@travel-match/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/components/CtaSentence/CtaSentence.cjs +1 -1
- package/dist/components/CtaSentence/CtaSentence.cjs.map +1 -1
- package/dist/components/CtaSentence/CtaSentence.js +142 -69
- package/dist/components/CtaSentence/CtaSentence.js.map +1 -1
- package/dist/components/HeroColumns/heroMotion.cjs +1 -1
- package/dist/components/HeroColumns/heroMotion.cjs.map +1 -1
- package/dist/components/HeroColumns/heroMotion.js +7 -44
- package/dist/components/HeroColumns/heroMotion.js.map +1 -1
- package/dist/components/HeroMap/HeroMap.cjs +1 -1
- package/dist/components/HeroMap/HeroMap.cjs.map +1 -1
- package/dist/components/HeroMap/HeroMap.js +58 -67
- package/dist/components/HeroMap/HeroMap.js.map +1 -1
- package/dist/components/HeroSwitcher/HeroSwitcher.cjs +1 -1
- package/dist/components/HeroSwitcher/HeroSwitcher.cjs.map +1 -1
- package/dist/components/HeroSwitcher/HeroSwitcher.js +85 -92
- package/dist/components/HeroSwitcher/HeroSwitcher.js.map +1 -1
- package/dist/components/HowItWorksSteps/HowItWorksSteps.cjs +1 -1
- package/dist/components/HowItWorksSteps/HowItWorksSteps.cjs.map +1 -1
- package/dist/components/HowItWorksSteps/HowItWorksSteps.js +84 -102
- package/dist/components/HowItWorksSteps/HowItWorksSteps.js.map +1 -1
- package/dist/components/PackageAnimation/PackageAnimation.cjs +1 -1
- package/dist/components/PackageAnimation/PackageAnimation.cjs.map +1 -1
- package/dist/components/PackageAnimation/PackageAnimation.js +31 -40
- package/dist/components/PackageAnimation/PackageAnimation.js.map +1 -1
- package/dist/components/PartnerCarousel/PartnerCarousel.cjs +1 -1
- package/dist/components/PartnerCarousel/PartnerCarousel.cjs.map +1 -1
- package/dist/components/PartnerCarousel/PartnerCarousel.js +94 -101
- package/dist/components/PartnerCarousel/PartnerCarousel.js.map +1 -1
- package/dist/components/PartnerCarousel/autoplay.cjs +1 -1
- package/dist/components/PartnerCarousel/autoplay.cjs.map +1 -1
- package/dist/components/PartnerCarousel/autoplay.js +13 -9
- package/dist/components/PartnerCarousel/autoplay.js.map +1 -1
- package/dist/index.d.cts +33 -55
- package/dist/index.d.ts +33 -55
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/components/PartnerCarousel/AutoplayToggle.cjs +0 -2
- package/dist/components/PartnerCarousel/AutoplayToggle.cjs.map +0 -1
- package/dist/components/PartnerCarousel/AutoplayToggle.js +0 -36
- package/dist/components/PartnerCarousel/AutoplayToggle.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoplay.js","names":["usePrefersReducedMotion","reduced","setReduced","useState","useEffect","query","update","useInView","inView","setInView","element","ref","observer","entry","entries","usePageVisible","visible","setVisible","useAutoplay","reducedMotion","rootRef","pageVisible","hovered","setHovered","focused","setFocused","
|
|
1
|
+
{"version":3,"file":"autoplay.js","names":["usePrefersReducedMotion","reduced","setReduced","useState","useEffect","query","update","useInView","inView","setInView","element","ref","observer","entry","entries","usePageVisible","visible","setVisible","useAutoplay","reducedMotion","rootRef","pageVisible","hovered","setHovered","focused","setFocused","running","enabled","paused","ignoreInteraction","tick","useRef","onTick","id","delay","resetKey","useCallback","event","keyboard","useIndexState","inner","setInner","defaultValue","current","count","n","value","changed","onValueChange","next"],"sources":["../../../src/components/PartnerCarousel/autoplay.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState, type FocusEvent, type PointerEvent, type RefObject } from 'react';\n\n/** `true` while the user asks the system for reduced motion. Starts `false` so server and client markup agree. */\nexport function usePrefersReducedMotion(): boolean {\n const [reduced, setReduced] = useState(false);\n useEffect(() => {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n const query = window.matchMedia('(prefers-reduced-motion: reduce)');\n const update = () => setReduced(query.matches);\n update();\n query.addEventListener?.('change', update);\n return () => query.removeEventListener?.('change', update);\n }, []);\n return reduced;\n}\n\n/** `false` while the element is scrolled out of the viewport. Without IntersectionObserver it counts as visible. */\nexport function useInView(ref: RefObject<Element | null>): boolean {\n const [inView, setInView] = useState(true);\n useEffect(() => {\n const element = ref.current;\n if (!element || typeof IntersectionObserver === 'undefined') return;\n const observer = new IntersectionObserver((entries) => {\n const entry = entries[entries.length - 1];\n if (entry) setInView(entry.isIntersecting);\n });\n observer.observe(element);\n return () => observer.disconnect();\n }, [ref]);\n return inView;\n}\n\n/** `false` while the browser tab is hidden. */\nexport function usePageVisible(): boolean {\n const [visible, setVisible] = useState(true);\n useEffect(() => {\n if (typeof document === 'undefined') return;\n const update = () => setVisible(document.visibilityState !== 'hidden');\n update();\n document.addEventListener('visibilitychange', update);\n return () => document.removeEventListener('visibilitychange', update);\n }, []);\n return visible;\n}\n\nexport interface UseAutoplayOptions {\n /** The component's `autoPlay` prop. */\n enabled: boolean;\n /** The component's `paused` prop. */\n paused?: boolean;\n /** Milliseconds between two ticks. */\n delay: number;\n /** Moves to the next state. */\n onTick: () => void;\n /** Root element: the loop stops while it is off-screen. */\n rootRef: RefObject<Element | null>;\n /** Restarts the countdown whenever it changes (pass the current step). */\n resetKey?: unknown;\n /** Keep running while the pointer is over the component or focus is inside it (decorative animations only). */\n ignoreInteraction?: boolean;\n}\n\nexport interface UseAutoplayResult {\n /** The loop is ticking right now. */\n running: boolean;\n /** The user asked for reduced motion: nothing plays by itself. */\n reducedMotion: boolean;\n /**\n * Spread on the root: holds the loop while a mouse hovers it or keyboard focus is inside. Pass the focus event to\n * `onFocus`: focus left behind by a click or a tap then does not hold the loop (without the event every focus does).\n */\n interactionProps: {\n onPointerEnter: (event: PointerEvent<HTMLElement>) => void;\n onPointerLeave: () => void;\n onFocus: (event?: FocusEvent<HTMLElement>) => void;\n onBlur: (event: FocusEvent<HTMLElement>) => void;\n };\n}\n\n/**\n * Shared autoplay loop of the animated components: ticks every `delay` ms, forever. It holds for reduced motion, a\n * hidden tab, an off-screen root, a hovering mouse, keyboard focus inside the root and the `paused` prop, and carries\n * on by itself as soon as none of them applies — there is no pause control and nothing the user does ends the loop.\n */\nexport function useAutoplay({ enabled, paused = false, delay, onTick, rootRef, resetKey, ignoreInteraction = false }: UseAutoplayOptions): UseAutoplayResult {\n const reducedMotion = usePrefersReducedMotion();\n const inView = useInView(rootRef);\n const pageVisible = usePageVisible();\n const [hovered, setHovered] = useState(false);\n const [focused, setFocused] = useState(false);\n\n const interacting = !ignoreInteraction && (hovered || focused);\n const running = enabled && !paused && !reducedMotion && inView && pageVisible && !interacting;\n\n const tick = useRef(onTick);\n useEffect(() => {\n tick.current = onTick;\n });\n\n useEffect(() => {\n if (!running) return;\n const id = setTimeout(() => tick.current(), Math.max(0, delay));\n return () => clearTimeout(id);\n }, [running, delay, resetKey]);\n\n const onPointerEnter = useCallback((event: PointerEvent<HTMLElement>) => {\n // Touch has no hover: a tap must not leave the loop paused.\n if (event.pointerType !== 'touch') setHovered(true);\n }, []);\n const onPointerLeave = useCallback(() => setHovered(false), []);\n const onFocus = useCallback((event?: FocusEvent<HTMLElement>) => {\n // Keyboard focus only: the focus a click or a tap leaves on a dot or a card must not hold the loop until the next blur.\n let keyboard = true;\n try {\n if (event) keyboard = event.target.matches(':focus-visible');\n } catch {\n /* :focus-visible unsupported — treat every focus as keyboard focus */\n }\n if (keyboard) setFocused(true);\n }, []);\n const onBlur = useCallback((event: FocusEvent<HTMLElement>) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) setFocused(false);\n }, []);\n\n return { running, reducedMotion, interactionProps: { onPointerEnter, onPointerLeave, onFocus, onBlur } };\n}\n\n/** Controlled / uncontrolled 0-based index, kept inside `0 … count - 1`. */\nexport function useIndexState(value: number | undefined, defaultValue: number, onValueChange: ((value: number) => void) | undefined, count: number) {\n const [inner, setInner] = useState(defaultValue);\n const clamp = (n: number) => (count > 0 ? Math.max(0, Math.min(Math.round(n), count - 1)) : 0);\n const current = clamp(value ?? inner);\n const changed = useRef(onValueChange);\n useEffect(() => {\n changed.current = onValueChange;\n });\n const set = useCallback(\n (next: number) => {\n setInner(next);\n changed.current?.(next);\n },\n [],\n );\n return [current, set] as const;\n}\n"],"mappings":"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"}
|
package/dist/index.d.cts
CHANGED
|
@@ -2817,26 +2817,22 @@ export interface HeroSwitcherProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
2817
2817
|
defaultValue?: string;
|
|
2818
2818
|
/** Called with the new value when the user picks a segment or autoplay advances. */
|
|
2819
2819
|
onValueChange?: (value: string) => void;
|
|
2820
|
-
/** Advances to the next item on its own
|
|
2820
|
+
/** Advances to the next item on its own, in an endless loop; after the user picks a segment it carries on from that item. */
|
|
2821
2821
|
autoPlay?: boolean;
|
|
2822
2822
|
/** Milliseconds each item stays before autoplay moves on (Figma prototype: 3s delay + 0.6s transition). */
|
|
2823
2823
|
interval?: number;
|
|
2824
|
-
/** Holds autoplay from outside (the selected item stays as it is). */
|
|
2824
|
+
/** Holds autoplay from outside (the selected item stays as it is); it carries on once this is `false` again. */
|
|
2825
2825
|
paused?: boolean;
|
|
2826
2826
|
/** Accessible name of the switch (tab list). */
|
|
2827
2827
|
"aria-label"?: string;
|
|
2828
2828
|
/** Heading level of the card title; pick the one that fits the page outline. */
|
|
2829
2829
|
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
2830
|
-
/** Accessible name of the pause button shown while autoplay runs. */
|
|
2831
|
-
pauseLabel?: string;
|
|
2832
|
-
/** Accessible name of the same button once autoplay is stopped. */
|
|
2833
|
-
playLabel?: string;
|
|
2834
2830
|
}
|
|
2835
2831
|
/**
|
|
2836
2832
|
* Photo, segmented switch and a sample request card that change together (Figma component set
|
|
2837
2833
|
* "Travel Requests / Hero switcher"). The switch is a real tab list — click or use the arrow keys — and autoplay
|
|
2838
|
-
*
|
|
2839
|
-
* for users who prefer reduced motion.
|
|
2834
|
+
* is an endless loop: it carries on from the segment the user picked, holds on hover and keyboard focus, off-screen
|
|
2835
|
+
* and in hidden tabs, and never starts for users who prefer reduced motion.
|
|
2840
2836
|
*/
|
|
2841
2837
|
export declare const HeroSwitcher: import("react").ForwardRefExoticComponent<HeroSwitcherProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
2842
2838
|
export interface HeroOrbitItem {
|
|
@@ -2944,22 +2940,18 @@ export interface HeroMapProps extends Omit<HTMLAttributes<HTMLDivElement>, "onCh
|
|
|
2944
2940
|
defaultActiveIndex?: number;
|
|
2945
2941
|
/** Called with the new index when autoplay advances. */
|
|
2946
2942
|
onActiveIndexChange?: (index: number) => void;
|
|
2947
|
-
/** Moves on to the next destination on its own. */
|
|
2943
|
+
/** Moves on to the next destination on its own, in an endless loop. */
|
|
2948
2944
|
autoPlay?: boolean;
|
|
2949
2945
|
/** Milliseconds each destination stays highlighted (Figma prototype: 2.2s delay + 0.5s transition). */
|
|
2950
2946
|
interval?: number;
|
|
2951
|
-
/** Holds autoplay from outside (the highlighted destination stays as it is). */
|
|
2947
|
+
/** Holds autoplay from outside (the highlighted destination stays as it is); it carries on once this is `false` again. */
|
|
2952
2948
|
paused?: boolean;
|
|
2953
|
-
/** Accessible name of the pause button shown while autoplay runs. */
|
|
2954
|
-
pauseLabel?: string;
|
|
2955
|
-
/** Accessible name of the same button once autoplay is stopped. */
|
|
2956
|
-
playLabel?: string;
|
|
2957
2949
|
}
|
|
2958
2950
|
/**
|
|
2959
2951
|
* Dotted map with a route from the origin to one sample request at a time (Figma component set "Join / Hero map").
|
|
2960
2952
|
* Every destination is a list item with its tag as real text, so the content does not depend on the animation;
|
|
2961
|
-
* autoplay
|
|
2962
|
-
*
|
|
2953
|
+
* autoplay loops endlessly, holds on hover, off-screen and in hidden tabs, and does not start for users who prefer
|
|
2954
|
+
* reduced motion.
|
|
2963
2955
|
*/
|
|
2964
2956
|
export declare const HeroMap: import("react").ForwardRefExoticComponent<HeroMapProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
2965
2957
|
export interface HowItWorksStepItem {
|
|
@@ -2983,18 +2975,14 @@ export interface HowItWorksStepsProps extends Omit<HTMLAttributes<HTMLDivElement
|
|
|
2983
2975
|
defaultValue?: string;
|
|
2984
2976
|
/** Called with the `value` of the step that became current, by a click or by auto-play. */
|
|
2985
2977
|
onValueChange?: (value: string) => void;
|
|
2986
|
-
/** Advances to the next step on a timer
|
|
2978
|
+
/** Advances to the next step on a timer, in an endless loop; after the user picks a step it carries on from that step. */
|
|
2987
2979
|
autoPlay?: boolean;
|
|
2988
2980
|
/** Time a step rests once its 500ms transition has finished, in ms (Figma: 2200 — a new step every 2.7s). */
|
|
2989
2981
|
interval?: number;
|
|
2990
|
-
/** Holds auto-play without unmounting it (e.g. while a dialog is open). */
|
|
2982
|
+
/** Holds auto-play without unmounting it (e.g. while a dialog is open); it carries on once this is `false` again. */
|
|
2991
2983
|
paused?: boolean;
|
|
2992
2984
|
/** Accessible name of the list of steps, e.g. "How it works". */
|
|
2993
2985
|
label?: string;
|
|
2994
|
-
/** Accessible name of the pause button shown while auto-playing. Translate it in the app. */
|
|
2995
|
-
pauseLabel?: string;
|
|
2996
|
-
/** Accessible name of the same button once auto-play is paused. Translate it in the app. */
|
|
2997
|
-
playLabel?: string;
|
|
2998
2986
|
/** Width of the component in px below which the steps stack (the Figma mobile layout). Default: 136px per step plus the gaps, at least 480. */
|
|
2999
2987
|
collapseBelow?: number;
|
|
3000
2988
|
}
|
|
@@ -3007,8 +2995,9 @@ export declare const HowItWorksStepTag: import("react").ForwardRefExoticComponen
|
|
|
3007
2995
|
/**
|
|
3008
2996
|
* The request journey as a numbered rail over a row of step cards, one of which is current
|
|
3009
2997
|
* (Figma "How it works / Steps"; its "Step=1…7" variants are the `value`). Every card is a button that makes its step
|
|
3010
|
-
* current; with `autoPlay` the steps also advance on a timer
|
|
3011
|
-
*
|
|
2998
|
+
* current; with `autoPlay` the steps also advance on a timer in an endless loop, which holds while the pointer or
|
|
2999
|
+
* keyboard focus is inside and carries on from the step the user picked. Below `collapseBelow` the cards stack and the
|
|
3000
|
+
* rail is dropped (Figma "Mobile / How it works / Steps").
|
|
3012
3001
|
*/
|
|
3013
3002
|
export declare const HowItWorksSteps: import("react").ForwardRefExoticComponent<HowItWorksStepsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3014
3003
|
export type ExampleRequestsHeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
@@ -3145,16 +3134,12 @@ export interface PackageAnimationProps extends Omit<HTMLAttributes<HTMLDivElemen
|
|
|
3145
3134
|
defaultValue?: number;
|
|
3146
3135
|
/** Called with the index of the card that comes to the front (click, keyboard focus or autoplay). */
|
|
3147
3136
|
onValueChange?: (value: number) => void;
|
|
3148
|
-
/** Swaps the cards by itself (the Figma prototype swaps on click only).
|
|
3137
|
+
/** Swaps the cards by itself, in an endless loop (the Figma prototype swaps on click only). Holds for hover, keyboard focus, a hidden tab, an off-screen stack and reduced motion. */
|
|
3149
3138
|
autoPlay?: boolean;
|
|
3150
3139
|
/** Time a card stays in front before the next swap, in ms. */
|
|
3151
3140
|
interval?: number;
|
|
3152
|
-
/** Holds the autoplay
|
|
3141
|
+
/** Holds the autoplay from outside; it carries on once this is `false` again. */
|
|
3153
3142
|
paused?: boolean;
|
|
3154
|
-
/** Name of the pause button shown with `autoPlay` — translate it. */
|
|
3155
|
-
pauseLabel?: string;
|
|
3156
|
-
/** Name of the play button shown with `autoPlay` — translate it. */
|
|
3157
|
-
playLabel?: string;
|
|
3158
3143
|
}
|
|
3159
3144
|
/**
|
|
3160
3145
|
* Two overlapping, tilted package cards that swap places (Figma component set "Package animation").
|
|
@@ -3173,15 +3158,15 @@ export interface PartnerCarouselProps extends Omit<HTMLAttributes<HTMLElement>,
|
|
|
3173
3158
|
defaultValue?: number;
|
|
3174
3159
|
/** Called with the new index when the carousel moves (swipe, dots or autoplay). */
|
|
3175
3160
|
onValueChange?: (value: number) => void;
|
|
3176
|
-
/** Moves one slide at a time by itself.
|
|
3161
|
+
/** Moves one slide at a time by itself, in an endless loop. Holds for hover, keyboard focus, a hidden tab, an off-screen carousel and reduced motion. */
|
|
3177
3162
|
autoPlay?: boolean;
|
|
3178
3163
|
/** Time a slide rests before the next move, in ms (Figma: 3000). */
|
|
3179
3164
|
interval?: number;
|
|
3180
|
-
/** Holds the autoplay
|
|
3165
|
+
/** Holds the autoplay from outside; it carries on once this is `false` again. */
|
|
3181
3166
|
paused?: boolean;
|
|
3182
3167
|
/** After the last slide the first one follows seamlessly, as in the Figma prototype. Needs more than two slides. */
|
|
3183
3168
|
loop?: boolean;
|
|
3184
|
-
/** Shows the dots
|
|
3169
|
+
/** Shows the dots. */
|
|
3185
3170
|
controls?: boolean;
|
|
3186
3171
|
/** Accessible name of a slide — translate it. */
|
|
3187
3172
|
getSlideLabel?: (index: number, count: number) => string;
|
|
@@ -3189,10 +3174,6 @@ export interface PartnerCarouselProps extends Omit<HTMLAttributes<HTMLElement>,
|
|
|
3189
3174
|
getPageLabel?: (page: number, pageCount: number) => string;
|
|
3190
3175
|
/** Name of the dots navigation — translate it. */
|
|
3191
3176
|
paginationLabel?: string;
|
|
3192
|
-
/** Name of the pause button — translate it. */
|
|
3193
|
-
pauseLabel?: string;
|
|
3194
|
-
/** Name of the play button — translate it. */
|
|
3195
|
-
playLabel?: string;
|
|
3196
3177
|
}
|
|
3197
3178
|
/**
|
|
3198
3179
|
* Carousel of partner cards (Figma component set "Home / Partner carousel"): a native scroll-snap track — so touch
|
|
@@ -3266,41 +3247,38 @@ export interface CtaSentenceExample {
|
|
|
3266
3247
|
key?: string;
|
|
3267
3248
|
/** Words and pills in reading order, e.g. `["I’d like", { value: "a Flight" }, "to", { value: "Paris" }]`. */
|
|
3268
3249
|
parts: CtaSentencePart[];
|
|
3269
|
-
/**
|
|
3250
|
+
/**
|
|
3251
|
+
* Insets the sentence by `spacing/3xl` on both sides so its lines break evenly. When the examples share one sentence
|
|
3252
|
+
* (see `CtaSentence`), the first example decides for all of them.
|
|
3253
|
+
*/
|
|
3270
3254
|
padded?: boolean;
|
|
3271
3255
|
}
|
|
3272
3256
|
export interface CtaSentenceProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
3273
|
-
/** The example
|
|
3257
|
+
/** The example requests the sentence cycles through. Any number. */
|
|
3274
3258
|
examples: CtaSentenceExample[];
|
|
3275
3259
|
/** Index (0-based) of the example shown — Figma "Example". Makes the component controlled. */
|
|
3276
3260
|
value?: number;
|
|
3277
3261
|
/** Example shown first when uncontrolled. */
|
|
3278
3262
|
defaultValue?: number;
|
|
3279
|
-
/** Called with the new index
|
|
3263
|
+
/** Called with the new index each time the sentence moves on to the next example. */
|
|
3280
3264
|
onValueChange?: (value: number) => void;
|
|
3281
|
-
/** Cycles through the examples by itself.
|
|
3265
|
+
/** Cycles through the examples by itself, endlessly. Holds for hover, focus, a hidden tab, an off-screen sentence and reduced motion. */
|
|
3282
3266
|
autoPlay?: boolean;
|
|
3283
3267
|
/** Time an example rests before the next one, in ms (Figma: 2600). */
|
|
3284
3268
|
interval?: number;
|
|
3285
|
-
/** Holds the autoplay
|
|
3269
|
+
/** Holds the autoplay. */
|
|
3286
3270
|
paused?: boolean;
|
|
3287
|
-
/** Shows the dots that pick an example and, with `autoPlay`, the pause / play button. */
|
|
3288
|
-
controls?: boolean;
|
|
3289
3271
|
/** Makes the pills buttons and is called with the example and part index of the pressed one, e.g. to open the request form. */
|
|
3290
3272
|
onPillClick?: (exampleIndex: number, partIndex: number) => void;
|
|
3291
|
-
/** Accessible name of a dot — translate it. */
|
|
3292
|
-
getPageLabel?: (page: number, pageCount: number) => string;
|
|
3293
|
-
/** Name of the dots navigation — translate it. */
|
|
3294
|
-
paginationLabel?: string;
|
|
3295
|
-
/** Name of the pause button — translate it. */
|
|
3296
|
-
pauseLabel?: string;
|
|
3297
|
-
/** Name of the play button — translate it. */
|
|
3298
|
-
playLabel?: string;
|
|
3299
3273
|
}
|
|
3300
3274
|
/**
|
|
3301
|
-
* A request written as
|
|
3302
|
-
*
|
|
3303
|
-
*
|
|
3275
|
+
* A request written as one sentence whose values are pills that look like selects (Figma component set
|
|
3276
|
+
* "How it works / CTA sentence"). The sentence stays where it is; every few seconds the values in the pills roll over
|
|
3277
|
+
* to the next example, one pill after another, endlessly. Each pill is as wide as its longest value, so nothing around
|
|
3278
|
+
* it moves. Only the values on show are exposed to assistive technology.
|
|
3279
|
+
*
|
|
3280
|
+
* The examples are expected to be the same sentence with different values (the same words and pills in the same
|
|
3281
|
+
* order). Examples built differently are shown one whole sentence at a time, fading from one to the next.
|
|
3304
3282
|
*/
|
|
3305
3283
|
export declare const CtaSentence: import("react").ForwardRefExoticComponent<CtaSentenceProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3306
3284
|
export interface SheetProps extends Omit<DialogProps, "size" | "placement" | "mobilePlacement" | "eyebrow" | "role"> {
|
package/dist/index.d.ts
CHANGED
|
@@ -2817,26 +2817,22 @@ export interface HeroSwitcherProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
2817
2817
|
defaultValue?: string;
|
|
2818
2818
|
/** Called with the new value when the user picks a segment or autoplay advances. */
|
|
2819
2819
|
onValueChange?: (value: string) => void;
|
|
2820
|
-
/** Advances to the next item on its own
|
|
2820
|
+
/** Advances to the next item on its own, in an endless loop; after the user picks a segment it carries on from that item. */
|
|
2821
2821
|
autoPlay?: boolean;
|
|
2822
2822
|
/** Milliseconds each item stays before autoplay moves on (Figma prototype: 3s delay + 0.6s transition). */
|
|
2823
2823
|
interval?: number;
|
|
2824
|
-
/** Holds autoplay from outside (the selected item stays as it is). */
|
|
2824
|
+
/** Holds autoplay from outside (the selected item stays as it is); it carries on once this is `false` again. */
|
|
2825
2825
|
paused?: boolean;
|
|
2826
2826
|
/** Accessible name of the switch (tab list). */
|
|
2827
2827
|
"aria-label"?: string;
|
|
2828
2828
|
/** Heading level of the card title; pick the one that fits the page outline. */
|
|
2829
2829
|
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
2830
|
-
/** Accessible name of the pause button shown while autoplay runs. */
|
|
2831
|
-
pauseLabel?: string;
|
|
2832
|
-
/** Accessible name of the same button once autoplay is stopped. */
|
|
2833
|
-
playLabel?: string;
|
|
2834
2830
|
}
|
|
2835
2831
|
/**
|
|
2836
2832
|
* Photo, segmented switch and a sample request card that change together (Figma component set
|
|
2837
2833
|
* "Travel Requests / Hero switcher"). The switch is a real tab list — click or use the arrow keys — and autoplay
|
|
2838
|
-
*
|
|
2839
|
-
* for users who prefer reduced motion.
|
|
2834
|
+
* is an endless loop: it carries on from the segment the user picked, holds on hover and keyboard focus, off-screen
|
|
2835
|
+
* and in hidden tabs, and never starts for users who prefer reduced motion.
|
|
2840
2836
|
*/
|
|
2841
2837
|
export declare const HeroSwitcher: import("react").ForwardRefExoticComponent<HeroSwitcherProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
2842
2838
|
export interface HeroOrbitItem {
|
|
@@ -2944,22 +2940,18 @@ export interface HeroMapProps extends Omit<HTMLAttributes<HTMLDivElement>, "onCh
|
|
|
2944
2940
|
defaultActiveIndex?: number;
|
|
2945
2941
|
/** Called with the new index when autoplay advances. */
|
|
2946
2942
|
onActiveIndexChange?: (index: number) => void;
|
|
2947
|
-
/** Moves on to the next destination on its own. */
|
|
2943
|
+
/** Moves on to the next destination on its own, in an endless loop. */
|
|
2948
2944
|
autoPlay?: boolean;
|
|
2949
2945
|
/** Milliseconds each destination stays highlighted (Figma prototype: 2.2s delay + 0.5s transition). */
|
|
2950
2946
|
interval?: number;
|
|
2951
|
-
/** Holds autoplay from outside (the highlighted destination stays as it is). */
|
|
2947
|
+
/** Holds autoplay from outside (the highlighted destination stays as it is); it carries on once this is `false` again. */
|
|
2952
2948
|
paused?: boolean;
|
|
2953
|
-
/** Accessible name of the pause button shown while autoplay runs. */
|
|
2954
|
-
pauseLabel?: string;
|
|
2955
|
-
/** Accessible name of the same button once autoplay is stopped. */
|
|
2956
|
-
playLabel?: string;
|
|
2957
2949
|
}
|
|
2958
2950
|
/**
|
|
2959
2951
|
* Dotted map with a route from the origin to one sample request at a time (Figma component set "Join / Hero map").
|
|
2960
2952
|
* Every destination is a list item with its tag as real text, so the content does not depend on the animation;
|
|
2961
|
-
* autoplay
|
|
2962
|
-
*
|
|
2953
|
+
* autoplay loops endlessly, holds on hover, off-screen and in hidden tabs, and does not start for users who prefer
|
|
2954
|
+
* reduced motion.
|
|
2963
2955
|
*/
|
|
2964
2956
|
export declare const HeroMap: import("react").ForwardRefExoticComponent<HeroMapProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
2965
2957
|
export interface HowItWorksStepItem {
|
|
@@ -2983,18 +2975,14 @@ export interface HowItWorksStepsProps extends Omit<HTMLAttributes<HTMLDivElement
|
|
|
2983
2975
|
defaultValue?: string;
|
|
2984
2976
|
/** Called with the `value` of the step that became current, by a click or by auto-play. */
|
|
2985
2977
|
onValueChange?: (value: string) => void;
|
|
2986
|
-
/** Advances to the next step on a timer
|
|
2978
|
+
/** Advances to the next step on a timer, in an endless loop; after the user picks a step it carries on from that step. */
|
|
2987
2979
|
autoPlay?: boolean;
|
|
2988
2980
|
/** Time a step rests once its 500ms transition has finished, in ms (Figma: 2200 — a new step every 2.7s). */
|
|
2989
2981
|
interval?: number;
|
|
2990
|
-
/** Holds auto-play without unmounting it (e.g. while a dialog is open). */
|
|
2982
|
+
/** Holds auto-play without unmounting it (e.g. while a dialog is open); it carries on once this is `false` again. */
|
|
2991
2983
|
paused?: boolean;
|
|
2992
2984
|
/** Accessible name of the list of steps, e.g. "How it works". */
|
|
2993
2985
|
label?: string;
|
|
2994
|
-
/** Accessible name of the pause button shown while auto-playing. Translate it in the app. */
|
|
2995
|
-
pauseLabel?: string;
|
|
2996
|
-
/** Accessible name of the same button once auto-play is paused. Translate it in the app. */
|
|
2997
|
-
playLabel?: string;
|
|
2998
2986
|
/** Width of the component in px below which the steps stack (the Figma mobile layout). Default: 136px per step plus the gaps, at least 480. */
|
|
2999
2987
|
collapseBelow?: number;
|
|
3000
2988
|
}
|
|
@@ -3007,8 +2995,9 @@ export declare const HowItWorksStepTag: import("react").ForwardRefExoticComponen
|
|
|
3007
2995
|
/**
|
|
3008
2996
|
* The request journey as a numbered rail over a row of step cards, one of which is current
|
|
3009
2997
|
* (Figma "How it works / Steps"; its "Step=1…7" variants are the `value`). Every card is a button that makes its step
|
|
3010
|
-
* current; with `autoPlay` the steps also advance on a timer
|
|
3011
|
-
*
|
|
2998
|
+
* current; with `autoPlay` the steps also advance on a timer in an endless loop, which holds while the pointer or
|
|
2999
|
+
* keyboard focus is inside and carries on from the step the user picked. Below `collapseBelow` the cards stack and the
|
|
3000
|
+
* rail is dropped (Figma "Mobile / How it works / Steps").
|
|
3012
3001
|
*/
|
|
3013
3002
|
export declare const HowItWorksSteps: import("react").ForwardRefExoticComponent<HowItWorksStepsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3014
3003
|
export type ExampleRequestsHeadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
@@ -3145,16 +3134,12 @@ export interface PackageAnimationProps extends Omit<HTMLAttributes<HTMLDivElemen
|
|
|
3145
3134
|
defaultValue?: number;
|
|
3146
3135
|
/** Called with the index of the card that comes to the front (click, keyboard focus or autoplay). */
|
|
3147
3136
|
onValueChange?: (value: number) => void;
|
|
3148
|
-
/** Swaps the cards by itself (the Figma prototype swaps on click only).
|
|
3137
|
+
/** Swaps the cards by itself, in an endless loop (the Figma prototype swaps on click only). Holds for hover, keyboard focus, a hidden tab, an off-screen stack and reduced motion. */
|
|
3149
3138
|
autoPlay?: boolean;
|
|
3150
3139
|
/** Time a card stays in front before the next swap, in ms. */
|
|
3151
3140
|
interval?: number;
|
|
3152
|
-
/** Holds the autoplay
|
|
3141
|
+
/** Holds the autoplay from outside; it carries on once this is `false` again. */
|
|
3153
3142
|
paused?: boolean;
|
|
3154
|
-
/** Name of the pause button shown with `autoPlay` — translate it. */
|
|
3155
|
-
pauseLabel?: string;
|
|
3156
|
-
/** Name of the play button shown with `autoPlay` — translate it. */
|
|
3157
|
-
playLabel?: string;
|
|
3158
3143
|
}
|
|
3159
3144
|
/**
|
|
3160
3145
|
* Two overlapping, tilted package cards that swap places (Figma component set "Package animation").
|
|
@@ -3173,15 +3158,15 @@ export interface PartnerCarouselProps extends Omit<HTMLAttributes<HTMLElement>,
|
|
|
3173
3158
|
defaultValue?: number;
|
|
3174
3159
|
/** Called with the new index when the carousel moves (swipe, dots or autoplay). */
|
|
3175
3160
|
onValueChange?: (value: number) => void;
|
|
3176
|
-
/** Moves one slide at a time by itself.
|
|
3161
|
+
/** Moves one slide at a time by itself, in an endless loop. Holds for hover, keyboard focus, a hidden tab, an off-screen carousel and reduced motion. */
|
|
3177
3162
|
autoPlay?: boolean;
|
|
3178
3163
|
/** Time a slide rests before the next move, in ms (Figma: 3000). */
|
|
3179
3164
|
interval?: number;
|
|
3180
|
-
/** Holds the autoplay
|
|
3165
|
+
/** Holds the autoplay from outside; it carries on once this is `false` again. */
|
|
3181
3166
|
paused?: boolean;
|
|
3182
3167
|
/** After the last slide the first one follows seamlessly, as in the Figma prototype. Needs more than two slides. */
|
|
3183
3168
|
loop?: boolean;
|
|
3184
|
-
/** Shows the dots
|
|
3169
|
+
/** Shows the dots. */
|
|
3185
3170
|
controls?: boolean;
|
|
3186
3171
|
/** Accessible name of a slide — translate it. */
|
|
3187
3172
|
getSlideLabel?: (index: number, count: number) => string;
|
|
@@ -3189,10 +3174,6 @@ export interface PartnerCarouselProps extends Omit<HTMLAttributes<HTMLElement>,
|
|
|
3189
3174
|
getPageLabel?: (page: number, pageCount: number) => string;
|
|
3190
3175
|
/** Name of the dots navigation — translate it. */
|
|
3191
3176
|
paginationLabel?: string;
|
|
3192
|
-
/** Name of the pause button — translate it. */
|
|
3193
|
-
pauseLabel?: string;
|
|
3194
|
-
/** Name of the play button — translate it. */
|
|
3195
|
-
playLabel?: string;
|
|
3196
3177
|
}
|
|
3197
3178
|
/**
|
|
3198
3179
|
* Carousel of partner cards (Figma component set "Home / Partner carousel"): a native scroll-snap track — so touch
|
|
@@ -3266,41 +3247,38 @@ export interface CtaSentenceExample {
|
|
|
3266
3247
|
key?: string;
|
|
3267
3248
|
/** Words and pills in reading order, e.g. `["I’d like", { value: "a Flight" }, "to", { value: "Paris" }]`. */
|
|
3268
3249
|
parts: CtaSentencePart[];
|
|
3269
|
-
/**
|
|
3250
|
+
/**
|
|
3251
|
+
* Insets the sentence by `spacing/3xl` on both sides so its lines break evenly. When the examples share one sentence
|
|
3252
|
+
* (see `CtaSentence`), the first example decides for all of them.
|
|
3253
|
+
*/
|
|
3270
3254
|
padded?: boolean;
|
|
3271
3255
|
}
|
|
3272
3256
|
export interface CtaSentenceProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
|
|
3273
|
-
/** The example
|
|
3257
|
+
/** The example requests the sentence cycles through. Any number. */
|
|
3274
3258
|
examples: CtaSentenceExample[];
|
|
3275
3259
|
/** Index (0-based) of the example shown — Figma "Example". Makes the component controlled. */
|
|
3276
3260
|
value?: number;
|
|
3277
3261
|
/** Example shown first when uncontrolled. */
|
|
3278
3262
|
defaultValue?: number;
|
|
3279
|
-
/** Called with the new index
|
|
3263
|
+
/** Called with the new index each time the sentence moves on to the next example. */
|
|
3280
3264
|
onValueChange?: (value: number) => void;
|
|
3281
|
-
/** Cycles through the examples by itself.
|
|
3265
|
+
/** Cycles through the examples by itself, endlessly. Holds for hover, focus, a hidden tab, an off-screen sentence and reduced motion. */
|
|
3282
3266
|
autoPlay?: boolean;
|
|
3283
3267
|
/** Time an example rests before the next one, in ms (Figma: 2600). */
|
|
3284
3268
|
interval?: number;
|
|
3285
|
-
/** Holds the autoplay
|
|
3269
|
+
/** Holds the autoplay. */
|
|
3286
3270
|
paused?: boolean;
|
|
3287
|
-
/** Shows the dots that pick an example and, with `autoPlay`, the pause / play button. */
|
|
3288
|
-
controls?: boolean;
|
|
3289
3271
|
/** Makes the pills buttons and is called with the example and part index of the pressed one, e.g. to open the request form. */
|
|
3290
3272
|
onPillClick?: (exampleIndex: number, partIndex: number) => void;
|
|
3291
|
-
/** Accessible name of a dot — translate it. */
|
|
3292
|
-
getPageLabel?: (page: number, pageCount: number) => string;
|
|
3293
|
-
/** Name of the dots navigation — translate it. */
|
|
3294
|
-
paginationLabel?: string;
|
|
3295
|
-
/** Name of the pause button — translate it. */
|
|
3296
|
-
pauseLabel?: string;
|
|
3297
|
-
/** Name of the play button — translate it. */
|
|
3298
|
-
playLabel?: string;
|
|
3299
3273
|
}
|
|
3300
3274
|
/**
|
|
3301
|
-
* A request written as
|
|
3302
|
-
*
|
|
3303
|
-
*
|
|
3275
|
+
* A request written as one sentence whose values are pills that look like selects (Figma component set
|
|
3276
|
+
* "How it works / CTA sentence"). The sentence stays where it is; every few seconds the values in the pills roll over
|
|
3277
|
+
* to the next example, one pill after another, endlessly. Each pill is as wide as its longest value, so nothing around
|
|
3278
|
+
* it moves. Only the values on show are exposed to assistive technology.
|
|
3279
|
+
*
|
|
3280
|
+
* The examples are expected to be the same sentence with different values (the same words and pills in the same
|
|
3281
|
+
* order). Examples built differently are shown one whole sentence at a time, fading from one to the next.
|
|
3304
3282
|
*/
|
|
3305
3283
|
export declare const CtaSentence: import("react").ForwardRefExoticComponent<CtaSentenceProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3306
3284
|
export interface SheetProps extends Omit<DialogProps, "size" | "placement" | "mobilePlacement" | "eyebrow" | "role"> {
|