@uncinc/uncinc-react-kitchen-sink 2.7.6 → 2.7.8

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.
@@ -8,6 +8,7 @@ declare namespace AccordionItem {
8
8
  export let duration: number;
9
9
  export let easing: string;
10
10
  export { AccordeonTitle as titleComponent };
11
+ export let defaultValue: boolean;
11
12
  }
12
13
  }
13
14
  import React from 'react';
@@ -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 = _interopRequireWildcard(require("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
- var _useState = (0, _react.useState)(true),
46
- _useState2 = _slicedToArray(_useState, 2),
47
- collapsed = _useState2[0],
48
- setCollapsed = _useState2[1];
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;
@@ -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 {Object} - An object containing the top and left offset relative to the passed element
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 {String} id - The id of the items that was clicked
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 {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
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) {
@@ -1,3 +1,3 @@
1
1
  export function parseDateWithTimezoneOffset(date: any): string;
2
2
  export function isValidDate(date: any): boolean;
3
- export function doubleDigits(number: int): int;
3
+ export function doubleDigits(number: number): number;
@@ -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 {int} number - The number.
20
+ * @param {number} number - The number.
21
21
  *
22
- * @returns {int} The double digit number.
22
+ * @returns {number} The double digit number.
23
23
  */
24
24
  exports.isValidDate = isValidDate;
25
25
  var doubleDigits = function doubleDigits(number) {
@@ -5,10 +5,10 @@ declare namespace gtm {
5
5
  *
6
6
  * @description
7
7
  * Check wether google tag manager has been loaded.
8
- * @return {bool}
8
+ * @return {boolean}
9
9
  * A boolean wether the GTM is loaded or not.
10
10
  */
11
- function loaded(): bool;
11
+ function loaded(): boolean;
12
12
  /**
13
13
  * gtm.register
14
14
  *
@@ -24,7 +24,7 @@ var gtm = {
24
24
  *
25
25
  * @description
26
26
  * Check wether google tag manager has been loaded.
27
- * @return {bool}
27
+ * @return {boolean}
28
28
  * A boolean wether the GTM is loaded or not.
29
29
  */
30
30
  gtm.loaded = function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.7.6",
3
+ "version": "2.7.8",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",
@@ -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"