@fanvue/ui 3.49.0 → 3.51.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 (91) hide show
  1. package/README.md +1 -1
  2. package/dist/animated-icons.d.ts +4 -1
  3. package/dist/charts.d.ts +18 -13
  4. package/dist/cjs/components/Alert/Alert.cjs +45 -36
  5. package/dist/cjs/components/Alert/Alert.cjs.map +1 -1
  6. package/dist/cjs/components/Autocomplete/Autocomplete.cjs +1 -1
  7. package/dist/cjs/components/Autocomplete/Autocomplete.cjs.map +1 -1
  8. package/dist/cjs/components/Autocomplete/AutocompleteDropdownContent.cjs +1 -1
  9. package/dist/cjs/components/Autocomplete/AutocompleteDropdownContent.cjs.map +1 -1
  10. package/dist/cjs/components/Button/Button.cjs +13 -9
  11. package/dist/cjs/components/Button/Button.cjs.map +1 -1
  12. package/dist/cjs/components/Chart/ChartCard.cjs +4 -3
  13. package/dist/cjs/components/Chart/ChartCard.cjs.map +1 -1
  14. package/dist/cjs/components/Chart/ChartGrid.cjs +19 -10
  15. package/dist/cjs/components/Chart/ChartGrid.cjs.map +1 -1
  16. package/dist/cjs/components/Dialog/Dialog.cjs +57 -24
  17. package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
  18. package/dist/cjs/components/Drawer/Drawer.cjs +61 -14
  19. package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
  20. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs +26 -7
  21. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs.map +1 -1
  22. package/dist/cjs/components/IconButton/IconButton.cjs +17 -3
  23. package/dist/cjs/components/IconButton/IconButton.cjs.map +1 -1
  24. package/dist/cjs/components/Icons/BaseIcon.cjs +3 -2
  25. package/dist/cjs/components/Icons/BaseIcon.cjs.map +1 -1
  26. package/dist/cjs/components/Icons/DocumentIcon.cjs +74 -0
  27. package/dist/cjs/components/Icons/DocumentIcon.cjs.map +1 -0
  28. package/dist/cjs/components/Icons/EpisodesIcon.cjs +65 -0
  29. package/dist/cjs/components/Icons/EpisodesIcon.cjs.map +1 -0
  30. package/dist/cjs/components/Icons/ShortsIcon.cjs +74 -0
  31. package/dist/cjs/components/Icons/ShortsIcon.cjs.map +1 -0
  32. package/dist/cjs/components/Icons/SpinnerIcon.cjs +4 -2
  33. package/dist/cjs/components/Icons/SpinnerIcon.cjs.map +1 -1
  34. package/dist/cjs/components/Icons/iconSpinClass.cjs +6 -0
  35. package/dist/cjs/components/Icons/iconSpinClass.cjs.map +1 -0
  36. package/dist/cjs/components/InfoBox/InfoBox.cjs +1 -1
  37. package/dist/cjs/components/InfoBox/InfoBox.cjs.map +1 -1
  38. package/dist/cjs/components/Loader/Loader.cjs +1 -1
  39. package/dist/cjs/components/Loader/Loader.cjs.map +1 -1
  40. package/dist/cjs/components/Pill/Pill.cjs +1 -1
  41. package/dist/cjs/components/Pill/Pill.cjs.map +1 -1
  42. package/dist/cjs/components/Skeleton/Skeleton.cjs +17 -1
  43. package/dist/cjs/components/Skeleton/Skeleton.cjs.map +1 -1
  44. package/dist/cjs/index.cjs +6 -0
  45. package/dist/cjs/index.cjs.map +1 -1
  46. package/dist/components/Alert/Alert.mjs +45 -36
  47. package/dist/components/Alert/Alert.mjs.map +1 -1
  48. package/dist/components/Autocomplete/Autocomplete.mjs +1 -1
  49. package/dist/components/Autocomplete/Autocomplete.mjs.map +1 -1
  50. package/dist/components/Autocomplete/AutocompleteDropdownContent.mjs +1 -1
  51. package/dist/components/Autocomplete/AutocompleteDropdownContent.mjs.map +1 -1
  52. package/dist/components/Button/Button.mjs +13 -9
  53. package/dist/components/Button/Button.mjs.map +1 -1
  54. package/dist/components/Chart/ChartCard.mjs +4 -3
  55. package/dist/components/Chart/ChartCard.mjs.map +1 -1
  56. package/dist/components/Chart/ChartGrid.mjs +20 -11
  57. package/dist/components/Chart/ChartGrid.mjs.map +1 -1
  58. package/dist/components/Dialog/Dialog.mjs +57 -24
  59. package/dist/components/Dialog/Dialog.mjs.map +1 -1
  60. package/dist/components/Drawer/Drawer.mjs +61 -14
  61. package/dist/components/Drawer/Drawer.mjs.map +1 -1
  62. package/dist/components/DropdownMenu/DropdownMenuItem.mjs +26 -7
  63. package/dist/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -1
  64. package/dist/components/IconButton/IconButton.mjs +17 -3
  65. package/dist/components/IconButton/IconButton.mjs.map +1 -1
  66. package/dist/components/Icons/BaseIcon.mjs +3 -2
  67. package/dist/components/Icons/BaseIcon.mjs.map +1 -1
  68. package/dist/components/Icons/DocumentIcon.mjs +57 -0
  69. package/dist/components/Icons/DocumentIcon.mjs.map +1 -0
  70. package/dist/components/Icons/EpisodesIcon.mjs +48 -0
  71. package/dist/components/Icons/EpisodesIcon.mjs.map +1 -0
  72. package/dist/components/Icons/ShortsIcon.mjs +57 -0
  73. package/dist/components/Icons/ShortsIcon.mjs.map +1 -0
  74. package/dist/components/Icons/SpinnerIcon.mjs +4 -2
  75. package/dist/components/Icons/SpinnerIcon.mjs.map +1 -1
  76. package/dist/components/Icons/iconSpinClass.mjs +6 -0
  77. package/dist/components/Icons/iconSpinClass.mjs.map +1 -0
  78. package/dist/components/InfoBox/InfoBox.mjs +1 -1
  79. package/dist/components/InfoBox/InfoBox.mjs.map +1 -1
  80. package/dist/components/Loader/Loader.mjs +1 -1
  81. package/dist/components/Loader/Loader.mjs.map +1 -1
  82. package/dist/components/Pill/Pill.mjs +1 -1
  83. package/dist/components/Pill/Pill.mjs.map +1 -1
  84. package/dist/components/Skeleton/Skeleton.mjs +17 -1
  85. package/dist/components/Skeleton/Skeleton.mjs.map +1 -1
  86. package/dist/index.d.ts +140 -17
  87. package/dist/index.mjs +6 -0
  88. package/dist/index.mjs.map +1 -1
  89. package/dist/styles/base.css +157 -4
  90. package/dist/styles/theme.css +20 -12
  91. package/package.json +1 -1
package/README.md CHANGED
@@ -105,7 +105,7 @@ Not every icon has a twin — an icon is only mapped once its animated artwork h
105
105
  been compared against ours — so a missing export means the pair was rejected or
106
106
  upstream has no equivalent. `SpinnerIcon` is deliberately absent: a loading
107
107
  indicator must not wait for a hover. Keep using the static one with
108
- `animate-spin`, or `Loader`.
108
+ `<SpinnerIcon spin />`, which respects reduced motion, or `Loader`.
109
109
 
110
110
  Nothing animates when the user has asked for reduced motion
111
111
  (`prefers-reduced-motion: reduce`), including animations you start yourself
@@ -107,7 +107,8 @@ export declare interface AnimatedIconHandle {
107
107
 
108
108
  /**
109
109
  * Props for animated twins of prop-based icons. Mirrors `BaseIconProps` minus
110
- * `filled` — the animated artwork is stroke-only, so there is no filled variant.
110
+ * `filled` and `spin` — the animated artwork is stroke-only, so there is no filled
111
+ * variant, and it already animates on its own.
111
112
  *
112
113
  * `size` selects the same box as the static icon of the same name, so swapping
113
114
  * `@fanvue/ui` for `@fanvue/ui/animated-icons` never changes layout.
@@ -121,6 +122,8 @@ export declare interface AnimatedIconProps extends Omit<React_2.SVGAttributes<SV
121
122
  * through a wrapper's spread fails to compile instead of reaching the DOM.
122
123
  */
123
124
  filled?: never;
125
+ /** Not available on animated icons, which animate on their own. Typed as `never` so a spread prop bag cannot leak it onto the `<svg>`. */
126
+ spin?: never;
124
127
  }
125
128
 
126
129
  /**
package/dist/charts.d.ts CHANGED
@@ -66,6 +66,13 @@ export declare interface ChartCardProps extends Omit<React_2.HTMLAttributes<HTML
66
66
  };
67
67
  /** Show loading skeleton instead of content. @default false */
68
68
  loading?: boolean;
69
+ /**
70
+ * Stretch the card to its container's height (e.g. a grid row shared with a
71
+ * taller card) and let the chart content take the height left under the
72
+ * header. Content that needs to scroll in that space should do so itself.
73
+ * @default false
74
+ */
75
+ fullHeight?: boolean;
69
76
  /** Chart content rendered below the header. */
70
77
  children?: React_2.ReactNode;
71
78
  }
@@ -168,16 +175,14 @@ declare type ChartContextValue = {
168
175
  };
169
176
 
170
177
  /**
171
- * The design-system grid for cartesian charts: dotted horizontal lines and one solid
172
- * baseline at value 0, above and below which every other line stays dotted. Render
173
- * it as a direct child of a Recharts `<LineChart>`, `<AreaChart>` or `<BarChart>`.
174
- *
175
- * Grid lines use `neutral-alphas-200`, the colour `ChartContainer` gives Recharts'
176
- * default grid. The baseline uses `border-strong`.
178
+ * The design-system grid for cartesian charts: faint solid horizontal lines
179
+ * (`neutral-alphas-200` at 40%) and a stronger `border-strong` baseline at value 0.
180
+ * Render it as a direct child of a Recharts `<LineChart>`, `<AreaChart>` or `<BarChart>`,
181
+ * and leave `<YAxis domain>` at its default.
177
182
  *
178
- * The baseline extends the y-axis domain to include zero, so it stays visible when
179
- * every value is negative. Leave `<YAxis domain>` at its default: the axis then starts
180
- * at zero, or at the lowest value when the data goes below zero.
183
+ * The baseline is a one-row grid placed by the y scale, not a visible `ReferenceLine`,
184
+ * because Recharts draws no `ReferenceLine` while `data` is empty (there is no x scale).
185
+ * The hidden `ReferenceLine` only keeps 0 inside the y domain when every value is negative.
181
186
  *
182
187
  * @example
183
188
  * ```tsx
@@ -191,7 +196,7 @@ declare type ChartContextValue = {
191
196
  * </ChartContainer>
192
197
  * ```
193
198
  */
194
- export declare function ChartGrid(props: ChartGridProps): JSX.Element;
199
+ export declare function ChartGrid({ xAxisId, yAxisId, ...props }: ChartGridProps): JSX.Element;
195
200
 
