@fanvue/ui 3.52.0 → 3.54.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 (189) hide show
  1. package/dist/cjs/components/AudioPlayer/AudioPlayer.cjs +4 -2
  2. package/dist/cjs/components/AudioPlayer/AudioPlayer.cjs.map +1 -1
  3. package/dist/cjs/components/Autocomplete/Autocomplete.cjs +34 -10
  4. package/dist/cjs/components/Autocomplete/Autocomplete.cjs.map +1 -1
  5. package/dist/cjs/components/Autocomplete/AutocompleteOptionItem.cjs +13 -1
  6. package/dist/cjs/components/Autocomplete/AutocompleteOptionItem.cjs.map +1 -1
  7. package/dist/cjs/components/Badge/Badge.cjs +7 -6
  8. package/dist/cjs/components/Badge/Badge.cjs.map +1 -1
  9. package/dist/cjs/components/BottomNavigation/BottomNavigation.cjs +2 -2
  10. package/dist/cjs/components/BottomNavigation/BottomNavigation.cjs.map +1 -1
  11. package/dist/cjs/components/Button/Button.cjs +2 -1
  12. package/dist/cjs/components/Button/Button.cjs.map +1 -1
  13. package/dist/cjs/components/Card/Card.cjs +6 -3
  14. package/dist/cjs/components/Card/Card.cjs.map +1 -1
  15. package/dist/cjs/components/Chart/ChartCard.cjs +2 -1
  16. package/dist/cjs/components/Chart/ChartCard.cjs.map +1 -1
  17. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs +1 -1
  18. package/dist/cjs/components/Chart/ChartLoadingOverlay.cjs.map +1 -1
  19. package/dist/cjs/components/ChatInput/ChatInput.cjs +2 -2
  20. package/dist/cjs/components/ChatInput/ChatInput.cjs.map +1 -1
  21. package/dist/cjs/components/ChatMessage/ChatMessage.cjs +4 -2
  22. package/dist/cjs/components/ChatMessage/ChatMessage.cjs.map +1 -1
  23. package/dist/cjs/components/Chip/Chip.cjs +10 -9
  24. package/dist/cjs/components/Chip/Chip.cjs.map +1 -1
  25. package/dist/cjs/components/CreatorCard/CreatorCard.cjs +3 -5
  26. package/dist/cjs/components/CreatorCard/CreatorCard.cjs.map +1 -1
  27. package/dist/cjs/components/CreatorCover/CreatorCover.cjs +11 -7
  28. package/dist/cjs/components/CreatorCover/CreatorCover.cjs.map +1 -1
  29. package/dist/cjs/components/DatePicker/DatePicker.cjs +37 -16
  30. package/dist/cjs/components/DatePicker/DatePicker.cjs.map +1 -1
  31. package/dist/cjs/components/DatePicker/DateRangePanel.cjs +143 -0
  32. package/dist/cjs/components/DatePicker/DateRangePanel.cjs.map +1 -0
  33. package/dist/cjs/components/DatePicker/DateRangePicker.cjs +33 -0
  34. package/dist/cjs/components/DatePicker/DateRangePicker.cjs.map +1 -0
  35. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs +33 -10
  36. package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs.map +1 -1
  37. package/dist/cjs/components/DropdownMenu/DropdownMenuReorderItem.cjs +2 -1
  38. package/dist/cjs/components/DropdownMenu/DropdownMenuReorderItem.cjs.map +1 -1
  39. package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs +18 -13
  40. package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs.map +1 -1
  41. package/dist/cjs/components/DropdownMenu/DropdownMenuSelectionItems.cjs +56 -40
  42. package/dist/cjs/components/DropdownMenu/DropdownMenuSelectionItems.cjs.map +1 -1
  43. package/dist/cjs/components/FilterMenu/FilterMenu.cjs +45 -0
  44. package/dist/cjs/components/FilterMenu/FilterMenu.cjs.map +1 -0
  45. package/dist/cjs/components/IconButton/IconButton.cjs +7 -3
  46. package/dist/cjs/components/IconButton/IconButton.cjs.map +1 -1
  47. package/dist/cjs/components/Icons/MenuRowIcon.cjs +9 -2
  48. package/dist/cjs/components/Icons/MenuRowIcon.cjs.map +1 -1
  49. package/dist/cjs/components/Icons/ReorganiseIcon.cjs +65 -0
  50. package/dist/cjs/components/Icons/ReorganiseIcon.cjs.map +1 -0
  51. package/dist/cjs/components/Icons/VerifiedIcon.cjs +9 -15
  52. package/dist/cjs/components/Icons/VerifiedIcon.cjs.map +1 -1
  53. package/dist/cjs/components/Pagination/Pagination.cjs +3 -2
  54. package/dist/cjs/components/Pagination/Pagination.cjs.map +1 -1
  55. package/dist/cjs/components/PhoneField/PhoneField.cjs +21 -17
  56. package/dist/cjs/components/PhoneField/PhoneField.cjs.map +1 -1
  57. package/dist/cjs/components/Popover/Popover.cjs +69 -0
  58. package/dist/cjs/components/Popover/Popover.cjs.map +1 -0
  59. package/dist/cjs/components/Select/Select.cjs +49 -12
  60. package/dist/cjs/components/Select/Select.cjs.map +1 -1
  61. package/dist/cjs/components/Slider/SliderThumb.cjs +3 -2
  62. package/dist/cjs/components/Slider/SliderThumb.cjs.map +1 -1
  63. package/dist/cjs/components/Snackbar/Snackbar.cjs +1 -1
  64. package/dist/cjs/components/Snackbar/Snackbar.cjs.map +1 -1
  65. package/dist/cjs/components/Switch/Switch.cjs +1 -1
  66. package/dist/cjs/components/Switch/Switch.cjs.map +1 -1
  67. package/dist/cjs/components/Table/Table.cjs +104 -38
  68. package/dist/cjs/components/Table/Table.cjs.map +1 -1
  69. package/dist/cjs/components/Table/TableToolbarSearchFilters.cjs +152 -0
  70. package/dist/cjs/components/Table/TableToolbarSearchFilters.cjs.map +1 -0
  71. package/dist/cjs/components/Table/useFittingCount.cjs +51 -0
  72. package/dist/cjs/components/Table/useFittingCount.cjs.map +1 -0
  73. package/dist/cjs/components/Tag/Tag.cjs +99 -0
  74. package/dist/cjs/components/Tag/Tag.cjs.map +1 -0
  75. package/dist/cjs/components/TextArea/TextArea.cjs +5 -4
  76. package/dist/cjs/components/TextArea/TextArea.cjs.map +1 -1
  77. package/dist/cjs/components/TextField/TextField.cjs +30 -15
  78. package/dist/cjs/components/TextField/TextField.cjs.map +1 -1
  79. package/dist/cjs/date-picker.cjs +4 -0
  80. package/dist/cjs/date-picker.cjs.map +1 -1
  81. package/dist/cjs/index.cjs +12 -0
  82. package/dist/cjs/index.cjs.map +1 -1
  83. package/dist/cjs/utils/floatingContentSurface.cjs +8 -0
  84. package/dist/cjs/utils/floatingContentSurface.cjs.map +1 -0
  85. package/dist/cjs/utils/inputFieldClasses.cjs +8 -0
  86. package/dist/cjs/utils/inputFieldClasses.cjs.map +1 -0
  87. package/dist/cjs/utils/pointerCapture.cjs +20 -0
  88. package/dist/cjs/utils/pointerCapture.cjs.map +1 -0
  89. package/dist/cjs/utils/useDragToDismiss.cjs +3 -2
  90. package/dist/cjs/utils/useDragToDismiss.cjs.map +1 -1
  91. package/dist/cjs/utils/useSuppressClickAfterDrag.cjs +2 -1
  92. package/dist/cjs/utils/useSuppressClickAfterDrag.cjs.map +1 -1
  93. package/dist/components/AudioPlayer/AudioPlayer.mjs +4 -2
  94. package/dist/components/AudioPlayer/AudioPlayer.mjs.map +1 -1
  95. package/dist/components/Autocomplete/Autocomplete.mjs +34 -10
  96. package/dist/components/Autocomplete/Autocomplete.mjs.map +1 -1
  97. package/dist/components/Autocomplete/AutocompleteOptionItem.mjs +13 -1
  98. package/dist/components/Autocomplete/AutocompleteOptionItem.mjs.map +1 -1
  99. package/dist/components/Badge/Badge.mjs +7 -6
  100. package/dist/components/Badge/Badge.mjs.map +1 -1
  101. package/dist/components/BottomNavigation/BottomNavigation.mjs +2 -2
  102. package/dist/components/BottomNavigation/BottomNavigation.mjs.map +1 -1
  103. package/dist/components/Button/Button.mjs +2 -1
  104. package/dist/components/Button/Button.mjs.map +1 -1
  105. package/dist/components/Card/Card.mjs +6 -3
  106. package/dist/components/Card/Card.mjs.map +1 -1
  107. package/dist/components/Chart/ChartCard.mjs +2 -1
  108. package/dist/components/Chart/ChartCard.mjs.map +1 -1
  109. package/dist/components/Chart/ChartLoadingOverlay.mjs +1 -1
  110. package/dist/components/Chart/ChartLoadingOverlay.mjs.map +1 -1
  111. package/dist/components/ChatInput/ChatInput.mjs +2 -2
  112. package/dist/components/ChatInput/ChatInput.mjs.map +1 -1
  113. package/dist/components/ChatMessage/ChatMessage.mjs +4 -2
  114. package/dist/components/ChatMessage/ChatMessage.mjs.map +1 -1
  115. package/dist/components/Chip/Chip.mjs +10 -9
  116. package/dist/components/Chip/Chip.mjs.map +1 -1
  117. package/dist/components/CreatorCard/CreatorCard.mjs +3 -5
  118. package/dist/components/CreatorCard/CreatorCard.mjs.map +1 -1
  119. package/dist/components/CreatorCover/CreatorCover.mjs +11 -7
  120. package/dist/components/CreatorCover/CreatorCover.mjs.map +1 -1
  121. package/dist/components/DatePicker/DatePicker.mjs +39 -18
  122. package/dist/components/DatePicker/DatePicker.mjs.map +1 -1
  123. package/dist/components/DatePicker/DateRangePanel.mjs +126 -0
  124. package/dist/components/DatePicker/DateRangePanel.mjs.map +1 -0
  125. package/dist/components/DatePicker/DateRangePicker.mjs +33 -0
  126. package/dist/components/DatePicker/DateRangePicker.mjs.map +1 -0
  127. package/dist/components/DropdownMenu/DropdownMenuItem.mjs +33 -10
  128. package/dist/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -1
  129. package/dist/components/DropdownMenu/DropdownMenuReorderItem.mjs +2 -1
  130. package/dist/components/DropdownMenu/DropdownMenuReorderItem.mjs.map +1 -1
  131. package/dist/components/DropdownMenu/DropdownMenuRoot.mjs +18 -13
  132. package/dist/components/DropdownMenu/DropdownMenuRoot.mjs.map +1 -1
  133. package/dist/components/DropdownMenu/DropdownMenuSelectionItems.mjs +56 -40
  134. package/dist/components/DropdownMenu/DropdownMenuSelectionItems.mjs.map +1 -1
  135. package/dist/components/FilterMenu/FilterMenu.mjs +28 -0
  136. package/dist/components/FilterMenu/FilterMenu.mjs.map +1 -0
  137. package/dist/components/IconButton/IconButton.mjs +7 -3
  138. package/dist/components/IconButton/IconButton.mjs.map +1 -1
  139. package/dist/components/Icons/MenuRowIcon.mjs +9 -2
  140. package/dist/components/Icons/MenuRowIcon.mjs.map +1 -1
  141. package/dist/components/Icons/ReorganiseIcon.mjs +48 -0
  142. package/dist/components/Icons/ReorganiseIcon.mjs.map +1 -0
  143. package/dist/components/Icons/VerifiedIcon.mjs +9 -15
  144. package/dist/components/Icons/VerifiedIcon.mjs.map +1 -1
  145. package/dist/components/Pagination/Pagination.mjs +3 -2
  146. package/dist/components/Pagination/Pagination.mjs.map +1 -1
  147. package/dist/components/PhoneField/PhoneField.mjs +21 -17
  148. package/dist/components/PhoneField/PhoneField.mjs.map +1 -1
  149. package/dist/components/Popover/Popover.mjs +51 -0
  150. package/dist/components/Popover/Popover.mjs.map +1 -0
  151. package/dist/components/Select/Select.mjs +49 -12
  152. package/dist/components/Select/Select.mjs.map +1 -1
  153. package/dist/components/Slider/SliderThumb.mjs +3 -2
  154. package/dist/components/Slider/SliderThumb.mjs.map +1 -1
  155. package/dist/components/Snackbar/Snackbar.mjs +1 -1
  156. package/dist/components/Snackbar/Snackbar.mjs.map +1 -1
  157. package/dist/components/Switch/Switch.mjs +1 -1
  158. package/dist/components/Switch/Switch.mjs.map +1 -1
  159. package/dist/components/Table/Table.mjs +104 -38
  160. package/dist/components/Table/Table.mjs.map +1 -1
  161. package/dist/components/Table/TableToolbarSearchFilters.mjs +135 -0
  162. package/dist/components/Table/TableToolbarSearchFilters.mjs.map +1 -0
  163. package/dist/components/Table/useFittingCount.mjs +34 -0
  164. package/dist/components/Table/useFittingCount.mjs.map +1 -0
  165. package/dist/components/Tag/Tag.mjs +82 -0
  166. package/dist/components/Tag/Tag.mjs.map +1 -0
  167. package/dist/components/TextArea/TextArea.mjs +5 -4
  168. package/dist/components/TextArea/TextArea.mjs.map +1 -1
  169. package/dist/components/TextField/TextField.mjs +30 -15
  170. package/dist/components/TextField/TextField.mjs.map +1 -1
  171. package/dist/date-picker.d.ts +109 -0
  172. package/dist/date-picker.mjs +5 -1
  173. package/dist/date-picker.mjs.map +1 -1
  174. package/dist/index.d.ts +317 -20
  175. package/dist/index.mjs +12 -0
  176. package/dist/index.mjs.map +1 -1
  177. package/dist/styles/base.css +51 -4
  178. package/dist/styles/theme.css +1217 -1
  179. package/dist/utils/floatingContentSurface.mjs +8 -0
  180. package/dist/utils/floatingContentSurface.mjs.map +1 -0
  181. package/dist/utils/inputFieldClasses.mjs +8 -0
  182. package/dist/utils/inputFieldClasses.mjs.map +1 -0
  183. package/dist/utils/pointerCapture.mjs +20 -0
  184. package/dist/utils/pointerCapture.mjs.map +1 -0
  185. package/dist/utils/useDragToDismiss.mjs +3 -2
  186. package/dist/utils/useDragToDismiss.mjs.map +1 -1
  187. package/dist/utils/useSuppressClickAfterDrag.mjs +2 -1
  188. package/dist/utils/useSuppressClickAfterDrag.mjs.map +1 -1
  189. package/package.json +1 -1
