@pingux/astro 2.32.0-alpha.13 → 2.32.0-alpha.15
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/useMountTransition/index.d.ts +1 -0
- package/lib/cjs/hooks/useMountTransition/useMountTransition.d.ts +14 -0
- package/lib/cjs/hooks/useMountTransition/useMountTransition.js +0 -9
- package/lib/cjs/hooks/useMountTransition/useMountTransition.test.d.ts +1 -0
- package/lib/cjs/hooks/useMountTransition/useMountTransition.test.js +2 -2
- package/lib/cjs/hooks/useStatusClasses/index.d.ts +1 -0
- package/lib/cjs/hooks/useStatusClasses/useStatusClasses.d.ts +18 -0
- package/lib/cjs/hooks/useStatusClasses/useStatusClasses.js +0 -9
- package/lib/cjs/hooks/useStatusClasses/useStatusClasses.test.d.ts +1 -0
- package/lib/hooks/useMountTransition/useMountTransition.js +0 -10
- package/lib/hooks/useMountTransition/useMountTransition.test.js +2 -2
- package/lib/hooks/useStatusClasses/useStatusClasses.js +0 -10
- package/package.json +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './useMountTransition';
|
@@ -0,0 +1,14 @@
|
|
1
|
+
interface UseMountTransition {
|
2
|
+
/**
|
3
|
+
* Allows for css transitions to be applied to components, while mounting or unmounting.
|
4
|
+
* @param {Object} [props] Properties provided to the state
|
5
|
+
*
|
6
|
+
* `props.isMounted`: boolean - Whether the component has been mounted.
|
7
|
+
* `props.unmountDelay`: number - Number value of the length of the transition in ms.
|
8
|
+
*
|
9
|
+
* @returns {Boolean} `isTransitioning`
|
10
|
+
*/
|
11
|
+
(isMounted: boolean, unmountDelay: number): boolean;
|
12
|
+
}
|
13
|
+
declare const useMountTransition: UseMountTransition;
|
14
|
+
export default useMountTransition;
|
@@ -9,15 +9,6 @@ exports["default"] = void 0;
|
|
9
9
|
var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout"));
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
11
11
|
var _react = require("react");
|
12
|
-
/**
|
13
|
-
* Allows for css transitions to be applied to components, while mounting or unmounting.
|
14
|
-
* @param {Object} [props] Properties provided to the state
|
15
|
-
* @param {Boolean} [props.isMounted] Whether the component has been mounted.
|
16
|
-
* @param {Number} [props.unmountDelay] Number value of the length of the transition in ms.
|
17
|
-
* `(isOpen: boolean) => void`
|
18
|
-
* @returns {Boolean} `isTransitioning`
|
19
|
-
*/
|
20
|
-
|
21
12
|
var useMountTransition = function useMountTransition(isMounted, unmountDelay) {
|
22
13
|
var _useState = (0, _react.useState)(false),
|
23
14
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -32,7 +32,7 @@ var ControlledWithTransition = function ControlledWithTransition() {
|
|
32
32
|
var _useOverlayPanelState = (0, _useOverlayPanelState2["default"])(),
|
33
33
|
state = _useOverlayPanelState.state,
|
34
34
|
onClose = _useOverlayPanelState.onClose;
|
35
|
-
var triggerRef = (0, _react.useRef)();
|
35
|
+
var triggerRef = (0, _react.useRef)(null);
|
36
36
|
return (
|
37
37
|
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
38
38
|
// readers when an overlay is open.
|
@@ -51,7 +51,7 @@ var ControlledWithTransition = function ControlledWithTransition() {
|
|
51
51
|
},
|
52
52
|
"aria-expanded": state.isOpen
|
53
53
|
}, defaultCloseButtonProps), "Close Panel"), (0, _react2.jsx)("p", {
|
54
|
-
|
54
|
+
"padding-top": "md"
|
55
55
|
}, (0, _stringify["default"])(state.isOpen)))))
|
56
56
|
);
|
57
57
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './useStatusClasses';
|
@@ -0,0 +1,18 @@
|
|
1
|
+
interface UseStatusClasses {
|
2
|
+
/**
|
3
|
+
* Converts status information into classes which can be supplied to the rendered component's
|
4
|
+
* `className` prop.
|
5
|
+
* @param {string} [defaultClass] An optional default class that will be added
|
6
|
+
* @param {{}} [statuses] A mapping of conditional statuses and the current value of each one
|
7
|
+
* @returns {{classNames: string}} A string of classes based on the input. Status keys will be
|
8
|
+
* converted to kebab-case.
|
9
|
+
* e.g. useStatusClasses('thing', { isDisabled: true }) => "thing is-disabled"
|
10
|
+
*/
|
11
|
+
(defaultClass?: string | undefined | null, statuses?: {
|
12
|
+
[key: string]: string | boolean | undefined | null;
|
13
|
+
}): {
|
14
|
+
classNames: string;
|
15
|
+
};
|
16
|
+
}
|
17
|
+
declare const useStatusClasses: UseStatusClasses;
|
18
|
+
export default useStatusClasses;
|
@@ -9,15 +9,6 @@ exports["default"] = void 0;
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
10
10
|
var _kebabCase = _interopRequireDefault(require("lodash/kebabCase"));
|
11
11
|
var _mapKeys = _interopRequireDefault(require("lodash/mapKeys"));
|
12
|
-
/**
|
13
|
-
* Converts status information into classes which can be supplied to the rendered component's
|
14
|
-
* `className` prop.
|
15
|
-
* @param {string} [defaultClass] An optional default class that will be added
|
16
|
-
* @param {{}} [statuses] A mapping of conditional statuses and the current value of each one
|
17
|
-
* @returns {{classNames: string}} A string of classes based on the input. Status keys will be
|
18
|
-
* converted to kebab-case.
|
19
|
-
* e.g. useStatusClasses('thing', { isDisabled: true }) => "thing is-disabled"
|
20
|
-
*/
|
21
12
|
var useStatusClasses = function useStatusClasses(defaultClass) {
|
22
13
|
var statuses = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
23
14
|
var kebabStatuses = (0, _mapKeys["default"])(statuses, function (_v, k) {
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -1,16 +1,6 @@
|
|
1
1
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
2
2
|
import _setTimeout from "@babel/runtime-corejs3/core-js-stable/set-timeout";
|
3
3
|
import { useEffect, useState } from 'react';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Allows for css transitions to be applied to components, while mounting or unmounting.
|
7
|
-
* @param {Object} [props] Properties provided to the state
|
8
|
-
* @param {Boolean} [props.isMounted] Whether the component has been mounted.
|
9
|
-
* @param {Number} [props.unmountDelay] Number value of the length of the transition in ms.
|
10
|
-
* `(isOpen: boolean) => void`
|
11
|
-
* @returns {Boolean} `isTransitioning`
|
12
|
-
*/
|
13
|
-
|
14
4
|
var useMountTransition = function useMountTransition(isMounted, unmountDelay) {
|
15
5
|
var _useState = useState(false),
|
16
6
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -23,7 +23,7 @@ var ControlledWithTransition = function ControlledWithTransition() {
|
|
23
23
|
var _useOverlayPanelState = useOverlayPanelState(),
|
24
24
|
state = _useOverlayPanelState.state,
|
25
25
|
onClose = _useOverlayPanelState.onClose;
|
26
|
-
var triggerRef = useRef();
|
26
|
+
var triggerRef = useRef(null);
|
27
27
|
return (
|
28
28
|
// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
29
29
|
// readers when an overlay is open.
|
@@ -42,7 +42,7 @@ var ControlledWithTransition = function ControlledWithTransition() {
|
|
42
42
|
},
|
43
43
|
"aria-expanded": state.isOpen
|
44
44
|
}, defaultCloseButtonProps), "Close Panel"), ___EmotionJSX("p", {
|
45
|
-
|
45
|
+
"padding-top": "md"
|
46
46
|
}, _JSON$stringify(state.isOpen)))))
|
47
47
|
);
|
48
48
|
};
|
@@ -1,16 +1,6 @@
|
|
1
1
|
import classnames from 'classnames';
|
2
2
|
import kebabCase from 'lodash/kebabCase';
|
3
3
|
import mapKeys from 'lodash/mapKeys';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Converts status information into classes which can be supplied to the rendered component's
|
7
|
-
* `className` prop.
|
8
|
-
* @param {string} [defaultClass] An optional default class that will be added
|
9
|
-
* @param {{}} [statuses] A mapping of conditional statuses and the current value of each one
|
10
|
-
* @returns {{classNames: string}} A string of classes based on the input. Status keys will be
|
11
|
-
* converted to kebab-case.
|
12
|
-
* e.g. useStatusClasses('thing', { isDisabled: true }) => "thing is-disabled"
|
13
|
-
*/
|
14
4
|
var useStatusClasses = function useStatusClasses(defaultClass) {
|
15
5
|
var statuses = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
16
6
|
var kebabStatuses = mapKeys(statuses, function (_v, k) {
|