@techzyapp/ui-library 1.0.44 → 1.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AdminRoot-9KE3ll-D.js → AdminRoot-BZ1v5vN9.js} +7 -7
- package/dist/{AdminRoot-9KE3ll-D.js.map → AdminRoot-BZ1v5vN9.js.map} +1 -1
- package/dist/{AdminRoot-BMzHo0n7.cjs → AdminRoot-DJ4-UMAB.cjs} +2 -2
- package/dist/{AdminRoot-BMzHo0n7.cjs.map → AdminRoot-DJ4-UMAB.cjs.map} +1 -1
- package/dist/{Alert-BFfzpPNd.js → Alert-BU7GlQna.js} +3 -3
- package/dist/{Alert-BFfzpPNd.js.map → Alert-BU7GlQna.js.map} +1 -1
- package/dist/{Alert-DS8TzpIS.cjs → Alert-CVQOjuEq.cjs} +2 -2
- package/dist/{Alert-DS8TzpIS.cjs.map → Alert-CVQOjuEq.cjs.map} +1 -1
- package/dist/{Breadcrumbs-CloqFpp1.js → Breadcrumbs-BMz_YVPa.js} +3 -3
- package/dist/{Breadcrumbs-CloqFpp1.js.map → Breadcrumbs-BMz_YVPa.js.map} +1 -1
- package/dist/{Breadcrumbs-N2-sZWW5.cjs → Breadcrumbs-BbC0o4JE.cjs} +2 -2
- package/dist/{Breadcrumbs-N2-sZWW5.cjs.map → Breadcrumbs-BbC0o4JE.cjs.map} +1 -1
- package/dist/{Button-5LQtDA9d.js → Button-C415LPw_.js} +2 -2
- package/dist/{Button-5LQtDA9d.js.map → Button-C415LPw_.js.map} +1 -1
- package/dist/{Button-Bxztlybi.cjs → Button-mBZOvgyZ.cjs} +2 -2
- package/dist/{Button-Bxztlybi.cjs.map → Button-mBZOvgyZ.cjs.map} +1 -1
- package/dist/{Calendar-BIKo_aus.js → Calendar-B0f6h9-A.js} +3 -3
- package/dist/{Calendar-BIKo_aus.js.map → Calendar-B0f6h9-A.js.map} +1 -1
- package/dist/{Calendar-CsBgaKZ-.cjs → Calendar-hO051hfk.cjs} +2 -2
- package/dist/{Calendar-CsBgaKZ-.cjs.map → Calendar-hO051hfk.cjs.map} +1 -1
- package/dist/{Card-Csn3FaMl.cjs → Card-BdNr5row.cjs} +2 -2
- package/dist/{Card-Csn3FaMl.cjs.map → Card-BdNr5row.cjs.map} +1 -1
- package/dist/{Card-DMwQ7rMk.js → Card-ssUNaOF_.js} +3 -3
- package/dist/{Card-DMwQ7rMk.js.map → Card-ssUNaOF_.js.map} +1 -1
- package/dist/{Chip-BdCZ44I8.cjs → Chip-BpJN4rzY.cjs} +2 -2
- package/dist/{Chip-BdCZ44I8.cjs.map → Chip-BpJN4rzY.cjs.map} +1 -1
- package/dist/{Chip-C7IkFuM1.js → Chip-C0x-6g2h.js} +2 -2
- package/dist/{Chip-C7IkFuM1.js.map → Chip-C0x-6g2h.js.map} +1 -1
- package/dist/{CodeBlock-C10JN6DR.js → CodeBlock-DKnWINdV.js} +3 -3
- package/dist/{CodeBlock-C10JN6DR.js.map → CodeBlock-DKnWINdV.js.map} +1 -1
- package/dist/{CodeBlock-BnXxxqAW.cjs → CodeBlock-DTrzN95i.cjs} +2 -2
- package/dist/{CodeBlock-BnXxxqAW.cjs.map → CodeBlock-DTrzN95i.cjs.map} +1 -1
- package/dist/{ColorPicker-z8_-77LO.js → ColorPicker-Bidev2DJ.js} +3 -3
- package/dist/{ColorPicker-z8_-77LO.js.map → ColorPicker-Bidev2DJ.js.map} +1 -1
- package/dist/{ColorPicker-CVddGc-n.cjs → ColorPicker-Doaegll4.cjs} +2 -2
- package/dist/{ColorPicker-CVddGc-n.cjs.map → ColorPicker-Doaegll4.cjs.map} +1 -1
- package/dist/{ColorPickerPanel-DJY6-EqO.cjs → ColorPickerPanel-048Fj7wv.cjs} +2 -2
- package/dist/{ColorPickerPanel-DJY6-EqO.cjs.map → ColorPickerPanel-048Fj7wv.cjs.map} +1 -1
- package/dist/{ColorPickerPanel-y4A2LLLf.js → ColorPickerPanel-DThSuUoz.js} +2 -2
- package/dist/{ColorPickerPanel-y4A2LLLf.js.map → ColorPickerPanel-DThSuUoz.js.map} +1 -1
- package/dist/{ColorRamp-DvRsdOWy.cjs → ColorRamp-CGw4D9bf.cjs} +2 -2
- package/dist/{ColorRamp-DvRsdOWy.cjs.map → ColorRamp-CGw4D9bf.cjs.map} +1 -1
- package/dist/{ColorRamp-Dvit8yoP.js → ColorRamp-Reb0q69d.js} +2 -2
- package/dist/{ColorRamp-Dvit8yoP.js.map → ColorRamp-Reb0q69d.js.map} +1 -1
- package/dist/{ConfigProvider-Cf-awvZs.cjs → ConfigProvider-DBU6rOIA.cjs} +2 -2
- package/dist/{ConfigProvider-Cf-awvZs.cjs.map → ConfigProvider-DBU6rOIA.cjs.map} +1 -1
- package/dist/{ConfigProvider-CYgmMH4j.js → ConfigProvider-DVDGtCUc.js} +2 -2
- package/dist/{ConfigProvider-CYgmMH4j.js.map → ConfigProvider-DVDGtCUc.js.map} +1 -1
- package/dist/{CopyButton-BOp7waEt.cjs → CopyButton-Cnab62vt.cjs} +2 -2
- package/dist/{CopyButton-BOp7waEt.cjs.map → CopyButton-Cnab62vt.cjs.map} +1 -1
- package/dist/{CopyButton-_iMBE4q_.js → CopyButton-Dm8-V4ku.js} +3 -3
- package/dist/{CopyButton-_iMBE4q_.js.map → CopyButton-Dm8-V4ku.js.map} +1 -1
- package/dist/{DatePicker-X5hZVSW6.js → DatePicker-C4MTCmDn.js} +4 -4
- package/dist/{DatePicker-X5hZVSW6.js.map → DatePicker-C4MTCmDn.js.map} +1 -1
- package/dist/{DatePicker-UQwpH-rw.cjs → DatePicker-CaGeW_-j.cjs} +2 -2
- package/dist/{DatePicker-UQwpH-rw.cjs.map → DatePicker-CaGeW_-j.cjs.map} +1 -1
- package/dist/{DateTimePicker-Ch1kUHEb.js → DateTimePicker-B0CjHKPV.js} +7 -7
- package/dist/{DateTimePicker-Ch1kUHEb.js.map → DateTimePicker-B0CjHKPV.js.map} +1 -1
- package/dist/{DateTimePicker-ClTZGMON.cjs → DateTimePicker-DXKaAYey.cjs} +2 -2
- package/dist/{DateTimePicker-ClTZGMON.cjs.map → DateTimePicker-DXKaAYey.cjs.map} +1 -1
- package/dist/{DescriptionList-IVAvgpEL.cjs → DescriptionList-BSDwobDc.cjs} +2 -2
- package/dist/{DescriptionList-IVAvgpEL.cjs.map → DescriptionList-BSDwobDc.cjs.map} +1 -1
- package/dist/{DescriptionList-Cque-iYk.js → DescriptionList-BkUS5egS.js} +4 -4
- package/dist/{DescriptionList-Cque-iYk.js.map → DescriptionList-BkUS5egS.js.map} +1 -1
- package/dist/{EmptyState-C84B-E8a.cjs → EmptyState-CkkFHKrh.cjs} +2 -2
- package/dist/{EmptyState-C84B-E8a.cjs.map → EmptyState-CkkFHKrh.cjs.map} +1 -1
- package/dist/{EmptyState-Yts_p-jZ.js → EmptyState-DXoaPC7o.js} +2 -2
- package/dist/{EmptyState-Yts_p-jZ.js.map → EmptyState-DXoaPC7o.js.map} +1 -1
- package/dist/{ErrorBoundary-BgMOPle0.js → ErrorBoundary-CSP_Ctg6.js} +3 -3
- package/dist/{ErrorBoundary-BgMOPle0.js.map → ErrorBoundary-CSP_Ctg6.js.map} +1 -1
- package/dist/{ErrorBoundary-DtYswKp3.cjs → ErrorBoundary-tZjKtO28.cjs} +2 -2
- package/dist/{ErrorBoundary-DtYswKp3.cjs.map → ErrorBoundary-tZjKtO28.cjs.map} +1 -1
- package/dist/{ErrorState-Aa8LVjkl.cjs → ErrorState-JH4JdrTI.cjs} +2 -2
- package/dist/{ErrorState-Aa8LVjkl.cjs.map → ErrorState-JH4JdrTI.cjs.map} +1 -1
- package/dist/{ErrorState-BE9Rcmht.js → ErrorState-WYsly5-i.js} +7 -7
- package/dist/{ErrorState-BE9Rcmht.js.map → ErrorState-WYsly5-i.js.map} +1 -1
- package/dist/{FileCard-Chfx0QdF.cjs → FileCard-BIfPqeek.cjs} +2 -2
- package/dist/{FileCard-Chfx0QdF.cjs.map → FileCard-BIfPqeek.cjs.map} +1 -1
- package/dist/{FileCard-m3i_8yKR.js → FileCard-D4TB3qGG.js} +3 -3
- package/dist/{FileCard-m3i_8yKR.js.map → FileCard-D4TB3qGG.js.map} +1 -1
- package/dist/FileUploader-DPVF76Ha.js +701 -0
- package/dist/FileUploader-DPVF76Ha.js.map +1 -0
- package/dist/FileUploader-YE_DfTNC.cjs +2 -0
- package/dist/FileUploader-YE_DfTNC.cjs.map +1 -0
- package/dist/{Flag-BvZB3295.cjs → Flag-B6OhgwZr.cjs} +2 -2
- package/dist/{Flag-BvZB3295.cjs.map → Flag-B6OhgwZr.cjs.map} +1 -1
- package/dist/{Flag-C1HwnZXJ.js → Flag-Q3vI7cgt.js} +2 -2
- package/dist/{Flag-C1HwnZXJ.js.map → Flag-Q3vI7cgt.js.map} +1 -1
- package/dist/{FullscreenToggle-B4ynXdCP.js → FullscreenToggle-CxwGPLdd.js} +3 -3
- package/dist/{FullscreenToggle-B4ynXdCP.js.map → FullscreenToggle-CxwGPLdd.js.map} +1 -1
- package/dist/{FullscreenToggle-CEFZQ5OC.cjs → FullscreenToggle-ipX55Nj4.cjs} +2 -2
- package/dist/{FullscreenToggle-CEFZQ5OC.cjs.map → FullscreenToggle-ipX55Nj4.cjs.map} +1 -1
- package/dist/{IconButton-wW1o4HHw.cjs → IconButton-U_sr2Ahy.cjs} +2 -2
- package/dist/{IconButton-wW1o4HHw.cjs.map → IconButton-U_sr2Ahy.cjs.map} +1 -1
- package/dist/{IconButton-EaExCXRq.js → IconButton-re6xITGO.js} +2 -2
- package/dist/{IconButton-EaExCXRq.js.map → IconButton-re6xITGO.js.map} +1 -1
- package/dist/ImageEditor-1n50vo_v.cjs +64 -0
- package/dist/ImageEditor-1n50vo_v.cjs.map +1 -0
- package/dist/{ImageEditor-DTFQZ6ON.js → ImageEditor-BwrG1fk7.js} +968 -948
- package/dist/ImageEditor-BwrG1fk7.js.map +1 -0
- package/dist/{Loader-D_Foo6Hj.js → Loader-7v1QBvHY.js} +2 -2
- package/dist/{Loader-D_Foo6Hj.js.map → Loader-7v1QBvHY.js.map} +1 -1
- package/dist/{Loader-DNR2_YHm.cjs → Loader-BE3SQr7W.cjs} +2 -2
- package/dist/{Loader-DNR2_YHm.cjs.map → Loader-BE3SQr7W.cjs.map} +1 -1
- package/dist/{LocationPicker-DGbnbTW9.js → LocationPicker-BvKtZFq0.js} +6 -6
- package/dist/{LocationPicker-DGbnbTW9.js.map → LocationPicker-BvKtZFq0.js.map} +1 -1
- package/dist/{LocationPicker-CdO37PKg.cjs → LocationPicker-CVJ4jVn2.cjs} +2 -2
- package/dist/{LocationPicker-CdO37PKg.cjs.map → LocationPicker-CVJ4jVn2.cjs.map} +1 -1
- package/dist/{Modal-Du-uVpYw.cjs → Modal-CxODxl81.cjs} +2 -2
- package/dist/{Modal-Du-uVpYw.cjs.map → Modal-CxODxl81.cjs.map} +1 -1
- package/dist/{Modal-1rIBMvKH.js → Modal-DpoiMMM3.js} +3 -3
- package/dist/{Modal-1rIBMvKH.js.map → Modal-DpoiMMM3.js.map} +1 -1
- package/dist/{MultiSelect-lAAaD0uL.cjs → MultiSelect-2GouMRTl.cjs} +2 -2
- package/dist/{MultiSelect-lAAaD0uL.cjs.map → MultiSelect-2GouMRTl.cjs.map} +1 -1
- package/dist/{MultiSelect-BoqunsM9.js → MultiSelect-B7KwEhL5.js} +4 -4
- package/dist/{MultiSelect-BoqunsM9.js.map → MultiSelect-B7KwEhL5.js.map} +1 -1
- package/dist/{NumberField-DHFGNQjZ.js → NumberField-ThojS4K3.js} +3 -3
- package/dist/{NumberField-DHFGNQjZ.js.map → NumberField-ThojS4K3.js.map} +1 -1
- package/dist/{NumberField-CyUA6eob.cjs → NumberField-o2z2QNK1.cjs} +2 -2
- package/dist/{NumberField-CyUA6eob.cjs.map → NumberField-o2z2QNK1.cjs.map} +1 -1
- package/dist/{OtpField-CIy5OtXI.cjs → OtpField-BhZq44vV.cjs} +2 -2
- package/dist/{OtpField-CIy5OtXI.cjs.map → OtpField-BhZq44vV.cjs.map} +1 -1
- package/dist/{OtpField-pL9nj4AW.js → OtpField-C3MlMZ2F.js} +2 -2
- package/dist/{OtpField-pL9nj4AW.js.map → OtpField-C3MlMZ2F.js.map} +1 -1
- package/dist/{PageError-C5SO0mVJ.js → PageError-63Gk6fVC.js} +5 -5
- package/dist/{PageError-C5SO0mVJ.js.map → PageError-63Gk6fVC.js.map} +1 -1
- package/dist/{PageError-DbokLmOY.cjs → PageError-CCKWbrc5.cjs} +2 -2
- package/dist/{PageError-DbokLmOY.cjs.map → PageError-CCKWbrc5.cjs.map} +1 -1
- package/dist/{PageLayout-Du-D6Pd4.js → PageLayout-BekkDBtT.js} +4 -4
- package/dist/{PageLayout-Du-D6Pd4.js.map → PageLayout-BekkDBtT.js.map} +1 -1
- package/dist/{PageLayout-B7ZDiNq8.cjs → PageLayout-CDPUYu6A.cjs} +2 -2
- package/dist/{PageLayout-B7ZDiNq8.cjs.map → PageLayout-CDPUYu6A.cjs.map} +1 -1
- package/dist/{PageNotFound-DSkoMfed.js → PageNotFound-BD3zX3cd.js} +5 -5
- package/dist/{PageNotFound-DSkoMfed.js.map → PageNotFound-BD3zX3cd.js.map} +1 -1
- package/dist/{PageNotFound-DfNwdtgJ.cjs → PageNotFound-CTR6htwa.cjs} +2 -2
- package/dist/{PageNotFound-DfNwdtgJ.cjs.map → PageNotFound-CTR6htwa.cjs.map} +1 -1
- package/dist/{Pagination-DO2Os4an.cjs → Pagination-BJvLUjQ0.cjs} +2 -2
- package/dist/{Pagination-DO2Os4an.cjs.map → Pagination-BJvLUjQ0.cjs.map} +1 -1
- package/dist/{Pagination-BH8ACaAC.js → Pagination-qKjISBJ9.js} +2 -2
- package/dist/{Pagination-BH8ACaAC.js.map → Pagination-qKjISBJ9.js.map} +1 -1
- package/dist/{PaletteField-BfvcJvGM.cjs → PaletteField-CDS9CJW9.cjs} +2 -2
- package/dist/{PaletteField-BfvcJvGM.cjs.map → PaletteField-CDS9CJW9.cjs.map} +1 -1
- package/dist/{PaletteField-BFb0PQ-S.js → PaletteField-y8KpR4Ap.js} +3 -3
- package/dist/{PaletteField-BFb0PQ-S.js.map → PaletteField-y8KpR4Ap.js.map} +1 -1
- package/dist/{PhoneField-C-wOm7g5.cjs → PhoneField-Df3J6Hhg.cjs} +2 -2
- package/dist/{PhoneField-C-wOm7g5.cjs.map → PhoneField-Df3J6Hhg.cjs.map} +1 -1
- package/dist/{PhoneField-DFhGWgbK.js → PhoneField-OjsuevPx.js} +4 -4
- package/dist/{PhoneField-DFhGWgbK.js.map → PhoneField-OjsuevPx.js.map} +1 -1
- package/dist/{Popconfirm-_53vtMI0.cjs → Popconfirm-BKzJ_EZy.cjs} +2 -2
- package/dist/{Popconfirm-_53vtMI0.cjs.map → Popconfirm-BKzJ_EZy.cjs.map} +1 -1
- package/dist/{Popconfirm-o5da44ra.js → Popconfirm-aCyniPnH.js} +3 -3
- package/dist/{Popconfirm-o5da44ra.js.map → Popconfirm-aCyniPnH.js.map} +1 -1
- package/dist/{Progress-BSinoQ8t.cjs → Progress-DWOoLd8u.cjs} +2 -2
- package/dist/{Progress-BSinoQ8t.cjs.map → Progress-DWOoLd8u.cjs.map} +1 -1
- package/dist/{Progress-CHzNwegP.js → Progress-DzxbkcaD.js} +2 -2
- package/dist/{Progress-CHzNwegP.js.map → Progress-DzxbkcaD.js.map} +1 -1
- package/dist/{QrCode-tNNnsbHM.cjs → QrCode-C8uAPiHq.cjs} +2 -2
- package/dist/{QrCode-tNNnsbHM.cjs.map → QrCode-C8uAPiHq.cjs.map} +1 -1
- package/dist/{QrCode-C3hAfNP6.js → QrCode-DaJYqBc1.js} +2 -2
- package/dist/{QrCode-C3hAfNP6.js.map → QrCode-DaJYqBc1.js.map} +1 -1
- package/dist/{RemoveDialog-Hi_gV-8A.cjs → RemoveDialog-BnOtR6-q.cjs} +2 -2
- package/dist/{RemoveDialog-Hi_gV-8A.cjs.map → RemoveDialog-BnOtR6-q.cjs.map} +1 -1
- package/dist/{RemoveDialog-CXy-PY-G.js → RemoveDialog-MhEU5Zl3.js} +5 -5
- package/dist/{RemoveDialog-CXy-PY-G.js.map → RemoveDialog-MhEU5Zl3.js.map} +1 -1
- package/dist/RichTextEditor-Cnrnvv1f.cjs +2 -0
- package/dist/RichTextEditor-Cnrnvv1f.cjs.map +1 -0
- package/dist/RichTextEditor-zkoxujnO.js +1148 -0
- package/dist/RichTextEditor-zkoxujnO.js.map +1 -0
- package/dist/{RootLayout-CjT5uHlt.js → RootLayout-C4r9i5Go.js} +15 -15
- package/dist/{RootLayout-CjT5uHlt.js.map → RootLayout-C4r9i5Go.js.map} +1 -1
- package/dist/{RootLayout-iSGY4MsS.cjs → RootLayout-Z9PuRfsa.cjs} +2 -2
- package/dist/{RootLayout-iSGY4MsS.cjs.map → RootLayout-Z9PuRfsa.cjs.map} +1 -1
- package/dist/{Select-DVoL547R.cjs → Select-CylqFHce.cjs} +2 -2
- package/dist/{Select-DVoL547R.cjs.map → Select-CylqFHce.cjs.map} +1 -1
- package/dist/{Select-DuLDLnnb.js → Select-jT94L1vq.js} +3 -3
- package/dist/{Select-DuLDLnnb.js.map → Select-jT94L1vq.js.map} +1 -1
- package/dist/{Sidebar-DvQmuBNK.js → Sidebar-B1O2RsbR.js} +3 -3
- package/dist/{Sidebar-DvQmuBNK.js.map → Sidebar-B1O2RsbR.js.map} +1 -1
- package/dist/{Sidebar-DRQo4zAF.cjs → Sidebar-Bcm0fgVm.cjs} +2 -2
- package/dist/{Sidebar-DRQo4zAF.cjs.map → Sidebar-Bcm0fgVm.cjs.map} +1 -1
- package/dist/{Slider-DxnCQRSH.cjs → Slider-CV7ug0WF.cjs} +2 -2
- package/dist/{Slider-DxnCQRSH.cjs.map → Slider-CV7ug0WF.cjs.map} +1 -1
- package/dist/{Slider-D-QjclQJ.js → Slider-DC-ugZwT.js} +2 -2
- package/dist/{Slider-D-QjclQJ.js.map → Slider-DC-ugZwT.js.map} +1 -1
- package/dist/{SpeedDial-BBQ9y6lm.js → SpeedDial-C6yiMUe8.js} +2 -2
- package/dist/{SpeedDial-BBQ9y6lm.js.map → SpeedDial-C6yiMUe8.js.map} +1 -1
- package/dist/{SpeedDial-37OMwj9C.cjs → SpeedDial-DOgm2DDX.cjs} +2 -2
- package/dist/{SpeedDial-37OMwj9C.cjs.map → SpeedDial-DOgm2DDX.cjs.map} +1 -1
- package/dist/{Stepper-CU5Y0kfj.js → Stepper-BZdYGpBN.js} +2 -2
- package/dist/{Stepper-CU5Y0kfj.js.map → Stepper-BZdYGpBN.js.map} +1 -1
- package/dist/{Stepper-WqkfGPnQ.cjs → Stepper-DqM86TGV.cjs} +2 -2
- package/dist/{Stepper-WqkfGPnQ.cjs.map → Stepper-DqM86TGV.cjs.map} +1 -1
- package/dist/{Table-BnlvrRMr.cjs → Table-BgaCwRDQ.cjs} +2 -2
- package/dist/{Table-BnlvrRMr.cjs.map → Table-BgaCwRDQ.cjs.map} +1 -1
- package/dist/{Table-BECUUZtf.js → Table-FZlVWoYi.js} +16 -16
- package/dist/{Table-BECUUZtf.js.map → Table-FZlVWoYi.js.map} +1 -1
- package/dist/{Tabs-BXAHddi7.js → Tabs-BqQPkorY.js} +2 -2
- package/dist/{Tabs-BXAHddi7.js.map → Tabs-BqQPkorY.js.map} +1 -1
- package/dist/{Tabs-DiL1vNW3.cjs → Tabs-kGeyFhJ6.cjs} +2 -2
- package/dist/{Tabs-DiL1vNW3.cjs.map → Tabs-kGeyFhJ6.cjs.map} +1 -1
- package/dist/{TagsField-BsV_6dff.cjs → TagsField-B_sjp48X.cjs} +2 -2
- package/dist/{TagsField-BsV_6dff.cjs.map → TagsField-B_sjp48X.cjs.map} +1 -1
- package/dist/{TagsField-C1SgykAj.js → TagsField-ByTx9JXK.js} +4 -4
- package/dist/{TagsField-C1SgykAj.js.map → TagsField-ByTx9JXK.js.map} +1 -1
- package/dist/{TextField-DUv689u2.cjs → TextField-CBYJIfau.cjs} +2 -2
- package/dist/{TextField-DUv689u2.cjs.map → TextField-CBYJIfau.cjs.map} +1 -1
- package/dist/{TextField-oZI7thoU.js → TextField-CyKIx-d-.js} +3 -3
- package/dist/{TextField-oZI7thoU.js.map → TextField-CyKIx-d-.js.map} +1 -1
- package/dist/{ThemeToggle-xn3roH0u.cjs → ThemeToggle-D2dIqiBa.cjs} +2 -2
- package/dist/{ThemeToggle-xn3roH0u.cjs.map → ThemeToggle-D2dIqiBa.cjs.map} +1 -1
- package/dist/{ThemeToggle-5uHCUsX7.js → ThemeToggle-Dg6IishB.js} +3 -3
- package/dist/{ThemeToggle-5uHCUsX7.js.map → ThemeToggle-Dg6IishB.js.map} +1 -1
- package/dist/{TimeColumns-lO33mhX7.js → TimeColumns-Cx8J5qzW.js} +2 -2
- package/dist/{TimeColumns-lO33mhX7.js.map → TimeColumns-Cx8J5qzW.js.map} +1 -1
- package/dist/{TimeColumns-By23LHZw.cjs → TimeColumns-DVmK_T_P.cjs} +2 -2
- package/dist/{TimeColumns-By23LHZw.cjs.map → TimeColumns-DVmK_T_P.cjs.map} +1 -1
- package/dist/{TimePicker-BHFNH8LR.cjs → TimePicker-0nZOPRKp.cjs} +2 -2
- package/dist/{TimePicker-BHFNH8LR.cjs.map → TimePicker-0nZOPRKp.cjs.map} +1 -1
- package/dist/{TimePicker-Dl5p833O.js → TimePicker-sAhtvqQ4.js} +5 -5
- package/dist/{TimePicker-Dl5p833O.js.map → TimePicker-sAhtvqQ4.js.map} +1 -1
- package/dist/{Toaster-BPBFZiTr.js → Toaster-BOW9rzLq.js} +3 -3
- package/dist/{Toaster-BPBFZiTr.js.map → Toaster-BOW9rzLq.js.map} +1 -1
- package/dist/{Toaster-D4T89N1S.cjs → Toaster-DYGo92ke.cjs} +2 -2
- package/dist/{Toaster-D4T89N1S.cjs.map → Toaster-DYGo92ke.cjs.map} +1 -1
- package/dist/{TranslatedFields-LdeJeHEp.cjs → TranslatedFields-C_DuLotV.cjs} +2 -2
- package/dist/{TranslatedFields-LdeJeHEp.cjs.map → TranslatedFields-C_DuLotV.cjs.map} +1 -1
- package/dist/{TranslatedFields-Clsr84XC.js → TranslatedFields-CcE0td9p.js} +5 -5
- package/dist/{TranslatedFields-Clsr84XC.js.map → TranslatedFields-CcE0td9p.js.map} +1 -1
- package/dist/{UserCard-CQOiWppq.cjs → UserCard-DLVptkLr.cjs} +2 -2
- package/dist/{UserCard-CQOiWppq.cjs.map → UserCard-DLVptkLr.cjs.map} +1 -1
- package/dist/{UserCard-Cr75RwZb.js → UserCard-DeONbaKj.js} +3 -3
- package/dist/{UserCard-Cr75RwZb.js.map → UserCard-DeONbaKj.js.map} +1 -1
- package/dist/components/Alert/index.cjs +1 -1
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/Breadcrumbs/index.cjs +1 -1
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Card/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/CodeBlock/index.cjs +1 -1
- package/dist/components/CodeBlock/index.js +1 -1
- package/dist/components/ColorPicker/index.cjs +1 -1
- package/dist/components/ColorPicker/index.js +1 -1
- package/dist/components/ColorRamp/index.cjs +1 -1
- package/dist/components/ColorRamp/index.js +1 -1
- package/dist/components/CopyButton/index.cjs +1 -1
- package/dist/components/CopyButton/index.js +1 -1
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/DateTimePicker/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/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/IconButton/index.cjs +1 -1
- package/dist/components/IconButton/index.js +1 -1
- package/dist/components/ImageEditor/index.cjs +1 -1
- package/dist/components/ImageEditor/index.js +1 -1
- package/dist/components/Loader/index.cjs +1 -1
- package/dist/components/Loader/index.js +1 -1
- package/dist/components/LocationPicker/index.cjs +1 -1
- package/dist/components/LocationPicker/index.js +1 -1
- package/dist/components/Modal/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/PageError/index.cjs +1 -1
- package/dist/components/PageError/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/Progress/index.cjs +1 -1
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/QrCode/index.cjs +1 -1
- package/dist/components/QrCode/index.js +1 -1
- package/dist/components/RemoveDialog/index.cjs +1 -1
- package/dist/components/RemoveDialog/index.js +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RichTextEditor/nodes/ImageNode.d.cts +17 -5
- package/dist/components/RichTextEditor/nodes/ImageNode.d.ts +17 -5
- package/dist/components/RootLayout/index.cjs +1 -1
- package/dist/components/RootLayout/index.js +1 -1
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Sidebar/index.cjs +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/Slider/index.cjs +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/SpeedDial/index.cjs +1 -1
- package/dist/components/SpeedDial/index.js +1 -1
- package/dist/components/Stepper/index.cjs +1 -1
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tabs/index.cjs +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/TagsField/index.cjs +1 -1
- package/dist/components/TagsField/index.js +1 -1
- package/dist/components/TextField/index.cjs +1 -1
- package/dist/components/TextField/index.js +1 -1
- package/dist/components/ThemeToggle/index.cjs +1 -1
- package/dist/components/ThemeToggle/index.js +1 -1
- package/dist/components/TimePicker/index.cjs +1 -1
- package/dist/components/TimePicker/index.js +1 -1
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/TranslatedFields/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 +53 -53
- package/dist/entries/i18n.cjs +1 -1
- package/dist/entries/i18n.js +2 -2
- package/dist/entries/theme.cjs +1 -1
- package/dist/entries/theme.js +1 -1
- package/dist/i18n/messages.d.cts +5 -0
- package/dist/i18n/messages.d.ts +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +56 -56
- package/dist/{messages-BZYBZ3GR.js → messages-DeQuvGln.js} +47 -12
- package/dist/messages-DeQuvGln.js.map +1 -0
- package/dist/{messages-CTHjpVJq.cjs → messages-dL9MkVze.cjs} +9 -9
- package/dist/messages-dL9MkVze.cjs.map +1 -0
- package/dist/{useHomeTo-Biyc-Un8.js → useHomeTo-BL3e8Sc6.js} +2 -2
- package/dist/{useHomeTo-Biyc-Un8.js.map → useHomeTo-BL3e8Sc6.js.map} +1 -1
- package/dist/{useHomeTo-D7wcH6aw.cjs → useHomeTo-W1PDW5CU.cjs} +2 -2
- package/dist/{useHomeTo-D7wcH6aw.cjs.map → useHomeTo-W1PDW5CU.cjs.map} +1 -1
- package/dist/{useOptionMenu-BTt8t9SM.js → useOptionMenu-BkKiZ6Ax.js} +3 -3
- package/dist/{useOptionMenu-BTt8t9SM.js.map → useOptionMenu-BkKiZ6Ax.js.map} +1 -1
- package/dist/{useOptionMenu-B40OOVsO.cjs → useOptionMenu-CVl7VHXl.cjs} +2 -2
- package/dist/{useOptionMenu-B40OOVsO.cjs.map → useOptionMenu-CVl7VHXl.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/FileUploader-B27Y4rak.js +0 -706
- package/dist/FileUploader-B27Y4rak.js.map +0 -1
- package/dist/FileUploader-DkvFO0N_.cjs +0 -2
- package/dist/FileUploader-DkvFO0N_.cjs.map +0 -1
- package/dist/ImageEditor-DTFQZ6ON.js.map +0 -1
- package/dist/ImageEditor-D_HKfDbx.cjs +0 -60
- package/dist/ImageEditor-D_HKfDbx.cjs.map +0 -1
- package/dist/RichTextEditor-BhVE1q4U.cjs +0 -2
- package/dist/RichTextEditor-BhVE1q4U.cjs.map +0 -1
- package/dist/RichTextEditor-DQz9jGD3.js +0 -1011
- package/dist/RichTextEditor-DQz9jGD3.js.map +0 -1
- package/dist/messages-BZYBZ3GR.js.map +0 -1
- package/dist/messages-CTHjpVJq.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout-
|
|
1
|
+
{"version":3,"file":"PageLayout-BekkDBtT.js","sources":["../src/components/PageLayout/PageLayout.tsx"],"sourcesContent":["import { forwardRef, type ReactNode } from 'react'\nimport { useRouter, type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { Card, type CardProps } from '../Card'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Typography } from '../Typography'\nimport styles from './PageLayout.module.css'\n\n/** Something React would actually render — `null` / `undefined` / booleans / `''` render nothing (e.g. the\n * `pageActions={isDirty && <Button…/>}` pattern), so they mustn't produce an empty heading row. */\nconst renders = (node: ReactNode): boolean =>\n node != null && typeof node !== 'boolean' && node !== ''\n\n/** PageLayout is a flat `Card`, so it gains all of Card's slots minus the `flat` toggle (always flat). */\nexport interface PageLayoutProps extends Omit<CardProps, 'flat'> {\n /**\n * The page heading — an `h2` in the row **above** the card (the card's own header — `icon` / `title` /\n * `subtitle` / `actions` — is separate and unchanged). Shown only when given.\n */\n pageTitle?: ReactNode\n /**\n * Anything for the right end of the heading row — usually a few `size=\"sm\"` `Button`s, built in the page with\n * its own state. Rendered as given (no automatic phone collapse); on a narrow screen the row wraps, so they\n * drop below the title.\n */\n pageActions?: ReactNode\n /**\n * A back button left of the heading. `true` → the browser history back; a **path** string → navigates there\n * (deterministic on a deep link / refresh, e.g. `back={`/users/${id}`}`). Omitted / `false` → none.\n */\n back?: boolean | string\n}\n\n/**\n * The container a page's body sits in — a **flat `Card`**: an ordinary bordered `surface` panel with no\n * shadow, floating on the shell's `background` canvas (`flat` is only a styling hook). Being a Card, it has the full\n * Card anatomy: an optional card header (`icon` + `title` + `subtitle` + `actions`), the body (`children`), a\n * `footer` / `footerStart` (`stickyFooter`), and `collapsible`. Above the card, an optional **page heading row**\n * — `back` (button) + `pageTitle` (`h2`) + `pageActions` (right) — shown only when one of them is given; the\n * shell itself renders no page title. Rendered by the consumer inside each route, below the shell's breadcrumbs:\n * `<PageLayout pageTitle=\"Users\" pageActions={<Button size=\"sm\">Add New</Button>}>…</PageLayout>`. The ref\n * points at the card. Styling uses `--tz-*` tokens only.\n */\nexport const PageLayout = forwardRef<HTMLDivElement, PageLayoutProps>(function PageLayout(\n { pageTitle, pageActions, back, ...props },\n ref,\n) {\n const t = useT()\n // lenient: outside a RouterProvider the back button falls back to the browser's own history / location\n const router = useRouter({ warn: false })\n const goBack =\n back === true\n ? () => (router ? router.history.back() : window.history.back())\n : typeof back === 'string' && back\n ? () =>\n router\n ? void router.navigate({ to: back as LinkProps['to'] })\n : window.location.assign(back)\n : undefined\n const showTitle = renders(pageTitle)\n const showActions = renders(pageActions)\n const hasHeading = showTitle || showActions || goBack != null\n\n return (\n <>\n {hasHeading ? (\n <div className={styles.heading}>\n {goBack ? (\n <IconButton\n aria-label={t('pageTitle.back')}\n variant=\"filled\"\n color=\"accent\"\n size=\"sm\"\n onClick={goBack}\n >\n <Icon name=\"ArrowLeft\" />\n </IconButton>\n ) : null}\n {showTitle ? (\n <Typography variant=\"h2\" className={styles.title}>\n {pageTitle}\n </Typography>\n ) : null}\n {showActions ? <div className={styles.actions}>{pageActions}</div> : null}\n </div>\n ) : null}\n <Card ref={ref} flat {...props} />\n </>\n )\n})\n"],"names":["renders","node","PageLayout","forwardRef","pageTitle","pageActions","back","props","ref","t","useT","router","useRouter","goBack","showTitle","showActions","hasHeading","jsxs","Fragment","styles","jsx","IconButton","Icon","Typography","Card"],"mappings":";;;;;;;;;;;;GAWMA,IAAU,CAACC,MACfA,KAAQ,QAAQ,OAAOA,KAAS,aAAaA,MAAS,IAgC3CC,IAAaC,EAA4C,SACpE,EAAE,WAAAC,GAAW,aAAAC,GAAa,MAAAC,GAAM,GAAGC,EAAA,GACnCC,GACA;AACA,QAAMC,IAAIC,EAAA,GAEJC,IAASC,EAAU,EAAE,MAAM,IAAO,GAClCC,IACJP,MAAS,KACL,MAAOK,IAASA,EAAO,QAAQ,KAAA,IAAS,OAAO,QAAQ,KAAA,IACvD,OAAOL,KAAS,YAAYA,IAC1B,MACEK,IACI,KAAKA,EAAO,SAAS,EAAE,IAAIL,EAAA,CAAyB,IACpD,OAAO,SAAS,OAAOA,CAAI,IACjC,QACFQ,IAAYd,EAAQI,CAAS,GAC7BW,IAAcf,EAAQK,CAAW,GACjCW,IAAaF,KAAaC,KAAeF,KAAU;AAEzD,SACE,gBAAAI,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAF,IACC,gBAAAC,EAAC,OAAA,EAAI,WAAWE,EAAO,SACpB,UAAA;AAAA,MAAAN,IACC,gBAAAO;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,cAAYZ,EAAE,gBAAgB;AAAA,UAC9B,SAAQ;AAAA,UACR,OAAM;AAAA,UACN,MAAK;AAAA,UACL,SAASI;AAAA,UAET,UAAA,gBAAAO,EAACE,GAAA,EAAK,MAAK,YAAA,CAAY;AAAA,QAAA;AAAA,MAAA,IAEvB;AAAA,MACHR,sBACES,GAAA,EAAW,SAAQ,MAAK,WAAWJ,EAAO,OACxC,UAAAf,EAAA,CACH,IACE;AAAA,MACHW,IAAc,gBAAAK,EAAC,OAAA,EAAI,WAAWD,EAAO,SAAU,aAAY,IAAS;AAAA,IAAA,EAAA,CACvE,IACE;AAAA,sBACHK,GAAA,EAAK,KAAAhB,GAAU,MAAI,IAAE,GAAGD,EAAA,CAAO;AAAA,EAAA,GAClC;AAEJ,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),f=require("react"),w=require("@tanstack/react-router"),_=require("./Card-
|
|
2
|
-
//# sourceMappingURL=PageLayout-
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),f=require("react"),w=require("@tanstack/react-router"),_=require("./Card-BdNr5row.cjs"),j=require("./Icon-CBg21lKA.cjs"),q=require("./IconButton-U_sr2Ahy.cjs"),v=require("./Typography-d97DdbNd.cjs"),x=require("./ConfigProvider-DBU6rOIA.cjs"),m="_heading_100i8_4",p="_title_100i8_12",C="_actions_100i8_19",i={heading:m,title:p,actions:C},u=e=>e!=null&&typeof e!="boolean"&&e!=="",I=f.forwardRef(function({pageTitle:r,pageActions:a,back:n,...d},h){const g=x.useT(),o=w.useRouter({warn:!1}),s=n===!0?()=>o?o.history.back():window.history.back():typeof n=="string"&&n?()=>o?void o.navigate({to:n}):window.location.assign(n):void 0,c=u(r),l=u(a),y=c||l||s!=null;return t.jsxs(t.Fragment,{children:[y?t.jsxs("div",{className:i.heading,children:[s?t.jsx(q.IconButton,{"aria-label":g("pageTitle.back"),variant:"filled",color:"accent",size:"sm",onClick:s,children:t.jsx(j.Icon,{name:"ArrowLeft"})}):null,c?t.jsx(v.Typography,{variant:"h2",className:i.title,children:r}):null,l?t.jsx("div",{className:i.actions,children:a}):null]}):null,t.jsx(_.Card,{ref:h,flat:!0,...d})]})});exports.PageLayout=I;
|
|
2
|
+
//# sourceMappingURL=PageLayout-CDPUYu6A.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout-
|
|
1
|
+
{"version":3,"file":"PageLayout-CDPUYu6A.cjs","sources":["../src/components/PageLayout/PageLayout.tsx"],"sourcesContent":["import { forwardRef, type ReactNode } from 'react'\nimport { useRouter, type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { Card, type CardProps } from '../Card'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Typography } from '../Typography'\nimport styles from './PageLayout.module.css'\n\n/** Something React would actually render — `null` / `undefined` / booleans / `''` render nothing (e.g. the\n * `pageActions={isDirty && <Button…/>}` pattern), so they mustn't produce an empty heading row. */\nconst renders = (node: ReactNode): boolean =>\n node != null && typeof node !== 'boolean' && node !== ''\n\n/** PageLayout is a flat `Card`, so it gains all of Card's slots minus the `flat` toggle (always flat). */\nexport interface PageLayoutProps extends Omit<CardProps, 'flat'> {\n /**\n * The page heading — an `h2` in the row **above** the card (the card's own header — `icon` / `title` /\n * `subtitle` / `actions` — is separate and unchanged). Shown only when given.\n */\n pageTitle?: ReactNode\n /**\n * Anything for the right end of the heading row — usually a few `size=\"sm\"` `Button`s, built in the page with\n * its own state. Rendered as given (no automatic phone collapse); on a narrow screen the row wraps, so they\n * drop below the title.\n */\n pageActions?: ReactNode\n /**\n * A back button left of the heading. `true` → the browser history back; a **path** string → navigates there\n * (deterministic on a deep link / refresh, e.g. `back={`/users/${id}`}`). Omitted / `false` → none.\n */\n back?: boolean | string\n}\n\n/**\n * The container a page's body sits in — a **flat `Card`**: an ordinary bordered `surface` panel with no\n * shadow, floating on the shell's `background` canvas (`flat` is only a styling hook). Being a Card, it has the full\n * Card anatomy: an optional card header (`icon` + `title` + `subtitle` + `actions`), the body (`children`), a\n * `footer` / `footerStart` (`stickyFooter`), and `collapsible`. Above the card, an optional **page heading row**\n * — `back` (button) + `pageTitle` (`h2`) + `pageActions` (right) — shown only when one of them is given; the\n * shell itself renders no page title. Rendered by the consumer inside each route, below the shell's breadcrumbs:\n * `<PageLayout pageTitle=\"Users\" pageActions={<Button size=\"sm\">Add New</Button>}>…</PageLayout>`. The ref\n * points at the card. Styling uses `--tz-*` tokens only.\n */\nexport const PageLayout = forwardRef<HTMLDivElement, PageLayoutProps>(function PageLayout(\n { pageTitle, pageActions, back, ...props },\n ref,\n) {\n const t = useT()\n // lenient: outside a RouterProvider the back button falls back to the browser's own history / location\n const router = useRouter({ warn: false })\n const goBack =\n back === true\n ? () => (router ? router.history.back() : window.history.back())\n : typeof back === 'string' && back\n ? () =>\n router\n ? void router.navigate({ to: back as LinkProps['to'] })\n : window.location.assign(back)\n : undefined\n const showTitle = renders(pageTitle)\n const showActions = renders(pageActions)\n const hasHeading = showTitle || showActions || goBack != null\n\n return (\n <>\n {hasHeading ? (\n <div className={styles.heading}>\n {goBack ? (\n <IconButton\n aria-label={t('pageTitle.back')}\n variant=\"filled\"\n color=\"accent\"\n size=\"sm\"\n onClick={goBack}\n >\n <Icon name=\"ArrowLeft\" />\n </IconButton>\n ) : null}\n {showTitle ? (\n <Typography variant=\"h2\" className={styles.title}>\n {pageTitle}\n </Typography>\n ) : null}\n {showActions ? <div className={styles.actions}>{pageActions}</div> : null}\n </div>\n ) : null}\n <Card ref={ref} flat {...props} />\n </>\n )\n})\n"],"names":["renders","node","PageLayout","forwardRef","pageTitle","pageActions","back","props","ref","t","useT","router","useRouter","goBack","showTitle","showActions","hasHeading","jsxs","Fragment","styles","jsx","IconButton","Icon","Typography","Card"],"mappings":"mYAWMA,EAAWC,GACfA,GAAQ,MAAQ,OAAOA,GAAS,WAAaA,IAAS,GAgC3CC,EAAaC,EAAAA,WAA4C,SACpE,CAAE,UAAAC,EAAW,YAAAC,EAAa,KAAAC,EAAM,GAAGC,CAAA,EACnCC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EAEJC,EAASC,EAAAA,UAAU,CAAE,KAAM,GAAO,EAClCC,EACJP,IAAS,GACL,IAAOK,EAASA,EAAO,QAAQ,KAAA,EAAS,OAAO,QAAQ,KAAA,EACvD,OAAOL,GAAS,UAAYA,EAC1B,IACEK,EACI,KAAKA,EAAO,SAAS,CAAE,GAAIL,CAAA,CAAyB,EACpD,OAAO,SAAS,OAAOA,CAAI,EACjC,OACFQ,EAAYd,EAAQI,CAAS,EAC7BW,EAAcf,EAAQK,CAAW,EACjCW,EAAaF,GAAaC,GAAeF,GAAU,KAEzD,OACEI,EAAAA,KAAAC,WAAA,CACG,SAAA,CAAAF,EACCC,EAAAA,KAAC,MAAA,CAAI,UAAWE,EAAO,QACpB,SAAA,CAAAN,EACCO,EAAAA,IAACC,EAAAA,WAAA,CACC,aAAYZ,EAAE,gBAAgB,EAC9B,QAAQ,SACR,MAAM,SACN,KAAK,KACL,QAASI,EAET,SAAAO,EAAAA,IAACE,EAAAA,KAAA,CAAK,KAAK,WAAA,CAAY,CAAA,CAAA,EAEvB,KACHR,QACES,aAAA,CAAW,QAAQ,KAAK,UAAWJ,EAAO,MACxC,SAAAf,CAAA,CACH,EACE,KACHW,EAAcK,EAAAA,IAAC,MAAA,CAAI,UAAWD,EAAO,QAAU,WAAY,EAAS,IAAA,CAAA,CACvE,EACE,WACHK,EAAAA,KAAA,CAAK,IAAAhB,EAAU,KAAI,GAAE,GAAGD,CAAA,CAAO,CAAA,EAClC,CAEJ,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as l } from "react";
|
|
3
|
-
import { E as F } from "./EmptyState-
|
|
4
|
-
import { B as N } from "./Button-
|
|
5
|
-
import { u as g } from "./useHomeTo-
|
|
6
|
-
import { a as v } from "./ConfigProvider-
|
|
3
|
+
import { E as F } from "./EmptyState-DXoaPC7o.js";
|
|
4
|
+
import { B as N } from "./Button-C415LPw_.js";
|
|
5
|
+
import { u as g } from "./useHomeTo-BL3e8Sc6.js";
|
|
6
|
+
import { a as v } from "./ConfigProvider-DVDGtCUc.js";
|
|
7
7
|
const k = l(function({
|
|
8
8
|
icon: e = "SearchStatus",
|
|
9
9
|
title: a,
|
|
@@ -33,4 +33,4 @@ const k = l(function({
|
|
|
33
33
|
export {
|
|
34
34
|
k as P
|
|
35
35
|
};
|
|
36
|
-
//# sourceMappingURL=PageNotFound-
|
|
36
|
+
//# sourceMappingURL=PageNotFound-BD3zX3cd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageNotFound-
|
|
1
|
+
{"version":3,"file":"PageNotFound-BD3zX3cd.js","sources":["../src/components/PageNotFound/PageNotFound.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react'\nimport { type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { EmptyState, type EmptyStateSize } from '../EmptyState'\nimport { Button } from '../Button'\nimport type { IconName } from '../../icons/names'\nimport { useHomeTo } from './useHomeTo'\n\nexport interface PageNotFoundProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Hero glyph — an `IconName`, any node, or `false` to hide it. Defaults to `SearchStatus`. */\n icon?: IconName | ReactNode | false\n /** Heading. Defaults to the localized `notFound.title`. */\n title?: ReactNode\n /** Muted description. Defaults to the localized `notFound.description`. */\n description?: ReactNode\n /** Action button label. Defaults to the localized `notFound.action`. */\n actionLabel?: ReactNode\n /** Where the action navigates. Defaults to the first allowed menu page (RBAC-aware), else `/`. */\n to?: string\n /** Show the \"back home\" action button. Defaults to `true` (hidden anyway when there's no router). */\n showAction?: boolean\n /** Faded-grid hero backdrop — passed to `EmptyState`. Defaults to `true` (its default). */\n pattern?: boolean\n /** Size — passed to `EmptyState`. Defaults to `md`. */\n size?: EmptyStateSize\n /*\n * The router's `NotFoundRouteProps`, declared so `defaultNotFoundComponent: PageNotFound` type-checks (an\n * all-optional props type that shares no field with the router's props fails TypeScript's weak-type check —\n * `data` / `isNotFound` alone satisfy it), and destructured away so they never reach the DOM.\n * `routeId` is `unknown` ON PURPOSE: the router types it `RouteIds<RegisteredRouter['routeTree']>`, and any\n * narrower type here (1.0.36 had `string`) makes the assignability check resolve that — i.e. `typeof router`\n * through the app's `Register` block — while `createRouter` is still inferring `router`: a cycle (TS7022 /\n * TS2502). `unknown` accepts it without looking. Guarded by `routerDefaults.registered.test-d.ts`.\n */\n /** Passed by TanStack Router when used as `defaultNotFoundComponent`; ignored. */\n data?: unknown\n /** Passed by TanStack Router when used as `defaultNotFoundComponent`; ignored. */\n isNotFound?: boolean\n /** Passed by TanStack Router when used as `defaultNotFoundComponent`; ignored (`unknown` — see above). */\n routeId?: unknown\n}\n\n/**\n * The shared **404** page. Drop it straight into TanStack Router as the\n * `defaultNotFoundComponent` — zero props needed: the title/description/action strings come from the\n * built-in i18n (`useT`), so they translate with the panel language, and the action navigates to the\n * **first allowed menu page** (the same RBAC-aware target as `FirstRouteRedirect`), falling back to\n * `/`. Built on `EmptyState` (hero glyph + title + description + action, `pattern` on by default), so\n * it renders inside the `RootLayout` content area with the shell/sidebar intact. Lenient: with no\n * router context the `EmptyState` still renders, just without the action button. Token-only styling.\n *\n * @example\n * const router = createRouter({\n * routeTree,\n * defaultNotFoundComponent: PageNotFound,\n * defaultErrorComponent: PageError,\n * })\n */\nexport const PageNotFound = forwardRef<HTMLDivElement, PageNotFoundProps>(function PageNotFound(\n {\n icon = 'SearchStatus',\n title,\n description,\n actionLabel,\n to,\n showAction = true,\n // the router's props — kept off the DOM\n data: _data,\n isNotFound: _isNotFound,\n routeId: _routeId,\n ...props\n },\n ref,\n) {\n const t = useT()\n // the first allowed menu page (RBAC-aware, `/` fallback); router is undefined outside a <RouterProvider>\n const { router, homeTo: resolvedTo } = useHomeTo(to)\n\n const canNavigate = !!router && resolvedTo != null\n const action =\n showAction && canNavigate ? (\n <Button size=\"sm\" onClick={() => router.navigate({ to: resolvedTo as LinkProps['to'] })}>\n {actionLabel ?? t('notFound.action')}\n </Button>\n ) : undefined\n\n return (\n <EmptyState\n ref={ref}\n icon={icon}\n title={title ?? t('notFound.title')}\n description={description ?? t('notFound.description')}\n action={action}\n {...props}\n />\n )\n})\n"],"names":["PageNotFound","forwardRef","icon","title","description","actionLabel","to","showAction","_data","_isNotFound","_routeId","props","ref","t","useT","router","resolvedTo","useHomeTo","canNavigate","action","jsx","Button","EmptyState"],"mappings":";;;;;;AA0DO,MAAMA,IAAeC,EAA8C,SACxE;AAAA,EACE,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,IAAAC;AAAA,EACA,YAAAC,IAAa;AAAA;AAAA,EAEb,MAAMC;AAAA,EACN,YAAYC;AAAA,EACZ,SAASC;AAAA,EACT,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GAEJ,EAAE,QAAAC,GAAQ,QAAQC,EAAA,IAAeC,EAAUX,CAAE,GAE7CY,IAAc,CAAC,CAACH,KAAUC,KAAc,MACxCG,IACJZ,KAAcW,IACZ,gBAAAE,EAACC,KAAO,MAAK,MAAK,SAAS,MAAMN,EAAO,SAAS,EAAE,IAAIC,GAA+B,GACnF,eAAeH,EAAE,iBAAiB,GACrC,IACE;AAEN,SACE,gBAAAO;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,KAAAV;AAAA,MACA,MAAAV;AAAA,MACA,OAAOC,KAASU,EAAE,gBAAgB;AAAA,MAClC,aAAaT,KAAeS,EAAE,sBAAsB;AAAA,MACpD,QAAAM;AAAA,MACC,GAAGR;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),g=require("react"),q=require("./EmptyState-
|
|
2
|
-
//# sourceMappingURL=PageNotFound-
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),g=require("react"),q=require("./EmptyState-CkkFHKrh.cjs"),N=require("./Button-mBZOvgyZ.cjs"),v=require("./useHomeTo-W1PDW5CU.cjs"),T=require("./ConfigProvider-DBU6rOIA.cjs"),f=g.forwardRef(function({icon:r="SearchStatus",title:u,description:i,actionLabel:s,to:c,showAction:a=!0,data:P,isNotFound:S,routeId:h,...d},F){const t=T.useT(),{router:o,homeTo:e}=v.useHomeTo(c),l=!!o&&e!=null,m=a&&l?n.jsx(N.Button,{size:"sm",onClick:()=>o.navigate({to:e}),children:s??t("notFound.action")}):void 0;return n.jsx(q.EmptyState,{ref:F,icon:r,title:u??t("notFound.title"),description:i??t("notFound.description"),action:m,...d})});exports.PageNotFound=f;
|
|
2
|
+
//# sourceMappingURL=PageNotFound-CTR6htwa.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageNotFound-
|
|
1
|
+
{"version":3,"file":"PageNotFound-CTR6htwa.cjs","sources":["../src/components/PageNotFound/PageNotFound.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from 'react'\nimport { type LinkProps } from '@tanstack/react-router'\nimport { useT } from '../../theme'\nimport { EmptyState, type EmptyStateSize } from '../EmptyState'\nimport { Button } from '../Button'\nimport type { IconName } from '../../icons/names'\nimport { useHomeTo } from './useHomeTo'\n\nexport interface PageNotFoundProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'color'> {\n /** Hero glyph — an `IconName`, any node, or `false` to hide it. Defaults to `SearchStatus`. */\n icon?: IconName | ReactNode | false\n /** Heading. Defaults to the localized `notFound.title`. */\n title?: ReactNode\n /** Muted description. Defaults to the localized `notFound.description`. */\n description?: ReactNode\n /** Action button label. Defaults to the localized `notFound.action`. */\n actionLabel?: ReactNode\n /** Where the action navigates. Defaults to the first allowed menu page (RBAC-aware), else `/`. */\n to?: string\n /** Show the \"back home\" action button. Defaults to `true` (hidden anyway when there's no router). */\n showAction?: boolean\n /** Faded-grid hero backdrop — passed to `EmptyState`. Defaults to `true` (its default). */\n pattern?: boolean\n /** Size — passed to `EmptyState`. Defaults to `md`. */\n size?: EmptyStateSize\n /*\n * The router's `NotFoundRouteProps`, declared so `defaultNotFoundComponent: PageNotFound` type-checks (an\n * all-optional props type that shares no field with the router's props fails TypeScript's weak-type check —\n * `data` / `isNotFound` alone satisfy it), and destructured away so they never reach the DOM.\n * `routeId` is `unknown` ON PURPOSE: the router types it `RouteIds<RegisteredRouter['routeTree']>`, and any\n * narrower type here (1.0.36 had `string`) makes the assignability check resolve that — i.e. `typeof router`\n * through the app's `Register` block — while `createRouter` is still inferring `router`: a cycle (TS7022 /\n * TS2502). `unknown` accepts it without looking. Guarded by `routerDefaults.registered.test-d.ts`.\n */\n /** Passed by TanStack Router when used as `defaultNotFoundComponent`; ignored. */\n data?: unknown\n /** Passed by TanStack Router when used as `defaultNotFoundComponent`; ignored. */\n isNotFound?: boolean\n /** Passed by TanStack Router when used as `defaultNotFoundComponent`; ignored (`unknown` — see above). */\n routeId?: unknown\n}\n\n/**\n * The shared **404** page. Drop it straight into TanStack Router as the\n * `defaultNotFoundComponent` — zero props needed: the title/description/action strings come from the\n * built-in i18n (`useT`), so they translate with the panel language, and the action navigates to the\n * **first allowed menu page** (the same RBAC-aware target as `FirstRouteRedirect`), falling back to\n * `/`. Built on `EmptyState` (hero glyph + title + description + action, `pattern` on by default), so\n * it renders inside the `RootLayout` content area with the shell/sidebar intact. Lenient: with no\n * router context the `EmptyState` still renders, just without the action button. Token-only styling.\n *\n * @example\n * const router = createRouter({\n * routeTree,\n * defaultNotFoundComponent: PageNotFound,\n * defaultErrorComponent: PageError,\n * })\n */\nexport const PageNotFound = forwardRef<HTMLDivElement, PageNotFoundProps>(function PageNotFound(\n {\n icon = 'SearchStatus',\n title,\n description,\n actionLabel,\n to,\n showAction = true,\n // the router's props — kept off the DOM\n data: _data,\n isNotFound: _isNotFound,\n routeId: _routeId,\n ...props\n },\n ref,\n) {\n const t = useT()\n // the first allowed menu page (RBAC-aware, `/` fallback); router is undefined outside a <RouterProvider>\n const { router, homeTo: resolvedTo } = useHomeTo(to)\n\n const canNavigate = !!router && resolvedTo != null\n const action =\n showAction && canNavigate ? (\n <Button size=\"sm\" onClick={() => router.navigate({ to: resolvedTo as LinkProps['to'] })}>\n {actionLabel ?? t('notFound.action')}\n </Button>\n ) : undefined\n\n return (\n <EmptyState\n ref={ref}\n icon={icon}\n title={title ?? t('notFound.title')}\n description={description ?? t('notFound.description')}\n action={action}\n {...props}\n />\n )\n})\n"],"names":["PageNotFound","forwardRef","icon","title","description","actionLabel","to","showAction","_data","_isNotFound","_routeId","props","ref","useT","router","resolvedTo","useHomeTo","canNavigate","action","jsx","Button","EmptyState"],"mappings":"gOA0DaA,EAAeC,EAAAA,WAA8C,SACxE,CACE,KAAAC,EAAO,eACP,MAAAC,EACA,YAAAC,EACA,YAAAC,EACA,GAAAC,EACA,WAAAC,EAAa,GAEb,KAAMC,EACN,WAAYC,EACZ,QAASC,EACT,GAAGC,CACL,EACAC,EACA,CACA,MAAM,EAAIC,EAAAA,KAAA,EAEJ,CAAE,OAAAC,EAAQ,OAAQC,CAAA,EAAeC,EAAAA,UAAUV,CAAE,EAE7CW,EAAc,CAAC,CAACH,GAAUC,GAAc,KACxCG,EACJX,GAAcU,EACZE,EAAAA,IAACC,EAAAA,QAAO,KAAK,KAAK,QAAS,IAAMN,EAAO,SAAS,CAAE,GAAIC,EAA+B,EACnF,YAAe,EAAE,iBAAiB,EACrC,EACE,OAEN,OACEI,EAAAA,IAACE,EAAAA,WAAA,CACC,IAAAT,EACA,KAAAV,EACA,MAAOC,GAAS,EAAE,gBAAgB,EAClC,YAAaC,GAAe,EAAE,sBAAsB,EACpD,OAAAc,EACC,GAAGP,CAAA,CAAA,CAGV,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const r=require("react/jsx-runtime"),P=require("react"),d=require("clsx"),U=require("./Icon-CBg21lKA.cjs"),V=require("./ConfigProvider-
|
|
2
|
-
//# sourceMappingURL=Pagination-
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),P=require("react"),d=require("clsx"),U=require("./Icon-CBg21lKA.cjs"),V=require("./ConfigProvider-DBU6rOIA.cjs"),x=(e,t)=>Array.from({length:Math.max(t-e+1,0)},(l,s)=>e+s);function W({count:e,page:t,siblingCount:l=1,boundaryCount:s=1}){if(e<=0)return[];const _=x(1,Math.min(s,e)),p=x(Math.max(e-s+1,s+1),e),m=Math.max(Math.min(t-l,e-s-l*2-1),s+2),g=Math.min(Math.max(t+l,s+l*2+2),p.length>0?p[0]-2:e-1);return[..._,...m>s+2?["start-ellipsis"]:s+1<e-s?[s+1]:[],...x(m,g),...g<e-s-1?["end-ellipsis"]:e-s>s?[e-s]:[],...p]}const X="_pagination_889w0_3",Y="_list_889w0_8",Z="_item_889w0_18",u="_sm_889w0_28",y="_md_889w0_33",C="_lg_889w0_38",ss="_page_889w0_45",es="_selected_889w0_65",as="_outlined_889w0_82",ts="_rounded_889w0_98",is="_arrow_889w0_26",ls="_flip_889w0_109",ns="_ellipsis_889w0_114",a={pagination:X,list:Y,item:Z,sm:u,md:y,lg:C,page:ss,selected:es,outlined:as,rounded:ts,arrow:is,flip:ls,ellipsis:ns},q=(e,t,l)=>Math.min(Math.max(e,t),l),rs=P.forwardRef(function({count:t,page:l,defaultPage:s=1,onChange:_,siblingCount:p=1,boundaryCount:m=1,showFirstButton:g=!1,showLastButton:$=!1,hidePrevButton:z=!1,hideNextButton:A=!1,variant:I="outlined",size:w="md",color:h="accent",rounded:L=!1,disabled:j=!1,className:R,style:S,"aria-label":k,...b},E){const v=l!==void 0,[T,B]=P.useState(s),M=Math.max(t,1),n=q(v?l:T,1,M),N=i=>{const c=q(i,1,M);c!==n&&(v||B(c),_==null||_(c))},o=V.useT(),D=k??o("pagination.label"),F=W({count:t,page:n,siblingCount:p,boundaryCount:m}),G={"--tz-btn-rgb":`var(--tz-color-${h}-rgb)`,"--tz-btn-on":`var(--tz-color-${h}-contrast, #fff)`,...S},f=(i,c,H,J,K,O,Q=!1)=>K?null:r.jsx("li",{className:a.item,children:r.jsx("button",{type:"button",className:d.clsx(a.page,a.arrow),"aria-label":H,disabled:j||O,onClick:()=>N(J),children:r.jsx(U.Icon,{name:c,size:w,className:Q?a.flip:void 0})})},i);return r.jsx("nav",{ref:E,"aria-label":D,className:d.clsx(a.pagination,a[I],a[w],L&&a.rounded,R),style:G,...b,children:r.jsxs("ul",{className:a.list,children:[g&&f("first","Previous",o("pagination.first"),1,!1,n<=1),f("prev","ArrowLeft",o("pagination.previous"),n-1,z,n<=1),F.map((i,c)=>typeof i=="number"?r.jsx("li",{className:a.item,children:r.jsx("button",{type:"button",className:d.clsx(a.page,i===n&&a.selected),"aria-label":o("pagination.page",{page:i}),"aria-current":i===n?"page":void 0,disabled:j,onClick:()=>N(i),children:i})},i):r.jsx("li",{className:a.item,"aria-hidden":!0,children:r.jsx("span",{className:a.ellipsis,children:"…"})},`${i}-${c}`)),f("next","ArrowLeft",o("pagination.next"),n+1,A,n>=t,!0),$&&f("last","Next",o("pagination.last"),t,!1,n>=t)]})})});exports.Pagination=rs;
|
|
2
|
+
//# sourceMappingURL=Pagination-BJvLUjQ0.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination-DO2Os4an.cjs","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabelProp,\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const ariaLabel = ariaLabelProp ?? t('pagination.label')\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n\n // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next glyph is the left one flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabelProp","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","ariaLabel","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":"mKAmBMA,EAAQ,CAACC,EAAeC,IAC5B,MAAM,KAAK,CAAE,OAAQ,KAAK,IAAIA,EAAMD,EAAQ,EAAG,CAAC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EACdgC,EAAO/B,CAAI,EACXE,GAAW6B,EAAO,QAClB3B,CAAA,EAEF,MAAOkB,EACN,GAAGf,EAEJ,SAAA2B,EAAAA,KAAC,KAAA,CAAG,UAAWH,EAAO,KACnB,SAAA,CAAApC,GACC4B,EAAQ,QAAS,WAAYL,EAAE,kBAAkB,EAAG,EAAG,GAAOJ,GAAW,CAAC,EAC3ES,EACC,OACA,YACAL,EAAE,qBAAqB,EACvBJ,EAAU,EACVjB,EACAiB,GAAW,CAAA,EAEZO,EAAM,IAAI,CAACc,EAAM1D,IAChB,OAAO0D,GAAS,SACdL,EAAAA,IAAC,KAAA,CAAc,UAAWC,EAAO,KAC/B,SAAAD,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWE,EAAAA,KAAKD,EAAO,KAAMI,IAASrB,GAAWiB,EAAO,QAAQ,EAChE,aAAYb,EAAE,kBAAmB,CAAE,KAAMiB,EAAM,EAC/C,eAAcA,IAASrB,EAAU,OAAS,OAC1C,SAAAX,EACA,QAAS,IAAMY,EAAGoB,CAAI,EAErB,SAAAA,CAAA,CAAA,CACH,EAVOA,CAWT,EAEAL,EAAAA,IAAC,MAAwB,UAAWC,EAAO,KAAM,cAAW,GAC1D,eAAC,OAAA,CAAK,UAAWA,EAAO,SAAU,SAAA,GAAA,CAAC,GAD5B,GAAGI,CAAI,IAAI1D,CAAC,EAErB,CAAA,EAGH8C,EACC,OACA,YACAL,EAAE,iBAAiB,EACnBJ,EAAU,EACVhB,EACAgB,GAAWnC,EACX,EAAA,EAEDiB,GACC2B,EAAQ,OAAQ,OAAQL,EAAE,iBAAiB,EAAGvC,EAAO,GAAOmC,GAAWnC,CAAK,CAAA,CAAA,CAChF,CAAA,CAAA,CAGN,CAAC"}
|
|
1
|
+
{"version":3,"file":"Pagination-BJvLUjQ0.cjs","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabelProp,\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const ariaLabel = ariaLabelProp ?? t('pagination.label')\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n\n // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next glyph is the left one flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabelProp","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","ariaLabel","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":"mKAmBMA,EAAQ,CAACC,EAAeC,IAC5B,MAAM,KAAK,CAAE,OAAQ,KAAK,IAAIA,EAAMD,EAAQ,EAAG,CAAC,CAAA,EAAK,CAACE,EAAGC,IAAMH,EAAQG,CAAC,EAOnE,SAASC,EAAgB,CAC9B,MAAAC,EACA,KAAAC,EACA,aAAAC,EAAe,EACf,cAAAC,EAAgB,CA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AO,KACnB,SAAA,CAAApC,GACC4B,EAAQ,QAAS,WAAYL,EAAE,kBAAkB,EAAG,EAAG,GAAOJ,GAAW,CAAC,EAC3ES,EACC,OACA,YACAL,EAAE,qBAAqB,EACvBJ,EAAU,EACVjB,EACAiB,GAAW,CAAA,EAEZO,EAAM,IAAI,CAACc,EAAM1D,IAChB,OAAO0D,GAAS,SACdL,EAAAA,IAAC,KAAA,CAAc,UAAWC,EAAO,KAC/B,SAAAD,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWE,EAAAA,KAAKD,EAAO,KAAMI,IAASrB,GAAWiB,EAAO,QAAQ,EAChE,aAAYb,EAAE,kBAAmB,CAAE,KAAMiB,EAAM,EAC/C,eAAcA,IAASrB,EAAU,OAAS,OAC1C,SAAAX,EACA,QAAS,IAAMY,EAAGoB,CAAI,EAErB,SAAAA,CAAA,CAAA,CACH,EAVOA,CAWT,EAEAL,EAAAA,IAAC,MAAwB,UAAWC,EAAO,KAAM,cAAW,GAC1D,eAAC,OAAA,CAAK,UAAWA,EAAO,SAAU,SAAA,GAAA,CAAC,GAD5B,GAAGI,CAAI,IAAI1D,CAAC,EAErB,CAAA,EAGH8C,EACC,OACA,YACAL,EAAE,iBAAiB,EACnBJ,EAAU,EACVhB,EACAgB,GAAWnC,EACX,EAAA,EAEDiB,GACC2B,EAAQ,OAAQ,OAAQL,EAAE,iBAAiB,EAAGvC,EAAO,GAAOmC,GAAWnC,CAAK,CAAA,CAAA,CAChF,CAAA,CAAA,CAGN,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as Q } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as U, useState as V } from "react";
|
|
3
3
|
import { clsx as d } from "clsx";
|
|
4
4
|
import { b as W } from "./Icon-B7DJn8Tw.js";
|
|
5
|
-
import { a as X } from "./ConfigProvider-
|
|
5
|
+
import { a as X } from "./ConfigProvider-DVDGtCUc.js";
|
|
6
6
|
const w = (s, t) => Array.from({ length: Math.max(t - s + 1, 0) }, (l, a) => s + a);
|
|
7
7
|
function Y({
|
|
8
8
|
count: s,
|
|
@@ -136,4 +136,4 @@ const Z = "_pagination_889w0_3", y = "_list_889w0_8", u = "_item_889w0_18", C =
|
|
|
136
136
|
export {
|
|
137
137
|
ga as P
|
|
138
138
|
};
|
|
139
|
-
//# sourceMappingURL=Pagination-
|
|
139
|
+
//# sourceMappingURL=Pagination-qKjISBJ9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination-BH8ACaAC.js","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabelProp,\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const ariaLabel = ariaLabelProp ?? t('pagination.label')\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n\n // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next glyph is the left one flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabelProp","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","ariaLabel","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":";;;;;AAmBA,MAAMA,IAAQ,CAACC,GAAeC,MAC5B,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAIA,IAAMD,IAAQ,GAAG,CAAC,EAAA,GAAK,CAACE,GAAGC,MAAMH,IAAQG,CAAC;AAOnE,SAASC,EAAgB;AAAA,EAC9B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,eAAAC,IAAgB;AAClB,GAA6C;AAC3C,MAAIH,KAAS,EAAG,QAAO,CAAA;AAGvB,QAAMI,IAAaV,EAAM,GAAG,KAAK,IAAIS,GAAeH,CAAK,CAAC,GACpDK,IAAWX,EAAM,KAAK,IAAIM,IAAQG,IAAgB,GAAGA,IAAgB,CAAC,GAAGH,CAAK,GAG9EM,IAAgB,KAAK;AAAA,IACzB,KAAK,IAAIL,IAAOC,GAAcF,IAAQG,IAAgBD,IAAe,IAAI,CAAC;AAAA,IAC1EC,IAAgB;AAAA,EAAA,GAEZI,IAAc,KAAK;AAAA,IACvB,KAAK,IAAIN,IAAOC,GAAcC,IAAgBD,IAAe,IAAI,CAAC;AAAA,IAClEG,EAAS,SAAS,IAAIA,EAAS,CAAC,IAAI,IAAIL,IAAQ;AAAA,EAAA;AAGlD,SAAO;AAAA,IACL,GAAGI;AAAA;AAAA,IAEH,GAAIE,IAAgBH,IAAgB,IAC/B,CAAC,gBAAgB,IAClBA,IAAgB,IAAIH,IAAQG,IAC1B,CAACA,IAAgB,CAAC,IAClB,CAAA;AAAA,IACN,GAAGT,EAAMY,GAAeC,CAAW;AAAA;AAAA,IAEnC,GAAIA,IAAcP,IAAQG,IAAgB,IACrC,CAAC,cAAc,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AAA,cACC,MAAK;AAAA,cACL,WAAWE,EAAKD,EAAO,MAAMI,MAASrB,KAAWiB,EAAO,QAAQ;AAAA,cAChE,cAAYb,EAAE,mBAAmB,EAAE,MAAMiB,GAAM;AAAA,cAC/C,gBAAcA,MAASrB,IAAU,SAAS;AAAA,cAC1C,UAAAX;AAAA,cACA,SAAS,MAAMY,EAAGoB,CAAI;AAAA,cAErB,UAAAA;AAAA,YAAA;AAAA,UAAA,EACH,GAVOA,CAWT,IAEA,gBAAAL,EAAC,QAAwB,WAAWC,EAAO,MAAM,eAAW,IAC1D,4BAAC,QAAA,EAAK,WAAWA,EAAO,UAAU,UAAA,IAAA,CAAC,KAD5B,GAAGI,CAAI,IAAI1D,CAAC,EAErB;AAAA,QAAA;AAAA,QAGH8C;AAAA,UACC;AAAA,UACA;AAAA,UACAL,EAAE,iBAAiB;AAAA,UACnBJ,IAAU;AAAA,UACVhB;AAAA,UACAgB,KAAWnC;AAAA,UACX;AAAA,QAAA;AAAA,QAEDiB,KACC2B,EAAQ,QAAQ,QAAQL,EAAE,iBAAiB,GAAGvC,GAAO,IAAOmC,KAAWnC,CAAK;AAAA,MAAA,EAAA,CAChF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Pagination-qKjISBJ9.js","sources":["../src/components/Pagination/paginationRange.ts","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["/** A gap placeholder rendered as `…` — at the start (`1 … 4`) or end (`6 … 10`) of the range. */\nexport type PaginationEllipsis = 'start-ellipsis' | 'end-ellipsis'\n\n/** One item in a pagination range: a 1-based page number, or an ellipsis placeholder. */\nexport type PaginationItem = number | PaginationEllipsis\n\n/** Inputs for {@link paginationRange}. */\nexport interface PaginationRangeOptions {\n /** Total number of pages. */\n count: number\n /** Current page (1-based). */\n page: number\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n}\n\n/** Inclusive integer range `[start, end]` (empty when `end < start`). */\nconst range = (start: number, end: number): number[] =>\n Array.from({ length: Math.max(end - start + 1, 0) }, (_, i) => start + i)\n\n/**\n * Build the page-item sequence for a pager — the boundary pages, the current page with its siblings,\n * and `start`/`end` ellipses where pages are skipped (the classic `1 … 4 5 6 … 10`). Pure and\n * framework-free so it can be unit-tested in isolation and reused. Assumes `1 <= page <= count`.\n */\nexport function paginationRange({\n count,\n page,\n siblingCount = 1,\n boundaryCount = 1,\n}: PaginationRangeOptions): PaginationItem[] {\n if (count <= 0) return []\n\n // Pages pinned at each edge.\n const startPages = range(1, Math.min(boundaryCount, count))\n const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count)\n\n // The window of pages around the current one, clamped so it never overlaps the boundaries.\n const siblingsStart = Math.max(\n Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1),\n boundaryCount + 2,\n )\n const siblingsEnd = Math.min(\n Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),\n endPages.length > 0 ? endPages[0] - 2 : count - 1,\n )\n\n return [\n ...startPages,\n // A start ellipsis, OR the single page that sits between the start boundary and the siblings.\n ...(siblingsStart > boundaryCount + 2\n ? (['start-ellipsis'] as PaginationItem[])\n : boundaryCount + 1 < count - boundaryCount\n ? [boundaryCount + 1]\n : []),\n ...range(siblingsStart, siblingsEnd),\n // An end ellipsis, OR the single page between the siblings and the end boundary.\n ...(siblingsEnd < count - boundaryCount - 1\n ? (['end-ellipsis'] as PaginationItem[])\n : count - boundaryCount > boundaryCount\n ? [count - boundaryCount]\n : []),\n ...endPages,\n ]\n}\n","import {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { Icon, type IconName } from '../Icon'\nimport { useT, type ThemeColor } from '../../theme'\nimport { paginationRange } from './paginationRange'\nimport styles from './Pagination.module.css'\n\nexport type PaginationVariant = 'outlined' | 'text'\nexport type PaginationSize = 'sm' | 'md' | 'lg'\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onChange'> {\n /** Total number of pages (required). From a row count, pass `Math.ceil(total / pageSize)`. */\n count: number\n /** Controlled current page (1-based). */\n page?: number\n /** Initial page for uncontrolled use (1-based). Defaults to `1`. */\n defaultPage?: number\n /** Fires with the next page (1-based) when a page or arrow is activated. */\n onChange?: (page: number) => void\n /** Pages shown on each side of the current page. Defaults to `1`. */\n siblingCount?: number\n /** Pages always shown at the start and end. Defaults to `1`. */\n boundaryCount?: number\n /** Show a jump-to-first-page button before the previous arrow. Defaults to `false`. */\n showFirstButton?: boolean\n /** Show a jump-to-last-page button after the next arrow. Defaults to `false`. */\n showLastButton?: boolean\n /** Hide the previous-page arrow. Defaults to `false`. */\n hidePrevButton?: boolean\n /** Hide the next-page arrow. Defaults to `false`. */\n hideNextButton?: boolean\n /** Item style: `outlined` (bordered boxes, default) or `text` (borderless). */\n variant?: PaginationVariant\n /** Control size — sets the box, font, and icon sizes. Defaults to `md`. */\n size?: PaginationSize\n /** Theme palette token that tints the selected page. Defaults to `accent`. */\n color?: ThemeColor\n /** Render circular page buttons instead of rounded rectangles. Defaults to `false`. */\n rounded?: boolean\n /** Disable the whole control. Defaults to `false`. */\n disabled?: boolean\n}\n\nconst clamp = (n: number, lo: number, hi: number) => Math.min(Math.max(n, lo), hi)\n\n/**\n * A page navigator — previous/next arrows around a numbered range with `…` gaps (`1 … 4 5 6 … 10`),\n * the classic pager. Reusable across tables, lists, and galleries: drive it with `count` (total\n * pages) + `page`/`onChange`, computing `count` as `Math.ceil(total / pageSize)`. The selected page\n * is tinted via the shared `--tz-btn-rgb` pattern; unselected items are bordered (`outlined`) or\n * borderless (`text`). Controlled (`page` + `onChange`) or uncontrolled (`defaultPage`).\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblingCount = 1,\n boundaryCount = 1,\n showFirstButton = false,\n showLastButton = false,\n hidePrevButton = false,\n hideNextButton = false,\n variant = 'outlined',\n size = 'md',\n color = 'accent',\n rounded = false,\n disabled = false,\n className,\n style,\n 'aria-label': ariaLabelProp,\n ...props\n },\n ref,\n) {\n const isControlled = page !== undefined\n const [internal, setInternal] = useState(defaultPage)\n const lastPage = Math.max(count, 1)\n const current = clamp(isControlled ? page! : internal, 1, lastPage)\n\n const go = (next: number) => {\n const target = clamp(next, 1, lastPage)\n if (target === current) return\n if (!isControlled) setInternal(target)\n onChange?.(target)\n }\n\n const t = useT()\n const ariaLabel = ariaLabelProp ?? t('pagination.label')\n const items = paginationRange({ count, page: current, siblingCount, boundaryCount })\n\n // The selected fill + its readable text color, derived once via the shared button-tint vars.\n const rootStyle = {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n '--tz-btn-on': `var(--tz-color-${color}-contrast, #fff)`,\n ...style,\n } as CSSProperties\n\n // An arrow / jump control. `flip` mirrors the (left-pointing) icon to face right — the icon set has\n // no matching plain right arrow, so the next glyph is the left one flipped for symmetry.\n const control = (\n key: string,\n icon: IconName,\n label: string,\n target: number,\n hidden: boolean,\n atBound: boolean,\n flip = false,\n ): ReactNode =>\n hidden ? null : (\n <li key={key} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, styles.arrow)}\n aria-label={label}\n disabled={disabled || atBound}\n onClick={() => go(target)}\n >\n <Icon name={icon} size={size} className={flip ? styles.flip : undefined} />\n </button>\n </li>\n )\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel}\n className={clsx(\n styles.pagination,\n styles[variant],\n styles[size],\n rounded && styles.rounded,\n className,\n )}\n style={rootStyle}\n {...props}\n >\n <ul className={styles.list}>\n {showFirstButton &&\n control('first', 'Previous', t('pagination.first'), 1, false, current <= 1)}\n {control(\n 'prev',\n 'ArrowLeft',\n t('pagination.previous'),\n current - 1,\n hidePrevButton,\n current <= 1,\n )}\n {items.map((item, i) =>\n typeof item === 'number' ? (\n <li key={item} className={styles.item}>\n <button\n type=\"button\"\n className={clsx(styles.page, item === current && styles.selected)}\n aria-label={t('pagination.page', { page: item })}\n aria-current={item === current ? 'page' : undefined}\n disabled={disabled}\n onClick={() => go(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={`${item}-${i}`} className={styles.item} aria-hidden>\n <span className={styles.ellipsis}>…</span>\n </li>\n ),\n )}\n {control(\n 'next',\n 'ArrowLeft',\n t('pagination.next'),\n current + 1,\n hideNextButton,\n current >= count,\n true,\n )}\n {showLastButton &&\n control('last', 'Next', t('pagination.last'), count, false, current >= count)}\n </ul>\n </nav>\n )\n})\n"],"names":["range","start","end","_","i","paginationRange","count","page","siblingCount","boundaryCount","startPages","endPages","siblingsStart","siblingsEnd","clamp","n","lo","hi","Pagination","forwardRef","defaultPage","onChange","showFirstButton","showLastButton","hidePrevButton","hideNextButton","variant","size","color","rounded","disabled","className","style","ariaLabelProp","props","ref","isControlled","internal","setInternal","useState","lastPage","current","go","next","target","t","useT","ariaLabel","items","rootStyle","control","key","icon","label","hidden","atBound","flip","jsx","styles","clsx","Icon","jsxs","item"],"mappings":";;;;;AAmBA,MAAMA,IAAQ,CAACC,GAAeC,MAC5B,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAIA,IAAMD,IAAQ,GAAG,CAAC,EAAA,GAAK,CAACE,GAAGC,MAAMH,IAAQG,CAAC;AAOnE,SAASC,EAAgB;AAAA,EAC9B,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,eAAAC,IAAgB;AAClB,GAA6C;AAC3C,MAAIH,KAAS,EAAG,QAAO,CAAA;AAGvB,QAAMI,IAAaV,EAAM,GAAG,KAAK,IAAIS,GAAeH,CAAK,CAAC,GACpDK,IAAWX,EAAM,KAAK,IAAIM,IAAQG,IAAgB,GAAGA,IAAgB,CAAC,GAAGH,CAAK,GAG9EM,IAAgB,KAAK;AAAA,IACzB,KAAK,IAAIL,IAAOC,GAAcF,IAAQG,IAAgBD,IAAe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,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),l=require("react"),y=require("clsx"),_=require("./formContext-bTWrqdEV.cjs"),z=require("./ColorPicker-
|
|
2
|
-
//# sourceMappingURL=PaletteField-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=require("react"),y=require("clsx"),_=require("./formContext-bTWrqdEV.cjs"),z=require("./ColorPicker-Doaegll4.cjs"),B=require("./ColorRamp-CGw4D9bf.cjs"),h="_root_bbykz_3",v={root:h},w=l.forwardRef(function({rampName:u,paletteOptions:a,rampSize:d="md",hideRamp:x=!1,showBounds:m=!0,opaque:f=!0,onCopyStep:q,value:o,defaultValue:s,onChange:r,name:t,className:C,style:p,...F},P){const c=_.useFormContext(),n=!!(c&&t),[j,R]=l.useState(s??""),b=o!==void 0?o:n?c.values[t]??"":j,k=i=>{o===void 0&&!n&&R(i),r==null||r(i)};return e.jsxs("div",{ref:P,className:y.clsx(v.root,C),style:p,children:[e.jsx(z.ColorPicker,{...F,name:t,value:o,defaultValue:s,onChange:k,alpha:!f}),!x&&e.jsx(B.ColorRamp,{baseColor:b,name:u??t??"color",options:a,size:d,showBounds:m,onCopy:q})]})});exports.PaletteField=w;
|
|
2
|
+
//# sourceMappingURL=PaletteField-CDS9CJW9.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaletteField-
|
|
1
|
+
{"version":3,"file":"PaletteField-CDS9CJW9.cjs","sources":["../src/components/PaletteField/PaletteField.tsx"],"sourcesContent":["import { forwardRef, useState, type CSSProperties } from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { GeneratePaletteOptions } from '../../helpers/palette'\nimport { ColorPicker, type ColorPickerProps } from '../ColorPicker'\nimport { ColorRamp, type ColorRampProps } from '../ColorRamp'\nimport styles from './PaletteField.module.css'\n\nexport interface PaletteFieldProps extends Omit<ColorPickerProps, 'swatches'> {\n /** Token prefix for the ramp (see `ColorRamp.name`). Defaults to `name`, then `'color'`. */\n rampName?: string\n /** `generatePalette` overrides, forwarded to the ramp. */\n paletteOptions?: GeneratePaletteOptions\n /** Ramp height (default `md`). */\n rampSize?: ColorRampProps['size']\n /** Hide the ramp (default `false`). */\n hideRamp?: boolean\n /**\n * Show the ramp's \"Lightest … Darkest\" row (see `ColorRamp.showBounds`). Default `true`. Ignored\n * with `hideRamp`.\n */\n showBounds?: boolean\n /** Brand colors are opaque: hide the alpha slider and emit `#rrggbb` only (default `true`). */\n opaque?: boolean\n /** Forwarded to the ramp's `onCopy`. */\n onCopyStep?: ColorRampProps['onCopy']\n className?: string\n style?: CSSProperties\n}\n\n/**\n * The composition every configurator page repeats: a **`ColorPicker`** with the **`ColorRamp`** of its\n * current value directly beneath, both bound to the same value. Works controlled (`value` +\n * `onChange`), uncontrolled (`defaultValue`), and inside `<Form>` by `name` — the ramp always reflects\n * the live field value (including `setValue` / `reset`), read through the same `useFormContext` binding\n * `ColorPicker` uses, so there is exactly one source of truth. `label` / `helperText` / `error` /\n * `required` go to the picker; the ramp shows no chrome of its own here (its bounds row stays unless\n * `showBounds={false}`). `opaque` (default `true`) passes `alpha={false}` to the picker: no alpha\n * slider, `#rrggbb` only.\n */\nexport const PaletteField = forwardRef<HTMLDivElement, PaletteFieldProps>(function PaletteField(\n {\n rampName,\n paletteOptions,\n rampSize = 'md',\n hideRamp = false,\n showBounds = true,\n opaque = true,\n onCopyStep,\n value,\n defaultValue,\n onChange,\n name,\n className,\n style,\n ...picker\n },\n ref,\n) {\n // Mirror ColorPicker's own binding exactly: controlled prop → form value (by `name`) → internal state.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const current =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : internal\n\n const handleChange = (color: string) => {\n // the picker already writes the form value when bound; we only track the uncontrolled case\n if (value === undefined && !isFormBound) setInternal(color)\n onChange?.(color)\n }\n\n return (\n <div ref={ref} className={clsx(styles.root, className)} style={style}>\n <ColorPicker\n {...picker}\n name={name}\n value={value}\n defaultValue={defaultValue}\n onChange={handleChange}\n alpha={!opaque}\n />\n {!hideRamp && (\n <ColorRamp\n baseColor={current}\n name={rampName ?? name ?? 'color'}\n options={paletteOptions}\n size={rampSize}\n showBounds={showBounds}\n onCopy={onCopyStep}\n />\n )}\n </div>\n )\n})\n"],"names":["PaletteField","forwardRef","rampName","paletteOptions","rampSize","hideRamp","showBounds","opaque","onCopyStep","value","defaultValue","onChange","name","className","style","picker","ref","form","useFormContext","isFormBound","internal","setInternal","useState","current","handleChange","color","jsxs","clsx","styles","jsx","ColorPicker","ColorRamp"],"mappings":"0OAwCaA,EAAeC,EAAAA,WAA8C,SACxE,CACE,SAAAC,EACA,eAAAC,EACA,SAAAC,EAAW,KACX,SAAAC,EAAW,GACX,WAAAC,EAAa,GACb,OAAAC,EAAS,GACT,WAAAC,EACA,MAAAC,EACA,aAAAC,EACA,SAAAC,EACA,KAAAC,EACA,UAAAC,EACA,MAAAC,EACA,GAAGC,CACL,EACAC,EACA,CAEA,MAAMC,EAAOC,EAAAA,eAAA,EACPC,EAAc,GAAQF,GAAQL,GAC9B,CAACQ,EAAUC,CAAW,EAAIC,EAAAA,SAAiBZ,GAAgB,EAAE,EAC7Da,EACJd,IAAU,OACNA,EACAU,EACIF,EAAM,OAAOL,CAAK,GAA4B,GAChDQ,EAEFI,EAAgBC,GAAkB,CAElChB,IAAU,QAAa,CAACU,KAAyBM,CAAK,EAC1Dd,GAAA,MAAAA,EAAWc,EACb,EAEA,OACEC,OAAC,OAAI,IAAAV,EAAU,UAAWW,EAAAA,KAAKC,EAAO,KAAMf,CAAS,EAAG,MAAAC,EACtD,SAAA,CAAAe,EAAAA,IAACC,EAAAA,YAAA,CACE,GAAGf,EACJ,KAAAH,EACA,MAAAH,EACA,aAAAC,EACA,SAAUc,EACV,MAAO,CAACjB,CAAA,CAAA,EAET,CAACF,GACAwB,EAAAA,IAACE,EAAAA,UAAA,CACC,UAAWR,EACX,KAAMrB,GAAYU,GAAQ,QAC1B,QAAST,EACT,KAAMC,EACN,WAAAE,EACA,OAAQE,CAAA,CAAA,CACV,EAEJ,CAEJ,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { jsxs as k, jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as z, useState as B } from "react";
|
|
3
3
|
import { clsx as R } from "clsx";
|
|
4
4
|
import { u as h } from "./formContext-B7ln1Miy.js";
|
|
5
|
-
import { C as v } from "./ColorPicker-
|
|
6
|
-
import { C as w } from "./ColorRamp-
|
|
5
|
+
import { C as v } from "./ColorPicker-Bidev2DJ.js";
|
|
6
|
+
import { C as w } from "./ColorRamp-Reb0q69d.js";
|
|
7
7
|
const I = "_root_bbykz_3", N = {
|
|
8
8
|
root: I
|
|
9
9
|
}, J = z(function({
|
|
@@ -53,4 +53,4 @@ const I = "_root_bbykz_3", N = {
|
|
|
53
53
|
export {
|
|
54
54
|
J as P
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=PaletteField-
|
|
56
|
+
//# sourceMappingURL=PaletteField-y8KpR4Ap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaletteField-
|
|
1
|
+
{"version":3,"file":"PaletteField-y8KpR4Ap.js","sources":["../src/components/PaletteField/PaletteField.tsx"],"sourcesContent":["import { forwardRef, useState, type CSSProperties } from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport type { GeneratePaletteOptions } from '../../helpers/palette'\nimport { ColorPicker, type ColorPickerProps } from '../ColorPicker'\nimport { ColorRamp, type ColorRampProps } from '../ColorRamp'\nimport styles from './PaletteField.module.css'\n\nexport interface PaletteFieldProps extends Omit<ColorPickerProps, 'swatches'> {\n /** Token prefix for the ramp (see `ColorRamp.name`). Defaults to `name`, then `'color'`. */\n rampName?: string\n /** `generatePalette` overrides, forwarded to the ramp. */\n paletteOptions?: GeneratePaletteOptions\n /** Ramp height (default `md`). */\n rampSize?: ColorRampProps['size']\n /** Hide the ramp (default `false`). */\n hideRamp?: boolean\n /**\n * Show the ramp's \"Lightest … Darkest\" row (see `ColorRamp.showBounds`). Default `true`. Ignored\n * with `hideRamp`.\n */\n showBounds?: boolean\n /** Brand colors are opaque: hide the alpha slider and emit `#rrggbb` only (default `true`). */\n opaque?: boolean\n /** Forwarded to the ramp's `onCopy`. */\n onCopyStep?: ColorRampProps['onCopy']\n className?: string\n style?: CSSProperties\n}\n\n/**\n * The composition every configurator page repeats: a **`ColorPicker`** with the **`ColorRamp`** of its\n * current value directly beneath, both bound to the same value. Works controlled (`value` +\n * `onChange`), uncontrolled (`defaultValue`), and inside `<Form>` by `name` — the ramp always reflects\n * the live field value (including `setValue` / `reset`), read through the same `useFormContext` binding\n * `ColorPicker` uses, so there is exactly one source of truth. `label` / `helperText` / `error` /\n * `required` go to the picker; the ramp shows no chrome of its own here (its bounds row stays unless\n * `showBounds={false}`). `opaque` (default `true`) passes `alpha={false}` to the picker: no alpha\n * slider, `#rrggbb` only.\n */\nexport const PaletteField = forwardRef<HTMLDivElement, PaletteFieldProps>(function PaletteField(\n {\n rampName,\n paletteOptions,\n rampSize = 'md',\n hideRamp = false,\n showBounds = true,\n opaque = true,\n onCopyStep,\n value,\n defaultValue,\n onChange,\n name,\n className,\n style,\n ...picker\n },\n ref,\n) {\n // Mirror ColorPicker's own binding exactly: controlled prop → form value (by `name`) → internal state.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const current =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as string | undefined) ?? '')\n : internal\n\n const handleChange = (color: string) => {\n // the picker already writes the form value when bound; we only track the uncontrolled case\n if (value === undefined && !isFormBound) setInternal(color)\n onChange?.(color)\n }\n\n return (\n <div ref={ref} className={clsx(styles.root, className)} style={style}>\n <ColorPicker\n {...picker}\n name={name}\n value={value}\n defaultValue={defaultValue}\n onChange={handleChange}\n alpha={!opaque}\n />\n {!hideRamp && (\n <ColorRamp\n baseColor={current}\n name={rampName ?? name ?? 'color'}\n options={paletteOptions}\n size={rampSize}\n showBounds={showBounds}\n onCopy={onCopyStep}\n />\n )}\n </div>\n )\n})\n"],"names":["PaletteField","forwardRef","rampName","paletteOptions","rampSize","hideRamp","showBounds","opaque","onCopyStep","value","defaultValue","onChange","name","className","style","picker","ref","form","useFormContext","isFormBound","internal","setInternal","useState","current","handleChange","color","jsxs","clsx","styles","jsx","ColorPicker","ColorRamp"],"mappings":";;;;;;;;GAwCaA,IAAeC,EAA8C,SACxE;AAAA,EACE,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AAAA,EACX,YAAAC,IAAa;AAAA,EACb,QAAAC,IAAS;AAAA,EACT,YAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AAEA,QAAMC,IAAOC,EAAA,GACPC,IAAc,GAAQF,KAAQL,IAC9B,CAACQ,GAAUC,CAAW,IAAIC,EAAiBZ,KAAgB,EAAE,GAC7Da,IACJd,MAAU,SACNA,IACAU,IACIF,EAAM,OAAOL,CAAK,KAA4B,KAChDQ,GAEFI,IAAe,CAACC,MAAkB;AAEtC,IAAIhB,MAAU,UAAa,CAACU,OAAyBM,CAAK,GAC1Dd,KAAA,QAAAA,EAAWc;AAAA,EACb;AAEA,SACE,gBAAAC,EAAC,SAAI,KAAAV,GAAU,WAAWW,EAAKC,EAAO,MAAMf,CAAS,GAAG,OAAAC,GACtD,UAAA;AAAA,IAAA,gBAAAe;AAAA,MAACC;AAAA,MAAA;AAAA,QACE,GAAGf;AAAA,QACJ,MAAAH;AAAA,QACA,OAAAH;AAAA,QACA,cAAAC;AAAA,QACA,UAAUc;AAAA,QACV,OAAO,CAACjB;AAAA,MAAA;AAAA,IAAA;AAAA,IAET,CAACF,KACA,gBAAAwB;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWR;AAAA,QACX,MAAMrB,KAAYU,KAAQ;AAAA,QAC1B,SAAST;AAAA,QACT,MAAMC;AAAA,QACN,YAAAE;AAAA,QACA,QAAQE;AAAA,MAAA;AAAA,IAAA;AAAA,EACV,GAEJ;AAEJ,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var we=Object.create;var ae=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var qe=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var Ue=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of De(e))!$e.call(t,r)&&r!==o&&ae(t,r,{get:()=>e[r],enumerable:!(s=Ae(e,r))||s.enumerable});return t};var Me=(t,e,o)=>(o=t!=null?we(qe(t)):{},Ue(e||!t||!t.__esModule?ae(o,"default",{value:t,enumerable:!0}):o,t));const c=require("react/jsx-runtime"),u=require("react"),z=require("clsx"),fe=require("./useOptionalPeer-9Fkx5Leb.cjs"),ke=require("./formContext-bTWrqdEV.cjs"),Ee=require("./Icon-CBg21lKA.cjs"),Ve=require("./TextField-
|
|
2
|
-
//# sourceMappingURL=PhoneField-
|
|
1
|
+
"use strict";var we=Object.create;var ae=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var De=Object.getOwnPropertyNames;var qe=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var Ue=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of De(e))!$e.call(t,r)&&r!==o&&ae(t,r,{get:()=>e[r],enumerable:!(s=Ae(e,r))||s.enumerable});return t};var Me=(t,e,o)=>(o=t!=null?we(qe(t)):{},Ue(e||!t||!t.__esModule?ae(o,"default",{value:t,enumerable:!0}):o,t));const c=require("react/jsx-runtime"),u=require("react"),z=require("clsx"),fe=require("./useOptionalPeer-9Fkx5Leb.cjs"),ke=require("./formContext-bTWrqdEV.cjs"),Ee=require("./Icon-CBg21lKA.cjs"),Ve=require("./TextField-CBYJIfau.cjs"),ce=require("./useOptionMenu-CVl7VHXl.cjs"),ue=require("./Typography-d97DdbNd.cjs"),v=require("./TextField.module-DsNCo8vN.cjs"),de=require("./ConfigProvider-DBU6rOIA.cjs"),G=fe.optionalPeer("libphonenumber-js","PhoneField",()=>import("libphonenumber-js")),g=()=>G.get();let We;function Be(){return We??(We=g().getCountries())}const D=t=>g().getCountryCallingCode(t);function Ge(t){const e=G.get();return e?typeof t=="string"&&t.trim()!==""&&e.isValidPhoneNumber(t):(G.load(),!1)}function pe(t){return String.fromCodePoint(...[...t.toUpperCase()].map(e=>127462+e.charCodeAt(0)-65))}const W=new Map;function he(t,e){var o;if(!W.has(e))try{W.set(e,new Intl.DisplayNames([e],{type:"region"}))}catch{W.set(e,null)}try{return((o=W.get(e))==null?void 0:o.of(t))??t}catch{return t}}const Le={1:"US",7:"RU",39:"IT",44:"GB",47:"NO",61:"AU",212:"MA",262:"RE",290:"SH",358:"FI",590:"GP",599:"CW"},Ye={ka:"GE",en:"US",es:"ES",de:"DE",it:"IT",fr:"FR",ru:"RU"};function He(t,e){var d,a;const[o,s]=t.split("-"),r=typeof navigator<"u"?(a=(d=navigator.language)==null?void 0:d.split("-")[1])==null?void 0:a.toUpperCase():void 0;return[s==null?void 0:s.toUpperCase(),Ye[o==null?void 0:o.toLowerCase()],r,"US"].find(h=>h&&e.includes(h))??e[0]}const Ke=t=>t.replace(/\D/g,"");function ye(t,e,o,s){return D(e)===t?e:[o,Le[t],...s.filter(i=>D(i)===t)].find(i=>i&&s.includes(i))??e}function B(t,e,o,s){const r=t.trimStart(),i=Ke(r);if(!i)return{e164:"",country:e,national:"",valid:!1,display:r.startsWith("+")?"+":""};if(r.startsWith("+")){const _=new(g()).AsYouType,N=_.input(`+${i}`),b=_.getCallingCode(),x=g().parsePhoneNumberFromString(`+${i}`),R=b?ye(b,e,(x==null?void 0:x.country)??_.getCountry(),s):e,q=`+${i}`;return{e164:q,country:R,national:b?i.slice(b.length):"",valid:g().isValidPhoneNumber(q),display:N}}const d=D(e),a=g().parsePhoneNumberFromString(i,e),h=(a==null?void 0:a.nationalNumber)??i.replace(/^0+/,""),P=h?`+${d}${h}`:"",w=o==="international"?new(g()).AsYouType(e).input(`+${d}${h}`):new(g()).AsYouType(e).input(i);return{e164:P,country:e,national:h,valid:P!==""&&g().isValidPhoneNumber(P),display:w}}function ee(t,e,o,s){if(!t)return{country:e,display:""};const r=g().parsePhoneNumberFromString(t);if(r)return{country:ye(r.countryCallingCode,e,r.country,s),display:o==="national"?r.formatNational():r.formatInternational()};const i=B(t,e,"international",s),d=o==="national"&&i.national?new(g()).AsYouType(i.country).input(i.national):i.display;return{country:i.country,display:d}}function Je(t,e){if(e<=0)return t.startsWith("+")?1:0;let o=0;for(let s=0;s<t.length;s++)if(/\d/.test(t[s])&&o++,o===e)return s+1;return t.length}const Qe="_phoneField_1eja1_4",Xe="_country_1eja1_9",Ze="_flag_1eja1_37",ze="_code_1eja1_42",et="_chevron_1eja1_46",tt="_chevronOpen_1eja1_50",nt="_dial_1eja1_55",F={phoneField:Qe,country:Xe,flag:Ze,code:ze,chevron:et,chevronOpen:tt,dial:nt},ot=u.forwardRef(function({value:e,defaultValue:o,onChange:s,defaultCountry:r,countries:i,preferredCountries:d=[],format:a="national",label:h,helperText:P,error:w,required:_,size:N="md",fullWidth:b=!0,name:x,disabled:R=!1,id:q,className:ge,style:me,onBlur:L,placeholder:ve,...xe},A){const O=de.useT(),{language:I}=de.useLanguage(),f=i??Be(),Ce=u.useId(),$=q??Ce,te=`${$}-helper`,U=ke.useFormContext(),M=!!(U&&x),C=M?U.field(x):void 0,[Fe,Ne]=u.useState(o??""),T=e!==void 0?e:M?U.values[x]??"":Fe,Y=w??(C==null?void 0:C.error)??!1,H=P??(C==null?void 0:C.helperText),ne=u.useMemo(()=>r&&f.includes(r)?r:He(I,f),[r,I,f.join()]),[S,K]=u.useState(()=>ee(T,ne,a,f).country),[k,oe]=u.useState(()=>ee(T,ne,a,f).display),J=u.useRef(T);if(J.current!==T){J.current=T;const n=ee(T,S,a,f);K(n.country),oe(n.display)}const Q=u.useRef(null),Se=u.useCallback(n=>{Q.current=n,typeof A=="function"?A(n):A&&(A.current=n)},[A]),X=u.useRef(null);u.useLayoutEffect(()=>{var y;const n=X.current;n!=null&&(X.current=null,(y=Q.current)==null||y.setSelectionRange(n,n))});const se=n=>{J.current=n.e164,oe(n.display),n.country!==S&&K(n.country),e===void 0&&!M&&Ne(n.e164),M&&U.setValue(x,n.e164),s==null||s(n.e164,{country:n.country,national:n.national,valid:n.valid})},je=n=>{const y=n.target;let p=y.value;const l=y.selectionStart??p.length;let m=p.slice(0,l).replace(/\D/g,"").length;const Ie=k.replace(/\D/g,"");if(p.length<k.length&&p.replace(/\D/g,"")===Ie&&m>0){let Te=0,E=-1;for(let V=0;V<p.length;V++)if(/\d/.test(p[V])&&++Te===m){E=V;break}E>=0&&(p=p.slice(0,E)+p.slice(E+1)),m-=1}const Z=B(p,S,a,f);X.current=l>=y.value.length?Z.display.length:Je(Z.display,m),se(Z)},re=u.useRef(null),Pe=u.useMemo(()=>{const n=l=>{const m=D(l);return{value:l,label:he(l,I),icon:c.jsx("span",{className:F.flag,"aria-hidden":"true",children:pe(l)}),keywords:[l,m,`+${m}`],trailing:c.jsxs("span",{className:F.dial,children:["+",m]})}},y=d.filter(l=>f.includes(l)).map(n),p=f.filter(l=>!d.includes(l)).map(n).sort((l,m)=>l.label.localeCompare(m.label,I));return y.length===0?p:[...y.map(l=>({...l,group:O("phoneField.suggested")})),...p.map(l=>({...l,group:O("phoneField.allCountries")}))]},[f,d,I,O]),_e=n=>{const y=B(k,S,a,f).national;K(n),se({...B(y,n,a,f),country:n})},j=ce.useOptionMenu({idBase:`${$}-country`,options:Pe,isSelected:n=>n.value===S,onPick:n=>_e(n.value),searchable:!0,disabled:R,focusRef:Q}),be=n=>{C==null||C.onBlur(n),L==null||L(n)},Re=H!=null?te:void 0,ie=N==="sm"?16:N==="md"?14:12,le=D(S),Oe=he(S,I);return c.jsxs("div",{className:z.clsx(v.fieldStyles.field,v.fieldStyles[N],b&&v.fieldStyles.fullWidth,Y&&v.fieldStyles.error,R&&v.fieldStyles.disabled,F.phoneField,ge),style:me,children:[h!=null&&c.jsxs("label",{htmlFor:$,className:v.fieldStyles.label,children:[c.jsx(ue.Typography,{as:"span",variant:"bodySmall",color:"muted",children:h}),_&&c.jsx("span",{className:v.fieldStyles.required,"aria-hidden":"true",children:"*"})]}),c.jsxs("div",{ref:re,className:z.clsx(v.fieldStyles.control,F.control),children:[c.jsxs("button",{type:"button",className:F.country,"aria-haspopup":"listbox","aria-expanded":j.open,"aria-controls":j.open?j.listboxId:void 0,"aria-label":`${O("phoneField.country")}: ${Oe} (+${le})`,disabled:R,onClick:j.toggleMenu,onKeyDown:n=>{(n.key==="ArrowDown"||n.key==="ArrowUp")&&!j.open&&(n.preventDefault(),j.openMenu())},children:[c.jsx("span",{className:F.flag,"aria-hidden":"true",children:pe(S)}),a==="national"&&c.jsxs("span",{className:F.code,children:["+",le]}),c.jsx(Ee.Icon,{name:"ArrowDown4",className:z.clsx(F.chevron,j.open&&F.chevronOpen),style:{width:ie,height:ie},"aria-hidden":"true"})]}),c.jsx("input",{ref:Se,id:$,name:x,type:"tel",inputMode:"tel",autoComplete:"tel",className:v.fieldStyles.input,value:k,placeholder:ve,onChange:je,onBlur:be,disabled:R,"aria-invalid":Y||void 0,"aria-describedby":Re,...xe})]}),c.jsx(ce.OptionMenu,{menu:j,anchorRef:re,size:N,searchPlaceholder:O("phoneField.search"),ariaLabel:O("phoneField.country")}),H!=null&&c.jsx(ue.Typography,{as:"span",id:te,variant:"bodySmall",color:Y?"error":"muted",className:v.fieldStyles.helper,children:H})]})}),st=u.forwardRef(function(e,o){const{module:s}=fe.useOptionalPeer(G);if(s)return c.jsx(ot,{ref:o,...e});const{label:r,helperText:i,error:d,required:a,size:h,fullWidth:P=!0,className:w,style:_,placeholder:N}=e;return c.jsx(Ve.TextField,{ref:o,type:"tel",label:r,helperText:i,error:d,required:a,size:h,fullWidth:P,className:w,style:_,placeholder:N,value:e.value??e.defaultValue??"",readOnly:!0,disabled:!0})});exports.PhoneField=st;exports.isValidPhone=Ge;
|
|
2
|
+
//# sourceMappingURL=PhoneField-Df3J6Hhg.cjs.map
|