@fanvue/ui 3.22.0 → 3.24.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 (121) hide show
  1. package/dist/charts.d.ts +94 -4
  2. package/dist/charts.mjs +4 -0
  3. package/dist/charts.mjs.map +1 -1
  4. package/dist/cjs/charts.cjs +4 -0
  5. package/dist/cjs/charts.cjs.map +1 -1
  6. package/dist/cjs/components/AiButton/AiButton.cjs +170 -0
  7. package/dist/cjs/components/AiButton/AiButton.cjs.map +1 -0
  8. package/dist/cjs/components/AnimatedNumber/AnimatedNumber.cjs +170 -0
  9. package/dist/cjs/components/AnimatedNumber/AnimatedNumber.cjs.map +1 -0
  10. package/dist/cjs/components/ButtonIconGroup/ButtonIconGroup.cjs +58 -0
  11. package/dist/cjs/components/ButtonIconGroup/ButtonIconGroup.cjs.map +1 -0
  12. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs +24 -2
  13. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs.map +1 -1
  14. package/dist/cjs/components/Chart/ChartMetricTrend.cjs +71 -0
  15. package/dist/cjs/components/Chart/ChartMetricTrend.cjs.map +1 -0
  16. package/dist/cjs/components/Chart/ChartSkeleton.cjs +95 -0
  17. package/dist/cjs/components/Chart/ChartSkeleton.cjs.map +1 -0
  18. package/dist/cjs/components/Chip/Chip.cjs +40 -11
  19. package/dist/cjs/components/Chip/Chip.cjs.map +1 -1
  20. package/dist/cjs/components/CountryFlag/CountryFlag.cjs +91 -0
  21. package/dist/cjs/components/CountryFlag/CountryFlag.cjs.map +1 -0
  22. package/dist/cjs/components/CountryFlag/flagShapes.cjs +3358 -0
  23. package/dist/cjs/components/CountryFlag/flagShapes.cjs.map +1 -0
  24. package/dist/cjs/components/CreatorTile/CreatorTile.cjs +2 -1
  25. package/dist/cjs/components/CreatorTile/CreatorTile.cjs.map +1 -1
  26. package/dist/cjs/components/CyclingText/CyclingText.cjs +9 -26
  27. package/dist/cjs/components/CyclingText/CyclingText.cjs.map +1 -1
  28. package/dist/cjs/components/CyclingText/useCyclingMotion.cjs +53 -0
  29. package/dist/cjs/components/CyclingText/useCyclingMotion.cjs.map +1 -0
  30. package/dist/cjs/components/Demographics/Demographics.cjs +39 -0
  31. package/dist/cjs/components/Demographics/Demographics.cjs.map +1 -0
  32. package/dist/cjs/components/Drawer/Drawer.cjs +9 -1
  33. package/dist/cjs/components/Drawer/Drawer.cjs.map +1 -1
  34. package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs +122 -16
  35. package/dist/cjs/components/DropdownMenu/DropdownMenu.cjs.map +1 -1
  36. package/dist/cjs/components/IconButton/IconButton.cjs +11 -1
  37. package/dist/cjs/components/IconButton/IconButton.cjs.map +1 -1
  38. package/dist/cjs/components/ProgressBar/ProgressBar.cjs +9 -1
  39. package/dist/cjs/components/ProgressBar/ProgressBar.cjs.map +1 -1
  40. package/dist/cjs/components/Tabs/TabsList.cjs +123 -91
  41. package/dist/cjs/components/Tabs/TabsList.cjs.map +1 -1
  42. package/dist/cjs/components/Tooltip/Tooltip.cjs +36 -25
  43. package/dist/cjs/components/Tooltip/Tooltip.cjs.map +1 -1
  44. package/dist/cjs/components/Tooltip/TooltipLabel.cjs +71 -0
  45. package/dist/cjs/components/Tooltip/TooltipLabel.cjs.map +1 -0
  46. package/dist/cjs/components/TrendPill/TrendPill.cjs +46 -0
  47. package/dist/cjs/components/TrendPill/TrendPill.cjs.map +1 -0
  48. package/dist/cjs/components/UserDisplayName/UserDisplayName.cjs +13 -1
  49. package/dist/cjs/components/UserDisplayName/UserDisplayName.cjs.map +1 -1
  50. package/dist/cjs/components/UserItem/UserItem.cjs +21 -2
  51. package/dist/cjs/components/UserItem/UserItem.cjs.map +1 -1
  52. package/dist/cjs/components/UserItem/UserItemTrailing.cjs +34 -0
  53. package/dist/cjs/components/UserItem/UserItemTrailing.cjs.map +1 -0
  54. package/dist/cjs/flags.cjs +6 -0
  55. package/dist/cjs/flags.cjs.map +1 -0
  56. package/dist/cjs/index.cjs +15 -0
  57. package/dist/cjs/index.cjs.map +1 -1
  58. package/dist/cjs/{components/CyclingText → utils}/usePrefersReducedMotion.cjs +14 -14
  59. package/dist/cjs/utils/usePrefersReducedMotion.cjs.map +1 -0
  60. package/dist/components/AiButton/AiButton.mjs +153 -0
  61. package/dist/components/AiButton/AiButton.mjs.map +1 -0
  62. package/dist/components/AnimatedNumber/AnimatedNumber.mjs +153 -0
  63. package/dist/components/AnimatedNumber/AnimatedNumber.mjs.map +1 -0
  64. package/dist/components/ButtonIconGroup/ButtonIconGroup.mjs +41 -0
  65. package/dist/components/ButtonIconGroup/ButtonIconGroup.mjs.map +1 -0
  66. package/dist/components/Chart/ChartLoadingOverlay.mjs +24 -2
  67. package/dist/components/Chart/ChartLoadingOverlay.mjs.map +1 -1
  68. package/dist/components/Chart/ChartMetricTrend.mjs +54 -0
  69. package/dist/components/Chart/ChartMetricTrend.mjs.map +1 -0
  70. package/dist/components/Chart/ChartSkeleton.mjs +78 -0
  71. package/dist/components/Chart/ChartSkeleton.mjs.map +1 -0
  72. package/dist/components/Chip/Chip.mjs +40 -11
  73. package/dist/components/Chip/Chip.mjs.map +1 -1
  74. package/dist/components/CountryFlag/CountryFlag.mjs +74 -0
  75. package/dist/components/CountryFlag/CountryFlag.mjs.map +1 -0
  76. package/dist/components/CountryFlag/flagShapes.mjs +3358 -0
  77. package/dist/components/CountryFlag/flagShapes.mjs.map +1 -0
  78. package/dist/components/CreatorTile/CreatorTile.mjs +2 -1
  79. package/dist/components/CreatorTile/CreatorTile.mjs.map +1 -1
  80. package/dist/components/CyclingText/CyclingText.mjs +9 -26
  81. package/dist/components/CyclingText/CyclingText.mjs.map +1 -1
  82. package/dist/components/CyclingText/useCyclingMotion.mjs +36 -0
  83. package/dist/components/CyclingText/useCyclingMotion.mjs.map +1 -0
  84. package/dist/components/Demographics/Demographics.mjs +22 -0
  85. package/dist/components/Demographics/Demographics.mjs.map +1 -0
  86. package/dist/components/Drawer/Drawer.mjs +9 -1
  87. package/dist/components/Drawer/Drawer.mjs.map +1 -1
  88. package/dist/components/DropdownMenu/DropdownMenu.mjs +122 -16
  89. package/dist/components/DropdownMenu/DropdownMenu.mjs.map +1 -1
  90. package/dist/components/IconButton/IconButton.mjs +11 -1
  91. package/dist/components/IconButton/IconButton.mjs.map +1 -1
  92. package/dist/components/ProgressBar/ProgressBar.mjs +9 -1
  93. package/dist/components/ProgressBar/ProgressBar.mjs.map +1 -1
  94. package/dist/components/Tabs/TabsList.mjs +123 -91
  95. package/dist/components/Tabs/TabsList.mjs.map +1 -1
  96. package/dist/components/Tooltip/Tooltip.mjs +37 -26
  97. package/dist/components/Tooltip/Tooltip.mjs.map +1 -1
  98. package/dist/components/Tooltip/TooltipLabel.mjs +54 -0
  99. package/dist/components/Tooltip/TooltipLabel.mjs.map +1 -0
  100. package/dist/components/TrendPill/TrendPill.mjs +29 -0
  101. package/dist/components/TrendPill/TrendPill.mjs.map +1 -0
  102. package/dist/components/UserDisplayName/UserDisplayName.mjs +13 -1
  103. package/dist/components/UserDisplayName/UserDisplayName.mjs.map +1 -1
  104. package/dist/components/UserItem/UserItem.mjs +21 -2
  105. package/dist/components/UserItem/UserItem.mjs.map +1 -1
  106. package/dist/components/UserItem/UserItemTrailing.mjs +17 -0
  107. package/dist/components/UserItem/UserItemTrailing.mjs.map +1 -0
  108. package/dist/flags.d.ts +59 -0
  109. package/dist/flags.mjs +6 -0
  110. package/dist/flags.mjs.map +1 -0
  111. package/dist/index.d.ts +458 -19
  112. package/dist/index.mjs +16 -1
  113. package/dist/index.mjs.map +1 -1
  114. package/dist/styles/base.css +166 -0
  115. package/dist/styles/theme.css +12 -0
  116. package/dist/utils/usePrefersReducedMotion.mjs +22 -0
  117. package/dist/utils/usePrefersReducedMotion.mjs.map +1 -0
  118. package/package.json +13 -2
  119. package/dist/cjs/components/CyclingText/usePrefersReducedMotion.cjs.map +0 -1
  120. package/dist/components/CyclingText/usePrefersReducedMotion.mjs +0 -22
  121. package/dist/components/CyclingText/usePrefersReducedMotion.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.mjs","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Count, type CountVariant } from \"../Count/Count\";\n\n/** Visual variant of the chip. */\nexport type ChipVariant = \"rounded\" | \"square\" | \"dark\";\n/** Height of the chip in pixels. */\nexport type ChipSize = \"32\" | \"40\";\n\nexport interface ChipProps extends React.HTMLAttributes<HTMLElement> {\n /** Visual variant of the chip. @default \"rounded\" */\n variant?: ChipVariant;\n /** Height of the chip in pixels. @default \"32\" */\n size?: ChipSize;\n /** Whether the chip is in a selected (pressed) state. @default false */\n selected?: boolean;\n /** Whether the chip is disabled. @default false */\n disabled?: boolean;\n /** Whether to show a coloured status dot at the leading edge. @default false */\n leftDot?: boolean;\n /**\n * Whether the chip uses a dashed border for add/create affordances.\n * When `selected`, it becomes a subtle filled state with a solid border.\n * Has no effect when `variant=\"dark\"`.\n * @default false\n */\n dotted?: boolean;\n /** Icon element displayed before the label. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed after the label. */\n rightIcon?: React.ReactNode;\n /** Notification badge content (e.g. `\"99+\"`). Passed as a string for i18n support. */\n notificationLabel?: string;\n /** Numeric value for the notification badge. Uses the `Count` component for overflow formatting. Takes precedence over `notificationLabel` when both are provided. */\n notificationCount?: number;\n /** Maximum value before the badge shows overflow (e.g. `\"9+\"`). Only applies when `notificationCount` is set. @default 99 */\n notificationMax?: number;\n /** Colour variant of the notification badge. @default \"brand\" */\n notificationVariant?: CountVariant;\n /** Click handler — when provided, the chip renders as a `<button>` for accessibility. */\n onClick?: React.MouseEventHandler<HTMLElement>;\n /** Merge props onto a child element instead of rendering a wrapper. @default false */\n asChild?: boolean;\n}\n\n/**\n * A compact element for filters, tags, or toggleable actions. When an `onClick`\n * handler is provided, the chip renders as an interactive `<button>` with\n * `aria-pressed` support.\n *\n * @example\n * ```tsx\n * <Chip selected onClick={toggle}>Music</Chip>\n * ```\n */\nexport const Chip = React.forwardRef<HTMLButtonElement, ChipProps>(\n (\n {\n className,\n variant = \"rounded\",\n size = \"32\",\n selected = false,\n disabled = false,\n leftDot = false,\n dotted = false,\n leftIcon,\n rightIcon,\n notificationLabel,\n notificationCount,\n notificationMax,\n notificationVariant = \"brand\",\n onClick,\n asChild = false,\n children,\n ...props\n },\n ref,\n // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Variant-heavy UI component\n ) => {\n const isInteractive = !!onClick && !asChild;\n const Comp = asChild ? Slot : isInteractive ? \"button\" : \"span\";\n const isDark = variant === \"dark\";\n\n // The dashed border is drawn as an SVG so the dash length matches the design\n // spec (8/8 for the 40px square, 6/6 otherwise). CSS `border-dashed` only\n // renders browser-default dash lengths, which are too short. The stroke colour\n // is driven by `currentColor`, and `group-hover`/`group-active` react to the\n // chip's interactive states. Rendered only in the default (non-`asChild`) path.\n const showDottedBorder = !isDark && dotted && !selected && !asChild;\n const dottedBorder = showDottedBorder ? (\n <svg\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute inset-0 size-full overflow-visible\",\n disabled ? \"text-buttons-chip-disabled\" : \"text-buttons-chip-dotted-default\",\n isInteractive &&\n !disabled &&\n \"group-hover:text-buttons-chip-dotted-hover-stroke group-active:text-buttons-chip-dotted-hover-stroke\",\n )}\n >\n <rect\n x=\"0.5\"\n y=\"0.5\"\n rx={variant === \"square\" ? 7.5 : size === \"40\" ? 19.5 : 15.5}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1\"\n strokeDasharray={variant === \"square\" && size === \"40\" ? \"8 8\" : \"6 6\"}\n style={{ width: \"calc(100% - 1px)\", height: \"calc(100% - 1px)\" }}\n />\n </svg>\n ) : null;\n\n return (\n <Comp\n ref={ref}\n data-testid=\"chip\"\n className={cn(\n \"relative inline-flex min-w-0 items-center justify-center whitespace-nowrap motion-safe:transition-colors motion-safe:duration-150\",\n // Shape\n variant === \"square\" ? \"rounded-xs\" : \"rounded-full\",\n // Size (32px uses 12px text, 40px uses 14px text per the design spec)\n size === \"32\" && \"typography-description-12px-semibold h-8 py-1\",\n size === \"40\" && \"typography-body-small-14px-semibold h-10 py-2.5\",\n // Variant colors\n isDark && \"bg-neutral-alphas-600 text-content-always-white\",\n !isDark && selected && !dotted && \"bg-buttons-chip-active text-content-primary-inverted\",\n // Active + dotted is a subtle filled state with a solid (non-dashed) border.\n !isDark &&\n selected &&\n dotted &&\n \"border border-border-primary border-solid bg-inputs-inputs-primary text-content-primary\",\n !isDark && !selected && !dotted && \"bg-buttons-chip-default text-content-primary\",\n // Dotted (non-selected): the dashed border is drawn via SVG (`dottedBorder`).\n // `group` lets that SVG react to hover/active. `asChild` keeps a CSS dashed\n // border fallback since the SVG is only rendered in the default path.\n !isDark && !selected && dotted && \"bg-transparent text-content-primary\",\n !isDark && !selected && dotted && !asChild && \"group\",\n asChild &&\n !isDark &&\n !selected &&\n dotted &&\n (disabled\n ? \"border border-buttons-chip-disabled border-dashed\"\n : \"border border-buttons-chip-dotted-default border-dashed\"),\n // Interactive\n isInteractive && !disabled && \"cursor-pointer\",\n isInteractive &&\n !disabled &&\n !isDark &&\n !selected &&\n !dotted &&\n \"hover:bg-buttons-chip-hover\",\n isInteractive &&\n !disabled &&\n !isDark &&\n !selected &&\n dotted &&\n \"hover:bg-neutral-alphas-50 active:bg-neutral-alphas-50\",\n // Focus\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n // Disabled\n disabled && isDark && \"pointer-events-none opacity-50\",\n disabled && !isDark && \"pointer-events-none text-content-disabled\",\n // Solid (non-dotted) disabled chips get a muted fill; dotted ones stay\n // transparent with their dashed border (drawn via SVG).\n disabled && !isDark && !dotted && \"bg-buttons-chip-disabled\",\n className,\n )}\n {...(isInteractive && {\n type: \"button\" as const,\n disabled,\n \"aria-pressed\": selected,\n onClick,\n })}\n {...(!isInteractive && disabled && { \"aria-disabled\": true })}\n {...(selected && { \"data-selected\": \"\" })}\n {...props}\n >\n {asChild ? (\n <Slottable>{children}</Slottable>\n ) : (\n <>\n {dottedBorder}\n <span className=\"flex min-w-0 items-center gap-0.5 overflow-hidden px-3\">\n {leftDot && (\n <span className=\"size-2 shrink-0 rounded-full bg-current\" aria-hidden=\"true\" />\n )}\n {leftIcon && (\n <span className=\"flex shrink-0 items-center justify-center\" aria-hidden=\"true\">\n {leftIcon}\n </span>\n )}\n <span className=\"min-w-0 truncate\">{children}</span>\n {rightIcon && (\n <span\n className=\"flex size-5 shrink-0 items-center justify-center\"\n aria-hidden=\"true\"\n >\n {rightIcon}\n </span>\n )}\n </span>\n {(notificationCount != null || notificationLabel) && (\n <Count\n variant={notificationVariant}\n size=\"32\"\n className={cn(\n // V2 Notification Count: 20px high/min-width, caption 12,\n // 4px horizontal and 2px vertical padding, rounded-md.\n \"absolute top-[-4px] rounded-md px-1 py-0.5\",\n // Anchor the leading edge so wider values grow away from the label.\n size === \"40\" ? \"left-[calc(100%_-_16px)]\" : \"left-[calc(100%_-_11px)]\",\n )}\n value={notificationCount ?? 0}\n max={notificationMax}\n >\n {notificationCount == null ? notificationLabel : undefined}\n </Count>\n )}\n </>\n )}\n </Comp>\n );\n },\n);\n\nChip.displayName = \"Chip\";\n"],"names":[],"mappings":";;;;;;AAwDO,MAAM,OAAO,MAAM;AAAA,EACxB,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV,OAAO;AAAA,IACP,WAAW;AAAA,IACX,WAAW;AAAA,IACX,UAAU;AAAA,IACV,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,sBAAsB;AAAA,IACtB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QAEG;AACH,UAAM,gBAAgB,CAAC,CAAC,WAAW,CAAC;AACpC,UAAM,OAAO,UAAU,OAAO,gBAAgB,WA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AIR;AACF;AAEA,KAAK,cAAc;"}
