@integry/sdk 4.5.2 → 4.5.4

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 +1818 -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,169 @@
1
+ import { html } from 'htm/preact';
2
+ import { useContext, useEffect, useRef, useState } from 'preact/hooks';
3
+
4
+ import AppContext from '@/contexts/AppContext';
5
+ import { Radio } from './Radio';
6
+ import { Label } from '../Label';
7
+ import { ErrorMessage } from '../ErrorMessage';
8
+
9
+ import styles from './styles.module.scss';
10
+ import { ThreeDotLoader } from '../ThreeDotLoader';
11
+
12
+ interface RadioItem {
13
+ id: string;
14
+ value: string;
15
+ }
16
+
17
+ export interface RadioGroupProps {
18
+ title: string;
19
+ description: string;
20
+ isDynamic: boolean;
21
+ dataSrcEndpoint?: string;
22
+ ariaLabel: string;
23
+ value: string;
24
+ initialOptions?: RadioItem[];
25
+ endpointData: string;
26
+ isRequired?: boolean;
27
+ showStepValidation?: boolean;
28
+ onChange?: (selected: string) => void;
29
+ isReadOnly?: boolean;
30
+ isChanged?: boolean;
31
+ }
32
+
33
+ /**
34
+ * RadioGroup component
35
+ *
36
+ */
37
+ export const RadioGroup = (props: RadioGroupProps) => {
38
+ const {
39
+ title,
40
+ description,
41
+ ariaLabel,
42
+ initialOptions = [],
43
+ value = null,
44
+ isDynamic,
45
+ dataSrcEndpoint,
46
+ endpointData,
47
+ isRequired = false,
48
+ showStepValidation = false,
49
+ onChange = () => null,
50
+ isReadOnly = false,
51
+ isChanged = false,
52
+ } = props;
53
+
54
+ const [loading, setLoading] = useState(isDynamic);
55
+
56
+ const selectedItemRef = useRef(value);
57
+
58
+ const [selectedItem, setSelectedItem] = useState(value);
59
+ const [error, setError] = useState<string | null>(null);
60
+
61
+ const handleChange = (inputValue: string) => {
62
+ setSelectedItem(inputValue);
63
+ };
64
+
65
+ const [parsedOptions, setParsedOptions] = useState<
66
+ { id: string; value: string }[]
67
+ >([]);
68
+
69
+ const context = useContext(AppContext);
70
+
71
+ useEffect(() => {
72
+ if (isDynamic) {
73
+ if (dataSrcEndpoint) {
74
+ // eslint-disable-next-line no-use-before-define
75
+ fetchDynamicData();
76
+ } else {
77
+ setParsedOptions(initialOptions);
78
+ setLoading(false);
79
+ }
80
+ } else
81
+ throw new Error(
82
+ 'Radio group with dynamic source has no data src endpoint',
83
+ );
84
+ }, []);
85
+
86
+ useEffect(() => {
87
+ if (selectedItemRef.current !== selectedItem && selectedItem)
88
+ onChange(selectedItem);
89
+ }, [selectedItem]);
90
+
91
+ const fetchDynamicData = (): void => {
92
+ if (dataSrcEndpoint) {
93
+ setLoading(true);
94
+ let data;
95
+ try {
96
+ data = JSON.parse(endpointData);
97
+ } catch (parseErr) {
98
+ data = '';
99
+ }
100
+ // call dynamic endpoint
101
+ context?.apiHandler
102
+ .callDynamicDataEndpoint<{ id: string; value: string }[]>(
103
+ new URL(dataSrcEndpoint),
104
+ data,
105
+ )
106
+ .then((res) => {
107
+ if (res) setParsedOptions(res);
108
+ else setError(`Error loading radio options`);
109
+ })
110
+ .catch((err) => {
111
+ console.error(err);
112
+ setError('Error loading radio options');
113
+ })
114
+ .finally(() => setLoading(false));
115
+ }
116
+ }
117
+
118
+ const handleRefreshClick = (): void => {
119
+ fetchDynamicData();
120
+ setSelectedItem('');
121
+ }
122
+
123
+ return html`
124
+ <div class="${styles.radioGroup}">
125
+ <fieldset>
126
+ <${Label} title=${title} description=${description}
127
+ isRequired=${isRequired} labelTag=${isReadOnly && isChanged ? 'Changed' : ''}
128
+ allowRefresh=${isDynamic && dataSrcEndpoint}
129
+ handleRefreshClick=${handleRefreshClick}
130
+ //>
131
+ <div
132
+ role="group"
133
+ class="${styles.radioGroupWrap}"
134
+ aria-labelledby=${ariaLabel}
135
+ >
136
+ ${loading
137
+ ? html`<div style="margin: 20px 0;">
138
+ <${ThreeDotLoader} color="#999" />
139
+ </div>`
140
+ : html`
141
+ ${error
142
+ ? html`<div style="margin-top: 20px">
143
+ <${ErrorMessage}>${error}<//>
144
+ </div>`
145
+ : html`
146
+ ${parsedOptions.map(
147
+ (el) =>
148
+ html`
149
+ <${Radio}
150
+ id=${el.id}
151
+ value=${el.value}
152
+ isChecked=${selectedItem === el.id}
153
+ onChange=${handleChange}
154
+ isDisabled=${isReadOnly}
155
+ isReadOnly=${isReadOnly}
156
+ ><//>
157
+ `,
158
+ )}
159
+ `}
160
+ `}
161
+ </div>
162
+ </fieldset>
163
+ ${showStepValidation &&
164
+ !selectedItem &&
165
+ isRequired &&
166
+ html` <${ErrorMessage}>Please select an option</${ErrorMessage}>`}
167
+ </div>
168
+ `;
169
+ };
@@ -0,0 +1,81 @@
1
+ .radioGroup {
2
+ fieldset {
3
+ border: none;
4
+ padding: 0;
5
+ }
6
+ .radioGroupWrap {
7
+ margin-top: 14px;
8
+ width: fit-content;
9
+ }
10
+ }
11
+
12
+ .radio {
13
+ position: relative;
14
+ display: flex;
15
+ align-items: center;
16
+ margin: 10px 0;
17
+ .button {
18
+ position: absolute;
19
+ width: 15px;
20
+ height: 15px;
21
+ left: 0;
22
+ display: inline-block;
23
+ border-radius: 9999px;
24
+ background: transparent;
25
+ svg {
26
+ width: 100%;
27
+ height: 100%;
28
+ }
29
+ }
30
+ input[type='radio'] {
31
+ opacity: 0;
32
+ margin: 0;
33
+ height: 13px !important;
34
+ }
35
+ label {
36
+ display: flex;
37
+ margin-left: 15px;
38
+ align-items: center;
39
+ cursor: pointer;
40
+ &.disabled {
41
+ cursor: auto;
42
+ }
43
+ }
44
+ .text {
45
+ font-style: normal;
46
+ font-weight: normal;
47
+ font-size: 14px;
48
+ margin: 2px 0;
49
+ color: #333333;
50
+ }
51
+ .description {
52
+ font-size: 12px;
53
+ line-height: 15px;
54
+ color: #999999;
55
+ }
56
+ &.authRadio {
57
+ .labelDiv {
58
+ width: calc(100% - 20px);
59
+ .textDiv {
60
+ width: 100%;
61
+ white-space: break-spaces;
62
+ word-break: break-word;
63
+ .text {
64
+ max-width: 100%;
65
+ overflow: hidden;
66
+ text-overflow: ellipsis;
67
+ padding: 2px 0;
68
+ margin: 0px;
69
+ }
70
+ }
71
+ }
72
+ margin: 0;
73
+ }
74
+ }
75
+
76
+ .readonlyHint {
77
+ position: absolute;
78
+ width: 100%;
79
+ height: -webkit-fill-available;
80
+ z-index: 99;
81
+ }
@@ -0,0 +1,69 @@
1
+ import { html, Component } from 'htm/preact';
2
+ import styles from './styles.module.scss';
3
+
4
+ interface SearchState {
5
+ value: string;
6
+ }
7
+
8
+ interface SearchProps {
9
+ initialValue?: string;
10
+ placeholder: string;
11
+ resultCount: number;
12
+ onChange: (val: string) => void;
13
+ className?: string;
14
+ reset?: boolean;
15
+ }
16
+
17
+ export class Search extends Component<SearchProps, SearchState> {
18
+ constructor(props: SearchProps) {
19
+ super(props);
20
+ this.state = {
21
+ value: this.props.initialValue || '',
22
+ };
23
+ }
24
+
25
+ componentDidUpdate(previousProps: Readonly<SearchProps>): void {
26
+ if (previousProps.reset !== this.props.reset) {
27
+ this.onClear();
28
+ }
29
+ };
30
+
31
+ onInput = (e: Event) => {
32
+ if (e.target instanceof HTMLInputElement) {
33
+ const { value } = e.target;
34
+ this.setState({ value });
35
+ this.props.onChange(value);
36
+ }
37
+ };
38
+
39
+ onClear = () => {
40
+ this.setState({ value: '' });
41
+ this.props.onChange('');
42
+ };
43
+
44
+ render() {
45
+ return html`
46
+ <div class="${styles.search} ${styles[this.props.className || '']} integry-container__search">
47
+ <div class="${styles.searchIcon} integry-container__search-count">
48
+ <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none">
49
+ <path d="M14.7706 13.6638L11.148 10.0407C13.0421 7.59989 12.8712 4.06416 10.6303 1.82385C9.45395 0.647448 7.89024 0 6.2271 0C4.56335 0 2.99953 0.647997 1.82385 1.82385C0.647448 2.99965 0 4.56335 0 6.2271C0 7.89084 0.647996 9.45466 1.82385 10.6303C3.00025 11.8067 4.56396 12.4542 6.2271 12.4542C7.62663 12.4542 8.95411 11.9942 10.0413 11.1481L13.6638 14.7706C13.8168 14.9236 14.0167 14.9997 14.2172 14.9997C14.4172 14.9997 14.6177 14.9236 14.7706 14.7706C15.0765 14.4654 15.0765 13.9697 14.7706 13.6639L14.7706 13.6638ZM2.93043 9.52291C2.05038 8.64226 1.56482 7.47179 1.56482 6.22694C1.56482 4.98153 2.04978 3.81114 2.93043 2.93037C3.81049 2.04972 4.98156 1.56476 6.2264 1.56476C7.47124 1.56476 8.6422 2.04972 9.52297 2.93037C11.3409 4.74767 11.3409 7.705 9.52297 9.52276C8.64232 10.4034 7.47124 10.8884 6.2264 10.8884C4.98156 10.8884 3.8112 10.4034 2.93043 9.52276V9.52291Z" fill="#BDBDBD"/>
50
+ </svg>
51
+ </div>
52
+ <input
53
+ class="${styles.integrySearchInput}"
54
+ placeholder=${this.props.placeholder || 'Search...'}
55
+ value=${this.state.value}
56
+ oninput=${this.onInput}
57
+ />
58
+ ${this.state.value && html`
59
+ <div class="${styles.crossIcon}">
60
+ <svg onclick=${this.onClear} width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
61
+ <path d="M12 4.69336L4 12.6934" stroke="#999999" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
62
+ <path d="M4 4.69336L12 12.6934" stroke="#999999" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
63
+ </svg>
64
+ </div>
65
+ `}
66
+ </div>
67
+ `;
68
+ }
69
+ }
@@ -0,0 +1,149 @@
1
+ .search {
2
+ display: flex;
3
+ flex-direction: row;
4
+ align-items: center;
5
+ justify-content: flex-start;
6
+ width: 100%;
7
+ flex: 1 1 0%;
8
+ overflow: hidden;
9
+ border-width: 1px;
10
+ border-style: solid;
11
+ font-family: inherit;
12
+ // border: 1px solid #e2e0db;
13
+ border: 1px solid var(--Gray-6, #F2F2F2);
14
+ border-radius: 4px;
15
+ height: 40px;
16
+
17
+ .integrySearchInput {
18
+ font-family: inherit;
19
+ // margin: 0.25rem;
20
+ height: auto;
21
+ font-size: 14px;
22
+ line-height: 15px;
23
+ width: 100%;
24
+ flex: 1 1 0%;
25
+ background: transparent;
26
+ color: #333333;
27
+ outline: none;
28
+ border-style: none;
29
+ padding-right: 12px; // 0.75rem;
30
+ // padding-top: 12px; //0.5rem;
31
+ // padding-bottom: 12px; //0.5rem;
32
+ margin-left: 0px;
33
+ color: #333;
34
+ font-family: Inter;
35
+ font-size: 12px;
36
+ font-style: normal;
37
+ font-weight: 400;
38
+ line-height: normal;
39
+
40
+ &::placeholder {
41
+ color: var(--black-and-grey-draft-and-tooltip-desc, #999);
42
+ font-family: Inter;
43
+ font-size: 12px;
44
+ font-style: normal;
45
+ font-weight: 400;
46
+ line-height: normal;
47
+ }
48
+ }
49
+ .crossIcon {
50
+ display: flex;
51
+ align-items: center;
52
+ margin-right: 12px;
53
+ svg {
54
+ cursor: pointer;
55
+ }
56
+ }
57
+ &:focus-within {
58
+ border: 1px solid #b6b5b5;
59
+ }
60
+ &.search-marketplace {
61
+ width: 445px;
62
+ height: 40px;
63
+ margin-bottom: 24px;
64
+ border-radius: 8px;
65
+ input {
66
+ height: 38px;
67
+ margin: 0px;
68
+ padding: 0px;
69
+ }
70
+ @media (min-width: 320px) {
71
+ max-width: 353px;
72
+ }
73
+ @media (min-width: 875px) {
74
+ max-width: 445px;
75
+ }
76
+ }
77
+
78
+ .searchIcon {
79
+ font-family: inherit;
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ padding-left: 12px;
84
+ padding-right: 10px;
85
+ font-size: 0.875rem;
86
+ line-height: 1.25rem;
87
+ font-weight: 500;
88
+ color: #999;
89
+ }
90
+ }
91
+
92
+ .resultCount {
93
+ font-family: inherit;
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ padding-left: 12px;
98
+ padding-right: 10px;
99
+ font-size: 0.875rem;
100
+ line-height: 1.25rem;
101
+ font-weight: 500;
102
+ color: #999;
103
+ }
104
+
105
+ .compact-search {
106
+ border-radius: 8px;
107
+ border: 1px solid var(--Gray-6, #F2F2F2);
108
+ background: #FFF;
109
+ padding: 0 12px;
110
+ display: flex;
111
+ flex-direction: row;
112
+ align-items: center;
113
+ justify-content: flex-start;
114
+ gap: 10px;
115
+ // max-width: 316px;
116
+ width: calc(100% - 30px);
117
+ height: 40px;
118
+
119
+ .searchIcon {
120
+ padding: 0;
121
+ }
122
+
123
+ input {
124
+ color: var(--black-and-grey-title-and-desc, #333);
125
+ font-family: Inter;
126
+ font-size: 12px;
127
+ font-style: normal;
128
+ font-weight: 400;
129
+ line-height: normal;
130
+ padding: 0;
131
+ margin: 0;
132
+
133
+ &::placeholder {
134
+ color: var(--black-and-grey-draft-and-tooltip-desc, #999);
135
+ font-family: Inter;
136
+ font-size: 12px;
137
+ font-style: normal;
138
+ font-weight: 400;
139
+ line-height: normal;
140
+ }
141
+ &:focus {
142
+ outline: none;
143
+ }
144
+ }
145
+
146
+ &:focus-within {
147
+ border: 1px solid var(--Gray-6, #F2F2F2);;
148
+ }
149
+ }
@@ -0,0 +1,33 @@
1
+ import { html } from 'htm/preact';
2
+
3
+ import styles from './styles.module.scss';
4
+
5
+ interface TabProps {
6
+ activeTab: string;
7
+ label: string;
8
+ onClick(label: string): void;
9
+ tabId: string;
10
+ }
11
+
12
+ const Tab = (props: TabProps) => {
13
+ const { label, activeTab, onClick, tabId } = props;
14
+
15
+ const onClickHandler = () => {
16
+ onClick(tabId);
17
+ };
18
+
19
+ return html`
20
+ <li
21
+ class=${`${styles.tab} ${
22
+ activeTab === tabId
23
+ ? `${styles.tabactive} integry-container__tabbed-nav__tab--active`
24
+ : ''
25
+ } integry-container__tabbed-nav__tab`}
26
+ onclick=${onClickHandler}
27
+ >
28
+ ${label}
29
+ </li>
30
+ `;
31
+ };
32
+
33
+ export { Tab, TabProps };
@@ -0,0 +1,64 @@
1
+ import { html } from 'htm/preact';
2
+ import { VNode } from 'preact';
3
+ import { useState, useEffect } from 'preact/hooks';
4
+
5
+ import { Tab } from './Tab';
6
+
7
+ import styles from './styles.module.scss';
8
+
9
+ interface TabBarProps {
10
+ preSelectedTab?: string;
11
+ children: VNode<{ label: string; id: string }>[];
12
+ activatedTab: string;
13
+ setTabInStore: (tabId: string) => void;
14
+ }
15
+
16
+ const TabBar = (props: TabBarProps) => {
17
+ const { preSelectedTab, children, activatedTab, setTabInStore } = props;
18
+
19
+ if (!Array.isArray(children) || children.length < 2) {
20
+ throw new Error('Tab Bar must have at least two children');
21
+ }
22
+
23
+ // either select preselected if specified, or the first tab
24
+ const [activeTab, setActiveTab] = useState<string>(
25
+ preSelectedTab || children[0].props.id,
26
+ );
27
+
28
+ useEffect(() => {
29
+ if (activatedTab && activatedTab !== activeTab) setActiveTab(activatedTab);
30
+ }, [activatedTab]);
31
+
32
+ const onClickTabItem = (tabId: string) => {
33
+ setTabInStore(tabId);
34
+ setActiveTab(tabId);
35
+ };
36
+
37
+ return html`
38
+ <div>
39
+ <ol class="${styles.nav} integry-container__tabbed-nav">
40
+ ${children.map((child) => {
41
+ const { label, id } = child.props;
42
+ return html`
43
+ <${Tab}
44
+ activeTab=${activeTab}
45
+ key=${label}
46
+ label=${label}
47
+ onClick=${onClickTabItem}
48
+ tabId=${id}
49
+ >
50
+ <//>
51
+ `;
52
+ })}
53
+ </ol>
54
+ <div className="tab-content">
55
+ ${children.map((child) => {
56
+ if (child.props.id !== activeTab) return undefined;
57
+ return child.props.children;
58
+ })}
59
+ </div>
60
+ </div>
61
+ `;
62
+ };
63
+
64
+ export { TabBar, TabBarProps };
@@ -0,0 +1,43 @@
1
+ .nav {
2
+ margin-bottom: 0px;
3
+ margin-top: 0px;
4
+ padding: 0px;
5
+ border-top-width: 0px;
6
+ border-right-width: 0px;
7
+ border-left-width: 0px;
8
+ border-bottom-width: 1px;
9
+ border-style: solid;
10
+ border-color: rgba(107, 114, 128, 0.25);
11
+ }
12
+
13
+ .tab {
14
+ display: inline-block;
15
+ cursor: pointer;
16
+ list-style-type: none;
17
+ border-bottom-width: 2px;
18
+ border-color: transparent;
19
+ padding-left: 0.75rem;
20
+ padding-right: 0.75rem;
21
+ padding-bottom: 0.25rem;
22
+ line-height: 2rem;
23
+ color: rgba(156, 163, 175, 1);
24
+ transition-property: background-color, border-color, color, fill, stroke,
25
+ opacity, box-shadow, transform, filter, backdrop-filter,
26
+ -webkit-backdrop-filter;
27
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
28
+ transition-duration: 150ms;
29
+ margin-bottom: -1px;
30
+ &:hover {
31
+ border-width: 0px;
32
+ border-bottom-width: 2px;
33
+ border-style: solid;
34
+ border-color: rgba(80, 156, 246, 1);
35
+ }
36
+ }
37
+ .tabactive {
38
+ border-width: 0px;
39
+ border-bottom-width: 2px;
40
+ border-style: solid;
41
+ border-color: rgba(80, 156, 246, 1);
42
+ color: rgba(55, 65, 81, 1);
43
+ }
@@ -0,0 +1,29 @@
1
+ import { html } from 'htm/preact';
2
+
3
+ import styles from './styles.module.scss';
4
+
5
+ interface TagProps {
6
+ label: string;
7
+ type: 'info' | 'success' | 'fail' | 'grey',
8
+ className?: string;
9
+ }
10
+
11
+ /**
12
+ * Tag component
13
+ *
14
+ */
15
+ const Tag = (props: TagProps) => {
16
+ const {
17
+ label,
18
+ type = 'info',
19
+ className
20
+ } = props;
21
+
22
+ return html`
23
+ <span class="${`${styles.tag} ${styles[type]} ${styles[className || '']}`}">
24
+ ${label}
25
+ </span>
26
+ `;
27
+ };
28
+
29
+ export { Tag, TagProps };
@@ -0,0 +1,57 @@
1
+ .tag {
2
+ box-sizing: border-box;
3
+ /* Auto layout */
4
+
5
+ display: flex;
6
+ flex-direction: row;
7
+ align-items: center;
8
+ padding: 5px 10px;
9
+
10
+ width: fit-content;
11
+ height: 22px;
12
+ border-radius: 4px;
13
+
14
+ font-family: inherit;
15
+ font-style: normal;
16
+ font-weight: 500;
17
+ font-size: 10px;
18
+ line-height: 12px;
19
+ text-align: center;
20
+
21
+ &.app-card-tag {
22
+ height: 20px;
23
+ font-style: normal;
24
+ font-weight: 400;
25
+ font-size: 10px;
26
+ line-height: 12px;
27
+ padding: 4px 10px;
28
+ }
29
+
30
+ &.integration-card-tag {
31
+ height: 25px;
32
+ font-style: normal;
33
+ font-weight: 400;
34
+ font-size: 12px;
35
+ line-height: 15px;
36
+ padding: 5px 12px;
37
+ }
38
+ &.flow-instance {
39
+ height: 20px;
40
+ }
41
+ &.info {
42
+ background: #dceaff;
43
+ color: #0a6cff;
44
+ }
45
+ &.success {
46
+ background: #dff4c8;
47
+ color: #749d48;
48
+ }
49
+ &.fail {
50
+ background: #fbd6d0;
51
+ color: #f05c42;
52
+ }
53
+ &.grey {
54
+ background: #f2f2f2;
55
+ color: #999999;
56
+ }
57
+ }