@pingux/astro 2.30.0-alpha.3 → 2.30.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/hooks/useAriaLabelWarning/index.d.ts +1 -0
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.d.ts +9 -0
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.js +0 -4
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.test.d.ts +1 -0
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.test.js +1 -3
- package/lib/cjs/hooks/useDevelopmentWarning/index.d.ts +1 -0
- package/lib/cjs/hooks/useDevelopmentWarning/useDevelopmentWarning.d.ts +11 -0
- package/lib/cjs/hooks/useDevelopmentWarning/useDevelopmentWarning.js +0 -3
- package/lib/cjs/hooks/useDevelopmentWarning/useDevelopmentWarning.test.d.ts +1 -0
- package/lib/cjs/hooks/useDevelopmentWarning/useDevelopmentWarning.test.js +1 -3
- package/lib/hooks/useAriaLabelWarning/useAriaLabelWarning.js +0 -5
- package/lib/hooks/useAriaLabelWarning/useAriaLabelWarning.test.js +1 -3
- package/lib/hooks/useDevelopmentWarning/useDevelopmentWarning.js +0 -4
- package/lib/hooks/useDevelopmentWarning/useDevelopmentWarning.test.js +1 -3
- package/package.json +2 -2
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './useAriaLabelWarning';
|
@@ -0,0 +1,9 @@
|
|
1
|
+
interface UseAriaLabelWarning {
|
2
|
+
/**
|
3
|
+
* Provides a development-only console warning when a component
|
4
|
+
* that needs an aria-label is mounted without one.
|
5
|
+
*/
|
6
|
+
(component: string, ariaLabel?: string, shouldTrigger?: boolean): void;
|
7
|
+
}
|
8
|
+
declare const useAriaLabelWarning: UseAriaLabelWarning;
|
9
|
+
export default useAriaLabelWarning;
|
@@ -7,10 +7,6 @@ _Object$defineProperty(exports, "__esModule", {
|
|
7
7
|
});
|
8
8
|
exports["default"] = void 0;
|
9
9
|
var _useDevelopmentWarning = _interopRequireDefault(require("../useDevelopmentWarning"));
|
10
|
-
/**
|
11
|
-
* Provides a development-only console warning when a component
|
12
|
-
* that needs an aria-label is mounted without one.
|
13
|
-
*/
|
14
10
|
var useAriaLabelWarning = function useAriaLabelWarning(component, ariaLabel) {
|
15
11
|
var shouldTrigger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
16
12
|
var message = "".concat(component, " has an undefined aria-label. If the surrounding content sufficiently labels this component instance, you may disable this warning by setting the prop to `null`. Otherwise, please provide an appropriate aria-label. See more info here: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label");
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -6,9 +6,7 @@ var _useAriaLabelWarning = _interopRequireDefault(require("./useAriaLabelWarning
|
|
6
6
|
var component = 'TestComponent';
|
7
7
|
beforeEach(function () {
|
8
8
|
process.env.NODE_ENV = 'development';
|
9
|
-
global.console.warn =
|
10
|
-
return jest.mock();
|
11
|
-
}; // eslint-disable-line no-console
|
9
|
+
global.console.warn = jest.fn(); // eslint-disable-line no-console
|
12
10
|
});
|
13
11
|
|
14
12
|
afterEach(function () {
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './useDevelopmentWarning';
|
@@ -0,0 +1,11 @@
|
|
1
|
+
interface UseDevelopmentWarning {
|
2
|
+
/**
|
3
|
+
* Provides a development-only console warning.
|
4
|
+
*/
|
5
|
+
({ message, shouldTrigger }: {
|
6
|
+
message: string;
|
7
|
+
shouldTrigger: boolean;
|
8
|
+
}): void;
|
9
|
+
}
|
10
|
+
declare const useDevelopmentWarning: UseDevelopmentWarning;
|
11
|
+
export default useDevelopmentWarning;
|
@@ -6,9 +6,6 @@ _Object$defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports["default"] = void 0;
|
8
8
|
var _react = require("react");
|
9
|
-
/**
|
10
|
-
* Provides a development-only console warning.
|
11
|
-
*/
|
12
9
|
var useDevelopmentWarning = function useDevelopmentWarning(_ref) {
|
13
10
|
var message = _ref.message,
|
14
11
|
shouldTrigger = _ref.shouldTrigger;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -6,9 +6,7 @@ var _useDevelopmentWarning = _interopRequireDefault(require("./useDevelopmentWar
|
|
6
6
|
var message = 'This is test message';
|
7
7
|
beforeEach(function () {
|
8
8
|
process.env.NODE_ENV = 'development';
|
9
|
-
global.console.warn =
|
10
|
-
return jest.mock();
|
11
|
-
}; // eslint-disable-line no-console
|
9
|
+
global.console.warn = jest.fn(); // eslint-disable-line no-console
|
12
10
|
});
|
13
11
|
|
14
12
|
afterEach(function () {
|
@@ -1,9 +1,4 @@
|
|
1
1
|
import useDevelopmentWarning from '../useDevelopmentWarning';
|
2
|
-
|
3
|
-
/**
|
4
|
-
* Provides a development-only console warning when a component
|
5
|
-
* that needs an aria-label is mounted without one.
|
6
|
-
*/
|
7
2
|
var useAriaLabelWarning = function useAriaLabelWarning(component, ariaLabel) {
|
8
3
|
var shouldTrigger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
9
4
|
var message = "".concat(component, " has an undefined aria-label. If the surrounding content sufficiently labels this component instance, you may disable this warning by setting the prop to `null`. Otherwise, please provide an appropriate aria-label. See more info here: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label");
|
@@ -3,9 +3,7 @@ import useAriaLabelWarning from './useAriaLabelWarning';
|
|
3
3
|
var component = 'TestComponent';
|
4
4
|
beforeEach(function () {
|
5
5
|
process.env.NODE_ENV = 'development';
|
6
|
-
global.console.warn =
|
7
|
-
return jest.mock();
|
8
|
-
}; // eslint-disable-line no-console
|
6
|
+
global.console.warn = jest.fn(); // eslint-disable-line no-console
|
9
7
|
});
|
10
8
|
|
11
9
|
afterEach(function () {
|
@@ -3,9 +3,7 @@ import useDevelopmentWarning from './useDevelopmentWarning';
|
|
3
3
|
var message = 'This is test message';
|
4
4
|
beforeEach(function () {
|
5
5
|
process.env.NODE_ENV = 'development';
|
6
|
-
global.console.warn =
|
7
|
-
return jest.mock();
|
8
|
-
}; // eslint-disable-line no-console
|
6
|
+
global.console.warn = jest.fn(); // eslint-disable-line no-console
|
9
7
|
});
|
10
8
|
|
11
9
|
afterEach(function () {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pingux/astro",
|
3
|
-
"version": "2.30.0
|
3
|
+
"version": "2.30.0",
|
4
4
|
"description": "React component library for Ping Identity's design system",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -136,7 +136,7 @@
|
|
136
136
|
"@storybook/theming": "^7.1.0",
|
137
137
|
"@testing-library/jest-dom": "^5.11.4",
|
138
138
|
"@testing-library/react": "^11.0.4",
|
139
|
-
"@testing-library/react-hooks": "^
|
139
|
+
"@testing-library/react-hooks": "^8.0.1",
|
140
140
|
"@testing-library/user-event": "^12.8.3",
|
141
141
|
"@types/jest": "^29.5.3",
|
142
142
|
"@types/mdx": "^2.0.5",
|