@iota-uz/sdk 0.3.0 → 0.3.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.
@@ -108,6 +108,9 @@
108
108
  --bichat-color-text-muted: var(--bichat-color-gray-500);
109
109
  --bichat-color-text-disabled: var(--bichat-color-gray-400);
110
110
  --bichat-color-text-inverse: #ffffff;
111
+ --bichat-color-code-text: var(--bichat-color-gray-800);
112
+ --bichat-color-code-bg: var(--bichat-color-gray-100);
113
+ --bichat-color-text-icon: var(--bichat-color-gray-500);
111
114
 
112
115
  --bichat-color-border: var(--bichat-color-gray-200);
113
116
  --bichat-color-border-subtle: var(--bichat-color-gray-100);
@@ -181,7 +184,7 @@
181
184
  /* Semantic radius aliases */
182
185
  --bichat-radius-bubble: var(--bichat-radius-2xl);
183
186
  --bichat-radius-bubble-tail: var(--bichat-radius-sm);
184
- --bichat-radius-button: var(--bichat-radius-md);
187
+ --bichat-radius-button: var(--bichat-radius-lg);
185
188
  --bichat-radius-input: var(--bichat-radius-lg);
186
189
  --bichat-radius-card: var(--bichat-radius-xl);
187
190
  --bichat-radius-modal: var(--bichat-radius-2xl);
@@ -198,10 +201,12 @@
198
201
  --bichat-shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
199
202
  --bichat-shadow-none: 0 0 #0000;
200
203
 
201
- /* Focus ring */
204
+ /* Focus ring (WCAG 2.4.7 Focus Visible - high contrast for keyboard users) */
202
205
  --bichat-ring-width: 2px;
203
206
  --bichat-ring-offset: 2px;
204
- --bichat-ring-color: rgba(59, 130, 246, 0.5);
207
+ --bichat-ring-color: var(--bichat-color-primary-500);
208
+ --bichat-focus-ring: 0 0 0 var(--bichat-ring-width) var(--bichat-ring-color);
209
+ --bichat-focus-ring-offset: 0 0 0 var(--bichat-ring-offset) var(--bichat-color-surface);
205
210
 
206
211
  /* -------------------------------------------------------------------------
207
212
  Transitions & Animation
@@ -271,6 +276,9 @@
271
276
  --bichat-color-text-secondary: var(--bichat-color-gray-300);
272
277
  --bichat-color-text-muted: var(--bichat-color-gray-400);
273
278
  --bichat-color-text-disabled: var(--bichat-color-gray-500);
279
+ --bichat-color-code-text: var(--bichat-color-gray-200);
280
+ --bichat-color-code-bg: var(--bichat-color-gray-800);
281
+ --bichat-color-text-icon: var(--bichat-color-gray-400);
274
282
 
275
283
  --bichat-color-border: var(--bichat-color-gray-700);
276
284
  --bichat-color-border-subtle: var(--bichat-color-gray-800);
@@ -299,44 +307,6 @@
299
307
  --bichat-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
300
308
  }
301
309
 
302
- /* System preference dark mode */
303
- @media (prefers-color-scheme: dark) {
304
- :root:not([data-theme="light"]) {
305
- --bichat-color-bg: var(--bichat-color-gray-900);
306
- --bichat-color-bg-subtle: var(--bichat-color-gray-800);
307
- --bichat-color-bg-muted: var(--bichat-color-gray-700);
308
-
309
- --bichat-color-surface: var(--bichat-color-gray-800);
310
- --bichat-color-surface-raised: var(--bichat-color-gray-750, #2d3748);
311
- --bichat-color-surface-overlay: rgba(31, 41, 55, 0.9);
312
-
313
- --bichat-color-text: var(--bichat-color-gray-100);
314
- --bichat-color-text-secondary: var(--bichat-color-gray-300);
315
- --bichat-color-text-muted: var(--bichat-color-gray-400);
316
- --bichat-color-text-disabled: var(--bichat-color-gray-500);
317
-
318
- --bichat-color-border: var(--bichat-color-gray-700);
319
- --bichat-color-border-subtle: var(--bichat-color-gray-800);
320
- --bichat-color-border-strong: var(--bichat-color-gray-600);
321
-
322
- --bichat-color-accent-muted: var(--bichat-color-primary-900);
323
-
324
- --bichat-color-user-bubble-bg: var(--bichat-color-primary-700);
325
- --bichat-color-assistant-bubble-bg: var(--bichat-color-gray-800);
326
- --bichat-color-assistant-bubble-border: var(--bichat-color-gray-700);
327
- --bichat-color-system-bubble-bg: var(--bichat-color-gray-800);
328
-
329
- --bichat-color-input-bg: var(--bichat-color-gray-800);
330
- --bichat-color-input-border: var(--bichat-color-gray-700);
331
-
332
- /* Legacy compatibility */
333
- --bichat-bg: var(--bichat-color-bg);
334
- --bichat-text: var(--bichat-color-text);
335
- --bichat-border: var(--bichat-color-border);
336
- --bichat-bubble-assistant: var(--bichat-color-assistant-bubble-bg);
337
- }
338
- }
339
-
340
310
  /* =============================================================================
341
311
  Base Styles
342
312
  ============================================================================= */
@@ -351,6 +321,73 @@
351
321
  -moz-osx-font-smoothing: grayscale;
352
322
  }
