@travel-match/ui 0.1.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.
Files changed (61) hide show
  1. package/README.md +1 -0
  2. package/dist/components/Checkbox/Checkbox.cjs +1 -1
  3. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  4. package/dist/components/Checkbox/Checkbox.js +29 -17
  5. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  6. package/dist/components/CtaSentence/CtaSentence.cjs +1 -1
  7. package/dist/components/CtaSentence/CtaSentence.cjs.map +1 -1
  8. package/dist/components/CtaSentence/CtaSentence.js +142 -69
  9. package/dist/components/CtaSentence/CtaSentence.js.map +1 -1
  10. package/dist/components/HeroColumns/heroMotion.cjs +1 -1
  11. package/dist/components/HeroColumns/heroMotion.cjs.map +1 -1
  12. package/dist/components/HeroColumns/heroMotion.js +7 -44
  13. package/dist/components/HeroColumns/heroMotion.js.map +1 -1
  14. package/dist/components/HeroMap/HeroMap.cjs +1 -1
  15. package/dist/components/HeroMap/HeroMap.cjs.map +1 -1
  16. package/dist/components/HeroMap/HeroMap.js +58 -67
  17. package/dist/components/HeroMap/HeroMap.js.map +1 -1
  18. package/dist/components/HeroSwitcher/HeroSwitcher.cjs +1 -1
  19. package/dist/components/HeroSwitcher/HeroSwitcher.cjs.map +1 -1
  20. package/dist/components/HeroSwitcher/HeroSwitcher.js +85 -92
  21. package/dist/components/HeroSwitcher/HeroSwitcher.js.map +1 -1
  22. package/dist/components/HowItWorksSteps/HowItWorksSteps.cjs +1 -1
  23. package/dist/components/HowItWorksSteps/HowItWorksSteps.cjs.map +1 -1
  24. package/dist/components/HowItWorksSteps/HowItWorksSteps.js +84 -102
  25. package/dist/components/HowItWorksSteps/HowItWorksSteps.js.map +1 -1
  26. package/dist/components/Logo/Logo.cjs +1 -1
  27. package/dist/components/Logo/Logo.cjs.map +1 -1
  28. package/dist/components/Logo/Logo.js +14 -13
  29. package/dist/components/Logo/Logo.js.map +1 -1
  30. package/dist/components/Logo/LogoArtwork.cjs +1 -1
  31. package/dist/components/Logo/LogoArtwork.cjs.map +1 -1
  32. package/dist/components/Logo/LogoArtwork.js +9 -2
  33. package/dist/components/Logo/LogoArtwork.js.map +1 -1
  34. package/dist/components/PackageAnimation/PackageAnimation.cjs +1 -1
  35. package/dist/components/PackageAnimation/PackageAnimation.cjs.map +1 -1
  36. package/dist/components/PackageAnimation/PackageAnimation.js +31 -40
  37. package/dist/components/PackageAnimation/PackageAnimation.js.map +1 -1
  38. package/dist/components/PartnerCarousel/PartnerCarousel.cjs +1 -1
  39. package/dist/components/PartnerCarousel/PartnerCarousel.cjs.map +1 -1
  40. package/dist/components/PartnerCarousel/PartnerCarousel.js +94 -101
  41. package/dist/components/PartnerCarousel/PartnerCarousel.js.map +1 -1
  42. package/dist/components/PartnerCarousel/autoplay.cjs +1 -1
  43. package/dist/components/PartnerCarousel/autoplay.cjs.map +1 -1
  44. package/dist/components/PartnerCarousel/autoplay.js +13 -9
  45. package/dist/components/PartnerCarousel/autoplay.js.map +1 -1
  46. package/dist/components/Select/Select.cjs +1 -1
  47. package/dist/components/Select/Select.cjs.map +1 -1
  48. package/dist/components/Select/Select.js +119 -112
  49. package/dist/components/Select/Select.js.map +1 -1
  50. package/dist/components/TextInput/PasswordInput.cjs +1 -1
  51. package/dist/components/TextInput/PasswordInput.cjs.map +1 -1
  52. package/dist/components/TextInput/PasswordInput.js +11 -11
  53. package/dist/components/TextInput/PasswordInput.js.map +1 -1
  54. package/dist/index.d.cts +54 -58
  55. package/dist/index.d.ts +54 -58
  56. package/dist/styles.css +1 -1
  57. package/package.json +17 -1
  58. package/dist/components/PartnerCarousel/AutoplayToggle.cjs +0 -2
  59. package/dist/components/PartnerCarousel/AutoplayToggle.cjs.map +0 -1
  60. package/dist/components/PartnerCarousel/AutoplayToggle.js +0 -36
  61. package/dist/components/PartnerCarousel/AutoplayToggle.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -213,6 +213,12 @@ export interface LogoProps extends Omit<SVGProps<SVGSVGElement>, "ref" | "childr
