@integry/sdk 4.5.2 → 4.5.3

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 (279) hide show
  1. package/.vscode/launch.json +2 -2
  2. package/THIRD_PARTY_LICENSES +0 -37
  3. package/dist/esm/index.csm.d.ts +12 -2
  4. package/dist/esm/index.csm.js +7262 -1
  5. package/dist/umd/index.umd.d.ts +9 -1
  6. package/dist/umd/index.umd.js +7262 -1
  7. package/jest.config.cjs +10 -0
  8. package/package.json +10 -4
  9. package/src/components/AddTagButton/index.ts +23 -0
  10. package/src/components/BasicSelect/index.ts +114 -0
  11. package/src/components/BasicSelect/styles.module.scss +44 -0
  12. package/src/components/Button/index.ts +94 -0
  13. package/src/components/Button/styles.module.scss +152 -0
  14. package/src/components/CheckboxGroup/Checkbox.ts +104 -0
  15. package/src/components/CheckboxGroup/index.ts +190 -0
  16. package/src/components/CheckboxGroup/styles.module.scss +63 -0
  17. package/src/components/CollapsedMenu/index.ts +101 -0
  18. package/src/components/CollapsedMenu/styles.module.scss +46 -0
  19. package/src/components/ConfigureFieldWrapper/index.ts +85 -0
  20. package/src/components/ConfigureFieldWrapper/styles.module.scss +57 -0
  21. package/src/components/EditableText/index.ts +121 -0
  22. package/src/components/EditableText/styles.module.scss +38 -0
  23. package/src/components/EditableTextArea/index.ts +143 -0
  24. package/src/components/EditableTextArea/styles.module.scss +91 -0
  25. package/src/components/ErrorMessage/index.ts +16 -0
  26. package/src/components/ErrorMessage/styles.module.scss +19 -0
  27. package/src/components/ErrorPage/index.ts +42 -0
  28. package/src/components/ErrorPage/styles.module.scss +26 -0
  29. package/src/components/Footer/index.ts +41 -0
  30. package/src/components/Footer/styles.module.scss +40 -0
  31. package/src/components/HTMLContent/index.tsx +275 -0
  32. package/src/components/HTMLContent/styles.module.scss +3 -0
  33. package/src/components/InfoBox/index.ts +48 -0
  34. package/src/components/InfoBox/styles.module.scss +21 -0
  35. package/src/components/Input/BaseInput/index.ts +170 -0
  36. package/src/components/Input/BaseInput/styles.module.scss +94 -0
  37. package/src/components/Input/DateInput/index.ts +103 -0
  38. package/src/components/Input/DateInput/styles.module.scss +50 -0
  39. package/src/components/Input/Input/index.ts +206 -0
  40. package/src/components/Input/Input/styles.module.scss +14 -0
  41. package/src/components/Input/PasswordInput/index.ts +164 -0
  42. package/src/components/Input/PasswordInput/styles.module.scss +37 -0
  43. package/src/components/Input/index.ts +7 -0
  44. package/src/components/Label/index.ts +61 -0
  45. package/src/components/Label/styles.module.scss +41 -0
  46. package/src/components/LargeLoader/index.ts +25 -0
  47. package/src/components/LargeLoader/styles.module.scss +16 -0
  48. package/src/components/Listbox/ListBoxItem.ts +57 -0
  49. package/src/components/Listbox/index.ts +479 -0
  50. package/src/components/Listbox/styles.module.scss +197 -0
  51. package/src/components/Loader/index.ts +25 -0
  52. package/src/components/Loader/styles.module.scss +16 -0
  53. package/src/components/MediaGallery/MediaGalleryModal.ts +82 -0
  54. package/src/components/MediaGallery/MediaSlider.ts +76 -0
  55. package/src/components/MediaGallery/index.ts +92 -0
  56. package/src/components/MediaGallery/styles.module.scss +156 -0
  57. package/src/components/MediaUpload/index.ts +233 -0
  58. package/src/components/MediaUpload/styles.module.scss +118 -0
  59. package/src/components/Modal/index.ts +87 -0
  60. package/src/components/Modal/styles.module.scss +441 -0
  61. package/src/components/MultipurposeField/Dropdown/ListBoxItem.tsx +58 -0
  62. package/src/components/MultipurposeField/Dropdown/index.tsx +981 -0
  63. package/src/components/MultipurposeField/Dropdown/styles.module.scss +208 -0
  64. package/src/components/MultipurposeField/TagMenu/index.ts +384 -0
  65. package/src/components/MultipurposeField/TagMenu/styles.module.scss +136 -0
  66. package/src/components/MultipurposeField/TagOptions/index.tsx +83 -0
  67. package/src/components/MultipurposeField/TagOptions/styles.module.scss +95 -0
  68. package/src/components/MultipurposeField/index.tsx +687 -0
  69. package/src/components/MultipurposeField/styles.module.scss +56 -0
  70. package/src/components/NewModal/index.ts +69 -0
  71. package/src/components/NewModal/styles.module.scss +70 -0
  72. package/src/components/OverflowTooltip/index.tsx +59 -0
  73. package/src/components/PopUp/ConfirmationPopUp/index.ts +58 -0
  74. package/src/components/PopUp/ConfirmationPopUp/styles.module.scss +49 -0
  75. package/src/components/PopUp/SuccessPopUp/index.ts +62 -0
  76. package/src/components/PopUp/SuccessPopUp/styles.module.scss +38 -0
  77. package/src/components/RadioGroup/Radio.ts +129 -0
  78. package/src/components/RadioGroup/index.ts +169 -0
  79. package/src/components/RadioGroup/styles.module.scss +81 -0
  80. package/src/components/Search/index.ts +69 -0
  81. package/src/components/Search/styles.module.scss +149 -0
  82. package/src/components/TabBar/Tab.ts +33 -0
  83. package/src/components/TabBar/index.ts +64 -0
  84. package/src/components/TabBar/styles.module.scss +43 -0
  85. package/src/components/Tag/index.ts +29 -0
  86. package/src/components/Tag/styles.module.scss +57 -0
  87. package/src/components/TextArea/index.ts +172 -0
  88. package/src/components/TextArea/styles.module.scss +70 -0
  89. package/src/components/TextContent/index.tsx +128 -0
  90. package/src/components/TextContent/styles.module.scss +6 -0
  91. package/src/components/ThreeDotLoader/index.ts +39 -0
  92. package/src/components/ThreeDotLoader/styles.module.scss +41 -0
  93. package/src/components/TimeInput/index.ts +129 -0
  94. package/src/components/TimeInput/styles.module.scss +16 -0
  95. package/src/components/Toggle/index.ts +34 -0
  96. package/src/components/Toggle/styles.module.scss +56 -0
  97. package/src/components/Toggle-v2/index.ts +40 -0
  98. package/src/components/Toggle-v2/styles.module.scss +86 -0
  99. package/src/components/Tooltip/index.ts +271 -0
  100. package/src/components/Tooltip/styles.module.scss +105 -0
  101. package/src/components/form/ObjectField/index.ts +364 -0
  102. package/src/components/form/ObjectField/styles.module.scss +103 -0
  103. package/src/components/form/index.ts +3 -0
  104. package/src/contexts/AppContext.ts +12 -0
  105. package/src/declaration.d.ts +7 -0
  106. package/src/extensions/HMAC.ts +25 -0
  107. package/src/extensions/IntegryAPIError.ts +19 -0
  108. package/src/features/common/AccountDropdown/index.ts +291 -0
  109. package/src/features/common/AccountDropdown/styles.module.scss +19 -0
  110. package/src/features/common/ActionForm/index.ts +1790 -0
  111. package/src/features/common/ActionForm/styles.module.scss +23 -0
  112. package/src/features/common/AppCard/index.ts +207 -0
  113. package/src/features/common/AppCard/styles.module.scss +117 -0
  114. package/src/features/common/AppCardCompact/index.ts +189 -0
  115. package/src/features/common/AppCardCompact/styles.module.scss +141 -0
  116. package/src/features/common/AuthSelector/index.ts +537 -0
  117. package/src/features/common/AuthSelector/styles.module.scss +161 -0
  118. package/src/features/common/AuthSelectorCompact/index.ts +706 -0
  119. package/src/features/common/AuthSelectorCompact/styles.module.scss +219 -0
  120. package/src/features/common/AuthSelectorDropdown/index.ts +704 -0
  121. package/src/features/common/AuthSelectorDropdown/styles.module.scss +361 -0
  122. package/src/features/common/DynamicField/index.ts +229 -0
  123. package/src/features/common/DynamicField/styles.module.scss +67 -0
  124. package/src/features/common/DynamicTypedField/index.ts +217 -0
  125. package/src/features/common/DynamicTypedField/styles.module.scss +67 -0
  126. package/src/features/common/FunctionForm/index.ts +862 -0
  127. package/src/features/common/FunctionForm/styles.module.scss +163 -0
  128. package/src/features/common/MappingUI/index.ts +649 -0
  129. package/src/features/common/MappingUI/styles.module.scss +121 -0
  130. package/src/features/common/MarketplaceAppCard/index.ts +279 -0
  131. package/src/features/common/MarketplaceAppCard/styles.module.scss +231 -0
  132. package/src/features/common/MarketplaceAppCardCompact/index.ts +283 -0
  133. package/src/features/common/MarketplaceAppCardCompact/styles.module.scss +255 -0
  134. package/src/features/common/NewMappingUI/index.ts +515 -0
  135. package/src/features/common/NewMappingUI/styles.module.scss +113 -0
  136. package/src/features/common/RequestAppWidget/RequestAppModal/index.ts +67 -0
  137. package/src/features/common/RequestAppWidget/RequestAppModal/styles.module.scss +23 -0
  138. package/src/features/common/RequestAppWidget/index.ts +48 -0
  139. package/src/features/common/RequestAppWidget/request-app-form.ts +89 -0
  140. package/src/features/common/RequestAppWidget/styles.module.scss +43 -0
  141. package/src/features/common/SectionField/index.ts +272 -0
  142. package/src/features/common/SectionField/styles.module.scss +67 -0
  143. package/src/features/common/Step/index.ts +827 -0
  144. package/src/features/common/Step/styles.module.scss +12 -0
  145. package/src/features/common/StepNavigation/CollapsedSteps.ts +125 -0
  146. package/src/features/common/StepNavigation/NavItem.ts +111 -0
  147. package/src/features/common/StepNavigation/index.ts +257 -0
  148. package/src/features/common/StepNavigation/styles.module.scss +117 -0
  149. package/src/features/common/Steps/index.ts +1139 -0
  150. package/src/features/common/Steps/styles.module.scss +314 -0
  151. package/src/features/containers/AppFlowContainer/AppFlowListing/compactStyles.module.scss +383 -0
  152. package/src/features/containers/AppFlowContainer/AppFlowListing/flow-instance.tsx +367 -0
  153. package/src/features/containers/AppFlowContainer/AppFlowListing/flowCard.tsx +194 -0
  154. package/src/features/containers/AppFlowContainer/AppFlowListing/flowCardCompact.tsx +389 -0
  155. package/src/features/containers/AppFlowContainer/AppFlowListing/flowInstanceCompact.tsx +577 -0
  156. package/src/features/containers/AppFlowContainer/AppFlowListing/index.tsx +83 -0
  157. package/src/features/containers/AppFlowContainer/AppFlowListing/styles.module.scss +212 -0
  158. package/src/features/containers/AppFlowContainer/AppFlowWrap/app-page-loader.tsx +45 -0
  159. package/src/features/containers/AppFlowContainer/AppFlowWrap/index.tsx +1081 -0
  160. package/src/features/containers/AppFlowContainer/AppFlowWrap/styles.module.scss +452 -0
  161. package/src/features/containers/AppFlowContainer/Authentication/index.ts +610 -0
  162. package/src/features/containers/AppFlowContainer/Authentication/styles.module.scss +468 -0
  163. package/src/features/containers/AppFlowContainer/index.ts +114 -0
  164. package/src/features/containers/AppPageContainer/AppPage/index.tsx +262 -0
  165. package/src/features/containers/AppPageContainer/AppPage/styles.module.scss +120 -0
  166. package/src/features/containers/AppPageContainer/IntegrationCard/index.ts +165 -0
  167. package/src/features/containers/AppPageContainer/IntegrationCard/styles.module.scss +81 -0
  168. package/src/features/containers/AppPageContainer/index.tsx +93 -0
  169. package/src/features/containers/AppPageContainer/styles.module.scss +0 -0
  170. package/src/features/containers/AppsForFlows/index.ts +161 -0
  171. package/src/features/containers/AppsForFlows/styles.module.scss +280 -0
  172. package/src/features/containers/AppsForFlowsCompact/index.ts +161 -0
  173. package/src/features/containers/AppsForFlowsCompact/styles.module.scss +279 -0
  174. package/src/features/containers/AuthSetupContainer/AppSelection.ts +73 -0
  175. package/src/features/containers/AuthSetupContainer/AuthTypeSelection.ts +67 -0
  176. package/src/features/containers/AuthSetupContainer/Footer.ts +32 -0
  177. package/src/features/containers/AuthSetupContainer/Header.ts +39 -0
  178. package/src/features/containers/AuthSetupContainer/PostAdditionPopup.ts +27 -0
  179. package/src/features/containers/AuthSetupContainer/index.ts +349 -0
  180. package/src/features/containers/AuthSetupContainer/styles.module.scss +229 -0
  181. package/src/features/containers/FlowSetupContainer/index.ts +390 -0
  182. package/src/features/containers/FlowSetupContainer/styles.module.scss +18 -0
  183. package/src/features/containers/MarkeplaceApps/index.ts +574 -0
  184. package/src/features/containers/MarkeplaceApps/styles.module.scss +559 -0
  185. package/src/features/containers/MarketplaceAppsCompact/index.ts +576 -0
  186. package/src/features/containers/MarketplaceAppsCompact/styles.module.scss +546 -0
  187. package/src/features/containers/MarketplaceAppsContainer/index.ts +83 -0
  188. package/src/features/containers/MarketplaceContainer/AppCard/index.ts +91 -0
  189. package/src/features/containers/MarketplaceContainer/AppCard/styles.module.scss +66 -0
  190. package/src/features/containers/MarketplaceContainer/AppListing/index.ts +34 -0
  191. package/src/features/containers/MarketplaceContainer/AppListing/styles.module.scss +10 -0
  192. package/src/features/containers/MarketplaceContainer/MarketplaceContentWrap/index.ts +132 -0
  193. package/src/features/containers/MarketplaceContainer/MarketplaceContentWrap/styles.module.scss +117 -0
  194. package/src/features/containers/MarketplaceContainer/index.ts +242 -0
  195. package/src/features/containers/MarketplaceContainer/styles.module.scss +84 -0
  196. package/src/features/containers/SDKContainer/index.ts +817 -0
  197. package/src/features/containers/SDKContainer/styles.module.scss +266 -0
  198. package/src/features/containers/SDKDebugContainer/index.ts +137 -0
  199. package/src/features/containers/SDKDebugContainer/styles.module.scss +37 -0
  200. package/src/features/containers/SDKFailedContainer/index.ts +117 -0
  201. package/src/features/containers/SDKFailedContainer/styles.module.scss +57 -0
  202. package/src/features/integrations/IntegrationRow/Icons.ts +77 -0
  203. package/src/features/integrations/IntegrationRow/index.ts +129 -0
  204. package/src/features/integrations/IntegrationRow/styles.module.scss +62 -0
  205. package/src/features/integrations/IntegrationsHeader/index.ts +34 -0
  206. package/src/features/integrations/IntegrationsHeader/styles.module.scss +47 -0
  207. package/src/features/integrations/IntegrationsList/index.ts +252 -0
  208. package/src/features/integrations/IntegrationsList/styles.module.scss +67 -0
  209. package/src/features/templates/Template/index.ts +295 -0
  210. package/src/features/templates/Template/styles.module.scss +226 -0
  211. package/src/features/templates/TemplatesView/index.ts +368 -0
  212. package/src/features/templates/TemplatesView/styles.module.scss +71 -0
  213. package/src/features/templates/TemplatesViewCompact/index.ts +364 -0
  214. package/src/features/templates/TemplatesViewCompact/styles.module.scss +141 -0
  215. package/src/hooks/useAutosizeTextArea.ts +22 -0
  216. package/src/hooks/useCustomRef.ts +13 -0
  217. package/src/hooks/useDebounce.ts +17 -0
  218. package/src/hooks/useElementResize.ts +40 -0
  219. package/src/hooks/useEventListener.ts +44 -0
  220. package/src/hooks/useHover.ts +40 -0
  221. package/src/hooks/useOnClickOutside.ts +32 -0
  222. package/src/index.ts +2051 -0
  223. package/src/index.umd.ts +13 -0
  224. package/src/interfaces/index.ts +924 -0
  225. package/src/modules/api/index.ts +1315 -0
  226. package/src/modules/api/responseHandler.ts +38 -0
  227. package/src/modules/event-emitter/index.ts +72 -0
  228. package/src/modules/event-emitter/runners/abstract.ts +21 -0
  229. package/src/modules/event-emitter/runners/default.ts +11 -0
  230. package/src/modules/event-emitter/runners/ntimes.ts +28 -0
  231. package/src/modules/event-emitter/types.ts +34 -0
  232. package/src/store/actionFunctions.ts +1573 -0
  233. package/src/store/index.ts +17 -0
  234. package/src/store/initialState.ts +58 -0
  235. package/src/stories/Button.stories.tsx +83 -0
  236. package/src/stories/Checkbox/Checkbox.stories.tsx +41 -0
  237. package/src/stories/Checkbox/CheckboxGroup.stories.tsx +46 -0
  238. package/src/stories/EditableText.stories.tsx +35 -0
  239. package/src/stories/Input/BaseInput.stories.tsx +48 -0
  240. package/src/stories/Input/DateInput.stories.tsx +28 -0
  241. package/src/stories/Input/Input.stories.tsx +24 -0
  242. package/src/stories/Input/PasswordInput.stories.tsx +26 -0
  243. package/src/stories/Introduction.stories.mdx +211 -0
  244. package/src/stories/Label.stories.tsx +27 -0
  245. package/src/stories/Listbox.stories.tsx +122 -0
  246. package/src/stories/Radio/Radio.stories.tsx +39 -0
  247. package/src/stories/Radio/RadioGroup.stories.tsx +46 -0
  248. package/src/stories/StepNavigation/NavItem.stories.tsx +31 -0
  249. package/src/stories/StepNavigation/StepNavigation.stories.tsx +50 -0
  250. package/src/stories/TabBar.stories.tsx +31 -0
  251. package/src/stories/TextArea.stories.tsx +23 -0
  252. package/src/stories/TimeInput.stories.tsx +37 -0
  253. package/src/stories/Toggle.stories.tsx +33 -0
  254. package/src/stories/assets/code-brackets.svg +1 -0
  255. package/src/stories/assets/colors.svg +1 -0
  256. package/src/stories/assets/comments.svg +1 -0
  257. package/src/stories/assets/direction.svg +1 -0
  258. package/src/stories/assets/flow.svg +1 -0
  259. package/src/stories/assets/plugin.svg +1 -0
  260. package/src/stories/assets/repo.svg +1 -0
  261. package/src/stories/assets/stackalt.svg +1 -0
  262. package/src/types/index.ts +293 -0
  263. package/src/types/store.ts +366 -0
  264. package/src/types/utils.ts +19 -0
  265. package/src/utils/ActivityOutputUtils.ts +163 -0
  266. package/src/utils/common.ts +20 -0
  267. package/src/utils/copyToClipboard.ts +24 -0
  268. package/src/utils/datetime.ts +101 -0
  269. package/src/utils/getUrlParam.ts +11 -0
  270. package/src/utils/isAuthMessage.ts +16 -0
  271. package/src/utils/isBrowser.ts +1 -0
  272. package/src/utils/jsonEncodeDecode.ts +15 -0
  273. package/src/utils/objectUtils.ts +116 -0
  274. package/src/utils/popup.ts +30 -0
  275. package/src/utils/searchJson.ts +51 -0
  276. package/src/utils/stepUtils.ts +45 -0
  277. package/src/utils/truncate.ts +6 -0
  278. package/test/setup.ts +1 -0
  279. package/vitest.config.ts +10 -0
