@luscii-healthtech/web-ui 0.3.0 → 0.4.2

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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.0",
2
+ "version": "0.4.2",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "scripts": {
14
14
  "start": "tsdx watch",
15
- "build": "tsdx build",
15
+ "build": "tsdx build && yarn build-tailwind",
16
16
  "test": "tsdx test --passWithNoTests",
17
17
  "lint": "eslint src --ext .jsx --ext .js --ext .ts --ext .tsx --cache",
18
18
  "lint:fix": "eslint src --ext .jsx --ext .js --ext .ts --ext .tsx --fix",
@@ -20,7 +20,8 @@
20
20
  "analyze": "size-limit --why",
21
21
  "storybook": "start-storybook -p 6006",
22
22
  "build-storybook": "build-storybook",
23
- "chromatic": "chromatic --exit-zero-on-changes"
23
+ "chromatic": "chromatic --exit-zero-on-changes",
24
+ "build-tailwind": "NODE_ENV=production yarn run tailwindcss build -o ./dist/web-ui-tailwind.css --minify"
24
25
  },
25
26
  "peerDependencies": {
26
27
  "react": ">=16"
@@ -68,7 +69,7 @@
68
69
  "@types/react": "^18.0.14",
69
70
  "@types/react-dom": "^18.0.5",
70
71
  "@typescript-eslint/parser": "^5.29.0",
71
- "autoprefixer": "^10.4.7",
72
+ "autoprefixer": "^9.0.0",
72
73
  "babel-loader": "^8.2.5",
73
74
  "chromatic": "^6.6.3",
74
75
  "css-loader": "^0.28.11",
@@ -80,6 +81,7 @@
80
81
  "react": "^18.2.0",
81
82
  "react-dom": "^18.2.0",
82
83
  "react-is": "^18.2.0",
84
+ "rollup-plugin-postcss": "^4.0.2",
83
85
  "rollup-plugin-scss": "^3.0.0",
84
86
  "rollup-plugin-svg": "^2.0.0",
85
87
  "sass-loader": "^6.0.7",
@@ -115,5 +117,11 @@
115
117
  "react-modal": "^3.15.1",
116
118
  "react-quill": "^1.3.5",
117
119
  "react-select": "^5.3.2"
118
- }
120
+ },
121
+ "browserslist": [
122
+ "last 1 chrome version",
123
+ "last 1 firefox version",
124
+ "last 1 edge version",
125
+ "ie 11"
126
+ ]
119
127
  }
@@ -1,15 +1,15 @@
1
- import React from "react";
1
+ import React, { SyntheticEvent } from "react";
2
2
  import classNames from "classnames";
3
3
 
4
- import "./ListItem.scss";
4
+ import "./SectionItem.scss";
5
5
 
