@juspay/svelte-ui-components 4.32.1 → 4.33.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.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The shared vocabulary between `ThinkingOrb`'s modes, its painter and its
3
+ * gravity pass. A mode never touches a canvas directly -- it only ever
4
+ * describes one instant as a `Frame`, so it stays a pure, testable function
5
+ * of `(t, ctx)` with nothing environment-specific to mock.
6
+ */
7
+ export {};
@@ -0,0 +1,68 @@
1
+ import type { Rgb } from '../types';
2
+ import type { GravityOptions } from './orb/gravity';
3
+ import type { ModeSize } from './orb/types';
4
+ export type { GravityOptions };
5
+ /**
6
+ * The nine animations `ThinkingOrb` can play. Full descriptions of each are
7
+ * in docs/ThinkingOrb.md.
8
+ */
9
+ export type OrbState = 'working' | 'searching' | 'solving' | 'listening' | 'connecting' | 'weaving' | 'composing' | 'breathing' | 'shaping';
10
+ /** The three fixed canvas sizes `ThinkingOrb` can draw at, in CSS pixels. */
11
+ export type ThinkingOrbSize = ModeSize;
12
+ export type MandatoryThinkingOrbProperties = Record<string, never>;
13
+ export type OptionalThinkingOrbProperties = {
14
+ /**
15
+ * Which animation to show.
16
+ * - `working` — dots travel in short trails along six differently tilted loops around the centre, each loop at its own pace
17
+ * - `searching` — a bright band sweeps around a speckled sphere, running from top to bottom while it goes, and brightens whichever dots it passes over
18
+ * - `solving` — four horizontal bands each turn a quarter-turn out of place, one after another, hold there a moment, then straighten out again starting from the last one that turned, looping the whole way through
19
+ * - `listening` — a wave of brightness rises through a stack of rings, swelling the dots in whichever ring it currently reaches
20
+ * - `connecting` — a small scattering of nodes across a sphere, linked to their closest neighbours, with small bright dots travelling along those links
21
+ * - `weaving` — three spiral strands wrap around a sphere end to end, swinging into and out of each other's path so they appear to cross as it spins
22
+ * - `composing` — a broad ribbon of dots, fading out at its edges, ripples like fabric while the whole thing turns
23
+ * - `breathing` — a single ring of dots slowly swells and settles on a steady cycle, its edge never quite resting
24
+ * - `shaping` — a ring of dots gradually reshapes itself, rounding out and pulling into a triangle, then a square, before smoothing back to round, on a repeating loop
25
+ * @default 'working'
26
+ */
27
+ state?: OrbState;
28
+ /** How big the canvas is, in CSS pixels. Only 64, 32 and 20 have real artwork; any other number falls back to `64`. @default 64 */
29
+ size?: ThinkingOrbSize;
30
+ /** Multiplies how fast the animation's own clock advances: `1` is normal pace, `2` is double speed, `0` holds it still. @default 1 */
31
+ speed?: number;
32
+ /** Stops the animation and leaves whatever frame was last drawn on screen. @default false */
33
+ paused?: boolean;
34
+ /**
35
+ * Sets the colour the dots and lines are drawn in. Left unset, the orb
36
+ * reads `--sui-thinking-orb-color`, falls back to the inherited CSS
37
+ * `color`, and finally to a mid-grey if neither resolves to something the
38
+ * canvas can use.
39
+ */
40
+ color?: Rgb;
41
+ /**
42
+ * Scales how many dots (or strands, or nodes, depending on the state) an
43
+ * animation draws. Anything below `0.1` is treated as `0.1`. @default 1
44
+ */
45
+ dots?: number;
46
+ /** Scales the size of every dot the animation draws. Anything below `0.1` is treated as `0.1`. @default 1 */
47
+ dotSize?: number;
48
+ /**
49
+ * While the pointer sits over the canvas, dots near it get pulled toward
50
+ * it — scoped to this instance's own canvas only. `true` uses the built-in
51
+ * reach and pull; pass a `GravityOptions` object to set your own
52
+ * `radius`/`strength`. Purely decorative, and deliberately has no
53
+ * keyboard equivalent — see docs/ThinkingOrb.md's Accessibility section.
54
+ * @default false
55
+ */
56
+ gravity?: boolean | GravityOptions;
57
+ /** Replaces the default label generated for the current state. See docs/ThinkingOrb.md's Accessibility section. */
58
+ ariaLabel?: string;
59
+ /** Extra CSS class names added to the canvas element. */
60
+ classes?: string;
61
+ /** Sets the `data-pw` attribute on the canvas, so tests can select it. */
62
+ testId?: string;
63
+ };
64
+ export type ThinkingOrbEventProperties = {
65
+ /** Called exactly once, right after the first frame is actually painted — this happens after mount, not at the same moment. */
66
+ onfirstframe?: () => void;
67
+ };
68
+ export type ThinkingOrbProperties = OptionalThinkingOrbProperties & ThinkingOrbEventProperties;
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -55,6 +55,7 @@ export { default as Calendar } from './Calendar/Calendar.svelte';
55
55
  export { default as RelativeTime } from './RelativeTime/RelativeTime.svelte';