1
+ {"version":3,"file":"Chip.mjs","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Count, type CountVariant } from \"../Count/Count\";\n\n/** Visual variant of the chip. */\nexport type ChipVariant = \"rounded\" | \"square\" | \"dark\";\n/** Height of the chip in pixels. */\nexport type ChipSize = \"32\" | \"40\";\n\nexport interface ChipProps extends React.HTMLAttributes<HTMLElement> {\n /** Visual variant of the chip. @default \"rounded\" */\n variant?: ChipVariant;\n /** Height of the chip in pixels. @default \"32\" */\n size?: ChipSize;\n /** Whether the chip is in a selected (pressed) state. @default false */\n selected?: boolean;\n /** Whether the chip is disabled. @default false */\n disabled?: boolean;\n /** Whether to show a coloured status dot at the leading edge. @default false */\n leftDot?: boolean;\n /**\n * Whether the chip uses a dashed border for add/create affordances.\n * When `selected`, it becomes a subtle filled state with a solid border.\n * Has no effect when `variant=\"dark\"`.\n * @default false\n */\n dotted?: boolean;\n /**\n * Draws the unselected state as a 1px `buttons-chip-default` outline over a\n * transparent background instead of filling with that same token. This is the\n * Figma `V2 Insights Chips` treatment, used where chips sit over a chart and a\n * row of solid fills would compete with the plotted series. The selected state\n * is unaffected — it stays filled — as are the `dark` and `dotted` variants.\n * @default false\n */\n outlined?: boolean;\n /** Icon element displayed before the label. */\n leftIcon?: React.ReactNode;\n /** Icon element displayed after the label. */\n rightIcon?: React.ReactNode;\n /** Notification badge content (e.g. `\"99+\"`). Passed as a string for i18n support. */\n notificationLabel?: string;\n /** Numeric value for the notification badge. Uses the `Count` component for overflow formatting. Takes precedence over `notificationLabel` when both are provided. */\n notificationCount?: number;\n /** Maximum value before the badge shows overflow (e.g. `\"9+\"`). Only applies when `notificationCount` is set. @default 99 */\n notificationMax?: number;\n /** Colour variant of the notification badge. @default \"brand\" */\n notificationVariant?: CountVariant;\n /** Click handler — when provided, the chip renders as a `<button>` for accessibility. */\n onClick?: React.MouseEventHandler<HTMLElement>;\n /** Merge props onto a child element instead of rendering a wrapper. @default false */\n asChild?: boolean;\n}\n\n/**\n * A compact element for filters, tags, or toggleable actions. When an `onClick`\n * handler is provided, the chip renders as an interactive `<button>` with\n * `aria-pressed` support.\n *\n * @example\n * ```tsx\n * <Chip selected onClick={toggle}>Music</Chip>\n * ```\n */\nexport const Chip = React.forwardRef<HTMLButtonElement, ChipProps>(\n (\n {\n className,\n variant = \"rounded\",\n size = \"32\",\n selected = false,\n disabled = false,\n leftDot = false,\n dotted = false,\n outlined = false,\n leftIcon,\n rightIcon,\n notificationLabel,\n notificationCount,\n notificationMax,\n notificationVariant = \"brand\",\n onClick,\n asChild = false,\n children,\n ...props\n },\n ref,\n // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Variant-heavy UI component\n ) => {\n const isInteractive = !!onClick && !asChild;\n const Comp = asChild ? Slot : isInteractive ? \"button\" : \"span\";\n const isDark = variant === \"dark\";\n // Precedence between the three treatments, named once rather than re-derived per\n // rule: `dark` owns its own palette, `dotted` wins over `outlined`, and what is\n // left is the normal chip, either filled or outlined.\n const isDotted = !isDark && dotted;\n const isSolid = !isDark && !dotted && !outlined;\n const isOutlined = !isDark && !dotted && outlined;\n\n // The dashed border is drawn as an SVG so the dash length matches the design\n // spec (8/8 for the 40px square, 6/6 otherwise). CSS `border-dashed` only\n // renders browser-default dash lengths, which are too short. The stroke colour\n // is driven by `currentColor`, and `group-hover`/`group-active` react to the\n // chip's interactive states. Rendered only in the default (non-`asChild`) path.\n const showDottedBorder = isDotted && !selected && !asChild;\n const dottedBorder = showDottedBorder ? (\n <svg\n aria-hidden=\"true\"\n className={cn(\n // `-1px` spans the reserved transparent border rather than the padding box\n // inside it, so the dash lands on the same ring as the solid border it\n // becomes when selected.\n \"pointer-events-none absolute -top-px -left-px h-[calc(100%+2px)] w-[calc(100%+2px)] overflow-visible\",\n disabled ? \"text-buttons-chip-disabled\" : \"text-buttons-chip-dotted-default\",\n isInteractive &&\n !disabled &&\n \"group-hover:text-buttons-chip-dotted-hover-stroke group-active:text-buttons-chip-dotted-hover-stroke\",\n )}\n >\n <rect\n x=\"0.5\"\n y=\"0.5\"\n rx={variant === \"square\" ? 7.5 : size === \"40\" ? 19.5 : 15.5}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1\"\n strokeDasharray={variant === \"square\" && size === \"40\" ? \"8 8\" : \"6 6\"}\n style={{ width: \"calc(100% - 1px)\", height: \"calc(100% - 1px)\" }}\n />\n </svg>\n ) : null;\n\n return (\n <Comp\n ref={ref}\n data-testid=\"chip\"\n className={cn(\n \"relative inline-flex min-w-0 items-center justify-center whitespace-nowrap motion-safe:transition-colors motion-safe:duration-150\",\n // Shape\n variant === \"square\" ? \"rounded-xs\" : \"rounded-full\",\n // Size (32px uses 12px text, 40px uses 14px text per the design spec)\n size === \"32\" && \"typography-description-12px-semibold h-8 py-1\",\n size === \"40\" && \"typography-body-small-14px-semibold h-10 py-2.5\",\n // Variant colors\n isDark && \"bg-neutral-alphas-600 text-content-always-white\",\n (isSolid || isOutlined) &&\n selected &&\n \"bg-buttons-chip-active text-content-primary-inverted\",\n // Active + dotted is a subtle filled state with a solid (non-dashed) border.\n isDotted &&\n selected &&\n \"border border-border-primary border-solid bg-inputs-inputs-primary text-content-primary\",\n isSolid && !selected && \"bg-buttons-chip-default text-content-primary\",\n // Outlined: the same token as a 1px stroke rather than a fill. The border\n // is declared in BOTH states and only changes colour, going transparent\n // once selected. It cannot be dropped on selection: `border-box` constrains\n // only explicitly sized axes, and a chip's width is intrinsic, so losing the\n // border would narrow the chip by 2px and reflow the whole row on every\n // click. Height is safe either way because `h-8` is explicit.\n isOutlined && \"border border-solid\",\n isOutlined &&\n !selected &&\n \"border-buttons-chip-default bg-transparent text-content-primary\",\n isOutlined && selected && \"border-transparent\",\n // Dotted (non-selected): the dashed border is drawn via SVG (`dottedBorder`).\n // `group` lets that SVG react to hover/active. `asChild` keeps a CSS dashed\n // border fallback since the SVG is only rendered in the default path.\n isDotted && !selected && \"bg-transparent text-content-primary\",\n isDotted && !selected && !asChild && \"group\",\n // The SVG path draws no CSS border, so selecting one used to add 1px and\n // widen the chip by 2px, shifting the row on every toggle. Reserving a\n // transparent border also puts the dash on the same ring as the solid\n // border it becomes. The `asChild` path already has a real border below.\n isDotted && !selected && !asChild && \"border border-transparent border-solid\",\n isDotted &&\n !selected &&\n asChild &&\n (disabled\n ? \"border border-buttons-chip-disabled border-dashed\"\n : \"border border-buttons-chip-dotted-default border-dashed\"),\n // Interactive\n isInteractive && !disabled && \"cursor-pointer\",\n isInteractive && !disabled && isSolid && !selected && \"hover:bg-buttons-chip-hover\",\n // Outlined darkens its stroke rather than filling. `buttons-chip-hover` is\n // the one-step darkening for chips, but as a fill it is 20% over a 10%\n // stroke, so it swallows the outline the variant exists to show. Moved onto\n // the border, over `interaction-hover`, the atomic hover surface.\n isInteractive &&\n !disabled &&\n isOutlined &&\n !selected &&\n \"hover:border-buttons-chip-hover hover:bg-interaction-hover\",\n isInteractive &&\n !disabled &&\n isDotted &&\n !selected &&\n \"hover:bg-neutral-alphas-50 active:bg-neutral-alphas-50\",\n // Focus\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n // Disabled\n disabled && isDark && \"pointer-events-none opacity-50\",\n disabled && !isDark && \"pointer-events-none text-content-disabled\",\n // Solid (non-dotted) disabled chips get a muted fill; dotted ones stay\n // transparent with their dashed border (drawn via SVG).\n disabled && (isSolid || (isOutlined && selected)) && \"bg-buttons-chip-disabled\",\n // Unselected outlined greys only its stroke. Selected is already filled, so\n // it takes the muted fill above and keeps `border-transparent` for its width.\n disabled && isOutlined && !selected && \"border-buttons-chip-disabled\",\n className,\n )}\n {...(isInteractive && {\n type: \"button\" as const,\n disabled,\n \"aria-pressed\": selected,\n onClick,\n })}\n {...(!isInteractive && disabled && { \"aria-disabled\": true })}\n {...(selected && { \"data-selected\": \"\" })}\n {...props}\n >\n {asChild ? (\n <Slottable>{children}</Slottable>\n ) : (\n <>\n {dottedBorder}\n <span className=\"flex min-w-0 items-center gap-0.5 overflow-hidden px-3\">\n {leftDot && (\n <span className=\"size-2 shrink-0 rounded-full bg-current\" aria-hidden=\"true\" />\n )}\n {leftIcon && (\n <span className=\"flex shrink-0 items-center justify-center\" aria-hidden=\"true\">\n {leftIcon}\n </span>\n )}\n <span className=\"min-w-0 truncate\">{children}</span>\n {rightIcon && (\n <span\n className=\"flex size-5 shrink-0 items-center justify-center\"\n aria-hidden=\"true\"\n >\n {rightIcon}\n </span>\n )}\n </span>\n {(notificationCount != null || notificationLabel) && (\n <Count\n variant={notificationVariant}\n size=\"32\"\n className={cn(\n // V2 Notification Count: 20px high/min-width, caption 12,\n // 4px horizontal and 2px vertical padding, rounded-md.\n \"absolute top-[-4px] rounded-md px-1 py-0.5\",\n // Anchor the leading edge so wider values grow away from the label.\n size === \"40\" ? \"left-[calc(100%_-_16px)]\" : \"left-[calc(100%_-_11px)]\",\n )}\n value={notificationCount ?? 0}\n max={notificationMax}\n >\n {notificationCount == null ? notificationLabel : undefined}\n </Count>\n )}\n </>\n )}\n </Comp>\n );\n },\n);\n\nChip.displayName = \"Chip\";\n"],"names":[],"mappings":";;;;;;AAiEO,MAAM,OAAO,MAAM;AAAA,EACxB,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV,OAAO;AAAA,IACP,WAAW;AAAA,IACX,WAAW;AAAA,IACX,UAAU;AAAA,IACV,SAAS;AAAA,IACT,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,sBAAsB;AAAA,IACtB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QAEG;AACH,UAAM,gBAAgB,CAAC,CAAC,WAAW,CAAC;AACpC,UAAM,OAAO,UAAU,OAAO,gBAAgB,WAAW;AACzD,UAAM,SAAS,YAAY;AAI3B,UAAM,WAAW,CAAC,UAA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cACL,WAAW;AAAA;AAAA;AAAA,gBAGT;AAAA;AAAA,gBAEA,SAAS,OAAO,6BAA6B;AAAA,cAAA;AAAA,cAE/C,OAAO,qBAAqB;AAAA,cAC5B,KAAK;AAAA,cAEJ,UAAA,qBAAqB,OAAO,oBAAoB;AAAA,YAAA;AAAA,UAAA;AAAA,QACnD,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,KAAK,cAAc;"}
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../../utils/cn.mjs";
5
+ import { FLAG_SHAPES } from "./flagShapes.mjs";
6
+ const SIZE_CLASS = {
7
+ 16: "size-4",
8
+ 20: "size-5",
9
+ 24: "size-6",
10
+ 32: "size-8"
11
+ };
12
+ const UNKNOWN_CODE = "xx";
13
+ const renderShape = (shape, index) => {
14
+ switch (shape.tag) {
15
+ case "path":
16
+ return /* @__PURE__ */ jsx("path", { fill: shape.fill, d: shape.d }, index);
17
+ case "circle":
18
+ return /* @__PURE__ */ jsx("circle", { fill: shape.fill, cx: shape.cx, cy: shape.cy, r: shape.r }, index);
19
+ case "rect":
20
+ return /* @__PURE__ */ jsx(
21
+ "rect",
22
+ {
23
+ fill: shape.fill,
24
+ x: shape.x,
25
+ y: shape.y,
26
+ width: shape.width,
27
+ height: shape.height,
28
+ rx: shape.rx,
29
+ ry: shape.ry
30
+ },
31
+ index
32
+ );
33
+ case "ellipse":
34
+ return /* @__PURE__ */ jsx(
35
+ "ellipse",
36
+ {
37
+ fill: shape.fill,
38
+ cx: shape.cx,
39
+ cy: shape.cy,
40
+ rx: shape.rx,
41
+ ry: shape.ry
42
+ },
43
+ index
44
+ );
45
+ }
46
+ };
47
+ const CountryFlag = React.forwardRef(
48
+ ({ country, size = 20, label, className, ...props }, ref) => {
49
+ const generatedId = React.useId();
50
+ const maskId = `country-flag-${generatedId.replace(/:/g, "")}`;
51
+ const shapes = FLAG_SHAPES[country.toLowerCase()] ?? FLAG_SHAPES[UNKNOWN_CODE];
52
+ return /* @__PURE__ */ jsxs(
53
+ "svg",
54
+ {
55
+ ref,
56
+ viewBox: "0 0 512 512",
57
+ className: cn("shrink-0", SIZE_CLASS[size], className),
58
+ role: label ? "img" : void 0,
59
+ "aria-hidden": label ? void 0 : true,
60
+ ...props,
61
+ children: [
62
+ label && /* @__PURE__ */ jsx("title", { children: label }),
63
+ /* @__PURE__ */ jsx("mask", { id: maskId, children: /* @__PURE__ */ jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
64
+ /* @__PURE__ */ jsx("g", { mask: `url(#${maskId})`, children: shapes.map(renderShape) })
65
+ ]
66
+ }
67
+ );
68
+ }
69
+ );
70
+ CountryFlag.displayName = "CountryFlag";
71
+ export {
72
+ CountryFlag
73
+ };
74
+ //# sourceMappingURL=CountryFlag.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CountryFlag.mjs","sources":["../../../src/components/CountryFlag/CountryFlag.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { type CountryFlagCode, FLAG_SHAPES, type FlagShape } from \"./flagShapes\";\n\nconst SIZE_CLASS = {\n 16: \"size-4\",\n 20: \"size-5\",\n 24: \"size-6\",\n 32: \"size-8\",\n} as const;\n\n/** Rendered edge length in px. */\nexport type CountryFlagSize = keyof typeof SIZE_CLASS;\n\n/** The source's placeholder disc, used for any code we hold no artwork for. */\nconst UNKNOWN_CODE = \"xx\" as const;\n\n/** Props for {@link CountryFlag}. */\nexport interface CountryFlagProps extends Omit<React.SVGProps<SVGSVGElement>, \"children\"> {\n /**\n * Two-letter country code, case-insensitive (e.g. `\"US\"`, `\"nl\"`). Codes we\n * hold no artwork for render a grey placeholder disc, so a live feed of\n * country codes can be passed straight through.\n */\n country: string;\n /** Rendered edge length in px. Defaults to 20, the size the designs use. */\n size?: CountryFlagSize;\n /**\n * Accessible name, e.g. the country's translated name. Leave unset when the\n * flag sits next to that name anyway — it is then hidden from assistive tech\n * rather than read out twice.\n */\n label?: string;\n}\n\nconst renderShape = (shape: FlagShape, index: number) => {\n switch (shape.tag) {\n case \"path\":\n return <path key={index} fill={shape.fill} d={shape.d} />;\n case \"circle\":\n return <circle key={index} fill={shape.fill} cx={shape.cx} cy={shape.cy} r={shape.r} />;\n case \"rect\":\n return (\n <rect\n key={index}\n fill={shape.fill}\n x={shape.x}\n y={shape.y}\n width={shape.width}\n height={shape.height}\n rx={shape.rx}\n ry={shape.ry}\n />\n );\n case \"ellipse\":\n return (\n <ellipse\n key={index}\n fill={shape.fill}\n cx={shape.cx}\n cy={shape.cy}\n rx={shape.rx}\n ry={shape.ry}\n />\n );\n }\n};\n\n/**\n * A country's flag, drawn as a circle. Use it wherever a row is keyed by\n * country — a demographics breakdown, a country picker, the country selector on\n * `PhoneField`.\n *\n * Prefer this to a flag emoji: emoji flags fall back to bare letter pairs on\n * Windows, where the fonts carry no flag glyphs.\n *\n * @example\n * ```tsx\n * <CountryFlag country=\"US\" label=\"United States\" />\n * ```\n */\nexport const CountryFlag = React.forwardRef<SVGSVGElement, CountryFlagProps>(\n ({ country, size = 20, label, className, ...props }, ref) => {\n const generatedId = React.useId();\n // Several flags share a page, so the clipping mask needs an id of its own.\n // Strip the colons React 18's `useId` produces — a url(#...) reference\n // can't carry them.\n const maskId = `country-flag-${generatedId.replace(/:/g, \"\")}`;\n\n // Unmapped codes fall back to the source's own `xx` placeholder — a plain\n // grey disc — rather than rendering nothing. A live feed can hand us a code\n // we hold no artwork for, and a blank where every other row has a glyph\n // reads as a broken image rather than an unknown country. Using `xx` keeps\n // the placeholder on the same viewBox and circular mask as a real flag,\n // which a hand-drawn disc would not.\n const shapes =\n FLAG_SHAPES[country.toLowerCase() as CountryFlagCode] ?? FLAG_SHAPES[UNKNOWN_CODE];\n\n return (\n <svg\n ref={ref}\n viewBox=\"0 0 512 512\"\n className={cn(\"shrink-0\", SIZE_CLASS[size], className)}\n role={label ? \"img\" : undefined}\n aria-hidden={label ? undefined : true}\n {...props}\n >\n {label && <title>{label}</title>}\n <mask id={maskId}>\n <circle cx=\"256\" cy=\"256\" r=\"256\" fill=\"#fff\" />\n </mask>\n <g mask={`url(#${maskId})`}>{shapes.map(renderShape)}</g>\n </svg>\n );\n },\n);\n\nCountryFlag.displayName = \"CountryFlag\";\n"],"names":[],"mappings":";;;;;AAIA,MAAM,aAAa;AAAA,EACjB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAMA,MAAM,eAAe;AAoBrB,MAAM,cAAc,CAAC,OAAkB,UAAkB;AACvD,UAAQ,MAAM,KAAA;AAAA,IACZ,KAAK;AACH,aAAO,oBAAC,UAAiB,MAAM,MAAM,MAAM,GAAG,MAAM,KAAlC,KAAqC;AAAA,IACzD,KAAK;AACH,aAAO,oBAAC,UAAA,EAAmB,MAAM,MAAM,MAAM,IAAI,MAAM,IAAI,IAAI,MAAM,IAAI,GAAG,MAAM,KAA9D,KAAiE;AAAA,IACvF,KAAK;AACH,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,MAAM,MAAM;AAAA,UACZ,GAAG,MAAM;AAAA,UACT,GAAG,MAAM;AAAA,UACT,OAAO,MAAM;AAAA,UACb,QAAQ,MAAM;AAAA,UACd,IAAI,MAAM;AAAA,UACV,IAAI,MAAM;AAAA,QAAA;AAAA,QAPL;AAAA,MAAA;AAAA,IAUX,KAAK;AACH,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,MAAM,MAAM;AAAA,UACZ,IAAI,MAAM;AAAA,UACV,IAAI,MAAM;AAAA,UACV,IAAI,MAAM;AAAA,UACV,IAAI,MAAM;AAAA,QAAA;AAAA,QALL;AAAA,MAAA;AAAA,EAMP;AAGR;AAeO,MAAM,cAAc,MAAM;AAAA,EAC/B,CAAC,EAAE,SAAS,OAAO,IAAI,OAAO,WAAW,GAAG,MAAA,GAAS,QAAQ;A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