@vendure-io/ui 3.0.0-next.4 → 3.0.0-next.6

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 (89) hide show
  1. package/package.json +12 -11
  2. package/src/components/atoms/alert-dialog.tsx +1 -4
  3. package/src/components/atoms/alert.tsx +59 -35
  4. package/src/components/atoms/badge.tsx +2 -2
  5. package/src/components/atoms/breadcrumb.tsx +154 -59
  6. package/src/components/atoms/button-group.tsx +1 -1
  7. package/src/components/atoms/button.tsx +2 -2
  8. package/src/components/atoms/calendar.tsx +2 -2
  9. package/src/components/atoms/card.tsx +15 -2
  10. package/src/components/atoms/carousel.tsx +33 -7
  11. package/src/components/atoms/chart.tsx +3 -3
  12. package/src/components/atoms/checkbox.tsx +1 -1
  13. package/src/components/atoms/combobox.tsx +60 -36
  14. package/src/components/atoms/command.tsx +17 -7
  15. package/src/components/atoms/context-menu.tsx +5 -5
  16. package/src/components/atoms/dialog.tsx +30 -14
  17. package/src/components/atoms/dropdown-menu.tsx +1 -1
  18. package/src/components/atoms/hover-card.tsx +1 -1
  19. package/src/components/atoms/input-group.tsx +30 -12
  20. package/src/components/atoms/input-otp.tsx +2 -2
  21. package/src/components/atoms/input.tsx +13 -3
  22. package/src/components/atoms/menubar.tsx +2 -2
  23. package/src/components/atoms/native-select.tsx +1 -1
  24. package/src/components/atoms/navigation-menu.tsx +3 -3
  25. package/src/components/atoms/pagination.tsx +52 -15
  26. package/src/components/atoms/popover.tsx +1 -1
  27. package/src/components/atoms/select.tsx +3 -3
  28. package/src/components/atoms/sheet.tsx +35 -15
  29. package/src/components/atoms/sidebar.tsx +224 -36
  30. package/src/components/atoms/skeleton.tsx +6 -3
  31. package/src/components/atoms/spinner.tsx +7 -2
  32. package/src/components/atoms/tabs.tsx +6 -2
  33. package/src/components/atoms/textarea.tsx +1 -1
  34. package/src/components/atoms/toggle.tsx +1 -1
  35. package/src/components/molecules/action-needed.tsx +483 -0
  36. package/src/components/molecules/anonymized-token.tsx +70 -25
  37. package/src/components/molecules/app-shell.tsx +14 -5
  38. package/src/components/molecules/checklist/checklist.tsx +47 -17
  39. package/src/components/molecules/chip.tsx +37 -19
  40. package/src/components/molecules/choice-card.tsx +117 -9
  41. package/src/components/molecules/code-block/package-manager-storage.ts +50 -0
  42. package/src/components/molecules/code-block/process-code.ts +1 -1
  43. package/src/components/molecules/code-block.tsx +58 -47
  44. package/src/components/molecules/combobox-free-text.tsx +75 -20
  45. package/src/components/molecules/confirm-dialog.tsx +17 -5
  46. package/src/components/molecules/copyable-text.tsx +10 -8
  47. package/src/components/molecules/data-table/data-table-filters.tsx +36 -6
  48. package/src/components/molecules/data-table/data-table-helpers.tsx +109 -3
  49. package/src/components/molecules/data-table/data-table-row-count-storage.tsx +88 -0
  50. package/src/components/molecules/data-table/data-table-selection-storage.tsx +33 -15
  51. package/src/components/molecules/data-table/data-table-types.tsx +156 -29
  52. package/src/components/molecules/data-table/data-table-view-options.tsx +14 -4
  53. package/src/components/molecules/data-table/data-table.tsx +156 -75
  54. package/src/components/molecules/data-table/table-pagination.tsx +142 -38
  55. package/src/components/molecules/date-picker.tsx +58 -25
  56. package/src/components/molecules/date-range-picker.tsx +59 -24
  57. package/src/components/molecules/date-time-picker.tsx +63 -25
  58. package/src/components/molecules/date-time.tsx +38 -3
  59. package/src/components/molecules/elapsed-time.tsx +61 -12
  60. package/src/components/molecules/file-dropzone.tsx +151 -40
  61. package/src/components/molecules/format-provider.tsx +14 -4
  62. package/src/components/molecules/id-chip-chrome.tsx +114 -0
  63. package/src/components/molecules/id-chip.tsx +13 -115
  64. package/src/components/molecules/issued-secret.tsx +35 -25
  65. package/src/components/molecules/live-indicator.tsx +1 -1
  66. package/src/components/molecules/money.tsx +44 -3
  67. package/src/components/molecules/multi-select.tsx +62 -16
  68. package/src/components/molecules/page-header.tsx +6 -2
  69. package/src/components/molecules/password-input.tsx +11 -10
  70. package/src/components/molecules/relative-time.tsx +88 -16
  71. package/src/components/molecules/search-trigger.tsx +5 -3
  72. package/src/components/molecules/secret-value.tsx +35 -19
  73. package/src/components/molecules/skip-link.tsx +11 -9
  74. package/src/components/molecules/stat-card.tsx +145 -33
  75. package/src/components/molecules/state-views/empty-state.tsx +16 -12
  76. package/src/components/molecules/state-views/error-state.tsx +36 -20
  77. package/src/components/molecules/state-views/loading-state.tsx +18 -6
  78. package/src/components/molecules/state-views/skeleton-parts.tsx +6 -4
  79. package/src/components/molecules/status-badge.tsx +11 -35
  80. package/src/components/molecules/time-tooltip.tsx +55 -1
  81. package/src/hooks/use-copy.ts +3 -1
  82. package/src/lib/deprecated.ts +71 -0
  83. package/src/lib/field-surface.ts +7 -7
  84. package/src/lib/format-messages.ts +368 -0
  85. package/src/lib/highlight.ts +1 -1
  86. package/src/lib/menu-item.tsx +1 -1
  87. package/src/lib/tint-recipes.ts +10 -5
  88. package/src/lib/utils.ts +19 -1
  89. package/src/lib/dialog-padding.ts +0 -48