196
201
  export declare namespace ChartGrid {
197
202
  var displayName: string;
@@ -199,10 +204,10 @@ export declare namespace ChartGrid {
199
204
 
200
205
  /**
201
206
  * Props for {@link ChartGrid}. Forwarded to Recharts' `CartesianGrid`; `xAxisId` and
202
- * `yAxisId` also place the zero baseline. The line colour and dash are fixed by the
203
- * design system, so `stroke` and `strokeDasharray` are not accepted.
207
+ * `yAxisId` also place the zero baseline. The line colour, opacity and dash are fixed by
208
+ * the design system, so `stroke`, `strokeOpacity` and `strokeDasharray` are not accepted.
204
209
  */
205
- export declare type ChartGridProps = Omit<React_2.ComponentProps<typeof CartesianGrid>, "stroke" | "strokeDasharray">;
210
+ export declare type ChartGridProps = Omit<React_2.ComponentProps<typeof CartesianGrid>, "stroke" | "strokeOpacity" | "strokeDasharray">;
206
211
 
207
212
  /** Re-export of Recharts `Legend` — use with `content={<ChartLegendContent />}`. */
208
213
  export declare const ChartLegend: typeof Legend;
@@ -123,44 +123,53 @@ const Alert = React__namespace.forwardRef(
123
123
  ),
124
124
  ...props,
125
125
  children: [
126
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-start gap-3 py-1 pr-1", children: [
127
- resolvedIcon && // The design's icon slot is 16px, but the default variant icons
128
- // (InfoCircleIcon and friends) ship at `size-5`, so constrain the
129
- // glyph here — the same way IconButton sizes its own icon. The 1px
130
- // top nudge then lands it optically centred on the first 18px line,
131
- // as in the design's icon-wrapper.
132
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-start pt-px [&>svg]:size-4", "aria-hidden": "true", children: resolvedIcon }),
133
- /* @__PURE__ */ jsxRuntime.jsxs(
134
- "div",
135
- {
136
- className: cn.cn(
137
- "flex min-w-0 flex-1",
138
- isTrailing ? "items-center gap-6" : "flex-col gap-3"
139
- ),
140
- children: [
141
- /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "alert", className: cn.cn("flex flex-col gap-1", isTrailing && "min-w-0 flex-1"), children: [
142
- title && /* @__PURE__ */ jsxRuntime.jsx(
143
- "div",
126
+ /* @__PURE__ */ jsxRuntime.jsxs(
127
+ "div",
128
+ {
129
+ className: cn.cn(
130
+ "flex min-w-0 flex-1 py-1 pr-1",
131
+ isTrailing ? "items-center gap-6" : "items-start gap-3"
132
+ ),
133
+ children: [
134
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
135
+ resolvedIcon && // The design's icon slot is 16px, but the default variant icons
136
+ // (InfoCircleIcon and friends) ship at `size-5`, so constrain the
137
+ // glyph here — the same way IconButton sizes its own icon. The 1px
138
+ // top nudge then lands it optically centred on the first 18px line,
139
+ // as in the design's icon-wrapper.
140
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex shrink-0 items-start pt-px [&>svg]:size-4", "aria-hidden": "true", children: resolvedIcon }),
141
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-3", children: [
142
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "alert", className: "flex flex-col gap-1", children: [
143
+ title && /* @__PURE__ */ jsxRuntime.jsx(
144
+ "div",
145
+ {
146
+ className: cn.cn("typography-body-small-14px-semibold", MESSAGE_CLASSES[variant]),
147
+ children: title
148
+ }
149
+ ),
150
+ children ? /* @__PURE__ */ jsxRuntime.jsx(
151
+ "div",
152
+ {
153
+ className: cn.cn("typography-body-small-14px-regular", MESSAGE_CLASSES[variant]),
154
+ children
155
+ }
156
+ ) : null
157
+ ] }),
158
+ !isTrailing && /* @__PURE__ */ jsxRuntime.jsx(
159
+ AlertCta,
144
160
  {
145
- className: cn.cn("typography-body-small-14px-semibold", MESSAGE_CLASSES[variant]),
146
- children: title
161
+ action,
162
+ ctaLabel,
163
+ ctaProps,
164
+ isTrailing: false
147
165
  }
148
- ),
149
- children ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn.cn("typography-body-small-14px-regular", MESSAGE_CLASSES[variant]), children }) : null
150
- ] }),
151
- /* @__PURE__ */ jsxRuntime.jsx(
152
- AlertCta,
153
- {
154
- action,
155
- ctaLabel,
156
- ctaProps,
157
- isTrailing
158
- }
159
- )
160
- ]
161
- }
162
- )
163
- ] }),
166
+ )
167
+ ] })
168
+ ] }),
169
+ isTrailing && /* @__PURE__ */ jsxRuntime.jsx(AlertCta, { action, ctaLabel, ctaProps, isTrailing: true })
170
+ ]
171
+ }
172
+ ),
164
173
  closable && /* @__PURE__ */ jsxRuntime.jsx(
165
174
  IconButton.IconButton,
166
175
  {
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.cjs","sources":["../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button, type ButtonProps } from \"../Button/Button\";\nimport { IconButton } from \"../IconButton/IconButton\";\nimport { AlertIcon } from \"../Icons/AlertIcon\";\nimport { CloseIcon } from \"../Icons/CloseIcon\";\nimport { InfoIcon } from \"../Icons/InfoIcon\";\nimport { TickCircleIcon } from \"../Icons/TickCircleIcon\";\nimport { WarningIcon } from \"../Icons/WarningIcon\";\n\n/** Visual style variant of the alert. */\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\" | \"neutral\";\n\n/**\n * Placement of the call-to-action relative to the message.\n *\n * - `\"under\"` stacks the action beneath the description. Use it when the CTA\n * label is long or the alert is narrow.\n * - `\"trailing\"` keeps the action inline with the message, which keeps the\n * alert compact and works best with short labels.\n */\nexport type AlertLayout = \"under\" | \"trailing\";\n\n/**\n * Per-variant default icon, mapped to the Iconography components the design\n * uses at `Size=16, Fill=Yes`. Note the design's naming: its Error variant\n * takes `Iconography / Warning` and its Warning variant takes\n * `Iconography / Alert`, which reads backwards but is what the node specifies.\n *\n * These carry dedicated 16px geometry, unlike the `*CircleIcon` set they\n * replace, whose 20px art had to be scaled down.\n */\nconst DEFAULT_ICONS: Record<AlertVariant, React.ReactNode> = {\n info: <InfoIcon size={16} filled />,\n success: <TickCircleIcon size={16} filled />,\n warning: <AlertIcon size={16} filled />,\n error: <WarningIcon size={16} filled />,\n neutral: <InfoIcon size={16} filled />,\n};\n\nexport interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Visual style variant of the alert. @default \"info\" */\n variant?: AlertVariant;\n /** Optional title text displayed in bold above the description. */\n title?: string;\n /** Custom icon override. Pass `null` to hide the icon entirely. Each variant shows a default icon when left `undefined`. */\n icon?: React.ReactNode | null;\n /** Whether to show the close button. @default false */\n closable?: boolean;\n /** Callback fired when the close button is clicked. */\n onClose?: () => void;\n /** Accessible label for the close button. @default \"Close alert\" */\n closeLabel?: string;\n /**\n * Composable action slot rendered beneath the description, outside the\n * `role=\"alert\"` live region. Pass your own element (an `<a>`, a `next/link`\n * `<Link>`, or a `<Button>`) and it receives the variant-appropriate link\n * styling via the Radix `Slot` pattern while remaining a real link/button.\n */\n action?: React.ReactNode;\n /** Placement of the call-to-action relative to the message. @default \"under\" */\n layout?: AlertLayout;\n /**\n * Label for a built-in call-to-action button, the button form of the CTA.\n * Use it when the alert asks the user to do something specific — activating a\n * feature, or completing setup — rather than pointing at more detail. Ignored\n * when `action` is set.\n */\n ctaLabel?: React.ReactNode;\n /**\n * Props forwarded to the built-in call-to-action button (e.g. `onClick`).\n * `variant` and `size` default to `secondary`/`32` and can be overridden.\n *\n * The stacked CTA is `w-full sm:w-fit`. To override the width, match the\n * modifier chain — a bare `w-auto` replaces `w-full` but leaves `sm:w-fit`\n * in place, so pass `sm:` variants too.\n */\n ctaProps?: Omit<ButtonProps, \"children\" | \"asChild\">;\n}\n\n/**\n * Title and description colour. The design binds both to\n * `Color/Alerts/Info Prompt/Content/<variant>`, and Neutral to\n * `Color/Content/Secondary` — not to `content-primary`, which reads as plain\n * black on the tinted surface.\n */\nconst MESSAGE_CLASSES: Record<AlertVariant, string> = {\n info: \"text-alerts-info-prompt-content-info\",\n success: \"text-alerts-info-prompt-content-success\",\n warning: \"text-alerts-info-prompt-content-warning\",\n error: \"text-alerts-info-prompt-content-error\",\n neutral: \"text-content-secondary\",\n};\n\n/**\n * Surface fill and icon colour, both read from the component's own design\n * variables: `Color/Alerts/Info Prompt/Background/<variant>` and\n * `Color/Alerts/Info Prompt/Icon/<variant>`.\n *\n * The `text-*` here is inherited by the icon only — the message sets its own\n * colour via {@link MESSAGE_CLASSES}. It matters that this reads the dedicated\n * icon tokens rather than the generic `*-content` ones: those agree only for\n * info, and they carry no dark-mode inversion, where the alert tokens step\n * from `*-600` in light to `*-400` in dark as the design specifies.\n */\nconst SURFACE_CLASSES: Record<AlertVariant, string> = {\n info: \"bg-alerts-info-prompt-background-info text-alerts-info-prompt-icon-info\",\n success: \"bg-alerts-info-prompt-background-success text-alerts-info-prompt-icon-success\",\n warning: \"bg-alerts-info-prompt-background-warning text-alerts-info-prompt-icon-warning\",\n error: \"bg-alerts-info-prompt-background-error text-alerts-info-prompt-icon-error\",\n neutral: \"bg-alerts-info-prompt-background-neutral text-alerts-info-prompt-icon-neutral\",\n};\n\n/**\n * CTA link treatment. The node's CTA is a `V2 Link` instance whose text binds\n * `Color/Buttons/Link/Primary/Default`, with no per-variant override on any of\n * the five — so the link takes the standard link colour rather than the alert's\n * own content tint. These are the same tokens the {@link Link} component\n * applies, including the hover step.\n */\nconst LINK_CLASSES = \"text-buttons-link-primary-default hover:text-buttons-link-primary-hover\";\n\n/**\n * The alert's call-to-action. `action` is the link form: any element passed\n * through receives the variant-appropriate link styling via Radix `Slot` while\n * staying a real link or button. `ctaLabel` is the button form. `action` wins\n * when both are set.\n */\nfunction AlertCta({\n action,\n ctaLabel,\n ctaProps,\n isTrailing,\n}: {\n action: React.ReactNode;\n ctaLabel: React.ReactNode;\n ctaProps?: AlertProps[\"ctaProps\"];\n isTrailing: boolean;\n}) {\n if (action) {\n return (\n <Slot\n className={cn(\n \"typography-body-small-14px-semibold w-fit cursor-pointer underline underline-offset-2\",\n isTrailing && \"shrink-0\",\n LINK_CLASSES,\n )}\n >\n {action}\n </Slot>\n );\n }\n\n if (ctaLabel === undefined || ctaLabel === null || ctaLabel === false) {\n return null;\n }\n\n return (\n <Button\n variant=\"secondary\"\n size=\"32\"\n {...ctaProps}\n className={cn(\n // Stacked, the CTA sits in a flex column, which would otherwise stretch\n // it across the whole alert. Fill on mobile, where a full-width button\n // is the easier target, and hug from `sm` (850px) up. Inline, it always\n // hugs so the message keeps the remaining width.\n isTrailing ? \"shrink-0\" : \"w-full sm:w-fit\",\n ctaProps?.className,\n )}\n >\n {ctaLabel}\n </Button>\n );\n}\n\n/**\n * Displays a contextual feedback message to the user.\n *\n * Supports `info`, `success`, `warning`, `error`, and `neutral` variants with a\n * default icon per variant, optional title, description, dismiss button, and an\n * optional composable `action` slot.\n *\n * Each variant renders a default icon automatically. Pass a custom `icon` to\n * override, or `icon={null}` to hide the icon entirely.\n *\n * Only the title and description live inside the `role=\"alert\"` live region.\n * The icon, `action`, and close button are rendered outside it so interactive\n * controls are announced and navigated consistently by screen readers.\n *\n * @example\n * ```tsx\n * <Alert variant=\"success\" title=\"Saved\" closable onClose={handleClose}>\n * Your changes have been saved.\n * </Alert>\n * ```\n *\n * @example\n * ```tsx\n * <Alert variant=\"neutral\" title=\"Heads up\" action={<a href=\"/docs\">Learn more</a>}>\n * A general notice with no specific sentiment.\n * </Alert>\n * ```\n *\n * @example\n * ```tsx\n * import Link from \"next/link\";\n *\n * <Alert variant=\"info\" title=\"Update available\" action={<Link href=\"/changelog\">See what's new</Link>}>\n * A new version is ready to install.\n * </Alert>\n * ```\n *\n * @example\n * The CTA sits under the description by default. `layout=\"trailing\"` keeps it\n * inline with the message, which suits short labels and keeps the alert compact.\n * ```tsx\n * <Alert variant=\"info\" layout=\"trailing\" action={<a href=\"/docs\">Learn more</a>}>\n * Scheduled posts now publish in your local timezone.\n * </Alert>\n * ```\n *\n * @example\n * `ctaLabel` renders the button form of the CTA instead of a link — use it when\n * the alert asks the user to do something specific.\n * ```tsx\n * <Alert variant=\"warning\" title=\"Finish setup\" layout=\"trailing\" ctaLabel=\"Verify now\" ctaProps={{ onClick: verify }}>\n * Verify your identity to start receiving payouts.\n * </Alert>\n * ```\n */\nexport const Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n className,\n variant = \"info\",\n title,\n icon,\n closable = false,\n onClose,\n closeLabel = \"Close alert\",\n action,\n layout = \"under\",\n ctaLabel,\n ctaProps,\n children,\n ...props\n },\n ref,\n ) => {\n const resolvedIcon = icon === null ? null : (icon ?? DEFAULT_ICONS[variant]);\n const isTrailing = layout === \"trailing\";\n\n return (\n <div\n ref={ref}\n data-testid=\"alert\"\n className={cn(\n // Mirrors the Figma frame: 12px inset with a 16px left inset, 24px\n // from the content row to the close button, `rounded-md` radius.\n \"flex items-start gap-6 rounded-md p-3 pl-4 text-sm leading-[18px]\",\n SURFACE_CLASSES[variant],\n className,\n )}\n {...props}\n >\n {/*\n Content row. Its 4px inset is what takes the container's 12px up to the\n 16px the design specifies around the message, while leaving the close\n button on the container's own 12px. It also puts 28px between the\n message and the close button (this 4px plus the container's 24px gap).\n */}\n <div className=\"flex min-w-0 flex-1 items-start gap-3 py-1 pr-1\">\n {resolvedIcon && (\n // The design's icon slot is 16px, but the default variant icons\n // (InfoCircleIcon and friends) ship at `size-5`, so constrain the\n // glyph here — the same way IconButton sizes its own icon. The 1px\n // top nudge then lands it optically centred on the first 18px line,\n // as in the design's icon-wrapper.\n <span className=\"flex shrink-0 items-start pt-px [&>svg]:size-4\" aria-hidden=\"true\">\n {resolvedIcon}\n </span>\n )}\n\n <div\n className={cn(\n \"flex min-w-0 flex-1\",\n isTrailing ? \"items-center gap-6\" : \"flex-col gap-3\",\n )}\n >\n <div role=\"alert\" className={cn(\"flex flex-col gap-1\", isTrailing && \"min-w-0 flex-1\")}>\n {title && (\n <div\n className={cn(\"typography-body-small-14px-semibold\", MESSAGE_CLASSES[variant])}\n >\n {title}\n </div>\n )}\n {children ? (\n <div className={cn(\"typography-body-small-14px-regular\", MESSAGE_CLASSES[variant])}>\n {children}\n </div>\n ) : null}\n </div>\n <AlertCta\n action={action}\n ctaLabel={ctaLabel}\n ctaProps={ctaProps}\n isTrailing={isTrailing}\n />\n </div>\n </div>\n\n {closable && (\n <IconButton\n variant=\"secondary\"\n size=\"24\"\n onClick={onClose}\n aria-label={closeLabel}\n icon={<CloseIcon size={16} />}\n />\n )}\n </div>\n );\n },\n);\n\nAlert.displayName = \"Alert\";\n"],"names":["jsx","InfoIcon","TickCircleIcon","AlertIcon","WarningIcon","Slot","cn","Button","React","jsxs","IconButton","CloseIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,gBAAuD;AAAA,EAC3D,MAAMA,2BAAAA,IAACC,mBAAA,EAAS,MAAM,I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AAA,sBACC;AAAA,sBACA;AAAA,sBACA;AAAA,sBACA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACF;AAAA,cAAA;AAAA,YAAA;AAAA,UACF,GACF;AAAA,UAEC,YACCA,2BAAAA;AAAAA,YAACU,WAAAA;AAAAA,YAAA;AAAA,cACC,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,SAAS;AAAA,cACT,cAAY;AAAA,cACZ,MAAMV,2BAAAA,IAACW,UAAAA,WAAA,EAAU,MAAM,GAAA,CAAI;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7B;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,MAAM,cAAc;;"}
1
+ {"version":3,"file":"Alert.cjs","sources":["../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button, type ButtonProps } from \"../Button/Button\";\nimport { IconButton } from \"../IconButton/IconButton\";\nimport { AlertIcon } from \"../Icons/AlertIcon\";\nimport { CloseIcon } from \"../Icons/CloseIcon\";\nimport { InfoIcon } from \"../Icons/InfoIcon\";\nimport { TickCircleIcon } from \"../Icons/TickCircleIcon\";\nimport { WarningIcon } from \"../Icons/WarningIcon\";\n\n/** Visual style variant of the alert. */\nexport type AlertVariant = \"info\" | \"success\" | \"warning\" | \"error\" | \"neutral\";\n\n/**\n * Placement of the call-to-action relative to the message.\n *\n * - `\"under\"` stacks the action beneath the description. Use it when the CTA\n * label is long or the alert is narrow.\n * - `\"trailing\"` keeps the action inline with the message, which keeps the\n * alert compact and works best with short labels.\n */\nexport type AlertLayout = \"under\" | \"trailing\";\n\n/**\n * Per-variant default icon, mapped to the Iconography components the design\n * uses at `Size=16, Fill=Yes`. Note the design's naming: its Error variant\n * takes `Iconography / Warning` and its Warning variant takes\n * `Iconography / Alert`, which reads backwards but is what the node specifies.\n *\n * These carry dedicated 16px geometry, unlike the `*CircleIcon` set they\n * replace, whose 20px art had to be scaled down.\n */\nconst DEFAULT_ICONS: Record<AlertVariant, React.ReactNode> = {\n info: <InfoIcon size={16} filled />,\n success: <TickCircleIcon size={16} filled />,\n warning: <AlertIcon size={16} filled />,\n error: <WarningIcon size={16} filled />,\n neutral: <InfoIcon size={16} filled />,\n};\n\nexport interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Visual style variant of the alert. @default \"info\" */\n variant?: AlertVariant;\n /** Optional title text displayed in bold above the description. */\n title?: string;\n /** Custom icon override. Pass `null` to hide the icon entirely. Each variant shows a default icon when left `undefined`. */\n icon?: React.ReactNode | null;\n /** Whether to show the close button. @default false */\n closable?: boolean;\n /** Callback fired when the close button is clicked. */\n onClose?: () => void;\n /** Accessible label for the close button. @default \"Close alert\" */\n closeLabel?: string;\n /**\n * Composable action slot rendered beneath the description, outside the\n * `role=\"alert\"` live region. Pass your own element (an `<a>`, a `next/link`\n * `<Link>`, or a `<Button>`) and it receives the variant-appropriate link\n * styling via the Radix `Slot` pattern while remaining a real link/button.\n */\n action?: React.ReactNode;\n /** Placement of the call-to-action relative to the message. @default \"under\" */\n layout?: AlertLayout;\n /**\n * Label for a built-in call-to-action button, the button form of the CTA.\n * Use it when the alert asks the user to do something specific — activating a\n * feature, or completing setup — rather than pointing at more detail. Ignored\n * when `action` is set.\n */\n ctaLabel?: React.ReactNode;\n /**\n * Props forwarded to the built-in call-to-action button (e.g. `onClick`).\n * `variant` and `size` default to `secondary`/`32` and can be overridden.\n *\n * The stacked CTA is `w-full sm:w-fit`. To override the width, match the\n * modifier chain — a bare `w-auto` replaces `w-full` but leaves `sm:w-fit`\n * in place, so pass `sm:` variants too.\n */\n ctaProps?: Omit<ButtonProps, \"children\" | \"asChild\">;\n}\n\n/**\n * Title and description colour. The design binds both to\n * `Color/Alerts/Info Prompt/Content/<variant>`, and Neutral to\n * `Color/Content/Secondary` — not to `content-primary`, which reads as plain\n * black on the tinted surface.\n */\nconst MESSAGE_CLASSES: Record<AlertVariant, string> = {\n info: \"text-alerts-info-prompt-content-info\",\n success: \"text-alerts-info-prompt-content-success\",\n warning: \"text-alerts-info-prompt-content-warning\",\n error: \"text-alerts-info-prompt-content-error\",\n neutral: \"text-content-secondary\",\n};\n\n/**\n * Surface fill and icon colour, both read from the component's own design\n * variables: `Color/Alerts/Info Prompt/Background/<variant>` and\n * `Color/Alerts/Info Prompt/Icon/<variant>`.\n *\n * The `text-*` here is inherited by the icon only — the message sets its own\n * colour via {@link MESSAGE_CLASSES}. It matters that this reads the dedicated\n * icon tokens rather than the generic `*-content` ones: those agree only for\n * info, and they carry no dark-mode inversion, where the alert tokens step\n * from `*-600` in light to `*-400` in dark as the design specifies.\n */\nconst SURFACE_CLASSES: Record<AlertVariant, string> = {\n info: \"bg-alerts-info-prompt-background-info text-alerts-info-prompt-icon-info\",\n success: \"bg-alerts-info-prompt-background-success text-alerts-info-prompt-icon-success\",\n warning: \"bg-alerts-info-prompt-background-warning text-alerts-info-prompt-icon-warning\",\n error: \"bg-alerts-info-prompt-background-error text-alerts-info-prompt-icon-error\",\n neutral: \"bg-alerts-info-prompt-background-neutral text-alerts-info-prompt-icon-neutral\",\n};\n\n/**\n * CTA link treatment. The node's CTA is a `V2 Link` instance whose text binds\n * `Color/Buttons/Link/Primary/Default`, with no per-variant override on any of\n * the five — so the link takes the standard link colour rather than the alert's\n * own content tint. These are the same tokens the {@link Link} component\n * applies, including the hover step.\n */\nconst LINK_CLASSES = \"text-buttons-link-primary-default hover:text-buttons-link-primary-hover\";\n\n/**\n * The alert's call-to-action. `action` is the link form: any element passed\n * through receives the variant-appropriate link styling via Radix `Slot` while\n * staying a real link or button. `ctaLabel` is the button form. `action` wins\n * when both are set.\n */\nfunction AlertCta({\n action,\n ctaLabel,\n ctaProps,\n isTrailing,\n}: {\n action: React.ReactNode;\n ctaLabel: React.ReactNode;\n ctaProps?: AlertProps[\"ctaProps\"];\n isTrailing: boolean;\n}) {\n if (action) {\n return (\n <Slot\n className={cn(\n \"typography-body-small-14px-semibold w-fit cursor-pointer underline underline-offset-2\",\n isTrailing && \"shrink-0\",\n LINK_CLASSES,\n )}\n >\n {action}\n </Slot>\n );\n }\n\n if (ctaLabel === undefined || ctaLabel === null || ctaLabel === false) {\n return null;\n }\n\n return (\n <Button\n variant=\"secondary\"\n size=\"32\"\n {...ctaProps}\n className={cn(\n // Stacked, the CTA sits in a flex column, which would otherwise stretch\n // it across the whole alert. Fill on mobile, where a full-width button\n // is the easier target, and hug from `sm` (850px) up. Inline, it always\n // hugs so the message keeps the remaining width.\n isTrailing ? \"shrink-0\" : \"w-full sm:w-fit\",\n ctaProps?.className,\n )}\n >\n {ctaLabel}\n </Button>\n );\n}\n\n/**\n * Displays a contextual feedback message to the user.\n *\n * Supports `info`, `success`, `warning`, `error`, and `neutral` variants with a\n * default icon per variant, optional title, description, dismiss button, and an\n * optional composable `action` slot.\n *\n * Each variant renders a default icon automatically. Pass a custom `icon` to\n * override, or `icon={null}` to hide the icon entirely.\n *\n * Only the title and description live inside the `role=\"alert\"` live region.\n * The icon, `action`, and close button are rendered outside it so interactive\n * controls are announced and navigated consistently by screen readers.\n *\n * @example\n * ```tsx\n * <Alert variant=\"success\" title=\"Saved\" closable onClose={handleClose}>\n * Your changes have been saved.\n * </Alert>\n * ```\n *\n * @example\n * ```tsx\n * <Alert variant=\"neutral\" title=\"Heads up\" action={<a href=\"/docs\">Learn more</a>}>\n * A general notice with no specific sentiment.\n * </Alert>\n * ```\n *\n * @example\n * ```tsx\n * import Link from \"next/link\";\n *\n * <Alert variant=\"info\" title=\"Update available\" action={<Link href=\"/changelog\">See what's new</Link>}>\n * A new version is ready to install.\n * </Alert>\n * ```\n *\n * @example\n * The CTA sits under the description by default. `layout=\"trailing\"` keeps it\n * inline with the message, which suits short labels and keeps the alert compact.\n * ```tsx\n * <Alert variant=\"info\" layout=\"trailing\" action={<a href=\"/docs\">Learn more</a>}>\n * Scheduled posts now publish in your local timezone.\n * </Alert>\n * ```\n *\n * @example\n * `ctaLabel` renders the button form of the CTA instead of a link — use it when\n * the alert asks the user to do something specific.\n * ```tsx\n * <Alert variant=\"warning\" title=\"Finish setup\" layout=\"trailing\" ctaLabel=\"Verify now\" ctaProps={{ onClick: verify }}>\n * Verify your identity to start receiving payouts.\n * </Alert>\n * ```\n */\nexport const Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n className,\n variant = \"info\",\n title,\n icon,\n closable = false,\n onClose,\n closeLabel = \"Close alert\",\n action,\n layout = \"under\",\n ctaLabel,\n ctaProps,\n children,\n ...props\n },\n ref,\n ) => {\n const resolvedIcon = icon === null ? null : (icon ?? DEFAULT_ICONS[variant]);\n const isTrailing = layout === \"trailing\";\n\n return (\n <div\n ref={ref}\n data-testid=\"alert\"\n className={cn(\n // Mirrors the Figma frame: 12px inset with a 16px left inset, 24px\n // from the content row to the close button, `rounded-md` radius.\n \"flex items-start gap-6 rounded-md p-3 pl-4 text-sm leading-[18px]\",\n SURFACE_CLASSES[variant],\n className,\n )}\n {...props}\n >\n {/*\n Content row. Its 4px inset is what takes the container's 12px up to the\n 16px the design specifies around the message, while leaving the close\n button on the container's own 12px. It also puts 28px between the\n message and the close button (this 4px plus the container's 24px gap).\n */}\n <div\n className={cn(\n \"flex min-w-0 flex-1 py-1 pr-1\",\n isTrailing ? \"items-center gap-6\" : \"items-start gap-3\",\n )}\n >\n {/*\n Trailing, the icon and message move as one group centred against\n the CTA, so a one-line message shorter than the 32px button keeps\n its icon on the text line instead of at the top of the row.\n */}\n <div className=\"flex min-w-0 flex-1 items-start gap-3\">\n {resolvedIcon && (\n // The design's icon slot is 16px, but the default variant icons\n // (InfoCircleIcon and friends) ship at `size-5`, so constrain the\n // glyph here — the same way IconButton sizes its own icon. The 1px\n // top nudge then lands it optically centred on the first 18px line,\n // as in the design's icon-wrapper.\n <span className=\"flex shrink-0 items-start pt-px [&>svg]:size-4\" aria-hidden=\"true\">\n {resolvedIcon}\n </span>\n )}\n\n <div className=\"flex min-w-0 flex-1 flex-col gap-3\">\n <div role=\"alert\" className=\"flex flex-col gap-1\">\n {title && (\n <div\n className={cn(\"typography-body-small-14px-semibold\", MESSAGE_CLASSES[variant])}\n >\n {title}\n </div>\n )}\n {children ? (\n <div\n className={cn(\"typography-body-small-14px-regular\", MESSAGE_CLASSES[variant])}\n >\n {children}\n </div>\n ) : null}\n </div>\n {!isTrailing && (\n <AlertCta\n action={action}\n ctaLabel={ctaLabel}\n ctaProps={ctaProps}\n isTrailing={false}\n />\n )}\n </div>\n </div>\n\n {isTrailing && (\n <AlertCta action={action} ctaLabel={ctaLabel} ctaProps={ctaProps} isTrailing />\n )}\n </div>\n\n {closable && (\n <IconButton\n variant=\"secondary\"\n size=\"24\"\n onClick={onClose}\n aria-label={closeLabel}\n icon={<CloseIcon size={16} />}\n />\n )}\n </div>\n );\n },\n);\n\nAlert.displayName = \"Alert\";\n"],"names":["jsx","InfoIcon","TickCircleIcon","AlertIcon","WarningIcon","Slot","cn","Button","React","jsxs","IconButton","CloseIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,gBAAuD;AAAA,EAC3D,MAAMA,2BAAAA,IAACC,mBAAA,EAAS,MAAM,IAAI,QAAM,MAAC;AAAA,EACjC,SAASD,2BAAAA,IAACE,+BAAA,EAAe,MAAM,IAAI,QAAM,MAAC;AAAA,EAC1C,SAASF,2BAAAA,IAACG,qBAAA,EAAU,MAAM,IAAI,QAAM,MAAC;AAAA,EACrC,OAAOH,2BAAAA,IAACI,yBAAA,EAAY,MAAM,IAAI,QAAM,MAAC;AAAA,EACrC,SAASJ,2BAAAA,IAACC,mBAAA,EAAS,MAAM,IAAI,QAAM,KAAA,CAAC;AACtC;AAgDA,MAAM,kBAAgD;AAAA,EACpD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AACX;AAaA,MAAM,kBAAgD;AAAA,EACpD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAA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AAA,EAAU,MAAM,GAAA,CAAI;AAAA,YAAA;AAAA,UAAA;AAAA,QAC7B;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,MAAM,cAAc;;"}
@@ -154,7 +154,7 @@ const Autocomplete = React__namespace.forwardRef((props, ref) => {
154
154
  )
155
155
  ] }),
