@uncinc/uncinc-react-kitchen-sink 2.5.3 → 2.5.5

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.
Files changed (48) hide show
  1. package/dist/Context/KitchenSinkComponentMapperContext.d.ts +3 -0
  2. package/dist/Context/withMapping.d.ts +3 -0
  3. package/dist/components/Button/index.d.ts +41 -0
  4. package/dist/components/CallToAction/index.d.ts +15 -0
  5. package/dist/components/CallToAction/index.js +43 -0
  6. package/dist/components/CallToAction/stories.d.ts +8 -0
  7. package/dist/components/CallToAction/stories.js +37 -0
  8. package/dist/components/CallToAction/style.scss +25 -0
  9. package/dist/components/Cookie/index.js +39 -40
  10. package/dist/components/Cookie/style.scss +18 -1
  11. package/dist/components/Download/index.d.ts +13 -0
  12. package/dist/components/Download/index.js +58 -0
  13. package/dist/components/Download/stories.d.ts +8 -0
  14. package/dist/components/Download/stories.js +28 -0
  15. package/dist/components/Download/stories.scss +67 -0
  16. package/dist/components/Image/LazyLoadWrapper/index.d.ts +10 -0
  17. package/dist/components/Image/Picture/index.d.ts +23 -0
  18. package/dist/components/Image/Picture/index.js +7 -1
  19. package/dist/components/Image/index.d.ts +15 -0
  20. package/dist/components/Image/index.js +8 -2
  21. package/dist/components/TitleWithText/index.d.ts +8 -0
  22. package/dist/components/TitleWithText/index.js +28 -0
  23. package/dist/components/TitleWithText/stories.d.ts +8 -0
  24. package/dist/components/TitleWithText/stories.js +24 -0
  25. package/dist/components/TitleWithText/stories.scss +0 -0
  26. package/dist/components/WysiwygField/index.d.ts +18 -0
  27. package/dist/config/constants.d.ts +15 -0
  28. package/dist/config/i18next/locales/en.json +9 -0
  29. package/dist/config/i18next/locales/nl.json +6 -0
  30. package/dist/helpers/gtm.d.ts +44 -0
  31. package/dist/helpers/link.d.ts +2 -0
  32. package/dist/index.js +42 -0
  33. package/dist/organisms/Downloads/index.d.ts +11 -0
  34. package/dist/organisms/Downloads/index.js +37 -0
  35. package/dist/organisms/Downloads/stories.d.ts +8 -0
  36. package/dist/organisms/Downloads/stories.js +43 -0
  37. package/dist/organisms/Downloads/stories.scss +67 -0
  38. package/dist/organisms/Quote/index.d.ts +18 -0
  39. package/dist/organisms/Quote/index.js +53 -0
  40. package/dist/organisms/Quote/stories.d.ts +8 -0
  41. package/dist/organisms/Quote/stories.js +39 -0
  42. package/dist/organisms/Quote/stories.scss +48 -0
  43. package/dist/organisms/Text/index.d.ts +15 -0
  44. package/dist/organisms/Text/index.js +74 -0
  45. package/dist/organisms/Text/stories.d.ts +8 -0
  46. package/dist/organisms/Text/stories.js +30 -0
  47. package/dist/organisms/Text/stories.scss +29 -0
  48. package/package.json +2 -2
