@brightlocal/ui-components 2.27.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 +6 -1
- package/component-meta.json +480 -126
- 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-screen.d.ts → progress-state.d.ts} +30 -18
- package/dist/blocks/progress-state.d.ts.map +1 -0
- package/dist/blocks/{progress-screen.js → progress-state.js} +100 -71
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +160 -161
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +11 -11
- 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.map +1 -1
- package/dist/chip.js +5 -3
- package/dist/combobox.cjs +2 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +81 -79
- 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 +44 -10
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +13 -11
- 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 +27 -1
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +18 -16
- 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 +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +512 -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/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/list.cjs +1 -1
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +62 -58
- 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 +2 -26
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +79 -118
- 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.js +2 -2
- 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.js +26 -26
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +40 -40
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +31 -28
- 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 +35 -7
- package/src/blocks/empty-state.tsx +424 -0
- package/src/blocks/input-list.tsx +66 -36
- package/src/blocks/{progress-screen.tsx → progress-state.tsx} +154 -93
- package/src/blocks/sidebar.tsx +25 -26
- 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 +1 -1
- package/src/components/button.tsx +3 -3
- 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 +5 -3
- package/src/components/combobox.tsx +12 -10
- package/src/components/command.tsx +9 -10
- package/src/components/context-menu.tsx +6 -9
- package/src/components/data-table.tsx +72 -17
- 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 +36 -3
- 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/list.tsx +13 -9
- 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 +35 -113
- package/src/components/select.tsx +5 -4
- package/src/components/separator.tsx +1 -1
- package/src/components/sheet.tsx +2 -2
- package/src/components/skeleton.tsx +78 -7
- package/src/components/sonner.tsx +2 -2
- package/src/components/stepper.tsx +3 -3
- package/src/components/table.tsx +6 -3
- 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 +10 -1
- 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/dist/blocks/progress-screen.cjs +0 -1
- package/dist/blocks/progress-screen.d.ts.map +0 -1
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
import { OpticalCenter } from "../lib/optical-center";
|
|
5
|
+
|
|
6
|
+
/* -------------------------------------------------------------------------------------------------
|
|
7
|
+
* Grid
|
|
8
|
+
*
|
|
9
|
+
* The layout primitive (DS-970): one component, one closed `variant` axis, and
|
|
10
|
+
* the modifiers each layout actually has — a discriminated union, so a prop
|
|
11
|
+
* that does not belong to a variant does not compile. The point is a learnable
|
|
12
|
+
* vocabulary: squads compose named layouts instead of hand-rolling flex/grid
|
|
13
|
+
* classNames, and the numbers those layouts agree on live here once.
|
|
14
|
+
*
|
|
15
|
+
* Variants ship as the family lands (see DS-970 for the inventory that sizes
|
|
16
|
+
* them):
|
|
17
|
+
*
|
|
18
|
+
* centered — one message held at the page body's OPTICAL centre.
|
|
19
|
+
* Shipped first because the single-message screens
|
|
20
|
+
* (`EmptyState size="lg"`, `ProgressState`) already share
|
|
21
|
+
* this agreement.
|
|
22
|
+
* stack / row / cards
|
|
23
|
+
* — vertical rhythm, inline cluster, responsive collections.
|
|
24
|
+
* Reserved: their closed props (gap scale, align, justify,
|
|
25
|
+
* cols) arrive with DS-970.
|
|
26
|
+
*
|
|
27
|
+
* `variant="centered"` is optical, not geometric: the content sits 38% down, not
|
|
28
|
+
* 50% (the derivation lives with the ratio in `lib/optical-center`). The ratio
|
|
29
|
+
* is the variant's only opinion and is deliberately not a prop. Not
|
|
30
|
+
* `CentredLayout`: that one owns the whole VIEWPORT (min-h-screen, background,
|
|
31
|
+
* padding) for pages outside the app shell — auth, invites. Grid owns nothing
|
|
32
|
+
* but the position inside whatever box it is given.
|
|
33
|
+
*
|
|
34
|
+
* The single-message blocks are deliberately NOT wired to this internally:
|
|
35
|
+
* `EmptyState size="lg"` is a pure visual block, and the page recipe is the
|
|
36
|
+
* composition `<Grid variant="centered"><EmptyState size="lg" /></Grid>` — so
|
|
37
|
+
* the same block can also sit in a custom position when a product needs one,
|
|
38
|
+
* without a prop to switch the layout off.
|
|
39
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The named layouts. Closed on purpose — a layout the vocabulary lacks is a
|
|
43
|
+
* signal to add a value here, not a className at the call site.
|
|
44
|
+
* (`stack`, `row`, `cards` are reserved for DS-970.)
|
|
45
|
+
*/
|
|
46
|
+
type GridVariant = "centered";
|
|
47
|
+
|
|
48
|
+
interface GridBaseProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
49
|
+
/**
|
|
50
|
+
* Required data-hook attribute for automated testing.
|
|
51
|
+
* @example "locations-empty-center"
|
|
52
|
+
*/
|
|
53
|
+
dataHook: string;
|
|
54
|
+
/**
|
|
55
|
+
* Tracking element identifier for analytics.
|
|
56
|
+
*/
|
|
57
|
+
trackingEl?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Tracking label for analytics context.
|
|
60
|
+
*/
|
|
61
|
+
trackingLabel?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* One message at the page body's optical centre (38/62). Give it a page body
|
|
66
|
+
* to fill — it stretches with `flex-1` — and one message to hold.
|
|
67
|
+
*/
|
|
68
|
+
interface GridCenteredProps extends GridBaseProps {
|
|
69
|
+
variant: "centered";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Props for the Grid primitive. `variant` discriminates the shapes; each
|
|
74
|
+
* variant carries only the modifiers it actually has.
|
|
75
|
+
*/
|
|
76
|
+
export type GridProps = GridCenteredProps;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The layout primitive: a closed vocabulary of named layouts instead of
|
|
80
|
+
* hand-rolled flex/grid classNames.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
84
|
+
* <GlobalLayoutContentBody dataHook="locations-body">
|
|
85
|
+
* <Grid dataHook="locations-empty-center" variant="centered">
|
|
86
|
+
* <EmptyState
|
|
87
|
+
* dataHook="locations-empty"
|
|
88
|
+
* illustration={<BusinessLocation aria-hidden />}
|
|
89
|
+
* size="lg"
|
|
90
|
+
* title={t("locations.empty.title")}
|
|
91
|
+
* />
|
|
92
|
+
* </Grid>
|
|
93
|
+
* </GlobalLayoutContentBody>
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
const Grid = React.forwardRef<HTMLDivElement, GridProps>(
|
|
97
|
+
(
|
|
98
|
+
{
|
|
99
|
+
className,
|
|
100
|
+
children,
|
|
101
|
+
dataHook,
|
|
102
|
+
variant,
|
|
103
|
+
trackingEl,
|
|
104
|
+
trackingLabel,
|
|
105
|
+
...props
|
|
106
|
+
},
|
|
107
|
+
ref
|
|
108
|
+
) => {
|
|
109
|
+
return (
|
|
110
|
+
<div
|
|
111
|
+
ref={ref}
|
|
112
|
+
className={cn("flex w-full flex-1 flex-col items-center", className)}
|
|
113
|
+
data-hook={dataHook}
|
|
114
|
+
data-slot="grid"
|
|
115
|
+
data-tracking-el={trackingEl ?? "grid"}
|
|
116
|
+
data-tracking-label={trackingLabel}
|
|
117
|
+
data-variant={variant}
|
|
118
|
+
{...props}
|
|
119
|
+
>
|
|
120
|
+
<OpticalCenter>{children}</OpticalCenter>
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
Grid.displayName = "Grid";
|
|
127
|
+
|
|
128
|
+
export { Grid };
|
|
129
|
+
|
|
130
|
+
export type { GridVariant };
|
|
@@ -35,6 +35,19 @@ const headerVariants = cva("flex w-full items-center", {
|
|
|
35
35
|
* <Logo dataHook="header-logo" />
|
|
36
36
|
* <NavigationMenu dataHook="header-nav" />
|
|
37
37
|
* </Header>
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // With the page title. The title is a TypographyHeading on the semantic
|
|
41
|
+
* // type scale (DS-714): text-heading-page — Poppins · Figma 600 · 24/32,
|
|
42
|
+
* // rendering one CSS weight lighter per the DS-305 offset. Never
|
|
43
|
+
* // hand-style it. `variant="page"` is level 1's default, written out so
|
|
44
|
+
* // the scale role is explicit. Exactly one page title per screen — a
|
|
45
|
+
* // second title is a section (`variant="section"`).
|
|
46
|
+
* <Header dataHook="page-header">
|
|
47
|
+
* <TypographyHeading level={1} variant="page" dataHook="page-title">
|
|
48
|
+
* All Locations
|
|
49
|
+
* </TypographyHeading>
|
|
50
|
+
* </Header>
|
|
38
51
|
*/
|
|
39
52
|
|
|
40
53
|
interface HeaderProps extends React.ComponentProps<"header"> {
|
|
@@ -89,7 +89,7 @@ const HoverCardTrigger = React.forwardRef<
|
|
|
89
89
|
ref={ref}
|
|
90
90
|
aria-disabled={disabled}
|
|
91
91
|
className={cn(
|
|
92
|
-
"text-link
|
|
92
|
+
"text-link text-label cursor-pointer underline",
|
|
93
93
|
disabled && "pointer-events-none cursor-not-allowed opacity-50",
|
|
94
94
|
className
|
|
95
95
|
)}
|
|
@@ -137,7 +137,7 @@ InputGroupAddon.displayName = "InputGroupAddon";
|
|
|
137
137
|
const inputGroupButtonVariants = cva(
|
|
138
138
|
[
|
|
139
139
|
"inline-flex items-center justify-center gap-2",
|
|
140
|
-
"text-
|
|
140
|
+
"text-label transition-colors duration-fast ease-out",
|
|
141
141
|
"outline-none focus-visible:shadow-default rounded-sm",
|
|
142
142
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
143
143
|
"text-muted-foreground hover:text-foreground",
|
|
@@ -137,7 +137,7 @@ function InputOTPSlot({ index, className, ...props }: InputOTPSlotProps) {
|
|
|
137
137
|
// Base styles
|
|
138
138
|
"relative flex h-9 w-9 items-center justify-center",
|
|
139
139
|
"border-input bg-background border-y border-r",
|
|
140
|
-
"text-foreground duration-fast text-
|
|
140
|
+
"text-foreground duration-fast text-body transition-[border-color,box-shadow] ease-out outline-none",
|
|
141
141
|
"first:rounded-l-md first:border-l last:rounded-r-md",
|
|
142
142
|
// Focus state
|
|
143
143
|
"data-[active=true]:border-ring data-[active=true]:z-10",
|
|
@@ -528,7 +528,7 @@ function InputPasswordStrength({
|
|
|
528
528
|
/>
|
|
529
529
|
{showLabel && (
|
|
530
530
|
<span
|
|
531
|
-
className="text-foreground w-10 shrink-0 text-right
|
|
531
|
+
className="text-foreground text-label w-10 shrink-0 text-right whitespace-nowrap"
|
|
532
532
|
data-hook={`${dataHook}-strength-label`}
|
|
533
533
|
>
|
|
534
534
|
{config.label}
|
package/src/components/input.tsx
CHANGED
|
@@ -16,7 +16,7 @@ export const inputVariants = cva(
|
|
|
16
16
|
"border border-input bg-background rounded-sm",
|
|
17
17
|
"outline-none transition-[border-color,box-shadow,background-color] duration-fast ease-out",
|
|
18
18
|
// Typography
|
|
19
|
-
"text-
|
|
19
|
+
"text-body",
|
|
20
20
|
"text-foreground",
|
|
21
21
|
"overflow-hidden text-ellipsis",
|
|
22
22
|
// States - Focus
|
package/src/components/label.tsx
CHANGED
|
@@ -5,20 +5,17 @@ import * as LabelPrimitive from "@radix-ui/react-label";
|
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
6
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
7
7
|
|
|
8
|
-
const labelVariants = cva(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
optional: {
|
|
13
|
-
true: "after:ml-1 after:content-['(optional)']",
|
|
14
|
-
},
|
|
15
|
-
srOnly: {
|
|
16
|
-
true: "sr-only",
|
|
17
|
-
},
|
|
8
|
+
const labelVariants = cva(["text-label", "text-foreground"], {
|
|
9
|
+
variants: {
|
|
10
|
+
optional: {
|
|
11
|
+
true: "after:ml-1 after:content-['(optional)']",
|
|
18
12
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
srOnly: {
|
|
14
|
+
true: "sr-only",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {},
|
|
18
|
+
});
|
|
22
19
|
|
|
23
20
|
interface LabelProps extends React.ComponentPropsWithoutRef<"label"> {
|
|
24
21
|
/**
|
package/src/components/list.tsx
CHANGED
|
@@ -232,10 +232,7 @@ const ItemTitle = React.forwardRef<HTMLDivElement, ItemTitleProps>(
|
|
|
232
232
|
({ className, ...props }, ref) => (
|
|
233
233
|
<div
|
|
234
234
|
ref={ref}
|
|
235
|
-
className={cn(
|
|
236
|
-
"text-foreground text-base leading-normal font-medium",
|
|
237
|
-
className
|
|
238
|
-
)}
|
|
235
|
+
className={cn("text-foreground text-body", className)}
|
|
239
236
|
data-slot="item-title"
|
|
240
237
|
{...props}
|
|
241
238
|
/>
|
|
@@ -257,10 +254,7 @@ const ItemDescription = React.forwardRef<HTMLDivElement, ItemDescriptionProps>(
|
|
|
257
254
|
({ className, ...props }, ref) => (
|
|
258
255
|
<div
|
|
259
256
|
ref={ref}
|
|
260
|
-
className={cn(
|
|
261
|
-
"text-muted-foreground text-sm leading-normal font-normal",
|
|
262
|
-
className
|
|
263
|
-
)}
|
|
257
|
+
className={cn("text-body-sm text-muted-foreground", className)}
|
|
264
258
|
data-slot="item-description"
|
|
265
259
|
{...props}
|
|
266
260
|
/>
|
|
@@ -322,7 +316,17 @@ const ItemSubheader = React.forwardRef<HTMLLIElement, ItemSubheaderProps>(
|
|
|
322
316
|
<li
|
|
323
317
|
ref={ref}
|
|
324
318
|
className={cn(
|
|
325
|
-
|
|
319
|
+
// A subheader is a caption over its group of items — the same role as a
|
|
320
|
+
// menu or sidebar group label, so text-label-sm (DS-925).
|
|
321
|
+
// Padding is deliberately asymmetric: with the old symmetric py-2 the
|
|
322
|
+
// caption sat equidistant between the previous group and its own
|
|
323
|
+
// (17px each side over the list's 8px gap), so it read as a second
|
|
324
|
+
// title rather than a label for the group below. 16px above / 4px
|
|
325
|
+
// below binds it downwards. The space above only has a job when a
|
|
326
|
+
// group precedes it, so a subheader that opens the list stays tight —
|
|
327
|
+
// that keeps compact surfaces (the Map popover, which sets gap-0
|
|
328
|
+
// inside p-3) from opening up.
|
|
329
|
+
"text-muted-foreground text-label-sm flex items-center pt-4 pr-2 pb-1 pl-4 first:pt-2",
|
|
326
330
|
className
|
|
327
331
|
)}
|
|
328
332
|
data-hook={dataHook}
|
package/src/components/map.tsx
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Map as MapIcon,
|
|
7
|
+
RefreshCw,
|
|
8
|
+
Store,
|
|
9
|
+
TriangleAlert,
|
|
10
|
+
} from "@brightlocal/icons";
|
|
6
11
|
import {
|
|
7
12
|
GlobeyFixingFault,
|
|
8
13
|
MapBackground as MapBackgroundImage,
|
|
@@ -18,6 +23,7 @@ import {
|
|
|
18
23
|
type PopoverAnchorProps,
|
|
19
24
|
type PopoverContentProps,
|
|
20
25
|
} from "@brightlocal/ui-components/popover";
|
|
26
|
+
import { EmptyCanvas } from "../lib/empty-canvas";
|
|
21
27
|
|
|
22
28
|
// ──────────────────────────────────────
|
|
23
29
|
// MapTypeId
|
|
@@ -289,7 +295,7 @@ const mapGridPinColorMap: Record<ResolvedVariant, string> = Object.fromEntries(
|
|
|
289
295
|
) as Record<ResolvedVariant, string>;
|
|
290
296
|
|
|
291
297
|
const mapGridPinVariants = cva(
|
|
292
|
-
"inline-flex items-center justify-center rounded-full
|
|
298
|
+
"inline-flex items-center justify-center rounded-full text-label font-semibold text-foreground dark:text-neutral-900 border-2 border-white shadow-sm transition-shadow duration-fast ease-out hover:shadow-md",
|
|
293
299
|
{
|
|
294
300
|
variants: {
|
|
295
301
|
variant: {
|
|
@@ -1096,14 +1102,14 @@ const MapErrorState = React.forwardRef<HTMLDivElement, MapErrorStateProps>(
|
|
|
1096
1102
|
</div>
|
|
1097
1103
|
<div className="flex flex-col gap-2">
|
|
1098
1104
|
<h3
|
|
1099
|
-
className="text-foreground text-
|
|
1105
|
+
className="text-foreground text-heading-subsection"
|
|
1100
1106
|
data-slot="map-error-title"
|
|
1101
1107
|
>
|
|
1102
1108
|
{title}
|
|
1103
1109
|
</h3>
|
|
1104
1110
|
{message && (
|
|
1105
1111
|
<p
|
|
1106
|
-
className="text-muted-foreground text-sm"
|
|
1112
|
+
className="text-muted-foreground text-body-sm"
|
|
1107
1113
|
data-slot="map-error-message"
|
|
1108
1114
|
>
|
|
1109
1115
|
{message}
|
|
@@ -1131,6 +1137,94 @@ const MapErrorState = React.forwardRef<HTMLDivElement, MapErrorStateProps>(
|
|
|
1131
1137
|
|
|
1132
1138
|
MapErrorState.displayName = "MapErrorState";
|
|
1133
1139
|
|
|
1140
|
+
// ──────────────────────────────────────
|
|
1141
|
+
// MapEmpty
|
|
1142
|
+
// ──────────────────────────────────────
|
|
1143
|
+
|
|
1144
|
+
/**
|
|
1145
|
+
* Props for the MapEmpty component.
|
|
1146
|
+
*/
|
|
1147
|
+
interface MapEmptyProps extends Omit<
|
|
1148
|
+
React.ComponentProps<"div">,
|
|
1149
|
+
"children" | "title"
|
|
1150
|
+
> {
|
|
1151
|
+
/**
|
|
1152
|
+
* Required data-hook attribute for automated testing. The parts derive
|
|
1153
|
+
* theirs from it: `-icon`, `-message`.
|
|
1154
|
+
* @example "rankings-grid-map-empty"
|
|
1155
|
+
*/
|
|
1156
|
+
dataHook: string;
|
|
1157
|
+
/**
|
|
1158
|
+
* The glyph on the surface. The component sizes it.
|
|
1159
|
+
* @default <Map strokeWidth={2} />
|
|
1160
|
+
*/
|
|
1161
|
+
icon?: React.ReactNode;
|
|
1162
|
+
/**
|
|
1163
|
+
* The one line on the surface. Domain copy — "No ranking data yet" rather
|
|
1164
|
+
* than a bare "No data" — with no trailing period.
|
|
1165
|
+
* @default "No data yet"
|
|
1166
|
+
*/
|
|
1167
|
+
message?: string;
|
|
1168
|
+
/** Analytics element identifier */
|
|
1169
|
+
trackingEl?: string;
|
|
1170
|
+
/** Analytics label */
|
|
1171
|
+
trackingLabel?: string;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* A map surface with nothing to plot — the map's reserved box filled with a
|
|
1176
|
+
* muted surface, a bare icon, and one quiet line.
|
|
1177
|
+
*
|
|
1178
|
+
* The rule this exists to enforce: **a map never renders pinless with no
|
|
1179
|
+
* message.** An empty map and a broken map look identical, so silence here
|
|
1180
|
+
* reads as a fault every time.
|
|
1181
|
+
*
|
|
1182
|
+
* Unlike its `MapLoadingState` and `MapErrorState` siblings it does not draw
|
|
1183
|
+
* the decorative map background. Those two are telling the reader that a real
|
|
1184
|
+
* map is coming or has failed, so a map-shaped backdrop is honest; here there
|
|
1185
|
+
* is nothing to show, and a pinless map behind the message would recreate the
|
|
1186
|
+
* exact confusion the message is there to clear up.
|
|
1187
|
+
*
|
|
1188
|
+
* The surroundings must agree: KPI tiles beside an empty map show em-dashes and
|
|
1189
|
+
* drop their trend badges.
|
|
1190
|
+
*
|
|
1191
|
+
* @example
|
|
1192
|
+
* ```tsx
|
|
1193
|
+
* <div className="h-[500px]">
|
|
1194
|
+
* {hasRuns ? (
|
|
1195
|
+
* <GridMap dataHook="rankings-grid-map" {...gridMap} />
|
|
1196
|
+
* ) : (
|
|
1197
|
+
* <MapEmpty
|
|
1198
|
+
* dataHook="rankings-grid-map-empty"
|
|
1199
|
+
* message={t("rankings.map.empty")}
|
|
1200
|
+
* />
|
|
1201
|
+
* )}
|
|
1202
|
+
* </div>
|
|
1203
|
+
* ```
|
|
1204
|
+
*/
|
|
1205
|
+
const MapEmpty = React.forwardRef<HTMLDivElement, MapEmptyProps>(
|
|
1206
|
+
(
|
|
1207
|
+
{ className, dataHook, icon, message, trackingEl, trackingLabel, ...props },
|
|
1208
|
+
ref
|
|
1209
|
+
) => (
|
|
1210
|
+
/* `h-full w-full`, matching MapLoadingState: a map is always given its box
|
|
1211
|
+
by the consumer, and this fills it so nothing reflows when runs arrive. */
|
|
1212
|
+
<EmptyCanvas
|
|
1213
|
+
ref={ref}
|
|
1214
|
+
className={cn("h-full w-full rounded-lg", className)}
|
|
1215
|
+
dataHook={dataHook}
|
|
1216
|
+
icon={icon ?? <MapIcon strokeWidth={2} />}
|
|
1217
|
+
message={message ?? "No data yet"}
|
|
1218
|
+
slot="map-empty"
|
|
1219
|
+
trackingEl={trackingEl}
|
|
1220
|
+
trackingLabel={trackingLabel}
|
|
1221
|
+
{...props}
|
|
1222
|
+
/>
|
|
1223
|
+
)
|
|
1224
|
+
);
|
|
1225
|
+
|
|
1226
|
+
MapEmpty.displayName = "MapEmpty";
|
|
1227
|
+
|
|
1134
1228
|
// ──────────────────────────────────────
|
|
1135
1229
|
// MapLegendItem
|
|
1136
1230
|
// ──────────────────────────────────────
|
|
@@ -1166,7 +1260,7 @@ const MapLegendItem = React.forwardRef<HTMLSpanElement, MapLegendItemProps>(
|
|
|
1166
1260
|
<span
|
|
1167
1261
|
ref={ref}
|
|
1168
1262
|
className={cn(
|
|
1169
|
-
"text-foreground flex items-center gap-1
|
|
1263
|
+
"text-foreground text-body-xs flex items-center gap-1",
|
|
1170
1264
|
className
|
|
1171
1265
|
)}
|
|
1172
1266
|
data-hook={dataHook}
|
|
@@ -1498,6 +1592,7 @@ export {
|
|
|
1498
1592
|
MapControlButton,
|
|
1499
1593
|
MapLoadingState,
|
|
1500
1594
|
MapErrorState,
|
|
1595
|
+
MapEmpty,
|
|
1501
1596
|
MapLegend,
|
|
1502
1597
|
MapLegendItem,
|
|
1503
1598
|
MapPopover,
|
|
@@ -1521,6 +1616,7 @@ export type {
|
|
|
1521
1616
|
MapControlButtonProps,
|
|
1522
1617
|
MapLoadingStateProps,
|
|
1523
1618
|
MapErrorStateProps,
|
|
1619
|
+
MapEmptyProps,
|
|
1524
1620
|
MapLegendProps,
|
|
1525
1621
|
MapLegendItemProps,
|
|
1526
1622
|
MapPopoverProps,
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Image, Video } from "@brightlocal/icons";
|
|
3
|
+
|
|
4
|
+
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
import { EmptyCanvas } from "../lib/empty-canvas";
|
|
6
|
+
|
|
7
|
+
/* -------------------------------------------------------------------------------------------------
|
|
8
|
+
* MediaEmpty
|
|
9
|
+
*
|
|
10
|
+
* The missing-media placeholder for a media slot (Patterns/Empty States →
|
|
11
|
+
* Charts, maps & images) — location photos, card media, video wells. Same
|
|
12
|
+
* canvas family as `ChartEmpty` and `MapEmpty`: a muted surface, a bare icon,
|
|
13
|
+
* one quiet line, no title and no CTA.
|
|
14
|
+
*
|
|
15
|
+
* One component, one `variant` axis — `image` and `video` are the same
|
|
16
|
+
* treatment with a different glyph and default line, so a second component
|
|
17
|
+
* would only be a second description of the same canvas. (It was born
|
|
18
|
+
* `ImageEmpty`; the name lied about half of its own variants.)
|
|
19
|
+
*
|
|
20
|
+
* Two decisions worth keeping:
|
|
21
|
+
*
|
|
22
|
+
* The icon is the plain `Image`/`Video` glyph, never `ImageOff`/`VideoOff`.
|
|
23
|
+
* This state is "media goes here", not "the media is broken" — the `…Off`
|
|
24
|
+
* glyphs tell the reader something failed, and nothing did.
|
|
25
|
+
*
|
|
26
|
+
* The component owns its own background. A media slot's frame — usually
|
|
27
|
+
* `AspectRatio` — is a layout primitive, and painting a surface on it from the
|
|
28
|
+
* outside means a `bg-muted` className override on a DS component, which the
|
|
29
|
+
* override policy rightly refuses. Absorbing the surface here settles that: the
|
|
30
|
+
* frame stays a frame, and the placeholder brings its own fill (DS-934).
|
|
31
|
+
*
|
|
32
|
+
* The frame is the consumer's and it stays put, so the layout never shifts when
|
|
33
|
+
* the media arrives — and anything overlaid on the frame (a status Badge in a
|
|
34
|
+
* corner) keeps working, because this fills the frame rather than replacing it.
|
|
35
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Which medium the slot holds. Picks the glyph and the default line — the
|
|
39
|
+
* treatment is identical.
|
|
40
|
+
*/
|
|
41
|
+
type MediaEmptyVariant = "image" | "video";
|
|
42
|
+
|
|
43
|
+
/** The glyph and default line per variant. */
|
|
44
|
+
const VARIANT_DEFAULTS: Record<
|
|
45
|
+
MediaEmptyVariant,
|
|
46
|
+
{ icon: React.ReactNode; message: string }
|
|
47
|
+
> = {
|
|
48
|
+
image: { icon: <Image strokeWidth={2} />, message: "No photo available" },
|
|
49
|
+
video: { icon: <Video strokeWidth={2} />, message: "No video available" },
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Props for the MediaEmpty component.
|
|
54
|
+
*/
|
|
55
|
+
export interface MediaEmptyProps extends Omit<
|
|
56
|
+
React.ComponentPropsWithoutRef<"div">,
|
|
57
|
+
"children" | "title"
|
|
58
|
+
> {
|
|
59
|
+
/**
|
|
60
|
+
* Required data-hook attribute for automated testing. The parts derive
|
|
61
|
+
* theirs from it: `-icon`, `-message`.
|
|
62
|
+
* @example "location-photo-empty"
|
|
63
|
+
*/
|
|
64
|
+
dataHook: string;
|
|
65
|
+
/**
|
|
66
|
+
* Which medium the slot holds — picks the glyph and the default line.
|
|
67
|
+
* @default "image"
|
|
68
|
+
*/
|
|
69
|
+
variant?: MediaEmptyVariant;
|
|
70
|
+
/**
|
|
71
|
+
* Overrides the variant's glyph, for a slot neither variant names.
|
|
72
|
+
* @default the variant's glyph
|
|
73
|
+
*/
|
|
74
|
+
icon?: React.ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* The one line under the glyph. No trailing period.
|
|
77
|
+
* @default "No photo available" at variant image, "No video available" at variant video
|
|
78
|
+
*/
|
|
79
|
+
message?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Tracking element identifier for analytics.
|
|
82
|
+
*/
|
|
83
|
+
trackingEl?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Tracking label for analytics context.
|
|
86
|
+
*/
|
|
87
|
+
trackingLabel?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* A media slot with nothing in it — the reserved frame, filled with a muted
|
|
92
|
+
* surface, a bare icon, and one quiet line.
|
|
93
|
+
*
|
|
94
|
+
* The frame is the consumer's: this fills it, and corners the consumer overlays
|
|
95
|
+
* on the frame keep rendering above it.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```tsx
|
|
99
|
+
* <AspectRatio dataHook="location-photo" ratio={16 / 9}>
|
|
100
|
+
* {photoUrl ? (
|
|
101
|
+
* <img alt={t("location.photo.alt", { businessName })} className="size-full object-cover" src={photoUrl} />
|
|
102
|
+
* ) : (
|
|
103
|
+
* <MediaEmpty dataHook="location-photo-empty" message={t("location.photo.empty")} />
|
|
104
|
+
* )}
|
|
105
|
+
* {status ? (
|
|
106
|
+
* <div className="absolute top-3 right-3">
|
|
107
|
+
* <LocationStatusBadge status={status} />
|
|
108
|
+
* </div>
|
|
109
|
+
* ) : null}
|
|
110
|
+
* </AspectRatio>
|
|
111
|
+
*
|
|
112
|
+
* // A video well: same canvas, the video glyph and line.
|
|
113
|
+
* <AspectRatio dataHook="tour-video" ratio={16 / 9}>
|
|
114
|
+
* <MediaEmpty dataHook="tour-video-empty" variant="video" />
|
|
115
|
+
* </AspectRatio>
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
const MediaEmpty = React.forwardRef<HTMLDivElement, MediaEmptyProps>(
|
|
119
|
+
(
|
|
120
|
+
{
|
|
121
|
+
className,
|
|
122
|
+
dataHook,
|
|
123
|
+
variant = "image",
|
|
124
|
+
icon,
|
|
125
|
+
message,
|
|
126
|
+
trackingEl,
|
|
127
|
+
trackingLabel,
|
|
128
|
+
...props
|
|
129
|
+
},
|
|
130
|
+
ref
|
|
131
|
+
) => (
|
|
132
|
+
/* `size-full`, unlike the chart and map placeholders: a media slot's frame
|
|
133
|
+
already has both dimensions — that is what reserving an aspect ratio
|
|
134
|
+
means — so this one fills rather than asking for a height. No radius
|
|
135
|
+
either: the frame clips, and a radius here would draw a second, smaller
|
|
136
|
+
corner inside the card's own. */
|
|
137
|
+
<EmptyCanvas
|
|
138
|
+
ref={ref}
|
|
139
|
+
className={cn("size-full", className)}
|
|
140
|
+
data-variant={variant}
|
|
141
|
+
dataHook={dataHook}
|
|
142
|
+
icon={icon ?? VARIANT_DEFAULTS[variant].icon}
|
|
143
|
+
message={message ?? VARIANT_DEFAULTS[variant].message}
|
|
144
|
+
slot="media-empty"
|
|
145
|
+
trackingEl={trackingEl}
|
|
146
|
+
trackingLabel={trackingLabel}
|
|
147
|
+
{...props}
|
|
148
|
+
/>
|
|
149
|
+
)
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
MediaEmpty.displayName = "MediaEmpty";
|
|
153
|
+
|
|
154
|
+
export { MediaEmpty };
|
|
155
|
+
|
|
156
|
+
export type { MediaEmptyVariant };
|
|
@@ -85,7 +85,7 @@ function MenubarTrigger({
|
|
|
85
85
|
return (
|
|
86
86
|
<MenubarPrimitive.Trigger
|
|
87
87
|
className={cn(
|
|
88
|
-
"text-foreground duration-fast flex cursor-pointer items-center justify-center gap-2 rounded-xs px-3 py-1
|
|
88
|
+
"text-foreground duration-fast text-label flex cursor-pointer items-center justify-center gap-2 rounded-xs px-3 py-1 transition-colors ease-out",
|
|
89
89
|
"hover:bg-accent hover:text-accent-foreground",
|
|
90
90
|
"focus:bg-accent focus:text-accent-foreground focus:outline-none",
|
|
91
91
|
"data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
|
@@ -147,7 +147,7 @@ function MenubarItem({
|
|
|
147
147
|
return (
|
|
148
148
|
<MenubarPrimitive.Item
|
|
149
149
|
className={cn(
|
|
150
|
-
"text-foreground duration-fast relative flex cursor-pointer items-center justify-between rounded-sm px-2 py-1.5
|
|
150
|
+
"text-foreground duration-fast text-label relative flex cursor-pointer items-center justify-between rounded-sm px-2 py-1.5 transition-colors ease-out outline-none",
|
|
151
151
|
"hover:bg-accent hover:text-foreground",
|
|
152
152
|
"focus:bg-accent focus:text-foreground",
|
|
153
153
|
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
@@ -191,7 +191,7 @@ function MenubarCheckboxItem({
|
|
|
191
191
|
<MenubarPrimitive.CheckboxItem
|
|
192
192
|
checked={checked}
|
|
193
193
|
className={cn(
|
|
194
|
-
"text-foreground duration-fast relative flex cursor-pointer items-center justify-between rounded-sm py-1.5 pr-2 pl-8
|
|
194
|
+
"text-foreground duration-fast text-label relative flex cursor-pointer items-center justify-between rounded-sm py-1.5 pr-2 pl-8 transition-colors ease-out outline-none",
|
|
195
195
|
"hover:bg-accent hover:text-foreground",
|
|
196
196
|
"focus:bg-accent focus:text-foreground",
|
|
197
197
|
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
@@ -268,7 +268,7 @@ function MenubarRadioItem({
|
|
|
268
268
|
return (
|
|
269
269
|
<MenubarPrimitive.RadioItem
|
|
270
270
|
className={cn(
|
|
271
|
-
"text-foreground duration-fast relative flex cursor-pointer items-center justify-between rounded-sm py-1.5 pr-2 pl-8
|
|
271
|
+
"text-foreground duration-fast text-label relative flex cursor-pointer items-center justify-between rounded-sm py-1.5 pr-2 pl-8 transition-colors ease-out outline-none",
|
|
272
272
|
"hover:bg-accent hover:text-foreground",
|
|
273
273
|
"focus:bg-accent focus:text-foreground",
|
|
274
274
|
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
@@ -310,7 +310,7 @@ function MenubarLabel({
|
|
|
310
310
|
return (
|
|
311
311
|
<MenubarPrimitive.Label
|
|
312
312
|
className={cn(
|
|
313
|
-
"text-foreground px-2 py-1.5
|
|
313
|
+
"text-foreground text-label-sm px-2 py-1.5",
|
|
314
314
|
inset && "pl-8",
|
|
315
315
|
className
|
|
316
316
|
)}
|
|
@@ -345,10 +345,7 @@ function MenubarShortcut({
|
|
|
345
345
|
}: React.HTMLAttributes<HTMLSpanElement>) {
|
|
346
346
|
return (
|
|
347
347
|
<span
|
|
348
|
-
className={cn(
|
|
349
|
-
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
350
|
-
className
|
|
351
|
-
)}
|
|
348
|
+
className={cn("text-muted-foreground text-body-xs ml-auto", className)}
|
|
352
349
|
data-slot="menubar-shortcut"
|
|
353
350
|
{...props}
|
|
354
351
|
/>
|
|
@@ -381,7 +378,7 @@ function MenubarSubTrigger({
|
|
|
381
378
|
return (
|
|
382
379
|
<MenubarPrimitive.SubTrigger
|
|
383
380
|
className={cn(
|
|
384
|
-
"text-foreground duration-fast flex cursor-pointer items-center justify-between rounded-xs px-2 py-1.5
|
|
381
|
+
"text-foreground duration-fast text-label flex cursor-pointer items-center justify-between rounded-xs px-2 py-1.5 transition-colors ease-out outline-none",
|
|
385
382
|
"hover:bg-accent hover:text-foreground",
|
|
386
383
|
"focus:bg-accent focus:text-foreground",
|
|
387
384
|
"data-[state=open]:bg-accent data-[state=open]:text-foreground",
|