@authdog/react-elements 0.0.4 → 0.0.8

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,22 @@
1
+
2
+ > @authdog/react-elements@0.0.8 build /home/runner/work/web-sdk/web-sdk/packages/react-elements
3
+ > pnpm tsup
4
+
5
+ CLI Building entry: src/index.ts
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/index.js.map 3.24 KB
15
+ CJS ⚡️ Build success in 84ms
16
+ ESM dist/index.mjs 1.35 KB
17
+ ESM dist/index.mjs.map 3.02 KB
18
+ ESM ⚡️ Build success in 85ms
19
+ DTS Build start
20
+ DTS ⚡️ Build success in 6619ms
21
+ DTS dist/index.d.ts 756.00 B
22
+ DTS dist/index.d.mts 756.00 B
package/CHANGELOG.md ADDED
@@ -0,0 +1,31 @@
1
+ # @authdog/react-elements
2
+
3
+ ## 0.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 57c41ef: add publish config
8
+
9
+ ## 0.0.8
10
+
11
+ ### Patch Changes
12
+
13
+ - 30fdfe6: bump
14
+
15
+ ## 0.0.7
16
+
17
+ ### Patch Changes
18
+
19
+ - 6c41c4d: bump version
20
+
21
+ ## 0.0.2
22
+
23
+ ### Patch Changes
24
+
25
+ - d6ac8e7: ensure all exports are available
26
+
27
+ ## 0.0.1
28
+
29
+ ### Patch Changes
30
+
31
+ - 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,69 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @layer base {
6
+ :root {
7
+ --background: 0 0% 100%;
8
+ --foreground: 240 10% 3.9%;
9
+ --card: 0 0% 100%;
10
+ --card-foreground: 240 10% 3.9%;
11
+ --popover: 0 0% 100%;
12
+ --popover-foreground: 240 10% 3.9%;
13
+ --primary: 240 5.9% 10%;
14
+ --primary-foreground: 0 0% 98%;
15
+ --secondary: 240 4.8% 95.9%;
16
+ --secondary-foreground: 240 5.9% 10%;
17
+ --muted: 240 4.8% 95.9%;
18
+ --muted-foreground: 240 3.8% 46.1%;
19
+ --accent: 240 4.8% 95.9%;
20
+ --accent-foreground: 240 5.9% 10%;
21
+ --destructive: 0 84.2% 60.2%;
22
+ --destructive-foreground: 0 0% 98%;
23
+ --border: 240 5.9% 90%;
24
+ --input: 240 5.9% 90%;
25
+ --ring: 240 5.9% 10%;
26
+ --radius: 0.5rem;
27
+ --chart-1: 12 76% 61%;
28
+ --chart-2: 173 58% 39%;
29
+ --chart-3: 197 37% 24%;
30
+ --chart-4: 43 74% 66%;
31
+ --chart-5: 27 87% 67%;
32
+ }
33
+
34
+ .dark {
35
+ --background: 240 10% 3.9%;
36
+ --foreground: 0 0% 98%;
37
+ --card: 240 10% 3.9%;
38
+ --card-foreground: 0 0% 98%;
39
+ --popover: 240 10% 3.9%;
40
+ --popover-foreground: 0 0% 98%;
41
+ --primary: 0 0% 98%;
42
+ --primary-foreground: 240 5.9% 10%;
43
+ --secondary: 240 3.7% 15.9%;
44
+ --secondary-foreground: 0 0% 98%;
45
+ --muted: 240 3.7% 15.9%;
46
+ --muted-foreground: 240 5% 64.9%;
47
+ --accent: 240 3.7% 15.9%;
48
+ --accent-foreground: 0 0% 98%;
49
+ --destructive: 0 62.8% 30.6%;
50
+ --destructive-foreground: 0 0% 98%;
51
+ --border: 240 3.7% 15.9%;
52
+ --input: 240 3.7% 15.9%;
53
+ --ring: 240 4.9% 83.9%;
54
+ --chart-1: 220 70% 50%;
55
+ --chart-2: 160 60% 45%;
56
+ --chart-3: 30 80% 55%;
57
+ --chart-4: 280 65% 60%;
58
+ --chart-5: 340 75% 55%;
59
+ }
60
+ }
61
+
62
+ @layer base {
63
+ * {
64
+ @apply border-border;
65
+ }
66
+ body {
67
+ @apply bg-background text-foreground;
68
+ }
69
+ }
package/dist/index.d.mts CHANGED
@@ -1,8 +1,14 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
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';
2
4
 
3
- interface INavbarProps {
4
- siteName?: string;
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;
5
11
  }
6
- declare const Navbar: ({ siteName }: INavbarProps) => react_jsx_runtime.JSX.Element;
12
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
7
13
 
8
- export { Navbar };
14
+ export { Button, type ButtonProps, buttonVariants };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,14 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
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';
2
4
 
3
- interface INavbarProps {
4
- siteName?: string;
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;
5
11
  }
