@travel-match/ui 0.3.0 → 0.5.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 (161) hide show
  1. package/dist/components/AccountMenu/AccountMenu.cjs +1 -1
  2. package/dist/components/AccountMenu/AccountMenu.cjs.map +1 -1
  3. package/dist/components/AccountMenu/AccountMenu.js +1 -1
  4. package/dist/components/AccountMenu/AccountMenu.js.map +1 -1
  5. package/dist/components/ConfirmationDialog/ConfirmationDialog.cjs +1 -1
  6. package/dist/components/ConfirmationDialog/ConfirmationDialog.cjs.map +1 -1
  7. package/dist/components/ConfirmationDialog/ConfirmationDialog.js +1 -0
  8. package/dist/components/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
  9. package/dist/components/CtaRequestFlow/CtaRequestFlow.cjs +1 -1
  10. package/dist/components/CtaRequestFlow/CtaRequestFlow.cjs.map +1 -1
  11. package/dist/components/CtaRequestFlow/CtaRequestFlow.js +72 -37
  12. package/dist/components/CtaRequestFlow/CtaRequestFlow.js.map +1 -1
  13. package/dist/components/ExampleRequests/ExampleRequests.cjs +1 -1
  14. package/dist/components/ExampleRequests/ExampleRequests.cjs.map +1 -1
  15. package/dist/components/ExampleRequests/ExampleRequests.js +18 -17
  16. package/dist/components/ExampleRequests/ExampleRequests.js.map +1 -1
  17. package/dist/components/FaqItem/FaqItem.cjs +1 -1
  18. package/dist/components/FaqItem/FaqItem.cjs.map +1 -1
  19. package/dist/components/FaqItem/FaqItem.js +79 -34
  20. package/dist/components/FaqItem/FaqItem.js.map +1 -1
  21. package/dist/components/Field/Field.cjs +1 -1
  22. package/dist/components/Field/Field.cjs.map +1 -1
  23. package/dist/components/Field/Field.js +10 -8
  24. package/dist/components/Field/Field.js.map +1 -1
  25. package/dist/components/HowItWorksSteps/HowItWorksSteps.cjs +1 -1
  26. package/dist/components/HowItWorksSteps/HowItWorksSteps.cjs.map +1 -1
  27. package/dist/components/HowItWorksSteps/HowItWorksSteps.js +1 -1
  28. package/dist/components/HowItWorksSteps/HowItWorksSteps.js.map +1 -1
  29. package/dist/components/InlineAlert/InlineAlert.cjs +1 -1
  30. package/dist/components/InlineAlert/InlineAlert.cjs.map +1 -1
  31. package/dist/components/InlineAlert/InlineAlert.js +9 -8
  32. package/dist/components/InlineAlert/InlineAlert.js.map +1 -1
  33. package/dist/components/LogoAnimation/LogoAnimation.cjs +2 -0
  34. package/dist/components/LogoAnimation/LogoAnimation.cjs.map +1 -0
  35. package/dist/components/LogoAnimation/LogoAnimation.js +202 -0
  36. package/dist/components/LogoAnimation/LogoAnimation.js.map +1 -0
  37. package/dist/components/LogoAnimation/LogoAnimationArtwork.cjs +2 -0
  38. package/dist/components/LogoAnimation/LogoAnimationArtwork.cjs.map +1 -0
  39. package/dist/components/LogoAnimation/LogoAnimationArtwork.js +57 -0
  40. package/dist/components/LogoAnimation/LogoAnimationArtwork.js.map +1 -0
  41. package/dist/components/LogoAnimation/motion.cjs +2 -0
  42. package/dist/components/LogoAnimation/motion.cjs.map +1 -0
  43. package/dist/components/LogoAnimation/motion.js +180 -0
  44. package/dist/components/LogoAnimation/motion.js.map +1 -0
  45. package/dist/components/NewRequestOverlay/NewRequestOverlay.cjs +1 -1
  46. package/dist/components/NewRequestOverlay/NewRequestOverlay.cjs.map +1 -1
  47. package/dist/components/NewRequestOverlay/NewRequestOverlay.js +67 -48
  48. package/dist/components/NewRequestOverlay/NewRequestOverlay.js.map +1 -1
  49. package/dist/components/NotificationsDropdown/NotificationsMenu.cjs +1 -1
  50. package/dist/components/NotificationsDropdown/NotificationsMenu.cjs.map +1 -1
  51. package/dist/components/NotificationsDropdown/NotificationsMenu.js +1 -1
  52. package/dist/components/NotificationsDropdown/NotificationsMenu.js.map +1 -1
  53. package/dist/components/PackageAnimation/PackageAnimation.cjs +1 -1
  54. package/dist/components/PackageAnimation/PackageAnimation.cjs.map +1 -1
  55. package/dist/components/PackageAnimation/PackageAnimation.js +1 -1
  56. package/dist/components/PackageAnimation/PackageAnimation.js.map +1 -1
  57. package/dist/components/PartnerCarousel/PartnerCarousel.cjs.map +1 -1
  58. package/dist/components/PartnerCarousel/PartnerCarousel.js.map +1 -1
  59. package/dist/components/PhoneInput/PhoneInput.cjs +1 -1
  60. package/dist/components/PhoneInput/PhoneInput.cjs.map +1 -1
  61. package/dist/components/PhoneInput/PhoneInput.js +8 -5
  62. package/dist/components/PhoneInput/PhoneInput.js.map +1 -1
  63. package/dist/components/PopularQuestions/PopularQuestions.cjs +1 -1
  64. package/dist/components/PopularQuestions/PopularQuestions.cjs.map +1 -1
  65. package/dist/components/PopularQuestions/PopularQuestions.js +22 -21
  66. package/dist/components/PopularQuestions/PopularQuestions.js.map +1 -1
  67. package/dist/components/RegionMap/RegionMap.cjs +2 -0
  68. package/dist/components/RegionMap/RegionMap.cjs.map +1 -0
  69. package/dist/components/RegionMap/RegionMap.js +55 -0
  70. package/dist/components/RegionMap/RegionMap.js.map +1 -0
  71. package/dist/components/RegionMap/mapPaths.cjs +2 -0
  72. package/dist/components/RegionMap/mapPaths.cjs.map +1 -0
  73. package/dist/components/RegionMap/mapPaths.js +86 -0
  74. package/dist/components/RegionMap/mapPaths.js.map +1 -0
  75. package/dist/components/RequestSearch/RequestSearch.cjs +2 -0
  76. package/dist/components/RequestSearch/RequestSearch.cjs.map +1 -0
  77. package/dist/components/RequestSearch/RequestSearch.js +36 -0
  78. package/dist/components/RequestSearch/RequestSearch.js.map +1 -0
  79. package/dist/components/RequestSummary/RequestSummary.cjs +1 -1
  80. package/dist/components/RequestSummary/RequestSummary.cjs.map +1 -1
  81. package/dist/components/RequestSummary/RequestSummary.js +31 -32
  82. package/dist/components/RequestSummary/RequestSummary.js.map +1 -1
  83. package/dist/components/RequestTypeOption/RequestTypeOption.cjs +2 -0
  84. package/dist/components/RequestTypeOption/RequestTypeOption.cjs.map +1 -0
  85. package/dist/components/RequestTypeOption/RequestTypeOption.js +52 -0
  86. package/dist/components/RequestTypeOption/RequestTypeOption.js.map +1 -0
  87. package/dist/components/Select/Select.cjs +1 -1
  88. package/dist/components/Select/Select.cjs.map +1 -1
  89. package/dist/components/Select/Select.js +127 -121
  90. package/dist/components/Select/Select.js.map +1 -1
  91. package/dist/components/ShowMore/ShowMore.cjs +2 -0
  92. package/dist/components/ShowMore/ShowMore.cjs.map +1 -0
  93. package/dist/components/ShowMore/ShowMore.js +34 -0
  94. package/dist/components/ShowMore/ShowMore.js.map +1 -0
  95. package/dist/components/SiteHeader/SiteHeader.cjs.map +1 -1
  96. package/dist/components/SiteHeader/SiteHeader.js.map +1 -1
  97. package/dist/components/SortSelect/SortSelect.cjs +2 -0
  98. package/dist/components/SortSelect/SortSelect.cjs.map +1 -0
  99. package/dist/components/SortSelect/SortSelect.js +18 -0
  100. package/dist/components/SortSelect/SortSelect.js.map +1 -0
  101. package/dist/components/StatusFilter/StatusFilter.cjs +2 -0
  102. package/dist/components/StatusFilter/StatusFilter.cjs.map +1 -0
  103. package/dist/components/StatusFilter/StatusFilter.js +37 -0
  104. package/dist/components/StatusFilter/StatusFilter.js.map +1 -0
  105. package/dist/components/StatusTag/StatusTag.cjs.map +1 -1
  106. package/dist/components/StatusTag/StatusTag.js.map +1 -1
  107. package/dist/components/StepCard/StepCard.cjs +1 -1
  108. package/dist/components/StepCard/StepCard.cjs.map +1 -1
  109. package/dist/components/StepCard/StepCard.js +9 -6
  110. package/dist/components/StepCard/StepCard.js.map +1 -1
  111. package/dist/components/StepProgress/StepProgress.cjs +2 -0
  112. package/dist/components/StepProgress/StepProgress.cjs.map +1 -0
  113. package/dist/components/StepProgress/StepProgress.js +43 -0
  114. package/dist/components/StepProgress/StepProgress.js.map +1 -0
  115. package/dist/components/TelegramConnect/TelegramConnect.cjs +2 -0
  116. package/dist/components/TelegramConnect/TelegramConnect.cjs.map +1 -0
  117. package/dist/components/TelegramConnect/TelegramConnect.js +57 -0
  118. package/dist/components/TelegramConnect/TelegramConnect.js.map +1 -0
  119. package/dist/components/TextInput/TextInput.cjs +1 -1
  120. package/dist/components/TextInput/TextInput.cjs.map +1 -1
  121. package/dist/components/TextInput/TextInput.js +21 -19
  122. package/dist/components/TextInput/TextInput.js.map +1 -1
  123. package/dist/components/Textarea/Textarea.cjs +1 -1
  124. package/dist/components/Textarea/Textarea.cjs.map +1 -1
  125. package/dist/components/Textarea/Textarea.js +18 -16
  126. package/dist/components/Textarea/Textarea.js.map +1 -1
  127. package/dist/components/Toast/Toast.cjs +2 -0
  128. package/dist/components/Toast/Toast.cjs.map +1 -0
  129. package/dist/components/Toast/Toast.js +57 -0
  130. package/dist/components/Toast/Toast.js.map +1 -0
  131. package/dist/icons/generated/CheckmarkIcon.cjs +1 -1
  132. package/dist/icons/generated/CheckmarkIcon.cjs.map +1 -1
  133. package/dist/icons/generated/CheckmarkIcon.js +19 -2
  134. package/dist/icons/generated/CheckmarkIcon.js.map +1 -1
  135. package/dist/icons/generated/InfoIcon.cjs +2 -0
  136. package/dist/icons/generated/InfoIcon.cjs.map +1 -0
  137. package/dist/icons/generated/InfoIcon.js +35 -0
  138. package/dist/icons/generated/InfoIcon.js.map +1 -0
  139. package/dist/icons/generated/SendIcon.cjs +2 -0
  140. package/dist/icons/generated/SendIcon.cjs.map +1 -0
  141. package/dist/icons/generated/SendIcon.js +23 -0
  142. package/dist/icons/generated/SendIcon.js.map +1 -0
  143. package/dist/icons/generated/index.cjs +1 -1
  144. package/dist/icons/generated/index.cjs.map +1 -1
  145. package/dist/icons/generated/index.js +71 -67
  146. package/dist/icons/generated/index.js.map +1 -1
  147. package/dist/index.cjs +1 -1
  148. package/dist/index.d.cts +649 -34
  149. package/dist/index.d.ts +649 -34
  150. package/dist/index.js +146 -134
  151. package/dist/styles.css +1 -1
  152. package/dist/tailwind.css +0 -6
  153. package/dist/tokens/generated.cjs +1 -1
  154. package/dist/tokens/generated.cjs.map +1 -1
  155. package/dist/tokens/generated.js +1 -7
  156. package/dist/tokens/generated.js.map +1 -1
  157. package/dist/tokens.css +0 -12
  158. package/dist/tokens.d.cts +2 -26
  159. package/dist/tokens.d.ts +2 -26
  160. package/dist/tokens.json +1 -7
  161. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Field.cjs","names":["cn","CheckmarkIcon","ErrorCircleIcon","useId","require_CheckmarkIcon","require_ErrorCircleIcon","require_cn","react","react_jsx_runtime","Label","props","className","size","children","required","optional","FieldMessage","tone","icon","useFieldIds","generated","controlId","id","hasMessage","FormField","message","error","helperText","label","ids","helperIcon"],"sources":["../../../src/components/Field/Field.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes, type LabelHTMLAttributes, type ReactNode } from 'react';\nimport { CheckmarkIcon, ErrorCircleIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './Field.css';\n\n/** Figma \"Size\" on every form control: L · M · S */\nexport type FieldSize = 'lg' | 'md' | 'sm';\n\n// ── Label ────────────────────────────────────────────────────────────\nexport interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n /** Figma \"Size\": `lg` Label-large · `md` Label · `sm` Label-small. */\n size?: FieldSize;\n /** Adds the red asterisk (Figma \"Style=Required\"). */\n required?: boolean;\n /** Adds the \"(Optional)\" hint (Figma \"Style=Optional\"). Pass a string to translate it. */\n optional?: boolean | string;\n}\n\n/** Figma component set \"Label title\". */\nexport const Label = /* @__PURE__ */ forwardRef<HTMLLabelElement, LabelProps>(function Label(\n { size = 'md', required, optional, className, children, ...props },\n ref,\n) {\n return (\n <label ref={ref} className={cn('tm-label', className)} data-size={size} {...props}>\n {children}\n {required ? (\n <span className=\"tm-label__required\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n {optional ? <span className=\"tm-label__optional\">{typeof optional === 'string' ? optional : '(Optional)'}</span> : null}\n </label>\n );\n});\n\n// ── Message ──────────────────────────────────────────────────────────\nexport interface FieldMessageProps extends HTMLAttributes<HTMLParagraphElement> {\n /**\n * `neutral` helper text (Figma \"Field message / Type=Hint\"), `error` with the error icon and colours\n * (Figma \"State=Error\", \"Field message / Type=Error\"), `success` with a check mark in success/content\n * (Figma \"Field message / Type=Success\", node 2606:16067).\n */\n tone?: 'neutral' | 'error' | 'success';\n /** Size of the control the message belongs to; sets the text style and icon size. */\n size?: FieldSize;\n /** Leading icon (Figma \"Style=With-icon-helper-text\"). Defaults to `true` for errors and success, `false` for helper text. */\n icon?: boolean;\n}\n\n/** Helper or error text shown under a control (Figma \"Inputs / With-helper-text\", \"Text inputs / State=Error\"). */\nexport const FieldMessage = /* @__PURE__ */ forwardRef<HTMLParagraphElement, FieldMessageProps>(function FieldMessage(\n { tone = 'neutral', size = 'md', icon = tone !== 'neutral', className, children, ...props },\n ref,\n) {\n return (\n <p ref={ref} className={cn('tm-field-message', className)} data-tone={tone} data-size={size} {...props}>\n {/* Figma: 20px icon next to the L message, 16px at M and S */}\n {icon ? tone === 'success' ? <CheckmarkIcon size={size === 'lg' ? 'md' : 'sm'} /> : <ErrorCircleIcon size={size === 'lg' ? 'md' : 'sm'} /> : null}\n <span>{children}</span>\n </p>\n );\n});\n\n// ── Form field wrapper ───────────────────────────────────────────────\nexport interface FormFieldProps {\n /** Visible label. Omit it only when the control has its own accessible name. */\n label?: ReactNode;\n /** Help text under the control. Replaced by `error` when both are set. */\n helperText?: ReactNode;\n /** Error text under the control; also switches the control to its invalid look. */\n error?: ReactNode;\n /** Marks the label with a red asterisk. */\n required?: boolean;\n /** Adds the \"(Optional)\" hint to the label. Pass a string to translate it. */\n optional?: boolean | string;\n /** Figma \"Size\": L · M · S. */\n size?: FieldSize;\n}\n\nexport interface FieldIds {\n /** id for the focusable control — also the label's `htmlFor`. */\n controlId: string;\n labelId: string;\n /** id of the helper/error text, or undefined when there is none; use it for `aria-describedby`. */\n messageId: string | undefined;\n}\n\n/** Stable ids that tie a control to its label and message. Pass the consumer's `id` to respect it. */\nexport function useFieldIds(id: string | undefined, hasMessage: boolean): FieldIds {\n const generated = useId();\n const controlId = id ?? `tm-${generated}`;\n return { controlId, labelId: `${controlId}-label`, messageId: hasMessage ? `${controlId}-message` : undefined };\n}\n\ninterface FormFieldLayoutProps extends FormFieldProps, Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n ids: FieldIds;\n /** Shows the info icon in front of `helperText` (Figma \"Style=With-icon-helper-text\"). Errors always have their icon. */\n helperIcon?: boolean;\n /** The control, normally a `.tm-field` box. */\n children: ReactNode;\n}\n\n/**\n * Lays out label → control → message. Building block for the form controls in this package\n * (TextInput, Select, …); apps normally use those instead of this component.\n */\nexport const FormField = /* @__PURE__ */ forwardRef<HTMLDivElement, FormFieldLayoutProps>(function FormField(\n { ids, label, helperText, error, required, optional, size = 'md', helperIcon, className, children, ...props },\n ref,\n) {\n const message = error || helperText;\n return (\n <div ref={ref} className={cn('tm-form-field', className)} data-size={size} {...props}>\n {label ? (\n <Label id={ids.labelId} htmlFor={ids.controlId} size={size} required={required} optional={optional}>\n {label}\n </Label>\n ) : null}\n {children}\n {message ? (\n <FieldMessage id={ids.messageId} tone={error ? 'error' : 'neutral'} size={size} icon={error ? true : helperIcon}>\n {message}\n </FieldMessage>\n ) : null}\n </div>\n );\n});\n"],"mappings":"A,gPAmBA,IAAaS,GAAwB,EAAAF,EAAA,WAAA,CAAyC,SAC5E,CAAE,OAAO,KAAM,WAAU,WAAU,YAAW,WAAU,GAAGG,GAC3D,EACA,CACA,OACE,EAAAF,EAAA,KAAA,CAAC,QAAD,CAAY,MAAK,UAAWR,EAAAA,GAAG,WAAYW,CAAS,EAAG,YAAWC,EAAM,GAAIF,EAA5E,SAAA,CACGG,EACAC,GACC,EAAAN,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,qBAAqB,cAAY,OAAO,SAAA,GAElD,CAAA,EACJ,KACHO,GAAW,EAAAP,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,qBAAsB,SAAA,OAAOO,GAAa,SAAWA,EAAW,YAAmB,CAAA,EAAI,IAC9G,C,EAEX,CAAC,EAiBYC,GAA+B,EAAAT,EAAA,WAAA,CAAoD,SAC9F,CAAE,OAAO,UAAW,OA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AAiB,OAAM,KAAMA,EAAQ,GAAOI,EAClG,SAAAL,CACW,CAAA,EACZ,IACD,C,EAET,CAAC,E"}
1
+ {"version":3,"file":"Field.cjs","names":["cn","CheckmarkIcon","ErrorCircleIcon","useId","require_CheckmarkIcon","require_ErrorCircleIcon","require_cn","react","react_jsx_runtime","Label","props","className","size","children","required","optional","FieldMessage","tone","icon","useFieldIds","generated","controlId","id","hasMessage","FormField","message","error","helperText","errorColor","errorBox","label","ids","helperIcon"],"sources":["../../../src/components/Field/Field.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes, type LabelHTMLAttributes, type ReactNode } from 'react';\nimport { CheckmarkIcon, ErrorCircleIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './Field.css';\n\n/** Figma \"Size\" on every form control: L · M · S */\nexport type FieldSize = 'lg' | 'md' | 'sm';\n\n// ── Label ────────────────────────────────────────────────────────────\nexport interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n /** Figma \"Size\": `lg` Label-large · `md` Label · `sm` Label-small. */\n size?: FieldSize;\n /** Adds the red asterisk (Figma \"Style=Required\"). */\n required?: boolean;\n /** Adds the \"(Optional)\" hint (Figma \"Style=Optional\"). Pass a string to translate it. */\n optional?: boolean | string;\n}\n\n/** Figma component set \"Label title\". */\nexport const Label = /* @__PURE__ */ forwardRef<HTMLLabelElement, LabelProps>(function Label(\n { size = 'md', required, optional, className, children, ...props },\n ref,\n) {\n return (\n <label ref={ref} className={cn('tm-label', className)} data-size={size} {...props}>\n {children}\n {required ? (\n <span className=\"tm-label__required\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n {optional ? <span className=\"tm-label__optional\">{typeof optional === 'string' ? optional : '(Optional)'}</span> : null}\n </label>\n );\n});\n\n// ── Message ──────────────────────────────────────────────────────────\nexport interface FieldMessageProps extends HTMLAttributes<HTMLParagraphElement> {\n /**\n * `neutral` helper text (Figma \"Field message / Type=Hint\"), `error` with the error icon and colours\n * (Figma \"State=Error\", \"Field message / Type=Error\"), `success` with a check mark in success/content\n * (Figma \"Field message / Type=Success\", node 2606:16067).\n */\n tone?: 'neutral' | 'error' | 'success';\n /** Size of the control the message belongs to; sets the text style and icon size. */\n size?: FieldSize;\n /** Leading icon (Figma \"Style=With-icon-helper-text\"). Defaults to `true` for errors and success, `false` for helper text. */\n icon?: boolean;\n}\n\n/** Helper or error text shown under a control (Figma \"Inputs / With-helper-text\", \"Text inputs / State=Error\"). */\nexport const FieldMessage = /* @__PURE__ */ forwardRef<HTMLParagraphElement, FieldMessageProps>(function FieldMessage(\n { tone = 'neutral', size = 'md', icon = tone !== 'neutral', className, children, ...props },\n ref,\n) {\n return (\n <p ref={ref} className={cn('tm-field-message', className)} data-tone={tone} data-size={size} {...props}>\n {/* Figma: 20px icon next to the L message, 16px at M and S */}\n {icon ? tone === 'success' ? <CheckmarkIcon size={size === 'lg' ? 'md' : 'sm'} /> : <ErrorCircleIcon size={size === 'lg' ? 'md' : 'sm'} /> : null}\n <span>{children}</span>\n </p>\n );\n});\n\n// ── Form field wrapper ───────────────────────────────────────────────\nexport interface FormFieldProps {\n /** Visible label. Omit it only when the control has its own accessible name. */\n label?: ReactNode;\n /** Help text under the control. Replaced by `error` when both are set. */\n helperText?: ReactNode;\n /** Error text under the control; also switches the control to its invalid look. */\n error?: ReactNode;\n /** Marks the label with a red asterisk. */\n required?: boolean;\n /** Adds the \"(Optional)\" hint to the label. Pass a string to translate it. */\n optional?: boolean | string;\n /** Figma \"Size\": L · M · S. */\n size?: FieldSize;\n}\n\n/** How a field shows its error. Supported by `TextInput`, `Textarea` and `Select`. */\nexport interface FieldErrorAppearanceProps {\n /**\n * Colour of the error message, text and icon: `error` error/error (Figma \"Field message / Type=Error\", the default) or\n * `content` the darker error/content some screens use (Figma Contact Support \"Errors\").\n */\n errorColor?: 'error' | 'content';\n /**\n * `error` (default) gives an invalid control the error fill and border (Figma \"State=Error\"); `neutral` keeps its\n * default box, so only the message shows the error. The control is still marked `aria-invalid`.\n */\n errorBox?: 'error' | 'neutral';\n}\n\nexport interface FieldIds {\n /** id for the focusable control — also the label's `htmlFor`. */\n controlId: string;\n labelId: string;\n /** id of the helper/error text, or undefined when there is none; use it for `aria-describedby`. */\n messageId: string | undefined;\n}\n\n/** Stable ids that tie a control to its label and message. Pass the consumer's `id` to respect it. */\nexport function useFieldIds(id: string | undefined, hasMessage: boolean): FieldIds {\n const generated = useId();\n const controlId = id ?? `tm-${generated}`;\n return { controlId, labelId: `${controlId}-label`, messageId: hasMessage ? `${controlId}-message` : undefined };\n}\n\ninterface FormFieldLayoutProps extends FormFieldProps, FieldErrorAppearanceProps, Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n ids: FieldIds;\n /** Shows the info icon in front of `helperText` (Figma \"Style=With-icon-helper-text\"). Errors always have their icon. */\n helperIcon?: boolean;\n /** The control, normally a `.tm-field` box. */\n children: ReactNode;\n}\n\n/**\n * Lays out label → control → message, 8px apart (`--tm-form-field-gap` changes it, e.g. to `var(--tm-spacing-xxs)` for\n * Figma's email and password fields). The spacing is margins, not a gap, so the root can also be placed on three rows\n * of a parent grid (`display: grid; grid-row: span 3; grid-template-rows: subgrid`) to keep the boxes of fields side by\n * side level. Building block for the form controls in this package\n * (TextInput, Select, …); apps normally use those instead of this component.\n */\nexport const FormField = /* @__PURE__ */ forwardRef<HTMLDivElement, FormFieldLayoutProps>(function FormField(\n { ids, label, helperText, error, required, optional, size = 'md', helperIcon, errorColor, errorBox, className, children, ...props },\n ref,\n) {\n const message = error || helperText;\n return (\n <div\n ref={ref}\n className={cn('tm-form-field', className)}\n data-size={size}\n data-error-color={errorColor === 'content' ? 'content' : undefined}\n data-error-box={errorBox === 'neutral' ? 'neutral' : undefined}\n {...props}\n >\n {label ? (\n <Label id={ids.labelId} htmlFor={ids.controlId} size={size} required={required} optional={optional}>\n {label}\n </Label>\n ) : null}\n {children}\n {message ? (\n <FieldMessage id={ids.messageId} tone={error ? 'error' : 'neutral'} size={size} icon={error ? true : helperIcon}>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AW,QAAS,GAAGC,EAAU,QAAS,UAAWE,EAAa,GAAGF,EAAU,UAAY,IAAA,EAAU,CAChH,CAiBA,IAAaG,GAA4B,EAAAjB,EAAA,WAAA,CAAiD,SACxF,CAAE,MAAK,QAAO,aAAY,QAAO,WAAU,WAAU,OAAO,KAAM,aAAY,aAAY,WAAU,YAAW,WAAU,GAAGG,GAC5H,EACA,CACA,IAAMe,EAAUC,GAASC,EACzB,OACE,EAAAnB,EAAA,KAAA,CAAC,MAAD,CACO,MACL,UAAWR,EAAAA,GAAG,gBAAiBW,CAAS,EACxC,YAAWC,EACX,mBAAkBgB,IAAe,UAAY,UAAY,IAAA,GACzD,iBAAgBC,IAAa,UAAY,UAAY,IAAA,GACrD,GAAInB,EANN,SAAA,CAQGoB,GACC,EAAAtB,EAAA,IAAA,CAACC,EAAD,CAAO,GAAIsB,EAAI,QAAS,QAASA,EAAI,UAAiB,OAAgB,WAAoB,WACvF,SAAAD,CACI,CAAA,EACL,KACHjB,EACAY,GACC,EAAAjB,EAAA,IAAA,CAACQ,EAAD,CAAc,GAAIe,EAAI,UAAW,KAAML,EAAQ,QAAU,UAAiB,OAAM,KAAMA,EAAQ,GAAOM,EAClG,SAAAP,CACW,CAAA,EACZ,IACD,C,EAET,CAAC,E"}
@@ -43,13 +43,15 @@ function l(e, t) {
43
43
  messageId: t ? `${r}-message` : void 0
44
44
  };
45
45
  }
46
- var u = /* @__PURE__ */ r(function({ ids: e, label: t, helperText: r, error: i, required: l, optional: u, size: d = "md", helperIcon: f, className: p, children: m, ...h }, g) {
47
- let _ = i || r;
46
+ var u = /* @__PURE__ */ r(function({ ids: e, label: t, helperText: r, error: i, required: l, optional: u, size: d = "md", helperIcon: f, errorColor: p, errorBox: m, className: h, children: g, ..._ }, v) {
47
+ let y = i || r;
48
48
  return /* @__PURE__ */ o("div", {
49
- ref: g,
50
- className: n("tm-form-field", p),
49
+ ref: v,
50
+ className: n("tm-form-field", h),
51
51
  "data-size": d,
52
- ...h,
52
+ "data-error-color": p === "content" ? "content" : void 0,
53
+ "data-error-box": m === "neutral" ? "neutral" : void 0,
54
+ ..._,
53
55
  children: [
54
56
  t ? /* @__PURE__ */ a(s, {
55
57
  id: e.labelId,
@@ -59,13 +61,13 @@ var u = /* @__PURE__ */ r(function({ ids: e, label: t, helperText: r, error: i,
59
61
  optional: u,
60
62
  children: t
61
63
  }) : null,
62
- m,
63
- _ ? /* @__PURE__ */ a(c, {
64
+ g,
65
+ y ? /* @__PURE__ */ a(c, {
64
66
  id: e.messageId,
65
67
  tone: i ? "error" : "neutral",
66
68
  size: d,
67
69
  icon: i ? !0 : f,
68
- children: _
70
+ children: y
69
71
  }) : null
70
72
  ]
71
73
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","names":["Label","props","cn","className","size","children","required","optional","FieldMessage","tone","icon","jsx","CheckmarkIcon","ErrorCircleIcon","useFieldIds","generated","useId","controlId","id","hasMessage","FormField","message","error","helperText","label","ids","helperIcon"],"sources":["../../../src/components/Field/Field.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes, type LabelHTMLAttributes, type ReactNode } from 'react';\nimport { CheckmarkIcon, ErrorCircleIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './Field.css';\n\n/** Figma \"Size\" on every form control: L · M · S */\nexport type FieldSize = 'lg' | 'md' | 'sm';\n\n// ── Label ────────────────────────────────────────────────────────────\nexport interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n /** Figma \"Size\": `lg` Label-large · `md` Label · `sm` Label-small. */\n size?: FieldSize;\n /** Adds the red asterisk (Figma \"Style=Required\"). */\n required?: boolean;\n /** Adds the \"(Optional)\" hint (Figma \"Style=Optional\"). Pass a string to translate it. */\n optional?: boolean | string;\n}\n\n/** Figma component set \"Label title\". */\nexport const Label = /* @__PURE__ */ forwardRef<HTMLLabelElement, LabelProps>(function Label(\n { size = 'md', required, optional, className, children, ...props },\n ref,\n) {\n return (\n <label ref={ref} className={cn('tm-label', className)} data-size={size} {...props}>\n {children}\n {required ? (\n <span className=\"tm-label__required\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n {optional ? <span className=\"tm-label__optional\">{typeof optional === 'string' ? optional : '(Optional)'}</span> : null}\n </label>\n );\n});\n\n// ── Message ──────────────────────────────────────────────────────────\nexport interface FieldMessageProps extends HTMLAttributes<HTMLParagraphElement> {\n /**\n * `neutral` helper text (Figma \"Field message / Type=Hint\"), `error` with the error icon and colours\n * (Figma \"State=Error\", \"Field message / Type=Error\"), `success` with a check mark in success/content\n * (Figma \"Field message / Type=Success\", node 2606:16067).\n */\n tone?: 'neutral' | 'error' | 'success';\n /** Size of the control the message belongs to; sets the text style and icon size. */\n size?: FieldSize;\n /** Leading icon (Figma \"Style=With-icon-helper-text\"). Defaults to `true` for errors and success, `false` for helper text. */\n icon?: boolean;\n}\n\n/** Helper or error text shown under a control (Figma \"Inputs / With-helper-text\", \"Text inputs / State=Error\"). */\nexport const FieldMessage = /* @__PURE__ */ forwardRef<HTMLParagraphElement, FieldMessageProps>(function FieldMessage(\n { tone = 'neutral', size = 'md', icon = tone !== 'neutral', className, children, ...props },\n ref,\n) {\n return (\n <p ref={ref} className={cn('tm-field-message', className)} data-tone={tone} data-size={size} {...props}>\n {/* Figma: 20px icon next to the L message, 16px at M and S */}\n {icon ? tone === 'success' ? <CheckmarkIcon size={size === 'lg' ? 'md' : 'sm'} /> : <ErrorCircleIcon size={size === 'lg' ? 'md' : 'sm'} /> : null}\n <span>{children}</span>\n </p>\n );\n});\n\n// ── Form field wrapper ───────────────────────────────────────────────\nexport interface FormFieldProps {\n /** Visible label. Omit it only when the control has its own accessible name. */\n label?: ReactNode;\n /** Help text under the control. Replaced by `error` when both are set. */\n helperText?: ReactNode;\n /** Error text under the control; also switches the control to its invalid look. */\n error?: ReactNode;\n /** Marks the label with a red asterisk. */\n required?: boolean;\n /** Adds the \"(Optional)\" hint to the label. Pass a string to translate it. */\n optional?: boolean | string;\n /** Figma \"Size\": L · M · S. */\n size?: FieldSize;\n}\n\nexport interface FieldIds {\n /** id for the focusable control — also the label's `htmlFor`. */\n controlId: string;\n labelId: string;\n /** id of the helper/error text, or undefined when there is none; use it for `aria-describedby`. */\n messageId: string | undefined;\n}\n\n/** Stable ids that tie a control to its label and message. Pass the consumer's `id` to respect it. */\nexport function useFieldIds(id: string | undefined, hasMessage: boolean): FieldIds {\n const generated = useId();\n const controlId = id ?? `tm-${generated}`;\n return { controlId, labelId: `${controlId}-label`, messageId: hasMessage ? `${controlId}-message` : undefined };\n}\n\ninterface FormFieldLayoutProps extends FormFieldProps, Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n ids: FieldIds;\n /** Shows the info icon in front of `helperText` (Figma \"Style=With-icon-helper-text\"). Errors always have their icon. */\n helperIcon?: boolean;\n /** The control, normally a `.tm-field` box. */\n children: ReactNode;\n}\n\n/**\n * Lays out label → control → message. Building block for the form controls in this package\n * (TextInput, Select, …); apps normally use those instead of this component.\n */\nexport const FormField = /* @__PURE__ */ forwardRef<HTMLDivElement, FormFieldLayoutProps>(function FormField(\n { ids, label, helperText, error, required, optional, size = 'md', helperIcon, className, children, ...props },\n ref,\n) {\n const message = error || helperText;\n return (\n <div ref={ref} className={cn('tm-form-field', className)} data-size={size} {...props}>\n {label ? (\n <Label id={ids.labelId} htmlFor={ids.controlId} size={size} required={required} optional={optional}>\n {label}\n </Label>\n ) : null}\n {children}\n {message ? (\n <FieldMessage id={ids.messageId} tone={error ? 'error' : 'neutral'} size={size} icon={error ? true : helperIcon}>\n {message}\n </FieldMessage>\n ) : null}\n </div>\n );\n});\n"],"mappings":";;;;;;;;AAmBA,IAAaA,IAAwB,kBAAyC,SAC5E,EAAE,UAAO,MAAM,aAAU,aAAU,cAAW,aAAU,GAAGC,KAC3D,GACA;CACA,OACE,kBAAC,SAAD;EAAY;EAAK,WAAWC,EAAG,YAAYC,CAAS;EAAG,aAAWC;EAAM,GAAIH;EAA5E,UAAA;GACGI;GACAC,IACC,kBAAC,QAAD;IA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AAOI;IAClG,UAAAL;GACW,CAAA,IACZ;EACD;;AAET,CAAC"}
1
+ {"version":3,"file":"Field.js","names":["Label","props","cn","className","size","children","required","optional","FieldMessage","tone","icon","jsx","CheckmarkIcon","ErrorCircleIcon","useFieldIds","generated","useId","controlId","id","hasMessage","FormField","message","error","helperText","errorColor","errorBox","label","ids","helperIcon"],"sources":["../../../src/components/Field/Field.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes, type LabelHTMLAttributes, type ReactNode } from 'react';\nimport { CheckmarkIcon, ErrorCircleIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './Field.css';\n\n/** Figma \"Size\" on every form control: L · M · S */\nexport type FieldSize = 'lg' | 'md' | 'sm';\n\n// ── Label ────────────────────────────────────────────────────────────\nexport interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n /** Figma \"Size\": `lg` Label-large · `md` Label · `sm` Label-small. */\n size?: FieldSize;\n /** Adds the red asterisk (Figma \"Style=Required\"). */\n required?: boolean;\n /** Adds the \"(Optional)\" hint (Figma \"Style=Optional\"). Pass a string to translate it. */\n optional?: boolean | string;\n}\n\n/** Figma component set \"Label title\". */\nexport const Label = /* @__PURE__ */ forwardRef<HTMLLabelElement, LabelProps>(function Label(\n { size = 'md', required, optional, className, children, ...props },\n ref,\n) {\n return (\n <label ref={ref} className={cn('tm-label', className)} data-size={size} {...props}>\n {children}\n {required ? (\n <span className=\"tm-label__required\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n {optional ? <span className=\"tm-label__optional\">{typeof optional === 'string' ? optional : '(Optional)'}</span> : null}\n </label>\n );\n});\n\n// ── Message ──────────────────────────────────────────────────────────\nexport interface FieldMessageProps extends HTMLAttributes<HTMLParagraphElement> {\n /**\n * `neutral` helper text (Figma \"Field message / Type=Hint\"), `error` with the error icon and colours\n * (Figma \"State=Error\", \"Field message / Type=Error\"), `success` with a check mark in success/content\n * (Figma \"Field message / Type=Success\", node 2606:16067).\n */\n tone?: 'neutral' | 'error' | 'success';\n /** Size of the control the message belongs to; sets the text style and icon size. */\n size?: FieldSize;\n /** Leading icon (Figma \"Style=With-icon-helper-text\"). Defaults to `true` for errors and success, `false` for helper text. */\n icon?: boolean;\n}\n\n/** Helper or error text shown under a control (Figma \"Inputs / With-helper-text\", \"Text inputs / State=Error\"). */\nexport const FieldMessage = /* @__PURE__ */ forwardRef<HTMLParagraphElement, FieldMessageProps>(function FieldMessage(\n { tone = 'neutral', size = 'md', icon = tone !== 'neutral', className, children, ...props },\n ref,\n) {\n return (\n <p ref={ref} className={cn('tm-field-message', className)} data-tone={tone} data-size={size} {...props}>\n {/* Figma: 20px icon next to the L message, 16px at M and S */}\n {icon ? tone === 'success' ? <CheckmarkIcon size={size === 'lg' ? 'md' : 'sm'} /> : <ErrorCircleIcon size={size === 'lg' ? 'md' : 'sm'} /> : null}\n <span>{children}</span>\n </p>\n );\n});\n\n// ── Form field wrapper ───────────────────────────────────────────────\nexport interface FormFieldProps {\n /** Visible label. Omit it only when the control has its own accessible name. */\n label?: ReactNode;\n /** Help text under the control. Replaced by `error` when both are set. */\n helperText?: ReactNode;\n /** Error text under the control; also switches the control to its invalid look. */\n error?: ReactNode;\n /** Marks the label with a red asterisk. */\n required?: boolean;\n /** Adds the \"(Optional)\" hint to the label. Pass a string to translate it. */\n optional?: boolean | string;\n /** Figma \"Size\": L · M · S. */\n size?: FieldSize;\n}\n\n/** How a field shows its error. Supported by `TextInput`, `Textarea` and `Select`. */\nexport interface FieldErrorAppearanceProps {\n /**\n * Colour of the error message, text and icon: `error` error/error (Figma \"Field message / Type=Error\", the default) or\n * `content` the darker error/content some screens use (Figma Contact Support \"Errors\").\n */\n errorColor?: 'error' | 'content';\n /**\n * `error` (default) gives an invalid control the error fill and border (Figma \"State=Error\"); `neutral` keeps its\n * default box, so only the message shows the error. The control is still marked `aria-invalid`.\n */\n errorBox?: 'error' | 'neutral';\n}\n\nexport interface FieldIds {\n /** id for the focusable control — also the label's `htmlFor`. */\n controlId: string;\n labelId: string;\n /** id of the helper/error text, or undefined when there is none; use it for `aria-describedby`. */\n messageId: string | undefined;\n}\n\n/** Stable ids that tie a control to its label and message. Pass the consumer's `id` to respect it. */\nexport function useFieldIds(id: string | undefined, hasMessage: boolean): FieldIds {\n const generated = useId();\n const controlId = id ?? `tm-${generated}`;\n return { controlId, labelId: `${controlId}-label`, messageId: hasMessage ? `${controlId}-message` : undefined };\n}\n\ninterface FormFieldLayoutProps extends FormFieldProps, FieldErrorAppearanceProps, Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n ids: FieldIds;\n /** Shows the info icon in front of `helperText` (Figma \"Style=With-icon-helper-text\"). Errors always have their icon. */\n helperIcon?: boolean;\n /** The control, normally a `.tm-field` box. */\n children: ReactNode;\n}\n\n/**\n * Lays out label → control → message, 8px apart (`--tm-form-field-gap` changes it, e.g. to `var(--tm-spacing-xxs)` for\n * Figma's email and password fields). The spacing is margins, not a gap, so the root can also be placed on three rows\n * of a parent grid (`display: grid; grid-row: span 3; grid-template-rows: subgrid`) to keep the boxes of fields side by\n * side level. Building block for the form controls in this package\n * (TextInput, Select, …); apps normally use those instead of this component.\n */\nexport const FormField = /* @__PURE__ */ forwardRef<HTMLDivElement, FormFieldLayoutProps>(function FormField(\n { ids, label, helperText, error, required, optional, size = 'md', helperIcon, errorColor, errorBox, className, children, ...props },\n ref,\n) {\n const message = error || helperText;\n return (\n <div\n ref={ref}\n className={cn('tm-form-field', className)}\n data-size={size}\n data-error-color={errorColor === 'content' ? 'content' : undefined}\n data-error-box={errorBox === 'neutral' ? 'neutral' : undefined}\n {...props}\n >\n {label ? (\n <Label id={ids.labelId} htmlFor={ids.controlId} size={size} required={required} optional={optional}>\n {label}\n </Label>\n ) : null}\n {children}\n {message ? (\n <FieldMessage id={ids.messageId} tone={error ? 'error' : 'neutral'} size={size} icon={error ? true : helperIcon}>\n {message}\n </FieldMessage>\n ) : null}\n </div>\n );\n});\n"],"mappings":";;;;;;;;AAmBA,IAAaA,IAAw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Y,YAAY,KAAA;EACzD,kBAAgBC,MAAa,YAAY,YAAY,KAAA;EACrD,GAAIxB;EANN,UAAA;GAQGyB,IACC,kBAAC1B,GAAD;IAAO,IAAI2B,EAAI;IAAS,SAASA,EAAI;IAAiB;IAAgB;IAAoB;IACvF,UAAAD;GACI,CAAA,IACL;GACHrB;GACAgB,IACC,kBAACb,GAAD;IAAc,IAAImB,EAAI;IAAW,MAAML,IAAQ,UAAU;IAAiB;IAAM,MAAMA,IAAQ,KAAOM;IAClG,UAAAP;GACW,CAAA,IACZ;EACD;;AAET,CAAC"}
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../icons/generated/CheckmarkIcon.cjs"),t=require("../../utils/cn.cjs");;/* empty css */let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.forwardRef)(function({icon:e,className:n,children:i,...a},o){return(0,r.jsxs)(`span`,{ref:o,className:t.cn(`tm-how-it-works-steps__tag`,n),"data-tm-icon-size":`sm`,...a,children:[e,i]})}),a=500,o=()=>{let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),n=()=>t(e.matches);return n(),e.addEventListener?.(`change`,n),()=>e.removeEventListener?.(`change`,n)},[]),e},s=(e,t)=>{let[r,i]=(0,n.useState)(!0),[a,o]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{if(!t)return;let n=()=>o(document.visibilityState!==`hidden`);n(),document.addEventListener(`visibilitychange`,n);let r;return e.current&&typeof IntersectionObserver==`function`&&(r=new IntersectionObserver(([e])=>i(e.isIntersecting)),r.observe(e.current)),()=>{document.removeEventListener(`visibilitychange`,n),r?.disconnect()}},[e,t]),r&&a},c=(0,n.forwardRef)(function({items:i,value:c,defaultValue:l,onValueChange:u,autoPlay:d=!1,interval:f=2200,paused:p=!1,label:m,collapseBelow:h,className:g,style:_,onPointerEnter:v,onPointerLeave:y,onFocus:b,onBlur:x,...S},C){let w=(0,n.useRef)(null),T=(0,n.useCallback)(e=>{w.current=e,typeof C==`function`?C(e):C&&(C.current=e)},[C]),[E,D]=(0,n.useState)(l),[O,k]=(0,n.useState)(!1),[A,j]=(0,n.useState)(!1),M=o(),N=s(w,d),P=i.length,F=c===void 0?E:c,I=i.findIndex(e=>e.value===F),L=I===-1?0:I,R=e=>{let t=i[e];t&&e!==L&&(c===void 0&&D(t.value),u?.(t.value))},z=(0,n.useRef)(R);z.current=R;let B=d&&P>1&&!M&&!p&&!O&&!A&&N;if((0,n.useEffect)(()=>{if(!B)return;let e=window.setTimeout(()=>z.current((L+1)%P),Math.max(f,0)+a);return()=>window.clearTimeout(e)},[B,L,P,f]),P===0)return null;let V=Math.max(480,h??P*136+(P-1)*16),H={"--_count":P,"--_progress":P>1?L/(P-1):0,"--_collapse":V,..._};return(0,r.jsx)(`div`,{ref:T,className:t.cn(`tm-how-it-works-steps`,g),style:H,"data-playing":B?``:void 0,onPointerEnter:e=>{v?.(e),e.pointerType!==`touch`&&k(!0)},onPointerLeave:e=>{y?.(e),k(!1)},onFocus:e=>{b?.(e);let t=!0;try{t=e.target.matches(`:focus-visible`)}catch{}t&&j(!0)},onBlur:e=>{x?.(e),e.currentTarget.contains(e.relatedTarget)||j(!1)},...S,children:(0,r.jsx)(`div`,{className:`tm-how-it-works-steps__frame`,children:(0,r.jsxs)(`div`,{className:`tm-how-it-works-steps__inner`,children:[(0,r.jsxs)(`div`,{className:`tm-how-it-works-steps__rail`,"aria-hidden":`true`,"data-tm-icon-size":`sm`,children:[(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__track`}),(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__progress`}),i.map((t,n)=>(0,r.jsxs)(`span`,{className:`tm-how-it-works-steps__node`,"data-state":n<L?`done`:n===L?`current`:`upcoming`,children:[(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__number`,children:n+1}),(0,r.jsx)(e.CheckmarkIcon,{className:`tm-how-it-works-steps__check`})]},t.value))]}),(0,r.jsx)(`ol`,{className:`tm-how-it-works-steps__list`,"aria-label":m,children:i.map((e,t)=>{let n=t===L;return(0,r.jsx)(`li`,{className:`tm-how-it-works-steps__item`,children:(0,r.jsxs)(`button`,{type:`button`,className:`tm-how-it-works-steps__card`,"aria-current":n?`step`:void 0,"data-current":n?``:void 0,onClick:()=>R(t),children:[(0,r.jsxs)(`span`,{className:`tm-how-it-works-steps__main`,children:[e.icon?(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__icon`,"data-tm-icon-size":`md`,children:e.icon}):null,(0,r.jsxs)(`span`,{className:`tm-how-it-works-steps__text`,children:[(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__title`,children:e.title}),e.description?(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__description`,children:e.description}):null]})]}),e.badge?(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__badge`,children:e.badge}):null]})},e.value)})})]})})})});exports.HowItWorksStepTag=i,exports.HowItWorksSteps=c;
1
+ "use client";const e=require("../../icons/generated/CheckmarkIcon.cjs"),t=require("../../utils/cn.cjs");;/* empty css */let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.forwardRef)(function({icon:e,className:n,children:i,...a},o){return(0,r.jsxs)(`span`,{ref:o,className:t.cn(`tm-how-it-works-steps__tag`,n),"data-tm-icon-size":`sm`,...a,children:[e,i]})}),a=500,o=()=>{let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),n=()=>t(e.matches);return n(),e.addEventListener?.(`change`,n),()=>e.removeEventListener?.(`change`,n)},[]),e},s=(e,t)=>{let[r,i]=(0,n.useState)(!0),[a,o]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{if(!t)return;let n=()=>o(document.visibilityState!==`hidden`);n(),document.addEventListener(`visibilitychange`,n);let r;return e.current&&typeof IntersectionObserver==`function`&&(r=new IntersectionObserver(([e])=>i(e.isIntersecting)),r.observe(e.current)),()=>{document.removeEventListener(`visibilitychange`,n),r?.disconnect()}},[e,t]),r&&a},c=(0,n.forwardRef)(function({items:i,value:c,defaultValue:l,onValueChange:u,autoPlay:d=!0,interval:f=2200,paused:p=!1,label:m,collapseBelow:h,className:g,style:_,onPointerEnter:v,onPointerLeave:y,onFocus:b,onBlur:x,...S},C){let w=(0,n.useRef)(null),T=(0,n.useCallback)(e=>{w.current=e,typeof C==`function`?C(e):C&&(C.current=e)},[C]),[E,D]=(0,n.useState)(l),[O,k]=(0,n.useState)(!1),[A,j]=(0,n.useState)(!1),M=o(),N=s(w,d),P=i.length,F=c===void 0?E:c,I=i.findIndex(e=>e.value===F),L=I===-1?0:I,R=e=>{let t=i[e];t&&e!==L&&(c===void 0&&D(t.value),u?.(t.value))},z=(0,n.useRef)(R);z.current=R;let B=d&&P>1&&!M&&!p&&!O&&!A&&N;if((0,n.useEffect)(()=>{if(!B)return;let e=window.setTimeout(()=>z.current((L+1)%P),Math.max(f,0)+a);return()=>window.clearTimeout(e)},[B,L,P,f]),P===0)return null;let V=Math.max(480,h??P*136+(P-1)*16),H={"--_count":P,"--_progress":P>1?L/(P-1):0,"--_collapse":V,..._};return(0,r.jsx)(`div`,{ref:T,className:t.cn(`tm-how-it-works-steps`,g),style:H,"data-playing":B?``:void 0,onPointerEnter:e=>{v?.(e),e.pointerType!==`touch`&&k(!0)},onPointerLeave:e=>{y?.(e),k(!1)},onFocus:e=>{b?.(e);let t=!0;try{t=e.target.matches(`:focus-visible`)}catch{}t&&j(!0)},onBlur:e=>{x?.(e),e.currentTarget.contains(e.relatedTarget)||j(!1)},...S,children:(0,r.jsx)(`div`,{className:`tm-how-it-works-steps__frame`,children:(0,r.jsxs)(`div`,{className:`tm-how-it-works-steps__inner`,children:[(0,r.jsxs)(`div`,{className:`tm-how-it-works-steps__rail`,"aria-hidden":`true`,"data-tm-icon-size":`sm`,children:[(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__track`}),(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__progress`}),i.map((t,n)=>(0,r.jsxs)(`span`,{className:`tm-how-it-works-steps__node`,"data-state":n<L?`done`:n===L?`current`:`upcoming`,children:[(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__number`,children:n+1}),(0,r.jsx)(e.CheckmarkIcon,{className:`tm-how-it-works-steps__check`})]},t.value))]}),(0,r.jsx)(`ol`,{className:`tm-how-it-works-steps__list`,"aria-label":m,children:i.map((e,t)=>{let n=t===L;return(0,r.jsx)(`li`,{className:`tm-how-it-works-steps__item`,children:(0,r.jsxs)(`button`,{type:`button`,className:`tm-how-it-works-steps__card`,"aria-current":n?`step`:void 0,"data-current":n?``:void 0,onClick:()=>R(t),children:[(0,r.jsxs)(`span`,{className:`tm-how-it-works-steps__main`,children:[e.icon?(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__icon`,"data-tm-icon-size":`md`,children:e.icon}):null,(0,r.jsxs)(`span`,{className:`tm-how-it-works-steps__text`,children:[(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__title`,children:e.title}),e.description?(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__description`,children:e.description}):null]})]}),e.badge?(0,r.jsx)(`span`,{className:`tm-how-it-works-steps__badge`,children:e.badge}):null]})},e.value)})})]})})})});exports.HowItWorksStepTag=i,exports.HowItWorksSteps=c;
2
2
  //# sourceMappingURL=HowItWorksSteps.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"HowItWorksSteps.cjs","names":["cn","useState","useRef","useCallback","CheckmarkIcon","require_CheckmarkIcon","require_cn","react","react_jsx_runtime","HowItWorksStepTag","props","className","icon","children","STEP_DURATION","useReducedMotion","reduced","setReduced","query","update","useOnScreen","inView","setInView","tabVisible","setTabVisible","enabled","observer","ref","entry","HowItWorksSteps","rootRef","setRef","node","uncontrolled","setUncontrolled","defaultValue","hovered","setHovered","focused","setFocused","reducedMotion","onScreen","autoPlay","count","items","requested","value","found","item","activeIndex","select","next","index","onValueChange","selectRef","playing","paused","timer","interval","threshold","collapseBelow","rootStyle","style","onPointerEnter","event","onPointerLeave","onFocus","keyboard","onBlur","label","isCurrent"],"sources":["../../../src/components/HowItWorksSteps/HowItWorksSteps.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type HTMLAttributes,\n type PointerEvent,\n type ReactNode,\n} from 'react';\nimport { CheckmarkIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './HowItWorksSteps.css';\n\nexport interface HowItWorksStepItem {\n /** Identifies the step in `value` / `onValueChange`. */\n value: string;\n /** One icon from `@travel-match/ui` for the icon tile, e.g. `<PaperIcon />`. */\n icon?: ReactNode;\n /** Step name, e.g. \"Submit a request\". Phrasing content only — it is rendered inside a button. */\n title: ReactNode;\n /** One or two sentences about the step. Phrasing content only. */\n description?: ReactNode;\n /** Pill at the bottom of the card, e.g. a `<RequestStatus>` or a `<Tag>`. Must not be interactive. */\n badge?: ReactNode;\n}\n\nexport interface HowItWorksStepsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue' | 'onChange'> {\n /** The steps, in order. Nothing is rendered for an empty list. */\n items: HowItWorksStepItem[];\n /** Controlled: `value` of the current step (Figma \"Step\"). */\n value?: string;\n /** Uncontrolled: `value` of the step that starts current. Defaults to the first one. */\n defaultValue?: string;\n /** Called with the `value` of the step that became current, by a click or by auto-play. */\n onValueChange?: (value: string) => void;\n /** Advances to the next step on a timer, in an endless loop; after the user picks a step it carries on from that step. */\n autoPlay?: boolean;\n /** Time a step rests once its 500ms transition has finished, in ms (Figma: 2200 — a new step every 2.7s). */\n interval?: number;\n /** Holds auto-play without unmounting it (e.g. while a dialog is open); it carries on once this is `false` again. */\n paused?: boolean;\n /** Accessible name of the list of steps, e.g. \"How it works\". */\n label?: string;\n /** 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. */\n collapseBelow?: number;\n}\n\nexport interface HowItWorksStepTagProps extends HTMLAttributes<HTMLSpanElement> {\n /** One icon from `@travel-match/ui`, e.g. `<CompareIcon />`. */\n icon?: ReactNode;\n}\n\n/** The tinted pill Figma draws at the bottom of the steps that have no request status (\"Up to 3 offers\"). Use it as a step's `badge`. */\nexport const HowItWorksStepTag = /* @__PURE__ */ forwardRef<HTMLSpanElement, HowItWorksStepTagProps>(function HowItWorksStepTag(\n { icon, className, children, ...props },\n ref,\n) {\n return (\n <span ref={ref} className={cn('tm-how-it-works-steps__tag', className)} data-tm-icon-size=\"sm\" {...props}>\n {icon}\n {children}\n </span>\n );\n});\n\n/** Figma prototype: Smart animate, ease in and out, 500ms. Keep in sync with `--_duration` in the stylesheet. */\nconst STEP_DURATION = 500;\n\nconst useReducedMotion = () => {\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/** True while the element is on screen and the tab is visible — the only time a timer should run. */\nconst useOnScreen = (ref: { current: Element | null }, enabled: boolean) => {\n const [inView, setInView] = useState(true);\n const [tabVisible, setTabVisible] = useState(true);\n useEffect(() => {\n if (!enabled) return;\n const update = () => setTabVisible(document.visibilityState !== 'hidden');\n update();\n document.addEventListener('visibilitychange', update);\n let observer: IntersectionObserver | undefined;\n if (ref.current && typeof IntersectionObserver === 'function') {\n observer = new IntersectionObserver(([entry]) => setInView(entry.isIntersecting));\n observer.observe(ref.current);\n }\n return () => {\n document.removeEventListener('visibilitychange', update);\n observer?.disconnect();\n };\n }, [ref, enabled]);\n return inView && tabVisible;\n};\n\n/**\n * The request journey as a numbered rail over a row of step cards, one of which is current\n * (Figma \"How it works / Steps\"; its \"Step=1…7\" variants are the `value`). Every card is a button that makes its step\n * current; with `autoPlay` the steps also advance on a timer in an endless loop, which holds while the pointer or\n * keyboard focus is inside and carries on from the step the user picked. Below `collapseBelow` the cards stack and the\n * rail is dropped (Figma \"Mobile / How it works / Steps\").\n */\nexport const HowItWorksSteps = /* @__PURE__ */ forwardRef<HTMLDivElement, HowItWorksStepsProps>(function HowItWorksSteps(\n {\n items,\n value,\n defaultValue,\n onValueChange,\n autoPlay = false,\n interval = 2200,\n paused = false,\n label,\n collapseBelow,\n className,\n style,\n onPointerEnter,\n onPointerLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref],\n );\n\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const [hovered, setHovered] = useState(false);\n const [focused, setFocused] = useState(false);\n const reducedMotion = useReducedMotion();\n const onScreen = useOnScreen(rootRef, autoPlay);\n\n const count = items.length;\n const requested = value !== undefined ? value : uncontrolled;\n const found = items.findIndex((item) => item.value === requested);\n // One step is always current: an unknown or missing value falls back to the first step.\n const activeIndex = found === -1 ? 0 : found;\n\n const select = (index: number) => {\n const next = items[index];\n if (!next || index === activeIndex) return;\n if (value === undefined) setUncontrolled(next.value);\n onValueChange?.(next.value);\n };\n const selectRef = useRef(select);\n selectRef.current = select;\n\n const playing = autoPlay && count > 1 && !reducedMotion && !paused && !hovered && !focused && onScreen;\n\n useEffect(() => {\n if (!playing) return;\n const timer = window.setTimeout(() => selectRef.current((activeIndex + 1) % count), Math.max(interval, 0) + STEP_DURATION);\n return () => window.clearTimeout(timer);\n }, [playing, activeIndex, count, interval]);\n\n if (count === 0) return null;\n\n // 136px per step keeps the Figma card (157px at 1200) readable; below that the row would crush the text.\n const threshold = Math.max(480, collapseBelow ?? count * 136 + (count - 1) * 16);\n const rootStyle = {\n '--_count': count,\n '--_progress': count > 1 ? activeIndex / (count - 1) : 0,\n '--_collapse': threshold,\n ...style,\n } as CSSProperties;\n\n return (\n <div\n ref={setRef}\n className={cn('tm-how-it-works-steps', className)}\n style={rootStyle}\n data-playing={playing ? '' : undefined}\n onPointerEnter={(event: PointerEvent<HTMLDivElement>) => {\n onPointerEnter?.(event);\n // A touch \"enters\" just before it taps; only a resting mouse or pen holds the timer.\n if (event.pointerType !== 'touch') setHovered(true);\n }}\n onPointerLeave={(event: PointerEvent<HTMLDivElement>) => {\n onPointerLeave?.(event);\n setHovered(false);\n }}\n onFocus={(event: FocusEvent<HTMLDivElement>) => {\n onFocus?.(event);\n // Keyboard focus only: the focus a click or a tap leaves on a card must not hold auto-play until the next blur.\n let keyboard = true;\n try {\n 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 onBlur={(event: FocusEvent<HTMLDivElement>) => {\n onBlur?.(event);\n if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);\n }}\n {...props}\n >\n <div className=\"tm-how-it-works-steps__frame\">\n <div className=\"tm-how-it-works-steps__inner\">\n {/* The rail repeats what the list below already says (order, current step), so it is decorative. */}\n <div className=\"tm-how-it-works-steps__rail\" aria-hidden=\"true\" data-tm-icon-size=\"sm\">\n <span className=\"tm-how-it-works-steps__track\" />\n <span className=\"tm-how-it-works-steps__progress\" />\n {items.map((item, index) => (\n <span\n key={item.value}\n className=\"tm-how-it-works-steps__node\"\n data-state={index < activeIndex ? 'done' : index === activeIndex ? 'current' : 'upcoming'}\n >\n <span className=\"tm-how-it-works-steps__number\">{index + 1}</span>\n <CheckmarkIcon className=\"tm-how-it-works-steps__check\" />\n </span>\n ))}\n </div>\n\n <ol className=\"tm-how-it-works-steps__list\" aria-label={label}>\n {items.map((item, index) => {\n const isCurrent = index === activeIndex;\n return (\n <li key={item.value} className=\"tm-how-it-works-steps__item\">\n <button\n type=\"button\"\n className=\"tm-how-it-works-steps__card\"\n aria-current={isCurrent ? 'step' : undefined}\n data-current={isCurrent ? '' : undefined}\n // Shows the chosen step; auto-play carries on from it once the pointer and keyboard focus have left.\n onClick={() => select(index)}\n >\n <span className=\"tm-how-it-works-steps__main\">\n {item.icon ? (\n <span className=\"tm-how-it-works-steps__icon\" data-tm-icon-size=\"md\">\n {item.icon}\n </span>\n ) : null}\n <span className=\"tm-how-it-works-steps__text\">\n <span className=\"tm-how-it-works-steps__title\">{item.title}</span>\n {item.description ? <span className=\"tm-how-it-works-steps__description\">{item.description}</span> : null}\n </span>\n </span>\n {item.badge ? <span className=\"tm-how-it-works-steps__badge\">{item.badge}</span> : null}\n </button>\n </li>\n );\n })}\n </ol>\n </div>\n </div>\n </div>\n );\n});\n"],"mappings":"A,mMAwDA,IAAaS,GAAoC,EAAAF,EAAA,WAAA,CAAoD,SACnG,CAAE,OAAM,YAAW,WAAU,GAAGG,GAChC,EACA,CACA,OACE,EAAAF,EAAA,KAAA,CAAC,OAAD,CAAW,MAAK,UAAWR,EAAAA,GAAG,6BAA8BW,CAAS,EAAG,oBAAkB,KAAK,GAAID,EAAnG,SAAA,CACGE,EACAC,CACG,C,EAEV,CAAC,EAGKC,EAAgB,IAEhBC,MAAyB,CAC7B,GAAM,CAACC,EAASC,IAAA,EAAchB,EAAAA,SAAAA,CAAS,EAAK,EAS5C,OARA,EAAAM,EAAA,UAAA,KAAgB,CACd,GAAI,OAAO,OAAW,KAAe,OAAO,OAAO,YAAe,WAAY,OAC9E,IAAMW,EAAQ,OAAO,WAAW,kCAAkC,EAC5DC,MAAeF,EAAWC,EAAM,OAAO,EAG7C,OAFAC,EAAO,EACPD,EAAM,mBAAmB,SAAUC,CAAM,MAC5BD,EAAM,sBAAsB,SAAUC,CAAM,CAC3D,EAAG,CAAC,CAAC,EACEH,CACT,EAGMI,GAAe,EAAkC,IAAqB,CAC1E,GAAM,CAACC,EAAQC,IAAA,EAAarB,EAAAA,SAAAA,CAAS,EAAI,EACnC,CAACsB,EAAYC,IAAA,EAAiBvB,EAAAA,SAAAA,CAAS,EAAI,E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AD,CAAM,UAAU,8BAAhB,SAAA,CACGwC,EAAK,MACJ,EAAAxC,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,8BAA8B,oBAAkB,KAC7D,SAAAwC,EAAK,IACF,CAAA,EACJ,MACJ,EAAAxC,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,8BAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,+BAAgC,SAAAwC,EAAK,KAAY,CAAA,EAChEA,EAAK,aAAc,EAAAxC,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,qCAAsC,SAAAwC,EAAK,WAAkB,CAAA,EAAI,IACjG,CACF,CAAA,CAAA,CACL,CAAA,EAAAA,EAAK,OAAQ,EAAAxC,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,+BAAgC,SAAAwC,EAAK,KAAY,CAAA,EAAI,IAC7E,C,EACN,EAtBKA,EAAK,KAsBV,CAER,CAAC,CACC,CAAA,CACD,C,EACF,CAAA,CACF,CAAA,CAET,CAAC,E"}
