@uncinc/uncinc-react-kitchen-sink 2.7.6 → 2.7.9
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/dist/components/Accordion/AccordionItem/index.d.ts +1 -0
- package/dist/components/Accordion/AccordionItem/index.js +12 -10
- package/dist/components/InlineMenu/index.d.ts +1 -1
- package/dist/components/InlineMenu/index.js +7 -7
- package/dist/helpers/date.d.ts +1 -1
- package/dist/helpers/date.js +2 -2
- package/dist/helpers/gtm.d.ts +2 -2
- package/dist/helpers/gtm.js +1 -1
- package/package.json +3 -2
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
9
|
var _reactAnimateHeight = _interopRequireDefault(require("react-animate-height"));
|
|
10
|
+
var _ucs = _interopRequireDefault(require("ucs"));
|
|
11
11
|
var _WysiwygField = _interopRequireDefault(require("../../WysiwygField"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
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); }
|
|
14
|
-
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; }
|
|
15
13
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
14
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
15
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -41,11 +39,14 @@ var AccordionItem = function AccordionItem(props) {
|
|
|
41
39
|
duration = props.duration,
|
|
42
40
|
easing = props.easing,
|
|
43
41
|
titleComponent = props.titleComponent,
|
|
44
|
-
className = props.className
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
className = props.className,
|
|
43
|
+
value = props.value,
|
|
44
|
+
onChange = props.onChange,
|
|
45
|
+
defaultValue = props.defaultValue;
|
|
46
|
+
var _useControlledState = (0, _ucs.default)(value, onChange, defaultValue),
|
|
47
|
+
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
48
|
+
collapsed = _useControlledState2[0],
|
|
49
|
+
setCollapsed = _useControlledState2[1];
|
|
49
50
|
var classes = (0, _classnames.default)(className, 'Accordion__item', {
|
|
50
51
|
collapsed: collapsed
|
|
51
52
|
});
|
|
@@ -76,7 +77,8 @@ AccordionItem.defaultProps = {
|
|
|
76
77
|
iconClassName: 'icon--arrow-right icon--variant-1',
|
|
77
78
|
duration: 333,
|
|
78
79
|
easing: 'cubic-bezier(0, 0, .2, 1)',
|
|
79
|
-
titleComponent: AccordeonTitle
|
|
80
|
+
titleComponent: AccordeonTitle,
|
|
81
|
+
defaultValue: true
|
|
80
82
|
};
|
|
81
83
|
var _default = AccordionItem;
|
|
82
84
|
exports.default = _default;
|
|
@@ -12,7 +12,7 @@ declare function InlineMenu({ autoFill, targetRef, items, scrollToTopOffset, Men
|
|
|
12
12
|
declare namespace InlineMenu {
|
|
13
13
|
namespace defaultProps {
|
|
14
14
|
export let autoFill: boolean;
|
|
15
|
-
export let targetRef:
|
|
15
|
+
export let targetRef: null;
|
|
16
16
|
export let items: null;
|
|
17
17
|
export let scrollToTopOffset: number;
|
|
18
18
|
export { DefaultMenuItem as MenuItemElement };
|
|
@@ -105,7 +105,7 @@ var InlineMenu = function InlineMenu(_ref2) {
|
|
|
105
105
|
/**
|
|
106
106
|
* Get the offset from the top for an element
|
|
107
107
|
* @param {HTMLElement} element - The element to get the offset of
|
|
108
|
-
* @returns {
|
|
108
|
+
* @returns {object} - An object containing the top and left offset relative to the passed element
|
|
109
109
|
*/
|
|
110
110
|
var offset = function offset(element) {
|
|
111
111
|
var rect = element.getBoundingClientRect();
|
|
@@ -119,7 +119,7 @@ var InlineMenu = function InlineMenu(_ref2) {
|
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
121
|
* On click, scroll to the corresponding item in the targetContainer
|
|
122
|
-
* @param {
|
|
122
|
+
* @param {string} id - The id of the items that was clicked
|
|
123
123
|
* @returns {void}
|
|
124
124
|
*/
|
|
125
125
|
var handleClick = function handleClick(id) {
|
|
@@ -135,10 +135,10 @@ var InlineMenu = function InlineMenu(_ref2) {
|
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
137
|
* Returns if the element with currentId is currently in its active state based on its offset from top
|
|
138
|
-
* @param {
|
|
139
|
-
* @param {
|
|
140
|
-
* @param {
|
|
141
|
-
* @returns {
|
|
138
|
+
* @param {string} currentId - The id of the element were checking the active state of
|
|
139
|
+
* @param {string} nextId - The element that comes after in the list
|
|
140
|
+
* @param {boolean} activeByDefault - If the element should be active by default if there are no elements yet
|
|
141
|
+
* @returns {boolean} - If the element with currentId is active
|
|
142
142
|
*/
|
|
143
143
|
var handleActiveState = function handleActiveState(currentId, nextId, activeByDefault) {
|
|
144
144
|
if (targetContainer) {
|
|
@@ -188,7 +188,7 @@ var InlineMenu = function InlineMenu(_ref2) {
|
|
|
188
188
|
};
|
|
189
189
|
InlineMenu.defaultProps = {
|
|
190
190
|
autoFill: false,
|
|
191
|
-
targetRef:
|
|
191
|
+
targetRef: null,
|
|
192
192
|
items: null,
|
|
193
193
|
scrollToTopOffset: 0,
|
|
194
194
|
MenuItemElement: DefaultMenuItem
|
package/dist/helpers/date.d.ts
CHANGED
package/dist/helpers/date.js
CHANGED
|
@@ -17,9 +17,9 @@ var isValidDate = function isValidDate(date) {
|
|
|
17
17
|
/**
|
|
18
18
|
* Make a time string double digit. So make 9 in to 09.
|
|
19
19
|
*
|
|
20
|
-
* @param {
|
|
20
|
+
* @param {number} number - The number.
|
|
21
21
|
*
|
|
22
|
-
* @returns {
|
|
22
|
+
* @returns {number} The double digit number.
|
|
23
23
|
*/
|
|
24
24
|
exports.isValidDate = isValidDate;
|
|
25
25
|
var doubleDigits = function doubleDigits(number) {
|
package/dist/helpers/gtm.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ declare namespace gtm {
|
|
|
5
5
|
*
|
|
6
6
|
* @description
|
|
7
7
|
* Check wether google tag manager has been loaded.
|
|
8
|
-
* @return {
|
|
8
|
+
* @return {boolean}
|
|
9
9
|
* A boolean wether the GTM is loaded or not.
|
|
10
10
|
*/
|
|
11
|
-
function loaded():
|
|
11
|
+
function loaded(): boolean;
|
|
12
12
|
/**
|
|
13
13
|
* gtm.register
|
|
14
14
|
*
|
package/dist/helpers/gtm.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uncinc/uncinc-react-kitchen-sink",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.9",
|
|
4
4
|
"description": "Default React components that are easily extended.",
|
|
5
5
|
"author": "uncinc",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"prepare": "yarn run publish:npm && husky install",
|
|
33
33
|
"storybook": "storybook dev -p 6006",
|
|
34
34
|
"build-storybook": "storybook build",
|
|
35
|
-
"yalc-watch": "nodemon -e js,jsx --ignore dist --exec \"yalc publish && yalc push\"",
|
|
35
|
+
"yalc-watch": "nodemon -e js,jsx,ts,tsx --ignore dist --exec \"yalc publish && yalc push\"",
|
|
36
36
|
"publish:npm": "yarn build:js && yarn build:types && yarn build:cleanup",
|
|
37
37
|
"extract": "sb extract",
|
|
38
38
|
"eslint": "NODE_ENV=development eslint './src/**/*.{js,jsx,ts,tsx}'",
|
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
"sass-loader": "^8.0.2",
|
|
100
100
|
"slick-carousel": "^1.8.1",
|
|
101
101
|
"typescript": "^5.2.2",
|
|
102
|
+
"ucs": "^1.0.1",
|
|
102
103
|
"uuid": "^9.0.0",
|
|
103
104
|
"videojs-vimeo-tech": "^1.0.0",
|
|
104
105
|
"videojs-youtube": "^2"
|