@pingux/astro 2.40.1 → 2.41.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/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/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +17 -6
- package/lib/cjs/types/link.d.ts +22 -0
- package/lib/cjs/types/link.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/types/index.js +1 -0
- package/lib/types/link.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';
|
package/lib/cjs/types/index.d.ts
CHANGED
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;
|
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, {
|
@@ -85,7 +96,7 @@ _forEachInstanceProperty(_context7 = _Object$keys(_popoverContainer)).call(_cont
|
|
85
96
|
});
|
86
97
|
});
|
87
98
|
var _shared = require("./shared");
|
88
|
-
_forEachInstanceProperty(
|
99
|
+
_forEachInstanceProperty(_context9 = _Object$keys(_shared)).call(_context9, function (key) {
|
89
100
|
if (key === "default" || key === "__esModule") return;
|
90
101
|
if (key in exports && exports[key] === _shared[key]) return;
|
91
102
|
_Object$defineProperty(exports, key, {
|
@@ -96,7 +107,7 @@ _forEachInstanceProperty(_context8 = _Object$keys(_shared)).call(_context8, func
|
|
96
107
|
});
|
97
108
|
});
|
98
109
|
var _tableCell = require("./tableCell");
|
99
|
-
_forEachInstanceProperty(
|
110
|
+
_forEachInstanceProperty(_context10 = _Object$keys(_tableCell)).call(_context10, function (key) {
|
100
111
|
if (key === "default" || key === "__esModule") return;
|
101
112
|
if (key in exports && exports[key] === _tableCell[key]) return;
|
102
113
|
_Object$defineProperty(exports, key, {
|
@@ -107,7 +118,7 @@ _forEachInstanceProperty(_context9 = _Object$keys(_tableCell)).call(_context9, f
|
|
107
118
|
});
|
108
119
|
});
|
109
120
|
var _text = require("./text");
|
110
|
-
_forEachInstanceProperty(
|
121
|
+
_forEachInstanceProperty(_context11 = _Object$keys(_text)).call(_context11, function (key) {
|
111
122
|
if (key === "default" || key === "__esModule") return;
|
112
123
|
if (key in exports && exports[key] === _text[key]) return;
|
113
124
|
_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 {};
|
@@ -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';
|
package/lib/types/index.js
CHANGED
@@ -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',
|