@amaury053/authkit 0.0.2 → 0.0.3
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/Button.d.ts +8 -4
- package/dist/authkit.js +19 -16
- package/dist/authkit.js.map +1 -1
- package/dist/authkit.umd.cjs +1 -1
- package/dist/authkit.umd.cjs.map +1 -1
- package/package.json +7 -1
package/dist/Button.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ButtonProps as HeroUIButtonProps } from '@heroui/react';
|
|
2
|
+
type HeroUIVariant = NonNullable<HeroUIButtonProps["variant"]>;
|
|
3
|
+
type SimpleVariant = "primary" | "secondary";
|
|
4
|
+
export interface ButtonProps extends Omit<HeroUIButtonProps, "variant"> {
|
|
5
|
+
/** "primary" | "secondary" map to color + solid; otherwise use HeroUI variant. */
|
|
6
|
+
variant?: SimpleVariant | HeroUIVariant;
|
|
4
7
|
}
|
|
5
|
-
export declare function Button({ variant,
|
|
8
|
+
export declare function Button({ variant, color, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
package/dist/authkit.js
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Button as a } from "@heroui/react";
|
|
3
|
+
const c = {
|
|
4
|
+
primary: "primary",
|
|
5
|
+
secondary: "secondary"
|
|
6
|
+
};
|
|
7
|
+
function r(o) {
|
|
8
|
+
return o === "primary" || o === "secondary";
|
|
9
|
+
}
|
|
10
|
+
function l({
|
|
11
|
+
variant: o = "primary",
|
|
12
|
+
color: t,
|
|
6
13
|
...n
|
|
7
14
|
}) {
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
const i = t ?? (r(o) ? c[o] : void 0), s = r(o) ? "solid" : o ?? "solid";
|
|
16
|
+
return /* @__PURE__ */ e(
|
|
17
|
+
a,
|
|
10
18
|
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
backgroundColor: t === "primary" ? "#0d6efd" : "#6c757d",
|
|
15
|
-
color: "white"
|
|
16
|
-
},
|
|
17
|
-
...n,
|
|
18
|
-
children: r
|
|
19
|
+
color: i,
|
|
20
|
+
variant: s,
|
|
21
|
+
...n
|
|
19
22
|
}
|
|
20
23
|
);
|
|
21
24
|
}
|
|
22
25
|
export {
|
|
23
|
-
|
|
26
|
+
l as Button
|
|
24
27
|
};
|
|
25
28
|
//# sourceMappingURL=authkit.js.map
|
package/dist/authkit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authkit.js","sources":["../src/Button.tsx"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"authkit.js","sources":["../src/Button.tsx"],"sourcesContent":["import { Button as HeroUIButton } from \"@heroui/react\";\nimport type { ButtonProps as HeroUIButtonProps } from \"@heroui/react\";\n\ntype HeroUIVariant = NonNullable<HeroUIButtonProps[\"variant\"]>;\ntype SimpleVariant = \"primary\" | \"secondary\";\n\nexport interface ButtonProps extends Omit<HeroUIButtonProps, \"variant\"> {\n /** \"primary\" | \"secondary\" map to color + solid; otherwise use HeroUI variant. */\n variant?: SimpleVariant | HeroUIVariant;\n}\n\nconst variantToColor: Record<SimpleVariant, HeroUIButtonProps[\"color\"]> = {\n primary: \"primary\",\n secondary: \"secondary\",\n};\n\nfunction isSimpleVariant(v: ButtonProps[\"variant\"]): v is SimpleVariant {\n return v === \"primary\" || v === \"secondary\";\n}\n\nexport function Button({\n variant = \"primary\",\n color,\n ...props\n}: ButtonProps) {\n const resolvedColor = color ?? (isSimpleVariant(variant) ? variantToColor[variant] : undefined);\n const resolvedVariant: HeroUIVariant = isSimpleVariant(variant) ? \"solid\" : (variant ?? \"solid\");\n return (\n <HeroUIButton\n color={resolvedColor}\n variant={resolvedVariant}\n {...props}\n />\n );\n}\n"],"names":["variantToColor","isSimpleVariant","v","Button","variant","color","props","resolvedColor","resolvedVariant","jsx","HeroUIButton"],"mappings":";;AAWA,MAAMA,IAAoE;AAAA,EACxE,SAAS;AAAA,EACT,WAAW;AACb;AAEA,SAASC,EAAgBC,GAA+C;AACtE,SAAOA,MAAM,aAAaA,MAAM;AAClC;AAEO,SAASC,EAAO;AAAA,EACrB,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,GAAGC;AACL,GAAgB;AACd,QAAMC,IAAgBF,MAAUJ,EAAgBG,CAAO,IAAIJ,EAAeI,CAAO,IAAI,SAC/EI,IAAiCP,EAAgBG,CAAO,IAAI,UAAWA,KAAW;AACxF,SACE,gBAAAK;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,OAAOH;AAAA,MACP,SAASC;AAAA,MACR,GAAGF;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
package/dist/authkit.umd.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(t
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime"),require("@heroui/react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@heroui/react"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.AuthKit={},e.jsxRuntime,e.HeroUI))})(this,(function(e,t,i){"use strict";const n={primary:"primary",secondary:"secondary"};function o(r){return r==="primary"||r==="secondary"}function u({variant:r="primary",color:s,...d}){const c=s??(o(r)?n[r]:void 0),f=o(r)?"solid":r??"solid";return t.jsx(i.Button,{color:c,variant:f,...d})}e.Button=u,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
|
2
2
|
//# sourceMappingURL=authkit.umd.cjs.map
|
package/dist/authkit.umd.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authkit.umd.cjs","sources":["../src/Button.tsx"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"authkit.umd.cjs","sources":["../src/Button.tsx"],"sourcesContent":["import { Button as HeroUIButton } from \"@heroui/react\";\nimport type { ButtonProps as HeroUIButtonProps } from \"@heroui/react\";\n\ntype HeroUIVariant = NonNullable<HeroUIButtonProps[\"variant\"]>;\ntype SimpleVariant = \"primary\" | \"secondary\";\n\nexport interface ButtonProps extends Omit<HeroUIButtonProps, \"variant\"> {\n /** \"primary\" | \"secondary\" map to color + solid; otherwise use HeroUI variant. */\n variant?: SimpleVariant | HeroUIVariant;\n}\n\nconst variantToColor: Record<SimpleVariant, HeroUIButtonProps[\"color\"]> = {\n primary: \"primary\",\n secondary: \"secondary\",\n};\n\nfunction isSimpleVariant(v: ButtonProps[\"variant\"]): v is SimpleVariant {\n return v === \"primary\" || v === \"secondary\";\n}\n\nexport function Button({\n variant = \"primary\",\n color,\n ...props\n}: ButtonProps) {\n const resolvedColor = color ?? (isSimpleVariant(variant) ? variantToColor[variant] : undefined);\n const resolvedVariant: HeroUIVariant = isSimpleVariant(variant) ? \"solid\" : (variant ?? \"solid\");\n return (\n <HeroUIButton\n color={resolvedColor}\n variant={resolvedVariant}\n {...props}\n />\n );\n}\n"],"names":["variantToColor","isSimpleVariant","v","Button","variant","color","props","resolvedColor","resolvedVariant","jsx","HeroUIButton"],"mappings":"oVAWA,MAAMA,EAAoE,CACxE,QAAS,UACT,UAAW,WACb,EAEA,SAASC,EAAgBC,EAA+C,CACtE,OAAOA,IAAM,WAAaA,IAAM,WAClC,CAEO,SAASC,EAAO,CACrB,QAAAC,EAAU,UACV,MAAAC,EACA,GAAGC,CACL,EAAgB,CACd,MAAMC,EAAgBF,IAAUJ,EAAgBG,CAAO,EAAIJ,EAAeI,CAAO,EAAI,QAC/EI,EAAiCP,EAAgBG,CAAO,EAAI,QAAWA,GAAW,QACxF,OACEK,EAAAA,IAACC,EAAAA,OAAA,CACC,MAAOH,EACP,QAASC,EACR,GAAGF,CAAA,CAAA,CAGV"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amaury053/authkit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "React component library built with Vite and TypeScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/authkit.umd.cjs",
|
|
@@ -27,15 +27,21 @@
|
|
|
27
27
|
"publish:package": "yarn build && npm publish"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
+
"@heroui/react": "^2.0.0",
|
|
31
|
+
"framer-motion": "^11.0.0",
|
|
30
32
|
"react": "^18.0.0 || ^19.0.0",
|
|
31
33
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
36
|
+
"@heroui/react": "^2.8.8",
|
|
37
|
+
"@tailwindcss/vite": "^4.0.0",
|
|
34
38
|
"@types/react": "^18.3.12",
|
|
35
39
|
"@types/react-dom": "^18.3.1",
|
|
36
40
|
"@vitejs/plugin-react": "^4.3.4",
|
|
41
|
+
"framer-motion": "^11.11.0",
|
|
37
42
|
"react": "^18.3.1",
|
|
38
43
|
"react-dom": "^18.3.1",
|
|
44
|
+
"tailwindcss": "^4.0.0",
|
|
39
45
|
"typescript": "~5.6.3",
|
|
40
46
|
"vite": "^6.0.1",
|
|
41
47
|
"vite-plugin-dts": "^4.3.0"
|