@techzyapp/ui-library 1.0.39 → 1.0.40
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/{AdminRoot-B2lwjQig.cjs → AdminRoot-CRTBGUxq.cjs} +2 -2
- package/dist/{AdminRoot-B2lwjQig.cjs.map → AdminRoot-CRTBGUxq.cjs.map} +1 -1
- package/dist/{AdminRoot-BTPLhufU.js → AdminRoot-JOgiNkJA.js} +3 -3
- package/dist/{AdminRoot-BTPLhufU.js.map → AdminRoot-JOgiNkJA.js.map} +1 -1
- package/dist/{CodeBlock-BbIC5BRK.cjs → CodeBlock-C3mG_seZ.cjs} +2 -2
- package/dist/{CodeBlock-BbIC5BRK.cjs.map → CodeBlock-C3mG_seZ.cjs.map} +1 -1
- package/dist/{CodeBlock-C8A6E-tJ.js → CodeBlock-DrWRSRmO.js} +2 -2
- package/dist/{CodeBlock-C8A6E-tJ.js.map → CodeBlock-DrWRSRmO.js.map} +1 -1
- package/dist/{ColorRamp-B_-ZPqMa.cjs → ColorRamp-D9_5JULy.cjs} +2 -2
- package/dist/{ColorRamp-B_-ZPqMa.cjs.map → ColorRamp-D9_5JULy.cjs.map} +1 -1
- package/dist/{ColorRamp-CCfImssD.js → ColorRamp-Mp_ddhmb.js} +2 -2
- package/dist/{ColorRamp-CCfImssD.js.map → ColorRamp-Mp_ddhmb.js.map} +1 -1
- package/dist/{CopyButton-CUEEp_Na.cjs → CopyButton-DZeYcG68.cjs} +2 -2
- package/dist/CopyButton-DZeYcG68.cjs.map +1 -0
- package/dist/{CopyButton-BD5sN32G.js → CopyButton-Yg5ZVTiX.js} +2 -2
- package/dist/CopyButton-Yg5ZVTiX.js.map +1 -0
- package/dist/{DescriptionList-BD65gv7C.js → DescriptionList-CG08_qwT.js} +2 -2
- package/dist/{DescriptionList-BD65gv7C.js.map → DescriptionList-CG08_qwT.js.map} +1 -1
- package/dist/{DescriptionList-BlAJIabM.cjs → DescriptionList-S9C6Tp90.cjs} +2 -2
- package/dist/{DescriptionList-BlAJIabM.cjs.map → DescriptionList-S9C6Tp90.cjs.map} +1 -1
- package/dist/{ErrorBoundary-sQY2sFdu.js → ErrorBoundary-BILk_3fM.js} +2 -2
- package/dist/{ErrorBoundary-sQY2sFdu.js.map → ErrorBoundary-BILk_3fM.js.map} +1 -1
- package/dist/{ErrorBoundary-6HvsCoJ8.cjs → ErrorBoundary-JCNa0_Ys.cjs} +2 -2
- package/dist/{ErrorBoundary-6HvsCoJ8.cjs.map → ErrorBoundary-JCNa0_Ys.cjs.map} +1 -1
- package/dist/{ErrorState-DdxOeZy2.js → ErrorState-DI28ZCJN.js} +3 -3
- package/dist/{ErrorState-DdxOeZy2.js.map → ErrorState-DI28ZCJN.js.map} +1 -1
- package/dist/{ErrorState-To_MAOf4.cjs → ErrorState-MQBeyF2n.cjs} +2 -2
- package/dist/{ErrorState-To_MAOf4.cjs.map → ErrorState-MQBeyF2n.cjs.map} +1 -1
- package/dist/{FileUploader-CWH-RS-z.js → FileUploader-DwAl3UXI.js} +2 -2
- package/dist/{FileUploader-CWH-RS-z.js.map → FileUploader-DwAl3UXI.js.map} +1 -1
- package/dist/{FileUploader-H4k4Cm5B.cjs → FileUploader-FMVbj7rz.cjs} +2 -2
- package/dist/{FileUploader-H4k4Cm5B.cjs.map → FileUploader-FMVbj7rz.cjs.map} +1 -1
- package/dist/{LocationPicker-CHGJkMXl.js → LocationPicker-Ce8aLubZ.js} +3 -3
- package/dist/{LocationPicker-CHGJkMXl.js.map → LocationPicker-Ce8aLubZ.js.map} +1 -1
- package/dist/{LocationPicker-CgzZnTFE.cjs → LocationPicker-D-sT4rSe.cjs} +2 -2
- package/dist/{LocationPicker-CgzZnTFE.cjs.map → LocationPicker-D-sT4rSe.cjs.map} +1 -1
- package/dist/Modal-DTnB_mGg.js +206 -0
- package/dist/Modal-DTnB_mGg.js.map +1 -0
- package/dist/Modal-DjSOhZqd.cjs +2 -0
- package/dist/Modal-DjSOhZqd.cjs.map +1 -0
- package/dist/{PageError-9tfvBssn.js → PageError-BORFaxGW.js} +2 -2
- package/dist/{PageError-9tfvBssn.js.map → PageError-BORFaxGW.js.map} +1 -1
- package/dist/{PageError-CJHOUfCa.cjs → PageError-aUV0vUfB.cjs} +2 -2
- package/dist/{PageError-CJHOUfCa.cjs.map → PageError-aUV0vUfB.cjs.map} +1 -1
- package/dist/{PaletteField-AMZpUMID.js → PaletteField-ChG2VQtS.js} +2 -2
- package/dist/{PaletteField-AMZpUMID.js.map → PaletteField-ChG2VQtS.js.map} +1 -1
- package/dist/{PaletteField-ClCvXFdN.cjs → PaletteField-DQ1OvXqe.cjs} +2 -2
- package/dist/{PaletteField-ClCvXFdN.cjs.map → PaletteField-DQ1OvXqe.cjs.map} +1 -1
- package/dist/{RemoveDialog-yEZm6JaC.cjs → RemoveDialog-B_Y18MeJ.cjs} +2 -2
- package/dist/{RemoveDialog-yEZm6JaC.cjs.map → RemoveDialog-B_Y18MeJ.cjs.map} +1 -1
- package/dist/{RemoveDialog-BfPTOs1y.js → RemoveDialog-ayAfGXpB.js} +2 -2
- package/dist/{RemoveDialog-BfPTOs1y.js.map → RemoveDialog-ayAfGXpB.js.map} +1 -1
- package/dist/{RichTextEditor-CitILCiw.cjs → RichTextEditor-DSvSaszc.cjs} +2 -2
- package/dist/{RichTextEditor-CitILCiw.cjs.map → RichTextEditor-DSvSaszc.cjs.map} +1 -1
- package/dist/{RichTextEditor-CgItVhAR.js → RichTextEditor-itYD1PfE.js} +2 -2
- package/dist/{RichTextEditor-CgItVhAR.js.map → RichTextEditor-itYD1PfE.js.map} +1 -1
- package/dist/{RootLayout-CVYEk7Wi.js → RootLayout-BlYjYAYk.js} +3 -3
- package/dist/{RootLayout-CVYEk7Wi.js.map → RootLayout-BlYjYAYk.js.map} +1 -1
- package/dist/{RootLayout-DJ2Xv35m.cjs → RootLayout-D5nlzYlH.cjs} +2 -2
- package/dist/{RootLayout-DJ2Xv35m.cjs.map → RootLayout-D5nlzYlH.cjs.map} +1 -1
- package/dist/{SpeedDial-C2hkC_8p.js → SpeedDial-CEBAWIYo.js} +2 -2
- package/dist/{SpeedDial-C2hkC_8p.js.map → SpeedDial-CEBAWIYo.js.map} +1 -1
- package/dist/{SpeedDial-DRSIilyC.cjs → SpeedDial-D6me6w_m.cjs} +2 -2
- package/dist/{SpeedDial-DRSIilyC.cjs.map → SpeedDial-D6me6w_m.cjs.map} +1 -1
- package/dist/{Table-DDPzTA1H.cjs → Table-CFl3OYlo.cjs} +2 -2
- package/dist/{Table-DDPzTA1H.cjs.map → Table-CFl3OYlo.cjs.map} +1 -1
- package/dist/{Table-AXMp0eiw.js → Table-DChIfjqj.js} +2 -2
- package/dist/{Table-AXMp0eiw.js.map → Table-DChIfjqj.js.map} +1 -1
- package/dist/Tooltip-BbT0uNzy.js +152 -0
- package/dist/Tooltip-BbT0uNzy.js.map +1 -0
- package/dist/Tooltip-DmMq5R1x.cjs +2 -0
- package/dist/Tooltip-DmMq5R1x.cjs.map +1 -0
- package/dist/components/CodeBlock/index.cjs +1 -1
- package/dist/components/CodeBlock/index.js +1 -1
- package/dist/components/ColorRamp/index.cjs +1 -1
- package/dist/components/ColorRamp/index.js +1 -1
- package/dist/components/CopyButton/CopyButton.d.cts +1 -1
- package/dist/components/CopyButton/CopyButton.d.ts +1 -1
- package/dist/components/CopyButton/index.cjs +1 -1
- package/dist/components/CopyButton/index.js +1 -1
- package/dist/components/DescriptionList/index.cjs +1 -1
- package/dist/components/DescriptionList/index.js +1 -1
- package/dist/components/ErrorState/index.cjs +1 -1
- package/dist/components/ErrorState/index.js +2 -2
- package/dist/components/FileUploader/index.cjs +1 -1
- package/dist/components/FileUploader/index.js +1 -1
- package/dist/components/LocationPicker/index.cjs +1 -1
- package/dist/components/LocationPicker/index.js +1 -1
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/PageError/index.cjs +1 -1
- package/dist/components/PageError/index.js +1 -1
- package/dist/components/PaletteField/index.cjs +1 -1
- package/dist/components/PaletteField/index.js +1 -1
- package/dist/components/RemoveDialog/index.cjs +1 -1
- package/dist/components/RemoveDialog/index.js +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RootLayout/index.cjs +1 -1
- package/dist/components/RootLayout/index.js +1 -1
- package/dist/components/SpeedDial/index.cjs +1 -1
- package/dist/components/SpeedDial/index.js +1 -1
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.cts +5 -3
- package/dist/components/Tooltip/Tooltip.d.ts +5 -3
- package/dist/components/Tooltip/index.cjs +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/entries/app.cjs +1 -1
- package/dist/entries/app.js +1 -1
- package/dist/entries/components.cjs +1 -1
- package/dist/entries/components.js +17 -17
- package/dist/index.cjs +1 -1
- package/dist/index.js +18 -18
- package/package.json +1 -1
- package/dist/CopyButton-BD5sN32G.js.map +0 -1
- package/dist/CopyButton-CUEEp_Na.cjs.map +0 -1
- package/dist/Modal-BkO_6afj.js +0 -195
- package/dist/Modal-BkO_6afj.js.map +0 -1
- package/dist/Modal-D8V-JZBg.cjs +0 -2
- package/dist/Modal-D8V-JZBg.cjs.map +0 -1
- package/dist/Tooltip-Bw-1Xk2Z.cjs +0 -2
- package/dist/Tooltip-Bw-1Xk2Z.cjs.map +0 -1
- package/dist/Tooltip-DsDv4NOq.js +0 -135
- package/dist/Tooltip-DsDv4NOq.js.map +0 -1
|
@@ -13,22 +13,22 @@ import { C as B } from "../Checkbox-DyKBIgVT.js";
|
|
|
13
13
|
import { C as L } from "../Chip-D5ZZs3QH.js";
|
|
14
14
|
import { C as A, a as M } from "../ChoiceCardGroup-Cx8CtmPl.js";
|
|
15
15
|
import { C as y } from "../Code-DaEpXHfF.js";
|
|
16
|
-
import { C as N } from "../CodeBlock-
|
|
16
|
+
import { C as N } from "../CodeBlock-DrWRSRmO.js";
|
|
17
17
|
import { C as G, R as O } from "../Col-B51RlwWP.js";
|
|
18
18
|
import { C as Q } from "../ColorPicker-w7NdprlW.js";
|
|
19
|
-
import { C as _ } from "../ColorRamp-
|
|
20
|
-
import { C as z } from "../CopyButton-
|
|
19
|
+
import { C as _ } from "../ColorRamp-Mp_ddhmb.js";
|
|
20
|
+
import { C as z } from "../CopyButton-Yg5ZVTiX.js";
|
|
21
21
|
import { D as V } from "../DashedButton-csz6Jt_K.js";
|
|
22
22
|
import { D as j } from "../DatePicker-BMJlfCKB.js";
|
|
23
23
|
import { D as K } from "../DateTimePicker-B-Jjejzm.js";
|
|
24
|
-
import { D as Y } from "../DescriptionList-
|
|
24
|
+
import { D as Y } from "../DescriptionList-CG08_qwT.js";
|
|
25
25
|
import { D as $ } from "../Divider-LtH3dLgw.js";
|
|
26
26
|
import { D as or } from "../Dropdown-CcC-Hwx4.js";
|
|
27
27
|
import { E as ar } from "../EmptyState-BCoPw8jf.js";
|
|
28
|
-
import { E as sr, Q as pr } from "../ErrorBoundary-
|
|
29
|
-
import { E as xr } from "../ErrorState-
|
|
28
|
+
import { E as sr, Q as pr } from "../ErrorBoundary-BILk_3fM.js";
|
|
29
|
+
import { E as xr } from "../ErrorState-DI28ZCJN.js";
|
|
30
30
|
import { F as ir } from "../FileCard-5QvVkO1-.js";
|
|
31
|
-
import { F as dr } from "../FileUploader-
|
|
31
|
+
import { F as dr } from "../FileUploader-DwAl3UXI.js";
|
|
32
32
|
import { F as cr, S as nr } from "../Sidebar-Dg15hPpM.js";
|
|
33
33
|
import { F as Fr } from "../Flag-DfA2t0yd.js";
|
|
34
34
|
import { F as Pr } from "../Flex-BFn4P1tJ.js";
|
|
@@ -41,35 +41,35 @@ import { L as Or } from "../Link-BQlvsu9V.js";
|
|
|
41
41
|
import { L as Qr } from "../List-CwuAJDTi.js";
|
|
42
42
|
import { L as _r } from "../ListItem-BWNIbyTh.js";
|
|
43
43
|
import { L as zr } from "../Loader-Bj5uwVR9.js";
|
|
44
|
-
import { L as Vr, T as Wr } from "../LocationPicker-
|
|
44
|
+
import { L as Vr, T as Wr } from "../LocationPicker-Ce8aLubZ.js";
|
|
45
45
|
import { M as Jr } from "../Masonry-BsRWG-oN.js";
|
|
46
|
-
import { M as Xr } from "../Modal-
|
|
46
|
+
import { M as Xr } from "../Modal-DTnB_mGg.js";
|
|
47
47
|
import { M as Zr } from "../MultiSelect-Dn8l5z52.js";
|
|
48
48
|
import { M as ro } from "../MultilineTextField-DJ26nTdF.js";
|
|
49
49
|
import { N as eo } from "../NumberField-DvQ5UP1R.js";
|
|
50
50
|
import { O as to } from "../OtpField-Dy4O1MeD.js";
|
|
51
|
-
import { P as po } from "../PageError-
|
|
51
|
+
import { P as po } from "../PageError-BORFaxGW.js";
|
|
52
52
|
import { P as xo } from "../PageLayout-ojiBEcxI.js";
|
|
53
53
|
import { P as io } from "../PageNotFound-D536Tshv.js";
|
|
54
54
|
import { P as To } from "../Pagination-DoDGKGpQ.js";
|
|
55
|
-
import { P as no } from "../PaletteField-
|
|
55
|
+
import { P as no } from "../PaletteField-ChG2VQtS.js";
|
|
56
56
|
import { P as Fo, i as uo } from "../PhoneField-CjYw-Unw.js";
|
|
57
57
|
import { P as go } from "../Popconfirm-B3GhhrRM.js";
|
|
58
58
|
import { P as Eo } from "../Popover-WaVH3jsN.js";
|
|
59
59
|
import { P as ho } from "../Progress-ZNQrxw_Q.js";
|
|
60
60
|
import { Q as Do } from "../QrCode-B9YbQNVc.js";
|
|
61
61
|
import { R as Ro, a as Ao } from "../RadioGroup-CD209tlb.js";
|
|
62
|
-
import { R as ko } from "../RemoveDialog-
|
|
63
|
-
import { R as bo } from "../RichTextEditor-
|
|
64
|
-
import { R as vo } from "../RootLayout-
|
|
62
|
+
import { R as ko } from "../RemoveDialog-ayAfGXpB.js";
|
|
63
|
+
import { R as bo } from "../RichTextEditor-itYD1PfE.js";
|
|
64
|
+
import { R as vo } from "../RootLayout-BlYjYAYk.js";
|
|
65
65
|
import { S as Oo } from "../Select-K0a_7ROf.js";
|
|
66
66
|
import { S as Qo } from "../Skeleton-_-uGax2j.js";
|
|
67
67
|
import { S as _o } from "../Slider-CwZYxDO0.js";
|
|
68
|
-
import { S as zo, a as Ho } from "../SpeedDial-
|
|
68
|
+
import { S as zo, a as Ho } from "../SpeedDial-CEBAWIYo.js";
|
|
69
69
|
import { S as Wo } from "../Stepper-BN0GsRZW.js";
|
|
70
70
|
import { S as Jo } from "../SwatchPicker-BZHRELA-.js";
|
|
71
71
|
import { S as Xo } from "../Switch-Jh2Ch8GO.js";
|
|
72
|
-
import { T as Zo } from "../Table-
|
|
72
|
+
import { T as Zo } from "../Table-DChIfjqj.js";
|
|
73
73
|
import { T as re } from "../Tabs-DfVFgOfs.js";
|
|
74
74
|
import { T as ee } from "../TagsField-CoBRqcjW.js";
|
|
75
75
|
import { T as te } from "../TextField-0gFvIFs8.js";
|
|
@@ -78,7 +78,7 @@ import { T as xe } from "../TimePicker-Bv2qIFf9.js";
|
|
|
78
78
|
import { T as ie, a as le } from "../Timeline-Cb1krSlo.js";
|
|
79
79
|
import { T as Te } from "../Toaster-Fq6-ImDJ.js";
|
|
80
80
|
import { T as ne, a as Ce } from "../ToggleButtonGroup-Mdskkjdh.js";
|
|
81
|
-
import { T as ue } from "../Tooltip-
|
|
81
|
+
import { T as ue } from "../Tooltip-BbT0uNzy.js";
|
|
82
82
|
import { T as ge } from "../TranslatedFields-CmRhRGC_.js";
|
|
83
83
|
import { T as Ee } from "../Typography-ChSuxgkc.js";
|
|
84
84
|
import { U as he } from "../UserCard-DcTLEHFu.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./Form-Bz2xgkEm.cjs"),s=require("./useForm-CSw6r1n1.cjs"),L=require("./useLockBodyScroll-CIXHZo-Q.cjs"),l=require("./useMediaQuery-CHMrI6Dy.cjs"),h=require("./useClipboard-BjTIX-4g.cjs"),a=require("./access-DPUHbE-S.cjs"),e=require("./ConfigProvider-B_Bb6pk1.cjs"),n=require("./messages-h22vS9zn.cjs"),t=require("./translations-CXEeeUDL.cjs"),d=require("./table-CZRQGNdk.cjs"),r=require("./palette-BycMHbED.cjs"),D=require("./AuthGuard-kfOZviar.cjs"),R=require("./authLayoutRoute-BVQ4LhuU.cjs"),b=require("./AdminRoot-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./Form-Bz2xgkEm.cjs"),s=require("./useForm-CSw6r1n1.cjs"),L=require("./useLockBodyScroll-CIXHZo-Q.cjs"),l=require("./useMediaQuery-CHMrI6Dy.cjs"),h=require("./useClipboard-BjTIX-4g.cjs"),a=require("./access-DPUHbE-S.cjs"),e=require("./ConfigProvider-B_Bb6pk1.cjs"),n=require("./messages-h22vS9zn.cjs"),t=require("./translations-CXEeeUDL.cjs"),d=require("./table-CZRQGNdk.cjs"),r=require("./palette-BycMHbED.cjs"),D=require("./AuthGuard-kfOZviar.cjs"),R=require("./authLayoutRoute-BVQ4LhuU.cjs"),b=require("./AdminRoot-CRTBGUxq.cjs"),T=require("./Accordion-B4vdZXIu.cjs"),B=require("./Alert-CY8iU1zd.cjs"),_=require("./AuthLayout-exuNQicH.cjs"),k=require("./Avatar-l48Ice6t.cjs"),I=require("./AvatarGroup-CuvFX4di.cjs"),u=require("./breakpoints-Dpnh6BbG.cjs"),N=require("./Badge-DVbe1rAI.cjs"),M=require("./Blockquote-BWGxIL_V.cjs"),Q=require("./Breadcrumbs-hi6dJhfN.cjs"),U=require("./Button-CYZoF18-.cjs"),v=require("./Card-CkZtVNyV.cjs"),K=require("./Checkbox-CTp1xFW7.cjs"),O=require("./Chip-B7cAHjlx.cjs"),q=require("./ChoiceCardGroup-143hR0v_.cjs"),f=require("./Code-CUdpWlY5.cjs"),G=require("./CodeBlock-C3mG_seZ.cjs"),E=require("./Col-BdQeyKEX.cjs"),x=require("./ColorPicker-C1pDI4su.cjs"),Y=require("./ColorRamp-D9_5JULy.cjs"),w=require("./CopyButton-DZeYcG68.cjs"),H=require("./DashedButton-Dw7xHgIp.cjs"),z=require("./DatePicker-CXRsT-lt.cjs"),V=require("./DateTimePicker-BuTIRTUX.cjs"),W=require("./DescriptionList-S9C6Tp90.cjs"),j=require("./Divider-CzbhdCiD.cjs"),J=require("./Dropdown-DYYhzKSo.cjs"),X=require("./EmptyState-DnGds1ch.cjs"),p=require("./ErrorBoundary-JCNa0_Ys.cjs"),Z=require("./ErrorState-MQBeyF2n.cjs"),$=require("./FileCard-Cl88Gu6L.cjs"),ee=require("./FileUploader-FMVbj7rz.cjs"),g=require("./Sidebar-C3-u3Agj.cjs"),re=require("./Flag-Do7x-AhS.cjs"),oe=require("./Flex-C6tHC8n7.cjs"),te=require("./FullscreenToggle-Bbb_z2xj.cjs"),ie=require("./Grid-frN0D9lR.cjs"),i=require("./Icon-B6lz-V0A.cjs"),c=require("./MobileFrame-Dsfgd_4k.cjs"),se=require("./IconButton-CQ25TtBc.cjs"),ae=require("./Link-GZT51mKx.cjs"),ue=require("./List-B5Ppe9R1.cjs"),ne=require("./ListItem-Qo1Tt6Fi.cjs"),ce=require("./Loader-B5Pm8AaT.cjs"),F=require("./LocationPicker-D-sT4rSe.cjs"),le=require("./Masonry-9LrJKlhI.cjs"),de=require("./Modal-DjSOhZqd.cjs"),Te=require("./MultiSelect-C4RvohFY.cjs"),qe=require("./MultilineTextField-ihcPDX3D.cjs"),Ee=require("./NumberField-C3TLdAgT.cjs"),pe=require("./OtpField-OdkuKKcV.cjs"),ge=require("./PageError-aUV0vUfB.cjs"),Fe=require("./PageLayout-rtEl8uqS.cjs"),Ae=require("./PageNotFound-f-dxrnol.cjs"),Se=require("./Pagination-Ffv6IFIU.cjs"),ye=require("./PaletteField-DQ1OvXqe.cjs"),A=require("./PhoneField-DzLTXJcw.cjs"),Pe=require("./Popconfirm-CYc8ywDI.cjs"),Ce=require("./Popover-DsYUT23r.cjs"),me=require("./Progress-BABBBG2y.cjs"),Le=require("./QrCode-CNVYpz9j.cjs"),S=require("./RadioGroup-687BVZ7k.cjs"),he=require("./RemoveDialog-B_Y18MeJ.cjs"),De=require("./RichTextEditor-DSvSaszc.cjs"),Re=require("./RootLayout-D5nlzYlH.cjs"),be=require("./Select-1FWkryTK.cjs"),Be=require("./Skeleton-DK0lAjS9.cjs"),_e=require("./Slider-0joKXhPo.cjs"),y=require("./SpeedDial-D6me6w_m.cjs"),ke=require("./Stepper-wPPs57uZ.cjs"),Ie=require("./SwatchPicker-0gnOvv7U.cjs"),Ne=require("./Switch-DSs2Y0IR.cjs"),Me=require("./Table-CFl3OYlo.cjs"),Qe=require("./Tabs-BAKPWO4g.cjs"),Ue=require("./TagsField-5mbyaFQZ.cjs"),ve=require("./TextField-BL6OAJcP.cjs"),Ke=require("./ThemeToggle-BgKfcb02.cjs"),Oe=require("./TimePicker-6nHQx0P5.cjs"),P=require("./Timeline-CmluHBIT.cjs"),fe=require("./Toaster-Brcspf7v.cjs"),C=require("./ToggleButtonGroup-Ci_DFvdt.cjs"),Ge=require("./Tooltip-DmMq5R1x.cjs"),xe=require("./TranslatedFields-CVc0NvXa.cjs"),Ye=require("./Typography-d97DdbNd.cjs"),we=require("./UserCard-1ubnvBV6.cjs"),o=require("./errorMessage-C7N4KvUS.cjs"),He=require("./toastStore-B4Tk2Xk7.cjs");exports.Form=m.Form;exports.useDisclosure=s.useDisclosure;exports.useForm=s.useForm;exports.useQueryModal=s.useQueryModal;exports.useTableQuery=s.useTableQuery;exports.useLockBodyScroll=L.useLockBodyScroll;exports.useBreakpointMatches=l.useBreakpointMatches;exports.useMediaQuery=l.useMediaQuery;exports.useClipboard=h.useClipboard;exports.getAccessKeys=a.getAccessKeys;exports.hasAccess=a.hasAccess;exports.setAccessKeys=a.setAccessKeys;exports.useAccessKeys=a.useAccessKeys;exports.ConfigProvider=e.ConfigProvider;exports.DEFAULT_FONT_FAMILY=e.DEFAULT_FONT_FAMILY;exports.DEFAULT_NESTED_TAB_QUERY_KEY=e.DEFAULT_NESTED_TAB_QUERY_KEY;exports.DEFAULT_STEP_QUERY_KEY=e.DEFAULT_STEP_QUERY_KEY;exports.DEFAULT_TABS_QUERY_KEY=e.DEFAULT_TABS_QUERY_KEY;exports.applyTheme=e.applyTheme;exports.useColorMode=e.useColorMode;exports.useHeaderConfig=e.useHeaderConfig;exports.useLanguage=e.useLanguage;exports.useLocales=e.useLocales;exports.useMapsConfig=e.useMapsConfig;exports.useNestedTabQueryKey=e.useNestedTabQueryKey;exports.useStepQueryKey=e.useStepQueryKey;exports.useT=e.useT;exports.useTableQueryConfig=e.useTableQueryConfig;exports.useTabsQueryKey=e.useTabsQueryKey;exports.useTheme=e.useTheme;exports.useTranslations=e.useTranslations;exports.useTranslationsNamespace=e.useTranslationsNamespace;exports.createAppTranslator=n.createAppTranslator;exports.createTranslator=n.createTranslator;exports.flagFor=n.flagFor;exports.DEFAULT_TRANSLATIONS_NAMESPACE=t.DEFAULT_TRANSLATIONS_NAMESPACE;exports.buildTranslationName=t.buildTranslationName;exports.buildTranslations=t.buildTranslations;exports.flattenTranslations=t.flattenTranslations;exports.nestTranslations=t.nestTranslations;exports.toFormData=t.toFormData;exports.buildTableQuery=d.buildTableQuery;exports.parseTableQuery=d.parseTableQuery;exports.BASE_STEP=r.BASE_STEP;exports.DEFAULT_PALETTE_SHADE=r.DEFAULT_PALETTE_SHADE;exports.DEFAULT_PALETTE_TINT=r.DEFAULT_PALETTE_TINT;exports.PALETTE_STEPS=r.PALETTE_STEPS;exports.contrastRatio=r.contrastRatio;exports.generatePalette=r.generatePalette;exports.legibility=r.legibility;exports.rateContrast=r.rateContrast;exports.relativeLuminance=r.relativeLuminance;exports.AuthGuard=D.AuthGuard;exports.authLayoutRoute=R.authLayoutRoute;exports.AdminRoot=b.AdminRoot;exports.Accordion=T.Accordion;exports.AccordionItem=T.AccordionItem;exports.Alert=B.Alert;exports.AuthLayout=_.AuthLayout;exports.Avatar=k.Avatar;exports.AvatarGroup=I.AvatarGroup;exports.BREAKPOINTS=u.BREAKPOINTS;exports.BREAKPOINT_ORDER=u.BREAKPOINT_ORDER;exports.breakpointQuery=u.breakpointQuery;exports.resolveResponsive=u.resolveResponsive;exports.Badge=N.Badge;exports.Blockquote=M.Blockquote;exports.Breadcrumbs=Q.Breadcrumbs;exports.Button=U.Button;exports.Card=v.Card;exports.Checkbox=K.Checkbox;exports.Chip=O.Chip;exports.ChoiceCard=q.ChoiceCard;exports.ChoiceCardGroup=q.ChoiceCardGroup;exports.Code=f.Code;exports.CodeBlock=G.CodeBlock;exports.Col=E.Col;exports.Row=E.Row;exports.ColorPicker=x.ColorPicker;exports.ColorRamp=Y.ColorRamp;exports.CopyButton=w.CopyButton;exports.DashedButton=H.DashedButton;exports.DatePicker=z.DatePicker;exports.DateTimePicker=V.DateTimePicker;exports.DescriptionList=W.DescriptionList;exports.Divider=j.Divider;exports.Dropdown=J.Dropdown;exports.EmptyState=X.EmptyState;exports.ErrorBoundary=p.ErrorBoundary;exports.QueryError=p.QueryError;exports.ErrorState=Z.ErrorState;exports.FileCard=$.FileCard;exports.FileUploader=ee.FileUploader;exports.FirstRouteRedirect=g.FirstRouteRedirect;exports.Sidebar=g.Sidebar;exports.Flag=re.Flag;exports.Flex=oe.Flex;exports.FullscreenToggle=te.FullscreenToggle;exports.Grid=ie.Grid;exports.ICON_COUNT=i.ICON_COUNT;exports.ICON_NAMES=i.ICON_NAMES;exports.Icon=i.Icon;exports.loadIcon=i.loadIcon;exports.preloadIcons=i.preloadIcons;exports.IPHONE_FRAME=c.IPHONE_FRAME;exports.MobileFrame=c.MobileFrame;exports.frameWidthFor=c.frameWidthFor;exports.IconButton=se.IconButton;exports.Link=ae.Link;exports.List=ue.List;exports.ListItem=ne.ListItem;exports.Loader=ce.Loader;exports.LocationPicker=F.LocationPicker;exports.TBILISI=F.TBILISI;exports.Masonry=le.Masonry;exports.Modal=de.Modal;exports.MultiSelect=Te.MultiSelect;exports.MultilineTextField=qe.MultilineTextField;exports.NumberField=Ee.NumberField;exports.OtpField=pe.OtpField;exports.PageError=ge.PageError;exports.PageLayout=Fe.PageLayout;exports.PageNotFound=Ae.PageNotFound;exports.Pagination=Se.Pagination;exports.PaletteField=ye.PaletteField;exports.PhoneField=A.PhoneField;exports.isValidPhone=A.isValidPhone;exports.Popconfirm=Pe.Popconfirm;exports.Popover=Ce.Popover;exports.Progress=me.Progress;exports.QrCode=Le.QrCode;exports.Radio=S.Radio;exports.RadioGroup=S.RadioGroup;exports.RemoveDialog=he.RemoveDialog;exports.RichTextEditor=De.RichTextEditor;exports.RootLayout=Re.RootLayout;exports.Select=be.Select;exports.Skeleton=Be.Skeleton;exports.Slider=_e.Slider;exports.SpeedDial=y.SpeedDial;exports.SpeedDialAction=y.SpeedDialAction;exports.Stepper=ke.Stepper;exports.SwatchPicker=Ie.SwatchPicker;exports.Switch=Ne.Switch;exports.Table=Me.Table;exports.Tabs=Qe.Tabs;exports.TagsField=Ue.TagsField;exports.TextField=ve.TextField;exports.ThemeToggle=Ke.ThemeToggle;exports.TimePicker=Oe.TimePicker;exports.Timeline=P.Timeline;exports.TimelineItem=P.TimelineItem;exports.Toaster=fe.Toaster;exports.ToggleButton=C.ToggleButton;exports.ToggleButtonGroup=C.ToggleButtonGroup;exports.Tooltip=Ge.Tooltip;exports.TranslatedFields=xe.TranslatedFields;exports.Typography=Ye.Typography;exports.UserCard=we.UserCard;exports.getErrorDetails=o.getErrorDetails;exports.getErrorFieldErrors=o.getErrorFieldErrors;exports.getErrorMessage=o.getErrorMessage;exports.getErrorStatus=o.getErrorStatus;exports.getErrorTraceId=o.getErrorTraceId;exports.humanizeField=o.humanizeField;exports.isNetworkError=o.isNetworkError;exports.isServerError=o.isServerError;exports.toast=He.toast;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { b as Z, p as $ } from "./table-DF3zTrC3.js";
|
|
|
11
11
|
import { B as or, D as er, a as ar, P as sr, c as tr, g as pr, l as mr, r as fr, b as xr } from "./palette-B031dM4E.js";
|
|
12
12
|
import { A as lr } from "./AuthGuard-CVklwDbj.js";
|
|
13
13
|
import { a as ur } from "./authLayoutRoute-B10sXioW.js";
|
|
14
|
-
import { A as dr } from "./AdminRoot-
|
|
14
|
+
import { A as dr } from "./AdminRoot-JOgiNkJA.js";
|
|
15
15
|
import { A as Er, a as Ar } from "./Accordion-DhFZ25KV.js";
|
|
16
16
|
import { A as gr } from "./Alert-CtUr-0s8.js";
|
|
17
17
|
import { A as Pr } from "./AuthLayout-q8pbCGdt.js";
|
|
@@ -27,22 +27,22 @@ import { C as wr } from "./Checkbox-DyKBIgVT.js";
|
|
|
27
27
|
import { C as jr } from "./Chip-D5ZZs3QH.js";
|
|
28
28
|
import { C as zr, a as Vr } from "./ChoiceCardGroup-Cx8CtmPl.js";
|
|
29
29
|
import { C as Jr } from "./Code-DaEpXHfF.js";
|
|
30
|
-
import { C as Zr } from "./CodeBlock-
|
|
30
|
+
import { C as Zr } from "./CodeBlock-DrWRSRmO.js";
|
|
31
31
|
import { C as ro, R as oo } from "./Col-B51RlwWP.js";
|
|
32
32
|
import { C as ao } from "./ColorPicker-w7NdprlW.js";
|
|
33
|
-
import { C as to } from "./ColorRamp-
|
|
34
|
-
import { C as mo } from "./CopyButton-
|
|
33
|
+
import { C as to } from "./ColorRamp-Mp_ddhmb.js";
|
|
34
|
+
import { C as mo } from "./CopyButton-Yg5ZVTiX.js";
|
|
35
35
|
import { D as xo } from "./DashedButton-csz6Jt_K.js";
|
|
36
36
|
import { D as lo } from "./DatePicker-BMJlfCKB.js";
|
|
37
37
|
import { D as uo } from "./DateTimePicker-B-Jjejzm.js";
|
|
38
|
-
import { D as co } from "./DescriptionList-
|
|
38
|
+
import { D as co } from "./DescriptionList-CG08_qwT.js";
|
|
39
39
|
import { D as Ao } from "./Divider-LtH3dLgw.js";
|
|
40
40
|
import { D as go } from "./Dropdown-CcC-Hwx4.js";
|
|
41
41
|
import { E as Po } from "./EmptyState-BCoPw8jf.js";
|
|
42
|
-
import { E as Lo, Q as Do } from "./ErrorBoundary-
|
|
43
|
-
import { E as bo } from "./ErrorState-
|
|
42
|
+
import { E as Lo, Q as Do } from "./ErrorBoundary-BILk_3fM.js";
|
|
43
|
+
import { E as bo } from "./ErrorState-DI28ZCJN.js";
|
|
44
44
|
import { F as Bo } from "./FileCard-5QvVkO1-.js";
|
|
45
|
-
import { F as _o } from "./FileUploader-
|
|
45
|
+
import { F as _o } from "./FileUploader-DwAl3UXI.js";
|
|
46
46
|
import { F as Mo, S as No } from "./Sidebar-Dg15hPpM.js";
|
|
47
47
|
import { F as ko } from "./Flag-DfA2t0yd.js";
|
|
48
48
|
import { F as Ko } from "./Flex-BFn4P1tJ.js";
|
|
@@ -55,35 +55,35 @@ import { L as ee } from "./Link-BQlvsu9V.js";
|
|
|
55
55
|
import { L as se } from "./List-CwuAJDTi.js";
|
|
56
56
|
import { L as pe } from "./ListItem-BWNIbyTh.js";
|
|
57
57
|
import { L as fe } from "./Loader-Bj5uwVR9.js";
|
|
58
|
-
import { L as ie, T as le } from "./LocationPicker-
|
|
58
|
+
import { L as ie, T as le } from "./LocationPicker-Ce8aLubZ.js";
|
|
59
59
|
import { M as ue } from "./Masonry-BsRWG-oN.js";
|
|
60
|
-
import { M as de } from "./Modal-
|
|
60
|
+
import { M as de } from "./Modal-DTnB_mGg.js";
|
|
61
61
|
import { M as Ee } from "./MultiSelect-Dn8l5z52.js";
|
|
62
62
|
import { M as Fe } from "./MultilineTextField-DJ26nTdF.js";
|
|
63
63
|
import { N as Ce } from "./NumberField-DvQ5UP1R.js";
|
|
64
64
|
import { O as Se } from "./OtpField-Dy4O1MeD.js";
|
|
65
|
-
import { P as De } from "./PageError-
|
|
65
|
+
import { P as De } from "./PageError-BORFaxGW.js";
|
|
66
66
|
import { P as be } from "./PageLayout-ojiBEcxI.js";
|
|
67
67
|
import { P as Be } from "./PageNotFound-D536Tshv.js";
|
|
68
68
|
import { P as _e } from "./Pagination-DoDGKGpQ.js";
|
|
69
|
-
import { P as Me } from "./PaletteField-
|
|
69
|
+
import { P as Me } from "./PaletteField-ChG2VQtS.js";
|
|
70
70
|
import { P as Qe, i as ke } from "./PhoneField-CjYw-Unw.js";
|
|
71
71
|
import { P as Ke } from "./Popconfirm-B3GhhrRM.js";
|
|
72
72
|
import { P as ve } from "./Popover-WaVH3jsN.js";
|
|
73
73
|
import { P as Ye } from "./Progress-ZNQrxw_Q.js";
|
|
74
74
|
import { Q as He } from "./QrCode-B9YbQNVc.js";
|
|
75
75
|
import { R as qe, a as ze } from "./RadioGroup-CD209tlb.js";
|
|
76
|
-
import { R as We } from "./RemoveDialog-
|
|
77
|
-
import { R as Xe } from "./RichTextEditor-
|
|
78
|
-
import { R as $e } from "./RootLayout-
|
|
76
|
+
import { R as We } from "./RemoveDialog-ayAfGXpB.js";
|
|
77
|
+
import { R as Xe } from "./RichTextEditor-itYD1PfE.js";
|
|
78
|
+
import { R as $e } from "./RootLayout-BlYjYAYk.js";
|
|
79
79
|
import { S as oa } from "./Select-K0a_7ROf.js";
|
|
80
80
|
import { S as aa } from "./Skeleton-_-uGax2j.js";
|
|
81
81
|
import { S as ta } from "./Slider-CwZYxDO0.js";
|
|
82
|
-
import { S as ma, a as fa } from "./SpeedDial-
|
|
82
|
+
import { S as ma, a as fa } from "./SpeedDial-CEBAWIYo.js";
|
|
83
83
|
import { S as ia } from "./Stepper-BN0GsRZW.js";
|
|
84
84
|
import { S as Ta } from "./SwatchPicker-BZHRELA-.js";
|
|
85
85
|
import { S as na } from "./Switch-Jh2Ch8GO.js";
|
|
86
|
-
import { T as ca } from "./Table-
|
|
86
|
+
import { T as ca } from "./Table-DChIfjqj.js";
|
|
87
87
|
import { T as Aa } from "./Tabs-DfVFgOfs.js";
|
|
88
88
|
import { T as ga } from "./TagsField-CoBRqcjW.js";
|
|
89
89
|
import { T as Pa } from "./TextField-0gFvIFs8.js";
|
|
@@ -92,7 +92,7 @@ import { T as ya } from "./TimePicker-Bv2qIFf9.js";
|
|
|
92
92
|
import { T as Ra, a as Ba } from "./Timeline-Cb1krSlo.js";
|
|
93
93
|
import { T as _a } from "./Toaster-Fq6-ImDJ.js";
|
|
94
94
|
import { T as Ma, a as Na } from "./ToggleButtonGroup-Mdskkjdh.js";
|
|
95
|
-
import { T as ka } from "./Tooltip-
|
|
95
|
+
import { T as ka } from "./Tooltip-BbT0uNzy.js";
|
|
96
96
|
import { T as Ka } from "./TranslatedFields-CmRhRGC_.js";
|
|
97
97
|
import { T as va } from "./Typography-ChSuxgkc.js";
|
|
98
98
|
import { U as Ya } from "./UserCard-DcTLEHFu.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CopyButton-BD5sN32G.js","sources":["../src/components/CopyButton/CopyButton.tsx"],"sourcesContent":["import { forwardRef, type MouseEvent } from 'react'\nimport { useT } from '../../theme'\nimport { useClipboard } from '../../hooks/useClipboard'\nimport { IconButton, type IconButtonProps } from '../IconButton'\nimport { Icon } from '../Icon'\nimport { Tooltip } from '../Tooltip'\nimport type { IconName } from '../../icons/names'\n\nexport interface CopyButtonProps extends Omit<\n IconButtonProps,\n 'children' | 'aria-label' | 'onCopy'\n> {\n /** The text copied to the clipboard on click. */\n value: string\n /** Idle icon. Defaults to `'Copy'`. */\n icon?: IconName\n /** Icon shown briefly after a successful copy. Defaults to `'CopySuccess'`. */\n copiedIcon?: IconName\n /** Tooltip + accessible label while idle. Defaults to the localized `clipboard.copy` (`\"Copy\"`). */\n copyLabel?: string\n /** Tooltip + accessible label right after copying. Defaults to the localized `clipboard.copied` (`\"Copied!\"`). */\n copiedLabel?: string\n /** How long (ms) the copied state shows before reverting. Defaults to `1600`. */\n timeout?: number\n /** Show the hover/focus tooltip. Defaults to `true`. */\n tooltip?: boolean\n /** Called with `value` after a successful copy. */\n onCopy?: (value: string) => void\n}\n\n/**\n * A ready-made **click-to-copy** button — copies `value` to the clipboard and flips its icon to a tick\n * (+ a tooltip that reads \"Copied!\") for a moment, then reverts. Wraps `IconButton` (defaults to the\n * quiet `text` variant) with a `Tooltip`; labels come from the built-in i18n (`clipboard.copy` /\n * `clipboard.copied`), so they localize with the panel. For a labeled button or a custom trigger, use\n * the `useClipboard` hook instead. Built on `navigator.clipboard` (no-ops where unavailable).\n *\n * @example\n * <CopyButton value={apiKey} />\n * <CopyButton value={url} copyLabel=\"Copy link\" size=\"sm\" />\n */\nexport const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(function CopyButton(\n {\n value,\n icon = 'Copy',\n copiedIcon = 'CopySuccess',\n copyLabel,\n copiedLabel,\n timeout = 1600,\n tooltip = true,\n variant = 'text',\n size = 'sm',\n onCopy,\n onClick,\n ...props\n },\n ref,\n) {\n const t = useT()\n const { copy, copied } = useClipboard({ timeout })\n const label = copied ? (copiedLabel ?? t('clipboard.copied')) : (copyLabel ?? t('clipboard.copy'))\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n void copy(value).then((ok) => {\n if (ok) onCopy?.(value)\n })\n }\n\n const button = (\n <IconButton\n ref={ref}\n variant={variant}\n size={size}\n aria-label={label}\n onClick={handleClick}\n {...props}\n >\n <Icon name={copied ? copiedIcon : icon} />\n </IconButton>\n )\n\n return tooltip ? <Tooltip content={label}>{button}</Tooltip> : button\n})\n"],"names":["CopyButton","forwardRef","value","icon","copiedIcon","copyLabel","copiedLabel","timeout","tooltip","variant","size","onCopy","onClick","props","ref","t","useT","copy","copied","useClipboard","label","button","jsx","IconButton","event","ok","Icon","Tooltip"],"mappings":";;;;;;;AAyCO,MAAMA,IAAaC,EAA+C,SACvE;AAAA,EACE,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,YAAAC,IAAa;AAAA,EACb,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,SAAAC,IAAU;AAAA,EACV,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJ,EAAE,MAAAC,GAAM,QAAAC,EAAA,IAAWC,EAAa,EAAE,SAAAZ,GAAS,GAC3Ca,IAAQF,IAAUZ,KAAeS,EAAE,kBAAkB,IAAMV,KAAaU,EAAE,gBAAgB,GAS1FM,IACJ,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAT;AAAA,MACA,SAAAL;AAAA,MACA,MAAAC;AAAA,MACA,cAAYU;AAAA,MACZ,SAbgB,CAACI,MAAyC;AAC5D,QAAAZ,KAAA,QAAAA,EAAUY,IACLP,EAAKf,CAAK,EAAE,KAAK,CAACuB,MAAO;AAC5B,UAAIA,qBAAavB;AAAA,QACnB,CAAC;AAAA,MACH;AAAA,MASK,GAAGW;AAAA,MAEJ,UAAA,gBAAAS,EAACI,GAAA,EAAK,MAAMR,IAASd,IAAaD,EAAA,CAAM;AAAA,IAAA;AAAA,EAAA;AAI5C,SAAOK,IAAU,gBAAAc,EAACK,GAAA,EAAQ,SAASP,GAAQ,aAAO,IAAaC;AACjE,CAAC;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CopyButton-CUEEp_Na.cjs","sources":["../src/components/CopyButton/CopyButton.tsx"],"sourcesContent":["import { forwardRef, type MouseEvent } from 'react'\nimport { useT } from '../../theme'\nimport { useClipboard } from '../../hooks/useClipboard'\nimport { IconButton, type IconButtonProps } from '../IconButton'\nimport { Icon } from '../Icon'\nimport { Tooltip } from '../Tooltip'\nimport type { IconName } from '../../icons/names'\n\nexport interface CopyButtonProps extends Omit<\n IconButtonProps,\n 'children' | 'aria-label' | 'onCopy'\n> {\n /** The text copied to the clipboard on click. */\n value: string\n /** Idle icon. Defaults to `'Copy'`. */\n icon?: IconName\n /** Icon shown briefly after a successful copy. Defaults to `'CopySuccess'`. */\n copiedIcon?: IconName\n /** Tooltip + accessible label while idle. Defaults to the localized `clipboard.copy` (`\"Copy\"`). */\n copyLabel?: string\n /** Tooltip + accessible label right after copying. Defaults to the localized `clipboard.copied` (`\"Copied!\"`). */\n copiedLabel?: string\n /** How long (ms) the copied state shows before reverting. Defaults to `1600`. */\n timeout?: number\n /** Show the hover/focus tooltip. Defaults to `true`. */\n tooltip?: boolean\n /** Called with `value` after a successful copy. */\n onCopy?: (value: string) => void\n}\n\n/**\n * A ready-made **click-to-copy** button — copies `value` to the clipboard and flips its icon to a tick\n * (+ a tooltip that reads \"Copied!\") for a moment, then reverts. Wraps `IconButton` (defaults to the\n * quiet `text` variant) with a `Tooltip`; labels come from the built-in i18n (`clipboard.copy` /\n * `clipboard.copied`), so they localize with the panel. For a labeled button or a custom trigger, use\n * the `useClipboard` hook instead. Built on `navigator.clipboard` (no-ops where unavailable).\n *\n * @example\n * <CopyButton value={apiKey} />\n * <CopyButton value={url} copyLabel=\"Copy link\" size=\"sm\" />\n */\nexport const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(function CopyButton(\n {\n value,\n icon = 'Copy',\n copiedIcon = 'CopySuccess',\n copyLabel,\n copiedLabel,\n timeout = 1600,\n tooltip = true,\n variant = 'text',\n size = 'sm',\n onCopy,\n onClick,\n ...props\n },\n ref,\n) {\n const t = useT()\n const { copy, copied } = useClipboard({ timeout })\n const label = copied ? (copiedLabel ?? t('clipboard.copied')) : (copyLabel ?? t('clipboard.copy'))\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n void copy(value).then((ok) => {\n if (ok) onCopy?.(value)\n })\n }\n\n const button = (\n <IconButton\n ref={ref}\n variant={variant}\n size={size}\n aria-label={label}\n onClick={handleClick}\n {...props}\n >\n <Icon name={copied ? copiedIcon : icon} />\n </IconButton>\n )\n\n return tooltip ? <Tooltip content={label}>{button}</Tooltip> : button\n})\n"],"names":["CopyButton","forwardRef","value","icon","copiedIcon","copyLabel","copiedLabel","timeout","tooltip","variant","size","onCopy","onClick","props","ref","t","useT","copy","copied","useClipboard","label","handleClick","event","ok","button","jsx","IconButton","Icon","Tooltip"],"mappings":"qQAyCaA,EAAaC,EAAAA,WAA+C,SACvE,CACE,MAAAC,EACA,KAAAC,EAAO,OACP,WAAAC,EAAa,cACb,UAAAC,EACA,YAAAC,EACA,QAAAC,EAAU,KACV,QAAAC,EAAU,GACV,QAAAC,EAAU,OACV,KAAAC,EAAO,KACP,OAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJ,CAAE,KAAAC,EAAM,OAAAC,CAAA,EAAWC,EAAAA,aAAa,CAAE,QAAAZ,EAAS,EAC3Ca,EAAQF,EAAUZ,GAAeS,EAAE,kBAAkB,EAAMV,GAAaU,EAAE,gBAAgB,EAE1FM,EAAeC,GAAyC,CAC5DV,GAAA,MAAAA,EAAUU,GACLL,EAAKf,CAAK,EAAE,KAAMqB,GAAO,CACxBA,eAAarB,GACnB,CAAC,CACH,EAEMsB,EACJC,EAAAA,IAACC,EAAAA,WAAA,CACC,IAAAZ,EACA,QAAAL,EACA,KAAAC,EACA,aAAYU,EACZ,QAASC,EACR,GAAGR,EAEJ,SAAAY,EAAAA,IAACE,OAAA,CAAK,KAAMT,EAASd,EAAaD,CAAA,CAAM,CAAA,CAAA,EAI5C,OAAOK,EAAUiB,MAACG,EAAAA,QAAA,CAAQ,QAASR,EAAQ,WAAO,EAAaI,CACjE,CAAC"}
|
package/dist/Modal-BkO_6afj.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as T } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as V, useRef as E, useState as Z, useEffect as F, useId as H } from "react";
|
|
3
|
-
import { clsx as D } from "clsx";
|
|
4
|
-
import { b as K, a as w } from "./Icon-D5TxgfCc.js";
|
|
5
|
-
import { I as U } from "./IconButton-06pmftMo.js";
|
|
6
|
-
import { createPortal as C } from "react-dom";
|
|
7
|
-
import { u as ee } from "./useLockBodyScroll-DwBILLPK.js";
|
|
8
|
-
import { a as te } from "./ConfigProvider-DeMASTVo.js";
|
|
9
|
-
const le = "_overlay_gwv2a_6", ae = {
|
|
10
|
-
overlay: le
|
|
11
|
-
}, re = V(function({
|
|
12
|
-
open: r,
|
|
13
|
-
onClose: n,
|
|
14
|
-
closeOnBackdrop: v = !0,
|
|
15
|
-
closeOnEscape: M = !0,
|
|
16
|
-
lockScroll: N = !0,
|
|
17
|
-
dim: s,
|
|
18
|
-
className: i,
|
|
19
|
-
style: c,
|
|
20
|
-
children: A,
|
|
21
|
-
onKeyDown: d,
|
|
22
|
-
onMouseDown: b,
|
|
23
|
-
onClick: f,
|
|
24
|
-
...O
|
|
25
|
-
}, q) {
|
|
26
|
-
const S = E(null), [P, g] = Z(!1);
|
|
27
|
-
ee(r && N), F(() => {
|
|
28
|
-
if (!r) {
|
|
29
|
-
g(!1);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const t = requestAnimationFrame(() => g(!0));
|
|
33
|
-
return () => cancelAnimationFrame(t);
|
|
34
|
-
}, [r]);
|
|
35
|
-
const h = (t) => {
|
|
36
|
-
t.key === "Escape" && (t.stopPropagation(), M && (n == null || n())), d == null || d(t);
|
|
37
|
-
}, k = (t) => {
|
|
38
|
-
S.current = t.target, b == null || b(t);
|
|
39
|
-
}, m = (t) => {
|
|
40
|
-
v && t.target === t.currentTarget && S.current === t.currentTarget && (n == null || n()), f == null || f(t);
|
|
41
|
-
};
|
|
42
|
-
return !r || typeof document > "u" ? null : C(
|
|
43
|
-
/* @__PURE__ */ a(
|
|
44
|
-
"div",
|
|
45
|
-
{
|
|
46
|
-
ref: q,
|
|
47
|
-
className: D(ae.overlay, i),
|
|
48
|
-
"data-open": P ? "true" : "false",
|
|
49
|
-
style: s != null ? { "--tz-overlay-dim": s, ...c } : c,
|
|
50
|
-
onKeyDown: h,
|
|
51
|
-
onMouseDown: k,
|
|
52
|
-
onClick: m,
|
|
53
|
-
...O,
|
|
54
|
-
children: A
|
|
55
|
-
}
|
|
56
|
-
),
|
|
57
|
-
document.body
|
|
58
|
-
);
|
|
59
|
-
}), ne = "_overlay_1lotx_3", se = "_modal_1lotx_25", ce = "_sm_1lotx_48", oe = "_md_1lotx_51", ie = "_lg_1lotx_54", de = "_fullScreen_1lotx_57", ue = "_header_1lotx_74", fe = "_headerDivided_1lotx_83", me = "_headerMain_1lotx_86", _e = "_icon_1lotx_93", be = "_headerText_1lotx_96", he = "_title_1lotx_103", xe = "_subtitle_1lotx_115", ye = "_close_1lotx_127", ve = "_body_1lotx_132", Ne = "_footer_1lotx_143", l = {
|
|
60
|
-
overlay: ne,
|
|
61
|
-
modal: se,
|
|
62
|
-
sm: ce,
|
|
63
|
-
md: oe,
|
|
64
|
-
lg: ie,
|
|
65
|
-
fullScreen: de,
|
|
66
|
-
header: ue,
|
|
67
|
-
headerDivided: fe,
|
|
68
|
-
headerMain: me,
|
|
69
|
-
icon: _e,
|
|
70
|
-
headerText: be,
|
|
71
|
-
title: he,
|
|
72
|
-
subtitle: xe,
|
|
73
|
-
close: ye,
|
|
74
|
-
body: ve,
|
|
75
|
-
footer: Ne
|
|
76
|
-
}, Se = new Set(w), I = 'a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), textarea:not(:disabled):not([tabindex="-1"]), input:not(:disabled):not([tabindex="-1"]), select:not(:disabled):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])', Oe = V(function({
|
|
77
|
-
open: r,
|
|
78
|
-
onClose: n,
|
|
79
|
-
size: v = "md",
|
|
80
|
-
scrollBehavior: M = "outside",
|
|
81
|
-
placement: N = "center",
|
|
82
|
-
title: s,
|
|
83
|
-
description: i,
|
|
84
|
-
icon: c,
|
|
85
|
-
color: A = "accent",
|
|
86
|
-
footer: d,
|
|
87
|
-
bodyClassName: b,
|
|
88
|
-
showCloseButton: f = !0,
|
|
89
|
-
closeOnBackdrop: O = !0,
|
|
90
|
-
closeOnEscape: q = !0,
|
|
91
|
-
ariaLabel: S,
|
|
92
|
-
className: P,
|
|
93
|
-
style: g,
|
|
94
|
-
children: h,
|
|
95
|
-
...k
|
|
96
|
-
}, m) {
|
|
97
|
-
const t = te(), p = E(null), R = E(null), j = E(null), B = H(), L = H();
|
|
98
|
-
F(() => {
|
|
99
|
-
var u, x, y;
|
|
100
|
-
if (!r) return;
|
|
101
|
-
const e = document.activeElement, o = ((u = R.current) == null ? void 0 : u.querySelector(I)) ?? ((x = j.current) == null ? void 0 : x.querySelector(I)) ?? ((y = p.current) == null ? void 0 : y.querySelector(I)) ?? p.current;
|
|
102
|
-
return o == null || o.focus({ preventScroll: !0 }), () => {
|
|
103
|
-
var _;
|
|
104
|
-
e != null && e.isConnected && ((_ = e.focus) == null || _.call(e));
|
|
105
|
-
};
|
|
106
|
-
}, [r]);
|
|
107
|
-
const J = (e) => {
|
|
108
|
-
p.current = e, typeof m == "function" ? m(e) : m && (m.current = e);
|
|
109
|
-
}, Q = (e) => {
|
|
110
|
-
if (e.key !== "Tab") return;
|
|
111
|
-
const o = p.current;
|
|
112
|
-
if (!o) return;
|
|
113
|
-
const u = [...o.querySelectorAll(I)].filter(
|
|
114
|
-
($) => $.offsetParent !== null || $ === document.activeElement
|
|
115
|
-
);
|
|
116
|
-
if (u.length === 0) {
|
|
117
|
-
e.preventDefault(), o.focus();
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
const x = u[0], y = u[u.length - 1], _ = document.activeElement;
|
|
121
|
-
e.shiftKey && (_ === x || _ === o) ? (e.preventDefault(), y.focus()) : !e.shiftKey && _ === y && (e.preventDefault(), x.focus());
|
|
122
|
-
};
|
|
123
|
-
if (!r) return null;
|
|
124
|
-
const W = N !== "center", z = c == null ? null : typeof c == "string" && Se.has(c) ? /* @__PURE__ */ a(K, { name: c }) : c, X = s != null || i != null || z != null || f, Y = h != null || d != null;
|
|
125
|
-
return /* @__PURE__ */ a(
|
|
126
|
-
re,
|
|
127
|
-
{
|
|
128
|
-
open: r,
|
|
129
|
-
onClose: n,
|
|
130
|
-
closeOnBackdrop: O,
|
|
131
|
-
closeOnEscape: q,
|
|
132
|
-
onKeyDown: Q,
|
|
133
|
-
className: l.overlay,
|
|
134
|
-
"data-size": v,
|
|
135
|
-
"data-placement": N,
|
|
136
|
-
"data-scroll": W ? "inside" : M,
|
|
137
|
-
children: /* @__PURE__ */ T(
|
|
138
|
-
"div",
|
|
139
|
-
{
|
|
140
|
-
ref: J,
|
|
141
|
-
className: D(l.modal, l[v], P),
|
|
142
|
-
role: "dialog",
|
|
143
|
-
"aria-modal": "true",
|
|
144
|
-
"aria-labelledby": s != null ? B : void 0,
|
|
145
|
-
"aria-label": s == null ? S : void 0,
|
|
146
|
-
"aria-describedby": i != null ? L : void 0,
|
|
147
|
-
tabIndex: -1,
|
|
148
|
-
style: g,
|
|
149
|
-
...k,
|
|
150
|
-
children: [
|
|
151
|
-
X && /* @__PURE__ */ T("div", { className: D(l.header, Y && l.headerDivided), children: [
|
|
152
|
-
/* @__PURE__ */ T("div", { className: l.headerMain, children: [
|
|
153
|
-
z != null && /* @__PURE__ */ a(
|
|
154
|
-
U,
|
|
155
|
-
{
|
|
156
|
-
variant: "filled",
|
|
157
|
-
size: "sm",
|
|
158
|
-
color: A,
|
|
159
|
-
nonClickable: !0,
|
|
160
|
-
"aria-hidden": !0,
|
|
161
|
-
className: l.icon,
|
|
162
|
-
children: z
|
|
163
|
-
}
|
|
164
|
-
),
|
|
165
|
-
(s != null || i != null) && /* @__PURE__ */ T("div", { className: l.headerText, children: [
|
|
166
|
-
s != null && /* @__PURE__ */ a("div", { id: B, className: l.title, children: s }),
|
|
167
|
-
i != null && /* @__PURE__ */ a("div", { id: L, className: l.subtitle, children: i })
|
|
168
|
-
] })
|
|
169
|
-
] }),
|
|
170
|
-
f && /* @__PURE__ */ a(
|
|
171
|
-
U,
|
|
172
|
-
{
|
|
173
|
-
variant: "filled",
|
|
174
|
-
color: "primary",
|
|
175
|
-
size: "sm",
|
|
176
|
-
className: l.close,
|
|
177
|
-
"aria-label": t("common.close"),
|
|
178
|
-
onClick: n,
|
|
179
|
-
children: /* @__PURE__ */ a(K, { name: "Close" })
|
|
180
|
-
}
|
|
181
|
-
)
|
|
182
|
-
] }),
|
|
183
|
-
h != null && /* @__PURE__ */ a("div", { ref: R, className: D(l.body, b), children: h }),
|
|
184
|
-
d != null && /* @__PURE__ */ a("div", { ref: j, className: l.footer, children: d })
|
|
185
|
-
]
|
|
186
|
-
}
|
|
187
|
-
)
|
|
188
|
-
}
|
|
189
|
-
);
|
|
190
|
-
});
|
|
191
|
-
export {
|
|
192
|
-
Oe as M,
|
|
193
|
-
re as O
|
|
194
|
-
};
|
|
195
|
-
//# sourceMappingURL=Modal-BkO_6afj.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Modal-BkO_6afj.js","sources":["../src/components/Overlay/Overlay.tsx","../src/components/Modal/Modal.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { clsx } from 'clsx'\nimport { useLockBodyScroll } from '../../hooks/useLockBodyScroll'\nimport styles from './Overlay.module.css'\n\nexport interface OverlayProps extends HTMLAttributes<HTMLDivElement> {\n /** Whether the overlay is mounted + shown — gates the portal and drives the fade-in. */\n open: boolean\n /** Requested dismiss — fired on a backdrop click (`closeOnBackdrop`) or Escape (`closeOnEscape`). */\n onClose?: () => void\n /** Close when the scrim itself (outside the content) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed while focus is within the overlay. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Lock page scroll while open. Defaults to `true`. */\n lockScroll?: boolean\n /** Scrim darkness — the black backdrop's alpha (0–1). Defaults to `0.45`. */\n dim?: number\n /** Overlay content — typically a centered dialog / box / media. */\n children?: ReactNode\n}\n\n/**\n * The shared backdrop primitive behind every dimmed, page-blocking surface (`Modal`, the FileUploader\n * lightbox). Portals a fixed full-viewport scrim to `<body>`, locks page scroll, fades in (opacity keyed\n * off a rAF `visible` flag → `data-open`), and dismisses on **backdrop-click** (gated on the pointer-down\n * AND click both landing on the scrim, so a text-selection drag ending on it doesn't close) / **Escape**\n * (swallowed via `stopPropagation` so it can't reach a React-tree ancestor overlay). Centers its children\n * by default; consumers layer their own padding / scroll / placement via `className` + `data-*` and read\n * the shared `data-open` on the scrim for their own box's enter transform. A consumer `onKeyDown` still\n * fires (after the Escape handling) so it can add e.g. a Tab focus-trap. Internal — no `index.ts`, so it's\n * never exposed as a package subpath; import it via `../Overlay/Overlay`. The ref points at the scrim div.\n */\nexport const Overlay = forwardRef<HTMLDivElement, OverlayProps>(function Overlay(\n {\n open,\n onClose,\n closeOnBackdrop = true,\n closeOnEscape = true,\n lockScroll = true,\n dim,\n className,\n style,\n children,\n onKeyDown,\n onMouseDown,\n onClick,\n ...props\n },\n ref,\n) {\n const mouseDownTarget = useRef<EventTarget | null>(null)\n const [visible, setVisible] = useState(false)\n\n useLockBodyScroll(open && lockScroll)\n\n // enter animation: flip `visible` on the frame after mount so the opacity transition runs\n useEffect(() => {\n if (!open) {\n setVisible(false)\n return\n }\n const raf = requestAnimationFrame(() => setVisible(true))\n return () => cancelAnimationFrame(raf)\n }, [open])\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n // the overlay owns the page — swallow Escape so it can't reach a React-tree ancestor overlay (e.g.\n // an outer Modal) even when this one isn't Escape-dismissible\n event.stopPropagation()\n if (closeOnEscape) onClose?.()\n }\n onKeyDown?.(event)\n }\n // remember where the pointer went down so the click handler can tell a scrim click from a drag that\n // started inside the content and ended on the scrim (a text-selection drag)\n const handleMouseDown = (event: MouseEvent<HTMLDivElement>) => {\n mouseDownTarget.current = event.target\n onMouseDown?.(event)\n }\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n if (\n closeOnBackdrop &&\n event.target === event.currentTarget &&\n mouseDownTarget.current === event.currentTarget\n ) {\n onClose?.()\n }\n onClick?.(event)\n }\n\n if (!open || typeof document === 'undefined') return null\n\n return createPortal(\n <div\n ref={ref}\n className={clsx(styles.overlay, className)}\n data-open={visible ? 'true' : 'false'}\n style={dim != null ? ({ '--tz-overlay-dim': dim, ...style } as CSSProperties) : style}\n onKeyDown={handleKeyDown}\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n {...props}\n >\n {children}\n </div>,\n document.body,\n )\n})\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Overlay } from '../Overlay/Overlay'\nimport styles from './Modal.module.css'\n\nexport type ModalSize = 'sm' | 'md' | 'lg' | 'fullScreen'\nexport type ModalScrollBehavior = 'inside' | 'outside'\nexport type ModalPlacement = 'center' | 'left' | 'right'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\n/** Focusable descendants used by the focus trap + initial focus. */\n// every clause excludes tabindex=\"-1\" so decorative/programmatic-only nodes (e.g. the header's\n// `nonClickable aria-hidden` IconButton) don't count as trap boundaries or initial-focus targets\nconst FOCUSABLE =\n 'a[href]:not([tabindex=\"-1\"]), button:not(:disabled):not([tabindex=\"-1\"]), textarea:not(:disabled):not([tabindex=\"-1\"]), input:not(:disabled):not([tabindex=\"-1\"]), select:not(:disabled):not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"])'\n\nexport interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Whether the modal is open — gates the portal and drives the enter animation. */\n open: boolean\n /** Called when a dismiss is requested (close button, backdrop click, or Escape). */\n onClose: () => void\n /** Preset width: `sm` 360 · `md` 620 · `lg` 900 px, or `fullScreen` (fills the viewport). Defaults to `md`. */\n size?: ModalSize\n /**\n * Where overflow scrolls when the content is taller than the viewport: `outside` (default — the\n * whole dialog grows and the overlay/page scrolls) or `inside` (the body scrolls while the header +\n * footer stay pinned). Ignored for side-drawer placements (`left`/`right`), which always scroll inside.\n */\n scrollBehavior?: ModalScrollBehavior\n /**\n * Where the dialog sits: `center` (default — the standard centered modal), or `left` / `right` to\n * make it a **full-height side drawer** (sheet) that slides in from that edge. A drawer takes its\n * width from `size`, fills the viewport height, and always scrolls its body inside (header + footer\n * stay pinned).\n */\n placement?: ModalPlacement\n /** Header title. When set, labels the dialog (`aria-labelledby`). */\n title?: ReactNode\n /** Muted description line under the title (e.g. a confirm prompt). */\n description?: ReactNode\n /** Leading header icon shown in a tinted box (like `Card`) — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Theme color that tints the leading icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Footer slot — right-aligned actions over a top divider (e.g. Cancel / Confirm buttons). */\n footer?: ReactNode\n /** Extra class on the scrollable body element — to tune its padding / layout (e.g. a compact confirm). */\n bodyClassName?: string\n /** Show the header × close button. Defaults to `true`. */\n showCloseButton?: boolean\n /** Close when the backdrop (outside the dialog) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Accessible label — used when there's no `title`. */\n ariaLabel?: string\n /** Dialog body. */\n children?: ReactNode\n}\n\n/**\n * A centered, backdrop-dimmed overlay dialog. Portaled to `<body>`, it locks page scroll while open,\n * traps Tab focus inside, restores focus to the previously-focused element on close, and dismisses on\n * close button / backdrop click / Escape (each toggleable). Sizes are `sm`/`md`/`lg` (max-width caps)\n * or `fullScreen`; `scrollBehavior` picks inside-body vs. whole-dialog scrolling. `placement` turns it\n * into a full-height side drawer (`left`/`right`) that slides in from the edge. The header mirrors\n * `Card` — an optional tinted `icon` box + `title` + `description`. Controlled by `open` + `onClose`.\n * The forwarded ref points at the dialog element.\n *\n * @example\n * const { isOpen, open, close } = useDisclosure()\n * <Modal open={isOpen} onClose={close} title=\"Edit\" footer={<Button onClick={close}>Done</Button>}>\n * …\n * </Modal>\n */\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n {\n open,\n onClose,\n size = 'md',\n scrollBehavior = 'outside',\n placement = 'center',\n title,\n description,\n icon,\n color = 'accent',\n footer,\n bodyClassName,\n showCloseButton = true,\n closeOnBackdrop = true,\n closeOnEscape = true,\n ariaLabel,\n className,\n style,\n children,\n ...props\n },\n forwardedRef,\n) {\n const t = useT()\n const panelRef = useRef<HTMLDivElement | null>(null)\n const bodyRef = useRef<HTMLDivElement | null>(null)\n const footerRef = useRef<HTMLDivElement | null>(null)\n const titleId = useId()\n const descId = useId()\n\n // portal + scrim + scroll-lock + fade-in + backdrop-dismiss are handled by the shared `<Overlay>`\n\n // focus management: move focus into the dialog on open — prefer a body field (form modals land on\n // their first input), else the first footer action (confirm dialogs land on Cancel/Confirm, not the\n // × button), else any control, else the dialog itself; restore focus to the trigger on close\n useEffect(() => {\n if (!open) return\n const previouslyFocused = document.activeElement as HTMLElement | null\n const target =\n bodyRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n footerRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n panelRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n panelRef.current\n // preventScroll so opening an `outside`-scroll modal doesn't jump the overlay to a below-fold control\n target?.focus({ preventScroll: true })\n // only restore if the element is still mounted (it may have unmounted while the modal was open)\n return () => {\n if (previouslyFocused?.isConnected) previouslyFocused.focus?.()\n }\n }, [open])\n\n // merge the panel ref (positioning/focus) with the forwarded ref (consumer access)\n const setPanelRef = (node: HTMLDivElement | null) => {\n panelRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n }\n\n // trap Tab within the dialog so focus can't strand on the locked page behind it (Escape + backdrop\n // dismissal live in `<Overlay>`; this fires after the overlay's own handler)\n const handleTabTrap = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab') return\n const panel = panelRef.current\n if (!panel) return\n const focusables = [...panel.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (el) => el.offsetParent !== null || el === document.activeElement,\n )\n if (focusables.length === 0) {\n event.preventDefault()\n panel.focus()\n return\n }\n const first = focusables[0]\n const last = focusables[focusables.length - 1]\n const active = document.activeElement\n if (event.shiftKey && (active === first || active === panel)) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && active === last) {\n event.preventDefault()\n first.focus()\n }\n }\n\n if (!open) return null\n\n // a side drawer (left/right) is always full-height with the body scrolling inside (header/footer pinned)\n const isDrawer = placement !== 'center'\n\n const renderedIcon =\n icon == null ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n const hasHeader = title != null || description != null || renderedIcon != null || showCloseButton\n // a divider sets the header apart from the body/footer, like Card\n const headerDivided = children != null || footer != null\n\n return (\n <Overlay\n open={open}\n onClose={onClose}\n closeOnBackdrop={closeOnBackdrop}\n closeOnEscape={closeOnEscape}\n onKeyDown={handleTabTrap}\n className={styles.overlay}\n data-size={size}\n data-placement={placement}\n data-scroll={isDrawer ? 'inside' : scrollBehavior}\n >\n <div\n ref={setPanelRef}\n className={clsx(styles.modal, styles[size], className)}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title != null ? titleId : undefined}\n aria-label={title == null ? ariaLabel : undefined}\n aria-describedby={description != null ? descId : undefined}\n tabIndex={-1}\n style={style as CSSProperties}\n {...props}\n >\n {hasHeader && (\n <div className={clsx(styles.header, headerDivided && styles.headerDivided)}>\n <div className={styles.headerMain}>\n {renderedIcon != null && (\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n color={color}\n nonClickable\n aria-hidden\n className={styles.icon}\n >\n {renderedIcon}\n </IconButton>\n )}\n {(title != null || description != null) && (\n <div className={styles.headerText}>\n {title != null && (\n <div id={titleId} className={styles.title}>\n {title}\n </div>\n )}\n {description != null && (\n <div id={descId} className={styles.subtitle}>\n {description}\n </div>\n )}\n </div>\n )}\n </div>\n {showCloseButton && (\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n size=\"sm\"\n className={styles.close}\n aria-label={t('common.close')}\n onClick={onClose}\n >\n <Icon name=\"Close\" />\n </IconButton>\n )}\n </div>\n )}\n {children != null && (\n <div ref={bodyRef} className={clsx(styles.body, bodyClassName)}>\n {children}\n </div>\n )}\n {footer != null && (\n <div ref={footerRef} className={styles.footer}>\n {footer}\n </div>\n )}\n </div>\n </Overlay>\n )\n})\n"],"names":["Overlay","forwardRef","open","onClose","closeOnBackdrop","closeOnEscape","lockScroll","dim","className","style","children","onKeyDown","onMouseDown","onClick","props","ref","mouseDownTarget","useRef","visible","setVisible","useState","useLockBodyScroll","useEffect","raf","handleKeyDown","event","handleMouseDown","handleClick","createPortal","jsx","clsx","styles","ICON_NAME_SET","ICON_NAMES","FOCUSABLE","Modal","size","scrollBehavior","placement","title","description","icon","color","footer","bodyClassName","showCloseButton","ariaLabel","forwardedRef","useT","panelRef","bodyRef","footerRef","titleId","useId","descId","previouslyFocused","target","_a","_b","_c","setPanelRef","node","handleTabTrap","panel","focusables","el","first","last","active","isDrawer","renderedIcon","Icon","hasHeader","headerDivided","jsxs","IconButton"],"mappings":";;;;;;;;;;GA4CaA,KAAUC,EAAyC,SAC9D;AAAA,EACE,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,eAAAC,IAAgB;AAAA,EAChB,YAAAC,IAAa;AAAA,EACb,KAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,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,CAAQ;AAAA,gBAAA;AAAA,cAAA;AAAA,YACrB,GAEJ;AAAA,YAED7D,KAAY,QACX,gBAAAmB,EAAC,OAAA,EAAI,KAAKqB,GAAS,WAAWpB,EAAKC,EAAO,MAAMa,CAAa,GAC1D,UAAAlC,EAAA,CACH;AAAA,YAEDiC,KAAU,QACT,gBAAAd,EAAC,OAAA,EAAI,KAAKsB,GAAW,WAAWpB,EAAO,QACpC,UAAAY,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN,CAAC;"}
|
package/dist/Modal-D8V-JZBg.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const l=require("react/jsx-runtime"),n=require("react"),T=require("clsx"),P=require("./Icon-B6lz-V0A.cjs"),H=require("./IconButton-CQ25TtBc.cjs"),W=require("react-dom"),X=require("./useLockBodyScroll-CIXHZo-Q.cjs"),Y=require("./ConfigProvider-B_Bb6pk1.cjs"),Z="_overlay_gwv2a_6",w={overlay:Z},K=n.forwardRef(function({open:a,onClose:s,closeOnBackdrop:N=!0,closeOnEscape:E=!0,lockScroll:j=!0,dim:c,className:u,style:o,children:D,onKeyDown:d,onMouseDown:h,onClick:_,...R},M){const S=n.useRef(null),[A,g]=n.useState(!1);X.useLockBodyScroll(a&&j),n.useEffect(()=>{if(!a){g(!1);return}const t=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(t)},[a]);const b=t=>{t.key==="Escape"&&(t.stopPropagation(),E&&(s==null||s())),d==null||d(t)},O=t=>{S.current=t.target,h==null||h(t)},x=t=>{N&&t.target===t.currentTarget&&S.current===t.currentTarget&&(s==null||s()),_==null||_(t)};return!a||typeof document>"u"?null:W.createPortal(l.jsx("div",{ref:M,className:T.clsx(w.overlay,u),"data-open":A?"true":"false",style:c!=null?{"--tz-overlay-dim":c,...o}:o,onKeyDown:b,onMouseDown:O,onClick:x,...R,children:D}),document.body)}),C="_overlay_1lotx_3",ee="_modal_1lotx_25",te="_sm_1lotx_48",le="_md_1lotx_51",re="_lg_1lotx_54",ne="_fullScreen_1lotx_57",ae="_header_1lotx_74",se="_headerDivided_1lotx_83",ce="_headerMain_1lotx_86",oe="_icon_1lotx_93",ie="_headerText_1lotx_96",ue="_title_1lotx_103",de="_subtitle_1lotx_115",fe="_close_1lotx_127",_e="_body_1lotx_132",xe="_footer_1lotx_143",r={overlay:C,modal:ee,sm:te,md:le,lg:re,fullScreen:ne,header:ae,headerDivided:se,headerMain:ce,icon:oe,headerText:ie,title:ue,subtitle:de,close:fe,body:_e,footer:xe},me=new Set(P.ICON_NAMES),q='a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), textarea:not(:disabled):not([tabindex="-1"]), input:not(:disabled):not([tabindex="-1"]), select:not(:disabled):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])',he=n.forwardRef(function({open:a,onClose:s,size:N="md",scrollBehavior:E="outside",placement:j="center",title:c,description:u,icon:o,color:D="accent",footer:d,bodyClassName:h,showCloseButton:_=!0,closeOnBackdrop:R=!0,closeOnEscape:M=!0,ariaLabel:S,className:A,style:g,children:b,...O},x){const t=Y.useT(),I=n.useRef(null),k=n.useRef(null),p=n.useRef(null),z=n.useId(),L=n.useId();n.useEffect(()=>{var f,y,v;if(!a)return;const e=document.activeElement,i=((f=k.current)==null?void 0:f.querySelector(q))??((y=p.current)==null?void 0:y.querySelector(q))??((v=I.current)==null?void 0:v.querySelector(q))??I.current;return i==null||i.focus({preventScroll:!0}),()=>{var m;e!=null&&e.isConnected&&((m=e.focus)==null||m.call(e))}},[a]);const V=e=>{I.current=e,typeof x=="function"?x(e):x&&(x.current=e)},F=e=>{if(e.key!=="Tab")return;const i=I.current;if(!i)return;const f=[...i.querySelectorAll(q)].filter($=>$.offsetParent!==null||$===document.activeElement);if(f.length===0){e.preventDefault(),i.focus();return}const y=f[0],v=f[f.length-1],m=document.activeElement;e.shiftKey&&(m===y||m===i)?(e.preventDefault(),v.focus()):!e.shiftKey&&m===v&&(e.preventDefault(),y.focus())};if(!a)return null;const G=j!=="center",B=o==null?null:typeof o=="string"&&me.has(o)?l.jsx(P.Icon,{name:o}):o,J=c!=null||u!=null||B!=null||_,Q=b!=null||d!=null;return l.jsx(K,{open:a,onClose:s,closeOnBackdrop:R,closeOnEscape:M,onKeyDown:F,className:r.overlay,"data-size":N,"data-placement":j,"data-scroll":G?"inside":E,children:l.jsxs("div",{ref:V,className:T.clsx(r.modal,r[N],A),role:"dialog","aria-modal":"true","aria-labelledby":c!=null?z:void 0,"aria-label":c==null?S:void 0,"aria-describedby":u!=null?L:void 0,tabIndex:-1,style:g,...O,children:[J&&l.jsxs("div",{className:T.clsx(r.header,Q&&r.headerDivided),children:[l.jsxs("div",{className:r.headerMain,children:[B!=null&&l.jsx(H.IconButton,{variant:"filled",size:"sm",color:D,nonClickable:!0,"aria-hidden":!0,className:r.icon,children:B}),(c!=null||u!=null)&&l.jsxs("div",{className:r.headerText,children:[c!=null&&l.jsx("div",{id:z,className:r.title,children:c}),u!=null&&l.jsx("div",{id:L,className:r.subtitle,children:u})]})]}),_&&l.jsx(H.IconButton,{variant:"filled",color:"primary",size:"sm",className:r.close,"aria-label":t("common.close"),onClick:s,children:l.jsx(P.Icon,{name:"Close"})})]}),b!=null&&l.jsx("div",{ref:k,className:T.clsx(r.body,h),children:b}),d!=null&&l.jsx("div",{ref:p,className:r.footer,children:d})]})})});exports.Modal=he;exports.Overlay=K;
|
|
2
|
-
//# sourceMappingURL=Modal-D8V-JZBg.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Modal-D8V-JZBg.cjs","sources":["../src/components/Overlay/Overlay.tsx","../src/components/Modal/Modal.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { clsx } from 'clsx'\nimport { useLockBodyScroll } from '../../hooks/useLockBodyScroll'\nimport styles from './Overlay.module.css'\n\nexport interface OverlayProps extends HTMLAttributes<HTMLDivElement> {\n /** Whether the overlay is mounted + shown — gates the portal and drives the fade-in. */\n open: boolean\n /** Requested dismiss — fired on a backdrop click (`closeOnBackdrop`) or Escape (`closeOnEscape`). */\n onClose?: () => void\n /** Close when the scrim itself (outside the content) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed while focus is within the overlay. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Lock page scroll while open. Defaults to `true`. */\n lockScroll?: boolean\n /** Scrim darkness — the black backdrop's alpha (0–1). Defaults to `0.45`. */\n dim?: number\n /** Overlay content — typically a centered dialog / box / media. */\n children?: ReactNode\n}\n\n/**\n * The shared backdrop primitive behind every dimmed, page-blocking surface (`Modal`, the FileUploader\n * lightbox). Portals a fixed full-viewport scrim to `<body>`, locks page scroll, fades in (opacity keyed\n * off a rAF `visible` flag → `data-open`), and dismisses on **backdrop-click** (gated on the pointer-down\n * AND click both landing on the scrim, so a text-selection drag ending on it doesn't close) / **Escape**\n * (swallowed via `stopPropagation` so it can't reach a React-tree ancestor overlay). Centers its children\n * by default; consumers layer their own padding / scroll / placement via `className` + `data-*` and read\n * the shared `data-open` on the scrim for their own box's enter transform. A consumer `onKeyDown` still\n * fires (after the Escape handling) so it can add e.g. a Tab focus-trap. Internal — no `index.ts`, so it's\n * never exposed as a package subpath; import it via `../Overlay/Overlay`. The ref points at the scrim div.\n */\nexport const Overlay = forwardRef<HTMLDivElement, OverlayProps>(function Overlay(\n {\n open,\n onClose,\n closeOnBackdrop = true,\n closeOnEscape = true,\n lockScroll = true,\n dim,\n className,\n style,\n children,\n onKeyDown,\n onMouseDown,\n onClick,\n ...props\n },\n ref,\n) {\n const mouseDownTarget = useRef<EventTarget | null>(null)\n const [visible, setVisible] = useState(false)\n\n useLockBodyScroll(open && lockScroll)\n\n // enter animation: flip `visible` on the frame after mount so the opacity transition runs\n useEffect(() => {\n if (!open) {\n setVisible(false)\n return\n }\n const raf = requestAnimationFrame(() => setVisible(true))\n return () => cancelAnimationFrame(raf)\n }, [open])\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Escape') {\n // the overlay owns the page — swallow Escape so it can't reach a React-tree ancestor overlay (e.g.\n // an outer Modal) even when this one isn't Escape-dismissible\n event.stopPropagation()\n if (closeOnEscape) onClose?.()\n }\n onKeyDown?.(event)\n }\n // remember where the pointer went down so the click handler can tell a scrim click from a drag that\n // started inside the content and ended on the scrim (a text-selection drag)\n const handleMouseDown = (event: MouseEvent<HTMLDivElement>) => {\n mouseDownTarget.current = event.target\n onMouseDown?.(event)\n }\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n if (\n closeOnBackdrop &&\n event.target === event.currentTarget &&\n mouseDownTarget.current === event.currentTarget\n ) {\n onClose?.()\n }\n onClick?.(event)\n }\n\n if (!open || typeof document === 'undefined') return null\n\n return createPortal(\n <div\n ref={ref}\n className={clsx(styles.overlay, className)}\n data-open={visible ? 'true' : 'false'}\n style={dim != null ? ({ '--tz-overlay-dim': dim, ...style } as CSSProperties) : style}\n onKeyDown={handleKeyDown}\n onMouseDown={handleMouseDown}\n onClick={handleClick}\n {...props}\n >\n {children}\n </div>,\n document.body,\n )\n})\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Overlay } from '../Overlay/Overlay'\nimport styles from './Modal.module.css'\n\nexport type ModalSize = 'sm' | 'md' | 'lg' | 'fullScreen'\nexport type ModalScrollBehavior = 'inside' | 'outside'\nexport type ModalPlacement = 'center' | 'left' | 'right'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\n/** Focusable descendants used by the focus trap + initial focus. */\n// every clause excludes tabindex=\"-1\" so decorative/programmatic-only nodes (e.g. the header's\n// `nonClickable aria-hidden` IconButton) don't count as trap boundaries or initial-focus targets\nconst FOCUSABLE =\n 'a[href]:not([tabindex=\"-1\"]), button:not(:disabled):not([tabindex=\"-1\"]), textarea:not(:disabled):not([tabindex=\"-1\"]), input:not(:disabled):not([tabindex=\"-1\"]), select:not(:disabled):not([tabindex=\"-1\"]), [tabindex]:not([tabindex=\"-1\"])'\n\nexport interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Whether the modal is open — gates the portal and drives the enter animation. */\n open: boolean\n /** Called when a dismiss is requested (close button, backdrop click, or Escape). */\n onClose: () => void\n /** Preset width: `sm` 360 · `md` 620 · `lg` 900 px, or `fullScreen` (fills the viewport). Defaults to `md`. */\n size?: ModalSize\n /**\n * Where overflow scrolls when the content is taller than the viewport: `outside` (default — the\n * whole dialog grows and the overlay/page scrolls) or `inside` (the body scrolls while the header +\n * footer stay pinned). Ignored for side-drawer placements (`left`/`right`), which always scroll inside.\n */\n scrollBehavior?: ModalScrollBehavior\n /**\n * Where the dialog sits: `center` (default — the standard centered modal), or `left` / `right` to\n * make it a **full-height side drawer** (sheet) that slides in from that edge. A drawer takes its\n * width from `size`, fills the viewport height, and always scrolls its body inside (header + footer\n * stay pinned).\n */\n placement?: ModalPlacement\n /** Header title. When set, labels the dialog (`aria-labelledby`). */\n title?: ReactNode\n /** Muted description line under the title (e.g. a confirm prompt). */\n description?: ReactNode\n /** Leading header icon shown in a tinted box (like `Card`) — a known `IconName` or any node. */\n icon?: IconName | ReactNode\n /** Theme color that tints the leading icon box. Defaults to `accent`. */\n color?: ThemeColor\n /** Footer slot — right-aligned actions over a top divider (e.g. Cancel / Confirm buttons). */\n footer?: ReactNode\n /** Extra class on the scrollable body element — to tune its padding / layout (e.g. a compact confirm). */\n bodyClassName?: string\n /** Show the header × close button. Defaults to `true`. */\n showCloseButton?: boolean\n /** Close when the backdrop (outside the dialog) is clicked. Defaults to `true`. */\n closeOnBackdrop?: boolean\n /** Close when Escape is pressed. Defaults to `true`. */\n closeOnEscape?: boolean\n /** Accessible label — used when there's no `title`. */\n ariaLabel?: string\n /** Dialog body. */\n children?: ReactNode\n}\n\n/**\n * A centered, backdrop-dimmed overlay dialog. Portaled to `<body>`, it locks page scroll while open,\n * traps Tab focus inside, restores focus to the previously-focused element on close, and dismisses on\n * close button / backdrop click / Escape (each toggleable). Sizes are `sm`/`md`/`lg` (max-width caps)\n * or `fullScreen`; `scrollBehavior` picks inside-body vs. whole-dialog scrolling. `placement` turns it\n * into a full-height side drawer (`left`/`right`) that slides in from the edge. The header mirrors\n * `Card` — an optional tinted `icon` box + `title` + `description`. Controlled by `open` + `onClose`.\n * The forwarded ref points at the dialog element.\n *\n * @example\n * const { isOpen, open, close } = useDisclosure()\n * <Modal open={isOpen} onClose={close} title=\"Edit\" footer={<Button onClick={close}>Done</Button>}>\n * …\n * </Modal>\n */\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n {\n open,\n onClose,\n size = 'md',\n scrollBehavior = 'outside',\n placement = 'center',\n title,\n description,\n icon,\n color = 'accent',\n footer,\n bodyClassName,\n showCloseButton = true,\n closeOnBackdrop = true,\n closeOnEscape = true,\n ariaLabel,\n className,\n style,\n children,\n ...props\n },\n forwardedRef,\n) {\n const t = useT()\n const panelRef = useRef<HTMLDivElement | null>(null)\n const bodyRef = useRef<HTMLDivElement | null>(null)\n const footerRef = useRef<HTMLDivElement | null>(null)\n const titleId = useId()\n const descId = useId()\n\n // portal + scrim + scroll-lock + fade-in + backdrop-dismiss are handled by the shared `<Overlay>`\n\n // focus management: move focus into the dialog on open — prefer a body field (form modals land on\n // their first input), else the first footer action (confirm dialogs land on Cancel/Confirm, not the\n // × button), else any control, else the dialog itself; restore focus to the trigger on close\n useEffect(() => {\n if (!open) return\n const previouslyFocused = document.activeElement as HTMLElement | null\n const target =\n bodyRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n footerRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n panelRef.current?.querySelector<HTMLElement>(FOCUSABLE) ??\n panelRef.current\n // preventScroll so opening an `outside`-scroll modal doesn't jump the overlay to a below-fold control\n target?.focus({ preventScroll: true })\n // only restore if the element is still mounted (it may have unmounted while the modal was open)\n return () => {\n if (previouslyFocused?.isConnected) previouslyFocused.focus?.()\n }\n }, [open])\n\n // merge the panel ref (positioning/focus) with the forwarded ref (consumer access)\n const setPanelRef = (node: HTMLDivElement | null) => {\n panelRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n }\n\n // trap Tab within the dialog so focus can't strand on the locked page behind it (Escape + backdrop\n // dismissal live in `<Overlay>`; this fires after the overlay's own handler)\n const handleTabTrap = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab') return\n const panel = panelRef.current\n if (!panel) return\n const focusables = [...panel.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (el) => el.offsetParent !== null || el === document.activeElement,\n )\n if (focusables.length === 0) {\n event.preventDefault()\n panel.focus()\n return\n }\n const first = focusables[0]\n const last = focusables[focusables.length - 1]\n const active = document.activeElement\n if (event.shiftKey && (active === first || active === panel)) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && active === last) {\n event.preventDefault()\n first.focus()\n }\n }\n\n if (!open) return null\n\n // a side drawer (left/right) is always full-height with the body scrolling inside (header/footer pinned)\n const isDrawer = placement !== 'center'\n\n const renderedIcon =\n icon == null ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n const hasHeader = title != null || description != null || renderedIcon != null || showCloseButton\n // a divider sets the header apart from the body/footer, like Card\n const headerDivided = children != null || footer != null\n\n return (\n <Overlay\n open={open}\n onClose={onClose}\n closeOnBackdrop={closeOnBackdrop}\n closeOnEscape={closeOnEscape}\n onKeyDown={handleTabTrap}\n className={styles.overlay}\n data-size={size}\n data-placement={placement}\n data-scroll={isDrawer ? 'inside' : scrollBehavior}\n >\n <div\n ref={setPanelRef}\n className={clsx(styles.modal, styles[size], className)}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title != null ? titleId : undefined}\n aria-label={title == null ? ariaLabel : undefined}\n aria-describedby={description != null ? descId : undefined}\n tabIndex={-1}\n style={style as CSSProperties}\n {...props}\n >\n {hasHeader && (\n <div className={clsx(styles.header, headerDivided && styles.headerDivided)}>\n <div className={styles.headerMain}>\n {renderedIcon != null && (\n <IconButton\n variant=\"filled\"\n size=\"sm\"\n color={color}\n nonClickable\n aria-hidden\n className={styles.icon}\n >\n {renderedIcon}\n </IconButton>\n )}\n {(title != null || description != null) && (\n <div className={styles.headerText}>\n {title != null && (\n <div id={titleId} className={styles.title}>\n {title}\n </div>\n )}\n {description != null && (\n <div id={descId} className={styles.subtitle}>\n {description}\n </div>\n )}\n </div>\n )}\n </div>\n {showCloseButton && (\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n size=\"sm\"\n className={styles.close}\n aria-label={t('common.close')}\n onClick={onClose}\n >\n <Icon name=\"Close\" />\n </IconButton>\n )}\n </div>\n )}\n {children != null && (\n <div ref={bodyRef} className={clsx(styles.body, bodyClassName)}>\n {children}\n </div>\n )}\n {footer != null && (\n <div ref={footerRef} className={styles.footer}>\n {footer}\n </div>\n )}\n </div>\n </Overlay>\n )\n})\n"],"names":["Overlay","forwardRef","open","onClose","closeOnBackdrop","closeOnEscape","lockScroll","dim","className","style","children","onKeyDown","onMouseDown","onClick","props","ref","mouseDownTarget","useRef","visible","setVisible","useState","useLockBodyScroll","useEffect","raf","handleKeyDown","event","handleMouseDown","handleClick","createPortal","jsx","clsx","styles","ICON_NAME_SET","ICON_NAMES","FOCUSABLE","Modal","size","scrollBehavior","placement","title","description","icon","color","footer","bodyClassName","showCloseButton","ariaLabel","forwardedRef","useT","panelRef","bodyRef","footerRef","titleId","useId","descId","previouslyFocused","target","_a","_b","_c","setPanelRef","node","handleTabTrap","panel","focusables","el","first","last","active","isDrawer","renderedIcon","Icon","hasHeader","headerDivided","jsxs","IconButton"],"mappings":"kTA4CaA,EAAUC,EAAAA,WAAyC,SAC9D,CACE,KAAAC,EACA,QAAAC,EACA,gBAAAC,EAAkB,GAClB,cAAAC,EAAgB,GAChB,WAAAC,EAAa,GACb,IAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,UAAAC,EACA,YAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAkBC,EAAAA,OAA2B,IAAI,EACjD,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAS,EAAK,EAE5CC,EAAAA,kBAAkBnB,GAAQI,CAAU,EAGpCgB,EAAAA,UAAU,IAAM,CACd,GAAI,CAACpB,EAAM,CACTiB,EAAW,EAAK,EAChB,MACF,CACA,MAAMI,EAAM,sBAAsB,IAAMJ,EAAW,EAAI,CAAC,EACxD,MAAO,IAAM,qBAAqBI,CAAG,CACvC,EAAG,CAACrB,CAAI,CAAC,EAET,MAAMsB,EAAiBC,GAAyC,CAC1DA,EAAM,MAAQ,WAGhBA,EAAM,gBAAA,EACFpB,IAAeF,GAAA,MAAAA,MAErBQ,GAAA,MAAAA,EAAYc,EACd,EAGMC,EAAmBD,GAAsC,CAC7DT,EAAgB,QAAUS,EAAM,OAChCb,GAAA,MAAAA,EAAca,EAChB,EACME,EAAeF,GAAsC,CAEvDrB,GACAqB,EAAM,SAAWA,EAAM,eACvBT,EAAgB,UAAYS,EAAM,gBAElCtB,GAAA,MAAAA,KAEFU,GAAA,MAAAA,EAAUY,EACZ,EAEA,MAAI,CAACvB,GAAQ,OAAO,SAAa,IAAoB,KAE9C0B,EAAAA,aACLC,EAAAA,IAAC,MAAA,CACC,IAAAd,EACA,UAAWe,EAAAA,KAAKC,EAAO,QAASvB,CAAS,EACzC,YAAWU,E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,OACpC,SAAAY,CAAA,CACH,CAAA,CAAA,CAAA,CAEJ,CAAA,CAGN,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const x=require("react/jsx-runtime"),e=require("react"),A=require("react-dom"),R=require("clsx"),C="_root_1i027_4",F="_tooltip_1i027_13",I="_arrow_1i027_41",M="_top_1i027_49",N="_bottom_1i027_59",W="_left_1i027_69",k="_right_1i027_79",_={root:C,tooltip:F,arrow:I,top:M,bottom:N,left:W,right:k},E=8,u=8,T={top:"bottom",bottom:"top",left:"right",right:"left"};function B(o,i,l){const d=window.innerWidth,w=window.innerHeight,h=t=>t==="top"?o.top-E-i.height>=u:t==="bottom"?o.bottom+E+i.height<=w-u:t==="left"?o.left-E-i.width>=u:o.right+E+i.width<=d-u,r=!h(l)&&h(T[l])?T[l]:l,m=(t,c,f)=>t-c<u?u-(t-c):t+c>f-u?f-u-(t+c):0;if(r==="top"||r==="bottom"){const t=o.left+o.width/2;return{side:r,x:t,y:r==="top"?o.top:o.bottom,shift:m(t,i.width/2,d)}}const p=o.top+o.height/2;return{side:r,x:r==="left"?o.left:o.right,y:p,shift:m(p,i.height/2,w)}}function H({content:o,placement:i="top",color:l="primary",children:d,className:w,style:h,onKeyDown:r,...m}){const p=`${e.useId()}-tooltip`,[t,c]=e.useState(!1),[f,b]=e.useState(!1),[q,S]=e.useState(!1),[s,O]=e.useState(null),j=e.useRef(null),z=e.useRef(null),y=o!=null&&o!=="",a=e.useCallback(()=>{const n=j.current,v=z.current;!n||!v||O(B(n.getBoundingClientRect(),{width:v.offsetWidth,height:v.offsetHeight},i))},[i]);e.useEffect(()=>{t?b(!0):S(!1)},[t]),e.useLayoutEffect(()=>{if(!t||!f)return;a();const n=requestAnimationFrame(()=>S(!0));return()=>cancelAnimationFrame(n)},[t,f,a,o]),e.useEffect(()=>{if(t)return window.addEventListener("scroll",a,!0),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a,!0),window.removeEventListener("resize",a)}},[t,a]),e.useEffect(()=>{if(t||!f)return;const n=window.setTimeout(()=>b(!1),400);return()=>window.clearTimeout(n)},[t,f]);const G=n=>{n.key==="Escape"&&c(!1),r==null||r(n)};if(!y)return d;const L={"--tz-btn-rgb":`var(--tz-color-${l}-rgb)`,"--tz-btn-on":`var(--tz-color-${l}-contrast, #fff)`},P=(s==null?void 0:s.side)??i,$=Object.fromEntries(Object.entries(h??{}).filter(([n])=>n.startsWith("--")));return x.jsxs("span",{ref:j,className:R.clsx(_.root,w),style:{...L,...h},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:G,...m,children:[t?e.cloneElement(d,{"aria-describedby":p}):d,f&&typeof document<"u"&&A.createPortal(x.jsxs("span",{ref:z,role:"tooltip",id:p,className:R.clsx(_.tooltip,_[P]),"data-open":t&&q?"true":"false",style:{...L,...$,top:(s==null?void 0:s.y)??0,left:(s==null?void 0:s.x)??0,"--tz-tooltip-shift":`${(s==null?void 0:s.shift)??0}px`},onTransitionEnd:()=>{t||b(!1)},children:[o,x.jsx("span",{className:_.arrow,"aria-hidden":"true"})]}),document.body)]})}exports.Tooltip=H;
|
|
2
|
-
//# sourceMappingURL=Tooltip-Bw-1Xk2Z.cjs.map
|