@@ -0,0 +1,74 @@
1
+ "use strict";
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
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _reactI18next = require("react-i18next");
10
+ var _reactAnimateHeight = _interopRequireDefault(require("react-animate-height"));
11
+ var _classnames = _interopRequireDefault(require("classnames"));
12
+ var _TitleWithText = _interopRequireDefault(require("../../components/TitleWithText"));
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ 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); }
15
+ 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; }
16
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
+ 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."); }
18
+ 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); }
19
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
20
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
21
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
+ var Text = function Text(_ref) {
23
+ var title = _ref.title,
24
+ text = _ref.text,
25
+ readMore = _ref.readMore,
26
+ _ref$duration = _ref.duration,
27
+ duration = _ref$duration === void 0 ? 333 : _ref$duration,
28
+ _ref$easing = _ref.easing,
29
+ easing = _ref$easing === void 0 ? 'cubic-bezier(0.65, 0, 0.35, 1)' : _ref$easing,
30
+ _ref$readMoreHeight = _ref.readMoreHeight,
31
+ readMoreHeight = _ref$readMoreHeight === void 0 ? 0 : _ref$readMoreHeight,
32
+ link = _ref.link,
33
+ linkText = _ref.linkText,
34
+ _ref$target = _ref.target,
35
+ target = _ref$target === void 0 ? '_self' : _ref$target,
36
+ className = _ref.className;
37
+ var _useState = (0, _react.useState)(false),
38
+ _useState2 = _slicedToArray(_useState, 2),
39
+ readMoreOpened = _useState2[0],
40
+ setReadMoreOpened = _useState2[1];
41
+ var _useTranslation = (0, _reactI18next.useTranslation)(),
42
+ t = _useTranslation.t;
43
+ var classes = (0, _classnames.default)('Text', className);
44
+ var readMoreClasses = (0, _classnames.default)('Text__read_more', {
45
+ 'Text__read_more--open': readMoreOpened
46
+ });
47
+ return /*#__PURE__*/_react.default.createElement("div", {
48
+ className: classes
49
+ }, /*#__PURE__*/_react.default.createElement(_TitleWithText.default, {
50
+ title: title,
51
+ text: text
52
+ }), readMore && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
53
+ className: readMoreClasses
54
+ }, /*#__PURE__*/_react.default.createElement(_reactAnimateHeight.default, {
55
+ duration: duration,
56
+ easing: easing,
57
+ height: readMoreOpened ? 'auto' : readMoreHeight
58
+ }, /*#__PURE__*/_react.default.createElement(_TitleWithText.default, {
59
+ text: readMore
60
+ }))), /*#__PURE__*/_react.default.createElement("button", {
61
+ type: "button",
62
+ className: "Text__read_more__button",
63
+ onClick: function onClick() {
64
+ return setReadMoreOpened(!readMoreOpened);
65
+ }
66
+ }, readMoreOpened ? t('organisms.text.read_less') : t('organisms.text.read_more'))), link && /*#__PURE__*/_react.default.createElement("a", {
67
+ className: "Text__link",
68
+ href: link,
69
+ target: target,
70
+ rel: "noreferrer"
71
+ }, linkText));
72
+ };
73
+ var _default = Text;
74
+ exports.default = _default;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import './stories.scss';
3
+ declare const _default: {
4
+ title: string;
5
+ component: React.FC<import(".").TextProps>;
6
+ };
7
+ export default _default;
8
+ export declare const Default: (args: any) => React.JSX.Element;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.Default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _ = _interopRequireDefault(require("."));
9
+ require("./stories.scss");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
12
+ var _default = {
13
+ title: 'Organisms/Text',
14
+ component: _.default
15
+ };
16
+ exports.default = _default;
17
+ var Default = function Default(args) {
18
+ var html = "<p>This is some text in a <code>WysiwygField</code> so you can put whatever you like in here.<br /><br />\n For example, a <ul><li>list</li><li>with</li><li>items</li></ul> perhaps?</p>";
19
+ var more = "<p>If you like, you can have some text behind a read-more button, like so.<br />\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut\n labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit\n esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt\n in culpa qui officia deserunt mollit anim id est laborum.</p>";
20
+ return /*#__PURE__*/_react.default.createElement(_.default, _extends({
21
+ title: "Text",
22
+ text: html,
23
+ readMore: more,
24
+ readMoreHeight: 60,
25
+ link: "https://www.uncinc.nl/",
26
+ linkText: "Optionally, this component can have a seperate link element",
27
+ target: "_blank"
28
+ }, args));
29
+ };
30
+ exports.Default = Default;
@@ -0,0 +1,29 @@
1
+ @import '../../styles/assets/variables';
2
+
3
+ .Text {
4
+ &__read_more {
5
+ position: relative;
6
+ overflow: hidden;
7
+ transition: height .33s linear;
8
+
9
+ &:not(.Text__read_more--open):after {
10
+ content: '';
11
+
12
+ position: absolute;
13
+ top: 0;
14
+ right: 0;
15
+ bottom: 0;
16
+ left: 0;
17
+
18
+ opacity: 1;
19
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, $color--white 100%);
20
+
21
+ transition: opacity .33s linear;
22
+ }
23
+
24
+ &__button {
25
+ display: block;
26
+ margin-bottom: 2rem;
27
+ }
28
+ }
29
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.5.3",
3
+ "version": "2.5.5",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",
@@ -79,7 +79,7 @@
79
79
  "react-dom": "^16 || ^17 || ^18",
80
80
  "react-global-configuration": "^1.4.0",
81
81
  "react-html-parser": "^2.0.2",
82
- "react-i18next": "^12.2.0",
82
+ "react-i18next": "^11.5.0",
83
83
  "react-immutable-proptypes": "^2.2.0",
84
84
  "react-lazyload": "^3.0.0",
85
85
  "react-paginate": "^7.1.3",