@pingux/astro 2.41.0-alpha.0 → 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.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { SeparatorProps } from '../../types';
3
+ declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLElement>>;
4
+ export default Separator;
@@ -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, ref),
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.ts");
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 _Separator = _interopRequireDefault(require("./Separator"));
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)(_Separator["default"], (0, _extends2["default"])({}, defaultProps, props)));
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)(_Separator["default"], (0, _extends2["default"])({}, defaultProps, props));
24
+ return (0, _react2.jsx)(_["default"], (0, _extends2["default"])({}, defaultProps, props));
23
25
  }
24
26
  });
25
- test('renders Separator component', function () {
26
- getComponent();
27
- var separator = _testWrapper.screen.getByTestId(testId);
28
- _testWrapper.screen.getByRole('separator');
29
- expect(separator).toBeInstanceOf(HTMLDivElement);
30
- expect(separator).toBeInTheDocument();
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';
@@ -6,6 +6,7 @@ export * from './item';
6
6
  export * from './link';
7
7
  export * from './loader';
8
8
  export * from './popoverContainer';
9
+ export * from './separator';
9
10
  export * from './shared';
10
11
  export * from './tableCell';
11
12
  export * from './text';
@@ -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;
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");
@@ -95,8 +95,19 @@ _forEachInstanceProperty(_context8 = _Object$keys(_popoverContainer)).call(_cont
95
95
  }
96
96
  });
97
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
+ });
98
109
  var _shared = require("./shared");
99
- _forEachInstanceProperty(_context9 = _Object$keys(_shared)).call(_context9, function (key) {
110
+ _forEachInstanceProperty(_context10 = _Object$keys(_shared)).call(_context10, function (key) {
100
111
  if (key === "default" || key === "__esModule") return;
101
112
  if (key in exports && exports[key] === _shared[key]) return;
102
113
  _Object$defineProperty(exports, key, {
@@ -107,7 +118,7 @@ _forEachInstanceProperty(_context9 = _Object$keys(_shared)).call(_context9, func
107
118
  });
108
119
  });
109
120
  var _tableCell = require("./tableCell");
110
- _forEachInstanceProperty(_context10 = _Object$keys(_tableCell)).call(_context10, function (key) {
121
+ _forEachInstanceProperty(_context11 = _Object$keys(_tableCell)).call(_context11, function (key) {
111
122
  if (key === "default" || key === "__esModule") return;
112
123
  if (key in exports && exports[key] === _tableCell[key]) return;
113
124
  _Object$defineProperty(exports, key, {
@@ -118,7 +129,7 @@ _forEachInstanceProperty(_context10 = _Object$keys(_tableCell)).call(_context10,
118
129
  });
119
130
  });
120
131
  var _text = require("./text");
121
- _forEachInstanceProperty(_context11 = _Object$keys(_text)).call(_context11, function (key) {
132
+ _forEachInstanceProperty(_context12 = _Object$keys(_text)).call(_context12, function (key) {
122
133
  if (key === "default" || key === "__esModule") return;
123
134
  if (key in exports && exports[key] === _text[key]) return;
124
135
  _Object$defineProperty(exports, key, {
@@ -0,0 +1,4 @@
1
+ import { TestingAttributes } from './shared/test';
2
+ import { DOMAttributes, OrientationProps, StyleProps } from './shared';
3
+ export interface SeparatorProps extends StyleProps, DOMAttributes, TestingAttributes, OrientationProps {
4
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
@@ -1,4 +1,5 @@
1
1
  export * from './dom';
2
2
  export * from './events';
3
+ export * from './orientation';
3
4
  export * from './style';
4
5
  export * from './utils';
@@ -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(_context3 = _Object$keys(_style)).call(_context3, function (key) {
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(_context4 = _Object$keys(_utils)).call(_context4, function (key) {
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, {
@@ -0,0 +1,4 @@
1
+ export interface OrientationProps {
2
+ /** The orientation of the component. */
3
+ orientation?: 'vertical' | 'horizontal';
4
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+ _Object$defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
@@ -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, ref),
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.ts';
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 './Separator';
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
- test('renders Separator component', function () {
23
- getComponent();
24
- var separator = screen.getByTestId(testId);
25
- screen.getByRole('separator');
26
- expect(separator).toBeInstanceOf(HTMLDivElement);
27
- expect(separator).toBeInTheDocument();
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
  });
@@ -6,6 +6,7 @@ export * from './item';
6
6
  export * from './link';
7
7
  export * from './loader';
8
8
  export * from './popoverContainer';
9
+ export * from './separator';
9
10
  export * from './shared';
10
11
  export * from './tableCell';
11
12
  export * from './text';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  export * from './dom';
2
2
  export * from './events';
3
+ export * from './orientation';
3
4
  export * from './style';
4
5
  export * from './utils';
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.41.0-alpha.0",
3
+ "version": "2.41.0-alpha.1",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",