@allshift/ui 0.2.0 → 0.3.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/index.cjs +598 -2
- package/dist/index.d.cts +191 -11
- package/dist/index.d.ts +191 -11
- package/dist/index.js +595 -1
- package/package.json +12 -3
- package/styles/shift-canvas.css +67 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default, { ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import { MotionProps } from 'framer-motion';
|
|
4
|
+
import { LucideIcon } from 'lucide-react';
|
|
4
5
|
|
|
5
6
|
interface ShiftCardProps extends MotionProps {
|
|
6
7
|
children: ReactNode;
|
|
@@ -8,9 +9,9 @@ interface ShiftCardProps extends MotionProps {
|
|
|
8
9
|
style?: CSSProperties;
|
|
9
10
|
blur?: number;
|
|
10
11
|
}
|
|
11
|
-
declare function ShiftCard({ children, className, blur, style, ...props }: ShiftCardProps):
|
|
12
|
+
declare function ShiftCard({ children, className, blur, style, ...props }: ShiftCardProps): react.JSX.Element;
|
|
12
13
|
|
|
13
|
-
interface TiltCardProps extends Omit<
|
|
14
|
+
interface TiltCardProps extends Omit<react__default.HTMLAttributes<HTMLDivElement>, keyof MotionProps>, MotionProps {
|
|
14
15
|
/** Spring stiffness for the tilt. Default 300. */
|
|
15
16
|
stiffness?: number;
|
|
16
17
|
/** Spring damping. Default 28. */
|
|
@@ -24,22 +25,22 @@ interface TiltCardProps extends Omit<React__default.HTMLAttributes<HTMLDivElemen
|
|
|
24
25
|
* Drop-in wrapper that adds physics-spring 3-D tilt on mouse move.
|
|
25
26
|
* Renders a `motion.div`; all extra props forwarded.
|
|
26
27
|
*/
|
|
27
|
-
declare function TiltCard({ children, stiffness, damping, maxRotateX, maxRotateY, style, ...rest }: TiltCardProps):
|
|
28
|
+
declare function TiltCard({ children, stiffness, damping, maxRotateX, maxRotateY, style, ...rest }: TiltCardProps): react__default.JSX.Element;
|
|
28
29
|
|
|
29
30
|
interface HolographicShineProps {
|
|
30
31
|
/** RGB triplet for the shine tint, e.g. "0,229,240". Default neutral white. */
|
|
31
32
|
rgb?: string;
|
|
32
33
|
/** Intensity 0–1 of the shine overlay. Default 0.18. */
|
|
33
34
|
intensity?: number;
|
|
34
|
-
children?:
|
|
35
|
+
children?: react__default.ReactNode;
|
|
35
36
|
className?: string;
|
|
36
|
-
style?:
|
|
37
|
+
style?: react__default.CSSProperties;
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
40
|
* Wrapper that paints a cursor-tracked radial holographic shine over its
|
|
40
41
|
* children. Combine with TiltCard for the full effect.
|
|
41
42
|
*/
|
|
42
|
-
declare function HolographicShine({ rgb, intensity, children, className, style, }: HolographicShineProps):
|
|
43
|
+
declare function HolographicShine({ rgb, intensity, children, className, style, }: HolographicShineProps): react__default.JSX.Element;
|
|
43
44
|
|
|
44
45
|
type Phase = "idle" | "skeleton" | "live";
|
|
45
46
|
interface ScrollGenerateCardProps {
|
|
@@ -47,7 +48,7 @@ interface ScrollGenerateCardProps {
|
|
|
47
48
|
* The real card content. Rendered in the "live" phase.
|
|
48
49
|
* Passed the current phase so content can animate itself in.
|
|
49
50
|
*/
|
|
50
|
-
children: (phase: Phase) =>
|
|
51
|
+
children: (phase: Phase) => react__default.ReactNode;
|
|
51
52
|
/**
|
|
52
53
|
* Milliseconds of skeleton phase before switching to live. Default 360.
|
|
53
54
|
*/
|
|
@@ -77,6 +78,185 @@ interface ScrollGenerateCardProps {
|
|
|
77
78
|
* </ScrollGenerateCard>
|
|
78
79
|
* ```
|
|
79
80
|
*/
|
|
80
|
-
declare function ScrollGenerateCard({ children, skeletonDuration, delay, margin, className, skeletonRows, skeletonWidths, }: ScrollGenerateCardProps):
|
|
81
|
+
declare function ScrollGenerateCard({ children, skeletonDuration, delay, margin, className, skeletonRows, skeletonWidths, }: ScrollGenerateCardProps): react__default.JSX.Element;
|
|
81
82
|
|
|
82
|
-
|
|
83
|
+
type Accent = "teal" | "blue" | "purple" | "magenta" | "green" | "orange" | "neutral";
|
|
84
|
+
declare const ACCENT_RGB: Record<Accent, string>;
|
|
85
|
+
|
|
86
|
+
interface LiveCardProps {
|
|
87
|
+
children: React.ReactNode;
|
|
88
|
+
/** Accent color driving shine + top line + glow. Default "neutral" (uses --shift-accent if "brand"). */
|
|
89
|
+
accent?: Accent | "brand";
|
|
90
|
+
/** Enable 3D tilt-on-hover physics. Default true. */
|
|
91
|
+
tilt?: boolean;
|
|
92
|
+
/** Enable holographic cursor shine. Default true. */
|
|
93
|
+
shine?: boolean;
|
|
94
|
+
/** Generate-in lifecycle: skeleton → live. Default true. */
|
|
95
|
+
generate?: boolean;
|
|
96
|
+
/** Stagger order for generate-in (multiplied into enterDelay). */
|
|
97
|
+
index?: number;
|
|
98
|
+
/** Trigger generation on scroll-into-view or immediately. */
|
|
99
|
+
trigger?: "view" | "mount";
|
|
100
|
+
/** Number of shimmer rows in the skeleton phase. */
|
|
101
|
+
skeletonRows?: number;
|
|
102
|
+
/** Lit top accent line when card completes. Default true. */
|
|
103
|
+
topLine?: boolean;
|
|
104
|
+
/** Extra classes on the card surface. */
|
|
105
|
+
className?: string;
|
|
106
|
+
/** Min height to reserve while idle (prevents layout shift). */
|
|
107
|
+
minHeight?: number;
|
|
108
|
+
onClick?: () => void;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* LiveCard — the universal living surface.
|
|
112
|
+
*
|
|
113
|
+
* Combines: glass depth, 3D tilt physics, holographic cursor shine, and the
|
|
114
|
+
* generate-in lifecycle (skeleton → live). Wrap any content in this and it
|
|
115
|
+
* becomes part of the breathing, self-assembling UI. Surface is brand-neutral
|
|
116
|
+
* (`.ash-surface`, driven by --shift-* tokens); accent is decorative or "brand".
|
|
117
|
+
*/
|
|
118
|
+
declare function LiveCard({ children, accent, tilt, shine, generate, index, trigger, skeletonRows, topLine, className, minHeight, onClick, }: LiveCardProps): react.JSX.Element;
|
|
119
|
+
|
|
120
|
+
interface GenerativeViewProps {
|
|
121
|
+
children: React.ReactNode;
|
|
122
|
+
/** Per-child stagger in seconds. Default 0.08. */
|
|
123
|
+
stagger?: number;
|
|
124
|
+
/** Delay before the first child appears (s). */
|
|
125
|
+
delay?: number;
|
|
126
|
+
className?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* GenerativeView — wrap a page's top-level sections and they assemble
|
|
130
|
+
* themselves in sequence on load: each child blurs + lifts into place,
|
|
131
|
+
* giving the "the page is building itself for you" feel everywhere.
|
|
132
|
+
*
|
|
133
|
+
* Use at the page root around section blocks. For data cards that should
|
|
134
|
+
* shimmer→live, use <LiveCard generate /> inside.
|
|
135
|
+
*/
|
|
136
|
+
declare function GenerativeView({ children, stagger, delay, className, }: GenerativeViewProps): react.JSX.Element;
|
|
137
|
+
|
|
138
|
+
interface LiveStatProps {
|
|
139
|
+
label: string;
|
|
140
|
+
/** Numeric value to count up to. Omit for string-only display. */
|
|
141
|
+
value?: number;
|
|
142
|
+
/** Pre-formatted string (overrides count-up). */
|
|
143
|
+
display?: string;
|
|
144
|
+
prefix?: string;
|
|
145
|
+
suffix?: string;
|
|
146
|
+
sub?: string;
|
|
147
|
+
icon?: LucideIcon;
|
|
148
|
+
/** Decorative accent, or "brand" to use --shift-accent-rgb. */
|
|
149
|
+
accent?: Accent | "brand";
|
|
150
|
+
/** Count-up duration ms. */
|
|
151
|
+
duration?: number;
|
|
152
|
+
index?: number;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* LiveStat — a metric tile that counts up on mount with a glass surface and
|
|
156
|
+
* accent top line. The atomic unit of every dashboard / overview header.
|
|
157
|
+
*/
|
|
158
|
+
declare function LiveStat({ label, value, display, prefix, suffix, sub, icon: Icon, accent, duration, index, }: LiveStatProps): react.JSX.Element;
|
|
159
|
+
|
|
160
|
+
type GenPhase = "idle" | "skeleton" | "live";
|
|
161
|
+
interface UseGenerateOptions {
|
|
162
|
+
/** Delay before the skeleton appears (ms). Lets earlier cards generate first. */
|
|
163
|
+
enterDelay?: number;
|
|
164
|
+
/** How long the skeleton shimmer holds before content materializes (ms). */
|
|
165
|
+
skeletonMs?: number;
|
|
166
|
+
/** Trigger on scroll-into-view (default) or immediately on mount. */
|
|
167
|
+
trigger?: "view" | "mount";
|
|
168
|
+
/** IntersectionObserver margin when trigger = "view". */
|
|
169
|
+
margin?: string;
|
|
170
|
+
/** Re-run every time it enters view, instead of once. */
|
|
171
|
+
repeat?: boolean;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The core "generate-in" lifecycle every living card/section shares:
|
|
175
|
+
* idle (reserves layout) → skeleton (shimmer) → live (real content).
|
|
176
|
+
*
|
|
177
|
+
* This is what makes the whole product feel like it is building itself in
|
|
178
|
+
* real time — the same heartbeat on the landing page and inside the app.
|
|
179
|
+
*/
|
|
180
|
+
declare function useGenerate<T extends HTMLElement = HTMLDivElement>(opts?: UseGenerateOptions): {
|
|
181
|
+
ref: react.RefObject<T | null>;
|
|
182
|
+
phase: GenPhase;
|
|
183
|
+
isLive: boolean;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* CanvasTransition — the heart of the "one living canvas" model.
|
|
188
|
+
*
|
|
189
|
+
* The app is not N pages you travel between. It is a single stage. Every
|
|
190
|
+
* route's content is *generated onto the canvas* — the previous view fades
|
|
191
|
+
* out and the requested view assembles itself in real time. The underlying
|
|
192
|
+
* Next.js routes remain as the behind-the-scenes resources the canvas draws
|
|
193
|
+
* from; this wrapper turns each navigation into a generation event.
|
|
194
|
+
*
|
|
195
|
+
* First visit to a view per login session = full generate-in (blur→lift,
|
|
196
|
+
* "Shift is assembling" sheen). Revisits in the same session are instant, so
|
|
197
|
+
* power users aren't slowed down. The seen-set resets on each login, so every
|
|
198
|
+
* session opens with that real-time-building feel.
|
|
199
|
+
*
|
|
200
|
+
* Brand-neutral: the assembling indicator uses the product's --shift-accent.
|
|
201
|
+
*/
|
|
202
|
+
interface CanvasTransitionProps {
|
|
203
|
+
children: React.ReactNode;
|
|
204
|
+
/** Map of first-path-segment → friendly label for the assembling pill. */
|
|
205
|
+
labels?: Record<string, string>;
|
|
206
|
+
/** sessionStorage key for the per-login seen-set. Default "ash-seen-views". */
|
|
207
|
+
seenKey?: string;
|
|
208
|
+
/** Product name shown in the pill, e.g. "Shift is assembling …". Default "Shift". */
|
|
209
|
+
assemblerName?: string;
|
|
210
|
+
}
|
|
211
|
+
declare function CanvasTransition({ children, labels, seenKey, assemblerName, }: CanvasTransitionProps): react.JSX.Element;
|
|
212
|
+
|
|
213
|
+
interface LauncherItem {
|
|
214
|
+
href: string;
|
|
215
|
+
label: string;
|
|
216
|
+
icon: LucideIcon;
|
|
217
|
+
desc: string;
|
|
218
|
+
}
|
|
219
|
+
interface LauncherGroup {
|
|
220
|
+
label: string;
|
|
221
|
+
accent: Accent;
|
|
222
|
+
items: LauncherItem[];
|
|
223
|
+
}
|
|
224
|
+
interface CanvasLauncherProps {
|
|
225
|
+
/** Every resource the canvas can draw from, grouped + color-coded. */
|
|
226
|
+
groups: LauncherGroup[];
|
|
227
|
+
/** Header title. */
|
|
228
|
+
title?: string;
|
|
229
|
+
/** Header subtitle. */
|
|
230
|
+
subtitle?: string;
|
|
231
|
+
/** Trigger button label (hidden under lg). */
|
|
232
|
+
buttonLabel?: string;
|
|
233
|
+
/** Keyboard shortcut letter (with ⌘/Ctrl). Default "j". */
|
|
234
|
+
hotkey?: string;
|
|
235
|
+
/** Window event name that also opens the launcher. Default "shift:open-launcher". */
|
|
236
|
+
openEvent?: string;
|
|
237
|
+
/** Override navigation. Default router.push. */
|
|
238
|
+
onNavigate?: (href: string) => void;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* CanvasLauncher — the single menu button for the whole OS.
|
|
242
|
+
*
|
|
243
|
+
* Opens a full-screen generative grid of every resource the canvas can draw
|
|
244
|
+
* from. Selecting one doesn't take you to a page — it routes, and
|
|
245
|
+
* CanvasTransition brings that view to the canvas, assembling it live. The
|
|
246
|
+
* launcher is how you "see all the background pages" without ever leaving the
|
|
247
|
+
* one stage.
|
|
248
|
+
*/
|
|
249
|
+
declare function CanvasLauncher({ groups, title, subtitle, buttonLabel, hotkey, openEvent, onNavigate, }: CanvasLauncherProps): react.JSX.Element;
|
|
250
|
+
|
|
251
|
+
interface PageTransitionProps {
|
|
252
|
+
children: ReactNode;
|
|
253
|
+
className?: string;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* PageTransition — directional slide based on navigation depth. Animates
|
|
257
|
+
* left-to-right (deeper) or right-to-left (back). Lighter-weight alternative
|
|
258
|
+
* to CanvasTransition for apps that keep real page navigation.
|
|
259
|
+
*/
|
|
260
|
+
declare function PageTransition({ children, className }: PageTransitionProps): react.JSX.Element;
|
|
261
|
+
|
|
262
|
+
export { ACCENT_RGB, type Accent, CanvasLauncher, type CanvasLauncherProps, CanvasTransition, type CanvasTransitionProps, type GenPhase, GenerativeView, type GenerativeViewProps, HolographicShine, type HolographicShineProps, type LauncherGroup, type LauncherItem, LiveCard, type LiveCardProps, LiveStat, type LiveStatProps, PageTransition, type PageTransitionProps, ScrollGenerateCard, type ScrollGenerateCardProps, ShiftCard, type ShiftCardProps, TiltCard, type TiltCardProps, type UseGenerateOptions, useGenerate };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default, { ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import { MotionProps } from 'framer-motion';
|
|
4
|
+
import { LucideIcon } from 'lucide-react';
|
|
4
5
|
|
|
5
6
|
interface ShiftCardProps extends MotionProps {
|
|
6
7
|
children: ReactNode;
|
|
@@ -8,9 +9,9 @@ interface ShiftCardProps extends MotionProps {
|
|
|
8
9
|
style?: CSSProperties;
|
|
9
10
|
blur?: number;
|
|
10
11
|
}
|
|
11
|
-
declare function ShiftCard({ children, className, blur, style, ...props }: ShiftCardProps):
|
|
12
|
+
declare function ShiftCard({ children, className, blur, style, ...props }: ShiftCardProps): react.JSX.Element;
|
|
12
13
|
|
|
13
|
-
interface TiltCardProps extends Omit<
|
|
14
|
+
interface TiltCardProps extends Omit<react__default.HTMLAttributes<HTMLDivElement>, keyof MotionProps>, MotionProps {
|
|
14
15
|
/** Spring stiffness for the tilt. Default 300. */
|
|
15
16
|
stiffness?: number;
|
|
16
17
|
/** Spring damping. Default 28. */
|
|
@@ -24,22 +25,22 @@ interface TiltCardProps extends Omit<React__default.HTMLAttributes<HTMLDivElemen
|
|
|
24
25
|
* Drop-in wrapper that adds physics-spring 3-D tilt on mouse move.
|
|
25
26
|
* Renders a `motion.div`; all extra props forwarded.
|
|
26
27
|
*/
|
|
27
|
-
declare function TiltCard({ children, stiffness, damping, maxRotateX, maxRotateY, style, ...rest }: TiltCardProps):
|
|
28
|
+
declare function TiltCard({ children, stiffness, damping, maxRotateX, maxRotateY, style, ...rest }: TiltCardProps): react__default.JSX.Element;
|
|
28
29
|
|
|
29
30
|
interface HolographicShineProps {
|
|
30
31
|
/** RGB triplet for the shine tint, e.g. "0,229,240". Default neutral white. */
|
|
31
32
|
rgb?: string;
|
|
32
33
|
/** Intensity 0–1 of the shine overlay. Default 0.18. */
|
|
33
34
|
intensity?: number;
|
|
34
|
-
children?:
|
|
35
|
+
children?: react__default.ReactNode;
|
|
35
36
|
className?: string;
|
|
36
|
-
style?:
|
|
37
|
+
style?: react__default.CSSProperties;
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
40
|
* Wrapper that paints a cursor-tracked radial holographic shine over its
|
|
40
41
|
* children. Combine with TiltCard for the full effect.
|
|
41
42
|
*/
|
|
42
|
-
declare function HolographicShine({ rgb, intensity, children, className, style, }: HolographicShineProps):
|
|
43
|
+
declare function HolographicShine({ rgb, intensity, children, className, style, }: HolographicShineProps): react__default.JSX.Element;
|
|
43
44
|
|
|
44
45
|
type Phase = "idle" | "skeleton" | "live";
|
|
45
46
|
interface ScrollGenerateCardProps {
|
|
@@ -47,7 +48,7 @@ interface ScrollGenerateCardProps {
|
|
|
47
48
|
* The real card content. Rendered in the "live" phase.
|
|
48
49
|
* Passed the current phase so content can animate itself in.
|
|
49
50
|
*/
|
|
50
|
-
children: (phase: Phase) =>
|
|
51
|
+
children: (phase: Phase) => react__default.ReactNode;
|
|
51
52
|
/**
|
|
52
53
|
* Milliseconds of skeleton phase before switching to live. Default 360.
|
|
53
54
|
*/
|
|
@@ -77,6 +78,185 @@ interface ScrollGenerateCardProps {
|
|
|
77
78
|
* </ScrollGenerateCard>
|
|
78
79
|
* ```
|
|
79
80
|
*/
|
|
80
|
-
declare function ScrollGenerateCard({ children, skeletonDuration, delay, margin, className, skeletonRows, skeletonWidths, }: ScrollGenerateCardProps):
|
|
81
|
+
declare function ScrollGenerateCard({ children, skeletonDuration, delay, margin, className, skeletonRows, skeletonWidths, }: ScrollGenerateCardProps): react__default.JSX.Element;
|
|
81
82
|
|
|
82
|
-
|
|
83
|
+
type Accent = "teal" | "blue" | "purple" | "magenta" | "green" | "orange" | "neutral";
|
|
84
|
+
declare const ACCENT_RGB: Record<Accent, string>;
|
|
85
|
+
|
|
86
|
+
interface LiveCardProps {
|
|
87
|
+
children: React.ReactNode;
|
|
88
|
+
/** Accent color driving shine + top line + glow. Default "neutral" (uses --shift-accent if "brand"). */
|
|
89
|
+
accent?: Accent | "brand";
|
|
90
|
+
/** Enable 3D tilt-on-hover physics. Default true. */
|
|
91
|
+
tilt?: boolean;
|
|
92
|
+
/** Enable holographic cursor shine. Default true. */
|
|
93
|
+
shine?: boolean;
|
|
94
|
+
/** Generate-in lifecycle: skeleton → live. Default true. */
|
|
95
|
+
generate?: boolean;
|
|
96
|
+
/** Stagger order for generate-in (multiplied into enterDelay). */
|
|
97
|
+
index?: number;
|
|
98
|
+
/** Trigger generation on scroll-into-view or immediately. */
|
|
99
|
+
trigger?: "view" | "mount";
|
|
100
|
+
/** Number of shimmer rows in the skeleton phase. */
|
|
101
|
+
skeletonRows?: number;
|
|
102
|
+
/** Lit top accent line when card completes. Default true. */
|
|
103
|
+
topLine?: boolean;
|
|
104
|
+
/** Extra classes on the card surface. */
|
|
105
|
+
className?: string;
|
|
106
|
+
/** Min height to reserve while idle (prevents layout shift). */
|
|
107
|
+
minHeight?: number;
|
|
108
|
+
onClick?: () => void;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* LiveCard — the universal living surface.
|
|
112
|
+
*
|
|
113
|
+
* Combines: glass depth, 3D tilt physics, holographic cursor shine, and the
|
|
114
|
+
* generate-in lifecycle (skeleton → live). Wrap any content in this and it
|
|
115
|
+
* becomes part of the breathing, self-assembling UI. Surface is brand-neutral
|
|
116
|
+
* (`.ash-surface`, driven by --shift-* tokens); accent is decorative or "brand".
|
|
117
|
+
*/
|
|
118
|
+
declare function LiveCard({ children, accent, tilt, shine, generate, index, trigger, skeletonRows, topLine, className, minHeight, onClick, }: LiveCardProps): react.JSX.Element;
|
|
119
|
+
|
|
120
|
+
interface GenerativeViewProps {
|
|
121
|
+
children: React.ReactNode;
|
|
122
|
+
/** Per-child stagger in seconds. Default 0.08. */
|
|
123
|
+
stagger?: number;
|
|
124
|
+
/** Delay before the first child appears (s). */
|
|
125
|
+
delay?: number;
|
|
126
|
+
className?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* GenerativeView — wrap a page's top-level sections and they assemble
|
|
130
|
+
* themselves in sequence on load: each child blurs + lifts into place,
|
|
131
|
+
* giving the "the page is building itself for you" feel everywhere.
|
|
132
|
+
*
|
|
133
|
+
* Use at the page root around section blocks. For data cards that should
|
|
134
|
+
* shimmer→live, use <LiveCard generate /> inside.
|
|
135
|
+
*/
|
|
136
|
+
declare function GenerativeView({ children, stagger, delay, className, }: GenerativeViewProps): react.JSX.Element;
|
|
137
|
+
|
|
138
|
+
interface LiveStatProps {
|
|
139
|
+
label: string;
|
|
140
|
+
/** Numeric value to count up to. Omit for string-only display. */
|
|
141
|
+
value?: number;
|
|
142
|
+
/** Pre-formatted string (overrides count-up). */
|
|
143
|
+
display?: string;
|
|
144
|
+
prefix?: string;
|
|
145
|
+
suffix?: string;
|
|
146
|
+
sub?: string;
|
|
147
|
+
icon?: LucideIcon;
|
|
148
|
+
/** Decorative accent, or "brand" to use --shift-accent-rgb. */
|
|
149
|
+
accent?: Accent | "brand";
|
|
150
|
+
/** Count-up duration ms. */
|
|
151
|
+
duration?: number;
|
|
152
|
+
index?: number;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* LiveStat — a metric tile that counts up on mount with a glass surface and
|
|
156
|
+
* accent top line. The atomic unit of every dashboard / overview header.
|
|
157
|
+
*/
|
|
158
|
+
declare function LiveStat({ label, value, display, prefix, suffix, sub, icon: Icon, accent, duration, index, }: LiveStatProps): react.JSX.Element;
|
|
159
|
+
|
|
160
|
+
type GenPhase = "idle" | "skeleton" | "live";
|
|
161
|
+
interface UseGenerateOptions {
|
|
162
|
+
/** Delay before the skeleton appears (ms). Lets earlier cards generate first. */
|
|
163
|
+
enterDelay?: number;
|
|
164
|
+
/** How long the skeleton shimmer holds before content materializes (ms). */
|
|
165
|
+
skeletonMs?: number;
|
|
166
|
+
/** Trigger on scroll-into-view (default) or immediately on mount. */
|
|
167
|
+
trigger?: "view" | "mount";
|
|
168
|
+
/** IntersectionObserver margin when trigger = "view". */
|
|
169
|
+
margin?: string;
|
|
170
|
+
/** Re-run every time it enters view, instead of once. */
|
|
171
|
+
repeat?: boolean;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The core "generate-in" lifecycle every living card/section shares:
|
|
175
|
+
* idle (reserves layout) → skeleton (shimmer) → live (real content).
|
|
176
|
+
*
|
|
177
|
+
* This is what makes the whole product feel like it is building itself in
|
|
178
|
+
* real time — the same heartbeat on the landing page and inside the app.
|
|
179
|
+
*/
|
|
180
|
+
declare function useGenerate<T extends HTMLElement = HTMLDivElement>(opts?: UseGenerateOptions): {
|
|
181
|
+
ref: react.RefObject<T | null>;
|
|
182
|
+
phase: GenPhase;
|
|
183
|
+
isLive: boolean;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* CanvasTransition — the heart of the "one living canvas" model.
|
|
188
|
+
*
|
|
189
|
+
* The app is not N pages you travel between. It is a single stage. Every
|
|
190
|
+
* route's content is *generated onto the canvas* — the previous view fades
|
|
191
|
+
* out and the requested view assembles itself in real time. The underlying
|
|
192
|
+
* Next.js routes remain as the behind-the-scenes resources the canvas draws
|
|
193
|
+
* from; this wrapper turns each navigation into a generation event.
|
|
194
|
+
*
|
|
195
|
+
* First visit to a view per login session = full generate-in (blur→lift,
|
|
196
|
+
* "Shift is assembling" sheen). Revisits in the same session are instant, so
|
|
197
|
+
* power users aren't slowed down. The seen-set resets on each login, so every
|
|
198
|
+
* session opens with that real-time-building feel.
|
|
199
|
+
*
|
|
200
|
+
* Brand-neutral: the assembling indicator uses the product's --shift-accent.
|
|
201
|
+
*/
|
|
202
|
+
interface CanvasTransitionProps {
|
|
203
|
+
children: React.ReactNode;
|
|
204
|
+
/** Map of first-path-segment → friendly label for the assembling pill. */
|
|
205
|
+
labels?: Record<string, string>;
|
|
206
|
+
/** sessionStorage key for the per-login seen-set. Default "ash-seen-views". */
|
|
207
|
+
seenKey?: string;
|
|
208
|
+
/** Product name shown in the pill, e.g. "Shift is assembling …". Default "Shift". */
|
|
209
|
+
assemblerName?: string;
|
|
210
|
+
}
|
|
211
|
+
declare function CanvasTransition({ children, labels, seenKey, assemblerName, }: CanvasTransitionProps): react.JSX.Element;
|
|
212
|
+
|
|
213
|
+
interface LauncherItem {
|
|
214
|
+
href: string;
|
|
215
|
+
label: string;
|
|
216
|
+
icon: LucideIcon;
|
|
217
|
+
desc: string;
|
|
218
|
+
}
|
|
219
|
+
interface LauncherGroup {
|
|
220
|
+
label: string;
|
|
221
|
+
accent: Accent;
|
|
222
|
+
items: LauncherItem[];
|
|
223
|
+
}
|
|
224
|
+
interface CanvasLauncherProps {
|
|
225
|
+
/** Every resource the canvas can draw from, grouped + color-coded. */
|
|
226
|
+
groups: LauncherGroup[];
|
|
227
|
+
/** Header title. */
|
|
228
|
+
title?: string;
|
|
229
|
+
/** Header subtitle. */
|
|
230
|
+
subtitle?: string;
|
|
231
|
+
/** Trigger button label (hidden under lg). */
|
|
232
|
+
buttonLabel?: string;
|
|
233
|
+
/** Keyboard shortcut letter (with ⌘/Ctrl). Default "j". */
|
|
234
|
+
hotkey?: string;
|
|
235
|
+
/** Window event name that also opens the launcher. Default "shift:open-launcher". */
|
|
236
|
+
openEvent?: string;
|
|
237
|
+
/** Override navigation. Default router.push. */
|
|
238
|
+
onNavigate?: (href: string) => void;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* CanvasLauncher — the single menu button for the whole OS.
|
|
242
|
+
*
|
|
243
|
+
* Opens a full-screen generative grid of every resource the canvas can draw
|
|
244
|
+
* from. Selecting one doesn't take you to a page — it routes, and
|
|
245
|
+
* CanvasTransition brings that view to the canvas, assembling it live. The
|
|
246
|
+
* launcher is how you "see all the background pages" without ever leaving the
|
|
247
|
+
* one stage.
|
|
248
|
+
*/
|
|
249
|
+
declare function CanvasLauncher({ groups, title, subtitle, buttonLabel, hotkey, openEvent, onNavigate, }: CanvasLauncherProps): react.JSX.Element;
|
|
250
|
+
|
|
251
|
+
interface PageTransitionProps {
|
|
252
|
+
children: ReactNode;
|
|
253
|
+
className?: string;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* PageTransition — directional slide based on navigation depth. Animates
|
|
257
|
+
* left-to-right (deeper) or right-to-left (back). Lighter-weight alternative
|
|
258
|
+
* to CanvasTransition for apps that keep real page navigation.
|
|
259
|
+
*/
|
|
260
|
+
declare function PageTransition({ children, className }: PageTransitionProps): react.JSX.Element;
|
|
261
|
+
|
|
262
|
+
export { ACCENT_RGB, type Accent, CanvasLauncher, type CanvasLauncherProps, CanvasTransition, type CanvasTransitionProps, type GenPhase, GenerativeView, type GenerativeViewProps, HolographicShine, type HolographicShineProps, type LauncherGroup, type LauncherItem, LiveCard, type LiveCardProps, LiveStat, type LiveStatProps, PageTransition, type PageTransitionProps, ScrollGenerateCard, type ScrollGenerateCardProps, ShiftCard, type ShiftCardProps, TiltCard, type TiltCardProps, type UseGenerateOptions, useGenerate };
|