@brightlocal/ui-components 2.21.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 +40 -5
- 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.d.ts +35 -3
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +178 -152
- 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/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +45 -45
- 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 +311 -308
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +7 -5
- 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/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.d.ts +5 -7
- package/dist/navigation-menu.d.ts.map +1 -1
- package/dist/navigation-menu.js +82 -90
- 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/table.cjs +1 -1
- package/dist/table.d.ts +22 -2
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +57 -43
- 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 +37 -34
- package/package.json +1 -1
- package/src/blocks/data-table.tsx +58 -4
- 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/hover-card.tsx +6 -3
- package/src/components/loading.tsx +322 -0
- package/src/components/map.tsx +3 -1
- package/src/components/menubar.tsx +6 -5
- package/src/components/navigation-menu.tsx +80 -101
- package/src/components/popover.tsx +6 -2
- package/src/components/select.tsx +5 -8
- package/src/components/table.tsx +44 -7
- package/src/components/tooltip.tsx +36 -8
- package/src/index.ts +1 -0
- package/src/lib/utils.ts +3 -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/navigation-menu.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),R=require("react"),_=require("@radix-ui/react-navigation-menu"),T=require("@brightlocal/icons"),r=require("@brightlocal/ui-components/lib/utils");function f(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const d=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,d.get?d:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const o=f(R),s=f(_),v=o.forwardRef(({className:t,children:e,dataHook:a,delayDuration:d=50,...c},u)=>n.jsxs(s.Root,{ref:u,className:r.cn("relative z-10 flex max-w-max flex-1 items-center justify-center",t),"data-hook":a,"data-slot":"navigation-menu",delayDuration:d,...c,children:[e,n.jsx(l,{})]}));v.displayName="NavigationMenu";const p=o.forwardRef(({className:t,...e},a)=>n.jsx(s.List,{ref:a,className:r.cn("group flex flex-1 list-none items-center justify-center gap-1",t),"data-slot":"navigation-menu-list",...e}));p.displayName="NavigationMenuList";const N=o.forwardRef((t,e)=>n.jsx(s.Item,{ref:e,"data-slot":"navigation-menu-item",...t}));N.displayName="NavigationMenuItem";const I=400,b=o.forwardRef(({className:t,children:e,onClick:a,onPointerDown:d,onPointerEnter:c,...u},M)=>{const g=o.useRef(""),m=o.useRef(0);return n.jsxs(s.Trigger,{ref:M,className:r.cn(["group inline-flex h-9 w-max items-center justify-center gap-1","rounded-md px-4 py-2","text-sm font-medium","text-foreground","transition-colors","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground","focus-visible:bg-accent focus-visible:ring-ring focus-visible:shadow-[0_0_0_4px_rgba(163,163,163,0.1)] focus-visible:ring-1 focus-visible:outline-none","disabled:pointer-events-none disabled:opacity-50","data-[state=open]:bg-accent/50"],t),"data-slot":"navigation-menu-trigger",onClick:i=>{const j=i.currentTarget.getAttribute("data-state")==="open",y=i.timeStamp-m.current<I;g.current==="mouse"&&i.detail>0&&j&&y&&i.preventDefault(),a?.(i)},onPointerDown:i=>{g.current=i.pointerType,d?.(i)},onPointerEnter:i=>{m.current=i.timeStamp,c?.(i)},...u,children:[e,n.jsx(T.ChevronDown,{"aria-hidden":"true",className:"relative top-[1px] ml-1 transition duration-300 group-data-[state=open]:rotate-180",size:12})]})});b.displayName="NavigationMenuTrigger";const x=o.forwardRef(({className:t,...e},a)=>n.jsx(s.Content,{ref:a,className:r.cn(["data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out top-0 left-0 w-full","data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out","data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52","data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52","duration-200 ease-[cubic-bezier(0.22,1,0.36,1)]","md:absolute md:w-auto"],t),"data-slot":"navigation-menu-content",role:"group",...e}));x.displayName="NavigationMenuContent";const w=o.forwardRef(({className:t,...e},a)=>n.jsx(s.Link,{ref:a,className:r.cn(["block rounded-md p-3 leading-none no-underline select-none","transition-colors outline-none","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground","focus-visible:bg-accent focus-visible:ring-ring focus-visible:shadow-[0_0_0_4px_rgba(163,163,163,0.1)] focus-visible:ring-1 focus-visible:outline-none"],t),"data-slot":"navigation-menu-link",...e}));w.displayName="NavigationMenuLink";const l=o.forwardRef(({className:t,...e},a)=>n.jsx("div",{className:r.cn("absolute top-full left-0 z-50 flex justify-center"),children:n.jsx(s.Viewport,{ref:a,className:r.cn(["origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)]","bg-popover text-popover-foreground w-full overflow-hidden rounded-md border shadow-sm","transition-[width,height] duration-200 ease-[cubic-bezier(0.22,1,0.36,1)]","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-150","md:w-[var(--radix-navigation-menu-viewport-width)]"],t),"data-slot":"navigation-menu-viewport",...e})}));l.displayName="NavigationMenuViewport";const h=o.forwardRef(({className:t,...e},a)=>n.jsx(s.Indicator,{ref:a,className:r.cn(["top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden","data-[state=visible]:animate-in data-[state=hidden]:animate-out","data-[state=hidden]:fade-out data-[state=visible]:fade-in"],t),"data-slot":"navigation-menu-indicator",...e,children:n.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})}));h.displayName="NavigationMenuIndicator";exports.NavigationMenu=v;exports.NavigationMenuContent=x;exports.NavigationMenuIndicator=h;exports.NavigationMenuItem=N;exports.NavigationMenuLink=w;exports.NavigationMenuList=p;exports.NavigationMenuTrigger=b;exports.NavigationMenuViewport=l;
|
|
@@ -37,13 +37,11 @@ type NavigationMenuTriggerProps = React.ComponentPropsWithoutRef<typeof Navigati
|
|
|
37
37
|
* closes it immediately (see radix-ui/primitives#1630).
|
|
38
38
|
*
|
|
39
39
|
* We port Base UI's "patient click" behaviour: an instinctive mouse click made
|
|
40
|
-
* within {@link PATIENT_CLICK_THRESHOLD_MS} of the
|
|
41
|
-
* (calling `preventDefault()` makes Radix's internal
|
|
42
|
-
* skip its toggle).
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* menu shut, and touch taps and keyboard activation are left untouched so they
|
|
46
|
-
* can toggle it too.
|
|
40
|
+
* within {@link PATIENT_CLICK_THRESHOLD_MS} of the pointer entering an open
|
|
41
|
+
* trigger keeps the menu open (calling `preventDefault()` makes Radix's internal
|
|
42
|
+
* `composeEventHandlers` skip its toggle). A deliberate click after that window
|
|
43
|
+
* still toggles the menu shut, and touch taps and keyboard activation are left
|
|
44
|
+
* untouched so they can toggle it too.
|
|
47
45
|
*/
|
|
48
46
|
declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
49
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../src/components/navigation-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,uBAAuB,MAAM,iCAAiC,CAAC;AAK3E;;;GAGG;AACH,UAAU,mBAAoB,SAAQ,KAAK,CAAC,wBAAwB,CAClE,OAAO,uBAAuB,CAAC,IAAI,CACpC;IACC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,cAAc,yFAoBlB,CAAC;AAIH;;;GAGG;AACH,QAAA,MAAM,kBAAkB,+KAatB,CAAC;AAIH;;GAEG;AACH,QAAA,MAAM,kBAAkB,yKAStB,CAAC;AAIH;;GAEG;AACH,KAAK,0BAA0B,GAAG,KAAK,CAAC,wBAAwB,CAC9D,OAAO,uBAAuB,CAAC,OAAO,CACvC,CAAC;
|
|
1
|
+
{"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../src/components/navigation-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,uBAAuB,MAAM,iCAAiC,CAAC;AAK3E;;;GAGG;AACH,UAAU,mBAAoB,SAAQ,KAAK,CAAC,wBAAwB,CAClE,OAAO,uBAAuB,CAAC,IAAI,CACpC;IACC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,cAAc,yFAoBlB,CAAC;AAIH;;;GAGG;AACH,QAAA,MAAM,kBAAkB,+KAatB,CAAC;AAIH;;GAEG;AACH,QAAA,MAAM,kBAAkB,yKAStB,CAAC;AAIH;;GAEG;AACH,KAAK,0BAA0B,GAAG,KAAK,CAAC,wBAAwB,CAC9D,OAAO,uBAAuB,CAAC,OAAO,CACvC,CAAC;AAUF;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,qBAAqB,oLA0E1B,CAAC;AAIF;;GAEG;AACH,KAAK,0BAA0B,GAAG,KAAK,CAAC,wBAAwB,CAC9D,OAAO,uBAAuB,CAAC,OAAO,CACvC,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,qBAAqB,8KAwBzB,CAAC;AAIH;;GAEG;AACH,KAAK,uBAAuB,GAAG,KAAK,CAAC,wBAAwB,CAC3D,OAAO,uBAAuB,CAAC,IAAI,CACpC,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,kBAAkB,iLAmBtB,CAAC;AAIH;;;GAGG;AACH,QAAA,MAAM,sBAAsB,+KA2B1B,CAAC;AAIH;;;GAGG;AACH,QAAA,MAAM,uBAAuB,gLAmB3B,CAAC;AAIH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,GACxB,CAAC;AAEF,YAAY,EACV,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,GACxB,CAAC"}
|