@alfadocs/ui-kit-debug 1.44.0 → 1.45.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.
- package/dist/_chunks/ai-sparkle-DXeP_6a0.js +52 -0
- package/dist/_chunks/ai-sparkle-DXeP_6a0.js.map +1 -0
- package/dist/_chunks/{calendar-workspace-DBYAtdyd.js → calendar-workspace-B7KvZ1_D.js} +2 -2
- package/dist/_chunks/{calendar-workspace-DBYAtdyd.js.map → calendar-workspace-B7KvZ1_D.js.map} +1 -1
- package/dist/_chunks/{notes-panel-CY4KmDo-.js → notes-panel-Dkk9QPPX.js} +2 -2
- package/dist/_chunks/{notes-panel-CY4KmDo-.js.map → notes-panel-Dkk9QPPX.js.map} +1 -1
- package/dist/_chunks/{rich-text-editor-BYE6kK4u.js → rich-text-editor-BrAvNajV.js} +1207 -1267
- package/dist/_chunks/rich-text-editor-BrAvNajV.js.map +1 -0
- package/dist/_chunks/use-ai-sparkle-CyQSRTCe.js +103 -0
- package/dist/_chunks/use-ai-sparkle-CyQSRTCe.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/ai-sparkle/ai-sparkle.d.ts +24 -0
- package/dist/components/ai-sparkle/ai-sparkle.d.ts.map +1 -0
- package/dist/components/ai-sparkle/index.d.ts +3 -0
- package/dist/components/ai-sparkle/index.d.ts.map +1 -0
- package/dist/components/ai-sparkle/index.js +5 -0
- package/dist/components/ai-sparkle/index.js.map +1 -0
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +64 -56
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-ai-sparkle.d.ts +109 -0
- package/dist/hooks/use-ai-sparkle.d.ts.map +1 -0
- package/dist/index.js +1106 -1102
- package/dist/index.js.map +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/package.json +1 -1
- package/dist/_chunks/rich-text-editor-BYE6kK4u.js.map +0 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/** Where the sparkle is: on first show, while an action runs, as it lands. */
|
|
2
|
+
export type AiSparkleState = 'intro' | 'working' | 'landed';
|
|
3
|
+
export declare const SHIMMER_CLASS: Record<AiSparkleState, string>;
|
|
4
|
+
export declare const COMET_CLASS: Record<AiSparkleState, string>;
|
|
5
|
+
export declare const BURST_CLASS: Record<AiSparkleState, string>;
|
|
6
|
+
export declare const SPARKLE_GLYPHS: readonly [{
|
|
7
|
+
readonly key: "start";
|
|
8
|
+
readonly className: "ds:absolute ds:opacity-0 ds:text-[color:var(--ai-sparkle)] ds:fill-current ds:drop-shadow-[0_0_var(--spacing-2xs)_var(--ai-sparkle)] ds:[animation-delay:calc(var(--animation-duration)*(var(--sparkle-base)+var(--sparkle-stagger)))] ds:[--sparkle-stagger:0] ds:size-3 ds:[inset-block-start:calc(var(--spacing-xs)*-1)] ds:[inset-inline-start:calc(var(--spacing-2xs)*-1)]";
|
|
9
|
+
}, {
|
|
10
|
+
readonly key: "top";
|
|
11
|
+
readonly className: "ds:absolute ds:opacity-0 ds:text-[color:var(--ai-sparkle)] ds:fill-current ds:drop-shadow-[0_0_var(--spacing-2xs)_var(--ai-sparkle)] ds:[animation-delay:calc(var(--animation-duration)*(var(--sparkle-base)+var(--sparkle-stagger)))] ds:[--sparkle-stagger:0.5] ds:size-4 ds:[inset-block-start:calc(var(--spacing-sm)*-1)] ds:[inset-inline-start:40%]";
|
|
12
|
+
}, {
|
|
13
|
+
readonly key: "end";
|
|
14
|
+
readonly className: "ds:absolute ds:opacity-0 ds:text-[color:var(--ai-sparkle)] ds:fill-current ds:drop-shadow-[0_0_var(--spacing-2xs)_var(--ai-sparkle)] ds:[animation-delay:calc(var(--animation-duration)*(var(--sparkle-base)+var(--sparkle-stagger)))] ds:[--sparkle-stagger:1] ds:size-3 ds:[inset-block-start:calc(var(--spacing-xs)*-1)] ds:[inset-inline-end:var(--spacing-md)]";
|
|
15
|
+
}, {
|
|
16
|
+
readonly key: "side";
|
|
17
|
+
readonly className: "ds:absolute ds:opacity-0 ds:text-[color:var(--ai-sparkle)] ds:fill-current ds:drop-shadow-[0_0_var(--spacing-2xs)_var(--ai-sparkle)] ds:[animation-delay:calc(var(--animation-duration)*(var(--sparkle-base)+var(--sparkle-stagger)))] ds:[--sparkle-stagger:1.5] ds:size-2 ds:[inset-block-start:40%] ds:[inset-inline-end:calc(var(--spacing-sm)*-1)]";
|
|
18
|
+
}, {
|
|
19
|
+
readonly key: "below";
|
|
20
|
+
readonly className: "ds:absolute ds:opacity-0 ds:text-[color:var(--ai-sparkle)] ds:fill-current ds:drop-shadow-[0_0_var(--spacing-2xs)_var(--ai-sparkle)] ds:[animation-delay:calc(var(--animation-duration)*(var(--sparkle-base)+var(--sparkle-stagger)))] ds:[--sparkle-stagger:2] ds:size-3 ds:[inset-block-end:calc(var(--spacing-xs)*-1)] ds:[inset-inline-start:25%]";
|
|
21
|
+
}];
|
|
22
|
+
export declare const COMET_WRAPPER_CLASS = "ds:pointer-events-none ds:absolute ds:[inset-block-start:0] ds:[inset-inline-start:0] ds:opacity-0 ds:[offset-path:inset(0_round_var(--radius-full))] ds:[offset-rotate:0deg]";
|
|
23
|
+
export declare const COMET_TAIL: readonly [{
|
|
24
|
+
readonly key: 1;
|
|
25
|
+
readonly lag: "ds:[animation-delay:calc(var(--animation-duration)*0.2)]";
|
|
26
|
+
readonly dot: "ds:size-2.5 ds:opacity-[var(--opacity-90)]";
|
|
27
|
+
}, {
|
|
28
|
+
readonly key: 2;
|
|
29
|
+
readonly lag: "ds:[animation-delay:calc(var(--animation-duration)*0.4)]";
|
|
30
|
+
readonly dot: "ds:size-2 ds:opacity-[var(--opacity-70)]";
|
|
31
|
+
}, {
|
|
32
|
+
readonly key: 3;
|
|
33
|
+
readonly lag: "ds:[animation-delay:calc(var(--animation-duration)*0.6)]";
|
|
34
|
+
readonly dot: "ds:size-2 ds:opacity-[var(--opacity-50)]";
|
|
35
|
+
}, {
|
|
36
|
+
readonly key: 4;
|
|
37
|
+
readonly lag: "ds:[animation-delay:calc(var(--animation-duration)*0.8)]";
|
|
38
|
+
readonly dot: "ds:size-1.5 ds:opacity-[var(--opacity-30)]";
|
|
39
|
+
}, {
|
|
40
|
+
readonly key: 5;
|
|
41
|
+
readonly lag: "ds:[animation-delay:calc(var(--animation-duration)*1)]";
|
|
42
|
+
readonly dot: "ds:size-1.5 ds:opacity-[var(--opacity-20)]";
|
|
43
|
+
}, {
|
|
44
|
+
readonly key: 6;
|
|
45
|
+
readonly lag: "ds:[animation-delay:calc(var(--animation-duration)*1.2)]";
|
|
46
|
+
readonly dot: "ds:size-1 ds:opacity-[var(--opacity-10)]";
|
|
47
|
+
}];
|
|
48
|
+
export interface UseAiSparkleOptions {
|
|
49
|
+
/**
|
|
50
|
+
* Whether the sparkle is available at all. Read once, at mount, to seed
|
|
51
|
+
* the initial `'intro'` phase — matches how the RichTextEditor's
|
|
52
|
+
* `aiSparkle` prop only ever gated the very first render. Default `true`.
|
|
53
|
+
*/
|
|
54
|
+
enabled?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* `'auto'` (default) reads `prefers-reduced-motion` via
|
|
57
|
+
* `usePrefersReducedMotion`. `'off'` forces full motion regardless of the
|
|
58
|
+
* OS preference — useful for a story that wants to show the animated
|
|
59
|
+
* states side by side with a reduced one.
|
|
60
|
+
*/
|
|
61
|
+
reducedMotion?: 'auto' | 'off';
|
|
62
|
+
}
|
|
63
|
+
export interface UseAiSparkleProps {
|
|
64
|
+
/** Spread (or picked) onto the host element as a pure styling hook. */
|
|
65
|
+
'data-ai-sparkle': AiSparkleState | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The shimmer animation class for the current state — empty when at rest.
|
|
68
|
+
* Layer it over the host's own base positioning classes; the comet and
|
|
69
|
+
* burst layers need real DOM and live in the `AiSparkle` component instead.
|
|
70
|
+
*/
|
|
71
|
+
className: string;
|
|
72
|
+
}
|
|
73
|
+
export interface UseAiSparkleReturn {
|
|
74
|
+
/** `null` at rest — nothing to render for the comet/burst layers either. */
|
|
75
|
+
state: AiSparkleState | null;
|
|
76
|
+
props: UseAiSparkleProps;
|
|
77
|
+
/** An AI action started: swap to the looping `'working'` phase. */
|
|
78
|
+
start: () => void;
|
|
79
|
+
/** An action's result landed: swap to the one-off `'landed'` phase. */
|
|
80
|
+
land: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* Settle after an action ends. Clears back to rest only when still
|
|
83
|
+
* `'working'` (the action errored or was cancelled before `land()`);
|
|
84
|
+
* leaves `'landed'` alone so the one-off animation gets to play out.
|
|
85
|
+
*/
|
|
86
|
+
reset: () => void;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Drives the AI-pill sparkle: lit on first show, looping while an action
|
|
90
|
+
* runs, and a one-off flourish as the result lands.
|
|
91
|
+
*
|
|
92
|
+
* The hook owns the state machine and the timing only — it paints nothing.
|
|
93
|
+
* `props['data-ai-sparkle']` is a plain styling hook for the host element;
|
|
94
|
+
* `props.className` carries the shimmer layer's animation class from the
|
|
95
|
+
* same lookup table the RichTextEditor's pill originally inlined. The
|
|
96
|
+
* comet and burst layers need actual DOM (a tail of dots, five staggered
|
|
97
|
+
* glyphs), so they live in the sibling `AiSparkle` component, keyed off the
|
|
98
|
+
* same `state`.
|
|
99
|
+
*
|
|
100
|
+
* Both `intro` and `landed` are one-off: this hook clears them back to
|
|
101
|
+
* `null` on a timer sized to the comet's lap plus the burst and its
|
|
102
|
+
* stagger, at the default 200ms `--animation-duration`. Under reduced
|
|
103
|
+
* motion (`prefers-reduced-motion` or `reducedMotion: 'auto'`'s system
|
|
104
|
+
* read) the CSS animations already collapse to 0ms, so the clear fires at
|
|
105
|
+
* the next tick instead of waiting out the full lap — the pill still gets
|
|
106
|
+
* its `data-ai-sparkle` attribute for a moment, but nothing visibly moves.
|
|
107
|
+
*/
|
|
108
|
+
export declare function useAiSparkle(options?: UseAiSparkleOptions): UseAiSparkleReturn;
|
|
109
|
+
//# sourceMappingURL=use-ai-sparkle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-ai-sparkle.d.ts","sourceRoot":"","sources":["../../src/hooks/use-ai-sparkle.ts"],"names":[],"mappings":"AASA,8EAA8E;AAC9E,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAa5D,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAOxD,CAAC;AAKF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAOtD,CAAC;AAKF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAOtD,CAAC;AAMF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EAqBjB,CAAC;AAKX,eAAO,MAAM,mBAAmB,kLACiJ,CAAC;AAClL,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;EA+Bb,CAAC;AAMX,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,uEAAuE;IACvE,iBAAiB,EAAE,cAAc,GAAG,SAAS,CAAC;IAC9C;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,iBAAiB,CAAC;IACzB,mEAAmE;IACnE,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,uEAAuE;IACvE,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB;;;;OAIG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,GAAE,mBAAwB,GAChC,kBAAkB,CAgCpB"}
|