@gntik-ai/ui 0.0.0-stage → 0.7.0

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.
@@ -0,0 +1 @@
1
+ (function(){try{var m=localStorage.getItem("gntik-theme")||"dark";if(m==='system'){var q=function(s){return window.matchMedia(s).matches};m=q('(prefers-contrast: more)')?'high_contrast':q('(prefers-color-scheme: light)')?'light':'dark'}var e=document.documentElement;e.classList.remove('dark','high_contrast');if(m!=='light')e.classList.add(m);e.style.colorScheme=m==='light'?'light':'dark'}catch(_){}})();
@@ -0,0 +1,16 @@
1
+
2
+ //#region src/theme/theme-script.d.ts
3
+ /**
4
+ * Server-safe theme helpers: no React, no 'use client'. Import from `@gntik-ai/ui/theme-script`
5
+ * in a React Server Component (e.g. a Next.js root layout); the main entry re-exports them.
6
+ */
7
+ type ThemeMode = 'dark' | 'light' | 'high_contrast' | 'system';
8
+ type ResolvedTheme = Exclude<ThemeMode, 'system'>;
9
+ /**
10
+ * Inline script for <head> that applies the stored theme before first paint.
11
+ * Usage: `<script dangerouslySetInnerHTML={{ __html: themeScript() }} />`.
12
+ */
13
+ declare function themeScript(storageKey?: string, defaultMode?: ThemeMode): string;
14
+ //#endregion
15
+ export { ThemeMode as n, themeScript as r, ResolvedTheme as t };
16
+ //# sourceMappingURL=theme-script-DReryl-n.d.ts.map
@@ -0,0 +1,3 @@
1
+
2
+ import { n as ThemeMode, r as themeScript, t as ResolvedTheme } from "./theme-script-DReryl-n.js";
3
+ export { ResolvedTheme, ThemeMode, themeScript };
@@ -0,0 +1,13 @@
1
+
2
+ //#region src/theme/theme-script.ts
3
+ /**
4
+ * Inline script for <head> that applies the stored theme before first paint.
5
+ * Usage: `<script dangerouslySetInnerHTML={{ __html: themeScript() }} />`.
6
+ */
7
+ function themeScript(storageKey = "gntik-theme", defaultMode = "dark") {
8
+ return `(function(){try{var m=localStorage.getItem(${JSON.stringify(storageKey)})||${JSON.stringify(defaultMode)};if(m==='system'){var q=function(s){return window.matchMedia(s).matches};m=q('(prefers-contrast: more)')?'high_contrast':q('(prefers-color-scheme: light)')?'light':'dark'}var e=document.documentElement;e.classList.remove('dark','high_contrast');if(m!=='light')e.classList.add(m);e.style.colorScheme=m==='light'?'light':'dark'}catch(_){}})();`;
9
+ }
10
+ //#endregion
11
+ export { themeScript };
12
+
13
+ //# sourceMappingURL=theme-script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-script.js","names":[],"sources":["../src/theme/theme-script.ts"],"sourcesContent":["/**\n * Server-safe theme helpers: no React, no 'use client'. Import from `@gntik-ai/ui/theme-script`\n * in a React Server Component (e.g. a Next.js root layout); the main entry re-exports them.\n */\n\nexport type ThemeMode = 'dark' | 'light' | 'high_contrast' | 'system';\nexport type ResolvedTheme = Exclude<ThemeMode, 'system'>;\n\n/**\n * Inline script for <head> that applies the stored theme before first paint.\n * Usage: `<script dangerouslySetInnerHTML={{ __html: themeScript() }} />`.\n */\nexport function themeScript(storageKey = 'gntik-theme', defaultMode: ThemeMode = 'dark') {\n return `(function(){try{var m=localStorage.getItem(${JSON.stringify(storageKey)})||${JSON.stringify(defaultMode)};if(m==='system'){var q=function(s){return window.matchMedia(s).matches};m=q('(prefers-contrast: more)')?'high_contrast':q('(prefers-color-scheme: light)')?'light':'dark'}var e=document.documentElement;e.classList.remove('dark','high_contrast');if(m!=='light')e.classList.add(m);e.style.colorScheme=m==='light'?'light':'dark'}catch(_){}})();`;\n}\n"],"mappings":";;;;;;AAYA,SAAgB,YAAY,aAAa,eAAe,cAAyB,QAAQ;CACvF,OAAO,8CAA8C,KAAK,UAAU,UAAU,EAAE,KAAK,KAAK,UAAU,WAAW,EAAE;AACnH"}
package/package.json CHANGED
@@ -1,6 +1,85 @@
1
1
  {
2
2
  "name": "@gntik-ai/ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.7.0",
4
+ "description": "gntik-ui React components and layouts on Base UI, styled with the brand tokens.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": [
8
+ "*.css"
9
+ ],
10
+ "files": [
11
+ "dist",
12
+ "src/styles.css"
13
+ ],
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
20
+ },
21
+ "./theme-script": {
22
+ "types": "./dist/theme-script.d.ts",
23
+ "default": "./dist/theme-script.js"
24
+ },
25
+ "./theme-bootstrap.js": "./dist/theme-bootstrap.js",
26
+ "./forms": {
27
+ "types": "./dist/forms.d.ts",
28
+ "default": "./dist/forms.js"
29
+ },
30
+ "./styles.css": "./src/styles.css",
31
+ "./package.json": "./package.json"
32
+ },
33
+ "publishConfig": {
34
+ "registry": "https://registry.npmjs.org/",
35
+ "access": "public"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/gntik-ai/gntik-ui.git",
40
+ "directory": "packages/ui"
41
+ },
42
+ "peerDependencies": {
43
+ "react": "^19.0.0",
44
+ "react-dom": "^19.0.0",
45
+ "react-hook-form": "^7.55.0",
46
+ "zod": "^3.25.0 || ^4.0.0"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "react-hook-form": {
50
+ "optional": true
51
+ },
52
+ "zod": {
53
+ "optional": true
54
+ }
55
+ },
56
+ "dependencies": {
57
+ "@base-ui/react": "^1.8.0",
58
+ "@gntik-ai/tokens": "0.2.1",
59
+ "clsx": "^2.1.1",
60
+ "lucide-react": "^1.48.0",
61
+ "tailwind-merge": "^3.7.0",
62
+ "tailwind-variants": "^3.3.1"
63
+ },
64
+ "devDependencies": {
65
+ "@testing-library/jest-dom": "^7.0.1",
66
+ "@testing-library/react": "^16.3.3",
67
+ "@testing-library/user-event": "^14.6.7",
68
+ "@types/react": "^19.3.0",
69
+ "@types/react-dom": "^19.3.0",
70
+ "axe-core": "^4.13.0",
71
+ "jsdom": "^30.1.1",
72
+ "react": "^19.3.0",
73
+ "react-dom": "^19.3.0",
74
+ "react-hook-form": "^7.89.0",
75
+ "tsdown": "^0.23.0",
76
+ "typescript": "~6.0.3",
77
+ "vitest": "^5.0.2",
78
+ "zod": "^4.6.5"
79
+ },
80
+ "scripts": {
81
+ "build": "tsdown && node scripts/build-theme-bootstrap.mjs",
82
+ "typecheck": "tsc -p tsconfig.json --noEmit",
83
+ "test": "vitest run"
84
+ }
6
85
  }
package/src/styles.css ADDED
@@ -0,0 +1,7 @@
1
+ /* @gntik-ai/ui — import after Tailwind:
2
+ @import "tailwindcss";
3
+ @import "@gntik-ai/ui/styles.css";
4
+ Brings the brand tokens and tells Tailwind v4 to scan the package's
5
+ compiled output, so component classes are generated in the app's CSS. */
6
+ @import "@gntik-ai/tokens/tailwind.css";
7
+ @source "../dist";
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.