@fanvue/ui 3.52.0 → 3.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/cjs/components/Autocomplete/Autocomplete.cjs +34 -10
  2. package/dist/cjs/components/Autocomplete/Autocomplete.cjs.map +1 -1
  3. package/dist/cjs/components/Autocomplete/AutocompleteOptionItem.cjs +13 -1
  4. package/dist/cjs/components/Autocomplete/AutocompleteOptionItem.cjs.map +1 -1
  5. package/dist/cjs/components/BottomNavigation/BottomNavigation.cjs +2 -2
  6. package/dist/cjs/components/BottomNavigation/BottomNavigation.cjs.map +1 -1
  7. package/dist/cjs/components/Card/Card.cjs +5 -2
  8. package/dist/cjs/components/Card/Card.cjs.map +1 -1
  9. package/dist/cjs/components/Chart/ChartCard.cjs +2 -1
  10. package/dist/cjs/components/Chart/ChartCard.cjs.map +1 -1
  11. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs +1 -1
  12. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs.map +1 -1
  13. package/dist/cjs/components/ChatInput/ChatInput.cjs +2 -2
  14. package/dist/cjs/components/ChatInput/ChatInput.cjs.map +1 -1
  15. package/dist/cjs/components/ChatMessage/ChatMessage.cjs +1 -1
  16. package/dist/cjs/components/ChatMessage/ChatMessage.cjs.map +1 -1
  17. package/dist/cjs/components/CreatorCard/CreatorCard.cjs +3 -5
  18. package/dist/cjs/components/CreatorCard/CreatorCard.cjs.map +1 -1
  19. package/dist/cjs/components/CreatorCover/CreatorCover.cjs +11 -7
  20. package/dist/cjs/components/CreatorCover/CreatorCover.cjs.map +1 -1
  21. package/dist/cjs/components/DatePicker/DatePicker.cjs +37 -16
  22. package/dist/cjs/components/DatePicker/DatePicker.cjs.map +1 -1
  23. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs +33 -10
  24. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs.map +1 -1
  25. package/dist/cjs/components/DropdownMenu/DropdownMenuReorderItem.cjs +2 -1
  26. package/dist/cjs/components/DropdownMenu/DropdownMenuReorderItem.cjs.map +1 -1
  27. package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs +18 -13
  28. package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs.map +1 -1
  29. package/dist/cjs/components/DropdownMenu/DropdownMenuSelectionItems.cjs +56 -40
  30. package/dist/cjs/components/DropdownMenu/DropdownMenuSelectionItems.cjs.map +1 -1
  31. package/dist/cjs/components/IconButton/IconButton.cjs +5 -2
  32. package/dist/cjs/components/IconButton/IconButton.cjs.map +1 -1
  33. package/dist/cjs/components/Icons/MenuRowIcon.cjs +9 -2
  34. package/dist/cjs/components/Icons/MenuRowIcon.cjs.map +1 -1
  35. package/dist/cjs/components/Icons/VerifiedIcon.cjs +9 -15
  36. package/dist/cjs/components/Icons/VerifiedIcon.cjs.map +1 -1
  37. package/dist/cjs/components/PhoneField/PhoneField.cjs +21 -17
  38. package/dist/cjs/components/PhoneField/PhoneField.cjs.map +1 -1
  39. package/dist/cjs/components/Popover/Popover.cjs +69 -0
  40. package/dist/cjs/components/Popover/Popover.cjs.map +1 -0
  41. package/dist/cjs/components/Select/Select.cjs +40 -12
  42. package/dist/cjs/components/Select/Select.cjs.map +1 -1
  43. package/dist/cjs/components/Slider/SliderThumb.cjs +3 -2
  44. package/dist/cjs/components/Slider/SliderThumb.cjs.map +1 -1
  45. package/dist/cjs/components/Snackbar/Snackbar.cjs +1 -1
  46. package/dist/cjs/components/Snackbar/Snackbar.cjs.map +1 -1
  47. package/dist/cjs/components/Switch/Switch.cjs +1 -1
  48. package/dist/cjs/components/Switch/Switch.cjs.map +1 -1
  49. package/dist/cjs/components/Table/Table.cjs +46 -5
  50. package/dist/cjs/components/Table/Table.cjs.map +1 -1
  51. package/dist/cjs/components/Tag/Tag.cjs +99 -0
  52. package/dist/cjs/components/Tag/Tag.cjs.map +1 -0
  53. package/dist/cjs/components/TextArea/TextArea.cjs +5 -4
  54. package/dist/cjs/components/TextArea/TextArea.cjs.map +1 -1
  55. package/dist/cjs/components/TextField/TextField.cjs +30 -15
  56. package/dist/cjs/components/TextField/TextField.cjs.map +1 -1
  57. package/dist/cjs/index.cjs +8 -0
  58. package/dist/cjs/index.cjs.map +1 -1
  59. package/dist/cjs/utils/floatingContentSurface.cjs +8 -0
  60. package/dist/cjs/utils/floatingContentSurface.cjs.map +1 -0
  61. package/dist/cjs/utils/inputFieldClasses.cjs +8 -0
  62. package/dist/cjs/utils/inputFieldClasses.cjs.map +1 -0
  63. package/dist/cjs/utils/pointerCapture.cjs +20 -0
  64. package/dist/cjs/utils/pointerCapture.cjs.map +1 -0
  65. package/dist/cjs/utils/useDragToDismiss.cjs +3 -2
  66. package/dist/cjs/utils/useDragToDismiss.cjs.map +1 -1
  67. package/dist/cjs/utils/useSuppressClickAfterDrag.cjs +2 -1
  68. package/dist/cjs/utils/useSuppressClickAfterDrag.cjs.map +1 -1
  69. package/dist/components/Autocomplete/Autocomplete.mjs +34 -10
  70. package/dist/components/Autocomplete/Autocomplete.mjs.map +1 -1
  71. package/dist/components/Autocomplete/AutocompleteOptionItem.mjs +13 -1
  72. package/dist/components/Autocomplete/AutocompleteOptionItem.mjs.map +1 -1
  73. package/dist/components/BottomNavigation/BottomNavigation.mjs +2 -2
  74. package/dist/components/BottomNavigation/BottomNavigation.mjs.map +1 -1
  75. package/dist/components/Card/Card.mjs +5 -2
  76. package/dist/components/Card/Card.mjs.map +1 -1
  77. package/dist/components/Chart/ChartCard.mjs +2 -1
  78. package/dist/components/Chart/ChartCard.mjs.map +1 -1
  79. package/dist/components/Chart/ChartLoadingOverlay.mjs +1 -1
  80. package/dist/components/Chart/ChartLoadingOverlay.mjs.map +1 -1
  81. package/dist/components/ChatInput/ChatInput.mjs +2 -2
  82. package/dist/components/ChatInput/ChatInput.mjs.map +1 -1
  83. package/dist/components/ChatMessage/ChatMessage.mjs +1 -1
  84. package/dist/components/ChatMessage/ChatMessage.mjs.map +1 -1
  85. package/dist/components/CreatorCard/CreatorCard.mjs +3 -5
  86. package/dist/components/CreatorCard/CreatorCard.mjs.map +1 -1
  87. package/dist/components/CreatorCover/CreatorCover.mjs +11 -7
  88. package/dist/components/CreatorCover/CreatorCover.mjs.map +1 -1
  89. package/dist/components/DatePicker/DatePicker.mjs +39 -18
  90. package/dist/components/DatePicker/DatePicker.mjs.map +1 -1
  91. package/dist/components/DropdownMenu/DropdownMenuItem.mjs +33 -10
  92. package/dist/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -1
  93. package/dist/components/DropdownMenu/DropdownMenuReorderItem.mjs +2 -1
  94. package/dist/components/DropdownMenu/DropdownMenuReorderItem.mjs.map +1 -1
  95. package/dist/components/DropdownMenu/DropdownMenuRoot.mjs +18 -13
  96. package/dist/components/DropdownMenu/DropdownMenuRoot.mjs.map +1 -1
  97. package/dist/components/DropdownMenu/DropdownMenuSelectionItems.mjs +56 -40
  98. package/dist/components/DropdownMenu/DropdownMenuSelectionItems.mjs.map +1 -1
  99. package/dist/components/IconButton/IconButton.mjs +5 -2
  100. package/dist/components/IconButton/IconButton.mjs.map +1 -1
  101. package/dist/components/Icons/MenuRowIcon.mjs +9 -2
  102. package/dist/components/Icons/MenuRowIcon.mjs.map +1 -1
  103. package/dist/components/Icons/VerifiedIcon.mjs +9 -15
  104. package/dist/components/Icons/VerifiedIcon.mjs.map +1 -1
  105. package/dist/components/PhoneField/PhoneField.mjs +21 -17
  106. package/dist/components/PhoneField/PhoneField.mjs.map +1 -1
  107. package/dist/components/Popover/Popover.mjs +51 -0
  108. package/dist/components/Popover/Popover.mjs.map +1 -0
  109. package/dist/components/Select/Select.mjs +40 -12
  110. package/dist/components/Select/Select.mjs.map +1 -1
  111. package/dist/components/Slider/SliderThumb.mjs +3 -2
  112. package/dist/components/Slider/SliderThumb.mjs.map +1 -1
  113. package/dist/components/Snackbar/Snackbar.mjs +1 -1
  114. package/dist/components/Snackbar/Snackbar.mjs.map +1 -1
  115. package/dist/components/Switch/Switch.mjs +1 -1
  116. package/dist/components/Switch/Switch.mjs.map +1 -1
  117. package/dist/components/Table/Table.mjs +46 -5
  118. package/dist/components/Table/Table.mjs.map +1 -1
  119. package/dist/components/Tag/Tag.mjs +82 -0
  120. package/dist/components/Tag/Tag.mjs.map +1 -0
  121. package/dist/components/TextArea/TextArea.mjs +5 -4
  122. package/dist/components/TextArea/TextArea.mjs.map +1 -1
  123. package/dist/components/TextField/TextField.mjs +30 -15
  124. package/dist/components/TextField/TextField.mjs.map +1 -1
  125. package/dist/date-picker.d.ts +9 -0
  126. package/dist/index.d.ts +217 -15
  127. package/dist/index.mjs +8 -0
  128. package/dist/index.mjs.map +1 -1
  129. package/dist/styles/base.css +8 -4
  130. package/dist/styles/theme.css +1217 -1
  131. package/dist/utils/floatingContentSurface.mjs +8 -0
  132. package/dist/utils/floatingContentSurface.mjs.map +1 -0
  133. package/dist/utils/inputFieldClasses.mjs +8 -0
  134. package/dist/utils/inputFieldClasses.mjs.map +1 -0
  135. package/dist/utils/pointerCapture.mjs +20 -0
  136. package/dist/utils/pointerCapture.mjs.map +1 -0
  137. package/dist/utils/useDragToDismiss.mjs +3 -2
  138. package/dist/utils/useDragToDismiss.mjs.map +1 -1
  139. package/dist/utils/useSuppressClickAfterDrag.mjs +2 -1
  140. package/dist/utils/useSuppressClickAfterDrag.mjs.map +1 -1
  141. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CreatorCard.mjs","sources":["../../../src/components/CreatorCard/CreatorCard.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Avatar } from \"../Avatar/Avatar\";\nimport { VerifiedIcon } from \"../Icons/VerifiedIcon\";\nimport { Pill, type PillProps } from \"../Pill/Pill\";\n\nexport interface CreatorCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"content\"> {\n /** Decorative banner media rendered at the top of the card. */\n background: React.ReactNode;\n /**\n * Props forwarded to a {@link Pill} overlaid on the top-left of the banner.\n * Pass the label as `children`. Omit to hide the pill.\n */\n pill?: PillProps;\n /** Avatar props forwarded to the inner {@link Avatar}. */\n avatar?: React.ComponentPropsWithoutRef<typeof Avatar>;\n /** Creator display name shown next to the avatar. */\n name: React.ReactNode;\n /** When `true`, renders a verified badge after the name. @default false */\n verified?: boolean;\n /** Accessible label for the verified badge. @default \"Verified\" */\n verifiedLabel?: string;\n /** Optional secondary line shown under the name (e.g. post count). */\n tagline?: React.ReactNode;\n /**\n * Optional content shown under the creator details (e.g. the subscription\n * price). It wraps by default; pass a `truncate` element to keep it on one line.\n */\n content?: React.ReactNode;\n /**\n * Action element rendered full-width at the bottom of the card (e.g. a\n * `Button` with `fullWidth` for subscribing to the creator).\n */\n action?: React.ReactNode;\n}\n\n/**\n * A card suggesting a creator, with a banner image, an optional {@link Pill},\n * the creator's avatar, name and tagline, free-form content such as a price,\n * and an optional action.\n *\n * The card has no fixed width or corner radius: set both through `className`\n * (e.g. `className=\"w-40 rounded-md\"`). The banner keeps a 10:11 ratio at any\n * width.\n *\n * @example\n * ```tsx\n * <CreatorCard\n * className=\"w-40 rounded-md\"\n * background={<img src=\"/banner.jpg\" alt=\"\" />}\n * pill={{ variant: \"contrast\", children: \"Popular this week\" }}\n * avatar={{ src: \"/avatar.jpg\", fallback: \"JD\" }}\n * name=\"Jane Doe\"\n * verified\n * tagline=\"412 posts\"\n * content={<span className=\"block truncate\">$9.99 / month</span>}\n * action={<Button variant=\"primary\" size=\"32\" fullWidth>Subscribe</Button>}\n * />\n * ```\n */\nexport const CreatorCard = React.forwardRef<HTMLDivElement, CreatorCardProps>(\n (\n {\n className,\n background,\n pill,\n avatar,\n name,\n verified = false,\n verifiedLabel = \"Verified\",\n tagline,\n content,\n action,\n ...props\n },\n ref,\n ) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"relative isolate flex flex-col overflow-hidden bg-surface-primary\",\n className,\n )}\n {...props}\n >\n <div className=\"relative aspect-10/11 w-full shrink-0 overflow-hidden\">\n <div className=\"pointer-events-none absolute inset-0 select-none *:h-full *:w-full [&>img]:object-cover [&>video]:object-cover\">\n {background}\n </div>\n {pill ? (\n <Pill\n variant=\"contrast\"\n {...pill}\n className={cn(\"absolute top-2 left-2 max-w-[calc(100%-1rem)]\", pill.className)}\n />\n ) : null}\n </div>\n <div className=\"flex min-w-0 flex-col gap-2.5 p-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <Avatar\n size={32}\n src={avatar?.src}\n alt={avatar?.alt ?? (typeof name === \"string\" ? name : undefined)}\n fallback={avatar?.fallback}\n {...avatar}\n />\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <div className=\"flex min-w-0 items-center gap-1\">\n <p className=\"typography-body-small-14px-semibold m-0 truncate text-content-primary\">\n {name}\n </p>\n {verified ? (\n <span\n role=\"img\"\n aria-label={verifiedLabel}\n className=\"inline-flex shrink-0 text-content-primary\"\n >\n <VerifiedIcon size={16} filled />\n </span>\n ) : null}\n </div>\n {tagline ? (\n <p className=\"typography-body-small-14px-regular m-0 truncate text-content-secondary\">\n {tagline}\n </p>\n ) : null}\n </div>\n </div>\n {content ? (\n <div className=\"typography-body-small-14px-semibold min-w-0 text-content-primary\">\n {content}\n </div>\n ) : null}\n {action ? <div className=\"flex w-full\">{action}</div> : null}\n </div>\n </div>\n );\n },\n);\n\nCreatorCard.displayName = \"CreatorCard\";\n"],"names":[],"mappings":";;;;;;;AA4DO,MAAM,cAAc,MAAM;AAAA,EAC/B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA,qBAAC,OAAA,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A,YAAY,cAAc;"}