1
+ {"version":3,"file":"HowItWorksSteps.cjs","names":["cn","useState","useRef","useCallback","CheckmarkIcon","require_CheckmarkIcon","require_cn","react","react_jsx_runtime","HowItWorksStepTag","props","className","icon","children","STEP_DURATION","useReducedMotion","reduced","setReduced","query","update","useOnScreen","inView","setInView","tabVisible","setTabVisible","enabled","observer","ref","entry","HowItWorksSteps","rootRef","setRef","node","uncontrolled","setUncontrolled","defaultValue","hovered","setHovered","focused","setFocused","reducedMotion","onScreen","autoPlay","count","items","requested","value","found","item","activeIndex","select","next","index","onValueChange","selectRef","playing","paused","timer","interval","threshold","collapseBelow","rootStyle","style","onPointerEnter","event","onPointerLeave","onFocus","keyboard","onBlur","label","isCurrent"],"sources":["../../../src/components/HowItWorksSteps/HowItWorksSteps.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type HTMLAttributes,\n type PointerEvent,\n type ReactNode,\n} from 'react';\nimport { CheckmarkIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './HowItWorksSteps.css';\n\nexport interface HowItWorksStepItem {\n /** Identifies the step in `value` / `onValueChange`. */\n value: string;\n /** One icon from `@travel-match/ui` for the icon tile, e.g. `<PaperIcon />`. */\n icon?: ReactNode;\n /** Step name, e.g. \"Submit a request\". Phrasing content only — it is rendered inside a button. */\n title: ReactNode;\n /** One or two sentences about the step. Phrasing content only. */\n description?: ReactNode;\n /** Pill at the bottom of the card, e.g. a `<RequestStatus>` or a `<Tag>`. Must not be interactive. */\n badge?: ReactNode;\n}\n\nexport interface HowItWorksStepsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue' | 'onChange'> {\n /** The steps, in order. Nothing is rendered for an empty list. */\n items: HowItWorksStepItem[];\n /** Controlled: `value` of the current step (Figma \"Step\"). */\n value?: string;\n /** Uncontrolled: `value` of the step that starts current. Defaults to the first one. */\n defaultValue?: string;\n /** Called with the `value` of the step that became current, by a click or by auto-play. */\n onValueChange?: (value: string) => void;\n /** Advances to the next step on a timer, in an endless loop (on by default); after the user picks a step it carries on from that step. */\n autoPlay?: boolean;\n /** Time a step rests once its 500ms transition has finished, in ms (Figma: 2200 — a new step every 2.7s). */\n interval?: number;\n /** Holds auto-play without unmounting it (e.g. while a dialog is open); it carries on once this is `false` again. */\n paused?: boolean;\n /** Accessible name of the list of steps, e.g. \"How it works\". */\n label?: string;\n /** 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. */\n collapseBelow?: number;\n}\n\nexport interface HowItWorksStepTagProps extends HTMLAttributes<HTMLSpanElement> {\n /** One icon from `@travel-match/ui`, e.g. `<CompareIcon />`. */\n icon?: ReactNode;\n}\n\n/** The tinted pill Figma draws at the bottom of the steps that have no request status (\"Up to 3 offers\"). Use it as a step's `badge`. */\nexport const HowItWorksStepTag = /* @__PURE__ */ forwardRef<HTMLSpanElement, HowItWorksStepTagProps>(function HowItWorksStepTag(\n { icon, className, children, ...props },\n ref,\n) {\n return (\n <span ref={ref} className={cn('tm-how-it-works-steps__tag', className)} data-tm-icon-size=\"sm\" {...props}>\n {icon}\n {children}\n </span>\n );\n});\n\n/** Figma prototype: Smart animate, ease in and out, 500ms. Keep in sync with `--_duration` in the stylesheet. */\nconst STEP_DURATION = 500;\n\nconst useReducedMotion = () => {\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/** True while the element is on screen and the tab is visible — the only time a timer should run. */\nconst useOnScreen = (ref: { current: Element | null }, enabled: boolean) => {\n const [inView, setInView] = useState(true);\n const [tabVisible, setTabVisible] = useState(true);\n useEffect(() => {\n if (!enabled) return;\n const update = () => setTabVisible(document.visibilityState !== 'hidden');\n update();\n document.addEventListener('visibilitychange', update);\n let observer: IntersectionObserver | undefined;\n if (ref.current && typeof IntersectionObserver === 'function') {\n observer = new IntersectionObserver(([entry]) => setInView(entry.isIntersecting));\n observer.observe(ref.current);\n }\n return () => {\n document.removeEventListener('visibilitychange', update);\n observer?.disconnect();\n };\n }, [ref, enabled]);\n return inView && tabVisible;\n};\n\n/**\n * The request journey as a numbered rail over a row of step cards, one of which is current\n * (Figma \"How it works / Steps\"; its \"Step=1…7\" variants are the `value`). Every card is a button that makes its step\n * current; with `autoPlay` the steps also advance on a timer in an endless loop, which holds while the pointer or\n * keyboard focus is inside and carries on from the step the user picked. Below `collapseBelow` the cards stack and the\n * rail is dropped (Figma \"Mobile / How it works / Steps\").\n */\nexport const HowItWorksSteps = /* @__PURE__ */ forwardRef<HTMLDivElement, HowItWorksStepsProps>(function HowItWorksSteps(\n {\n items,\n value,\n defaultValue,\n onValueChange,\n autoPlay = true,\n interval = 2200,\n paused = false,\n label,\n collapseBelow,\n className,\n style,\n onPointerEnter,\n onPointerLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref],\n );\n\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const [hovered, setHovered] = useState(false);\n const [focused, setFocused] = useState(false);\n const reducedMotion = useReducedMotion();\n const onScreen = useOnScreen(rootRef, autoPlay);\n\n const count = items.length;\n const requested = value !== undefined ? value : uncontrolled;\n const found = items.findIndex((item) => item.value === requested);\n // One step is always current: an unknown or missing value falls back to the first step.\n const activeIndex = found === -1 ? 0 : found;\n\n const select = (index: number) => {\n const next = items[index];\n if (!next || index === activeIndex) return;\n if (value === undefined) setUncontrolled(next.value);\n onValueChange?.(next.value);\n };\n const selectRef = useRef(select);\n selectRef.current = select;\n\n const playing = autoPlay && count > 1 && !reducedMotion && !paused && !hovered && !focused && onScreen;\n\n useEffect(() => {\n if (!playing) return;\n const timer = window.setTimeout(() => selectRef.current((activeIndex + 1) % count), Math.max(interval, 0) + STEP_DURATION);\n return () => window.clearTimeout(timer);\n }, [playing, activeIndex, count, interval]);\n\n if (count === 0) return null;\n\n // 136px per step keeps the Figma card (157px at 1200) readable; below that the row would crush the text.\n const threshold = Math.max(480, collapseBelow ?? count * 136 + (count - 1) * 16);\n const rootStyle = {\n '--_count': count,\n '--_progress': count > 1 ? activeIndex / (count - 1) : 0,\n '--_collapse': threshold,\n ...style,\n } as CSSProperties;\n\n return (\n <div\n ref={setRef}\n className={cn('tm-how-it-works-steps', className)}\n style={rootStyle}\n data-playing={playing ? '' : undefined}\n onPointerEnter={(event: PointerEvent<HTMLDivElement>) => {\n onPointerEnter?.(event);\n // A touch \"enters\" just before it taps; only a resting mouse or pen holds the timer.\n if (event.pointerType !== 'touch') setHovered(true);\n }}\n onPointerLeave={(event: PointerEvent<HTMLDivElement>) => {\n onPointerLeave?.(event);\n setHovered(false);\n }}\n onFocus={(event: FocusEvent<HTMLDivElement>) => {\n onFocus?.(event);\n // Keyboard focus only: the focus a click or a tap leaves on a card must not hold auto-play until the next blur.\n let keyboard = true;\n try {\n 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 onBlur={(event: FocusEvent<HTMLDivElement>) => {\n onBlur?.(event);\n if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);\n }}\n {...props}\n >\n <div className=\"tm-how-it-works-steps__frame\">\n <div className=\"tm-how-it-works-steps__inner\">\n {/* The rail repeats what the list below already says (order, current step), so it is decorative. */}\n <div className=\"tm-how-it-works-steps__rail\" aria-hidden=\"true\" data-tm-icon-size=\"sm\">\n <span className=\"tm-how-it-works-steps__track\" />\n <span className=\"tm-how-it-works-steps__progress\" />\n {items.map((item, index) => (\n <span\n key={item.value}\n className=\"tm-how-it-works-steps__node\"\n data-state={index < activeIndex ? 'done' : index === activeIndex ? 'current' : 'upcoming'}\n >\n <span className=\"tm-how-it-works-steps__number\">{index + 1}</span>\n <CheckmarkIcon className=\"tm-how-it-works-steps__check\" />\n </span>\n ))}\n </div>\n\n <ol className=\"tm-how-it-works-steps__list\" aria-label={label}>\n {items.map((item, index) => {\n const isCurrent = index === activeIndex;\n return (\n <li key={item.value} className=\"tm-how-it-works-steps__item\">\n <button\n type=\"button\"\n className=\"tm-how-it-works-steps__card\"\n aria-current={isCurrent ? 'step' : undefined}\n data-current={isCurrent ? '' : undefined}\n // Shows the chosen step; auto-play carries on from it once the pointer and keyboard focus have left.\n onClick={() => select(index)}\n >\n <span className=\"tm-how-it-works-steps__main\">\n {item.icon ? (\n <span className=\"tm-how-it-works-steps__icon\" data-tm-icon-size=\"md\">\n {item.icon}\n </span>\n ) : null}\n <span className=\"tm-how-it-works-steps__text\">\n <span className=\"tm-how-it-works-steps__title\">{item.title}</span>\n {item.description ? <span className=\"tm-how-it-works-steps__description\">{item.description}</span> : null}\n </span>\n </span>\n {item.badge ? <span className=\"tm-how-it-works-steps__badge\">{item.badge}</span> : null}\n </button>\n </li>\n );\n })}\n </ol>\n </div>\n </div>\n </div>\n );\n});\n"],"mappings":"A,mMAwDA,IAAaS,GAAoC,EAAAF,EAAA,WAAA,CAAoD,SACnG,CAAE,OAAM,YAAW,WAAU,GAAGG,GAChC,EACA,CACA,OACE,EAAAF,EAAA,KAAA,CAAC,OAAD,CAAW,MAAK,UAAWR,EAAAA,GAAG,6BAA8BW,CAAS,EAAG,oBAAkB,KAAK,GAAID,EAAnG,SAAA,CACGE,EACAC,CACG,C,EAEV,CAAC,EAGKC,EAAgB,IAEhBC,MAAyB,CAC7B,GAAM,CAACC,EAASC,IAAA,EAAchB,EAAAA,SAAAA,CAAS,EAAK,EAS5C,OARA,EAAAM,EAAA,UAAA,KAAgB,CACd,GAAI,OAAO,OAAW,KAAe,OAAO,OAAO,YAAe,WAAY,OAC9E,IAAMW,EAAQ,OAAO,WAAW,kCAAkC,EAC5DC,MAAeF,EAAWC,EAAM,OAAO,EAG7C,OAFAC,EAAO,EACPD,EAAM,mBAAmB,SAAUC,CAAM,MAC5BD,EAAM,sBAAsB,SAAUC,CAAM,CAC3D,EAAG,CAAC,CAAC,EACEH,CACT,EAGMI,GAAe,EAAkC,IAAqB,CAC1E,GAAM,CAACC,EAAQC,IAAA,EAAarB,EAAAA,SAAAA,CAAS,EAAI,EACnC,CAACsB,EAAYC,IAAA,EAAiBvB,EAAAA,SAAAA,CAAS,EAAI,EAgBjD,OAfA,EAAAM,EAAA,UAAA,KAAgB,CACd,GAAI,CAACkB,EAAS,OACd,IAAMN,MAAeK,EAAc,SAAS,kBAAoB,QAAQ,EACxEL,EAAO,EACP,SAAS,iBAAiB,mBAAoBA,CAAM,EACpD,IAAIO,EAKJ,OAJIC,EAAI,SAAW,OAAO,sBAAyB,aACjD,EAAW,IAAI,sBAAsB,CAAC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,OAAD,CAAM,UAAU,+BAAgC,SAAAwC,EAAK,KAAY,CAAA,EAChEA,EAAK,aAAc,EAAAxC,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,qCAAsC,SAAAwC,EAAK,WAAkB,CAAA,EAAI,IACjG,CACF,CAAA,CAAA,CACL,CAAA,EAAAA,EAAK,OAAQ,EAAAxC,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,+BAAgC,SAAAwC,EAAK,KAAY,CAAA,EAAI,IAC7E,C,EACN,EAtBKA,EAAK,KAsBV,CAER,CAAC,CACC,CAAA,CACD,C,EACF,CAAA,CACF,CAAA,CAET,CAAC,E"}
@@ -31,7 +31,7 @@ var l = /* @__PURE__ */ n(function({ icon: e, className: n, children: r, ...i },
31
31
  document.removeEventListener("visibilitychange", n), i?.disconnect();
32
32
  };
33
33
  }, [e, t]), n && a;