56
56
  export { default as ThemeSwitcher } from './ThemeSwitcher/ThemeSwitcher.svelte';
57
57
  export { default as ThinkingIndicator } from './ThinkingIndicator/ThinkingIndicator.svelte';
58
+ export { default as ThinkingOrb } from './ThinkingOrb/ThinkingOrb.svelte';
58
59
  export { default as ToolCallLog } from './ToolCallLog/ToolCallLog.svelte';
59
60
  export { default as TaskList } from './TaskList/TaskList.svelte';
60
61
  export { default as Book } from './Book/Book.svelte';
@@ -166,6 +167,7 @@ export type * from './Calendar/properties';
166
167
  export type * from './RelativeTime/properties';
167
168
  export type * from './ThemeSwitcher/properties';
168
169
  export type * from './ThinkingIndicator/properties';
170
+ export type * from './ThinkingOrb/properties';
169
171
  export type * from './ToolCallLog/properties';
170
172
  export type * from './TaskList/properties';
171
173
  export type * from './SoundKit/properties';
package/dist/index.js CHANGED
@@ -55,6 +55,7 @@ export { default as Calendar } from './Calendar/Calendar.svelte';
55
55
  export { default as RelativeTime } from './RelativeTime/RelativeTime.svelte';
56
56
  export { default as ThemeSwitcher } from './ThemeSwitcher/ThemeSwitcher.svelte';
57
57
  export { default as ThinkingIndicator } from './ThinkingIndicator/ThinkingIndicator.svelte';
58
+ export { default as ThinkingOrb } from './ThinkingOrb/ThinkingOrb.svelte';
58
59
  export { default as ToolCallLog } from './ToolCallLog/ToolCallLog.svelte';
59
60
  export { default as TaskList } from './TaskList/TaskList.svelte';
60
61
  export { default as Book } from './Book/Book.svelte';
@@ -17,7 +17,7 @@
17
17
  * stylesheet is a crutch for the migration window, not a permanent override.
18
18
  */
19
19
 
20
- /* components whose new default is `block` (87) */
20
+ /* components whose new default is `block` (88) */
21
21
  sui-accordion { --sui-accordion-display: inline; }
22
22
  sui-area-chart { --sui-area-chart-display: inline; }
23
23
  sui-aspect-ratio { --sui-aspect-ratio-display: inline; }
@@ -98,6 +98,7 @@ sui-table { --sui-table-display: inline; }
98
98
  sui-tabs { --sui-tabs-display: inline; }
99
99
  sui-task-list { --sui-task-list-display: inline; }
100
100
  sui-thinking-indicator { --sui-thinking-indicator-display: inline; }
101
+ sui-thinking-orb { --sui-thinking-orb-display: inline; }
101
102
  sui-toast { --sui-toast-display: inline; }
102
103
  sui-toggle { --sui-toggle-display: inline; }
103
104
  sui-tool-call-log { --sui-tool-call-log-display: inline; }
@@ -459,6 +459,11 @@
459
459
  "property": "--sui-thinking-indicator-display",
460
460
  "default": "block"
461
461
  },
462
+ {
463
+ "tag": "sui-thinking-orb",
464
+ "property": "--sui-thinking-orb-display",
465
+ "default": "block"
466
+ },
462
467
  {
463
468
  "tag": "sui-toast",
464
469
  "property": "--sui-toast-display",