@luscii-healthtech/web-ui 0.0.0-alpha.38b1613

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 (218) hide show
  1. package/README.md +109 -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 +19 -0
  41. package/dist/components/CheckboxList/CheckboxGroup.d.ts +3 -0
  42. package/dist/components/CheckboxList/CheckboxList.d.ts +5 -0
  43. package/dist/components/CheckboxList/CheckboxList.types.d.ts +52 -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/Form/Form.d.ts +30 -0
  63. package/dist/components/Form/FormFieldCheckbox.d.ts +9 -0
  64. package/dist/components/Form/FormFieldCheckboxList.d.ts +9 -0
  65. package/dist/components/Form/FormFieldErrorMessages.d.ts +8 -0
  66. package/dist/components/Form/FormFieldLabeler.d.ts +8 -0
  67. package/dist/components/Form/FormImagePicker.d.ts +9 -0
  68. package/dist/components/Form/FormInput.d.ts +14 -0
  69. package/dist/components/Form/FormRadioGroup.d.ts +13 -0
  70. package/dist/components/Form/FormSelect.d.ts +10 -0
  71. package/dist/components/Form/FormTextarea.d.ts +14 -0
  72. package/dist/components/Form/form.transformer.d.ts +3 -0
  73. package/dist/components/Form/form.types.d.ts +91 -0
  74. package/dist/components/Icon/Icon.d.ts +17 -0
  75. package/dist/components/Icon/index.d.ts +1 -0
  76. package/dist/components/Icons/AddIcon.d.ts +4 -0
  77. package/dist/components/Icons/AlertsIcon.d.ts +4 -0
  78. package/dist/components/Icons/BellIcon.d.ts +4 -0
  79. package/dist/components/Icons/BluetoothIcon.d.ts +4 -0
  80. package/dist/components/Icons/ChartIcon.d.ts +4 -0
  81. package/dist/components/Icons/ChartLineColoredIcon.d.ts +4 -0
  82. package/dist/components/Icons/ChatBoxIcon.d.ts +4 -0
  83. package/dist/components/Icons/CheckIcon.d.ts +4 -0
  84. package/dist/components/Icons/ChevronDoubleIcon.d.ts +4 -0
  85. package/dist/components/Icons/ChevronDownIcon.d.ts +4 -0
  86. package/dist/components/Icons/ChevronRightIcon.d.ts +4 -0
  87. package/dist/components/Icons/CrossIcon.d.ts +4 -0
  88. package/dist/components/Icons/DeleteIcon.d.ts +4 -0
  89. package/dist/components/Icons/DownArrowIcon.d.ts +4 -0
  90. package/dist/components/Icons/DragIcon.d.ts +4 -0
  91. package/dist/components/Icons/EditIcon.d.ts +4 -0
  92. package/dist/components/Icons/EmptyIcon.d.ts +4 -0
  93. package/dist/components/Icons/EmptyStateDashboardIcon.d.ts +4 -0
  94. package/dist/components/Icons/ExclamationMarkIcon.d.ts +4 -0
  95. package/dist/components/Icons/EyeIcon.d.ts +4 -0
  96. package/dist/components/Icons/GearColoredIcon.d.ts +4 -0
  97. package/dist/components/Icons/GearIcon.d.ts +4 -0
  98. package/dist/components/Icons/GroupColoredIcon.d.ts +4 -0
  99. package/dist/components/Icons/GroupIcon.d.ts +4 -0
  100. package/dist/components/Icons/HamburgerIcon.d.ts +4 -0
  101. package/dist/components/Icons/HeartIcon.d.ts +4 -0
  102. package/dist/components/Icons/ImageIcon.d.ts +4 -0
  103. package/dist/components/Icons/InfoIcon.d.ts +4 -0
  104. package/dist/components/Icons/LeftArrowIcon.d.ts +4 -0
  105. package/dist/components/Icons/LightBulbIcon.d.ts +4 -0
  106. package/dist/components/Icons/LinkIcon.d.ts +4 -0
  107. package/dist/components/Icons/LockIcon.d.ts +4 -0
  108. package/dist/components/Icons/MessagesIcon.d.ts +4 -0
  109. package/dist/components/Icons/MouseIcon.d.ts +4 -0
  110. package/dist/components/Icons/NotesIcon.d.ts +4 -0
  111. package/dist/components/Icons/PageViewIcon.d.ts +4 -0
  112. package/dist/components/Icons/PinIcon.d.ts +4 -0
  113. package/dist/components/Icons/PrintIcon.d.ts +4 -0
  114. package/dist/components/Icons/RightArrowIcon.d.ts +4 -0
  115. package/dist/components/Icons/SearchCancelIcon.d.ts +4 -0
  116. package/dist/components/Icons/SearchIcon.d.ts +4 -0
  117. package/dist/components/Icons/SmallCircleIcon.d.ts +4 -0
  118. package/dist/components/Icons/SmallDiamondIcon.d.ts +4 -0
  119. package/dist/components/Icons/SmallSquareIcon.d.ts +4 -0
  120. package/dist/components/Icons/SpaceRocketIcon.d.ts +4 -0
  121. package/dist/components/Icons/StarIcon.d.ts +4 -0
  122. package/dist/components/Icons/StatusColoredIcon.d.ts +4 -0
  123. package/dist/components/Icons/WarningIcon.d.ts +4 -0
  124. package/dist/components/Icons/iconWrapper/iconWrapper.d.ts +4 -0
  125. package/dist/components/Icons/iconWrapper/index.d.ts +1 -0
  126. package/dist/components/Icons/index.d.ts +48 -0
  127. package/dist/components/Icons/templates/component.d.ts +3 -0
  128. package/dist/components/Icons/templates/index.d.ts +2 -0
  129. package/dist/components/Icons/types/IconProps.type.d.ts +8 -0
  130. package/dist/components/Image/Image.d.ts +10 -0
  131. package/dist/components/ImagePicker/ImageCategory.d.ts +14 -0
  132. package/dist/components/ImagePicker/ImagePicker.d.ts +29 -0
  133. package/dist/components/InfoField/InfoField.d.ts +18 -0
  134. package/dist/components/Input/Input.d.ts +57 -0
  135. package/dist/components/Input/SearchInput.d.ts +4 -0
  136. package/dist/components/List/List.d.ts +6 -0
  137. package/dist/components/List/List.types.d.ts +19 -0
  138. package/dist/components/List/ListItem.d.ts +4 -0
  139. package/dist/components/List/index.d.ts +5 -0
  140. package/dist/components/LoadingIndicator/LoadingIndicator.d.ts +12 -0
  141. package/dist/components/Modal/FullPageModal.d.ts +11 -0
  142. package/dist/components/Modal/FullPageModalHeader.d.ts +7 -0
  143. package/dist/components/Modal/Modal.d.ts +6 -0
  144. package/dist/components/Modal/ModalBase.d.ts +16 -0
  145. package/dist/components/Modal/ModalFooter.d.ts +12 -0
  146. package/dist/components/Modal/ModalHeader.d.ts +6 -0
  147. package/dist/components/NavMenu/NavLayout.d.ts +20 -0
  148. package/dist/components/NavMenu/NavMenu.d.ts +16 -0
  149. package/dist/components/NavMenu/NavMenuContent.d.ts +3 -0
  150. package/dist/components/NavMenu/NavMenuFooter.d.ts +3 -0
  151. package/dist/components/NavMenu/NavMenuHeader.d.ts +3 -0
  152. package/dist/components/NavMenu/NavMenuItem.d.ts +3 -0
  153. package/dist/components/NavMenu/types/NavMenuFooterProps.type.d.ts +5 -0
  154. package/dist/components/NavMenu/types/NavMenuHeaderProps.type.d.ts +5 -0
  155. package/dist/components/NavMenu/types/NavMenuItemProps.type.d.ts +11 -0
  156. package/dist/components/NotificationBanner/NotificationBanner.d.ts +41 -0
  157. package/dist/components/Page/CRUDPage.d.ts +4 -0
  158. package/dist/components/Page/CRUDPage.types.d.ts +32 -0
  159. package/dist/components/Page/index.d.ts +3 -0
  160. package/dist/components/PageHeader/PageHeader.d.ts +4 -0
  161. package/dist/components/PageHeader/PageHeader.types.d.ts +28 -0
  162. package/dist/components/PageHeader/index.d.ts +2 -0
  163. package/dist/components/PaginationMenu/PaginationMenu.d.ts +3 -0
  164. package/dist/components/PaginationMenu/PaginationMenu.types.d.ts +37 -0
  165. package/dist/components/PaginationMenu/PaginationMenu.utils.d.ts +15 -0
  166. package/dist/components/PaginationMenu/PaginationMenuLarge.d.ts +3 -0
  167. package/dist/components/PaginationMenu/PaginationMenuSmall.d.ts +3 -0
  168. package/dist/components/PreviewPhone/PreviewPhone.d.ts +7 -0
  169. package/dist/components/Radio/RadioV2.d.ts +17 -0
  170. package/dist/components/RadioGroup/RadioGroupV2.d.ts +10 -0
  171. package/dist/components/Section/Section.d.ts +25 -0
  172. package/dist/components/Section/SectionItem.d.ts +9 -0
  173. package/dist/components/Section/SectionItemWithContent.d.ts +9 -0
  174. package/dist/components/Section/subcomponents/SectionActions.d.ts +21 -0
  175. package/dist/components/Select/Select.d.ts +40 -0
  176. package/dist/components/Select/SelectDropdownIndicator.d.ts +3 -0
  177. package/dist/components/Select/SelectLoadingIndicator.d.ts +3 -0
  178. package/dist/components/SettingsMenuButton/SettingsMenuButton.d.ts +19 -0
  179. package/dist/components/Spinner/Spinner.d.ts +6 -0
  180. package/dist/components/Steps/Step.d.ts +10 -0
  181. package/dist/components/Steps/Steps.d.ts +10 -0
  182. package/dist/components/TabLinks/TabLinks.d.ts +14 -0
  183. package/dist/components/Tabbar/Tabbar.d.ts +18 -0
  184. package/dist/components/Tabbar/TabbarItem.d.ts +16 -0
  185. package/dist/components/Table/Table.d.ts +16 -0
  186. package/dist/components/Table/Table.types.d.ts +43 -0
  187. package/dist/components/Table/Table.utils.d.ts +3 -0
  188. package/dist/components/Table/TableBody.d.ts +13 -0
  189. package/dist/components/Table/TableBodyRow.d.ts +10 -0
  190. package/dist/components/Table/TableBodyRowDataCell.d.ts +8 -0
  191. package/dist/components/Table/TableFooter.d.ts +8 -0
  192. package/dist/components/Table/TableHeader.d.ts +7 -0
  193. package/dist/components/Tag/Tag.d.ts +17 -0
  194. package/dist/components/Tag/Tag.utils.d.ts +4 -0
  195. package/dist/components/Tag/TagGroup.d.ts +10 -0
  196. package/dist/components/Text/Text.d.ts +66 -0
  197. package/dist/components/TextEditor/TextEditor.d.ts +17 -0
  198. package/dist/components/TextLink/TextLink.d.ts +11 -0
  199. package/dist/components/Textarea/Textarea.d.ts +29 -0
  200. package/dist/components/Timeline/Timeline.d.ts +14 -0
  201. package/dist/components/Timeline/TimelineHeader.d.ts +10 -0
  202. package/dist/components/Timeline/TimelineStep.d.ts +10 -0
  203. package/dist/components/Title/Title.d.ts +17 -0
  204. package/dist/components/Toaster/Toaster.d.ts +17 -0
  205. package/dist/components/Toaster/toast-elements-getter.d.ts +22 -0
  206. package/dist/components/Toaster/toast-progress-animator.d.ts +12 -0
  207. package/dist/components/Toaster/toast.d.ts +12 -0
  208. package/dist/components/ViewItem/ViewItem.d.ts +16 -0
  209. package/dist/index.d.ts +81 -0
  210. package/dist/index.development.js +5531 -0
  211. package/dist/index.development.js.map +1 -0
  212. package/dist/index.js +2 -0
  213. package/dist/index.js.map +1 -0
  214. package/dist/types/general.types.d.ts +8 -0
  215. package/dist/utils/string.utils.d.ts +7 -0
  216. package/dist/web-ui.esm.js +2 -0
  217. package/dist/web-ui.esm.js.map +1 -0
  218. package/package.json +153 -0
