@luscii-healthtech/web-ui 0.4.2 → 0.4.5

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 (30) hide show
  1. package/README.md +37 -21
  2. package/dist/components/NavMenu/NavMenu.d.ts +9 -1
  3. package/dist/components/NavMenu/NavMenu.utils.d.ts +3 -0
  4. package/dist/components/NavMenu/NavMenuContent.d.ts +2 -6
  5. package/dist/components/NavMenu/NavMenuItem.d.ts +1 -1
  6. package/dist/components/Section/SectionItemWithContent.d.ts +8 -11
  7. package/dist/index.d.ts +3 -3
  8. package/dist/web-ui-tailwind.css +0 -13
  9. package/dist/web-ui.cjs.development.js +223 -175
  10. package/dist/web-ui.cjs.development.js.map +1 -1
  11. package/dist/web-ui.cjs.production.min.js +1 -1
  12. package/dist/web-ui.cjs.production.min.js.map +1 -1
  13. package/dist/web-ui.esm.js +220 -172
  14. package/dist/web-ui.esm.js.map +1 -1
  15. package/package.json +3 -2
  16. package/src/assets/arrow-down-icon.svg +3 -0
  17. package/src/components/Datepicker/Datepicker.scss +3 -2
  18. package/src/components/ListTable/ListTable.tsx +4 -13
  19. package/src/components/NavMenu/{NavMenu.js → NavMenu.tsx} +7 -3
  20. package/src/components/NavMenu/NavMenu.utils.ts +6 -0
  21. package/src/components/NavMenu/NavMenuContent.tsx +8 -8
  22. package/src/components/NavMenu/NavMenuItem.tsx +1 -1
  23. package/src/components/Section/SectionItemWithContent.tsx +30 -0
  24. package/src/components/Title/Title.scss +0 -59
  25. package/src/index.tsx +6 -6
  26. package/dist/web-ui.cjs.development.css +0 -1128
  27. package/dist/web-ui.cjs.production.min.css +0 -1128
  28. package/dist/web-ui.esm.css +0 -1128
  29. package/src/components/Section/SectionItemWithContent.js +0 -32
  30. package/src/components/Section/SectionItemWithContent.scss +0 -10
package/README.md CHANGED
@@ -1,60 +1,76 @@
1
1
  # web-ui
2
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.
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
4
 
5
5
  ## Running locally
6
6
 
7
- If you want to run storybook locally you can use
7
+ If you want to run storybook locally you can use
8
8
 
9
9
  ```bash
10
10
  yarn install
11
11
  yarn storybook
12
12
  ```
13
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
+ 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.
29
+
14
30
  ## Contributing
15
31
 
16
32
  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.
17
33
 
18
- If you want to add components, do so in
34
+ If you want to add components, do so in
35
+
19
36
  ```
20
37
  /src/components
21
38
  ```
22
- 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.
39
+
40
+ 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.
23
41
 
24
42
  When you create new components, you must add them to storybook as well. Stories go in
43
+
25
44
  ```
26
45
  /stories
27
46
  ```
28
47
 
29
-
30
48
  ## CI setup
31
49
 
32
50
  #### Branching
33
51
 
34
- The `main` branch is our default branch. When you contribute, branch from there and name your branch
52
+ The `main` branch is our default branch. When you contribute, branch from there and name your branch
35
53
 
36
- ```
37
- //Branch names convention (enforced)
38
-
39
- major/* //for a new design system or changes that effect our foundations (typography, color)
40
- minor/* //for new components and stories
41
- patch/* //for small improvements to existing components, stories
42
- bug/* //for bugs, fixes
43
- ```
54
+ ```
55
+ //Branch names convention (enforced)
44
56
 
45
- We have configured at lot of magic for your convenience.
57
+ major/* //for a new design system or changes that effect our foundations (typography, color)
58
+ minor/* //for new components and stories
59
+ patch/* //for small improvements to existing components, stories
60
+ bug/* //for bugs, fixes
61
+ ```
62
+
63
+ We have configured at lot of magic for your convenience.
46
64
 
47
65
  #### On every PR
48
- 1. the module build, lint and tests are checked.
49
- 2. The storybook build is published to chromatic.
50
- 3. Labels are added based on the branch name and PR size.
51
- 4. Branch names must follow the convention and are checked
52
-
53
66
 
67
+ 1. the module build, lint and tests are checked.
68
+ 2. The storybook build is published to chromatic.
69
+ 3. Labels are added based on the branch name and PR size.
70
+ 4. Branch names must follow the convention and are checked
54
71
 
55
72
  #### On merge to main
56
73
 
57
74
  1. Draft a github release
58
75
  2. Version bump of the package
59
76
  3. Publish new package to NPM
60
-
@@ -1 +1,9 @@
1
- export function NavMenu(props: any): JSX.Element;
1
+ /// <reference types="react" />
2
+ import { NavMenuItemProps } from "./NavMenuItem";
3
+ export declare type NavMenuElement = NavMenuItemProps | {
4
+ type: "separator" | "spacer";
5
+ };
6
+ export declare type NavMenuProps = {
7
+ items: NavMenuElement[];
8
+ };
9
+ export declare function NavMenu({ items }: NavMenuProps): JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { NavMenuElement } from "./NavMenu";
2
+ import { NavMenuItemProps } from "./NavMenuItem";
3
+ export declare function isNavMenuItem(item: NavMenuElement): item is NavMenuItemProps;
@@ -1,7 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { NavMenuItemProps } from "./NavMenuItem";
3
- interface NavMenuContentProps {
4
- items: Array<NavMenuItemProps>;
5
- }
6
- export declare const NavMenuContent: (props: NavMenuContentProps) => JSX.Element;
7
- export {};
2
+ import { NavMenuProps } from "./NavMenu";
3
+ export declare const NavMenuContent: ({ items }: NavMenuProps) => JSX.Element;
@@ -9,7 +9,7 @@ export interface NavMenuItemProps {
9
9
  dataTestId: string;
10
10
  gtmEvent?: string;
11
11
  isExternal?: boolean;
12
- type?: "separator" | "spacer" | "base" | void;
12
+ type?: "base";
13
13
  track?: (event: string) => void;
14
14
  }