213
213
  variant?: LogoVariant;
214
214
  /** Height in px, or any CSS length. The width follows the artwork's aspect ratio. */
215
215
  height?: number | string;
216
+ /**
217
+ * Draws the whole logo (mark, "Travel" and "Match") in the variant's ink colour instead of the brand gradient.
218
+ * Figma's Authentication screens use the `white` logo this way on their photo panel, where the gradient would not
219
+ * read. The colour follows `color`, so it can be set with a class.
220
+ */
221
+ mono?: boolean;
216
222
  /** Accessible name. Pass an empty string when the logo is decorative (for example inside a link that already has a label). */
217
223
  title?: string;
218
224
  }
@@ -487,13 +493,19 @@ export interface PasswordInputProps extends Omit<TextInputProps, "type" | "endIc
487
493
  hidePasswordLabel?: string;
488
494
  /** Start with the password visible (Figma "Type=Password-eye-slashed"). */
489
495
  defaultVisible?: boolean;
496
+ /**
497
+ * What the toggle's icon stands for. `action` (default, as the component set draws its filled examples): the eye
498
+ * while the password is hidden ("show it"), the slashed eye while it is readable. `state`, as the Authentication
499
+ * screens use the same two variants: the slashed eye while the password is hidden, the eye while it is readable.
500
+ */
501
+ toggleIcon?: "action" | "state";
490
502
  /** Called when the user shows or hides the password. */
491
503
  onVisibleChange?: (visible: boolean) => void;
492
504
  }
493
505
  /**
494
506
  * Figma "Text inputs / Type=Password-eye-open · Password-eye-slashed": a `TextInput` with a show/hide toggle.
495
- * The eye shows while the password is hidden, the slashed eye while it is readable. Figma also puts a
496
- * lock in front — pass `startIcon={<LockIcon />}` for that.
507
+ * By default the eye shows while the password is hidden and the slashed eye while it is readable; `toggleIcon="state"`
508
+ * swaps them. Figma also puts a lock in front — pass `startIcon={<LockIcon />}` for that.
497
509
  */
498
510
  export declare const PasswordInput: import("react").ForwardRefExoticComponent<PasswordInputProps & import("react").RefAttributes<HTMLInputElement>>;
499
511
  export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement>, FormFieldProps {
@@ -810,13 +822,19 @@ export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement
810
822
  size?: CheckboxSize;
811
823
  /** Label shown next to the box. Without it pass `aria-label` or `aria-labelledby`. */
812
824
  children?: ReactNode;
825
+ /**
826
+ * Error text shown under the checkbox (Figma "Checkbox field / State=Error" with a "Field message" below it).
827
+ * Also marks the input invalid and describes it with the message.
828
+ */
829
+ error?: ReactNode;
813
830
  /** Class for the root `<label>`; every other prop (and the ref) goes to the native `<input>`. */
814
831
  className?: string;
815
832
  /** Inline style for the root `<label>`. */
816
833
  style?: CSSProperties;
817
834
  }
