@fanvue/ui 3.50.0 → 3.52.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 (77) hide show
  1. package/dist/charts.d.ts +7 -0
  2. package/dist/cjs/components/Button/Button.cjs +12 -8
  3. package/dist/cjs/components/Button/Button.cjs.map +1 -1
  4. package/dist/cjs/components/Chart/ChartCard.cjs +4 -3
  5. package/dist/cjs/components/Chart/ChartCard.cjs.map +1 -1
  6. package/dist/cjs/components/Dialog/Dialog.cjs +29 -2
  7. package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
  8. package/dist/cjs/components/Drawer/Drawer.cjs +72 -17
  9. package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
  10. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs +26 -7
  11. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs.map +1 -1
  12. package/dist/cjs/components/IconButton/IconButton.cjs +11 -2
  13. package/dist/cjs/components/IconButton/IconButton.cjs.map +1 -1
  14. package/dist/cjs/components/Icons/DocumentIcon.cjs +74 -0
  15. package/dist/cjs/components/Icons/DocumentIcon.cjs.map +1 -0
  16. package/dist/cjs/components/Icons/EpisodesIcon.cjs +65 -0
  17. package/dist/cjs/components/Icons/EpisodesIcon.cjs.map +1 -0
  18. package/dist/cjs/components/Icons/ShortsIcon.cjs +74 -0
  19. package/dist/cjs/components/Icons/ShortsIcon.cjs.map +1 -0
  20. package/dist/cjs/components/InfoBox/InfoBox.cjs +1 -1
  21. package/dist/cjs/components/InfoBox/InfoBox.cjs.map +1 -1
  22. package/dist/cjs/components/InlineEmptyState/InlineEmptyState.cjs +42 -0
  23. package/dist/cjs/components/InlineEmptyState/InlineEmptyState.cjs.map +1 -0
  24. package/dist/cjs/components/Link/Link.cjs +30 -7
  25. package/dist/cjs/components/Link/Link.cjs.map +1 -1
  26. package/dist/cjs/components/Pill/Pill.cjs +1 -1
  27. package/dist/cjs/components/Pill/Pill.cjs.map +1 -1
  28. package/dist/cjs/components/SegmentedControl/SegmentedControl.cjs +6 -10
  29. package/dist/cjs/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
  30. package/dist/cjs/components/SegmentedControl/segmentedControlClassNames.cjs +54 -0
  31. package/dist/cjs/components/SegmentedControl/segmentedControlClassNames.cjs.map +1 -0
  32. package/dist/cjs/components/Table/Table.cjs +31 -2
  33. package/dist/cjs/components/Table/Table.cjs.map +1 -1
  34. package/dist/cjs/components/Table/TableRowLink.cjs +55 -0
  35. package/dist/cjs/components/Table/TableRowLink.cjs.map +1 -0
  36. package/dist/cjs/index.cjs +10 -0
  37. package/dist/cjs/index.cjs.map +1 -1
  38. package/dist/components/Button/Button.mjs +12 -8
  39. package/dist/components/Button/Button.mjs.map +1 -1
  40. package/dist/components/Chart/ChartCard.mjs +4 -3
  41. package/dist/components/Chart/ChartCard.mjs.map +1 -1
  42. package/dist/components/Dialog/Dialog.mjs +29 -2
  43. package/dist/components/Dialog/Dialog.mjs.map +1 -1
  44. package/dist/components/Drawer/Drawer.mjs +72 -17
  45. package/dist/components/Drawer/Drawer.mjs.map +1 -1
  46. package/dist/components/DropdownMenu/DropdownMenuItem.mjs +26 -7
  47. package/dist/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -1
  48. package/dist/components/IconButton/IconButton.mjs +11 -2
  49. package/dist/components/IconButton/IconButton.mjs.map +1 -1
  50. package/dist/components/Icons/DocumentIcon.mjs +57 -0
  51. package/dist/components/Icons/DocumentIcon.mjs.map +1 -0
  52. package/dist/components/Icons/EpisodesIcon.mjs +48 -0
  53. package/dist/components/Icons/EpisodesIcon.mjs.map +1 -0
  54. package/dist/components/Icons/ShortsIcon.mjs +57 -0
  55. package/dist/components/Icons/ShortsIcon.mjs.map +1 -0
  56. package/dist/components/InfoBox/InfoBox.mjs +1 -1
  57. package/dist/components/InfoBox/InfoBox.mjs.map +1 -1
  58. package/dist/components/InlineEmptyState/InlineEmptyState.mjs +25 -0
  59. package/dist/components/InlineEmptyState/InlineEmptyState.mjs.map +1 -0
  60. package/dist/components/Link/Link.mjs +31 -8
  61. package/dist/components/Link/Link.mjs.map +1 -1
  62. package/dist/components/Pill/Pill.mjs +1 -1
  63. package/dist/components/Pill/Pill.mjs.map +1 -1
  64. package/dist/components/SegmentedControl/SegmentedControl.mjs +6 -10
  65. package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  66. package/dist/components/SegmentedControl/segmentedControlClassNames.mjs +54 -0
  67. package/dist/components/SegmentedControl/segmentedControlClassNames.mjs.map +1 -0
  68. package/dist/components/Table/Table.mjs +31 -2
  69. package/dist/components/Table/Table.mjs.map +1 -1
  70. package/dist/components/Table/TableRowLink.mjs +38 -0
  71. package/dist/components/Table/TableRowLink.mjs.map +1 -0
  72. package/dist/index.d.ts +204 -22
  73. package/dist/index.mjs +10 -0
  74. package/dist/index.mjs.map +1 -1
  75. package/dist/styles/base.css +157 -4
  76. package/dist/styles/theme.css +20 -12
  77. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenuItem.mjs","sources":["../../../src/components/DropdownMenu/DropdownMenuItem.tsx"],"sourcesContent":["import * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { MenuRowIcon } from \"../Icons/MenuRowIcon\";\nimport { DropdownMenuVariantContext, ToggleOpenContext } from \"./context\";\n\n/** Vertical placement of a {@link DropdownMenuLabel} within its group. */\nexport type DropdownMenuLabelPosition = \"default\" | \"top\";\n\n/** Props for the {@link DropdownMenuLabel} component. */\nexport interface DropdownMenuLabelProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {\n /**\n * Vertical placement within the surrounding group. `\"top\"` is used for the\n * first label directly under a header; `\"default\"` adds extra top padding to\n * separate it from preceding items. @default \"default\"\n */\n position?: DropdownMenuLabelPosition;\n}\n\n/** A non-interactive label that groups related items within a menu. */\nexport const DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n DropdownMenuLabelProps\n>(({ className, position = \"default\", ...props }, ref) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n const labelClassName = cn(\n \"typography-description-12px-regular flex items-center px-3 text-content-secondary\",\n position === \"top\" ? \"py-2\" : \"pt-4 pb-2\",\n className,\n );\n\n // DropdownMenuPrimitive.Label requires Radix menu context, unavailable when\n // the sheet variant renders inside a Drawer (Dialog) instead.\n if (variant === \"sheet\") {\n return <div ref={ref} className={labelClassName} {...props} />;\n }\n\n return <DropdownMenuPrimitive.Label ref={ref} className={labelClassName} {...props} />;\n});\nDropdownMenuLabel.displayName = \"DropdownMenuLabel\";\n\n/**\n * Height preset for a dropdown menu item.\n *\n * `\"40\"` (default) and `\"32\"` are the v2 numeric tokens that mirror the Figma\n * design system. `\"sm\"` and `\"md\"` are deprecated aliases retained for\n * backwards compatibility — `\"sm\"` maps to `\"32\"`, `\"md\"` maps to `\"40\"`.\n */\nexport type DropdownMenuItemSize =\n | \"40\"\n | \"32\"\n /** @deprecated Use `\"32\"` instead. */\n | \"sm\"\n /** @deprecated Use `\"40\"` instead. */\n | \"md\";\n\nconst SIZE_NORMALIZED: Record<DropdownMenuItemSize, \"40\" | \"32\"> = {\n \"40\": \"40\",\n md: \"40\",\n \"32\": \"32\",\n sm: \"32\",\n};\n\nconst ITEM_SIZE_CLASSES: Record<\"40\" | \"32\", string> = {\n \"40\": \"min-h-10 py-2 typography-body-small-14px-regular\",\n \"32\": \"min-h-8 py-[7px] typography-body-small-14px-regular\",\n};\n\n/*\n * 14px at both heights. `V2 Menu Item` draws the count as `Body Small 14px/Regular`\n * in `content-tertiary` (node `21542:8629`), and the 40 row previously stepped up to\n * 16px — which also put the count's line box at 24px against the two-line layout's\n * 18px title leading.\n *\n * Only the 40 row is drawn in Figma: the component set's variants are Type and State\n * with no size axis. The 32 row is ours, and 14px matches the body type it already\n * uses, so both entries agree by construction rather than by design reference.\n */\nconst ITEM_COUNT_TYPOGRAPHY: Record<\"40\" | \"32\", string> = {\n \"40\": \"typography-body-small-14px-regular\",\n \"32\": \"typography-body-small-14px-regular\",\n};\n\nexport interface DropdownMenuItemProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {\n /** Height of the menu item row. @default \"40\" */\n size?: DropdownMenuItemSize;\n /** Applies the destructive (error) treatment. Use for irreversible actions. @default false */\n destructive?: boolean;\n /**\n * Icon (or other node) rendered before the label. Ignored when {@link DropdownMenuItemProps.avatar} is set.\n * Icons sit in a 16px box in `Icons/Secondary`, and prop-based icons draw filled at 16px unless they set\n * `filled` or `size` themselves (`filled={false}` opts out). Legacy icons such as `TrashBinIcon` stay outlined.\n */\n leadingIcon?: React.ReactNode;\n /**\n * Leading avatar rendered in place of {@link DropdownMenuItemProps.leadingIcon},\n * for rows that represent a person or account. Pass an `Avatar` sized to `24`.\n * Takes precedence over `leadingIcon`.\n */\n avatar?: React.ReactNode;\n /**\n * Icon (or other node) rendered after the label. Treated like {@link DropdownMenuItemProps.leadingIcon}.\n */\n trailingIcon?: React.ReactNode;\n /** Trailing count or number (e.g. an unread total) rendered before {@link DropdownMenuItemProps.trailingIcon}. */\n count?: React.ReactNode;\n /**\n * Optional secondary text rendered on a second line below the label. When\n * provided, the row switches to a two-line layout and the leading/trailing\n * icons align to the title line (top) rather than the row's vertical centre.\n */\n description?: React.ReactNode;\n /** Marks the item as the current selection in a single-select menu. @default false */\n selected?: boolean;\n}\n\n/**\n * An individual item within a {@link DropdownMenuContent}.\n *\n * @example\n * ```tsx\n * <DropdownMenuItem>Edit profile</DropdownMenuItem>\n * <DropdownMenuItem destructive>Delete</DropdownMenuItem>\n * <DropdownMenuItem leadingIcon={<EditIcon />}>Edit</DropdownMenuItem>\n *\n * // Feature-rich row with an avatar and a trailing count\n * <DropdownMenuItem avatar={<Avatar size={24} src={src} />} count=\"12\">\n * Jane Doe\n * </DropdownMenuItem>\n *\n * // As a link\n * <DropdownMenuItem asChild>\n * <a href=\"/settings\">Settings</a>\n * </DropdownMenuItem>\n * ```\n */\nexport const DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuItemProps\n>(\n (\n {\n size = \"40\",\n destructive,\n leadingIcon,\n avatar,\n trailingIcon,\n count,\n description,\n selected,\n className,\n children,\n asChild,\n onSelect,\n disabled,\n ...props\n },\n ref,\n ) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n const toggleOpen = React.useContext(ToggleOpenContext);\n const normalizedSize = SIZE_NORMALIZED[size];\n const hasDescription = description != null;\n const hasAvatar = avatar != null;\n const itemClassName = cn(\n // `text-start` because the sheet variant renders the row as a <button>,\n // whose UA-centred text misaligned it from the popper variant's rows.\n \"group flex w-full cursor-pointer gap-2 rounded-sm px-3 text-start outline-none\",\n hasDescription ? \"items-start\" : \"items-center\",\n // The sheet's header runs the full width of the panel, so its rows have to\n // come in off the edge themselves — 4px here on the panel's own 4px gives the\n // same 8px inset as the popper panel. `w-auto` lets the column stretch them\n // to the space left over; `w-full` plus a margin would overflow.\n variant === \"sheet\" && \"mx-1 w-auto\",\n ITEM_SIZE_CLASSES[normalizedSize],\n // A 24px avatar would push the compact 32px row past its height with the\n // default padding; tighten it so the avatar variant keeps the 32px contract.\n hasAvatar && !hasDescription && normalizedSize === \"32\" && \"py-1\",\n \"data-[highlighted]:bg-interaction-hover\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:text-content-disabled\",\n \"disabled:cursor-not-allowed disabled:text-content-disabled\",\n // Sheet-variant asChild items are marked disabled via aria-disabled\n // (see below), not the native disabled attribute or Radix's\n // data-disabled — neither selector above matches them.\n \"aria-disabled:cursor-not-allowed aria-disabled:text-content-disabled\",\n destructive && \"text-error-content\",\n // Selected: the same `Interaction/Hover` fill as a highlighted row (library\n // node `23452:13432`), so the current value reads as the resting highlight.\n selected && \"bg-interaction-hover\",\n className,\n );\n // The selected row shares the hover fill, so it also carries the state in the\n // markup: `aria-current` for assistive tech and `data-selected` for styling.\n // A consumer that already exposes the state (e.g. `menuitemradio` with\n // `aria-checked`) keeps it, without a second `aria-current` on top.\n const selectedProps = selected\n ? {\n ...(props[\"aria-checked\"] === undefined && { \"aria-current\": \"true\" as const }),\n \"data-selected\": \"\",\n }\n : undefined;\n\n // In the two-line (description) layout everything beside the title sits on\n // the title's line, not the centre of the two-line block. A box the height of\n // that line centres each sibling on it whatever its own size — a 16px icon, a\n // 24px avatar, or the count's larger text box. The height is the title's, from\n // `typography-body-small-14px-semibold`; a `pt-*` nudge cannot do this because\n // the correct offset differs per sibling, and the previous `pt-1` was computed\n // against the single-line title's 24px leading, leaving all four 3px low.\n const iconAlignClassName = hasDescription ? \"flex h-4.5 shrink-0 items-center\" : null;\n\n const countNode = count != null && (\n <span\n className={cn(\n \"shrink-0 tabular-nums\",\n iconAlignClassName,\n ITEM_COUNT_TYPOGRAPHY[normalizedSize],\n destructive ? \"text-error-content\" : \"text-content-tertiary\",\n \"group-data-[disabled]:text-content-disabled\",\n )}\n >\n {count}\n </span>\n );\n\n // Destructive rows keep the row's error colour on their icons.\n const renderIcon = (icon: React.ReactNode, className?: string) => (\n <MenuRowIcon inheritColor={destructive} alignToTitle={hasDescription} className={className}>\n {icon}\n </MenuRowIcon>\n );\n const leadingNode = leadingIcon != null && renderIcon(leadingIcon);\n\n // In an asChild row the consumer's children have no flex-1 wrapper, so `ms-auto`\n // pushes the trailing icon to the row's end.\n const trailingNode =\n trailingIcon != null && renderIcon(trailingIcon, asChild ? \"ms-auto\" : undefined);\n\n const itemChildren = (\n <>\n {avatar != null ? (\n <span className={cn(\"shrink-0\", iconAlignClassName)}>{avatar}</span>\n ) : (\n leadingNode\n )}\n {hasDescription ? (\n <span className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n {/*\n * The two-line row sets its own title type rather than inheriting the\n * row's: `V2 Menu Item` pairs a 14px semibold title with the 14px\n * regular description below it, where a single-line row's title is the\n * size's own 14px regular. It also settles the row's height — 18 + 2 +\n * 18 of text inside `py-2` is the design's 54px.\n */}\n <span className=\"typography-body-small-14px-semibold truncate\">{children}</span>\n <span className=\"typography-body-small-14px-regular truncate text-content-secondary\">\n {description}\n </span>\n </span>\n ) : (\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n )}\n {countNode}\n {trailingNode}\n </>\n );\n\n // The sheet variant renders inside a Drawer (Dialog), not a Radix menu, so\n // DropdownMenuPrimitive.Item (which requires menu context) can't be used —\n // render a plain option element with equivalent selection semantics instead.\n // asChild goes through the same Slot primitive Radix's own Item uses\n // internally, so a custom element (e.g. a link) gets the option\n // role/handlers merged onto it without needing menu context.\n if (variant === \"sheet\") {\n const Comp = asChild ? Slot : \"button\";\n // Pull the consumer's onClick out of the passthrough spread so the\n // handler below can compose with it instead of the spread order\n // silently overwriting it (an explicit onClick after {...props} always\n // wins over the spread's).\n const { onClick: consumerOnClick, ...restProps } =\n props as React.ComponentPropsWithoutRef<\"button\">;\n const sheetSpecificProps = !asChild\n ? { type: \"button\" as const, disabled }\n : disabled\n ? { \"aria-disabled\": true }\n : {};\n return (\n <Comp\n ref={ref as React.Ref<HTMLButtonElement>}\n {...restProps}\n {...sheetSpecificProps}\n role=\"option\"\n aria-selected={selected}\n data-selected={selected ? \"\" : undefined}\n className={itemClassName}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n // A native <button disabled> already blocks its click event, but\n // asChild's element (e.g. a link) has no such enforcement — guard\n // explicitly, and prevent the click's default action (e.g. anchor\n // navigation) since aria-disabled alone doesn't stop it.\n if (disabled) {\n event.preventDefault();\n return;\n }\n consumerOnClick?.(event);\n if (event.defaultPrevented) return;\n // Pass the real native event through, not a fake partial shape —\n // handlers that call any Event API beyond preventDefault (e.g.\n // stopPropagation, composedPath) need it to actually exist. It's\n // still live (currentTarget/target are valid) since we're inside\n // the same synchronous click handler that produced it.\n onSelect?.(event.nativeEvent);\n if (!event.nativeEvent.defaultPrevented) toggleOpen?.(() => false);\n }}\n >\n {asChild\n ? [leadingNode, <Slottable key=\"children\">{children}</Slottable>, trailingNode]\n : itemChildren}\n </Comp>\n );\n }\n\n if (asChild) {\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n asChild\n className={itemClassName}\n disabled={disabled}\n onSelect={onSelect}\n {...selectedProps}\n {...props}\n >\n {/* The icons slot into the consumer's element (e.g. a link) around its own children. */}\n <Slot>\n {leadingNode}\n <Slottable>{children}</Slottable>\n {trailingNode}\n </Slot>\n </DropdownMenuPrimitive.Item>\n );\n }\n\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={itemClassName}\n disabled={disabled}\n onSelect={onSelect}\n {...selectedProps}\n {...props}\n >\n {itemChildren}\n </DropdownMenuPrimitive.Item>\n );\n },\n);\nDropdownMenuItem.displayName = \"DropdownMenuItem\";\n\n/** Props for the {@link DropdownMenuSeparator} component. */\nexport interface DropdownMenuSeparatorProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator> {}\n\n/** Visual separator between groups of items. */\nexport const DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n const separatorClassName = cn(\"my-1 h-px bg-neutral-alphas-200\", className);\n\n // DropdownMenuPrimitive.Separator requires Radix menu context, unavailable\n // when the sheet variant renders inside a Drawer (Dialog) instead. <hr> is a\n // native separator, so it needs no ARIA role.\n if (variant === \"sheet\") {\n return <hr ref={ref as React.Ref<HTMLHRElement>} className={separatorClassName} {...props} />;\n }\n\n return <DropdownMenuPrimitive.Separator ref={ref} className={separatorClassName} {...props} />;\n});\nDropdownMenuSeparator.displayName = \"DropdownMenuSeparator\";\n"],"names":["className"],"mappings":";;;;;;;;AAsBO,MAAM,oBAAoB,MAAM,WAGrC,CAAC,EAAE,WAAW,WAAW,WAAW,GAAG,MAAA,GAAS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AAS;AAK1E,MAAI,YAAY,SAAS;AACvB,+BAAQ,MAAA,EAAG,KAAsC,WAAW,oBAAqB,GAAG,OAAO;AAAA,EAC7F;AAEA,SAAO,oBAAC,sBAAsB,WAAtB,EAAgC,KAAU,WAAW,oBAAqB,GAAG,OAAO;AAC9F,CAAC;AACD,sBAAsB,cAAc;"}
