@travel-match/ui 0.4.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 (141) 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/InlineAlert/InlineAlert.cjs +1 -1
  26. package/dist/components/InlineAlert/InlineAlert.cjs.map +1 -1
  27. package/dist/components/InlineAlert/InlineAlert.js +9 -8
  28. package/dist/components/InlineAlert/InlineAlert.js.map +1 -1
  29. package/dist/components/NewRequestOverlay/NewRequestOverlay.cjs +1 -1
  30. package/dist/components/NewRequestOverlay/NewRequestOverlay.cjs.map +1 -1
  31. package/dist/components/NewRequestOverlay/NewRequestOverlay.js +67 -48
  32. package/dist/components/NewRequestOverlay/NewRequestOverlay.js.map +1 -1
  33. package/dist/components/NotificationsDropdown/NotificationsMenu.cjs +1 -1
  34. package/dist/components/NotificationsDropdown/NotificationsMenu.cjs.map +1 -1
  35. package/dist/components/NotificationsDropdown/NotificationsMenu.js +1 -1
  36. package/dist/components/NotificationsDropdown/NotificationsMenu.js.map +1 -1
  37. package/dist/components/PartnerCarousel/PartnerCarousel.cjs.map +1 -1
  38. package/dist/components/PartnerCarousel/PartnerCarousel.js.map +1 -1
  39. package/dist/components/PhoneInput/PhoneInput.cjs +1 -1
  40. package/dist/components/PhoneInput/PhoneInput.cjs.map +1 -1
  41. package/dist/components/PhoneInput/PhoneInput.js +8 -5
  42. package/dist/components/PhoneInput/PhoneInput.js.map +1 -1
  43. package/dist/components/PopularQuestions/PopularQuestions.cjs +1 -1
  44. package/dist/components/PopularQuestions/PopularQuestions.cjs.map +1 -1
  45. package/dist/components/PopularQuestions/PopularQuestions.js +22 -21
  46. package/dist/components/PopularQuestions/PopularQuestions.js.map +1 -1
  47. package/dist/components/RegionMap/RegionMap.cjs +2 -0
  48. package/dist/components/RegionMap/RegionMap.cjs.map +1 -0
  49. package/dist/components/RegionMap/RegionMap.js +55 -0
  50. package/dist/components/RegionMap/RegionMap.js.map +1 -0
  51. package/dist/components/RegionMap/mapPaths.cjs +2 -0
  52. package/dist/components/RegionMap/mapPaths.cjs.map +1 -0
  53. package/dist/components/RegionMap/mapPaths.js +86 -0
  54. package/dist/components/RegionMap/mapPaths.js.map +1 -0
  55. package/dist/components/RequestSearch/RequestSearch.cjs +2 -0
  56. package/dist/components/RequestSearch/RequestSearch.cjs.map +1 -0
  57. package/dist/components/RequestSearch/RequestSearch.js +36 -0
  58. package/dist/components/RequestSearch/RequestSearch.js.map +1 -0
  59. package/dist/components/RequestSummary/RequestSummary.cjs +1 -1
  60. package/dist/components/RequestSummary/RequestSummary.cjs.map +1 -1
  61. package/dist/components/RequestSummary/RequestSummary.js +31 -32
  62. package/dist/components/RequestSummary/RequestSummary.js.map +1 -1
  63. package/dist/components/RequestTypeOption/RequestTypeOption.cjs +2 -0
  64. package/dist/components/RequestTypeOption/RequestTypeOption.cjs.map +1 -0
  65. package/dist/components/RequestTypeOption/RequestTypeOption.js +52 -0
  66. package/dist/components/RequestTypeOption/RequestTypeOption.js.map +1 -0
  67. package/dist/components/Select/Select.cjs +1 -1
  68. package/dist/components/Select/Select.cjs.map +1 -1
  69. package/dist/components/Select/Select.js +127 -121
  70. package/dist/components/Select/Select.js.map +1 -1
  71. package/dist/components/ShowMore/ShowMore.cjs +2 -0
  72. package/dist/components/ShowMore/ShowMore.cjs.map +1 -0
  73. package/dist/components/ShowMore/ShowMore.js +34 -0
  74. package/dist/components/ShowMore/ShowMore.js.map +1 -0
  75. package/dist/components/SiteHeader/SiteHeader.cjs.map +1 -1
  76. package/dist/components/SiteHeader/SiteHeader.js.map +1 -1
  77. package/dist/components/SortSelect/SortSelect.cjs +2 -0
  78. package/dist/components/SortSelect/SortSelect.cjs.map +1 -0
  79. package/dist/components/SortSelect/SortSelect.js +18 -0
  80. package/dist/components/SortSelect/SortSelect.js.map +1 -0
  81. package/dist/components/StatusFilter/StatusFilter.cjs +2 -0
  82. package/dist/components/StatusFilter/StatusFilter.cjs.map +1 -0
  83. package/dist/components/StatusFilter/StatusFilter.js +37 -0
  84. package/dist/components/StatusFilter/StatusFilter.js.map +1 -0
  85. package/dist/components/StatusTag/StatusTag.cjs.map +1 -1
  86. package/dist/components/StatusTag/StatusTag.js.map +1 -1
  87. package/dist/components/StepCard/StepCard.cjs +1 -1
  88. package/dist/components/StepCard/StepCard.cjs.map +1 -1
  89. package/dist/components/StepCard/StepCard.js +9 -6
  90. package/dist/components/StepCard/StepCard.js.map +1 -1
  91. package/dist/components/StepProgress/StepProgress.cjs +2 -0
  92. package/dist/components/StepProgress/StepProgress.cjs.map +1 -0
  93. package/dist/components/StepProgress/StepProgress.js +43 -0
  94. package/dist/components/StepProgress/StepProgress.js.map +1 -0
  95. package/dist/components/TelegramConnect/TelegramConnect.cjs +2 -0
  96. package/dist/components/TelegramConnect/TelegramConnect.cjs.map +1 -0
  97. package/dist/components/TelegramConnect/TelegramConnect.js +57 -0
  98. package/dist/components/TelegramConnect/TelegramConnect.js.map +1 -0
  99. package/dist/components/TextInput/TextInput.cjs +1 -1
  100. package/dist/components/TextInput/TextInput.cjs.map +1 -1
  101. package/dist/components/TextInput/TextInput.js +21 -19
  102. package/dist/components/TextInput/TextInput.js.map +1 -1
  103. package/dist/components/Textarea/Textarea.cjs +1 -1
  104. package/dist/components/Textarea/Textarea.cjs.map +1 -1
  105. package/dist/components/Textarea/Textarea.js +18 -16
  106. package/dist/components/Textarea/Textarea.js.map +1 -1
  107. package/dist/components/Toast/Toast.cjs +2 -0
  108. package/dist/components/Toast/Toast.cjs.map +1 -0
  109. package/dist/components/Toast/Toast.js +57 -0
  110. package/dist/components/Toast/Toast.js.map +1 -0
  111. package/dist/icons/generated/CheckmarkIcon.cjs +1 -1
  112. package/dist/icons/generated/CheckmarkIcon.cjs.map +1 -1
  113. package/dist/icons/generated/CheckmarkIcon.js +19 -2
  114. package/dist/icons/generated/CheckmarkIcon.js.map +1 -1
  115. package/dist/icons/generated/InfoIcon.cjs +2 -0
  116. package/dist/icons/generated/InfoIcon.cjs.map +1 -0
  117. package/dist/icons/generated/InfoIcon.js +35 -0
  118. package/dist/icons/generated/InfoIcon.js.map +1 -0
  119. package/dist/icons/generated/SendIcon.cjs +2 -0
  120. package/dist/icons/generated/SendIcon.cjs.map +1 -0
  121. package/dist/icons/generated/SendIcon.js +23 -0
  122. package/dist/icons/generated/SendIcon.js.map +1 -0
  123. package/dist/icons/generated/index.cjs +1 -1
  124. package/dist/icons/generated/index.cjs.map +1 -1
  125. package/dist/icons/generated/index.js +71 -67
  126. package/dist/icons/generated/index.js.map +1 -1
  127. package/dist/index.cjs +1 -1
  128. package/dist/index.d.cts +618 -32
  129. package/dist/index.d.ts +618 -32
  130. package/dist/index.js +146 -135
  131. package/dist/styles.css +1 -1
  132. package/dist/tailwind.css +0 -6
  133. package/dist/tokens/generated.cjs +1 -1
  134. package/dist/tokens/generated.cjs.map +1 -1
  135. package/dist/tokens/generated.js +1 -7
  136. package/dist/tokens/generated.js.map +1 -1
  137. package/dist/tokens.css +0 -12
  138. package/dist/tokens.d.cts +2 -26
  139. package/dist/tokens.d.ts +2 -26
  140. package/dist/tokens.json +1 -7
  141. 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,EA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,EAAUC,GAASC,EACzB,OACE,EAAAnB,EAAA,KAAA,CAAC,MAAD,CAAU,MAAK,UAAWR,EAAAA,GAAG,gBAAiBW,CAAS,EAAG,YAAWC,EAAM,GAAIF,EAA/E,SAAA,CACGkB,GACC,EAAApB,EAAA,IAAA,CAACC,EAAD,CAAO,GAAIoB,EAAI,QAAS,QAASA,EAAI,UAAiB,OAAgB,WAAoB,WACvF,SAAAD,CACI,CAAA,EACL,KACHf,EACAY,GACC,EAAAjB,EAAA,IAAA,CAACQ,EAAD,CAAc,GAAIa,EAAI,UAAW,KAAMH,EAAQ,QAAU,UAAiB,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}>\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,OAAO,KAAM,OAAOU,IAAS,UAAW,YAAW,WAAU,GAAGP,GACpF,EACA,CACA,OACE,EAAAF,EAAA,KAAA,CAAC,IAAD,CAAQ,MAAK,UAAWR,EAAAA,GAAG,mBAAoBW,CAAS,EAAG,YAAWM,EAAM,YAAWL,EAAM,GAAIF,EAAjG,SAAA,CAEGQ,EAAOD,IAAS,WAAY,EAAAT,EAAA,IAA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
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;IAAM,WAAU;IAAqB,eAAY;IAAO,UAAA;GAElD,CAAA,IACJ;GACHC,IAAW,kBAAC,QAAD;IAAM,WAAU;IAAsB,UAAA,OAAOA,KAAa,WAAWA,IAAW;GAAmB,CAAA,IAAI;EAC9G;;AAEX,CAAC,GAiBYC,IAA+B,kBAAoD,SAC9F,EAAE,UAAO,WAAW,UAAO,MAAM,UAAOC,MAAS,WAAW,cAAW,aAAU,GAAGR,KACpF,GACA;CACA,OACE,kBAAC,KAAD;EAAQ;EAAK,WAAWC,EAAG,oBAAoBC,CAAS;EAAG,aAAWM;EAAM,aAAWL;EAAM,GAAIH;EAAjG,UAAA,CAEGS,IAA4BC,EAArBF,MAAS,YAAaG,IAAuDC,GAAxD,EAAe,MAAMT,MAAS,OAAO,OAAO,KAAO,CAAyD,IAAI,MAC7I,kBAAC,QAAD,EAAO,YAAe,CAAA,CACrB;;AAEP,CAAC;AA2BD,SAAgBU,EAAY,GAAwB,GAA+B;CACjF,IAAMC,IAAYC,EAAM,GAClBC,IAAYC,KAAM,MAAMH;CAC9B,OAAO;EAAE;EAAW,SAAS,GAAGE,EAAU;EAAS,WAAWE,IAAa,GAAGF,EAAU,YAAY,KAAA;CAAU;AAChH;AAcA,IAAaG,IAA4B,kBAAiD,SACxF,EAAE,QAAK,UAAO,eAAY,UAAO,aAAU,aAAU,UAAO,MAAM,eAAY,cAAW,aAAU,GAAGnB,KACtG,GACA;CACA,IAAMoB,IAAUC,KAASC;CACzB,OACE,kBAAC,OAAD;EAAU;EAAK,WAAWrB,EAAG,iBAAiBC,CAAS;EAAG,aAAWC;EAAM,GAAIH;EAA/E,UAAA;GACGuB,IACC,kBAACxB,GAAD;IAAO,IAAIyB,EAAI;IAAS,SAASA,EAAI;IAAiB;IAAgB;IAAoB;IACvF,UAAAD;GACI,CAAA,IACL;GACHnB;GACAgB,IACC,kBAACb,GAAD;IAAc,IAAIiB,EAAI;IAAW,MAAMH,IAAQ,UAAU;IAAiB;IAAM,MAAMA,IAAQ,KAAOI;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,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;IAAM,WAAU;IAAqB,eAAY;IAAO,UAAA;GAElD,CAAA,IACJ;GACHC,IAAW,kBAAC,QAAD;IAAM,WAAU;IAAsB,UAAA,OAAOA,KAAa,WAAWA,IAAW;GAAmB,CAAA,IAAI;EAC9G;;AAEX,CAAC,GAiBYC,IAA+B,kBAAoD,SAC9F,EAAE,UAAO,WAAW,UAAO,MAAM,UAAOC,MAAS,WAAW,cAAW,aAAU,GAAGR,KACpF,GACA;CACA,OACE,kBAAC,KAAD;EAAQ;EAAK,WAAWC,EAAG,oBAAoBC,CAAS;EAAG,aAAWM;EAAM,aAAWL;EAAM,GAAIH;EAAjG,UAAA,CAEGS,IAA4BC,EAArBF,MAAS,YAAaG,IAAuDC,GAAxD,EAAe,MAAMT,MAAS,OAAO,OAAO,KAAO,CAAyD,IAAI,MAC7I,kBAAC,QAAD,EAAO,YAAe,CAAA,CACrB;;AAEP,CAAC;AAyCD,SAAgBU,EAAY,GAAwB,GAA+B;CACjF,IAAMC,IAAYC,EAAM,GAClBC,IAAYC,KAAM,MAAMH;CAC9B,OAAO;EAAE;EAAW,SAAS,GAAGE,EAAU;EAAS,WAAWE,IAAa,GAAGF,EAAU,YAAY,KAAA;CAAU;AAChH;AAiBA,IAAaG,IAA4B,kBAAiD,SACxF,EAAE,QAAK,UAAO,eAAY,UAAO,aAAU,aAAU,UAAO,MAAM,eAAY,eAAY,aAAU,cAAW,aAAU,GAAGnB,KAC5H,GACA;CACA,IAAMoB,IAAUC,KAASC;CACzB,OACE,kBAAC,OAAD;EACO;EACL,WAAWrB,EAAG,iBAAiBC,CAAS;EACxC,aAAWC;EACX,oBAAkBoB,MAAe,YAAY,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("../../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"}
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../icons/generated/CheckmarkIcon.cjs"),t=require("../../icons/generated/NextArrowIcon.cjs"),n=require("../../utils/cn.cjs"),r=require("../Dialog/Dialog.cjs");;/* empty css */let i=require("react"),a=require("react/jsx-runtime"),o=require("@radix-ui/react-slot");var s=(0,i.forwardRef)(function({title:r,description:s,icon:c,imageSrc:l,imageAlt:u=``,image:d,features:f,cta:p,href:m,asChild:h=!1,disabled:g,className:_,children:v,...y},b){let x=(0,i.useId)(),S=`${x}-title`,C=`${x}-description`,w=`${x}-features`,T=!!(f&&f.length>0),E=d??(l?(0,a.jsx)(`img`,{src:l,alt:u,loading:`lazy`,decoding:`async`}):null),D=(0,a.jsxs)(a.Fragment,{children:[E?(0,a.jsx)(`span`,{className:`tm-new-request-option__media`,children:E}):null,(0,a.jsxs)(`span`,{className:`tm-new-request-option__content`,children:[c?(0,a.jsx)(`span`,{className:`tm-new-request-option__icon`,"data-tm-icon-size":`md`,"aria-hidden":`true`,children:c}):null,(0,a.jsxs)(`span`,{className:`tm-new-request-option__text`,children:[(0,a.jsx)(`span`,{id:S,className:`tm-new-request-option__title`,children:r}),s?(0,a.jsx)(`span`,{id:C,className:`tm-new-request-option__description`,children:s}):null]}),T?(0,a.jsx)(`span`,{id:w,className:`tm-new-request-option__features`,children:f.map((t,n)=>(0,a.jsxs)(`span`,{className:`tm-new-request-option__feature`,children:[(0,a.jsx)(e.CheckmarkIcon,{size:`sm`}),(0,a.jsx)(`span`,{children:t})]},n))}):null,p?(0,a.jsxs)(`span`,{className:`tm-new-request-option__cta`,children:[p,(0,a.jsx)(t.NextArrowIcon,{size:`sm`})]}):null]})]}),O={ref:b,className:n.cn(`tm-new-request-option`,_),"aria-labelledby":s?`${S} ${C}`:S,"aria-describedby":T?w:void 0,...y};return h?(0,a.jsx)(o.Slot,{"aria-disabled":g||void 0,...O,children:(0,i.isValidElement)(v)?(0,i.cloneElement)(v,void 0,D):v}):m===void 0?(0,a.jsx)(`button`,{type:`button`,disabled:g,...O,children:D}):(0,a.jsx)(`a`,{href:g?void 0:m,"aria-disabled":g||void 0,...O,children:D})}),c=(0,i.forwardRef)(function({options:e=[],onSelect:t,closeOnSelect:o=!0,footer:c,children:l,open:u,defaultOpen:d=!1,onOpenChange:f,mobilePlacement:p=`fullscreen`,className:m,...h},g){let[_,v]=(0,i.useState)(d),y=u??_,b=e=>{u===void 0&&v(e),f?.(e)},x=e=>n=>{t?.(e),o&&b(!1)};return(0,a.jsx)(r.Dialog,{ref:g,size:`lg`,className:n.cn(`tm-new-request-overlay`,m),open:y,onOpenChange:b,mobilePlacement:p,...h,children:(0,a.jsxs)(`div`,{className:`tm-new-request-overlay__content`,children:[l??(e.length>0?(0,a.jsx)(`ul`,{className:`tm-new-request-overlay__options`,role:`list`,children:e.map(({id:e,...t})=>(0,a.jsx)(`li`,{className:`tm-new-request-overlay__option`,children:(0,a.jsx)(s,{...t,"data-option":e,onClick:x(e)})},e))}):null),c?(0,a.jsx)(`div`,{className:`tm-new-request-overlay__footer`,children:c}):null]})})});exports.NewRequestOptionCard=s,exports.NewRequestOverlay=c;
1
+ "use client";const e=require("../../icons/generated/CheckmarkIcon.cjs"),t=require("../../icons/generated/NextArrowIcon.cjs"),n=require("../../utils/cn.cjs"),r=require("../Dialog/Dialog.cjs"),i=require("../RequestTypeOption/RequestTypeOption.cjs");;/* empty css */let a=require("react"),o=require("react/jsx-runtime"),s=require("@radix-ui/react-slot");var c=(0,a.forwardRef)(function({title:r,description:i,icon:c,imageSrc:l,imageAlt:u=``,image:d,features:f,cta:p,href:m,asChild:h=!1,disabled:g,className:_,children:v,...y},b){let x=(0,a.useId)(),S=`${x}-title`,C=`${x}-description`,w=`${x}-features`,T=!!(f&&f.length>0),E=d??(l?(0,o.jsx)(`img`,{src:l,alt:u,loading:`lazy`,decoding:`async`}):null),D=(0,o.jsxs)(o.Fragment,{children:[E?(0,o.jsx)(`span`,{className:`tm-new-request-option__media`,children:E}):null,(0,o.jsxs)(`span`,{className:`tm-new-request-option__content`,children:[c?(0,o.jsx)(`span`,{className:`tm-new-request-option__icon`,"data-tm-icon-size":`md`,"aria-hidden":`true`,children:c}):null,(0,o.jsxs)(`span`,{className:`tm-new-request-option__text`,children:[(0,o.jsx)(`span`,{id:S,className:`tm-new-request-option__title`,children:r}),i?(0,o.jsx)(`span`,{id:C,className:`tm-new-request-option__description`,children:i}):null]}),T?(0,o.jsx)(`span`,{id:w,className:`tm-new-request-option__features`,children:f.map((t,n)=>(0,o.jsxs)(`span`,{className:`tm-new-request-option__feature`,children:[(0,o.jsx)(e.CheckmarkIcon,{size:`sm`}),(0,o.jsx)(`span`,{children:t})]},n))}):null,p?(0,o.jsxs)(`span`,{className:`tm-new-request-option__cta`,children:[p,(0,o.jsx)(t.NextArrowIcon,{size:`sm`})]}):null]})]}),O={ref:b,className:n.cn(`tm-new-request-option`,_),"aria-labelledby":i?`${S} ${C}`:S,"aria-describedby":T?w:void 0,...y};return h?(0,o.jsx)(s.Slot,{"aria-disabled":g||void 0,...O,children:(0,a.isValidElement)(v)?(0,a.cloneElement)(v,void 0,D):v}):m===void 0?(0,o.jsx)(`button`,{type:`button`,disabled:g,...O,children:D}):(0,o.jsx)(`a`,{href:g?void 0:m,"aria-disabled":g||void 0,...O,children:D})}),l=(0,a.forwardRef)(function({variant:e=`list`,options:t=[],onSelect:s,closeOnSelect:l=!0,footer:u,children:d,open:f,defaultOpen:p=!1,onOpenChange:m,mobilePlacement:h=`fullscreen`,className:g,..._},v){let[y,b]=(0,a.useState)(p),x=f??y,S=e=>{f===void 0&&b(e),m?.(e)},C=e=>t=>{s?.(e),l&&S(!1)};return(0,o.jsx)(r.Dialog,{ref:v,size:e===`cards`?`lg`:`md`,className:n.cn(`tm-new-request-overlay`,g),"data-variant":e,open:x,onOpenChange:S,mobilePlacement:h,..._,children:(0,o.jsxs)(`div`,{className:`tm-new-request-overlay__content`,children:[d??(t.length>0?(0,o.jsx)(`ul`,{className:`tm-new-request-overlay__options`,role:`list`,children:t.map(({id:t,title:n,description:r,icon:a,href:s,disabled:l,imageSrc:u,imageAlt:d,image:f,features:p,cta:m})=>(0,o.jsx)(`li`,{className:`tm-new-request-overlay__option`,children:e===`cards`?(0,o.jsx)(c,{title:n,description:r,icon:a,href:s,disabled:l,imageSrc:u,imageAlt:d,image:f,features:p,cta:m,"data-option":t,onClick:C(t)}):(0,o.jsx)(i.RequestTypeOption,{title:n,description:r,icon:a,href:s,disabled:l,"data-option":t,onClick:C(t)})},t))}):null),u?(0,o.jsx)(`div`,{className:`tm-new-request-overlay__footer`,children:u}):null]})})});exports.NewRequestOptionCard=c,exports.NewRequestOverlay=l;
2
2
  //# sourceMappingURL=NewRequestOverlay.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"NewRequestOverlay.cjs","names":["useId","_Fragment","CheckmarkIcon","NextArrowIcon","cn","Slot","isValidElement","cloneElement","useState","Dialog","require_CheckmarkIcon","require_NextArrowIcon","require_cn","require_Dialog","react","react_jsx_runtime","_radix_ui_react_slot","NewRequestOptionCard","props","id","titleId","descriptionId","featuresId","hasFeatures","features","media","image","imageSrc","imageAlt","content","icon","title","description","feature","index","cta","shared","className","asChild","disabled","children","href","NewRequestOverlay","openProp","uncontrolledOpen","setUncontrolledOpen","defaultOpen","open","setOpen","next","onOpenChange","select","onSelect","closeOnSelect","options","option","footer"],"sources":["../../../src/components/NewRequestOverlay/NewRequestOverlay.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport {\n cloneElement,\n forwardRef,\n isValidElement,\n useId,\n useState,\n type ButtonHTMLAttributes,\n type ElementType,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { CheckmarkIcon, NextArrowIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport { Dialog, type DialogProps } from '../Dialog';\nimport './NewRequestOverlay.css';\n\ninterface NewRequestOptionContent {\n /** Name of the request type (Figma \"Travel Package\"). With the description it forms the card's accessible name. */\n title: ReactNode;\n /** One line under the title (Figma \"Plan a trip in Armenia or abroad.\"). */\n description?: ReactNode;\n /** One icon from `@travel-match/ui` for the 44px tile (Figma `roadmap`, `plane`). */\n icon?: ReactNode;\n /** Photo at the top of the card; it is cropped to fill a 220px band (140px in narrow layouts). */\n imageSrc?: string;\n /** Alternative text of the photo. The photos are decorative by default. */\n imageAlt?: string;\n /** Custom image element used instead of `imageSrc`, e.g. `next/image`. */\n image?: ReactNode;\n /** What the request type covers (Figma \"Capabilities\"); each entry gets a check mark. */\n features?: ReactNode[];\n /** Call to action at the bottom of the card (Figma \"Start a Travel Package\"); an arrow is added after it. */\n cta?: ReactNode;\n /** Renders the card as a link to this URL instead of a button. */\n href?: string;\n}\n\nexport interface NewRequestOptionCardProps extends NewRequestOptionContent, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {\n /** Renders the single child element (e.g. a router `<Link href=\"…\" />`) as the card instead of a `<button>`. */\n asChild?: boolean;\n}\n\n/**\n * One choice of the New Request Overlay (Figma \"Option / Travel Package\"): the whole card is one button or link,\n * named by its title and description; the feature list is its description for assistive technology.\n */\nexport const NewRequestOptionCard = /* @__PURE__ */ forwardRef<HTMLButtonElement, NewRequestOptionCardProps>(function NewRequestOptionCard(\n { title, description, icon, imageSrc, imageAlt = '', image, features, cta, href, asChild = false, disabled, className, children, ...props },\n ref,\n) {\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n const featuresId = `${id}-features`;\n const hasFeatures = Boolean(features && features.length > 0);\n const media = image ?? (imageSrc ? <img src={imageSrc} alt={imageAlt} loading=\"lazy\" decoding=\"async\" /> : null);\n\n // Only phrasing content inside: the card is a <button> or an <a>.\n const content = (\n <>\n {media ? <span className=\"tm-new-request-option__media\">{media}</span> : null}\n <span className=\"tm-new-request-option__content\">\n {icon ? (\n <span className=\"tm-new-request-option__icon\" data-tm-icon-size=\"md\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <span className=\"tm-new-request-option__text\">\n <span id={titleId} className=\"tm-new-request-option__title\">\n {title}\n </span>\n {description ? (\n <span id={descriptionId} className=\"tm-new-request-option__description\">\n {description}\n </span>\n ) : null}\n </span>\n {hasFeatures ? (\n <span id={featuresId} className=\"tm-new-request-option__features\">\n {features!.map((feature, index) => (\n <span key={index} className=\"tm-new-request-option__feature\">\n <CheckmarkIcon size=\"sm\" />\n <span>{feature}</span>\n </span>\n ))}\n </span>\n ) : null}\n {cta ? (\n <span className=\"tm-new-request-option__cta\">\n {cta}\n <NextArrowIcon size=\"sm\" />\n </span>\n ) : null}\n </span>\n </>\n );\n\n const shared = {\n ref,\n className: cn('tm-new-request-option', className),\n 'aria-labelledby': description ? `${titleId} ${descriptionId}` : titleId,\n 'aria-describedby': hasFeatures ? featuresId : undefined,\n ...props,\n };\n\n if (asChild) {\n return (\n <Slot aria-disabled={disabled || undefined} {...shared}>\n {isValidElement(children) ? cloneElement(children as ReactElement<{ children?: ReactNode }>, undefined, content) : children}\n </Slot>\n );\n }\n if (href !== undefined) {\n const Anchor = 'a' as ElementType;\n // A link cannot be `disabled`: without `href` it is not focusable or clickable, and says so to assistive technology.\n return (\n <Anchor href={disabled ? undefined : href} aria-disabled={disabled || undefined} {...shared}>\n {content}\n </Anchor>\n );\n }\n return (\n <button type=\"button\" disabled={disabled} {...shared}>\n {content}\n </button>\n );\n});\n\nexport interface NewRequestOverlayOption extends NewRequestOptionContent {\n /** Identifies the option in `onSelect`. */\n id: string;\n /** Disables the card (buttons only). */\n disabled?: boolean;\n}\n\nexport interface NewRequestOverlayProps extends Omit<DialogProps, 'size' | 'role' | 'footer' | 'children' | 'onSelect'> {\n /** The request types to choose from (Figma \"Options\"): any number, laid out in equal columns that wrap. */\n options?: NewRequestOverlayOption[];\n /** Called with the option's `id` when a card is activated. */\n onSelect?: (id: string) => void;\n /** `false` keeps the overlay open after a choice (close it yourself through `open`). */\n closeOnSelect?: boolean;\n /** Line under the options (Figma \"Not sure which one? See how TravelMatch works\"); links inside it are styled. */\n footer?: ReactNode;\n /**\n * Replaces the option cards: compose `NewRequestOptionCard` yourself (e.g. `asChild` with router links)\n * or render the next step of the flow here.\n */\n children?: ReactNode;\n}\n\n/**\n * The overlay that starts a new request by choosing its type (Figma component set \"New Request Overlay\").\n * A large centered dialog; below 768px it covers the screen and the cards stack.\n */\nexport const NewRequestOverlay = /* @__PURE__ */ forwardRef<HTMLDivElement, NewRequestOverlayProps>(function NewRequestOverlay(\n { options = [], onSelect, closeOnSelect = true, footer, children, open: openProp, defaultOpen = false, onOpenChange, mobilePlacement = 'fullscreen', className, ...props },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const open = openProp ?? uncontrolledOpen;\n const setOpen = (next: boolean) => {\n if (openProp === undefined) setUncontrolledOpen(next);\n onOpenChange?.(next);\n };\n\n const select = (id: string) => (_event: MouseEvent) => {\n onSelect?.(id);\n if (closeOnSelect) setOpen(false);\n };\n\n return (\n <Dialog ref={ref} size=\"lg\" className={cn('tm-new-request-overlay', className)} open={open} onOpenChange={setOpen} mobilePlacement={mobilePlacement} {...props}>\n <div className=\"tm-new-request-overlay__content\">\n {children ??\n (options.length > 0 ? (\n <ul className=\"tm-new-request-overlay__options\" role=\"list\">\n {options.map(({ id, ...option }) => (\n <li key={id} className=\"tm-new-request-overlay__option\">\n <NewRequestOptionCard {...option} data-option={id} onClick={select(id)} />\n </li>\n ))}\n </ul>\n ) : null)}\n {footer ? <div className=\"tm-new-request-overlay__footer\">{footer}</div> : null}\n </div>\n </Dialog>\n );\n});\n"],"mappings":"A,8TAgDA,IAAaiB,GAAuC,EAAAH,EAAA,WAAA,CAAyD,SAC3G,CAAE,QAAO,cAAa,OAAM,WAAU,WAAW,GAAI,QAAO,WAAU,MAAK,OAAM,UAAU,GAAO,WAAU,YAAW,WAAU,GAAGI,GACpI,EACA,CACA,IAAMC,GAAA,EAAKnB,EAAAA,MAAAA,CAAM,EACXoB,EAAU,GAAGD,EAAG,QAChBE,EAAgB,GAAGF,EAAG,cACtBG,EAAa,GAAGH,EAAG,WACnBI,EAAc,GAAQC,GAAYA,EAAS,OAAS,GACpDC,EAAQC,IAAUC,GAAW,EAAAZ,EAAA,IAAA,CAAC,MAAD,CAAK,IAAKY,EAAU,IAAKC,EAAU,QAAQ,OAAO,SAAS,OAAS,CAAA,EAAI,MAGrGC,GACJ,EAAAd,EAAA,KAAA,CAAAd,EAAAA,SAAA,CAAA,SAAA,CACGwB,GAAQ,EAAAV,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,+BAAgC,SAAAU,CAAY,CAAA,EAAI,MACzE,EAAAV,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,iCAAhB,SAAA,CACGe,GACC,EAAAf,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,8BAA8B,oBAAkB,KAAK,cA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OhC,CAAE,CAAI,CAAA,CACvE,EAFKA,CAEL,CACL,CACC,CAAA,EACF,MACLqC,GAAS,EAAAzC,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,iCAAkC,SAAAyC,CAAY,CAAA,EAAI,IACxE,C,EACC,CAAA,CAEZ,CAAC,E"}