@@ -6,6 +6,7 @@ const SelectPrimitive = require("@radix-ui/react-select");
6
6
  const React = require("react");
7
7
  const cn = require("../../utils/cn.cjs");
8
8
  const floatingContentCollisionPadding = require("../../utils/floatingContentCollisionPadding.cjs");
9
+ const floatingContentSurface = require("../../utils/floatingContentSurface.cjs");
9
10
  const CheckIcon = require("../Icons/CheckIcon.cjs");
10
11
  const ChevronDownIcon = require("../Icons/ChevronDownIcon.cjs");
11
12
  const IconDefaults = require("../Icons/IconDefaults.cjs");
@@ -108,8 +109,11 @@ const Select = React__namespace.forwardRef(
108
109
  TRIGGER_GAP[size],
109
110
  TRIGGER_TYPOGRAPHY[size],
110
111
  isFilled ? "justify-center bg-background-secondary text-content-tertiary" : "justify-between bg-inputs-inputs-primary",
111
- error ? "border-error-content" : isFilled ? "border-transparent" : "border-border-primary",
112
- !disabled && !error && (isFilled ? "hover:bg-neutral-alphas-100 data-[state=open]:bg-neutral-alphas-100" : "hover:border-neutral-alphas-400 data-[state=open]:border-neutral-alphas-400"),
112
+ error ? "border-error-content" : isFilled ? "border-transparent" : "border-border-input",
113
+ !disabled && !error && (isFilled ? "hover:bg-neutral-alphas-100 data-[state=open]:bg-neutral-alphas-100" : [
114
+ "hover:border-border-input-hover data-[state=open]:border-border-input-hover",
115
+ "theme-v2:focus-visible:border-border-selected theme-v2:focus-visible:shadow-none theme-v2:data-[state=open]:border-border-selected"
116
+ ]),
113
117
  disabled && "cursor-not-allowed opacity-50"
114
118
  ),
115
119
  children: [
@@ -156,6 +160,22 @@ const Select = React__namespace.forwardRef(
156
160
  }
157
161
  );
158
162
  Select.displayName = "Select";
163
+ function SelectViewport({ children }) {
164
+ const [interacted, setInteracted] = React__namespace.useState(false);
165
+ const markInteracted = () => {
166
+ if (!interacted) setInteracted(true);
167
+ };
168
+ return /* @__PURE__ */ jsxRuntime.jsx(
169
+ SelectPrimitive__namespace.Viewport,
170
+ {
171
+ "data-interacted": interacted ? "" : void 0,
172
+ onPointerMove: markInteracted,
173
+ onKeyDown: markInteracted,
174
+ className: "group/select flex max-h-[var(--radix-select-content-available-height)] flex-col gap-0.5 overflow-y-auto p-2",
175
+ children
176
+ }
177
+ );
178
+ }
159
179
  const SelectContent = React__namespace.forwardRef(
160
180
  ({
161
181
  className,
@@ -172,9 +192,10 @@ const SelectContent = React__namespace.forwardRef(
172
192
  position,
173
193
  sideOffset,
174
194
  collisionPadding,
175
- style: { zIndex: "var(--fanvue-ui-portal-z-index, 50)", ...style },
195
+ style: { zIndex: floatingContentSurface.FLOATING_CONTENT_Z_INDEX, ...style },
176
196
  className: cn.cn(
177
- "relative w-max min-w-(--radix-select-trigger-width) max-w-(--radix-select-content-available-width) overflow-hidden rounded-md border border-border-strong bg-background-secondary text-content-primary shadow-blur-menu backdrop-blur-xs",
197
+ floatingContentSurface.FLOATING_CONTENT_SURFACE_CLASS,
198
+ "relative w-max min-w-(--radix-select-trigger-width) max-w-(--radix-select-content-available-width) overflow-hidden",
178
199
  "data-[state=closed]:animate-out data-[state=open]:animate-in",
179
200
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
180
201
  "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
@@ -182,7 +203,7 @@ const SelectContent = React__namespace.forwardRef(
182
203
  className
183
204
  ),
184
205
  ...props,
185
- children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Viewport, { className: "max-h-[var(--radix-select-content-available-height)] overflow-y-auto p-2", children: /* @__PURE__ */ jsxRuntime.jsx(IconDefaults.IconDefaultsContext.Provider, { value: IconDefaults.NO_ICON_DEFAULTS, children }) })
206
+ children: /* @__PURE__ */ jsxRuntime.jsx(SelectViewport, { children: /* @__PURE__ */ jsxRuntime.jsx(IconDefaults.IconDefaultsContext.Provider, { value: IconDefaults.NO_ICON_DEFAULTS, children }) })
186
207
  }
187
208
  ) })
188
209
  );