818
835
  /**
819
- * Figma component set "Checkbox" (State=Default → unchecked, State=Clicked → checked).
836
+ * Figma component set "Checkbox" (State=Default → unchecked, State=Clicked → checked) and "Checkbox field" (the box
837
+ * with its label; State=Error adds a message underneath).
820
838
  * A native `<input type="checkbox">`, so `checked` / `defaultChecked` / `onChange` / `name` / `required` work as usual.
821
839
  */
822
840
  export declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -2799,26 +2817,22 @@ export interface HeroSwitcherProps extends Omit<HTMLAttributes<HTMLDivElement>,
2799
2817
  defaultValue?: string;
2800
2818
  /** Called with the new value when the user picks a segment or autoplay advances. */
2801
2819
  onValueChange?: (value: string) => void;
2802
- /** Advances to the next item on its own until the user picks a segment or presses pause. */
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. */
2803
2821
  autoPlay?: boolean;
2804
2822
  /** Milliseconds each item stays before autoplay moves on (Figma prototype: 3s delay + 0.6s transition). */
2805
2823
  interval?: number;
2806
- /** 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. */
2807
2825
  paused?: boolean;
2808
2826
  /** Accessible name of the switch (tab list). */
2809
2827
  "aria-label"?: string;
2810
2828
  /** Heading level of the card title; pick the one that fits the page outline. */
2811
2829
  headingLevel?: 2 | 3 | 4 | 5 | 6;
2812
- /** Accessible name of the pause button shown while autoplay runs. */
2813
- pauseLabel?: string;
2814
- /** Accessible name of the same button once autoplay is stopped. */
2815
- playLabel?: string;
2816
2830
  }
2817
2831
  /**
2818
2832
  * Photo, segmented switch and a sample request card that change together (Figma component set
2819
2833
  * "Travel Requests / Hero switcher"). The switch is a real tab list — click or use the arrow keys — and autoplay
2820
- * stops for good once the user takes over, pauses on hover and focus, off-screen, in hidden tabs and never starts
2821
- * 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.
2822
2836
  */
2823
2837
  export declare const HeroSwitcher: import("react").ForwardRefExoticComponent<HeroSwitcherProps & import("react").RefAttributes<HTMLDivElement>>;
2824
2838
  export interface HeroOrbitItem {
@@ -2926,22 +2940,18 @@ export interface HeroMapProps extends Omit<HTMLAttributes<HTMLDivElement>, "onCh
2926
2940
  defaultActiveIndex?: number;
2927
2941
  /** Called with the new index when autoplay advances. */
2928
2942
  onActiveIndexChange?: (index: number) => void;
2929
- /** Moves on to the next destination on its own. */
2943
+ /** Moves on to the next destination on its own, in an endless loop. */
2930
2944
  autoPlay?: boolean;
2931
2945
  /** Milliseconds each destination stays highlighted (Figma prototype: 2.2s delay + 0.5s transition). */
2932
2946
  interval?: number;
2933
- /** 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. */
2934
2948
  paused?: boolean;
2935
- /** Accessible name of the pause button shown while autoplay runs. */
2936
- pauseLabel?: string;
2937
- /** Accessible name of the same button once autoplay is stopped. */
2938
- playLabel?: string;
2939
2949
  }
2940
2950
  /**
2941
2951
  * Dotted map with a route from the origin to one sample request at a time (Figma component set "Join / Hero map").
2942
2952
  * Every destination is a list item with its tag as real text, so the content does not depend on the animation;
2943
- * autoplay can be paused with the built-in button, holds on hover, off-screen and in hidden tabs, and does not start
2944
- * for users who prefer reduced motion.
2953
+ * autoplay loops endlessly, holds on hover, off-screen and in hidden tabs, and does not start for users who prefer
2954
+ * reduced motion.
2945
2955
  */
2946
2956
  export declare const HeroMap: import("react").ForwardRefExoticComponent<HeroMapProps & import("react").RefAttributes<HTMLDivElement>>;