15
15
  export declare const NavMenuItem: (props: NavMenuItemProps) => JSX.Element;
@@ -1,12 +1,9 @@
1
- export default SectionItemWithContent;
2
- declare function SectionItemWithContent(props: any): JSX.Element;
3
- declare namespace SectionItemWithContent {
4
- export namespace propTypes {
5
- export const text: PropTypes.Validator<string>;
6
- export const icon: PropTypes.Requireable<string | object>;
7
- export const className: PropTypes.Requireable<string>;
8
- export const iconClass: PropTypes.Requireable<string>;
9
- export const onClick: PropTypes.Requireable<(...args: any[]) => any>;
10
- }
1
+ /// <reference types="react" />
2
+ import { SectionItemProps } from "./SectionItem";
3
+ interface SectionItemWithContentProps extends Omit<SectionItemProps, "children"> {
4
+ text: string;
5
+ icon?: string;
6
+ iconClass?: string;
11
7
  }
12
- import PropTypes from "prop-types";
8
+ declare function SectionItemWithContent(props: SectionItemWithContentProps): JSX.Element;
9
+ export default SectionItemWithContent;
package/dist/index.d.ts CHANGED
@@ -17,13 +17,12 @@ export { default as InfoBlock } from "./components/InfoBlock/InfoBlock";
17
17
  export { InfoField } from "./components/InfoField/InfoField";
18
18
  export { INPUT_TYPES, default as Input } from "./components/Input/Input";
19
19
  export { default as Line } from "./components/Line/Line";
20
- export { default as SectionItem, SectionItemProps, } from "./components/Section/SectionItem";
21
20
  export { ListTable, ListTableProps, ListTablePropsConfiguration, ListTablePropsConfigurationField, } from "./components/ListTable/ListTable";
22
21
  export { LoadingIndicator, LoadingIndicatorProps, } from "./components/LoadingIndicator/LoadingIndicator";
23
22
  export { default as Menu } from "./components/Menu/Menu";
24
23
  export { MultiSelect } from "./components/MultiSelect/MultiSelect";
25
24
  export { NavLayout, NavMenuLayoutProps } from "./components/NavMenu/NavLayout";
26
- export { NavMenu } from "./components/NavMenu/NavMenu";
25
+ export { NavMenu, NavMenuElement } from "./components/NavMenu/NavMenu";
27
26
  export { NotificationBanner, NotificationBannerColor, NotificationBannerLinkProps, } from "./components/NotificationBanner/NotificationBanner";
28
27
  export { default as Page } from "./components/Page/Page";
29
28
  export { default as CRUDPage } from "./components/Page/CRUDPage";
@@ -33,6 +32,8 @@ export { default as PreviewPhone } from "./components/PreviewPhone/PreviewPhone"
33
32
  export { default as Radio } from "./components/Radio/Radio";
34
33
  export { default as RadioGroup } from "./components/RadioGroup/RadioGroup";
35
34
  export { default as Section } from "./components/Section/Section";
35
+ export { default as SectionItemWithContent } from "./components/Section/SectionItemWithContent";
36
+ export { default as SectionItem, SectionItemProps, } from "./components/Section/SectionItem";
36
37
  export { SettingsMenuButton, SettingsMenuButtonProps, } from "./components/SettingsMenuButton/SettingsMenuButton";
37
38
  export { Spinner } from "./components/Spinner/Spinner";
38
39
  export { Steps } from "./components/Steps/Steps";
@@ -45,7 +46,6 @@ export { default as TextArea } from "./components/Textarea/Textarea";
45
46
  export { default as TextEditor } from "./components/TextEditor/TextEditor";
46
47
  export { default as TextEditorV2 } from "./components/TextEditorV2/TextEditorV2";
47
48
  export { TextLink, TextLinkProps } from "./components/TextLink/TextLink";
48
- export { default as SectionItemWithContent } from "./components/Section/SectionItemWithContent";
49
49
  export { Title, TitleStyle } from "./components/Title/Title";
50
50
  export { ViewItem, ViewItemProps } from "./components/ViewItem/ViewItem";
51
51
  export { default as Text } from "./components/Text/Text";
@@ -1140,10 +1140,6 @@ video {
1140
1140
  font-size: 0.875rem;
1141
1141
  }
1142
1142
 
1143
- .text-base {
1144
- font-size: 1rem;
1145
- }
1146
-
1147
1143
  .text-lg {
1148
1144
  font-size: 1.125rem;
1149
1145
  }
@@ -1783,10 +1779,6 @@ video {
1783
1779
  white-space: nowrap;
1784
1780
  }
1785
1781
 
1786
- .whitespace-pre-wrap {
1787
- white-space: pre-wrap;
1788
- }
1789
-
1790
1782
  .break-words {
1791
1783
  word-wrap: break-word;
1792
1784
  overflow-wrap: break-word;
@@ -1834,10 +1826,6 @@ video {
1834
1826
  width: 11.5rem;
1835
1827
  }
1836
1828
 
1837
- .w-56 {
1838
- width: 14rem;
1839
- }
1840
-
1841
1829
  .w-80 {
1842
1830
  width: 20rem;
1843
1831
  }
@@ -2108,4 +2096,3 @@ video {
2108
2096
  display: none;
2109
2097
  }
2110
2098
  }
2111
-