156
156
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
157
- loading && /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon.SpinnerIcon, { className: "size-4 animate-spin text-content-secondary" }),
157
+ loading && /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon.SpinnerIcon, { size: 16, spin: true, className: "text-content-secondary" }),
158
158
  clearable && ac.hasClearableValue && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
159
159
  "button",
160
160
  {
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.cjs","sources":["../../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import * as Popover from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { FLOATING_CONTENT_COLLISION_PADDING } from \"@/utils/floatingContentCollisionPadding\";\nimport { ChevronDownIcon } from \"../Icons/ChevronDownIcon\";\nimport { CloseIcon } from \"../Icons/CloseIcon\";\nimport { SpinnerIcon } from \"../Icons/SpinnerIcon\";\nimport { AutocompleteDropdownContent } from \"./AutocompleteDropdownContent\";\nimport { AutocompleteTag } from \"./AutocompleteTag\";\nimport { useAutocomplete } from \"./useAutocomplete\";\n\nexport type AutocompleteSize = \"48\" | \"40\" | \"32\";\n\nexport interface AutocompleteOption {\n /** Unique value identifying the option. Returned via `onChange`. */\n value: string;\n /** Visible label. Falls back to `value` when omitted. */\n label?: string;\n /** When `true`, the option renders but cannot be selected. @default false */\n disabled?: boolean;\n /**\n * ID of the group this option belongs to. Must match an entry in the\n * component's `groups` prop. Options without a `groupId` render in an\n * implicit \"ungrouped\" bucket above the first declared group.\n */\n groupId?: string;\n /**\n * Pinned options bypass the search filter and stay visible at the top of\n * the list regardless of the current query. Useful for \"+ Create new\"\n * affordances. Pinned options ignore `groupId` and render before any\n * grouped or ungrouped content. @default false\n */\n pinned?: boolean;\n}\n\n/**\n * Describes a single group rendered above its matching options.\n * Indentation of nested rows (e.g. price under product) is not built in —\n * consumers control it via `renderOption` styling.\n */\nexport interface AutocompleteGroup {\n /** Stable identifier referenced by `option.groupId`. */\n id: string;\n /**\n * Group heading text. Used as the group's accessible name and matched\n * against the search query: when the query matches a group's `label`,\n * every option under that group is kept regardless of whether it\n * individually matches the per-option filter. This supports the common\n * \"heading is the searchable label, items are sub-rows\" shape (e.g.\n * heading = product name, items = prices).\n */\n label: string;\n}\n\ninterface AutocompleteBaseProps {\n label?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n helperText?: string;\n /** @default \"48\" */\n size?: AutocompleteSize;\n /** @default false */\n error?: boolean;\n errorMessage?: string;\n placeholder?: string;\n leftIcon?: React.ReactNode;\n /** @default false */\n fullWidth?: boolean;\n /** @default false */\n disabled?: boolean;\n /** @default false */\n clearable?: boolean;\n clearAriaLabel?: string;\n id?: string;\n className?: string;\n options: AutocompleteOption[];\n inputValue?: string;\n onInputChange?: (value: string) => void;\n filterFn?: (option: AutocompleteOption, query: string) => boolean;\n /** @default false */\n creatable?: boolean;\n creatableLabel?: (inputValue: string) => string;\n onCreate?: (inputValue: string) => void;\n /** @default false */\n loading?: boolean;\n loadingText?: string;\n emptyText?: string;\n renderOption?: (\n option: AutocompleteOption,\n state: { selected: boolean; active: boolean },\n ) => React.ReactNode;\n renderTag?: (option: AutocompleteOption, onRemove: () => void) => React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * Ordered list of groups. When provided, options whose `groupId` matches\n * an entry render under the corresponding heading. Groups with no visible\n * (post-filter) options collapse silently. Pinned options render above\n * everything; ungrouped options render between pinned and the first group.\n * Only one level of grouping is supported.\n */\n groups?: AutocompleteGroup[];\n /**\n * Custom renderer for group headings. The returned node is wrapped by the\n * component in an element carrying the `id` referenced by the surrounding\n * `role=\"group\"` wrapper's `aria-labelledby`, so consumers only need to\n * return visual content.\n */\n renderGroupHeading?: (group: AutocompleteGroup) => React.ReactNode;\n}\n\ninterface AutocompleteSingleProps extends AutocompleteBaseProps {\n multiple?: false;\n value?: string | null;\n defaultValue?: string | null;\n onChange?: (value: string | null) => void;\n}\n\ninterface AutocompleteMultiProps extends AutocompleteBaseProps {\n multiple: true;\n value?: string[];\n defaultValue?: string[];\n onChange?: (values: string[]) => void;\n}\n\nexport type AutocompleteProps = AutocompleteSingleProps | AutocompleteMultiProps;\n\nconst CONTAINER_HEIGHT: Record<AutocompleteSize, string> = {\n \"48\": \"min-h-12\",\n \"40\": \"min-h-10\",\n \"32\": \"min-h-8\",\n};\n\nconst INPUT_SIZE_CLASSES: Record<AutocompleteSize, string> = {\n \"48\": \"typography-body-default-16px-regular\",\n \"40\": \"typography-body-default-16px-regular\",\n \"32\": \"typography-body-small-14px-regular\",\n};\n\nconst PADDING_CLASSES: Record<AutocompleteSize, string> = {\n \"48\": \"px-4 py-1.5 gap-3\",\n \"40\": \"px-4 py-1 gap-3\",\n \"32\": \"px-3 py-1 gap-2\",\n};\n\nfunction warnMissingAccessibleName(label?: string, ariaLabel?: string, ariaLabelledBy?: string) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n \"Autocomplete: no accessible name provided. Pass a `label`, `aria-label`, or `aria-labelledby` prop.\",\n );\n }\n }\n}\n\n/**\n * A combobox input with single- or multi-select, optional async loading, and\n * native support for grouped + pinned options.\n *\n * - Pass `groups` plus an `options` array whose entries reference each group\n * via `groupId` to render hierarchical lists with proper `role=\"group\"` +\n * `aria-labelledby` semantics. Options without a `groupId` render above\n * the first group; options marked `pinned` render above everything and\n * bypass the search filter.\n * - Indentation of nested rows (e.g. price under product) is controlled by\n * the consumer via `renderOption` styling — there is no built-in indent.\n *\n * @example\n * ```tsx\n * <Autocomplete\n * aria-label=\"Choose a product\"\n * options={[\n * { value: \"__new__\", label: \"+ Create new product\", pinned: true },\n * { value: \"product:abc\", label: \"Demo Product\", groupId: \"recent\" },\n * ]}\n * groups={[{ id: \"recent\", label: \"Recent products\" }]}\n * onChange={handleSelect}\n * />\n * ```\n */\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Conditional JSX branches in the render template\nexport const Autocomplete = React.forwardRef<HTMLInputElement, AutocompleteProps>((props, ref) => {\n const {\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n helperText,\n size = \"48\",\n error = false,\n errorMessage,\n placeholder,\n leftIcon,\n fullWidth = false,\n disabled = false,\n clearable = false,\n clearAriaLabel = \"Clear\",\n className,\n loading = false,\n loadingText,\n emptyText = \"No results\",\n renderOption,\n renderTag,\n renderGroupHeading,\n } = props;\n\n const ac = useAutocomplete(props);\n\n React.useImperativeHandle(ref, () => ac.inputRef.current as HTMLInputElement);\n\n warnMissingAccessibleName(label, ariaLabel, ariaLabelledby);\n\n const bottomText = error && errorMessage ? errorMessage : helperText;\n\n return (\n <Popover.Root open={ac.isOpen && !disabled} onOpenChange={ac.handleOpenChange}>\n <div\n className={cn(\"flex flex-col\", fullWidth && \"w-full\", className)}\n data-autocomplete-root=\"\"\n data-disabled={disabled ? \"\" : undefined}\n data-error={error ? \"\" : undefined}\n >\n {label && (\n <label\n htmlFor={ac.inputId}\n className=\"typography-description-12px-semibold px-1 pt-1 pb-2 text-content-primary\"\n >\n {label}\n </label>\n )}\n\n <Popover.Anchor asChild>\n {/* biome-ignore lint/a11y/noStaticElementInteractions: Container delegates click to the inner input */}\n {/* biome-ignore lint/a11y/useKeyWithClickEvents: Keyboard interaction is handled by the inner combobox input */}\n <div\n className={cn(\n \"relative flex flex-wrap items-center overflow-hidden rounded-sm border bg-neutral-alphas-100 after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] has-focus-visible:outline-none has-focus-visible:after:shadow-focus-ring motion-safe:transition-colors\",\n error ? \"border-error-content\" : \"border-transparent\",\n !disabled && !error && \"hover:border-neutral-alphas-400\",\n ac.isOpen && !error && !disabled && \"border-neutral-alphas-400\",\n CONTAINER_HEIGHT[size],\n PADDING_CLASSES[size],\n disabled && \"opacity-50\",\n )}\n onClick={ac.handleContainerClick}\n >\n {leftIcon && (\n <div className=\"flex size-5 shrink-0 items-center justify-center text-content-secondary\">\n {leftIcon}\n </div>\n )}\n\n <div className=\"flex min-w-0 flex-1 flex-wrap items-center gap-1.5\">\n {ac.isMulti &&\n ac.selectedMultiOptions.map((opt) => (\n <AutocompleteTag\n key={opt.value}\n option={opt}\n disabled={disabled}\n onRemove={() => ac.toggleMulti(opt.value)}\n renderTag={renderTag}\n />\n ))}\n\n <input\n ref={ac.inputRef}\n id={ac.inputId}\n role=\"combobox\"\n type=\"text\"\n disabled={disabled}\n aria-expanded={ac.isOpen}\n aria-controls={ac.isOpen ? ac.listboxId : undefined}\n aria-activedescendant={ac.activeDescendantId}\n aria-autocomplete=\"list\"\n aria-describedby={bottomText ? ac.helperTextId : undefined}\n aria-invalid={error || undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n autoComplete=\"off\"\n placeholder={\n ac.isMulti && ac.selectedMultiValues.length > 0 ? undefined : placeholder\n }\n value={ac.displayInputValue}\n onChange={ac.handleInputChange}\n onKeyDown={ac.handleKeyDown}\n onFocus={ac.handleFocus}\n onBlur={ac.handleBlur}\n className={cn(\n \"min-w-[40px] flex-1 truncate bg-transparent text-content-primary no-underline placeholder:text-content-secondary placeholder:opacity-40 focus:outline-none disabled:cursor-not-allowed\",\n INPUT_SIZE_CLASSES[size],\n )}\n />\n </div>\n\n <div className=\"flex shrink-0 items-center gap-1\">\n {loading && <SpinnerIcon className=\"size-4 animate-spin text-content-secondary\" />}\n {clearable && ac.hasClearableValue && !disabled && (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={clearAriaLabel}\n className=\"flex size-5 shrink-0 cursor-pointer items-center justify-center text-content-secondary hover:text-content-primary active:scale-95\"\n onClick={ac.handleClear}\n >\n <CloseIcon className=\"size-4\" />\n </button>\n )}\n <div className=\"flex size-5 shrink-0 items-center justify-center text-content-secondary\">\n <ChevronDownIcon\n className={cn(\"size-5 transition-transform\", ac.isOpen && \"rotate-180\")}\n />\n </div>\n </div>\n </div>\n </Popover.Anchor>\n\n <Popover.Portal>\n <Popover.Content\n sideOffset={4}\n collisionPadding={FLOATING_CONTENT_COLLISION_PADDING}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onCloseAutoFocus={(e) => e.preventDefault()}\n style={{ zIndex: \"var(--fanvue-ui-portal-z-index, 50)\" }}\n className={cn(\n \"w-max min-w-(--radix-popper-anchor-width) max-w-(--radix-popover-content-available-width) overflow-hidden rounded-sm border border-neutral-alphas-200 bg-background-primary text-content-primary shadow-[0_4px_16px_rgba(0,0,0,0.10)]\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2\",\n )}\n >\n <div\n ref={ac.listRef}\n id={ac.listboxId}\n role=\"listbox\"\n aria-label={label ?? ariaLabel ?? \"Options\"}\n aria-multiselectable={ac.isMulti || undefined}\n className=\"max-h-60 overflow-y-auto p-1\"\n >\n <AutocompleteDropdownContent\n loading={loading}\n loadingText={loadingText}\n emptyText={emptyText}\n visibleOptions={ac.visibleOptions}\n visibleSections={ac.visibleSections}\n createOption={ac.createOption}\n listboxId={ac.listboxId}\n activeIndex={ac.activeIndex}\n isMulti={ac.isMulti}\n selectedMultiValues={ac.selectedMultiValues}\n selectedValue={ac.selectedValue}\n onSelect={ac.handleSelect}\n onMouseEnter={ac.setActiveIndex}\n renderOption={renderOption}\n renderGroupHeading={renderGroupHeading}\n />\n </div>\n </Popover.Content>\n </Popover.Portal>\n\n {bottomText && (\n <p\n id={ac.helperTextId}\n className={cn(\n \"typography-description-12px-regular px-2 pt-1 pb-0.5\",\n error ? \"text-error-content\" : \"text-content-secondary\",\n )}\n >\n {bottomText}\n </p>\n )}\n </div>\n </Popover.Root>\n );\n});\n\nAutocomplete.displayName = \"Autocomplete\";\n"],"names":["React","useAutocomplete","jsx","Popover","jsxs","cn","AutocompleteTag","SpinnerIcon","CloseIcon","ChevronDownIcon","FLOATING_CONTENT_COLLISION_PADDING","AutocompleteDropdownContent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgIA,MAAM,mBAAqD;AAAA,EACzD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,qBAAuD;AAAA,EAC3D,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,kBAAoD;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,SAAS,0BAA0B,OAAgB,WAAoB,gBAAyB;AAC9F,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,CAAC,SAAS,CAAC,aAAa,CAAC,gBAAgB;AAC3C,cAAQ;AAAA,QACN;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF;AACF;AA4BO,MAAM,eAAeA,iBAAM,WAAgD,CAAC,OAAO,QAAQ;AAChG,QAAM;AAAA,IACJ;AAAA,IACA,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB;AAAA,IACA,OAAO;AAAA,IACP,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE;AAEJ,QAAM,KAAK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AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GAEJ;AAAA,QAEC,cACCT,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI,GAAG;AAAA,YACP,WAAWG,GAAAA;AAAAA,cACT;AAAA,cACA,QAAQ,uBAAuB;AAAA,YAAA;AAAA,YAGhC,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ,CAAC;AAED,aAAa,cAAc;;"}
1
+ {"version":3,"file":"Autocomplete.cjs","sources":["../../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import * as Popover from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { FLOATING_CONTENT_COLLISION_PADDING } from \"@/utils/floatingContentCollisionPadding\";\nimport { ChevronDownIcon } from \"../Icons/ChevronDownIcon\";\nimport { CloseIcon } from \"../Icons/CloseIcon\";\nimport { SpinnerIcon } from \"../Icons/SpinnerIcon\";\nimport { AutocompleteDropdownContent } from \"./AutocompleteDropdownContent\";\nimport { AutocompleteTag } from \"./AutocompleteTag\";\nimport { useAutocomplete } from \"./useAutocomplete\";\n\nexport type AutocompleteSize = \"48\" | \"40\" | \"32\";\n\nexport interface AutocompleteOption {\n /** Unique value identifying the option. Returned via `onChange`. */\n value: string;\n /** Visible label. Falls back to `value` when omitted. */\n label?: string;\n /** When `true`, the option renders but cannot be selected. @default false */\n disabled?: boolean;\n /**\n * ID of the group this option belongs to. Must match an entry in the\n * component's `groups` prop. Options without a `groupId` render in an\n * implicit \"ungrouped\" bucket above the first declared group.\n */\n groupId?: string;\n /**\n * Pinned options bypass the search filter and stay visible at the top of\n * the list regardless of the current query. Useful for \"+ Create new\"\n * affordances. Pinned options ignore `groupId` and render before any\n * grouped or ungrouped content. @default false\n */\n pinned?: boolean;\n}\n\n/**\n * Describes a single group rendered above its matching options.\n * Indentation of nested rows (e.g. price under product) is not built in —\n * consumers control it via `renderOption` styling.\n */\nexport interface AutocompleteGroup {\n /** Stable identifier referenced by `option.groupId`. */\n id: string;\n /**\n * Group heading text. Used as the group's accessible name and matched\n * against the search query: when the query matches a group's `label`,\n * every option under that group is kept regardless of whether it\n * individually matches the per-option filter. This supports the common\n * \"heading is the searchable label, items are sub-rows\" shape (e.g.\n * heading = product name, items = prices).\n */\n label: string;\n}\n\ninterface AutocompleteBaseProps {\n label?: string;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n helperText?: string;\n /** @default \"48\" */\n size?: AutocompleteSize;\n /** @default false */\n error?: boolean;\n errorMessage?: string;\n placeholder?: string;\n leftIcon?: React.ReactNode;\n /** @default false */\n fullWidth?: boolean;\n /** @default false */\n disabled?: boolean;\n /** @default false */\n clearable?: boolean;\n clearAriaLabel?: string;\n id?: string;\n className?: string;\n options: AutocompleteOption[];\n inputValue?: string;\n onInputChange?: (value: string) => void;\n filterFn?: (option: AutocompleteOption, query: string) => boolean;\n /** @default false */\n creatable?: boolean;\n creatableLabel?: (inputValue: string) => string;\n onCreate?: (inputValue: string) => void;\n /** @default false */\n loading?: boolean;\n loadingText?: string;\n emptyText?: string;\n renderOption?: (\n option: AutocompleteOption,\n state: { selected: boolean; active: boolean },\n ) => React.ReactNode;\n renderTag?: (option: AutocompleteOption, onRemove: () => void) => React.ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * Ordered list of groups. When provided, options whose `groupId` matches\n * an entry render under the corresponding heading. Groups with no visible\n * (post-filter) options collapse silently. Pinned options render above\n * everything; ungrouped options render between pinned and the first group.\n * Only one level of grouping is supported.\n */\n groups?: AutocompleteGroup[];\n /**\n * Custom renderer for group headings. The returned node is wrapped by the\n * component in an element carrying the `id` referenced by the surrounding\n * `role=\"group\"` wrapper's `aria-labelledby`, so consumers only need to\n * return visual content.\n */\n renderGroupHeading?: (group: AutocompleteGroup) => React.ReactNode;\n}\n\ninterface AutocompleteSingleProps extends AutocompleteBaseProps {\n multiple?: false;\n value?: string | null;\n defaultValue?: string | null;\n onChange?: (value: string | null) => void;\n}\n\ninterface AutocompleteMultiProps extends AutocompleteBaseProps {\n multiple: true;\n value?: string[];\n defaultValue?: string[];\n onChange?: (values: string[]) => void;\n}\n\nexport type AutocompleteProps = AutocompleteSingleProps | AutocompleteMultiProps;\n\nconst CONTAINER_HEIGHT: Record<AutocompleteSize, string> = {\n \"48\": \"min-h-12\",\n \"40\": \"min-h-10\",\n \"32\": \"min-h-8\",\n};\n\nconst INPUT_SIZE_CLASSES: Record<AutocompleteSize, string> = {\n \"48\": \"typography-body-default-16px-regular\",\n \"40\": \"typography-body-default-16px-regular\",\n \"32\": \"typography-body-small-14px-regular\",\n};\n\nconst PADDING_CLASSES: Record<AutocompleteSize, string> = {\n \"48\": \"px-4 py-1.5 gap-3\",\n \"40\": \"px-4 py-1 gap-3\",\n \"32\": \"px-3 py-1 gap-2\",\n};\n\nfunction warnMissingAccessibleName(label?: string, ariaLabel?: string, ariaLabelledBy?: string) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n \"Autocomplete: no accessible name provided. Pass a `label`, `aria-label`, or `aria-labelledby` prop.\",\n );\n }\n }\n}\n\n/**\n * A combobox input with single- or multi-select, optional async loading, and\n * native support for grouped + pinned options.\n *\n * - Pass `groups` plus an `options` array whose entries reference each group\n * via `groupId` to render hierarchical lists with proper `role=\"group\"` +\n * `aria-labelledby` semantics. Options without a `groupId` render above\n * the first group; options marked `pinned` render above everything and\n * bypass the search filter.\n * - Indentation of nested rows (e.g. price under product) is controlled by\n * the consumer via `renderOption` styling — there is no built-in indent.\n *\n * @example\n * ```tsx\n * <Autocomplete\n * aria-label=\"Choose a product\"\n * options={[\n * { value: \"__new__\", label: \"+ Create new product\", pinned: true },\n * { value: \"product:abc\", label: \"Demo Product\", groupId: \"recent\" },\n * ]}\n * groups={[{ id: \"recent\", label: \"Recent products\" }]}\n * onChange={handleSelect}\n * />\n * ```\n */\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Conditional JSX branches in the render template\nexport const Autocomplete = React.forwardRef<HTMLInputElement, AutocompleteProps>((props, ref) => {\n const {\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n helperText,\n size = \"48\",\n error = false,\n errorMessage,\n placeholder,\n leftIcon,\n fullWidth = false,\n disabled = false,\n clearable = false,\n clearAriaLabel = \"Clear\",\n className,\n loading = false,\n loadingText,\n emptyText = \"No results\",\n renderOption,\n renderTag,\n renderGroupHeading,\n } = props;\n\n const ac = useAutocomplete(props);\n\n React.useImperativeHandle(ref, () => ac.inputRef.current as HTMLInputElement);\n\n warnMissingAccessibleName(label, ariaLabel, ariaLabelledby);\n\n const bottomText = error && errorMessage ? errorMessage : helperText;\n\n return (\n <Popover.Root open={ac.isOpen && !disabled} onOpenChange={ac.handleOpenChange}>\n <div\n className={cn(\"flex flex-col\", fullWidth && \"w-full\", className)}\n data-autocomplete-root=\"\"\n data-disabled={disabled ? \"\" : undefined}\n data-error={error ? \"\" : undefined}\n >\n {label && (\n <label\n htmlFor={ac.inputId}\n className=\"typography-description-12px-semibold px-1 pt-1 pb-2 text-content-primary\"\n >\n {label}\n </label>\n )}\n\n <Popover.Anchor asChild>\n {/* biome-ignore lint/a11y/noStaticElementInteractions: Container delegates click to the inner input */}\n {/* biome-ignore lint/a11y/useKeyWithClickEvents: Keyboard interaction is handled by the inner combobox input */}\n <div\n className={cn(\n \"relative flex flex-wrap items-center overflow-hidden rounded-sm border bg-neutral-alphas-100 after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] has-focus-visible:outline-none has-focus-visible:after:shadow-focus-ring motion-safe:transition-colors\",\n error ? \"border-error-content\" : \"border-transparent\",\n !disabled && !error && \"hover:border-neutral-alphas-400\",\n ac.isOpen && !error && !disabled && \"border-neutral-alphas-400\",\n CONTAINER_HEIGHT[size],\n PADDING_CLASSES[size],\n disabled && \"opacity-50\",\n )}\n onClick={ac.handleContainerClick}\n >\n {leftIcon && (\n <div className=\"flex size-5 shrink-0 items-center justify-center text-content-secondary\">\n {leftIcon}\n </div>\n )}\n\n <div className=\"flex min-w-0 flex-1 flex-wrap items-center gap-1.5\">\n {ac.isMulti &&\n ac.selectedMultiOptions.map((opt) => (\n <AutocompleteTag\n key={opt.value}\n option={opt}\n disabled={disabled}\n onRemove={() => ac.toggleMulti(opt.value)}\n renderTag={renderTag}\n />\n ))}\n\n <input\n ref={ac.inputRef}\n id={ac.inputId}\n role=\"combobox\"\n type=\"text\"\n disabled={disabled}\n aria-expanded={ac.isOpen}\n aria-controls={ac.isOpen ? ac.listboxId : undefined}\n aria-activedescendant={ac.activeDescendantId}\n aria-autocomplete=\"list\"\n aria-describedby={bottomText ? ac.helperTextId : undefined}\n aria-invalid={error || undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n autoComplete=\"off\"\n placeholder={\n ac.isMulti && ac.selectedMultiValues.length > 0 ? undefined : placeholder\n }\n value={ac.displayInputValue}\n onChange={ac.handleInputChange}\n onKeyDown={ac.handleKeyDown}\n onFocus={ac.handleFocus}\n onBlur={ac.handleBlur}\n className={cn(\n \"min-w-[40px] flex-1 truncate bg-transparent text-content-primary no-underline placeholder:text-content-secondary placeholder:opacity-40 focus:outline-none disabled:cursor-not-allowed\",\n INPUT_SIZE_CLASSES[size],\n )}\n />\n </div>\n\n <div className=\"flex shrink-0 items-center gap-1\">\n {loading && <SpinnerIcon size={16} spin className=\"text-content-secondary\" />}\n {clearable && ac.hasClearableValue && !disabled && (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={clearAriaLabel}\n className=\"flex size-5 shrink-0 cursor-pointer items-center justify-center text-content-secondary hover:text-content-primary active:scale-95\"\n onClick={ac.handleClear}\n >\n <CloseIcon className=\"size-4\" />\n </button>\n )}\n <div className=\"flex size-5 shrink-0 items-center justify-center text-content-secondary\">\n <ChevronDownIcon\n className={cn(\"size-5 transition-transform\", ac.isOpen && \"rotate-180\")}\n />\n </div>\n </div>\n </div>\n </Popover.Anchor>\n\n <Popover.Portal>\n <Popover.Content\n sideOffset={4}\n collisionPadding={FLOATING_CONTENT_COLLISION_PADDING}\n onOpenAutoFocus={(e) => e.preventDefault()}\n onCloseAutoFocus={(e) => e.preventDefault()}\n style={{ zIndex: \"var(--fanvue-ui-portal-z-index, 50)\" }}\n className={cn(\n \"w-max min-w-(--radix-popper-anchor-width) max-w-(--radix-popover-content-available-width) overflow-hidden rounded-sm border border-neutral-alphas-200 bg-background-primary text-content-primary shadow-[0_4px_16px_rgba(0,0,0,0.10)]\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2\",\n )}\n >\n <div\n ref={ac.listRef}\n id={ac.listboxId}\n role=\"listbox\"\n aria-label={label ?? ariaLabel ?? \"Options\"}\n aria-multiselectable={ac.isMulti || undefined}\n className=\"max-h-60 overflow-y-auto p-1\"\n >\n <AutocompleteDropdownContent\n loading={loading}\n loadingText={loadingText}\n emptyText={emptyText}\n visibleOptions={ac.visibleOptions}\n visibleSections={ac.visibleSections}\n createOption={ac.createOption}\n listboxId={ac.listboxId}\n activeIndex={ac.activeIndex}\n isMulti={ac.isMulti}\n selectedMultiValues={ac.selectedMultiValues}\n selectedValue={ac.selectedValue}\n onSelect={ac.handleSelect}\n onMouseEnter={ac.setActiveIndex}\n renderOption={renderOption}\n renderGroupHeading={renderGroupHeading}\n />\n </div>\n </Popover.Content>\n </Popover.Portal>\n\n {bottomText && (\n <p\n id={ac.helperTextId}\n className={cn(\n \"typography-description-12px-regular px-2 pt-1 pb-0.5\",\n error ? \"text-error-content\" : \"text-content-secondary\",\n )}\n >\n {bottomText}\n </p>\n )}\n </div>\n </Popover.Root>\n );\n});\n\nAutocomplete.displayName = \"Autocomplete\";\n"],"names":["React","useAutocomplete","jsx","Popover","jsxs","cn","AutocompleteTag","SpinnerIcon","CloseIcon","ChevronDownIcon","FLOATING_CONTENT_COLLISION_PADDING","AutocompleteDropdownContent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgIA,MAAM,mBAAqD;AAAA,EACzD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,qBAAuD;AAAA,EAC3D,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,kBAAoD;AAAA,EACxD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,SAAS,0BAA0B,OAAgB,WAAoB,gBAAyB;AAC9F,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,QAAI,CAAC,SAAS,CAAC,aAAa,CAAC,gBAAgB;AAC3C,cAAQ;AAAA,QACN;AAAA,MAAA;AAAA,IAEJ;AAAA,EACF;AACF;AA4BO,MAAM,eAAeA,iBAAM,WAAgD,CAAC,OAAO,QAAQ;AAChG,QAAM;AAAA,IACJ;AAAA,IACA,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB;AAAA,IACA,OAAO;AAAA,IACP,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE;AAEJ,QAAM,KAAKC,gBAAAA,gBAAgB,KAAK;AAEhCD,mBAAM,oBAAoB,KAAK,MAAM,GAAG,SAAS,OAA2B;AAE5E,4BAA0B,OAAO,WAAW,cAAc;AAE1D,QAAM,aAAa,SAAS,eAAe,eAAe;AAE1D,SACEE,2BAAAA,IAACC,4BAAQ,MAAR,EAAa,MA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BAAuB;AAAA,YAAA;AAAA,YAGhC,UAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA,GAGN;AAEJ,CAAC;AAED,aAAa,cAAc;;"}
@@ -29,7 +29,7 @@ function AutocompleteDropdownContent({
29
29
  return (
30
30
  // biome-ignore lint/a11y/useSemanticElements: <output> is not appropriate here; using role="status" for live region announcements
31
31
  /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "status", className: "flex items-center justify-center py-4", children: [
32
- /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon.SpinnerIcon, { className: "size-5 animate-spin text-content-secondary" }),
32
+ /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon.SpinnerIcon, { spin: true, className: "text-content-secondary" }),
33
33
  loadingText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-body-small-14px-regular ml-2 text-content-secondary", children: loadingText })
34
34
  ] })
