sv5ui 2.2.0 → 2.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/components/Error/Error.svelte +89 -0
- package/dist/components/Error/Error.svelte.d.ts +5 -0
- package/dist/components/Error/error.types.d.ts +87 -0
- package/dist/components/Error/error.types.js +1 -0
- package/dist/components/Error/error.variants.d.ts +66 -0
- package/dist/components/Error/error.variants.js +16 -0
- package/dist/components/Error/index.d.ts +2 -0
- package/dist/components/Error/index.js +1 -0
- package/dist/components/Footer/Footer.svelte +71 -0
- package/dist/components/Footer/Footer.svelte.d.ts +5 -0
- package/dist/components/Footer/FooterColumns.svelte +110 -0
- package/dist/components/Footer/FooterColumns.svelte.d.ts +5 -0
- package/dist/components/Footer/footer-columns.types.d.ts +73 -0
- package/dist/components/Footer/footer-columns.types.js +1 -0
- package/dist/components/Footer/footer-columns.variants.d.ts +108 -0
- package/dist/components/Footer/footer-columns.variants.js +23 -0
- package/dist/components/Footer/footer.types.d.ts +46 -0
- package/dist/components/Footer/footer.types.js +1 -0
- package/dist/components/Footer/footer.variants.d.ts +66 -0
- package/dist/components/Footer/footer.variants.js +16 -0
- package/dist/components/Footer/index.d.ts +4 -0
- package/dist/components/Footer/index.js +2 -0
- package/dist/components/Header/Header.svelte +177 -0
- package/dist/components/Header/Header.svelte.d.ts +5 -0
- package/dist/components/Header/header.types.d.ts +124 -0
- package/dist/components/Header/header.types.js +1 -0
- package/dist/components/Header/header.variants.d.ts +108 -0
- package/dist/components/Header/header.variants.js +32 -0
- package/dist/components/Header/index.d.ts +2 -0
- package/dist/components/Header/index.js +1 -0
- package/dist/components/Main/Main.svelte +20 -0
- package/dist/components/Main/Main.svelte.d.ts +5 -0
- package/dist/components/Main/index.d.ts +2 -0
- package/dist/components/Main/index.js +1 -0
- package/dist/components/Main/main.types.d.ts +27 -0
- package/dist/components/Main/main.types.js +1 -0
- package/dist/components/Main/main.variants.d.ts +30 -0
- package/dist/components/Main/main.variants.js +10 -0
- package/dist/components/Tour/Tour.svelte +459 -0
- package/dist/components/Tour/Tour.svelte.d.ts +5 -0
- package/dist/components/Tour/index.d.ts +2 -0
- package/dist/components/Tour/index.js +1 -0
- package/dist/components/Tour/tour.types.d.ts +457 -0
- package/dist/components/Tour/tour.types.js +1 -0
- package/dist/components/Tour/tour.variants.d.ts +208 -0
- package/dist/components/Tour/tour.variants.js +56 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.js +2 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useTour/index.d.ts +1 -0
- package/dist/hooks/useTour/index.js +1 -0
- package/dist/hooks/useTour/useTour.svelte.d.ts +29 -0
- package/dist/hooks/useTour/useTour.svelte.js +194 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/theme.css +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { ClassNameValue } from 'tailwind-merge';
|
|
3
|
+
import type { Placement } from '@floating-ui/dom';
|
|
4
|
+
import type { TourSlots, TourVariantProps } from './tour.variants.js';
|
|
5
|
+
/**
|
|
6
|
+
* What a step points at.
|
|
7
|
+
* - `string` → CSS selector, resolved lazily each time the step activates.
|
|
8
|
+
* - `HTMLElement`→ used directly.
|
|
9
|
+
* - `() => ...` → getter, resolved on activation (reactive sources welcome).
|
|
10
|
+
* - `null`/omit → dialog mode: panel is centered, no spotlight anchor.
|
|
11
|
+
*/
|
|
12
|
+
export type TourTarget = string | HTMLElement | (() => HTMLElement | null) | null;
|
|
13
|
+
/**
|
|
14
|
+
* Configuration for a single step in the tour.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const step: TourStep = {
|
|
19
|
+
* target: '#create-btn',
|
|
20
|
+
* title: 'Create',
|
|
21
|
+
* description: 'Click here to make your first item.',
|
|
22
|
+
* placement: 'right'
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export interface TourStep {
|
|
27
|
+
/**
|
|
28
|
+
* Stable identifier. Enables `goTo('step-id')` and survives reordering.
|
|
29
|
+
* Falls back to the step's zero-based index when omitted.
|
|
30
|
+
*/
|
|
31
|
+
id?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Element the step highlights. See {@link TourTarget}.
|
|
34
|
+
* Omit (or `null`) for a centered dialog step with no spotlight.
|
|
35
|
+
*/
|
|
36
|
+
target?: TourTarget;
|
|
37
|
+
/**
|
|
38
|
+
* Poll the DOM until the target appears (useful right after a route change
|
|
39
|
+
* where the target hasn't rendered yet).
|
|
40
|
+
* - `true` → wait up to 2000ms.
|
|
41
|
+
* - `number` → wait up to this many milliseconds.
|
|
42
|
+
* @default inherits `TourProps.waitForTarget`
|
|
43
|
+
*/
|
|
44
|
+
waitForTarget?: boolean | number;
|
|
45
|
+
/**
|
|
46
|
+
* Heading shown at the top of the panel.
|
|
47
|
+
*/
|
|
48
|
+
title?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Body text shown under the title.
|
|
51
|
+
*/
|
|
52
|
+
description?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Custom body content. Replaces `title` + `description` rendering.
|
|
55
|
+
*/
|
|
56
|
+
content?: Snippet<[TourStepSlotProps]>;
|
|
57
|
+
/**
|
|
58
|
+
* Panel placement relative to the target. Overrides `TourProps.placement`.
|
|
59
|
+
* @example 'bottom' | 'top-start' | 'right-end'
|
|
60
|
+
*/
|
|
61
|
+
placement?: Placement;
|
|
62
|
+
/**
|
|
63
|
+
* Gap in pixels between the target and the panel. Overrides `TourProps.sideOffset`.
|
|
64
|
+
*/
|
|
65
|
+
sideOffset?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Extra pixels around the target inside the spotlight cut-out.
|
|
68
|
+
* Overrides `TourProps.spotlightPadding`.
|
|
69
|
+
*/
|
|
70
|
+
spotlightPadding?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Corner radius of the spotlight cut-out in pixels.
|
|
73
|
+
* Overrides `TourProps.spotlightRadius`.
|
|
74
|
+
*/
|
|
75
|
+
spotlightRadius?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Let pointer events reach the highlighted target (the dismiss backdrop is
|
|
78
|
+
* dropped for this step). Useful for "try clicking this" steps.
|
|
79
|
+
* Overrides `TourProps.spotlightInteractable`.
|
|
80
|
+
*/
|
|
81
|
+
spotlightInteractable?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Hide the spotlight entirely for this step (intro / outro). The panel still
|
|
84
|
+
* renders, centered when there is no target.
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
disableSpotlight?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Scroll the target into view before positioning. Overrides `TourProps.scrollIntoView`.
|
|
90
|
+
*/
|
|
91
|
+
scrollIntoView?: boolean | ScrollIntoViewOptions;
|
|
92
|
+
/**
|
|
93
|
+
* Label for the next button on this step (e.g. `'Try it'`).
|
|
94
|
+
*/
|
|
95
|
+
nextLabel?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Label for the previous button on this step.
|
|
98
|
+
*/
|
|
99
|
+
prevLabel?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Show the previous button on this step. Defaults to hidden on the first step.
|
|
102
|
+
*/
|
|
103
|
+
showPrev?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Show the skip button on this step. Overrides `TourProps.showSkip`.
|
|
106
|
+
*/
|
|
107
|
+
showSkip?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Guard run before advancing. Return `false` (or a rejecting/`false` promise)
|
|
110
|
+
* to block the move — e.g. to validate a form first.
|
|
111
|
+
*/
|
|
112
|
+
onBeforeNext?: () => boolean | Promise<boolean>;
|
|
113
|
+
/**
|
|
114
|
+
* Guard run before going back. Return `false` to block the move.
|
|
115
|
+
*/
|
|
116
|
+
onBeforePrev?: () => boolean | Promise<boolean>;
|
|
117
|
+
/**
|
|
118
|
+
* Called when the step becomes active. May be async; the panel waits for it
|
|
119
|
+
* to resolve before animating in.
|
|
120
|
+
*/
|
|
121
|
+
onEnter?: () => void | Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* Skip this step. `next()` / `prev()` jump over it automatically.
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
126
|
+
disabled?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Route this step belongs to. Pure metadata — the component never navigates.
|
|
129
|
+
* Read it in `onStepChange` to drive your router.
|
|
130
|
+
*/
|
|
131
|
+
route?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Additional CSS classes for this step's panel.
|
|
134
|
+
*/
|
|
135
|
+
class?: ClassNameValue;
|
|
136
|
+
/**
|
|
137
|
+
* Per-step overrides for individual slot classes.
|
|
138
|
+
*/
|
|
139
|
+
ui?: Partial<Record<TourSlots, ClassNameValue>>;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Context passed to every Tour snippet (`header`, `footer`, `content`).
|
|
143
|
+
*/
|
|
144
|
+
export interface TourStepSlotProps {
|
|
145
|
+
/** The current step's data. */
|
|
146
|
+
step: TourStep;
|
|
147
|
+
/** Zero-based position in the `steps` array. */
|
|
148
|
+
index: number;
|
|
149
|
+
/** Human-friendly one-based position (`index + 1`). */
|
|
150
|
+
number: number;
|
|
151
|
+
/** Total number of steps. */
|
|
152
|
+
total: number;
|
|
153
|
+
/** Whether this is the first step. */
|
|
154
|
+
isFirst: boolean;
|
|
155
|
+
/** Whether this is the last step. */
|
|
156
|
+
isLast: boolean;
|
|
157
|
+
/** The controller driving the tour. */
|
|
158
|
+
controller: TourController;
|
|
159
|
+
/** Shorthand for `controller.next()`. */
|
|
160
|
+
next: () => void;
|
|
161
|
+
/** Shorthand for `controller.prev()`. */
|
|
162
|
+
prev: () => void;
|
|
163
|
+
/** Shorthand for `controller.stop()`. */
|
|
164
|
+
stop: () => void;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Imperative controller for a tour. Returned by both `useTour()` and the
|
|
168
|
+
* component's `bind:api`. It is the single source of truth for tour state —
|
|
169
|
+
* there is no `bind:open` / `bind:step`.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```svelte
|
|
173
|
+
* <script>
|
|
174
|
+
* let api = $state<TourController>()
|
|
175
|
+
* </script>
|
|
176
|
+
*
|
|
177
|
+
* <Button onclick={() => api?.start()}>Start tour</Button>
|
|
178
|
+
* <Tour {steps} bind:api />
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
export interface TourController {
|
|
182
|
+
/**
|
|
183
|
+
* Open the tour. Optionally start at a specific step (index or `id`).
|
|
184
|
+
* Defaults to `defaultStep`.
|
|
185
|
+
*/
|
|
186
|
+
start: (step?: number | string) => void;
|
|
187
|
+
/**
|
|
188
|
+
* Close the tour. Does not fire `onComplete`.
|
|
189
|
+
*/
|
|
190
|
+
stop: () => void;
|
|
191
|
+
/**
|
|
192
|
+
* Advance to the next enabled step. On the last step this completes the tour
|
|
193
|
+
* (fires `onComplete` and closes).
|
|
194
|
+
*/
|
|
195
|
+
next: () => void;
|
|
196
|
+
/**
|
|
197
|
+
* Go back to the previous enabled step. No-op on the first step.
|
|
198
|
+
*/
|
|
199
|
+
prev: () => void;
|
|
200
|
+
/**
|
|
201
|
+
* Jump to a step by index or `id`. Bypasses `onBeforeNext` / `onBeforePrev`.
|
|
202
|
+
*/
|
|
203
|
+
goTo: (step: number | string) => void;
|
|
204
|
+
/** Whether the tour is currently open. */
|
|
205
|
+
readonly isActive: boolean;
|
|
206
|
+
/** Current step's zero-based index, or `-1` when inactive. */
|
|
207
|
+
readonly currentIndex: number;
|
|
208
|
+
/** Total number of steps. */
|
|
209
|
+
readonly totalSteps: number;
|
|
210
|
+
/** Whether `prev()` would move back. */
|
|
211
|
+
readonly hasPrev: boolean;
|
|
212
|
+
/** Whether `next()` would move forward (not on the last step). */
|
|
213
|
+
readonly hasNext: boolean;
|
|
214
|
+
/** Whether the current step is the first one. */
|
|
215
|
+
readonly isFirst: boolean;
|
|
216
|
+
/** Whether the current step is the last one. */
|
|
217
|
+
readonly isLast: boolean;
|
|
218
|
+
/** The current step's data, or `undefined` when inactive. */
|
|
219
|
+
readonly currentStepData: TourStep | undefined;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Persistence configuration for `useTour`. Lets an in-progress tour survive a
|
|
223
|
+
* page reload or SPA navigation.
|
|
224
|
+
*/
|
|
225
|
+
export interface TourPersistOptions {
|
|
226
|
+
/**
|
|
227
|
+
* Storage key.
|
|
228
|
+
* @default 'sv5ui-tour'
|
|
229
|
+
*/
|
|
230
|
+
key?: string;
|
|
231
|
+
/**
|
|
232
|
+
* Which Web Storage to use.
|
|
233
|
+
* @default 'local'
|
|
234
|
+
*/
|
|
235
|
+
storage?: 'local' | 'session';
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Options for the `useTour` hook.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```ts
|
|
242
|
+
* const tour = useTour({
|
|
243
|
+
* steps,
|
|
244
|
+
* persist: true,
|
|
245
|
+
* onStepChange: (i) => { if (steps[i].route) goto(steps[i].route) }
|
|
246
|
+
* })
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
249
|
+
export interface UseTourOptions {
|
|
250
|
+
/**
|
|
251
|
+
* The steps that make up the tour.
|
|
252
|
+
*/
|
|
253
|
+
steps: TourStep[];
|
|
254
|
+
/**
|
|
255
|
+
* Step to open at when `start()` is called without an argument.
|
|
256
|
+
* @default 0
|
|
257
|
+
*/
|
|
258
|
+
defaultStep?: number;
|
|
259
|
+
/**
|
|
260
|
+
* Persist `open` + current step so the tour resumes across reloads /
|
|
261
|
+
* navigations. `true` uses the defaults in {@link TourPersistOptions}.
|
|
262
|
+
* @default false
|
|
263
|
+
*/
|
|
264
|
+
persist?: boolean | TourPersistOptions;
|
|
265
|
+
/**
|
|
266
|
+
* Fired when the tour opens.
|
|
267
|
+
*/
|
|
268
|
+
onStart?: () => void;
|
|
269
|
+
/**
|
|
270
|
+
* Fired when the tour finishes (advancing past the last step).
|
|
271
|
+
*/
|
|
272
|
+
onComplete?: () => void;
|
|
273
|
+
/**
|
|
274
|
+
* Fired when the tour is skipped/closed before completing. Receives the
|
|
275
|
+
* index it was on.
|
|
276
|
+
*/
|
|
277
|
+
onSkip?: (index: number) => void;
|
|
278
|
+
/**
|
|
279
|
+
* Fired whenever the active step changes. Receives the new and previous
|
|
280
|
+
* indices. Use it to drive routing in multi-page tours.
|
|
281
|
+
*/
|
|
282
|
+
onStepChange?: (index: number, prev: number) => void;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Props for the Tour component.
|
|
286
|
+
*
|
|
287
|
+
* The component always runs on a {@link TourController}: pass one via
|
|
288
|
+
* `controller` (e.g. from `useTour()` for multi-page tours), or let the
|
|
289
|
+
* component create one internally and read it back through `bind:api`.
|
|
290
|
+
*
|
|
291
|
+
* @example
|
|
292
|
+
* ```svelte
|
|
293
|
+
* <Tour {steps} bind:api onComplete={() => ...} />
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
export interface TourProps {
|
|
297
|
+
/** Custom data attributes are forwarded to the panel element. */
|
|
298
|
+
[key: `data-${string}`]: string | number | boolean | null | undefined;
|
|
299
|
+
/**
|
|
300
|
+
* The steps that make up the tour.
|
|
301
|
+
*/
|
|
302
|
+
steps: TourStep[];
|
|
303
|
+
/**
|
|
304
|
+
* External controller (typically from `useTour()`). When provided, the
|
|
305
|
+
* component reads all state from it and never creates its own. Required for
|
|
306
|
+
* multi-page tours where state must outlive the component.
|
|
307
|
+
*/
|
|
308
|
+
controller?: TourController;
|
|
309
|
+
/**
|
|
310
|
+
* Bindable controller. Echoes the active controller (internal or external)
|
|
311
|
+
* for imperative `start()` / `stop()` / `goTo()` from the parent.
|
|
312
|
+
*/
|
|
313
|
+
api?: TourController;
|
|
314
|
+
/**
|
|
315
|
+
* Step to open at when `start()` is called without an argument. Ignored when
|
|
316
|
+
* a `controller` is supplied (configure it on the hook instead).
|
|
317
|
+
* @default 0
|
|
318
|
+
*/
|
|
319
|
+
defaultStep?: number;
|
|
320
|
+
/**
|
|
321
|
+
* Fired when the tour opens or closes.
|
|
322
|
+
*/
|
|
323
|
+
onOpenChange?: (open: boolean) => void;
|
|
324
|
+
/**
|
|
325
|
+
* Fired whenever the active step changes. Receives new and previous indices.
|
|
326
|
+
*/
|
|
327
|
+
onStepChange?: (index: number, prev: number) => void;
|
|
328
|
+
/**
|
|
329
|
+
* Fired when the tour opens.
|
|
330
|
+
*/
|
|
331
|
+
onStart?: () => void;
|
|
332
|
+
/**
|
|
333
|
+
* Fired when the tour finishes (advancing past the last step).
|
|
334
|
+
*/
|
|
335
|
+
onComplete?: () => void;
|
|
336
|
+
/**
|
|
337
|
+
* Fired when the tour is skipped/closed before completing.
|
|
338
|
+
*/
|
|
339
|
+
onSkip?: (index: number) => void;
|
|
340
|
+
/**
|
|
341
|
+
* Default panel placement relative to the target.
|
|
342
|
+
* @default 'bottom'
|
|
343
|
+
*/
|
|
344
|
+
placement?: Placement;
|
|
345
|
+
/**
|
|
346
|
+
* Default gap in pixels between the target and the panel.
|
|
347
|
+
* @default 12
|
|
348
|
+
*/
|
|
349
|
+
sideOffset?: number;
|
|
350
|
+
/**
|
|
351
|
+
* Render the spotlight cut-out highlighting the target.
|
|
352
|
+
* @default true
|
|
353
|
+
*/
|
|
354
|
+
spotlight?: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* Default extra pixels around the target inside the cut-out.
|
|
357
|
+
* @default 8
|
|
358
|
+
*/
|
|
359
|
+
spotlightPadding?: number;
|
|
360
|
+
/**
|
|
361
|
+
* Default corner radius of the cut-out in pixels.
|
|
362
|
+
* @default 8
|
|
363
|
+
*/
|
|
364
|
+
spotlightRadius?: number;
|
|
365
|
+
/**
|
|
366
|
+
* Default: let pointer events reach the highlighted target.
|
|
367
|
+
* @default false
|
|
368
|
+
*/
|
|
369
|
+
spotlightInteractable?: boolean;
|
|
370
|
+
/**
|
|
371
|
+
* Scroll the target into view before positioning each step.
|
|
372
|
+
* @default true
|
|
373
|
+
*/
|
|
374
|
+
scrollIntoView?: boolean | ScrollIntoViewOptions;
|
|
375
|
+
/**
|
|
376
|
+
* Default DOM-poll timeout for targets that aren't rendered yet.
|
|
377
|
+
* @default 2000
|
|
378
|
+
*/
|
|
379
|
+
waitForTarget?: boolean | number;
|
|
380
|
+
/**
|
|
381
|
+
* Allow closing the tour by clicking the backdrop or pressing Escape.
|
|
382
|
+
* @default false
|
|
383
|
+
*/
|
|
384
|
+
dismissible?: boolean;
|
|
385
|
+
/**
|
|
386
|
+
* Render an arrow pointing from the panel to the target.
|
|
387
|
+
* @default true
|
|
388
|
+
*/
|
|
389
|
+
arrow?: boolean;
|
|
390
|
+
/**
|
|
391
|
+
* Label for the previous button.
|
|
392
|
+
* @default 'Back'
|
|
393
|
+
*/
|
|
394
|
+
prevLabel?: string;
|
|
395
|
+
/**
|
|
396
|
+
* Label for the next button.
|
|
397
|
+
* @default 'Next'
|
|
398
|
+
*/
|
|
399
|
+
nextLabel?: string;
|
|
400
|
+
/**
|
|
401
|
+
* Label for the next button on the last step.
|
|
402
|
+
* @default 'Done'
|
|
403
|
+
*/
|
|
404
|
+
doneLabel?: string;
|
|
405
|
+
/**
|
|
406
|
+
* Label for the skip button.
|
|
407
|
+
* @default 'Skip'
|
|
408
|
+
*/
|
|
409
|
+
skipLabel?: string;
|
|
410
|
+
/**
|
|
411
|
+
* Show the progress dots in the footer.
|
|
412
|
+
* @default true
|
|
413
|
+
*/
|
|
414
|
+
showProgress?: boolean;
|
|
415
|
+
/**
|
|
416
|
+
* Show the skip button.
|
|
417
|
+
* @default true
|
|
418
|
+
*/
|
|
419
|
+
showSkip?: boolean;
|
|
420
|
+
/**
|
|
421
|
+
* Size variant controlling the panel width.
|
|
422
|
+
* @default 'md'
|
|
423
|
+
*/
|
|
424
|
+
size?: NonNullable<TourVariantProps['size']>;
|
|
425
|
+
/**
|
|
426
|
+
* Animate the panel and spotlight. Automatically disabled when the user
|
|
427
|
+
* prefers reduced motion.
|
|
428
|
+
* @default true
|
|
429
|
+
*/
|
|
430
|
+
transition?: NonNullable<TourVariantProps['transition']>;
|
|
431
|
+
/**
|
|
432
|
+
* Render the tour in a portal.
|
|
433
|
+
* @default true
|
|
434
|
+
*/
|
|
435
|
+
portal?: boolean;
|
|
436
|
+
/**
|
|
437
|
+
* Additional CSS classes for the panel element.
|
|
438
|
+
*/
|
|
439
|
+
class?: ClassNameValue;
|
|
440
|
+
/**
|
|
441
|
+
* Override classes for component slots.
|
|
442
|
+
*/
|
|
443
|
+
ui?: Partial<Record<TourSlots, ClassNameValue>>;
|
|
444
|
+
/**
|
|
445
|
+
* Custom panel header. Replaces the default title + close button.
|
|
446
|
+
*/
|
|
447
|
+
header?: Snippet<[TourStepSlotProps]>;
|
|
448
|
+
/**
|
|
449
|
+
* Custom panel footer. Replaces the default progress + navigation buttons.
|
|
450
|
+
*/
|
|
451
|
+
footer?: Snippet<[TourStepSlotProps]>;
|
|
452
|
+
/**
|
|
453
|
+
* Custom panel body. Replaces the entire content area (title, description,
|
|
454
|
+
* and each step's `content`).
|
|
455
|
+
*/
|
|
456
|
+
content?: Snippet<[TourStepSlotProps]>;
|
|
457
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { type VariantProps } from 'tailwind-variants';
|
|
2
|
+
export declare const tourVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
size: {
|
|
4
|
+
sm: {
|
|
5
|
+
panel: string;
|
|
6
|
+
};
|
|
7
|
+
md: {
|
|
8
|
+
panel: string;
|
|
9
|
+
};
|
|
10
|
+
lg: {
|
|
11
|
+
panel: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
transition: {
|
|
15
|
+
true: {
|
|
16
|
+
panel: string[];
|
|
17
|
+
spotlight: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
active: {
|
|
21
|
+
true: {
|
|
22
|
+
progressDot: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
overlay: string;
|
|
27
|
+
spotlight: string[];
|
|
28
|
+
panel: string[];
|
|
29
|
+
arrow: string;
|
|
30
|
+
header: string;
|
|
31
|
+
title: string;
|
|
32
|
+
description: string;
|
|
33
|
+
body: string;
|
|
34
|
+
footer: string;
|
|
35
|
+
progress: string;
|
|
36
|
+
progressDot: string;
|
|
37
|
+
nav: string;
|
|
38
|
+
prevButton: string;
|
|
39
|
+
nextButton: string;
|
|
40
|
+
skipButton: string;
|
|
41
|
+
closeButton: string;
|
|
42
|
+
}, undefined, {
|
|
43
|
+
size: {
|
|
44
|
+
sm: {
|
|
45
|
+
panel: string;
|
|
46
|
+
};
|
|
47
|
+
md: {
|
|
48
|
+
panel: string;
|
|
49
|
+
};
|
|
50
|
+
lg: {
|
|
51
|
+
panel: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
transition: {
|
|
55
|
+
true: {
|
|
56
|
+
panel: string[];
|
|
57
|
+
spotlight: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
active: {
|
|
61
|
+
true: {
|
|
62
|
+
progressDot: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
}, {
|
|
66
|
+
overlay: string;
|
|
67
|
+
spotlight: string[];
|
|
68
|
+
panel: string[];
|
|
69
|
+
arrow: string;
|
|
70
|
+
header: string;
|
|
71
|
+
title: string;
|
|
72
|
+
description: string;
|
|
73
|
+
body: string;
|
|
74
|
+
footer: string;
|
|
75
|
+
progress: string;
|
|
76
|
+
progressDot: string;
|
|
77
|
+
nav: string;
|
|
78
|
+
prevButton: string;
|
|
79
|
+
nextButton: string;
|
|
80
|
+
skipButton: string;
|
|
81
|
+
closeButton: string;
|
|
82
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
83
|
+
size: {
|
|
84
|
+
sm: {
|
|
85
|
+
panel: string;
|
|
86
|
+
};
|
|
87
|
+
md: {
|
|
88
|
+
panel: string;
|
|
89
|
+
};
|
|
90
|
+
lg: {
|
|
91
|
+
panel: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
transition: {
|
|
95
|
+
true: {
|
|
96
|
+
panel: string[];
|
|
97
|
+
spotlight: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
active: {
|
|
101
|
+
true: {
|
|
102
|
+
progressDot: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
}, {
|
|
106
|
+
overlay: string;
|
|
107
|
+
spotlight: string[];
|
|
108
|
+
panel: string[];
|
|
109
|
+
arrow: string;
|
|
110
|
+
header: string;
|
|
111
|
+
title: string;
|
|
112
|
+
description: string;
|
|
113
|
+
body: string;
|
|
114
|
+
footer: string;
|
|
115
|
+
progress: string;
|
|
116
|
+
progressDot: string;
|
|
117
|
+
nav: string;
|
|
118
|
+
prevButton: string;
|
|
119
|
+
nextButton: string;
|
|
120
|
+
skipButton: string;
|
|
121
|
+
closeButton: string;
|
|
122
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
123
|
+
export type TourVariantProps = VariantProps<typeof tourVariants>;
|
|
124
|
+
export type TourSlots = keyof ReturnType<typeof tourVariants>;
|
|
125
|
+
export declare const tourDefaults: {
|
|
126
|
+
defaultVariants: import("tailwind-variants").TVDefaultVariants<{
|
|
127
|
+
size: {
|
|
128
|
+
sm: {
|
|
129
|
+
panel: string;
|
|
130
|
+
};
|
|
131
|
+
md: {
|
|
132
|
+
panel: string;
|
|
133
|
+
};
|
|
134
|
+
lg: {
|
|
135
|
+
panel: string;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
transition: {
|
|
139
|
+
true: {
|
|
140
|
+
panel: string[];
|
|
141
|
+
spotlight: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
active: {
|
|
145
|
+
true: {
|
|
146
|
+
progressDot: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
}, {
|
|
150
|
+
overlay: string;
|
|
151
|
+
spotlight: string[];
|
|
152
|
+
panel: string[];
|
|
153
|
+
arrow: string;
|
|
154
|
+
header: string;
|
|
155
|
+
title: string;
|
|
156
|
+
description: string;
|
|
157
|
+
body: string;
|
|
158
|
+
footer: string;
|
|
159
|
+
progress: string;
|
|
160
|
+
progressDot: string;
|
|
161
|
+
nav: string;
|
|
162
|
+
prevButton: string;
|
|
163
|
+
nextButton: string;
|
|
164
|
+
skipButton: string;
|
|
165
|
+
closeButton: string;
|
|
166
|
+
}, {
|
|
167
|
+
size: {
|
|
168
|
+
sm: {
|
|
169
|
+
panel: string;
|
|
170
|
+
};
|
|
171
|
+
md: {
|
|
172
|
+
panel: string;
|
|
173
|
+
};
|
|
174
|
+
lg: {
|
|
175
|
+
panel: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
transition: {
|
|
179
|
+
true: {
|
|
180
|
+
panel: string[];
|
|
181
|
+
spotlight: string;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
active: {
|
|
185
|
+
true: {
|
|
186
|
+
progressDot: string;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
}, {
|
|
190
|
+
overlay: string;
|
|
191
|
+
spotlight: string[];
|
|
192
|
+
panel: string[];
|
|
193
|
+
arrow: string;
|
|
194
|
+
header: string;
|
|
195
|
+
title: string;
|
|
196
|
+
description: string;
|
|
197
|
+
body: string;
|
|
198
|
+
footer: string;
|
|
199
|
+
progress: string;
|
|
200
|
+
progressDot: string;
|
|
201
|
+
nav: string;
|
|
202
|
+
prevButton: string;
|
|
203
|
+
nextButton: string;
|
|
204
|
+
skipButton: string;
|
|
205
|
+
closeButton: string;
|
|
206
|
+
}>;
|
|
207
|
+
slots: Partial<Record<TourSlots, string>>;
|
|
208
|
+
};
|