@appkits-ai/ui 0.1.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.
Files changed (82) hide show
  1. package/README.md +51 -0
  2. package/dist/components/badge.d.ts +17 -0
  3. package/dist/components/badge.d.ts.map +1 -0
  4. package/dist/components/badge.js +25 -0
  5. package/dist/components/button.d.ts +18 -0
  6. package/dist/components/button.d.ts.map +1 -0
  7. package/dist/components/button.js +36 -0
  8. package/dist/components/card.d.ts +35 -0
  9. package/dist/components/card.d.ts.map +1 -0
  10. package/dist/components/card.js +45 -0
  11. package/dist/components/checkbox.d.ts +7 -0
  12. package/dist/components/checkbox.d.ts.map +1 -0
  13. package/dist/components/checkbox.js +20 -0
  14. package/dist/components/context-menu.d.ts +71 -0
  15. package/dist/components/context-menu.d.ts.map +1 -0
  16. package/dist/components/context-menu.js +100 -0
  17. package/dist/components/dialog.d.ts +46 -0
  18. package/dist/components/dialog.d.ts.map +1 -0
  19. package/dist/components/dialog.js +70 -0
  20. package/dist/components/input.d.ts +11 -0
  21. package/dist/components/input.d.ts.map +1 -0
  22. package/dist/components/input.js +9 -0
  23. package/dist/components/label.d.ts +8 -0
  24. package/dist/components/label.d.ts.map +1 -0
  25. package/dist/components/label.js +15 -0
  26. package/dist/components/notifications.d.ts +5 -0
  27. package/dist/components/notifications.d.ts.map +1 -0
  28. package/dist/components/notifications.js +22 -0
  29. package/dist/components/scroll-area.d.ts +12 -0
  30. package/dist/components/scroll-area.d.ts.map +1 -0
  31. package/dist/components/scroll-area.js +23 -0
  32. package/dist/components/select.d.ts +46 -0
  33. package/dist/components/select.d.ts.map +1 -0
  34. package/dist/components/select.js +72 -0
  35. package/dist/components/switch.d.ts +8 -0
  36. package/dist/components/switch.d.ts.map +1 -0
  37. package/dist/components/switch.js +15 -0
  38. package/dist/components/tabs.d.ts +20 -0
  39. package/dist/components/tabs.d.ts.map +1 -0
  40. package/dist/components/tabs.js +33 -0
  41. package/dist/components/theme-provider.d.ts +8 -0
  42. package/dist/components/theme-provider.d.ts.map +1 -0
  43. package/dist/components/theme-provider.js +14 -0
  44. package/dist/components/tooltip.d.ts +8 -0
  45. package/dist/components/tooltip.d.ts.map +1 -0
  46. package/dist/components/tooltip.js +15 -0
  47. package/dist/components/transfer-status-panel.d.ts +34 -0
  48. package/dist/components/transfer-status-panel.d.ts.map +1 -0
  49. package/dist/components/transfer-status-panel.js +41 -0
  50. package/dist/components/upload-conflict-dialog.d.ts +16 -0
  51. package/dist/components/upload-conflict-dialog.d.ts.map +1 -0
  52. package/dist/components/upload-conflict-dialog.js +24 -0
  53. package/dist/components/upload-drop-overlay.d.ts +15 -0
  54. package/dist/components/upload-drop-overlay.d.ts.map +1 -0
  55. package/dist/components/upload-drop-overlay.js +30 -0
  56. package/dist/hooks/index.d.ts +6 -0
  57. package/dist/hooks/index.d.ts.map +1 -0
  58. package/dist/hooks/index.js +5 -0
  59. package/dist/hooks/use-chain-settings.d.ts +43 -0
  60. package/dist/hooks/use-chain-settings.d.ts.map +1 -0
  61. package/dist/hooks/use-chain-settings.js +313 -0
  62. package/dist/hooks/use-global-dialog.d.ts +28 -0
  63. package/dist/hooks/use-global-dialog.d.ts.map +1 -0
  64. package/dist/hooks/use-global-dialog.js +80 -0
  65. package/dist/hooks/use-sub-app-context-menu.d.ts +5 -0
  66. package/dist/hooks/use-sub-app-context-menu.d.ts.map +1 -0
  67. package/dist/hooks/use-sub-app-context-menu.js +37 -0
  68. package/dist/hooks/use-theme-sync.d.ts +5 -0
  69. package/dist/hooks/use-theme-sync.d.ts.map +1 -0
  70. package/dist/hooks/use-theme-sync.js +36 -0
  71. package/dist/index.d.ts +26 -0
  72. package/dist/index.d.ts.map +1 -0
  73. package/dist/index.js +25 -0
  74. package/dist/lib/notify.d.ts +21 -0
  75. package/dist/lib/notify.d.ts.map +1 -0
  76. package/dist/lib/notify.js +81 -0
  77. package/dist/lib/utils.d.ts +10 -0
  78. package/dist/lib/utils.d.ts.map +1 -0
  79. package/dist/lib/utils.js +12 -0
  80. package/package.json +79 -0
  81. package/postcss.config.mjs +6 -0
  82. package/src/styles/globals.css +182 -0
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Defines the notify source module for the ui package.
3
+ * @module ui-package
4
+ */
5
+ import { toast } from "sonner";
6
+ import * as appkits from "@appkits-ai/sdk/client";
7
+ /**
8
+ * Implements notify behavior.
9
+ */
10
+ export function notify(title, body, optionsOrAction) {
11
+ // Basic compatibility: if 3rd arg is action object (has label), treat as options with action
12
+ let options = {};
13
+ if (optionsOrAction) {
14
+ if ("label" in optionsOrAction && !("action" in optionsOrAction)) {
15
+ options = { action: optionsOrAction };
16
+ }
17
+ else {
18
+ options = optionsOrAction;
19
+ }
20
+ }
21
+ const { type = "default", action, duration, icon } = options;
22
+ // Check if running in iframe (Desktop OS mode)
23
+ const isIframe = typeof window !== "undefined" && appkits.isInsideAppKits();
24
+ const id = options.id || crypto.randomUUID();
25
+ if (isIframe) {
26
+ void appkits.Notification.show({
27
+ id,
28
+ title,
29
+ body,
30
+ variant: type,
31
+ duration,
32
+ action: action
33
+ ? {
34
+ label: action.label,
35
+ url: action.url,
36
+ }
37
+ : undefined,
38
+ });
39
+ }
40
+ else {
41
+ // Show Local Toast
42
+ const toastFn = type === "success"
43
+ ? toast.success
44
+ : type === "error"
45
+ ? toast.error
46
+ : type === "loading"
47
+ ? toast.loading
48
+ : type === "info"
49
+ ? toast.info
50
+ : toast;
51
+ toastFn(title, {
52
+ id,
53
+ description: body,
54
+ duration,
55
+ icon,
56
+ action: action
57
+ ? {
58
+ label: action.label,
59
+ onClick: action.onClick ||
60
+ (() => {
61
+ if (action.url)
62
+ window.open(action.url, "_blank");
63
+ }),
64
+ }
65
+ : undefined,
66
+ });
67
+ }
68
+ return id;
69
+ }
70
+ /**
71
+ * Implements dismiss behavior.
72
+ */
73
+ export function dismiss(id) {
74
+ const isIframe = typeof window !== "undefined" && appkits.isInsideAppKits();
75
+ if (isIframe) {
76
+ void appkits.Notification.dismiss(id);
77
+ }
78
+ else {
79
+ toast.dismiss(id);
80
+ }
81
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Defines the utils source module for the ui package.
3
+ * @module ui-package
4
+ */
5
+ import { type ClassValue } from "clsx";
6
+ /**
7
+ * Implements cn behavior.
8
+ */
9
+ export declare function cn(...inputs: ClassValue[]): string;
10
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C;;GAEG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Defines the utils source module for the ui package.
3
+ * @module ui-package
4
+ */
5
+ import { clsx } from "clsx";
6
+ import { twMerge } from "tailwind-merge";
7
+ /**
8
+ * Implements cn behavior.
9
+ */
10
+ export function cn(...inputs) {
11
+ return twMerge(clsx(inputs));
12
+ }
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@appkits-ai/ui",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "private": false,
6
+ "dependencies": {
7
+ "@radix-ui/react-context-menu": "^2.2.16",
8
+ "@radix-ui/react-dialog": "^1.1.15",
9
+ "@radix-ui/react-label": "^2.1.8",
10
+ "@radix-ui/react-scroll-area": "^1.2.10",
11
+ "@radix-ui/react-select": "^2.2.6",
12
+ "@radix-ui/react-slot": "^1.2.3",
13
+ "@radix-ui/react-switch": "^1.2.6",
14
+ "@radix-ui/react-tabs": "^1.1.13",
15
+ "@radix-ui/react-tooltip": "^1.2.8",
16
+ "class-variance-authority": "^0.7.1",
17
+ "clsx": "^2.1.1",
18
+ "lucide-react": "^0.562.0",
19
+ "next-themes": "^0.4.6",
20
+ "react": "^19.2.6",
21
+ "react-dom": "^19.2.6",
22
+ "sonner": "^2.0.7",
23
+ "tailwind-merge": "^3.4.0",
24
+ "tw-animate-css": "^1.4.0",
25
+ "zod": "^3.22.4",
26
+ "viem": "^2.43.2",
27
+ "zustand": "^5.0.9",
28
+ "@appkits-ai/sdk": "0.1.0"
29
+ },
30
+ "devDependencies": {
31
+ "@tailwindcss/postcss": "^4.1.17",
32
+ "@turbo/gen": "^1.1.1",
33
+ "@types/node": "^20.19.25",
34
+ "@types/react": "^19.2.7",
35
+ "@types/react-dom": "^19.2.3",
36
+ "eslint": "^9.39.1",
37
+ "tailwindcss": "^4.1.17",
38
+ "typescript": "^5.9.3",
39
+ "@workspace/typescript-config": "0.0.0",
40
+ "@appkits-ai/eslint-config": "0.1.0"
41
+ },
42
+ "main": "./dist/index.js",
43
+ "types": "./dist/index.d.ts",
44
+ "files": [
45
+ "dist",
46
+ "src/styles/globals.css",
47
+ "postcss.config.mjs",
48
+ "README.md"
49
+ ],
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "exports": {
54
+ ".": {
55
+ "types": "./dist/index.d.ts",
56
+ "import": "./dist/index.js"
57
+ },
58
+ "./globals.css": "./src/styles/globals.css",
59
+ "./postcss.config": "./postcss.config.mjs",
60
+ "./lib/*": {
61
+ "types": "./dist/lib/*.d.ts",
62
+ "import": "./dist/lib/*.js"
63
+ },
64
+ "./components/*": {
65
+ "types": "./dist/components/*.d.ts",
66
+ "import": "./dist/components/*.js"
67
+ },
68
+ "./hooks/*": {
69
+ "types": "./dist/hooks/*.d.ts",
70
+ "import": "./dist/hooks/*.js"
71
+ },
72
+ "./package.json": "./package.json"
73
+ },
74
+ "scripts": {
75
+ "build": "pnpm lint && rm -rf dist && tsc -p tsconfig.build.json",
76
+ "typecheck": "tsc -p tsconfig.json --noEmit",
77
+ "lint": "eslint . --max-warnings 0"
78
+ }
79
+ }
@@ -0,0 +1,6 @@
1
+ /** @type {import('postcss-load-config').Config} */
2
+ const config = {
3
+ plugins: { "@tailwindcss/postcss": {} },
4
+ };
5
+
6
+ export default config;
@@ -0,0 +1,182 @@
1
+ @import "tailwindcss";
2
+ @import "tw-animate-css";
3
+
4
+ @source "../../../apps/**/*.{ts,tsx}";
5
+ @source "../../../components/**/*.{ts,tsx}";
6
+ @source "../**/*.{ts,tsx}";
7
+
8
+ @custom-variant dark (&:is(.dark *));
9
+
10
+ :root {
11
+ --background: oklch(1 0 0);
12
+ --foreground: oklch(0.145 0 0);
13
+ --card: oklch(1 0 0);
14
+ --card-foreground: oklch(0.145 0 0);
15
+ --popover: oklch(1 0 0);
16
+ --popover-foreground: oklch(0.145 0 0);
17
+ --primary: oklch(0.205 0 0);
18
+ --primary-foreground: oklch(0.985 0 0);
19
+ --secondary: oklch(0.97 0 0);
20
+ --secondary-foreground: oklch(0.205 0 0);
21
+ --muted: oklch(0.97 0 0);
22
+ --muted-foreground: oklch(0.556 0 0);
23
+ --accent: oklch(0.97 0 0);
24
+ --accent-foreground: oklch(0.205 0 0);
25
+ --destructive: oklch(0.577 0.245 27.325);
26
+ --destructive-foreground: oklch(0.577 0.245 27.325);
27
+ --border: oklch(0.922 0 0);
28
+ --input: oklch(0.922 0 0);
29
+ --ring: oklch(0.708 0 0);
30
+ --chart-1: oklch(0.646 0.222 41.116);
31
+ --chart-2: oklch(0.6 0.118 184.704);
32
+ --chart-3: oklch(0.398 0.07 227.392);
33
+ --chart-4: oklch(0.828 0.189 84.429);
34
+ --chart-5: oklch(0.769 0.188 70.08);
35
+ --radius: 0.625rem;
36
+ --sidebar: oklch(0.985 0 0);
37
+ --sidebar-foreground: oklch(0.145 0 0);
38
+ --sidebar-primary: oklch(0.205 0 0);
39
+ --sidebar-primary-foreground: oklch(0.985 0 0);
40
+ --sidebar-accent: oklch(0.97 0 0);
41
+ --sidebar-accent-foreground: oklch(0.205 0 0);
42
+ --sidebar-border: oklch(0.922 0 0);
43
+ --sidebar-ring: oklch(0.708 0 0);
44
+ }
45
+
46
+ .dark {
47
+ --background: oklch(0.145 0 0);
48
+ --foreground: oklch(0.985 0 0);
49
+ --card: oklch(0.145 0 0);
50
+ --card-foreground: oklch(0.985 0 0);
51
+ --popover: oklch(0.145 0 0);
52
+ --popover-foreground: oklch(0.985 0 0);
53
+ --primary: oklch(0.985 0 0);
54
+ --primary-foreground: oklch(0.205 0 0);
55
+ --secondary: oklch(0.269 0 0);
56
+ --secondary-foreground: oklch(0.985 0 0);
57
+ --muted: oklch(0.269 0 0);
58
+ --muted-foreground: oklch(0.708 0 0);
59
+ --accent: oklch(0.269 0 0);
60
+ --accent-foreground: oklch(0.985 0 0);
61
+ --destructive: oklch(0.396 0.141 25.723);
62
+ --destructive-foreground: oklch(0.637 0.237 25.331);
63
+ --border: oklch(0.269 0 0);
64
+ --input: oklch(0.269 0 0);
65
+ --ring: oklch(0.556 0 0);
66
+ --chart-1: oklch(0.488 0.243 264.376);
67
+ --chart-2: oklch(0.696 0.17 162.48);
68
+ --chart-3: oklch(0.769 0.188 70.08);
69
+ --chart-4: oklch(0.627 0.265 303.9);
70
+ --chart-5: oklch(0.645 0.246 16.439);
71
+ --sidebar: oklch(0.205 0 0);
72
+ --sidebar-foreground: oklch(0.985 0 0);
73
+ --sidebar-primary: oklch(0.488 0.243 264.376);
74
+ --sidebar-primary-foreground: oklch(0.985 0 0);
75
+ --sidebar-accent: oklch(0.269 0 0);
76
+ --sidebar-accent-foreground: oklch(0.985 0 0);
77
+ --sidebar-border: oklch(0.269 0 0);
78
+ --sidebar-ring: oklch(0.439 0 0);
79
+ }
80
+
81
+ @theme inline {
82
+ --color-background: var(--background);
83
+ --color-foreground: var(--foreground);
84
+ --color-card: var(--card);
85
+ --color-card-foreground: var(--card-foreground);
86
+ --color-popover: var(--popover);
87
+ --color-popover-foreground: var(--popover-foreground);
88
+ --color-primary: var(--primary);
89
+ --color-primary-foreground: var(--primary-foreground);
90
+ --color-secondary: var(--secondary);
91
+ --color-secondary-foreground: var(--secondary-foreground);
92
+ --color-muted: var(--muted);
93
+ --color-muted-foreground: var(--muted-foreground);
94
+ --color-accent: var(--accent);
95
+ --color-accent-foreground: var(--accent-foreground);
96
+ --color-destructive: var(--destructive);
97
+ --color-destructive-foreground: var(--destructive-foreground);
98
+ --color-border: var(--border);
99
+ --color-input: var(--input);
100
+ --color-ring: var(--ring);
101
+ --color-chart-1: var(--chart-1);
102
+ --color-chart-2: var(--chart-2);
103
+ --color-chart-3: var(--chart-3);
104
+ --color-chart-4: var(--chart-4);
105
+ --color-chart-5: var(--chart-5);
106
+ --radius-sm: calc(var(--radius) - 4px);
107
+ --radius-md: calc(var(--radius) - 2px);
108
+ --radius-lg: var(--radius);
109
+ --radius-xl: calc(var(--radius) + 4px);
110
+ --color-sidebar: var(--sidebar);
111
+ --color-sidebar-foreground: var(--sidebar-foreground);
112
+ --color-sidebar-primary: var(--sidebar-primary);
113
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
114
+ --color-sidebar-accent: var(--sidebar-accent);
115
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
116
+ --color-sidebar-border: var(--sidebar-border);
117
+ --color-sidebar-ring: var(--sidebar-ring);
118
+ }
119
+
120
+ @layer base {
121
+ * {
122
+ @apply border-border outline-ring/50;
123
+ }
124
+
125
+ ::selection {
126
+ background: transparent;
127
+ color: inherit;
128
+ }
129
+
130
+ body {
131
+ @apply bg-background text-foreground;
132
+ }
133
+ }
134
+
135
+ /* Custom Scrollbar */
136
+ ::-webkit-scrollbar {
137
+ width: 10px;
138
+ height: 10px;
139
+ }
140
+
141
+ ::-webkit-scrollbar-track {
142
+ background: transparent;
143
+ }
144
+
145
+ ::-webkit-scrollbar-thumb {
146
+ background: color-mix(in srgb, var(--muted-foreground), transparent 50%);
147
+ border-radius: 5px;
148
+ border: 2px solid transparent;
149
+ background-clip: content-box;
150
+ }
151
+
152
+ ::-webkit-scrollbar-thumb:hover {
153
+ background: var(--muted-foreground);
154
+ border: 2px solid transparent;
155
+ background-clip: content-box;
156
+ }
157
+
158
+ ::-webkit-scrollbar-corner {
159
+ background: transparent;
160
+ }
161
+
162
+ /* For Firefox */
163
+ * {
164
+ scrollbar-width: thin;
165
+ scrollbar-color: color-mix(in srgb, var(--muted-foreground), transparent 50%) transparent;
166
+ }
167
+
168
+ @layer utilities {
169
+ .animate-spin-slow {
170
+ animation: spin-slow 120s linear infinite;
171
+ }
172
+ }
173
+
174
+ @keyframes spin-slow {
175
+ from {
176
+ transform: rotate(0deg);
177
+ }
178
+
179
+ to {
180
+ transform: rotate(360deg);
181
+ }
182
+ }