@brightlocal/ui-components 2.24.1 → 2.25.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 +93 -79
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +2 -2
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.js +17 -17
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +9 -9
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +43 -46
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.js +14 -14
- package/dist/brand-illustration-motif.cjs +1 -1
- package/dist/brand-illustration-motif.js +11 -11
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +10 -10
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.js +12 -12
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +7 -7
- package/dist/chip.cjs +1 -1
- package/dist/chip.js +7 -7
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/data-table.d.ts +29 -0
- package/dist/data-table.d.ts.map +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +61 -61
- package/dist/field.cjs +1 -1
- package/dist/field.js +1 -1
- package/dist/height-transition.cjs +1 -0
- package/dist/height-transition.d.ts +44 -0
- package/dist/height-transition.d.ts.map +1 -0
- package/dist/height-transition.js +63 -0
- 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 +326 -324
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +2 -2
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +15 -15
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/lib/motion.cjs +1 -0
- package/dist/lib/motion.d.ts +70 -0
- package/dist/lib/motion.d.ts.map +1 -0
- package/dist/lib/motion.js +25 -0
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +12 -4
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +17 -16
- package/dist/list.cjs +1 -1
- package/dist/list.js +10 -10
- package/dist/loading.cjs +1 -1
- package/dist/loading.d.ts.map +1 -1
- package/dist/loading.js +45 -47
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +2 -2
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.js +5 -5
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.js +13 -13
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.js +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +21 -25
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +12 -12
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.js +11 -11
- package/dist/select.cjs +1 -1
- package/dist/select.js +12 -12
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +54 -50
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +13 -13
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +4 -4
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +5 -5
- package/dist/table.cjs +1 -1
- package/dist/table.js +2 -2
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-reveal-motion.cjs +1 -1
- package/dist/text-reveal-motion.d.ts.map +1 -1
- package/dist/text-reveal-motion.js +77 -79
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +11 -11
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +5 -5
- package/package.json +13 -4
- package/src/blocks/input-list.tsx +3 -6
- package/src/blocks/sidebar.tsx +14 -14
- package/src/components/accordion.tsx +2 -2
- package/src/components/alert-dialog.tsx +2 -2
- package/src/components/badge.tsx +1 -1
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/button.tsx +2 -2
- package/src/components/card.tsx +1 -1
- package/src/components/carousel.tsx +1 -1
- package/src/components/checkbox.tsx +1 -1
- package/src/components/chip.tsx +2 -2
- package/src/components/combobox.tsx +1 -1
- package/src/components/data-table.tsx +29 -0
- package/src/components/dialog.tsx +3 -3
- package/src/components/field.tsx +1 -1
- package/src/components/height-transition.tsx +164 -0
- package/src/components/input-chip.tsx +2 -2
- package/src/components/input-group.tsx +2 -2
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input.tsx +1 -1
- package/src/components/link.tsx +4 -3
- package/src/components/list.tsx +1 -1
- package/src/components/loading.tsx +2 -15
- package/src/components/map.tsx +3 -2
- package/src/components/menubar.tsx +5 -5
- package/src/components/navigation-menu.tsx +6 -6
- package/src/components/pagination.tsx +1 -1
- package/src/components/progress.tsx +2 -10
- package/src/components/radio-group.tsx +1 -1
- package/src/components/scroll-area.tsx +2 -2
- package/src/components/select.tsx +1 -1
- package/src/components/sheet.tsx +9 -5
- package/src/components/slider.tsx +1 -1
- package/src/components/stepper.tsx +4 -4
- package/src/components/switch.tsx +2 -2
- package/src/components/table.tsx +2 -2
- package/src/components/tabs.tsx +1 -1
- package/src/components/text-reveal-motion.tsx +3 -8
- package/src/components/textarea.tsx +1 -1
- package/src/components/toggle.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/lib/motion.ts +75 -0
- package/src/lib/utils.ts +14 -2
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as P } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { AnimatePresence as
|
|
4
|
-
import { X as
|
|
3
|
+
import { AnimatePresence as D, motion as K } from "framer-motion";
|
|
4
|
+
import { X as S } from "@brightlocal/icons";
|
|
5
5
|
import { cn as y } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
-
import { usePrefersReducedMotion as
|
|
7
|
-
import {
|
|
6
|
+
import { usePrefersReducedMotion as $ } from "@brightlocal/ui-components/hooks/use-prefers-reduced-motion";
|
|
7
|
+
import { SPRING_SNAPPY as _ } from "../lib/motion.js";
|
|
8
|
+
import { Button as B } from "../button.js";
|
|
8
9
|
import { Input as V } from "../input.js";
|
|
9
|
-
import { Item as
|
|
10
|
-
const
|
|
10
|
+
import { Item as R, ItemContent as j, ItemTitle as E, ItemActions as M } from "../list.js";
|
|
11
|
+
const k = s.createContext(
|
|
11
12
|
null
|
|
12
13
|
);
|
|
13
14
|
function x() {
|
|
14
|
-
const t = s.useContext(
|
|
15
|
+
const t = s.useContext(k);
|
|
15
16
|
if (!t)
|
|
16
17
|
throw new Error("InputList components must be used within an <InputList>");
|
|
17
18
|
return t;
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function z({
|
|
20
21
|
value: t,
|
|
21
22
|
onValueChange: i,
|
|
22
23
|
children: d,
|
|
@@ -25,45 +26,45 @@ function M({
|
|
|
25
26
|
trackingEl: l,
|
|
26
27
|
trackingLabel: g
|
|
27
28
|
}) {
|
|
28
|
-
const [m,
|
|
29
|
-
() => t.map((
|
|
30
|
-
), [
|
|
29
|
+
const [m, p] = s.useState(""), h = s.useRef(t.length), e = s.useRef(t.length), [r, I] = s.useState(
|
|
30
|
+
() => t.map((f, n) => n)
|
|
31
|
+
), [A, N] = s.useState(0);
|
|
31
32
|
s.useEffect(() => {
|
|
32
|
-
const
|
|
33
|
-
h.current = t.length, t.length >
|
|
33
|
+
const f = h.current;
|
|
34
|
+
h.current = t.length, t.length > f && p(""), I((n) => n.length === t.length ? n : t.length > n.length ? [
|
|
34
35
|
...n,
|
|
35
36
|
...Array.from(
|
|
36
37
|
{ length: t.length - n.length },
|
|
37
38
|
() => e.current++
|
|
38
39
|
)
|
|
39
40
|
] : n.slice(0, t.length));
|
|
40
|
-
}, [t,
|
|
41
|
+
}, [t, A]);
|
|
41
42
|
const L = s.useCallback(
|
|
42
|
-
(
|
|
43
|
-
const n =
|
|
43
|
+
(f) => {
|
|
44
|
+
const n = f.map((u) => u.trim()).filter(Boolean);
|
|
44
45
|
n.length && (I((u) => [
|
|
45
46
|
...u,
|
|
46
47
|
...n.map(() => e.current++)
|
|
47
|
-
]), i([...t, ...n]),
|
|
48
|
+
]), i([...t, ...n]), N((u) => u + 1));
|
|
48
49
|
},
|
|
49
50
|
[t, i]
|
|
50
51
|
), b = s.useCallback(
|
|
51
|
-
(
|
|
52
|
-
I((n) => n.filter((u,
|
|
52
|
+
(f) => {
|
|
53
|
+
I((n) => n.filter((u, C) => C !== f)), i(t.filter((n, u) => u !== f));
|
|
53
54
|
},
|
|
54
55
|
[t, i]
|
|
55
|
-
),
|
|
56
|
+
), w = s.useMemo(
|
|
56
57
|
() => ({
|
|
57
58
|
value: t,
|
|
58
59
|
inputValue: m,
|
|
59
|
-
setInputValue:
|
|
60
|
+
setInputValue: p,
|
|
60
61
|
addItems: L,
|
|
61
62
|
removeItem: b,
|
|
62
63
|
stableKeys: r
|
|
63
64
|
}),
|
|
64
65
|
[t, m, L, b, r]
|
|
65
66
|
);
|
|
66
|
-
return /* @__PURE__ */ o(
|
|
67
|
+
return /* @__PURE__ */ o(k.Provider, { value: w, children: /* @__PURE__ */ o(
|
|
67
68
|
"div",
|
|
68
69
|
{
|
|
69
70
|
className: y("flex flex-col gap-4", a),
|
|
@@ -75,8 +76,8 @@ function M({
|
|
|
75
76
|
}
|
|
76
77
|
) });
|
|
77
78
|
}
|
|
78
|
-
|
|
79
|
-
function
|
|
79
|
+
z.displayName = "InputList";
|
|
80
|
+
function G({
|
|
80
81
|
dataHook: t = "input-list",
|
|
81
82
|
loading: i = !1,
|
|
82
83
|
skeletonCount: d = 5,
|
|
@@ -84,13 +85,13 @@ function z({
|
|
|
84
85
|
removeAriaLabel: c,
|
|
85
86
|
className: l
|
|
86
87
|
}) {
|
|
87
|
-
const { value: g, removeItem: m, stableKeys:
|
|
88
|
+
const { value: g, removeItem: m, stableKeys: p } = x(), h = $();
|
|
88
89
|
return i ? /* @__PURE__ */ o(
|
|
89
90
|
"ul",
|
|
90
91
|
{
|
|
91
92
|
className: y("flex flex-col gap-2", l),
|
|
92
93
|
"data-slot": "input-list-skeleton",
|
|
93
|
-
children: Array.from({ length: d }).map((e, r) => /* @__PURE__ */ o(
|
|
94
|
+
children: Array.from({ length: d }).map((e, r) => /* @__PURE__ */ o(R, { variant: "loading" }, r))
|
|
94
95
|
}
|
|
95
96
|
) : /* @__PURE__ */ o(
|
|
96
97
|
"ul",
|
|
@@ -98,8 +99,8 @@ function z({
|
|
|
98
99
|
className: y("flex flex-col gap-2", l),
|
|
99
100
|
"data-hook": `${t}-list`,
|
|
100
101
|
"data-slot": "list",
|
|
101
|
-
children: /* @__PURE__ */ o(
|
|
102
|
-
|
|
102
|
+
children: /* @__PURE__ */ o(D, { initial: !1, mode: "popLayout", children: g.map((e, r) => /* @__PURE__ */ o(
|
|
103
|
+
K.li,
|
|
103
104
|
{
|
|
104
105
|
layout: !0,
|
|
105
106
|
animate: { opacity: 1, scale: 1 },
|
|
@@ -116,15 +117,11 @@ function z({
|
|
|
116
117
|
transition: {
|
|
117
118
|
opacity: { duration: 0.15 },
|
|
118
119
|
scale: { duration: 0.15 },
|
|
119
|
-
layout:
|
|
120
|
-
type: "spring",
|
|
121
|
-
stiffness: 500,
|
|
122
|
-
damping: 35
|
|
123
|
-
}
|
|
120
|
+
layout: _
|
|
124
121
|
},
|
|
125
|
-
children: /* @__PURE__ */ o(
|
|
126
|
-
/* @__PURE__ */ o(
|
|
127
|
-
/* @__PURE__ */ o(
|
|
122
|
+
children: /* @__PURE__ */ o(R, { asChild: !0, variant: "filled", children: /* @__PURE__ */ P("div", { children: [
|
|
123
|
+
/* @__PURE__ */ o(j, { children: /* @__PURE__ */ o(E, { children: e }) }),
|
|
124
|
+
/* @__PURE__ */ o(M, { children: /* @__PURE__ */ o(
|
|
128
125
|
"button",
|
|
129
126
|
{
|
|
130
127
|
"aria-label": c ? c.replace("{item}", e) : `Remove ${e}`,
|
|
@@ -132,27 +129,27 @@ function z({
|
|
|
132
129
|
"inline-flex size-9 cursor-pointer items-center justify-center rounded-full",
|
|
133
130
|
"text-muted-foreground",
|
|
134
131
|
"focus-visible:shadow-default outline-none",
|
|
135
|
-
"transition-colors
|
|
132
|
+
"duration-fast transition-colors ease-out",
|
|
136
133
|
"disabled:pointer-events-none disabled:opacity-50"
|
|
137
134
|
),
|
|
138
135
|
"data-hook": `${t}-remove-${r}`,
|
|
139
136
|
disabled: a,
|
|
140
137
|
type: "button",
|
|
141
138
|
onClick: () => m(r),
|
|
142
|
-
children: /* @__PURE__ */ o(
|
|
139
|
+
children: /* @__PURE__ */ o(S, {})
|
|
143
140
|
}
|
|
144
141
|
) })
|
|
145
142
|
] }) })
|
|
146
143
|
},
|
|
147
|
-
|
|
144
|
+
p[r]
|
|
148
145
|
)) })
|
|
149
146
|
}
|
|
150
147
|
);
|
|
151
148
|
}
|
|
152
|
-
|
|
149
|
+
G.displayName = "InputListItems";
|
|
153
150
|
const T = s.forwardRef(
|
|
154
151
|
({ dataHook: t, error: i = !1, className: d, ...a }, c) => {
|
|
155
|
-
const { inputValue: l, setInputValue: g, addItems: m } = x(),
|
|
152
|
+
const { inputValue: l, setInputValue: g, addItems: m } = x(), p = (e) => {
|
|
156
153
|
e.key === "Enter" && (e.preventDefault(), m([l])), a.onKeyDown?.(e);
|
|
157
154
|
}, h = (e) => {
|
|
158
155
|
const I = e.clipboardData.getData("text").split(`
|
|
@@ -171,7 +168,7 @@ const T = s.forwardRef(
|
|
|
171
168
|
onChange: (e) => {
|
|
172
169
|
g(e.target.value), a.onChange?.(e);
|
|
173
170
|
},
|
|
174
|
-
onKeyDown:
|
|
171
|
+
onKeyDown: p,
|
|
175
172
|
onPaste: h
|
|
176
173
|
}
|
|
177
174
|
);
|
|
@@ -181,7 +178,7 @@ T.displayName = "InputListInput";
|
|
|
181
178
|
const X = s.forwardRef(({ dataHook: t, children: i, ...d }, a) => {
|
|
182
179
|
const { inputValue: c, addItems: l } = x();
|
|
183
180
|
return /* @__PURE__ */ o(
|
|
184
|
-
|
|
181
|
+
B,
|
|
185
182
|
{
|
|
186
183
|
ref: a,
|
|
187
184
|
...d,
|
|
@@ -193,9 +190,9 @@ const X = s.forwardRef(({ dataHook: t, children: i, ...d }, a) => {
|
|
|
193
190
|
});
|
|
194
191
|
X.displayName = "InputListAddButton";
|
|
195
192
|
export {
|
|
196
|
-
|
|
193
|
+
z as InputList,
|
|
197
194
|
X as InputListAddButton,
|
|
198
195
|
T as InputListInput,
|
|
199
|
-
|
|
196
|
+
G as InputListItems,
|
|
200
197
|
x as useInputListContext
|
|
201
198
|
};
|
package/dist/blocks/sidebar.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),_e=require("react"),Pe=require("react-dom"),y=require("@radix-ui/react-slot"),T=require("class-variance-authority"),m=require("@brightlocal/icons"),l=require("@brightlocal/ui-components/lib/utils"),U=require("../button.cjs"),Te=require("../input.cjs"),z=require("../separator.cjs"),N=require("../dropdown-menu.cjs"),_=require("../popover.cjs"),R=require("../sheet.cjs"),P=require("../accordion.cjs"),ze=require("@radix-ui/react-accordion"),Be=require("../scroll-area.cjs"),H=require("../skeleton.cjs"),I=require("../tooltip.cjs"),Le=require("../hooks/use-breakpoint.cjs");function K(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const i=K(_e),qe=K(ze),v="focus-visible:[box-shadow:0_0_0_1px_color-mix(in_srgb,var(--color-sidebar-ring)_50%,transparent),0_0_0_3px_rgba(0,0,0,0.1)]";var V=(e=>(e.LEFT="left",e))(V||{}),$=(e=>(e.SIDEBAR="sidebar",e))($||{}),W=(e=>(e.OFFCANVAS="offcanvas",e.ICON="icon",e.NONE="none",e))(W||{}),X=(e=>(e.DEFAULT="default",e.SM="sm",e.XS="xs",e))(X||{}),Y=(e=>(e.DEFAULT="default",e.COLLAPSIBLE="collapsible",e.ACTION="action",e))(Y||{}),Z=(e=>(e.SIMPLE="simple",e.COLLAPSIBLE="collapsible",e.DROPDOWN="dropdown",e.BADGE="badge",e.BIG_ICON="bigIcon",e.CHECKBOX="checkbox",e))(Z||{}),J=(e=>(e.DEFAULT="default",e.SM="sm",e.LG="lg",e))(J||{}),Q=(e=>(e.DEFAULT="default",e.BORDER="border",e.INDENT="indent",e))(Q||{}),ee=(e=>(e.SM="sm",e.MD="md",e))(ee||{}),ae=(e=>(e.CARET="caret",e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e.UP_DOWN="upDown",e.PLUS_MINUS="plusMinus",e.DOTS="dots",e))(ae||{});const Fe="sidebar:state",Ge=3600*24*7,He="232px",Ue="336px",Ke="48px",Ve="b",te=i.createContext(null);function j(){const e=i.useContext(te);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const re=i.forwardRef(({dataHook:e,trackingEl:r,trackingLabel:t,defaultOpen:o=!0,open:s,onOpenChange:n,className:d,style:c,children:f,...b},u)=>{const p=Le.useIsBelowBreakpoint("lg"),[x,S]=i.useState(!1),[g,O]=i.useState(null),[E,Oe]=i.useState(o),k=s??E,M=i.useCallback(h=>{const w=typeof h=="function"?h(k):h;n?n(w):Oe(w),document.cookie=`${Fe}=${w}; path=/; max-age=${Ge}`},[n,k]),C=i.useCallback(()=>p?S(h=>!h):M(h=>!h),[p,M,S]);i.useEffect(()=>{const h=w=>{w.key===Ve&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),C())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[C]);const G=k?"expanded":"collapsed",Ee=i.useMemo(()=>({state:G,open:k,setOpen:M,isMobile:p,openMobile:x,setOpenMobile:S,toggleSidebar:C,footerPortalEl:g,setFooterPortalEl:O}),[G,k,M,p,x,S,C,g]);return a.jsx(te.Provider,{value:Ee,children:a.jsx(I.TooltipProvider,{delayDuration:0,children:a.jsx("div",{ref:u,className:l.cn("group/sidebar-wrapper flex min-h-svh w-full",d),"data-hook":e,"data-slot":"sidebar-provider","data-tracking-el":r||"sidebar-provider","data-tracking-label":t,style:{"--sidebar-width":He,"--sidebar-width-icon":Ke,...c},...b,children:f})})})});re.displayName="SidebarProvider";const oe=i.forwardRef(({dataHook:e,trackingEl:r,trackingLabel:t,side:o="left",variant:s="sidebar",collapsible:n="offcanvas",embedded:d,mobileTitle:c,mobileDescription:f,className:b,children:u,...p},x)=>{const{isMobile:S,state:g,openMobile:O,setOpenMobile:E}=j();return n==="none"?a.jsx("div",{ref:x,className:l.cn("text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",b),"data-hook":e,"data-slot":"sidebar","data-tracking-el":r||"sidebar","data-tracking-label":t,...p,children:u}):S?a.jsx(R.Sheet,{open:O,onOpenChange:E,children:a.jsxs(R.SheetContent,{className:"bg-sidebar-background text-sidebar-foreground w-(--sidebar-width) p-6","data-hook":`${e}-mobile-content`,"data-mobile":"true","data-sidebar":"sidebar",side:"left",style:{"--sidebar-width":`min(${Ue}, calc(100vw - 40px))`},children:[a.jsx(R.SheetTitle,{className:"sr-only",children:c??"Navigation"}),a.jsx(R.SheetDescription,{className:"sr-only",children:f??"Main navigation menu"}),a.jsx("div",{className:"flex h-full w-full flex-col",children:u})]})}):a.jsx("div",{ref:x,className:l.cn("group text-sidebar-foreground flex h-full shrink-0 flex-col overflow-hidden transition-[width] duration-200 ease-linear",g==="expanded"&&"w-(--sidebar-width)",n==="icon"&&g==="collapsed"&&"w-(--sidebar-width-icon)",n==="offcanvas"&&g==="collapsed"&&"w-0",b),"data-collapsible":g==="collapsed"?n:"","data-hook":e,"data-side":o,"data-slot":"sidebar","data-state":g,"data-tracking-el":r||"sidebar","data-tracking-label":t,"data-variant":s,...p,children:u})});oe.displayName="Sidebar";const B=i.forwardRef(({className:e,onClick:r,dataHook:t="sidebar-trigger",toggleAriaLabel:o,children:s,...n},d)=>{const{toggleSidebar:c}=j(),f=o??"Toggle sidebar";return a.jsxs(U.Button,{ref:d,iconOnly:!0,"aria-label":f,className:l.cn("relative h-7 w-7",e),"data-slot":"sidebar-trigger",dataHook:t,size:"sm",variant:"ghost",onClick:b=>{r?.(b),c()},...n,children:[s||a.jsx(m.PanelLeft,{}),a.jsx("span",{className:"sr-only",children:f})]})});B.displayName="SidebarTrigger";const se=i.forwardRef(({className:e,toggleAriaLabel:r,...t},o)=>{const{toggleSidebar:s}=j(),n=r??"Toggle sidebar";return a.jsx("button",{ref:o,"aria-label":n,className:l.cn("hover:after:bg-sidebar-border absolute inset-y-0 -right-4 z-20 hidden w-4 -translate-x-1/2 transition-transform ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 sm:flex","cursor-w-resize","in-data-[state=collapsed]:cursor-e-resize","group-data-[collapsible=offcanvas]:hover:bg-sidebar-background group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","in-data-[collapsible=offcanvas]:-right-2",e),"data-slot":"sidebar-rail",tabIndex:-1,title:n,onClick:s,...t})});se.displayName="SidebarRail";const ne=i.forwardRef(({className:e,dataHook:r,trackingEl:t,trackingLabel:o,...s},n)=>a.jsx("main",{ref:n,className:l.cn("bg-background relative flex min-h-svh flex-1 flex-col",e),"data-hook":r,"data-slot":"sidebar-inset","data-tracking-el":t||"sidebar-inset","data-tracking-label":o,...s}));ne.displayName="SidebarInset";const ie=i.forwardRef(({className:e,...r},t)=>a.jsx(Te.Input,{ref:t,className:l.cn("bg-background h-8 w-full shadow-none",v,e),"data-slot":"sidebar-input",dataHook:"sidebar-input",...r}));ie.displayName="SidebarInput";const de=i.forwardRef(({className:e,dataHook:r,...t},o)=>a.jsx("header",{ref:o,className:l.cn("pr-section-xs flex shrink-0 flex-col gap-2 pt-2 pb-9 pl-8",e),"data-hook":r,"data-slot":"sidebar-header",...t}));de.displayName="SidebarHeader";const le=i.forwardRef(({className:e,dataHook:r,separator:t=!0,...o},s)=>{const{footerPortalEl:n}=j(),d=a.jsxs(a.Fragment,{children:[t&&a.jsx(z.Separator,{className:"group-data-[collapsible=icon]:mx-0","data-slot":"sidebar-footer-separator",spacing:"md"}),a.jsx("footer",{ref:s,className:l.cn("flex shrink-0 flex-col gap-1 p-1",e),"data-hook":r,"data-slot":"sidebar-footer",...o})]});return n?Pe.createPortal(d,n):d});le.displayName="SidebarFooter";const ce=i.forwardRef(({className:e,...r},t)=>a.jsx(z.Separator,{ref:t,className:l.cn("bg-sidebar-border mx-2 my-5 w-auto group-data-[collapsible=icon]:mx-0",e),"data-slot":"sidebar-separator",...r}));ce.displayName="SidebarSeparator";const ue=i.forwardRef(({className:e,dataHook:r,ariaLabel:t="Sidebar",children:o,...s},n)=>{const{isMobile:d,setFooterPortalEl:c}=j(),f=i.useCallback(b=>{const u=b?.querySelector('[data-slot="scroll-area-viewport"]');u&&(u.tabIndex=-1),typeof n=="function"?n(b):n&&(n.current=b)},[n]);return a.jsxs(Be.ScrollArea,{ref:f,className:l.cn("min-h-0 flex-1 group-data-[collapsible=icon]:overflow-hidden **:data-[slot=scroll-area-scrollbar]:w-1 **:data-[slot=scroll-area-scrollbar]:border-l-0 **:data-[slot=scroll-area-scrollbar]:p-0 [&_[data-slot=scroll-area-viewport]>div]:flex! [&_[data-slot=scroll-area-viewport]>div]:min-h-full [&_[data-slot=scroll-area-viewport]>div]:flex-col",e),dataHook:r??"sidebar-content-scroll",scrollOrientation:d?"both":"vertical",...s,children:[a.jsx("nav",{"aria-label":t,className:"flex flex-col gap-2","data-slot":"sidebar-content",children:o}),a.jsx("div",{ref:c,className:"mt-auto"})]})});ue.displayName="SidebarContent";const be=i.forwardRef(({className:e,dataHook:r,...t},o)=>a.jsx("div",{ref:o,className:l.cn("relative flex w-full min-w-0 flex-col py-2",e),"data-hook":r,"data-slot":"sidebar-group",...t}));be.displayName="SidebarGroup";const $e=T.cva(["flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 outline-none transition-[margin,opacity] duration-200 ease-linear [&>svg]:shrink-0 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",v],{variants:{size:{default:"text-sm",sm:"text-sm",xs:"text-xs"},variant:{default:"",collapsible:"w-full justify-between cursor-pointer hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",action:"w-full justify-between cursor-pointer hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"}},defaultVariants:{size:"sm",variant:"default"}}),pe=i.forwardRef(({className:e,dataHook:r,asChild:t=!1,size:o="sm",variant:s="default",isOpen:n=!1,onToggle:d,onAction:c,children:f,...b},u)=>{const p=t?y.Slot:"div",x=()=>{s==="collapsible"&&d?d():s==="action"&&c&&c()},S=g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),x())};return a.jsxs(p,{ref:u,className:l.cn($e({size:o,variant:s}),e),"data-hook":r,"data-slot":"sidebar-group-label","data-variant":s,role:s!=="default"?"button":void 0,tabIndex:s!=="default"?0:void 0,onClick:s!=="default"?x:void 0,onKeyDown:s!=="default"?S:void 0,...b,children:[a.jsx("span",{children:f}),s==="collapsible"&&a.jsx(m.ChevronDown,{className:l.cn("shrink-0 transition-transform duration-200",n&&"rotate-180"),size:16}),s==="action"&&a.jsx(m.Plus,{className:"shrink-0",size:16})]})});pe.displayName="SidebarGroupLabel";const fe=i.forwardRef(({className:e,asChild:r=!1,...t},o)=>{const s=r?y.Slot:"button";return a.jsx(s,{ref:o,className:l.cn("text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none [&>svg]:shrink-0",v,"after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),"data-slot":"sidebar-group-action",...t})});fe.displayName="SidebarGroupAction";const me=i.forwardRef(({className:e,dataHook:r,...t},o)=>a.jsx("div",{ref:o,className:l.cn("w-full text-sm",e),"data-hook":r,"data-slot":"sidebar-group-content",...t}));me.displayName="SidebarGroupContent";const xe=i.forwardRef(({className:e,dataHook:r,...t},o)=>a.jsx("ul",{ref:o,className:l.cn("flex w-full min-w-0 flex-col gap-1",e),"data-hook":r,"data-slot":"sidebar-menu",...t}));xe.displayName="SidebarMenu";const L=i.forwardRef(({className:e,dataHook:r,...t},o)=>a.jsx("li",{ref:o,className:l.cn("group/menu-item relative",e),"data-hook":r,"data-slot":"sidebar-menu-item",...t}));L.displayName="SidebarMenuItem";const ge=i.forwardRef(({type:e="caret",isActive:r=!1,className:t,...o},s)=>{const n={ref:s,className:l.cn("shrink-0 transition-transform",r&&e==="caret"&&"rotate-90",t),"data-slot":"sidebar-collapse-icon",...o};switch(e){case"horizontal":return a.jsx(m.ChevronRight,{...n});case"vertical":return a.jsx(m.ChevronDown,{...n});case"upDown":return a.jsx(m.ChevronsUpDown,{...n});case"plusMinus":return r?a.jsx(m.Minus,{...n}):a.jsx(m.Plus,{...n});case"dots":return a.jsx(m.Ellipsis,{...n});default:return a.jsx(m.ChevronRight,{...n})}});ge.displayName="SidebarCollapseIcon";const We=T.cva(["peer/menu-button flex w-full items-center gap-3 overflow-hidden rounded-full px-6 py-2 text-left text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow,opacity,width,height,padding] duration-150 ease-in-out hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-semibold data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:rounded-md [&>span:not([data-slot])]:truncate [&>svg]:shrink-0 [&>svg]:opacity-70 data-[active=true]:[&>svg]:opacity-100 group-data-[collapsible=icon]:[&>span]:hidden group-data-[collapsible=icon]:[&>div]:hidden",v],{variants:{variant:{simple:"",collapsible:"[&>[data-collapse-icon]]:ml-auto [&>[data-collapse-icon]]:transition-transform data-[state=open]:[&>[data-collapse-icon]]:rotate-90",dropdown:"group-has-[[data-slot=sidebar-menu-action]]/menu-item:pr-8",badge:"group-has-[[data-slot=sidebar-menu-badge]]/menu-item:pr-16",bigIcon:"h-auto flex-col items-start gap-1 rounded-lg p-3 [&>svg]:size-6 [&>svg]:rounded-md [&>svg]:bg-sidebar-foreground [&>svg]:p-1 [&>svg]:text-sidebar-background [&>svg]:opacity-100 hover:[&>svg]:bg-sidebar-foreground hover:[&>svg]:text-sidebar-background group-data-[collapsible=icon]:!size-10 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:[&>svg]:size-6",checkbox:"px-3 [&>[data-checkbox]]:size-4 [&>[data-checkbox]]:shrink-0 [&>[data-checkbox]]:rounded [&>[data-checkbox]]:border [&>[data-checkbox]]:border-sidebar-foreground/30 data-[checked=true]:[&>[data-checkbox]]:bg-primary data-[checked=true]:[&>[data-checkbox]]:border-primary data-[checked=true]:[&>[data-checkbox]]:text-primary-foreground"},size:{default:"h-12 text-sm/4",sm:"h-7 text-xs/4",lg:"h-12 text-sm/4 group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"simple",size:"default"}}),A=i.forwardRef(({asChild:e=!1,isActive:r=!1,variant:t="simple",size:o="default",tooltip:s,className:n,dataHook:d,...c},f)=>{const b=e?y.Slot:"button",{isMobile:u,state:p}=j(),x=a.jsx(b,{ref:f,className:l.cn(We({variant:t,size:o}),n),"data-active":r,"data-hook":d,"data-size":o,"data-slot":"sidebar-menu-button","data-variant":t,...c});return s?(typeof s=="string"&&(s={children:s,dataHook:"sidebar-menu-button-tooltip"}),a.jsxs(I.Tooltip,{children:[a.jsx(I.TooltipTrigger,{asChild:!0,children:x}),a.jsx(I.TooltipContent,{hideArrow:!0,...s,align:"center",className:l.cn("bg-foreground text-background border-none",s.className),hidden:p!=="collapsed"||u,side:"right",sideOffset:8})]})):x});A.displayName="SidebarMenuButton";const he=i.forwardRef(({className:e,asChild:r=!1,showOnHover:t=!1,...o},s)=>{const n=r?y.Slot:"button";return a.jsx(n,{ref:s,className:l.cn("text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none [&>svg]:shrink-0",v,"after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","peer-data-[size=bigIcon]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),"data-slot":"sidebar-menu-action",...o})});he.displayName="SidebarMenuAction";const ve=i.forwardRef(({className:e,...r},t)=>a.jsx("div",{ref:t,className:l.cn("text-sidebar-foreground pointer-events-none absolute inset-y-0 right-4 my-auto flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","group-data-[collapsible=icon]:hidden",e),"data-slot":"sidebar-menu-badge",...r}));ve.displayName="SidebarMenuBadge";const Se=i.forwardRef(({className:e,showIcon:r=!1,...t},o)=>{const s=i.useId(),n=i.useMemo(()=>{let d=0;for(let c=0;c<s.length;c++)d=(d<<5)-d+s.charCodeAt(c),d|=0;return`${Math.abs(d)%40+50}%`},[s]);return a.jsxs("div",{ref:o,className:l.cn("flex h-8 items-center gap-2 rounded-md px-2",e),"data-slot":"sidebar-menu-skeleton",...t,children:[r&&a.jsx(H.Skeleton,{className:"size-4 rounded-md","data-slot":"sidebar-menu-skeleton-icon"}),a.jsx(H.Skeleton,{className:"h-4 max-w-[--skeleton-width] flex-1","data-slot":"sidebar-menu-skeleton-text",style:{"--skeleton-width":n}})]})});Se.displayName="SidebarMenuSkeleton";const Xe=T.cva("flex min-w-0 flex-col items-start gap-1 py-1 group-data-[collapsible=icon]:hidden",{variants:{variant:{default:"px-10",border:"border-l border-sidebar-border ml-10 pl-1 pr-10",indent:"px-10"}},defaultVariants:{variant:"border"}}),q=i.forwardRef(({className:e,variant:r="border",dataHook:t,...o},s)=>a.jsx("ul",{ref:s,className:l.cn(Xe({variant:r}),e),"data-hook":t,"data-slot":"sidebar-menu-sub",...o}));q.displayName="SidebarMenuSub";const we=i.forwardRef(({dataHook:e,...r},t)=>a.jsx("li",{ref:t,"data-hook":e,"data-slot":"sidebar-menu-sub-item",...r}));we.displayName="SidebarMenuSubItem";const je=i.forwardRef(({asChild:e=!1,size:r="md",isActive:t,className:o,dataHook:s,...n},d)=>{const c=e?y.Slot:"a";return a.jsx(c,{ref:d,className:l.cn("text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-foreground flex h-7 min-w-0 items-center gap-2 overflow-hidden rounded-md px-2 transition-[color,background-color,box-shadow,opacity] duration-150 ease-in-out outline-none disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:not([data-slot])]:truncate [&>svg]:shrink-0",v,"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",r==="sm"&&"text-xs",r==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),"data-active":t,"data-hook":s,"data-size":r,"data-slot":"sidebar-menu-sub-button",...n})});je.displayName="SidebarMenuSubButton";function Ne({dataHook:e,className:r,children:t,defaultOpen:o,open:s,onOpenChange:n}){return a.jsx(L,{children:a.jsx(P.Accordion,{collapsible:!0,className:r,dataHook:e??"sidebar-menu-collapsible",defaultValue:o?"item":void 0,type:"single",value:s!==void 0?s?"item":"":void 0,onValueChange:n?d=>n(d==="item"):void 0,children:a.jsx(P.AccordionItem,{className:"group/collapsible border-none",value:"item",children:t})})})}Ne.displayName="SidebarMenuCollapsible";const ke=i.forwardRef(({children:e,className:r,...t},o)=>a.jsx(qe.Trigger,{asChild:!0,children:a.jsxs(A,{ref:o,className:r,variant:"collapsible",...t,children:[e,a.jsx(m.ChevronRight,{"data-collapse-icon":!0,className:"opacity-100! transition-transform duration-200 ease-out group-data-[collapsible=icon]:hidden",size:12})]})}));ke.displayName="SidebarMenuCollapsibleTrigger";const ye=i.forwardRef(({dataHook:e,children:r,...t},o)=>a.jsx(P.AccordionContent,{className:"p-0",children:a.jsx(q,{ref:o,dataHook:e,...t,children:r})}));ye.displayName="SidebarMenuCollapsibleContent";const Me=i.forwardRef(({className:e,dataHook:r="sidebar-drawer",trackingEl:t,trackingLabel:o,children:s,...n},d)=>a.jsx("div",{ref:d,className:e,"data-hook":r,"data-slot":"sidebar-drawer","data-tracking-el":t,"data-tracking-label":o,...n,children:a.jsx(B,{dataHook:`${r}-trigger`,children:a.jsx(m.Menu,{size:24})})}));Me.displayName="SidebarDrawer";const Ce=i.forwardRef(({className:e,dataHook:r="sidebar-header-button",children:t,...o},s)=>a.jsx(U.Button,{ref:s,...o,iconOnly:!0,className:l.cn("hover:bg-sidebar-accent hover:text-sidebar-accent-foreground size-7 rounded-md shadow-none",v,e),"data-slot":"sidebar-header-button",dataHook:r,size:"sm",variant:"ghost",children:t}));Ce.displayName="SidebarHeaderButton";const F=i.forwardRef(({className:e,dataHook:r="sidebar-popover-trigger",icon:t,triggerAriaLabel:o,children:s,...n},d)=>a.jsxs("button",{ref:d,"aria-label":o??"Switch workspace",className:l.cn("text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex items-center gap-2 rounded-md px-1.5 py-2 text-sm font-semibold transition-colors duration-200 ease-out outline-none",v,e),"data-hook":r,"data-slot":"sidebar-popover-trigger",type:"button",...n,children:[t&&a.jsx("span",{className:"bg-sidebar-primary text-sidebar-primary-foreground flex size-5 shrink-0 items-center justify-center rounded-md",children:t}),a.jsx("span",{className:"truncate",children:s}),a.jsx(m.ChevronDown,{className:"shrink-0 opacity-50",size:16})]}));F.displayName="SidebarPopoverTrigger";const D=i.forwardRef(({className:e,dataHook:r,icon:t,shortcut:o,children:s,...n},d)=>a.jsxs("button",{ref:d,className:l.cn("text-popover-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground flex h-10 w-full items-center gap-2 rounded-xs p-2 text-sm transition-colors duration-150 ease-in-out outline-none",v,e),"data-hook":r,"data-slot":"sidebar-popover-menu-item",type:"button",...n,children:[t&&a.jsx("span",{className:"border-border flex size-6 shrink-0 items-center justify-center rounded-xs border [&_svg]:size-4",children:t}),a.jsx("span",{className:"min-w-px flex-1 truncate text-left",children:s}),o&&a.jsx("span",{className:"text-popover-foreground/60 shrink-0 text-xs",children:o})]}));D.displayName="SidebarPopoverMenuItem";const Re=i.forwardRef(({className:e,dataHook:r="sidebar-popover-menu",groupTitle:t="Teams",items:o,addActionLabel:s,addActionIcon:n,onAddAction:d,children:c,...f},b)=>a.jsx("div",{ref:b,className:l.cn("flex flex-col",e),"data-hook":r,"data-slot":"sidebar-popover-menu",...f,children:c||a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-col items-start p-1",children:[t&&a.jsx("div",{className:"flex w-full items-center px-2 py-1.5",children:a.jsx("span",{className:"text-muted-foreground flex-1 text-xs font-medium",children:t})}),o?.map((u,p)=>a.jsx(D,{icon:u.icon,shortcut:u.shortcut,onClick:u.onClick,children:u.label},p))]}),d&&a.jsxs(a.Fragment,{children:[a.jsx(z.Separator,{}),a.jsx("div",{className:"flex flex-col items-start p-1",children:a.jsx(D,{icon:n||a.jsx(m.Plus,{size:16}),onClick:d,children:s??"Add team"})})]})]})}));Re.displayName="SidebarPopoverMenu";function Ie({dataHook:e="sidebar-switcher",icon:r,label:t,triggerAriaLabel:o,triggerClassName:s,children:n}){return a.jsxs(_.Popover,{children:[a.jsx(_.PopoverTrigger,{asChild:!0,children:a.jsx(F,{className:s,dataHook:`${e}-trigger`,icon:r,triggerAriaLabel:o,children:t})}),a.jsx(_.PopoverContent,{align:"start",className:"w-[316px] p-0",dataHook:`${e}-content`,side:"bottom",sideOffset:4,children:n})]})}Ie.displayName="SidebarSwitcher";function De({dataHook:e="sidebar-account-dropdown",name:r,email:t,avatar:o,menuGroups:s,triggerAriaLabel:n,align:d="end",side:c="top",children:f}){return a.jsxs(N.DropdownMenu,{children:[a.jsx(N.DropdownMenuTrigger,{asChild:!0,children:a.jsxs(A,{"aria-label":n??"Account menu",className:"h-auto py-1.5",dataHook:`${e}-button`,size:"lg",children:[o,a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5 leading-none",children:[a.jsx("span",{className:"truncate text-sm font-semibold",children:r}),a.jsx("span",{className:"truncate text-xs font-normal",children:t})]})]})}),a.jsx(N.DropdownMenuContent,{align:d,className:"w-56",dataHook:`${e}-content`,side:c,sideOffset:4,children:f||a.jsxs(a.Fragment,{children:[a.jsxs(N.DropdownMenuLabel,{className:"flex items-center gap-2 px-1 py-1.5",children:[o,a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5 leading-none",children:[a.jsx("span",{className:"truncate text-sm font-semibold",children:r}),a.jsx("span",{className:"truncate text-xs font-normal",children:t})]})]}),s?.map((b,u)=>a.jsxs(i.Fragment,{children:[a.jsx(N.DropdownMenuSeparator,{}),b.map((p,x)=>a.jsxs(N.DropdownMenuItem,{onClick:p.onClick,children:[p.icon,p.label]},x))]},u))]})})]})}De.displayName="SidebarAccountDropdown";const Ae=i.forwardRef(({className:e,dataHook:r,senderName:t,title:o,description:s,timestamp:n,...d},c)=>a.jsxs("button",{ref:c,className:l.cn("border-sidebar-border text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent flex w-full flex-col gap-2 border-b p-4 text-left transition-colors duration-150 ease-in-out outline-none",v,e),"data-hook":r,"data-slot":"sidebar-inbox-item",type:"button",...d,children:[a.jsxs("div",{className:"flex w-full items-center justify-between text-sm",children:[a.jsx("span",{children:t}),n&&a.jsx("span",{children:n})]}),a.jsx("p",{className:"w-full text-sm font-medium",children:o}),s&&a.jsx("p",{className:"w-full truncate text-xs",children:s})]}));Ae.displayName="SidebarInboxItem";exports.Sidebar=oe;exports.SidebarAccountDropdown=De;exports.SidebarCollapseIcon=ge;exports.SidebarCollapseIconType=ae;exports.SidebarCollapsible=W;exports.SidebarContent=ue;exports.SidebarDrawer=Me;exports.SidebarFooter=le;exports.SidebarGroup=be;exports.SidebarGroupAction=fe;exports.SidebarGroupContent=me;exports.SidebarGroupLabel=pe;exports.SidebarGroupLabelSize=X;exports.SidebarGroupLabelVariant=Y;exports.SidebarHeader=de;exports.SidebarHeaderButton=Ce;exports.SidebarInboxItem=Ae;exports.SidebarInput=ie;exports.SidebarInset=ne;exports.SidebarMenu=xe;exports.SidebarMenuAction=he;exports.SidebarMenuBadge=ve;exports.SidebarMenuButton=A;exports.SidebarMenuButtonSize=J;exports.SidebarMenuButtonVariant=Z;exports.SidebarMenuCollapsible=Ne;exports.SidebarMenuCollapsibleContent=ye;exports.SidebarMenuCollapsibleTrigger=ke;exports.SidebarMenuItem=L;exports.SidebarMenuSkeleton=Se;exports.SidebarMenuSub=q;exports.SidebarMenuSubButton=je;exports.SidebarMenuSubButtonSize=ee;exports.SidebarMenuSubItem=we;exports.SidebarMenuSubVariant=Q;exports.SidebarPopoverMenu=Re;exports.SidebarPopoverMenuItem=D;exports.SidebarPopoverTrigger=F;exports.SidebarProvider=re;exports.SidebarRail=se;exports.SidebarSeparator=ce;exports.SidebarSide=V;exports.SidebarSwitcher=Ie;exports.SidebarTrigger=B;exports.SidebarVariant=$;exports.useSidebar=j;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),_e=require("react"),Pe=require("react-dom"),y=require("@radix-ui/react-slot"),T=require("class-variance-authority"),m=require("@brightlocal/icons"),l=require("@brightlocal/ui-components/lib/utils"),U=require("../button.cjs"),Te=require("../input.cjs"),z=require("../separator.cjs"),N=require("../dropdown-menu.cjs"),_=require("../popover.cjs"),R=require("../sheet.cjs"),P=require("../accordion.cjs"),ze=require("@radix-ui/react-accordion"),Be=require("../scroll-area.cjs"),H=require("../skeleton.cjs"),I=require("../tooltip.cjs"),Le=require("../hooks/use-breakpoint.cjs");function K(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const i=K(_e),qe=K(ze),v="focus-visible:[box-shadow:0_0_0_1px_color-mix(in_srgb,var(--color-sidebar-ring)_50%,transparent),0_0_0_3px_rgba(0,0,0,0.1)]";var V=(e=>(e.LEFT="left",e))(V||{}),$=(e=>(e.SIDEBAR="sidebar",e))($||{}),W=(e=>(e.OFFCANVAS="offcanvas",e.ICON="icon",e.NONE="none",e))(W||{}),X=(e=>(e.DEFAULT="default",e.SM="sm",e.XS="xs",e))(X||{}),Y=(e=>(e.DEFAULT="default",e.COLLAPSIBLE="collapsible",e.ACTION="action",e))(Y||{}),Z=(e=>(e.SIMPLE="simple",e.COLLAPSIBLE="collapsible",e.DROPDOWN="dropdown",e.BADGE="badge",e.BIG_ICON="bigIcon",e.CHECKBOX="checkbox",e))(Z||{}),J=(e=>(e.DEFAULT="default",e.SM="sm",e.LG="lg",e))(J||{}),Q=(e=>(e.DEFAULT="default",e.BORDER="border",e.INDENT="indent",e))(Q||{}),ee=(e=>(e.SM="sm",e.MD="md",e))(ee||{}),ae=(e=>(e.CARET="caret",e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e.UP_DOWN="upDown",e.PLUS_MINUS="plusMinus",e.DOTS="dots",e))(ae||{});const Fe="sidebar:state",Ge=3600*24*7,He="232px",Ue="336px",Ke="48px",Ve="b",te=i.createContext(null);function j(){const e=i.useContext(te);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const re=i.forwardRef(({dataHook:e,trackingEl:r,trackingLabel:t,defaultOpen:o=!0,open:s,onOpenChange:n,className:d,style:c,children:f,...b},u)=>{const p=Le.useIsBelowBreakpoint("lg"),[x,S]=i.useState(!1),[g,O]=i.useState(null),[E,Oe]=i.useState(o),k=s??E,M=i.useCallback(h=>{const w=typeof h=="function"?h(k):h;n?n(w):Oe(w),document.cookie=`${Fe}=${w}; path=/; max-age=${Ge}`},[n,k]),C=i.useCallback(()=>p?S(h=>!h):M(h=>!h),[p,M,S]);i.useEffect(()=>{const h=w=>{w.key===Ve&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),C())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[C]);const G=k?"expanded":"collapsed",Ee=i.useMemo(()=>({state:G,open:k,setOpen:M,isMobile:p,openMobile:x,setOpenMobile:S,toggleSidebar:C,footerPortalEl:g,setFooterPortalEl:O}),[G,k,M,p,x,S,C,g]);return a.jsx(te.Provider,{value:Ee,children:a.jsx(I.TooltipProvider,{delayDuration:0,children:a.jsx("div",{ref:u,className:l.cn("group/sidebar-wrapper flex min-h-svh w-full",d),"data-hook":e,"data-slot":"sidebar-provider","data-tracking-el":r||"sidebar-provider","data-tracking-label":t,style:{"--sidebar-width":He,"--sidebar-width-icon":Ke,...c},...b,children:f})})})});re.displayName="SidebarProvider";const oe=i.forwardRef(({dataHook:e,trackingEl:r,trackingLabel:t,side:o="left",variant:s="sidebar",collapsible:n="offcanvas",embedded:d,mobileTitle:c,mobileDescription:f,className:b,children:u,...p},x)=>{const{isMobile:S,state:g,openMobile:O,setOpenMobile:E}=j();return n==="none"?a.jsx("div",{ref:x,className:l.cn("text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",b),"data-hook":e,"data-slot":"sidebar","data-tracking-el":r||"sidebar","data-tracking-label":t,...p,children:u}):S?a.jsx(R.Sheet,{open:O,onOpenChange:E,children:a.jsxs(R.SheetContent,{className:"bg-sidebar-background text-sidebar-foreground w-(--sidebar-width) p-6","data-hook":`${e}-mobile-content`,"data-mobile":"true","data-sidebar":"sidebar",side:"left",style:{"--sidebar-width":`min(${Ue}, calc(100vw - 40px))`},children:[a.jsx(R.SheetTitle,{className:"sr-only",children:c??"Navigation"}),a.jsx(R.SheetDescription,{className:"sr-only",children:f??"Main navigation menu"}),a.jsx("div",{className:"flex h-full w-full flex-col",children:u})]})}):a.jsx("div",{ref:x,className:l.cn("group text-sidebar-foreground duration-base flex h-full shrink-0 flex-col overflow-hidden transition-[width] ease-linear",g==="expanded"&&"w-(--sidebar-width)",n==="icon"&&g==="collapsed"&&"w-(--sidebar-width-icon)",n==="offcanvas"&&g==="collapsed"&&"w-0",b),"data-collapsible":g==="collapsed"?n:"","data-hook":e,"data-side":o,"data-slot":"sidebar","data-state":g,"data-tracking-el":r||"sidebar","data-tracking-label":t,"data-variant":s,...p,children:u})});oe.displayName="Sidebar";const B=i.forwardRef(({className:e,onClick:r,dataHook:t="sidebar-trigger",toggleAriaLabel:o,children:s,...n},d)=>{const{toggleSidebar:c}=j(),f=o??"Toggle sidebar";return a.jsxs(U.Button,{ref:d,iconOnly:!0,"aria-label":f,className:l.cn("relative h-7 w-7",e),"data-slot":"sidebar-trigger",dataHook:t,size:"sm",variant:"ghost",onClick:b=>{r?.(b),c()},...n,children:[s||a.jsx(m.PanelLeft,{}),a.jsx("span",{className:"sr-only",children:f})]})});B.displayName="SidebarTrigger";const se=i.forwardRef(({className:e,toggleAriaLabel:r,...t},o)=>{const{toggleSidebar:s}=j(),n=r??"Toggle sidebar";return a.jsx("button",{ref:o,"aria-label":n,className:l.cn("hover:after:bg-sidebar-border duration-base absolute inset-y-0 -right-4 z-20 hidden w-4 -translate-x-1/2 transition-transform ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 sm:flex","cursor-w-resize","in-data-[state=collapsed]:cursor-e-resize","group-data-[collapsible=offcanvas]:hover:bg-sidebar-background group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","in-data-[collapsible=offcanvas]:-right-2",e),"data-slot":"sidebar-rail",tabIndex:-1,title:n,onClick:s,...t})});se.displayName="SidebarRail";const ne=i.forwardRef(({className:e,dataHook:r,trackingEl:t,trackingLabel:o,...s},n)=>a.jsx("main",{ref:n,className:l.cn("bg-background relative flex min-h-svh flex-1 flex-col",e),"data-hook":r,"data-slot":"sidebar-inset","data-tracking-el":t||"sidebar-inset","data-tracking-label":o,...s}));ne.displayName="SidebarInset";const ie=i.forwardRef(({className:e,...r},t)=>a.jsx(Te.Input,{ref:t,className:l.cn("bg-background h-8 w-full shadow-none",v,e),"data-slot":"sidebar-input",dataHook:"sidebar-input",...r}));ie.displayName="SidebarInput";const de=i.forwardRef(({className:e,dataHook:r,...t},o)=>a.jsx("header",{ref:o,className:l.cn("pr-section-xs flex shrink-0 flex-col gap-2 pt-2 pb-9 pl-8",e),"data-hook":r,"data-slot":"sidebar-header",...t}));de.displayName="SidebarHeader";const le=i.forwardRef(({className:e,dataHook:r,separator:t=!0,...o},s)=>{const{footerPortalEl:n}=j(),d=a.jsxs(a.Fragment,{children:[t&&a.jsx(z.Separator,{className:"group-data-[collapsible=icon]:mx-0","data-slot":"sidebar-footer-separator",spacing:"md"}),a.jsx("footer",{ref:s,className:l.cn("flex shrink-0 flex-col gap-1 p-1",e),"data-hook":r,"data-slot":"sidebar-footer",...o})]});return n?Pe.createPortal(d,n):d});le.displayName="SidebarFooter";const ce=i.forwardRef(({className:e,...r},t)=>a.jsx(z.Separator,{ref:t,className:l.cn("bg-sidebar-border mx-2 my-5 w-auto group-data-[collapsible=icon]:mx-0",e),"data-slot":"sidebar-separator",...r}));ce.displayName="SidebarSeparator";const ue=i.forwardRef(({className:e,dataHook:r,ariaLabel:t="Sidebar",children:o,...s},n)=>{const{isMobile:d,setFooterPortalEl:c}=j(),f=i.useCallback(b=>{const u=b?.querySelector('[data-slot="scroll-area-viewport"]');u&&(u.tabIndex=-1),typeof n=="function"?n(b):n&&(n.current=b)},[n]);return a.jsxs(Be.ScrollArea,{ref:f,className:l.cn("min-h-0 flex-1 group-data-[collapsible=icon]:overflow-hidden **:data-[slot=scroll-area-scrollbar]:w-1 **:data-[slot=scroll-area-scrollbar]:border-l-0 **:data-[slot=scroll-area-scrollbar]:p-0 [&_[data-slot=scroll-area-viewport]>div]:flex! [&_[data-slot=scroll-area-viewport]>div]:min-h-full [&_[data-slot=scroll-area-viewport]>div]:flex-col",e),dataHook:r??"sidebar-content-scroll",scrollOrientation:d?"both":"vertical",...s,children:[a.jsx("nav",{"aria-label":t,className:"flex flex-col gap-2","data-slot":"sidebar-content",children:o}),a.jsx("div",{ref:c,className:"mt-auto"})]})});ue.displayName="SidebarContent";const be=i.forwardRef(({className:e,dataHook:r,...t},o)=>a.jsx("div",{ref:o,className:l.cn("relative flex w-full min-w-0 flex-col py-2",e),"data-hook":r,"data-slot":"sidebar-group",...t}));be.displayName="SidebarGroup";const $e=T.cva(["flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 outline-none transition-[margin,opacity] duration-base ease-linear [&>svg]:shrink-0 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",v],{variants:{size:{default:"text-sm",sm:"text-sm",xs:"text-xs"},variant:{default:"",collapsible:"w-full justify-between cursor-pointer hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",action:"w-full justify-between cursor-pointer hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"}},defaultVariants:{size:"sm",variant:"default"}}),pe=i.forwardRef(({className:e,dataHook:r,asChild:t=!1,size:o="sm",variant:s="default",isOpen:n=!1,onToggle:d,onAction:c,children:f,...b},u)=>{const p=t?y.Slot:"div",x=()=>{s==="collapsible"&&d?d():s==="action"&&c&&c()},S=g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),x())};return a.jsxs(p,{ref:u,className:l.cn($e({size:o,variant:s}),e),"data-hook":r,"data-slot":"sidebar-group-label","data-variant":s,role:s!=="default"?"button":void 0,tabIndex:s!=="default"?0:void 0,onClick:s!=="default"?x:void 0,onKeyDown:s!=="default"?S:void 0,...b,children:[a.jsx("span",{children:f}),s==="collapsible"&&a.jsx(m.ChevronDown,{className:l.cn("duration-base shrink-0 transition-transform ease-in-out",n&&"rotate-180"),size:16}),s==="action"&&a.jsx(m.Plus,{className:"shrink-0",size:16})]})});pe.displayName="SidebarGroupLabel";const fe=i.forwardRef(({className:e,asChild:r=!1,...t},o)=>{const s=r?y.Slot:"button";return a.jsx(s,{ref:o,className:l.cn("text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground duration-base absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform ease-in-out outline-none [&>svg]:shrink-0",v,"after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),"data-slot":"sidebar-group-action",...t})});fe.displayName="SidebarGroupAction";const me=i.forwardRef(({className:e,dataHook:r,...t},o)=>a.jsx("div",{ref:o,className:l.cn("w-full text-sm",e),"data-hook":r,"data-slot":"sidebar-group-content",...t}));me.displayName="SidebarGroupContent";const xe=i.forwardRef(({className:e,dataHook:r,...t},o)=>a.jsx("ul",{ref:o,className:l.cn("flex w-full min-w-0 flex-col gap-1",e),"data-hook":r,"data-slot":"sidebar-menu",...t}));xe.displayName="SidebarMenu";const L=i.forwardRef(({className:e,dataHook:r,...t},o)=>a.jsx("li",{ref:o,className:l.cn("group/menu-item relative",e),"data-hook":r,"data-slot":"sidebar-menu-item",...t}));L.displayName="SidebarMenuItem";const ge=i.forwardRef(({type:e="caret",isActive:r=!1,className:t,...o},s)=>{const n={ref:s,className:l.cn("shrink-0 transition-transform duration-base ease-in-out",r&&e==="caret"&&"rotate-90",t),"data-slot":"sidebar-collapse-icon",...o};switch(e){case"horizontal":return a.jsx(m.ChevronRight,{...n});case"vertical":return a.jsx(m.ChevronDown,{...n});case"upDown":return a.jsx(m.ChevronsUpDown,{...n});case"plusMinus":return r?a.jsx(m.Minus,{...n}):a.jsx(m.Plus,{...n});case"dots":return a.jsx(m.Ellipsis,{...n});default:return a.jsx(m.ChevronRight,{...n})}});ge.displayName="SidebarCollapseIcon";const We=T.cva(["peer/menu-button flex w-full items-center gap-3 overflow-hidden rounded-full px-6 py-2 text-left text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow,opacity,width,height,padding] duration-base ease-in-out hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-semibold data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:rounded-md [&>span:not([data-slot])]:truncate [&>svg]:shrink-0 [&>svg]:opacity-70 data-[active=true]:[&>svg]:opacity-100 group-data-[collapsible=icon]:[&>span]:hidden group-data-[collapsible=icon]:[&>div]:hidden",v],{variants:{variant:{simple:"",collapsible:"[&>[data-collapse-icon]]:ml-auto [&>[data-collapse-icon]]:transition-transform [&>[data-collapse-icon]]:duration-base [&>[data-collapse-icon]]:ease-in-out data-[state=open]:[&>[data-collapse-icon]]:rotate-90",dropdown:"group-has-[[data-slot=sidebar-menu-action]]/menu-item:pr-8",badge:"group-has-[[data-slot=sidebar-menu-badge]]/menu-item:pr-16",bigIcon:"h-auto flex-col items-start gap-1 rounded-lg p-3 [&>svg]:size-6 [&>svg]:rounded-md [&>svg]:bg-sidebar-foreground [&>svg]:p-1 [&>svg]:text-sidebar-background [&>svg]:opacity-100 hover:[&>svg]:bg-sidebar-foreground hover:[&>svg]:text-sidebar-background group-data-[collapsible=icon]:!size-10 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:[&>svg]:size-6",checkbox:"px-3 [&>[data-checkbox]]:size-4 [&>[data-checkbox]]:shrink-0 [&>[data-checkbox]]:rounded [&>[data-checkbox]]:border [&>[data-checkbox]]:border-sidebar-foreground/30 data-[checked=true]:[&>[data-checkbox]]:bg-primary data-[checked=true]:[&>[data-checkbox]]:border-primary data-[checked=true]:[&>[data-checkbox]]:text-primary-foreground"},size:{default:"h-12 text-sm/4",sm:"h-7 text-xs/4",lg:"h-12 text-sm/4 group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"simple",size:"default"}}),A=i.forwardRef(({asChild:e=!1,isActive:r=!1,variant:t="simple",size:o="default",tooltip:s,className:n,dataHook:d,...c},f)=>{const b=e?y.Slot:"button",{isMobile:u,state:p}=j(),x=a.jsx(b,{ref:f,className:l.cn(We({variant:t,size:o}),n),"data-active":r,"data-hook":d,"data-size":o,"data-slot":"sidebar-menu-button","data-variant":t,...c});return s?(typeof s=="string"&&(s={children:s,dataHook:"sidebar-menu-button-tooltip"}),a.jsxs(I.Tooltip,{children:[a.jsx(I.TooltipTrigger,{asChild:!0,children:x}),a.jsx(I.TooltipContent,{hideArrow:!0,...s,align:"center",className:l.cn("bg-foreground text-background border-none",s.className),hidden:p!=="collapsed"||u,side:"right",sideOffset:8})]})):x});A.displayName="SidebarMenuButton";const he=i.forwardRef(({className:e,asChild:r=!1,showOnHover:t=!1,...o},s)=>{const n=r?y.Slot:"button";return a.jsx(n,{ref:s,className:l.cn("text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground duration-base absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform ease-in-out outline-none [&>svg]:shrink-0",v,"after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","peer-data-[size=bigIcon]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),"data-slot":"sidebar-menu-action",...o})});he.displayName="SidebarMenuAction";const ve=i.forwardRef(({className:e,...r},t)=>a.jsx("div",{ref:t,className:l.cn("text-sidebar-foreground pointer-events-none absolute inset-y-0 right-4 my-auto flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","group-data-[collapsible=icon]:hidden",e),"data-slot":"sidebar-menu-badge",...r}));ve.displayName="SidebarMenuBadge";const Se=i.forwardRef(({className:e,showIcon:r=!1,...t},o)=>{const s=i.useId(),n=i.useMemo(()=>{let d=0;for(let c=0;c<s.length;c++)d=(d<<5)-d+s.charCodeAt(c),d|=0;return`${Math.abs(d)%40+50}%`},[s]);return a.jsxs("div",{ref:o,className:l.cn("flex h-8 items-center gap-2 rounded-md px-2",e),"data-slot":"sidebar-menu-skeleton",...t,children:[r&&a.jsx(H.Skeleton,{className:"size-4 rounded-md","data-slot":"sidebar-menu-skeleton-icon"}),a.jsx(H.Skeleton,{className:"h-4 max-w-[--skeleton-width] flex-1","data-slot":"sidebar-menu-skeleton-text",style:{"--skeleton-width":n}})]})});Se.displayName="SidebarMenuSkeleton";const Xe=T.cva("flex min-w-0 flex-col items-start gap-1 py-1 group-data-[collapsible=icon]:hidden",{variants:{variant:{default:"px-10",border:"border-l border-sidebar-border ml-10 pl-1 pr-10",indent:"px-10"}},defaultVariants:{variant:"border"}}),q=i.forwardRef(({className:e,variant:r="border",dataHook:t,...o},s)=>a.jsx("ul",{ref:s,className:l.cn(Xe({variant:r}),e),"data-hook":t,"data-slot":"sidebar-menu-sub",...o}));q.displayName="SidebarMenuSub";const we=i.forwardRef(({dataHook:e,...r},t)=>a.jsx("li",{ref:t,"data-hook":e,"data-slot":"sidebar-menu-sub-item",...r}));we.displayName="SidebarMenuSubItem";const je=i.forwardRef(({asChild:e=!1,size:r="md",isActive:t,className:o,dataHook:s,...n},d)=>{const c=e?y.Slot:"a";return a.jsx(c,{ref:d,className:l.cn("text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-foreground duration-fast flex h-7 min-w-0 items-center gap-2 overflow-hidden rounded-md px-2 transition-[color,background-color,box-shadow,opacity] ease-out outline-none disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:not([data-slot])]:truncate [&>svg]:shrink-0",v,"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",r==="sm"&&"text-xs",r==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),"data-active":t,"data-hook":s,"data-size":r,"data-slot":"sidebar-menu-sub-button",...n})});je.displayName="SidebarMenuSubButton";function Ne({dataHook:e,className:r,children:t,defaultOpen:o,open:s,onOpenChange:n}){return a.jsx(L,{children:a.jsx(P.Accordion,{collapsible:!0,className:r,dataHook:e??"sidebar-menu-collapsible",defaultValue:o?"item":void 0,type:"single",value:s!==void 0?s?"item":"":void 0,onValueChange:n?d=>n(d==="item"):void 0,children:a.jsx(P.AccordionItem,{className:"group/collapsible border-none",value:"item",children:t})})})}Ne.displayName="SidebarMenuCollapsible";const ke=i.forwardRef(({children:e,className:r,...t},o)=>a.jsx(qe.Trigger,{asChild:!0,children:a.jsxs(A,{ref:o,className:r,variant:"collapsible",...t,children:[e,a.jsx(m.ChevronRight,{"data-collapse-icon":!0,className:"duration-base opacity-100! transition-transform ease-in-out group-data-[collapsible=icon]:hidden",size:12})]})}));ke.displayName="SidebarMenuCollapsibleTrigger";const ye=i.forwardRef(({dataHook:e,children:r,...t},o)=>a.jsx(P.AccordionContent,{className:"p-0",children:a.jsx(q,{ref:o,dataHook:e,...t,children:r})}));ye.displayName="SidebarMenuCollapsibleContent";const Me=i.forwardRef(({className:e,dataHook:r="sidebar-drawer",trackingEl:t,trackingLabel:o,children:s,...n},d)=>a.jsx("div",{ref:d,className:e,"data-hook":r,"data-slot":"sidebar-drawer","data-tracking-el":t,"data-tracking-label":o,...n,children:a.jsx(B,{dataHook:`${r}-trigger`,children:a.jsx(m.Menu,{size:24})})}));Me.displayName="SidebarDrawer";const Ce=i.forwardRef(({className:e,dataHook:r="sidebar-header-button",children:t,...o},s)=>a.jsx(U.Button,{ref:s,...o,iconOnly:!0,className:l.cn("hover:bg-sidebar-accent hover:text-sidebar-accent-foreground size-7 rounded-md shadow-none",v,e),"data-slot":"sidebar-header-button",dataHook:r,size:"sm",variant:"ghost",children:t}));Ce.displayName="SidebarHeaderButton";const F=i.forwardRef(({className:e,dataHook:r="sidebar-popover-trigger",icon:t,triggerAriaLabel:o,children:s,...n},d)=>a.jsxs("button",{ref:d,"aria-label":o??"Switch workspace",className:l.cn("text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground duration-fast flex items-center gap-2 rounded-md px-1.5 py-2 text-sm font-semibold transition-colors ease-out outline-none",v,e),"data-hook":r,"data-slot":"sidebar-popover-trigger",type:"button",...n,children:[t&&a.jsx("span",{className:"bg-sidebar-primary text-sidebar-primary-foreground flex size-5 shrink-0 items-center justify-center rounded-md",children:t}),a.jsx("span",{className:"truncate",children:s}),a.jsx(m.ChevronDown,{className:"shrink-0 opacity-50",size:16})]}));F.displayName="SidebarPopoverTrigger";const D=i.forwardRef(({className:e,dataHook:r,icon:t,shortcut:o,children:s,...n},d)=>a.jsxs("button",{ref:d,className:l.cn("text-popover-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground duration-fast flex h-10 w-full items-center gap-2 rounded-xs p-2 text-sm transition-colors ease-out outline-none",v,e),"data-hook":r,"data-slot":"sidebar-popover-menu-item",type:"button",...n,children:[t&&a.jsx("span",{className:"border-border flex size-6 shrink-0 items-center justify-center rounded-xs border [&_svg]:size-4",children:t}),a.jsx("span",{className:"min-w-px flex-1 truncate text-left",children:s}),o&&a.jsx("span",{className:"text-popover-foreground/60 shrink-0 text-xs",children:o})]}));D.displayName="SidebarPopoverMenuItem";const Re=i.forwardRef(({className:e,dataHook:r="sidebar-popover-menu",groupTitle:t="Teams",items:o,addActionLabel:s,addActionIcon:n,onAddAction:d,children:c,...f},b)=>a.jsx("div",{ref:b,className:l.cn("flex flex-col",e),"data-hook":r,"data-slot":"sidebar-popover-menu",...f,children:c||a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-col items-start p-1",children:[t&&a.jsx("div",{className:"flex w-full items-center px-2 py-1.5",children:a.jsx("span",{className:"text-muted-foreground flex-1 text-xs font-medium",children:t})}),o?.map((u,p)=>a.jsx(D,{icon:u.icon,shortcut:u.shortcut,onClick:u.onClick,children:u.label},p))]}),d&&a.jsxs(a.Fragment,{children:[a.jsx(z.Separator,{}),a.jsx("div",{className:"flex flex-col items-start p-1",children:a.jsx(D,{icon:n||a.jsx(m.Plus,{size:16}),onClick:d,children:s??"Add team"})})]})]})}));Re.displayName="SidebarPopoverMenu";function Ie({dataHook:e="sidebar-switcher",icon:r,label:t,triggerAriaLabel:o,triggerClassName:s,children:n}){return a.jsxs(_.Popover,{children:[a.jsx(_.PopoverTrigger,{asChild:!0,children:a.jsx(F,{className:s,dataHook:`${e}-trigger`,icon:r,triggerAriaLabel:o,children:t})}),a.jsx(_.PopoverContent,{align:"start",className:"w-[316px] p-0",dataHook:`${e}-content`,side:"bottom",sideOffset:4,children:n})]})}Ie.displayName="SidebarSwitcher";function De({dataHook:e="sidebar-account-dropdown",name:r,email:t,avatar:o,menuGroups:s,triggerAriaLabel:n,align:d="end",side:c="top",children:f}){return a.jsxs(N.DropdownMenu,{children:[a.jsx(N.DropdownMenuTrigger,{asChild:!0,children:a.jsxs(A,{"aria-label":n??"Account menu",className:"h-auto py-1.5",dataHook:`${e}-button`,size:"lg",children:[o,a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5 leading-none",children:[a.jsx("span",{className:"truncate text-sm font-semibold",children:r}),a.jsx("span",{className:"truncate text-xs font-normal",children:t})]})]})}),a.jsx(N.DropdownMenuContent,{align:d,className:"w-56",dataHook:`${e}-content`,side:c,sideOffset:4,children:f||a.jsxs(a.Fragment,{children:[a.jsxs(N.DropdownMenuLabel,{className:"flex items-center gap-2 px-1 py-1.5",children:[o,a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5 leading-none",children:[a.jsx("span",{className:"truncate text-sm font-semibold",children:r}),a.jsx("span",{className:"truncate text-xs font-normal",children:t})]})]}),s?.map((b,u)=>a.jsxs(i.Fragment,{children:[a.jsx(N.DropdownMenuSeparator,{}),b.map((p,x)=>a.jsxs(N.DropdownMenuItem,{onClick:p.onClick,children:[p.icon,p.label]},x))]},u))]})})]})}De.displayName="SidebarAccountDropdown";const Ae=i.forwardRef(({className:e,dataHook:r,senderName:t,title:o,description:s,timestamp:n,...d},c)=>a.jsxs("button",{ref:c,className:l.cn("border-sidebar-border text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent duration-fast flex w-full flex-col gap-2 border-b p-4 text-left transition-colors ease-out outline-none",v,e),"data-hook":r,"data-slot":"sidebar-inbox-item",type:"button",...d,children:[a.jsxs("div",{className:"flex w-full items-center justify-between text-sm",children:[a.jsx("span",{children:t}),n&&a.jsx("span",{children:n})]}),a.jsx("p",{className:"w-full text-sm font-medium",children:o}),s&&a.jsx("p",{className:"w-full truncate text-xs",children:s})]}));Ae.displayName="SidebarInboxItem";exports.Sidebar=oe;exports.SidebarAccountDropdown=De;exports.SidebarCollapseIcon=ge;exports.SidebarCollapseIconType=ae;exports.SidebarCollapsible=W;exports.SidebarContent=ue;exports.SidebarDrawer=Me;exports.SidebarFooter=le;exports.SidebarGroup=be;exports.SidebarGroupAction=fe;exports.SidebarGroupContent=me;exports.SidebarGroupLabel=pe;exports.SidebarGroupLabelSize=X;exports.SidebarGroupLabelVariant=Y;exports.SidebarHeader=de;exports.SidebarHeaderButton=Ce;exports.SidebarInboxItem=Ae;exports.SidebarInput=ie;exports.SidebarInset=ne;exports.SidebarMenu=xe;exports.SidebarMenuAction=he;exports.SidebarMenuBadge=ve;exports.SidebarMenuButton=A;exports.SidebarMenuButtonSize=J;exports.SidebarMenuButtonVariant=Z;exports.SidebarMenuCollapsible=Ne;exports.SidebarMenuCollapsibleContent=ye;exports.SidebarMenuCollapsibleTrigger=ke;exports.SidebarMenuItem=L;exports.SidebarMenuSkeleton=Se;exports.SidebarMenuSub=q;exports.SidebarMenuSubButton=je;exports.SidebarMenuSubButtonSize=ee;exports.SidebarMenuSubItem=we;exports.SidebarMenuSubVariant=Q;exports.SidebarPopoverMenu=Re;exports.SidebarPopoverMenuItem=D;exports.SidebarPopoverTrigger=F;exports.SidebarProvider=re;exports.SidebarRail=se;exports.SidebarSeparator=ce;exports.SidebarSide=V;exports.SidebarSwitcher=Ie;exports.SidebarTrigger=B;exports.SidebarVariant=$;exports.useSidebar=j;
|
package/dist/blocks/sidebar.js
CHANGED
|
@@ -153,7 +153,7 @@ const He = i.forwardRef(
|
|
|
153
153
|
{
|
|
154
154
|
ref: h,
|
|
155
155
|
className: l(
|
|
156
|
-
"group text-sidebar-foreground flex h-full shrink-0 flex-col overflow-hidden transition-[width]
|
|
156
|
+
"group text-sidebar-foreground duration-base flex h-full shrink-0 flex-col overflow-hidden transition-[width] ease-linear",
|
|
157
157
|
g === "expanded" && "w-(--sidebar-width)",
|
|
158
158
|
n === "icon" && g === "collapsed" && "w-(--sidebar-width-icon)",
|
|
159
159
|
n === "offcanvas" && g === "collapsed" && "w-0",
|
|
@@ -217,7 +217,7 @@ const $e = i.forwardRef(
|
|
|
217
217
|
ref: o,
|
|
218
218
|
"aria-label": n,
|
|
219
219
|
className: l(
|
|
220
|
-
"hover:after:bg-sidebar-border absolute inset-y-0 -right-4 z-20 hidden w-4 -translate-x-1/2 transition-transform ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 sm:flex",
|
|
220
|
+
"hover:after:bg-sidebar-border duration-base absolute inset-y-0 -right-4 z-20 hidden w-4 -translate-x-1/2 transition-transform ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 sm:flex",
|
|
221
221
|
"cursor-w-resize",
|
|
222
222
|
"in-data-[state=collapsed]:cursor-e-resize",
|
|
223
223
|
"group-data-[collapsible=offcanvas]:hover:bg-sidebar-background group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
|
|
@@ -376,7 +376,7 @@ const Xe = i.forwardRef(
|
|
|
376
376
|
Xe.displayName = "SidebarGroup";
|
|
377
377
|
const Ve = O(
|
|
378
378
|
[
|
|
379
|
-
"flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 outline-none transition-[margin,opacity] duration-
|
|
379
|
+
"flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 outline-none transition-[margin,opacity] duration-base ease-linear [&>svg]:shrink-0 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
380
380
|
v
|
|
381
381
|
],
|
|
382
382
|
{
|
|
@@ -434,7 +434,7 @@ const Ve = O(
|
|
|
434
434
|
P,
|
|
435
435
|
{
|
|
436
436
|
className: l(
|
|
437
|
-
"shrink-0 transition-transform
|
|
437
|
+
"duration-base shrink-0 transition-transform ease-in-out",
|
|
438
438
|
n && "rotate-180"
|
|
439
439
|
),
|
|
440
440
|
size: 16
|
|
@@ -452,7 +452,7 @@ const Ze = i.forwardRef(({ className: e, asChild: t = !1, ...r }, o) => /* @__PU
|
|
|
452
452
|
{
|
|
453
453
|
ref: o,
|
|
454
454
|
className: l(
|
|
455
|
-
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none [&>svg]:shrink-0",
|
|
455
|
+
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground duration-base absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform ease-in-out outline-none [&>svg]:shrink-0",
|
|
456
456
|
v,
|
|
457
457
|
// Increases the hit area of the button on mobile.
|
|
458
458
|
"after:absolute after:-inset-2 after:md:hidden",
|
|
@@ -511,7 +511,7 @@ const ea = i.forwardRef(
|
|
|
511
511
|
const n = {
|
|
512
512
|
ref: s,
|
|
513
513
|
className: l(
|
|
514
|
-
"shrink-0 transition-transform",
|
|
514
|
+
"shrink-0 transition-transform duration-base ease-in-out",
|
|
515
515
|
t && e === "caret" && "rotate-90",
|
|
516
516
|
r
|
|
517
517
|
),
|
|
@@ -537,7 +537,7 @@ const ea = i.forwardRef(
|
|
|
537
537
|
ea.displayName = "SidebarCollapseIcon";
|
|
538
538
|
const aa = O(
|
|
539
539
|
[
|
|
540
|
-
"peer/menu-button flex w-full items-center gap-3 overflow-hidden rounded-full px-6 py-2 text-left text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow,opacity,width,height,padding] duration-
|
|
540
|
+
"peer/menu-button flex w-full items-center gap-3 overflow-hidden rounded-full px-6 py-2 text-left text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow,opacity,width,height,padding] duration-base ease-in-out hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-semibold data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:rounded-md [&>span:not([data-slot])]:truncate [&>svg]:shrink-0 [&>svg]:opacity-70 data-[active=true]:[&>svg]:opacity-100 group-data-[collapsible=icon]:[&>span]:hidden group-data-[collapsible=icon]:[&>div]:hidden",
|
|
541
541
|
v
|
|
542
542
|
],
|
|
543
543
|
{
|
|
@@ -546,7 +546,7 @@ const aa = O(
|
|
|
546
546
|
// Simple - basic menu item with icon and text
|
|
547
547
|
simple: "",
|
|
548
548
|
// Collapsible - has a chevron indicator that rotates when open
|
|
549
|
-
collapsible: "[&>[data-collapse-icon]]:ml-auto [&>[data-collapse-icon]]:transition-transform data-[state=open]:[&>[data-collapse-icon]]:rotate-90",
|
|
549
|
+
collapsible: "[&>[data-collapse-icon]]:ml-auto [&>[data-collapse-icon]]:transition-transform [&>[data-collapse-icon]]:duration-base [&>[data-collapse-icon]]:ease-in-out data-[state=open]:[&>[data-collapse-icon]]:rotate-90",
|
|
550
550
|
// Dropdown - has action menu (dots) on hover
|
|
551
551
|
dropdown: "group-has-[[data-slot=sidebar-menu-action]]/menu-item:pr-8",
|
|
552
552
|
// Badge - has a number badge on the right (handled via SidebarMenuBadge)
|
|
@@ -620,7 +620,7 @@ const ta = i.forwardRef(({ className: e, asChild: t = !1, showOnHover: r = !1, .
|
|
|
620
620
|
{
|
|
621
621
|
ref: s,
|
|
622
622
|
className: l(
|
|
623
|
-
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none [&>svg]:shrink-0",
|
|
623
|
+
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground duration-base absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform ease-in-out outline-none [&>svg]:shrink-0",
|
|
624
624
|
v,
|
|
625
625
|
// Increases the hit area of the button on mobile.
|
|
626
626
|
"after:absolute after:-inset-2 after:md:hidden",
|
|
@@ -739,7 +739,7 @@ const ia = i.forwardRef(
|
|
|
739
739
|
{
|
|
740
740
|
ref: d,
|
|
741
741
|
className: l(
|
|
742
|
-
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-foreground flex h-7 min-w-0 items-center gap-2 overflow-hidden rounded-md px-2 transition-[color,background-color,box-shadow,opacity]
|
|
742
|
+
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-foreground duration-fast flex h-7 min-w-0 items-center gap-2 overflow-hidden rounded-md px-2 transition-[color,background-color,box-shadow,opacity] ease-out outline-none disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:not([data-slot])]:truncate [&>svg]:shrink-0",
|
|
743
743
|
v,
|
|
744
744
|
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
745
745
|
t === "sm" && "text-xs",
|
|
@@ -792,7 +792,7 @@ const la = i.forwardRef(({ children: e, className: t, ...r }, o) => /* @__PURE__
|
|
|
792
792
|
E,
|
|
793
793
|
{
|
|
794
794
|
"data-collapse-icon": !0,
|
|
795
|
-
className: "opacity-100! transition-transform
|
|
795
|
+
className: "duration-base opacity-100! transition-transform ease-in-out group-data-[collapsible=icon]:hidden",
|
|
796
796
|
size: 12
|
|
797
797
|
}
|
|
798
798
|
)
|
|
@@ -861,7 +861,7 @@ const U = i.forwardRef(
|
|
|
861
861
|
ref: d,
|
|
862
862
|
"aria-label": o ?? "Switch workspace",
|
|
863
863
|
className: l(
|
|
864
|
-
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex items-center gap-2 rounded-md px-1.5 py-2 text-sm font-semibold transition-colors
|
|
864
|
+
"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground duration-fast flex items-center gap-2 rounded-md px-1.5 py-2 text-sm font-semibold transition-colors ease-out outline-none",
|
|
865
865
|
v,
|
|
866
866
|
e
|
|
867
867
|
),
|
|
@@ -883,7 +883,7 @@ const A = i.forwardRef(({ className: e, dataHook: t, icon: r, shortcut: o, child
|
|
|
883
883
|
{
|
|
884
884
|
ref: d,
|
|
885
885
|
className: l(
|
|
886
|
-
"text-popover-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground flex h-10 w-full items-center gap-2 rounded-xs p-2 text-sm transition-colors
|
|
886
|
+
"text-popover-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground duration-fast flex h-10 w-full items-center gap-2 rounded-xs p-2 text-sm transition-colors ease-out outline-none",
|
|
887
887
|
v,
|
|
888
888
|
e
|
|
889
889
|
),
|
|
@@ -1052,7 +1052,7 @@ const ha = i.forwardRef(
|
|
|
1052
1052
|
{
|
|
1053
1053
|
ref: u,
|
|
1054
1054
|
className: l(
|
|
1055
|
-
"border-sidebar-border text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent flex w-full flex-col gap-2 border-b p-4 text-left transition-colors
|
|
1055
|
+
"border-sidebar-border text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:bg-sidebar-accent duration-fast flex w-full flex-col gap-2 border-b p-4 text-left transition-colors ease-out outline-none",
|
|
1056
1056
|
v,
|
|
1057
1057
|
e
|
|
1058
1058
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("react"),p=require("class-variance-authority"),s=require("@brightlocal/icons"),l=require("@brightlocal/ui-components/lib/utils");function j(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return i.default=e,Object.freeze(i)}const y=j(g),M={sparkle:s.MotifSparkle,starburst:s.MotifStarburst,circle:s.MotifCircle,sunrise:s.MotifSunrise},x=p.cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"size-6 text-primary",md:"size-12 text-primary",lg:"size-80 text-muted"}},defaultVariants:{size:"lg"}}),o=y.forwardRef(({className:e,motif:i,size:t="lg",dataHook:a,trackingEl:c,trackingLabel:u,children:n,...d},f)=>{const m=M[i],b=i==="sunrise"&&t==="lg";return r.jsxs("div",{ref:f,className:l.cn(x({size:t}),e),"data-hook":a,"data-motif":i,"data-size":t,"data-slot":"brand-illustration-motif","data-tracking-el":c??"brand-illustration-motif","data-tracking-label":u,...d,children:[r.jsx("div",{"aria-hidden":"true",className:l.cn("absolute inset-0",b&&"animate-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),g=require("react"),p=require("class-variance-authority"),s=require("@brightlocal/icons"),l=require("@brightlocal/ui-components/lib/utils");function j(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return i.default=e,Object.freeze(i)}const y=j(g),M={sparkle:s.MotifSparkle,starburst:s.MotifStarburst,circle:s.MotifCircle,sunrise:s.MotifSunrise},x=p.cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"size-6 text-primary",md:"size-12 text-primary",lg:"size-80 text-muted"}},defaultVariants:{size:"lg"}}),o=y.forwardRef(({className:e,motif:i,size:t="lg",dataHook:a,trackingEl:c,trackingLabel:u,children:n,...d},f)=>{const m=M[i],b=i==="sunrise"&&t==="lg";return r.jsxs("div",{ref:f,className:l.cn(x({size:t}),e),"data-hook":a,"data-motif":i,"data-size":t,"data-slot":"brand-illustration-motif","data-tracking-el":c??"brand-illustration-motif","data-tracking-label":u,...d,children:[r.jsx("div",{"aria-hidden":"true",className:l.cn("absolute inset-0",b&&"animate-ambient-spin"),children:r.jsx(m,{className:"size-full",size:"100%"})}),t==="lg"&&n?r.jsx("div",{className:"relative flex size-36 items-center justify-center",children:n}):null]})});o.displayName="BrandIllustrationMotif";exports.BrandIllustrationMotif=o;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as u, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import * as p from "react";
|
|
3
|
-
import { cva as
|
|
4
|
-
import { MotifSunrise as
|
|
3
|
+
import { cva as b } from "class-variance-authority";
|
|
4
|
+
import { MotifSunrise as g, MotifCircle as x, MotifStarburst as M, MotifSparkle as v } from "@brightlocal/icons";
|
|
5
5
|
import { cn as r } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
const y = {
|
|
7
7
|
sparkle: v,
|
|
8
|
-
starburst:
|
|
9
|
-
circle:
|
|
10
|
-
sunrise:
|
|
11
|
-
}, z =
|
|
8
|
+
starburst: M,
|
|
9
|
+
circle: x,
|
|
10
|
+
sunrise: g
|
|
11
|
+
}, z = b(
|
|
12
12
|
"relative inline-flex items-center justify-center",
|
|
13
13
|
{
|
|
14
14
|
variants: {
|
|
@@ -27,8 +27,8 @@ const y = {
|
|
|
27
27
|
className: s,
|
|
28
28
|
motif: i,
|
|
29
29
|
size: t = "lg",
|
|
30
|
-
dataHook:
|
|
31
|
-
trackingEl:
|
|
30
|
+
dataHook: n,
|
|
31
|
+
trackingEl: l,
|
|
32
32
|
trackingLabel: o,
|
|
33
33
|
children: e,
|
|
34
34
|
...m
|
|
@@ -39,11 +39,11 @@ const y = {
|
|
|
39
39
|
{
|
|
40
40
|
ref: c,
|
|
41
41
|
className: r(z({ size: t }), s),
|
|
42
|
-
"data-hook":
|
|
42
|
+
"data-hook": n,
|
|
43
43
|
"data-motif": i,
|
|
44
44
|
"data-size": t,
|
|
45
45
|
"data-slot": "brand-illustration-motif",
|
|
46
|
-
"data-tracking-el":
|
|
46
|
+
"data-tracking-el": l ?? "brand-illustration-motif",
|
|
47
47
|
"data-tracking-label": o,
|
|
48
48
|
...m,
|
|
49
49
|
children: [
|
|
@@ -51,7 +51,7 @@ const y = {
|
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
53
53
|
"aria-hidden": "true",
|
|
54
|
-
className: r("absolute inset-0", d && "animate-
|
|
54
|
+
className: r("absolute inset-0", d && "animate-ambient-spin"),
|
|
55
55
|
children: /* @__PURE__ */ a(f, { className: "size-full", size: "100%" })
|
|
56
56
|
}
|
|
57
57
|
),
|
package/dist/breadcrumb.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),g=require("react"),x=require("@radix-ui/react-slot"),d=require("@brightlocal/icons"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),g=require("react"),x=require("@radix-ui/react-slot"),d=require("@brightlocal/icons"),c=require("@brightlocal/ui-components/lib/utils");function j(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,t.get?t:{enumerable:!0,get:()=>e[r]})}}return a.default=e,Object.freeze(a)}const o=j(g),i=o.forwardRef(({dataHook:e,trackingEl:a,trackingLabel:r,ariaLabel:t,...n},B)=>s.jsx("nav",{ref:B,"aria-label":t??"Breadcrumb","data-hook":e,"data-slot":"breadcrumb","data-tracking-el":a,"data-tracking-label":r,...n}));i.displayName="Breadcrumb";const l=o.forwardRef(({className:e,...a},r)=>s.jsx("ol",{ref:r,className:c.cn("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),"data-slot":"breadcrumb-list",...a}));l.displayName="BreadcrumbList";const u=o.forwardRef(({className:e,...a},r)=>s.jsx("li",{ref:r,className:c.cn("inline-flex items-center gap-1.5",e),"data-slot":"breadcrumb-item",...a}));u.displayName="BreadcrumbItem";const m=o.forwardRef(({asChild:e,className:a,...r},t)=>{const n=e?x.Slot:"a";return s.jsx(n,{ref:t,className:c.cn("hover:text-foreground focus-visible:shadow-default duration-fast rounded-sm transition-colors ease-out outline-none",a),"data-slot":"breadcrumb-link",...r})});m.displayName="BreadcrumbLink";const b=o.forwardRef(({className:e,...a},r)=>s.jsx("span",{ref:r,"aria-current":"page","aria-disabled":"true",className:c.cn("text-foreground font-normal",e),"data-slot":"breadcrumb-page",role:"link",...a}));b.displayName="BreadcrumbPage";const f=o.forwardRef(({children:e,className:a,...r},t)=>s.jsx("li",{ref:t,"aria-hidden":"true",className:a,"data-slot":"breadcrumb-separator",role:"presentation",...r,children:e??s.jsx(d.ChevronRight,{size:14})}));f.displayName="BreadcrumbSeparator";const p=o.forwardRef(({className:e,srLabel:a="More",...r},t)=>s.jsxs("span",{ref:t,"aria-hidden":"true",className:c.cn("relative flex size-9 items-center justify-center",e),"data-slot":"breadcrumb-ellipsis",role:"presentation",...r,children:[s.jsx(d.MoreHorizontal,{}),s.jsx("span",{className:"sr-only",children:a})]}));p.displayName="BreadcrumbEllipsis";exports.Breadcrumb=i;exports.BreadcrumbEllipsis=p;exports.BreadcrumbItem=u;exports.BreadcrumbLink=m;exports.BreadcrumbList=l;exports.BreadcrumbPage=b;exports.BreadcrumbSeparator=f;
|
package/dist/breadcrumb.js
CHANGED
|
@@ -47,7 +47,7 @@ const B = s.forwardRef(
|
|
|
47
47
|
{
|
|
48
48
|
ref: o,
|
|
49
49
|
className: d(
|
|
50
|
-
"hover:text-foreground focus-visible:shadow-default rounded-sm transition-colors outline-none",
|
|
50
|
+
"hover:text-foreground focus-visible:shadow-default duration-fast rounded-sm transition-colors ease-out outline-none",
|
|
51
51
|
a
|
|
52
52
|
),
|
|
53
53
|
"data-slot": "breadcrumb-link",
|
package/dist/button.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),O=require("react"),_=require("@radix-ui/react-slot"),z=require("class-variance-authority"),q=require("@brightlocal/icons"),x=require("@brightlocal/ui-components/lib/utils");function B(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 c=B(O),P=16,b=z.cva(["rounded-full","inline-flex","font-semibold","items-center","justify-center","gap-2","whitespace-nowrap","transition-[color,background-color,border-color,box-shadow,opacity]","duration-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),O=require("react"),_=require("@radix-ui/react-slot"),z=require("class-variance-authority"),q=require("@brightlocal/icons"),x=require("@brightlocal/ui-components/lib/utils");function B(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 c=B(O),P=16,b=z.cva(["rounded-full","inline-flex","font-semibold","items-center","justify-center","gap-2","whitespace-nowrap","transition-[color,background-color,border-color,box-shadow,opacity]","duration-fast","ease-out","cursor-pointer","disabled:pointer-events-none","disabled:cursor-not-allowed","disabled:opacity-50","aria-disabled:opacity-50","[&_svg]:pointer-events-none","[&_svg]:shrink-0","shrink-0","outline-none","aria-invalid:ring-destructive/20","dark:aria-invalid:ring-destructive/40","aria-invalid:border-destructive"],{variants:{variant:{primary:["bg-primary","dark:bg-green-400","text-primary-foreground","dark:text-[var(--ds-colors-primary-foreground-light)]","hover:bg-primary/90","focus-visible:shadow-default"],secondary:["bg-secondary","text-secondary-foreground","hover:bg-secondary/80","focus-visible:shadow-default"],warning:["bg-warning-background","hover:bg-warning-background/80","text-warning-foreground","focus-visible:shadow-default"],destructive:["bg-destructive","dark:bg-red-400/90","hover:bg-destructive/80","dark:hover:bg-red-400/90","text-destructive-foreground","dark:text-red-950","focus-visible:shadow-destructive"],outline:["border","border-border","border-solid","bg-background","hover:bg-accent","hover:text-accent-foreground","dark:bg-input/30","dark:border-input","dark:hover:bg-input/80","dark:hover:border-input","focus-visible:shadow-default","focus-visible:border-ring"],ghost:["bg-transparent","text-foreground","hover:bg-accent","data-[state=open]:bg-accent","focus-visible:shadow-default"]},size:{default:"px-4 py-2 h-9 text-sm",sm:"py-2 px-3 h-8 text-xs",lg:"py-2 px-8 h-10 text-sm [&_svg:not([class*='size-'])]:size-5"},state:{default:"",loading:"pointer-events-none",disabled:"pointer-events-none opacity-50"},fullWidth:{false:"",true:"w-full"}},defaultVariants:{variant:"primary",size:"default",state:"default",fullWidth:!1}}),k=c.forwardRef(({className:e,variant:t="primary",size:a="default",fullWidth:o=!1,asChild:l=!1,dataHook:f,trackingEl:g,trackingLabel:v,iconOnly:w=!1,loading:n=!1,ariaLabel:j,disabled:p=!1,children:r,...u},y)=>{const h=l?_.Slot:"button",m=p||n;let i=w;!i&&c.Children.count(r)===1&&c.isValidElement(r)&&(i=r.props?.children==null);const S=n&&!l;let s="default";n?s="loading":p&&(s="disabled");const N=j??(n?typeof r=="string"||typeof r=="number"?`Loading: ${r}`:"Loading":void 0);return l?d.jsx(h,{ref:y,className:x.cn(b({variant:t,size:a,state:s,fullWidth:o}),i&&"size-9 p-0",e),"data-hook":f,"data-slot":"button","data-tracking-el":g||`button-${t}`,"data-tracking-label":v,...u,children:r}):d.jsxs(h,{ref:y,"aria-busy":n?"true":void 0,"aria-disabled":m?"true":void 0,"aria-label":N,className:x.cn(b({variant:t,size:a,state:s,fullWidth:o}),i&&"size-9 p-0",e),"data-hook":f,"data-slot":"button","data-tracking-el":g||`button-${t}`,"data-tracking-label":v,disabled:m,type:u.type??"button",...u,children:[S&&d.jsx("div",{className:"pointer-events-none flex items-center justify-center","data-slot":"button-loading-icon",children:d.jsx(q.Loader2,{className:"animate-spin",size:P})}),r]})});k.displayName="Button";exports.Button=k;exports.ButtonVariants=b;
|