@amaury053/authkit 0.0.1 → 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 CHANGED
@@ -1,5 +1,9 @@
1
- import { ButtonHTMLAttributes } from 'react';
2
- export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
- variant?: "primary" | "secondary";
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, className, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function Button({ variant, color, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
package/dist/authkit.js CHANGED
@@ -1,21 +1,28 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- function a({
3
- variant: t = "primary",
4
- className: n = "",
5
- children: r,
6
- ...o
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,
13
+ ...n
7
14
  }) {
8
- return /* @__PURE__ */ u(
9
- "button",
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
- type: "button",
12
- className: `authkit-btn authkit-btn--${t} ${n}`.trim(),
13
- ...o,
14
- children: r
19
+ color: i,
20
+ variant: s,
21
+ ...n
15
22
  }
16
23
  );
17
24
  }
18
25
  export {
19
- a as Button
26
+ l as Button
20
27
  };
21
28
  //# sourceMappingURL=authkit.js.map
@@ -1 +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;"}
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;"}
@@ -1,2 +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"})}));
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
@@ -1 +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"}
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.1",
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"