1
+ {"version":3,"file":"NewRequestOverlay.cjs","names":["useId","_Fragment","CheckmarkIcon","NextArrowIcon","cn","Slot","isValidElement","cloneElement","useState","Dialog","RequestTypeOption","require_CheckmarkIcon","require_NextArrowIcon","require_cn","require_Dialog","require_RequestTypeOption","react","react_jsx_runtime","_radix_ui_react_slot","NewRequestOptionCard","props","id","titleId","descriptionId","featuresId","hasFeatures","features","media","image","imageSrc","imageAlt","content","icon","title","description","feature","index","cta","shared","className","asChild","disabled","children","href","NewRequestOverlay","openProp","uncontrolledOpen","setUncontrolledOpen","defaultOpen","open","setOpen","next","onOpenChange","select","onSelect","closeOnSelect","variant","options","footer"],"sources":["../../../src/components/NewRequestOverlay/NewRequestOverlay.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport {\n cloneElement,\n forwardRef,\n isValidElement,\n useId,\n useState,\n type ButtonHTMLAttributes,\n type ElementType,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { CheckmarkIcon, NextArrowIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport { Dialog, type DialogProps } from '../Dialog';\nimport { RequestTypeOption } from '../RequestTypeOption';\nimport './NewRequestOverlay.css';\n\ninterface NewRequestOptionContent {\n /** Name of the request type (Figma \"Travel Package\"). With the description it forms the card's accessible name. */\n title: ReactNode;\n /** One line under the title (Figma \"Plan a trip in Armenia or abroad.\"). */\n description?: ReactNode;\n /** One icon from `@travel-match/ui` for the 44px tile (Figma `roadmap`, `plane`). */\n icon?: ReactNode;\n /** `variant=\"cards\"` only. Photo at the top of the card; it is cropped to fill a 220px band (140px in narrow layouts). */\n imageSrc?: string;\n /** `variant=\"cards\"` only. Alternative text of the photo. The photos are decorative by default. */\n imageAlt?: string;\n /** `variant=\"cards\"` only. Custom image element used instead of `imageSrc`, e.g. `next/image`. */\n image?: ReactNode;\n /** `variant=\"cards\"` only. What the request type covers (Figma \"Capabilities\"); each entry gets a check mark. */\n features?: ReactNode[];\n /** `variant=\"cards\"` only. Call to action at the bottom of the card (Figma \"Start a Travel Package\"); an arrow is added after it. */\n cta?: ReactNode;\n /** Renders the card as a link to this URL instead of a button. */\n href?: string;\n}\n\nexport interface NewRequestOptionCardProps extends NewRequestOptionContent, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {\n /** Renders the single child element (e.g. a router `<Link href=\"…\" />`) as the card instead of a `<button>`. */\n asChild?: boolean;\n}\n\n/**\n * The large photo card of the earlier New Request Overlay design (`variant=\"cards\"`): the whole card is one button or\n * link, named by its title and description; the feature list is its description for assistive technology.\n * The current Figma overlay uses the compact `RequestTypeOption` rows instead.\n */\nexport const NewRequestOptionCard = /* @__PURE__ */ forwardRef<HTMLButtonElement, NewRequestOptionCardProps>(function NewRequestOptionCard(\n { title, description, icon, imageSrc, imageAlt = '', image, features, cta, href, asChild = false, disabled, className, children, ...props },\n ref,\n) {\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n const featuresId = `${id}-features`;\n const hasFeatures = Boolean(features && features.length > 0);\n const media = image ?? (imageSrc ? <img src={imageSrc} alt={imageAlt} loading=\"lazy\" decoding=\"async\" /> : null);\n\n // Only phrasing content inside: the card is a <button> or an <a>.\n const content = (\n <>\n {media ? <span className=\"tm-new-request-option__media\">{media}</span> : null}\n <span className=\"tm-new-request-option__content\">\n {icon ? (\n <span className=\"tm-new-request-option__icon\" data-tm-icon-size=\"md\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <span className=\"tm-new-request-option__text\">\n <span id={titleId} className=\"tm-new-request-option__title\">\n {title}\n </span>\n {description ? (\n <span id={descriptionId} className=\"tm-new-request-option__description\">\n {description}\n </span>\n ) : null}\n </span>\n {hasFeatures ? (\n <span id={featuresId} className=\"tm-new-request-option__features\">\n {features!.map((feature, index) => (\n <span key={index} className=\"tm-new-request-option__feature\">\n <CheckmarkIcon size=\"sm\" />\n <span>{feature}</span>\n </span>\n ))}\n </span>\n ) : null}\n {cta ? (\n <span className=\"tm-new-request-option__cta\">\n {cta}\n <NextArrowIcon size=\"sm\" />\n </span>\n ) : null}\n </span>\n </>\n );\n\n const shared = {\n ref,\n className: cn('tm-new-request-option', className),\n 'aria-labelledby': description ? `${titleId} ${descriptionId}` : titleId,\n 'aria-describedby': hasFeatures ? featuresId : undefined,\n ...props,\n };\n\n if (asChild) {\n return (\n <Slot aria-disabled={disabled || undefined} {...shared}>\n {isValidElement(children) ? cloneElement(children as ReactElement<{ children?: ReactNode }>, undefined, content) : children}\n </Slot>\n );\n }\n if (href !== undefined) {\n const Anchor = 'a' as ElementType;\n // A link cannot be `disabled`: without `href` it is not focusable or clickable, and says so to assistive technology.\n return (\n <Anchor href={disabled ? undefined : href} aria-disabled={disabled || undefined} {...shared}>\n {content}\n </Anchor>\n );\n }\n return (\n <button type=\"button\" disabled={disabled} {...shared}>\n {content}\n </button>\n );\n});\n\nexport interface NewRequestOverlayOption extends NewRequestOptionContent {\n /** Identifies the option in `onSelect`. */\n id: string;\n /** Disables the card (buttons only). */\n disabled?: boolean;\n}\n\n/** `list` — the current Figma design: a 560px dialog with one `RequestTypeOption` row per type · `cards` — the earlier design: a 1120px dialog with photo cards side by side. */\nexport type NewRequestOverlayVariant = 'list' | 'cards';\n\nexport interface NewRequestOverlayProps extends Omit<DialogProps, 'size' | 'role' | 'footer' | 'children' | 'onSelect'> {\n /** `list` (default, Figma \"New Request Overlay\"): compact rows in a 560px dialog · `cards`: the earlier large photo cards. */\n variant?: NewRequestOverlayVariant;\n /** The request types to choose from (Figma \"Options\"): any number — stacked rows (`list`) or equal columns that wrap (`cards`). */\n options?: NewRequestOverlayOption[];\n /** Called with the option's `id` when a card is activated. */\n onSelect?: (id: string) => void;\n /** `false` keeps the overlay open after a choice (close it yourself through `open`). */\n closeOnSelect?: boolean;\n /** Line under the options (Figma \"Not sure which one? See how TravelMatch works\"); links inside it are styled. */\n footer?: ReactNode;\n /**\n * Replaces the options: compose `RequestTypeOption` (or `NewRequestOptionCard`) yourself (e.g. `asChild` with router links)\n * or render the next step of the flow here.\n */\n children?: ReactNode;\n}\n\n/**\n * The overlay that starts a new request by choosing its type (Figma component set \"New Request Overlay\").\n * A centered dialog listing one `RequestTypeOption` per type; below 768px it covers the screen.\n */\nexport const NewRequestOverlay = /* @__PURE__ */ forwardRef<HTMLDivElement, NewRequestOverlayProps>(function NewRequestOverlay(\n {\n variant = 'list',\n options = [],\n onSelect,\n closeOnSelect = true,\n footer,\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n mobilePlacement = 'fullscreen',\n className,\n ...props\n },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const open = openProp ?? uncontrolledOpen;\n const setOpen = (next: boolean) => {\n if (openProp === undefined) setUncontrolledOpen(next);\n onOpenChange?.(next);\n };\n\n const select = (id: string) => (_event: MouseEvent) => {\n onSelect?.(id);\n if (closeOnSelect) setOpen(false);\n };\n\n return (\n <Dialog\n ref={ref}\n size={variant === 'cards' ? 'lg' : 'md'}\n className={cn('tm-new-request-overlay', className)}\n data-variant={variant}\n open={open}\n onOpenChange={setOpen}\n mobilePlacement={mobilePlacement}\n {...props}\n >\n <div className=\"tm-new-request-overlay__content\">\n {children ??\n (options.length > 0 ? (\n <ul className=\"tm-new-request-overlay__options\" role=\"list\">\n {options.map(({ id, title, description, icon, href, disabled, imageSrc, imageAlt, image, features, cta }) => (\n <li key={id} className=\"tm-new-request-overlay__option\">\n {variant === 'cards' ? (\n <NewRequestOptionCard\n {...{ title, description, icon, href, disabled, imageSrc, imageAlt, image, features, cta }}\n data-option={id}\n onClick={select(id)}\n />\n ) : (\n <RequestTypeOption title={title} description={description} icon={icon} href={href} disabled={disabled} data-option={id} onClick={select(id)} />\n )}\n </li>\n ))}\n </ul>\n ) : null)}\n {footer ? <div className=\"tm-new-request-overlay__footer\">{footer}</div> : null}\n </div>\n </Dialog>\n );\n});\n"],"mappings":"A,sXAkDA,IAAamB,GAAuC,EAAAH,EAAA,WAAA,CAAyD,SAC3G,CAAE,QAAO,cAAa,OAAM,WAAU,WAAW,GAAI,QAAO,WAAU,MAAK,OAAM,UAAU,GAAO,WAAU,YAAW,WAAU,GAAGI,GACpI,EACA,CACA,IAAMC,GAAA,EAAKrB,EAAAA,MAAAA,CAAM,EACXsB,EAAU,GAAGD,EAAG,QAChBE,EAAgB,GAAGF,EAAG,cACtBG,EAAa,GAAGH,EAAG,WACnBI,EAAc,GAAQC,GAAYA,EAAS,OAAS,GACpDC,EAAQC,IAAUC,GAAW,EAAAZ,EAAA,IAAA,CAAC,MAAD,CAAK,IAAKY,EAAU,IAAKC,EAAU,QAAQ,OAAO,SAAS,OAAS,CAAA,EAAI,MAGrGC,GACJ,EAAAd,EAAA,KAAA,CAAAhB,EAAAA,SAAA,CAAA,SAAA,CACG0B,GAAQ,EAAAV,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,+BAAgC,SAAAU,CAAY,CAAA,EAAI,MACzE,EAAAV,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,iCAAhB,SAAA,CACGe,GACC,EAAAf,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,8BAA8B,oBAAkB,KAAK,cAAY,OAC9E,SAAAe,CACG,CAAA,EACJ,MACJ,EAAAf,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,8BAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,GAAIK,EAAS,UAAU,+BAC1B,SAAAW,CACG,CAAA,EACLC,GACC,EAAAjB,EAAA,IAAA,CAAC,OAAD,CAAM,GAAIM,EAAe,UAAU,qCAChC,SAAAW,CACG,CAAA,EACJ,IACA,C,GACLT,GACC,EAAAR,EAAA,IA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,EACF,MACLqC,GAAS,EAAAzC,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,iCAAkC,SAAAyC,CAAY,CAAA,EAAI,IACxE,C,EACC,CAAA,CAEZ,CAAC,E"}
@@ -3,110 +3,129 @@ import { CheckmarkIcon as e } from "../../icons/generated/CheckmarkIcon.js";
3
3
  import { NextArrowIcon as t } from "../../icons/generated/NextArrowIcon.js";
