@akinon/ui-button 0.2.0 → 0.4.0
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/cjs/index.css +5 -0
- package/dist/{index.d.ts → cjs/index.d.ts} +1 -1
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/{index.js → cjs/index.js} +1 -1
- package/dist/esm/index.css +5 -0
- package/dist/esm/index.d.ts +34 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +21 -0
- package/package.json +17 -11
- package/dist/index.cjs +0 -2
- package/dist/index.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,cAAc,EACd,UAAU,IAAI,aAAa,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,KAAK,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,eAAe,EACb,MAAM,GACN,YAAY,GACZ,eAAe,GACf,QAAQ,GACR,WAAW,GACX,OAAO,GACP,UAAU,CACb,GAAG;IACF;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,iCAAkC,WAAW,sBAE/D,CAAC"}
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.Button = void 0;
|
|
15
|
-
require("./index.
|
|
15
|
+
require("./index.css");
|
|
16
16
|
const antd_1 = require("antd");
|
|
17
17
|
const React = require("react");
|
|
18
18
|
/**
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import type { BaseButtonProps } from 'antd/lib/button/button';
|
|
3
|
+
import type { ButtonHTMLType, ButtonType as AntButtonType } from 'antd/lib/button/buttonHelpers';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
type ButtonType = Exclude<AntButtonType, 'dashed'> | 'secondary';
|
|
6
|
+
/**
|
|
7
|
+
* The props of the Button component.
|
|
8
|
+
*/
|
|
9
|
+
export type ButtonProps = Omit<BaseButtonProps, 'type' | 'classNames' | 'rootClassName' | 'styles' | 'prefixCls' | 'shape' | 'htmlType'> & {
|
|
10
|
+
/**
|
|
11
|
+
* The type of the button. Note that this is different from the html type.
|
|
12
|
+
*/
|
|
13
|
+
type?: ButtonType;
|
|
14
|
+
/**
|
|
15
|
+
* The href of the button. If provided, the button will be rendered as an anchor tag.
|
|
16
|
+
*/
|
|
17
|
+
href?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The html type of the button. Note that this is different from the type.
|
|
20
|
+
*/
|
|
21
|
+
htmlType?: ButtonHTMLType;
|
|
22
|
+
/**
|
|
23
|
+
* onClick handler.
|
|
24
|
+
* @param event
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Button component.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Button: ({ children, ...buttonProps }: ButtonProps) => React.JSX.Element;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,cAAc,EACd,UAAU,IAAI,aAAa,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,KAAK,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,eAAe,EACb,MAAM,GACN,YAAY,GACZ,eAAe,GACf,QAAQ,GACR,WAAW,GACX,OAAO,GACP,UAAU,CACb,GAAG;IACF;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,iCAAkC,WAAW,sBAE/D,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import './index.css';
|
|
13
|
+
import { Button as AntButton } from 'antd';
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
/**
|
|
16
|
+
* Button component.
|
|
17
|
+
*/
|
|
18
|
+
export const Button = (_a) => {
|
|
19
|
+
var { children } = _a, buttonProps = __rest(_a, ["children"]);
|
|
20
|
+
return React.createElement(AntButton, Object.assign({}, buttonProps), children);
|
|
21
|
+
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/ui-button",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A basic button react component.",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"main": "dist/index.js",
|
|
8
|
-
"module": "dist/index.js",
|
|
7
|
+
"main": "dist/esm/index.js",
|
|
8
|
+
"module": "dist/esm/index.js",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
@@ -14,27 +14,33 @@
|
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"clean-package": "2.2.0",
|
|
17
|
+
"copyfiles": "^2.4.1",
|
|
18
|
+
"rimraf": "^5.0.5",
|
|
17
19
|
"typescript": "^5.2.2",
|
|
18
|
-
"@akinon/
|
|
19
|
-
"@akinon/typescript-config": "0.
|
|
20
|
-
"@akinon/
|
|
20
|
+
"@akinon/eslint-config": "0.1.0",
|
|
21
|
+
"@akinon/typescript-config": "0.1.0",
|
|
22
|
+
"@akinon/vite-config": "0.3.0"
|
|
21
23
|
},
|
|
22
24
|
"peerDependencies": {
|
|
23
25
|
"react": ">=18",
|
|
24
26
|
"react-dom": ">=18"
|
|
25
27
|
},
|
|
26
28
|
"clean-package": "../../../clean-package.config.json",
|
|
27
|
-
"types": "dist/index.d.ts",
|
|
29
|
+
"types": "dist/esm/index.d.ts",
|
|
28
30
|
"exports": {
|
|
29
31
|
".": {
|
|
30
|
-
"types": "./dist/index.d.ts",
|
|
31
|
-
"import": "./dist/index.js",
|
|
32
|
-
"require": "./dist/index.
|
|
32
|
+
"types": "./dist/esm/index.d.ts",
|
|
33
|
+
"import": "./dist/esm/index.js",
|
|
34
|
+
"require": "./dist/cjs/index.js"
|
|
33
35
|
},
|
|
34
36
|
"./package.json": "./package.json"
|
|
35
37
|
},
|
|
36
38
|
"scripts": {
|
|
37
|
-
"build": "
|
|
39
|
+
"build": "pnpm run build:esm && pnpm run build:commonjs && pnpm run copy:files",
|
|
40
|
+
"build:esm": "tsc --outDir dist/esm",
|
|
41
|
+
"build:commonjs": "tsc --module commonjs --outDir dist/cjs",
|
|
42
|
+
"copy:files": "copyfiles -u 1 src/**/*.css dist/esm && copyfiles -u 1 src/**/*.css dist/cjs",
|
|
43
|
+
"clean": "rimraf dist/",
|
|
38
44
|
"lint": "eslint *.ts*",
|
|
39
45
|
"test": "vitest run",
|
|
40
46
|
"test:ui": "vitest --ui",
|
package/dist/index.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".akinon-btn-secondary{color:var(--color-neutral-50);background-color:var(--color-green-500);box-shadow:0 2px #0591ff1a}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("antd");const r=({children:t,...e})=>n.jsx(o.Button,{...e,children:t});exports.Button=r;
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAGtB,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,cAAc,EACd,UAAU,IAAI,aAAa,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,KAAK,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,eAAe,EACb,MAAM,GACN,YAAY,GACZ,eAAe,GACf,QAAQ,GACR,WAAW,GACX,OAAO,GACP,UAAU,CACb,GAAG;IACF;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,iCAAkC,WAAW,sBAE/D,CAAC"}
|