@techzyapp/ui-library 1.0.29 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Accordion-w-w_WxxV.js → Accordion-ClK2XpD7.js} +3 -3
- package/dist/{Accordion-w-w_WxxV.js.map → Accordion-ClK2XpD7.js.map} +1 -1
- package/dist/{Accordion-P3PNqSER.cjs → Accordion-CtvAYNKd.cjs} +2 -2
- package/dist/{Accordion-P3PNqSER.cjs.map → Accordion-CtvAYNKd.cjs.map} +1 -1
- package/dist/AdminRoot-BYkmCGNx.js +57 -0
- package/dist/AdminRoot-BYkmCGNx.js.map +1 -0
- package/dist/AdminRoot-BbkfFQEn.cjs +2 -0
- package/dist/AdminRoot-BbkfFQEn.cjs.map +1 -0
- package/dist/{Alert-CJono1TJ.js → Alert-BLqAcEoT.js} +5 -5
- package/dist/{Alert-CJono1TJ.js.map → Alert-BLqAcEoT.js.map} +1 -1
- package/dist/{Alert-VFQuuII6.cjs → Alert-BM5WOI_u.cjs} +2 -2
- package/dist/{Alert-VFQuuII6.cjs.map → Alert-BM5WOI_u.cjs.map} +1 -1
- package/dist/{AuthLayout-QAtW2GAT.cjs → AuthLayout-DIcR__vo.cjs} +2 -2
- package/dist/{AuthLayout-QAtW2GAT.cjs.map → AuthLayout-DIcR__vo.cjs.map} +1 -1
- package/dist/{AuthLayout-DOFYw_z5.js → AuthLayout-m1BQ6Ixx.js} +2 -2
- package/dist/{AuthLayout-DOFYw_z5.js.map → AuthLayout-m1BQ6Ixx.js.map} +1 -1
- package/dist/{Avatar-DrV_F7Ex.cjs → Avatar-CQ--wGWS.cjs} +2 -2
- package/dist/{Avatar-DrV_F7Ex.cjs.map → Avatar-CQ--wGWS.cjs.map} +1 -1
- package/dist/{Avatar-DXNPg23a.js → Avatar-MwWIcj8z.js} +3 -3
- package/dist/{Avatar-DXNPg23a.js.map → Avatar-MwWIcj8z.js.map} +1 -1
- package/dist/{AvatarGroup-CwlYqDCI.js → AvatarGroup-BxYQo0zZ.js} +2 -2
- package/dist/{AvatarGroup-CwlYqDCI.js.map → AvatarGroup-BxYQo0zZ.js.map} +1 -1
- package/dist/{AvatarGroup-CHesdo-M.cjs → AvatarGroup-Bzu2t6Sd.cjs} +2 -2
- package/dist/{AvatarGroup-CHesdo-M.cjs.map → AvatarGroup-Bzu2t6Sd.cjs.map} +1 -1
- package/dist/{Breadcrumbs-XWU8tRvs.js → Breadcrumbs-CzHGbN2c.js} +5 -5
- package/dist/{Breadcrumbs-XWU8tRvs.js.map → Breadcrumbs-CzHGbN2c.js.map} +1 -1
- package/dist/{Breadcrumbs-DCEHxpSi.cjs → Breadcrumbs-Di4-Acfb.cjs} +2 -2
- package/dist/{Breadcrumbs-DCEHxpSi.cjs.map → Breadcrumbs-Di4-Acfb.cjs.map} +1 -1
- package/dist/{Button-CWMNNiia.js → Button-9Qcdkw-y.js} +2 -2
- package/dist/{Button-CWMNNiia.js.map → Button-9Qcdkw-y.js.map} +1 -1
- package/dist/{Button-CusxDmfq.cjs → Button-BQhiJq8e.cjs} +2 -2
- package/dist/{Button-CusxDmfq.cjs.map → Button-BQhiJq8e.cjs.map} +1 -1
- package/dist/{Calendar-Db3rr1VD.js → Calendar-BB-C0qXO.js} +4 -4
- package/dist/{Calendar-Db3rr1VD.js.map → Calendar-BB-C0qXO.js.map} +1 -1
- package/dist/{Calendar-BEQbZixA.cjs → Calendar-dXhLgOUH.cjs} +2 -2
- package/dist/{Calendar-BEQbZixA.cjs.map → Calendar-dXhLgOUH.cjs.map} +1 -1
- package/dist/Card-BERQfyhJ.js +129 -0
- package/dist/Card-BERQfyhJ.js.map +1 -0
- package/dist/Card-DULpoOfj.cjs +2 -0
- package/dist/Card-DULpoOfj.cjs.map +1 -0
- package/dist/{Chip-D12KcV4_.cjs → Chip-BuydTI6V.cjs} +2 -2
- package/dist/{Chip-D12KcV4_.cjs.map → Chip-BuydTI6V.cjs.map} +1 -1
- package/dist/{Chip-Zh1OB9nV.js → Chip-DZ5Fz7jx.js} +3 -3
- package/dist/{Chip-Zh1OB9nV.js.map → Chip-DZ5Fz7jx.js.map} +1 -1
- package/dist/{ChoiceCardGroup-CEniY_HJ.js → ChoiceCardGroup-BTbKjJdp.js} +3 -3
- package/dist/{ChoiceCardGroup-CEniY_HJ.js.map → ChoiceCardGroup-BTbKjJdp.js.map} +1 -1
- package/dist/{ChoiceCardGroup-BSagRbPI.cjs → ChoiceCardGroup-Bg2jtFpe.cjs} +2 -2
- package/dist/{ChoiceCardGroup-BSagRbPI.cjs.map → ChoiceCardGroup-Bg2jtFpe.cjs.map} +1 -1
- package/dist/{CodeBlock-DAM7BkHK.cjs → CodeBlock-BPraYPoS.cjs} +2 -2
- package/dist/{CodeBlock-DAM7BkHK.cjs.map → CodeBlock-BPraYPoS.cjs.map} +1 -1
- package/dist/{CodeBlock-CkrTnpcj.js → CodeBlock-BySsTAtY.js} +5 -5
- package/dist/{CodeBlock-CkrTnpcj.js.map → CodeBlock-BySsTAtY.js.map} +1 -1
- package/dist/{ColorPicker-BcCozxIe.cjs → ColorPicker-BTBTQD39.cjs} +2 -2
- package/dist/{ColorPicker-BcCozxIe.cjs.map → ColorPicker-BTBTQD39.cjs.map} +1 -1
- package/dist/{ColorPicker-DqxVgUoD.js → ColorPicker-DJow7m2v.js} +4 -4
- package/dist/{ColorPicker-DqxVgUoD.js.map → ColorPicker-DJow7m2v.js.map} +1 -1
- package/dist/{ColorPickerPanel-DZjN8NNn.js → ColorPickerPanel-D6agWM6y.js} +3 -3
- package/dist/{ColorPickerPanel-DZjN8NNn.js.map → ColorPickerPanel-D6agWM6y.js.map} +1 -1
- package/dist/{ColorPickerPanel-DAOESLCe.cjs → ColorPickerPanel-DXIYwUoE.cjs} +2 -2
- package/dist/{ColorPickerPanel-DAOESLCe.cjs.map → ColorPickerPanel-DXIYwUoE.cjs.map} +1 -1
- package/dist/{ColorRamp-_KwlPQ-T.cjs → ColorRamp-B45Rtwgw.cjs} +2 -2
- package/dist/{ColorRamp-_KwlPQ-T.cjs.map → ColorRamp-B45Rtwgw.cjs.map} +1 -1
- package/dist/{ColorRamp-DS5LVpRF.js → ColorRamp-Bhj28c_6.js} +3 -3
- package/dist/{ColorRamp-DS5LVpRF.js.map → ColorRamp-Bhj28c_6.js.map} +1 -1
- package/dist/ConfigProvider-Ct0Pe3Ku.js +335 -0
- package/dist/ConfigProvider-Ct0Pe3Ku.js.map +1 -0
- package/dist/ConfigProvider-CtpfSy1i.cjs +2 -0
- package/dist/ConfigProvider-CtpfSy1i.cjs.map +1 -0
- package/dist/{CopyButton-SFwjKod9.cjs → CopyButton-Bfte6TJF.cjs} +2 -2
- package/dist/{CopyButton-SFwjKod9.cjs.map → CopyButton-Bfte6TJF.cjs.map} +1 -1
- package/dist/{CopyButton-D4s8aeSE.js → CopyButton-CBk85MQ7.js} +5 -5
- package/dist/{CopyButton-D4s8aeSE.js.map → CopyButton-CBk85MQ7.js.map} +1 -1
- package/dist/{DashedButton-iM7kzopW.js → DashedButton-BpiG8rab.js} +3 -3
- package/dist/{DashedButton-iM7kzopW.js.map → DashedButton-BpiG8rab.js.map} +1 -1
- package/dist/{DashedButton-B7xodc3N.cjs → DashedButton-DZmgxLMO.cjs} +2 -2
- package/dist/{DashedButton-B7xodc3N.cjs.map → DashedButton-DZmgxLMO.cjs.map} +1 -1
- package/dist/{DatePicker-ENbn2Vab.cjs → DatePicker-DBiU4Mb6.cjs} +2 -2
- package/dist/{DatePicker-ENbn2Vab.cjs.map → DatePicker-DBiU4Mb6.cjs.map} +1 -1
- package/dist/{DatePicker-DGwjCHfd.js → DatePicker-eAzDnO2Y.js} +6 -6
- package/dist/{DatePicker-DGwjCHfd.js.map → DatePicker-eAzDnO2Y.js.map} +1 -1
- package/dist/{DateTimePicker-BQUmsFwX.cjs → DateTimePicker-CvaD8IkF.cjs} +2 -2
- package/dist/{DateTimePicker-BQUmsFwX.cjs.map → DateTimePicker-CvaD8IkF.cjs.map} +1 -1
- package/dist/{DateTimePicker-CwVkQiun.js → DateTimePicker-M2UBjFVc.js} +9 -9
- package/dist/{DateTimePicker-CwVkQiun.js.map → DateTimePicker-M2UBjFVc.js.map} +1 -1
- package/dist/{DescriptionList-0qjKr6GN.js → DescriptionList-BhsmdtS1.js} +64 -64
- package/dist/{DescriptionList-0qjKr6GN.js.map → DescriptionList-BhsmdtS1.js.map} +1 -1
- package/dist/DescriptionList-DQHNOTWl.cjs +2 -0
- package/dist/{DescriptionList-U5z2Faf4.cjs.map → DescriptionList-DQHNOTWl.cjs.map} +1 -1
- package/dist/{Dropdown-DNZ9S_zQ.cjs → Dropdown-BbaU1WDC.cjs} +2 -2
- package/dist/{Dropdown-DNZ9S_zQ.cjs.map → Dropdown-BbaU1WDC.cjs.map} +1 -1
- package/dist/{Dropdown--1mNTVZJ.js → Dropdown-BlmbYp1X.js} +2 -2
- package/dist/{Dropdown--1mNTVZJ.js.map → Dropdown-BlmbYp1X.js.map} +1 -1
- package/dist/{EmptyState-DwT9_HW7.js → EmptyState-2pA3XlOX.js} +4 -4
- package/dist/{EmptyState-DwT9_HW7.js.map → EmptyState-2pA3XlOX.js.map} +1 -1
- package/dist/{EmptyState-B2_4BN4l.cjs → EmptyState-ByBpy2vN.cjs} +2 -2
- package/dist/{EmptyState-B2_4BN4l.cjs.map → EmptyState-ByBpy2vN.cjs.map} +1 -1
- package/dist/{ErrorBoundary-CsDHKYB4.js → ErrorBoundary-B-37hGZW.js} +6 -6
- package/dist/{ErrorBoundary-CsDHKYB4.js.map → ErrorBoundary-B-37hGZW.js.map} +1 -1
- package/dist/{ErrorBoundary-CYSOAQlB.cjs → ErrorBoundary-gRGxeuM1.cjs} +2 -2
- package/dist/{ErrorBoundary-CYSOAQlB.cjs.map → ErrorBoundary-gRGxeuM1.cjs.map} +1 -1
- package/dist/{FileCard-B9f9RoXS.js → FileCard-BNfUAgsF.js} +5 -5
- package/dist/{FileCard-B9f9RoXS.js.map → FileCard-BNfUAgsF.js.map} +1 -1
- package/dist/{FileCard-zuUYik-F.cjs → FileCard-BYNJVmp0.cjs} +2 -2
- package/dist/{FileCard-zuUYik-F.cjs.map → FileCard-BYNJVmp0.cjs.map} +1 -1
- package/dist/{FileUploader-Y8hiyIpp.cjs → FileUploader-DdICa5UC.cjs} +2 -2
- package/dist/{FileUploader-Y8hiyIpp.cjs.map → FileUploader-DdICa5UC.cjs.map} +1 -1
- package/dist/{FileUploader-Dh2zA50t.js → FileUploader-TOWwDOSS.js} +6 -6
- package/dist/{FileUploader-Dh2zA50t.js.map → FileUploader-TOWwDOSS.js.map} +1 -1
- package/dist/{Flag-CmDXvd7j.js → Flag-DDR6OANA.js} +2 -2
- package/dist/{Flag-CmDXvd7j.js.map → Flag-DDR6OANA.js.map} +1 -1
- package/dist/{Flag-BpTQAgbD.cjs → Flag-DXPQ2t8z.cjs} +2 -2
- package/dist/{Flag-BpTQAgbD.cjs.map → Flag-DXPQ2t8z.cjs.map} +1 -1
- package/dist/FloatingPanel-C5c_eMQ0.js +135 -0
- package/dist/{FloatingPanel-CeSOtE_D.js.map → FloatingPanel-C5c_eMQ0.js.map} +1 -1
- package/dist/FloatingPanel-tGCG2nhA.cjs +2 -0
- package/dist/{FloatingPanel-BIC4WrFa.cjs.map → FloatingPanel-tGCG2nhA.cjs.map} +1 -1
- package/dist/{FullscreenToggle-CeGgw3z1.cjs → FullscreenToggle-BKo1lDSE.cjs} +2 -2
- package/dist/{FullscreenToggle-CeGgw3z1.cjs.map → FullscreenToggle-BKo1lDSE.cjs.map} +1 -1
- package/dist/{FullscreenToggle-2IYIS5KF.js → FullscreenToggle-DmH1541W.js} +4 -4
- package/dist/{FullscreenToggle-2IYIS5KF.js.map → FullscreenToggle-DmH1541W.js.map} +1 -1
- package/dist/Icon-BUP5_kRs.cjs +2 -0
- package/dist/Icon-BUP5_kRs.cjs.map +1 -0
- package/dist/{Icon-DaTvzLBu.js → Icon-CGQ5yGSZ.js} +4 -3
- package/dist/Icon-CGQ5yGSZ.js.map +1 -0
- package/dist/{IconButton-GU3Ud4Zg.js → IconButton-CL_6iMQh.js} +2 -2
- package/dist/{IconButton-GU3Ud4Zg.js.map → IconButton-CL_6iMQh.js.map} +1 -1
- package/dist/{IconButton-BNa0yLcv.cjs → IconButton-CvIXSFsr.cjs} +2 -2
- package/dist/{IconButton-BNa0yLcv.cjs.map → IconButton-CvIXSFsr.cjs.map} +1 -1
- package/dist/{List-CZwNGxuP.js → List-BLPB3-B8.js} +3 -3
- package/dist/{List-CZwNGxuP.js.map → List-BLPB3-B8.js.map} +1 -1
- package/dist/{List-9lUjapQ5.cjs → List-ah2PNWeY.cjs} +2 -2
- package/dist/{List-9lUjapQ5.cjs.map → List-ah2PNWeY.cjs.map} +1 -1
- package/dist/{Loader-Cpr9-OOZ.cjs → Loader-CI1j71X8.cjs} +2 -2
- package/dist/{Loader-Cpr9-OOZ.cjs.map → Loader-CI1j71X8.cjs.map} +1 -1
- package/dist/{Loader-C1uaCtx6.js → Loader-Czzb450N.js} +2 -2
- package/dist/{Loader-C1uaCtx6.js.map → Loader-Czzb450N.js.map} +1 -1
- package/dist/{Modal-DHP2R3K3.js → Modal-DMJMw6kT.js} +5 -5
- package/dist/{Modal-DHP2R3K3.js.map → Modal-DMJMw6kT.js.map} +1 -1
- package/dist/{Modal-DFeBHv-Q.cjs → Modal-DPObz0b-.cjs} +2 -2
- package/dist/{Modal-DFeBHv-Q.cjs.map → Modal-DPObz0b-.cjs.map} +1 -1
- package/dist/{MultiSelect-B-FPQ08c.js → MultiSelect-BTR6w5Ot.js} +5 -5
- package/dist/{MultiSelect-B-FPQ08c.js.map → MultiSelect-BTR6w5Ot.js.map} +1 -1
- package/dist/{MultiSelect-S5VG9g3l.cjs → MultiSelect-IDAJ5a5K.cjs} +2 -2
- package/dist/{MultiSelect-S5VG9g3l.cjs.map → MultiSelect-IDAJ5a5K.cjs.map} +1 -1
- package/dist/{NumberField-SSGXlF8U.cjs → NumberField-Cg0XEDgW.cjs} +2 -2
- package/dist/{NumberField-SSGXlF8U.cjs.map → NumberField-Cg0XEDgW.cjs.map} +1 -1
- package/dist/{NumberField-CzyvDMRV.js → NumberField-DlaW-g3Z.js} +4 -4
- package/dist/{NumberField-CzyvDMRV.js.map → NumberField-DlaW-g3Z.js.map} +1 -1
- package/dist/{OtpField-Pr7Ch0El.cjs → OtpField-DsedK1nQ.cjs} +2 -2
- package/dist/{OtpField-Pr7Ch0El.cjs.map → OtpField-DsedK1nQ.cjs.map} +1 -1
- package/dist/{OtpField-CMoJqcx1.js → OtpField-vxQuo-uR.js} +2 -2
- package/dist/{OtpField-CMoJqcx1.js.map → OtpField-vxQuo-uR.js.map} +1 -1
- package/dist/{PageLayout-BIMkjq-q.cjs → PageLayout-BPbjTYS3.cjs} +2 -2
- package/dist/{PageLayout-BIMkjq-q.cjs.map → PageLayout-BPbjTYS3.cjs.map} +1 -1
- package/dist/{PageLayout-Ctr-IEzX.js → PageLayout-Rk6KSxmn.js} +2 -2
- package/dist/{PageLayout-Ctr-IEzX.js.map → PageLayout-Rk6KSxmn.js.map} +1 -1
- package/dist/{PageNotFound-KKJTeaRF.js → PageNotFound-CBNhKZ9Y.js} +5 -5
- package/dist/{PageNotFound-KKJTeaRF.js.map → PageNotFound-CBNhKZ9Y.js.map} +1 -1
- package/dist/{PageNotFound-CnhBheI4.cjs → PageNotFound-PUQ1o9R4.cjs} +2 -2
- package/dist/{PageNotFound-CnhBheI4.cjs.map → PageNotFound-PUQ1o9R4.cjs.map} +1 -1
- package/dist/{Pagination-Oyms2ERd.js → Pagination-CNdkfXp2.js} +3 -3
- package/dist/{Pagination-Oyms2ERd.js.map → Pagination-CNdkfXp2.js.map} +1 -1
- package/dist/{Pagination-BD5WOW98.cjs → Pagination-DNGKNQy0.cjs} +2 -2
- package/dist/{Pagination-BD5WOW98.cjs.map → Pagination-DNGKNQy0.cjs.map} +1 -1
- package/dist/{PaletteField-CCQGW5LC.cjs → PaletteField-BSIF5jI6.cjs} +2 -2
- package/dist/{PaletteField-CCQGW5LC.cjs.map → PaletteField-BSIF5jI6.cjs.map} +1 -1
- package/dist/{PaletteField-BHzzzdou.js → PaletteField-Bp5Fgygh.js} +3 -3
- package/dist/{PaletteField-BHzzzdou.js.map → PaletteField-Bp5Fgygh.js.map} +1 -1
- package/dist/{PhoneField-5zGY4Wko.cjs → PhoneField-BMhZeZkW.cjs} +2 -2
- package/dist/{PhoneField-5zGY4Wko.cjs.map → PhoneField-BMhZeZkW.cjs.map} +1 -1
- package/dist/{PhoneField-CBfmChPx.js → PhoneField-BdmvslXQ.js} +5 -5
- package/dist/{PhoneField-CBfmChPx.js.map → PhoneField-BdmvslXQ.js.map} +1 -1
- package/dist/{Popconfirm-BtGDhqrc.js → Popconfirm-Cyaeybtj.js} +6 -6
- package/dist/{Popconfirm-BtGDhqrc.js.map → Popconfirm-Cyaeybtj.js.map} +1 -1
- package/dist/{Popconfirm-CkBdntxV.cjs → Popconfirm-IhlIINtZ.cjs} +2 -2
- package/dist/{Popconfirm-CkBdntxV.cjs.map → Popconfirm-IhlIINtZ.cjs.map} +1 -1
- package/dist/{Popover-DAT6DcM9.cjs → Popover-DsYUT23r.cjs} +2 -2
- package/dist/{Popover-DAT6DcM9.cjs.map → Popover-DsYUT23r.cjs.map} +1 -1
- package/dist/{Popover-B82Id9Ut.js → Popover-WaVH3jsN.js} +2 -2
- package/dist/{Popover-B82Id9Ut.js.map → Popover-WaVH3jsN.js.map} +1 -1
- package/dist/{Progress-Bwxx71Ns.cjs → Progress-CAY1p06_.cjs} +2 -2
- package/dist/{Progress-Bwxx71Ns.cjs.map → Progress-CAY1p06_.cjs.map} +1 -1
- package/dist/{Progress-pTbaOSDd.js → Progress-T7PLrJ0Y.js} +2 -2
- package/dist/{Progress-pTbaOSDd.js.map → Progress-T7PLrJ0Y.js.map} +1 -1
- package/dist/{QueryError-C01oichG.cjs → QueryError-DP22IUnp.cjs} +2 -2
- package/dist/{QueryError-C01oichG.cjs.map → QueryError-DP22IUnp.cjs.map} +1 -1
- package/dist/{QueryError-Bu_MNGek.js → QueryError-Dtspj9l4.js} +2 -2
- package/dist/{QueryError-Bu_MNGek.js.map → QueryError-Dtspj9l4.js.map} +1 -1
- package/dist/RadioGroup-CTAayuMv.js +142 -0
- package/dist/RadioGroup-CTAayuMv.js.map +1 -0
- package/dist/RadioGroup-CvC2yc4p.cjs +2 -0
- package/dist/RadioGroup-CvC2yc4p.cjs.map +1 -0
- package/dist/{RemoveDialog-Bm2mJB3l.cjs → RemoveDialog-D12B4x80.cjs} +2 -2
- package/dist/{RemoveDialog-Bm2mJB3l.cjs.map → RemoveDialog-D12B4x80.cjs.map} +1 -1
- package/dist/{RemoveDialog-C2uJzWi-.js → RemoveDialog-DdGsqaWV.js} +6 -6
- package/dist/{RemoveDialog-C2uJzWi-.js.map → RemoveDialog-DdGsqaWV.js.map} +1 -1
- package/dist/RichTextEditor-BVXY25sz.cjs +2 -0
- package/dist/RichTextEditor-BVXY25sz.cjs.map +1 -0
- package/dist/RichTextEditor-DL4y5xVv.js +916 -0
- package/dist/RichTextEditor-DL4y5xVv.js.map +1 -0
- package/dist/RootLayout-BK3t6Mm0.js +604 -0
- package/dist/RootLayout-BK3t6Mm0.js.map +1 -0
- package/dist/RootLayout-DDuzPlJe.cjs +2 -0
- package/dist/RootLayout-DDuzPlJe.cjs.map +1 -0
- package/dist/{Select-CVVJKAtS.cjs → Select-DlFDOZtn.cjs} +2 -2
- package/dist/{Select-CVVJKAtS.cjs.map → Select-DlFDOZtn.cjs.map} +1 -1
- package/dist/{Select-d9LDI8O3.js → Select-tVI_qer3.js} +5 -5
- package/dist/{Select-d9LDI8O3.js.map → Select-tVI_qer3.js.map} +1 -1
- package/dist/{Sidebar-BgCfnZBF.js → Sidebar-CjrD3nNp.js} +7 -6
- package/dist/Sidebar-CjrD3nNp.js.map +1 -0
- package/dist/Sidebar-gB-X4VLX.cjs +2 -0
- package/dist/Sidebar-gB-X4VLX.cjs.map +1 -0
- package/dist/{SpeedDial-CEr2JWQb.cjs → SpeedDial-BIOkkLKO.cjs} +2 -2
- package/dist/{SpeedDial-CEr2JWQb.cjs.map → SpeedDial-BIOkkLKO.cjs.map} +1 -1
- package/dist/{SpeedDial-CBVwgnFp.js → SpeedDial-xQr4JH0x.js} +5 -5
- package/dist/{SpeedDial-CBVwgnFp.js.map → SpeedDial-xQr4JH0x.js.map} +1 -1
- package/dist/Stepper-CBdhvPoz.cjs +2 -0
- package/dist/Stepper-CBdhvPoz.cjs.map +1 -0
- package/dist/Stepper-CkYcIc15.js +169 -0
- package/dist/Stepper-CkYcIc15.js.map +1 -0
- package/dist/{SwatchPicker-Bpxk0IOe.js → SwatchPicker-BAKslSY4.js} +2 -2
- package/dist/{SwatchPicker-Bpxk0IOe.js.map → SwatchPicker-BAKslSY4.js.map} +1 -1
- package/dist/{SwatchPicker-BWXqgsEy.cjs → SwatchPicker-CpwVq0xp.cjs} +2 -2
- package/dist/{SwatchPicker-BWXqgsEy.cjs.map → SwatchPicker-CpwVq0xp.cjs.map} +1 -1
- package/dist/Table-CwQKfXGn.js +1210 -0
- package/dist/Table-CwQKfXGn.js.map +1 -0
- package/dist/Table-Cwxqo7Br.cjs +2 -0
- package/dist/Table-Cwxqo7Br.cjs.map +1 -0
- package/dist/Tabs-651xbRe4.cjs +2 -0
- package/dist/Tabs-651xbRe4.cjs.map +1 -0
- package/dist/Tabs-Bztnezt9.js +194 -0
- package/dist/Tabs-Bztnezt9.js.map +1 -0
- package/dist/{TagsField-DcuSn7wL.cjs → TagsField-B7ZARHzD.cjs} +2 -2
- package/dist/{TagsField-DcuSn7wL.cjs.map → TagsField-B7ZARHzD.cjs.map} +1 -1
- package/dist/{TagsField-DuQEFHZ3.js → TagsField-CdymON69.js} +5 -5
- package/dist/{TagsField-DuQEFHZ3.js.map → TagsField-CdymON69.js.map} +1 -1
- package/dist/{TextField-E85pvJQC.cjs → TextField-B22NRQ91.cjs} +2 -2
- package/dist/{TextField-E85pvJQC.cjs.map → TextField-B22NRQ91.cjs.map} +1 -1
- package/dist/{TextField-SGYWviFf.js → TextField-DkaYK1DI.js} +4 -4
- package/dist/{TextField-SGYWviFf.js.map → TextField-DkaYK1DI.js.map} +1 -1
- package/dist/{ThemeToggle-BdlxzYNt.cjs → ThemeToggle-D5dWHQFb.cjs} +2 -2
- package/dist/{ThemeToggle-BdlxzYNt.cjs.map → ThemeToggle-D5dWHQFb.cjs.map} +1 -1
- package/dist/{ThemeToggle-C2kjFrD_.js → ThemeToggle-DqzUvcK5.js} +4 -4
- package/dist/{ThemeToggle-C2kjFrD_.js.map → ThemeToggle-DqzUvcK5.js.map} +1 -1
- package/dist/{TimeColumns-BS1d0qOp.js → TimeColumns-BEoHh961.js} +2 -2
- package/dist/{TimeColumns-BS1d0qOp.js.map → TimeColumns-BEoHh961.js.map} +1 -1
- package/dist/{TimeColumns-D7-O4Qyt.cjs → TimeColumns-o2xhvSGE.cjs} +2 -2
- package/dist/{TimeColumns-D7-O4Qyt.cjs.map → TimeColumns-o2xhvSGE.cjs.map} +1 -1
- package/dist/{TimePicker-Dzb3gycP.cjs → TimePicker-CACmHwNn.cjs} +2 -2
- package/dist/{TimePicker-Dzb3gycP.cjs.map → TimePicker-CACmHwNn.cjs.map} +1 -1
- package/dist/{TimePicker-DlzYNDN1.js → TimePicker-DCryZCmh.js} +7 -7
- package/dist/{TimePicker-DlzYNDN1.js.map → TimePicker-DCryZCmh.js.map} +1 -1
- package/dist/{Timeline-CKEosWka.cjs → Timeline-CMP93APm.cjs} +2 -2
- package/dist/{Timeline-CKEosWka.cjs.map → Timeline-CMP93APm.cjs.map} +1 -1
- package/dist/{Timeline-ufVXmpMY.js → Timeline-Dri2dPsK.js} +3 -3
- package/dist/{Timeline-ufVXmpMY.js.map → Timeline-Dri2dPsK.js.map} +1 -1
- package/dist/{Toaster-Cummylmj.cjs → Toaster-BwREV06e.cjs} +2 -2
- package/dist/{Toaster-Cummylmj.cjs.map → Toaster-BwREV06e.cjs.map} +1 -1
- package/dist/{Toaster-cu5XyKeE.js → Toaster-DwVLab3k.js} +2 -2
- package/dist/{Toaster-cu5XyKeE.js.map → Toaster-DwVLab3k.js.map} +1 -1
- package/dist/{ToggleButtonGroup-D9odYMzD.js → ToggleButtonGroup-BtVDnQIF.js} +3 -3
- package/dist/{ToggleButtonGroup-D9odYMzD.js.map → ToggleButtonGroup-BtVDnQIF.js.map} +1 -1
- package/dist/{ToggleButtonGroup-M2oj_3mc.cjs → ToggleButtonGroup-UylpGJ16.cjs} +2 -2
- package/dist/{ToggleButtonGroup-M2oj_3mc.cjs.map → ToggleButtonGroup-UylpGJ16.cjs.map} +1 -1
- package/dist/Tooltip-Bw-1Xk2Z.cjs +2 -0
- package/dist/Tooltip-Bw-1Xk2Z.cjs.map +1 -0
- package/dist/Tooltip-DsDv4NOq.js +135 -0
- package/dist/Tooltip-DsDv4NOq.js.map +1 -0
- package/dist/{TranslatedFields-Ccjhq2YL.js → TranslatedFields-B0LMXgiu.js} +5 -5
- package/dist/{TranslatedFields-Ccjhq2YL.js.map → TranslatedFields-B0LMXgiu.js.map} +1 -1
- package/dist/{TranslatedFields-CbTlgKnh.cjs → TranslatedFields-sio1Qfy7.cjs} +2 -2
- package/dist/{TranslatedFields-CbTlgKnh.cjs.map → TranslatedFields-sio1Qfy7.cjs.map} +1 -1
- package/dist/{UserCard-Bs8kuV2j.js → UserCard-B5FVcJaK.js} +5 -5
- package/dist/{UserCard-Bs8kuV2j.js.map → UserCard-B5FVcJaK.js.map} +1 -1
- package/dist/{UserCard-BfHHfkDr.cjs → UserCard-Dzc4zmPj.cjs} +2 -2
- package/dist/{UserCard-BfHHfkDr.cjs.map → UserCard-Dzc4zmPj.cjs.map} +1 -1
- package/dist/app/AdminRoot.d.cts +7 -2
- package/dist/app/AdminRoot.d.ts +7 -2
- package/dist/components/Accordion/index.cjs +1 -1
- package/dist/components/Accordion/index.js +1 -1
- package/dist/components/Alert/index.cjs +1 -1
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/AuthLayout/index.cjs +1 -1
- package/dist/components/AuthLayout/index.js +1 -1
- package/dist/components/Avatar/index.cjs +1 -1
- package/dist/components/Avatar/index.js +2 -2
- 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 +9 -1
- package/dist/components/Card/Card.d.ts +9 -1
- package/dist/components/Card/index.cjs +1 -1
- package/dist/components/Card/index.js +1 -1
- package/dist/components/Chip/index.cjs +1 -1
- package/dist/components/Chip/index.js +1 -1
- package/dist/components/ChoiceCard/index.cjs +1 -1
- package/dist/components/ChoiceCard/index.js +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/DashedButton/index.cjs +1 -1
- package/dist/components/DashedButton/index.js +1 -1
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/DateTimePicker/index.cjs +1 -1
- package/dist/components/DateTimePicker/index.js +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/index.cjs +1 -1
- package/dist/components/FileCard/index.js +1 -1
- 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/FullscreenToggle/index.cjs +1 -1
- package/dist/components/FullscreenToggle/index.js +1 -1
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.js +2 -2
- 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 +1 -1
- package/dist/components/Loader/index.cjs +1 -1
- package/dist/components/Loader/index.js +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/index.cjs +1 -1
- package/dist/components/OtpField/index.js +1 -1
- 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/index.cjs +1 -1
- package/dist/components/Popover/index.js +1 -1
- package/dist/components/Progress/index.cjs +1 -1
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/Radio/RadioGroup.d.cts +1 -1
- package/dist/components/Radio/RadioGroup.d.ts +1 -1
- package/dist/components/Radio/index.cjs +1 -1
- package/dist/components/Radio/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 +16 -1
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +16 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RootLayout/RootLayout.d.cts +8 -1
- package/dist/components/RootLayout/RootLayout.d.ts +8 -1
- package/dist/components/RootLayout/SettingsDrawer.d.cts +4 -1
- package/dist/components/RootLayout/SettingsDrawer.d.ts +4 -1
- 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/Sidebar.d.cts +2 -0
- package/dist/components/Sidebar/Sidebar.d.ts +2 -0
- package/dist/components/Sidebar/index.cjs +1 -1
- package/dist/components/Sidebar/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 +8 -1
- package/dist/components/Stepper/Stepper.d.ts +8 -1
- package/dist/components/Stepper/index.cjs +1 -1
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/SwatchPicker/index.cjs +1 -1
- package/dist/components/SwatchPicker/index.js +1 -1
- package/dist/components/Table/Table.d.cts +20 -3
- package/dist/components/Table/Table.d.ts +20 -3
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Table/tableFilter.d.cts +12 -2
- package/dist/components/Table/tableFilter.d.ts +12 -2
- package/dist/components/Tabs/Tabs.d.cts +8 -1
- package/dist/components/Tabs/Tabs.d.ts +8 -1
- package/dist/components/Tabs/index.cjs +1 -1
- package/dist/components/Tabs/index.js +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/Timeline/index.cjs +1 -1
- package/dist/components/Timeline/index.js +1 -1
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/ToggleButton/index.cjs +1 -1
- package/dist/components/ToggleButton/index.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.cts +10 -3
- package/dist/components/Tooltip/Tooltip.d.ts +10 -3
- package/dist/components/Tooltip/index.cjs +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/TranslatedFields/index.cjs +1 -1
- package/dist/components/TranslatedFields/index.js +1 -1
- 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 +64 -64
- package/dist/entries/hooks.cjs +1 -1
- package/dist/entries/hooks.d.cts +2 -0
- package/dist/entries/hooks.d.ts +2 -0
- package/dist/entries/hooks.js +9 -8
- package/dist/entries/i18n.cjs +1 -1
- package/dist/entries/i18n.js +2 -2
- package/dist/entries/icons.cjs +1 -1
- package/dist/entries/icons.js +2 -2
- package/dist/entries/theme.cjs +1 -1
- package/dist/entries/theme.d.cts +1 -1
- package/dist/entries/theme.d.ts +1 -1
- package/dist/entries/theme.js +1 -1
- package/dist/hooks/index.d.cts +2 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useClearUrlOnUnmount.d.cts +19 -0
- package/dist/hooks/useClearUrlOnUnmount.d.ts +19 -0
- package/dist/hooks/useQueryModal.d.cts +40 -0
- package/dist/hooks/useQueryModal.d.ts +40 -0
- package/dist/i18n/messages.d.cts +12 -0
- package/dist/i18n/messages.d.ts +12 -0
- package/dist/icons/names.d.cts +3 -3
- package/dist/icons/names.d.ts +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +251 -250
- package/dist/{messages-FiUqCKjJ.cjs → messages-DS38X5W2.cjs} +9 -9
- package/dist/messages-DS38X5W2.cjs.map +1 -0
- package/dist/{messages-DCefu6Pn.js → messages-DswDgGe2.js} +52 -10
- package/dist/messages-DswDgGe2.js.map +1 -0
- package/dist/{names-r21QPjcU.js → names-BR1uJs0-.js} +5 -4
- package/dist/names-BR1uJs0-.js.map +1 -0
- package/dist/names-YOCJ4B5J.cjs +2 -0
- package/dist/names-YOCJ4B5J.cjs.map +1 -0
- package/dist/theme/ConfigProvider.d.cts +48 -0
- package/dist/theme/ConfigProvider.d.ts +48 -0
- package/dist/theme/index.d.cts +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/useClearUrlOnUnmount-Cg7v2y5B.cjs +2 -0
- package/dist/useClearUrlOnUnmount-Cg7v2y5B.cjs.map +1 -0
- package/dist/useClearUrlOnUnmount-DOeh6CUN.js +37 -0
- package/dist/useClearUrlOnUnmount-DOeh6CUN.js.map +1 -0
- package/dist/useForm-CGbJ44Gp.js +194 -0
- package/dist/useForm-CGbJ44Gp.js.map +1 -0
- package/dist/useForm-CSw6r1n1.cjs +2 -0
- package/dist/useForm-CSw6r1n1.cjs.map +1 -0
- package/dist/{useOptionMenu-BoWyPgbY.cjs → useOptionMenu-BYeSUee6.cjs} +2 -2
- package/dist/{useOptionMenu-BoWyPgbY.cjs.map → useOptionMenu-BYeSUee6.cjs.map} +1 -1
- package/dist/{useOptionMenu-D7EbYG9A.js → useOptionMenu-DtTvY9EC.js} +6 -6
- package/dist/{useOptionMenu-D7EbYG9A.js.map → useOptionMenu-DtTvY9EC.js.map} +1 -1
- package/package.json +1 -1
- package/dist/AdminRoot-9HGp3Mds.js +0 -55
- package/dist/AdminRoot-9HGp3Mds.js.map +0 -1
- package/dist/AdminRoot-D24UJ-4a.cjs +0 -2
- package/dist/AdminRoot-D24UJ-4a.cjs.map +0 -1
- package/dist/Card-CUUh4mlB.cjs +0 -2
- package/dist/Card-CUUh4mlB.cjs.map +0 -1
- package/dist/Card-MxYfQTOY.js +0 -121
- package/dist/Card-MxYfQTOY.js.map +0 -1
- package/dist/ConfigProvider-BbsI15b-.js +0 -320
- package/dist/ConfigProvider-BbsI15b-.js.map +0 -1
- package/dist/ConfigProvider-ByLHqXpv.cjs +0 -2
- package/dist/ConfigProvider-ByLHqXpv.cjs.map +0 -1
- package/dist/DescriptionList-U5z2Faf4.cjs +0 -2
- package/dist/FloatingPanel-BIC4WrFa.cjs +0 -2
- package/dist/FloatingPanel-CeSOtE_D.js +0 -135
- package/dist/Icon-BVULqOJD.cjs +0 -2
- package/dist/Icon-BVULqOJD.cjs.map +0 -1
- package/dist/Icon-DaTvzLBu.js.map +0 -1
- package/dist/RadioGroup-BcFBdFhh.cjs +0 -2
- package/dist/RadioGroup-BcFBdFhh.cjs.map +0 -1
- package/dist/RadioGroup-dVx_hMCY.js +0 -141
- package/dist/RadioGroup-dVx_hMCY.js.map +0 -1
- package/dist/RichTextEditor-BDAWmQrN.js +0 -806
- package/dist/RichTextEditor-BDAWmQrN.js.map +0 -1
- package/dist/RichTextEditor-D4HpPT3C.cjs +0 -2
- package/dist/RichTextEditor-D4HpPT3C.cjs.map +0 -1
- package/dist/RootLayout-CxncyjCz.js +0 -515
- package/dist/RootLayout-CxncyjCz.js.map +0 -1
- package/dist/RootLayout-XEcU_MBs.cjs +0 -2
- package/dist/RootLayout-XEcU_MBs.cjs.map +0 -1
- package/dist/Sidebar-B8ecHwZr.cjs +0 -2
- package/dist/Sidebar-B8ecHwZr.cjs.map +0 -1
- package/dist/Sidebar-BgCfnZBF.js.map +0 -1
- package/dist/Stepper-DOSc03YV.cjs +0 -2
- package/dist/Stepper-DOSc03YV.cjs.map +0 -1
- package/dist/Stepper-DtYamv1q.js +0 -165
- package/dist/Stepper-DtYamv1q.js.map +0 -1
- package/dist/Table-AzNzUAkl.js +0 -1170
- package/dist/Table-AzNzUAkl.js.map +0 -1
- package/dist/Table-CrpWhZUg.cjs +0 -2
- package/dist/Table-CrpWhZUg.cjs.map +0 -1
- package/dist/Tabs-CMnLXRjA.cjs +0 -2
- package/dist/Tabs-CMnLXRjA.cjs.map +0 -1
- package/dist/Tabs-D1RGhKsa.js +0 -190
- package/dist/Tabs-D1RGhKsa.js.map +0 -1
- package/dist/Tooltip-Ao7az09p.cjs +0 -2
- package/dist/Tooltip-Ao7az09p.cjs.map +0 -1
- package/dist/Tooltip-Cb_FKxT9.js +0 -65
- package/dist/Tooltip-Cb_FKxT9.js.map +0 -1
- package/dist/messages-DCefu6Pn.js.map +0 -1
- package/dist/messages-FiUqCKjJ.cjs.map +0 -1
- package/dist/names-BJnFU_5m.cjs +0 -2
- package/dist/names-BJnFU_5m.cjs.map +0 -1
- package/dist/names-r21QPjcU.js.map +0 -1
- package/dist/useForm-CN-qCrP7.js +0 -144
- package/dist/useForm-CN-qCrP7.js.map +0 -1
- package/dist/useForm-WvV361y6.cjs +0 -2
- package/dist/useForm-WvV361y6.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popconfirm-CkBdntxV.cjs","sources":["../src/components/Popconfirm/Popconfirm.tsx"],"sourcesContent":["import {\n cloneElement,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type MouseEvent as ReactMouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { Button } from '../Button'\nimport { FloatingPanel } from '../FloatingPanel/FloatingPanel'\nimport { Icon } from '../Icon'\nimport type { PopoverAlign } from '../Popover'\nimport styles from './Popconfirm.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface PopconfirmProps {\n /** The question — \"Delete this item?\". Labels the dialog. */\n title: ReactNode\n /** Optional muted line under the title (the consequence). Describes the dialog. */\n description?: ReactNode\n /**\n * Runs on confirm. Return a Promise to keep the popover open with the confirm button **loading** until\n * it settles — it closes on success and **stays open on rejection** (show your own toast).\n */\n // `unknown` (not `void | Promise`) so `() => toast.success(…)` — which returns an id — still fits\n onConfirm: () => unknown\n /** Runs on Cancel, `Escape` or an outside click. */\n onCancel?: () => void\n /** Confirm button label. Defaults to the localized \"Confirm\". */\n confirmLabel?: ReactNode\n /** Cancel button label. Defaults to the localized \"Cancel\". */\n cancelLabel?: ReactNode\n /** Tints the confirm button and the icon. Defaults to `error` (a destructive action). */\n color?: ThemeColor\n /** Leading icon — a known `IconName`, any node, or `false`. Defaults to `Danger` in the `color`. */\n icon?: IconName | ReactNode | false\n /** Horizontal alignment to the trigger (`start` default, `end` for a trigger near the right edge). */\n align?: PopoverAlign\n /** Controlled open state. */\n open?: boolean\n /** Fires with the next open state. */\n onOpenChange?: (open: boolean) => void\n /** Clicking the trigger does nothing (no popover). */\n disabled?: boolean\n /** Panel width (px number or CSS width). Defaults to `300px`. */\n width?: number | string\n /** Class on the floating panel. */\n className?: string\n /** Style on the floating panel. */\n style?: CSSProperties\n /** The trigger — usually a `Button` / `IconButton`. Cloned to wire the click + ARIA. */\n children: ReactElement\n}\n\n/**\n * An **inline confirm** for quick, low-risk actions (a row's delete / archive) — a small anchored popover\n * with a question, an optional description and **Cancel** / **Confirm**, where a `RemoveDialog` modal\n * would be too heavy and a bare `onClick` too dangerous. Wraps its trigger (`children`), which it clones\n * to toggle the panel. Built on the shared `FloatingPanel` (portaled, flips, clamps to the viewport,\n * dismisses on outside click / `Escape` = cancel). A11y: `role=\"alertdialog\"` labelled by the title and\n * described by the description, focus trapped and **placed on Cancel** (never the destructive button —\n * the `RemoveDialog` rule), focus returns to the trigger. An async `onConfirm` shows a loading confirm\n * button (Cancel + dismiss locked meanwhile), closes on success, stays open on failure. The icon sits in a\n * tinted box, the buttons (`sm`; confirm `contained` in `color`, default `error`) in a Card-style footer. Use `RemoveDialog` for high-risk, context-heavy deletes.\n */\nexport function Popconfirm({\n title,\n description,\n onConfirm,\n onCancel,\n confirmLabel,\n cancelLabel,\n color = 'error',\n icon = 'Danger',\n align = 'start',\n open,\n onOpenChange,\n disabled = false,\n width = 300,\n className,\n style,\n children,\n}: PopconfirmProps) {\n const t = useT()\n const id = useId()\n const panelId = `${id}-panel`\n const titleId = `${id}-title`\n const descId = `${id}-desc`\n const triggerRef = useRef<HTMLElement | null>(null)\n const cancelRef = useRef<HTMLButtonElement | null>(null)\n const [busy, setBusy] = useState(false)\n\n const isControlled = open !== undefined\n const [internalOpen, setInternalOpen] = useState(false)\n const isOpen = isControlled ? open : internalOpen\n const setOpen = (next: boolean) => {\n if (!isControlled) setInternalOpen(next)\n onOpenChange?.(next)\n }\n\n // focus Cancel once the panel is positioned + visible (a hidden element can't take focus)\n useEffect(() => {\n if (!isOpen) return\n const raf = requestAnimationFrame(() => cancelRef.current?.focus())\n return () => cancelAnimationFrame(raf)\n }, [isOpen])\n\n const close = (refocus: boolean) => {\n setOpen(false)\n if (refocus) triggerRef.current?.focus()\n }\n\n const cancel = (refocus = true) => {\n if (busy) return\n onCancel?.()\n close(refocus)\n }\n\n const confirm = async () => {\n const result = onConfirm()\n // any thenable counts as async (not just native Promises)\n if (!result || typeof (result as PromiseLike<unknown>).then !== 'function') {\n close(true)\n return\n }\n setBusy(true)\n try {\n await result\n setBusy(false)\n close(true)\n } catch {\n // stays open so the user can retry or cancel; surfacing the error (a toast) is the consumer's job\n setBusy(false)\n }\n }\n\n const triggerProps = children.props as {\n onClick?: (event: ReactMouseEvent) => void\n ref?: Ref<HTMLElement>\n }\n const originalRef = triggerProps.ref\n const trigger = cloneElement(children as ReactElement<Record<string, unknown>>, {\n ref: (node: HTMLElement | null) => {\n triggerRef.current = node\n if (typeof originalRef === 'function') originalRef(node)\n else if (originalRef) (originalRef as { current: HTMLElement | null }).current = node\n },\n onClick: (event: ReactMouseEvent) => {\n triggerProps.onClick?.(event)\n if (disabled || busy) return\n if (isOpen) cancel(false)\n else setOpen(true)\n },\n 'aria-haspopup': 'dialog',\n 'aria-expanded': isOpen,\n 'aria-controls': isOpen ? panelId : undefined,\n })\n\n const renderedIcon =\n icon === false ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n return (\n <>\n {trigger}\n <FloatingPanel\n open={isOpen}\n triggerRef={triggerRef}\n align={align}\n onClose={(refocus) => cancel(refocus)}\n id={panelId}\n role=\"alertdialog\"\n ariaLabelledBy={titleId}\n ariaDescribedBy={description != null ? descId : undefined}\n trapFocus\n width={width}\n className={clsx(styles.popconfirm, className)}\n style={{ '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`, ...style } as CSSProperties}\n >\n <div className={styles.body}>\n {renderedIcon != null && (\n <span className={styles.icon} aria-hidden=\"true\">\n {renderedIcon}\n </span>\n )}\n <div className={styles.text}>\n <div id={titleId} className={styles.title}>\n {title}\n </div>\n {description != null && (\n <div id={descId} className={styles.description}>\n {description}\n </div>\n )}\n </div>\n </div>\n <div className={styles.footer}>\n <Button ref={cancelRef} variant=\"text\" size=\"sm\" onClick={() => cancel()} disabled={busy}>\n {cancelLabel ?? t('common.cancel')}\n </Button>\n <Button variant=\"contained\" color={color} size=\"sm\" loading={busy} onClick={confirm}>\n {confirmLabel ?? t('common.confirm')}\n </Button>\n </div>\n </FloatingPanel>\n </>\n )\n}\n"],"names":["ICON_NAME_SET","ICON_NAMES","Popconfirm","title","description","onConfirm","onCancel","confirmLabel","cancelLabel","color","icon","align","open","onOpenChange","disabled","width","className","style","children","t","useT","id","useId","panelId","titleId","descId","triggerRef","useRef","cancelRef","busy","setBusy","useState","isControlled","internalOpen","setInternalOpen","isOpen","setOpen","next","useEffect","raf","_a","close","refocus","cancel","confirm","result","triggerProps","originalRef","trigger","cloneElement","node","event","renderedIcon","jsx","Icon","jsxs","Fragment","FloatingPanel","clsx","styles","Button"],"mappings":"6eAqBMA,GAAgB,IAAI,IAAYC,YAAU,EAoDzC,SAASC,GAAW,CACzB,MAAAC,EACA,YAAAC,EACA,UAAAC,EACA,SAAAC,EACA,aAAAC,EACA,YAAAC,EACA,MAAAC,EAAQ,QACR,KAAAC,EAAO,SACP,MAAAC,EAA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ChC,SAAAvD,CAAA,CACH,CAAA,CAAA,CAEJ,CAAA,EACF,EACAmD,EAAAA,KAAC,MAAA,CAAI,UAAWI,EAAO,OACrB,SAAA,CAAAN,MAACO,EAAAA,QAAO,IAAKhC,EAAW,QAAQ,OAAO,KAAK,KAAK,QAAS,IAAMe,EAAA,EAAU,SAAUd,EACjF,SAAArB,GAAeW,EAAE,eAAe,EACnC,EACAkC,EAAAA,IAACO,EAAAA,OAAA,CAAO,QAAQ,YAAY,MAAAnD,EAAc,KAAK,KAAK,QAASoB,EAAM,QAASe,EACzE,SAAArC,GAAgBY,EAAE,gBAAgB,CAAA,CACrC,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CACF,EACF,CAEJ"}
|
|
1
|
+
{"version":3,"file":"Popconfirm-IhlIINtZ.cjs","sources":["../src/components/Popconfirm/Popconfirm.tsx"],"sourcesContent":["import {\n cloneElement,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type MouseEvent as ReactMouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport { ICON_NAMES, type IconName } from '../../icons/names'\nimport { Button } from '../Button'\nimport { FloatingPanel } from '../FloatingPanel/FloatingPanel'\nimport { Icon } from '../Icon'\nimport type { PopoverAlign } from '../Popover'\nimport styles from './Popconfirm.module.css'\n\nconst ICON_NAME_SET = new Set<string>(ICON_NAMES)\n\nexport interface PopconfirmProps {\n /** The question — \"Delete this item?\". Labels the dialog. */\n title: ReactNode\n /** Optional muted line under the title (the consequence). Describes the dialog. */\n description?: ReactNode\n /**\n * Runs on confirm. Return a Promise to keep the popover open with the confirm button **loading** until\n * it settles — it closes on success and **stays open on rejection** (show your own toast).\n */\n // `unknown` (not `void | Promise`) so `() => toast.success(…)` — which returns an id — still fits\n onConfirm: () => unknown\n /** Runs on Cancel, `Escape` or an outside click. */\n onCancel?: () => void\n /** Confirm button label. Defaults to the localized \"Confirm\". */\n confirmLabel?: ReactNode\n /** Cancel button label. Defaults to the localized \"Cancel\". */\n cancelLabel?: ReactNode\n /** Tints the confirm button and the icon. Defaults to `error` (a destructive action). */\n color?: ThemeColor\n /** Leading icon — a known `IconName`, any node, or `false`. Defaults to `Danger` in the `color`. */\n icon?: IconName | ReactNode | false\n /** Horizontal alignment to the trigger (`start` default, `end` for a trigger near the right edge). */\n align?: PopoverAlign\n /** Controlled open state. */\n open?: boolean\n /** Fires with the next open state. */\n onOpenChange?: (open: boolean) => void\n /** Clicking the trigger does nothing (no popover). */\n disabled?: boolean\n /** Panel width (px number or CSS width). Defaults to `300px`. */\n width?: number | string\n /** Class on the floating panel. */\n className?: string\n /** Style on the floating panel. */\n style?: CSSProperties\n /** The trigger — usually a `Button` / `IconButton`. Cloned to wire the click + ARIA. */\n children: ReactElement\n}\n\n/**\n * An **inline confirm** for quick, low-risk actions (a row's delete / archive) — a small anchored popover\n * with a question, an optional description and **Cancel** / **Confirm**, where a `RemoveDialog` modal\n * would be too heavy and a bare `onClick` too dangerous. Wraps its trigger (`children`), which it clones\n * to toggle the panel. Built on the shared `FloatingPanel` (portaled, flips, clamps to the viewport,\n * dismisses on outside click / `Escape` = cancel). A11y: `role=\"alertdialog\"` labelled by the title and\n * described by the description, focus trapped and **placed on Cancel** (never the destructive button —\n * the `RemoveDialog` rule), focus returns to the trigger. An async `onConfirm` shows a loading confirm\n * button (Cancel + dismiss locked meanwhile), closes on success, stays open on failure. The icon sits in a\n * tinted box, the buttons (`sm`; confirm `contained` in `color`, default `error`) in a Card-style footer. Use `RemoveDialog` for high-risk, context-heavy deletes.\n */\nexport function Popconfirm({\n title,\n description,\n onConfirm,\n onCancel,\n confirmLabel,\n cancelLabel,\n color = 'error',\n icon = 'Danger',\n align = 'start',\n open,\n onOpenChange,\n disabled = false,\n width = 300,\n className,\n style,\n children,\n}: PopconfirmProps) {\n const t = useT()\n const id = useId()\n const panelId = `${id}-panel`\n const titleId = `${id}-title`\n const descId = `${id}-desc`\n const triggerRef = useRef<HTMLElement | null>(null)\n const cancelRef = useRef<HTMLButtonElement | null>(null)\n const [busy, setBusy] = useState(false)\n\n const isControlled = open !== undefined\n const [internalOpen, setInternalOpen] = useState(false)\n const isOpen = isControlled ? open : internalOpen\n const setOpen = (next: boolean) => {\n if (!isControlled) setInternalOpen(next)\n onOpenChange?.(next)\n }\n\n // focus Cancel once the panel is positioned + visible (a hidden element can't take focus)\n useEffect(() => {\n if (!isOpen) return\n const raf = requestAnimationFrame(() => cancelRef.current?.focus())\n return () => cancelAnimationFrame(raf)\n }, [isOpen])\n\n const close = (refocus: boolean) => {\n setOpen(false)\n if (refocus) triggerRef.current?.focus()\n }\n\n const cancel = (refocus = true) => {\n if (busy) return\n onCancel?.()\n close(refocus)\n }\n\n const confirm = async () => {\n const result = onConfirm()\n // any thenable counts as async (not just native Promises)\n if (!result || typeof (result as PromiseLike<unknown>).then !== 'function') {\n close(true)\n return\n }\n setBusy(true)\n try {\n await result\n setBusy(false)\n close(true)\n } catch {\n // stays open so the user can retry or cancel; surfacing the error (a toast) is the consumer's job\n setBusy(false)\n }\n }\n\n const triggerProps = children.props as {\n onClick?: (event: ReactMouseEvent) => void\n ref?: Ref<HTMLElement>\n }\n const originalRef = triggerProps.ref\n const trigger = cloneElement(children as ReactElement<Record<string, unknown>>, {\n ref: (node: HTMLElement | null) => {\n triggerRef.current = node\n if (typeof originalRef === 'function') originalRef(node)\n else if (originalRef) (originalRef as { current: HTMLElement | null }).current = node\n },\n onClick: (event: ReactMouseEvent) => {\n triggerProps.onClick?.(event)\n if (disabled || busy) return\n if (isOpen) cancel(false)\n else setOpen(true)\n },\n 'aria-haspopup': 'dialog',\n 'aria-expanded': isOpen,\n 'aria-controls': isOpen ? panelId : undefined,\n })\n\n const renderedIcon =\n icon === false ? null : typeof icon === 'string' && ICON_NAME_SET.has(icon) ? (\n <Icon name={icon as IconName} />\n ) : (\n icon\n )\n\n return (\n <>\n {trigger}\n <FloatingPanel\n open={isOpen}\n triggerRef={triggerRef}\n align={align}\n onClose={(refocus) => cancel(refocus)}\n id={panelId}\n role=\"alertdialog\"\n ariaLabelledBy={titleId}\n ariaDescribedBy={description != null ? descId : undefined}\n trapFocus\n width={width}\n className={clsx(styles.popconfirm, className)}\n style={{ '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`, ...style } as CSSProperties}\n >\n <div className={styles.body}>\n {renderedIcon != null && (\n <span className={styles.icon} aria-hidden=\"true\">\n {renderedIcon}\n </span>\n )}\n <div className={styles.text}>\n <div id={titleId} className={styles.title}>\n {title}\n </div>\n {description != null && (\n <div id={descId} className={styles.description}>\n {description}\n </div>\n )}\n </div>\n </div>\n <div className={styles.footer}>\n <Button ref={cancelRef} variant=\"text\" size=\"sm\" onClick={() => cancel()} disabled={busy}>\n {cancelLabel ?? t('common.cancel')}\n </Button>\n <Button variant=\"contained\" color={color} size=\"sm\" loading={busy} onClick={confirm}>\n {confirmLabel ?? t('common.confirm')}\n </Button>\n </div>\n </FloatingPanel>\n </>\n )\n}\n"],"names":["ICON_NAME_SET","ICON_NAMES","Popconfirm","title","description","onConfirm","onCancel","confirmLabel","cancelLabel","color","icon","align","open","onOpenChange","disabled","width","className","style","children","t","useT","id","useId","panelId","titleId","descId","triggerRef","useRef","cancelRef","busy","setBusy","useState","isControlled","internalOpen","setInternalOpen","isOpen","setOpen","next","useEffect","raf","_a","close","refocus","cancel","confirm","result","triggerProps","originalRef","trigger","cloneElement","node","event","renderedIcon","jsx","Icon","jsxs","Fragment","FloatingPanel","clsx","styles","Button"],"mappings":"6eAqBMA,GAAgB,IAAI,IAAYC,YAAU,EAoDzC,SAASC,GAAW,CACzB,MAAAC,EACA,YAAAC,EACA,UAAAC,EACA,SAAAC,EACA,aAAAC,EACA,YAAAC,EACA,MAAAC,EAAQ,QACR,KAAAC,EAAO,SACP,MAAAC,EAAQ,QACR,KAAAC,EACA,aAAAC,EACA,SAAAC,EAAW,GACX,MAAAC,EAAQ,IACR,UAAAC,EACA,MAAA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AAWI,EAAO,OACrB,SAAA,CAAAN,MAACO,EAAAA,QAAO,IAAKhC,EAAW,QAAQ,OAAO,KAAK,KAAK,QAAS,IAAMe,EAAA,EAAU,SAAUd,EACjF,SAAArB,GAAeW,EAAE,eAAe,EACnC,EACAkC,EAAAA,IAACO,EAAAA,OAAA,CAAO,QAAQ,YAAY,MAAAnD,EAAc,KAAK,KAAK,QAASoB,EAAM,QAASe,EACzE,SAAArC,GAAgBY,EAAE,gBAAgB,CAAA,CACrC,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CACF,EACF,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),n=require("react"),z=require("clsx"),E=require("./FloatingPanel-
|
|
2
|
-
//# sourceMappingURL=Popover-
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),n=require("react"),z=require("clsx"),E=require("./FloatingPanel-tGCG2nhA.cjs"),N="_popover_1gmzd_4",S={popover:N};function T({trigger:a,children:v,align:m="start",open:f,defaultOpen:x=!1,onOpenChange:l,trapFocus:q=!1,matchTriggerWidth:R=!1,width:g,ariaLabel:j,disabled:F=!1,className:I,style:P}){const u=n.useId(),c=n.useRef(null),p=f!==void 0,[_,k]=n.useState(x),o=p?f:_,d=e=>{p||k(e),l==null||l(e)},t=a.props,r=t.ref,y=n.cloneElement(a,{ref:e=>{c.current=e,typeof r=="function"?r(e):r&&(r.current=e)},onClick:e=>{var s;(s=t.onClick)==null||s.call(t,e),F||d(!o)},"aria-haspopup":"dialog","aria-expanded":o,"aria-controls":o?u:void 0});return i.jsxs(i.Fragment,{children:[y,i.jsx(E.FloatingPanel,{open:o,triggerRef:c,align:m,onClose:e=>{var s;d(!1),e&&((s=c.current)==null||s.focus())},id:u,role:"dialog",ariaLabel:j,trapFocus:q,matchTriggerWidth:R,width:g,className:z.clsx(S.popover,I),style:P,children:v})]})}exports.Popover=T;
|
|
2
|
+
//# sourceMappingURL=Popover-DsYUT23r.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover-
|
|
1
|
+
{"version":3,"file":"Popover-DsYUT23r.cjs","sources":["../src/components/Popover/Popover.tsx"],"sourcesContent":["import {\n cloneElement,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type MouseEvent as ReactMouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { FloatingPanel } from '../FloatingPanel/FloatingPanel'\nimport styles from './Popover.module.css'\n\nexport type PopoverAlign = 'start' | 'end'\n\nexport interface PopoverProps {\n /** Element that toggles the popover (e.g. a `Button`/`IconButton`). Cloned to wire click + a11y. */\n trigger: ReactElement\n /** Popover content — arbitrary (a header/body/footer, a form, a filter panel, …). */\n children: ReactNode\n /**\n * Horizontal alignment to the trigger: `start` (default — left edges align, grows right) or `end`\n * (right edges align, grows left — for a trigger near the right edge).\n */\n align?: PopoverAlign\n /** Controlled open state. */\n open?: boolean\n /** Initial open state for uncontrolled use. Defaults to `false`. */\n defaultOpen?: boolean\n /** Fires with the next open state. */\n onOpenChange?: (open: boolean) => void\n /** Trap Tab focus inside (+ `aria-modal`) — for form/filter popovers. Defaults to `false`. */\n trapFocus?: boolean\n /** Make the panel at least as wide as the trigger. Defaults to `false`. */\n matchTriggerWidth?: boolean\n /** Fixed panel width (px number or any CSS width). */\n width?: number | string\n /** Accessible label for the panel (`role=\"dialog\"`). */\n ariaLabel?: string\n /** Prevents opening. */\n disabled?: boolean\n /** Class applied to the floating panel. */\n className?: string\n /** Style applied to the floating panel. */\n style?: CSSProperties\n}\n\n/**\n * An anchored popover holding **arbitrary content** — the generic floating surface for filter panels,\n * forms, detail cards, etc. (unlike `Dropdown`, which is a `role=\"menu\"` of items). Built on the shared\n * `FloatingPanel`: portaled to `<body>`, opens below the `trigger` (flips above on overflow), locks page\n * scroll, dismisses on outside-pointerdown / `Escape` (refocusing the trigger), and animates in. The\n * trigger is cloned to wire `onClick` + `aria-haspopup=\"dialog\"`/`aria-expanded`/`aria-controls`.\n * `trapFocus` cycles Tab within (for forms). Controlled (`open` + `onOpenChange`) or uncontrolled\n * (`defaultOpen`). The panel is `role=\"dialog\"`.\n */\nexport function Popover({\n trigger,\n children,\n align = 'start',\n open,\n defaultOpen = false,\n onOpenChange,\n trapFocus = false,\n matchTriggerWidth = false,\n width,\n ariaLabel,\n disabled = false,\n className,\n style,\n}: PopoverProps) {\n const panelId = useId()\n const triggerRef = useRef<HTMLElement | null>(null)\n\n const isControlled = open !== undefined\n const [internalOpen, setInternalOpen] = useState(defaultOpen)\n const isOpen = isControlled ? open : internalOpen\n\n const setOpen = (next: boolean) => {\n if (!isControlled) setInternalOpen(next)\n onOpenChange?.(next)\n }\n\n const triggerProps = trigger.props as {\n onClick?: (event: ReactMouseEvent) => void\n ref?: Ref<HTMLElement>\n }\n const originalRef = triggerProps.ref\n\n const clonedTrigger = cloneElement(trigger as ReactElement<Record<string, unknown>>, {\n ref: (node: HTMLElement | null) => {\n triggerRef.current = node\n if (typeof originalRef === 'function') originalRef(node)\n else if (originalRef) (originalRef as { current: HTMLElement | null }).current = node\n },\n onClick: (event: ReactMouseEvent) => {\n triggerProps.onClick?.(event)\n if (!disabled) setOpen(!isOpen)\n },\n 'aria-haspopup': 'dialog',\n 'aria-expanded': isOpen,\n 'aria-controls': isOpen ? panelId : undefined,\n })\n\n return (\n <>\n {clonedTrigger}\n <FloatingPanel\n open={isOpen}\n triggerRef={triggerRef}\n align={align}\n onClose={(refocus) => {\n setOpen(false)\n if (refocus) triggerRef.current?.focus()\n }}\n id={panelId}\n role=\"dialog\"\n ariaLabel={ariaLabel}\n trapFocus={trapFocus}\n matchTriggerWidth={matchTriggerWidth}\n width={width}\n className={clsx(styles.popover, className)}\n style={style}\n >\n {children}\n </FloatingPanel>\n </>\n )\n}\n"],"names":["Popover","trigger","children","align","open","defaultOpen","onOpenChange","trapFocus","matchTriggerWidth","width","ariaLabel","disabled","className","style","panelId","useId","triggerRef","useRef","isControlled","internalOpen","setInternalOpen","useState","isOpen","setOpen","next","triggerProps","originalRef","clonedTrigger","cloneElement","node","event","_a","jsxs","Fragment","jsx","FloatingPanel","refocus","clsx","styles"],"mappings":"oKA0DO,SAASA,EAAQ,CACtB,QAAAC,EACA,SAAAC,EACA,MAAAC,EAAQ,QACR,KAAAC,EACA,YAAAC,EAAc,GACd,aAAAC,EACA,UAAAC,EAAY,GACZ,kBAAAC,EAAoB,GACpB,MAAAC,EACA,UAAAC,EACA,SAAAC,EAAW,GACX,UAAAC,EACA,MAAAC,CACF,EAAiB,CACf,MAAMC,EAAUC,EAAAA,MAAA,EACVC,EAAaC,EAAAA,OAA2B,IAAI,EAE5CC,EAAed,IAAS,OACxB,CAACe,EAAcC,CAAe,EAAIC,EAAAA,SAAShB,CAAW,EACtDiB,EAASJ,EAAed,EAAOe,EAE/BI,EAAWC,GAAkB,CAC5BN,GAAcE,EAAgBI,CAAI,EACvClB,GAAA,MAAAA,EAAekB,EACjB,EAEMC,EAAexB,EAAQ,MAIvByB,EAAcD,EAAa,IAE3BE,EAAgBC,EAAAA,aAAa3B,EAAkD,CACnF,IAAM4B,GAA6B,CACjCb,EAAW,QAAUa,EACjB,OAAOH,GAAgB,WAAYA,EAAYG,CAAI,EAC9CH,IAAcA,EAAgD,QAAUG,EACnF,EACA,QAAUC,GAA2B,QACnCC,EAAAN,EAAa,UAAb,MAAAM,EAAA,KAAAN,EAAuBK,GAClBnB,GAAUY,EAAQ,CAACD,CAAM,CAChC,EACA,gBAAiB,SACjB,gBAAiBA,EACjB,gBAAiBA,EAASR,EAAU,MAAA,CACrC,EAED,OACEkB,EAAAA,KAAAC,WAAA,CACG,SAAA,CAAAN,EACDO,EAAAA,IAACC,EAAAA,cAAA,CACC,KAAMb,EACN,WAAAN,EACA,MAAAb,EACA,QAAUiC,GAAY,OACpBb,EAAQ,EAAK,EACTa,KAASL,EAAAf,EAAW,UAAX,MAAAe,EAAoB,QACnC,EACA,GAAIjB,EACJ,KAAK,SACL,UAAAJ,EACA,UAAAH,EACA,kBAAAC,EACA,MAAAC,EACA,UAAW4B,EAAAA,KAAKC,EAAO,QAAS1B,CAAS,EACzC,MAAAC,EAEC,SAAAX,CAAA,CAAA,CACH,EACF,CAEJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as P, Fragment as z, jsx as E } from "react/jsx-runtime";
|
|
2
2
|
import { useId as N, useRef as S, useState as T, cloneElement as b } from "react";
|
|
3
3
|
import { clsx as q } from "clsx";
|
|
4
|
-
import { F as w } from "./FloatingPanel-
|
|
4
|
+
import { F as w } from "./FloatingPanel-C5c_eMQ0.js";
|
|
5
5
|
const A = "_popover_1gmzd_4", B = {
|
|
6
6
|
popover: A
|
|
7
7
|
};
|
|
@@ -62,4 +62,4 @@ function J({
|
|
|
62
62
|
export {
|
|
63
63
|
J as P
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=Popover-
|
|
65
|
+
//# sourceMappingURL=Popover-WaVH3jsN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover-
|
|
1
|
+
{"version":3,"file":"Popover-WaVH3jsN.js","sources":["../src/components/Popover/Popover.tsx"],"sourcesContent":["import {\n cloneElement,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type MouseEvent as ReactMouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { FloatingPanel } from '../FloatingPanel/FloatingPanel'\nimport styles from './Popover.module.css'\n\nexport type PopoverAlign = 'start' | 'end'\n\nexport interface PopoverProps {\n /** Element that toggles the popover (e.g. a `Button`/`IconButton`). Cloned to wire click + a11y. */\n trigger: ReactElement\n /** Popover content — arbitrary (a header/body/footer, a form, a filter panel, …). */\n children: ReactNode\n /**\n * Horizontal alignment to the trigger: `start` (default — left edges align, grows right) or `end`\n * (right edges align, grows left — for a trigger near the right edge).\n */\n align?: PopoverAlign\n /** Controlled open state. */\n open?: boolean\n /** Initial open state for uncontrolled use. Defaults to `false`. */\n defaultOpen?: boolean\n /** Fires with the next open state. */\n onOpenChange?: (open: boolean) => void\n /** Trap Tab focus inside (+ `aria-modal`) — for form/filter popovers. Defaults to `false`. */\n trapFocus?: boolean\n /** Make the panel at least as wide as the trigger. Defaults to `false`. */\n matchTriggerWidth?: boolean\n /** Fixed panel width (px number or any CSS width). */\n width?: number | string\n /** Accessible label for the panel (`role=\"dialog\"`). */\n ariaLabel?: string\n /** Prevents opening. */\n disabled?: boolean\n /** Class applied to the floating panel. */\n className?: string\n /** Style applied to the floating panel. */\n style?: CSSProperties\n}\n\n/**\n * An anchored popover holding **arbitrary content** — the generic floating surface for filter panels,\n * forms, detail cards, etc. (unlike `Dropdown`, which is a `role=\"menu\"` of items). Built on the shared\n * `FloatingPanel`: portaled to `<body>`, opens below the `trigger` (flips above on overflow), locks page\n * scroll, dismisses on outside-pointerdown / `Escape` (refocusing the trigger), and animates in. The\n * trigger is cloned to wire `onClick` + `aria-haspopup=\"dialog\"`/`aria-expanded`/`aria-controls`.\n * `trapFocus` cycles Tab within (for forms). Controlled (`open` + `onOpenChange`) or uncontrolled\n * (`defaultOpen`). The panel is `role=\"dialog\"`.\n */\nexport function Popover({\n trigger,\n children,\n align = 'start',\n open,\n defaultOpen = false,\n onOpenChange,\n trapFocus = false,\n matchTriggerWidth = false,\n width,\n ariaLabel,\n disabled = false,\n className,\n style,\n}: PopoverProps) {\n const panelId = useId()\n const triggerRef = useRef<HTMLElement | null>(null)\n\n const isControlled = open !== undefined\n const [internalOpen, setInternalOpen] = useState(defaultOpen)\n const isOpen = isControlled ? open : internalOpen\n\n const setOpen = (next: boolean) => {\n if (!isControlled) setInternalOpen(next)\n onOpenChange?.(next)\n }\n\n const triggerProps = trigger.props as {\n onClick?: (event: ReactMouseEvent) => void\n ref?: Ref<HTMLElement>\n }\n const originalRef = triggerProps.ref\n\n const clonedTrigger = cloneElement(trigger as ReactElement<Record<string, unknown>>, {\n ref: (node: HTMLElement | null) => {\n triggerRef.current = node\n if (typeof originalRef === 'function') originalRef(node)\n else if (originalRef) (originalRef as { current: HTMLElement | null }).current = node\n },\n onClick: (event: ReactMouseEvent) => {\n triggerProps.onClick?.(event)\n if (!disabled) setOpen(!isOpen)\n },\n 'aria-haspopup': 'dialog',\n 'aria-expanded': isOpen,\n 'aria-controls': isOpen ? panelId : undefined,\n })\n\n return (\n <>\n {clonedTrigger}\n <FloatingPanel\n open={isOpen}\n triggerRef={triggerRef}\n align={align}\n onClose={(refocus) => {\n setOpen(false)\n if (refocus) triggerRef.current?.focus()\n }}\n id={panelId}\n role=\"dialog\"\n ariaLabel={ariaLabel}\n trapFocus={trapFocus}\n matchTriggerWidth={matchTriggerWidth}\n width={width}\n className={clsx(styles.popover, className)}\n style={style}\n >\n {children}\n </FloatingPanel>\n </>\n )\n}\n"],"names":["Popover","trigger","children","align","open","defaultOpen","onOpenChange","trapFocus","matchTriggerWidth","width","ariaLabel","disabled","className","style","panelId","useId","triggerRef","useRef","isControlled","internalOpen","setInternalOpen","useState","isOpen","setOpen","next","triggerProps","originalRef","clonedTrigger","cloneElement","node","event","_a","jsxs","Fragment","jsx","FloatingPanel","refocus","clsx","styles"],"mappings":";;;;;;;AA0DO,SAASA,EAAQ;AAAA,EACtB,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,MAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,cAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,mBAAAC,IAAoB;AAAA,EACpB,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,OAAAC;AACF,GAAiB;AACf,QAAMC,IAAUC,EAAA,GACVC,IAAaC,EAA2B,IAAI,GAE5CC,IAAed,MAAS,QACxB,CAACe,GAAcC,CAAe,IAAIC,EAAShB,CAAW,GACtDiB,IAASJ,IAAed,IAAOe,GAE/BI,IAAU,CAACC,MAAkB;AACjC,IAAKN,KAAcE,EAAgBI,CAAI,GACvClB,KAAA,QAAAA,EAAekB;AAAA,EACjB,GAEMC,IAAexB,EAAQ,OAIvByB,IAAcD,EAAa,KAE3BE,IAAgBC,EAAa3B,GAAkD;AAAA,IACnF,KAAK,CAAC4B,MAA6B;AACjC,MAAAb,EAAW,UAAUa,GACjB,OAAOH,KAAgB,aAAYA,EAAYG,CAAI,IAC9CH,MAAcA,EAAgD,UAAUG;AAAA,IACnF;AAAA,IACA,SAAS,CAACC,MAA2B;;AACnC,OAAAC,IAAAN,EAAa,YAAb,QAAAM,EAAA,KAAAN,GAAuBK,IAClBnB,KAAUY,EAAQ,CAACD,CAAM;AAAA,IAChC;AAAA,IACA,iBAAiB;AAAA,IACjB,iBAAiBA;AAAA,IACjB,iBAAiBA,IAASR,IAAU;AAAA,EAAA,CACrC;AAED,SACE,gBAAAkB,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAN;AAAA,IACD,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAMb;AAAA,QACN,YAAAN;AAAA,QACA,OAAAb;AAAA,QACA,SAAS,CAACiC,MAAY;;AACpB,UAAAb,EAAQ,EAAK,GACTa,OAASL,IAAAf,EAAW,YAAX,QAAAe,EAAoB;AAAA,QACnC;AAAA,QACA,IAAIjB;AAAA,QACJ,MAAK;AAAA,QACL,WAAAJ;AAAA,QACA,WAAAH;AAAA,QACA,mBAAAC;AAAA,QACA,OAAAC;AAAA,QACA,WAAW4B,EAAKC,EAAO,SAAS1B,CAAS;AAAA,QACzC,OAAAC;AAAA,QAEC,UAAAX;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const r=require("react/jsx-runtime"),w=require("react"),o=require("clsx"),h=require("./ConfigProvider-
|
|
2
|
-
//# sourceMappingURL=Progress-
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),w=require("react"),o=require("clsx"),h=require("./ConfigProvider-CtpfSy1i.cjs"),C="_root_1uzzo_4",I="_caption_1uzzo_11",L="_value_1uzzo_16",R="_linear_1uzzo_23",B="_sm_1uzzo_28",D="_md_1uzzo_31",S="_lg_1uzzo_34",A="_header_1uzzo_38",E="_track_1uzzo_45",G="_buffer_1uzzo_52",H="_fill_1uzzo_53",J="_striped_1uzzo_69",K="_animated_1uzzo_82",O="_indeterminate_1uzzo_95",Q="_circular_1uzzo_109",U="_ring_1uzzo_128",W="_svg_1uzzo_136",X="_ringTrack_1uzzo_144",Y="_ringFill_1uzzo_145",Z="_ringValue_1uzzo_159",nn="_spinning_1uzzo_165",n={root:C,caption:I,value:L,linear:R,sm:B,md:D,lg:S,header:A,track:E,buffer:G,fill:H,striped:J,animated:K,"pg-stripes":"_pg-stripes_1uzzo_1",indeterminate:O,"pg-sweep":"_pg-sweep_1uzzo_1",circular:Q,ring:U,svg:W,ringTrack:X,ringFill:Y,ringValue:Z,spinning:nn,"pg-spin":"_pg-spin_1uzzo_1"},T=(d,l,u)=>Math.min(u,Math.max(l,d)),rn=w.forwardRef(function({value:l,max:u=100,variant:$="linear",size:p="md",color:M="accent",label:c,showValue:_=!1,buffer:m,striped:P=!1,animated:v=!1,thresholds:i,className:x,style:q,...f},j){const y=h.useT(),g=w.useId(),s=l==null,t=u>0?u:100,z=s?0:T(l,0,t),a=z/t*100,N=m==null?void 0:T(m,0,t)/t*100,F=!s&&(i==null?void 0:i.error)!=null&&a>=i.error?"error":!s&&(i==null?void 0:i.warning)!=null&&a>=i.warning?"warning":M,e=s?void 0:typeof _=="function"?_(z,t):_?`${Math.round(a)}%`:void 0,V=s?y("common.loading"):typeof e=="string"?e:`${Math.round(a)}%`,b={role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":s?void 0:z,"aria-valuetext":V,"aria-busy":s||void 0,...c!=null?{"aria-labelledby":g}:{"aria-label":y("progress.label")}},k={"--tz-btn-rgb":`var(--tz-color-${F}-rgb)`,...q};return $==="circular"?r.jsxs("div",{ref:j,className:o.clsx(n.root,n.circular,n[p],x),style:k,...f,children:[r.jsxs("div",{className:o.clsx(n.ring,s&&n.spinning),...b,children:[r.jsxs("svg",{viewBox:"0 0 36 36",className:n.svg,"aria-hidden":"true",children:[r.jsx("circle",{className:n.ringTrack,cx:"18",cy:"18",r:"15.5",pathLength:100}),r.jsx("circle",{className:n.ringFill,cx:"18",cy:"18",r:"15.5",pathLength:100,strokeDasharray:s?"28 72":`${a} ${100-a}`})]}),e!=null&&r.jsx("span",{className:n.ringValue,children:e})]}),c!=null&&r.jsx("span",{id:g,className:n.caption,children:c})]}):r.jsxs("div",{ref:j,className:o.clsx(n.root,n.linear,n[p],x),style:k,...f,children:[(c!=null||e!=null)&&r.jsxs("div",{className:n.header,children:[c!=null?r.jsx("span",{id:g,className:n.caption,children:c}):r.jsx("span",{}),e!=null&&r.jsx("span",{className:n.value,children:e})]}),r.jsxs("div",{className:o.clsx(n.track,s&&n.indeterminate),...b,children:[N!=null&&!s&&r.jsx("div",{className:n.buffer,style:{width:`${N}%`}}),r.jsx("div",{className:o.clsx(n.fill,(P||v)&&n.striped,v&&n.animated),style:s?void 0:{width:`${a}%`}})]})]})});exports.Progress=rn;
|
|
2
|
+
//# sourceMappingURL=Progress-CAY1p06_.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress-Bwxx71Ns.cjs","sources":["../src/components/Progress/Progress.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Progress.module.css'\n\nexport type ProgressVariant = 'linear' | 'circular'\nexport type ProgressSize = 'sm' | 'md' | 'lg'\n\n/** Percentages (0–100) at which the color switches automatically — quota UX. */\nexport interface ProgressThresholds {\n /** From this percentage on, the bar turns `warning`. */\n warning?: number\n /** From this percentage on, the bar turns `error`. */\n error?: number\n}\n\nexport interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Current value, `0`–`max`. Omit it for an **indeterminate** progress (a moving bar / spinning arc). */\n value?: number\n /** The value that means \"done\". Defaults to `100`. */\n max?: number\n /** `linear` (default) — a bar; `circular` — a ring. */\n variant?: ProgressVariant\n /** Linear: bar thickness 4 / 6 / 8 px. Circular: ring 32 / 48 / 64 px. Defaults to `md`. */\n size?: ProgressSize\n /** Theme color of the fill. Defaults to `accent`. */\n color?: ThemeColor\n /** A caption — above the bar (left) for linear, under the ring for circular. Labels the progressbar. */\n label?: ReactNode\n /**\n * Show the value: `true` → the percentage (\"42%\"); a function → your own text, e.g.\n * `(v, max) => `${v} GB of ${max} GB``. Linear: right of the caption; circular: inside the ring.\n */\n showValue?: boolean | ((value: number, max: number) => ReactNode)\n /** A second, lighter bar behind the fill (buffered / pending amount), `0`–`max`. Linear only. */\n buffer?: number\n /** Diagonal stripes on the fill. Linear only. */\n striped?: boolean\n /** Animate the stripes (implies `striped`). Linear only. Off under `prefers-reduced-motion`. */\n animated?: boolean\n /** Switch the color automatically by percentage (e.g. `{ warning: 80, error: 95 }` for a quota). */\n thresholds?: ProgressThresholds\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, n))\n\n/**\n * A progress indicator — **linear** (a bar) or **circular** (a ring) — for uploads, wizard steps, quotas and\n * background jobs. Determinate with `value` / `max`, or **indeterminate** without `value` (a moving bar / a\n * spinning arc). An optional caption (`label`) and value readout (`showValue` — the percentage or your own\n * formatter), a lighter `buffer` bar, `striped` / `animated` fills, and `thresholds` that turn the fill\n * `warning` / `error` as it fills up. Tinted by `color` through the shared `--tz-btn-rgb` pattern; the track is\n * `primary-shade200`, the bar is pill-rounded (so the global `square` shape flattens it). A11y:\n * `role=\"progressbar\"` with `aria-valuemin/max/now` + `aria-valuetext`, labelled by the caption (or a\n * localized \"Progress\"); indeterminate drops `aria-valuenow` and sets `aria-busy`. Motion stops under\n * `prefers-reduced-motion`. Token-only. `forwardRef` to the root `<div>`.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n value,\n max = 100,\n variant = 'linear',\n size = 'md',\n color = 'accent',\n label,\n showValue = false,\n buffer,\n striped = false,\n animated = false,\n thresholds,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const labelId = useId()\n const indeterminate = value == null\n const safeMax = max > 0 ? max : 100\n const current = indeterminate ? 0 : clamp(value, 0, safeMax)\n const pct = (current / safeMax) * 100\n const bufferPct = buffer == null ? undefined : (clamp(buffer, 0, safeMax) / safeMax) * 100\n\n // quota UX: the fill turns warning / error as it crosses the thresholds (error wins)\n const resolvedColor: ThemeColor =\n !indeterminate && thresholds?.error != null && pct >= thresholds.error\n ? 'error'\n : !indeterminate && thresholds?.warning != null && pct >= thresholds.warning\n ? 'warning'\n : color\n\n const valueText = indeterminate\n ? undefined\n : typeof showValue === 'function'\n ? showValue(current, safeMax)\n : showValue\n ? `${Math.round(pct)}%`\n : undefined\n const ariaValueText = indeterminate\n ? t('common.loading')\n : typeof valueText === 'string'\n ? valueText\n : `${Math.round(pct)}%`\n\n const a11y = {\n role: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n 'aria-valuenow': indeterminate ? undefined : current,\n 'aria-valuetext': ariaValueText,\n 'aria-busy': indeterminate || undefined,\n ...(label != null ? { 'aria-labelledby': labelId } : { 'aria-label': t('progress.label') }),\n } as const\n\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`,\n ...style,\n } as CSSProperties\n\n if (variant === 'circular') {\n // pathLength=100 makes the dash math a plain percentage\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.circular, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n <div className={clsx(styles.ring, indeterminate && styles.spinning)} {...a11y}>\n <svg viewBox=\"0 0 36 36\" className={styles.svg} aria-hidden=\"true\">\n <circle className={styles.ringTrack} cx=\"18\" cy=\"18\" r=\"15.5\" pathLength={100} />\n <circle\n className={styles.ringFill}\n cx=\"18\"\n cy=\"18\"\n r=\"15.5\"\n pathLength={100}\n strokeDasharray={indeterminate ? '28 72' : `${pct} ${100 - pct}`}\n />\n </svg>\n {valueText != null && <span className={styles.ringValue}>{valueText}</span>}\n </div>\n {label != null && (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n )}\n </div>\n )\n }\n\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.linear, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n {(label != null || valueText != null) && (\n <div className={styles.header}>\n {label != null ? (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n ) : (\n <span />\n )}\n {valueText != null && <span className={styles.value}>{valueText}</span>}\n </div>\n )}\n <div className={clsx(styles.track, indeterminate && styles.indeterminate)} {...a11y}>\n {bufferPct != null && !indeterminate && (\n <div className={styles.buffer} style={{ width: `${bufferPct}%` }} />\n )}\n <div\n className={clsx(\n styles.fill,\n (striped || animated) && styles.striped,\n animated && styles.animated,\n )}\n style={indeterminate ? undefined : { width: `${pct}%` }}\n />\n </div>\n </div>\n )\n})\n"],"names":["clamp","n","lo","hi","Progress","forwardRef","value","max","variant","size","color","label","showValue","buffer","striped","animated","thresholds","className","style","props","ref","t","useT","labelId","useId","indeterminate","safeMax","current","pct","bufferPct","resolvedColor","valueText","ariaValueText","a11y","rootStyle","jsxs","clsx","styles","jsx"],"mappings":"m2BA4CMA,EAAQ,CAACC,EAAWC,EAAYC,IAAe,KAAK,IAAIA,EAAI,KAAK,IAAID,EAAID,CAAC,CAAC,EAapEG,GAAWC,EAAAA,WAA0C,SAChE,CACE,MAAAC,EACA,IAAAC,EAAM,IACN,QAAAC,EAAU,SACV,KAAAC,EAAO,KACP,MAAAC,EAAQ,SACR,MAAAC,EACA,UAAAC,EAAY,GACZ,OAAAC,EACA,QAAAC,EAAU,GACV,SAAAC,EAAW,GACX,WAAAC,EACA,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EAC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,GAAGR,CAAS,KAAO,EAEpES,EAAAA,IAAC,MAAA,CACC,UAAWF,EAAAA,KACTC,EAAO,MACNvB,GAAWC,IAAasB,EAAO,QAChCtB,GAAYsB,EAAO,QAAA,EAErB,MAAOZ,EAAgB,OAAY,CAAE,MAAO,GAAGG,CAAG,GAAA,CAAI,CAAA,CACxD,CAAA,CACF,CAAA,CAAA,CAAA,CAGN,CAAC"}
|
|
1
|
+
{"version":3,"file":"Progress-CAY1p06_.cjs","sources":["../src/components/Progress/Progress.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Progress.module.css'\n\nexport type ProgressVariant = 'linear' | 'circular'\nexport type ProgressSize = 'sm' | 'md' | 'lg'\n\n/** Percentages (0–100) at which the color switches automatically — quota UX. */\nexport interface ProgressThresholds {\n /** From this percentage on, the bar turns `warning`. */\n warning?: number\n /** From this percentage on, the bar turns `error`. */\n error?: number\n}\n\nexport interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Current value, `0`–`max`. Omit it for an **indeterminate** progress (a moving bar / spinning arc). */\n value?: number\n /** The value that means \"done\". Defaults to `100`. */\n max?: number\n /** `linear` (default) — a bar; `circular` — a ring. */\n variant?: ProgressVariant\n /** Linear: bar thickness 4 / 6 / 8 px. Circular: ring 32 / 48 / 64 px. Defaults to `md`. */\n size?: ProgressSize\n /** Theme color of the fill. Defaults to `accent`. */\n color?: ThemeColor\n /** A caption — above the bar (left) for linear, under the ring for circular. Labels the progressbar. */\n label?: ReactNode\n /**\n * Show the value: `true` → the percentage (\"42%\"); a function → your own text, e.g.\n * `(v, max) => `${v} GB of ${max} GB``. Linear: right of the caption; circular: inside the ring.\n */\n showValue?: boolean | ((value: number, max: number) => ReactNode)\n /** A second, lighter bar behind the fill (buffered / pending amount), `0`–`max`. Linear only. */\n buffer?: number\n /** Diagonal stripes on the fill. Linear only. */\n striped?: boolean\n /** Animate the stripes (implies `striped`). Linear only. Off under `prefers-reduced-motion`. */\n animated?: boolean\n /** Switch the color automatically by percentage (e.g. `{ warning: 80, error: 95 }` for a quota). */\n thresholds?: ProgressThresholds\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, n))\n\n/**\n * A progress indicator — **linear** (a bar) or **circular** (a ring) — for uploads, wizard steps, quotas and\n * background jobs. Determinate with `value` / `max`, or **indeterminate** without `value` (a moving bar / a\n * spinning arc). An optional caption (`label`) and value readout (`showValue` — the percentage or your own\n * formatter), a lighter `buffer` bar, `striped` / `animated` fills, and `thresholds` that turn the fill\n * `warning` / `error` as it fills up. Tinted by `color` through the shared `--tz-btn-rgb` pattern; the track is\n * `primary-shade200`, the bar is pill-rounded (so the global `square` shape flattens it). A11y:\n * `role=\"progressbar\"` with `aria-valuemin/max/now` + `aria-valuetext`, labelled by the caption (or a\n * localized \"Progress\"); indeterminate drops `aria-valuenow` and sets `aria-busy`. Motion stops under\n * `prefers-reduced-motion`. Token-only. `forwardRef` to the root `<div>`.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n value,\n max = 100,\n variant = 'linear',\n size = 'md',\n color = 'accent',\n label,\n showValue = false,\n buffer,\n striped = false,\n animated = false,\n thresholds,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const labelId = useId()\n const indeterminate = value == null\n const safeMax = max > 0 ? max : 100\n const current = indeterminate ? 0 : clamp(value, 0, safeMax)\n const pct = (current / safeMax) * 100\n const bufferPct = buffer == null ? undefined : (clamp(buffer, 0, safeMax) / safeMax) * 100\n\n // quota UX: the fill turns warning / error as it crosses the thresholds (error wins)\n const resolvedColor: ThemeColor =\n !indeterminate && thresholds?.error != null && pct >= thresholds.error\n ? 'error'\n : !indeterminate && thresholds?.warning != null && pct >= thresholds.warning\n ? 'warning'\n : color\n\n const valueText = indeterminate\n ? undefined\n : typeof showValue === 'function'\n ? showValue(current, safeMax)\n : showValue\n ? `${Math.round(pct)}%`\n : undefined\n const ariaValueText = indeterminate\n ? t('common.loading')\n : typeof valueText === 'string'\n ? valueText\n : `${Math.round(pct)}%`\n\n const a11y = {\n role: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n 'aria-valuenow': indeterminate ? undefined : current,\n 'aria-valuetext': ariaValueText,\n 'aria-busy': indeterminate || undefined,\n ...(label != null ? { 'aria-labelledby': labelId } : { 'aria-label': t('progress.label') }),\n } as const\n\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`,\n ...style,\n } as CSSProperties\n\n if (variant === 'circular') {\n // pathLength=100 makes the dash math a plain percentage\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.circular, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n <div className={clsx(styles.ring, indeterminate && styles.spinning)} {...a11y}>\n <svg viewBox=\"0 0 36 36\" className={styles.svg} aria-hidden=\"true\">\n <circle className={styles.ringTrack} cx=\"18\" cy=\"18\" r=\"15.5\" pathLength={100} />\n <circle\n className={styles.ringFill}\n cx=\"18\"\n cy=\"18\"\n r=\"15.5\"\n pathLength={100}\n strokeDasharray={indeterminate ? '28 72' : `${pct} ${100 - pct}`}\n />\n </svg>\n {valueText != null && <span className={styles.ringValue}>{valueText}</span>}\n </div>\n {label != null && (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n )}\n </div>\n )\n }\n\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.linear, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n {(label != null || valueText != null) && (\n <div className={styles.header}>\n {label != null ? (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n ) : (\n <span />\n )}\n {valueText != null && <span className={styles.value}>{valueText}</span>}\n </div>\n )}\n <div className={clsx(styles.track, indeterminate && styles.indeterminate)} {...a11y}>\n {bufferPct != null && !indeterminate && (\n <div className={styles.buffer} style={{ width: `${bufferPct}%` }} />\n )}\n <div\n className={clsx(\n styles.fill,\n (striped || animated) && styles.striped,\n animated && styles.animated,\n )}\n style={indeterminate ? undefined : { width: `${pct}%` }}\n />\n </div>\n </div>\n )\n})\n"],"names":["clamp","n","lo","hi","Progress","forwardRef","value","max","variant","size","color","label","showValue","buffer","striped","animated","thresholds","className","style","props","ref","t","useT","labelId","useId","indeterminate","safeMax","current","pct","bufferPct","resolvedColor","valueText","ariaValueText","a11y","rootStyle","jsxs","clsx","styles","jsx"],"mappings":"m2BA4CMA,EAAQ,CAACC,EAAWC,EAAYC,IAAe,KAAK,IAAIA,EAAI,KAAK,IAAID,EAAID,CAAC,CAAC,EAapEG,GAAWC,EAAAA,WAA0C,SAChE,CACE,MAAAC,EACA,IAAAC,EAAM,IACN,QAAAC,EAAU,SACV,KAAAC,EAAO,KACP,MAAAC,EAAQ,SACR,MAAAC,EACA,UAAAC,EAAY,GACZ,OAAAC,EACA,QAAAC,EAAU,GACV,SAAAC,EAAW,GACX,WAAAC,EACA,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJC,EAAUC,EAAAA,MAAA,EACVC,EAAgBnB,GAAS,KACzBoB,EAAUnB,EAAM,EAAIA,EAAM,IAC1BoB,EAAUF,EAAgB,EAAIzB,EAAMM,EAAO,EAAGoB,CAAO,EACrDE,EAAOD,EAAUD,EAAW,IAC5BG,EAAYhB,GAAU,KAAO,OAAab,EAAMa,EAAQ,EAAGa,CAAO,EAAIA,EAAW,IAGjFI,EACJ,CAACL,IAAiBT,GAAA,YAAAA,EAAY,QAAS,MAAQY,GAAOZ,EAAW,MAC7D,QACA,CAACS,IAAiBT,GAAA,YAAAA,EAAY,UAAW,MAAQY,GAAOZ,EAAW,QACjE,UACAN,EAEFqB,EAAYN,EACd,OACA,OAAOb,GAAc,WACnBA,EAAUe,EAASD,CAAO,EAC1Bd,EACE,GAAG,KAAK,MAAMgB,CAAG,CAAC,IAClB,OACFI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EAONwB,EAAAA,KAAC,MAAA,CACC,IAAAf,EACA,UAAWgB,EAAAA,KAAKC,EAAO,KAAMA,EAAO,OAAQA,EAAO5B,CAAI,EAAGQ,CAAS,EACnE,MAAOiB,EACN,GAAGf,EAEF,SAAA,EAAAR,GAAS,MAAQoB,GAAa,cAC7B,MAAA,CAAI,UAAWM,EAAO,OACpB,SAAA,CAAA1B,GAAS,KACR2B,EAAAA,IAAC,OAAA,CAAK,GAAIf,EAAS,UAAWc,EAAO,QAClC,SAAA1B,CAAA,CACH,EAEA2B,EAAAA,IAAC,OAAA,EAAK,EAEPP,GAAa,MAAQO,EAAAA,IAAC,QAAK,UAAWD,EAAO,MAAQ,SAAAN,CAAA,CAAU,CAAA,EAClE,EAEFI,EAAAA,KAAC,MAAA,CAAI,UAAWC,EAAAA,KAAKC,EAAO,MAAOZ,GAAiBY,EAAO,aAAa,EAAI,GAAGJ,EAC5E,SAAA,CAAAJ,GAAa,MAAQ,CAACJ,GACrBa,EAAAA,IAAC,OAAI,UAAWD,EAAO,OAAQ,MAAO,CAAE,MAAO,GAAGR,CAAS,KAAO,EAEpES,EAAAA,IAAC,MAAA,CACC,UAAWF,EAAAA,KACTC,EAAO,MACNvB,GAAWC,IAAasB,EAAO,QAChCtB,GAAYsB,EAAO,QAAA,EAErB,MAAOZ,EAAgB,OAAY,CAAE,MAAO,GAAGG,CAAG,GAAA,CAAI,CAAA,CACxD,CAAA,CACF,CAAA,CAAA,CAAA,CAGN,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as I, useId as L } from "react";
|
|
3
3
|
import { clsx as l } from "clsx";
|
|
4
|
-
import { a as B } from "./ConfigProvider-
|
|
4
|
+
import { a as B } from "./ConfigProvider-Ct0Pe3Ku.js";
|
|
5
5
|
const C = "_root_1uzzo_4", D = "_caption_1uzzo_11", R = "_value_1uzzo_16", S = "_linear_1uzzo_23", q = "_sm_1uzzo_28", A = "_md_1uzzo_31", E = "_lg_1uzzo_34", G = "_header_1uzzo_38", H = "_track_1uzzo_45", J = "_buffer_1uzzo_52", K = "_fill_1uzzo_53", O = "_striped_1uzzo_69", Q = "_animated_1uzzo_82", U = "_indeterminate_1uzzo_95", W = "_circular_1uzzo_109", X = "_ring_1uzzo_128", Y = "_svg_1uzzo_136", Z = "_ringTrack_1uzzo_144", nn = "_ringFill_1uzzo_145", rn = "_ringValue_1uzzo_159", an = "_spinning_1uzzo_165", n = {
|
|
6
6
|
root: C,
|
|
7
7
|
caption: D,
|
|
@@ -116,4 +116,4 @@ const C = "_root_1uzzo_4", D = "_caption_1uzzo_11", R = "_value_1uzzo_16", S = "
|
|
|
116
116
|
export {
|
|
117
117
|
sn as P
|
|
118
118
|
};
|
|
119
|
-
//# sourceMappingURL=Progress-
|
|
119
|
+
//# sourceMappingURL=Progress-T7PLrJ0Y.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress-pTbaOSDd.js","sources":["../src/components/Progress/Progress.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Progress.module.css'\n\nexport type ProgressVariant = 'linear' | 'circular'\nexport type ProgressSize = 'sm' | 'md' | 'lg'\n\n/** Percentages (0–100) at which the color switches automatically — quota UX. */\nexport interface ProgressThresholds {\n /** From this percentage on, the bar turns `warning`. */\n warning?: number\n /** From this percentage on, the bar turns `error`. */\n error?: number\n}\n\nexport interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Current value, `0`–`max`. Omit it for an **indeterminate** progress (a moving bar / spinning arc). */\n value?: number\n /** The value that means \"done\". Defaults to `100`. */\n max?: number\n /** `linear` (default) — a bar; `circular` — a ring. */\n variant?: ProgressVariant\n /** Linear: bar thickness 4 / 6 / 8 px. Circular: ring 32 / 48 / 64 px. Defaults to `md`. */\n size?: ProgressSize\n /** Theme color of the fill. Defaults to `accent`. */\n color?: ThemeColor\n /** A caption — above the bar (left) for linear, under the ring for circular. Labels the progressbar. */\n label?: ReactNode\n /**\n * Show the value: `true` → the percentage (\"42%\"); a function → your own text, e.g.\n * `(v, max) => `${v} GB of ${max} GB``. Linear: right of the caption; circular: inside the ring.\n */\n showValue?: boolean | ((value: number, max: number) => ReactNode)\n /** A second, lighter bar behind the fill (buffered / pending amount), `0`–`max`. Linear only. */\n buffer?: number\n /** Diagonal stripes on the fill. Linear only. */\n striped?: boolean\n /** Animate the stripes (implies `striped`). Linear only. Off under `prefers-reduced-motion`. */\n animated?: boolean\n /** Switch the color automatically by percentage (e.g. `{ warning: 80, error: 95 }` for a quota). */\n thresholds?: ProgressThresholds\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, n))\n\n/**\n * A progress indicator — **linear** (a bar) or **circular** (a ring) — for uploads, wizard steps, quotas and\n * background jobs. Determinate with `value` / `max`, or **indeterminate** without `value` (a moving bar / a\n * spinning arc). An optional caption (`label`) and value readout (`showValue` — the percentage or your own\n * formatter), a lighter `buffer` bar, `striped` / `animated` fills, and `thresholds` that turn the fill\n * `warning` / `error` as it fills up. Tinted by `color` through the shared `--tz-btn-rgb` pattern; the track is\n * `primary-shade200`, the bar is pill-rounded (so the global `square` shape flattens it). A11y:\n * `role=\"progressbar\"` with `aria-valuemin/max/now` + `aria-valuetext`, labelled by the caption (or a\n * localized \"Progress\"); indeterminate drops `aria-valuenow` and sets `aria-busy`. Motion stops under\n * `prefers-reduced-motion`. Token-only. `forwardRef` to the root `<div>`.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n value,\n max = 100,\n variant = 'linear',\n size = 'md',\n color = 'accent',\n label,\n showValue = false,\n buffer,\n striped = false,\n animated = false,\n thresholds,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const labelId = useId()\n const indeterminate = value == null\n const safeMax = max > 0 ? max : 100\n const current = indeterminate ? 0 : clamp(value, 0, safeMax)\n const pct = (current / safeMax) * 100\n const bufferPct = buffer == null ? undefined : (clamp(buffer, 0, safeMax) / safeMax) * 100\n\n // quota UX: the fill turns warning / error as it crosses the thresholds (error wins)\n const resolvedColor: ThemeColor =\n !indeterminate && thresholds?.error != null && pct >= thresholds.error\n ? 'error'\n : !indeterminate && thresholds?.warning != null && pct >= thresholds.warning\n ? 'warning'\n : color\n\n const valueText = indeterminate\n ? undefined\n : typeof showValue === 'function'\n ? showValue(current, safeMax)\n : showValue\n ? `${Math.round(pct)}%`\n : undefined\n const ariaValueText = indeterminate\n ? t('common.loading')\n : typeof valueText === 'string'\n ? valueText\n : `${Math.round(pct)}%`\n\n const a11y = {\n role: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n 'aria-valuenow': indeterminate ? undefined : current,\n 'aria-valuetext': ariaValueText,\n 'aria-busy': indeterminate || undefined,\n ...(label != null ? { 'aria-labelledby': labelId } : { 'aria-label': t('progress.label') }),\n } as const\n\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`,\n ...style,\n } as CSSProperties\n\n if (variant === 'circular') {\n // pathLength=100 makes the dash math a plain percentage\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.circular, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n <div className={clsx(styles.ring, indeterminate && styles.spinning)} {...a11y}>\n <svg viewBox=\"0 0 36 36\" className={styles.svg} aria-hidden=\"true\">\n <circle className={styles.ringTrack} cx=\"18\" cy=\"18\" r=\"15.5\" pathLength={100} />\n <circle\n className={styles.ringFill}\n cx=\"18\"\n cy=\"18\"\n r=\"15.5\"\n pathLength={100}\n strokeDasharray={indeterminate ? '28 72' : `${pct} ${100 - pct}`}\n />\n </svg>\n {valueText != null && <span className={styles.ringValue}>{valueText}</span>}\n </div>\n {label != null && (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n )}\n </div>\n )\n }\n\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.linear, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n {(label != null || valueText != null) && (\n <div className={styles.header}>\n {label != null ? (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n ) : (\n <span />\n )}\n {valueText != null && <span className={styles.value}>{valueText}</span>}\n </div>\n )}\n <div className={clsx(styles.track, indeterminate && styles.indeterminate)} {...a11y}>\n {bufferPct != null && !indeterminate && (\n <div className={styles.buffer} style={{ width: `${bufferPct}%` }} />\n )}\n <div\n className={clsx(\n styles.fill,\n (striped || animated) && styles.striped,\n animated && styles.animated,\n )}\n style={indeterminate ? undefined : { width: `${pct}%` }}\n />\n </div>\n </div>\n )\n})\n"],"names":["clamp","n","lo","hi","Progress","forwardRef","value","max","variant","size","color","label","showValue","buffer","striped","animated","thresholds","className","style","props","ref","t","useT","labelId","useId","indeterminate","safeMax","current","pct","bufferPct","resolvedColor","valueText","ariaValueText","a11y","rootStyle","jsxs","clsx","styles","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CMA,IAAQ,CAACC,GAAWC,GAAYC,MAAe,KAAK,IAAIA,GAAI,KAAK,IAAID,GAAID,CAAC,CAAC,GAapEG,KAAWC,EAA0C,SAChE;AAAA,EACE,OAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,QAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJC,IAAUC,EAAA,GACVC,IAAgBnB,KAAS,MACzBoB,IAAUnB,IAAM,IAAIA,IAAM,KAC1BoB,IAAUF,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,EAAKC,EAAO,OAAOZ,KAAiBY,EAAO,aAAa,GAAI,GAAGJ,GAC5E,UAAA;AAAA,UAAAJ,KAAa,QAAQ,CAACJ,KACrB,gBAAAa,EAAC,SAAI,WAAWD,EAAO,QAAQ,OAAO,EAAE,OAAO,GAAGR,CAAS,OAAO;AAAA,UAEpE,gBAAAS;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWF;AAAA,gBACTC,EAAO;AAAA,iBACNvB,KAAWC,MAAasB,EAAO;AAAA,gBAChCtB,KAAYsB,EAAO;AAAA,cAAA;AAAA,cAErB,OAAOZ,IAAgB,SAAY,EAAE,OAAO,GAAGG,CAAG,IAAA;AAAA,YAAI;AAAA,UAAA;AAAA,QACxD,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Progress-T7PLrJ0Y.js","sources":["../src/components/Progress/Progress.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT, type ThemeColor } from '../../theme'\nimport styles from './Progress.module.css'\n\nexport type ProgressVariant = 'linear' | 'circular'\nexport type ProgressSize = 'sm' | 'md' | 'lg'\n\n/** Percentages (0–100) at which the color switches automatically — quota UX. */\nexport interface ProgressThresholds {\n /** From this percentage on, the bar turns `warning`. */\n warning?: number\n /** From this percentage on, the bar turns `error`. */\n error?: number\n}\n\nexport interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'> {\n /** Current value, `0`–`max`. Omit it for an **indeterminate** progress (a moving bar / spinning arc). */\n value?: number\n /** The value that means \"done\". Defaults to `100`. */\n max?: number\n /** `linear` (default) — a bar; `circular` — a ring. */\n variant?: ProgressVariant\n /** Linear: bar thickness 4 / 6 / 8 px. Circular: ring 32 / 48 / 64 px. Defaults to `md`. */\n size?: ProgressSize\n /** Theme color of the fill. Defaults to `accent`. */\n color?: ThemeColor\n /** A caption — above the bar (left) for linear, under the ring for circular. Labels the progressbar. */\n label?: ReactNode\n /**\n * Show the value: `true` → the percentage (\"42%\"); a function → your own text, e.g.\n * `(v, max) => `${v} GB of ${max} GB``. Linear: right of the caption; circular: inside the ring.\n */\n showValue?: boolean | ((value: number, max: number) => ReactNode)\n /** A second, lighter bar behind the fill (buffered / pending amount), `0`–`max`. Linear only. */\n buffer?: number\n /** Diagonal stripes on the fill. Linear only. */\n striped?: boolean\n /** Animate the stripes (implies `striped`). Linear only. Off under `prefers-reduced-motion`. */\n animated?: boolean\n /** Switch the color automatically by percentage (e.g. `{ warning: 80, error: 95 }` for a quota). */\n thresholds?: ProgressThresholds\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, n))\n\n/**\n * A progress indicator — **linear** (a bar) or **circular** (a ring) — for uploads, wizard steps, quotas and\n * background jobs. Determinate with `value` / `max`, or **indeterminate** without `value` (a moving bar / a\n * spinning arc). An optional caption (`label`) and value readout (`showValue` — the percentage or your own\n * formatter), a lighter `buffer` bar, `striped` / `animated` fills, and `thresholds` that turn the fill\n * `warning` / `error` as it fills up. Tinted by `color` through the shared `--tz-btn-rgb` pattern; the track is\n * `primary-shade200`, the bar is pill-rounded (so the global `square` shape flattens it). A11y:\n * `role=\"progressbar\"` with `aria-valuemin/max/now` + `aria-valuetext`, labelled by the caption (or a\n * localized \"Progress\"); indeterminate drops `aria-valuenow` and sets `aria-busy`. Motion stops under\n * `prefers-reduced-motion`. Token-only. `forwardRef` to the root `<div>`.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n value,\n max = 100,\n variant = 'linear',\n size = 'md',\n color = 'accent',\n label,\n showValue = false,\n buffer,\n striped = false,\n animated = false,\n thresholds,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const labelId = useId()\n const indeterminate = value == null\n const safeMax = max > 0 ? max : 100\n const current = indeterminate ? 0 : clamp(value, 0, safeMax)\n const pct = (current / safeMax) * 100\n const bufferPct = buffer == null ? undefined : (clamp(buffer, 0, safeMax) / safeMax) * 100\n\n // quota UX: the fill turns warning / error as it crosses the thresholds (error wins)\n const resolvedColor: ThemeColor =\n !indeterminate && thresholds?.error != null && pct >= thresholds.error\n ? 'error'\n : !indeterminate && thresholds?.warning != null && pct >= thresholds.warning\n ? 'warning'\n : color\n\n const valueText = indeterminate\n ? undefined\n : typeof showValue === 'function'\n ? showValue(current, safeMax)\n : showValue\n ? `${Math.round(pct)}%`\n : undefined\n const ariaValueText = indeterminate\n ? t('common.loading')\n : typeof valueText === 'string'\n ? valueText\n : `${Math.round(pct)}%`\n\n const a11y = {\n role: 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': safeMax,\n 'aria-valuenow': indeterminate ? undefined : current,\n 'aria-valuetext': ariaValueText,\n 'aria-busy': indeterminate || undefined,\n ...(label != null ? { 'aria-labelledby': labelId } : { 'aria-label': t('progress.label') }),\n } as const\n\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`,\n ...style,\n } as CSSProperties\n\n if (variant === 'circular') {\n // pathLength=100 makes the dash math a plain percentage\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.circular, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n <div className={clsx(styles.ring, indeterminate && styles.spinning)} {...a11y}>\n <svg viewBox=\"0 0 36 36\" className={styles.svg} aria-hidden=\"true\">\n <circle className={styles.ringTrack} cx=\"18\" cy=\"18\" r=\"15.5\" pathLength={100} />\n <circle\n className={styles.ringFill}\n cx=\"18\"\n cy=\"18\"\n r=\"15.5\"\n pathLength={100}\n strokeDasharray={indeterminate ? '28 72' : `${pct} ${100 - pct}`}\n />\n </svg>\n {valueText != null && <span className={styles.ringValue}>{valueText}</span>}\n </div>\n {label != null && (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n )}\n </div>\n )\n }\n\n return (\n <div\n ref={ref}\n className={clsx(styles.root, styles.linear, styles[size], className)}\n style={rootStyle}\n {...props}\n >\n {(label != null || valueText != null) && (\n <div className={styles.header}>\n {label != null ? (\n <span id={labelId} className={styles.caption}>\n {label}\n </span>\n ) : (\n <span />\n )}\n {valueText != null && <span className={styles.value}>{valueText}</span>}\n </div>\n )}\n <div className={clsx(styles.track, indeterminate && styles.indeterminate)} {...a11y}>\n {bufferPct != null && !indeterminate && (\n <div className={styles.buffer} style={{ width: `${bufferPct}%` }} />\n )}\n <div\n className={clsx(\n styles.fill,\n (striped || animated) && styles.striped,\n animated && styles.animated,\n )}\n style={indeterminate ? undefined : { width: `${pct}%` }}\n />\n </div>\n </div>\n )\n})\n"],"names":["clamp","n","lo","hi","Progress","forwardRef","value","max","variant","size","color","label","showValue","buffer","striped","animated","thresholds","className","style","props","ref","t","useT","labelId","useId","indeterminate","safeMax","current","pct","bufferPct","resolvedColor","valueText","ariaValueText","a11y","rootStyle","jsxs","clsx","styles","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CMA,IAAQ,CAACC,GAAWC,GAAYC,MAAe,KAAK,IAAIA,GAAI,KAAK,IAAID,GAAID,CAAC,CAAC,GAapEG,KAAWC,EAA0C,SAChE;AAAA,EACE,OAAAC;AAAA,EACA,KAAAC,IAAM;AAAA,EACN,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,QAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJC,IAAUC,EAAA,GACVC,IAAgBnB,KAAS,MACzBoB,IAAUnB,IAAM,IAAIA,IAAM,KAC1BoB,IAAUF,IAAgB,IAAIzB,EAAMM,GAAO,GAAGoB,CAAO,GACrDE,IAAOD,IAAUD,IAAW,KAC5B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UAAAJ,KAAa,QAAQ,CAACJ,KACrB,gBAAAa,EAAC,SAAI,WAAWD,EAAO,QAAQ,OAAO,EAAE,OAAO,GAAGR,CAAS,OAAO;AAAA,UAEpE,gBAAAS;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWF;AAAA,gBACTC,EAAO;AAAA,iBACNvB,KAAWC,MAAasB,EAAO;AAAA,gBAChCtB,KAAYsB,EAAO;AAAA,cAAA;AAAA,cAErB,OAAOZ,IAAgB,SAAY,EAAE,OAAO,GAAGG,CAAG,IAAA;AAAA,YAAI;AAAA,UAAA;AAAA,QACxD,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const s=require("react/jsx-runtime"),i=require("react"),c=require("./ErrorBoundary-
|
|
2
|
-
//# sourceMappingURL=QueryError-
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),i=require("react"),c=require("./ErrorBoundary-gRGxeuM1.cjs"),a=i.forwardRef(function({error:r,fallback:e,description:t,compact:u=!0,...n},o){return r==null||r===!1?null:s.jsx(c.ErrorState,{ref:o,error:r,description:t??e,compact:u,...n})});exports.QueryError=a;
|
|
2
|
+
//# sourceMappingURL=QueryError-DP22IUnp.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryError-
|
|
1
|
+
{"version":3,"file":"QueryError-DP22IUnp.cjs","sources":["../src/components/ErrorState/QueryError.tsx"],"sourcesContent":["import { forwardRef, type ReactNode } from 'react'\nimport { ErrorState, type ErrorStateProps } from './ErrorState'\n\nexport interface QueryErrorProps extends ErrorStateProps {\n /** The query's error (`query.error`). `null` / `undefined` → renders nothing. */\n error: unknown\n /**\n * The user-facing sentence (\"Could not load players.\"). Shown instead of the raw message, which then\n * only appears in the (dev) details panel. Same as `description`, which wins when both are set.\n */\n fallback?: ReactNode\n}\n\n/**\n * The react-query-style one-liner: `<QueryError error={users.error} onRetry={users.refetch}\n * fallback=\"Could not load players.\" />`. Renders nothing while `error` is empty, otherwise an\n * `ErrorState` — **compact by default** (it usually sits where the data would, inside a card or table\n * area; pass `compact={false}` for the hero). Everything else passes through to `ErrorState`.\n */\nexport const QueryError = forwardRef<HTMLDivElement, QueryErrorProps>(function QueryError(\n { error, fallback, description, compact = true, ...props },\n ref,\n) {\n if (error == null || error === false) return null\n return (\n <ErrorState\n ref={ref}\n error={error}\n description={description ?? fallback}\n compact={compact}\n {...props}\n />\n )\n})\n"],"names":["QueryError","forwardRef","error","fallback","description","compact","props","ref","jsx","ErrorState"],"mappings":"+GAmBaA,EAAaC,EAAAA,WAA4C,SACpE,CAAE,MAAAC,EAAO,SAAAC,EAAU,YAAAC,EAAa,QAAAC,EAAU,GAAM,GAAGC,CAAA,EACnDC,EACA,CACA,OAAIL,GAAS,MAAQA,IAAU,GAAc,KAE3CM,EAAAA,IAACC,EAAAA,WAAA,CACC,IAAAF,EACA,MAAAL,EACA,YAAaE,GAAeD,EAC5B,QAAAE,EACC,GAAGC,CAAA,CAAA,CAGV,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as i } from "react";
|
|
3
|
-
import { a } from "./ErrorBoundary-
|
|
3
|
+
import { a } from "./ErrorBoundary-B-37hGZW.js";
|
|
4
4
|
const c = i(function({ error: r, fallback: o, description: t, compact: e = !0, ...f }, n) {
|
|
5
5
|
return r == null || r === !1 ? null : /* @__PURE__ */ u(
|
|
6
6
|
a,
|
|
@@ -16,4 +16,4 @@ const c = i(function({ error: r, fallback: o, description: t, compact: e = !0, .
|
|
|
16
16
|
export {
|
|
17
17
|
c as Q
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=QueryError-
|
|
19
|
+
//# sourceMappingURL=QueryError-Dtspj9l4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryError-
|
|
1
|
+
{"version":3,"file":"QueryError-Dtspj9l4.js","sources":["../src/components/ErrorState/QueryError.tsx"],"sourcesContent":["import { forwardRef, type ReactNode } from 'react'\nimport { ErrorState, type ErrorStateProps } from './ErrorState'\n\nexport interface QueryErrorProps extends ErrorStateProps {\n /** The query's error (`query.error`). `null` / `undefined` → renders nothing. */\n error: unknown\n /**\n * The user-facing sentence (\"Could not load players.\"). Shown instead of the raw message, which then\n * only appears in the (dev) details panel. Same as `description`, which wins when both are set.\n */\n fallback?: ReactNode\n}\n\n/**\n * The react-query-style one-liner: `<QueryError error={users.error} onRetry={users.refetch}\n * fallback=\"Could not load players.\" />`. Renders nothing while `error` is empty, otherwise an\n * `ErrorState` — **compact by default** (it usually sits where the data would, inside a card or table\n * area; pass `compact={false}` for the hero). Everything else passes through to `ErrorState`.\n */\nexport const QueryError = forwardRef<HTMLDivElement, QueryErrorProps>(function QueryError(\n { error, fallback, description, compact = true, ...props },\n ref,\n) {\n if (error == null || error === false) return null\n return (\n <ErrorState\n ref={ref}\n error={error}\n description={description ?? fallback}\n compact={compact}\n {...props}\n />\n )\n})\n"],"names":["QueryError","forwardRef","error","fallback","description","compact","props","ref","jsx","ErrorState"],"mappings":";;;AAmBO,MAAMA,IAAaC,EAA4C,SACpE,EAAE,OAAAC,GAAO,UAAAC,GAAU,aAAAC,GAAa,SAAAC,IAAU,IAAM,GAAGC,EAAA,GACnDC,GACA;AACA,SAAIL,KAAS,QAAQA,MAAU,KAAc,OAE3C,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,OAAAL;AAAA,MACA,aAAaE,KAAeD;AAAA,MAC5B,SAAAE;AAAA,MACC,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { jsx as s, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as D, createContext as P, forwardRef as j, useId as S, useState as B } from "react";
|
|
3
|
+
import { clsx as h } from "clsx";
|
|
4
|
+
import { u as $ } from "./formContext-B7ln1Miy.js";
|
|
5
|
+
import { T as A } from "./Typography-CJv5AnRP.js";
|
|
6
|
+
const E = P(null);
|
|
7
|
+
function H() {
|
|
8
|
+
return D(E);
|
|
9
|
+
}
|
|
10
|
+
const J = "_field_iusre_2", K = "_row_iusre_9", M = "_disabled_iusre_21", O = "_input_iusre_27", Q = "_circle_iusre_41", U = "_dot_iusre_63", W = "_error_iusre_77", X = "_label_iusre_81", Y = "_required_iusre_86", Z = "_sm_iusre_92", ee = "_md_iusre_96", re = "_lg_iusre_100", se = "_group_iusre_116", oe = "_groupLabel_iusre_123", le = "_options_iusre_128", ae = "_horizontal_iusre_134", r = {
|
|
11
|
+
field: J,
|
|
12
|
+
row: K,
|
|
13
|
+
disabled: M,
|
|
14
|
+
input: O,
|
|
15
|
+
circle: Q,
|
|
16
|
+
dot: U,
|
|
17
|
+
error: W,
|
|
18
|
+
label: X,
|
|
19
|
+
required: Y,
|
|
20
|
+
sm: Z,
|
|
21
|
+
md: ee,
|
|
22
|
+
lg: re,
|
|
23
|
+
group: se,
|
|
24
|
+
groupLabel: oe,
|
|
25
|
+
options: le,
|
|
26
|
+
horizontal: ae
|
|
27
|
+
}, ie = j(function({
|
|
28
|
+
value: a,
|
|
29
|
+
label: d,
|
|
30
|
+
color: N,
|
|
31
|
+
size: c,
|
|
32
|
+
error: o,
|
|
33
|
+
checked: t,
|
|
34
|
+
onChange: u,
|
|
35
|
+
name: x,
|
|
36
|
+
disabled: z,
|
|
37
|
+
id: R,
|
|
38
|
+
className: y,
|
|
39
|
+
style: g,
|
|
40
|
+
...C
|
|
41
|
+
}, w) {
|
|
42
|
+
const I = S(), m = R ?? I, e = H(), i = N ?? (e == null ? void 0 : e.color) ?? "accent", f = c ?? (e == null ? void 0 : e.size) ?? "md", n = o ?? (e == null ? void 0 : e.error) ?? !1, _ = z ?? (e == null ? void 0 : e.disabled) ?? !1, v = x ?? (e == null ? void 0 : e.name), [b, q] = B(!1), G = e ? e.value === a : t !== void 0 ? t : b, L = (p) => {
|
|
43
|
+
if (e) {
|
|
44
|
+
e.onChange(a);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
t === void 0 && q(p.target.checked), u == null || u(p.target.checked);
|
|
48
|
+
};
|
|
49
|
+
return /* @__PURE__ */ s(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: h(
|
|
53
|
+
r.field,
|
|
54
|
+
n && r.error,
|
|
55
|
+
_ && r.disabled,
|
|
56
|
+
y
|
|
57
|
+
),
|
|
58
|
+
style: { "--tz-btn-rgb": `var(--tz-color-${i}-rgb)`, ...g },
|
|
59
|
+
children: /* @__PURE__ */ k("label", { className: h(r.row, r[f]), children: [
|
|
60
|
+
/* @__PURE__ */ s(
|
|
61
|
+
"input",
|
|
62
|
+
{
|
|
63
|
+
ref: w,
|
|
64
|
+
id: m,
|
|
65
|
+
name: v,
|
|
66
|
+
type: "radio",
|
|
67
|
+
className: r.input,
|
|
68
|
+
value: a,
|
|
69
|
+
checked: G,
|
|
70
|
+
onChange: L,
|
|
71
|
+
disabled: _,
|
|
72
|
+
"aria-invalid": n || void 0,
|
|
73
|
+
...C
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ s("span", { className: r.circle, "aria-hidden": "true", children: /* @__PURE__ */ s("span", { className: r.dot }) }),
|
|
77
|
+
d != null && /* @__PURE__ */ s("span", { className: r.label, children: d })
|
|
78
|
+
] })
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}), me = j(function({
|
|
82
|
+
label: a,
|
|
83
|
+
value: d,
|
|
84
|
+
defaultValue: N,
|
|
85
|
+
onChange: c,
|
|
86
|
+
name: o,
|
|
87
|
+
options: t,
|
|
88
|
+
orientation: u = "vertical",
|
|
89
|
+
size: x = "md",
|
|
90
|
+
color: z = "accent",
|
|
91
|
+
error: R,
|
|
92
|
+
required: y = !1,
|
|
93
|
+
disabled: g = !1,
|
|
94
|
+
children: C,
|
|
95
|
+
className: w,
|
|
96
|
+
style: I,
|
|
97
|
+
...m
|
|
98
|
+
}, e) {
|
|
99
|
+
const i = $(), f = !!(i && o), n = i && o ? i.field(o) : void 0, _ = d !== void 0 ? d : f ? i.values[o] : void 0, v = _ !== void 0, b = S(), q = S(), [G, L] = B(N), p = v ? _ : G, V = R ?? (n == null ? void 0 : n.error) ?? !1, T = {
|
|
100
|
+
name: o ?? q,
|
|
101
|
+
value: p,
|
|
102
|
+
onChange: (l) => {
|
|
103
|
+
v || L(l), f && i.setValue(o, l), c == null || c(l);
|
|
104
|
+
},
|
|
105
|
+
size: x,
|
|
106
|
+
color: z,
|
|
107
|
+
disabled: g,
|
|
108
|
+
error: V
|
|
109
|
+
};
|
|
110
|
+
return /* @__PURE__ */ k(
|
|
111
|
+
"div",
|
|
112
|
+
{
|
|
113
|
+
ref: e,
|
|
114
|
+
role: "radiogroup",
|
|
115
|
+
"aria-labelledby": a != null && m["aria-label"] == null ? b : void 0,
|
|
116
|
+
"aria-invalid": V || void 0,
|
|
117
|
+
className: h(r.group, w),
|
|
118
|
+
style: I,
|
|
119
|
+
...m,
|
|
120
|
+
children: [
|
|
121
|
+
a != null && /* @__PURE__ */ k("span", { id: b, className: r.groupLabel, children: [
|
|
122
|
+
/* @__PURE__ */ s(A, { as: "span", variant: "bodySmall", color: "muted", children: a }),
|
|
123
|
+
y && /* @__PURE__ */ s("span", { className: r.required, "aria-hidden": "true", children: "*" })
|
|
124
|
+
] }),
|
|
125
|
+
/* @__PURE__ */ s("div", { className: h(r.options, u === "horizontal" && r.horizontal), children: /* @__PURE__ */ s(E.Provider, { value: T, children: t ? t.map((l) => /* @__PURE__ */ s(
|
|
126
|
+
ie,
|
|
127
|
+
{
|
|
128
|
+
value: l.value,
|
|
129
|
+
label: l.label,
|
|
130
|
+
disabled: l.disabled
|
|
131
|
+
},
|
|
132
|
+
l.value
|
|
133
|
+
)) : C }) })
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
});
|
|
138
|
+
export {
|
|
139
|
+
ie as R,
|
|
140
|
+
me as a
|
|
141
|
+
};
|
|
142
|
+
//# sourceMappingURL=RadioGroup-CTAayuMv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup-CTAayuMv.js","sources":["../src/components/Radio/radioContext.ts","../src/components/Radio/Radio.tsx","../src/components/Radio/RadioGroup.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { ThemeColor } from '../../theme'\nimport type { RadioSize } from './Radio'\n\n/** Shared state a `<RadioGroup>` hands down to its `<Radio>` children via context. */\nexport interface RadioGroupContextValue {\n /** Shared input `name` (the radios in a group must share one). */\n name?: string\n /** The group's currently-selected value. */\n value?: string\n /** Select a value — called by a child `<Radio>` on change. */\n onChange: (value: string) => void\n size?: RadioSize\n color?: ThemeColor\n disabled?: boolean\n error?: boolean\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue | null>(null)\n\n/** Read the surrounding `<RadioGroup>` so a `<Radio>` can wire itself in (or `null` when standalone). */\nexport function useRadioGroupContext(): RadioGroupContextValue | null {\n return useContext(RadioGroupContext)\n}\n","import {\n forwardRef,\n useId,\n useState,\n type ChangeEvent,\n type CSSProperties,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { useRadioGroupContext } from './radioContext'\nimport styles from './Radio.module.css'\n\nexport type RadioSize = 'sm' | 'md' | 'lg'\n\nexport interface RadioProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'color' | 'type' | 'onChange' | 'value'\n> {\n /** This option's value — selected when it matches the surrounding `RadioGroup`'s value. */\n value: string\n /** Text shown to the right of the control. */\n label?: ReactNode\n /** Theme palette token for the selected fill. Defaults to `accent` (inherits the group's `color`). */\n color?: ThemeColor\n /** Preset size — circle dimensions and label font. Inherits the group's `size` when omitted. */\n size?: RadioSize\n /** Marks the control invalid — reddens the ring. Inherits the group's `error`. */\n error?: boolean\n /** Controlled selected state for standalone use (inside a `RadioGroup` the group drives this). */\n checked?: boolean\n /** Fires with the next selected state (standalone use). */\n onChange?: (checked: boolean) => void\n}\n\n/**\n * A single radio button with a label. The native `<input type=\"radio\">` is visually hidden but fully\n * accessible; a styled circle shows the state, filling with `color` and an inner dot when selected.\n * Designed to live inside a `<RadioGroup>` (which supplies the shared `name`, selection and\n * `size`/`color`/`disabled`/`error` via context), but also works standalone (`checked` + `onChange`).\n * Styling uses `--tz-*` tokens only.\n */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n {\n value,\n label,\n color,\n size,\n error,\n checked,\n onChange,\n name,\n disabled,\n id: idProp,\n className,\n style,\n ...props\n },\n ref,\n) {\n const reactId = useId()\n const id = idProp ?? reactId\n const group = useRadioGroupContext()\n\n const resolvedColor = color ?? group?.color ?? 'accent'\n const resolvedSize = size ?? group?.size ?? 'md'\n const resolvedError = error ?? group?.error ?? false\n const resolvedDisabled = disabled ?? group?.disabled ?? false\n const resolvedName = name ?? group?.name\n\n // In a group the selection comes from context; standalone it's controlled (`checked`) or local.\n const [internal, setInternal] = useState(false)\n const isChecked = group ? group.value === value : checked !== undefined ? checked : internal\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (group) {\n group.onChange(value)\n return\n }\n if (checked === undefined) setInternal(event.target.checked)\n onChange?.(event.target.checked)\n }\n\n return (\n <div\n className={clsx(\n styles.field,\n resolvedError && styles.error,\n resolvedDisabled && styles.disabled,\n className,\n )}\n style={{ '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`, ...style } as CSSProperties}\n >\n <label className={clsx(styles.row, styles[resolvedSize])}>\n <input\n ref={ref}\n id={id}\n name={resolvedName}\n type=\"radio\"\n className={styles.input}\n value={value}\n checked={isChecked}\n onChange={handleChange}\n disabled={resolvedDisabled}\n aria-invalid={resolvedError || undefined}\n {...props}\n />\n <span className={styles.circle} aria-hidden=\"true\">\n <span className={styles.dot} />\n </span>\n {label != null && <span className={styles.label}>{label}</span>}\n </label>\n </div>\n )\n})\n","import {\n forwardRef,\n useId,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport { Radio, type RadioSize } from './Radio'\nimport { RadioGroupContext, type RadioGroupContextValue } from './radioContext'\nimport styles from './Radio.module.css'\n\nexport type RadioOrientation = 'vertical' | 'horizontal'\n\n/** A single option for the data-driven `options` prop. */\nexport interface RadioOption {\n value: string\n label?: ReactNode\n disabled?: boolean\n}\n\nexport interface RadioGroupProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue'\n> {\n /** Group label rendered above the options. */\n label?: ReactNode\n /** Controlled selected value. */\n value?: string\n /** Initial value for uncontrolled use. */\n defaultValue?: string\n /** Fires with the newly-selected value. */\n onChange?: (value: string) => void\n /** Shared input `name` for the radios (also the `<Form>` binding key). */\n name?: string\n /** Data-driven options — an alternative to passing `<Radio>` children. */\n options?: RadioOption[]\n /** Stack direction of the options. Defaults to `vertical`. */\n orientation?: RadioOrientation\n /** Preset size for every radio. Defaults to `md`. */\n size?: RadioSize\n /** Theme palette token for the selected fill. Defaults to `accent`. */\n color?: ThemeColor\n /** Marks the group invalid — reddens the radio rings (no message text, like `Checkbox`). */\n error?: boolean\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Disables every radio in the group. */\n disabled?: boolean\n /** `<Radio>` children (used when `options` is not given). */\n children?: ReactNode\n}\n\n/**\n * Groups radio buttons so exactly one is selected. Supplies the shared `name`, selection and\n * `size`/`color`/`disabled`/`error` to its `<Radio>` children via context — pass them as `children`\n * or, for the common case, via the data-driven `options` prop. Controlled (`value` + `onChange`) or\n * uncontrolled (`defaultValue`), and binds to a surrounding `<Form>` by `name` (its form value is a\n * `string`; validate with e.g. `z.string().min(1)`). `error` reddens the radio rings (no message text,\n * like `Checkbox`). `role=\"radiogroup\"`, named by its `label` (`aria-labelledby`); styling uses `--tz-*` tokens.\n */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function RadioGroup(\n {\n label,\n value,\n defaultValue,\n onChange,\n name,\n options,\n orientation = 'vertical',\n size = 'md',\n color = 'accent',\n error,\n required = false,\n disabled = false,\n children,\n className,\n style,\n ...props\n },\n ref,\n) {\n // Auto-bind to a surrounding <Form> by `name` — the form value is the selected string.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: string | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? (form!.values[name!] as string | undefined)\n : undefined\n const isControlled = externalValue !== undefined\n // the visible label names the group for assistive tech (an explicit aria-label/-labelledby wins)\n const labelId = useId()\n // without a `name` the inputs wouldn't form a native radio group (every option its own tab stop, no\n // arrow-key selection) — fall back to a generated one for the DOM only; `<Form>` binding still keys off `name`\n const fallbackName = useId()\n const [internal, setInternal] = useState<string | undefined>(defaultValue)\n const currentValue = isControlled ? externalValue : internal\n\n const resolvedError = error ?? bound?.error ?? false\n\n const handleChange = (next: string) => {\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n }\n\n const ctx: RadioGroupContextValue = {\n name: name ?? fallbackName,\n value: currentValue,\n onChange: handleChange,\n size,\n color,\n disabled,\n error: resolvedError,\n }\n\n return (\n <div\n ref={ref}\n role=\"radiogroup\"\n aria-labelledby={label != null && props['aria-label'] == null ? labelId : undefined}\n aria-invalid={resolvedError || undefined}\n className={clsx(styles.group, className)}\n style={style as CSSProperties}\n {...props}\n >\n {label != null && (\n <span id={labelId} className={styles.groupLabel}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </span>\n )}\n\n <div className={clsx(styles.options, orientation === 'horizontal' && styles.horizontal)}>\n <RadioGroupContext.Provider value={ctx}>\n {options\n ? options.map((option) => (\n <Radio\n key={option.value}\n value={option.value}\n label={option.label}\n disabled={option.disabled}\n />\n ))\n : children}\n </RadioGroupContext.Provider>\n </div>\n </div>\n )\n})\n"],"names":["RadioGroupContext","createContext","useRadioGroupContext","useContext","Radio","forwardRef","value","label","color","size","error","checked","onChange","name","disabled","idProp","className","style","props","ref","reactId","useId","id","group","resolvedColor","resolvedSize","resolvedError","resolvedDisabled","resolvedName","internal","setInternal","useState","isChecked","handleChange","event","jsx","clsx","styles","jsxs","RadioGroup","defaultValue","options","orientation","required","children","form","useFormContext","isFormBound","bound","externalValue","isControlled","labelId","fallbackName","currentValue","ctx","next","Typography","option"],"mappings":";;;;;AAkBO,MAAMA,IAAoBC,EAA6C,IAAI;AAG3E,SAASC,IAAsD;AACpE,SAAOC,EAAWH,CAAiB;AACrC;;;;;;;;;;;;;;;;;;GCoBaI,KAAQC,EAAyC,SAC5D;AAAA,EACE,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,IAAIC;AAAA,EACJ,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAUC,EAAA,GACVC,IAAKP,KAAUK,GACfG,IAAQrB,EAAA,GAERsB,IAAgBhB,MAASe,KAAA,gBAAAA,EAAO,UAAS,UACzCE,IAAehB,MAAQc,KAAA,gBAAAA,EAAO,SAAQ,MACtCG,IAAgBhB,MAASa,KAAA,gBAAAA,EAAO,UAAS,IACzCI,IAAmBb,MAAYS,KAAA,gBAAAA,EAAO,aAAY,IAClDK,IAAef,MAAQU,KAAA,gBAAAA,EAAO,OAG9B,CAACM,GAAUC,CAAW,IAAIC,EAAS,EAAK,GACxC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OAAAC;AAAA,MACC,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAX,KAAS,QACR,gBAAA+B,EAAC,QAAA,EAAK,IAAIa,GAAS,WAAWd,EAAO,YACnC,UAAA;AAAA,UAAA,gBAAAF,EAACqB,KAAW,IAAG,QAAO,SAAQ,aAAY,OAAM,SAC7C,UAAAjD,EAAA,CACH;AAAA,UACCoC,uBACE,QAAA,EAAK,WAAWN,EAAO,UAAU,eAAY,QAAO,UAAA,IAAA,CAErD;AAAA,QAAA,GAEJ;AAAA,QAGF,gBAAAF,EAAC,SAAI,WAAWC,EAAKC,EAAO,SAASK,MAAgB,gBAAgBL,EAAO,UAAU,GACpF,UAAA,gBAAAF,EAACnC,EAAkB,UAAlB,EAA2B,OAAOsD,GAChC,UAAAb,IACGA,EAAQ,IAAI,CAACgB,MACX,gBAAAtB;AAAA,UAAC/B;AAAA,UAAA;AAAA,YAEC,OAAOqD,EAAO;AAAA,YACd,OAAOA,EAAO;AAAA,YACd,UAAUA,EAAO;AAAA,UAAA;AAAA,UAHZA,EAAO;AAAA,QAAA,CAKf,IACDb,EAAA,CACN,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),o=require("react"),p=require("clsx"),F=require("./formContext-bTWrqdEV.cjs"),T=require("./Typography-B6ASPrzT.cjs"),k=o.createContext(null);function D(){return o.useContext(k)}const P="_field_iusre_2",$="_row_iusre_9",A="_disabled_iusre_21",H="_input_iusre_27",J="_circle_iusre_41",K="_dot_iusre_63",M="_error_iusre_77",O="_label_iusre_81",Q="_required_iusre_86",U="_sm_iusre_92",W="_md_iusre_96",X="_lg_iusre_100",Y="_group_iusre_116",Z="_groupLabel_iusre_123",ee="_options_iusre_128",se="_horizontal_iusre_134",s={field:P,row:$,disabled:A,input:H,circle:J,dot:K,error:M,label:O,required:Q,sm:U,md:W,lg:X,group:Y,groupLabel:Z,options:ee,horizontal:se},V=o.forwardRef(function({value:a,label:d,color:j,size:u,error:l,checked:n,onChange:_,name:N,disabled:R,id:q,className:y,style:z,...g},C){const I=o.useId(),m=q??I,e=D(),t=j??(e==null?void 0:e.color)??"accent",b=u??(e==null?void 0:e.size)??"md",c=l??(e==null?void 0:e.error)??!1,v=R??(e==null?void 0:e.disabled)??!1,f=N??(e==null?void 0:e.name),[x,w]=o.useState(!1),G=e?e.value===a:n!==void 0?n:x,L=h=>{if(e){e.onChange(a);return}n===void 0&&w(h.target.checked),_==null||_(h.target.checked)};return r.jsx("div",{className:p.clsx(s.field,c&&s.error,v&&s.disabled,y),style:{"--tz-btn-rgb":`var(--tz-color-${t}-rgb)`,...z},children:r.jsxs("label",{className:p.clsx(s.row,s[b]),children:[r.jsx("input",{ref:C,id:m,name:f,type:"radio",className:s.input,value:a,checked:G,onChange:L,disabled:v,"aria-invalid":c||void 0,...g}),r.jsx("span",{className:s.circle,"aria-hidden":"true",children:r.jsx("span",{className:s.dot})}),d!=null&&r.jsx("span",{className:s.label,children:d})]})})}),re=o.forwardRef(function({label:a,value:d,defaultValue:j,onChange:u,name:l,options:n,orientation:_="vertical",size:N="md",color:R="accent",error:q,required:y=!1,disabled:z=!1,children:g,className:C,style:I,...m},e){const t=F.useFormContext(),b=!!(t&&l),c=t&&l?t.field(l):void 0,v=d!==void 0?d:b?t.values[l]:void 0,f=v!==void 0,x=o.useId(),w=o.useId(),[G,L]=o.useState(j),h=f?v:G,S=q??(c==null?void 0:c.error)??!1,E={name:l??w,value:h,onChange:i=>{f||L(i),b&&t.setValue(l,i),u==null||u(i)},size:N,color:R,disabled:z,error:S};return r.jsxs("div",{ref:e,role:"radiogroup","aria-labelledby":a!=null&&m["aria-label"]==null?x:void 0,"aria-invalid":S||void 0,className:p.clsx(s.group,C),style:I,...m,children:[a!=null&&r.jsxs("span",{id:x,className:s.groupLabel,children:[r.jsx(T.Typography,{as:"span",variant:"bodySmall",color:"muted",children:a}),y&&r.jsx("span",{className:s.required,"aria-hidden":"true",children:"*"})]}),r.jsx("div",{className:p.clsx(s.options,_==="horizontal"&&s.horizontal),children:r.jsx(k.Provider,{value:E,children:n?n.map(i=>r.jsx(V,{value:i.value,label:i.label,disabled:i.disabled},i.value)):g})})]})});exports.Radio=V;exports.RadioGroup=re;
|
|
2
|
+
//# sourceMappingURL=RadioGroup-CvC2yc4p.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup-CvC2yc4p.cjs","sources":["../src/components/Radio/radioContext.ts","../src/components/Radio/Radio.tsx","../src/components/Radio/RadioGroup.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\nimport type { ThemeColor } from '../../theme'\nimport type { RadioSize } from './Radio'\n\n/** Shared state a `<RadioGroup>` hands down to its `<Radio>` children via context. */\nexport interface RadioGroupContextValue {\n /** Shared input `name` (the radios in a group must share one). */\n name?: string\n /** The group's currently-selected value. */\n value?: string\n /** Select a value — called by a child `<Radio>` on change. */\n onChange: (value: string) => void\n size?: RadioSize\n color?: ThemeColor\n disabled?: boolean\n error?: boolean\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue | null>(null)\n\n/** Read the surrounding `<RadioGroup>` so a `<Radio>` can wire itself in (or `null` when standalone). */\nexport function useRadioGroupContext(): RadioGroupContextValue | null {\n return useContext(RadioGroupContext)\n}\n","import {\n forwardRef,\n useId,\n useState,\n type ChangeEvent,\n type CSSProperties,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport type { ThemeColor } from '../../theme'\nimport { useRadioGroupContext } from './radioContext'\nimport styles from './Radio.module.css'\n\nexport type RadioSize = 'sm' | 'md' | 'lg'\n\nexport interface RadioProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'color' | 'type' | 'onChange' | 'value'\n> {\n /** This option's value — selected when it matches the surrounding `RadioGroup`'s value. */\n value: string\n /** Text shown to the right of the control. */\n label?: ReactNode\n /** Theme palette token for the selected fill. Defaults to `accent` (inherits the group's `color`). */\n color?: ThemeColor\n /** Preset size — circle dimensions and label font. Inherits the group's `size` when omitted. */\n size?: RadioSize\n /** Marks the control invalid — reddens the ring. Inherits the group's `error`. */\n error?: boolean\n /** Controlled selected state for standalone use (inside a `RadioGroup` the group drives this). */\n checked?: boolean\n /** Fires with the next selected state (standalone use). */\n onChange?: (checked: boolean) => void\n}\n\n/**\n * A single radio button with a label. The native `<input type=\"radio\">` is visually hidden but fully\n * accessible; a styled circle shows the state, filling with `color` and an inner dot when selected.\n * Designed to live inside a `<RadioGroup>` (which supplies the shared `name`, selection and\n * `size`/`color`/`disabled`/`error` via context), but also works standalone (`checked` + `onChange`).\n * Styling uses `--tz-*` tokens only.\n */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n {\n value,\n label,\n color,\n size,\n error,\n checked,\n onChange,\n name,\n disabled,\n id: idProp,\n className,\n style,\n ...props\n },\n ref,\n) {\n const reactId = useId()\n const id = idProp ?? reactId\n const group = useRadioGroupContext()\n\n const resolvedColor = color ?? group?.color ?? 'accent'\n const resolvedSize = size ?? group?.size ?? 'md'\n const resolvedError = error ?? group?.error ?? false\n const resolvedDisabled = disabled ?? group?.disabled ?? false\n const resolvedName = name ?? group?.name\n\n // In a group the selection comes from context; standalone it's controlled (`checked`) or local.\n const [internal, setInternal] = useState(false)\n const isChecked = group ? group.value === value : checked !== undefined ? checked : internal\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (group) {\n group.onChange(value)\n return\n }\n if (checked === undefined) setInternal(event.target.checked)\n onChange?.(event.target.checked)\n }\n\n return (\n <div\n className={clsx(\n styles.field,\n resolvedError && styles.error,\n resolvedDisabled && styles.disabled,\n className,\n )}\n style={{ '--tz-btn-rgb': `var(--tz-color-${resolvedColor}-rgb)`, ...style } as CSSProperties}\n >\n <label className={clsx(styles.row, styles[resolvedSize])}>\n <input\n ref={ref}\n id={id}\n name={resolvedName}\n type=\"radio\"\n className={styles.input}\n value={value}\n checked={isChecked}\n onChange={handleChange}\n disabled={resolvedDisabled}\n aria-invalid={resolvedError || undefined}\n {...props}\n />\n <span className={styles.circle} aria-hidden=\"true\">\n <span className={styles.dot} />\n </span>\n {label != null && <span className={styles.label}>{label}</span>}\n </label>\n </div>\n )\n})\n","import {\n forwardRef,\n useId,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport { Radio, type RadioSize } from './Radio'\nimport { RadioGroupContext, type RadioGroupContextValue } from './radioContext'\nimport styles from './Radio.module.css'\n\nexport type RadioOrientation = 'vertical' | 'horizontal'\n\n/** A single option for the data-driven `options` prop. */\nexport interface RadioOption {\n value: string\n label?: ReactNode\n disabled?: boolean\n}\n\nexport interface RadioGroupProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onChange' | 'defaultValue'\n> {\n /** Group label rendered above the options. */\n label?: ReactNode\n /** Controlled selected value. */\n value?: string\n /** Initial value for uncontrolled use. */\n defaultValue?: string\n /** Fires with the newly-selected value. */\n onChange?: (value: string) => void\n /** Shared input `name` for the radios (also the `<Form>` binding key). */\n name?: string\n /** Data-driven options — an alternative to passing `<Radio>` children. */\n options?: RadioOption[]\n /** Stack direction of the options. Defaults to `vertical`. */\n orientation?: RadioOrientation\n /** Preset size for every radio. Defaults to `md`. */\n size?: RadioSize\n /** Theme palette token for the selected fill. Defaults to `accent`. */\n color?: ThemeColor\n /** Marks the group invalid — reddens the radio rings (no message text, like `Checkbox`). */\n error?: boolean\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Disables every radio in the group. */\n disabled?: boolean\n /** `<Radio>` children (used when `options` is not given). */\n children?: ReactNode\n}\n\n/**\n * Groups radio buttons so exactly one is selected. Supplies the shared `name`, selection and\n * `size`/`color`/`disabled`/`error` to its `<Radio>` children via context — pass them as `children`\n * or, for the common case, via the data-driven `options` prop. Controlled (`value` + `onChange`) or\n * uncontrolled (`defaultValue`), and binds to a surrounding `<Form>` by `name` (its form value is a\n * `string`; validate with e.g. `z.string().min(1)`). `error` reddens the radio rings (no message text,\n * like `Checkbox`). `role=\"radiogroup\"`, named by its `label` (`aria-labelledby`); styling uses `--tz-*` tokens.\n */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function RadioGroup(\n {\n label,\n value,\n defaultValue,\n onChange,\n name,\n options,\n orientation = 'vertical',\n size = 'md',\n color = 'accent',\n error,\n required = false,\n disabled = false,\n children,\n className,\n style,\n ...props\n },\n ref,\n) {\n // Auto-bind to a surrounding <Form> by `name` — the form value is the selected string.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: string | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? (form!.values[name!] as string | undefined)\n : undefined\n const isControlled = externalValue !== undefined\n // the visible label names the group for assistive tech (an explicit aria-label/-labelledby wins)\n const labelId = useId()\n // without a `name` the inputs wouldn't form a native radio group (every option its own tab stop, no\n // arrow-key selection) — fall back to a generated one for the DOM only; `<Form>` binding still keys off `name`\n const fallbackName = useId()\n const [internal, setInternal] = useState<string | undefined>(defaultValue)\n const currentValue = isControlled ? externalValue : internal\n\n const resolvedError = error ?? bound?.error ?? false\n\n const handleChange = (next: string) => {\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n }\n\n const ctx: RadioGroupContextValue = {\n name: name ?? fallbackName,\n value: currentValue,\n onChange: handleChange,\n size,\n color,\n disabled,\n error: resolvedError,\n }\n\n return (\n <div\n ref={ref}\n role=\"radiogroup\"\n aria-labelledby={label != null && props['aria-label'] == null ? labelId : undefined}\n aria-invalid={resolvedError || undefined}\n className={clsx(styles.group, className)}\n style={style as CSSProperties}\n {...props}\n >\n {label != null && (\n <span id={labelId} className={styles.groupLabel}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </span>\n )}\n\n <div className={clsx(styles.options, orientation === 'horizontal' && styles.horizontal)}>\n <RadioGroupContext.Provider value={ctx}>\n {options\n ? options.map((option) => (\n <Radio\n key={option.value}\n value={option.value}\n label={option.label}\n disabled={option.disabled}\n />\n ))\n : children}\n </RadioGroupContext.Provider>\n </div>\n </div>\n )\n})\n"],"names":["RadioGroupContext","createContext","useRadioGroupContext","useContext","Radio","forwardRef","value","label","color","size","error","checked","onChange","name","disabled","idProp","className","style","props","ref","reactId","useId","id","group","resolvedColor","resolvedSize","resolvedError","resolvedDisabled","resolvedName","internal","setInternal","useState","isChecked","handleChange","event","jsx","clsx","styles","jsxs","RadioGroup","defaultValue","options","orientation","required","children","form","useFormContext","isFormBound","bound","externalValue","isControlled","labelId","fallbackName","currentValue","ctx","next","Typography","option"],"mappings":"sKAkBaA,EAAoBC,EAAAA,cAA6C,IAAI,EAG3E,SAASC,GAAsD,CACpE,OAAOC,EAAAA,WAAWH,CAAiB,CACrC,8dCoBaI,EAAQC,EAAAA,WAAyC,SAC5D,CACE,MAAAC,EACA,MAAAC,EACA,MAAAC,EACA,KAAAC,EACA,MAAAC,EACA,QAAAC,EACA,SAAAC,EACA,KAAAC,EACA,SAAAC,EACA,GAAIC,EACJ,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAUC,EAAAA,MAAA,EACVC,EAAKP,GAAUK,EACfG,EAAQrB,EAAA,EAERsB,EAAgBhB,IAASe,GAAA,YAAAA,EAAO,QAAS,SACzCE,EAAehB,IAAQc,GAAA,YAAAA,EAAO,OAAQ,KACtCG,EAAgBhB,IAASa,GAAA,YAAAA,EAAO,QAAS,GACzCI,EAAmBb,IAAYS,GAAA,YAAAA,EAAO,WAAY,GAClDK,EAAef,IAAQU,GAAA,YAAAA,EAAO,MAG9B,CAACM,EAAUC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