@pingux/astro 2.203.0-alpha.0 → 2.205.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.
- package/lib/cjs/components/LinkSelectField/LinkSelectField.js +29 -10
- package/lib/cjs/components/LinkSelectField/LinkSelectField.stories.js +55 -1
- package/lib/cjs/components/LinkSelectField/LinkSelectField.test.js +33 -8
- package/lib/cjs/components/Stepper/Line.d.ts +7 -0
- package/lib/cjs/components/Stepper/Line.js +0 -5
- package/lib/cjs/components/Stepper/Step.d.ts +10 -0
- package/lib/cjs/components/Stepper/Step.js +6 -14
- package/lib/cjs/components/Stepper/Stepper.constants.d.ts +6 -0
- package/lib/cjs/components/Stepper/Stepper.d.ts +4 -0
- package/lib/cjs/components/Stepper/Stepper.js +15 -29
- package/lib/cjs/components/Stepper/Stepper.stories.js +2 -2
- package/lib/cjs/components/Stepper/Stepper.styles.d.ts +257 -0
- package/lib/cjs/components/Stepper/Stepper.test.js +18 -20
- package/lib/cjs/components/Stepper/index.d.ts +2 -0
- package/lib/cjs/styles/themeOverrides/onyxDarkUiLibraryOverride.js +3 -1
- package/lib/cjs/types/Stepper.d.ts +33 -0
- package/lib/cjs/types/Stepper.js +6 -0
- package/lib/cjs/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +20 -9
- package/lib/cjs/types/tabs.d.ts +2 -2
- package/lib/cjs/utils/devUtils/props/isValidPositiveInt.d.ts +2 -0
- package/lib/cjs/utils/devUtils/props/isValidPositiveInt.js +2 -1
- package/lib/components/LinkSelectField/LinkSelectField.js +29 -10
- package/lib/components/LinkSelectField/LinkSelectField.stories.js +55 -1
- package/lib/components/LinkSelectField/LinkSelectField.test.js +33 -8
- package/lib/components/Stepper/Line.js +0 -5
- package/lib/components/Stepper/Step.js +6 -14
- package/lib/components/Stepper/Stepper.js +17 -31
- package/lib/components/Stepper/Stepper.stories.js +2 -2
- package/lib/components/Stepper/Stepper.test.js +18 -20
- package/lib/styles/themeOverrides/onyxDarkUiLibraryOverride.js +3 -1
- package/lib/types/Stepper.js +1 -0
- package/lib/types/index.js +1 -0
- package/lib/utils/devUtils/props/isValidPositiveInt.js +2 -1
- package/package.json +1 -1
|
@@ -36,9 +36,10 @@ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymb
|
|
|
36
36
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
37
37
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
38
38
|
import { OverlayProvider } from 'react-aria';
|
|
39
|
+
import EarthIcon from '@pingux/mdi-react/EarthIcon';
|
|
39
40
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
40
41
|
import { getAllUsers } from '../../api/users';
|
|
41
|
-
import { Box, Item, LinkSelectField, Section } from '../../index';
|
|
42
|
+
import { Box, Button, Item, LinkSelectField, Section } from '../../index';
|
|
42
43
|
import { LIMIT } from '../../mocks/constants';
|
|
43
44
|
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
|
44
45
|
import { inputFieldAttributeBaseArgTypes } from '../../utils/docUtils/fieldAttributes';
|
|
@@ -85,6 +86,14 @@ export default {
|
|
|
85
86
|
isRequired: {},
|
|
86
87
|
selectedKey: {
|
|
87
88
|
control: false
|
|
89
|
+
},
|
|
90
|
+
iconProps: {
|
|
91
|
+
control: false,
|
|
92
|
+
description: 'Props object spread into the Icon inside the default trigger button. Supports icon, title, size, color, sx, and other IconProps. The sx prop is merged with the rotation style.'
|
|
93
|
+
},
|
|
94
|
+
trigger: {
|
|
95
|
+
control: false,
|
|
96
|
+
description: 'A ReactNode that replaces the default Button trigger entirely. When provided, the local Button element is not rendered.'
|
|
88
97
|
}
|
|
89
98
|
}, statusArgTypes), ariaAttributeBaseArgTypes), inputFieldAttributeBaseArgTypes),
|
|
90
99
|
args: {
|
|
@@ -343,4 +352,49 @@ WithPopoverWidth.parameters = {
|
|
|
343
352
|
story: 'The `popoverWidth` prop can be used to set a custom width for the dropdown/popover.'
|
|
344
353
|
}
|
|
345
354
|
}
|
|
355
|
+
};
|
|
356
|
+
export var WithIconProps = function WithIconProps() {
|
|
357
|
+
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(LinkSelectField, {
|
|
358
|
+
label: "What's your favorite color?",
|
|
359
|
+
iconProps: {
|
|
360
|
+
icon: EarthIcon,
|
|
361
|
+
sx: {
|
|
362
|
+
color: 'accent.40'
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}, ___EmotionJSX(Item, {
|
|
366
|
+
key: "red"
|
|
367
|
+
}, "Red"), ___EmotionJSX(Item, {
|
|
368
|
+
key: "blue"
|
|
369
|
+
}, "Blue"), ___EmotionJSX(Item, {
|
|
370
|
+
key: "yellow"
|
|
371
|
+
}, "Yellow")));
|
|
372
|
+
};
|
|
373
|
+
WithIconProps.parameters = {
|
|
374
|
+
docs: {
|
|
375
|
+
description: {
|
|
376
|
+
story: 'Use the `iconProps` prop to customize the icon inside the default trigger button. Here a different icon and custom `sx` color are passed via `iconProps`.'
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
export var WithCustomTrigger = function WithCustomTrigger() {
|
|
381
|
+
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(LinkSelectField, {
|
|
382
|
+
label: "What's your favorite color?",
|
|
383
|
+
trigger: ___EmotionJSX(Button, {
|
|
384
|
+
variant: "primary"
|
|
385
|
+
}, "Open menu")
|
|
386
|
+
}, ___EmotionJSX(Item, {
|
|
387
|
+
key: "red"
|
|
388
|
+
}, "Red"), ___EmotionJSX(Item, {
|
|
389
|
+
key: "blue"
|
|
390
|
+
}, "Blue"), ___EmotionJSX(Item, {
|
|
391
|
+
key: "yellow"
|
|
392
|
+
}, "Yellow")));
|
|
393
|
+
};
|
|
394
|
+
WithCustomTrigger.parameters = {
|
|
395
|
+
docs: {
|
|
396
|
+
description: {
|
|
397
|
+
story: 'Use the `trigger` prop to supply a fully custom ReactNode trigger, replacing the default `Button` element entirely.'
|
|
398
|
+
}
|
|
399
|
+
}
|
|
346
400
|
};
|
|
@@ -21,6 +21,7 @@ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present,
|
|
|
21
21
|
function _regeneratorDefine2(e, r, n, t) { var i = _Object$defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
22
22
|
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
23
23
|
import React from 'react';
|
|
24
|
+
import EarthIcon from '@pingux/mdi-react/EarthIcon';
|
|
24
25
|
import userEvent from '@testing-library/user-event';
|
|
25
26
|
import { Item, LinkSelectField } from '../../index';
|
|
26
27
|
import statuses from '../../utils/devUtils/constants/statuses';
|
|
@@ -228,23 +229,47 @@ test('passing helper text should display it and correct aria attributes on input
|
|
|
228
229
|
var helperTextID = helper.getAttribute('id');
|
|
229
230
|
expect(screen.getByRole('button')).toHaveAttribute('aria-describedby', helperTextID);
|
|
230
231
|
});
|
|
231
|
-
test('iconProps
|
|
232
|
-
var iconTestId = 'custom-icon';
|
|
232
|
+
test('iconProps data-testid is applied to the inner Icon element', function () {
|
|
233
233
|
getComponent({
|
|
234
234
|
iconProps: {
|
|
235
|
-
'data-testid':
|
|
235
|
+
'data-testid': 'custom-icon',
|
|
236
|
+
sx: {
|
|
237
|
+
color: 'red'
|
|
238
|
+
}
|
|
236
239
|
}
|
|
237
240
|
});
|
|
238
|
-
|
|
241
|
+
var icon = screen.getByTestId('custom-icon');
|
|
242
|
+
expect(icon).toBeInTheDocument();
|
|
243
|
+
expect(icon).toBeInstanceOf(SVGSVGElement);
|
|
239
244
|
});
|
|
240
|
-
test('
|
|
245
|
+
test('iconProps with a custom icon renders the substitute icon without throwing', function () {
|
|
241
246
|
getComponent({
|
|
242
|
-
|
|
243
|
-
|
|
247
|
+
iconProps: {
|
|
248
|
+
icon: EarthIcon
|
|
244
249
|
}
|
|
245
250
|
});
|
|
251
|
+
// The default trigger button is still present when only iconProps is provided
|
|
252
|
+
var button = screen.getByRole('button');
|
|
253
|
+
expect(button).toBeInTheDocument();
|
|
254
|
+
});
|
|
255
|
+
test('trigger prop replaces the default Button trigger', function () {
|
|
256
|
+
getComponent({
|
|
257
|
+
trigger: ___EmotionJSX("button", {
|
|
258
|
+
type: "button",
|
|
259
|
+
"data-testid": "custom-trigger"
|
|
260
|
+
}, "Custom")
|
|
261
|
+
});
|
|
262
|
+
expect(screen.getByTestId('custom-trigger')).toBeInTheDocument();
|
|
263
|
+
// The default Button trigger (identified by its pendo data attribute) should not be rendered
|
|
264
|
+
expect(document.querySelector('[data-pendo-id="LinkSelectField"]')).not.toBeInTheDocument();
|
|
265
|
+
});
|
|
266
|
+
test('default render is unchanged when neither iconProps nor trigger is provided', function () {
|
|
267
|
+
getComponent();
|
|
268
|
+
// The default trigger button is present via getByRole
|
|
246
269
|
var button = screen.getByRole('button');
|
|
247
|
-
expect(button).
|
|
270
|
+
expect(button).toBeInTheDocument();
|
|
271
|
+
// The default button has the pendo ID set by the component
|
|
272
|
+
expect(document.querySelector('[data-pendo-id="LinkSelectField"]')).toBeInTheDocument();
|
|
248
273
|
});
|
|
249
274
|
|
|
250
275
|
// Needs to be added to each components test file
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
|
2
1
|
/* istanbul ignore file */
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
3
|
import { useStatusClasses } from '../../hooks';
|
|
6
4
|
import Box from '../Box';
|
|
7
5
|
import { stepStatuses } from './Stepper.constants';
|
|
@@ -20,7 +18,4 @@ var Line = function Line(_ref) {
|
|
|
20
18
|
className: classNames
|
|
21
19
|
});
|
|
22
20
|
};
|
|
23
|
-
Line.propTypes = {
|
|
24
|
-
status: PropTypes.oneOf(_Object$values(stepStatuses))
|
|
25
|
-
};
|
|
26
21
|
export default Line;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
|
-
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
|
3
2
|
import React, { forwardRef } from 'react';
|
|
4
3
|
import CheckBoldIcon from '@pingux/mdi-react/CheckBoldIcon';
|
|
5
4
|
import { useHover } from '@react-aria/interactions';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
5
|
import { Box, Icon } from '../../index';
|
|
8
6
|
import ORIENTATION from '../../utils/devUtils/constants/orientation';
|
|
9
7
|
import { stepStatuses } from './Stepper.constants';
|
|
@@ -11,11 +9,13 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
11
9
|
var COMPLETED = stepStatuses.COMPLETED,
|
|
12
10
|
INACTIVE = stepStatuses.INACTIVE;
|
|
13
11
|
var Step = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
14
|
-
var status = props.status,
|
|
15
|
-
|
|
12
|
+
var _props$status = props.status,
|
|
13
|
+
status = _props$status === void 0 ? INACTIVE : _props$status,
|
|
14
|
+
_props$value = props.value,
|
|
15
|
+
value = _props$value === void 0 ? 0 : _props$value,
|
|
16
16
|
className = props.className,
|
|
17
17
|
orientation = props.orientation;
|
|
18
|
-
var _useHover = useHover(
|
|
18
|
+
var _useHover = useHover({}),
|
|
19
19
|
hoverProps = _useHover.hoverProps,
|
|
20
20
|
isHovered = _useHover.isHovered;
|
|
21
21
|
var stepValue = orientation !== ORIENTATION.VERTICAL && value;
|
|
@@ -33,13 +33,5 @@ var Step = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
33
33
|
}
|
|
34
34
|
}) : stepValue);
|
|
35
35
|
});
|
|
36
|
-
Step.
|
|
37
|
-
status: PropTypes.oneOf(_Object$values(stepStatuses)),
|
|
38
|
-
value: PropTypes.number,
|
|
39
|
-
orientation: PropTypes.oneOf([ORIENTATION.VERTICAL, ORIENTATION.HORIZONTAL])
|
|
40
|
-
};
|
|
41
|
-
Step.defaultProps = {
|
|
42
|
-
status: INACTIVE,
|
|
43
|
-
value: 0
|
|
44
|
-
};
|
|
36
|
+
Step.displayName = 'Step';
|
|
45
37
|
export default Step;
|
|
@@ -18,11 +18,11 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
|
18
18
|
/* istanbul ignore file */
|
|
19
19
|
import React, { forwardRef } from 'react';
|
|
20
20
|
import { useSingleSelectListState } from '@react-stately/list';
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
import { useStatusClasses } from '../../hooks';
|
|
21
|
+
import { Box, Step, Tabs, Text } from '../..';
|
|
22
|
+
import { useLocalOrForwardRef, useStatusClasses } from '../../hooks';
|
|
24
23
|
import ORIENTATION from '../../utils/devUtils/constants/orientation';
|
|
25
24
|
import isValidPositiveInt from '../../utils/devUtils/props/isValidPositiveInt';
|
|
25
|
+
import Tab from '../Tab';
|
|
26
26
|
import Line from './Line';
|
|
27
27
|
import { stepStatuses } from './Stepper.constants';
|
|
28
28
|
import { verticalLine } from './Stepper.styles';
|
|
@@ -39,6 +39,15 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
39
39
|
orientation = props.orientation,
|
|
40
40
|
className = props.className,
|
|
41
41
|
others = _objectWithoutProperties(props, _excluded);
|
|
42
|
+
var stepperRef = useLocalOrForwardRef(ref);
|
|
43
|
+
if (process.env.NODE_ENV !== 'production' && props.activeStep !== undefined) {
|
|
44
|
+
var validationError = isValidPositiveInt({
|
|
45
|
+
activeStep: props.activeStep
|
|
46
|
+
}, 'activeStep', 'Stepper');
|
|
47
|
+
if (validationError) {
|
|
48
|
+
console.error(validationError.message);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
42
51
|
var state = useSingleSelectListState(props);
|
|
43
52
|
var getStatus = function getStatus(i) {
|
|
44
53
|
if (i === activeStep) {
|
|
@@ -51,7 +60,7 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
51
60
|
};
|
|
52
61
|
var onStepChangeHandler = function onStepChangeHandler(key) {
|
|
53
62
|
if (onStepChange) {
|
|
54
|
-
onStepChange(
|
|
63
|
+
onStepChange(Number(key));
|
|
55
64
|
}
|
|
56
65
|
};
|
|
57
66
|
var _useStatusClasses = useStatusClasses(className, {
|
|
@@ -97,7 +106,8 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
97
106
|
|
|
98
107
|
/* istanbul ignore next */
|
|
99
108
|
var textValue = item && item.value && item.value.label || item.textValue || stepIndex.toString();
|
|
100
|
-
var
|
|
109
|
+
var TabItem = Tab;
|
|
110
|
+
var container = ___EmotionJSX(TabItem, {
|
|
101
111
|
key: stepIndex,
|
|
102
112
|
variant: "stepper.tab",
|
|
103
113
|
tabLineProps: {
|
|
@@ -112,13 +122,13 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
112
122
|
content: item.rendered,
|
|
113
123
|
separator: !isFirst && orientation === ORIENTATION.HORIZONTAL && !isFirst && line,
|
|
114
124
|
tooltipTriggerProps: tooltipProps,
|
|
115
|
-
sx: i !== steps.length - 1 && orientation === ORIENTATION.VERTICAL
|
|
125
|
+
sx: i !== steps.length - 1 && orientation === ORIENTATION.VERTICAL ? verticalLine : undefined
|
|
116
126
|
});
|
|
117
127
|
isFirst = isFirst && !container;
|
|
118
128
|
return container;
|
|
119
129
|
});
|
|
120
130
|
return ___EmotionJSX(Tabs, _extends({
|
|
121
|
-
ref:
|
|
131
|
+
ref: stepperRef,
|
|
122
132
|
variant: "stepper.wrapper",
|
|
123
133
|
tabListProps: _objectSpread({
|
|
124
134
|
variant: 'stepper.tabs',
|
|
@@ -130,30 +140,6 @@ var Stepper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
130
140
|
orientation: orientation
|
|
131
141
|
}, others), render);
|
|
132
142
|
});
|
|
133
|
-
Stepper.propTypes = {
|
|
134
|
-
/**
|
|
135
|
-
* *For performance reasons,
|
|
136
|
-
use this prop instead of Array.map when iteratively rendering Items*.
|
|
137
|
-
* For use with [dynamic collections](https://react-spectrum.adobe.com/react-stately/collections.html#dynamic-collections).
|
|
138
|
-
*/
|
|
139
|
-
items: PropTypes.arrayOf(PropTypes.shape({
|
|
140
|
-
/** The primary option for the tooltip label. */
|
|
141
|
-
label: PropTypes.string,
|
|
142
|
-
children: PropTypes.node,
|
|
143
|
-
name: PropTypes.string
|
|
144
|
-
})),
|
|
145
|
-
/** The number of the current step (using one-based indexing) */
|
|
146
|
-
activeStep: isValidPositiveInt,
|
|
147
|
-
/**
|
|
148
|
-
* Handler that is called when the current step changes
|
|
149
|
-
* `(index: number) => void`
|
|
150
|
-
*/
|
|
151
|
-
onStepChange: PropTypes.func,
|
|
152
|
-
/** A props object that is subsequently spread into the rendered tablist. */
|
|
153
|
-
tabListProps: PropTypes.shape({}),
|
|
154
|
-
tooltipProps: PropTypes.shape({}),
|
|
155
|
-
orientation: PropTypes.oneOf(['vertical', 'horizontal'])
|
|
156
|
-
};
|
|
157
143
|
Stepper.displayName = 'Stepper';
|
|
158
144
|
Stepper.defaultProps = {
|
|
159
145
|
orientation: 'horizontal'
|
|
@@ -5,7 +5,7 @@ import CreationOutlineIcon from '@pingux/mdi-react/CreationOutlineIcon';
|
|
|
5
5
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
6
6
|
import { useOverlayPanelState } from '../../hooks';
|
|
7
7
|
import { Box, Button, Item, OverlayPanel, OverlayProvider, PanelHeader, PanelHeaderCloseButton, Stepper, Text } from '../../index';
|
|
8
|
-
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks
|
|
8
|
+
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
|
9
9
|
import StepperReadme from './Stepper.mdx';
|
|
10
10
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
11
11
|
export default {
|
|
@@ -236,7 +236,7 @@ export var Panel = function Panel() {
|
|
|
236
236
|
var _useOverlayPanelState = useOverlayPanelState(),
|
|
237
237
|
state = _useOverlayPanelState.state,
|
|
238
238
|
onClose = _useOverlayPanelState.onClose;
|
|
239
|
-
var triggerRef = useRef
|
|
239
|
+
var triggerRef = useRef(null);
|
|
240
240
|
var onCloseHandler = function onCloseHandler() {
|
|
241
241
|
return onClose(state, triggerRef);
|
|
242
242
|
};
|
|
@@ -61,34 +61,31 @@ var defaultProps = {
|
|
|
61
61
|
activeStep: 1,
|
|
62
62
|
items: steps
|
|
63
63
|
};
|
|
64
|
+
|
|
65
|
+
// StepperProps.children is ReactNode (from BoxProps), but Stepper also accepts a render-prop
|
|
66
|
+
// function via react-stately's collection mechanism. We cast to silence the assignability error.
|
|
67
|
+
var stepperChildren = function stepperChildren(_ref) {
|
|
68
|
+
var name = _ref.name,
|
|
69
|
+
children = _ref.children;
|
|
70
|
+
return ___EmotionJSX(Item, {
|
|
71
|
+
key: name || children,
|
|
72
|
+
textValue: name || children
|
|
73
|
+
}, ___EmotionJSX(Text, null, children));
|
|
74
|
+
};
|
|
64
75
|
var getComponent = function getComponent() {
|
|
65
76
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
renderFn =
|
|
77
|
+
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
78
|
+
_ref2$renderFn = _ref2.renderFn,
|
|
79
|
+
renderFn = _ref2$renderFn === void 0 ? render : _ref2$renderFn;
|
|
69
80
|
return renderFn(___EmotionJSX(CacheProvider, {
|
|
70
81
|
value: emotionCache
|
|
71
|
-
}, ___EmotionJSX(Stepper, _extends({}, defaultProps, props),
|
|
72
|
-
var name = _ref2.name,
|
|
73
|
-
children = _ref2.children;
|
|
74
|
-
return ___EmotionJSX(Item, {
|
|
75
|
-
key: name || children,
|
|
76
|
-
textValue: name || children
|
|
77
|
-
}, ___EmotionJSX(Text, null, children));
|
|
78
|
-
})));
|
|
82
|
+
}, ___EmotionJSX(Stepper, _extends({}, defaultProps, props), stepperChildren)));
|
|
79
83
|
};
|
|
80
84
|
|
|
81
85
|
// Needs to be added to each components test file
|
|
82
86
|
universalComponentTests({
|
|
83
87
|
renderComponent: function renderComponent(props) {
|
|
84
|
-
return ___EmotionJSX(Stepper, _extends({}, defaultProps, props),
|
|
85
|
-
var name = _ref3.name,
|
|
86
|
-
children = _ref3.children;
|
|
87
|
-
return ___EmotionJSX(Item, {
|
|
88
|
-
key: name || children,
|
|
89
|
-
textValue: name || children
|
|
90
|
-
}, ___EmotionJSX(Text, null, children));
|
|
91
|
-
});
|
|
88
|
+
return ___EmotionJSX(Stepper, _extends({}, defaultProps, props), stepperChildren);
|
|
92
89
|
}
|
|
93
90
|
});
|
|
94
91
|
test('renders Stepper component in the default state', function () {
|
|
@@ -162,8 +159,9 @@ test('tooltip renders expected content based on props', /*#__PURE__*/_asyncToGen
|
|
|
162
159
|
fireEvent.mouseMove(tab0);
|
|
163
160
|
fireEvent.mouseEnter(tab0);
|
|
164
161
|
_setTimeout(function () {
|
|
162
|
+
var _steps$0$label;
|
|
165
163
|
expect(screen.queryByRole('tooltip')).toBeInTheDocument();
|
|
166
|
-
expect(screen.queryByRole('tooltip')).toHaveTextContent(steps[0].label);
|
|
164
|
+
expect(screen.queryByRole('tooltip')).toHaveTextContent((_steps$0$label = steps[0].label) !== null && _steps$0$label !== void 0 ? _steps$0$label : '');
|
|
167
165
|
}, 0);
|
|
168
166
|
|
|
169
167
|
// Should render textValue
|
|
@@ -111,7 +111,9 @@ var forms = {
|
|
|
111
111
|
'& input[type=search]': _objectSpread(_objectSpread({}, theme.text.inputValue), {}, {
|
|
112
112
|
borderColor: astroTokensDark.color.gray[500],
|
|
113
113
|
fontSize: '15px',
|
|
114
|
-
bg:
|
|
114
|
+
bg: astroTokensDark.color.gray[900],
|
|
115
|
+
height: '50px',
|
|
116
|
+
borderRadius: '4px',
|
|
115
117
|
'::placeholder': _objectSpread(_objectSpread({}, theme.text.placeholder), {}, {
|
|
116
118
|
fontStyle: 'unset',
|
|
117
119
|
fontSize: '15px'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/types/index.js
CHANGED
|
@@ -12,7 +12,8 @@ var validatePositiveInteger = function validatePositiveInteger() {
|
|
|
12
12
|
var isPositiveInteger = isWithinRange(1, Infinity);
|
|
13
13
|
if (props[propName] && !isPositiveInteger(props[propName])) {
|
|
14
14
|
var _context, _context2;
|
|
15
|
-
|
|
15
|
+
var received = props[propName];
|
|
16
|
+
return new Error(_concatInstanceProperty(_context = _concatInstanceProperty(_context2 = "Expected a positive integer for ".concat(propName, " in ")).call(_context2, componentName, ", but instead received `")).call(_context, received, "`."));
|
|
16
17
|
}
|
|
17
18
|
// Everything is fine
|
|
18
19
|
return null;
|