package/README.md ADDED
@@ -0,0 +1,109 @@
1
+ # web-ui
2
+
3
+ The web-ui repository contains the web UI components for Luscii's front end projects. It is published to NPM for inclusion into our projects. It also uses storybook and is published to chromatic for easy review of 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 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 are in the same folder
19
+ - You have ran `yarn install` on `cVitals-Web`
20
+ - You have ran `yarn build` on `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 again, it should contain your latest updates in the component library. Use this to make sure your changes are solid before merging a pull request.
35
+
36
+ ## Contributing
37
+
38
+ Make sure you understand our design system and follow its guidelines. They are document in storybook. We value consistency, simplicity and usability highly. Don't mess it up.
39
+
40
+ If you want to add components, do so in
41
+
42
+ ```
43
+ /src/components
44
+ ```
45
+
46
+ Please stay vigilant when adding components that we implement them consistently in our projects and that it is clear when and where they have to be used. We want to avoid a lot of components that are similar.
47
+
48
+ When you create new components, you must add them to storybook as well. Stories go in
49
+
50
+ ```
51
+ /stories
52
+ ```
53
+
54
+ ### Adding icons
55
+
56
+ Add new icons by:
57
+
58
+ - Add the svg file(s) in `src/components/Icons/icons`
59
+ - Run `yarn icons`
60
+
61
+ The icons are optimized by SVGO and transformed into React components by [SVGR](https://react-svgr.com) which are placed in `src/components/Icons`.
62
+
63
+ ## CI setup
64
+
65
+ #### Branching
66
+
67
+ The `main` branch is our default branch. When you contribute, branch from there and name your branch
68
+
69
+ ```
70
+ //Branch names convention (enforced)
71
+
72
+ major/* //for a new design system or changes that effect our foundations (typography, color)
73
+ minor/* //for new components and stories
74
+ patch/* //for small improvements to existing components, stories
75
+ bug/* //for bugs, fixes
76
+ ```
77
+
78
+ We have configured at lot of magic for your convenience.
79
+
80
+ #### On every PR
81
+
82
+ 1. the module build, lint and tests are checked.
83
+ 2. The storybook build is published to chromatic.
84
+ 3. Labels are added based on the branch name and PR size.
85
+ 4. Branch names must follow the convention and are checked
86
+
87
+ #### On merge to main
88
+
89
+ 1. Draft a github release
90
+ 2. Version bump of the package
91
+ 3. Publish new package to NPM
92
+
93
+ ---
94
+
95
+ ## IE11
96
+
97
+ This package includes [dnd-kit](https://dndkit.com) as a peer dependency. The bundle of dnd-kit contains syntax which isn't compatible with IE11, therefore any application needing to support IE11 has to transpile dnd-kit.
98
+
99
+ It should also at least include the following polyfills to make it work:
100
+
101
+ - [core-js](https://www.npmjs.com/package/core-js)
102
+ - [regenerator-runtime](https://www.npmjs.com/package/regenerator-runtime)
103
+ - [smoothscroll-polyfill](https://www.npmjs.com/package/smoothscroll-polyfill)
104
+
105
+ Optional:
106
+
107
+ - [web-animations-js](https://www.npmjs.com/package/web-animations-js)
108
+
109
+ This isn't necessary if the [drop animation is disabled](https://github.com/clauderic/dnd-kit/issues/705#issuecomment-1103056336). Check out [this ticket](https://github.com/clauderic/dnd-kit/issues/271) for more information on IE11.
@@ -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;
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ import { CheckboxGroupItemProps } from "../CheckboxList/CheckboxList.types";
3
+ export type Item = {
4
+ group?: string;
5
+ isPinned?: boolean;
6
+ } & Pick<CheckboxGroupItemProps, "id" | "label" | "isChecked" | "isDisabled">;
7
+ export interface Group {
8
+ title?: string;
9
+ items: Item[];
10
+ }
11
+ interface CheckboxListModalTexts {
12
+ title: string;
13
+ confirmLabel: string;
14
+ cancelLabel: string;
15
+ searchPlaceHolder?: string;
16
+ emptyState: string;
17
+ }
18
+ export interface CheckboxListModalProps {
19
+ texts: CheckboxListModalTexts;
20
+ initialItems: Array<Item>;
21
+ isLoadingInitialItems?: boolean;
22
+ isOpen: boolean;
23
+ onSave: (newItems: Item[]) => void;
24
+ onCloseClick: () => void;
25
+ filterItem: (item: Item, searchQuery: string) => boolean;
26
+ className?: string;
27
+ hasSearch: boolean;
28
+ }
29
+ export declare const CheckboxListModal: ({ texts, initialItems, isLoadingInitialItems, isOpen, onSave, onCloseClick, filterItem, hasSearch, }: CheckboxListModalProps) => JSX.Element;
30
+ export {};
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import "./Checkbox.scss";
3
+ export interface CheckboxProps {
4
+ id?: string;
5
+ text?: string;
6
+ explanation?: string;
7
+ type?: "regular" | "switch";
8
+ isChecked?: boolean;
9
+ isIndeterminate?: boolean;
10
+ isDisabled?: boolean;
11
+ name?: string;
12
+ value?: string;
13
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
14
+ className?: string;
15
+ error?: boolean;
16
+ innerRef?: React.Ref<HTMLInputElement>;
17
+ }
18
+ export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
19
+ export default Checkbox;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { CheckboxGroupProps } from "./CheckboxList.types";
3
+ export declare const CheckboxGroup: ({ title, items, onChange, className, hasDividers, isCollapsed, collapsible, }: CheckboxGroupProps) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { CheckboxListProps } from "./CheckboxList.types";
3
+ export { CheckboxListProps };
4
+ export declare const CheckboxList: ({ groups, onChange, className, hasDividers, }: CheckboxListProps) => JSX.Element;
5
+ export default CheckboxList;