1
+ {"version":3,"file":"DropdownMenuItem.mjs","sources":["../../../src/components/DropdownMenu/DropdownMenuItem.tsx"],"sourcesContent":["import * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { MenuRowIcon } from \"../Icons/MenuRowIcon\";\nimport { DropdownMenuVariantContext, ToggleOpenContext } from \"./context\";\n\n/** Vertical placement of a {@link DropdownMenuLabel} within its group. */\nexport type DropdownMenuLabelPosition = \"default\" | \"top\";\n\n/** Props for the {@link DropdownMenuLabel} component. */\nexport interface DropdownMenuLabelProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {\n /**\n * Vertical placement within the surrounding group. `\"top\"` is used for the\n * first label directly under a header; `\"default\"` adds extra top padding to\n * separate it from preceding items. @default \"default\"\n */\n position?: DropdownMenuLabelPosition;\n}\n\n/** A non-interactive label that groups related items within a menu. */\nexport const DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n DropdownMenuLabelProps\n>(({ className, position = \"default\", ...props }, ref) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n const labelClassName = cn(\n \"typography-description-12px-regular flex items-center px-3 text-content-secondary\",\n position === \"top\" ? \"py-2\" : \"pt-4 pb-2\",\n className,\n );\n\n // DropdownMenuPrimitive.Label requires Radix menu context, unavailable when\n // the sheet variant renders inside a Drawer (Dialog) instead.\n if (variant === \"sheet\") {\n return <div ref={ref} className={labelClassName} {...props} />;\n }\n\n return <DropdownMenuPrimitive.Label ref={ref} className={labelClassName} {...props} />;\n});\nDropdownMenuLabel.displayName = \"DropdownMenuLabel\";\n\n/**\n * Height preset for a dropdown menu item.\n *\n * `\"40\"` (default) and `\"32\"` are the v2 numeric tokens that mirror the Figma\n * design system. `\"sm\"` and `\"md\"` are deprecated aliases retained for\n * backwards compatibility — `\"sm\"` maps to `\"32\"`, `\"md\"` maps to `\"40\"`.\n */\nexport type DropdownMenuItemSize =\n | \"40\"\n | \"32\"\n /** @deprecated Use `\"32\"` instead. */\n | \"sm\"\n /** @deprecated Use `\"40\"` instead. */\n | \"md\";\n\nconst SIZE_NORMALIZED: Record<DropdownMenuItemSize, \"40\" | \"32\"> = {\n \"40\": \"40\",\n md: \"40\",\n \"32\": \"32\",\n sm: \"32\",\n};\n\nconst ITEM_SIZE_CLASSES: Record<\"40\" | \"32\", string> = {\n \"40\": \"min-h-10 py-2 typography-body-small-14px-regular\",\n \"32\": \"min-h-8 py-[7px] typography-body-small-14px-regular\",\n};\n\n/*\n * 14px at both heights. `V2 Menu Item` draws the count as `Body Small 14px/Regular`\n * in `content-tertiary` (node `21542:8629`), and the 40 row previously stepped up to\n * 16px — which also put the count's line box at 24px against the two-line layout's\n * 18px title leading.\n *\n * Only the 40 row is drawn in Figma: the component set's variants are Type and State\n * with no size axis. The 32 row is ours, and 14px matches the body type it already\n * uses, so both entries agree by construction rather than by design reference.\n */\nconst ITEM_COUNT_TYPOGRAPHY: Record<\"40\" | \"32\", string> = {\n \"40\": \"typography-body-small-14px-regular\",\n \"32\": \"typography-body-small-14px-regular\",\n};\n\nexport interface DropdownMenuItemProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {\n /** Height of the menu item row. @default \"40\" */\n size?: DropdownMenuItemSize;\n /** Applies the destructive (error) treatment. Use for irreversible actions. @default false */\n destructive?: boolean;\n /**\n * Icon (or other node) rendered before the label. Ignored when {@link DropdownMenuItemProps.avatar} is set.\n * Icons sit in a 16px box in `Icons/Secondary`, and prop-based icons draw filled at 16px unless they set\n * `filled` or `size` themselves (`filled={false}` opts out). Legacy icons such as `TrashBinIcon` stay outlined.\n */\n leadingIcon?: React.ReactNode;\n /**\n * Leading avatar rendered in place of {@link DropdownMenuItemProps.leadingIcon},\n * for rows that represent a person or account. Pass an `Avatar` sized to `24`.\n * Takes precedence over `leadingIcon`.\n */\n avatar?: React.ReactNode;\n /**\n * Icon (or other node) rendered after the label. Treated like {@link DropdownMenuItemProps.leadingIcon}.\n */\n trailingIcon?: React.ReactNode;\n /** Trailing count or number (e.g. an unread total) rendered before {@link DropdownMenuItemProps.trailingIcon}. */\n count?: React.ReactNode;\n /**\n * A small action drawn at the row's end, after everything else — typically a 24px\n * `Button` rendered `asChild` as a span. The whole row performs the action through\n * `onSelect`, so pass a visual, never a second interactive control. Its text joins the\n * row's accessible name, so the label people see is also the one they can speak.\n * The row does not restyle it: when the row is `disabled`, disable the visual too\n * (or show its `loading` state) so it does not look live.\n */\n trailingAction?: React.ReactNode;\n /**\n * Optional secondary text rendered on a second line below the label. When\n * provided, the row switches to a two-line layout and the leading/trailing\n * icons align to the title line (top) rather than the row's vertical centre.\n */\n description?: React.ReactNode;\n /** Marks the item as the current selection in a single-select menu. @default false */\n selected?: boolean;\n}\n\n/**\n * An individual item within a {@link DropdownMenuContent}.\n *\n * @example\n * ```tsx\n * <DropdownMenuItem>Edit profile</DropdownMenuItem>\n * <DropdownMenuItem destructive>Delete</DropdownMenuItem>\n * <DropdownMenuItem leadingIcon={<EditIcon />}>Edit</DropdownMenuItem>\n *\n * // Feature-rich row with an avatar and a trailing count\n * <DropdownMenuItem avatar={<Avatar size={24} src={src} />} count=\"12\">\n * Jane Doe\n * </DropdownMenuItem>\n *\n * // As a link\n * <DropdownMenuItem asChild>\n * <a href=\"/settings\">Settings</a>\n * </DropdownMenuItem>\n * ```\n */\nexport const DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n DropdownMenuItemProps\n>(\n (\n {\n size = \"40\",\n destructive,\n leadingIcon,\n avatar,\n trailingIcon,\n count,\n trailingAction,\n description,\n selected,\n className,\n children,\n asChild,\n onSelect,\n disabled,\n ...props\n },\n ref,\n ) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n const toggleOpen = React.useContext(ToggleOpenContext);\n const normalizedSize = SIZE_NORMALIZED[size];\n const hasDescription = description != null;\n const hasAvatar = avatar != null;\n const itemClassName = cn(\n // `text-start` because the sheet variant renders the row as a <button>,\n // whose UA-centred text misaligned it from the popper variant's rows.\n \"group flex w-full cursor-pointer gap-2 rounded-sm px-3 text-start outline-none\",\n hasDescription ? \"items-start\" : \"items-center\",\n // The sheet's header runs the full width of the panel, so its rows have to\n // come in off the edge themselves — 4px here on the panel's own 4px gives the\n // same 8px inset as the popper panel. `w-auto` lets the column stretch them\n // to the space left over; `w-full` plus a margin would overflow.\n variant === \"sheet\" && \"mx-1 w-auto\",\n ITEM_SIZE_CLASSES[normalizedSize],\n // A 24px avatar or trailing action would push the compact 32px row past its\n // height with the default padding; tighten it so the row keeps the 32px contract.\n (hasAvatar || trailingAction != null) && !hasDescription && normalizedSize === \"32\" && \"py-1\",\n \"data-[highlighted]:bg-interaction-hover\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:text-content-disabled\",\n \"disabled:cursor-not-allowed disabled:text-content-disabled\",\n // Sheet-variant asChild items are marked disabled via aria-disabled\n // (see below), not the native disabled attribute or Radix's\n // data-disabled — neither selector above matches them.\n \"aria-disabled:cursor-not-allowed aria-disabled:text-content-disabled\",\n destructive && \"text-error-content\",\n // Selected: the same `Interaction/Hover` fill as a highlighted row (library\n // node `23452:13432`), so the current value reads as the resting highlight.\n selected && \"bg-interaction-hover\",\n className,\n );\n // The selected row shares the hover fill, so it also carries the state in the\n // markup: `aria-current` for assistive tech and `data-selected` for styling.\n // A consumer that already exposes the state (e.g. `menuitemradio` with\n // `aria-checked`) keeps it, without a second `aria-current` on top.\n const selectedProps = selected\n ? {\n ...(props[\"aria-checked\"] === undefined && { \"aria-current\": \"true\" as const }),\n \"data-selected\": \"\",\n }\n : undefined;\n\n // In the two-line (description) layout everything beside the title sits on\n // the title's line, not the centre of the two-line block. A box the height of\n // that line centres each sibling on it whatever its own size — a 16px icon, a\n // 24px avatar, or the count's larger text box. The height is the title's, from\n // `typography-body-small-14px-semibold`; a `pt-*` nudge cannot do this because\n // the correct offset differs per sibling, and the previous `pt-1` was computed\n // against the single-line title's 24px leading, leaving all four 3px low.\n const iconAlignClassName = hasDescription ? \"flex h-4.5 shrink-0 items-center\" : null;\n\n const countNode = count != null && (\n <span\n className={cn(\n \"shrink-0 tabular-nums\",\n iconAlignClassName,\n ITEM_COUNT_TYPOGRAPHY[normalizedSize],\n destructive ? \"text-error-content\" : \"text-content-tertiary\",\n \"group-data-[disabled]:text-content-disabled\",\n )}\n >\n {count}\n </span>\n );\n\n // Destructive rows keep the row's error colour on their icons.\n const renderIcon = (icon: React.ReactNode, className?: string) => (\n <MenuRowIcon inheritColor={destructive} alignToTitle={hasDescription} className={className}>\n {icon}\n </MenuRowIcon>\n );\n const leadingNode = leadingIcon != null && renderIcon(leadingIcon);\n\n // In an asChild row the consumer's children have no flex-1 wrapper, so `ms-auto`\n // pushes the trailing icon to the row's end.\n const trailingNode =\n trailingIcon != null && renderIcon(trailingIcon, asChild ? \"ms-auto\" : undefined);\n const trailingActionNode = trailingAction != null && (\n <span\n className={cn(\n \"flex shrink-0 items-center\",\n iconAlignClassName,\n asChild && trailingIcon == null && \"ms-auto\",\n )}\n >\n {trailingAction}\n </span>\n );\n\n const itemChildren = (\n <>\n {avatar != null ? (\n <span className={cn(\"shrink-0\", iconAlignClassName)}>{avatar}</span>\n ) : (\n leadingNode\n )}\n {hasDescription ? (\n <span className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n {/*\n * The two-line row sets its own title type rather than inheriting the\n * row's: `V2 Menu Item` pairs a 14px semibold title with the 14px\n * regular description below it, where a single-line row's title is the\n * size's own 14px regular. It also settles the row's height — 18 + 2 +\n * 18 of text inside `py-2` is the design's 54px.\n */}\n <span className=\"typography-body-small-14px-semibold truncate\">{children}</span>\n <span className=\"typography-body-small-14px-regular truncate text-content-secondary\">\n {description}\n </span>\n </span>\n ) : (\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n )}\n {countNode}\n {trailingNode}\n {trailingActionNode}\n </>\n );\n\n // The sheet variant renders inside a Drawer (Dialog), not a Radix menu, so\n // DropdownMenuPrimitive.Item (which requires menu context) can't be used —\n // render a plain option element with equivalent selection semantics instead.\n // asChild goes through the same Slot primitive Radix's own Item uses\n // internally, so a custom element (e.g. a link) gets the option\n // role/handlers merged onto it without needing menu context.\n if (variant === \"sheet\") {\n const Comp = asChild ? Slot : \"button\";\n // Pull the consumer's onClick out of the passthrough spread so the\n // handler below can compose with it instead of the spread order\n // silently overwriting it (an explicit onClick after {...props} always\n // wins over the spread's).\n const { onClick: consumerOnClick, ...restProps } =\n props as React.ComponentPropsWithoutRef<\"button\">;\n const sheetSpecificProps = !asChild\n ? { type: \"button\" as const, disabled }\n : disabled\n ? { \"aria-disabled\": true }\n : {};\n return (\n <Comp\n ref={ref as React.Ref<HTMLButtonElement>}\n {...restProps}\n {...sheetSpecificProps}\n role=\"option\"\n aria-selected={selected}\n data-selected={selected ? \"\" : undefined}\n className={itemClassName}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n // A native <button disabled> already blocks its click event, but\n // asChild's element (e.g. a link) has no such enforcement — guard\n // explicitly, and prevent the click's default action (e.g. anchor\n // navigation) since aria-disabled alone doesn't stop it.\n if (disabled) {\n event.preventDefault();\n return;\n }\n consumerOnClick?.(event);\n if (event.defaultPrevented) return;\n // Pass the real native event through, not a fake partial shape —\n // handlers that call any Event API beyond preventDefault (e.g.\n // stopPropagation, composedPath) need it to actually exist. It's\n // still live (currentTarget/target are valid) since we're inside\n // the same synchronous click handler that produced it.\n onSelect?.(event.nativeEvent);\n if (!event.nativeEvent.defaultPrevented) toggleOpen?.(() => false);\n }}\n >\n {asChild\n ? [\n leadingNode,\n <Slottable key=\"children\">{children}</Slottable>,\n trailingNode,\n trailingActionNode,\n ]\n : itemChildren}\n </Comp>\n );\n }\n\n if (asChild) {\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n asChild\n className={itemClassName}\n disabled={disabled}\n onSelect={onSelect}\n {...selectedProps}\n {...props}\n >\n {/* The icons slot into the consumer's element (e.g. a link) around its own children. */}\n <Slot>\n {leadingNode}\n <Slottable>{children}</Slottable>\n {trailingNode}\n {trailingActionNode}\n </Slot>\n </DropdownMenuPrimitive.Item>\n );\n }\n\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={itemClassName}\n disabled={disabled}\n onSelect={onSelect}\n {...selectedProps}\n {...props}\n >\n {itemChildren}\n </DropdownMenuPrimitive.Item>\n );\n },\n);\nDropdownMenuItem.displayName = \"DropdownMenuItem\";\n\n/** Props for the {@link DropdownMenuSeparator} component. */\nexport interface DropdownMenuSeparatorProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator> {}\n\n/** Visual separator between groups of items. */\nexport const DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, ref) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n // border-0 resets the currentColor border-top that preflight gives <hr>,\n // which would otherwise draw a second line on the sheet variant.\n const separatorClassName = cn(\"my-1 h-px border-0 bg-neutral-alphas-200\", className);\n\n // DropdownMenuPrimitive.Separator requires Radix menu context, unavailable\n // when the sheet variant renders inside a Drawer (Dialog) instead. <hr> is a\n // native separator, so it needs no ARIA role.\n if (variant === \"sheet\") {\n return <hr ref={ref as React.Ref<HTMLHRElement>} className={separatorClassName} {...props} />;\n }\n\n return <DropdownMenuPrimitive.Separator ref={ref} className={separatorClassName} {...props} />;\n});\nDropdownMenuSeparator.displayName = \"DropdownMenuSeparator\";\n"],"names":["className"],"mappings":";;;;;;;;AAsBO,MAAM,oBAAoB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sBAAsB;AAAA,MAAtB;AAAA,QACC;AAAA,QACA,WAAW;AAAA,QACX;AAAA,QACA;AAAA,QACC,GAAG;AAAA,QACH,GAAG;AAAA,QAEH,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AACA,iBAAiB,cAAc;AAOxB,MAAM,wBAAwB,MAAM,WAGzC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAAQ;AAClC,QAAM,UAAU,MAAM,WAAW,0BAA0B;AAG3D,QAAM,qBAAqB,GAAG,4CAA4C,SAAS;AAKnF,MAAI,YAAY,SAAS;AACvB,+BAAQ,MAAA,EAAG,KAAsC,WAAW,oBAAqB,GAAG,OAAO;AAAA,EAC7F;AAEA,SAAO,oBAAC,sBAAsB,WAAtB,EAAgC,KAAU,WAAW,oBAAqB,GAAG,OAAO;AAC9F,CAAC;AACD,sBAAsB,cAAc;"}
@@ -36,16 +36,19 @@ const SIZE_DRIVEN_SHAPE_VARIANTS = /* @__PURE__ */ new Set([
36
36
  "error",
37
37
  "white",
38
38
  "black",
39
+ "upsell",
39
40
  "overlay"
40
41
  ]);
