intelicoreact 1.5.40 → 1.5.41

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 (177) hide show
  1. package/package.json +1 -1
  2. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.interface.js +0 -4
  3. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.stories.js +0 -89
  4. package/dist/Atomic/FormElements/ActionAlert/ActionAlert.test.js +0 -130
  5. package/dist/Atomic/FormElements/ActionAlert/index.js +0 -17
  6. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.interface.js +0 -4
  7. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.stories.js +0 -81
  8. package/dist/Atomic/FormElements/AdvancedStatus/AdvancedStatus.test.js +0 -104
  9. package/dist/Atomic/FormElements/AdvancedStatus/index.js +0 -17
  10. package/dist/Atomic/FormElements/Calendar/Calendar.props.js +0 -4
  11. package/dist/Atomic/FormElements/Calendar/Calendar.stories.js +0 -108
  12. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.interface.js +0 -4
  13. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.stories.js +0 -100
  14. package/dist/Atomic/FormElements/CheckboxInput/CheckboxInput.test.js +0 -143
  15. package/dist/Atomic/FormElements/CheckboxInput/index.js +0 -17
  16. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.interface.js +0 -4
  17. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.stories.js +0 -94
  18. package/dist/Atomic/FormElements/CheckboxesLine/CheckboxesLine.test.js +0 -177
  19. package/dist/Atomic/FormElements/CheckboxesLine/index.js +0 -17
  20. package/dist/Atomic/FormElements/Datepicker/Datepicker.stories.js +0 -51
  21. package/dist/Atomic/FormElements/Dropdown/Dropdown.stories.js +0 -596
  22. package/dist/Atomic/FormElements/DropdownLiveSearch/DropdownLiveSearch.stories.js +0 -272
  23. package/dist/Atomic/FormElements/FileLoader/FileLoader.stories.js +0 -182
  24. package/dist/Atomic/FormElements/FileLoaderDescription/FileLoaderDescription.stories.js +0 -327
  25. package/dist/Atomic/FormElements/FileLoaderLocal/FileLoaderLocal.stories.js +0 -186
  26. package/dist/Atomic/FormElements/FileLoaderLocalGroup/FileLoaderLocalGroup.stories.js +0 -84
  27. package/dist/Atomic/FormElements/FormattedRawSSN/FormattedRawSSN.stories.js +0 -107
  28. package/dist/Atomic/FormElements/Input/Input.stories.js +0 -251
  29. package/dist/Atomic/FormElements/InputCalendar/InputCalendar.stories.js +0 -115
  30. package/dist/Atomic/FormElements/InputColor/InputColor.stories.js +0 -119
  31. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.interface.js +0 -4
  32. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.stories.js +0 -178
  33. package/dist/Atomic/FormElements/InputCurrency/InputCurrency.test.js +0 -129
  34. package/dist/Atomic/FormElements/InputCurrency/index.js +0 -16
  35. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.stories.js +0 -123
  36. package/dist/Atomic/FormElements/InputLink/InputLink.stories.js +0 -140
  37. package/dist/Atomic/FormElements/InputMask/InputMask.stories.js +0 -303
  38. package/dist/Atomic/FormElements/InputMask2/InputMask2.stories.js +0 -314
  39. package/dist/Atomic/FormElements/InputMask3/InputMask3.stories.js +0 -335
  40. package/dist/Atomic/FormElements/InputWithAction/InputWithAction.stories.js +0 -276
  41. package/dist/Atomic/FormElements/InputsRow/InputsRow.stories.js +0 -56
  42. package/dist/Atomic/FormElements/Label/Label.interface.js +0 -4
  43. package/dist/Atomic/FormElements/Label/Label.stories.js +0 -47
  44. package/dist/Atomic/FormElements/Label/Label.test.js +0 -167
  45. package/dist/Atomic/FormElements/Label/index.js +0 -17
  46. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.stories.js +0 -172
  47. package/dist/Atomic/FormElements/MultiSelect/MultiSelect.stories.js +0 -121
  48. package/dist/Atomic/FormElements/NumericInput/NumericInput.stories.js +0 -184
  49. package/dist/Atomic/FormElements/RadioGroup/RadioGroup.stories.js +0 -79
  50. package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.stories.js +0 -151
  51. package/dist/Atomic/FormElements/RadioInput/RadioInput.stories.js +0 -67
  52. package/dist/Atomic/FormElements/RadioRowSwitcher/RadioRowSwitcher.stories.js +0 -116
  53. package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.stories.js +0 -107
  54. package/dist/Atomic/FormElements/RangeInputs/RangeInputs.stories.js +0 -92
  55. package/dist/Atomic/FormElements/RangeList/RangeList.stories.js +0 -169
  56. package/dist/Atomic/FormElements/RangeSlider/RangeSlider.stories.js +0 -401
  57. package/dist/Atomic/FormElements/RangeSlider2/RangeSlider2.stories.js +0 -314
  58. package/dist/Atomic/FormElements/SwitchableRow/SwitchableRow.stories.js +0 -137
  59. package/dist/Atomic/FormElements/Switcher/Switcher.stories.js +0 -91
  60. package/dist/Atomic/FormElements/SwitcherCheckbox/SwitcherCheckbox.stories.js +0 -104
  61. package/dist/Atomic/FormElements/SwitcherHide/SwitcherHide.stories.js +0 -96
  62. package/dist/Atomic/FormElements/SwitcherRadio/SwitcherRadio.stories.js +0 -140
  63. package/dist/Atomic/FormElements/SwitcherRange/SwitcherRange.stories.js +0 -112
  64. package/dist/Atomic/FormElements/SwitcherRangeList/SwitcherRangeList.stories.js +0 -145
  65. package/dist/Atomic/FormElements/SwitcherTagsDropdown/SwitcherTagsDropdown.stories.js +0 -158
  66. package/dist/Atomic/FormElements/SwitcherTextarea/SwitcherTextarea.stories.js +0 -101
  67. package/dist/Atomic/FormElements/TagListToDropdown/TagListToDropdown.stories.js +0 -131
  68. package/dist/Atomic/FormElements/TagsDropdown/TagsDropdown.stories.js +0 -357
  69. package/dist/Atomic/FormElements/Text/Text.stories.js +0 -80
  70. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.stories.js +0 -106
  71. package/dist/Atomic/FormElements/TextSwitcher/TextSwitcher.test.js +0 -93
  72. package/dist/Atomic/FormElements/Textarea/Textarea.stories.js +0 -103
  73. package/dist/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.stories.js +0 -174
  74. package/dist/Atomic/FormElements/TimeRange/TimeRange.interface.js +0 -4
  75. package/dist/Atomic/FormElements/TimeRange/TimeRange.stories.js +0 -40
  76. package/dist/Atomic/FormElements/TimeRange/TimeRange.test.js +0 -163
  77. package/dist/Atomic/FormElements/TimeRange/index.js +0 -17
  78. package/dist/Atomic/FormElements/UserContacts/UserContact.test.js +0 -381
  79. package/dist/Atomic/FormElements/UserContacts/UserContacts.interface.js +0 -4
  80. package/dist/Atomic/FormElements/UserContacts/UserContacts.stories.js +0 -74
  81. package/dist/Atomic/FormElements/UserContacts/index.js +0 -17
  82. package/dist/Atomic/FormElements/VariantsListRadio/VariantsListRadio.stories.js +0 -193
  83. package/dist/Atomic/FormElements/WidgetPseudoTable/WidgetPseudoTable.stories.js +0 -147
  84. package/dist/Atomic/FormElements/WidgetWithSwitchableRows/WidgetWithSwitchableRows.stories.js +0 -151
  85. package/dist/Atomic/Layout/Header/Header.stories.js +0 -71
  86. package/dist/Atomic/Layout/MainMenu/MainMenu.stories.js +0 -115
  87. package/dist/Atomic/Layout/Spinner/Spinner.interface.js +0 -4
  88. package/dist/Atomic/Layout/Spinner/Spinner.stories.js +0 -46
  89. package/dist/Atomic/Layout/Spinner/Spinner.test.js +0 -54
  90. package/dist/Atomic/Layout/Spinner/index.js +0 -17
  91. package/dist/Atomic/UI/Accordion/Accordion.interface.js +0 -4
  92. package/dist/Atomic/UI/Accordion/Accordion.stories.js +0 -168
  93. package/dist/Atomic/UI/Accordion/Accordion.test.js +0 -54
  94. package/dist/Atomic/UI/Accordion/AccordionItem.test.js +0 -50
  95. package/dist/Atomic/UI/Accordion/index.js +0 -17
  96. package/dist/Atomic/UI/AccordionTable/AccordionTable.stories.js +0 -268
  97. package/dist/Atomic/UI/AccordionText/AccordionText.stories.js +0 -125
  98. package/dist/Atomic/UI/AdvancedTag/AdvancedTags.stories.js +0 -115
  99. package/dist/Atomic/UI/Alert/Alert.stories.js +0 -81
  100. package/dist/Atomic/UI/Arrow/Arrow.stories.js +0 -62
  101. package/dist/Atomic/UI/Box/Box.stories.js +0 -114
  102. package/dist/Atomic/UI/Button/Button.stories.js +0 -105
  103. package/dist/Atomic/UI/Button/Button.test.js +0 -147
  104. package/dist/Atomic/UI/ButtonsBar/ButtonsBar.stories.js +0 -129
  105. package/dist/Atomic/UI/Chart/Chart.stories.js +0 -93
  106. package/dist/Atomic/UI/CircleProgressBar/CircleProgressBar.stories.js +0 -85
  107. package/dist/Atomic/UI/DateTime/DateTime.stories.js +0 -50
  108. package/dist/Atomic/UI/DoubleString/DoubleString.stories.js +0 -79
  109. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.interface.js +0 -4
  110. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.stories.js +0 -98
  111. package/dist/Atomic/UI/DynamicIcon/DynamicIcon.test.js +0 -51
  112. package/dist/Atomic/UI/DynamicIcon/index.js +0 -17
  113. package/dist/Atomic/UI/ExampleChartIntegration/ExampleChartIntegration.stories.js +0 -98
  114. package/dist/Atomic/UI/Hint/Hint.stories.js +0 -101
  115. package/dist/Atomic/UI/Hint/index.js +0 -16
  116. package/dist/Atomic/UI/Modal/Modal.interface.js +0 -4
  117. package/dist/Atomic/UI/Modal/Modal.stories.js +0 -370
  118. package/dist/Atomic/UI/Modal/ModalHOC.stories.js +0 -191
  119. package/dist/Atomic/UI/Modal/ModalHOC.test.js +0 -187
  120. package/dist/Atomic/UI/Modal/index.js +0 -26
  121. package/dist/Atomic/UI/Modal/partials/ModalFooter.test.js +0 -118
  122. package/dist/Atomic/UI/Modal/partials/ModalTitle.test.js +0 -126
  123. package/dist/Atomic/UI/Modal/partials/useMobileModal.test.js +0 -133
  124. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.interface.js +0 -4
  125. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.stories.js +0 -513
  126. package/dist/Atomic/UI/MonoAccordion/MonoAccordion.test.js +0 -84
  127. package/dist/Atomic/UI/MonoAccordion/index.js +0 -17
  128. package/dist/Atomic/UI/NavLine/NavLine.interface.js +0 -4
  129. package/dist/Atomic/UI/NavLine/NavLine.stories.js +0 -434
  130. package/dist/Atomic/UI/NavLine/NavLine.test.js +0 -311
  131. package/dist/Atomic/UI/NavLine/index.js +0 -17
  132. package/dist/Atomic/UI/PageTitle/PageTitle.interface.js +0 -4
  133. package/dist/Atomic/UI/PageTitle/PageTitle.stories.js +0 -62
  134. package/dist/Atomic/UI/PageTitle/PageTitle.test.js +0 -181
  135. package/dist/Atomic/UI/PageTitle/index.js +0 -17
  136. package/dist/Atomic/UI/PieChart/PieChar.interface.js +0 -4
  137. package/dist/Atomic/UI/PieChart/PieChart.stories.js +0 -82
  138. package/dist/Atomic/UI/PieChart/PieChart.test.js +0 -142
  139. package/dist/Atomic/UI/PieChart/index.js +0 -26
  140. package/dist/Atomic/UI/Price/Price.interface.js +0 -4
  141. package/dist/Atomic/UI/Price/Price.stories.js +0 -52
  142. package/dist/Atomic/UI/Price/Price.test.js +0 -83
  143. package/dist/Atomic/UI/Price/index.js +0 -17
  144. package/dist/Atomic/UI/PriceRange/PriceRange.interface.js +0 -4
  145. package/dist/Atomic/UI/PriceRange/PriceRange.stories.js +0 -51
  146. package/dist/Atomic/UI/PriceRange/PriceRange.test.js +0 -72
  147. package/dist/Atomic/UI/PriceRange/index.js +0 -17
  148. package/dist/Atomic/UI/ProgressLine/ProgressLine.interface.js +0 -4
  149. package/dist/Atomic/UI/ProgressLine/ProgressLine.stories.js +0 -163
  150. package/dist/Atomic/UI/ProgressLine/ProgressLine.test.js +0 -60
  151. package/dist/Atomic/UI/ProgressLine/index.js +0 -17
  152. package/dist/Atomic/UI/Status/Status.interface.js +0 -4
  153. package/dist/Atomic/UI/Status/Status.stories.js +0 -79
  154. package/dist/Atomic/UI/Status/Status.test.js +0 -103
  155. package/dist/Atomic/UI/Status/index.js +0 -17
  156. package/dist/Atomic/UI/Table/Table.stories.js +0 -250
  157. package/dist/Atomic/UI/Tag/Tag.interface.js +0 -4
  158. package/dist/Atomic/UI/Tag/Tag.stories.js +0 -108
  159. package/dist/Atomic/UI/Tag/Tag.test.js +0 -75
  160. package/dist/Atomic/UI/Tag/index.js +0 -17
  161. package/dist/Atomic/UI/TagList/TagList.stories.js +0 -169
  162. package/dist/Atomic/UI/UserBox/UserBox.interface.js +0 -4
  163. package/dist/Atomic/UI/UserBox/UserBox.stories.js +0 -57
  164. package/dist/Atomic/UI/UserBox/UserBox.test.js +0 -136
  165. package/dist/Atomic/UI/UserBox/index.js +0 -17
  166. package/dist/Atomic/UI/WizardStepper/WizardStepper.stories.js +0 -70
  167. package/dist/Functions/useIsMobile/index.js +0 -17
  168. package/dist/Functions/useIsMobile/useIsMobile.js +0 -33
  169. package/dist/Functions/useIsMobile/useIsMobile.test.js +0 -104
  170. package/dist/Functions/useKeyPress/useHandleKeyPress.test.js +0 -96
  171. package/dist/Functions/useKeyPress/useKeyPress.test.js +0 -87
  172. package/dist/Molecular/FormElement/FormElement.stories.js +0 -92
  173. package/dist/Molecular/FormWithDependOn/FormWithDependOn.stories.js +0 -301
  174. package/dist/Molecular/InputAddress/InputAddress.stories.js +0 -541
  175. package/dist/Molecular/InputPassword/InputPassword.stories.js +0 -86
  176. package/dist/types/base.interface.js +0 -4
  177. package/dist/types/base.types.js +0 -4
