@brightlocal/ui-components 3.4.0 → 3.5.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/AI_USAGE.md +22 -3
- package/README.md +177 -109
- package/component-meta.json +1061 -102
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +13 -2
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +4 -3
- package/dist/banner.cjs +1 -1
- package/dist/banner.d.ts +47 -11
- package/dist/banner.d.ts.map +1 -1
- package/dist/banner.js +156 -79
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +40 -5
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +59 -52
- package/dist/blocks/input-list.d.ts +1 -0
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +12 -6
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +64 -63
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +47 -43
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +12 -0
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +115 -97
- package/dist/chart.cjs +6 -6
- package/dist/chart.d.ts +6 -10
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +281 -296
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +430 -343
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +23 -2
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +212 -207
- package/dist/count-indicator.cjs +1 -0
- package/dist/count-indicator.d.ts +85 -0
- package/dist/count-indicator.d.ts.map +1 -0
- package/dist/count-indicator.js +72 -0
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +101 -11
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +593 -523
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +26 -3
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +62 -47
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +8 -4
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +37 -38
- package/dist/file-upload.cjs +1 -0
- package/dist/file-upload.d.ts +546 -0
- package/dist/file-upload.d.ts.map +1 -0
- package/dist/file-upload.js +1103 -0
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +7 -2
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +52 -52
- package/dist/hooks/use-file-dropzone.cjs +1 -0
- package/dist/hooks/use-file-dropzone.d.ts +75 -0
- package/dist/hooks/use-file-dropzone.d.ts.map +1 -0
- package/dist/hooks/use-file-dropzone.js +133 -0
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +29 -16
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +153 -36
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +676 -640
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.d.ts +30 -1
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +131 -115
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +37 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +131 -114
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.js +6 -6
- package/dist/lib/empty-canvas.cjs +1 -1
- package/dist/lib/empty-canvas.d.ts +27 -1
- package/dist/lib/empty-canvas.d.ts.map +1 -1
- package/dist/lib/empty-canvas.js +27 -23
- package/dist/lib/empty-chip.cjs +1 -1
- package/dist/lib/empty-chip.d.ts +19 -2
- package/dist/lib/empty-chip.d.ts.map +1 -1
- package/dist/lib/empty-chip.js +14 -9
- package/dist/lib/field-aria.cjs +1 -1
- package/dist/lib/field-aria.d.ts +4 -4
- package/dist/lib/field-aria.d.ts.map +1 -1
- package/dist/lib/field-aria.js +7 -5
- package/dist/lib/media-viewer-content.cjs +1 -1
- package/dist/lib/media-viewer-content.js +1 -1
- package/dist/lib/table-internal.cjs +1 -1
- package/dist/lib/table-internal.d.ts +19 -0
- package/dist/lib/table-internal.d.ts.map +1 -1
- package/dist/lib/table-internal.js +22 -7
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts +13 -0
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +103 -82
- package/dist/logo-mark.cjs +1 -1
- package/dist/logo-mark.d.ts +18 -2
- package/dist/logo-mark.d.ts.map +1 -1
- package/dist/logo-mark.js +159 -79
- package/dist/media-empty.cjs +1 -1
- package/dist/media-empty.d.ts +50 -7
- package/dist/media-empty.d.ts.map +1 -1
- package/dist/media-empty.js +14 -13
- package/dist/media-viewer.cjs +1 -1
- package/dist/media-viewer.js +6 -6
- package/dist/multi-select-filter.cjs +1 -1
- package/dist/multi-select-filter.d.ts.map +1 -1
- package/dist/multi-select-filter.js +92 -101
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +11 -0
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +17 -17
- package/dist/relative-date.d.ts +6 -0
- package/dist/relative-date.d.ts.map +1 -1
- package/dist/resizable.d.ts +1 -1
- package/dist/result-count.cjs +1 -1
- package/dist/result-count.d.ts +13 -16
- package/dist/result-count.d.ts.map +1 -1
- package/dist/result-count.js +24 -33
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +22 -3
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +152 -125
- package/dist/single-select-filter.cjs +1 -1
- package/dist/single-select-filter.d.ts.map +1 -1
- package/dist/single-select-filter.js +67 -76
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +77 -76
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +39 -3
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +127 -76
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.d.ts +34 -0
- package/dist/textarea.d.ts.map +1 -1
- package/dist/textarea.js +115 -19
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +137 -131
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +6 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +14 -13
- package/package.json +3 -4
- package/src/blocks/empty-state.tsx +108 -48
- package/src/blocks/input-list.tsx +1 -0
- package/src/blocks/sidebar.tsx +39 -16
- package/src/components/alert-dialog.tsx +18 -2
- package/src/components/banner.tsx +247 -68
- package/src/components/button.tsx +27 -10
- package/src/components/card.tsx +89 -7
- package/src/components/chart.tsx +47 -67
- package/src/components/combobox.tsx +221 -12
- package/src/components/command.tsx +83 -37
- package/src/components/count-indicator.tsx +188 -0
- package/src/components/data-table.tsx +506 -159
- package/src/components/dialog.tsx +74 -5
- package/src/components/drawer.tsx +52 -32
- package/src/components/file-upload.tsx +2574 -0
- package/src/components/global-layout.tsx +18 -5
- package/src/components/hover-card.tsx +395 -65
- package/src/components/input-chip.tsx +67 -2
- package/src/components/input-group.tsx +89 -6
- package/src/components/list.tsx +40 -3
- package/src/components/logo-mark.tsx +109 -25
- package/src/components/media-empty.tsx +62 -7
- package/src/components/multi-select-filter.tsx +9 -16
- package/src/components/pagination.tsx +15 -2
- package/src/components/relative-date.tsx +6 -0
- package/src/components/result-count.tsx +27 -54
- package/src/components/sheet.tsx +86 -8
- package/src/components/single-select-filter.tsx +9 -16
- package/src/components/table.tsx +16 -1
- package/src/components/tabs.tsx +223 -41
- package/src/components/textarea.tsx +271 -4
- package/src/components/tooltip.tsx +29 -2
- package/src/components/typography-text.tsx +7 -2
- package/src/hooks/use-file-dropzone.ts +325 -0
- package/src/index.ts +3 -0
- package/src/lib/empty-canvas.tsx +47 -20
- package/src/lib/empty-chip.tsx +38 -3
- package/src/lib/field-aria.tsx +11 -6
- package/src/lib/table-internal.ts +38 -0
package/dist/blocks/sidebar.js
CHANGED
|
@@ -12,9 +12,9 @@ import { Sheet as fe, SheetContent as me, SheetDescription as he, SheetTitle as
|
|
|
12
12
|
import { useIsBelowBreakpoint as ve } from "../hooks/use-breakpoint.js";
|
|
13
13
|
import * as n from "react";
|
|
14
14
|
import * as xe from "@radix-ui/react-accordion";
|
|
15
|
-
import { ChevronDown as O, ChevronRight as D, ChevronsUpDown as H, Ellipsis as we, Menu as Ne, Minus as
|
|
15
|
+
import { ChevronDown as O, ChevronRight as D, ChevronsUpDown as H, Ellipsis as we, Menu as Ne, Minus as ye, PanelLeft as ke, Plus as T } from "@brightlocal/icons";
|
|
16
16
|
import { cn as l } from "@brightlocal/ui-components/lib/utils";
|
|
17
|
-
import { Fragment as
|
|
17
|
+
import { Fragment as E, jsx as a, jsxs as c } from "react/jsx-runtime";
|
|
18
18
|
import { Slot as C } from "@radix-ui/react-slot";
|
|
19
19
|
import { cva as P } from "class-variance-authority";
|
|
20
20
|
import { createPortal as Se } from "react-dom";
|
|
@@ -28,9 +28,9 @@ var w = "focus-visible:[box-shadow:0_0_0_1px_color-mix(in_srgb,var(--color-sideb
|
|
|
28
28
|
return e.DEFAULT = "default", e.SM = "sm", e.XS = "xs", e;
|
|
29
29
|
})({}), Da = /* @__PURE__ */ (function(e) {
|
|
30
30
|
return e.DEFAULT = "default", e.COLLAPSIBLE = "collapsible", e.ACTION = "action", e;
|
|
31
|
-
})({}), Aa = /* @__PURE__ */ (function(e) {
|
|
32
|
-
return e.SIMPLE = "simple", e.COLLAPSIBLE = "collapsible", e.DROPDOWN = "dropdown", e.BADGE = "badge", e.BIG_ICON = "bigIcon", e.CHECKBOX = "checkbox", e;
|
|
33
31
|
})({}), Ea = /* @__PURE__ */ (function(e) {
|
|
32
|
+
return e.SIMPLE = "simple", e.COLLAPSIBLE = "collapsible", e.DROPDOWN = "dropdown", e.BADGE = "badge", e.BIG_ICON = "bigIcon", e.CHECKBOX = "checkbox", e;
|
|
33
|
+
})({}), Aa = /* @__PURE__ */ (function(e) {
|
|
34
34
|
return e.DEFAULT = "default", e.SM = "sm", e.LG = "lg", e;
|
|
35
35
|
})({}), _a = /* @__PURE__ */ (function(e) {
|
|
36
36
|
return e.DEFAULT = "default", e.BORDER = "border", e.INDENT = "indent", e;
|
|
@@ -39,13 +39,13 @@ var w = "focus-visible:[box-shadow:0_0_0_1px_color-mix(in_srgb,var(--color-sideb
|
|
|
39
39
|
})({}), Ta = /* @__PURE__ */ (function(e) {
|
|
40
40
|
return e.CARET = "caret", e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e.UP_DOWN = "upDown", e.PLUS_MINUS = "plusMinus", e.DOTS = "dots", e;
|
|
41
41
|
})({}), Ce = "sidebar:state", Re = 604800, Me = "288px", Ie = "48px", De = "b", G = n.createContext(null);
|
|
42
|
-
function
|
|
42
|
+
function k() {
|
|
43
43
|
const e = n.useContext(G);
|
|
44
44
|
if (!e) throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
45
45
|
return e;
|
|
46
46
|
}
|
|
47
|
-
var
|
|
48
|
-
const f = ve("lg"), [g, v] = n.useState(!1), [h,
|
|
47
|
+
var Ee = n.forwardRef(({ dataHook: e, trackingEl: t, trackingLabel: r, defaultOpen: o = !0, open: i, onOpenChange: s, className: d, style: u, children: m, ...p }, b) => {
|
|
48
|
+
const f = ve("lg"), [g, v] = n.useState(!1), [h, y] = n.useState(null), [I, X] = n.useState(o), S = i ?? I, R = n.useCallback((x) => {
|
|
49
49
|
const N = typeof x == "function" ? x(S) : x;
|
|
50
50
|
s ? s(N) : X(N), document.cookie = `${Ce}=${N}; path=/; max-age=${Re}`;
|
|
51
51
|
}, [s, S]), M = n.useCallback(() => f ? v((x) => !x) : R((x) => !x), [
|
|
@@ -68,7 +68,7 @@ var Ae = n.forwardRef(({ dataHook: e, trackingEl: t, trackingLabel: r, defaultOp
|
|
|
68
68
|
setOpenMobile: v,
|
|
69
69
|
toggleSidebar: M,
|
|
70
70
|
footerPortalEl: h,
|
|
71
|
-
setFooterPortalEl:
|
|
71
|
+
setFooterPortalEl: y
|
|
72
72
|
}), [
|
|
73
73
|
L,
|
|
74
74
|
S,
|
|
@@ -101,9 +101,9 @@ var Ae = n.forwardRef(({ dataHook: e, trackingEl: t, trackingLabel: r, defaultOp
|
|
|
101
101
|
})
|
|
102
102
|
});
|
|
103
103
|
});
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
const { isMobile: v, state: h, openMobile:
|
|
104
|
+
Ee.displayName = "SidebarProvider";
|
|
105
|
+
var Ae = n.forwardRef(({ dataHook: e, trackingEl: t, trackingLabel: r, side: o = "left", variant: i = "sidebar", collapsible: s = "offcanvas", embedded: d, mobileTitle: u, mobileDescription: m, className: p, children: b, ...f }, g) => {
|
|
106
|
+
const { isMobile: v, state: h, openMobile: y, setOpenMobile: I } = k();
|
|
107
107
|
return s === "none" ? /* @__PURE__ */ a("div", {
|
|
108
108
|
ref: g,
|
|
109
109
|
className: l("text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", p),
|
|
@@ -114,7 +114,7 @@ var Ee = n.forwardRef(({ dataHook: e, trackingEl: t, trackingLabel: r, side: o =
|
|
|
114
114
|
...f,
|
|
115
115
|
children: b
|
|
116
116
|
}) : v ? /* @__PURE__ */ a(fe, {
|
|
117
|
-
open:
|
|
117
|
+
open: y,
|
|
118
118
|
onOpenChange: I,
|
|
119
119
|
children: /* @__PURE__ */ c(me, {
|
|
120
120
|
className: "bg-sidebar-background text-sidebar-foreground p-6",
|
|
@@ -153,9 +153,9 @@ var Ee = n.forwardRef(({ dataHook: e, trackingEl: t, trackingLabel: r, side: o =
|
|
|
153
153
|
children: b
|
|
154
154
|
});
|
|
155
155
|
});
|
|
156
|
-
|
|
157
|
-
var
|
|
158
|
-
const { toggleSidebar: u } =
|
|
156
|
+
Ae.displayName = "Sidebar";
|
|
157
|
+
var $ = n.forwardRef(({ className: e, onClick: t, dataHook: r = "sidebar-trigger", toggleAriaLabel: o, children: i, ...s }, d) => {
|
|
158
|
+
const { toggleSidebar: u } = k(), m = o ?? "Toggle sidebar";
|
|
159
159
|
return /* @__PURE__ */ c(F, {
|
|
160
160
|
ref: d,
|
|
161
161
|
iconOnly: !0,
|
|
@@ -169,15 +169,15 @@ var j = n.forwardRef(({ className: e, onClick: t, dataHook: r = "sidebar-trigger
|
|
|
169
169
|
t?.(p), u();
|
|
170
170
|
},
|
|
171
171
|
...s,
|
|
172
|
-
children: [i || /* @__PURE__ */ a(
|
|
172
|
+
children: [i || /* @__PURE__ */ a(ke, {}), /* @__PURE__ */ a("span", {
|
|
173
173
|
className: "sr-only",
|
|
174
174
|
children: m
|
|
175
175
|
})]
|
|
176
176
|
});
|
|
177
177
|
});
|
|
178
|
-
|
|
178
|
+
$.displayName = "SidebarTrigger";
|
|
179
179
|
var _e = n.forwardRef(({ className: e, toggleAriaLabel: t, ...r }, o) => {
|
|
180
|
-
const { toggleSidebar: i } =
|
|
180
|
+
const { toggleSidebar: i } = k(), s = t ?? "Toggle sidebar";
|
|
181
181
|
return /* @__PURE__ */ a("button", {
|
|
182
182
|
ref: o,
|
|
183
183
|
"aria-label": s,
|
|
@@ -217,7 +217,7 @@ var Pe = n.forwardRef(({ className: e, dataHook: t, ...r }, o) => /* @__PURE__ *
|
|
|
217
217
|
}));
|
|
218
218
|
Pe.displayName = "SidebarHeader";
|
|
219
219
|
var ze = n.forwardRef(({ className: e, dataHook: t, separator: r = !0, ...o }, i) => {
|
|
220
|
-
const { footerPortalEl: s } =
|
|
220
|
+
const { footerPortalEl: s } = k(), d = /* @__PURE__ */ c(E, { children: [r && /* @__PURE__ */ a(_, {
|
|
221
221
|
className: "group-data-[collapsible=icon]:mx-0",
|
|
222
222
|
"data-slot": "sidebar-footer-separator",
|
|
223
223
|
spacing: "md"
|
|
@@ -239,7 +239,7 @@ var Le = n.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ a(_, {
|
|
|
239
239
|
}));
|
|
240
240
|
Le.displayName = "SidebarSeparator";
|
|
241
241
|
var Be = n.forwardRef(({ className: e, dataHook: t, ariaLabel: r = "Sidebar", children: o, ...i }, s) => {
|
|
242
|
-
const { isMobile: d, setFooterPortalEl: u } =
|
|
242
|
+
const { isMobile: d, setFooterPortalEl: u } = k(), m = n.useCallback((p) => {
|
|
243
243
|
const b = p?.querySelector('[data-slot="scroll-area-viewport"]');
|
|
244
244
|
b && (b.tabIndex = -1), typeof s == "function" ? s(p) : s && (s.current = p);
|
|
245
245
|
}, [s]);
|
|
@@ -273,7 +273,7 @@ var He = P(["flex h-8 shrink-0 items-center rounded-md px-2 text-sidebar-foregro
|
|
|
273
273
|
variants: {
|
|
274
274
|
size: {
|
|
275
275
|
default: "text-label",
|
|
276
|
-
sm: "text-label",
|
|
276
|
+
sm: "text-label-sm",
|
|
277
277
|
xs: "text-label-sm"
|
|
278
278
|
},
|
|
279
279
|
variant: {
|
|
@@ -320,40 +320,40 @@ var He = P(["flex h-8 shrink-0 items-center rounded-md px-2 text-sidebar-foregro
|
|
|
320
320
|
});
|
|
321
321
|
});
|
|
322
322
|
Ge.displayName = "SidebarGroupLabel";
|
|
323
|
-
var
|
|
323
|
+
var $e = n.forwardRef(({ className: e, asChild: t = !1, ...r }, o) => /* @__PURE__ */ a(t ? C : "button", {
|
|
324
324
|
ref: o,
|
|
325
325
|
className: l("text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground duration-base absolute top-3.5 right-3 flex aspect-square w-5 cursor-pointer items-center justify-center rounded-md p-0 transition-transform ease-in-out outline-none [&>svg]:shrink-0", w, "after:absolute after:-inset-2 after:md:hidden", "group-data-[collapsible=icon]:hidden", e),
|
|
326
326
|
"data-slot": "sidebar-group-action",
|
|
327
327
|
...r
|
|
328
328
|
}));
|
|
329
|
-
|
|
330
|
-
var
|
|
329
|
+
$e.displayName = "SidebarGroupAction";
|
|
330
|
+
var je = n.forwardRef(({ className: e, dataHook: t, ...r }, o) => /* @__PURE__ */ a("div", {
|
|
331
331
|
ref: o,
|
|
332
332
|
className: l("text-body-sm w-full", e),
|
|
333
333
|
"data-hook": t,
|
|
334
334
|
"data-slot": "sidebar-group-content",
|
|
335
335
|
...r
|
|
336
336
|
}));
|
|
337
|
-
|
|
338
|
-
var
|
|
337
|
+
je.displayName = "SidebarGroupContent";
|
|
338
|
+
var Ue = n.forwardRef(({ className: e, dataHook: t, ...r }, o) => /* @__PURE__ */ a("ul", {
|
|
339
339
|
ref: o,
|
|
340
340
|
className: l("flex w-full min-w-0 flex-col gap-1", e),
|
|
341
341
|
"data-hook": t,
|
|
342
342
|
"data-slot": "sidebar-menu",
|
|
343
343
|
...r
|
|
344
344
|
}));
|
|
345
|
-
|
|
346
|
-
var
|
|
347
|
-
function
|
|
345
|
+
Ue.displayName = "SidebarMenu";
|
|
346
|
+
var j = "relative before:absolute before:inset-x-0 before:-top-1 before:h-1 before:cursor-pointer before:content-['']";
|
|
347
|
+
function U(e) {
|
|
348
348
|
e.target === e.currentTarget && e.currentTarget.querySelector("a[href], button")?.click();
|
|
349
349
|
}
|
|
350
350
|
var K = n.forwardRef(({ className: e, dataHook: t, onClick: r, ...o }, i) => /* @__PURE__ */ a("li", {
|
|
351
351
|
ref: i,
|
|
352
|
-
className: l("group/menu-item",
|
|
352
|
+
className: l("group/menu-item", j, "first:before:hidden", e),
|
|
353
353
|
"data-hook": t,
|
|
354
354
|
"data-slot": "sidebar-menu-item",
|
|
355
355
|
onClick: (s) => {
|
|
356
|
-
r?.(s),
|
|
356
|
+
r?.(s), U(s);
|
|
357
357
|
},
|
|
358
358
|
...o
|
|
359
359
|
}));
|
|
@@ -373,7 +373,7 @@ var Ke = n.forwardRef(({ type: e = "caret", isActive: t = !1, className: r, ...o
|
|
|
373
373
|
case "upDown":
|
|
374
374
|
return /* @__PURE__ */ a(H, { ...s });
|
|
375
375
|
case "plusMinus":
|
|
376
|
-
return t ? /* @__PURE__ */ a(
|
|
376
|
+
return t ? /* @__PURE__ */ a(ye, { ...s }) : /* @__PURE__ */ a(T, { ...s });
|
|
377
377
|
case "dots":
|
|
378
378
|
return /* @__PURE__ */ a(we, { ...s });
|
|
379
379
|
default:
|
|
@@ -406,9 +406,9 @@ var qe = P([
|
|
|
406
406
|
size: "default"
|
|
407
407
|
}
|
|
408
408
|
}), z = n.forwardRef(({ asChild: e = !1, isActive: t = !1, variant: r = "simple", size: o = "default", tooltip: i, className: s, dataHook: d, ...u }, m) => {
|
|
409
|
-
const p = e ? C : "button", { isMobile: b, state: f } =
|
|
409
|
+
const p = e ? C : "button", { isMobile: b, state: f } = k(), g = f === "collapsed" && !b, [v, h] = n.useState(!1);
|
|
410
410
|
!g && v && h(!1);
|
|
411
|
-
const
|
|
411
|
+
const y = /* @__PURE__ */ a(p, {
|
|
412
412
|
ref: m,
|
|
413
413
|
className: l(qe({
|
|
414
414
|
variant: r,
|
|
@@ -429,7 +429,7 @@ var qe = P([
|
|
|
429
429
|
onOpenChange: g ? h : void 0,
|
|
430
430
|
children: [/* @__PURE__ */ a(ce, {
|
|
431
431
|
asChild: !0,
|
|
432
|
-
children:
|
|
432
|
+
children: y
|
|
433
433
|
}), /* @__PURE__ */ a(de, {
|
|
434
434
|
hideArrow: !0,
|
|
435
435
|
...i,
|
|
@@ -438,7 +438,7 @@ var qe = P([
|
|
|
438
438
|
side: "right",
|
|
439
439
|
sideOffset: 8
|
|
440
440
|
})]
|
|
441
|
-
})) :
|
|
441
|
+
})) : y;
|
|
442
442
|
});
|
|
443
443
|
z.displayName = "SidebarMenuButton";
|
|
444
444
|
var We = n.forwardRef(({ className: e, asChild: t = !1, showOnHover: r = !1, ...o }, i) => /* @__PURE__ */ a(t ? C : "button", {
|
|
@@ -495,11 +495,11 @@ var Ye = P("flex min-w-0 flex-col items-start gap-1 py-1 group-data-[collapsible
|
|
|
495
495
|
q.displayName = "SidebarMenuSub";
|
|
496
496
|
var Ze = n.forwardRef(({ className: e, dataHook: t, onClick: r, ...o }, i) => /* @__PURE__ */ a("li", {
|
|
497
497
|
ref: i,
|
|
498
|
-
className: l(
|
|
498
|
+
className: l(j, "last:after:absolute last:after:inset-x-0 last:after:-bottom-1 last:after:h-1 last:after:cursor-pointer last:after:content-['']", e),
|
|
499
499
|
"data-hook": t,
|
|
500
500
|
"data-slot": "sidebar-menu-sub-item",
|
|
501
501
|
onClick: (s) => {
|
|
502
|
-
r?.(s),
|
|
502
|
+
r?.(s), U(s);
|
|
503
503
|
},
|
|
504
504
|
...o
|
|
505
505
|
}));
|
|
@@ -564,7 +564,7 @@ var ra = n.forwardRef(({ className: e, dataHook: t = "sidebar-drawer", trackingE
|
|
|
564
564
|
"data-tracking-el": r,
|
|
565
565
|
"data-tracking-label": o,
|
|
566
566
|
...s,
|
|
567
|
-
children: /* @__PURE__ */ a(
|
|
567
|
+
children: /* @__PURE__ */ a($, {
|
|
568
568
|
dataHook: `${t}-trigger`,
|
|
569
569
|
children: /* @__PURE__ */ a(Ne, { size: 24 })
|
|
570
570
|
})
|
|
@@ -584,7 +584,7 @@ var ta = n.forwardRef(({ className: e, dataHook: t = "sidebar-header-button", ch
|
|
|
584
584
|
ta.displayName = "SidebarHeaderButton";
|
|
585
585
|
var W = n.forwardRef(({ className: e, dataHook: t = "sidebar-popover-trigger", icon: r, triggerAriaLabel: o, children: i, ...s }, d) => /* @__PURE__ */ c("button", {
|
|
586
586
|
ref: d,
|
|
587
|
-
"aria-label": o
|
|
587
|
+
"aria-label": o || void 0,
|
|
588
588
|
className: l("text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground duration-fast text-heading-compact flex items-center gap-2 rounded-md px-1.5 py-2 transition-colors ease-out outline-none", w, e),
|
|
589
589
|
"data-hook": t,
|
|
590
590
|
"data-slot": "sidebar-popover-trigger",
|
|
@@ -606,9 +606,9 @@ var W = n.forwardRef(({ className: e, dataHook: t = "sidebar-popover-trigger", i
|
|
|
606
606
|
]
|
|
607
607
|
}));
|
|
608
608
|
W.displayName = "SidebarPopoverTrigger";
|
|
609
|
-
var
|
|
609
|
+
var A = n.forwardRef(({ className: e, dataHook: t, icon: r, shortcut: o, children: i, ...s }, d) => /* @__PURE__ */ c("button", {
|
|
610
610
|
ref: d,
|
|
611
|
-
className: l("text-popover-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground duration-fast text-label flex h-10 w-full items-center gap-2 rounded-xs p-2 transition-colors ease-out outline-none", w, e),
|
|
611
|
+
className: l("text-popover-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground duration-fast text-label flex min-h-10 w-full items-center gap-2 rounded-xs p-2 transition-colors ease-out outline-none", w, e),
|
|
612
612
|
"data-hook": t,
|
|
613
613
|
"data-slot": "sidebar-popover-menu-item",
|
|
614
614
|
type: "button",
|
|
@@ -619,7 +619,7 @@ var E = n.forwardRef(({ className: e, dataHook: t, icon: r, shortcut: o, childre
|
|
|
619
619
|
children: r
|
|
620
620
|
}),
|
|
621
621
|
/* @__PURE__ */ a("span", {
|
|
622
|
-
className: "min-w-px flex-1
|
|
622
|
+
className: "min-w-px flex-1 text-left wrap-anywhere",
|
|
623
623
|
children: i
|
|
624
624
|
}),
|
|
625
625
|
o && /* @__PURE__ */ a("span", {
|
|
@@ -628,14 +628,14 @@ var E = n.forwardRef(({ className: e, dataHook: t, icon: r, shortcut: o, childre
|
|
|
628
628
|
})
|
|
629
629
|
]
|
|
630
630
|
}));
|
|
631
|
-
|
|
631
|
+
A.displayName = "SidebarPopoverMenuItem";
|
|
632
632
|
var oa = n.forwardRef(({ className: e, dataHook: t = "sidebar-popover-menu", groupTitle: r = "Teams", items: o, addActionLabel: i, addActionIcon: s, onAddAction: d, children: u, ...m }, p) => /* @__PURE__ */ a("div", {
|
|
633
633
|
ref: p,
|
|
634
634
|
className: l("flex flex-col", e),
|
|
635
635
|
"data-hook": t,
|
|
636
636
|
"data-slot": "sidebar-popover-menu",
|
|
637
637
|
...m,
|
|
638
|
-
children: u || /* @__PURE__ */ c(
|
|
638
|
+
children: u || /* @__PURE__ */ c(E, { children: [/* @__PURE__ */ c("div", {
|
|
639
639
|
className: "flex flex-col items-start p-1",
|
|
640
640
|
children: [r && /* @__PURE__ */ a("div", {
|
|
641
641
|
className: "flex w-full items-center px-2 py-1.5",
|
|
@@ -643,15 +643,15 @@ var oa = n.forwardRef(({ className: e, dataHook: t = "sidebar-popover-menu", gro
|
|
|
643
643
|
className: "text-muted-foreground text-label-sm flex-1",
|
|
644
644
|
children: r
|
|
645
645
|
})
|
|
646
|
-
}), o?.map((b, f) => /* @__PURE__ */ a(
|
|
646
|
+
}), o?.map((b, f) => /* @__PURE__ */ a(A, {
|
|
647
647
|
icon: b.icon,
|
|
648
648
|
shortcut: b.shortcut,
|
|
649
649
|
onClick: b.onClick,
|
|
650
650
|
children: b.label
|
|
651
651
|
}, f))]
|
|
652
|
-
}), d && /* @__PURE__ */ c(
|
|
652
|
+
}), d && /* @__PURE__ */ c(E, { children: [/* @__PURE__ */ a(_, {}), /* @__PURE__ */ a("div", {
|
|
653
653
|
className: "flex flex-col items-start p-1",
|
|
654
|
-
children: /* @__PURE__ */ a(
|
|
654
|
+
children: /* @__PURE__ */ a(A, {
|
|
655
655
|
icon: s || /* @__PURE__ */ a(T, { size: 16 }),
|
|
656
656
|
onClick: d,
|
|
657
657
|
children: i ?? "Add team"
|
|
@@ -683,14 +683,14 @@ function sa({ dataHook: e = "sidebar-account-dropdown", name: t, email: r, avata
|
|
|
683
683
|
return /* @__PURE__ */ c(ee, { children: [/* @__PURE__ */ a(ie, {
|
|
684
684
|
asChild: !0,
|
|
685
685
|
children: /* @__PURE__ */ c(z, {
|
|
686
|
-
"aria-label": s
|
|
687
|
-
className: "h-auto py-1.5",
|
|
686
|
+
"aria-label": s || void 0,
|
|
687
|
+
className: "relative h-auto py-1.5",
|
|
688
688
|
dataHook: `${e}-button`,
|
|
689
689
|
size: "lg",
|
|
690
690
|
children: [
|
|
691
691
|
o,
|
|
692
692
|
/* @__PURE__ */ c("div", {
|
|
693
|
-
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
693
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5 group-data-[collapsible=icon]:sr-only group-data-[collapsible=icon]:flex!",
|
|
694
694
|
children: [/* @__PURE__ */ a("span", {
|
|
695
695
|
className: "text-heading-compact truncate",
|
|
696
696
|
children: t
|
|
@@ -710,13 +710,14 @@ function sa({ dataHook: e = "sidebar-account-dropdown", name: t, email: r, avata
|
|
|
710
710
|
sideOffset: 4,
|
|
711
711
|
children: [/* @__PURE__ */ c(te, {
|
|
712
712
|
className: "flex items-center gap-2 px-1 py-1.5",
|
|
713
|
+
dataHook: `${e}-header`,
|
|
713
714
|
children: [o, /* @__PURE__ */ c("div", {
|
|
714
715
|
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
715
716
|
children: [/* @__PURE__ */ a("span", {
|
|
716
|
-
className: "text-heading-compact
|
|
717
|
+
className: "text-heading-compact wrap-anywhere",
|
|
717
718
|
children: t
|
|
718
719
|
}), /* @__PURE__ */ a("span", {
|
|
719
|
-
className: "text-body-xs
|
|
720
|
+
className: "text-body-xs wrap-anywhere",
|
|
720
721
|
children: r
|
|
721
722
|
})]
|
|
722
723
|
})]
|
|
@@ -751,7 +752,7 @@ var na = n.forwardRef(({ className: e, dataHook: t, senderName: r, title: o, des
|
|
|
751
752
|
}));
|
|
752
753
|
na.displayName = "SidebarInboxItem";
|
|
753
754
|
export {
|
|
754
|
-
|
|
755
|
+
Ae as Sidebar,
|
|
755
756
|
sa as SidebarAccountDropdown,
|
|
756
757
|
Ke as SidebarCollapseIcon,
|
|
757
758
|
Ta as SidebarCollapseIconType,
|
|
@@ -760,8 +761,8 @@ export {
|
|
|
760
761
|
ra as SidebarDrawer,
|
|
761
762
|
ze as SidebarFooter,
|
|
762
763
|
Fe as SidebarGroup,
|
|
763
|
-
|
|
764
|
-
|
|
764
|
+
$e as SidebarGroupAction,
|
|
765
|
+
je as SidebarGroupContent,
|
|
765
766
|
Ge as SidebarGroupLabel,
|
|
766
767
|
Ia as SidebarGroupLabelSize,
|
|
767
768
|
Da as SidebarGroupLabelVariant,
|
|
@@ -770,12 +771,12 @@ export {
|
|
|
770
771
|
na as SidebarInboxItem,
|
|
771
772
|
Te as SidebarInput,
|
|
772
773
|
Oe as SidebarInset,
|
|
773
|
-
|
|
774
|
+
Ue as SidebarMenu,
|
|
774
775
|
We as SidebarMenuAction,
|
|
775
776
|
Xe as SidebarMenuBadge,
|
|
776
777
|
z as SidebarMenuButton,
|
|
777
|
-
|
|
778
|
-
|
|
778
|
+
Aa as SidebarMenuButtonSize,
|
|
779
|
+
Ea as SidebarMenuButtonVariant,
|
|
779
780
|
Qe as SidebarMenuCollapsible,
|
|
780
781
|
aa as SidebarMenuCollapsibleContent,
|
|
781
782
|
ea as SidebarMenuCollapsibleTrigger,
|
|
@@ -787,14 +788,14 @@ export {
|
|
|
787
788
|
Ze as SidebarMenuSubItem,
|
|
788
789
|
_a as SidebarMenuSubVariant,
|
|
789
790
|
oa as SidebarPopoverMenu,
|
|
790
|
-
|
|
791
|
+
A as SidebarPopoverMenuItem,
|
|
791
792
|
W as SidebarPopoverTrigger,
|
|
792
|
-
|
|
793
|
+
Ee as SidebarProvider,
|
|
793
794
|
_e as SidebarRail,
|
|
794
795
|
Le as SidebarSeparator,
|
|
795
796
|
Ca as SidebarSide,
|
|
796
797
|
ia as SidebarSwitcher,
|
|
797
|
-
|
|
798
|
+
$ as SidebarTrigger,
|
|
798
799
|
Ra as SidebarVariant,
|
|
799
|
-
|
|
800
|
+
k as useSidebar
|
|
800
801
|
};
|
package/dist/button.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const I=require("./_virtual/_rolldown/runtime.cjs");let i=require("react");i=I.__toESM(i,1);let x=require("@brightlocal/ui-components/lib/utils"),r=require("react/jsx-runtime"),z=require("@radix-ui/react-slot"),E=require("class-variance-authority"),k=require("@brightlocal/ui-components/spinner");var u=(0,E.cva)(["rounded-full","inline-flex","font-semibold","items-center","justify-center","gap-2","whitespace-nowrap","transition-[color,background-color,border-color,box-shadow,opacity]","duration-fast","ease-out","cursor-pointer","disabled:pointer-events-none","disabled:cursor-not-allowed","disabled:opacity-50","aria-disabled:opacity-50","[&_svg]:pointer-events-none","[&_svg]:shrink-0","shrink-0","outline-none","aria-invalid:ring-destructive/20","dark:aria-invalid:ring-destructive/40","aria-invalid:border-destructive"],{variants:{variant:{primary:["bg-primary","dark:bg-green-400","text-primary-foreground","dark:text-[var(--ds-colors-primary-foreground-light)]","hover:bg-primary/90","focus-visible:shadow-default"],secondary:["bg-secondary","text-secondary-foreground","hover:bg-secondary/80","focus-visible:shadow-default"],destructive:["bg-destructive","dark:bg-red-400/90","hover:bg-destructive/80","dark:hover:bg-red-400/90","text-destructive-foreground","dark:text-red-950","focus-visible:shadow-destructive"],outline:["border","border-input","border-solid","bg-background","hover:bg-accent","hover:text-accent-foreground","dark:bg-input/30","dark:border-input","dark:hover:bg-input/80","dark:hover:border-input","focus-visible:shadow-default","focus-visible:border-ring"],warning:["bg-warning-background","hover:bg-warning-background/80","text-warning-foreground","focus-visible:shadow-default"],ghost:["bg-transparent","text-foreground","hover:bg-accent","data-[state=open]:bg-accent","focus-visible:shadow-default"]},size:{default:"px-4 py-2 h-9 text-label",sm:"py-2 px-3 h-8 text-label-sm",lg:"py-2 px-8 h-10 text-label [&_svg:not([class*='size-'])]:size-5"},state:{default:"",loading:"pointer-events-none",disabled:"pointer-events-none opacity-50"},fullWidth:{false:"",true:"w-full"}},defaultVariants:{variant:"primary",size:"default",state:"default",fullWidth:!1}}),w={sm:"size-8 p-0",default:"size-9 p-0",lg:"size-10 p-0"},S={sm:"md",default:"md",lg:"lg"},q=i.forwardRef(({className:b,variant:n="primary",size:t="default",fullWidth:c=!1,asChild:d=!1,dataHook:g,trackingEl:f,trackingLabel:v,iconOnly:j=!1,loading:a=!1,ariaLabel:N,disabled:p=!1,children:e,...l},h)=>{const y=d?z.Slot:"button",_=p||a;let o=j;!o&&i.Children.count(e)===1&&i.isValidElement(e)&&(o=e.props?.children==null);const m=a&&!d;let s="default";a?s="loading":p&&(s="disabled");const B=N??(a?typeof e=="string"||typeof e=="number"?`Loading: ${e}`:"Loading":void 0);return d?(0,r.jsx)(y,{ref:h,className:(0,x.cn)(u({variant:n,size:t,state:s,fullWidth:c}),o&&w[t],b),"data-hook":g,"data-slot":"button","data-tracking-el":f||`button-${n}`,"data-tracking-label":v,...l,children:e}):(0,r.jsx)(y,{ref:h,"aria-busy":a?"true":void 0,"aria-disabled":_?"true":void 0,"aria-label":B,className:(0,x.cn)(u({variant:n,size:t,state:s,fullWidth:c}),o&&w[t],b),"data-hook":g,"data-slot":"button","data-tracking-el":f||`button-${n}`,"data-tracking-label":v,disabled:_,type:l.type??"button",...l,children:m&&o?(0,r.jsx)(k.Spinner,{size:S[t]}):(0,r.jsxs)(r.Fragment,{children:[m&&(0,r.jsx)(k.Spinner,{size:S[t]}),e]})})});q.displayName="Button";exports.Button=q;exports.ButtonVariants=u;
|
package/dist/button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B;;GAEG;AACH,KAAK,kBAAkB,GAAG;IACxB;;;OAGG;IACH,OAAO,CAAC,EACJ,SAAS,GACT,aAAa,GACb,SAAS,GACT,WAAW,GACX,OAAO;IACT,uIAAuI;OACrI,SAAS,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC;AAEvE,QAAA,MAAM,cAAc;;;;;8EAsGnB,CAAC;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B;;GAEG;AACH,KAAK,kBAAkB,GAAG;IACxB;;;OAGG;IACH,OAAO,CAAC,EACJ,SAAS,GACT,aAAa,GACb,SAAS,GACT,WAAW,GACX,OAAO;IACT,uIAAuI;OACrI,SAAS,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC;AAEvE,QAAA,MAAM,cAAc;;;;;8EAsGnB,CAAC;AAoBF;;GAEG;AACH,KAAK,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;AAEtE,KAAK,WAAW,GAAG,iBAAiB,GAClC,kBAAkB,GAAG;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEJ,QAAA,MAAM,MAAM,oGAqHX,CAAC;AAIF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;AAElC,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/button.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { jsx as
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { cn as k } from "@brightlocal/ui-components/lib/utils";
|
|
3
|
+
import { Fragment as L, jsx as n, jsxs as j } from "react/jsx-runtime";
|
|
4
4
|
import { Slot as B } from "@radix-ui/react-slot";
|
|
5
|
-
import { cva as
|
|
6
|
-
import { Spinner as
|
|
7
|
-
var
|
|
5
|
+
import { cva as E } from "class-variance-authority";
|
|
6
|
+
import { Spinner as x } from "@brightlocal/ui-components/spinner";
|
|
7
|
+
var w = E([
|
|
8
8
|
"rounded-full",
|
|
9
9
|
"inline-flex",
|
|
10
10
|
"font-semibold",
|
|
@@ -102,55 +102,59 @@ var x = L([
|
|
|
102
102
|
state: "default",
|
|
103
103
|
fullWidth: !1
|
|
104
104
|
}
|
|
105
|
-
}),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
}), S = {
|
|
106
|
+
sm: "size-8 p-0",
|
|
107
|
+
default: "size-9 p-0",
|
|
108
|
+
lg: "size-10 p-0"
|
|
109
|
+
}, N = {
|
|
110
|
+
sm: "md",
|
|
111
|
+
default: "md",
|
|
112
|
+
lg: "lg"
|
|
113
|
+
}, O = l.forwardRef(({ className: u, variant: o = "primary", size: t = "default", fullWidth: b = !1, asChild: s = !1, dataHook: f, trackingEl: c, trackingLabel: g, iconOnly: _ = !1, loading: r = !1, ariaLabel: I, disabled: p = !1, children: e, ...d }, v) => {
|
|
114
|
+
const m = s ? B : "button", y = p || r;
|
|
115
|
+
let a = _;
|
|
116
|
+
!a && l.Children.count(e) === 1 && l.isValidElement(e) && (a = e.props?.children == null);
|
|
117
|
+
const h = r && !s;
|
|
118
|
+
let i = "default";
|
|
119
|
+
r ? i = "loading" : p && (i = "disabled");
|
|
120
|
+
const z = I ?? (r ? typeof e == "string" || typeof e == "number" ? `Loading: ${e}` : "Loading" : void 0);
|
|
121
|
+
return s ? /* @__PURE__ */ n(m, {
|
|
114
122
|
ref: v,
|
|
115
|
-
className:
|
|
116
|
-
variant:
|
|
117
|
-
size:
|
|
118
|
-
state:
|
|
123
|
+
className: k(w({
|
|
124
|
+
variant: o,
|
|
125
|
+
size: t,
|
|
126
|
+
state: i,
|
|
119
127
|
fullWidth: b
|
|
120
|
-
}), a &&
|
|
121
|
-
"data-hook":
|
|
128
|
+
}), a && S[t], u),
|
|
129
|
+
"data-hook": f,
|
|
122
130
|
"data-slot": "button",
|
|
123
|
-
"data-tracking-el":
|
|
131
|
+
"data-tracking-el": c || `button-${o}`,
|
|
124
132
|
"data-tracking-label": g,
|
|
125
|
-
...
|
|
133
|
+
...d,
|
|
126
134
|
children: e
|
|
127
|
-
}) : /* @__PURE__ */
|
|
135
|
+
}) : /* @__PURE__ */ n(m, {
|
|
128
136
|
ref: v,
|
|
129
|
-
"aria-busy":
|
|
137
|
+
"aria-busy": r ? "true" : void 0,
|
|
130
138
|
"aria-disabled": y ? "true" : void 0,
|
|
131
|
-
"aria-label":
|
|
132
|
-
className:
|
|
133
|
-
variant:
|
|
134
|
-
size:
|
|
135
|
-
state:
|
|
139
|
+
"aria-label": z,
|
|
140
|
+
className: k(w({
|
|
141
|
+
variant: o,
|
|
142
|
+
size: t,
|
|
143
|
+
state: i,
|
|
136
144
|
fullWidth: b
|
|
137
|
-
}), a &&
|
|
138
|
-
"data-hook":
|
|
145
|
+
}), a && S[t], u),
|
|
146
|
+
"data-hook": f,
|
|
139
147
|
"data-slot": "button",
|
|
140
|
-
"data-tracking-el":
|
|
148
|
+
"data-tracking-el": c || `button-${o}`,
|
|
141
149
|
"data-tracking-label": g,
|
|
142
150
|
disabled: y,
|
|
143
|
-
type:
|
|
144
|
-
...
|
|
145
|
-
children: [
|
|
146
|
-
className: "pointer-events-none flex items-center justify-center",
|
|
147
|
-
"data-slot": "button-loading-icon",
|
|
148
|
-
children: /* @__PURE__ */ d(N, { size: "md" })
|
|
149
|
-
}), e]
|
|
151
|
+
type: d.type ?? "button",
|
|
152
|
+
...d,
|
|
153
|
+
children: h && a ? /* @__PURE__ */ n(x, { size: N[t] }) : /* @__PURE__ */ j(L, { children: [h && /* @__PURE__ */ n(x, { size: N[t] }), e] })
|
|
150
154
|
});
|
|
151
155
|
});
|
|
152
|
-
|
|
156
|
+
O.displayName = "Button";
|
|
153
157
|
export {
|
|
154
|
-
|
|
155
|
-
|
|
158
|
+
O as Button,
|
|
159
|
+
w as ButtonVariants
|
|
156
160
|
};
|
package/dist/card.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const
|
|
1
|
+
"use client";const E=require("./_virtual/_rolldown/runtime.cjs");let d=require("react");d=E.__toESM(d,1);let c=require("@brightlocal/ui-components/lib/utils"),n=require("react/jsx-runtime"),C=require("@radix-ui/react-slot"),h=require("class-variance-authority");var m=d.createContext({flush:!1,density:"default",variant:"filled"}),q={filled:"bg-muted",border:"bg-card",transparent:"bg-background","transparent-flush":"bg-background"},z={default:"[--content-inset:var(--ds-section-padding-x-md)]",condensed:"[--content-inset:0.75rem]",data:"[--content-inset:var(--ds-content-padding)]"};function b(r,a){return r?!1:a==="condensed"?"px-3":a==="data"?"px-content":"px-section-md"}var M=(0,h.cva)(["flex","flex-col","rounded-xl","transition-colors duration-fast ease-out","w-full"],{variants:{variant:{filled:["bg-muted","text-card-foreground","border","border-card-border"],transparent:["bg-transparent","text-foreground"],border:["bg-card","text-foreground","border","border-border"],"transparent-flush":["bg-transparent","text-foreground"]},density:{default:["gap-8","py-section-md","[&>[data-divider]+[data-flush]]:-mt-8"],condensed:["gap-3","py-3","[&>[data-divider]+[data-flush]]:-mt-3"],data:["pb-6"]}},defaultVariants:{variant:"filled",density:"default"}}),w=d.forwardRef(({className:r,variant:a="filled",density:t="default",dataHook:e,trackingEl:s,trackingLabel:o,maxWidth:i,children:p,style:l,...u},f)=>{const x=a==="transparent-flush";d.useEffect(()=>{process.env.NODE_ENV!=="production"&&i!==void 0&&console.warn('Card: the "maxWidth" prop is deprecated. Use Tailwind max-width utilities via className instead (e.g., className="max-w-sm").')},[i]);const v=i!==void 0?{maxWidth:typeof i=="number"?`${i}px`:i}:void 0;return(0,n.jsx)(m.Provider,{value:{flush:x,density:t,variant:a},children:(0,n.jsx)("div",{ref:f,className:(0,c.cn)(M({variant:a,density:t}),z[t],r),"data-density":t,"data-hook":e,"data-slot":"card","data-tracking-el":s||`card-${a}`,"data-tracking-label":o,style:{...v,...l},...u,children:p})})});w.displayName="Card";var H=(0,h.cva)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-metric]:grid-cols-[1fr_auto]",{variants:{align:{left:"items-start",center:"justify-items-center text-center",right:"items-start text-right [&>[data-slot=card-title]]:justify-end"}},defaultVariants:{align:"left"}});function D(r,a){d.useLayoutEffect(()=>{const t=r.current,e=t?.closest('[data-slot="card"]');if(!a||!t||!e)return;const s=new ResizeObserver(([o])=>{const i=o?.borderBoxSize?.[0]?.blockSize;i!==void 0&&e.style.setProperty("--content-sticky-top",`${i}px`)});return s.observe(t,{box:"border-box"}),()=>{s.disconnect(),e.style.removeProperty("--content-sticky-top")}},[r,a])}var y=d.forwardRef(({className:r,align:a="left",divider:t=!1,sticky:e=!1,dataHook:s,...o},i)=>{const{flush:p,density:l,variant:u}=d.useContext(m),f=d.useRef(null);return d.useImperativeHandle(i,()=>f.current,[]),D(f,e),(0,n.jsx)("div",{ref:f,className:(0,c.cn)(H({align:a}),b(p,l),l==="data"&&"pt-4 pb-4",t&&l==="default"&&"pb-8",t&&l==="condensed"&&"pb-3",t&&"border-border border-b",e&&["sticky top-0 z-10 rounded-t-xl",q[u]],r),"data-divider":t?"":void 0,"data-hook":s,"data-slot":"card-header","data-sticky":e?"":void 0,...o})});y.displayName="CardHeader";var F=(0,h.cva)("",{variants:{size:{small:"text-heading-subsection",default:"text-heading-section"}},defaultVariants:{size:"default"}}),N=d.forwardRef(({className:r,size:a="default",level:t,asChild:e=!1,icon:s,children:o,dataHook:i,...p},l)=>{const u={className:(0,c.cn)(F({size:a}),s&&"flex items-start gap-2",r),"data-hook":i,"data-slot":"card-title",...p},f=s?(0,n.jsx)("span",{"aria-hidden":"true",className:"flex h-lh shrink-0 items-center [&>svg]:size-5","data-slot":"card-title-icon",children:s}):null,x=g=>(0,n.jsx)("span",{className:"min-w-0","data-slot":"card-title-text",children:g});if(e)return!s||!d.isValidElement(o)?(0,n.jsx)(C.Slot,{ref:l,...u,children:o}):(0,n.jsxs)(C.Slot,{ref:l,...u,children:[f,(0,n.jsx)(C.Slottable,{children:d.cloneElement(o,void 0,x(o.props.children))})]});const v=s?(0,n.jsxs)(n.Fragment,{children:[f,x(o)]}):o;if(t){const g=`h${t}`;return(0,n.jsx)(g,{ref:l,...u,children:v})}return(0,n.jsx)("div",{ref:l,...u,children:v})});N.displayName="CardTitle";var $=(0,h.cva)("text-body-sm text-muted-foreground",{variants:{align:{left:"text-left",center:"text-center",right:"text-right"}}}),j=d.forwardRef(({className:r,align:a,dataHook:t,...e},s)=>(0,n.jsx)("div",{ref:s,className:(0,c.cn)($({align:a}),r),"data-hook":t,"data-slot":"card-description",...e}));j.displayName="CardDescription";var _=d.forwardRef(({className:r,dataHook:a,...t},e)=>(0,n.jsx)("div",{ref:e,className:(0,c.cn)("col-start-2 row-span-2 row-start-1 self-center justify-self-end",r),"data-hook":a,"data-slot":"card-action",...t}));_.displayName="CardAction";var k=d.forwardRef(({className:r,children:a,dataHook:t,...e},s)=>{const{flush:o,density:i}=d.useContext(m);return(0,n.jsx)("div",{ref:s,className:(0,c.cn)(b(o,i),i==="data"&&"pt-6",r),"data-hook":t,"data-slot":"card-media",...e,children:(0,n.jsx)("div",{className:"overflow-hidden rounded-md","data-slot":"card-media-clip",children:a})})});k.displayName="CardMedia";var R=d.forwardRef(({className:r,flush:a=!1,dataHook:t,...e},s)=>{const{flush:o,density:i}=d.useContext(m);return(0,n.jsx)("div",{ref:s,className:(0,c.cn)(a?!1:b(o,i),i==="data"&&!a&&"pt-6",r),"data-flush":a?"":void 0,"data-hook":t,"data-slot":"card-content",...e})});R.displayName="CardContent";var T=d.forwardRef(({className:r,dataHook:a,...t},e)=>(0,n.jsx)("div",{ref:e,className:(0,c.cn)("col-span-full mt-2 flex flex-wrap items-center gap-2 justify-self-stretch","[&>[data-slot=data-table-search]]:max-w-90 [&>[data-slot=data-table-search]]:min-w-0 [&>[data-slot=input-group]]:max-w-90 [&>[data-slot=input-group]]:min-w-0 [&>[data-slot=input]]:max-w-90 [&>[data-slot=input]]:min-w-0","[&>[data-slot=combobox-trigger]]:w-fit [&>[data-slot=select-trigger]]:w-fit",r),"data-hook":a,"data-slot":"card-toolbar",...t}));T.displayName="CardToolbar";var S=d.forwardRef(({className:r,value:a,trend:t,dataHook:e,...s},o)=>(0,n.jsxs)("div",{ref:o,className:(0,c.cn)("col-start-2 row-span-2 row-start-1 flex items-baseline gap-2 self-center justify-self-end",r),"data-hook":e,"data-slot":"card-metric",...s,children:[(0,n.jsx)("span",{className:"text-metric","data-slot":"card-metric-value",children:a}),t]}));S.displayName="CardMetric";var V=d.forwardRef(({className:r,dataHook:a,...t},e)=>{const{flush:s,density:o}=d.useContext(m);return(0,n.jsx)("div",{ref:e,className:(0,c.cn)("flex items-center",b(s,o),o==="data"&&"pt-6",r),"data-hook":a,"data-slot":"card-footer",...t})});V.displayName="CardFooter";exports.Card=w;exports.CardAction=_;exports.CardContent=R;exports.CardDescription=j;exports.CardFooter=V;exports.CardHeader=y;exports.CardMedia=k;exports.CardMetric=S;exports.CardTitle=N;exports.CardToolbar=T;
|
package/dist/card.d.ts
CHANGED
|
@@ -147,6 +147,18 @@ type CardTitleProps = CardSubComponentProps & {
|
|
|
147
147
|
* @default false
|
|
148
148
|
*/
|
|
149
149
|
asChild?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Optional icon rendered before the title text — a DS icon or a 20px
|
|
152
|
+
* platform logo (`LogoMark`). Placed with an 8px gap like `SheetTitle`,
|
|
153
|
+
* and centred on the title's first line so a wrapping title keeps the
|
|
154
|
+
* icon beside its opening words. A bare DS icon is sized to 20px; a
|
|
155
|
+
* `LogoMark` keeps its own size (`size="sm" variant="transparent"` or
|
|
156
|
+
* `size="xs"` for 20px). Decorative: hidden from assistive tech, so the
|
|
157
|
+
* title text must carry the meaning. Works with every `size`, `level`
|
|
158
|
+
* and `asChild`.
|
|
159
|
+
* @example <CardTitle size="small" icon={<LogoMark name="google" size="xs" dataHook="gbp-logo" />}>Google Business Profile</CardTitle>
|
|
160
|
+
*/
|
|
161
|
+
icon?: React.ReactNode;
|
|
150
162
|
};
|
|
151
163
|
/**
|
|
152
164
|
* Title element within the Card header.
|
package/dist/card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;GAEG;AACH,KAAK,WAAW,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,GAAG,mBAAmB,CAAC;AAE7E;;GAEG;AACH,KAAK,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;AAwFpD;;GAEG;AACH,KAAK,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7C;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,IAAI,+FAuDT,CAAC;AAIF;;GAEG;AACH,KAAK,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IACzD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,KAAK,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"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"}
|