2947
2957
  export interface HowItWorksStepItem {
@@ -2965,18 +2975,14 @@ export interface HowItWorksStepsProps extends Omit<HTMLAttributes<HTMLDivElement
2965
2975
  defaultValue?: string;
2966
2976
  /** Called with the `value` of the step that became current, by a click or by auto-play. */
2967
2977
  onValueChange?: (value: string) => void;
2968
- /** Advances to the next step on a timer and loops. Stops for good once the user picks a step or presses pause. */
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. */
2969
2979
  autoPlay?: boolean;
2970
2980
  /** Time a step rests once its 500ms transition has finished, in ms (Figma: 2200 — a new step every 2.7s). */
2971
2981
  interval?: number;
2972
- /** 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. */
2973
2983
  paused?: boolean;
2974
2984
  /** Accessible name of the list of steps, e.g. "How it works". */
2975
2985
  label?: string;
2976
- /** Accessible name of the pause button shown while auto-playing. Translate it in the app. */
2977
- pauseLabel?: string;
2978
- /** Accessible name of the same button once auto-play is paused. Translate it in the app. */
2979
- playLabel?: string;
2980
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. */
2981
2987
  collapseBelow?: number;
2982
2988
  }
@@ -2989,8 +2995,9 @@ export declare const HowItWorksStepTag: import("react").ForwardRefExoticComponen
2989
2995
  /**
2990
2996
  * The request journey as a numbered rail over a row of step cards, one of which is current
2991
2997
  * (Figma "How it works / Steps"; its "Step=1…7" variants are the `value`). Every card is a button that makes its step
2992
- * current; with `autoPlay` the steps also advance on a timer until the user takes over. Below `collapseBelow` the
2993
- * cards stack and the rail is dropped (Figma "Mobile / How it works / Steps").
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").
2994
3001
  */
2995
3002
  export declare const HowItWorksSteps: import("react").ForwardRefExoticComponent<HowItWorksStepsProps & import("react").RefAttributes<HTMLDivElement>>;
2996
3003
  export type ExampleRequestsHeadingLevel = 2 | 3 | 4 | 5 | 6;
@@ -3127,16 +3134,12 @@ export interface PackageAnimationProps extends Omit<HTMLAttributes<HTMLDivElemen
3127
3134
  defaultValue?: number;
3128
3135
  /** Called with the index of the card that comes to the front (click, keyboard focus or autoplay). */
3129
3136
  onValueChange?: (value: number) => void;
3130
- /** Swaps the cards by itself (the Figma prototype swaps on click only). Stops for hover, focus, a hidden tab, an off-screen stack and reduced motion. */
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. */
3131
3138
  autoPlay?: boolean;
3132
3139
  /** Time a card stays in front before the next swap, in ms. */
3133
3140
  interval?: number;
3134
- /** Holds the autoplay (the pause control stays available). */
3141
+ /** Holds the autoplay from outside; it carries on once this is `false` again. */
3135
3142
  paused?: boolean;
3136
- /** Name of the pause button shown with `autoPlay` — translate it. */
3137
- pauseLabel?: string;
3138
- /** Name of the play button shown with `autoPlay` — translate it. */
3139
- playLabel?: string;
3140
3143
  }
3141
3144
  /**
3142
3145
  * Two overlapping, tilted package cards that swap places (Figma component set "Package animation").
@@ -3155,15 +3158,15 @@ export interface PartnerCarouselProps extends Omit<HTMLAttributes<HTMLElement>,
3155
3158
  defaultValue?: number;
3156
3159
  /** Called with the new index when the carousel moves (swipe, dots or autoplay). */
3157
3160
  onValueChange?: (value: number) => void;
3158
- /** Moves one slide at a time by itself. Stops for hover, focus, a hidden tab, an off-screen carousel and reduced motion. */
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. */
3159
3162
  autoPlay?: boolean;
3160
3163
  /** Time a slide rests before the next move, in ms (Figma: 3000). */
3161
3164
  interval?: number;
3162
- /** Holds the autoplay (the pause control stays available). */
3165
+ /** Holds the autoplay from outside; it carries on once this is `false` again. */
3163
3166
  paused?: boolean;
3164
3167
  /** After the last slide the first one follows seamlessly, as in the Figma prototype. Needs more than two slides. */