@@ -0,0 +1,197 @@
1
+ .listboxGroupWrapper {
2
+ fieldset {
3
+ margin: 0;
4
+ padding: 0;
5
+ border: none;
6
+ margin-bottom: 16px !important;
7
+ }
8
+ }
9
+
10
+ .listbox {
11
+ position: relative;
12
+ max-width: 285px;
13
+ user-select: none;
14
+ .customSelect {
15
+ position: relative;
16
+ display: flex;
17
+ flex-direction: column;
18
+ font-size: 14px;
19
+ font-family: inherit;
20
+ letter-spacing: -0.197647px;
21
+ color: #999999;
22
+
23
+ &.open .customOptions {
24
+ opacity: 1;
25
+ visibility: visible;
26
+ pointer-events: auto;
27
+ }
28
+ .readonlyHint {
29
+ width: 100%;
30
+ height: 100%;
31
+ z-index: 99;
32
+ position: absolute;
33
+ }
34
+ }
35
+ .customSelectTrigger {
36
+ position: relative;
37
+ display: flex;
38
+ align-items: center;
39
+ box-sizing: border-box;
40
+ height: 35px;
41
+ padding: 0 10px;
42
+ justify-content: space-between;
43
+ cursor: pointer;
44
+ font-size: 14px;
45
+ font-family: inherit;
46
+ border: 1px solid #e2e0db;
47
+ border-radius: 4px;
48
+ span {
49
+ display: flex;
50
+ flex: 1;
51
+ align-items: center;
52
+ height: 100%;
53
+ padding-right: 10px;
54
+ white-space: nowrap;
55
+ overflow: hidden;
56
+ text-overflow: ellipsis;
57
+ &.selected {
58
+ color: #333333;
59
+ }
60
+ }
61
+ &:focus {
62
+ outline: none;
63
+ }
64
+ &.error {
65
+ border-color: #f05c42;
66
+ }
67
+ &.searchable {
68
+ // cursor: text;
69
+ }
70
+ .arrow {
71
+ transform: rotate(0);
72
+ cursor: pointer;
73
+ transition-property: transform;
74
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
75
+ transition-duration: 150ms;
76
+ &.close {
77
+ transform: rotate(180deg);
78
+ }
79
+ &.readonly {
80
+ cursor: auto;
81
+ }
82
+ }
83
+ .searchInput {
84
+ border: 0;
85
+ outline: none;
86
+ width: 100%;
87
+ color: #333;
88
+ font-size: 12px;
89
+ font-family: inherit;
90
+ padding: 0;
91
+ margin: 0;
92
+ height: 100%;
93
+ &::placeholder {
94
+ color: #999999;
95
+ }
96
+ }
97
+ &.readonly {
98
+ cursor: auto;
99
+ }
100
+ }
101
+ .customOptions {
102
+ position: absolute;
103
+ top: 100%;
104
+ left: 0px;
105
+ right: 0px;
106
+ z-index: 10;
107
+ margin-top: 10px;
108
+ display: block;
109
+ overflow: hidden;
110
+ background-color: #fff;
111
+ font-family: inherit;
112
+ font-size: 14px;
113
+ line-height: 20px;
114
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
115
+ transition-property: all;
116
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
117
+ transition-duration: 150ms;
118
+ pointer-events: none;
119
+ visibility: hidden;
120
+ max-height: 132px;
121
+ min-height: 100%;
122
+ overflow-y: auto;
123
+ border-width: 1px;
124
+ border-style: solid;
125
+ border-color: #e2e0db;
126
+ opacity: 0;
127
+ border-radius: 4px;
128
+ &::-webkit-scrollbar {
129
+ width: 7px;
130
+ }
131
+
132
+ /* Track */
133
+ &::-webkit-scrollbar-track {
134
+ // background: #f1f1f1;
135
+ background: transparent;
136
+ border-radius: 10px;
137
+ }
138
+
139
+ /* Handle */
140
+ &::-webkit-scrollbar-thumb {
141
+ background: #ededed;
142
+ border: 1px solid #e7e7e7;
143
+ border-radius: 10px;
144
+ }
145
+
146
+ /* Handle on hover */
147
+ &::-webkit-scrollbar-thumb:hover {
148
+ background: rgb(116, 116, 116);
149
+ }
150
+ }
151
+ }
152
+
153
+ .noResults {
154
+ padding-top: 0.5rem;
155
+ padding-bottom: 0.5rem;
156
+ padding-left: 0.5rem;
157
+ }
158
+
159
+ .listboxItem {
160
+ position: relative;
161
+ display: block;
162
+ cursor: pointer;
163
+ border-width: 0px;
164
+ border-bottom-width: 1px;
165
+ border-style: solid;
166
+ border-color: #e2e0db;
167
+ transition-property: all;
168
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
169
+ transition-duration: 150ms;
170
+ white-space: nowrap;
171
+ text-overflow: ellipsis;
172
+ overflow: hidden;
173
+ padding: 8px 10px;
174
+ svg {
175
+ position: absolute;
176
+ height: 100%;
177
+ width: 12px;
178
+ left: 16px;
179
+ top: 0;
180
+ }
181
+ &:last-child {
182
+ border: none;
183
+ }
184
+ &:hover {
185
+ color: #333;
186
+ background: #ececec;
187
+ }
188
+ &.selected {
189
+ color: #333;
190
+ font-weight: 500;
191
+ background: #ececec;
192
+ }
193
+ &.highlighted {
194
+ color: #333;
195
+ background: #ececec;
196
+ }
197
+ }
@@ -0,0 +1,25 @@
1
+ import { html } from 'htm/preact';
2
+
3
+ import styles from './styles.module.scss';
4
+
5
+ const Loader = ({ fill = '#ADADAD', size='md' }) => html`
6
+ <svg
7
+ class=${styles.loader}
8
+ width="${size === 'sm' ? '12' : '15'}"
9
+ height="${size === 'sm' ? '12' : '15'}"
10
+ viewBox="0 0 15 15"
11
+ fill="none"
12
+ xmlns="http://www.w3.org/2000/svg"
13
+ >
14
+ <path
15
+ d="M9.13037 0.179352C7.57047 -0.168051 5.94039 -0.00810102 4.47777 0.635883C3.01515 1.27987 1.79647 2.37421 0.999409 3.75937C0.202348 5.14453 -0.131421 6.74808 0.0467641 8.33623C0.224949 9.92438 0.90577 11.4141 1.98997 12.5882C3.07417 13.7623 4.50506 14.5593 6.07402 14.8632C7.64298 15.167 9.26799 14.9618 10.7121 14.2773C12.1562 13.5929 13.344 12.4651 14.1022 11.0582C14.8604 9.65144 15.1494 8.03922 14.9271 6.45665L14.1844 6.56098C14.3845 7.9853 14.1243 9.43629 13.442 10.7024C12.7596 11.9685 11.6906 12.9836 10.3909 13.5996C9.09119 14.2156 7.62869 14.4003 6.21662 14.1269C4.80455 13.8534 3.51675 13.136 2.54097 12.0794C1.56519 11.0227 0.952454 9.68194 0.792088 8.2526C0.631721 6.82327 0.932113 5.38008 1.64947 4.13343C2.36682 2.88679 3.46363 1.90188 4.77999 1.32229C6.09635 0.742709 7.56343 0.598754 8.96733 0.911417L9.13037 0.179352Z"
16
+ fill="#E0E0E0"
17
+ />
18
+ <path
19
+ d="M14.93 6.47755C14.7207 4.95709 14.0501 3.53742 13.0085 2.41017C11.9669 1.28292 10.6046 0.50235 9.10537 0.173829L8.94483 0.906446C10.2941 1.20212 11.5202 1.90462 12.4577 2.91915C13.3951 3.93368 13.9987 5.21138 14.187 6.57979L14.93 6.47755Z"
20
+ fill="${fill}"
21
+ />
22
+ </svg>
23
+ `;
24
+
25
+ export { Loader };
@@ -0,0 +1,16 @@
1
+ .loader {
2
+ animation-name: ckw;
3
+ animation-duration: 1s;
4
+ animation-iteration-count: infinite;
5
+ animation-timing-function: linear;
6
+ transform-origin: 50% 50%;
7
+ }
8
+
9
+ @keyframes ckw {
10
+ 0% {
11
+ transform: rotate(0deg);
12
+ }
13
+ 100% {
14
+ transform: rotate(360deg);
15
+ }
16
+ }
@@ -0,0 +1,82 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ /* eslint-disable no-use-before-define */
3
+ import { html } from 'htm/preact';
4
+ import { useState } from 'preact/hooks';
5
+ import { MediaObject } from '@/interfaces';
6
+ import { Modal } from '../Modal';
7
+ import styles from './styles.module.scss';
8
+
9
+
10
+ interface MediaGalleryModalProps {
11
+ media: MediaObject[];
12
+ showGallery?: boolean;
13
+ onClose: () => void;
14
+ defaultActiveIndex?: number;
15
+ }
16
+
17
+ const MediaGalleryModal = (props: MediaGalleryModalProps) => {
18
+ const {
19
+ media,
20
+ showGallery = false,
21
+ onClose,
22
+ defaultActiveIndex = 0,
23
+ } = props;
24
+ const [activeMediaIndex, setActiveMediaIndex] = useState(defaultActiveIndex);
25
+
26
+ const currentMedia = media[activeMediaIndex];
27
+
28
+ const handleCloseGallery = (): void => {
29
+ if (onClose) {
30
+ onClose();
31
+ }
32
+ }
33
+
34
+ const prevMedia = (): void => {
35
+ setActiveMediaIndex((prevIndex) => {
36
+ if (prevIndex === 0) {
37
+ return media.length - 1;
38
+ }
39
+ return prevIndex - 1;
40
+ })
41
+ }
42
+
43
+ const nextMedia = (): void => {
44
+ setActiveMediaIndex((prevIndex) => {
45
+ if (prevIndex === media.length - 1) {
46
+ return 0;
47
+ }
48
+ return prevIndex + 1;
49
+ })
50
+ }
51
+
52
+ return html`
53
+ <${Modal}
54
+ isOpen=${showGallery}
55
+ onClose=${handleCloseGallery}
56
+ className="media-gallery-modal"
57
+ >
58
+ <div class="${styles.modalSetup} ${'integry-container__media-gallery-modal'}">
59
+ <div class="${styles.modalContentWrap}">
60
+ <div class="${styles.mediaGalleryModal}">
61
+ <div class="${styles.galleryContent}">
62
+ <a class="${styles.prev}" onclick=${prevMedia}>
63
+ <svg width="7" height="13" viewBox="0 0 7 13" fill="none" xmlns="http://www.w3.org/2000/svg">
64
+ <path d="M5.78906 11.5176L0.789062 6.51758L5.78906 1.51758" stroke="#4250F0" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
65
+ </svg>
66
+ </a>
67
+ <img src=${currentMedia.url} class="${styles.mediaImage}" />
68
+ <a class="${styles.next}" onclick=${nextMedia}>
69
+ <svg width="7" height="13" viewBox="0 0 7 13" fill="none" xmlns="http://www.w3.org/2000/svg">
70
+ <path d="M1.0293 1.51758L6.0293 6.51758L1.0293 11.5176" stroke="#4250F0" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
71
+ </svg>
72
+ </a>
73
+ </div>
74
+ <div class="${styles.mediaCount}">${activeMediaIndex + 1} / ${media.length}</div>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ <//>
79
+ `;
80
+ };
81
+
82
+ export default MediaGalleryModal;
@@ -0,0 +1,76 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ /* eslint-disable no-use-before-define */
3
+ import { html } from 'htm/preact';
4
+ import { useRef, useState } from 'preact/hooks';
5
+ import { MediaObject } from '@/interfaces';
6
+ import styles from './styles.module.scss';
7
+
8
+
9
+ interface MediaSliderProps {
10
+ media: MediaObject[];
11
+ }
12
+
13
+ const MediaSlider = (props: MediaSliderProps) => {
14
+ const {
15
+ media,
16
+ } = props;
17
+ const [activeMediaIndex, setActiveMediaIndex] = useState(0);
18
+ const shuffledMediaRef = useRef(media);
19
+
20
+ shuffledMediaRef.current = media.slice(activeMediaIndex, activeMediaIndex + 2);
21
+
22
+ const prevMedia = (): void => {
23
+ if (activeMediaIndex > 0) {
24
+ setActiveMediaIndex((prevIndex) => {
25
+ if (prevIndex === 0) {
26
+ return media.length - 1;
27
+ }
28
+ return prevIndex - 1;
29
+ })
30
+ }
31
+ }
32
+
33
+ const nextMedia = (): void => {
34
+ if (activeMediaIndex < media.length - 1) {
35
+ setActiveMediaIndex((prevIndex) => {
36
+ if (prevIndex === media.length - 1) {
37
+ return 0;
38
+ }
39
+ return prevIndex + 1;
40
+ })
41
+ }
42
+ }
43
+
44
+ return html`
45
+ <div class="${styles.mediaSliderGallery}">
46
+ <a class="${`${styles.prev}`}" onclick=${prevMedia}>
47
+ <svg width="7" height="13" viewBox="0 0 7 13" fill="none" xmlns="http://www.w3.org/2000/svg">
48
+ <path d="M5.78906 11.5176L0.789062 6.51758L5.78906 1.51758" stroke="${activeMediaIndex < 1 ? '#BDBDBD' : '#4250F0'}" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
49
+ </svg>
50
+ </a>
51
+ ${shuffledMediaRef.current && shuffledMediaRef.current.length > 0 && html `
52
+ <div class="${styles.mediaDisplayWrap}">
53
+ ${shuffledMediaRef.current.map((mediaItem, index) => {
54
+ const { url } = mediaItem;
55
+ return (
56
+ html`
57
+ <img
58
+ key=${`m_${mediaItem.id}`}
59
+ src=${url}
60
+ class="${styles.mediaImage}"
61
+ />
62
+
63
+ `
64
+ )
65
+ })}
66
+ </div>`}
67
+ <a class="${`${styles.next}`}" onclick=${nextMedia}>
68
+ <svg width="7" height="13" viewBox="0 0 7 13" fill="none" xmlns="http://www.w3.org/2000/svg">
69
+ <path d="M1.0293 1.51758L6.0293 6.51758L1.0293 11.5176" stroke="${activeMediaIndex >= media.length - 1 ? '#BDBDBD' : '#4250F0'}" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
70
+ </svg>
71
+ </a>
72
+ </div>
73
+ `;
74
+ };
75
+
76
+ export default MediaSlider;
@@ -0,0 +1,92 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ /* eslint-disable no-use-before-define */
3
+ import { html } from 'htm/preact';
4
+ import { useRef, useState } from 'preact/hooks';
5
+ import { MediaObject, MediaType } from '@/interfaces';
6
+ import MediaGalleryModal from './MediaGalleryModal';
7
+ import MediaSlider from './MediaSlider';
8
+ import styles from './styles.module.scss';
9
+
10
+
11
+ interface MediaGalleryProps {
12
+ media: MediaObject[];
13
+ }
14
+
15
+ const MediaGallery = (props: MediaGalleryProps) => {
16
+ const {
17
+ media,
18
+ } = props;
19
+ const [openGallery, setOpenGallery] = useState(false);
20
+ const activeMediaIndexRef = useRef(0);
21
+
22
+ const handleMediaClick = (mediaIndex: number): void => {
23
+ activeMediaIndexRef.current = mediaIndex;
24
+ setOpenGallery(true);
25
+ }
26
+
27
+ return html`
28
+ <div class="${styles.mediaGallery}">
29
+ ${media.length >= 1 && html`
30
+ <img onclick=${() => {
31
+ handleMediaClick(0);
32
+ }}
33
+ src=${media[0].url}
34
+ class="${styles.mediaImage}" />
35
+ `}
36
+ ${media.length > 1 && html `
37
+ <div class="${styles.layout2}">
38
+ ${media.map((mediaItem, index) => {
39
+ if (index > 0 && index <=2 ) {
40
+ const { url, type } = mediaItem;
41
+ if (type === MediaType.IMAGE) {
42
+ return (
43
+ html`${
44
+ media.length > 3 && index === 2 ? html`
45
+ <div class="${styles.mediaImageWrap}" onclick=${
46
+ () => {
47
+ handleMediaClick(index);
48
+ }
49
+ } >
50
+ <img src=${url}
51
+ class="${styles.mediaImage}"
52
+ />
53
+ <span class="${styles.moreImages}">+ ${media.length - 3} more</span>
54
+ </div>
55
+ ` : html`
56
+ <img onclick=${
57
+ () => {
58
+ handleMediaClick(index);
59
+ }
60
+ }
61
+ src=${url}
62
+ class="${styles.mediaImage}" />
63
+ `
64
+ }
65
+ `
66
+ )
67
+ }
68
+ return (
69
+ html`
70
+ `
71
+ )
72
+ }
73
+ return html``
74
+ })}
75
+ </div>`}
76
+ <div class="${styles.mediaSlider}">
77
+ <${MediaSlider} media=${media} />
78
+ </div>
79
+ </div>
80
+ ${openGallery && html `
81
+ <${MediaGalleryModal}
82
+ media=${media}
83
+ showGallery=${openGallery}
84
+ onClose=${() => {
85
+ setOpenGallery(false);
86
+ }}
87
+ defaultActiveIndex=${activeMediaIndexRef.current}
88
+ /> `}
89
+ `;
90
+ };
91
+
92
+ export default MediaGallery;
@@ -0,0 +1,156 @@
1
+ .mediaGallery {
2
+ display: flex;
3
+ align-items: flex-start;
4
+ justify-content: flex-start;
5
+ gap: 16px;
6
+ .mediaImage {
7
+ width: 288px;
8
+ height: 162px;
9
+ border-radius: 6px;
10
+ object-fit: cover;
11
+ cursor: pointer;
12
+ }
13
+ .layout2 {
14
+ display: flex;
15
+ flex-direction: column;
16
+ align-items: flex-start;
17
+ justify-content: flex-start;
18
+ gap: 16px;
19
+ .mediaImage {
20
+ width: 121px;
21
+ height: 73px;
22
+ border-radius: 6px;
23
+ }
24
+ .mediaImageWrap {
25
+ width: min-content;
26
+ position: relative;
27
+ opacity: 0.7;
28
+ cursor: pointer;
29
+ .moreImages {
30
+ background: #FFFFFF;
31
+ border-radius: 8px;
32
+ padding: 5px 12px;
33
+ font-style: normal;
34
+ font-weight: 500;
35
+ font-size: 12px;
36
+ line-height: 15px;
37
+ color: #333333;
38
+ position: absolute;
39
+ left: 23px;
40
+ bottom: 14px;
41
+ cursor: pointer;
42
+ }
43
+ }
44
+ }
45
+ .mediaSlider {
46
+ display: none;
47
+ max-width: 400px;
48
+ }
49
+ @media (min-width: 320px ) and (max-width: 856px) {
50
+ .layout2 {
51
+ display: none;
52
+ }
53
+ .mediaImage {
54
+ display: none;
55
+ }
56
+ .mediaSlider {
57
+ display: block;
58
+ }
59
+ }
60
+ @media (min-width: 857px) {
61
+ .mediaSlider {
62
+ display: none;
63
+ }
64
+ .mediaImage {
65
+ display: block;
66
+ }
67
+ }
68
+ }
69
+
70
+ .mediaGalleryModal {
71
+ .galleryContent {
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: space-evenly;
75
+ .prev {
76
+ cursor: pointer;
77
+ svg {
78
+ width: 20px;
79
+ height: 20px;
80
+ }
81
+ }
82
+ .next {
83
+ cursor: pointer;
84
+ svg {
85
+ width: 20px;
86
+ height: 20px;
87
+ }
88
+ }
89
+ }
90
+ .mediaCount {
91
+ font-family: inherit;
92
+ font-style: normal;
93
+ font-weight: 500;
94
+ font-size: 14px;
95
+ line-height: 15px;
96
+ color: #333333;
97
+ margin-top: 16px;
98
+ display: flex;
99
+ justify-content: center;
100
+ }
101
+ .mediaImage {
102
+ height: calc(100vh - 300px);
103
+ object-fit: contain;
104
+ width: 522px;
105
+ margin-top: 34px;
106
+ @media (min-width: 640px) {
107
+ width: 200px;
108
+ }
109
+ @media (min-width: 857px) {
110
+ width: 422px;
111
+ max-width: 422px;
112
+ }
113
+ @media (min-width: 1237px) {
114
+ width: 522px;
115
+ max-width: 522px;
116
+ }
117
+ @media (min-height: 1152px) {
118
+ max-height: 600px;
119
+ height: 600px;
120
+ }
121
+ }
122
+ }
123
+
124
+ .mediaSliderGallery {
125
+ display: flex;
126
+ align-items: center;
127
+ justify-content: flex-start;
128
+ gap: 8px;
129
+ .mediaDisplayWrap {
130
+ display: flex;
131
+ gap: 24px;
132
+ overflow: hidden;
133
+ }
134
+ .prev {
135
+ cursor: pointer;
136
+ svg {
137
+ width: 20px;
138
+ height: 20px;
139
+ }
140
+ }
141
+ .next {
142
+ cursor: pointer;
143
+ svg {
144
+ width: 20px;
145
+ height: 20px;
146
+ }
147
+ }
148
+ .mediaImage {
149
+ width: 288px;
150
+ height: 162px;
151
+ border-radius: 6px;
152
+ object-fit: cover;
153
+ cursor: default;
154
+ display: block;
155
+ }
156
+ }