@techzyapp/ui-library 1.0.36 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -11
- package/dist/{AdminRoot-D97qDVTM.cjs → AdminRoot-DwQi_tM4.cjs} +2 -2
- package/dist/{AdminRoot-D97qDVTM.cjs.map → AdminRoot-DwQi_tM4.cjs.map} +1 -1
- package/dist/{AdminRoot-C_SNXQkB.js → AdminRoot-kGG0oPN_.js} +8 -8
- package/dist/{AdminRoot-C_SNXQkB.js.map → AdminRoot-kGG0oPN_.js.map} +1 -1
- package/dist/{Alert-CggrNMn5.cjs → Alert-B9gTeI7o.cjs} +2 -2
- package/dist/{Alert-CggrNMn5.cjs.map → Alert-B9gTeI7o.cjs.map} +1 -1
- package/dist/{Alert-BXtQFAVl.js → Alert-DXPlWb-U.js} +3 -3
- package/dist/{Alert-BXtQFAVl.js.map → Alert-DXPlWb-U.js.map} +1 -1
- package/dist/{Breadcrumbs-Cpa_LSY2.cjs → Breadcrumbs-ByFf228Q.cjs} +2 -2
- package/dist/{Breadcrumbs-Cpa_LSY2.cjs.map → Breadcrumbs-ByFf228Q.cjs.map} +1 -1
- package/dist/{Breadcrumbs-D_QnKw8q.js → Breadcrumbs-etqxqMJd.js} +3 -3
- package/dist/{Breadcrumbs-D_QnKw8q.js.map → Breadcrumbs-etqxqMJd.js.map} +1 -1
- package/dist/{Button-BQ7jsm5P.js → Button-Bst_NtPJ.js} +2 -2
- package/dist/{Button-BQ7jsm5P.js.map → Button-Bst_NtPJ.js.map} +1 -1
- package/dist/{Button-Cm64ROip.cjs → Button-CYZoF18-.cjs} +2 -2
- package/dist/{Button-Cm64ROip.cjs.map → Button-CYZoF18-.cjs.map} +1 -1
- package/dist/{Calendar-C2x9ZtPV.cjs → Calendar-CHflyWXY.cjs} +2 -2
- package/dist/{Calendar-C2x9ZtPV.cjs.map → Calendar-CHflyWXY.cjs.map} +1 -1
- package/dist/{Calendar-BrpJOBTt.js → Calendar-Dvb--s-e.js} +3 -3
- package/dist/{Calendar-BrpJOBTt.js.map → Calendar-Dvb--s-e.js.map} +1 -1
- package/dist/{Card-yhly3Xdp.cjs → Card-AibwIuoP.cjs} +2 -2
- package/dist/{Card-yhly3Xdp.cjs.map → Card-AibwIuoP.cjs.map} +1 -1
- package/dist/{Card-kizK1B7N.js → Card-Bar_wCiH.js} +2 -2
- package/dist/{Card-kizK1B7N.js.map → Card-Bar_wCiH.js.map} +1 -1
- package/dist/{Chip-BPcnO5WI.cjs → Chip-CeU3FxHU.cjs} +2 -2
- package/dist/{Chip-BPcnO5WI.cjs.map → Chip-CeU3FxHU.cjs.map} +1 -1
- package/dist/{Chip-BzyzLEeX.js → Chip-_8JWFrHv.js} +2 -2
- package/dist/{Chip-BzyzLEeX.js.map → Chip-_8JWFrHv.js.map} +1 -1
- package/dist/{CodeBlock-BTt40oh5.js → CodeBlock-CbJxxBn0.js} +3 -3
- package/dist/{CodeBlock-BTt40oh5.js.map → CodeBlock-CbJxxBn0.js.map} +1 -1
- package/dist/{CodeBlock-BgSum_bB.cjs → CodeBlock-b7PyuuI7.cjs} +2 -2
- package/dist/{CodeBlock-BgSum_bB.cjs.map → CodeBlock-b7PyuuI7.cjs.map} +1 -1
- package/dist/{ColorPicker-C33dlkhN.cjs → ColorPicker-CuaBgOPo.cjs} +2 -2
- package/dist/{ColorPicker-C33dlkhN.cjs.map → ColorPicker-CuaBgOPo.cjs.map} +1 -1
- package/dist/{ColorPicker-BNM75F5E.js → ColorPicker-DTh0w9rX.js} +3 -3
- package/dist/{ColorPicker-BNM75F5E.js.map → ColorPicker-DTh0w9rX.js.map} +1 -1
- package/dist/{ColorPickerPanel-BZ_ZNu2B.cjs → ColorPickerPanel-D5kmpmJM.cjs} +2 -2
- package/dist/{ColorPickerPanel-BZ_ZNu2B.cjs.map → ColorPickerPanel-D5kmpmJM.cjs.map} +1 -1
- package/dist/{ColorPickerPanel-Bh1K0YS8.js → ColorPickerPanel-yTEfn38g.js} +2 -2
- package/dist/{ColorPickerPanel-Bh1K0YS8.js.map → ColorPickerPanel-yTEfn38g.js.map} +1 -1
- package/dist/{ColorRamp-BJWNKzoX.cjs → ColorRamp-B_-ZPqMa.cjs} +2 -2
- package/dist/{ColorRamp-BJWNKzoX.cjs.map → ColorRamp-B_-ZPqMa.cjs.map} +1 -1
- package/dist/{ColorRamp-BnuXrSxa.js → ColorRamp-CCfImssD.js} +2 -2
- package/dist/{ColorRamp-BnuXrSxa.js.map → ColorRamp-CCfImssD.js.map} +1 -1
- package/dist/{ConfigProvider-th4GYhcU.cjs → ConfigProvider-B_Bb6pk1.cjs} +2 -2
- package/dist/ConfigProvider-B_Bb6pk1.cjs.map +1 -0
- package/dist/{ConfigProvider-DZMtq2Fz.js → ConfigProvider-DeMASTVo.js} +2 -2
- package/dist/ConfigProvider-DeMASTVo.js.map +1 -0
- package/dist/{CopyButton-C9oHGs6W.cjs → CopyButton-DZ3pdgfJ.cjs} +2 -2
- package/dist/{CopyButton-C9oHGs6W.cjs.map → CopyButton-DZ3pdgfJ.cjs.map} +1 -1
- package/dist/{CopyButton-hZqLdXJq.js → CopyButton-kZ8hJbqK.js} +3 -3
- package/dist/{CopyButton-hZqLdXJq.js.map → CopyButton-kZ8hJbqK.js.map} +1 -1
- package/dist/{DatePicker-DXwJB4MH.cjs → DatePicker-BXywGXmV.cjs} +2 -2
- package/dist/{DatePicker-DXwJB4MH.cjs.map → DatePicker-BXywGXmV.cjs.map} +1 -1
- package/dist/{DatePicker-B6ZL_T-E.js → DatePicker-CnMYmi0M.js} +4 -4
- package/dist/{DatePicker-B6ZL_T-E.js.map → DatePicker-CnMYmi0M.js.map} +1 -1
- package/dist/{DateTimePicker-BynW1Eeg.js → DateTimePicker-Cu8kcOtZ.js} +7 -7
- package/dist/{DateTimePicker-BynW1Eeg.js.map → DateTimePicker-Cu8kcOtZ.js.map} +1 -1
- package/dist/{DateTimePicker-CHi1H2k1.cjs → DateTimePicker-DrjYq5Bt.cjs} +2 -2
- package/dist/{DateTimePicker-CHi1H2k1.cjs.map → DateTimePicker-DrjYq5Bt.cjs.map} +1 -1
- package/dist/{DescriptionList-BqYwp08t.cjs → DescriptionList-DR9NTjaH.cjs} +2 -2
- package/dist/{DescriptionList-BqYwp08t.cjs.map → DescriptionList-DR9NTjaH.cjs.map} +1 -1
- package/dist/{DescriptionList-C6Gfk6I_.js → DescriptionList-DrvYmivR.js} +4 -4
- package/dist/{DescriptionList-C6Gfk6I_.js.map → DescriptionList-DrvYmivR.js.map} +1 -1
- package/dist/{EmptyState-CZ6X5-Zy.cjs → EmptyState-DIrXPui9.cjs} +2 -2
- package/dist/{EmptyState-CZ6X5-Zy.cjs.map → EmptyState-DIrXPui9.cjs.map} +1 -1
- package/dist/{EmptyState-BvAA5mYO.js → EmptyState-pUe8qBT5.js} +2 -2
- package/dist/{EmptyState-BvAA5mYO.js.map → EmptyState-pUe8qBT5.js.map} +1 -1
- package/dist/{ErrorBoundary-BS0x9RVO.js → ErrorBoundary-CLz5rsOJ.js} +3 -3
- package/dist/{ErrorBoundary-BS0x9RVO.js.map → ErrorBoundary-CLz5rsOJ.js.map} +1 -1
- package/dist/{ErrorBoundary-WwmJrL6o.cjs → ErrorBoundary-DtZn1K4r.cjs} +2 -2
- package/dist/{ErrorBoundary-WwmJrL6o.cjs.map → ErrorBoundary-DtZn1K4r.cjs.map} +1 -1
- package/dist/{ErrorState-DRXuV6na.cjs → ErrorState-Dtqznchj.cjs} +2 -2
- package/dist/{ErrorState-DRXuV6na.cjs.map → ErrorState-Dtqznchj.cjs.map} +1 -1
- package/dist/{ErrorState-BTSGKrJq.js → ErrorState-kdqkurmw.js} +7 -7
- package/dist/{ErrorState-BTSGKrJq.js.map → ErrorState-kdqkurmw.js.map} +1 -1
- package/dist/{FileCard-ZZNd_tUN.cjs → FileCard-19jrdC37.cjs} +2 -2
- package/dist/{FileCard-ZZNd_tUN.cjs.map → FileCard-19jrdC37.cjs.map} +1 -1
- package/dist/{FileCard-CxZ3o4BO.js → FileCard-flhEr03R.js} +3 -3
- package/dist/{FileCard-CxZ3o4BO.js.map → FileCard-flhEr03R.js.map} +1 -1
- package/dist/{FileUploader-CPah0hUe.js → FileUploader-CdBbl4os.js} +5 -5
- package/dist/{FileUploader-CPah0hUe.js.map → FileUploader-CdBbl4os.js.map} +1 -1
- package/dist/{FileUploader-B--hPV3b.cjs → FileUploader-Cha5mtqm.cjs} +2 -2
- package/dist/{FileUploader-B--hPV3b.cjs.map → FileUploader-Cha5mtqm.cjs.map} +1 -1
- package/dist/{Flag-DikEV1jI.js → Flag-DfA2t0yd.js} +2 -2
- package/dist/{Flag-DikEV1jI.js.map → Flag-DfA2t0yd.js.map} +1 -1
- package/dist/{Flag-C4La35rA.cjs → Flag-Do7x-AhS.cjs} +2 -2
- package/dist/{Flag-C4La35rA.cjs.map → Flag-Do7x-AhS.cjs.map} +1 -1
- package/dist/{FullscreenToggle-ejjFFd9a.cjs → FullscreenToggle-CIY7Anek.cjs} +2 -2
- package/dist/{FullscreenToggle-ejjFFd9a.cjs.map → FullscreenToggle-CIY7Anek.cjs.map} +1 -1
- package/dist/{FullscreenToggle-CTt7_Kv_.js → FullscreenToggle-CjirSJ6w.js} +3 -3
- package/dist/{FullscreenToggle-CTt7_Kv_.js.map → FullscreenToggle-CjirSJ6w.js.map} +1 -1
- package/dist/{IconButton-BUmXN_lD.js → IconButton-06pmftMo.js} +2 -2
- package/dist/{IconButton-BUmXN_lD.js.map → IconButton-06pmftMo.js.map} +1 -1
- package/dist/{IconButton-CYMvszcM.cjs → IconButton-CQ25TtBc.cjs} +2 -2
- package/dist/{IconButton-CYMvszcM.cjs.map → IconButton-CQ25TtBc.cjs.map} +1 -1
- package/dist/{Loader-DkwiCGbB.cjs → Loader-B5Pm8AaT.cjs} +2 -2
- package/dist/{Loader-DkwiCGbB.cjs.map → Loader-B5Pm8AaT.cjs.map} +1 -1
- package/dist/{Loader-jh7XMRhy.js → Loader-Bj5uwVR9.js} +2 -2
- package/dist/{Loader-jh7XMRhy.js.map → Loader-Bj5uwVR9.js.map} +1 -1
- package/dist/{LocationPicker-D-9mrCVD.cjs → LocationPicker-By3yMkOw.cjs} +2 -2
- package/dist/{LocationPicker-D-9mrCVD.cjs.map → LocationPicker-By3yMkOw.cjs.map} +1 -1
- package/dist/{LocationPicker-Cdm7BCX5.js → LocationPicker-D3jkpcIF.js} +6 -6
- package/dist/{LocationPicker-Cdm7BCX5.js.map → LocationPicker-D3jkpcIF.js.map} +1 -1
- package/dist/{Modal-CrvOHbNy.js → Modal-CDpWnBEB.js} +3 -3
- package/dist/{Modal-CrvOHbNy.js.map → Modal-CDpWnBEB.js.map} +1 -1
- package/dist/{Modal-eI6QL-LM.cjs → Modal-Df5Yc6CM.cjs} +2 -2
- package/dist/{Modal-eI6QL-LM.cjs.map → Modal-Df5Yc6CM.cjs.map} +1 -1
- package/dist/{MultiSelect-B_Jenpgv.cjs → MultiSelect-BoHvTTDJ.cjs} +2 -2
- package/dist/{MultiSelect-B_Jenpgv.cjs.map → MultiSelect-BoHvTTDJ.cjs.map} +1 -1
- package/dist/{MultiSelect-BTilYrXp.js → MultiSelect-DfVKZFX4.js} +4 -4
- package/dist/{MultiSelect-BTilYrXp.js.map → MultiSelect-DfVKZFX4.js.map} +1 -1
- package/dist/{NumberField-DEoaxFJj.js → NumberField-DU2oXSV3.js} +3 -3
- package/dist/{NumberField-DEoaxFJj.js.map → NumberField-DU2oXSV3.js.map} +1 -1
- package/dist/{NumberField-czWHuAyt.cjs → NumberField-vxOxw9m8.cjs} +2 -2
- package/dist/{NumberField-czWHuAyt.cjs.map → NumberField-vxOxw9m8.cjs.map} +1 -1
- package/dist/{OtpField-v2RuXdsE.js → OtpField-Dy4O1MeD.js} +2 -2
- package/dist/{OtpField-v2RuXdsE.js.map → OtpField-Dy4O1MeD.js.map} +1 -1
- package/dist/{OtpField-DK5KikOt.cjs → OtpField-OdkuKKcV.cjs} +2 -2
- package/dist/{OtpField-DK5KikOt.cjs.map → OtpField-OdkuKKcV.cjs.map} +1 -1
- package/dist/{PageError-CyMdVrxL.js → PageError-BHz8iTw2.js} +5 -5
- package/dist/{PageError-CyMdVrxL.js.map → PageError-BHz8iTw2.js.map} +1 -1
- package/dist/{PageError-CIVYNLTW.cjs → PageError-C0vYP2PL.cjs} +2 -2
- package/dist/{PageError-CIVYNLTW.cjs.map → PageError-C0vYP2PL.cjs.map} +1 -1
- package/dist/PageLayout-B4iX-IWD.js +37 -0
- package/dist/PageLayout-B4iX-IWD.js.map +1 -0
- package/dist/PageLayout-c9GL3nhJ.cjs +2 -0
- package/dist/PageLayout-c9GL3nhJ.cjs.map +1 -0
- package/dist/{PageNotFound-B-Ewl9a2.cjs → PageNotFound-B9nBGn4h.cjs} +2 -2
- package/dist/PageNotFound-B9nBGn4h.cjs.map +1 -0
- package/dist/{PageNotFound-B6jcXPba.js → PageNotFound-D1wFU9SN.js} +5 -5
- package/dist/PageNotFound-D1wFU9SN.js.map +1 -0
- package/dist/{Pagination-jLyJa8iL.cjs → Pagination-oLQcSMaO.cjs} +2 -2
- package/dist/{Pagination-jLyJa8iL.cjs.map → Pagination-oLQcSMaO.cjs.map} +1 -1
- package/dist/{Pagination-BjufY1mt.js → Pagination-sCDknGdJ.js} +2 -2
- package/dist/{Pagination-BjufY1mt.js.map → Pagination-sCDknGdJ.js.map} +1 -1
- package/dist/{PaletteField-DTfV8Lny.js → PaletteField-B9k607Dt.js} +3 -3
- package/dist/{PaletteField-DTfV8Lny.js.map → PaletteField-B9k607Dt.js.map} +1 -1
- package/dist/{PaletteField-DGaV7VJ9.cjs → PaletteField-BIRTMSbB.cjs} +2 -2
- package/dist/{PaletteField-DGaV7VJ9.cjs.map → PaletteField-BIRTMSbB.cjs.map} +1 -1
- package/dist/{PhoneField-DchrnSiE.cjs → PhoneField-CifOd98q.cjs} +2 -2
- package/dist/{PhoneField-DchrnSiE.cjs.map → PhoneField-CifOd98q.cjs.map} +1 -1
- package/dist/{PhoneField-BSIhBMW2.js → PhoneField-ql9eYaCh.js} +4 -4
- package/dist/{PhoneField-BSIhBMW2.js.map → PhoneField-ql9eYaCh.js.map} +1 -1
- package/dist/{Popconfirm-l9au66oY.cjs → Popconfirm-BctHVuvL.cjs} +2 -2
- package/dist/{Popconfirm-l9au66oY.cjs.map → Popconfirm-BctHVuvL.cjs.map} +1 -1
- package/dist/{Popconfirm-p2O8Vmz0.js → Popconfirm-C4WiB80U.js} +3 -3
- package/dist/{Popconfirm-p2O8Vmz0.js.map → Popconfirm-C4WiB80U.js.map} +1 -1
- package/dist/{Progress-Cqr2_BF1.cjs → Progress-BABBBG2y.cjs} +2 -2
- package/dist/{Progress-Cqr2_BF1.cjs.map → Progress-BABBBG2y.cjs.map} +1 -1
- package/dist/{Progress-C-VGs3yJ.js → Progress-ZNQrxw_Q.js} +2 -2
- package/dist/{Progress-C-VGs3yJ.js.map → Progress-ZNQrxw_Q.js.map} +1 -1
- package/dist/{RemoveDialog-eGCbOuuM.cjs → RemoveDialog-CB9Aq6KI.cjs} +2 -2
- package/dist/{RemoveDialog-eGCbOuuM.cjs.map → RemoveDialog-CB9Aq6KI.cjs.map} +1 -1
- package/dist/{RemoveDialog-BKgWohkG.js → RemoveDialog-DoYsfSWp.js} +5 -5
- package/dist/{RemoveDialog-BKgWohkG.js.map → RemoveDialog-DoYsfSWp.js.map} +1 -1
- package/dist/{RichTextEditor-C24uBIWh.js → RichTextEditor-B0V6OmlD.js} +7 -7
- package/dist/{RichTextEditor-C24uBIWh.js.map → RichTextEditor-B0V6OmlD.js.map} +1 -1
- package/dist/{RichTextEditor-BPAD4ISz.cjs → RichTextEditor-CJKfX0FP.cjs} +2 -2
- package/dist/{RichTextEditor-BPAD4ISz.cjs.map → RichTextEditor-CJKfX0FP.cjs.map} +1 -1
- package/dist/RootLayout-Dy6Llv-I.cjs +2 -0
- package/dist/RootLayout-Dy6Llv-I.cjs.map +1 -0
- package/dist/RootLayout-fsVJvS8l.js +582 -0
- package/dist/RootLayout-fsVJvS8l.js.map +1 -0
- package/dist/{Select-BbgueWwN.cjs → Select-It6dlL1v.cjs} +2 -2
- package/dist/{Select-BbgueWwN.cjs.map → Select-It6dlL1v.cjs.map} +1 -1
- package/dist/{Select-DEi_ZUHR.js → Select-TVfg_miK.js} +3 -3
- package/dist/{Select-DEi_ZUHR.js.map → Select-TVfg_miK.js.map} +1 -1
- package/dist/Sidebar-C4i3P_Lu.cjs +2 -0
- package/dist/Sidebar-C4i3P_Lu.cjs.map +1 -0
- package/dist/Sidebar-Cn2yCsG-.js +520 -0
- package/dist/Sidebar-Cn2yCsG-.js.map +1 -0
- package/dist/SpeedDial-B12OzpQt.js +178 -0
- package/dist/SpeedDial-B12OzpQt.js.map +1 -0
- package/dist/SpeedDial-Nvp31Ey3.cjs +2 -0
- package/dist/SpeedDial-Nvp31Ey3.cjs.map +1 -0
- package/dist/{Stepper-D8bRyyhl.js → Stepper-D7TdotAi.js} +2 -2
- package/dist/{Stepper-D8bRyyhl.js.map → Stepper-D7TdotAi.js.map} +1 -1
- package/dist/{Stepper-BRksGDK1.cjs → Stepper-YhyHUGhS.cjs} +2 -2
- package/dist/{Stepper-BRksGDK1.cjs.map → Stepper-YhyHUGhS.cjs.map} +1 -1
- package/dist/{Table-CGIip6UL.cjs → Table-Be6MMn0w.cjs} +2 -2
- package/dist/{Table-CGIip6UL.cjs.map → Table-Be6MMn0w.cjs.map} +1 -1
- package/dist/{Table-C0RDylA0.js → Table-D1_ErbiM.js} +15 -15
- package/dist/{Table-C0RDylA0.js.map → Table-D1_ErbiM.js.map} +1 -1
- package/dist/{Tabs-CQvfqazt.js → Tabs--NEoH5tq.js} +2 -2
- package/dist/{Tabs-CQvfqazt.js.map → Tabs--NEoH5tq.js.map} +1 -1
- package/dist/{Tabs-BzbSNmBj.cjs → Tabs-DWV0p55U.cjs} +2 -2
- package/dist/{Tabs-BzbSNmBj.cjs.map → Tabs-DWV0p55U.cjs.map} +1 -1
- package/dist/{TagsField-BdM-xre0.js → TagsField-C2RRJY8B.js} +4 -4
- package/dist/{TagsField-BdM-xre0.js.map → TagsField-C2RRJY8B.js.map} +1 -1
- package/dist/{TagsField-CGL1oI7b.cjs → TagsField-CP6gZJj2.cjs} +2 -2
- package/dist/{TagsField-CGL1oI7b.cjs.map → TagsField-CP6gZJj2.cjs.map} +1 -1
- package/dist/{TextField-otYGVuwF.js → TextField-Drb9cu7s.js} +3 -3
- package/dist/{TextField-otYGVuwF.js.map → TextField-Drb9cu7s.js.map} +1 -1
- package/dist/{TextField-D49Lpbjt.cjs → TextField-XdJ5bxGN.cjs} +2 -2
- package/dist/{TextField-D49Lpbjt.cjs.map → TextField-XdJ5bxGN.cjs.map} +1 -1
- package/dist/{ThemeToggle-D33Tqv2F.js → ThemeToggle-Bmx6I9qM.js} +3 -3
- package/dist/{ThemeToggle-D33Tqv2F.js.map → ThemeToggle-Bmx6I9qM.js.map} +1 -1
- package/dist/{ThemeToggle-B8rkRTis.cjs → ThemeToggle-n3I_o6Qm.cjs} +2 -2
- package/dist/{ThemeToggle-B8rkRTis.cjs.map → ThemeToggle-n3I_o6Qm.cjs.map} +1 -1
- package/dist/{TimeColumns-DyjTpZbD.js → TimeColumns-BE1sLoRV.js} +2 -2
- package/dist/{TimeColumns-DyjTpZbD.js.map → TimeColumns-BE1sLoRV.js.map} +1 -1
- package/dist/{TimeColumns-qEHHZC1N.cjs → TimeColumns-DkJsIu1w.cjs} +2 -2
- package/dist/{TimeColumns-qEHHZC1N.cjs.map → TimeColumns-DkJsIu1w.cjs.map} +1 -1
- package/dist/{TimePicker-DJrNO01U.cjs → TimePicker-Bv3lBZPP.cjs} +2 -2
- package/dist/{TimePicker-DJrNO01U.cjs.map → TimePicker-Bv3lBZPP.cjs.map} +1 -1
- package/dist/{TimePicker-yfYqLbj3.js → TimePicker-DC7x-szU.js} +5 -5
- package/dist/{TimePicker-yfYqLbj3.js.map → TimePicker-DC7x-szU.js.map} +1 -1
- package/dist/{Toaster-D8cxkhwr.js → Toaster-C_3REdVz.js} +2 -2
- package/dist/{Toaster-D8cxkhwr.js.map → Toaster-C_3REdVz.js.map} +1 -1
- package/dist/{Toaster-B7Xd2IaM.cjs → Toaster-CyWSt38Y.cjs} +2 -2
- package/dist/{Toaster-B7Xd2IaM.cjs.map → Toaster-CyWSt38Y.cjs.map} +1 -1
- package/dist/{TranslatedFields-CsSsTrnF.js → TranslatedFields-C58exJpw.js} +5 -5
- package/dist/{TranslatedFields-CsSsTrnF.js.map → TranslatedFields-C58exJpw.js.map} +1 -1
- package/dist/{TranslatedFields-BvqqdNWz.cjs → TranslatedFields-Pa4fR2P_.cjs} +2 -2
- package/dist/{TranslatedFields-BvqqdNWz.cjs.map → TranslatedFields-Pa4fR2P_.cjs.map} +1 -1
- package/dist/{UserCard-Die7JV4z.cjs → UserCard-DrJIl-gD.cjs} +2 -2
- package/dist/{UserCard-Die7JV4z.cjs.map → UserCard-DrJIl-gD.cjs.map} +1 -1
- package/dist/{UserCard-CsZ4Ogac.js → UserCard-eiY2q0lu.js} +3 -3
- package/dist/{UserCard-CsZ4Ogac.js.map → UserCard-eiY2q0lu.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/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/PageLayout.d.cts +25 -6
- package/dist/components/PageLayout/PageLayout.d.ts +25 -6
- package/dist/components/PageLayout/index.cjs +1 -1
- package/dist/components/PageLayout/index.js +1 -1
- package/dist/components/PageNotFound/PageNotFound.d.cts +2 -2
- package/dist/components/PageNotFound/PageNotFound.d.ts +2 -2
- 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/RemoveDialog/index.cjs +1 -1
- package/dist/components/RemoveDialog/index.js +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RootLayout/RootLayout.d.cts +5 -8
- package/dist/components/RootLayout/RootLayout.d.ts +5 -8
- package/dist/components/RootLayout/index.cjs +1 -1
- package/dist/components/RootLayout/index.js +1 -1
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Sidebar/Sidebar.d.cts +14 -96
- package/dist/components/Sidebar/Sidebar.d.ts +14 -96
- package/dist/components/Sidebar/index.cjs +1 -1
- package/dist/components/Sidebar/index.d.cts +0 -1
- package/dist/components/Sidebar/index.d.ts +0 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/SpeedDial/SpeedDial.d.cts +2 -0
- package/dist/components/SpeedDial/SpeedDial.d.ts +2 -0
- package/dist/components/SpeedDial/SpeedDialAction.d.cts +6 -0
- package/dist/components/SpeedDial/SpeedDialAction.d.ts +6 -0
- 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 +50 -50
- 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 +0 -1
- package/dist/i18n/messages.d.ts +0 -1
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +53 -53
- package/dist/{messages-zarEtcsN.js → messages-CMgYU5p6.js} +10 -17
- package/dist/messages-CMgYU5p6.js.map +1 -0
- package/dist/messages-h22vS9zn.cjs +36 -0
- package/dist/messages-h22vS9zn.cjs.map +1 -0
- package/dist/theme/ConfigProvider.d.cts +2 -4
- package/dist/theme/ConfigProvider.d.ts +2 -4
- package/dist/{useHomeTo-DVMyLZbb.js → useHomeTo-CsHSJ9bP.js} +2 -2
- package/dist/{useHomeTo-DVMyLZbb.js.map → useHomeTo-CsHSJ9bP.js.map} +1 -1
- package/dist/{useHomeTo-Dnu6VAvU.cjs → useHomeTo-QCdw9Rtn.cjs} +2 -2
- package/dist/{useHomeTo-Dnu6VAvU.cjs.map → useHomeTo-QCdw9Rtn.cjs.map} +1 -1
- package/dist/{useOptionMenu-OAYGUWP_.cjs → useOptionMenu-C0uz30xp.cjs} +2 -2
- package/dist/{useOptionMenu-OAYGUWP_.cjs.map → useOptionMenu-C0uz30xp.cjs.map} +1 -1
- package/dist/{useOptionMenu-DNYlfNO_.js → useOptionMenu-tLAmCiZ0.js} +3 -3
- package/dist/{useOptionMenu-DNYlfNO_.js.map → useOptionMenu-tLAmCiZ0.js.map} +1 -1
- package/package.json +1 -1
- package/dist/ConfigProvider-DZMtq2Fz.js.map +0 -1
- package/dist/ConfigProvider-th4GYhcU.cjs.map +0 -1
- package/dist/PageLayout-BtukUUfe.js +0 -12
- package/dist/PageLayout-BtukUUfe.js.map +0 -1
- package/dist/PageLayout-C_daDKkg.cjs +0 -2
- package/dist/PageLayout-C_daDKkg.cjs.map +0 -1
- package/dist/PageNotFound-B-Ewl9a2.cjs.map +0 -1
- package/dist/PageNotFound-B6jcXPba.js.map +0 -1
- package/dist/RootLayout-BY_BxQ0C.cjs +0 -2
- package/dist/RootLayout-BY_BxQ0C.cjs.map +0 -1
- package/dist/RootLayout-CicjlAUF.js +0 -641
- package/dist/RootLayout-CicjlAUF.js.map +0 -1
- package/dist/Sidebar-D-nR8Cu6.cjs +0 -2
- package/dist/Sidebar-D-nR8Cu6.cjs.map +0 -1
- package/dist/Sidebar-nORfjIg8.js +0 -565
- package/dist/Sidebar-nORfjIg8.js.map +0 -1
- package/dist/SpeedDial-BMpJtYP6.js +0 -165
- package/dist/SpeedDial-BMpJtYP6.js.map +0 -1
- package/dist/SpeedDial-D5uk_E5v.cjs +0 -2
- package/dist/SpeedDial-D5uk_E5v.cjs.map +0 -1
- package/dist/components/RootLayout/ActionSet.d.cts +0 -27
- package/dist/components/RootLayout/ActionSet.d.ts +0 -27
- package/dist/messages-DYXyWU3X.cjs +0 -36
- package/dist/messages-DYXyWU3X.cjs.map +0 -1
- package/dist/messages-zarEtcsN.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const s=require("react/jsx-runtime"),v=require("react"),m=require("clsx"),L=require("./useClipboard-BjTIX-4g.cjs"),h=require("./palette-BycMHbED.cjs"),D=require("./Tooltip-Bw-1Xk2Z.cjs"),i=require("./Typography-d97DdbNd.cjs"),T=require("./toastStore-B4Tk2Xk7.cjs"),n=require("./TextField.module-DsNCo8vN.cjs"),W=require("./ConfigProvider-
|
|
2
|
-
//# sourceMappingURL=ColorRamp-
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),v=require("react"),m=require("clsx"),L=require("./useClipboard-BjTIX-4g.cjs"),h=require("./palette-BycMHbED.cjs"),D=require("./Tooltip-Bw-1Xk2Z.cjs"),i=require("./Typography-d97DdbNd.cjs"),T=require("./toastStore-B4Tk2Xk7.cjs"),n=require("./TextField.module-DsNCo8vN.cjs"),W=require("./ConfigProvider-B_Bb6pk1.cjs"),z="_band_1d0th_5",G="_sm_1d0th_15",H="_md_1d0th_18",J="_lg_1d0th_21",K="_num_1d0th_42",M="_step_1d0th_47",O="_bounds_1d0th_94",Q="_tip_1d0th_101",U="_tipTitle_1d0th_107",o={band:z,sm:G,md:H,lg:J,num:K,step:M,static:"_static_1d0th_61",bounds:O,tip:Q,tipTitle:U},$=(x,l)=>`${x} ${l.ratio.toFixed(2)}${l.small?` ${l.small}`:""}`,V=v.forwardRef(function({baseColor:l,name:a="color",options:f,size:N="md",copyable:_=!0,onCopy:c,showBounds:S=!0,label:d,helperText:p,error:b=!1,required:q=!1,className:k,...C},E){const t=W.useT(),y=v.useId(),j=`${y}-label`,g=`${y}-helper`,{copy:F}=L.useClipboard(),R=h.generatePalette(l,f),P=async e=>{const r=`${a}-${e.step}`;await F(e.hex)?(T.toast.success(t("colorRamp.copied",{step:r,hex:e.hex})),c==null||c(e)):T.toast.error(t("colorRamp.copyFailed",{step:r}))},A=e=>s.jsxs("span",{className:o.tip,children:[s.jsxs("span",{className:o.tipTitle,children:[a,"-",e.step,e.step===h.BASE_STEP?` · ${t("colorRamp.base")}`:""]}),s.jsx("span",{children:e.hex}),s.jsxs("span",{children:[$(t("colorRamp.black"),e.onDark)," ·"," ",$(t("colorRamp.white"),e.onWhite)]}),_&&s.jsx("span",{children:t("colorRamp.clickToCopy")})]});return s.jsxs("div",{ref:E,className:m.clsx(n.fieldStyles.field,b&&n.fieldStyles.error,k),...C,children:[d!=null&&s.jsxs("label",{id:j,className:n.fieldStyles.label,children:[s.jsx(i.Typography,{as:"span",variant:"bodySmall",color:"muted",children:d}),q&&s.jsx("span",{className:n.fieldStyles.required,"aria-hidden":"true",children:"*"})]}),R?s.jsxs(s.Fragment,{children:[s.jsx("div",{role:"group","aria-label":t("colorRamp.groupLabel",{name:a}),"aria-labelledby":d!=null?j:void 0,"aria-describedby":p!=null?g:void 0,className:m.clsx(o.band,o[N]),children:R.map(e=>{const r=e.step===h.BASE_STEP,u={backgroundColor:e.hex,color:e.textColor},B=`${a}-${e.step}`,I=_?s.jsx("button",{type:"button",className:o.step,style:u,"data-base":r||void 0,"aria-label":t("colorRamp.copyAria",{name:a,step:e.step,hex:e.hex}),onClick:()=>void P(e),children:s.jsx("span",{className:o.num,"aria-hidden":"true",children:e.step})}):s.jsx("span",{className:m.clsx(o.step,o.static),style:u,"data-base":r||void 0,role:"img","aria-label":`${B} ${e.hex}`,children:s.jsx("span",{className:o.num,"aria-hidden":"true",children:e.step})});return s.jsx(D.Tooltip,{content:A(e),children:I},e.step)})}),S&&s.jsxs("div",{className:o.bounds,children:[s.jsx(i.Typography,{as:"span",variant:"caption",color:"muted",children:t("colorRamp.lightest")}),s.jsx(i.Typography,{as:"span",variant:"caption",color:"muted",children:t("colorRamp.darkest")})]})]}):s.jsx(i.Typography,{as:"span",variant:"caption",color:"muted",children:t("colorRamp.invalid")}),p!=null&&s.jsx(i.Typography,{as:"span",id:g,variant:"bodySmall",color:b?"error":"muted",className:n.fieldStyles.helper,children:p})]})});exports.ColorRamp=V;
|
|
2
|
+
//# sourceMappingURL=ColorRamp-B_-ZPqMa.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorRamp-BJWNKzoX.cjs","sources":["../src/components/ColorRamp/ColorRamp.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { useClipboard } from '../../hooks/useClipboard'\nimport {\n BASE_STEP,\n generatePalette,\n type GeneratePaletteOptions,\n type Legibility,\n type PaletteSwatch,\n} from '../../helpers/palette'\nimport { Tooltip } from '../Tooltip'\nimport { Typography } from '../Typography'\nimport { toast } from '../Toast'\n// shared field chrome (wrapper / label / helper / required / error)\nimport fieldStyles from '../TextField/TextField.module.css'\nimport styles from './ColorRamp.module.css'\n\nexport type ColorRampSize = 'sm' | 'md' | 'lg'\n\n// `onCopy` here is the swatch callback, so the DOM clipboard `onCopy` handler is omitted alongside `color`\nexport interface ColorRampProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'onCopy'> {\n /** The base (500) color — any value `generatePalette` accepts. Invalid → the empty-state caption. */\n baseColor: string\n /** Token prefix for step names (`primary` → \"primary-500\") — used in tooltips, aria-labels and the copy toast. Default `'color'`. */\n name?: string\n /** Passed to `generatePalette` (override any subset of the tint / shade fractions). */\n options?: GeneratePaletteOptions\n /** Band height. `sm` 32 · `md` 40 (default) · `lg` 48 px. */\n size?: ColorRampSize\n /** Click a step to copy its hex (default `true`). `false` renders the steps as non-interactive cells. */\n copyable?: boolean\n /** After a successful copy — in addition to the built-in toast. */\n onCopy?: (swatch: PaletteSwatch) => void\n /** Show the \"Lightest … Darkest\" caption row under the band (default `true`). */\n showBounds?: boolean\n /** Label rendered above the band (field-family chrome, like `Slider` / `SwatchPicker`). */\n label?: ReactNode\n /** Helper / validation text under the band. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Marks the field invalid — reddens the label/asterisk and shows `helperText` in the error color. */\n error?: boolean\n /** Adds a red asterisk after the label. */\n required?: boolean\n}\n\n/** `black 4.52 AA` — ratio to 2 decimals, the body-text rating appended when it exists. */\nconst contrastLine = (who: string, l: Legibility) =>\n `${who} ${l.ratio.toFixed(2)}${l.small ? ` ${l.small}` : ''}`\n\n/**\n * The generated tonal scale for one color as **a single horizontal band of ten equal steps** sharing\n * one rounded, clipped frame (reads as a continuous ramp, not ten chips). Display + copy only — it never\n * edits the color; pair it with `ColorPicker` (or use `PaletteField`, which composes both). Each step\n * is a `Tooltip`-wrapped button whose fill / ink are the swatch's own colors (inline — the color IS the\n * data), showing its number on the base step and on hover / focus; clicking copies the hex with a toast.\n * `role=\"group\"` labelled \"{name} color scale\"; an invalid `baseColor` renders only a muted caption.\n */\nexport const ColorRamp = forwardRef<HTMLDivElement, ColorRampProps>(function ColorRamp(\n {\n baseColor,\n name = 'color',\n options,\n size = 'md',\n copyable = true,\n onCopy,\n showBounds = true,\n label,\n helperText,\n error = false,\n required = false,\n className,\n ...props\n },\n ref,\n) {\n const t = useT()\n const id = useId()\n const labelId = `${id}-label`\n const helperId = `${id}-helper`\n const { copy } = useClipboard()\n const palette = generatePalette(baseColor, options)\n\n const handleCopy = async (swatch: PaletteSwatch) => {\n const step = `${name}-${swatch.step}`\n const ok = await copy(swatch.hex)\n if (ok) {\n toast.success(t('colorRamp.copied', { step, hex: swatch.hex }))\n onCopy?.(swatch)\n } else {\n toast.error(t('colorRamp.copyFailed', { step }))\n }\n }\n\n const tip = (swatch: PaletteSwatch) => (\n <span className={styles.tip}>\n <span className={styles.tipTitle}>\n {name}-{swatch.step}\n {swatch.step === BASE_STEP ? ` · ${t('colorRamp.base')}` : ''}\n </span>\n <span>{swatch.hex}</span>\n <span>\n {contrastLine(t('colorRamp.black'), swatch.onDark)} ·{' '}\n {contrastLine(t('colorRamp.white'), swatch.onWhite)}\n </span>\n {copyable && <span>{t('colorRamp.clickToCopy')}</span>}\n </span>\n )\n\n return (\n <div\n ref={ref}\n className={clsx(fieldStyles.field, error && fieldStyles.error, className)}\n {...props}\n >\n {label != null && (\n <label id={labelId} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n {palette ? (\n <>\n <div\n role=\"group\"\n aria-label={t('colorRamp.groupLabel', { name })}\n aria-labelledby={label != null ? labelId : undefined}\n aria-describedby={helperText != null ? helperId : undefined}\n className={clsx(styles.band, styles[size])}\n >\n {palette.map((swatch) => {\n const isBase = swatch.step === BASE_STEP\n // the swatch's own colors are the data — the one legitimate inline-color exception\n const ink = { backgroundColor: swatch.hex, color: swatch.textColor } as CSSProperties\n const stepName = `${name}-${swatch.step}`\n const cell = copyable ? (\n <button\n type=\"button\"\n className={styles.step}\n style={ink}\n data-base={isBase || undefined}\n aria-label={t('colorRamp.copyAria', { name, step: swatch.step, hex: swatch.hex })}\n onClick={() => void handleCopy(swatch)}\n >\n <span className={styles.num} aria-hidden=\"true\">\n {swatch.step}\n </span>\n </button>\n ) : (\n <span\n className={clsx(styles.step, styles.static)}\n style={ink}\n data-base={isBase || undefined}\n role=\"img\"\n aria-label={`${stepName} ${swatch.hex}`}\n >\n <span className={styles.num} aria-hidden=\"true\">\n {swatch.step}\n </span>\n </span>\n )\n // the Tooltip's wrapper span is the band's real flex child (sized by `.band > *`)\n return (\n <Tooltip key={swatch.step} content={tip(swatch)}>\n {cell}\n </Tooltip>\n )\n })}\n </div>\n {showBounds && (\n <div className={styles.bounds}>\n <Typography as=\"span\" variant=\"caption\" color=\"muted\">\n {t('colorRamp.lightest')}\n </Typography>\n <Typography as=\"span\" variant=\"caption\" color=\"muted\">\n {t('colorRamp.darkest')}\n </Typography>\n </div>\n )}\n </>\n ) : (\n <Typography as=\"span\" variant=\"caption\" color=\"muted\">\n {t('colorRamp.invalid')}\n </Typography>\n )}\n\n {helperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={error ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {helperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["contrastLine","who","ColorRamp","forwardRef","baseColor","name","options","size","copyable","onCopy","showBounds","label","helperText","error","required","className","props","ref","useT","id","useId","labelId","helperId","copy","useClipboard","palette","generatePalette","handleCopy","swatch","step","toast","tip","styles","jsxs","BASE_STEP","jsx","clsx","fieldStyles","Typography","Fragment","isBase","ink","stepName","cell","Tooltip"],"mappings":"mnBA+CMA,EAAe,CAACC,EAAa,IACjC,GAAGA,CAAG,IAAI,EAAE,MAAM,QAAQ,CAAC,CAAC,GAAG,EAAE,MAAQ,IAAI,EAAE,KAAK,GAAK,EAAE,GAUhDC,EAAYC,EAAAA,WAA2C,SAClE,CACE,UAAAC,EACA,KAAAC,EAAO,QACP,QAAAC,EACA,KAAAC,EAAO,KACP,SAAAC,EAAW,GACX,OAAAC,EACA,WAAAC,EAAa,GACb,MAAAC,EACA,WAAAC,EACA,MAAAC,EAAQ,GACR,SAAAC,EAAW,GACX,UAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAM,EAAIC,EAAAA,KAAA,EACJC,EAAKC,EAAAA,MAAA,EACLC,EAAU,GAAGF,CAAE,SACfG,EAAW,GAAGH,CAAE,UAChB,CAAE,KAAAI,CAAA,EAASC,eAAA,EACXC,EAAUC,EAAAA,gBAAgBtB,EAAWE,CAAO,EAE5CqB,EAAa,MAAOC,GAA0B,CAClD,MAAMC,EAAO,GAAGxB,CAAI,IAAIuB,EAAO,IAAI,GACxB,MAAML,EAAKK,EAAO,GAAG,GAE9BE,QAAM,QAAQ,EAAE,mBAAoB,CAAE,KAAAD,EAAM,IAAKD,EAAO,GAAA,CAAK,CAAC,EAC9DnB,GAAA,MAAAA,EAASmB,IAETE,EAAAA,MAAM,MAAM,EAAE,uBAAwB,CAAE,KAAAD,CAAA,CAAM,CAAC,CAEnD,EAEME,EAAOH,UACV,OAAA,CAAK,UAAWI,EAAO,IACtB,SAAA,CAAAC,EAAAA,KAAC,OAAA,CAAK,UAAWD,EAAO,SACrB,SAAA,CAAA3B,EAAK,IAAEuB,EAAO,KACdA,EAAO,OAASM,YAAY,MAAM,EAAE,gBAAgB,CAAC,GAAK,EAAA,EAC7D,EACAC,EAAAA,IAAC,OAAA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
1
|
+
{"version":3,"file":"ColorRamp-B_-ZPqMa.cjs","sources":["../src/components/ColorRamp/ColorRamp.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { useClipboard } from '../../hooks/useClipboard'\nimport {\n BASE_STEP,\n generatePalette,\n type GeneratePaletteOptions,\n type Legibility,\n type PaletteSwatch,\n} from '../../helpers/palette'\nimport { Tooltip } from '../Tooltip'\nimport { Typography } from '../Typography'\nimport { toast } from '../Toast'\n// shared field chrome (wrapper / label / helper / required / error)\nimport fieldStyles from '../TextField/TextField.module.css'\nimport styles from './ColorRamp.module.css'\n\nexport type ColorRampSize = 'sm' | 'md' | 'lg'\n\n// `onCopy` here is the swatch callback, so the DOM clipboard `onCopy` handler is omitted alongside `color`\nexport interface ColorRampProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'onCopy'> {\n /** The base (500) color — any value `generatePalette` accepts. Invalid → the empty-state caption. */\n baseColor: string\n /** Token prefix for step names (`primary` → \"primary-500\") — used in tooltips, aria-labels and the copy toast. Default `'color'`. */\n name?: string\n /** Passed to `generatePalette` (override any subset of the tint / shade fractions). */\n options?: GeneratePaletteOptions\n /** Band height. `sm` 32 · `md` 40 (default) · `lg` 48 px. */\n size?: ColorRampSize\n /** Click a step to copy its hex (default `true`). `false` renders the steps as non-interactive cells. */\n copyable?: boolean\n /** After a successful copy — in addition to the built-in toast. */\n onCopy?: (swatch: PaletteSwatch) => void\n /** Show the \"Lightest … Darkest\" caption row under the band (default `true`). */\n showBounds?: boolean\n /** Label rendered above the band (field-family chrome, like `Slider` / `SwatchPicker`). */\n label?: ReactNode\n /** Helper / validation text under the band. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Marks the field invalid — reddens the label/asterisk and shows `helperText` in the error color. */\n error?: boolean\n /** Adds a red asterisk after the label. */\n required?: boolean\n}\n\n/** `black 4.52 AA` — ratio to 2 decimals, the body-text rating appended when it exists. */\nconst contrastLine = (who: string, l: Legibility) =>\n `${who} ${l.ratio.toFixed(2)}${l.small ? ` ${l.small}` : ''}`\n\n/**\n * The generated tonal scale for one color as **a single horizontal band of ten equal steps** sharing\n * one rounded, clipped frame (reads as a continuous ramp, not ten chips). Display + copy only — it never\n * edits the color; pair it with `ColorPicker` (or use `PaletteField`, which composes both). Each step\n * is a `Tooltip`-wrapped button whose fill / ink are the swatch's own colors (inline — the color IS the\n * data), showing its number on the base step and on hover / focus; clicking copies the hex with a toast.\n * `role=\"group\"` labelled \"{name} color scale\"; an invalid `baseColor` renders only a muted caption.\n */\nexport const ColorRamp = forwardRef<HTMLDivElement, ColorRampProps>(function ColorRamp(\n {\n baseColor,\n name = 'color',\n options,\n size = 'md',\n copyable = true,\n onCopy,\n showBounds = true,\n label,\n helperText,\n error = false,\n required = false,\n className,\n ...props\n },\n ref,\n) {\n const t = useT()\n const id = useId()\n const labelId = `${id}-label`\n const helperId = `${id}-helper`\n const { copy } = useClipboard()\n const palette = generatePalette(baseColor, options)\n\n const handleCopy = async (swatch: PaletteSwatch) => {\n const step = `${name}-${swatch.step}`\n const ok = await copy(swatch.hex)\n if (ok) {\n toast.success(t('colorRamp.copied', { step, hex: swatch.hex }))\n onCopy?.(swatch)\n } else {\n toast.error(t('colorRamp.copyFailed', { step }))\n }\n }\n\n const tip = (swatch: PaletteSwatch) => (\n <span className={styles.tip}>\n <span className={styles.tipTitle}>\n {name}-{swatch.step}\n {swatch.step === BASE_STEP ? ` · ${t('colorRamp.base')}` : ''}\n </span>\n <span>{swatch.hex}</span>\n <span>\n {contrastLine(t('colorRamp.black'), swatch.onDark)} ·{' '}\n {contrastLine(t('colorRamp.white'), swatch.onWhite)}\n </span>\n {copyable && <span>{t('colorRamp.clickToCopy')}</span>}\n </span>\n )\n\n return (\n <div\n ref={ref}\n className={clsx(fieldStyles.field, error && fieldStyles.error, className)}\n {...props}\n >\n {label != null && (\n <label id={labelId} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n {palette ? (\n <>\n <div\n role=\"group\"\n aria-label={t('colorRamp.groupLabel', { name })}\n aria-labelledby={label != null ? labelId : undefined}\n aria-describedby={helperText != null ? helperId : undefined}\n className={clsx(styles.band, styles[size])}\n >\n {palette.map((swatch) => {\n const isBase = swatch.step === BASE_STEP\n // the swatch's own colors are the data — the one legitimate inline-color exception\n const ink = { backgroundColor: swatch.hex, color: swatch.textColor } as CSSProperties\n const stepName = `${name}-${swatch.step}`\n const cell = copyable ? (\n <button\n type=\"button\"\n className={styles.step}\n style={ink}\n data-base={isBase || undefined}\n aria-label={t('colorRamp.copyAria', { name, step: swatch.step, hex: swatch.hex })}\n onClick={() => void handleCopy(swatch)}\n >\n <span className={styles.num} aria-hidden=\"true\">\n {swatch.step}\n </span>\n </button>\n ) : (\n <span\n className={clsx(styles.step, styles.static)}\n style={ink}\n data-base={isBase || undefined}\n role=\"img\"\n aria-label={`${stepName} ${swatch.hex}`}\n >\n <span className={styles.num} aria-hidden=\"true\">\n {swatch.step}\n </span>\n </span>\n )\n // the Tooltip's wrapper span is the band's real flex child (sized by `.band > *`)\n return (\n <Tooltip key={swatch.step} content={tip(swatch)}>\n {cell}\n </Tooltip>\n )\n })}\n </div>\n {showBounds && (\n <div className={styles.bounds}>\n <Typography as=\"span\" variant=\"caption\" color=\"muted\">\n {t('colorRamp.lightest')}\n </Typography>\n <Typography as=\"span\" variant=\"caption\" color=\"muted\">\n {t('colorRamp.darkest')}\n </Typography>\n </div>\n )}\n </>\n ) : (\n <Typography as=\"span\" variant=\"caption\" color=\"muted\">\n {t('colorRamp.invalid')}\n </Typography>\n )}\n\n {helperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={error ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {helperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["contrastLine","who","ColorRamp","forwardRef","baseColor","name","options","size","copyable","onCopy","showBounds","label","helperText","error","required","className","props","ref","useT","id","useId","labelId","helperId","copy","useClipboard","palette","generatePalette","handleCopy","swatch","step","toast","tip","styles","jsxs","BASE_STEP","jsx","clsx","fieldStyles","Typography","Fragment","isBase","ink","stepName","cell","Tooltip"],"mappings":"mnBA+CMA,EAAe,CAACC,EAAa,IACjC,GAAGA,CAAG,IAAI,EAAE,MAAM,QAAQ,CAAC,CAAC,GAAG,EAAE,MAAQ,IAAI,EAAE,KAAK,GAAK,EAAE,GAUhDC,EAAYC,EAAAA,WAA2C,SAClE,CACE,UAAAC,EACA,KAAAC,EAAO,QACP,QAAAC,EACA,KAAAC,EAAO,KACP,SAAAC,EAAW,GACX,OAAAC,EACA,WAAAC,EAAa,GACb,MAAAC,EACA,WAAAC,EACA,MAAAC,EAAQ,GACR,SAAAC,EAAW,GACX,UAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAM,EAAIC,EAAAA,KAAA,EACJC,EAAKC,EAAAA,MAAA,EACLC,EAAU,GAAGF,CAAE,SACfG,EAAW,GAAGH,CAAE,UAChB,CAAE,KAAAI,CAAA,EAASC,eAAA,EACXC,EAAUC,EAAAA,gBAAgBtB,EAAWE,CAAO,EAE5CqB,EAAa,MAAOC,GAA0B,CAClD,MAAMC,EAAO,GAAGxB,CAAI,IAAIuB,EAAO,IAAI,GACxB,MAAML,EAAKK,EAAO,GAAG,GAE9BE,QAAM,QAAQ,EAAE,mBAAoB,CAAE,KAAAD,EAAM,IAAKD,EAAO,GAAA,CAAK,CAAC,EAC9DnB,GAAA,MAAAA,EAASmB,IAETE,EAAAA,MAAM,MAAM,EAAE,uBAAwB,CAAE,KAAAD,CAAA,CAAM,CAAC,CAEnD,EAEME,EAAOH,UACV,OAAA,CAAK,UAAWI,EAAO,IACtB,SAAA,CAAAC,EAAAA,KAAC,OAAA,CAAK,UAAWD,EAAO,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AIhB,EACJ,QAAQ,YACR,MAAOT,EAAQ,QAAU,QACzB,UAAWwB,EAAAA,YAAY,OAEtB,SAAAzB,CAAA,CAAA,CACH,CAAA,CAAA,CAIR,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { T as H } from "./Tooltip-DsDv4NOq.js";
|
|
|
7
7
|
import { T as n } from "./Typography-ChSuxgkc.js";
|
|
8
8
|
import { t as x } from "./toastStore-Cx_JOKwS.js";
|
|
9
9
|
import { f as d } from "./TextField.module-6gYcR9TL.js";
|
|
10
|
-
import { a as J } from "./ConfigProvider-
|
|
10
|
+
import { a as J } from "./ConfigProvider-DeMASTVo.js";
|
|
11
11
|
const K = "_band_1d0th_5", M = "_sm_1d0th_15", O = "_md_1d0th_18", Q = "_lg_1d0th_21", U = "_num_1d0th_42", V = "_step_1d0th_47", X = "_bounds_1d0th_94", Y = "_tip_1d0th_101", Z = "_tipTitle_1d0th_107", t = {
|
|
12
12
|
band: K,
|
|
13
13
|
sm: M,
|
|
@@ -123,4 +123,4 @@ const K = "_band_1d0th_5", M = "_sm_1d0th_15", O = "_md_1d0th_18", Q = "_lg_1d0t
|
|
|
123
123
|
export {
|
|
124
124
|
de as C
|
|
125
125
|
};
|
|
126
|
-
//# sourceMappingURL=ColorRamp-
|
|
126
|
+
//# sourceMappingURL=ColorRamp-CCfImssD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorRamp-BnuXrSxa.js","sources":["../src/components/ColorRamp/ColorRamp.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { useClipboard } from '../../hooks/useClipboard'\nimport {\n BASE_STEP,\n generatePalette,\n type GeneratePaletteOptions,\n type Legibility,\n type PaletteSwatch,\n} from '../../helpers/palette'\nimport { Tooltip } from '../Tooltip'\nimport { Typography } from '../Typography'\nimport { toast } from '../Toast'\n// shared field chrome (wrapper / label / helper / required / error)\nimport fieldStyles from '../TextField/TextField.module.css'\nimport styles from './ColorRamp.module.css'\n\nexport type ColorRampSize = 'sm' | 'md' | 'lg'\n\n// `onCopy` here is the swatch callback, so the DOM clipboard `onCopy` handler is omitted alongside `color`\nexport interface ColorRampProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'onCopy'> {\n /** The base (500) color — any value `generatePalette` accepts. Invalid → the empty-state caption. */\n baseColor: string\n /** Token prefix for step names (`primary` → \"primary-500\") — used in tooltips, aria-labels and the copy toast. Default `'color'`. */\n name?: string\n /** Passed to `generatePalette` (override any subset of the tint / shade fractions). */\n options?: GeneratePaletteOptions\n /** Band height. `sm` 32 · `md` 40 (default) · `lg` 48 px. */\n size?: ColorRampSize\n /** Click a step to copy its hex (default `true`). `false` renders the steps as non-interactive cells. */\n copyable?: boolean\n /** After a successful copy — in addition to the built-in toast. */\n onCopy?: (swatch: PaletteSwatch) => void\n /** Show the \"Lightest … Darkest\" caption row under the band (default `true`). */\n showBounds?: boolean\n /** Label rendered above the band (field-family chrome, like `Slider` / `SwatchPicker`). */\n label?: ReactNode\n /** Helper / validation text under the band. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Marks the field invalid — reddens the label/asterisk and shows `helperText` in the error color. */\n error?: boolean\n /** Adds a red asterisk after the label. */\n required?: boolean\n}\n\n/** `black 4.52 AA` — ratio to 2 decimals, the body-text rating appended when it exists. */\nconst contrastLine = (who: string, l: Legibility) =>\n `${who} ${l.ratio.toFixed(2)}${l.small ? ` ${l.small}` : ''}`\n\n/**\n * The generated tonal scale for one color as **a single horizontal band of ten equal steps** sharing\n * one rounded, clipped frame (reads as a continuous ramp, not ten chips). Display + copy only — it never\n * edits the color; pair it with `ColorPicker` (or use `PaletteField`, which composes both). Each step\n * is a `Tooltip`-wrapped button whose fill / ink are the swatch's own colors (inline — the color IS the\n * data), showing its number on the base step and on hover / focus; clicking copies the hex with a toast.\n * `role=\"group\"` labelled \"{name} color scale\"; an invalid `baseColor` renders only a muted caption.\n */\nexport const ColorRamp = forwardRef<HTMLDivElement, ColorRampProps>(function ColorRamp(\n {\n baseColor,\n name = 'color',\n options,\n size = 'md',\n copyable = true,\n onCopy,\n showBounds = true,\n label,\n helperText,\n error = false,\n required = false,\n className,\n ...props\n },\n ref,\n) {\n const t = useT()\n const id = useId()\n const labelId = `${id}-label`\n const helperId = `${id}-helper`\n const { copy } = useClipboard()\n const palette = generatePalette(baseColor, options)\n\n const handleCopy = async (swatch: PaletteSwatch) => {\n const step = `${name}-${swatch.step}`\n const ok = await copy(swatch.hex)\n if (ok) {\n toast.success(t('colorRamp.copied', { step, hex: swatch.hex }))\n onCopy?.(swatch)\n } else {\n toast.error(t('colorRamp.copyFailed', { step }))\n }\n }\n\n const tip = (swatch: PaletteSwatch) => (\n <span className={styles.tip}>\n <span className={styles.tipTitle}>\n {name}-{swatch.step}\n {swatch.step === BASE_STEP ? ` · ${t('colorRamp.base')}` : ''}\n </span>\n <span>{swatch.hex}</span>\n <span>\n {contrastLine(t('colorRamp.black'), swatch.onDark)} ·{' '}\n {contrastLine(t('colorRamp.white'), swatch.onWhite)}\n </span>\n {copyable && <span>{t('colorRamp.clickToCopy')}</span>}\n </span>\n )\n\n return (\n <div\n ref={ref}\n className={clsx(fieldStyles.field, error && fieldStyles.error, className)}\n {...props}\n >\n {label != null && (\n <label id={labelId} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n {palette ? (\n <>\n <div\n role=\"group\"\n aria-label={t('colorRamp.groupLabel', { name })}\n aria-labelledby={label != null ? labelId : undefined}\n aria-describedby={helperText != null ? helperId : undefined}\n className={clsx(styles.band, styles[size])}\n >\n {palette.map((swatch) => {\n const isBase = swatch.step === BASE_STEP\n // the swatch's own colors are the data — the one legitimate inline-color exception\n const ink = { backgroundColor: swatch.hex, color: swatch.textColor } as CSSProperties\n const stepName = `${name}-${swatch.step}`\n const cell = copyable ? (\n <button\n type=\"button\"\n className={styles.step}\n style={ink}\n data-base={isBase || undefined}\n aria-label={t('colorRamp.copyAria', { name, step: swatch.step, hex: swatch.hex })}\n onClick={() => void handleCopy(swatch)}\n >\n <span className={styles.num} aria-hidden=\"true\">\n {swatch.step}\n </span>\n </button>\n ) : (\n <span\n className={clsx(styles.step, styles.static)}\n style={ink}\n data-base={isBase || undefined}\n role=\"img\"\n aria-label={`${stepName} ${swatch.hex}`}\n >\n <span className={styles.num} aria-hidden=\"true\">\n {swatch.step}\n </span>\n </span>\n )\n // the Tooltip's wrapper span is the band's real flex child (sized by `.band > *`)\n return (\n <Tooltip key={swatch.step} content={tip(swatch)}>\n {cell}\n </Tooltip>\n )\n })}\n </div>\n {showBounds && (\n <div className={styles.bounds}>\n <Typography as=\"span\" variant=\"caption\" color=\"muted\">\n {t('colorRamp.lightest')}\n </Typography>\n <Typography as=\"span\" variant=\"caption\" color=\"muted\">\n {t('colorRamp.darkest')}\n </Typography>\n </div>\n )}\n </>\n ) : (\n <Typography as=\"span\" variant=\"caption\" color=\"muted\">\n {t('colorRamp.invalid')}\n </Typography>\n )}\n\n {helperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={error ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {helperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["contrastLine","who","ColorRamp","forwardRef","baseColor","name","options","size","copyable","onCopy","showBounds","label","helperText","error","required","className","props","ref","t","useT","id","useId","labelId","helperId","copy","useClipboard","palette","generatePalette","handleCopy","swatch","step","toast","tip","styles","jsxs","BASE_STEP","jsx","clsx","fieldStyles","Typography","Fragment","isBase","ink","stepName","cell","Tooltip"],"mappings":";;;;;;;;;;;;;;;;;;;;;GA+CMA,IAAe,CAACC,GAAa,MACjC,GAAGA,CAAG,IAAI,EAAE,MAAM,QAAQ,CAAC,CAAC,GAAG,EAAE,QAAQ,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xB;AAAA,QAGDN,KAAc,QACb,gBAAAwB;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAIhB;AAAA,YACJ,SAAQ;AAAA,YACR,OAAOV,IAAQ,UAAU;AAAA,YACzB,WAAWyB,EAAY;AAAA,YAEtB,UAAA1B;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
|
|
1
|
+
{"version":3,"file":"ColorRamp-CCfImssD.js","sources":["../src/components/ColorRamp/ColorRamp.tsx"],"sourcesContent":["import { forwardRef, useId, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { clsx } from 'clsx'\nimport { useT } from '../../theme'\nimport { useClipboard } from '../../hooks/useClipboard'\nimport {\n BASE_STEP,\n generatePalette,\n type GeneratePaletteOptions,\n type Legibility,\n type PaletteSwatch,\n} from '../../helpers/palette'\nimport { Tooltip } from '../Tooltip'\nimport { Typography } from '../Typography'\nimport { toast } from '../Toast'\n// shared field chrome (wrapper / label / helper / required / error)\nimport fieldStyles from '../TextField/TextField.module.css'\nimport styles from './ColorRamp.module.css'\n\nexport type ColorRampSize = 'sm' | 'md' | 'lg'\n\n// `onCopy` here is the swatch callback, so the DOM clipboard `onCopy` handler is omitted alongside `color`\nexport interface ColorRampProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'onCopy'> {\n /** The base (500) color — any value `generatePalette` accepts. Invalid → the empty-state caption. */\n baseColor: string\n /** Token prefix for step names (`primary` → \"primary-500\") — used in tooltips, aria-labels and the copy toast. Default `'color'`. */\n name?: string\n /** Passed to `generatePalette` (override any subset of the tint / shade fractions). */\n options?: GeneratePaletteOptions\n /** Band height. `sm` 32 · `md` 40 (default) · `lg` 48 px. */\n size?: ColorRampSize\n /** Click a step to copy its hex (default `true`). `false` renders the steps as non-interactive cells. */\n copyable?: boolean\n /** After a successful copy — in addition to the built-in toast. */\n onCopy?: (swatch: PaletteSwatch) => void\n /** Show the \"Lightest … Darkest\" caption row under the band (default `true`). */\n showBounds?: boolean\n /** Label rendered above the band (field-family chrome, like `Slider` / `SwatchPicker`). */\n label?: ReactNode\n /** Helper / validation text under the band. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Marks the field invalid — reddens the label/asterisk and shows `helperText` in the error color. */\n error?: boolean\n /** Adds a red asterisk after the label. */\n required?: boolean\n}\n\n/** `black 4.52 AA` — ratio to 2 decimals, the body-text rating appended when it exists. */\nconst contrastLine = (who: string, l: Legibility) =>\n `${who} ${l.ratio.toFixed(2)}${l.small ? ` ${l.small}` : ''}`\n\n/**\n * The generated tonal scale for one color as **a single horizontal band of ten equal steps** sharing\n * one rounded, clipped frame (reads as a continuous ramp, not ten chips). Display + copy only — it never\n * edits the color; pair it with `ColorPicker` (or use `PaletteField`, which composes both). Each step\n * is a `Tooltip`-wrapped button whose fill / ink are the swatch's own colors (inline — the color IS the\n * data), showing its number on the base step and on hover / focus; clicking copies the hex with a toast.\n * `role=\"group\"` labelled \"{name} color scale\"; an invalid `baseColor` renders only a muted caption.\n */\nexport const ColorRamp = forwardRef<HTMLDivElement, ColorRampProps>(function ColorRamp(\n {\n baseColor,\n name = 'color',\n options,\n size = 'md',\n copyable = true,\n onCopy,\n showBounds = true,\n label,\n helperText,\n error = false,\n required = false,\n className,\n ...props\n },\n ref,\n) {\n const t = useT()\n const id = useId()\n const labelId = `${id}-label`\n const helperId = `${id}-helper`\n const { copy } = useClipboard()\n const palette = generatePalette(baseColor, options)\n\n const handleCopy = async (swatch: PaletteSwatch) => {\n const step = `${name}-${swatch.step}`\n const ok = await copy(swatch.hex)\n if (ok) {\n toast.success(t('colorRamp.copied', { step, hex: swatch.hex }))\n onCopy?.(swatch)\n } else {\n toast.error(t('colorRamp.copyFailed', { step }))\n }\n }\n\n const tip = (swatch: PaletteSwatch) => (\n <span className={styles.tip}>\n <span className={styles.tipTitle}>\n {name}-{swatch.step}\n {swatch.step === BASE_STEP ? ` · ${t('colorRamp.base')}` : ''}\n </span>\n <span>{swatch.hex}</span>\n <span>\n {contrastLine(t('colorRamp.black'), swatch.onDark)} ·{' '}\n {contrastLine(t('colorRamp.white'), swatch.onWhite)}\n </span>\n {copyable && <span>{t('colorRamp.clickToCopy')}</span>}\n </span>\n )\n\n return (\n <div\n ref={ref}\n className={clsx(fieldStyles.field, error && fieldStyles.error, className)}\n {...props}\n >\n {label != null && (\n <label id={labelId} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n {palette ? (\n <>\n <div\n role=\"group\"\n aria-label={t('colorRamp.groupLabel', { name })}\n aria-labelledby={label != null ? labelId : undefined}\n aria-describedby={helperText != null ? helperId : undefined}\n className={clsx(styles.band, styles[size])}\n >\n {palette.map((swatch) => {\n const isBase = swatch.step === BASE_STEP\n // the swatch's own colors are the data — the one legitimate inline-color exception\n const ink = { backgroundColor: swatch.hex, color: swatch.textColor } as CSSProperties\n const stepName = `${name}-${swatch.step}`\n const cell = copyable ? (\n <button\n type=\"button\"\n className={styles.step}\n style={ink}\n data-base={isBase || undefined}\n aria-label={t('colorRamp.copyAria', { name, step: swatch.step, hex: swatch.hex })}\n onClick={() => void handleCopy(swatch)}\n >\n <span className={styles.num} aria-hidden=\"true\">\n {swatch.step}\n </span>\n </button>\n ) : (\n <span\n className={clsx(styles.step, styles.static)}\n style={ink}\n data-base={isBase || undefined}\n role=\"img\"\n aria-label={`${stepName} ${swatch.hex}`}\n >\n <span className={styles.num} aria-hidden=\"true\">\n {swatch.step}\n </span>\n </span>\n )\n // the Tooltip's wrapper span is the band's real flex child (sized by `.band > *`)\n return (\n <Tooltip key={swatch.step} content={tip(swatch)}>\n {cell}\n </Tooltip>\n )\n })}\n </div>\n {showBounds && (\n <div className={styles.bounds}>\n <Typography as=\"span\" variant=\"caption\" color=\"muted\">\n {t('colorRamp.lightest')}\n </Typography>\n <Typography as=\"span\" variant=\"caption\" color=\"muted\">\n {t('colorRamp.darkest')}\n </Typography>\n </div>\n )}\n </>\n ) : (\n <Typography as=\"span\" variant=\"caption\" color=\"muted\">\n {t('colorRamp.invalid')}\n </Typography>\n )}\n\n {helperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={error ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {helperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["contrastLine","who","ColorRamp","forwardRef","baseColor","name","options","size","copyable","onCopy","showBounds","label","helperText","error","required","className","props","ref","t","useT","id","useId","labelId","helperId","copy","useClipboard","palette","generatePalette","handleCopy","swatch","step","toast","tip","styles","jsxs","BASE_STEP","jsx","clsx","fieldStyles","Typography","Fragment","isBase","ink","stepName","cell","Tooltip"],"mappings":";;;;;;;;;;;;;;;;;;;;;GA+CMA,IAAe,CAACC,GAAa,MACjC,GAAGA,CAAG,IAAI,EAAE,MAAM,QAAQ,CAAC,CAAC,GAAG,EAAE,QAAQ,IAAI,EAAE,KAAK,KAAK,EAAE,IAUhDC,KAAYC,EAA2C,SAClE;AAAA,EACE,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,QAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAIC,EAAA,GACJC,IAAKC,EAAA,GACLC,IAAU,GAAGF,CAAE,UACfG,IAAW,GAAGH,CAAE,WAChB,EAAE,MAAAI,EAAA,IAASC,EAAA,GACXC,IAAUC,EAAgBvB,GAAWE,CAAO,GAE5CsB,IAAa,OAAOC,MAA0B;AAClD,UAAMC,IAAO,GAAGzB,CAAI,IAAIw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AAWH,EAAO,KAAK,eAAY,QACtC,YAAO,KAAA,CACV;AAAA,kBAAA;AAAA,gBAAA;AAIJ,uBACE,gBAAAG,EAACS,KAA0B,SAASb,EAAIH,CAAM,GAC3C,UAAAe,KADWf,EAAO,IAErB;AAAA,cAEJ,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,UAEFnB,KACC,gBAAAwB,EAAC,OAAA,EAAI,WAAWD,EAAO,QACrB,UAAA;AAAA,YAAA,gBAAAG,EAACG,GAAA,EAAW,IAAG,QAAO,SAAQ,WAAU,OAAM,SAC3C,UAAArB,EAAE,oBAAoB,EAAA,CACzB;AAAA,YACA,gBAAAkB,EAACG,GAAA,EAAW,IAAG,QAAO,SAAQ,WAAU,OAAM,SAC3C,UAAArB,EAAE,mBAAmB,EAAA,CACxB;AAAA,UAAA,EAAA,CACF;AAAA,QAAA,EAAA,CAEJ,IAEA,gBAAAkB,EAACG,GAAA,EAAW,IAAG,QAAO,SAAQ,WAAU,OAAM,SAC3C,UAAArB,EAAE,mBAAmB,EAAA,CACxB;AAAA,QAGDN,KAAc,QACb,gBAAAwB;AAAA,UAACG;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAIhB;AAAA,YACJ,SAAQ;AAAA,YACR,OAAOV,IAAQ,UAAU;AAAA,YACzB,WAAWyB,EAAY;AAAA,YAEtB,UAAA1B;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const Qe=require("react/jsx-runtime"),s=require("react"),Ye=require("./breakpoints-Dpnh6BbG.cjs"),_e=require("./translations-CXEeeUDL.cjs"),I=require("./messages-
|
|
2
|
-
//# sourceMappingURL=ConfigProvider-
|
|
1
|
+
"use strict";const Qe=require("react/jsx-runtime"),s=require("react"),Ye=require("./breakpoints-Dpnh6BbG.cjs"),_e=require("./translations-CXEeeUDL.cjs"),I=require("./messages-h22vS9zn.cjs");function Pe(e){let a=e.trim().replace(/^#/,"");a.length===3&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]);const n=parseInt(a,16);return`${n>>16&255}, ${n>>8&255}, ${n&255}`}function De(e){const[a,n,u]=e.split(",").map(A=>Number(A.trim()));return(a*299+n*587+u*114)/1e3>=150?"#04202b":"#ffffff"}const fe={secondary:"rgb(var(--tz-color-primary-rgb))",warning:"#ffffff"};function ke(e,a=document.documentElement){for(const[n,u]of Object.entries(e)){if(!u)continue;const r=Pe(u);a.style.setProperty(`--tz-color-${n}-rgb`,r),a.style.setProperty(`--tz-color-${n}-contrast`,fe[n]??De(r))}}const o=s.createContext(null),R="tz-theme-mode",T=e=>`tz-accent-color-${e}`,N="tz-header-sticky",Q="tz-font-family",Y="tz-shape",Le="tz-locale",Fe=[{code:"en-US",label:"English"}],C="Inter",Oe=[C],ze=e=>`'${e}', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif`;function Be(){if(typeof document>"u"||document.getElementById("tz-font-preconnect"))return;const e=document.createElement("link");e.id="tz-font-preconnect",e.rel="preconnect",e.href="https://fonts.googleapis.com",document.head.appendChild(e);const a=document.createElement("link");a.rel="preconnect",a.href="https://fonts.gstatic.com",a.crossOrigin="anonymous",document.head.appendChild(a)}function ve(e){if(typeof document>"u"||Oe.includes(e))return;const a=`tz-font-${e.trim().replace(/\s+/g,"-").toLowerCase()}`;if(document.getElementById(a))return;Be();const n=document.createElement("link");n.id=a,n.rel="stylesheet",n.href=`https://fonts.googleapis.com/css2?family=${encodeURIComponent(e.trim()).replace(/%20/g,"+")}&display=swap`,document.head.appendChild(n)}const P="tab",D="nestedTab",f="step",Ie=[],Ke={},Ue={},Me={},He={primary:"#13404e",secondary:"#ffffff",background:"#f9f9f9",surface:"#ffffff",accent:"#056472",success:"#00a854",error:"#f04134",info:"#039aa1",warning:"#ffbf00"},qe={primary:"#e6e8eb",secondary:"#191919",background:"#0f0f0f",surface:"#191919",accent:"#16a6b4",success:"#00a854",error:"#f04134",info:"#039aa1",warning:"#ffbf00"};function we(e){const a=localStorage.getItem(R);return a==="light"||a==="dark"?a:e}function $e(){return{light:localStorage.getItem(T("light"))||null,dark:localStorage.getItem(T("dark"))||null}}function xe(e){const a=localStorage.getItem(N);return a==="1"?!0:a==="0"?!1:e}function Ge(e){return localStorage.getItem(Q)||e}function je(e){const a=localStorage.getItem(Y);return a==="rounded"||a==="square"?a:e}function ge(e,a){const n=e.map(r=>r.code),u=localStorage.getItem(Le);return u&&n.includes(u)?u:a&&n.includes(a)?a:n.find(r=>r.toLowerCase().startsWith("en"))??n[0]??"en-US"}function Je({config:e,children:a}){var le,ce,de,me,pe,ye,Ee,Te,Se,he,ie,Ce,Ae,be;const[n,u]=s.useState(()=>{var t;return we(((t=e==null?void 0:e.theme)==null?void 0:t.mode)??"light")}),[r,A]=s.useState($e),[K,O]=s.useState(()=>{var t;return xe(((t=e==null?void 0:e.header)==null?void 0:t.sticky)??!1)}),[S,z]=s.useState(()=>{var t;return Ge(((t=e==null?void 0:e.theme)==null?void 0:t.fontFamily)??C)}),[h,B]=s.useState(()=>{var t;return je(((t=e==null?void 0:e.theme)==null?void 0:t.shape)??"rounded")}),U=((le=e==null?void 0:e.i18n)==null?void 0:le.languages)??Fe,v=(ce=e==null?void 0:e.i18n)==null?void 0:ce.messages,H=(de=e==null?void 0:e.i18n)==null?void 0:de.appMessages,[p,Re]=s.useState(()=>{var t;return ge(U,(t=e==null?void 0:e.i18n)==null?void 0:t.language)}),d=(me=e==null?void 0:e.theme)==null?void 0:me.colors,i=s.useMemo(()=>{const t={...He,...d==null?void 0:d.light},l={...t,...qe,...d==null?void 0:d.dark};return{light:t,dark:l}},[d]),q=s.useMemo(()=>({light:i.light.accent,dark:i.dark.accent}),[i]),c=s.useCallback((t,l=r[t])=>{const m=i[t];ke(l?{...m,accent:l}:m);const F=document.documentElement;F.setAttribute("data-tz-theme",t),F.style.setProperty("color-scheme",t)},[i,r]);s.useLayoutEffect(()=>{c(n)},[c,n]);const w=(pe=e==null?void 0:e.theme)==null?void 0:pe.breakpoints;s.useLayoutEffect(()=>{Ye.setBreakpoints(w)},[JSON.stringify(w??null)]);const b=s.useCallback(t=>{c(t),u(t),localStorage.setItem(R,t)},[c]),$=s.useCallback(()=>b(n==="light"?"dark":"light"),[n,b]),x=s.useCallback((t,l)=>{const m=l??n;A(F=>({...F,[m]:t})),t?localStorage.setItem(T(m),t):localStorage.removeItem(T(m)),m===n&&c(n,t)},[n,c]),G=s.useCallback(t=>{O(t),localStorage.setItem(N,t?"1":"0")},[]),y=s.useCallback(t=>{ve(t),document.documentElement.style.setProperty("--tz-font-family",ze(t))},[]);s.useLayoutEffect(()=>{y(S)},[y,S]);const j=s.useCallback(t=>{const l=t.trim()||C;y(l),z(l),localStorage.setItem(Q,l)},[y]),E=s.useCallback(t=>{document.documentElement.setAttribute("data-tz-shape",t)},[]);s.useLayoutEffect(()=>{E(h)},[E,h]);const g=s.useCallback(t=>{E(t),B(t),localStorage.setItem(Y,t)},[E]),_=((ye=e==null?void 0:e.theme)==null?void 0:ye.mode)??"light",M=((Ee=e==null?void 0:e.header)==null?void 0:Ee.sticky)??!1,k=((Te=e==null?void 0:e.theme)==null?void 0:Te.fontFamily)??C,L=((Se=e==null?void 0:e.theme)==null?void 0:Se.shape)??"rounded",J=n!==_||r.light!=null||r.dark!=null||K!==M||S!==k||h!==L,V=s.useCallback(()=>{for(const t of[R,T("light"),T("dark"),N,Q,Y])localStorage.removeItem(t);A({light:null,dark:null}),c(_,null),u(_),O(M),y(k),z(k),E(L),B(L)},[c,y,E,_,M,k,L]),W=s.useCallback(t=>{Re(t),localStorage.setItem(Le,t)},[]),X=s.useMemo(()=>I.createTranslator(p,v),[p,v]),Z=s.useMemo(()=>I.createAppTranslator(p,H),[p,H]),ee=(e==null?void 0:e.locales)??Ie,te=((he=e==null?void 0:e.keys)==null?void 0:he.translationsNamespace)??_e.DEFAULT_TRANSLATIONS_NAMESPACE,se=((ie=e==null?void 0:e.keys)==null?void 0:ie.tabQueryKey)??P,ae=((Ce=e==null?void 0:e.keys)==null?void 0:Ce.nestedTabQueryKey)??D,ne=((Ae=e==null?void 0:e.keys)==null?void 0:Ae.stepQueryKey)??f,re=((be=e==null?void 0:e.table)==null?void 0:be.query)??Ke,oe=(e==null?void 0:e.header)??Ue,ue=(e==null?void 0:e.maps)??Me,Ne=s.useMemo(()=>({mode:n,setMode:b,toggleMode:$,accentColors:r,defaultAccentColors:q,setAccentColor:x,locales:ee,translationsNamespace:te,tabQueryKey:se,nestedTabQueryKey:ae,stepQueryKey:ne,tableQuery:re,header:oe,maps:ue,headerSticky:K,setHeaderSticky:G,fontFamily:S,setFontFamily:j,shape:h,setShape:g,hasCustomPreferences:J,resetPreferences:V,language:p,setLanguage:W,languages:U,t:X,appT:Z}),[n,b,$,r,q,x,ee,te,se,ae,ne,re,oe,ue,K,G,S,j,h,g,J,V,p,W,U,X,Z]);return Qe.jsx(o.Provider,{value:Ne,children:a})}function Ve(){const e=s.useContext(o);if(!e)throw new Error("useTheme must be used within a <ConfigProvider>");return e}function We(){var e;return((e=s.useContext(o))==null?void 0:e.locales)??Ie}const Xe=I.createTranslator("en"),Ze=I.createAppTranslator("en");function et(){var e;return((e=s.useContext(o))==null?void 0:e.t)??Xe}function tt(){var e;return((e=s.useContext(o))==null?void 0:e.appT)??Ze}function st(){const e=s.useContext(o);return{language:(e==null?void 0:e.language)??"en-US",setLanguage:(e==null?void 0:e.setLanguage)??(()=>{}),languages:(e==null?void 0:e.languages)??Fe}}function at(){var e;return((e=s.useContext(o))==null?void 0:e.translationsNamespace)??_e.DEFAULT_TRANSLATIONS_NAMESPACE}function nt(){var e;return((e=s.useContext(o))==null?void 0:e.tabQueryKey)??P}function rt(){var e;return((e=s.useContext(o))==null?void 0:e.nestedTabQueryKey)??D}function ot(){var e;return((e=s.useContext(o))==null?void 0:e.stepQueryKey)??f}function ut(){var e;return((e=s.useContext(o))==null?void 0:e.tableQuery)??Ke}function lt(){var e;return((e=s.useContext(o))==null?void 0:e.header)??Ue}function ct(){var e;return((e=s.useContext(o))==null?void 0:e.maps)??Me}function dt(){var e;return((e=s.useContext(o))==null?void 0:e.mode)??"light"}exports.ConfigProvider=Je;exports.DEFAULT_FONT_FAMILY=C;exports.DEFAULT_NESTED_TAB_QUERY_KEY=D;exports.DEFAULT_STEP_QUERY_KEY=f;exports.DEFAULT_TABS_QUERY_KEY=P;exports.applyTheme=ke;exports.useColorMode=dt;exports.useHeaderConfig=lt;exports.useLanguage=st;exports.useLocales=We;exports.useMapsConfig=ct;exports.useNestedTabQueryKey=rt;exports.useStepQueryKey=ot;exports.useT=et;exports.useTableQueryConfig=ut;exports.useTabsQueryKey=nt;exports.useTheme=Ve;exports.useTranslations=tt;exports.useTranslationsNamespace=at;
|
|
2
|
+
//# sourceMappingURL=ConfigProvider-B_Bb6pk1.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigProvider-B_Bb6pk1.cjs","sources":["../src/theme/applyTheme.ts","../src/theme/ConfigProvider.tsx"],"sourcesContent":["export interface ThemePalette {\n primary: string\n /**\n * A free theme color (near-white by default) selectable via the `color` prop — it is **no longer**\n * the component surface (elevated panels use `--tz-color-surface`).\n */\n secondary: string\n /**\n * The rear-most page background — the `<body>` fill + the shell canvas that the floating panels sit\n * on; nothing else uses it. Built-in defaults: a soft off-white in light mode, a near-black in dark mode.\n */\n background: string\n /**\n * The elevated **panel surface** — cards, sidebar, inputs/forms, dropdowns, modals (the panels that\n * float over `--tz-color-background`). Built-in defaults: white in light mode, a touch lighter than\n * the canvas in dark mode. Configurable per mode like any theme color.\n */\n surface: string\n /** The single accent color — the default tint for controls (`Button`, `IconButton`, …). */\n accent: string\n success: string\n error: string\n info: string\n warning: string\n}\n\n/** Names of the theme palette tokens (maps to `--tz-color-<name>`). */\nexport type ThemeColor = keyof ThemePalette\n\nfunction hexToRgbTriplet(hex: string): string {\n let h = hex.trim().replace(/^#/, '')\n if (h.length === 3) {\n h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2]\n }\n const int = parseInt(h, 16)\n return `${(int >> 16) & 255}, ${(int >> 8) & 255}, ${int & 255}`\n}\n\n/**\n * Picks a readable text color (near-black or white) to sit on top of a solid\n * fill — used by `contained` controls so the label stays legible on light\n * colors (e.g. a light `primary` in dark mode).\n */\nfunction contrastColor(rgbTriplet: string): string {\n const [r, g, b] = rgbTriplet.split(',').map((n) => Number(n.trim()))\n const yiq = (r * 299 + g * 587 + b * 114) / 1000\n return yiq >= 150 ? '#04202b' : '#ffffff'\n}\n\n/**\n * Per-color overrides for the `contained` label color, where the automatic\n * luminance pick isn't the desired look:\n * - `secondary`: near-white fill that blends with the page, so the label uses\n * the primary color (flips with the mode) to stay readable without a border.\n * - `warning`: keep the plain white label by design.\n */\nconst CONTRAST_OVERRIDE: Readonly<Record<string, string>> = {\n secondary: 'rgb(var(--tz-color-primary-rgb))',\n warning: '#ffffff',\n}\n\nexport function applyTheme(\n theme: Partial<ThemePalette>,\n target: HTMLElement = document.documentElement,\n): void {\n for (const [name, value] of Object.entries(theme)) {\n if (!value) continue\n const triplet = hexToRgbTriplet(value)\n target.style.setProperty(`--tz-color-${name}-rgb`, triplet)\n target.style.setProperty(\n `--tz-color-${name}-contrast`,\n CONTRAST_OVERRIDE[name] ?? contrastColor(triplet),\n )\n }\n}\n","import {\n createContext,\n useCallback,\n useContext,\n useLayoutEffect,\n useMemo,\n useState,\n type ReactNode,\n} from 'react'\nimport { applyTheme, type ThemeColor, type ThemePalette } from './applyTheme'\nimport { setBreakpoints, type Breakpoint } from './breakpoints'\nimport { DEFAULT_TRANSLATIONS_NAMESPACE } from '../helpers/translations'\nimport type { IconName } from '../icons/names'\nimport {\n createAppTranslator,\n createTranslator,\n type AppMessages,\n type AppTranslator,\n type MessageOverrides,\n type Translator,\n} from '../i18n/messages'\n\nexport type ThemeMode = 'light' | 'dark'\n/**\n * Global corner shape. `rounded` (default) leaves every radius as designed; `square` flattens every\n * library corner by zeroing the WHOLE `--tz-radius-*` scale (theme.css, under `[data-tz-shape='square']`)\n * — including the `pill` / `round` steps every decorative pill and circle uses. Purely token-driven: no\n * `!important`, no universal selector, and the consuming app's own elements are untouched. The `Loader`\n * ring and the `EmptyState` icon puck use a literal `50%` (off the scale) and stay round.\n */\nexport type ThemeShape = 'rounded' | 'square'\n\nexport interface ThemeColors {\n /** Light-mode palette. Override any subset of the theme colors — the rest use the library defaults. */\n light?: Partial<ThemePalette>\n /** Dark-mode overrides, layered on the (merged) light palette + the library's dark defaults. */\n dark?: Partial<ThemePalette>\n}\n\n/** A content locale the app supports — a tab in `<TranslatedFields>`. */\nexport interface LocaleConfig {\n /** BCP-47 locale code, e.g. `'en-US'`. Namespaces the form field names and is the tab's fallback label. */\n code: string\n /** Human-readable tab label. Falls back to `code`. */\n label?: string\n}\n\n/** Theme settings — color overrides + initial mode. Lives under `Config.theme`. */\nexport interface ThemeConfig {\n /** Theme color overrides. Omit entirely to use the library's built-in theme. */\n colors?: ThemeColors\n /** Initial color mode. */\n mode?: ThemeMode\n /**\n * Default font family — the app-wide default the user's Settings choice overrides (persisted). One of\n * the pre-imported presets (`Inter` / `Roboto` / `Lato`) or any Google Font family name. Defaults to\n * `Inter`. A non-preset family is loaded on demand at runtime.\n */\n fontFamily?: string\n /**\n * Default corner shape — the app-wide default the user's Settings choice overrides (persisted).\n * `rounded` (default) leaves every radius as designed; `square` zeroes the whole `--tz-radius-*` scale\n * (pills and circles included) — token-driven, so the app's own elements are never touched. Only the\n * `Loader` ring and the `EmptyState` icon puck (a literal `50%`) stay round.\n */\n shape?: ThemeShape\n /**\n * Override the shared responsive **breakpoint** bounds (px, max-width). Keys are fixed\n * (`xxs`/`xs`/`sm`/`md`/`lg`/`xl`/`xxl`); pass any subset — the rest keep their defaults. Drives the\n * **JS** responsive layer (`useMediaQuery` tokens, `Flex`/`Grid`/`Masonry` responsive props); note\n * component CSS `@media` rules are compiled and don't follow a runtime override. E.g.\n * `breakpoints: { md: 1200, xl: 1600 }`.\n */\n breakpoints?: Partial<Record<Breakpoint, number>>\n}\n\n/**\n * The configurable key / param **names** the library's components read — grouped under `Config.keys`\n * so they live in one place. Each is overridable; omit one to use its built-in default. Grows over\n * time (e.g. `page` / `size` for paginated tables ⇒ `?page=1&size=10`).\n */\nexport interface KeysConfig {\n /**\n * URL query param name a **top-level** `<Tabs>` syncs its active tab to (e.g. `'view'` ⇒ `?view=…`),\n * unless that strip sets its own `queryKey` (or `queryKey={null}` to opt out). Defaults to `'tab'`.\n */\n tabQueryKey?: string\n /**\n * URL query param name a **nested** `<Tabs>` (one rendered inside another tab's panel) syncs to, so it\n * doesn't collide with the outer strip's `tabQueryKey` (e.g. `?tab=…&nestedTab=…`). Auto-applied by\n * nesting depth; overridable per strip via `queryKey`. Defaults to `'nestedTab'`.\n */\n nestedTabQueryKey?: string\n /**\n * URL query param name a `<Stepper queryKey>` (the bare/`true` form) syncs its active step to\n * (**1-based**, e.g. `?step=2`); a string `queryKey` overrides it per stepper. Defaults to `'step'`.\n * (The sync itself is **opt-in** — a stepper with no `queryKey` never touches the URL.)\n */\n stepQueryKey?: string\n /**\n * Top-level namespace word for `<TranslatedFields>`' form names + the nested object — e.g.\n * `'languages'` ⇒ `languages[en-US].title`. Defaults to `'translations'`.\n */\n translationsNamespace?: string\n}\n\n/**\n * How a `<Table>` builds its **server-request** params — the query it hands the consumer (as `params` /\n * `query`) in `onChange`, so a server-mode fetch doesn't hand-map page/size/search/sort every time. This is\n * the **backend transport** layer, distinct from `keys.*QueryKey` (the browser-URL sync, always page-based\n * for shareable links). Set once in `config.table.query`, override per table via the `queryMapping` prop.\n * Every field is optional; the defaults reproduce the browser-URL shape (`?page=1&size=10&search=…&sort=-key`).\n */\nexport interface TableQueryConfig {\n /** Request param name for the page / offset. Defaults to `'page'` (e.g. `'skip'` for an offset API). */\n pageParam?: string\n /** Request param name for the page size. Defaults to `'size'` (e.g. `'limit'`). */\n sizeParam?: string\n /** Request param name for the search query (omitted when the search is empty). Defaults to `'search'` (e.g. `'q'`). */\n searchParam?: string\n /**\n * Request param name holding the sort **key**. Defaults to `'sort'` (e.g. `'sortBy'`). With\n * `sortFormat: 'field'` this single param also carries the direction (`-key` = desc); with `'separate'`\n * the direction goes to `sortOrderParam`.\n */\n sortParam?: string\n /**\n * Pagination style. `'page'` (default) emits the **1-based page number** as-is (`page=2`); `'offset'`\n * emits a **zero-based offset** `(page - 1) * size` instead (`skip=10`), for skip/offset APIs.\n */\n pagination?: 'page' | 'offset'\n /**\n * Sort encoding. `'field'` (default) is a single param with a `-` prefix for descending (`sort=-price`);\n * `'separate'` splits into two params — the key in `sortParam` + the direction in `sortOrderParam`\n * (`sortBy=price&order=desc`); `'suffix'` appends the direction value to the key in a single param\n * (`sort=priceAsc` / `sort=priceDesc` with `ascValue: 'Asc'` / `descValue: 'Desc'`).\n */\n sortFormat?: 'field' | 'separate' | 'suffix'\n /** Direction param name when `sortFormat: 'separate'`. Defaults to `'order'`. */\n sortOrderParam?: string\n /**\n * Value emitted for an ascending sort — the `sortOrderParam` value when `sortFormat: 'separate'`, or the\n * suffix appended to the key when `sortFormat: 'suffix'`. Defaults to `'asc'`.\n */\n ascValue?: string\n /**\n * Value emitted for a descending sort — the `sortOrderParam` value when `sortFormat: 'separate'`, or the\n * suffix appended to the key when `sortFormat: 'suffix'`. Defaults to `'desc'`.\n */\n descValue?: string\n /**\n * What to emit for the size param when the **\"All\"** rows-per-page choice is active. A `string`/`number`\n * sets `size=<allValue>` (e.g. `0` for APIs where `limit=0` means \"all\"); omit it (default) to drop the\n * size param entirely (many APIs treat a missing limit as unbounded).\n */\n allValue?: string | number\n /**\n * How a **`multiSelect`** filter serializes into the request query: `'repeat'` (default — `cat=a&cat=b`),\n * `'csv'` (`cat=a,b`), or `'indexed'` (`cat[0]=a&cat[1]=b`).\n */\n multiSelectFormat?: 'repeat' | 'csv' | 'indexed'\n /**\n * Suffix appended to a **range** filter's param for its lower / upper bound — e.g. `Min`/`Max` (default)\n * → `priceMin`/`priceMax`; set `'_gte'`/`'_lte'`, `'[gte]'`/`'[lte]'`, `'From'`/`'To'`, … to match your API.\n */\n rangeMinSuffix?: string\n rangeMaxSuffix?: string\n}\n\n/** `<Table>`-specific configuration. Grows over time; today just the server-request query mapping. */\nexport interface TableConfig {\n /** How `<Table>` builds its server-request params (emitted as `params` / `query` in `onChange`). */\n query?: TableQueryConfig\n}\n\n/** Signed-in user shown in the shell header avatar + its account menu (see `HeaderConfig`). */\nexport interface HeaderUser {\n /** Full name — shown as the menu's name line. */\n name?: string\n /** Email shown under the name in the account menu. */\n email?: string\n /** Avatar image URL (falls back to a user icon). */\n avatar?: string\n}\n\n/**\n * One custom item in the header account menu (rendered between the user block and **Sign out**). Give it a\n * `to` (a real router link — an `href`, middle-click / ⌘-click open a new tab), an `onClick`, or both\n * (`onClick` runs first, then the navigation). With neither, a development warning is logged.\n */\nexport interface HeaderMenuItem {\n /** Visible label. */\n label: string\n /** Leading icon (`IconName`). Optional. */\n icon?: IconName\n /** Runs on click (before any `to` navigation); the menu closes afterwards. */\n onClick?: () => void\n /** Router path the item links to (rendered as a router `Link`, so it has an `href`). */\n to?: string\n /** Path params for `to` (e.g. `{ id: '7' }` for `/users/$id`). */\n params?: Record<string, string>\n /** Search params for `to`. */\n search?: Record<string, unknown>\n /** Renders the item disabled. Optional. */\n disabled?: boolean\n /** Tint, e.g. `'error'` for a destructive item. Default: inherit. */\n color?: ThemeColor\n}\n\n/** The `header.environment` badge, spelled out — e.g. `{ label: 'QA', color: 'info' }`. */\nexport interface HeaderEnvironment {\n /** Chip text, shown as given. */\n label: string\n /** Chip tint. Defaults to `warning`. */\n color?: ThemeColor\n /** Leading icon. Defaults to `Code` (a build, not the live app); `false` hides it. */\n icon?: IconName | false\n}\n\n/**\n * An app action button in the shell header — rendered as an `IconButton` in the same style as the built-in\n * header controls (with a `Tooltip` and an optional count / dot badge), left of them. On narrow screens\n * (`xs`) the actions move into the account menu (when there is one).\n */\nexport interface HeaderAction {\n /** Icon on the button (`IconName`). */\n icon: IconName\n /** Accessible name + tooltip text (and the item label once it moves into the account menu). */\n label: string\n /** Runs on click. */\n onClick?: () => void\n /** Router path to navigate to on click (instead of / as well as `onClick`). */\n to?: string\n /** Path params for `to`. */\n params?: Record<string, string>\n /** Search params for `to`. */\n search?: Record<string, unknown>\n /** Count / text badge pinned to the button (e.g. unread notifications). A numeric `0` is hidden. */\n badge?: number | string\n /** A plain indicator dot instead of a count. */\n dot?: boolean\n /** Badge / dot tint. Defaults to `error`. */\n badgeColor?: ThemeColor\n /** Icon tint. Defaults to the header controls' tint (`accent`). */\n color?: ThemeColor\n /** Renders the button disabled. */\n disabled?: boolean\n}\n\n/**\n * `RootLayout` header configuration — the shell's top-bar controls. Set it once app-wide in\n * `config.header`, or per shell via the `RootLayout` `header` prop (the prop wins, merged over config).\n */\nexport interface HeaderConfig {\n /** Show the built-in light/dark theme toggle. Defaults to `true`. */\n theme?: boolean\n /**\n * Make the shell header **stick to the top on scroll** (fixed) instead of scrolling away (static).\n * This is the app-wide default; the user can flip it in the **Settings** drawer and their choice is\n * persisted (`localStorage['tz-header-sticky']`), overriding this. Defaults to `false` (static).\n */\n sticky?: boolean\n /** Show the browser-fullscreen toggle (auto-hides where the Fullscreen API is unavailable). Defaults to `false`. */\n fullscreen?: boolean\n /** Show the **Settings** button (opens the right-side drawer to pick the per-mode `accent`). Defaults to `true`. */\n settings?: boolean\n /** Show the nav search over the sidebar's pages (with suggestions). Defaults to `true`. */\n search?: boolean\n /**\n * Show the header **language switcher** (the `Global`-icon dropdown of `config.i18n.languages`).\n * Defaults to `true`, but it only renders when more than one UI language is configured — so pass\n * `false` to hide it even with several languages (the panel stays on its current/default language).\n */\n languages?: boolean\n /** Show the breadcrumb trail at the top of the content. Defaults to **`true`**. */\n breadcrumbs?: boolean\n /** When provided, an account `Avatar` appears; its menu has a **Sign Out** item that calls this. */\n onLogout?: () => void\n /** Signed-in user — shown in the header avatar and as a header block atop the account menu. */\n user?: HeaderUser\n /**\n * Extra items in the header account menu, rendered between the user block and **Sign out**, in order.\n * Only shown when `onLogout` is set (the menu does not exist otherwise). A `Divider` separates them\n * from **Sign out**. (When merging a `RootLayout`/`AdminRoot` `header` prop over `config.header`, the\n * prop's `menu` array **replaces** the config's — arrays don't concatenate.)\n */\n menu?: HeaderMenuItem[]\n /**\n * App action buttons, left of the built-in controls (theme / language / settings / account), in order —\n * styled like them, each with a tooltip and an optional badge. On `xs` they move into the account menu\n * (above the `menu` items) when `onLogout` is set; otherwise they stay in the header. Like `menu`, a\n * `header` prop's `actions` **replaces** the config's.\n */\n actions?: HeaderAction[]\n /**\n * Free-form header content for what `actions` can't express — a text `Button` (\"New Order\"), a `Dropdown`.\n * Rendered left of `actions`; hidden on `xs` (the header has no room there). For an environment badge use\n * `environment`, which stays visible on `xs`.\n */\n extra?: ReactNode\n /**\n * The deployment environment badge — a small chip at the start of the header controls, **shown on every\n * screen size (phones too)**, so nobody mistakes a test build for the real one. Pass the app's env value\n * straight in, the same code everywhere: `environment: import.meta.env.VITE_APP_ENV`. A string is shown with\n * its first letter capitalized (`'staging'` → \"Staging\") in the `warning` color with a `Code` icon;\n * `{ label, color, icon }` sets them.\n * **Nothing renders** when it's empty / `undefined` / `null` or `'production'` / `'prod'` (any case).\n */\n environment?: string | HeaderEnvironment | null\n}\n\n/**\n * UI-language config for the admin panel's **own** static strings (labels, placeholders, aria-labels).\n * Distinct from `locales` (which is content-translation locales for `<TranslatedFields>`). The library\n * ships built-in translations (English + Georgian), so listing `languages` here is enough to get a\n * localized panel — no per-app setup. Any language the library doesn't ship is supplied via `messages`.\n */\nexport interface I18nConfig {\n /**\n * Active UI language on first load (a locale code, e.g. `'ka-GE'`). Defaults to English if listed in\n * `languages`, else the first `languages` entry, else `'en-US'`. The user's switcher choice (persisted)\n * overrides it.\n */\n language?: string\n /**\n * The UI languages the panel offers — drives the Settings language switcher. One entry = a fixed\n * language (no switcher). Defaults to English only. (Reuses the `{ code, label }` shape.)\n */\n languages?: LocaleConfig[]\n /**\n * Extra / override message catalogs for the **library's own** strings, merged **over** the built-ins\n * and keyed by language code or base language (`'ka-GE'` or `'ka'`). Use this to localize into a\n * language the library doesn't ship, or to tweak a built-in string. Unset keys fall back to English.\n */\n messages?: MessageOverrides\n /**\n * Catalogs for the **consuming app's own** UI strings — its section titles, labels, business copy —\n * keyed by language code/base then by any string key the app picks. Read via **`useTranslations()`**,\n * which binds to the active UI language, so the app's text switches together with the panel. Resolution\n * per key: exact code → base language → English (`'en'`) → the key itself. This is the app's own copy;\n * `messages` above is only for the library's built-in strings.\n */\n appMessages?: AppMessages\n}\n\n/**\n * App-level configuration passed to `<ConfigProvider config={…}>`. Groups theming under `theme`,\n * the configurable key/param names under `keys`, and keeps the rest (`locales`, …) at the top — a\n * single place to grow.\n */\nexport interface Config {\n /** Theme settings (color overrides + initial mode). Omit entirely to use the built-in theme. */\n theme?: ThemeConfig\n /** Content locales the app supports — drive `<TranslatedFields>`' tabs (one per locale). */\n locales?: LocaleConfig[]\n /** UI-language config for the panel's own strings (the library ships the translations). See `I18nConfig`. */\n i18n?: I18nConfig\n /**\n * Configurable key / query-param names the components read — e.g. the `<Tabs>` query keys\n * (`tabQueryKey` / `nestedTabQueryKey`) and the `<TranslatedFields>` namespace\n * (`translationsNamespace`). Grows over time (`page`, `size`, …).\n */\n keys?: KeysConfig\n /** `<Table>` config — today the server-request query mapping (`table.query`) shared by every table. */\n table?: TableConfig\n /**\n * `RootLayout` header config, app-wide — the shell top-bar toggles (`theme` / `fullscreen` /\n * `search` / `breadcrumbs`) + the account (`onLogout` / `user`). A `RootLayout`\n * `header` prop is merged over this (the prop wins), so a specific shell can override.\n */\n header?: HeaderConfig\n /** Google Maps settings for `LocationPicker` (the API key etc.), app-wide. See `MapsConfig`. */\n maps?: MapsConfig\n}\n\n/**\n * Google Maps settings, app-wide — read by `LocationPicker` (its own `apiKey` / `mapId` props win). The key is the\n * app's **browser** key (restrict it by HTTP referrer in the Google Cloud console); the Maps JavaScript API is\n * loaded on demand the first time a map renders, so a panel that never shows one never loads it.\n */\nexport interface MapsConfig {\n /** The Google Maps JavaScript API key. */\n apiKey?: string\n /**\n * A Map ID (Google Cloud → Map Management). Optional — with one the pin is an `AdvancedMarkerElement` and the\n * map uses its cloud style; without it a classic marker + the library's light / dark styling are used.\n */\n mapId?: string\n}\n\ninterface ThemeContextValue {\n mode: ThemeMode\n setMode: (mode: ThemeMode) => void\n toggleMode: () => void\n /** The persisted accent-color overrides **per mode** (a hex, or `null` when using that mode's default). */\n accentColors: Record<ThemeMode, string | null>\n /** The configured/default `accent` **per mode** (before any override) — the \"no override\" values. */\n defaultAccentColors: Record<ThemeMode, string>\n /** Set (or clear with `null`) the accent override for `mode` (defaults to the current) — persists + re-applies. */\n setAccentColor: (color: string | null, mode?: ThemeMode) => void\n locales: LocaleConfig[]\n /** Resolved translations namespace (`config.keys.translationsNamespace` ?? the built-in default). */\n translationsNamespace: string\n /** Resolved top-level tabs query key (`config.keys.tabQueryKey` ?? the built-in default). */\n tabQueryKey: string\n /** Resolved nested tabs query key (`config.keys.nestedTabQueryKey` ?? the built-in default). */\n nestedTabQueryKey: string\n /** Resolved stepper query key (`config.keys.stepQueryKey` ?? the built-in default). */\n stepQueryKey: string\n /** The `<Table>` server-request query mapping (`config.table.query` ?? `{}`). Defaults applied by `buildTableQuery`. */\n tableQuery: TableQueryConfig\n /** App-wide `RootLayout` header config (`config.header` ?? `{}`); the `RootLayout` prop merges over it. */\n header: HeaderConfig\n /** App-wide Google Maps settings (`config.maps` ?? `{}`). */\n maps: MapsConfig\n /** Whether the shell header sticks to the top on scroll (fixed) vs scrolls away (static). Persisted. */\n headerSticky: boolean\n /** Set + persist the header sticky/static preference (overrides `config.header.sticky`). */\n setHeaderSticky: (sticky: boolean) => void\n /** The active font family (drives `--tz-font-family`). Persisted; seeded from `config.theme.fontFamily`. */\n fontFamily: string\n /** Set + persist the font family (a preset or any Google Font name; loaded on demand). */\n setFontFamily: (family: string) => void\n /** The active corner shape (`rounded` / `square`, drives `data-tz-shape` on `<html>`). Persisted; seeded from `config.theme.shape`. */\n shape: ThemeShape\n /** Set + persist the corner shape (overrides `config.theme.shape`). */\n setShape: (shape: ThemeShape) => void\n /**\n * `true` while any appearance preference differs from the app's configured default — the mode, either\n * mode's accent, the font, the header sticky choice or the shape. Drives the Settings drawer's Reset.\n */\n hasCustomPreferences: boolean\n /**\n * Reset every appearance preference to the app's configured default (`config.theme.mode` / `fontFamily` /\n * `shape`, `config.header.sticky`, no accent override) and forget the saved choices, so the configured\n * defaults apply again on the next visit. The UI language is not touched (it isn't an appearance setting).\n */\n resetPreferences: () => void\n /** Active UI language code (drives `t`). Persisted; seeded from `config.i18n.language` (default English). */\n language: string\n /** Set + persist the active UI language (must be one of `languages`). */\n setLanguage: (code: string) => void\n /** The UI languages the panel offers (from `config.i18n.languages`, default English only). */\n languages: LocaleConfig[]\n /** Translator for the library's built-in strings, bound to the active `language`. */\n t: Translator\n /** Translator for the **app's own** strings (`config.i18n.appMessages`), bound to the active `language`. */\n appT: AppTranslator\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null)\nconst STORAGE_KEY = 'tz-theme-mode'\n/** Where the user's picked accent-color override is persisted, **per mode** (survives reloads). */\nconst accentStorageKey = (mode: ThemeMode) => `tz-accent-color-${mode}`\n/** Where the user's header sticky/static choice is persisted (survives reloads). */\nconst HEADER_STICKY_KEY = 'tz-header-sticky'\n/** Where the user's chosen font family is persisted (survives reloads). */\nconst FONT_STORAGE_KEY = 'tz-font-family'\n/** Where the user's chosen corner shape is persisted (survives reloads). */\nconst SHAPE_STORAGE_KEY = 'tz-shape'\n/** Where the user's chosen UI language is persisted (survives reloads). */\nconst LOCALE_KEY = 'tz-locale'\n/** Default UI languages when `config.i18n.languages` is unset — English only. */\nconst DEFAULT_LANGUAGES: LocaleConfig[] = [{ code: 'en-US', label: 'English' }]\n/** The default font family (matches the `--tz-font-family` token's primary family). */\nexport const DEFAULT_FONT_FAMILY = 'Inter'\n/** Families already in the shipped CSS (only the default) — these skip the runtime `<link>` load. */\nconst BUNDLED_FONTS: readonly string[] = [DEFAULT_FONT_FAMILY]\n/** The full fallback stack applied to `--tz-font-family` for a chosen family (mirrors theme.css). */\nconst fontStack = (family: string) =>\n `'${family}', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif`\n\n/** Add the Google Fonts preconnect hints once, so the on-demand font fetch isn't delayed by DNS/TLS. */\nfunction ensureFontPreconnect() {\n if (typeof document === 'undefined' || document.getElementById('tz-font-preconnect')) return\n const api = document.createElement('link')\n api.id = 'tz-font-preconnect'\n api.rel = 'preconnect'\n api.href = 'https://fonts.googleapis.com'\n document.head.appendChild(api)\n const gstatic = document.createElement('link')\n gstatic.rel = 'preconnect'\n gstatic.href = 'https://fonts.gstatic.com'\n gstatic.crossOrigin = 'anonymous'\n document.head.appendChild(gstatic)\n}\n\n/**\n * Ensure a Google Fonts stylesheet `<link>` exists for `family` (deduped by id). Only the default\n * (`Inter`) ships pre-imported, so every other family — the Roboto/Lato presets and any custom pick —\n * is loaded here on first use. Bare family request (no weight axes) so it works for any font — Google\n * serves the available weights.\n */\nfunction ensureFontLoaded(family: string) {\n if (typeof document === 'undefined' || BUNDLED_FONTS.includes(family)) return\n const id = `tz-font-${family.trim().replace(/\\s+/g, '-').toLowerCase()}`\n if (document.getElementById(id)) return\n ensureFontPreconnect()\n const link = document.createElement('link')\n link.id = id\n link.rel = 'stylesheet'\n link.href = `https://fonts.googleapis.com/css2?family=${encodeURIComponent(family.trim()).replace(/%20/g, '+')}&display=swap`\n document.head.appendChild(link)\n}\n/** The built-in default URL query param name a **top-level** `<Tabs>` syncs to (no `queryKey`/config). */\nexport const DEFAULT_TABS_QUERY_KEY = 'tab'\n/** The built-in default URL query param name a **nested** `<Tabs>` syncs to (no `queryKey`/config). */\nexport const DEFAULT_NESTED_TAB_QUERY_KEY = 'nestedTab'\n/** The built-in default URL query param name a `<Stepper>` syncs to (no `queryKey`/config). */\nexport const DEFAULT_STEP_QUERY_KEY = 'step'\n/** Stable empty-locales fallback so the context value memo doesn't churn when no locales are configured. */\nconst EMPTY_LOCALES: LocaleConfig[] = []\n/** Stable empty table-query fallback so the context memo doesn't churn when no `table.query` is configured. */\nconst EMPTY_TABLE_QUERY: TableQueryConfig = {}\n/** Stable empty header fallback so the context memo doesn't churn when no `header` is configured. */\nconst EMPTY_HEADER: HeaderConfig = {}\nconst EMPTY_MAPS: MapsConfig = {}\n\n/**\n * The library's built-in light palette — the single source of truth for every theme color's default\n * value. Apps override any subset via `config.colors.light`; the rest fall back to these. (theme.css\n * holds only the structure that references these values, not the values themselves.)\n */\nconst DEFAULT_LIGHT_COLORS: ThemePalette = {\n primary: '#13404e',\n secondary: '#ffffff',\n background: '#f9f9f9', // the rear + shell canvas — a soft off-white behind the white panels\n surface: '#ffffff', // the elevated panels (cards, sidebar, inputs, dropdowns, modals)\n accent: '#056472',\n success: '#00a854',\n error: '#f04134',\n info: '#039aa1',\n warning: '#ffbf00',\n}\n\n/**\n * Built-in dark-mode overrides — only the colors that differ from light; everything else inherits the\n * (merged) light palette. Apps override any of these via `config.colors.dark`.\n */\nconst DEFAULT_DARK_COLORS: Partial<ThemePalette> = {\n primary: '#e6e8eb',\n secondary: '#191919',\n background: '#0f0f0f', // the near-black rear + canvas\n surface: '#191919', // a touch lighter than the canvas, for the elevated panels\n accent: '#16a6b4', // a brighter teal — the light-mode accent is too dark on the dark canvas\n success: '#00a854',\n error: '#f04134',\n info: '#039aa1',\n warning: '#ffbf00',\n}\n\nfunction getInitialMode(fallback: ThemeMode): ThemeMode {\n const stored = localStorage.getItem(STORAGE_KEY)\n return stored === 'light' || stored === 'dark' ? stored : fallback\n}\n\n/** The persisted per-mode accent-color overrides (a hex string per mode, or `null` when none picked). */\nfunction getInitialAccentByMode(): Record<ThemeMode, string | null> {\n return {\n light: localStorage.getItem(accentStorageKey('light')) || null,\n dark: localStorage.getItem(accentStorageKey('dark')) || null,\n }\n}\n\n/** The persisted header sticky choice (`fallback` = the app's `config.header.sticky` when unset). */\nfunction getInitialHeaderSticky(fallback: boolean): boolean {\n const stored = localStorage.getItem(HEADER_STICKY_KEY)\n return stored === '1' ? true : stored === '0' ? false : fallback\n}\n\n/** The persisted font family (`fallback` = `config.theme.fontFamily` ?? the default when unset). */\nfunction getInitialFont(fallback: string): string {\n return localStorage.getItem(FONT_STORAGE_KEY) || fallback\n}\n\n/** The persisted corner shape (`fallback` = `config.theme.shape` ?? `rounded` when unset / invalid). */\nfunction getInitialShape(fallback: ThemeShape): ThemeShape {\n const stored = localStorage.getItem(SHAPE_STORAGE_KEY)\n return stored === 'rounded' || stored === 'square' ? stored : fallback\n}\n\n/**\n * The initial UI language: the persisted choice (if still offered), else `config.i18n.language`, else\n * English if it's among the offered languages, else the first offered, else `'en-US'`. Always clamped\n * to a code that's actually in `languages`.\n */\nfunction getInitialLanguage(languages: LocaleConfig[], configLanguage?: string): string {\n const codes = languages.map((l) => l.code)\n const stored = localStorage.getItem(LOCALE_KEY)\n if (stored && codes.includes(stored)) return stored\n if (configLanguage && codes.includes(configLanguage)) return configLanguage\n return codes.find((c) => c.toLowerCase().startsWith('en')) ?? codes[0] ?? 'en-US'\n}\n\nexport interface ConfigProviderProps {\n /** App config — theme overrides, initial mode, locales. Omit for the built-in defaults (light mode). */\n config?: Config\n children: ReactNode\n}\n\nexport function ConfigProvider({ config, children }: ConfigProviderProps) {\n const [mode, setModeState] = useState<ThemeMode>(() =>\n getInitialMode(config?.theme?.mode ?? 'light'),\n )\n // user-picked accents that override the configured/default `accent` — kept PER MODE; persisted\n const [accentByMode, setAccentByMode] =\n useState<Record<ThemeMode, string | null>>(getInitialAccentByMode)\n // user's header sticky/static choice — persisted; seeded from config.header.sticky (default static)\n const [headerSticky, setHeaderStickyState] = useState<boolean>(() =>\n getInitialHeaderSticky(config?.header?.sticky ?? false),\n )\n // user's chosen font family — persisted; seeded from config.theme.fontFamily (default Inter)\n const [fontFamily, setFontFamilyState] = useState<string>(() =>\n getInitialFont(config?.theme?.fontFamily ?? DEFAULT_FONT_FAMILY),\n )\n // user's chosen corner shape — persisted; seeded from config.theme.shape (default rounded)\n const [shape, setShapeState] = useState<ThemeShape>(() =>\n getInitialShape(config?.theme?.shape ?? 'rounded'),\n )\n // UI languages offered + the active one (persisted; seeded from config.i18n, default English)\n const languages = config?.i18n?.languages ?? DEFAULT_LANGUAGES\n const i18nMessages = config?.i18n?.messages\n const appMessages = config?.i18n?.appMessages\n const [language, setLanguageState] = useState<string>(() =>\n getInitialLanguage(languages, config?.i18n?.language),\n )\n const colors = config?.theme?.colors\n\n // the configured/default palette for BOTH modes, before any accent override:\n // light = library defaults then the app's light overrides; dark = that, then the library dark deltas,\n // then the app's dark overrides. (Both computed so the Settings drawer can offer a picker per mode.)\n const basePalettes = useMemo(() => {\n const light = { ...DEFAULT_LIGHT_COLORS, ...colors?.light }\n const dark = { ...light, ...DEFAULT_DARK_COLORS, ...colors?.dark }\n return { light, dark }\n }, [colors])\n // the accent per mode when there's NO override — exposed so UI needn't hardcode it\n const defaultAccentColors = useMemo(\n () => ({ light: basePalettes.light.accent, dark: basePalettes.dark.accent }),\n [basePalettes],\n )\n\n // Commit a mode's resolved theme straight to `<html>` (CSS vars + attrs + persisted mode). Called\n // **eagerly** on change (so the DOM updates the instant you toggle, NOT after React re-renders the\n // whole subtree — which is what made the switch feel ~1s late) and from the effect below (initial\n // mount / accent change / external `setMode`). Idempotent, so applying twice is harmless.\n const applyMode = useCallback(\n (nextMode: ThemeMode, accent: string | null = accentByMode[nextMode]) => {\n const base = basePalettes[nextMode]\n applyTheme(accent ? { ...base, accent } : base)\n const root = document.documentElement\n root.setAttribute('data-tz-theme', nextMode)\n root.style.setProperty('color-scheme', nextMode)\n },\n [basePalettes, accentByMode],\n )\n\n useLayoutEffect(() => {\n applyMode(mode)\n }, [applyMode, mode])\n\n // commit the app's breakpoint overrides to the shared store (before paint, so token media queries\n // resolve to the configured bounds without a flash). Serialized dep so an inline object doesn't refire.\n const breakpointsConfig = config?.theme?.breakpoints\n useLayoutEffect(() => {\n setBreakpoints(breakpointsConfig)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(breakpointsConfig ?? null)])\n\n const setMode = useCallback(\n (next: ThemeMode) => {\n applyMode(next) // eager DOM update — don't wait for the re-render/commit\n setModeState(next)\n localStorage.setItem(STORAGE_KEY, next) // persisted only on a user choice (not on every mount)\n },\n [applyMode],\n )\n\n const toggleMode = useCallback(\n () => setMode(mode === 'light' ? 'dark' : 'light'),\n [mode, setMode],\n )\n\n // set (or clear with `null`) the accent override for `target` (defaults to the current mode); persists\n const setAccentColor = useCallback(\n (color: string | null, target?: ThemeMode) => {\n const m = target ?? mode\n setAccentByMode((prev) => ({ ...prev, [m]: color }))\n if (color) localStorage.setItem(accentStorageKey(m), color)\n else localStorage.removeItem(accentStorageKey(m))\n if (m === mode) applyMode(mode, color) // eager for the active mode\n },\n [mode, applyMode],\n )\n\n // set + persist the header sticky preference (overrides config.header.sticky)\n const setHeaderSticky = useCallback((sticky: boolean) => {\n setHeaderStickyState(sticky)\n localStorage.setItem(HEADER_STICKY_KEY, sticky ? '1' : '0')\n }, [])\n\n // apply the font: load it (if not preloaded) + write the stack to --tz-font-family on <html>.\n // Eager on change + in a layout effect (mount / external change), like the mode/accent commit.\n const applyFont = useCallback((family: string) => {\n ensureFontLoaded(family)\n document.documentElement.style.setProperty('--tz-font-family', fontStack(family))\n }, [])\n useLayoutEffect(() => {\n applyFont(fontFamily)\n }, [applyFont, fontFamily])\n // set + persist the chosen font family (overrides config.theme.fontFamily)\n const setFontFamily = useCallback(\n (family: string) => {\n const next = family.trim() || DEFAULT_FONT_FAMILY\n applyFont(next) // eager — don't wait for the re-render\n setFontFamilyState(next)\n localStorage.setItem(FONT_STORAGE_KEY, next)\n },\n [applyFont],\n )\n\n // apply the corner shape: write `data-tz-shape` on <html> — theme.css zeroes the `--tz-radius-*`\n // scale under `[data-tz-shape='square']`. Eager on change + in a layout effect, like the mode commit.\n const applyShape = useCallback((next: ThemeShape) => {\n document.documentElement.setAttribute('data-tz-shape', next)\n }, [])\n useLayoutEffect(() => {\n applyShape(shape)\n }, [applyShape, shape])\n // set + persist the chosen corner shape (overrides config.theme.shape)\n const setShape = useCallback(\n (next: ThemeShape) => {\n applyShape(next) // eager — don't wait for the re-render\n setShapeState(next)\n localStorage.setItem(SHAPE_STORAGE_KEY, next)\n },\n [applyShape],\n )\n\n // the app's configured defaults — what Reset returns to (and what \"unchanged\" is measured against)\n const defaultMode = config?.theme?.mode ?? 'light'\n const defaultSticky = config?.header?.sticky ?? false\n const defaultFont = config?.theme?.fontFamily ?? DEFAULT_FONT_FAMILY\n const defaultShape = config?.theme?.shape ?? 'rounded'\n const hasCustomPreferences =\n mode !== defaultMode ||\n accentByMode.light != null ||\n accentByMode.dark != null ||\n headerSticky !== defaultSticky ||\n fontFamily !== defaultFont ||\n shape !== defaultShape\n // reset every appearance preference to the configured default + forget the saved choices (eager DOM\n // commits like the individual setters), so the configured defaults apply again on the next visit too\n const resetPreferences = useCallback(() => {\n for (const key of [\n STORAGE_KEY,\n accentStorageKey('light'),\n accentStorageKey('dark'),\n HEADER_STICKY_KEY,\n FONT_STORAGE_KEY,\n SHAPE_STORAGE_KEY,\n ]) {\n localStorage.removeItem(key)\n }\n setAccentByMode({ light: null, dark: null })\n applyMode(defaultMode, null)\n setModeState(defaultMode)\n setHeaderStickyState(defaultSticky)\n applyFont(defaultFont)\n setFontFamilyState(defaultFont)\n applyShape(defaultShape)\n setShapeState(defaultShape)\n }, [applyMode, applyFont, applyShape, defaultMode, defaultSticky, defaultFont, defaultShape])\n\n // set + persist the active UI language\n const setLanguage = useCallback((code: string) => {\n setLanguageState(code)\n localStorage.setItem(LOCALE_KEY, code)\n }, [])\n // the translator bound to the active language (rebuilt only when the language or overrides change)\n const t = useMemo<Translator>(\n () => createTranslator(language, i18nMessages),\n [language, i18nMessages],\n )\n // the app's-own-strings translator, bound to the same active language (rebuilt on language/catalog change)\n const appT = useMemo<AppTranslator>(\n () => createAppTranslator(language, appMessages),\n [language, appMessages],\n )\n\n const locales = config?.locales ?? EMPTY_LOCALES\n const translationsNamespace =\n config?.keys?.translationsNamespace ?? DEFAULT_TRANSLATIONS_NAMESPACE\n const tabQueryKey = config?.keys?.tabQueryKey ?? DEFAULT_TABS_QUERY_KEY\n const nestedTabQueryKey = config?.keys?.nestedTabQueryKey ?? DEFAULT_NESTED_TAB_QUERY_KEY\n const stepQueryKey = config?.keys?.stepQueryKey ?? DEFAULT_STEP_QUERY_KEY\n const tableQuery = config?.table?.query ?? EMPTY_TABLE_QUERY\n const headerConfig = config?.header ?? EMPTY_HEADER\n const mapsConfig = config?.maps ?? EMPTY_MAPS\n\n const value = useMemo<ThemeContextValue>(\n () => ({\n mode,\n setMode,\n toggleMode,\n accentColors: accentByMode,\n defaultAccentColors,\n setAccentColor,\n locales,\n translationsNamespace,\n tabQueryKey,\n nestedTabQueryKey,\n stepQueryKey,\n tableQuery,\n header: headerConfig,\n maps: mapsConfig,\n headerSticky,\n setHeaderSticky,\n fontFamily,\n setFontFamily,\n shape,\n setShape,\n hasCustomPreferences,\n resetPreferences,\n language,\n setLanguage,\n languages,\n t,\n appT,\n }),\n [\n mode,\n setMode,\n toggleMode,\n accentByMode,\n defaultAccentColors,\n setAccentColor,\n locales,\n translationsNamespace,\n tabQueryKey,\n nestedTabQueryKey,\n stepQueryKey,\n tableQuery,\n headerConfig,\n mapsConfig,\n headerSticky,\n setHeaderSticky,\n fontFamily,\n setFontFamily,\n shape,\n setShape,\n hasCustomPreferences,\n resetPreferences,\n language,\n setLanguage,\n languages,\n t,\n appT,\n ],\n )\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n}\n\nexport function useTheme(): ThemeContextValue {\n const value = useContext(ThemeContext)\n if (!value) {\n throw new Error('useTheme must be used within a <ConfigProvider>')\n }\n return value\n}\n\n/**\n * The content locales configured on `<ConfigProvider config={{ locales }}>`. Lenient — returns `[]`\n * outside a provider (locales are optional), so `<TranslatedFields>` can also take a `locales` prop.\n */\nexport function useLocales(): LocaleConfig[] {\n return useContext(ThemeContext)?.locales ?? EMPTY_LOCALES\n}\n\n/** Fallback English translator so a component used **without** a `<ConfigProvider>` still shows text. */\nconst DEFAULT_TRANSLATOR: Translator = createTranslator('en')\n/** Fallback app translator (no catalogs) — returns the key itself, so `useTranslations()` is safe anywhere. */\nconst DEFAULT_APP_TRANSLATOR: AppTranslator = createAppTranslator('en')\n\n/**\n * The translator for the library's built-in UI strings, bound to the active `config.i18n` language.\n * **Lenient** — outside a provider it returns an English translator, so components render standalone\n * (and in tests) with their default English labels. Use it for any built-in string:\n * `t('select.noOptions')`.\n */\nexport function useT(): Translator {\n return useContext(ThemeContext)?.t ?? DEFAULT_TRANSLATOR\n}\n\n/**\n * Translator for the **consuming app's own** strings — the catalogs passed to\n * `<ConfigProvider config={{ i18n: { appMessages } }}>` — bound to the active UI language, so the app's\n * copy switches together with the panel. Free-form string keys; per key it resolves exact code → base\n * language → English (`'en'`) → the key itself, with `{name}` interpolation:\n *\n * ```tsx\n * const t = useTranslations()\n * <PageLayout title={t('customer-transactions.title')} />\n * <p>{t('customer-transactions.count', { count: 128 })}</p>\n * ```\n *\n * **Lenient** — outside a provider (or with no `appMessages`) it echoes the key back, so it's safe\n * anywhere. Use `useT()` for the library's built-in strings; use this for your own.\n */\nexport function useTranslations(): AppTranslator {\n return useContext(ThemeContext)?.appT ?? DEFAULT_APP_TRANSLATOR\n}\n\n/**\n * The active UI language + switcher data: `{ language, setLanguage, languages }`. Lenient outside a\n * provider (English, single language, no-op setter) so it's safe to call anywhere.\n */\nexport function useLanguage(): {\n language: string\n setLanguage: (code: string) => void\n languages: LocaleConfig[]\n} {\n const ctx = useContext(ThemeContext)\n return {\n language: ctx?.language ?? 'en-US',\n setLanguage: ctx?.setLanguage ?? (() => {}),\n languages: ctx?.languages ?? DEFAULT_LANGUAGES,\n }\n}\n\n/**\n * The translations namespace configured on `<ConfigProvider config={{ keys: { translationsNamespace } }}>`,\n * resolved against the built-in default (`'translations'`). Lenient outside a provider. Use it to pass\n * the same namespace to the helpers, e.g. `buildTranslations(codes, fields, useTranslationsNamespace())`.\n */\nexport function useTranslationsNamespace(): string {\n return useContext(ThemeContext)?.translationsNamespace ?? DEFAULT_TRANSLATIONS_NAMESPACE\n}\n\n/**\n * The default top-level tabs query key configured on `<ConfigProvider config={{ keys: { tabQueryKey } }}>`,\n * resolved against the built-in default (`'tab'`). Lenient outside a provider. A top-level `<Tabs>` reads\n * it as the fallback for an omitted `queryKey`, so every tab strip URL-syncs out of the box.\n */\nexport function useTabsQueryKey(): string {\n return useContext(ThemeContext)?.tabQueryKey ?? DEFAULT_TABS_QUERY_KEY\n}\n\n/**\n * The default nested tabs query key configured on\n * `<ConfigProvider config={{ keys: { nestedTabQueryKey } }}>`, resolved against the built-in default\n * (`'nestedTab'`). Lenient outside a provider. A `<Tabs>` nested inside another tab's panel uses this\n * (instead of `tabQueryKey`) so the two strips don't collide on the same URL param.\n */\nexport function useNestedTabQueryKey(): string {\n return useContext(ThemeContext)?.nestedTabQueryKey ?? DEFAULT_NESTED_TAB_QUERY_KEY\n}\n\n/**\n * The default stepper query key configured on `<ConfigProvider config={{ keys: { stepQueryKey } }}>`,\n * resolved against the built-in default (`'step'`). Lenient outside a provider. A `<Stepper queryKey>`\n * (the bare/`true` opt-in form) reads it as the param name; a string `queryKey` overrides it.\n */\nexport function useStepQueryKey(): string {\n return useContext(ThemeContext)?.stepQueryKey ?? DEFAULT_STEP_QUERY_KEY\n}\n\n/**\n * The `<Table>` server-request query mapping configured on `<ConfigProvider config={{ table: { query } }}>`\n * (`{}` when unset / outside a provider). `<Table>` merges its own `queryMapping` prop over this, then feeds\n * the result to `buildTableQuery`, which applies the field defaults — so an unconfigured table emits the\n * default page-based `?page=…&size=…&search=…&sort=…` shape.\n */\nexport function useTableQueryConfig(): TableQueryConfig {\n return useContext(ThemeContext)?.tableQuery ?? EMPTY_TABLE_QUERY\n}\n\n/**\n * The app-wide `RootLayout` header config set on `<ConfigProvider config={{ header }}>` (`{}` when\n * unset / outside a provider). `RootLayout` merges its own `header` prop over this (the prop wins), so\n * a specific shell can override the app-wide defaults.\n */\nexport function useHeaderConfig(): HeaderConfig {\n return useContext(ThemeContext)?.header ?? EMPTY_HEADER\n}\n\n/** The app-wide Google Maps settings (`config.maps`; `{}` when unset / outside a provider). */\nexport function useMapsConfig(): MapsConfig {\n return useContext(ThemeContext)?.maps ?? EMPTY_MAPS\n}\n\n/** The active light / dark mode — lenient (`'light'` outside a provider), for components that only read it. */\nexport function useColorMode(): ThemeMode {\n return useContext(ThemeContext)?.mode ?? 'light'\n}\n"],"names":["hexToRgbTriplet","hex","h","int","contrastColor","rgbTriplet","r","g","b","n","CONTRAST_OVERRIDE","applyTheme","theme","target","name","value","triplet","ThemeContext","createContext","STORAGE_KEY","accentStorageKey","mode","HEADER_STICKY_KEY","FONT_STORAGE_KEY","SHAPE_STORAGE_KEY","LOCALE_KEY","DEFAULT_LANGUAGES","DEFAULT_FONT_FAMILY","BUNDLED_FONTS","fontStack","family","ensureFontPreconnect","api","gstatic","ensureFontLoaded","id","link","DEFAULT_TABS_QUERY_KEY","DEFAULT_NESTED_TAB_QUERY_KEY","DEFAULT_STEP_QUERY_KEY","EMPTY_LOCALES","EMPTY_TABLE_QUERY","EMPTY_HEADER","EMPTY_MAPS","DEFAULT_LIGHT_COLORS","DEFAULT_DARK_COLORS","getInitialMode","fallback","stored","getInitialAccentByMode","getInitialHeaderSticky","getInitialFont","getInitialShape","getInitialLanguage","languages","configLanguage","codes","l","c","ConfigProvider","config","children","setModeState","useState","_a","accentByMode","setAccentByMode","headerSticky","setHeaderStickyState","fontFamily","setFontFamilyState","shape","setShapeState","i18nMessages","_b","appMessages","_c","language","setLanguageState","colors","_d","basePalettes","useMemo","light","dark","defaultAccentColors","applyMode","useCallback","nextMode","accent","base","root","useLayoutEffect","breakpointsConfig","_e","setBreakpoints","setMode","next","toggleMode","setAccentColor","color","prev","setHeaderSticky","sticky","applyFont","setFontFamily","applyShape","setShape","defaultMode","_f","defaultSticky","_g","defaultFont","_h","defaultShape","_i","hasCustomPreferences","resetPreferences","key","setLanguage","code","t","createTranslator","appT","createAppTranslator","locales","translationsNamespace","_j","DEFAULT_TRANSLATIONS_NAMESPACE","tabQueryKey","_k","nestedTabQueryKey","_l","stepQueryKey","_m","tableQuery","_n","headerConfig","mapsConfig","jsx","useTheme","useContext","useLocales","DEFAULT_TRANSLATOR","DEFAULT_APP_TRANSLATOR","useT","useTranslations","useLanguage","ctx","useTranslationsNamespace","useTabsQueryKey","useNestedTabQueryKey","useStepQueryKey","useTableQueryConfig","useHeaderConfig","useMapsConfig","useColorMode"],"mappings":"8LA6BA,SAASA,GAAgBC,EAAqB,CAC5C,IAAIC,EAAID,EAAI,KAAA,EAAO,QAAQ,KAAM,EAAE,EAC/BC,EAAE,SAAW,IACfA,EAAIA,EAAE,CAAC,EAAIA,EAAE,CAAC,EAAIA,EAAE,CAAC,EAAIA,EAAE,CAAC,EAAIA,EAAE,CAAC,EAAIA,EAAE,CAAC,GAE5C,MAAMC,EAAM,SAASD,EAAG,EAAE,EAC1B,MAAO,GAAIC,GAAO,GAAM,GAAG,KAAMA,GAAO,EAAK,GAAG,KAAKA,EAAM,GAAG,EAChE,CAOA,SAASC,GAAcC,EAA4B,CACjD,KAAM,CAACC,EAAGC,EAAGC,CAAC,EAAIH,EAAW,MAAM,GAAG,EAAE,IAAKI,GAAM,OAAOA,EAAE,KAAA,CAAM,CAAC,EAEnE,OADaH,EAAI,IAAMC,EAAI,IAAMC,EAAI,KAAO,KAC9B,IAAM,UAAY,SAClC,CASA,MAAME,GAAsD,CAC1D,UAAW,mCACX,QAAS,SACX,EAEO,SAASC,GACdC,EACAC,EAAsB,SAAS,gBACzB,CACN,SAAW,CAACC,EAAMC,CAAK,IAAK,OAAO,QAAQH,CAAK,EAAG,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AAY,IAAvB4H,YAAAA,EAA0B,OAAQlG,EAC3C,CAGO,SAASiH,IAA0B,OACxC,QAAOf,EAAAA,aAAW5H,CAAY,IAAvB4H,YAAAA,EAA0B,OAAQ,OAC3C"}
|
|
@@ -2,7 +2,7 @@ import { jsx as fe } from "react/jsx-runtime";
|
|
|
2
2
|
import { useContext as o, useState as E, useMemo as _, useCallback as u, useLayoutEffect as R, createContext as Ye } from "react";
|
|
3
3
|
import { c as ze } from "./breakpoints-BbDakdqF.js";
|
|
4
4
|
import { D as ke } from "./translations-D15tFHM1.js";
|
|
5
|
-
import { a as Le, c as Ce } from "./messages-
|
|
5
|
+
import { a as Le, c as Ce } from "./messages-CMgYU5p6.js";
|
|
6
6
|
function Be(e) {
|
|
7
7
|
let s = e.trim().replace(/^#/, "");
|
|
8
8
|
s.length === 3 && (s = s[0] + s[0] + s[1] + s[1] + s[2] + s[2]);
|
|
@@ -344,4 +344,4 @@ export {
|
|
|
344
344
|
ht as p,
|
|
345
345
|
yt as u
|
|
346
346
|
};
|
|
347
|
-
//# sourceMappingURL=ConfigProvider-
|
|
347
|
+
//# sourceMappingURL=ConfigProvider-DeMASTVo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigProvider-DeMASTVo.js","sources":["../src/theme/applyTheme.ts","../src/theme/ConfigProvider.tsx"],"sourcesContent":["export interface ThemePalette {\n primary: string\n /**\n * A free theme color (near-white by default) selectable via the `color` prop — it is **no longer**\n * the component surface (elevated panels use `--tz-color-surface`).\n */\n secondary: string\n /**\n * The rear-most page background — the `<body>` fill + the shell canvas that the floating panels sit\n * on; nothing else uses it. Built-in defaults: a soft off-white in light mode, a near-black in dark mode.\n */\n background: string\n /**\n * The elevated **panel surface** — cards, sidebar, inputs/forms, dropdowns, modals (the panels that\n * float over `--tz-color-background`). Built-in defaults: white in light mode, a touch lighter than\n * the canvas in dark mode. Configurable per mode like any theme color.\n */\n surface: string\n /** The single accent color — the default tint for controls (`Button`, `IconButton`, …). */\n accent: string\n success: string\n error: string\n info: string\n warning: string\n}\n\n/** Names of the theme palette tokens (maps to `--tz-color-<name>`). */\nexport type ThemeColor = keyof ThemePalette\n\nfunction hexToRgbTriplet(hex: string): string {\n let h = hex.trim().replace(/^#/, '')\n if (h.length === 3) {\n h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2]\n }\n const int = parseInt(h, 16)\n return `${(int >> 16) & 255}, ${(int >> 8) & 255}, ${int & 255}`\n}\n\n/**\n * Picks a readable text color (near-black or white) to sit on top of a solid\n * fill — used by `contained` controls so the label stays legible on light\n * colors (e.g. a light `primary` in dark mode).\n */\nfunction contrastColor(rgbTriplet: string): string {\n const [r, g, b] = rgbTriplet.split(',').map((n) => Number(n.trim()))\n const yiq = (r * 299 + g * 587 + b * 114) / 1000\n return yiq >= 150 ? '#04202b' : '#ffffff'\n}\n\n/**\n * Per-color overrides for the `contained` label color, where the automatic\n * luminance pick isn't the desired look:\n * - `secondary`: near-white fill that blends with the page, so the label uses\n * the primary color (flips with the mode) to stay readable without a border.\n * - `warning`: keep the plain white label by design.\n */\nconst CONTRAST_OVERRIDE: Readonly<Record<string, string>> = {\n secondary: 'rgb(var(--tz-color-primary-rgb))',\n warning: '#ffffff',\n}\n\nexport function applyTheme(\n theme: Partial<ThemePalette>,\n target: HTMLElement = document.documentElement,\n): void {\n for (const [name, value] of Object.entries(theme)) {\n if (!value) continue\n const triplet = hexToRgbTriplet(value)\n target.style.setProperty(`--tz-color-${name}-rgb`, triplet)\n target.style.setProperty(\n `--tz-color-${name}-contrast`,\n CONTRAST_OVERRIDE[name] ?? contrastColor(triplet),\n )\n }\n}\n","import {\n createContext,\n useCallback,\n useContext,\n useLayoutEffect,\n useMemo,\n useState,\n type ReactNode,\n} from 'react'\nimport { applyTheme, type ThemeColor, type ThemePalette } from './applyTheme'\nimport { setBreakpoints, type Breakpoint } from './breakpoints'\nimport { DEFAULT_TRANSLATIONS_NAMESPACE } from '../helpers/translations'\nimport type { IconName } from '../icons/names'\nimport {\n createAppTranslator,\n createTranslator,\n type AppMessages,\n type AppTranslator,\n type MessageOverrides,\n type Translator,\n} from '../i18n/messages'\n\nexport type ThemeMode = 'light' | 'dark'\n/**\n * Global corner shape. `rounded` (default) leaves every radius as designed; `square` flattens every\n * library corner by zeroing the WHOLE `--tz-radius-*` scale (theme.css, under `[data-tz-shape='square']`)\n * — including the `pill` / `round` steps every decorative pill and circle uses. Purely token-driven: no\n * `!important`, no universal selector, and the consuming app's own elements are untouched. The `Loader`\n * ring and the `EmptyState` icon puck use a literal `50%` (off the scale) and stay round.\n */\nexport type ThemeShape = 'rounded' | 'square'\n\nexport interface ThemeColors {\n /** Light-mode palette. Override any subset of the theme colors — the rest use the library defaults. */\n light?: Partial<ThemePalette>\n /** Dark-mode overrides, layered on the (merged) light palette + the library's dark defaults. */\n dark?: Partial<ThemePalette>\n}\n\n/** A content locale the app supports — a tab in `<TranslatedFields>`. */\nexport interface LocaleConfig {\n /** BCP-47 locale code, e.g. `'en-US'`. Namespaces the form field names and is the tab's fallback label. */\n code: string\n /** Human-readable tab label. Falls back to `code`. */\n label?: string\n}\n\n/** Theme settings — color overrides + initial mode. Lives under `Config.theme`. */\nexport interface ThemeConfig {\n /** Theme color overrides. Omit entirely to use the library's built-in theme. */\n colors?: ThemeColors\n /** Initial color mode. */\n mode?: ThemeMode\n /**\n * Default font family — the app-wide default the user's Settings choice overrides (persisted). One of\n * the pre-imported presets (`Inter` / `Roboto` / `Lato`) or any Google Font family name. Defaults to\n * `Inter`. A non-preset family is loaded on demand at runtime.\n */\n fontFamily?: string\n /**\n * Default corner shape — the app-wide default the user's Settings choice overrides (persisted).\n * `rounded` (default) leaves every radius as designed; `square` zeroes the whole `--tz-radius-*` scale\n * (pills and circles included) — token-driven, so the app's own elements are never touched. Only the\n * `Loader` ring and the `EmptyState` icon puck (a literal `50%`) stay round.\n */\n shape?: ThemeShape\n /**\n * Override the shared responsive **breakpoint** bounds (px, max-width). Keys are fixed\n * (`xxs`/`xs`/`sm`/`md`/`lg`/`xl`/`xxl`); pass any subset — the rest keep their defaults. Drives the\n * **JS** responsive layer (`useMediaQuery` tokens, `Flex`/`Grid`/`Masonry` responsive props); note\n * component CSS `@media` rules are compiled and don't follow a runtime override. E.g.\n * `breakpoints: { md: 1200, xl: 1600 }`.\n */\n breakpoints?: Partial<Record<Breakpoint, number>>\n}\n\n/**\n * The configurable key / param **names** the library's components read — grouped under `Config.keys`\n * so they live in one place. Each is overridable; omit one to use its built-in default. Grows over\n * time (e.g. `page` / `size` for paginated tables ⇒ `?page=1&size=10`).\n */\nexport interface KeysConfig {\n /**\n * URL query param name a **top-level** `<Tabs>` syncs its active tab to (e.g. `'view'` ⇒ `?view=…`),\n * unless that strip sets its own `queryKey` (or `queryKey={null}` to opt out). Defaults to `'tab'`.\n */\n tabQueryKey?: string\n /**\n * URL query param name a **nested** `<Tabs>` (one rendered inside another tab's panel) syncs to, so it\n * doesn't collide with the outer strip's `tabQueryKey` (e.g. `?tab=…&nestedTab=…`). Auto-applied by\n * nesting depth; overridable per strip via `queryKey`. Defaults to `'nestedTab'`.\n */\n nestedTabQueryKey?: string\n /**\n * URL query param name a `<Stepper queryKey>` (the bare/`true` form) syncs its active step to\n * (**1-based**, e.g. `?step=2`); a string `queryKey` overrides it per stepper. Defaults to `'step'`.\n * (The sync itself is **opt-in** — a stepper with no `queryKey` never touches the URL.)\n */\n stepQueryKey?: string\n /**\n * Top-level namespace word for `<TranslatedFields>`' form names + the nested object — e.g.\n * `'languages'` ⇒ `languages[en-US].title`. Defaults to `'translations'`.\n */\n translationsNamespace?: string\n}\n\n/**\n * How a `<Table>` builds its **server-request** params — the query it hands the consumer (as `params` /\n * `query`) in `onChange`, so a server-mode fetch doesn't hand-map page/size/search/sort every time. This is\n * the **backend transport** layer, distinct from `keys.*QueryKey` (the browser-URL sync, always page-based\n * for shareable links). Set once in `config.table.query`, override per table via the `queryMapping` prop.\n * Every field is optional; the defaults reproduce the browser-URL shape (`?page=1&size=10&search=…&sort=-key`).\n */\nexport interface TableQueryConfig {\n /** Request param name for the page / offset. Defaults to `'page'` (e.g. `'skip'` for an offset API). */\n pageParam?: string\n /** Request param name for the page size. Defaults to `'size'` (e.g. `'limit'`). */\n sizeParam?: string\n /** Request param name for the search query (omitted when the search is empty). Defaults to `'search'` (e.g. `'q'`). */\n searchParam?: string\n /**\n * Request param name holding the sort **key**. Defaults to `'sort'` (e.g. `'sortBy'`). With\n * `sortFormat: 'field'` this single param also carries the direction (`-key` = desc); with `'separate'`\n * the direction goes to `sortOrderParam`.\n */\n sortParam?: string\n /**\n * Pagination style. `'page'` (default) emits the **1-based page number** as-is (`page=2`); `'offset'`\n * emits a **zero-based offset** `(page - 1) * size` instead (`skip=10`), for skip/offset APIs.\n */\n pagination?: 'page' | 'offset'\n /**\n * Sort encoding. `'field'` (default) is a single param with a `-` prefix for descending (`sort=-price`);\n * `'separate'` splits into two params — the key in `sortParam` + the direction in `sortOrderParam`\n * (`sortBy=price&order=desc`); `'suffix'` appends the direction value to the key in a single param\n * (`sort=priceAsc` / `sort=priceDesc` with `ascValue: 'Asc'` / `descValue: 'Desc'`).\n */\n sortFormat?: 'field' | 'separate' | 'suffix'\n /** Direction param name when `sortFormat: 'separate'`. Defaults to `'order'`. */\n sortOrderParam?: string\n /**\n * Value emitted for an ascending sort — the `sortOrderParam` value when `sortFormat: 'separate'`, or the\n * suffix appended to the key when `sortFormat: 'suffix'`. Defaults to `'asc'`.\n */\n ascValue?: string\n /**\n * Value emitted for a descending sort — the `sortOrderParam` value when `sortFormat: 'separate'`, or the\n * suffix appended to the key when `sortFormat: 'suffix'`. Defaults to `'desc'`.\n */\n descValue?: string\n /**\n * What to emit for the size param when the **\"All\"** rows-per-page choice is active. A `string`/`number`\n * sets `size=<allValue>` (e.g. `0` for APIs where `limit=0` means \"all\"); omit it (default) to drop the\n * size param entirely (many APIs treat a missing limit as unbounded).\n */\n allValue?: string | number\n /**\n * How a **`multiSelect`** filter serializes into the request query: `'repeat'` (default — `cat=a&cat=b`),\n * `'csv'` (`cat=a,b`), or `'indexed'` (`cat[0]=a&cat[1]=b`).\n */\n multiSelectFormat?: 'repeat' | 'csv' | 'indexed'\n /**\n * Suffix appended to a **range** filter's param for its lower / upper bound — e.g. `Min`/`Max` (default)\n * → `priceMin`/`priceMax`; set `'_gte'`/`'_lte'`, `'[gte]'`/`'[lte]'`, `'From'`/`'To'`, … to match your API.\n */\n rangeMinSuffix?: string\n rangeMaxSuffix?: string\n}\n\n/** `<Table>`-specific configuration. Grows over time; today just the server-request query mapping. */\nexport interface TableConfig {\n /** How `<Table>` builds its server-request params (emitted as `params` / `query` in `onChange`). */\n query?: TableQueryConfig\n}\n\n/** Signed-in user shown in the shell header avatar + its account menu (see `HeaderConfig`). */\nexport interface HeaderUser {\n /** Full name — shown as the menu's name line. */\n name?: string\n /** Email shown under the name in the account menu. */\n email?: string\n /** Avatar image URL (falls back to a user icon). */\n avatar?: string\n}\n\n/**\n * One custom item in the header account menu (rendered between the user block and **Sign out**). Give it a\n * `to` (a real router link — an `href`, middle-click / ⌘-click open a new tab), an `onClick`, or both\n * (`onClick` runs first, then the navigation). With neither, a development warning is logged.\n */\nexport interface HeaderMenuItem {\n /** Visible label. */\n label: string\n /** Leading icon (`IconName`). Optional. */\n icon?: IconName\n /** Runs on click (before any `to` navigation); the menu closes afterwards. */\n onClick?: () => void\n /** Router path the item links to (rendered as a router `Link`, so it has an `href`). */\n to?: string\n /** Path params for `to` (e.g. `{ id: '7' }` for `/users/$id`). */\n params?: Record<string, string>\n /** Search params for `to`. */\n search?: Record<string, unknown>\n /** Renders the item disabled. Optional. */\n disabled?: boolean\n /** Tint, e.g. `'error'` for a destructive item. Default: inherit. */\n color?: ThemeColor\n}\n\n/** The `header.environment` badge, spelled out — e.g. `{ label: 'QA', color: 'info' }`. */\nexport interface HeaderEnvironment {\n /** Chip text, shown as given. */\n label: string\n /** Chip tint. Defaults to `warning`. */\n color?: ThemeColor\n /** Leading icon. Defaults to `Code` (a build, not the live app); `false` hides it. */\n icon?: IconName | false\n}\n\n/**\n * An app action button in the shell header — rendered as an `IconButton` in the same style as the built-in\n * header controls (with a `Tooltip` and an optional count / dot badge), left of them. On narrow screens\n * (`xs`) the actions move into the account menu (when there is one).\n */\nexport interface HeaderAction {\n /** Icon on the button (`IconName`). */\n icon: IconName\n /** Accessible name + tooltip text (and the item label once it moves into the account menu). */\n label: string\n /** Runs on click. */\n onClick?: () => void\n /** Router path to navigate to on click (instead of / as well as `onClick`). */\n to?: string\n /** Path params for `to`. */\n params?: Record<string, string>\n /** Search params for `to`. */\n search?: Record<string, unknown>\n /** Count / text badge pinned to the button (e.g. unread notifications). A numeric `0` is hidden. */\n badge?: number | string\n /** A plain indicator dot instead of a count. */\n dot?: boolean\n /** Badge / dot tint. Defaults to `error`. */\n badgeColor?: ThemeColor\n /** Icon tint. Defaults to the header controls' tint (`accent`). */\n color?: ThemeColor\n /** Renders the button disabled. */\n disabled?: boolean\n}\n\n/**\n * `RootLayout` header configuration — the shell's top-bar controls. Set it once app-wide in\n * `config.header`, or per shell via the `RootLayout` `header` prop (the prop wins, merged over config).\n */\nexport interface HeaderConfig {\n /** Show the built-in light/dark theme toggle. Defaults to `true`. */\n theme?: boolean\n /**\n * Make the shell header **stick to the top on scroll** (fixed) instead of scrolling away (static).\n * This is the app-wide default; the user can flip it in the **Settings** drawer and their choice is\n * persisted (`localStorage['tz-header-sticky']`), overriding this. Defaults to `false` (static).\n */\n sticky?: boolean\n /** Show the browser-fullscreen toggle (auto-hides where the Fullscreen API is unavailable). Defaults to `false`. */\n fullscreen?: boolean\n /** Show the **Settings** button (opens the right-side drawer to pick the per-mode `accent`). Defaults to `true`. */\n settings?: boolean\n /** Show the nav search over the sidebar's pages (with suggestions). Defaults to `true`. */\n search?: boolean\n /**\n * Show the header **language switcher** (the `Global`-icon dropdown of `config.i18n.languages`).\n * Defaults to `true`, but it only renders when more than one UI language is configured — so pass\n * `false` to hide it even with several languages (the panel stays on its current/default language).\n */\n languages?: boolean\n /** Show the breadcrumb trail at the top of the content. Defaults to **`true`**. */\n breadcrumbs?: boolean\n /** When provided, an account `Avatar` appears; its menu has a **Sign Out** item that calls this. */\n onLogout?: () => void\n /** Signed-in user — shown in the header avatar and as a header block atop the account menu. */\n user?: HeaderUser\n /**\n * Extra items in the header account menu, rendered between the user block and **Sign out**, in order.\n * Only shown when `onLogout` is set (the menu does not exist otherwise). A `Divider` separates them\n * from **Sign out**. (When merging a `RootLayout`/`AdminRoot` `header` prop over `config.header`, the\n * prop's `menu` array **replaces** the config's — arrays don't concatenate.)\n */\n menu?: HeaderMenuItem[]\n /**\n * App action buttons, left of the built-in controls (theme / language / settings / account), in order —\n * styled like them, each with a tooltip and an optional badge. On `xs` they move into the account menu\n * (above the `menu` items) when `onLogout` is set; otherwise they stay in the header. Like `menu`, a\n * `header` prop's `actions` **replaces** the config's.\n */\n actions?: HeaderAction[]\n /**\n * Free-form header content for what `actions` can't express — a text `Button` (\"New Order\"), a `Dropdown`.\n * Rendered left of `actions`; hidden on `xs` (the header has no room there). For an environment badge use\n * `environment`, which stays visible on `xs`.\n */\n extra?: ReactNode\n /**\n * The deployment environment badge — a small chip at the start of the header controls, **shown on every\n * screen size (phones too)**, so nobody mistakes a test build for the real one. Pass the app's env value\n * straight in, the same code everywhere: `environment: import.meta.env.VITE_APP_ENV`. A string is shown with\n * its first letter capitalized (`'staging'` → \"Staging\") in the `warning` color with a `Code` icon;\n * `{ label, color, icon }` sets them.\n * **Nothing renders** when it's empty / `undefined` / `null` or `'production'` / `'prod'` (any case).\n */\n environment?: string | HeaderEnvironment | null\n}\n\n/**\n * UI-language config for the admin panel's **own** static strings (labels, placeholders, aria-labels).\n * Distinct from `locales` (which is content-translation locales for `<TranslatedFields>`). The library\n * ships built-in translations (English + Georgian), so listing `languages` here is enough to get a\n * localized panel — no per-app setup. Any language the library doesn't ship is supplied via `messages`.\n */\nexport interface I18nConfig {\n /**\n * Active UI language on first load (a locale code, e.g. `'ka-GE'`). Defaults to English if listed in\n * `languages`, else the first `languages` entry, else `'en-US'`. The user's switcher choice (persisted)\n * overrides it.\n */\n language?: string\n /**\n * The UI languages the panel offers — drives the Settings language switcher. One entry = a fixed\n * language (no switcher). Defaults to English only. (Reuses the `{ code, label }` shape.)\n */\n languages?: LocaleConfig[]\n /**\n * Extra / override message catalogs for the **library's own** strings, merged **over** the built-ins\n * and keyed by language code or base language (`'ka-GE'` or `'ka'`). Use this to localize into a\n * language the library doesn't ship, or to tweak a built-in string. Unset keys fall back to English.\n */\n messages?: MessageOverrides\n /**\n * Catalogs for the **consuming app's own** UI strings — its section titles, labels, business copy —\n * keyed by language code/base then by any string key the app picks. Read via **`useTranslations()`**,\n * which binds to the active UI language, so the app's text switches together with the panel. Resolution\n * per key: exact code → base language → English (`'en'`) → the key itself. This is the app's own copy;\n * `messages` above is only for the library's built-in strings.\n */\n appMessages?: AppMessages\n}\n\n/**\n * App-level configuration passed to `<ConfigProvider config={…}>`. Groups theming under `theme`,\n * the configurable key/param names under `keys`, and keeps the rest (`locales`, …) at the top — a\n * single place to grow.\n */\nexport interface Config {\n /** Theme settings (color overrides + initial mode). Omit entirely to use the built-in theme. */\n theme?: ThemeConfig\n /** Content locales the app supports — drive `<TranslatedFields>`' tabs (one per locale). */\n locales?: LocaleConfig[]\n /** UI-language config for the panel's own strings (the library ships the translations). See `I18nConfig`. */\n i18n?: I18nConfig\n /**\n * Configurable key / query-param names the components read — e.g. the `<Tabs>` query keys\n * (`tabQueryKey` / `nestedTabQueryKey`) and the `<TranslatedFields>` namespace\n * (`translationsNamespace`). Grows over time (`page`, `size`, …).\n */\n keys?: KeysConfig\n /** `<Table>` config — today the server-request query mapping (`table.query`) shared by every table. */\n table?: TableConfig\n /**\n * `RootLayout` header config, app-wide — the shell top-bar toggles (`theme` / `fullscreen` /\n * `search` / `breadcrumbs`) + the account (`onLogout` / `user`). A `RootLayout`\n * `header` prop is merged over this (the prop wins), so a specific shell can override.\n */\n header?: HeaderConfig\n /** Google Maps settings for `LocationPicker` (the API key etc.), app-wide. See `MapsConfig`. */\n maps?: MapsConfig\n}\n\n/**\n * Google Maps settings, app-wide — read by `LocationPicker` (its own `apiKey` / `mapId` props win). The key is the\n * app's **browser** key (restrict it by HTTP referrer in the Google Cloud console); the Maps JavaScript API is\n * loaded on demand the first time a map renders, so a panel that never shows one never loads it.\n */\nexport interface MapsConfig {\n /** The Google Maps JavaScript API key. */\n apiKey?: string\n /**\n * A Map ID (Google Cloud → Map Management). Optional — with one the pin is an `AdvancedMarkerElement` and the\n * map uses its cloud style; without it a classic marker + the library's light / dark styling are used.\n */\n mapId?: string\n}\n\ninterface ThemeContextValue {\n mode: ThemeMode\n setMode: (mode: ThemeMode) => void\n toggleMode: () => void\n /** The persisted accent-color overrides **per mode** (a hex, or `null` when using that mode's default). */\n accentColors: Record<ThemeMode, string | null>\n /** The configured/default `accent` **per mode** (before any override) — the \"no override\" values. */\n defaultAccentColors: Record<ThemeMode, string>\n /** Set (or clear with `null`) the accent override for `mode` (defaults to the current) — persists + re-applies. */\n setAccentColor: (color: string | null, mode?: ThemeMode) => void\n locales: LocaleConfig[]\n /** Resolved translations namespace (`config.keys.translationsNamespace` ?? the built-in default). */\n translationsNamespace: string\n /** Resolved top-level tabs query key (`config.keys.tabQueryKey` ?? the built-in default). */\n tabQueryKey: string\n /** Resolved nested tabs query key (`config.keys.nestedTabQueryKey` ?? the built-in default). */\n nestedTabQueryKey: string\n /** Resolved stepper query key (`config.keys.stepQueryKey` ?? the built-in default). */\n stepQueryKey: string\n /** The `<Table>` server-request query mapping (`config.table.query` ?? `{}`). Defaults applied by `buildTableQuery`. */\n tableQuery: TableQueryConfig\n /** App-wide `RootLayout` header config (`config.header` ?? `{}`); the `RootLayout` prop merges over it. */\n header: HeaderConfig\n /** App-wide Google Maps settings (`config.maps` ?? `{}`). */\n maps: MapsConfig\n /** Whether the shell header sticks to the top on scroll (fixed) vs scrolls away (static). Persisted. */\n headerSticky: boolean\n /** Set + persist the header sticky/static preference (overrides `config.header.sticky`). */\n setHeaderSticky: (sticky: boolean) => void\n /** The active font family (drives `--tz-font-family`). Persisted; seeded from `config.theme.fontFamily`. */\n fontFamily: string\n /** Set + persist the font family (a preset or any Google Font name; loaded on demand). */\n setFontFamily: (family: string) => void\n /** The active corner shape (`rounded` / `square`, drives `data-tz-shape` on `<html>`). Persisted; seeded from `config.theme.shape`. */\n shape: ThemeShape\n /** Set + persist the corner shape (overrides `config.theme.shape`). */\n setShape: (shape: ThemeShape) => void\n /**\n * `true` while any appearance preference differs from the app's configured default — the mode, either\n * mode's accent, the font, the header sticky choice or the shape. Drives the Settings drawer's Reset.\n */\n hasCustomPreferences: boolean\n /**\n * Reset every appearance preference to the app's configured default (`config.theme.mode` / `fontFamily` /\n * `shape`, `config.header.sticky`, no accent override) and forget the saved choices, so the configured\n * defaults apply again on the next visit. The UI language is not touched (it isn't an appearance setting).\n */\n resetPreferences: () => void\n /** Active UI language code (drives `t`). Persisted; seeded from `config.i18n.language` (default English). */\n language: string\n /** Set + persist the active UI language (must be one of `languages`). */\n setLanguage: (code: string) => void\n /** The UI languages the panel offers (from `config.i18n.languages`, default English only). */\n languages: LocaleConfig[]\n /** Translator for the library's built-in strings, bound to the active `language`. */\n t: Translator\n /** Translator for the **app's own** strings (`config.i18n.appMessages`), bound to the active `language`. */\n appT: AppTranslator\n}\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null)\nconst STORAGE_KEY = 'tz-theme-mode'\n/** Where the user's picked accent-color override is persisted, **per mode** (survives reloads). */\nconst accentStorageKey = (mode: ThemeMode) => `tz-accent-color-${mode}`\n/** Where the user's header sticky/static choice is persisted (survives reloads). */\nconst HEADER_STICKY_KEY = 'tz-header-sticky'\n/** Where the user's chosen font family is persisted (survives reloads). */\nconst FONT_STORAGE_KEY = 'tz-font-family'\n/** Where the user's chosen corner shape is persisted (survives reloads). */\nconst SHAPE_STORAGE_KEY = 'tz-shape'\n/** Where the user's chosen UI language is persisted (survives reloads). */\nconst LOCALE_KEY = 'tz-locale'\n/** Default UI languages when `config.i18n.languages` is unset — English only. */\nconst DEFAULT_LANGUAGES: LocaleConfig[] = [{ code: 'en-US', label: 'English' }]\n/** The default font family (matches the `--tz-font-family` token's primary family). */\nexport const DEFAULT_FONT_FAMILY = 'Inter'\n/** Families already in the shipped CSS (only the default) — these skip the runtime `<link>` load. */\nconst BUNDLED_FONTS: readonly string[] = [DEFAULT_FONT_FAMILY]\n/** The full fallback stack applied to `--tz-font-family` for a chosen family (mirrors theme.css). */\nconst fontStack = (family: string) =>\n `'${family}', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif`\n\n/** Add the Google Fonts preconnect hints once, so the on-demand font fetch isn't delayed by DNS/TLS. */\nfunction ensureFontPreconnect() {\n if (typeof document === 'undefined' || document.getElementById('tz-font-preconnect')) return\n const api = document.createElement('link')\n api.id = 'tz-font-preconnect'\n api.rel = 'preconnect'\n api.href = 'https://fonts.googleapis.com'\n document.head.appendChild(api)\n const gstatic = document.createElement('link')\n gstatic.rel = 'preconnect'\n gstatic.href = 'https://fonts.gstatic.com'\n gstatic.crossOrigin = 'anonymous'\n document.head.appendChild(gstatic)\n}\n\n/**\n * Ensure a Google Fonts stylesheet `<link>` exists for `family` (deduped by id). Only the default\n * (`Inter`) ships pre-imported, so every other family — the Roboto/Lato presets and any custom pick —\n * is loaded here on first use. Bare family request (no weight axes) so it works for any font — Google\n * serves the available weights.\n */\nfunction ensureFontLoaded(family: string) {\n if (typeof document === 'undefined' || BUNDLED_FONTS.includes(family)) return\n const id = `tz-font-${family.trim().replace(/\\s+/g, '-').toLowerCase()}`\n if (document.getElementById(id)) return\n ensureFontPreconnect()\n const link = document.createElement('link')\n link.id = id\n link.rel = 'stylesheet'\n link.href = `https://fonts.googleapis.com/css2?family=${encodeURIComponent(family.trim()).replace(/%20/g, '+')}&display=swap`\n document.head.appendChild(link)\n}\n/** The built-in default URL query param name a **top-level** `<Tabs>` syncs to (no `queryKey`/config). */\nexport const DEFAULT_TABS_QUERY_KEY = 'tab'\n/** The built-in default URL query param name a **nested** `<Tabs>` syncs to (no `queryKey`/config). */\nexport const DEFAULT_NESTED_TAB_QUERY_KEY = 'nestedTab'\n/** The built-in default URL query param name a `<Stepper>` syncs to (no `queryKey`/config). */\nexport const DEFAULT_STEP_QUERY_KEY = 'step'\n/** Stable empty-locales fallback so the context value memo doesn't churn when no locales are configured. */\nconst EMPTY_LOCALES: LocaleConfig[] = []\n/** Stable empty table-query fallback so the context memo doesn't churn when no `table.query` is configured. */\nconst EMPTY_TABLE_QUERY: TableQueryConfig = {}\n/** Stable empty header fallback so the context memo doesn't churn when no `header` is configured. */\nconst EMPTY_HEADER: HeaderConfig = {}\nconst EMPTY_MAPS: MapsConfig = {}\n\n/**\n * The library's built-in light palette — the single source of truth for every theme color's default\n * value. Apps override any subset via `config.colors.light`; the rest fall back to these. (theme.css\n * holds only the structure that references these values, not the values themselves.)\n */\nconst DEFAULT_LIGHT_COLORS: ThemePalette = {\n primary: '#13404e',\n secondary: '#ffffff',\n background: '#f9f9f9', // the rear + shell canvas — a soft off-white behind the white panels\n surface: '#ffffff', // the elevated panels (cards, sidebar, inputs, dropdowns, modals)\n accent: '#056472',\n success: '#00a854',\n error: '#f04134',\n info: '#039aa1',\n warning: '#ffbf00',\n}\n\n/**\n * Built-in dark-mode overrides — only the colors that differ from light; everything else inherits the\n * (merged) light palette. Apps override any of these via `config.colors.dark`.\n */\nconst DEFAULT_DARK_COLORS: Partial<ThemePalette> = {\n primary: '#e6e8eb',\n secondary: '#191919',\n background: '#0f0f0f', // the near-black rear + canvas\n surface: '#191919', // a touch lighter than the canvas, for the elevated panels\n accent: '#16a6b4', // a brighter teal — the light-mode accent is too dark on the dark canvas\n success: '#00a854',\n error: '#f04134',\n info: '#039aa1',\n warning: '#ffbf00',\n}\n\nfunction getInitialMode(fallback: ThemeMode): ThemeMode {\n const stored = localStorage.getItem(STORAGE_KEY)\n return stored === 'light' || stored === 'dark' ? stored : fallback\n}\n\n/** The persisted per-mode accent-color overrides (a hex string per mode, or `null` when none picked). */\nfunction getInitialAccentByMode(): Record<ThemeMode, string | null> {\n return {\n light: localStorage.getItem(accentStorageKey('light')) || null,\n dark: localStorage.getItem(accentStorageKey('dark')) || null,\n }\n}\n\n/** The persisted header sticky choice (`fallback` = the app's `config.header.sticky` when unset). */\nfunction getInitialHeaderSticky(fallback: boolean): boolean {\n const stored = localStorage.getItem(HEADER_STICKY_KEY)\n return stored === '1' ? true : stored === '0' ? false : fallback\n}\n\n/** The persisted font family (`fallback` = `config.theme.fontFamily` ?? the default when unset). */\nfunction getInitialFont(fallback: string): string {\n return localStorage.getItem(FONT_STORAGE_KEY) || fallback\n}\n\n/** The persisted corner shape (`fallback` = `config.theme.shape` ?? `rounded` when unset / invalid). */\nfunction getInitialShape(fallback: ThemeShape): ThemeShape {\n const stored = localStorage.getItem(SHAPE_STORAGE_KEY)\n return stored === 'rounded' || stored === 'square' ? stored : fallback\n}\n\n/**\n * The initial UI language: the persisted choice (if still offered), else `config.i18n.language`, else\n * English if it's among the offered languages, else the first offered, else `'en-US'`. Always clamped\n * to a code that's actually in `languages`.\n */\nfunction getInitialLanguage(languages: LocaleConfig[], configLanguage?: string): string {\n const codes = languages.map((l) => l.code)\n const stored = localStorage.getItem(LOCALE_KEY)\n if (stored && codes.includes(stored)) return stored\n if (configLanguage && codes.includes(configLanguage)) return configLanguage\n return codes.find((c) => c.toLowerCase().startsWith('en')) ?? codes[0] ?? 'en-US'\n}\n\nexport interface ConfigProviderProps {\n /** App config — theme overrides, initial mode, locales. Omit for the built-in defaults (light mode). */\n config?: Config\n children: ReactNode\n}\n\nexport function ConfigProvider({ config, children }: ConfigProviderProps) {\n const [mode, setModeState] = useState<ThemeMode>(() =>\n getInitialMode(config?.theme?.mode ?? 'light'),\n )\n // user-picked accents that override the configured/default `accent` — kept PER MODE; persisted\n const [accentByMode, setAccentByMode] =\n useState<Record<ThemeMode, string | null>>(getInitialAccentByMode)\n // user's header sticky/static choice — persisted; seeded from config.header.sticky (default static)\n const [headerSticky, setHeaderStickyState] = useState<boolean>(() =>\n getInitialHeaderSticky(config?.header?.sticky ?? false),\n )\n // user's chosen font family — persisted; seeded from config.theme.fontFamily (default Inter)\n const [fontFamily, setFontFamilyState] = useState<string>(() =>\n getInitialFont(config?.theme?.fontFamily ?? DEFAULT_FONT_FAMILY),\n )\n // user's chosen corner shape — persisted; seeded from config.theme.shape (default rounded)\n const [shape, setShapeState] = useState<ThemeShape>(() =>\n getInitialShape(config?.theme?.shape ?? 'rounded'),\n )\n // UI languages offered + the active one (persisted; seeded from config.i18n, default English)\n const languages = config?.i18n?.languages ?? DEFAULT_LANGUAGES\n const i18nMessages = config?.i18n?.messages\n const appMessages = config?.i18n?.appMessages\n const [language, setLanguageState] = useState<string>(() =>\n getInitialLanguage(languages, config?.i18n?.language),\n )\n const colors = config?.theme?.colors\n\n // the configured/default palette for BOTH modes, before any accent override:\n // light = library defaults then the app's light overrides; dark = that, then the library dark deltas,\n // then the app's dark overrides. (Both computed so the Settings drawer can offer a picker per mode.)\n const basePalettes = useMemo(() => {\n const light = { ...DEFAULT_LIGHT_COLORS, ...colors?.light }\n const dark = { ...light, ...DEFAULT_DARK_COLORS, ...colors?.dark }\n return { light, dark }\n }, [colors])\n // the accent per mode when there's NO override — exposed so UI needn't hardcode it\n const defaultAccentColors = useMemo(\n () => ({ light: basePalettes.light.accent, dark: basePalettes.dark.accent }),\n [basePalettes],\n )\n\n // Commit a mode's resolved theme straight to `<html>` (CSS vars + attrs + persisted mode). Called\n // **eagerly** on change (so the DOM updates the instant you toggle, NOT after React re-renders the\n // whole subtree — which is what made the switch feel ~1s late) and from the effect below (initial\n // mount / accent change / external `setMode`). Idempotent, so applying twice is harmless.\n const applyMode = useCallback(\n (nextMode: ThemeMode, accent: string | null = accentByMode[nextMode]) => {\n const base = basePalettes[nextMode]\n applyTheme(accent ? { ...base, accent } : base)\n const root = document.documentElement\n root.setAttribute('data-tz-theme', nextMode)\n root.style.setProperty('color-scheme', nextMode)\n },\n [basePalettes, accentByMode],\n )\n\n useLayoutEffect(() => {\n applyMode(mode)\n }, [applyMode, mode])\n\n // commit the app's breakpoint overrides to the shared store (before paint, so token media queries\n // resolve to the configured bounds without a flash). Serialized dep so an inline object doesn't refire.\n const breakpointsConfig = config?.theme?.breakpoints\n useLayoutEffect(() => {\n setBreakpoints(breakpointsConfig)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(breakpointsConfig ?? null)])\n\n const setMode = useCallback(\n (next: ThemeMode) => {\n applyMode(next) // eager DOM update — don't wait for the re-render/commit\n setModeState(next)\n localStorage.setItem(STORAGE_KEY, next) // persisted only on a user choice (not on every mount)\n },\n [applyMode],\n )\n\n const toggleMode = useCallback(\n () => setMode(mode === 'light' ? 'dark' : 'light'),\n [mode, setMode],\n )\n\n // set (or clear with `null`) the accent override for `target` (defaults to the current mode); persists\n const setAccentColor = useCallback(\n (color: string | null, target?: ThemeMode) => {\n const m = target ?? mode\n setAccentByMode((prev) => ({ ...prev, [m]: color }))\n if (color) localStorage.setItem(accentStorageKey(m), color)\n else localStorage.removeItem(accentStorageKey(m))\n if (m === mode) applyMode(mode, color) // eager for the active mode\n },\n [mode, applyMode],\n )\n\n // set + persist the header sticky preference (overrides config.header.sticky)\n const setHeaderSticky = useCallback((sticky: boolean) => {\n setHeaderStickyState(sticky)\n localStorage.setItem(HEADER_STICKY_KEY, sticky ? '1' : '0')\n }, [])\n\n // apply the font: load it (if not preloaded) + write the stack to --tz-font-family on <html>.\n // Eager on change + in a layout effect (mount / external change), like the mode/accent commit.\n const applyFont = useCallback((family: string) => {\n ensureFontLoaded(family)\n document.documentElement.style.setProperty('--tz-font-family', fontStack(family))\n }, [])\n useLayoutEffect(() => {\n applyFont(fontFamily)\n }, [applyFont, fontFamily])\n // set + persist the chosen font family (overrides config.theme.fontFamily)\n const setFontFamily = useCallback(\n (family: string) => {\n const next = family.trim() || DEFAULT_FONT_FAMILY\n applyFont(next) // eager — don't wait for the re-render\n setFontFamilyState(next)\n localStorage.setItem(FONT_STORAGE_KEY, next)\n },\n [applyFont],\n )\n\n // apply the corner shape: write `data-tz-shape` on <html> — theme.css zeroes the `--tz-radius-*`\n // scale under `[data-tz-shape='square']`. Eager on change + in a layout effect, like the mode commit.\n const applyShape = useCallback((next: ThemeShape) => {\n document.documentElement.setAttribute('data-tz-shape', next)\n }, [])\n useLayoutEffect(() => {\n applyShape(shape)\n }, [applyShape, shape])\n // set + persist the chosen corner shape (overrides config.theme.shape)\n const setShape = useCallback(\n (next: ThemeShape) => {\n applyShape(next) // eager — don't wait for the re-render\n setShapeState(next)\n localStorage.setItem(SHAPE_STORAGE_KEY, next)\n },\n [applyShape],\n )\n\n // the app's configured defaults — what Reset returns to (and what \"unchanged\" is measured against)\n const defaultMode = config?.theme?.mode ?? 'light'\n const defaultSticky = config?.header?.sticky ?? false\n const defaultFont = config?.theme?.fontFamily ?? DEFAULT_FONT_FAMILY\n const defaultShape = config?.theme?.shape ?? 'rounded'\n const hasCustomPreferences =\n mode !== defaultMode ||\n accentByMode.light != null ||\n accentByMode.dark != null ||\n headerSticky !== defaultSticky ||\n fontFamily !== defaultFont ||\n shape !== defaultShape\n // reset every appearance preference to the configured default + forget the saved choices (eager DOM\n // commits like the individual setters), so the configured defaults apply again on the next visit too\n const resetPreferences = useCallback(() => {\n for (const key of [\n STORAGE_KEY,\n accentStorageKey('light'),\n accentStorageKey('dark'),\n HEADER_STICKY_KEY,\n FONT_STORAGE_KEY,\n SHAPE_STORAGE_KEY,\n ]) {\n localStorage.removeItem(key)\n }\n setAccentByMode({ light: null, dark: null })\n applyMode(defaultMode, null)\n setModeState(defaultMode)\n setHeaderStickyState(defaultSticky)\n applyFont(defaultFont)\n setFontFamilyState(defaultFont)\n applyShape(defaultShape)\n setShapeState(defaultShape)\n }, [applyMode, applyFont, applyShape, defaultMode, defaultSticky, defaultFont, defaultShape])\n\n // set + persist the active UI language\n const setLanguage = useCallback((code: string) => {\n setLanguageState(code)\n localStorage.setItem(LOCALE_KEY, code)\n }, [])\n // the translator bound to the active language (rebuilt only when the language or overrides change)\n const t = useMemo<Translator>(\n () => createTranslator(language, i18nMessages),\n [language, i18nMessages],\n )\n // the app's-own-strings translator, bound to the same active language (rebuilt on language/catalog change)\n const appT = useMemo<AppTranslator>(\n () => createAppTranslator(language, appMessages),\n [language, appMessages],\n )\n\n const locales = config?.locales ?? EMPTY_LOCALES\n const translationsNamespace =\n config?.keys?.translationsNamespace ?? DEFAULT_TRANSLATIONS_NAMESPACE\n const tabQueryKey = config?.keys?.tabQueryKey ?? DEFAULT_TABS_QUERY_KEY\n const nestedTabQueryKey = config?.keys?.nestedTabQueryKey ?? DEFAULT_NESTED_TAB_QUERY_KEY\n const stepQueryKey = config?.keys?.stepQueryKey ?? DEFAULT_STEP_QUERY_KEY\n const tableQuery = config?.table?.query ?? EMPTY_TABLE_QUERY\n const headerConfig = config?.header ?? EMPTY_HEADER\n const mapsConfig = config?.maps ?? EMPTY_MAPS\n\n const value = useMemo<ThemeContextValue>(\n () => ({\n mode,\n setMode,\n toggleMode,\n accentColors: accentByMode,\n defaultAccentColors,\n setAccentColor,\n locales,\n translationsNamespace,\n tabQueryKey,\n nestedTabQueryKey,\n stepQueryKey,\n tableQuery,\n header: headerConfig,\n maps: mapsConfig,\n headerSticky,\n setHeaderSticky,\n fontFamily,\n setFontFamily,\n shape,\n setShape,\n hasCustomPreferences,\n resetPreferences,\n language,\n setLanguage,\n languages,\n t,\n appT,\n }),\n [\n mode,\n setMode,\n toggleMode,\n accentByMode,\n defaultAccentColors,\n setAccentColor,\n locales,\n translationsNamespace,\n tabQueryKey,\n nestedTabQueryKey,\n stepQueryKey,\n tableQuery,\n headerConfig,\n mapsConfig,\n headerSticky,\n setHeaderSticky,\n fontFamily,\n setFontFamily,\n shape,\n setShape,\n hasCustomPreferences,\n resetPreferences,\n language,\n setLanguage,\n languages,\n t,\n appT,\n ],\n )\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n}\n\nexport function useTheme(): ThemeContextValue {\n const value = useContext(ThemeContext)\n if (!value) {\n throw new Error('useTheme must be used within a <ConfigProvider>')\n }\n return value\n}\n\n/**\n * The content locales configured on `<ConfigProvider config={{ locales }}>`. Lenient — returns `[]`\n * outside a provider (locales are optional), so `<TranslatedFields>` can also take a `locales` prop.\n */\nexport function useLocales(): LocaleConfig[] {\n return useContext(ThemeContext)?.locales ?? EMPTY_LOCALES\n}\n\n/** Fallback English translator so a component used **without** a `<ConfigProvider>` still shows text. */\nconst DEFAULT_TRANSLATOR: Translator = createTranslator('en')\n/** Fallback app translator (no catalogs) — returns the key itself, so `useTranslations()` is safe anywhere. */\nconst DEFAULT_APP_TRANSLATOR: AppTranslator = createAppTranslator('en')\n\n/**\n * The translator for the library's built-in UI strings, bound to the active `config.i18n` language.\n * **Lenient** — outside a provider it returns an English translator, so components render standalone\n * (and in tests) with their default English labels. Use it for any built-in string:\n * `t('select.noOptions')`.\n */\nexport function useT(): Translator {\n return useContext(ThemeContext)?.t ?? DEFAULT_TRANSLATOR\n}\n\n/**\n * Translator for the **consuming app's own** strings — the catalogs passed to\n * `<ConfigProvider config={{ i18n: { appMessages } }}>` — bound to the active UI language, so the app's\n * copy switches together with the panel. Free-form string keys; per key it resolves exact code → base\n * language → English (`'en'`) → the key itself, with `{name}` interpolation:\n *\n * ```tsx\n * const t = useTranslations()\n * <PageLayout title={t('customer-transactions.title')} />\n * <p>{t('customer-transactions.count', { count: 128 })}</p>\n * ```\n *\n * **Lenient** — outside a provider (or with no `appMessages`) it echoes the key back, so it's safe\n * anywhere. Use `useT()` for the library's built-in strings; use this for your own.\n */\nexport function useTranslations(): AppTranslator {\n return useContext(ThemeContext)?.appT ?? DEFAULT_APP_TRANSLATOR\n}\n\n/**\n * The active UI language + switcher data: `{ language, setLanguage, languages }`. Lenient outside a\n * provider (English, single language, no-op setter) so it's safe to call anywhere.\n */\nexport function useLanguage(): {\n language: string\n setLanguage: (code: string) => void\n languages: LocaleConfig[]\n} {\n const ctx = useContext(ThemeContext)\n return {\n language: ctx?.language ?? 'en-US',\n setLanguage: ctx?.setLanguage ?? (() => {}),\n languages: ctx?.languages ?? DEFAULT_LANGUAGES,\n }\n}\n\n/**\n * The translations namespace configured on `<ConfigProvider config={{ keys: { translationsNamespace } }}>`,\n * resolved against the built-in default (`'translations'`). Lenient outside a provider. Use it to pass\n * the same namespace to the helpers, e.g. `buildTranslations(codes, fields, useTranslationsNamespace())`.\n */\nexport function useTranslationsNamespace(): string {\n return useContext(ThemeContext)?.translationsNamespace ?? DEFAULT_TRANSLATIONS_NAMESPACE\n}\n\n/**\n * The default top-level tabs query key configured on `<ConfigProvider config={{ keys: { tabQueryKey } }}>`,\n * resolved against the built-in default (`'tab'`). Lenient outside a provider. A top-level `<Tabs>` reads\n * it as the fallback for an omitted `queryKey`, so every tab strip URL-syncs out of the box.\n */\nexport function useTabsQueryKey(): string {\n return useContext(ThemeContext)?.tabQueryKey ?? DEFAULT_TABS_QUERY_KEY\n}\n\n/**\n * The default nested tabs query key configured on\n * `<ConfigProvider config={{ keys: { nestedTabQueryKey } }}>`, resolved against the built-in default\n * (`'nestedTab'`). Lenient outside a provider. A `<Tabs>` nested inside another tab's panel uses this\n * (instead of `tabQueryKey`) so the two strips don't collide on the same URL param.\n */\nexport function useNestedTabQueryKey(): string {\n return useContext(ThemeContext)?.nestedTabQueryKey ?? DEFAULT_NESTED_TAB_QUERY_KEY\n}\n\n/**\n * The default stepper query key configured on `<ConfigProvider config={{ keys: { stepQueryKey } }}>`,\n * resolved against the built-in default (`'step'`). Lenient outside a provider. A `<Stepper queryKey>`\n * (the bare/`true` opt-in form) reads it as the param name; a string `queryKey` overrides it.\n */\nexport function useStepQueryKey(): string {\n return useContext(ThemeContext)?.stepQueryKey ?? DEFAULT_STEP_QUERY_KEY\n}\n\n/**\n * The `<Table>` server-request query mapping configured on `<ConfigProvider config={{ table: { query } }}>`\n * (`{}` when unset / outside a provider). `<Table>` merges its own `queryMapping` prop over this, then feeds\n * the result to `buildTableQuery`, which applies the field defaults — so an unconfigured table emits the\n * default page-based `?page=…&size=…&search=…&sort=…` shape.\n */\nexport function useTableQueryConfig(): TableQueryConfig {\n return useContext(ThemeContext)?.tableQuery ?? EMPTY_TABLE_QUERY\n}\n\n/**\n * The app-wide `RootLayout` header config set on `<ConfigProvider config={{ header }}>` (`{}` when\n * unset / outside a provider). `RootLayout` merges its own `header` prop over this (the prop wins), so\n * a specific shell can override the app-wide defaults.\n */\nexport function useHeaderConfig(): HeaderConfig {\n return useContext(ThemeContext)?.header ?? EMPTY_HEADER\n}\n\n/** The app-wide Google Maps settings (`config.maps`; `{}` when unset / outside a provider). */\nexport function useMapsConfig(): MapsConfig {\n return useContext(ThemeContext)?.maps ?? EMPTY_MAPS\n}\n\n/** The active light / dark mode — lenient (`'light'` outside a provider), for components that only read it. */\nexport function useColorMode(): ThemeMode {\n return useContext(ThemeContext)?.mode ?? 'light'\n}\n"],"names":["hexToRgbTriplet","hex","h","int","contrastColor","rgbTriplet","r","g","b","n","CONTRAST_OVERRIDE","applyTheme","theme","target","name","value","triplet","ThemeContext","createContext","STORAGE_KEY","accentStorageKey","mode","HEADER_STICKY_KEY","FONT_STORAGE_KEY","SHAPE_STORAGE_KEY","LOCALE_KEY","DEFAULT_LANGUAGES","DEFAULT_FONT_FAMILY","BUNDLED_FONTS","fontStack","family","ensureFontPreconnect","api","gstatic","ensureFontLoaded","id","link","DEFAULT_TABS_QUERY_KEY","DEFAULT_NESTED_TAB_QUERY_KEY","DEFAULT_STEP_QUERY_KEY","EMPTY_LOCALES","EMPTY_TABLE_QUERY","EMPTY_HEADER","EMPTY_MAPS","DEFAULT_LIGHT_COLORS","DEFAULT_DARK_COLORS","getInitialMode","fallback","stored","getInitialAccentByMode","getInitialHeaderSticky","getInitialFont","getInitialShape","getInitialLanguage","languages","configLanguage","codes","l","c","ConfigProvider","config","children","setModeState","useState","_a","accentByMode","setAccentByMode","headerSticky","setHeaderStickyState","fontFamily","setFontFamilyState","shape","setShapeState","i18nMessages","_b","appMessages","_c","language","setLanguageState","colors","_d","basePalettes","useMemo","light","dark","defaultAccentColors","applyMode","useCallback","nextMode","accent","base","root","useLayoutEffect","breakpointsConfig","_e","setBreakpoints","setMode","next","toggleMode","setAccentColor","color","m","prev","setHeaderSticky","sticky","applyFont","setFontFamily","applyShape","setShape","defaultMode","_f","defaultSticky","_g","defaultFont","_h","defaultShape","_i","hasCustomPreferences","resetPreferences","key","setLanguage","code","t","createTranslator","appT","createAppTranslator","locales","translationsNamespace","_j","DEFAULT_TRANSLATIONS_NAMESPACE","tabQueryKey","_k","nestedTabQueryKey","_l","stepQueryKey","_m","tableQuery","_n","headerConfig","mapsConfig","jsx","useTheme","useContext","useLocales","DEFAULT_TRANSLATOR","DEFAULT_APP_TRANSLATOR","useT","useTranslations","useLanguage","ctx","useTranslationsNamespace","useTabsQueryKey","useNestedTabQueryKey","useStepQueryKey","useTableQueryConfig","useHeaderConfig","useMapsConfig","useColorMode"],"mappings":";;;;;AA6BA,SAASA,GAAgBC,GAAqB;AAC5C,MAAIC,IAAID,EAAI,KAAA,EAAO,QAAQ,MAAM,EAAE;AACnC,EAAIC,EAAE,WAAW,MACfA,IAAIA,EAAE,CAAC,IAAIA,EAAE,CAAC,IAAIA,EAAE,CAAC,IAAIA,EAAE,CAAC,IAAIA,EAAE,CAAC,IAAIA,EAAE,CAAC;AAE5C,QAAMC,IAAM,SAASD,GAAG,EAAE;AAC1B,SAAO,GAAIC,KAAO,KAAM,GAAG,KAAMA,KAAO,IAAK,GAAG,KAAKA,IAAM,GAAG;AAChE;AAOA,SAASC,GAAcC,GAA4B;AACjD,QAAM,CAACC,GAAGC,GAAGC,CAAC,IAAIH,EAAW,MAAM,GAAG,EAAE,IAAI,CAACI,MAAM,OAAOA,EAAE,KAAA,CAAM,CAAC;AAEnE,UADaH,IAAI,MAAMC,IAAI,MAAMC,IAAI,OAAO,OAC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AQrB;AAC3C;AAGO,SAASkH,KAA0B;;AACxC,WAAO7F,IAAA8E,EAAW7H,CAAY,MAAvB,gBAAA+C,EAA0B,SAAQ;AAC3C;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const o=require("react/jsx-runtime"),y=require("react"),T=require("./useClipboard-BjTIX-4g.cjs"),C=require("./IconButton-
|
|
2
|
-
//# sourceMappingURL=CopyButton-
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),y=require("react"),T=require("./useClipboard-BjTIX-4g.cjs"),C=require("./IconButton-CQ25TtBc.cjs"),R=require("./Icon-BUP5_kRs.cjs"),g=require("./Tooltip-Bw-1Xk2Z.cjs"),v=require("./ConfigProvider-B_Bb6pk1.cjs"),w=y.forwardRef(function({value:r,icon:u="Copy",copiedIcon:d="CopySuccess",copyLabel:a,copiedLabel:p,timeout:l=1600,tooltip:b=!0,variant:q="text",size:f="sm",onCopy:t,onClick:e,...x},B){const c=v.useT(),{copy:h,copied:n}=T.useClipboard({timeout:l}),s=n?p??c("clipboard.copied"):a??c("clipboard.copy"),j=I=>{e==null||e(I),h(r).then(m=>{m&&(t==null||t(r))})},i=o.jsx(C.IconButton,{ref:B,variant:q,size:f,"aria-label":s,onClick:j,...x,children:o.jsx(R.Icon,{name:n?d:u})});return b?o.jsx(g.Tooltip,{content:s,children:i}):i});exports.CopyButton=w;
|
|
2
|
+
//# sourceMappingURL=CopyButton-DZ3pdgfJ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyButton-
|
|
1
|
+
{"version":3,"file":"CopyButton-DZ3pdgfJ.cjs","sources":["../src/components/CopyButton/CopyButton.tsx"],"sourcesContent":["import { forwardRef, type MouseEvent } from 'react'\nimport { useT } from '../../theme'\nimport { useClipboard } from '../../hooks/useClipboard'\nimport { IconButton, type IconButtonProps } from '../IconButton'\nimport { Icon } from '../Icon'\nimport { Tooltip } from '../Tooltip'\nimport type { IconName } from '../../icons/names'\n\nexport interface CopyButtonProps extends Omit<\n IconButtonProps,\n 'children' | 'aria-label' | 'onCopy'\n> {\n /** The text copied to the clipboard on click. */\n value: string\n /** Idle icon. Defaults to `'Copy'`. */\n icon?: IconName\n /** Icon shown briefly after a successful copy. Defaults to `'CopySuccess'`. */\n copiedIcon?: IconName\n /** Tooltip + accessible label while idle. Defaults to the localized `clipboard.copy` (`\"Copy\"`). */\n copyLabel?: string\n /** Tooltip + accessible label right after copying. Defaults to the localized `clipboard.copied` (`\"Copied!\"`). */\n copiedLabel?: string\n /** How long (ms) the copied state shows before reverting. Defaults to `1600`. */\n timeout?: number\n /** Show the hover/focus tooltip. Defaults to `true`. */\n tooltip?: boolean\n /** Called with `value` after a successful copy. */\n onCopy?: (value: string) => void\n}\n\n/**\n * A ready-made **click-to-copy** button — copies `value` to the clipboard and flips its icon to a tick\n * (+ a tooltip that reads \"Copied!\") for a moment, then reverts. Wraps `IconButton` (defaults to the\n * quiet `text` variant) with a `Tooltip`; labels come from the built-in i18n (`clipboard.copy` /\n * `clipboard.copied`), so they localize with the panel. For a labeled button or a custom trigger, use\n * the `useClipboard` hook instead. Built on `navigator.clipboard` (no-ops where unavailable).\n *\n * @example\n * <CopyButton value={apiKey} />\n * <CopyButton value={url} copyLabel=\"Copy link\" size=\"sm\" />\n */\nexport const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(function CopyButton(\n {\n value,\n icon = 'Copy',\n copiedIcon = 'CopySuccess',\n copyLabel,\n copiedLabel,\n timeout = 1600,\n tooltip = true,\n variant = 'text',\n size = 'sm',\n onCopy,\n onClick,\n ...props\n },\n ref,\n) {\n const t = useT()\n const { copy, copied } = useClipboard({ timeout })\n const label = copied ? (copiedLabel ?? t('clipboard.copied')) : (copyLabel ?? t('clipboard.copy'))\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event)\n void copy(value).then((ok) => {\n if (ok) onCopy?.(value)\n })\n }\n\n const button = (\n <IconButton\n ref={ref}\n variant={variant}\n size={size}\n aria-label={label}\n onClick={handleClick}\n {...props}\n >\n <Icon name={copied ? copiedIcon : icon} />\n </IconButton>\n )\n\n return tooltip ? <Tooltip content={label}>{button}</Tooltip> : button\n})\n"],"names":["CopyButton","forwardRef","value","icon","copiedIcon","copyLabel","copiedLabel","timeout","tooltip","variant","size","onCopy","onClick","props","ref","t","useT","copy","copied","useClipboard","label","handleClick","event","ok","button","jsx","IconButton","Icon","Tooltip"],"mappings":"qQAyCaA,EAAaC,EAAAA,WAA+C,SACvE,CACE,MAAAC,EACA,KAAAC,EAAO,OACP,WAAAC,EAAa,cACb,UAAAC,EACA,YAAAC,EACA,QAAAC,EAAU,KACV,QAAAC,EAAU,GACV,QAAAC,EAAU,OACV,KAAAC,EAAO,KACP,OAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAIC,EAAAA,KAAA,EACJ,CAAE,KAAAC,EAAM,OAAAC,CAAA,EAAWC,EAAAA,aAAa,CAAE,QAAAZ,EAAS,EAC3Ca,EAAQF,EAAUZ,GAAeS,EAAE,kBAAkB,EAAMV,GAAaU,EAAE,gBAAgB,EAE1FM,EAAeC,GAAyC,CAC5DV,GAAA,MAAAA,EAAUU,GACLL,EAAKf,CAAK,EAAE,KAAMqB,GAAO,CACxBA,eAAarB,GACnB,CAAC,CACH,EAEMsB,EACJC,EAAAA,IAACC,EAAAA,WAAA,CACC,IAAAZ,EACA,QAAAL,EACA,KAAAC,EACA,aAAYU,EACZ,QAASC,EACR,GAAGR,EAEJ,SAAAY,EAAAA,IAACE,OAAA,CAAK,KAAMT,EAASd,EAAaD,CAAA,CAAM,CAAA,CAAA,EAI5C,OAAOK,EAAUiB,MAACG,EAAAA,QAAA,CAAQ,QAASR,EAAQ,WAAO,EAAaI,CACjE,CAAC"}
|