@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/dist/components/Section/SectionItem.d.ts +9 -0
- package/dist/components/{TextListItem/TextListItem.d.ts → Section/SectionItemWithContent.d.ts} +3 -3
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/components/Tag/Tag.utils.d.ts +4 -0
- package/dist/components/Tag/TagGroup.d.ts +2 -5
- package/dist/index.d.ts +2 -2
- package/dist/web-ui-tailwind.css +2111 -0
- package/dist/web-ui.cjs.development.css +70 -70
- package/dist/web-ui.cjs.development.js +29 -29
- package/dist/web-ui.cjs.development.js.map +1 -1
- package/dist/web-ui.cjs.production.min.css +70 -70
- package/dist/web-ui.cjs.production.min.js +1 -1
- package/dist/web-ui.cjs.production.min.js.map +1 -1
- package/dist/web-ui.esm.css +70 -70
- package/dist/web-ui.esm.js +28 -28
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +13 -5
- package/src/components/{ListItem/ListItem.scss → Section/SectionItem.scss} +0 -0
- package/src/components/{ListItem/ListItem.tsx → Section/SectionItem.tsx} +7 -7
- package/src/components/{TextListItem/TextListItem.js → Section/SectionItemWithContent.js} +10 -9
- package/src/components/{TextListItem/TextListItem.scss → Section/SectionItemWithContent.scss} +2 -2
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/Tag/Tag.utils.ts +4 -0
- package/src/components/Tag/TagGroup.tsx +12 -8
- package/src/index.tsx +4 -4
- package/dist/components/ListItem/ListItem.d.ts +0 -9
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "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": "^
|
|
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
|
}
|
|
File without changes
|
|
@@ -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 "./
|
|
4
|
+
import "./SectionItem.scss";
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface SectionItemProps {
|
|
7
7
|
className?: string;
|
|
8
|
-
onClick?:
|
|
9
|
-
children?:
|
|
8
|
+
onClick?: (event: SyntheticEvent) => void; // func
|
|
9
|
+
children?: React.ReactNode;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export const
|
|
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
|
|
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
|
-
|
|
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-
|
|
13
|
-
const iconClasses = classNames("cweb-text-
|
|
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
|
-
<
|
|
17
|
+
<SectionItem className={mergedClasses} onClick={onClick} {...rest}>
|
|
17
18
|
{icon && <img className={iconClasses} src={icon} alt="" />}
|
|
18
19
|
<LegacyText text={text} />
|
|
19
|
-
</
|
|
20
|
+
</SectionItem>
|
|
20
21
|
);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
|
|
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
|
|
32
|
+
export default SectionItemWithContent;
|
|
@@ -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 = ({
|
|
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(
|
|
20
|
-
<Tag
|
|
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
|
|
28
|
-
|
|
29
|
-
} from "./components/
|
|
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
|
|
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
|
|