4
4
  import { cn as n } from "../../utils/cn.js";
5
5
  import { Dialog as r } from "../Dialog/Dialog.js";
6
+ import { RequestTypeOption as i } from "../RequestTypeOption/RequestTypeOption.js";
6
7
  /* empty css */
7
- import { cloneElement as i, forwardRef as a, isValidElement as o, useId as s, useState as c } from "react";
8
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
9
- import { Slot as f } from "@radix-ui/react-slot";
8
+ import { cloneElement as a, forwardRef as o, isValidElement as s, useId as c, useState as l } from "react";
9
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
10
+ import { Slot as p } from "@radix-ui/react-slot";
10
11
  // src/components/NewRequestOverlay/NewRequestOverlay.tsx
11
- var p = /* @__PURE__ */ a(function({ title: r, description: a, icon: c, imageSrc: p, imageAlt: m = "", image: h, features: g, cta: _, href: v, asChild: y = !1, disabled: b, className: x, children: S, ...C }, w) {
12
- let T = s(), E = `${T}-title`, D = `${T}-description`, O = `${T}-features`, k = !!(g && g.length > 0), A = h ?? (p ? /* @__PURE__ */ u("img", {
13
- src: p,
12
+ var m = /* @__PURE__ */ o(function({ title: r, description: i, icon: o, imageSrc: l, imageAlt: m = "", image: h, features: g, cta: _, href: v, asChild: y = !1, disabled: b, className: x, children: S, ...C }, w) {
13
+ let T = c(), E = `${T}-title`, D = `${T}-description`, O = `${T}-features`, k = !!(g && g.length > 0), A = h ?? (l ? /* @__PURE__ */ d("img", {
14
+ src: l,
14
15
  alt: m,
15
16
  loading: "lazy",
16
17
  decoding: "async"
17
- }) : null), j = /* @__PURE__ */ d(l, { children: [A ? /* @__PURE__ */ u("span", {
18
+ }) : null), j = /* @__PURE__ */ f(u, { children: [A ? /* @__PURE__ */ d("span", {
18
19
  className: "tm-new-request-option__media",
19
20
  children: A
20
- }) : null, /* @__PURE__ */ d("span", {
21
+ }) : null, /* @__PURE__ */ f("span", {
21
22
  className: "tm-new-request-option__content",
22
23
  children: [
23
- c ? /* @__PURE__ */ u("span", {
24
+ o ? /* @__PURE__ */ d("span", {
24
25
  className: "tm-new-request-option__icon",
25
26
  "data-tm-icon-size": "md",
26
27
  "aria-hidden": "true",
27
- children: c
28
+ children: o
28
29
  }) : null,
29
- /* @__PURE__ */ d("span", {
30
+ /* @__PURE__ */ f("span", {
30
31
  className: "tm-new-request-option__text",
31
- children: [/* @__PURE__ */ u("span", {
32
+ children: [/* @__PURE__ */ d("span", {
32
33
  id: E,
33
34
  className: "tm-new-request-option__title",
34
35
  children: r
35
- }), a ? /* @__PURE__ */ u("span", {
36
+ }), i ? /* @__PURE__ */ d("span", {
36
37
  id: D,
37
38
  className: "tm-new-request-option__description",
38
- children: a
39
+ children: i
39
40
  }) : null]
40
41
  }),
41
- k ? /* @__PURE__ */ u("span", {
42
+ k ? /* @__PURE__ */ d("span", {
42
43
  id: O,
43
44
  className: "tm-new-request-option__features",
44
- children: g.map((t, n) => /* @__PURE__ */ d("span", {
45
+ children: g.map((t, n) => /* @__PURE__ */ f("span", {
45
46
  className: "tm-new-request-option__feature",
46
- children: [/* @__PURE__ */ u(e, { size: "sm" }), /* @__PURE__ */ u("span", { children: t })]
47
+ children: [/* @__PURE__ */ d(e, { size: "sm" }), /* @__PURE__ */ d("span", { children: t })]
47
48
  }, n))
48
49
  }) : null,
49
- _ ? /* @__PURE__ */ d("span", {
50
+ _ ? /* @__PURE__ */ f("span", {
50
51
  className: "tm-new-request-option__cta",
51
- children: [_, /* @__PURE__ */ u(t, { size: "sm" })]
52
+ children: [_, /* @__PURE__ */ d(t, { size: "sm" })]
52
53
  }) : null
53
54
  ]
54
55
  })] }), M = {
55
56
  ref: w,
56
57
  className: n("tm-new-request-option", x),
57
- "aria-labelledby": a ? `${E} ${D}` : E,
58
+ "aria-labelledby": i ? `${E} ${D}` : E,
58
59
  "aria-describedby": k ? O : void 0,
59
60
  ...C
60
61
  };
61
- return y ? /* @__PURE__ */ u(f, {
62
+ return y ? /* @__PURE__ */ d(p, {
62
63
  "aria-disabled": b || void 0,
63
64
  ...M,
64
- children: o(S) ? i(S, void 0, j) : S
65
- }) : v === void 0 ? /* @__PURE__ */ u("button", {
65
+ children: s(S) ? a(S, void 0, j) : S
66
+ }) : v === void 0 ? /* @__PURE__ */ d("button", {
66
67
  type: "button",
67
68
  disabled: b,
68
69
  ...M,
69
70
  children: j
70
- }) : /* @__PURE__ */ u("a", {
71
+ }) : /* @__PURE__ */ d("a", {
71
72
  href: b ? void 0 : v,
72
73
  "aria-disabled": b || void 0,
73
74
  ...M,
74
75
  children: j
75
76
  });
76
- }), m = /* @__PURE__ */ a(function({ options: e = [], onSelect: t, closeOnSelect: i = !0, footer: a, children: o, open: s, defaultOpen: l = !1, onOpenChange: f, mobilePlacement: m = "fullscreen", className: h, ...g }, _) {
77
- let [v, y] = c(l), b = s ?? v, x = (e) => {
78
- s === void 0 && y(e), f?.(e);
79
- }, S = (e) => (n) => {
80
- t?.(e), i && x(!1);
77
+ }), h = /* @__PURE__ */ o(function({ variant: e = "list", options: t = [], onSelect: a, closeOnSelect: o = !0, footer: s, children: c, open: u, defaultOpen: p = !1, onOpenChange: h, mobilePlacement: g = "fullscreen", className: _, ...v }, y) {
78
+ let [b, x] = l(p), S = u ?? b, C = (e) => {
79
+ u === void 0 && x(e), h?.(e);
80
+ }, w = (e) => (t) => {
81
+ a?.(e), o && C(!1);
81
82
  };
82
- return /* @__PURE__ */ u(r, {
83
- ref: _,
84
- size: "lg",
85
- className: n("tm-new-request-overlay", h),
86
- open: b,
87
- onOpenChange: x,
88
- mobilePlacement: m,
89
- ...g,
90
- children: /* @__PURE__ */ d("div", {
83
+ return /* @__PURE__ */ d(r, {
84
+ ref: y,
85
+ size: e === "cards" ? "lg" : "md",
86
+ className: n("tm-new-request-overlay", _),
87
+ "data-variant": e,
88
+ open: S,
89
+ onOpenChange: C,
90
+ mobilePlacement: g,
91
+ ...v,
92
+ children: /* @__PURE__ */ f("div", {
91
93
  className: "tm-new-request-overlay__content",
92
- children: [o ?? (e.length > 0 ? /* @__PURE__ */ u("ul", {
94
+ children: [c ?? (t.length > 0 ? /* @__PURE__ */ d("ul", {
93
95
  className: "tm-new-request-overlay__options",
94
96
  role: "list",
95
- children: e.map(({ id: e, ...t }) => /* @__PURE__ */ u("li", {
97
+ children: t.map(({ id: t, title: n, description: r, icon: a, href: o, disabled: s, imageSrc: c, imageAlt: l, image: u, features: f, cta: p }) => /* @__PURE__ */ d("li", {
96
98
  className: "tm-new-request-overlay__option",
97
- children: /* @__PURE__ */ u(p, {
98
- ...t,
99
- "data-option": e,
100
- onClick: S(e)
99
+ children: e === "cards" ? /* @__PURE__ */ d(m, {
100
+ title: n,
101
+ description: r,
102
+ icon: a,
103
+ href: o,
104
+ disabled: s,
105
+ imageSrc: c,
106
+ imageAlt: l,
107
+ image: u,
108
+ features: f,
109
+ cta: p,
110
+ "data-option": t,
111
+ onClick: w(t)
112
+ }) : /* @__PURE__ */ d(i, {
113
+ title: n,
114
+ description: r,
115
+ icon: a,
116
+ href: o,
117
+ disabled: s,
118
+ "data-option": t,
119
+ onClick: w(t)
101
120
  })
102
- }, e))
103
- }) : null), a ? /* @__PURE__ */ u("div", {
121
+ }, t))
122
+ }) : null), s ? /* @__PURE__ */ d("div", {
104
123
  className: "tm-new-request-overlay__footer",
105
- children: a
124
+ children: s
106
125
  }) : null]
107
126
  })
108
127
  });
109
128
  });
110
- export { p as NewRequestOptionCard, m as NewRequestOverlay };
129
+ export { m as NewRequestOptionCard, h as NewRequestOverlay };
111
130
 
112
131
  //# sourceMappingURL=NewRequestOverlay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NewRequestOverlay.js","names":["_Fragment","Fragment$1","NewRequestOptionCard","props","id","useId","titleId","descriptionId","featuresId","hasFeatures","features","media","image","imageSrc","imageAlt","content","icon","title","description","CheckmarkIcon","feature","index","cta","NextArrowIcon","shared","cn","className","asChild","Slot","disabled","isValidElement","children","cloneElement","href","NewRequestOverlay","openProp","uncontrolledOpen","setUncontrolledOpen","useState","defaultOpen","open","setOpen","next","onOpenChange","select","onSelect","closeOnSelect","Dialog","options","option","footer"],"sources":["../../../src/components/NewRequestOverlay/NewRequestOverlay.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport {\n cloneElement,\n forwardRef,\n isValidElement,\n useId,\n useState,\n type ButtonHTMLAttributes,\n type ElementType,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { CheckmarkIcon, NextArrowIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport { Dialog, type DialogProps } from '../Dialog';\nimport './NewRequestOverlay.css';\n\ninterface NewRequestOptionContent {\n /** Name of the request type (Figma \"Travel Package\"). With the description it forms the card's accessible name. */\n title: ReactNode;\n /** One line under the title (Figma \"Plan a trip in Armenia or abroad.\"). */\n description?: ReactNode;\n /** One icon from `@travel-match/ui` for the 44px tile (Figma `roadmap`, `plane`). */\n icon?: ReactNode;\n /** Photo at the top of the card; it is cropped to fill a 220px band (140px in narrow layouts). */\n imageSrc?: string;\n /** Alternative text of the photo. The photos are decorative by default. */\n imageAlt?: string;\n /** Custom image element used instead of `imageSrc`, e.g. `next/image`. */\n image?: ReactNode;\n /** What the request type covers (Figma \"Capabilities\"); each entry gets a check mark. */\n features?: ReactNode[];\n /** Call to action at the bottom of the card (Figma \"Start a Travel Package\"); an arrow is added after it. */\n cta?: ReactNode;\n /** Renders the card as a link to this URL instead of a button. */\n href?: string;\n}\n\nexport interface NewRequestOptionCardProps extends NewRequestOptionContent, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {\n /** Renders the single child element (e.g. a router `<Link href=\"…\" />`) as the card instead of a `<button>`. */\n asChild?: boolean;\n}\n\n/**\n * One choice of the New Request Overlay (Figma \"Option / Travel Package\"): the whole card is one button or link,\n * named by its title and description; the feature list is its description for assistive technology.\n */\nexport const NewRequestOptionCard = /* @__PURE__ */ forwardRef<HTMLButtonElement, NewRequestOptionCardProps>(function NewRequestOptionCard(\n { title, description, icon, imageSrc, imageAlt = '', image, features, cta, href, asChild = false, disabled, className, children, ...props },\n ref,\n) {\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n const featuresId = `${id}-features`;\n const hasFeatures = Boolean(features && features.length > 0);\n const media = image ?? (imageSrc ? <img src={imageSrc} alt={imageAlt} loading=\"lazy\" decoding=\"async\" /> : null);\n\n // Only phrasing content inside: the card is a <button> or an <a>.\n const content = (\n <>\n {media ? <span className=\"tm-new-request-option__media\">{media}</span> : null}\n <span className=\"tm-new-request-option__content\">\n {icon ? (\n <span className=\"tm-new-request-option__icon\" data-tm-icon-size=\"md\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <span className=\"tm-new-request-option__text\">\n <span id={titleId} className=\"tm-new-request-option__title\">\n {title}\n </span>\n {description ? (\n <span id={descriptionId} className=\"tm-new-request-option__description\">\n {description}\n </span>\n ) : null}\n </span>\n {hasFeatures ? (\n <span id={featuresId} className=\"tm-new-request-option__features\">\n {features!.map((feature, index) => (\n <span key={index} className=\"tm-new-request-option__feature\">\n <CheckmarkIcon size=\"sm\" />\n <span>{feature}</span>\n </span>\n ))}\n </span>\n ) : null}\n {cta ? (\n <span className=\"tm-new-request-option__cta\">\n {cta}\n <NextArrowIcon size=\"sm\" />\n </span>\n ) : null}\n </span>\n </>\n );\n\n const shared = {\n ref,\n className: cn('tm-new-request-option', className),\n 'aria-labelledby': description ? `${titleId} ${descriptionId}` : titleId,\n 'aria-describedby': hasFeatures ? featuresId : undefined,\n ...props,\n };\n\n if (asChild) {\n return (\n <Slot aria-disabled={disabled || undefined} {...shared}>\n {isValidElement(children) ? cloneElement(children as ReactElement<{ children?: ReactNode }>, undefined, content) : children}\n </Slot>\n );\n }\n if (href !== undefined) {\n const Anchor = 'a' as ElementType;\n // A link cannot be `disabled`: without `href` it is not focusable or clickable, and says so to assistive technology.\n return (\n <Anchor href={disabled ? undefined : href} aria-disabled={disabled || undefined} {...shared}>\n {content}\n </Anchor>\n );\n }\n return (\n <button type=\"button\" disabled={disabled} {...shared}>\n {content}\n </button>\n );\n});\n\nexport interface NewRequestOverlayOption extends NewRequestOptionContent {\n /** Identifies the option in `onSelect`. */\n id: string;\n /** Disables the card (buttons only). */\n disabled?: boolean;\n}\n\nexport interface NewRequestOverlayProps extends Omit<DialogProps, 'size' | 'role' | 'footer' | 'children' | 'onSelect'> {\n /** The request types to choose from (Figma \"Options\"): any number, laid out in equal columns that wrap. */\n options?: NewRequestOverlayOption[];\n /** Called with the option's `id` when a card is activated. */\n onSelect?: (id: string) => void;\n /** `false` keeps the overlay open after a choice (close it yourself through `open`). */\n closeOnSelect?: boolean;\n /** Line under the options (Figma \"Not sure which one? See how TravelMatch works\"); links inside it are styled. */\n footer?: ReactNode;\n /**\n * Replaces the option cards: compose `NewRequestOptionCard` yourself (e.g. `asChild` with router links)\n * or render the next step of the flow here.\n */\n children?: ReactNode;\n}\n\n/**\n * The overlay that starts a new request by choosing its type (Figma component set \"New Request Overlay\").\n * A large centered dialog; below 768px it covers the screen and the cards stack.\n */\nexport const NewRequestOverlay = /* @__PURE__ */ forwardRef<HTMLDivElement, NewRequestOverlayProps>(function NewRequestOverlay(\n { options = [], onSelect, closeOnSelect = true, footer, children, open: openProp, defaultOpen = false, onOpenChange, mobilePlacement = 'fullscreen', className, ...props },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const open = openProp ?? uncontrolledOpen;\n const setOpen = (next: boolean) => {\n if (openProp === undefined) setUncontrolledOpen(next);\n onOpenChange?.(next);\n };\n\n const select = (id: string) => (_event: MouseEvent) => {\n onSelect?.(id);\n if (closeOnSelect) setOpen(false);\n };\n\n return (\n <Dialog ref={ref} size=\"lg\" className={cn('tm-new-request-overlay', className)} open={open} onOpenChange={setOpen} mobilePlacement={mobilePlacement} {...props}>\n <div className=\"tm-new-request-overlay__content\">\n {children ??\n (options.length > 0 ? (\n <ul className=\"tm-new-request-overlay__options\" role=\"list\">\n {options.map(({ id, ...option }) => (\n <li key={id} className=\"tm-new-request-overlay__option\">\n <NewRequestOptionCard {...option} data-option={id} onClick={select(id)} />\n </li>\n ))}\n </ul>\n ) : null)}\n {footer ? <div className=\"tm-new-request-overlay__footer\">{footer}</div> : null}\n </div>\n </Dialog>\n );\n});\n"],"mappings":";;;;;;;;;;AAgDA,IAAaE,IAAuC,kBAAyD,SAC3G,EAAE,UAAO,gBAAa,SAAM,aAAU,cAAW,IAAI,UAAO,aAAU,QAAK,SAAM,aAAU,IAAO,aAAU,cAAW,aAAU,GAAGC,KACpI,GACA;CACA,IAAMC,IAAKC,EAAM,GACXC,IAAU,GAAGF,EAAG,SAChBG,IAAgB,GAAGH,EAAG,eACtBI,IAAa,GAAGJ,EAAG,YACnBK,IAAc,GAAQC,KAAYA,EAAS,SAAS,IACpDC,IAAQC,MAAUC,IAAW,kBAAC,OAAD;EAAK,KAAKA;EAAU,KAAKC;EAAU,SAAQ;EAAO,UAAS;CAAS,CAAA,IAAI,OAGrGC,IACJ,kBAAAf,GAAA,EAAA,UAAA,CACGW,IAAQ,kBAAC,QAAD;EAAM,WAAU;EAAgC,UAAAA;CAAY,CAAA,IAAI,MACzE,kBAAC,QAAD;EAAM,WAAU;EAAhB,UAAA;GACGK,IACC,kBAAC,QAAD;IAAM,WAAU;IAA8B,qBAAkB;IAAK,eAAY;IAC9E,UAAAA;GACG,CAAA,IACJ;GACJ,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,kBAAC,QAAD;KAAM,IAAIV;KAAS,WAAU;KAC1B,UAAAW;IACG,CAAA,GACLC,IACC,kBAAC,QAAD;KAAM,IAAIX;KAAe,WAAU;K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AYC,GACnBK,KAAW,MAAkB;EAEjC,AADIN,MAAa,KAAA,KAAWE,EAAoBK,CAAI,GACpDC,IAAeD,CAAI;CACrB,GAEME,KAAU,OAAgB,MAAuB;EAErD,AADAC,IAAWzC,CAAE,GACT0C,KAAeL,EAAQ,EAAK;CAClC;CAEA,OACE,kBAACM,GAAD;EAAa;EAAK,MAAK;EAAK,WAAWtB,EAAG,0BAA0BC,CAAS;EAAS;EAAM,cAAce;EAA0B;EAAiB,GAAItC;EACvJ,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACG4B,MACEiB,EAAQ,SAAS,IAChB,kBAAC,MAAD;IAAI,WAAU;IAAkC,MAAK;IAClD,UAAAA,EAAQ,KAAK,EAAE,OAAI,GAAGC,QACrB,kBAAC,MAAD;KAAa,WAAU;KACrB,UAAA,kBAAC/C,GAAD;MAAsB,GAAI+C;MAAQ,eAAa7C;MAAI,SAASwC,EAAOxC,CAAE;KAAI,CAAA;IACvE,GAFKA,CAEL,CACL;GACC,CAAA,IACF,OACL8C,IAAS,kBAAC,OAAD;IAAK,WAAU;IAAkC,UAAAA;GAAY,CAAA,IAAI,IACxE;;CACC,CAAA;AAEZ,CAAC"}
1
+ {"version":3,"file":"NewRequestOverlay.js","names":["_Fragment","Fragment$1","NewRequestOptionCard","props","id","useId","titleId","descriptionId","featuresId","hasFeatures","features","media","image","imageSrc","imageAlt","content","icon","title","description","CheckmarkIcon","feature","index","cta","NextArrowIcon","shared","cn","className","asChild","Slot","disabled","isValidElement","children","cloneElement","href","NewRequestOverlay","openProp","uncontrolledOpen","setUncontrolledOpen","useState","defaultOpen","open","setOpen","next","onOpenChange","select","onSelect","closeOnSelect","Dialog","variant","options","RequestTypeOption","footer"],"sources":["../../../src/components/NewRequestOverlay/NewRequestOverlay.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport {\n cloneElement,\n forwardRef,\n isValidElement,\n useId,\n useState,\n type ButtonHTMLAttributes,\n type ElementType,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { CheckmarkIcon, NextArrowIcon } from '../../icons';\nimport { cn } from '../../utils/cn';\nimport { Dialog, type DialogProps } from '../Dialog';\nimport { RequestTypeOption } from '../RequestTypeOption';\nimport './NewRequestOverlay.css';\n\ninterface NewRequestOptionContent {\n /** Name of the request type (Figma \"Travel Package\"). With the description it forms the card's accessible name. */\n title: ReactNode;\n /** One line under the title (Figma \"Plan a trip in Armenia or abroad.\"). */\n description?: ReactNode;\n /** One icon from `@travel-match/ui` for the 44px tile (Figma `roadmap`, `plane`). */\n icon?: ReactNode;\n /** `variant=\"cards\"` only. Photo at the top of the card; it is cropped to fill a 220px band (140px in narrow layouts). */\n imageSrc?: string;\n /** `variant=\"cards\"` only. Alternative text of the photo. The photos are decorative by default. */\n imageAlt?: string;\n /** `variant=\"cards\"` only. Custom image element used instead of `imageSrc`, e.g. `next/image`. */\n image?: ReactNode;\n /** `variant=\"cards\"` only. What the request type covers (Figma \"Capabilities\"); each entry gets a check mark. */\n features?: ReactNode[];\n /** `variant=\"cards\"` only. Call to action at the bottom of the card (Figma \"Start a Travel Package\"); an arrow is added after it. */\n cta?: ReactNode;\n /** Renders the card as a link to this URL instead of a button. */\n href?: string;\n}\n\nexport interface NewRequestOptionCardProps extends NewRequestOptionContent, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {\n /** Renders the single child element (e.g. a router `<Link href=\"…\" />`) as the card instead of a `<button>`. */\n asChild?: boolean;\n}\n\n/**\n * The large photo card of the earlier New Request Overlay design (`variant=\"cards\"`): the whole card is one button or\n * link, named by its title and description; the feature list is its description for assistive technology.\n * The current Figma overlay uses the compact `RequestTypeOption` rows instead.\n */\nexport const NewRequestOptionCard = /* @__PURE__ */ forwardRef<HTMLButtonElement, NewRequestOptionCardProps>(function NewRequestOptionCard(\n { title, description, icon, imageSrc, imageAlt = '', image, features, cta, href, asChild = false, disabled, className, children, ...props },\n ref,\n) {\n const id = useId();\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n const featuresId = `${id}-features`;\n const hasFeatures = Boolean(features && features.length > 0);\n const media = image ?? (imageSrc ? <img src={imageSrc} alt={imageAlt} loading=\"lazy\" decoding=\"async\" /> : null);\n\n // Only phrasing content inside: the card is a <button> or an <a>.\n const content = (\n <>\n {media ? <span className=\"tm-new-request-option__media\">{media}</span> : null}\n <span className=\"tm-new-request-option__content\">\n {icon ? (\n <span className=\"tm-new-request-option__icon\" data-tm-icon-size=\"md\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <span className=\"tm-new-request-option__text\">\n <span id={titleId} className=\"tm-new-request-option__title\">\n {title}\n </span>\n {description ? (\n <span id={descriptionId} className=\"tm-new-request-option__description\">\n {description}\n </span>\n ) : null}\n </span>\n {hasFeatures ? (\n <span id={featuresId} className=\"tm-new-request-option__features\">\n {features!.map((feature, index) => (\n <span key={index} className=\"tm-new-request-option__feature\">\n <CheckmarkIcon size=\"sm\" />\n <span>{feature}</span>\n </span>\n ))}\n </span>\n ) : null}\n {cta ? (\n <span className=\"tm-new-request-option__cta\">\n {cta}\n <NextArrowIcon size=\"sm\" />\n </span>\n ) : null}\n </span>\n </>\n );\n\n const shared = {\n ref,\n className: cn('tm-new-request-option', className),\n 'aria-labelledby': description ? `${titleId} ${descriptionId}` : titleId,\n 'aria-describedby': hasFeatures ? featuresId : undefined,\n ...props,\n };\n\n if (asChild) {\n return (\n <Slot aria-disabled={disabled || undefined} {...shared}>\n {isValidElement(children) ? cloneElement(children as ReactElement<{ children?: ReactNode }>, undefined, content) : children}\n </Slot>\n );\n }\n if (href !== undefined) {\n const Anchor = 'a' as ElementType;\n // A link cannot be `disabled`: without `href` it is not focusable or clickable, and says so to assistive technology.\n return (\n <Anchor href={disabled ? undefined : href} aria-disabled={disabled || undefined} {...shared}>\n {content}\n </Anchor>\n );\n }\n return (\n <button type=\"button\" disabled={disabled} {...shared}>\n {content}\n </button>\n );\n});\n\nexport interface NewRequestOverlayOption extends NewRequestOptionContent {\n /** Identifies the option in `onSelect`. */\n id: string;\n /** Disables the card (buttons only). */\n disabled?: boolean;\n}\n\n/** `list` — the current Figma design: a 560px dialog with one `RequestTypeOption` row per type · `cards` — the earlier design: a 1120px dialog with photo cards side by side. */\nexport type NewRequestOverlayVariant = 'list' | 'cards';\n\nexport interface NewRequestOverlayProps extends Omit<DialogProps, 'size' | 'role' | 'footer' | 'children' | 'onSelect'> {\n /** `list` (default, Figma \"New Request Overlay\"): compact rows in a 560px dialog · `cards`: the earlier large photo cards. */\n variant?: NewRequestOverlayVariant;\n /** The request types to choose from (Figma \"Options\"): any number — stacked rows (`list`) or equal columns that wrap (`cards`). */\n options?: NewRequestOverlayOption[];\n /** Called with the option's `id` when a card is activated. */\n onSelect?: (id: string) => void;\n /** `false` keeps the overlay open after a choice (close it yourself through `open`). */\n closeOnSelect?: boolean;\n /** Line under the options (Figma \"Not sure which one? See how TravelMatch works\"); links inside it are styled. */\n footer?: ReactNode;\n /**\n * Replaces the options: compose `RequestTypeOption` (or `NewRequestOptionCard`) yourself (e.g. `asChild` with router links)\n * or render the next step of the flow here.\n */\n children?: ReactNode;\n}\n\n/**\n * The overlay that starts a new request by choosing its type (Figma component set \"New Request Overlay\").\n * A centered dialog listing one `RequestTypeOption` per type; below 768px it covers the screen.\n */\nexport const NewRequestOverlay = /* @__PURE__ */ forwardRef<HTMLDivElement, NewRequestOverlayProps>(function NewRequestOverlay(\n {\n variant = 'list',\n options = [],\n onSelect,\n closeOnSelect = true,\n footer,\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n mobilePlacement = 'fullscreen',\n className,\n ...props\n },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const open = openProp ?? uncontrolledOpen;\n const setOpen = (next: boolean) => {\n if (openProp === undefined) setUncontrolledOpen(next);\n onOpenChange?.(next);\n };\n\n const select = (id: string) => (_event: MouseEvent) => {\n onSelect?.(id);\n if (closeOnSelect) setOpen(false);\n };\n\n return (\n <Dialog\n ref={ref}\n size={variant === 'cards' ? 'lg' : 'md'}\n className={cn('tm-new-request-overlay', className)}\n data-variant={variant}\n open={open}\n onOpenChange={setOpen}\n mobilePlacement={mobilePlacement}\n {...props}\n >\n <div className=\"tm-new-request-overlay__content\">\n {children ??\n (options.length > 0 ? (\n <ul className=\"tm-new-request-overlay__options\" role=\"list\">\n {options.map(({ id, title, description, icon, href, disabled, imageSrc, imageAlt, image, features, cta }) => (\n <li key={id} className=\"tm-new-request-overlay__option\">\n {variant === 'cards' ? (\n <NewRequestOptionCard\n {...{ title, description, icon, href, disabled, imageSrc, imageAlt, image, features, cta }}\n data-option={id}\n onClick={select(id)}\n />\n ) : (\n <RequestTypeOption title={title} description={description} icon={icon} href={href} disabled={disabled} data-option={id} onClick={select(id)} />\n )}\n </li>\n ))}\n </ul>\n ) : null)}\n {footer ? <div className=\"tm-new-request-overlay__footer\">{footer}</div> : null}\n </div>\n </Dialog>\n );\n});\n"],"mappings":";;;;;;;;;;;AAkDA,IAAaE,IAAuC,kBAAyD,SAC3G,EAAE,UAAO,gBAAa,SAAM,aAAU,cAAW,IAAI,UAAO,aAAU,QAAK,SAAM,aAAU,IAAO,aAAU,cAAW,aAAU,GAAGC,KACpI,GACA;CACA,IAAMC,IAAKC,EAAM,GACXC,IAAU,GAAGF,EAAG,SAChBG,IAAgB,GAAGH,EAAG,eACtBI,IAAa,GAAGJ,EAAG,YACnBK,IAAc,GAAQC,KAAYA,EAAS,SAAS,IACpDC,IAAQC,MAAUC,IAAW,kBAAC,OAAD;EAAK,KAAKA;EAAU,KAAKC;EAAU,SAAQ;EAAO,UAAS;CAAS,CAAA,IAAI,OAGrGC,IACJ,kBAAAf,GAAA,EAAA,UAAA,CACGW,IAAQ,kBAAC,QAAD;EAAM,WAAU;EAAgC,UAAAA;CAAY,CAAA,IAAI,MACzE,kBAAC,QAAD;EAAM,WAAU;EAAhB,UAAA;GACGK,IACC,kBAAC,QAAD;IAAM,WAAU;IAA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e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utils/cn.cjs"),n=require("../NotificationsButton/NotificationsButton.cjs"),r=require("./NotificationsDropdown.cjs");let i=require("react"),a=require("react/jsx-runtime"),o=require("@radix-ui/react-popover");o=e.__toESM(o,1);var s=(0,i.forwardRef)(function({title:e,headingLevel:s,headerAction:c,children:l,footer:u,emptyTitle:d,emptyMessage:f,empty:p,error:m,retryLabel:h,onRetry:g,open:_,defaultOpen:v=!1,onOpenChange:y,align:b=`end`,portalContainer:x,panelClassName:S,...C},w){let[T,E]=(0,i.useState)(v),D=_??T,O=e=>{_===void 0&&E(e),y?.(e)},k=e=>{!e.defaultPrevented&&e.target.closest(`a[href]`)&&O(!1)};return(0,a.jsxs)(o.Root,{open:D,onOpenChange:O,children:[(0,a.jsx)(o.Trigger,{asChild:!0,children:(0,a.jsx)(n.NotificationsButton,{ref:w,...C})}),(0,a.jsx)(o.Portal,{container:x,children:(0,a.jsx)(o.Content,{asChild:!0,align:b,sideOffset:8,collisionPadding:8,children:(0,a.jsx)(r.NotificationsDropdown,{className:t.cn(`tm-notifications-menu__panel`,S),title:e,headingLevel:s,headerAction:c,footer:u,emptyTitle:d,emptyMessage:f,empty:p,error:m,retryLabel:h,onRetry:g,onClick:k,children:l})})})]})});exports.NotificationsMenu=s;
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utils/cn.cjs"),n=require("../NotificationsButton/NotificationsButton.cjs"),r=require("./NotificationsDropdown.cjs");let i=require("react"),a=require("react/jsx-runtime"),o=require("@radix-ui/react-popover");o=e.__toESM(o,1);var s=(0,i.forwardRef)(function({title:e,headingLevel:s,headerAction:c,children:l,footer:u,emptyTitle:d,emptyMessage:f,empty:p,error:m,retryLabel:h,onRetry:g,open:_,defaultOpen:v=!1,onOpenChange:y,align:b=`center`,portalContainer:x,panelClassName:S,...C},w){let[T,E]=(0,i.useState)(v),D=_??T,O=e=>{_===void 0&&E(e),y?.(e)},k=e=>{!e.defaultPrevented&&e.target.closest(`a[href]`)&&O(!1)};return(0,a.jsxs)(o.Root,{open:D,onOpenChange:O,children:[(0,a.jsx)(o.Trigger,{asChild:!0,children:(0,a.jsx)(n.NotificationsButton,{ref:w,...C})}),(0,a.jsx)(o.Portal,{container:x,children:(0,a.jsx)(o.Content,{asChild:!0,align:b,sideOffset:8,collisionPadding:8,children:(0,a.jsx)(r.NotificationsDropdown,{className:t.cn(`tm-notifications-menu__panel`,S),title:e,headingLevel:s,headerAction:c,footer:u,emptyTitle:d,emptyMessage:f,empty:p,error:m,retryLabel:h,onRetry:g,onClick:k,children:l})})})]})});exports.NotificationsMenu=s;
2
2
  //# sourceMappingURL=NotificationsMenu.cjs.map