@techzyapp/ui-library 1.0.41 → 1.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -8
- package/dist/AdminRoot-DufZpgdm.js +100 -0
- package/dist/AdminRoot-DufZpgdm.js.map +1 -0
- package/dist/AdminRoot-DwJ5jdXr.cjs +2 -0
- package/dist/AdminRoot-DwJ5jdXr.cjs.map +1 -0
- package/dist/Alert-C8BBxL_7.cjs +2 -0
- package/dist/Alert-C8BBxL_7.cjs.map +1 -0
- package/dist/Alert-D6oBxBdP.js +70 -0
- package/dist/Alert-D6oBxBdP.js.map +1 -0
- package/dist/AuthLayout-exuNQicH.cjs.map +1 -1
- package/dist/AuthLayout-q8pbCGdt.js.map +1 -1
- package/dist/{Breadcrumbs-B6Pii2Y_.cjs → Breadcrumbs-B-olYVdw.cjs} +2 -2
- package/dist/Breadcrumbs-B-olYVdw.cjs.map +1 -0
- package/dist/{Breadcrumbs-DKYJOdHZ.js → Breadcrumbs-cXET6OM5.js} +3 -3
- package/dist/Breadcrumbs-cXET6OM5.js.map +1 -0
- package/dist/{Button-CjsnB8gX.js → Button-0ZgdNjX-.js} +2 -2
- package/dist/{Button-CjsnB8gX.js.map → Button-0ZgdNjX-.js.map} +1 -1
- package/dist/{Button-ClVfHGBc.cjs → Button-CwrDiZek.cjs} +2 -2
- package/dist/{Button-ClVfHGBc.cjs.map → Button-CwrDiZek.cjs.map} +1 -1
- package/dist/{Calendar-CQaPEukM.js → Calendar-CxzdnzdK.js} +3 -3
- package/dist/{Calendar-CQaPEukM.js.map → Calendar-CxzdnzdK.js.map} +1 -1
- package/dist/{Calendar-BzGVX4F4.cjs → Calendar-d3CX5UJp.cjs} +2 -2
- package/dist/{Calendar-BzGVX4F4.cjs.map → Calendar-d3CX5UJp.cjs.map} +1 -1
- package/dist/Card-CjqStov5.js +129 -0
- package/dist/Card-CjqStov5.js.map +1 -0
- package/dist/Card-CxnUoWsi.cjs +2 -0
- package/dist/Card-CxnUoWsi.cjs.map +1 -0
- package/dist/{Chip-Dp8skUZ2.cjs → Chip-BkU3yx6G.cjs} +2 -2
- package/dist/Chip-BkU3yx6G.cjs.map +1 -0
- package/dist/{Chip-BjSNgaAf.js → Chip-CzJjbaKx.js} +2 -2
- package/dist/Chip-CzJjbaKx.js.map +1 -0
- package/dist/ChoiceCardGroup-C7Eengyd.cjs +2 -0
- package/dist/ChoiceCardGroup-C7Eengyd.cjs.map +1 -0
- package/dist/ChoiceCardGroup-q0yN-TeQ.js +180 -0
- package/dist/{ChoiceCardGroup-143hR0v_.cjs.map → ChoiceCardGroup-q0yN-TeQ.js.map} +1 -1
- package/dist/{CodeBlock-CcJjS0_q.js → CodeBlock-BHcvQrs9.js} +3 -3
- package/dist/CodeBlock-BHcvQrs9.js.map +1 -0
- package/dist/{CodeBlock-o_VSkAek.cjs → CodeBlock-DRBQ_S5t.cjs} +2 -2
- package/dist/CodeBlock-DRBQ_S5t.cjs.map +1 -0
- package/dist/{ColorPicker-C1hZcAbH.js → ColorPicker-BQKFdTNr.js} +51 -51
- package/dist/{ColorPicker-C1hZcAbH.js.map → ColorPicker-BQKFdTNr.js.map} +1 -1
- package/dist/ColorPicker-BzCEMN7B.cjs +2 -0
- package/dist/{ColorPicker-DY6Vk1uS.cjs.map → ColorPicker-BzCEMN7B.cjs.map} +1 -1
- package/dist/{ColorPickerPanel-BuzwmkPN.js → ColorPickerPanel-DKTKC9KH.js} +2 -2
- package/dist/{ColorPickerPanel-BuzwmkPN.js.map → ColorPickerPanel-DKTKC9KH.js.map} +1 -1
- package/dist/{ColorPickerPanel-CDrHbCfG.cjs → ColorPickerPanel-kl2jUix-.cjs} +2 -2
- package/dist/{ColorPickerPanel-CDrHbCfG.cjs.map → ColorPickerPanel-kl2jUix-.cjs.map} +1 -1
- package/dist/{ColorRamp-CVnOYlu3.cjs → ColorRamp-n7muILK3.cjs} +2 -2
- package/dist/{ColorRamp-CVnOYlu3.cjs.map → ColorRamp-n7muILK3.cjs.map} +1 -1
- package/dist/{ColorRamp-CePqEkMR.js → ColorRamp-yfMyJCyx.js} +2 -2
- package/dist/{ColorRamp-CePqEkMR.js.map → ColorRamp-yfMyJCyx.js.map} +1 -1
- package/dist/{ConfigProvider-DELhJlqo.cjs → ConfigProvider-BaiTKZKC.cjs} +2 -2
- package/dist/ConfigProvider-BaiTKZKC.cjs.map +1 -0
- package/dist/{ConfigProvider-Bgu85MsI.js → ConfigProvider-D61cpCz-.js} +2 -2
- package/dist/ConfigProvider-D61cpCz-.js.map +1 -0
- package/dist/{CopyButton-CjPyKpky.cjs → CopyButton-DlSi82gv.cjs} +2 -2
- package/dist/{CopyButton-CjPyKpky.cjs.map → CopyButton-DlSi82gv.cjs.map} +1 -1
- package/dist/{CopyButton-CgDeyJ3A.js → CopyButton-ecxn-ghi.js} +3 -3
- package/dist/{CopyButton-CgDeyJ3A.js.map → CopyButton-ecxn-ghi.js.map} +1 -1
- package/dist/DatePicker-BjZ_P21i.cjs +2 -0
- package/dist/{DatePicker-CwZ_-ElE.cjs.map → DatePicker-BjZ_P21i.cjs.map} +1 -1
- package/dist/{DatePicker-tid4OuJ2.js → DatePicker-CAGpJbDi.js} +42 -42
- package/dist/{DatePicker-tid4OuJ2.js.map → DatePicker-CAGpJbDi.js.map} +1 -1
- package/dist/{DateTimePicker-C2871cuc.js → DateTimePicker-BJmF0Su6.js} +50 -50
- package/dist/DateTimePicker-BJmF0Su6.js.map +1 -0
- package/dist/DateTimePicker-DZqWQeUL.cjs +2 -0
- package/dist/DateTimePicker-DZqWQeUL.cjs.map +1 -0
- package/dist/{DescriptionList-BWw0Fe6U.cjs → DescriptionList-CvPDn-kh.cjs} +2 -2
- package/dist/DescriptionList-CvPDn-kh.cjs.map +1 -0
- package/dist/{DescriptionList-BP4CDME5.js → DescriptionList-Knq5eCiY.js} +4 -4
- package/dist/DescriptionList-Knq5eCiY.js.map +1 -0
- package/dist/{Dropdown-DYYhzKSo.cjs → Dropdown-CMjURWYd.cjs} +2 -2
- package/dist/{Dropdown-DYYhzKSo.cjs.map → Dropdown-CMjURWYd.cjs.map} +1 -1
- package/dist/{Dropdown-CcC-Hwx4.js → Dropdown-CnDBlB02.js} +2 -2
- package/dist/{Dropdown-CcC-Hwx4.js.map → Dropdown-CnDBlB02.js.map} +1 -1
- package/dist/{EmptyState-DGHOD_jy.cjs → EmptyState-CX1g47y_.cjs} +2 -2
- package/dist/{EmptyState-DGHOD_jy.cjs.map → EmptyState-CX1g47y_.cjs.map} +1 -1
- package/dist/{EmptyState-BlmQtbSs.js → EmptyState-Dqtpmtje.js} +2 -2
- package/dist/{EmptyState-BlmQtbSs.js.map → EmptyState-Dqtpmtje.js.map} +1 -1
- package/dist/{ErrorBoundary-DL194IyB.cjs → ErrorBoundary-B8KwWXXp.cjs} +2 -2
- package/dist/{ErrorBoundary-DL194IyB.cjs.map → ErrorBoundary-B8KwWXXp.cjs.map} +1 -1
- package/dist/{ErrorBoundary-ukRaS6uS.js → ErrorBoundary-Dos7VLb-.js} +3 -3
- package/dist/{ErrorBoundary-ukRaS6uS.js.map → ErrorBoundary-Dos7VLb-.js.map} +1 -1
- package/dist/{ErrorState-BjEA0VfF.cjs → ErrorState-CwCqd2PU.cjs} +2 -2
- package/dist/{ErrorState-BjEA0VfF.cjs.map → ErrorState-CwCqd2PU.cjs.map} +1 -1
- package/dist/{ErrorState-Hfd_0MeE.js → ErrorState-KhzrGIJ-.js} +7 -7
- package/dist/{ErrorState-Hfd_0MeE.js.map → ErrorState-KhzrGIJ-.js.map} +1 -1
- package/dist/{FileCard-COc4rHe-.cjs → FileCard-DEc10T2G.cjs} +2 -2
- package/dist/FileCard-DEc10T2G.cjs.map +1 -0
- package/dist/{FileCard-CWwB8CWF.js → FileCard-SSuFS13E.js} +3 -3
- package/dist/FileCard-SSuFS13E.js.map +1 -0
- package/dist/{FileUploader-Bqy_fV7l.cjs → FileUploader-D58_6kDA.cjs} +2 -2
- package/dist/FileUploader-D58_6kDA.cjs.map +1 -0
- package/dist/{FileUploader--WOmlhSh.js → FileUploader-DfYOBFa4.js} +5 -5
- package/dist/FileUploader-DfYOBFa4.js.map +1 -0
- package/dist/{Flag-C48Zfhvb.cjs → Flag-B1ZvZVXi.cjs} +2 -2
- package/dist/{Flag-C48Zfhvb.cjs.map → Flag-B1ZvZVXi.cjs.map} +1 -1
- package/dist/{Flag-fgMTTcy8.js → Flag-BEIqYQZg.js} +2 -2
- package/dist/{Flag-fgMTTcy8.js.map → Flag-BEIqYQZg.js.map} +1 -1
- package/dist/FloatingPanel-C5c_eMQ0.js.map +1 -1
- package/dist/FloatingPanel-tGCG2nhA.cjs.map +1 -1
- package/dist/{FullscreenToggle-GjsMn1GO.js → FullscreenToggle-I_In47BB.js} +3 -3
- package/dist/{FullscreenToggle-GjsMn1GO.js.map → FullscreenToggle-I_In47BB.js.map} +1 -1
- package/dist/{FullscreenToggle-DuLaUzi_.cjs → FullscreenToggle-Po769CoC.cjs} +2 -2
- package/dist/{FullscreenToggle-DuLaUzi_.cjs.map → FullscreenToggle-Po769CoC.cjs.map} +1 -1
- package/dist/{IconButton-D3ZpI0XL.cjs → IconButton-CxSXEYce.cjs} +2 -2
- package/dist/{IconButton-D3ZpI0XL.cjs.map → IconButton-CxSXEYce.cjs.map} +1 -1
- package/dist/{IconButton-t1OhAMNc.js → IconButton-D9MCwRK_.js} +2 -2
- package/dist/{IconButton-t1OhAMNc.js.map → IconButton-D9MCwRK_.js.map} +1 -1
- package/dist/{List-CwuAJDTi.js → List-2Y3ktTcF.js} +2 -2
- package/dist/{List-CwuAJDTi.js.map → List-2Y3ktTcF.js.map} +1 -1
- package/dist/{List-B5Ppe9R1.cjs → List-CKoNx21F.cjs} +2 -2
- package/dist/{List-B5Ppe9R1.cjs.map → List-CKoNx21F.cjs.map} +1 -1
- package/dist/{ListItem-BWNIbyTh.js → ListItem-2Lr5_NRY.js} +15 -15
- package/dist/{ListItem-BWNIbyTh.js.map → ListItem-2Lr5_NRY.js.map} +1 -1
- package/dist/ListItem-DkCYXucd.cjs +2 -0
- package/dist/{ListItem-Qo1Tt6Fi.cjs.map → ListItem-DkCYXucd.cjs.map} +1 -1
- package/dist/{Loader-Cywaf7ju.cjs → Loader-5zp2MPm5.cjs} +2 -2
- package/dist/{Loader-Cywaf7ju.cjs.map → Loader-5zp2MPm5.cjs.map} +1 -1
- package/dist/{Loader-De8_GqR1.js → Loader-Bluu6z0-.js} +2 -2
- package/dist/{Loader-De8_GqR1.js.map → Loader-Bluu6z0-.js.map} +1 -1
- package/dist/{LocationPicker-DBsxCYi9.cjs → LocationPicker-CGHXTIml.cjs} +2 -2
- package/dist/{LocationPicker-DBsxCYi9.cjs.map → LocationPicker-CGHXTIml.cjs.map} +1 -1
- package/dist/{LocationPicker-UfyDBvhp.js → LocationPicker-hULpHBVG.js} +7 -7
- package/dist/{LocationPicker-UfyDBvhp.js.map → LocationPicker-hULpHBVG.js.map} +1 -1
- package/dist/{Modal-Dfwc9eIq.js → Modal-C6Zgwz_6.js} +3 -3
- package/dist/Modal-C6Zgwz_6.js.map +1 -0
- package/dist/{Modal--5EbLfMz.cjs → Modal-D9_OG53G.cjs} +2 -2
- package/dist/Modal-D9_OG53G.cjs.map +1 -0
- package/dist/{MultiSelect-lBAEcAlR.cjs → MultiSelect-BdPvjiTj.cjs} +2 -2
- package/dist/{MultiSelect-lBAEcAlR.cjs.map → MultiSelect-BdPvjiTj.cjs.map} +1 -1
- package/dist/{MultiSelect-q__o8HyU.js → MultiSelect-CHLMpim4.js} +4 -4
- package/dist/{MultiSelect-q__o8HyU.js.map → MultiSelect-CHLMpim4.js.map} +1 -1
- package/dist/{NumberField-CXH0B1Bt.js → NumberField-BlpFmetF.js} +3 -3
- package/dist/{NumberField-CXH0B1Bt.js.map → NumberField-BlpFmetF.js.map} +1 -1
- package/dist/{NumberField-DSicjq5R.cjs → NumberField-C-FZ-uRI.cjs} +2 -2
- package/dist/{NumberField-DSicjq5R.cjs.map → NumberField-C-FZ-uRI.cjs.map} +1 -1
- package/dist/OtpField-D4-r7I0A.js +174 -0
- package/dist/OtpField-D4-r7I0A.js.map +1 -0
- package/dist/OtpField-Drjy2wwq.cjs +2 -0
- package/dist/OtpField-Drjy2wwq.cjs.map +1 -0
- package/dist/{PageError-MHbSl1oT.cjs → PageError-DXUOkE14.cjs} +2 -2
- package/dist/{PageError-MHbSl1oT.cjs.map → PageError-DXUOkE14.cjs.map} +1 -1
- package/dist/{PageError-VYc07Q7W.js → PageError-DyDj1wQZ.js} +5 -5
- package/dist/{PageError-VYc07Q7W.js.map → PageError-DyDj1wQZ.js.map} +1 -1
- package/dist/{PageLayout-Bt6U_80d.cjs → PageLayout-CoG0AaUs.cjs} +2 -2
- package/dist/PageLayout-CoG0AaUs.cjs.map +1 -0
- package/dist/{PageLayout-Df1SOlr7.js → PageLayout-nsJa8CbT.js} +4 -4
- package/dist/PageLayout-nsJa8CbT.js.map +1 -0
- package/dist/{PageNotFound-BWfaomjC.js → PageNotFound-BNNwMkwE.js} +5 -5
- package/dist/{PageNotFound-BWfaomjC.js.map → PageNotFound-BNNwMkwE.js.map} +1 -1
- package/dist/{PageNotFound-e4ITkqDC.cjs → PageNotFound-CGSxT_n9.cjs} +2 -2
- package/dist/{PageNotFound-e4ITkqDC.cjs.map → PageNotFound-CGSxT_n9.cjs.map} +1 -1
- package/dist/Pagination-CZtewveA.cjs +2 -0
- package/dist/Pagination-CZtewveA.cjs.map +1 -0
- package/dist/Pagination-tuWRnGwR.js +139 -0
- package/dist/Pagination-tuWRnGwR.js.map +1 -0
- package/dist/{PaletteField-D4c-Q1PG.js → PaletteField-CTPl3D43.js} +3 -3
- package/dist/{PaletteField-D4c-Q1PG.js.map → PaletteField-CTPl3D43.js.map} +1 -1
- package/dist/{PaletteField-DnUpn2zP.cjs → PaletteField-PDcu2vUp.cjs} +2 -2
- package/dist/{PaletteField-DnUpn2zP.cjs.map → PaletteField-PDcu2vUp.cjs.map} +1 -1
- package/dist/{PhoneField-BTB2_Lo1.cjs → PhoneField-BPYg5ZHW.cjs} +2 -2
- package/dist/{PhoneField-BTB2_Lo1.cjs.map → PhoneField-BPYg5ZHW.cjs.map} +1 -1
- package/dist/{PhoneField-BY5hapKk.js → PhoneField-pdWDCszb.js} +4 -4
- package/dist/{PhoneField-BY5hapKk.js.map → PhoneField-pdWDCszb.js.map} +1 -1
- package/dist/{Popconfirm-BXa5qLHY.js → Popconfirm-CMVzLaC_.js} +3 -3
- package/dist/{Popconfirm-BXa5qLHY.js.map → Popconfirm-CMVzLaC_.js.map} +1 -1
- package/dist/{Popconfirm-PkVgBrL-.cjs → Popconfirm-cNpJmkuR.cjs} +2 -2
- package/dist/{Popconfirm-PkVgBrL-.cjs.map → Popconfirm-cNpJmkuR.cjs.map} +1 -1
- package/dist/Popover-DsYUT23r.cjs.map +1 -1
- package/dist/Popover-WaVH3jsN.js.map +1 -1
- package/dist/{Progress-bId4RkgJ.js → Progress-BNEFGn-O.js} +2 -2
- package/dist/{Progress-bId4RkgJ.js.map → Progress-BNEFGn-O.js.map} +1 -1
- package/dist/{Progress-R_Vt4gJA.cjs → Progress-x12Rkh06.cjs} +2 -2
- package/dist/{Progress-R_Vt4gJA.cjs.map → Progress-x12Rkh06.cjs.map} +1 -1
- package/dist/QrCode-CrNJZV_8.js +81 -0
- package/dist/QrCode-CrNJZV_8.js.map +1 -0
- package/dist/QrCode-TcQQE0h7.cjs +2 -0
- package/dist/QrCode-TcQQE0h7.cjs.map +1 -0
- package/dist/{RemoveDialog-Dh_q5jZF.js → RemoveDialog-ARFp1UJM.js} +5 -5
- package/dist/{RemoveDialog-Dh_q5jZF.js.map → RemoveDialog-ARFp1UJM.js.map} +1 -1
- package/dist/{RemoveDialog-Cvj-DaiY.cjs → RemoveDialog-IWOAQFNK.cjs} +2 -2
- package/dist/{RemoveDialog-Cvj-DaiY.cjs.map → RemoveDialog-IWOAQFNK.cjs.map} +1 -1
- package/dist/RichTextEditor-C9jT2cLl.cjs +2 -0
- package/dist/RichTextEditor-C9jT2cLl.cjs.map +1 -0
- package/dist/{RichTextEditor-Dv-LDsN-.js → RichTextEditor-DrwJUEYz.js} +148 -148
- package/dist/RichTextEditor-DrwJUEYz.js.map +1 -0
- package/dist/RootLayout-CZ2GQ8XA.js +647 -0
- package/dist/RootLayout-CZ2GQ8XA.js.map +1 -0
- package/dist/RootLayout-DStUP263.cjs +2 -0
- package/dist/RootLayout-DStUP263.cjs.map +1 -0
- package/dist/{Select-DdkJXkw-.cjs → Select-C2DIfuoB.cjs} +2 -2
- package/dist/{Select-DdkJXkw-.cjs.map → Select-C2DIfuoB.cjs.map} +1 -1
- package/dist/{Select-Bw8Q86ts.js → Select-KGsA8PbI.js} +3 -3
- package/dist/{Select-Bw8Q86ts.js.map → Select-KGsA8PbI.js.map} +1 -1
- package/dist/{Sidebar-CGL5hvpl.js → Sidebar-_pcwxdd8.js} +133 -131
- package/dist/{Sidebar-CGL5hvpl.js.map → Sidebar-_pcwxdd8.js.map} +1 -1
- package/dist/Sidebar-wK1_xaY_.cjs +2 -0
- package/dist/{Sidebar-CfEx7W7i.cjs.map → Sidebar-wK1_xaY_.cjs.map} +1 -1
- package/dist/Slider-CXAz9SUY.cjs +2 -0
- package/dist/Slider-CXAz9SUY.cjs.map +1 -0
- package/dist/Slider-Cpc5_dPl.js +185 -0
- package/dist/Slider-Cpc5_dPl.js.map +1 -0
- package/dist/{SpeedDial-jOxWEd09.cjs → SpeedDial-BT_boD06.cjs} +2 -2
- package/dist/{SpeedDial-jOxWEd09.cjs.map → SpeedDial-BT_boD06.cjs.map} +1 -1
- package/dist/{SpeedDial-C-yLmnk7.js → SpeedDial-SMMfes9f.js} +2 -2
- package/dist/{SpeedDial-C-yLmnk7.js.map → SpeedDial-SMMfes9f.js.map} +1 -1
- package/dist/{Stepper-D7An-ugU.cjs → Stepper-BmA_DjTS.cjs} +2 -2
- package/dist/Stepper-BmA_DjTS.cjs.map +1 -0
- package/dist/{Stepper-DYpiLhzD.js → Stepper-CR0Mlkq7.js} +2 -2
- package/dist/Stepper-CR0Mlkq7.js.map +1 -0
- package/dist/{Table-BhaH8EKZ.cjs → Table-BkjY1Lwt.cjs} +2 -2
- package/dist/Table-BkjY1Lwt.cjs.map +1 -0
- package/dist/{Table-DK4GBKS3.js → Table-D-F68lcm.js} +18 -18
- package/dist/Table-D-F68lcm.js.map +1 -0
- package/dist/{Tabs-6x4vC8je.cjs → Tabs-Cgp6D1WP.cjs} +2 -2
- package/dist/{Tabs-6x4vC8je.cjs.map → Tabs-Cgp6D1WP.cjs.map} +1 -1
- package/dist/{Tabs-CWiDeqqW.js → Tabs-DP0aZ5TB.js} +2 -2
- package/dist/{Tabs-CWiDeqqW.js.map → Tabs-DP0aZ5TB.js.map} +1 -1
- package/dist/TagsField-9nKu6ZW4.cjs +2 -0
- package/dist/TagsField-9nKu6ZW4.cjs.map +1 -0
- package/dist/{TagsField-Cg9YVl7G.js → TagsField-CcY9MTMw.js} +64 -64
- package/dist/TagsField-CcY9MTMw.js.map +1 -0
- package/dist/{TextField-5nQkU8HP.js → TextField-0WvJsHhA.js} +3 -3
- package/dist/{TextField-5nQkU8HP.js.map → TextField-0WvJsHhA.js.map} +1 -1
- package/dist/{TextField-BRaoadxk.cjs → TextField-C5MgCQIV.cjs} +2 -2
- package/dist/{TextField-BRaoadxk.cjs.map → TextField-C5MgCQIV.cjs.map} +1 -1
- package/dist/{ThemeToggle-DhaVEyPL.cjs → ThemeToggle-BvcCxRpF.cjs} +2 -2
- package/dist/{ThemeToggle-DhaVEyPL.cjs.map → ThemeToggle-BvcCxRpF.cjs.map} +1 -1
- package/dist/{ThemeToggle-DXpbooYn.js → ThemeToggle-DmCePuTy.js} +3 -3
- package/dist/{ThemeToggle-DXpbooYn.js.map → ThemeToggle-DmCePuTy.js.map} +1 -1
- package/dist/{TimeColumns-girAEgEN.cjs → TimeColumns-Q-vsHFZU.cjs} +2 -2
- package/dist/{TimeColumns-girAEgEN.cjs.map → TimeColumns-Q-vsHFZU.cjs.map} +1 -1
- package/dist/{TimeColumns-C_gdJn__.js → TimeColumns-WJRHQuFv.js} +2 -2
- package/dist/{TimeColumns-C_gdJn__.js.map → TimeColumns-WJRHQuFv.js.map} +1 -1
- package/dist/TimePicker-CvbQFzBf.cjs +2 -0
- package/dist/{TimePicker-_Ak5yB_5.cjs.map → TimePicker-CvbQFzBf.cjs.map} +1 -1
- package/dist/{TimePicker-DHdsY8kQ.js → TimePicker-DJDuSxAg.js} +54 -54
- package/dist/{TimePicker-DHdsY8kQ.js.map → TimePicker-DJDuSxAg.js.map} +1 -1
- package/dist/{Toaster-Dput5iLU.js → Toaster-Bb5YEN5j.js} +2 -2
- package/dist/{Toaster-Dput5iLU.js.map → Toaster-Bb5YEN5j.js.map} +1 -1
- package/dist/{Toaster-fjyF8W3F.cjs → Toaster-Dy1AonLa.cjs} +2 -2
- package/dist/{Toaster-fjyF8W3F.cjs.map → Toaster-Dy1AonLa.cjs.map} +1 -1
- package/dist/TranslatedFields-CuK5KKzE.cjs +2 -0
- package/dist/TranslatedFields-CuK5KKzE.cjs.map +1 -0
- package/dist/TranslatedFields-DKXznBtD.js +86 -0
- package/dist/TranslatedFields-DKXznBtD.js.map +1 -0
- package/dist/{UserCard-B9bzkZph.cjs → UserCard-DbudGMvG.cjs} +2 -2
- package/dist/UserCard-DbudGMvG.cjs.map +1 -0
- package/dist/{UserCard-DYK6S-nr.js → UserCard-UG_Cwe-Y.js} +3 -3
- package/dist/UserCard-UG_Cwe-Y.js.map +1 -0
- package/dist/app/AdminRoot.d.cts +5 -2
- package/dist/app/AdminRoot.d.ts +5 -2
- package/dist/components/Alert/Alert.d.cts +1 -1
- package/dist/components/Alert/Alert.d.ts +1 -1
- package/dist/components/Alert/index.cjs +1 -1
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/AuthLayout/AuthLayout.d.cts +2 -2
- package/dist/components/AuthLayout/AuthLayout.d.ts +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.d.cts +2 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +2 -1
- package/dist/components/Breadcrumbs/index.cjs +1 -1
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Card/Card.d.cts +1 -1
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/index.cjs +1 -1
- package/dist/components/Card/index.js +1 -1
- package/dist/components/Chip/Chip.d.cts +1 -1
- package/dist/components/Chip/Chip.d.ts +1 -1
- package/dist/components/Chip/index.cjs +1 -1
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/ChoiceCard/ChoiceCard.d.cts +1 -1
- package/dist/components/ChoiceCard/ChoiceCard.d.ts +1 -1
- package/dist/components/ChoiceCard/index.cjs +1 -1
- package/dist/components/ChoiceCard/index.js +1 -1
- package/dist/components/CodeBlock/CodeBlock.d.cts +1 -1
- package/dist/components/CodeBlock/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock/index.cjs +1 -1
- package/dist/components/CodeBlock/index.js +1 -1
- package/dist/components/ColorPicker/index.cjs +1 -1
- package/dist/components/ColorPicker/index.js +1 -1
- package/dist/components/ColorRamp/index.cjs +1 -1
- package/dist/components/ColorRamp/index.js +1 -1
- package/dist/components/CopyButton/index.cjs +1 -1
- package/dist/components/CopyButton/index.js +1 -1
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.d.cts +2 -2
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +2 -2
- package/dist/components/DateTimePicker/index.cjs +1 -1
- package/dist/components/DateTimePicker/index.js +1 -1
- package/dist/components/DescriptionList/DescriptionList.d.cts +1 -1
- package/dist/components/DescriptionList/DescriptionList.d.ts +1 -1
- package/dist/components/DescriptionList/index.cjs +1 -1
- package/dist/components/DescriptionList/index.js +1 -1
- package/dist/components/Dropdown/index.cjs +1 -1
- package/dist/components/Dropdown/index.js +1 -1
- package/dist/components/EmptyState/index.cjs +1 -1
- package/dist/components/EmptyState/index.js +1 -1
- package/dist/components/ErrorState/index.cjs +1 -1
- package/dist/components/ErrorState/index.js +2 -2
- package/dist/components/FileCard/FileCard.d.cts +5 -2
- package/dist/components/FileCard/FileCard.d.ts +5 -2
- package/dist/components/FileCard/index.cjs +1 -1
- package/dist/components/FileCard/index.js +1 -1
- package/dist/components/FileUploader/FileUploader.d.cts +5 -5
- package/dist/components/FileUploader/FileUploader.d.ts +5 -5
- package/dist/components/FileUploader/index.cjs +1 -1
- package/dist/components/FileUploader/index.js +1 -1
- package/dist/components/Flag/index.cjs +1 -1
- package/dist/components/Flag/index.js +1 -1
- package/dist/components/FloatingPanel/FloatingPanel.d.cts +6 -5
- package/dist/components/FloatingPanel/FloatingPanel.d.ts +6 -5
- package/dist/components/FullscreenToggle/index.cjs +1 -1
- package/dist/components/FullscreenToggle/index.js +1 -1
- package/dist/components/IconButton/index.cjs +1 -1
- package/dist/components/IconButton/index.js +1 -1
- package/dist/components/List/index.cjs +1 -1
- package/dist/components/List/index.js +2 -2
- package/dist/components/Loader/Loader.d.cts +1 -1
- package/dist/components/Loader/Loader.d.ts +1 -1
- package/dist/components/Loader/index.cjs +1 -1
- package/dist/components/Loader/index.js +1 -1
- package/dist/components/LocationPicker/index.cjs +1 -1
- package/dist/components/LocationPicker/index.js +1 -1
- package/dist/components/Modal/Modal.d.cts +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/MultiSelect/index.cjs +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/NumberField/index.cjs +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/OtpField/OtpField.d.cts +1 -1
- package/dist/components/OtpField/OtpField.d.ts +1 -1
- package/dist/components/OtpField/index.cjs +1 -1
- package/dist/components/OtpField/index.js +1 -1
- package/dist/components/PageError/index.cjs +1 -1
- package/dist/components/PageError/index.js +1 -1
- package/dist/components/PageLayout/PageLayout.d.cts +2 -2
- package/dist/components/PageLayout/PageLayout.d.ts +2 -2
- package/dist/components/PageLayout/index.cjs +1 -1
- package/dist/components/PageLayout/index.js +1 -1
- package/dist/components/PageNotFound/index.cjs +1 -1
- package/dist/components/PageNotFound/index.js +1 -1
- package/dist/components/Pagination/index.cjs +1 -1
- package/dist/components/Pagination/index.js +1 -1
- package/dist/components/PaletteField/index.cjs +1 -1
- package/dist/components/PaletteField/index.js +1 -1
- package/dist/components/PhoneField/index.cjs +1 -1
- package/dist/components/PhoneField/index.js +1 -1
- package/dist/components/Popconfirm/index.cjs +1 -1
- package/dist/components/Popconfirm/index.js +1 -1
- package/dist/components/Popover/Popover.d.cts +1 -1
- package/dist/components/Popover/Popover.d.ts +1 -1
- package/dist/components/Progress/index.cjs +1 -1
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/QrCode/QrCode.d.cts +5 -2
- package/dist/components/QrCode/QrCode.d.ts +5 -2
- package/dist/components/QrCode/index.cjs +1 -1
- package/dist/components/QrCode/index.js +1 -1
- package/dist/components/RemoveDialog/index.cjs +1 -1
- package/dist/components/RemoveDialog/index.js +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.d.cts +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RootLayout/RootLayout.d.cts +12 -5
- package/dist/components/RootLayout/RootLayout.d.ts +12 -5
- package/dist/components/RootLayout/index.cjs +1 -1
- package/dist/components/RootLayout/index.js +1 -1
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Sidebar/index.cjs +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/Slider/Slider.d.cts +2 -2
- package/dist/components/Slider/Slider.d.ts +2 -2
- package/dist/components/Slider/index.cjs +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/SpeedDial/index.cjs +1 -1
- package/dist/components/SpeedDial/index.js +1 -1
- package/dist/components/Stepper/Stepper.d.cts +2 -2
- package/dist/components/Stepper/Stepper.d.ts +2 -2
- package/dist/components/Stepper/index.cjs +1 -1
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/Table/Table.d.cts +1 -1
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tabs/index.cjs +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/TagsField/TagsField.d.cts +1 -1
- package/dist/components/TagsField/TagsField.d.ts +1 -1
- package/dist/components/TagsField/index.cjs +1 -1
- package/dist/components/TagsField/index.js +1 -1
- package/dist/components/TextField/index.cjs +1 -1
- package/dist/components/TextField/index.js +1 -1
- package/dist/components/ThemeToggle/index.cjs +1 -1
- package/dist/components/ThemeToggle/index.js +1 -1
- package/dist/components/TimePicker/index.cjs +1 -1
- package/dist/components/TimePicker/index.js +1 -1
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/TranslatedFields/TranslatedFields.d.cts +1 -1
- package/dist/components/TranslatedFields/TranslatedFields.d.ts +1 -1
- package/dist/components/TranslatedFields/index.cjs +1 -1
- package/dist/components/TranslatedFields/index.js +1 -1
- package/dist/components/UserCard/UserCard.d.cts +6 -5
- package/dist/components/UserCard/UserCard.d.ts +6 -5
- package/dist/components/UserCard/index.cjs +1 -1
- package/dist/components/UserCard/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 +56 -56
- package/dist/entries/i18n.cjs +1 -1
- package/dist/entries/i18n.js +2 -2
- package/dist/entries/theme.cjs +1 -1
- package/dist/entries/theme.js +1 -1
- package/dist/form/useForm.d.cts +1 -1
- package/dist/form/useForm.d.ts +1 -1
- package/dist/hooks/useMediaQuery.d.cts +3 -3
- package/dist/hooks/useMediaQuery.d.ts +3 -3
- package/dist/i18n/messages.d.cts +20 -0
- package/dist/i18n/messages.d.ts +20 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +3 -3
- package/dist/index.js +59 -59
- package/dist/{messages-BasxRpyx.js → messages-BiRLMy1E.js} +177 -37
- package/dist/messages-BiRLMy1E.js.map +1 -0
- package/dist/{messages-CElolVGm.cjs → messages-C_fRRCg6.cjs} +9 -9
- package/dist/messages-C_fRRCg6.cjs.map +1 -0
- package/dist/theme/ConfigProvider.d.cts +19 -10
- package/dist/theme/ConfigProvider.d.ts +19 -10
- package/dist/useForm-CGbJ44Gp.js.map +1 -1
- package/dist/useForm-CSw6r1n1.cjs.map +1 -1
- package/dist/{useHomeTo-BnjXms11.cjs → useHomeTo-BaM7kBDh.cjs} +2 -2
- package/dist/{useHomeTo-BnjXms11.cjs.map → useHomeTo-BaM7kBDh.cjs.map} +1 -1
- package/dist/{useHomeTo-Btkk0RSB.js → useHomeTo-DQj9tVZI.js} +2 -2
- package/dist/{useHomeTo-Btkk0RSB.js.map → useHomeTo-DQj9tVZI.js.map} +1 -1
- package/dist/useMediaQuery-CHMrI6Dy.cjs.map +1 -1
- package/dist/useMediaQuery-DrDUrkmJ.js.map +1 -1
- package/dist/{useOptionMenu-IebDGoqk.cjs → useOptionMenu-BKC1y6oj.cjs} +2 -2
- package/dist/{useOptionMenu-IebDGoqk.cjs.map → useOptionMenu-BKC1y6oj.cjs.map} +1 -1
- package/dist/{useOptionMenu-DeW68na-.js → useOptionMenu-Dom1-bqm.js} +5 -5
- package/dist/{useOptionMenu-DeW68na-.js.map → useOptionMenu-Dom1-bqm.js.map} +1 -1
- package/package.json +1 -1
- package/dist/AdminRoot-aOYQtzF0.js +0 -109
- package/dist/AdminRoot-aOYQtzF0.js.map +0 -1
- package/dist/AdminRoot-ajWIf94J.cjs +0 -2
- package/dist/AdminRoot-ajWIf94J.cjs.map +0 -1
- package/dist/Alert-5tpyGb2M.cjs +0 -2
- package/dist/Alert-5tpyGb2M.cjs.map +0 -1
- package/dist/Alert-Dz0sNGpz.js +0 -70
- package/dist/Alert-Dz0sNGpz.js.map +0 -1
- package/dist/Breadcrumbs-B6Pii2Y_.cjs.map +0 -1
- package/dist/Breadcrumbs-DKYJOdHZ.js.map +0 -1
- package/dist/Card-CIRGqg3P.cjs +0 -2
- package/dist/Card-CIRGqg3P.cjs.map +0 -1
- package/dist/Card-Co3A4Qgo.js +0 -128
- package/dist/Card-Co3A4Qgo.js.map +0 -1
- package/dist/Chip-BjSNgaAf.js.map +0 -1
- package/dist/Chip-Dp8skUZ2.cjs.map +0 -1
- package/dist/ChoiceCardGroup-143hR0v_.cjs +0 -2
- package/dist/ChoiceCardGroup-Cx8CtmPl.js +0 -180
- package/dist/ChoiceCardGroup-Cx8CtmPl.js.map +0 -1
- package/dist/CodeBlock-CcJjS0_q.js.map +0 -1
- package/dist/CodeBlock-o_VSkAek.cjs.map +0 -1
- package/dist/ColorPicker-DY6Vk1uS.cjs +0 -2
- package/dist/ConfigProvider-Bgu85MsI.js.map +0 -1
- package/dist/ConfigProvider-DELhJlqo.cjs.map +0 -1
- package/dist/DatePicker-CwZ_-ElE.cjs +0 -2
- package/dist/DateTimePicker-C2871cuc.js.map +0 -1
- package/dist/DateTimePicker-DdEPtw9U.cjs +0 -2
- package/dist/DateTimePicker-DdEPtw9U.cjs.map +0 -1
- package/dist/DescriptionList-BP4CDME5.js.map +0 -1
- package/dist/DescriptionList-BWw0Fe6U.cjs.map +0 -1
- package/dist/FileCard-COc4rHe-.cjs.map +0 -1
- package/dist/FileCard-CWwB8CWF.js.map +0 -1
- package/dist/FileUploader--WOmlhSh.js.map +0 -1
- package/dist/FileUploader-Bqy_fV7l.cjs.map +0 -1
- package/dist/ListItem-Qo1Tt6Fi.cjs +0 -2
- package/dist/Modal--5EbLfMz.cjs.map +0 -1
- package/dist/Modal-Dfwc9eIq.js.map +0 -1
- package/dist/OtpField-Dy-LKTi9.js +0 -174
- package/dist/OtpField-Dy-LKTi9.js.map +0 -1
- package/dist/OtpField-KHwdaajC.cjs +0 -2
- package/dist/OtpField-KHwdaajC.cjs.map +0 -1
- package/dist/PageLayout-Bt6U_80d.cjs.map +0 -1
- package/dist/PageLayout-Df1SOlr7.js.map +0 -1
- package/dist/Pagination-DDMq_7OZ.js +0 -139
- package/dist/Pagination-DDMq_7OZ.js.map +0 -1
- package/dist/Pagination-UMeckhmY.cjs +0 -2
- package/dist/Pagination-UMeckhmY.cjs.map +0 -1
- package/dist/QrCode-B9YbQNVc.js +0 -80
- package/dist/QrCode-B9YbQNVc.js.map +0 -1
- package/dist/QrCode-CNVYpz9j.cjs +0 -2
- package/dist/QrCode-CNVYpz9j.cjs.map +0 -1
- package/dist/RichTextEditor-Dv-LDsN-.js.map +0 -1
- package/dist/RichTextEditor-lmPGowSR.cjs +0 -2
- package/dist/RichTextEditor-lmPGowSR.cjs.map +0 -1
- package/dist/RootLayout-B_ZtI-L_.cjs +0 -2
- package/dist/RootLayout-B_ZtI-L_.cjs.map +0 -1
- package/dist/RootLayout-DIOquzrU.js +0 -642
- package/dist/RootLayout-DIOquzrU.js.map +0 -1
- package/dist/Sidebar-CfEx7W7i.cjs +0 -2
- package/dist/Slider-0joKXhPo.cjs +0 -2
- package/dist/Slider-0joKXhPo.cjs.map +0 -1
- package/dist/Slider-CwZYxDO0.js +0 -184
- package/dist/Slider-CwZYxDO0.js.map +0 -1
- package/dist/Stepper-D7An-ugU.cjs.map +0 -1
- package/dist/Stepper-DYpiLhzD.js.map +0 -1
- package/dist/Table-BhaH8EKZ.cjs.map +0 -1
- package/dist/Table-DK4GBKS3.js.map +0 -1
- package/dist/TagsField-Cg9YVl7G.js.map +0 -1
- package/dist/TagsField-DwZLCIeb.cjs +0 -2
- package/dist/TagsField-DwZLCIeb.cjs.map +0 -1
- package/dist/TimePicker-_Ak5yB_5.cjs +0 -2
- package/dist/TranslatedFields-B-BU17IV.cjs +0 -2
- package/dist/TranslatedFields-B-BU17IV.cjs.map +0 -1
- package/dist/TranslatedFields-JnqLgUiF.js +0 -86
- package/dist/TranslatedFields-JnqLgUiF.js.map +0 -1
- package/dist/UserCard-B9bzkZph.cjs.map +0 -1
- package/dist/UserCard-DYK6S-nr.js.map +0 -1
- package/dist/messages-BasxRpyx.js.map +0 -1
- package/dist/messages-CElolVGm.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton-
|
|
1
|
+
{"version":3,"file":"IconButton-D9MCwRK_.js","sources":["../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import {\n cloneElement,\n forwardRef,\n isValidElement,\n type ButtonHTMLAttributes,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { Loader } from '../Loader'\nimport styles from './IconButton.module.css'\n\nexport type IconButtonVariant = 'contained' | 'filled' | 'outlined' | 'text'\nexport type IconButtonSize = 'sm' | 'md' | 'lg'\n\nexport interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'> {\n /** Visual style. `contained` solid · `filled` soft tint · `outlined` border · `text` bare. */\n variant?: IconButtonVariant\n /** Theme palette token that tints the button. Defaults to `accent`. */\n color?: ThemeColor\n /** Preset size — square: width === height === `--tz-control-height-*` (matches `Button` heights). */\n size?: IconButtonSize\n /** Shows the loader in the icon's place and blocks interaction (also sets the native `disabled`). */\n loading?: boolean\n /** Circular shape instead of the default rounded square. */\n rounded?: boolean\n /** Ignores all interaction (no clicks, hover or focus) while keeping the normal look — unlike `disabled`, it's not dimmed. */\n nonClickable?: boolean\n /** The icon to render — typically an `<Icon />`. Swapped for the loader while `loading`. */\n children?: ReactNode\n}\n\n/**\n * A square, text-less button for a single icon. Shares `Button`'s variants,\n * colors and sizing, but its width equals its height (the matching\n * `--tz-control-height-*`). Pass an `<Icon />` (or any node) as the child;\n * while `loading` it's replaced by the `Loader`. Provide an `aria-label` since\n * there's no visible text.\n */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n {\n variant = 'contained',\n color = 'accent',\n size = 'md',\n loading = false,\n rounded = false,\n disabled = false,\n nonClickable = false,\n className,\n style,\n type = 'button',\n tabIndex,\n children,\n ...props\n },\n ref,\n) {\n // size the icon child to match the button (an explicit icon `size` still wins)\n const icon =\n isValidElement(children) && !loading\n ? cloneElement(children as ReactElement<{ size?: IconButtonSize }>, {\n size: (children.props as { size?: IconButtonSize }).size ?? size,\n })\n : children\n\n return (\n <button\n ref={ref}\n type={type}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n aria-disabled={nonClickable || undefined}\n tabIndex={nonClickable ? -1 : tabIndex}\n className={clsx(\n styles.iconButton,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n loading && styles.loading,\n disabled && styles.disabled,\n nonClickable && styles.nonClickable,\n className,\n )}\n style={\n {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n }\n {...props}\n >\n {loading ? <Loader size={size} aria-hidden=\"true\" /> : icon}\n </button>\n )\n})\n"],"names":["IconButton","forwardRef","variant","color","size","loading","rounded","disabled","nonClickable","className","style","type","tabIndex","children","props","ref","icon","isValidElement","cloneElement","jsx","clsx","styles","Loader"],"mappings":";;;;;;;;;;;;;;;;;GAyCaA,IAAaC,EAA+C,SACvE;AAAA,EACE,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,cAAAC,IAAe;AAAA,EACf,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AAEA,QAAMC,IACJC,EAAeJ,CAAQ,KAAK,CAACR,IACzBa,EAAaL,GAAqD;AAAA,IAChE,MAAOA,EAAS,MAAoC,QAAQT;AAAA,EAAA,CAC7D,IACDS;AAEN,SACE,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAJ;AAAA,MACA,MAAAJ;AAAA,MACA,UAAUJ,KAAYF;AAAA,MACtB,aAAWA,KAAW;AAAA,MACtB,iBAAeG,KAAgB;AAAA,MAC/B,UAAUA,IAAe,KAAKI;AAAA,MAC9B,WAAWQ;AAAA,QACTC,EAAO;AAAA,QACPA,EAAOnB,CAAO;AAAA,QACdmB,EAAOjB,CAAI;AAAA,QACXE,KAAWe,EAAO;AAAA,QAClBhB,KAAWgB,EAAO;AAAA,QAClBd,KAAYc,EAAO;AAAA,QACnBb,KAAgBa,EAAO;AAAA,QACvBZ;AAAA,MAAA;AAAA,MAEF,OACE;AAAA,QACE,gBAAgB,kBAAkBN,CAAK;AAAA,QACvC,eAAe,kBAAkBA,CAAK;AAAA,QACtC,GAAGO;AAAA,MAAA;AAAA,MAGN,GAAGI;AAAA,MAEH,cAAU,gBAAAK,EAACG,GAAA,EAAO,MAAAlB,GAAY,eAAY,QAAO,IAAKY;AAAA,IAAA;AAAA,EAAA;AAG7D,CAAC;"}
|
|
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as v, useMemo as y } from "react";
|
|
3
3
|
import { s as n } from "./Flex-BFn4P1tJ.js";
|
|
4
4
|
import { S as o } from "./Skeleton-_-uGax2j.js";
|
|
5
|
-
import { a as w, L as b } from "./ListItem-
|
|
5
|
+
import { a as w, L as b } from "./ListItem-2Lr5_NRY.js";
|
|
6
6
|
const I = v(function({ as: m, gap: a = 2, padding: c, role: p = "list", size: i, flush: s, loading: e = !1, style: f, children: d, ...l }, h) {
|
|
7
7
|
const u = m ?? "div", x = y(() => ({ size: i, flush: s }), [i, s]), L = typeof e == "number" ? e : e ? 3 : 0;
|
|
8
8
|
return /* @__PURE__ */ t(
|
|
@@ -35,4 +35,4 @@ const I = v(function({ as: m, gap: a = 2, padding: c, role: p = "list", size: i,
|
|
|
35
35
|
export {
|
|
36
36
|
I as L
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=List-
|
|
38
|
+
//# sourceMappingURL=List-2Y3ktTcF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List-
|
|
1
|
+
{"version":3,"file":"List-2Y3ktTcF.js","sources":["../src/components/List/List.tsx"],"sourcesContent":["import {\n forwardRef,\n useMemo,\n type CSSProperties,\n type ElementType,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { space, type Spacing } from '../Flex/Flex'\nimport { Skeleton } from '../Skeleton'\nimport { ListContext } from './listContext'\nimport { ListItem, type ListItemSize } from './ListItem'\n\nexport interface ListProps extends HTMLAttributes<HTMLElement> {\n /** Render a different element — e.g. `'ul'`, `'nav'`, `'menu'`. Defaults to `div`. */\n as?: ElementType\n /** Gap between items (token key, px number, or CSS value). Defaults to `2px`. */\n gap?: Spacing\n /** Padding around the list (token key, px number, or CSS value). */\n padding?: Spacing\n /** Default size for the contained `ListItem`s — each item can still override its own `size`. */\n size?: ListItemSize\n /**\n * Default `flush` for the contained `ListItem`s — drops their left / right padding so rows sit flush with\n * the list's edges (e.g. inside a padded `Card`). Each item can still override its own `flush`.\n */\n flush?: boolean\n /**\n * Render skeleton rows instead of `children` — `true` shows 3, a number sets the count. Each row is a\n * `ListItem` with an icon disc, a label line and a description line. Defaults to `false`.\n */\n loading?: boolean | number\n children?: ReactNode\n}\n\n/**\n * A thin semantic container for `ListItem`s — a vertical stack with a configurable `gap`/`padding`\n * and `role=\"list\"` (override `role` to `\"menu\"` for a dropdown, etc.). `size` and `flush` set defaults\n * for all contained `ListItem`s (an explicit item prop wins). `loading` swaps the items for skeleton rows. Layout is set via inline style, matching the `Flex`/`Grid` primitives.\n */\nexport const List = forwardRef<HTMLElement, ListProps>(function List(\n { as, gap = 2, padding, role = 'list', size, flush, loading = false, style, children, ...props },\n ref,\n) {\n const Component = (as ?? 'div') as ElementType\n // one stable object per (size, flush) so items don't re-render on every List render\n const ctx = useMemo(() => ({ size, flush }), [size, flush])\n const skeletonRows = typeof loading === 'number' ? loading : loading ? 3 : 0\n return (\n <Component\n ref={ref}\n role={role}\n aria-busy={loading ? true : undefined}\n style={\n {\n display: 'flex',\n flexDirection: 'column',\n gap: space(gap),\n padding: space(padding),\n ...style,\n } as CSSProperties\n }\n {...props}\n >\n <ListContext.Provider value={ctx}>\n {loading\n ? Array.from({ length: skeletonRows }, (_, i) => (\n <ListItem\n key={i}\n aria-hidden=\"true\"\n icon={<Skeleton variant=\"circle\" height=\"1.25em\" />}\n description={<Skeleton width={i % 2 ? '45%' : '60%'} />}\n >\n <Skeleton width={i % 2 ? '30%' : '40%'} />\n </ListItem>\n ))\n : children}\n </ListContext.Provider>\n </Component>\n )\n})\n"],"names":["List","forwardRef","as","gap","padding","role","size","flush","loading","style","children","props","ref","Component","ctx","useMemo","skeletonRows","jsx","space","ListContext","_","i","ListItem","Skeleton"],"mappings":";;;;;AAwCO,MAAMA,IAAOC,EAAmC,SACrD,EAAE,IAAAC,GAAI,KAAAC,IAAM,GAAG,SAAAC,GAAS,MAAAC,IAAO,QAAQ,MAAAC,GAAM,OAAAC,GAAO,SAAAC,IAAU,IAAO,OAAAC,GAAO,UAAAC,GAAU,GAAGC,EAAA,GACzFC,GACA;AACA,QAAMC,IAAaX,KAAM,OAEnBY,IAAMC,EAAQ,OAAO,EAAE,MAAAT,GAAM,OAAAC,MAAU,CAACD,GAAMC,CAAK,CAAC,GACpDS,IAAe,OAAOR,KAAY,WAAWA,IAAUA,IAAU,IAAI;AAC3E,SACE,gBAAAS;AAAA,IAACJ;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,MAAAP;AAAA,MACA,aAAWG,IAAU,KAAO;AAAA,MAC5B,OACE;AAAA,QACE,SAAS;AAAA,QACT,eAAe;AAAA,QACf,KAAKU,EAAMf,CAAG;AAAA,QACd,SAASe,EAAMd,CAAO;AAAA,QACtB,GAAGK;AAAA,MAAA;AAAA,MAGN,GAAGE;AAAA,MAEJ,UAAA,gBAAAM,EAACE,EAAY,UAAZ,EAAqB,OAAOL,GAC1B,UAAAN,IACG,MAAM,KAAK,EAAE,QAAQQ,EAAA,GAAgB,CAACI,GAAGC,MACvC,gBAAAJ;AAAA,QAACK;AAAA,QAAA;AAAA,UAEC,eAAY;AAAA,UACZ,MAAM,gBAAAL,EAACM,GAAA,EAAS,SAAQ,UAAS,QAAO,UAAS;AAAA,UACjD,aAAa,gBAAAN,EAACM,GAAA,EAAS,OAAOF,IAAI,IAAI,QAAQ,OAAO;AAAA,UAErD,4BAACE,GAAA,EAAS,OAAOF,IAAI,IAAI,QAAQ,MAAA,CAAO;AAAA,QAAA;AAAA,QALnCA;AAAA,MAAA,CAOR,IACDX,EAAA,CACN;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),o=require("react"),c=require("./Flex-C6tHC8n7.cjs"),s=require("./Skeleton-DK0lAjS9.cjs"),u=require("./ListItem-
|
|
2
|
-
//# sourceMappingURL=List-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),o=require("react"),c=require("./Flex-C6tHC8n7.cjs"),s=require("./Skeleton-DK0lAjS9.cjs"),u=require("./ListItem-DkCYXucd.cjs"),q=o.forwardRef(function({as:l,gap:a=2,padding:x,role:d="list",size:i,flush:n,loading:t=!1,style:m,children:h,...p},f){const j=l??"div",L=o.useMemo(()=>({size:i,flush:n}),[i,n]),k=typeof t=="number"?t:t?3:0;return e.jsx(j,{ref:f,role:d,"aria-busy":t?!0:void 0,style:{display:"flex",flexDirection:"column",gap:c.space(a),padding:c.space(x),...m},...p,children:e.jsx(u.ListContext.Provider,{value:L,children:t?Array.from({length:k},(y,r)=>e.jsx(u.ListItem,{"aria-hidden":"true",icon:e.jsx(s.Skeleton,{variant:"circle",height:"1.25em"}),description:e.jsx(s.Skeleton,{width:r%2?"45%":"60%"}),children:e.jsx(s.Skeleton,{width:r%2?"30%":"40%"})},r)):h})})});exports.List=q;
|
|
2
|
+
//# sourceMappingURL=List-CKoNx21F.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List-
|
|
1
|
+
{"version":3,"file":"List-CKoNx21F.cjs","sources":["../src/components/List/List.tsx"],"sourcesContent":["import {\n forwardRef,\n useMemo,\n type CSSProperties,\n type ElementType,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { space, type Spacing } from '../Flex/Flex'\nimport { Skeleton } from '../Skeleton'\nimport { ListContext } from './listContext'\nimport { ListItem, type ListItemSize } from './ListItem'\n\nexport interface ListProps extends HTMLAttributes<HTMLElement> {\n /** Render a different element — e.g. `'ul'`, `'nav'`, `'menu'`. Defaults to `div`. */\n as?: ElementType\n /** Gap between items (token key, px number, or CSS value). Defaults to `2px`. */\n gap?: Spacing\n /** Padding around the list (token key, px number, or CSS value). */\n padding?: Spacing\n /** Default size for the contained `ListItem`s — each item can still override its own `size`. */\n size?: ListItemSize\n /**\n * Default `flush` for the contained `ListItem`s — drops their left / right padding so rows sit flush with\n * the list's edges (e.g. inside a padded `Card`). Each item can still override its own `flush`.\n */\n flush?: boolean\n /**\n * Render skeleton rows instead of `children` — `true` shows 3, a number sets the count. Each row is a\n * `ListItem` with an icon disc, a label line and a description line. Defaults to `false`.\n */\n loading?: boolean | number\n children?: ReactNode\n}\n\n/**\n * A thin semantic container for `ListItem`s — a vertical stack with a configurable `gap`/`padding`\n * and `role=\"list\"` (override `role` to `\"menu\"` for a dropdown, etc.). `size` and `flush` set defaults\n * for all contained `ListItem`s (an explicit item prop wins). `loading` swaps the items for skeleton rows. Layout is set via inline style, matching the `Flex`/`Grid` primitives.\n */\nexport const List = forwardRef<HTMLElement, ListProps>(function List(\n { as, gap = 2, padding, role = 'list', size, flush, loading = false, style, children, ...props },\n ref,\n) {\n const Component = (as ?? 'div') as ElementType\n // one stable object per (size, flush) so items don't re-render on every List render\n const ctx = useMemo(() => ({ size, flush }), [size, flush])\n const skeletonRows = typeof loading === 'number' ? loading : loading ? 3 : 0\n return (\n <Component\n ref={ref}\n role={role}\n aria-busy={loading ? true : undefined}\n style={\n {\n display: 'flex',\n flexDirection: 'column',\n gap: space(gap),\n padding: space(padding),\n ...style,\n } as CSSProperties\n }\n {...props}\n >\n <ListContext.Provider value={ctx}>\n {loading\n ? Array.from({ length: skeletonRows }, (_, i) => (\n <ListItem\n key={i}\n aria-hidden=\"true\"\n icon={<Skeleton variant=\"circle\" height=\"1.25em\" />}\n description={<Skeleton width={i % 2 ? '45%' : '60%'} />}\n >\n <Skeleton width={i % 2 ? '30%' : '40%'} />\n </ListItem>\n ))\n : children}\n </ListContext.Provider>\n </Component>\n )\n})\n"],"names":["List","forwardRef","as","gap","padding","role","size","flush","loading","style","children","props","ref","Component","ctx","useMemo","skeletonRows","jsx","space","ListContext","_","i","ListItem","Skeleton"],"mappings":"gLAwCaA,EAAOC,EAAAA,WAAmC,SACrD,CAAE,GAAAC,EAAI,IAAAC,EAAM,EAAG,QAAAC,EAAS,KAAAC,EAAO,OAAQ,KAAAC,EAAM,MAAAC,EAAO,QAAAC,EAAU,GAAO,MAAAC,EAAO,SAAAC,EAAU,GAAGC,CAAA,EACzFC,EACA,CACA,MAAMC,EAAaX,GAAM,MAEnBY,EAAMC,UAAQ,KAAO,CAAE,KAAAT,EAAM,MAAAC,IAAU,CAACD,EAAMC,CAAK,CAAC,EACpDS,EAAe,OAAOR,GAAY,SAAWA,EAAUA,EAAU,EAAI,EAC3E,OACES,EAAAA,IAACJ,EAAA,CACC,IAAAD,EACA,KAAAP,EACA,YAAWG,EAAU,GAAO,OAC5B,MACE,CACE,QAAS,OACT,cAAe,SACf,IAAKU,EAAAA,MAAMf,CAAG,EACd,QAASe,EAAAA,MAAMd,CAAO,EACtB,GAAGK,CAAA,EAGN,GAAGE,EAEJ,SAAAM,EAAAA,IAACE,cAAY,SAAZ,CAAqB,MAAOL,EAC1B,SAAAN,EACG,MAAM,KAAK,CAAE,OAAQQ,CAAA,EAAgB,CAACI,EAAGC,IACvCJ,EAAAA,IAACK,EAAAA,SAAA,CAEC,cAAY,OACZ,KAAML,EAAAA,IAACM,WAAA,CAAS,QAAQ,SAAS,OAAO,SAAS,EACjD,YAAaN,EAAAA,IAACM,EAAAA,SAAA,CAAS,MAAOF,EAAI,EAAI,MAAQ,MAAO,EAErD,eAACE,EAAAA,SAAA,CAAS,MAAOF,EAAI,EAAI,MAAQ,KAAA,CAAO,CAAA,EALnCA,CAAA,CAOR,EACDX,CAAA,CACN,CAAA,CAAA,CAGN,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as l, jsxs as b } from "react/jsx-runtime";
|
|
|
2
2
|
import { createContext as v, useContext as y, forwardRef as E } from "react";
|
|
3
3
|
import { clsx as O } from "clsx";
|
|
4
4
|
import { b as S, a as j } from "./Icon-D5TxgfCc.js";
|
|
5
|
-
const D = v({}), A = () => y(D), M = "
|
|
5
|
+
const D = v({}), A = () => y(D), M = "_item_1arwt_3", B = "_sm_1arwt_25", R = "_md_1arwt_31", Z = "_lg_1arwt_36", $ = "_flush_1arwt_43", q = "_itemIcon_1arwt_49", F = "_itemText_1arwt_57", G = "_itemLabel_1arwt_65", H = "_itemDescription_1arwt_72", J = "_itemTrailing_1arwt_82", P = "_clickable_1arwt_92", Q = "_selected_1arwt_109", U = "_disabled_1arwt_130", t = {
|
|
6
6
|
item: M,
|
|
7
7
|
sm: B,
|
|
8
8
|
md: R,
|
|
@@ -18,10 +18,10 @@ const D = v({}), A = () => y(D), M = "_item_16twt_3", B = "_sm_16twt_25", R = "_
|
|
|
18
18
|
disabled: U
|
|
19
19
|
}, V = new Set(j), W = { sm: "sm", md: "md", lg: "md" }, nt = E(function({
|
|
20
20
|
icon: e,
|
|
21
|
-
description:
|
|
21
|
+
description: c,
|
|
22
22
|
trailing: _,
|
|
23
23
|
selected: d = !1,
|
|
24
|
-
clickable:
|
|
24
|
+
clickable: o = !1,
|
|
25
25
|
disabled: s = !1,
|
|
26
26
|
size: I,
|
|
27
27
|
flush: h,
|
|
@@ -29,13 +29,13 @@ const D = v({}), A = () => y(D), M = "_item_16twt_3", B = "_sm_16twt_25", R = "_
|
|
|
29
29
|
as: n,
|
|
30
30
|
className: x,
|
|
31
31
|
style: g,
|
|
32
|
-
children:
|
|
32
|
+
children: r,
|
|
33
33
|
onClick: N,
|
|
34
|
-
onKeyDown:
|
|
34
|
+
onKeyDown: a,
|
|
35
35
|
...C
|
|
36
36
|
}, T) {
|
|
37
|
-
const u = A(), f = I ?? u.size ?? "md", L = h ?? u.flush ?? !1, k = n ?? "div",
|
|
38
|
-
|
|
37
|
+
const u = A(), f = I ?? u.size ?? "md", L = h ?? u.flush ?? !1, k = n ?? "div", m = o && !(n === "a" || n === "button" || typeof n == "function" || typeof n == "object"), p = e == null ? null : typeof e == "string" && V.has(e) ? /* @__PURE__ */ l(S, { name: e, size: W[f] }) : e, z = (i) => {
|
|
38
|
+
m && !s && (i.key === "Enter" || i.key === " ") && (i.preventDefault(), i.currentTarget.click()), a == null || a(i);
|
|
39
39
|
};
|
|
40
40
|
return /* @__PURE__ */ b(
|
|
41
41
|
k,
|
|
@@ -46,23 +46,23 @@ const D = v({}), A = () => y(D), M = "_item_16twt_3", B = "_sm_16twt_25", R = "_
|
|
|
46
46
|
t[f],
|
|
47
47
|
L && t.flush,
|
|
48
48
|
d && t.selected,
|
|
49
|
-
|
|
49
|
+
o && t.clickable,
|
|
50
50
|
s && t.disabled,
|
|
51
51
|
x
|
|
52
52
|
),
|
|
53
53
|
style: { "--tz-btn-rgb": `var(--tz-color-${w}-rgb)`, ...g },
|
|
54
|
-
role:
|
|
55
|
-
tabIndex:
|
|
54
|
+
role: m ? "button" : void 0,
|
|
55
|
+
tabIndex: m ? s ? -1 : 0 : void 0,
|
|
56
56
|
"aria-disabled": s || void 0,
|
|
57
57
|
"aria-current": d || void 0,
|
|
58
58
|
onClick: s ? void 0 : N,
|
|
59
|
-
onKeyDown:
|
|
59
|
+
onKeyDown: o ? z : a,
|
|
60
60
|
...C,
|
|
61
61
|
children: [
|
|
62
62
|
p != null && /* @__PURE__ */ l("span", { className: t.itemIcon, children: p }),
|
|
63
|
-
(
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
(r != null || c != null) && /* @__PURE__ */ b("span", { className: t.itemText, children: [
|
|
64
|
+
r != null && /* @__PURE__ */ l("span", { className: t.itemLabel, children: r }),
|
|
65
|
+
c != null && /* @__PURE__ */ l("span", { className: t.itemDescription, children: c })
|
|
66
66
|
] }),
|
|
67
67
|
_ != null && /* @__PURE__ */ l("span", { className: t.itemTrailing, children: _ })
|
|
68
68
|
]
|
|
@@ -73,4 +73,4 @@ export {
|
|
|
73
73
|
nt as L,
|
|
74
74
|
D as a
|
|
75
75
|
};
|
|
76
|
-
//# sourceMappingURL=ListItem-
|
|
76
|
+
//# sourceMappingURL=ListItem-2Lr5_NRY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem-
|
|
1
|
+
{"version":3,"file":"ListItem-2Lr5_NRY.js","sources":["../src/components/List/listContext.ts","../src/components/List/ListItem.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { ListItemSize } from './ListItem'\n\n/** Defaults a `List` hands to its `ListItem`s — an explicit item prop still wins. */\nexport interface ListContextValue {\n size?: ListItemSize\n flush?: boolean\n}\n\nexport const ListContext = createContext<ListContextValue>({})\n\n/** Read the defaults provided by a surrounding `List`, if any. */\nexport const useListContext = (): ListContextValue => useContext(ListContext)\n\n/** @deprecated internal — use `useListContext().size`. Kept so older call sites keep compiling. */\nexport const useListSize = (): ListItemSize | undefined => useListContext().size\n","import {\n forwardRef,\n type AnchorHTMLAttributes,\n type CSSProperties,\n type ElementType,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon } from '../Icon'\nimport type { ThemeColor } from '../../theme'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useListContext } from './listContext'\nimport styles from './List.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport type ListItemSize = 'sm' | 'md' | 'lg'\n\n/** Leading `<Icon>` size per row size. */\nconst ICON_SIZE: Record<ListItemSize, 'sm' | 'md'> = { sm: 'sm', md: 'md', lg: 'md' }\n\nexport interface ListItemProps\n extends\n Omit<HTMLAttributes<HTMLElement>, 'color'>,\n Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'rel' | 'download'> {\n /** Leading element — a known `IconName` (rendered as `<Icon>`) or any node (e.g. an `Avatar`). */\n icon?: IconName | ReactNode\n /** Secondary muted line shown under the label. */\n description?: ReactNode\n /** Trailing content pinned to the right (icon, `Badge`, shortcut text, chevron, …). */\n trailing?: ReactNode\n /** Highlights the row as selected/active (menu selection, current nav route). */\n selected?: boolean\n /** Makes the row interactive (hover + cursor; adds `role`/`tabIndex`/keyboard when rendered plain). */\n clickable?: boolean\n /** Dims and inerts the row. */\n disabled?: boolean\n /** Row size — height / padding / font. Defaults to `md`. */\n size?: ListItemSize\n /**\n * Drops the row's left / right padding so it sits flush with its container's edges (vertical padding\n * and min-height stay). Defaults to `false`; a surrounding `List flush` sets the default for all its rows.\n */\n flush?: boolean\n /** Theme color for the selected tint and clickable hover. Defaults to `primary`. */\n color?: ThemeColor\n /** Render a different element/component — e.g. `'a'`, `'button'`, or a router `Link`. Defaults to `div`. */\n as?: ElementType\n /** Primary label / content. */\n children?: ReactNode\n}\n\n/**\n * A flexible, reusable list row: leading `icon`, a label (`children`) with optional `description`, and\n * a `trailing` slot. `clickable` turns it interactive (hover + keyboard when rendered as a plain\n * element), `selected` highlights it, `disabled` inerts it. Render as a link/button/router `Link` via\n * `as`. Designed to compose inside `List` — for menus, the sidebar, or a standalone styled list.\n */\nexport const ListItem = forwardRef<HTMLElement, ListItemProps>(function ListItem(\n {\n icon,\n description,\n trailing,\n selected = false,\n clickable = false,\n disabled = false,\n size: sizeProp,\n flush: flushProp,\n color = 'primary',\n as,\n className,\n style,\n children,\n onClick,\n onKeyDown,\n ...props\n },\n ref,\n) {\n // explicit props win; otherwise inherit the surrounding `List`'s defaults (size falls back to `md`)\n const listCtx = useListContext()\n const size = sizeProp ?? listCtx.size ?? 'md'\n const flush = flushProp ?? listCtx.flush ?? false\n const Component = (as ?? 'div') as ElementType\n // Anchors, buttons, and custom components (e.g. a router Link) carry their own click + keyboard\n // semantics — only a plain element needs the button role/tabIndex/Enter-Space shim.\n const handlesOwnInteraction =\n as === 'a' || as === 'button' || typeof as === 'function' || typeof as === 'object'\n const isDivButton = clickable && !handlesOwnInteraction\n\n const renderedIcon =\n icon == null ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} size={ICON_SIZE[size]} />\n ) : (\n icon\n )\n\n const handleKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n if (isDivButton && !disabled && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault()\n event.currentTarget.click()\n }\n onKeyDown?.(event)\n }\n\n return (\n <Component\n ref={ref}\n className={clsx(\n styles.item,\n styles[size],\n flush && styles.flush,\n selected && styles.selected,\n clickable && styles.clickable,\n disabled && styles.disabled,\n className,\n )}\n style={{ '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`, ...style } as CSSProperties}\n role={isDivButton ? 'button' : undefined}\n tabIndex={isDivButton ? (disabled ? -1 : 0) : undefined}\n aria-disabled={disabled || undefined}\n aria-current={selected || undefined}\n onClick={disabled ? undefined : onClick}\n onKeyDown={clickable ? handleKeyDown : onKeyDown}\n {...props}\n >\n {renderedIcon != null && <span className={styles.itemIcon}>{renderedIcon}</span>}\n {(children != null || description != null) && (\n <span className={styles.itemText}>\n {children != null && <span className={styles.itemLabel}>{children}</span>}\n {description != null && <span className={styles.itemDescription}>{description}</span>}\n </span>\n )}\n {trailing != null && <span className={styles.itemTrailing}>{trailing}</span>}\n </Component>\n )\n})\n"],"names":["ListContext","createContext","useListContext","useContext","ICON_NAME_SET","ICON_NAMES","ICON_SIZE","ListItem","forwardRef","icon","description","trailing","selected","clickable","disabled","sizeProp","flushProp","color","as","className","style","children","onClick","onKeyDown","props","ref","listCtx","size","flush","Component","isDivButton","renderedIcon","jsx","Icon","handleKeyDown","event","jsxs","clsx","styles"],"mappings":";;;;AASO,MAAMA,IAAcC,EAAgC,CAAA,CAAE,GAGhDC,IAAiB,MAAwBC,EAAWH,CAAW;;;;;;;;;;;;;;GCItEI,IAAgB,IAAI,IAAYC,CAAU,GAK1CC,IAA+C,EAAE,IAAI,MAAM,IAAI,MAAM,IAAI,KAAA,GAuClEC,KAAWC,EAAuC,SAC7D;AAAA,EACE,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,MAAMC;AAAA,EACN,OAAOC;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,IAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AAEA,QAAMC,IAAUxB,EAAA,GACVyB,IAAOZ,KAAYW,EAAQ,QAAQ,MACnCE,IAAQZ,KAAaU,EAAQ,SAAS,IACtCG,IAAaX,KAAM,OAKnBY,IAAcjB,KAAa,EAD/BK,MAAO,OAAOA,MAAO,YAAY,OAAOA,KAAO,cAAc,OAAOA,KAAO,WAGvEa,IACJtB,KAAQ,OAAO,OAAO,OAAOA,KAAS,YAAYL,EAAc,IAAIK,CAAI,IACtE,gBAAAuB,EAACC,KAAK,MAAMxB,GAAkB,MAAMH,EAAUqB,CAAI,GAAG,IAErDlB,GAGEyB,IAAgB,CAACC,MAAsC;AAC3D,IAAIL,KAAe,CAAChB,MAAaqB,EAAM,QAAQ,WAAWA,EAAM,QAAQ,SACtEA,EAAM,eAAA,GACNA,EAAM,cAAc,MAAA,IAEtBZ,KAAA,QAAAA,EAAYY;AAAA,EACd;AAEA,SACE,gBAAAC;AAAA,IAACP;AAAA,IAAA;AAAA,MACC,KAAAJ;AAAA,MACA,WAAWY;AAAA,QACTC,EAAO;AAAA,QACPA,EAAOX,CAAI;AAAA,QACXC,KAASU,EAAO;AAAA,QAChB1B,KAAY0B,EAAO;AAAA,QACnBzB,KAAayB,EAAO;AAAA,QACpBxB,KAAYwB,EAAO;AAAA,QACnBnB;AAAA,MAAA;AAAA,MAEF,OAAO,EAAE,gBAAgB,kBAAkBF,CAAK,SAAS,GAAGG,EAAA;AAAA,MAC5D,MAAMU,IAAc,WAAW;AAAA,MAC/B,UAAUA,IAAehB,IAAW,KAAK,IAAK;AAAA,MAC9C,iBAAeA,KAAY;AAAA,MAC3B,gBAAcF,KAAY;AAAA,MAC1B,SAASE,IAAW,SAAYQ;AAAA,MAChC,WAAWT,IAAYqB,IAAgBX;AAAA,MACtC,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAO,KAAgB,QAAQ,gBAAAC,EAAC,QAAA,EAAK,WAAWM,EAAO,UAAW,UAAAP,GAAa;AAAA,SACvEV,KAAY,QAAQX,KAAe,2BAClC,QAAA,EAAK,WAAW4B,EAAO,UACrB,UAAA;AAAA,UAAAjB,KAAY,QAAQ,gBAAAW,EAAC,QAAA,EAAK,WAAWM,EAAO,WAAY,UAAAjB,GAAS;AAAA,UACjEX,KAAe,QAAQ,gBAAAsB,EAAC,UAAK,WAAWM,EAAO,iBAAkB,UAAA5B,EAAA,CAAY;AAAA,QAAA,GAChF;AAAA,QAEDC,KAAY,QAAQ,gBAAAqB,EAAC,UAAK,WAAWM,EAAO,cAAe,UAAA3B,EAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG3E,CAAC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),_=require("react"),y=require("clsx"),b=require("./Icon-B6lz-V0A.cjs"),h=_.createContext({}),E=()=>_.useContext(h),O="_item_1arwt_3",q="_sm_1arwt_25",S="_md_1arwt_31",D="_lg_1arwt_36",A="_flush_1arwt_43",M="_itemIcon_1arwt_49",R="_itemText_1arwt_57",B="_itemLabel_1arwt_65",Z="_itemDescription_1arwt_72",$="_itemTrailing_1arwt_82",F="_clickable_1arwt_92",G="_selected_1arwt_109",H="_disabled_1arwt_130",t={item:O,sm:q,md:S,lg:D,flush:A,itemIcon:M,itemText:R,itemLabel:B,itemDescription:Z,itemTrailing:$,clickable:F,selected:G,disabled:H},J=new Set(b.ICON_NAMES),P={sm:"sm",md:"md",lg:"md"},Q=_.forwardRef(function({icon:s,description:a,trailing:u,selected:d=!1,clickable:o=!1,disabled:n=!1,size:w,flush:p,color:g="primary",as:i,className:C,style:N,children:r,onClick:L,onKeyDown:l,...T},j){const x=E(),f=w??x.size??"md",k=p??x.flush??!1,z=i??"div",m=o&&!(i==="a"||i==="button"||typeof i=="function"||typeof i=="object"),I=s==null?null:typeof s=="string"&&J.has(s)?e.jsx(b.Icon,{name:s,size:P[f]}):s,v=c=>{m&&!n&&(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),c.currentTarget.click()),l==null||l(c)};return e.jsxs(z,{ref:j,className:y.clsx(t.item,t[f],k&&t.flush,d&&t.selected,o&&t.clickable,n&&t.disabled,C),style:{"--tz-btn-rgb":`var(--tz-color-${g}-rgb)`,...N},role:m?"button":void 0,tabIndex:m?n?-1:0:void 0,"aria-disabled":n||void 0,"aria-current":d||void 0,onClick:n?void 0:L,onKeyDown:o?v:l,...T,children:[I!=null&&e.jsx("span",{className:t.itemIcon,children:I}),(r!=null||a!=null)&&e.jsxs("span",{className:t.itemText,children:[r!=null&&e.jsx("span",{className:t.itemLabel,children:r}),a!=null&&e.jsx("span",{className:t.itemDescription,children:a})]}),u!=null&&e.jsx("span",{className:t.itemTrailing,children:u})]})});exports.ListContext=h;exports.ListItem=Q;
|
|
2
|
+
//# sourceMappingURL=ListItem-DkCYXucd.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem-
|
|
1
|
+
{"version":3,"file":"ListItem-DkCYXucd.cjs","sources":["../src/components/List/listContext.ts","../src/components/List/ListItem.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { ListItemSize } from './ListItem'\n\n/** Defaults a `List` hands to its `ListItem`s — an explicit item prop still wins. */\nexport interface ListContextValue {\n size?: ListItemSize\n flush?: boolean\n}\n\nexport const ListContext = createContext<ListContextValue>({})\n\n/** Read the defaults provided by a surrounding `List`, if any. */\nexport const useListContext = (): ListContextValue => useContext(ListContext)\n\n/** @deprecated internal — use `useListContext().size`. Kept so older call sites keep compiling. */\nexport const useListSize = (): ListItemSize | undefined => useListContext().size\n","import {\n forwardRef,\n type AnchorHTMLAttributes,\n type CSSProperties,\n type ElementType,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon } from '../Icon'\nimport type { ThemeColor } from '../../theme'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { useListContext } from './listContext'\nimport styles from './List.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport type ListItemSize = 'sm' | 'md' | 'lg'\n\n/** Leading `<Icon>` size per row size. */\nconst ICON_SIZE: Record<ListItemSize, 'sm' | 'md'> = { sm: 'sm', md: 'md', lg: 'md' }\n\nexport interface ListItemProps\n extends\n Omit<HTMLAttributes<HTMLElement>, 'color'>,\n Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'rel' | 'download'> {\n /** Leading element — a known `IconName` (rendered as `<Icon>`) or any node (e.g. an `Avatar`). */\n icon?: IconName | ReactNode\n /** Secondary muted line shown under the label. */\n description?: ReactNode\n /** Trailing content pinned to the right (icon, `Badge`, shortcut text, chevron, …). */\n trailing?: ReactNode\n /** Highlights the row as selected/active (menu selection, current nav route). */\n selected?: boolean\n /** Makes the row interactive (hover + cursor; adds `role`/`tabIndex`/keyboard when rendered plain). */\n clickable?: boolean\n /** Dims and inerts the row. */\n disabled?: boolean\n /** Row size — height / padding / font. Defaults to `md`. */\n size?: ListItemSize\n /**\n * Drops the row's left / right padding so it sits flush with its container's edges (vertical padding\n * and min-height stay). Defaults to `false`; a surrounding `List flush` sets the default for all its rows.\n */\n flush?: boolean\n /** Theme color for the selected tint and clickable hover. Defaults to `primary`. */\n color?: ThemeColor\n /** Render a different element/component — e.g. `'a'`, `'button'`, or a router `Link`. Defaults to `div`. */\n as?: ElementType\n /** Primary label / content. */\n children?: ReactNode\n}\n\n/**\n * A flexible, reusable list row: leading `icon`, a label (`children`) with optional `description`, and\n * a `trailing` slot. `clickable` turns it interactive (hover + keyboard when rendered as a plain\n * element), `selected` highlights it, `disabled` inerts it. Render as a link/button/router `Link` via\n * `as`. Designed to compose inside `List` — for menus, the sidebar, or a standalone styled list.\n */\nexport const ListItem = forwardRef<HTMLElement, ListItemProps>(function ListItem(\n {\n icon,\n description,\n trailing,\n selected = false,\n clickable = false,\n disabled = false,\n size: sizeProp,\n flush: flushProp,\n color = 'primary',\n as,\n className,\n style,\n children,\n onClick,\n onKeyDown,\n ...props\n },\n ref,\n) {\n // explicit props win; otherwise inherit the surrounding `List`'s defaults (size falls back to `md`)\n const listCtx = useListContext()\n const size = sizeProp ?? listCtx.size ?? 'md'\n const flush = flushProp ?? listCtx.flush ?? false\n const Component = (as ?? 'div') as ElementType\n // Anchors, buttons, and custom components (e.g. a router Link) carry their own click + keyboard\n // semantics — only a plain element needs the button role/tabIndex/Enter-Space shim.\n const handlesOwnInteraction =\n as === 'a' || as === 'button' || typeof as === 'function' || typeof as === 'object'\n const isDivButton = clickable && !handlesOwnInteraction\n\n const renderedIcon =\n icon == null ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} size={ICON_SIZE[size]} />\n ) : (\n icon\n )\n\n const handleKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n if (isDivButton && !disabled && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault()\n event.currentTarget.click()\n }\n onKeyDown?.(event)\n }\n\n return (\n <Component\n ref={ref}\n className={clsx(\n styles.item,\n styles[size],\n flush && styles.flush,\n selected && styles.selected,\n clickable && styles.clickable,\n disabled && styles.disabled,\n className,\n )}\n style={{ '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`, ...style } as CSSProperties}\n role={isDivButton ? 'button' : undefined}\n tabIndex={isDivButton ? (disabled ? -1 : 0) : undefined}\n aria-disabled={disabled || undefined}\n aria-current={selected || undefined}\n onClick={disabled ? undefined : onClick}\n onKeyDown={clickable ? handleKeyDown : onKeyDown}\n {...props}\n >\n {renderedIcon != null && <span className={styles.itemIcon}>{renderedIcon}</span>}\n {(children != null || description != null) && (\n <span className={styles.itemText}>\n {children != null && <span className={styles.itemLabel}>{children}</span>}\n {description != null && <span className={styles.itemDescription}>{description}</span>}\n </span>\n )}\n {trailing != null && <span className={styles.itemTrailing}>{trailing}</span>}\n </Component>\n )\n})\n"],"names":["ListContext","createContext","useListContext","useContext","ICON_NAME_SET","ICON_NAMES","ICON_SIZE","ListItem","forwardRef","icon","description","trailing","selected","clickable","disabled","sizeProp","flushProp","color","as","className","style","children","onClick","onKeyDown","props","ref","listCtx","size","flush","Component","isDivButton","renderedIcon","jsx","Icon","handleKeyDown","event","jsxs","clsx","styles"],"mappings":"wHASaA,EAAcC,EAAAA,cAAgC,CAAA,CAAE,EAGhDC,EAAiB,IAAwBC,EAAAA,WAAWH,CAAW,yaCItEI,EAAgB,IAAI,IAAYC,YAAU,EAK1CC,EAA+C,CAAE,GAAI,KAAM,GAAI,KAAM,GAAI,IAAA,EAuClEC,EAAWC,EAAAA,WAAuC,SAC7D,CACE,KAAAC,EACA,YAAAC,EACA,SAAAC,EACA,SAAAC,EAAW,GACX,UAAAC,EAAY,GACZ,SAAAC,EAAW,GACX,KAAMC,EACN,MAAOC,EACP,MAAAC,EAAQ,UACR,GAAAC,EACA,UAAAC,EACA,MAAAC,EACA,SAAAC,EACA,QAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EACAC,EACA,CAEA,MAAMC,EAAUxB,EAAA,EACVyB,EAAOZ,GAAYW,EAAQ,MAAQ,KACnCE,EAAQZ,GAAaU,EAAQ,OAAS,GACtCG,EAAaX,GAAM,MAKnBY,EAAcjB,GAAa,EAD/BK,IAAO,KAAOA,IAAO,UAAY,OAAOA,GAAO,YAAc,OAAOA,GAAO,UAGvEa,EACJtB,GAAQ,KAAO,KAAO,OAAOA,GAAS,UAAYL,EAAc,IAAIK,CAAI,EACtEuB,MAACC,EAAAA,MAAK,KAAMxB,EAAkB,KAAMH,EAAUqB,CAAI,EAAG,EAErDlB,EAGEyB,EAAiBC,GAAsC,CACvDL,GAAe,CAAChB,IAAaqB,EAAM,MAAQ,SAAWA,EAAM,MAAQ,OACtEA,EAAM,eAAA,EACNA,EAAM,cAAc,MAAA,GAEtBZ,GAAA,MAAAA,EAAYY,EACd,EAEA,OACEC,EAAAA,KAACP,EAAA,CACC,IAAAJ,EACA,UAAWY,EAAAA,KACTC,EAAO,KACPA,EAAOX,CAAI,EACXC,GAASU,EAAO,MAChB1B,GAAY0B,EAAO,SACnBzB,GAAayB,EAAO,UACpBxB,GAAYwB,EAAO,SACnBnB,CAAA,EAEF,MAAO,CAAE,eAAgB,kBAAkBF,CAAK,QAAS,GAAGG,CAAA,EAC5D,KAAMU,EAAc,SAAW,OAC/B,SAAUA,EAAehB,EAAW,GAAK,EAAK,OAC9C,gBAAeA,GAAY,OAC3B,eAAcF,GAAY,OAC1B,QAASE,EAAW,OAAYQ,EAChC,UAAWT,EAAYqB,EAAgBX,EACtC,GAAGC,EAEH,SAAA,CAAAO,GAAgB,MAAQC,EAAAA,IAAC,OAAA,CAAK,UAAWM,EAAO,SAAW,SAAAP,EAAa,GACvEV,GAAY,MAAQX,GAAe,cAClC,OAAA,CAAK,UAAW4B,EAAO,SACrB,SAAA,CAAAjB,GAAY,MAAQW,EAAAA,IAAC,OAAA,CAAK,UAAWM,EAAO,UAAY,SAAAjB,EAAS,EACjEX,GAAe,MAAQsB,EAAAA,IAAC,QAAK,UAAWM,EAAO,gBAAkB,SAAA5B,CAAA,CAAY,CAAA,EAChF,EAEDC,GAAY,MAAQqB,EAAAA,IAAC,QAAK,UAAWM,EAAO,aAAe,SAAA3B,CAAA,CAAS,CAAA,CAAA,CAAA,CAG3E,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const c=require("react/jsx-runtime"),d=require("react"),_=require("clsx"),p=require("./ConfigProvider-
|
|
2
|
-
//# sourceMappingURL=Loader-
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),d=require("react"),_=require("clsx"),p=require("./ConfigProvider-BaiTKZKC.cjs"),i="_loader_166pp_2",u="_sm_166pp_18",m="_md_166pp_24",f="_lg_166pp_30",s={loader:i,"tz-loader-spin":"_tz-loader-spin_166pp_1",sm:u,md:m,lg:f},g=d.forwardRef(function({size:o="md",color:e,className:t,style:r,...a},l){const n=p.useT();return c.jsx("span",{ref:l,role:"status","aria-label":n("loader.label"),...a,className:_.clsx(s.loader,s[o],t),style:e?{color:`var(--tz-color-${e})`,...r}:r})});exports.Loader=g;
|
|
2
|
+
//# sourceMappingURL=Loader-5zp2MPm5.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loader-
|
|
1
|
+
{"version":3,"file":"Loader-5zp2MPm5.cjs","sources":["../src/components/Loader/Loader.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Loader.module.css'\n\nexport type LoaderSize = 'sm' | 'md' | 'lg'\n\nexport interface LoaderProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {\n /** Preset size — matches the Icon sizes: `sm` 16px · `md` 18px · `lg` 22px. Defaults to `md`. */\n size?: LoaderSize\n /** Theme palette token used to color the spinner. Omit to inherit the surrounding text color (`currentColor`). */\n color?: ThemeColor\n}\n\n/**\n * A circular spinner. Works standalone as a loading indicator or inside a\n * `Button`, where it inherits the button color via `currentColor` unless an\n * explicit `color` is given.\n */\nexport const Loader = forwardRef<HTMLSpanElement, LoaderProps>(function Loader(\n { size = 'md', color, className, style, ...props },\n ref,\n) {\n const t = useT()\n return (\n <span\n ref={ref}\n role=\"status\"\n aria-label={t('loader.label')}\n {...props}\n className={clsx(styles.loader, styles[size], className)}\n style={color ? ({ color: `var(--tz-color-${color})`, ...style } as CSSProperties) : style}\n />\n )\n})\n"],"names":["Loader","forwardRef","size","color","className","style","props","ref","t","useT","jsx","clsx","styles"],"mappings":"gRAmBaA,EAASC,EAAAA,WAAyC,SAC7D,CAAE,KAAAC,EAAO,KAAM,MAAAC,EAAO,UAAAC,EAAW,MAAAC,EAAO,GAAGC,CAAA,EAC3CC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACV,OACEC,EAAAA,IAAC,OAAA,CACC,IAAAH,EACA,KAAK,SACL,aAAYC,EAAE,cAAc,EAC3B,GAAGF,EACJ,UAAWK,EAAAA,KAAKC,EAAO,OAAQA,EAAOV,CAAI,EAAGE,CAAS,EACtD,MAAOD,EAAS,CAAE,MAAO,kBAAkBA,CAAK,IAAK,GAAGE,GAA4BA,CAAA,CAAA,CAG1F,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as _ } from "react";
|
|
3
3
|
import { clsx as d } from "clsx";
|
|
4
|
-
import { a as n } from "./ConfigProvider-
|
|
4
|
+
import { a as n } from "./ConfigProvider-D61cpCz-.js";
|
|
5
5
|
const c = "_loader_166pp_2", i = "_sm_166pp_18", f = "_md_166pp_24", u = "_lg_166pp_30", s = {
|
|
6
6
|
loader: c,
|
|
7
7
|
"tz-loader-spin": "_tz-loader-spin_166pp_1",
|
|
@@ -25,4 +25,4 @@ const c = "_loader_166pp_2", i = "_sm_166pp_18", f = "_md_166pp_24", u = "_lg_16
|
|
|
25
25
|
export {
|
|
26
26
|
j as L
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=Loader-
|
|
28
|
+
//# sourceMappingURL=Loader-Bluu6z0-.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loader-
|
|
1
|
+
{"version":3,"file":"Loader-Bluu6z0-.js","sources":["../src/components/Loader/Loader.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Loader.module.css'\n\nexport type LoaderSize = 'sm' | 'md' | 'lg'\n\nexport interface LoaderProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {\n /** Preset size — matches the Icon sizes: `sm` 16px · `md` 18px · `lg` 22px. Defaults to `md`. */\n size?: LoaderSize\n /** Theme palette token used to color the spinner. Omit to inherit the surrounding text color (`currentColor`). */\n color?: ThemeColor\n}\n\n/**\n * A circular spinner. Works standalone as a loading indicator or inside a\n * `Button`, where it inherits the button color via `currentColor` unless an\n * explicit `color` is given.\n */\nexport const Loader = forwardRef<HTMLSpanElement, LoaderProps>(function Loader(\n { size = 'md', color, className, style, ...props },\n ref,\n) {\n const t = useT()\n return (\n <span\n ref={ref}\n role=\"status\"\n aria-label={t('loader.label')}\n {...props}\n className={clsx(styles.loader, styles[size], className)}\n style={color ? ({ color: `var(--tz-color-${color})`, ...style } as CSSProperties) : style}\n />\n )\n})\n"],"names":["Loader","forwardRef","size","color","className","style","props","ref","t","useT","jsx","clsx","styles"],"mappings":";;;;;;;;;;GAmBaA,IAASC,EAAyC,SAC7D,EAAE,MAAAC,IAAO,MAAM,OAAAC,GAAO,WAAAC,GAAW,OAAAC,GAAO,GAAGC,EAAA,GAC3CC,GACA;AACA,QAAMC,IAAIC,EAAA;AACV,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,MAAK;AAAA,MACL,cAAYC,EAAE,cAAc;AAAA,MAC3B,GAAGF;AAAA,MACJ,WAAWK,EAAKC,EAAO,QAAQA,EAAOV,CAAI,GAAGE,CAAS;AAAA,MACtD,OAAOD,IAAS,EAAE,OAAO,kBAAkBA,CAAK,KAAK,GAAGE,MAA4BA;AAAA,IAAA;AAAA,EAAA;AAG1F,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),r=require("react"),je=require("clsx"),Tt=require("./formContext-bTWrqdEV.cjs"),Pt=require("./CopyButton-CjPyKpky.cjs"),z=require("./Icon-B6lz-V0A.cjs"),ge=require("./IconButton-D3ZpI0XL.cjs"),Lt=require("./Skeleton-DK0lAjS9.cjs"),Be=require("./TextField-BRaoadxk.cjs"),fe=require("./Tooltip-DmMq5R1x.cjs"),K=require("./Typography-d97DdbNd.cjs"),Et=require("./FloatingPanel-tGCG2nhA.cjs"),qt=require("./ListItem-Qo1Tt6Fi.cjs"),mt=require("./Loader-Cywaf7ju.cjs"),he=require("./ConfigProvider-DELhJlqo.cjs"),yt="tz-google-maps",gt="__tzGoogleMapsReady";let Z=null,ft=!1,xt=!1;const $e=new Set;function Mt(){const n=globalThis;if(n.__tzAuthHooked)return;n.__tzAuthHooked=!0;const a=n.gm_authFailure;n.gm_authFailure=()=>{xt=!0,$e.forEach(d=>d()),a==null||a()}}function Nt(n){return xt&&n(),$e.add(n),()=>{$e.delete(n)}}const Oe=()=>globalThis.google,ze=n=>typeof n.lat=="function"?{lat:n.lat(),lng:n.lng()}:n;function Rt(n,a){return new Promise((d,y)=>{const i=new URLSearchParams({key:n,v:"weekly",loading:"async",callback:gt});a&&i.set("language",a),globalThis[gt]=()=>d();const v=document.createElement("script");v.id=yt,v.async=!0,v.src=`https://maps.googleapis.com/maps/api/js?${i.toString()}`,v.onerror=()=>{v.remove(),y(new Error("The Google Maps script failed to load"))},document.head.appendChild(v)})}async function Ct(){var I,C;const n=Oe();if(!((I=n==null?void 0:n.maps)!=null&&I.importLibrary))throw new Error("Google Maps is unavailable");const[a,d,y]=await Promise.all([n.maps.importLibrary("core"),n.maps.importLibrary("maps"),n.maps.importLibrary("marker")]),i={...a,...d,...y},v=(C=n.maps.Animation)==null?void 0:C.DROP,w=l=>`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(l)}`,j=l=>({url:w(l.svg),scaledSize:i.Size?new i.Size(l.width,l.height):{width:l.width,height:l.height},anchor:i.Point?new i.Point(l.anchorX,l.anchorY):{x:l.anchorX,y:l.anchorY}}),E=l=>{const m=document.createElement("img");return m.src=w(l.svg),m.width=l.width,m.height=l.height,m.alt="",m.style.display="block",m.style.transform=`translate(${l.width/2-l.anchorX}px, ${l.height-l.anchorY}px)`,m};let k=null,N=null;const F=()=>k??(k=n.maps.importLibrary("places")),R=()=>N??(N=n.maps.importLibrary("geocoding"));return{colorScheme:l=>i.ColorScheme?i.ColorScheme[l==="dark"?"DARK":"LIGHT"]:l.toUpperCase(),createPlacesSession:()=>{let l=null,m=new Map;return{async suggest(T,{language:b,bias:g,regions:f}){const u=await F();l??(l=new u.AutocompleteSessionToken);const{suggestions:ee}=await u.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:T,sessionToken:l,...b?{language:b}:{},...g?{locationBias:{center:g,radius:5e4}}:{},...f!=null&&f.length?{includedRegionCodes:f}:{}});return m=new Map,ee.flatMap((te,G)=>{var Y,p,_;const q=te.placePrediction;if(!q)return[];const X=q.placeId??String(G);m.set(X,q);const H=((Y=q.mainText)==null?void 0:Y.text)??((p=q.text)==null?void 0:p.text)??"";return[{id:X,primary:H,secondary:((_=q.secondaryText)==null?void 0:_.text)??void 0}]})},async resolve(T){const b=m.get(T);if(!b)return null;const g=b.toPlace();return await g.fetchFields({fields:["location","formattedAddress"]}),l=null,g.location?{location:ze(g.location),address:g.formattedAddress??void 0}:null}}},reverseGeocode:async(l,m)=>{var b;const T=await R();try{const{results:g}=await new T.Geocoder().geocode({location:l,...m?{language:m}:{}});return((b=g[0])==null?void 0:b.formatted_address)??null}catch(g){return(g==null?void 0:g.code)==="REQUEST_DENIED"&&!ft&&(ft=!0,console.warn("[LocationPicker] Address lookup was denied — enable the Geocoding API for this Google Maps key (and allow it in the key's API restrictions).")),null}},createMap:(l,m)=>new i.Map(l,m),createPin:(l,{position:m,advanced:T,icon:b})=>{if(T&&i.AdvancedMarkerElement){const f=new i.AdvancedMarkerElement({map:l,position:m,gmpDraggable:!0,...b?{content:E(b)}:{}});return{setPosition:u=>{f.position=u},setIcon:u=>{f.content=E(u)},setDraggable:u=>{f.gmpDraggable=u},onDragEnd:u=>f.addListener("dragend",()=>f.position&&u(ze(f.position))),remove:()=>{f.map=null}}}const g=new i.Marker({map:l,position:m,draggable:!0,animation:v,...b?{icon:j(b)}:{}});return{setPosition:f=>g.setPosition(f),setIcon:f=>g.setIcon(j(f)),setDraggable:f=>g.setDraggable(f),onDragEnd:f=>g.addListener("dragend",()=>{const u=g.getPosition();u&&f(ze(u))}),remove:()=>g.setMap(null)}}}}function Dt(n,a){if(Mt(),Z&&Z.key===n)return Z.promise;const d=(async()=>{var y,i;if(!((i=(y=Oe())==null?void 0:y.maps)!=null&&i.importLibrary)){if(typeof document>"u")throw new Error("Google Maps needs a browser");document.getElementById(yt)?await new Promise(v=>{const w=()=>{var j,E;return(E=(j=Oe())==null?void 0:j.maps)!=null&&E.importLibrary?v():setTimeout(w,50)};w()}):await Rt(n,a)}return Ct()})();return Z={key:n,promise:d},d.catch(()=>{(Z==null?void 0:Z.promise)===d&&(Z=null)}),d}const At="_root_1ykqa_4",zt="_label_1ykqa_12",Ft="_required_1ykqa_18",Bt="_helper_1ykqa_21",$t="_frame_1ykqa_27",Ot="_error_1ykqa_46",Gt="_map_1ykqa_53",Ht="_mapHost_1ykqa_58",Ut="_cover_1ykqa_64",Zt="_message_1ykqa_70",Kt="_messageIcon_1ykqa_78",Xt="_controls_1ykqa_90",Yt="_control_1ykqa_90",Vt="_zoomControls_1ykqa_106",Wt="_badge_1ykqa_114",Qt="_badgeIcon_1ykqa_137",Jt="_coords_1ykqa_141",eo="_copy_1ykqa_147",to="_search_1ykqa_155",oo="_searchPanel_1ykqa_158",no="_searchStatus_1ykqa_163",ro="_address_1ykqa_171",so="_addressIcon_1ykqa_178",ao="_addressText_1ykqa_183",lo="_fields_1ykqa_189",co="_disabled_1ykqa_202",c={root:At,label:zt,required:Ft,helper:Bt,frame:$t,error:Ot,map:Gt,mapHost:Ht,cover:Ut,message:Zt,messageIcon:Kt,controls:Xt,control:Yt,zoomControls:Vt,badge:Wt,badgeIcon:Qt,coords:Jt,copy:eo,search:to,searchPanel:oo,searchStatus:no,address:ro,addressIcon:so,addressText:ao,fields:lo,disabled:co},io=250,pt=2;function uo({api:n,language:a,bias:d,regions:y,size:i,disabled:v,onPick:w}){const j=he.useT(),E=r.useId(),k=r.useRef(null),N=r.useRef(null),F=r.useRef(0),[R,I]=r.useState(""),[C,l]=r.useState([]),[m,T]=r.useState("idle"),[b,g]=r.useState(!1),[f,u]=r.useState(-1),[ee,te]=r.useState(!1),G=()=>N.current??(N.current=n.createPlacesSession());r.useEffect(()=>{const p=R.trim();if(p.length<pt){l([]),T("idle");return}const _=++F.current;T("loading");const h=window.setTimeout(()=>{G().suggest(p,{language:a,bias:d==null?void 0:d(),regions:y}).then(V=>{_===F.current&&(l(V),u(V.length?0:-1),T("ready"))}).catch(()=>{_===F.current&&(l([]),T("error"))})},io);return()=>window.clearTimeout(h)},[R,a,y==null?void 0:y.join(",")]);const q=async p=>{te(!0);try{const _=await G().resolve(p.id);if(N.current=null,!_)return;I(_.address??[p.primary,p.secondary].filter(Boolean).join(", ")),g(!1),l([]),T("idle"),F.current++,w(_)}catch{T("error")}finally{te(!1)}},X=p=>{if(p.key==="ArrowDown"||p.key==="ArrowUp"){if(!C.length)return;p.preventDefault(),g(!0);const _=p.key==="ArrowDown"?1:-1;u(h=>(h+_+C.length)%C.length)}else if(p.key==="Enter"){p.preventDefault();const _=C[f];b&&_&&q(_)}else p.key==="Escape"&&b&&(p.stopPropagation(),g(!1))},H=b&&R.trim().length>=pt&&m!=="idle",Y=p=>`${E}-option-${p}`;return t.jsxs("div",{ref:k,className:c.search,children:[t.jsx(Be.TextField,{size:i,disabled:v,value:R,placeholder:j("location.searchPlaceholder"),adornment:ee?t.jsx(mt.Loader,{size:"sm"}):t.jsx(z.Icon,{name:"SearchNormal"}),role:"combobox","aria-label":j("location.searchPlaceholder"),"aria-autocomplete":"list","aria-expanded":H,"aria-controls":H?E:void 0,"aria-activedescendant":H&&f>=0?Y(f):void 0,autoComplete:"off",onChange:p=>{I(p.target.value),g(!0)},onFocus:()=>g(!0),onKeyDown:X}),t.jsx(Et.FloatingPanel,{open:H,triggerRef:k,matchTriggerWidth:!0,onClose:()=>g(!1),className:c.searchPanel,children:m==="loading"&&!C.length?t.jsxs("div",{className:c.searchStatus,children:[t.jsx(mt.Loader,{size:"sm"}),t.jsx(K.Typography,{variant:"bodySmall",color:"muted",children:j("location.searching")})]}):m==="error"?t.jsxs("div",{className:c.searchStatus,children:[t.jsx(z.Icon,{name:"Danger",color:"error"}),t.jsx(K.Typography,{variant:"bodySmall",color:"muted",children:j("location.searchUnavailable")})]}):C.length===0?t.jsx("div",{className:c.searchStatus,children:t.jsx(K.Typography,{variant:"bodySmall",color:"muted",children:j("location.searchEmpty")})}):t.jsx("div",{role:"listbox",id:E,"aria-label":j("location.searchPlaceholder"),children:C.map((p,_)=>t.jsx(qt.ListItem,{id:Y(_),role:"option","aria-selected":_===f,selected:_===f,clickable:!0,icon:t.jsx(z.Icon,{name:"Location"}),description:p.secondary,onMouseDown:h=>h.preventDefault(),onMouseEnter:()=>u(_),onClick:()=>void q(p),children:p.primary},p.id))})})]})}const Pe={lat:41.7151,lng:44.8271},mo=12,go=0,fo=22,ht=16,O=(n,a)=>Number(n.toFixed(a)),pe=(n,a)=>Math.abs(n.lat-a.lat)<1e-7&&Math.abs(n.lng-a.lng)<1e-7,Te=(n,a)=>n==null?"":String(O(n,a));function se(n,a){const d=n.trim().replace(",",".");if(d==="")return null;if(!/^[-+]?\d+(\.\d*)?$/.test(d))return;const y=Number(d);return Math.abs(y)<=a?y:void 0}function po(n){const a=n.trim().match(/^\(?\s*([-+]?\d+(?:\.\d+)?)\s*[,;\s]\s*([-+]?\d+(?:\.\d+)?)\s*\)?$/);if(!a)return null;const d=Number(a[1]),y=Number(a[2]);return Math.abs(d)<=90&&Math.abs(y)<=180?{lat:d,lng:y}:null}function Ge(n,a){const d=getComputedStyle(document.documentElement).getPropertyValue(`--tz-color-${n}-rgb`).trim();if(!d)return a;const[y,i,v]=d.split(",").map(w=>Number(w.trim()));return[y,i,v].some(w=>Number.isNaN(w))?a:`#${[y,i,v].map(w=>w.toString(16).padStart(2,"0")).join("")}`}const J={width:40,height:52,tipX:20,tipY:45},Fe={width:34,height:44};function vt(n){const a=Fe.width/J.width;return{svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${J.width}" height="${J.height}" viewBox="0 0 ${J.width} ${J.height}"><defs><filter id="s" x="-40%" y="-20%" width="180%" height="160%"><feDropShadow dx="0" dy="2" stdDeviation="1.8" flood-color="#000" flood-opacity=".3"/></filter></defs><path filter="url(#s)" fill="${n}" stroke="#fff" stroke-width="2.2" stroke-linejoin="round" d="M20 3C11.2 3 4 10 4 18.7c0 10.9 13.3 24 14.7 25.3a1.9 1.9 0 0 0 2.6 0C22.7 42.7 36 29.6 36 18.7 36 10 28.8 3 20 3Z"/><circle cx="20" cy="18.5" r="6.2" fill="#fff"/></svg>`,width:Fe.width,height:Fe.height,anchorX:J.tipX*a,anchorY:J.tipY*a}}const ho=()=>vt(Ge("accent","#056472"));function yo(){const n=getComputedStyle(document.documentElement),a=(w,j)=>{const E=n.getPropertyValue(`--tz-color-${w}-rgb`).trim();if(!E)return j;const[k,N,F]=E.split(",").map(R=>Number(R.trim()));return`#${[k,N,F].map(R=>R.toString(16).padStart(2,"0")).join("")}`},d=a("surface","#191919"),y=a("background","#0f0f0f"),i=a("primary","#e6e8eb"),v=a("accent","#16a6b4");return[{elementType:"geometry",stylers:[{color:d}]},{elementType:"labels.text.fill",stylers:[{color:i},{lightness:-35}]},{elementType:"labels.text.stroke",stylers:[{color:y}]},{featureType:"road",elementType:"geometry",stylers:[{color:y}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:d}]},{featureType:"water",elementType:"geometry",stylers:[{color:v},{lightness:-55}]},{featureType:"poi",elementType:"geometry",stylers:[{color:d},{lightness:4}]},{featureType:"transit",stylers:[{visibility:"off"}]}]}const xo=r.forwardRef(function({value:a,defaultValue:d=null,onChange:y,name:i,label:v,helperText:w,error:j,required:E=!1,disabled:k=!1,size:N="md",apiKey:F,mapId:R,center:I,defaultCenter:C,onCenterChange:l,zoom:m,defaultZoom:T=mo,onZoomChange:b,mapHeight:g=300,locateButton:f=!0,precision:u=6,search:ee=!1,searchRegions:te,geocode:G=!1,onAddressChange:q,addressName:X,className:H,style:Y,...p},_){const h=he.useT(),{language:V}=he.useLanguage(),Le=he.useColorMode(),He=he.useMapsConfig(),ye=F??He.apiKey,W=R??He.mapId,Ue=`${r.useId()}-label`,Q=Tt.useFormContext(),ae=!!(Q&&i),D=ae?Q.field(i):void 0,[_t,bt]=r.useState(d),s=a!==void 0?a:ae?Q.values[i]??null:_t,xe=j??(D==null?void 0:D.error)??!1,Ze=w??(D==null?void 0:D.helperText),Ke=r.useRef(!1),[Ee,le]=r.useState(null),[Xe,ce]=r.useState(!1),Ye=r.useRef(null),Ve=r.useRef(0),U=r.useCallback(e=>{const o=e&&{lat:O(e.lat,u),lng:O(e.lng,u)};Ke.current=!0,a===void 0&&!ae&&bt(o),ae&&Q.setValue(i,o),y==null||y(o)},[a,ae,Q,i,y,u]),qe=r.useRef(U);qe.current=U;const[ie,Me]=r.useState(()=>Te(s==null?void 0:s.lat,u)),[ue,Ne]=r.useState(()=>Te(s==null?void 0:s.lng,u)),Re=r.useRef({lat:ie,lng:ue});Re.current={lat:ie,lng:ue},r.useEffect(()=>{const e=se(Re.current.lat,90),o=se(Re.current.lng,180),x=e!=null&&o!=null?{lat:e,lng:o}:null;(s?x!=null&&pe(x,s):x==null)||(Me(Te(s==null?void 0:s.lat,u)),Ne(Te(s==null?void 0:s.lng,u)))},[s==null?void 0:s.lat,s==null?void 0:s.lng,u]);const ve=se(ie,90),_e=se(ue,180),[We,be]=r.useState({lat:!1,lng:!1}),Qe=ve===null&&_e!=null&&We.lat,Je=_e===null&&ve!=null&&We.lng,et=r.useRef(null);r.useEffect(()=>{const e=et.current;e&&(i?e.setAttribute("name",i):e.removeAttribute("name"))},[i]);const Ce=r.useRef(null),B=r.useRef(null),oe=r.useRef(null),ne=r.useRef(null),[L,de]=r.useState(ye?"loading":"missingKey"),[kt,De]=r.useState(!1),[tt,ot]=r.useState(!1),wt=I??C??s??Pe,It=m??T,P=r.useRef({center:wt,zoom:It}),ke=r.useRef(l);ke.current=l;const we=r.useRef(b);we.current=b;const Ie=r.useRef(k);Ie.current=k;const nt=r.useRef(s);nt.current=s;const rt=W?Le:null;r.useEffect(()=>{if(!ye){de("missingKey");return}let e=!1;const o=[];let x=null;ne.current||de("loading");const $=Nt(()=>{e||de("authError")});return Dt(ye,V.split("-")[0]).then(M=>{if(e||!Ce.current)return;ne.current=M,x=document.createElement("div"),x.className=c.mapHost,Ce.current.appendChild(x);const A=M.createMap(x,{center:P.current.center,zoom:P.current.zoom,...W?{mapId:W,colorScheme:M.colorScheme(rt??"light")}:{},disableDefaultUI:!0,zoomControl:!1,clickableIcons:!1,gestureHandling:"cooperative",draggableCursor:Ie.current?void 0:"crosshair"});B.current=A;const Ae=M.createPin(A,{position:nt.current,advanced:!!W,icon:ho()});Ae.setDraggable(!Ie.current),oe.current=Ae,o.push(A.addListener("click",S=>{Ie.current||!S.latLng||qe.current({lat:S.latLng.lat(),lng:S.latLng.lng()})}),Ae.onDragEnd(S=>qe.current(S)),A.addListener("zoom_changed",()=>{var re;const S=A.getZoom();S==null||S===P.current.zoom||(P.current={...P.current,zoom:S},(re=we.current)==null||re.call(we,S))}),A.addListener("idle",()=>{var dt;const S=A.getCenter();if(!S)return;const re={lat:S.lat(),lng:S.lng()};pe(re,P.current.center)||(P.current={...P.current,center:re},(dt=ke.current)==null||dt.call(ke,re))})),de(S=>S==="authError"?S:"ready")}).catch(()=>{e||de("error")}),()=>{var M;e=!0,$(),o.forEach(A=>A.remove()),(M=oe.current)==null||M.remove(),oe.current=null,B.current=null,x==null||x.remove()}},[ye,W,rt]),r.useEffect(()=>{var e;(e=oe.current)==null||e.setPosition(s)},[s,L]),r.useEffect(()=>{var e,o;(e=oe.current)==null||e.setDraggable(!k),(o=B.current)==null||o.setOptions({draggableCursor:k?void 0:"crosshair"})},[k,L]),r.useEffect(()=>{const e=B.current;!e||!I||pe(I,P.current.center)||(P.current={...P.current,center:I},e.setCenter(I))},[I==null?void 0:I.lat,I==null?void 0:I.lng,L]),r.useEffect(()=>{const e=B.current;!e||m==null||m===P.current.zoom||(P.current={...P.current,zoom:m},e.setZoom(m))},[m,L]),r.useEffect(()=>{if(L!=="ready"||typeof MutationObserver>"u")return;let e=Ge("accent","#056472");const o=new MutationObserver(()=>{var $;const x=Ge("accent","#056472");x!==e&&(e=x,($=oe.current)==null||$.setIcon(vt(x)))});return o.observe(document.documentElement,{attributes:!0,attributeFilter:["style","data-tz-theme"]}),()=>o.disconnect()},[L]),r.useEffect(()=>{!B.current||W||B.current.setOptions({styles:Le==="dark"?yo():null})},[Le,W,L]);const st=e=>{const o=B.current;o&&o.setZoom(Math.min(fo,Math.max(go,(o.getZoom()??P.current.zoom)+e)))},at=e=>{Ke.current&&(q==null||q(e),Q&&X&&Q.setValue(X,e??""))},Se=r.useRef(at);Se.current=at,r.useEffect(()=>{const e=++Ve.current;if(!s){le(null),ce(!1),Se.current(null);return}const o=Ye.current;if(o&&pe(o,s)){le(o.address),ce(!1),Se.current(o.address);return}if(!G||L!=="ready"||!ne.current){le(null),ce(!1);return}le(null),ce(!0);const x=ne.current,$=s,M=window.setTimeout(()=>{x.reverseGeocode($,V.split("-")[0]).then(A=>{e===Ve.current&&(le(A),ce(!1),Se.current(A))})},400);return()=>window.clearTimeout(M)},[s==null?void 0:s.lat,s==null?void 0:s.lng,G,L,V]);const St=e=>{const o={lat:O(e.location.lat,u),lng:O(e.location.lng,u)};Ye.current=e.address?{...o,address:e.address}:null,U(o),me(o,ht)},me=(e,o)=>{const x=B.current;x&&(x.panTo(e),o!=null&&(x.getZoom()??0)<o&&x.setZoom(o))},lt=(e,o)=>{const x=se(e,90),$=se(o,180);if(x==null||$==null){s&&U(null);return}const M={lat:x,lng:$};s&&pe(M,s)||(U(M),me(M))},ct=e=>{const o=po(e.clipboardData.getData("text"));o&&(e.preventDefault(),Me(String(O(o.lat,u))),Ne(String(O(o.lng,u))),U(o),me(o))},jt=()=>{navigator.geolocation&&(De(!0),ot(!1),navigator.geolocation.getCurrentPosition(e=>{De(!1);const o={lat:e.coords.latitude,lng:e.coords.longitude};U(o),me(o,ht)},()=>{De(!1),ot(!0)},{enableHighAccuracy:!0,timeout:1e4}))},it=s?`${O(s.lat,u)}, ${O(s.lng,u)}`:"",ut=L==="missingKey"?h("location.missingKey"):L==="authError"?h("location.authError"):L==="error"?h("location.loadError"):null;return t.jsxs("div",{ref:_,role:"group","aria-labelledby":v!=null?Ue:void 0,className:je.clsx(c.root,k&&c.disabled,H),style:{"--tz-location-map-height":`${g}px`,...Y},...p,children:[v!=null&&t.jsxs("div",{className:c.label,id:Ue,children:[t.jsx(K.Typography,{as:"span",variant:"bodySmall",color:"muted",children:v}),E&&t.jsx("span",{className:c.required,"aria-hidden":"true",children:"*"})]}),ee&&L==="ready"&&ne.current&&!k&&t.jsx(uo,{api:ne.current,language:V.split("-")[0],bias:()=>{var o;const e=(o=B.current)==null?void 0:o.getCenter();return e?{lat:e.lat(),lng:e.lng()}:P.current.center},regions:te,size:N,onPick:St}),t.jsxs("div",{ref:et,tabIndex:-1,className:je.clsx(c.frame,xe&&c.error),children:[t.jsx("div",{ref:Ce,className:c.map,role:"application","aria-label":h("location.mapLabel"),"data-testid":"location-map"}),L==="loading"&&t.jsx("div",{className:c.cover,"aria-hidden":"true",children:t.jsx(Lt.Skeleton,{variant:"rect",width:"100%",height:"100%",radius:"xxs"})}),ut&&t.jsxs("div",{className:je.clsx(c.cover,c.message),role:"status",children:[t.jsx("span",{className:c.messageIcon,children:t.jsx(z.Icon,{name:"Map"})}),t.jsx(K.Typography,{variant:"bodySmall",color:"muted",align:"center",children:ut})]}),L==="ready"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:c.controls,children:[f&&!k&&typeof navigator<"u"&&navigator.geolocation&&t.jsx(fe.Tooltip,{content:h(tt?"location.locateFailed":"location.locate"),placement:"left",children:t.jsx(ge.IconButton,{size:"sm",color:"surface",className:c.control,"aria-label":h("location.locate"),loading:kt,onClick:jt,children:t.jsx(z.Icon,{name:tt?"GpsSlash":"Gps"})})}),s&&t.jsx(fe.Tooltip,{content:h("location.centerOnPin"),placement:"left",children:t.jsx(ge.IconButton,{size:"sm",color:"surface",className:c.control,"aria-label":h("location.centerOnPin"),onClick:()=>me(s),children:t.jsx(z.Icon,{name:"Location"})})}),s&&!k&&t.jsx(fe.Tooltip,{content:h("location.removePin"),placement:"left",children:t.jsx(ge.IconButton,{size:"sm",color:"surface",className:c.control,"aria-label":h("location.removePin"),onClick:()=>U(null),children:t.jsx(z.Icon,{name:"LocationCross"})})})]}),t.jsxs("div",{className:je.clsx(c.controls,c.zoomControls),children:[t.jsx(fe.Tooltip,{content:h("location.zoomIn"),placement:"left",children:t.jsx(ge.IconButton,{size:"sm",color:"surface",className:c.control,"aria-label":h("location.zoomIn"),onClick:()=>st(1),children:t.jsx(z.Icon,{name:"Add"})})}),t.jsx(fe.Tooltip,{content:h("location.zoomOut"),placement:"left",children:t.jsx(ge.IconButton,{size:"sm",color:"surface",className:c.control,"aria-label":h("location.zoomOut"),onClick:()=>st(-1),children:t.jsx(z.Icon,{name:"Minus"})})})]}),t.jsx("div",{className:c.badge,"aria-live":"polite",children:s?t.jsxs(t.Fragment,{children:[t.jsx(z.Icon,{name:"Location",size:"sm",className:c.badgeIcon}),t.jsx("span",{className:c.coords,children:it}),t.jsx(Pt.CopyButton,{value:it,size:"sm",className:c.copy})]}):!k&&t.jsxs(t.Fragment,{children:[t.jsx(z.Icon,{name:"LocationAdd",size:"sm",className:c.badgeIcon}),t.jsx("span",{children:h("location.hint")})]})})]})]}),(G||ee)&&s&&(Ee||Xe)&&t.jsxs("div",{className:c.address,"aria-live":"polite",children:[t.jsx(z.Icon,{name:"Location",size:"sm",className:c.addressIcon}),Xe&&!Ee?t.jsx(K.Typography,{as:"span",variant:"bodySmall",color:"muted",children:h("location.addressLoading")}):t.jsx(K.Typography,{as:"span",variant:"bodySmall",className:c.addressText,children:Ee})]}),t.jsxs("div",{className:c.fields,children:[t.jsx(Be.TextField,{label:h("location.latitude"),size:N,inputMode:"decimal",placeholder:String(Pe.lat),value:ie,disabled:k,error:xe||ve===void 0||Qe,helperText:ve===void 0?h("location.latitudeRange"):Qe?h("location.pairIncomplete"):void 0,onChange:e=>{Me(e.target.value),be(o=>o.lat?o:{...o,lat:!0}),lt(e.target.value,ue)},onPaste:ct,onBlur:e=>{be(o=>o.lat?o:{...o,lat:!0}),D==null||D.onBlur(e)}}),t.jsx(Be.TextField,{label:h("location.longitude"),size:N,inputMode:"decimal",placeholder:String(Pe.lng),value:ue,disabled:k,error:xe||_e===void 0||Je,helperText:_e===void 0?h("location.longitudeRange"):Je?h("location.pairIncomplete"):void 0,onChange:e=>{Ne(e.target.value),be(o=>o.lng?o:{...o,lng:!0}),lt(ie,e.target.value)},onPaste:ct,onBlur:e=>{be(o=>o.lng?o:{...o,lng:!0}),D==null||D.onBlur(e)}})]}),Ze!=null&&t.jsx(K.Typography,{as:"span",variant:"bodySmall",color:xe?"error":"muted",className:c.helper,children:Ze})]})});exports.LocationPicker=xo;exports.TBILISI=Pe;
|
|
2
|
-
//# sourceMappingURL=LocationPicker-
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),r=require("react"),je=require("clsx"),Tt=require("./formContext-bTWrqdEV.cjs"),Pt=require("./CopyButton-DlSi82gv.cjs"),z=require("./Icon-B6lz-V0A.cjs"),ge=require("./IconButton-CxSXEYce.cjs"),Lt=require("./Skeleton-DK0lAjS9.cjs"),Be=require("./TextField-C5MgCQIV.cjs"),fe=require("./Tooltip-DmMq5R1x.cjs"),K=require("./Typography-d97DdbNd.cjs"),Et=require("./FloatingPanel-tGCG2nhA.cjs"),qt=require("./ListItem-DkCYXucd.cjs"),mt=require("./Loader-5zp2MPm5.cjs"),he=require("./ConfigProvider-BaiTKZKC.cjs"),yt="tz-google-maps",gt="__tzGoogleMapsReady";let Z=null,ft=!1,xt=!1;const $e=new Set;function Mt(){const n=globalThis;if(n.__tzAuthHooked)return;n.__tzAuthHooked=!0;const a=n.gm_authFailure;n.gm_authFailure=()=>{xt=!0,$e.forEach(d=>d()),a==null||a()}}function Nt(n){return xt&&n(),$e.add(n),()=>{$e.delete(n)}}const Oe=()=>globalThis.google,ze=n=>typeof n.lat=="function"?{lat:n.lat(),lng:n.lng()}:n;function Rt(n,a){return new Promise((d,y)=>{const i=new URLSearchParams({key:n,v:"weekly",loading:"async",callback:gt});a&&i.set("language",a),globalThis[gt]=()=>d();const v=document.createElement("script");v.id=yt,v.async=!0,v.src=`https://maps.googleapis.com/maps/api/js?${i.toString()}`,v.onerror=()=>{v.remove(),y(new Error("The Google Maps script failed to load"))},document.head.appendChild(v)})}async function Ct(){var I,C;const n=Oe();if(!((I=n==null?void 0:n.maps)!=null&&I.importLibrary))throw new Error("Google Maps is unavailable");const[a,d,y]=await Promise.all([n.maps.importLibrary("core"),n.maps.importLibrary("maps"),n.maps.importLibrary("marker")]),i={...a,...d,...y},v=(C=n.maps.Animation)==null?void 0:C.DROP,w=l=>`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(l)}`,j=l=>({url:w(l.svg),scaledSize:i.Size?new i.Size(l.width,l.height):{width:l.width,height:l.height},anchor:i.Point?new i.Point(l.anchorX,l.anchorY):{x:l.anchorX,y:l.anchorY}}),E=l=>{const m=document.createElement("img");return m.src=w(l.svg),m.width=l.width,m.height=l.height,m.alt="",m.style.display="block",m.style.transform=`translate(${l.width/2-l.anchorX}px, ${l.height-l.anchorY}px)`,m};let k=null,N=null;const F=()=>k??(k=n.maps.importLibrary("places")),R=()=>N??(N=n.maps.importLibrary("geocoding"));return{colorScheme:l=>i.ColorScheme?i.ColorScheme[l==="dark"?"DARK":"LIGHT"]:l.toUpperCase(),createPlacesSession:()=>{let l=null,m=new Map;return{async suggest(T,{language:b,bias:g,regions:f}){const u=await F();l??(l=new u.AutocompleteSessionToken);const{suggestions:ee}=await u.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:T,sessionToken:l,...b?{language:b}:{},...g?{locationBias:{center:g,radius:5e4}}:{},...f!=null&&f.length?{includedRegionCodes:f}:{}});return m=new Map,ee.flatMap((te,G)=>{var Y,p,_;const q=te.placePrediction;if(!q)return[];const X=q.placeId??String(G);m.set(X,q);const H=((Y=q.mainText)==null?void 0:Y.text)??((p=q.text)==null?void 0:p.text)??"";return[{id:X,primary:H,secondary:((_=q.secondaryText)==null?void 0:_.text)??void 0}]})},async resolve(T){const b=m.get(T);if(!b)return null;const g=b.toPlace();return await g.fetchFields({fields:["location","formattedAddress"]}),l=null,g.location?{location:ze(g.location),address:g.formattedAddress??void 0}:null}}},reverseGeocode:async(l,m)=>{var b;const T=await R();try{const{results:g}=await new T.Geocoder().geocode({location:l,...m?{language:m}:{}});return((b=g[0])==null?void 0:b.formatted_address)??null}catch(g){return(g==null?void 0:g.code)==="REQUEST_DENIED"&&!ft&&(ft=!0,console.warn("[LocationPicker] Address lookup was denied — enable the Geocoding API for this Google Maps key (and allow it in the key's API restrictions).")),null}},createMap:(l,m)=>new i.Map(l,m),createPin:(l,{position:m,advanced:T,icon:b})=>{if(T&&i.AdvancedMarkerElement){const f=new i.AdvancedMarkerElement({map:l,position:m,gmpDraggable:!0,...b?{content:E(b)}:{}});return{setPosition:u=>{f.position=u},setIcon:u=>{f.content=E(u)},setDraggable:u=>{f.gmpDraggable=u},onDragEnd:u=>f.addListener("dragend",()=>f.position&&u(ze(f.position))),remove:()=>{f.map=null}}}const g=new i.Marker({map:l,position:m,draggable:!0,animation:v,...b?{icon:j(b)}:{}});return{setPosition:f=>g.setPosition(f),setIcon:f=>g.setIcon(j(f)),setDraggable:f=>g.setDraggable(f),onDragEnd:f=>g.addListener("dragend",()=>{const u=g.getPosition();u&&f(ze(u))}),remove:()=>g.setMap(null)}}}}function Dt(n,a){if(Mt(),Z&&Z.key===n)return Z.promise;const d=(async()=>{var y,i;if(!((i=(y=Oe())==null?void 0:y.maps)!=null&&i.importLibrary)){if(typeof document>"u")throw new Error("Google Maps needs a browser");document.getElementById(yt)?await new Promise(v=>{const w=()=>{var j,E;return(E=(j=Oe())==null?void 0:j.maps)!=null&&E.importLibrary?v():setTimeout(w,50)};w()}):await Rt(n,a)}return Ct()})();return Z={key:n,promise:d},d.catch(()=>{(Z==null?void 0:Z.promise)===d&&(Z=null)}),d}const At="_root_1ykqa_4",zt="_label_1ykqa_12",Ft="_required_1ykqa_18",Bt="_helper_1ykqa_21",$t="_frame_1ykqa_27",Ot="_error_1ykqa_46",Gt="_map_1ykqa_53",Ht="_mapHost_1ykqa_58",Ut="_cover_1ykqa_64",Zt="_message_1ykqa_70",Kt="_messageIcon_1ykqa_78",Xt="_controls_1ykqa_90",Yt="_control_1ykqa_90",Vt="_zoomControls_1ykqa_106",Wt="_badge_1ykqa_114",Qt="_badgeIcon_1ykqa_137",Jt="_coords_1ykqa_141",eo="_copy_1ykqa_147",to="_search_1ykqa_155",oo="_searchPanel_1ykqa_158",no="_searchStatus_1ykqa_163",ro="_address_1ykqa_171",so="_addressIcon_1ykqa_178",ao="_addressText_1ykqa_183",lo="_fields_1ykqa_189",co="_disabled_1ykqa_202",c={root:At,label:zt,required:Ft,helper:Bt,frame:$t,error:Ot,map:Gt,mapHost:Ht,cover:Ut,message:Zt,messageIcon:Kt,controls:Xt,control:Yt,zoomControls:Vt,badge:Wt,badgeIcon:Qt,coords:Jt,copy:eo,search:to,searchPanel:oo,searchStatus:no,address:ro,addressIcon:so,addressText:ao,fields:lo,disabled:co},io=250,pt=2;function uo({api:n,language:a,bias:d,regions:y,size:i,disabled:v,onPick:w}){const j=he.useT(),E=r.useId(),k=r.useRef(null),N=r.useRef(null),F=r.useRef(0),[R,I]=r.useState(""),[C,l]=r.useState([]),[m,T]=r.useState("idle"),[b,g]=r.useState(!1),[f,u]=r.useState(-1),[ee,te]=r.useState(!1),G=()=>N.current??(N.current=n.createPlacesSession());r.useEffect(()=>{const p=R.trim();if(p.length<pt){l([]),T("idle");return}const _=++F.current;T("loading");const h=window.setTimeout(()=>{G().suggest(p,{language:a,bias:d==null?void 0:d(),regions:y}).then(V=>{_===F.current&&(l(V),u(V.length?0:-1),T("ready"))}).catch(()=>{_===F.current&&(l([]),T("error"))})},io);return()=>window.clearTimeout(h)},[R,a,y==null?void 0:y.join(",")]);const q=async p=>{te(!0);try{const _=await G().resolve(p.id);if(N.current=null,!_)return;I(_.address??[p.primary,p.secondary].filter(Boolean).join(", ")),g(!1),l([]),T("idle"),F.current++,w(_)}catch{T("error")}finally{te(!1)}},X=p=>{if(p.key==="ArrowDown"||p.key==="ArrowUp"){if(!C.length)return;p.preventDefault(),g(!0);const _=p.key==="ArrowDown"?1:-1;u(h=>(h+_+C.length)%C.length)}else if(p.key==="Enter"){p.preventDefault();const _=C[f];b&&_&&q(_)}else p.key==="Escape"&&b&&(p.stopPropagation(),g(!1))},H=b&&R.trim().length>=pt&&m!=="idle",Y=p=>`${E}-option-${p}`;return t.jsxs("div",{ref:k,className:c.search,children:[t.jsx(Be.TextField,{size:i,disabled:v,value:R,placeholder:j("location.searchPlaceholder"),adornment:ee?t.jsx(mt.Loader,{size:"sm"}):t.jsx(z.Icon,{name:"SearchNormal"}),role:"combobox","aria-label":j("location.searchPlaceholder"),"aria-autocomplete":"list","aria-expanded":H,"aria-controls":H?E:void 0,"aria-activedescendant":H&&f>=0?Y(f):void 0,autoComplete:"off",onChange:p=>{I(p.target.value),g(!0)},onFocus:()=>g(!0),onKeyDown:X}),t.jsx(Et.FloatingPanel,{open:H,triggerRef:k,matchTriggerWidth:!0,onClose:()=>g(!1),className:c.searchPanel,children:m==="loading"&&!C.length?t.jsxs("div",{className:c.searchStatus,children:[t.jsx(mt.Loader,{size:"sm"}),t.jsx(K.Typography,{variant:"bodySmall",color:"muted",children:j("location.searching")})]}):m==="error"?t.jsxs("div",{className:c.searchStatus,children:[t.jsx(z.Icon,{name:"Danger",color:"error"}),t.jsx(K.Typography,{variant:"bodySmall",color:"muted",children:j("location.searchUnavailable")})]}):C.length===0?t.jsx("div",{className:c.searchStatus,children:t.jsx(K.Typography,{variant:"bodySmall",color:"muted",children:j("location.searchEmpty")})}):t.jsx("div",{role:"listbox",id:E,"aria-label":j("location.searchPlaceholder"),children:C.map((p,_)=>t.jsx(qt.ListItem,{id:Y(_),role:"option","aria-selected":_===f,selected:_===f,clickable:!0,icon:t.jsx(z.Icon,{name:"Location"}),description:p.secondary,onMouseDown:h=>h.preventDefault(),onMouseEnter:()=>u(_),onClick:()=>void q(p),children:p.primary},p.id))})})]})}const Pe={lat:41.7151,lng:44.8271},mo=12,go=0,fo=22,ht=16,O=(n,a)=>Number(n.toFixed(a)),pe=(n,a)=>Math.abs(n.lat-a.lat)<1e-7&&Math.abs(n.lng-a.lng)<1e-7,Te=(n,a)=>n==null?"":String(O(n,a));function se(n,a){const d=n.trim().replace(",",".");if(d==="")return null;if(!/^[-+]?\d+(\.\d*)?$/.test(d))return;const y=Number(d);return Math.abs(y)<=a?y:void 0}function po(n){const a=n.trim().match(/^\(?\s*([-+]?\d+(?:\.\d+)?)\s*[,;\s]\s*([-+]?\d+(?:\.\d+)?)\s*\)?$/);if(!a)return null;const d=Number(a[1]),y=Number(a[2]);return Math.abs(d)<=90&&Math.abs(y)<=180?{lat:d,lng:y}:null}function Ge(n,a){const d=getComputedStyle(document.documentElement).getPropertyValue(`--tz-color-${n}-rgb`).trim();if(!d)return a;const[y,i,v]=d.split(",").map(w=>Number(w.trim()));return[y,i,v].some(w=>Number.isNaN(w))?a:`#${[y,i,v].map(w=>w.toString(16).padStart(2,"0")).join("")}`}const J={width:40,height:52,tipX:20,tipY:45},Fe={width:34,height:44};function vt(n){const a=Fe.width/J.width;return{svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${J.width}" height="${J.height}" viewBox="0 0 ${J.width} ${J.height}"><defs><filter id="s" x="-40%" y="-20%" width="180%" height="160%"><feDropShadow dx="0" dy="2" stdDeviation="1.8" flood-color="#000" flood-opacity=".3"/></filter></defs><path filter="url(#s)" fill="${n}" stroke="#fff" stroke-width="2.2" stroke-linejoin="round" d="M20 3C11.2 3 4 10 4 18.7c0 10.9 13.3 24 14.7 25.3a1.9 1.9 0 0 0 2.6 0C22.7 42.7 36 29.6 36 18.7 36 10 28.8 3 20 3Z"/><circle cx="20" cy="18.5" r="6.2" fill="#fff"/></svg>`,width:Fe.width,height:Fe.height,anchorX:J.tipX*a,anchorY:J.tipY*a}}const ho=()=>vt(Ge("accent","#056472"));function yo(){const n=getComputedStyle(document.documentElement),a=(w,j)=>{const E=n.getPropertyValue(`--tz-color-${w}-rgb`).trim();if(!E)return j;const[k,N,F]=E.split(",").map(R=>Number(R.trim()));return`#${[k,N,F].map(R=>R.toString(16).padStart(2,"0")).join("")}`},d=a("surface","#191919"),y=a("background","#0f0f0f"),i=a("primary","#e6e8eb"),v=a("accent","#16a6b4");return[{elementType:"geometry",stylers:[{color:d}]},{elementType:"labels.text.fill",stylers:[{color:i},{lightness:-35}]},{elementType:"labels.text.stroke",stylers:[{color:y}]},{featureType:"road",elementType:"geometry",stylers:[{color:y}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:d}]},{featureType:"water",elementType:"geometry",stylers:[{color:v},{lightness:-55}]},{featureType:"poi",elementType:"geometry",stylers:[{color:d},{lightness:4}]},{featureType:"transit",stylers:[{visibility:"off"}]}]}const xo=r.forwardRef(function({value:a,defaultValue:d=null,onChange:y,name:i,label:v,helperText:w,error:j,required:E=!1,disabled:k=!1,size:N="md",apiKey:F,mapId:R,center:I,defaultCenter:C,onCenterChange:l,zoom:m,defaultZoom:T=mo,onZoomChange:b,mapHeight:g=300,locateButton:f=!0,precision:u=6,search:ee=!1,searchRegions:te,geocode:G=!1,onAddressChange:q,addressName:X,className:H,style:Y,...p},_){const h=he.useT(),{language:V}=he.useLanguage(),Le=he.useColorMode(),He=he.useMapsConfig(),ye=F??He.apiKey,W=R??He.mapId,Ue=`${r.useId()}-label`,Q=Tt.useFormContext(),ae=!!(Q&&i),D=ae?Q.field(i):void 0,[_t,bt]=r.useState(d),s=a!==void 0?a:ae?Q.values[i]??null:_t,xe=j??(D==null?void 0:D.error)??!1,Ze=w??(D==null?void 0:D.helperText),Ke=r.useRef(!1),[Ee,le]=r.useState(null),[Xe,ce]=r.useState(!1),Ye=r.useRef(null),Ve=r.useRef(0),U=r.useCallback(e=>{const o=e&&{lat:O(e.lat,u),lng:O(e.lng,u)};Ke.current=!0,a===void 0&&!ae&&bt(o),ae&&Q.setValue(i,o),y==null||y(o)},[a,ae,Q,i,y,u]),qe=r.useRef(U);qe.current=U;const[ie,Me]=r.useState(()=>Te(s==null?void 0:s.lat,u)),[ue,Ne]=r.useState(()=>Te(s==null?void 0:s.lng,u)),Re=r.useRef({lat:ie,lng:ue});Re.current={lat:ie,lng:ue},r.useEffect(()=>{const e=se(Re.current.lat,90),o=se(Re.current.lng,180),x=e!=null&&o!=null?{lat:e,lng:o}:null;(s?x!=null&&pe(x,s):x==null)||(Me(Te(s==null?void 0:s.lat,u)),Ne(Te(s==null?void 0:s.lng,u)))},[s==null?void 0:s.lat,s==null?void 0:s.lng,u]);const ve=se(ie,90),_e=se(ue,180),[We,be]=r.useState({lat:!1,lng:!1}),Qe=ve===null&&_e!=null&&We.lat,Je=_e===null&&ve!=null&&We.lng,et=r.useRef(null);r.useEffect(()=>{const e=et.current;e&&(i?e.setAttribute("name",i):e.removeAttribute("name"))},[i]);const Ce=r.useRef(null),B=r.useRef(null),oe=r.useRef(null),ne=r.useRef(null),[L,de]=r.useState(ye?"loading":"missingKey"),[kt,De]=r.useState(!1),[tt,ot]=r.useState(!1),wt=I??C??s??Pe,It=m??T,P=r.useRef({center:wt,zoom:It}),ke=r.useRef(l);ke.current=l;const we=r.useRef(b);we.current=b;const Ie=r.useRef(k);Ie.current=k;const nt=r.useRef(s);nt.current=s;const rt=W?Le:null;r.useEffect(()=>{if(!ye){de("missingKey");return}let e=!1;const o=[];let x=null;ne.current||de("loading");const $=Nt(()=>{e||de("authError")});return Dt(ye,V.split("-")[0]).then(M=>{if(e||!Ce.current)return;ne.current=M,x=document.createElement("div"),x.className=c.mapHost,Ce.current.appendChild(x);const A=M.createMap(x,{center:P.current.center,zoom:P.current.zoom,...W?{mapId:W,colorScheme:M.colorScheme(rt??"light")}:{},disableDefaultUI:!0,zoomControl:!1,clickableIcons:!1,gestureHandling:"cooperative",draggableCursor:Ie.current?void 0:"crosshair"});B.current=A;const Ae=M.createPin(A,{position:nt.current,advanced:!!W,icon:ho()});Ae.setDraggable(!Ie.current),oe.current=Ae,o.push(A.addListener("click",S=>{Ie.current||!S.latLng||qe.current({lat:S.latLng.lat(),lng:S.latLng.lng()})}),Ae.onDragEnd(S=>qe.current(S)),A.addListener("zoom_changed",()=>{var re;const S=A.getZoom();S==null||S===P.current.zoom||(P.current={...P.current,zoom:S},(re=we.current)==null||re.call(we,S))}),A.addListener("idle",()=>{var dt;const S=A.getCenter();if(!S)return;const re={lat:S.lat(),lng:S.lng()};pe(re,P.current.center)||(P.current={...P.current,center:re},(dt=ke.current)==null||dt.call(ke,re))})),de(S=>S==="authError"?S:"ready")}).catch(()=>{e||de("error")}),()=>{var M;e=!0,$(),o.forEach(A=>A.remove()),(M=oe.current)==null||M.remove(),oe.current=null,B.current=null,x==null||x.remove()}},[ye,W,rt]),r.useEffect(()=>{var e;(e=oe.current)==null||e.setPosition(s)},[s,L]),r.useEffect(()=>{var e,o;(e=oe.current)==null||e.setDraggable(!k),(o=B.current)==null||o.setOptions({draggableCursor:k?void 0:"crosshair"})},[k,L]),r.useEffect(()=>{const e=B.current;!e||!I||pe(I,P.current.center)||(P.current={...P.current,center:I},e.setCenter(I))},[I==null?void 0:I.lat,I==null?void 0:I.lng,L]),r.useEffect(()=>{const e=B.current;!e||m==null||m===P.current.zoom||(P.current={...P.current,zoom:m},e.setZoom(m))},[m,L]),r.useEffect(()=>{if(L!=="ready"||typeof MutationObserver>"u")return;let e=Ge("accent","#056472");const o=new MutationObserver(()=>{var $;const x=Ge("accent","#056472");x!==e&&(e=x,($=oe.current)==null||$.setIcon(vt(x)))});return o.observe(document.documentElement,{attributes:!0,attributeFilter:["style","data-tz-theme"]}),()=>o.disconnect()},[L]),r.useEffect(()=>{!B.current||W||B.current.setOptions({styles:Le==="dark"?yo():null})},[Le,W,L]);const st=e=>{const o=B.current;o&&o.setZoom(Math.min(fo,Math.max(go,(o.getZoom()??P.current.zoom)+e)))},at=e=>{Ke.current&&(q==null||q(e),Q&&X&&Q.setValue(X,e??""))},Se=r.useRef(at);Se.current=at,r.useEffect(()=>{const e=++Ve.current;if(!s){le(null),ce(!1),Se.current(null);return}const o=Ye.current;if(o&&pe(o,s)){le(o.address),ce(!1),Se.current(o.address);return}if(!G||L!=="ready"||!ne.current){le(null),ce(!1);return}le(null),ce(!0);const x=ne.current,$=s,M=window.setTimeout(()=>{x.reverseGeocode($,V.split("-")[0]).then(A=>{e===Ve.current&&(le(A),ce(!1),Se.current(A))})},400);return()=>window.clearTimeout(M)},[s==null?void 0:s.lat,s==null?void 0:s.lng,G,L,V]);const St=e=>{const o={lat:O(e.location.lat,u),lng:O(e.location.lng,u)};Ye.current=e.address?{...o,address:e.address}:null,U(o),me(o,ht)},me=(e,o)=>{const x=B.current;x&&(x.panTo(e),o!=null&&(x.getZoom()??0)<o&&x.setZoom(o))},lt=(e,o)=>{const x=se(e,90),$=se(o,180);if(x==null||$==null){s&&U(null);return}const M={lat:x,lng:$};s&&pe(M,s)||(U(M),me(M))},ct=e=>{const o=po(e.clipboardData.getData("text"));o&&(e.preventDefault(),Me(String(O(o.lat,u))),Ne(String(O(o.lng,u))),U(o),me(o))},jt=()=>{navigator.geolocation&&(De(!0),ot(!1),navigator.geolocation.getCurrentPosition(e=>{De(!1);const o={lat:e.coords.latitude,lng:e.coords.longitude};U(o),me(o,ht)},()=>{De(!1),ot(!0)},{enableHighAccuracy:!0,timeout:1e4}))},it=s?`${O(s.lat,u)}, ${O(s.lng,u)}`:"",ut=L==="missingKey"?h("location.missingKey"):L==="authError"?h("location.authError"):L==="error"?h("location.loadError"):null;return t.jsxs("div",{ref:_,role:"group","aria-labelledby":v!=null?Ue:void 0,className:je.clsx(c.root,k&&c.disabled,H),style:{"--tz-location-map-height":`${g}px`,...Y},...p,children:[v!=null&&t.jsxs("div",{className:c.label,id:Ue,children:[t.jsx(K.Typography,{as:"span",variant:"bodySmall",color:"muted",children:v}),E&&t.jsx("span",{className:c.required,"aria-hidden":"true",children:"*"})]}),ee&&L==="ready"&&ne.current&&!k&&t.jsx(uo,{api:ne.current,language:V.split("-")[0],bias:()=>{var o;const e=(o=B.current)==null?void 0:o.getCenter();return e?{lat:e.lat(),lng:e.lng()}:P.current.center},regions:te,size:N,onPick:St}),t.jsxs("div",{ref:et,tabIndex:-1,className:je.clsx(c.frame,xe&&c.error),children:[t.jsx("div",{ref:Ce,className:c.map,role:"application","aria-label":h("location.mapLabel"),"data-testid":"location-map"}),L==="loading"&&t.jsx("div",{className:c.cover,"aria-hidden":"true",children:t.jsx(Lt.Skeleton,{variant:"rect",width:"100%",height:"100%",radius:"xxs"})}),ut&&t.jsxs("div",{className:je.clsx(c.cover,c.message),role:"status",children:[t.jsx("span",{className:c.messageIcon,children:t.jsx(z.Icon,{name:"Map"})}),t.jsx(K.Typography,{variant:"bodySmall",color:"muted",align:"center",children:ut})]}),L==="ready"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:c.controls,children:[f&&!k&&typeof navigator<"u"&&navigator.geolocation&&t.jsx(fe.Tooltip,{content:h(tt?"location.locateFailed":"location.locate"),placement:"left",children:t.jsx(ge.IconButton,{size:"sm",color:"surface",className:c.control,"aria-label":h("location.locate"),loading:kt,onClick:jt,children:t.jsx(z.Icon,{name:tt?"GpsSlash":"Gps"})})}),s&&t.jsx(fe.Tooltip,{content:h("location.centerOnPin"),placement:"left",children:t.jsx(ge.IconButton,{size:"sm",color:"surface",className:c.control,"aria-label":h("location.centerOnPin"),onClick:()=>me(s),children:t.jsx(z.Icon,{name:"Location"})})}),s&&!k&&t.jsx(fe.Tooltip,{content:h("location.removePin"),placement:"left",children:t.jsx(ge.IconButton,{size:"sm",color:"surface",className:c.control,"aria-label":h("location.removePin"),onClick:()=>U(null),children:t.jsx(z.Icon,{name:"LocationCross"})})})]}),t.jsxs("div",{className:je.clsx(c.controls,c.zoomControls),children:[t.jsx(fe.Tooltip,{content:h("location.zoomIn"),placement:"left",children:t.jsx(ge.IconButton,{size:"sm",color:"surface",className:c.control,"aria-label":h("location.zoomIn"),onClick:()=>st(1),children:t.jsx(z.Icon,{name:"Add"})})}),t.jsx(fe.Tooltip,{content:h("location.zoomOut"),placement:"left",children:t.jsx(ge.IconButton,{size:"sm",color:"surface",className:c.control,"aria-label":h("location.zoomOut"),onClick:()=>st(-1),children:t.jsx(z.Icon,{name:"Minus"})})})]}),t.jsx("div",{className:c.badge,"aria-live":"polite",children:s?t.jsxs(t.Fragment,{children:[t.jsx(z.Icon,{name:"Location",size:"sm",className:c.badgeIcon}),t.jsx("span",{className:c.coords,children:it}),t.jsx(Pt.CopyButton,{value:it,size:"sm",className:c.copy})]}):!k&&t.jsxs(t.Fragment,{children:[t.jsx(z.Icon,{name:"LocationAdd",size:"sm",className:c.badgeIcon}),t.jsx("span",{children:h("location.hint")})]})})]})]}),(G||ee)&&s&&(Ee||Xe)&&t.jsxs("div",{className:c.address,"aria-live":"polite",children:[t.jsx(z.Icon,{name:"Location",size:"sm",className:c.addressIcon}),Xe&&!Ee?t.jsx(K.Typography,{as:"span",variant:"bodySmall",color:"muted",children:h("location.addressLoading")}):t.jsx(K.Typography,{as:"span",variant:"bodySmall",className:c.addressText,children:Ee})]}),t.jsxs("div",{className:c.fields,children:[t.jsx(Be.TextField,{label:h("location.latitude"),size:N,inputMode:"decimal",placeholder:String(Pe.lat),value:ie,disabled:k,error:xe||ve===void 0||Qe,helperText:ve===void 0?h("location.latitudeRange"):Qe?h("location.pairIncomplete"):void 0,onChange:e=>{Me(e.target.value),be(o=>o.lat?o:{...o,lat:!0}),lt(e.target.value,ue)},onPaste:ct,onBlur:e=>{be(o=>o.lat?o:{...o,lat:!0}),D==null||D.onBlur(e)}}),t.jsx(Be.TextField,{label:h("location.longitude"),size:N,inputMode:"decimal",placeholder:String(Pe.lng),value:ue,disabled:k,error:xe||_e===void 0||Je,helperText:_e===void 0?h("location.longitudeRange"):Je?h("location.pairIncomplete"):void 0,onChange:e=>{Ne(e.target.value),be(o=>o.lng?o:{...o,lng:!0}),lt(ie,e.target.value)},onPaste:ct,onBlur:e=>{be(o=>o.lng?o:{...o,lng:!0}),D==null||D.onBlur(e)}})]}),Ze!=null&&t.jsx(K.Typography,{as:"span",variant:"bodySmall",color:xe?"error":"muted",className:c.helper,children:Ze})]})});exports.LocationPicker=xo;exports.TBILISI=Pe;
|
|
2
|
+
//# sourceMappingURL=LocationPicker-CGHXTIml.cjs.map
|