@brightlocal/ui-components 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +1 -1
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.js +30 -30
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +4 -3
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +10 -10
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +6 -3
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +5 -0
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +49 -36
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +3 -8
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +33 -48
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +7 -7
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +6 -1
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +116 -103
- package/dist/command.cjs +1 -1
- package/dist/command.js +3 -3
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.js +3 -3
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.js +10 -10
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +12 -19
- package/dist/header.d.ts.map +1 -1
- package/dist/header.js +4 -1
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.js +63 -63
- package/dist/link.cjs +1 -1
- package/dist/link.js +2 -2
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +17 -16
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.js +3 -3
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.d.ts.map +1 -1
- package/dist/navigation-menu.js +2 -1
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.js +16 -16
- package/dist/rating.cjs +1 -1
- package/dist/rating.js +8 -8
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +1 -1
- package/dist/resizable.js +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +20 -20
- package/dist/sheet.d.ts +1 -1
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +9 -8
- package/package.json +1 -1
- package/src/blocks/data-table.tsx +5 -5
- package/src/blocks/sidebar.tsx +3 -2
- package/src/components/accordion.tsx +1 -1
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/calendar.tsx +6 -3
- package/src/components/card.tsx +24 -1
- package/src/components/centred-layout.tsx +6 -29
- package/src/components/checkbox.tsx +1 -1
- package/src/components/combobox.tsx +21 -5
- package/src/components/command.tsx +3 -3
- package/src/components/context-menu.tsx +3 -3
- package/src/components/dropdown-menu.tsx +4 -4
- package/src/components/field.tsx +9 -14
- package/src/components/header.tsx +4 -1
- package/src/components/input-password.tsx +4 -4
- package/src/components/link.tsx +1 -1
- package/src/components/logo.tsx +10 -9
- package/src/components/menubar.tsx +3 -3
- package/src/components/navigation-menu.tsx +2 -1
- package/src/components/pagination.tsx +3 -3
- package/src/components/rating.tsx +2 -2
- package/src/components/resizable.tsx +1 -1
- package/src/components/select.tsx +4 -4
- package/src/components/sonner.tsx +6 -5
package/dist/combobox.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as n, jsxs as I, Fragment as j } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "react";
|
|
3
|
-
import { CheckIcon as z,
|
|
4
|
-
import { cva as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Popover as
|
|
7
|
-
import { Command as
|
|
3
|
+
import { CheckIcon as z, ChevronsUpDownIcon as P } from "@brightlocal/icons";
|
|
4
|
+
import { cva as M } from "class-variance-authority";
|
|
5
|
+
import { cn as f } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
import { Popover as _, PopoverContent as G, PopoverTrigger as U } from "@brightlocal/ui-components/popover";
|
|
7
|
+
import { Command as $, CommandEmpty as F, CommandGroup as O, CommandInput as D, CommandItem as H, CommandList as V, CommandSeparator as q } from "@brightlocal/ui-components/command";
|
|
8
8
|
const E = t.createContext(null);
|
|
9
9
|
function y() {
|
|
10
10
|
const o = t.useContext(E);
|
|
@@ -12,58 +12,58 @@ function y() {
|
|
|
12
12
|
throw new Error("Combobox components must be used within a <Combobox>");
|
|
13
13
|
return o;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function so({
|
|
16
16
|
value: o,
|
|
17
17
|
onValueChange: e,
|
|
18
18
|
open: a,
|
|
19
19
|
onOpenChange: r,
|
|
20
20
|
shouldFilter: s = !0,
|
|
21
|
-
disabled:
|
|
22
|
-
children:
|
|
21
|
+
disabled: d = !1,
|
|
22
|
+
children: i
|
|
23
23
|
}) {
|
|
24
|
-
const [
|
|
24
|
+
const [x, c] = t.useState(""), [l, g] = t.useState(!1), [u, b] = t.useState(
|
|
25
25
|
() => /* @__PURE__ */ new Map()
|
|
26
|
-
),
|
|
27
|
-
(
|
|
28
|
-
p ||
|
|
26
|
+
), C = o !== void 0, p = a !== void 0, v = C ? o : x, h = p ? a : l, w = t.useCallback(
|
|
27
|
+
(m) => {
|
|
28
|
+
p || g(m), r?.(m);
|
|
29
29
|
},
|
|
30
30
|
[p, r]
|
|
31
31
|
), N = t.useCallback(
|
|
32
|
-
(
|
|
33
|
-
|
|
32
|
+
(m) => {
|
|
33
|
+
C || c(m), e?.(m);
|
|
34
34
|
},
|
|
35
|
-
[
|
|
36
|
-
), R = t.useCallback((
|
|
37
|
-
|
|
38
|
-
if (k.get(
|
|
35
|
+
[C, e]
|
|
36
|
+
), R = t.useCallback((m, S) => {
|
|
37
|
+
b((k) => {
|
|
38
|
+
if (k.get(m) === S) return k;
|
|
39
39
|
const L = new Map(k);
|
|
40
|
-
return L.set(
|
|
40
|
+
return L.set(m, S), L;
|
|
41
41
|
});
|
|
42
42
|
}, []), T = t.useMemo(
|
|
43
43
|
() => ({
|
|
44
|
-
open:
|
|
45
|
-
setOpen:
|
|
46
|
-
value:
|
|
44
|
+
open: h,
|
|
45
|
+
setOpen: w,
|
|
46
|
+
value: v,
|
|
47
47
|
onValueChange: N,
|
|
48
48
|
shouldFilter: s,
|
|
49
|
-
disabled:
|
|
49
|
+
disabled: d,
|
|
50
50
|
itemLabels: u,
|
|
51
51
|
registerItem: R
|
|
52
52
|
}),
|
|
53
53
|
[
|
|
54
|
-
v,
|
|
55
54
|
h,
|
|
56
|
-
|
|
55
|
+
w,
|
|
56
|
+
v,
|
|
57
57
|
N,
|
|
58
58
|
s,
|
|
59
|
-
|
|
59
|
+
d,
|
|
60
60
|
u,
|
|
61
61
|
R
|
|
62
62
|
]
|
|
63
63
|
);
|
|
64
|
-
return /* @__PURE__ */ n(E.Provider, { value: T, children: /* @__PURE__ */ n(
|
|
64
|
+
return /* @__PURE__ */ n(E.Provider, { value: T, children: /* @__PURE__ */ n(_, { open: h, onOpenChange: w, children: i }) });
|
|
65
65
|
}
|
|
66
|
-
const
|
|
66
|
+
const A = M(
|
|
67
67
|
[
|
|
68
68
|
// Base layout
|
|
69
69
|
"relative flex w-full items-center justify-between gap-2",
|
|
@@ -102,42 +102,43 @@ const B = G(
|
|
|
102
102
|
variant: "default"
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
),
|
|
105
|
+
), B = t.forwardRef(
|
|
106
106
|
({
|
|
107
107
|
className: o,
|
|
108
108
|
variant: e,
|
|
109
109
|
dataHook: a,
|
|
110
110
|
trackingEl: r,
|
|
111
111
|
trackingLabel: s,
|
|
112
|
-
children:
|
|
113
|
-
...
|
|
114
|
-
},
|
|
115
|
-
const { open:
|
|
116
|
-
return /* @__PURE__ */ n(
|
|
112
|
+
children: d,
|
|
113
|
+
...i
|
|
114
|
+
}, x) => {
|
|
115
|
+
const { open: c, disabled: l, value: g } = y(), u = t.useId(), b = !g;
|
|
116
|
+
return /* @__PURE__ */ n(U, { asChild: !0, children: /* @__PURE__ */ I(
|
|
117
117
|
"button",
|
|
118
118
|
{
|
|
119
|
-
ref:
|
|
120
|
-
"aria-controls":
|
|
121
|
-
"aria-expanded":
|
|
119
|
+
ref: x,
|
|
120
|
+
"aria-controls": c ? u : void 0,
|
|
121
|
+
"aria-expanded": c,
|
|
122
122
|
"aria-haspopup": "listbox",
|
|
123
|
-
className:
|
|
123
|
+
className: f(A({ variant: e }), o),
|
|
124
124
|
"data-hook": a,
|
|
125
|
-
"data-placeholder":
|
|
125
|
+
"data-placeholder": b,
|
|
126
126
|
"data-slot": "combobox-trigger",
|
|
127
|
-
"data-state":
|
|
127
|
+
"data-state": c ? "open" : "closed",
|
|
128
128
|
"data-tracking-el": r || "combobox-trigger",
|
|
129
129
|
"data-tracking-label": s,
|
|
130
|
-
disabled:
|
|
130
|
+
disabled: l || i.disabled,
|
|
131
131
|
role: "combobox",
|
|
132
132
|
type: "button",
|
|
133
|
-
...
|
|
133
|
+
...i,
|
|
134
134
|
children: [
|
|
135
|
-
|
|
135
|
+
d,
|
|
136
136
|
/* @__PURE__ */ n(
|
|
137
|
-
|
|
137
|
+
P,
|
|
138
138
|
{
|
|
139
139
|
"aria-hidden": "true",
|
|
140
|
-
className: "text-muted-foreground ml-auto
|
|
140
|
+
className: "text-muted-foreground ml-auto shrink-0",
|
|
141
|
+
size: 16
|
|
141
142
|
}
|
|
142
143
|
)
|
|
143
144
|
]
|
|
@@ -145,13 +146,13 @@ const B = G(
|
|
|
145
146
|
) });
|
|
146
147
|
}
|
|
147
148
|
);
|
|
148
|
-
|
|
149
|
-
function
|
|
149
|
+
B.displayName = "ComboboxTrigger";
|
|
150
|
+
function io({ placeholder: o, className: e }) {
|
|
150
151
|
const { value: a, itemLabels: r } = y(), s = a ? r.get(a) || a : o;
|
|
151
152
|
return /* @__PURE__ */ n(
|
|
152
153
|
"span",
|
|
153
154
|
{
|
|
154
|
-
className:
|
|
155
|
+
className: f(
|
|
155
156
|
"text-foreground overflow-hidden text-sm leading-normal font-medium text-ellipsis whitespace-nowrap",
|
|
156
157
|
e
|
|
157
158
|
),
|
|
@@ -164,37 +165,42 @@ function mo({
|
|
|
164
165
|
dataHook: o,
|
|
165
166
|
className: e,
|
|
166
167
|
children: a,
|
|
167
|
-
align: r = "start"
|
|
168
|
+
align: r = "start",
|
|
169
|
+
hideList: s = !1
|
|
168
170
|
}) {
|
|
169
|
-
const { shouldFilter:
|
|
171
|
+
const { shouldFilter: d } = y();
|
|
170
172
|
return /* @__PURE__ */ n(
|
|
171
|
-
|
|
173
|
+
G,
|
|
172
174
|
{
|
|
173
175
|
align: r,
|
|
174
|
-
className:
|
|
176
|
+
className: f("w-[var(--radix-popover-trigger-width)] p-0", e),
|
|
175
177
|
"data-slot": "combobox-popover",
|
|
178
|
+
side: "bottom",
|
|
176
179
|
children: /* @__PURE__ */ n(
|
|
177
|
-
|
|
180
|
+
$,
|
|
178
181
|
{
|
|
179
|
-
className:
|
|
182
|
+
className: f(
|
|
183
|
+
"border-0 shadow-none",
|
|
184
|
+
s && "[&_[data-slot='command-input-wrapper']]:border-b-0"
|
|
185
|
+
),
|
|
180
186
|
"data-slot": "combobox-command",
|
|
181
187
|
dataHook: o || "combobox-command",
|
|
182
|
-
shouldFilter:
|
|
188
|
+
shouldFilter: d,
|
|
183
189
|
children: a
|
|
184
190
|
}
|
|
185
191
|
)
|
|
186
192
|
}
|
|
187
193
|
);
|
|
188
194
|
}
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
function
|
|
195
|
+
const J = t.forwardRef((o, e) => /* @__PURE__ */ n(D, { ref: e, "data-slot": "combobox-input", ...o }));
|
|
196
|
+
J.displayName = "ComboboxInput";
|
|
197
|
+
const K = t.forwardRef((o, e) => /* @__PURE__ */ n(V, { ref: e, "data-slot": "combobox-list", ...o }));
|
|
198
|
+
K.displayName = "ComboboxList";
|
|
199
|
+
const Q = t.forwardRef((o, e) => /* @__PURE__ */ n(F, { ref: e, "data-slot": "combobox-empty", ...o }));
|
|
200
|
+
Q.displayName = "ComboboxEmpty";
|
|
201
|
+
const W = t.forwardRef((o, e) => /* @__PURE__ */ n(O, { ref: e, "data-slot": "combobox-group", ...o }));
|
|
202
|
+
W.displayName = "ComboboxGroup";
|
|
203
|
+
function X(o, e, a) {
|
|
198
204
|
if (!e || !e.trim())
|
|
199
205
|
return o;
|
|
200
206
|
const r = new RegExp(
|
|
@@ -202,50 +208,51 @@ function Y(o, e, a) {
|
|
|
202
208
|
"gi"
|
|
203
209
|
), s = o.split(r);
|
|
204
210
|
return /* @__PURE__ */ n("span", { children: s.map(
|
|
205
|
-
(
|
|
211
|
+
(d, i) => i % 2 === 1 ? /* @__PURE__ */ n("span", { className: a, children: d }, i) : /* @__PURE__ */ n(t.Fragment, { children: d }, i)
|
|
206
212
|
) });
|
|
207
213
|
}
|
|
208
|
-
const
|
|
214
|
+
const Y = t.forwardRef(
|
|
209
215
|
({
|
|
210
216
|
value: o,
|
|
211
217
|
label: e,
|
|
212
218
|
dataHook: a,
|
|
213
219
|
children: r,
|
|
214
220
|
className: s,
|
|
215
|
-
highlight:
|
|
216
|
-
highlightClassName:
|
|
217
|
-
...
|
|
218
|
-
},
|
|
219
|
-
const { value:
|
|
221
|
+
highlight: d,
|
|
222
|
+
highlightClassName: i,
|
|
223
|
+
...x
|
|
224
|
+
}, c) => {
|
|
225
|
+
const { value: l, onValueChange: g, setOpen: u, registerItem: b } = y(), C = l === o, p = t.useMemo(() => e || (typeof r == "string" ? r : typeof r == "number" ? String(r) : o), [e, r, o]), v = t.useRef(b);
|
|
220
226
|
t.useEffect(() => {
|
|
221
|
-
|
|
222
|
-
}, [
|
|
223
|
-
|
|
227
|
+
v.current = b;
|
|
228
|
+
}, [b]), t.useEffect(() => {
|
|
229
|
+
v.current(o, p);
|
|
224
230
|
}, [o, p]);
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
},
|
|
231
|
+
const h = () => {
|
|
232
|
+
g(o === l ? "" : o), u(!1);
|
|
233
|
+
}, w = () => d && typeof r == "string" ? X(
|
|
228
234
|
r,
|
|
229
|
-
|
|
230
|
-
|
|
235
|
+
d,
|
|
236
|
+
i || "text-sm leading-normal font-semibold"
|
|
231
237
|
) : r;
|
|
232
238
|
return /* @__PURE__ */ I(
|
|
233
|
-
|
|
239
|
+
H,
|
|
234
240
|
{
|
|
235
|
-
ref:
|
|
236
|
-
className:
|
|
241
|
+
ref: c,
|
|
242
|
+
className: f("justify-between", s),
|
|
237
243
|
"data-slot": "combobox-item",
|
|
238
244
|
dataHook: a,
|
|
239
245
|
value: o,
|
|
240
|
-
onSelect:
|
|
241
|
-
...
|
|
246
|
+
onSelect: h,
|
|
247
|
+
...x,
|
|
242
248
|
children: [
|
|
243
|
-
|
|
244
|
-
|
|
249
|
+
w(),
|
|
250
|
+
C && /* @__PURE__ */ n(
|
|
245
251
|
z,
|
|
246
252
|
{
|
|
247
253
|
"aria-hidden": "true",
|
|
248
|
-
className: "text-muted-foreground
|
|
254
|
+
className: "text-muted-foreground shrink-0",
|
|
255
|
+
size: 16
|
|
249
256
|
}
|
|
250
257
|
)
|
|
251
258
|
]
|
|
@@ -253,35 +260,41 @@ const Z = t.forwardRef(
|
|
|
253
260
|
);
|
|
254
261
|
}
|
|
255
262
|
);
|
|
256
|
-
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
function
|
|
263
|
+
Y.displayName = "ComboboxItem";
|
|
264
|
+
const Z = t.forwardRef((o, e) => /* @__PURE__ */ n(q, { ref: e, "data-slot": "combobox-separator", ...o }));
|
|
265
|
+
Z.displayName = "ComboboxSeparator";
|
|
266
|
+
function co({ className: o, children: e }) {
|
|
260
267
|
return /* @__PURE__ */ n(
|
|
261
268
|
"div",
|
|
262
269
|
{
|
|
263
|
-
className:
|
|
270
|
+
className: f(
|
|
264
271
|
"text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm",
|
|
265
272
|
o
|
|
266
273
|
),
|
|
267
274
|
"data-slot": "combobox-loading",
|
|
268
275
|
children: e || /* @__PURE__ */ I(j, { children: [
|
|
269
|
-
/* @__PURE__ */ n(
|
|
276
|
+
/* @__PURE__ */ n(
|
|
277
|
+
"div",
|
|
278
|
+
{
|
|
279
|
+
"aria-hidden": "true",
|
|
280
|
+
className: "size-4 animate-spin rounded-full border-2 border-current border-t-transparent [animation-duration:0.6s]"
|
|
281
|
+
}
|
|
282
|
+
),
|
|
270
283
|
"Loading..."
|
|
271
284
|
] })
|
|
272
285
|
}
|
|
273
286
|
);
|
|
274
287
|
}
|
|
275
288
|
export {
|
|
276
|
-
|
|
289
|
+
so as Combobox,
|
|
277
290
|
mo as ComboboxContent,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
291
|
+
Q as ComboboxEmpty,
|
|
292
|
+
W as ComboboxGroup,
|
|
293
|
+
J as ComboboxInput,
|
|
294
|
+
Y as ComboboxItem,
|
|
295
|
+
K as ComboboxList,
|
|
296
|
+
co as ComboboxLoading,
|
|
297
|
+
Z as ComboboxSeparator,
|
|
298
|
+
B as ComboboxTrigger,
|
|
299
|
+
io as ComboboxValue
|
|
287
300
|
};
|
package/dist/command.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),z=require("react"),m=require("cmdk"),f=require("@brightlocal/icons"),O=require("@brightlocal/ui-components/button"),c=require("@brightlocal/ui-components/lib/utils");function E(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const d=E(z),C=d.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:o,...r},s)=>n.jsx(m.Command,{ref:s,className:c.cn("bg-popover text-popover-foreground flex w-full flex-col overflow-hidden rounded-lg border shadow-md",e),"data-hook":t,"data-slot":"command","data-tracking-el":a,"data-tracking-label":o,...r}));C.displayName="Command";const b=d.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:o,value:r,onValueChange:s,onClear:l,...i},S)=>{const u=d.useRef(null),[I,g]=d.useState("");d.useImperativeHandle(S,()=>u.current,[]);const p=r!==void 0,x=p?r:I,R=String(x).length>0,_=h=>{p||g(h),s?.(h)},q=()=>{p||g(""),s?.(""),l?.(),u.current?.focus()};return n.jsxs("div",{className:"border-base-border flex h-12 items-center gap-2 self-stretch border-b px-3","data-hook":t,"data-slot":"command-input-wrapper",children:[n.jsx(f.SearchIcon,{className:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),z=require("react"),m=require("cmdk"),f=require("@brightlocal/icons"),O=require("@brightlocal/ui-components/button"),c=require("@brightlocal/ui-components/lib/utils");function E(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const d=E(z),C=d.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:o,...r},s)=>n.jsx(m.Command,{ref:s,className:c.cn("bg-popover text-popover-foreground flex w-full flex-col overflow-hidden rounded-lg border shadow-md",e),"data-hook":t,"data-slot":"command","data-tracking-el":a,"data-tracking-label":o,...r}));C.displayName="Command";const b=d.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:o,value:r,onValueChange:s,onClear:l,...i},S)=>{const u=d.useRef(null),[I,g]=d.useState("");d.useImperativeHandle(S,()=>u.current,[]);const p=r!==void 0,x=p?r:I,R=String(x).length>0,_=h=>{p||g(h),s?.(h)},q=()=>{p||g(""),s?.(""),l?.(),u.current?.focus()};return n.jsxs("div",{className:"border-base-border flex h-12 items-center gap-2 self-stretch border-b px-3","data-hook":t,"data-slot":"command-input-wrapper",children:[n.jsx(f.SearchIcon,{className:"shrink-0 opacity-50",size:16}),n.jsx(m.Command.Input,{ref:u,className:c.cn("placeholder:text-muted-foreground flex w-full bg-transparent text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),"data-slot":"command-input","data-tracking-el":a,"data-tracking-label":o,value:x,onValueChange:_,...i}),R&&n.jsx(O.Button,{"aria-label":"Clear search",className:"text-muted-foreground hover:text-foreground",dataHook:"command-input-clear",variant:"ghost",onClick:q,children:n.jsx(f.XIcon,{size:16})})]})});b.displayName="CommandInput";const k=d.forwardRef(({className:e,dataHook:t,...a},o)=>n.jsx(m.Command.List,{ref:o,className:c.cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),"data-hook":t,"data-slot":"command-list",...a}));k.displayName="CommandList";const y=d.forwardRef(({dataHook:e,...t},a)=>n.jsx(m.Command.Empty,{ref:a,className:"py-6 text-center text-sm","data-hook":e,"data-slot":"command-empty",...t}));y.displayName="CommandEmpty";const v=d.forwardRef(({className:e,dataHook:t,...a},o)=>n.jsx(m.Command.Group,{ref:o,className:c.cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden px-2 py-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),"data-hook":t,"data-slot":"command-group",...a}));v.displayName="CommandGroup";const N=d.forwardRef(({className:e,dataHook:t,...a},o)=>n.jsx(m.Command.Separator,{ref:o,className:c.cn("bg-border -mx-1 h-px",e),"data-hook":t,"data-slot":"command-separator",...a}));N.displayName="CommandSeparator";const j=d.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:o,selected:r,children:s,...l},i)=>n.jsxs(m.Command.Item,{ref:i,className:c.cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground data-[disabled=true]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),"data-hook":t,"data-selected-item":r||void 0,"data-slot":"command-item","data-tracking-el":a,"data-tracking-label":o,...l,children:[s,r&&n.jsx(f.CheckIcon,{className:"text-foreground ml-auto",size:16})]}));j.displayName="CommandItem";const w=d.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:o,...r},s)=>n.jsx("span",{ref:s,className:c.cn("text-muted-foreground ml-auto text-xs tracking-widest",e),"data-hook":t,"data-slot":"command-shortcut","data-tracking-el":a,"data-tracking-label":o,...r}));w.displayName="CommandShortcut";exports.Command=C;exports.CommandEmpty=y;exports.CommandGroup=v;exports.CommandInput=b;exports.CommandItem=j;exports.CommandList=k;exports.CommandSeparator=N;exports.CommandShortcut=w;
|
package/dist/command.js
CHANGED
|
@@ -45,7 +45,7 @@ const S = r.forwardRef(
|
|
|
45
45
|
"data-hook": e,
|
|
46
46
|
"data-slot": "command-input-wrapper",
|
|
47
47
|
children: [
|
|
48
|
-
/* @__PURE__ */ d(N, { className: "
|
|
48
|
+
/* @__PURE__ */ d(N, { className: "shrink-0 opacity-50", size: 16 }),
|
|
49
49
|
/* @__PURE__ */ d(
|
|
50
50
|
s.Input,
|
|
51
51
|
{
|
|
@@ -70,7 +70,7 @@ const S = r.forwardRef(
|
|
|
70
70
|
dataHook: "command-input-clear",
|
|
71
71
|
variant: "ghost",
|
|
72
72
|
onClick: y,
|
|
73
|
-
children: /* @__PURE__ */ d(w, {
|
|
73
|
+
children: /* @__PURE__ */ d(w, { size: 16 })
|
|
74
74
|
}
|
|
75
75
|
)
|
|
76
76
|
]
|
|
@@ -154,7 +154,7 @@ const j = r.forwardRef(
|
|
|
154
154
|
...c,
|
|
155
155
|
children: [
|
|
156
156
|
m,
|
|
157
|
-
n && /* @__PURE__ */ d(I, { className: "text-foreground ml-auto size
|
|
157
|
+
n && /* @__PURE__ */ d(I, { className: "text-foreground ml-auto", size: 16 })
|
|
158
158
|
]
|
|
159
159
|
}
|
|
160
160
|
)
|
package/dist/context-menu.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),I=require("react"),z=require("@radix-ui/react-context-menu"),m=require("@brightlocal/icons"),d=require("@brightlocal/ui-components/lib/utils");function x(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const s=x(I),a=x(z);function p({...e}){return o.jsx(a.Root,{"data-slot":"context-menu",...e})}p.displayName="ContextMenu";const f=s.forwardRef(({dataHook:e,...n},t)=>o.jsx(a.Trigger,{ref:t,"data-hook":e,"data-slot":"context-menu-trigger",...n}));f.displayName="ContextMenuTrigger";function b({...e}){return o.jsx(a.Group,{"data-slot":"context-menu-group",...e})}b.displayName="ContextMenuGroup";function g({...e}){return o.jsx(a.Portal,{"data-slot":"context-menu-portal",...e})}g.displayName="ContextMenuPortal";function C({...e}){return o.jsx(a.Sub,{"data-slot":"context-menu-sub",...e})}C.displayName="ContextMenuSub";function M({...e}){return o.jsx(a.RadioGroup,{"data-slot":"context-menu-radio-group",...e})}M.displayName="ContextMenuRadioGroup";const h=s.forwardRef(({className:e,inset:n,children:t,dataHook:r,trackingEl:u,trackingLabel:i,...c},l)=>o.jsxs(a.SubTrigger,{ref:l,className:d.cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none",n&&"pl-8",e),"data-hook":r,"data-slot":"context-menu-sub-trigger","data-tracking-el":u,"data-tracking-label":i,...c,children:[t,o.jsx(m.ChevronRight,{className:"ml-auto
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),I=require("react"),z=require("@radix-ui/react-context-menu"),m=require("@brightlocal/icons"),d=require("@brightlocal/ui-components/lib/utils");function x(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const s=x(I),a=x(z);function p({...e}){return o.jsx(a.Root,{"data-slot":"context-menu",...e})}p.displayName="ContextMenu";const f=s.forwardRef(({dataHook:e,...n},t)=>o.jsx(a.Trigger,{ref:t,"data-hook":e,"data-slot":"context-menu-trigger",...n}));f.displayName="ContextMenuTrigger";function b({...e}){return o.jsx(a.Group,{"data-slot":"context-menu-group",...e})}b.displayName="ContextMenuGroup";function g({...e}){return o.jsx(a.Portal,{"data-slot":"context-menu-portal",...e})}g.displayName="ContextMenuPortal";function C({...e}){return o.jsx(a.Sub,{"data-slot":"context-menu-sub",...e})}C.displayName="ContextMenuSub";function M({...e}){return o.jsx(a.RadioGroup,{"data-slot":"context-menu-radio-group",...e})}M.displayName="ContextMenuRadioGroup";const h=s.forwardRef(({className:e,inset:n,children:t,dataHook:r,trackingEl:u,trackingLabel:i,...c},l)=>o.jsxs(a.SubTrigger,{ref:l,className:d.cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none",n&&"pl-8",e),"data-hook":r,"data-slot":"context-menu-sub-trigger","data-tracking-el":u,"data-tracking-label":i,...c,children:[t,o.jsx(m.ChevronRight,{className:"ml-auto",size:16})]}));h.displayName="ContextMenuSubTrigger";const j=s.forwardRef(({className:e,...n},t)=>o.jsx(a.SubContent,{ref:t,className:d.cn("border-border bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",e),"data-slot":"context-menu-sub-content",...n}));j.displayName="ContextMenuSubContent";const y=s.forwardRef(({className:e,...n},t)=>o.jsx(a.Portal,{children:o.jsx(a.Content,{ref:t,className:d.cn("border-border bg-popover text-popover-foreground animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",e),"data-slot":"context-menu-content",...n})}));y.displayName="ContextMenuContent";const N=s.forwardRef(({className:e,inset:n,dataHook:t,trackingEl:r,trackingLabel:u,...i},c)=>o.jsx(a.Item,{ref:c,className:d.cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",e),"data-hook":t,"data-slot":"context-menu-item","data-tracking-el":r,"data-tracking-label":u,...i}));N.displayName="ContextMenuItem";const R=s.forwardRef(({className:e,children:n,checked:t,dataHook:r,trackingEl:u,trackingLabel:i,...c},l)=>o.jsxs(a.CheckboxItem,{ref:l,checked:t,className:d.cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),"data-hook":r,"data-slot":"context-menu-checkbox-item","data-tracking-el":u,"data-tracking-label":i,...c,children:[o.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:o.jsx(a.ItemIndicator,{children:o.jsx(m.Check,{size:16})})}),n]}));R.displayName="ContextMenuCheckboxItem";const S=s.forwardRef(({className:e,children:n,dataHook:t,trackingEl:r,trackingLabel:u,...i},c)=>o.jsxs(a.RadioItem,{ref:c,className:d.cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),"data-hook":t,"data-slot":"context-menu-radio-item","data-tracking-el":r,"data-tracking-label":u,...i,children:[o.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:o.jsx(a.ItemIndicator,{children:o.jsx(m.Circle,{className:"fill-current",size:8})})}),n]}));S.displayName="ContextMenuRadioItem";const k=s.forwardRef(({className:e,inset:n,...t},r)=>o.jsx(a.Label,{ref:r,className:d.cn("text-foreground px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),"data-slot":"context-menu-label",...t}));k.displayName="ContextMenuLabel";const w=s.forwardRef(({className:e,...n},t)=>o.jsx(a.Separator,{ref:t,className:d.cn("bg-border -mx-1 my-1 h-px",e),"data-slot":"context-menu-separator",...n}));w.displayName="ContextMenuSeparator";const v=s.forwardRef(({className:e,...n},t)=>o.jsx("span",{ref:t,className:d.cn("text-muted-foreground ml-auto text-xs tracking-widest",e),"data-slot":"context-menu-shortcut",...n}));v.displayName="ContextMenuShortcut";exports.ContextMenu=p;exports.ContextMenuCheckboxItem=R;exports.ContextMenuContent=y;exports.ContextMenuGroup=b;exports.ContextMenuItem=N;exports.ContextMenuLabel=k;exports.ContextMenuPortal=g;exports.ContextMenuRadioGroup=M;exports.ContextMenuRadioItem=S;exports.ContextMenuSeparator=w;exports.ContextMenuShortcut=v;exports.ContextMenuSub=C;exports.ContextMenuSubContent=j;exports.ContextMenuSubTrigger=h;exports.ContextMenuTrigger=f;
|
package/dist/context-menu.js
CHANGED
|
@@ -64,7 +64,7 @@ const y = r.forwardRef(
|
|
|
64
64
|
...c,
|
|
65
65
|
children: [
|
|
66
66
|
o,
|
|
67
|
-
/* @__PURE__ */ t(x, { className: "ml-auto size
|
|
67
|
+
/* @__PURE__ */ t(x, { className: "ml-auto", size: 16 })
|
|
68
68
|
]
|
|
69
69
|
}
|
|
70
70
|
)
|
|
@@ -139,7 +139,7 @@ const v = r.forwardRef(
|
|
|
139
139
|
"data-tracking-label": l,
|
|
140
140
|
...c,
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */ t("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(p, {
|
|
142
|
+
/* @__PURE__ */ t("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(p, { size: 16 }) }) }),
|
|
143
143
|
a
|
|
144
144
|
]
|
|
145
145
|
}
|
|
@@ -161,7 +161,7 @@ const S = r.forwardRef(
|
|
|
161
161
|
"data-tracking-label": i,
|
|
162
162
|
...l,
|
|
163
163
|
children: [
|
|
164
|
-
/* @__PURE__ */ t("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(f, { className: "
|
|
164
|
+
/* @__PURE__ */ t("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(f, { className: "fill-current", size: 8 }) }) }),
|
|
165
165
|
a
|
|
166
166
|
]
|
|
167
167
|
}
|
package/dist/dropdown-menu.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),T=require("react"),P=require("@radix-ui/react-dropdown-menu"),p=require("@brightlocal/icons"),l=require("@brightlocal/ui-components/lib/utils");function m(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const u=m(T),r=m(P);function g({...e}){return o.jsx(r.Root,{...e})}g.displayName="DropdownMenu";function f({...e}){return o.jsx(r.Portal,{...e})}f.displayName="DropdownMenuPortal";const w=u.forwardRef(({className:e,dataHook:t,trackingEl:n,trackingLabel:a,...s},d)=>o.jsx(r.Trigger,{ref:d,className:e,"data-hook":t,"data-slot":"dropdown-menu-trigger","data-tracking-el":n,"data-tracking-label":a,...s}));w.displayName="DropdownMenuTrigger";const x=u.forwardRef(({className:e,sideOffset:t=4,align:n="start",dataHook:a,trackingEl:s,trackingLabel:d,...i},c)=>o.jsx(r.Portal,{children:o.jsx(r.Content,{ref:c,align:n,className:l.cn(["bg-popover text-popover-foreground","z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem]","origin-(--radix-dropdown-menu-content-transform-origin)","overflow-x-hidden overflow-y-auto","rounded-md border p-1 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2"],e),"data-hook":a,"data-slot":"dropdown-menu-content","data-tracking-el":s,"data-tracking-label":d,sideOffset:t,...i})}));x.displayName="DropdownMenuContent";function b({...e}){return o.jsx(r.Group,{...e})}b.displayName="DropdownMenuGroup";const h=u.forwardRef(({className:e,inset:t,dataHook:n,trackingEl:a,trackingLabel:s,...d},i)=>o.jsx(r.Item,{ref:i,className:l.cn(["relative flex cursor-default items-center gap-2 self-stretch select-none","rounded-sm px-2 py-1.5 text-sm leading-normal outline-hidden","[&>span]:overflow-hidden [&>span]:text-ellipsis [&>span]:whitespace-nowrap","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","data-[inset]:pl-8","[&_svg]:pointer-events-none [&_svg]:shrink-0","[&_svg:not([class*='size-'])]:size-4","[&_svg:not([class*='text-'])]:text-muted-foreground"],e),"data-hook":n,"data-inset":t,"data-slot":"dropdown-menu-item","data-tracking-el":a,"data-tracking-label":s,...d}));h.displayName="DropdownMenuItem";const v=u.forwardRef(({className:e,children:t,checked:n,dataHook:a,trackingEl:s,trackingLabel:d,...i},c)=>o.jsxs(r.CheckboxItem,{ref:c,checked:n,className:l.cn(["relative flex cursor-default items-center gap-2 select-none","rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0","[&_svg:not([class*='size-'])]:size-4"],e),"data-hook":a,"data-slot":"dropdown-menu-checkbox-item","data-tracking-el":s,"data-tracking-label":d,...i,children:[o.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:o.jsx(r.ItemIndicator,{children:o.jsx(p.Check,{
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),T=require("react"),P=require("@radix-ui/react-dropdown-menu"),p=require("@brightlocal/icons"),l=require("@brightlocal/ui-components/lib/utils");function m(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const u=m(T),r=m(P);function g({...e}){return o.jsx(r.Root,{...e})}g.displayName="DropdownMenu";function f({...e}){return o.jsx(r.Portal,{...e})}f.displayName="DropdownMenuPortal";const w=u.forwardRef(({className:e,dataHook:t,trackingEl:n,trackingLabel:a,...s},d)=>o.jsx(r.Trigger,{ref:d,className:e,"data-hook":t,"data-slot":"dropdown-menu-trigger","data-tracking-el":n,"data-tracking-label":a,...s}));w.displayName="DropdownMenuTrigger";const x=u.forwardRef(({className:e,sideOffset:t=4,align:n="start",dataHook:a,trackingEl:s,trackingLabel:d,...i},c)=>o.jsx(r.Portal,{children:o.jsx(r.Content,{ref:c,align:n,className:l.cn(["bg-popover text-popover-foreground","z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem]","origin-(--radix-dropdown-menu-content-transform-origin)","overflow-x-hidden overflow-y-auto","rounded-md border p-1 shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2"],e),"data-hook":a,"data-slot":"dropdown-menu-content","data-tracking-el":s,"data-tracking-label":d,sideOffset:t,...i})}));x.displayName="DropdownMenuContent";function b({...e}){return o.jsx(r.Group,{...e})}b.displayName="DropdownMenuGroup";const h=u.forwardRef(({className:e,inset:t,dataHook:n,trackingEl:a,trackingLabel:s,...d},i)=>o.jsx(r.Item,{ref:i,className:l.cn(["relative flex cursor-default items-center gap-2 self-stretch select-none","rounded-sm px-2 py-1.5 text-sm leading-normal outline-hidden","[&>span]:overflow-hidden [&>span]:text-ellipsis [&>span]:whitespace-nowrap","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","data-[inset]:pl-8","[&_svg]:pointer-events-none [&_svg]:shrink-0","[&_svg:not([class*='size-'])]:size-4","[&_svg:not([class*='text-'])]:text-muted-foreground"],e),"data-hook":n,"data-inset":t,"data-slot":"dropdown-menu-item","data-tracking-el":a,"data-tracking-label":s,...d}));h.displayName="DropdownMenuItem";const v=u.forwardRef(({className:e,children:t,checked:n,dataHook:a,trackingEl:s,trackingLabel:d,...i},c)=>o.jsxs(r.CheckboxItem,{ref:c,checked:n,className:l.cn(["relative flex cursor-default items-center gap-2 select-none","rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0","[&_svg:not([class*='size-'])]:size-4"],e),"data-hook":a,"data-slot":"dropdown-menu-checkbox-item","data-tracking-el":s,"data-tracking-label":d,...i,children:[o.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:o.jsx(r.ItemIndicator,{children:o.jsx(p.Check,{size:16})})}),t]}));v.displayName="DropdownMenuCheckboxItem";function D({...e}){return o.jsx(r.RadioGroup,{...e})}D.displayName="DropdownMenuRadioGroup";const M=u.forwardRef(({className:e,children:t,dataHook:n,trackingEl:a,trackingLabel:s,...d},i)=>o.jsxs(r.RadioItem,{ref:i,className:l.cn(["relative flex cursor-default items-center gap-2 select-none","rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden","focus:bg-accent focus:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0","[&_svg:not([class*='size-'])]:size-4"],e),"data-hook":n,"data-slot":"dropdown-menu-radio-item","data-tracking-el":a,"data-tracking-label":s,...d,children:[o.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:o.jsx(r.ItemIndicator,{children:o.jsx(p.Circle,{className:"fill-current",size:8})})}),t]}));M.displayName="DropdownMenuRadioItem";const y=u.forwardRef(({className:e,inset:t,...n},a)=>o.jsx(r.Label,{ref:a,className:l.cn(["px-2 py-1.5 text-sm leading-normal font-semibold","data-[inset]:pl-8"],e),"data-inset":t,"data-slot":"dropdown-menu-label",...n}));y.displayName="DropdownMenuLabel";const j=u.forwardRef(({className:e,...t},n)=>o.jsx(r.Separator,{ref:n,className:l.cn(["bg-border -mx-1 my-1 h-px"],e),"data-slot":"dropdown-menu-separator",...t}));j.displayName="DropdownMenuSeparator";function N({className:e,...t}){return o.jsx("span",{className:l.cn(["text-popover-foreground ml-auto text-xs leading-normal opacity-60"],e),"data-slot":"dropdown-menu-shortcut",...t})}N.displayName="DropdownMenuShortcut";function k({...e}){return o.jsx(r.Sub,{...e})}k.displayName="DropdownMenuSub";const R=u.forwardRef(({className:e,inset:t,children:n,dataHook:a,trackingEl:s,trackingLabel:d,...i},c)=>o.jsxs(r.SubTrigger,{ref:c,className:l.cn(["flex cursor-default items-center gap-2 select-none","rounded-sm px-2 py-1.5 text-sm outline-hidden","focus:bg-accent focus:text-accent-foreground","data-[state=open]:bg-accent data-[state=open]:text-accent-foreground","data-[inset]:pl-8","[&_svg]:pointer-events-none [&_svg]:shrink-0","[&_svg:not([class*='size-'])]:size-4"],e),"data-hook":a,"data-inset":t,"data-slot":"dropdown-menu-sub-trigger","data-tracking-el":s,"data-tracking-label":d,...i,children:[n,o.jsx(p.ChevronRight,{className:"ml-auto",size:16})]}));R.displayName="DropdownMenuSubTrigger";const S=u.forwardRef(({className:e,...t},n)=>o.jsx(r.SubContent,{ref:n,className:l.cn(["bg-popover text-popover-foreground","z-50 min-w-[8rem]","origin-(--radix-dropdown-menu-content-transform-origin)","overflow-hidden rounded-md border p-1 shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2"],e),"data-slot":"dropdown-menu-sub-content",...t}));S.displayName="DropdownMenuSubContent";const z=u.forwardRef(({className:e,dataHook:t,trackingEl:n,trackingLabel:a,avatar:s,title:d,description:i,disabled:c,ariaLabel:_,...C},I)=>o.jsxs(r.Trigger,{ref:I,"aria-label":_??d,className:l.cn(["flex items-center gap-2 rounded-lg border px-3 py-2","bg-popover shadow-sm","outline-none","hover:bg-accent","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","disabled:pointer-events-none disabled:opacity-50"],e),"data-hook":t,"data-slot":"dropdown-menu-trigger-avatar","data-tracking-el":n,"data-tracking-label":a,disabled:c,...C,children:[s,o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col items-start",children:[o.jsx("span",{className:"w-full overflow-hidden text-sm leading-normal font-semibold text-ellipsis whitespace-nowrap",children:d}),i&&o.jsx("span",{className:"text-muted-foreground w-full overflow-hidden text-xs leading-normal text-ellipsis whitespace-nowrap",children:i})]}),o.jsx(p.ChevronsUpDown,{className:"text-muted-foreground opacity-50",size:16})]}));z.displayName="DropdownMenuTriggerAvatar";exports.DropdownMenu=g;exports.DropdownMenuCheckboxItem=v;exports.DropdownMenuContent=x;exports.DropdownMenuGroup=b;exports.DropdownMenuItem=h;exports.DropdownMenuLabel=y;exports.DropdownMenuPortal=f;exports.DropdownMenuRadioGroup=D;exports.DropdownMenuRadioItem=M;exports.DropdownMenuSeparator=j;exports.DropdownMenuShortcut=N;exports.DropdownMenuSub=k;exports.DropdownMenuSubContent=S;exports.DropdownMenuSubTrigger=R;exports.DropdownMenuTrigger=w;exports.DropdownMenuTriggerAvatar=z;
|
package/dist/dropdown-menu.js
CHANGED
|
@@ -9,13 +9,13 @@ function v({
|
|
|
9
9
|
return /* @__PURE__ */ t(n.Root, { ...e });
|
|
10
10
|
}
|
|
11
11
|
v.displayName = "DropdownMenu";
|
|
12
|
-
function
|
|
12
|
+
function D({
|
|
13
13
|
...e
|
|
14
14
|
}) {
|
|
15
15
|
return /* @__PURE__ */ t(n.Portal, { ...e });
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
const
|
|
17
|
+
D.displayName = "DropdownMenuPortal";
|
|
18
|
+
const N = l.forwardRef(({ className: e, dataHook: o, trackingEl: a, trackingLabel: r, ...s }, d) => /* @__PURE__ */ t(
|
|
19
19
|
n.Trigger,
|
|
20
20
|
{
|
|
21
21
|
ref: d,
|
|
@@ -27,7 +27,7 @@ const D = l.forwardRef(({ className: e, dataHook: o, trackingEl: a, trackingLabe
|
|
|
27
27
|
...s
|
|
28
28
|
}
|
|
29
29
|
));
|
|
30
|
-
|
|
30
|
+
N.displayName = "DropdownMenuTrigger";
|
|
31
31
|
const M = l.forwardRef(
|
|
32
32
|
({
|
|
33
33
|
className: e,
|
|
@@ -140,7 +140,7 @@ const z = l.forwardRef(
|
|
|
140
140
|
"data-tracking-label": d,
|
|
141
141
|
...i,
|
|
142
142
|
children: [
|
|
143
|
-
/* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(w, {
|
|
143
|
+
/* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(w, { size: 16 }) }) }),
|
|
144
144
|
o
|
|
145
145
|
]
|
|
146
146
|
}
|
|
@@ -176,7 +176,7 @@ const S = l.forwardRef(
|
|
|
176
176
|
"data-tracking-label": s,
|
|
177
177
|
...d,
|
|
178
178
|
children: [
|
|
179
|
-
/* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(b, { className: "
|
|
179
|
+
/* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(b, { className: "fill-current", size: 8 }) }) }),
|
|
180
180
|
o
|
|
181
181
|
]
|
|
182
182
|
}
|
|
@@ -267,7 +267,7 @@ const G = l.forwardRef(
|
|
|
267
267
|
...i,
|
|
268
268
|
children: [
|
|
269
269
|
a,
|
|
270
|
-
/* @__PURE__ */ t(h, { className: "ml-auto size
|
|
270
|
+
/* @__PURE__ */ t(h, { className: "ml-auto", size: 16 })
|
|
271
271
|
]
|
|
272
272
|
}
|
|
273
273
|
)
|
|
@@ -339,7 +339,7 @@ const j = l.forwardRef(
|
|
|
339
339
|
/* @__PURE__ */ t("span", { className: "w-full overflow-hidden text-sm leading-normal font-semibold text-ellipsis whitespace-nowrap", children: d }),
|
|
340
340
|
i && /* @__PURE__ */ t("span", { className: "text-muted-foreground w-full overflow-hidden text-xs leading-normal text-ellipsis whitespace-nowrap", children: i })
|
|
341
341
|
] }),
|
|
342
|
-
/* @__PURE__ */ t(x, { className: "text-muted-foreground
|
|
342
|
+
/* @__PURE__ */ t(x, { className: "text-muted-foreground opacity-50", size: 16 })
|
|
343
343
|
]
|
|
344
344
|
}
|
|
345
345
|
)
|
|
@@ -352,7 +352,7 @@ export {
|
|
|
352
352
|
y as DropdownMenuGroup,
|
|
353
353
|
k as DropdownMenuItem,
|
|
354
354
|
C as DropdownMenuLabel,
|
|
355
|
-
|
|
355
|
+
D as DropdownMenuPortal,
|
|
356
356
|
R as DropdownMenuRadioGroup,
|
|
357
357
|
S as DropdownMenuRadioItem,
|
|
358
358
|
I as DropdownMenuSeparator,
|
|
@@ -360,6 +360,6 @@ export {
|
|
|
360
360
|
T as DropdownMenuSub,
|
|
361
361
|
P as DropdownMenuSubContent,
|
|
362
362
|
G as DropdownMenuSubTrigger,
|
|
363
|
-
|
|
363
|
+
N as DropdownMenuTrigger,
|
|
364
364
|
j as DropdownMenuTriggerAvatar
|
|
365
365
|
};
|
package/dist/field.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),g=require("class-variance-authority"),p=require("@brightlocal/icons"),o=require("@brightlocal/ui-components/lib/utils"),m=require("./description.cjs"),h=require("@brightlocal/ui-components/label");function s({className:t,...e}){return l.jsx("fieldset",{className:o.cn("flex flex-col gap-6","has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",t),"data-slot":"field-set",...e})}s.displayName="FieldSet";const x=["legend","label"];function b({className:t,variant:e="legend",...a}){return l.jsx("legend",{className:o.cn("mb-3 font-medium","data-[variant=legend]:text-base","data-[variant=label]:text-sm",t),"data-slot":"field-legend","data-variant":e,...a})}function F({className:t,...e}){return l.jsx("div",{className:o.cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",t),"data-slot":"field-group",...e})}const v=g.cva("group/field flex w-full gap-2",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["grid grid-cols-[auto_1fr] items-center","[&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:grid @md/field-group:grid-cols-[auto_1fr] @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-description]]:col-start-2 @md/field-group:[&>[data-slot=field-error]]:col-start-2","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});function j({className:t,orientation:e="vertical",...a}){return l.jsx("div",{className:o.cn(v({orientation:e}),t),"data-orientation":e,"data-slot":"field",role:"group",...a})}function k({className:t,...e}){return l.jsx("div",{className:o.cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug",t),"data-slot":"field-content",...e})}function N({className:t,htmlFor:e,dataHook:a,...
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),g=require("class-variance-authority"),p=require("@brightlocal/icons"),o=require("@brightlocal/ui-components/lib/utils"),m=require("./description.cjs"),h=require("@brightlocal/ui-components/label");function s({className:t,...e}){return l.jsx("fieldset",{className:o.cn("flex flex-col gap-6","has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",t),"data-slot":"field-set",...e})}s.displayName="FieldSet";const x=["legend","label"];function b({className:t,variant:e="legend",...a}){return l.jsx("legend",{className:o.cn("mb-3 font-medium","data-[variant=legend]:text-base","data-[variant=label]:text-sm",t),"data-slot":"field-legend","data-variant":e,...a})}function F({className:t,...e}){return l.jsx("div",{className:o.cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",t),"data-slot":"field-group",...e})}const v=g.cva("group/field flex w-full gap-2",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["grid grid-cols-[auto_1fr] items-center","[&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"],responsive:["flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:grid @md/field-group:grid-cols-[auto_1fr] @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-description]]:col-start-2 @md/field-group:[&>[data-slot=field-error]]:col-start-2","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"]}},defaultVariants:{orientation:"vertical"}});function j({className:t,orientation:e="vertical",...a}){return l.jsx("div",{className:o.cn(v({orientation:e}),t),"data-orientation":e,"data-slot":"field",role:"group",...a})}function k({className:t,...e}){return l.jsx("div",{className:o.cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug",t),"data-slot":"field-content",...e})}function N({className:t,htmlFor:e,dataHook:a,...i}){return l.jsx(h.Label,{className:o.cn("group/field-label peer/field-label w-fit","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",t),"data-hook":a,"data-slot":"field-label",htmlFor:e,...i})}function y({className:t,dataHook:e,...a}){return l.jsx(m.Description,{className:o.cn("mt-2","group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",t),"data-hook":e,"data-slot":"field-description",...a})}function w({icon:t=p.AlertCircle,className:e,...a}){return l.jsx(t,{"aria-hidden":"true",className:o.cn("inline-block shrink-0 align-text-bottom",e),...a})}function L({className:t,dataHook:e,children:a,errors:i,...n}){const r=i?.filter(d=>!!d?.message);if(!a&&(!r||r.length===0))return null;const c=o.cn("text-destructive-foreground text-sm font-normal leading-5","mt-2","group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",t),f=r&&r.length>1;return l.jsx("div",{className:c,"data-hook":e,"data-slot":"field-error",role:"alert",...n,children:f?l.jsx("ul",{className:"list-disc space-y-1 pl-4",children:r.map((d,u)=>l.jsx("li",{children:d.message},u))}):l.jsx("p",{className:"m-0",children:a||r?.[0]?.message})})}exports.Field=j;exports.FieldContent=k;exports.FieldDescription=y;exports.FieldError=L;exports.FieldErrorIcon=w;exports.FieldGroup=F;exports.FieldLabel=N;exports.FieldLegend=b;exports.FieldSet=s;exports.fieldLegendVariants=x;
|