@@ -1,133 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _jsxruntime = require("react/jsx-runtime");
6
- const _react = require("@testing-library/react");
7
- const _useIsMobile = /*#__PURE__*/ _interop_require_default(require("../../../../Functions/useIsMobile"));
8
- const _useMobileModal = /*#__PURE__*/ _interop_require_default(require("./useMobileModal"));
9
- function _interop_require_default(obj) {
10
- return obj && obj.__esModule ? obj : {
11
- default: obj
12
- };
13
- }
14
- jest.mock('../../../../Functions/useIsMobile', ()=>({
15
- __esModule: true,
16
- default: jest.fn(()=>({
17
- isMobile: true
18
- }))
19
- }));
20
- describe('useMobileModal', ()=>{
21
- beforeEach(()=>{
22
- jest.clearAllMocks();
23
- _useIsMobile.default.mockImplementation(()=>({
24
- isMobile: true
25
- }));
26
- });
27
- it('should initialize with default values', ()=>{
28
- const { result } = (0, _react.renderHook)(()=>(0, _useMobileModal.default)({
29
- isOpen: false,
30
- withMobileLogic: false
31
- }));
32
- expect(result.current.MODALS_LOGIC).toEqual({
33
- IS_HEADER_HIDDEN: false,
34
- IS_HEADER_STICKY: false,
35
- IS_FOOTER_HIDDEN: false,
36
- IS_FOOTER_STICKY: false
37
- });
38
- expect(result.current.scrollTop).toBe(0);
39
- expect(result.current.scrollHeight).toBe(1);
40
- });
41
- it('should initialize with fixed footer when withFixedFooter is true', ()=>{
42
- const { result } = (0, _react.renderHook)(()=>(0, _useMobileModal.default)({
43
- isOpen: true,
44
- withMobileLogic: true,
45
- withFixedFooter: true
46
- }));
47
- expect(result.current.MODALS_LOGIC.IS_FOOTER_STICKY).toBe(true);
48
- });
49
- it('should provide all required refs', ()=>{
50
- const { result } = (0, _react.renderHook)(()=>(0, _useMobileModal.default)({
51
- isOpen: true,
52
- withMobileLogic: true
53
- }));
54
- expect(result.current.modalMobileContainerRef).toBeDefined();
55
- expect(result.current.modalMobileHeaderRef).toBeDefined();
56
- expect(result.current.modalMobileBodyRef).toBeDefined();
57
- expect(result.current.modalMobileFooterRef).toBeDefined();
58
- });
59
- it('should provide scroll directions', ()=>{
60
- const { result } = (0, _react.renderHook)(()=>(0, _useMobileModal.default)({
61
- isOpen: true,
62
- withMobileLogic: true
63
- }));
64
- expect(result.current.SCROLL_DIRECTION).toEqual({
65
- UP: 'up',
66
- DOWN: 'down'
67
- });
68
- });
69
- describe('renderModal', ()=>{
70
- it('should return original content when not mobile', ()=>{
71
- _useIsMobile.default.mockImplementation(()=>({
72
- isMobile: false
73
- }));
74
- const { result } = (0, _react.renderHook)(()=>(0, _useMobileModal.default)({
75
- isOpen: true,
76
- withMobileLogic: true
77
- }));
78
- const testContent = /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
79
- children: "Test Content"
80
- });
81
- const rendered = result.current.renderModal(testContent);
82
- expect(rendered).toBe(testContent);
83
- });
84
- it('should return original content when withMobileLogic is false', ()=>{
85
- const { result } = (0, _react.renderHook)(()=>(0, _useMobileModal.default)({
86
- isOpen: true,
87
- withMobileLogic: false
88
- }));
89
- const testContent = /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
90
- children: "Test Content"
91
- });
92
- const rendered = result.current.renderModal(testContent);
93
- expect(rendered).toBe(testContent);
94
- });
95
- it('should return React element when mobile and withMobileLogic is true', ()=>{
96
- const { result } = (0, _react.renderHook)(()=>(0, _useMobileModal.default)({
97
- isOpen: true,
98
- withMobileLogic: true
99
- }));
100
- const testContent = /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
101
- children: "Test Content"
102
- });
103
- const rendered = result.current.renderModal(testContent);
104
- expect(React.isValidElement(rendered)).toBe(true);
105
- });
106
- });
107
- describe('props handling', ()=>{
108
- it('should handle undefined props', ()=>{
109
- const { result } = (0, _react.renderHook)(()=>(0, _useMobileModal.default)({}));
110
- expect(result.current.MODALS_LOGIC).toBeDefined();
111
- expect(result.current.scrollTop).toBeDefined();
112
- expect(result.current.scrollHeight).toBeDefined();
113
- });
114
- it('should handle all props as false', ()=>{
115
- const { result } = (0, _react.renderHook)(()=>(0, _useMobileModal.default)({
116
- isOpen: false,
117
- withMobileLogic: false,
118
- withFixedFooter: false
119
- }));
120
- expect(result.current.MODALS_LOGIC.IS_FOOTER_STICKY).toBe(false);
121
- });
122
- it('should handle modalRef prop', ()=>{
123
- const mockRef = {
124
- current: null
125
- };
126
- const { result } = (0, _react.renderHook)(()=>(0, _useMobileModal.default)({
127
- // @ts-ignore
128
- modalRef: mockRef
129
- }));
130
- expect(result.current.modalMobileContainerRef).toBeDefined();
131
- });
132
- });
133
- });
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
@@ -1,513 +0,0 @@
1
- // @ts-expect-error
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- function _export(target, all) {
7
- for(var name in all)Object.defineProperty(target, name, {
8
- enumerable: true,
9
- get: all[name]
10
- });
11
- }
12
- _export(exports, {
13
- AlternativeIcons: function() {
14
- return AlternativeIcons;
15
- },
16
- Basic: function() {
17
- return Basic;
18
- },
19
- CustomStyled: function() {
20
- return CustomStyled;
21
- },
22
- CustomStyledTitle: function() {
23
- return CustomStyledTitle;
24
- },
25
- Disabled: function() {
26
- return Disabled;
27
- },
28
- FormContent: function() {
29
- return FormContent;
30
- },
31
- LoadingState: function() {
32
- return LoadingState;
33
- },
34
- MultipleAccordions: function() {
35
- return MultipleAccordions;
36
- },
37
- NestedAccordions: function() {
38
- return NestedAccordions;
39
- },
40
- RichContent: function() {
41
- return RichContent;
42
- },
43
- TableContent: function() {
44
- return TableContent;
45
- },
46
- default: function() {
47
- return _default;
48
- }
49
- });
50
- const _jsxruntime = require("react/jsx-runtime");
51
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
52
- const _reactfeather = require("react-feather");
53
- const _MonoAccordion = /*#__PURE__*/ _interop_require_default(require("./MonoAccordion"));
54
- require("./partial/AnyOuterClass.scss");
55
- function _interop_require_default(obj) {
56
- return obj && obj.__esModule ? obj : {
57
- default: obj
58
- };
59
- }
60
- function _getRequireWildcardCache(nodeInterop) {
61
- if (typeof WeakMap !== "function") return null;
62
- var cacheBabelInterop = new WeakMap();
63
- var cacheNodeInterop = new WeakMap();
64
- return (_getRequireWildcardCache = function(nodeInterop) {
65
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
66
- })(nodeInterop);
67
- }
68
- function _interop_require_wildcard(obj, nodeInterop) {
69
- if (!nodeInterop && obj && obj.__esModule) {
70
- return obj;
71
- }
72
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
73
- return {
74
- default: obj
75
- };
76
- }
77
- var cache = _getRequireWildcardCache(nodeInterop);
78
- if (cache && cache.has(obj)) {
79
- return cache.get(obj);
80
- }
81
- var newObj = {
82
- __proto__: null
83
- };
84
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
85
- for(var key in obj){
86
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
87
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
88
- if (desc && (desc.get || desc.set)) {
89
- Object.defineProperty(newObj, key, desc);
90
- } else {
91
- newObj[key] = obj[key];
92
- }
93
- }
94
- }
95
- newObj.default = obj;
96
- if (cache) {
97
- cache.set(obj, newObj);
98
- }
99
- return newObj;
100
- }
101
- const _default = {
102
- title: 'UI/Accordion',
103
- component: _MonoAccordion.default,
104
- parameters: {
105
- docs: {
106
- description: {
107
- component: 'A flexible accordion component that supports custom content, icons, and animations.'
108
- }
109
- }
110
- },
111
- argTypes: {
112
- isIncludeOuterStyles: {
113
- control: 'boolean',
114
- description: 'Include additional outer styling class',
115
- defaultValue: false
116
- },
117
- disabled: {
118
- control: 'boolean',
119
- description: 'Disable accordion interaction'
120
- },
121
- className: {
122
- control: 'text',
123
- description: 'Additional CSS class names'
124
- }
125
- }
126
- };
127
- // Base Template
128
- const Template = (args)=>{
129
- const { isIncludeOuterStyles, children } = args;
130
- const [isOpen, setIsOpen] = (0, _react.useState)(false);
131
- if (!Array.isArray(children) || !children.length) {
132
- return null;
133
- }
134
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_MonoAccordion.default, {
135
- className: isIncludeOuterStyles ? 'any-outer-class__mono-accordion' : undefined,
136
- titleJSX: args.titleJSX,
137
- icon: isOpen ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronUp, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronDown, {}),
138
- isOpen: isOpen,
139
- onClick: ()=>setIsOpen(!isOpen),
140
- disabled: args.disabled,
141
- children: (children || []).map((el, idx)=>/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
142
- style: {
143
- padding: '5px 0'
144
- },
145
- children: el
146
- }, idx))
147
- });
148
- };
149
- const Basic = Template.bind({});
150
- Basic.args = {
151
- titleJSX: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
152
- children: "Basic Accordion"
153
- }),
154
- children: [
155
- 'First item',
156
- 'Second item',
157
- 'Third item'
158
- ]
159
- };
160
- const CustomStyledTitle = Template.bind({});
161
- CustomStyledTitle.args = {
162
- titleJSX: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
163
- style: {
164
- display: 'flex',
165
- flexDirection: 'column',
166
- gap: '4px'
167
- },
168
- children: [
169
- /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
170
- style: {
171
- fontWeight: 'bold'
172
- },
173
- children: "Custom Styled Title"
174
- }),
175
- /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
176
- style: {
177
- fontSize: '12px',
178
- color: '#666'
179
- },
180
- children: "With subtitle"
181
- })
182
- ]
183
- }),
184
- children: [
185
- 'Content item 1',
186
- 'Content item 2'
187
- ]
188
- };
189
- const RichContent = Template.bind({});
190
- RichContent.args = {
191
- titleJSX: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
192
- children: "Rich Content Example"
193
- }),
194
- children: [
195
- /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
196
- style: {
197
- display: 'flex',
198
- alignItems: 'center',
199
- gap: '8px'
200
- },
201
- children: [
202
- /*#__PURE__*/ (0, _jsxruntime.jsx)("img", {
203
- src: "https://via.placeholder.com/40",
204
- alt: "placeholder",
205
- style: {
206
- borderRadius: '50%'
207
- }
208
- }),
209
- /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
210
- children: [
211
- /*#__PURE__*/ (0, _jsxruntime.jsx)("h4", {
212
- style: {
213
- margin: 0
214
- },
215
- children: "John Doe"
216
- }),
217
- /*#__PURE__*/ (0, _jsxruntime.jsx)("p", {
218
- style: {
219
- margin: 0,
220
- color: '#666'
221
- },
222
- children: "Frontend Developer"
223
- })
224
- ]
225
- })
226
- ]
227
- }, "1"),
228
- /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
229
- style: {
230
- padding: '12px',
231
- backgroundColor: '#f5f5f5',
232
- borderRadius: '4px'
233
- },
234
- children: [
235
- /*#__PURE__*/ (0, _jsxruntime.jsx)("p", {
236
- children: "This is a card-like content block"
237
- }),
238
- /*#__PURE__*/ (0, _jsxruntime.jsx)("button", {
239
- type: "button",
240
- children: "Click me"
241
- })
242
- ]
243
- }, "2")
244
- ]
245
- };
246
- const AlternativeIcons = (args)=>{
247
- const [isOpen, setIsOpen] = (0, _react.useState)(false);
248
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_MonoAccordion.default, {
249
- ...args,
250
- titleJSX: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
251
- children: "Alternative Icons"
252
- }),
253
- icon: isOpen ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.Minus, {
254
- size: 18
255
- }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.Plus, {
256
- size: 18
257
- }),
258
- isOpen: isOpen,
259
- onClick: ()=>setIsOpen(!isOpen),
260
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)("p", {
261
- children: "Content with alternative icons"
262
- })
263
- });
264
- };
265
- const MultipleAccordions = ()=>{
266
- const [openStates, setOpenStates] = (0, _react.useState)([
267
- false,
268
- false,
269
- false
270
- ]);
271
- const toggleAccordion = (index)=>{
272
- setOpenStates((prev)=>prev.map((state, i)=>i === index ? !state : state));
273
- };
274
- return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
275
- style: {
276
- display: 'flex',
277
- flexDirection: 'column',
278
- gap: '8px'
279
- },
280
- children: [
281
- 'First',
282
- 'Second',
283
- 'Third'
284
- ].map((title, index)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_MonoAccordion.default, {
285
- titleJSX: /*#__PURE__*/ (0, _jsxruntime.jsxs)("span", {
286
- children: [
287
- title,
288
- ' ',
289
- "Accordion"
290
- ]
291
- }),
292
- icon: openStates[index] ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ArrowUp, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ArrowDown, {}),
293
- isOpen: openStates[index],
294
- onClick: ()=>toggleAccordion(index),
295
- children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("p", {
296
- children: [
297
- "Content for",
298
- title.toLowerCase(),
299
- ' ',
300
- "accordion"
301
- ]
302
- })
303
- }, index))
304
- });
305
- };
306
- const NestedAccordions = ()=>{
307
- const [parentOpen, setParentOpen] = (0, _react.useState)(false);
308
- const [childOpen, setChildOpen] = (0, _react.useState)(false);
309
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_MonoAccordion.default, {
310
- titleJSX: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
311
- children: "Parent Accordion"
312
- }),
313
- icon: parentOpen ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronUp, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronDown, {}),
314
- isOpen: parentOpen,
315
- onClick: ()=>setParentOpen(!parentOpen),
316
- children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
317
- style: {
318
- padding: '10px 0'
319
- },
320
- children: [
321
- /*#__PURE__*/ (0, _jsxruntime.jsx)("p", {
322
- children: "Parent content"
323
- }),
324
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_MonoAccordion.default, {
325
- titleJSX: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
326
- children: "Child Accordion"
327
- }),
328
- icon: childOpen ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronUp, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronDown, {}),
329
- isOpen: childOpen,
330
- onClick: ()=>setChildOpen(!childOpen),
331
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)("p", {
332
- children: "Child content"
333
- })
334
- })
335
- ]
336
- })
337
- });
338
- };
339
- const Disabled = Template.bind({});
340
- Disabled.args = {
341
- titleJSX: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
342
- children: "Disabled Accordion"
343
- }),
344
- disabled: true,
345
- children: [
346
- 'This content is not accessible'
347
- ]
348
- };
349
- const CustomStyled = Template.bind({});
350
- CustomStyled.args = {
351
- isIncludeOuterStyles: true,
352
- titleJSX: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
353
- children: "Custom Styled Accordion"
354
- }),
355
- children: [
356
- 'Content with custom styling'
357
- ]
358
- };
359
- const FormContent = ()=>{
360
- const [isOpen, setIsOpen] = (0, _react.useState)(false);
361
- const [formData, setFormData] = (0, _react.useState)({
362
- name: '',
363
- email: ''
364
- });
365
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_MonoAccordion.default, {
366
- titleJSX: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
367
- children: "Form Example"
368
- }),
369
- icon: isOpen ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronUp, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronDown, {}),
370
- isOpen: isOpen,
371
- onClick: ()=>setIsOpen(!isOpen),
372
- children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("form", {
373
- style: {
374
- display: 'flex',
375
- flexDirection: 'column',
376
- gap: '10px',
377
- padding: '10px 0'
378
- },
379
- children: [
380
- /*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
381
- type: "text",
382
- placeholder: "Name",
383
- value: formData.name,
384
- onChange: (e)=>setFormData((prev)=>({
385
- ...prev,
386
- name: e.target.value
387
- }))
388
- }),
389
- /*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
390
- type: "email",
391
- placeholder: "Email",
392
- value: formData.email,
393
- onChange: (e)=>setFormData((prev)=>({
394
- ...prev,
395
- email: e.target.value
396
- }))
397
- }),
398
- /*#__PURE__*/ (0, _jsxruntime.jsx)("button", {
399
- type: "button",
400
- children: "Submit"
401
- })
402
- ]
403
- })
404
- });
405
- };
406
- const TableContent = Template.bind({});
407
- TableContent.args = {
408
- titleJSX: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
409
- children: "Table Example"
410
- }),
411
- children: [
412
- /*#__PURE__*/ (0, _jsxruntime.jsxs)("table", {
413
- style: {
414
- width: '100%',
415
- borderCollapse: 'collapse'
416
- },
417
- children: [
418
- /*#__PURE__*/ (0, _jsxruntime.jsx)("thead", {
419
- children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("tr", {
420
- children: [
421
- /*#__PURE__*/ (0, _jsxruntime.jsx)("th", {
422
- style: {
423
- border: '1px solid #ddd',
424
- padding: '8px'
425
- },
426
- children: "Header 1"
427
- }),
428
- /*#__PURE__*/ (0, _jsxruntime.jsx)("th", {
429
- style: {
430
- border: '1px solid #ddd',
431
- padding: '8px'
432
- },
433
- children: "Header 2"
434
- })
435
- ]
436
- })
437
- }),
438
- /*#__PURE__*/ (0, _jsxruntime.jsxs)("tbody", {
439
- children: [
440
- /*#__PURE__*/ (0, _jsxruntime.jsxs)("tr", {
441
- children: [
442
- /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
443
- style: {
444
- border: '1px solid #ddd',
445
- padding: '8px'
446
- },
447
- children: "Data 1"
448
- }),
449
- /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
450
- style: {
451
- border: '1px solid #ddd',
452
- padding: '8px'
453
- },
454
- children: "Data 2"
455
- })
456
- ]
457
- }),
458
- /*#__PURE__*/ (0, _jsxruntime.jsxs)("tr", {
459
- children: [
460
- /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
461
- style: {
462
- border: '1px solid #ddd',
463
- padding: '8px'
464
- },
465
- children: "Data 3"
466
- }),
467
- /*#__PURE__*/ (0, _jsxruntime.jsx)("td", {
468
- style: {
469
- border: '1px solid #ddd',
470
- padding: '8px'
471
- },
472
- children: "Data 4"
473
- })
474
- ]
475
- })
476
- ]
477
- })
478
- ]
479
- }, "1")
480
- ]
481
- };
482
- const LoadingState = ()=>{
483
- const [isOpen, setIsOpen] = (0, _react.useState)(false);
484
- const [isLoading, setIsLoading] = (0, _react.useState)(false);
485
- const [content, setContent] = (0, _react.useState)(null);
486
- const handleClick = async ()=>{
487
- if (!isOpen) {
488
- setIsLoading(true);
489
- // Имитация загрузки данных
490
- await new Promise((resolve)=>setTimeout(resolve, 1000));
491
- setContent('Loaded content');
492
- setIsLoading(false);
493
- }
494
- setIsOpen(!isOpen);
495
- };
496
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_MonoAccordion.default, {
497
- titleJSX: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
498
- children: "Loading Example"
499
- }),
500
- icon: isOpen ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronUp, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactfeather.ChevronDown, {}),
501
- isOpen: isOpen,
502
- onClick: handleClick,
503
- children: isLoading ? /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
504
- style: {
505
- padding: '20px 0',
506
- textAlign: 'center'
507
- },
508
- children: "Loading..."
509
- }) : /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
510
- children: content
511
- })
512
- });
513
- };