@the12company/ui 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 ADDED
@@ -0,0 +1,49 @@
1
+ # `@the12company/ui`
2
+
3
+ Shared **tokens + components** (Vite / Next). Lives in this monorepo at `packages/ui`.
4
+
5
+ ## Local use (this repo)
6
+
7
+ Resolved via Vite/TS aliases — no publish needed day to day.
8
+
9
+ ```tsx
10
+ import { Button } from "@the12company/ui";
11
+ ```
12
+
13
+ ```css
14
+ @import "@the12company/ui/tokens/theme.css";
15
+ ```
16
+
17
+ ## Per-product colors
18
+
19
+ ```css
20
+ :root {
21
+ --primary: 160 84% 39%;
22
+ --primary-foreground: 0 0% 100%;
23
+ }
24
+ ```
25
+
26
+ ## First publish (checklist)
27
+
28
+ 1. npm org **`the12company`** exists and you have 2FA on.
29
+ 2. Token created (e.g. named `capivara-ui-kit-token`) — copy the **value**, not only the name.
30
+ 3. GitHub → this repo → **Settings → Secrets and variables → Actions → New repository secret**
31
+ - Name: `NPM_TOKEN`
32
+ - Value: paste the token
33
+ 4. From the repo root (logged in / token configured):
34
+
35
+ ```bash
36
+ npm run publish:ui
37
+ ```
38
+
39
+ Or: Actions → **Publish @the12company/ui** → Run workflow.
40
+
41
+ ## Install in another repo
42
+
43
+ ```bash
44
+ npm install @the12company/ui
45
+ ```
46
+
47
+ Peer deps: `react`, `react-dom`, `@radix-ui/react-slot`, `class-variance-authority`, `clsx`, `tailwind-merge`.
48
+
49
+ > Free npm orgs only allow **public** packages (`--access public`). For private packages you’d need a paid npm plan or GitHub Packages.
@@ -0,0 +1,17 @@
1
+ import { ClassValue } from 'clsx';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as React from 'react';
4
+ import { VariantProps } from 'class-variance-authority';
5
+
6
+ declare function cn(...inputs: ClassValue[]): string;
7
+
8
+ declare const buttonVariants: (props?: ({
9
+ variant?: "default" | "destructive" | "outline" | "outlinePrimary" | "secondary" | "ghost" | "backNav" | "link" | "ghostHover" | "coloredShadow" | null | undefined;
10
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
11
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
12
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
13
+ asChild?: boolean;
14
+ }
15
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
16
+
17
+ export { Button, type ButtonProps, buttonVariants, cn };
package/dist/index.js ADDED
@@ -0,0 +1,58 @@
1
+ import { clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+ import * as React from 'react';
4
+ import { Slot } from '@radix-ui/react-slot';
5
+ import { cva } from 'class-variance-authority';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ // src/lib/cn.ts
9
+ function cn(...inputs) {
10
+ return twMerge(clsx(inputs));
11
+ }
12
+ var buttonVariants = cva(
13
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
14
+ {
15
+ variants: {
16
+ variant: {
17
+ default: "bg-primary text-primary-foreground hover:bg-primary/90 hover:-translate-y-0.5 hover:shadow-lg dark:hover:!shadow-[0_3px_12px_-4px_rgba(0,0,0,0.5)]",
18
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 hover:-translate-y-0.5 hover:shadow-lg dark:hover:!shadow-[0_3px_12px_-4px_rgba(0,0,0,0.5)]",
19
+ outline: "border border-input bg-background hover:bg-accent hover:border-accent hover:text-accent-foreground hover:-translate-y-0.5 hover:shadow-lg dark:hover:!shadow-[0_2px_10px_-4px_rgba(0,0,0,0.4)]",
20
+ outlinePrimary: "border border-input bg-background hover:bg-transparent hover:border-primary hover:text-primary hover:-translate-y-0.5 hover:shadow-lg dark:hover:!shadow-[0_2px_10px_-4px_rgba(0,0,0,0.4)]",
21
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 hover:-translate-y-0.5 hover:shadow-lg dark:hover:!shadow-[0_2px_10px_-4px_rgba(0,0,0,0.4)]",
22
+ ghost: "hover:bg-accent hover:border-accent hover:text-accent-foreground hover:-translate-y-0.5 hover:shadow-lg dark:hover:!shadow-[0_2px_10px_-4px_rgba(0,0,0,0.35)]",
23
+ backNav: "hover:-translate-y-0.5 rounded-lg border border-transparent bg-transparent text-foreground/60 shadow-none hover:text-foreground",
24
+ link: "text-primary hover-underline hover:-translate-y-0.5 hover:shadow-none",
25
+ ghostHover: "hover:shadow-none",
26
+ coloredShadow: "hover:-translate-y-0.5 bg-primary text-primary-foreground hover:bg-primary/90 hover:shadow-lg hover:shadow-[0_0_15px_rgba(96,214,111,0.2)] hover:shadow-primary/40 dark:hover:shadow-primary/25"
27
+ },
28
+ size: {
29
+ default: "h-10 px-4 py-2",
30
+ sm: "h-9 rounded-md px-3",
31
+ lg: "h-11 rounded-md px-8 text-base",
32
+ icon: "h-10 w-10"
33
+ }
34
+ },
35
+ defaultVariants: {
36
+ variant: "default",
37
+ size: "default"
38
+ }
39
+ }
40
+ );
41
+ var Button = React.forwardRef(
42
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
43
+ const Comp = asChild ? Slot : "button";
44
+ return /* @__PURE__ */ jsx(
45
+ Comp,
46
+ {
47
+ className: cn(buttonVariants({ variant, size, className })),
48
+ ref,
49
+ ...props
50
+ }
51
+ );
52
+ }
53
+ );
54
+ Button.displayName = "Button";
55
+
56
+ export { Button, buttonVariants, cn };
57
+ //# sourceMappingURL=index.js.map
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/cn.ts","../src/components/button.tsx"],"names":[],"mappings":";;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AA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{ twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}\r\n","import * as React from \"react\";\r\nimport { Slot } from \"@radix-ui/react-slot\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nimport { cn } from \"../lib/cn\";\r\n\r\nconst buttonVariants = cva(\r\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\r\n {\r\n variants: {\r\n variant: {\r\n default:\r\n \"bg-primary text-primary-foreground hover:bg-primary/90 hover:-translate-y-0.5 hover:shadow-lg dark:hover:!shadow-[0_3px_12px_-4px_rgba(0,0,0,0.5)]\",\r\n destructive:\r\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90 hover:-translate-y-0.5 hover:shadow-lg dark:hover:!shadow-[0_3px_12px_-4px_rgba(0,0,0,0.5)]\",\r\n outline:\r\n \"border border-input bg-background hover:bg-accent hover:border-accent hover:text-accent-foreground hover:-translate-y-0.5 hover:shadow-lg dark:hover:!shadow-[0_2px_10px_-4px_rgba(0,0,0,0.4)]\",\r\n outlinePrimary:\r\n \"border border-input bg-background hover:bg-transparent hover:border-primary hover:text-primary hover:-translate-y-0.5 hover:shadow-lg dark:hover:!shadow-[0_2px_10px_-4px_rgba(0,0,0,0.4)]\",\r\n secondary:\r\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80 hover:-translate-y-0.5 hover:shadow-lg dark:hover:!shadow-[0_2px_10px_-4px_rgba(0,0,0,0.4)]\",\r\n ghost:\r\n \"hover:bg-accent hover:border-accent hover:text-accent-foreground hover:-translate-y-0.5 hover:shadow-lg dark:hover:!shadow-[0_2px_10px_-4px_rgba(0,0,0,0.35)]\",\r\n backNav:\r\n \"hover:-translate-y-0.5 rounded-lg border border-transparent bg-transparent text-foreground/60 shadow-none hover:text-foreground\",\r\n link: \"text-primary hover-underline hover:-translate-y-0.5 hover:shadow-none\",\r\n ghostHover: \"hover:shadow-none\",\r\n coloredShadow:\r\n \"hover:-translate-y-0.5 bg-primary text-primary-foreground hover:bg-primary/90 hover:shadow-lg hover:shadow-[0_0_15px_rgba(96,214,111,0.2)] hover:shadow-primary/40 dark:hover:shadow-primary/25\",\r\n },\r\n size: {\r\n default: \"h-10 px-4 py-2\",\r\n sm: \"h-9 rounded-md px-3\",\r\n lg: \"h-11 rounded-md px-8 text-base\",\r\n icon: \"h-10 w-10\",\r\n },\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n size: \"default\",\r\n },\r\n }\r\n);\r\n\r\nexport interface ButtonProps\r\n extends\r\n React.ButtonHTMLAttributes<HTMLButtonElement>,\r\n VariantProps<typeof buttonVariants> {\r\n asChild?: boolean;\r\n}\r\n\r\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\r\n ({ className, variant, size, asChild = false, ...props }, ref) => {\r\n const Comp = asChild ? Slot : \"button\";\r\n return (\r\n <Comp\r\n className={cn(buttonVariants({ variant, size, className }))}\r\n ref={ref}\r\n {...props}\r\n />\r\n );\r\n }\r\n);\r\nButton.displayName = \"Button\";\r\n\r\nexport { Button, buttonVariants };\r\n"]}
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@the12company/ui",
3
+ "version": "0.0.1",
4
+ "description": "UI Kit para projetos Capivara",
5
+ "license": "UNLICENSED",
6
+ "type": "module",
7
+ "sideEffects": [
8
+ "**/*.css"
9
+ ],
10
+ "files": [
11
+ "dist",
12
+ "src/tokens"
13
+ ],
14
+ "main": "./dist/index.js",
15
+ "module": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ },
22
+ "./tokens/theme.css": "./src/tokens/theme.css",
23
+ "./tokens/theme-contract.css": "./src/tokens/theme-contract.css",
24
+ "./package.json": "./package.json"
25
+ },
26
+ "scripts": {
27
+ "build": "tsup",
28
+ "typecheck": "tsc --noEmit -p tsconfig.json",
29
+ "prepublishOnly": "npm run build"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "peerDependencies": {
35
+ "@radix-ui/react-slot": "^1.0.0",
36
+ "class-variance-authority": "^0.7.0",
37
+ "clsx": "^2.0.0",
38
+ "react": "^18.0.0 || ^19.0.0",
39
+ "react-dom": "^18.0.0 || ^19.0.0",
40
+ "tailwind-merge": "^2.0.0"
41
+ },
42
+ "devDependencies": {
43
+ "@types/react": "^18.3.31",
44
+ "tsup": "^8.5.0",
45
+ "typescript": "^5.9.3"
46
+ },
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/the-12-company/quick-analytics-frontend.git",
50
+ "directory": "packages/ui"
51
+ }
52
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Semantic token contract for @the12company/ui.
3
+ *
4
+ * Apps MUST provide these CSS variables (on :root and optionally .dark).
5
+ * Components only reference the names — never raw brand hex/HSL.
6
+ *
7
+ * Override per product, e.g.:
8
+ * :root { --primary: 160 84% 39%; }
9
+ */
10
+ :root {
11
+ /* Surfaces */
12
+ --background: 0 0% 100%;
13
+ --foreground: 0 0% 10%;
14
+ --card: 0 0% 100%;
15
+ --card-foreground: 0 0% 10%;
16
+ --popover: 0 0% 100%;
17
+ --popover-foreground: 0 0% 10%;
18
+
19
+ /* Brand — override per app */
20
+ --primary: 220 90% 50%;
21
+ --primary-foreground: 0 0% 100%;
22
+
23
+ --secondary: 0 0% 96%;
24
+ --secondary-foreground: 0 0% 10%;
25
+ --muted: 0 0% 96%;
26
+ --muted-foreground: 0 0% 45%;
27
+ --accent: 220 90% 50%;
28
+ --accent-foreground: 0 0% 100%;
29
+
30
+ --destructive: 0 72% 51%;
31
+ --destructive-foreground: 0 0% 100%;
32
+
33
+ --border: 0 0% 90%;
34
+ --input: 0 0% 90%;
35
+ --ring: 220 90% 50%;
36
+
37
+ --radius: 0.625rem;
38
+
39
+ /* Status */
40
+ --warning: 38 92% 50%;
41
+ --warning-foreground: 38 92% 14%;
42
+ --success: 160 84% 39%;
43
+ --success-foreground: 0 0% 100%;
44
+ --info: 220 90% 50%;
45
+ --info-foreground: 0 0% 100%;
46
+
47
+ /* Charts (optional) */
48
+ --chart-1: 220 90% 50%;
49
+ --chart-2: 160 84% 39%;
50
+ --chart-3: 38 92% 50%;
51
+ --chart-4: 280 65% 55%;
52
+ --chart-5: 0 72% 51%;
53
+ --chart-6: 190 80% 45%;
54
+
55
+ /* Sidebar (optional) */
56
+ --sidebar-background: 0 0% 10%;
57
+ --sidebar-foreground: 0 0% 80%;
58
+ --sidebar-primary: 220 90% 55%;
59
+ --sidebar-primary-foreground: 0 0% 100%;
60
+ --sidebar-accent: 0 0% 16%;
61
+ --sidebar-accent-foreground: 0 0% 90%;
62
+ --sidebar-border: 0 0% 18%;
63
+ --sidebar-ring: 220 90% 55%;
64
+ --sidebar-muted: 0 0% 25%;
65
+ }
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Quick Analytics brand theme (default for this monorepo).
3
+ * Other products: copy theme-contract.css and set your --primary (etc.).
4
+ */
5
+ :root {
6
+ --background: 220 20% 97%;
7
+ --foreground: 220 25% 10%;
8
+
9
+ --card: 0 0% 100%;
10
+ --card-foreground: 220 25% 10%;
11
+
12
+ --popover: 0 0% 100%;
13
+ --popover-foreground: 220 25% 10%;
14
+
15
+ --primary: 217 91% 50%;
16
+ --primary-foreground: 0 0% 100%;
17
+
18
+ --secondary: 220 14% 92%;
19
+ --secondary-foreground: 220 25% 10%;
20
+
21
+ --muted: 220 14% 95%;
22
+ --muted-foreground: 220 10% 46%;
23
+
24
+ --accent: 230 78% 58%;
25
+ --accent-foreground: 0 0% 100%;
26
+
27
+ --destructive: 0 72% 51%;
28
+ --destructive-foreground: 0 0% 100%;
29
+
30
+ --border: 220 13% 89%;
31
+ --input: 220 13% 89%;
32
+ --ring: 217 91% 50%;
33
+
34
+ --radius: 0.625rem;
35
+
36
+ --sidebar-background: 220 25% 10%;
37
+ --sidebar-foreground: 220 10% 80%;
38
+ --sidebar-primary: 217 91% 60%;
39
+ --sidebar-primary-foreground: 0 0% 100%;
40
+ --sidebar-accent: 220 20% 16%;
41
+ --sidebar-accent-foreground: 220 10% 90%;
42
+ --sidebar-border: 220 20% 18%;
43
+ --sidebar-ring: 217 91% 60%;
44
+ --sidebar-muted: 220 15% 25%;
45
+
46
+ --warning: 38 92% 50%;
47
+ --warning-foreground: 38 92% 14%;
48
+ --success: 160 84% 39%;
49
+ --success-foreground: 0 0% 100%;
50
+ --info: 217 91% 50%;
51
+ --info-foreground: 0 0% 100%;
52
+
53
+ --chart-1: 217 91% 50%;
54
+ --chart-2: 160 84% 39%;
55
+ --chart-3: 38 92% 50%;
56
+ --chart-4: 280 65% 55%;
57
+ --chart-5: 0 72% 51%;
58
+ --chart-6: 190 80% 45%;
59
+
60
+ --insight-glow-surface: 0 0% 100%;
61
+ }
62
+
63
+ .dark {
64
+ --background: 222 25% 8%;
65
+ --foreground: 220 15% 90%;
66
+
67
+ --card: 222 22% 11%;
68
+ --card-foreground: 220 15% 90%;
69
+
70
+ --popover: 222 22% 11%;
71
+ --popover-foreground: 220 15% 90%;
72
+
73
+ --primary: 217 91% 60%;
74
+ --primary-foreground: 0 0% 100%;
75
+
76
+ --secondary: 220 18% 18%;
77
+ --secondary-foreground: 220 15% 85%;
78
+
79
+ --muted: 220 18% 15%;
80
+ --muted-foreground: 220 10% 55%;
81
+
82
+ --accent: 230 78% 58%;
83
+ --accent-foreground: 0 0% 100%;
84
+
85
+ --destructive: 0 62% 55%;
86
+ --destructive-foreground: 0 0% 100%;
87
+
88
+ --border: 220 18% 18%;
89
+ --input: 220 18% 18%;
90
+ --ring: 230 78% 58%;
91
+
92
+ --sidebar-background: 222 28% 6%;
93
+ --sidebar-foreground: 220 10% 75%;
94
+ --sidebar-primary: 230 78% 58%;
95
+ --sidebar-primary-foreground: 0 0% 100%;
96
+ --sidebar-accent: 222 22% 12%;
97
+ --sidebar-accent-foreground: 220 10% 90%;
98
+ --sidebar-border: 220 20% 14%;
99
+ --sidebar-ring: 230 78% 58%;
100
+ --sidebar-muted: 220 15% 20%;
101
+
102
+ --warning: 38 80% 55%;
103
+ --warning-foreground: 38 80% 10%;
104
+ --success: 160 70% 45%;
105
+ --success-foreground: 0 0% 100%;
106
+ --info: 230 78% 58%;
107
+ --info-foreground: 0 0% 100%;
108
+
109
+ --chart-1: 217 91% 60%;
110
+ --chart-2: 160 70% 45%;
111
+ --chart-3: 38 80% 55%;
112
+ --chart-4: 280 60% 60%;
113
+ --chart-5: 0 62% 55%;
114
+ --chart-6: 190 70% 50%;
115
+
116
+ --insight-glow-surface: 222 24% 12%;
117
+ }