@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,17 @@
1
+ /* eslint-disable import/no-cycle */
2
+ import createStore, { Store } from 'unistore';
3
+ import devtools from 'unistore/devtools';
4
+
5
+ import { initialState } from '@/store/initialState';
6
+
7
+ import { State } from '../types/store';
8
+ import { actionFunctions } from './actionFunctions';
9
+
10
+ const createSDKStore = (): Store<State> => {
11
+ const createStoreWrapper = () => createStore<State>(initialState);
12
+ // const store = createStoreWrapper();
13
+ const store = devtools(createStoreWrapper());
14
+ return store;
15
+ };
16
+
17
+ export { createSDKStore, actionFunctions, initialState };
@@ -0,0 +1,58 @@
1
+ /* eslint-disable import/no-cycle */
2
+ import { State } from '@/types/store';
3
+
4
+ export const initialState: State = {
5
+ stepState: {
6
+ steps: [],
7
+ currentStep: {
8
+ type: 'CONFIRMATION',
9
+ },
10
+ stepIndex: 0,
11
+ fieldsListData: null,
12
+ showValidation: false,
13
+ allStepsCompleted: false,
14
+ },
15
+ genericData: {
16
+ deploymentId: null,
17
+ implicitAuthEnabled: false,
18
+ templateId: null,
19
+ stepWithActivityOutput: null,
20
+ isPreviewMode: false,
21
+ brandingApp: null,
22
+ name: '',
23
+ authModalId: '',
24
+ showAppAuthModal: false,
25
+ isAnonymous: false,
26
+ marketplaceId: null,
27
+ marketplaceDetail: null,
28
+ IUAccountsData: null,
29
+ app_id: null,
30
+ currentIntegrationStatus: '',
31
+ isTestIntegration: false,
32
+ deploymentIdFromConfig: null,
33
+ customFlowSetupRender: false,
34
+ },
35
+ stepMapping: {},
36
+ authMapping: {},
37
+ stepDataMapping: {},
38
+ parentChildMapping: {},
39
+ conditionalFieldMapping: {},
40
+ fieldListMapping: {},
41
+ integrations: [],
42
+ templates: [],
43
+ showFlowsListModal: false,
44
+ showAppsListModal: false,
45
+ showAppPageModal: false,
46
+ showSetupModal: false,
47
+ showSetupInline: false,
48
+ fetchingIntegrations: false,
49
+ fetchingTemplates: false,
50
+ integrationIdToEdit: null,
51
+ mappingInfo: null,
52
+ activatedTab: '',
53
+ showMarketplaceModal: false,
54
+ showRequestAppModal: false,
55
+ requestAppFormData: {},
56
+ showMarketplaceAppPageId: null,
57
+ selectedAuthByAppId: {},
58
+ };
@@ -0,0 +1,83 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ /** @jsx h */
4
+ import { h } from 'htm/preact';
5
+ import { Story } from '@storybook/preact';
6
+ import { Button, ButtonProps, ButtonTypes } from '@/components/Button';
7
+
8
+ export default {
9
+ title: 'Button',
10
+ component: Button,
11
+ argTypes: {
12
+ label: {
13
+ name: 'Label',
14
+ type: { name: 'string', required: true },
15
+ description: 'Button label',
16
+ },
17
+ type: {
18
+ name: 'Type',
19
+ description: 'Button type',
20
+ options: ['primary', 'secondary', 'link'],
21
+ control: { type: 'radio' },
22
+ },
23
+ size: {
24
+ name: 'Size',
25
+ description: 'Button size',
26
+ options: ['small', 'medium', 'large'],
27
+ control: { type: 'radio' },
28
+ },
29
+ isLoading: {
30
+ name: 'Loading',
31
+ description: 'Show loading state',
32
+ options: [true, false],
33
+ control: { type: 'radio' },
34
+ },
35
+ color: { name: 'Text Color', control: 'color' },
36
+ backgroundColor: { name: 'Background Color', control: 'color' },
37
+ onClick: { action: 'onClick' },
38
+ },
39
+ };
40
+
41
+ const Template: Story<ButtonProps> = (args: ButtonProps) => (
42
+ <Button {...args} />
43
+ );
44
+
45
+ export const Primary = Template.bind({});
46
+
47
+ Primary.args = {
48
+ type: ButtonTypes.PRIMARY,
49
+ label: 'Primary Button',
50
+ };
51
+
52
+ export const Secondary = Template.bind({});
53
+ Secondary.args = {
54
+ type: ButtonTypes.SECONDARY,
55
+ label: 'Secondary Button',
56
+ };
57
+
58
+ export const Link = Template.bind({});
59
+ Link.args = {
60
+ type: ButtonTypes.LINK,
61
+ label: 'Link',
62
+ };
63
+
64
+ export const Large = Template.bind({});
65
+ Large.args = {
66
+ label: 'Large Button',
67
+ };
68
+
69
+ export const Medium = Template.bind({});
70
+ Medium.args = {
71
+ label: 'Medium Button',
72
+ };
73
+
74
+ export const Small = Template.bind({});
75
+ Small.args = {
76
+ label: 'Small Button',
77
+ };
78
+
79
+ export const Loading = Template.bind({});
80
+ Loading.args = {
81
+ label: 'Save',
82
+ isLoading: true,
83
+ };
@@ -0,0 +1,41 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ /** @jsx h */
4
+ import { h } from 'htm/preact';
5
+ import { Story } from '@storybook/preact';
6
+ import { Checkbox, CheckboxProps } from '@/components/CheckboxGroup/Checkbox';
7
+
8
+ export default {
9
+ title: 'Checkbox',
10
+ component: Checkbox,
11
+ argTypes: {
12
+ isChecked: {
13
+ name: 'Checked',
14
+ description: 'Checked',
15
+ options: [true, false],
16
+ control: { type: 'radio' },
17
+ },
18
+ handleChange: { action: 'onClick' },
19
+ },
20
+ };
21
+
22
+ const Template: Story<CheckboxProps> = (args: CheckboxProps) => (
23
+ <Checkbox {...args} />
24
+ );
25
+
26
+ export const Primary = Template.bind({});
27
+
28
+ Primary.args = {
29
+ name: 'primary',
30
+ label: 'Primary Button',
31
+ value: 'primary',
32
+ };
33
+
34
+ export const Description = Template.bind({});
35
+
36
+ Description.args = {
37
+ name: 'primary',
38
+ label: 'Primary Button',
39
+ description: 'With description',
40
+ value: 'primary',
41
+ };
@@ -0,0 +1,46 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ /** @jsx h */
4
+ import { h } from 'htm/preact';
5
+ import { Story } from '@storybook/preact';
6
+ import { CheckboxGroup, CheckboxGroupProps } from '@/components/CheckboxGroup';
7
+
8
+ export default {
9
+ title: 'CheckboxGroup',
10
+ component: CheckboxGroup,
11
+ argTypes: {
12
+ onChange: { action: 'onChange' },
13
+ },
14
+ };
15
+
16
+ const Template: Story<CheckboxGroupProps> = (args: CheckboxGroupProps) => (
17
+ <CheckboxGroup {...args} />
18
+ );
19
+
20
+ export const Primary = Template.bind({});
21
+
22
+ Primary.args = {
23
+ title: 'Checkbox selection',
24
+ description: 'Select option/s from the following',
25
+ selectedItemIndices: [0, 1],
26
+ items: [
27
+ {
28
+ name: 'item_a',
29
+ value: 'item_a',
30
+ label: 'Item A',
31
+ description: 'A description for item A',
32
+ },
33
+ {
34
+ name: 'item_b',
35
+ value: 'item_b',
36
+ label: 'Item B',
37
+ description: 'A description for item B',
38
+ },
39
+ {
40
+ name: 'item_c',
41
+ value: 'item_c',
42
+ label: 'Item C',
43
+ description: 'A description for item C',
44
+ },
45
+ ],
46
+ };
@@ -0,0 +1,35 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ /** @jsx h */
4
+ import { h } from 'htm/preact';
5
+ import { useState } from 'preact/hooks';
6
+ import { Story } from '@storybook/preact';
7
+
8
+ import { EditableText, EditableTextProps } from '@/components/EditableText';
9
+
10
+ export default {
11
+ title: 'EditableText',
12
+ component: EditableText,
13
+ argTypes: {
14
+ value: { type: 'string' },
15
+ handleChange: { action: 'onChange' },
16
+ },
17
+ };
18
+
19
+ const Template: Story<EditableTextProps> = (args: EditableTextProps) => {
20
+ const [value, setValue] = useState(args.value ?? '');
21
+
22
+ return (
23
+ <EditableText
24
+ {...args}
25
+ value={value}
26
+ handleChange={(val) => setValue(val)}
27
+ ></EditableText>
28
+ );
29
+ };
30
+
31
+ export const Primary = Template.bind({});
32
+
33
+ Primary.args = {
34
+ value: 'This is text',
35
+ };
@@ -0,0 +1,48 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ /** @jsx h */
4
+ import { h } from 'htm/preact';
5
+ import { Story } from '@storybook/preact';
6
+ import { BaseInput, BaseInputProps } from '@/components/Input/BaseInput';
7
+
8
+ export default {
9
+ title: 'BaseInput',
10
+ component: BaseInput,
11
+ argTypes: {
12
+ handleChange: { action: 'onChange' },
13
+ },
14
+ };
15
+
16
+ const Template: Story<BaseInputProps> = (args: BaseInputProps) => (
17
+ <BaseInput {...args} />
18
+ );
19
+
20
+ export const Primary = Template.bind({});
21
+
22
+ Primary.args = {
23
+ value: '',
24
+ placeholder: 'Placeholder',
25
+ };
26
+
27
+ export const WithValue = Template.bind({});
28
+
29
+ WithValue.args = {
30
+ value: 'I am filled',
31
+ placeholder: 'Placeholder',
32
+ };
33
+
34
+ export const Number = Template.bind({});
35
+
36
+ Number.args = {
37
+ type: 'number',
38
+ value: '10',
39
+ placeholder: 'Placeholder',
40
+ };
41
+
42
+ export const Password = Template.bind({});
43
+
44
+ Password.args = {
45
+ type: 'password',
46
+ value: '10',
47
+ placeholder: 'Placeholder',
48
+ };
@@ -0,0 +1,28 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ /** @jsx h */
4
+ import { h } from 'htm/preact';
5
+ import { Story } from '@storybook/preact';
6
+ import { DateInput, DateInputProps } from '@/components/Input';
7
+ import { getDateFormat } from '@/utils/datetime';
8
+
9
+ export default {
10
+ title: 'DateInput',
11
+ component: DateInput,
12
+ argTypes: {
13
+ onChange: { action: 'onChange' },
14
+ },
15
+ };
16
+
17
+ const Template: Story<DateInputProps> = (args: DateInputProps) => (
18
+ <DateInput {...args} />
19
+ );
20
+
21
+ export const Primary = Template.bind({});
22
+
23
+ Primary.args = {
24
+ placeholder: 'Placeholder',
25
+ title: 'An input',
26
+ description: 'Some description',
27
+ value: getDateFormat(new Date()),
28
+ };
@@ -0,0 +1,24 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ /** @jsx h */
4
+ import { h } from 'htm/preact';
5
+ import { Story } from '@storybook/preact';
6
+ import { Input, InputProps } from '@/components/Input';
7
+
8
+ export default {
9
+ title: 'Input',
10
+ component: Input,
11
+ argTypes: {
12
+ value: { type: 'string' },
13
+ },
14
+ };
15
+
16
+ const Template: Story<InputProps> = (args: InputProps) => <Input {...args} />;
17
+
18
+ export const Primary = Template.bind({});
19
+
20
+ Primary.args = {
21
+ placeholder: 'Placeholder',
22
+ title: 'An input',
23
+ description: 'Some description',
24
+ };
@@ -0,0 +1,26 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ /** @jsx h */
4
+ import { h } from 'htm/preact';
5
+ import { Story } from '@storybook/preact';
6
+ import { PasswordInput, PasswordInputProps } from '@/components/Input';
7
+
8
+ export default {
9
+ title: 'PasswordInput',
10
+ component: PasswordInput,
11
+ argTypes: {
12
+ value: { type: 'string' },
13
+ },
14
+ };
15
+
16
+ const Template: Story<PasswordInputProps> = (args: PasswordInputProps) => (
17
+ <PasswordInput {...args} />
18
+ );
19
+
20
+ export const Primary = Template.bind({});
21
+
22
+ Primary.args = {
23
+ placeholder: 'Placeholder',
24
+ title: 'A password input',
25
+ description: 'Some description for this password input',
26
+ };
@@ -0,0 +1,211 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+ import Code from './assets/code-brackets.svg';
3
+ import Colors from './assets/colors.svg';
4
+ import Comments from './assets/comments.svg';
5
+ import Direction from './assets/direction.svg';
6
+ import Flow from './assets/flow.svg';
7
+ import Plugin from './assets/plugin.svg';
8
+ import Repo from './assets/repo.svg';
9
+ import StackAlt from './assets/stackalt.svg';
10
+
11
+ <Meta title="Example/Introduction" />
12
+
13
+ <style>{`
14
+ .subheading {
15
+ --mediumdark: '#999999';
16
+ font-weight: 900;
17
+ font-size: 13px;
18
+ color: #999;
19
+ letter-spacing: 6px;
20
+ line-height: 24px;
21
+ text-transform: uppercase;
22
+ margin-bottom: 12px;
23
+ margin-top: 40px;
24
+ }
25
+
26
+ .link-list {
27
+ display: grid;
28
+ grid-template-columns: 1fr;
29
+ grid-template-rows: 1fr 1fr;
30
+ row-gap: 10px;
31
+ }
32
+
33
+ @media (min-width: 620px) {
34
+ .link-list {
35
+ row-gap: 20px;
36
+ column-gap: 20px;
37
+ grid-template-columns: 1fr 1fr;
38
+ }
39
+ }
40
+
41
+ @media all and (-ms-high-contrast:none) {
42
+ .link-list {
43
+ display: -ms-grid;
44
+ -ms-grid-columns: 1fr 1fr;
45
+ -ms-grid-rows: 1fr 1fr;
46
+ }
47
+ }
48
+
49
+ .link-item {
50
+ display: block;
51
+ padding: 20px 30px 20px 15px;
52
+ border: 1px solid #00000010;
53
+ border-radius: 5px;
54
+ transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
55
+ color: #333333;
56
+ display: flex;
57
+ align-items: flex-start;
58
+ }
59
+
60
+ .link-item:hover {
61
+ border-color: #1EA7FD50;
62
+ transform: translate3d(0, -3px, 0);
63
+ box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
64
+ }
65
+
66
+ .link-item:active {
67
+ border-color: #1EA7FD;
68
+ transform: translate3d(0, 0, 0);
69
+ }
70
+
71
+ .link-item strong {
72
+ font-weight: 700;
73
+ display: block;
74
+ margin-bottom: 2px;
75
+ }
76
+
77
+ .link-item img {
78
+ height: 40px;
79
+ width: 40px;
80
+ margin-right: 15px;
81
+ flex: none;
82
+ }
83
+
84
+ .link-item span {
85
+ font-size: 14px;
86
+ line-height: 20px;
87
+ }
88
+
89
+ .tip {
90
+ display: inline-block;
91
+ border-radius: 1em;
92
+ font-size: 11px;
93
+ line-height: 12px;
94
+ font-weight: 700;
95
+ background: #E7FDD8;
96
+ color: #66BF3C;
97
+ padding: 4px 12px;
98
+ margin-right: 10px;
99
+ vertical-align: top;
100
+ }
101
+
102
+ .tip-wrapper {
103
+ font-size: 13px;
104
+ line-height: 20px;
105
+ margin-top: 40px;
106
+ margin-bottom: 40px;
107
+ }
108
+
109
+ .tip-wrapper code {
110
+ font-size: 12px;
111
+ display: inline-block;
112
+ }
113
+
114
+
115
+ `}</style>
116
+
117
+ # Welcome to Storybook
118
+
119
+ Storybook helps you build UI components in isolation from your app's business logic, data, and context.
120
+ That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
121
+
122
+ Browse example stories now by navigating to them in the sidebar.
123
+ View their code in the `src/stories` directory to learn how they work.
124
+ We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
125
+
126
+ <div className="subheading">Configure</div>
127
+
128
+ <div className="link-list">
129
+ <a
130
+ className="link-item"
131
+ href="https://storybook.js.org/docs/react/addons/addon-types"
132
+ target="_blank"
133
+ >
134
+ <img src={Plugin} alt="plugin" />
135
+ <span>
136
+ <strong>Presets for popular tools</strong>
137
+ Easy setup for TypeScript, SCSS and more.
138
+ </span>
139
+ </a>
140
+ <a
141
+ className="link-item"
142
+ href="https://storybook.js.org/docs/react/configure/webpack"
143
+ target="_blank"
144
+ >
145
+ <img src={StackAlt} alt="Build" />
146
+ <span>
147
+ <strong>Build configuration</strong>
148
+ How to customize webpack and Babel
149
+ </span>
150
+ </a>
151
+ <a
152
+ className="link-item"
153
+ href="https://storybook.js.org/docs/react/configure/styling-and-css"
154
+ target="_blank"
155
+ >
156
+ <img src={Colors} alt="colors" />
157
+ <span>
158
+ <strong>Styling</strong>
159
+ How to load and configure CSS libraries
160
+ </span>
161
+ </a>
162
+ <a
163
+ className="link-item"
164
+ href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
165
+ target="_blank"
166
+ >
167
+ <img src={Flow} alt="flow" />
168
+ <span>
169
+ <strong>Data</strong>
170
+ Providers and mocking for data libraries
171
+ </span>
172
+ </a>
173
+ </div>
174
+
175
+ <div className="subheading">Learn</div>
176
+
177
+ <div className="link-list">
178
+ <a className="link-item" href="https://storybook.js.org/docs" target="_blank">
179
+ <img src={Repo} alt="repo" />
180
+ <span>
181
+ <strong>Storybook documentation</strong>
182
+ Configure, customize, and extend
183
+ </span>
184
+ </a>
185
+ <a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
186
+ <img src={Direction} alt="direction" />
187
+ <span>
188
+ <strong>In-depth guides</strong>
189
+ Best practices from leading teams
190
+ </span>
191
+ </a>
192
+ <a className="link-item" href="https://github.com/storybookjs/storybook" target="_blank">
193
+ <img src={Code} alt="code" />
194
+ <span>
195
+ <strong>GitHub project</strong>
196
+ View the source and add issues
197
+ </span>
198
+ </a>
199
+ <a className="link-item" href="https://discord.gg/storybook" target="_blank">
200
+ <img src={Comments} alt="comments" />
201
+ <span>
202
+ <strong>Discord chat</strong>
203
+ Chat with maintainers and the community
204
+ </span>
205
+ </a>
206
+ </div>
207
+
208
+ <div className="tip-wrapper">
209
+ <span className="tip">Tip</span>Edit the Markdown in{' '}
210
+ <code>src/stories/Introduction.stories.mdx</code>
211
+ </div>
@@ -0,0 +1,27 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable import/no-extraneous-dependencies */
3
+ /** @jsx h */
4
+ import { h } from 'htm/preact';
5
+ import { Story } from '@storybook/preact';
6
+
7
+ import { Label, LabelProps } from '@/components/Label';
8
+
9
+ export default {
10
+ title: 'Label',
11
+ component: Label,
12
+ };
13
+
14
+ const Template: Story<LabelProps> = (args: LabelProps) => <Label {...args} />;
15
+
16
+ export const Primary = Template.bind({});
17
+
18
+ Primary.args = {
19
+ title: 'Title',
20
+ description: 'Primary Button',
21
+ };
22
+
23
+ export const Secondary = Template.bind({});
24
+
25
+ Secondary.args = {
26
+ title: 'Title',
27
+ };