@pingux/astro 2.34.0-alpha.0 → 2.34.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.
@@ -37,6 +37,11 @@ var calendarButton = {
37
37
  backgroundColor: 'neutral.80',
38
38
  color: 'neutral.10',
39
39
  opacity: 1
40
+ },
41
+ '&.is-disabled': {
42
+ '&.is-hovered': {
43
+ backgroundColor: 'unset'
44
+ }
40
45
  }
41
46
  };
42
47
  var calendarCell = {
@@ -1,13 +1,19 @@
1
1
  "use strict";
2
2
 
3
+ var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
4
+ var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
5
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
6
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
3
7
  var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
5
- var _react = _interopRequireDefault(require("react"));
9
+ var _react = _interopRequireWildcard(require("react"));
6
10
  var _EarthIcon = _interopRequireDefault(require("@pingux/mdi-react/EarthIcon"));
7
11
  var _react2 = require("@testing-library/react");
8
- var _testAxe = _interopRequireDefault(require("../../utils/testUtils/testAxe"));
12
+ var _universalComponentTest = require("../../utils/testUtils/universalComponentTest");
9
13
  var _ = _interopRequireDefault(require("."));
10
14
  var _react3 = require("@emotion/react");
15
+ function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
17
  var testId = 'test-icon';
12
18
  var defaultProps = {
13
19
  'data-testid': testId,
@@ -22,8 +28,26 @@ var getComponent = function getComponent() {
22
28
  return (0, _react2.render)((0, _react3.jsx)(_["default"], (0, _extends2["default"])({}, defaultProps, props)));
23
29
  };
24
30
 
25
- // Need to be added to each test file to test accessibility using axe.
26
- (0, _testAxe["default"])(getComponent);
31
+ // The mdi-react and @pingux/mid-react libraries don't support ref forwarding
32
+ // A simple implementation of an SVG component demonstrates ref forwarding
33
+ var SVGTestComponent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
34
+ return (0, _react3.jsx)("svg", (0, _extends2["default"])({
35
+ ref: ref
36
+ }, props, {
37
+ "aria-labelledby": "id"
38
+ }), (0, _react3.jsx)("title", {
39
+ id: "id"
40
+ }, "title"));
41
+ });
42
+
43
+ // Needs to be added to each components test file
44
+ (0, _universalComponentTest.universalComponentTests)({
45
+ renderComponent: function renderComponent(props) {
46
+ return (0, _react3.jsx)(_["default"], (0, _extends2["default"])({
47
+ icon: SVGTestComponent
48
+ }, props));
49
+ }
50
+ });
27
51
  test('default icon', function () {
28
52
  getComponent();
29
53
  var icon = _react2.screen.getByTestId(testId);
@@ -30,6 +30,11 @@ var calendarButton = {
30
30
  backgroundColor: 'neutral.80',
31
31
  color: 'neutral.10',
32
32
  opacity: 1
33
+ },
34
+ '&.is-disabled': {
35
+ '&.is-hovered': {
36
+ backgroundColor: 'unset'
37
+ }
33
38
  }
34
39
  };
35
40
  var calendarCell = {
@@ -1,8 +1,8 @@
1
1
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
- import React from 'react';
2
+ import React, { forwardRef } from 'react';
3
3
  import Earth from '@pingux/mdi-react/EarthIcon';
4
4
  import { render, screen } from '@testing-library/react';
5
- import axeTest from '../../utils/testUtils/testAxe';
5
+ import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
6
6
  import Icon from '.';
7
7
  import { jsx as ___EmotionJSX } from "@emotion/react";
8
8
  var testId = 'test-icon';
@@ -19,8 +19,26 @@ var getComponent = function getComponent() {
19
19
  return render(___EmotionJSX(Icon, _extends({}, defaultProps, props)));
20
20
  };
21
21
 
22
- // Need to be added to each test file to test accessibility using axe.
23
- axeTest(getComponent);
22
+ // The mdi-react and @pingux/mid-react libraries don't support ref forwarding
23
+ // A simple implementation of an SVG component demonstrates ref forwarding
24
+ var SVGTestComponent = /*#__PURE__*/forwardRef(function (props, ref) {
25
+ return ___EmotionJSX("svg", _extends({
26
+ ref: ref
27
+ }, props, {
28
+ "aria-labelledby": "id"
29
+ }), ___EmotionJSX("title", {
30
+ id: "id"
31
+ }, "title"));
32
+ });
33
+
34
+ // Needs to be added to each components test file
35
+ universalComponentTests({
36
+ renderComponent: function renderComponent(props) {
37
+ return ___EmotionJSX(Icon, _extends({
38
+ icon: SVGTestComponent
39
+ }, props));
40
+ }
41
+ });
24
42
  test('default icon', function () {
25
43
  getComponent();
26
44
  var icon = screen.getByTestId(testId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "2.34.0-alpha.0",
3
+ "version": "2.34.0-alpha.2",
4
4
  "description": "React component library for Ping Identity's design system",
5
5
  "repository": {
6
6
  "type": "git",