@authdog/react-elements 0.0.4 → 0.0.9

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/.eslintrc.js ADDED
@@ -0,0 +1,9 @@
1
+ /** @type {import("eslint").Linter.Config} */
2
+ module.exports = {
3
+ root: true,
4
+ extends: ['@authdog/eslint-config/react-internal.js'],
5
+ parser: '@typescript-eslint/parser',
6
+ rules: {
7
+ 'no-redeclare': 'off',
8
+ },
9
+ };
@@ -0,0 +1,34 @@
1
+
2
+ > @authdog/react-elements@0.0.9 build /home/runner/work/web-sdk/web-sdk/packages/react-elements
3
+ > pnpm tsup
4
+
5
+ CLI Building entry: src/index.ts, src/lib/utils.ts, src/components/ui/button.tsx
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.3.5
8
+ CLI Using tsup config: /home/runner/work/web-sdk/web-sdk/packages/react-elements/tsup.config.ts
9
+ CLI Target: es2020
10
+ CLI Cleaning output folder
11
+ CJS Build start
12
+ ESM Build start
13
+ CJS dist/index.js 1.93 KB
14
+ CJS dist/lib/utils.js 606.00 B
15
+ CJS dist/components/ui/button.js 1.93 KB
16
+ CJS dist/index.js.map 3.24 KB
17
+ CJS dist/lib/utils.js.map 519.00 B
18
+ CJS dist/components/ui/button.js.map 3.19 KB
19
+ CJS ⚡️ Build success in 70ms
20
+ ESM dist/index.mjs 1.35 KB
21
+ ESM dist/lib/utils.mjs 152.00 B
22
+ ESM dist/components/ui/button.mjs 1.35 KB
23
+ ESM dist/index.mjs.map 3.02 KB
24
+ ESM dist/lib/utils.mjs.map 414.00 B
25
+ ESM dist/components/ui/button.mjs.map 3.03 KB
26
+ ESM ⚡️ Build success in 72ms
27
+ DTS Build start
28
+ DTS ⚡️ Build success in 10599ms
29
+ DTS dist/lib/utils.d.ts 106.00 B
30
+ DTS dist/components/ui/button.d.ts 756.00 B
31
+ DTS dist/index.d.ts 173.00 B
32
+ DTS dist/lib/utils.d.mts 106.00 B
33
+ DTS dist/components/ui/button.d.mts 756.00 B
34
+ DTS dist/index.d.mts 174.00 B
package/CHANGELOG.md ADDED
@@ -0,0 +1,37 @@
1
+ # @authdog/react-elements
2
+
3
+ ## 0.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 352d31e: replace css filepath
8
+
9
+ ## 0.0.8
10
+
11
+ ### Patch Changes
12
+
13
+ - 57c41ef: add publish config
14
+
15
+ ## 0.0.8
16
+
17
+ ### Patch Changes
18
+
19
+ - 30fdfe6: bump
20
+
21
+ ## 0.0.7
22
+
23
+ ### Patch Changes
24
+
25
+ - 6c41c4d: bump version
26
+
27
+ ## 0.0.2
28
+
29
+ ### Patch Changes
30
+
31
+ - d6ac8e7: ensure all exports are available
32
+
33
+ ## 0.0.1
34
+
35
+ ### Patch Changes
36
+
37
+ - 8d5f1a9: adjust config to export tailwinded components and style
package/README.md CHANGED
@@ -1,5 +1 @@
1
- # Authdog React Elements
2
-
3
- ## Installation
4
-
5
- `npm i @authdog/react-elements`
1
+ # `@authdog/react-elements`
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "default",
4
+ "rsc": true,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "tailwind.config.ts",
8
+ "css": "src/globals.css",
9
+ "baseColor": "zinc",
10
+ "cssVariables": true,
11
+ "prefix": ""
12
+ },
13
+ "aliases": {
14
+ "components": "@authdog/react-elements/components",
15
+ "ui": "@authdog/react-elements/components/ui",
16
+ "utils": "@authdog/react-elements/lib/utils",
17
+ "lib": "@authdog/react-elements/lib",
18
+ "hooks": "@authdog/react-elements/hooks"
19
+ }
20
+ }
@@ -0,0 +1,14 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ declare const buttonVariants: (props?: ({
6
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
7
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
8
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
9
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
+ asChild?: boolean;
11
+ }
12
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
13
+
14
+ export { Button, type ButtonProps, buttonVariants };
@@ -0,0 +1,14 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { VariantProps } from 'class-variance-authority';
4
+
5
+ declare const buttonVariants: (props?: ({
6
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
7
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
8
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
9
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
10
+ asChild?: boolean;
11
+ }
12
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
13
+
14
+ export { Button, type ButtonProps, buttonVariants };
@@ -0,0 +1,2 @@
1
+ "use strict";var v=Object.create;var i=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var V=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},a=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of x(t))!B.call(e,o)&&o!==r&&i(e,o,{get:()=>t[o],enumerable:!(n=h(t,o))||n.enumerable});return e};var w=(e,t,r)=>(r=e!=null?v(y(e)):{},a(t||!e||!e.__esModule?i(r,"default",{value:e,enumerable:!0}):r,e)),C=e=>a(i({},"__esModule",{value:!0}),e);var M={};V(M,{Button:()=>m,buttonVariants:()=>p});module.exports=C(M);var c=w(require("react")),f=require("@radix-ui/react-slot"),l=require("class-variance-authority");var s=require("clsx"),u=require("tailwind-merge");function d(...e){return(0,u.twMerge)((0,s.clsx)(e))}var b=require("react/jsx-runtime"),p=(0,l.cva)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),m=c.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},g)=>(0,b.jsx)(n?f.Slot:"button",{className:d(p({variant:t,size:r,className:e})),ref:g,...o}));m.displayName="Button";
2
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ui/button.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@authdog/react-elements/lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAAuB,oBACvBC,EAAqB,gCACrBC,EAAuC,oCCFvC,IAAAC,EAAsC,gBACtCC,EAAwB,0BAEjB,SAASC,KAAMC,EAAsB,CAC1C,SAAO,cAAQ,QAAKA,CAAM,CAAC,CAC7B,CDwCM,IAAAC,EAAA,6BAvCAC,KAAiB,OACrB,yRACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,yDACT,YACE,qEACF,QACE,iFACF,UACE,+DACF,MAAO,+CACP,KAAM,iDACR,EACA,KAAM,CACJ,QAAS,iBACT,GAAI,sBACJ,GAAI,uBACJ,KAAM,WACR,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CACF,EAQMC,EAAe,aACnB,CAAC,CAAE,UAAAC,EAAW,QAAAC,EAAS,KAAAC,EAAM,QAAAC,EAAU,GAAO,GAAGC,CAAM,EAAGC,OAGtD,OAFWF,EAAU,OAAO,SAE3B,CACC,UAAWG,EAAGR,EAAe,CAAE,QAAAG,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,CAAC,EAC1D,IAAKK,EACJ,GAAGD,EACN,CAGN,EACAL,EAAO,YAAc","names":["button_exports","__export","Button","buttonVariants","__toCommonJS","React","import_react_slot","import_class_variance_authority","import_clsx","import_tailwind_merge","cn","inputs","import_jsx_runtime","buttonVariants","Button","className","variant","size","asChild","props","ref","cn"]}
@@ -0,0 +1,2 @@
1
+ import*as r from"react";import{Slot as c}from"@radix-ui/react-slot";import{cva as f}from"class-variance-authority";import{clsx as u}from"clsx";import{twMerge as d}from"tailwind-merge";function t(...e){return d(u(e))}import{jsx as m}from"react/jsx-runtime";var l=f("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),p=r.forwardRef(({className:e,variant:o,size:n,asChild:i=!1,...a},s)=>m(i?c:"button",{className:t(l({variant:o,size:n,className:e})),ref:s,...a}));p.displayName="Button";export{p as Button,l as buttonVariants};
2
+ //# sourceMappingURL=button.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ui/button.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@authdog/react-elements/lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"AAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAA8B,2BCFvC,OAA0B,QAAAC,MAAY,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B,CDwCM,cAAAC,MAAA,oBAvCN,IAAMC,EAAiBC,EACrB,yRACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,yDACT,YACE,qEACF,QACE,iFACF,UACE,+DACF,MAAO,+CACP,KAAM,iDACR,EACA,KAAM,CACJ,QAAS,iBACT,GAAI,sBACJ,GAAI,uBACJ,KAAM,WACR,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CACF,EAQMC,EAAe,aACnB,CAAC,CAAE,UAAAC,EAAW,QAAAC,EAAS,KAAAC,EAAM,QAAAC,EAAU,GAAO,GAAGC,CAAM,EAAGC,IAGtDT,EAFWO,EAAUG,EAAO,SAE3B,CACC,UAAWC,EAAGV,EAAe,CAAE,QAAAI,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,CAAC,EAC1D,IAAKK,EACJ,GAAGD,EACN,CAGN,EACAL,EAAO,YAAc","names":["React","Slot","cva","clsx","twMerge","cn","inputs","jsx","buttonVariants","cva","Button","className","variant","size","asChild","props","ref","Slot","cn"]}
@@ -0,0 +1,81 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @layer base {
6
+ :root {
7
+ --background: 0 0% 100%;
8
+ --foreground: 222.2 47.4% 11.2%;
9
+
10
+ --muted: 210 40% 96.1%;
11
+ --muted-foreground: 215.4 16.3% 46.9%;
12
+
13
+ --popover: 0 0% 100%;
14
+ --popover-foreground: 222.2 47.4% 11.2%;
15
+
16
+ --card: 0 0% 100%;
17
+ --card-foreground: 222.2 47.4% 11.2%;
18
+
19
+ --border: 214.3 31.8% 91.4%;
20
+ --input: 214.3 31.8% 91.4%;
21
+
22
+ --primary: 222.2 47.4% 11.2%;
23
+ --primary-foreground: 210 40% 98%;
24
+
25
+ --secondary: 210 40% 96.1%;
26
+ --secondary-foreground: 222.2 47.4% 11.2%;
27
+
28
+ --accent: 210 40% 96.1%;
29
+ --accent-foreground: 222.2 47.4% 11.2%;
30
+
31
+ --destructive: 0 100% 50%;
32
+ --destructive-foreground: 210 40% 98%;
33
+
34
+ --ring: 215 20.2% 65.1%;
35
+
36
+ --radius: 0.5rem;
37
+ }
38
+
39
+ .dark {
40
+ --background: 224 71% 4%;
41
+ --foreground: 213 31% 91%;
42
+
43
+ --muted: 223 47% 11%;
44
+ --muted-foreground: 215.4 16.3% 56.9%;
45
+
46
+ --popover: 224 71% 4%;
47
+ --popover-foreground: 215 20.2% 65.1%;
48
+
49
+ --card: 224 71% 4%;
50
+ --card-foreground: 213 31% 91%;
51
+
52
+ --border: 216 34% 17%;
53
+ --input: 216 34% 17%;
54
+
55
+ --primary: 210 40% 98%;
56
+ --primary-foreground: 222.2 47.4% 1.2%;
57
+
58
+ --secondary: 222.2 47.4% 11.2%;
59
+ --secondary-foreground: 210 40% 98%;
60
+
61
+ --accent: 216 34% 17%;
62
+ --accent-foreground: 210 40% 98%;
63
+
64
+ --destructive: 0 63% 31%;
65
+ --destructive-foreground: 210 40% 98%;
66
+
67
+ --ring: 216 34% 17%;
68
+
69
+ --radius: 0.5rem;
70
+ }
71
+ }
72
+
73
+ @layer base {
74
+ * {
75
+ @apply border-border;
76
+ }
77
+ body {
78
+ @apply bg-background text-foreground;
79
+ font-feature-settings: "rlig" 1, "calt" 1;
80
+ }
81
+ }
package/dist/index.d.mts CHANGED
@@ -1,8 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- interface INavbarProps {
4
- siteName?: string;
5
- }
6
- declare const Navbar: ({ siteName }: INavbarProps) => react_jsx_runtime.JSX.Element;
7
-
8
- export { Navbar };
1
+ export { Button, ButtonProps, buttonVariants } from './components/ui/button.mjs';
2
+ import 'class-variance-authority/types';
3
+ import 'react';
4
+ import 'class-variance-authority';
package/dist/index.d.ts CHANGED
@@ -1,8 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- interface INavbarProps {
4
- siteName?: string;
5
- }
6
- declare const Navbar: ({ siteName }: INavbarProps) => react_jsx_runtime.JSX.Element;
7
-
8
- export { Navbar };
1
+ export { Button, ButtonProps, buttonVariants } from './components/ui/button.js';
2
+ import 'class-variance-authority/types';
3
+ import 'react';
4
+ import 'class-variance-authority';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var l=(e,r)=>{for(var o in r)i(e,o,{get:r[o],enumerable:!0})},v=(e,r,o,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of p(r))!b.call(e,a)&&a!==o&&i(e,a,{get:()=>r[a],enumerable:!(s=n(r,a))||s.enumerable});return e};var N=e=>v(i({},"__esModule",{value:!0}),e);var c={};l(c,{Navbar:()=>d});module.exports=N(c);var t=require("react/jsx-runtime"),d=({siteName:e="Authdog"})=>(0,t.jsxs)("div",{style:{backgroundColor:"blue",padding:"10px",color:"white"},children:[e,(0,t.jsx)("div",{style:{display:"flex",justifyContent:"space-between"}})]});
1
+ "use strict";var v=Object.create;var i=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var V=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},a=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of h(t))!B.call(e,o)&&o!==r&&i(e,o,{get:()=>t[o],enumerable:!(n=x(t,o))||n.enumerable});return e};var w=(e,t,r)=>(r=e!=null?v(y(e)):{},a(t||!e||!e.__esModule?i(r,"default",{value:e,enumerable:!0}):r,e)),C=e=>a(i({},"__esModule",{value:!0}),e);var M={};V(M,{Button:()=>m,buttonVariants:()=>p});module.exports=C(M);var c=w(require("react")),f=require("@radix-ui/react-slot"),l=require("class-variance-authority");var s=require("clsx"),u=require("tailwind-merge");function d(...e){return(0,u.twMerge)((0,s.clsx)(e))}var b=require("react/jsx-runtime"),p=(0,l.cva)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),m=c.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},g)=>(0,b.jsx)(n?f.Slot:"button",{className:d(p({variant:t,size:r,className:e})),ref:g,...o}));m.displayName="Button";
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/navigation/index.tsx"],"sourcesContent":["export { Navbar } from \"./navigation\";\n","interface INavbarProps {\n siteName?: string;\n}\n\nexport const Navbar = ({ siteName = \"Authdog\" }: INavbarProps) => {\n return (\n <div style={{ backgroundColor: \"blue\", padding: \"10px\", color: \"white\" }}>\n {siteName}\n <div style={{ display: \"flex\", justifyContent: \"space-between\" }} />\n </div>\n );\n};\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GCMI,IAAAI,EAAA,6BAFSC,EAAS,CAAC,CAAE,SAAAC,EAAW,SAAU,OAE1C,QAAC,OAAI,MAAO,CAAE,gBAAiB,OAAQ,QAAS,OAAQ,MAAO,OAAQ,EACpE,UAAAA,KACD,OAAC,OAAI,MAAO,CAAE,QAAS,OAAQ,eAAgB,eAAgB,EAAG,GACpE","names":["index_exports","__export","Navbar","__toCommonJS","import_jsx_runtime","Navbar","siteName"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/components/ui/button.tsx","../src/lib/utils.ts"],"sourcesContent":["export * from \"./components/ui/button\";\n","import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@authdog/react-elements/lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GCAA,IAAAK,EAAuB,oBACvBC,EAAqB,gCACrBC,EAAuC,oCCFvC,IAAAC,EAAsC,gBACtCC,EAAwB,0BAEjB,SAASC,KAAMC,EAAsB,CAC1C,SAAO,cAAQ,QAAKA,CAAM,CAAC,CAC7B,CDwCM,IAAAC,EAAA,6BAvCAC,KAAiB,OACrB,yRACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,yDACT,YACE,qEACF,QACE,iFACF,UACE,+DACF,MAAO,+CACP,KAAM,iDACR,EACA,KAAM,CACJ,QAAS,iBACT,GAAI,sBACJ,GAAI,uBACJ,KAAM,WACR,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CACF,EAQMC,EAAe,aACnB,CAAC,CAAE,UAAAC,EAAW,QAAAC,EAAS,KAAAC,EAAM,QAAAC,EAAU,GAAO,GAAGC,CAAM,EAAGC,OAGtD,OAFWF,EAAU,OAAO,SAE3B,CACC,UAAWG,EAAGR,EAAe,CAAE,QAAAG,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,CAAC,EAC1D,IAAKK,EACJ,GAAGD,EACN,CAGN,EACAL,EAAO,YAAc","names":["index_exports","__export","Button","buttonVariants","__toCommonJS","React","import_react_slot","import_class_variance_authority","import_clsx","import_tailwind_merge","cn","inputs","import_jsx_runtime","buttonVariants","Button","className","variant","size","asChild","props","ref","cn"]}
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as a,jsxs as o}from"react/jsx-runtime";var r=({siteName:e="Authdog"})=>o("div",{style:{backgroundColor:"blue",padding:"10px",color:"white"},children:[e,a("div",{style:{display:"flex",justifyContent:"space-between"}})]});export{r as Navbar};
1
+ import*as r from"react";import{Slot as c}from"@radix-ui/react-slot";import{cva as f}from"class-variance-authority";import{clsx as u}from"clsx";import{twMerge as d}from"tailwind-merge";function t(...e){return d(u(e))}import{jsx as m}from"react/jsx-runtime";var l=f("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),p=r.forwardRef(({className:e,variant:o,size:n,asChild:i=!1,...a},s)=>m(i?c:"button",{className:t(l({variant:o,size:n,className:e})),ref:s,...a}));p.displayName="Button";export{p as Button,l as buttonVariants};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/navigation/index.tsx"],"sourcesContent":["interface INavbarProps {\n siteName?: string;\n}\n\nexport const Navbar = ({ siteName = \"Authdog\" }: INavbarProps) => {\n return (\n <div style={{ backgroundColor: \"blue\", padding: \"10px\", color: \"white\" }}>\n {siteName}\n <div style={{ display: \"flex\", justifyContent: \"space-between\" }} />\n </div>\n );\n};\n"],"mappings":"AAMI,OAEE,OAAAA,EAFF,QAAAC,MAAA,oBAFG,IAAMC,EAAS,CAAC,CAAE,SAAAC,EAAW,SAAU,IAE1CF,EAAC,OAAI,MAAO,CAAE,gBAAiB,OAAQ,QAAS,OAAQ,MAAO,OAAQ,EACpE,UAAAE,EACDH,EAAC,OAAI,MAAO,CAAE,QAAS,OAAQ,eAAgB,eAAgB,EAAG,GACpE","names":["jsx","jsxs","Navbar","siteName"]}
1
+ {"version":3,"sources":["../src/components/ui/button.tsx","../src/lib/utils.ts"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@authdog/react-elements/lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"AAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAA8B,2BCFvC,OAA0B,QAAAC,MAAY,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B,CDwCM,cAAAC,MAAA,oBAvCN,IAAMC,EAAiBC,EACrB,yRACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,yDACT,YACE,qEACF,QACE,iFACF,UACE,+DACF,MAAO,+CACP,KAAM,iDACR,EACA,KAAM,CACJ,QAAS,iBACT,GAAI,sBACJ,GAAI,uBACJ,KAAM,WACR,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SACR,CACF,CACF,EAQMC,EAAe,aACnB,CAAC,CAAE,UAAAC,EAAW,QAAAC,EAAS,KAAAC,EAAM,QAAAC,EAAU,GAAO,GAAGC,CAAM,EAAGC,IAGtDT,EAFWO,EAAUG,EAAO,SAE3B,CACC,UAAWC,EAAGV,EAAe,CAAE,QAAAI,EAAS,KAAAC,EAAM,UAAAF,CAAU,CAAC,CAAC,EAC1D,IAAKK,EACJ,GAAGD,EACN,CAGN,EACAL,EAAO,YAAc","names":["React","Slot","cva","clsx","twMerge","cn","inputs","jsx","buttonVariants","cva","Button","className","variant","size","asChild","props","ref","Slot","cn"]}
@@ -0,0 +1,5 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ declare function cn(...inputs: ClassValue[]): string;
4
+
5
+ export { cn };
@@ -0,0 +1,5 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ declare function cn(...inputs: ClassValue[]): string;
4
+
5
+ export { cn };
@@ -0,0 +1,2 @@
1
+ "use strict";var l=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(r,e)=>{for(var o in e)l(r,o,{get:e[o],enumerable:!0})},f=(r,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of p(e))!u.call(r,t)&&t!==o&&l(r,t,{get:()=>e[t],enumerable:!(s=n(e,t))||s.enumerable});return r};var i=r=>f(l({},"__esModule",{value:!0}),r);var C={};c(C,{cn:()=>x});module.exports=i(C);var a=require("clsx"),m=require("tailwind-merge");function x(...r){return(0,m.twMerge)((0,a.clsx)(r))}
2
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utils.ts"],"sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,QAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAsC,gBACtCC,EAAwB,0BAEjB,SAASH,KAAMI,EAAsB,CAC1C,SAAO,cAAQ,QAAKA,CAAM,CAAC,CAC7B","names":["utils_exports","__export","cn","__toCommonJS","import_clsx","import_tailwind_merge","inputs"]}
@@ -0,0 +1,2 @@
1
+ import{clsx as e}from"clsx";import{twMerge as t}from"tailwind-merge";function s(...r){return t(e(r))}export{s as cn};
2
+ //# sourceMappingURL=utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utils.ts"],"sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"AAAA,OAA0B,QAAAA,MAAY,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B","names":["clsx","twMerge","cn","inputs"]}
@@ -0,0 +1,9 @@
1
+ /** @type {import('postcss-load-config').Config} */
2
+ const config = {
3
+ plugins: {
4
+ tailwindcss: {},
5
+ autoprefixer: {},
6
+ },
7
+ };
8
+
9
+ export default config;
@@ -0,0 +1,82 @@
1
+ import type { Config } from "tailwindcss";
2
+ import tailwindcssAnimate from "tailwindcss-animate";
3
+
4
+ const config = {
5
+ darkMode: ["class", ""],
6
+ content: [
7
+ "./pages/**/*.{ts,tsx}",
8
+ "./components/**/*.{ts,tsx}",
9
+ "./components/**/**/*.{ts,tsx}",
10
+ "./app/**/*.{ts,tsx}",
11
+ "./src/**/*.{ts,tsx}"
12
+ ],
13
+ prefix: "",
14
+ theme: {
15
+ container: {
16
+ center: true,
17
+ padding: "2rem",
18
+ screens: {
19
+ "2xl": "1400px",
20
+ },
21
+ },
22
+ extend: {
23
+ colors: {
24
+ border: "hsl(var(--border))",
25
+ input: "hsl(var(--input))",
26
+ ring: "hsl(var(--ring))",
27
+ background: "hsl(var(--background))",
28
+ foreground: "hsl(var(--foreground))",
29
+ primary: {
30
+ DEFAULT: "hsl(var(--primary))",
31
+ foreground: "hsl(var(--primary-foreground))",
32
+ },
33
+ secondary: {
34
+ DEFAULT: "hsl(var(--secondary))",
35
+ foreground: "hsl(var(--secondary-foreground))",
36
+ },
37
+ destructive: {
38
+ DEFAULT: "hsl(var(--destructive))",
39
+ foreground: "hsl(var(--destructive-foreground))",
40
+ },
41
+ muted: {
42
+ DEFAULT: "hsl(var(--muted))",
43
+ foreground: "hsl(var(--muted-foreground))",
44
+ },
45
+ accent: {
46
+ DEFAULT: "hsl(var(--accent))",
47
+ foreground: "hsl(var(--accent-foreground))",
48
+ },
49
+ popover: {
50
+ DEFAULT: "hsl(var(--popover))",
51
+ foreground: "hsl(var(--popover-foreground))",
52
+ },
53
+ card: {
54
+ DEFAULT: "hsl(var(--card))",
55
+ foreground: "hsl(var(--card-foreground))",
56
+ },
57
+ },
58
+ borderRadius: {
59
+ lg: "var(--radius)",
60
+ md: "calc(var(--radius) - 2px)",
61
+ sm: "calc(var(--radius) - 4px)",
62
+ },
63
+ keyframes: {
64
+ "accordion-down": {
65
+ from: { height: "0" },
66
+ to: { height: "var(--radix-accordion-content-height)" },
67
+ },
68
+ "accordion-up": {
69
+ from: { height: "var(--radix-accordion-content-height)" },
70
+ to: { height: "0" },
71
+ },
72
+ },
73
+ animation: {
74
+ "accordion-down": "accordion-down 0.2s ease-out",
75
+ "accordion-up": "accordion-up 0.2s ease-out",
76
+ },
77
+ },
78
+ },
79
+ plugins: [tailwindcssAnimate],
80
+ } satisfies Config;
81
+
82
+ export default config;
package/package.json CHANGED
@@ -1,38 +1,44 @@
1
1
  {
2
2
  "name": "@authdog/react-elements",
3
- "version": "0.0.4",
4
- "description": "Authdog React Elements",
5
- "source": "src/index.ts",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.mjs",
8
- "types": "./dist/index.d.ts",
3
+ "version": "0.0.9",
4
+ "peerDependencies": {
5
+ "react": "^18.3.1"
6
+ },
7
+ "devDependencies": {
8
+ "@types/node": "^20",
9
+ "@types/react": "^18.3.11",
10
+ "autoprefixer": "^10",
11
+ "postcss": "^8",
12
+ "postcss-load-config": "^6",
13
+ "tailwindcss": "3.4.17",
14
+ "typescript": "^5.6.3",
15
+ "@authdog/eslint-config": "0.0.0",
16
+ "@authdog/typescript-config": "0.0.0"
17
+ },
18
+ "dependencies": {
19
+ "@radix-ui/react-slot": "^1.0.2",
20
+ "class-variance-authority": "^0.7.0",
21
+ "clsx": "^2.1.1",
22
+ "lucide-react": "^0.451.0",
23
+ "tailwind-merge": "^2.3.0",
24
+ "tailwindcss-animate": "^1.0.7"
25
+ },
9
26
  "exports": {
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.mjs",
13
- "require": "./dist/index.js"
14
- }
27
+ ".": "./dist/index.js",
28
+ "./global.css": "./dist/global.css",
29
+ "./postcss.config": "./postcss.config.mjs",
30
+ "./tailwind.config": "./tailwind.config.ts",
31
+ "./lib/*": "./dist/lib/*.js",
32
+ "./components/*": "./dist/components/ui/*.js",
33
+ "./tailwind.preset": "./dist/tailwind.preset.js"
15
34
  },