353
323
 
324
+ /* Buttons and button-like elements: pointer cursor; disabled: not-allowed
325
+ :host is required when styles are injected into the applet shadow root (bi-chat-root) */
326
+ :host button,
327
+ :host [role="button"],
328
+ :host [role="tab"],
329
+ .bichat-session button,
330
+ .bichat-session [role="button"],
331
+ .bichat-session [role="tab"],
332
+ bi-chat-root button,
333
+ bi-chat-root [role="button"],
334
+ bi-chat-root [role="tab"] {
335
+ cursor: pointer;
336
+ }
337
+ :host button:disabled,
338
+ :host [role="button"][aria-disabled="true"],
339
+ .bichat-session button:disabled,
340
+ .bichat-session [role="button"][aria-disabled="true"],
341
+ bi-chat-root button:disabled,
342
+ bi-chat-root [role="button"][aria-disabled="true"] {
343
+ cursor: not-allowed;
344
+ }
345
+
346
+ /* Focus visible: high-contrast focus rings for keyboard navigation (WCAG 2.4.7) */
347
+ .bichat-session button:focus-visible,
348
+ .bichat-session a:focus-visible,
349
+ .bichat-session input:focus-visible,
350
+ .bichat-session textarea:focus-visible,
351
+ .bichat-session [role="button"]:focus-visible,
352
+ .bichat-session [role="menuitem"]:focus-visible,
353
+ .bichat-session [role="tab"]:focus-visible,
354
+ .bichat-session select:focus-visible,
355
+ .bichat-session [tabindex]:not([tabindex="-1"]):focus-visible,
356
+ bi-chat-root button:focus-visible,
357
+ bi-chat-root a:focus-visible,
358
+ bi-chat-root input:focus-visible,
359
+ bi-chat-root textarea:focus-visible,
360
+ bi-chat-root [role="button"]:focus-visible,
361
+ bi-chat-root [role="menuitem"]:focus-visible,
362
+ bi-chat-root [role="tab"]:focus-visible,
363
+ bi-chat-root select:focus-visible,
364
+ bi-chat-root [tabindex]:not([tabindex="-1"]):focus-visible {
365
+ outline: none;
366
+ box-shadow: var(--bichat-focus-ring-offset), var(--bichat-focus-ring);
367
+ border-radius: inherit;
368
+ }
369
+
370
+ .dark .bichat-session button:focus-visible,
371
+ .dark .bichat-session a:focus-visible,
372
+ .dark .bichat-session input:focus-visible,
373
+ .dark .bichat-session textarea:focus-visible,
374
+ .dark .bichat-session [role="button"]:focus-visible,
375
+ .dark .bichat-session [role="menuitem"]:focus-visible,
376
+ .dark .bichat-session [role="tab"]:focus-visible,
377
+ .dark .bichat-session select:focus-visible,
378
+ .dark .bichat-session [tabindex]:not([tabindex="-1"]):focus-visible,
379
+ .dark bi-chat-root button:focus-visible,
380
+ .dark bi-chat-root a:focus-visible,
381
+ .dark bi-chat-root input:focus-visible,
382
+ .dark bi-chat-root textarea:focus-visible,
383
+ .dark bi-chat-root [role="button"]:focus-visible,
384
+ .dark bi-chat-root [role="menuitem"]:focus-visible,
385
+ .dark bi-chat-root [role="tab"]:focus-visible,
386
+ .dark bi-chat-root select:focus-visible,
387
+ .dark bi-chat-root [tabindex]:not([tabindex="-1"]):focus-visible {
388
+ --bichat-focus-ring: 0 0 0 var(--bichat-ring-width) var(--bichat-color-primary-400);
389
+ }
390
+
354
391
  /* =============================================================================
355
392
  Scrollbar Styles
356
393
  ============================================================================= */
