@brightlocal/ui-components 2.22.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/component-meta.json +19 -1
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +31 -31
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.js +2 -2
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +111 -109
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +109 -121
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +295 -293
- package/dist/loading.cjs +1 -0
- package/dist/loading.d.ts +46 -0
- package/dist/loading.d.ts.map +1 -0
- package/dist/loading.js +142 -0
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +1 -1
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +97 -99
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +27 -26
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +29 -35
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +21 -2
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +35 -32
- package/package.json +1 -1
- package/src/blocks/data-table.tsx +2 -2
- package/src/components/alert.tsx +9 -13
- package/src/components/context-menu.tsx +8 -3
- package/src/components/dropdown-menu.tsx +6 -15
- package/src/components/loading.tsx +322 -0
- package/src/components/map.tsx +3 -1
- package/src/components/menubar.tsx +6 -5
- package/src/components/popover.tsx +6 -2
- package/src/components/select.tsx +5 -8
- package/src/components/tooltip.tsx +28 -3
- package/src/index.ts +1 -0
package/dist/menubar.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { Check as m, Circle as f, ChevronRight as
|
|
4
|
-
import { cn as
|
|
5
|
-
function
|
|
1
|
+
import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "@radix-ui/react-menubar";
|
|
3
|
+
import { Check as m, Circle as f, ChevronRight as p } from "@brightlocal/icons";
|
|
4
|
+
import { cn as u, FLOATING_CONTENT_ANIMATION as b } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
function g({
|
|
6
6
|
className: e,
|
|
7
7
|
dataHook: t,
|
|
8
|
-
defaultValue:
|
|
9
|
-
...
|
|
8
|
+
defaultValue: o,
|
|
9
|
+
...a
|
|
10
10
|
}) {
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
11
|
+
return /* @__PURE__ */ r(
|
|
12
|
+
n.Root,
|
|
13
13
|
{
|
|
14
|
-
className:
|
|
14
|
+
className: u(
|
|
15
15
|
"border-border bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",
|
|
16
16
|
e
|
|
17
17
|
),
|
|
@@ -19,26 +19,26 @@ function p({
|
|
|
19
19
|
"data-slot": "menubar",
|
|
20
20
|
"data-tracking-el": "menubar",
|
|
21
21
|
"data-tracking-label": t,
|
|
22
|
-
defaultValue:
|
|
23
|
-
...
|
|
22
|
+
defaultValue: o,
|
|
23
|
+
...a
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
function
|
|
27
|
+
g.displayName = "Menubar";
|
|
28
|
+
function N({
|
|
29
29
|
value: e,
|
|
30
30
|
...t
|
|
31
31
|
}) {
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ r(n.Menu, { "data-slot": "menubar-menu", value: e, ...t });
|
|
33
33
|
}
|
|
34
34
|
function y({
|
|
35
35
|
className: e,
|
|
36
36
|
...t
|
|
37
37
|
}) {
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
|
|
38
|
+
return /* @__PURE__ */ r(
|
|
39
|
+
n.Trigger,
|
|
40
40
|
{
|
|
41
|
-
className:
|
|
41
|
+
className: u(
|
|
42
42
|
"text-foreground flex cursor-pointer items-center justify-center gap-2 rounded-xs px-3 py-1 text-sm font-normal transition-colors",
|
|
43
43
|
"hover:bg-accent hover:text-accent-foreground",
|
|
44
44
|
"focus:bg-accent focus:text-accent-foreground focus:outline-none",
|
|
@@ -54,78 +54,77 @@ function y({
|
|
|
54
54
|
function M({
|
|
55
55
|
align: e = "start",
|
|
56
56
|
alignOffset: t = -4,
|
|
57
|
-
className:
|
|
58
|
-
sideOffset:
|
|
59
|
-
...
|
|
57
|
+
className: o,
|
|
58
|
+
sideOffset: a = 8,
|
|
59
|
+
...s
|
|
60
60
|
}) {
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
|
|
61
|
+
return /* @__PURE__ */ r(n.Portal, { children: /* @__PURE__ */ r(
|
|
62
|
+
n.Content,
|
|
63
63
|
{
|
|
64
64
|
align: e,
|
|
65
65
|
alignOffset: t,
|
|
66
|
-
className:
|
|
66
|
+
className: u(
|
|
67
67
|
"border-border bg-popover text-popover-foreground z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) rounded-md border p-1 shadow-md",
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
a
|
|
68
|
+
b,
|
|
69
|
+
o
|
|
71
70
|
),
|
|
72
71
|
"data-slot": "menubar-content",
|
|
73
|
-
sideOffset:
|
|
74
|
-
...
|
|
72
|
+
sideOffset: a,
|
|
73
|
+
...s
|
|
75
74
|
}
|
|
76
75
|
) });
|
|
77
76
|
}
|
|
78
|
-
function
|
|
77
|
+
function I({
|
|
79
78
|
className: e,
|
|
80
79
|
disabled: t,
|
|
81
|
-
inset:
|
|
82
|
-
...
|
|
80
|
+
inset: o,
|
|
81
|
+
...a
|
|
83
82
|
}) {
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
|
|
83
|
+
return /* @__PURE__ */ r(
|
|
84
|
+
n.Item,
|
|
86
85
|
{
|
|
87
|
-
className:
|
|
86
|
+
className: u(
|
|
88
87
|
"text-foreground relative flex cursor-pointer items-center justify-between rounded-sm px-2 py-1.5 text-sm font-normal transition-colors outline-none",
|
|
89
88
|
"hover:bg-accent hover:text-foreground",
|
|
90
89
|
"focus:bg-accent focus:text-foreground",
|
|
91
90
|
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
92
|
-
|
|
91
|
+
o && "pl-8",
|
|
93
92
|
e
|
|
94
93
|
),
|
|
95
94
|
"data-slot": "menubar-item",
|
|
96
95
|
disabled: t,
|
|
97
|
-
...
|
|
96
|
+
...a
|
|
98
97
|
}
|
|
99
98
|
);
|
|
100
99
|
}
|
|
101
100
|
function S({
|
|
102
101
|
checked: e,
|
|
103
102
|
children: t,
|
|
104
|
-
className:
|
|
105
|
-
closeOnSelect:
|
|
106
|
-
onCheckedChange:
|
|
107
|
-
onSelect:
|
|
103
|
+
className: o,
|
|
104
|
+
closeOnSelect: a = !0,
|
|
105
|
+
onCheckedChange: s,
|
|
106
|
+
onSelect: d,
|
|
108
107
|
...i
|
|
109
108
|
}) {
|
|
110
109
|
return /* @__PURE__ */ c(
|
|
111
|
-
|
|
110
|
+
n.CheckboxItem,
|
|
112
111
|
{
|
|
113
112
|
checked: e,
|
|
114
|
-
className:
|
|
113
|
+
className: u(
|
|
115
114
|
"text-foreground relative flex cursor-pointer items-center justify-between rounded-sm py-1.5 pr-2 pl-8 text-sm font-normal transition-colors outline-none",
|
|
116
115
|
"hover:bg-accent hover:text-foreground",
|
|
117
116
|
"focus:bg-accent focus:text-foreground",
|
|
118
117
|
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
119
|
-
|
|
118
|
+
o
|
|
120
119
|
),
|
|
121
120
|
"data-slot": "menubar-checkbox-item",
|
|
122
|
-
onCheckedChange:
|
|
121
|
+
onCheckedChange: s,
|
|
123
122
|
onSelect: (l) => {
|
|
124
|
-
|
|
123
|
+
a || l.preventDefault(), d?.(l);
|
|
125
124
|
},
|
|
126
125
|
...i,
|
|
127
126
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ r("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ r(n.ItemIndicator, { children: /* @__PURE__ */ r(m, { className: "text-foreground" }) }) }),
|
|
129
128
|
t
|
|
130
129
|
]
|
|
131
130
|
}
|
|
@@ -134,30 +133,30 @@ function S({
|
|
|
134
133
|
function w({
|
|
135
134
|
onValueChange: e,
|
|
136
135
|
value: t,
|
|
137
|
-
...
|
|
136
|
+
...o
|
|
138
137
|
}) {
|
|
139
|
-
return /* @__PURE__ */
|
|
140
|
-
|
|
138
|
+
return /* @__PURE__ */ r(
|
|
139
|
+
n.RadioGroup,
|
|
141
140
|
{
|
|
142
141
|
"data-slot": "menubar-radio-group",
|
|
143
142
|
value: t,
|
|
144
143
|
onValueChange: e,
|
|
145
|
-
...
|
|
144
|
+
...o
|
|
146
145
|
}
|
|
147
146
|
);
|
|
148
147
|
}
|
|
149
|
-
function
|
|
148
|
+
function C({
|
|
150
149
|
children: e,
|
|
151
150
|
className: t,
|
|
152
|
-
closeOnSelect:
|
|
153
|
-
onSelect:
|
|
154
|
-
value:
|
|
155
|
-
...
|
|
151
|
+
closeOnSelect: o = !0,
|
|
152
|
+
onSelect: a,
|
|
153
|
+
value: s,
|
|
154
|
+
...d
|
|
156
155
|
}) {
|
|
157
156
|
return /* @__PURE__ */ c(
|
|
158
|
-
|
|
157
|
+
n.RadioItem,
|
|
159
158
|
{
|
|
160
|
-
className:
|
|
159
|
+
className: u(
|
|
161
160
|
"text-foreground relative flex cursor-pointer items-center justify-between rounded-sm py-1.5 pr-2 pl-8 text-sm font-normal transition-colors outline-none",
|
|
162
161
|
"hover:bg-accent hover:text-foreground",
|
|
163
162
|
"focus:bg-accent focus:text-foreground",
|
|
@@ -165,13 +164,13 @@ function I({
|
|
|
165
164
|
t
|
|
166
165
|
),
|
|
167
166
|
"data-slot": "menubar-radio-item",
|
|
168
|
-
value:
|
|
167
|
+
value: s,
|
|
169
168
|
onSelect: (i) => {
|
|
170
|
-
|
|
169
|
+
o || i.preventDefault(), a?.(i);
|
|
171
170
|
},
|
|
172
|
-
...
|
|
171
|
+
...d,
|
|
173
172
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ r("span", { className: "absolute left-3 flex size-2 items-center justify-center", children: /* @__PURE__ */ r(n.ItemIndicator, { children: /* @__PURE__ */ r(f, { className: "fill-foreground", size: 8 }) }) }),
|
|
175
174
|
e
|
|
176
175
|
]
|
|
177
176
|
}
|
|
@@ -180,42 +179,42 @@ function I({
|
|
|
180
179
|
function j({
|
|
181
180
|
className: e,
|
|
182
181
|
inset: t,
|
|
183
|
-
...
|
|
182
|
+
...o
|
|
184
183
|
}) {
|
|
185
|
-
return /* @__PURE__ */
|
|
186
|
-
|
|
184
|
+
return /* @__PURE__ */ r(
|
|
185
|
+
n.Label,
|
|
187
186
|
{
|
|
188
|
-
className:
|
|
187
|
+
className: u(
|
|
189
188
|
"text-foreground px-2 py-1.5 text-sm font-semibold",
|
|
190
189
|
t && "pl-8",
|
|
191
190
|
e
|
|
192
191
|
),
|
|
193
192
|
"data-slot": "menubar-label",
|
|
194
|
-
...
|
|
193
|
+
...o
|
|
195
194
|
}
|
|
196
195
|
);
|
|
197
196
|
}
|
|
198
|
-
function
|
|
197
|
+
function k({
|
|
199
198
|
className: e,
|
|
200
199
|
...t
|
|
201
200
|
}) {
|
|
202
|
-
return /* @__PURE__ */
|
|
203
|
-
|
|
201
|
+
return /* @__PURE__ */ r(
|
|
202
|
+
n.Separator,
|
|
204
203
|
{
|
|
205
|
-
className:
|
|
204
|
+
className: u("bg-border -mx-1 my-1 h-px", e),
|
|
206
205
|
"data-slot": "menubar-separator",
|
|
207
206
|
...t
|
|
208
207
|
}
|
|
209
208
|
);
|
|
210
209
|
}
|
|
211
|
-
function
|
|
210
|
+
function T({
|
|
212
211
|
className: e,
|
|
213
212
|
...t
|
|
214
213
|
}) {
|
|
215
|
-
return /* @__PURE__ */
|
|
214
|
+
return /* @__PURE__ */ r(
|
|
216
215
|
"span",
|
|
217
216
|
{
|
|
218
|
-
className:
|
|
217
|
+
className: u(
|
|
219
218
|
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
220
219
|
e
|
|
221
220
|
),
|
|
@@ -224,49 +223,48 @@ function C({
|
|
|
224
223
|
}
|
|
225
224
|
);
|
|
226
225
|
}
|
|
227
|
-
function
|
|
226
|
+
function R({
|
|
228
227
|
...e
|
|
229
228
|
}) {
|
|
230
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ r(n.Sub, { "data-slot": "menubar-sub", ...e });
|
|
231
230
|
}
|
|
232
|
-
function
|
|
231
|
+
function z({
|
|
233
232
|
children: e,
|
|
234
233
|
className: t,
|
|
235
|
-
inset:
|
|
236
|
-
...
|
|
234
|
+
inset: o,
|
|
235
|
+
...a
|
|
237
236
|
}) {
|
|
238
237
|
return /* @__PURE__ */ c(
|
|
239
|
-
|
|
238
|
+
n.SubTrigger,
|
|
240
239
|
{
|
|
241
|
-
className:
|
|
240
|
+
className: u(
|
|
242
241
|
"text-foreground flex cursor-pointer items-center justify-between rounded-xs px-2 py-1.5 text-sm font-normal transition-colors outline-none",
|
|
243
242
|
"hover:bg-accent hover:text-foreground",
|
|
244
243
|
"focus:bg-accent focus:text-foreground",
|
|
245
244
|
"data-[state=open]:bg-accent data-[state=open]:text-foreground",
|
|
246
245
|
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
247
|
-
|
|
246
|
+
o && "pl-8",
|
|
248
247
|
t
|
|
249
248
|
),
|
|
250
249
|
"data-slot": "menubar-sub-trigger",
|
|
251
|
-
...
|
|
250
|
+
...a,
|
|
252
251
|
children: [
|
|
253
252
|
e,
|
|
254
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ r(p, { className: "ml-auto" })
|
|
255
254
|
]
|
|
256
255
|
}
|
|
257
256
|
);
|
|
258
257
|
}
|
|
259
|
-
function
|
|
258
|
+
function A({
|
|
260
259
|
className: e,
|
|
261
260
|
...t
|
|
262
261
|
}) {
|
|
263
|
-
return /* @__PURE__ */
|
|
264
|
-
|
|
262
|
+
return /* @__PURE__ */ r(
|
|
263
|
+
n.SubContent,
|
|
265
264
|
{
|
|
266
|
-
className:
|
|
265
|
+
className: u(
|
|
267
266
|
"border-border bg-popover text-popover-foreground z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) rounded-md border p-1 shadow-lg",
|
|
268
|
-
|
|
269
|
-
"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",
|
|
267
|
+
b,
|
|
270
268
|
e
|
|
271
269
|
),
|
|
272
270
|
"data-slot": "menubar-sub-content",
|
|
@@ -275,18 +273,18 @@ function T({
|
|
|
275
273
|
);
|
|
276
274
|
}
|
|
277
275
|
export {
|
|
278
|
-
|
|
276
|
+
g as Menubar,
|
|
279
277
|
S as MenubarCheckboxItem,
|
|
280
278
|
M as MenubarContent,
|
|
281
|
-
|
|
279
|
+
I as MenubarItem,
|
|
282
280
|
j as MenubarLabel,
|
|
283
|
-
|
|
281
|
+
N as MenubarMenu,
|
|
284
282
|
w as MenubarRadioGroup,
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
283
|
+
C as MenubarRadioItem,
|
|
284
|
+
k as MenubarSeparator,
|
|
285
|
+
T as MenubarShortcut,
|
|
286
|
+
R as MenubarSub,
|
|
287
|
+
A as MenubarSubContent,
|
|
288
|
+
z as MenubarSubTrigger,
|
|
291
289
|
y as MenubarTrigger
|
|
292
290
|
};
|
package/dist/popover.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),f=require("@radix-ui/react-popover"),c=require("@brightlocal/ui-components/lib/utils"),m=require("@brightlocal/ui-components/hooks/use-overlay-pointer-lock");function p(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,a.get?a:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const i=p(g),n=p(f);function s({...e}){return t.jsx(n.Root,{"data-slot":"popover",...e})}s.displayName="Popover";const d=i.forwardRef(({dataHook:e,...r},o)=>t.jsx(n.Trigger,{ref:o,"data-slot":"popover-trigger",...e!=null&&{"data-hook":e},...r}));d.displayName="PopoverTrigger";const l=i.forwardRef(({className:e,align:r="center",sideOffset:o=4,dataHook:a,...v},P)=>(m.useOverlayPointerLock(),t.jsx(n.Portal,{children:t.jsx(n.Content,{ref:P,align:r,className:c.cn("bg-popover text-popover-foreground z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",c.FLOATING_CONTENT_ANIMATION,e),"data-hook":a,"data-slot":"popover-content",sideOffset:o,...v})})));l.displayName="PopoverContent";const u=i.forwardRef(({dataHook:e,...r},o)=>t.jsx(n.Anchor,{ref:o,"data-hook":e,"data-slot":"popover-anchor",...r}));u.displayName="PopoverAnchor";exports.Popover=s;exports.PopoverAnchor=u;exports.PopoverContent=l;exports.PopoverTrigger=d;
|
package/dist/popover.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/components/popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gB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ACnC,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qFAAqF;IACrF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uIAAuI;IACvI,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC9B,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,QAAA,MAAM,cAAc,yGA6BnB,CAAC;AAGF,MAAM,WAAW,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAC9D,OAAO,gBAAgB,CAAC,MAAM,CAC/B;IACC,2GAA2G;IAC3G,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,QAAA,MAAM,aAAa,wGAUjB,CAAC;AAGH,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/popover.js
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as p from "react";
|
|
3
3
|
import * as a from "@radix-ui/react-popover";
|
|
4
|
-
import { cn as s } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
-
import { useOverlayPointerLock as
|
|
6
|
-
function
|
|
7
|
-
return /* @__PURE__ */
|
|
4
|
+
import { cn as m, FLOATING_CONTENT_ANIMATION as s } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
import { useOverlayPointerLock as v } from "@brightlocal/ui-components/hooks/use-overlay-pointer-lock";
|
|
6
|
+
function c({ ...o }) {
|
|
7
|
+
return /* @__PURE__ */ t(a.Root, { "data-slot": "popover", ...o });
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
const
|
|
9
|
+
c.displayName = "Popover";
|
|
10
|
+
const l = p.forwardRef(({ dataHook: o, ...r }, e) => /* @__PURE__ */ t(
|
|
11
11
|
a.Trigger,
|
|
12
12
|
{
|
|
13
13
|
ref: e,
|
|
14
14
|
"data-slot": "popover-trigger",
|
|
15
15
|
...o != null && { "data-hook": o },
|
|
16
|
-
...
|
|
16
|
+
...r
|
|
17
17
|
}
|
|
18
18
|
));
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
({ className: o, align:
|
|
19
|
+
l.displayName = "PopoverTrigger";
|
|
20
|
+
const f = p.forwardRef(
|
|
21
|
+
({ className: o, align: r = "center", sideOffset: e = 4, dataHook: n, ...i }, d) => (v(), /* @__PURE__ */ t(a.Portal, { children: /* @__PURE__ */ t(
|
|
22
22
|
a.Content,
|
|
23
23
|
{
|
|
24
|
-
ref:
|
|
25
|
-
align:
|
|
26
|
-
className:
|
|
27
|
-
"bg-popover text-popover-foreground
|
|
24
|
+
ref: d,
|
|
25
|
+
align: r,
|
|
26
|
+
className: m(
|
|
27
|
+
"bg-popover text-popover-foreground z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
28
|
+
s,
|
|
28
29
|
o
|
|
29
30
|
),
|
|
30
|
-
"data-hook":
|
|
31
|
+
"data-hook": n,
|
|
31
32
|
"data-slot": "popover-content",
|
|
32
33
|
sideOffset: e,
|
|
33
|
-
...
|
|
34
|
+
...i
|
|
34
35
|
}
|
|
35
36
|
) }))
|
|
36
37
|
);
|
|
37
|
-
|
|
38
|
-
const
|
|
38
|
+
f.displayName = "PopoverContent";
|
|
39
|
+
const g = p.forwardRef(({ dataHook: o, ...r }, e) => /* @__PURE__ */ t(
|
|
39
40
|
a.Anchor,
|
|
40
41
|
{
|
|
41
42
|
ref: e,
|
|
42
43
|
"data-hook": o,
|
|
43
44
|
"data-slot": "popover-anchor",
|
|
44
|
-
...
|
|
45
|
+
...r
|
|
45
46
|
}
|
|
46
47
|
));
|
|
47
|
-
|
|
48
|
+
g.displayName = "PopoverAnchor";
|
|
48
49
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
c as Popover,
|
|
51
|
+
g as PopoverAnchor,
|
|
52
|
+
f as PopoverContent,
|
|
53
|
+
l as PopoverTrigger
|
|
53
54
|
};
|
package/dist/select.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),q=require("react"),C=require("@radix-ui/react-select"),d=require("@brightlocal/icons"),
|
|
2
|
-
Import: import { Combobox } from "@brightlocal/ui-components/combobox"`,[r]);const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),q=require("react"),C=require("@radix-ui/react-select"),d=require("@brightlocal/icons"),I=require("class-variance-authority"),a=require("@brightlocal/ui-components/lib/utils"),T=require("./lib/use-dev-warning.cjs"),O=require("@brightlocal/ui-components/hooks/use-overlay-pointer-lock");function g(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const _=g(q),o=g(C);function v({children:e,...r}){return t.jsx(o.Root,{"data-slot":"select",...r,children:e})}v.displayName="Select";function x(e){return t.jsx(o.Group,{"data-slot":"select-group",...e})}x.displayName="SelectGroup";function S(e){return t.jsx(o.Value,{"data-slot":"select-value",...e})}S.displayName="SelectValue";const D=I.cva(["relative flex w-full h-9 items-center justify-between gap-2","px-3 py-2","border border-border rounded-sm outline-none transition-[border-color,box-shadow,background-color]","bg-neutral-50 border-neutral-300","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans text-foreground","[&>span]:block [&>span]:truncate","data-[placeholder]:text-muted-foreground","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0"]);function h({className:e,children:r,placeholder:n,dataHook:s,error:c,selectLabel:u,...l}){const i=c||l["aria-invalid"]===!0||l["aria-invalid"]==="true",p=l["aria-required"]===!0||l["aria-required"]==="true",m=l["aria-label"]||u||n||"Select an option",k=i?"border-destructive-40 dark:border-destructive-40 focus-visible:border-destructive-40 dark:focus-visible:border-destructive-40 focus-visible:shadow-destructive data-[state=open]:border-destructive-40 dark:data-[state=open]:border-destructive-40 data-[state=open]:shadow-destructive":"";return t.jsxs(o.Trigger,{...l,"aria-invalid":i?"true":void 0,"aria-label":m,"aria-required":p?"true":void 0,className:a.cn(D(),k,e),"data-hook":s,"data-slot":"select-trigger",children:[r,t.jsx(o.Icon,{asChild:!0,children:t.jsx(d.ChevronDown,{className:"text-muted-foreground"})})]})}h.displayName="SelectTrigger";function y({className:e,children:r,position:n="popper",maxHeight:s,style:c,...u}){O.useOverlayPointerLock();const l=_.useRef(null);T.useDevWarning(()=>l.current?l.current.querySelectorAll('[data-slot="select-item"]').length>=100:!1,`Select contains many items. For large lists (100+), consider using <Combobox> which supports search and filtering.
|
|
2
|
+
Import: import { Combobox } from "@brightlocal/ui-components/combobox"`,[r]);const i=a.cn("relative z-50 overflow-hidden","min-w-[8rem]","rounded-md border border-border bg-popover shadow-md","text-popover-foreground","max-h-[var(--radix-select-content-available-height)]","origin-[var(--radix-select-content-transform-origin)]",a.FLOATING_CONTENT_ANIMATION),p=n==="popper"&&a.cn("data-[side=bottom]:translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1","data-[side=top]:-translate-y-1"),m=s!==void 0?{...c,maxHeight:`min(${s}px, var(--radix-select-content-available-height))`}:c;return t.jsx(o.Portal,{children:t.jsxs(o.Content,{className:a.cn(i,p,e),"data-slot":"select-content",position:n,style:m,...u,children:[t.jsx(b,{}),t.jsx(o.Viewport,{ref:l,className:a.cn("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),t.jsx(f,{})]})})}y.displayName="SelectContent";function j({className:e,...r}){return t.jsx(o.Label,{className:a.cn("text-muted-foreground px-2 py-1.5 text-xs font-medium",e),"data-slot":"select-label",...r})}j.displayName="SelectLabel";function w({className:e,children:r,...n}){const s=a.cn("relative flex w-full cursor-default select-none items-center gap-2","rounded py-1.5 pl-2 pr-8","text-sm font-normal leading-5 text-popover-foreground","focus:bg-accent focus:text-accent-foreground","hover:bg-accent/50 hover:text-accent-foreground","outline-none focus:outline-none","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0");return t.jsxs(o.Item,{className:a.cn(s,e),"data-slot":"select-item",...n,children:[t.jsx("span",{className:"absolute right-2 flex size-4 items-center justify-center",children:t.jsx(o.ItemIndicator,{children:t.jsx(d.Check,{})})}),t.jsx(o.ItemText,{children:r})]})}w.displayName="SelectItem";function N({className:e,...r}){return t.jsx(o.Separator,{className:a.cn("bg-border pointer-events-none -mx-1 my-1 h-px",e),"data-slot":"select-separator",...r})}N.displayName="SelectSeparator";function b({className:e,...r}){return t.jsx(o.ScrollUpButton,{className:a.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...r,children:t.jsx(d.ChevronUp,{})})}b.displayName="SelectScrollUpButton";function f({className:e,...r}){return t.jsx(o.ScrollDownButton,{className:a.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...r,children:t.jsx(d.ChevronDown,{})})}f.displayName="SelectScrollDownButton";exports.Select=v;exports.SelectContent=y;exports.SelectGroup=x;exports.SelectItem=w;exports.SelectLabel=j;exports.SelectScrollDownButton=f;exports.SelectScrollUpButton=b;exports.SelectSeparator=N;exports.SelectTrigger=h;exports.SelectValue=S;
|
package/dist/select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAe1D,UAAU,WAAY,SAAQ,KAAK,CAAC,cAAc,CAChD,OAAO,eAAe,CAAC,IAAI,CAC5B;IACC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CACvD,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,MAAM,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAMlD;kBANQ,MAAM;;;AAUf;;GAEG;AACH,iBAAS,WAAW,CAClB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAG1D;kBAJQ,WAAW;;;AAQpB;;GAEG;AACH,iBAAS,WAAW,CAClB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAG1D;kBAJQ,WAAW;;;AA6CpB,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CACvD,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,WAAW,CA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