@festo-ui/react 5.0.1 → 5.1.0-dev.164

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 (144) hide show
  1. package/index.css +2 -2
  2. package/index.d.ts +4 -0
  3. package/index.js +4 -0
  4. package/lib/components/accordion/Accordion.d.ts +1 -1
  5. package/lib/components/accordion/Accordion.js +1 -1
  6. package/lib/components/accordion/accordion-header/AccordionHeader.d.ts +1 -1
  7. package/lib/components/accordion/accordion-item/AccordionItem.d.ts +1 -1
  8. package/lib/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.d.ts +1 -1
  9. package/lib/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.d.ts +1 -1
  10. package/lib/components/loading-indicator/LoadingIndicator.d.ts +1 -1
  11. package/lib/components/mobile-flyout/MobileFlyout.d.ts +12 -0
  12. package/lib/components/mobile-flyout/MobileFlyout.js +83 -0
  13. package/lib/components/mobile-flyout/MobileFlyoutContext.d.ts +9 -0
  14. package/lib/components/mobile-flyout/MobileFlyoutContext.js +2 -0
  15. package/lib/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.d.ts +19 -0
  16. package/lib/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.js +54 -0
  17. package/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.d.ts +8 -0
  18. package/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +47 -0
  19. package/lib/components/modals/Modal.d.ts +5 -7
  20. package/lib/components/modals/Modal.js +28 -61
  21. package/lib/components/modals/ModalBase.d.ts +9 -0
  22. package/lib/components/modals/ModalBase.js +68 -0
  23. package/lib/components/modals/ModalFooter.d.ts +1 -1
  24. package/lib/components/modals/imageGallery/BaseGallery.d.ts +18 -0
  25. package/lib/components/modals/imageGallery/BaseGallery.js +77 -0
  26. package/lib/components/modals/imageGallery/ImageGallery.d.ts +15 -0
  27. package/lib/components/modals/imageGallery/ImageGallery.helper.d.ts +3 -0
  28. package/lib/components/modals/imageGallery/ImageGallery.helper.js +11 -0
  29. package/lib/components/modals/imageGallery/ImageGallery.js +77 -0
  30. package/lib/components/modals/imageGallery/ImageGallery.stories.helper.d.ts +3 -0
  31. package/lib/components/modals/imageGallery/ImageGallery.stories.helper.js +108 -0
  32. package/lib/components/modals/imageGallery/ImageGalleryContent.d.ts +10 -0
  33. package/lib/components/modals/imageGallery/ImageGalleryContent.js +16 -0
  34. package/lib/components/modals/imageGallery/ImageGalleryPagination.d.ts +8 -0
  35. package/lib/components/modals/imageGallery/ImageGalleryPagination.js +30 -0
  36. package/lib/components/modals/imageGallery/useClasses.d.ts +0 -0
  37. package/lib/components/modals/imageGallery/useClasses.js +0 -0
  38. package/lib/components/snackbar/SnackbarProvider.js +4 -4
  39. package/lib/components/stepper-horizontal/StepperHorizontal.d.ts +1 -1
  40. package/lib/components/stepper-horizontal/StepperHorizontal.js +1 -1
  41. package/lib/components/stepper-horizontal/step-horizontal/StepHorizontal.d.ts +1 -1
  42. package/lib/components/stepper-vertical/StepperVertical.d.ts +1 -1
  43. package/lib/components/stepper-vertical/StepperVertical.js +1 -1
  44. package/lib/components/stepper-vertical/step-vertical/StepVertical.d.ts +1 -1
  45. package/lib/components/tab/Tabs.d.ts +1 -1
  46. package/lib/components/tab/Tabs.js +3 -0
  47. package/lib/components/tab/useTabScroll.js +0 -1
  48. package/lib/components/table-header-cell/TableHeaderCell.d.ts +1 -1
  49. package/lib/components/table-header-cell/TableHeaderCell.js +10 -4
  50. package/lib/forms/checkbox/Checkbox.d.ts +5 -4
  51. package/lib/forms/checkbox/Checkbox.js +16 -18
  52. package/lib/forms/radio/RadioGroup.js +1 -1
  53. package/lib/forms/select/Select.d.ts +4 -10
  54. package/lib/forms/select/Select.js +96 -126
  55. package/lib/forms/select/list-item/ListItem.d.ts +6 -0
  56. package/lib/forms/select/list-item/ListItem.js +24 -0
  57. package/lib/forms/select/select-option/SelectOption.d.ts +2 -2
  58. package/lib/forms/select/utils.d.ts +2 -0
  59. package/lib/forms/select/utils.js +17 -0
  60. package/lib/forms/text-editor/TextEditor.d.ts +2 -1
  61. package/lib/forms/text-editor/TextEditor.js +29 -14
  62. package/lib/forms/text-input/TextInput.d.ts +1 -1
  63. package/lib/forms/time-picker/TimePicker.d.ts +1 -1
  64. package/lib/forms/time-picker/time-picker-dropdown/TimePickerDropdown.d.ts +1 -1
  65. package/lib/helper/types.d.ts +17 -0
  66. package/lib/helper/useId.js +2 -1
  67. package/node/index.js +30 -2
  68. package/node/lib/components/accordion/Accordion.js +2 -3
  69. package/node/lib/components/accordion/AccordionContext.js +1 -2
  70. package/node/lib/components/accordion/accordion-header/AccordionHeader.js +1 -2
  71. package/node/lib/components/accordion/accordion-item/AccordionItem.js +1 -2
  72. package/node/lib/components/accordion/accordion-item/AccordionItemContext.js +1 -2
  73. package/node/lib/components/accordion/accordion-item/accordion-item-body/AccordionItemBody.js +1 -2
  74. package/node/lib/components/accordion/accordion-item/accordion-item-header/AccordionItemHeader.js +1 -2
  75. package/node/lib/components/breadcrumb/Breadcrumb.js +1 -2
  76. package/node/lib/components/buttons/button/Button.js +1 -2
  77. package/node/lib/components/card/Card.js +1 -2
  78. package/node/lib/components/card/CardBody.js +1 -2
  79. package/node/lib/components/card/CardHeader.js +1 -2
  80. package/node/lib/components/card/CardNotification.js +1 -2
  81. package/node/lib/components/chips/chip/Chip.js +2 -4
  82. package/node/lib/components/chips/chip-container/ChipContainer.js +1 -2
  83. package/node/lib/components/link-button/LinkButton.js +1 -2
  84. package/node/lib/components/loading-indicator/LoadingIndicator.js +2 -4
  85. package/node/lib/components/mobile-flyout/MobileFlyout.js +89 -0
  86. package/node/lib/components/mobile-flyout/MobileFlyoutContext.js +8 -0
  87. package/node/lib/components/mobile-flyout/mobile-flyout-item/MobileFlyoutItem.js +77 -0
  88. package/node/lib/components/mobile-flyout/mobile-flyout-page/MobileFlyoutPage.js +53 -0
  89. package/node/lib/components/modals/AlertModal.js +1 -2
  90. package/node/lib/components/modals/ConfirmModal.js +1 -2
  91. package/node/lib/components/modals/Modal.js +30 -63
  92. package/node/lib/components/modals/ModalBase.js +73 -0
  93. package/node/lib/components/modals/ModalFooter.js +1 -2
  94. package/node/lib/components/modals/Prompt.js +2 -2
  95. package/node/lib/components/modals/imageGallery/BaseGallery.js +83 -0
  96. package/node/lib/components/modals/imageGallery/ImageGallery.helper.js +18 -0
  97. package/node/lib/components/modals/imageGallery/ImageGallery.js +82 -0
  98. package/node/lib/components/modals/imageGallery/ImageGallery.stories.helper.js +123 -0
  99. package/node/lib/components/modals/imageGallery/ImageGalleryContent.js +20 -0
  100. package/node/lib/components/modals/imageGallery/ImageGalleryPagination.js +34 -0
  101. package/node/lib/components/modals/imageGallery/useClasses.js +1 -0
  102. package/node/lib/components/pagination/Pagination.js +4 -6
  103. package/node/lib/components/popovers/legend/Legend.js +1 -2
  104. package/node/lib/components/popovers/popover/Popover.js +3 -4
  105. package/node/lib/components/popovers/popover-menu/PopoverMenu.js +1 -2
  106. package/node/lib/components/popovers/tooltip/Tooltip.js +1 -2
  107. package/node/lib/components/progress/Progress.js +1 -2
  108. package/node/lib/components/search-input/SearchInput.js +1 -2
  109. package/node/lib/components/snackbar/Snackbar.js +1 -2
  110. package/node/lib/components/snackbar/SnackbarContext.js +1 -2
  111. package/node/lib/components/snackbar/SnackbarProvider.js +4 -5
  112. package/node/lib/components/stepper-horizontal/StepperHorizontal.js +5 -6
  113. package/node/lib/components/stepper-horizontal/step-horizontal/StepHorizontal.js +1 -2
  114. package/node/lib/components/stepper-vertical/StepperVertical.js +5 -6
  115. package/node/lib/components/stepper-vertical/step-vertical/StepVertical.js +1 -2
  116. package/node/lib/components/tab/Tabs.js +5 -4
  117. package/node/lib/components/tab/tab-pane/TabPane.js +1 -2
  118. package/node/lib/components/tab/useTabScroll.js +3 -2
  119. package/node/lib/components/table-header-cell/TableHeaderCell.js +11 -6
  120. package/node/lib/forms/checkbox/Checkbox.js +17 -22
  121. package/node/lib/forms/color-indicator/ColorIndicator.js +3 -4
  122. package/node/lib/forms/color-picker/ColorPicker.js +4 -6
  123. package/node/lib/forms/date-picker/DatePicker.js +1 -2
  124. package/node/lib/forms/date-range-picker/DateRangePicker.js +1 -2
  125. package/node/lib/forms/radio/RadioButton.js +1 -2
  126. package/node/lib/forms/radio/RadioGroup.js +2 -3
  127. package/node/lib/forms/radio/RadioGroupContext.js +1 -2
  128. package/node/lib/forms/segment/Segment.js +1 -2
  129. package/node/lib/forms/segment/segment-control/SegmentControl.js +3 -4
  130. package/node/lib/forms/select/Select.js +99 -130
  131. package/node/lib/forms/select/list-item/ListItem.js +33 -0
  132. package/node/lib/forms/select/select-option/SelectOption.js +4 -6
  133. package/node/lib/forms/select/utils.js +23 -0
  134. package/node/lib/forms/slider/Slider.js +3 -4
  135. package/node/lib/forms/switch/Switch.js +1 -2
  136. package/node/lib/forms/text-area/TextArea.js +3 -4
  137. package/node/lib/forms/text-editor/TextEditor.js +29 -15
  138. package/node/lib/forms/text-editor/TextEditorButton.js +1 -2
  139. package/node/lib/forms/text-input/TextInput.js +3 -4
  140. package/node/lib/forms/time-picker/TimePicker.js +3 -4
  141. package/node/lib/forms/time-picker/time-picker-dropdown/TimePickerDropdown.js +3 -4
  142. package/node/lib/helper/index.js +1 -2
  143. package/node/lib/helper/useId.js +2 -1
  144. package/package.json +2 -2
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.MobileFlyoutPage = void 0;
7
+ var _classnames = _interopRequireDefault(require("classnames"));
8
+ var _react = require("react");
9
+ var _MobileFlyoutContext = _interopRequireDefault(require("../MobileFlyoutContext"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ const MobileFlyoutPage = exports.MobileFlyoutPage = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
13
+ let {
14
+ back,
15
+ children,
16
+ name,
17
+ root,
18
+ ...props
19
+ } = _ref;
20
+ const {
21
+ visible,
22
+ setVisible,
23
+ back: backContext
24
+ } = (0, _react.useContext)(_MobileFlyoutContext.default);
25
+ const innerVisible = root || name && visible.includes(name);
26
+ const innerBack = back ?? backContext ?? 'Back';
27
+ function handleChange() {
28
+ if (name) {
29
+ setVisible(name);
30
+ }
31
+ }
32
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
33
+ className: (0, _classnames.default)('fwe-mobile-flyout-page', {
34
+ 'fwe-opened': innerVisible
35
+ }),
36
+ ref: ref,
37
+ ...props,
38
+ children: [!root && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
39
+ tabIndex: 0,
40
+ role: "button",
41
+ className: "fwe-page-back",
42
+ onClick: handleChange,
43
+ onKeyUp: handleChange,
44
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
45
+ children: innerBack
46
+ })]
47
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
48
+ className: "fwe-mobile-flyout-item-container",
49
+ children: children
50
+ })]
51
+ });
52
+ });
53
+ var _default = exports.default = MobileFlyoutPage;
@@ -78,5 +78,4 @@ function AlertModal(_ref) {
78
78
  })
