@apexcura/ui-components 0.0.1
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/.env.defaults +2 -0
- package/README.md +25 -0
- package/dist/index.d.mts +41 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +121 -0
- package/dist/index.mjs +82 -0
- package/jest.config.js +10 -0
- package/package.json +44 -0
package/.env.defaults
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Apex Cura React Component Library
|
|
2
|
+
|
|
3
|
+
The Apex Cura React Component Library provides many helpful components to quickly build your healthcare web app.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add as a dependency:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install @apexcura/ui-component
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Note the following peer dependencies:
|
|
14
|
+
|
|
15
|
+
- [antd](https://www.npmjs.com/package/antd)
|
|
16
|
+
- [react](https://www.npmjs.com/package/react)
|
|
17
|
+
- [react-dom](https://www.npmjs.com/package/react-dom)
|
|
18
|
+
|
|
19
|
+
## About Apex Cura
|
|
20
|
+
|
|
21
|
+
Apex Cura is a healthcare platform that helps you quickly develop high-quality compliant applications. Apex Cura includes a React component library, and developer app.
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
. Copyright © Apex Cura 2024
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React$1 from 'react';
|
|
2
|
+
|
|
3
|
+
type ElementType = {
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
addonBefore?: React.ReactNode;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
prefix?: React.ReactNode;
|
|
9
|
+
type?: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
status?: "error" | "warning";
|
|
12
|
+
styles?: React.CSSProperties;
|
|
13
|
+
classNames?: string;
|
|
14
|
+
variant?: "outlined" | "borderless" | "filled";
|
|
15
|
+
label?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
suffix?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
declare const InputElement: (props: ElementType) => React$1.JSX.Element;
|
|
21
|
+
|
|
22
|
+
interface InputData {
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
id?: string;
|
|
25
|
+
prefix?: React$1.ReactNode;
|
|
26
|
+
addonBefore?: React$1.ReactNode;
|
|
27
|
+
type?: string;
|
|
28
|
+
}
|
|
29
|
+
interface PasswordProps {
|
|
30
|
+
inputData: InputData;
|
|
31
|
+
}
|
|
32
|
+
declare const PasswordElement: React$1.FC<PasswordProps>;
|
|
33
|
+
|
|
34
|
+
interface SelectProps {
|
|
35
|
+
placeholder: string;
|
|
36
|
+
defaultValue: string;
|
|
37
|
+
id: string;
|
|
38
|
+
}
|
|
39
|
+
declare const SelectElement: React$1.FC<SelectProps>;
|
|
40
|
+
|
|
41
|
+
export { InputElement, PasswordElement, SelectElement };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React$1 from 'react';
|
|
2
|
+
|
|
3
|
+
type ElementType = {
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
addonBefore?: React.ReactNode;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
prefix?: React.ReactNode;
|
|
9
|
+
type?: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
status?: "error" | "warning";
|
|
12
|
+
styles?: React.CSSProperties;
|
|
13
|
+
classNames?: string;
|
|
14
|
+
variant?: "outlined" | "borderless" | "filled";
|
|
15
|
+
label?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
suffix?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
declare const InputElement: (props: ElementType) => React$1.JSX.Element;
|
|
21
|
+
|
|
22
|
+
interface InputData {
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
id?: string;
|
|
25
|
+
prefix?: React$1.ReactNode;
|
|
26
|
+
addonBefore?: React$1.ReactNode;
|
|
27
|
+
type?: string;
|
|
28
|
+
}
|
|
29
|
+
interface PasswordProps {
|
|
30
|
+
inputData: InputData;
|
|
31
|
+
}
|
|
32
|
+
declare const PasswordElement: React$1.FC<PasswordProps>;
|
|
33
|
+
|
|
34
|
+
interface SelectProps {
|
|
35
|
+
placeholder: string;
|
|
36
|
+
defaultValue: string;
|
|
37
|
+
id: string;
|
|
38
|
+
}
|
|
39
|
+
declare const SelectElement: React$1.FC<SelectProps>;
|
|
40
|
+
|
|
41
|
+
export { InputElement, PasswordElement, SelectElement };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
InputElement: () => InputElement,
|
|
34
|
+
PasswordElement: () => PasswordElement,
|
|
35
|
+
SelectElement: () => SelectElement
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(src_exports);
|
|
38
|
+
|
|
39
|
+
// src/Components/InputElement.tsx
|
|
40
|
+
var import_react = __toESM(require("react"));
|
|
41
|
+
var import_antd = require("antd");
|
|
42
|
+
var onHandleChange = ($event) => {
|
|
43
|
+
console.log($event);
|
|
44
|
+
};
|
|
45
|
+
var InputElement = (props) => {
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ import_react.default.createElement(
|
|
47
|
+
import_antd.Input,
|
|
48
|
+
{
|
|
49
|
+
placeholder: props.placeholder,
|
|
50
|
+
addonBefore: props.addonBefore,
|
|
51
|
+
allowClear: true,
|
|
52
|
+
defaultValue: props.defaultValue,
|
|
53
|
+
disabled: props.disabled,
|
|
54
|
+
id: props.name,
|
|
55
|
+
prefix: props.prefix,
|
|
56
|
+
type: props.type,
|
|
57
|
+
value: props.value,
|
|
58
|
+
status: props.status,
|
|
59
|
+
style: props.styles,
|
|
60
|
+
className: props.classNames,
|
|
61
|
+
variant: props.variant,
|
|
62
|
+
onChange: onHandleChange,
|
|
63
|
+
name: props.name
|
|
64
|
+
}
|
|
65
|
+
));
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// src/Components/PasswordElement.tsx
|
|
69
|
+
var import_react2 = __toESM(require("react"));
|
|
70
|
+
var import_icons = require("@ant-design/icons");
|
|
71
|
+
var import_antd2 = require("antd");
|
|
72
|
+
var PasswordElement = ({ inputData }) => {
|
|
73
|
+
const [passwordVisible, setPasswordVisible] = (0, import_react2.useState)(false);
|
|
74
|
+
const handleVisibilityToggle = () => {
|
|
75
|
+
setPasswordVisible((prev) => !prev);
|
|
76
|
+
};
|
|
77
|
+
const renderVisibilityIcon = (visible) => visible ? /* @__PURE__ */ import_react2.default.createElement(import_icons.EyeTwoTone, null) : /* @__PURE__ */ import_react2.default.createElement(import_icons.EyeInvisibleOutlined, null);
|
|
78
|
+
const renderPasswordInput = () => /* @__PURE__ */ import_react2.default.createElement(
|
|
79
|
+
import_antd2.Input.Password,
|
|
80
|
+
{
|
|
81
|
+
placeholder: inputData.placeholder,
|
|
82
|
+
id: inputData.id,
|
|
83
|
+
prefix: inputData.prefix,
|
|
84
|
+
addonBefore: inputData.addonBefore,
|
|
85
|
+
type: inputData.type,
|
|
86
|
+
iconRender: renderVisibilityIcon,
|
|
87
|
+
visibilityToggle: { visible: passwordVisible, onVisibleChange: handleVisibilityToggle }
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_antd2.Space, { direction: "vertical" }, renderPasswordInput(), /* @__PURE__ */ import_react2.default.createElement(import_antd2.Space, { direction: "horizontal" }, renderPasswordInput(), /* @__PURE__ */ import_react2.default.createElement(import_antd2.Button, { style: { width: 80 }, onClick: handleVisibilityToggle }, passwordVisible ? "Hide" : "Show")));
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// src/Components/SelectElement.tsx
|
|
94
|
+
var import_react3 = __toESM(require("react"));
|
|
95
|
+
var import_antd3 = require("antd");
|
|
96
|
+
var options = [
|
|
97
|
+
{
|
|
98
|
+
value: "zhejiang",
|
|
99
|
+
label: "Zhejiang"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
value: "jiangsu",
|
|
103
|
+
label: "Jiangsu"
|
|
104
|
+
}
|
|
105
|
+
];
|
|
106
|
+
var SelectElement = (props) => /* @__PURE__ */ import_react3.default.createElement(
|
|
107
|
+
import_antd3.Select,
|
|
108
|
+
{
|
|
109
|
+
placeholder: props.placeholder,
|
|
110
|
+
allowClear: true,
|
|
111
|
+
defaultValue: props.defaultValue,
|
|
112
|
+
id: props.id,
|
|
113
|
+
options
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
117
|
+
0 && (module.exports = {
|
|
118
|
+
InputElement,
|
|
119
|
+
PasswordElement,
|
|
120
|
+
SelectElement
|
|
121
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// src/Components/InputElement.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Input as AntInput } from "antd";
|
|
4
|
+
var onHandleChange = ($event) => {
|
|
5
|
+
console.log($event);
|
|
6
|
+
};
|
|
7
|
+
var InputElement = (props) => {
|
|
8
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("label", { htmlFor: props.name }, props.label), /* @__PURE__ */ React.createElement(
|
|
9
|
+
AntInput,
|
|
10
|
+
{
|
|
11
|
+
placeholder: props.placeholder,
|
|
12
|
+
addonBefore: props.addonBefore,
|
|
13
|
+
allowClear: true,
|
|
14
|
+
defaultValue: props.defaultValue,
|
|
15
|
+
disabled: props.disabled,
|
|
16
|
+
id: props.name,
|
|
17
|
+
prefix: props.prefix,
|
|
18
|
+
type: props.type,
|
|
19
|
+
value: props.value,
|
|
20
|
+
status: props.status,
|
|
21
|
+
style: props.styles,
|
|
22
|
+
className: props.classNames,
|
|
23
|
+
variant: props.variant,
|
|
24
|
+
onChange: onHandleChange,
|
|
25
|
+
name: props.name
|
|
26
|
+
}
|
|
27
|
+
));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// src/Components/PasswordElement.tsx
|
|
31
|
+
import React2, { useState } from "react";
|
|
32
|
+
import { EyeInvisibleOutlined, EyeTwoTone } from "@ant-design/icons";
|
|
33
|
+
import { Button, Input, Space } from "antd";
|
|
34
|
+
var PasswordElement = ({ inputData }) => {
|
|
35
|
+
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
36
|
+
const handleVisibilityToggle = () => {
|
|
37
|
+
setPasswordVisible((prev) => !prev);
|
|
38
|
+
};
|
|
39
|
+
const renderVisibilityIcon = (visible) => visible ? /* @__PURE__ */ React2.createElement(EyeTwoTone, null) : /* @__PURE__ */ React2.createElement(EyeInvisibleOutlined, null);
|
|
40
|
+
const renderPasswordInput = () => /* @__PURE__ */ React2.createElement(
|
|
41
|
+
Input.Password,
|
|
42
|
+
{
|
|
43
|
+
placeholder: inputData.placeholder,
|
|
44
|
+
id: inputData.id,
|
|
45
|
+
prefix: inputData.prefix,
|
|
46
|
+
addonBefore: inputData.addonBefore,
|
|
47
|
+
type: inputData.type,
|
|
48
|
+
iconRender: renderVisibilityIcon,
|
|
49
|
+
visibilityToggle: { visible: passwordVisible, onVisibleChange: handleVisibilityToggle }
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
return /* @__PURE__ */ React2.createElement(Space, { direction: "vertical" }, renderPasswordInput(), /* @__PURE__ */ React2.createElement(Space, { direction: "horizontal" }, renderPasswordInput(), /* @__PURE__ */ React2.createElement(Button, { style: { width: 80 }, onClick: handleVisibilityToggle }, passwordVisible ? "Hide" : "Show")));
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// src/Components/SelectElement.tsx
|
|
56
|
+
import React3 from "react";
|
|
57
|
+
import { Select as AntSelect } from "antd";
|
|
58
|
+
var options = [
|
|
59
|
+
{
|
|
60
|
+
value: "zhejiang",
|
|
61
|
+
label: "Zhejiang"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
value: "jiangsu",
|
|
65
|
+
label: "Jiangsu"
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
var SelectElement = (props) => /* @__PURE__ */ React3.createElement(
|
|
69
|
+
AntSelect,
|
|
70
|
+
{
|
|
71
|
+
placeholder: props.placeholder,
|
|
72
|
+
allowClear: true,
|
|
73
|
+
defaultValue: props.defaultValue,
|
|
74
|
+
id: props.id,
|
|
75
|
+
options
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
export {
|
|
79
|
+
InputElement,
|
|
80
|
+
PasswordElement,
|
|
81
|
+
SelectElement
|
|
82
|
+
};
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
preset: 'ts-jest',
|
|
3
|
+
testEnvironment: 'jsdom',
|
|
4
|
+
testTimeout: 120000,
|
|
5
|
+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
6
|
+
moduleNameMapper: {
|
|
7
|
+
'\\.(css|less)$': 'identity-obj-proxy',
|
|
8
|
+
},
|
|
9
|
+
testMatch: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
|
|
10
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@apexcura/ui-components",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Apex cura React components library",
|
|
5
|
+
"keywords" : ["apec cura", "input", "ui", "react", "react-component"],
|
|
6
|
+
"homepage": "https://www.apexcura.com/",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/apexcura/ui-components/issues"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/apexcura/ui-components.git",
|
|
13
|
+
"directory": "packages/ui-components"
|
|
14
|
+
},
|
|
15
|
+
"author": "Apex Cura <hello@apexcura.com>",
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"main": "./dist/index.js",
|
|
18
|
+
"module": "./dist/index.mjs",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "jest",
|
|
22
|
+
"build": "tsup"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@testing-library/jest-dom": "^6.4.2",
|
|
26
|
+
"@testing-library/react": "^15.0.6",
|
|
27
|
+
"@types/react-global-configuration": "^1.3.3",
|
|
28
|
+
"@types/jest": "^29.5.12",
|
|
29
|
+
"@types/react": "^18.3.1",
|
|
30
|
+
"@types/react-dom": "18.2.18",
|
|
31
|
+
"@types/testing-library__react": "^10.2.0",
|
|
32
|
+
"antd": "^5.16.5",
|
|
33
|
+
"react": "^18.3.1",
|
|
34
|
+
"react-dom": "^18.3.1",
|
|
35
|
+
"tsup": "^8.0.2",
|
|
36
|
+
"jest": "^29.7.0",
|
|
37
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
38
|
+
"ts-jest": "^29.1.2",
|
|
39
|
+
"typescript": "^5.4.5"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=18.0.0"
|
|
43
|
+
}
|
|
44
|
+
}
|