@brightlocal/ui-components 0.1.3 → 0.1.4
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/alert.cjs +1 -1
- package/dist/alert.js +1 -1
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.js +1 -1
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +37 -306
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +392 -489
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +4 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +33 -33
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +5 -18
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +21 -23
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +9 -17
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +104 -107
- package/dist/command.cjs +1 -1
- package/dist/command.js +1 -1
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +3 -0
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +5 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +348 -363
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +1 -1
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.js +1 -1
- package/dist/link.cjs +1 -1
- package/dist/link.js +1 -1
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +6 -4
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +18 -21
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +3 -0
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +31 -30
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.d.ts +6 -54
- package/dist/navigation-menu.d.ts.map +1 -1
- package/dist/navigation-menu.js +73 -84
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +8 -10
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +78 -86
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.d.ts +6 -23
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/radio-group.js +56 -66
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +19 -28
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +24 -40
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +4 -4
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +19 -21
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +5 -10
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +24 -26
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +17 -20
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +42 -45
- package/dist/switch.cjs +1 -1
- package/dist/switch.d.ts +2 -12
- package/dist/switch.d.ts.map +1 -1
- package/dist/switch.js +37 -41
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +16 -12
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +56 -58
- package/dist/tabs.d.ts +27 -3
- package/dist/tabs.d.ts.map +1 -1
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.d.ts +57 -7
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +60 -67
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.d.ts +12 -26
- package/dist/toggle.d.ts.map +1 -1
- package/dist/toggle.js +16 -20
- package/package.json +2 -2
- package/src/blocks/data-table.tsx +1 -1
- package/src/blocks/sidebar.tsx +157 -532
- package/src/components/accordion.tsx +1 -1
- package/src/components/alert.tsx +1 -1
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/button.tsx +1 -1
- package/src/components/calendar.tsx +6 -4
- package/src/components/centred-layout.tsx +11 -24
- package/src/components/checkbox.tsx +1 -1
- package/src/components/combobox.tsx +18 -26
- package/src/components/command.tsx +1 -1
- package/src/components/context-menu.tsx +1 -1
- package/src/components/date-picker.tsx +1 -1
- package/src/components/dialog.tsx +1 -1
- package/src/components/dropdown-menu.tsx +1 -1
- package/src/components/field.tsx +2 -0
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +1 -1
- package/src/components/link.tsx +1 -1
- package/src/components/logo.tsx +9 -7
- package/src/components/menubar.tsx +3 -1
- package/src/components/navigation-menu.tsx +37 -99
- package/src/components/pagination.tsx +13 -19
- package/src/components/radio-group.tsx +17 -38
- package/src/components/resizable.tsx +5 -43
- package/src/components/select.tsx +1 -1
- package/src/components/separator.tsx +5 -5
- package/src/components/sheet.tsx +6 -11
- package/src/components/sonner.tsx +24 -27
- package/src/components/switch.figma.tsx +7 -11
- package/src/components/switch.tsx +9 -19
- package/src/components/table.tsx +23 -18
- package/src/components/tabs.tsx +27 -3
- package/src/components/toggle-group.tsx +115 -86
- package/src/components/toggle.figma.tsx +13 -19
- package/src/components/toggle.tsx +20 -34
package/dist/combobox.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { jsxs as t, jsx as
|
|
1
|
+
import { jsxs as t, jsx as o, Fragment as d } from "react/jsx-runtime";
|
|
2
2
|
import * as m from "react";
|
|
3
|
-
import { ChevronDownIcon as
|
|
4
|
-
import { Checkbox as
|
|
5
|
-
import { cva as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Command as
|
|
9
|
-
|
|
10
|
-
const h = "font-sans text-sm leading-normal font-normal text-foreground", ae = "bg-accent flex size-5 shrink-0 items-center justify-center rounded-full text-xs font-medium", oe = "size-5 rounded-full object-cover", re = M(
|
|
3
|
+
import { ChevronDownIcon as P, ChevronsUpDownIcon as D, CheckIcon as F } from "@brightlocal/icons";
|
|
4
|
+
import { Checkbox as U } from "@brightlocal/ui-components/checkbox";
|
|
5
|
+
import { cva as B } from "class-variance-authority";
|
|
6
|
+
import { cn as q } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
+
import { Popover as H, PopoverTrigger as J, PopoverContent as K } from "@brightlocal/ui-components/popover";
|
|
8
|
+
import { Command as Q, CommandInput as W, CommandList as X, CommandEmpty as Y, CommandGroup as I, CommandItem as S } from "@brightlocal/ui-components/command";
|
|
9
|
+
const h = "font-sans text-sm leading-normal font-normal text-foreground", Z = "bg-accent flex size-5 shrink-0 items-center justify-center rounded-full text-xs font-medium", ee = "size-5 rounded-full object-cover", oe = B(
|
|
11
10
|
[
|
|
12
11
|
// Base layout
|
|
13
12
|
"relative flex w-full items-center justify-start gap-2",
|
|
@@ -52,69 +51,69 @@ const h = "font-sans text-sm leading-normal font-normal text-foreground", ae = "
|
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
);
|
|
55
|
-
function
|
|
56
|
-
src:
|
|
57
|
-
fallback:
|
|
58
|
-
alt:
|
|
59
|
-
dataSlot:
|
|
54
|
+
function A({
|
|
55
|
+
src: i,
|
|
56
|
+
fallback: r,
|
|
57
|
+
alt: n,
|
|
58
|
+
dataSlot: b
|
|
60
59
|
}) {
|
|
61
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ o("span", { className: Z, "data-slot": b, children: i ? /* @__PURE__ */ o("img", { alt: n || "", className: ee, src: i }) : r || "?" });
|
|
62
61
|
}
|
|
63
|
-
const
|
|
62
|
+
const ae = m.forwardRef(
|
|
64
63
|
({
|
|
65
|
-
id:
|
|
66
|
-
variant:
|
|
67
|
-
dataHook:
|
|
68
|
-
trackingEl:
|
|
69
|
-
trackingLabel:
|
|
70
|
-
items:
|
|
64
|
+
id: i,
|
|
65
|
+
variant: r = "default",
|
|
66
|
+
dataHook: n,
|
|
67
|
+
trackingEl: b,
|
|
68
|
+
trackingLabel: _,
|
|
69
|
+
items: c,
|
|
71
70
|
value: u,
|
|
72
|
-
onValueChange:
|
|
73
|
-
placeholder:
|
|
74
|
-
groupLabel:
|
|
75
|
-
disabled:
|
|
71
|
+
onValueChange: y,
|
|
72
|
+
placeholder: x = "Select an option...",
|
|
73
|
+
groupLabel: g,
|
|
74
|
+
disabled: L,
|
|
76
75
|
emptyMessage: $ = "No results found.",
|
|
77
76
|
searchPlaceholder: z = "Search",
|
|
78
|
-
showAvatar:
|
|
79
|
-
avatarSrc:
|
|
80
|
-
avatarFallback:
|
|
81
|
-
className:
|
|
82
|
-
menuItemType:
|
|
83
|
-
"aria-label":
|
|
84
|
-
},
|
|
85
|
-
const [p, v] = m.useState(!1), w = m.useId(),
|
|
86
|
-
(e,
|
|
87
|
-
const
|
|
88
|
-
return e[
|
|
77
|
+
showAvatar: j = !1,
|
|
78
|
+
avatarSrc: E,
|
|
79
|
+
avatarFallback: G,
|
|
80
|
+
className: T,
|
|
81
|
+
menuItemType: M = "simple",
|
|
82
|
+
"aria-label": O
|
|
83
|
+
}, R) => {
|
|
84
|
+
const [p, v] = m.useState(!1), w = m.useId(), s = c.find((e) => e.value === u), V = !s, k = m.useMemo(() => r !== "withGroupLabel" ? { "": c } : c.reduce(
|
|
85
|
+
(e, l) => {
|
|
86
|
+
const a = l.group || "";
|
|
87
|
+
return e[a] || (e[a] = []), e[a].push(l), e;
|
|
89
88
|
},
|
|
90
89
|
{}
|
|
91
|
-
), [
|
|
92
|
-
|
|
93
|
-
}, C = (e,
|
|
94
|
-
const
|
|
95
|
-
switch (
|
|
90
|
+
), [c, r]), N = (e) => {
|
|
91
|
+
y?.(e === u ? "" : e), v(!1);
|
|
92
|
+
}, C = (e, l) => {
|
|
93
|
+
const a = e.icon, f = l ? /* @__PURE__ */ o(F, { className: "text-muted-foreground ml-auto size-4 shrink-0" }) : null;
|
|
94
|
+
switch (M) {
|
|
96
95
|
case "checkbox":
|
|
97
|
-
return /* @__PURE__ */ t(
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
96
|
+
return /* @__PURE__ */ t(d, { children: [
|
|
97
|
+
/* @__PURE__ */ o(
|
|
98
|
+
U,
|
|
100
99
|
{
|
|
101
|
-
checked:
|
|
100
|
+
checked: l,
|
|
102
101
|
className: "pointer-events-none self-center",
|
|
103
|
-
dataHook: `${
|
|
102
|
+
dataHook: `${n}-checkbox-${e.value}`
|
|
104
103
|
}
|
|
105
104
|
),
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ o("span", { className: h, children: e.label })
|
|
107
106
|
] });
|
|
108
107
|
case "icon":
|
|
109
|
-
return /* @__PURE__ */ t(
|
|
110
|
-
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
|
|
108
|
+
return /* @__PURE__ */ t(d, { children: [
|
|
109
|
+
a && /* @__PURE__ */ o(a, { className: "text-muted-foreground size-4 shrink-0" }),
|
|
110
|
+
/* @__PURE__ */ o("span", { className: h, children: e.label }),
|
|
111
|
+
f
|
|
113
112
|
] });
|
|
114
113
|
case "avatar":
|
|
115
|
-
return /* @__PURE__ */ t(
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
|
|
114
|
+
return /* @__PURE__ */ t(d, { children: [
|
|
115
|
+
/* @__PURE__ */ o(
|
|
116
|
+
A,
|
|
118
117
|
{
|
|
119
118
|
alt: e.label,
|
|
120
119
|
dataSlot: "menu-item-avatar",
|
|
@@ -122,98 +121,98 @@ const te = m.forwardRef(
|
|
|
122
121
|
src: e.avatarSrc
|
|
123
122
|
}
|
|
124
123
|
),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
|
|
124
|
+
/* @__PURE__ */ o("span", { className: h, children: e.label }),
|
|
125
|
+
f
|
|
127
126
|
] });
|
|
128
127
|
case "simple":
|
|
129
128
|
default:
|
|
130
|
-
return /* @__PURE__ */ t(
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
129
|
+
return /* @__PURE__ */ t(d, { children: [
|
|
130
|
+
/* @__PURE__ */ o("span", { className: h, children: e.label }),
|
|
131
|
+
f
|
|
133
132
|
] });
|
|
134
133
|
}
|
|
135
134
|
};
|
|
136
|
-
return /* @__PURE__ */ t(
|
|
137
|
-
/* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ t(H, { open: p, onOpenChange: v, children: [
|
|
136
|
+
/* @__PURE__ */ o(J, { asChild: !0, children: /* @__PURE__ */ o(
|
|
138
137
|
"button",
|
|
139
138
|
{
|
|
140
|
-
ref:
|
|
139
|
+
ref: R,
|
|
141
140
|
"aria-controls": p ? w : void 0,
|
|
142
141
|
"aria-expanded": p,
|
|
143
142
|
"aria-haspopup": "listbox",
|
|
144
|
-
"aria-label":
|
|
145
|
-
className:
|
|
146
|
-
|
|
147
|
-
variant:
|
|
143
|
+
"aria-label": O,
|
|
144
|
+
className: q(
|
|
145
|
+
oe({
|
|
146
|
+
variant: r
|
|
148
147
|
}),
|
|
149
|
-
|
|
148
|
+
T
|
|
150
149
|
),
|
|
151
|
-
"data-hook":
|
|
150
|
+
"data-hook": n,
|
|
152
151
|
"data-placeholder": V,
|
|
153
152
|
"data-slot": "combobox-trigger",
|
|
154
|
-
"data-tracking-el":
|
|
155
|
-
"data-tracking-label":
|
|
156
|
-
disabled:
|
|
157
|
-
id:
|
|
153
|
+
"data-tracking-el": b || `combobox-${r}`,
|
|
154
|
+
"data-tracking-label": _,
|
|
155
|
+
disabled: L,
|
|
156
|
+
id: i,
|
|
158
157
|
role: "combobox",
|
|
159
158
|
type: "button",
|
|
160
|
-
children:
|
|
159
|
+
children: r === "withGroupLabel" ? /* @__PURE__ */ t(d, { children: [
|
|
161
160
|
/* @__PURE__ */ t("div", { className: "flex w-full flex-col items-start pr-6", children: [
|
|
162
|
-
|
|
163
|
-
/* @__PURE__ */
|
|
161
|
+
g && /* @__PURE__ */ o("span", { className: "text-muted-foreground overflow-hidden font-sans text-xs leading-4 font-normal text-ellipsis", children: g }),
|
|
162
|
+
/* @__PURE__ */ o("span", { className: "text-foreground overflow-hidden font-sans text-sm leading-5 font-medium text-ellipsis whitespace-nowrap", children: s ? s.label : x })
|
|
164
163
|
] }),
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
] }) : /* @__PURE__ */ t(
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
/* @__PURE__ */ o(P, { className: "text-muted-foreground absolute top-1/2 right-4 size-4 shrink-0 -translate-y-1/2" })
|
|
165
|
+
] }) : /* @__PURE__ */ t(d, { children: [
|
|
166
|
+
j && /* @__PURE__ */ o(
|
|
167
|
+
A,
|
|
169
168
|
{
|
|
170
|
-
alt:
|
|
169
|
+
alt: s?.label,
|
|
171
170
|
dataSlot: "combobox-avatar",
|
|
172
|
-
fallback:
|
|
173
|
-
src:
|
|
171
|
+
fallback: G,
|
|
172
|
+
src: E
|
|
174
173
|
}
|
|
175
174
|
),
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ o("span", { className: "text-foreground overflow-hidden text-sm leading-normal font-medium text-ellipsis whitespace-nowrap", children: s ? s.label : x }),
|
|
176
|
+
/* @__PURE__ */ o(D, { className: "text-muted-foreground ml-auto size-4 shrink-0" })
|
|
178
177
|
] })
|
|
179
178
|
}
|
|
180
179
|
) }),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
|
|
180
|
+
/* @__PURE__ */ o(
|
|
181
|
+
K,
|
|
183
182
|
{
|
|
184
183
|
align: "start",
|
|
185
184
|
className: "w-[var(--radix-popover-trigger-width)] p-0",
|
|
186
185
|
"data-slot": "combobox-popover",
|
|
187
186
|
children: /* @__PURE__ */ t(
|
|
188
|
-
|
|
187
|
+
Q,
|
|
189
188
|
{
|
|
190
189
|
className: "border-0 shadow-none",
|
|
191
190
|
"data-slot": "combobox-command",
|
|
192
|
-
dataHook: `${
|
|
191
|
+
dataHook: `${n}-command`,
|
|
193
192
|
id: w,
|
|
194
193
|
children: [
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
|
|
194
|
+
/* @__PURE__ */ o(
|
|
195
|
+
W,
|
|
197
196
|
{
|
|
198
|
-
dataHook: `${
|
|
197
|
+
dataHook: `${n}-search`,
|
|
199
198
|
placeholder: z
|
|
200
199
|
}
|
|
201
200
|
),
|
|
202
|
-
/* @__PURE__ */ t(
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
|
|
205
|
-
|
|
201
|
+
/* @__PURE__ */ t(X, { children: [
|
|
202
|
+
/* @__PURE__ */ o(Y, { children: $ }),
|
|
203
|
+
r === "withGroupLabel" && Object.keys(k).length > 1 ? Object.entries(k).map(([e, l]) => /* @__PURE__ */ o(I, { heading: e, children: l.map((a) => /* @__PURE__ */ o(
|
|
204
|
+
S,
|
|
206
205
|
{
|
|
207
|
-
dataHook: `${
|
|
208
|
-
value:
|
|
206
|
+
dataHook: `${n}-item-${a.value}`,
|
|
207
|
+
value: a.value,
|
|
209
208
|
onSelect: N,
|
|
210
|
-
children: C(
|
|
209
|
+
children: C(a, u === a.value)
|
|
211
210
|
},
|
|
212
|
-
|
|
213
|
-
)) }, e)) : /* @__PURE__ */
|
|
214
|
-
|
|
211
|
+
a.value
|
|
212
|
+
)) }, e)) : /* @__PURE__ */ o(I, { children: c.map((e) => /* @__PURE__ */ o(
|
|
213
|
+
S,
|
|
215
214
|
{
|
|
216
|
-
dataHook: `${
|
|
215
|
+
dataHook: `${n}-item-${e.value}`,
|
|
217
216
|
value: e.value,
|
|
218
217
|
onSelect: N,
|
|
219
218
|
children: C(e, u === e.value)
|
|
@@ -229,9 +228,7 @@ const te = m.forwardRef(
|
|
|
229
228
|
] });
|
|
230
229
|
}
|
|
231
230
|
);
|
|
232
|
-
|
|
231
|
+
ae.displayName = "Combobox";
|
|
233
232
|
export {
|
|
234
|
-
|
|
235
|
-
ee as ComboboxMenuItemType,
|
|
236
|
-
Z as ComboboxVariant
|
|
233
|
+
ae as Combobox
|
|
237
234
|
};
|
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("
|
|
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:"size-4 shrink-0 opacity-50"}),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,{className:"size-4"})})]})});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-4"})]}));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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as d, jsxs as x } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
3
|
import { Command as s } from "cmdk";
|
|
4
|
-
import { SearchIcon as N, XIcon as w, CheckIcon as I } from "
|
|
4
|
+
import { SearchIcon as N, XIcon as w, CheckIcon as I } from "@brightlocal/icons";
|
|
5
5
|
import { Button as R } from "@brightlocal/ui-components/button";
|
|
6
6
|
import { cn as l } from "@brightlocal/ui-components/lib/utils";
|
|
7
7
|
const _ = r.forwardRef(({ className: a, dataHook: e, trackingEl: t, trackingLabel: o, ...n }, m) => /* @__PURE__ */ d(
|
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("
|
|
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-4"})]}));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,{className:"size-4"})})}),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:"size-2 fill-current"})})}),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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
3
|
import * as n from "@radix-ui/react-context-menu";
|
|
4
|
-
import { Check as p, Circle as f, ChevronRight as x } from "
|
|
4
|
+
import { Check as p, Circle as f, ChevronRight as x } from "@brightlocal/icons";
|
|
5
5
|
import { cn as s } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
function b({ ...e }) {
|
|
7
7
|
return /* @__PURE__ */ t(n.Root, { "data-slot": "context-menu", ...e });
|
package/dist/date-picker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),T=require("react"),b=require("date-fns"),S=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),T=require("react"),b=require("date-fns"),S=require("@brightlocal/icons"),c=require("@brightlocal/ui-components/lib/utils"),y=require("./input.cjs"),N=require("@brightlocal/ui-components/calendar"),d=require("@brightlocal/ui-components/popover"),g=require("@brightlocal/ui-components/select");function $(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const p=$(T),k=p.forwardRef(({className:t,dataHook:a,trackingEl:n,trackingLabel:i,date:r,onDateChange:m,placeholder:x="Pick a date",disabled:o,dateFormat:u="PPP",presets:s,id:P,...f},D)=>{const[w,h]=p.useState(!1),j=e.jsx(N.Calendar,{captionLayout:"dropdown",className:c.cn("border-0 shadow-none",s&&"border-border rounded-lg border"),dataHook:`${a}-calendar`,disabled:o,endMonth:new Date(2100,11,31),mode:"single",selected:r,startMonth:new Date(1900,0,1),onSelect:l=>{m?.(l),h(!1)}});return e.jsx("div",{ref:D,className:c.cn("flex w-full flex-col gap-2",t),"data-hook":a,"data-slot":"date-picker","data-tracking-el":n||"date-picker","data-tracking-label":i,...f,children:e.jsxs(d.Popover,{open:w,onOpenChange:h,children:[e.jsx(d.PopoverTrigger,{asChild:!0,children:e.jsxs("div",{className:"relative flex w-full items-center",children:[e.jsx(S.Calendar,{className:c.cn("text-muted-foreground pointer-events-none absolute left-3 flex size-4 items-center",o&&"opacity-50"),"data-slot":"calendar-icon"}),e.jsx("button",{"aria-label":f["aria-label"]??"Select date",className:c.cn(y.inputVariants({hasIcon:!0}),"cursor-pointer justify-start text-left",!r&&"text-muted-foreground"),"data-hook":`${a}-trigger`,"data-slot":"date-picker-trigger",disabled:o,id:P,type:"button",children:r?b.format(r,u):e.jsx("span",{children:x})})]})}),e.jsx(d.PopoverContent,{align:"start",className:"w-auto rounded-lg p-0",children:s?e.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[e.jsxs(g.Select,{disabled:o,value:r?s.find(l=>l.date().toDateString()===r.toDateString())?.label:void 0,onValueChange:l=>{const v=s.find(q=>q.label===l);v&&m?.(v.date())},children:[e.jsx(g.SelectTrigger,{className:"w-full",dataHook:`${a}-preset-select`,children:e.jsx(g.SelectValue,{placeholder:x})}),e.jsx(g.SelectContent,{children:s.map(l=>e.jsx(g.SelectItem,{"data-hook":`${a}-preset-${l.label.toLowerCase().replace(/\s+/g,"-")}`,value:l.label,children:l.label},l.label))})]}),j]}):j})]})})});k.displayName="DatePicker";const M=[{label:"Today",date:()=>new Date},{label:"Tomorrow",date:()=>{const t=new Date;return t.setDate(t.getDate()+1),t}},{label:"In 3 days",date:()=>{const t=new Date;return t.setDate(t.getDate()+3),t}},{label:"In a week",date:()=>{const t=new Date;return t.setDate(t.getDate()+7),t}}],C=p.forwardRef(({presets:t=M,...a},n)=>e.jsx(k,{ref:n,presets:t,...a}));C.displayName="DatePickerPreset";const O=p.forwardRef(({className:t,dataHook:a,trackingEl:n,trackingLabel:i,dateRange:r,onDateRangeChange:m,placeholder:x="Pick a date range",disabled:o,dateFormat:u="PP",numberOfMonths:s=2,id:P,...f},D)=>{const[w,h]=p.useState(!1),j=()=>r?.from?r.to?`${b.format(r.from,u)} - ${b.format(r.to,u)}`:b.format(r.from,u):null;return e.jsx("div",{ref:D,className:c.cn("flex w-full flex-col gap-2",t),"data-hook":a,"data-slot":"date-picker-range","data-tracking-el":n||"date-picker-range","data-tracking-label":i,...f,children:e.jsxs(d.Popover,{open:w,onOpenChange:h,children:[e.jsx(d.PopoverTrigger,{asChild:!0,children:e.jsxs("div",{className:"relative flex w-full items-center",children:[e.jsx(S.Calendar,{className:c.cn("text-muted-foreground pointer-events-none absolute left-3 flex size-4 items-center",o&&"opacity-50"),"data-slot":"calendar-icon"}),e.jsx("button",{"aria-label":f["aria-label"]??"Select date range",className:c.cn(y.inputVariants({hasIcon:!0}),"cursor-pointer justify-start text-left",!r?.from&&"text-muted-foreground"),"data-hook":`${a}-trigger`,"data-slot":"date-picker-trigger",disabled:o,id:P,type:"button",children:j()||e.jsx("span",{children:x})})]})}),e.jsx(d.PopoverContent,{align:"start",className:"w-auto rounded-lg p-0",children:e.jsx(N.Calendar,{captionLayout:"dropdown",className:"border-0 shadow-none",dataHook:`${a}-calendar`,disabled:o,endMonth:new Date(2100,11,31),mode:"range",numberOfMonths:s,selected:r,startMonth:new Date(1900,0,1),onSelect:m})})]})})});O.displayName="DatePickerRange";exports.DatePicker=k;exports.DatePickerPreset=C;exports.DatePickerRange=O;
|
package/dist/date-picker.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import * as m from "react";
|
|
3
3
|
import { format as w } from "date-fns";
|
|
4
|
-
import { Calendar as N } from "
|
|
4
|
+
import { Calendar as N } from "@brightlocal/icons";
|
|
5
5
|
import { cn as c } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
import { inputVariants as v } from "./input.js";
|
|
7
7
|
import { Calendar as S } from "@brightlocal/ui-components/calendar";
|
package/dist/dialog.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),v=require("react"),w=require("@radix-ui/react-dialog"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),v=require("react"),w=require("@radix-ui/react-dialog"),h=require("@brightlocal/icons"),l=require("@brightlocal/ui-components/lib/utils");function c(e){const a=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(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const i=c(v),s=c(w),g=s.Root;g.displayName="Dialog";const f=i.forwardRef(({dataHook:e,...a},t)=>o.jsx(s.Trigger,{ref:t,"data-hook":e,"data-slot":"dialog-trigger",...a}));f.displayName="DialogTrigger";function n({...e}){return o.jsx(s.Portal,{...e})}n.displayName="DialogPortal";const u=i.forwardRef(({...e},a)=>o.jsx(s.Close,{ref:a,"data-slot":"dialog-close",...e}));u.displayName="DialogClose";const d=i.forwardRef(({className:e,...a},t)=>o.jsx(s.Overlay,{ref:t,className:l.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),"data-slot":"dialog-overlay",...a}));d.displayName="DialogOverlay";const m=i.forwardRef(({className:e,children:a,dataHook:t,trackingEl:r,trackingLabel:b,...j},N)=>o.jsxs(n,{children:[o.jsx(d,{}),o.jsxs(s.Content,{ref:N,className:l.cn("bg-background text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 border-card-border fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-xl border p-8 shadow-lg duration-200 sm:max-w-lg",e),"data-hook":t,"data-slot":"dialog-content","data-tracking-el":r,"data-tracking-label":b,...j,children:[a,o.jsxs(s.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-8 right-8 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[o.jsx(h.XIcon,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName="DialogContent";const p=i.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:l.cn("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"dialog-header",...a}));p.displayName="DialogHeader";const D=i.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:l.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),"data-slot":"dialog-footer",...a}));D.displayName="DialogFooter";const x=i.forwardRef(({className:e,...a},t)=>o.jsx(s.Title,{ref:t,className:l.cn("text-lg leading-none font-semibold",e),"data-slot":"dialog-title",...a}));x.displayName="DialogTitle";const y=i.forwardRef(({className:e,...a},t)=>o.jsx(s.Description,{ref:t,className:l.cn("text-muted-foreground text-sm",e),"data-slot":"dialog-description",...a}));y.displayName="DialogDescription";exports.Dialog=g;exports.DialogClose=u;exports.DialogContent=m;exports.DialogDescription=y;exports.DialogFooter=D;exports.DialogHeader=p;exports.DialogOverlay=d;exports.DialogPortal=n;exports.DialogTitle=x;exports.DialogTrigger=f;
|
package/dist/dialog.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import * as l from "@radix-ui/react-dialog";
|
|
4
|
-
import { XIcon as p } from "
|
|
4
|
+
import { XIcon as p } from "@brightlocal/icons";
|
|
5
5
|
import { cn as i } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
const u = l.Root;
|
|
7
7
|
u.displayName = "Dialog";
|
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("
|
|
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,{className:"size-4"})})}),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:"size-2 fill-current"})})}),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-4"})]}));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 size-4 opacity-50"})]}));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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
3
|
import * as n from "@radix-ui/react-dropdown-menu";
|
|
4
|
-
import { Check as w, Circle as b, ChevronRight as h, ChevronsUpDown as x } from "
|
|
4
|
+
import { Check as w, Circle as b, ChevronRight as h, ChevronsUpDown as x } from "@brightlocal/icons";
|
|
5
5
|
import { cn as p } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
function v({
|
|
7
7
|
...e
|
package/dist/field.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),r=require("class-variance-authority"),l=require("@brightlocal/ui-components/lib/utils"),s=require("./description.cjs"),n=require("@brightlocal/ui-components/label");function o({className:t,...e}){return a.jsx("fieldset",{className:l.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})}o.displayName="FieldSet";const c=["legend","label"];function f({className:t,variant:e="legend",...d}){return a.jsx("legend",{className:l.cn("mb-3 font-medium","data-[variant=legend]:text-base","data-[variant=label]:text-sm",t),"data-slot":"field-legend","data-variant":e,...d})}function u({className:t,...e}){return a.jsx("div",{className:l.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 p=r.cva("group/field flex w-full gap-2",{variants:{orientation:{vertical:["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],horizontal:["flex-row items-center","[&>[data-slot=field-label]]:flex-auto","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:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@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 g({className:t,orientation:e="vertical",dataHook:d,...i}){return a.jsx("div",{className:l.cn(p({orientation:e}),t),"data-hook":d,"data-orientation":e,"data-slot":"field",role:"group",...i})}function m({className:t,...e}){return a.jsx("div",{className:l.cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug",t),"data-slot":"field-content",...e})}function x({className:t,htmlFor:e,...d}){return a.jsx(n.Label,{className:l.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-slot":"field-label",htmlFor:e,...d})}function h({className:t,...e}){return a.jsx(s.Description,{className:l.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-slot":"field-description",...e})}exports.Field=g;exports.FieldContent=m;exports.FieldDescription=h;exports.FieldGroup=u;exports.FieldLabel=x;exports.FieldLegend=f;exports.FieldSet=o;exports.fieldLegendVariants=c;
|
package/dist/field.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import { Label } from '../label';
|
|
3
3
|
declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare namespace FieldSet {
|
|
5
|
+
var displayName: string;
|
|
6
|
+
}
|
|
4
7
|
interface FieldLegendProps extends React.ComponentProps<"legend"> {
|
|
5
8
|
/**
|
|
6
9
|
* Visual style variant of the legend
|
package/dist/field.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/components/field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEzD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,2CAY1E;
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/components/field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEzD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,2CAY1E;kBAZQ,QAAQ;;;AAgBjB,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC;IAC/D;;;OAGG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC9B;AAED,QAAA,MAAM,mBAAmB,EAAE,gBAAgB,CAAC,SAAS,CAAC,EAAwB,CAAC;AAE/E,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAkB,EAClB,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAclB;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWvE;AAED,QAAA,MAAM,aAAa;;8EAmBjB,CAAC;AAEH;;GAEG;AACH,UAAU,UACR,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC;IACvE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,WAAwB,EACxB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,UAAU,2CAWZ;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWzE;AAED,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC;IAClE;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAiBpE;AAED,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAc3E;AAED,OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,QAAQ,EACR,YAAY,GACb,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/field.js
CHANGED
|
@@ -3,7 +3,7 @@ import { cva as i } from "class-variance-authority";
|
|
|
3
3
|
import { cn as l } from "@brightlocal/ui-components/lib/utils";
|
|
4
4
|
import { Description as r } from "./description.js";
|
|
5
5
|
import { Label as s } from "@brightlocal/ui-components/label";
|
|
6
|
-
function
|
|
6
|
+
function n({ className: e, ...a }) {
|
|
7
7
|
return /* @__PURE__ */ t(
|
|
8
8
|
"fieldset",
|
|
9
9
|
{
|
|
@@ -17,6 +17,7 @@ function g({ className: e, ...a }) {
|
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
|
+
n.displayName = "FieldSet";
|
|
20
21
|
const x = ["legend", "label"];
|
|
21
22
|
function h({
|
|
22
23
|
className: e,
|
|
@@ -51,7 +52,7 @@ function b({ className: e, ...a }) {
|
|
|
51
52
|
}
|
|
52
53
|
);
|
|
53
54
|
}
|
|
54
|
-
const
|
|
55
|
+
const f = i("group/field flex w-full gap-2", {
|
|
55
56
|
variants: {
|
|
56
57
|
orientation: {
|
|
57
58
|
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
@@ -80,7 +81,7 @@ function v({
|
|
|
80
81
|
return /* @__PURE__ */ t(
|
|
81
82
|
"div",
|
|
82
83
|
{
|
|
83
|
-
className: l(
|
|
84
|
+
className: l(f({ orientation: a }), e),
|
|
84
85
|
"data-hook": o,
|
|
85
86
|
"data-orientation": a,
|
|
86
87
|
"data-slot": "field",
|
|
@@ -144,6 +145,6 @@ export {
|
|
|
144
145
|
b as FieldGroup,
|
|
145
146
|
k as FieldLabel,
|
|
146
147
|
h as FieldLegend,
|
|
147
|
-
|
|
148
|
+
n as FieldSet,
|
|
148
149
|
x as fieldLegendVariants
|
|
149
150
|
};
|