@amaury053/authkit 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 +66 -0
- package/dist/Button.d.ts +5 -0
- package/dist/authkit.js +21 -0
- package/dist/authkit.js.map +1 -0
- package/dist/authkit.umd.cjs +2 -0
- package/dist/authkit.umd.cjs.map +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# AuthKit
|
|
2
|
+
|
|
3
|
+
React component library built with Vite and TypeScript.
|
|
4
|
+
|
|
5
|
+
## Development
|
|
6
|
+
|
|
7
|
+
Run the dev server to work on the library with **hot reload**:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn dev
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This starts a local server (default: http://localhost:5173) where you can use and preview your components. Edit files under `src/` and see changes instantly.
|
|
14
|
+
|
|
15
|
+
- Library code: `src/index.ts`, `src/Button.tsx`, etc.
|
|
16
|
+
- Dev app (playground): `src/dev/` — not included in the published package.
|
|
17
|
+
|
|
18
|
+
## Build
|
|
19
|
+
|
|
20
|
+
Type-check and build the library for distribution:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
yarn build
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Output is written to `dist/` (ESM, UMD, and TypeScript declarations).
|
|
27
|
+
|
|
28
|
+
## Publish to npm
|
|
29
|
+
|
|
30
|
+
Build and publish in one step:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
yarn publish:package
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This runs `yarn build` then `npm publish`. Ensure you’re logged in (`npm login`) and have bumped the version in `package.json` if needed.
|
|
37
|
+
|
|
38
|
+
You can also rely on the lifecycle script:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm publish
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`prepublishOnly` runs `yarn build` automatically before publishing, so the package is always built from the current source.
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
After publishing, consumers can install and use the library:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm install @amaury053/authkit
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { Button } from "@amaury053/authkit";
|
|
56
|
+
|
|
57
|
+
<Button variant="primary">Click me</Button>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Scripts
|
|
61
|
+
|
|
62
|
+
| Script | Description |
|
|
63
|
+
|---------------------|--------------------------------------------------|
|
|
64
|
+
| `yarn dev` | Start dev server with HMR for the library |
|
|
65
|
+
| `yarn build` | Type-check and build the library to `dist/` |
|
|
66
|
+
| `yarn publish:package` | Build and publish to npm |
|
package/dist/Button.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
variant?: "primary" | "secondary";
|
|
4
|
+
}
|
|
5
|
+
export declare function Button({ variant, className, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/authkit.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
function a({
|
|
3
|
+
variant: t = "primary",
|
|
4
|
+
className: n = "",
|
|
5
|
+
children: r,
|
|
6
|
+
...o
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ u(
|
|
9
|
+
"button",
|
|
10
|
+
{
|
|
11
|
+
type: "button",
|
|
12
|
+
className: `authkit-btn authkit-btn--${t} ${n}`.trim(),
|
|
13
|
+
...o,
|
|
14
|
+
children: r
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
a as Button
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=authkit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authkit.js","sources":["../src/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from \"react\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: \"primary\" | \"secondary\";\n}\n\nexport function Button({\n variant = \"primary\",\n className = \"\",\n children,\n ...props\n}: ButtonProps) {\n return (\n <button\n type=\"button\"\n className={`authkit-btn authkit-btn--${variant} ${className}`.trim()}\n {...props}\n >\n {children}\n </button>\n );\n}\n"],"names":["Button","variant","className","children","props","jsx"],"mappings":";AAMO,SAASA,EAAO;AAAA,EACrB,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,GAAGC;AACL,GAAgB;AACd,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAW,4BAA4BJ,CAAO,IAAIC,CAAS,GAAG,KAAA;AAAA,MAC7D,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.AuthKit={},t.jsxRuntime))})(this,(function(t,e){"use strict";function n({variant:i="primary",className:u="",children:o,...r}){return e.jsx("button",{type:"button",className:`authkit-btn authkit-btn--${i} ${u}`.trim(),...r,children:o})}t.Button=n,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
|
2
|
+
//# sourceMappingURL=authkit.umd.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authkit.umd.cjs","sources":["../src/Button.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from \"react\";\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: \"primary\" | \"secondary\";\n}\n\nexport function Button({\n variant = \"primary\",\n className = \"\",\n children,\n ...props\n}: ButtonProps) {\n return (\n <button\n type=\"button\"\n className={`authkit-btn authkit-btn--${variant} ${className}`.trim()}\n {...props}\n >\n {children}\n </button>\n );\n}\n"],"names":["Button","variant","className","children","props","jsx"],"mappings":"gSAMO,SAASA,EAAO,CACrB,QAAAC,EAAU,UACV,UAAAC,EAAY,GACZ,SAAAC,EACA,GAAGC,CACL,EAAgB,CACd,OACEC,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAW,4BAA4BJ,CAAO,IAAIC,CAAS,GAAG,KAAA,EAC7D,GAAGE,EAEH,SAAAD,CAAA,CAAA,CAGP"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from './Button';
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@amaury053/authkit",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "React component library built with Vite and TypeScript",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/authkit.umd.cjs",
|
|
7
|
+
"module": "./dist/authkit.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/authkit.js",
|
|
13
|
+
"require": "./dist/authkit.umd.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public",
|
|
21
|
+
"tag": "latest"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "vite",
|
|
25
|
+
"build": "tsc && vite build",
|
|
26
|
+
"prepublishOnly": "yarn build",
|
|
27
|
+
"publish:package": "yarn build && npm publish"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
31
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/react": "^18.3.12",
|
|
35
|
+
"@types/react-dom": "^18.3.1",
|
|
36
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
37
|
+
"react": "^18.3.1",
|
|
38
|
+
"react-dom": "^18.3.1",
|
|
39
|
+
"typescript": "~5.6.3",
|
|
40
|
+
"vite": "^6.0.1",
|
|
41
|
+
"vite-plugin-dts": "^4.3.0"
|
|
42
|
+
},
|
|
43
|
+
"packageManager": "yarn@4.9.1"
|
|
44
|
+
}
|