@luscii-healthtech/web-ui 0.0.0-alpha.2fcd0e9

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 (229) hide show
  1. package/README.md +179 -0
  2. package/dist/components/Accordion/Accordion.d.ts +10 -0
  3. package/dist/components/Accordion/AccordionItem.d.ts +9 -0
  4. package/dist/components/AccordionList/AccordionList.d.ts +42 -0
  5. package/dist/components/AccordionList/subcomponents/AccordionListActions.d.ts +18 -0
  6. package/dist/components/Badge/Badge.d.ts +7 -0
  7. package/dist/components/BaseList/BaseList.d.ts +7 -0
  8. package/dist/components/BaseList/BaseList.types.d.ts +55 -0
  9. package/dist/components/BaseList/BaseListEmptyState.d.ts +7 -0
  10. package/dist/components/BaseList/BaseListHeader.d.ts +4 -0
  11. package/dist/components/BaseList/BaseListIcon.d.ts +5 -0
  12. package/dist/components/BaseList/BaseListItem.d.ts +4 -0
  13. package/dist/components/BaseList/DraggableBaseList/DraggableBaseList.d.ts +4 -0
  14. package/dist/components/BaseList/DraggableBaseList/DraggableBaseListItem.d.ts +3 -0
  15. package/dist/components/BaseList/DraggableBaseList/index.d.ts +2 -0
  16. package/dist/components/BaseList/ListSkeleton/ListItemSkeleton.d.ts +2 -0
  17. package/dist/components/BaseList/ListSkeleton/ListSkeleton.d.ts +8 -0
  18. package/dist/components/BaseList/SortableBaseList/SortableBaseList.d.ts +4 -0
  19. package/dist/components/BaseList/SortableBaseList/SortableBaseListItem.d.ts +3 -0
  20. package/dist/components/BaseList/SortableBaseList/index.d.ts +2 -0
  21. package/dist/components/BaseList/index.d.ts +6 -0
  22. package/dist/components/BaseList/utils.d.ts +10 -0
  23. package/dist/components/Breadcrumbs/BreadcrumbItem.d.ts +4 -0
  24. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -0
  25. package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +14 -0
  26. package/dist/components/Breadcrumbs/index.d.ts +2 -0
  27. package/dist/components/Button/Button.d.ts +9 -0
  28. package/dist/components/Button/Button.types.d.ts +32 -0
  29. package/dist/components/Button/ButtonIcon.d.ts +7 -0
  30. package/dist/components/ButtonV2/ButtonProps.type.d.ts +49 -0
  31. package/dist/components/ButtonV2/ButtonV2.d.ts +3 -0
  32. package/dist/components/ButtonV2/PrimaryButton.d.ts +3 -0
  33. package/dist/components/ButtonV2/SecondaryButton.d.ts +3 -0
  34. package/dist/components/ButtonV2/TertiaryButton.d.ts +3 -0
  35. package/dist/components/Card/Card.d.ts +12 -0
  36. package/dist/components/Carousel/Carousel.d.ts +8 -0
  37. package/dist/components/Carousel/GliderContainer.d.ts +7 -0
  38. package/dist/components/CenteredHero/CenteredHero.d.ts +14 -0
  39. package/dist/components/CheckBoxListModal/CheckboxListModal.d.ts +30 -0
  40. package/dist/components/Checkbox/Checkbox.d.ts +64 -0
  41. package/dist/components/CheckboxList/CheckboxGroup.d.ts +3 -0
  42. package/dist/components/CheckboxList/CheckboxList.d.ts +4 -0
  43. package/dist/components/CheckboxList/CheckboxList.types.d.ts +74 -0
  44. package/dist/components/CheckboxList/CheckboxListItem.d.ts +3 -0
  45. package/dist/components/ConfirmationDialog/ConfirmationDialog.d.ts +3 -0
  46. package/dist/components/ConfirmationDialog/ConfirmationDialogChoices.d.ts +7 -0
  47. package/dist/components/ConfirmationDialog/ConfirmationDialogMessage.d.ts +4 -0
  48. package/dist/components/ConfirmationDialog/ConfirmationDialogTitle.d.ts +3 -0
  49. package/dist/components/ConfirmationDialog/types/ConfirmationDialog.types.d.ts +41 -0
  50. package/dist/components/Container/FlexColumn.d.ts +7 -0
  51. package/dist/components/Container/FlexContainer.d.ts +9 -0
  52. package/dist/components/Container/FlexRow.d.ts +7 -0
  53. package/dist/components/Container/types/FlexContainerProps.type.d.ts +26 -0
  54. package/dist/components/Divider/Divider.d.ts +6 -0
  55. package/dist/components/DragHandle/DragHandle.d.ts +7 -0
  56. package/dist/components/DragHandle/DragHandle.types.d.ts +6 -0
  57. package/dist/components/DragHandle/index.d.ts +2 -0
  58. package/dist/components/Dropzone/Dropzone.d.ts +6 -0
  59. package/dist/components/Dropzone/Dropzone.types.d.ts +33 -0
  60. package/dist/components/Dropzone/index.d.ts +2 -0
  61. package/dist/components/EmptyListMessage/EmptyListMessage.d.ts +14 -0
  62. package/dist/components/FilterBar/ActiveFilters.d.ts +9 -0
  63. package/dist/components/FilterBar/FilterBar.d.ts +96 -0
  64. package/dist/components/FilterBar/FilterBar.utils.d.ts +32 -0
  65. package/dist/components/FilterBar/FilterBarProps.type.d.ts +86 -0
  66. package/dist/components/FilterBar/FiltersMenus.d.ts +8 -0
  67. package/dist/components/FilterBar/SortMenu.d.ts +9 -0
  68. package/dist/components/FilterBar/index.d.ts +2 -0
  69. package/dist/components/Form/Form.d.ts +30 -0
  70. package/dist/components/Form/FormFieldCheckbox.d.ts +9 -0
  71. package/dist/components/Form/FormFieldCheckboxList.d.ts +9 -0
  72. package/dist/components/Form/FormFieldErrorMessages.d.ts +8 -0
  73. package/dist/components/Form/FormFieldLabeler.d.ts +8 -0
  74. package/dist/components/Form/FormImagePicker.d.ts +9 -0
  75. package/dist/components/Form/FormInput.d.ts +14 -0
  76. package/dist/components/Form/FormRadioGroup.d.ts +13 -0
  77. package/dist/components/Form/FormSelect.d.ts +10 -0
  78. package/dist/components/Form/FormTextarea.d.ts +14 -0
  79. package/dist/components/Form/form.transformer.d.ts +3 -0
  80. package/dist/components/Form/form.types.d.ts +92 -0
  81. package/dist/components/Icon/Icon.d.ts +17 -0
  82. package/dist/components/Icon/index.d.ts +1 -0
  83. package/dist/components/Icons/AddIcon.d.ts +4 -0
  84. package/dist/components/Icons/AlertsIcon.d.ts +4 -0
  85. package/dist/components/Icons/BellIcon.d.ts +4 -0
  86. package/dist/components/Icons/BluetoothIcon.d.ts +4 -0
  87. package/dist/components/Icons/ChartIcon.d.ts +4 -0
  88. package/dist/components/Icons/ChartLineColoredIcon.d.ts +4 -0
  89. package/dist/components/Icons/ChatBoxIcon.d.ts +4 -0
  90. package/dist/components/Icons/CheckIcon.d.ts +4 -0
  91. package/dist/components/Icons/ChevronDoubleIcon.d.ts +4 -0
  92. package/dist/components/Icons/ChevronDownIcon.d.ts +4 -0
  93. package/dist/components/Icons/ChevronRightIcon.d.ts +4 -0
  94. package/dist/components/Icons/CrossIcon.d.ts +4 -0
  95. package/dist/components/Icons/DeleteIcon.d.ts +4 -0
  96. package/dist/components/Icons/DownArrowIcon.d.ts +4 -0
  97. package/dist/components/Icons/DragIcon.d.ts +4 -0
  98. package/dist/components/Icons/EditIcon.d.ts +4 -0
  99. package/dist/components/Icons/EmptyIcon.d.ts +4 -0
  100. package/dist/components/Icons/EmptyStateDashboardIcon.d.ts +4 -0
  101. package/dist/components/Icons/ExclamationMarkIcon.d.ts +4 -0
  102. package/dist/components/Icons/EyeIcon.d.ts +4 -0
  103. package/dist/components/Icons/EyeIconSlashed.d.ts +4 -0
  104. package/dist/components/Icons/GearColoredIcon.d.ts +4 -0
  105. package/dist/components/Icons/GearIcon.d.ts +4 -0
  106. package/dist/components/Icons/GroupColoredIcon.d.ts +4 -0
  107. package/dist/components/Icons/GroupIcon.d.ts +4 -0
  108. package/dist/components/Icons/HamburgerIcon.d.ts +4 -0
  109. package/dist/components/Icons/HeartIcon.d.ts +4 -0
  110. package/dist/components/Icons/ImageIcon.d.ts +4 -0
  111. package/dist/components/Icons/InfoIcon.d.ts +4 -0
  112. package/dist/components/Icons/LeftArrowIcon.d.ts +4 -0
  113. package/dist/components/Icons/LightBulbIcon.d.ts +4 -0
  114. package/dist/components/Icons/LinkIcon.d.ts +4 -0
  115. package/dist/components/Icons/LockIcon.d.ts +4 -0
  116. package/dist/components/Icons/MessagesIcon.d.ts +4 -0
  117. package/dist/components/Icons/MouseIcon.d.ts +4 -0
  118. package/dist/components/Icons/NotesIcon.d.ts +4 -0
  119. package/dist/components/Icons/PageViewIcon.d.ts +4 -0
  120. package/dist/components/Icons/PinIcon.d.ts +4 -0
  121. package/dist/components/Icons/PrintIcon.d.ts +4 -0
  122. package/dist/components/Icons/RightArrowIcon.d.ts +4 -0
  123. package/dist/components/Icons/SearchCancelIcon.d.ts +4 -0
  124. package/dist/components/Icons/SearchIcon.d.ts +4 -0
  125. package/dist/components/Icons/SmallCircleIcon.d.ts +4 -0
  126. package/dist/components/Icons/SmallDiamondIcon.d.ts +4 -0
  127. package/dist/components/Icons/SmallSquareIcon.d.ts +4 -0
  128. package/dist/components/Icons/SpaceRocketIcon.d.ts +4 -0
  129. package/dist/components/Icons/StarIcon.d.ts +4 -0
  130. package/dist/components/Icons/StatusColoredIcon.d.ts +4 -0
  131. package/dist/components/Icons/WarningIcon.d.ts +4 -0
  132. package/dist/components/Icons/iconWrapper/iconWrapper.d.ts +4 -0
  133. package/dist/components/Icons/iconWrapper/index.d.ts +1 -0
  134. package/dist/components/Icons/index.d.ts +49 -0
  135. package/dist/components/Icons/templates/component.d.ts +3 -0
  136. package/dist/components/Icons/templates/index.d.ts +2 -0
  137. package/dist/components/Icons/types/IconProps.type.d.ts +8 -0
  138. package/dist/components/Image/Image.d.ts +10 -0
  139. package/dist/components/InfoField/InfoField.d.ts +28 -0
  140. package/dist/components/Input/Input.d.ts +57 -0
  141. package/dist/components/Input/SearchInput.d.ts +24 -0
  142. package/dist/components/Link/Link.d.ts +19 -0
  143. package/dist/components/List/List.d.ts +6 -0
  144. package/dist/components/List/List.types.d.ts +19 -0
  145. package/dist/components/List/ListItem.d.ts +4 -0
  146. package/dist/components/List/index.d.ts +5 -0
  147. package/dist/components/LoadingIndicator/LoadingIndicator.d.ts +12 -0
  148. package/dist/components/MediaPicker/ImageCategory.d.ts +14 -0
  149. package/dist/components/MediaPicker/MediaPicker.d.ts +95 -0
  150. package/dist/components/Modal/FullPageModal.d.ts +39 -0
  151. package/dist/components/Modal/FullPageModalHeader.d.ts +13 -0
  152. package/dist/components/Modal/Modal.d.ts +6 -0
  153. package/dist/components/Modal/ModalBase.d.ts +16 -0
  154. package/dist/components/Modal/ModalFooter.d.ts +12 -0
  155. package/dist/components/Modal/ModalHeader.d.ts +6 -0
  156. package/dist/components/Modal/subcomponents/FullPageModalActions.d.ts +18 -0
  157. package/dist/components/NavMenu/NavLayout.d.ts +20 -0
  158. package/dist/components/NavMenu/NavMenu.d.ts +16 -0
  159. package/dist/components/NavMenu/NavMenuContent.d.ts +3 -0
  160. package/dist/components/NavMenu/NavMenuFooter.d.ts +3 -0
  161. package/dist/components/NavMenu/NavMenuHeader.d.ts +3 -0
  162. package/dist/components/NavMenu/NavMenuItem.d.ts +3 -0
  163. package/dist/components/NavMenu/types/NavMenuFooterProps.type.d.ts +5 -0
  164. package/dist/components/NavMenu/types/NavMenuHeaderProps.type.d.ts +5 -0
  165. package/dist/components/NavMenu/types/NavMenuItemProps.type.d.ts +11 -0
  166. package/dist/components/NotificationBanner/NotificationBanner.d.ts +41 -0
  167. package/dist/components/Page/CRUDPage.d.ts +4 -0
  168. package/dist/components/Page/CRUDPage.types.d.ts +32 -0
  169. package/dist/components/Page/index.d.ts +3 -0
  170. package/dist/components/PageHeader/PageHeader.d.ts +4 -0
  171. package/dist/components/PageHeader/PageHeader.types.d.ts +28 -0
  172. package/dist/components/PageHeader/index.d.ts +2 -0
  173. package/dist/components/PaginationMenu/PaginationMenu.d.ts +3 -0
  174. package/dist/components/PaginationMenu/PaginationMenu.types.d.ts +37 -0
  175. package/dist/components/PaginationMenu/PaginationMenu.utils.d.ts +15 -0
  176. package/dist/components/PaginationMenu/PaginationMenuLarge.d.ts +3 -0
  177. package/dist/components/PaginationMenu/PaginationMenuSmall.d.ts +3 -0
  178. package/dist/components/PreviewPhone/PreviewPhone.d.ts +7 -0
  179. package/dist/components/Radio/RadioV2.d.ts +17 -0
  180. package/dist/components/RadioGroup/RadioGroupV2.d.ts +10 -0
  181. package/dist/components/Section/Section.d.ts +25 -0
  182. package/dist/components/Section/SectionItem.d.ts +9 -0
  183. package/dist/components/Section/SectionItemWithContent.d.ts +9 -0
  184. package/dist/components/Section/subcomponents/SectionActions.d.ts +21 -0
  185. package/dist/components/Select/Select.d.ts +46 -0
  186. package/dist/components/Select/SelectDropdownIndicator.d.ts +3 -0
  187. package/dist/components/Select/SelectLoadingIndicator.d.ts +3 -0
  188. package/dist/components/SettingsMenuButton/SettingsMenuButton.d.ts +19 -0
  189. package/dist/components/Spinner/Spinner.d.ts +6 -0
  190. package/dist/components/Steps/Step.d.ts +10 -0
  191. package/dist/components/Steps/Steps.d.ts +10 -0
  192. package/dist/components/TabLinks/TabLinks.d.ts +14 -0
  193. package/dist/components/Tabbar/Tabbar.d.ts +18 -0
  194. package/dist/components/Tabbar/TabbarItem.d.ts +16 -0
  195. package/dist/components/Table/Table.d.ts +16 -0
  196. package/dist/components/Table/Table.types.d.ts +43 -0
  197. package/dist/components/Table/Table.utils.d.ts +3 -0
  198. package/dist/components/Table/TableBody.d.ts +13 -0
  199. package/dist/components/Table/TableBodyRow.d.ts +10 -0
  200. package/dist/components/Table/TableBodyRowDataCell.d.ts +8 -0
  201. package/dist/components/Table/TableFooter.d.ts +8 -0
  202. package/dist/components/Table/TableHeader.d.ts +7 -0
  203. package/dist/components/Tag/Tag.d.ts +17 -0
  204. package/dist/components/Tag/Tag.utils.d.ts +4 -0
  205. package/dist/components/Tag/TagGroup.d.ts +10 -0
  206. package/dist/components/Text/Text.d.ts +115 -0
  207. package/dist/components/TextEditor/TextEditor.d.ts +17 -0
  208. package/dist/components/TextLink/TextLink.d.ts +14 -0
  209. package/dist/components/Textarea/Textarea.d.ts +29 -0
  210. package/dist/components/Timeline/Timeline.d.ts +14 -0
  211. package/dist/components/Timeline/TimelineHeader.d.ts +10 -0
  212. package/dist/components/Timeline/TimelineStep.d.ts +10 -0
  213. package/dist/components/Title/Title.d.ts +17 -0
  214. package/dist/components/Toaster/Toaster.d.ts +17 -0
  215. package/dist/components/Toaster/toast-elements-getter.d.ts +22 -0
  216. package/dist/components/Toaster/toast-progress-animator.d.ts +12 -0
  217. package/dist/components/Toaster/toast.d.ts +12 -0
  218. package/dist/components/ViewItem/ViewItem.d.ts +16 -0
  219. package/dist/index.d.ts +83 -0
  220. package/dist/index.development.js +5682 -0
  221. package/dist/index.development.js.map +1 -0
  222. package/dist/index.js +2 -0
  223. package/dist/index.js.map +1 -0
  224. package/dist/types/general.types.d.ts +8 -0
  225. package/dist/utils/string.utils.d.ts +7 -0
  226. package/dist/web-ui-tailwind.css +2890 -0
  227. package/dist/web-ui.esm.js +2 -0
  228. package/dist/web-ui.esm.js.map +1 -0
  229. package/package.json +159 -0