@@ -453,6 +490,67 @@
453
490
  animation: bichat-slide-up var(--bichat-transition-slow) var(--bichat-ease-out);
454
491
  }
455
492
 
493
+ /* =============================================================================
494
+ Thinking Shimmer Animation
495
+ ============================================================================= */
496
+
497
+ .bichat-thinking-shimmer {
498
+ -webkit-mask-image: linear-gradient(
499
+ -45deg,
500
+ rgba(0, 0, 0, 1) 20%,
501
+ rgba(0, 0, 0, 1) 40%,
502
+ rgba(0, 0, 0, 0.2) 50%,
503
+ rgba(0, 0, 0, 1) 60%,
504
+ rgba(0, 0, 0, 1) 80%
505
+ );
506
+ mask-image: linear-gradient(
507
+ -45deg,
508
+ rgba(0, 0, 0, 1) 20%,
509
+ rgba(0, 0, 0, 1) 40%,
510
+ rgba(0, 0, 0, 0.2) 50%,
511
+ rgba(0, 0, 0, 1) 60%,
512
+ rgba(0, 0, 0, 1) 80%
513
+ );
514
+ -webkit-mask-size: 300% 100%;
515
+ mask-size: 300% 100%;
516
+ animation: bichat-thinking-shimmer 4.5s linear infinite;
517
+ }
518
+
519
+ .dark .bichat-thinking-shimmer {
520
+ -webkit-mask-image: linear-gradient(
521
+ -45deg,
522
+ rgba(0, 0, 0, 1) 15%,
523
+ rgba(0, 0, 0, 1) 35%,
524
+ rgba(0, 0, 0, 0.3) 50%,
525
+ rgba(0, 0, 0, 1) 65%,
526
+ rgba(0, 0, 0, 1) 85%
527
+ );
528
+ mask-image: linear-gradient(
529
+ -45deg,
530
+ rgba(0, 0, 0, 1) 15%,
531
+ rgba(0, 0, 0, 1) 35%,
532
+ rgba(0, 0, 0, 0.3) 50%,
533
+ rgba(0, 0, 0, 1) 65%,
534
+ rgba(0, 0, 0, 1) 85%
535
+ );
536
+ }
537
+
538
+ @media (prefers-reduced-motion: reduce) {
539
+ .bichat-thinking-shimmer,
540
+ .animate-pulse,
541
+ .animate-bounce,
542
+ .animate-spin,
543
+ .animate-fade-in,
544
+ .animate-slide-up {
545
+ animation: none;
546
+ }
547
+ }
548
+
549
+ @keyframes bichat-thinking-shimmer {
550
+ 0% { -webkit-mask-position: 130% 0; mask-position: 130% 0; }
551
+ 100% { -webkit-mask-position: -30% 0; mask-position: -30% 0; }
552
+ }
553
+
456
554
  /* =============================================================================
457
555
  Prose / Markdown Styles
458
556
  ============================================================================= */
@@ -484,11 +582,27 @@
484
582
  line-height: var(--bichat-line-height-tight);
485
583
  }
486
584
 