@@ -198,7 +219,10 @@ const ITEM_DESCRIPTION_TYPOGRAPHY = {
198
219
  function isRenderableNode(node) {
199
220
  return node !== null && node !== void 0 && typeof node !== "boolean";
200
221
  }
201
- const SelectItem = React__namespace.forwardRef(({ className, children, size, leadingIcon, avatar, description, ...props }, ref) => {
222
+ const CHECKED_V2_CLASSES = "theme-v2:data-[state=checked]:text-content-primary-inverted theme-v2:data-[state=checked]:focus:bg-menu-item-selected theme-v2:data-[state=checked]:data-highlighted:bg-menu-item-selected theme-v2:group-data-[interacted]/select:data-[state=checked]:data-highlighted:bg-menu-item-selected-hover";
223
+ const CHECKED_DESCRIPTION_V2_CLASSES = "theme-v2:group-data-[state=checked]:text-content-secondary-inverted theme-v2:group-data-[interacted]/select:group-data-[state=checked]:group-data-highlighted:text-menu-item-selected-hover-secondary";
224
+ const CHECKED_DISABLED_V2_CLASSES = "theme-v2:data-[state=checked]:bg-transparent";
225
+ const SelectItem = React__namespace.forwardRef(({ className, children, size, leadingIcon, avatar, description, disabled, ...props }, ref) => {
202
226
  const { size: triggerSize } = React__namespace.useContext(SelectContext);
203
227
  const itemSize = size ?? (triggerSize === "32" ? "32" : "40");
204
228
  const hasDescription = isRenderableNode(description);
@@ -209,18 +233,22 @@ const SelectItem = React__namespace.forwardRef(({ className, children, size, lea
209
233
  {
210
234
  ref,
211
235
  className: cn.cn(
212
- "group relative flex w-full cursor-pointer select-none gap-2 rounded-sm px-3 text-content-primary outline-none",
236
+ "group relative flex w-full shrink-0 cursor-pointer select-none gap-2 rounded-sm px-3 text-content-primary outline-none",
213
237
  hasDescription ? "items-start" : "items-center",
214
238
  ITEM_SIZE_CLASSES[itemSize],
215
239
  hasAvatar && !hasDescription && itemSize === "32" && "py-1",
240
+ "data-[state=checked]:bg-menu-item-selected",
216
241
  "focus:bg-interaction-hover data-highlighted:bg-interaction-hover",
242
+ "data-[state=checked]:focus:bg-interaction-hover data-[state=checked]:data-highlighted:bg-interaction-hover",
243
+ disabled ? CHECKED_DISABLED_V2_CLASSES : CHECKED_V2_CLASSES,
217
244
  "data-disabled:pointer-events-none data-disabled:text-content-disabled",
218
245
  className
219
246
  ),
247
+ disabled,
220
248
  ...props,
221
249
  children: [
222
- hasAvatar ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", children: avatar }) : hasLeadingIcon && // In the two-line row the icon centres on the 18px title line, as in DropdownMenuItem.
223
- /* @__PURE__ */ jsxRuntime.jsx(MenuRowIcon.MenuRowIcon, { alignToTitle: hasDescription, children: leadingIcon }),
250
+ hasAvatar ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn.cn("shrink-0", disabled && "theme-v2:opacity-60"), children: avatar }) : hasLeadingIcon && // In the two-line row the icon centres on the 18px title line, as in DropdownMenuItem.
251
+ /* @__PURE__ */ jsxRuntime.jsx(MenuRowIcon.MenuRowIcon, { alignToTitle: hasDescription, invertWhenSelected: !disabled, children: leadingIcon }),
224
252
  hasDescription ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
225
253
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typography-body-small-14px-semibold truncate", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children }) }),
226
254
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -228,12 +256,13 @@ const SelectItem = React__namespace.forwardRef(({ className, children, size, lea
228
256
  {
229
257
  className: cn.cn(
230
258
  "truncate text-content-secondary group-data-[disabled]:text-content-disabled",
259
+ !disabled && CHECKED_DESCRIPTION_V2_CLASSES,
231
260
  ITEM_DESCRIPTION_TYPOGRAPHY[itemSize]
232
261
  ),
233
262
  children: description
234
263
  }
235
264
  )
236
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children }) }),
265
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate group-data-[state=checked]:font-semibold", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children }) }),
237
266
  /* @__PURE__ */ jsxRuntime.jsx(
238
267
  SelectPrimitive__namespace.ItemIndicator,
239
268
  {
@@ -241,7 +270,15 @@ const SelectItem = React__namespace.forwardRef(({ className, children, size, lea
241
270
  "ml-auto flex w-4 shrink-0 items-center justify-center",
242
271
  hasDescription ? "h-4.5 self-start" : "h-4"
243
272
  ),
244
- children: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon.CheckIcon, { className: "size-4 text-content-primary group-data-[disabled]:text-content-disabled" })
273
+ children: /* @__PURE__ */ jsxRuntime.jsx(
274
+ CheckIcon.CheckIcon,
275
+ {
276
+ className: cn.cn(
277
+ "size-4 text-content-primary group-data-[disabled]:text-content-disabled",
278
+ !disabled && "theme-v2:text-icons-primary-inverted"
279
+ )
280
+ }
281
+ )
245
282
  }
246
283
  )
247
284
  ]
@@ -249,7 +286,7 @@ const SelectItem = React__namespace.forwardRef(({ className, children, size, lea
249
286
  );
250
287
  });
251
288
  SelectItem.displayName = "SelectItem";
252
- const SelectGroup = SelectPrimitive__namespace.Group;
289
+ const SelectGroup = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Group, { ref, className: cn.cn("flex flex-col gap-0.5", className), ...props }));
253
290
  SelectGroup.displayName = "SelectGroup";
254
291
  const SelectLabel = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
255
292
  SelectPrimitive__namespace.Label,
@@ -1 +1 @@
1
- {"version":3,"file":"Select.cjs","sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["import * as SelectPrimitive from \"@radix-ui/react-select\";\nimport * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { FLOATING_CONTENT_COLLISION_PADDING } from \"@/utils/floatingContentCollisionPadding\";\nimport { CheckIcon } from \"../Icons/CheckIcon\";\nimport { ChevronDownIcon } from \"../Icons/ChevronDownIcon\";\nimport { IconDefaultsContext, NO_ICON_DEFAULTS } from \"../Icons/IconDefaults\";\nimport { MenuRowIcon } from \"../Icons/MenuRowIcon\";\n\n/** Select field height in pixels. */\nexport type SelectSize = \"48\" | \"40\" | \"32\";\n\n/**\n * Trigger surface. `\"default\"` is the bordered input field; `\"filled\"` is the\n * V2 Table Tab Actions pill: a `background-secondary` fill with no border and a\n * centred `content-tertiary` label, for filters that sit beside a table or chart.\n */\nexport type SelectVariant = \"default\" | \"filled\";\n\ntype SelectContextValue = {\n size: SelectSize;\n error: boolean;\n disabled?: boolean;\n};\n\nconst SelectContext = React.createContext<SelectContextValue>({\n size: \"48\",\n error: false,\n});\n\nconst TRIGGER_HEIGHT: Record<SelectSize, string> = {\n \"48\": \"h-12\",\n \"40\": \"h-10\",\n \"32\": \"h-8\",\n};\n\nconst TRIGGER_PADDING_X: Record<SelectSize, string> = {\n \"48\": \"px-4\",\n \"40\": \"px-4\",\n \"32\": \"px-3\",\n};\n\nconst TRIGGER_GAP: Record<SelectSize, string> = {\n \"48\": \"gap-3\",\n \"40\": \"gap-3\",\n \"32\": \"gap-2\",\n};\n\nconst TRIGGER_TYPOGRAPHY: Record<SelectSize, string> = {\n \"48\": \"typography-body-default-16px-regular\",\n \"40\": \"typography-body-default-16px-regular\",\n \"32\": \"typography-body-small-14px-regular\",\n};\n\nexport interface SelectProps extends Omit<SelectPrimitive.SelectProps, \"dir\"> {\n /** Label text displayed above the trigger. Also used as the accessible name. */\n label?: string;\n /** Accessible name applied directly to the trigger button when no visible `label` is provided. */\n \"aria-label\"?: string;\n /** ID of an external element that labels the trigger button. */\n \"aria-labelledby\"?: string;\n /** Helper text displayed below the trigger. Replaced by `errorMessage` when `error` is `true`. */\n helperText?: string;\n /** Height of the select field in pixels. @default \"48\" */\n size?: SelectSize;\n /** Trigger surface. See {@link SelectVariant}. @default \"default\" */\n variant?: SelectVariant;\n /** Whether the field is in an error state. @default false */\n error?: boolean;\n /** Error message displayed below the trigger. Shown instead of `helperText` when `error` is `true`. */\n errorMessage?: string;\n /** Placeholder shown when no value is selected. */\n placeholder?: string;\n /** Icon element displayed at the left side of the trigger. */\n leftIcon?: React.ReactNode;\n /** Whether the field stretches to fill its container width. @default false */\n fullWidth?: boolean;\n /** Wraps the `className` of the outermost container div. */\n className?: string;\n /** HTML `id` applied to the trigger button. Auto-generated if omitted. */\n id?: string;\n}\n\n/**\n * A select field with optional label, helper/error text, and an icon slot,\n * built on Radix UI Select for full accessibility and keyboard navigation.\n *\n * Pair with {@link SelectContent} and {@link SelectItem} to provide options.\n *\n * @example\n * ```tsx\n * <Select label=\"Country\" placeholder=\"Select a country\">\n * <SelectContent>\n * <SelectItem value=\"us\">United States</SelectItem>\n * <SelectItem value=\"uk\">United Kingdom</SelectItem>\n * </SelectContent>\n * </Select>\n * ```\n */\nexport const Select = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n SelectProps\n>(\n (\n {\n label,\n helperText,\n size = \"48\",\n variant = \"default\",\n error = false,\n errorMessage,\n placeholder,\n leftIcon,\n fullWidth = false,\n className,\n id,\n disabled,\n children,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const triggerId = id ?? generatedId;\n const helperTextId = `${triggerId}-helper`;\n const bottomText = error && errorMessage ? errorMessage : helperText;\n const isFilled = variant === \"filled\";\n\n return (\n <SelectContext.Provider value={{ size, error, disabled }}>\n <div\n className={cn(\"flex flex-col\", fullWidth && \"w-full\", className)}\n data-disabled={disabled ? \"\" : undefined}\n data-error={error ? \"\" : undefined}\n >\n {label && (\n <label\n htmlFor={triggerId}\n className=\"typography-description-12px-semibold pb-2 text-content-primary\"\n >\n {label}\n </label>\n )}\n\n <SelectPrimitive.Root disabled={disabled} {...props}>\n <SelectPrimitive.Trigger\n ref={ref}\n id={triggerId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={bottomText ? helperTextId : undefined}\n aria-invalid={error || undefined}\n className={cn(\n \"flex w-full cursor-pointer items-center rounded-sm border outline-none focus-visible:shadow-focus-ring motion-safe:transition-colors\",\n TRIGGER_HEIGHT[size],\n isFilled ? \"px-2\" : TRIGGER_PADDING_X[size],\n TRIGGER_GAP[size],\n TRIGGER_TYPOGRAPHY[size],\n isFilled\n ? \"justify-center bg-background-secondary text-content-tertiary\"\n : \"justify-between bg-inputs-inputs-primary\",\n error\n ? \"border-error-content\"\n : isFilled\n ? \"border-transparent\"\n : \"border-border-primary\",\n !disabled &&\n !error &&\n (isFilled\n ? \"hover:bg-neutral-alphas-100 data-[state=open]:bg-neutral-alphas-100\"\n : \"hover:border-neutral-alphas-400 data-[state=open]:border-neutral-alphas-400\"),\n disabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n {leftIcon && (\n <span\n className=\"flex size-5 shrink-0 items-center justify-center text-content-secondary\"\n data-testid=\"left-icon\"\n >\n {leftIcon}\n </span>\n )}\n <span\n className={cn(\n \"min-w-0 flex-1 truncate [&>[data-placeholder]]:text-content-tertiary\",\n isFilled\n ? \"text-center text-content-tertiary\"\n : \"text-left text-content-primary\",\n )}\n >\n <SelectPrimitive.Value placeholder={placeholder} />\n </span>\n </div>\n\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon size={isFilled ? 16 : 24} className=\"shrink-0\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n\n {children}\n </SelectPrimitive.Root>\n\n {bottomText && (\n <p\n id={helperTextId}\n className={cn(\n \"typography-description-12px-regular px-2 pt-1 pb-0.5\",\n error ? \"text-error-content\" : \"text-content-secondary\",\n )}\n >\n {bottomText}\n </p>\n )}\n </div>\n </SelectContext.Provider>\n );\n },\n);\n\nSelect.displayName = \"Select\";\n\nexport interface SelectContentProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> {}\n\n/**\n * The dropdown panel rendered inside a portal. Place {@link SelectItem} elements\n * (and optionally {@link SelectGroup} / {@link SelectLabel}) as children.\n */\nexport const SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = \"popper\",\n sideOffset = 4,\n collisionPadding = FLOATING_CONTENT_COLLISION_PADDING,\n style,\n ...props\n },\n ref,\n ) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n style={{ zIndex: \"var(--fanvue-ui-portal-z-index, 50)\", ...style }}\n className={cn(\n \"relative w-max min-w-(--radix-select-trigger-width) max-w-(--radix-select-content-available-width) overflow-hidden rounded-md border border-border-strong bg-background-secondary text-content-primary shadow-blur-menu backdrop-blur-xs\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n >\n <SelectPrimitive.Viewport className=\"max-h-[var(--radix-select-content-available-height)] overflow-y-auto p-2\">\n {/* A select opened from inside a menu row must not inherit that row's icon defaults. */}\n <IconDefaultsContext.Provider value={NO_ICON_DEFAULTS}>\n {children}\n </IconDefaultsContext.Provider>\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n ),\n);\n\nSelectContent.displayName = \"SelectContent\";\n\n/** Dropdown row height in pixels, matching the V2 Menu Item spec. */\nexport type SelectItemSize = \"40\" | \"32\";\n\nconst ITEM_SIZE_CLASSES: Record<SelectItemSize, 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\nconst ITEM_DESCRIPTION_TYPOGRAPHY: Record<SelectItemSize, string> = {\n \"40\": \"typography-body-small-14px-regular\",\n \"32\": \"typography-description-12px-regular\",\n};\n\nexport interface SelectItemProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {\n /** Row height. Defaults to the parent {@link Select} size (`48`/`40` → `40`, `32` → `32`). */\n size?: SelectItemSize;\n /**\n * Icon (or other node) rendered before the label. Ignored when {@link SelectItemProps.avatar} is set.\n * Treated like `DropdownMenuItem`'s icons: a 16px box in `Icons/Secondary`, prop-based icons filled at 16px\n * unless they set `filled` or `size` themselves.\n */\n leadingIcon?: React.ReactNode;\n /**\n * Leading avatar rendered in place of {@link SelectItemProps.leadingIcon}, for rows\n * representing a person or account. Pass an `Avatar` sized to `24`. Takes precedence over `leadingIcon`.\n */\n avatar?: React.ReactNode;\n /** Optional secondary text rendered on a second line below the label. */\n description?: React.ReactNode;\n}\n\n/**\n * Whether a `ReactNode` will actually render. Excludes `null`/`undefined` and\n * booleans so short-circuit props (e.g. `description={cond && \"…\"}`) don't flip\n * the item into a two-line/avatar layout when they resolve to `false`.\n */\nfunction isRenderableNode(node: React.ReactNode): boolean {\n return node !== null && node !== undefined && typeof node !== \"boolean\";\n}\n\n/**\n * An individual option inside {@link SelectContent}, following the V2 Menu Item spec.\n *\n * Supports a leading icon or avatar, an optional two-line layout via `description`,\n * and the standard hover / selected / disabled states. The selected row is marked\n * with a trailing check indicator.\n *\n * @example\n * ```tsx\n * <SelectItem value=\"jane\" avatar={<Avatar size={24} fallback=\"JD\" />} description=\"Product designer\">\n * Jane Doe\n * </SelectItem>\n * ```\n */\nexport const SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n SelectItemProps\n>(({ className, children, size, leadingIcon, avatar, description, ...props }, ref) => {\n const { size: triggerSize } = React.useContext(SelectContext);\n const itemSize: SelectItemSize = size ?? (triggerSize === \"32\" ? \"32\" : \"40\");\n const hasDescription = isRenderableNode(description);\n const hasAvatar = isRenderableNode(avatar);\n const hasLeadingIcon = isRenderableNode(leadingIcon);\n\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"group relative flex w-full cursor-pointer select-none gap-2 rounded-sm px-3 text-content-primary outline-none\",\n hasDescription ? \"items-start\" : \"items-center\",\n ITEM_SIZE_CLASSES[itemSize],\n hasAvatar && !hasDescription && itemSize === \"32\" && \"py-1\",\n \"focus:bg-interaction-hover data-highlighted:bg-interaction-hover\",\n \"data-disabled:pointer-events-none data-disabled:text-content-disabled\",\n className,\n )}\n {...props}\n >\n {hasAvatar ? (\n <span className=\"shrink-0\">{avatar}</span>\n ) : (\n hasLeadingIcon && (\n // In the two-line row the icon centres on the 18px title line, as in DropdownMenuItem.\n <MenuRowIcon alignToTitle={hasDescription}>{leadingIcon}</MenuRowIcon>\n )\n )}\n\n {hasDescription ? (\n <span className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n {/* A 14px semibold title over the regular description, matching DropdownMenuItem's two-line row. */}\n <span className=\"typography-body-small-14px-semibold truncate\">\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </span>\n <span\n className={cn(\n \"truncate text-content-secondary group-data-[disabled]:text-content-disabled\",\n ITEM_DESCRIPTION_TYPOGRAPHY[itemSize],\n )}\n >\n {description}\n </span>\n </span>\n ) : (\n <span className=\"min-w-0 flex-1 truncate\">\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </span>\n )}\n\n <SelectPrimitive.ItemIndicator\n className={cn(\n \"ml-auto flex w-4 shrink-0 items-center justify-center\",\n hasDescription ? \"h-4.5 self-start\" : \"h-4\",\n )}\n >\n <CheckIcon className=\"size-4 text-content-primary group-data-[disabled]:text-content-disabled\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n );\n});\n\nSelectItem.displayName = \"SelectItem\";\n\n/** Props for {@link SelectGroup}. */\nexport type SelectGroupProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;\n\n/**\n * Groups related {@link SelectItem} elements under a {@link SelectLabel}.\n */\nexport const SelectGroup = SelectPrimitive.Group;\nSelectGroup.displayName = \"SelectGroup\";\n\nexport interface SelectLabelProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label> {}\n\n/**\n * A non-interactive label shown above a {@link SelectGroup}.\n */\nexport const SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n SelectLabelProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\n \"typography-description-12px-semibold px-3 py-1.5 text-content-secondary\",\n className,\n )}\n {...props}\n />\n));\n\nSelectLabel.displayName = \"SelectLabel\";\n\nexport interface SelectSeparatorProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator> {}\n\n/** A horizontal rule that visually separates groups in {@link SelectContent}. */\nexport const SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"my-1 h-px bg-neutral-alphas-200\", className)}\n {...props}\n />\n));\n\nSelectSeparator.displayName = \"SelectSeparator\";\n"],"names":["React","jsx","jsxs","cn","SelectPrimitive","ChevronDownIcon","FLOATING_CONTENT_COLLISION_PADDING","IconDefaultsContext","NO_ICON_DEFAULTS","MenuRowIcon","CheckIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,gBAAgBA,iBAAM,cAAkC;AAAA,EAC5D,MAAM;AAAA,EACN,OAAO;AACT,CAAC;AAED,MAAM,iBAA6C;AAAA,EACjD,MAAM;AAAA,E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A;AAAA,MACjG;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AAED,WAAW,cAAc;AAQlB,MAAM,cAAcN,2BAAgB;AAC3C,YAAY,cAAc;AAQnB,MAAM,cAAcJ,iBAAM,WAG/B,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1BC,2BAAAA;AAAAA,EAACG,2BAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAWD,GAAAA;AAAAA,MACT;AAAA,MACA;AAAA,IAAA;AAAA,IAED,GAAG;AAAA,EAAA;AACN,CACD;AAED,YAAY,cAAc;AAMnB,MAAM,kBAAkBH,iBAAM,WAGnC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1BC,2BAAAA;AAAAA,EAACG,2BAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAWD,GAAAA,GAAG,mCAAmC,SAAS;AAAA,IACzD,GAAG;AAAA,EAAA;AACN,CACD;AAED,gBAAgB,cAAc;;;;;;;"}
1
+ {"version":3,"file":"Select.cjs","sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["import * as SelectPrimitive from \"@radix-ui/react-select\";\nimport * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { FLOATING_CONTENT_COLLISION_PADDING } from \"@/utils/floatingContentCollisionPadding\";\nimport {\n FLOATING_CONTENT_SURFACE_CLASS,\n FLOATING_CONTENT_Z_INDEX,\n} from \"@/utils/floatingContentSurface\";\nimport { CheckIcon } from \"../Icons/CheckIcon\";\nimport { ChevronDownIcon } from \"../Icons/ChevronDownIcon\";\nimport { IconDefaultsContext, NO_ICON_DEFAULTS } from \"../Icons/IconDefaults\";\nimport { MenuRowIcon } from \"../Icons/MenuRowIcon\";\n\n/** Select field height in pixels. */\nexport type SelectSize = \"48\" | \"40\" | \"32\";\n\n/**\n * Trigger surface. `\"default\"` is the bordered input field; `\"filled\"` is the\n * V2 Table Tab Actions pill: a `background-secondary` fill with no border and a\n * centred `content-tertiary` label, for filters that sit beside a table or chart.\n */\nexport type SelectVariant = \"default\" | \"filled\";\n\ntype SelectContextValue = {\n size: SelectSize;\n error: boolean;\n disabled?: boolean;\n};\n\nconst SelectContext = React.createContext<SelectContextValue>({\n size: \"48\",\n error: false,\n});\n\nconst TRIGGER_HEIGHT: Record<SelectSize, string> = {\n \"48\": \"h-12\",\n \"40\": \"h-10\",\n \"32\": \"h-8\",\n};\n\nconst TRIGGER_PADDING_X: Record<SelectSize, string> = {\n \"48\": \"px-4\",\n \"40\": \"px-4\",\n \"32\": \"px-3\",\n};\n\nconst TRIGGER_GAP: Record<SelectSize, string> = {\n \"48\": \"gap-3\",\n \"40\": \"gap-3\",\n \"32\": \"gap-2\",\n};\n\nconst TRIGGER_TYPOGRAPHY: Record<SelectSize, string> = {\n \"48\": \"typography-body-default-16px-regular\",\n \"40\": \"typography-body-default-16px-regular\",\n \"32\": \"typography-body-small-14px-regular\",\n};\n\nexport interface SelectProps extends Omit<SelectPrimitive.SelectProps, \"dir\"> {\n /** Label text displayed above the trigger. Also used as the accessible name. */\n label?: string;\n /** Accessible name applied directly to the trigger button when no visible `label` is provided. */\n \"aria-label\"?: string;\n /** ID of an external element that labels the trigger button. */\n \"aria-labelledby\"?: string;\n /** Helper text displayed below the trigger. Replaced by `errorMessage` when `error` is `true`. */\n helperText?: string;\n /** Height of the select field in pixels. @default \"48\" */\n size?: SelectSize;\n /** Trigger surface. See {@link SelectVariant}. @default \"default\" */\n variant?: SelectVariant;\n /** Whether the field is in an error state. @default false */\n error?: boolean;\n /** Error message displayed below the trigger. Shown instead of `helperText` when `error` is `true`. */\n errorMessage?: string;\n /** Placeholder shown when no value is selected. */\n placeholder?: string;\n /** Icon element displayed at the left side of the trigger. */\n leftIcon?: React.ReactNode;\n /** Whether the field stretches to fill its container width. @default false */\n fullWidth?: boolean;\n /** Wraps the `className` of the outermost container div. */\n className?: string;\n /** HTML `id` applied to the trigger button. Auto-generated if omitted. */\n id?: string;\n}\n\n/**\n * A select field with optional label, helper/error text, and an icon slot,\n * built on Radix UI Select for full accessibility and keyboard navigation.\n *\n * Pair with {@link SelectContent} and {@link SelectItem} to provide options.\n *\n * @example\n * ```tsx\n * <Select label=\"Country\" placeholder=\"Select a country\">\n * <SelectContent>\n * <SelectItem value=\"us\">United States</SelectItem>\n * <SelectItem value=\"uk\">United Kingdom</SelectItem>\n * </SelectContent>\n * </Select>\n * ```\n */\nexport const Select = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n SelectProps\n>(\n (\n {\n label,\n helperText,\n size = \"48\",\n variant = \"default\",\n error = false,\n errorMessage,\n placeholder,\n leftIcon,\n fullWidth = false,\n className,\n id,\n disabled,\n children,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const triggerId = id ?? generatedId;\n const helperTextId = `${triggerId}-helper`;\n const bottomText = error && errorMessage ? errorMessage : helperText;\n const isFilled = variant === \"filled\";\n\n return (\n <SelectContext.Provider value={{ size, error, disabled }}>\n <div\n className={cn(\"flex flex-col\", fullWidth && \"w-full\", className)}\n data-disabled={disabled ? \"\" : undefined}\n data-error={error ? \"\" : undefined}\n >\n {label && (\n <label\n htmlFor={triggerId}\n className=\"typography-description-12px-semibold pb-2 text-content-primary\"\n >\n {label}\n </label>\n )}\n\n <SelectPrimitive.Root disabled={disabled} {...props}>\n <SelectPrimitive.Trigger\n ref={ref}\n id={triggerId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={bottomText ? helperTextId : undefined}\n aria-invalid={error || undefined}\n className={cn(\n \"flex w-full cursor-pointer items-center rounded-sm border outline-none focus-visible:shadow-focus-ring motion-safe:transition-colors\",\n TRIGGER_HEIGHT[size],\n isFilled ? \"px-2\" : TRIGGER_PADDING_X[size],\n TRIGGER_GAP[size],\n TRIGGER_TYPOGRAPHY[size],\n isFilled\n ? \"justify-center bg-background-secondary text-content-tertiary\"\n : \"justify-between bg-inputs-inputs-primary\",\n error\n ? \"border-error-content\"\n : isFilled\n ? \"border-transparent\"\n : \"border-border-input\",\n !disabled &&\n !error &&\n (isFilled\n ? \"hover:bg-neutral-alphas-100 data-[state=open]:bg-neutral-alphas-100\"\n : [\n \"hover:border-border-input-hover data-[state=open]:border-border-input-hover\",\n \"theme-v2:focus-visible:border-border-selected theme-v2:focus-visible:shadow-none theme-v2:data-[state=open]:border-border-selected\",\n ]),\n disabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n {leftIcon && (\n <span\n className=\"flex size-5 shrink-0 items-center justify-center text-content-secondary\"\n data-testid=\"left-icon\"\n >\n {leftIcon}\n </span>\n )}\n <span\n className={cn(\n \"min-w-0 flex-1 truncate [&>[data-placeholder]]:text-content-tertiary\",\n isFilled\n ? \"text-center text-content-tertiary\"\n : \"text-left text-content-primary\",\n )}\n >\n <SelectPrimitive.Value placeholder={placeholder} />\n </span>\n </div>\n\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon size={isFilled ? 16 : 24} className=\"shrink-0\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n\n {children}\n </SelectPrimitive.Root>\n\n {bottomText && (\n <p\n id={helperTextId}\n className={cn(\n \"typography-description-12px-regular px-2 pt-1 pb-0.5\",\n error ? \"text-error-content\" : \"text-content-secondary\",\n )}\n >\n {bottomText}\n </p>\n )}\n </div>\n </SelectContext.Provider>\n );\n },\n);\n\nSelect.displayName = \"Select\";\n\nexport interface SelectContentProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> {}\n\n/**\n * The list's scroll area. It marks itself `data-interacted` once the person moves the\n * pointer or presses a key in it, which lets the selected row's v2 hover fill wait for\n * real input (see {@link CHECKED_V2_CLASSES}). Radix mounts it afresh on every open, so\n * each open starts unmarked.\n */\nfunction SelectViewport({ children }: { children: React.ReactNode }) {\n const [interacted, setInteracted] = React.useState(false);\n const markInteracted = () => {\n if (!interacted) setInteracted(true);\n };\n return (\n <SelectPrimitive.Viewport\n data-interacted={interacted ? \"\" : undefined}\n onPointerMove={markInteracted}\n onKeyDown={markInteracted}\n className=\"group/select flex max-h-[var(--radix-select-content-available-height)] flex-col gap-0.5 overflow-y-auto p-2\"\n >\n {children}\n </SelectPrimitive.Viewport>\n );\n}\n\n/**\n * The dropdown panel rendered inside a portal. Place {@link SelectItem} elements\n * (and optionally {@link SelectGroup} / {@link SelectLabel}) as children.\n */\nexport const SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = \"popper\",\n sideOffset = 4,\n collisionPadding = FLOATING_CONTENT_COLLISION_PADDING,\n style,\n ...props\n },\n ref,\n ) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n style={{ zIndex: FLOATING_CONTENT_Z_INDEX, ...style }}\n className={cn(\n FLOATING_CONTENT_SURFACE_CLASS,\n \"relative w-max min-w-(--radix-select-trigger-width) max-w-(--radix-select-content-available-width) overflow-hidden\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n \"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n >\n <SelectViewport>\n {/* A select opened from inside a menu row must not inherit that row's icon defaults. */}\n <IconDefaultsContext.Provider value={NO_ICON_DEFAULTS}>\n {children}\n </IconDefaultsContext.Provider>\n </SelectViewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n ),\n);\n\nSelectContent.displayName = \"SelectContent\";\n\n/** Dropdown row height in pixels, matching the V2 Menu Item spec. */\nexport type SelectItemSize = \"40\" | \"32\";\n\nconst ITEM_SIZE_CLASSES: Record<SelectItemSize, 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\nconst ITEM_DESCRIPTION_TYPOGRAPHY: Record<SelectItemSize, string> = {\n \"40\": \"typography-body-small-14px-regular\",\n \"32\": \"typography-description-12px-regular\",\n};\n\nexport interface SelectItemProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {\n /** Row height. Defaults to the parent {@link Select} size (`48`/`40` → `40`, `32` → `32`). */\n size?: SelectItemSize;\n /**\n * Icon (or other node) rendered before the label. Ignored when {@link SelectItemProps.avatar} is set.\n * Treated like `DropdownMenuItem`'s icons: a 16px box in `Icons/Secondary`, prop-based icons filled at 16px\n * unless they set `filled` or `size` themselves.\n */\n leadingIcon?: React.ReactNode;\n /**\n * Leading avatar rendered in place of {@link SelectItemProps.leadingIcon}, for rows\n * representing a person or account. Pass an `Avatar` sized to `24`. Takes precedence over `leadingIcon`.\n */\n avatar?: React.ReactNode;\n /** Optional secondary text rendered on a second line below the label. */\n description?: React.ReactNode;\n}\n\n/**\n * Whether a `ReactNode` will actually render. Excludes `null`/`undefined` and\n * booleans so short-circuit props (e.g. `description={cond && \"…\"}`) don't flip\n * the item into a two-line/avatar layout when they resolve to `false`.\n */\nfunction isRenderableNode(node: React.ReactNode): boolean {\n return node !== null && node !== undefined && typeof node !== \"boolean\";\n}\n\n/**\n * Under the v2 palette a selected option's `Menu Item Selected` fill is inverted, so its\n * content inverts too. Radix focuses and highlights the selected option as the list opens,\n * so keyboard users start from it. Until the person moves the pointer or presses a key in\n * the list, the selected row keeps its own fill; after that a highlighted one moves to\n * `Menu Item Selected Hover` (see {@link SelectViewport}).\n */\nconst CHECKED_V2_CLASSES =\n \"theme-v2:data-[state=checked]:text-content-primary-inverted theme-v2:data-[state=checked]:focus:bg-menu-item-selected theme-v2:data-[state=checked]:data-highlighted:bg-menu-item-selected theme-v2:group-data-[interacted]/select:data-[state=checked]:data-highlighted:bg-menu-item-selected-hover\";\n\n/**\n * A selected option's description under the v2 palette: inverted, and\n * `Menu Item Selected Hover Secondary` while the row shows its hover fill.\n */\nconst CHECKED_DESCRIPTION_V2_CLASSES =\n \"theme-v2:group-data-[state=checked]:text-content-secondary-inverted theme-v2:group-data-[interacted]/select:group-data-[state=checked]:group-data-highlighted:text-menu-item-selected-hover-secondary\";\n\n/** A disabled selected option takes the library's Disabled state under the v2 palette, which has no fill. */\nconst CHECKED_DISABLED_V2_CLASSES = \"theme-v2:data-[state=checked]:bg-transparent\";\n\n/**\n * An individual option inside {@link SelectContent}, following the V2 Menu Item spec.\n *\n * Supports a leading icon or avatar, an optional two-line layout via `description`,\n * and the standard hover / selected / disabled states. The selected row rests on\n * `Buttons/Navigation/Hover` with a semibold label and a trailing check; hovering\n * it shows `Interaction/Hover` like any other row. Under the v2 palette the fill is\n * inverted, with inverted content, and a highlighted selected row moves to `Menu Item\n * Selected Hover`. Under the v2 palette the list opens with the selected row on its own\n * fill: the hover fill waits until the person moves the pointer or presses a key. Rows do not shrink, so a\n * two-line row stays whole when the list scrolls.\n *\n * @example\n * ```tsx\n * <SelectItem value=\"jane\" avatar={<Avatar size={24} fallback=\"JD\" />} description=\"Product designer\">\n * Jane Doe\n * </SelectItem>\n * ```\n */\nexport const SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n SelectItemProps\n>(({ className, children, size, leadingIcon, avatar, description, disabled, ...props }, ref) => {\n const { size: triggerSize } = React.useContext(SelectContext);\n const itemSize: SelectItemSize = size ?? (triggerSize === \"32\" ? \"32\" : \"40\");\n const hasDescription = isRenderableNode(description);\n const hasAvatar = isRenderableNode(avatar);\n const hasLeadingIcon = isRenderableNode(leadingIcon);\n\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"group relative flex w-full shrink-0 cursor-pointer select-none gap-2 rounded-sm px-3 text-content-primary outline-none\",\n hasDescription ? \"items-start\" : \"items-center\",\n ITEM_SIZE_CLASSES[itemSize],\n hasAvatar && !hasDescription && itemSize === \"32\" && \"py-1\",\n \"data-[state=checked]:bg-menu-item-selected\",\n \"focus:bg-interaction-hover data-highlighted:bg-interaction-hover\",\n \"data-[state=checked]:focus:bg-interaction-hover data-[state=checked]:data-highlighted:bg-interaction-hover\",\n disabled ? CHECKED_DISABLED_V2_CLASSES : CHECKED_V2_CLASSES,\n \"data-disabled:pointer-events-none data-disabled:text-content-disabled\",\n className,\n )}\n disabled={disabled}\n {...props}\n >\n {hasAvatar ? (\n <span className={cn(\"shrink-0\", disabled && \"theme-v2:opacity-60\")}>{avatar}</span>\n ) : (\n hasLeadingIcon && (\n // In the two-line row the icon centres on the 18px title line, as in DropdownMenuItem.\n <MenuRowIcon alignToTitle={hasDescription} invertWhenSelected={!disabled}>\n {leadingIcon}\n </MenuRowIcon>\n )\n )}\n\n {hasDescription ? (\n <span className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n {/* A 14px semibold title over the regular description, matching DropdownMenuItem's two-line row. */}\n <span className=\"typography-body-small-14px-semibold truncate\">\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </span>\n <span\n className={cn(\n \"truncate text-content-secondary group-data-[disabled]:text-content-disabled\",\n !disabled && CHECKED_DESCRIPTION_V2_CLASSES,\n ITEM_DESCRIPTION_TYPOGRAPHY[itemSize],\n )}\n >\n {description}\n </span>\n </span>\n ) : (\n <span className=\"min-w-0 flex-1 truncate group-data-[state=checked]:font-semibold\">\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </span>\n )}\n\n <SelectPrimitive.ItemIndicator\n className={cn(\n \"ml-auto flex w-4 shrink-0 items-center justify-center\",\n hasDescription ? \"h-4.5 self-start\" : \"h-4\",\n )}\n >\n <CheckIcon\n className={cn(\n \"size-4 text-content-primary group-data-[disabled]:text-content-disabled\",\n !disabled && \"theme-v2:text-icons-primary-inverted\",\n )}\n />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n );\n});\n\nSelectItem.displayName = \"SelectItem\";\n\n/** Props for {@link SelectGroup}. */\nexport type SelectGroupProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;\n\n/**\n * Groups related {@link SelectItem} elements under a {@link SelectLabel}.\n */\nexport const SelectGroup = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Group>,\n SelectGroupProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Group ref={ref} className={cn(\"flex flex-col gap-0.5\", className)} {...props} />\n));\nSelectGroup.displayName = \"SelectGroup\";\n\nexport interface SelectLabelProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label> {}\n\n/**\n * A non-interactive label shown above a {@link SelectGroup}.\n */\nexport const SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n SelectLabelProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\n \"typography-description-12px-semibold px-3 py-1.5 text-content-secondary\",\n className,\n )}\n {...props}\n />\n));\n\nSelectLabel.displayName = \"SelectLabel\";\n\nexport interface SelectSeparatorProps\n extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator> {}\n\n/** A horizontal rule that visually separates groups in {@link SelectContent}. */\nexport const SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"my-1 h-px bg-neutral-alphas-200\", className)}\n {...props}\n />\n));\n\nSelectSeparator.displayName = \"SelectSeparator\";\n"],"names":["React","jsx","jsxs","cn","SelectPrimitive","ChevronDownIcon","FLOATING_CONTENT_COLLISION_PADDING","FLOATING_CONTENT_Z_INDEX","FLOATING_CONTENT_SURFACE_CLASS","IconDefaultsContext","NO_ICON_DEFAULTS","MenuRowIcon","CheckIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,gBAAgBA,iBAAM,cAAkC;AAAA,EAC5D,MAAM;AAA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AAY,cAAc;AAMnB,MAAM,kBAAkBH,iBAAM,WAGnC,CAAC,EAAE,WAAW,GAAG,MAAA,GAAS,QAC1BC,2BAAAA;AAAAA,EAACG,2BAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAWD,GAAAA,GAAG,mCAAmC,SAAS;AAAA,IACzD,GAAG;AAAA,EAAA;AACN,CACD;AAED,gBAAgB,cAAc;;;;;;;"}
@@ -52,11 +52,12 @@ function SliderThumb({
52
52
  },
53
53
  onKeyDown: (e) => {
54
54
  if (showTooltip) {
55
- requestAnimationFrame(() => syncTooltipText(e.currentTarget, formatTooltip));
55
+ const thumb = e.currentTarget;
56
+ requestAnimationFrame(() => syncTooltipText(thumb, formatTooltip));
56
57
  }
57
58
  },
58
59
  className: cn.cn(
59
- "flex size-6 items-center justify-center rounded-full border border-border-primary bg-background-primary shadow-sm",
60
+ "flex size-6 items-center justify-center rounded-full border border-border-primary bg-background-primary shadow-sm theme-v2:bg-surface-primary",
60
61
  "transition-shadow duration-150",
61
62
  "hover:ring-2 hover:ring-brand-primary-default",
62
63
  "not-data-disabled:active:ring-2 not-data-disabled:active:ring-brand-primary-default",
@@ -1 +1 @@
1
- {"version":3,"file":"SliderThumb.cjs","sources":["../../../../src/components/Slider/SliderThumb.tsx"],"sourcesContent":["import * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\ninterface SliderThumbProps {\n showTooltip: boolean;\n formatTooltip?: (value: number) => string;\n index: number;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n}\n\nexport function SliderThumb({\n showTooltip,\n formatTooltip,\n index,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n}: SliderThumbProps) {\n const thumbRef = React.useCallback(\n (el: HTMLSpanElement | null) => {\n if (!el || !showTooltip) return;\n syncTooltipText(el, formatTooltip);\n },\n [showTooltip, formatTooltip],\n );\n\n return (\n <SliderPrimitive.Thumb\n ref={thumbRef}\n data-index={index}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n onPointerDown={(e) => {\n if (showTooltip) syncTooltipText(e.currentTarget, formatTooltip);\n }}\n onPointerMove={(e) => {\n if (showTooltip) syncTooltipText(e.currentTarget, formatTooltip);\n }}\n onKeyDown={(e) => {\n if (showTooltip) {\n requestAnimationFrame(() => syncTooltipText(e.currentTarget, formatTooltip));\n }\n }}\n className={cn(\n \"flex size-6 items-center justify-center rounded-full border border-border-primary bg-background-primary shadow-sm\",\n \"transition-shadow duration-150\",\n \"hover:ring-2 hover:ring-brand-primary-default\",\n \"not-data-disabled:active:ring-2 not-data-disabled:active:ring-brand-primary-default\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n \"data-disabled:cursor-not-allowed\",\n )}\n >\n <span className=\"block size-3 rounded-full bg-brand-primary-default shadow-[inset_0px_1px_2px_0px_rgba(0,0,0,0.1)]\" />\n\n {showTooltip && (\n <span\n role=\"tooltip\"\n data-slider-tooltip\n className=\"typography-description-12px-semibold pointer-events-none absolute bottom-full mb-2 rounded-lg bg-surface-primary-inverted px-2 py-1 text-content-primary-inverted shadow-sm\"\n />\n )}\n </SliderPrimitive.Thumb>\n );\n}\n\nfunction syncTooltipText(thumb: HTMLElement, formatTooltip?: (value: number) => string) {\n const raw = thumb.getAttribute(\"aria-valuenow\");\n const tooltip = thumb.querySelector<HTMLSpanElement>(\"[data-slider-tooltip]\");\n if (raw == null || !tooltip) return;\n const num = Number(raw);\n tooltip.textContent = formatTooltip ? formatTooltip(num) : String(num);\n}\n"],"names":["React","jsxs","SliderPrimitive","cn","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAYO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,mBAAmB;AACrB,GAAqB;AACnB,QAAM,WAAWA,iBAAM;AAAA,IACrB,CAAC,OAA+B;AAC9B,UAAI,CAAC,MAAM,CAAC,YAAa;AACzB,sBAAgB,IAAI,aAAa;AAAA,IACnC;AAAA,IACA,CAAC,aAAa,aAAa;AAAA,EAAA;AAG7B,SACEC,2BAAAA;AAAAA,IAACC,2BAAgB;AAAA,IAAhB;AAAA,MACC,KAAK;AAAA,MACL,cAAY;AAAA,MACZ,cAAY;AAAA,MACZ,mBAAiB;AAAA,MACjB,eAAe,CAAC,MAAM;AACpB,YAAI,YAAa,iBAAgB,EAAE,eAAe,aAAa;AAAA,MACjE;AAAA,MACA,eAAe,CAAC,MAAM;AACpB,YAAI,YAAa,iBAAgB,EAAE,eAAe,aAAa;AAAA,MACjE;AAAA,MACA,WAAW,CAAC,MAAM;AAChB,YAAI,aAAa;AACf,gCAAsB,MAAM,gBAAgB,EAAE,eAAe,aAAa,CAAC;AAAA,QAC7E;AAAA,MACF;AAAA,MACA,WAAWC,GAAAA;AAAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAAC,2BAAAA,IAAC,QAAA,EAAK,WAAU,oGAAA,CAAoG;AAAA,QAEnH,eACCA,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,uBAAmB;AAAA,YACnB,WAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA;AAAA,EAAA;AAIR;AAEA,SAAS,gBAAgB,OAAoB,eAA2C;AACtF,QAAM,MAAM,MAAM,aAAa,eAAe;AAC9C,QAAM,UAAU,MAAM,cAA+B,uBAAuB;AAC5E,MAAI,OAAO,QAAQ,CAAC,QAAS;AAC7B,QAAM,MAAM,OAAO,GAAG;AACtB,UAAQ,cAAc,gBAAgB,cAAc,GAAG,IAAI,OAAO,GAAG;AACvE;;"}
1
+ {"version":3,"file":"SliderThumb.cjs","sources":["../../../../src/components/Slider/SliderThumb.tsx"],"sourcesContent":["import * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\ninterface SliderThumbProps {\n showTooltip: boolean;\n formatTooltip?: (value: number) => string;\n index: number;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n}\n\nexport function SliderThumb({\n showTooltip,\n formatTooltip,\n index,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n}: SliderThumbProps) {\n const thumbRef = React.useCallback(\n (el: HTMLSpanElement | null) => {\n if (!el || !showTooltip) return;\n syncTooltipText(el, formatTooltip);\n },\n [showTooltip, formatTooltip],\n );\n\n return (\n <SliderPrimitive.Thumb\n ref={thumbRef}\n data-index={index}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n onPointerDown={(e) => {\n if (showTooltip) syncTooltipText(e.currentTarget, formatTooltip);\n }}\n onPointerMove={(e) => {\n if (showTooltip) syncTooltipText(e.currentTarget, formatTooltip);\n }}\n onKeyDown={(e) => {\n if (showTooltip) {\n const thumb = e.currentTarget;\n requestAnimationFrame(() => syncTooltipText(thumb, formatTooltip));\n }\n }}\n className={cn(\n \"flex size-6 items-center justify-center rounded-full border border-border-primary bg-background-primary shadow-sm theme-v2:bg-surface-primary\",\n \"transition-shadow duration-150\",\n \"hover:ring-2 hover:ring-brand-primary-default\",\n \"not-data-disabled:active:ring-2 not-data-disabled:active:ring-brand-primary-default\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n \"data-disabled:cursor-not-allowed\",\n )}\n >\n <span className=\"block size-3 rounded-full bg-brand-primary-default shadow-[inset_0px_1px_2px_0px_rgba(0,0,0,0.1)]\" />\n\n {showTooltip && (\n <span\n role=\"tooltip\"\n data-slider-tooltip\n className=\"typography-description-12px-semibold pointer-events-none absolute bottom-full mb-2 rounded-lg bg-surface-primary-inverted px-2 py-1 text-content-primary-inverted shadow-sm\"\n />\n )}\n </SliderPrimitive.Thumb>\n );\n}\n\nfunction syncTooltipText(thumb: HTMLElement, formatTooltip?: (value: number) => string) {\n const raw = thumb.getAttribute(\"aria-valuenow\");\n const tooltip = thumb.querySelector<HTMLSpanElement>(\"[data-slider-tooltip]\");\n if (raw == null || !tooltip) return;\n const num = Number(raw);\n tooltip.textContent = formatTooltip ? formatTooltip(num) : String(num);\n}\n"],"names":["React","jsxs","SliderPrimitive","cn","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAYO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,mBAAmB;AACrB,GAAqB;AACnB,QAAM,WAAWA,iBAAM;AAAA,IACrB,CAAC,OAA+B;AAC9B,UAAI,CAAC,MAAM,CAAC,YAAa;AACzB,sBAAgB,IAAI,aAAa;AAAA,IACnC;AAAA,IACA,CAAC,aAAa,aAAa;AAAA,EAAA;AAG7B,SACEC,2BAAAA;AAAAA,IAACC,2BAAgB;AAAA,IAAhB;AAAA,MACC,KAAK;AAAA,MACL,cAAY;AAAA,MACZ,cAAY;AAAA,MACZ,mBAAiB;AAAA,MACjB,eAAe,CAAC,MAAM;AACpB,YAAI,YAAa,iBAAgB,EAAE,eAAe,aAAa;AAAA,MACjE;AAAA,MACA,eAAe,CAAC,MAAM;AACpB,YAAI,YAAa,iBAAgB,EAAE,eAAe,aAAa;AAAA,MACjE;AAAA,MACA,WAAW,CAAC,MAAM;AAChB,YAAI,aAAa;AACf,gBAAM,QAAQ,EAAE;AAChB,gCAAsB,MAAM,gBAAgB,OAAO,aAAa,CAAC;AAAA,QACnE;AAAA,MACF;AAAA,MACA,WAAWC,GAAAA;AAAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAGF,UAAA;AAAA,QAAAC,2BAAAA,IAAC,QAAA,EAAK,WAAU,oGAAA,CAAoG;AAAA,QAEnH,eACCA,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,uBAAmB;AAAA,YACnB,WAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACZ;AAAA,IAAA;AAAA,EAAA;AAIR;AAEA,SAAS,gBAAgB,OAAoB,eAA2C;AACtF,QAAM,MAAM,MAAM,aAAa,eAAe;AAC9C,QAAM,UAAU,MAAM,cAA+B,uBAAuB;AAC5E,MAAI,OAAO,QAAQ,CAAC,QAAS;AAC7B,QAAM,MAAM,OAAO,GAAG;AACtB,UAAQ,cAAc,gBAAgB,cAAc,GAAG,IAAI,OAAO,GAAG;AACvE;;"}
@@ -159,7 +159,7 @@ const Snackbar = React__namespace.forwardRef(
159
159
  (variant === "default" || variant === "vipEarn") && "border border-neutral-alphas-50 bg-surface-primary p-4 backdrop-blur-md",
160
160
  variant === "default" && "flex-wrap items-start",
161
161
  variant === "vipEarn" && "items-start",
162
- variant === "welcome" && "relative flex-col items-center bg-background-primary py-6",
162
+ variant === "welcome" && "relative flex-col items-center bg-background-primary py-6 theme-v2:bg-surface-primary",
163
163
  className
164
164
  ),
165
165
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"Snackbar.cjs","sources":["../../../../src/components/Snackbar/Snackbar.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button } from \"../Button/Button\";\nimport { IconButton } from \"../IconButton/IconButton\";\nimport { CrossIcon } from \"../Icons/CrossIcon\";\n\n/** Layout variant of the snackbar. */\nexport type SnackbarVariant = \"default\" | \"vipEarn\" | \"welcome\";\n\nexport interface SnackbarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Layout variant of the snackbar. @default \"default\" */\n variant?: SnackbarVariant;\n /** Icon element displayed at the leading edge (used by the `vipEarn` variant). */\n icon?: React.ReactNode;\n /** Title content. */\n title?: React.ReactNode;\n /** Descriptive body text. */\n description?: React.ReactNode;\n /** Whether to show primary/secondary action buttons. @default true */\n showActions?: boolean;\n /** Primary CTA label — renders a default {@link Button}. */\n primaryLabel?: string;\n /** Click handler for the primary CTA (used together with `primaryLabel`). */\n primaryOnClick?: () => void;\n /** Custom element rendered as the primary CTA. Overrides `primaryLabel` / `primaryOnClick`. */\n primarySlot?: React.ReactNode;\n /** Secondary CTA label — renders a default {@link Button}. */\n secondaryLabel?: string;\n /** Click handler for the secondary CTA (used together with `secondaryLabel`). */\n secondaryOnClick?: () => void;\n /** Custom element rendered as the secondary CTA. Overrides `secondaryLabel` / `secondaryOnClick`. */\n secondarySlot?: React.ReactNode;\n /** Whether to show the close button. @default false */\n closable?: boolean;\n /** Callback fired when the close button is clicked. */\n onClose?: () => void;\n /** Accessible label for the close button. @default \"Close snackbar\" */\n closeLabel?: string;\n}\n\nfunction CloseButton({\n onClose,\n className,\n closeLabel = \"Close snackbar\",\n}: {\n onClose?: () => void;\n className?: string;\n closeLabel?: string;\n}) {\n return (\n <IconButton\n variant=\"tertiary\"\n size=\"24\"\n onClick={onClose}\n icon={<CrossIcon />}\n className={cn(\"shrink-0\", className)}\n aria-label={closeLabel}\n />\n );\n}\n\n/**\n * Resolves a CTA slot. If a custom slot is provided it takes precedence,\n * otherwise a default Button is rendered from label + onClick.\n */\nfunction resolveCtaSlot(\n slot: React.ReactNode | undefined,\n label: string | undefined,\n onClick: (() => void) | undefined,\n buttonProps: React.ComponentProps<typeof Button>,\n): React.ReactNode | null {\n if (slot) return slot;\n if (label) {\n return (\n <Button onClick={onClick} {...buttonProps}>\n {label}\n </Button>\n );\n }\n return null;\n}\n\nfunction VipEarnContent({\n icon,\n title,\n description,\n showActions,\n primarySlot,\n primaryLabel,\n primaryOnClick,\n}: Pick<\n SnackbarProps,\n | \"icon\"\n | \"title\"\n | \"description\"\n | \"showActions\"\n | \"primarySlot\"\n | \"primaryLabel\"\n | \"primaryOnClick\"\n>) {\n const primary = resolveCtaSlot(primarySlot, primaryLabel, primaryOnClick, {\n variant: \"text\",\n size: \"24\",\n });\n\n return (\n <>\n {icon && (\n <span className=\"flex shrink-0\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n <div className=\"flex min-w-0 flex-1 flex-col gap-4\">\n <div className=\"flex flex-col\">\n {title && (\n <p className=\"typography-body-default-16px-semibold text-content-primary leading-6\">\n {title}\n </p>\n )}\n {description && (\n <p className=\"typography-body-small-14px-regular text-content-secondary\">\n {description}\n </p>\n )}\n </div>\n {showActions && primary && <div className=\"self-start\">{primary}</div>}\n </div>\n </>\n );\n}\n\nfunction WelcomeContent({\n title,\n description,\n showActions,\n primarySlot,\n primaryLabel,\n primaryOnClick,\n secondarySlot,\n secondaryLabel,\n secondaryOnClick,\n}: Pick<\n SnackbarProps,\n | \"title\"\n | \"description\"\n | \"showActions\"\n | \"primarySlot\"\n | \"primaryLabel\"\n | \"primaryOnClick\"\n | \"secondarySlot\"\n | \"secondaryLabel\"\n | \"secondaryOnClick\"\n>) {\n const primary = resolveCtaSlot(primarySlot, primaryLabel, primaryOnClick, {\n variant: \"primary\",\n });\n const secondary = resolveCtaSlot(secondarySlot, secondaryLabel, secondaryOnClick, {\n variant: \"secondary\",\n });\n\n return (\n <>\n <div className=\"flex flex-col items-center gap-2 px-8 text-center text-content-primary\">\n {title && <p className=\"typography-header-heading-xs text-content-primary\">{title}</p>}\n {description && (\n <p className=\"typography-body-small-14px-regular text-content-secondary\">{description}</p>\n )}\n </div>\n {showActions && (primary || secondary) && (\n <div className=\"flex w-full flex-col gap-4 px-8 sm:flex-row sm:*:flex-1\">\n {secondary}\n {primary}\n </div>\n )}\n </>\n );\n}\n\nfunction DefaultContent({\n children,\n showActions,\n primarySlot,\n primaryLabel,\n primaryOnClick,\n secondarySlot,\n secondaryLabel,\n secondaryOnClick,\n}: Pick<\n SnackbarProps,\n | \"children\"\n | \"showActions\"\n | \"primarySlot\"\n | \"primaryLabel\"\n | \"primaryOnClick\"\n | \"secondarySlot\"\n | \"secondaryLabel\"\n | \"secondaryOnClick\"\n>) {\n const primary = resolveCtaSlot(primarySlot, primaryLabel, primaryOnClick, {\n variant: \"primary\",\n size: \"40\",\n });\n const secondary = resolveCtaSlot(secondarySlot, secondaryLabel, secondaryOnClick, {\n variant: \"tertiary\",\n size: \"40\",\n });\n\n return (\n <>\n <div className=\"typography-body-default-16px-regular flex min-w-0 flex-1 items-center self-stretch text-content-primary\">\n {children}\n </div>\n {showActions && (primary || secondary) && (\n <div className=\"flex shrink-0 items-start gap-2\">\n {primary}\n {secondary}\n </div>\n )}\n </>\n );\n}\n\n/**\n * A prominent inline message with optional title, description, action buttons,\n * and close control. Supports three layout variants: `default`, `vipEarn`, and\n * `welcome`.\n *\n * @example\n * ```tsx\n * <Snackbar\n * variant=\"default\"\n * primaryLabel=\"Undo\"\n * primaryOnClick={undo}\n * closable\n * onClose={dismiss}\n * >\n * Item deleted\n * </Snackbar>\n * ```\n */\nexport const Snackbar = React.forwardRef<HTMLDivElement, SnackbarProps>(\n (\n {\n className,\n variant = \"default\",\n icon,\n title,\n description,\n showActions = true,\n primaryLabel,\n primaryOnClick,\n primarySlot,\n secondaryLabel,\n secondaryOnClick,\n secondarySlot,\n closable = false,\n onClose,\n closeLabel,\n children,\n ...props\n },\n ref,\n ) => {\n return (\n /* biome-ignore lint/a11y/useSemanticElements: output cannot contain div children; browsers would break the wrapper. */\n <div\n ref={ref}\n role=\"status\"\n data-testid=\"snackbar\"\n className={cn(\n \"flex gap-4 rounded-md\",\n (variant === \"default\" || variant === \"vipEarn\") &&\n \"border border-neutral-alphas-50 bg-surface-primary p-4 backdrop-blur-md\",\n variant === \"default\" && \"flex-wrap items-start\",\n variant === \"vipEarn\" && \"items-start\",\n variant === \"welcome\" && \"relative flex-col items-center bg-background-primary py-6\",\n className,\n )}\n {...props}\n >\n {variant === \"vipEarn\" && (\n <VipEarnContent\n icon={icon}\n title={title}\n description={description}\n showActions={showActions}\n primarySlot={primarySlot}\n primaryLabel={primaryLabel}\n primaryOnClick={primaryOnClick}\n />\n )}\n {variant === \"welcome\" && (\n <WelcomeContent\n title={title}\n description={description}\n showActions={showActions}\n primarySlot={primarySlot}\n primaryLabel={primaryLabel}\n primaryOnClick={primaryOnClick}\n secondarySlot={secondarySlot}\n secondaryLabel={secondaryLabel}\n secondaryOnClick={secondaryOnClick}\n />\n )}\n {variant === \"default\" && (\n <DefaultContent\n showActions={showActions}\n primarySlot={primarySlot}\n primaryLabel={primaryLabel}\n primaryOnClick={primaryOnClick}\n secondarySlot={secondarySlot}\n secondaryLabel={secondaryLabel}\n secondaryOnClick={secondaryOnClick}\n >\n {children}\n </DefaultContent>\n )}\n {closable && (\n <CloseButton\n onClose={onClose}\n closeLabel={closeLabel}\n className={variant === \"welcome\" ? \"absolute top-2 right-2\" : undefined}\n />\n )}\n </div>\n );\n },\n);\n\nSnackbar.displayName = \"Snackbar\";\n"],"names":["jsx","IconButton","CrossIcon","cn","Button","jsxs","Fragment","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA;AAAA,EACA,aAAa;AACf,GAIG;AACD,SACEA,2BAAAA;AAAAA,IAACC,WAAAA;AAAAA,IAAA;AAAA,MACC,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,SAAS;AAAA,MACT,qCAAOC,UAAAA,WAAA,EAAU;AAAA,MACjB,WAAWC,GAAAA,GAAG,YAAY,SAAS;AAAA,MACnC,cAAY;AAAA,IAAA;AAAA,EAAA;AAGlB;AAMA,SAAS,eACP,MACA,OACA,SACA,aACwB;AACxB,MAAI,KAAM,QAAO;AACjB,MAAI,OAAO;AACT,WACEH,2BAAAA,IAACI,OAAAA,QAAA,EAAO,SAAmB,GAAG,aAC3B,UAAA,OACH;AAAA,EAEJ;AACA,SAAO;AACT;AAEA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASG;AACD,QAAM,UAAU,eAAe,aAAa,cAAc,gBAAgB;AAAA,IACxE,SAAS;AAAA,IACT,MAAM;AAAA,EAAA,CACP;AAED,SACEC,2BAAAA,KAAAC,qBAAA,EACG,UAAA;AAAA,IAAA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AAAA,cAAA;AAAA,YAAA;AAAA,YAGH,YAAY,aACXA,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,YAAA;AAAA,YAGH,YAAY,aACXA,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBAEC;AAAA,cAAA;AAAA,YAAA;AAAA,YAGJ,YACCA,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC;AAAA,gBACA;AAAA,gBACA,WAAW,YAAY,YAAY,2BAA2B;AAAA,cAAA;AAAA,YAAA;AAAA,UAChE;AAAA,QAAA;AAAA,MAAA;AAAA;AAAA,EAIR;AACF;AAEA,SAAS,cAAc;;"}
1
+ {"version":3,"file":"Snackbar.cjs","sources":["../../../../src/components/Snackbar/Snackbar.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button } from \"../Button/Button\";\nimport { IconButton } from \"../IconButton/IconButton\";\nimport { CrossIcon } from \"../Icons/CrossIcon\";\n\n/** Layout variant of the snackbar. */\nexport type SnackbarVariant = \"default\" | \"vipEarn\" | \"welcome\";\n\nexport interface SnackbarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n /** Layout variant of the snackbar. @default \"default\" */\n variant?: SnackbarVariant;\n /** Icon element displayed at the leading edge (used by the `vipEarn` variant). */\n icon?: React.ReactNode;\n /** Title content. */\n title?: React.ReactNode;\n /** Descriptive body text. */\n description?: React.ReactNode;\n /** Whether to show primary/secondary action buttons. @default true */\n showActions?: boolean;\n /** Primary CTA label — renders a default {@link Button}. */\n primaryLabel?: string;\n /** Click handler for the primary CTA (used together with `primaryLabel`). */\n primaryOnClick?: () => void;\n /** Custom element rendered as the primary CTA. Overrides `primaryLabel` / `primaryOnClick`. */\n primarySlot?: React.ReactNode;\n /** Secondary CTA label — renders a default {@link Button}. */\n secondaryLabel?: string;\n /** Click handler for the secondary CTA (used together with `secondaryLabel`). */\n secondaryOnClick?: () => void;\n /** Custom element rendered as the secondary CTA. Overrides `secondaryLabel` / `secondaryOnClick`. */\n secondarySlot?: React.ReactNode;\n /** Whether to show the close button. @default false */\n closable?: boolean;\n /** Callback fired when the close button is clicked. */\n onClose?: () => void;\n /** Accessible label for the close button. @default \"Close snackbar\" */\n closeLabel?: string;\n}\n\nfunction CloseButton({\n onClose,\n className,\n closeLabel = \"Close snackbar\",\n}: {\n onClose?: () => void;\n className?: string;\n closeLabel?: string;\n}) {\n return (\n <IconButton\n variant=\"tertiary\"\n size=\"24\"\n onClick={onClose}\n icon={<CrossIcon />}\n className={cn(\"shrink-0\", className)}\n aria-label={closeLabel}\n />\n );\n}\n\n/**\n * Resolves a CTA slot. If a custom slot is provided it takes precedence,\n * otherwise a default Button is rendered from label + onClick.\n */\nfunction resolveCtaSlot(\n slot: React.ReactNode | undefined,\n label: string | undefined,\n onClick: (() => void) | undefined,\n buttonProps: React.ComponentProps<typeof Button>,\n): React.ReactNode | null {\n if (slot) return slot;\n if (label) {\n return (\n <Button onClick={onClick} {...buttonProps}>\n {label}\n </Button>\n );\n }\n return null;\n}\n\nfunction VipEarnContent({\n icon,\n title,\n description,\n showActions,\n primarySlot,\n primaryLabel,\n primaryOnClick,\n}: Pick<\n SnackbarProps,\n | \"icon\"\n | \"title\"\n | \"description\"\n | \"showActions\"\n | \"primarySlot\"\n | \"primaryLabel\"\n | \"primaryOnClick\"\n>) {\n const primary = resolveCtaSlot(primarySlot, primaryLabel, primaryOnClick, {\n variant: \"text\",\n size: \"24\",\n });\n\n return (\n <>\n {icon && (\n <span className=\"flex shrink-0\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n <div className=\"flex min-w-0 flex-1 flex-col gap-4\">\n <div className=\"flex flex-col\">\n {title && (\n <p className=\"typography-body-default-16px-semibold text-content-primary leading-6\">\n {title}\n </p>\n )}\n {description && (\n <p className=\"typography-body-small-14px-regular text-content-secondary\">\n {description}\n </p>\n )}\n </div>\n {showActions && primary && <div className=\"self-start\">{primary}</div>}\n </div>\n </>\n );\n}\n\nfunction WelcomeContent({\n title,\n description,\n showActions,\n primarySlot,\n primaryLabel,\n primaryOnClick,\n secondarySlot,\n secondaryLabel,\n secondaryOnClick,\n}: Pick<\n SnackbarProps,\n | \"title\"\n | \"description\"\n | \"showActions\"\n | \"primarySlot\"\n | \"primaryLabel\"\n | \"primaryOnClick\"\n | \"secondarySlot\"\n | \"secondaryLabel\"\n | \"secondaryOnClick\"\n>) {\n const primary = resolveCtaSlot(primarySlot, primaryLabel, primaryOnClick, {\n variant: \"primary\",\n });\n const secondary = resolveCtaSlot(secondarySlot, secondaryLabel, secondaryOnClick, {\n variant: \"secondary\",\n });\n\n return (\n <>\n <div className=\"flex flex-col items-center gap-2 px-8 text-center text-content-primary\">\n {title && <p className=\"typography-header-heading-xs text-content-primary\">{title}</p>}\n {description && (\n <p className=\"typography-body-small-14px-regular text-content-secondary\">{description}</p>\n )}\n </div>\n {showActions && (primary || secondary) && (\n <div className=\"flex w-full flex-col gap-4 px-8 sm:flex-row sm:*:flex-1\">\n {secondary}\n {primary}\n </div>\n )}\n </>\n );\n}\n\nfunction DefaultContent({\n children,\n showActions,\n primarySlot,\n primaryLabel,\n primaryOnClick,\n secondarySlot,\n secondaryLabel,\n secondaryOnClick,\n}: Pick<\n SnackbarProps,\n | \"children\"\n | \"showActions\"\n | \"primarySlot\"\n | \"primaryLabel\"\n | \"primaryOnClick\"\n | \"secondarySlot\"\n | \"secondaryLabel\"\n | \"secondaryOnClick\"\n>) {\n const primary = resolveCtaSlot(primarySlot, primaryLabel, primaryOnClick, {\n variant: \"primary\",\n size: \"40\",\n });\n const secondary = resolveCtaSlot(secondarySlot, secondaryLabel, secondaryOnClick, {\n variant: \"tertiary\",\n size: \"40\",\n });\n\n return (\n <>\n <div className=\"typography-body-default-16px-regular flex min-w-0 flex-1 items-center self-stretch text-content-primary\">\n {children}\n </div>\n {showActions && (primary || secondary) && (\n <div className=\"flex shrink-0 items-start gap-2\">\n {primary}\n {secondary}\n </div>\n )}\n </>\n );\n}\n\n/**\n * A prominent inline message with optional title, description, action buttons,\n * and close control. Supports three layout variants: `default`, `vipEarn`, and\n * `welcome`.\n *\n * @example\n * ```tsx\n * <Snackbar\n * variant=\"default\"\n * primaryLabel=\"Undo\"\n * primaryOnClick={undo}\n * closable\n * onClose={dismiss}\n * >\n * Item deleted\n * </Snackbar>\n * ```\n */\nexport const Snackbar = React.forwardRef<HTMLDivElement, SnackbarProps>(\n (\n {\n className,\n variant = \"default\",\n icon,\n title,\n description,\n showActions = true,\n primaryLabel,\n primaryOnClick,\n primarySlot,\n secondaryLabel,\n secondaryOnClick,\n secondarySlot,\n closable = false,\n onClose,\n closeLabel,\n children,\n ...props\n },\n ref,\n ) => {\n return (\n /* biome-ignore lint/a11y/useSemanticElements: output cannot contain div children; browsers would break the wrapper. */\n <div\n ref={ref}\n role=\"status\"\n data-testid=\"snackbar\"\n className={cn(\n \"flex gap-4 rounded-md\",\n (variant === \"default\" || variant === \"vipEarn\") &&\n \"border border-neutral-alphas-50 bg-surface-primary p-4 backdrop-blur-md\",\n variant === \"default\" && \"flex-wrap items-start\",\n variant === \"vipEarn\" && \"items-start\",\n variant === \"welcome\" &&\n \"relative flex-col items-center bg-background-primary py-6 theme-v2:bg-surface-primary\",\n className,\n )}\n {...props}\n >\n {variant === \"vipEarn\" && (\n <VipEarnContent\n icon={icon}\n title={title}\n description={description}\n showActions={showActions}\n primarySlot={primarySlot}\n primaryLabel={primaryLabel}\n primaryOnClick={primaryOnClick}\n />\n )}\n {variant === \"welcome\" && (\n <WelcomeContent\n title={title}\n description={description}\n showActions={showActions}\n primarySlot={primarySlot}\n primaryLabel={primaryLabel}\n primaryOnClick={primaryOnClick}\n secondarySlot={secondarySlot}\n secondaryLabel={secondaryLabel}\n secondaryOnClick={secondaryOnClick}\n />\n )}\n {variant === \"default\" && (\n <DefaultContent\n showActions={showActions}\n primarySlot={primarySlot}\n primaryLabel={primaryLabel}\n primaryOnClick={primaryOnClick}\n secondarySlot={secondarySlot}\n secondaryLabel={secondaryLabel}\n secondaryOnClick={secondaryOnClick}\n >\n {children}\n </DefaultContent>\n )}\n {closable && (\n <CloseButton\n onClose={onClose}\n closeLabel={closeLabel}\n className={variant === \"welcome\" ? \"absolute top-2 right-2\" : undefined}\n />\n )}\n </div>\n );\n },\n);\n\nSnackbar.displayName = \"Snackbar\";\n"],"names":["jsx","IconButton","CrossIcon","cn","Button","jsxs","Fragment","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA;AAAA,EACA,aAAa;AACf,GAIG;AACD,SACEA,2BAAAA;AAAAA,IAACC,WAAAA;AAAAA,IAAA;AAAA,MACC,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,SAAS;AAAA,MACT,qCAAOC,UAAAA,WAAA,EAAU;AAAA,MACjB,WAAWC,GAAAA,GAAG,YAAY,SAAS;AAAA,MACnC,cAAY;AAAA,IAAA;AAAA,EAAA;AAGlB;AAMA,SAAS,eACP,MACA,OACA,SACA,aACwB;AACxB,MAAI,KAAM,QAAO;AACjB,MAAI,OAAO;AACT,WACEH,2BAAAA,IAACI,OAAAA,QAAA,EAAO,SAAmB,GAAG,aAC3B,UAAA,OACH;AAAA,EAEJ;AACA,SAAO;AACT;AAEA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASG;AACD,QAAM,UAAU,eAAe,aAAa,cAAc,gBAAgB;AAAA,IACxE,SAAS;AAAA,IACT,MAAM;AAAA,EAAA,CACP;AAED,SACEC,2BAAAA,KAAAC,qBAAA,EACG,UAAA;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A,gBACA;AAAA,cAAA;AAAA,YAAA;AAAA,YAGH,YAAY,aACXA,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,YAAA;AAAA,YAGH,YAAY,aACXA,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBAEC;AAAA,cAAA;AAAA,YAAA;AAAA,YAGJ,YACCA,2BAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC;AAAA,gBACA;AAAA,gBACA,WAAW,YAAY,YAAY,2BAA2B;AAAA,cAAA;AAAA,YAAA;AAAA,UAChE;AAAA,QAAA;AAAA,MAAA;AAAA;AAAA,EAIR;AACF;AAEA,SAAS,cAAc;;"}
@@ -45,7 +45,7 @@ const Switch = React__namespace.forwardRef(({ className, size = "default", ...pr
45
45
  SwitchPrimitive__namespace.Thumb,
46
46
  {
47
47
  className: cn.cn(
48
- "pointer-events-none rounded-full bg-background-primary shadow-sm transition-transform duration-150",
48
+ "pointer-events-none rounded-full bg-background-primary shadow-sm theme-v2:bg-surface-primary transition-transform duration-150",
49
49
  thumbSizeClass
50
50
  )
51
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.cjs","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import * as SwitchPrimitive from \"@radix-ui/react-switch\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Size variant of the switch toggle. */\nexport type SwitchSize = \"default\" | \"small\";\n\nexport interface SwitchProps\n extends Omit<React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, \"asChild\"> {\n /** Size variant of the switch. @default \"default\" */\n size?: SwitchSize;\n}\n\n/**\n * A toggle switch for boolean on/off states. Built on Radix UI `Switch`.\n *\n * For a labelled switch with helper text, see {@link SwitchField}.\n *\n * @example\n * ```tsx\n * <Switch checked={on} onCheckedChange={setOn} />\n * ```\n */\nexport const Switch = React.forwardRef<\n React.ComponentRef<typeof SwitchPrimitive.Root>,\n SwitchProps\n>(({ className, size = \"default\", ...props }, ref) => {\n const thumbSizeClass =\n size === \"default\"\n ? \"size-4.5 translate-x-0.75 data-[state=checked]:translate-x-4.75\"\n : \"size-4 translate-x-0.5 data-[state=checked]:translate-x-4.25\";\n\n return (\n <SwitchPrimitive.Root\n ref={ref}\n className={cn(\n \"inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors duration-150\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n \"data-[state=checked]:border-neutral-alphas-200 data-[state=checked]:bg-brand-primary-default\",\n \"data-[state=unchecked]:bg-neutral-alphas-400\",\n \"not-disabled:active:opacity-80\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n size === \"default\" && \"h-6 w-10.5\",\n size === \"small\" && \"h-5 w-9\",\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n className={cn(\n \"pointer-events-none rounded-full bg-background-primary shadow-sm transition-transform duration-150\",\n thumbSizeClass,\n )}\n />\n </SwitchPrimitive.Root>\n );\n});\n\nSwitch.displayName = \"Switch\";\n"],"names":["React","jsx","SwitchPrimitive","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,SAASA,iBAAM,WAG1B,CAAC,EAAE,WAAW,OAAO,WAAW,GAAG,MAAA,GAAS,QAAQ;AACpD,QAAM,iBACJ,SAAS,YACL,oEACA;AAEN,SACEC,2BAAAA;AAAAA,IAACC,2BAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAWC,GAAAA;AAAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS,aAAa;AAAA,QACtB,SAAS,WAAW;AAAA,QACpB;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEJ,UAAAF,2BAAAA;AAAAA,QAACC,2BAAgB;AAAA,QAAhB;AAAA,UACC,WAAWC,GAAAA;AAAAA,YACT;AAAA,YACA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN,CAAC;AAED,OAAO,cAAc;;"}
1
+ {"version":3,"file":"Switch.cjs","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import * as SwitchPrimitive from \"@radix-ui/react-switch\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Size variant of the switch toggle. */\nexport type SwitchSize = \"default\" | \"small\";\n\nexport interface SwitchProps\n extends Omit<React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, \"asChild\"> {\n /** Size variant of the switch. @default \"default\" */\n size?: SwitchSize;\n}\n\n/**\n * A toggle switch for boolean on/off states. Built on Radix UI `Switch`.\n *\n * For a labelled switch with helper text, see {@link SwitchField}.\n *\n * @example\n * ```tsx\n * <Switch checked={on} onCheckedChange={setOn} />\n * ```\n */\nexport const Switch = React.forwardRef<\n React.ComponentRef<typeof SwitchPrimitive.Root>,\n SwitchProps\n>(({ className, size = \"default\", ...props }, ref) => {\n const thumbSizeClass =\n size === \"default\"\n ? \"size-4.5 translate-x-0.75 data-[state=checked]:translate-x-4.75\"\n : \"size-4 translate-x-0.5 data-[state=checked]:translate-x-4.25\";\n\n return (\n <SwitchPrimitive.Root\n ref={ref}\n className={cn(\n \"inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors duration-150\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n \"data-[state=checked]:border-neutral-alphas-200 data-[state=checked]:bg-brand-primary-default\",\n \"data-[state=unchecked]:bg-neutral-alphas-400\",\n \"not-disabled:active:opacity-80\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n size === \"default\" && \"h-6 w-10.5\",\n size === \"small\" && \"h-5 w-9\",\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n className={cn(\n \"pointer-events-none rounded-full bg-background-primary shadow-sm theme-v2:bg-surface-primary transition-transform duration-150\",\n thumbSizeClass,\n )}\n />\n </SwitchPrimitive.Root>\n );\n});\n\nSwitch.displayName = \"Switch\";\n"],"names":["React","jsx","SwitchPrimitive","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,SAASA,iBAAM,WAG1B,CAAC,EAAE,WAAW,OAAO,WAAW,GAAG,MAAA,GAAS,QAAQ;AACpD,QAAM,iBACJ,SAAS,YACL,oEACA;AAEN,SACEC,2BAAAA;AAAAA,IAACC,2BAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAWC,GAAAA;AAAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS,aAAa;AAAA,QACtB,SAAS,WAAW;AAAA,QACpB;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEJ,UAAAF,2BAAAA;AAAAA,QAACC,2BAAgB;AAAA,QAAhB;AAAA,UACC,WAAWC,GAAAA;AAAAA,YACT;AAAA,YACA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN,CAAC;AAED,OAAO,cAAc;;"}
@@ -10,6 +10,7 @@ const SearchIcon = require("../Icons/SearchIcon.cjs");
10
10
  const TranscationArrowIcon = require("../Icons/TranscationArrowIcon.cjs");
11
11
  const Tooltip = require("../Tooltip/Tooltip.cjs");
12
12
  const TableRowLink = require("./TableRowLink.cjs");
13
+ const TableToolbarSearchFilters = require("./TableToolbarSearchFilters.cjs");
13
14
  function _interopNamespaceDefault(e) {
14
15
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
15
16
  if (e) {
@@ -60,7 +61,7 @@ const TableToolbar = React__namespace.forwardRef(
60
61
  ...props,
61
62
  children: [
62
63
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-24 flex-1 items-center", children: search }),
63
- children != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 items-center gap-6 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children })
64
+ children != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 items-center gap-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children })
64
65
  ]
65
66
  }
66
67
  );
@@ -68,33 +69,58 @@ const TableToolbar = React__namespace.forwardRef(
68
69
  );
69
70
  TableToolbar.displayName = "TableToolbar";
70
71
  const TableToolbarSearch = React__namespace.forwardRef(
71
- ({ className, value, onValueChange, clearLabel, placeholder, ...props }, ref) => {
72
- return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cn.cn("flex h-6 w-full min-w-0 cursor-text items-center gap-2", className), children: [
73
- /* @__PURE__ */ jsxRuntime.jsx(SearchIcon.SearchIcon, { size: 16, className: "shrink-0 text-icons-secondary", "aria-hidden": true }),
74
- /* @__PURE__ */ jsxRuntime.jsx(
75
- "input",
76
- {
77
- ref,
78
- type: "search",
79
- value,
80
- onChange: (event) => onValueChange(event.target.value),
81
- placeholder,
82
- "aria-label": props["aria-label"] ?? placeholder,
83
- className: "typography-description-12px-regular min-w-0 flex-1 border-none bg-transparent p-0 text-content-primary outline-none placeholder:text-content-secondary [&::-webkit-search-cancel-button]:hidden",
84
- ...props
85
- }
86
- ),
87
- value !== "" && /* @__PURE__ */ jsxRuntime.jsx(
88
- "button",
89
- {
90
- type: "button",
91
- "aria-label": clearLabel,
92
- onClick: () => onValueChange(""),
93
- className: "inline-flex size-4 shrink-0 cursor-pointer items-center justify-center border-none bg-transparent p-0 text-icons-secondary hover:text-icons-primary",
94
- children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon.CloseIcon, { size: 16 })
95
- }
96
- )
97
- ] });
72
+ ({
73
+ className,
74
+ value,
75
+ onValueChange,
76
+ clearLabel,
77
+ placeholder,
78
+ filters,
79
+ formatHiddenFilters,
80
+ clearFiltersLabel,
81
+ onClearFilters,
82
+ ...props
83
+ }, ref) => {
84
+ const generatedId = React__namespace.useId();
85
+ const inputId = filters ? props.id ?? generatedId : props.id;
86
+ return /* @__PURE__ */ jsxRuntime.jsxs(
87
+ "label",
88
+ {
89
+ htmlFor: filters ? inputId : void 0,
90
+ className: cn.cn("flex h-6 w-full min-w-0 cursor-text items-center gap-2", className),
91
+ children: [
92
+ /* @__PURE__ */ jsxRuntime.jsx(SearchIcon.SearchIcon, { size: 16, className: "shrink-0 text-icons-secondary", "aria-hidden": true }),
93
+ /* @__PURE__ */ jsxRuntime.jsx(TableToolbarSearchFilters.SearchFilters, { filters, formatHiddenFilters, children: /* @__PURE__ */ jsxRuntime.jsx(
94
+ "input",
95
+ {
96
+ ref,
97
+ id: inputId,
98
+ type: "search",
99
+ value,
100
+ onChange: (event) => onValueChange(event.target.value),
101
+ placeholder,
102
+ "aria-label": props["aria-label"] ?? placeholder,
103
+ className: cn.cn(
104
+ "typography-description-12px-regular min-w-0 flex-1 border-none bg-transparent p-0 text-content-primary outline-none placeholder:text-content-secondary [&::-webkit-search-cancel-button]:hidden",
105
+ filters && "min-w-24"
106
+ ),
107
+ ...props
108
+ }
109
+ ) }),
110
+ value !== "" && /* @__PURE__ */ jsxRuntime.jsx(
111
+ "button",
112
+ {
113
+ type: "button",
114
+ "aria-label": clearLabel,
115
+ onClick: () => onValueChange(""),
116
+ className: "inline-flex size-4 shrink-0 cursor-pointer items-center justify-center border-none bg-transparent p-0 text-icons-secondary hover:text-icons-primary",
117
+ children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon.CloseIcon, { size: 16 })
118
+ }
119
+ ),
120
+ clearFiltersLabel && onClearFilters && filters && filters.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(TableToolbarSearchFilters.ClearSearchFilters, { label: clearFiltersLabel, onClick: onClearFilters })
121
+ ]
122
+ }
123
+ );
98
124
  }
99
125
  );
100
126
  TableToolbarSearch.displayName = "TableToolbarSearch";
@@ -106,10 +132,12 @@ const TableToolbarAction = React__namespace.forwardRef(
106
132
  ref,
107
133
  type,
108
134
  className: cn.cn(
109
- "typography-description-12px-regular inline-flex h-6 shrink-0 cursor-pointer items-center gap-2 whitespace-nowrap rounded-xs border-none bg-transparent p-0 text-content-secondary outline-none",
110
- "hover:text-content-primary focus-visible:shadow-focus-ring disabled:cursor-default disabled:opacity-40",
135
+ "typography-description-12px-regular inline-flex h-6 shrink-0 cursor-pointer items-center gap-2 whitespace-nowrap rounded-xs border-none bg-transparent px-2 py-0 text-content-secondary outline-none",
136
+ "focus-visible:shadow-focus-ring enabled:hover:bg-interaction-hover enabled:hover:text-content-primary disabled:cursor-default disabled:opacity-40",
137
+ "data-[active]:bg-interaction-hover data-[state=open]:bg-neutral-alphas-100 data-[active]:text-content-primary data-[state=open]:text-content-primary data-[state=open]:enabled:hover:bg-neutral-alphas-100",
111
138
  className
112
139
  ),
140
+ "data-active": active ? "" : void 0,
113
141
  ...props,
114
142
  children: [
115
143
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-md:sr-only", children }),
@@ -117,10 +145,7 @@ const TableToolbarAction = React__namespace.forwardRef(
117
145
  "span",
118
146
  {
119
147
  "aria-hidden": true,
120
- className: cn.cn(
121
- "inline-flex size-4 shrink-0 items-center justify-center [&>svg]:size-4",
122
- active ? "text-brand-primary-default" : "text-icons-secondary"
123
- ),
148
+ className: "inline-flex size-4 shrink-0 items-center justify-center text-icons-secondary [&>svg]:size-4",
124
149
  children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(TranscationArrowIcon.TranscationArrowIcon, { size: 16 })
125
150
  }
126
151
  )
@@ -206,18 +231,52 @@ const TableTruncatedText = React__namespace.forwardRef(
206
231
  TableTruncatedText.displayName = "TableTruncatedText";
207
232
  const TableScrollArea = React__namespace.forwardRef(
208
233
  ({ className, children, roundTop: _roundTop, showScrollbar = false, ...props }, ref) => {
234
+ const scrollportRef = React__namespace.useRef(null);
235
+ const [overflowsX, setOverflowsX] = React__namespace.useState(false);
236
+ React__namespace.useLayoutEffect(() => {
237
+ const scrollport = scrollportRef.current;
238
+ if (!showScrollbar || !scrollport || typeof ResizeObserver === "undefined") {
239
+ return;
240
+ }
241
+ const measure = () => setOverflowsX(scrollport.scrollWidth > scrollport.clientWidth);
242
+ const resizeObserver = new ResizeObserver(measure);
243
+ const observeContent = () => {
244
+ resizeObserver.disconnect();
245
+ resizeObserver.observe(scrollport);
246
+ for (const element of [
247
+ ...Array.from(scrollport.children),
248
+ ...Array.from(scrollport.querySelectorAll("table"))
249
+ ]) {
250
+ resizeObserver.observe(element);
251
+ }
252
+ measure();
253
+ };
254
+ observeContent();
255
+ const mutationObserver = new MutationObserver(observeContent);
256
+ mutationObserver.observe(scrollport, { childList: true, subtree: true });
257
+ return () => {
258
+ mutationObserver.disconnect();
259
+ resizeObserver.disconnect();
260
+ };
261
+ }, [showScrollbar]);
209
262
  return /* @__PURE__ */ jsxRuntime.jsx(
210
263
  "div",
211
264
  {
212
265
  ref,
213
- className: cn.cn("relative w-full min-w-0 overflow-hidden", className),
266
+ className: cn.cn(
267
+ "relative flex min-h-0 w-full min-w-0 flex-auto flex-col overflow-hidden",
268
+ className
269
+ ),
214
270
  ...props,
215
271
  children: /* @__PURE__ */ jsxRuntime.jsx(
216
272
  "div",
217
273
  {
274
+ ref: scrollportRef,
275
+ "data-table-scrollport": "",
218
276
  className: cn.cn(
219
- "overflow-x-auto",
220
- showScrollbar && "pb-3 [scrollbar-color:var(--color-border-strong)_transparent] [scrollbar-width:thin]"
277
+ "min-h-0 flex-auto overflow-auto",
278
+ showScrollbar && "[scrollbar-color:var(--color-border-strong)_transparent] [scrollbar-width:thin]",
279
+ showScrollbar && overflowsX && "pb-3"
221
280
  ),
222
281
  children
223
282
  }
@@ -245,7 +304,14 @@ const Table = React__namespace.forwardRef(
245
304
  Table.displayName = "Table";
246
305
  const TableHeader = React__namespace.forwardRef(
247
306
  ({ className, ...props }, ref) => {
248
- return /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn.cn(className), ...props });
307
+ return /* @__PURE__ */ jsxRuntime.jsx(
308
+ "thead",
309
+ {
310
+ ref,
311
+ className: cn.cn("[&_th]:sticky [&_th]:top-0 [&_th]:z-10", className),
312
+ ...props
313
+ }
314
+ );
249
315
  }
250
316
  );
251
317
  TableHeader.displayName = "TableHeader";