@pingux/astro 2.41.0-alpha.0 → 2.41.0-alpha.2
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/Bracket/Bracket.d.ts +4 -0
- package/lib/cjs/components/Bracket/Bracket.js +1 -12
- package/lib/cjs/components/Bracket/Bracket.stories.d.ts +15 -0
- package/lib/cjs/components/Bracket/Bracket.stories.js +1 -1
- package/lib/cjs/components/Bracket/Bracket.styles.d.ts +9 -0
- package/lib/cjs/components/Bracket/Bracket.test.d.ts +1 -0
- package/lib/cjs/components/Bracket/Bracket.test.js +1 -1
- package/lib/cjs/components/Bracket/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/bracket.d.ts +8 -0
- package/lib/cjs/types/bracket.js +6 -0
- package/lib/cjs/types/index.d.ts +2 -0
- package/lib/cjs/types/index.js +32 -10
- 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/components/Bracket/Bracket.js +1 -12
- package/lib/components/Bracket/Bracket.stories.js +1 -1
- package/lib/components/Bracket/Bracket.test.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/bracket.js +1 -0
- package/lib/types/index.js +2 -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/package.json +1 -1
@@ -12,7 +12,6 @@ exports["default"] = void 0;
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
13
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/objectWithoutProperties"));
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
15
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
16
15
|
var _uuid = require("uuid");
|
17
16
|
var _index = require("../../index");
|
18
17
|
var _colors = require("../../styles/colors");
|
@@ -24,7 +23,7 @@ var Bracket = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
24
23
|
var isLast = props.isLast,
|
25
24
|
color = props.color,
|
26
25
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
27
|
-
var bracketRef = (0, _react.useRef)();
|
26
|
+
var bracketRef = (0, _react.useRef)(null);
|
28
27
|
|
29
28
|
/* istanbul ignore next */
|
30
29
|
(0, _react.useImperativeHandle)(ref, function () {
|
@@ -65,8 +64,6 @@ var Bracket = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
65
64
|
}, "bracket-fill"), (0, _react2.jsx)("g", {
|
66
65
|
transform: "translate(-0.85, 0)"
|
67
66
|
}, (0, _react2.jsx)("title", null, "Layer 3"), (0, _react2.jsx)("line", {
|
68
|
-
strokeLinecap: "undefined",
|
69
|
-
strokeLinejoin: "undefined",
|
70
67
|
y2: "0",
|
71
68
|
x2: "1",
|
72
69
|
y1: "10",
|
@@ -88,8 +85,6 @@ var Bracket = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
88
85
|
}, (0, _react2.jsx)("title", {
|
89
86
|
id: "bracket-fill-1-icon-title-".concat(bracketFillOneId)
|
90
87
|
}, "bracket-fill"), (0, _react2.jsx)("g", null, (0, _react2.jsx)("title", null, "Layer 1"), (0, _react2.jsx)("line", {
|
91
|
-
strokeLinecap: "undefined",
|
92
|
-
strokeLinejoin: "undefined",
|
93
88
|
y2: "0",
|
94
89
|
x2: "0",
|
95
90
|
y1: "10",
|
@@ -114,11 +109,5 @@ var Bracket = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
114
109
|
Bracket.defaultProps = {
|
115
110
|
color: _colors.line.light
|
116
111
|
};
|
117
|
-
Bracket.propTypes = {
|
118
|
-
/** A prop to set the strokes color. */
|
119
|
-
color: _propTypes["default"].string,
|
120
|
-
/** Whether or not the bracket is the last in a series of brackets. */
|
121
|
-
isLast: _propTypes["default"].bool
|
122
|
-
};
|
123
112
|
var _default = Bracket;
|
124
113
|
exports["default"] = _default;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { StoryFn } from '@storybook/react';
|
3
|
+
import { BracketProps } 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<BracketProps>;
|
7
|
+
export declare const IsLast: {
|
8
|
+
(): React.JSX.Element;
|
9
|
+
parameters: {
|
10
|
+
design: {
|
11
|
+
type: string;
|
12
|
+
url: string;
|
13
|
+
};
|
14
|
+
};
|
15
|
+
};
|
@@ -9,7 +9,7 @@ exports["default"] = exports.IsLast = exports.Default = void 0;
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
10
10
|
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
11
11
|
var _index = require("../../index");
|
12
|
-
var _figmaLinks = require("../../utils/designUtils/figmaLinks
|
12
|
+
var _figmaLinks = require("../../utils/designUtils/figmaLinks");
|
13
13
|
var _Bracket = _interopRequireDefault(require("./Bracket.mdx"));
|
14
14
|
var _react2 = require("@emotion/react");
|
15
15
|
var _default = {
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -19,7 +19,7 @@ var getComponent = function getComponent() {
|
|
19
19
|
// Needs to be added to each components test file
|
20
20
|
(0, _universalComponentTest.universalComponentTests)({
|
21
21
|
renderComponent: function renderComponent(props) {
|
22
|
-
return (0, _react3.jsx)(_["default"], props);
|
22
|
+
return (0, _react3.jsx)(_["default"], (0, _extends2["default"])({}, defaultProps, props));
|
23
23
|
}
|
24
24
|
});
|
25
25
|
test('default bracket', function () {
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './Bracket';
|
@@ -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';
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { TestingAttributes } from './shared/test';
|
2
|
+
import { DOMAttributes, StyleProps } from './shared';
|
3
|
+
export interface BracketProps extends StyleProps, DOMAttributes, TestingAttributes {
|
4
|
+
/** Whether or not the bracket is the last in a series of brackets. */
|
5
|
+
isLast?: boolean;
|
6
|
+
/** A prop to set the strokes color. */
|
7
|
+
color?: string;
|
8
|
+
}
|
package/lib/cjs/types/index.d.ts
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
export * from './badge';
|
2
2
|
export * from './box';
|
3
|
+
export * from './bracket';
|
3
4
|
export * from './button';
|
4
5
|
export * from './icon';
|
5
6
|
export * from './item';
|
6
7
|
export * from './link';
|
7
8
|
export * from './loader';
|
8
9
|
export * from './popoverContainer';
|
10
|
+
export * from './separator';
|
9
11
|
export * from './shared';
|
10
12
|
export * from './tableCell';
|
11
13
|
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, _context11;
|
3
|
+
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13;
|
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(_box)).call(_context2, functio
|
|
29
29
|
}
|
30
30
|
});
|
31
31
|
});
|
32
|
+
var _bracket = require("./bracket");
|
33
|
+
_forEachInstanceProperty(_context3 = _Object$keys(_bracket)).call(_context3, function (key) {
|
34
|
+
if (key === "default" || key === "__esModule") return;
|
35
|
+
if (key in exports && exports[key] === _bracket[key]) return;
|
36
|
+
_Object$defineProperty(exports, key, {
|
37
|
+
enumerable: true,
|
38
|
+
get: function get() {
|
39
|
+
return _bracket[key];
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
32
43
|
var _button = require("./button");
|
33
|
-
_forEachInstanceProperty(
|
44
|
+
_forEachInstanceProperty(_context4 = _Object$keys(_button)).call(_context4, function (key) {
|
34
45
|
if (key === "default" || key === "__esModule") return;
|
35
46
|
if (key in exports && exports[key] === _button[key]) return;
|
36
47
|
_Object$defineProperty(exports, key, {
|
@@ -41,7 +52,7 @@ _forEachInstanceProperty(_context3 = _Object$keys(_button)).call(_context3, func
|
|
41
52
|
});
|
42
53
|
});
|
43
54
|
var _icon = require("./icon");
|
44
|
-
_forEachInstanceProperty(
|
55
|
+
_forEachInstanceProperty(_context5 = _Object$keys(_icon)).call(_context5, function (key) {
|
45
56
|
if (key === "default" || key === "__esModule") return;
|
46
57
|
if (key in exports && exports[key] === _icon[key]) return;
|
47
58
|
_Object$defineProperty(exports, key, {
|
@@ -52,7 +63,7 @@ _forEachInstanceProperty(_context4 = _Object$keys(_icon)).call(_context4, functi
|
|
52
63
|
});
|
53
64
|
});
|
54
65
|
var _item = require("./item");
|
55
|
-
_forEachInstanceProperty(
|
66
|
+
_forEachInstanceProperty(_context6 = _Object$keys(_item)).call(_context6, function (key) {
|
56
67
|
if (key === "default" || key === "__esModule") return;
|
57
68
|
if (key in exports && exports[key] === _item[key]) return;
|
58
69
|
_Object$defineProperty(exports, key, {
|
@@ -63,7 +74,7 @@ _forEachInstanceProperty(_context5 = _Object$keys(_item)).call(_context5, functi
|
|
63
74
|
});
|
64
75
|
});
|
65
76
|
var _link = require("./link");
|
66
|
-
_forEachInstanceProperty(
|
77
|
+
_forEachInstanceProperty(_context7 = _Object$keys(_link)).call(_context7, function (key) {
|
67
78
|
if (key === "default" || key === "__esModule") return;
|
68
79
|
if (key in exports && exports[key] === _link[key]) return;
|
69
80
|
_Object$defineProperty(exports, key, {
|
@@ -74,7 +85,7 @@ _forEachInstanceProperty(_context6 = _Object$keys(_link)).call(_context6, functi
|
|
74
85
|
});
|
75
86
|
});
|
76
87
|
var _loader = require("./loader");
|
77
|
-
_forEachInstanceProperty(
|
88
|
+
_forEachInstanceProperty(_context8 = _Object$keys(_loader)).call(_context8, function (key) {
|
78
89
|
if (key === "default" || key === "__esModule") return;
|
79
90
|
if (key in exports && exports[key] === _loader[key]) return;
|
80
91
|
_Object$defineProperty(exports, key, {
|
@@ -85,7 +96,7 @@ _forEachInstanceProperty(_context7 = _Object$keys(_loader)).call(_context7, func
|
|
85
96
|
});
|
86
97
|
});
|
87
98
|
var _popoverContainer = require("./popoverContainer");
|
88
|
-
_forEachInstanceProperty(
|
99
|
+
_forEachInstanceProperty(_context9 = _Object$keys(_popoverContainer)).call(_context9, function (key) {
|
89
100
|
if (key === "default" || key === "__esModule") return;
|
90
101
|
if (key in exports && exports[key] === _popoverContainer[key]) return;
|
91
102
|
_Object$defineProperty(exports, key, {
|
@@ -95,8 +106,19 @@ _forEachInstanceProperty(_context8 = _Object$keys(_popoverContainer)).call(_cont
|
|
95
106
|
}
|
96
107
|
});
|
97
108
|
});
|
109
|
+
var _separator = require("./separator");
|
110
|
+
_forEachInstanceProperty(_context10 = _Object$keys(_separator)).call(_context10, function (key) {
|
111
|
+
if (key === "default" || key === "__esModule") return;
|
112
|
+
if (key in exports && exports[key] === _separator[key]) return;
|
113
|
+
_Object$defineProperty(exports, key, {
|
114
|
+
enumerable: true,
|
115
|
+
get: function get() {
|
116
|
+
return _separator[key];
|
117
|
+
}
|
118
|
+
});
|
119
|
+
});
|
98
120
|
var _shared = require("./shared");
|
99
|
-
_forEachInstanceProperty(
|
121
|
+
_forEachInstanceProperty(_context11 = _Object$keys(_shared)).call(_context11, function (key) {
|
100
122
|
if (key === "default" || key === "__esModule") return;
|
101
123
|
if (key in exports && exports[key] === _shared[key]) return;
|
102
124
|
_Object$defineProperty(exports, key, {
|
@@ -107,7 +129,7 @@ _forEachInstanceProperty(_context9 = _Object$keys(_shared)).call(_context9, func
|
|
107
129
|
});
|
108
130
|
});
|
109
131
|
var _tableCell = require("./tableCell");
|
110
|
-
_forEachInstanceProperty(
|
132
|
+
_forEachInstanceProperty(_context12 = _Object$keys(_tableCell)).call(_context12, function (key) {
|
111
133
|
if (key === "default" || key === "__esModule") return;
|
112
134
|
if (key in exports && exports[key] === _tableCell[key]) return;
|
113
135
|
_Object$defineProperty(exports, key, {
|
@@ -118,7 +140,7 @@ _forEachInstanceProperty(_context10 = _Object$keys(_tableCell)).call(_context10,
|
|
118
140
|
});
|
119
141
|
});
|
120
142
|
var _text = require("./text");
|
121
|
-
_forEachInstanceProperty(
|
143
|
+
_forEachInstanceProperty(_context13 = _Object$keys(_text)).call(_context13, function (key) {
|
122
144
|
if (key === "default" || key === "__esModule") return;
|
123
145
|
if (key in exports && exports[key] === _text[key]) return;
|
124
146
|
_Object$defineProperty(exports, key, {
|
@@ -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, {
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
3
|
var _excluded = ["isLast", "color"];
|
4
4
|
import React, { forwardRef, useImperativeHandle, useMemo, useRef } from 'react';
|
5
|
-
import PropTypes from 'prop-types';
|
6
5
|
import { v4 as uuid } from 'uuid';
|
7
6
|
import { Box } from '../../index';
|
8
7
|
import { line } from '../../styles/colors';
|
@@ -11,7 +10,7 @@ var Bracket = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
11
10
|
var isLast = props.isLast,
|
12
11
|
color = props.color,
|
13
12
|
others = _objectWithoutProperties(props, _excluded);
|
14
|
-
var bracketRef = useRef();
|
13
|
+
var bracketRef = useRef(null);
|
15
14
|
|
16
15
|
/* istanbul ignore next */
|
17
16
|
useImperativeHandle(ref, function () {
|
@@ -52,8 +51,6 @@ var Bracket = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
52
51
|
}, "bracket-fill"), ___EmotionJSX("g", {
|
53
52
|
transform: "translate(-0.85, 0)"
|
54
53
|
}, ___EmotionJSX("title", null, "Layer 3"), ___EmotionJSX("line", {
|
55
|
-
strokeLinecap: "undefined",
|
56
|
-
strokeLinejoin: "undefined",
|
57
54
|
y2: "0",
|
58
55
|
x2: "1",
|
59
56
|
y1: "10",
|
@@ -75,8 +72,6 @@ var Bracket = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
75
72
|
}, ___EmotionJSX("title", {
|
76
73
|
id: "bracket-fill-1-icon-title-".concat(bracketFillOneId)
|
77
74
|
}, "bracket-fill"), ___EmotionJSX("g", null, ___EmotionJSX("title", null, "Layer 1"), ___EmotionJSX("line", {
|
78
|
-
strokeLinecap: "undefined",
|
79
|
-
strokeLinejoin: "undefined",
|
80
75
|
y2: "0",
|
81
76
|
x2: "0",
|
82
77
|
y1: "10",
|
@@ -101,10 +96,4 @@ var Bracket = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
101
96
|
Bracket.defaultProps = {
|
102
97
|
color: line.light
|
103
98
|
};
|
104
|
-
Bracket.propTypes = {
|
105
|
-
/** A prop to set the strokes color. */
|
106
|
-
color: PropTypes.string,
|
107
|
-
/** Whether or not the bracket is the last in a series of brackets. */
|
108
|
-
isLast: PropTypes.bool
|
109
|
-
};
|
110
99
|
export default Bracket;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
3
3
|
import { Box, Bracket } from '../../index';
|
4
|
-
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks
|
4
|
+
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
5
5
|
import BracketReadme from './Bracket.mdx';
|
6
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
7
|
export default {
|
@@ -16,7 +16,7 @@ var getComponent = function getComponent() {
|
|
16
16
|
// Needs to be added to each components test file
|
17
17
|
universalComponentTests({
|
18
18
|
renderComponent: function renderComponent(props) {
|
19
|
-
return ___EmotionJSX(Bracket, props);
|
19
|
+
return ___EmotionJSX(Bracket, _extends({}, defaultProps, props));
|
20
20
|
}
|
21
21
|
});
|
22
22
|
test('default bracket', function () {
|
@@ -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
|
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/lib/types/index.js
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
export * from './badge';
|
2
2
|
export * from './box';
|
3
|
+
export * from './bracket';
|
3
4
|
export * from './button';
|
4
5
|
export * from './icon';
|
5
6
|
export * from './item';
|
6
7
|
export * from './link';
|
7
8
|
export * from './loader';
|
8
9
|
export * from './popoverContainer';
|
10
|
+
export * from './separator';
|
9
11
|
export * from './shared';
|
10
12
|
export * from './tableCell';
|
11
13
|
export * from './text';
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|