@gv-tech/ui-web 2.15.2 → 2.17.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 +1 -1
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.mjs +3 -3
- package/dist/alert-dialog.cjs +2 -2
- package/dist/alert-dialog.mjs +16 -16
- package/dist/alert.cjs +1 -1
- package/dist/alert.mjs +1 -1
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.mjs +34 -34
- package/dist/badge.cjs +1 -1
- package/dist/badge.mjs +1 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.mjs +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.mjs +1 -1
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.mjs +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.mjs +1 -1
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.mjs +1 -1
- package/dist/chart.cjs +1 -1
- package/dist/chart.mjs +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.mjs +2 -2
- package/dist/command.cjs +1 -1
- package/dist/command.mjs +114 -114
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.mjs +68 -68
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.mjs +21 -21
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.mjs +16 -16
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.mjs +43 -43
- package/dist/form.cjs +1 -1
- package/dist/form.mjs +1 -1
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +52 -0
- package/dist/index.mjs +101 -95
- package/dist/input.cjs +1 -1
- package/dist/input.mjs +1 -1
- package/dist/label.cjs +1 -1
- package/dist/label.mjs +2 -2
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.mjs +77 -77
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.mjs +57 -57
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.mjs +1 -1
- package/dist/popover.cjs +1 -1
- package/dist/popover.mjs +62 -62
- package/dist/progress.cjs +2 -2
- package/dist/progress.mjs +2 -2
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.mjs +36 -36
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.mjs +1 -1
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.mjs +88 -88
- package/dist/scroll-to-top.cjs +1 -0
- package/dist/scroll-to-top.d.ts +12 -0
- package/dist/scroll-to-top.mjs +86 -0
- package/dist/search.cjs +1 -1
- package/dist/search.mjs +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.mjs +74 -74
- package/dist/separator.cjs +1 -1
- package/dist/separator.mjs +9 -9
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.mjs +12 -12
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.mjs +1 -1
- package/dist/slider.cjs +1 -1
- package/dist/slider.mjs +2 -2
- package/dist/support-fab.cjs +1 -0
- package/dist/support-fab.d.ts +20 -0
- package/dist/support-fab.mjs +120 -0
- package/dist/switch.cjs +1 -1
- package/dist/switch.mjs +12 -12
- package/dist/table-of-contents.cjs +1 -0
- package/dist/table-of-contents.d.ts +35 -0
- package/dist/table-of-contents.mjs +160 -0
- package/dist/table.cjs +1 -1
- package/dist/table.mjs +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.mjs +41 -41
- package/dist/text.cjs +1 -1
- package/dist/text.mjs +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.mjs +1 -1
- package/dist/{theme-toggle-B4VZTDpe.js → theme-toggle-DXQGNfCe.js} +1 -1
- package/dist/{theme-toggle-WtPW9UZi.mjs → theme-toggle-tHXIbr8W.mjs} +1 -1
- package/dist/theme-toggle.cjs +1 -1
- package/dist/theme-toggle.mjs +2 -2
- package/dist/toast.cjs +1 -1
- package/dist/toast.mjs +35 -35
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.mjs +15 -15
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.mjs +4 -4
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.mjs +3 -3
- package/dist/utils-DY6fhrgS.mjs +12 -0
- package/dist/utils-cdbZV8DZ.js +1 -0
- package/package.json +1 -1
- package/src/accordion.tsx +2 -2
- package/src/alert-dialog.tsx +6 -6
- package/src/avatar.tsx +3 -3
- package/src/checkbox.tsx +1 -1
- package/src/command.tsx +7 -7
- package/src/context-menu.tsx +8 -8
- package/src/dialog.tsx +4 -4
- package/src/drawer.tsx +3 -3
- package/src/dropdown-menu.tsx +8 -8
- package/src/hover-card.tsx +1 -1
- package/src/index.ts +12 -1
- package/src/label.tsx +1 -1
- package/src/lib/utils.ts +10 -0
- package/src/menubar.tsx +10 -10
- package/src/navigation-menu.tsx +6 -6
- package/src/popover.tsx +1 -1
- package/src/progress.tsx +1 -1
- package/src/radio-group.tsx +2 -2
- package/src/scroll-area.tsx +2 -2
- package/src/scroll-to-top.tsx +134 -0
- package/src/select.tsx +7 -7
- package/src/separator.tsx +1 -1
- package/src/setupTests.ts +1 -1
- package/src/sheet.tsx +4 -4
- package/src/slider.tsx +1 -1
- package/src/support-fab.tsx +190 -0
- package/src/switch.tsx +1 -1
- package/src/table-of-contents.tsx +285 -0
- package/src/tabs.tsx +3 -3
- package/src/toast.tsx +6 -6
- package/src/toggle-group.tsx +2 -2
- package/src/toggle.tsx +1 -1
- package/src/tooltip.tsx +2 -2
- package/dist/utils-B6yFEsav.mjs +0 -8
- package/dist/utils-IjLH3w2e.js +0 -1
package/dist/tabs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-nZSsnGb7.js"),F=require("react"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-nZSsnGb7.js"),F=require("react"),b=require("./index-BtZvtDmp.js"),D=require("./index-D2HnlO3y.js"),m=require("./index-DIsg7zU7.js"),k=require("./index-B2XtpfGY.js"),G=require("./index-Dko2XdTk.js"),L=require("./index-Ce5TOFAK.js"),O=require("./index-CefEQe_4.js"),x=require("./utils-cdbZV8DZ.js");function V(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const d=V(F);var p="Tabs",[H]=D.createContextScope(p,[m.createRovingFocusGroupScope]),j=m.createRovingFocusGroupScope(),[K,T]=H(p),R=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:i,defaultValue:u,orientation:a="horizontal",dir:l,activationMode:v="automatic",...g}=e,r=G.useDirection(l),[s,f]=L.useControllableState({prop:o,onChange:i,defaultProp:u??"",caller:p});return c.jsxRuntimeExports.jsx(K,{scope:n,baseId:O.useId(),value:s,onValueChange:f,orientation:a,dir:r,activationMode:v,children:c.jsxRuntimeExports.jsx(b.Primitive.div,{dir:r,"data-orientation":a,...g,ref:t})})});R.displayName=p;var y="TabsList",E=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...i}=e,u=T(y,n),a=j(n);return c.jsxRuntimeExports.jsx(m.Root,{asChild:!0,...a,orientation:u.orientation,dir:u.dir,loop:o,children:c.jsxRuntimeExports.jsx(b.Primitive.div,{role:"tablist","aria-orientation":u.orientation,...i,ref:t})})});E.displayName=y;var C="TabsTrigger",N=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:i=!1,...u}=e,a=T(C,n),l=j(n),v=P(a.baseId,o),g=_(a.baseId,o),r=o===a.value;return c.jsxRuntimeExports.jsx(m.Item,{asChild:!0,...l,focusable:!i,active:r,children:c.jsxRuntimeExports.jsx(b.Primitive.button,{type:"button",role:"tab","aria-selected":r,"aria-controls":g,"data-state":r?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:v,...u,ref:t,onMouseDown:b.composeEventHandlers(e.onMouseDown,s=>{!i&&s.button===0&&s.ctrlKey===!1?a.onValueChange(o):s.preventDefault()}),onKeyDown:b.composeEventHandlers(e.onKeyDown,s=>{[" ","Enter"].includes(s.key)&&a.onValueChange(o)}),onFocus:b.composeEventHandlers(e.onFocus,()=>{const s=a.activationMode!=="manual";!r&&!i&&s&&a.onValueChange(o)})})})});N.displayName=C;var h="TabsContent",I=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:i,children:u,...a}=e,l=T(h,n),v=P(l.baseId,o),g=_(l.baseId,o),r=o===l.value,s=d.useRef(r);return d.useEffect(()=>{const f=requestAnimationFrame(()=>s.current=!1);return()=>cancelAnimationFrame(f)},[]),c.jsxRuntimeExports.jsx(k.Presence,{present:i||r,children:({present:f})=>c.jsxRuntimeExports.jsx(b.Primitive.div,{"data-state":r?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":v,hidden:!f,id:g,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:s.current?"0s":void 0},children:f&&u})})});I.displayName=h;function P(e,t){return`${e}-trigger-${t}`}function _(e,t){return`${e}-content-${t}`}var z=R,w=E,S=N,$=I;const B=z,A=d.forwardRef(({className:e,...t},n)=>c.jsxRuntimeExports.jsx(w,{ref:n,className:x.cn("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...t}));A.displayName=w?.displayName||"TabsList";const M=d.forwardRef(({className:e,...t},n)=>c.jsxRuntimeExports.jsx(S,{ref:n,className:x.cn("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow",e),...t}));M.displayName=S?.displayName||"TabsTrigger";const q=d.forwardRef(({className:e,...t},n)=>c.jsxRuntimeExports.jsx($,{ref:n,className:x.cn("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t}));q.displayName=$?.displayName||"TabsContent";exports.Tabs=B;exports.TabsContent=q;exports.TabsList=A;exports.TabsTrigger=M;
|
package/dist/tabs.mjs
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as c } from "./jsx-runtime-tc70JA_2.mjs";
|
|
3
3
|
import * as l from "react";
|
|
4
|
-
import { P as
|
|
4
|
+
import { P as v, c as p } from "./index-K9FzbxYw.mjs";
|
|
5
5
|
import { c as F } from "./index-IZ2gq03c.mjs";
|
|
6
6
|
import { R as $, I as D, c as y } from "./index-Bv7qrYW6.mjs";
|
|
7
7
|
import { P as V } from "./index-vuPgkS0V.mjs";
|
|
8
8
|
import { u as k } from "./index-CD6_IrA-.mjs";
|
|
9
9
|
import { u as G } from "./index-p6xVFRb4.mjs";
|
|
10
10
|
import { u as L } from "./index-DnFcfnA9.mjs";
|
|
11
|
-
import { c as T } from "./utils-
|
|
12
|
-
var
|
|
11
|
+
import { c as T } from "./utils-DY6fhrgS.mjs";
|
|
12
|
+
var g = "Tabs", [K] = F(g, [
|
|
13
13
|
y
|
|
14
|
-
]), h = y(), [B, x] = K(
|
|
14
|
+
]), h = y(), [B, x] = K(g), C = l.forwardRef(
|
|
15
15
|
(e, t) => {
|
|
16
16
|
const {
|
|
17
17
|
__scopeTabs: a,
|
|
18
18
|
value: o,
|
|
19
|
-
onValueChange:
|
|
19
|
+
onValueChange: r,
|
|
20
20
|
defaultValue: d,
|
|
21
21
|
orientation: n = "horizontal",
|
|
22
22
|
dir: u,
|
|
23
23
|
activationMode: m = "automatic",
|
|
24
|
-
...
|
|
25
|
-
} = e, i = k(u), [
|
|
24
|
+
...b
|
|
25
|
+
} = e, i = k(u), [s, f] = G({
|
|
26
26
|
prop: o,
|
|
27
|
-
onChange:
|
|
27
|
+
onChange: r,
|
|
28
28
|
defaultProp: d ?? "",
|
|
29
|
-
caller:
|
|
29
|
+
caller: g
|
|
30
30
|
});
|
|
31
31
|
return /* @__PURE__ */ c.jsx(
|
|
32
32
|
B,
|
|
33
33
|
{
|
|
34
34
|
scope: a,
|
|
35
35
|
baseId: L(),
|
|
36
|
-
value:
|
|
36
|
+
value: s,
|
|
37
37
|
onValueChange: f,
|
|
38
38
|
orientation: n,
|
|
39
39
|
dir: i,
|
|
40
40
|
activationMode: m,
|
|
41
41
|
children: /* @__PURE__ */ c.jsx(
|
|
42
|
-
|
|
42
|
+
v.div,
|
|
43
43
|
{
|
|
44
44
|
dir: i,
|
|
45
45
|
"data-orientation": n,
|
|
46
|
-
...
|
|
46
|
+
...b,
|
|
47
47
|
ref: t
|
|
48
48
|
}
|
|
49
49
|
)
|
|
@@ -51,10 +51,10 @@ var p = "Tabs", [K] = F(p, [
|
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
|
-
|
|
55
|
-
var
|
|
54
|
+
C.displayName = g;
|
|
55
|
+
var N = "TabsList", R = l.forwardRef(
|
|
56
56
|
(e, t) => {
|
|
57
|
-
const { __scopeTabs: a, loop: o = !0, ...
|
|
57
|
+
const { __scopeTabs: a, loop: o = !0, ...r } = e, d = x(N, a), n = h(a);
|
|
58
58
|
return /* @__PURE__ */ c.jsx(
|
|
59
59
|
$,
|
|
60
60
|
{
|
|
@@ -64,11 +64,11 @@ var C = "TabsList", R = l.forwardRef(
|
|
|
64
64
|
dir: d.dir,
|
|
65
65
|
loop: o,
|
|
66
66
|
children: /* @__PURE__ */ c.jsx(
|
|
67
|
-
|
|
67
|
+
v.div,
|
|
68
68
|
{
|
|
69
69
|
role: "tablist",
|
|
70
70
|
"aria-orientation": d.orientation,
|
|
71
|
-
...
|
|
71
|
+
...r,
|
|
72
72
|
ref: t
|
|
73
73
|
}
|
|
74
74
|
)
|
|
@@ -76,39 +76,39 @@ var C = "TabsList", R = l.forwardRef(
|
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
|
-
R.displayName =
|
|
79
|
+
R.displayName = N;
|
|
80
80
|
var I = "TabsTrigger", j = l.forwardRef(
|
|
81
81
|
(e, t) => {
|
|
82
|
-
const { __scopeTabs: a, value: o, disabled:
|
|
82
|
+
const { __scopeTabs: a, value: o, disabled: r = !1, ...d } = e, n = x(I, a), u = h(a), m = A(n.baseId, o), b = P(n.baseId, o), i = o === n.value;
|
|
83
83
|
return /* @__PURE__ */ c.jsx(
|
|
84
84
|
D,
|
|
85
85
|
{
|
|
86
86
|
asChild: !0,
|
|
87
87
|
...u,
|
|
88
|
-
focusable: !
|
|
88
|
+
focusable: !r,
|
|
89
89
|
active: i,
|
|
90
90
|
children: /* @__PURE__ */ c.jsx(
|
|
91
|
-
|
|
91
|
+
v.button,
|
|
92
92
|
{
|
|
93
93
|
type: "button",
|
|
94
94
|
role: "tab",
|
|
95
95
|
"aria-selected": i,
|
|
96
|
-
"aria-controls":
|
|
96
|
+
"aria-controls": b,
|
|
97
97
|
"data-state": i ? "active" : "inactive",
|
|
98
|
-
"data-disabled":
|
|
99
|
-
disabled:
|
|
98
|
+
"data-disabled": r ? "" : void 0,
|
|
99
|
+
disabled: r,
|
|
100
100
|
id: m,
|
|
101
101
|
...d,
|
|
102
102
|
ref: t,
|
|
103
|
-
onMouseDown:
|
|
104
|
-
!
|
|
103
|
+
onMouseDown: p(e.onMouseDown, (s) => {
|
|
104
|
+
!r && s.button === 0 && s.ctrlKey === !1 ? n.onValueChange(o) : s.preventDefault();
|
|
105
105
|
}),
|
|
106
|
-
onKeyDown:
|
|
107
|
-
[" ", "Enter"].includes(
|
|
106
|
+
onKeyDown: p(e.onKeyDown, (s) => {
|
|
107
|
+
[" ", "Enter"].includes(s.key) && n.onValueChange(o);
|
|
108
108
|
}),
|
|
109
|
-
onFocus:
|
|
110
|
-
const
|
|
111
|
-
!i && !
|
|
109
|
+
onFocus: p(e.onFocus, () => {
|
|
110
|
+
const s = n.activationMode !== "manual";
|
|
111
|
+
!i && !r && s && n.onValueChange(o);
|
|
112
112
|
})
|
|
113
113
|
}
|
|
114
114
|
)
|
|
@@ -119,25 +119,25 @@ var I = "TabsTrigger", j = l.forwardRef(
|
|
|
119
119
|
j.displayName = I;
|
|
120
120
|
var w = "TabsContent", _ = l.forwardRef(
|
|
121
121
|
(e, t) => {
|
|
122
|
-
const { __scopeTabs: a, value: o, forceMount:
|
|
122
|
+
const { __scopeTabs: a, value: o, forceMount: r, children: d, ...n } = e, u = x(w, a), m = A(u.baseId, o), b = P(u.baseId, o), i = o === u.value, s = l.useRef(i);
|
|
123
123
|
return l.useEffect(() => {
|
|
124
|
-
const f = requestAnimationFrame(() =>
|
|
124
|
+
const f = requestAnimationFrame(() => s.current = !1);
|
|
125
125
|
return () => cancelAnimationFrame(f);
|
|
126
|
-
}, []), /* @__PURE__ */ c.jsx(V, { present:
|
|
127
|
-
|
|
126
|
+
}, []), /* @__PURE__ */ c.jsx(V, { present: r || i, children: ({ present: f }) => /* @__PURE__ */ c.jsx(
|
|
127
|
+
v.div,
|
|
128
128
|
{
|
|
129
129
|
"data-state": i ? "active" : "inactive",
|
|
130
130
|
"data-orientation": u.orientation,
|
|
131
131
|
role: "tabpanel",
|
|
132
132
|
"aria-labelledby": m,
|
|
133
133
|
hidden: !f,
|
|
134
|
-
id:
|
|
134
|
+
id: b,
|
|
135
135
|
tabIndex: 0,
|
|
136
136
|
...n,
|
|
137
137
|
ref: t,
|
|
138
138
|
style: {
|
|
139
139
|
...e.style,
|
|
140
|
-
animationDuration:
|
|
140
|
+
animationDuration: s.current ? "0s" : void 0
|
|
141
141
|
},
|
|
142
142
|
children: f && d
|
|
143
143
|
}
|
|
@@ -151,7 +151,7 @@ function A(e, t) {
|
|
|
151
151
|
function P(e, t) {
|
|
152
152
|
return `${e}-content-${t}`;
|
|
153
153
|
}
|
|
154
|
-
var q =
|
|
154
|
+
var q = C, E = R, M = j, S = _;
|
|
155
155
|
const ae = q, z = l.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ c.jsx(
|
|
156
156
|
E,
|
|
157
157
|
{
|
|
@@ -163,7 +163,7 @@ const ae = q, z = l.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ c.
|
|
|
163
163
|
...t
|
|
164
164
|
}
|
|
165
165
|
));
|
|
166
|
-
z.displayName = E
|
|
166
|
+
z.displayName = E?.displayName || "TabsList";
|
|
167
167
|
const H = l.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ c.jsx(
|
|
168
168
|
M,
|
|
169
169
|
{
|
|
@@ -175,7 +175,7 @@ const H = l.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ c.jsx(
|
|
|
175
175
|
...t
|
|
176
176
|
}
|
|
177
177
|
));
|
|
178
|
-
H.displayName = M
|
|
178
|
+
H.displayName = M?.displayName || "TabsTrigger";
|
|
179
179
|
const O = l.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ c.jsx(
|
|
180
180
|
S,
|
|
181
181
|
{
|
|
@@ -187,7 +187,7 @@ const O = l.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ c.jsx(
|
|
|
187
187
|
...t
|
|
188
188
|
}
|
|
189
189
|
));
|
|
190
|
-
O.displayName = S
|
|
190
|
+
O.displayName = S?.displayName || "TabsContent";
|
|
191
191
|
export {
|
|
192
192
|
ae as Tabs,
|
|
193
193
|
O as TabsContent,
|
package/dist/text.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-nZSsnGb7.js"),d=require("class-variance-authority"),u=require("react"),x=require("./utils-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./jsx-runtime-nZSsnGb7.js"),d=require("class-variance-authority"),u=require("react"),x=require("./utils-cdbZV8DZ.js");function m(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const b=m(u),a=d.cva("",{variants:{variant:{h1:"scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",h2:"scroll-m-20 text-3xl font-semibold tracking-tight",h3:"scroll-m-20 text-2xl font-semibold tracking-tight",h4:"scroll-m-20 text-xl font-semibold tracking-tight",body:"leading-7",bodySmall:"text-sm leading-6",caption:"text-xs text-muted-foreground",label:"text-sm font-medium leading-none",overline:"text-xs font-semibold uppercase tracking-widest text-muted-foreground"}},defaultVariants:{variant:"body"}}),g={h1:"h1",h2:"h2",h3:"h3",h4:"h4",body:"p",bodySmall:"p",caption:"span",label:"label",overline:"span"},r=b.forwardRef(({className:t,variant:e="body",as:n,children:o,...l},i)=>{const s=n||g[e??"body"]||"p";return c.jsxRuntimeExports.jsx(s,{ref:i,className:x.cn(a({variant:e,className:t})),...l,children:o})});r.displayName="Text";exports.Text=r;exports.textVariants=a;
|
package/dist/text.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { j as i } from "./jsx-runtime-tc70JA_2.mjs";
|
|
3
3
|
import { cva as s } from "class-variance-authority";
|
|
4
4
|
import * as m from "react";
|
|
5
|
-
import { c as x } from "./utils-
|
|
5
|
+
import { c as x } from "./utils-DY6fhrgS.mjs";
|
|
6
6
|
const d = s("", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
package/dist/textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-nZSsnGb7.js"),s=require("react"),i=require("./utils-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-nZSsnGb7.js"),s=require("react"),i=require("./utils-cdbZV8DZ.js");function u(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const c=u(s),o=c.forwardRef(({className:e,...r},t)=>a.jsxRuntimeExports.jsx("textarea",{className:i.cn("border-input placeholder:text-muted-foreground focus-visible:ring-ring flex min-h-[60px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-sm focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:t,...r}));o.displayName="Textarea";exports.Textarea=o;
|
package/dist/textarea.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as o } from "./jsx-runtime-tc70JA_2.mjs";
|
|
3
3
|
import * as s from "react";
|
|
4
|
-
import { c as a } from "./utils-
|
|
4
|
+
import { c as a } from "./utils-DY6fhrgS.mjs";
|
|
5
5
|
const i = s.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ o.jsx(
|
|
6
6
|
"textarea",
|
|
7
7
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-nZSsnGb7.js"),s=require("lucide-react"),j=require("./button.cjs"),t=require("./dropdown-menu.cjs"),d=require("@gv-tech/design-tokens"),T=require("next-themes"),r=require("./utils-
|
|
1
|
+
"use strict";const e=require("./jsx-runtime-nZSsnGb7.js"),s=require("lucide-react"),j=require("./button.cjs"),t=require("./dropdown-menu.cjs"),d=require("@gv-tech/design-tokens"),T=require("next-themes"),r=require("./utils-cdbZV8DZ.js");function p(){const o=T.useTheme(),{resolvedTheme:i}=o,n=i==="dark"?d.theme.dark:d.theme.light;return{...o,tokens:n}}function k({variant:o="binary",onThemeChange:i,customTheme:n,className:c}){const{theme:R,setTheme:E,resolvedTheme:g}=p(),m=n??R,l=(n||g)==="dark",a=m==="system",x=h=>{i?i(h):E(h)},u=()=>e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(s.Sun,{className:r.cn("h-[1.2rem] w-[1.2rem] transition-all",!a&&!l?"scale-100 rotate-0":"scale-0 -rotate-90")}),e.jsxRuntimeExports.jsx(s.Moon,{className:r.cn("absolute h-[1.2rem] w-[1.2rem] transition-all",!a&&l?"scale-100 rotate-0":"scale-0 rotate-90")}),e.jsxRuntimeExports.jsx(s.SunMoon,{className:r.cn("absolute h-[1.2rem] w-[1.2rem] transition-all",a?"scale-100 rotate-0":"scale-0 rotate-90")}),e.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Toggle theme"})]});return o==="ternary"?e.jsxRuntimeExports.jsxs(t.DropdownMenu,{children:[e.jsxRuntimeExports.jsx(t.DropdownMenuTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(j.Button,{variant:"ghost",size:"icon",className:r.cn("relative h-9 w-9",c),children:e.jsxRuntimeExports.jsx(u,{})})}),e.jsxRuntimeExports.jsxs(t.DropdownMenuContent,{align:"end",children:[e.jsxRuntimeExports.jsxs(t.DropdownMenuItem,{onClick:()=>x("light"),children:[e.jsxRuntimeExports.jsx(s.Sun,{className:"mr-2 h-4 w-4"}),e.jsxRuntimeExports.jsx("span",{children:"Light"})]}),e.jsxRuntimeExports.jsxs(t.DropdownMenuItem,{onClick:()=>x("dark"),children:[e.jsxRuntimeExports.jsx(s.Moon,{className:"mr-2 h-4 w-4"}),e.jsxRuntimeExports.jsx("span",{children:"Dark"})]}),e.jsxRuntimeExports.jsxs(t.DropdownMenuItem,{onClick:()=>x("system"),children:[e.jsxRuntimeExports.jsx(s.SunMoon,{className:"mr-2 h-4 w-4"}),e.jsxRuntimeExports.jsx("span",{children:"System"})]})]})]}):e.jsxRuntimeExports.jsx(j.Button,{variant:"ghost",size:"icon",className:r.cn("relative h-9 w-9",c),onClick:()=>x(m==="dark"?"light":"dark"),"aria-label":"Toggle theme",children:e.jsxRuntimeExports.jsx(u,{})})}exports.ThemeToggle=k;exports.useTheme=p;
|
|
@@ -4,7 +4,7 @@ import { Button as g } from "./button.mjs";
|
|
|
4
4
|
import { DropdownMenu as w, DropdownMenuTrigger as v, DropdownMenuContent as N, DropdownMenuItem as i } from "./dropdown-menu.mjs";
|
|
5
5
|
import { theme as p } from "@gv-tech/design-tokens";
|
|
6
6
|
import { useTheme as y } from "next-themes";
|
|
7
|
-
import { c as r } from "./utils-
|
|
7
|
+
import { c as r } from "./utils-DY6fhrgS.mjs";
|
|
8
8
|
function C() {
|
|
9
9
|
const t = y(), { resolvedTheme: n } = t, s = n === "dark" ? p.dark : p.light;
|
|
10
10
|
return {
|
package/dist/theme-toggle.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-nZSsnGb7.js");require("lucide-react");require("./button.cjs");require("./dropdown-menu.cjs");const e=require("./theme-toggle-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./jsx-runtime-nZSsnGb7.js");require("lucide-react");require("./button.cjs");require("./dropdown-menu.cjs");const e=require("./theme-toggle-DXQGNfCe.js");require("./utils-cdbZV8DZ.js");exports.ThemeToggle=e.ThemeToggle;
|
package/dist/theme-toggle.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import "./jsx-runtime-tc70JA_2.mjs";
|
|
|
3
3
|
import "lucide-react";
|
|
4
4
|
import "./button.mjs";
|
|
5
5
|
import "./dropdown-menu.mjs";
|
|
6
|
-
import { T } from "./theme-toggle-
|
|
7
|
-
import "./utils-
|
|
6
|
+
import { T } from "./theme-toggle-tHXIbr8W.mjs";
|
|
7
|
+
import "./utils-DY6fhrgS.mjs";
|
|
8
8
|
export {
|
|
9
9
|
T as ThemeToggle
|
|
10
10
|
};
|
package/dist/toast.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-nZSsnGb7.js"),Ae=require("react"),Ie=require("react-dom"),x=require("./index-BtZvtDmp.js"),te=require("./index-_XxjJPRD.js"),Fe=require("./index-BGIK9FQF.js"),Oe=require("./index-D2HnlO3y.js"),se=require("./index-BoNjHhm4.js"),Le=require("./index-CwyAfCwY.js"),Me=require("./index-B2XtpfGY.js"),K=require("./index-CzY-WZXL.js"),ke=require("./index-Ce5TOFAK.js"),Ve=require("./index-MQ0c3ZX_.js"),oe=require("./index-Cl3G0jzM.js"),$e=require("class-variance-authority"),He=require("lucide-react"),S=require("./utils-IjLH3w2e.js");function re(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const r=re(Ae),Ke=re(Ie);var z="ToastProvider",[G,qe,We]=Fe.createCollection("Toast"),[ne]=Oe.createContextScope("Toast",[We]),[Xe,q]=ne(z),ae=e=>{const{__scopeToast:t,label:s="Notification",duration:o=5e3,swipeDirection:u="right",swipeThreshold:l=50,children:p}=e,[v,E]=r.useState(null),[c,b]=r.useState(0),T=r.useRef(!1),_=r.useRef(!1);return s.trim()||console.error(`Invalid prop \`label\` supplied to \`${z}\`. Expected non-empty \`string\`.`),n.jsxRuntimeExports.jsx(G.Provider,{scope:t,children:n.jsxRuntimeExports.jsx(Xe,{scope:t,label:s,duration:o,swipeDirection:u,swipeThreshold:l,toastCount:c,viewport:v,onViewportChange:E,onToastAdd:r.useCallback(()=>b(C=>C+1),[]),onToastRemove:r.useCallback(()=>b(C=>C-1),[]),isFocusedToastEscapeKeyDownRef:T,isClosePausedRef:_,children:p})})};ae.displayName=z;var ie="ToastViewport",Ue=["F8"],U="toast.viewportPause",Y="toast.viewportResume",ce=r.forwardRef((e,t)=>{const{__scopeToast:s,hotkey:o=Ue,label:u="Notifications ({hotkey})",...l}=e,p=q(ie,s),v=qe(s),E=r.useRef(null),c=r.useRef(null),b=r.useRef(null),T=r.useRef(null),_=te.useComposedRefs(t,T,p.onViewportChange),C=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=p.toastCount>0;r.useEffect(()=>{const i=y=>{o.length!==0&&o.every(m=>y[m]||y.code===m)&&T.current?.focus()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[o]),r.useEffect(()=>{const i=E.current,y=T.current;if(j&&i&&y){const f=()=>{if(!p.isClosePausedRef.current){const w=new CustomEvent(U);y.dispatchEvent(w),p.isClosePausedRef.current=!0}},m=()=>{if(p.isClosePausedRef.current){const w=new CustomEvent(Y);y.dispatchEvent(w),p.isClosePausedRef.current=!1}},R=w=>{!i.contains(w.relatedTarget)&&m()},g=()=>{i.contains(document.activeElement)||m()};return i.addEventListener("focusin",f),i.addEventListener("focusout",R),i.addEventListener("pointermove",f),i.addEventListener("pointerleave",g),window.addEventListener("blur",f),window.addEventListener("focus",m),()=>{i.removeEventListener("focusin",f),i.removeEventListener("focusout",R),i.removeEventListener("pointermove",f),i.removeEventListener("pointerleave",g),window.removeEventListener("blur",f),window.removeEventListener("focus",m)}}},[j,p.isClosePausedRef]);const d=r.useCallback(({tabbingDirection:i})=>{const f=v().map(m=>{const R=m.ref.current,g=[R,...nt(R)];return i==="forwards"?g:g.reverse()});return(i==="forwards"?f.reverse():f).flat()},[v]);return r.useEffect(()=>{const i=T.current;if(i){const y=f=>{const m=f.altKey||f.ctrlKey||f.metaKey;if(f.key==="Tab"&&!m){const g=document.activeElement,w=f.shiftKey;if(f.target===i&&w){c.current?.focus();return}const A=d({tabbingDirection:w?"backwards":"forwards"}),M=A.findIndex(N=>N===g);X(A.slice(M+1))?f.preventDefault():w?c.current?.focus():b.current?.focus()}};return i.addEventListener("keydown",y),()=>i.removeEventListener("keydown",y)}},[v,d]),n.jsxRuntimeExports.jsxs(se.Branch,{ref:E,role:"region","aria-label":u.replace("{hotkey}",C),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&n.jsxRuntimeExports.jsx(B,{ref:c,onFocusFromOutsideViewport:()=>{const i=d({tabbingDirection:"forwards"});X(i)}}),n.jsxRuntimeExports.jsx(G.Slot,{scope:s,children:n.jsxRuntimeExports.jsx(x.Primitive.ol,{tabIndex:-1,...l,ref:_})}),j&&n.jsxRuntimeExports.jsx(B,{ref:b,onFocusFromOutsideViewport:()=>{const i=d({tabbingDirection:"backwards"});X(i)}})]})});ce.displayName=ie;var ue="ToastFocusProxy",B=r.forwardRef((e,t)=>{const{__scopeToast:s,onFocusFromOutsideViewport:o,...u}=e,l=q(ue,s);return n.jsxRuntimeExports.jsx(oe.VisuallyHidden,{tabIndex:0,...u,ref:t,style:{position:"fixed"},onFocus:p=>{const v=p.relatedTarget;!l.viewport?.contains(v)&&o()}})});B.displayName=ue;var O="Toast",Ye="toast.swipeStart",Be="toast.swipeMove",ze="toast.swipeCancel",Ge="toast.swipeEnd",de=r.forwardRef((e,t)=>{const{forceMount:s,open:o,defaultOpen:u,onOpenChange:l,...p}=e,[v,E]=ke.useControllableState({prop:o,defaultProp:u??!0,onChange:l,caller:O});return n.jsxRuntimeExports.jsx(Me.Presence,{present:s||v,children:n.jsxRuntimeExports.jsx(Ze,{open:v,...p,ref:t,onClose:()=>E(!1),onPause:K.useCallbackRef(e.onPause),onResume:K.useCallbackRef(e.onResume),onSwipeStart:x.composeEventHandlers(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:x.composeEventHandlers(e.onSwipeMove,c=>{const{x:b,y:T}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${b}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${T}px`)}),onSwipeCancel:x.composeEventHandlers(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:x.composeEventHandlers(e.onSwipeEnd,c=>{const{x:b,y:T}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${b}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${T}px`),E(!1)})})})});de.displayName=O;var[Je,Qe]=ne(O,{onClose(){}}),Ze=r.forwardRef((e,t)=>{const{__scopeToast:s,type:o="foreground",duration:u,open:l,onClose:p,onEscapeKeyDown:v,onPause:E,onResume:c,onSwipeStart:b,onSwipeMove:T,onSwipeCancel:_,onSwipeEnd:C,...j}=e,d=q(O,s),[i,y]=r.useState(null),f=te.useComposedRefs(t,a=>y(a)),m=r.useRef(null),R=r.useRef(null),g=u||d.duration,w=r.useRef(0),D=r.useRef(g),L=r.useRef(0),{onToastAdd:A,onToastRemove:M}=d,N=K.useCallbackRef(()=>{i?.contains(document.activeElement)&&d.viewport?.focus(),p()}),k=r.useCallback(a=>{!a||a===1/0||(window.clearTimeout(L.current),w.current=new Date().getTime(),L.current=window.setTimeout(N,a))},[N]);r.useEffect(()=>{const a=d.viewport;if(a){const h=()=>{k(D.current),c?.()},P=()=>{const I=new Date().getTime()-w.current;D.current=D.current-I,window.clearTimeout(L.current),E?.()};return a.addEventListener(U,P),a.addEventListener(Y,h),()=>{a.removeEventListener(U,P),a.removeEventListener(Y,h)}}},[d.viewport,g,E,c,k]),r.useEffect(()=>{l&&!d.isClosePausedRef.current&&k(g)},[l,g,d.isClosePausedRef,k]),r.useEffect(()=>(A(),()=>M()),[A,M]);const Q=r.useMemo(()=>i?Ee(i):null,[i]);return d.viewport?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[Q&&n.jsxRuntimeExports.jsx(et,{__scopeToast:s,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:Q}),n.jsxRuntimeExports.jsx(Je,{scope:s,onClose:N,children:Ke.createPortal(n.jsxRuntimeExports.jsx(G.ItemSlot,{scope:s,children:n.jsxRuntimeExports.jsx(se.Root,{asChild:!0,onEscapeKeyDown:x.composeEventHandlers(v,()=>{d.isFocusedToastEscapeKeyDownRef.current||N(),d.isFocusedToastEscapeKeyDownRef.current=!1}),children:n.jsxRuntimeExports.jsx(x.Primitive.li,{tabIndex:0,"data-state":l?"open":"closed","data-swipe-direction":d.swipeDirection,...j,ref:f,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:x.composeEventHandlers(e.onKeyDown,a=>{a.key==="Escape"&&(v?.(a.nativeEvent),a.nativeEvent.defaultPrevented||(d.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:x.composeEventHandlers(e.onPointerDown,a=>{a.button===0&&(m.current={x:a.clientX,y:a.clientY})}),onPointerMove:x.composeEventHandlers(e.onPointerMove,a=>{if(!m.current)return;const h=a.clientX-m.current.x,P=a.clientY-m.current.y,I=!!R.current,F=["left","right"].includes(d.swipeDirection),V=["left","up"].includes(d.swipeDirection)?Math.min:Math.max,_e=F?V(0,h):0,De=F?0:V(0,P),W=a.pointerType==="touch"?10:2,$={x:_e,y:De},Z={originalEvent:a,delta:$};I?(R.current=$,H(Be,T,Z,{discrete:!1})):ee($,d.swipeDirection,W)?(R.current=$,H(Ye,b,Z,{discrete:!1}),a.target.setPointerCapture(a.pointerId)):(Math.abs(h)>W||Math.abs(P)>W)&&(m.current=null)}),onPointerUp:x.composeEventHandlers(e.onPointerUp,a=>{const h=R.current,P=a.target;if(P.hasPointerCapture(a.pointerId)&&P.releasePointerCapture(a.pointerId),R.current=null,m.current=null,h){const I=a.currentTarget,F={originalEvent:a,delta:h};ee(h,d.swipeDirection,d.swipeThreshold)?H(Ge,C,F,{discrete:!0}):H(ze,_,F,{discrete:!0}),I.addEventListener("click",V=>V.preventDefault(),{once:!0})}})})})}),d.viewport)})]}):null}),et=e=>{const{__scopeToast:t,children:s,...o}=e,u=q(O,t),[l,p]=r.useState(!1),[v,E]=r.useState(!1);return ot(()=>p(!0)),r.useEffect(()=>{const c=window.setTimeout(()=>E(!0),1e3);return()=>window.clearTimeout(c)},[]),v?null:n.jsxRuntimeExports.jsx(Le.Portal,{asChild:!0,children:n.jsxRuntimeExports.jsx(oe.VisuallyHidden,{...o,children:l&&n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[u.label," ",s]})})})},tt="ToastTitle",le=r.forwardRef((e,t)=>{const{__scopeToast:s,...o}=e;return n.jsxRuntimeExports.jsx(x.Primitive.div,{...o,ref:t})});le.displayName=tt;var st="ToastDescription",pe=r.forwardRef((e,t)=>{const{__scopeToast:s,...o}=e;return n.jsxRuntimeExports.jsx(x.Primitive.div,{...o,ref:t})});pe.displayName=st;var fe="ToastAction",me=r.forwardRef((e,t)=>{const{altText:s,...o}=e;return s.trim()?n.jsxRuntimeExports.jsx(ve,{altText:s,asChild:!0,children:n.jsxRuntimeExports.jsx(J,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${fe}\`. Expected non-empty \`string\`.`),null)});me.displayName=fe;var xe="ToastClose",J=r.forwardRef((e,t)=>{const{__scopeToast:s,...o}=e,u=Qe(xe,s);return n.jsxRuntimeExports.jsx(ve,{asChild:!0,children:n.jsxRuntimeExports.jsx(x.Primitive.button,{type:"button",...o,ref:t,onClick:x.composeEventHandlers(e.onClick,u.onClose)})})});J.displayName=xe;var ve=r.forwardRef((e,t)=>{const{__scopeToast:s,altText:o,...u}=e;return n.jsxRuntimeExports.jsx(x.Primitive.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...u,ref:t})});function Ee(e){const t=[];return Array.from(e.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),rt(o)){const u=o.ariaHidden||o.hidden||o.style.display==="none",l=o.dataset.radixToastAnnounceExclude==="";if(!u)if(l){const p=o.dataset.radixToastAnnounceAlt;p&&t.push(p)}else t.push(...Ee(o))}}),t}function H(e,t,s,{discrete:o}){const u=s.originalEvent.currentTarget,l=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:s});t&&u.addEventListener(e,t,{once:!0}),o?x.dispatchDiscreteCustomEvent(u,l):u.dispatchEvent(l)}var ee=(e,t,s=0)=>{const o=Math.abs(e.x),u=Math.abs(e.y),l=o>u;return t==="left"||t==="right"?l&&o>s:!l&&u>s};function ot(e=()=>{}){const t=K.useCallbackRef(e);Ve.useLayoutEffect2(()=>{let s=0,o=0;return s=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(s),window.cancelAnimationFrame(o)}},[t])}function rt(e){return e.nodeType===e.ELEMENT_NODE}function nt(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const u=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||u?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function X(e){const t=document.activeElement;return e.some(s=>s===t?!0:(s.focus(),document.activeElement!==t))}var at=ae,we=ce,Te=de,ye=le,Re=pe,ge=me,be=J;const it=at,he=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(we,{ref:s,className:S.cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]",e),...t}));he.displayName=we.displayName;const ct=$e.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Pe=r.forwardRef(({className:e,variant:t,...s},o)=>n.jsxRuntimeExports.jsx(Te,{ref:o,className:S.cn(ct({variant:t}),e),...s}));Pe.displayName=Te.displayName;const Ce=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ge,{ref:s,className:S.cn("hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-1 focus:outline-none disabled:pointer-events-none disabled:opacity-50",e),...t}));Ce.displayName=ge.displayName;const je=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(be,{ref:s,className:S.cn("text-foreground/50 hover:text-foreground absolute top-1 right-1 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-1 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:n.jsxRuntimeExports.jsx(He.X,{className:"h-4 w-4"})}));je.displayName=be.displayName;const Ne=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ye,{ref:s,className:S.cn("text-sm font-semibold [&+div]:text-xs",e),...t}));Ne.displayName=ye.displayName;const Se=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(Re,{ref:s,className:S.cn("text-sm opacity-90",e),...t}));Se.displayName=Re.displayName;exports.Toast=Pe;exports.ToastAction=Ce;exports.ToastClose=je;exports.ToastDescription=Se;exports.ToastProvider=it;exports.ToastTitle=Ne;exports.ToastViewport=he;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-nZSsnGb7.js"),Ae=require("react"),Ie=require("react-dom"),x=require("./index-BtZvtDmp.js"),te=require("./index-_XxjJPRD.js"),Fe=require("./index-BGIK9FQF.js"),Oe=require("./index-D2HnlO3y.js"),se=require("./index-BoNjHhm4.js"),Le=require("./index-CwyAfCwY.js"),Me=require("./index-B2XtpfGY.js"),K=require("./index-CzY-WZXL.js"),ke=require("./index-Ce5TOFAK.js"),Ve=require("./index-MQ0c3ZX_.js"),oe=require("./index-Cl3G0jzM.js"),$e=require("class-variance-authority"),He=require("lucide-react"),S=require("./utils-cdbZV8DZ.js");function re(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const r=re(Ae),Ke=re(Ie);var z="ToastProvider",[G,qe,We]=Fe.createCollection("Toast"),[ne]=Oe.createContextScope("Toast",[We]),[Xe,q]=ne(z),ae=e=>{const{__scopeToast:t,label:s="Notification",duration:o=5e3,swipeDirection:u="right",swipeThreshold:l=50,children:p}=e,[v,T]=r.useState(null),[c,b]=r.useState(0),E=r.useRef(!1),D=r.useRef(!1);return s.trim()||console.error(`Invalid prop \`label\` supplied to \`${z}\`. Expected non-empty \`string\`.`),n.jsxRuntimeExports.jsx(G.Provider,{scope:t,children:n.jsxRuntimeExports.jsx(Xe,{scope:t,label:s,duration:o,swipeDirection:u,swipeThreshold:l,toastCount:c,viewport:v,onViewportChange:T,onToastAdd:r.useCallback(()=>b(C=>C+1),[]),onToastRemove:r.useCallback(()=>b(C=>C-1),[]),isFocusedToastEscapeKeyDownRef:E,isClosePausedRef:D,children:p})})};ae.displayName=z;var ie="ToastViewport",Ue=["F8"],U="toast.viewportPause",Y="toast.viewportResume",ce=r.forwardRef((e,t)=>{const{__scopeToast:s,hotkey:o=Ue,label:u="Notifications ({hotkey})",...l}=e,p=q(ie,s),v=qe(s),T=r.useRef(null),c=r.useRef(null),b=r.useRef(null),E=r.useRef(null),D=te.useComposedRefs(t,E,p.onViewportChange),C=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=p.toastCount>0;r.useEffect(()=>{const i=y=>{o.length!==0&&o.every(m=>y[m]||y.code===m)&&E.current?.focus()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[o]),r.useEffect(()=>{const i=T.current,y=E.current;if(j&&i&&y){const f=()=>{if(!p.isClosePausedRef.current){const w=new CustomEvent(U);y.dispatchEvent(w),p.isClosePausedRef.current=!0}},m=()=>{if(p.isClosePausedRef.current){const w=new CustomEvent(Y);y.dispatchEvent(w),p.isClosePausedRef.current=!1}},R=w=>{!i.contains(w.relatedTarget)&&m()},g=()=>{i.contains(document.activeElement)||m()};return i.addEventListener("focusin",f),i.addEventListener("focusout",R),i.addEventListener("pointermove",f),i.addEventListener("pointerleave",g),window.addEventListener("blur",f),window.addEventListener("focus",m),()=>{i.removeEventListener("focusin",f),i.removeEventListener("focusout",R),i.removeEventListener("pointermove",f),i.removeEventListener("pointerleave",g),window.removeEventListener("blur",f),window.removeEventListener("focus",m)}}},[j,p.isClosePausedRef]);const d=r.useCallback(({tabbingDirection:i})=>{const f=v().map(m=>{const R=m.ref.current,g=[R,...nt(R)];return i==="forwards"?g:g.reverse()});return(i==="forwards"?f.reverse():f).flat()},[v]);return r.useEffect(()=>{const i=E.current;if(i){const y=f=>{const m=f.altKey||f.ctrlKey||f.metaKey;if(f.key==="Tab"&&!m){const g=document.activeElement,w=f.shiftKey;if(f.target===i&&w){c.current?.focus();return}const A=d({tabbingDirection:w?"backwards":"forwards"}),M=A.findIndex(N=>N===g);X(A.slice(M+1))?f.preventDefault():w?c.current?.focus():b.current?.focus()}};return i.addEventListener("keydown",y),()=>i.removeEventListener("keydown",y)}},[v,d]),n.jsxRuntimeExports.jsxs(se.Branch,{ref:T,role:"region","aria-label":u.replace("{hotkey}",C),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&n.jsxRuntimeExports.jsx(B,{ref:c,onFocusFromOutsideViewport:()=>{const i=d({tabbingDirection:"forwards"});X(i)}}),n.jsxRuntimeExports.jsx(G.Slot,{scope:s,children:n.jsxRuntimeExports.jsx(x.Primitive.ol,{tabIndex:-1,...l,ref:D})}),j&&n.jsxRuntimeExports.jsx(B,{ref:b,onFocusFromOutsideViewport:()=>{const i=d({tabbingDirection:"backwards"});X(i)}})]})});ce.displayName=ie;var ue="ToastFocusProxy",B=r.forwardRef((e,t)=>{const{__scopeToast:s,onFocusFromOutsideViewport:o,...u}=e,l=q(ue,s);return n.jsxRuntimeExports.jsx(oe.VisuallyHidden,{tabIndex:0,...u,ref:t,style:{position:"fixed"},onFocus:p=>{const v=p.relatedTarget;!l.viewport?.contains(v)&&o()}})});B.displayName=ue;var O="Toast",Ye="toast.swipeStart",Be="toast.swipeMove",ze="toast.swipeCancel",Ge="toast.swipeEnd",de=r.forwardRef((e,t)=>{const{forceMount:s,open:o,defaultOpen:u,onOpenChange:l,...p}=e,[v,T]=ke.useControllableState({prop:o,defaultProp:u??!0,onChange:l,caller:O});return n.jsxRuntimeExports.jsx(Me.Presence,{present:s||v,children:n.jsxRuntimeExports.jsx(Ze,{open:v,...p,ref:t,onClose:()=>T(!1),onPause:K.useCallbackRef(e.onPause),onResume:K.useCallbackRef(e.onResume),onSwipeStart:x.composeEventHandlers(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:x.composeEventHandlers(e.onSwipeMove,c=>{const{x:b,y:E}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${b}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${E}px`)}),onSwipeCancel:x.composeEventHandlers(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:x.composeEventHandlers(e.onSwipeEnd,c=>{const{x:b,y:E}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${b}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${E}px`),T(!1)})})})});de.displayName=O;var[Je,Qe]=ne(O,{onClose(){}}),Ze=r.forwardRef((e,t)=>{const{__scopeToast:s,type:o="foreground",duration:u,open:l,onClose:p,onEscapeKeyDown:v,onPause:T,onResume:c,onSwipeStart:b,onSwipeMove:E,onSwipeCancel:D,onSwipeEnd:C,...j}=e,d=q(O,s),[i,y]=r.useState(null),f=te.useComposedRefs(t,a=>y(a)),m=r.useRef(null),R=r.useRef(null),g=u||d.duration,w=r.useRef(0),_=r.useRef(g),L=r.useRef(0),{onToastAdd:A,onToastRemove:M}=d,N=K.useCallbackRef(()=>{i?.contains(document.activeElement)&&d.viewport?.focus(),p()}),k=r.useCallback(a=>{!a||a===1/0||(window.clearTimeout(L.current),w.current=new Date().getTime(),L.current=window.setTimeout(N,a))},[N]);r.useEffect(()=>{const a=d.viewport;if(a){const h=()=>{k(_.current),c?.()},P=()=>{const I=new Date().getTime()-w.current;_.current=_.current-I,window.clearTimeout(L.current),T?.()};return a.addEventListener(U,P),a.addEventListener(Y,h),()=>{a.removeEventListener(U,P),a.removeEventListener(Y,h)}}},[d.viewport,g,T,c,k]),r.useEffect(()=>{l&&!d.isClosePausedRef.current&&k(g)},[l,g,d.isClosePausedRef,k]),r.useEffect(()=>(A(),()=>M()),[A,M]);const Q=r.useMemo(()=>i?Te(i):null,[i]);return d.viewport?n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[Q&&n.jsxRuntimeExports.jsx(et,{__scopeToast:s,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:Q}),n.jsxRuntimeExports.jsx(Je,{scope:s,onClose:N,children:Ke.createPortal(n.jsxRuntimeExports.jsx(G.ItemSlot,{scope:s,children:n.jsxRuntimeExports.jsx(se.Root,{asChild:!0,onEscapeKeyDown:x.composeEventHandlers(v,()=>{d.isFocusedToastEscapeKeyDownRef.current||N(),d.isFocusedToastEscapeKeyDownRef.current=!1}),children:n.jsxRuntimeExports.jsx(x.Primitive.li,{tabIndex:0,"data-state":l?"open":"closed","data-swipe-direction":d.swipeDirection,...j,ref:f,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:x.composeEventHandlers(e.onKeyDown,a=>{a.key==="Escape"&&(v?.(a.nativeEvent),a.nativeEvent.defaultPrevented||(d.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:x.composeEventHandlers(e.onPointerDown,a=>{a.button===0&&(m.current={x:a.clientX,y:a.clientY})}),onPointerMove:x.composeEventHandlers(e.onPointerMove,a=>{if(!m.current)return;const h=a.clientX-m.current.x,P=a.clientY-m.current.y,I=!!R.current,F=["left","right"].includes(d.swipeDirection),V=["left","up"].includes(d.swipeDirection)?Math.min:Math.max,De=F?V(0,h):0,_e=F?0:V(0,P),W=a.pointerType==="touch"?10:2,$={x:De,y:_e},Z={originalEvent:a,delta:$};I?(R.current=$,H(Be,E,Z,{discrete:!1})):ee($,d.swipeDirection,W)?(R.current=$,H(Ye,b,Z,{discrete:!1}),a.target.setPointerCapture(a.pointerId)):(Math.abs(h)>W||Math.abs(P)>W)&&(m.current=null)}),onPointerUp:x.composeEventHandlers(e.onPointerUp,a=>{const h=R.current,P=a.target;if(P.hasPointerCapture(a.pointerId)&&P.releasePointerCapture(a.pointerId),R.current=null,m.current=null,h){const I=a.currentTarget,F={originalEvent:a,delta:h};ee(h,d.swipeDirection,d.swipeThreshold)?H(Ge,C,F,{discrete:!0}):H(ze,D,F,{discrete:!0}),I.addEventListener("click",V=>V.preventDefault(),{once:!0})}})})})}),d.viewport)})]}):null}),et=e=>{const{__scopeToast:t,children:s,...o}=e,u=q(O,t),[l,p]=r.useState(!1),[v,T]=r.useState(!1);return ot(()=>p(!0)),r.useEffect(()=>{const c=window.setTimeout(()=>T(!0),1e3);return()=>window.clearTimeout(c)},[]),v?null:n.jsxRuntimeExports.jsx(Le.Portal,{asChild:!0,children:n.jsxRuntimeExports.jsx(oe.VisuallyHidden,{...o,children:l&&n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[u.label," ",s]})})})},tt="ToastTitle",le=r.forwardRef((e,t)=>{const{__scopeToast:s,...o}=e;return n.jsxRuntimeExports.jsx(x.Primitive.div,{...o,ref:t})});le.displayName=tt;var st="ToastDescription",pe=r.forwardRef((e,t)=>{const{__scopeToast:s,...o}=e;return n.jsxRuntimeExports.jsx(x.Primitive.div,{...o,ref:t})});pe.displayName=st;var fe="ToastAction",me=r.forwardRef((e,t)=>{const{altText:s,...o}=e;return s.trim()?n.jsxRuntimeExports.jsx(ve,{altText:s,asChild:!0,children:n.jsxRuntimeExports.jsx(J,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${fe}\`. Expected non-empty \`string\`.`),null)});me.displayName=fe;var xe="ToastClose",J=r.forwardRef((e,t)=>{const{__scopeToast:s,...o}=e,u=Qe(xe,s);return n.jsxRuntimeExports.jsx(ve,{asChild:!0,children:n.jsxRuntimeExports.jsx(x.Primitive.button,{type:"button",...o,ref:t,onClick:x.composeEventHandlers(e.onClick,u.onClose)})})});J.displayName=xe;var ve=r.forwardRef((e,t)=>{const{__scopeToast:s,altText:o,...u}=e;return n.jsxRuntimeExports.jsx(x.Primitive.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...u,ref:t})});function Te(e){const t=[];return Array.from(e.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),rt(o)){const u=o.ariaHidden||o.hidden||o.style.display==="none",l=o.dataset.radixToastAnnounceExclude==="";if(!u)if(l){const p=o.dataset.radixToastAnnounceAlt;p&&t.push(p)}else t.push(...Te(o))}}),t}function H(e,t,s,{discrete:o}){const u=s.originalEvent.currentTarget,l=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:s});t&&u.addEventListener(e,t,{once:!0}),o?x.dispatchDiscreteCustomEvent(u,l):u.dispatchEvent(l)}var ee=(e,t,s=0)=>{const o=Math.abs(e.x),u=Math.abs(e.y),l=o>u;return t==="left"||t==="right"?l&&o>s:!l&&u>s};function ot(e=()=>{}){const t=K.useCallbackRef(e);Ve.useLayoutEffect2(()=>{let s=0,o=0;return s=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(s),window.cancelAnimationFrame(o)}},[t])}function rt(e){return e.nodeType===e.ELEMENT_NODE}function nt(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const u=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||u?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function X(e){const t=document.activeElement;return e.some(s=>s===t?!0:(s.focus(),document.activeElement!==t))}var at=ae,we=ce,Ee=de,ye=le,Re=pe,ge=me,be=J;const it=at,he=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(we,{ref:s,className:S.cn("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]",e),...t}));he.displayName=we?.displayName||"ToastViewport";const ct=$e.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Pe=r.forwardRef(({className:e,variant:t,...s},o)=>n.jsxRuntimeExports.jsx(Ee,{ref:o,className:S.cn(ct({variant:t}),e),...s}));Pe.displayName=Ee?.displayName||"Toast";const Ce=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ge,{ref:s,className:S.cn("hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-1 focus:outline-none disabled:pointer-events-none disabled:opacity-50",e),...t}));Ce.displayName=ge?.displayName||"ToastAction";const je=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(be,{ref:s,className:S.cn("text-foreground/50 hover:text-foreground absolute top-1 right-1 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-1 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:n.jsxRuntimeExports.jsx(He.X,{className:"h-4 w-4"})}));je.displayName=be?.displayName||"ToastClose";const Ne=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(ye,{ref:s,className:S.cn("text-sm font-semibold [&+div]:text-xs",e),...t}));Ne.displayName=ye?.displayName||"ToastTitle";const Se=r.forwardRef(({className:e,...t},s)=>n.jsxRuntimeExports.jsx(Re,{ref:s,className:S.cn("text-sm opacity-90",e),...t}));Se.displayName=Re?.displayName||"ToastDescription";exports.Toast=Pe;exports.ToastAction=Ce;exports.ToastClose=je;exports.ToastDescription=Se;exports.ToastProvider=it;exports.ToastTitle=Ne;exports.ToastViewport=he;
|
package/dist/toast.mjs
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
import { j as n } from "./jsx-runtime-tc70JA_2.mjs";
|
|
3
3
|
import * as s from "react";
|
|
4
4
|
import * as Re from "react-dom";
|
|
5
|
-
import { P as
|
|
5
|
+
import { P as A, c as P, d as Ce } from "./index-K9FzbxYw.mjs";
|
|
6
6
|
import { u as oe } from "./index-DLcqcWxM.mjs";
|
|
7
7
|
import { c as Ne } from "./index-DFdF7K7v.mjs";
|
|
8
8
|
import { c as Se } from "./index-IZ2gq03c.mjs";
|
|
9
|
-
import { B as
|
|
10
|
-
import { P as
|
|
11
|
-
import { P as
|
|
9
|
+
import { B as Ae, R as Ie } from "./index-Dfzl8TxY.mjs";
|
|
10
|
+
import { P as De } from "./index-C7HEunrh.mjs";
|
|
11
|
+
import { P as Fe } from "./index-vuPgkS0V.mjs";
|
|
12
12
|
import { u as W } from "./index-0ioNhtNM.mjs";
|
|
13
13
|
import { u as _e } from "./index-p6xVFRb4.mjs";
|
|
14
14
|
import { u as je } from "./index-CCKe-Mpx.mjs";
|
|
15
15
|
import { a as re } from "./index-DKN_vhyX.mjs";
|
|
16
16
|
import { cva as Le } from "class-variance-authority";
|
|
17
17
|
import { X as Me } from "lucide-react";
|
|
18
|
-
import { c as
|
|
18
|
+
import { c as I } from "./utils-DY6fhrgS.mjs";
|
|
19
19
|
var G = "ToastProvider", [J, Oe, ke] = Ne("Toast"), [se] = Se("Toast", [ke]), [Ve, X] = se(G), ne = (e) => {
|
|
20
20
|
const {
|
|
21
21
|
__scopeToast: t,
|
|
@@ -24,7 +24,7 @@ var G = "ToastProvider", [J, Oe, ke] = Ne("Toast"), [se] = Se("Toast", [ke]), [V
|
|
|
24
24
|
swipeDirection: u = "right",
|
|
25
25
|
swipeThreshold: l = 50,
|
|
26
26
|
children: p
|
|
27
|
-
} = e, [v, w] = s.useState(null), [c, h] = s.useState(0), x = s.useRef(!1),
|
|
27
|
+
} = e, [v, w] = s.useState(null), [c, h] = s.useState(0), x = s.useRef(!1), D = s.useRef(!1);
|
|
28
28
|
return o.trim() || console.error(
|
|
29
29
|
`Invalid prop \`label\` supplied to \`${G}\`. Expected non-empty \`string\`.`
|
|
30
30
|
), /* @__PURE__ */ n.jsx(J.Provider, { scope: t, children: /* @__PURE__ */ n.jsx(
|
|
@@ -41,7 +41,7 @@ var G = "ToastProvider", [J, Oe, ke] = Ne("Toast"), [se] = Se("Toast", [ke]), [V
|
|
|
41
41
|
onToastAdd: s.useCallback(() => h((C) => C + 1), []),
|
|
42
42
|
onToastRemove: s.useCallback(() => h((C) => C - 1), []),
|
|
43
43
|
isFocusedToastEscapeKeyDownRef: x,
|
|
44
|
-
isClosePausedRef:
|
|
44
|
+
isClosePausedRef: D,
|
|
45
45
|
children: p
|
|
46
46
|
}
|
|
47
47
|
) });
|
|
@@ -54,7 +54,7 @@ var ae = "ToastViewport", Ke = ["F8"], B = "toast.viewportPause", q = "toast.vie
|
|
|
54
54
|
hotkey: r = Ke,
|
|
55
55
|
label: u = "Notifications ({hotkey})",
|
|
56
56
|
...l
|
|
57
|
-
} = e, p = X(ae, o), v = Oe(o), w = s.useRef(null), c = s.useRef(null), h = s.useRef(null), x = s.useRef(null),
|
|
57
|
+
} = e, p = X(ae, o), v = Oe(o), w = s.useRef(null), c = s.useRef(null), h = s.useRef(null), x = s.useRef(null), D = oe(t, x, p.onViewportChange), C = r.join("+").replace(/Key/g, "").replace(/Digit/g, ""), N = p.toastCount > 0;
|
|
58
58
|
s.useEffect(() => {
|
|
59
59
|
const i = (E) => {
|
|
60
60
|
r.length !== 0 && r.every((m) => E[m] || E.code === m) && x.current?.focus();
|
|
@@ -111,7 +111,7 @@ var ae = "ToastViewport", Ke = ["F8"], B = "toast.viewportPause", q = "toast.vie
|
|
|
111
111
|
return i.addEventListener("keydown", E), () => i.removeEventListener("keydown", E);
|
|
112
112
|
}
|
|
113
113
|
}, [v, d]), /* @__PURE__ */ n.jsxs(
|
|
114
|
-
|
|
114
|
+
Ae,
|
|
115
115
|
{
|
|
116
116
|
ref: w,
|
|
117
117
|
role: "region",
|
|
@@ -131,7 +131,7 @@ var ae = "ToastViewport", Ke = ["F8"], B = "toast.viewportPause", q = "toast.vie
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
),
|
|
134
|
-
/* @__PURE__ */ n.jsx(J.Slot, { scope: o, children: /* @__PURE__ */ n.jsx(
|
|
134
|
+
/* @__PURE__ */ n.jsx(J.Slot, { scope: o, children: /* @__PURE__ */ n.jsx(A.ol, { tabIndex: -1, ...l, ref: D }) }),
|
|
135
135
|
N && /* @__PURE__ */ n.jsx(
|
|
136
136
|
z,
|
|
137
137
|
{
|
|
@@ -177,7 +177,7 @@ var M = "Toast", $e = "toast.swipeStart", He = "toast.swipeMove", We = "toast.sw
|
|
|
177
177
|
onChange: l,
|
|
178
178
|
caller: M
|
|
179
179
|
});
|
|
180
|
-
return /* @__PURE__ */ n.jsx(
|
|
180
|
+
return /* @__PURE__ */ n.jsx(Fe, { present: o || v, children: /* @__PURE__ */ n.jsx(
|
|
181
181
|
Be,
|
|
182
182
|
{
|
|
183
183
|
open: v,
|
|
@@ -221,10 +221,10 @@ var [Ue, Ye] = se(M, {
|
|
|
221
221
|
onResume: c,
|
|
222
222
|
onSwipeStart: h,
|
|
223
223
|
onSwipeMove: x,
|
|
224
|
-
onSwipeCancel:
|
|
224
|
+
onSwipeCancel: D,
|
|
225
225
|
onSwipeEnd: C,
|
|
226
226
|
...N
|
|
227
|
-
} = e, d = X(M, o), [i, E] = s.useState(null), f = oe(t, (a) => E(a)), m = s.useRef(null), y = s.useRef(null), g = u || d.duration, T = s.useRef(0),
|
|
227
|
+
} = e, d = X(M, o), [i, E] = s.useState(null), f = oe(t, (a) => E(a)), m = s.useRef(null), y = s.useRef(null), g = u || d.duration, T = s.useRef(0), F = s.useRef(g), O = s.useRef(0), { onToastAdd: _, onToastRemove: k } = d, S = W(() => {
|
|
228
228
|
i?.contains(document.activeElement) && d.viewport?.focus(), p();
|
|
229
229
|
}), V = s.useCallback(
|
|
230
230
|
(a) => {
|
|
@@ -236,10 +236,10 @@ var [Ue, Ye] = se(M, {
|
|
|
236
236
|
const a = d.viewport;
|
|
237
237
|
if (a) {
|
|
238
238
|
const b = () => {
|
|
239
|
-
V(
|
|
239
|
+
V(F.current), c?.();
|
|
240
240
|
}, R = () => {
|
|
241
241
|
const j = (/* @__PURE__ */ new Date()).getTime() - T.current;
|
|
242
|
-
|
|
242
|
+
F.current = F.current - j, window.clearTimeout(O.current), w?.();
|
|
243
243
|
};
|
|
244
244
|
return a.addEventListener(B, R), a.addEventListener(q, b), () => {
|
|
245
245
|
a.removeEventListener(B, R), a.removeEventListener(q, b);
|
|
@@ -261,14 +261,14 @@ var [Ue, Ye] = se(M, {
|
|
|
261
261
|
),
|
|
262
262
|
/* @__PURE__ */ n.jsx(Ue, { scope: o, onClose: S, children: Re.createPortal(
|
|
263
263
|
/* @__PURE__ */ n.jsx(J.ItemSlot, { scope: o, children: /* @__PURE__ */ n.jsx(
|
|
264
|
-
|
|
264
|
+
Ie,
|
|
265
265
|
{
|
|
266
266
|
asChild: !0,
|
|
267
267
|
onEscapeKeyDown: P(v, () => {
|
|
268
268
|
d.isFocusedToastEscapeKeyDownRef.current || S(), d.isFocusedToastEscapeKeyDownRef.current = !1;
|
|
269
269
|
}),
|
|
270
270
|
children: /* @__PURE__ */ n.jsx(
|
|
271
|
-
|
|
271
|
+
A.li,
|
|
272
272
|
{
|
|
273
273
|
tabIndex: 0,
|
|
274
274
|
"data-state": l ? "open" : "closed",
|
|
@@ -299,7 +299,7 @@ var [Ue, Ye] = se(M, {
|
|
|
299
299
|
discrete: !0
|
|
300
300
|
}) : H(
|
|
301
301
|
We,
|
|
302
|
-
|
|
302
|
+
D,
|
|
303
303
|
L,
|
|
304
304
|
{
|
|
305
305
|
discrete: !0
|
|
@@ -322,7 +322,7 @@ var [Ue, Ye] = se(M, {
|
|
|
322
322
|
return Je(() => p(!0)), s.useEffect(() => {
|
|
323
323
|
const c = window.setTimeout(() => w(!0), 1e3);
|
|
324
324
|
return () => window.clearTimeout(c);
|
|
325
|
-
}, []), v ? null : /* @__PURE__ */ n.jsx(
|
|
325
|
+
}, []), v ? null : /* @__PURE__ */ n.jsx(De, { asChild: !0, children: /* @__PURE__ */ n.jsx(re, { ...r, children: l && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
326
326
|
u.label,
|
|
327
327
|
" ",
|
|
328
328
|
o
|
|
@@ -330,14 +330,14 @@ var [Ue, Ye] = se(M, {
|
|
|
330
330
|
}, ze = "ToastTitle", de = s.forwardRef(
|
|
331
331
|
(e, t) => {
|
|
332
332
|
const { __scopeToast: o, ...r } = e;
|
|
333
|
-
return /* @__PURE__ */ n.jsx(
|
|
333
|
+
return /* @__PURE__ */ n.jsx(A.div, { ...r, ref: t });
|
|
334
334
|
}
|
|
335
335
|
);
|
|
336
336
|
de.displayName = ze;
|
|
337
337
|
var Ge = "ToastDescription", le = s.forwardRef(
|
|
338
338
|
(e, t) => {
|
|
339
339
|
const { __scopeToast: o, ...r } = e;
|
|
340
|
-
return /* @__PURE__ */ n.jsx(
|
|
340
|
+
return /* @__PURE__ */ n.jsx(A.div, { ...r, ref: t });
|
|
341
341
|
}
|
|
342
342
|
);
|
|
343
343
|
le.displayName = Ge;
|
|
@@ -354,7 +354,7 @@ var me = "ToastClose", Q = s.forwardRef(
|
|
|
354
354
|
(e, t) => {
|
|
355
355
|
const { __scopeToast: o, ...r } = e, u = Ye(me, o);
|
|
356
356
|
return /* @__PURE__ */ n.jsx(ve, { asChild: !0, children: /* @__PURE__ */ n.jsx(
|
|
357
|
-
|
|
357
|
+
A.button,
|
|
358
358
|
{
|
|
359
359
|
type: "button",
|
|
360
360
|
...r,
|
|
@@ -368,7 +368,7 @@ Q.displayName = me;
|
|
|
368
368
|
var ve = s.forwardRef((e, t) => {
|
|
369
369
|
const { __scopeToast: o, altText: r, ...u } = e;
|
|
370
370
|
return /* @__PURE__ */ n.jsx(
|
|
371
|
-
|
|
371
|
+
A.div,
|
|
372
372
|
{
|
|
373
373
|
"data-radix-toast-announce-exclude": "",
|
|
374
374
|
"data-radix-toast-announce-alt": r || void 0,
|
|
@@ -431,14 +431,14 @@ const Pt = et, tt = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */
|
|
|
431
431
|
Te,
|
|
432
432
|
{
|
|
433
433
|
ref: o,
|
|
434
|
-
className:
|
|
434
|
+
className: I(
|
|
435
435
|
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]",
|
|
436
436
|
e
|
|
437
437
|
),
|
|
438
438
|
...t
|
|
439
439
|
}
|
|
440
440
|
));
|
|
441
|
-
tt.displayName = Te
|
|
441
|
+
tt.displayName = Te?.displayName || "ToastViewport";
|
|
442
442
|
const ot = Le(
|
|
443
443
|
"group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
|
|
444
444
|
{
|
|
@@ -452,25 +452,25 @@ const ot = Le(
|
|
|
452
452
|
variant: "default"
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
), rt = s.forwardRef(({ className: e, variant: t, ...o }, r) => /* @__PURE__ */ n.jsx(xe, { ref: r, className:
|
|
456
|
-
rt.displayName = xe
|
|
455
|
+
), rt = s.forwardRef(({ className: e, variant: t, ...o }, r) => /* @__PURE__ */ n.jsx(xe, { ref: r, className: I(ot({ variant: t }), e), ...o }));
|
|
456
|
+
rt.displayName = xe?.displayName || "Toast";
|
|
457
457
|
const st = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ n.jsx(
|
|
458
458
|
ge,
|
|
459
459
|
{
|
|
460
460
|
ref: o,
|
|
461
|
-
className:
|
|
461
|
+
className: I(
|
|
462
462
|
"hover:bg-secondary focus:ring-ring group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-1 focus:outline-none disabled:pointer-events-none disabled:opacity-50",
|
|
463
463
|
e
|
|
464
464
|
),
|
|
465
465
|
...t
|
|
466
466
|
}
|
|
467
467
|
));
|
|
468
|
-
st.displayName = ge
|
|
468
|
+
st.displayName = ge?.displayName || "ToastAction";
|
|
469
469
|
const nt = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ n.jsx(
|
|
470
470
|
he,
|
|
471
471
|
{
|
|
472
472
|
ref: o,
|
|
473
|
-
className:
|
|
473
|
+
className: I(
|
|
474
474
|
"text-foreground/50 hover:text-foreground absolute top-1 right-1 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:ring-1 focus:outline-none group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
|
|
475
475
|
e
|
|
476
476
|
),
|
|
@@ -479,11 +479,11 @@ const nt = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ n.jsx(
|
|
|
479
479
|
children: /* @__PURE__ */ n.jsx(Me, { className: "h-4 w-4" })
|
|
480
480
|
}
|
|
481
481
|
));
|
|
482
|
-
nt.displayName = he
|
|
483
|
-
const at = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ n.jsx(Ee, { ref: o, className:
|
|
484
|
-
at.displayName = Ee
|
|
485
|
-
const it = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ n.jsx(ye, { ref: o, className:
|
|
486
|
-
it.displayName = ye
|
|
482
|
+
nt.displayName = he?.displayName || "ToastClose";
|
|
483
|
+
const at = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ n.jsx(Ee, { ref: o, className: I("text-sm font-semibold [&+div]:text-xs", e), ...t }));
|
|
484
|
+
at.displayName = Ee?.displayName || "ToastTitle";
|
|
485
|
+
const it = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ n.jsx(ye, { ref: o, className: I("text-sm opacity-90", e), ...t }));
|
|
486
|
+
it.displayName = ye?.displayName || "ToastDescription";
|
|
487
487
|
export {
|
|
488
488
|
rt as Toast,
|
|
489
489
|
st as ToastAction,
|