79
79
  });
80
80
  }
81
- var _default = AlertModal;
82
- exports.default = _default;
81
+ var _default = exports.default = AlertModal;
@@ -58,5 +58,4 @@ function ConfirmModal(_ref) {
58
58
  })
59
59
  });
60
60
  }
61
- var _default = ConfirmModal;
62
- exports.default = _default;
61
+ var _default = exports.default = ConfirmModal;
@@ -5,14 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
- var _classnames = _interopRequireDefault(require("classnames"));
9
- var _reactTransitionGroup = require("react-transition-group");
10
- var _reactOutsideClickHandler = _interopRequireDefault(require("react-outside-click-handler"));
11
- var _useForkRef = _interopRequireDefault(require("../../helper/useForkRef"));
8
+ var _ModalBase = _interopRequireDefault(require("./ModalBase"));
12
9
  var _jsxRuntime = require("react/jsx-runtime");
13
10
  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 (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; }
11
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
13
  const Modal = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
17
14
  let {
18
15
  head,
@@ -22,63 +19,33 @@ const Modal = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
22
19
  className,
23
20
  children
24
21
  } = _ref;
25
- const backdropRef = (0, _react.useRef)(null);
26
- const modalRef = (0, _react.useRef)(null);
27
- const combinedRef = (0, _useForkRef.default)(ref, modalRef);
28
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
29
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
30
- nodeRef: backdropRef,
31
- unmountOnExit: true,
32
- timeout: {
33
- exit: 600
34
- },
35
- in: isOpen,
36
- classNames: "fr-modal-backdrop",
37
- appear: true,
38
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
39
- ref: backdropRef,
40
- className: "fr-modal-backdrop fwe-modal-backdrop"
22
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ModalBase.default, {
23
+ isOpen: isOpen,
24
+ className: className,
25
+ ref: ref,
26
+ onClose: onClose,
27
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
28
+ className: "fwe-modal-close",
29
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
30
+ type: "button",
31
+ "aria-label": "Close",
32
+ className: "fwe-btn fwe-btn-link fwe-dark",
33
+ onClick: onClose,
34
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
35
+ "aria-hidden": "true",
36
+ className: "fwe-icon fwe-icon-close-small"
37
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
38
+ className: "fwe-sr-only",
39
+ children: "Close"
40
+ })]
41
41
  })