35
35
  );
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteDropdownContent.cjs","sources":["../../../../src/components/Autocomplete/AutocompleteDropdownContent.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { SpinnerIcon } from \"../Icons/SpinnerIcon\";\nimport type { AutocompleteGroup, AutocompleteOption } from \"./Autocomplete\";\nimport { AutocompleteOptionItem } from \"./AutocompleteOptionItem\";\nimport type { AutocompleteVisibleSections } from \"./constants\";\n\ninterface AutocompleteDropdownContentProps {\n loading: boolean;\n loadingText?: string;\n emptyText?: string;\n visibleOptions: AutocompleteOption[];\n visibleSections: AutocompleteVisibleSections;\n /**\n * Synthetic \"Create new …\" row, when `creatable` is on and the search\n * doesn't already match an existing option. Rendered as a trailing row,\n * always shown regardless of filter, and indexed last in\n * `visibleOptions` so keyboard navigation works.\n */\n createOption?: AutocompleteOption | null;\n listboxId: string;\n activeIndex: number;\n isMulti: boolean;\n selectedMultiValues: string[];\n selectedValue: string | null;\n onSelect: (option: AutocompleteOption) => void;\n onMouseEnter: (index: number) => void;\n renderOption?: (\n option: AutocompleteOption,\n state: { selected: boolean; active: boolean },\n ) => React.ReactNode;\n renderGroupHeading?: (group: AutocompleteGroup) => React.ReactNode;\n}\n\nfunction DefaultGroupHeading({ children }: { children: React.ReactNode }) {\n return (\n <span className=\"typography-description-12px-semibold block px-3 pt-2 pb-1 text-content-secondary uppercase tracking-wide\">\n {children}\n </span>\n );\n}\n\nexport function AutocompleteDropdownContent({\n loading,\n loadingText,\n emptyText,\n visibleOptions,\n visibleSections,\n createOption,\n listboxId,\n activeIndex,\n isMulti,\n selectedMultiValues,\n selectedValue,\n onSelect,\n onMouseEnter,\n renderOption,\n renderGroupHeading,\n}: AutocompleteDropdownContentProps) {\n if (loading) {\n return (\n // biome-ignore lint/a11y/useSemanticElements: <output> is not appropriate here; using role=\"status\" for live region announcements\n <div role=\"status\" className=\"flex items-center justify-center py-4\">\n <SpinnerIcon className=\"size-5 animate-spin text-content-secondary\" />\n {loadingText && (\n <span className=\"typography-body-small-14px-regular ml-2 text-content-secondary\">\n {loadingText}\n </span>\n )}\n </div>\n );\n }\n\n const { pinned, ungrouped, groups } = visibleSections;\n const hasTopBlock = pinned.length > 0 || ungrouped.length > 0;\n const hasGroups = groups.length > 0;\n const nonPinnedVisibleCount =\n ungrouped.length + groups.reduce((n, g) => n + g.options.length, 0) + (createOption ? 1 : 0);\n\n if (visibleOptions.length === 0) {\n return (\n <div className=\"typography-body-small-14px-regular block px-3 py-4 text-center text-content-secondary\">\n {emptyText}\n </div>\n );\n }\n\n let cursor = 0;\n const renderOptionRow = (option: AutocompleteOption) => {\n const index = cursor++;\n const isSelected = isMulti\n ? selectedMultiValues.includes(option.value)\n : option.value === selectedValue;\n return (\n <AutocompleteOptionItem\n key={option.value}\n option={option}\n optionId={`${listboxId}-option-${index}`}\n index={index}\n isSelected={isSelected}\n isActive={index === activeIndex}\n onSelect={() => onSelect(option)}\n onMouseEnter={() => onMouseEnter(index)}\n renderOption={renderOption}\n />\n );\n };\n\n const showDivider = hasTopBlock && hasGroups;\n const emptyAfterPinned = nonPinnedVisibleCount === 0 && pinned.length > 0;\n\n return (\n <>\n {pinned.map(renderOptionRow)}\n {ungrouped.map(renderOptionRow)}\n {groups.map((section, sectionIndex) => {\n const headingId = `${listboxId}-group-${section.group.id}`;\n const headingNode = renderGroupHeading\n ? renderGroupHeading(section.group)\n : section.group.label;\n return (\n // biome-ignore lint/a11y/useSemanticElements: <fieldset> carries form semantics and default styling we don't want inside a listbox; role=\"group\" is the correct ARIA pattern here\n <div\n key={section.group.id}\n role=\"group\"\n aria-labelledby={headingId}\n className={cn(\n showDivider && sectionIndex === 0 && \"mt-1 border-neutral-alphas-200 border-t pt-1\",\n )}\n >\n <div role=\"presentation\" id={headingId}>\n {renderGroupHeading ? (\n headingNode\n ) : (\n <DefaultGroupHeading>{headingNode}</DefaultGroupHeading>\n )}\n </div>\n {section.options.map(renderOptionRow)}\n </div>\n );\n })}\n {createOption && renderOptionRow(createOption)}\n {emptyAfterPinned && (\n <div className=\"typography-body-small-14px-regular block px-3 py-4 text-center text-content-secondary\">\n {emptyText}\n </div>\n )}\n </>\n );\n}\n"],"names":["jsx","jsxs","SpinnerIcon","AutocompleteOptionItem","Fragment","cn"],"mappings":";;;;;;;AAkCA,SAAS,oBAAoB,EAAE,YAA2C;AACxE,SACEA,2BAAAA,IAAC,QAAA,EAAK,WAAU,4GACb,SAAA,CACH;AAEJ;AAEO,SAAS,4BAA4B;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAqC;AACnC,MAAI,SAAS;AACX;AAAA;AAAA,MAEEC,2BAAAA,KAAC,OAAA,EAAI,MAAK,UAAS,WAAU,yCAC3B,UAAA;AAAA,QAAAD,2BAAAA,IAACE,YAAAA,aAAA,EAAY,WAAU,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AChC,QAAQ,MAAM;AAClB;AAAA;AAAA,QAEEH,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YAEC,MAAK;AAAA,YACL,mBAAiB;AAAA,YACjB,WAAWI,GAAAA;AAAAA,cACT,eAAe,iBAAiB,KAAK;AAAA,YAAA;AAAA,YAGvC,UAAA;AAAA,cAAAL,2BAAAA,IAAC,OAAA,EAAI,MAAK,gBAAe,IAAI,WAC1B,+BACC,cAEAA,2BAAAA,IAAC,qBAAA,EAAqB,UAAA,YAAA,CAAY,GAEtC;AAAA,cACC,QAAQ,QAAQ,IAAI,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,UAd/B,QAAQ,MAAM;AAAA,QAAA;AAAA;AAAA,IAiBzB,CAAC;AAAA,IACA,gBAAgB,gBAAgB,YAAY;AAAA,IAC5C,oBACCA,2BAAAA,IAAC,OAAA,EAAI,WAAU,yFACZ,UAAA,UAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;;"}
1
+ {"version":3,"file":"AutocompleteDropdownContent.cjs","sources":["../../../../src/components/Autocomplete/AutocompleteDropdownContent.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { SpinnerIcon } from \"../Icons/SpinnerIcon\";\nimport type { AutocompleteGroup, AutocompleteOption } from \"./Autocomplete\";\nimport { AutocompleteOptionItem } from \"./AutocompleteOptionItem\";\nimport type { AutocompleteVisibleSections } from \"./constants\";\n\ninterface AutocompleteDropdownContentProps {\n loading: boolean;\n loadingText?: string;\n emptyText?: string;\n visibleOptions: AutocompleteOption[];\n visibleSections: AutocompleteVisibleSections;\n /**\n * Synthetic \"Create new …\" row, when `creatable` is on and the search\n * doesn't already match an existing option. Rendered as a trailing row,\n * always shown regardless of filter, and indexed last in\n * `visibleOptions` so keyboard navigation works.\n */\n createOption?: AutocompleteOption | null;\n listboxId: string;\n activeIndex: number;\n isMulti: boolean;\n selectedMultiValues: string[];\n selectedValue: string | null;\n onSelect: (option: AutocompleteOption) => void;\n onMouseEnter: (index: number) => void;\n renderOption?: (\n option: AutocompleteOption,\n state: { selected: boolean; active: boolean },\n ) => React.ReactNode;\n renderGroupHeading?: (group: AutocompleteGroup) => React.ReactNode;\n}\n\nfunction DefaultGroupHeading({ children }: { children: React.ReactNode }) {\n return (\n <span className=\"typography-description-12px-semibold block px-3 pt-2 pb-1 text-content-secondary uppercase tracking-wide\">\n {children}\n </span>\n );\n}\n\nexport function AutocompleteDropdownContent({\n loading,\n loadingText,\n emptyText,\n visibleOptions,\n visibleSections,\n createOption,\n listboxId,\n activeIndex,\n isMulti,\n selectedMultiValues,\n selectedValue,\n onSelect,\n onMouseEnter,\n renderOption,\n renderGroupHeading,\n}: AutocompleteDropdownContentProps) {\n if (loading) {\n return (\n // biome-ignore lint/a11y/useSemanticElements: <output> is not appropriate here; using role=\"status\" for live region announcements\n <div role=\"status\" className=\"flex items-center justify-center py-4\">\n <SpinnerIcon spin className=\"text-content-secondary\" />\n {loadingText && (\n <span className=\"typography-body-small-14px-regular ml-2 text-content-secondary\">\n {loadingText}\n </span>\n )}\n </div>\n );\n }\n\n const { pinned, ungrouped, groups } = visibleSections;\n const hasTopBlock = pinned.length > 0 || ungrouped.length > 0;\n const hasGroups = groups.length > 0;\n const nonPinnedVisibleCount =\n ungrouped.length + groups.reduce((n, g) => n + g.options.length, 0) + (createOption ? 1 : 0);\n\n if (visibleOptions.length === 0) {\n return (\n <div className=\"typography-body-small-14px-regular block px-3 py-4 text-center text-content-secondary\">\n {emptyText}\n </div>\n );\n }\n\n let cursor = 0;\n const renderOptionRow = (option: AutocompleteOption) => {\n const index = cursor++;\n const isSelected = isMulti\n ? selectedMultiValues.includes(option.value)\n : option.value === selectedValue;\n return (\n <AutocompleteOptionItem\n key={option.value}\n option={option}\n optionId={`${listboxId}-option-${index}`}\n index={index}\n isSelected={isSelected}\n isActive={index === activeIndex}\n onSelect={() => onSelect(option)}\n onMouseEnter={() => onMouseEnter(index)}\n renderOption={renderOption}\n />\n );\n };\n\n const showDivider = hasTopBlock && hasGroups;\n const emptyAfterPinned = nonPinnedVisibleCount === 0 && pinned.length > 0;\n\n return (\n <>\n {pinned.map(renderOptionRow)}\n {ungrouped.map(renderOptionRow)}\n {groups.map((section, sectionIndex) => {\n const headingId = `${listboxId}-group-${section.group.id}`;\n const headingNode = renderGroupHeading\n ? renderGroupHeading(section.group)\n : section.group.label;\n return (\n // biome-ignore lint/a11y/useSemanticElements: <fieldset> carries form semantics and default styling we don't want inside a listbox; role=\"group\" is the correct ARIA pattern here\n <div\n key={section.group.id}\n role=\"group\"\n aria-labelledby={headingId}\n className={cn(\n showDivider && sectionIndex === 0 && \"mt-1 border-neutral-alphas-200 border-t pt-1\",\n )}\n >\n <div role=\"presentation\" id={headingId}>\n {renderGroupHeading ? (\n headingNode\n ) : (\n <DefaultGroupHeading>{headingNode}</DefaultGroupHeading>\n )}\n </div>\n {section.options.map(renderOptionRow)}\n </div>\n );\n })}\n {createOption && renderOptionRow(createOption)}\n {emptyAfterPinned && (\n <div className=\"typography-body-small-14px-regular block px-3 py-4 text-center text-content-secondary\">\n {emptyText}\n </div>\n )}\n </>\n );\n}\n"],"names":["jsx","jsxs","SpinnerIcon","AutocompleteOptionItem","Fragment","cn"],"mappings":";;;;;;;AAkCA,SAAS,oBAAoB,EAAE,YAA2C;AACxE,SACEA,2BAAAA,IAAC,QAAA,EAAK,WAAU,4GACb,SAAA,CACH;AAEJ;AAEO,SAAS,4BAA4B;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAqC;AACnC,MAAI,SAAS;AACX;AAAA;AAAA,MAEEC,2BAAAA,KAAC,OAAA,EAAI,MAAK,UAAS,WAAU,yCAC3B,UAAA;AAAA,QAAAD,2BAAAA,IAACE,YAAAA,aAAA,EAAY,M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Q,KAAK,IAChC,QAAQ,MAAM;AAClB;AAAA;AAAA,QAEEH,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YAEC,MAAK;AAAA,YACL,mBAAiB;AAAA,YACjB,WAAWI,GAAAA;AAAAA,cACT,eAAe,iBAAiB,KAAK;AAAA,YAAA;AAAA,YAGvC,UAAA;AAAA,cAAAL,2BAAAA,IAAC,OAAA,EAAI,MAAK,gBAAe,IAAI,WAC1B,+BACC,cAEAA,2BAAAA,IAAC,qBAAA,EAAqB,UAAA,YAAA,CAAY,GAEtC;AAAA,cACC,QAAQ,QAAQ,IAAI,eAAe;AAAA,YAAA;AAAA,UAAA;AAAA,UAd/B,QAAQ,MAAM;AAAA,QAAA;AAAA;AAAA,IAiBzB,CAAC;AAAA,IACA,gBAAgB,gBAAgB,YAAY;AAAA,IAC5C,oBACCA,2BAAAA,IAAC,OAAA,EAAI,WAAU,yFACZ,UAAA,UAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;;"}
@@ -28,13 +28,14 @@ const NEGATIVE_AWARE_VARIANTS = /* @__PURE__ */ new Set([
28
28
  "primary",
29
29
  "secondary",
30
30
  "tertiary",
31
- "outline"
31
+ "outline",
32
+ "brand"
32
33
  ]);
