@uncinc/uncinc-react-kitchen-sink 2.3.6 → 2.4.1
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/Context/KitchenSinkComponentMapperContext.js +11 -3
- package/dist/Context/ViewportContext.js +32 -19
- package/dist/Context/withMapping.js +26 -15
- package/dist/components/AbbreviationAnnotation/index.js +49 -27
- package/dist/components/AbbreviationAnnotation/stories.js +32 -21
- package/dist/components/AbbreviationAnnotation/stories.scss +1 -1
- package/dist/components/AbbreviationAnnotation/style.scss +0 -2
- package/dist/components/Accordion/AccordionItem/index.js +56 -36
- package/dist/components/Accordion/AccordionItemVariant/index.js +47 -25
- package/dist/components/Accordion/index.js +17 -10
- package/dist/components/Accordion/stories.js +38 -24
- package/dist/components/ApiAutocomplete/index.js +79 -51
- package/dist/components/ApiAutocomplete/stories.js +18 -9
- package/dist/components/Button/index.js +53 -39
- package/dist/components/Button/stories.js +52 -30
- package/dist/components/Cookie/Checkbox/index.js +24 -17
- package/dist/components/Cookie/index.js +164 -118
- package/dist/components/Cookie/stories.js +57 -39
- package/dist/components/Dialog/index.d.ts +38 -0
- package/dist/components/Dialog/index.js +96 -0
- package/dist/components/Dialog/stories.js +42 -0
- package/dist/components/Dialog/style.scss +72 -0
- package/dist/components/FontSizeSwitcher/index.js +63 -31
- package/dist/components/FontSizeSwitcher/stories.js +23 -9
- package/dist/components/Form/Checkbox/index.js +43 -37
- package/dist/components/Form/Checkbox/stories.js +20 -11
- package/dist/components/Form/Checkboxes/index.js +62 -57
- package/dist/components/Form/Checkboxes/index.test.js +113 -62
- package/dist/components/Form/Checkboxes/stories.js +23 -12
- package/dist/components/Form/Date/index.js +13 -5
- package/dist/components/Form/Date/stories.js +18 -9
- package/dist/components/Form/DatePicker/index.js +40 -34
- package/dist/components/Form/DatePicker/stories.js +18 -9
- package/dist/components/Form/DateSelect/index.js +102 -66
- package/dist/components/Form/DateSelect/stories.js +33 -12
- package/dist/components/Form/Email/index.js +13 -5
- package/dist/components/Form/Email/stories.js +18 -9
- package/dist/components/Form/FormikWrapper/index.js +52 -45
- package/dist/components/Form/GenericFormElement/index.js +39 -34
- package/dist/components/Form/Number/index.js +23 -18
- package/dist/components/Form/Number/stories.js +18 -9
- package/dist/components/Form/RadioButtons/index.js +53 -49
- package/dist/components/Form/RadioButtons/index.test.js +106 -57
- package/dist/components/Form/RadioButtons/stories.js +23 -12
- package/dist/components/Form/SearchField/index.js +37 -30
- package/dist/components/Form/Select/Input/index.js +74 -70
- package/dist/components/Form/Select/index.js +32 -24
- package/dist/components/Form/Select/stories.js +25 -15
- package/dist/components/Form/TextField/index.js +38 -33
- package/dist/components/Form/TextField/index.test.js +104 -56
- package/dist/components/Form/TextField/stories.js +23 -12
- package/dist/components/Form/Textarea/index.js +34 -27
- package/dist/components/Form/Textarea/stories.js +18 -9
- package/dist/components/Hamburger/index.js +30 -19
- package/dist/components/Hamburger/stories.js +42 -16
- package/dist/components/Header/index.js +70 -42
- package/dist/components/Header/stories.js +48 -28
- package/dist/components/Image/Background/index.js +36 -21
- package/dist/components/Image/LazyLoadWrapper/index.js +101 -64
- package/dist/components/Image/Picture/index.js +83 -66
- package/dist/components/Image/index.js +21 -15
- package/dist/components/Image/stories.js +87 -64
- package/dist/components/InlineMenu/index.js +62 -42
- package/dist/components/InlineMenu/stories.js +66 -55
- package/dist/components/Layout/Container/index.js +29 -21
- package/dist/components/Layout/Container/stories.js +104 -83
- package/dist/components/Layout/QuickLayout/Auto/index.js +19 -12
- package/dist/components/Layout/QuickLayout/Center/index.js +17 -10
- package/dist/components/Layout/QuickLayout/Clamp/index.js +20 -13
- package/dist/components/Layout/QuickLayout/Sidebar/index.js +20 -13
- package/dist/components/Layout/QuickLayout/SpaceBetween/index.js +20 -13
- package/dist/components/Layout/QuickLayout/Stack/index.js +21 -11
- package/dist/components/Layout/QuickLayout/Wrap/index.js +21 -14
- package/dist/components/Layout/QuickLayout/index.js +31 -21
- package/dist/components/Layout/QuickLayout/stories.js +102 -70
- package/dist/components/Lottie/LottieAnimation/index.js +74 -71
- package/dist/components/Lottie/LottieAnimationWithMousePosition.js +33 -20
- package/dist/components/Lottie/index.js +47 -34
- package/dist/components/Lottie/stories.js +54 -31
- package/dist/components/MagicLine/index.js +52 -29
- package/dist/components/MagicLine/stories.js +60 -46
- package/dist/components/NavigationScroll/index.js +76 -57
- package/dist/components/NavigationScroll/stories.js +19 -8
- package/dist/components/Pagination/index.js +54 -41
- package/dist/components/Pagination/stories.js +51 -28
- package/dist/components/SearchKit/Facets/ChipFacet/index.js +24 -16
- package/dist/components/SearchKit/Facets/ListFacet/index.js +24 -15
- package/dist/components/SearchKit/Facets/SelectFacet/index.js +39 -30
- package/dist/components/SearchKit/Query/index.js +41 -23
- package/dist/components/SearchKit/SearchFacets/index.js +36 -25
- package/dist/components/SearchKit/SearchField/index.js +50 -26
- package/dist/components/SearchKit/SearchLoadMore/index.js +22 -15
- package/dist/components/SearchKit/SearchPage/index.js +26 -11
- package/dist/components/SearchKit/SearchPagination/index.js +17 -10
- package/dist/components/SearchKit/SearchReset/index.js +33 -12
- package/dist/components/SearchKit/SearchResults/index.js +114 -61
- package/dist/components/SearchKit/SearchSelectedFilters/Filters/CustomValue/index.js +22 -0
- package/dist/components/SearchKit/SearchSelectedFilters/Filters/DateRange/index.js +24 -0
- package/dist/components/SearchKit/SearchSelectedFilters/Filters/NumericRange/index.js +24 -0
- package/dist/components/SearchKit/SearchSelectedFilters/Filters/Value/index.js +29 -0
- package/dist/components/SearchKit/SearchSelectedFilters/index.js +43 -30
- package/dist/components/SearchKit/SearchSelectedFilters/style.scss +4 -0
- package/dist/components/SearchKit/SearchSorting/index.js +29 -19
- package/dist/components/SearchKit/index.js +75 -49
- package/dist/components/SearchKit/stories.js +144 -183
- package/dist/components/Share/index.js +51 -43
- package/dist/components/Share/stories.js +16 -5
- package/dist/components/Sliders/SliderRelated/index.js +32 -25
- package/dist/components/Sliders/SliderRelated/stories.js +75 -57
- package/dist/components/Webform/WebformActions/index.js +19 -13
- package/dist/components/Webform/WebformCheckbox/index.js +32 -24
- package/dist/components/Webform/WebformCheckboxes/index.js +37 -29
- package/dist/components/Webform/WebformContainer/index.js +17 -11
- package/dist/components/Webform/WebformDate/index.js +77 -48
- package/dist/components/Webform/WebformMapper/index.js +53 -38
- package/dist/components/Webform/WebformNumber/index.js +31 -22
- package/dist/components/Webform/WebformRadioButtons/index.js +37 -29
- package/dist/components/Webform/WebformSelect/index.js +37 -29
- package/dist/components/Webform/WebformTextField/index.js +34 -26
- package/dist/components/Webform/WebformTextarea/index.js +32 -24
- package/dist/components/Webform/WebformWizardPage/index.js +56 -43
- package/dist/components/Webform/index.js +42 -20
- package/dist/components/Webform/stories.actions.js +35 -24
- package/dist/components/Webform/stories.checkboxes.js +40 -29
- package/dist/components/Webform/stories.checked.js +53 -42
- package/dist/components/Webform/stories.container.js +47 -36
- package/dist/components/Webform/stories.date.js +35 -24
- package/dist/components/Webform/stories.filled.js +53 -42
- package/dist/components/Webform/stories.number.js +36 -25
- package/dist/components/Webform/stories.radiobuttons.js +40 -29
- package/dist/components/Webform/stories.select.js +40 -29
- package/dist/components/Webform/stories.textarea.js +19 -8
- package/dist/components/Webform/stories.textfield.js +19 -8
- package/dist/components/Webform/stories.wizard.js +133 -122
- package/dist/components/Webform/withStates.js +49 -28
- package/dist/components/WysiwygField/index.js +30 -21
- package/dist/components/WysiwygField/stories.js +39 -29
- package/dist/components/index.js +111 -15
- package/dist/config/constants.js +38 -18
- package/dist/config/i18next/index.js +19 -11
- package/dist/config/i18next/locales/en.json +4 -0
- package/dist/config/i18next/locales/nl.json +7 -0
- package/dist/helpers/date.js +16 -0
- package/dist/helpers/gtm.js +27 -17
- package/dist/helpers/link.js +15 -6
- package/dist/helpers/useValueForCurrentViewPort.js +27 -10
- package/dist/hooks/useBoolean.d.ts +8 -0
- package/dist/hooks/useBoolean.js +38 -0
- package/dist/hooks/useClickOutside.d.ts +8 -0
- package/dist/hooks/useClickOutside.js +35 -0
- package/dist/hooks/useDialog.d.ts +10 -0
- package/dist/hooks/useDialog.js +39 -0
- package/dist/hooks/useDialogHelpers.d.ts +20 -0
- package/dist/hooks/useDialogHelpers.js +85 -0
- package/dist/hooks/useEscape.d.ts +6 -0
- package/dist/hooks/useEscape.js +24 -0
- package/dist/hooks/useOnScreen.js +27 -6
- package/dist/hooks/usePrevious.js +11 -6
- package/dist/hooks/useScrollPosition.js +25 -7
- package/dist/hooks/useTrapFocus.d.ts +10 -0
- package/dist/hooks/useTrapFocus.js +63 -0
- package/dist/hooks/useWindowDimensions.js +27 -11
- package/dist/index.js +398 -55
- package/dist/setupTests.js +9 -5
- package/package.json +44 -19
- package/dist/components/Form/SearchField/stories.js +0 -0
- package/dist/components/SearchKit/Facets/HierarchicalFilterFacet/index.js +0 -60
- package/dist/components/SearchKit/Facets/HierarchicalMenuFacet/index.js +0 -60
|
@@ -1,45 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import loadable from '@loadable/component';
|
|
1
|
+
"use strict";
|
|
5
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _component = _interopRequireDefault(require("@loadable/component"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
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); }
|
|
12
|
+
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); }
|
|
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; }
|
|
6
15
|
// Lazy-load Lottie animations with a delay.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
var Lottie = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
17
|
+
var delay = props.delay;
|
|
18
|
+
var LottieAnimation = (0, _component.default)(function () {
|
|
19
|
+
return new Promise(function (resolve) {
|
|
20
|
+
setTimeout(function () {
|
|
21
|
+
return resolve(Promise.resolve().then(function () {
|
|
22
|
+
return _interopRequireWildcard(require('./LottieAnimation'));
|
|
23
|
+
}));
|
|
24
|
+
}, delay);
|
|
14
25
|
});
|
|
15
26
|
});
|
|
16
|
-
return /*#__PURE__*/
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(LottieAnimation, _extends({
|
|
17
28
|
ref: ref
|
|
18
29
|
}, props));
|
|
19
30
|
});
|
|
20
31
|
Lottie.propTypes = {
|
|
21
|
-
id:
|
|
22
|
-
className:
|
|
23
|
-
renderer:
|
|
24
|
-
rendererSettings:
|
|
25
|
-
preserveAspectRatio:
|
|
32
|
+
id: _propTypes.default.string,
|
|
33
|
+
className: _propTypes.default.string,
|
|
34
|
+
renderer: _propTypes.default.string,
|
|
35
|
+
rendererSettings: _propTypes.default.shape({
|
|
36
|
+
preserveAspectRatio: _propTypes.default.string
|
|
26
37
|
}),
|
|
27
|
-
data:
|
|
28
|
-
path:
|
|
29
|
-
segments:
|
|
38
|
+
data: _propTypes.default.object,
|
|
39
|
+
path: _propTypes.default.string,
|
|
40
|
+
segments: _propTypes.default.array,
|
|
30
41
|
// Events
|
|
31
|
-
onInit:
|
|
32
|
-
onDestroy:
|
|
42
|
+
onInit: _propTypes.default.func,
|
|
43
|
+
onDestroy: _propTypes.default.func,
|
|
33
44
|
// Options
|
|
34
|
-
delay:
|
|
35
|
-
autoPlay:
|
|
36
|
-
loop:
|
|
37
|
-
speed:
|
|
38
|
-
direction:
|
|
39
|
-
activateOnHover:
|
|
40
|
-
pauseOnClick:
|
|
41
|
-
olaTime:
|
|
42
|
-
startPosition:
|
|
45
|
+
delay: _propTypes.default.number,
|
|
46
|
+
autoPlay: _propTypes.default.bool,
|
|
47
|
+
loop: _propTypes.default.bool,
|
|
48
|
+
speed: _propTypes.default.number,
|
|
49
|
+
direction: _propTypes.default.number,
|
|
50
|
+
activateOnHover: _propTypes.default.bool,
|
|
51
|
+
pauseOnClick: _propTypes.default.bool,
|
|
52
|
+
olaTime: _propTypes.default.number,
|
|
53
|
+
startPosition: _propTypes.default.number,
|
|
54
|
+
ariaLabel: _propTypes.default.string
|
|
43
55
|
};
|
|
44
56
|
Lottie.defaultProps = {
|
|
45
57
|
id: null,
|
|
@@ -52,8 +64,8 @@ Lottie.defaultProps = {
|
|
|
52
64
|
path: null,
|
|
53
65
|
segments: null,
|
|
54
66
|
// Events
|
|
55
|
-
onInit: ()
|
|
56
|
-
onDestroy: ()
|
|
67
|
+
onInit: function onInit() {},
|
|
68
|
+
onDestroy: function onDestroy() {},
|
|
57
69
|
// Options
|
|
58
70
|
delay: null,
|
|
59
71
|
autoPlay: true,
|
|
@@ -66,4 +78,5 @@ Lottie.defaultProps = {
|
|
|
66
78
|
olaTime: 300,
|
|
67
79
|
startPosition: null
|
|
68
80
|
};
|
|
69
|
-
|
|
81
|
+
var _default = Lottie;
|
|
82
|
+
exports.default = _default;
|
|
@@ -1,41 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
import Lottie from './';
|
|
3
|
-
import LottieAnimationWithMousePosition from './LottieAnimationWithMousePosition';
|
|
4
|
-
import exampleLottie from '../../assets/lottie/example.json';
|
|
5
|
-
import exampleLottieEspero from '../../assets/lottie/data.json';
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Atoms/Lottie'
|
|
8
|
-
};
|
|
1
|
+
"use strict";
|
|
9
2
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
id: "example",
|
|
13
|
-
data: exampleLottie,
|
|
14
|
-
onInit: lottie => console.log(lottie)
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
15
5
|
});
|
|
6
|
+
exports.playAnimationOnMousePosition = exports.pauseOnClickAnimation = exports.default = exports.activateOnHoverAnimation = exports.PathLoad = exports.DefaultAnimation = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _ = _interopRequireDefault(require("."));
|
|
9
|
+
var _LottieAnimationWithMousePosition = _interopRequireDefault(require("./LottieAnimationWithMousePosition"));
|
|
10
|
+
var _example = _interopRequireDefault(require("../../assets/lottie/example.json"));
|
|
11
|
+
var _data = _interopRequireDefault(require("../../assets/lottie/data.json"));
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
var _default = {
|
|
14
|
+
title: 'Atoms/Lottie'
|
|
15
|
+
}; // Default animation
|
|
16
|
+
exports.default = _default;
|
|
17
|
+
var DefaultAnimation = function DefaultAnimation() {
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_.default, {
|
|
19
|
+
id: "example",
|
|
20
|
+
data: _example.default,
|
|
21
|
+
onInit: function onInit(lottie) {
|
|
22
|
+
return console.log(lottie);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
|
16
26
|
|
|
17
27
|
// Animation active on hover
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
28
|
+
exports.DefaultAnimation = DefaultAnimation;
|
|
29
|
+
var activateOnHoverAnimation = function activateOnHoverAnimation() {
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_.default, {
|
|
31
|
+
data: _example.default,
|
|
32
|
+
activateOnHover: true
|
|
33
|
+
});
|
|
34
|
+
};
|
|
22
35
|
|
|
23
36
|
// Animation plays on mouse position
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
exports.activateOnHoverAnimation = activateOnHoverAnimation;
|
|
38
|
+
var playAnimationOnMousePosition = function playAnimationOnMousePosition() {
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_LottieAnimationWithMousePosition.default, {
|
|
40
|
+
loop: false,
|
|
41
|
+
autoplay: false,
|
|
42
|
+
data: _data.default,
|
|
43
|
+
olaTime: 100,
|
|
44
|
+
startPosition: 0.5
|
|
45
|
+
});
|
|
46
|
+
};
|
|
31
47
|
|
|
32
48
|
// Pause animation on click
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
49
|
+
exports.playAnimationOnMousePosition = playAnimationOnMousePosition;
|
|
50
|
+
var pauseOnClickAnimation = function pauseOnClickAnimation() {
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_.default, {
|
|
52
|
+
data: _example.default,
|
|
53
|
+
pauseOnClick: true
|
|
54
|
+
});
|
|
55
|
+
};
|
|
37
56
|
|
|
38
57
|
// Via path load
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
58
|
+
exports.pauseOnClickAnimation = pauseOnClickAnimation;
|
|
59
|
+
var PathLoad = function PathLoad() {
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_.default, {
|
|
61
|
+
path: "https://maxst.icons8.com/vue-static/landings/animated-icons/icons/checkmark-ok/checkmark-ok.json"
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
exports.PathLoad = PathLoad;
|
|
@@ -1,64 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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."); }
|
|
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); }
|
|
16
|
+
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; }
|
|
17
|
+
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; } }
|
|
18
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
+
var MagicLine = function MagicLine(_ref) {
|
|
20
|
+
var _ref$activeClassName = _ref.activeClassName,
|
|
21
|
+
activeClassName = _ref$activeClassName === void 0 ? 'Menu__item--active' : _ref$activeClassName,
|
|
22
|
+
children = _ref.children;
|
|
23
|
+
var magicLineParentRef = (0, _react.useRef)(null);
|
|
24
|
+
var magicLineRef = (0, _react.useRef)(null);
|
|
25
|
+
var currentActiveItem = (0, _react.useRef)(null);
|
|
26
|
+
var _useState = (0, _react.useState)(false),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
loaded = _useState2[0],
|
|
29
|
+
setLoaded = _useState2[1];
|
|
30
|
+
var _useState3 = (0, _react.useState)(false),
|
|
31
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
32
|
+
activeItemInNavigation = _useState4[0],
|
|
33
|
+
_setActiveItemInNavigation = _useState4[1];
|
|
34
|
+
var setActiveItemInNavigation = function setActiveItemInNavigation(value) {
|
|
13
35
|
if (value !== activeItemInNavigation) {
|
|
14
36
|
_setActiveItemInNavigation(value);
|
|
15
37
|
}
|
|
16
38
|
};
|
|
17
|
-
|
|
39
|
+
var MagicLineRefClasses = (0, _classnames.default)('MagicLine__magic_line', {
|
|
18
40
|
'MagicLine__magic_line--visible': activeItemInNavigation && loaded
|
|
19
41
|
});
|
|
20
|
-
|
|
42
|
+
var alignMagicLine = function alignMagicLine() {
|
|
21
43
|
if (magicLineRef.current && currentActiveItem.current) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
magicLineRef.current.style.left =
|
|
25
|
-
magicLineRef.current.style.right =
|
|
44
|
+
var left = currentActiveItem.current.getBoundingClientRect().left - magicLineParentRef.current.getBoundingClientRect().left;
|
|
45
|
+
var right = magicLineParentRef.current.getBoundingClientRect().width - left - currentActiveItem.current.getBoundingClientRect().width;
|
|
46
|
+
magicLineRef.current.style.left = "".concat(left, "px");
|
|
47
|
+
magicLineRef.current.style.right = "".concat(right, "px");
|
|
26
48
|
setLoaded(true);
|
|
27
49
|
}
|
|
28
50
|
};
|
|
29
|
-
|
|
51
|
+
var hoverMagicLine = function hoverMagicLine(e) {
|
|
30
52
|
currentActiveItem.current = e.target;
|
|
31
53
|
_setActiveItemInNavigation(true);
|
|
32
54
|
alignMagicLine();
|
|
33
55
|
};
|
|
34
|
-
|
|
56
|
+
var setInitialMagicLine = function setInitialMagicLine() {
|
|
35
57
|
currentActiveItem.current = document.getElementsByClassName(activeClassName)[0];
|
|
36
58
|
if (!currentActiveItem.current) {
|
|
37
59
|
_setActiveItemInNavigation(false);
|
|
38
60
|
}
|
|
39
61
|
alignMagicLine();
|
|
40
62
|
};
|
|
41
|
-
useEffect(()
|
|
42
|
-
|
|
63
|
+
(0, _react.useEffect)(function () {
|
|
64
|
+
var initialize = function initialize() {
|
|
43
65
|
setInitialMagicLine();
|
|
44
66
|
};
|
|
45
|
-
|
|
67
|
+
var handleResize = function handleResize() {
|
|
46
68
|
alignMagicLine();
|
|
47
69
|
};
|
|
48
70
|
document.fonts.ready.then(initialize);
|
|
49
71
|
window.addEventListener('load', initialize);
|
|
50
|
-
window.addEventListener(
|
|
51
|
-
return ()
|
|
72
|
+
window.addEventListener('resize', handleResize);
|
|
73
|
+
return function () {
|
|
52
74
|
window.removeEventListener('load', initialize);
|
|
53
|
-
window.removeEventListener(
|
|
75
|
+
window.removeEventListener('resize', handleResize);
|
|
54
76
|
};
|
|
55
77
|
}, []);
|
|
56
|
-
return /*#__PURE__*/
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
57
79
|
ref: magicLineParentRef,
|
|
58
80
|
className: "MagicLine"
|
|
59
|
-
}, /*#__PURE__*/
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
60
82
|
ref: magicLineRef,
|
|
61
83
|
className: MagicLineRefClasses
|
|
62
84
|
}), children(setInitialMagicLine, hoverMagicLine, setActiveItemInNavigation));
|
|
63
85
|
};
|
|
64
|
-
|
|
86
|
+
var _default = MagicLine;
|
|
87
|
+
exports.default = _default;
|
|
@@ -1,49 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.NoActiveItem = exports.Default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _ = _interopRequireDefault(require("."));
|
|
10
|
+
require("./stories.scss");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
var _default = {
|
|
6
13
|
title: 'Molecules/MagicLine'
|
|
7
14
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return /*#__PURE__*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
'Menu__item--active': active
|
|
19
|
-
});
|
|
20
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
key: item,
|
|
22
|
-
className: classes,
|
|
23
|
-
onMouseEnter: e => {
|
|
24
|
-
hoverMagicLine(e);
|
|
25
|
-
},
|
|
26
|
-
onMouseLeave: e => {
|
|
27
|
-
setInitialMagicLine();
|
|
28
|
-
}
|
|
29
|
-
}, item);
|
|
30
|
-
}));
|
|
31
|
-
});
|
|
32
|
-
export const NoActiveItem = () => /*#__PURE__*/React.createElement(MagicLine, null, (setInitialMagicLine, hoverMagicLine, setActiveItemInNavigation) => {
|
|
33
|
-
const items = ["one", "two with a longer name", "three"];
|
|
34
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
className: "Menu"
|
|
36
|
-
}, items.map(item => {
|
|
37
|
-
const classes = c('Menu__item');
|
|
38
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
-
key: item,
|
|
40
|
-
className: classes,
|
|
41
|
-
onMouseEnter: e => {
|
|
42
|
-
hoverMagicLine(e);
|
|
43
|
-
},
|
|
44
|
-
onMouseLeave: e => {
|
|
45
|
-
setInitialMagicLine();
|
|
15
|
+
exports.default = _default;
|
|
16
|
+
var Default = function Default() {
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_.default, null, function (setInitialMagicLine, hoverMagicLine, setActiveItemInNavigation) {
|
|
18
|
+
var items = ['one', 'two with a longer name', 'three'];
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
20
|
+
className: "Menu"
|
|
21
|
+
}, items.map(function (item) {
|
|
22
|
+
var active = item === 'three';
|
|
23
|
+
if (active) {
|
|
24
|
+
setActiveItemInNavigation(true);
|
|
46
25
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
});
|
|
26
|
+
var classes = (0, _classnames.default)('Menu__item', {
|
|
27
|
+
'Menu__item--active': active
|
|
28
|
+
});
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
+
key: item,
|
|
31
|
+
className: classes,
|
|
32
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
33
|
+
hoverMagicLine(e);
|
|
34
|
+
},
|
|
35
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
36
|
+
setInitialMagicLine();
|
|
37
|
+
}
|
|
38
|
+
}, item);
|
|
39
|
+
}));
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
exports.Default = Default;
|
|
43
|
+
var NoActiveItem = function NoActiveItem() {
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_.default, null, function (setInitialMagicLine, hoverMagicLine, setActiveItemInNavigation) {
|
|
45
|
+
var items = ['one', 'two with a longer name', 'three'];
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
+
className: "Menu"
|
|
48
|
+
}, items.map(function (item) {
|
|
49
|
+
var classes = (0, _classnames.default)('Menu__item');
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
+
key: item,
|
|
52
|
+
className: classes,
|
|
53
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
54
|
+
hoverMagicLine(e);
|
|
55
|
+
},
|
|
56
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
57
|
+
setInitialMagicLine();
|
|
58
|
+
}
|
|
59
|
+
}, item);
|
|
60
|
+
}));
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
exports.NoActiveItem = NoActiveItem;
|
|
@@ -1,74 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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 _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
require("./style.scss");
|
|
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
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
20
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
21
|
+
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."); }
|
|
22
|
+
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); }
|
|
23
|
+
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; }
|
|
24
|
+
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; } }
|
|
25
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
|
+
var NavigationScroll = function NavigationScroll(props) {
|
|
27
|
+
var node = (0, _react.useRef)(null);
|
|
28
|
+
var _useState = (0, _react.useState)({
|
|
29
|
+
pos: 0,
|
|
30
|
+
reachedBottom: false,
|
|
31
|
+
reachedTop: false,
|
|
32
|
+
scrolledPastNavHeight: false,
|
|
33
|
+
_previousPos: 0
|
|
34
|
+
}),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
state = _useState2[0],
|
|
37
|
+
setState = _useState2[1];
|
|
38
|
+
var getScrollPos = function getScrollPos(element) {
|
|
21
39
|
if (typeof element.pageYOffset !== 'undefined') {
|
|
22
40
|
return element.pageYOffset;
|
|
23
41
|
}
|
|
24
42
|
return element.scrollTop;
|
|
25
43
|
};
|
|
26
|
-
|
|
27
|
-
|
|
44
|
+
var getElementHeight = function getElementHeight(element) {
|
|
45
|
+
var deductHeight = 0;
|
|
28
46
|
if (document.getElementsByClassName('Header__subMenu').length !== 0) {
|
|
29
47
|
deductHeight = document.getElementsByClassName('Header__subMenu')[0].clientHeight;
|
|
30
48
|
}
|
|
31
49
|
return element.offsetHeight - deductHeight;
|
|
32
50
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
51
|
+
var handleScroll = function handleScroll() {
|
|
52
|
+
var scrollPos = getScrollPos(window);
|
|
53
|
+
var elementHeight = getElementHeight(node.current);
|
|
54
|
+
var newPos = 0;
|
|
37
55
|
if (scrollPos > 0) {
|
|
38
|
-
|
|
56
|
+
var diff = state._previousPos - scrollPos;
|
|
39
57
|
newPos = state.pos + diff;
|
|
40
58
|
newPos = Math.max(-elementHeight, Math.min(0, newPos));
|
|
41
59
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
setState(prevState
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
60
|
+
var isVisible = newPos > -elementHeight;
|
|
61
|
+
var hasReachedTop = scrollPos < 5 && isVisible;
|
|
62
|
+
var hasReachedBottom = Math.round(scrollPos + window.innerHeight) >= document.body.clientHeight;
|
|
63
|
+
var scrolledPastNavHeight = scrollPos > elementHeight;
|
|
64
|
+
setState(function (prevState) {
|
|
65
|
+
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
66
|
+
pos: hasReachedBottom ? 0 : newPos,
|
|
67
|
+
reachedTop: hasReachedTop,
|
|
68
|
+
scrolledPastNavHeight: scrolledPastNavHeight,
|
|
69
|
+
reachedBottom: hasReachedBottom,
|
|
70
|
+
_previousPos: scrollPos
|
|
71
|
+
});
|
|
72
|
+
});
|
|
54
73
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
74
|
+
(0, _react.useEffect)(function () {
|
|
75
|
+
window.addEventListener('scroll', handleScroll);
|
|
76
|
+
return function () {
|
|
77
|
+
window.removeEventListener('scroll', handleScroll);
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
var reachedTop = state.reachedTop,
|
|
81
|
+
reachedBottom = state.reachedBottom,
|
|
82
|
+
pos = state.pos,
|
|
83
|
+
scrolledPastNavHeight = state.scrolledPastNavHeight;
|
|
84
|
+
var children = props.children,
|
|
85
|
+
hasBackground = props.hasBackground;
|
|
86
|
+
var classes = (0, _classnames.default)('NavigationScroll', {
|
|
66
87
|
'NavigationScroll--hasBackground': hasBackground,
|
|
67
88
|
's-scrolled-past-nav-height': scrolledPastNavHeight,
|
|
68
89
|
's-reached-page-top': reachedTop,
|
|
69
90
|
's-reached-page-bottom': reachedBottom
|
|
70
91
|
});
|
|
71
|
-
return /*#__PURE__*/
|
|
92
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
72
93
|
ref: node,
|
|
73
94
|
className: classes,
|
|
74
95
|
style: {
|
|
@@ -77,10 +98,8 @@ const NavigationScroll = props => {
|
|
|
77
98
|
}, children);
|
|
78
99
|
};
|
|
79
100
|
NavigationScroll.propTypes = {
|
|
80
|
-
children:
|
|
81
|
-
onUpdate: PropTypes.func
|
|
82
|
-
};
|
|
83
|
-
NavigationScroll.defaultProps = {
|
|
84
|
-
onUpdate: () => {}
|
|
101
|
+
children: _propTypes.default.element.isRequired
|
|
85
102
|
};
|
|
86
|
-
|
|
103
|
+
NavigationScroll.defaultProps = {};
|
|
104
|
+
var _default = NavigationScroll;
|
|
105
|
+
exports.default = _default;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _ = _interopRequireDefault(require("."));
|
|
10
|
+
require("./stories.scss");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
var _default = {
|
|
6
13
|
title: 'Molecules/NavigationScroll'
|
|
7
14
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
exports.default = _default;
|
|
16
|
+
var Default = function Default() {
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
18
|
+
className: "NavigationScrollExample"
|
|
19
|
+
}, /*#__PURE__*/_react.default.createElement(_.default, null, /*#__PURE__*/_react.default.createElement("nav", null, /*#__PURE__*/_react.default.createElement("div", null, "one"), /*#__PURE__*/_react.default.createElement("div", null, "two"), /*#__PURE__*/_react.default.createElement("div", null, "three"))));
|
|
20
|
+
};
|
|
21
|
+
exports.Default = Default;
|