@pingux/astro 2.40.1 → 2.41.0-alpha.1
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/Callout/Callout.mdx +1 -1
- package/lib/cjs/components/Callout/Callout.stories.d.ts +10 -0
- package/lib/cjs/components/Callout/Callout.stories.js +38 -25
- package/lib/cjs/components/Link/Link.d.ts +4 -0
- package/lib/cjs/components/Link/Link.js +3 -20
- package/lib/cjs/components/Link/Link.stories.d.ts +5 -0
- package/lib/cjs/components/Link/Link.stories.js +1 -1
- package/lib/cjs/components/Link/Link.styles.d.ts +76 -0
- package/lib/cjs/components/Link/Link.test.d.ts +1 -0
- package/lib/cjs/components/Link/index.d.ts +1 -0
- package/lib/cjs/components/Separator/Separator.d.ts +4 -0
- package/lib/cjs/components/Separator/Separator.js +4 -10
- package/lib/cjs/components/Separator/Separator.stories.d.ts +7 -0
- package/lib/cjs/components/Separator/Separator.stories.js +1 -1
- package/lib/cjs/components/Separator/Separator.styles.d.ts +44 -0
- package/lib/cjs/components/Separator/Separator.test.d.ts +1 -0
- package/lib/cjs/components/Separator/Separator.test.js +36 -10
- package/lib/cjs/components/Separator/index.d.ts +1 -0
- package/lib/cjs/types/index.d.ts +2 -0
- package/lib/cjs/types/index.js +28 -6
- package/lib/cjs/types/link.d.ts +22 -0
- package/lib/cjs/types/link.js +6 -0
- package/lib/cjs/types/separator.d.ts +4 -0
- package/lib/cjs/types/separator.js +6 -0
- package/lib/cjs/types/shared/index.d.ts +1 -0
- package/lib/cjs/types/shared/index.js +14 -3
- package/lib/cjs/types/shared/orientation.d.ts +4 -0
- package/lib/cjs/types/shared/orientation.js +6 -0
- package/lib/cjs/utils/designUtils/figmaLinks.d.ts +4 -0
- package/lib/cjs/utils/designUtils/figmaLinks.js +5 -1
- package/lib/components/Callout/Callout.mdx +1 -1
- package/lib/components/Callout/Callout.stories.js +33 -21
- package/lib/components/Link/Link.js +3 -20
- package/lib/components/Link/Link.stories.js +1 -1
- package/lib/components/Separator/Separator.js +4 -10
- package/lib/components/Separator/Separator.stories.js +1 -1
- package/lib/components/Separator/Separator.test.js +34 -8
- package/lib/types/index.js +2 -0
- package/lib/types/link.js +1 -0
- package/lib/types/separator.js +1 -0
- package/lib/types/shared/index.js +1 -0
- package/lib/types/shared/orientation.js +1 -0
- package/lib/utils/designUtils/figmaLinks.js +5 -1
- package/package.json +1 -1
@@ -9,7 +9,7 @@ Callouts should contain only 1 or 2 pieces of information and display at the top
|
|
9
9
|
|
10
10
|
### Required components
|
11
11
|
|
12
|
-
This component requires the [
|
12
|
+
This component requires the [Text](./?path=/docs/components-text--default) component.
|
13
13
|
|
14
14
|
### Accessibility
|
15
15
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import React from 'react';
|
1
2
|
import { StoryFn } from '@storybook/react';
|
2
3
|
import { CalloutProps } from '../../types/callout';
|
3
4
|
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
@@ -5,4 +6,13 @@ export default _default;
|
|
5
6
|
export declare const Default: StoryFn<CalloutProps>;
|
6
7
|
export declare const ErrorStatus: StoryFn;
|
7
8
|
export declare const Success: StoryFn;
|
9
|
+
export declare const WithLink: {
|
10
|
+
(args: any): React.JSX.Element;
|
11
|
+
parameters: {
|
12
|
+
design: {
|
13
|
+
type: string;
|
14
|
+
url: string;
|
15
|
+
};
|
16
|
+
};
|
17
|
+
};
|
8
18
|
export declare const Warning: StoryFn;
|
@@ -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.Warning = exports.Success = exports.ErrorStatus = exports.Default = void 0;
|
15
|
+
exports["default"] = exports.WithLink = exports.Warning = exports.Success = exports.ErrorStatus = exports.Default = void 0;
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
17
17
|
var _react = _interopRequireDefault(require("react"));
|
18
18
|
var _storybookAddonDesigns = require("storybook-addon-designs");
|
@@ -43,12 +43,7 @@ var _default = {
|
|
43
43
|
}; // main
|
44
44
|
exports["default"] = _default;
|
45
45
|
var Default = function Default(args) {
|
46
|
-
return (0, _react2.jsx)(_index.Callout, args, (0, _react2.jsx)(_index.Text, null, "
|
47
|
-
href: "https://pingidentity.com",
|
48
|
-
target: "_blank",
|
49
|
-
"aria-label": "".concat(_statuses["default"].DEFAULT, "-callout"),
|
50
|
-
variant: "app"
|
51
|
-
}, ' ', "Read More")));
|
46
|
+
return (0, _react2.jsx)(_index.Callout, args, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae lacinia diam, nec ullamcorper neque. In egestas dui vel dolor tincidunt, sit amet ullamcorper leo consequat."));
|
52
47
|
};
|
53
48
|
exports.Default = Default;
|
54
49
|
Default.parameters = {
|
@@ -60,36 +55,54 @@ Default.parameters = {
|
|
60
55
|
var ErrorStatus = function ErrorStatus() {
|
61
56
|
return (0, _react2.jsx)(_index.Callout, {
|
62
57
|
status: _statuses["default"].ERROR
|
63
|
-
}, (0, _react2.jsx)(_index.Text, null, "
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
58
|
+
}, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae lacinia diam, nec ullamcorper neque. In egestas dui vel dolor tincidunt, sit amet ullamcorper leo consequat. Etiam at urna erat."));
|
59
|
+
};
|
60
|
+
exports.ErrorStatus = ErrorStatus;
|
61
|
+
ErrorStatus.parameters = {
|
62
|
+
design: {
|
63
|
+
type: 'figma',
|
64
|
+
url: _figmaLinks.FIGMA_LINKS.callout.errorStatus
|
65
|
+
}
|
69
66
|
};
|
70
67
|
|
71
68
|
// Avoiding using Error as the function name due to it being a JS built-in method
|
72
|
-
exports.ErrorStatus = ErrorStatus;
|
73
69
|
ErrorStatus.storyName = 'Error';
|
74
70
|
var Success = function Success() {
|
75
71
|
return (0, _react2.jsx)(_index.Callout, {
|
76
72
|
status: _statuses["default"].SUCCESS
|
77
|
-
}, (0, _react2.jsx)(_index.Text, null, "
|
73
|
+
}, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae lacinia diam, nec ullamcorper neque. In egestas dui vel dolor tincidunt, sit amet ullamcorper leo consequat."));
|
74
|
+
};
|
75
|
+
exports.Success = Success;
|
76
|
+
Success.parameters = {
|
77
|
+
design: {
|
78
|
+
type: 'figma',
|
79
|
+
url: _figmaLinks.FIGMA_LINKS.callout.success
|
80
|
+
}
|
81
|
+
};
|
82
|
+
var WithLink = function WithLink(args) {
|
83
|
+
return (0, _react2.jsx)(_index.Callout, args, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae lacinia diam, nec ullamcorper neque. In egestas dui vel dolor tincidunt, sit amet ullamcorper leo consequat.", ' ', (0, _react2.jsx)(_index.Link, {
|
78
84
|
href: "https://pingidentity.com",
|
79
85
|
target: "_blank",
|
80
|
-
"aria-label": "".concat(_statuses["default"].
|
86
|
+
"aria-label": "".concat(_statuses["default"].DEFAULT, "-callout"),
|
81
87
|
variant: "app"
|
82
|
-
},
|
88
|
+
}, "Learn More")));
|
89
|
+
};
|
90
|
+
exports.WithLink = WithLink;
|
91
|
+
WithLink.parameters = {
|
92
|
+
design: {
|
93
|
+
type: 'figma',
|
94
|
+
url: _figmaLinks.FIGMA_LINKS.callout.withLink
|
95
|
+
}
|
83
96
|
};
|
84
|
-
exports.Success = Success;
|
85
97
|
var Warning = function Warning() {
|
86
98
|
return (0, _react2.jsx)(_index.Callout, {
|
87
99
|
status: _statuses["default"].WARNING
|
88
|
-
}, (0, _react2.jsx)(_index.Text, null, "
|
89
|
-
href: "https://pingidentity.com",
|
90
|
-
target: "_blank",
|
91
|
-
"aria-label": "".concat(_statuses["default"].WARNING, "-callout"),
|
92
|
-
variant: "app"
|
93
|
-
}, ' ', "Read More")));
|
100
|
+
}, (0, _react2.jsx)(_index.Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae lacinia diam, nec ullamcorper neque. In egestas dui vel dolor tincidunt, sit amet ullamcorper leo consequat."));
|
94
101
|
};
|
95
|
-
exports.Warning = Warning;
|
102
|
+
exports.Warning = Warning;
|
103
|
+
Warning.parameters = {
|
104
|
+
design: {
|
105
|
+
type: 'figma',
|
106
|
+
url: _figmaLinks.FIGMA_LINKS.callout.warning
|
107
|
+
}
|
108
|
+
};
|
@@ -14,7 +14,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-c
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
15
15
|
var _reactAria = require("react-aria");
|
16
16
|
var _interactions = require("@react-aria/interactions");
|
17
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
18
17
|
var _themeUi = require("theme-ui");
|
19
18
|
var _hooks = require("../../hooks");
|
20
19
|
var _react2 = require("@emotion/react");
|
@@ -27,7 +26,7 @@ var Link = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
27
26
|
onPress = props.onPress,
|
28
27
|
isSafariCompatible = props.isSafariCompatible,
|
29
28
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
30
|
-
var linkRef = (0, _react.useRef)();
|
29
|
+
var linkRef = (0, _react.useRef)(null);
|
31
30
|
(0, _hooks.usePropWarning)(props, 'disabled', 'isDisabled');
|
32
31
|
/* istanbul ignore next */
|
33
32
|
(0, _react.useImperativeHandle)(ref, function () {
|
@@ -68,26 +67,10 @@ var Link = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
68
67
|
role: "link"
|
69
68
|
}, others, (0, _reactAria.mergeProps)(hoverProps, pressProps, linkProps, focusProps)));
|
70
69
|
});
|
71
|
-
Link.propTypes = {
|
72
|
-
/** Whether the link is disabled. */
|
73
|
-
isDisabled: _propTypes["default"].bool,
|
74
|
-
/** The HTML element used to render the link, e.g. 'a', or 'span'. */
|
75
|
-
as: _propTypes["default"].string,
|
76
|
-
/** Handler that is called when the press is released over the target. */
|
77
|
-
onPress: _propTypes["default"].func,
|
78
|
-
/** Specifies the location of the URL */
|
79
|
-
href: _propTypes["default"].string,
|
80
|
-
/** Specifies the window where the linked page is loaded */
|
81
|
-
target: _propTypes["default"].string,
|
82
|
-
/** The styling variation of the link. */
|
83
|
-
variant: _propTypes["default"].string,
|
84
|
-
/** Whether the link is clickable inside a popover in safari */
|
85
|
-
isSafariCompatible: _propTypes["default"].bool
|
86
|
-
};
|
87
70
|
Link.defaultProps = {
|
88
71
|
isDisabled: false,
|
89
|
-
|
90
|
-
|
72
|
+
variant: 'app',
|
73
|
+
as: 'a'
|
91
74
|
};
|
92
75
|
Link.displayName = 'Link';
|
93
76
|
var _default = Link;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { StoryFn } from '@storybook/react';
|
2
|
+
import { LinkProps } from '../../types/link';
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
4
|
+
export default _default;
|
5
|
+
export declare const Default: StoryFn<LinkProps>;
|
@@ -13,7 +13,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
var _storybookAddonDesigns = require("storybook-addon-designs");
|
14
14
|
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
15
15
|
var _index = require("../../index");
|
16
|
-
var _figmaLinks = require("../../utils/designUtils/figmaLinks
|
16
|
+
var _figmaLinks = require("../../utils/designUtils/figmaLinks");
|
17
17
|
var _htmlElements = require("../../utils/devUtils/constants/htmlElements");
|
18
18
|
var _Link = _interopRequireDefault(require("./Link.mdx"));
|
19
19
|
var _Link2 = _interopRequireDefault(require("./Link.styles"));
|
@@ -0,0 +1,76 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
app: {
|
3
|
+
color: string;
|
4
|
+
fontFamily: string;
|
5
|
+
fontSize: string;
|
6
|
+
textDecoration: string;
|
7
|
+
outline: string;
|
8
|
+
'&.is-hovered': {
|
9
|
+
textDecoration: string;
|
10
|
+
};
|
11
|
+
'&.is-focused': {
|
12
|
+
boxShadow: string;
|
13
|
+
outline: string;
|
14
|
+
outlineColor: string;
|
15
|
+
outlineOffset: string;
|
16
|
+
};
|
17
|
+
'&.is-pressed': {
|
18
|
+
color: string;
|
19
|
+
textDecoration: string;
|
20
|
+
};
|
21
|
+
'&.is-disabled': {
|
22
|
+
pointerEvents: string;
|
23
|
+
};
|
24
|
+
};
|
25
|
+
popover: {
|
26
|
+
color: string;
|
27
|
+
fontSize: string;
|
28
|
+
fontWeight: number;
|
29
|
+
textDecoration: string;
|
30
|
+
'&.is-hovered': {
|
31
|
+
cursor: string;
|
32
|
+
};
|
33
|
+
fontFamily: string;
|
34
|
+
outline: string;
|
35
|
+
'&.is-focused': {
|
36
|
+
boxShadow: string;
|
37
|
+
outline: string;
|
38
|
+
outlineColor: string;
|
39
|
+
outlineOffset: string;
|
40
|
+
};
|
41
|
+
'&.is-pressed': {
|
42
|
+
color: string;
|
43
|
+
textDecoration: string;
|
44
|
+
};
|
45
|
+
'&.is-disabled': {
|
46
|
+
pointerEvents: string;
|
47
|
+
};
|
48
|
+
};
|
49
|
+
web: {
|
50
|
+
textDecoration: string;
|
51
|
+
'&:visited': {
|
52
|
+
color: string;
|
53
|
+
};
|
54
|
+
'&.is-focused': {
|
55
|
+
boxShadow: string;
|
56
|
+
outline: string;
|
57
|
+
outlineColor: string;
|
58
|
+
outlineOffset: string;
|
59
|
+
};
|
60
|
+
color: string;
|
61
|
+
fontFamily: string;
|
62
|
+
fontSize: string;
|
63
|
+
outline: string;
|
64
|
+
'&.is-hovered': {
|
65
|
+
textDecoration: string;
|
66
|
+
};
|
67
|
+
'&.is-pressed': {
|
68
|
+
color: string;
|
69
|
+
textDecoration: string;
|
70
|
+
};
|
71
|
+
'&.is-disabled': {
|
72
|
+
pointerEvents: string;
|
73
|
+
};
|
74
|
+
};
|
75
|
+
};
|
76
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './Link';
|
@@ -13,7 +13,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/e
|
|
13
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
15
15
|
var _reactAria = require("react-aria");
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
17
16
|
var _hooks = require("../../hooks");
|
18
17
|
var _orientation = _interopRequireDefault(require("../../utils/devUtils/constants/orientation"));
|
19
18
|
var _Box = _interopRequireDefault(require("../Box/Box"));
|
@@ -25,7 +24,7 @@ var Separator = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
25
24
|
var className = props.className,
|
26
25
|
orientation = props.orientation,
|
27
26
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
28
|
-
var _useSeparator = (0, _reactAria.useSeparator)(props
|
27
|
+
var _useSeparator = (0, _reactAria.useSeparator)(props),
|
29
28
|
separatorProps = _useSeparator.separatorProps;
|
30
29
|
var _useStatusClasses = (0, _hooks.useStatusClasses)(className, {
|
31
30
|
'is-vertical': orientation === _orientation["default"].VERTICAL,
|
@@ -36,15 +35,10 @@ var Separator = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
36
35
|
ref: ref,
|
37
36
|
className: classNames,
|
38
37
|
variant: "separator.base"
|
39
|
-
}, others, separatorProps
|
38
|
+
}, others, separatorProps, {
|
39
|
+
role: "separator"
|
40
|
+
}));
|
40
41
|
});
|
41
|
-
Separator.propTypes = {
|
42
|
-
/** Sets horizontal or vertical orientation of the divider. If
|
43
|
-
* vertical orientation is specified, the parent container must have the following styles:
|
44
|
-
* a defined height, flexDirection="row" alignItems="center"
|
45
|
-
*/
|
46
|
-
orientation: _propTypes["default"].oneOf(['vertical', 'horizontal'])
|
47
|
-
};
|
48
42
|
Separator.defaultProps = {
|
49
43
|
orientation: 'horizontal'
|
50
44
|
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { StoryFn } from '@storybook/react';
|
3
|
+
import { SeparatorProps } from '../../types';
|
4
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("@storybook/types").Args>;
|
5
|
+
export default _default;
|
6
|
+
export declare const Default: StoryFn<SeparatorProps>;
|
7
|
+
export declare const verticalSeparator: () => React.JSX.Element;
|
@@ -12,7 +12,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _storybookAddonDesigns = require("storybook-addon-designs");
|
13
13
|
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
14
14
|
var _index = require("../../index");
|
15
|
-
var _figmaLinks = require("../../utils/designUtils/figmaLinks
|
15
|
+
var _figmaLinks = require("../../utils/designUtils/figmaLinks");
|
16
16
|
var _Separator = _interopRequireDefault(require("./Separator.mdx"));
|
17
17
|
var _react2 = require("@emotion/react");
|
18
18
|
var _default = {
|
@@ -0,0 +1,44 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
base: {
|
3
|
+
bg: string;
|
4
|
+
width: string;
|
5
|
+
height: string;
|
6
|
+
my: string;
|
7
|
+
flexShrink: number;
|
8
|
+
'&.is-vertical': {
|
9
|
+
width: string;
|
10
|
+
height: string;
|
11
|
+
mx: string;
|
12
|
+
};
|
13
|
+
};
|
14
|
+
navBarSeparator: {
|
15
|
+
width: string;
|
16
|
+
my: string;
|
17
|
+
mx: string;
|
18
|
+
backgroundColor: string;
|
19
|
+
bg: string;
|
20
|
+
height: string;
|
21
|
+
flexShrink: number;
|
22
|
+
'&.is-vertical': {
|
23
|
+
width: string;
|
24
|
+
height: string;
|
25
|
+
mx: string;
|
26
|
+
};
|
27
|
+
};
|
28
|
+
navBarSubtitleSeparator: {
|
29
|
+
ml: string;
|
30
|
+
width: string;
|
31
|
+
my: string;
|
32
|
+
mx: string;
|
33
|
+
backgroundColor: string;
|
34
|
+
bg: string;
|
35
|
+
height: string;
|
36
|
+
flexShrink: number;
|
37
|
+
'&.is-vertical': {
|
38
|
+
width: string;
|
39
|
+
height: string;
|
40
|
+
mx: string;
|
41
|
+
};
|
42
|
+
};
|
43
|
+
};
|
44
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -3,29 +3,55 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
4
4
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
5
5
|
var _react = _interopRequireDefault(require("react"));
|
6
|
+
var _orientation = _interopRequireDefault(require("../../utils/devUtils/constants/orientation"));
|
6
7
|
var _testWrapper = require("../../utils/testUtils/testWrapper");
|
7
8
|
var _universalComponentTest = require("../../utils/testUtils/universalComponentTest");
|
8
|
-
var
|
9
|
+
var _ = _interopRequireDefault(require("."));
|
9
10
|
var _react2 = require("@emotion/react");
|
10
11
|
var testId = 'test-separator';
|
11
12
|
var defaultProps = {
|
12
|
-
'data-testid': testId
|
13
|
+
'data-testid': testId,
|
14
|
+
'orientation': 'horizontal'
|
13
15
|
};
|
14
16
|
var getComponent = function getComponent() {
|
15
17
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
16
|
-
return (0, _testWrapper.render)((0, _react2.jsx)(
|
18
|
+
return (0, _testWrapper.render)((0, _react2.jsx)(_["default"], (0, _extends2["default"])({}, defaultProps, props)));
|
17
19
|
};
|
18
20
|
|
19
21
|
// Needs to be added to each components test file
|
20
22
|
(0, _universalComponentTest.universalComponentTests)({
|
21
23
|
renderComponent: function renderComponent(props) {
|
22
|
-
return (0, _react2.jsx)(
|
24
|
+
return (0, _react2.jsx)(_["default"], (0, _extends2["default"])({}, defaultProps, props));
|
23
25
|
}
|
24
26
|
});
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
describe('Separator component', function () {
|
28
|
+
test('renders Separator component', function () {
|
29
|
+
getComponent();
|
30
|
+
var separator = _testWrapper.screen.getByTestId(testId);
|
31
|
+
_testWrapper.screen.getByRole('separator');
|
32
|
+
expect(separator).toBeInstanceOf(HTMLDivElement);
|
33
|
+
expect(separator).toBeInTheDocument();
|
34
|
+
expect(separator).toHaveClass('is-horizontal');
|
35
|
+
});
|
36
|
+
test('Separator as a horizontal', function () {
|
37
|
+
getComponent({
|
38
|
+
orientation: 'horizontal'
|
39
|
+
});
|
40
|
+
var separator = _testWrapper.screen.getByTestId(testId);
|
41
|
+
expect(separator).toHaveClass('is-horizontal');
|
42
|
+
});
|
43
|
+
test('Separator vertical orientation', function () {
|
44
|
+
getComponent({
|
45
|
+
orientation: 'vertical'
|
46
|
+
});
|
47
|
+
var separator = _testWrapper.screen.getByTestId(testId);
|
48
|
+
expect(separator).toHaveAttribute('aria-orientation', _orientation["default"].VERTICAL);
|
49
|
+
});
|
50
|
+
test('applies custom className if provided', function () {
|
51
|
+
getComponent({
|
52
|
+
className: 'custom-class'
|
53
|
+
});
|
54
|
+
var separator = _testWrapper.screen.getByTestId(testId);
|
55
|
+
expect(separator).toHaveClass('custom-class');
|
56
|
+
});
|
31
57
|
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './Separator';
|
package/lib/cjs/types/index.d.ts
CHANGED
@@ -3,8 +3,10 @@ export * from './box';
|
|
3
3
|
export * from './button';
|
4
4
|
export * from './icon';
|
5
5
|
export * from './item';
|
6
|
+
export * from './link';
|
6
7
|
export * from './loader';
|
7
8
|
export * from './popoverContainer';
|
9
|
+
export * from './separator';
|
8
10
|
export * from './shared';
|
9
11
|
export * from './tableCell';
|
10
12
|
export * from './text';
|
package/lib/cjs/types/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10;
|
3
|
+
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12;
|
4
4
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
5
5
|
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
6
6
|
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
@@ -62,8 +62,19 @@ _forEachInstanceProperty(_context5 = _Object$keys(_item)).call(_context5, functi
|
|
62
62
|
}
|
63
63
|
});
|
64
64
|
});
|
65
|
+
var _link = require("./link");
|
66
|
+
_forEachInstanceProperty(_context6 = _Object$keys(_link)).call(_context6, function (key) {
|
67
|
+
if (key === "default" || key === "__esModule") return;
|
68
|
+
if (key in exports && exports[key] === _link[key]) return;
|
69
|
+
_Object$defineProperty(exports, key, {
|
70
|
+
enumerable: true,
|
71
|
+
get: function get() {
|
72
|
+
return _link[key];
|
73
|
+
}
|
74
|
+
});
|
75
|
+
});
|
65
76
|
var _loader = require("./loader");
|
66
|
-
_forEachInstanceProperty(
|
77
|
+
_forEachInstanceProperty(_context7 = _Object$keys(_loader)).call(_context7, function (key) {
|
67
78
|
if (key === "default" || key === "__esModule") return;
|
68
79
|
if (key in exports && exports[key] === _loader[key]) return;
|
69
80
|
_Object$defineProperty(exports, key, {
|
@@ -74,7 +85,7 @@ _forEachInstanceProperty(_context6 = _Object$keys(_loader)).call(_context6, func
|
|
74
85
|
});
|
75
86
|
});
|
76
87
|
var _popoverContainer = require("./popoverContainer");
|
77
|
-
_forEachInstanceProperty(
|
88
|
+
_forEachInstanceProperty(_context8 = _Object$keys(_popoverContainer)).call(_context8, function (key) {
|
78
89
|
if (key === "default" || key === "__esModule") return;
|
79
90
|
if (key in exports && exports[key] === _popoverContainer[key]) return;
|
80
91
|
_Object$defineProperty(exports, key, {
|
@@ -84,8 +95,19 @@ _forEachInstanceProperty(_context7 = _Object$keys(_popoverContainer)).call(_cont
|
|
84
95
|
}
|
85
96
|
});
|
86
97
|
});
|
98
|
+
var _separator = require("./separator");
|
99
|
+
_forEachInstanceProperty(_context9 = _Object$keys(_separator)).call(_context9, function (key) {
|
100
|
+
if (key === "default" || key === "__esModule") return;
|
101
|
+
if (key in exports && exports[key] === _separator[key]) return;
|
102
|
+
_Object$defineProperty(exports, key, {
|
103
|
+
enumerable: true,
|
104
|
+
get: function get() {
|
105
|
+
return _separator[key];
|
106
|
+
}
|
107
|
+
});
|
108
|
+
});
|
87
109
|
var _shared = require("./shared");
|
88
|
-
_forEachInstanceProperty(
|
110
|
+
_forEachInstanceProperty(_context10 = _Object$keys(_shared)).call(_context10, function (key) {
|
89
111
|
if (key === "default" || key === "__esModule") return;
|
90
112
|
if (key in exports && exports[key] === _shared[key]) return;
|
91
113
|
_Object$defineProperty(exports, key, {
|
@@ -96,7 +118,7 @@ _forEachInstanceProperty(_context8 = _Object$keys(_shared)).call(_context8, func
|
|
96
118
|
});
|
97
119
|
});
|
98
120
|
var _tableCell = require("./tableCell");
|
99
|
-
_forEachInstanceProperty(
|
121
|
+
_forEachInstanceProperty(_context11 = _Object$keys(_tableCell)).call(_context11, function (key) {
|
100
122
|
if (key === "default" || key === "__esModule") return;
|
101
123
|
if (key in exports && exports[key] === _tableCell[key]) return;
|
102
124
|
_Object$defineProperty(exports, key, {
|
@@ -107,7 +129,7 @@ _forEachInstanceProperty(_context9 = _Object$keys(_tableCell)).call(_context9, f
|
|
107
129
|
});
|
108
130
|
});
|
109
131
|
var _text = require("./text");
|
110
|
-
_forEachInstanceProperty(
|
132
|
+
_forEachInstanceProperty(_context12 = _Object$keys(_text)).call(_context12, function (key) {
|
111
133
|
if (key === "default" || key === "__esModule") return;
|
112
134
|
if (key in exports && exports[key] === _text[key]) return;
|
113
135
|
_Object$defineProperty(exports, key, {
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { TestingAttributes } from './shared/test';
|
3
|
+
type AS = Extract<keyof JSX.IntrinsicElements, 'a' | 'span'> | undefined;
|
4
|
+
export interface LinkProps extends TestingAttributes {
|
5
|
+
/** Whether the link is disabled. */
|
6
|
+
isDisabled?: boolean;
|
7
|
+
/** Handler that is called when the press is released over the target. */
|
8
|
+
onPress?: () => void;
|
9
|
+
/** Specifies the HTML Element */
|
10
|
+
as?: AS;
|
11
|
+
/** Specifies the location of the URL */
|
12
|
+
href?: string;
|
13
|
+
/** Specifies the window where the linked page is loaded */
|
14
|
+
target?: string;
|
15
|
+
/** The styling variation of the link. */
|
16
|
+
variant?: string;
|
17
|
+
/** Whether the link is clickable inside a popover in safari */
|
18
|
+
isSafariCompatible?: boolean;
|
19
|
+
className?: string;
|
20
|
+
children?: React.ReactNode;
|
21
|
+
}
|
22
|
+
export {};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _context, _context2, _context3, _context4;
|
3
|
+
var _context, _context2, _context3, _context4, _context5;
|
4
4
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
5
5
|
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
6
6
|
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
@@ -29,8 +29,19 @@ _forEachInstanceProperty(_context2 = _Object$keys(_events)).call(_context2, func
|
|
29
29
|
}
|
30
30
|
});
|
31
31
|
});
|
32
|
+
var _orientation = require("./orientation");
|
33
|
+
_forEachInstanceProperty(_context3 = _Object$keys(_orientation)).call(_context3, function (key) {
|
34
|
+
if (key === "default" || key === "__esModule") return;
|
35
|
+
if (key in exports && exports[key] === _orientation[key]) return;
|
36
|
+
_Object$defineProperty(exports, key, {
|
37
|
+
enumerable: true,
|
38
|
+
get: function get() {
|
39
|
+
return _orientation[key];
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
32
43
|
var _style = require("./style");
|
33
|
-
_forEachInstanceProperty(
|
44
|
+
_forEachInstanceProperty(_context4 = _Object$keys(_style)).call(_context4, function (key) {
|
34
45
|
if (key === "default" || key === "__esModule") return;
|
35
46
|
if (key in exports && exports[key] === _style[key]) return;
|
36
47
|
_Object$defineProperty(exports, key, {
|
@@ -41,7 +52,7 @@ _forEachInstanceProperty(_context3 = _Object$keys(_style)).call(_context3, funct
|
|
41
52
|
});
|
42
53
|
});
|
43
54
|
var _utils = require("./utils");
|
44
|
-
_forEachInstanceProperty(
|
55
|
+
_forEachInstanceProperty(_context5 = _Object$keys(_utils)).call(_context5, function (key) {
|
45
56
|
if (key === "default" || key === "__esModule") return;
|
46
57
|
if (key in exports && exports[key] === _utils[key]) return;
|
47
58
|
_Object$defineProperty(exports, key, {
|
@@ -58,7 +58,11 @@ var FIGMA_LINKS = {
|
|
58
58
|
autofocus: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16768&mode=design&t=PX1Q47IuuVvOafDQ-4'
|
59
59
|
},
|
60
60
|
callout: {
|
61
|
-
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=
|
61
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45647%3A506&mode=dev',
|
62
|
+
errorStatus: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=14289%3A33238&mode=dev',
|
63
|
+
success: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45647%3A511&mode=dev',
|
64
|
+
warning: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45647%3A501&mode=dev',
|
65
|
+
withLink: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45652%3A1604&mode=dev'
|
62
66
|
},
|
63
67
|
card: {
|
64
68
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=335%3A1780&mode=dev',
|
@@ -9,7 +9,7 @@ Callouts should contain only 1 or 2 pieces of information and display at the top
|
|
9
9
|
|
10
10
|
### Required components
|
11
11
|
|
12
|
-
This component requires the [
|
12
|
+
This component requires the [Text](./?path=/docs/components-text--default) component.
|
13
13
|
|
14
14
|
### Accessibility
|
15
15
|
|
@@ -37,12 +37,7 @@ export default {
|
|
37
37
|
|
38
38
|
// main
|
39
39
|
export var Default = function Default(args) {
|
40
|
-
return ___EmotionJSX(Callout, args, ___EmotionJSX(Text, null, "
|
41
|
-
href: "https://pingidentity.com",
|
42
|
-
target: "_blank",
|
43
|
-
"aria-label": "".concat(statuses.DEFAULT, "-callout"),
|
44
|
-
variant: "app"
|
45
|
-
}, ' ', "Read More")));
|
40
|
+
return ___EmotionJSX(Callout, args, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae lacinia diam, nec ullamcorper neque. In egestas dui vel dolor tincidunt, sit amet ullamcorper leo consequat."));
|
46
41
|
};
|
47
42
|
Default.parameters = {
|
48
43
|
design: {
|
@@ -53,12 +48,13 @@ Default.parameters = {
|
|
53
48
|
export var ErrorStatus = function ErrorStatus() {
|
54
49
|
return ___EmotionJSX(Callout, {
|
55
50
|
status: statuses.ERROR
|
56
|
-
}, ___EmotionJSX(Text, null, "
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
51
|
+
}, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae lacinia diam, nec ullamcorper neque. In egestas dui vel dolor tincidunt, sit amet ullamcorper leo consequat. Etiam at urna erat."));
|
52
|
+
};
|
53
|
+
ErrorStatus.parameters = {
|
54
|
+
design: {
|
55
|
+
type: 'figma',
|
56
|
+
url: FIGMA_LINKS.callout.errorStatus
|
57
|
+
}
|
62
58
|
};
|
63
59
|
|
64
60
|
// Avoiding using Error as the function name due to it being a JS built-in method
|
@@ -66,20 +62,36 @@ ErrorStatus.storyName = 'Error';
|
|
66
62
|
export var Success = function Success() {
|
67
63
|
return ___EmotionJSX(Callout, {
|
68
64
|
status: statuses.SUCCESS
|
69
|
-
}, ___EmotionJSX(Text, null, "
|
65
|
+
}, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae lacinia diam, nec ullamcorper neque. In egestas dui vel dolor tincidunt, sit amet ullamcorper leo consequat."));
|
66
|
+
};
|
67
|
+
Success.parameters = {
|
68
|
+
design: {
|
69
|
+
type: 'figma',
|
70
|
+
url: FIGMA_LINKS.callout.success
|
71
|
+
}
|
72
|
+
};
|
73
|
+
export var WithLink = function WithLink(args) {
|
74
|
+
return ___EmotionJSX(Callout, args, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae lacinia diam, nec ullamcorper neque. In egestas dui vel dolor tincidunt, sit amet ullamcorper leo consequat.", ' ', ___EmotionJSX(Link, {
|
70
75
|
href: "https://pingidentity.com",
|
71
76
|
target: "_blank",
|
72
|
-
"aria-label": "".concat(statuses.
|
77
|
+
"aria-label": "".concat(statuses.DEFAULT, "-callout"),
|
73
78
|
variant: "app"
|
74
|
-
},
|
79
|
+
}, "Learn More")));
|
80
|
+
};
|
81
|
+
WithLink.parameters = {
|
82
|
+
design: {
|
83
|
+
type: 'figma',
|
84
|
+
url: FIGMA_LINKS.callout.withLink
|
85
|
+
}
|
75
86
|
};
|
76
87
|
export var Warning = function Warning() {
|
77
88
|
return ___EmotionJSX(Callout, {
|
78
89
|
status: statuses.WARNING
|
79
|
-
}, ___EmotionJSX(Text, null, "
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
90
|
+
}, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vitae lacinia diam, nec ullamcorper neque. In egestas dui vel dolor tincidunt, sit amet ullamcorper leo consequat."));
|
91
|
+
};
|
92
|
+
Warning.parameters = {
|
93
|
+
design: {
|
94
|
+
type: 'figma',
|
95
|
+
url: FIGMA_LINKS.callout.warning
|
96
|
+
}
|
85
97
|
};
|
@@ -4,7 +4,6 @@ var _excluded = ["className", "isDisabled", "onPress", "isSafariCompatible"];
|
|
4
4
|
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
|
5
5
|
import { mergeProps, useFocusRing, useLink } from 'react-aria';
|
6
6
|
import { useHover, usePress } from '@react-aria/interactions';
|
7
|
-
import PropTypes from 'prop-types';
|
8
7
|
import { Link as ThemeUILink } from 'theme-ui';
|
9
8
|
import { usePropWarning, useStatusClasses } from '../../hooks';
|
10
9
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
@@ -14,7 +13,7 @@ var Link = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
14
13
|
onPress = props.onPress,
|
15
14
|
isSafariCompatible = props.isSafariCompatible,
|
16
15
|
others = _objectWithoutProperties(props, _excluded);
|
17
|
-
var linkRef = useRef();
|
16
|
+
var linkRef = useRef(null);
|
18
17
|
usePropWarning(props, 'disabled', 'isDisabled');
|
19
18
|
/* istanbul ignore next */
|
20
19
|
useImperativeHandle(ref, function () {
|
@@ -55,26 +54,10 @@ var Link = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
55
54
|
role: "link"
|
56
55
|
}, others, mergeProps(hoverProps, pressProps, linkProps, focusProps)));
|
57
56
|
});
|
58
|
-
Link.propTypes = {
|
59
|
-
/** Whether the link is disabled. */
|
60
|
-
isDisabled: PropTypes.bool,
|
61
|
-
/** The HTML element used to render the link, e.g. 'a', or 'span'. */
|
62
|
-
as: PropTypes.string,
|
63
|
-
/** Handler that is called when the press is released over the target. */
|
64
|
-
onPress: PropTypes.func,
|
65
|
-
/** Specifies the location of the URL */
|
66
|
-
href: PropTypes.string,
|
67
|
-
/** Specifies the window where the linked page is loaded */
|
68
|
-
target: PropTypes.string,
|
69
|
-
/** The styling variation of the link. */
|
70
|
-
variant: PropTypes.string,
|
71
|
-
/** Whether the link is clickable inside a popover in safari */
|
72
|
-
isSafariCompatible: PropTypes.bool
|
73
|
-
};
|
74
57
|
Link.defaultProps = {
|
75
58
|
isDisabled: false,
|
76
|
-
|
77
|
-
|
59
|
+
variant: 'app',
|
60
|
+
as: 'a'
|
78
61
|
};
|
79
62
|
Link.displayName = 'Link';
|
80
63
|
export default Link;
|
@@ -5,7 +5,7 @@ import React from 'react';
|
|
5
5
|
import { withDesign } from 'storybook-addon-designs';
|
6
6
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
7
7
|
import { Link } from '../../index';
|
8
|
-
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks
|
8
|
+
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
9
9
|
import { htmlElements } from '../../utils/devUtils/constants/htmlElements';
|
10
10
|
import LinkReadme from './Link.mdx';
|
11
11
|
import variants from './Link.styles';
|
@@ -3,7 +3,6 @@ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectW
|
|
3
3
|
var _excluded = ["className", "orientation"];
|
4
4
|
import React, { forwardRef } from 'react';
|
5
5
|
import { useSeparator } from 'react-aria';
|
6
|
-
import PropTypes from 'prop-types';
|
7
6
|
import { useStatusClasses } from '../../hooks';
|
8
7
|
import ORIENTATION from '../../utils/devUtils/constants/orientation';
|
9
8
|
import Box from '../Box/Box';
|
@@ -12,7 +11,7 @@ var Separator = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
12
11
|
var className = props.className,
|
13
12
|
orientation = props.orientation,
|
14
13
|
others = _objectWithoutProperties(props, _excluded);
|
15
|
-
var _useSeparator = useSeparator(props
|
14
|
+
var _useSeparator = useSeparator(props),
|
16
15
|
separatorProps = _useSeparator.separatorProps;
|
17
16
|
var _useStatusClasses = useStatusClasses(className, {
|
18
17
|
'is-vertical': orientation === ORIENTATION.VERTICAL,
|
@@ -23,15 +22,10 @@ var Separator = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
23
22
|
ref: ref,
|
24
23
|
className: classNames,
|
25
24
|
variant: "separator.base"
|
26
|
-
}, others, separatorProps
|
25
|
+
}, others, separatorProps, {
|
26
|
+
role: "separator"
|
27
|
+
}));
|
27
28
|
});
|
28
|
-
Separator.propTypes = {
|
29
|
-
/** Sets horizontal or vertical orientation of the divider. If
|
30
|
-
* vertical orientation is specified, the parent container must have the following styles:
|
31
|
-
* a defined height, flexDirection="row" alignItems="center"
|
32
|
-
*/
|
33
|
-
orientation: PropTypes.oneOf(['vertical', 'horizontal'])
|
34
|
-
};
|
35
29
|
Separator.defaultProps = {
|
36
30
|
orientation: 'horizontal'
|
37
31
|
};
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
4
4
|
import { withDesign } from 'storybook-addon-designs';
|
5
5
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
6
6
|
import { Box, Separator } from '../../index';
|
7
|
-
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks
|
7
|
+
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
8
8
|
import SeparatorReadme from './Separator.mdx';
|
9
9
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
10
10
|
export default {
|
@@ -1,12 +1,14 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import React from 'react';
|
3
|
+
import ORIENTATION from '../../utils/devUtils/constants/orientation';
|
3
4
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
4
5
|
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
5
|
-
import Separator from '
|
6
|
+
import Separator from '.';
|
6
7
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
8
|
var testId = 'test-separator';
|
8
9
|
var defaultProps = {
|
9
|
-
'data-testid': testId
|
10
|
+
'data-testid': testId,
|
11
|
+
'orientation': 'horizontal'
|
10
12
|
};
|
11
13
|
var getComponent = function getComponent() {
|
12
14
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -19,10 +21,34 @@ universalComponentTests({
|
|
19
21
|
return ___EmotionJSX(Separator, _extends({}, defaultProps, props));
|
20
22
|
}
|
21
23
|
});
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
describe('Separator component', function () {
|
25
|
+
test('renders Separator component', function () {
|
26
|
+
getComponent();
|
27
|
+
var separator = screen.getByTestId(testId);
|
28
|
+
screen.getByRole('separator');
|
29
|
+
expect(separator).toBeInstanceOf(HTMLDivElement);
|
30
|
+
expect(separator).toBeInTheDocument();
|
31
|
+
expect(separator).toHaveClass('is-horizontal');
|
32
|
+
});
|
33
|
+
test('Separator as a horizontal', function () {
|
34
|
+
getComponent({
|
35
|
+
orientation: 'horizontal'
|
36
|
+
});
|
37
|
+
var separator = screen.getByTestId(testId);
|
38
|
+
expect(separator).toHaveClass('is-horizontal');
|
39
|
+
});
|
40
|
+
test('Separator vertical orientation', function () {
|
41
|
+
getComponent({
|
42
|
+
orientation: 'vertical'
|
43
|
+
});
|
44
|
+
var separator = screen.getByTestId(testId);
|
45
|
+
expect(separator).toHaveAttribute('aria-orientation', ORIENTATION.VERTICAL);
|
46
|
+
});
|
47
|
+
test('applies custom className if provided', function () {
|
48
|
+
getComponent({
|
49
|
+
className: 'custom-class'
|
50
|
+
});
|
51
|
+
var separator = screen.getByTestId(testId);
|
52
|
+
expect(separator).toHaveClass('custom-class');
|
53
|
+
});
|
28
54
|
});
|
package/lib/types/index.js
CHANGED
@@ -3,8 +3,10 @@ export * from './box';
|
|
3
3
|
export * from './button';
|
4
4
|
export * from './icon';
|
5
5
|
export * from './item';
|
6
|
+
export * from './link';
|
6
7
|
export * from './loader';
|
7
8
|
export * from './popoverContainer';
|
9
|
+
export * from './separator';
|
8
10
|
export * from './shared';
|
9
11
|
export * from './tableCell';
|
10
12
|
export * from './text';
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -51,7 +51,11 @@ export var FIGMA_LINKS = {
|
|
51
51
|
autofocus: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16768&mode=design&t=PX1Q47IuuVvOafDQ-4'
|
52
52
|
},
|
53
53
|
callout: {
|
54
|
-
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=
|
54
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45647%3A506&mode=dev',
|
55
|
+
errorStatus: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=14289%3A33238&mode=dev',
|
56
|
+
success: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45647%3A511&mode=dev',
|
57
|
+
warning: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45647%3A501&mode=dev',
|
58
|
+
withLink: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45652%3A1604&mode=dev'
|
55
59
|
},
|
56
60
|
card: {
|
57
61
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=335%3A1780&mode=dev',
|