487
- .prose h1 { font-size: var(--bichat-font-size-2xl); }
488
- .prose h2 { font-size: var(--bichat-font-size-xl); }
489
- .prose h3 { font-size: var(--bichat-font-size-lg); }
585
+ .prose h1 {
586
+ font-size: 1.625rem;
587
+ font-weight: var(--bichat-font-weight-bold);
588
+ }
589
+
590
+ .prose h2 {
591
+ font-size: 1.375rem;
592
+ margin-top: 2em;
593
+ }
594
+
595
+ .prose h3 {
596
+ font-size: var(--bichat-font-size-lg);
597
+ font-weight: var(--bichat-font-weight-semibold);
598
+ }
599
+
490
600
  .prose h4 { font-size: var(--bichat-font-size-base); }
491
601
 
602
+ .prose > * + h2 {
603
+ margin-top: 2em;
604
+ }
605
+
492
606
  .prose p {
493
607
  margin-top: 0.75em;
494
608
  margin-bottom: 0.75em;
@@ -500,16 +614,17 @@
500
614
  }
501
615
 
502
616
  .prose code {
503
- background-color: var(--bichat-color-bg-subtle);
504
- color: var(--bichat-color-text);
505
- padding: 0.125em 0.375em;
506
- border-radius: var(--bichat-radius-default);
617
+ background-color: var(--bichat-color-code-bg);
618
+ color: var(--bichat-color-code-text);
619
+ padding: 0.2em 0.5em;
620
+ border-radius: var(--bichat-radius-md);
621
+ border: 1px solid var(--bichat-color-border-subtle);
507
622
  font-family: var(--bichat-font-family-mono);
508
623
  font-size: 0.875em;
509
624
  }
510
625
 
511
626
  .prose pre {
512
- background-color: var(--bichat-color-gray-900);
627
+ background-color: var(--bichat-color-code-bg);
513
628
  color: var(--bichat-color-gray-100);
514
629
  padding: var(--bichat-spacing-4);
515
630
  border-radius: var(--bichat-radius-lg);
@@ -527,6 +642,7 @@
527
642
  color: inherit;
528
643
  font-size: inherit;
529
644
  border-radius: 0;
645
+ border: none;
530
646
  }
531
647
 