3165
3168
  loop?: boolean;
3166
- /** Shows the dots and, with `autoPlay`, the pause / play button. */
3169
+ /** Shows the dots. */
3167
3170
  controls?: boolean;
3168
3171
  /** Accessible name of a slide — translate it. */
3169
3172
  getSlideLabel?: (index: number, count: number) => string;
@@ -3171,10 +3174,6 @@ export interface PartnerCarouselProps extends Omit<HTMLAttributes<HTMLElement>,
3171
3174
  getPageLabel?: (page: number, pageCount: number) => string;
3172
3175
  /** Name of the dots navigation — translate it. */
3173
3176
  paginationLabel?: string;
3174
- /** Name of the pause button — translate it. */
3175
- pauseLabel?: string;
3176
- /** Name of the play button — translate it. */
3177
- playLabel?: string;
3178
3177
  }
3179
3178
  /**
3180
3179
  * Carousel of partner cards (Figma component set "Home / Partner carousel"): a native scroll-snap track — so touch
@@ -3248,41 +3247,38 @@ export interface CtaSentenceExample {
3248
3247
  key?: string;
3249
3248
  /** Words and pills in reading order, e.g. `["I’d like", { value: "a Flight" }, "to", { value: "Paris" }]`. */
3250
3249
  parts: CtaSentencePart[];
3251
- /** Insets the sentence by `spacing/3xl` on both sides so its lines break evenly (Figma does this on Example 2). */
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
+ */
3252
3254
  padded?: boolean;
3253
3255
  }
3254
3256
  export interface CtaSentenceProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue"> {
3255
- /** The example sentences the component cycles through. Any number. */
3257
+ /** The example requests the sentence cycles through. Any number. */
3256
3258
  examples: CtaSentenceExample[];
3257
3259
  /** Index (0-based) of the example shown — Figma "Example". Makes the component controlled. */
3258
3260
  value?: number;
3259
3261
  /** Example shown first when uncontrolled. */
3260
3262
  defaultValue?: number;
3261
- /** Called with the new index when the example changes (autoplay or dots). */
3263
+ /** Called with the new index each time the sentence moves on to the next example. */
3262
3264
  onValueChange?: (value: number) => void;
3263
- /** Cycles through the examples by itself. Stops for hover, focus, a hidden tab, an off-screen sentence and reduced motion. */
3265
+ /** Cycles through the examples by itself, endlessly. Holds for hover, focus, a hidden tab, an off-screen sentence and reduced motion. */
3264
3266
  autoPlay?: boolean;
3265
3267
  /** Time an example rests before the next one, in ms (Figma: 2600). */
3266
3268
  interval?: number;
3267
- /** Holds the autoplay (the pause control stays available). */
3269
+ /** Holds the autoplay. */
3268
3270
  paused?: boolean;
3269
- /** Shows the dots that pick an example and, with `autoPlay`, the pause / play button. */
3270
- controls?: boolean;
3271
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. */
3272
3272
  onPillClick?: (exampleIndex: number, partIndex: number) => void;
3273
- /** Accessible name of a dot — translate it. */
3274
- getPageLabel?: (page: number, pageCount: number) => string;
3275
- /** Name of the dots navigation — translate it. */
3276
- paginationLabel?: string;
3277
- /** Name of the pause button — translate it. */
3278
- pauseLabel?: string;
3279
- /** Name of the play button — translate it. */
3280
- playLabel?: string;
3281
3273
  }
3282
3274
  /**
3283
- * A request written as a sentence whose values are pills, cycling through examples
3284
- * (Figma component set "How it works / CTA sentence"). Every example is real text; the one on show is the only one
3285
- * exposed to assistive technology, and the dots reach the others.
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.
3286
3282
  */
3287
3283
  export declare const CtaSentence: import("react").ForwardRefExoticComponent<CtaSentenceProps & import("react").RefAttributes<HTMLDivElement>>;
3288
3284
  export interface SheetProps extends Omit<DialogProps, "size" | "placement" | "mobilePlacement" | "eyebrow" | "role"> {