33
34
  const SIZE_CLASSES = {
34
- "48": "h-12 px-6 py-3 typography-body-default-16px-semibold",
35
- "40": "h-10 px-4 py-2 typography-body-default-16px-semibold",
36
- "32": "h-8 px-3 py-[7px] typography-body-small-14px-semibold",
37
- "24": "h-6 px-2 py-1 typography-body-small-14px-semibold"
35
+ "48": "h-12 rounded-full px-6 py-3 typography-body-default-16px-semibold",
36
+ "40": "h-10 rounded-full px-4 py-2 typography-body-default-16px-semibold",
37
+ "32": "h-8 rounded-full px-3 py-[7px] typography-body-small-14px-semibold",
38
+ "24": "h-6 rounded-xs px-2 py-1 typography-description-12px-semibold"
38
39
  };
39
40
  const ICON_SIDE_PADDING_CLASSES = {
40
41
  "48": { left: "pl-5", right: "pr-5" },
@@ -57,6 +58,7 @@ const ICON_WRAPPER_CLASS = {
57
58
  const AI_GRADIENT = "[background-clip:padding-box,border-box] [background-image:linear-gradient(var(--color-buttons-ai-default),var(--color-buttons-ai-default)),linear-gradient(50deg,var(--color-buttons-ai-stroke-start)_11.87%,var(--color-buttons-ai-stroke-end)_112.39%)] [background-origin:border-box] hover:[background-image:linear-gradient(var(--color-buttons-ai-hover),var(--color-buttons-ai-hover)),linear-gradient(50deg,var(--color-buttons-ai-stroke-start)_11.87%,var(--color-buttons-ai-stroke-end)_112.39%)]";
58
59
  const DISABLED_FILL = "bg-buttons-disabled-default text-content-disabled";
59
60
  const DISABLED_FILL_NEGATIVE = "bg-buttons-disabled-negative text-content-disabled";
61
+ const BRAND_UPSELL = "fv-upsell fv-upsell-shine bg-buttons-brand-default text-content-always-black hover:[--fv-upsell-end:var(--color-buttons-brand-hover)] active:[--fv-upsell-end:var(--color-buttons-brand-hover)]";
60
62
  const DISABLED_TRANSPARENT = "bg-transparent text-content-disabled";
61
63
  const VARIANT_CLASSES = {
62
64
  primary: {
@@ -84,8 +86,10 @@ const VARIANT_CLASSES = {
84
86
  negativeDisabled: "border border-buttons-disabled-negative bg-transparent text-content-disabled"
85
87
  },
86
88
  brand: {
87
- default: "bg-buttons-brand-default text-content-always-black hover:bg-buttons-brand-hover hover:text-content-always-black active:bg-buttons-brand-hover active:text-content-always-black",
88
- disabled: DISABLED_FILL
89
+ default: BRAND_UPSELL,
90
+ negative: `${BRAND_UPSELL} fv-upsell-negative`,
91
+ disabled: DISABLED_FILL,
92
+ negativeDisabled: DISABLED_FILL_NEGATIVE
89
93
  },
90
94
  destructive: {
91
95
  default: "bg-buttons-error-default text-content-always-white hover:bg-buttons-error-hover hover:text-content-always-white active:bg-buttons-error-hover active:text-content-always-white",
@@ -139,7 +143,7 @@ function getTextContent(node) {
139
143
  return void 0;
140
144
  }
141
145
  const LoadingSpinner = ({ size }) => {
142
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-spin", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon.SpinnerIcon, { className: ICON_SIZE_CLASS[size], children: /* @__PURE__ */ jsxRuntime.jsx("title", { children: "Loading" }) }) });
146
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon.SpinnerIcon, { spin: true, className: ICON_SIZE_CLASS[size], children: /* @__PURE__ */ jsxRuntime.jsx("title", { children: "Loading" }) }) });
143
147
  };
144
148
  function renderContent({
145
149
  loading,
@@ -245,7 +249,7 @@ const Button = React__namespace.forwardRef(
245
249
  "aria-busy": loading,
246
250
  ...loadingLabelProps,
247
251
  className: cn.cn(
248
- "inline-flex min-w-0 cursor-pointer items-center gap-2 whitespace-nowrap rounded-full transition-colors",
252
+ "inline-flex min-w-0 cursor-pointer items-center gap-2 whitespace-nowrap transition-colors",
249
253
  "focus-visible:shadow-focus-ring focus-visible:outline-none",
250
254
  isInteractionDisabled && "pointer-events-none cursor-not-allowed",
251
255
  `${price ? "justify-between" : "justify-center"}`,
@@ -1 +1 @@
1
- {"version":3,"file":"Button.cjs","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { AIIcon } from \"../Icons/AIIcon\";\nimport { SpinnerIcon } from \"../Icons/SpinnerIcon\";\n\n/** Visual style variant of the button. */\nexport type ButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"outline\"\n | \"link\"\n | \"brand\"\n | \"destructive\"\n | \"white\"\n | \"alwaysBlack\"\n | \"ai\"\n | \"tertiaryDestructive\"\n | \"text\";\n\n/** Button height in pixels. */\nexport type ButtonSize = \"48\" | \"40\" | \"32\" | \"24\";\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant of the button. @default \"primary\" */\n variant?: ButtonVariant;\n /** Height of the button in pixels. @default \"40\" */\n size?: ButtonSize;\n /**\n * Forces the dark-surface treatment regardless of theme. Only honored on\n * `primary`, `secondary`, `tertiary`, and `outline` variants; ignored on\n * all others. Use when placing the button on a dark background in a light\n * theme (e.g. an inverted hero or modal).\n * @default false\n */\n negative?: boolean;\n /** Icon element displayed before the label. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed after the label. */\n rightIcon?: React.ReactNode;\n /** When `true`, replaces the label with a spinner and disables interaction. @default false */\n loading?: boolean;\n /** Merge props onto a child element instead of rendering a `<button>`. @default false */\n asChild?: boolean;\n /** Old price shown with a strikethrough before the current price. */\n discount?: string;\n /** Current price shown inside the button after the label and icons. */\n price?: string;\n /** When `true`, the button will take the full width of its container. @default false */\n fullWidth?: boolean;\n}\n\nconst NEGATIVE_AWARE_VARIANTS = new Set<ButtonVariant>([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"outline\",\n]);\n\nconst SIZE_CLASSES: Record<ButtonSize, string> = {\n \"48\": \"h-12 px-6 py-3 typography-body-default-16px-semibold\",\n \"40\": \"h-10 px-4 py-2 typography-body-default-16px-semibold\",\n \"32\": \"h-8 px-3 py-[7px] typography-body-small-14px-semibold\",\n \"24\": \"h-6 px-2 py-1 typography-body-small-14px-semibold\",\n};\n\nconst ICON_SIDE_PADDING_CLASSES: Record<ButtonSize, { left: string; right: string }> = {\n \"48\": { left: \"pl-5\", right: \"pr-5\" },\n \"40\": { left: \"pl-3\", right: \"pr-3\" },\n \"32\": { left: \"pl-2\", right: \"pr-2\" },\n \"24\": { left: \"pl-1\", right: \"pr-1\" },\n};\n\nconst ICON_SIZE_CLASS: Record<ButtonSize, string> = {\n \"48\": \"size-5\",\n \"40\": \"size-5\",\n \"32\": \"size-4\",\n \"24\": \"size-3.5\",\n};\n\n/** Targets only direct SVG children so non-icon content (e.g. Pill) can size naturally. */\nconst ICON_WRAPPER_CLASS: Record<ButtonSize, string> = {\n \"48\": \"[&>svg]:size-5\",\n \"40\": \"[&>svg]:size-5\",\n \"32\": \"[&>svg]:size-4\",\n \"24\": \"[&>svg]:size-3.5\",\n};\n\n/**\n * AI variant paints a flat fill over a fixed-angle gradient stroke. The fill is written\n * as a two-stop gradient of one colour because the border-box/padding-box clip trick\n * that draws the stroke requires both layers to be background images.\n */\nconst AI_GRADIENT =\n \"[background-clip:padding-box,border-box] [background-image:linear-gradient(var(--color-buttons-ai-default),var(--color-buttons-ai-default)),linear-gradient(50deg,var(--color-buttons-ai-stroke-start)_11.87%,var(--color-buttons-ai-stroke-end)_112.39%)] [background-origin:border-box] hover:[background-image:linear-gradient(var(--color-buttons-ai-hover),var(--color-buttons-ai-hover)),linear-gradient(50deg,var(--color-buttons-ai-stroke-start)_11.87%,var(--color-buttons-ai-stroke-end)_112.39%)]\";\n\nconst DISABLED_FILL = \"bg-buttons-disabled-default text-content-disabled\";\nconst DISABLED_FILL_NEGATIVE = \"bg-buttons-disabled-negative text-content-disabled\";\nconst DISABLED_TRANSPARENT = \"bg-transparent text-content-disabled\";\n\n/**\n * Class strings for each `ButtonVariant`, indexed by `negative` and `disabled`\n * state. `negative` and `negativeDisabled` are only honored when the variant\n * is in `NEGATIVE_AWARE_VARIANTS` — other variants fall back to the default /\n * disabled entries regardless of the `negative` prop.\n */\ntype VariantClasses = {\n default: string;\n disabled: string;\n negative?: string;\n negativeDisabled?: string;\n};\n\nconst VARIANT_CLASSES: Record<ButtonVariant, VariantClasses> = {\n primary: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted hover:bg-buttons-primary-hover hover:text-content-primary-inverted active:bg-buttons-primary-hover active:text-content-primary-inverted\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-primary-negative-default text-content-primary hover:bg-buttons-primary-negative-hover active:bg-buttons-primary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n secondary: {\n default:\n \"bg-buttons-secondary-default text-content-primary hover:bg-buttons-secondary-hover active:bg-buttons-secondary-hover\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-secondary-negative-default text-content-primary-inverted hover:bg-buttons-secondary-negative-hover active:bg-buttons-secondary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n tertiary: {\n default:\n \"bg-transparent text-content-primary hover:bg-buttons-tertiary-hover active:bg-buttons-tertiary-hover\",\n disabled: DISABLED_TRANSPARENT,\n negative:\n \"bg-transparent text-content-primary-inverted hover:bg-buttons-tertiary-negative-hover active:bg-buttons-tertiary-negative-hover\",\n negativeDisabled: DISABLED_TRANSPARENT,\n },\n outline: {\n default:\n \"border border-buttons-outline-default bg-transparent text-content-primary hover:bg-buttons-outline-hover active:bg-buttons-outline-hover\",\n disabled: \"border border-buttons-disabled-default bg-transparent text-content-disabled\",\n negative:\n \"border border-buttons-outline-negative-default bg-transparent text-content-primary-inverted hover:bg-buttons-outline-negative-hover active:bg-buttons-outline-negative-hover\",\n negativeDisabled:\n \"border border-buttons-disabled-negative bg-transparent text-content-disabled\",\n },\n brand: {\n default:\n \"bg-buttons-brand-default text-content-always-black hover:bg-buttons-brand-hover hover:text-content-always-black active:bg-buttons-brand-hover active:text-content-always-black\",\n disabled: DISABLED_FILL,\n },\n destructive: {\n default:\n \"bg-buttons-error-default text-content-always-white hover:bg-buttons-error-hover hover:text-content-always-white active:bg-buttons-error-hover active:text-content-always-white\",\n disabled: DISABLED_FILL,\n },\n white: {\n default:\n \"bg-buttons-always-white-default text-content-always-black hover:bg-buttons-always-white-hover hover:text-content-always-black active:bg-buttons-always-white-hover active:text-content-always-black\",\n disabled: DISABLED_FILL,\n },\n alwaysBlack: {\n default:\n \"bg-buttons-always-black-default text-content-always-white hover:bg-buttons-always-black-hover hover:text-content-always-white active:bg-buttons-always-black-hover active:text-content-always-white\",\n disabled: DISABLED_FILL,\n },\n ai: {\n default: `border border-transparent text-content-primary shadow-ai-button-glow ${AI_GRADIENT}`,\n disabled: DISABLED_FILL,\n },\n link: {\n default:\n \"bg-transparent text-content-primary underline decoration-solid hover:bg-buttons-tertiary-hover active:bg-buttons-tertiary-hover\",\n disabled: \"bg-transparent text-content-primary underline decoration-solid opacity-50\",\n },\n tertiaryDestructive: {\n default: \"bg-transparent text-error-content hover:bg-error-surface active:bg-error-surface\",\n disabled: \"bg-transparent text-error-content opacity-50\",\n },\n text: {\n default: \"bg-transparent text-content-primary hover:underline active:underline\",\n disabled: \"bg-transparent text-content-primary opacity-50\",\n },\n};\n\nfunction getVariantClasses(variant: ButtonVariant, negative: boolean, disabled: boolean): string {\n const spec = VARIANT_CLASSES[variant];\n const isNegative = NEGATIVE_AWARE_VARIANTS.has(variant) && negative;\n if (disabled) return (isNegative && spec.negativeDisabled) || spec.disabled;\n return (isNegative && spec.negative) || spec.default;\n}\n\nfunction getIconPaddingClasses(\n size: ButtonSize,\n hasLeftIcon: boolean,\n hasRightIcon: boolean,\n): string | undefined {\n const padding = ICON_SIDE_PADDING_CLASSES[size];\n return cn(hasLeftIcon && padding.left, hasRightIcon && padding.right);\n}\n\n/** Recursively extract text content from React nodes for accessible labels */\nfunction getTextContent(node: React.ReactNode): string | undefined {\n if (typeof node === \"string\") return node;\n if (typeof node === \"number\") return String(node);\n if (React.isValidElement(node)) {\n return getTextContent((node.props as { children?: React.ReactNode }).children);\n }\n if (Array.isArray(node)) {\n const text = node.map(getTextContent).filter(Boolean).join(\"\");\n return text || undefined;\n }\n return undefined;\n}\n\nconst LoadingSpinner = ({ size }: { size: ButtonSize }) => {\n return (\n <span className=\"animate-spin\" aria-hidden=\"true\">\n <SpinnerIcon className={ICON_SIZE_CLASS[size]}>\n <title>Loading</title>\n </SpinnerIcon>\n </span>\n );\n};\n\nfunction renderContent({\n loading,\n asChild,\n children,\n size,\n leftIcon,\n rightIcon,\n iconSizeClass,\n discount,\n price,\n}: {\n loading: boolean;\n asChild: boolean;\n children: React.ReactNode;\n size: ButtonSize;\n leftIcon: React.ReactNode;\n rightIcon: React.ReactNode;\n iconSizeClass: string;\n discount?: string;\n price?: string;\n fullWidth?: boolean;\n}) {\n if (loading) {\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(\n children as React.ReactElement<{ children?: React.ReactNode }>,\n undefined,\n <LoadingSpinner size={size} />,\n );\n }\n return (\n <>\n <LoadingSpinner size={size} />\n <span className=\"sr-only\">{children}</span>\n </>\n );\n }\n\n if (asChild) return children;\n\n return (\n <>\n {leftIcon && (\n <span\n className={cn(\"flex shrink-0 items-center justify-center\", iconSizeClass)}\n aria-hidden=\"true\"\n >\n {leftIcon}\n </span>\n )}\n {React.Children.map(children, (child) =>\n typeof child === \"string\" ? (\n child.trim() ? (\n <span className=\"min-w-0 truncate\">{child}</span>\n ) : null\n ) : typeof child === \"number\" ? (\n <span className=\"min-w-0 truncate\">{child}</span>\n ) : (\n child\n ),\n )}\n {rightIcon && (\n <span\n className={cn(\"flex shrink-0 items-center justify-center\", iconSizeClass)}\n aria-hidden=\"true\"\n >\n {rightIcon}\n </span>\n )}\n {(price || discount) && (\n <div>\n {discount && (\n <span className=\"typography-body-default-16px-regular line-through\" aria-hidden=\"true\">\n {discount}\n </span>\n )}\n {price && (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {price}\n </span>\n )}\n </div>\n )}\n </>\n );\n}\n\n/**\n * A versatile button component with multiple visual variants, sizes, icon\n * slots, loading state, and optional pricing display.\n *\n * Pass `negative` when rendering on a dark surface to opt into the inverted\n * treatment for `primary`, `secondary`, `tertiary`, and `outline` variants.\n *\n * The `ai` variant ships with the AI sparkle icon baked in (locked at 16px\n * regardless of button size); pass `leftIcon` to override the default sparkle.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"40\" leftIcon={<StarIcon />}>\n * Continue\n * </Button>\n * ```\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = \"primary\",\n size = \"40\",\n negative = false,\n leftIcon,\n rightIcon,\n loading = false,\n asChild = false,\n disabled,\n children,\n discount,\n price,\n fullWidth = false,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n const isDisabled = Boolean(disabled);\n const isInteractionDisabled = isDisabled || loading;\n const iconSizeClass = variant === \"ai\" ? \"[&>svg]:size-4\" : ICON_WRAPPER_CLASS[size];\n const effectiveLeftIcon = leftIcon ?? (variant === \"ai\" ? <AIIcon filled /> : undefined);\n const iconPaddingClasses = getIconPaddingClasses(\n size,\n Boolean(effectiveLeftIcon),\n Boolean(rightIcon),\n );\n\n const buttonSpecificProps = !asChild\n ? {\n type: \"button\" as const,\n \"data-testid\": \"button\",\n disabled: isInteractionDisabled,\n }\n : isInteractionDisabled\n ? { \"aria-disabled\": true }\n : {};\n\n const loadingLabelProps = loading && asChild ? { \"aria-label\": getTextContent(children) } : {};\n\n const content = renderContent({\n loading,\n asChild,\n children,\n size,\n leftIcon: effectiveLeftIcon,\n rightIcon,\n iconSizeClass,\n discount,\n price,\n });\n\n return (\n <Comp\n ref={ref}\n {...buttonSpecificProps}\n aria-busy={loading}\n {...loadingLabelProps}\n className={cn(\n \"inline-flex min-w-0 cursor-pointer items-center gap-2 whitespace-nowrap rounded-full transition-colors\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n isInteractionDisabled && \"pointer-events-none cursor-not-allowed\",\n `${price ? \"justify-between\" : \"justify-center\"}`,\n fullWidth && \"w-full\",\n SIZE_CLASSES[size],\n iconPaddingClasses,\n getVariantClasses(variant, negative, isDisabled),\n className,\n )}\n {...props}\n >\n {content}\n </Comp>\n );\n },\n);\n\nButton.displayName = \"Button\";\n"],"names":["cn","React","jsx","SpinnerIcon","jsxs","Fragment","Slot","AIIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAM,8CAA8B,IAAmB;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,MAAM,eAA2C;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,4BAAiF;AAAA,EACrF,MAAM,EAAE,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jB;AAAA,UACA,kBAAkB,SAAS,UAAU,UAAU;AAAA,UAC/C;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,OAAO,cAAc;;"}
1
+ {"version":3,"file":"Button.cjs","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { AIIcon } from \"../Icons/AIIcon\";\nimport { SpinnerIcon } from \"../Icons/SpinnerIcon\";\n\n/** Visual style variant of the button. */\nexport type ButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"outline\"\n | \"link\"\n | \"brand\"\n | \"destructive\"\n | \"white\"\n | \"alwaysBlack\"\n | \"ai\"\n | \"tertiaryDestructive\"\n | \"text\";\n\n/** Button height in pixels. */\nexport type ButtonSize = \"48\" | \"40\" | \"32\" | \"24\";\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant of the button. @default \"primary\" */\n variant?: ButtonVariant;\n /** Height of the button in pixels. @default \"40\" */\n size?: ButtonSize;\n /**\n * Forces the dark-surface treatment regardless of theme. Only honored on\n * `primary`, `secondary`, `tertiary`, and `outline` variants; ignored on\n * all others. Use when placing the button on a dark background in a light\n * theme (e.g. an inverted hero or modal).\n * @default false\n */\n negative?: boolean;\n /** Icon element displayed before the label. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed after the label. */\n rightIcon?: React.ReactNode;\n /** When `true`, replaces the label with a spinner and disables interaction. @default false */\n loading?: boolean;\n /** Merge props onto a child element instead of rendering a `<button>`. @default false */\n asChild?: boolean;\n /** Old price shown with a strikethrough before the current price. */\n discount?: string;\n /** Current price shown inside the button after the label and icons. */\n price?: string;\n /** When `true`, the button will take the full width of its container. @default false */\n fullWidth?: boolean;\n}\n\nconst NEGATIVE_AWARE_VARIANTS = new Set<ButtonVariant>([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"outline\",\n \"brand\",\n]);\n\n/** The `24` size is squared (`rounded-xs`) with 12px text, matching Figma; every larger size is a pill. */\nconst SIZE_CLASSES: Record<ButtonSize, string> = {\n \"48\": \"h-12 rounded-full px-6 py-3 typography-body-default-16px-semibold\",\n \"40\": \"h-10 rounded-full px-4 py-2 typography-body-default-16px-semibold\",\n \"32\": \"h-8 rounded-full px-3 py-[7px] typography-body-small-14px-semibold\",\n \"24\": \"h-6 rounded-xs px-2 py-1 typography-description-12px-semibold\",\n};\n\nconst ICON_SIDE_PADDING_CLASSES: Record<ButtonSize, { left: string; right: string }> = {\n \"48\": { left: \"pl-5\", right: \"pr-5\" },\n \"40\": { left: \"pl-3\", right: \"pr-3\" },\n \"32\": { left: \"pl-2\", right: \"pr-2\" },\n \"24\": { left: \"pl-1\", right: \"pr-1\" },\n};\n\nconst ICON_SIZE_CLASS: Record<ButtonSize, string> = {\n \"48\": \"size-5\",\n \"40\": \"size-5\",\n \"32\": \"size-4\",\n \"24\": \"size-3.5\",\n};\n\n/** Targets only direct SVG children so non-icon content (e.g. Pill) can size naturally. */\nconst ICON_WRAPPER_CLASS: Record<ButtonSize, string> = {\n \"48\": \"[&>svg]:size-5\",\n \"40\": \"[&>svg]:size-5\",\n \"32\": \"[&>svg]:size-4\",\n \"24\": \"[&>svg]:size-3.5\",\n};\n\n/**\n * AI variant paints a flat fill over a fixed-angle gradient stroke. The fill is written\n * as a two-stop gradient of one colour because the border-box/padding-box clip trick\n * that draws the stroke requires both layers to be background images.\n */\nconst AI_GRADIENT =\n \"[background-clip:padding-box,border-box] [background-image:linear-gradient(var(--color-buttons-ai-default),var(--color-buttons-ai-default)),linear-gradient(50deg,var(--color-buttons-ai-stroke-start)_11.87%,var(--color-buttons-ai-stroke-end)_112.39%)] [background-origin:border-box] hover:[background-image:linear-gradient(var(--color-buttons-ai-hover),var(--color-buttons-ai-hover)),linear-gradient(50deg,var(--color-buttons-ai-stroke-start)_11.87%,var(--color-buttons-ai-stroke-end)_112.39%)]\";\n\nconst DISABLED_FILL = \"bg-buttons-disabled-default text-content-disabled\";\nconst DISABLED_FILL_NEGATIVE = \"bg-buttons-disabled-negative text-content-disabled\";\nconst BRAND_UPSELL =\n \"fv-upsell fv-upsell-shine bg-buttons-brand-default text-content-always-black hover:[--fv-upsell-end:var(--color-buttons-brand-hover)] active:[--fv-upsell-end:var(--color-buttons-brand-hover)]\";\nconst DISABLED_TRANSPARENT = \"bg-transparent text-content-disabled\";\n\n/**\n * Class strings for each `ButtonVariant`, indexed by `negative` and `disabled`\n * state. `negative` and `negativeDisabled` are only honored when the variant\n * is in `NEGATIVE_AWARE_VARIANTS` — other variants fall back to the default /\n * disabled entries regardless of the `negative` prop.\n */\ntype VariantClasses = {\n default: string;\n disabled: string;\n negative?: string;\n negativeDisabled?: string;\n};\n\nconst VARIANT_CLASSES: Record<ButtonVariant, VariantClasses> = {\n primary: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted hover:bg-buttons-primary-hover hover:text-content-primary-inverted active:bg-buttons-primary-hover active:text-content-primary-inverted\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-primary-negative-default text-content-primary hover:bg-buttons-primary-negative-hover active:bg-buttons-primary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n secondary: {\n default:\n \"bg-buttons-secondary-default text-content-primary hover:bg-buttons-secondary-hover active:bg-buttons-secondary-hover\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-secondary-negative-default text-content-primary-inverted hover:bg-buttons-secondary-negative-hover active:bg-buttons-secondary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n tertiary: {\n default:\n \"bg-transparent text-content-primary hover:bg-buttons-tertiary-hover active:bg-buttons-tertiary-hover\",\n disabled: DISABLED_TRANSPARENT,\n negative:\n \"bg-transparent text-content-primary-inverted hover:bg-buttons-tertiary-negative-hover active:bg-buttons-tertiary-negative-hover\",\n negativeDisabled: DISABLED_TRANSPARENT,\n },\n outline: {\n default:\n \"border border-buttons-outline-default bg-transparent text-content-primary hover:bg-buttons-outline-hover active:bg-buttons-outline-hover\",\n disabled: \"border border-buttons-disabled-default bg-transparent text-content-disabled\",\n negative:\n \"border border-buttons-outline-negative-default bg-transparent text-content-primary-inverted hover:bg-buttons-outline-negative-hover active:bg-buttons-outline-negative-hover\",\n negativeDisabled:\n \"border border-buttons-disabled-negative bg-transparent text-content-disabled\",\n },\n brand: {\n default: BRAND_UPSELL,\n negative: `${BRAND_UPSELL} fv-upsell-negative`,\n disabled: DISABLED_FILL,\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n destructive: {\n default:\n \"bg-buttons-error-default text-content-always-white hover:bg-buttons-error-hover hover:text-content-always-white active:bg-buttons-error-hover active:text-content-always-white\",\n disabled: DISABLED_FILL,\n },\n white: {\n default:\n \"bg-buttons-always-white-default text-content-always-black hover:bg-buttons-always-white-hover hover:text-content-always-black active:bg-buttons-always-white-hover active:text-content-always-black\",\n disabled: DISABLED_FILL,\n },\n alwaysBlack: {\n default:\n \"bg-buttons-always-black-default text-content-always-white hover:bg-buttons-always-black-hover hover:text-content-always-white active:bg-buttons-always-black-hover active:text-content-always-white\",\n disabled: DISABLED_FILL,\n },\n ai: {\n default: `border border-transparent text-content-primary shadow-ai-button-glow ${AI_GRADIENT}`,\n disabled: DISABLED_FILL,\n },\n link: {\n default:\n \"bg-transparent text-content-primary underline decoration-solid hover:bg-buttons-tertiary-hover active:bg-buttons-tertiary-hover\",\n disabled: \"bg-transparent text-content-primary underline decoration-solid opacity-50\",\n },\n tertiaryDestructive: {\n default: \"bg-transparent text-error-content hover:bg-error-surface active:bg-error-surface\",\n disabled: \"bg-transparent text-error-content opacity-50\",\n },\n text: {\n default: \"bg-transparent text-content-primary hover:underline active:underline\",\n disabled: \"bg-transparent text-content-primary opacity-50\",\n },\n};\n\nfunction getVariantClasses(variant: ButtonVariant, negative: boolean, disabled: boolean): string {\n const spec = VARIANT_CLASSES[variant];\n const isNegative = NEGATIVE_AWARE_VARIANTS.has(variant) && negative;\n if (disabled) return (isNegative && spec.negativeDisabled) || spec.disabled;\n return (isNegative && spec.negative) || spec.default;\n}\n\nfunction getIconPaddingClasses(\n size: ButtonSize,\n hasLeftIcon: boolean,\n hasRightIcon: boolean,\n): string | undefined {\n const padding = ICON_SIDE_PADDING_CLASSES[size];\n return cn(hasLeftIcon && padding.left, hasRightIcon && padding.right);\n}\n\n/** Recursively extract text content from React nodes for accessible labels */\nfunction getTextContent(node: React.ReactNode): string | undefined {\n if (typeof node === \"string\") return node;\n if (typeof node === \"number\") return String(node);\n if (React.isValidElement(node)) {\n return getTextContent((node.props as { children?: React.ReactNode }).children);\n }\n if (Array.isArray(node)) {\n const text = node.map(getTextContent).filter(Boolean).join(\"\");\n return text || undefined;\n }\n return undefined;\n}\n\nconst LoadingSpinner = ({ size }: { size: ButtonSize }) => {\n return (\n <span aria-hidden=\"true\">\n <SpinnerIcon spin className={ICON_SIZE_CLASS[size]}>\n <title>Loading</title>\n </SpinnerIcon>\n </span>\n );\n};\n\nfunction renderContent({\n loading,\n asChild,\n children,\n size,\n leftIcon,\n rightIcon,\n iconSizeClass,\n discount,\n price,\n}: {\n loading: boolean;\n asChild: boolean;\n children: React.ReactNode;\n size: ButtonSize;\n leftIcon: React.ReactNode;\n rightIcon: React.ReactNode;\n iconSizeClass: string;\n discount?: string;\n price?: string;\n fullWidth?: boolean;\n}) {\n if (loading) {\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(\n children as React.ReactElement<{ children?: React.ReactNode }>,\n undefined,\n <LoadingSpinner size={size} />,\n );\n }\n return (\n <>\n <LoadingSpinner size={size} />\n <span className=\"sr-only\">{children}</span>\n </>\n );\n }\n\n if (asChild) return children;\n\n return (\n <>\n {leftIcon && (\n <span\n className={cn(\"flex shrink-0 items-center justify-center\", iconSizeClass)}\n aria-hidden=\"true\"\n >\n {leftIcon}\n </span>\n )}\n {React.Children.map(children, (child) =>\n typeof child === \"string\" ? (\n child.trim() ? (\n <span className=\"min-w-0 truncate\">{child}</span>\n ) : null\n ) : typeof child === \"number\" ? (\n <span className=\"min-w-0 truncate\">{child}</span>\n ) : (\n child\n ),\n )}\n {rightIcon && (\n <span\n className={cn(\"flex shrink-0 items-center justify-center\", iconSizeClass)}\n aria-hidden=\"true\"\n >\n {rightIcon}\n </span>\n )}\n {(price || discount) && (\n <div>\n {discount && (\n <span className=\"typography-body-default-16px-regular line-through\" aria-hidden=\"true\">\n {discount}\n </span>\n )}\n {price && (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {price}\n </span>\n )}\n </div>\n )}\n </>\n );\n}\n\n/**\n * A versatile button component with multiple visual variants, sizes, icon\n * slots, loading state, and optional pricing display.\n *\n * Pass `negative` when rendering on an inverted surface to opt into the\n * inverted treatment for `primary`, `secondary`, `tertiary`, `outline` and\n * `brand` variants.\n *\n * The `brand` variant is the Figma \"Upsell\" button: a green radial fill with a\n * green glow and a highlight that circles the rim once. With `negative` it takes\n * the other theme's glow, made for the inverted surface. The highlight holds\n * still when the user prefers reduced motion. Keep it for upgrade and purchase\n * prompts. The fill is a gradient, so a `bg-*` class sits under it: recolour it\n * through `--fv-upsell-end`, or pair the class with `bg-none`.\n *\n * The `ai` variant ships with the AI sparkle icon baked in (locked at 16px\n * regardless of button size); pass `leftIcon` to override the default sparkle.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"40\" leftIcon={<StarIcon />}>\n * Continue\n * </Button>\n * ```\n */\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = \"primary\",\n size = \"40\",\n negative = false,\n leftIcon,\n rightIcon,\n loading = false,\n asChild = false,\n disabled,\n children,\n discount,\n price,\n fullWidth = false,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n const isDisabled = Boolean(disabled);\n const isInteractionDisabled = isDisabled || loading;\n const iconSizeClass = variant === \"ai\" ? \"[&>svg]:size-4\" : ICON_WRAPPER_CLASS[size];\n const effectiveLeftIcon = leftIcon ?? (variant === \"ai\" ? <AIIcon filled /> : undefined);\n const iconPaddingClasses = getIconPaddingClasses(\n size,\n Boolean(effectiveLeftIcon),\n Boolean(rightIcon),\n );\n\n const buttonSpecificProps = !asChild\n ? {\n type: \"button\" as const,\n \"data-testid\": \"button\",\n disabled: isInteractionDisabled,\n }\n : isInteractionDisabled\n ? { \"aria-disabled\": true }\n : {};\n\n const loadingLabelProps = loading && asChild ? { \"aria-label\": getTextContent(children) } : {};\n\n const content = renderContent({\n loading,\n asChild,\n children,\n size,\n leftIcon: effectiveLeftIcon,\n rightIcon,\n iconSizeClass,\n discount,\n price,\n });\n\n return (\n <Comp\n ref={ref}\n {...buttonSpecificProps}\n aria-busy={loading}\n {...loadingLabelProps}\n className={cn(\n \"inline-flex min-w-0 cursor-pointer items-center gap-2 whitespace-nowrap transition-colors\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n isInteractionDisabled && \"pointer-events-none cursor-not-allowed\",\n `${price ? \"justify-between\" : \"justify-center\"}`,\n fullWidth && \"w-full\",\n SIZE_CLASSES[size],\n iconPaddingClasses,\n getVariantClasses(variant, negative, isDisabled),\n className,\n )}\n {...props}\n >\n {content}\n </Comp>\n );\n },\n);\n\nButton.displayName = \"Button\";\n"],"names":["cn","React","jsx","SpinnerIcon","jsxs","Fragment","Slot","AIIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAM,8CAA8B,IAAmB;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,MAAM,eAA2C;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,4BAAiF;AAAA,EACrF,MAAM,EAAE,MAAM,QAAQ,OAAO,OAAA;AAAA,EAC7B,MAAM,EAAE,MAAM,QAAQ,OAAO,OAAA;AAAA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