@smart-cloud/ai-kit-ui 1.5.2 → 1.5.4

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.
@@ -26,4 +26,4 @@ export type ShadowBoundaryProps = {
26
26
  shadowRoot: ShadowRoot;
27
27
  }) => React.ReactNode;
28
28
  };
29
- export declare function ShadowBoundary({ stylesheets, children, rootElementId, mode, overlayRootId, setHost, }: ShadowBoundaryProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare function ShadowBoundary({ stylesheets, children, rootElementId, mode, overlayRootId, setHost, }: ShadowBoundaryProps): import("react").JSX.Element;
@@ -2,4 +2,4 @@ export declare function AiFeatureBorder({ enabled, working, variation, children,
2
2
  enabled?: boolean;
3
3
  working?: boolean;
4
4
  variation?: string;
5
- }>): import("react/jsx-runtime").JSX.Element;
5
+ }>): import("react").JSX.Element;
@@ -10,4 +10,4 @@ export type ProofreadDiffProps = {
10
10
  original: string;
11
11
  corrections: Correction[];
12
12
  };
13
- export declare function ProofreadDiff({ original, corrections }: ProofreadDiffProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function ProofreadDiff({ original, corrections }: ProofreadDiffProps): import("react").JSX.Element;
@@ -49,6 +49,11 @@
49
49
  /* Useful “bridge” vars */
50
50
  --ai-kit-button-padding-x: var(--button-padding-x, 12px);
51
51
  --ai-kit-input-padding-x: var(--input-padding-x, 12px);
52
+ --ai-kit-action-transition:
53
+ background-color 160ms ease, border-color 160ms ease, color 160ms ease,
54
+ box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
55
+ --ai-kit-action-focus-ring: var(--mantine-primary-color-filled, #1c7ed6);
56
+ --ai-kit-action-disabled-opacity: 0.6;
52
57
 
53
58
  /* ---------------------------
54
59
  1) Semantic color tokens
@@ -359,6 +364,31 @@
359
364
  min-width: var(--ai-kit-actions-button-min-width, 140px);
360
365
  }
361
366
 
367
+ /* Leave action colors to Mantine's resolved primary palette and the shared
368
+ WP Suite Theme CSS; this layer only standardizes interaction states. */
369
+ .ai-feature-root .mantine-Button-root,
370
+ .doc-search-root .mantine-Button-root,
371
+ .ai-docs-ask .mantine-Button-root,
372
+ .ai-docs-ask .mantine-ActionIcon-root {
373
+ transition: var(--ai-kit-action-transition);
374
+ }
375
+
376
+ .ai-feature-root .mantine-Button-root:focus-visible,
377
+ .doc-search-root .mantine-Button-root:focus-visible,
378
+ .ai-docs-ask .mantine-Button-root:focus-visible,
379
+ .ai-docs-ask .mantine-ActionIcon-root:focus-visible {
380
+ outline: 2px solid var(--ai-kit-action-focus-ring);
381
+ outline-offset: 2px;
382
+ }
383
+
384
+ .ai-feature-root .mantine-Button-root:disabled,
385
+ .doc-search-root .mantine-Button-root:disabled,
386
+ .ai-docs-ask .mantine-Button-root:disabled,
387
+ .ai-docs-ask .mantine-ActionIcon-root:disabled {
388
+ cursor: not-allowed;
389
+ opacity: var(--ai-kit-action-disabled-opacity);
390
+ }
391
+
362
392
  @media (max-width: var(--ai-kit-actions-breakpoint, 520px)) {
363
393
  .ai-kit-actions {
364
394
  flex-direction: column;
@@ -463,10 +493,7 @@
463
493
  gap: 2px;
464
494
 
465
495
  box-shadow: var(--ai-kit-launcher-shadow);
466
- transition:
467
- transform 0.2s ease,
468
- box-shadow 0.2s ease,
469
- background 0.2s ease;
496
+ transition: var(--ai-kit-action-transition);
470
497
 
471
498
  padding: var(--ai-kit-space-3);
472
499
  pointer-events: auto;
@@ -0,0 +1,21 @@
1
+ export type AiRunErrorKind = "cancelled" | "human-verification" | "authorization" | "throttled" | "validation" | "network" | "server" | "general";
2
+ export type AiRunErrorDetails = {
3
+ kind: AiRunErrorKind;
4
+ status?: number;
5
+ code?: string;
6
+ safeMessage?: string;
7
+ requestId?: string;
8
+ };
9
+ export type AiRunErrorFeedback = {
10
+ message: string | null;
11
+ details: AiRunErrorDetails | null;
12
+ };
13
+ export declare function isAiRunAbort(error: unknown): boolean;
14
+ export declare function normalizeAiRunError(error: unknown): AiRunErrorDetails;
15
+ export declare function getAiRunErrorMessage(details: AiRunErrorDetails, translate?: (message: string) => string): string;
16
+ export declare function clearAiRunErrorFeedback(): AiRunErrorFeedback;
17
+ export declare function createAiRunErrorFeedback(error: unknown, translate?: (message: string) => string): AiRunErrorFeedback;
18
+ export declare class AiRunError extends Error {
19
+ readonly details: AiRunErrorDetails;
20
+ constructor(details: AiRunErrorDetails, message?: string, options?: ErrorOptions);
21
+ }