6
- export interface ListItemProps {
6
+ export interface SectionItemProps {
7
7
  className?: string;
8
- onClick?: any; // func
9
- children?: any;
8
+ onClick?: (event: SyntheticEvent) => void; // func
9
+ children?: React.ReactNode;
10
10
  }
11
11
 
12
- export const ListItem: React.FC<ListItemProps> = (props) => {
12
+ export const SectionItem: React.FC<SectionItemProps> = props => {
13
13
  const { children, className, onClick, ...rest } = props;
14
14
 
15
15
  const classes = classNames("cweb-list-item", className, {
@@ -23,4 +23,4 @@ export const ListItem: React.FC<ListItemProps> = (props) => {
23
23
  );
24
24
  };
25
25
 
26
- export default ListItem;
26
+ export default SectionItem;
@@ -3,24 +3,25 @@ import PropTypes from "prop-types";
3
3
  import classNames from "classnames";
4
4
 
5
5
  import LegacyText from "../Text/LegacyText";
6
- import "./TextListItem.scss";
7
- import ListItem from "../ListItem/ListItem";
8
6
 
9
- function TextListItem(props) {
7
+ import "./SectionItemWithContent.scss";
8
+ import SectionItem from "./SectionItem";
9
+
10
+ function SectionItemWithContent(props) {
10
11
  const { text, icon, className, iconClass, onClick, ...rest } = props;
11
12
 
12
- const mergedClasses = classNames("cweb-text-list-item", className);
13
- const iconClasses = classNames("cweb-text-list-item-icon", iconClass);
13
+ const mergedClasses = classNames("cweb-section-text-item", className);
14
+ const iconClasses = classNames("cweb-section-text-item-icon", iconClass);
14
15
 
15
16
  return (
16
- <ListItem className={mergedClasses} onClick={onClick} {...rest}>
17
+ <SectionItem className={mergedClasses} onClick={onClick} {...rest}>
17
18
  {icon && <img className={iconClasses} src={icon} alt="" />}
18
19
  <LegacyText text={text} />
19
- </ListItem>
20
+ </SectionItem>
20
21
  );
21
22
  }
22
23
 
23
- TextListItem.propTypes = {
24
+ SectionItemWithContent.propTypes = {
24
25
  text: PropTypes.string.isRequired,
25
26
  icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
26
27
  className: PropTypes.string,
@@ -28,4 +29,4 @@ TextListItem.propTypes = {
28
29
  onClick: PropTypes.func,
29
30
  };
30
31
 
31
- export default TextListItem;
32
+ export default SectionItemWithContent;
@@ -1,8 +1,8 @@
1
1
  @import "../../styles/colors";
2
2
  @import "../../styles/layout";
3
3
 
4
- .cweb-text-list-item {
5
- .cweb-text-list-item-icon {
4
+ .cweb-section-text-item {
5
+ .cweb-section-text-item-icon {
6
6
  width: 24px;
7
7
  height: 24px;
8
8
  margin-right: 16px;
@@ -3,7 +3,7 @@ import classNames from "classnames";
3
3
 
4
4
  import { Text, TextColor } from "../Text/Text";
5
5
 
6
- import { TagSize } from "./TagGroup";
6
+ import { TagSize } from "./Tag.utils";
7
7
 
8
8
  export enum TagColorTheme {
9
9
  Red = "red",
@@ -0,0 +1,4 @@
1
+ export enum TagSize {
2
+ "small" = "small",
3
+ "base" = "base",
4
+ }
@@ -2,11 +2,7 @@ import React from "react";
2
2
  import classNames from "classnames";
3
3
 
4
4
  import Tag, { TagProps } from "./Tag";
5
-
6
- export enum TagSize {
7
- "small" = "small",
8
- "base" = "base",
9
- }
5
+ import { TagSize } from "./Tag.utils";
10
6
 
11
7
  interface TagGroupProps {
12
8
  tags: TagProps[];
@@ -14,10 +10,18 @@ interface TagGroupProps {
14
10
  className?: string;
15
11
  }
16
12
 
17
- const TagGroup = ({ tags, tagSize = TagSize.base, className }: TagGroupProps): JSX.Element => (
13
+ const TagGroup = ({
14
+ tags,
15
+ tagSize = TagSize.base,
16
+ className,
17
+ }: TagGroupProps): JSX.Element => (
18
18
  <div className={classNames("flex flex-row flex-wrap", className)}>
19
- {tags.map((tag) => (
20
- <Tag size={tagSize} {...tag} className={classNames("mr-2 last:mr-0 mb-2")} />
19
+ {tags.map(tag => (
20
+ <Tag
21
+ size={tagSize}
22
+ {...tag}
23
+ className={classNames("mr-2 last:mr-0 mb-2")}
24
+ />
21
25
  ))}
22
26
  </div>
23
27
  );
package/src/index.tsx CHANGED
@@ -24,9 +24,9 @@ export { InfoField } from "./components/InfoField/InfoField";
24
24
  export { INPUT_TYPES, default as Input } from "./components/Input/Input";
25
25
  export { default as Line } from "./components/Line/Line";
26
26
  export {
27
- default as ListItem,
28
- ListItemProps,
29
- } from "./components/ListItem/ListItem";
27
+ default as SectionItem,
28
+ SectionItemProps,
29
+ } from "./components/Section/SectionItem";
30
30
  export {
31
31
  ListTable,
32
32
  ListTableProps,
@@ -75,7 +75,7 @@ export { default as TextArea } from "./components/Textarea/Textarea";
75
75
  export { default as TextEditor } from "./components/TextEditor/TextEditor";
76
76
  export { default as TextEditorV2 } from "./components/TextEditorV2/TextEditorV2";
77
77
  export { TextLink, TextLinkProps } from "./components/TextLink/TextLink";
78
- export { default as TextListItem } from "./components/TextListItem/TextListItem";
78
+ export { default as SectionItemWithContent } from "./components/Section/SectionItemWithContent";
79
79
  export { Title, TitleStyle } from "./components/Title/Title";
80
80
  export { ViewItem, ViewItemProps } from "./components/ViewItem/ViewItem";
81
81
 
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- import "./ListItem.scss";
3
- export interface ListItemProps {
4
- className?: string;
5
- onClick?: any;
6
- children?: any;
7
- }
8
- export declare const ListItem: React.FC<ListItemProps>;
9
- export default ListItem;