41
42
  const NEGATIVE_AWARE_VARIANTS = /* @__PURE__ */ new Set([
42
43
  "primary",
43
44
  "secondary",
44
45
  "tertiary",
45
- "outline"
46
+ "outline",
47
+ "upsell"
46
48
  ]);
47
49
  const DISABLED_FILL = "disabled:bg-buttons-disabled-default disabled:text-content-disabled";
48
50
  const DISABLED_FILL_NEGATIVE = "disabled:bg-buttons-disabled-negative disabled:text-content-disabled";
51
+ const UPSELL = "fv-upsell fv-upsell-shine bg-buttons-brand-default text-content-always-black not-disabled:hover:[--fv-upsell-end:var(--color-buttons-brand-hover)] not-disabled:active:[--fv-upsell-end:var(--color-buttons-brand-hover)]";
49
52
  const DISABLED_TRANSPARENT = "disabled:text-content-disabled";
50
53
  const DISABLED_OPACITY = "disabled:opacity-50";
51
54
  const VARIANT_CLASSES = {
@@ -89,6 +92,12 @@ const VARIANT_CLASSES = {
89
92
  default: "bg-content-always-black text-brand-primary-default hover:bg-brand-primary-default hover:text-content-always-black not-disabled:active:bg-brand-primary-default not-disabled:active:text-content-always-black",
90
93
  disabled: DISABLED_OPACITY
91
94
  },
95
+ upsell: {
96
+ default: UPSELL,
97
+ negative: `${UPSELL} fv-upsell-negative`,
98
+ disabled: DISABLED_FILL,
99
+ negativeDisabled: DISABLED_FILL_NEGATIVE
100
+ },
92
101
  contrast: {
93
102
  default: "bg-transparent text-content-always-white hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted",
94
103
  disabled: DISABLED_OPACITY
@@ -185,7 +194,7 @@ const IconButton = React.forwardRef(
185
194
  value: counterValue,
186
195
  variant: "alert",
187
196
  size: countSizeMap[size],
188
- className: "absolute -top-0.5 -right-0.5"
197
+ className: "absolute -top-0.5 -right-0.5 z-10"
189
198
  }
190
199
  )
191
200
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.mjs","sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Count, type CountSize } from \"../Count/Count\";\nimport { IconDefaultsContext, NO_ICON_DEFAULTS } from \"../Icons/IconDefaults\";\n\n/**\n * Visual style variant of the icon button.\n *\n * `primary`, `secondary`, `tertiary`, `outline`, `error`, `white` and `black`\n * use the shared button colour tokens and a size-driven shape (squared at the\n * `24` size, circular otherwise). Of these, `primary`, `secondary`, `tertiary`\n * and `outline` also honour the {@link IconButtonProps.negative} prop.\n *\n * `overlay` is a translucent dark fill with a backdrop blur, for buttons that sit\n * on photos or video. Its fill and icon look the same in light and dark themes, while\n * the keyboard focus ring still follows the theme. It takes the same size-driven\n * shape as the standard variants.\n *\n * `brand`, `contrast`, `messaging`, `navTray`, `tertiaryDestructive`, `stop` and\n * `microphone` are bespoke variants that stay circular at every size.\n */\nexport type IconButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"outline\"\n | \"error\"\n | \"white\"\n | \"black\"\n | \"brand\"\n | \"contrast\"\n | \"messaging\"\n | \"navTray\"\n | \"tertiaryDestructive\"\n | \"stop\"\n | \"microphone\"\n | \"overlay\"\n | \"field\";\n\n/** Icon button size in pixels. */\nexport type IconButtonSize = \"24\" | \"32\" | \"40\" | \"48\" | \"52\" | \"72\";\n\nconst iconSizeVariants: Record<IconButtonSize, string> = {\n 24: \"[&>svg]:size-4\",\n 32: \"[&>svg]:size-4\",\n 40: \"[&>svg]:size-4\",\n 48: \"[&>svg]:size-6\",\n 52: \"[&>svg]:size-7\",\n 72: \"[&>svg]:size-8\",\n};\n\nconst sizeVariants: Record<IconButtonSize, string> = {\n 24: \"size-6 p-1\",\n 32: \"size-8 p-1.5\",\n 40: \"size-10 p-[10px]\",\n 48: \"size-12 p-3\",\n 52: \"size-[52px] p-2\",\n 72: \"size-[72px] p-4\",\n};\n\nconst countSizeMap: Record<IconButtonSize, CountSize> = {\n 24: \"16\",\n 32: \"24\",\n 40: \"32\",\n 48: \"32\",\n 52: \"32\",\n 72: \"32\",\n};\n\n/**\n * Variants whose corner radius is size-driven (see {@link IconButton}): the `24`\n * size is squared (`rounded-xs`), every larger size stays circular. All other\n * variants are circular at every size.\n */\nconst SIZE_DRIVEN_SHAPE_VARIANTS = new Set<IconButtonVariant>([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"outline\",\n \"error\",\n \"white\",\n \"black\",\n \"overlay\",\n]);\n\n/** Variants that honour the `negative` (dark-surface) treatment. */\nconst NEGATIVE_AWARE_VARIANTS = new Set<IconButtonVariant>([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"outline\",\n]);\n\nconst DISABLED_FILL = \"disabled:bg-buttons-disabled-default disabled:text-content-disabled\";\nconst DISABLED_FILL_NEGATIVE =\n \"disabled:bg-buttons-disabled-negative disabled:text-content-disabled\";\nconst DISABLED_TRANSPARENT = \"disabled:text-content-disabled\";\nconst DISABLED_OPACITY = \"disabled:opacity-50\";\n\ntype VariantClasses = {\n default: string;\n disabled: string;\n negative?: string;\n negativeDisabled?: string;\n};\n\n/**\n * Icon button styling for every variant. The disabled treatment is expressed\n * with the CSS `disabled:` variant (not the `disabled` prop) so an ancestor\n * `<fieldset disabled>` is styled too; hover is guarded with `not-disabled:` so\n * it never fights the disabled state.\n */\nconst VARIANT_CLASSES: Record<IconButtonVariant, VariantClasses> = {\n primary: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted not-disabled:hover:bg-buttons-primary-hover not-disabled:active:bg-buttons-primary-hover\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-primary-negative-default text-content-primary not-disabled:hover:bg-buttons-primary-negative-hover not-disabled:active:bg-buttons-primary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n secondary: {\n default:\n \"bg-buttons-secondary-default text-content-primary not-disabled:hover:bg-buttons-secondary-hover not-disabled:active:bg-buttons-secondary-hover\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-secondary-negative-default text-content-primary-inverted not-disabled:hover:bg-buttons-secondary-negative-hover not-disabled:active:bg-buttons-secondary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n tertiary: {\n default:\n \"bg-transparent text-content-primary not-disabled:hover:bg-buttons-tertiary-hover not-disabled:active:bg-buttons-tertiary-hover\",\n disabled: DISABLED_TRANSPARENT,\n negative:\n \"bg-transparent text-content-primary-inverted not-disabled:hover:bg-buttons-tertiary-negative-hover not-disabled: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 not-disabled:hover:bg-buttons-outline-hover not-disabled:active:bg-buttons-outline-hover\",\n disabled: \"disabled:border-buttons-disabled-default disabled:text-content-disabled\",\n negative:\n \"border border-buttons-outline-negative-default bg-transparent text-content-primary-inverted not-disabled:hover:bg-buttons-outline-negative-hover not-disabled:active:bg-buttons-outline-negative-hover\",\n negativeDisabled: \"disabled:border-buttons-disabled-negative disabled:text-content-disabled\",\n },\n error: {\n default:\n \"bg-buttons-error-default text-content-always-white not-disabled:hover:bg-buttons-error-hover not-disabled:active:bg-buttons-error-hover\",\n disabled: DISABLED_FILL,\n },\n white: {\n default:\n \"bg-buttons-always-white-default text-content-always-black not-disabled:hover:bg-buttons-always-white-hover not-disabled:active:bg-buttons-always-white-hover\",\n disabled: DISABLED_FILL,\n },\n black: {\n default:\n \"bg-buttons-always-black-default text-content-always-white not-disabled:hover:bg-buttons-always-black-hover not-disabled:active:bg-buttons-always-black-hover\",\n disabled: DISABLED_FILL,\n },\n brand: {\n default:\n \"bg-content-always-black text-brand-primary-default hover:bg-brand-primary-default hover:text-content-always-black not-disabled:active:bg-brand-primary-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n contrast: {\n default:\n \"bg-transparent text-content-always-white hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted\",\n disabled: DISABLED_OPACITY,\n },\n messaging: {\n default:\n \"bg-content-always-black text-brand-primary-default hover:bg-brand-primary-default hover:text-content-always-black not-disabled:active:bg-brand-primary-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n navTray: {\n default:\n \"bg-transparent text-content-primary hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted\",\n disabled: DISABLED_OPACITY,\n },\n tertiaryDestructive: {\n default:\n \"bg-transparent text-error-content hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted\",\n disabled: DISABLED_OPACITY,\n },\n stop: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted hover:bg-buttons-brand-default hover:text-content-always-black not-disabled:active:bg-buttons-brand-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n microphone: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted hover:bg-buttons-brand-default hover:text-content-always-black not-disabled:active:bg-buttons-brand-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n overlay: {\n default:\n \"bg-buttons-overlay-default text-content-always-white backdrop-blur-sm not-disabled:hover:bg-buttons-overlay-hover not-disabled:active:bg-buttons-overlay-hover\",\n disabled: DISABLED_OPACITY,\n },\n // Carries the input surface rather than a button one, so an icon-only action can\n // sit flush in a row of fields (Figma draws these as a `V2 Input Fields` instance\n // with only an icon inside). Border and hover match the Select trigger it lines up\n // with, so the row reads as one control group.\n field: {\n default:\n \"border border-border-primary bg-inputs-inputs-primary text-content-primary not-disabled:hover:border-neutral-alphas-400\",\n disabled: DISABLED_TRANSPARENT,\n },\n};\n\nfunction getVariantClasses(variant: IconButtonVariant, negative: boolean): string {\n const classes = VARIANT_CLASSES[variant];\n const isNegative = NEGATIVE_AWARE_VARIANTS.has(variant) && negative;\n const base = (isNegative && classes.negative) || classes.default;\n const disabledClasses = (isNegative && classes.negativeDisabled) || classes.disabled;\n return cn(base, disabledClasses);\n}\n\nexport interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant of the icon button. @default \"primary\" */\n variant?: IconButtonVariant;\n /** Size of the button in pixels. @default \"40\" */\n size?: IconButtonSize;\n /** Icon element to render inside the button. */\n icon: React.ReactNode;\n /**\n * Forces the dark-surface treatment regardless of theme. Only honoured on the\n * `primary`, `secondary`, `tertiary`, and `outline` variants. @default false\n */\n negative?: boolean;\n /** When provided, displays a {@link Count} badge at the top-right corner. */\n counterValue?: number;\n}\n\n/**\n * A button containing only an icon. Use when an action can be represented by an\n * icon alone (e.g. close, send). Always pair with an `aria-label` for\n * accessibility.\n *\n * Shape is size-driven for the standard variants and `overlay`: the `24` size is\n * squared (`rounded-xs`), every larger size is circular. Bespoke variants (`brand`,\n * `contrast`, `messaging`, `navTray`, `tertiaryDestructive`, `stop`,\n * `microphone`) stay circular at all sizes. `field` is the exception that is\n * never circular — it takes the inputs' `rounded-sm` so it matches the fields it\n * sits beside. Use it at `32`, `40` or `48`: those are the sizes `Select` offers,\n * and the variant only earns its surface when it lines up with one.\n *\n * @example\n * ```tsx\n * <IconButton icon={<CloseIcon />} aria-label=\"Close\" variant=\"tertiary\" />\n * ```\n */\nexport const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n className,\n variant = \"primary\",\n size = \"40\",\n icon,\n counterValue,\n negative = false,\n disabled = false,\n ...props\n },\n ref,\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n if (!props[\"aria-label\"] && !props[\"aria-labelledby\"] && !props.title) {\n console.warn(\n \"IconButton: No accessible name provided. Add an `aria-label`, `aria-labelledby`, or `title` prop so screen readers can announce this button.\",\n );\n }\n }\n\n return (\n <button\n ref={ref}\n type=\"button\"\n data-testid=\"icon-button\"\n disabled={disabled}\n className={cn(\n \"relative inline-flex shrink-0 items-center justify-center focus-visible:outline-none\",\n \"cursor-pointer transition-all duration-150 ease-in-out disabled:cursor-default\",\n \"focus-visible:shadow-focus-ring\",\n // `field` takes the inputs' radius at every size so it lines up with the\n // fields around it; everything else keeps the existing size-driven shape.\n variant === \"field\"\n ? \"rounded-sm\"\n : SIZE_DRIVEN_SHAPE_VARIANTS.has(variant) && size === \"24\"\n ? \"rounded-xs\"\n : \"rounded-full\",\n sizeVariants[size],\n getVariantClasses(variant, negative),\n className,\n )}\n {...props}\n >\n <span\n className={cn(\"flex shrink-0 items-center justify-center\", iconSizeVariants[size])}\n aria-hidden=\"true\"\n >\n {/* A button sizes its own icon, so a menu row's icon defaults stop here. */}\n <IconDefaultsContext.Provider value={NO_ICON_DEFAULTS}>\n {icon}\n </IconDefaultsContext.Provider>\n </span>\n\n {counterValue !== undefined && (\n <Count\n value={counterValue}\n variant=\"alert\"\n size={countSizeMap[size]}\n className=\"absolute -top-0.5 -right-0.5\"\n />\n )}\n </button>\n );\n },\n);\n\nIconButton.displayName = \"IconButton\";\n"],"names":[],"mappings":";;;;;;AA0CA,MAAM,mBAAmD;AAAA,EACvD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;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A,QACL,eAAY;AAAA,QACZ;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA;AAAA;AAAA,UAGA,YAAY,UACR,eACA,2BAA2B,IAAI,OAAO,KAAK,SAAS,OAClD,eACA;AAAA,UACN,aAAa,IAAI;AAAA,UACjB,kBAAkB,SAAS,QAAQ;AAAA,UACnC;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,GAAG,6CAA6C,iBAAiB,IAAI,CAAC;AAAA,cACjF,eAAY;AAAA,cAGZ,8BAAC,oBAAoB,UAApB,EAA6B,OAAO,kBAClC,UAAA,KAAA,CACH;AAAA,YAAA;AAAA,UAAA;AAAA,UAGD,iBAAiB,UAChB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,OAAO;AAAA,cACP,SAAQ;AAAA,cACR,MAAM,aAAa,IAAI;AAAA,cACvB,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,WAAW,cAAc;"}
1
+ {"version":3,"file":"IconButton.mjs","sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Count, type CountSize } from \"../Count/Count\";\nimport { IconDefaultsContext, NO_ICON_DEFAULTS } from \"../Icons/IconDefaults\";\n\n/**\n * Visual style variant of the icon button.\n *\n * `primary`, `secondary`, `tertiary`, `outline`, `error`, `white` and `black`\n * use the shared button colour tokens and a size-driven shape (squared at the\n * `24` size, circular otherwise). Of these, `primary`, `secondary`, `tertiary`\n * and `outline` also honour the {@link IconButtonProps.negative} prop, as does\n * `upsell`, which takes the other theme's glow.\n *\n * `upsell` is the Figma \"Upsell\" icon button and matches `Button`'s `brand`\n * variant: a green radial fill, a green glow and a highlight that circles the\n * rim once, held still when the user prefers reduced motion. It takes the same\n * size-driven shape as the standard variants.\n *\n * `overlay` is a translucent dark fill with a backdrop blur, for buttons that sit\n * on photos or video. Its fill and icon look the same in light and dark themes, while\n * the keyboard focus ring still follows the theme. It takes the same size-driven\n * shape as the standard variants.\n *\n * `brand`, `contrast`, `messaging`, `navTray`, `tertiaryDestructive`, `stop` and\n * `microphone` are bespoke variants that stay circular at every size.\n */\nexport type IconButtonVariant =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"outline\"\n | \"error\"\n | \"white\"\n | \"black\"\n | \"brand\"\n | \"upsell\"\n | \"contrast\"\n | \"messaging\"\n | \"navTray\"\n | \"tertiaryDestructive\"\n | \"stop\"\n | \"microphone\"\n | \"overlay\"\n | \"field\";\n\n/** Icon button size in pixels. */\nexport type IconButtonSize = \"24\" | \"32\" | \"40\" | \"48\" | \"52\" | \"72\";\n\nconst iconSizeVariants: Record<IconButtonSize, string> = {\n 24: \"[&>svg]:size-4\",\n 32: \"[&>svg]:size-4\",\n 40: \"[&>svg]:size-4\",\n 48: \"[&>svg]:size-6\",\n 52: \"[&>svg]:size-7\",\n 72: \"[&>svg]:size-8\",\n};\n\nconst sizeVariants: Record<IconButtonSize, string> = {\n 24: \"size-6 p-1\",\n 32: \"size-8 p-1.5\",\n 40: \"size-10 p-[10px]\",\n 48: \"size-12 p-3\",\n 52: \"size-[52px] p-2\",\n 72: \"size-[72px] p-4\",\n};\n\nconst countSizeMap: Record<IconButtonSize, CountSize> = {\n 24: \"16\",\n 32: \"24\",\n 40: \"32\",\n 48: \"32\",\n 52: \"32\",\n 72: \"32\",\n};\n\n/**\n * Variants whose corner radius is size-driven (see {@link IconButton}): the `24`\n * size is squared (`rounded-xs`), every larger size stays circular. All other\n * variants are circular at every size.\n */\nconst SIZE_DRIVEN_SHAPE_VARIANTS = new Set<IconButtonVariant>([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"outline\",\n \"error\",\n \"white\",\n \"black\",\n \"upsell\",\n \"overlay\",\n]);\n\n/** Variants that honour the `negative` (dark-surface) treatment. */\nconst NEGATIVE_AWARE_VARIANTS = new Set<IconButtonVariant>([\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"outline\",\n \"upsell\",\n]);\n\nconst DISABLED_FILL = \"disabled:bg-buttons-disabled-default disabled:text-content-disabled\";\nconst DISABLED_FILL_NEGATIVE =\n \"disabled:bg-buttons-disabled-negative disabled:text-content-disabled\";\nconst UPSELL =\n \"fv-upsell fv-upsell-shine bg-buttons-brand-default text-content-always-black not-disabled:hover:[--fv-upsell-end:var(--color-buttons-brand-hover)] not-disabled:active:[--fv-upsell-end:var(--color-buttons-brand-hover)]\";\nconst DISABLED_TRANSPARENT = \"disabled:text-content-disabled\";\nconst DISABLED_OPACITY = \"disabled:opacity-50\";\n\ntype VariantClasses = {\n default: string;\n disabled: string;\n negative?: string;\n negativeDisabled?: string;\n};\n\n/**\n * Icon button styling for every variant. The disabled treatment is expressed\n * with the CSS `disabled:` variant (not the `disabled` prop) so an ancestor\n * `<fieldset disabled>` is styled too; hover is guarded with `not-disabled:` so\n * it never fights the disabled state.\n */\nconst VARIANT_CLASSES: Record<IconButtonVariant, VariantClasses> = {\n primary: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted not-disabled:hover:bg-buttons-primary-hover not-disabled:active:bg-buttons-primary-hover\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-primary-negative-default text-content-primary not-disabled:hover:bg-buttons-primary-negative-hover not-disabled:active:bg-buttons-primary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n secondary: {\n default:\n \"bg-buttons-secondary-default text-content-primary not-disabled:hover:bg-buttons-secondary-hover not-disabled:active:bg-buttons-secondary-hover\",\n disabled: DISABLED_FILL,\n negative:\n \"bg-buttons-secondary-negative-default text-content-primary-inverted not-disabled:hover:bg-buttons-secondary-negative-hover not-disabled:active:bg-buttons-secondary-negative-hover\",\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n tertiary: {\n default:\n \"bg-transparent text-content-primary not-disabled:hover:bg-buttons-tertiary-hover not-disabled:active:bg-buttons-tertiary-hover\",\n disabled: DISABLED_TRANSPARENT,\n negative:\n \"bg-transparent text-content-primary-inverted not-disabled:hover:bg-buttons-tertiary-negative-hover not-disabled: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 not-disabled:hover:bg-buttons-outline-hover not-disabled:active:bg-buttons-outline-hover\",\n disabled: \"disabled:border-buttons-disabled-default disabled:text-content-disabled\",\n negative:\n \"border border-buttons-outline-negative-default bg-transparent text-content-primary-inverted not-disabled:hover:bg-buttons-outline-negative-hover not-disabled:active:bg-buttons-outline-negative-hover\",\n negativeDisabled: \"disabled:border-buttons-disabled-negative disabled:text-content-disabled\",\n },\n error: {\n default:\n \"bg-buttons-error-default text-content-always-white not-disabled:hover:bg-buttons-error-hover not-disabled:active:bg-buttons-error-hover\",\n disabled: DISABLED_FILL,\n },\n white: {\n default:\n \"bg-buttons-always-white-default text-content-always-black not-disabled:hover:bg-buttons-always-white-hover not-disabled:active:bg-buttons-always-white-hover\",\n disabled: DISABLED_FILL,\n },\n black: {\n default:\n \"bg-buttons-always-black-default text-content-always-white not-disabled:hover:bg-buttons-always-black-hover not-disabled:active:bg-buttons-always-black-hover\",\n disabled: DISABLED_FILL,\n },\n brand: {\n default:\n \"bg-content-always-black text-brand-primary-default hover:bg-brand-primary-default hover:text-content-always-black not-disabled:active:bg-brand-primary-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n upsell: {\n default: UPSELL,\n negative: `${UPSELL} fv-upsell-negative`,\n disabled: DISABLED_FILL,\n negativeDisabled: DISABLED_FILL_NEGATIVE,\n },\n contrast: {\n default:\n \"bg-transparent text-content-always-white hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted\",\n disabled: DISABLED_OPACITY,\n },\n messaging: {\n default:\n \"bg-content-always-black text-brand-primary-default hover:bg-brand-primary-default hover:text-content-always-black not-disabled:active:bg-brand-primary-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n navTray: {\n default:\n \"bg-transparent text-content-primary hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted\",\n disabled: DISABLED_OPACITY,\n },\n tertiaryDestructive: {\n default:\n \"bg-transparent text-error-content hover:bg-brand-primary-muted not-disabled:active:bg-brand-primary-muted\",\n disabled: DISABLED_OPACITY,\n },\n stop: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted hover:bg-buttons-brand-default hover:text-content-always-black not-disabled:active:bg-buttons-brand-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n microphone: {\n default:\n \"bg-buttons-primary-default text-content-primary-inverted hover:bg-buttons-brand-default hover:text-content-always-black not-disabled:active:bg-buttons-brand-default not-disabled:active:text-content-always-black\",\n disabled: DISABLED_OPACITY,\n },\n overlay: {\n default:\n \"bg-buttons-overlay-default text-content-always-white backdrop-blur-sm not-disabled:hover:bg-buttons-overlay-hover not-disabled:active:bg-buttons-overlay-hover\",\n disabled: DISABLED_OPACITY,\n },\n // Carries the input surface rather than a button one, so an icon-only action can\n // sit flush in a row of fields (Figma draws these as a `V2 Input Fields` instance\n // with only an icon inside). Border and hover match the Select trigger it lines up\n // with, so the row reads as one control group.\n field: {\n default:\n \"border border-border-primary bg-inputs-inputs-primary text-content-primary not-disabled:hover:border-neutral-alphas-400\",\n disabled: DISABLED_TRANSPARENT,\n },\n};\n\nfunction getVariantClasses(variant: IconButtonVariant, negative: boolean): string {\n const classes = VARIANT_CLASSES[variant];\n const isNegative = NEGATIVE_AWARE_VARIANTS.has(variant) && negative;\n const base = (isNegative && classes.negative) || classes.default;\n const disabledClasses = (isNegative && classes.negativeDisabled) || classes.disabled;\n return cn(base, disabledClasses);\n}\n\nexport interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual style variant of the icon button. @default \"primary\" */\n variant?: IconButtonVariant;\n /** Size of the button in pixels. @default \"40\" */\n size?: IconButtonSize;\n /** Icon element to render inside the button. */\n icon: React.ReactNode;\n /**\n * Forces the dark-surface treatment regardless of theme. Only honoured on the\n * `primary`, `secondary`, `tertiary`, and `outline` variants. @default false\n */\n negative?: boolean;\n /** When provided, displays a {@link Count} badge at the top-right corner. */\n counterValue?: number;\n}\n\n/**\n * A button containing only an icon. Use when an action can be represented by an\n * icon alone (e.g. close, send). Always pair with an `aria-label` for\n * accessibility.\n *\n * Shape is size-driven for the standard variants, `upsell` and `overlay`: the `24` size is\n * squared (`rounded-xs`), every larger size is circular. Bespoke variants (`brand`,\n * `contrast`, `messaging`, `navTray`, `tertiaryDestructive`, `stop`,\n * `microphone`) stay circular at all sizes. `field` is the exception that is\n * never circular — it takes the inputs' `rounded-sm` so it matches the fields it\n * sits beside. Use it at `32`, `40` or `48`: those are the sizes `Select` offers,\n * and the variant only earns its surface when it lines up with one.\n *\n * @example\n * ```tsx\n * <IconButton icon={<CloseIcon />} aria-label=\"Close\" variant=\"tertiary\" />\n * ```\n */\nexport const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n (\n {\n className,\n variant = \"primary\",\n size = \"40\",\n icon,\n counterValue,\n negative = false,\n disabled = false,\n ...props\n },\n ref,\n ) => {\n if (process.env.NODE_ENV !== \"production\") {\n if (!props[\"aria-label\"] && !props[\"aria-labelledby\"] && !props.title) {\n console.warn(\n \"IconButton: No accessible name provided. Add an `aria-label`, `aria-labelledby`, or `title` prop so screen readers can announce this button.\",\n );\n }\n }\n\n return (\n <button\n ref={ref}\n type=\"button\"\n data-testid=\"icon-button\"\n disabled={disabled}\n className={cn(\n \"relative inline-flex shrink-0 items-center justify-center focus-visible:outline-none\",\n \"cursor-pointer transition-all duration-150 ease-in-out disabled:cursor-default\",\n \"focus-visible:shadow-focus-ring\",\n // `field` takes the inputs' radius at every size so it lines up with the\n // fields around it; everything else keeps the existing size-driven shape.\n variant === \"field\"\n ? \"rounded-sm\"\n : SIZE_DRIVEN_SHAPE_VARIANTS.has(variant) && size === \"24\"\n ? \"rounded-xs\"\n : \"rounded-full\",\n sizeVariants[size],\n getVariantClasses(variant, negative),\n className,\n )}\n {...props}\n >\n <span\n className={cn(\"flex shrink-0 items-center justify-center\", iconSizeVariants[size])}\n aria-hidden=\"true\"\n >\n {/* A button sizes its own icon, so a menu row's icon defaults stop here. */}\n <IconDefaultsContext.Provider value={NO_ICON_DEFAULTS}>\n {icon}\n </IconDefaultsContext.Provider>\n </span>\n\n {counterValue !== undefined && (\n <Count\n value={counterValue}\n variant=\"alert\"\n size={countSizeMap[size]}\n className=\"absolute -top-0.5 -right-0.5 z-10\"\n />\n )}\n </button>\n );\n },\n);\n\nIconButton.displayName = \"IconButton\";\n"],"names":[],"mappings":";;;;;;AAiDA,MAAM,mBAAmD;AAAA,EACvD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,eAA+C;AAAA,EACnD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,MAAM,eAAkD;AAAA,EACtD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAOA,MAAM,iDAAiC,IAAuB;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGD,MAAM,8CAA8B,IAAuB;AAAA,EACzD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,MAAM,gBAAgB;AACtB,MAAM,yBACJ;AACF,MAAM,SACJ;AACF,MAAM,uBAAuB;AAC7B,MAAM,mBAAmB;AAezB,MA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UAAA;AAAA,UAGD,iBAAiB,UAChB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,OAAO;AAAA,cACP,SAAQ;AAAA,cACR,MAAM,aAAa,IAAI;AAAA,cACvB,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACZ;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,WAAW,cAAc;"}
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { BaseIcon } from "./BaseIcon.mjs";
5
+ const VARIANTS = {
6
+ 16: {
7
+ outlined: [
8
+ {
9
+ d: "M10 15.167H6C2.38 15.167.833 13.62.833 10V6C.833 2.38 2.38.833 6 .833h3.333c.274 0 .5.227.5.5 0 .274-.226.5-.5.5H6C2.927 1.833 1.833 2.927 1.833 6v4c0 3.073 1.094 4.167 4.167 4.167h4c3.073 0 4.167-1.094 4.167-4.167V6.667c0-.274.226-.5.5-.5.273 0 .5.226.5.5V10c0 3.62-1.547 5.167-5.167 5.167"
10
+ },
11
+ {
12
+ d: "M14.667 7.167H12C9.72 7.167 8.833 6.28 8.833 4V1.333c0-.2.12-.386.307-.46.187-.08.4-.033.547.107l5.333 5.333a.502.502 0 0 1-.353.854M9.833 2.54V4c0 1.72.447 2.167 2.167 2.167h1.46zM8.667 9.167h-4a.504.504 0 0 1-.5-.5c0-.274.226-.5.5-.5h4c.273 0 .5.226.5.5 0 .273-.227.5-.5.5m-1.334 2.666H4.667a.504.504 0 0 1-.5-.5c0-.273.226-.5.5-.5h2.666c.274 0 .5.227.5.5 0 .274-.226.5-.5.5"
13
+ }
14
+ ],
15
+ filled: [
16
+ {
17
+ d: "M10.667 1.333H5.333C3 1.333 2 2.667 2 4.667v6.666c0 2 1 3.334 3.333 3.334h5.334C13 14.667 14 13.333 14 11.333V4.667c0-2-1-3.334-3.333-3.334M5.333 8.167H8c.273 0 .5.226.5.5 0 .273-.227.5-.5.5H5.333a.504.504 0 0 1-.5-.5c0-.274.227-.5.5-.5m5.334 3.666H5.333a.504.504 0 0 1-.5-.5c0-.273.227-.5.5-.5h5.334c.273 0 .5.227.5.5 0 .274-.227.5-.5.5m1.666-5.666H11a1.83 1.83 0 0 1-1.833-1.834V3c0-.273.226-.5.5-.5.273 0 .5.227.5.5v1.333c0 .46.373.834.833.834h1.333c.274 0 .5.226.5.5 0 .273-.226.5-.5.5"
18
+ }
19
+ ]
20
+ },
21
+ 24: {
22
+ outlined: [
23
+ {
24
+ d: "M15 22.75H9c-5.43 0-7.75-2.32-7.75-7.75V9c0-5.43 2.32-7.75 7.75-7.75h5c.41 0 .75.34.75.75s-.34.75-.75.75H9C4.39 2.75 2.75 4.39 2.75 9v6c0 4.61 1.64 6.25 6.25 6.25h6c4.61 0 6.25-1.64 6.25-6.25v-5c0-.41.34-.75.75-.75s.75.34.75.75v5c0 5.43-2.32 7.75-7.75 7.75"
25
+ },
26
+ {
27
+ d: "M22 10.75h-4c-3.42 0-4.75-1.33-4.75-4.75V2c0-.3.18-.58.46-.69.28-.12.6-.05.82.16l8 8a.751.751 0 0 1-.53 1.28m-7.25-6.94V6c0 2.58.67 3.25 3.25 3.25h2.19zM13 13.75H7c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h6c.41 0 .75.34.75.75s-.34.75-.75.75m-2 4H7c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h4c.41 0 .75.34.75.75s-.34.75-.75.75"
28
+ }
29
+ ],
30
+ filled: [
31
+ {
32
+ d: "M16 2H8C4.5 2 3 4 3 7v10c0 3 1.5 5 5 5h8c3.5 0 5-2 5-5V7c0-3-1.5-5-5-5M8 12.25h4c.41 0 .75.34.75.75s-.34.75-.75.75H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75m8 5.5H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h8c.41 0 .75.34.75.75s-.34.75-.75.75m2.5-8.5h-2c-1.52 0-2.75-1.23-2.75-2.75v-2c0-.41.34-.75.75-.75s.75.34.75.75v2c0 .69.56 1.25 1.25 1.25h2c.41 0 .75.34.75.75s-.34.75-.75.75"
33
+ }
34
+ ]
35
+ },
36
+ 32: {
37
+ outlined: [
38
+ {
39
+ d: "M20 30.333h-8C4.76 30.333 1.667 27.24 1.667 20v-8C1.666 4.76 4.76 1.667 12 1.667h6.666c.547 0 1 .453 1 1s-.453 1-1 1H12c-6.147 0-8.333 2.186-8.333 8.333v8c0 6.147 2.186 8.333 8.333 8.333h8c6.147 0 8.333-2.186 8.333-8.333v-6.667c0-.546.454-1 1-1 .547 0 1 .454 1 1V20c0 7.24-3.093 10.333-10.333 10.333"
40
+ },
41
+ {
42
+ d: "M29.333 14.334H24c-4.56 0-6.334-1.773-6.334-6.333V2.667c0-.4.24-.773.614-.92.373-.16.8-.066 1.093.214L30.04 12.627a1.002 1.002 0 0 1-.707 1.707M19.667 5.08V8c0 3.44.893 4.333 4.333 4.333h2.92zm-2.333 13.253h-8c-.547 0-1-.453-1-1s.453-1 1-1h8c.546 0 1 .454 1 1 0 .547-.454 1-1 1m-2.667 5.334H9.334c-.547 0-1-.454-1-1 0-.547.453-1 1-1h5.333c.547 0 1 .453 1 1s-.453 1-1 1"
43
+ }
44
+ ],
45
+ filled: [
46
+ {
47
+ d: "M21.333 2.667H10.667C6 2.667 4 5.333 4 9.333v13.333c0 4 2 6.667 6.667 6.667h10.666C26 29.333 28 26.667 28 22.667V9.333c0-4-2-6.666-6.667-6.666M10.667 16.333H16c.547 0 1 .454 1 1 0 .547-.453 1-1 1h-5.333c-.547 0-1-.453-1-1s.453-1 1-1m10.666 7.334H10.667c-.547 0-1-.454-1-1 0-.547.453-1 1-1h10.666c.547 0 1 .453 1 1s-.453 1-1 1m3.334-11.334H22a3.665 3.665 0 0 1-3.667-3.667V6c0-.547.454-1 1-1 .547 0 1 .453 1 1v2.666c0 .92.747 1.667 1.667 1.667h2.667c.546 0 1 .454 1 1 0 .547-.454 1-1 1"
48
+ }
49
+ ]
50
+ }
51
+ };
52
+ const DocumentIcon = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseIcon, { ref, variants: VARIANTS, ...props }));
53
+ DocumentIcon.displayName = "DocumentIcon";
54
+ export {
55
+ DocumentIcon
56
+ };
57
+ //# sourceMappingURL=DocumentIcon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentIcon.mjs","sources":["../../../src/components/Icons/DocumentIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { BaseIcon } from \"./BaseIcon\";\nimport type { BaseIconProps, IconVariants } from \"./types\";\n\nconst VARIANTS: IconVariants = {\n 16: {\n outlined: [\n {\n d: \"M10 15.167H6C2.38 15.167.833 13.62.833 10V6C.833 2.38 2.38.833 6 .833h3.333c.274 0 .5.227.5.5 0 .274-.226.5-.5.5H6C2.927 1.833 1.833 2.927 1.833 6v4c0 3.073 1.094 4.167 4.167 4.167h4c3.073 0 4.167-1.094 4.167-4.167V6.667c0-.274.226-.5.5-.5.273 0 .5.226.5.5V10c0 3.62-1.547 5.167-5.167 5.167\",\n },\n {\n d: \"M14.667 7.167H12C9.72 7.167 8.833 6.28 8.833 4V1.333c0-.2.12-.386.307-.46.187-.08.4-.033.547.107l5.333 5.333a.502.502 0 0 1-.353.854M9.833 2.54V4c0 1.72.447 2.167 2.167 2.167h1.46zM8.667 9.167h-4a.504.504 0 0 1-.5-.5c0-.274.226-.5.5-.5h4c.273 0 .5.226.5.5 0 .273-.227.5-.5.5m-1.334 2.666H4.667a.504.504 0 0 1-.5-.5c0-.273.226-.5.5-.5h2.666c.274 0 .5.227.5.5 0 .274-.226.5-.5.5\",\n },\n ],\n filled: [\n {\n d: \"M10.667 1.333H5.333C3 1.333 2 2.667 2 4.667v6.666c0 2 1 3.334 3.333 3.334h5.334C13 14.667 14 13.333 14 11.333V4.667c0-2-1-3.334-3.333-3.334M5.333 8.167H8c.273 0 .5.226.5.5 0 .273-.227.5-.5.5H5.333a.504.504 0 0 1-.5-.5c0-.274.227-.5.5-.5m5.334 3.666H5.333a.504.504 0 0 1-.5-.5c0-.273.227-.5.5-.5h5.334c.273 0 .5.227.5.5 0 .274-.227.5-.5.5m1.666-5.666H11a1.83 1.83 0 0 1-1.833-1.834V3c0-.273.226-.5.5-.5.273 0 .5.227.5.5v1.333c0 .46.373.834.833.834h1.333c.274 0 .5.226.5.5 0 .273-.226.5-.5.5\",\n },\n ],\n },\n 24: {\n outlined: [\n {\n d: \"M15 22.75H9c-5.43 0-7.75-2.32-7.75-7.75V9c0-5.43 2.32-7.75 7.75-7.75h5c.41 0 .75.34.75.75s-.34.75-.75.75H9C4.39 2.75 2.75 4.39 2.75 9v6c0 4.61 1.64 6.25 6.25 6.25h6c4.61 0 6.25-1.64 6.25-6.25v-5c0-.41.34-.75.75-.75s.75.34.75.75v5c0 5.43-2.32 7.75-7.75 7.75\",\n },\n {\n d: \"M22 10.75h-4c-3.42 0-4.75-1.33-4.75-4.75V2c0-.3.18-.58.46-.69.28-.12.6-.05.82.16l8 8a.751.751 0 0 1-.53 1.28m-7.25-6.94V6c0 2.58.67 3.25 3.25 3.25h2.19zM13 13.75H7c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h6c.41 0 .75.34.75.75s-.34.75-.75.75m-2 4H7c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h4c.41 0 .75.34.75.75s-.34.75-.75.75\",\n },\n ],\n filled: [\n {\n d: \"M16 2H8C4.5 2 3 4 3 7v10c0 3 1.5 5 5 5h8c3.5 0 5-2 5-5V7c0-3-1.5-5-5-5M8 12.25h4c.41 0 .75.34.75.75s-.34.75-.75.75H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75m8 5.5H8c-.41 0-.75-.34-.75-.75s.34-.75.75-.75h8c.41 0 .75.34.75.75s-.34.75-.75.75m2.5-8.5h-2c-1.52 0-2.75-1.23-2.75-2.75v-2c0-.41.34-.75.75-.75s.75.34.75.75v2c0 .69.56 1.25 1.25 1.25h2c.41 0 .75.34.75.75s-.34.75-.75.75\",\n },\n ],\n },\n 32: {\n outlined: [\n {\n d: \"M20 30.333h-8C4.76 30.333 1.667 27.24 1.667 20v-8C1.666 4.76 4.76 1.667 12 1.667h6.666c.547 0 1 .453 1 1s-.453 1-1 1H12c-6.147 0-8.333 2.186-8.333 8.333v8c0 6.147 2.186 8.333 8.333 8.333h8c6.147 0 8.333-2.186 8.333-8.333v-6.667c0-.546.454-1 1-1 .547 0 1 .454 1 1V20c0 7.24-3.093 10.333-10.333 10.333\",\n },\n {\n d: \"M29.333 14.334H24c-4.56 0-6.334-1.773-6.334-6.333V2.667c0-.4.24-.773.614-.92.373-.16.8-.066 1.093.214L30.04 12.627a1.002 1.002 0 0 1-.707 1.707M19.667 5.08V8c0 3.44.893 4.333 4.333 4.333h2.92zm-2.333 13.253h-8c-.547 0-1-.453-1-1s.453-1 1-1h8c.546 0 1 .454 1 1 0 .547-.454 1-1 1m-2.667 5.334H9.334c-.547 0-1-.454-1-1 0-.547.453-1 1-1h5.333c.547 0 1 .453 1 1s-.453 1-1 1\",\n },\n ],\n filled: [\n {\n d: \"M21.333 2.667H10.667C6 2.667 4 5.333 4 9.333v13.333c0 4 2 6.667 6.667 6.667h10.666C26 29.333 28 26.667 28 22.667V9.333c0-4-2-6.666-6.667-6.666M10.667 16.333H16c.547 0 1 .454 1 1 0 .547-.453 1-1 1h-5.333c-.547 0-1-.453-1-1s.453-1 1-1m10.666 7.334H10.667c-.547 0-1-.454-1-1 0-.547.453-1 1-1h10.666c.547 0 1 .453 1 1s-.453 1-1 1m3.334-11.334H22a3.665 3.665 0 0 1-3.667-3.667V6c0-.547.454-1 1-1 .547 0 1 .453 1 1v2.666c0 .92.747 1.667 1.667 1.667h2.667c.546 0 1 .454 1 1 0 .547-.454 1-1 1\",\n },\n ],\n },\n};\n\n/** Props for {@link DocumentIcon}. See {@link BaseIconProps} for the shared shape. */\nexport type DocumentIconProps = BaseIconProps;\n\n/**\n * Document icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.\n *\n * @example\n * ```tsx\n * <DocumentIcon size={24} filled />\n * ```\n */\nexport const DocumentIcon = React.forwardRef<SVGSVGElement, DocumentIconProps>((props, ref) => (\n <BaseIcon ref={ref} variants={VARIANTS} {...props} />\n));\n\nDocumentIcon.displayName = \"DocumentIcon\";\n"],"names":[],"mappings":";;;;AAIA,MAAM,WAAyB;AAAA,EAC7B,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,MAEL;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,MAEL;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,MAEL;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAEJ;AAaO,MAAM,eAAe,MAAM,WAA6C,CAAC,OAAO,QACrF,oBAAC,UAAA,EAAS,KAAU,UAAU,UAAW,GAAG,OAAO,CACpD;AAED,aAAa,cAAc;"}
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { BaseIcon } from "./BaseIcon.mjs";
5
+ const VARIANTS = {
6
+ 16: {
7
+ outlined: [
8
+ {
9
+ d: "M14.167 2.833a.5.5 0 0 1 0 1H1.833a.5.5 0 0 1 0-1zm0 3.334a.5.5 0 0 1 0 1H1.833a.5.5 0 0 1 0-1zm-7 3.333a.5.5 0 0 1 0 1H1.833a.5.5 0 0 1 0-1zm2.505-.612c.57-.328 1.269-.23 1.91.139h.001l1.706.986c.643.37 1.076.928 1.076 1.587s-.432 1.217-1.075 1.587h-.001l-.852.493-.854.492v.001c-.643.37-1.342.464-1.912.136-.57-.33-.838-.981-.838-1.722v-1.974c0-.743.267-1.397.839-1.725m.161 3.699c0 .525.183.766.338.856.135.078.383.117.749-.051l.164-.085 1.706-.987c.457-.264.575-.543.575-.72 0-.178-.118-.457-.575-.72l-1.706-.987c-.458-.264-.76-.227-.914-.138-.154.088-.337.328-.337.858z"
10
+ }
11
+ ],
12
+ filled: [
13
+ {
14
+ d: "M14.167 2.833a.5.5 0 1 1 0 1H1.834a.5.5 0 1 1 0-1zm0 3.334a.5.5 0 1 1 0 1H1.834a.5.5 0 1 1 0-1zm-7 3.333a.5.5 0 0 1 0 1H1.834a.5.5 0 0 1 0-1zm2.505-.612c.57-.328 1.27-.23 1.91.139h.002l1.705.986c.643.37 1.076.928 1.076 1.587s-.432 1.217-1.075 1.587l-.853.493-.853.492-.001.001c-.643.37-1.342.464-1.912.136-.57-.33-.837-.981-.837-1.722v-1.974c0-.743.266-1.397.838-1.725"
15
+ }
16
+ ]
17
+ },
18
+ 24: {
19
+ outlined: [
20
+ {
21
+ d: "M21.25 4.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm0 5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm-10.5 5a.75.75 0 0 1 0 1.5h-8a.75.75 0 0 1 0-1.5zm3.758-.918c.856-.492 1.904-.346 2.866.208l.001.001 2.559 1.479c.964.555 1.614 1.392 1.614 2.38 0 .987-.649 1.825-1.613 2.38h-.001l-1.279.74-1.28.739h-.001c-.964.556-2.012.697-2.867.204-.855-.494-1.257-1.472-1.257-2.583v-2.96c0-1.115.4-2.095 1.258-2.588m.242 5.548c0 .788.274 1.15.506 1.284.203.117.575.176 1.124-.076l.246-.128 2.559-1.48c.686-.395.863-.814.863-1.08 0-.268-.177-.685-.862-1.08h-.001l-2.559-1.481c-.688-.396-1.14-.34-1.371-.206-.23.132-.505.492-.505 1.287z"
22
+ }
23
+ ],
24
+ filled: [
25
+ {
26
+ d: "M21.25 4.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm0 5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm-10.5 5a.75.75 0 0 1 0 1.5h-8a.75.75 0 0 1 0-1.5zm3.758-.918c.856-.492 1.904-.346 2.866.208l.001.001 2.559 1.479c.964.555 1.614 1.392 1.614 2.38 0 .987-.649 1.825-1.613 2.38h-.001l-1.279.74-1.28.739h-.001c-.964.556-2.012.697-2.867.204-.855-.494-1.257-1.472-1.257-2.583v-2.96c0-1.115.4-2.095 1.258-2.588"
27
+ }
28
+ ]
29
+ },
30
+ 32: {
31
+ outlined: [
32
+ {
33
+ d: "M28.333 5.667a1 1 0 1 1 0 2H3.667a1 1 0 0 1 0-2zm0 6.666a1 1 0 1 1 0 2H3.667a1 1 0 0 1 0-2zm-14 6.667a1 1 0 1 1 0 2H3.667a1 1 0 1 1 0-2zm5.011-1.224c1.14-.656 2.538-.462 3.821.277l.002.002 3.411 1.971c1.286.74 2.152 1.856 2.152 3.173s-.865 2.434-2.15 3.175l-.002-.002-1.704.987-1.707.986-.002.001c-1.286.74-2.683.929-3.823.271s-1.675-1.962-1.675-3.444v-3.946c0-1.487.534-2.794 1.677-3.451m.322 7.397c0 1.051.366 1.534.675 1.712.271.157.767.235 1.499-.101l.328-.17 3.411-1.973.002-.002c.913-.526 1.15-1.084 1.15-1.44-.001-.356-.237-.913-1.15-1.439h-.002l-3.411-1.975c-.917-.528-1.52-.452-1.828-.275-.307.177-.674.657-.674 1.717z"
34
+ }
35
+ ],
36
+ filled: [
37
+ {
38
+ d: "M28.333 5.667a1 1 0 1 1 0 2H3.667a1 1 0 1 1 0-2zm0 6.666a1 1 0 1 1 0 2H3.667a1 1 0 0 1 0-2zm-14 6.667a1 1 0 1 1 0 2H3.667a1 1 0 1 1 0-2zm5.011-1.224c1.141-.656 2.538-.462 3.821.277l.002.002 3.411 1.971c1.286.74 2.152 1.856 2.153 3.173s-.865 2.434-2.152 3.175v-.002l-1.705.987-1.707.986-.002.001c-1.285.74-2.682.929-3.822.271s-1.676-1.962-1.676-3.444v-3.946c0-1.487.534-2.794 1.677-3.451"
39
+ }
40
+ ]
41
+ }
42
+ };
43
+ const EpisodesIcon = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseIcon, { ref, variants: VARIANTS, ...props }));
44
+ EpisodesIcon.displayName = "EpisodesIcon";
45
+ export {
46
+ EpisodesIcon
47
+ };
48
+ //# sourceMappingURL=EpisodesIcon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpisodesIcon.mjs","sources":["../../../src/components/Icons/EpisodesIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { BaseIcon } from \"./BaseIcon\";\nimport type { BaseIconProps, IconVariants } from \"./types\";\n\nconst VARIANTS: IconVariants = {\n 16: {\n outlined: [\n {\n d: \"M14.167 2.833a.5.5 0 0 1 0 1H1.833a.5.5 0 0 1 0-1zm0 3.334a.5.5 0 0 1 0 1H1.833a.5.5 0 0 1 0-1zm-7 3.333a.5.5 0 0 1 0 1H1.833a.5.5 0 0 1 0-1zm2.505-.612c.57-.328 1.269-.23 1.91.139h.001l1.706.986c.643.37 1.076.928 1.076 1.587s-.432 1.217-1.075 1.587h-.001l-.852.493-.854.492v.001c-.643.37-1.342.464-1.912.136-.57-.33-.838-.981-.838-1.722v-1.974c0-.743.267-1.397.839-1.725m.161 3.699c0 .525.183.766.338.856.135.078.383.117.749-.051l.164-.085 1.706-.987c.457-.264.575-.543.575-.72 0-.178-.118-.457-.575-.72l-1.706-.987c-.458-.264-.76-.227-.914-.138-.154.088-.337.328-.337.858z\",\n },\n ],\n filled: [\n {\n d: \"M14.167 2.833a.5.5 0 1 1 0 1H1.834a.5.5 0 1 1 0-1zm0 3.334a.5.5 0 1 1 0 1H1.834a.5.5 0 1 1 0-1zm-7 3.333a.5.5 0 0 1 0 1H1.834a.5.5 0 0 1 0-1zm2.505-.612c.57-.328 1.27-.23 1.91.139h.002l1.705.986c.643.37 1.076.928 1.076 1.587s-.432 1.217-1.075 1.587l-.853.493-.853.492-.001.001c-.643.37-1.342.464-1.912.136-.57-.33-.837-.981-.837-1.722v-1.974c0-.743.266-1.397.838-1.725\",\n },\n ],\n },\n 24: {\n outlined: [\n {\n d: \"M21.25 4.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm0 5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm-10.5 5a.75.75 0 0 1 0 1.5h-8a.75.75 0 0 1 0-1.5zm3.758-.918c.856-.492 1.904-.346 2.866.208l.001.001 2.559 1.479c.964.555 1.614 1.392 1.614 2.38 0 .987-.649 1.825-1.613 2.38h-.001l-1.279.74-1.28.739h-.001c-.964.556-2.012.697-2.867.204-.855-.494-1.257-1.472-1.257-2.583v-2.96c0-1.115.4-2.095 1.258-2.588m.242 5.548c0 .788.274 1.15.506 1.284.203.117.575.176 1.124-.076l.246-.128 2.559-1.48c.686-.395.863-.814.863-1.08 0-.268-.177-.685-.862-1.08h-.001l-2.559-1.481c-.688-.396-1.14-.34-1.371-.206-.23.132-.505.492-.505 1.287z\",\n },\n ],\n filled: [\n {\n d: \"M21.25 4.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm0 5a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5zm-10.5 5a.75.75 0 0 1 0 1.5h-8a.75.75 0 0 1 0-1.5zm3.758-.918c.856-.492 1.904-.346 2.866.208l.001.001 2.559 1.479c.964.555 1.614 1.392 1.614 2.38 0 .987-.649 1.825-1.613 2.38h-.001l-1.279.74-1.28.739h-.001c-.964.556-2.012.697-2.867.204-.855-.494-1.257-1.472-1.257-2.583v-2.96c0-1.115.4-2.095 1.258-2.588\",\n },\n ],\n },\n 32: {\n outlined: [\n {\n d: \"M28.333 5.667a1 1 0 1 1 0 2H3.667a1 1 0 0 1 0-2zm0 6.666a1 1 0 1 1 0 2H3.667a1 1 0 0 1 0-2zm-14 6.667a1 1 0 1 1 0 2H3.667a1 1 0 1 1 0-2zm5.011-1.224c1.14-.656 2.538-.462 3.821.277l.002.002 3.411 1.971c1.286.74 2.152 1.856 2.152 3.173s-.865 2.434-2.15 3.175l-.002-.002-1.704.987-1.707.986-.002.001c-1.286.74-2.683.929-3.823.271s-1.675-1.962-1.675-3.444v-3.946c0-1.487.534-2.794 1.677-3.451m.322 7.397c0 1.051.366 1.534.675 1.712.271.157.767.235 1.499-.101l.328-.17 3.411-1.973.002-.002c.913-.526 1.15-1.084 1.15-1.44-.001-.356-.237-.913-1.15-1.439h-.002l-3.411-1.975c-.917-.528-1.52-.452-1.828-.275-.307.177-.674.657-.674 1.717z\",\n },\n ],\n filled: [\n {\n d: \"M28.333 5.667a1 1 0 1 1 0 2H3.667a1 1 0 1 1 0-2zm0 6.666a1 1 0 1 1 0 2H3.667a1 1 0 0 1 0-2zm-14 6.667a1 1 0 1 1 0 2H3.667a1 1 0 1 1 0-2zm5.011-1.224c1.141-.656 2.538-.462 3.821.277l.002.002 3.411 1.971c1.286.74 2.152 1.856 2.153 3.173s-.865 2.434-2.152 3.175v-.002l-1.705.987-1.707.986-.002.001c-1.285.74-2.682.929-3.822.271s-1.676-1.962-1.676-3.444v-3.946c0-1.487.534-2.794 1.677-3.451\",\n },\n ],\n },\n};\n\n/** Props for {@link EpisodesIcon}. See {@link BaseIconProps} for the shared shape. */\nexport type EpisodesIconProps = BaseIconProps;\n\n/**\n * Episodes icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.\n *\n * @example\n * ```tsx\n * <EpisodesIcon size={24} filled />\n * ```\n */\nexport const EpisodesIcon = React.forwardRef<SVGSVGElement, EpisodesIconProps>((props, ref) => (\n <BaseIcon ref={ref} variants={VARIANTS} {...props} />\n));\n\nEpisodesIcon.displayName = \"EpisodesIcon\";\n"],"names":[],"mappings":";;;;AAIA,MAAM,WAAyB;AAAA,EAC7B,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAEJ;AAaO,MAAM,eAAe,MAAM,WAA6C,CAAC,OAAO,QACrF,oBAAC,UAAA,EAAS,KAAU,UAAU,UAAW,GAAG,OAAO,CACpD;AAED,aAAa,cAAc;"}
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { BaseIcon } from "./BaseIcon.mjs";
5
+ const VARIANTS = {
6
+ 16: {
7
+ outlined: [
8
+ {
9
+ d: "M13.833 4.667v6.666c0 2.294-1.54 3.834-3.833 3.834H6c-2.293 0-3.833-1.54-3.833-3.834V4.667C2.167 2.373 3.707.833 6 .833h4c2.293 0 3.833 1.54 3.833 3.834M3.167 11.333c0 1.72 1.113 2.834 2.833 2.834h4c1.72 0 2.833-1.114 2.833-2.834V4.667c0-1.72-1.113-2.834-2.833-2.834H6c-1.72 0-2.833 1.114-2.833 2.834z"
10
+ },
11
+ {
12
+ d: "M7.06 10.353c-.193 0-.38-.047-.546-.14-.387-.22-.614-.667-.614-1.22V7.019c0-.553.22-1 .614-1.22.386-.22.886-.18 1.36.107l1.646.987c.454.273.713.68.713 1.113s-.26.84-.713 1.113l-1.647.987c-.273.16-.553.247-.813.247m0-3.707A.13.13 0 0 0 7 6.66c-.047.027-.1.147-.1.354v1.973c0 .2.053.32.1.353.053.027.18.014.354-.093L9 8.26c.167-.1.227-.2.227-.26s-.06-.153-.227-.26l-1.646-.986a.63.63 0 0 0-.294-.107"
13
+ }
14
+ ],
15
+ filled: [
16
+ {
17
+ d: "M2.667 4.667v6.666c0 2 1.333 3.334 3.333 3.334h4c2 0 3.333-1.334 3.333-3.334V4.667c0-2-1.333-3.334-3.333-3.334H6c-2 0-3.333 1.334-3.333 3.334m6.522 3.955-1.646.987c-.667.4-1.214.093-1.214-.687v-1.98c0-.78.547-1.086 1.214-.686l1.646.986c.634.387.634 1 0 1.38"
18
+ }
19
+ ]
20
+ },
21
+ 24: {
22
+ outlined: [
23
+ {
24
+ d: "M20.75 7v10c0 3.44-2.31 5.75-5.75 5.75H9c-3.44 0-5.75-2.31-5.75-5.75V7c0-3.44 2.31-5.75 5.75-5.75h6c3.44 0 5.75 2.31 5.75 5.75m-16 10c0 2.58 1.67 4.25 4.25 4.25h6c2.58 0 4.25-1.67 4.25-4.25V7c0-2.58-1.67-4.25-4.25-4.25H9C6.42 2.75 4.75 4.42 4.75 7z"
25
+ },
26
+ {
27
+ d: "M10.59 15.53c-.29 0-.57-.07-.82-.21-.58-.33-.92-1-.92-1.83v-2.96c0-.83.33-1.5.92-1.83.58-.33 1.33-.27 2.04.16l2.47 1.48c.68.41 1.07 1.02 1.07 1.67s-.39 1.26-1.07 1.67l-2.47 1.48c-.41.24-.83.37-1.22.37m0-5.56a.2.2 0 0 0-.09.02c-.07.04-.15.22-.15.53v2.96c0 .3.08.48.15.53.08.04.27.02.53-.14l2.47-1.48c.25-.15.34-.3.34-.39s-.09-.23-.34-.39l-2.47-1.48c-.18-.11-.34-.16-.44-.16"
28
+ }
29
+ ],
30
+ filled: [
31
+ {
32
+ d: "M4 7v10c0 3 2 5 5 5h6c3 0 5-2 5-5V7c0-3-2-5-5-5H9C6 2 4 4 4 7m9.784 5.934-2.47 1.48c-1 .6-1.82.14-1.82-1.03v-2.97c0-1.17.82-1.63 1.82-1.03l2.47 1.48c.95.58.95 1.5 0 2.07"
33
+ }
34
+ ]
35
+ },
36
+ 32: {
37
+ outlined: [
38
+ {
39
+ d: "M27.667 9.333v13.334c0 4.586-3.08 7.666-7.667 7.666h-8c-4.587 0-7.667-3.08-7.667-7.666V9.333c0-4.586 3.08-7.666 7.667-7.666h8c4.587 0 7.667 3.08 7.667 7.666M6.333 22.667c0 3.44 2.227 5.666 5.667 5.666h8c3.44 0 5.667-2.226 5.667-5.666V9.333c0-3.44-2.227-5.666-5.667-5.666h-8c-3.44 0-5.667 2.226-5.667 5.666z"
40
+ },
41
+ {
42
+ d: "M14.12 20.706c-.387 0-.76-.094-1.093-.28-.774-.44-1.227-1.334-1.227-2.44v-3.947c0-1.107.44-2 1.227-2.44.773-.44 1.773-.36 2.72.213l3.293 1.974c.907.546 1.427 1.36 1.427 2.226 0 .867-.52 1.68-1.427 2.227l-3.293 1.973c-.547.32-1.107.494-1.627.494m0-7.414a.3.3 0 0 0-.12.027c-.093.053-.2.293-.2.707v3.946c0 .4.107.64.2.707.107.053.36.027.707-.187L18 16.52c.333-.2.453-.4.453-.52s-.12-.307-.453-.52l-3.293-1.973c-.24-.147-.454-.214-.587-.214"
43
+ }
44
+ ],
45
+ filled: [
46
+ {
47
+ d: "M5.334 9.333v13.334c0 4 2.666 6.666 6.666 6.666h8c4 0 6.667-2.666 6.667-6.666V9.333c0-4-2.667-6.666-6.667-6.666h-8c-4 0-6.666 2.666-6.666 6.666m13.045 7.912-3.294 1.973c-1.333.8-2.427.187-2.427-1.373v-3.96c0-1.56 1.094-2.173 2.427-1.373l3.293 1.973c1.267.773 1.267 2 0 2.76"
48
+ }
49
+ ]
50
+ }
51
+ };
52
+ const ShortsIcon = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(BaseIcon, { ref, variants: VARIANTS, ...props }));
53
+ ShortsIcon.displayName = "ShortsIcon";
54
+ export {
55
+ ShortsIcon
56
+ };
57
+ //# sourceMappingURL=ShortsIcon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShortsIcon.mjs","sources":["../../../src/components/Icons/ShortsIcon.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { BaseIcon } from \"./BaseIcon\";\nimport type { BaseIconProps, IconVariants } from \"./types\";\n\nconst VARIANTS: IconVariants = {\n 16: {\n outlined: [\n {\n d: \"M13.833 4.667v6.666c0 2.294-1.54 3.834-3.833 3.834H6c-2.293 0-3.833-1.54-3.833-3.834V4.667C2.167 2.373 3.707.833 6 .833h4c2.293 0 3.833 1.54 3.833 3.834M3.167 11.333c0 1.72 1.113 2.834 2.833 2.834h4c1.72 0 2.833-1.114 2.833-2.834V4.667c0-1.72-1.113-2.834-2.833-2.834H6c-1.72 0-2.833 1.114-2.833 2.834z\",\n },\n {\n d: \"M7.06 10.353c-.193 0-.38-.047-.546-.14-.387-.22-.614-.667-.614-1.22V7.019c0-.553.22-1 .614-1.22.386-.22.886-.18 1.36.107l1.646.987c.454.273.713.68.713 1.113s-.26.84-.713 1.113l-1.647.987c-.273.16-.553.247-.813.247m0-3.707A.13.13 0 0 0 7 6.66c-.047.027-.1.147-.1.354v1.973c0 .2.053.32.1.353.053.027.18.014.354-.093L9 8.26c.167-.1.227-.2.227-.26s-.06-.153-.227-.26l-1.646-.986a.63.63 0 0 0-.294-.107\",\n },\n ],\n filled: [\n {\n d: \"M2.667 4.667v6.666c0 2 1.333 3.334 3.333 3.334h4c2 0 3.333-1.334 3.333-3.334V4.667c0-2-1.333-3.334-3.333-3.334H6c-2 0-3.333 1.334-3.333 3.334m6.522 3.955-1.646.987c-.667.4-1.214.093-1.214-.687v-1.98c0-.78.547-1.086 1.214-.686l1.646.986c.634.387.634 1 0 1.38\",\n },\n ],\n },\n 24: {\n outlined: [\n {\n d: \"M20.75 7v10c0 3.44-2.31 5.75-5.75 5.75H9c-3.44 0-5.75-2.31-5.75-5.75V7c0-3.44 2.31-5.75 5.75-5.75h6c3.44 0 5.75 2.31 5.75 5.75m-16 10c0 2.58 1.67 4.25 4.25 4.25h6c2.58 0 4.25-1.67 4.25-4.25V7c0-2.58-1.67-4.25-4.25-4.25H9C6.42 2.75 4.75 4.42 4.75 7z\",\n },\n {\n d: \"M10.59 15.53c-.29 0-.57-.07-.82-.21-.58-.33-.92-1-.92-1.83v-2.96c0-.83.33-1.5.92-1.83.58-.33 1.33-.27 2.04.16l2.47 1.48c.68.41 1.07 1.02 1.07 1.67s-.39 1.26-1.07 1.67l-2.47 1.48c-.41.24-.83.37-1.22.37m0-5.56a.2.2 0 0 0-.09.02c-.07.04-.15.22-.15.53v2.96c0 .3.08.48.15.53.08.04.27.02.53-.14l2.47-1.48c.25-.15.34-.3.34-.39s-.09-.23-.34-.39l-2.47-1.48c-.18-.11-.34-.16-.44-.16\",\n },\n ],\n filled: [\n {\n d: \"M4 7v10c0 3 2 5 5 5h6c3 0 5-2 5-5V7c0-3-2-5-5-5H9C6 2 4 4 4 7m9.784 5.934-2.47 1.48c-1 .6-1.82.14-1.82-1.03v-2.97c0-1.17.82-1.63 1.82-1.03l2.47 1.48c.95.58.95 1.5 0 2.07\",\n },\n ],\n },\n 32: {\n outlined: [\n {\n d: \"M27.667 9.333v13.334c0 4.586-3.08 7.666-7.667 7.666h-8c-4.587 0-7.667-3.08-7.667-7.666V9.333c0-4.586 3.08-7.666 7.667-7.666h8c4.587 0 7.667 3.08 7.667 7.666M6.333 22.667c0 3.44 2.227 5.666 5.667 5.666h8c3.44 0 5.667-2.226 5.667-5.666V9.333c0-3.44-2.227-5.666-5.667-5.666h-8c-3.44 0-5.667 2.226-5.667 5.666z\",\n },\n {\n d: \"M14.12 20.706c-.387 0-.76-.094-1.093-.28-.774-.44-1.227-1.334-1.227-2.44v-3.947c0-1.107.44-2 1.227-2.44.773-.44 1.773-.36 2.72.213l3.293 1.974c.907.546 1.427 1.36 1.427 2.226 0 .867-.52 1.68-1.427 2.227l-3.293 1.973c-.547.32-1.107.494-1.627.494m0-7.414a.3.3 0 0 0-.12.027c-.093.053-.2.293-.2.707v3.946c0 .4.107.64.2.707.107.053.36.027.707-.187L18 16.52c.333-.2.453-.4.453-.52s-.12-.307-.453-.52l-3.293-1.973c-.24-.147-.454-.214-.587-.214\",\n },\n ],\n filled: [\n {\n d: \"M5.334 9.333v13.334c0 4 2.666 6.666 6.666 6.666h8c4 0 6.667-2.666 6.667-6.666V9.333c0-4-2.667-6.666-6.667-6.666h-8c-4 0-6.666 2.666-6.666 6.666m13.045 7.912-3.294 1.973c-1.333.8-2.427.187-2.427-1.373v-3.96c0-1.56 1.094-2.173 2.427-1.373l3.293 1.973c1.267.773 1.267 2 0 2.76\",\n },\n ],\n },\n};\n\n/** Props for {@link ShortsIcon}. See {@link BaseIconProps} for the shared shape. */\nexport type ShortsIconProps = BaseIconProps;\n\n/**\n * Shorts icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.\n *\n * @example\n * ```tsx\n * <ShortsIcon size={24} filled />\n * ```\n */\nexport const ShortsIcon = React.forwardRef<SVGSVGElement, ShortsIconProps>((props, ref) => (\n <BaseIcon ref={ref} variants={VARIANTS} {...props} />\n));\n\nShortsIcon.displayName = \"ShortsIcon\";\n"],"names":[],"mappings":";;;;AAIA,MAAM,WAAyB;AAAA,EAC7B,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,MAEL;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,MAEL;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAAA,EAEF,IAAI;AAAA,IACF,UAAU;AAAA,MACR;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,MAEL;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,IAEF,QAAQ;AAAA,MACN;AAAA,QACE,GAAG;AAAA,MAAA;AAAA,IACL;AAAA,EACF;AAEJ;AAaO,MAAM,aAAa,MAAM,WAA2C,CAAC,OAAO,QACjF,oBAAC,UAAA,EAAS,KAAU,UAAU,UAAW,GAAG,OAAO,CACpD;AAED,WAAW,cAAc;"}
@@ -10,7 +10,7 @@ const InfoBox = PopoverPrimitive.Root;
10
10
  const InfoBoxTrigger = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { ref, ...useSuppressClickAfterDrag(props) }));
