@brightlocal/ui-components 0.1.3 → 0.1.4
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/dist/accordion.cjs +1 -1
- package/dist/accordion.js +1 -1
- package/dist/alert.cjs +1 -1
- package/dist/alert.js +1 -1
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.js +1 -1
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +37 -306
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +392 -489
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +4 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +33 -33
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +5 -18
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +21 -23
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +9 -17
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +104 -107
- package/dist/command.cjs +1 -1
- package/dist/command.js +1 -1
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +3 -0
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +5 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +348 -363
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +1 -1
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.js +1 -1
- package/dist/link.cjs +1 -1
- package/dist/link.js +1 -1
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +6 -4
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +18 -21
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +3 -0
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +31 -30
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.d.ts +6 -54
- package/dist/navigation-menu.d.ts.map +1 -1
- package/dist/navigation-menu.js +73 -84
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +8 -10
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +78 -86
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.d.ts +6 -23
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/radio-group.js +56 -66
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +19 -28
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +24 -40
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +4 -4
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +19 -21
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +5 -10
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +24 -26
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +17 -20
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +42 -45
- package/dist/switch.cjs +1 -1
- package/dist/switch.d.ts +2 -12
- package/dist/switch.d.ts.map +1 -1
- package/dist/switch.js +37 -41
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +16 -12
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +56 -58
- package/dist/tabs.d.ts +27 -3
- package/dist/tabs.d.ts.map +1 -1
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.d.ts +57 -7
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +60 -67
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.d.ts +12 -26
- package/dist/toggle.d.ts.map +1 -1
- package/dist/toggle.js +16 -20
- package/package.json +2 -2
- package/src/blocks/data-table.tsx +1 -1
- package/src/blocks/sidebar.tsx +157 -532
- package/src/components/accordion.tsx +1 -1
- package/src/components/alert.tsx +1 -1
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/button.tsx +1 -1
- package/src/components/calendar.tsx +6 -4
- package/src/components/centred-layout.tsx +11 -24
- package/src/components/checkbox.tsx +1 -1
- package/src/components/combobox.tsx +18 -26
- package/src/components/command.tsx +1 -1
- package/src/components/context-menu.tsx +1 -1
- package/src/components/date-picker.tsx +1 -1
- package/src/components/dialog.tsx +1 -1
- package/src/components/dropdown-menu.tsx +1 -1
- package/src/components/field.tsx +2 -0
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +1 -1
- package/src/components/link.tsx +1 -1
- package/src/components/logo.tsx +9 -7
- package/src/components/menubar.tsx +3 -1
- package/src/components/navigation-menu.tsx +37 -99
- package/src/components/pagination.tsx +13 -19
- package/src/components/radio-group.tsx +17 -38
- package/src/components/resizable.tsx +5 -43
- package/src/components/select.tsx +1 -1
- package/src/components/separator.tsx +5 -5
- package/src/components/sheet.tsx +6 -11
- package/src/components/sonner.tsx +24 -27
- package/src/components/switch.figma.tsx +7 -11
- package/src/components/switch.tsx +9 -19
- package/src/components/table.tsx +23 -18
- package/src/components/tabs.tsx +27 -3
- package/src/components/toggle-group.tsx +115 -86
- package/src/components/toggle.figma.tsx +13 -19
- package/src/components/toggle.tsx +20 -34
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
5
|
-
import { ChevronDownIcon } from "
|
|
5
|
+
import { ChevronDownIcon } from "@brightlocal/icons";
|
|
6
6
|
|
|
7
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
8
8
|
|
package/src/components/alert.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import { CircleCheck, Info, CircleX, TriangleAlert } from "
|
|
3
|
+
import { CircleCheck, Info, CircleX, TriangleAlert } from "@brightlocal/icons";
|
|
4
4
|
|
|
5
5
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
-
import { ChevronRight, MoreHorizontal } from "
|
|
3
|
+
import { ChevronRight, MoreHorizontal } from "@brightlocal/icons";
|
|
4
4
|
|
|
5
5
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
-
import { Loader2 } from "
|
|
4
|
+
import { Loader2 } from "@brightlocal/icons";
|
|
5
5
|
|
|
6
6
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { ChevronDown, ChevronLeft, ChevronRight } from "
|
|
4
|
+
import { ChevronDown, ChevronLeft, ChevronRight } from "@brightlocal/icons";
|
|
5
5
|
import {
|
|
6
6
|
DayButton,
|
|
7
7
|
DayPicker,
|
|
@@ -46,12 +46,12 @@ const navButtonStyles = cn(
|
|
|
46
46
|
* Custom day button component for the Calendar.
|
|
47
47
|
* Renders individual day cells with proper styling and selection states.
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
const CalendarDayButton = ({
|
|
50
50
|
className,
|
|
51
51
|
day,
|
|
52
52
|
modifiers,
|
|
53
53
|
...props
|
|
54
|
-
}: React.ComponentProps<typeof DayButton>) {
|
|
54
|
+
}: React.ComponentProps<typeof DayButton>) => {
|
|
55
55
|
const defaultClassNames = getDefaultClassNames();
|
|
56
56
|
const ref = React.useRef<HTMLButtonElement>(null);
|
|
57
57
|
|
|
@@ -88,7 +88,9 @@ function CalendarDayButton({
|
|
|
88
88
|
{...props}
|
|
89
89
|
/>
|
|
90
90
|
);
|
|
91
|
-
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
CalendarDayButton.displayName = "CalendarDayButton";
|
|
92
94
|
|
|
93
95
|
/**
|
|
94
96
|
* Calendar component for date and range selection.
|
|
@@ -18,25 +18,12 @@ import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Breakpoint variants for CentredLayout
|
|
21
|
+
* - xl: Extra large breakpoint (1280px max-width)
|
|
22
|
+
* - lg: Large breakpoint (1024px max-width)
|
|
23
|
+
* - md: Medium breakpoint (768px max-width)
|
|
24
|
+
* - sm: Small breakpoint (640px max-width)
|
|
21
25
|
*/
|
|
22
|
-
export
|
|
23
|
-
/**
|
|
24
|
-
* Extra large breakpoint (1280px max-width)
|
|
25
|
-
*/
|
|
26
|
-
XL = "xl",
|
|
27
|
-
/**
|
|
28
|
-
* Large breakpoint (1024px max-width)
|
|
29
|
-
*/
|
|
30
|
-
LG = "lg",
|
|
31
|
-
/**
|
|
32
|
-
* Medium breakpoint (768px max-width)
|
|
33
|
-
*/
|
|
34
|
-
MD = "md",
|
|
35
|
-
/**
|
|
36
|
-
* Small breakpoint (640px max-width)
|
|
37
|
-
*/
|
|
38
|
-
SM = "sm",
|
|
39
|
-
}
|
|
26
|
+
export type CentredLayoutBreakpoint = "xl" | "lg" | "md" | "sm";
|
|
40
27
|
|
|
41
28
|
interface CentredLayoutProps extends React.ComponentProps<"div"> {
|
|
42
29
|
/**
|
|
@@ -69,7 +56,7 @@ const CentredLayout = React.forwardRef<HTMLDivElement, CentredLayoutProps>(
|
|
|
69
56
|
(
|
|
70
57
|
{
|
|
71
58
|
className,
|
|
72
|
-
breakpoint =
|
|
59
|
+
breakpoint = "xl",
|
|
73
60
|
maxWidth,
|
|
74
61
|
children,
|
|
75
62
|
dataHook,
|
|
@@ -80,11 +67,11 @@ const CentredLayout = React.forwardRef<HTMLDivElement, CentredLayoutProps>(
|
|
|
80
67
|
ref
|
|
81
68
|
) => {
|
|
82
69
|
// Map breakpoints to Tailwind max-width utility classes
|
|
83
|
-
const breakpointMaxWidthClass = {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
const breakpointMaxWidthClass: Record<CentredLayoutBreakpoint, string> = {
|
|
71
|
+
xl: "max-w-7xl",
|
|
72
|
+
lg: "max-w-5xl",
|
|
73
|
+
md: "max-w-3xl",
|
|
74
|
+
sm: "max-w-2xl",
|
|
88
75
|
};
|
|
89
76
|
|
|
90
77
|
// If custom maxWidth is provided, use inline style; otherwise use Tailwind class
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
4
|
-
import { CheckIcon } from "
|
|
4
|
+
import { CheckIcon } from "@brightlocal/icons";
|
|
5
5
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
6
6
|
|
|
7
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
ChevronDownIcon,
|
|
7
7
|
CheckIcon,
|
|
8
8
|
type LucideIcon,
|
|
9
|
-
} from "
|
|
9
|
+
} from "@brightlocal/icons";
|
|
10
10
|
import { Checkbox } from "@brightlocal/ui-components/checkbox";
|
|
11
11
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
12
12
|
|
|
@@ -27,27 +27,19 @@ import {
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Visual style variants for Combobox
|
|
30
|
+
* - `default`: Default variant with standard combobox styling
|
|
31
|
+
* - `withGroupLabel`: Variant with group label showing category above selection
|
|
30
32
|
*/
|
|
31
|
-
export
|
|
32
|
-
/** Default variant with standard combobox styling */
|
|
33
|
-
DEFAULT = "default",
|
|
34
|
-
/** Variant with group label showing category above selection */
|
|
35
|
-
WITH_GROUP_LABEL = "withGroupLabel",
|
|
36
|
-
}
|
|
33
|
+
export type ComboboxVariant = "default" | "withGroupLabel";
|
|
37
34
|
|
|
38
35
|
/**
|
|
39
36
|
* Menu item type variants for Combobox dropdown items
|
|
37
|
+
* - `simple`: Simple text-only menu item
|
|
38
|
+
* - `checkbox`: Menu item with checkbox
|
|
39
|
+
* - `icon`: Menu item with icon
|
|
40
|
+
* - `avatar`: Menu item with avatar
|
|
40
41
|
*/
|
|
41
|
-
export
|
|
42
|
-
/** Simple text-only menu item */
|
|
43
|
-
SIMPLE = "simple",
|
|
44
|
-
/** Menu item with checkbox */
|
|
45
|
-
CHECKBOX = "checkbox",
|
|
46
|
-
/** Menu item with icon */
|
|
47
|
-
ICON = "icon",
|
|
48
|
-
/** Menu item with avatar */
|
|
49
|
-
AVATAR = "avatar",
|
|
50
|
-
}
|
|
42
|
+
export type ComboboxMenuItemType = "simple" | "checkbox" | "icon" | "avatar";
|
|
51
43
|
|
|
52
44
|
export interface ComboboxItem {
|
|
53
45
|
/** Unique value for the item */
|
|
@@ -197,7 +189,7 @@ const Combobox = React.forwardRef<HTMLButtonElement, ComboboxProps>(
|
|
|
197
189
|
(
|
|
198
190
|
{
|
|
199
191
|
id,
|
|
200
|
-
variant =
|
|
192
|
+
variant = "default",
|
|
201
193
|
dataHook,
|
|
202
194
|
trackingEl,
|
|
203
195
|
trackingLabel,
|
|
@@ -213,7 +205,7 @@ const Combobox = React.forwardRef<HTMLButtonElement, ComboboxProps>(
|
|
|
213
205
|
avatarSrc,
|
|
214
206
|
avatarFallback,
|
|
215
207
|
className,
|
|
216
|
-
menuItemType =
|
|
208
|
+
menuItemType = "simple",
|
|
217
209
|
"aria-label": ariaLabel,
|
|
218
210
|
},
|
|
219
211
|
ref
|
|
@@ -226,7 +218,7 @@ const Combobox = React.forwardRef<HTMLButtonElement, ComboboxProps>(
|
|
|
226
218
|
|
|
227
219
|
// Group items by their group property for withGroupLabel variant
|
|
228
220
|
const groupedItems = React.useMemo(() => {
|
|
229
|
-
if (variant !==
|
|
221
|
+
if (variant !== "withGroupLabel") {
|
|
230
222
|
return { "": items };
|
|
231
223
|
}
|
|
232
224
|
|
|
@@ -256,7 +248,7 @@ const Combobox = React.forwardRef<HTMLButtonElement, ComboboxProps>(
|
|
|
256
248
|
) : null;
|
|
257
249
|
|
|
258
250
|
switch (menuItemType) {
|
|
259
|
-
case
|
|
251
|
+
case "checkbox":
|
|
260
252
|
return (
|
|
261
253
|
<>
|
|
262
254
|
<Checkbox
|
|
@@ -267,7 +259,7 @@ const Combobox = React.forwardRef<HTMLButtonElement, ComboboxProps>(
|
|
|
267
259
|
<span className={MENU_ITEM_LABEL_CLASS}>{item.label}</span>
|
|
268
260
|
</>
|
|
269
261
|
);
|
|
270
|
-
case
|
|
262
|
+
case "icon":
|
|
271
263
|
return (
|
|
272
264
|
<>
|
|
273
265
|
{ItemIcon && (
|
|
@@ -277,7 +269,7 @@ const Combobox = React.forwardRef<HTMLButtonElement, ComboboxProps>(
|
|
|
277
269
|
{checkIcon}
|
|
278
270
|
</>
|
|
279
271
|
);
|
|
280
|
-
case
|
|
272
|
+
case "avatar":
|
|
281
273
|
return (
|
|
282
274
|
<>
|
|
283
275
|
<ComboboxAvatar
|
|
@@ -290,7 +282,7 @@ const Combobox = React.forwardRef<HTMLButtonElement, ComboboxProps>(
|
|
|
290
282
|
{checkIcon}
|
|
291
283
|
</>
|
|
292
284
|
);
|
|
293
|
-
case
|
|
285
|
+
case "simple":
|
|
294
286
|
default:
|
|
295
287
|
return (
|
|
296
288
|
<>
|
|
@@ -326,7 +318,7 @@ const Combobox = React.forwardRef<HTMLButtonElement, ComboboxProps>(
|
|
|
326
318
|
role="combobox"
|
|
327
319
|
type="button"
|
|
328
320
|
>
|
|
329
|
-
{variant ===
|
|
321
|
+
{variant === "withGroupLabel" ? (
|
|
330
322
|
<>
|
|
331
323
|
<div className="flex w-full flex-col items-start pr-6">
|
|
332
324
|
{groupLabel && (
|
|
@@ -376,7 +368,7 @@ const Combobox = React.forwardRef<HTMLButtonElement, ComboboxProps>(
|
|
|
376
368
|
/>
|
|
377
369
|
<CommandList>
|
|
378
370
|
<CommandEmpty>{emptyMessage}</CommandEmpty>
|
|
379
|
-
{variant ===
|
|
371
|
+
{variant === "withGroupLabel" &&
|
|
380
372
|
Object.keys(groupedItems).length > 1 ? (
|
|
381
373
|
Object.entries(groupedItems).map(([group, groupItems]) => (
|
|
382
374
|
<CommandGroup key={group} heading={group}>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Command as CommandPrimitive } from "cmdk";
|
|
5
|
-
import { CheckIcon, SearchIcon, XIcon } from "
|
|
5
|
+
import { CheckIcon, SearchIcon, XIcon } from "@brightlocal/icons";
|
|
6
6
|
|
|
7
7
|
import { Button } from "@brightlocal/ui-components/button";
|
|
8
8
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
4
|
-
import { Check, ChevronRight, Circle } from "
|
|
4
|
+
import { Check, ChevronRight, Circle } from "@brightlocal/icons";
|
|
5
5
|
|
|
6
6
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { format } from "date-fns";
|
|
5
|
-
import { Calendar as CalendarIcon } from "
|
|
5
|
+
import { Calendar as CalendarIcon } from "@brightlocal/icons";
|
|
6
6
|
import type { DateRange } from "react-day-picker";
|
|
7
7
|
|
|
8
8
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
5
|
-
import { Check, ChevronRight, Circle, ChevronsUpDown } from "
|
|
5
|
+
import { Check, ChevronRight, Circle, ChevronsUpDown } from "@brightlocal/icons";
|
|
6
6
|
|
|
7
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
8
8
|
|
package/src/components/field.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
REGEXP_ONLY_CHARS,
|
|
10
10
|
REGEXP_ONLY_DIGITS_AND_CHARS,
|
|
11
11
|
} from "input-otp";
|
|
12
|
-
import { MinusIcon } from "
|
|
12
|
+
import { MinusIcon } from "@brightlocal/icons";
|
|
13
13
|
|
|
14
14
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
15
15
|
import { Label } from "@brightlocal/ui-components/label";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { Eye, EyeOff } from "
|
|
4
|
+
import { Eye, EyeOff } from "@brightlocal/icons";
|
|
5
5
|
|
|
6
6
|
import { Progress } from "@brightlocal/ui-components/progress";
|
|
7
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
package/src/components/link.tsx
CHANGED
package/src/components/logo.tsx
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { cva, VariantProps } from "class-variance-authority";
|
|
2
2
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Visual style variants for the Logo component.
|
|
6
|
+
* - `logotype`: Full BrightLocal logo with text
|
|
7
|
+
* - `mark`: Icon-only logo mark
|
|
8
|
+
*/
|
|
9
|
+
export type LogoVariant = "logotype" | "mark";
|
|
8
10
|
|
|
9
11
|
const logoVariants = cva("inline-flex [&_path]:fill-primary", {
|
|
10
12
|
variants: {
|
|
@@ -14,7 +16,7 @@ const logoVariants = cva("inline-flex [&_path]:fill-primary", {
|
|
|
14
16
|
},
|
|
15
17
|
},
|
|
16
18
|
defaultVariants: {
|
|
17
|
-
variant:
|
|
19
|
+
variant: "logotype",
|
|
18
20
|
},
|
|
19
21
|
});
|
|
20
22
|
|
|
@@ -55,7 +57,7 @@ function Logo({
|
|
|
55
57
|
role="img"
|
|
56
58
|
{...props}
|
|
57
59
|
>
|
|
58
|
-
{variant ===
|
|
60
|
+
{variant === "logotype" && (
|
|
59
61
|
<svg
|
|
60
62
|
fill="none"
|
|
61
63
|
height="30"
|
|
@@ -73,7 +75,7 @@ function Logo({
|
|
|
73
75
|
</defs>
|
|
74
76
|
</svg>
|
|
75
77
|
)}
|
|
76
|
-
{variant ===
|
|
78
|
+
{variant === "mark" && (
|
|
77
79
|
<svg
|
|
78
80
|
fill="none"
|
|
79
81
|
height="21"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
4
|
-
import { Check, ChevronRight, Circle } from "
|
|
4
|
+
import { Check, ChevronRight, Circle } from "@brightlocal/icons";
|
|
5
5
|
|
|
6
6
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
7
7
|
|
|
@@ -53,6 +53,8 @@ function Menubar({
|
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
Menubar.displayName = "Menubar";
|
|
57
|
+
|
|
56
58
|
/**
|
|
57
59
|
* MenubarMenu - Individual menu within the menubar
|
|
58
60
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
5
|
-
import { ChevronDown } from "
|
|
5
|
+
import { ChevronDown } from "@brightlocal/icons";
|
|
6
6
|
|
|
7
7
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
8
8
|
|
|
@@ -78,25 +78,9 @@ NavigationMenuItem.displayName = "NavigationMenuItem";
|
|
|
78
78
|
/**
|
|
79
79
|
* Props for NavigationMenuTrigger component
|
|
80
80
|
*/
|
|
81
|
-
|
|
81
|
+
type NavigationMenuTriggerProps = React.ComponentPropsWithoutRef<
|
|
82
82
|
typeof NavigationMenuPrimitive.Trigger
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Data hook for automated testing (REQUIRED)
|
|
86
|
-
* Used to identify component in tests and E2E automation
|
|
87
|
-
*/
|
|
88
|
-
dataHook: string;
|
|
89
|
-
/**
|
|
90
|
-
* Tracking element identifier for analytics
|
|
91
|
-
* Defaults to component name if not provided
|
|
92
|
-
*/
|
|
93
|
-
trackingEl?: string;
|
|
94
|
-
/**
|
|
95
|
-
* Tracking label for analytics context
|
|
96
|
-
* Additional context for tracking events
|
|
97
|
-
*/
|
|
98
|
-
trackingLabel?: string;
|
|
99
|
-
}
|
|
83
|
+
>;
|
|
100
84
|
|
|
101
85
|
/**
|
|
102
86
|
* Trigger button that opens a dropdown menu
|
|
@@ -105,67 +89,43 @@ interface NavigationMenuTriggerProps extends React.ComponentPropsWithoutRef<
|
|
|
105
89
|
const NavigationMenuTrigger = React.forwardRef<
|
|
106
90
|
React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
|
|
107
91
|
NavigationMenuTriggerProps
|
|
108
|
-
>(
|
|
109
|
-
|
|
110
|
-
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
{children}
|
|
137
|
-
<ChevronDown
|
|
138
|
-
aria-hidden="true"
|
|
139
|
-
className="relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180"
|
|
140
|
-
/>
|
|
141
|
-
</NavigationMenuPrimitive.Trigger>
|
|
142
|
-
)
|
|
143
|
-
);
|
|
92
|
+
>(({ className, children, ...props }, ref) => (
|
|
93
|
+
<NavigationMenuPrimitive.Trigger
|
|
94
|
+
ref={ref}
|
|
95
|
+
className={cn(
|
|
96
|
+
[
|
|
97
|
+
"group inline-flex h-9 w-max items-center justify-center gap-1",
|
|
98
|
+
"rounded-md px-4 py-2",
|
|
99
|
+
"text-sm font-medium",
|
|
100
|
+
"text-foreground",
|
|
101
|
+
"transition-colors",
|
|
102
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
103
|
+
"focus:bg-accent focus:text-accent-foreground",
|
|
104
|
+
"focus-visible:bg-accent focus-visible:ring-ring focus-visible:shadow-[0_0_0_4px_rgba(163,163,163,0.1)] focus-visible:ring-1 focus-visible:outline-none",
|
|
105
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
106
|
+
"data-[state=open]:bg-accent/50",
|
|
107
|
+
],
|
|
108
|
+
className
|
|
109
|
+
)}
|
|
110
|
+
data-slot="navigation-menu-trigger"
|
|
111
|
+
{...props}
|
|
112
|
+
>
|
|
113
|
+
{children}
|
|
114
|
+
<ChevronDown
|
|
115
|
+
aria-hidden="true"
|
|
116
|
+
className="relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180"
|
|
117
|
+
/>
|
|
118
|
+
</NavigationMenuPrimitive.Trigger>
|
|
119
|
+
));
|
|
144
120
|
|
|
145
121
|
NavigationMenuTrigger.displayName = "NavigationMenuTrigger";
|
|
146
122
|
|
|
147
123
|
/**
|
|
148
124
|
* Props for NavigationMenuContent component
|
|
149
125
|
*/
|
|
150
|
-
|
|
126
|
+
type NavigationMenuContentProps = React.ComponentPropsWithoutRef<
|
|
151
127
|
typeof NavigationMenuPrimitive.Content
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Data hook for automated testing (REQUIRED)
|
|
155
|
-
* Used to identify component in tests and E2E automation
|
|
156
|
-
*/
|
|
157
|
-
dataHook: string;
|
|
158
|
-
/**
|
|
159
|
-
* Tracking element identifier for analytics
|
|
160
|
-
* Defaults to component name if not provided
|
|
161
|
-
*/
|
|
162
|
-
trackingEl?: string;
|
|
163
|
-
/**
|
|
164
|
-
* Tracking label for analytics context
|
|
165
|
-
* Additional context for tracking events
|
|
166
|
-
*/
|
|
167
|
-
trackingLabel?: string;
|
|
168
|
-
}
|
|
128
|
+
>;
|
|
169
129
|
|
|
170
130
|
/**
|
|
171
131
|
* Dropdown content container
|
|
@@ -174,7 +134,7 @@ interface NavigationMenuContentProps extends React.ComponentPropsWithoutRef<
|
|
|
174
134
|
const NavigationMenuContent = React.forwardRef<
|
|
175
135
|
React.ElementRef<typeof NavigationMenuPrimitive.Content>,
|
|
176
136
|
NavigationMenuContentProps
|
|
177
|
-
>(({ className,
|
|
137
|
+
>(({ className, ...props }, ref) => (
|
|
178
138
|
<NavigationMenuPrimitive.Content
|
|
179
139
|
ref={ref}
|
|
180
140
|
className={cn(
|
|
@@ -187,10 +147,7 @@ const NavigationMenuContent = React.forwardRef<
|
|
|
187
147
|
],
|
|
188
148
|
className
|
|
189
149
|
)}
|
|
190
|
-
data-hook={dataHook}
|
|
191
150
|
data-slot="navigation-menu-content"
|
|
192
|
-
data-tracking-el={trackingEl || "navigation-menu-content"}
|
|
193
|
-
data-tracking-label={trackingLabel}
|
|
194
151
|
{...props}
|
|
195
152
|
/>
|
|
196
153
|
));
|
|
@@ -200,25 +157,9 @@ NavigationMenuContent.displayName = "NavigationMenuContent";
|
|
|
200
157
|
/**
|
|
201
158
|
* Props for NavigationMenuLink component
|
|
202
159
|
*/
|
|
203
|
-
|
|
160
|
+
type NavigationMenuLinkProps = React.ComponentPropsWithoutRef<
|
|
204
161
|
typeof NavigationMenuPrimitive.Link
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Data hook for automated testing (REQUIRED)
|
|
208
|
-
* Used to identify component in tests and E2E automation
|
|
209
|
-
*/
|
|
210
|
-
dataHook: string;
|
|
211
|
-
/**
|
|
212
|
-
* Tracking element identifier for analytics
|
|
213
|
-
* Defaults to component name if not provided
|
|
214
|
-
*/
|
|
215
|
-
trackingEl?: string;
|
|
216
|
-
/**
|
|
217
|
-
* Tracking label for analytics context
|
|
218
|
-
* Additional context for tracking events
|
|
219
|
-
*/
|
|
220
|
-
trackingLabel?: string;
|
|
221
|
-
}
|
|
162
|
+
>;
|
|
222
163
|
|
|
223
164
|
/**
|
|
224
165
|
* Navigation link within the menu
|
|
@@ -227,7 +168,7 @@ interface NavigationMenuLinkProps extends React.ComponentPropsWithoutRef<
|
|
|
227
168
|
const NavigationMenuLink = React.forwardRef<
|
|
228
169
|
React.ElementRef<typeof NavigationMenuPrimitive.Link>,
|
|
229
170
|
NavigationMenuLinkProps
|
|
230
|
-
>(({ className,
|
|
171
|
+
>(({ className, ...props }, ref) => (
|
|
231
172
|
<NavigationMenuPrimitive.Link
|
|
232
173
|
ref={ref}
|
|
233
174
|
className={cn(
|
|
@@ -240,10 +181,7 @@ const NavigationMenuLink = React.forwardRef<
|
|
|
240
181
|
],
|
|
241
182
|
className
|
|
242
183
|
)}
|
|
243
|
-
data-hook={dataHook}
|
|
244
184
|
data-slot="navigation-menu-link"
|
|
245
|
-
data-tracking-el={trackingEl || "navigation-menu-link"}
|
|
246
|
-
data-tracking-label={trackingLabel}
|
|
247
185
|
{...props}
|
|
248
186
|
/>
|
|
249
187
|
));
|