6
- declare const Navbar: ({ siteName }: INavbarProps) => react_jsx_runtime.JSX.Element;
12
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
7
13
 
8
- export { Navbar };
14
+ export { Button, type ButtonProps, buttonVariants };
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,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
+ "./app/**/*.{ts,tsx}",
10
+ "./src/**/*.{ts,tsx}",
11
+ "../../packages/react-elements/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,43 @@
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.8",
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.1",
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/*": "./src/lib/*.ts",
32
+ "./components/*": "./src/components/ui/*.tsx"
15
33
  },
16
- "files": [
17
- "dist/"
18
- ],
19
34
  "publishConfig": {
20
35
  "registry": "https://registry.npmjs.org/",
21
36
  "access": "public"
22
37
  },
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
38
  "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"
39
+ "ui": "pnpm dlx shadcn@latest",
40
+ "lint": "eslint .",
41
+ "build": "pnpm tsup"
37
42
  }
38
43
  }
@@ -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 };
@@ -0,0 +1,4 @@
1
+ declare module '*.module.css' {
2
+ const classes: { [key: string]: string };
3
+ export default classes;
4
+ }
@@ -0,0 +1,69 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @layer base {
6
+ :root {
7
+ --background: 0 0% 100%;
8
+ --foreground: 240 10% 3.9%;
9
+ --card: 0 0% 100%;
10
+ --card-foreground: 240 10% 3.9%;
11
+ --popover: 0 0% 100%;
12
+ --popover-foreground: 240 10% 3.9%;
13
+ --primary: 240 5.9% 10%;
14
+ --primary-foreground: 0 0% 98%;
15
+ --secondary: 240 4.8% 95.9%;
16
+ --secondary-foreground: 240 5.9% 10%;
17
+ --muted: 240 4.8% 95.9%;
18
+ --muted-foreground: 240 3.8% 46.1%;
19
+ --accent: 240 4.8% 95.9%;
20
+ --accent-foreground: 240 5.9% 10%;
21
+ --destructive: 0 84.2% 60.2%;
22
+ --destructive-foreground: 0 0% 98%;
23
+ --border: 240 5.9% 90%;
24
+ --input: 240 5.9% 90%;
25
+ --ring: 240 5.9% 10%;
26
+ --radius: 0.5rem;
27
+ --chart-1: 12 76% 61%;
28
+ --chart-2: 173 58% 39%;
29
+ --chart-3: 197 37% 24%;
30
+ --chart-4: 43 74% 66%;
31
+ --chart-5: 27 87% 67%;
32
+ }
33
+
34
+ .dark {
35
+ --background: 240 10% 3.9%;
36
+ --foreground: 0 0% 98%;
37
+ --card: 240 10% 3.9%;
38
+ --card-foreground: 0 0% 98%;
39
+ --popover: 240 10% 3.9%;
40
+ --popover-foreground: 0 0% 98%;
41
+ --primary: 0 0% 98%;
42
+ --primary-foreground: 240 5.9% 10%;
43
+ --secondary: 240 3.7% 15.9%;
44
+ --secondary-foreground: 0 0% 98%;
45
+ --muted: 240 3.7% 15.9%;
46
+ --muted-foreground: 240 5% 64.9%;
47
+ --accent: 240 3.7% 15.9%;
48
+ --accent-foreground: 0 0% 98%;
49
+ --destructive: 0 62.8% 30.6%;
50
+ --destructive-foreground: 0 0% 98%;
51
+ --border: 240 3.7% 15.9%;
52
+ --input: 240 3.7% 15.9%;
53
+ --ring: 240 4.9% 83.9%;
54
+ --chart-1: 220 70% 50%;
55
+ --chart-2: 160 60% 45%;
56
+ --chart-3: 30 80% 55%;
57
+ --chart-4: 280 65% 60%;
58
+ --chart-5: 340 75% 55%;
59
+ }
60
+ }
61
+
62
+ @layer base {
63
+ * {
64
+ @apply border-border;
65
+ }
66
+ body {
67
+ @apply bg-background text-foreground;
68
+ }
69
+ }
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
+ "./app/**/*.{ts,tsx}",
10
+ "./src/**/*.{ts,tsx}",
11
+ "../../packages/react-elements/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,19 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: ["src/index.ts"], // Entry point for your source code
5
+ format: ["cjs", "esm"],
6
+ dts: true,
7
+ splitting: false,
8
+ sourcemap: true,
9
+ minify: true,
10
+ clean: true,
11
+ target: "es2020",
12
+ external: ["react", "react-dom"],
13
+ outDir: "dist",
14
+ platform: "browser",
15
+ outExtension: ({ format }) => ({
16
+ js: format === "esm" ? ".mjs" : ".js",
17
+ }),
18
+ onSuccess: "cp src/global.module.css dist/global.css && cp postcss.config.mjs dist/postcss.config.mjs && cp tailwind.config.ts dist/tailwind.config.ts"
19
+ });