@theaiplatform/miniapp-sdk 0.0.1 → 0.1.0-dev.5264044

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.
@@ -1,112 +0,0 @@
1
- /**
2
- * @capability shared-infra
3
- *
4
- * Tailwind v4 theme contract for miniapps that already use Tailwind. The
5
- * public SDK rewrites the sibling theme import when it copies this file.
6
- */
7
- @import './theme.css';
8
-
9
- @custom-variant dark (&:where(.dark, .dark *));
10
-
11
- @theme inline {
12
- --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
13
- --font-mono: 'Chivo Mono', ui-monospace, SFMono-Regular, monospace;
14
- --color-background: var(--background);
15
- --color-foreground: var(--foreground);
16
- --color-card: var(--card);
17
- --color-card-foreground: var(--card-foreground);
18
- --color-popover: var(--popover);
19
- --color-popover-foreground: var(--popover-foreground);
20
- --color-popover-accent: var(--popover-accent);
21
- --color-tooltip-chrome: var(--tooltip-chrome);
22
- --color-tooltip-chrome-foreground: var(--tooltip-chrome-foreground);
23
- --color-primary: var(--primary);
24
- --color-primary-foreground: var(--primary-foreground);
25
- --color-primary-hover: var(--primary-hover);
26
- --color-primary-accent: var(--primary-accent);
27
- --color-primary-accent-foreground: var(--primary-accent-foreground);
28
- --color-secondary: var(--secondary);
29
- --color-secondary-foreground: var(--secondary-foreground);
30
- --color-secondary-hover: var(--secondary-hover);
31
- --color-muted: var(--muted);
32
- --color-muted-foreground: var(--muted-foreground);
33
- --color-accent: var(--accent);
34
- --color-accent-foreground: var(--accent-foreground);
35
- --color-destructive: var(--destructive);
36
- --color-destructive-foreground: var(--destructive-foreground);
37
- --color-destructive-hover: var(--destructive-hover);
38
- --color-destructive-accent: var(--destructive-accent);
39
- --color-destructive-accent-foreground: var(--destructive-accent-foreground);
40
- --color-warning: var(--warning);
41
- --color-warning-foreground: var(--warning-foreground);
42
- --color-warning-accent: var(--warning-accent);
43
- --color-warning-accent-foreground: var(--warning-accent-foreground);
44
- --color-success: var(--success);
45
- --color-success-foreground: var(--success-foreground);
46
- --color-success-accent: var(--success-accent);
47
- --color-success-accent-foreground: var(--success-accent-foreground);
48
- --color-info: var(--info);
49
- --color-info-foreground: var(--info-foreground);
50
- --color-info-accent: var(--info-accent);
51
- --color-info-accent-foreground: var(--info-accent-foreground);
52
- --color-border: var(--border);
53
- --color-border-focus: var(--border-focus);
54
- --color-border-error: var(--border-error);
55
- --color-input: var(--input);
56
- --color-input-background: var(--input-background);
57
- --color-input-border-focus: var(--input-border-focus);
58
- --color-input-border-error: var(--input-border-error);
59
- --color-ring: var(--ring);
60
- --color-ring-focus: var(--ring-focus);
61
- --color-text-secondary: var(--text-secondary);
62
- --color-text-tertiary: var(--text-tertiary);
63
- --color-text-subheader: var(--text-subheader);
64
- --color-text-contrast: var(--text-contrast);
65
- --color-interactive-default: var(--interactive-default);
66
- --color-interactive-hover: var(--interactive-hover);
67
- --color-interactive-active: var(--interactive-active);
68
- --color-interactive-focus: var(--interactive-focus);
69
- --color-interactive-card-hover: var(--interactive-card-hover);
70
- --color-surface-border-1: var(--surface-border-1);
71
- --color-surface-border-2: var(--surface-border-2);
72
- --color-surface-level-1: var(--surface-level-1);
73
- --color-surface-level-1-border: var(--surface-level-1-border);
74
- --color-surface-level-2: var(--surface-level-2);
75
- --color-surface-level-minus-1: var(--surface-level-minus-1);
76
- --color-surface-tag: var(--surface-tag);
77
- --color-workspace-divider: var(--workspace-divider);
78
- --color-sidebar: var(--sidebar);
79
- --color-sidebar-foreground: var(--sidebar-foreground);
80
- --color-sidebar-primary: var(--sidebar-primary);
81
- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
82
- --color-sidebar-accent: var(--sidebar-accent);
83
- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
84
- --color-sidebar-border: var(--sidebar-border);
85
- --color-sidebar-ring: var(--sidebar-ring);
86
- --color-sidebar-surface: var(--sidebar-surface);
87
- --color-button-tertiary-default: var(--button-tertiary-default);
88
- --color-button-tertiary-hover: var(--button-tertiary-hover);
89
- --color-button-borderless-default: var(--button-borderless-default);
90
- --color-button-borderless-hover: var(--button-borderless-hover);
91
- --color-button-borderless-active: var(--button-borderless-active);
92
- --color-icon-active: var(--icon-active);
93
- --color-icon-secondary: var(--icon-secondary);
94
- --radius-lg: var(--radius);
95
- --radius-md: calc(var(--radius) - 2px);
96
- --radius-sm: calc(var(--radius) - 4px);
97
- --shadow-surface-sm: var(--shadow-surface-sm-value);
98
- --shadow-surface-md: var(--shadow-surface-md-value);
99
- --shadow-popover: var(--shadow-popover-value);
100
- --shadow-button-primary: var(--shadow-button-primary-value);
101
- --shadow-button-secondary: var(--shadow-button-secondary-value);
102
- --shadow-button-secondary-hover: var(--shadow-button-secondary-hover-value);
103
- --shadow-button-outline: var(--shadow-button-outline-value);
104
- --shadow-button-outline-hover: var(--shadow-button-outline-hover-value);
105
- --shadow-input-rest: var(--shadow-input-rest-value);
106
- --shadow-input-focus: var(--shadow-input-focus-value);
107
- --z-popover: 200;
108
- --z-modal: 200;
109
- --z-tooltip: 250;
110
- }
111
-
112
- @source '../ui.js';
package/dist/ui/theme.css DELETED
@@ -1,335 +0,0 @@
1
- /**
2
- * @capability shared-infra
3
- *
4
- * Theme contract for portable miniapps rendered in an isolated frame. Keep
5
- * these values aligned with apps/tauri/src/globals.css. The frame owns layout;
6
- * this file only supplies the platform design tokens and browser defaults.
7
- */
8
-
9
- :root {
10
- color-scheme: light;
11
- --app-font-size: 16px;
12
-
13
- --background: hsl(0 0% 100%);
14
- --foreground: hsl(240 3.7% 15.9%);
15
- --card: oklch(1 0 0);
16
- --card-foreground: var(--foreground);
17
- --popover: hsl(0 0% 100%);
18
- --popover-foreground: var(--foreground);
19
- --popover-accent: hsl(240 4.8% 95.9%);
20
- --tooltip-chrome: hsl(240 3.7% 15.9%);
21
- --tooltip-chrome-foreground: hsl(0 0% 100%);
22
-
23
- --primary: #155dfc;
24
- --primary-foreground: hsl(0 0% 100%);
25
- --primary-hover: #1447e6;
26
- --primary-accent: hsl(214 100% 97%);
27
- --primary-accent-foreground: hsl(221 83% 53%);
28
- --secondary: hsl(0 0% 100%);
29
- --secondary-foreground: hsl(240 5.9% 10%);
30
- --secondary-hover: hsl(240 4.8% 95.9%);
31
- --muted: hsl(240 4.9% 96.1%);
32
- --muted-foreground: hsl(240 3.8% 46.1%);
33
- --accent: hsl(240 4.8% 95.9%);
34
- --accent-foreground: hsl(240 5.9% 10%);
35
-
36
- --destructive: hsl(0 72% 51%);
37
- --destructive-foreground: hsl(0 0% 100%);
38
- --destructive-hover: hsl(0 84% 60%);
39
- --destructive-accent: hsl(0 84.2% 95%);
40
- --destructive-accent-foreground: var(--destructive);
41
- --warning: oklch(75% 0.15 90);
42
- --warning-foreground: oklch(30% 0.08 85);
43
- --warning-accent: oklch(95% 0.02 90);
44
- --warning-accent-foreground: var(--warning);
45
- --success: oklch(69.59% 0.0596 162.48);
46
- --success-foreground: oklch(37.8% 0.0292 168.94);
47
- --success-accent: oklch(95% 0.02 162);
48
- --success-accent-foreground: var(--success);
49
- --info: oklch(70% 0.15 200);
50
- --info-foreground: oklch(20% 0.05 200);
51
- --info-accent: oklch(95% 0.02 200);
52
- --info-accent-foreground: var(--info);
53
-
54
- --border: hsl(240 5.9% 90%);
55
- --border-focus: hsl(221 83% 53%);
56
- --border-error: var(--destructive);
57
- --input: hsl(240 5.9% 90%);
58
- --input-background: hsl(0 0% 100%);
59
- --input-border-focus: hsl(221 83% 53%);
60
- --input-border-error: var(--destructive);
61
- --ring: hsl(221 83% 53%);
62
- --ring-focus: rgb(147 197 253 / 50%);
63
-
64
- --text-secondary: rgb(9 9 11 / 64%);
65
- --text-tertiary: rgb(9 9 11 / 48%);
66
- --text-subheader: rgb(9 9 11 / 88%);
67
- --text-contrast: hsl(0 0% 100%);
68
- --interactive-default: transparent;
69
- --interactive-hover: rgb(9 9 11 / 6%);
70
- --interactive-active: rgb(9 9 11 / 10%);
71
- --interactive-focus: rgb(147 197 253 / 50%);
72
- --interactive-card-hover: hsl(0 0% 98%);
73
-
74
- --surface-border-1: rgb(9 9 11 / 8%);
75
- --surface-border-2: rgb(9 9 11 / 12%);
76
- --workspace-divider: rgb(9 9 11 / 6%);
77
- --surface-level-1: #fafafa;
78
- --surface-level-1-border: transparent;
79
- --surface-level-2: hsl(0 0% 100%);
80
- --surface-level-minus-1: rgb(9 9 11 / 4%);
81
- --surface-tag: rgb(9 9 11 / 6%);
82
-
83
- --sidebar: hsl(240 4.8% 95.9%);
84
- --sidebar-foreground: hsl(240 5.9% 10%);
85
- --sidebar-primary: hsl(240 5.9% 10%);
86
- --sidebar-primary-foreground: hsl(0 0% 98%);
87
- --sidebar-accent: hsl(240 5.9% 90%);
88
- --sidebar-accent-foreground: hsl(240 5.9% 10%);
89
- --sidebar-border: hsl(240 5.9% 90%);
90
- --sidebar-ring: hsl(240 5.9% 90%);
91
- --sidebar-surface: rgb(255 255 255 / 82%);
92
-
93
- --button-tertiary-default: rgb(9 9 11 / 6%);
94
- --button-tertiary-hover: hsl(240 4.9% 83.9%);
95
- --button-borderless-default: transparent;
96
- --button-borderless-hover: rgb(9 9 11 / 8%);
97
- --button-borderless-active: hsl(214 95% 93%);
98
- --icon-active: hsl(221 83% 53%);
99
- --icon-secondary: hsl(240 3.8% 46.1%);
100
-
101
- --radius: 0.5rem;
102
- --z-popover: 200;
103
- --z-modal: 200;
104
- --z-tooltip: 250;
105
- --scrollbar-thumb: rgb(9 9 11 / 22%);
106
- --scrollbar-thumb-hover: rgb(9 9 11 / 34%);
107
-
108
- --shadow-surface-sm-value:
109
- 0 0 0 1px rgb(9 9 11 / 8%), 0 2px 4px -1px rgb(9 9 11 / 8%),
110
- 0 1px 2px rgb(9 9 11 / 7%);
111
- --shadow-surface-md-value:
112
- 0 0 0 1px rgb(9 9 11 / 8%), 0 3px 6px -1px rgb(9 9 11 / 12%),
113
- 0 1px 3px rgb(9 9 11 / 8%);
114
- --shadow-popover-value:
115
- 0 0 0 1px rgb(9 9 11 / 8%), 0 4px 6px -1px rgb(9 9 11 / 12%),
116
- 0 2px 4px -2px rgb(9 9 11 / 12%);
117
- --shadow-button-primary-value: inset 0 2px 0 rgb(255 255 255 / 16%);
118
- --shadow-button-secondary-value:
119
- 0 0 0 1px rgb(9 9 11 / 12%), 0 2px 4px -1.5px rgb(9 9 11 / 16%);
120
- --shadow-button-secondary-hover-value:
121
- 0 0 0 1px rgb(9 9 11 / 24%), 0 3px 6px -1px rgb(9 9 11 / 12%),
122
- 0 1px 3px rgb(9 9 11 / 8%);
123
- --shadow-button-outline-value: inset 0 0 0 1px var(--input);
124
- --shadow-button-outline-hover-value: inset 0 0 0 1px var(--border);
125
- --shadow-input-rest-value: var(--shadow-surface-sm-value);
126
- --shadow-input-focus-value:
127
- 0 0 0 3px var(--ring-focus), 0 1px 2px rgb(9 9 11 / 6%);
128
- }
129
-
130
- :root.dark,
131
- :root[data-theme='dark'] {
132
- color-scheme: dark;
133
-
134
- --background: oklch(21.03% 0.0023 285.89);
135
- --foreground: oklch(98.48% 0 0);
136
- --card: hsl(240 4.2% 18.8%);
137
- --card-foreground: var(--foreground);
138
- --popover: hsl(240 4.2% 18.8%);
139
- --popover-foreground: var(--foreground);
140
- --popover-accent: oklch(24.48% 0.0023 285.98);
141
- --tooltip-chrome: hsl(0 0% 100%);
142
- --tooltip-chrome-foreground: hsl(240 3.7% 15.9%);
143
-
144
- --primary-foreground: hsl(0 0% 100%);
145
- --primary-accent: hsl(224 64% 33%);
146
- --primary-accent-foreground: var(--foreground);
147
- --secondary: hsl(240 4.4% 21.4%);
148
- --secondary-foreground: var(--foreground);
149
- --secondary-hover: hsl(240 5.3% 26.1%);
150
- --muted: oklch(24.48% 0.0023 285.98);
151
- --muted-foreground: oklch(71.19% 0.0051 286.07);
152
- --accent: oklch(30.27% 0.0071 285.97);
153
- --accent-foreground: var(--foreground);
154
-
155
- --destructive-accent: oklch(30% 0.03 15);
156
- --warning-accent: oklch(30% 0.08 85);
157
- --success: oklch(50.81% 0.042 165.61);
158
- --success-foreground: var(--foreground);
159
- --success-accent: oklch(30% 0.03 165);
160
- --info: oklch(65% 0.12 200);
161
- --info-foreground: var(--foreground);
162
- --info-accent: oklch(30% 0.03 200);
163
-
164
- --border: rgb(255 255 255 / 16%);
165
- --input: oklch(30.27% 0.0071 285.97);
166
- --input-background: #3f3f46;
167
- --ring-focus: rgb(29 78 216 / 60%);
168
-
169
- --text-secondary: rgb(250 250 250 / 64%);
170
- --text-tertiary: rgb(250 250 250 / 48%);
171
- --text-subheader: rgb(255 255 255 / 88%);
172
- --interactive-hover: rgb(255 255 255 / 10%);
173
- --interactive-active: rgb(255 255 255 / 20%);
174
- --interactive-focus: rgb(29 78 216 / 60%);
175
- --interactive-card-hover: hsl(240 3.7% 15.9%);
176
-
177
- --surface-border-1: rgb(255 255 255 / 8%);
178
- --surface-border-2: rgb(255 255 255 / 12%);
179
- --workspace-divider: rgb(255 255 255 / 4.5%);
180
- --surface-level-1: hsl(240 5% 8%);
181
- --surface-level-1-border: rgb(255 255 255 / 16%);
182
- --surface-level-2: hsl(240 4.2% 18.8%);
183
- --surface-level-minus-1: #09090b;
184
- --surface-tag: rgb(255 255 255 / 8%);
185
-
186
- --sidebar: var(--surface-level-minus-1);
187
- --sidebar-foreground: var(--foreground);
188
- --sidebar-primary: var(--foreground);
189
- --sidebar-primary-foreground: hsl(240 5.9% 10%);
190
- --sidebar-accent: oklch(24.48% 0.0023 285.98);
191
- --sidebar-accent-foreground: var(--foreground);
192
- --sidebar-border: oklch(37.05% 0.0048 285.8);
193
- --sidebar-ring: oklch(37.05% 0.0048 285.8);
194
- --sidebar-surface: rgb(0 0 0 / 70%);
195
-
196
- --button-tertiary-default: rgb(255 255 255 / 8%);
197
- --button-tertiary-hover: rgb(255 255 255 / 22%);
198
- --button-borderless-default: transparent;
199
- --button-borderless-hover: rgb(255 255 255 / 12%);
200
- --button-borderless-active: hsl(224 64% 33%);
201
- --scrollbar-thumb: rgb(255 255 255 / 24%);
202
- --scrollbar-thumb-hover: rgb(255 255 255 / 36%);
203
-
204
- --shadow-surface-sm-value:
205
- 0 2px 4px rgb(9 9 11 / 8%), 0 1px 2px rgb(9 9 11 / 7%),
206
- inset 0 0 0 1px rgb(255 255 255 / 6%);
207
- --shadow-surface-md-value:
208
- 0 4px 8px -2px rgb(9 9 11 / 16%), 0 2px 4px rgb(9 9 11 / 12%),
209
- inset 0 0 0 1px rgb(255 255 255 / 8%);
210
- --shadow-popover-value:
211
- 0 1px 4px rgb(9 9 11 / 24%), inset 0 0 0 1px rgb(255 255 255 / 6%);
212
- --shadow-button-secondary-value:
213
- 0 0 0 1px rgb(9 9 11 / 32%), 0 2px 4px -1.5px rgb(9 9 11 / 16%),
214
- inset 0 1px 0 rgb(255 255 255 / 16%);
215
- --shadow-button-secondary-hover-value:
216
- inset 0 0 0 1px rgb(255 255 255 / 5%), 0 3px 6px rgb(9 9 11 / 54%),
217
- 0 1px 3px rgb(9 9 11 / 40%);
218
- --shadow-input-rest-value: inset 0 0 0 0.5px var(--border);
219
- --shadow-input-focus-value:
220
- 0 0 0 3px var(--ring-focus), 0 1px 2px rgb(0 0 0 / 20%);
221
- }
222
-
223
- /* Match the platform base layer so uncolored shared borders use the token. */
224
- @layer base {
225
- *,
226
- ::before,
227
- ::after {
228
- border-color: var(--border);
229
- }
230
- }
231
-
232
- /* Shared Button's primary treatment relies on this platform utility. */
233
- .btn-primary-shine {
234
- position: relative;
235
- overflow: hidden;
236
- }
237
-
238
- .btn-primary-shine::before {
239
- position: absolute;
240
- inset: 0;
241
- border-radius: inherit;
242
- background: linear-gradient(180deg, rgb(255 255 255 / 48%), transparent);
243
- content: '';
244
- mix-blend-mode: overlay;
245
- pointer-events: none;
246
- }
247
-
248
- .btn-primary-shine:hover::before {
249
- background: linear-gradient(180deg, rgb(255 255 255 / 32%), transparent);
250
- }
251
-
252
- .btn-primary-shine:active::before {
253
- display: none;
254
- }
255
-
256
- .code-block-light {
257
- display: block;
258
- }
259
-
260
- .code-block-dark {
261
- display: none;
262
- }
263
-
264
- .dark .code-block-light {
265
- display: none;
266
- }
267
-
268
- .dark .code-block-dark {
269
- display: block;
270
- }
271
-
272
- /* Browser-safe document defaults for isolated miniapp surfaces. */
273
- *,
274
- ::before,
275
- ::after {
276
- box-sizing: border-box;
277
- }
278
-
279
- [hidden] {
280
- display: none !important;
281
- }
282
-
283
- html {
284
- font-size: var(--app-font-size);
285
- }
286
-
287
- body {
288
- margin: 0;
289
- background: var(--background);
290
- color: var(--foreground);
291
- font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
292
- }
293
-
294
- button:not(:disabled),
295
- [role='button']:not([aria-disabled='true']) {
296
- cursor: pointer;
297
- touch-action: manipulation;
298
- }
299
-
300
- ::selection {
301
- background: color-mix(in srgb, var(--primary) 25%, transparent);
302
- }
303
-
304
- * {
305
- scrollbar-color: var(--scrollbar-thumb) transparent;
306
- scrollbar-width: thin;
307
- }
308
-
309
- *::-webkit-scrollbar {
310
- width: 8px;
311
- height: 8px;
312
- }
313
-
314
- *::-webkit-scrollbar-thumb {
315
- border: 2px solid transparent;
316
- border-radius: 9999px;
317
- background: var(--scrollbar-thumb);
318
- background-clip: padding-box;
319
- }
320
-
321
- *::-webkit-scrollbar-thumb:hover {
322
- background: var(--scrollbar-thumb-hover);
323
- background-clip: padding-box;
324
- }
325
-
326
- @media (prefers-reduced-motion: reduce) {
327
- *,
328
- *::before,
329
- *::after {
330
- scroll-behavior: auto !important;
331
- animation-duration: 0.01ms !important;
332
- animation-iteration-count: 1 !important;
333
- transition-duration: 0.01ms !important;
334
- }
335
- }