34
- }, p = /* @__PURE__ */ n(function({ items: n, value: l, defaultValue: p, onValueChange: m, autoPlay: h = !1, interval: g = 2200, paused: _ = !1, label: v, collapseBelow: y, className: b, style: x, onPointerEnter: S, onPointerLeave: C, onFocus: w, onBlur: T, ...E }, D) {
34
+ }, p = /* @__PURE__ */ n(function({ items: n, value: l, defaultValue: p, onValueChange: m, autoPlay: h = !0, interval: g = 2200, paused: _ = !1, label: v, collapseBelow: y, className: b, style: x, onPointerEnter: S, onPointerLeave: C, onFocus: w, onBlur: T, ...E }, D) {
35
35
  let O = a(null), k = r((e) => {
36
36
  O.current = e, typeof D == "function" ? D(e) : D && (D.current = e);
37
37
  }, [D]), [A, j] = o(p), [M, N] = o(!1), [P, F] = o(!1), I = d(), L = f(O, h), R = n.length, z = l === void 0 ? A : l, B = n.findIndex((e) => e.value === z), V = B === -1 ? 0 : B, H = (e) => {
@@ -1 +1 @@
1
- {"version":3,"file":"HowItWorksSteps.js","names":["HowItWorksStepTag","props","cn","className","icon","children","STEP_DURATION","useReducedMotion","reduced","setReduced","useState","useEffect","query","update","useOnScreen","inView","setInView","tabVisible","setTabVisible","enabled","observer","ref","entry","HowItWorksSteps","rootRef","useRef","setRef","useCallback","node","uncontrolled","setUncontrolled","defaultValue","hovered","setHovered","focused","setFocused","reducedMotion","onScreen","autoPlay","count","items","requested","value","found","item","activeIndex","select","next","index","onValueChange","selectRef","playing","paused","timer","interval","threshold","collapseBelow","rootStyle","style","onPointerEnter","event","onPointerLeave","keyboard","onBlur","CheckmarkIcon","label","isCurrent"],"sources":["../../../src/components/HowItWorksSteps/HowItWorksSteps.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type HTMLAttributes,\n type PointerEvent,\n type ReactNode,\n} from 'react';\nimport { CheckmarkIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './HowItWorksSteps.css';\n\nexport interface HowItWorksStepItem {\n /** Identifies the step in `value` / `onValueChange`. */\n value: string;\n /** One icon from `@travel-match/ui` for the icon tile, e.g. `<PaperIcon />`. */\n icon?: ReactNode;\n /** Step name, e.g. \"Submit a request\". Phrasing content only — it is rendered inside a button. */\n title: ReactNode;\n /** One or two sentences about the step. Phrasing content only. */\n description?: ReactNode;\n /** Pill at the bottom of the card, e.g. a `<RequestStatus>` or a `<Tag>`. Must not be interactive. */\n badge?: ReactNode;\n}\n\nexport interface HowItWorksStepsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue' | 'onChange'> {\n /** The steps, in order. Nothing is rendered for an empty list. */\n items: HowItWorksStepItem[];\n /** Controlled: `value` of the current step (Figma \"Step\"). */\n value?: string;\n /** Uncontrolled: `value` of the step that starts current. Defaults to the first one. */\n defaultValue?: string;\n /** Called with the `value` of the step that became current, by a click or by auto-play. */\n onValueChange?: (value: string) => void;\n /** Advances to the next step on a timer, in an endless loop; after the user picks a step it carries on from that step. */\n autoPlay?: boolean;\n /** Time a step rests once its 500ms transition has finished, in ms (Figma: 2200 — a new step every 2.7s). */\n interval?: number;\n /** Holds auto-play without unmounting it (e.g. while a dialog is open); it carries on once this is `false` again. */\n paused?: boolean;\n /** Accessible name of the list of steps, e.g. \"How it works\". */\n label?: string;\n /** 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. */\n collapseBelow?: number;\n}\n\nexport interface HowItWorksStepTagProps extends HTMLAttributes<HTMLSpanElement> {\n /** One icon from `@travel-match/ui`, e.g. `<CompareIcon />`. */\n icon?: ReactNode;\n}\n\n/** The tinted pill Figma draws at the bottom of the steps that have no request status (\"Up to 3 offers\"). Use it as a step's `badge`. */\nexport const HowItWorksStepTag = /* @__PURE__ */ forwardRef<HTMLSpanElement, HowItWorksStepTagProps>(function HowItWorksStepTag(\n { icon, className, children, ...props },\n ref,\n) {\n return (\n <span ref={ref} className={cn('tm-how-it-works-steps__tag', className)} data-tm-icon-size=\"sm\" {...props}>\n {icon}\n {children}\n </span>\n );\n});\n\n/** Figma prototype: Smart animate, ease in and out, 500ms. Keep in sync with `--_duration` in the stylesheet. */\nconst STEP_DURATION = 500;\n\nconst useReducedMotion = () => {\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/** True while the element is on screen and the tab is visible — the only time a timer should run. */\nconst useOnScreen = (ref: { current: Element | null }, enabled: boolean) => {\n const [inView, setInView] = useState(true);\n const [tabVisible, setTabVisible] = useState(true);\n useEffect(() => {\n if (!enabled) return;\n const update = () => setTabVisible(document.visibilityState !== 'hidden');\n update();\n document.addEventListener('visibilitychange', update);\n let observer: IntersectionObserver | undefined;\n if (ref.current && typeof IntersectionObserver === 'function') {\n observer = new IntersectionObserver(([entry]) => setInView(entry.isIntersecting));\n observer.observe(ref.current);\n }\n return () => {\n document.removeEventListener('visibilitychange', update);\n observer?.disconnect();\n };\n }, [ref, enabled]);\n return inView && tabVisible;\n};\n\n/**\n * The request journey as a numbered rail over a row of step cards, one of which is current\n * (Figma \"How it works / Steps\"; its \"Step=1…7\" variants are the `value`). Every card is a button that makes its step\n * current; with `autoPlay` the steps also advance on a timer in an endless loop, which holds while the pointer or\n * keyboard focus is inside and carries on from the step the user picked. Below `collapseBelow` the cards stack and the\n * rail is dropped (Figma \"Mobile / How it works / Steps\").\n */\nexport const HowItWorksSteps = /* @__PURE__ */ forwardRef<HTMLDivElement, HowItWorksStepsProps>(function HowItWorksSteps(\n {\n items,\n value,\n defaultValue,\n onValueChange,\n autoPlay = false,\n interval = 2200,\n paused = false,\n label,\n collapseBelow,\n className,\n style,\n onPointerEnter,\n onPointerLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref],\n );\n\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const [hovered, setHovered] = useState(false);\n const [focused, setFocused] = useState(false);\n const reducedMotion = useReducedMotion();\n const onScreen = useOnScreen(rootRef, autoPlay);\n\n const count = items.length;\n const requested = value !== undefined ? value : uncontrolled;\n const found = items.findIndex((item) => item.value === requested);\n // One step is always current: an unknown or missing value falls back to the first step.\n const activeIndex = found === -1 ? 0 : found;\n\n const select = (index: number) => {\n const next = items[index];\n if (!next || index === activeIndex) return;\n if (value === undefined) setUncontrolled(next.value);\n onValueChange?.(next.value);\n };\n const selectRef = useRef(select);\n selectRef.current = select;\n\n const playing = autoPlay && count > 1 && !reducedMotion && !paused && !hovered && !focused && onScreen;\n\n useEffect(() => {\n if (!playing) return;\n const timer = window.setTimeout(() => selectRef.current((activeIndex + 1) % count), Math.max(interval, 0) + STEP_DURATION);\n return () => window.clearTimeout(timer);\n }, [playing, activeIndex, count, interval]);\n\n if (count === 0) return null;\n\n // 136px per step keeps the Figma card (157px at 1200) readable; below that the row would crush the text.\n const threshold = Math.max(480, collapseBelow ?? count * 136 + (count - 1) * 16);\n const rootStyle = {\n '--_count': count,\n '--_progress': count > 1 ? activeIndex / (count - 1) : 0,\n '--_collapse': threshold,\n ...style,\n } as CSSProperties;\n\n return (\n <div\n ref={setRef}\n className={cn('tm-how-it-works-steps', className)}\n style={rootStyle}\n data-playing={playing ? '' : undefined}\n onPointerEnter={(event: PointerEvent<HTMLDivElement>) => {\n onPointerEnter?.(event);\n // A touch \"enters\" just before it taps; only a resting mouse or pen holds the timer.\n if (event.pointerType !== 'touch') setHovered(true);\n }}\n onPointerLeave={(event: PointerEvent<HTMLDivElement>) => {\n onPointerLeave?.(event);\n setHovered(false);\n }}\n onFocus={(event: FocusEvent<HTMLDivElement>) => {\n onFocus?.(event);\n // Keyboard focus only: the focus a click or a tap leaves on a card must not hold auto-play until the next blur.\n let keyboard = true;\n try {\n 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 onBlur={(event: FocusEvent<HTMLDivElement>) => {\n onBlur?.(event);\n if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);\n }}\n {...props}\n >\n <div className=\"tm-how-it-works-steps__frame\">\n <div className=\"tm-how-it-works-steps__inner\">\n {/* The rail repeats what the list below already says (order, current step), so it is decorative. */}\n <div className=\"tm-how-it-works-steps__rail\" aria-hidden=\"true\" data-tm-icon-size=\"sm\">\n <span className=\"tm-how-it-works-steps__track\" />\n <span className=\"tm-how-it-works-steps__progress\" />\n {items.map((item, index) => (\n <span\n key={item.value}\n className=\"tm-how-it-works-steps__node\"\n data-state={index < activeIndex ? 'done' : index === activeIndex ? 'current' : 'upcoming'}\n >\n <span className=\"tm-how-it-works-steps__number\">{index + 1}</span>\n <CheckmarkIcon className=\"tm-how-it-works-steps__check\" />\n </span>\n ))}\n </div>\n\n <ol className=\"tm-how-it-works-steps__list\" aria-label={label}>\n {items.map((item, index) => {\n const isCurrent = index === activeIndex;\n return (\n <li key={item.value} className=\"tm-how-it-works-steps__item\">\n <button\n type=\"button\"\n className=\"tm-how-it-works-steps__card\"\n aria-current={isCurrent ? 'step' : undefined}\n data-current={isCurrent ? '' : undefined}\n // Shows the chosen step; auto-play carries on from it once the pointer and keyboard focus have left.\n onClick={() => select(index)}\n >\n <span className=\"tm-how-it-works-steps__main\">\n {item.icon ? (\n <span className=\"tm-how-it-works-steps__icon\" data-tm-icon-size=\"md\">\n {item.icon}\n </span>\n ) : null}\n <span className=\"tm-how-it-works-steps__text\">\n <span className=\"tm-how-it-works-steps__title\">{item.title}</span>\n {item.description ? <span className=\"tm-how-it-works-steps__description\">{item.description}</span> : null}\n </span>\n </span>\n {item.badge ? <span className=\"tm-how-it-works-steps__badge\">{item.badge}</span> : null}\n </button>\n </li>\n );\n })}\n </ol>\n </div>\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;;AAwDA,IAAaA,IAAoC,kBAAoD,SACnG,EAAE,SAAM,cAAW,aAAU,GAAGC,KAChC,GACA;CACA,OACE,kBAAC,QAAD;EAAW;EAAK,WAAWC,EAAG,8BAA8BC,CAAS;EAAG,qBAAkB;EAAK,GAAIF;EAAnG,UAAA,CACGG,GACAC,CACG;;AAEV,CAAC,GAGKC,IAAgB,KAEhBC,UAAyB;CAC7B,IAAM,CAACC,GAASC,KAAcC,EAAS,EAAK;CAS5C,OARAC,QAAgB;EACd,IAAI,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe,YAAY;EAC9E,IAAMC,IAAQ,OAAO,WAAW,kCAAkC,GAC5DC,UAAeJ,EAAWG,EAAM,OAAO;EAG7C,OAFAC,EAAO,GACPD,EAAM,mBAAmB,UAAUC,CAAM,SAC5BD,EAAM,sBAAsB,UAAUC,CAAM;CAC3D,GAAG,CAAC,CAAC,GACEL;AACT,GAGMM,KAAe,GAAkC,MAAqB;CAC1E,IAAM,CAACC,GAAQC,KAAaN,EAAS,EA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,GAAAA,EAAK,QAAQ,kBAAC,QAAD;SAAM,WAAU;SAAgC,UAAAA,EAAK;QAAY,CAAA,IAAI,IAC7E;;MACN,GAtBKA,EAAK,KAsBV;KAER,CAAC;IACC,CAAA,CACD;;EACF,CAAA;CACF,CAAA;AAET,CAAC"}
1
+ {"version":3,"file":"HowItWorksSteps.js","names":["HowItWorksStepTag","props","cn","className","icon","children","STEP_DURATION","useReducedMotion","reduced","setReduced","useState","useEffect","query","update","useOnScreen","inView","setInView","tabVisible","setTabVisible","enabled","observer","ref","entry","HowItWorksSteps","rootRef","useRef","setRef","useCallback","node","uncontrolled","setUncontrolled","defaultValue","hovered","setHovered","focused","setFocused","reducedMotion","onScreen","autoPlay","count","items","requested","value","found","item","activeIndex","select","next","index","onValueChange","selectRef","playing","paused","timer","interval","threshold","collapseBelow","rootStyle","style","onPointerEnter","event","onPointerLeave","keyboard","onBlur","CheckmarkIcon","label","isCurrent"],"sources":["../../../src/components/HowItWorksSteps/HowItWorksSteps.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type HTMLAttributes,\n type PointerEvent,\n type ReactNode,\n} from 'react';\nimport { CheckmarkIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './HowItWorksSteps.css';\n\nexport interface HowItWorksStepItem {\n /** Identifies the step in `value` / `onValueChange`. */\n value: string;\n /** One icon from `@travel-match/ui` for the icon tile, e.g. `<PaperIcon />`. */\n icon?: ReactNode;\n /** Step name, e.g. \"Submit a request\". Phrasing content only — it is rendered inside a button. */\n title: ReactNode;\n /** One or two sentences about the step. Phrasing content only. */\n description?: ReactNode;\n /** Pill at the bottom of the card, e.g. a `<RequestStatus>` or a `<Tag>`. Must not be interactive. */\n badge?: ReactNode;\n}\n\nexport interface HowItWorksStepsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue' | 'onChange'> {\n /** The steps, in order. Nothing is rendered for an empty list. */\n items: HowItWorksStepItem[];\n /** Controlled: `value` of the current step (Figma \"Step\"). */\n value?: string;\n /** Uncontrolled: `value` of the step that starts current. Defaults to the first one. */\n defaultValue?: string;\n /** Called with the `value` of the step that became current, by a click or by auto-play. */\n onValueChange?: (value: string) => void;\n /** Advances to the next step on a timer, in an endless loop (on by default); after the user picks a step it carries on from that step. */\n autoPlay?: boolean;\n /** Time a step rests once its 500ms transition has finished, in ms (Figma: 2200 — a new step every 2.7s). */\n interval?: number;\n /** Holds auto-play without unmounting it (e.g. while a dialog is open); it carries on once this is `false` again. */\n paused?: boolean;\n /** Accessible name of the list of steps, e.g. \"How it works\". */\n label?: string;\n /** 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. */\n collapseBelow?: number;\n}\n\nexport interface HowItWorksStepTagProps extends HTMLAttributes<HTMLSpanElement> {\n /** One icon from `@travel-match/ui`, e.g. `<CompareIcon />`. */\n icon?: ReactNode;\n}\n\n/** The tinted pill Figma draws at the bottom of the steps that have no request status (\"Up to 3 offers\"). Use it as a step's `badge`. */\nexport const HowItWorksStepTag = /* @__PURE__ */ forwardRef<HTMLSpanElement, HowItWorksStepTagProps>(function HowItWorksStepTag(\n { icon, className, children, ...props },\n ref,\n) {\n return (\n <span ref={ref} className={cn('tm-how-it-works-steps__tag', className)} data-tm-icon-size=\"sm\" {...props}>\n {icon}\n {children}\n </span>\n );\n});\n\n/** Figma prototype: Smart animate, ease in and out, 500ms. Keep in sync with `--_duration` in the stylesheet. */\nconst STEP_DURATION = 500;\n\nconst useReducedMotion = () => {\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/** True while the element is on screen and the tab is visible — the only time a timer should run. */\nconst useOnScreen = (ref: { current: Element | null }, enabled: boolean) => {\n const [inView, setInView] = useState(true);\n const [tabVisible, setTabVisible] = useState(true);\n useEffect(() => {\n if (!enabled) return;\n const update = () => setTabVisible(document.visibilityState !== 'hidden');\n update();\n document.addEventListener('visibilitychange', update);\n let observer: IntersectionObserver | undefined;\n if (ref.current && typeof IntersectionObserver === 'function') {\n observer = new IntersectionObserver(([entry]) => setInView(entry.isIntersecting));\n observer.observe(ref.current);\n }\n return () => {\n document.removeEventListener('visibilitychange', update);\n observer?.disconnect();\n };\n }, [ref, enabled]);\n return inView && tabVisible;\n};\n\n/**\n * The request journey as a numbered rail over a row of step cards, one of which is current\n * (Figma \"How it works / Steps\"; its \"Step=1…7\" variants are the `value`). Every card is a button that makes its step\n * current; with `autoPlay` the steps also advance on a timer in an endless loop, which holds while the pointer or\n * keyboard focus is inside and carries on from the step the user picked. Below `collapseBelow` the cards stack and the\n * rail is dropped (Figma \"Mobile / How it works / Steps\").\n */\nexport const HowItWorksSteps = /* @__PURE__ */ forwardRef<HTMLDivElement, HowItWorksStepsProps>(function HowItWorksSteps(\n {\n items,\n value,\n defaultValue,\n onValueChange,\n autoPlay = true,\n interval = 2200,\n paused = false,\n label,\n collapseBelow,\n className,\n style,\n onPointerEnter,\n onPointerLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref,\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const setRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref],\n );\n\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const [hovered, setHovered] = useState(false);\n const [focused, setFocused] = useState(false);\n const reducedMotion = useReducedMotion();\n const onScreen = useOnScreen(rootRef, autoPlay);\n\n const count = items.length;\n const requested = value !== undefined ? value : uncontrolled;\n const found = items.findIndex((item) => item.value === requested);\n // One step is always current: an unknown or missing value falls back to the first step.\n const activeIndex = found === -1 ? 0 : found;\n\n const select = (index: number) => {\n const next = items[index];\n if (!next || index === activeIndex) return;\n if (value === undefined) setUncontrolled(next.value);\n onValueChange?.(next.value);\n };\n const selectRef = useRef(select);\n selectRef.current = select;\n\n const playing = autoPlay && count > 1 && !reducedMotion && !paused && !hovered && !focused && onScreen;\n\n useEffect(() => {\n if (!playing) return;\n const timer = window.setTimeout(() => selectRef.current((activeIndex + 1) % count), Math.max(interval, 0) + STEP_DURATION);\n return () => window.clearTimeout(timer);\n }, [playing, activeIndex, count, interval]);\n\n if (count === 0) return null;\n\n // 136px per step keeps the Figma card (157px at 1200) readable; below that the row would crush the text.\n const threshold = Math.max(480, collapseBelow ?? count * 136 + (count - 1) * 16);\n const rootStyle = {\n '--_count': count,\n '--_progress': count > 1 ? activeIndex / (count - 1) : 0,\n '--_collapse': threshold,\n ...style,\n } as CSSProperties;\n\n return (\n <div\n ref={setRef}\n className={cn('tm-how-it-works-steps', className)}\n style={rootStyle}\n data-playing={playing ? '' : undefined}\n onPointerEnter={(event: PointerEvent<HTMLDivElement>) => {\n onPointerEnter?.(event);\n // A touch \"enters\" just before it taps; only a resting mouse or pen holds the timer.\n if (event.pointerType !== 'touch') setHovered(true);\n }}\n onPointerLeave={(event: PointerEvent<HTMLDivElement>) => {\n onPointerLeave?.(event);\n setHovered(false);\n }}\n onFocus={(event: FocusEvent<HTMLDivElement>) => {\n onFocus?.(event);\n // Keyboard focus only: the focus a click or a tap leaves on a card must not hold auto-play until the next blur.\n let keyboard = true;\n try {\n 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 onBlur={(event: FocusEvent<HTMLDivElement>) => {\n onBlur?.(event);\n if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);\n }}\n {...props}\n >\n <div className=\"tm-how-it-works-steps__frame\">\n <div className=\"tm-how-it-works-steps__inner\">\n {/* The rail repeats what the list below already says (order, current step), so it is decorative. */}\n <div className=\"tm-how-it-works-steps__rail\" aria-hidden=\"true\" data-tm-icon-size=\"sm\">\n <span className=\"tm-how-it-works-steps__track\" />\n <span className=\"tm-how-it-works-steps__progress\" />\n {items.map((item, index) => (\n <span\n key={item.value}\n className=\"tm-how-it-works-steps__node\"\n data-state={index < activeIndex ? 'done' : index === activeIndex ? 'current' : 'upcoming'}\n >\n <span className=\"tm-how-it-works-steps__number\">{index + 1}</span>\n <CheckmarkIcon className=\"tm-how-it-works-steps__check\" />\n </span>\n ))}\n </div>\n\n <ol className=\"tm-how-it-works-steps__list\" aria-label={label}>\n {items.map((item, index) => {\n const isCurrent = index === activeIndex;\n return (\n <li key={item.value} className=\"tm-how-it-works-steps__item\">\n <button\n type=\"button\"\n className=\"tm-how-it-works-steps__card\"\n aria-current={isCurrent ? 'step' : undefined}\n data-current={isCurrent ? '' : undefined}\n // Shows the chosen step; auto-play carries on from it once the pointer and keyboard focus have left.\n onClick={() => select(index)}\n >\n <span className=\"tm-how-it-works-steps__main\">\n {item.icon ? (\n <span className=\"tm-how-it-works-steps__icon\" data-tm-icon-size=\"md\">\n {item.icon}\n </span>\n ) : null}\n <span className=\"tm-how-it-works-steps__text\">\n <span className=\"tm-how-it-works-steps__title\">{item.title}</span>\n {item.description ? <span className=\"tm-how-it-works-steps__description\">{item.description}</span> : null}\n </span>\n </span>\n {item.badge ? <span className=\"tm-how-it-works-steps__badge\">{item.badge}</span> : null}\n </button>\n </li>\n );\n })}\n </ol>\n </div>\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;;AAwDA,IAAaA,IAAoC,kBAAoD,SACnG,EAAE,SAAM,cAAW,aAAU,GAAGC,KAChC,GACA;CACA,OACE,kBAAC,QAAD;EAAW;EAAK,WAAWC,EAAG,8BAA8BC,CAAS;EAAG,qBAAkB;EAAK,GAAIF;EAAnG,UAAA,CACGG,GACAC,CACG;;AAEV,CAAC,GAGKC,IAAgB,KAEhBC,UAAyB;CAC7B,IAAM,CAACC,GAASC,KAAcC,EAAS,EAAK;CAS5C,OARAC,QAAgB;EAC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AA,CACGJ,EAAK,OACJ,kBAAC,QAAD;UAAM,WAAU;UAA8B,qBAAkB;UAC7D,UAAAA,EAAK;SACF,CAAA,IACJ,MACJ,kBAAC,QAAD;UAAM,WAAU;UAAhB,UAAA,CACE,kBAAC,QAAD;WAAM,WAAU;WAAgC,UAAAA,EAAK;UAAY,CAAA,GAChEA,EAAK,cAAc,kBAAC,QAAD;WAAM,WAAU;WAAsC,UAAAA,EAAK;UAAkB,CAAA,IAAI,IACjG;SACF,CAAA,CAAA;QACL,CAAA,GAAAA,EAAK,QAAQ,kBAAC,QAAD;SAAM,WAAU;SAAgC,UAAAA,EAAK;QAAY,CAAA,IAAI,IAC7E;;MACN,GAtBKA,EAAK,KAsBV;KAER,CAAC;IACC,CAAA,CACD;;EACF,CAAA;CACF,CAAA;AAET,CAAC"}
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../icons/generated/CheckmarkIcon.cjs"),t=require("../../icons/generated/ErrorCircleIcon.cjs"),n=require("../../utils/cn.cjs");;/* empty css */let r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(function({tone:r=`info`,title:a,action:o,className:s,children:c,...l},u){let d=r===`success`?e.CheckmarkIcon:t.ErrorCircleIcon;return(0,i.jsxs)(`div`,{ref:u,className:n.cn(`tm-inline-alert`,s),"data-tone":r,role:r===`warning`||r===`error`?`alert`:`status`,...l,children:[(0,i.jsx)(d,{className:`tm-inline-alert__icon`,size:`md`}),(0,i.jsxs)(`div`,{className:`tm-inline-alert__content`,children:[a?(0,i.jsx)(`div`,{className:`tm-inline-alert__title`,children:a}):null,c?(0,i.jsx)(`div`,{className:`tm-inline-alert__message`,children:c}):null]}),o?(0,i.jsx)(`div`,{className:`tm-inline-alert__action`,children:o}):null]})});exports.InlineAlert=a;
1
+ "use client";const e=require("../../icons/generated/CheckmarkIcon.cjs"),t=require("../../icons/generated/ErrorCircleIcon.cjs"),n=require("../../utils/cn.cjs");;/* empty css */let r=require("react"),i=require("react/jsx-runtime");var a=(0,r.forwardRef)(function({tone:r=`info`,title:a,action:o,size:s=`md`,className:c,children:l,...u},d){let f=r===`success`?e.CheckmarkIcon:t.ErrorCircleIcon;return(0,i.jsxs)(`div`,{ref:d,className:n.cn(`tm-inline-alert`,c),"data-tone":r,"data-size":s,role:r===`warning`||r===`error`?`alert`:`status`,...u,children:[(0,i.jsx)(f,{className:`tm-inline-alert__icon`,size:`md`}),(0,i.jsxs)(`div`,{className:`tm-inline-alert__content`,children:[a?(0,i.jsx)(`div`,{className:`tm-inline-alert__title`,children:a}):null,l?(0,i.jsx)(`div`,{className:`tm-inline-alert__message`,children:l}):null]}),o?(0,i.jsx)(`div`,{className:`tm-inline-alert__action`,children:o}):null]})});exports.InlineAlert=a;
2
2
  //# sourceMappingURL=InlineAlert.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"InlineAlert.cjs","names":["CheckmarkIcon","ErrorCircleIcon","cn","require_CheckmarkIcon","require_ErrorCircleIcon","require_cn","react","react_jsx_runtime","InlineAlert","props","Icon","tone","className","title","children","action"],"sources":["../../../src/components/InlineAlert/InlineAlert.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { CheckmarkIcon, ErrorCircleIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './InlineAlert.css';\n\n/** Figma \"Type\": Info · Success · Warning · Error */\nexport type InlineAlertTone = 'info' | 'success' | 'warning' | 'error';\n\nexport interface InlineAlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Figma \"Type\". Sets the colours and icon, and the default role: `status` for info/success, `alert` for warning/error. */\n tone?: InlineAlertTone;\n /** Short heading in the tone's colour (Figma \"Title\"). */\n title?: ReactNode;\n /** Link or button at the end of the alert (Figma \"Action\"), e.g. `<button type=\"button\">Try again</button>`. */\n action?: ReactNode;\n /** The message (Figma \"Message\"). */\n children?: ReactNode;\n}\n\n/** A message placed in the page flow, next to the content it is about. */\nexport const InlineAlert = /* @__PURE__ */ forwardRef<HTMLDivElement, InlineAlertProps>(function InlineAlert(\n { tone = 'info', title, action, className, children, ...props },\n ref,\n) {\n const Icon = tone === 'success' ? CheckmarkIcon : ErrorCircleIcon;\n return (\n <div ref={ref} className={cn('tm-inline-alert', className)} data-tone={tone} role={tone === 'warning' || tone === 'error' ? 'alert' : 'status'} {...props}>\n <Icon className=\"tm-inline-alert__icon\" size=\"md\" />\n <div className=\"tm-inline-alert__content\">\n {title ? <div className=\"tm-inline-alert__title\">{title}</div> : null}\n {children ? <div className=\"tm-inline-alert__message\">{children}</div> : null}\n </div>\n {action ? <div className=\"tm-inline-alert__action\">{action}</div> : null}\n </div>\n );\n});\n"],"mappings":"A,sPAoBA,IAAaQ,GAA8B,EAAAF,EAAA,WAAA,CAA6C,SACtF,CAAE,OAAO,OAAQ,QAAO,SAAQ,YAAW,WAAU,GAAGG,GACxD,EACA,CACA,IAAMC,EAAOC,IAAS,UAAYX,EAAAA,cAAgBC,EAAAA,gBAClD,OACE,EAAAM,EAAA,KAAA,CAAC,MAAD,CAAU,MAAK,UAAWL,EAAAA,GAAG,kBAAmBU,CAAS,EAAG,YAAWD,EAAM,KAAMA,IAAS,WAAaA,IAAS,QAAU,QAAU,SAAU,GAAIF,EAApJ,SAAA,EACE,EAAAF,EAAA,IAAA,CAACG,EAAD,CAAM,UAAU,wBAAwB,KAAK,IAAM,CAAA,GACnD,EAAAH,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,2BAAf,SAAA,CACGM,GAAQ,EAAAN,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,yBAA0B,SAAAM,CAAW,CAAA,EAAI,KAChEC,GAAW,EAAAP,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,2BAA4B,UAAc,CAAA,EAAI,IACtE,C,GACJQ,GAAS,EAAAR,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0BAA2B,SAAAQ,CAAY,CAAA,EAAI,IACjE,C,EAET,CAAC,E"}
1
+ {"version":3,"file":"InlineAlert.cjs","names":["CheckmarkIcon","ErrorCircleIcon","cn","require_CheckmarkIcon","require_ErrorCircleIcon","require_cn","react","react_jsx_runtime","InlineAlert","props","Icon","tone","className","size","title","children","action"],"sources":["../../../src/components/InlineAlert/InlineAlert.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { CheckmarkIcon, ErrorCircleIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './InlineAlert.css';\n\n/** Figma \"Type\": Info · Success · Warning · Error */\nexport type InlineAlertTone = 'info' | 'success' | 'warning' | 'error';\n\nexport interface InlineAlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Figma \"Type\". Sets the colours and icon, and the default role: `status` for info/success, `alert` for warning/error. */\n tone?: InlineAlertTone;\n /** Short heading in the tone's colour (Figma \"Title\"). */\n title?: ReactNode;\n /** Link or button at the end of the alert (Figma \"Action\"), e.g. `<button type=\"button\">Try again</button>`. */\n action?: ReactNode;\n /** The message (Figma \"Message\"). */\n children?: ReactNode;\n /**\n * `md` (default): the Figma component, 12px × 16px padding, the message as wide as the alert. `lg`: the alert as the\n * screens place it (Contact Support 2410:6422, Help Article 2404:6448) — 16px padding all round, and the message kept\n * to the component's 400px text column.\n */\n size?: 'md' | 'lg';\n}\n\n/** A message placed in the page flow, next to the content it is about. */\nexport const InlineAlert = /* @__PURE__ */ forwardRef<HTMLDivElement, InlineAlertProps>(function InlineAlert(\n { tone = 'info', title, action, size = 'md', className, children, ...props },\n ref,\n) {\n const Icon = tone === 'success' ? CheckmarkIcon : ErrorCircleIcon;\n return (\n <div ref={ref} className={cn('tm-inline-alert', className)} data-tone={tone} data-size={size} role={tone === 'warning' || tone === 'error' ? 'alert' : 'status'} {...props}>\n <Icon className=\"tm-inline-alert__icon\" size=\"md\" />\n <div className=\"tm-inline-alert__content\">\n {title ? <div className=\"tm-inline-alert__title\">{title}</div> : null}\n {children ? <div className=\"tm-inline-alert__message\">{children}</div> : null}\n </div>\n {action ? <div className=\"tm-inline-alert__action\">{action}</div> : null}\n </div>\n );\n});\n"],"mappings":"A,sPA0BA,IAAaQ,GAA8B,EAAAF,EAAA,WAAA,CAA6C,SACtF,CAAE,OAAO,OAAQ,QAAO,SAAQ,OAAO,KAAM,YAAW,WAAU,GAAGG,GACrE,EACA,CACA,IAAMC,EAAOC,IAAS,UAAYX,EAAAA,cAAgBC,EAAAA,gBAClD,OACE,EAAAM,EAAA,KAAA,CAAC,MAAD,CAAU,MAAK,UAAWL,EAAAA,GAAG,kBAAmBU,CAAS,EAAG,YAAWD,EAAM,YAAWE,EAAM,KAAMF,IAAS,WAAaA,IAAS,QAAU,QAAU,SAAU,GAAIF,EAArK,SAAA,EACE,EAAAF,EAAA,IAAA,CAACG,EAAD,CAAM,UAAU,wBAAwB,KAAK,IAAM,CAAA,GACnD,EAAAH,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,2BAAf,SAAA,CACGO,GAAQ,EAAAP,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,yBAA0B,SAAAO,CAAW,CAAA,EAAI,KAChEC,GAAW,EAAAR,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,2BAA4B,UAAc,CAAA,EAAI,IACtE,C,GACJS,GAAS,EAAAT,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0BAA2B,SAAAS,CAAY,CAAA,EAAI,IACjE,C,EAET,CAAC,E"}
@@ -6,16 +6,17 @@ import { cn as n } from "../../utils/cn.js";
6
6
  import { forwardRef as r } from "react";
7
7
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
8
8
  // src/components/InlineAlert/InlineAlert.tsx
9
- var o = /* @__PURE__ */ r(function({ tone: r = "info", title: o, action: s, className: c, children: l, ...u }, d) {
10
- let f = r === "success" ? e : t;
9
+ var o = /* @__PURE__ */ r(function({ tone: r = "info", title: o, action: s, size: c = "md", className: l, children: u, ...d }, f) {
10
+ let p = r === "success" ? e : t;
11
11
  return /* @__PURE__ */ a("div", {
12
- ref: d,
13
- className: n("tm-inline-alert", c),
12
+ ref: f,
13
+ className: n("tm-inline-alert", l),
14
14
  "data-tone": r,
15
+ "data-size": c,
15
16
  role: r === "warning" || r === "error" ? "alert" : "status",
16
- ...u,
17
+ ...d,
17
18
  children: [
18
- /* @__PURE__ */ i(f, {
19
+ /* @__PURE__ */ i(p, {
19
20
  className: "tm-inline-alert__icon",
20
21
  size: "md"
21
22
  }),
@@ -24,9 +25,9 @@ var o = /* @__PURE__ */ r(function({ tone: r = "info", title: o, action: s, clas
24
25
  children: [o ? /* @__PURE__ */ i("div", {
25
26
  className: "tm-inline-alert__title",
26
27
  children: o
27
- }) : null, l ? /* @__PURE__ */ i("div", {
28
+ }) : null, u ? /* @__PURE__ */ i("div", {
28
29
  className: "tm-inline-alert__message",
29
- children: l
30
+ children: u
30
31
  }) : null]
31
32
  }),
32
33
  s ? /* @__PURE__ */ i("div", {
@@ -1 +1 @@
1
- {"version":3,"file":"InlineAlert.js","names":["InlineAlert","props","Icon","tone","CheckmarkIcon","ErrorCircleIcon","cn","className","title","children","action"],"sources":["../../../src/components/InlineAlert/InlineAlert.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { CheckmarkIcon, ErrorCircleIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './InlineAlert.css';\n\n/** Figma \"Type\": Info · Success · Warning · Error */\nexport type InlineAlertTone = 'info' | 'success' | 'warning' | 'error';\n\nexport interface InlineAlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Figma \"Type\". Sets the colours and icon, and the default role: `status` for info/success, `alert` for warning/error. */\n tone?: InlineAlertTone;\n /** Short heading in the tone's colour (Figma \"Title\"). */\n title?: ReactNode;\n /** Link or button at the end of the alert (Figma \"Action\"), e.g. `<button type=\"button\">Try again</button>`. */\n action?: ReactNode;\n /** The message (Figma \"Message\"). */\n children?: ReactNode;\n}\n\n/** A message placed in the page flow, next to the content it is about. */\nexport const InlineAlert = /* @__PURE__ */ forwardRef<HTMLDivElement, InlineAlertProps>(function InlineAlert(\n { tone = 'info', title, action, className, children, ...props },\n ref,\n) {\n const Icon = tone === 'success' ? CheckmarkIcon : ErrorCircleIcon;\n return (\n <div ref={ref} className={cn('tm-inline-alert', className)} data-tone={tone} role={tone === 'warning' || tone === 'error' ? 'alert' : 'status'} {...props}>\n <Icon className=\"tm-inline-alert__icon\" size=\"md\" />\n <div className=\"tm-inline-alert__content\">\n {title ? <div className=\"tm-inline-alert__title\">{title}</div> : null}\n {children ? <div className=\"tm-inline-alert__message\">{children}</div> : null}\n </div>\n {action ? <div className=\"tm-inline-alert__action\">{action}</div> : null}\n </div>\n );\n});\n"],"mappings":";;;;;;;;AAoBA,IAAaA,IAA8B,kBAA6C,SACtF,EAAE,UAAO,QAAQ,UAAO,WAAQ,cAAW,aAAU,GAAGC,KACxD,GACA;CACA,IAAMC,IAAOC,MAAS,YAAYC,IAAgBC;CAClD,OACE,kBAAC,OAAD;EAAU;EAAK,WAAWC,EAAG,mBAAmBC,CAAS;EAAG,aAAWJ;EAAM,MAAMA,MAAS,aAAaA,MAAS,UAAU,UAAU;EAAU,GAAIF;EAApJ,UAAA;GACE,kBAACC,GAAD;IAAM,WAAU;IAAwB,MAAK;GAAM,CAAA;GACnD,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACGM,IAAQ,kBAAC,OAAD;KAAK,WAAU;KAA0B,UAAAA;IAAW,CAAA,IAAI,MAChEC,IAAW,kBAAC,OAAD;KAAK,WAAU;KAA4B;IAAc,CAAA,IAAI,IACtE;;GACJC,IAAS,kBAAC,OAAD;IAAK,WAAU;IAA2B,UAAAA;GAAY,CAAA,IAAI;EACjE;;AAET,CAAC"}
1
+ {"version":3,"file":"InlineAlert.js","names":["InlineAlert","props","Icon","tone","CheckmarkIcon","ErrorCircleIcon","cn","className","size","title","children","action"],"sources":["../../../src/components/InlineAlert/InlineAlert.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { CheckmarkIcon, ErrorCircleIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport './InlineAlert.css';\n\n/** Figma \"Type\": Info · Success · Warning · Error */\nexport type InlineAlertTone = 'info' | 'success' | 'warning' | 'error';\n\nexport interface InlineAlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Figma \"Type\". Sets the colours and icon, and the default role: `status` for info/success, `alert` for warning/error. */\n tone?: InlineAlertTone;\n /** Short heading in the tone's colour (Figma \"Title\"). */\n title?: ReactNode;\n /** Link or button at the end of the alert (Figma \"Action\"), e.g. `<button type=\"button\">Try again</button>`. */\n action?: ReactNode;\n /** The message (Figma \"Message\"). */\n children?: ReactNode;\n /**\n * `md` (default): the Figma component, 12px × 16px padding, the message as wide as the alert. `lg`: the alert as the\n * screens place it (Contact Support 2410:6422, Help Article 2404:6448) — 16px padding all round, and the message kept\n * to the component's 400px text column.\n */\n size?: 'md' | 'lg';\n}\n\n/** A message placed in the page flow, next to the content it is about. */\nexport const InlineAlert = /* @__PURE__ */ forwardRef<HTMLDivElement, InlineAlertProps>(function InlineAlert(\n { tone = 'info', title, action, size = 'md', className, children, ...props },\n ref,\n) {\n const Icon = tone === 'success' ? CheckmarkIcon : ErrorCircleIcon;\n return (\n <div ref={ref} className={cn('tm-inline-alert', className)} data-tone={tone} data-size={size} role={tone === 'warning' || tone === 'error' ? 'alert' : 'status'} {...props}>\n <Icon className=\"tm-inline-alert__icon\" size=\"md\" />\n <div className=\"tm-inline-alert__content\">\n {title ? <div className=\"tm-inline-alert__title\">{title}</div> : null}\n {children ? <div className=\"tm-inline-alert__message\">{children}</div> : null}\n </div>\n {action ? <div className=\"tm-inline-alert__action\">{action}</div> : null}\n </div>\n );\n});\n"],"mappings":";;;;;;;;AA0BA,IAAaA,IAA8B,kBAA6C,SACtF,EAAE,UAAO,QAAQ,UAAO,WAAQ,UAAO,MAAM,cAAW,aAAU,GAAGC,KACrE,GACA;CACA,IAAMC,IAAOC,MAAS,YAAYC,IAAgBC;CAClD,OACE,kBAAC,OAAD;EAAU;EAAK,WAAWC,EAAG,mBAAmBC,CAAS;EAAG,aAAWJ;EAAM,aAAWK;EAAM,MAAML,MAAS,aAAaA,MAAS,UAAU,UAAU;EAAU,GAAIF;EAArK,UAAA;GACE,kBAACC,GAAD;IAAM,WAAU;IAAwB,MAAK;GAAM,CAAA;GACnD,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACGO,IAAQ,kBAAC,OAAD;KAAK,WAAU;KAA0B,UAAAA;IAAW,CAAA,IAAI,MAChEC,IAAW,kBAAC,OAAD;KAAK,WAAU;KAA4B;IAAc,CAAA,IAAI,IACtE;;GACJC,IAAS,kBAAC,OAAD;IAAK,WAAU;IAA2B,UAAAA;GAAY,CAAA,IAAI;EACjE;;AAET,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../utils/cn.cjs"),t=require("../Logo/LogoArtwork.cjs"),n=require("../PartnerCarousel/autoplay.cjs"),r=require("./LogoAnimationArtwork.cjs"),i=require("./motion.cjs");;/* empty css */let a=require("react"),o=require("react/jsx-runtime");var s=`tm-logo-animation__`,c=`(prefers-reduced-motion: reduce)`,l=(0,a.forwardRef)(function({mode:l=`once`,size:u=160,delay:d=0,title:f,className:p,...m},h){let g=`tm-logo-animation-${(0,a.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`,_=f??(l===`loop`?`Loading`:`TravelMatch`),v=(0,a.useRef)(null),y=n.usePrefersReducedMotion(),b=n.useInView(v),x=n.usePageVisible(),S=(0,a.useRef)(null),C=(0,a.useRef)(null),w=(0,a.useRef)(0);(0,a.useEffect)(()=>{let e=v.current;if(!e)return;let t=t=>e.querySelector(`.${s}${t}`);return S.current={route:t(`route`),routeMask:t(`route-mask`),leg:t(`leg-mask`),routeCap:t(`route-cap`),legCap:t(`leg-cap`),dot:t(`dot`),parts:t(`parts`),final:t(`final`),trail:Array.from(e.querySelectorAll(`.${s}puff`)),plane:t(`plane`)},C.current=i.createLogoMotion(S.current,l,d),w.current=0,()=>{C.current=null}},[l,d]),(0,a.useEffect)(()=>{let e=S.current;if(!e)return;let t=C.current,n=y||typeof window.matchMedia==`function`&&window.matchMedia(c).matches;if(!t||n){i.showFinal(e),t&&l===`once`&&(w.current=t.end);return}if(w.current>=t.end){t.render(1e3);return}if(t.render(w.current),!b||!x)return;let r=0,a=null,o=e=>{a!==null&&(w.current+=Math.min(.25,Math.max(0,(e-a)/1e3))),a=e,w.current>=t.end?t.render(1e3):(t.render(w.current),r=requestAnimationFrame(o))};return r=requestAnimationFrame(o),()=>cancelAnimationFrame(r)},[l,d,y,b,x]);let T={fill:`none`,stroke:`#fff`,strokeWidth:5.6,strokeLinecap:`butt`},E=`url(#${g}-g)`;return(0,o.jsxs)(`svg`,{ref:e=>{v.current=e,typeof h==`function`?h(e):h&&(h.current=e)},xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 40 52`,width:u,height:Math.round(u*1.3*100)/100,overflow:`visible`,fill:`none`,className:e.cn(`tm-logo-animation`,p),"data-mode":l,role:_?`img`:void 0,"aria-label":_||void 0,"aria-hidden":!_||void 0,focusable:`false`,...m,children:[(0,o.jsxs)(`defs`,{children:[(0,o.jsxs)(`linearGradient`,{id:`${g}-g`,x1:`12.9902`,y1:`-1.17862`,x2:`28.2362`,y2:`52.8384`,gradientUnits:`userSpaceOnUse`,children:[(0,o.jsx)(`stop`,{stopColor:`#2136D2`}),(0,o.jsx)(`stop`,{offset:`1`,stopColor:`#21B2FF`})]}),(0,o.jsx)(`clipPath`,{id:`${g}-cm`,children:(0,o.jsx)(`path`,{clipRule:`evenodd`,d:`M-20 -20H60V80H-20Z ${r.LEG_POLY}`})}),(0,o.jsx)(`clipPath`,{id:`${g}-cl`,children:(0,o.jsx)(`path`,{d:r.LEG_POLY2})}),(0,o.jsxs)(`mask`,{id:`${g}-mm`,maskUnits:`userSpaceOnUse`,x:`-20`,y:`-20`,width:`80`,height:`100`,children:[(0,o.jsx)(`path`,{className:`${s}route-mask`,d:r.ROUTE_X,...T,strokeLinejoin:`round`,style:{opacity:0}}),(0,o.jsx)(`circle`,{className:`${s}route-cap`,r:`0`,fill:`#fff`}),(0,o.jsx)(`circle`,{className:`${s}dot`,cx:r.DOT[0],cy:r.DOT[1],r:l===`loop`?4.3:0,fill:`#fff`})]}),(0,o.jsxs)(`mask`,{id:`${g}-ml`,maskUnits:`userSpaceOnUse`,x:`-20`,y:`-20`,width:`80`,height:`100`,children:[(0,o.jsx)(`path`,{className:`${s}leg-mask`,d:r.LEG_D,...T,style:{opacity:0}}),(0,o.jsx)(`circle`,{className:`${s}leg-cap`,r:`0`,fill:`#fff`})]})]}),(0,o.jsxs)(`g`,{className:`${s}parts`,children:[(0,o.jsx)(`g`,{mask:`url(#${g}-mm)`,children:(0,o.jsx)(`path`,{d:r.PIN_D,fill:E,clipPath:`url(#${g}-cm)`})}),(0,o.jsx)(`g`,{mask:`url(#${g}-ml)`,children:(0,o.jsx)(`path`,{d:r.PIN_D,fill:E,clipPath:`url(#${g}-cl)`})})]}),(0,o.jsx)(`g`,{className:`${s}final`,style:{display:`none`},children:(0,o.jsx)(t.LogoMark,{gradientId:`${g}-mark`})}),(0,o.jsx)(`path`,{className:`${s}route`,d:r.ROUTE_D,fill:`none`,stroke:`none`}),(0,o.jsx)(`g`,{children:[0,1,2].map(e=>(0,o.jsx)(`circle`,{className:`${s}puff`,fill:E,style:{opacity:0}},e))}),(0,o.jsx)(`g`,{className:`${s}plane`,style:{opacity:0},children:(0,o.jsx)(`path`,{d:r.PLANE_D,fill:E})})]})});exports.LogoAnimation=l;
2
+ //# sourceMappingURL=LogoAnimation.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogoAnimation.cjs","names":["useId","useRef","usePrefersReducedMotion","useInView","usePageVisible","createLogoMotion","cn","LEG_POLY","LEG_POLY2","ROUTE_X","DOT","LEG_D","PIN_D","LogoMark","ROUTE_D","PLANE_D","require_cn","require_LogoArtwork","require_autoplay","require_LogoAnimationArtwork","require_motion","react","react_jsx_runtime","PART","REDUCED_MOTION","LogoAnimation","props","id","label","title","mode","rootRef","reduced","inView","pageVisible","elements","motion","clock","svg","q","part","delay","els","m","reducedNow","raf","last","tick","now","stroke","gradient","node","ref","size","className","i"],"sources":["../../../src/components/LogoAnimation/LogoAnimation.tsx"],"sourcesContent":["import { forwardRef, useEffect, useId, useRef, type SVGProps } from 'react';\nimport { cn } from '../../utils/cn';\nimport { LogoMark } from '../Logo/LogoArtwork';\nimport { useInView, usePageVisible, usePrefersReducedMotion } from '../PartnerCarousel/autoplay';\nimport { DOT, LEG_D, LEG_POLY, LEG_POLY2, PIN_D, PLANE_D, ROUTE_D, ROUTE_X } from './LogoAnimationArtwork';\nimport { createLogoMotion, showFinal, type LogoMotion, type LogoMotionElements, type LogoMotionMode } from './motion';\nimport './LogoAnimation.css';\n\n/** `once`: the intro — the plane draws the logo, lands and the logo stays. `loop`: the loader — it flies out, the line rewinds and it starts again. */\nexport type LogoAnimationMode = LogoMotionMode;\n\nexport interface LogoAnimationProps extends Omit<SVGProps<SVGSVGElement>, 'ref' | 'children' | 'width' | 'height' | 'viewBox' | 'mode'> {\n /** `once` (intro, holds the final logo) or `loop` (loader, repeats forever). Both play by themselves. */\n mode?: LogoAnimationMode;\n /** Width in px. The height follows the 40 × 52 mark: `size × 1.3`. */\n size?: number;\n /** Seconds to wait before the dot appears. */\n delay?: number;\n /**\n * Accessible name. Defaults to \"TravelMatch\" for `once` and \"Loading\" for `loop`; pass a translated string, or an\n * empty string when the animation is decorative (it is then hidden from assistive technology).\n */\n title?: string;\n}\n\nconst PART = 'tm-logo-animation__';\nconst REDUCED_MOTION = '(prefers-reduced-motion: reduce)';\n\n/**\n * The TravelMatch mark drawn by its paper plane: the dot appears, the plane takes off from it, draws the pin and grows\n * the lower-left branch, then lands in the exact logo pose (the `Logo` mark artwork). `once` holds the logo; `loop`\n * flies the plane out with a few puffs while the line rewinds into the dot, and starts again.\n *\n * - Plays by itself — there is no play or pause control. Frames stop while the tab is hidden or the logo is\n * off-screen and pick up where they were, so an intro below the fold plays when it is scrolled into view.\n * - `prefers-reduced-motion`: both modes show the still logo straight away (CSS does this from the first paint, before\n * hydration). The loader keeps its \"Loading\" name for assistive technology.\n * - Server rendering: the markup is the first frame (an empty, size-reserving box for `once`; the dot for `loop`), so\n * hydration continues from it without a flash. Paths are measured and frames run in effects only.\n */\nexport const LogoAnimation = /* @__PURE__ */ forwardRef<SVGSVGElement, LogoAnimationProps>(function LogoAnimation(\n { mode = 'once', size = 160, delay = 0, title, className, ...props },\n ref,\n) {\n // Masks, clip paths and gradients are referenced by id, so every instance needs its own.\n const id = `tm-logo-animation-${useId().replace(/[^a-zA-Z0-9_-]/g, '')}`;\n const label = title ?? (mode === 'loop' ? 'Loading' : 'TravelMatch');\n\n const rootRef = useRef<SVGSVGElement | null>(null);\n const reduced = usePrefersReducedMotion();\n const inView = useInView(rootRef);\n const pageVisible = usePageVisible();\n const elements = useRef<LogoMotionElements | null>(null);\n const motion = useRef<LogoMotion | null>(null);\n /** Animation time in seconds; kept while frames are paused (hidden tab, off-screen). */\n const clock = useRef(0);\n\n // Measure the paths and build the frame renderer; a new mode or delay starts from the beginning.\n useEffect(() => {\n const svg = rootRef.current;\n if (!svg) return;\n const q = <T extends Element>(part: string) => svg.querySelector(`.${PART}${part}`) as T;\n elements.current = {\n route: q('route'),\n routeMask: q('route-mask'),\n leg: q('leg-mask'),\n routeCap: q('route-cap'),\n legCap: q('leg-cap'),\n dot: q('dot'),\n parts: q('parts'),\n final: q('final'),\n trail: Array.from(svg.querySelectorAll<SVGCircleElement>(`.${PART}puff`)),\n plane: q('plane'),\n };\n motion.current = createLogoMotion(elements.current, mode, delay);\n clock.current = 0;\n return () => {\n motion.current = null;\n };\n }, [mode, delay]);\n\n // Run the frames.\n useEffect(() => {\n const els = elements.current;\n if (!els) return;\n const m = motion.current;\n // The hook answers `false` on the first render (server markup must match); ask directly so no frame runs at all.\n const reducedNow = reduced || (typeof window.matchMedia === 'function' && window.matchMedia(REDUCED_MOTION).matches);\n if (!m || reducedNow) {\n // Reduced motion, or a browser that cannot measure SVG paths: the still logo. A finished intro stays finished.\n showFinal(els);\n if (m && mode === 'once') clock.current = m.end;\n return;\n }\n if (clock.current >= m.end) {\n m.render(1e3);\n return;\n }\n m.render(clock.current);\n if (!inView || !pageVisible) return;\n\n let raf = 0;\n let last: number | null = null;\n const tick = (now: number) => {\n // A long gap (throttled tab) must not skip the animation ahead.\n if (last !== null) clock.current += Math.min(0.25, Math.max(0, (now - last) / 1000));\n last = now;\n if (clock.current >= m.end) {\n m.render(1e3);\n return;\n }\n m.render(clock.current);\n raf = requestAnimationFrame(tick);\n };\n raf = requestAnimationFrame(tick);\n return () => cancelAnimationFrame(raf);\n }, [mode, delay, reduced, inView, pageVisible]);\n\n const stroke = { fill: 'none', stroke: '#fff', strokeWidth: 5.6, strokeLinecap: 'butt' } as const;\n const gradient = `url(#${id}-g)`;\n\n return (\n <svg\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 40 52\"\n width={size}\n height={Math.round(size * 1.3 * 100) / 100}\n overflow=\"visible\"\n fill=\"none\"\n className={cn('tm-logo-animation', className)}\n data-mode={mode}\n role={label ? 'img' : undefined}\n aria-label={label || undefined}\n aria-hidden={label ? undefined : true}\n focusable=\"false\"\n {...props}\n >\n {/* The server markup is the first frame: lines and plane hidden, the dot shown only by the loader. */}\n <defs>\n {/* Same gradient as the Logo mark (#2136D2 → #21B2FF), so the landing swap is seamless. */}\n <linearGradient id={`${id}-g`} x1=\"12.9902\" y1=\"-1.17862\" x2=\"28.2362\" y2=\"52.8384\" gradientUnits=\"userSpaceOnUse\">\n <stop stopColor=\"#2136D2\" />\n <stop offset=\"1\" stopColor=\"#21B2FF\" />\n </linearGradient>\n <clipPath id={`${id}-cm`}>\n <path clipRule=\"evenodd\" d={`M-20 -20H60V80H-20Z ${LEG_POLY}`} />\n </clipPath>\n <clipPath id={`${id}-cl`}>\n <path d={LEG_POLY2} />\n </clipPath>\n <mask id={`${id}-mm`} maskUnits=\"userSpaceOnUse\" x=\"-20\" y=\"-20\" width=\"80\" height=\"100\">\n <path className={`${PART}route-mask`} d={ROUTE_X} {...stroke} strokeLinejoin=\"round\" style={{ opacity: 0 }} />\n <circle className={`${PART}route-cap`} r=\"0\" fill=\"#fff\" />\n <circle className={`${PART}dot`} cx={DOT[0]} cy={DOT[1]} r={mode === 'loop' ? 4.3 : 0} fill=\"#fff\" />\n </mask>\n <mask id={`${id}-ml`} maskUnits=\"userSpaceOnUse\" x=\"-20\" y=\"-20\" width=\"80\" height=\"100\">\n <path className={`${PART}leg-mask`} d={LEG_D} {...stroke} style={{ opacity: 0 }} />\n <circle className={`${PART}leg-cap`} r=\"0\" fill=\"#fff\" />\n </mask>\n </defs>\n <g className={`${PART}parts`}>\n <g mask={`url(#${id}-mm)`}>\n <path d={PIN_D} fill={gradient} clipPath={`url(#${id}-cm)`} />\n </g>\n <g mask={`url(#${id}-ml)`}>\n <path d={PIN_D} fill={gradient} clipPath={`url(#${id}-cl)`} />\n </g>\n </g>\n <g className={`${PART}final`} style={{ display: 'none' }}>\n <LogoMark gradientId={`${id}-mark`} />\n </g>\n <path className={`${PART}route`} d={ROUTE_D} fill=\"none\" stroke=\"none\" />\n <g>\n {[0, 1, 2].map((i) => (\n <circle key={i} className={`${PART}puff`} fill={gradient} style={{ opacity: 0 }} />\n ))}\n </g>\n <g className={`${PART}plane`} style={{ opacity: 0 }}>\n <path d={PLANE_D} fill={gradient} />\n </g>\n </svg>\n );\n});\n"],"mappings":"A,gSAyBA,IAAMuB,EAAO,sBACPC,EAAiB,mCAcVC,GAAgC,EAAAJ,EAAA,WAAA,CAA8C,SACzF,CAAE,OAAO,OAAQ,OAAO,IAAK,QAAQ,EAAG,QAAO,YAAW,GAAGK,GAC7D,EACA,CAEA,IAAMC,EAAK,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