532
648
  .prose a {
@@ -0,0 +1,84 @@
1
+ /**
2
+ * TypeScript type definitions for IOTA SDK Applet Core
3
+ * Matches Go backend types from pkg/applet/types.go
4
+ */
5
+ interface InitialContext {
6
+ user: UserContext;
7
+ tenant: TenantContext;
8
+ locale: LocaleContext;
9
+ config: AppConfig;
10
+ route: RouteContext;
11
+ session: SessionContext;
12
+ error: ErrorContext | null;
13
+ extensions?: Record<string, unknown>;
14
+ }
15
+ interface UserContext {
16
+ id: number;
17
+ email: string;
18
+ firstName: string;
19
+ lastName: string;
20
+ permissions: string[];
21
+ }
22
+ interface TenantContext {
23
+ id: string;
24
+ name: string;
25
+ }
26
+ interface LocaleContext {
27
+ language: string;
28
+ translations: Record<string, string>;
29
+ }
30
+ interface AppConfig {
31
+ graphQLEndpoint?: string;
32
+ streamEndpoint?: string;
33
+ restEndpoint?: string;
34
+ basePath?: string;
35
+ assetsBasePath?: string;
36
+ rpcUIEndpoint?: string;
37
+ shellMode?: 'embedded' | 'standalone';
38
+ }
39
+ interface RouteContext {
40
+ path: string;
41
+ params: Record<string, string>;
42
+ query: Record<string, string>;
43
+ }
44
+ interface SessionContext {
45
+ expiresAt: number;
46
+ refreshURL: string;
47
+ csrfToken: string;
48
+ }
49
+ interface ErrorContext {
50
+ supportEmail?: string;
51
+ debugMode: boolean;
52
+ errorCodes?: Record<string, string>;
53
+ retryConfig?: RetryConfig;
54
+ }
55
+ interface RetryConfig {
56
+ maxAttempts: number;
57
+ backoffMs: number;
58
+ }
59
+ /**
60
+ * Hook return types
61
+ */
62
+ interface TranslationHook {
63
+ t: (key: string, params?: Record<string, unknown>) => string;
64
+ language: string;
65
+ }
66
+ interface PermissionsHook {
67
+ hasPermission: (permission: string) => boolean;
68
+ hasAnyPermission: (...permissions: string[]) => boolean;
69
+ permissions: string[];
70
+ }
71
+ interface SessionHook {
72
+ isExpiringSoon: boolean;
73
+ refreshSession: () => Promise<void>;
74
+ csrfToken: string;
75
+ expiresAt: number;
76
+ }
77
+ interface StreamingHook {
78
+ isStreaming: boolean;
79
+ processStream: <T>(generator: AsyncGenerator<T>, onChunk: (chunk: T) => void, signal?: AbortSignal) => Promise<void>;
80
+ cancel: () => void;
81
+ reset: () => void;
82
+ }
83
+
84
+ export type { AppConfig as A, InitialContext as I, LocaleContext as L, PermissionsHook as P, RouteContext as R, SessionHook as S, TranslationHook as T, UserContext as U, StreamingHook as a, SessionContext as b, TenantContext as c };
@@ -0,0 +1,84 @@
1
+ /**
2
+ * TypeScript type definitions for IOTA SDK Applet Core
3
+ * Matches Go backend types from pkg/applet/types.go
4
+ */
5
+ interface InitialContext {
6
+ user: UserContext;
7
+ tenant: TenantContext;
8
+ locale: LocaleContext;
9
+ config: AppConfig;
10
+ route: RouteContext;
11
+ session: SessionContext;
12
+ error: ErrorContext | null;
13
+ extensions?: Record<string, unknown>;
14
+ }
15
+ interface UserContext {
16
+ id: number;
17
+ email: string;
18
+ firstName: string;
19
+ lastName: string;
20
+ permissions: string[];
21
+ }
22
+ interface TenantContext {
23
+ id: string;
24
+ name: string;
25
+ }
26
+ interface LocaleContext {
27
+ language: string;
28
+ translations: Record<string, string>;
29
+ }
30
+ interface AppConfig {
31
+ graphQLEndpoint?: string;
32
+ streamEndpoint?: string;
33
+ restEndpoint?: string;
34
+ basePath?: string;
35
+ assetsBasePath?: string;
36
+ rpcUIEndpoint?: string;
37
+ shellMode?: 'embedded' | 'standalone';
38
+ }
39
+ interface RouteContext {
40
+ path: string;
41
+ params: Record<string, string>;
42
+ query: Record<string, string>;
43
+ }
44
+ interface SessionContext {
45
+ expiresAt: number;
46
+ refreshURL: string;
47
+ csrfToken: string;
48
+ }
49
+ interface ErrorContext {
50
+ supportEmail?: string;
51
+ debugMode: boolean;
52
+ errorCodes?: Record<string, string>;
53
+ retryConfig?: RetryConfig;
54
+ }
55
+ interface RetryConfig {
56
+ maxAttempts: number;
57
+ backoffMs: number;
58
+ }
59
+ /**
60
+ * Hook return types
61
+ */
62
+ interface TranslationHook {
63
+ t: (key: string, params?: Record<string, unknown>) => string;
64
+ language: string;
65
+ }
66
+ interface PermissionsHook {
67
+ hasPermission: (permission: string) => boolean;
68
+ hasAnyPermission: (...permissions: string[]) => boolean;
69
+ permissions: string[];
70
+ }
71
+ interface SessionHook {
72
+ isExpiringSoon: boolean;
73
+ refreshSession: () => Promise<void>;
74
+ csrfToken: string;
75
+ expiresAt: number;
76
+ }
77
+ interface StreamingHook {
78
+ isStreaming: boolean;
79
+ processStream: <T>(generator: AsyncGenerator<T>, onChunk: (chunk: T) => void, signal?: AbortSignal) => Promise<void>;
80
+ cancel: () => void;
81
+ reset: () => void;
82
+ }
83
+
84
+ export type { AppConfig as A, InitialContext as I, LocaleContext as L, PermissionsHook as P, RouteContext as R, SessionHook as S, TranslationHook as T, UserContext as U, StreamingHook as a, SessionContext as b, TenantContext as c };