@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
package/dist/sonner.js
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { Loader2 as S, XCircle as p, AlertTriangle as b, CheckCircle2 as g, Info as v } from "lucide-react";
|
|
3
|
+
import { cva as i } from "class-variance-authority";
|
|
4
|
+
import { toast as f, Toaster as N } from "sonner";
|
|
5
|
+
import { Button as x, ButtonSize as A } from "@brightlocal/ui-components/button";
|
|
6
|
+
import { cn as r } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
+
var C = /* @__PURE__ */ ((e) => (e.INFO = "info", e.SUCCESS = "success", e.WARNING = "warning", e.ERROR = "error", e.LOADING = "loading", e))(C || {}), T = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.SUCCESS = "success", e))(T || {});
|
|
8
|
+
const I = i(
|
|
9
|
+
[
|
|
10
|
+
"flex",
|
|
11
|
+
"items-center",
|
|
12
|
+
"justify-between",
|
|
13
|
+
"w-full",
|
|
14
|
+
"md:w-auto",
|
|
15
|
+
"md:min-w-[364px]",
|
|
16
|
+
"rounded-md",
|
|
17
|
+
"border",
|
|
18
|
+
"border-border",
|
|
19
|
+
"p-4",
|
|
20
|
+
"gap-2",
|
|
21
|
+
"shadow-lg"
|
|
22
|
+
].join(" "),
|
|
23
|
+
{
|
|
24
|
+
variants: {
|
|
25
|
+
colorSchema: {
|
|
26
|
+
default: "bg-white dark:bg-popover",
|
|
27
|
+
success: "bg-green-200 dark:bg-popover"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
colorSchema: "default"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
), w = i("text-sm leading-normal font-medium", {
|
|
35
|
+
variants: {
|
|
36
|
+
colorSchema: {
|
|
37
|
+
default: "text-foreground",
|
|
38
|
+
success: "text-green-900"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
colorSchema: "default"
|
|
43
|
+
}
|
|
44
|
+
}), R = i("text-sm leading-normal", {
|
|
45
|
+
variants: {
|
|
46
|
+
colorSchema: {
|
|
47
|
+
default: "text-muted-foreground",
|
|
48
|
+
success: "text-green-900"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
colorSchema: "default"
|
|
53
|
+
}
|
|
54
|
+
}), s = i("size-5", {
|
|
55
|
+
variants: {
|
|
56
|
+
colorSchema: {
|
|
57
|
+
default: "text-foreground",
|
|
58
|
+
success: "text-green-900"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: {
|
|
62
|
+
colorSchema: "default"
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
function k(e, t) {
|
|
66
|
+
switch (e) {
|
|
67
|
+
case "info":
|
|
68
|
+
return /* @__PURE__ */ o(v, { className: r(s({ colorSchema: t })) });
|
|
69
|
+
case "success":
|
|
70
|
+
return /* @__PURE__ */ o(g, { className: r(s({ colorSchema: t })) });
|
|
71
|
+
case "warning":
|
|
72
|
+
return /* @__PURE__ */ o(b, { className: r(s({ colorSchema: t })) });
|
|
73
|
+
case "error":
|
|
74
|
+
return /* @__PURE__ */ o(p, { className: r(s({ colorSchema: t })) });
|
|
75
|
+
case "loading":
|
|
76
|
+
return /* @__PURE__ */ o(
|
|
77
|
+
S,
|
|
78
|
+
{
|
|
79
|
+
className: r(s({ colorSchema: t }), "animate-spin")
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
default:
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function _(e, t) {
|
|
87
|
+
const { id: c, ...a } = e, u = c != null ? { ...t, id: t?.id ?? c } : t;
|
|
88
|
+
f.custom((l) => {
|
|
89
|
+
const d = a.button && a.button.label ? {
|
|
90
|
+
label: a.button.label,
|
|
91
|
+
variant: a.button.variant,
|
|
92
|
+
onClick: () => {
|
|
93
|
+
a.button?.onClick && a.button.onClick(), f.dismiss(l);
|
|
94
|
+
}
|
|
95
|
+
} : void 0;
|
|
96
|
+
return /* @__PURE__ */ o(
|
|
97
|
+
E,
|
|
98
|
+
{
|
|
99
|
+
button: d,
|
|
100
|
+
colorSchema: a.colorSchema,
|
|
101
|
+
description: a.description,
|
|
102
|
+
icon: a.icon ?? void 0,
|
|
103
|
+
id: l,
|
|
104
|
+
title: a.title
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}, u);
|
|
108
|
+
}
|
|
109
|
+
function E(e) {
|
|
110
|
+
const { button: t, description: c, icon: a, title: u, colorSchema: l } = e, n = ((h) => h === "success" ? "success" : "default")(l);
|
|
111
|
+
return /* @__PURE__ */ m(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
"aria-atomic": "true",
|
|
115
|
+
"aria-live": "polite",
|
|
116
|
+
className: r(I({ colorSchema: n })),
|
|
117
|
+
role: "status",
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ m("div", { className: "flex flex-1 items-start gap-2", children: [
|
|
120
|
+
a != null && k(a, n),
|
|
121
|
+
/* @__PURE__ */ m("div", { className: "w-full", children: [
|
|
122
|
+
/* @__PURE__ */ o("p", { className: r(w({ colorSchema: n })), children: u }),
|
|
123
|
+
c && /* @__PURE__ */ o("p", { className: r(R({ colorSchema: n })), children: c })
|
|
124
|
+
] })
|
|
125
|
+
] }),
|
|
126
|
+
t?.label && /* @__PURE__ */ o(
|
|
127
|
+
x,
|
|
128
|
+
{
|
|
129
|
+
"aria-label": t.label,
|
|
130
|
+
className: "min-h-6 px-2 py-0 text-xs leading-normal font-medium",
|
|
131
|
+
dataHook: "toast-action",
|
|
132
|
+
size: A.DEFAULT,
|
|
133
|
+
variant: t.variant,
|
|
134
|
+
onClick: t.onClick,
|
|
135
|
+
children: t.label
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
function z() {
|
|
143
|
+
return /* @__PURE__ */ o(N, { position: "top-right" });
|
|
144
|
+
}
|
|
145
|
+
export {
|
|
146
|
+
z as Sonner,
|
|
147
|
+
T as SonnerColorSchema,
|
|
148
|
+
C as SonnerIcon,
|
|
149
|
+
_ as sonner
|
|
150
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),g=require("react"),x=require("class-variance-authority"),n=require("@brightlocal/ui-components/lib/utils");function j(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,l.get?l:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const c=j(g),m=["flex","w-full","min-h-screen","flex-col","lg:flex-row"],r=x.cva(["flex","flex-1","items-center","overflow-auto","p-6"],{variants:{side:{left:["bg-background","justify-center","lg:justify-end","lg:pr-[46px]","xl:pr-[110px]"],right:["bg-card","hidden","lg:flex","justify-center","lg:justify-start","lg:pl-[46px]","xl:pl-[110px]"]}},defaultVariants:{side:"left"}}),u=c.forwardRef(({className:t,dataHook:e,trackingEl:a,trackingLabel:l,left:i,right:o,children:f,...p},y)=>s.jsxs("div",{ref:y,className:n.cn(m,t),"data-hook":e,"data-slot":"split-layout","data-tracking-el":a||"split-layout","data-tracking-label":l,...p,children:[i&&s.jsx("div",{className:r({side:"left"}),"data-slot":"split-layout-left",children:i}),o&&s.jsx("div",{className:r({side:"right"}),"data-slot":"split-layout-right",children:o}),f]}));u.displayName="SplitLayout";const d=c.forwardRef(({className:t,side:e="left",children:a,...l},i)=>s.jsx("div",{ref:i,className:n.cn(r({side:e}),t),"data-slot":`split-layout-${e}`,...l,children:a}));d.displayName="SplitLayoutSection";exports.SplitLayout=u;exports.SplitLayoutSection=d;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface SplitLayoutProps extends React.ComponentProps<"div"> {
|
|
3
|
+
/** Data hook for automated testing (REQUIRED) */
|
|
4
|
+
dataHook: string;
|
|
5
|
+
/** Tracking element identifier for analytics */
|
|
6
|
+
trackingEl?: string;
|
|
7
|
+
/** Tracking label for analytics context */
|
|
8
|
+
trackingLabel?: string;
|
|
9
|
+
/** Content for the left/first section */
|
|
10
|
+
left?: React.ReactNode;
|
|
11
|
+
/** Content for the right/second section */
|
|
12
|
+
right?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* SplitLayout component for creating responsive two-column layouts
|
|
16
|
+
*
|
|
17
|
+
* Displays content in two sections side-by-side on large screens (≥1024px),
|
|
18
|
+
* and shows only the left section on smaller screens (hiding the right/marketing section).
|
|
19
|
+
* This pattern is commonly used for authentication pages where the form is prioritized on mobile.
|
|
20
|
+
*
|
|
21
|
+
* Layout specifications:
|
|
22
|
+
* - Mobile/Tablet: Stacked layout, only left section visible, content centered
|
|
23
|
+
* - LG (≥1024px): Side-by-side with 46px spacing on each side (92px total gap)
|
|
24
|
+
* - XL (≥1280px) and bigger: Side-by-side with 110px spacing on each side (220px total gap max)
|
|
25
|
+
* - Left section: Content aligned to right edge with responsive padding
|
|
26
|
+
* - Right section: Content aligned to left edge with responsive padding
|
|
27
|
+
* - Background colors extend full-width of viewport
|
|
28
|
+
* - Content within each section can be independently sized (e.g., using Card components)
|
|
29
|
+
*/
|
|
30
|
+
declare const SplitLayout: React.ForwardRefExoticComponent<Omit<SplitLayoutProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
interface SplitLayoutSectionProps extends React.ComponentProps<"div"> {
|
|
32
|
+
/** Which side this section appears on */
|
|
33
|
+
side?: "left" | "right";
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* SplitLayoutSection - Individual section within a SplitLayout
|
|
37
|
+
*
|
|
38
|
+
* Use this for more granular control over layout sections
|
|
39
|
+
*/
|
|
40
|
+
declare const SplitLayoutSection: React.ForwardRefExoticComponent<Omit<SplitLayoutSectionProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
export { SplitLayout, SplitLayoutSection, type SplitLayoutProps, type SplitLayoutSectionProps, };
|
|
42
|
+
//# sourceMappingURL=split-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-layout.d.ts","sourceRoot":"","sources":["../../src/components/split-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4C/B,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC5D,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yCAAyC;IACzC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB;AAED;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,WAAW,sGA4ChB,CAAC;AAIF,UAAU,uBAAwB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACnE,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,QAAA,MAAM,kBAAkB,6GActB,CAAC;AAIH,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,GAC7B,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsxs as u, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { cva as y } from "class-variance-authority";
|
|
4
|
+
import { cn as n } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
const m = [
|
|
6
|
+
"flex",
|
|
7
|
+
"w-full",
|
|
8
|
+
"min-h-screen",
|
|
9
|
+
// Responsive behavior: stack on small screens, side-by-side on large
|
|
10
|
+
"flex-col",
|
|
11
|
+
"lg:flex-row"
|
|
12
|
+
], o = y(
|
|
13
|
+
["flex", "flex-1", "items-center", "overflow-auto", "p-6"],
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
side: {
|
|
17
|
+
left: [
|
|
18
|
+
"bg-background",
|
|
19
|
+
// base/background token
|
|
20
|
+
"justify-center",
|
|
21
|
+
// Center on mobile
|
|
22
|
+
"lg:justify-end",
|
|
23
|
+
// Align to right on large screens
|
|
24
|
+
"lg:pr-[46px]",
|
|
25
|
+
// 46px spacing from right edge on LG
|
|
26
|
+
"xl:pr-[110px]"
|
|
27
|
+
// 110px spacing from right edge on XL and bigger
|
|
28
|
+
],
|
|
29
|
+
right: [
|
|
30
|
+
"bg-card",
|
|
31
|
+
// base/card token (handles both light and dark modes)
|
|
32
|
+
"hidden",
|
|
33
|
+
// Hidden on mobile (MD and SM breakpoints)
|
|
34
|
+
"lg:flex",
|
|
35
|
+
// Visible on large screens (LG and XL breakpoints)
|
|
36
|
+
"justify-center",
|
|
37
|
+
// Center on mobile
|
|
38
|
+
"lg:justify-start",
|
|
39
|
+
// Align to left on large screens
|
|
40
|
+
"lg:pl-[46px]",
|
|
41
|
+
// 46px spacing from left edge on LG
|
|
42
|
+
"xl:pl-[110px]"
|
|
43
|
+
// 110px spacing from left edge on XL and bigger
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
side: "left"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
), x = d.forwardRef(
|
|
52
|
+
({
|
|
53
|
+
className: l,
|
|
54
|
+
dataHook: t,
|
|
55
|
+
trackingEl: e,
|
|
56
|
+
trackingLabel: i,
|
|
57
|
+
left: a,
|
|
58
|
+
right: r,
|
|
59
|
+
children: p,
|
|
60
|
+
...c
|
|
61
|
+
}, f) => /* @__PURE__ */ u(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
ref: f,
|
|
65
|
+
className: n(m, l),
|
|
66
|
+
"data-hook": t,
|
|
67
|
+
"data-slot": "split-layout",
|
|
68
|
+
"data-tracking-el": e || "split-layout",
|
|
69
|
+
"data-tracking-label": i,
|
|
70
|
+
...c,
|
|
71
|
+
children: [
|
|
72
|
+
a && /* @__PURE__ */ s(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: o({ side: "left" }),
|
|
76
|
+
"data-slot": "split-layout-left",
|
|
77
|
+
children: a
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
r && /* @__PURE__ */ s(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: o({ side: "right" }),
|
|
84
|
+
"data-slot": "split-layout-right",
|
|
85
|
+
children: r
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
p
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
x.displayName = "SplitLayout";
|
|
94
|
+
const g = d.forwardRef(({ className: l, side: t = "left", children: e, ...i }, a) => /* @__PURE__ */ s(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
ref: a,
|
|
98
|
+
className: n(o({ side: t }), l),
|
|
99
|
+
"data-slot": `split-layout-${t}`,
|
|
100
|
+
...i,
|
|
101
|
+
children: e
|
|
102
|
+
}
|
|
103
|
+
));
|
|
104
|
+
g.displayName = "SplitLayoutSection";
|
|
105
|
+
export {
|
|
106
|
+
x as SplitLayout,
|
|
107
|
+
g as SplitLayoutSection
|
|
108
|
+
};
|
package/dist/switch.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),w=require("react"),j=require("@radix-ui/react-switch"),v=require("class-variance-authority"),l=require("@brightlocal/ui-components/lib/utils");function m(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return r.default=e,Object.freeze(r)}const k=m(w),f=m(j);var h=(e=>(e.DEFAULT="default",e.BOX="box",e))(h||{}),b=(e=>(e.LEFT="left",e.RIGHT="right",e))(b||{});const y=v.cva(["peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:focus-visible:border-neutral-500 dark:data-[state=unchecked]:bg-input/80","inline-flex h-5 w-9 shrink-0 items-center rounded-full border-1 border-transparent shadow-xs transition-all outline-none focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","pl-[1px]"],{variants:{variant:{default:[],box:[]}},defaultVariants:{variant:"default"}}),x=k.forwardRef(({className:e,variant:r="default",dataHook:a,trackingEl:n,trackingLabel:g,label:s,description:o,side:d="right",...c},p)=>{const i=t.jsx(f.Root,{ref:p,className:l.cn(y({variant:r}),e),"data-hook":a,"data-slot":"switch","data-tracking-el":n||`switch-${r}`,"data-tracking-label":g,...c,children:t.jsx(f.Thumb,{className:l.cn("bg-background","pointer-events-none block size-4 rounded-full ring-0 transition-transform","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"),"data-slot":"switch-thumb"})});if(r==="default")return t.jsxs("div",{className:l.cn("flex items-center gap-2",d==="left"&&"flex-row-reverse"),children:[i,s&&t.jsx("label",{className:"cursor-pointer text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",htmlFor:c.id,children:s})]});if(r==="box"){const u=t.jsxs("div",{className:"flex flex-col gap-2",children:[s&&t.jsx("label",{className:"cursor-pointer text-sm leading-none font-medium",htmlFor:c.id,children:s}),o&&t.jsx("p",{className:"text-muted-foreground text-sm leading-normal",children:o})]});return t.jsx("div",{className:"border-border flex items-center justify-between gap-4 rounded-lg border p-4",children:d==="left"?t.jsxs(t.Fragment,{children:[i,u]}):t.jsxs(t.Fragment,{children:[u,i]})})}return i});x.displayName="Switch";exports.Switch=x;exports.SwitchSide=b;exports.SwitchVariant=h;
|
package/dist/switch.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
4
|
+
/**
|
|
5
|
+
* Visual style variants for Switch component
|
|
6
|
+
*/
|
|
7
|
+
export declare enum SwitchVariant {
|
|
8
|
+
/** Default variant with inline switch and side label */
|
|
9
|
+
DEFAULT = "default",
|
|
10
|
+
/** Box variant with bordered container, label, and description */
|
|
11
|
+
BOX = "box"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Label position for switch (used in Default variant)
|
|
15
|
+
*/
|
|
16
|
+
export declare enum SwitchSide {
|
|
17
|
+
/** Label positioned on the left side */
|
|
18
|
+
LEFT = "left",
|
|
19
|
+
/** Label positioned on the right side */
|
|
20
|
+
RIGHT = "right"
|
|
21
|
+
}
|
|
22
|
+
declare const switchVariants: (props?: ({
|
|
23
|
+
variant?: "default" | "box" | null | undefined;
|
|
24
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
25
|
+
interface SwitchProps extends Omit<React.ComponentProps<typeof SwitchPrimitive.Root>, "asChild">, VariantProps<typeof switchVariants> {
|
|
26
|
+
/** Data hook for automated testing (REQUIRED) */
|
|
27
|
+
dataHook: string;
|
|
28
|
+
/** Tracking element identifier for analytics */
|
|
29
|
+
trackingEl?: string;
|
|
30
|
+
/** Tracking label for analytics context */
|
|
31
|
+
trackingLabel?: string;
|
|
32
|
+
/** Visual style variant */
|
|
33
|
+
variant?: SwitchVariant;
|
|
34
|
+
/** Label text for the switch */
|
|
35
|
+
label?: string;
|
|
36
|
+
/** Description text (visible in Box variant) */
|
|
37
|
+
description?: string;
|
|
38
|
+
/** Label position - left or right (for Default variant) */
|
|
39
|
+
side?: SwitchSide;
|
|
40
|
+
}
|
|
41
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
42
|
+
export { Switch, type SwitchProps };
|
|
43
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE;;GAEG;AACH,oBAAY,aAAa;IACvB,wDAAwD;IACxD,OAAO,YAAY;IACnB,kEAAkE;IAClE,GAAG,QAAQ;CACZ;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,wCAAwC;IACxC,IAAI,SAAS;IACb,yCAAyC;IACzC,KAAK,UAAU;CAChB;AAED,QAAA,MAAM,cAAc;;8EAkBnB,CAAC;AAEF,UAAU,WACR,SACE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,EAClE,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,QAAA,MAAM,MAAM,oGAoGX,CAAC;AAIF,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.figma.d.ts","sourceRoot":"","sources":["../../src/components/switch.figma.tsx"],"names":[],"mappings":""}
|
package/dist/switch.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx as t, jsxs as s, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import * as u from "@radix-ui/react-switch";
|
|
4
|
+
import { cva as g } from "class-variance-authority";
|
|
5
|
+
import { cn as i } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
var w = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.BOX = "box", e))(w || {}), k = /* @__PURE__ */ ((e) => (e.LEFT = "left", e.RIGHT = "right", e))(k || {});
|
|
7
|
+
const v = g(
|
|
8
|
+
[
|
|
9
|
+
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring dark:focus-visible:border-neutral-500 dark:data-[state=unchecked]:bg-input/80",
|
|
10
|
+
"inline-flex h-5 w-9 shrink-0 items-center rounded-full border-1 border-transparent shadow-xs transition-all outline-none focus-visible:shadow-default",
|
|
11
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
12
|
+
"pl-[1px]"
|
|
13
|
+
],
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
default: [],
|
|
18
|
+
box: []
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "default"
|
|
23
|
+
/* DEFAULT */
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
), N = x.forwardRef(
|
|
27
|
+
({
|
|
28
|
+
className: e,
|
|
29
|
+
variant: r = "default",
|
|
30
|
+
dataHook: f,
|
|
31
|
+
trackingEl: h,
|
|
32
|
+
trackingLabel: b,
|
|
33
|
+
label: a,
|
|
34
|
+
description: l,
|
|
35
|
+
side: o = "right",
|
|
36
|
+
...d
|
|
37
|
+
}, p) => {
|
|
38
|
+
const n = /* @__PURE__ */ t(
|
|
39
|
+
u.Root,
|
|
40
|
+
{
|
|
41
|
+
ref: p,
|
|
42
|
+
className: i(v({ variant: r }), e),
|
|
43
|
+
"data-hook": f,
|
|
44
|
+
"data-slot": "switch",
|
|
45
|
+
"data-tracking-el": h || `switch-${r}`,
|
|
46
|
+
"data-tracking-label": b,
|
|
47
|
+
...d,
|
|
48
|
+
children: /* @__PURE__ */ t(
|
|
49
|
+
u.Thumb,
|
|
50
|
+
{
|
|
51
|
+
className: i(
|
|
52
|
+
"bg-background",
|
|
53
|
+
"pointer-events-none block size-4 rounded-full ring-0 transition-transform",
|
|
54
|
+
"data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
55
|
+
),
|
|
56
|
+
"data-slot": "switch-thumb"
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
if (r === "default")
|
|
62
|
+
return /* @__PURE__ */ s(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: i(
|
|
66
|
+
"flex items-center gap-2",
|
|
67
|
+
o === "left" && "flex-row-reverse"
|
|
68
|
+
),
|
|
69
|
+
children: [
|
|
70
|
+
n,
|
|
71
|
+
a && /* @__PURE__ */ t(
|
|
72
|
+
"label",
|
|
73
|
+
{
|
|
74
|
+
className: "cursor-pointer text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
75
|
+
htmlFor: d.id,
|
|
76
|
+
children: a
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
if (r === "box") {
|
|
83
|
+
const c = /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: [
|
|
84
|
+
a && /* @__PURE__ */ t(
|
|
85
|
+
"label",
|
|
86
|
+
{
|
|
87
|
+
className: "cursor-pointer text-sm leading-none font-medium",
|
|
88
|
+
htmlFor: d.id,
|
|
89
|
+
children: a
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
l && /* @__PURE__ */ t("p", { className: "text-muted-foreground text-sm leading-normal", children: l })
|
|
93
|
+
] });
|
|
94
|
+
return /* @__PURE__ */ t("div", { className: "border-border flex items-center justify-between gap-4 rounded-lg border p-4", children: o === "left" ? /* @__PURE__ */ s(m, { children: [
|
|
95
|
+
n,
|
|
96
|
+
c
|
|
97
|
+
] }) : /* @__PURE__ */ s(m, { children: [
|
|
98
|
+
c,
|
|
99
|
+
n
|
|
100
|
+
] }) });
|
|
101
|
+
}
|
|
102
|
+
return n;
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
N.displayName = "Switch";
|
|
106
|
+
export {
|
|
107
|
+
N as Switch,
|
|
108
|
+
k as SwitchSide,
|
|
109
|
+
w as SwitchVariant
|
|
110
|
+
};
|
package/dist/table.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),w=require("react"),b=require("class-variance-authority"),r=require("@brightlocal/ui-components/lib/utils");function N(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const l=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,l.get?l:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const s=N(w);var c=(a=>(a.DEFAULT="default",a.MD="md",a.LG="lg",a))(c||{});const j=b.cva("align-middle bg-transparent text-foreground text-sm font-normal leading-normal break-words",{variants:{size:{default:"h-12 p-2",md:"h-16 p-2",lg:"h-24 p-2"},align:{left:"text-left",right:"text-right"}},defaultVariants:{size:"default",align:"left"}}),R=b.cva("h-10 p-2 border-b align-middle text-muted-foreground text-sm font-medium leading-normal hover:bg-muted/50 break-words",{variants:{align:{left:"text-left",right:"text-right"}},defaultVariants:{align:"left"}}),f=s.forwardRef(({className:a,dataHook:t,trackingEl:e,trackingLabel:l,...d},n)=>o.jsx("div",{className:"relative w-full overflow-x-auto","data-slot":"table-container",children:o.jsx("table",{ref:n,className:r.cn("w-full caption-bottom text-sm",a),"data-hook":t,"data-slot":"table","data-tracking-el":e,"data-tracking-label":l,...d})}));f.displayName="Table";const m=s.forwardRef(({className:a,dataHook:t,...e},l)=>o.jsx("thead",{ref:l,className:r.cn("[&_tr]:border-b",a),"data-hook":t,"data-slot":"table-header",...e}));m.displayName="TableHeader";const u=s.forwardRef(({className:a,dataHook:t,...e},l)=>o.jsx("tbody",{ref:l,className:r.cn("[&_tr:last-child]:border-0",a),"data-hook":t,"data-slot":"table-body",...e}));u.displayName="TableBody";const g=s.forwardRef(({className:a,dataHook:t,...e},l)=>o.jsx("tfoot",{ref:l,className:r.cn("bg-muted/50 border-t [&>tr]:last:border-b-0",a),"data-hook":t,"data-slot":"table-footer",...e}));g.displayName="TableFooter";const p=s.forwardRef(({className:a,dataHook:t,...e},l)=>o.jsx("tr",{ref:l,className:r.cn("data-[state=selected]:bg-muted border-b transition-colors",a),"data-hook":t,"data-slot":"table-row",...e}));p.displayName="TableRow";const T=s.forwardRef(({className:a,dataHook:t,align:e,minWidth:l,style:d,...n},i)=>o.jsx("th",{ref:i,className:r.cn(R({align:e}),a),"data-hook":t,"data-slot":"table-head",style:{minWidth:l,...d},...n}));T.displayName="TableHead";const h=s.forwardRef(({className:a,dataHook:t,size:e,align:l,minWidth:d,style:n,...i},y)=>o.jsx("td",{ref:y,className:r.cn(j({size:e,align:l}),a),"data-hook":t,"data-slot":"table-cell",style:{minWidth:d,...n},...i}));h.displayName="TableCell";const x=s.forwardRef(({className:a,dataHook:t,...e},l)=>o.jsx("caption",{ref:l,className:r.cn("text-muted-foreground mt-4 text-sm",a),"data-hook":t,"data-slot":"table-caption",...e}));x.displayName="TableCaption";exports.Table=f;exports.TableBody=u;exports.TableCaption=x;exports.TableCell=h;exports.TableFooter=g;exports.TableHead=T;exports.TableHeader=m;exports.TableRow=p;exports.TableSize=c;
|
package/dist/table.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Table size variants
|
|
5
|
+
*/
|
|
6
|
+
export declare enum TableSize {
|
|
7
|
+
/** Default size - compact padding */
|
|
8
|
+
DEFAULT = "default",
|
|
9
|
+
/** Medium size - moderate padding */
|
|
10
|
+
MD = "md",
|
|
11
|
+
/** Large size - spacious padding */
|
|
12
|
+
LG = "lg"
|
|
13
|
+
}
|
|
14
|
+
declare const tableCellVariants: (props?: ({
|
|
15
|
+
size?: TableSize | null | undefined;
|
|
16
|
+
align?: "left" | "right" | null | undefined;
|
|
17
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
18
|
+
declare const tableHeadVariants: (props?: ({
|
|
19
|
+
align?: "left" | "right" | null | undefined;
|
|
20
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
21
|
+
interface TableProps extends React.ComponentProps<"table"> {
|
|
22
|
+
/**
|
|
23
|
+
* Data hook for automated testing (REQUIRED)
|
|
24
|
+
*/
|
|
25
|
+
dataHook: string;
|
|
26
|
+
/**
|
|
27
|
+
* Tracking element identifier for analytics
|
|
28
|
+
*/
|
|
29
|
+
trackingEl?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Tracking label for analytics context
|
|
32
|
+
*/
|
|
33
|
+
trackingLabel?: string;
|
|
34
|
+
}
|
|
35
|
+
declare const Table: React.ForwardRefExoticComponent<Omit<TableProps, "ref"> & React.RefAttributes<HTMLTableElement>>;
|
|
36
|
+
interface TableHeaderProps extends React.ComponentProps<"thead"> {
|
|
37
|
+
/**
|
|
38
|
+
* Data hook for automated testing
|
|
39
|
+
*/
|
|
40
|
+
dataHook?: string;
|
|
41
|
+
}
|
|
42
|
+
declare const TableHeader: React.ForwardRefExoticComponent<Omit<TableHeaderProps, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
43
|
+
interface TableBodyProps extends React.ComponentProps<"tbody"> {
|
|
44
|
+
/**
|
|
45
|
+
* Data hook for automated testing
|
|
46
|
+
*/
|
|
47
|
+
dataHook?: string;
|
|
48
|
+
}
|
|
49
|
+
declare const TableBody: React.ForwardRefExoticComponent<Omit<TableBodyProps, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
50
|
+
interface TableFooterProps extends React.ComponentProps<"tfoot"> {
|
|
51
|
+
/**
|
|
52
|
+
* Data hook for automated testing
|
|
53
|
+
*/
|
|
54
|
+
dataHook?: string;
|
|
55
|
+
}
|
|
56
|
+
declare const TableFooter: React.ForwardRefExoticComponent<Omit<TableFooterProps, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
57
|
+
interface TableRowProps extends React.ComponentProps<"tr"> {
|
|
58
|
+
/**
|
|
59
|
+
* Data hook for automated testing
|
|
60
|
+
*/
|
|
61
|
+
dataHook?: string;
|
|
62
|
+
}
|
|
63
|
+
declare const TableRow: React.ForwardRefExoticComponent<Omit<TableRowProps, "ref"> & React.RefAttributes<HTMLTableRowElement>>;
|
|
64
|
+
interface TableHeadProps extends Omit<React.ComponentProps<"th">, "align">, VariantProps<typeof tableHeadVariants> {
|
|
65
|
+
/**
|
|
66
|
+
* Data hook for automated testing
|
|
67
|
+
*/
|
|
68
|
+
dataHook?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Minimum width for the column (e.g., "100px", "8rem")
|
|
71
|
+
*/
|
|
72
|
+
minWidth?: string;
|
|
73
|
+
}
|
|
74
|
+
declare const TableHead: React.ForwardRefExoticComponent<Omit<TableHeadProps, "ref"> & React.RefAttributes<HTMLTableCellElement>>;
|
|
75
|
+
interface TableCellProps extends Omit<React.ComponentProps<"td">, "align">, VariantProps<typeof tableCellVariants> {
|
|
76
|
+
/**
|
|
77
|
+
* Data hook for automated testing
|
|
78
|
+
*/
|
|
79
|
+
dataHook?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Minimum width for the cell (e.g., "100px", "8rem")
|
|
82
|
+
*/
|
|
83
|
+
minWidth?: string;
|
|
84
|
+
}
|
|
85
|
+
declare const TableCell: React.ForwardRefExoticComponent<Omit<TableCellProps, "ref"> & React.RefAttributes<HTMLTableCellElement>>;
|
|
86
|
+
interface TableCaptionProps extends React.ComponentProps<"caption"> {
|
|
87
|
+
/**
|
|
88
|
+
* Data hook for automated testing
|
|
89
|
+
*/
|
|
90
|
+
dataHook?: string;
|
|
91
|
+
}
|
|
92
|
+
declare const TableCaption: React.ForwardRefExoticComponent<Omit<TableCaptionProps, "ref"> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
93
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
94
|
+
export type { TableProps, TableHeaderProps, TableBodyProps, TableFooterProps, TableRowProps, TableHeadProps, TableCellProps, TableCaptionProps, };
|
|
95
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/components/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE;;GAEG;AACH,oBAAY,SAAS;IACnB,qCAAqC;IACrC,OAAO,YAAY;IACnB,qCAAqC;IACrC,EAAE,OAAO;IACT,oCAAoC;IACpC,EAAE,OAAO;CACV;AAED,QAAA,MAAM,iBAAiB;;;8EAmBtB,CAAC;AAEF,QAAA,MAAM,iBAAiB;;8EAatB,CAAC;AAEF,UAAU,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IACxD;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,KAAK,kGAiBV,CAAC;AAIF,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IAC9D;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,WAAW,+GAUhB,CAAC;AAIF,UAAU,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IAC5D;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,SAAS,6GAUd,CAAC;AAIF,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IAC9D;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,WAAW,+GAUhB,CAAC;AAIF,UAAU,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;IACxD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,QAAQ,wGAab,CAAC;AAIF,UAAU,cACR,SACE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,EACzC,YAAY,CAAC,OAAO,iBAAiB,CAAC;IACxC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,SAAS,0GAWd,CAAC;AAIF,UAAU,cACR,SACE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,EACzC,YAAY,CAAC,OAAO,iBAAiB,CAAC;IACxC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,SAAS,0GAWd,CAAC;AAIF,UAAU,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC;IACjE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,YAAY,gHAWhB,CAAC;AAIH,OAAO,EACL,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GACb,CAAC;AAEF,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,GAClB,CAAC"}
|