16
- "files": [
17
- "dist/"
18
- ],
19
35
  "publishConfig": {
20
36
  "registry": "https://registry.npmjs.org/",
21
37
  "access": "public"
22
38
  },
23
- "dependencies": {
24
- "react": "^18.2.0",
25
- "@authdog/node-commons": "0.0.21"
26
- },
27
- "devDependencies": {
28
- "@types/node": "^22.14.1",
29
- "@types/react": "^18.2.0"
30
- },
31
39
  "scripts": {
32
- "format": "prettier --config .prettierrc.json --write \"**/*.{ts,md}\"",
33
- "type-check": "tsc",
34
- "clean": "rm -rf dist",
35
- "build": "pnpm clean && tsup",
36
- "ship": "pnpm build && pnpm publish --access public --no-git-checks"
40
+ "ui": "pnpm dlx shadcn@latest",
41
+ "lint": "eslint .",
42
+ "build": "pnpm tsup"
37
43
  }
38
44
  }
@@ -0,0 +1,9 @@
1
+ /** @type {import('postcss-load-config').Config} */
2
+ const config = {
3
+ plugins: {
4
+ tailwindcss: {},
5
+ autoprefixer: {},
6
+ },
7
+ };
8
+
9
+ export default config;
@@ -0,0 +1,56 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+ import { cva, type VariantProps } from "class-variance-authority";
4
+
5
+ import { cn } from "@authdog/react-elements/lib/utils";
6
+
7
+ const buttonVariants = cva(
8
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
13
+ destructive:
14
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90",
15
+ outline:
16
+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
17
+ secondary:
18
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19
+ ghost: "hover:bg-accent hover:text-accent-foreground",
20
+ link: "text-primary underline-offset-4 hover:underline",
21
+ },
22
+ size: {
23
+ default: "h-10 px-4 py-2",
24
+ sm: "h-9 rounded-md px-3",
25
+ lg: "h-11 rounded-md px-8",
26
+ icon: "h-10 w-10",
27
+ },
28
+ },
29
+ defaultVariants: {
30
+ variant: "default",
31
+ size: "default",
32
+ },
33
+ },
34
+ );
35
+
36
+ export interface ButtonProps
37
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
38
+ VariantProps<typeof buttonVariants> {
39
+ asChild?: boolean;
40
+ }
41
+
42
+ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
43
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
44
+ const Comp = asChild ? Slot : "button";
45
+ return (
46
+ <Comp
47
+ className={cn(buttonVariants({ variant, size, className }))}
48
+ ref={ref}
49
+ {...props}
50
+ />
51
+ );
52
+ },
53
+ );
54
+ Button.displayName = "Button";
55
+
56
+ export { Button, buttonVariants };
package/src/global.css ADDED
@@ -0,0 +1,81 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @layer base {
6
+ :root {
7
+ --background: 0 0% 100%;
8
+ --foreground: 222.2 47.4% 11.2%;
9
+
10
+ --muted: 210 40% 96.1%;
11
+ --muted-foreground: 215.4 16.3% 46.9%;
12
+
13
+ --popover: 0 0% 100%;
14
+ --popover-foreground: 222.2 47.4% 11.2%;
15
+
16
+ --card: 0 0% 100%;
17
+ --card-foreground: 222.2 47.4% 11.2%;
18
+
19
+ --border: 214.3 31.8% 91.4%;
20
+ --input: 214.3 31.8% 91.4%;
21
+
22
+ --primary: 222.2 47.4% 11.2%;
23
+ --primary-foreground: 210 40% 98%;
24
+
25
+ --secondary: 210 40% 96.1%;
26
+ --secondary-foreground: 222.2 47.4% 11.2%;
27
+
28
+ --accent: 210 40% 96.1%;
29
+ --accent-foreground: 222.2 47.4% 11.2%;
30
+
31
+ --destructive: 0 100% 50%;
32
+ --destructive-foreground: 210 40% 98%;
33
+
34
+ --ring: 215 20.2% 65.1%;
35
+
36
+ --radius: 0.5rem;
37
+ }
38
+
39
+ .dark {
40
+ --background: 224 71% 4%;
41
+ --foreground: 213 31% 91%;
42
+
43
+ --muted: 223 47% 11%;
44
+ --muted-foreground: 215.4 16.3% 56.9%;
45
+
46
+ --popover: 224 71% 4%;
47
+ --popover-foreground: 215 20.2% 65.1%;
48
+
49
+ --card: 224 71% 4%;
50
+ --card-foreground: 213 31% 91%;
51
+
52
+ --border: 216 34% 17%;
53
+ --input: 216 34% 17%;
54
+
55
+ --primary: 210 40% 98%;
56
+ --primary-foreground: 222.2 47.4% 1.2%;
57
+
58
+ --secondary: 222.2 47.4% 11.2%;
59
+ --secondary-foreground: 210 40% 98%;
60
+
61
+ --accent: 216 34% 17%;
62
+ --accent-foreground: 210 40% 98%;
63
+
64
+ --destructive: 0 63% 31%;
65
+ --destructive-foreground: 210 40% 98%;
66
+
67
+ --ring: 216 34% 17%;
68
+
69
+ --radius: 0.5rem;
70
+ }
71
+ }
72
+
73
+ @layer base {
74
+ * {
75
+ @apply border-border;
76
+ }
77
+ body {
78
+ @apply bg-background text-foreground;
79
+ font-feature-settings: "rlig" 1, "calt" 1;
80
+ }
81
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./components/ui/button";
@@ -0,0 +1,6 @@
1
+ import { type ClassValue, clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs));
6
+ }
@@ -0,0 +1,82 @@
1
+ import type { Config } from "tailwindcss";
2
+ import tailwindcssAnimate from "tailwindcss-animate";
3
+
4
+ const config = {
5
+ darkMode: ["class", ""],
6
+ content: [
7
+ "./pages/**/*.{ts,tsx}",
8
+ "./components/**/*.{ts,tsx}",
9
+ "./components/**/**/*.{ts,tsx}",
10
+ "./app/**/*.{ts,tsx}",
11
+ "./src/**/*.{ts,tsx}"
12
+ ],
13
+ prefix: "",
14
+ theme: {
15
+ container: {
16
+ center: true,
17
+ padding: "2rem",
18
+ screens: {
19
+ "2xl": "1400px",
20
+ },
21
+ },
22
+ extend: {
23
+ colors: {
24
+ border: "hsl(var(--border))",
25
+ input: "hsl(var(--input))",
26
+ ring: "hsl(var(--ring))",
27
+ background: "hsl(var(--background))",
28
+ foreground: "hsl(var(--foreground))",
29
+ primary: {
30
+ DEFAULT: "hsl(var(--primary))",
31
+ foreground: "hsl(var(--primary-foreground))",
32
+ },
33
+ secondary: {
34
+ DEFAULT: "hsl(var(--secondary))",
35
+ foreground: "hsl(var(--secondary-foreground))",
36
+ },
37
+ destructive: {
38
+ DEFAULT: "hsl(var(--destructive))",
39
+ foreground: "hsl(var(--destructive-foreground))",
40
+ },
41
+ muted: {
42
+ DEFAULT: "hsl(var(--muted))",
43
+ foreground: "hsl(var(--muted-foreground))",
44
+ },
45
+ accent: {
46
+ DEFAULT: "hsl(var(--accent))",
47
+ foreground: "hsl(var(--accent-foreground))",
48
+ },
49
+ popover: {
50
+ DEFAULT: "hsl(var(--popover))",
51
+ foreground: "hsl(var(--popover-foreground))",
52
+ },
53
+ card: {
54
+ DEFAULT: "hsl(var(--card))",
55
+ foreground: "hsl(var(--card-foreground))",
56
+ },
57
+ },
58
+ borderRadius: {
59
+ lg: "var(--radius)",
60
+ md: "calc(var(--radius) - 2px)",
61
+ sm: "calc(var(--radius) - 4px)",
62
+ },
63
+ keyframes: {
64
+ "accordion-down": {
65
+ from: { height: "0" },
66
+ to: { height: "var(--radix-accordion-content-height)" },
67
+ },
68
+ "accordion-up": {
69
+ from: { height: "var(--radix-accordion-content-height)" },
70
+ to: { height: "0" },
71
+ },
72
+ },
73
+ animation: {
74
+ "accordion-down": "accordion-down 0.2s ease-out",
75
+ "accordion-up": "accordion-up 0.2s ease-out",
76
+ },
77
+ },
78
+ },
79
+ plugins: [tailwindcssAnimate],
80
+ } satisfies Config;
81
+
82
+ export default config;
package/tsconfig.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "@authdog/typescript-config/react-library.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "paths": {
6
+ "@authdog/react-elements/*": ["./src/*"]
7
+ }
8
+ },
9
+ "include": ["src"],
10
+ "exclude": ["node_modules"]
11
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,23 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: [
5
+ "src/index.ts",
6
+ "src/components/ui/*.tsx",
7
+ "src/lib/*.ts"
8
+ ], // Build all entry points
9
+ format: ["cjs", "esm"],
10
+ dts: true,
11
+ splitting: false,
12
+ sourcemap: true,
13
+ minify: true,
14
+ clean: true,
15
+ target: "es2020",
16
+ external: ["react", "react-dom"],
17
+ outDir: "dist",
18
+ platform: "browser",
19
+ outExtension: ({ format }) => ({
20
+ js: format === "esm" ? ".mjs" : ".js",
21
+ }),
22
+ onSuccess: "cp src/global.css dist/global.css && cp postcss.config.mjs dist/postcss.config.mjs && cp tailwind.config.ts dist/tailwind.config.ts"
23
+ });