42
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactOutsideClickHandler.default, {
43
- onOutsideClick: () => onClose ? onClose() : undefined,
44
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
45
- ref: modalRef,
46
- unmountOnExit: true,
47
- classNames: "fr-modal",
48
- appear: true,
49
- in: isOpen,
50
- timeout: {
51
- exit: 600
52
- },
53
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
54
- ref: combinedRef,
55
- className: (0, _classnames.default)('fr-modal fwe-modal', className),
56
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
57
- className: "fwe-modal-close",
58
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
59
- type: "button",
60
- "aria-label": "Close",
61
- className: "fwe-btn fwe-btn-link fwe-dark",
62
- onClick: onClose,
63
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
64
- "aria-hidden": "true",
65
- className: "fwe-icon fwe-icon-close-small"
66
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
67
- className: "fwe-sr-only",
68
- children: "Close"
69
- })]
70
- })
71
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
72
- className: "fwe-modal-header",
73
- children: head
74
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
75
- className: "fwe-modal-body",
76
- children: body
77
- }), children]
78
- })
79
- })
80
- })]
42
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
43
+ className: "fwe-modal-header",
44
+ children: head
45
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
46
+ className: "fwe-modal-body",
47
+ children: body
48
+ }), children]
81
49
  });
82
50
  });
