foxit-component 0.0.1-alpha.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/README.md +45 -0
- package/es/Button/Button.d.ts +15 -0
- package/es/Button/Button.js +14 -0
- package/es/Button/button.css.js +6 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/node_modules/style-inject/dist/style-inject.es.js +28 -0
- package/es/node_modules/tslib/tslib.es6.js +46 -0
- package/package.json +97 -0
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Foxit Component
|
|
2
|
+
组件库
|
|
3
|
+
|
|
4
|
+
# 发包原则问题
|
|
5
|
+
在 npm 和软件版本管理中,版本号(Versioning)遵循 语义化版本控制(Semantic Versioning,简称 SemVer)的规则。版本号通常采用三位数的格式:MAJOR.MINOR.PATCH。
|
|
6
|
+
|
|
7
|
+
除了常见的正式版本,还有一些用于标识开发阶段的版本号标签,通常包括 alpha、beta 这些标签帮助开发者和使用者理解软件处于哪个发布阶段。
|
|
8
|
+
|
|
9
|
+
## Alpha 版本 (alpha)
|
|
10
|
+
描述:alpha 版本通常是开发中的早期版本,功能未完全实现,可能有大量的 bug 或不稳定的特性,适合开发者和早期测试者使用。
|
|
11
|
+
命名规则:通常以 MAJOR.MINOR.PATCH-alpha.N 的格式表示,其中 N 是从 1 开始的递增数字。
|
|
12
|
+
例子:
|
|
13
|
+
1.0.0-alpha.1
|
|
14
|
+
1.0.0-alpha.2
|
|
15
|
+
1.0.0-alpha.3
|
|
16
|
+
|
|
17
|
+
## Beta 版本 (beta)
|
|
18
|
+
描述:beta 版本通常是开发中的后期版本,功能已经基本完成,可能已经解决了一些 bug,但仍可能存在问题。它是给开发者、测试人员或对新功能感兴趣的用户使用的版本。
|
|
19
|
+
命名规则:MAJOR.MINOR.PATCH-beta.N,N 是递增的数字。
|
|
20
|
+
例子:
|
|
21
|
+
1.0.0-beta.1
|
|
22
|
+
1.0.0-beta.2
|
|
23
|
+
1.0.0-beta.3
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 正式版本 (stable, final)
|
|
27
|
+
描述:正式版本是经过充分测试,功能和 API 已经稳定,适合最终用户使用。它没有附加的标签,直接用 MAJOR.MINOR.PATCH 格式发布。
|
|
28
|
+
命名规则:MAJOR.MINOR.PATCH
|
|
29
|
+
例子:
|
|
30
|
+
1.0.0
|
|
31
|
+
2.0.0
|
|
32
|
+
1.1.0
|
|
33
|
+
|
|
34
|
+
## 发包示例
|
|
35
|
+
```jsx
|
|
36
|
+
alpha:
|
|
37
|
+
npm version 1.0.0-alpha.1
|
|
38
|
+
npm publish --tag alpha
|
|
39
|
+
beta:
|
|
40
|
+
npm version 1.0.0-beta.1
|
|
41
|
+
npm publish --tag beta
|
|
42
|
+
正式:
|
|
43
|
+
npm version 1.0.0
|
|
44
|
+
npm publish
|
|
45
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./button.css";
|
|
2
|
+
export interface ButtonProps {
|
|
3
|
+
/** Is this the principal call to action on the page? */
|
|
4
|
+
primary?: boolean;
|
|
5
|
+
/** What background color to use */
|
|
6
|
+
backgroundColor?: string;
|
|
7
|
+
/** How large should the button be? */
|
|
8
|
+
size?: "small" | "medium" | "large";
|
|
9
|
+
/** Button contents */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Optional click handler */
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
}
|
|
14
|
+
/** Primary UI component for user interaction */
|
|
15
|
+
export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __rest, __assign } from '../node_modules/tslib/tslib.es6.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import './button.css.js';
|
|
4
|
+
|
|
5
|
+
/** Primary UI component for user interaction */
|
|
6
|
+
var Button = function (_a) {
|
|
7
|
+
var _b = _a.primary, primary = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? "medium" : _c, backgroundColor = _a.backgroundColor, label = _a.label, props = __rest(_a, ["primary", "size", "backgroundColor", "label"]);
|
|
8
|
+
var mode = primary
|
|
9
|
+
? "storybook-button--primary"
|
|
10
|
+
: "storybook-button--secondary";
|
|
11
|
+
return (jsx("button", __assign({ type: "button", className: ["storybook-button", "storybook-button--".concat(size), mode].join(" "), style: { backgroundColor: backgroundColor } }, props, { children: label })));
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { Button };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import styleInject from '../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".storybook-button {\n display: inline-block;\n cursor: pointer;\n border: 0;\n border-radius: 3em;\n font-weight: 700;\n line-height: 1;\n font-family: \"Nunito Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n}\n.storybook-button--primary {\n background-color: #555ab9;\n color: white;\n}\n.storybook-button--secondary {\n box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;\n background-color: transparent;\n color: #333;\n}\n.storybook-button--small {\n padding: 10px 16px;\n font-size: 12px;\n}\n.storybook-button--medium {\n padding: 11px 20px;\n font-size: 14px;\n}\n.storybook-button--large {\n padding: 12px 24px;\n font-size: 16px;\n}\n";
|
|
4
|
+
styleInject(css_248z);
|
|
5
|
+
|
|
6
|
+
export { css_248z as default };
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from './Button/Button';
|
package/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from './Button/Button.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function styleInject(css, ref) {
|
|
2
|
+
if ( ref === void 0 ) ref = {};
|
|
3
|
+
var insertAt = ref.insertAt;
|
|
4
|
+
|
|
5
|
+
if (typeof document === 'undefined') { return; }
|
|
6
|
+
|
|
7
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
8
|
+
var style = document.createElement('style');
|
|
9
|
+
style.type = 'text/css';
|
|
10
|
+
|
|
11
|
+
if (insertAt === 'top') {
|
|
12
|
+
if (head.firstChild) {
|
|
13
|
+
head.insertBefore(style, head.firstChild);
|
|
14
|
+
} else {
|
|
15
|
+
head.appendChild(style);
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
head.appendChild(style);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (style.styleSheet) {
|
|
22
|
+
style.styleSheet.cssText = css;
|
|
23
|
+
} else {
|
|
24
|
+
style.appendChild(document.createTextNode(css));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { styleInject as default };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation.
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var __assign = function() {
|
|
19
|
+
__assign = Object.assign || function __assign(t) {
|
|
20
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
21
|
+
s = arguments[i];
|
|
22
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function __rest(s, e) {
|
|
30
|
+
var t = {};
|
|
31
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
32
|
+
t[p] = s[p];
|
|
33
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
34
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
35
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
36
|
+
t[p[i]] = s[p[i]];
|
|
37
|
+
}
|
|
38
|
+
return t;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
42
|
+
var e = new Error(message);
|
|
43
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { __assign, __rest };
|
package/package.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "foxit-component",
|
|
3
|
+
"version": "0.0.1-alpha.1",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "linye",
|
|
6
|
+
"email": "869675630@qq.com"
|
|
7
|
+
},
|
|
8
|
+
"description": "Foxit React Component",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"foxit",
|
|
11
|
+
"component",
|
|
12
|
+
"css",
|
|
13
|
+
"react"
|
|
14
|
+
],
|
|
15
|
+
"module": "es/index.js",
|
|
16
|
+
"types": "es/index.d.ts",
|
|
17
|
+
"files": [
|
|
18
|
+
"es"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"storybook": "storybook dev -p 6006",
|
|
23
|
+
"build-storybook": "storybook build",
|
|
24
|
+
"prettier": "prettier src --write",
|
|
25
|
+
"eslint": "eslint src --fix",
|
|
26
|
+
"chromatic": "npx chromatic --project-token=chpt_3e4d6e9742666b1",
|
|
27
|
+
"build-component": "rimraf es && rollup -c"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@testing-library/dom": "^10.4.0",
|
|
31
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
32
|
+
"@testing-library/react": "^16.2.0",
|
|
33
|
+
"@testing-library/user-event": "^13.5.0",
|
|
34
|
+
"@types/jest": "^27.5.2",
|
|
35
|
+
"@types/node": "^16.18.126",
|
|
36
|
+
"@types/react": "^19.0.10",
|
|
37
|
+
"@types/react-dom": "^19.0.4",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^8.24.1",
|
|
39
|
+
"@typescript-eslint/parser": "^8.24.1",
|
|
40
|
+
"classnames": "^2.5.1",
|
|
41
|
+
"eslint": "^8.57.1",
|
|
42
|
+
"eslint-plugin-react": "^7.37.4",
|
|
43
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
44
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
45
|
+
"react": "^19.0.0",
|
|
46
|
+
"react-dom": "^19.0.0",
|
|
47
|
+
"react-scripts": "5.0.1",
|
|
48
|
+
"react-select": "^5.10.0",
|
|
49
|
+
"typescript": "^4.9.5",
|
|
50
|
+
"web-vitals": "^2.1.4",
|
|
51
|
+
"react-transition-group": "^4.4.5"
|
|
52
|
+
},
|
|
53
|
+
"eslintConfig": {
|
|
54
|
+
"extends": [
|
|
55
|
+
"react-app",
|
|
56
|
+
"react-app/jest",
|
|
57
|
+
"plugin:storybook/recommended"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"browserslist": {
|
|
61
|
+
"production": [
|
|
62
|
+
">0.2%",
|
|
63
|
+
"not dead",
|
|
64
|
+
"not op_mini all"
|
|
65
|
+
],
|
|
66
|
+
"development": [
|
|
67
|
+
"last 1 chrome version",
|
|
68
|
+
"last 1 firefox version",
|
|
69
|
+
"last 1 safari version"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@chromatic-com/storybook": "^3.2.4",
|
|
74
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
75
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
76
|
+
"@rollup/plugin-strip": "^3.0.4",
|
|
77
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
78
|
+
"@storybook/addon-essentials": "^8.5.8",
|
|
79
|
+
"@storybook/addon-interactions": "^8.5.8",
|
|
80
|
+
"@storybook/addon-onboarding": "^8.5.8",
|
|
81
|
+
"@storybook/blocks": "^8.5.8",
|
|
82
|
+
"@storybook/preset-create-react-app": "^8.5.8",
|
|
83
|
+
"@storybook/react": "^8.5.8",
|
|
84
|
+
"@storybook/react-webpack5": "^8.5.8",
|
|
85
|
+
"@storybook/test": "^8.5.8",
|
|
86
|
+
"autoprefixer": "^10.4.20",
|
|
87
|
+
"chromatic": "^11.25.2",
|
|
88
|
+
"eslint-plugin-storybook": "^0.11.3",
|
|
89
|
+
"prettier": "^3.5.1",
|
|
90
|
+
"prop-types": "^15.8.1",
|
|
91
|
+
"rollup": "^4.34.8",
|
|
92
|
+
"rollup-plugin-node-externals": "^8.0.0",
|
|
93
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
94
|
+
"storybook": "^8.5.8",
|
|
95
|
+
"webpack": "^5.98.0"
|
|
96
|
+
}
|
|
97
|
+
}
|