@brightlocal/ui-components 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/component-meta.json +749 -53
- package/deprecations.json +114 -4
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.d.ts +36 -0
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +74 -61
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +32 -3
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +61 -58
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +58 -57
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +9 -0
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +50 -30
- package/dist/banner.cjs +1 -0
- package/dist/banner.d.ts +81 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +176 -0
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +4 -3
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +50 -57
- package/dist/blocks/progress-state.d.ts +2 -2
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +17 -0
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +8 -2
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/button-group.cjs +1 -0
- package/dist/button-group.d.ts +36 -0
- package/dist/button-group.d.ts.map +1 -0
- package/dist/button-group.js +47 -0
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +105 -7
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +198 -101
- package/dist/chart.cjs +3 -3
- package/dist/chart.d.ts +270 -24
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +497 -322
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +2 -1
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +38 -4
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +95 -81
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +2 -2
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +23 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +251 -225
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +201 -23
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +712 -568
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +13 -5
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +54 -53
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +8 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +79 -52
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +105 -13
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +146 -129
- package/dist/grid.d.ts +26 -3
- package/dist/grid.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.cjs +1 -1
- package/dist/hooks/use-breakpoint.d.ts +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +1 -0
- package/dist/hooks/use-mobile.cjs +1 -0
- package/dist/hooks/use-mobile.js +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +594 -553
- package/dist/info-tooltip.cjs +1 -0
- package/dist/info-tooltip.d.ts +39 -0
- package/dist/info-tooltip.d.ts.map +1 -0
- package/dist/info-tooltip.js +41 -0
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +1 -1
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +33 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +167 -54
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +9 -9
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +45 -15
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +31 -30
- package/dist/input.cjs +1 -1
- package/dist/input.js +10 -10
- package/dist/lib/block-illustration.cjs +1 -1
- package/dist/lib/block-illustration.d.ts +4 -1
- package/dist/lib/block-illustration.d.ts.map +1 -1
- package/dist/lib/block-illustration.js +12 -11
- package/dist/lib/empty-chip.cjs +1 -0
- package/dist/lib/empty-chip.d.ts +4 -0
- package/dist/lib/empty-chip.d.ts.map +1 -0
- package/dist/lib/empty-chip.js +13 -0
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +4 -3
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/multi-select-filter.cjs +1 -0
- package/dist/multi-select-filter.d.ts +178 -0
- package/dist/multi-select-filter.d.ts.map +1 -0
- package/dist/multi-select-filter.js +463 -0
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +3 -0
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +57 -57
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +123 -16
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +89 -75
- package/dist/rating.cjs +1 -1
- package/dist/rating.js +18 -18
- package/dist/relative-date.cjs +1 -0
- package/dist/relative-date.d.ts +65 -0
- package/dist/relative-date.d.ts.map +1 -0
- package/dist/relative-date.js +128 -0
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +15 -6
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +38 -36
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +24 -3
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +130 -110
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +78 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +192 -85
- package/dist/single-select-filter.cjs +1 -0
- package/dist/single-select-filter.d.ts +81 -0
- package/dist/single-select-filter.d.ts.map +1 -0
- package/dist/single-select-filter.js +226 -0
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +22 -22
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/split-layout.js +13 -13
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +45 -4
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +90 -73
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +12 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +148 -126
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +38 -36
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +262 -73
- package/dist/typography-heading.cjs +1 -1
- package/dist/typography-heading.d.ts +13 -0
- package/dist/typography-heading.d.ts.map +1 -1
- package/dist/typography-heading.js +32 -21
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +15 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +35 -24
- package/dist/typography.d.ts +1 -1
- package/package.json +5 -6
- package/src/blocks/empty-state.tsx +17 -24
- package/src/blocks/progress-state.tsx +2 -2
- package/src/blocks/sidebar.tsx +26 -2
- package/src/components/accordion.tsx +82 -27
- package/src/components/alert-dialog.tsx +50 -5
- package/src/components/alert.tsx +16 -8
- package/src/components/badge.tsx +40 -3
- package/src/components/banner.tsx +288 -0
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/button-group.tsx +112 -0
- package/src/components/button.tsx +1 -1
- package/src/components/card.tsx +249 -27
- package/src/components/chart.tsx +586 -53
- package/src/components/checkbox.tsx +1 -1
- package/src/components/chip.tsx +83 -10
- package/src/components/combobox.tsx +2 -2
- package/src/components/command.tsx +56 -4
- package/src/components/data-table.tsx +842 -199
- package/src/components/date-picker.tsx +18 -7
- package/src/components/field.tsx +81 -12
- package/src/components/global-layout.tsx +176 -38
- package/src/components/grid.tsx +34 -3
- package/src/components/info-tooltip.tsx +94 -0
- package/src/components/input-chip.tsx +1 -1
- package/src/components/input-group.tsx +246 -11
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +56 -22
- package/src/components/input.tsx +1 -1
- package/src/components/list.tsx +1 -1
- package/src/components/multi-select-filter.tsx +912 -0
- package/src/components/pagination.tsx +10 -3
- package/src/components/progress.tsx +190 -31
- package/src/components/rating.tsx +1 -1
- package/src/components/relative-date.tsx +230 -0
- package/src/components/scroll-area.tsx +23 -10
- package/src/components/select.tsx +65 -11
- package/src/components/sheet.tsx +240 -4
- package/src/components/single-select-filter.tsx +443 -0
- package/src/components/sonner.tsx +16 -5
- package/src/components/split-layout.tsx +2 -2
- package/src/components/table.tsx +71 -11
- package/src/components/tabs.tsx +93 -46
- package/src/components/textarea.tsx +1 -1
- package/src/components/tooltip.tsx +440 -68
- package/src/components/typography-heading.tsx +24 -0
- package/src/components/typography-text.tsx +27 -3
- package/src/components/typography.tsx +1 -1
- package/src/hooks/use-breakpoint.ts +2 -1
- package/src/index.ts +6 -0
- package/src/lib/block-illustration.tsx +5 -1
- package/src/lib/empty-chip.ts +24 -0
- package/src/lib/utils.ts +1 -0
package/dist/alert-dialog.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { useOverlayPointerLock as
|
|
1
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import * as i from "@radix-ui/react-alert-dialog";
|
|
4
|
+
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
import { useOverlayPointerLock as f } from "@brightlocal/ui-components/hooks/use-overlay-pointer-lock";
|
|
6
6
|
import { ButtonVariants as s } from "@brightlocal/ui-components/button";
|
|
7
|
-
function
|
|
7
|
+
function p({
|
|
8
8
|
dataHook: a,
|
|
9
9
|
trackingEl: t,
|
|
10
10
|
trackingLabel: e,
|
|
11
|
-
...
|
|
11
|
+
...l
|
|
12
12
|
}) {
|
|
13
13
|
return /* @__PURE__ */ o(
|
|
14
|
-
|
|
14
|
+
i.Root,
|
|
15
15
|
{
|
|
16
16
|
"data-hook": a,
|
|
17
17
|
"data-slot": "alert-dialog",
|
|
18
18
|
"data-tracking-el": t,
|
|
19
19
|
"data-tracking-label": e,
|
|
20
|
-
...
|
|
20
|
+
...l
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
24
|
+
p.displayName = "AlertDialog";
|
|
25
|
+
const A = r.forwardRef((a, t) => /* @__PURE__ */ o(
|
|
26
|
+
i.Trigger,
|
|
27
27
|
{
|
|
28
28
|
ref: t,
|
|
29
29
|
"data-slot": "alert-dialog-trigger",
|
|
30
30
|
...a
|
|
31
31
|
}
|
|
32
32
|
));
|
|
33
|
-
|
|
33
|
+
A.displayName = "AlertDialogTrigger";
|
|
34
34
|
function n({
|
|
35
35
|
...a
|
|
36
36
|
}) {
|
|
37
|
-
return /* @__PURE__ */ o(
|
|
37
|
+
return /* @__PURE__ */ o(i.Portal, { ...a });
|
|
38
38
|
}
|
|
39
39
|
n.displayName = "AlertDialogPortal";
|
|
40
|
-
const c =
|
|
41
|
-
|
|
40
|
+
const c = r.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
|
|
41
|
+
i.Overlay,
|
|
42
42
|
{
|
|
43
43
|
ref: e,
|
|
44
|
-
className:
|
|
44
|
+
className: d(
|
|
45
45
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:duration-slow fixed inset-0 z-50 bg-black/50 ease-out data-[state=closed]:duration-250 data-[state=closed]:ease-in",
|
|
46
46
|
a
|
|
47
47
|
),
|
|
@@ -50,13 +50,13 @@ const c = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
|
|
|
50
50
|
}
|
|
51
51
|
));
|
|
52
52
|
c.displayName = "AlertDialogOverlay";
|
|
53
|
-
const
|
|
53
|
+
const D = r.forwardRef(({ className: a, ...t }, e) => (f(), /* @__PURE__ */ m(n, { children: [
|
|
54
54
|
/* @__PURE__ */ o(c, {}),
|
|
55
55
|
/* @__PURE__ */ o(
|
|
56
|
-
|
|
56
|
+
i.Content,
|
|
57
57
|
{
|
|
58
58
|
ref: e,
|
|
59
|
-
className:
|
|
59
|
+
className: d(
|
|
60
60
|
"border-border bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=open]:duration-slow fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg ease-out data-[state=closed]:duration-250 data-[state=closed]:ease-in sm:max-w-lg",
|
|
61
61
|
a
|
|
62
62
|
),
|
|
@@ -65,22 +65,22 @@ const A = l.forwardRef(({ className: a, ...t }, e) => (m(), /* @__PURE__ */ g(n,
|
|
|
65
65
|
}
|
|
66
66
|
)
|
|
67
67
|
] })));
|
|
68
|
-
|
|
69
|
-
const
|
|
68
|
+
D.displayName = "AlertDialogContent";
|
|
69
|
+
const u = r.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
|
|
70
70
|
"div",
|
|
71
71
|
{
|
|
72
72
|
ref: e,
|
|
73
|
-
className:
|
|
73
|
+
className: d("flex flex-col gap-2 text-center sm:text-left", a),
|
|
74
74
|
"data-slot": "alert-dialog-header",
|
|
75
75
|
...t
|
|
76
76
|
}
|
|
77
77
|
));
|
|
78
|
-
|
|
79
|
-
const
|
|
78
|
+
u.displayName = "AlertDialogHeader";
|
|
79
|
+
const y = r.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
ref: e,
|
|
83
|
-
className:
|
|
83
|
+
className: d(
|
|
84
84
|
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
85
85
|
a
|
|
86
86
|
),
|
|
@@ -88,59 +88,62 @@ const u = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
|
|
|
88
88
|
...t
|
|
89
89
|
}
|
|
90
90
|
));
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
91
|
+
y.displayName = "AlertDialogFooter";
|
|
92
|
+
const N = r.forwardRef(({ className: a, dataHook: t, ...e }, l) => /* @__PURE__ */ o(
|
|
93
|
+
i.Title,
|
|
94
94
|
{
|
|
95
|
-
ref:
|
|
96
|
-
className:
|
|
95
|
+
ref: l,
|
|
96
|
+
className: d("text-heading-section", a),
|
|
97
97
|
"data-hook": t,
|
|
98
98
|
"data-slot": "alert-dialog-title",
|
|
99
99
|
...e
|
|
100
100
|
}
|
|
101
101
|
));
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
102
|
+
N.displayName = "AlertDialogTitle";
|
|
103
|
+
const x = r.forwardRef(({ className: a, dataHook: t, ...e }, l) => /* @__PURE__ */ o(
|
|
104
|
+
i.Description,
|
|
105
105
|
{
|
|
106
|
-
ref:
|
|
107
|
-
className:
|
|
106
|
+
ref: l,
|
|
107
|
+
className: d("text-body-sm text-muted-foreground", a),
|
|
108
108
|
"data-hook": t,
|
|
109
109
|
"data-slot": "alert-dialog-description",
|
|
110
110
|
...e
|
|
111
111
|
}
|
|
112
112
|
));
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
113
|
+
x.displayName = "AlertDialogDescription";
|
|
114
|
+
const w = r.forwardRef(({ className: a, variant: t = "primary", dataHook: e, ...l }, g) => /* @__PURE__ */ o(
|
|
115
|
+
i.Action,
|
|
116
116
|
{
|
|
117
|
-
ref:
|
|
118
|
-
className:
|
|
117
|
+
ref: g,
|
|
118
|
+
className: d(s({ variant: t }), a),
|
|
119
|
+
"data-hook": e,
|
|
119
120
|
"data-slot": "alert-dialog-action",
|
|
120
|
-
|
|
121
|
+
"data-variant": t,
|
|
122
|
+
...l
|
|
121
123
|
}
|
|
122
124
|
));
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
125
|
+
w.displayName = "AlertDialogAction";
|
|
126
|
+
const R = r.forwardRef(({ className: a, dataHook: t, ...e }, l) => /* @__PURE__ */ o(
|
|
127
|
+
i.Cancel,
|
|
126
128
|
{
|
|
127
|
-
ref:
|
|
128
|
-
className:
|
|
129
|
+
ref: l,
|
|
130
|
+
className: d(s({ variant: "outline" }), a),
|
|
131
|
+
"data-hook": t,
|
|
129
132
|
"data-slot": "alert-dialog-cancel",
|
|
130
|
-
...
|
|
133
|
+
...e
|
|
131
134
|
}
|
|
132
135
|
));
|
|
133
|
-
|
|
136
|
+
R.displayName = "AlertDialogCancel";
|
|
134
137
|
export {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
p as AlertDialog,
|
|
139
|
+
w as AlertDialogAction,
|
|
140
|
+
R as AlertDialogCancel,
|
|
141
|
+
D as AlertDialogContent,
|
|
142
|
+
x as AlertDialogDescription,
|
|
143
|
+
y as AlertDialogFooter,
|
|
144
|
+
u as AlertDialogHeader,
|
|
142
145
|
c as AlertDialogOverlay,
|
|
143
146
|
n as AlertDialogPortal,
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
N as AlertDialogTitle,
|
|
148
|
+
A as AlertDialogTrigger
|
|
146
149
|
};
|
package/dist/alert.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react"),v=require("@radix-ui/react-slot"),N=require("class-variance-authority"),u=require("@brightlocal/icons"),i=require("@brightlocal/ui-components/lib/utils");function p(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(a,s,r.get?r:{enumerable:!0,get:()=>t[s]})}}return a.default=t,Object.freeze(a)}const g=p(j),h=N.cva("relative w-full rounded-lg px-4 py-3 flex gap-3 items-start",{variants:{variant:{default:"bg-muted text-foreground",success:"bg-success-background text-success-foreground",info:"bg-info-background text-info-foreground",destructive:"bg-destructive text-destructive-foreground",warning:"bg-warning-background text-warning-foreground"}},defaultVariants:{variant:"default"}}),d=g.forwardRef(({className:t,variant:a,...s},r)=>e.jsx("div",{ref:r,className:i.cn(h({variant:a}),t),"data-slot":"alert","data-tracking-el":`alert-${a}`,role:"alert",...s}));d.displayName="Alert";const o=g.forwardRef(({className:t,asChild:a=!1,...s},r)=>{const l=a?v.Slot:"div";return e.jsx(l,{ref:r,className:i.cn("text-heading-compact break-words",t),"data-slot":"alert-title",...s})});o.displayName="AlertTitle";const x=g.forwardRef(({className:t,...a},s)=>e.jsx("div",{ref:s,className:i.cn("text-body-sm [&_p]:leading-5",t),"data-slot":"alert-description",...a}));x.displayName="AlertDescription";const f="max-md:flex-col max-md:items-stretch items-center",m="shrink-0 self-center max-md:self-start max-md:pl-7";function k({title:t,description:a,action:s,className:r,dataHook:l,trackingEl:n,trackingLabel:c}){return e.jsxs(d,{className:i.cn(f,r),"data-hook":l,"data-tracking-el":n,"data-tracking-label":c,variant:"success",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.CircleCheck,{className:"text-success-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),a!=null&&e.jsx(x,{children:a})]})]}),s&&e.jsx("div",{className:m,children:s})]})}function A({title:t,description:a,action:s,className:r,dataHook:l,trackingEl:n,trackingLabel:c}){return e.jsxs(d,{className:i.cn(f,r),"data-hook":l,"data-tracking-el":n,"data-tracking-label":c,variant:"info",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.Info,{className:"text-info-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),a!=null&&e.jsx(x,{children:a})]})]}),s&&e.jsx("div",{className:m,children:s})]})}function b({title:t,description:a,action:s,className:r,dataHook:l,trackingEl:n,trackingLabel:c}){return e.jsxs(d,{className:i.cn(f,r),"data-hook":l,"data-tracking-el":n,"data-tracking-label":c,variant:"destructive",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.CircleX,{className:"text-destructive-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),a!=null&&e.jsx(x,{children:a})]})]}),s&&e.jsx("div",{className:m,children:s})]})}function w({title:t,description:a,action:s,className:r,dataHook:l,trackingEl:n,trackingLabel:c}){return e.jsxs(d,{className:i.cn(f,r),"data-hook":l,"data-tracking-el":n,"data-tracking-label":c,variant:"warning",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.TriangleAlert,{className:"text-warning-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),a!=null&&e.jsx(x,{children:a})]})]}),s&&e.jsx("div",{className:m,children:s})]})}exports.Alert=d;exports.AlertDescription=x;exports.AlertDestructive=b;exports.AlertInfo=A;exports.AlertSuccess=k;exports.AlertTitle=o;exports.AlertWarning=w;exports.alertVariants=h;
|
package/dist/alert.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/components/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,QAAA,MAAM,aAAa;;8EAgBlB,CAAC;AAEF,QAAA,MAAM,KAAK;;sHAYT,CAAC;AAGH,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpE;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,UAAU,wFAYf,CAAC;AAGF,QAAA,MAAM,gBAAgB,6GAUpB,CAAC;AAGH,UAAU,qBAAqB;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,KAAK,iBAAiB,GAAG,qBAAqB,GAC5C,CACI;IACE;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B,GACD;IACE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B,CACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/components/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,QAAA,MAAM,aAAa;;8EAgBlB,CAAC;AAEF,QAAA,MAAM,KAAK;;sHAYT,CAAC;AAGH,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpE;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,UAAU,wFAYf,CAAC;AAGF,QAAA,MAAM,gBAAgB,6GAUpB,CAAC;AAGH,UAAU,qBAAqB;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,KAAK,iBAAiB,GAAG,qBAAqB,GAC5C,CACI;IACE;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B,GACD;IACE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B,CACJ,CAAC;AAUJ,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,GACb,CAAC;AACF,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
package/dist/alert.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { CircleX as
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { Slot as h } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as v } from "class-variance-authority";
|
|
5
|
+
import { CircleX as N, Info as p, CircleCheck as k, TriangleAlert as w } from "@brightlocal/icons";
|
|
6
6
|
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
-
const
|
|
7
|
+
const A = v(
|
|
8
8
|
"relative w-full rounded-lg px-4 py-3 flex gap-3 items-start",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
@@ -20,11 +20,11 @@ const p = h(
|
|
|
20
20
|
variant: "default"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
), o =
|
|
23
|
+
), o = x.forwardRef(({ className: r, variant: a, ...t }, s) => /* @__PURE__ */ e(
|
|
24
24
|
"div",
|
|
25
25
|
{
|
|
26
|
-
ref:
|
|
27
|
-
className: d(
|
|
26
|
+
ref: s,
|
|
27
|
+
className: d(A({ variant: a }), r),
|
|
28
28
|
"data-slot": "alert",
|
|
29
29
|
"data-tracking-el": `alert-${a}`,
|
|
30
30
|
role: "alert",
|
|
@@ -32,19 +32,19 @@ const p = h(
|
|
|
32
32
|
}
|
|
33
33
|
));
|
|
34
34
|
o.displayName = "Alert";
|
|
35
|
-
const
|
|
36
|
-
({ className: r, asChild: a = !1, ...t },
|
|
37
|
-
a ?
|
|
35
|
+
const m = x.forwardRef(
|
|
36
|
+
({ className: r, asChild: a = !1, ...t }, s) => /* @__PURE__ */ e(
|
|
37
|
+
a ? h : "div",
|
|
38
38
|
{
|
|
39
|
-
ref:
|
|
39
|
+
ref: s,
|
|
40
40
|
className: d("text-heading-compact break-words", r),
|
|
41
41
|
"data-slot": "alert-title",
|
|
42
42
|
...t
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
45
|
);
|
|
46
|
-
|
|
47
|
-
const
|
|
46
|
+
m.displayName = "AlertTitle";
|
|
47
|
+
const f = x.forwardRef(({ className: r, ...a }, t) => /* @__PURE__ */ e(
|
|
48
48
|
"div",
|
|
49
49
|
{
|
|
50
50
|
ref: t,
|
|
@@ -53,21 +53,22 @@ const m = g.forwardRef(({ className: r, ...a }, t) => /* @__PURE__ */ e(
|
|
|
53
53
|
...a
|
|
54
54
|
}
|
|
55
55
|
));
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
f.displayName = "AlertDescription";
|
|
57
|
+
const g = "max-md:flex-col max-md:items-stretch items-center", u = "shrink-0 self-center max-md:self-start max-md:pl-7";
|
|
58
|
+
function _({
|
|
58
59
|
title: r,
|
|
59
60
|
description: a,
|
|
60
61
|
action: t,
|
|
61
|
-
className:
|
|
62
|
-
dataHook:
|
|
62
|
+
className: s,
|
|
63
|
+
dataHook: n,
|
|
63
64
|
trackingEl: i,
|
|
64
65
|
trackingLabel: c
|
|
65
66
|
}) {
|
|
66
67
|
return /* @__PURE__ */ l(
|
|
67
68
|
o,
|
|
68
69
|
{
|
|
69
|
-
className: d(
|
|
70
|
-
"data-hook":
|
|
70
|
+
className: d(g, s),
|
|
71
|
+
"data-hook": n,
|
|
71
72
|
"data-tracking-el": i,
|
|
72
73
|
"data-tracking-label": c,
|
|
73
74
|
variant: "success",
|
|
@@ -75,112 +76,112 @@ function R({
|
|
|
75
76
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
76
77
|
/* @__PURE__ */ e(k, { className: "text-success-foreground shrink-0 translate-y-0.5" }),
|
|
77
78
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
78
|
-
r && /* @__PURE__ */ e(
|
|
79
|
-
a != null && /* @__PURE__ */ e(
|
|
79
|
+
r && /* @__PURE__ */ e(m, { children: r }),
|
|
80
|
+
a != null && /* @__PURE__ */ e(f, { children: a })
|
|
80
81
|
] })
|
|
81
82
|
] }),
|
|
82
|
-
t && /* @__PURE__ */ e("div", { className:
|
|
83
|
+
t && /* @__PURE__ */ e("div", { className: u, children: t })
|
|
83
84
|
]
|
|
84
85
|
}
|
|
85
86
|
);
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function L({
|
|
88
89
|
title: r,
|
|
89
90
|
description: a,
|
|
90
91
|
action: t,
|
|
91
|
-
className:
|
|
92
|
-
dataHook:
|
|
92
|
+
className: s,
|
|
93
|
+
dataHook: n,
|
|
93
94
|
trackingEl: i,
|
|
94
95
|
trackingLabel: c
|
|
95
96
|
}) {
|
|
96
97
|
return /* @__PURE__ */ l(
|
|
97
98
|
o,
|
|
98
99
|
{
|
|
99
|
-
className: d(
|
|
100
|
-
"data-hook":
|
|
100
|
+
className: d(g, s),
|
|
101
|
+
"data-hook": n,
|
|
101
102
|
"data-tracking-el": i,
|
|
102
103
|
"data-tracking-label": c,
|
|
103
104
|
variant: "info",
|
|
104
105
|
children: [
|
|
105
106
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
106
|
-
/* @__PURE__ */ e(
|
|
107
|
+
/* @__PURE__ */ e(p, { className: "text-info-foreground shrink-0 translate-y-0.5" }),
|
|
107
108
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
108
|
-
r && /* @__PURE__ */ e(
|
|
109
|
-
a != null && /* @__PURE__ */ e(
|
|
109
|
+
r && /* @__PURE__ */ e(m, { children: r }),
|
|
110
|
+
a != null && /* @__PURE__ */ e(f, { children: a })
|
|
110
111
|
] })
|
|
111
112
|
] }),
|
|
112
|
-
t && /* @__PURE__ */ e("div", { className:
|
|
113
|
+
t && /* @__PURE__ */ e("div", { className: u, children: t })
|
|
113
114
|
]
|
|
114
115
|
}
|
|
115
116
|
);
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
+
function O({
|
|
118
119
|
title: r,
|
|
119
120
|
description: a,
|
|
120
121
|
action: t,
|
|
121
|
-
className:
|
|
122
|
-
dataHook:
|
|
122
|
+
className: s,
|
|
123
|
+
dataHook: n,
|
|
123
124
|
trackingEl: i,
|
|
124
125
|
trackingLabel: c
|
|
125
126
|
}) {
|
|
126
127
|
return /* @__PURE__ */ l(
|
|
127
128
|
o,
|
|
128
129
|
{
|
|
129
|
-
className: d(
|
|
130
|
-
"data-hook":
|
|
130
|
+
className: d(g, s),
|
|
131
|
+
"data-hook": n,
|
|
131
132
|
"data-tracking-el": i,
|
|
132
133
|
"data-tracking-label": c,
|
|
133
134
|
variant: "destructive",
|
|
134
135
|
children: [
|
|
135
136
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
136
|
-
/* @__PURE__ */ e(
|
|
137
|
+
/* @__PURE__ */ e(N, { className: "text-destructive-foreground shrink-0 translate-y-0.5" }),
|
|
137
138
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
138
|
-
r && /* @__PURE__ */ e(
|
|
139
|
-
a != null && /* @__PURE__ */ e(
|
|
139
|
+
r && /* @__PURE__ */ e(m, { children: r }),
|
|
140
|
+
a != null && /* @__PURE__ */ e(f, { children: a })
|
|
140
141
|
] })
|
|
141
142
|
] }),
|
|
142
|
-
t && /* @__PURE__ */ e("div", { className:
|
|
143
|
+
t && /* @__PURE__ */ e("div", { className: u, children: t })
|
|
143
144
|
]
|
|
144
145
|
}
|
|
145
146
|
);
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
+
function D({
|
|
148
149
|
title: r,
|
|
149
150
|
description: a,
|
|
150
151
|
action: t,
|
|
151
|
-
className:
|
|
152
|
-
dataHook:
|
|
152
|
+
className: s,
|
|
153
|
+
dataHook: n,
|
|
153
154
|
trackingEl: i,
|
|
154
155
|
trackingLabel: c
|
|
155
156
|
}) {
|
|
156
157
|
return /* @__PURE__ */ l(
|
|
157
158
|
o,
|
|
158
159
|
{
|
|
159
|
-
className: d(
|
|
160
|
-
"data-hook":
|
|
160
|
+
className: d(g, s),
|
|
161
|
+
"data-hook": n,
|
|
161
162
|
"data-tracking-el": i,
|
|
162
163
|
"data-tracking-label": c,
|
|
163
164
|
variant: "warning",
|
|
164
165
|
children: [
|
|
165
166
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
166
|
-
/* @__PURE__ */ e(
|
|
167
|
+
/* @__PURE__ */ e(w, { className: "text-warning-foreground shrink-0 translate-y-0.5" }),
|
|
167
168
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
168
|
-
r && /* @__PURE__ */ e(
|
|
169
|
-
a != null && /* @__PURE__ */ e(
|
|
169
|
+
r && /* @__PURE__ */ e(m, { children: r }),
|
|
170
|
+
a != null && /* @__PURE__ */ e(f, { children: a })
|
|
170
171
|
] })
|
|
171
172
|
] }),
|
|
172
|
-
t && /* @__PURE__ */ e("div", { className:
|
|
173
|
+
t && /* @__PURE__ */ e("div", { className: u, children: t })
|
|
173
174
|
]
|
|
174
175
|
}
|
|
175
176
|
);
|
|
176
177
|
}
|
|
177
178
|
export {
|
|
178
179
|
o as Alert,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
180
|
+
f as AlertDescription,
|
|
181
|
+
O as AlertDestructive,
|
|
182
|
+
L as AlertInfo,
|
|
183
|
+
_ as AlertSuccess,
|
|
184
|
+
m as AlertTitle,
|
|
185
|
+
D as AlertWarning,
|
|
186
|
+
A as alertVariants
|
|
186
187
|
};
|
package/dist/badge.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),f=require("react"),v=require("@radix-ui/react-slot"),_=require("class-variance-authority"),m=require("@brightlocal/ui-components/lib/utils"),x=require("@brightlocal/ui-components/lib/use-dev-warning");function y(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const h=y(f),j=_.cva(["inline-flex items-center justify-center gap-1 w-fit shrink-0 overflow-hidden","rounded-full border px-2 py-0.5","text-label-sm whitespace-nowrap","[&>svg]:size-3 [&>svg]:pointer-events-none","[&>.contents>svg]:size-3 [&>.contents>svg]:pointer-events-none","transition-[color,background-color,border-color,box-shadow] duration-fast ease-out","focus-visible:outline-none","focus-visible:shadow-[0_0_0_1px_white,0_0_0_2px_var(--color-ring),0_0_0_4px_rgba(0,0,0,0.1)]","dark:focus-visible:shadow-[0_0_0_1px_var(--background),0_0_0_2px_var(--color-ring),0_0_0_4px_rgba(255,255,255,0.1)]","data-[number=true]:size-5 data-[number=true]:p-0 data-[number=true]:aspect-square"],{variants:{variant:{primary:"border-transparent bg-success-background text-success-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground focus-visible:border-ring",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"bg-background border-border text-foreground focus-visible:border-ring"}},defaultVariants:{variant:"primary"}}),c=h.forwardRef(({className:r,variant:t,asChild:e=!1,dataHook:a,trackingEl:d,trackingLabel:u,srLabel:s,children:o,...l},g)=>{const b=e?v.Slot:"span",i=s!==void 0&&!e;x.useDevWarning(()=>e&&s!==void 0,"srLabel is set on a <Badge asChild>. Slot renders the child element as-is, so the phrase cannot be injected — add an sr-only span inside the child instead.",[e,s]);const p=typeof o=="string"&&/^[0-9]$/.test(o);return n.jsx(b,{ref:g,className:m.cn(j({variant:t}),i&&"relative",r),"data-hook":a,"data-number":p,"data-slot":"badge","data-tracking-el":d,"data-tracking-label":u,...l,children:i?n.jsxs(n.Fragment,{children:[n.jsx("span",{"aria-hidden":"true",className:"contents",children:o}),n.jsx("span",{className:"sr-only",children:s})]}):o})});c.displayName="Badge";exports.Badge=c;
|
package/dist/badge.d.ts
CHANGED
|
@@ -23,6 +23,15 @@ interface BadgeProps extends React.ComponentProps<"span">, VariantProps<typeof b
|
|
|
23
23
|
* Tracking label for analytics context
|
|
24
24
|
*/
|
|
25
25
|
trackingLabel?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Screen-reader phrase that replaces the visible content. A bare numeral
|
|
28
|
+
* tells a screen-reader user nothing about what it counts, so a count
|
|
29
|
+
* badge passes the phrase here ("3 active", "2 selected") and the numeral
|
|
30
|
+
* stays visual only. Ignored with `asChild` — the Slot's single child is
|
|
31
|
+
* the consumer's element, so put the phrase inside it instead.
|
|
32
|
+
* @example srLabel="3 active"
|
|
33
|
+
*/
|
|
34
|
+
srLabel?: string;
|
|
26
35
|
}
|
|
27
36
|
/**
|
|
28
37
|
* Displays a badge or a component that looks like a badge.
|
package/dist/badge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,QAAA,MAAM,aAAa;;8EA2ClB,CAAC;AAEF;;GAEG;AACH,UAAU,UACR,SAAQ,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC;IACxE;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,QAAA,MAAM,KAAK,iGA2DV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/badge.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { cn as
|
|
6
|
-
|
|
1
|
+
import { jsx as a, jsxs as g, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { Slot as v } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as _ } from "class-variance-authority";
|
|
5
|
+
import { cn as x } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
import { useDevWarning as h } from "@brightlocal/ui-components/lib/use-dev-warning";
|
|
7
|
+
const y = _(
|
|
7
8
|
[
|
|
8
9
|
// Layout
|
|
9
10
|
"inline-flex items-center justify-center gap-1 w-fit shrink-0 overflow-hidden",
|
|
@@ -15,8 +16,11 @@ const _ = l(
|
|
|
15
16
|
// Typography — type-scale role for badges (12/16 Figma 500; the weight
|
|
16
17
|
// drop from the old semibold is intentional, DS-925)
|
|
17
18
|
"text-label-sm whitespace-nowrap",
|
|
18
|
-
// Icons
|
|
19
|
+
// Icons — direct children, plus the one `srLabel` wrapper (display:
|
|
20
|
+
// contents) so an icon inside it keeps its size without resizing any
|
|
21
|
+
// other nested SVG
|
|
19
22
|
"[&>svg]:size-3 [&>svg]:pointer-events-none",
|
|
23
|
+
"[&>.contents>svg]:size-3 [&>.contents>svg]:pointer-events-none",
|
|
20
24
|
// Transition
|
|
21
25
|
"transition-[color,background-color,border-color,box-shadow] duration-fast ease-out",
|
|
22
26
|
// Focus
|
|
@@ -39,35 +43,51 @@ const _ = l(
|
|
|
39
43
|
variant: "primary"
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
|
-
),
|
|
46
|
+
), k = f.forwardRef(
|
|
43
47
|
({
|
|
44
|
-
className:
|
|
45
|
-
variant:
|
|
46
|
-
asChild:
|
|
47
|
-
dataHook:
|
|
48
|
-
trackingEl:
|
|
49
|
-
trackingLabel:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
className: n,
|
|
49
|
+
variant: s,
|
|
50
|
+
asChild: e = !1,
|
|
51
|
+
dataHook: i,
|
|
52
|
+
trackingEl: d,
|
|
53
|
+
trackingLabel: c,
|
|
54
|
+
srLabel: r,
|
|
55
|
+
children: t,
|
|
56
|
+
...u
|
|
57
|
+
}, p) => {
|
|
58
|
+
const l = e ? v : "span", o = r !== void 0 && !e;
|
|
59
|
+
h(
|
|
60
|
+
() => e && r !== void 0,
|
|
61
|
+
"srLabel is set on a <Badge asChild>. Slot renders the child element as-is, so the phrase cannot be injected — add an sr-only span inside the child instead.",
|
|
62
|
+
[e, r]
|
|
63
|
+
);
|
|
64
|
+
const b = typeof t == "string" && /^[0-9]$/.test(t);
|
|
65
|
+
return /* @__PURE__ */ a(
|
|
66
|
+
l,
|
|
56
67
|
{
|
|
57
|
-
ref:
|
|
58
|
-
className:
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
ref: p,
|
|
69
|
+
className: x(
|
|
70
|
+
y({ variant: s }),
|
|
71
|
+
/* sr-only is absolutely positioned: the badge is its positioning
|
|
72
|
+
context so the phrase never escapes a scroll viewport. */
|
|
73
|
+
o && "relative",
|
|
74
|
+
n
|
|
75
|
+
),
|
|
76
|
+
"data-hook": i,
|
|
77
|
+
"data-number": b,
|
|
61
78
|
"data-slot": "badge",
|
|
62
|
-
"data-tracking-el":
|
|
63
|
-
"data-tracking-label":
|
|
64
|
-
...
|
|
65
|
-
children:
|
|
79
|
+
"data-tracking-el": d,
|
|
80
|
+
"data-tracking-label": c,
|
|
81
|
+
...u,
|
|
82
|
+
children: o ? /* @__PURE__ */ g(m, { children: [
|
|
83
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", className: "contents", children: t }),
|
|
84
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: r })
|
|
85
|
+
] }) : t
|
|
66
86
|
}
|
|
67
87
|
);
|
|
68
88
|
}
|
|
69
89
|
);
|
|
70
|
-
|
|
90
|
+
k.displayName = "Badge";
|
|
71
91
|
export {
|
|
72
|
-
|
|
92
|
+
k as Badge
|
|
73
93
|
};
|
package/dist/banner.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),R=require("react"),I=require("class-variance-authority"),O=require("@brightlocal/icons"),q=require("@brightlocal/ui-components/button"),i=require("@brightlocal/ui-components/lib/utils");function D(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const s=D(R),x=I.cva("relative flex w-full flex-col gap-3 rounded-xl p-4 md:flex-row md:items-center md:gap-5 md:pl-5",{variants:{variant:{sky:"bg-highlight-sky text-highlight-sky-foreground",violet:"bg-highlight-violet text-highlight-violet-foreground"},dismissible:{true:"pr-12 md:pr-14",false:""}},defaultVariants:{variant:"sky",dismissible:!1}}),M={sky:"text-highlight-sky-muted-foreground",violet:"text-highlight-violet-muted-foreground"},S={sky:"text-highlight-sky-foreground hover:bg-highlight-sky-foreground/10",violet:"text-highlight-violet-foreground hover:bg-highlight-violet-foreground/10"},h=s.createContext({variant:"sky",titleId:"",registerTitle:()=>()=>{}}),p=s.forwardRef(({className:t,variant:e="sky",onDismiss:n,dismissLabel:a,dataHook:o,trackingEl:c,trackingLabel:l,children:d,...N},w)=>{const u=s.useId(),[C,f]=s.useState(0),m=s.useCallback(()=>(f(g=>g+1),()=>f(g=>g-1)),[]),T=s.useMemo(()=>({variant:e,titleId:u,registerTitle:m}),[e,u,m]),b=n!=null;return r.jsx(h.Provider,{value:T,children:r.jsxs("section",{ref:w,"aria-labelledby":C>0?u:void 0,className:i.cn(x({variant:e,dismissible:b}),t),"data-hook":o,"data-slot":"banner","data-tracking-el":c||`banner-${e}`,"data-tracking-label":l,...N,children:[d,b&&r.jsxs(q.Button,{iconOnly:!0,className:i.cn("absolute top-2 right-2",S[e]),dataHook:`${o}-dismiss`,variant:"ghost",onClick:n,children:[r.jsx(O.X,{}),r.jsx("span",{className:"sr-only",children:a??"Dismiss"})]})]})})});p.displayName="Banner";const y=s.forwardRef(({className:t,dataHook:e,...n},a)=>r.jsx("div",{ref:a,"aria-hidden":"true",className:i.cn("flex size-14 shrink-0 md:size-16 [&>svg]:size-full",t),"data-hook":e,"data-slot":"banner-illustration",...n}));y.displayName="BannerIllustration";const k=s.forwardRef(({className:t,dataHook:e,...n},a)=>r.jsx("div",{ref:a,className:i.cn("flex min-w-0 flex-1 flex-col gap-1",t),"data-hook":e,"data-slot":"banner-content",...n}));k.displayName="BannerContent";const v=s.forwardRef(({className:t,level:e,dataHook:n,...a},o)=>{const{titleId:c,registerTitle:l}=s.useContext(h);s.useLayoutEffect(()=>l(),[l]);const d=e?`h${e}`:"div";return r.jsx(d,{ref:o,className:i.cn("text-heading-subsection break-words",t),"data-hook":n,"data-slot":"banner-title",id:c,...a})});v.displayName="BannerTitle";const B=s.forwardRef(({className:t,dataHook:e,...n},a)=>{const{variant:o}=s.useContext(h);return r.jsx("div",{ref:a,className:i.cn("text-body-sm break-words",M[o],t),"data-hook":e,"data-slot":"banner-description",...n})});B.displayName="BannerDescription";const j=s.forwardRef(({className:t,dataHook:e,...n},a)=>r.jsx("div",{ref:a,className:i.cn("flex shrink-0 flex-wrap items-center gap-2",t),"data-hook":e,"data-slot":"banner-actions",...n}));j.displayName="BannerActions";exports.Banner=p;exports.BannerActions=j;exports.BannerContent=k;exports.BannerDescription=B;exports.BannerIllustration=y;exports.BannerTitle=v;exports.bannerVariants=x;
|