ivt 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion/index.mjs +19 -1
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/alert/index.mjs +43 -1
- package/dist/alert/index.mjs.map +1 -1
- package/dist/alert-dialog/index.mjs +260 -1
- package/dist/alert-dialog/index.mjs.map +1 -1
- package/dist/avatar/index.mjs +164 -1
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/badge/index.mjs +6 -1
- package/dist/badge/index.mjs.map +1 -1
- package/dist/base/index.mjs +760 -1
- package/dist/base/index.mjs.map +1 -1
- package/dist/button/index.mjs +6 -1
- package/dist/button/index.mjs.map +1 -1
- package/dist/calendar/index.mjs +11 -1
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/card/index.mjs +55 -1
- package/dist/card/index.mjs.map +1 -1
- package/dist/chart/index.mjs +16696 -1
- package/dist/chart/index.mjs.map +1 -1
- package/dist/checkbox/index.mjs +223 -1
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/chunks/_commonjsHelpers-DKISyIRi.mjs +6 -0
- package/dist/chunks/_commonjsHelpers-DKISyIRi.mjs.map +1 -0
- package/dist/chunks/accordion-CK9Ucbko.mjs +455 -0
- package/dist/chunks/{accordion-CdshDFZC.mjs.map → accordion-CK9Ucbko.mjs.map} +1 -1
- package/dist/chunks/badge-CT_hmjd2.mjs +57 -0
- package/dist/chunks/{badge-BYqshEmA.mjs.map → badge-CT_hmjd2.mjs.map} +1 -1
- package/dist/chunks/bundle-mjs-CS-QKnOm.mjs +4491 -0
- package/dist/chunks/{bundle-mjs-9BXytT_r.mjs.map → bundle-mjs-CS-QKnOm.mjs.map} +1 -1
- package/dist/chunks/button-BHeYV17S.mjs +47 -0
- package/dist/chunks/{button-DrFZXJ7z.mjs.map → button-BHeYV17S.mjs.map} +1 -1
- package/dist/chunks/calendar-CU6HdJET.mjs +7106 -0
- package/dist/chunks/calendar-CU6HdJET.mjs.map +1 -0
- package/dist/chunks/check-B3pXhibW.mjs +15 -0
- package/dist/chunks/{check-CimnOyD7.mjs.map → check-B3pXhibW.mjs.map} +1 -1
- package/dist/chunks/chevron-down-BV5gvmUW.mjs +15 -0
- package/dist/chunks/{chevron-down-D3fvbjxE.mjs.map → chevron-down-BV5gvmUW.mjs.map} +1 -1
- package/dist/chunks/chevron-left-BjGcH2KQ.mjs +15 -0
- package/dist/chunks/{chevron-left-CrN7DlXg.mjs.map → chevron-left-BjGcH2KQ.mjs.map} +1 -1
- package/dist/chunks/chevron-right-DmZu0xvo.mjs +15 -0
- package/dist/chunks/{chevron-right-BMSCuDGK.mjs.map → chevron-right-DmZu0xvo.mjs.map} +1 -1
- package/dist/chunks/chevrons-up-down-COuCmfU7.mjs +22 -0
- package/dist/chunks/{chevrons-up-down-DBgvRkZm.mjs.map → chevrons-up-down-COuCmfU7.mjs.map} +1 -1
- package/dist/chunks/circle-BKsPjIbw.mjs +17 -0
- package/dist/chunks/{circle-CGqt18Bd.mjs.map → circle-BKsPjIbw.mjs.map} +1 -1
- package/dist/chunks/command-CUWr3X1X.mjs +611 -0
- package/dist/chunks/command-CUWr3X1X.mjs.map +1 -0
- package/dist/chunks/createLucideIcon-BSP_Jxu-.mjs +60 -0
- package/dist/chunks/{createLucideIcon-L-tld2uc.mjs.map → createLucideIcon-BSP_Jxu-.mjs.map} +1 -1
- package/dist/chunks/dialog-zZCazow7.mjs +80 -0
- package/dist/chunks/{dialog-36eqHzT3.mjs.map → dialog-zZCazow7.mjs.map} +1 -1
- package/dist/chunks/hover-card-C6WPsacG.mjs +274 -0
- package/dist/chunks/{hover-card-Cnd58du6.mjs.map → hover-card-C6WPsacG.mjs.map} +1 -1
- package/dist/chunks/index-3XcV7C7l.mjs +324 -0
- package/dist/chunks/{index-DUNcuWJE.mjs.map → index-3XcV7C7l.mjs.map} +1 -1
- package/dist/chunks/index-B1VVz0MP.mjs +266 -0
- package/dist/chunks/index-B1VVz0MP.mjs.map +1 -0
- package/dist/chunks/index-BFDafXar.mjs +2370 -0
- package/dist/chunks/index-BFDafXar.mjs.map +1 -0
- package/dist/chunks/index-BF_TaONY.mjs +859 -0
- package/dist/chunks/{index-DZHMFdr0.mjs.map → index-BF_TaONY.mjs.map} +1 -1
- package/dist/chunks/index-BOOPeiVs.mjs +34 -0
- package/dist/chunks/{index-D2sZp5OP.mjs.map → index-BOOPeiVs.mjs.map} +1 -1
- package/dist/chunks/index-BYijxgZz.mjs +12 -0
- package/dist/chunks/index-BYijxgZz.mjs.map +1 -0
- package/dist/chunks/index-BZyzz9k8.mjs +40 -0
- package/dist/chunks/index-BZyzz9k8.mjs.map +1 -0
- package/dist/chunks/index-Bgiaprdv.mjs +7 -0
- package/dist/chunks/{index-CLtWFQL5.mjs.map → index-Bgiaprdv.mjs.map} +1 -1
- package/dist/chunks/index-Bl6nVRXe.mjs +110 -0
- package/dist/chunks/{index-CCcl327A.mjs.map → index-Bl6nVRXe.mjs.map} +1 -1
- package/dist/chunks/index-BwQDLVf8.mjs +151 -0
- package/dist/chunks/index-BwQDLVf8.mjs.map +1 -0
- package/dist/chunks/index-CHyZo-Tj.mjs +1210 -0
- package/dist/chunks/index-CHyZo-Tj.mjs.map +1 -0
- package/dist/chunks/index-CZ7Wntp7.mjs +21 -0
- package/dist/chunks/index-CZ7Wntp7.mjs.map +1 -0
- package/dist/chunks/index-D1yPZAOL.mjs +13 -0
- package/dist/chunks/{index-CXszXOf_.mjs.map → index-D1yPZAOL.mjs.map} +1 -1
- package/dist/chunks/index-DIBl7n6R.mjs +145 -0
- package/dist/chunks/index-DIBl7n6R.mjs.map +1 -0
- package/dist/chunks/index-DRk0bB4A.mjs +216 -0
- package/dist/chunks/{index-LvOFIVGz.mjs.map → index-DRk0bB4A.mjs.map} +1 -1
- package/dist/chunks/index-DUFr75Kc.mjs +77 -0
- package/dist/chunks/{index-CybgQKpz.mjs.map → index-DUFr75Kc.mjs.map} +1 -1
- package/dist/chunks/index-DrnQ43fz.mjs +18 -0
- package/dist/chunks/{index-CRxQlsb9.mjs.map → index-DrnQ43fz.mjs.map} +1 -1
- package/dist/chunks/index-Dulm0stf.mjs +12 -0
- package/dist/chunks/{index-CU_y1XAz.mjs.map → index-Dulm0stf.mjs.map} +1 -1
- package/dist/chunks/index-fWnSEyU5.mjs +50 -0
- package/dist/chunks/{index-w9bxia3O.mjs.map → index-fWnSEyU5.mjs.map} +1 -1
- package/dist/chunks/index-tNc5GmLL.mjs +51 -0
- package/dist/chunks/{index-vmPXTidH.mjs.map → index-tNc5GmLL.mjs.map} +1 -1
- package/dist/chunks/input-D9-FhnGc.mjs +14 -0
- package/dist/chunks/{input-85UFztMJ.mjs.map → input-D9-FhnGc.mjs.map} +1 -1
- package/dist/chunks/label-CiJcd2F9.mjs +32 -0
- package/dist/chunks/{label-CICFzZIt.mjs.map → label-CiJcd2F9.mjs.map} +1 -1
- package/dist/chunks/pagination-SOhqOW7I.mjs +106 -0
- package/dist/chunks/{pagination-CReDQes6.mjs.map → pagination-SOhqOW7I.mjs.map} +1 -1
- package/dist/chunks/popover-WlYXFyUl.mjs +308 -0
- package/dist/chunks/{popover-Cn2ZTvKd.mjs.map → popover-WlYXFyUl.mjs.map} +1 -1
- package/dist/chunks/progress-DdBZJTQG.mjs +99 -0
- package/dist/chunks/{progress-CSxQH6-f.mjs.map → progress-DdBZJTQG.mjs.map} +1 -1
- package/dist/chunks/scroll-area-B2wNbBRR.mjs +791 -0
- package/dist/chunks/scroll-area-B2wNbBRR.mjs.map +1 -0
- package/dist/chunks/select-COGYOg3A.mjs +104 -0
- package/dist/chunks/{select-BR6_N_Yo.mjs.map → select-COGYOg3A.mjs.map} +1 -1
- package/dist/chunks/separator-D6Y96f4g.mjs +48 -0
- package/dist/chunks/{separator-BB6-E9Z1.mjs.map → separator-D6Y96f4g.mjs.map} +1 -1
- package/dist/chunks/skeleton-CRfBAk8U.mjs +13 -0
- package/dist/chunks/{skeleton-XPWWiaac.mjs.map → skeleton-CRfBAk8U.mjs.map} +1 -1
- package/dist/chunks/sortable-tiuZWf3S.mjs +4221 -0
- package/dist/chunks/sortable-tiuZWf3S.mjs.map +1 -0
- package/dist/chunks/table-BlTF56Yn.mjs +62 -0
- package/dist/chunks/{table-LQIHzPHi.mjs.map → table-BlTF56Yn.mjs.map} +1 -1
- package/dist/chunks/toggle-D5tCYA7L.mjs +65 -0
- package/dist/chunks/{toggle-Co72WXGd.mjs.map → toggle-D5tCYA7L.mjs.map} +1 -1
- package/dist/chunks/tooltip-BpTMPR5Q.mjs +596 -0
- package/dist/chunks/{tooltip-qX2HjdJP.mjs.map → tooltip-BpTMPR5Q.mjs.map} +1 -1
- package/dist/chunks/tslib.es6-O3UsmxNe.mjs +61 -0
- package/dist/chunks/{tslib.es6-cMGqxriw.mjs.map → tslib.es6-O3UsmxNe.mjs.map} +1 -1
- package/dist/chunks/utils-tbIgc9YG.mjs +42 -0
- package/dist/chunks/utils-tbIgc9YG.mjs.map +1 -0
- package/dist/chunks/x-5oL4uC6I.mjs +22 -0
- package/dist/chunks/{x-BNLl0E-E.mjs.map → x-5oL4uC6I.mjs.map} +1 -1
- package/dist/combobox/index.mjs +65 -1
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.mjs +23 -1
- package/dist/command/index.mjs.map +1 -1
- package/dist/data-table/index.mjs +673 -1
- package/dist/data-table/index.mjs.map +1 -1
- package/dist/dialog/index.mjs +22 -1
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/dropdown-menu/index.mjs +438 -1
- package/dist/dropdown-menu/index.mjs.map +1 -1
- package/dist/dropzone/index.mjs +7839 -1
- package/dist/dropzone/index.mjs.map +1 -1
- package/dist/form/index.mjs +649 -1
- package/dist/form/index.mjs.map +1 -1
- package/dist/hover-card/index.mjs +18 -1
- package/dist/hover-card/index.mjs.map +1 -1
- package/dist/icon/index.mjs +317 -1
- package/dist/icon/index.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/input/index.mjs +4 -1
- package/dist/input/index.mjs.map +1 -1
- package/dist/ivt.css +1 -1
- package/dist/label/index.mjs +8 -1
- package/dist/label/index.mjs.map +1 -1
- package/dist/menubar/index.mjs +583 -1
- package/dist/menubar/index.mjs.map +1 -1
- package/dist/multi-select/index.mjs +297 -1
- package/dist/multi-select/index.mjs.map +1 -1
- package/dist/pagination/index.mjs +10 -1
- package/dist/pagination/index.mjs.map +1 -1
- package/dist/popover/index.mjs +21 -1
- package/dist/popover/index.mjs.map +1 -1
- package/dist/progress/index.mjs +9 -1
- package/dist/progress/index.mjs.map +1 -1
- package/dist/radio-group/index.mjs +267 -1
- package/dist/radio-group/index.mjs.map +1 -1
- package/dist/scroll-area/index.mjs +15 -1
- package/dist/scroll-area/index.mjs.map +1 -1
- package/dist/select/index.mjs +8 -1
- package/dist/select/index.mjs.map +1 -1
- package/dist/separator/index.mjs +8 -1
- package/dist/separator/index.mjs.map +1 -1
- package/dist/sheet/index.mjs +96 -1
- package/dist/sheet/index.mjs.map +1 -1
- package/dist/skeleton/index.mjs +4 -1
- package/dist/skeleton/index.mjs.map +1 -1
- package/dist/sonner/index.mjs +1140 -1
- package/dist/sonner/index.mjs.map +1 -1
- package/dist/sortable/index.mjs +8 -1
- package/dist/sortable/index.mjs.map +1 -1
- package/dist/table/index.mjs +4 -1
- package/dist/table/index.mjs.map +1 -1
- package/dist/tabs/index.mjs +193 -1
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.mjs +13 -1
- package/dist/textarea/index.mjs.map +1 -1
- package/dist/toast/index.mjs +705 -1
- package/dist/toast/index.mjs.map +1 -1
- package/dist/toggle/index.mjs +12 -1
- package/dist/toggle/index.mjs.map +1 -1
- package/dist/toggle-group/index.mjs +219 -1
- package/dist/toggle-group/index.mjs.map +1 -1
- package/dist/tooltip/index.mjs +20 -1
- package/dist/tooltip/index.mjs.map +1 -1
- package/package.json +6 -5
- package/dist/chunks/_commonjsHelpers-6qLFzZa5.mjs +0 -2
- package/dist/chunks/_commonjsHelpers-6qLFzZa5.mjs.map +0 -1
- package/dist/chunks/accordion-CdshDFZC.mjs +0 -2
- package/dist/chunks/badge-BYqshEmA.mjs +0 -2
- package/dist/chunks/bundle-mjs-9BXytT_r.mjs +0 -2
- package/dist/chunks/button-DrFZXJ7z.mjs +0 -2
- package/dist/chunks/calendar-BY6t8wdJ.mjs +0 -2
- package/dist/chunks/calendar-BY6t8wdJ.mjs.map +0 -1
- package/dist/chunks/check-CimnOyD7.mjs +0 -2
- package/dist/chunks/chevron-down-D3fvbjxE.mjs +0 -2
- package/dist/chunks/chevron-left-CrN7DlXg.mjs +0 -2
- package/dist/chunks/chevron-right-BMSCuDGK.mjs +0 -2
- package/dist/chunks/chevrons-up-down-DBgvRkZm.mjs +0 -2
- package/dist/chunks/circle-CGqt18Bd.mjs +0 -2
- package/dist/chunks/command-C6ON-ciq.mjs +0 -2
- package/dist/chunks/command-C6ON-ciq.mjs.map +0 -1
- package/dist/chunks/createLucideIcon-L-tld2uc.mjs +0 -2
- package/dist/chunks/dialog-36eqHzT3.mjs +0 -2
- package/dist/chunks/hover-card-Cnd58du6.mjs +0 -2
- package/dist/chunks/index-B4QsDzeM.mjs +0 -2
- package/dist/chunks/index-B4QsDzeM.mjs.map +0 -1
- package/dist/chunks/index-BdpYc58_.mjs +0 -2
- package/dist/chunks/index-BdpYc58_.mjs.map +0 -1
- package/dist/chunks/index-CCcl327A.mjs +0 -2
- package/dist/chunks/index-CLtWFQL5.mjs +0 -2
- package/dist/chunks/index-COvW87ew.mjs +0 -2
- package/dist/chunks/index-COvW87ew.mjs.map +0 -1
- package/dist/chunks/index-CRxQlsb9.mjs +0 -2
- package/dist/chunks/index-CU_y1XAz.mjs +0 -2
- package/dist/chunks/index-CXszXOf_.mjs +0 -2
- package/dist/chunks/index-CdJCOoFA.mjs +0 -2
- package/dist/chunks/index-CdJCOoFA.mjs.map +0 -1
- package/dist/chunks/index-Cpq7N5Ej.mjs +0 -2
- package/dist/chunks/index-Cpq7N5Ej.mjs.map +0 -1
- package/dist/chunks/index-CybgQKpz.mjs +0 -2
- package/dist/chunks/index-D2sZp5OP.mjs +0 -2
- package/dist/chunks/index-DOyt-JEx.mjs +0 -2
- package/dist/chunks/index-DOyt-JEx.mjs.map +0 -1
- package/dist/chunks/index-DUNcuWJE.mjs +0 -2
- package/dist/chunks/index-DZHMFdr0.mjs +0 -2
- package/dist/chunks/index-LvOFIVGz.mjs +0 -2
- package/dist/chunks/index-lvPXnk5F.mjs +0 -2
- package/dist/chunks/index-lvPXnk5F.mjs.map +0 -1
- package/dist/chunks/index-vmPXTidH.mjs +0 -2
- package/dist/chunks/index-w9bxia3O.mjs +0 -2
- package/dist/chunks/index-xew3kygQ.mjs +0 -2
- package/dist/chunks/index-xew3kygQ.mjs.map +0 -1
- package/dist/chunks/input-85UFztMJ.mjs +0 -2
- package/dist/chunks/label-CICFzZIt.mjs +0 -2
- package/dist/chunks/pagination-CReDQes6.mjs +0 -2
- package/dist/chunks/popover-Cn2ZTvKd.mjs +0 -2
- package/dist/chunks/progress-CSxQH6-f.mjs +0 -2
- package/dist/chunks/scroll-area-CvCz7cL_.mjs +0 -2
- package/dist/chunks/scroll-area-CvCz7cL_.mjs.map +0 -1
- package/dist/chunks/select-BR6_N_Yo.mjs +0 -2
- package/dist/chunks/separator-BB6-E9Z1.mjs +0 -2
- package/dist/chunks/skeleton-XPWWiaac.mjs +0 -2
- package/dist/chunks/sortable-CqPFGn8Q.mjs +0 -2
- package/dist/chunks/sortable-CqPFGn8Q.mjs.map +0 -1
- package/dist/chunks/table-LQIHzPHi.mjs +0 -2
- package/dist/chunks/toggle-Co72WXGd.mjs +0 -2
- package/dist/chunks/tooltip-qX2HjdJP.mjs +0 -2
- package/dist/chunks/tslib.es6-cMGqxriw.mjs +0 -2
- package/dist/chunks/utils-BctauAA9.mjs +0 -2
- package/dist/chunks/utils-BctauAA9.mjs.map +0 -1
- package/dist/chunks/x-BNLl0E-E.mjs +0 -2
package/dist/accordion/index.mjs
CHANGED
@@ -1,2 +1,20 @@
|
|
1
|
-
export{A as Accordion,c as AccordionContent,a as AccordionItem,b as AccordionTrigger}from
|
1
|
+
export { A as Accordion, c as AccordionContent, a as AccordionItem, b as AccordionTrigger } from '../chunks/accordion-CK9Ucbko.mjs';
|
2
|
+
import '../chunks/utils-tbIgc9YG.mjs';
|
3
|
+
import '../chunks/bundle-mjs-CS-QKnOm.mjs';
|
4
|
+
import 'react';
|
5
|
+
import '../chunks/index-Bl6nVRXe.mjs';
|
6
|
+
import 'react/jsx-runtime';
|
7
|
+
import '@radix-ui/react-collection';
|
8
|
+
import '../chunks/index-BZyzz9k8.mjs';
|
9
|
+
import '../chunks/index-BYijxgZz.mjs';
|
10
|
+
import '../chunks/index-DUFr75Kc.mjs';
|
11
|
+
import '../chunks/index-Bgiaprdv.mjs';
|
12
|
+
import '../chunks/index-fWnSEyU5.mjs';
|
13
|
+
import 'react-dom';
|
14
|
+
import '@radix-ui/react-slot';
|
15
|
+
import '../chunks/index-DIBl7n6R.mjs';
|
16
|
+
import '../chunks/index-DrnQ43fz.mjs';
|
17
|
+
import '../chunks/index-Dulm0stf.mjs';
|
18
|
+
import '../chunks/chevron-down-BV5gvmUW.mjs';
|
19
|
+
import '../chunks/createLucideIcon-BSP_Jxu-.mjs';
|
2
20
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
package/dist/alert/index.mjs
CHANGED
@@ -1,2 +1,44 @@
|
|
1
|
-
import{c as
|
1
|
+
import { c as cn } from '../chunks/utils-tbIgc9YG.mjs';
|
2
|
+
import { cva } from 'class-variance-authority';
|
3
|
+
import React__default from 'react';
|
4
|
+
import '../chunks/bundle-mjs-CS-QKnOm.mjs';
|
5
|
+
|
6
|
+
const alertVariants = cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", {
|
7
|
+
variants: {
|
8
|
+
variant: {
|
9
|
+
default: "bg-card text-card-foreground",
|
10
|
+
destructive: "text-destructive bg-card border-destructive bg-destructive-foreground [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
|
11
|
+
warning: "text-warning bg-card border-warning bg-warning-foreground [&>svg]:text-current *:data-[slot=alert-description]:text-warning/90"
|
12
|
+
}
|
13
|
+
},
|
14
|
+
defaultVariants: {
|
15
|
+
variant: "default"
|
16
|
+
}
|
17
|
+
});
|
18
|
+
function Alert({ className, variant, ...props }) {
|
19
|
+
return /*#__PURE__*/ React__default.createElement("div", {
|
20
|
+
"data-slot": "alert",
|
21
|
+
role: "alert",
|
22
|
+
className: cn(alertVariants({
|
23
|
+
variant
|
24
|
+
}), className),
|
25
|
+
...props
|
26
|
+
});
|
27
|
+
}
|
28
|
+
function AlertTitle({ className, ...props }) {
|
29
|
+
return /*#__PURE__*/ React__default.createElement("div", {
|
30
|
+
"data-slot": "alert-title",
|
31
|
+
className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className),
|
32
|
+
...props
|
33
|
+
});
|
34
|
+
}
|
35
|
+
function AlertDescription({ className, ...props }) {
|
36
|
+
return /*#__PURE__*/ React__default.createElement("div", {
|
37
|
+
"data-slot": "alert-description",
|
38
|
+
className: cn("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", className),
|
39
|
+
...props
|
40
|
+
});
|
41
|
+
}
|
42
|
+
|
43
|
+
export { Alert, AlertDescription, AlertTitle };
|
2
44
|
//# sourceMappingURL=index.mjs.map
|
package/dist/alert/index.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/components/ui/alert/alert.tsx"],"sourcesContent":["import { cn } from \"@/lib/utils\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport React from \"react\";\n\nconst alertVariants = cva(\n\t\"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-card text-card-foreground\",\n\t\t\t\tdestructive:\n\t\t\t\t\t\"text-destructive bg-card border-destructive bg-destructive-foreground [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90\",\n\t\t\t\twarning:\n\t\t\t\t\t\"text-warning bg-card border-warning bg-warning-foreground [&>svg]:text-current *:data-[slot=alert-description]:text-warning/90\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t},\n\t},\n);\n\nfunction Alert({\n\tclassName,\n\tvariant,\n\t...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof alertVariants>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert\"\n\t\t\trole=\"alert\"\n\t\t\tclassName={cn(alertVariants({ variant }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-title\"\n\t\t\tclassName={cn(\"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-description\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Alert, AlertTitle, AlertDescription };\n"],"names":["alertVariants","cva","variants","variant","default","destructive","warning","defaultVariants","Alert","className","props","React","
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/components/ui/alert/alert.tsx"],"sourcesContent":["import { cn } from \"@/lib/utils\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport React from \"react\";\n\nconst alertVariants = cva(\n\t\"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-card text-card-foreground\",\n\t\t\t\tdestructive:\n\t\t\t\t\t\"text-destructive bg-card border-destructive bg-destructive-foreground [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90\",\n\t\t\t\twarning:\n\t\t\t\t\t\"text-warning bg-card border-warning bg-warning-foreground [&>svg]:text-current *:data-[slot=alert-description]:text-warning/90\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t},\n\t},\n);\n\nfunction Alert({\n\tclassName,\n\tvariant,\n\t...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof alertVariants>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert\"\n\t\t\trole=\"alert\"\n\t\t\tclassName={cn(alertVariants({ variant }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-title\"\n\t\t\tclassName={cn(\"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-description\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Alert, AlertTitle, AlertDescription };\n"],"names":["alertVariants","cva","variants","variant","default","destructive","warning","defaultVariants","Alert","className","props","React","div","data-slot","role","cn","AlertTitle","AlertDescription"],"mappings":";;;;;AAIA,MAAMA,aAAAA,GAAgBC,IACrB,mOAAA,EACA;IACCC,QAAAA,EAAU;QACTC,OAAAA,EAAS;YACRC,OAAAA,EAAS,8BAAA;YACTC,WAAAA,EACC,gJAAA;YACDC,OAAAA,EACC;AACF;AACD,KAAA;IACAC,eAAAA,EAAiB;QAChBJ,OAAAA,EAAS;AACV;AACD,CAAA,CAAA;AAGD,SAASK,MAAM,EACdC,SAAS,EACTN,OAAO,EACP,GAAGO,KAAAA,EAC+D,EAAA;AAClE,IAAA,qBACCC,cAAA,CAAA,aAAA,CAACC,KAAAA,EAAAA;QACAC,WAAAA,EAAU,OAAA;QACVC,IAAAA,EAAK,OAAA;AACLL,QAAAA,SAAAA,EAAWM,GAAGf,aAAAA,CAAc;AAAEG,YAAAA;SAAQ,CAAA,EAAIM,SAAAA,CAAAA;AACzC,QAAA,GAAGC;;AAGP;AAEA,SAASM,UAAAA,CAAW,EAAEP,SAAS,EAAE,GAAGC,KAAAA,EAAoC,EAAA;AACvE,IAAA,qBACCC,cAAA,CAAA,aAAA,CAACC,KAAAA,EAAAA;QACAC,WAAAA,EAAU,aAAA;AACVJ,QAAAA,SAAAA,EAAWM,GAAG,6DAAA,EAA+DN,SAAAA,CAAAA;AAC5E,QAAA,GAAGC;;AAGP;AAEA,SAASO,gBAAAA,CAAiB,EAAER,SAAS,EAAE,GAAGC,KAAAA,EAAoC,EAAA;AAC7E,IAAA,qBACCC,cAAA,CAAA,aAAA,CAACC,KAAAA,EAAAA;QACAC,WAAAA,EAAU,mBAAA;AACVJ,QAAAA,SAAAA,EAAWM,GACV,gGAAA,EACAN,SAAAA,CAAAA;AAEA,QAAA,GAAGC;;AAGP;;;;"}
|
@@ -1,2 +1,261 @@
|
|
1
|
-
import*
|
1
|
+
import * as React from 'react';
|
2
|
+
import { c as createContextScope } from '../chunks/index-Bl6nVRXe.mjs';
|
3
|
+
import { u as useComposedRefs } from '../chunks/index-BZyzz9k8.mjs';
|
4
|
+
import { c as createDialogScope, R as Root, P as Portal, O as Overlay, b as Trigger, W as WarningProvider, a as Content, T as Title, D as Description, C as Close } from '../chunks/index-3XcV7C7l.mjs';
|
5
|
+
import { c as composeEventHandlers } from '../chunks/index-BYijxgZz.mjs';
|
6
|
+
import { createSlottable } from '@radix-ui/react-slot';
|
7
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
8
|
+
import { c as cn } from '../chunks/utils-tbIgc9YG.mjs';
|
9
|
+
import { b as buttonVariants } from '../chunks/button-BHeYV17S.mjs';
|
10
|
+
import '../chunks/index-DrnQ43fz.mjs';
|
11
|
+
import '../chunks/index-Bgiaprdv.mjs';
|
12
|
+
import '../chunks/index-DUFr75Kc.mjs';
|
13
|
+
import '../chunks/index-B1VVz0MP.mjs';
|
14
|
+
import '../chunks/index-fWnSEyU5.mjs';
|
15
|
+
import 'react-dom';
|
16
|
+
import '../chunks/index-D1yPZAOL.mjs';
|
17
|
+
import '../chunks/index-CHyZo-Tj.mjs';
|
18
|
+
import '../chunks/tslib.es6-O3UsmxNe.mjs';
|
19
|
+
import '../chunks/index-DIBl7n6R.mjs';
|
20
|
+
import '../chunks/bundle-mjs-CS-QKnOm.mjs';
|
21
|
+
import 'class-variance-authority';
|
22
|
+
|
23
|
+
var ROOT_NAME = "AlertDialog";
|
24
|
+
var [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [
|
25
|
+
createDialogScope
|
26
|
+
]);
|
27
|
+
var useDialogScope = createDialogScope();
|
28
|
+
var AlertDialog$1 = (props)=>{
|
29
|
+
const { __scopeAlertDialog, ...alertDialogProps } = props;
|
30
|
+
const dialogScope = useDialogScope(__scopeAlertDialog);
|
31
|
+
return /* @__PURE__ */ jsx(Root, {
|
32
|
+
...dialogScope,
|
33
|
+
...alertDialogProps,
|
34
|
+
modal: true
|
35
|
+
});
|
36
|
+
};
|
37
|
+
AlertDialog$1.displayName = ROOT_NAME;
|
38
|
+
var TRIGGER_NAME = "AlertDialogTrigger";
|
39
|
+
var AlertDialogTrigger$1 = React.forwardRef((props, forwardedRef)=>{
|
40
|
+
const { __scopeAlertDialog, ...triggerProps } = props;
|
41
|
+
const dialogScope = useDialogScope(__scopeAlertDialog);
|
42
|
+
return /* @__PURE__ */ jsx(Trigger, {
|
43
|
+
...dialogScope,
|
44
|
+
...triggerProps,
|
45
|
+
ref: forwardedRef
|
46
|
+
});
|
47
|
+
});
|
48
|
+
AlertDialogTrigger$1.displayName = TRIGGER_NAME;
|
49
|
+
var PORTAL_NAME = "AlertDialogPortal";
|
50
|
+
var AlertDialogPortal$1 = (props)=>{
|
51
|
+
const { __scopeAlertDialog, ...portalProps } = props;
|
52
|
+
const dialogScope = useDialogScope(__scopeAlertDialog);
|
53
|
+
return /* @__PURE__ */ jsx(Portal, {
|
54
|
+
...dialogScope,
|
55
|
+
...portalProps
|
56
|
+
});
|
57
|
+
};
|
58
|
+
AlertDialogPortal$1.displayName = PORTAL_NAME;
|
59
|
+
var OVERLAY_NAME = "AlertDialogOverlay";
|
60
|
+
var AlertDialogOverlay$1 = React.forwardRef((props, forwardedRef)=>{
|
61
|
+
const { __scopeAlertDialog, ...overlayProps } = props;
|
62
|
+
const dialogScope = useDialogScope(__scopeAlertDialog);
|
63
|
+
return /* @__PURE__ */ jsx(Overlay, {
|
64
|
+
...dialogScope,
|
65
|
+
...overlayProps,
|
66
|
+
ref: forwardedRef
|
67
|
+
});
|
68
|
+
});
|
69
|
+
AlertDialogOverlay$1.displayName = OVERLAY_NAME;
|
70
|
+
var CONTENT_NAME = "AlertDialogContent";
|
71
|
+
var [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME);
|
72
|
+
var Slottable = createSlottable("AlertDialogContent");
|
73
|
+
var AlertDialogContent$1 = React.forwardRef((props, forwardedRef)=>{
|
74
|
+
const { __scopeAlertDialog, children, ...contentProps } = props;
|
75
|
+
const dialogScope = useDialogScope(__scopeAlertDialog);
|
76
|
+
const contentRef = React.useRef(null);
|
77
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
78
|
+
const cancelRef = React.useRef(null);
|
79
|
+
return /* @__PURE__ */ jsx(WarningProvider, {
|
80
|
+
contentName: CONTENT_NAME,
|
81
|
+
titleName: TITLE_NAME,
|
82
|
+
docsSlug: "alert-dialog",
|
83
|
+
children: /* @__PURE__ */ jsx(AlertDialogContentProvider, {
|
84
|
+
scope: __scopeAlertDialog,
|
85
|
+
cancelRef,
|
86
|
+
children: /* @__PURE__ */ jsxs(Content, {
|
87
|
+
role: "alertdialog",
|
88
|
+
...dialogScope,
|
89
|
+
...contentProps,
|
90
|
+
ref: composedRefs,
|
91
|
+
onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event)=>{
|
92
|
+
event.preventDefault();
|
93
|
+
cancelRef.current?.focus({
|
94
|
+
preventScroll: true
|
95
|
+
});
|
96
|
+
}),
|
97
|
+
onPointerDownOutside: (event)=>event.preventDefault(),
|
98
|
+
onInteractOutside: (event)=>event.preventDefault(),
|
99
|
+
children: [
|
100
|
+
/* @__PURE__ */ jsx(Slottable, {
|
101
|
+
children
|
102
|
+
}),
|
103
|
+
/* @__PURE__ */ jsx(DescriptionWarning, {
|
104
|
+
contentRef
|
105
|
+
})
|
106
|
+
]
|
107
|
+
})
|
108
|
+
})
|
109
|
+
});
|
110
|
+
});
|
111
|
+
AlertDialogContent$1.displayName = CONTENT_NAME;
|
112
|
+
var TITLE_NAME = "AlertDialogTitle";
|
113
|
+
var AlertDialogTitle$1 = React.forwardRef((props, forwardedRef)=>{
|
114
|
+
const { __scopeAlertDialog, ...titleProps } = props;
|
115
|
+
const dialogScope = useDialogScope(__scopeAlertDialog);
|
116
|
+
return /* @__PURE__ */ jsx(Title, {
|
117
|
+
...dialogScope,
|
118
|
+
...titleProps,
|
119
|
+
ref: forwardedRef
|
120
|
+
});
|
121
|
+
});
|
122
|
+
AlertDialogTitle$1.displayName = TITLE_NAME;
|
123
|
+
var DESCRIPTION_NAME = "AlertDialogDescription";
|
124
|
+
var AlertDialogDescription$1 = React.forwardRef((props, forwardedRef)=>{
|
125
|
+
const { __scopeAlertDialog, ...descriptionProps } = props;
|
126
|
+
const dialogScope = useDialogScope(__scopeAlertDialog);
|
127
|
+
return /* @__PURE__ */ jsx(Description, {
|
128
|
+
...dialogScope,
|
129
|
+
...descriptionProps,
|
130
|
+
ref: forwardedRef
|
131
|
+
});
|
132
|
+
});
|
133
|
+
AlertDialogDescription$1.displayName = DESCRIPTION_NAME;
|
134
|
+
var ACTION_NAME = "AlertDialogAction";
|
135
|
+
var AlertDialogAction$1 = React.forwardRef((props, forwardedRef)=>{
|
136
|
+
const { __scopeAlertDialog, ...actionProps } = props;
|
137
|
+
const dialogScope = useDialogScope(__scopeAlertDialog);
|
138
|
+
return /* @__PURE__ */ jsx(Close, {
|
139
|
+
...dialogScope,
|
140
|
+
...actionProps,
|
141
|
+
ref: forwardedRef
|
142
|
+
});
|
143
|
+
});
|
144
|
+
AlertDialogAction$1.displayName = ACTION_NAME;
|
145
|
+
var CANCEL_NAME = "AlertDialogCancel";
|
146
|
+
var AlertDialogCancel$1 = React.forwardRef((props, forwardedRef)=>{
|
147
|
+
const { __scopeAlertDialog, ...cancelProps } = props;
|
148
|
+
const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);
|
149
|
+
const dialogScope = useDialogScope(__scopeAlertDialog);
|
150
|
+
const ref = useComposedRefs(forwardedRef, cancelRef);
|
151
|
+
return /* @__PURE__ */ jsx(Close, {
|
152
|
+
...dialogScope,
|
153
|
+
...cancelProps,
|
154
|
+
ref
|
155
|
+
});
|
156
|
+
});
|
157
|
+
AlertDialogCancel$1.displayName = CANCEL_NAME;
|
158
|
+
var DescriptionWarning = ({ contentRef })=>{
|
159
|
+
const MESSAGE = `\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
|
160
|
+
|
161
|
+
You can add a description to the \`${CONTENT_NAME}\` by passing a \`${DESCRIPTION_NAME}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
162
|
+
|
163
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
164
|
+
|
165
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
|
166
|
+
React.useEffect(()=>{
|
167
|
+
const hasDescription = document.getElementById(contentRef.current?.getAttribute("aria-describedby"));
|
168
|
+
if (!hasDescription) console.warn(MESSAGE);
|
169
|
+
}, [
|
170
|
+
MESSAGE,
|
171
|
+
contentRef
|
172
|
+
]);
|
173
|
+
return null;
|
174
|
+
};
|
175
|
+
var Root2 = AlertDialog$1;
|
176
|
+
var Trigger2 = AlertDialogTrigger$1;
|
177
|
+
var Portal2 = AlertDialogPortal$1;
|
178
|
+
var Overlay2 = AlertDialogOverlay$1;
|
179
|
+
var Content2 = AlertDialogContent$1;
|
180
|
+
var Action = AlertDialogAction$1;
|
181
|
+
var Cancel = AlertDialogCancel$1;
|
182
|
+
var Title2 = AlertDialogTitle$1;
|
183
|
+
var Description2 = AlertDialogDescription$1;
|
184
|
+
|
185
|
+
function AlertDialog({ ...props }) {
|
186
|
+
return /*#__PURE__*/ React.createElement(Root2, {
|
187
|
+
"data-slot": "alert-dialog",
|
188
|
+
...props
|
189
|
+
});
|
190
|
+
}
|
191
|
+
function AlertDialogTrigger({ ...props }) {
|
192
|
+
return /*#__PURE__*/ React.createElement(Trigger2, {
|
193
|
+
"data-slot": "alert-dialog-trigger",
|
194
|
+
...props
|
195
|
+
});
|
196
|
+
}
|
197
|
+
function AlertDialogPortal({ ...props }) {
|
198
|
+
return /*#__PURE__*/ React.createElement(Portal2, {
|
199
|
+
"data-slot": "alert-dialog-portal",
|
200
|
+
...props
|
201
|
+
});
|
202
|
+
}
|
203
|
+
function AlertDialogOverlay({ className, ...props }) {
|
204
|
+
return /*#__PURE__*/ React.createElement(Overlay2, {
|
205
|
+
"data-slot": "alert-dialog-overlay",
|
206
|
+
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className),
|
207
|
+
...props
|
208
|
+
});
|
209
|
+
}
|
210
|
+
function AlertDialogContent({ className, ...props }) {
|
211
|
+
return /*#__PURE__*/ React.createElement(AlertDialogPortal, null, /*#__PURE__*/ React.createElement(AlertDialogOverlay, null), /*#__PURE__*/ React.createElement(Content2, {
|
212
|
+
"data-slot": "alert-dialog-content",
|
213
|
+
className: cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", className),
|
214
|
+
...props
|
215
|
+
}));
|
216
|
+
}
|
217
|
+
function AlertDialogHeader({ className, ...props }) {
|
218
|
+
return /*#__PURE__*/ React.createElement("div", {
|
219
|
+
"data-slot": "alert-dialog-header",
|
220
|
+
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
221
|
+
...props
|
222
|
+
});
|
223
|
+
}
|
224
|
+
function AlertDialogFooter({ className, ...props }) {
|
225
|
+
return /*#__PURE__*/ React.createElement("div", {
|
226
|
+
"data-slot": "alert-dialog-footer",
|
227
|
+
className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
228
|
+
...props
|
229
|
+
});
|
230
|
+
}
|
231
|
+
function AlertDialogTitle({ className, ...props }) {
|
232
|
+
return /*#__PURE__*/ React.createElement(Title2, {
|
233
|
+
"data-slot": "alert-dialog-title",
|
234
|
+
className: cn("text-lg font-semibold", className),
|
235
|
+
...props
|
236
|
+
});
|
237
|
+
}
|
238
|
+
function AlertDialogDescription({ className, ...props }) {
|
239
|
+
return /*#__PURE__*/ React.createElement(Description2, {
|
240
|
+
"data-slot": "alert-dialog-description",
|
241
|
+
className: cn("text-muted-foreground text-sm", className),
|
242
|
+
...props
|
243
|
+
});
|
244
|
+
}
|
245
|
+
function AlertDialogAction({ className, ...props }) {
|
246
|
+
return /*#__PURE__*/ React.createElement(Action, {
|
247
|
+
className: cn(buttonVariants(), className),
|
248
|
+
...props
|
249
|
+
});
|
250
|
+
}
|
251
|
+
function AlertDialogCancel({ className, ...props }) {
|
252
|
+
return /*#__PURE__*/ React.createElement(Cancel, {
|
253
|
+
className: cn(buttonVariants({
|
254
|
+
variant: "outline"
|
255
|
+
}), className),
|
256
|
+
...props
|
257
|
+
});
|
258
|
+
}
|
259
|
+
|
260
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
|
2
261
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../node_modules/@radix-ui/react-alert-dialog/dist/index.mjs","../../src/components/ui/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\n// src/alert-dialog.tsx\nimport * as React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { createDialogScope } from \"@radix-ui/react-dialog\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createSlottable } from \"@radix-ui/react-slot\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar ROOT_NAME = \"AlertDialog\";\nvar [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [\n createDialogScope\n]);\nvar useDialogScope = createDialogScope();\nvar AlertDialog = (props) => {\n const { __scopeAlertDialog, ...alertDialogProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...dialogScope, ...alertDialogProps, modal: true });\n};\nAlertDialog.displayName = ROOT_NAME;\nvar TRIGGER_NAME = \"AlertDialogTrigger\";\nvar AlertDialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...triggerProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ...dialogScope, ...triggerProps, ref: forwardedRef });\n }\n);\nAlertDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"AlertDialogPortal\";\nvar AlertDialogPortal = (props) => {\n const { __scopeAlertDialog, ...portalProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { ...dialogScope, ...portalProps });\n};\nAlertDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"AlertDialogOverlay\";\nvar AlertDialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...overlayProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { ...dialogScope, ...overlayProps, ref: forwardedRef });\n }\n);\nAlertDialogOverlay.displayName = OVERLAY_NAME;\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME);\nvar Slottable = createSlottable(\"AlertDialogContent\");\nvar AlertDialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, children, ...contentProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const cancelRef = React.useRef(null);\n return /* @__PURE__ */ jsx(\n DialogPrimitive.WarningProvider,\n {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"alert-dialog\",\n children: /* @__PURE__ */ jsx(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ jsxs(\n DialogPrimitive.Content,\n {\n role: \"alertdialog\",\n ...dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {\n event.preventDefault();\n cancelRef.current?.focus({ preventScroll: true });\n }),\n onPointerDownOutside: (event) => event.preventDefault(),\n onInteractOutside: (event) => event.preventDefault(),\n children: [\n /* @__PURE__ */ jsx(Slottable, { children }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef })\n ]\n }\n ) })\n }\n );\n }\n);\nAlertDialogContent.displayName = CONTENT_NAME;\nvar TITLE_NAME = \"AlertDialogTitle\";\nvar AlertDialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...titleProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Title, { ...dialogScope, ...titleProps, ref: forwardedRef });\n }\n);\nAlertDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"AlertDialogDescription\";\nvar AlertDialogDescription = React.forwardRef((props, forwardedRef) => {\n const { __scopeAlertDialog, ...descriptionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Description, { ...dialogScope, ...descriptionProps, ref: forwardedRef });\n});\nAlertDialogDescription.displayName = DESCRIPTION_NAME;\nvar ACTION_NAME = \"AlertDialogAction\";\nvar AlertDialogAction = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...actionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...actionProps, ref: forwardedRef });\n }\n);\nAlertDialogAction.displayName = ACTION_NAME;\nvar CANCEL_NAME = \"AlertDialogCancel\";\nvar AlertDialogCancel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...cancelProps } = props;\n const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const ref = useComposedRefs(forwardedRef, cancelRef);\n return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...cancelProps, ref });\n }\n);\nAlertDialogCancel.displayName = CANCEL_NAME;\nvar DescriptionWarning = ({ contentRef }) => {\n const MESSAGE = `\\`${CONTENT_NAME}\\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \\`${CONTENT_NAME}\\` by passing a \\`${DESCRIPTION_NAME}\\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \\`id\\` and passing the same value to the \\`aria-describedby\\` prop in \\`${CONTENT_NAME}\\`. If the description is confusing or duplicative for sighted users, you can use the \\`@radix-ui/react-visually-hidden\\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;\n React.useEffect(() => {\n const hasDescription = document.getElementById(\n contentRef.current?.getAttribute(\"aria-describedby\")\n );\n if (!hasDescription) console.warn(MESSAGE);\n }, [MESSAGE, contentRef]);\n return null;\n};\nvar Root2 = AlertDialog;\nvar Trigger2 = AlertDialogTrigger;\nvar Portal2 = AlertDialogPortal;\nvar Overlay2 = AlertDialogOverlay;\nvar Content2 = AlertDialogContent;\nvar Action = AlertDialogAction;\nvar Cancel = AlertDialogCancel;\nvar Title2 = AlertDialogTitle;\nvar Description2 = AlertDialogDescription;\nexport {\n Action,\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n Cancel,\n Content2 as Content,\n Description2 as Description,\n Overlay2 as Overlay,\n Portal2 as Portal,\n Root2 as Root,\n Title2 as Title,\n Trigger2 as Trigger,\n createAlertDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n","import * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport * as React from \"react\";\n\nimport { buttonVariants } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\nfunction AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n\treturn <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />;\n}\n\nfunction AlertDialogTrigger({\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n\treturn <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />;\n}\n\nfunction AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n\treturn <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />;\n}\n\nfunction AlertDialogOverlay({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Overlay\n\t\t\tdata-slot=\"alert-dialog-overlay\"\n\t\t\tclassName={cn(\n\t\t\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogContent({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {\n\treturn (\n\t\t<AlertDialogPortal>\n\t\t\t<AlertDialogOverlay />\n\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\tdata-slot=\"alert-dialog-content\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPortal>\n\t);\n}\n\nfunction AlertDialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-dialog-header\"\n\t\t\tclassName={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-dialog-footer\"\n\t\t\tclassName={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogTitle({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Title\n\t\t\tdata-slot=\"alert-dialog-title\"\n\t\t\tclassName={cn(\"text-lg font-semibold\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogDescription({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Description\n\t\t\tdata-slot=\"alert-dialog-description\"\n\t\t\tclassName={cn(\"text-muted-foreground text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogAction({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {\n\treturn <AlertDialogPrimitive.Action className={cn(buttonVariants(), className)} {...props} />;\n}\n\nfunction AlertDialogCancel({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Cancel\n\t\t\tclassName={cn(buttonVariants({ variant: \"outline\" }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tAlertDialog,\n\tAlertDialogPortal,\n\tAlertDialogOverlay,\n\tAlertDialogTrigger,\n\tAlertDialogContent,\n\tAlertDialogHeader,\n\tAlertDialogFooter,\n\tAlertDialogTitle,\n\tAlertDialogDescription,\n\tAlertDialogAction,\n\tAlertDialogCancel,\n};\n"],"names":["ROOT_NAME","createAlertDialogContext","createAlertDialogScope","createContextScope","createDialogScope","useDialogScope","AlertDialog","props","__scopeAlertDialog","alertDialogProps","dialogScope","jsx","DialogPrimitive.Root","modal","displayName","AlertDialogTrigger","React","forwardRef","forwardedRef","triggerProps","DialogPrimitive.Trigger","ref","AlertDialogPortal","portalProps","DialogPrimitive.Portal","AlertDialogOverlay","overlayProps","DialogPrimitive.Overlay","CONTENT_NAME","AlertDialogContentProvider","useAlertDialogContentContext","Slottable","createSlottable","AlertDialogContent","children","contentProps","contentRef","useRef","composedRefs","useComposedRefs","cancelRef","DialogPrimitive.WarningProvider","contentName","titleName","TITLE_NAME","docsSlug","scope","jsxs","DialogPrimitive.Content","role","onOpenAutoFocus","composeEventHandlers","event","preventDefault","current","focus","preventScroll","onPointerDownOutside","onInteractOutside","DescriptionWarning","AlertDialogTitle","titleProps","DialogPrimitive.Title","DESCRIPTION_NAME","AlertDialogDescription","descriptionProps","DialogPrimitive.Description","AlertDialogAction","actionProps","DialogPrimitive.Close","CANCEL_NAME","AlertDialogCancel","cancelProps","MESSAGE","useEffect","document","getElementById","getAttribute","Root","Trigger","Portal","Overlay","Content","Action","Cancel","Title","Description","createElement","AlertDialogPrimitive","data-slot","className","cn","AlertDialogHeader","div","AlertDialogFooter","buttonVariants","variant"],"mappings":"q5BAcA,IAAMA,EAAY,eAGXC,EAA0BC,GAA0BC,EAAmBH,EAAW,CACvFI,IAEIC,EAAiBD,IAKjBE,EAA2CC,IAC/C,MAAMC,mBAAEA,KAAuBC,GAAqBF,EAC9CG,EAAcL,EAAeG,GACnC,OAAOG,EAAiBC,EAAhB,IAAyBF,KAAiBD,EAAkBI,OAAO,KAG7EP,EAAYQ,YAAcd,EAK1B,IAMMe,EAA2BC,EAAAC,WAC/B,CAACV,EAA6CW,KAC5C,MAAMV,mBAAEA,KAAuBW,GAAiBZ,EAC1CG,EAAcL,EAAeG,GACnC,OAAOG,EAAiBS,EAAhB,IAA4BV,KAAiBS,EAAcE,IAAKH,MAI5EH,EAAmBD,YAdE,qBAoBrB,IAKMQ,EACJf,IAEA,MAAMC,mBAAEA,KAAuBe,GAAgBhB,EACzCG,EAAcL,EAAeG,GACnC,OAAOG,EAAiBa,EAAhB,IAA2Bd,KAAiBa,KAGtDD,EAAkBR,YAbE,oBAmBpB,IAMMW,EAA2BT,EAAAC,WAC/B,CAACV,EAA6CW,KAC5C,MAAMV,mBAAEA,KAAuBkB,GAAiBnB,EAC1CG,EAAcL,EAAeG,GACnC,OAAOG,EAAiBgB,EAAhB,IAA4BjB,KAAiBgB,EAAcL,IAAKH,MAI5EO,EAAmBX,YAdE,qBAoBrB,IAAMc,EAAe,sBAMdC,EAA4BC,GACjC7B,EAAyD2B,GAOrDG,EAAYC,EAAgB,sBAE5BC,EAA2BjB,EAAAC,WAC/B,CAACV,EAA6CW,KAC5C,MAAMV,mBAAEA,EAAA0B,SAAoBA,KAAaC,GAAiB5B,EACpDG,EAAcL,EAAeG,GAC7B4B,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AAAA,CACAJ,YAAU,sBACVC,UAAWC,EAAG,+CAAgDD,MAC1DnF,GAGP,CAEA,SAASuF,IAAkBJ,UAAEA,KAAcnF,IAC1C,OACCS,EAAAuE,cAACM,MAAAA,CACAJ,YAAU,sBACVC,UAAWC,EAAG,yDAA0DD,MACpEnF,GAGP,CAEA,SAASqD,IAAiB8B,UACzBA,KACGnF,IAEH,OACCS,EAAAuE,cAACC,EAA0B,CAC1BC,YAAU,qBACVC,UAAWC,EAAG,wBAAyBD,MACnCnF,GAGP,CAEA,SAASyD,IAAuB0B,UAC/BA,KACGnF,IAEH,OACCS,EAAAuE,cAACC,EAAgC,CAChCC,YAAU,2BACVC,UAAWC,EAAG,gCAAiCD,MAC3CnF,GAGP,CAEA,SAAS4D,IAAkBuB,UAC1BA,KACGnF,IAEH,OAAOS,EAAAuE,cAACC,EAA2B,CAACE,UAAWC,EAAGI,IAAkBL,MAAgBnF,GACrF,CAEA,SAASgE,IAAkBmB,UAC1BA,KACGnF,IAEH,OACCS,EAAAuE,cAACC,EAA2B,CAC3BE,UAAWC,EAAGI,EAAe,CAAEC,QAAS,YAAcN,MAClDnF,GAGP","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../node_modules/@radix-ui/react-alert-dialog/dist/index.mjs","../../src/components/ui/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\n// src/alert-dialog.tsx\nimport * as React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { createDialogScope } from \"@radix-ui/react-dialog\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createSlottable } from \"@radix-ui/react-slot\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar ROOT_NAME = \"AlertDialog\";\nvar [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [\n createDialogScope\n]);\nvar useDialogScope = createDialogScope();\nvar AlertDialog = (props) => {\n const { __scopeAlertDialog, ...alertDialogProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...dialogScope, ...alertDialogProps, modal: true });\n};\nAlertDialog.displayName = ROOT_NAME;\nvar TRIGGER_NAME = \"AlertDialogTrigger\";\nvar AlertDialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...triggerProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ...dialogScope, ...triggerProps, ref: forwardedRef });\n }\n);\nAlertDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"AlertDialogPortal\";\nvar AlertDialogPortal = (props) => {\n const { __scopeAlertDialog, ...portalProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { ...dialogScope, ...portalProps });\n};\nAlertDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"AlertDialogOverlay\";\nvar AlertDialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...overlayProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { ...dialogScope, ...overlayProps, ref: forwardedRef });\n }\n);\nAlertDialogOverlay.displayName = OVERLAY_NAME;\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME);\nvar Slottable = createSlottable(\"AlertDialogContent\");\nvar AlertDialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, children, ...contentProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const cancelRef = React.useRef(null);\n return /* @__PURE__ */ jsx(\n DialogPrimitive.WarningProvider,\n {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"alert-dialog\",\n children: /* @__PURE__ */ jsx(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ jsxs(\n DialogPrimitive.Content,\n {\n role: \"alertdialog\",\n ...dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {\n event.preventDefault();\n cancelRef.current?.focus({ preventScroll: true });\n }),\n onPointerDownOutside: (event) => event.preventDefault(),\n onInteractOutside: (event) => event.preventDefault(),\n children: [\n /* @__PURE__ */ jsx(Slottable, { children }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef })\n ]\n }\n ) })\n }\n );\n }\n);\nAlertDialogContent.displayName = CONTENT_NAME;\nvar TITLE_NAME = \"AlertDialogTitle\";\nvar AlertDialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...titleProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Title, { ...dialogScope, ...titleProps, ref: forwardedRef });\n }\n);\nAlertDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"AlertDialogDescription\";\nvar AlertDialogDescription = React.forwardRef((props, forwardedRef) => {\n const { __scopeAlertDialog, ...descriptionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Description, { ...dialogScope, ...descriptionProps, ref: forwardedRef });\n});\nAlertDialogDescription.displayName = DESCRIPTION_NAME;\nvar ACTION_NAME = \"AlertDialogAction\";\nvar AlertDialogAction = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...actionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...actionProps, ref: forwardedRef });\n }\n);\nAlertDialogAction.displayName = ACTION_NAME;\nvar CANCEL_NAME = \"AlertDialogCancel\";\nvar AlertDialogCancel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...cancelProps } = props;\n const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const ref = useComposedRefs(forwardedRef, cancelRef);\n return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...cancelProps, ref });\n }\n);\nAlertDialogCancel.displayName = CANCEL_NAME;\nvar DescriptionWarning = ({ contentRef }) => {\n const MESSAGE = `\\`${CONTENT_NAME}\\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \\`${CONTENT_NAME}\\` by passing a \\`${DESCRIPTION_NAME}\\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \\`id\\` and passing the same value to the \\`aria-describedby\\` prop in \\`${CONTENT_NAME}\\`. If the description is confusing or duplicative for sighted users, you can use the \\`@radix-ui/react-visually-hidden\\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;\n React.useEffect(() => {\n const hasDescription = document.getElementById(\n contentRef.current?.getAttribute(\"aria-describedby\")\n );\n if (!hasDescription) console.warn(MESSAGE);\n }, [MESSAGE, contentRef]);\n return null;\n};\nvar Root2 = AlertDialog;\nvar Trigger2 = AlertDialogTrigger;\nvar Portal2 = AlertDialogPortal;\nvar Overlay2 = AlertDialogOverlay;\nvar Content2 = AlertDialogContent;\nvar Action = AlertDialogAction;\nvar Cancel = AlertDialogCancel;\nvar Title2 = AlertDialogTitle;\nvar Description2 = AlertDialogDescription;\nexport {\n Action,\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n Cancel,\n Content2 as Content,\n Description2 as Description,\n Overlay2 as Overlay,\n Portal2 as Portal,\n Root2 as Root,\n Title2 as Title,\n Trigger2 as Trigger,\n createAlertDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n","import * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport * as React from \"react\";\n\nimport { buttonVariants } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\nfunction AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n\treturn <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />;\n}\n\nfunction AlertDialogTrigger({\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n\treturn <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />;\n}\n\nfunction AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n\treturn <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />;\n}\n\nfunction AlertDialogOverlay({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Overlay\n\t\t\tdata-slot=\"alert-dialog-overlay\"\n\t\t\tclassName={cn(\n\t\t\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogContent({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {\n\treturn (\n\t\t<AlertDialogPortal>\n\t\t\t<AlertDialogOverlay />\n\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\tdata-slot=\"alert-dialog-content\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPortal>\n\t);\n}\n\nfunction AlertDialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-dialog-header\"\n\t\t\tclassName={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-dialog-footer\"\n\t\t\tclassName={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogTitle({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Title\n\t\t\tdata-slot=\"alert-dialog-title\"\n\t\t\tclassName={cn(\"text-lg font-semibold\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogDescription({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Description\n\t\t\tdata-slot=\"alert-dialog-description\"\n\t\t\tclassName={cn(\"text-muted-foreground text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogAction({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {\n\treturn <AlertDialogPrimitive.Action className={cn(buttonVariants(), className)} {...props} />;\n}\n\nfunction AlertDialogCancel({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Cancel\n\t\t\tclassName={cn(buttonVariants({ variant: \"outline\" }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tAlertDialog,\n\tAlertDialogPortal,\n\tAlertDialogOverlay,\n\tAlertDialogTrigger,\n\tAlertDialogContent,\n\tAlertDialogHeader,\n\tAlertDialogFooter,\n\tAlertDialogTitle,\n\tAlertDialogDescription,\n\tAlertDialogAction,\n\tAlertDialogCancel,\n};\n"],"names":["AlertDialog","DialogPrimitive.Root","AlertDialogTrigger","DialogPrimitive.Trigger","AlertDialogPortal","DialogPrimitive.Portal","AlertDialogOverlay","DialogPrimitive.Overlay","AlertDialogContent","DialogPrimitive.WarningProvider","DialogPrimitive.Content","AlertDialogTitle","DialogPrimitive.Title","AlertDialogDescription","DialogPrimitive.Description","AlertDialogAction","DialogPrimitive.Close","AlertDialogCancel","Root","Trigger","Portal","Overlay","Content","Title","Description","props","AlertDialogPrimitive","data-slot","className","cn","AlertDialogHeader","div","AlertDialogFooter","buttonVariants","variant"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAcA,IAAM,SAAA,GAAY,aAAA;AAGlB,IAAM,CAAC,wBAAA,EAA0B,sBAAsB,CAAA,GAAI,mBAAmB,SAAA,EAAW;AACvF,IAAA;AACD,CAAA,CAAA;AACD,IAAM,iBAAiB,iBAAA,EAAkB;AAKzC,IAAMA,aAAA,GAA0C,CAAC,KAAA,GAAA;AAC/C,IAAA,MAAM,EAAE,kBAAA,EAAoB,GAAG,gBAAA,EAAiB,GAAI,KAAA;IACpD,MAAM,WAAA,GAAc,eAAe,kBAAkB,CAAA;AACrD,IAAA,uBAAO,GAAA,CAAiBC,IAAA,EAAhB;AAAsB,QAAA,GAAG,WAAA;AAAc,QAAA,GAAG,gBAAA;QAAkB,KAAA,EAAO;KAAM,CAAA;AACnF,CAAA;AAEAD,aAAA,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D,EAAA;IAC1D,qBAAO,KAAA,CAAA,aAAA,CAACC,MAA2B,EAAA;AAACE,QAAAA,SAAAA,EAAWC,GAAGI,cAAAA,EAAAA,EAAkBL,SAAAA,CAAAA;AAAa,QAAA,GAAGH;;AACrF;AAEA,SAASR,iBAAAA,CAAkB,EAC1BW,SAAS,EACT,GAAGH,KAAAA,EACuD,EAAA;IAC1D,qBACC,KAAA,CAAA,aAAA,CAACC,MAA2B,EAAA;AAC3BE,QAAAA,SAAAA,EAAWC,GAAGI,cAAAA,CAAe;YAAEC,OAAAA,EAAS;SAAU,CAAA,EAAIN,SAAAA,CAAAA;AACrD,QAAA,GAAGH;;AAGP;;;;","x_google_ignoreList":[0]}
|
package/dist/avatar/index.mjs
CHANGED
@@ -1,2 +1,165 @@
|
|
1
|
-
import*
|
1
|
+
import * as React from 'react';
|
2
|
+
import { c as createContextScope } from '../chunks/index-Bl6nVRXe.mjs';
|
3
|
+
import { u as useCallbackRef } from '../chunks/index-D1yPZAOL.mjs';
|
4
|
+
import { u as useLayoutEffect2 } from '../chunks/index-Bgiaprdv.mjs';
|
5
|
+
import { P as Primitive } from '../chunks/index-fWnSEyU5.mjs';
|
6
|
+
import { r as requireShim } from '../chunks/index-BwQDLVf8.mjs';
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
8
|
+
import { c as cn } from '../chunks/utils-tbIgc9YG.mjs';
|
9
|
+
import 'react-dom';
|
10
|
+
import '@radix-ui/react-slot';
|
11
|
+
import '../chunks/bundle-mjs-CS-QKnOm.mjs';
|
12
|
+
|
13
|
+
var shimExports = requireShim();
|
14
|
+
|
15
|
+
// src/use-is-hydrated.tsx
|
16
|
+
function useIsHydrated() {
|
17
|
+
return shimExports.useSyncExternalStore(subscribe, ()=>true, ()=>false);
|
18
|
+
}
|
19
|
+
function subscribe() {
|
20
|
+
return ()=>{};
|
21
|
+
}
|
22
|
+
|
23
|
+
var AVATAR_NAME = "Avatar";
|
24
|
+
var [createAvatarContext, createAvatarScope] = createContextScope(AVATAR_NAME);
|
25
|
+
var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);
|
26
|
+
var Avatar$1 = React.forwardRef((props, forwardedRef)=>{
|
27
|
+
const { __scopeAvatar, ...avatarProps } = props;
|
28
|
+
const [imageLoadingStatus, setImageLoadingStatus] = React.useState("idle");
|
29
|
+
return /* @__PURE__ */ jsx(AvatarProvider, {
|
30
|
+
scope: __scopeAvatar,
|
31
|
+
imageLoadingStatus,
|
32
|
+
onImageLoadingStatusChange: setImageLoadingStatus,
|
33
|
+
children: /* @__PURE__ */ jsx(Primitive.span, {
|
34
|
+
...avatarProps,
|
35
|
+
ref: forwardedRef
|
36
|
+
})
|
37
|
+
});
|
38
|
+
});
|
39
|
+
Avatar$1.displayName = AVATAR_NAME;
|
40
|
+
var IMAGE_NAME = "AvatarImage";
|
41
|
+
var AvatarImage$1 = React.forwardRef((props, forwardedRef)=>{
|
42
|
+
const { __scopeAvatar, src, onLoadingStatusChange = ()=>{}, ...imageProps } = props;
|
43
|
+
const context = useAvatarContext(IMAGE_NAME, __scopeAvatar);
|
44
|
+
const imageLoadingStatus = useImageLoadingStatus(src, imageProps);
|
45
|
+
const handleLoadingStatusChange = useCallbackRef((status)=>{
|
46
|
+
onLoadingStatusChange(status);
|
47
|
+
context.onImageLoadingStatusChange(status);
|
48
|
+
});
|
49
|
+
useLayoutEffect2(()=>{
|
50
|
+
if (imageLoadingStatus !== "idle") {
|
51
|
+
handleLoadingStatusChange(imageLoadingStatus);
|
52
|
+
}
|
53
|
+
}, [
|
54
|
+
imageLoadingStatus,
|
55
|
+
handleLoadingStatusChange
|
56
|
+
]);
|
57
|
+
return imageLoadingStatus === "loaded" ? /* @__PURE__ */ jsx(Primitive.img, {
|
58
|
+
...imageProps,
|
59
|
+
ref: forwardedRef,
|
60
|
+
src
|
61
|
+
}) : null;
|
62
|
+
});
|
63
|
+
AvatarImage$1.displayName = IMAGE_NAME;
|
64
|
+
var FALLBACK_NAME = "AvatarFallback";
|
65
|
+
var AvatarFallback$1 = React.forwardRef((props, forwardedRef)=>{
|
66
|
+
const { __scopeAvatar, delayMs, ...fallbackProps } = props;
|
67
|
+
const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar);
|
68
|
+
const [canRender, setCanRender] = React.useState(delayMs === void 0);
|
69
|
+
React.useEffect(()=>{
|
70
|
+
if (delayMs !== void 0) {
|
71
|
+
const timerId = window.setTimeout(()=>setCanRender(true), delayMs);
|
72
|
+
return ()=>window.clearTimeout(timerId);
|
73
|
+
}
|
74
|
+
}, [
|
75
|
+
delayMs
|
76
|
+
]);
|
77
|
+
return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ jsx(Primitive.span, {
|
78
|
+
...fallbackProps,
|
79
|
+
ref: forwardedRef
|
80
|
+
}) : null;
|
81
|
+
});
|
82
|
+
AvatarFallback$1.displayName = FALLBACK_NAME;
|
83
|
+
function resolveLoadingStatus(image, src) {
|
84
|
+
if (!image) {
|
85
|
+
return "idle";
|
86
|
+
}
|
87
|
+
if (!src) {
|
88
|
+
return "error";
|
89
|
+
}
|
90
|
+
if (image.src !== src) {
|
91
|
+
image.src = src;
|
92
|
+
}
|
93
|
+
return image.complete && image.naturalWidth > 0 ? "loaded" : "loading";
|
94
|
+
}
|
95
|
+
function useImageLoadingStatus(src, { referrerPolicy, crossOrigin }) {
|
96
|
+
const isHydrated = useIsHydrated();
|
97
|
+
const imageRef = React.useRef(null);
|
98
|
+
const image = (()=>{
|
99
|
+
if (!isHydrated) return null;
|
100
|
+
if (!imageRef.current) {
|
101
|
+
imageRef.current = new window.Image();
|
102
|
+
}
|
103
|
+
return imageRef.current;
|
104
|
+
})();
|
105
|
+
const [loadingStatus, setLoadingStatus] = React.useState(()=>resolveLoadingStatus(image, src));
|
106
|
+
useLayoutEffect2(()=>{
|
107
|
+
setLoadingStatus(resolveLoadingStatus(image, src));
|
108
|
+
}, [
|
109
|
+
image,
|
110
|
+
src
|
111
|
+
]);
|
112
|
+
useLayoutEffect2(()=>{
|
113
|
+
const updateStatus = (status)=>()=>{
|
114
|
+
setLoadingStatus(status);
|
115
|
+
};
|
116
|
+
if (!image) return;
|
117
|
+
const handleLoad = updateStatus("loaded");
|
118
|
+
const handleError = updateStatus("error");
|
119
|
+
image.addEventListener("load", handleLoad);
|
120
|
+
image.addEventListener("error", handleError);
|
121
|
+
if (referrerPolicy) {
|
122
|
+
image.referrerPolicy = referrerPolicy;
|
123
|
+
}
|
124
|
+
if (typeof crossOrigin === "string") {
|
125
|
+
image.crossOrigin = crossOrigin;
|
126
|
+
}
|
127
|
+
return ()=>{
|
128
|
+
image.removeEventListener("load", handleLoad);
|
129
|
+
image.removeEventListener("error", handleError);
|
130
|
+
};
|
131
|
+
}, [
|
132
|
+
image,
|
133
|
+
crossOrigin,
|
134
|
+
referrerPolicy
|
135
|
+
]);
|
136
|
+
return loadingStatus;
|
137
|
+
}
|
138
|
+
var Root = Avatar$1;
|
139
|
+
var Image = AvatarImage$1;
|
140
|
+
var Fallback = AvatarFallback$1;
|
141
|
+
|
142
|
+
function Avatar({ className, ...props }) {
|
143
|
+
return /*#__PURE__*/ React.createElement(Root, {
|
144
|
+
"data-slot": "avatar",
|
145
|
+
className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className),
|
146
|
+
...props
|
147
|
+
});
|
148
|
+
}
|
149
|
+
function AvatarImage({ className, ...props }) {
|
150
|
+
return /*#__PURE__*/ React.createElement(Image, {
|
151
|
+
"data-slot": "avatar-image",
|
152
|
+
className: cn("aspect-square h-full w-full", className),
|
153
|
+
...props
|
154
|
+
});
|
155
|
+
}
|
156
|
+
function AvatarFallback({ className, ...props }) {
|
157
|
+
return /*#__PURE__*/ React.createElement(Fallback, {
|
158
|
+
"data-slot": "avatar-fallback",
|
159
|
+
className: cn("bg-muted flex h-full w-full items-center justify-center rounded-full", className),
|
160
|
+
...props
|
161
|
+
});
|
162
|
+
}
|
163
|
+
|
164
|
+
export { Avatar, AvatarFallback, AvatarImage };
|
2
165
|
//# sourceMappingURL=index.mjs.map
|