foxit-component 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/README.md +2 -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 +83 -0
package/README.md
ADDED
|
@@ -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,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "foxit-component",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"module": "es/index.js",
|
|
5
|
+
"types": "es/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"es"
|
|
8
|
+
],
|
|
9
|
+
"type": "module",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"storybook": "storybook dev -p 6006",
|
|
12
|
+
"build-storybook": "storybook build",
|
|
13
|
+
"prettier": "prettier src --write",
|
|
14
|
+
"eslint": "eslint src --fix",
|
|
15
|
+
"chromatic": "npx chromatic --project-token=chpt_3e4d6e9742666b1",
|
|
16
|
+
"build-component": "rimraf es && rollup -c"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@testing-library/dom": "^10.4.0",
|
|
20
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
21
|
+
"@testing-library/react": "^16.2.0",
|
|
22
|
+
"@testing-library/user-event": "^13.5.0",
|
|
23
|
+
"@types/jest": "^27.5.2",
|
|
24
|
+
"@types/node": "^16.18.126",
|
|
25
|
+
"@types/react": "^19.0.10",
|
|
26
|
+
"@types/react-dom": "^19.0.4",
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^8.24.1",
|
|
28
|
+
"@typescript-eslint/parser": "^8.24.1",
|
|
29
|
+
"eslint": "^8.57.1",
|
|
30
|
+
"eslint-plugin-react": "^7.37.4",
|
|
31
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
32
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
33
|
+
"react": "^19.0.0",
|
|
34
|
+
"react-dom": "^19.0.0",
|
|
35
|
+
"react-scripts": "5.0.1",
|
|
36
|
+
"typescript": "^4.9.5",
|
|
37
|
+
"web-vitals": "^2.1.4"
|
|
38
|
+
},
|
|
39
|
+
"eslintConfig": {
|
|
40
|
+
"extends": [
|
|
41
|
+
"react-app",
|
|
42
|
+
"react-app/jest",
|
|
43
|
+
"plugin:storybook/recommended"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"browserslist": {
|
|
47
|
+
"production": [
|
|
48
|
+
">0.2%",
|
|
49
|
+
"not dead",
|
|
50
|
+
"not op_mini all"
|
|
51
|
+
],
|
|
52
|
+
"development": [
|
|
53
|
+
"last 1 chrome version",
|
|
54
|
+
"last 1 firefox version",
|
|
55
|
+
"last 1 safari version"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@chromatic-com/storybook": "^3.2.4",
|
|
60
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
61
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
62
|
+
"@rollup/plugin-strip": "^3.0.4",
|
|
63
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
64
|
+
"@storybook/addon-essentials": "^8.5.8",
|
|
65
|
+
"@storybook/addon-interactions": "^8.5.8",
|
|
66
|
+
"@storybook/addon-onboarding": "^8.5.8",
|
|
67
|
+
"@storybook/blocks": "^8.5.8",
|
|
68
|
+
"@storybook/preset-create-react-app": "^8.5.8",
|
|
69
|
+
"@storybook/react": "^8.5.8",
|
|
70
|
+
"@storybook/react-webpack5": "^8.5.8",
|
|
71
|
+
"@storybook/test": "^8.5.8",
|
|
72
|
+
"autoprefixer": "^10.4.20",
|
|
73
|
+
"chromatic": "^11.25.2",
|
|
74
|
+
"eslint-plugin-storybook": "^0.11.3",
|
|
75
|
+
"prettier": "^3.5.1",
|
|
76
|
+
"prop-types": "^15.8.1",
|
|
77
|
+
"rollup-plugin-node-externals": "^8.0.0",
|
|
78
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
79
|
+
"storybook": "^8.5.8",
|
|
80
|
+
"webpack": "^5.98.0",
|
|
81
|
+
"rollup": "^4.34.8"
|
|
82
|
+
}
|
|
83
|
+
}
|