1
+ {"version":3,"file":"CreatorCard.mjs","sources":["../../../src/components/CreatorCard/CreatorCard.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Avatar } from \"../Avatar/Avatar\";\nimport { VerifiedIcon } from \"../Icons/VerifiedIcon\";\nimport { Pill, type PillProps } from \"../Pill/Pill\";\n\nexport interface CreatorCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"content\"> {\n /** Decorative banner media rendered at the top of the card. */\n background: React.ReactNode;\n /**\n * Props forwarded to a {@link Pill} overlaid on the top-left of the banner.\n * Pass the label as `children`. Omit to hide the pill.\n */\n pill?: PillProps;\n /**\n * Props forwarded to the inner {@link Avatar}. Omit to hide the avatar, so the\n * name and tagline align with the card's left edge.\n */\n avatar?: React.ComponentPropsWithoutRef<typeof Avatar>;\n /** Creator display name, shown next to the avatar when there is one. */\n name: React.ReactNode;\n /** When `true`, renders a verified badge after the name. @default false */\n verified?: boolean;\n /** Accessible label for the verified badge. @default \"Verified\" */\n verifiedLabel?: string;\n /** Optional secondary line shown under the name (e.g. post count). */\n tagline?: React.ReactNode;\n /**\n * Optional content shown under the creator details (e.g. the subscription\n * price). It wraps by default; pass a `truncate` element to keep it on one line.\n */\n content?: React.ReactNode;\n /**\n * Action element rendered full-width at the bottom of the card (e.g. a\n * `Button` with `fullWidth` for subscribing to the creator).\n */\n action?: React.ReactNode;\n}\n\n/**\n * A card suggesting a creator, with a banner image, an optional {@link Pill},\n * the creator's avatar, name and tagline, free-form content such as a price,\n * and an optional action.\n *\n * The card has no fixed width or corner radius: set both through `className`\n * (e.g. `className=\"w-40 rounded-md\"`). The banner keeps a 10:11 ratio at any\n * width.\n *\n * @example\n * ```tsx\n * <CreatorCard\n * className=\"w-40 rounded-md\"\n * background={<img src=\"/banner.jpg\" alt=\"\" />}\n * pill={{ variant: \"contrast\", children: \"Popular this week\" }}\n * avatar={{ src: \"/avatar.jpg\", fallback: \"JD\" }}\n * name=\"Jane Doe\"\n * verified\n * tagline=\"412 posts\"\n * content={<span className=\"block truncate\">$9.99 / month</span>}\n * action={<Button variant=\"primary\" size=\"32\" fullWidth>Subscribe</Button>}\n * />\n * ```\n */\nexport const CreatorCard = React.forwardRef<HTMLDivElement, CreatorCardProps>(\n (\n {\n className,\n background,\n pill,\n avatar,\n name,\n verified = false,\n verifiedLabel = \"Verified\",\n tagline,\n content,\n action,\n ...props\n },\n ref,\n ) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"relative isolate flex flex-col overflow-hidden bg-surface-primary\",\n className,\n )}\n {...props}\n >\n <div className=\"relative aspect-10/11 w-full shrink-0 overflow-hidden\">\n <div className=\"pointer-events-none absolute inset-0 select-none *:h-full *:w-full [&>img]:object-cover [&>video]:object-cover\">\n {background}\n </div>\n {pill ? (\n <Pill\n variant=\"contrast\"\n {...pill}\n className={cn(\"absolute top-2 left-2 max-w-[calc(100%-1rem)]\", pill.className)}\n />\n ) : null}\n </div>\n <div className=\"flex min-w-0 flex-col gap-2.5 p-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n {avatar ? (\n <Avatar\n size={32}\n alt={avatar.alt ?? (typeof name === \"string\" ? name : undefined)}\n {...avatar}\n />\n ) : null}\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <div className=\"flex min-w-0 items-center gap-1\">\n <p className=\"typography-body-small-14px-semibold m-0 truncate text-content-primary\">\n {name}\n </p>\n {verified ? (\n <span\n role=\"img\"\n aria-label={verifiedLabel}\n className=\"inline-flex shrink-0 text-content-primary\"\n >\n <VerifiedIcon size={16} filled />\n </span>\n ) : null}\n </div>\n {tagline ? (\n <p className=\"typography-body-small-14px-regular m-0 truncate text-content-secondary\">\n {tagline}\n </p>\n ) : null}\n </div>\n </div>\n {content ? (\n <div className=\"typography-body-small-14px-semibold min-w-0 text-content-primary\">\n {content}\n </div>\n ) : null}\n {action ? <div className=\"flex w-full\">{action}</div> : null}\n </div>\n </div>\n );\n },\n);\n\nCreatorCard.displ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KAAA,CAAC;AAAA,oBAAA;AAAA,kBAAA,IAE/B;AAAA,gBAAA,GACN;AAAA,gBACC,UACC,oBAAC,KAAA,EAAE,WAAU,0EACV,mBACH,IACE;AAAA,cAAA,EAAA,CACN;AAAA,YAAA,GACF;AAAA,YACC,UACC,oBAAC,OAAA,EAAI,WAAU,oEACZ,mBACH,IACE;AAAA,YACH,SAAS,oBAAC,OAAA,EAAI,WAAU,eAAe,kBAAO,IAAS;AAAA,UAAA,EAAA,CAC1D;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,YAAY,cAAc;"}
@@ -16,10 +16,7 @@ const CreatorCover = React.forwardRef(
16
16
  ref,
17
17
  "aria-labelledby": headingId,
18
18
  "data-testid": "creator-cover",
19
- className: cn(
20
- "relative isolate w-full overflow-hidden bg-white dark:bg-background-primary",
21
- className
22
- ),
19
+ className: cn("relative isolate w-full overflow-hidden bg-background-primary", className),
23
20
  ...props,
24
21
  children: [
25
22
  /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 -z-10", children: [
@@ -32,8 +29,8 @@ const CreatorCover = React.forwardRef(
32
29
  className: "size-full scale-110 object-cover blur-3xl"
33
30
  }
34
31
  ),
35
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-linear-to-b from-white/30 to-white/15 dark:from-background-primary/30 dark:to-background-primary/15" }),
36
- /* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 bottom-0 h-1/3 bg-linear-to-b from-transparent to-white dark:to-background-primary" })
32
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-linear-to-b from-background-primary/30 to-background-primary/15" }),
33
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 bottom-0 h-1/3 bg-linear-to-b from-transparent to-background-primary" })
37
34
  ] }),
38
35
  /* @__PURE__ */ jsxs("div", { className: cn("mx-auto flex max-w-90 flex-col items-center gap-4 px-4 pt-17 pb-16"), children: [
39
36
  /* @__PURE__ */ jsxs("div", { className: "relative", children: [
@@ -49,7 +46,14 @@ const CreatorCover = React.forwardRef(
49
46
  renderedTag ? /* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2", children: renderedTag }) : null
50
47
  ] }),
51
48
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-1 pt-4 text-center", children: [
52
- /* @__PURE__ */ jsx("h2", { id: headingId, className: "typography-header-heading-md m-0 text-white", children: name }),
49
+ /* @__PURE__ */ jsx(
50
+ "h2",
51
+ {
52
+ id: headingId,
53
+ className: "typography-header-heading-md m-0 text-content-always-white",
54
+ children: name
55
+ }
56
+ ),
53
57
  tagline ? /* @__PURE__ */ jsx("p", { className: "typography-badge-badgecaps m-0 text-brand-primary-default uppercase", children: tagline }) : null
54
58
  ] }),
55
59
  action ? /* @__PURE__ */ jsx("div", { className: "w-full pt-2", children: action }) : null
@@ -1 +1 @@
1
- {"version":3,"file":"CreatorCover.mjs","sources":["../../../src/components/CreatorCover/CreatorCover.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Pill } from \"../Pill/Pill\";\n\n/** Slot that accepts a string (rendered as default styling) or a node for full control. */\nexport type CreatorCoverSlot = string | React.ReactNode;\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === \"string\" && value.length > 0;\n}\n\nexport interface CreatorCoverProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n /** URL of the creator image displayed in the centre card. Also used as the blurred backdrop unless `backgroundSrc` is provided. */\n imageSrc: string;\n /** Alt text for the centre cover image. @default \"\" */\n imageAlt?: string;\n /** Override URL used for the blurred background image. @default `imageSrc` */\n backgroundSrc?: string;\n /** Creator's name, rendered as the heading. */\n name: string;\n /** Smaller subtitle below the name (e.g. \"GLOBAL POPSTAR\"). Rendered uppercase in the brand colour. */\n tagline?: string;\n /**\n * Status label rendered as a pill overlapping the bottom of the cover image (e.g. \"New Joiner\").\n * Strings render with default green pill styling; pass a node for custom markup.\n */\n tag?: CreatorCoverSlot;\n /**\n * Primary call to action displayed below the title.\n */\n action?: React.ReactNode;\n /** When `true`, fades the bottom of the component to transparent and increases bottom padding to 64px. @default false */\n fadeBottom?: boolean;\n}\n\n/**\n * A creator profile hero with a stylised blurred backdrop, central cover image,\n * status pill, name, tagline, and primary call to action.\n *\n * @example\n * ```tsx\n * <CreatorCover\n * imageSrc=\"/creator.jpg\"\n * imageAlt=\"Jane Doe\"\n * name=\"JANE DOE\"\n * tagline=\"GLOBAL POPSTAR\"\n * tag=\"New Joiner\"\n * action={<Button variant=\"brand\" size=\"48\" fullWidth>Join for free for 7 days</Button>}\n * />\n * ```\n */\nexport const CreatorCover = React.forwardRef<HTMLElement, CreatorCoverProps>(\n (\n { className, imageSrc, imageAlt = \"\", backgroundSrc, name, tagline, tag, action, ...props },\n ref,\n ) => {\n const headingId = React.useId();\n\n const renderedTag = isNonEmptyString(tag) ? <Pill variant=\"brand\">{tag}</Pill> : tag;\n\n return (\n <section\n ref={ref}\n aria-labelledby={headingId}\n data-testid=\"creator-cover\"\n className={cn(\n \"relative isolate w-full overflow-hidden bg-white dark:bg-background-primary\",\n className,\n )}\n {...props}\n >\n <div className=\"absolute inset-0 -z-10\">\n <img\n src={backgroundSrc ?? imageSrc}\n alt=\"\"\n loading=\"lazy\"\n className=\"size-full scale-110 object-cover blur-3xl\"\n />\n <div className=\"absolute inset-0 bg-linear-to-b from-white/30 to-white/15 dark:from-background-primary/30 dark:to-background-primary/15\" />\n <div className=\"absolute inset-x-0 bottom-0 h-1/3 bg-linear-to-b from-transparent to-white dark:to-background-primary\" />\n </div>\n <div className={cn(\"mx-auto flex max-w-90 flex-col items-center gap-4 px-4 pt-17 pb-16\")}>\n <div className=\"relative\">\n <img\n src={imageSrc}\n alt={imageAlt}\n loading=\"lazy\"\n className=\"block h-55 w-37.5 rounded-lg object-cover\"\n />\n {renderedTag ? (\n <div className=\"absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2\">\n {renderedTag}\n </div>\n ) : null}\n </div>\n <div className=\"flex flex-col items-center gap-1 pt-4 text-center\">\n <h2 id={headingId} className=\"typography-header-heading-md m-0 text-white\">\n {name}\n </h2>\n {tagline ? (\n <p className=\"typography-badge-badgecaps m-0 text-brand-primary-default uppercase\">\n {tagline}\n </p>\n ) : null}\n </div>\n {action ? <div className=\"w-full pt-2\">{action}</div> : null}\n </div>\n </section>\n );\n },\n);\n\nCreatorCover.displayName = \"CreatorCover\";\n"],"names":[],"mappings":";;;;;AAOA,SAAS,iBAAiB,OAAiC;AACzD,SAAO,OAAO,UAAU,YAAY,MAAM,SAAS;AACrD;AA0CO,MAAM,eAAe,MAAM;AAAA,EAChC,CACE,EAAE,WAAW,UAAU,WAAW,IAAI,eAAe,MAAM,SAAS,KAAK,QAAQ,GAAG,MAAA,GACpF,QACG;AACH,UAAM,YAAY,MAAM,MAAA;AAExB,UAAM,cAAc,iBAAiB,GAAG,wBAAK,MAAA,EAAK,SAAQ,SAAS,UAAA,IAAA,CAAI,IAAU;AAEjF,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,mBAAiB;AAAA,QACjB,eAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA,qBAAC,OAAA,EAAI,WAAU,0BACb,UAAA;AAAA,YAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,KAAK,iBAAiB;AAAA,gBACtB,KAAI;AAAA,gBACJ,SAAQ;AAAA,gBACR,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,YAEZ,oBAAC,OAAA,EAAI,WAAU,0HAAA,CAA0H;AAAA,YACzI,oBAAC,OAAA,EAAI,WAAU,wGAAA,CAAwG;AAAA,UAAA,GACzH;AAAA,UACA,qBAAC,OAAA,EAAI,WAAW,GAAG,oEAAoE,GACrF,UAAA;AAAA,YAAA,qBAAC,OAAA,EAAI,WAAU,YACb,UAAA;AAAA,cAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,KAAK;AAAA,kBACL,KAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,WAAU;AAAA,gBAAA;AAAA,cAAA;AAAA,cAEX,cACC,oBAAC,OAAA,EAAI,WAAU,+DACZ,uBACH,IACE;AAAA,YAAA,GACN;AAAA,YACA,qBAAC,OAAA,EAAI,WAAU,qDACb,UAAA;AAAA,cAAA,oBAAC,MAAA,EAAG,IAAI,WAAW,WAAU,+CAC1B,UAAA,MACH;AAAA,cACC,UACC,oBAAC,KAAA,EAAE,WAAU,uEACV,mBACH,IACE;AAAA,YAAA,GACN;AAAA,YACC,SAAS,oBAAC,OAAA,EAAI,WAAU,eAAe,kBAAO,IAAS;AAAA,UAAA,EAAA,CAC1D;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,aAAa,cAAc;"}
1
+ {"version":3,"file":"CreatorCover.mjs","sources":["../../../src/components/CreatorCover/CreatorCover.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Pill } from \"../Pill/Pill\";\n\n/** Slot that accepts a string (rendered as default styling) or a node for full control. */\nexport type CreatorCoverSlot = string | React.ReactNode;\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === \"string\" && value.length > 0;\n}\n\nexport interface CreatorCoverProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n /** URL of the creator image displayed in the centre card. Also used as the blurred backdrop unless `backgroundSrc` is provided. */\n imageSrc: string;\n /** Alt text for the centre cover image. @default \"\" */\n imageAlt?: string;\n /** Override URL used for the blurred background image. @default `imageSrc` */\n backgroundSrc?: string;\n /** Creator's name, rendered as the heading. */\n name: string;\n /** Smaller subtitle below the name (e.g. \"GLOBAL POPSTAR\"). Rendered uppercase in the brand colour. */\n tagline?: string;\n /**\n * Status label rendered as a pill overlapping the bottom of the cover image (e.g. \"New Joiner\").\n * Strings render with default green pill styling; pass a node for custom markup.\n */\n tag?: CreatorCoverSlot;\n /**\n * Primary call to action displayed below the title.\n */\n action?: React.ReactNode;\n /** When `true`, fades the bottom of the component to transparent and increases bottom padding to 64px. @default false */\n fadeBottom?: boolean;\n}\n\n/**\n * A creator profile hero with a stylised blurred backdrop, central cover image,\n * status pill, name, tagline, and primary call to action.\n *\n * @example\n * ```tsx\n * <CreatorCover\n * imageSrc=\"/creator.jpg\"\n * imageAlt=\"Jane Doe\"\n * name=\"JANE DOE\"\n * tagline=\"GLOBAL POPSTAR\"\n * tag=\"New Joiner\"\n * action={<Button variant=\"brand\" size=\"48\" fullWidth>Join for free for 7 days</Button>}\n * />\n * ```\n */\nexport const CreatorCover = React.forwardRef<HTMLElement, CreatorCoverProps>(\n (\n { className, imageSrc, imageAlt = \"\", backgroundSrc, name, tagline, tag, action, ...props },\n ref,\n ) => {\n const headingId = React.useId();\n\n const renderedTag = isNonEmptyString(tag) ? <Pill variant=\"brand\">{tag}</Pill> : tag;\n\n return (\n <section\n ref={ref}\n aria-labelledby={headingId}\n data-testid=\"creator-cover\"\n className={cn(\"relative isolate w-full overflow-hidden bg-background-primary\", className)}\n {...props}\n >\n <div className=\"absolute inset-0 -z-10\">\n <img\n src={backgroundSrc ?? imageSrc}\n alt=\"\"\n loading=\"lazy\"\n className=\"size-full scale-110 object-cover blur-3xl\"\n />\n <div className=\"absolute inset-0 bg-linear-to-b from-background-primary/30 to-background-primary/15\" />\n <div className=\"absolute inset-x-0 bottom-0 h-1/3 bg-linear-to-b from-transparent to-background-primary\" />\n </div>\n <div className={cn(\"mx-auto flex max-w-90 flex-col items-center gap-4 px-4 pt-17 pb-16\")}>\n <div className=\"relative\">\n <img\n src={imageSrc}\n alt={imageAlt}\n loading=\"lazy\"\n className=\"block h-55 w-37.5 rounded-lg object-cover\"\n />\n {renderedTag ? (\n <div className=\"absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2\">\n {renderedTag}\n </div>\n ) : null}\n </div>\n <div className=\"flex flex-col items-center gap-1 pt-4 text-center\">\n <h2\n id={headingId}\n className=\"typography-header-heading-md m-0 text-content-always-white\"\n >\n {name}\n </h2>\n {tagline ? (\n <p className=\"typography-badge-badgecaps m-0 text-brand-primary-default uppercase\">\n {tagline}\n </p>\n ) : null}\n </div>\n {action ? <div className=\"w-full pt-2\">{action}</div> : null}\n </div>\n </section>\n );\n },\n);\n\nCreatorCover.displayName = \"CreatorCover\";\n"],"names":[],"mappings":";;;;;AAOA,SAAS,iBAAiB,OAAiC;AACzD,SAAO,OAAO,UAAU,YAAY,MAAM,SAAS;AACrD;AA0CO,MAAM,eAAe,MAAM;AAAA,EAChC,CACE,EAAE,WAAW,UAAU,WAAW,IAAI,eAAe,MAAM,SAAS,KAAK,QAAQ,GAAG,MAAA,GACpF,QACG;AACH,UAAM,YAAY,MAAM,MAAA;AAExB,UAAM,cAAc,iBAAiB,GAAG,wBAAK,MAAA,EAAK,SAAQ,SAAS,UAAA,IAAA,CAAI,IAAU;AAEjF,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,mBAAiB;AAAA,QACjB,eAAY;AAAA,QACZ,WAAW,GAAG,iEAAiE,SAAS;AAAA,QACvF,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAA,qBAAC,OAAA,EAAI,WAAU,0BACb,UAAA;AAAA,YAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,KAAK,iBAAiB;AAAA,gBACtB,KAAI;AAAA,gBACJ,SAAQ;AAAA,gBACR,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,YAEZ,oBAAC,OAAA,EAAI,WAAU,sFAAA,CAAsF;AAAA,YACrG,oBAAC,OAAA,EAAI,WAAU,0FAAA,CAA0F;AAAA,UAAA,GAC3G;AAAA,UACA,qBAAC,OAAA,EAAI,WAAW,GAAG,oEAAoE,GACrF,UAAA;AAAA,YAAA,qBAAC,OAAA,EAAI,WAAU,YACb,UAAA;AAAA,cAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,KAAK;AAAA,kBACL,KAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,WAAU;AAAA,gBAAA;AAAA,cAAA;AAAA,cAEX,cACC,oBAAC,OAAA,EAAI,WAAU,+DACZ,uBACH,IACE;AAAA,YAAA,GACN;AAAA,YACA,qBAAC,OAAA,EAAI,WAAU,qDACb,UAAA;AAAA,cAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,IAAI;AAAA,kBACJ,WAAU;AAAA,kBAET,UAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,cAEF,UACC,oBAAC,KAAA,EAAE,WAAU,uEACV,mBACH,IACE;AAAA,YAAA,GACN;AAAA,YACC,SAAS,oBAAC,OAAA,EAAI,WAAU,eAAe,kBAAO,IAAS;AAAA,UAAA,EAAA,CAC1D;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEA,aAAa,cAAc;"}
@@ -1,11 +1,12 @@
1
1
  "use client";
2
- import { jsxs, jsx } from "react/jsx-runtime";
3
- import { forwardRef, useRef, useEffect } from "react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { forwardRef, createContext, useRef, useContext, useEffect } from "react";
4
4
  import { DayPicker } from "react-day-picker";
5
5
  import { cn } from "../../utils/cn.mjs";
6
6
  import { Button } from "../Button/Button.mjs";
7
7
  import { ChevronLeftIcon } from "../Icons/ChevronLeftIcon.mjs";
8
8
  import { ChevronRightIcon } from "../Icons/ChevronRightIcon.mjs";
9
+ const DatePickerSizeContext = createContext("40");
9
10
  function Day({ day, modifiers, className, ...divProps }) {
10
11
  const { range_start, range_end, range_middle } = modifiers;
11
12
  const isSingleDayRange = range_start && range_end;
@@ -15,9 +16,9 @@ function Day({ day, modifiers, className, ...divProps }) {
15
16
  {
16
17
  className: cn(
17
18
  className,
18
- inRange && "bg-inputs-calendar-range",
19
- inRange && range_start && "rounded-l-sm",
20
- inRange && range_end && "rounded-r-sm"
19
+ inRange && "before:absolute before:inset-x-0 before:inset-y-0.5 before:bg-inputs-calendar-range first:before:left-0.5 first:before:rounded-l-sm last:before:right-0.5 last:before:rounded-r-sm",
20
+ inRange && range_start && "before:left-0.5 before:rounded-l-sm",
21
+ inRange && range_end && "before:right-0.5 before:rounded-r-sm"
21
22
  ),
22
23
  ...divProps
23
24
  }
@@ -25,6 +26,7 @@ function Day({ day, modifiers, className, ...divProps }) {
25
26
  }
26
27
  function DayButton({ day, modifiers, className, ...buttonProps }) {
27
28
  const ref = useRef(null);
29
+ const size = useContext(DatePickerSizeContext);
28
30
  useEffect(() => {
29
31
  if (modifiers.focused) ref.current?.focus();
30
32
  }, [modifiers.focused]);
@@ -35,11 +37,14 @@ function DayButton({ day, modifiers, className, ...buttonProps }) {
35
37
  ref,
36
38
  type: "button",
37
39
  className: cn(
38
- "relative z-10 inline-flex size-10 cursor-pointer items-center justify-center rounded-sm text-content-primary",
40
+ "relative z-10 inline-flex cursor-pointer items-center justify-center rounded-sm text-content-primary",
39
41
  "transition-colors hover:bg-inputs-calendar-range not-disabled:active:bg-inputs-calendar-range",
40
42
  "focus-visible:shadow-focus-ring focus-visible:outline-none",
41
43
  "disabled:cursor-not-allowed",
42
- isSelected ? "typography-body-small-14px-semibold" : "typography-body-small-14px-regular",
44
+ size === "40" && "size-10",
45
+ size === "32" && "size-8",
46
+ size === "40" && (isSelected ? "typography-body-small-14px-semibold" : "typography-body-small-14px-regular"),
47
+ size === "32" && (isSelected ? "typography-description-12px-semibold" : "typography-description-12px-regular"),
43
48
  modifiers.today && !isSelected && "bg-inputs-calendar-today ring-1 ring-inputs-calendar-today-stroke hover:bg-inputs-calendar-today",
44
49
  isSelected && "bg-inputs-calendar-selected text-content-primary-inverted hover:bg-inputs-calendar-selected",
45
50
  modifiers.range_middle && "bg-transparent hover:bg-transparent",
@@ -53,6 +58,7 @@ function DayButton({ day, modifiers, className, ...buttonProps }) {
53
58
  const DatePicker = forwardRef(
54
59
  ({
55
60
  variant = "single",
61
+ size = "40",
56
62
  onApply,
57
63
  onCancel,
58
64
  cancelLabel = "Cancel",
@@ -64,6 +70,11 @@ const DatePicker = forwardRef(
64
70
  }, ref) => {
65
71
  const numberOfMonths = variant === "double" ? 2 : 1;
66
72
  const isMulti = numberOfMonths > 1;
73
+ const isCompact = size === "32";
74
+ const navButtonClassName = cn(
75
+ "pointer-events-auto inline-flex cursor-pointer items-center justify-center rounded-full bg-buttons-secondary-default text-content-primary transition-colors hover:bg-buttons-secondary-hover focus-visible:shadow-focus-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-buttons-disabled-default disabled:text-content-disabled [&>svg]:size-4",
76
+ isCompact ? "size-6" : "size-8"
77
+ );
67
78
  const resolvedDayPickerProps = (() => {
68
79
  if (dayPickerProps.mode !== "range") return dayPickerProps;
69
80
  const { selected, onSelect } = dayPickerProps;
@@ -87,12 +98,13 @@ const DatePicker = forwardRef(
87
98
  }
88
99
  };
89
100
  })();
90
- return /* @__PURE__ */ jsxs(
101
+ return /* @__PURE__ */ jsx(DatePickerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxs(
91
102
  "div",
92
103
  {
93
104
  ref,
94
105
  className: cn(
95
- "inline-flex flex-col rounded-xl border border-modal-stroke bg-modal-background p-6 shadow-blur-menu backdrop-blur-sm",
106
+ "inline-flex flex-col rounded-xl border border-modal-stroke bg-modal-background shadow-blur-menu backdrop-blur-sm",
107
+ isCompact ? "p-4" : "p-6",
96
108
  className
97
109
  ),
98
110
  children: [
@@ -109,14 +121,23 @@ const DatePicker = forwardRef(
109
121
  root: "w-full",
110
122
  months: cn("relative flex", isMulti && "gap-6"),
111
123
  month: "flex flex-1 flex-col",
112
- month_caption: "mb-4 flex h-8 items-center justify-center",
113
- caption_label: "typography-body-default-16px-regular text-content-primary",
124
+ month_caption: cn(
125
+ "flex items-center justify-center",
126
+ isCompact ? "mb-2 h-6" : "mb-4 h-8"
127
+ ),
128
+ caption_label: cn(
129
+ "text-content-primary",
130
+ isCompact ? "typography-body-small-14px-regular" : "typography-body-default-16px-regular"
131
+ ),
114
132
  nav: "absolute inset-x-0 top-0 z-20 flex justify-between",
115
- button_previous: "pointer-events-auto inline-flex size-8 cursor-pointer items-center justify-center rounded-full bg-buttons-secondary-default text-content-primary transition-colors hover:bg-buttons-secondary-hover focus-visible:shadow-focus-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-buttons-disabled-default disabled:text-content-disabled [&>svg]:size-4",
116
- button_next: "pointer-events-auto inline-flex size-8 cursor-pointer items-center justify-center rounded-full bg-buttons-secondary-default text-content-primary transition-colors hover:bg-buttons-secondary-hover focus-visible:shadow-focus-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-buttons-disabled-default disabled:text-content-disabled [&>svg]:size-4",
133
+ button_previous: navButtonClassName,
134
+ button_next: navButtonClassName,
117
135
  month_grid: "w-full",
118
136
  weekdays: "flex",
119
- weekday: "flex h-[30px] w-10 flex-1 items-center justify-center typography-body-small-14px-regular text-content-secondary",
137
+ weekday: cn(
138
+ "flex flex-1 items-center justify-center text-content-secondary",
139
+ isCompact ? "typography-description-12px-regular h-6 w-8" : "typography-body-small-14px-regular h-7.5 w-10"
140
+ ),
120
141
  week: "flex",
121
142
  day: "relative flex flex-1 items-center justify-center p-0.5",
122
143
  hidden: "hidden"
@@ -137,13 +158,13 @@ const DatePicker = forwardRef(
137
158
  ...resolvedDayPickerProps
138
159
  }
139
160
  ),
140
- showFooter && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 pt-6", children: [
141
- /* @__PURE__ */ jsx(Button, { variant: "outline", size: "40", className: "flex-1", onClick: onCancel, children: cancelLabel }),
142
- /* @__PURE__ */ jsx(Button, { variant: "primary", size: "40", className: "flex-1", onClick: onApply, children: applyLabel })
161
+ showFooter && /* @__PURE__ */ jsxs("div", { className: cn("flex gap-2", isCompact ? "pt-4" : "pt-6"), children: [
162
+ /* @__PURE__ */ jsx(Button, { variant: "outline", size, className: "flex-1", onClick: onCancel, children: cancelLabel }),
163
+ /* @__PURE__ */ jsx(Button, { variant: "primary", size, className: "flex-1", onClick: onApply, children: applyLabel })
143
164
  ] })
144
165
  ]
145
166
  }
146
- );
167
+ ) });
147
168
  }
148
169
  );
149
170
  DatePicker.displayName = "DatePicker";
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.mjs","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef } from \"react\";\nimport {\n type ChevronProps,\n type DateRange,\n type DayButtonProps,\n DayPicker,\n type DayPickerProps,\n type DayProps,\n type Modifiers,\n type MonthGridProps,\n type WeekdayProps,\n type WeekdaysProps,\n type WeekProps,\n type WeeksProps,\n} from \"react-day-picker\";\nimport { cn } from \"../../utils/cn\";\nimport type { OmitDistributed } from \"../../utils/types\";\nimport { Button } from \"../Button/Button\";\nimport { ChevronLeftIcon } from \"../Icons/ChevronLeftIcon\";\nimport { ChevronRightIcon } from \"../Icons/ChevronRightIcon\";\n\nexport type { DateRange }; // Needed by consumers when passing props\n\n/** Layout variant — single or side-by-side month display. */\nexport type DatePickerVariant = \"single\" | \"double\";\n\n/** Props specific to the DatePicker wrapper (not inherited from react-day-picker). */\nexport interface DatePickerOwnProps {\n /** Display one month or two side-by-side. @default \"single\" */\n variant?: DatePickerVariant;\n /** Callback fired when the Apply button is clicked. */\n onApply?: () => void;\n /** Callback fired when the Cancel button is clicked. */\n onCancel?: () => void;\n /** Label for the cancel button. @default \"Cancel\" */\n cancelLabel?: string;\n /** Label for the apply button. @default \"Apply\" */\n applyLabel?: string;\n /** Whether to render the cancel / apply footer buttons. @default true */\n showFooter?: boolean;\n /** Additional CSS class name for the outer container. */\n className?: string;\n}\n\nfunction Day({ day, modifiers, className, ...divProps }: DayProps) {\n const { range_start, range_end, range_middle } = modifiers;\n const isSingleDayRange = range_start && range_end;\n const inRange = (range_start || range_end || range_middle) && !isSingleDayRange;\n\n return (\n <div\n className={cn(\n className,\n inRange && \"bg-inputs-calendar-range\",\n inRange && range_start && \"rounded-l-sm\",\n inRange && range_end && \"rounded-r-sm\",\n )}\n {...divProps}\n />\n );\n}\n\nfunction DayButton({ day, modifiers, className, ...buttonProps }: DayButtonProps) {\n const ref = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n const isSelected = modifiers.selected && !modifiers.range_middle;\n\n return (\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n \"relative z-10 inline-flex size-10 cursor-pointer items-center justify-center rounded-sm text-content-primary\",\n \"transition-colors hover:bg-inputs-calendar-range not-disabled:active:bg-inputs-calendar-range\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n \"disabled:cursor-not-allowed\",\n isSelected ? \"typography-body-small-14px-semibold\" : \"typography-body-small-14px-regular\",\n modifiers.today &&\n !isSelected &&\n \"bg-inputs-calendar-today ring-1 ring-inputs-calendar-today-stroke hover:bg-inputs-calendar-today\",\n isSelected &&\n \"bg-inputs-calendar-selected text-content-primary-inverted hover:bg-inputs-calendar-selected\",\n modifiers.range_middle && \"bg-transparent hover:bg-transparent\",\n modifiers.disabled &&\n \"bg-inputs-calendar-disabled text-content-disabled hover:bg-inputs-calendar-disabled\",\n modifiers.outside && \"pointer-events-none text-content-disabled\",\n )}\n {...buttonProps}\n />\n );\n}\n\n/** Combined props — own DatePicker options plus all react-day-picker props (except `numberOfMonths`). */\nexport type DatePickerProps = DatePickerOwnProps &\n OmitDistributed<DayPickerProps, \"numberOfMonths\">;\n\n/**\n * A calendar date picker supporting single-date and date-range selection with\n * optional side-by-side month display and footer action buttons.\n *\n * Built on top of [react-day-picker](https://react-day-picker.js.org/) — all\n * `DayPickerProps` (except `numberOfMonths`) are forwarded.\n *\n * @example\n * ```tsx\n * <DatePicker\n * mode=\"range\"\n * variant=\"double\"\n * selected={range}\n * onSelect={setRange}\n * onApply={save}\n * onCancel={close}\n * />\n * ```\n */\nexport const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(\n (\n {\n variant = \"single\",\n onApply,\n onCancel,\n cancelLabel = \"Cancel\",\n applyLabel = \"Apply\",\n showFooter = true,\n className,\n formatters,\n ...dayPickerProps\n },\n ref,\n ) => {\n const numberOfMonths = variant === \"double\" ? 2 : 1;\n const isMulti = numberOfMonths > 1;\n\n // Wrap onSelect for range mode: when clicking inside a complete range,\n // move the nearest boundary instead of always resetting the end date.\n const resolvedDayPickerProps = (() => {\n if (dayPickerProps.mode !== \"range\") return dayPickerProps;\n\n const { selected, onSelect } = dayPickerProps as {\n selected?: DateRange;\n onSelect?: (\n range: DateRange | undefined,\n triggerDate: Date,\n modifiers: Modifiers,\n e: React.MouseEvent | React.KeyboardEvent,\n ) => void;\n };\n\n if (!onSelect || !selected?.from || !selected?.to) return dayPickerProps;\n\n const { from, to } = selected;\n\n return {\n ...dayPickerProps,\n onSelect: (\n range: DateRange | undefined,\n triggerDate: Date,\n modifiers: Modifiers,\n e: React.MouseEvent | React.KeyboardEvent,\n ) => {\n const clickedTime = triggerDate.getTime();\n const fromTime = from.getTime();\n const toTime = to.getTime();\n\n if (clickedTime > fromTime && clickedTime < toTime) {\n if (clickedTime - fromTime <= toTime - clickedTime) {\n onSelect({ from: triggerDate, to }, triggerDate, modifiers, e);\n } else {\n onSelect({ from, to: triggerDate }, triggerDate, modifiers, e);\n }\n return;\n }\n\n onSelect(range, triggerDate, modifiers, e);\n },\n } as typeof dayPickerProps;\n })();\n\n return (\n <div\n ref={ref}\n className={cn(\n \"inline-flex flex-col rounded-xl border border-modal-stroke bg-modal-background p-6 shadow-blur-menu backdrop-blur-sm\",\n className,\n )}\n >\n <DayPicker\n showOutsideDays\n numberOfMonths={numberOfMonths}\n formatters={{\n formatCaption: (date: Date) =>\n date.toLocaleDateString(\"en-US\", { month: \"long\", year: \"numeric\" }),\n ...formatters,\n }}\n classNames={{\n root: \"w-full\",\n months: cn(\"relative flex\", isMulti && \"gap-6\"),\n month: \"flex flex-1 flex-col\",\n month_caption: \"mb-4 flex h-8 items-center justify-center\",\n caption_label: \"typography-body-default-16px-regular text-content-primary\",\n nav: \"absolute inset-x-0 top-0 z-20 flex justify-between\",\n button_previous:\n \"pointer-events-auto inline-flex size-8 cursor-pointer items-center justify-center rounded-full bg-buttons-secondary-default text-content-primary transition-colors hover:bg-buttons-secondary-hover focus-visible:shadow-focus-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-buttons-disabled-default disabled:text-content-disabled [&>svg]:size-4\",\n button_next:\n \"pointer-events-auto inline-flex size-8 cursor-pointer items-center justify-center rounded-full bg-buttons-secondary-default text-content-primary transition-colors hover:bg-buttons-secondary-hover focus-visible:shadow-focus-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-buttons-disabled-default disabled:text-content-disabled [&>svg]:size-4\",\n month_grid: \"w-full\",\n weekdays: \"flex\",\n weekday:\n \"flex h-[30px] w-10 flex-1 items-center justify-center typography-body-small-14px-regular text-content-secondary\",\n week: \"flex\",\n day: \"relative flex flex-1 items-center justify-center p-0.5\",\n hidden: \"hidden\",\n }}\n components={{\n /**\n * !NOTE: We're unable to use semantic elements for the grid due to rdp, as such we've disabled the a11y lint rules for these elements in biome.json.\n */\n Chevron: ({ orientation }: ChevronProps) =>\n orientation === \"left\" ? <ChevronLeftIcon /> : <ChevronRightIcon />,\n MonthGrid: (props: MonthGridProps) => <div role=\"grid\" {...props} />,\n Weekdays: (props: WeekdaysProps) => <div role=\"row\" {...props} />,\n Weekday: (props: WeekdayProps) => <div role=\"columnheader\" {...props} />,\n Weeks: (props: WeeksProps) => <div role=\"rowgroup\" {...props} />,\n Week: ({ week, ...props }: WeekProps) => <div role=\"row\" {...props} />,\n Day,\n DayButton,\n }}\n {...resolvedDayPickerProps}\n />\n\n {showFooter && (\n <div className=\"flex gap-2 pt-6\">\n <Button variant=\"outline\" size=\"40\" className=\"flex-1\" onClick={onCancel}>\n {cancelLabel}\n </Button>\n <Button variant=\"primary\" size=\"40\" className=\"flex-1\" onClick={onApply}>\n {applyLabel}\n </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A,gBACZ,UAAU;AAAA,gBACV,SACE;AAAA,gBACF,MAAM;AAAA,gBACN,KAAK;AAAA,gBACL,QAAQ;AAAA,cAAA;AAAA,cAEV,YAAY;AAAA;AAAA;AAAA;AAAA,gBAIV,SAAS,CAAC,EAAE,YAAA,MACV,gBAAgB,SAAS,oBAAC,iBAAA,CAAA,CAAgB,IAAK,oBAAC,kBAAA,CAAA,CAAiB;AAAA,gBACnE,WAAW,CAAC,UAA0B,oBAAC,SAAI,MAAK,QAAQ,GAAG,OAAO;AAAA,gBAClE,UAAU,CAAC,UAAyB,oBAAC,SAAI,MAAK,OAAO,GAAG,OAAO;AAAA,gBAC/D,SAAS,CAAC,UAAwB,oBAAC,SAAI,MAAK,gBAAgB,GAAG,OAAO;AAAA,gBACtE,OAAO,CAAC,UAAsB,oBAAC,SAAI,MAAK,YAAY,GAAG,OAAO;AAAA,gBAC9D,MAAM,CAAC,EAAE,MAAM,GAAG,MAAA,MAAuB,oBAAC,OAAA,EAAI,MAAK,OAAO,GAAG,MAAA,CAAO;AAAA,gBACpE;AAAA,gBACA;AAAA,cAAA;AAAA,cAED,GAAG;AAAA,YAAA;AAAA,UAAA;AAAA,UAGL,cACC,qBAAC,OAAA,EAAI,WAAU,mBACb,UAAA;AAAA,YAAA,oBAAC,QAAA,EAAO,SAAQ,WAAU,MAAK,MAAK,WAAU,UAAS,SAAS,UAC7D,UAAA,YAAA,CACH;AAAA,YACA,oBAAC,QAAA,EAAO,SAAQ,WAAU,MAAK,MAAK,WAAU,UAAS,SAAS,SAC7D,UAAA,WAAA,CACH;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA,WAAW,cAAc;"}
1
+ {"version":3,"file":"DatePicker.mjs","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { createContext, forwardRef, useContext, useEffect, useRef } from \"react\";\nimport {\n type ChevronProps,\n type DateRange,\n type DayButtonProps,\n DayPicker,\n type DayPickerProps,\n type DayProps,\n type Modifiers,\n type MonthGridProps,\n type WeekdayProps,\n type WeekdaysProps,\n type WeekProps,\n type WeeksProps,\n} from \"react-day-picker\";\nimport { cn } from \"../../utils/cn\";\nimport type { OmitDistributed } from \"../../utils/types\";\nimport { Button } from \"../Button/Button\";\nimport { ChevronLeftIcon } from \"../Icons/ChevronLeftIcon\";\nimport { ChevronRightIcon } from \"../Icons/ChevronRightIcon\";\n\nexport type { DateRange }; // Needed by consumers when passing props\n\n/** Layout variant — single or side-by-side month display. */\nexport type DatePickerVariant = \"single\" | \"double\";\n\n/** Day button size in pixels. It also scales the navigation, caption, padding and footer buttons. */\nexport type DatePickerSize = \"40\" | \"32\";\n\n/** Props specific to the DatePicker wrapper (not inherited from react-day-picker). */\nexport interface DatePickerOwnProps {\n /** Display one month or two side-by-side. @default \"single\" */\n variant?: DatePickerVariant;\n /**\n * Day button size in pixels. It also scales the navigation, caption, padding and footer buttons.\n * Use `\"32\"` for compact surfaces such as toolbar popovers.\n * @default \"40\"\n */\n size?: DatePickerSize;\n /** Callback fired when the Apply button is clicked. */\n onApply?: () => void;\n /** Callback fired when the Cancel button is clicked. */\n onCancel?: () => void;\n /** Label for the cancel button. @default \"Cancel\" */\n cancelLabel?: string;\n /** Label for the apply button. @default \"Apply\" */\n applyLabel?: string;\n /** Whether to render the cancel / apply footer buttons. @default true */\n showFooter?: boolean;\n /** Additional CSS class name for the outer container. */\n className?: string;\n}\n\nconst DatePickerSizeContext = createContext<DatePickerSize>(\"40\");\n\nfunction Day({ day, modifiers, className, ...divProps }: DayProps) {\n const { range_start, range_end, range_middle } = modifiers;\n const isSingleDayRange = range_start && range_end;\n const inRange = (range_start || range_end || range_middle) && !isSingleDayRange;\n\n return (\n <div\n className={cn(\n className,\n inRange &&\n \"before:absolute before:inset-x-0 before:inset-y-0.5 before:bg-inputs-calendar-range first:before:left-0.5 first:before:rounded-l-sm last:before:right-0.5 last:before:rounded-r-sm\",\n inRange && range_start && \"before:left-0.5 before:rounded-l-sm\",\n inRange && range_end && \"before:right-0.5 before:rounded-r-sm\",\n )}\n {...divProps}\n />\n );\n}\n\nfunction DayButton({ day, modifiers, className, ...buttonProps }: DayButtonProps) {\n const ref = useRef<HTMLButtonElement>(null);\n const size = useContext(DatePickerSizeContext);\n\n useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n const isSelected = modifiers.selected && !modifiers.range_middle;\n\n return (\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n \"relative z-10 inline-flex cursor-pointer items-center justify-center rounded-sm text-content-primary\",\n \"transition-colors hover:bg-inputs-calendar-range not-disabled:active:bg-inputs-calendar-range\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n \"disabled:cursor-not-allowed\",\n size === \"40\" && \"size-10\",\n size === \"32\" && \"size-8\",\n size === \"40\" &&\n (isSelected\n ? \"typography-body-small-14px-semibold\"\n : \"typography-body-small-14px-regular\"),\n size === \"32\" &&\n (isSelected\n ? \"typography-description-12px-semibold\"\n : \"typography-description-12px-regular\"),\n modifiers.today &&\n !isSelected &&\n \"bg-inputs-calendar-today ring-1 ring-inputs-calendar-today-stroke hover:bg-inputs-calendar-today\",\n isSelected &&\n \"bg-inputs-calendar-selected text-content-primary-inverted hover:bg-inputs-calendar-selected\",\n modifiers.range_middle && \"bg-transparent hover:bg-transparent\",\n modifiers.disabled &&\n \"bg-inputs-calendar-disabled text-content-disabled hover:bg-inputs-calendar-disabled\",\n modifiers.outside && \"pointer-events-none text-content-disabled\",\n )}\n {...buttonProps}\n />\n );\n}\n\n/** Combined props — own DatePicker options plus all react-day-picker props (except `numberOfMonths`). */\nexport type DatePickerProps = DatePickerOwnProps &\n OmitDistributed<DayPickerProps, \"numberOfMonths\">;\n\n/**\n * A calendar date picker supporting single-date and date-range selection with\n * optional side-by-side month display and footer action buttons.\n *\n * Built on top of [react-day-picker](https://react-day-picker.js.org/) — all\n * `DayPickerProps` (except `numberOfMonths`) are forwarded.\n *\n * @example\n * ```tsx\n * <DatePicker\n * mode=\"range\"\n * variant=\"double\"\n * selected={range}\n * onSelect={setRange}\n * onApply={save}\n * onCancel={close}\n * />\n * ```\n */\nexport const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(\n (\n {\n variant = \"single\",\n size = \"40\",\n onApply,\n onCancel,\n cancelLabel = \"Cancel\",\n applyLabel = \"Apply\",\n showFooter = true,\n className,\n formatters,\n ...dayPickerProps\n },\n ref,\n ) => {\n const numberOfMonths = variant === \"double\" ? 2 : 1;\n const isMulti = numberOfMonths > 1;\n const isCompact = size === \"32\";\n const navButtonClassName = cn(\n \"pointer-events-auto inline-flex cursor-pointer items-center justify-center rounded-full bg-buttons-secondary-default text-content-primary transition-colors hover:bg-buttons-secondary-hover focus-visible:shadow-focus-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-buttons-disabled-default disabled:text-content-disabled [&>svg]:size-4\",\n isCompact ? \"size-6\" : \"size-8\",\n );\n\n // Wrap onSelect for range mode: when clicking inside a complete range,\n // move the nearest boundary instead of always resetting the end date.\n const resolvedDayPickerProps = (() => {\n if (dayPickerProps.mode !== \"range\") return dayPickerProps;\n\n const { selected, onSelect } = dayPickerProps as {\n selected?: DateRange;\n onSelect?: (\n range: DateRange | undefined,\n triggerDate: Date,\n modifiers: Modifiers,\n e: React.MouseEvent | React.KeyboardEvent,\n ) => void;\n };\n\n if (!onSelect || !selected?.from || !selected?.to) return dayPickerProps;\n\n const { from, to } = selected;\n\n return {\n ...dayPickerProps,\n onSelect: (\n range: DateRange | undefined,\n triggerDate: Date,\n modifiers: Modifiers,\n e: React.MouseEvent | React.KeyboardEvent,\n ) => {\n const clickedTime = triggerDate.getTime();\n const fromTime = from.getTime();\n const toTime = to.getTime();\n\n if (clickedTime > fromTime && clickedTime < toTime) {\n if (clickedTime - fromTime <= toTime - clickedTime) {\n onSelect({ from: triggerDate, to }, triggerDate, modifiers, e);\n } else {\n onSelect({ from, to: triggerDate }, triggerDate, modifiers, e);\n }\n return;\n }\n\n onSelect(range, triggerDate, modifiers, e);\n },\n } as typeof dayPickerProps;\n })();\n\n return (\n <DatePickerSizeContext.Provider value={size}>\n <div\n ref={ref}\n className={cn(\n \"inline-flex flex-col rounded-xl border border-modal-stroke bg-modal-background shadow-blur-menu backdrop-blur-sm\",\n isCompact ? \"p-4\" : \"p-6\",\n className,\n )}\n >\n <DayPicker\n showOutsideDays\n numberOfMonths={numberOfMonths}\n formatters={{\n formatCaption: (date: Date) =>\n date.toLocaleDateString(\"en-US\", { month: \"long\", year: \"numeric\" }),\n ...formatters,\n }}\n classNames={{\n root: \"w-full\",\n months: cn(\"relative flex\", isMulti && \"gap-6\"),\n month: \"flex flex-1 flex-col\",\n month_caption: cn(\n \"flex items-center justify-center\",\n isCompact ? \"mb-2 h-6\" : \"mb-4 h-8\",\n ),\n caption_label: cn(\n \"text-content-primary\",\n isCompact\n ? \"typography-body-small-14px-regular\"\n : \"typography-body-default-16px-regular\",\n ),\n nav: \"absolute inset-x-0 top-0 z-20 flex justify-between\",\n button_previous: navButtonClassName,\n button_next: navButtonClassName,\n month_grid: \"w-full\",\n weekdays: \"flex\",\n weekday: cn(\n \"flex flex-1 items-center justify-center text-content-secondary\",\n isCompact\n ? \"typography-description-12px-regular h-6 w-8\"\n : \"typography-body-small-14px-regular h-7.5 w-10\",\n ),\n week: \"flex\",\n day: \"relative flex flex-1 items-center justify-center p-0.5\",\n hidden: \"hidden\",\n }}\n components={{\n /**\n * !NOTE: We're unable to use semantic elements for the grid due to rdp, as such we've disabled the a11y lint rules for these elements in biome.json.\n */\n Chevron: ({ orientation }: ChevronProps) =>\n orientation === \"left\" ? <ChevronLeftIcon /> : <ChevronRightIcon />,\n MonthGrid: (props: MonthGridProps) => <div role=\"grid\" {...props} />,\n Weekdays: (props: WeekdaysProps) => <div role=\"row\" {...props} />,\n Weekday: (props: WeekdayProps) => <div role=\"columnheader\" {...props} />,\n Weeks: (props: WeeksProps) => <div role=\"rowgroup\" {...props} />,\n Week: ({ week, ...props }: WeekProps) => <div role=\"row\" {...props} />,\n Day,\n DayButton,\n }}\n {...resolvedDayPickerProps}\n />\n\n {showFooter && (\n <div className={cn(\"flex gap-2\", isCompact ? \"pt-4\" : \"pt-6\")}>\n <Button variant=\"outline\" size={size} className=\"flex-1\" onClick={onCancel}>\n {cancelLabel}\n </Button>\n <Button variant=\"primary\" size={size} className=\"flex-1\" onClick={onApply}>\n {applyLabel}\n </Button>\n </div>\n )}\n </div>\n </DatePickerSizeContext.Provider>\n );\n },\n);\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":[],"mappings":";;;;;;;;AAqDA,MAAM,wBAAwB,cAA8B,IAAI;AAEhE,SAAS,IAAI,EAAE,KAAK,WAAW,WAAW,GAAG,YAAsB;AACjE,QAAM,EAAE,aAAa,WAAW,aAAA,IAAiB;AACjD,QAAM,mBAAmB,eAAe;AACxC,QAAM,WAAW,eAAe,aAAa,iBAAiB,CAAC;AAE/D,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,WACE;AAAA,QACF,WAAW,eAAe;AAAA,QAC1B,WAAW,aAAa;AAAA,MAAA;AAAA,MAEzB,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAAS,UAAU,EAAE,KAAK,WAAW,WAAW,GAAG,eAA+B;AAChF,QAAM,MAAM,OAA0B,IAAI;AAC1C,QAAM,OAAO,WAAW,qBAAqB;AAE7C,YAAU,MAAM;AACd,QAAI,UAAU,QAAS,KAAI,SAAS,MAAA;AAAA,EACtC,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,aAAa,UAAU,YAAY,CAAC,UAAU;AAEpD,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS,QAAQ;AAAA,QACjB,SAAS,QAAQ;AAAA,QACjB,S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SAAI,MAAK,gBAAgB,GAAG,OAAO;AAAA,gBACtE,OAAO,CAAC,UAAsB,oBAAC,SAAI,MAAK,YAAY,GAAG,OAAO;AAAA,gBAC9D,MAAM,CAAC,EAAE,MAAM,GAAG,MAAA,MAAuB,oBAAC,OAAA,EAAI,MAAK,OAAO,GAAG,MAAA,CAAO;AAAA,gBACpE;AAAA,gBACA;AAAA,cAAA;AAAA,cAED,GAAG;AAAA,YAAA;AAAA,UAAA;AAAA,UAGL,mCACE,OAAA,EAAI,WAAW,GAAG,cAAc,YAAY,SAAS,MAAM,GAC1D,UAAA;AAAA,YAAA,oBAAC,QAAA,EAAO,SAAQ,WAAU,MAAY,WAAU,UAAS,SAAS,UAC/D,UAAA,YAAA,CACH;AAAA,YACA,oBAAC,UAAO,SAAQ,WAAU,MAAY,WAAU,UAAS,SAAS,SAC/D,UAAA,WAAA,CACH;AAAA,UAAA,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAGN;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;"}
@@ -33,6 +33,9 @@ const ITEM_COUNT_TYPOGRAPHY = {
33
33
  "40": "typography-body-small-14px-regular",
34
34
  "32": "typography-body-small-14px-regular"
35
35
  };
36
+ const SELECTED_V2_CLASSES = "theme-v2:text-content-primary-inverted theme-v2:data-[highlighted]:bg-menu-item-selected-hover";
37
+ const SELECTED_SECONDARY_V2_CLASSES = "theme-v2:group-data-[selected]:text-content-secondary-inverted theme-v2:group-data-[selected]:group-data-[highlighted]:text-menu-item-selected-hover-secondary";
38
+ const SELECTED_DISABLED_V2_CLASSES = "theme-v2:bg-transparent";
36
39
  const DropdownMenuItem = React.forwardRef(
37
40
  ({
38
41
  size = "40",
@@ -59,7 +62,7 @@ const DropdownMenuItem = React.forwardRef(
59
62
  const itemClassName = cn(
60
63
  // `text-start` because the sheet variant renders the row as a <button>,
61
64
  // whose UA-centred text misaligned it from the popper variant's rows.
62
- "group flex w-full cursor-pointer gap-2 rounded-sm px-3 text-start outline-none",
65
+ "group flex w-full shrink-0 cursor-pointer gap-2 rounded-sm px-3 text-start outline-none",
63
66
  hasDescription ? "items-start" : "items-center",
64
67
  // The sheet's header runs the full width of the panel, so its rows have to
65
68
  // come in off the edge themselves — 4px here on the panel's own 4px gives the
@@ -78,9 +81,10 @@ const DropdownMenuItem = React.forwardRef(
78
81
  // data-disabled — neither selector above matches them.
79
82
  "aria-disabled:cursor-not-allowed aria-disabled:text-content-disabled",
80
83
  destructive && "text-error-content",
81
- // Selected: the same `Interaction/Hover` fill as a highlighted row (library
82
- // node `23452:13432`), so the current value reads as the resting highlight.
83
- selected && "bg-interaction-hover",
84
+ selected && [
85
+ "bg-menu-item-selected",
86
+ disabled ? SELECTED_DISABLED_V2_CLASSES : SELECTED_V2_CLASSES
87
+ ],
84
88
  className
85
89
  );
86
90
  const selectedProps = selected ? {
@@ -96,12 +100,22 @@ const DropdownMenuItem = React.forwardRef(
96
100
  iconAlignClassName,
97
101
  ITEM_COUNT_TYPOGRAPHY[normalizedSize],
98
102
  destructive ? "text-error-content" : "text-content-tertiary",
99
- "group-data-[disabled]:text-content-disabled"
103
+ "group-data-[disabled]:text-content-disabled",
104
+ !disabled && SELECTED_SECONDARY_V2_CLASSES
100
105
  ),
101
106
  children: count
102
107
  }
103
108
  );
104
- const renderIcon = (icon, className2) => /* @__PURE__ */ jsx(MenuRowIcon, { inheritColor: destructive, alignToTitle: hasDescription, className: className2, children: icon });
109
+ const renderIcon = (icon, className2) => /* @__PURE__ */ jsx(
110
+ MenuRowIcon,
111
+ {
112
+ inheritColor: destructive,
113
+ alignToTitle: hasDescription,
114
+ invertWhenSelected: !disabled,
115
+ className: className2,
116
+ children: icon
117
+ }
118
+ );
105
119
  const leadingNode = leadingIcon != null && renderIcon(leadingIcon);
106
120
  const trailingNode = trailingIcon != null && renderIcon(trailingIcon, asChild ? "ms-auto" : void 0);
107
121
  const trailingActionNode = trailingAction != null && /* @__PURE__ */ jsx(
@@ -116,11 +130,20 @@ const DropdownMenuItem = React.forwardRef(
116
130
  }
117
131
  );
118
132
  const itemChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
119
- avatar != null ? /* @__PURE__ */ jsx("span", { className: cn("shrink-0", iconAlignClassName), children: avatar }) : leadingNode,
133
+ avatar != null ? /* @__PURE__ */ jsx("span", { className: cn("shrink-0", iconAlignClassName, disabled && "theme-v2:opacity-60"), children: avatar }) : leadingNode,
120
134
  hasDescription ? /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
121
135
  /* @__PURE__ */ jsx("span", { className: "typography-body-small-14px-semibold truncate", children }),
122
- /* @__PURE__ */ jsx("span", { className: "typography-body-small-14px-regular truncate text-content-secondary", children: description })
123
- ] }) : /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children }),
136
+ /* @__PURE__ */ jsx(
137
+ "span",
138
+ {
139
+ className: cn(
140
+ "typography-body-small-14px-regular truncate text-content-secondary",
141
+ disabled ? "theme-v2:text-content-disabled" : SELECTED_SECONDARY_V2_CLASSES
142
+ ),
143
+ children: description
144
+ }
145
+ )
146
+ ] }) : /* @__PURE__ */ jsx("span", { className: cn("min-w-0 flex-1 truncate", selected && "font-semibold"), children }),
124
147
  countNode,
125
148
  trailingNode,
126
149
  trailingActionNode
@@ -195,7 +218,7 @@ const DropdownMenuItem = React.forwardRef(
195
218
  DropdownMenuItem.displayName = "DropdownMenuItem";
196
219
  const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => {
197
220
  const variant = React.useContext(DropdownMenuVariantContext);
198
- const separatorClassName = cn("my-1 h-px border-0 bg-neutral-alphas-200", className);
221
+ const separatorClassName = cn("my-[5px] h-px border-0 bg-neutral-alphas-200", className);
199
222
  if (variant === "sheet") {
200
223
  return /* @__PURE__ */ jsx("hr", { ref, className: separatorClassName, ...props });
201
224
  }
@@ -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 * 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,MAAM,WAGrC,CAAC,EAAE,WAAW,WAAW,WAAW,GAAG,MAAA,GAAS,QAAQ;AACxD,QAAM,UAAU,MAAM,WAAW,0BAA0B;AAC3D,QAAM,iBAAiB;AAAA,IACrB;AAAA,IACA,aAAa,QAAQ,SAAS;AAAA,IAC9B;AAAA,EAAA;AAKF,MAAI,YAAY,SAAS;AACvB,+BAAQ,OAAA,EAAI,KAAU,WAAW,gBAAiB,GAAG,OAAO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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;"}
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 /**\n * Marks the item as the current selection in a single-select menu. The row\n * rests on `Buttons/Navigation/Hover` with a semibold label; hover still shows\n * `Interaction/Hover`, because `data-[highlighted]` outranks the selected class.\n * Under the v2 palette that fill is inverted, with inverted content, and a\n * highlighted row moves to `Menu Item Selected Hover` so keyboard focus stays visible.\n * The row also gets `data-selected`, and `aria-current` unless the consumer\n * already sets `aria-checked`.\n * @default false\n */\n selected?: boolean;\n}\n\n/**\n * Under the v2 palette a selected row's `Menu Item Selected` fill is inverted, so its\n * content inverts too, and a highlighted row moves to `Menu Item Selected Hover`.\n */\nconst SELECTED_V2_CLASSES =\n \"theme-v2:text-content-primary-inverted theme-v2:data-[highlighted]:bg-menu-item-selected-hover\";\n\n/**\n * Secondary lines (description, count) on a selected row under the v2 palette: inverted,\n * and `Menu Item Selected Hover Secondary` while the row is highlighted, so they keep\n * contrast on the hover fill.\n */\nconst SELECTED_SECONDARY_V2_CLASSES =\n \"theme-v2:group-data-[selected]:text-content-secondary-inverted theme-v2:group-data-[selected]:group-data-[highlighted]:text-menu-item-selected-hover-secondary\";\n\n/** A disabled selected row takes the library's Disabled state under the v2 palette, which has no fill. */\nconst SELECTED_DISABLED_V2_CLASSES = \"theme-v2:bg-transparent\";\n\n/**\n * An individual item within a {@link DropdownMenuContent}.\n *\n * Rows do not shrink (`shrink-0`): the panel is a scrolling flex column capped at the\n * space available, and a row allowed to shrink would drop to its minimum height and\n * spill a second line.\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 shrink-0 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 && [\n \"bg-menu-item-selected\",\n disabled ? SELECTED_DISABLED_V2_CLASSES : SELECTED_V2_CLASSES,\n ],\n className,\n );\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 !disabled && SELECTED_SECONDARY_V2_CLASSES,\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\n inheritColor={destructive}\n alignToTitle={hasDescription}\n invertWhenSelected={!disabled}\n className={className}\n >\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, disabled && \"theme-v2:opacity-60\")}>\n {avatar}\n </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\n className={cn(\n \"typography-body-small-14px-regular truncate text-content-secondary\",\n disabled ? \"theme-v2:text-content-disabled\" : SELECTED_SECONDARY_V2_CLASSES,\n )}\n >\n {description}\n </span>\n </span>\n ) : (\n <span className={cn(\"min-w-0 flex-1 truncate\", selected && \"font-semibold\")}>\n {children}\n </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-[5px] 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,MAAM,WAGrC,CAAC,EAAE,WAAW,WAAW,WAAW,GAAG,MAAA,GAAS,QAAQ;AACxD,QAAM,UAAU,MAAM,WAAW,0BAA0B;AAC3D,QAAM,iBAAiB;AAAA,IACrB;AAAA,IACA,aAAa,QAAQ,SAAS;AAAA,IAC9B;AAAA,EAAA;AAKF,MAAI,YAAY,SAAS;AACvB,+BAAQ,OAAA,EAAI,KAAU,WAAW,gBAAiB,GAAG,OAAO;AAAA,EAC9D;AAEA,SAAO,oBA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A,MAAC,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,gDAAgD,SAAS;AAKvF,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;"}
@@ -3,6 +3,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { createPortal } from "react-dom";
5
5
  import { cn } from "../../utils/cn.mjs";
6
+ import { capturePointer } from "../../utils/pointerCapture.mjs";
6
7
  import { MenuRowIcon } from "../Icons/MenuRowIcon.mjs";
7
8
  import { DropdownMenuVariantContext } from "./context.mjs";
8
9
  import { ReorderActionsContext, ReorderLiftedContext, DragHandleDots } from "./reorderShared.mjs";
@@ -118,7 +119,7 @@ const DropdownMenuReorderItem = React.forwardRef(
118
119
  if (!canStartReorderDrag(event, handleRef.current)) return;
119
120
  if (!actions.startDrag(value, event, element)) return;
120
121
  event.preventDefault();
121
- element.setPointerCapture?.(event.pointerId);
122
+ capturePointer(element, event.pointerId);
122
123
  },
123
124
  onPointerMove: (event) => {
124
125
  onPointerMove?.(event);