83
- var _default = Modal;
84
- exports.default = _default;
51
+ var _default = exports.default = Modal;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _classnames = _interopRequireDefault(require("classnames"));
8
+ var _react = require("react");
9
+ var _reactDom = _interopRequireDefault(require("react-dom"));
10
+ var _reactTransitionGroup = require("react-transition-group");
11
+ var _useForkRef = _interopRequireDefault(require("../../helper/useForkRef"));
12
+ var _useOnClickOutside = _interopRequireDefault(require("../../helper/useOnClickOutside"));
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ const ModalBase = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
16
+ let {
17
+ isOpen,
18
+ onClose,
19
+ className,
20
+ children
21
+ } = _ref;
22
+ const backdropRef = (0, _react.useRef)(null);
23
+ const modalRef = (0, _react.useRef)(null);
24
+ const divRef = (0, _react.useRef)(null);
25
+ const combinedRef = (0, _useForkRef.default)(ref, modalRef);
26
+ const allRefs = (0, _useForkRef.default)(combinedRef, divRef);
27
+ const container = divRef?.current?.ownerDocument || document;
28
+ (0, _useOnClickOutside.default)(divRef, () => onClose?.());
29
+ (0, _react.useEffect)(() => {
30
+ const handleKeyDown = event => {
31
+ if (event.key === 'Escape') {
32
+ onClose?.();
33
+ }
34
+ };
35
+ container.addEventListener('keydown', handleKeyDown);
36
+ return () => container.removeEventListener('keydown', handleKeyDown);
37
+ }, [onClose, container]);
38
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
39
+ children: /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
40
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
41
+ nodeRef: backdropRef,
42
+ unmountOnExit: true,
43
+ timeout: {
44
+ exit: 600
45
+ },
46
+ in: isOpen,
47
+ classNames: "fr-modal-backdrop",
48
+ appear: true,
49
+ component: null,
50
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
51
+ ref: backdropRef,
52
+ className: "fr-modal-backdrop fwe-modal-backdrop"
53
+ })
54
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
55
+ ref: modalRef,
56
+ unmountOnExit: true,
57
+ classNames: "fr-modal",
58
+ appear: true,
59
+ in: isOpen,
60
+ timeout: {
61
+ exit: 600
62
+ },
63
+ component: null,
64
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
65
+ ref: allRefs,
66
+ className: (0, _classnames.default)('fr-modal fwe-modal', className),
67
+ children: children
68
+ })
69
+ })]
70
+ }), container.body)
71
+ });
72
+ });
73
+ var _default = exports.default = ModalBase;
@@ -22,5 +22,4 @@ const ModalFooter = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
22
22
  })
