@brightlocal/ui-components 2.26.0 → 3.0.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.
- package/README.md +9 -2
- package/component-meta.json +4010 -255
- package/deprecations.json +189 -2
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +2 -2
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.js +18 -18
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts +11 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +31 -28
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +4 -4
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +15 -11
- package/dist/blocks/empty-state.cjs +1 -0
- package/dist/blocks/empty-state.d.ts +172 -0
- package/dist/blocks/empty-state.d.ts.map +1 -0
- package/dist/blocks/empty-state.js +155 -0
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +124 -108
- package/dist/blocks/progress-state.cjs +1 -0
- package/dist/blocks/progress-state.d.ts +121 -0
- package/dist/blocks/progress-state.d.ts.map +1 -0
- package/dist/blocks/progress-state.js +368 -0
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +297 -296
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +44 -40
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +23 -23
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +37 -38
- package/dist/callout.cjs +1 -1
- package/dist/callout.d.ts +24 -2
- package/dist/callout.d.ts.map +1 -1
- package/dist/callout.js +57 -55
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +23 -2
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +94 -91
- package/dist/chart-empty.cjs +1 -0
- package/dist/chart-empty.d.ts +59 -0
- package/dist/chart-empty.d.ts.map +1 -0
- package/dist/chart-empty.js +29 -0
- package/dist/chart.cjs +6 -6
- package/dist/chart.d.ts +6 -1
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +183 -183
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +1 -1
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +47 -44
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +4 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +143 -141
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +74 -77
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +26 -29
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +182 -13
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +462 -314
- package/dist/description.cjs +1 -1
- package/dist/description.js +5 -5
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +20 -20
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +8 -11
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +17 -20
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +29 -25
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +58 -6
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +278 -194
- package/dist/grid.cjs +1 -0
- package/dist/grid.d.ts +56 -0
- package/dist/grid.d.ts.map +1 -0
- package/dist/grid.js +32 -0
- package/dist/header.d.ts +13 -0
- package/dist/header.d.ts.map +1 -1
- package/dist/hooks/use-delayed-pending.cjs +1 -0
- package/dist/hooks/use-delayed-pending.d.ts +34 -0
- package/dist/hooks/use-delayed-pending.d.ts.map +1 -0
- package/dist/hooks/use-delayed-pending.js +17 -0
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.js +13 -13
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +523 -494
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +25 -25
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +9 -9
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +9 -9
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.js +51 -51
- package/dist/input.cjs +1 -1
- package/dist/input.js +9 -9
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +25 -28
- package/dist/lib/block-illustration.cjs +1 -0
- package/dist/lib/block-illustration.d.ts +28 -0
- package/dist/lib/block-illustration.d.ts.map +1 -0
- package/dist/lib/block-illustration.js +21 -0
- package/dist/lib/empty-canvas.cjs +1 -0
- package/dist/lib/empty-canvas.d.ts +27 -0
- package/dist/lib/empty-canvas.d.ts.map +1 -0
- package/dist/lib/empty-canvas.js +62 -0
- package/dist/lib/motion.cjs +1 -1
- package/dist/lib/motion.js +10 -8
- package/dist/lib/optical-center.cjs +1 -0
- package/dist/lib/optical-center.d.ts +12 -0
- package/dist/lib/optical-center.d.ts.map +1 -0
- package/dist/lib/optical-center.js +11 -0
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +28 -5
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +8 -6
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +52 -20
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +87 -81
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts +60 -2
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +187 -164
- package/dist/media-empty.cjs +1 -0
- package/dist/media-empty.d.ts +72 -0
- package/dist/media-empty.d.ts.map +1 -0
- package/dist/media-empty.js +45 -0
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +17 -20
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.js +7 -7
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +127 -1
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +189 -98
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +37 -3
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +102 -64
- package/dist/route-progress.cjs +1 -0
- package/dist/route-progress.d.ts +103 -0
- package/dist/route-progress.d.ts.map +1 -0
- package/dist/route-progress.js +106 -0
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +19 -18
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +8 -8
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +35 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +103 -66
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +38 -3
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +43 -20
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +32 -36
- package/dist/spinner.cjs +1 -0
- package/dist/spinner.d.ts +57 -0
- package/dist/spinner.d.ts.map +1 -0
- package/dist/spinner.js +35 -0
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.d.ts.map +1 -1
- package/dist/stepper.js +23 -22
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +36 -29
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-reveal-motion.d.ts +10 -0
- package/dist/text-reveal-motion.d.ts.map +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +11 -11
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +8 -8
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +8 -8
- package/dist/typography-heading.cjs +1 -0
- package/dist/typography-heading.d.ts +116 -0
- package/dist/typography-heading.d.ts.map +1 -0
- package/dist/typography-heading.js +84 -0
- package/dist/typography-text.cjs +1 -0
- package/dist/typography-text.d.ts +113 -0
- package/dist/typography-text.d.ts.map +1 -0
- package/dist/typography-text.js +81 -0
- package/dist/typography.d.ts +13 -0
- package/dist/typography.d.ts.map +1 -1
- package/package.json +42 -2
- package/src/blocks/empty-state.tsx +424 -0
- package/src/blocks/input-list.tsx +66 -36
- package/src/blocks/progress-state.tsx +542 -0
- package/src/blocks/sidebar.tsx +46 -40
- package/src/components/accordion.tsx +2 -2
- package/src/components/alert-dialog.tsx +2 -2
- package/src/components/alert.tsx +27 -13
- package/src/components/avatar.tsx +1 -1
- package/src/components/badge.tsx +8 -4
- package/src/components/breadcrumb.tsx +9 -4
- package/src/components/button.tsx +5 -8
- package/src/components/calendar.tsx +5 -6
- package/src/components/callout.tsx +48 -15
- package/src/components/card.tsx +52 -17
- package/src/components/chart-empty.tsx +116 -0
- package/src/components/chart.tsx +43 -17
- package/src/components/chip.tsx +9 -6
- package/src/components/combobox.tsx +21 -12
- package/src/components/command.tsx +9 -10
- package/src/components/context-menu.tsx +6 -9
- package/src/components/data-table.tsx +405 -31
- package/src/components/description.tsx +1 -1
- package/src/components/dialog.tsx +2 -2
- package/src/components/drawer.tsx +2 -5
- package/src/components/dropdown-menu.tsx +8 -11
- package/src/components/field.tsx +8 -4
- package/src/components/global-layout.tsx +264 -65
- package/src/components/grid.tsx +130 -0
- package/src/components/header.tsx +13 -0
- package/src/components/hover-card.tsx +1 -1
- package/src/components/input-chip.tsx +1 -1
- package/src/components/input-group.tsx +1 -1
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +1 -1
- package/src/components/input.tsx +1 -1
- package/src/components/label.tsx +10 -13
- package/src/components/link.tsx +39 -5
- package/src/components/list.tsx +18 -14
- package/src/components/map.tsx +101 -5
- package/src/components/media-empty.tsx +156 -0
- package/src/components/menubar.tsx +7 -10
- package/src/components/navigation-menu.tsx +1 -1
- package/src/components/pagination.tsx +279 -1
- package/src/components/progress.tsx +120 -11
- package/src/components/route-progress.tsx +354 -0
- package/src/components/select.tsx +5 -4
- package/src/components/separator.tsx +1 -1
- package/src/components/sheet.tsx +89 -7
- package/src/components/skeleton.tsx +78 -7
- package/src/components/sonner.tsx +5 -14
- package/src/components/spinner.tsx +94 -0
- package/src/components/stepper.tsx +6 -7
- package/src/components/table.tsx +11 -4
- package/src/components/tabs.tsx +1 -1
- package/src/components/text-reveal-motion.tsx +10 -0
- package/src/components/textarea.tsx +1 -1
- package/src/components/toggle.tsx +1 -1
- package/src/components/tooltip.tsx +1 -1
- package/src/components/typography-heading.tsx +229 -0
- package/src/components/typography-text.tsx +225 -0
- package/src/components/typography.tsx +13 -0
- package/src/hooks/use-delayed-pending.ts +60 -0
- package/src/index.ts +12 -0
- package/src/lib/block-illustration.tsx +88 -0
- package/src/lib/empty-canvas.tsx +128 -0
- package/src/lib/optical-center.tsx +45 -0
- package/src/lib/utils.ts +26 -0
package/src/components/card.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
5
|
import { cva } from "class-variance-authority";
|
|
5
6
|
|
|
6
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
@@ -240,11 +241,17 @@ CardHeader.displayName = "CardHeader";
|
|
|
240
241
|
*/
|
|
241
242
|
type CardTitleSize = "small" | "default";
|
|
242
243
|
|
|
243
|
-
|
|
244
|
+
/**
|
|
245
|
+
* Document outline level for the CardTitle — renders the corresponding
|
|
246
|
+
* h2–h6 tag. There is no level 1: a card title is never the page title.
|
|
247
|
+
*/
|
|
248
|
+
type CardTitleLevel = 2 | 3 | 4 | 5 | 6;
|
|
249
|
+
|
|
250
|
+
const cardTitleVariants = cva("", {
|
|
244
251
|
variants: {
|
|
245
252
|
size: {
|
|
246
|
-
small: "text-
|
|
247
|
-
default: "text-
|
|
253
|
+
small: "text-heading-subsection",
|
|
254
|
+
default: "text-heading-section",
|
|
248
255
|
},
|
|
249
256
|
},
|
|
250
257
|
defaultVariants: {
|
|
@@ -261,21 +268,51 @@ type CardTitleProps = CardSubComponentProps & {
|
|
|
261
268
|
* @default "default"
|
|
262
269
|
*/
|
|
263
270
|
size?: CardTitleSize;
|
|
271
|
+
/**
|
|
272
|
+
* Document outline level — renders the title as the corresponding
|
|
273
|
+
* heading element (`h2`–`h6`). The DS never guesses a level: when
|
|
274
|
+
* omitted, the title renders as a `div` and stays out of the outline.
|
|
275
|
+
* Ignored when `asChild` is set.
|
|
276
|
+
* @example <CardTitle level={2}>Card Title</CardTitle>
|
|
277
|
+
*/
|
|
278
|
+
level?: CardTitleLevel;
|
|
279
|
+
/**
|
|
280
|
+
* Render as a different element using Radix Slot pattern.
|
|
281
|
+
* When true, merges props onto the child element so consumers can opt the
|
|
282
|
+
* title into the document outline (e.g. `<CardTitle asChild><h2>…</h2></CardTitle>`).
|
|
283
|
+
* Takes precedence over `level`.
|
|
284
|
+
* @default false
|
|
285
|
+
*/
|
|
286
|
+
asChild?: boolean;
|
|
264
287
|
};
|
|
265
288
|
|
|
266
289
|
/**
|
|
267
290
|
* Title element within the Card header.
|
|
268
291
|
*/
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
292
|
+
// HTMLElement, not HTMLDivElement: `level` renders h2–h6 and `asChild` an
|
|
293
|
+
// arbitrary element, so heading refs must type-check too.
|
|
294
|
+
const CardTitle = React.forwardRef<HTMLElement, CardTitleProps>(
|
|
295
|
+
(
|
|
296
|
+
{ className, size = "default", level, asChild = false, dataHook, ...props },
|
|
297
|
+
ref
|
|
298
|
+
) => {
|
|
299
|
+
const sharedProps = {
|
|
300
|
+
className: cn(cardTitleVariants({ size }), className),
|
|
301
|
+
"data-hook": dataHook,
|
|
302
|
+
"data-slot": "card-title",
|
|
303
|
+
...props,
|
|
304
|
+
};
|
|
305
|
+
if (asChild) {
|
|
306
|
+
return <Slot ref={ref} {...sharedProps} />;
|
|
307
|
+
}
|
|
308
|
+
if (level) {
|
|
309
|
+
const Heading = `h${level}` as const;
|
|
310
|
+
return (
|
|
311
|
+
<Heading ref={ref as React.Ref<HTMLHeadingElement>} {...sharedProps} />
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
return <div ref={ref as React.Ref<HTMLDivElement>} {...sharedProps} />;
|
|
315
|
+
}
|
|
279
316
|
);
|
|
280
317
|
CardTitle.displayName = "CardTitle";
|
|
281
318
|
|
|
@@ -286,10 +323,7 @@ const CardDescription = React.forwardRef<HTMLDivElement, CardSubComponentProps>(
|
|
|
286
323
|
({ className, dataHook, ...props }, ref) => (
|
|
287
324
|
<div
|
|
288
325
|
ref={ref}
|
|
289
|
-
className={cn(
|
|
290
|
-
"text-muted-foreground text-sm leading-normal font-normal",
|
|
291
|
-
className
|
|
292
|
-
)}
|
|
326
|
+
className={cn("text-body-sm text-muted-foreground", className)}
|
|
293
327
|
data-hook={dataHook}
|
|
294
328
|
data-slot="card-description"
|
|
295
329
|
{...props}
|
|
@@ -400,6 +434,7 @@ export type {
|
|
|
400
434
|
CardHeaderAlign,
|
|
401
435
|
CardTitleProps,
|
|
402
436
|
CardTitleSize,
|
|
437
|
+
CardTitleLevel,
|
|
403
438
|
CardVariant,
|
|
404
439
|
CardDensity,
|
|
405
440
|
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ChartColumn } from "@brightlocal/icons";
|
|
3
|
+
|
|
4
|
+
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
import { EmptyCanvas } from "../lib/empty-canvas";
|
|
6
|
+
|
|
7
|
+
/* -------------------------------------------------------------------------------------------------
|
|
8
|
+
* ChartEmpty
|
|
9
|
+
*
|
|
10
|
+
* The empty-canvas treatment for a chart's plot area (Patterns/Empty States →
|
|
11
|
+
* Charts, maps & images). Deliberately not the standard empty block: a canvas
|
|
12
|
+
* keeps quiet. The plot area becomes a muted surface at the chart's own
|
|
13
|
+
* reserved height, carrying one bare icon and one line — no title, no CTA, and
|
|
14
|
+
* no circle behind the icon, because a circle on a flat surface reads as a
|
|
15
|
+
* button.
|
|
16
|
+
*
|
|
17
|
+
* It lives in its own file rather than inside `chart.tsx` so that rendering an
|
|
18
|
+
* empty chart does not pull Recharts into the bundle — the one case where there
|
|
19
|
+
* is no chart to draw is the one case that should cost nothing. `/chart`
|
|
20
|
+
* re-exports it, so either import path works.
|
|
21
|
+
*
|
|
22
|
+
* A primitive, not a block: it composes nothing but its own surface, a glyph
|
|
23
|
+
* and a line. That body is shared with its two siblings through an internal
|
|
24
|
+
* helper — deliberately not through `EmptyState`, which is a block, and which
|
|
25
|
+
* a primitive must not depend on.
|
|
26
|
+
*
|
|
27
|
+
* THE SURROUNDINGS MUST AGREE. This component can only speak for the plot
|
|
28
|
+
* area; everything in the card has to tell the same story. A KPI beside an
|
|
29
|
+
* empty chart shows an em-dash (`text-metric`) and drops its trend badge — a
|
|
30
|
+
* number or a flat-0 trend next to "No data yet" is a contradiction the reader
|
|
31
|
+
* has to resolve, and they will resolve it as "this screen is broken".
|
|
32
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Props for the ChartEmpty component.
|
|
36
|
+
*/
|
|
37
|
+
export interface ChartEmptyProps extends Omit<
|
|
38
|
+
React.ComponentPropsWithoutRef<"div">,
|
|
39
|
+
"children" | "title"
|
|
40
|
+
> {
|
|
41
|
+
/**
|
|
42
|
+
* Required data-hook attribute for automated testing. The parts derive
|
|
43
|
+
* theirs from it: `-icon`, `-message`.
|
|
44
|
+
* @example "visibility-score-chart-empty"
|
|
45
|
+
*/
|
|
46
|
+
dataHook: string;
|
|
47
|
+
/**
|
|
48
|
+
* The glyph on the surface. Pass one that names the missing chart where a
|
|
49
|
+
* generic bar chart would be vague. The component sizes it.
|
|
50
|
+
* @default <ChartColumn strokeWidth={2} />
|
|
51
|
+
*/
|
|
52
|
+
icon?: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* The one line on the canvas. Domain copy in the reader's terms — "No
|
|
55
|
+
* ranking data yet" beats "No data yet" — with no trailing period.
|
|
56
|
+
* @default "No data yet"
|
|
57
|
+
*/
|
|
58
|
+
message?: string;
|
|
59
|
+
/**
|
|
60
|
+
* The height the chart had reserved. The consumer owns the box: this
|
|
61
|
+
* component only fills it, so the layout never shifts when data arrives.
|
|
62
|
+
* @example "h-36"
|
|
63
|
+
*/
|
|
64
|
+
className?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Tracking element identifier for analytics.
|
|
67
|
+
*/
|
|
68
|
+
trackingEl?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Tracking label for analytics context.
|
|
71
|
+
*/
|
|
72
|
+
trackingLabel?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* A chart's plot area with nothing to plot — a muted surface at the chart's
|
|
77
|
+
* reserved height, a bare icon, and one quiet line.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```tsx
|
|
81
|
+
* // The card's headline agrees: an em-dash, and no trend badge.
|
|
82
|
+
* <CardContent className="flex flex-col gap-2">
|
|
83
|
+
* <TypographySmall dataHook="metric-label">Visibility score</TypographySmall>
|
|
84
|
+
* <p className="text-metric">{hasData ? score : "—"}</p>
|
|
85
|
+
* {hasData ? (
|
|
86
|
+
* <MetricBarChart data={byPlatform} />
|
|
87
|
+
* ) : (
|
|
88
|
+
* <ChartEmpty className="h-36" dataHook="metric-chart-empty" />
|
|
89
|
+
* )}
|
|
90
|
+
* </CardContent>
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
const ChartEmpty = React.forwardRef<HTMLDivElement, ChartEmptyProps>(
|
|
94
|
+
(
|
|
95
|
+
{ className, dataHook, icon, message, trackingEl, trackingLabel, ...props },
|
|
96
|
+
ref
|
|
97
|
+
) => (
|
|
98
|
+
/* `w-full` and no height: the height is the consumer's, because only the
|
|
99
|
+
chart knows what it had reserved. */
|
|
100
|
+
<EmptyCanvas
|
|
101
|
+
ref={ref}
|
|
102
|
+
className={cn("w-full rounded-lg", className)}
|
|
103
|
+
dataHook={dataHook}
|
|
104
|
+
icon={icon ?? <ChartColumn strokeWidth={2} />}
|
|
105
|
+
message={message ?? "No data yet"}
|
|
106
|
+
slot="chart-empty"
|
|
107
|
+
trackingEl={trackingEl}
|
|
108
|
+
trackingLabel={trackingLabel}
|
|
109
|
+
{...props}
|
|
110
|
+
/>
|
|
111
|
+
)
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
ChartEmpty.displayName = "ChartEmpty";
|
|
115
|
+
|
|
116
|
+
export { ChartEmpty };
|
package/src/components/chart.tsx
CHANGED
|
@@ -124,7 +124,7 @@ const ChartContainer = React.forwardRef<HTMLDivElement, ChartContainerProps>(
|
|
|
124
124
|
<div
|
|
125
125
|
ref={ref}
|
|
126
126
|
className={cn(
|
|
127
|
-
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-polar-radius-axis-tick-value]:fill-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-pie-sector]:stroke-background flex aspect-video justify-center
|
|
127
|
+
"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-polar-radius-axis-tick-value]:fill-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-pie-sector]:stroke-background text-body-xs flex aspect-video justify-center [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-pie-sector]:stroke-2 [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none [&_svg_g]:outline-none [&_svg_g]:focus:outline-none",
|
|
128
128
|
className
|
|
129
129
|
)}
|
|
130
130
|
data-chart={chartId}
|
|
@@ -200,6 +200,19 @@ function ChartStyle({ id, config }: { id: string; config: ChartConfig }) {
|
|
|
200
200
|
// Chart Tooltip
|
|
201
201
|
// ============================================================================
|
|
202
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Whether a tooltip row has a value worth printing. Zero is a real value and
|
|
205
|
+
* must render; NaN/Infinity (a dataKey over a non-numeric field, a ratio with
|
|
206
|
+
* a zero denominator) and blank strings have nothing to show, so the value
|
|
207
|
+
* slot stays empty rather than reading "NaN".
|
|
208
|
+
*/
|
|
209
|
+
function isRenderableValue(value: unknown): boolean {
|
|
210
|
+
if (value == null || value === "") {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
return typeof value === "number" ? Number.isFinite(value) : true;
|
|
214
|
+
}
|
|
215
|
+
|
|
203
216
|
/**
|
|
204
217
|
* Props for the ChartTooltip component.
|
|
205
218
|
*/
|
|
@@ -330,7 +343,7 @@ function ChartTooltipContent({
|
|
|
330
343
|
return (
|
|
331
344
|
<div
|
|
332
345
|
className={cn(
|
|
333
|
-
"border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5
|
|
346
|
+
"border-border/50 bg-background text-body-xs grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 shadow-xl",
|
|
334
347
|
className
|
|
335
348
|
)}
|
|
336
349
|
data-slot="chart-tooltip-content"
|
|
@@ -351,7 +364,7 @@ function ChartTooltipContent({
|
|
|
351
364
|
indicator === "dot" && "items-center"
|
|
352
365
|
)}
|
|
353
366
|
>
|
|
354
|
-
{formatter && item?.value
|
|
367
|
+
{formatter && isRenderableValue(item?.value) && item.name ? (
|
|
355
368
|
formatter(item.value, item.name, item, index, payload)
|
|
356
369
|
) : (
|
|
357
370
|
<>
|
|
@@ -391,8 +404,8 @@ function ChartTooltipContent({
|
|
|
391
404
|
{itemConfig?.label || item.name}
|
|
392
405
|
</span>
|
|
393
406
|
</div>
|
|
394
|
-
{item.value && (
|
|
395
|
-
<span className="text-foreground
|
|
407
|
+
{isRenderableValue(item.value) && (
|
|
408
|
+
<span className="text-foreground tabular-nums">
|
|
396
409
|
{typeof item.value === "number"
|
|
397
410
|
? item.value.toLocaleString()
|
|
398
411
|
: item.value}
|
|
@@ -874,7 +887,7 @@ function ChartRadarLabelWrapper({
|
|
|
874
887
|
|
|
875
888
|
return (
|
|
876
889
|
<text
|
|
877
|
-
className="text-xs"
|
|
890
|
+
className="text-body-xs"
|
|
878
891
|
data-slot="chart-radar-label-wrapper"
|
|
879
892
|
textAnchor={textAnchor}
|
|
880
893
|
x={x}
|
|
@@ -966,7 +979,7 @@ function ChartPieLabelList({
|
|
|
966
979
|
|
|
967
980
|
return (
|
|
968
981
|
<text
|
|
969
|
-
className="fill-foreground text-xs"
|
|
982
|
+
className="fill-foreground text-body-xs"
|
|
970
983
|
data-slot="chart-pie-label-list"
|
|
971
984
|
dominantBaseline="middle"
|
|
972
985
|
textAnchor="middle"
|
|
@@ -1024,7 +1037,7 @@ function ChartPieLabelWrapper({
|
|
|
1024
1037
|
|
|
1025
1038
|
return (
|
|
1026
1039
|
<text
|
|
1027
|
-
className="fill-foreground text-xs"
|
|
1040
|
+
className="fill-foreground text-body-xs"
|
|
1028
1041
|
data-slot="chart-pie-label-wrapper"
|
|
1029
1042
|
dominantBaseline="middle"
|
|
1030
1043
|
textAnchor={textAnchor}
|
|
@@ -1056,7 +1069,8 @@ interface ChartCenterLabelProps {
|
|
|
1056
1069
|
/** Secondary label shown beneath the primary value. */
|
|
1057
1070
|
secondary?: React.ReactNode;
|
|
1058
1071
|
/**
|
|
1059
|
-
* Size of the primary value text.
|
|
1072
|
+
* Size of the primary value text. Every size keeps the `text-metric`
|
|
1073
|
+
* identity (Inter semibold); only the figure size scales.
|
|
1060
1074
|
* @default "3xl"
|
|
1061
1075
|
*/
|
|
1062
1076
|
size?: ChartCenterLabelSize;
|
|
@@ -1064,14 +1078,20 @@ interface ChartCenterLabelProps {
|
|
|
1064
1078
|
viewBox?: unknown;
|
|
1065
1079
|
}
|
|
1066
1080
|
|
|
1081
|
+
/* Only text-metric (24/28) exists on the type scale; the larger sizes are
|
|
1082
|
+
scaled variants of it carrying the same metric identity (Inter semibold)
|
|
1083
|
+
spelled out — twMerge registers scale styles as font-size atoms, so
|
|
1084
|
+
`text-metric text-4xl` would drop text-metric. */
|
|
1067
1085
|
const chartCenterLabelPrimarySize: Record<ChartCenterLabelSize, string> = {
|
|
1068
|
-
"2xl": "text-
|
|
1069
|
-
"3xl": "text-3xl",
|
|
1070
|
-
"4xl": "text-4xl
|
|
1086
|
+
"2xl": "text-metric",
|
|
1087
|
+
"3xl": "font-sans text-3xl font-semibold",
|
|
1088
|
+
"4xl": "font-sans text-4xl font-semibold",
|
|
1071
1089
|
};
|
|
1072
1090
|
|
|
1073
1091
|
/**
|
|
1074
1092
|
* ChartCenterLabel renders a centred primary value with an optional label.
|
|
1093
|
+
* The primary value is a KPI figure in the `text-metric` type-scale style;
|
|
1094
|
+
* `size` scales the figure.
|
|
1075
1095
|
*/
|
|
1076
1096
|
function ChartCenterLabel({
|
|
1077
1097
|
primary,
|
|
@@ -1099,10 +1119,7 @@ function ChartCenterLabel({
|
|
|
1099
1119
|
y={cy}
|
|
1100
1120
|
>
|
|
1101
1121
|
<tspan
|
|
1102
|
-
className={cn(
|
|
1103
|
-
"fill-foreground font-sans font-bold",
|
|
1104
|
-
chartCenterLabelPrimarySize[size]
|
|
1105
|
-
)}
|
|
1122
|
+
className={cn("fill-foreground", chartCenterLabelPrimarySize[size])}
|
|
1106
1123
|
x={cx}
|
|
1107
1124
|
y={cy}
|
|
1108
1125
|
>
|
|
@@ -1110,7 +1127,7 @@ function ChartCenterLabel({
|
|
|
1110
1127
|
</tspan>
|
|
1111
1128
|
{secondary != null && (
|
|
1112
1129
|
<tspan
|
|
1113
|
-
className="fill-muted-foreground
|
|
1130
|
+
className="fill-muted-foreground text-body-xs"
|
|
1114
1131
|
x={cx}
|
|
1115
1132
|
y={cy + 24}
|
|
1116
1133
|
>
|
|
@@ -1163,6 +1180,15 @@ export type {
|
|
|
1163
1180
|
ChartCenterLabelSize,
|
|
1164
1181
|
};
|
|
1165
1182
|
|
|
1183
|
+
/* ChartEmpty is defined in its own file so that a card showing "no data yet"
|
|
1184
|
+
need not pull Recharts in to say so — but it belongs to the chart family, so
|
|
1185
|
+
`/chart` exports it too and either import path works. It stays below the
|
|
1186
|
+
primary exports: the MCP indexer treats the file's first value export as the
|
|
1187
|
+
primary component when no export matches the file name, and `/chart`'s
|
|
1188
|
+
primary is ChartContainer. */
|
|
1189
|
+
export { ChartEmpty } from "./chart-empty";
|
|
1190
|
+
export type { ChartEmptyProps } from "./chart-empty";
|
|
1191
|
+
|
|
1166
1192
|
// Re-export Recharts components with aliases to avoid naming conflicts
|
|
1167
1193
|
export {
|
|
1168
1194
|
Area,
|
package/src/components/chip.tsx
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
|
-
import { X
|
|
5
|
+
import { X } from "@brightlocal/icons";
|
|
6
6
|
|
|
7
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
8
|
+
import { Spinner } from "@brightlocal/ui-components/spinner";
|
|
8
9
|
import {
|
|
9
10
|
Tooltip,
|
|
10
11
|
TooltipContent,
|
|
@@ -25,7 +26,6 @@ const chipVariants = cva(
|
|
|
25
26
|
"justify-center",
|
|
26
27
|
"gap-0.5",
|
|
27
28
|
"rounded-full",
|
|
28
|
-
"font-medium",
|
|
29
29
|
"whitespace-nowrap",
|
|
30
30
|
"shrink-0",
|
|
31
31
|
"select-none",
|
|
@@ -50,8 +50,11 @@ const chipVariants = cva(
|
|
|
50
50
|
{
|
|
51
51
|
variants: {
|
|
52
52
|
size: {
|
|
53
|
-
md: ["h-7", "pl-2.5", "pr-1", "text-
|
|
54
|
-
|
|
53
|
+
md: ["h-7", "pl-2.5", "pr-1", "text-label-sm"],
|
|
54
|
+
// A chip is a control: the bigger box steps up one label role, never
|
|
55
|
+
// onto a body size — mirrors Button (sm → label-sm, md/lg → label).
|
|
56
|
+
// Resolves the 16px off-scale flag from DS-925 (DS-966).
|
|
57
|
+
lg: ["h-8", "pl-4", "pr-2", "text-label"],
|
|
55
58
|
},
|
|
56
59
|
},
|
|
57
60
|
defaultVariants: {
|
|
@@ -173,7 +176,7 @@ const Chip = React.forwardRef<HTMLDivElement, ChipProps>(
|
|
|
173
176
|
ref
|
|
174
177
|
) => {
|
|
175
178
|
const isDisabled = disabled || loading;
|
|
176
|
-
const iconSize = size === "lg" ? 16 :
|
|
179
|
+
const iconSize = size === "lg" ? 16 : 14;
|
|
177
180
|
const labelRef = React.useRef<HTMLSpanElement>(null);
|
|
178
181
|
const [isTruncated, setIsTruncated] = React.useState(false);
|
|
179
182
|
|
|
@@ -232,7 +235,7 @@ const Chip = React.forwardRef<HTMLDivElement, ChipProps>(
|
|
|
232
235
|
data-slot="chip-loading"
|
|
233
236
|
role="status"
|
|
234
237
|
>
|
|
235
|
-
<
|
|
238
|
+
<Spinner size={size === "lg" ? "md" : "sm"} />
|
|
236
239
|
</span>
|
|
237
240
|
) : (
|
|
238
241
|
<button
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
CommandList,
|
|
23
23
|
CommandSeparator,
|
|
24
24
|
} from "@brightlocal/ui-components/command";
|
|
25
|
+
import { Spinner } from "@brightlocal/ui-components/spinner";
|
|
25
26
|
|
|
26
27
|
/* -------------------------------------------------------------------------------------------------
|
|
27
28
|
* Combobox Context
|
|
@@ -383,7 +384,7 @@ const comboboxTriggerVariants = cva([
|
|
|
383
384
|
"dark:bg-white/5 dark:border-white/15",
|
|
384
385
|
|
|
385
386
|
// Typography
|
|
386
|
-
"text-
|
|
387
|
+
"text-body text-foreground",
|
|
387
388
|
|
|
388
389
|
// Placeholder state
|
|
389
390
|
"data-[placeholder=true]:text-muted-foreground",
|
|
@@ -619,7 +620,7 @@ function ComboboxValue<T>({
|
|
|
619
620
|
return (
|
|
620
621
|
<span
|
|
621
622
|
className={cn(
|
|
622
|
-
"
|
|
623
|
+
"text-body overflow-hidden text-ellipsis whitespace-nowrap",
|
|
623
624
|
className
|
|
624
625
|
)}
|
|
625
626
|
data-slot="combobox-value"
|
|
@@ -1472,7 +1473,7 @@ const ComboboxItem = React.forwardRef<
|
|
|
1472
1473
|
return highlightText(
|
|
1473
1474
|
children,
|
|
1474
1475
|
highlight,
|
|
1475
|
-
highlightClassName || "text-
|
|
1476
|
+
highlightClassName || "text-label font-semibold"
|
|
1476
1477
|
);
|
|
1477
1478
|
}
|
|
1478
1479
|
return children;
|
|
@@ -1491,7 +1492,7 @@ const ComboboxItem = React.forwardRef<
|
|
|
1491
1492
|
aria-selected={isSelected}
|
|
1492
1493
|
aria-setsize={virtualCtx.filteredCount}
|
|
1493
1494
|
className={cn(
|
|
1494
|
-
"data-[highlighted=true]:bg-accent data-[highlighted=true]:text-accent-foreground relative flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-3
|
|
1495
|
+
"data-[highlighted=true]:bg-accent data-[highlighted=true]:text-accent-foreground text-label relative flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-3 outline-hidden select-none",
|
|
1495
1496
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1496
1497
|
isDisabled && "pointer-events-none opacity-50",
|
|
1497
1498
|
className
|
|
@@ -1579,8 +1580,10 @@ export interface ComboboxLoadingProps {
|
|
|
1579
1580
|
/** Children - custom loading content */
|
|
1580
1581
|
children?: React.ReactNode;
|
|
1581
1582
|
/**
|
|
1582
|
-
* Loading
|
|
1583
|
-
*
|
|
1583
|
+
* Loading announcement for assistive technologies (visually hidden).
|
|
1584
|
+
* The default loading state is a spinner only — the surrounding combobox
|
|
1585
|
+
* makes the context unambiguous, so visible text would be noise.
|
|
1586
|
+
* @default "Loading suggestions"
|
|
1584
1587
|
*/
|
|
1585
1588
|
loadingText?: string;
|
|
1586
1589
|
}
|
|
@@ -1594,7 +1597,14 @@ function ComboboxLoading({
|
|
|
1594
1597
|
<div
|
|
1595
1598
|
aria-live="polite"
|
|
1596
1599
|
className={cn(
|
|
1597
|
-
|
|
1600
|
+
// The entrance fade doubles as the flash-threshold appearance delay
|
|
1601
|
+
// (`both` holds the hidden start): a fetch that resolves inside the
|
|
1602
|
+
// flash zone never flashes a spinner, which would read slower than
|
|
1603
|
+
// no indicator at all. flash-delay draws the delay from
|
|
1604
|
+
// --ds-motion-flash-threshold — the same threshold useDelayedPending
|
|
1605
|
+
// mirrors in JS.
|
|
1606
|
+
"text-body-sm text-muted-foreground relative flex items-center justify-center gap-2 py-6",
|
|
1607
|
+
"animate-entrance-fade flash-delay",
|
|
1598
1608
|
className
|
|
1599
1609
|
)}
|
|
1600
1610
|
data-slot="combobox-loading"
|
|
@@ -1602,11 +1612,10 @@ function ComboboxLoading({
|
|
|
1602
1612
|
>
|
|
1603
1613
|
{children || (
|
|
1604
1614
|
<>
|
|
1605
|
-
<
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
{loadingText ?? "Loading..."}
|
|
1615
|
+
<Spinner size="md" />
|
|
1616
|
+
<span className="sr-only">
|
|
1617
|
+
{loadingText ?? "Loading suggestions"}
|
|
1618
|
+
</span>
|
|
1610
1619
|
</>
|
|
1611
1620
|
)}
|
|
1612
1621
|
</div>
|
|
@@ -249,7 +249,7 @@ const CommandInput = React.forwardRef<
|
|
|
249
249
|
<CommandPrimitive.Input
|
|
250
250
|
ref={inputRef}
|
|
251
251
|
className={cn(
|
|
252
|
-
"placeholder:text-muted-foreground flex w-full bg-transparent
|
|
252
|
+
"placeholder:text-muted-foreground text-body flex w-full bg-transparent outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
253
253
|
className
|
|
254
254
|
)}
|
|
255
255
|
data-slot="command-input"
|
|
@@ -262,7 +262,9 @@ const CommandInput = React.forwardRef<
|
|
|
262
262
|
{showClearButton && (
|
|
263
263
|
<Button
|
|
264
264
|
aria-label={clearSearchAriaLabel ?? "Clear search"}
|
|
265
|
-
|
|
265
|
+
/* Same square hit area as the DataTableSearch clear — a default
|
|
266
|
+
h-9 px-4 button hovers as a wide pill inside the field. */
|
|
267
|
+
className="text-muted-foreground hover:text-foreground size-6 p-0"
|
|
266
268
|
dataHook="command-input-clear"
|
|
267
269
|
variant="ghost"
|
|
268
270
|
onClick={handleClear}
|
|
@@ -352,7 +354,7 @@ const CommandEmpty = React.forwardRef<
|
|
|
352
354
|
ref={setRef}
|
|
353
355
|
aria-disabled="true"
|
|
354
356
|
aria-selected="false"
|
|
355
|
-
className="py-6 text-center
|
|
357
|
+
className="text-body-sm py-6 text-center"
|
|
356
358
|
data-hook={dataHook}
|
|
357
359
|
data-slot="command-empty"
|
|
358
360
|
{...props}
|
|
@@ -387,7 +389,7 @@ const CommandGroup = React.forwardRef<
|
|
|
387
389
|
<CommandPrimitive.Group
|
|
388
390
|
ref={ref}
|
|
389
391
|
className={cn(
|
|
390
|
-
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground
|
|
392
|
+
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-label-sm overflow-hidden px-2 py-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5",
|
|
391
393
|
className
|
|
392
394
|
)}
|
|
393
395
|
data-hook={dataHook}
|
|
@@ -480,7 +482,7 @@ const CommandItem = React.forwardRef<
|
|
|
480
482
|
<CommandPrimitive.Item
|
|
481
483
|
ref={ref}
|
|
482
484
|
className={cn(
|
|
483
|
-
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3
|
|
485
|
+
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-muted-foreground text-label relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
484
486
|
className
|
|
485
487
|
)}
|
|
486
488
|
data-hook={dataHook}
|
|
@@ -526,10 +528,7 @@ const CommandShortcut = React.forwardRef<HTMLSpanElement, CommandShortcutProps>(
|
|
|
526
528
|
({ className, dataHook, trackingEl, trackingLabel, ...props }, ref) => (
|
|
527
529
|
<span
|
|
528
530
|
ref={ref}
|
|
529
|
-
className={cn(
|
|
530
|
-
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
531
|
-
className
|
|
532
|
-
)}
|
|
531
|
+
className={cn("text-muted-foreground text-body-xs ml-auto", className)}
|
|
533
532
|
data-hook={dataHook}
|
|
534
533
|
data-slot="command-shortcut"
|
|
535
534
|
data-tracking-el={trackingEl}
|
|
@@ -976,7 +975,7 @@ const CommandVirtualItem = React.forwardRef<
|
|
|
976
975
|
aria-selected={selected || undefined}
|
|
977
976
|
aria-setsize={virtualCtx?.filteredCount}
|
|
978
977
|
className={cn(
|
|
979
|
-
"data-[highlighted=true]:bg-accent data-[highlighted=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3
|
|
978
|
+
"data-[highlighted=true]:bg-accent data-[highlighted=true]:text-accent-foreground text-label relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3 outline-hidden select-none",
|
|
980
979
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
981
980
|
disabled && "pointer-events-none opacity-50",
|
|
982
981
|
className
|
|
@@ -168,7 +168,7 @@ const ContextMenuSubTrigger = React.forwardRef<
|
|
|
168
168
|
<ContextMenuPrimitive.SubTrigger
|
|
169
169
|
ref={ref}
|
|
170
170
|
className={cn(
|
|
171
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5
|
|
171
|
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground text-label flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 outline-none select-none",
|
|
172
172
|
inset && "pl-8",
|
|
173
173
|
className
|
|
174
174
|
)}
|
|
@@ -284,7 +284,7 @@ const ContextMenuItem = React.forwardRef<
|
|
|
284
284
|
<ContextMenuPrimitive.Item
|
|
285
285
|
ref={ref}
|
|
286
286
|
className={cn(
|
|
287
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5
|
|
287
|
+
"focus:bg-accent focus:text-accent-foreground text-label relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
288
288
|
inset && "pl-8",
|
|
289
289
|
className
|
|
290
290
|
)}
|
|
@@ -341,7 +341,7 @@ const ContextMenuCheckboxItem = React.forwardRef<
|
|
|
341
341
|
ref={ref}
|
|
342
342
|
checked={checked}
|
|
343
343
|
className={cn(
|
|
344
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8
|
|
344
|
+
"focus:bg-accent focus:text-accent-foreground text-label relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
345
345
|
className
|
|
346
346
|
)}
|
|
347
347
|
data-hook={dataHook}
|
|
@@ -395,7 +395,7 @@ const ContextMenuRadioItem = React.forwardRef<
|
|
|
395
395
|
<ContextMenuPrimitive.RadioItem
|
|
396
396
|
ref={ref}
|
|
397
397
|
className={cn(
|
|
398
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8
|
|
398
|
+
"focus:bg-accent focus:text-accent-foreground text-label relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
399
399
|
className
|
|
400
400
|
)}
|
|
401
401
|
data-hook={dataHook}
|
|
@@ -437,7 +437,7 @@ const ContextMenuLabel = React.forwardRef<
|
|
|
437
437
|
<ContextMenuPrimitive.Label
|
|
438
438
|
ref={ref}
|
|
439
439
|
className={cn(
|
|
440
|
-
"text-foreground px-2 py-1.5
|
|
440
|
+
"text-foreground text-label-sm px-2 py-1.5",
|
|
441
441
|
inset && "pl-8",
|
|
442
442
|
className
|
|
443
443
|
)}
|
|
@@ -484,10 +484,7 @@ const ContextMenuShortcut = React.forwardRef<
|
|
|
484
484
|
>(({ className, ...props }, ref) => (
|
|
485
485
|
<span
|
|
486
486
|
ref={ref}
|
|
487
|
-
className={cn(
|
|
488
|
-
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
489
|
-
className
|
|
490
|
-
)}
|
|
487
|
+
className={cn("text-muted-foreground text-body-xs ml-auto", className)}
|
|
491
488
|
data-slot="context-menu-shortcut"
|
|
492
489
|
{...props}
|
|
493
490
|
/>
|