@brightlocal/ui-components 0.1.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/LICENSE +21 -0
- package/README.md +349 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.d.ts +32 -0
- package/dist/accordion.d.ts.map +1 -0
- package/dist/accordion.js +107 -0
- package/dist/alert-dialog.cjs +1 -0
- package/dist/alert-dialog.d.ts +15 -0
- package/dist/alert-dialog.d.ts.map +1 -0
- package/dist/alert-dialog.js +146 -0
- package/dist/alert.cjs +1 -0
- package/dist/alert.d.ts +16 -0
- package/dist/alert.d.ts.map +1 -0
- package/dist/alert.js +174 -0
- package/dist/aspect-ratio.cjs +1 -0
- package/dist/aspect-ratio.d.ts +10 -0
- package/dist/aspect-ratio.d.ts.map +1 -0
- package/dist/aspect-ratio.js +22 -0
- package/dist/avatar.cjs +1 -0
- package/dist/avatar.d.ts +11 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/avatar.js +46 -0
- package/dist/badge.cjs +1 -0
- package/dist/badge.d.ts +19 -0
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +50 -0
- package/dist/blocks/data-table.cjs +1 -0
- package/dist/blocks/data-table.d.ts +303 -0
- package/dist/blocks/data-table.d.ts.map +1 -0
- package/dist/blocks/data-table.js +555 -0
- package/dist/blocks/sidebar.cjs +1 -0
- package/dist/blocks/sidebar.d.ts +744 -0
- package/dist/blocks/sidebar.d.ts.map +1 -0
- package/dist/blocks/sidebar.js +839 -0
- package/dist/breadcrumb.cjs +1 -0
- package/dist/breadcrumb.d.ts +12 -0
- package/dist/breadcrumb.d.ts.map +1 -0
- package/dist/breadcrumb.js +102 -0
- package/dist/button.cjs +1 -0
- package/dist/button.d.ts +73 -0
- package/dist/button.d.ts.map +1 -0
- package/dist/button.js +195 -0
- package/dist/calendar.cjs +1 -0
- package/dist/calendar.d.ts +28 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +191 -0
- package/dist/card.cjs +1 -0
- package/dist/card.d.ts +28 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +131 -0
- package/dist/carousel.cjs +1 -0
- package/dist/carousel.d.ts +21 -0
- package/dist/carousel.d.ts.map +1 -0
- package/dist/carousel.js +185 -0
- package/dist/centred-layout.cjs +1 -0
- package/dist/centred-layout.d.ts +49 -0
- package/dist/centred-layout.d.ts.map +1 -0
- package/dist/centred-layout.js +35 -0
- package/dist/chart.cjs +10 -0
- package/dist/chart.d.ts +83 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +254 -0
- package/dist/checkbox.cjs +1 -0
- package/dist/checkbox.d.ts +15 -0
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/checkbox.js +96 -0
- package/dist/collapsible.cjs +1 -0
- package/dist/collapsible.d.ts +18 -0
- package/dist/collapsible.d.ts.map +1 -0
- package/dist/collapsible.js +58 -0
- package/dist/combobox.cjs +1 -0
- package/dist/combobox.d.ts +65 -0
- package/dist/combobox.d.ts.map +1 -0
- package/dist/combobox.js +203 -0
- package/dist/command.cjs +1 -0
- package/dist/command.d.ts +44 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +166 -0
- package/dist/context-menu.cjs +1 -0
- package/dist/context-menu.d.ts +42 -0
- package/dist/context-menu.d.ts.map +1 -0
- package/dist/context-menu.js +226 -0
- package/dist/date-picker.cjs +1 -0
- package/dist/date-picker.d.ts +54 -0
- package/dist/date-picker.d.ts.map +1 -0
- package/dist/date-picker.js +95 -0
- package/dist/dialog.cjs +1 -0
- package/dist/dialog.d.ts +20 -0
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dialog.js +130 -0
- package/dist/drawer.cjs +1 -0
- package/dist/drawer.d.ts +22 -0
- package/dist/drawer.d.ts.map +1 -0
- package/dist/drawer.js +149 -0
- package/dist/dropdown-menu.cjs +1 -0
- package/dist/dropdown-menu.d.ts +253 -0
- package/dist/dropdown-menu.d.ts.map +1 -0
- package/dist/dropdown-menu.js +325 -0
- package/dist/field.cjs +1 -0
- package/dist/field.d.ts +21 -0
- package/dist/field.d.ts.map +1 -0
- package/dist/field.js +148 -0
- package/dist/global-layout.cjs +1 -0
- package/dist/global-layout.d.ts +60 -0
- package/dist/global-layout.d.ts.map +1 -0
- package/dist/global-layout.js +87 -0
- package/dist/hooks/use-mobile.cjs +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hover-card.cjs +1 -0
- package/dist/hover-card.d.ts +43 -0
- package/dist/hover-card.d.ts.map +1 -0
- package/dist/hover-card.js +71 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +412 -0
- package/dist/input-base.cjs +1 -0
- package/dist/input-base.d.ts +28 -0
- package/dist/input-base.d.ts.map +1 -0
- package/dist/input-base.js +56 -0
- package/dist/input-group.cjs +1 -0
- package/dist/input-group.d.ts +26 -0
- package/dist/input-group.d.ts.map +1 -0
- package/dist/input-group.js +116 -0
- package/dist/input-otp.cjs +1 -0
- package/dist/input-otp.d.ts +45 -0
- package/dist/input-otp.d.ts.map +1 -0
- package/dist/input-otp.js +186 -0
- package/dist/input-password.cjs +1 -0
- package/dist/input-password.d.ts +38 -0
- package/dist/input-password.d.ts.map +1 -0
- package/dist/input-password.js +101 -0
- package/dist/input.cjs +1 -0
- package/dist/input.d.ts +32 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +146 -0
- package/dist/label.cjs +1 -0
- package/dist/label.d.ts +12 -0
- package/dist/label.d.ts.map +1 -0
- package/dist/label.js +34 -0
- package/dist/lib/utils.cjs +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +8 -0
- package/dist/link.cjs +1 -0
- package/dist/link.d.ts +29 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.figma.d.ts +2 -0
- package/dist/link.figma.d.ts.map +1 -0
- package/dist/link.js +71 -0
- package/dist/logo.cjs +1 -0
- package/dist/logo.d.ts +25 -0
- package/dist/logo.d.ts.map +1 -0
- package/dist/logo.js +71 -0
- package/dist/menubar.cjs +1 -0
- package/dist/menubar.d.ts +106 -0
- package/dist/menubar.d.ts.map +1 -0
- package/dist/menubar.js +270 -0
- package/dist/navigation-menu.cjs +1 -0
- package/dist/navigation-menu.d.ts +108 -0
- package/dist/navigation-menu.d.ts.map +1 -0
- package/dist/navigation-menu.js +175 -0
- package/dist/pagination.cjs +1 -0
- package/dist/pagination.d.ts +81 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +216 -0
- package/dist/popover.cjs +1 -0
- package/dist/popover.d.ts +8 -0
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +44 -0
- package/dist/progress.cjs +1 -0
- package/dist/progress.d.ts +29 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +64 -0
- package/dist/radio-group.cjs +1 -0
- package/dist/radio-group.d.ts +33 -0
- package/dist/radio-group.d.ts.map +1 -0
- package/dist/radio-group.js +193 -0
- package/dist/rating.cjs +1 -0
- package/dist/rating.d.ts +22 -0
- package/dist/rating.d.ts.map +1 -0
- package/dist/rating.js +51 -0
- package/dist/resizable.cjs +1 -0
- package/dist/resizable.d.ts +14 -0
- package/dist/resizable.d.ts.map +1 -0
- package/dist/resizable.js +46 -0
- package/dist/scroll-area.cjs +1 -0
- package/dist/scroll-area.d.ts +12 -0
- package/dist/scroll-area.d.ts.map +1 -0
- package/dist/scroll-area.js +67 -0
- package/dist/select.cjs +1 -0
- package/dist/select.d.ts +77 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +259 -0
- package/dist/separator.cjs +1 -0
- package/dist/separator.d.ts +14 -0
- package/dist/separator.d.ts.map +1 -0
- package/dist/separator.js +43 -0
- package/dist/sheet.cjs +1 -0
- package/dist/sheet.d.ts +38 -0
- package/dist/sheet.d.ts.map +1 -0
- package/dist/sheet.js +190 -0
- package/dist/skeleton.cjs +1 -0
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/skeleton.js +15 -0
- package/dist/slider.cjs +1 -0
- package/dist/slider.d.ts +19 -0
- package/dist/slider.d.ts.map +1 -0
- package/dist/slider.js +69 -0
- package/dist/sonner.cjs +1 -0
- package/dist/sonner.d.ts +188 -0
- package/dist/sonner.d.ts.map +1 -0
- package/dist/sonner.js +150 -0
- package/dist/split-layout.cjs +1 -0
- package/dist/split-layout.d.ts +42 -0
- package/dist/split-layout.d.ts.map +1 -0
- package/dist/split-layout.js +108 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.d.ts +43 -0
- package/dist/switch.d.ts.map +1 -0
- package/dist/switch.figma.d.ts +2 -0
- package/dist/switch.figma.d.ts.map +1 -0
- package/dist/switch.js +110 -0
- package/dist/table.cjs +1 -0
- package/dist/table.d.ts +95 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +164 -0
- package/dist/tabs.cjs +1 -0
- package/dist/tabs.d.ts +29 -0
- package/dist/tabs.d.ts.map +1 -0
- package/dist/tabs.js +96 -0
- package/dist/textarea.cjs +1 -0
- package/dist/textarea.d.ts +23 -0
- package/dist/textarea.d.ts.map +1 -0
- package/dist/textarea.js +47 -0
- package/dist/toggle-group.cjs +1 -0
- package/dist/toggle-group.d.ts +25 -0
- package/dist/toggle-group.d.ts.map +1 -0
- package/dist/toggle-group.js +74 -0
- package/dist/toggle.cjs +1 -0
- package/dist/toggle.d.ts +44 -0
- package/dist/toggle.d.ts.map +1 -0
- package/dist/toggle.figma.d.ts +2 -0
- package/dist/toggle.figma.d.ts.map +1 -0
- package/dist/toggle.js +57 -0
- package/dist/tooltip.cjs +1 -0
- package/dist/tooltip.d.ts +66 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +78 -0
- package/package.json +184 -0
- package/src/blocks/data-table.tsx +1166 -0
- package/src/blocks/sidebar.tsx +1830 -0
- package/src/components/.gitkeep +0 -0
- package/src/components/accordion.tsx +142 -0
- package/src/components/alert-dialog.tsx +157 -0
- package/src/components/alert.tsx +199 -0
- package/src/components/aspect-ratio.tsx +30 -0
- package/src/components/avatar.tsx +56 -0
- package/src/components/badge.tsx +72 -0
- package/src/components/breadcrumb.tsx +109 -0
- package/src/components/button.tsx +296 -0
- package/src/components/calendar.tsx +234 -0
- package/src/components/card.tsx +158 -0
- package/src/components/carousel.tsx +256 -0
- package/src/components/centred-layout.tsx +91 -0
- package/src/components/chart.tsx +456 -0
- package/src/components/checkbox.tsx +132 -0
- package/src/components/collapsible.tsx +68 -0
- package/src/components/combobox.tsx +321 -0
- package/src/components/command.tsx +220 -0
- package/src/components/context-menu.tsx +305 -0
- package/src/components/date-picker.tsx +155 -0
- package/src/components/dialog.tsx +152 -0
- package/src/components/drawer.tsx +168 -0
- package/src/components/dropdown-menu.tsx +575 -0
- package/src/components/field.tsx +155 -0
- package/src/components/global-layout.tsx +153 -0
- package/src/components/hover-card.tsx +121 -0
- package/src/components/input-base.tsx +86 -0
- package/src/components/input-group.tsx +158 -0
- package/src/components/input-otp.tsx +327 -0
- package/src/components/input-password.tsx +191 -0
- package/src/components/input.tsx +220 -0
- package/src/components/label.tsx +42 -0
- package/src/components/link.figma.tsx +71 -0
- package/src/components/link.tsx +105 -0
- package/src/components/logo.tsx +97 -0
- package/src/components/menubar.tsx +379 -0
- package/src/components/navigation-menu.tsx +324 -0
- package/src/components/pagination.tsx +368 -0
- package/src/components/popover.tsx +46 -0
- package/src/components/progress.tsx +100 -0
- package/src/components/radio-group.tsx +281 -0
- package/src/components/rating.tsx +87 -0
- package/src/components/resizable.tsx +66 -0
- package/src/components/scroll-area.tsx +72 -0
- package/src/components/select.tsx +442 -0
- package/src/components/separator.tsx +53 -0
- package/src/components/sheet.tsx +220 -0
- package/src/components/skeleton.tsx +17 -0
- package/src/components/slider.tsx +86 -0
- package/src/components/sonner.tsx +396 -0
- package/src/components/split-layout.tsx +155 -0
- package/src/components/switch.figma.tsx +115 -0
- package/src/components/switch.tsx +173 -0
- package/src/components/table.tsx +277 -0
- package/src/components/tabs.tsx +142 -0
- package/src/components/textarea.tsx +77 -0
- package/src/components/toggle-group.tsx +109 -0
- package/src/components/toggle.figma.tsx +81 -0
- package/src/components/toggle.tsx +103 -0
- package/src/components/tooltip.tsx +156 -0
- package/src/hooks/.gitkeep +0 -0
- package/src/hooks/use-mobile.ts +21 -0
- package/src/index.ts +67 -0
- package/src/lib/utils.ts +6 -0
- package/src/types/external-modules.d.ts +16 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import * as t from "@radix-ui/react-context-menu";
|
|
4
|
+
import { Check as p, Circle as f, ChevronRight as x } from "lucide-react";
|
|
5
|
+
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
function S({
|
|
7
|
+
...e
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ a(t.Root, { "data-slot": "context-menu", ...e });
|
|
10
|
+
}
|
|
11
|
+
function z({
|
|
12
|
+
...e
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ a(t.Trigger, { "data-slot": "context-menu-trigger", ...e });
|
|
15
|
+
}
|
|
16
|
+
function T({
|
|
17
|
+
...e
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ a(t.Group, { "data-slot": "context-menu-group", ...e });
|
|
20
|
+
}
|
|
21
|
+
function j({
|
|
22
|
+
...e
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ a(t.Portal, { "data-slot": "context-menu-portal", ...e });
|
|
25
|
+
}
|
|
26
|
+
function G({
|
|
27
|
+
...e
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ a(t.Sub, { "data-slot": "context-menu-sub", ...e });
|
|
30
|
+
}
|
|
31
|
+
function P({
|
|
32
|
+
...e
|
|
33
|
+
}) {
|
|
34
|
+
return /* @__PURE__ */ a(
|
|
35
|
+
t.RadioGroup,
|
|
36
|
+
{
|
|
37
|
+
"data-slot": "context-menu-radio-group",
|
|
38
|
+
...e
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
const b = s.forwardRef(
|
|
43
|
+
({
|
|
44
|
+
className: e,
|
|
45
|
+
inset: o,
|
|
46
|
+
children: n,
|
|
47
|
+
dataHook: r,
|
|
48
|
+
trackingEl: i,
|
|
49
|
+
trackingLabel: l,
|
|
50
|
+
...c
|
|
51
|
+
}, m) => /* @__PURE__ */ u(
|
|
52
|
+
t.SubTrigger,
|
|
53
|
+
{
|
|
54
|
+
ref: m,
|
|
55
|
+
className: d(
|
|
56
|
+
"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 text-sm outline-none select-none",
|
|
57
|
+
o && "pl-8",
|
|
58
|
+
e
|
|
59
|
+
),
|
|
60
|
+
"data-hook": r,
|
|
61
|
+
"data-slot": "context-menu-sub-trigger",
|
|
62
|
+
"data-tracking-el": i,
|
|
63
|
+
"data-tracking-label": l,
|
|
64
|
+
...c,
|
|
65
|
+
children: [
|
|
66
|
+
n,
|
|
67
|
+
/* @__PURE__ */ a(x, { className: "ml-auto size-4" })
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
b.displayName = t.SubTrigger.displayName;
|
|
73
|
+
const g = s.forwardRef(({ className: e, ...o }, n) => /* @__PURE__ */ a(
|
|
74
|
+
t.SubContent,
|
|
75
|
+
{
|
|
76
|
+
ref: n,
|
|
77
|
+
className: d(
|
|
78
|
+
"border-border bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",
|
|
79
|
+
e
|
|
80
|
+
),
|
|
81
|
+
"data-slot": "context-menu-sub-content",
|
|
82
|
+
...o
|
|
83
|
+
}
|
|
84
|
+
));
|
|
85
|
+
g.displayName = t.SubContent.displayName;
|
|
86
|
+
const h = s.forwardRef(({ className: e, ...o }, n) => /* @__PURE__ */ a(t.Portal, { children: /* @__PURE__ */ a(
|
|
87
|
+
t.Content,
|
|
88
|
+
{
|
|
89
|
+
ref: n,
|
|
90
|
+
className: d(
|
|
91
|
+
"border-border bg-popover text-popover-foreground animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",
|
|
92
|
+
e
|
|
93
|
+
),
|
|
94
|
+
"data-slot": "context-menu-content",
|
|
95
|
+
...o
|
|
96
|
+
}
|
|
97
|
+
) }));
|
|
98
|
+
h.displayName = t.Content.displayName;
|
|
99
|
+
const N = s.forwardRef(
|
|
100
|
+
({ className: e, inset: o, dataHook: n, trackingEl: r, trackingLabel: i, ...l }, c) => /* @__PURE__ */ a(
|
|
101
|
+
t.Item,
|
|
102
|
+
{
|
|
103
|
+
ref: c,
|
|
104
|
+
className: d(
|
|
105
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
106
|
+
o && "pl-8",
|
|
107
|
+
e
|
|
108
|
+
),
|
|
109
|
+
"data-hook": n,
|
|
110
|
+
"data-slot": "context-menu-item",
|
|
111
|
+
"data-tracking-el": r,
|
|
112
|
+
"data-tracking-label": i,
|
|
113
|
+
...l
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
);
|
|
117
|
+
N.displayName = t.Item.displayName;
|
|
118
|
+
const C = s.forwardRef(
|
|
119
|
+
({
|
|
120
|
+
className: e,
|
|
121
|
+
children: o,
|
|
122
|
+
checked: n,
|
|
123
|
+
dataHook: r,
|
|
124
|
+
trackingEl: i,
|
|
125
|
+
trackingLabel: l,
|
|
126
|
+
...c
|
|
127
|
+
}, m) => /* @__PURE__ */ u(
|
|
128
|
+
t.CheckboxItem,
|
|
129
|
+
{
|
|
130
|
+
ref: m,
|
|
131
|
+
checked: n,
|
|
132
|
+
className: d(
|
|
133
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
134
|
+
e
|
|
135
|
+
),
|
|
136
|
+
"data-hook": r,
|
|
137
|
+
"data-slot": "context-menu-checkbox-item",
|
|
138
|
+
"data-tracking-el": i,
|
|
139
|
+
"data-tracking-label": l,
|
|
140
|
+
...c,
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ a("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(p, { className: "size-4" }) }) }),
|
|
143
|
+
o
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
);
|
|
148
|
+
C.displayName = t.CheckboxItem.displayName;
|
|
149
|
+
const y = s.forwardRef(
|
|
150
|
+
({ className: e, children: o, dataHook: n, trackingEl: r, trackingLabel: i, ...l }, c) => /* @__PURE__ */ u(
|
|
151
|
+
t.RadioItem,
|
|
152
|
+
{
|
|
153
|
+
ref: c,
|
|
154
|
+
className: d(
|
|
155
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
156
|
+
e
|
|
157
|
+
),
|
|
158
|
+
"data-hook": n,
|
|
159
|
+
"data-slot": "context-menu-radio-item",
|
|
160
|
+
"data-tracking-el": r,
|
|
161
|
+
"data-tracking-label": i,
|
|
162
|
+
...l,
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ a("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(f, { className: "size-2 fill-current" }) }) }),
|
|
165
|
+
o
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
);
|
|
170
|
+
y.displayName = t.RadioItem.displayName;
|
|
171
|
+
const k = s.forwardRef(({ className: e, inset: o, ...n }, r) => /* @__PURE__ */ a(
|
|
172
|
+
t.Label,
|
|
173
|
+
{
|
|
174
|
+
ref: r,
|
|
175
|
+
className: d(
|
|
176
|
+
"text-foreground px-2 py-1.5 text-sm font-semibold",
|
|
177
|
+
o && "pl-8",
|
|
178
|
+
e
|
|
179
|
+
),
|
|
180
|
+
"data-slot": "context-menu-label",
|
|
181
|
+
...n
|
|
182
|
+
}
|
|
183
|
+
));
|
|
184
|
+
k.displayName = t.Label.displayName;
|
|
185
|
+
const M = s.forwardRef(({ className: e, ...o }, n) => /* @__PURE__ */ a(
|
|
186
|
+
t.Separator,
|
|
187
|
+
{
|
|
188
|
+
ref: n,
|
|
189
|
+
className: d("bg-border -mx-1 my-1 h-px", e),
|
|
190
|
+
"data-slot": "context-menu-separator",
|
|
191
|
+
...o
|
|
192
|
+
}
|
|
193
|
+
));
|
|
194
|
+
M.displayName = t.Separator.displayName;
|
|
195
|
+
const R = ({
|
|
196
|
+
className: e,
|
|
197
|
+
...o
|
|
198
|
+
}) => /* @__PURE__ */ a(
|
|
199
|
+
"span",
|
|
200
|
+
{
|
|
201
|
+
className: d(
|
|
202
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
203
|
+
e
|
|
204
|
+
),
|
|
205
|
+
"data-slot": "context-menu-shortcut",
|
|
206
|
+
...o
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
R.displayName = "ContextMenuShortcut";
|
|
210
|
+
export {
|
|
211
|
+
S as ContextMenu,
|
|
212
|
+
C as ContextMenuCheckboxItem,
|
|
213
|
+
h as ContextMenuContent,
|
|
214
|
+
T as ContextMenuGroup,
|
|
215
|
+
N as ContextMenuItem,
|
|
216
|
+
k as ContextMenuLabel,
|
|
217
|
+
j as ContextMenuPortal,
|
|
218
|
+
P as ContextMenuRadioGroup,
|
|
219
|
+
y as ContextMenuRadioItem,
|
|
220
|
+
M as ContextMenuSeparator,
|
|
221
|
+
R as ContextMenuShortcut,
|
|
222
|
+
G as ContextMenuSub,
|
|
223
|
+
g as ContextMenuSubContent,
|
|
224
|
+
b as ContextMenuSubTrigger,
|
|
225
|
+
z as ContextMenuTrigger
|
|
226
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),v=require("date-fns"),y=require("lucide-react"),i=require("@brightlocal/ui-components/lib/utils"),q=require("@brightlocal/ui-components/input-base"),N=require("@brightlocal/ui-components/calendar"),l=require("@brightlocal/ui-components/popover");function O(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,n.get?n:{enumerable:!0,get:()=>t[a]})}}return r.default=t,Object.freeze(r)}const d=O(b),p=d.forwardRef(({className:t,dataHook:r,trackingEl:a,trackingLabel:n,date:s,onDateChange:f,label:c,placeholder:g="Pick a date",disabled:o,ariaLabel:m,dateFormat:x="PPP",...j},h)=>{const[P,u]=d.useState(!1);return e.jsxs("div",{ref:h,className:i.cn("flex w-full flex-col gap-2",t),"data-hook":r,"data-slot":"date-picker","data-tracking-el":a||"date-picker","data-tracking-label":n,...j,children:[c&&e.jsx("label",{className:"text-foreground text-sm leading-none font-medium","data-slot":"date-picker-label",children:c}),e.jsxs(l.Popover,{open:P,onOpenChange:u,children:[e.jsx(l.PopoverTrigger,{asChild:!0,children:e.jsxs("div",{className:"relative flex w-full items-center",children:[e.jsx(y.Calendar,{className:i.cn("text-muted-foreground pointer-events-none absolute left-3 flex size-4 items-center",o&&"opacity-50"),"data-slot":"calendar-icon"}),e.jsx("button",{"aria-label":m||c||"Select date",className:i.cn(q.inputVariants({hasIcon:!0}),"cursor-pointer justify-start text-left",!s&&"text-muted-foreground"),"data-hook":`${r}-trigger`,"data-slot":"date-picker-trigger",disabled:o,type:"button",children:s?v.format(s,x):e.jsx("span",{children:g})})]})}),e.jsx(l.PopoverContent,{align:"start",className:"w-auto p-0",children:e.jsx(N.Calendar,{initialFocus:!0,dataHook:`${r}-calendar`,disabled:o,mode:"single",selected:s,onSelect:k=>{f?.(k),u(!1)}})})]})]})});p.displayName="DatePicker";exports.DatePicker=p;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface DatePickerProps extends Omit<React.ComponentProps<"div">, "onSelect"> {
|
|
3
|
+
/**
|
|
4
|
+
* Data hook for automated testing (REQUIRED)
|
|
5
|
+
* Used to identify component in tests and E2E automation
|
|
6
|
+
*/
|
|
7
|
+
dataHook: string;
|
|
8
|
+
/**
|
|
9
|
+
* Tracking element identifier for analytics
|
|
10
|
+
* Defaults to "date-picker" if not provided
|
|
11
|
+
*/
|
|
12
|
+
trackingEl?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Tracking label for analytics context
|
|
15
|
+
* Additional context for tracking events
|
|
16
|
+
*/
|
|
17
|
+
trackingLabel?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Selected date value
|
|
20
|
+
*/
|
|
21
|
+
date?: Date;
|
|
22
|
+
/**
|
|
23
|
+
* Callback fired when date selection changes
|
|
24
|
+
*/
|
|
25
|
+
onDateChange?: (date: Date | undefined) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Label text displayed above the date picker
|
|
28
|
+
*/
|
|
29
|
+
label?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Placeholder text when no date is selected
|
|
32
|
+
* @default "Pick a date"
|
|
33
|
+
*/
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Disabled state
|
|
37
|
+
*/
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Accessible label for screen readers
|
|
41
|
+
*/
|
|
42
|
+
ariaLabel?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Format string for displaying selected date
|
|
45
|
+
* Uses date-fns format tokens
|
|
46
|
+
* @default "PPP"
|
|
47
|
+
* @example "MM/dd/yyyy" → "12/31/2024"
|
|
48
|
+
* @example "PPP" → "December 31st, 2024"
|
|
49
|
+
*/
|
|
50
|
+
dateFormat?: string;
|
|
51
|
+
}
|
|
52
|
+
declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
53
|
+
export { DatePicker };
|
|
54
|
+
//# sourceMappingURL=date-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../src/components/date-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B,UAAU,CACX;IACC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IAChD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,QAAA,MAAM,UAAU,qGAiFf,CAAC;AAIF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { format as v } from "date-fns";
|
|
4
|
+
import { Calendar as N } from "lucide-react";
|
|
5
|
+
import { cn as l } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
import { inputVariants as C } from "@brightlocal/ui-components/input-base";
|
|
7
|
+
import { Calendar as w } from "@brightlocal/ui-components/calendar";
|
|
8
|
+
import { Popover as y, PopoverTrigger as b, PopoverContent as j } from "@brightlocal/ui-components/popover";
|
|
9
|
+
const S = s.forwardRef(
|
|
10
|
+
({
|
|
11
|
+
className: c,
|
|
12
|
+
dataHook: a,
|
|
13
|
+
trackingEl: d,
|
|
14
|
+
trackingLabel: m,
|
|
15
|
+
date: t,
|
|
16
|
+
onDateChange: p,
|
|
17
|
+
label: r,
|
|
18
|
+
placeholder: f = "Pick a date",
|
|
19
|
+
disabled: o,
|
|
20
|
+
ariaLabel: u,
|
|
21
|
+
dateFormat: g = "PPP",
|
|
22
|
+
...h
|
|
23
|
+
}, x) => {
|
|
24
|
+
const [k, i] = s.useState(!1);
|
|
25
|
+
return /* @__PURE__ */ n(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
ref: x,
|
|
29
|
+
className: l("flex w-full flex-col gap-2", c),
|
|
30
|
+
"data-hook": a,
|
|
31
|
+
"data-slot": "date-picker",
|
|
32
|
+
"data-tracking-el": d || "date-picker",
|
|
33
|
+
"data-tracking-label": m,
|
|
34
|
+
...h,
|
|
35
|
+
children: [
|
|
36
|
+
r && /* @__PURE__ */ e(
|
|
37
|
+
"label",
|
|
38
|
+
{
|
|
39
|
+
className: "text-foreground text-sm leading-none font-medium",
|
|
40
|
+
"data-slot": "date-picker-label",
|
|
41
|
+
children: r
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ n(y, { open: k, onOpenChange: i, children: [
|
|
45
|
+
/* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "relative flex w-full items-center", children: [
|
|
46
|
+
/* @__PURE__ */ e(
|
|
47
|
+
N,
|
|
48
|
+
{
|
|
49
|
+
className: l(
|
|
50
|
+
"text-muted-foreground pointer-events-none absolute left-3 flex size-4 items-center",
|
|
51
|
+
o && "opacity-50"
|
|
52
|
+
),
|
|
53
|
+
"data-slot": "calendar-icon"
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ e(
|
|
57
|
+
"button",
|
|
58
|
+
{
|
|
59
|
+
"aria-label": u || r || "Select date",
|
|
60
|
+
className: l(
|
|
61
|
+
C({ hasIcon: !0 }),
|
|
62
|
+
"cursor-pointer justify-start text-left",
|
|
63
|
+
!t && "text-muted-foreground"
|
|
64
|
+
),
|
|
65
|
+
"data-hook": `${a}-trigger`,
|
|
66
|
+
"data-slot": "date-picker-trigger",
|
|
67
|
+
disabled: o,
|
|
68
|
+
type: "button",
|
|
69
|
+
children: t ? v(t, g) : /* @__PURE__ */ e("span", { children: f })
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] }) }),
|
|
73
|
+
/* @__PURE__ */ e(j, { align: "start", className: "w-auto p-0", children: /* @__PURE__ */ e(
|
|
74
|
+
w,
|
|
75
|
+
{
|
|
76
|
+
initialFocus: !0,
|
|
77
|
+
dataHook: `${a}-calendar`,
|
|
78
|
+
disabled: o,
|
|
79
|
+
mode: "single",
|
|
80
|
+
selected: t,
|
|
81
|
+
onSelect: (P) => {
|
|
82
|
+
p?.(P), i(!1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
) })
|
|
86
|
+
] })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
S.displayName = "DatePicker";
|
|
93
|
+
export {
|
|
94
|
+
S as DatePicker
|
|
95
|
+
};
|
package/dist/dialog.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),x=require("@radix-ui/react-dialog"),p=require("lucide-react"),i=require("@brightlocal/ui-components/lib/utils");function r(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const D=r(m),o=r(x);function j({...t}){return a.jsx(o.Root,{...t})}function b({...t}){return a.jsx(o.Trigger,{"data-slot":"dialog-trigger",...t})}function l({...t}){return a.jsx(o.Portal,{"data-slot":"dialog-portal",...t})}function v({...t}){return a.jsx(o.Close,{"data-slot":"dialog-close",...t})}function d({className:t,...e}){return a.jsx(o.Overlay,{className:i.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),"data-slot":"dialog-overlay",...e})}const c=D.forwardRef(({className:t,children:e,dataHook:n,trackingEl:s,trackingLabel:g,...u},f)=>a.jsxs(l,{"data-slot":"dialog-portal",children:[a.jsx(d,{}),a.jsxs(o.Content,{ref:f,className:i.cn("bg-background text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-xl border border-card-border p-8 shadow-lg duration-200 sm:max-w-lg",t),"data-hook":n,"data-slot":"dialog-content","data-tracking-el":s,"data-tracking-label":g,...u,children:[e,a.jsxs(o.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-8 right-8 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[a.jsx(p.XIcon,{}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));c.displayName="DialogContent";function y({className:t,...e}){return a.jsx("div",{className:i.cn("flex flex-col gap-2 text-center sm:text-left",t),"data-slot":"dialog-header",...e})}function h({className:t,...e}){return a.jsx("div",{className:i.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),"data-slot":"dialog-footer",...e})}function N({className:t,...e}){return a.jsx(o.Title,{className:i.cn("text-lg leading-none font-semibold",t),"data-slot":"dialog-title",...e})}function C({className:t,...e}){return a.jsx(o.Description,{className:i.cn("text-muted-foreground text-sm",t),"data-slot":"dialog-description",...e})}exports.Dialog=j;exports.DialogClose=v;exports.DialogContent=c;exports.DialogDescription=C;exports.DialogFooter=h;exports.DialogHeader=y;exports.DialogOverlay=d;exports.DialogPortal=l;exports.DialogTitle=N;exports.DialogTrigger=b;
|
package/dist/dialog.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
interface DialogContentProps extends React.ComponentProps<typeof DialogPrimitive.Content> {
|
|
9
|
+
dataHook?: string;
|
|
10
|
+
trackingEl?: string;
|
|
11
|
+
trackingLabel?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
19
|
+
export type { DialogContentProps };
|
|
20
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAK1D,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAEnD;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAEtD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,2CAErD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAWtD;AAED,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CACvD,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,aAAa,wGA6BlB,CAAC;AAIF,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQzE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWzE;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAQpD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,2CAQ1D;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC;AAEF,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/dialog.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { jsx as a, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import * as o from "@radix-ui/react-dialog";
|
|
4
|
+
import { XIcon as f } from "lucide-react";
|
|
5
|
+
import { cn as n } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
function v({
|
|
7
|
+
...t
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ a(o.Root, { ...t });
|
|
10
|
+
}
|
|
11
|
+
function h({
|
|
12
|
+
...t
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ a(o.Trigger, { "data-slot": "dialog-trigger", ...t });
|
|
15
|
+
}
|
|
16
|
+
function u({
|
|
17
|
+
...t
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ a(o.Portal, { "data-slot": "dialog-portal", ...t });
|
|
20
|
+
}
|
|
21
|
+
function y({
|
|
22
|
+
...t
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ a(o.Close, { "data-slot": "dialog-close", ...t });
|
|
25
|
+
}
|
|
26
|
+
function m({
|
|
27
|
+
className: t,
|
|
28
|
+
...e
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ a(
|
|
31
|
+
o.Overlay,
|
|
32
|
+
{
|
|
33
|
+
className: n(
|
|
34
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
35
|
+
t
|
|
36
|
+
),
|
|
37
|
+
"data-slot": "dialog-overlay",
|
|
38
|
+
...e
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
const p = g.forwardRef(
|
|
43
|
+
({ className: t, children: e, dataHook: i, trackingEl: l, trackingLabel: s, ...d }, c) => /* @__PURE__ */ r(u, { "data-slot": "dialog-portal", children: [
|
|
44
|
+
/* @__PURE__ */ a(m, {}),
|
|
45
|
+
/* @__PURE__ */ r(
|
|
46
|
+
o.Content,
|
|
47
|
+
{
|
|
48
|
+
ref: c,
|
|
49
|
+
className: n(
|
|
50
|
+
"bg-background text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-xl border border-card-border p-8 shadow-lg duration-200 sm:max-w-lg",
|
|
51
|
+
t
|
|
52
|
+
),
|
|
53
|
+
"data-hook": i,
|
|
54
|
+
"data-slot": "dialog-content",
|
|
55
|
+
"data-tracking-el": l,
|
|
56
|
+
"data-tracking-label": s,
|
|
57
|
+
...d,
|
|
58
|
+
children: [
|
|
59
|
+
e,
|
|
60
|
+
/* @__PURE__ */ r(o.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-8 right-8 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [
|
|
61
|
+
/* @__PURE__ */ a(f, {}),
|
|
62
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: "Close" })
|
|
63
|
+
] })
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
] })
|
|
68
|
+
);
|
|
69
|
+
p.displayName = "DialogContent";
|
|
70
|
+
function N({ className: t, ...e }) {
|
|
71
|
+
return /* @__PURE__ */ a(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: n("flex flex-col gap-2 text-center sm:text-left", t),
|
|
75
|
+
"data-slot": "dialog-header",
|
|
76
|
+
...e
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function k({ className: t, ...e }) {
|
|
81
|
+
return /* @__PURE__ */ a(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
className: n(
|
|
85
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
86
|
+
t
|
|
87
|
+
),
|
|
88
|
+
"data-slot": "dialog-footer",
|
|
89
|
+
...e
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
function C({
|
|
94
|
+
className: t,
|
|
95
|
+
...e
|
|
96
|
+
}) {
|
|
97
|
+
return /* @__PURE__ */ a(
|
|
98
|
+
o.Title,
|
|
99
|
+
{
|
|
100
|
+
className: n("text-lg leading-none font-semibold", t),
|
|
101
|
+
"data-slot": "dialog-title",
|
|
102
|
+
...e
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function w({
|
|
107
|
+
className: t,
|
|
108
|
+
...e
|
|
109
|
+
}) {
|
|
110
|
+
return /* @__PURE__ */ a(
|
|
111
|
+
o.Description,
|
|
112
|
+
{
|
|
113
|
+
className: n("text-muted-foreground text-sm", t),
|
|
114
|
+
"data-slot": "dialog-description",
|
|
115
|
+
...e
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
v as Dialog,
|
|
121
|
+
y as DialogClose,
|
|
122
|
+
p as DialogContent,
|
|
123
|
+
w as DialogDescription,
|
|
124
|
+
k as DialogFooter,
|
|
125
|
+
N as DialogHeader,
|
|
126
|
+
m as DialogOverlay,
|
|
127
|
+
u as DialogPortal,
|
|
128
|
+
C as DialogTitle,
|
|
129
|
+
h as DialogTrigger
|
|
130
|
+
};
|
package/dist/drawer.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),e=require("vaul"),d=require("@brightlocal/ui-components/lib/utils");function u({...r}){return a.jsx(e.Drawer.Root,{"data-slot":"drawer",...r})}function c({...r}){return a.jsx(e.Drawer.Trigger,{"data-slot":"drawer-trigger",...r})}function o({...r}){return a.jsx(e.Drawer.Portal,{"data-slot":"drawer-portal",...r})}function m({...r}){return a.jsx(e.Drawer.Close,{"data-slot":"drawer-close",...r})}function n({className:r,...t}){return a.jsx(e.Drawer.Overlay,{className:d.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",r),"data-slot":"drawer-overlay",...t})}function x({className:r,children:t,dataHook:i,trackingEl:l,trackingLabel:s,...w}){return a.jsxs(o,{children:[a.jsx(n,{}),a.jsxs(e.Drawer.Content,{className:d.cn("group/drawer-content bg-background border-border fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-[10px] data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-[10px] data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",r),"data-hook":i,"data-slot":"drawer-content","data-tracking-el":l,"data-tracking-label":s,...w,children:[a.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[120px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function f({className:r,...t}){return a.jsx("div",{className:d.cn("mx-auto flex w-full max-w-sm flex-col gap-1.5 p-4 text-center sm:text-left",r),"data-slot":"drawer-header",...t})}function v({className:r,...t}){return a.jsx("div",{className:d.cn("mx-auto w-full max-w-sm px-4",r),"data-slot":"drawer-body",...t})}function D({className:r,...t}){return a.jsx("div",{className:d.cn("mx-auto mt-auto flex w-full max-w-sm flex-col gap-2 p-4",r),"data-slot":"drawer-footer",...t})}function g({className:r,...t}){return a.jsx(e.Drawer.Title,{className:d.cn("text-foreground text-lg leading-none font-semibold",r),"data-slot":"drawer-title",...t})}function b({className:r,...t}){return a.jsx(e.Drawer.Description,{className:d.cn("text-muted-foreground text-sm leading-normal",r),"data-slot":"drawer-description",...t})}exports.Drawer=u;exports.DrawerBody=v;exports.DrawerClose=m;exports.DrawerContent=x;exports.DrawerDescription=b;exports.DrawerFooter=D;exports.DrawerHeader=f;exports.DrawerOverlay=n;exports.DrawerPortal=o;exports.DrawerTitle=g;exports.DrawerTrigger=c;
|
package/dist/drawer.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;
|
|
4
|
+
declare function Drawer({ ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
type DrawerContentProps = React.ComponentProps<typeof DrawerPrimitive.Content> & {
|
|
10
|
+
dataHook?: string;
|
|
11
|
+
trackingEl?: string;
|
|
12
|
+
trackingLabel?: string;
|
|
13
|
+
};
|
|
14
|
+
declare function DrawerContent({ className, children, dataHook, trackingEl, trackingLabel, ...props }: DrawerContentProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function DrawerBody({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, };
|
|
21
|
+
export type { DrawerProps, DrawerContentProps };
|
|
22
|
+
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/components/drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,MAAM,CAAC;AAIjD,KAAK,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAErE,iBAAS,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAExC;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAEtD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,2CAErD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAWtD;AAED,KAAK,kBAAkB,GAAG,KAAK,CAAC,cAAc,CAC5C,OAAO,eAAe,CAAC,OAAO,CAC/B,GAAG;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,aAAa,EACb,GAAG,KAAK,EACT,EAAE,kBAAkB,2CAwBpB;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWzE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQvE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWzE;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAWpD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,2CAQ1D;AAED,OAAO,EACL,MAAM,EACN,UAAU,EACV,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC;AAEF,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC"}
|