23
23
  });
24
24
  });
25
- var _default = ModalFooter;
26
- exports.default = _default;
25
+ var _default = exports.default = ModalFooter;
@@ -10,8 +10,8 @@ var _Modal = _interopRequireDefault(require("./Modal"));
10
10
  var _ModalFooter = _interopRequireDefault(require("./ModalFooter"));
11
11
  var _jsxRuntime = require("react/jsx-runtime");
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 (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; }
13
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  function Prompt(_ref) {
16
16
  let {
17
17
  title,
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = BaseGallery;
7
+ require("swiper/css");
8
+ var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _react = require("react");
10
+ var _swiper = require("swiper");
11
+ var _react2 = require("swiper/react");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function BaseGallery(_ref) {
15
+ let {
16
+ images,
17
+ thumbnailImages,
18
+ onSlideChanged,
19
+ startIndex
20
+ } = _ref;
21
+ const [thumbsSwiper, setThumbsSwiper] = (0, _react.useState)(null);
22
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
23
+ className: "fwe-image-gallery-wrapper",
24
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Swiper, {
25
+ initialSlide: startIndex,
26
+ thumbs: {
27
+ swiper: thumbsSwiper
28
+ },
29
+ modules: [_swiper.Thumbs, _swiper.Navigation],
30
+ navigation: {
31
+ nextEl: '.fwe-navigate-btn-up',
32
+ prevEl: '.fwe-navigate-btn-down'
33
+ },
34
+ zoom: true,
35
+ className: "gallery-swiper fwe-image-gallery",
36
+ spaceBetween: 0,
37
+ onSlideChange: slider => onSlideChanged?.(slider.activeIndex),
38
+ children: images.map(_ref2 => {
39
+ let {
40
+ containMode,
41
+ alt,
42
+ content,
43
+ ...image
44
+ } = _ref2;
45
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.SwiperSlide, {
46
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
47
+ className: "swiper-zoom-container",
48
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
49
+ ...image,
50
+ className: (0, _classnames.default)({
51
+ 'fwe-object-fit-contain fwe-p-m': containMode
52
+ }, image.className),
53
+ alt: alt
54
+ })
55
+ })
56
+ }, image.src);
57
+ })
58
+ }), thumbnailImages && /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Swiper, {
59
+ freeMode: true,
60
+ slidesPerView: "auto",
61
+ className: "thumbs-swiper fwe-image-gallery-thumbs",
62
+ modules: [_swiper.Thumbs],
63
+ watchSlidesProgress: true,
64
+ onSwiper: setThumbsSwiper,
65
+ children: thumbnailImages.map(_ref3 => {
66
+ let {
67
+ containMode,
68
+ alt,
69
+ ...image
70
+ } = _ref3;
71
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.SwiperSlide, {
72
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
73
+ ...image,
74
+ className: (0, _classnames.default)({
75
+ 'fwe-object-fit-contain fwe-p-xxxs': containMode
76
+ }, image.className),
77
+ alt: alt
78
+ })
79
+ }, image.src);
80
+ })
81
+ })]
82
+ });
83
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _classnames = _interopRequireDefault(require("classnames"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const getClasses = (thumbnailImages, descriptiveContent, className) => {
10
+ const base = 'fwe-modal-image-gallery';
11
+ const thumbnail = `${base}--with-thumbnails`;
12
+ const container = `${base}--with-container`;
13
+ return (0, _classnames.default)(base, {
14
+ [thumbnail]: [thumbnailImages],
15
+ [container]: descriptiveContent
16
+ }, className);
17
+ };
18
+ var _default = exports.default = getClasses;
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _ModalBase = _interopRequireDefault(require("../ModalBase"));
9
+ var _BaseGallery = _interopRequireDefault(require("./BaseGallery"));
10
+ var _ImageGalleryContent = _interopRequireDefault(require("./ImageGalleryContent"));
11
+ var _ImageGalleryPagination = _interopRequireDefault(require("./ImageGalleryPagination"));
12
+ var _ImageGallery = _interopRequireDefault(require("./ImageGallery.helper"));
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ const ImageGallery = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
16
+ let {
17
+ isOpen,
18
+ startIndex,
19
+ images,
20
+ thumbnailImages,
21
+ descriptiveContent,
22
+ children,
23
+ className,
24
+ pagination,
25
+ onClose,
26
+ onSlideChanged,
27
+ ...props
28
+ } = _ref;
29
+ const [currentIndex, setCurrentIndex] = (0, _react.useState)(startIndex + 1);
30
+ function handleChange(index) {
31
+ setCurrentIndex(index + 1);
32
+ onSlideChanged?.(index);
33
+ }
34
+ function handleClose() {
35
+ setCurrentIndex(startIndex + 1);
36
+ onClose?.();
37
+ }
38
+ const classes = (0, _ImageGallery.default)(thumbnailImages, descriptiveContent, className);
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalBase.default, {
40
+ onClose: handleClose,
41
+ className: classes,
42
+ ...props,
43
+ isOpen: isOpen,
44
+ ref: ref,
45
+ children: isOpen && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
46
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
47
+ className: "fwe-image-gallery-header",
48
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageGalleryPagination.default, {
49
+ currentIndex: currentIndex,
50
+ length: images.length,
51
+ pagination: pagination
52
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
53
+ "aria-label": "close",
54
+ type: "button",
55
+ className: "fwe-btn fwe-btn-link fwe-ml-auto",
56
+ onClick: handleClose,
57
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
58
+ className: "fwe-icon fwe-icon-lg fwe-color-white fwe-icon-menu-close fwe-modal-image-gallery-close"
59
+ })
60
+ })]
61
+ }), descriptiveContent ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
62
+ className: "fwe-image-gallery-container",
63
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseGallery.default, {
64
+ startIndex: startIndex,
65
+ images: images,
66
+ thumbnailImages: thumbnailImages,
67
+ onSlideChanged: handleChange,
68
+ children: children
69
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageGalleryContent.default, {
70
+ imageContent: images[currentIndex - 1]?.content
71
+ })]
72
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseGallery.default, {
73
+ startIndex: startIndex,
74
+ images: images,
75
+ thumbnailImages: thumbnailImages,
76
+ onSlideChanged: handleChange,
77
+ children: children
78
+ })]
79
+ })
80
+ });
81
+ });
82
+ var _default = exports.default = ImageGallery;
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _gallery = _interopRequireDefault(require("../../../../../../web-essentials/stories/assets/gallery-01.webp"));
8
+ var _gallery2 = _interopRequireDefault(require("../../../../../../web-essentials/stories/assets/gallery-02.webp"));
9
+ var _gallery3 = _interopRequireDefault(require("../../../../../../web-essentials/stories/assets/gallery-03.webp"));
10
+ var _gallery4 = _interopRequireDefault(require("../../../../../../web-essentials/stories/assets/gallery-04.webp"));
11
+ var _gallery5 = _interopRequireDefault(require("../../../../../../web-essentials/stories/assets/gallery-05.webp"));
12
+ var _gallery6 = _interopRequireDefault(require("../../../../../../web-essentials/stories/assets/gallery-06.webp"));
13
+ var _gallery7 = _interopRequireDefault(require("../../../../../../web-essentials/stories/assets/gallery-07.webp"));
14
+ var _gallery8 = _interopRequireDefault(require("../../../../../../web-essentials/stories/assets/gallery-08.webp"));
15
+ var _gallery9 = _interopRequireDefault(require("../../../../../../web-essentials/stories/assets/gallery-09.webp"));
16
+ var _gallery10 = _interopRequireDefault(require("../../../../../../web-essentials/stories/assets/gallery-10.webp"));
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ /* eslint-disable import/no-relative-packages */
20
+ // @ts-ignore
21
+
22
+ // @ts-ignore
23
+
24
+ // @ts-ignore
25
+
26
+ // @ts-ignore
27
+
28
+ // @ts-ignore
29
+
30
+ // @ts-ignore
31
+
32
+ // @ts-ignore
33
+
34
+ // @ts-ignore
35
+
36
+ // @ts-ignore
37
+
38
+ // @ts-ignore
39
+
40
+ const images = [{
41
+ src: _gallery.default,
42
+ alt: 'Asset1',
43
+ content: {
44
+ title: 'Asset 1',
45
+ body: 'Asset 1 description'
46
+ }
47
+ }, {
48
+ src: _gallery2.default,
49
+ alt: 'Asset2',
50
+ containMode: true,
51
+ content: {
52
+ title: 'Asset 2',
53
+ body: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
54
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
55
+ children: "Asset 2 description with some html inside."
56
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("ul", {
57
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
58
+ children: "bullet point 1"
59
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
60
+ children: "bullet point 2"
61
+ })]
62
+ })]
63
+ })
64
+ }
65
+ }, {
66
+ src: _gallery3.default,
67
+ alt: 'Asset3',
68
+ containMode: true,
69
+ content: {
70
+ title: 'Asset 3',
71
+ body: 'Asset 3 description'
72
+ }
73
+ }, {
74
+ src: _gallery4.default,
75
+ alt: 'Asset4',
76
+ content: {
77
+ title: 'Asset 4',
78
+ body: 'Asset 4 description'
79
+ }
80
+ }, {
81
+ src: _gallery5.default,
82
+ alt: 'Asset5',
83
+ content: {
84
+ title: 'Asset 5',
85
+ body: 'Asset 5 description'
86
+ }
87
+ }, {
88
+ src: _gallery6.default,
89
+ alt: 'Asset6',
90
+ content: {
91
+ title: 'Asset 6',
92
+ body: 'Asset 6 description'
93
+ }
94
+ }, {
95
+ src: _gallery7.default,
96
+ alt: 'Asset7',
97
+ content: {
98
+ title: 'Asset 7',
99
+ body: 'Asset 7 description'
100
+ }
101
+ }, {
102
+ src: _gallery8.default,
103
+ alt: 'Asset8',
104
+ content: {
105
+ title: 'Asset 8',
106
+ body: 'Asset 8 description'
107
+ }
108
+ }, {
109
+ src: _gallery9.default,
110
+ alt: 'Asset9',
111
+ content: {
112
+ title: 'Asset 9',
113
+ body: 'Asset 9 description'
114
+ }
115
+ }, {
116
+ src: _gallery10.default,
117
+ alt: 'Asset10',
118
+ content: {
119
+ title: 'Asset 10',
120
+ body: 'Asset 1ß description'
121
+ }
122
+ }];
123
+ var _default = exports.default = images;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = ImageGalleryContent;
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ function ImageGalleryContent(_ref) {
9
+ let {
10
+ imageContent
11
+ } = _ref;
12
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
13
+ children: imageContent && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
14
+ className: "fwe-image-gallery-content",
15
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h3", {
16
+ children: imageContent.title
17
+ }), imageContent.body]
18
+ })
19
+ });
20
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = ImageGalleryPagination;
7
+ var _jsxRuntime = require("react/jsx-runtime");
8
+ function ImageGalleryPagination(_ref) {
9
+ let {
10
+ pagination,
11
+ currentIndex,
12
+ length
13
+ } = _ref;
14
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
15
+ children: pagination && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
16
+ className: "fwe-pagination fwe-pagination--on-dark-bg",
17
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
18
+ "aria-label": "previous",
19
+ type: "button",
20
+ className: "fwe-navigate-btn-down"
21
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
22
+ className: "fwe-page-current",
23
+ children: currentIndex
24
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
25
+ className: "fwe-page-max",
26
+ children: length
27
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
28
+ "aria-label": "next",
29
+ type: "button",
30
+ className: "fwe-navigate-btn-up"
31
+ })]
32
+ })
33
+ });
34
+ }
@@ -0,0 +1 @@
1
+ "use strict";