11
11
  InfoBoxTrigger.displayName = "InfoBoxTrigger";
12
12
  const ACTION_CLASSES = {
13
- brand: "hover:bg-brand-primary-default/80 hover:text-content-always-black",
13
+ brand: "",
14
14
  tertiary: "text-content-primary-inverted hover:text-content-primary-inverted hover:bg-content-primary-inverted/10"
15
15
  };
16
16
  const ActionButton = ({
@@ -1 +1 @@
1
- {"version":3,"file":"InfoBox.mjs","sources":["../../../src/components/InfoBox/InfoBox.tsx"],"sourcesContent":["import * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { FLOATING_CONTENT_COLLISION_PADDING } from \"../../utils/floatingContentCollisionPadding\";\nimport { useSuppressClickAfterDrag } from \"../../utils/useSuppressClickAfterDrag\";\nimport { Button } from \"../Button/Button\";\n\n/** Props for the {@link InfoBox} root component. */\nexport interface InfoBoxProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root> {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n defaultOpen?: boolean;\n}\n\n/** Root component that manages open/close state for an info box. */\nexport const InfoBox = PopoverPrimitive.Root;\n\n/** Props for the {@link InfoBoxTrigger} component. */\nexport type InfoBoxTriggerProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>;\n\n/**\n * The element that triggers the info box on click.\n *\n * On touch / pen, a press-and-release that crosses a small movement threshold\n * is treated as a drag and the resulting synthetic click is suppressed —\n * defends against Android Chrome opening the popover on a scroll-drag-end.\n */\nexport const InfoBoxTrigger = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Trigger>,\n InfoBoxTriggerProps\n>((props, ref) => <PopoverPrimitive.Trigger ref={ref} {...useSuppressClickAfterDrag(props)} />);\nInfoBoxTrigger.displayName = \"InfoBoxTrigger\";\n\n/** Action button with a label and click handler. */\ninterface InfoBoxButtonAction {\n label: string;\n onClick?: () => void;\n}\n\n/** Custom element rendered in place of the default action button. */\ninterface InfoBoxElementAction {\n element: React.ReactNode;\n}\n\n/** Action configuration for {@link InfoBoxContent}. */\nexport type InfoBoxAction = InfoBoxButtonAction | InfoBoxElementAction;\n\nexport interface InfoBoxContentProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {\n /** Whether to show the directional arrow pointer. @default true */\n showArrow?: boolean;\n /** Heading text rendered at the top of the info box. */\n heading?: React.ReactNode;\n /** Icon element displayed to the left of the heading. */\n icon?: React.ReactNode;\n /** Pill or badge element displayed to the right of the heading. */\n pill?: React.ReactNode;\n /** Primary action button (brand green). */\n primaryAction?: InfoBoxAction;\n /** Secondary action button (ghost). */\n secondaryAction?: InfoBoxAction;\n}\n\nconst ACTION_CLASSES: Record<\"brand\" | \"tertiary\", string> = {\n brand: \"hover:bg-brand-primary-default/80 hover:text-content-always-black\",\n tertiary:\n \"text-content-primary-inverted hover:text-content-primary-inverted hover:bg-content-primary-inverted/10\",\n};\n\nconst ActionButton = ({\n action,\n variant,\n}: {\n action: InfoBoxAction;\n variant: \"brand\" | \"tertiary\";\n}) =>\n \"element\" in action ? (\n action.element\n ) : (\n <Button variant={variant} onClick={action.onClick} className={ACTION_CLASSES[variant]}>\n {action.label}\n </Button>\n );\n\nexport const InfoBoxContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n InfoBoxContentProps\n>(\n (\n {\n className,\n showArrow = true,\n sideOffset = 8,\n heading,\n icon,\n pill,\n primaryAction,\n secondaryAction,\n children,\n style,\n onOpenAutoFocus,\n collisionPadding = FLOATING_CONTENT_COLLISION_PADDING,\n ...props\n },\n ref,\n ) => {\n const hasHeader = icon !== undefined || heading !== undefined || pill !== undefined;\n const hasActions = primaryAction !== undefined || secondaryAction !== undefined;\n const headingId = React.useId();\n\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n style={{ zIndex: \"var(--fanvue-ui-portal-z-index, 50)\", ...style }}\n className={cn(\n \"typography-body-small-14px-regular max-w-[280px] overflow-hidden rounded-md border border-white/20 bg-surface-primary-inverted p-4 text-content-primary-inverted shadow-[0px_2px_4px_0px_rgba(17,24,39,0.08)]\",\n className,\n )}\n align=\"center\"\n aria-labelledby={heading ? headingId : undefined}\n arrowPadding={12}\n onOpenAutoFocus={(e) => {\n // Prevent auto-focus stealing when opening — content is supplementary, not a dialog.\n e.preventDefault();\n onOpenAutoFocus?.(e);\n }}\n {...props}\n >\n <div className=\"flex flex-col gap-3\">\n {hasHeader && (\n <div className=\"flex items-center gap-3\">\n {icon && <div className=\"size-5 shrink-0\">{icon}</div>}\n {heading && (\n <p\n id={headingId}\n className=\"typography-body-default-16px-semibold min-w-0 flex-1 text-content-primary-inverted\"\n >\n {heading}\n </p>\n )}\n {pill && <div className=\"shrink-0\">{pill}</div>}\n </div>\n )}\n {children && (\n <div className=\"typography-body-small-14px-regular text-content-primary-inverted\">\n {children}\n </div>\n )}\n {hasActions && (\n <div className=\"flex items-center gap-1\">\n {primaryAction && <ActionButton action={primaryAction} variant=\"brand\" />}\n {secondaryAction && <ActionButton action={secondaryAction} variant=\"tertiary\" />}\n </div>\n )}\n </div>\n {showArrow && (\n <PopoverPrimitive.Arrow\n className={\n \"-translate-y-px! fill-surface-primary-inverted stroke-2 stroke-surface-primary-inverted\"\n }\n width={12}\n height={6}\n />\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n },\n);\nInfoBoxContent.displayName = \"InfoBoxContent\";\n"],"names":[],"mappings":";;;;;;;;AAeO,MAAM,UAAU,iBAAiB;AAYjC,MAAM,iBAAiB,MAAM,WAGlC,CAAC,OAAO,QAAQ,oBAAC,iBAAiB,SAAjB,EAAyB,KAAW,GAAG,0BAA0B,KAAK,GAAG,CAAE;AAC9F,eAAe,cAAc;AAgC7B,MAAM,iBAAuD;AAAA,EAC3D,OAAO;AAAA,EACP,UACE;AACJ;AAEA,MAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA;AACF,MAIE,aAAa,SACX,OAAO,8BAEN,QAAA,EAAO,SAAkB,SAAS,OAAO,SAAS,WAAW,eAAe,OAAO,GACjF,iBAAO,OACV;AAGG,MAAM,iBAAiB,MAAM;AAAA,EAIlC,CACE;AAAA,IACE;AAAA,IACA,YAAY;AAAA,IACZ,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,mBAAmB;AAAA,IACnB,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,YAAY,SAAS,UAAa,YAAY,UAAa,SAAS;AAC1E,UAAM,aAAa,kBAAkB,UAAa,oBAAoB;AACtE,UAAM,YAAY,MAAM,MAAA;AAExB,WACE,oBAAC,iBAAiB,QAAjB,EACC,UAAA;AAAA,MAAC,iBAAiB;AAAA,MAAjB;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO,EAAE,QAAQ,uCAAuC,GAAG,MAAA;AAAA,QAC3D,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAEF,OAAM;AAAA,QACN,mBAAiB,UAAU,YAAY;AAAA,QACvC,cAAc;AAAA,QACd,iBAAiB,CAAC,MAAM;AAEtB,YAAE,eAAA;AACF,4BAAkB,CAAC;AAAA,QACrB;AAAA,QACC,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA,qBAAC,OAAA,EAAI,WAAU,uBACZ,UAAA;AAAA,YAAA,aACC,qBAAC,OAAA,EAAI,WAAU,2BACZ,UAAA;AAAA,cAAA,QAAQ,oBAAC,OAAA,EAAI,WAAU,mBAAmB,UAAA,MAAK;AAAA,cAC/C,WACC;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,IAAI;AAAA,kBACJ,WAAU;AAAA,kBAET,UAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,cAGJ,QAAQ,oBAAC,OAAA,EAAI,WAAU,YAAY,UAAA,KAAA,CAAK;AAAA,YAAA,GAC3C;AAAA,YAED,YACC,oBAAC,OAAA,EAAI,WAAU,oEACZ,UACH;AAAA,YAED,cACC,qBAAC,OAAA,EAAI,WAAU,2BACZ,UAAA;AAAA,cAAA,iBAAiB,oBAAC,cAAA,EAAa,QAAQ,eAAe,SAAQ,SAAQ;AAAA,cACtE,mBAAmB,oBAAC,cAAA,EAAa,QAAQ,iBAAiB,SAAQ,WAAA,CAAW;AAAA,YAAA,EAAA,CAChF;AAAA,UAAA,GAEJ;AAAA,UACC,aACC;AAAA,YAAC,iBAAiB;AAAA,YAAjB;AAAA,cACC,WACE;AAAA,cAEF,OAAO;AAAA,cACP,QAAQ;AAAA,YAAA;AAAA,UAAA;AAAA,QACV;AAAA,MAAA;AAAA,IAAA,GAGN;AAAA,EAEJ;AACF;AACA,eAAe,cAAc;"}
1
+ {"version":3,"file":"InfoBox.mjs","sources":["../../../src/components/InfoBox/InfoBox.tsx"],"sourcesContent":["import * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { FLOATING_CONTENT_COLLISION_PADDING } from \"../../utils/floatingContentCollisionPadding\";\nimport { useSuppressClickAfterDrag } from \"../../utils/useSuppressClickAfterDrag\";\nimport { Button } from \"../Button/Button\";\n\n/** Props for the {@link InfoBox} root component. */\nexport interface InfoBoxProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root> {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n defaultOpen?: boolean;\n}\n\n/** Root component that manages open/close state for an info box. */\nexport const InfoBox = PopoverPrimitive.Root;\n\n/** Props for the {@link InfoBoxTrigger} component. */\nexport type InfoBoxTriggerProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>;\n\n/**\n * The element that triggers the info box on click.\n *\n * On touch / pen, a press-and-release that crosses a small movement threshold\n * is treated as a drag and the resulting synthetic click is suppressed —\n * defends against Android Chrome opening the popover on a scroll-drag-end.\n */\nexport const InfoBoxTrigger = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Trigger>,\n InfoBoxTriggerProps\n>((props, ref) => <PopoverPrimitive.Trigger ref={ref} {...useSuppressClickAfterDrag(props)} />);\nInfoBoxTrigger.displayName = \"InfoBoxTrigger\";\n\n/** Action button with a label and click handler. */\ninterface InfoBoxButtonAction {\n label: string;\n onClick?: () => void;\n}\n\n/** Custom element rendered in place of the default action button. */\ninterface InfoBoxElementAction {\n element: React.ReactNode;\n}\n\n/** Action configuration for {@link InfoBoxContent}. */\nexport type InfoBoxAction = InfoBoxButtonAction | InfoBoxElementAction;\n\nexport interface InfoBoxContentProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {\n /** Whether to show the directional arrow pointer. @default true */\n showArrow?: boolean;\n /** Heading text rendered at the top of the info box. */\n heading?: React.ReactNode;\n /** Icon element displayed to the left of the heading. */\n icon?: React.ReactNode;\n /** Pill or badge element displayed to the right of the heading. */\n pill?: React.ReactNode;\n /** Primary action button (brand green). */\n primaryAction?: InfoBoxAction;\n /** Secondary action button (ghost). */\n secondaryAction?: InfoBoxAction;\n}\n\nconst ACTION_CLASSES: Record<\"brand\" | \"tertiary\", string> = {\n brand: \"\",\n tertiary:\n \"text-content-primary-inverted hover:text-content-primary-inverted hover:bg-content-primary-inverted/10\",\n};\n\nconst ActionButton = ({\n action,\n variant,\n}: {\n action: InfoBoxAction;\n variant: \"brand\" | \"tertiary\";\n}) =>\n \"element\" in action ? (\n action.element\n ) : (\n <Button variant={variant} onClick={action.onClick} className={ACTION_CLASSES[variant]}>\n {action.label}\n </Button>\n );\n\nexport const InfoBoxContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n InfoBoxContentProps\n>(\n (\n {\n className,\n showArrow = true,\n sideOffset = 8,\n heading,\n icon,\n pill,\n primaryAction,\n secondaryAction,\n children,\n style,\n onOpenAutoFocus,\n collisionPadding = FLOATING_CONTENT_COLLISION_PADDING,\n ...props\n },\n ref,\n ) => {\n const hasHeader = icon !== undefined || heading !== undefined || pill !== undefined;\n const hasActions = primaryAction !== undefined || secondaryAction !== undefined;\n const headingId = React.useId();\n\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n style={{ zIndex: \"var(--fanvue-ui-portal-z-index, 50)\", ...style }}\n className={cn(\n \"typography-body-small-14px-regular max-w-[280px] overflow-hidden rounded-md border border-white/20 bg-surface-primary-inverted p-4 text-content-primary-inverted shadow-[0px_2px_4px_0px_rgba(17,24,39,0.08)]\",\n className,\n )}\n align=\"center\"\n aria-labelledby={heading ? headingId : undefined}\n arrowPadding={12}\n onOpenAutoFocus={(e) => {\n // Prevent auto-focus stealing when opening — content is supplementary, not a dialog.\n e.preventDefault();\n onOpenAutoFocus?.(e);\n }}\n {...props}\n >\n <div className=\"flex flex-col gap-3\">\n {hasHeader && (\n <div className=\"flex items-center gap-3\">\n {icon && <div className=\"size-5 shrink-0\">{icon}</div>}\n {heading && (\n <p\n id={headingId}\n className=\"typography-body-default-16px-semibold min-w-0 flex-1 text-content-primary-inverted\"\n >\n {heading}\n </p>\n )}\n {pill && <div className=\"shrink-0\">{pill}</div>}\n </div>\n )}\n {children && (\n <div className=\"typography-body-small-14px-regular text-content-primary-inverted\">\n {children}\n </div>\n )}\n {hasActions && (\n <div className=\"flex items-center gap-1\">\n {primaryAction && <ActionButton action={primaryAction} variant=\"brand\" />}\n {secondaryAction && <ActionButton action={secondaryAction} variant=\"tertiary\" />}\n </div>\n )}\n </div>\n {showArrow && (\n <PopoverPrimitive.Arrow\n className={\n \"-translate-y-px! fill-surface-primary-inverted stroke-2 stroke-surface-primary-inverted\"\n }\n width={12}\n height={6}\n />\n )}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n },\n);\nInfoBoxContent.displayName = \"InfoBoxContent\";\n"],"names":[],"mappings":";;;;;;;;AAeO,MAAM,UAAU,iBAAiB;AAYjC,MAAM,iBAAiB,MAAM,WAGlC,CAAC,OAAO,QAAQ,oBAAC,iBAAiB,SAAjB,EAAyB,KAAW,GAAG,0BAA0B,KAAK,GAAG,CAAE;AAC9F,eAAe,cAAc;AAgC7B,MAAM,iBAAuD;AAAA,EAC3D,OAAO;AAAA,EACP,UACE;AACJ;AAEA,MAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA;AACF,MAIE,aAAa,SACX,OAAO,8BAEN,QAAA,EAAO,SAAkB,SAAS,OAAO,SAAS,WAAW,eAAe,OAAO,GACjF,iBAAO,OACV;AAGG,MAAM,iBAAiB,MAAM;AAAA,EAIlC,CACE;AAAA,IACE;AAAA,IACA,YAAY;AAAA,IACZ,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,mBAAmB;AAAA,IACnB,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,YAAY,SAAS,UAAa,YAAY,UAAa,SAAS;AAC1E,UAAM,aAAa,kBAAkB,UAAa,oBAAoB;AACtE,UAAM,YAAY,MAAM,M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AA,IAAA,GAGN;AAAA,EAEJ;AACF;AACA,eAAe,cAAc;"}
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../../utils/cn.mjs";
5
+ const InlineEmptyState = React.forwardRef(
6
+ ({ className, children, ...props }, ref) => {
7
+ return /* @__PURE__ */ jsx(
8
+ "p",
9
+ {
10
+ ref,
11
+ className: cn(
12
+ "typography-body-small-14px-regular m-0 flex min-h-20 items-center justify-center px-4 text-center text-content-tertiary",
13
+ className
14
+ ),
15
+ ...props,
16
+ children: /* @__PURE__ */ jsx("span", { className: "min-w-0 [overflow-wrap:anywhere]", children })
17
+ }
18
+ );
19
+ }
20
+ );
21
+ InlineEmptyState.displayName = "InlineEmptyState";
22
+ export {
23
+ InlineEmptyState
24
+ };
25
+ //# sourceMappingURL=InlineEmptyState.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineEmptyState.mjs","sources":["../../../src/components/InlineEmptyState/InlineEmptyState.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface InlineEmptyStateProps\n extends Omit<React.HTMLAttributes<HTMLParagraphElement>, \"dangerouslySetInnerHTML\"> {\n /** The message. Keep it to one short sentence. */\n children?: React.ReactNode;\n}\n\n/**\n * An empty or coming-soon state as one quiet, centred line in an 80px block. Use it inside a\n * card, table or panel that has nothing to show yet. For a state with a title, artwork or\n * actions, use {@link EmptyState}.\n *\n * @example\n * ```tsx\n * <InlineEmptyState>No links in this campaign yet.</InlineEmptyState>\n * ```\n */\nexport const InlineEmptyState = React.forwardRef<HTMLParagraphElement, InlineEmptyStateProps>(\n ({ className, children, ...props }, ref) => {\n return (\n <p\n ref={ref}\n className={cn(\n \"typography-body-small-14px-regular m-0 flex min-h-20 items-center justify-center px-4 text-center text-content-tertiary\",\n className,\n )}\n {...props}\n >\n <span className=\"min-w-0 [overflow-wrap:anywhere]\">{children}</span>\n </p>\n );\n },\n);\n\nInlineEmptyState.displayName = \"InlineEmptyState\";\n"],"names":[],"mappings":";;;;AAmBO,MAAM,mBAAmB,MAAM;AAAA,EACpC,CAAC,EAAE,WAAW,UAAU,GAAG,MAAA,GAAS,QAAQ;AAC1C,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEJ,UAAA,oBAAC,QAAA,EAAK,WAAU,oCAAoC,SAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EAGnE;AACF;AAEA,iBAAiB,cAAc;"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Slot, Slottable } from "@radix-ui/react-slot";
4
4
  import * as React from "react";
5
5
  import { cn } from "../../utils/cn.mjs";
@@ -11,9 +11,25 @@ const SIZE_CLASSES = {
11
11
  const VARIANT_CLASSES = {
12
12
  primary: "text-buttons-link-primary-default hover:text-buttons-link-primary-hover",
13
13
  brand: "text-buttons-link-brand-default hover:text-buttons-link-brand-hover",
14
- inherit: "text-inherit hover:opacity-80"
14
+ inherit: "text-inherit hover:opacity-80",
15
+ subtle: "text-content-secondary hover:text-content-primary"
15
16
  };
16
17
  const ICON_WRAPPER = "flex shrink-0 items-center justify-center [&>svg]:size-4";
18
+ const UNDERLINE_STYLE = "decoration-from-font decoration-solid [text-underline-position:from-font]";
19
+ function getUnderlineClassName(variant, asChild) {
20
+ if (variant !== "subtle") return cn("underline", UNDERLINE_STYLE);
21
+ return cn(
22
+ "no-underline underline-offset-4",
23
+ asChild ? "hover:underline" : "group-hover/link:underline",
24
+ UNDERLINE_STYLE
25
+ );
26
+ }
27
+ function getLayoutClassName(variant, size, hasIcon) {
28
+ const hoverGroup = variant === "subtle" && "group/link";
29
+ if (size === "inherit" && !hasIcon) return cn("inline", hoverGroup);
30
+ if (variant !== "subtle") return "inline-flex items-center gap-2";
31
+ return cn(hoverGroup, "inline-flex items-center gap-1", hasIcon && "min-h-8 px-1");
32
+ }
17
33
  const Link = React.forwardRef(
18
34
  ({
19
35
  className,
@@ -29,15 +45,22 @@ const Link = React.forwardRef(
29
45
  ...props
30
46
  }, ref) => {
31
47
  const Comp = asChild ? Slot : "a";
32
- const textClasses = cn(
33
- SIZE_CLASSES[size],
34
- "underline decoration-from-font decoration-solid [text-underline-position:from-font]"
35
- );
48
+ const textClasses = cn(SIZE_CLASSES[size], getUnderlineClassName(variant, asChild));
36
49
  const disabledProps = disabled ? { "aria-disabled": true, tabIndex: -1 } : {};
37
50
  const slotChild = disabled && React.isValidElement(children) && children.type === "a" ? React.cloneElement(children, { href: void 0 }) : children;
38
51
  const handleClick = disabled ? (event) => event.preventDefault() : onClick;
39
52
  const leftIconNode = leftIcon && /* @__PURE__ */ jsx("span", { className: ICON_WRAPPER, "aria-hidden": "true", children: leftIcon });
40
- const rightIconNode = rightIcon && /* @__PURE__ */ jsx("span", { className: ICON_WRAPPER, "aria-hidden": "true", children: rightIcon });
53
+ const rightIconNode = rightIcon && /* @__PURE__ */ jsx(
54
+ "span",
55
+ {
56
+ className: cn(
57
+ ICON_WRAPPER,
58
+ variant === "subtle" && "motion-safe:transition-transform motion-safe:group-hover/link:translate-x-0.5"
59
+ ),
60
+ "aria-hidden": "true",
61
+ children: rightIcon
62
+ }
63
+ );
41
64
  return /* @__PURE__ */ jsxs(
42
65
  Comp,
43
66
  {
@@ -45,7 +68,7 @@ const Link = React.forwardRef(
45
68
  href: disabled ? void 0 : href,
46
69
  onClick: handleClick,
47
70
  className: cn(
48
- size === "inherit" && !leftIcon && !rightIcon ? "inline" : "inline-flex items-center gap-2",
71
+ getLayoutClassName(variant, size, Boolean(leftIcon || rightIcon)),
49
72
  "rounded-2xs",
50
73
  variant === "inherit" ? "transition-opacity" : "transition-colors",
51
74
  "focus-visible:shadow-focus-ring focus-visible:outline-none",