package/README.md ADDED
@@ -0,0 +1,179 @@
1
+ # WebUI
2
+
3
+ The `web-ui` repository contains the UI components for Luscii's frontend projects. It is published to NPM for usage into our projects. It uses Storybook and is published to Chromatic for easy review and tracking of visual changes.
4
+
5
+ ## Running locally
6
+
7
+ If you want to run Storybook locally you can use:
8
+
9
+ ```bash
10
+ yarn install
11
+ yarn dev # runs a Tailwind watcher and Storybook
12
+ ```
13
+
14
+ ## Testing your production build
15
+
16
+ Assuming the following setup:
17
+
18
+ - The `web-ui` and `cVitals-Web` repositories are siblings in the same folder.
19
+ - You ran `yarn install` in `cVitals-Web`.
20
+ - You ran `yarn build` in `web-ui`.
21
+
22
+ Run the script below in your terminal, _in the parent folder of the repositories_.
23
+
24
+ ```
25
+ cp -a web-ui/dist/. cVitals-Web/node_modules/@luscii-healthtech/web-ui/dist
26
+ ```
27
+
28
+ Or use the shortcut:
29
+
30
+ ```
31
+ yarn test-copy-build
32
+ ```
33
+
34
+ When you run `cVitals-Web` again, it should contain your latest updates in the component library. Use this to make sure your changes are solid before opening a pull request.
35
+
36
+ ## Contributing
37
+
38
+ Thank you for your help in keeping our component library organized and easy to use!
39
+
40
+ When adding components, please make sure to implement them consistently in our projects and that it is clear where and when they should be used. We want to avoid having many similar components. If you want to add components, do so in the `/src/components` directory. When you create new components, add them to Storybook as well. Stories go in the `/stories` directory.
41
+
42
+ If you add new components, please make sure they fit in with our existing ones and that it's clear where and when they should be used. We want to avoid having too many similar components.
43
+
44
+ ### Documentation
45
+
46
+ Every component should have proper documentation that explains when, where and how to use it. This sounds like a lot of work, but it doesn't have to be. And it's important, also for you, to quickly see how to best use a component.
47
+
48
+ Component documentation should include the following parts:
49
+
50
+ - A short explanation of each prop in a JSDoc comment style.
51
+ - A stories file (`<ComponentName>.stories.tsx`).
52
+ - A docs file (`<ComponentName>.docs.mdx`).
53
+
54
+ Below is an explanation of each.
55
+
56
+ #### Props documented via JSDoc comments
57
+
58
+ A short explanation of each prop in a JSDoc comment style. These will show up in your IDE for on the fly documentation when you need it. It will also show up in Storybook, so this is a double-whammy and provides documentation exactly where you need it.
59
+
60
+ ```ts
61
+ type Props = {
62
+ /**
63
+ * Optional description that will be shown close to the label, used to provide more
64
+ * detail about the field next to the concise text of the label.
65
+ */
66
+ helperText?: string;
67
+ };
68
+ ```
69
+
70
+ #### Stories file
71
+
72
+ Stories files (`*stories.tsx`) will show up in Storybook as separate entries/pages for each component. Each component can have multiple stories defined for it, showing different use cases, variants and states of that component.
73
+ It is important to include stories for a lot of these different variants and states, because visual snapshots will be created of these stories by a tool called Chromatic. This allows us to visually track changes to the component over time, and ensure that it looks and behaves correctly across different use cases. By writing stories that showcase all the different ways your component can be used, you can catch issues early and ensure that your component is robust and reliable.
74
+
75
+ You can find the Chromatic project for WebUI [here](https://www.chromatic.com/library?appId=62b0c4d5afd432f7ee70a740).
76
+
77
+ #### Docs file
78
+
79
+ The component docs file brings everything together and should be considered the source of truth about the component. What should be documented:
80
+
81
+ - Why we have the component and where it should be used.
82
+ - An overview of the different variants and states.
83
+ - Usage guidelines of when and where to use the component.
84
+ - Best practices to show what to do and what not do when working with the component.
85
+
86
+ > 🔎 If you need to e.g. create a story to show how NOT to use a component, you might not want
87
+ > to create a snapshot for that component or show it in the sidebar of Storybook. To omit a story
88
+ > from snapshots, add the following to its parameters:
89
+ >
90
+ > ```ts
91
+ > chromatic: { disableSnapshot: true },
92
+ > ```
93
+ >
94
+ > To hide a story from the sidebar, prefix the story (variable) name
95
+ > with `HIDE_`.
96
+
97
+ Please see examples of other components' docs files for inspiration and try to stay consistent with how they are documented.
98
+
99
+ ### Accessibility
100
+
101
+ WebUI is not currently designed to support screen reader usage. This is because our application is designed specifically for healthcare providers and is not publicly accessible. Our primary users are caregivers who work in healthcare and do not rely on screen readers to be able to use our application.
102
+ However, it is important for developers to write accessible frontend code. Even if our current application is not designed to support screen reader usage. This means following best practices for web accessibility, such as using semantic HTML, providing alternative text for images, and ensuring keyboard navigation is possible. While our primary users may not rely on screen readers, it is important to make our application as inclusive as possible to all users.
103
+
104
+ ### Testing
105
+
106
+ WebUI relies on two types of testing: Visual snapshot testing via Chromatic and interaction testing via Storybook.
107
+
108
+ Visual snapshot testing is handled for you. Any story you write will be picked up by Chromatic and it will create a snapshot for it.
109
+
110
+ Interaction testing via Storybook allows to programmatically interact with the component. This is very helpful in testing any logic that the component may use internally and any states of the component that might be hard/impossible to trigger from the outside.
111
+ More information on how to approach writing interaction tests can be found in [this page of the Storybook documentation](https://storybook.js.org/docs/react/writing-tests/interaction-testing#write-an-interaction-test).
112
+
113
+ ### Adding icons
114
+
115
+ Add new icons by following these steps:
116
+
117
+ - Add the svg file(s) in `src/components/Icons/icons`.
118
+ - Run `yarn icons`.
119
+
120
+ The icons are optimized by SVGO and transformed into React components by [SVGR](https://react-svgr.com) which are placed in `src/components/Icons`.
121
+
122
+ ## CI setup
123
+
124
+ ### Branching
125
+
126
+ The `main` branch is our default branch. When you contribute, branch from there and use the following branch naming convention:
127
+
128
+ ```
129
+ // Branch naming convention (enforced)
130
+
131
+ major/* // For a new design system or changes that effect our foundations (e.g. typography, color).
132
+ minor/* // For new components and stories.
133
+ patch/* // For small improvements to existing components or stories.
134
+ bug/* // For bugs or fixes.
135
+ chore/* // For things related to development that don't impact the output for consumers and/or users.
136
+ ```
137
+
138
+ We have configured at lot of magic for your convenience.
139
+
140
+ ### On every PR
141
+
142
+ 1. The module build, lint and tests are checked.
143
+ 2. The Storybook build is published to Chromatic.
144
+ 3. Labels are added based on the branch name and PR size.
145
+ 4. Branch names must follow the convention and are checked.
146
+
147
+ ### On merge to main
148
+
149
+ 1. Drafts a GitHub release.
150
+ 2. Bumps the version of the package.
151
+ 3. Publishes the new package version to NPM.
152
+
153
+ ## Stories
154
+
155
+ ### Stories using deprecated props
156
+
157
+ When creating new stories for components with deprecated functionality please prefix the story name with `Deprecated`. In addition, also mark it with a "DEPRECATED" badge via the story's parameters.
158
+
159
+ For example a story of a `FullPageModal` component using the deprecated `primaryButtonProps` prop would look like this:
160
+
161
+ ```tsx
162
+ import { BADGES } from "../.storybook/constants";
163
+
164
+ export const DeprecatedWithPrimaryButtonProps = {
165
+ render: OneColumTemplate,
166
+ args: {
167
+ isOpen: true,
168
+ primaryButtonProps: {
169
+ onClick: action("onClick Primary Button"),
170
+ text: "Primary",
171
+ },
172
+ },
173
+ parameters: {
174
+ badges: [BADGES.DEPRECATED],
175
+ },
176
+ };
177
+ ```
178
+
179
+ This groups deprecated stories together and will make it easier to remove them later on.
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { AccordionItemProps } from "./AccordionItem";
3
+ export interface AccordionProps {
4
+ dataTestId?: string;
5
+ items: AccordionItemProps[];
6
+ className?: string;
7
+ isCollapsedByDefault?: boolean;
8
+ }
9
+ declare const Accordion: React.VFC<AccordionProps>;
10
+ export default Accordion;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export interface AccordionItemProps {
3
+ id: string | number;
4
+ title: string;
5
+ content: React.ReactNode;
6
+ className?: string;
7
+ isCollapsedByDefault?: boolean;
8
+ }
9
+ export declare const AccordionItem: React.VFC<AccordionItemProps>;
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import { AccordionProps } from "../Accordion/Accordion";
3
+ import { DraggableListProps, ListItemProps, SortableListProps } from "../List/List.types";
4
+ import { AccordionItemProps } from "../Accordion/AccordionItem";
5
+ import { BaseButtonProps } from "../ButtonV2/ButtonProps.type";
6
+ import { AccordionListActions } from "./subcomponents/AccordionListActions";
7
+ export interface AccordionListProps extends Omit<AccordionProps, "items"> {
8
+ localisations: {
9
+ title: string;
10
+ searchPlaceholder?: string;
11
+ emptyListText?: string;
12
+ };
13
+ accordionItems: AccordionItem[];
14
+ /**
15
+ * @deprecated
16
+ * Use the `actions` prop to render any button(s)
17
+ * or other component(s) automatically in the correct area.
18
+ */
19
+ buttonProps?: BaseButtonProps;
20
+ isSearchEnabled?: boolean;
21
+ isLoading?: boolean;
22
+ actions?: React.ReactNode;
23
+ }
24
+ export type AccordionListItemProps<T = ListItemProps> = Omit<AccordionItemProps, "content"> & {
25
+ listItems: T[];
26
+ draggableListType?: "default";
27
+ };
28
+ export type DraggableAccordionListItemProps = Omit<AccordionItemProps, "content"> & {
29
+ draggableListType: "draggable";
30
+ listItems: DraggableListProps["items"];
31
+ };
32
+ export type SortableAccordionListItemProps = Omit<AccordionItemProps, "content"> & {
33
+ draggableListType: "sortable";
34
+ draggableIdentifier: string;
35
+ listItems: SortableListProps["items"];
36
+ };
37
+ export type AccordionItem = AccordionListItemProps | DraggableAccordionListItemProps | SortableAccordionListItemProps;
38
+ interface StaticComponents {
39
+ Actions: typeof AccordionListActions;
40
+ }
41
+ export declare const AccordionList: React.FC<AccordionListProps> & StaticComponents;
42
+ export default AccordionList;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ /**
3
+ * Use in the actions of an AccordionList. Spaces out the action
4
+ * components correctly in relation to the styling of the AccordionList component.
5
+ *
6
+ * @usage
7
+ * ```tsx
8
+ * <AccordionList
9
+ * actions={
10
+ * <AccordionList.Actions>
11
+ * <PrimaryButton />
12
+ * <SecondaryButton />
13
+ * </AccordionList.Actions>
14
+ * }
15
+ * />
16
+ * ```
17
+ */
18
+ export declare const AccordionListActions: React.FC<React.PropsWithChildren>;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface BadgeProps {
3
+ badgeCount: number;
4
+ className?: string;
5
+ }
6
+ declare const Badge: (props: BadgeProps) => JSX.Element;
7
+ export default Badge;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import type { BaseListItemProps, BaseListProps } from "./BaseList.types";
3
+ declare const BaseListInner: <T extends BaseListItemProps>({ dataTestId, title, headerButton, emptyStateMessage, isLoading, items, headerTransparent, itemComponent, footer, withBorder, }: BaseListProps<T>, ref: React.ForwardedRef<HTMLUListElement>) => JSX.Element;
4
+ export declare const BaseList: <T extends BaseListItemProps>(props: BaseListProps<T> & {
5
+ ref?: React.ForwardedRef<HTMLUListElement> | undefined;
6
+ }) => ReturnType<typeof BaseListInner>;
7
+ export {};
@@ -0,0 +1,55 @@
1
+ import React, { Ref, ReactNode } from "react";
2
+ import { PrimaryButtonProps } from "../..";
3
+ import { ButtonDefinition } from "../ButtonV2/ButtonProps.type";
4
+ import { IconProps } from "../Icons/types/IconProps.type";
5
+ import { TitleProps } from "../Title/Title";
6
+ export type BaseListItemProps = {
7
+ itemId: string | number;
8
+ title: string;
9
+ subtitle?: string;
10
+ icon?: React.FunctionComponent<IconProps> | string;
11
+ accessories?: JSX.Element[];
12
+ onClick?: (e: React.MouseEvent<HTMLLIElement>) => void;
13
+ /** Same as onClick to be compatible with listItem */
14
+ handleItemClick?: (e: React.MouseEvent<HTMLLIElement>) => void;
15
+ onAssetLoadError?: (payload: OnAssetLoadErrorPayload) => void;
16
+ tooltipId?: string;
17
+ isSelected?: boolean;
18
+ roundTop?: boolean;
19
+ roundBottom?: boolean;
20
+ withBorder?: boolean;
21
+ isDraggable?: boolean;
22
+ dataTestId?: string;
23
+ ref?: Ref<HTMLLIElement>;
24
+ renderDragHandle?: () => ReactNode;
25
+ htmlProps?: React.HTMLProps<HTMLLIElement>;
26
+ };
27
+ export type OnAssetLoadErrorPayload = Pick<BaseListItemProps, "itemId" | "subtitle" | "title" | "icon">;
28
+ export interface BaseListProps<T extends BaseListItemProps = BaseListItemProps> {
29
+ items: T[];
30
+ title?: string | TitleProps;
31
+ headerButton?: ButtonDefinition<PrimaryButtonProps>;
32
+ headerTransparent?: boolean;
33
+ itemComponent?: React.FC<T>;
34
+ emptyStateMessage?: string;
35
+ isLoading?: boolean;
36
+ dataTestId?: string;
37
+ footer?: ReactNode;
38
+ withBorder?: boolean;
39
+ ref?: Ref<HTMLUListElement>;
40
+ }
41
+ export type BaseListHeaderProps = {
42
+ title?: string | TitleProps;
43
+ button?: ButtonDefinition<PrimaryButtonProps>;
44
+ transparent?: boolean;
45
+ withBorder?: boolean;
46
+ };
47
+ export type DraggableBaseListProps = Omit<BaseListProps<DraggableBaseListItemProps>, "itemComponent">;
48
+ export type DraggableBaseListItemProps = BaseListItemProps & {
49
+ draggableIdentifier: string;
50
+ draggableData?: Record<string, unknown>;
51
+ };
52
+ export type SortableBaseListProps = DraggableBaseListProps & {
53
+ draggableIdentifier: string;
54
+ };
55
+ export type SortableBaseListItemProps = DraggableBaseListItemProps;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ export declare const BaseListEmptyState: React.FC<{
3
+ message: string;
4
+ roundTop?: boolean;
5
+ withBorder?: boolean;
6
+ }>;
7
+ export default BaseListEmptyState;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { BaseListHeaderProps } from "./BaseList.types";
3
+ export declare const BaseListHeader: React.FC<BaseListHeaderProps>;
4
+ export default BaseListHeader;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { BaseListItemProps } from "./BaseList.types";
3
+ export declare const BaseListIcon: React.FC<Pick<BaseListItemProps, "icon"> & {
4
+ onAssetLoadError?: () => void;
5
+ }>;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { BaseListItemProps } from "./BaseList.types";
3
+ export declare const BaseListItem: React.FC<BaseListItemProps>;
4
+ export default BaseListItem;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { DraggableBaseListProps } from "../BaseList.types";
3
+ export declare const DraggableBaseList: React.FC<DraggableBaseListProps>;
4
+ export default DraggableBaseList;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { DraggableBaseListItemProps } from "../BaseList.types";
3
+ export declare const DraggableBaseListItem: React.FC<DraggableBaseListItemProps>;
@@ -0,0 +1,2 @@
1
+ export { DraggableBaseList } from "./DraggableBaseList";
2
+ export { DraggableBaseListItem } from "./DraggableBaseListItem";
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ListItemSkeleton: () => JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import "./ListSkeleton.scss";
3
+ type ListSkeletonProps = {
4
+ items: number;
5
+ dataTestId?: string;
6
+ };
7
+ export declare const ListSkeleton: ({ items, dataTestId, }: ListSkeletonProps) => JSX.Element;
8
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { SortableBaseListProps } from "../BaseList.types";
3
+ export declare const SortableBaseList: React.FC<SortableBaseListProps>;
4
+ export default SortableBaseList;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { SortableBaseListItemProps } from "../BaseList.types";
3
+ export declare const SortableBaseListItem: React.FC<SortableBaseListItemProps>;
@@ -0,0 +1,2 @@
1
+ export { SortableBaseList } from "./SortableBaseList";
2
+ export { SortableBaseListItem } from "./SortableBaseListItem";
@@ -0,0 +1,6 @@
1
+ export { BaseList } from "./BaseList";
2
+ export { BaseListItem } from "./BaseListItem";
3
+ export type { BaseListProps, BaseListItemProps, OnAssetLoadErrorPayload, DraggableBaseListProps, DraggableBaseListItemProps, } from "./BaseList.types";
4
+ export { DraggableBaseList, DraggableBaseListItem } from "./DraggableBaseList";
5
+ export { SortableBaseList, SortableBaseListItem } from "./SortableBaseList";
6
+ export { getDndListItemProps } from "./utils";
@@ -0,0 +1,10 @@
1
+ import { Active, Over } from "@dnd-kit/core";
2
+ import { ListItemProps } from "../List/List";
3
+ declare const draggableListItemPropsPointer: {
4
+ readonly symbol: symbol;
5
+ };
6
+ type DraggableListItemProps = WeakMap<typeof draggableListItemPropsPointer, Pick<ListItemProps, "itemId" | "title" | "subtitle" | "icon" | "isDraggable" | "isSelected">>;
7
+ export declare const createDraggableListProps: ({ itemId, title, subtitle, icon, isDraggable, isSelected, }: ListItemProps) => DraggableListItemProps;
8
+ export declare const draggableListPropsKey: "listItem";
9
+ export declare const getDndListItemProps: (subject: Active | Over) => ListItemProps | null;
10
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { BreadcrumbDividerProps, Crumb } from "./Breadcrumbs.types";
3
+ export declare const BreadcrumbItem: React.FC<Crumb>;
4
+ export declare const BreadcrumbDividerItem: React.FC<BreadcrumbDividerProps>;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import type { BreadcrumbProps } from "./Breadcrumbs.types";
3
+ export declare const Breadcrumbs: React.FC<BreadcrumbProps>;
@@ -0,0 +1,14 @@
1
+ export interface Crumb {
2
+ name: string;
3
+ key?: string;
4
+ link?: string;
5
+ }
6
+ export interface BreadcrumbProps {
7
+ crumbs: Crumb[];
8
+ truncateAfter?: number;
9
+ }
10
+ export type BreadcrumbDividerProps = {
11
+ onClick: () => void;
12
+ truncatedCrumbs: Crumb[];
13
+ };
14
+ export declare const isBreadcrumbDividerProps: (subject: unknown) => subject is BreadcrumbDividerProps;
@@ -0,0 +1,2 @@
1
+ export type { BreadcrumbProps, Crumb } from "./Breadcrumbs.types";
2
+ export { Breadcrumbs } from "./Breadcrumbs";
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { BUTTON_ROLES, ButtonProps } from "./Button.types";
3
+ /**
4
+ * TODO: We have to probably use [ButtonV2.tsx](../../components/ButtonV2/ButtonV2.tsx)
5
+ * to replace this component at some point.
6
+ */
7
+ declare function Button(props: ButtonProps): JSX.Element;
8
+ export default Button;
9
+ export { BUTTON_ROLES };
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ import { RestPropped } from "../../types/general.types";
3
+ import { IconProps } from "../Icons/types/IconProps.type";
4
+ export declare const BUTTON_ROLES: {
5
+ readonly PRIMARY: "primary";
6
+ readonly SECONDARY: "secondary";
7
+ readonly SECONDARY_DARK: "secondaryDark";
8
+ readonly TERTIARY: "tertiary";
9
+ readonly QUATERNARY: "quaternary";
10
+ readonly NEGATIVE: "negative";
11
+ readonly TEXT: "text";
12
+ readonly LINK: "link";
13
+ readonly ICON: "icon";
14
+ };
15
+ type BUTTON_KEYS = keyof typeof BUTTON_ROLES;
16
+ export type BUTTON_TYPE = (typeof BUTTON_ROLES)[BUTTON_KEYS];
17
+ export type ButtonType = "button" | "submit";
18
+ export interface ButtonProps extends RestPropped {
19
+ text?: string;
20
+ role?: BUTTON_TYPE;
21
+ type?: ButtonType;
22
+ title?: string;
23
+ link?: string;
24
+ isPending?: boolean;
25
+ isDisabled?: boolean;
26
+ onClick?: (arg: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
27
+ className?: string;
28
+ iconName?: string;
29
+ hasIcon?: boolean;
30
+ dynamicIcon?: React.FunctionComponent<IconProps>;
31
+ }
32
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface ButtonIconProps {
3
+ name: string;
4
+ className?: string;
5
+ }
6
+ export declare const ButtonIcon: (props: ButtonIconProps) => JSX.Element;
7
+ export {};
@@ -0,0 +1,49 @@
1
+ import React from "react";
2
+ import type { IconKey, IconProps } from "../Icons/types/IconProps.type";
3
+ import { TextColor, TextHoverColor } from "../Text/Text";
4
+ /**
5
+ * Properties that are present in all variants of the button
6
+ *
7
+ */
8
+ export interface BaseButtonProps extends React.ComponentPropsWithRef<"button"> {
9
+ text?: string;
10
+ icon?: React.FunctionComponent<IconProps> | IconKey;
11
+ isDisabled?: boolean;
12
+ className?: string;
13
+ dataTestId?: string;
14
+ }
15
+ export type NonPrimaryButtonProps = BaseButtonProps;
16
+ /**
17
+ * Extra properties that can be set when the variant of the button
18
+ * supports the pending state
19
+ *
20
+ */
21
+ export interface ButtonWithPendingStateProps extends BaseButtonProps {
22
+ isPending?: boolean;
23
+ }
24
+ export type PrimaryButtonProps = ButtonWithPendingStateProps;
25
+ /**
26
+ * All properties of BaseButtonProps and ButtonWithPendingStateProps,
27
+ * plus other properties that are assigned internally by the button variants.
28
+ *
29
+ */
30
+ export interface ButtonProps extends BaseButtonProps, ButtonWithPendingStateProps {
31
+ textColor?: TextColor;
32
+ textHoverColor?: TextHoverColor;
33
+ }
34
+ /**
35
+ * Interface for defining a button
36
+ */
37
+ export interface ButtonDefinition<Props extends BaseButtonProps = BaseButtonProps> {
38
+ buttonType: React.FunctionComponent<Props>;
39
+ buttonProps: React.Attributes & Props;
40
+ }
41
+ /**
42
+ * Interface for defining a button with mandatory key
43
+ */
44
+ export interface ButtonDefinitionWithKey<Props extends BaseButtonProps = BaseButtonProps> {
45
+ buttonType: React.FunctionComponent<Props>;
46
+ buttonProps: {
47
+ key: string | number;
48
+ } & Props;
49
+ }
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { ButtonProps } from "./ButtonProps.type";
3
+ export declare const ButtonV2: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ButtonWithPendingStateProps } from "./ButtonProps.type";
3
+ export declare const PrimaryButton: (props: ButtonWithPendingStateProps) => JSX.Element;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { ButtonProps } from "./ButtonProps.type";
3
+ export declare const SecondaryButton: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { BaseButtonProps } from "./ButtonProps.type";
3
+ export declare const TertiaryButton: (props: BaseButtonProps) => JSX.Element;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ export type CardProps = {
3
+ title: string;
4
+ children: React.ReactNode;
5
+ dataTestId?: string;
6
+ };
7
+ /**
8
+ * Card component that centralizes itself inside a container.
9
+ * Specific variant made with ui-w-135 to suffice the use case needed,
10
+ * more variants can be added.
11
+ */
12
+ export declare const Card: React.FC<CardProps>;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ interface CarouselProps {
3
+ id: string;
4
+ slides: React.ReactNode[];
5
+ className?: string;
6
+ }
7
+ declare const Carousel: ({ slides, className, id }: CarouselProps) => JSX.Element;
8
+ export default Carousel;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import "./GliderContainer.scss";
3
+ interface GliderContainerProps {
4
+ children: React.ReactNode;
5
+ }
6
+ export declare const GliderContainer: (props: GliderContainerProps) => JSX.Element;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from "../Button/Button.types";
3
+ export type BackgroundColor = "white" | "slate-50";
4
+ export type ImageSize = "small" | "large";
5
+ export interface CenteredHeroProps {
6
+ title: string;
7
+ text: string;
8
+ image: string;
9
+ imageSize?: ImageSize;
10
+ buttons?: ButtonProps[];
11
+ background?: BackgroundColor;
12
+ }
13
+ declare const CenteredHero: ({ title, text, image, buttons, background, imageSize, }: CenteredHeroProps) => JSX.Element;
14
+ export default CenteredHero;