@@ -103,7 +103,7 @@ function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
103
103
  <div
104
104
  data-slot="card-title"
105
105
  className={cn(
106
- "font-heading text-sm font-semibold tracking-[-0.005em] text-foreground-secondary has-data-[slot=card-count]:flex has-data-[slot=card-count]:items-baseline has-data-[slot=card-count]:gap-2.5",
106
+ "font-heading text-sm font-semibold tracking-[-0.005em] text-foreground-secondary has-data-[slot=card-count]:flex has-data-[slot=card-count]:items-baseline has-data-[slot=card-count]:gap-2.5 @max-xs/card-header:col-span-full",
107
107
  className
108
108
  )}
109
109
  {...props}
@@ -176,7 +176,10 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
176
176
  return (
177
177
  <div
178
178
  data-slot="card-description"
179
- className={cn("text-foreground-secondary text-sm", className)}
179
+ className={cn(
180
+ "text-foreground-secondary text-sm @max-xs/card-header:col-span-full",
181
+ className
182
+ )}
180
183
  {...props}
181
184
  />
182
185
  )
@@ -185,12 +188,22 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
185
188
  // The action box is one title line high and centres its content, so a small
186
189
  // button lines up with the title and overflows into the card padding instead
187
190
  // of making the header row taller.
191
+ // When the header is narrower than 20rem (a container query on the header,
192
+ // so it follows the card and not the viewport) the action leaves the second
193
+ // column and takes its own row under the title and description, which then
194
+ // span the header too. The action starts at the inline start (the right in
195
+ // RTL), grows to its content's height and wraps inside the header instead of
196
+ // overflowing.
197
+ const NARROW_ACTION =
198
+ "@max-xs/card-header:order-last @max-xs/card-header:col-span-full @max-xs/card-header:col-start-1 @max-xs/card-header:row-span-1 @max-xs/card-header:row-start-auto @max-xs/card-header:mt-2 @max-xs/card-header:h-auto @max-xs/card-header:max-w-full @max-xs/card-header:justify-self-start"
199
+
188
200
  function CardAction({ className, ...props }: React.ComponentProps<"div">) {
189
201
  return (
190
202
  <div
191
203
  data-slot="card-action"
192
204
  className={cn(
193
205
  "col-start-2 row-span-2 row-start-1 flex h-lh flex-wrap content-center items-center gap-2 self-start justify-self-end",
206
+ NARROW_ACTION,
194
207
  className
195
208
  )}
196
209
  {...props}
@@ -9,6 +9,7 @@ import { cn } from "@vendure-io/ui/lib/utils"
9
9
  import { Button } from "@vendure-io/ui/components/atoms/button"
10
10
  import { useDirection } from "@vendure-io/ui/components/atoms/direction"
11
11
  import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react"
12
+ import { useMessages } from "../../lib/format-messages.ts"
12
13
 
13
14
  type CarouselApi = UseEmblaCarouselType[1]
14
15
  type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
@@ -50,8 +51,11 @@ function Carousel({
50
51
  plugins,
51
52
  className,
52
53
  children,
54
+ "aria-roledescription": roleDescription,
53
55
  ...props
54
56
  }: React.ComponentProps<"div"> & CarouselProps) {
57
+ // `aria-roledescription` defaults to `messages.carousel.region`, "carousel".
58
+ const t = useMessages("carousel", { region: roleDescription })
55
59
  // Embla scrolls the other way in right to left, so it needs the direction.
56
60
  const direction = useDirection()
57
61
  const [carouselRef, api] = useEmblaCarousel(
@@ -129,7 +133,7 @@ function Carousel({
129
133
  onKeyDownCapture={handleKeyDown}
130
134
  className={cn("relative", className)}
131
135
  role="region"
132
- aria-roledescription="carousel"
136
+ aria-roledescription={t.region}
133
137
  data-slot="carousel"
134
138
  {...props}
135
139
  >
@@ -160,13 +164,19 @@ function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
160
164
  )
161
165
  }
162
166
 
163
- function CarouselItem({ className, ...props }: React.ComponentProps<"div">) {
167
+ // `aria-roledescription` defaults to `messages.carousel.slide`, "slide".
168
+ function CarouselItem({
169
+ className,
170
+ "aria-roledescription": roleDescription,
171
+ ...props
172
+ }: React.ComponentProps<"div">) {
164
173
  const { orientation } = useCarousel()
174
+ const t = useMessages("carousel", { slide: roleDescription })
165
175
 
166
176
  return (
167
177
  <div
168
178
  role="group"
169
- aria-roledescription="slide"
179
+ aria-roledescription={t.slide}
170
180
  data-slot="carousel-item"
171
181
  className={cn(
172
182
  "min-w-0 shrink-0 grow-0 basis-full",
@@ -182,9 +192,17 @@ function CarouselPrevious({
182
192
  className,
183
193
  variant = "outline",
184
194
  size = "icon-sm",
195
+ label,
185
196
  ...props
186
- }: React.ComponentProps<typeof Button>) {
197
+ }: React.ComponentProps<typeof Button> & {
198
+ /**
199
+ * Screen-reader text of the button.
200
+ * @default `messages.carousel.previous`, "Previous slide"
201
+ */
202
+ label?: string
203
+ }) {
187
204
  const { orientation, scrollPrev, canScrollPrev } = useCarousel()
205
+ const t = useMessages("carousel", { previous: label })
188
206
 
189
207
  return (
190
208
  <Button
@@ -203,7 +221,7 @@ function CarouselPrevious({
203
221
  {...props}
204
222
  >
205
223
  <ChevronLeftIcon className={cn(orientation === "horizontal" && "rtl:rotate-180")} />
206
- <span className="sr-only">Previous slide</span>
224
+ <span className="sr-only">{t.previous}</span>
207
225
  </Button>
208
226
  )
209
227
  }
@@ -212,9 +230,17 @@ function CarouselNext({
212
230
  className,
213
231
  variant = "outline",
214
232
  size = "icon-sm",
233
+ label,
215
234
  ...props
216
- }: React.ComponentProps<typeof Button>) {
235
+ }: React.ComponentProps<typeof Button> & {
236
+ /**
237
+ * Screen-reader text of the button.
238
+ * @default `messages.carousel.next`, "Next slide"
239
+ */
240
+ label?: string
241
+ }) {
217
242
  const { orientation, scrollNext, canScrollNext } = useCarousel()
243
+ const t = useMessages("carousel", { next: label })
218
244
 
219
245
  return (
220
246
  <Button
@@ -233,7 +259,7 @@ function CarouselNext({
233
259
  {...props}
234
260
  >
235
261
  <ChevronRightIcon className={cn(orientation === "horizontal" && "rtl:rotate-180")} />
236
- <span className="sr-only">Next slide</span>
262
+ <span className="sr-only">{t.next}</span>
237
263
  </Button>
238
264
  )
239
265
  }
@@ -259,7 +259,7 @@ function ChartTooltipContent({
259
259
  return (
260
260
  <div
261
261
  className={cn(
262
- "bg-popover text-popover-foreground grid min-w-32 items-start gap-1.5 rounded-xl px-2.5 py-1.5 text-xs shadow-overlay",
262
+ "bg-popover text-popover-foreground grid min-w-32 items-start gap-1.5 rounded-2xl px-2.5 py-1.5 text-xs shadow-overlay",
263
263
  className
264
264
  )}
265
265
  >
@@ -290,7 +290,7 @@ function ChartTooltipContent({
290
290
  !hideIndicator && (
291
291
  <div
292
292
  className={cn(
293
- "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
293
+ "shrink-0 rounded-sm border-(--color-border) bg-(--color-bg)",
294
294
  {
295
295
  "h-2.5 w-2.5": indicator === "dot",
296
296
  "w-1": indicator === "line",
@@ -380,7 +380,7 @@ function ChartLegendContent({
380
380
  <itemConfig.icon />
381
381
  ) : (
382
382
  <div
383
- className="h-2 w-2 shrink-0 rounded-[2px]"
383
+ className="h-2 w-2 shrink-0 rounded-sm"
384
384
  style={{
385
385
  backgroundColor: item.color,
386
386
  }}
@@ -70,7 +70,7 @@ function Checkbox({ className, indeterminate, ...props }: CheckboxPrimitive.Root
70
70
  <CheckboxPrimitive.Root
71
71
  data-slot="checkbox"
72
72
  className={(state) => cn(
73
- "group/checkbox border-control-border dark:bg-input/30 data-checked:text-primary-foreground data-checked:border-primary data-indeterminate:text-primary-foreground data-indeterminate:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring aria-invalid:focus-visible:outline-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:ring-3",
73
+ "group/checkbox border-control-border dark:bg-input/30 data-checked:text-primary-foreground data-checked:border-primary data-indeterminate:text-primary-foreground data-indeterminate:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring aria-invalid:focus-visible:outline-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 items-center justify-center rounded-md border outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:ring-3",
74
74
  rootTransition,
75
75
  hole,
76
76
  fill,
@@ -5,8 +5,8 @@ import { Combobox as ComboboxPrimitive } from "@base-ui/react"
5
5
 
6
6
  import { cn } from "@vendure-io/ui/lib/utils"
7
7
  import { MenuCheck, menuCheckItem, menuItemDisabled } from "../../lib/menu-item.tsx"
8
- import { statusChipRing } from "@vendure-io/ui/lib/tint-recipes"
9
- import { fieldSurface, fieldSurfaceWithin } from "@vendure-io/ui/lib/field-surface"
8
+ import { statusChipRing } from "../../lib/tint-recipes.ts"
9
+ import { fieldSurface, fieldSurfaceWithin } from "../../lib/field-surface.ts"
10
10
  import { popupMotion } from "../../lib/popup-motion.ts"
11
11
  import { Button } from "@vendure-io/ui/components/atoms/button"
12
12
  import {
@@ -19,6 +19,8 @@ import { ChevronDownIcon, Loader2Icon, XIcon } from "lucide-react"
19
19
  import { usePopupDir } from "../../lib/popup-direction.ts"
20
20
  import { usePopupAlign } from "../../lib/popup-align.ts"
21
21
  import { hasName, nameFrom, useRegisteredRef } from "../../lib/control-name.ts"
22
+ import { useMessages } from "../../lib/format-messages.ts"
23
+ import { warnDeprecated } from "../../lib/deprecated.ts"
22
24
 
23
25
  /**
24
26
  * The controls of the nearest Combobox. Base UI names the trigger and the
@@ -39,7 +41,7 @@ type ComboboxPagingProps = {
39
41
  /**
40
42
  * Asks for the next page of a server-searched list. Called once when the
41
43
  * list scrolls near its end, or the arrow keys reach its last option, while
42
- * `hasMore` is set and `loading` is not. It is called again once the
44
+ * `hasMore` is set and `isLoading` is not. It is called again once the
43
45
  * options change, the search changes, the list reopens, or the list
44
46
  * scrolls away from its end and back: a failed fetch is retried by
45
47
  * scrolling, never in a loop.
@@ -52,8 +54,13 @@ type ComboboxPagingProps = {
52
54
  * assistive technology and announces `loadingLabel`. With no options yet,
53
55
  * the loading row takes the place of ComboboxEmpty.
54
56
  */
57
+ isLoading?: boolean
58
+ /** @deprecated Use `isLoading`. Removed in 4.0. */
55
59
  loading?: boolean
56
- /** Announced to screen readers while `loading` is set. */
60
+ /**
61
+ * Announced to screen readers while `isLoading` is set.
62
+ * @default `messages.combobox.loading`, "Loading…"
63
+ */
57
64
  loadingLabel?: string
58
65
  }
59
66
 
@@ -62,7 +69,7 @@ type ComboboxPagingProps = {
62
69
  * Null when the Combobox takes none of the paging props.
63
70
  */
64
71
  type ComboboxPaging = {
65
- loading: boolean
72
+ isLoading: boolean
66
73
  loadingLabel: string
67
74
  canLoadMore: boolean
68
75
  list: HTMLElement | null
@@ -78,12 +85,15 @@ const ComboboxPagingContext = React.createContext<ComboboxPaging | null>(null)
78
85
  function Combobox<Value, Multiple extends boolean | undefined = false, Item = Value>({
79
86
  onLoadMore,
80
87
  hasMore = false,
88
+ isLoading: isLoadingProp,
81
89
  loading,
82
- loadingLabel = "Loading…",
90
+ loadingLabel,
83
91
  onItemHighlighted,
84
92
  onInputValueChange,
85
93
  ...props
86
94
  }: ComboboxPrimitive.Root.Props<Value, Multiple, Item> & ComboboxPagingProps) {
95
+ if (loading !== undefined) warnDeprecated("Combobox", "loading", "isLoading")
96
+ const isLoading = isLoadingProp ?? loading
87
97
  const [trigger, setTrigger] = React.useState<HTMLElement | null>(null)
88
98
  const [input, setInput] = React.useState<HTMLElement | null>(null)
89
99
  const [list, setList] = React.useState<HTMLElement | null>(null)
@@ -91,16 +101,16 @@ function Combobox<Value, Multiple extends boolean | undefined = false, Item = Va
91
101
 
92
102
  // Read at call time, so an observer set up on an earlier render sees the
93
103
  // current flags.
94
- const latest = React.useRef({ onLoadMore, hasMore, loading })
104
+ const latest = React.useRef({ onLoadMore, hasMore, isLoading })
95
105
  React.useLayoutEffect(() => {
96
- latest.current = { onLoadMore, hasMore, loading }
106
+ latest.current = { onLoadMore, hasMore, isLoading }
97
107
  })
98
108
  // Set once a page is asked for. Scrolling fires many events before the
99
- // consumer's `loading` flag turns on; the latch keeps that to one call.
109
+ // consumer's `isLoading` flag turns on; the latch keeps that to one call.
100
110
  const latched = React.useRef(false)
101
111
  const requestMore = React.useCallback(() => {
102
112
  const current = latest.current
103
- if (!current.onLoadMore || !current.hasMore || current.loading || latched.current) return
113
+ if (!current.onLoadMore || !current.hasMore || current.isLoading || latched.current) return
104
114
  latched.current = true
105
115
  current.onLoadMore()
106
116
  }, [])
@@ -109,13 +119,14 @@ function Combobox<Value, Multiple extends boolean | undefined = false, Item = Va
109
119
  }, [])
110
120
 
111
121
  const canLoadMore = onLoadMore !== undefined
112
- const enabled = canLoadMore || loading !== undefined
122
+ const enabled = canLoadMore || isLoading !== undefined
123
+ const t = useMessages("combobox", { loading: loadingLabel })
113
124
  const paging = React.useMemo(
114
125
  () =>
115
126
  enabled
116
127
  ? {
117
- loading: !!loading,
118
- loadingLabel,
128
+ isLoading: !!isLoading,
129
+ loadingLabel: t.loading,
119
130
  canLoadMore,
120
131
  list,
121
132
  setList,
@@ -123,7 +134,7 @@ function Combobox<Value, Multiple extends boolean | undefined = false, Item = Va
123
134
  rearm,
124
135
  }
125
136
  : null,
126
- [enabled, loading, loadingLabel, canLoadMore, list, requestMore, rearm]
137
+ [enabled, isLoading, t.loading, canLoadMore, list, requestMore, rearm]
127
138
  )
128
139
 
129
140
  return (
@@ -195,11 +206,13 @@ function ComboboxTrigger({
195
206
  // Icon-only, so it carries a name. Like the open button, it stays out of the
196
207
  // tab order: Backspace clears the input from the keyboard, and while the list
197
208
  // is open Base UI hides it from assistive technology.
198
- function ComboboxClear({ className, "aria-label": ariaLabel = "Clear", ...props }: ComboboxPrimitive.Clear.Props) {
209
+ // `aria-label` defaults to `messages.combobox.clear`, "Clear".
210
+ function ComboboxClear({ className, "aria-label": ariaLabel, ...props }: ComboboxPrimitive.Clear.Props) {
211
+ const t = useMessages("combobox", { clear: ariaLabel })
199
212
  return (
200
213
  <ComboboxPrimitive.Clear
201
214
  data-slot="combobox-clear"
202
- aria-label={ariaLabel}
215
+ aria-label={t.clear}
203
216
  tabIndex={-1}
204
217
  render={<InputGroupButton variant="ghost" size="icon-xs" />}
205
218
  className={cn(className)}
@@ -216,18 +229,25 @@ function ComboboxInput({
216
229
  disabled = false,
217
230
  showTrigger = true,
218
231
  showClear = false,
219
- triggerLabel = "Open options",
220
- clearLabel = "Clear",
232
+ triggerLabel,
233
+ clearLabel,
221
234
  ref,
222
235
  ...props
223
236
  }: ComboboxPrimitive.Input.Props & {
224
237
  showTrigger?: boolean
225
238
  showClear?: boolean
226
- /** Accessible name of the icon-only trigger button. */
239
+ /**
240
+ * Accessible name of the icon-only trigger button.
241
+ * @default `messages.combobox.open`, "Open options"
242
+ */
227
243
  triggerLabel?: string
228
- /** Accessible name of the icon-only clear button. */
244
+ /**
245
+ * Accessible name of the icon-only clear button.
246
+ * @default `messages.combobox.clear`, "Clear"
247
+ */
229
248
  clearLabel?: string
230
249
  }) {
250
+ const t = useMessages("combobox", { open: triggerLabel })
231
251
  const inputRef = useRegisteredRef(ref, React.useContext(ComboboxControlsContext)?.setInput)
232
252
  return (
233
253
  <InputGroup className={cn("w-auto", className)}>
@@ -253,7 +273,7 @@ function ComboboxInput({
253
273
  variant="ghost"
254
274
  render={<ComboboxPrimitive.Trigger />}
255
275
  data-slot="input-group-button"
256
- aria-label={triggerLabel}
276
+ aria-label={t.open}
257
277
  className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent"
258
278
  disabled={disabled}
259
279
  >
@@ -330,7 +350,7 @@ function ComboboxContent({
330
350
  data-slot="combobox-content"
331
351
  data-chips={!!anchor}
332
352
  data-field-group={!!fieldGroup}
333
- className={cn("bg-popover text-popover-foreground shadow-overlay group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] overflow-hidden rounded-xl data-[chips=true]:min-w-(--anchor-width) data-[field-group=true]:min-w-(--anchor-width) *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none", popupMotion, className )}
353
+ className={cn("bg-popover text-popover-foreground shadow-overlay group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] overflow-hidden rounded-2xl data-[chips=true]:min-w-(--anchor-width) data-[field-group=true]:min-w-(--anchor-width) *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none *:data-[slot=input-group]:inset-ring-0", popupMotion, className )}
334
354
  // A closing list is gone for assistive technology: the input no
335
355
  // longer points at it, and it takes no input while it fades out.
336
356
  // With the search input inside it, the popup is a dialog: it takes
@@ -418,9 +438,9 @@ function ComboboxList({ className, children, ref, ...props }: ComboboxPrimitive.
418
438
  {...(hasName(props) ? {} : name)}
419
439
  ref={listRef}
420
440
  data-slot="combobox-list"
421
- aria-busy={paging?.loading || undefined}
441
+ aria-busy={paging?.isLoading || undefined}
422
442
  className={cn(
423
- "no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0",
443
+ "no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1.25 data-empty:p-0",
424
444
  className
425
445
  )}
426
446
  {...props}
@@ -431,7 +451,7 @@ function ComboboxList({ className, children, ref, ...props }: ComboboxPrimitive.
431
451
  {/* Decorative: a listbox holds only options and groups, so the
432
452
  row is hidden from assistive technology. The list is busy
433
453
  and the status below announces the load. */}
434
- {paging.loading && (
454
+ {paging.isLoading && (
435
455
  <div
436
456
  data-slot="combobox-loading"
437
457
  aria-hidden="true"
@@ -450,7 +470,7 @@ function ComboboxList({ className, children, ref, ...props }: ComboboxPrimitive.
450
470
  listbox, which may hold only options and groups. */}
451
471
  {paging && (
452
472
  <ComboboxPrimitive.Status data-slot="combobox-status" className="sr-only">
453
- {paging.loading ? paging.loadingLabel : null}
473
+ {paging.isLoading ? paging.loadingLabel : null}
454
474
  </ComboboxPrimitive.Status>
455
475
  )}
456
476
  </>
@@ -473,7 +493,7 @@ function ComboboxItem({
473
493
  className={cn(
474
494
  menuItemDisabled,
475
495
  menuCheckItem,
476
- "not-data-disabled:data-highlighted:bg-muted not-data-disabled:data-highlighted:text-accent-foreground data-disabled:data-highlighted:outline-solid data-disabled:data-highlighted:outline-2 data-disabled:data-highlighted:-outline-offset-2 data-disabled:data-highlighted:outline-ring not-data-[variant=destructive]:not-data-disabled:data-highlighted:**:text-accent-foreground relative flex min-h-8.5 w-full cursor-default items-center gap-2 rounded-lg py-1.5 pe-8 ps-2 text-sm outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75] [&>svg:not([class*='opacity-'])]:opacity-55 [&>svg:not([class*='opacity-'])]:transition-opacity [&>svg:not([class*='opacity-'])]:duration-moderate not-data-disabled:data-highlighted:[&>svg:not([class*='opacity-'])]:opacity-85",
496
+ "not-data-disabled:data-highlighted:bg-muted not-data-disabled:data-highlighted:text-accent-foreground data-disabled:data-highlighted:outline-solid data-disabled:data-highlighted:outline-2 data-disabled:data-highlighted:-outline-offset-2 data-disabled:data-highlighted:outline-ring not-data-[variant=destructive]:not-data-disabled:data-highlighted:**:text-accent-foreground relative flex min-h-8.5 w-full cursor-default items-center gap-2 rounded-[calc(var(--radius-2xl)-5px)] py-1.5 pe-8 ps-2 text-sm outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75] [&>svg:not([class*='opacity-'])]:opacity-55 [&>svg:not([class*='opacity-'])]:transition-opacity [&>svg:not([class*='opacity-'])]:duration-moderate not-data-disabled:data-highlighted:[&>svg:not([class*='opacity-'])]:opacity-85",
477
497
  className
478
498
  )}
479
499
  {...props}
@@ -518,13 +538,13 @@ function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {
518
538
  // While a page loads, the list's loading row stands in for the empty state:
519
539
  // a new search has no options yet, but it is not empty.
520
540
  function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {
521
- const loading = !!React.useContext(ComboboxPagingContext)?.loading
541
+ const isLoading = !!React.useContext(ComboboxPagingContext)?.isLoading
522
542
  return (
523
543
  <ComboboxPrimitive.Empty
524
544
  data-slot="combobox-empty"
525
545
  className={cn(
526
546
  "text-muted-foreground hidden w-full justify-center py-2 text-center text-sm group-data-empty/combobox-content:flex",
527
- loading && "group-data-empty/combobox-content:hidden",
547
+ isLoading && "group-data-empty/combobox-content:hidden",
528
548
  className
529
549
  )}
530
550
  {...props}
@@ -567,25 +587,29 @@ function ComboboxChips({
567
587
  // muted field it sits on, with a grey outline, so each value stands out.
568
588
  // It has the Chip height, 24px, and is denser than a standalone Chip: the
569
589
  // label is 8px from the edge, so a field fits more of them. In the 34px
570
- // field it sits 5px from the edge, so its corner is the field's 6px minus that
571
- // 5px, 1px. The remove button sits 4px inside the chip, so its corner is the
572
- // chip's 1px minus 4px, which is square.
590
+ // field it sits 5px from the edge, so its corner is the field's 8px minus that
591
+ // 5px, 3px. The remove button sits 4px inside the chip, so its corner is the
592
+ // chip's 3px minus 4px, which is square.
573
593
  function ComboboxChip({
574
594
  className,
575
595
  children,
576
596
  showRemove = true,
577
- removeLabel = "Remove",
597
+ removeLabel,
578
598
  ...props
579
599
  }: ComboboxPrimitive.Chip.Props & {
580
600
  showRemove?: boolean
581
- /** Accessible name of the icon-only remove button. */
601
+ /**
602
+ * Accessible name of the icon-only remove button.
603
+ * @default `messages.combobox.remove`, "Remove"
604
+ */
582
605
  removeLabel?: string
583
606
  }) {
607
+ const t = useMessages("combobox", { remove: removeLabel })
584
608
  return (
585
609
  <ComboboxPrimitive.Chip
586
610
  data-slot="combobox-chip"
587
611
  className={cn(
588
- "bg-accent [--status-tone:var(--neutral-text)]", statusChipRing, "text-foreground flex h-6 w-fit items-center justify-center gap-1.5 rounded-[calc(var(--radius-lg)-5px)] ps-2 pe-2 text-xs font-medium whitespace-nowrap has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pe-1",
612
+ "bg-accent [--status-tone:var(--neutral-text)]", statusChipRing, "text-foreground flex h-6 w-fit items-center justify-center gap-1.5 rounded-[calc(var(--radius-xl)-5px)] ps-2 pe-2 text-xs font-medium whitespace-nowrap has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pe-1",
589
613
  className
590
614
  )}
591
615
  {...props}
@@ -596,7 +620,7 @@ function ComboboxChip({
596
620
  render={<Button variant="ghost" size="icon-xs" />}
597
621
  className="size-4 rounded-none [--button-box:--spacing(4)] opacity-50 hover:opacity-100"
598
622
  data-slot="combobox-chip-remove"
599
- aria-label={removeLabel}
623
+ aria-label={t.remove}
600
624
  >
601
625
  <XIcon className="pointer-events-none" />
602
626
  </ComboboxPrimitive.ChipRemove>
@@ -5,6 +5,7 @@ import { Command as CommandPrimitive, useCommandState } from "cmdk"
5
5
 
6
6
  import { cn } from "@vendure-io/ui/lib/utils"
7
7
  import { MenuCheck, menuCheckItem } from "../../lib/menu-item.tsx"
8
+ import { useMessages } from "../../lib/format-messages.ts"
8
9
  import {
9
10
  Dialog,
10
11
  DialogContent,
@@ -35,24 +36,33 @@ function Command({
35
36
  }
36
37
 
37
38
  function CommandDialog({
38
- title = "Command Palette",
39
- description = "Search for a command to run...",
39
+ title,
40
+ description,
40
41
  children,
41
42
  className,
42
43
  showCloseButton = false,
43
44
  ...props
44
45
  }: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
46
+ /**
47
+ * Screen-reader title of the dialog.
48
+ * @default `messages.command.title`, "Command Palette"
49
+ */
45
50
  title?: string
51
+ /**
52
+ * Screen-reader description of the dialog.
53
+ * @default `messages.command.description`, "Search for a command to run..."
54
+ */
46
55
  description?: string
47
56
  className?: string
48
57
  showCloseButton?: boolean
49
58
  children: React.ReactNode
50
59
  }) {
60
+ const t = useMessages("command", { title, description })
51
61
  return (
52
62
  <Dialog {...props}>
53
63
  <DialogHeader className="sr-only">
54
- <DialogTitle>{title}</DialogTitle>
55
- <DialogDescription>{description}</DialogDescription>
64
+ <DialogTitle>{t.title}</DialogTitle>
65
+ <DialogDescription>{t.description}</DialogDescription>
56
66
  </DialogHeader>
57
67
  {/* The palette: 600px wide, 12% of the viewport from the top so the
58
68
  list can grow down without moving the input. It opens often, so its
@@ -93,7 +103,7 @@ function CommandInput({
93
103
  // Unboxed: the input runs edge to edge above a hairline, with no field
94
104
  // border, fill or ring. 54px with 16px text in the palette dialog.
95
105
  <div data-slot="command-input-wrapper" className="border-border border-b">
96
- <InputGroup className="h-10! rounded-none! border-0! bg-transparent! pe-3.5 shadow-none! ring-0! outline-none! in-data-command-palette:h-13.5! *:data-[slot=input-group-addon]:ps-3! in-data-command-palette:*:data-[slot=input-group-addon]:ps-4.5!">
106
+ <InputGroup className="h-10! rounded-none! border-0! bg-transparent! pe-3.5 shadow-none! inset-ring-0! ring-0! outline-none! in-data-command-palette:h-13.5! *:data-[slot=input-group-addon]:ps-3! in-data-command-palette:*:data-[slot=input-group-addon]:ps-4.5!">
97
107
  <CommandPrimitive.Input
98
108
  data-slot="command-input"
99
109
  className={cn(
@@ -336,7 +346,7 @@ function CommandHighlight() {
336
346
  aria-hidden="true"
337
347
  role="none"
338
348
  data-slot="command-highlight"
339
- className="bg-muted pointer-events-none absolute top-0 left-0 rounded-sm opacity-0 will-change-transform forced-colors:outline-2 forced-colors:-outline-offset-2 forced-colors:outline-solid forced-colors:outline-[Highlight] in-data-command-palette:rounded-xl data-shown:opacity-100 data-ready:transition-opacity data-ready:duration-fast data-ready:ease-soft in-data-command-palette:transition-none!"
349
+ className="bg-muted pointer-events-none absolute top-0 left-0 rounded-sm opacity-0 will-change-transform forced-colors:outline-2 forced-colors:-outline-offset-2 forced-colors:outline-solid forced-colors:outline-[Highlight] in-data-command-palette:rounded-[calc(var(--radius-3xl)-8px)] data-shown:opacity-100 data-ready:transition-opacity data-ready:duration-fast data-ready:ease-soft in-data-command-palette:transition-none!"
340
350
  />
341
351
  )
342
352
  }
@@ -419,7 +429,7 @@ function CommandItem({
419
429
  <CommandPrimitive.Item
420
430
  data-slot="command-item"
421
431
  className={cn(
422
- "group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[selected=true]:bg-muted not-in-data-command-palette:data-[selected=true]:text-accent-foreground not-in-data-command-palette:data-[selected=true]:**:[svg]:text-accent-foreground in-data-[highlight=slide]:data-[selected=true]:bg-transparent! not-in-data-[highlight=slide]:data-[selected=true]:forced-colors:outline-2 not-in-data-[highlight=slide]:data-[selected=true]:forced-colors:-outline-offset-2 not-in-data-[highlight=slide]:data-[selected=true]:forced-colors:outline-solid not-in-data-[highlight=slide]:data-[selected=true]:forced-colors:outline-[Highlight] in-data-command-palette:h-10 in-data-command-palette:gap-3 in-data-command-palette:rounded-xl in-data-command-palette:px-2.5 in-data-command-palette:text-foreground-secondary in-data-command-palette:data-[selected=true]:text-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75] [&>svg:not([class*='opacity-'])]:opacity-55 [&>svg:not([class*='opacity-'])]:transition-[opacity,color] [&>svg:not([class*='opacity-'])]:duration-moderate not-in-data-command-palette:data-[selected=true]:[&>svg:not([class*='opacity-'])]:opacity-85 in-data-command-palette:[&>svg:not([class*='opacity-'])]:transition-none! in-data-command-palette:data-[selected=true]:[&>svg:not([class*='opacity-'])]:opacity-100 in-data-command-palette:data-[selected=true]:[&>svg:not([class*='opacity-'])]:text-brand-indicator",
432
+ "group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[selected=true]:bg-muted not-in-data-command-palette:data-[selected=true]:text-accent-foreground not-in-data-command-palette:data-[selected=true]:**:[svg]:text-accent-foreground in-data-[highlight=slide]:data-[selected=true]:bg-transparent! not-in-data-[highlight=slide]:data-[selected=true]:forced-colors:outline-2 not-in-data-[highlight=slide]:data-[selected=true]:forced-colors:-outline-offset-2 not-in-data-[highlight=slide]:data-[selected=true]:forced-colors:outline-solid not-in-data-[highlight=slide]:data-[selected=true]:forced-colors:outline-[Highlight] in-data-command-palette:h-10 in-data-command-palette:gap-3 in-data-command-palette:rounded-[calc(var(--radius-3xl)-8px)] in-data-command-palette:px-2.5 in-data-command-palette:text-foreground-secondary in-data-command-palette:data-[selected=true]:text-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75] [&>svg:not([class*='opacity-'])]:opacity-55 [&>svg:not([class*='opacity-'])]:transition-[opacity,color] [&>svg:not([class*='opacity-'])]:duration-moderate not-in-data-command-palette:data-[selected=true]:[&>svg:not([class*='opacity-'])]:opacity-85 in-data-command-palette:[&>svg:not([class*='opacity-'])]:transition-none! in-data-command-palette:data-[selected=true]:[&>svg:not([class*='opacity-'])]:opacity-100 in-data-command-palette:data-[selected=true]:[&>svg:not([class*='opacity-'])]:text-brand-indicator",
423
433
  className
424
434
  )}
425
435
  {...props}
@@ -58,7 +58,7 @@ function ContextMenuContent({
58
58
  >
59
59
  <ContextMenuPrimitive.Popup
60
60
  data-slot="context-menu-content"
61
- className={cn("bg-popover text-popover-foreground shadow-overlay rounded-xl p-1.25 z-50 max-h-(--available-height) min-w-36 overflow-x-hidden overflow-y-auto outline-none", popupMotion, className )}
61
+ className={cn("bg-popover text-popover-foreground shadow-overlay rounded-2xl p-1.25 z-50 max-h-(--available-height) min-w-36 overflow-x-hidden overflow-y-auto outline-none", popupMotion, className )}
62
62
  {...props}
63
63
  />
64
64
  </ContextMenuPrimitive.Positioner>
@@ -108,7 +108,7 @@ function ContextMenuItem({
108
108
  data-variant={variant}
109
109
  className={cn(
110
110
  menuItemDisabled,
111
- "not-data-disabled:focus:bg-muted not-data-disabled:focus:text-accent-foreground data-[variant=destructive]:text-destructive-text data-[variant=destructive]:not-data-disabled:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive-text data-[variant=destructive]:*:[svg]:text-destructive-text data-[variant=destructive]:[&>svg:not([class*='opacity-'])]:opacity-100 not-data-[variant=destructive]:not-data-disabled:focus:*:[svg]:text-accent-foreground group/context-menu-item relative flex min-h-8.5 cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-foreground-secondary outline-hidden select-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring data-inset:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75] [&>svg:not([class*='opacity-'])]:opacity-55 [&>svg:not([class*='opacity-'])]:transition-opacity [&>svg:not([class*='opacity-'])]:duration-moderate not-data-disabled:focus:[&>svg:not([class*='opacity-'])]:opacity-85",
111
+ "not-data-disabled:focus:bg-muted not-data-disabled:focus:text-accent-foreground data-[variant=destructive]:text-destructive-text data-[variant=destructive]:not-data-disabled:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive-text data-[variant=destructive]:*:[svg]:text-destructive-text data-[variant=destructive]:[&>svg:not([class*='opacity-'])]:opacity-100 not-data-[variant=destructive]:not-data-disabled:focus:*:[svg]:text-accent-foreground group/context-menu-item relative flex min-h-8.5 cursor-default items-center gap-2 rounded-[calc(var(--radius-2xl)-5px)] px-2 py-1.5 text-sm text-foreground-secondary outline-hidden select-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring data-inset:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75] [&>svg:not([class*='opacity-'])]:opacity-55 [&>svg:not([class*='opacity-'])]:transition-opacity [&>svg:not([class*='opacity-'])]:duration-moderate not-data-disabled:focus:[&>svg:not([class*='opacity-'])]:opacity-85",
112
112
  className
113
113
  )}
114
114
  {...props}
@@ -136,7 +136,7 @@ function ContextMenuSubTrigger({
136
136
  data-inset={inset}
137
137
  className={cn(
138
138
  menuItemDisabled,
139
- "not-data-disabled:focus:bg-muted not-data-disabled:focus:text-accent-foreground data-popup-open:bg-muted data-popup-open:text-accent-foreground relative flex min-h-8.5 cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-foreground-secondary outline-hidden select-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring data-inset:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75] [&>svg:not([class*='opacity-'])]:opacity-55 [&>svg:not([class*='opacity-'])]:transition-opacity [&>svg:not([class*='opacity-'])]:duration-moderate not-data-disabled:focus:[&>svg:not([class*='opacity-'])]:opacity-85",
139
+ "not-data-disabled:focus:bg-muted not-data-disabled:focus:text-accent-foreground data-popup-open:bg-muted data-popup-open:text-accent-foreground relative flex min-h-8.5 cursor-default items-center gap-2 rounded-[calc(var(--radius-2xl)-5px)] px-2 py-1.5 text-sm text-foreground-secondary outline-hidden select-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring data-inset:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75] [&>svg:not([class*='opacity-'])]:opacity-55 [&>svg:not([class*='opacity-'])]:transition-opacity [&>svg:not([class*='opacity-'])]:duration-moderate not-data-disabled:focus:[&>svg:not([class*='opacity-'])]:opacity-85",
140
140
  className
141
141
  )}
142
142
  {...props}
@@ -175,7 +175,7 @@ function ContextMenuCheckboxItem({
175
175
  className={cn(
176
176
  menuItemDisabled,
177
177
  menuCheckItem,
178
- "not-data-disabled:focus:bg-muted not-data-disabled:focus:text-accent-foreground relative flex min-h-8.5 cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-foreground-secondary outline-hidden select-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring data-inset:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75] [&>svg:not([class*='opacity-'])]:opacity-55 [&>svg:not([class*='opacity-'])]:transition-opacity [&>svg:not([class*='opacity-'])]:duration-moderate not-data-disabled:focus:[&>svg:not([class*='opacity-'])]:opacity-85 pe-8",
178
+ "not-data-disabled:focus:bg-muted not-data-disabled:focus:text-accent-foreground relative flex min-h-8.5 cursor-default items-center gap-2 rounded-[calc(var(--radius-2xl)-5px)] px-2 py-1.5 text-sm text-foreground-secondary outline-hidden select-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring data-inset:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75] [&>svg:not([class*='opacity-'])]:opacity-55 [&>svg:not([class*='opacity-'])]:transition-opacity [&>svg:not([class*='opacity-'])]:duration-moderate not-data-disabled:focus:[&>svg:not([class*='opacity-'])]:opacity-85 pe-8",
179
179
  className
180
180
  )}
181
181
  checked={checked}
@@ -215,7 +215,7 @@ function ContextMenuRadioItem({
215
215
  className={cn(
216
216
  menuItemDisabled,
217
217
  menuRadioItem,
218
- "not-data-disabled:focus:bg-muted not-data-disabled:focus:text-accent-foreground relative flex min-h-8.5 cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-foreground-secondary outline-hidden select-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring data-inset:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75] [&>svg:not([class*='opacity-'])]:opacity-55 [&>svg:not([class*='opacity-'])]:transition-opacity [&>svg:not([class*='opacity-'])]:duration-moderate not-data-disabled:focus:[&>svg:not([class*='opacity-'])]:opacity-85 pe-8",
218
+ "not-data-disabled:focus:bg-muted not-data-disabled:focus:text-accent-foreground relative flex min-h-8.5 cursor-default items-center gap-2 rounded-[calc(var(--radius-2xl)-5px)] px-2 py-1.5 text-sm text-foreground-secondary outline-hidden select-none focus-visible:outline-solid focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring data-inset:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='stroke-'])]:stroke-[1.75] [&>svg:not([class*='opacity-'])]:opacity-55 [&>svg:not([class*='opacity-'])]:transition-opacity [&>svg:not([class*='opacity-'])]:duration-moderate not-data-disabled:focus:[&>svg:not([class*='opacity-'])]:opacity-85 pe-8",
219
219
  className
220
220
  )}
221
221
  {...props}