@womp/kookie-ui 0.3.25 → 0.4.0
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/AUTHORS +27 -0
- package/LICENSE +29 -0
- package/README.md +21 -1
- package/components.css +163 -118
- package/dist/cjs/components/_internal/base-button.d.ts.map +1 -1
- package/dist/cjs/components/_internal/base-button.js +1 -1
- package/dist/cjs/components/_internal/base-button.js.map +4 -4
- package/dist/cjs/components/_internal/dropdown-menu-drill-down.js +1 -1
- package/dist/cjs/components/_internal/dropdown-menu-drill-down.js.map +3 -3
- package/dist/cjs/components/_internal/shell-bottom.js +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js.map +4 -4
- package/dist/cjs/components/_internal/shell-handles.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-handles.js +1 -1
- package/dist/cjs/components/_internal/shell-handles.js.map +3 -3
- package/dist/cjs/components/_internal/shell-inspector.js +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js.map +4 -4
- package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js.map +4 -4
- package/dist/cjs/components/accordion.d.ts.map +1 -1
- package/dist/cjs/components/accordion.js +1 -1
- package/dist/cjs/components/accordion.js.map +4 -4
- package/dist/cjs/components/alert-dialog.d.ts.map +1 -1
- package/dist/cjs/components/alert-dialog.js +1 -1
- package/dist/cjs/components/alert-dialog.js.map +4 -4
- package/dist/cjs/components/avatar.js +1 -1
- package/dist/cjs/components/avatar.js.map +4 -4
- package/dist/cjs/components/badge.d.ts.map +1 -1
- package/dist/cjs/components/badge.js +1 -1
- package/dist/cjs/components/badge.js.map +4 -4
- package/dist/cjs/components/blockquote.js +1 -1
- package/dist/cjs/components/blockquote.js.map +4 -4
- package/dist/cjs/components/box.js +1 -1
- package/dist/cjs/components/box.js.map +4 -4
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +4 -4
- package/dist/cjs/components/callout.js +1 -1
- package/dist/cjs/components/callout.js.map +4 -4
- package/dist/cjs/components/card.js +1 -1
- package/dist/cjs/components/card.js.map +4 -4
- package/dist/cjs/components/chatbar.js +2 -2
- package/dist/cjs/components/chatbar.js.map +4 -4
- package/dist/cjs/components/checkbox-cards.js +1 -1
- package/dist/cjs/components/checkbox-cards.js.map +4 -4
- package/dist/cjs/components/checkbox-group.js +1 -1
- package/dist/cjs/components/checkbox-group.js.map +4 -4
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +4 -4
- package/dist/cjs/components/code.js +1 -1
- package/dist/cjs/components/code.js.map +4 -4
- package/dist/cjs/components/combobox.js +1 -1
- package/dist/cjs/components/combobox.js.map +4 -4
- package/dist/cjs/components/container.js +1 -1
- package/dist/cjs/components/container.js.map +4 -4
- package/dist/cjs/components/context-menu.d.ts.map +1 -1
- package/dist/cjs/components/context-menu.js +1 -1
- package/dist/cjs/components/context-menu.js.map +4 -4
- package/dist/cjs/components/data-list.js +1 -1
- package/dist/cjs/components/data-list.js.map +4 -4
- package/dist/cjs/components/dialog.d.ts.map +1 -1
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +4 -4
- package/dist/cjs/components/dropdown-menu.d.ts.map +1 -1
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +4 -4
- package/dist/cjs/components/em.js +1 -1
- package/dist/cjs/components/em.js.map +4 -4
- package/dist/cjs/components/flex.js +1 -1
- package/dist/cjs/components/flex.js.map +4 -4
- package/dist/cjs/components/grid.js +1 -1
- package/dist/cjs/components/grid.js.map +4 -4
- package/dist/cjs/components/heading.js +1 -1
- package/dist/cjs/components/heading.js.map +4 -4
- package/dist/cjs/components/hover-card.js +1 -1
- package/dist/cjs/components/hover-card.js.map +4 -4
- package/dist/cjs/components/icon-button.js +2 -2
- package/dist/cjs/components/icon-button.js.map +4 -4
- package/dist/cjs/components/image.js +1 -1
- package/dist/cjs/components/image.js.map +4 -4
- package/dist/cjs/components/index.js +5 -5
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/components/inset.js +1 -1
- package/dist/cjs/components/inset.js.map +4 -4
- package/dist/cjs/components/kbd.js +1 -1
- package/dist/cjs/components/kbd.js.map +4 -4
- package/dist/cjs/components/link.js +1 -1
- package/dist/cjs/components/link.js.map +4 -4
- package/dist/cjs/components/navbar.js +1 -1
- package/dist/cjs/components/navbar.js.map +4 -4
- package/dist/cjs/components/popover.js +1 -1
- package/dist/cjs/components/popover.js.map +4 -4
- package/dist/cjs/components/progress.js +1 -1
- package/dist/cjs/components/progress.js.map +4 -4
- package/dist/cjs/components/quote.js +1 -1
- package/dist/cjs/components/quote.js.map +4 -4
- package/dist/cjs/components/radio-cards.js +1 -1
- package/dist/cjs/components/radio-cards.js.map +4 -4
- package/dist/cjs/components/radio-group.js +1 -1
- package/dist/cjs/components/radio-group.js.map +4 -4
- package/dist/cjs/components/radio.js +1 -1
- package/dist/cjs/components/radio.js.map +4 -4
- package/dist/cjs/components/schemas/base-button.schema.d.ts +2 -2
- package/dist/cjs/components/schemas/button.schema.d.ts +2 -2
- package/dist/cjs/components/schemas/icon-button.schema.d.ts +4 -4
- package/dist/cjs/components/schemas/shell.schema.d.ts +2 -2
- package/dist/cjs/components/schemas/toggle-button.schema.d.ts +6 -6
- package/dist/cjs/components/schemas/toggle-icon-button.schema.d.ts +8 -8
- package/dist/cjs/components/scroll-area.js +1 -1
- package/dist/cjs/components/scroll-area.js.map +4 -4
- package/dist/cjs/components/section.js +1 -1
- package/dist/cjs/components/section.js.map +4 -4
- package/dist/cjs/components/segmented-control.js +1 -1
- package/dist/cjs/components/segmented-control.js.map +4 -4
- package/dist/cjs/components/select.js +1 -1
- package/dist/cjs/components/select.js.map +4 -4
- package/dist/cjs/components/separator.js +1 -1
- package/dist/cjs/components/separator.js.map +4 -4
- package/dist/cjs/components/sheet.d.ts.map +1 -1
- package/dist/cjs/components/sheet.js +1 -1
- package/dist/cjs/components/sheet.js.map +4 -4
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +4 -4
- package/dist/cjs/components/sidebar.js +1 -1
- package/dist/cjs/components/sidebar.js.map +4 -4
- package/dist/cjs/components/skeleton.js +1 -1
- package/dist/cjs/components/skeleton.js.map +4 -4
- package/dist/cjs/components/slider.js +1 -1
- package/dist/cjs/components/slider.js.map +4 -4
- package/dist/cjs/components/spinner.js +1 -1
- package/dist/cjs/components/spinner.js.map +4 -4
- package/dist/cjs/components/strong.js +1 -1
- package/dist/cjs/components/strong.js.map +4 -4
- package/dist/cjs/components/switch.js +1 -1
- package/dist/cjs/components/switch.js.map +4 -4
- package/dist/cjs/components/tab-nav.js +1 -1
- package/dist/cjs/components/tab-nav.js.map +4 -4
- package/dist/cjs/components/table.js +1 -1
- package/dist/cjs/components/table.js.map +4 -4
- package/dist/cjs/components/tabs.js +1 -1
- package/dist/cjs/components/tabs.js.map +4 -4
- package/dist/cjs/components/text-area.js +1 -1
- package/dist/cjs/components/text-area.js.map +4 -4
- package/dist/cjs/components/text-field.js +2 -2
- package/dist/cjs/components/text-field.js.map +4 -4
- package/dist/cjs/components/text.js +1 -1
- package/dist/cjs/components/text.js.map +4 -4
- package/dist/cjs/components/theme-panel.js +3 -3
- package/dist/cjs/components/theme-panel.js.map +4 -4
- package/dist/cjs/components/theme.d.ts +3 -0
- package/dist/cjs/components/theme.d.ts.map +1 -1
- package/dist/cjs/components/theme.js +1 -1
- package/dist/cjs/components/theme.js.map +4 -4
- package/dist/cjs/components/theme.props.d.ts +15 -1
- package/dist/cjs/components/theme.props.d.ts.map +1 -1
- package/dist/cjs/components/theme.props.js +1 -1
- package/dist/cjs/components/theme.props.js.map +2 -2
- package/dist/cjs/components/toggle-button.js +2 -2
- package/dist/cjs/components/toggle-button.js.map +4 -4
- package/dist/cjs/components/toggle-icon-button.js +3 -3
- package/dist/cjs/components/toggle-icon-button.js.map +4 -4
- package/dist/cjs/components/toolbar.js +1 -1
- package/dist/cjs/components/toolbar.js.map +4 -4
- package/dist/cjs/components/tooltip.js +1 -1
- package/dist/cjs/components/tooltip.js.map +4 -4
- package/dist/cjs/components/user-card.js +1 -1
- package/dist/cjs/components/user-card.js.map +4 -4
- package/dist/cjs/helpers/compile-prop-defs.d.ts +49 -0
- package/dist/cjs/helpers/compile-prop-defs.d.ts.map +1 -0
- package/dist/cjs/helpers/compile-prop-defs.js +2 -0
- package/dist/cjs/helpers/compile-prop-defs.js.map +7 -0
- package/dist/cjs/helpers/extract-props.d.ts.map +1 -1
- package/dist/cjs/helpers/extract-props.js +1 -1
- package/dist/cjs/helpers/extract-props.js.map +4 -4
- package/dist/cjs/helpers/font-config.d.ts +84 -77
- package/dist/cjs/helpers/font-config.d.ts.map +1 -1
- package/dist/cjs/helpers/font-config.js +5 -2
- package/dist/cjs/helpers/font-config.js.map +3 -3
- package/dist/cjs/helpers/get-margin-styles.d.ts.map +1 -1
- package/dist/cjs/helpers/get-margin-styles.js +1 -1
- package/dist/cjs/helpers/get-margin-styles.js.map +3 -3
- package/dist/cjs/helpers/get-responsive-styles.d.ts +5 -2
- package/dist/cjs/helpers/get-responsive-styles.d.ts.map +1 -1
- package/dist/cjs/helpers/get-responsive-styles.js +1 -1
- package/dist/cjs/helpers/get-responsive-styles.js.map +3 -3
- package/dist/cjs/helpers/index.js +5 -2
- package/dist/cjs/helpers/index.js.map +4 -4
- package/dist/cjs/helpers/use-deprecation-warning.d.ts +10 -0
- package/dist/cjs/helpers/use-deprecation-warning.d.ts.map +1 -0
- package/dist/cjs/helpers/use-deprecation-warning.js +2 -0
- package/dist/cjs/helpers/use-deprecation-warning.js.map +7 -0
- package/dist/cjs/hooks/index.js +2 -2
- package/dist/cjs/hooks/index.js.map +3 -3
- package/dist/cjs/hooks/use-body-pointer-events-cleanup.d.ts.map +1 -1
- package/dist/cjs/hooks/use-body-pointer-events-cleanup.js +1 -1
- package/dist/cjs/hooks/use-body-pointer-events-cleanup.js.map +3 -3
- package/dist/cjs/hooks/use-breakpoint.d.ts +7 -3
- package/dist/cjs/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/cjs/hooks/use-breakpoint.js +1 -1
- package/dist/cjs/hooks/use-breakpoint.js.map +3 -3
- package/dist/cjs/hooks/use-prop-synced-state.d.ts +14 -0
- package/dist/cjs/hooks/use-prop-synced-state.d.ts.map +1 -0
- package/dist/cjs/hooks/use-prop-synced-state.js +2 -0
- package/dist/cjs/hooks/use-prop-synced-state.js.map +7 -0
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/props/index.js +1 -1
- package/dist/cjs/props/index.js.map +2 -2
- package/dist/esm/{chunk-WYA4IRU6.js → chunk-25WZA7ZU.js} +2 -2
- package/dist/esm/{chunk-ARGX2ZZK.js → chunk-2FYJTSOP.js} +2 -2
- package/dist/esm/chunk-2UPAYDKR.js +2 -0
- package/dist/esm/chunk-2UPAYDKR.js.map +7 -0
- package/dist/esm/chunk-374ZYJUP.js +2 -0
- package/dist/esm/chunk-374ZYJUP.js.map +7 -0
- package/dist/esm/{chunk-K3R4AH3E.js → chunk-3MWWP4MW.js} +2 -2
- package/dist/esm/{chunk-HQ35PM4O.js → chunk-43A5GUSI.js} +2 -2
- package/dist/esm/{chunk-Z5DQ6FSA.js → chunk-4AQTUBVP.js} +2 -2
- package/dist/esm/{chunk-QLIELX4I.js → chunk-4ME6O27S.js} +2 -2
- package/dist/esm/chunk-4XJY6FIK.js +2 -0
- package/dist/esm/chunk-4XJY6FIK.js.map +7 -0
- package/dist/esm/{chunk-JQOFJNCV.js → chunk-4YFJWXL2.js} +2 -2
- package/dist/esm/chunk-5TXQLK4G.js +2 -0
- package/dist/esm/chunk-5TXQLK4G.js.map +7 -0
- package/dist/esm/{chunk-IPJUHVM6.js → chunk-666GX7O5.js} +2 -2
- package/dist/esm/chunk-6FLLFCBU.js +2 -0
- package/dist/esm/chunk-6FLLFCBU.js.map +7 -0
- package/dist/esm/{chunk-7CBAHIVG.js → chunk-6IGTK4JE.js} +2 -2
- package/dist/esm/chunk-6XGZPIUT.js +2 -0
- package/dist/esm/{chunk-T27QHMW7.js.map → chunk-6XGZPIUT.js.map} +2 -2
- package/dist/esm/{chunk-DJBPM5QK.js → chunk-7FC7HF76.js} +2 -2
- package/dist/esm/{chunk-SVLY6B5F.js → chunk-7QDTSBJF.js} +2 -2
- package/dist/esm/{chunk-7MURQ6CR.js → chunk-A2RZGGMY.js} +2 -2
- package/dist/esm/{chunk-VF5TRT3H.js → chunk-AU3D6F42.js} +2 -2
- package/dist/esm/chunk-AX5S56DS.js +2 -0
- package/dist/esm/chunk-AX5S56DS.js.map +7 -0
- package/dist/esm/{chunk-DK5MHD6I.js → chunk-B24BDVG2.js} +2 -2
- package/dist/esm/{chunk-BJTJUIYJ.js → chunk-CRWYCLTE.js} +2 -2
- package/dist/esm/{chunk-OHJVFZMH.js → chunk-CSKZZOI2.js} +2 -2
- package/dist/esm/{chunk-4N5JU7XQ.js → chunk-CVWCKOHO.js} +2 -2
- package/dist/esm/chunk-CWRNW44F.js +2 -0
- package/dist/esm/chunk-CWRNW44F.js.map +7 -0
- package/dist/esm/{chunk-ADYTQCZX.js → chunk-D6B7IMZU.js} +2 -2
- package/dist/esm/{chunk-U7AASKZI.js → chunk-DNHUQLXO.js} +2 -2
- package/dist/esm/{chunk-USGTBZ43.js → chunk-E67CIG6A.js} +2 -2
- package/dist/esm/{chunk-YUZPSUJE.js → chunk-F7IYL2VW.js} +2 -2
- package/dist/esm/{chunk-FVCWNSRU.js → chunk-FHOCUZDR.js} +2 -2
- package/dist/esm/{chunk-APRBRAOT.js → chunk-FXUUI6Z2.js} +2 -2
- package/dist/esm/{chunk-WNSPLWRV.js → chunk-GJSGKE7B.js} +2 -2
- package/dist/esm/{chunk-OGOOZLUD.js → chunk-GLERJXVS.js} +2 -2
- package/dist/esm/{chunk-6VGPTAHM.js → chunk-GWXVETMF.js} +2 -2
- package/dist/esm/{chunk-ES7MK2MM.js → chunk-GYBLXQ4R.js} +2 -2
- package/dist/esm/{chunk-4OBMRJHC.js → chunk-H7ST535H.js} +2 -2
- package/dist/esm/{chunk-QLZ5XAW6.js → chunk-HF5WY5YE.js} +2 -2
- package/dist/esm/{chunk-RDP4UQ42.js → chunk-IEWCQU2S.js} +2 -2
- package/dist/esm/{chunk-XLOHPURR.js → chunk-IHK3H2OM.js} +2 -2
- package/dist/esm/{chunk-EJWAAFCI.js → chunk-IKSN4RNB.js} +2 -2
- package/dist/esm/{chunk-3F6I7YOR.js → chunk-JDGJSNWT.js} +2 -2
- package/dist/esm/chunk-JUY7CBSL.js +2 -0
- package/dist/esm/chunk-JUY7CBSL.js.map +7 -0
- package/dist/esm/{chunk-ZSEFZM5H.js → chunk-K6QZMNCD.js} +2 -2
- package/dist/esm/chunk-KKBP2CRH.js +2 -0
- package/dist/esm/chunk-KKBP2CRH.js.map +7 -0
- package/dist/esm/{chunk-ZHYOJNWV.js → chunk-LKAK5GXF.js} +2 -2
- package/dist/esm/{chunk-GWYFT3EI.js → chunk-M24UXMOQ.js} +2 -2
- package/dist/esm/{chunk-JCYI4NTV.js → chunk-MBCBP73P.js} +2 -2
- package/dist/esm/{chunk-UYNYUR7O.js → chunk-MBE2YSBU.js} +2 -2
- package/dist/esm/chunk-MHANZINI.js +2 -0
- package/dist/esm/chunk-MHANZINI.js.map +7 -0
- package/dist/esm/chunk-MK2R6DAU.js +2 -0
- package/dist/esm/chunk-MK2R6DAU.js.map +7 -0
- package/dist/esm/{chunk-DNI4QRXQ.js → chunk-MOR3NSXQ.js} +2 -2
- package/dist/esm/{chunk-H2G446JG.js → chunk-NMKPFUNP.js} +2 -2
- package/dist/esm/{chunk-TEULZKBM.js → chunk-OGXZHAQL.js} +2 -2
- package/dist/esm/{chunk-M3ZYJANH.js → chunk-OSRJRBKP.js} +2 -2
- package/dist/esm/{chunk-2AEELIG6.js → chunk-OWAUCLRT.js} +2 -2
- package/dist/esm/{chunk-7CXVHFMQ.js → chunk-P7HYVJSU.js} +2 -2
- package/dist/esm/{chunk-4532RT2B.js → chunk-P7IAHW4V.js} +2 -2
- package/dist/esm/{chunk-GLC4QJBF.js → chunk-PLWXTEVE.js} +2 -2
- package/dist/esm/{chunk-SGU4HUHF.js → chunk-PTLFMWCN.js} +2 -2
- package/dist/esm/{chunk-QOWA5LK5.js → chunk-QEOAXJLN.js} +2 -2
- package/dist/esm/{chunk-XHQGMOXV.js → chunk-RMKXWYOV.js} +2 -2
- package/dist/esm/chunk-S2HA3W3V.js +2 -0
- package/dist/esm/chunk-S2HA3W3V.js.map +7 -0
- package/dist/esm/{chunk-WZCZHCVE.js → chunk-S56YSRHP.js} +2 -2
- package/dist/esm/{chunk-E6IWYD3U.js → chunk-S5C5YRBS.js} +2 -2
- package/dist/esm/{chunk-A24PYRVV.js → chunk-SO67YEVQ.js} +2 -2
- package/dist/esm/chunk-TLWTUKKL.js +2 -0
- package/dist/esm/chunk-TLWTUKKL.js.map +7 -0
- package/dist/esm/{chunk-RQ2ZPMHJ.js → chunk-TOLLPRMM.js} +2 -2
- package/dist/esm/{chunk-HACQF6F4.js → chunk-TOOSHJOA.js} +2 -2
- package/dist/esm/{chunk-42HFGCHX.js → chunk-UGD7Z3L4.js} +2 -2
- package/dist/esm/chunk-VA5A4MHU.js +6 -0
- package/dist/esm/chunk-VA5A4MHU.js.map +7 -0
- package/dist/esm/{chunk-DXI5P5O4.js → chunk-VX6ARMWP.js} +2 -2
- package/dist/esm/{chunk-25U7DENY.js → chunk-W7N7V5YD.js} +2 -2
- package/dist/esm/chunk-WAURCNAS.js +2 -0
- package/dist/esm/chunk-WAURCNAS.js.map +7 -0
- package/dist/esm/chunk-WFMYNZXZ.js +2 -0
- package/dist/esm/chunk-WFMYNZXZ.js.map +7 -0
- package/dist/esm/{chunk-6FAICIYS.js → chunk-XMRIRFM7.js} +2 -2
- package/dist/esm/chunk-YEB3H7QN.js +2 -0
- package/dist/esm/chunk-YEB3H7QN.js.map +7 -0
- package/dist/esm/chunk-YUP6EICB.js +2 -0
- package/dist/esm/chunk-YUP6EICB.js.map +7 -0
- package/dist/esm/chunk-YV2KYHGR.js +2 -0
- package/dist/esm/chunk-YV2KYHGR.js.map +7 -0
- package/dist/esm/{chunk-UIEUZLZZ.js → chunk-ZY6SQWHT.js} +2 -2
- package/dist/esm/components/_internal/base-button.d.ts.map +1 -1
- package/dist/esm/components/_internal/base-button.js +1 -1
- package/dist/esm/components/_internal/dropdown-menu-drill-down.js +1 -1
- package/dist/esm/components/_internal/shell-bottom.js +1 -1
- package/dist/esm/components/_internal/shell-handles.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-handles.js +1 -1
- package/dist/esm/components/_internal/shell-inspector.js +1 -1
- package/dist/esm/components/_internal/shell-sidebar.js +1 -1
- package/dist/esm/components/accordion.d.ts.map +1 -1
- package/dist/esm/components/accordion.js +1 -1
- package/dist/esm/components/alert-dialog.d.ts.map +1 -1
- package/dist/esm/components/alert-dialog.js +1 -1
- package/dist/esm/components/avatar.js +1 -1
- package/dist/esm/components/badge.d.ts.map +1 -1
- package/dist/esm/components/badge.js +1 -1
- package/dist/esm/components/blockquote.js +1 -1
- package/dist/esm/components/box.js +1 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/callout.js +1 -1
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/chatbar.js +1 -1
- package/dist/esm/components/checkbox-cards.js +1 -1
- package/dist/esm/components/checkbox-group.js +1 -1
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/code.js +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/components/context-menu.d.ts.map +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/data-list.js +1 -1
- package/dist/esm/components/dialog.d.ts.map +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dropdown-menu.d.ts.map +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/em.js +1 -1
- package/dist/esm/components/flex.js +1 -1
- package/dist/esm/components/grid.js +1 -1
- package/dist/esm/components/heading.js +1 -1
- package/dist/esm/components/hover-card.js +1 -1
- package/dist/esm/components/icon-button.js +1 -1
- package/dist/esm/components/image.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/inset.js +1 -1
- package/dist/esm/components/kbd.js +1 -1
- package/dist/esm/components/link.js +1 -1
- package/dist/esm/components/navbar.js +1 -1
- package/dist/esm/components/popover.js +1 -1
- package/dist/esm/components/progress.js +1 -1
- package/dist/esm/components/quote.js +1 -1
- package/dist/esm/components/radio-cards.js +1 -1
- package/dist/esm/components/radio-group.js +1 -1
- package/dist/esm/components/radio.js +1 -1
- package/dist/esm/components/schemas/base-button.schema.d.ts +2 -2
- package/dist/esm/components/schemas/button.schema.d.ts +2 -2
- package/dist/esm/components/schemas/icon-button.schema.d.ts +4 -4
- package/dist/esm/components/schemas/shell.schema.d.ts +2 -2
- package/dist/esm/components/schemas/toggle-button.schema.d.ts +6 -6
- package/dist/esm/components/schemas/toggle-icon-button.schema.d.ts +8 -8
- package/dist/esm/components/scroll-area.js +1 -1
- package/dist/esm/components/section.js +1 -1
- package/dist/esm/components/segmented-control.js +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/separator.js +1 -1
- package/dist/esm/components/sheet.d.ts.map +1 -1
- package/dist/esm/components/sheet.js +1 -1
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/skeleton.js +1 -1
- package/dist/esm/components/slider.js +1 -1
- package/dist/esm/components/spinner.js +1 -1
- package/dist/esm/components/strong.js +1 -1
- package/dist/esm/components/switch.js +1 -1
- package/dist/esm/components/tab-nav.js +1 -1
- package/dist/esm/components/table.js +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/text-area.js +1 -1
- package/dist/esm/components/text-field.js +1 -1
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/theme-panel.js +1 -1
- package/dist/esm/components/theme.d.ts +3 -0
- package/dist/esm/components/theme.d.ts.map +1 -1
- package/dist/esm/components/theme.js +1 -1
- package/dist/esm/components/theme.props.d.ts +15 -1
- package/dist/esm/components/theme.props.d.ts.map +1 -1
- package/dist/esm/components/theme.props.js +1 -1
- package/dist/esm/components/toggle-button.js +1 -1
- package/dist/esm/components/toggle-icon-button.js +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/user-card.js +1 -1
- package/dist/esm/helpers/compile-prop-defs.d.ts +49 -0
- package/dist/esm/helpers/compile-prop-defs.d.ts.map +1 -0
- package/dist/esm/helpers/compile-prop-defs.js +2 -0
- package/dist/esm/helpers/compile-prop-defs.js.map +7 -0
- package/dist/esm/helpers/extract-props.d.ts.map +1 -1
- package/dist/esm/helpers/extract-props.js +1 -1
- package/dist/esm/helpers/font-config.d.ts +84 -77
- package/dist/esm/helpers/font-config.d.ts.map +1 -1
- package/dist/esm/helpers/font-config.js +1 -1
- package/dist/esm/helpers/get-margin-styles.d.ts.map +1 -1
- package/dist/esm/helpers/get-margin-styles.js +1 -1
- package/dist/esm/helpers/get-responsive-styles.d.ts +5 -2
- package/dist/esm/helpers/get-responsive-styles.d.ts.map +1 -1
- package/dist/esm/helpers/get-responsive-styles.js +1 -1
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/helpers/use-deprecation-warning.d.ts +10 -0
- package/dist/esm/helpers/use-deprecation-warning.d.ts.map +1 -0
- package/dist/esm/helpers/use-deprecation-warning.js +2 -0
- package/dist/esm/helpers/use-deprecation-warning.js.map +7 -0
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/use-body-pointer-events-cleanup.d.ts.map +1 -1
- package/dist/esm/hooks/use-body-pointer-events-cleanup.js +1 -1
- package/dist/esm/hooks/use-breakpoint.d.ts +7 -3
- package/dist/esm/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/esm/hooks/use-breakpoint.js +1 -1
- package/dist/esm/hooks/use-prop-synced-state.d.ts +14 -0
- package/dist/esm/hooks/use-prop-synced-state.d.ts.map +1 -0
- package/dist/esm/hooks/use-prop-synced-state.js +2 -0
- package/dist/esm/hooks/use-prop-synced-state.js.map +7 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/props/index.js +1 -1
- package/fonts.css +8 -0
- package/package.json +18 -7
- package/schemas/base-button.json +0 -1
- package/schemas/button.json +0 -1
- package/schemas/icon-button.json +0 -1
- package/schemas/index.json +0 -6
- package/schemas/toggle-button.json +0 -1
- package/schemas/toggle-icon-button.json +0 -1
- package/src/components/_internal/base-button.css +2 -2
- package/src/components/_internal/base-button.tsx +3 -58
- package/src/components/_internal/base-card.css +19 -4
- package/src/components/_internal/base-checkbox.css +2 -2
- package/src/components/_internal/base-dialog.css +7 -0
- package/src/components/_internal/base-menu.css +7 -0
- package/src/components/_internal/base-radio.css +2 -2
- package/src/components/_internal/base-sidebar.css +7 -0
- package/src/components/_internal/base-tab-list.css +2 -2
- package/src/components/_internal/shell-handles.tsx +27 -0
- package/src/components/accordion.css +6 -6
- package/src/components/accordion.tsx +2 -8
- package/src/components/alert-dialog.tsx +22 -20
- package/src/components/avatar.css +2 -2
- package/src/components/badge.css +2 -2
- package/src/components/badge.tsx +2 -8
- package/src/components/callout.css +2 -2
- package/src/components/chatbar.css +1 -1
- package/src/components/context-menu.tsx +2 -8
- package/src/components/dialog.tsx +22 -20
- package/src/components/dropdown-menu.tsx +2 -8
- package/src/components/heading.css +10 -3
- package/src/components/popover.css +7 -0
- package/src/components/progress.css +21 -8
- package/src/components/segmented-control.css +2 -2
- package/src/components/select.css +9 -2
- package/src/components/sheet.tsx +31 -28
- package/src/components/shell.css +106 -69
- package/src/components/slider.css +2 -2
- package/src/components/switch.css +2 -2
- package/src/components/table.css +7 -0
- package/src/components/text-area.css +2 -2
- package/src/components/text-field.css +2 -2
- package/src/components/text.css +10 -3
- package/src/components/theme.props.tsx +13 -1
- package/src/components/theme.tsx +53 -34
- package/src/helpers/compile-prop-defs.ts +121 -0
- package/src/helpers/extract-props.ts +104 -83
- package/src/helpers/font-config.ts +130 -148
- package/src/helpers/get-margin-styles.ts +38 -71
- package/src/helpers/get-responsive-styles.ts +37 -38
- package/src/helpers/use-deprecation-warning.ts +26 -0
- package/src/hooks/use-body-pointer-events-cleanup.ts +36 -6
- package/src/hooks/use-breakpoint.ts +94 -53
- package/src/hooks/use-prop-synced-state.ts +24 -0
- package/src/styles/fonts.css +24 -29
- package/src/styles/index.css +0 -1
- package/src/styles/tokens/base.css +1 -0
- package/src/styles/tokens/blur.css +28 -0
- package/src/styles/tokens/color.css +3 -3
- package/src/styles/tokens/constants.css +11 -0
- package/src/styles/tokens/font-family.css +263 -0
- package/src/styles/tokens/typography.css +2 -216
- package/styles.css +8776 -8727
- package/tokens/base.css +50 -30
- package/tokens.css +53 -30
- package/dist/esm/chunk-2SS3FA3N.js +0 -2
- package/dist/esm/chunk-2SS3FA3N.js.map +0 -7
- package/dist/esm/chunk-5U2Q23K3.js +0 -2
- package/dist/esm/chunk-5U2Q23K3.js.map +0 -7
- package/dist/esm/chunk-6ELPYR73.js +0 -2
- package/dist/esm/chunk-6ELPYR73.js.map +0 -7
- package/dist/esm/chunk-DZ4H2KTP.js +0 -2
- package/dist/esm/chunk-DZ4H2KTP.js.map +0 -7
- package/dist/esm/chunk-H4MMVAGQ.js +0 -2
- package/dist/esm/chunk-H4MMVAGQ.js.map +0 -7
- package/dist/esm/chunk-ITRVKLYU.js +0 -2
- package/dist/esm/chunk-ITRVKLYU.js.map +0 -7
- package/dist/esm/chunk-KCAFSCOV.js +0 -2
- package/dist/esm/chunk-KCAFSCOV.js.map +0 -7
- package/dist/esm/chunk-KMPBTEZH.js +0 -2
- package/dist/esm/chunk-KMPBTEZH.js.map +0 -7
- package/dist/esm/chunk-LN5SP46K.js +0 -2
- package/dist/esm/chunk-LN5SP46K.js.map +0 -7
- package/dist/esm/chunk-OKJNS7Z7.js +0 -2
- package/dist/esm/chunk-OKJNS7Z7.js.map +0 -7
- package/dist/esm/chunk-Q73Y5O5P.js +0 -2
- package/dist/esm/chunk-Q73Y5O5P.js.map +0 -7
- package/dist/esm/chunk-Q7P6BTVU.js +0 -3
- package/dist/esm/chunk-Q7P6BTVU.js.map +0 -7
- package/dist/esm/chunk-T27QHMW7.js +0 -2
- package/dist/esm/chunk-UUX42HBM.js +0 -2
- package/dist/esm/chunk-UUX42HBM.js.map +0 -7
- package/dist/esm/chunk-X7BD5FLE.js +0 -2
- package/dist/esm/chunk-X7BD5FLE.js.map +0 -7
- package/dist/esm/chunk-YEA646GM.js +0 -2
- package/dist/esm/chunk-YEA646GM.js.map +0 -7
- package/dist/esm/chunk-ZMEXIPWM.js +0 -2
- package/dist/esm/chunk-ZMEXIPWM.js.map +0 -7
- /package/dist/esm/{chunk-WYA4IRU6.js.map → chunk-25WZA7ZU.js.map} +0 -0
- /package/dist/esm/{chunk-ARGX2ZZK.js.map → chunk-2FYJTSOP.js.map} +0 -0
- /package/dist/esm/{chunk-K3R4AH3E.js.map → chunk-3MWWP4MW.js.map} +0 -0
- /package/dist/esm/{chunk-HQ35PM4O.js.map → chunk-43A5GUSI.js.map} +0 -0
- /package/dist/esm/{chunk-Z5DQ6FSA.js.map → chunk-4AQTUBVP.js.map} +0 -0
- /package/dist/esm/{chunk-QLIELX4I.js.map → chunk-4ME6O27S.js.map} +0 -0
- /package/dist/esm/{chunk-JQOFJNCV.js.map → chunk-4YFJWXL2.js.map} +0 -0
- /package/dist/esm/{chunk-IPJUHVM6.js.map → chunk-666GX7O5.js.map} +0 -0
- /package/dist/esm/{chunk-7CBAHIVG.js.map → chunk-6IGTK4JE.js.map} +0 -0
- /package/dist/esm/{chunk-DJBPM5QK.js.map → chunk-7FC7HF76.js.map} +0 -0
- /package/dist/esm/{chunk-SVLY6B5F.js.map → chunk-7QDTSBJF.js.map} +0 -0
- /package/dist/esm/{chunk-7MURQ6CR.js.map → chunk-A2RZGGMY.js.map} +0 -0
- /package/dist/esm/{chunk-VF5TRT3H.js.map → chunk-AU3D6F42.js.map} +0 -0
- /package/dist/esm/{chunk-DK5MHD6I.js.map → chunk-B24BDVG2.js.map} +0 -0
- /package/dist/esm/{chunk-BJTJUIYJ.js.map → chunk-CRWYCLTE.js.map} +0 -0
- /package/dist/esm/{chunk-OHJVFZMH.js.map → chunk-CSKZZOI2.js.map} +0 -0
- /package/dist/esm/{chunk-4N5JU7XQ.js.map → chunk-CVWCKOHO.js.map} +0 -0
- /package/dist/esm/{chunk-ADYTQCZX.js.map → chunk-D6B7IMZU.js.map} +0 -0
- /package/dist/esm/{chunk-U7AASKZI.js.map → chunk-DNHUQLXO.js.map} +0 -0
- /package/dist/esm/{chunk-USGTBZ43.js.map → chunk-E67CIG6A.js.map} +0 -0
- /package/dist/esm/{chunk-YUZPSUJE.js.map → chunk-F7IYL2VW.js.map} +0 -0
- /package/dist/esm/{chunk-FVCWNSRU.js.map → chunk-FHOCUZDR.js.map} +0 -0
- /package/dist/esm/{chunk-APRBRAOT.js.map → chunk-FXUUI6Z2.js.map} +0 -0
- /package/dist/esm/{chunk-WNSPLWRV.js.map → chunk-GJSGKE7B.js.map} +0 -0
- /package/dist/esm/{chunk-OGOOZLUD.js.map → chunk-GLERJXVS.js.map} +0 -0
- /package/dist/esm/{chunk-6VGPTAHM.js.map → chunk-GWXVETMF.js.map} +0 -0
- /package/dist/esm/{chunk-ES7MK2MM.js.map → chunk-GYBLXQ4R.js.map} +0 -0
- /package/dist/esm/{chunk-4OBMRJHC.js.map → chunk-H7ST535H.js.map} +0 -0
- /package/dist/esm/{chunk-QLZ5XAW6.js.map → chunk-HF5WY5YE.js.map} +0 -0
- /package/dist/esm/{chunk-RDP4UQ42.js.map → chunk-IEWCQU2S.js.map} +0 -0
- /package/dist/esm/{chunk-XLOHPURR.js.map → chunk-IHK3H2OM.js.map} +0 -0
- /package/dist/esm/{chunk-EJWAAFCI.js.map → chunk-IKSN4RNB.js.map} +0 -0
- /package/dist/esm/{chunk-3F6I7YOR.js.map → chunk-JDGJSNWT.js.map} +0 -0
- /package/dist/esm/{chunk-ZSEFZM5H.js.map → chunk-K6QZMNCD.js.map} +0 -0
- /package/dist/esm/{chunk-ZHYOJNWV.js.map → chunk-LKAK5GXF.js.map} +0 -0
- /package/dist/esm/{chunk-GWYFT3EI.js.map → chunk-M24UXMOQ.js.map} +0 -0
- /package/dist/esm/{chunk-JCYI4NTV.js.map → chunk-MBCBP73P.js.map} +0 -0
- /package/dist/esm/{chunk-UYNYUR7O.js.map → chunk-MBE2YSBU.js.map} +0 -0
- /package/dist/esm/{chunk-DNI4QRXQ.js.map → chunk-MOR3NSXQ.js.map} +0 -0
- /package/dist/esm/{chunk-H2G446JG.js.map → chunk-NMKPFUNP.js.map} +0 -0
- /package/dist/esm/{chunk-TEULZKBM.js.map → chunk-OGXZHAQL.js.map} +0 -0
- /package/dist/esm/{chunk-M3ZYJANH.js.map → chunk-OSRJRBKP.js.map} +0 -0
- /package/dist/esm/{chunk-2AEELIG6.js.map → chunk-OWAUCLRT.js.map} +0 -0
- /package/dist/esm/{chunk-7CXVHFMQ.js.map → chunk-P7HYVJSU.js.map} +0 -0
- /package/dist/esm/{chunk-4532RT2B.js.map → chunk-P7IAHW4V.js.map} +0 -0
- /package/dist/esm/{chunk-GLC4QJBF.js.map → chunk-PLWXTEVE.js.map} +0 -0
- /package/dist/esm/{chunk-SGU4HUHF.js.map → chunk-PTLFMWCN.js.map} +0 -0
- /package/dist/esm/{chunk-QOWA5LK5.js.map → chunk-QEOAXJLN.js.map} +0 -0
- /package/dist/esm/{chunk-XHQGMOXV.js.map → chunk-RMKXWYOV.js.map} +0 -0
- /package/dist/esm/{chunk-WZCZHCVE.js.map → chunk-S56YSRHP.js.map} +0 -0
- /package/dist/esm/{chunk-E6IWYD3U.js.map → chunk-S5C5YRBS.js.map} +0 -0
- /package/dist/esm/{chunk-A24PYRVV.js.map → chunk-SO67YEVQ.js.map} +0 -0
- /package/dist/esm/{chunk-RQ2ZPMHJ.js.map → chunk-TOLLPRMM.js.map} +0 -0
- /package/dist/esm/{chunk-HACQF6F4.js.map → chunk-TOOSHJOA.js.map} +0 -0
- /package/dist/esm/{chunk-42HFGCHX.js.map → chunk-UGD7Z3L4.js.map} +0 -0
- /package/dist/esm/{chunk-DXI5P5O4.js.map → chunk-VX6ARMWP.js.map} +0 -0
- /package/dist/esm/{chunk-25U7DENY.js.map → chunk-W7N7V5YD.js.map} +0 -0
- /package/dist/esm/{chunk-6FAICIYS.js.map → chunk-XMRIRFM7.js.map} +0 -0
- /package/dist/esm/{chunk-UIEUZLZZ.js.map → chunk-ZY6SQWHT.js.map} +0 -0
|
@@ -1,194 +1,176 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Runtime font configuration for Kookie UI.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* and
|
|
4
|
+
* This is a thin, typed wrapper over the CSS tokens in `styles/tokens/font-family.css` —
|
|
5
|
+
* it writes the same variables you would write by hand, and nothing else. Prefer plain CSS
|
|
6
|
+
* where you can; reach for this when the stacks are only known at runtime (a theme editor,
|
|
7
|
+
* a user-selectable typeface).
|
|
8
|
+
*
|
|
9
|
+
* Two tiers, matching the CSS:
|
|
10
|
+
*
|
|
11
|
+
* - `stacks` — which typefaces exist: `sans`, `mono`, `serif`. Written to `:root`.
|
|
12
|
+
* - `roles` — which stack each role uses: `body`, `heading`, `code`, `strong`, `em`,
|
|
13
|
+
* `quote`. Written to the theme element, since roles are per-theme.
|
|
6
14
|
*/
|
|
7
15
|
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
export interface FontConfig {
|
|
12
|
-
/** Sans-serif font stack for fontFamily="sans" */
|
|
16
|
+
/** Tier 1 — the typefaces available to the theme. */
|
|
17
|
+
export interface FontStacks {
|
|
18
|
+
/** Sans-serif stack. Backs `font="sans"` and, by default, body text. */
|
|
13
19
|
sans?: string;
|
|
14
|
-
/** Monospace
|
|
20
|
+
/** Monospace stack. Backs `font="mono"` and `Code`. */
|
|
15
21
|
mono?: string;
|
|
16
|
-
/** Serif
|
|
22
|
+
/** Serif stack. Backs `font="serif"`, `Em` and `Quote`. */
|
|
17
23
|
serif?: string;
|
|
18
|
-
/** Base Inter font replacement */
|
|
19
|
-
inter?: string;
|
|
20
|
-
/** Base JetBrains Mono font replacement */
|
|
21
|
-
jetbrainsMono?: string;
|
|
22
|
-
/** Base Playfair Display font replacement */
|
|
23
|
-
playfairDisplay?: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
*/
|
|
29
|
-
|
|
26
|
+
/** Tier 2 — which stack each role of text uses. */
|
|
27
|
+
export interface FontRoles {
|
|
28
|
+
/** Body text: `Text`, inputs, buttons, and anything that does not opt out. */
|
|
29
|
+
body?: string;
|
|
30
|
+
/** `Heading`. Follows `body` when left unset. */
|
|
31
|
+
heading?: string;
|
|
32
|
+
/** `Code`. */
|
|
33
|
+
code?: string;
|
|
34
|
+
/** `Strong`. */
|
|
35
|
+
strong?: string;
|
|
36
|
+
/** `Em`. */
|
|
37
|
+
em?: string;
|
|
38
|
+
/** `Quote`. */
|
|
39
|
+
quote?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface FontConfig {
|
|
43
|
+
stacks?: FontStacks;
|
|
44
|
+
roles?: FontRoles;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** CSS custom properties backing each stack. Declared on `:root`. */
|
|
48
|
+
export const FONT_STACK_VARIABLES = {
|
|
30
49
|
sans: '--font-sans',
|
|
31
50
|
mono: '--font-mono',
|
|
32
51
|
serif: '--font-serif',
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
} as const satisfies Record<keyof FontStacks, `--font-${string}`>;
|
|
53
|
+
|
|
54
|
+
/** CSS custom properties backing each role. Declared on the theme element. */
|
|
55
|
+
export const FONT_ROLE_VARIABLES = {
|
|
56
|
+
body: '--font-body',
|
|
57
|
+
heading: '--font-heading',
|
|
58
|
+
code: '--font-code',
|
|
59
|
+
strong: '--font-strong',
|
|
60
|
+
em: '--font-em',
|
|
61
|
+
quote: '--font-quote',
|
|
62
|
+
} as const satisfies Record<keyof FontRoles, `--font-${string}`>;
|
|
41
63
|
|
|
42
64
|
/**
|
|
43
|
-
*
|
|
65
|
+
* Ready-made stacks, each ending in a system fallback.
|
|
66
|
+
*
|
|
67
|
+
* The webfont entries assume the face is already loaded — via
|
|
68
|
+
* `import '@womp/kookie-ui/fonts.css'`, `next/font`, or your own `@font-face`.
|
|
69
|
+
* Kookie's core stylesheet deliberately loads none.
|
|
44
70
|
*/
|
|
45
71
|
export const FONT_STACKS = {
|
|
46
|
-
// Sans
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
poppins: "'Poppins',
|
|
50
|
-
openSans: "'Open Sans
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// Serif
|
|
59
|
-
|
|
60
|
-
|
|
72
|
+
// Sans
|
|
73
|
+
system: "-apple-system, BlinkMacSystemFont, 'Segoe UI (Custom)', Roboto, 'Helvetica Neue', system-ui, sans-serif",
|
|
74
|
+
inter: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI (Custom)', Roboto, system-ui, sans-serif",
|
|
75
|
+
poppins: "'Poppins', -apple-system, BlinkMacSystemFont, system-ui, sans-serif",
|
|
76
|
+
openSans: "'Open Sans (Custom)', -apple-system, BlinkMacSystemFont, system-ui, sans-serif",
|
|
77
|
+
|
|
78
|
+
// Mono
|
|
79
|
+
systemMono: "'Menlo', 'Consolas (Custom)', 'Bitstream Vera Sans Mono', monospace",
|
|
80
|
+
jetbrainsMono: "'JetBrains Mono', 'Menlo', 'Consolas (Custom)', monospace",
|
|
81
|
+
firaCode: "'Fira Code', 'Menlo', 'Consolas (Custom)', monospace",
|
|
82
|
+
sourceCodePro: "'Source Code Pro', 'Menlo', 'Consolas (Custom)', monospace",
|
|
83
|
+
|
|
84
|
+
// Serif
|
|
85
|
+
systemSerif: "'Times New Roman', 'Times', 'Georgia', 'Cambria', serif",
|
|
86
|
+
playfair: "'Playfair Display', 'Times New Roman', 'Georgia', serif",
|
|
61
87
|
georgia: "'Georgia', 'Times New Roman', 'Times', serif",
|
|
62
|
-
lora: "'Lora', 'Times New Roman',
|
|
88
|
+
lora: "'Lora', 'Georgia', 'Times New Roman', serif",
|
|
63
89
|
} as const;
|
|
64
90
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
* @param target Target element (defaults to document.documentElement)
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```ts
|
|
73
|
-
* // Use Google Fonts
|
|
74
|
-
* applyFontConfig({
|
|
75
|
-
* sans: FONT_STACKS.poppins,
|
|
76
|
-
* mono: FONT_STACKS.firaCode
|
|
77
|
-
* });
|
|
78
|
-
*
|
|
79
|
-
* // Use system fonts only
|
|
80
|
-
* applyFontConfig({
|
|
81
|
-
* sans: FONT_STACKS.system,
|
|
82
|
-
* mono: FONT_STACKS.systemMono
|
|
83
|
-
* });
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
export function applyFontConfig(config: FontConfig, target: HTMLElement = document.documentElement): void {
|
|
87
|
-
const style = target.style;
|
|
88
|
-
|
|
89
|
-
if (config.sans) {
|
|
90
|
-
style.setProperty(FONT_CSS_VARIABLES.sans, config.sans);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (config.mono) {
|
|
94
|
-
style.setProperty(FONT_CSS_VARIABLES.mono, config.mono);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (config.serif) {
|
|
98
|
-
style.setProperty(FONT_CSS_VARIABLES.serif, config.serif);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (config.inter) {
|
|
102
|
-
style.setProperty(FONT_CSS_VARIABLES.inter, config.inter);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (config.jetbrainsMono) {
|
|
106
|
-
style.setProperty(FONT_CSS_VARIABLES.jetbrainsMono, config.jetbrainsMono);
|
|
91
|
+
function write<K extends string>(target: HTMLElement, variables: Record<K, string>, values: Partial<Record<K, string>>) {
|
|
92
|
+
for (const key of Object.keys(variables) as K[]) {
|
|
93
|
+
const value = values[key];
|
|
94
|
+
if (value) target.style.setProperty(variables[key], value);
|
|
107
95
|
}
|
|
96
|
+
}
|
|
108
97
|
|
|
109
|
-
|
|
110
|
-
|
|
98
|
+
function clear(target: HTMLElement, variables: Record<string, string>) {
|
|
99
|
+
for (const variable of Object.values(variables)) {
|
|
100
|
+
target.style.removeProperty(variable);
|
|
111
101
|
}
|
|
112
102
|
}
|
|
113
103
|
|
|
114
104
|
/**
|
|
115
|
-
*
|
|
105
|
+
* Apply a font configuration.
|
|
116
106
|
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
107
|
+
* Stacks land on `:root` and roles on `themeElement`, mirroring where the stylesheet
|
|
108
|
+
* declares them — writing a role to `:root` would not survive, because the theme
|
|
109
|
+
* element declares its own.
|
|
119
110
|
*
|
|
120
111
|
* @example
|
|
121
112
|
* ```ts
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
113
|
+
* // Serif headings over a sans body
|
|
114
|
+
* applyFontConfig({
|
|
115
|
+
* stacks: { sans: FONT_STACKS.inter, serif: FONT_STACKS.playfair },
|
|
116
|
+
* roles: { heading: 'var(--font-serif)' },
|
|
125
117
|
* });
|
|
126
|
-
*
|
|
127
|
-
* // Inject into document
|
|
128
|
-
* const style = document.createElement('style');
|
|
129
|
-
* style.textContent = css;
|
|
130
|
-
* document.head.appendChild(style);
|
|
131
118
|
* ```
|
|
132
119
|
*/
|
|
133
|
-
export function
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (config.mono) {
|
|
141
|
-
rules.push(` ${FONT_CSS_VARIABLES.mono}: ${config.mono};`);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (config.serif) {
|
|
145
|
-
rules.push(` ${FONT_CSS_VARIABLES.serif}: ${config.serif};`);
|
|
146
|
-
}
|
|
120
|
+
export function applyFontConfig(
|
|
121
|
+
config: FontConfig,
|
|
122
|
+
{ root = document.documentElement, themeElement = document.querySelector<HTMLElement>('.radix-themes') }: { root?: HTMLElement; themeElement?: HTMLElement | null } = {},
|
|
123
|
+
): void {
|
|
124
|
+
if (config.stacks) write(root, FONT_STACK_VARIABLES, config.stacks);
|
|
125
|
+
if (config.roles && themeElement) write(themeElement, FONT_ROLE_VARIABLES, config.roles);
|
|
126
|
+
}
|
|
147
127
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Render a font configuration as a CSS string, for injecting into a stylesheet or
|
|
130
|
+
* emitting server-side.
|
|
131
|
+
*/
|
|
132
|
+
export function generateFontCSS(config: FontConfig): string {
|
|
133
|
+
const blocks: string[] = [];
|
|
151
134
|
|
|
152
|
-
|
|
153
|
-
|
|
135
|
+
const stacks = Object.entries(config.stacks ?? {}).filter(([, value]) => value);
|
|
136
|
+
if (stacks.length) {
|
|
137
|
+
blocks.push([':root {', ...stacks.map(([key, value]) => ` ${FONT_STACK_VARIABLES[key as keyof FontStacks]}: ${value};`), '}'].join('\n'));
|
|
154
138
|
}
|
|
155
139
|
|
|
156
|
-
|
|
157
|
-
|
|
140
|
+
const roles = Object.entries(config.roles ?? {}).filter(([, value]) => value);
|
|
141
|
+
if (roles.length) {
|
|
142
|
+
blocks.push(['.radix-themes {', ...roles.map(([key, value]) => ` ${FONT_ROLE_VARIABLES[key as keyof FontRoles]}: ${value};`), '}'].join('\n'));
|
|
158
143
|
}
|
|
159
144
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
return rules.join('\n');
|
|
145
|
+
return blocks.join('\n\n');
|
|
163
146
|
}
|
|
164
147
|
|
|
165
|
-
/**
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const style = target.style;
|
|
170
|
-
|
|
171
|
-
// Remove custom font variables to fall back to defaults
|
|
172
|
-
style.removeProperty(FONT_CSS_VARIABLES.sans);
|
|
173
|
-
style.removeProperty(FONT_CSS_VARIABLES.mono);
|
|
174
|
-
style.removeProperty(FONT_CSS_VARIABLES.serif);
|
|
175
|
-
style.removeProperty(FONT_CSS_VARIABLES.inter);
|
|
176
|
-
style.removeProperty(FONT_CSS_VARIABLES.jetbrainsMono);
|
|
177
|
-
style.removeProperty(FONT_CSS_VARIABLES.playfairDisplay);
|
|
148
|
+
/** Drop every inline font override, falling back to the stylesheet's defaults. */
|
|
149
|
+
export function resetFonts({ root = document.documentElement, themeElement = document.querySelector<HTMLElement>('.radix-themes') }: { root?: HTMLElement; themeElement?: HTMLElement | null } = {}): void {
|
|
150
|
+
clear(root, FONT_STACK_VARIABLES);
|
|
151
|
+
if (themeElement) clear(themeElement, FONT_ROLE_VARIABLES);
|
|
178
152
|
}
|
|
179
153
|
|
|
180
|
-
/**
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const
|
|
154
|
+
/** Read the stacks and roles currently in effect. */
|
|
155
|
+
export function getCurrentFontConfig({ themeElement = document.querySelector<HTMLElement>('.radix-themes') }: { themeElement?: HTMLElement | null } = {}): Required<FontConfig> {
|
|
156
|
+
// Roles resolve against the theme element, so read both tiers from it — it inherits
|
|
157
|
+
// the stacks from `:root` and is the only place the roles are declared.
|
|
158
|
+
const computed = getComputedStyle(themeElement ?? document.documentElement);
|
|
159
|
+
const read = (variable: string) => computed.getPropertyValue(variable).trim() || undefined;
|
|
185
160
|
|
|
186
161
|
return {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
162
|
+
stacks: {
|
|
163
|
+
sans: read(FONT_STACK_VARIABLES.sans),
|
|
164
|
+
mono: read(FONT_STACK_VARIABLES.mono),
|
|
165
|
+
serif: read(FONT_STACK_VARIABLES.serif),
|
|
166
|
+
},
|
|
167
|
+
roles: {
|
|
168
|
+
body: read(FONT_ROLE_VARIABLES.body),
|
|
169
|
+
heading: read(FONT_ROLE_VARIABLES.heading),
|
|
170
|
+
code: read(FONT_ROLE_VARIABLES.code),
|
|
171
|
+
strong: read(FONT_ROLE_VARIABLES.strong),
|
|
172
|
+
em: read(FONT_ROLE_VARIABLES.em),
|
|
173
|
+
quote: read(FONT_ROLE_VARIABLES.quote),
|
|
174
|
+
},
|
|
193
175
|
};
|
|
194
176
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
|
|
3
1
|
import { getResponsiveStyles } from './get-responsive-styles.js';
|
|
4
2
|
import { mergeStyles } from './merge-styles.js';
|
|
5
3
|
import { marginPropDefs } from '../props/margin.props.js';
|
|
@@ -7,75 +5,44 @@ import { marginPropDefs } from '../props/margin.props.js';
|
|
|
7
5
|
import type { MarginProps } from '../props/margin.props.js';
|
|
8
6
|
|
|
9
7
|
const marginValues = marginPropDefs.m.values;
|
|
8
|
+
const marginValueSet: ReadonlySet<string> = new Set(marginValues);
|
|
9
|
+
|
|
10
|
+
// Static table so the common case — a component with no margin props at all —
|
|
11
|
+
// is seven property reads and nothing else.
|
|
12
|
+
const MARGIN_PROPS: ReadonlyArray<{
|
|
13
|
+
key: keyof MarginProps;
|
|
14
|
+
className: string;
|
|
15
|
+
customProperties: `--${string}`[];
|
|
16
|
+
}> = [
|
|
17
|
+
{ key: 'm', className: 'rt-r-m', customProperties: ['--margin'] },
|
|
18
|
+
{ key: 'mx', className: 'rt-r-mx', customProperties: ['--margin-left', '--margin-right'] },
|
|
19
|
+
{ key: 'my', className: 'rt-r-my', customProperties: ['--margin-top', '--margin-bottom'] },
|
|
20
|
+
{ key: 'mt', className: 'rt-r-mt', customProperties: ['--margin-top'] },
|
|
21
|
+
{ key: 'mr', className: 'rt-r-mr', customProperties: ['--margin-right'] },
|
|
22
|
+
{ key: 'mb', className: 'rt-r-mb', customProperties: ['--margin-bottom'] },
|
|
23
|
+
{ key: 'ml', className: 'rt-r-ml', customProperties: ['--margin-left'] },
|
|
24
|
+
];
|
|
10
25
|
|
|
11
26
|
export function getMarginStyles(props: MarginProps) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const [mtClassNames, mtCustomProperties] = getResponsiveStyles({
|
|
34
|
-
className: 'rt-r-mt',
|
|
35
|
-
customProperties: ['--margin-top'],
|
|
36
|
-
propValues: marginValues,
|
|
37
|
-
value: props.mt,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const [mrClassNames, mrCustomProperties] = getResponsiveStyles({
|
|
41
|
-
className: 'rt-r-mr',
|
|
42
|
-
customProperties: ['--margin-right'],
|
|
43
|
-
propValues: marginValues,
|
|
44
|
-
value: props.mr,
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
const [mbClassNames, mbCustomProperties] = getResponsiveStyles({
|
|
48
|
-
className: 'rt-r-mb',
|
|
49
|
-
customProperties: ['--margin-bottom'],
|
|
50
|
-
propValues: marginValues,
|
|
51
|
-
value: props.mb,
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const [mlClassNames, mlCustomProperties] = getResponsiveStyles({
|
|
55
|
-
className: 'rt-r-ml',
|
|
56
|
-
customProperties: ['--margin-left'],
|
|
57
|
-
propValues: marginValues,
|
|
58
|
-
value: props.ml,
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
return [
|
|
62
|
-
classNames(
|
|
63
|
-
mClassNames,
|
|
64
|
-
mxClassNames,
|
|
65
|
-
myClassNames,
|
|
66
|
-
mtClassNames,
|
|
67
|
-
mrClassNames,
|
|
68
|
-
mbClassNames,
|
|
69
|
-
mlClassNames
|
|
70
|
-
),
|
|
71
|
-
mergeStyles(
|
|
72
|
-
mCustomProperties,
|
|
73
|
-
mxCustomProperties,
|
|
74
|
-
myCustomProperties,
|
|
75
|
-
mtCustomProperties,
|
|
76
|
-
mrCustomProperties,
|
|
77
|
-
mbCustomProperties,
|
|
78
|
-
mlCustomProperties
|
|
79
|
-
),
|
|
80
|
-
] as const;
|
|
27
|
+
let classes: string[] | undefined;
|
|
28
|
+
let style: ReturnType<typeof mergeStyles>;
|
|
29
|
+
|
|
30
|
+
for (let i = 0; i < MARGIN_PROPS.length; i++) {
|
|
31
|
+
const { key, className, customProperties } = MARGIN_PROPS[i];
|
|
32
|
+
const value = props[key];
|
|
33
|
+
if (value === undefined) continue;
|
|
34
|
+
|
|
35
|
+
const [propClassNames, propCustomProperties] = getResponsiveStyles({
|
|
36
|
+
className,
|
|
37
|
+
customProperties,
|
|
38
|
+
propValues: marginValues,
|
|
39
|
+
propValueSet: marginValueSet,
|
|
40
|
+
value,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
if (propClassNames) (classes ??= []).push(propClassNames);
|
|
44
|
+
if (propCustomProperties) style = mergeStyles(style, propCustomProperties);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return [classes !== undefined ? classes.join(' ') : '', style] as const;
|
|
81
48
|
}
|
|
@@ -4,11 +4,21 @@ import { isResponsiveObject } from './is-responsive-object.js';
|
|
|
4
4
|
|
|
5
5
|
import type { Responsive, Union } from '../props/prop-def.js';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Membership test against a prop def's enum values. Callers that already hold a
|
|
9
|
+
* compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call
|
|
10
|
+
* sites that build options inline fall back to scanning the array.
|
|
11
|
+
*/
|
|
12
|
+
function includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {
|
|
13
|
+
return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);
|
|
14
|
+
}
|
|
15
|
+
|
|
7
16
|
interface GetResponsiveStylesOptions {
|
|
8
17
|
className: string;
|
|
9
18
|
customProperties: `--${string}`[];
|
|
10
19
|
value: Responsive<Union> | Responsive<string> | undefined;
|
|
11
20
|
propValues: string[] | readonly string[];
|
|
21
|
+
propValueSet?: ReadonlySet<string>;
|
|
12
22
|
parseValue?: (value: string) => string | undefined;
|
|
13
23
|
}
|
|
14
24
|
|
|
@@ -28,28 +38,25 @@ interface GetResponsiveClassNamesOptions {
|
|
|
28
38
|
className: string;
|
|
29
39
|
value: Responsive<Union> | Responsive<string> | undefined;
|
|
30
40
|
propValues: string[] | readonly string[];
|
|
41
|
+
propValueSet?: ReadonlySet<string>;
|
|
31
42
|
parseValue?: (value: string) => string | undefined;
|
|
32
43
|
}
|
|
33
44
|
|
|
34
|
-
function getResponsiveClassNames({
|
|
35
|
-
allowArbitraryValues,
|
|
36
|
-
value,
|
|
37
|
-
className,
|
|
38
|
-
propValues,
|
|
39
|
-
parseValue = (value) => value,
|
|
40
|
-
}: GetResponsiveClassNamesOptions): string | undefined {
|
|
41
|
-
const classNames: string[] = [];
|
|
42
|
-
|
|
45
|
+
function getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {
|
|
43
46
|
if (!value) {
|
|
44
47
|
return undefined;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
|
-
if (typeof value === 'string'
|
|
48
|
-
|
|
50
|
+
if (typeof value === 'string') {
|
|
51
|
+
if (includesValue(propValues, propValueSet, value)) {
|
|
52
|
+
return getBaseClassName(className, value, parseValue);
|
|
53
|
+
}
|
|
54
|
+
return allowArbitraryValues ? className : undefined;
|
|
49
55
|
}
|
|
50
56
|
|
|
51
57
|
if (isResponsiveObject(value)) {
|
|
52
58
|
const object = value;
|
|
59
|
+
const classNames: string[] = [];
|
|
53
60
|
|
|
54
61
|
for (const bp in object) {
|
|
55
62
|
// Make sure we are not iterating over keys that aren't breakpoints
|
|
@@ -60,7 +67,7 @@ function getResponsiveClassNames({
|
|
|
60
67
|
const value = object[bp];
|
|
61
68
|
|
|
62
69
|
if (value !== undefined) {
|
|
63
|
-
if (propValues
|
|
70
|
+
if (includesValue(propValues, propValueSet, value)) {
|
|
64
71
|
const baseClassName = getBaseClassName(className, value, parseValue);
|
|
65
72
|
const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;
|
|
66
73
|
classNames.push(bpClassName);
|
|
@@ -71,7 +78,7 @@ function getResponsiveClassNames({
|
|
|
71
78
|
}
|
|
72
79
|
}
|
|
73
80
|
|
|
74
|
-
return classNames.join(' ');
|
|
81
|
+
return classNames.length > 0 ? classNames.join(' ') : '';
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
if (allowArbitraryValues) {
|
|
@@ -79,11 +86,7 @@ function getResponsiveClassNames({
|
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
|
|
82
|
-
function getBaseClassName(
|
|
83
|
-
className: string,
|
|
84
|
-
value: string,
|
|
85
|
-
parseValue: (value: string) => string | undefined
|
|
86
|
-
): string {
|
|
89
|
+
function getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {
|
|
87
90
|
const delimiter = className ? '-' : '';
|
|
88
91
|
const matchedValue = parseValue(value);
|
|
89
92
|
const isNegative = matchedValue?.startsWith('-');
|
|
@@ -96,24 +99,25 @@ interface GetResponsiveCustomPropertiesOptions {
|
|
|
96
99
|
customProperties: `--${string}`[];
|
|
97
100
|
value: Responsive<Union> | Responsive<string> | undefined;
|
|
98
101
|
propValues: string[] | readonly string[];
|
|
102
|
+
propValueSet?: ReadonlySet<string>;
|
|
99
103
|
parseValue?: (value: string) => string | undefined;
|
|
100
104
|
}
|
|
101
105
|
|
|
102
|
-
function getResponsiveCustomProperties({
|
|
103
|
-
customProperties,
|
|
104
|
-
value,
|
|
105
|
-
propValues,
|
|
106
|
-
parseValue = (value) => value,
|
|
107
|
-
}: GetResponsiveCustomPropertiesOptions) {
|
|
108
|
-
let styles: Record<string, string | undefined> = {};
|
|
109
|
-
|
|
106
|
+
function getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {
|
|
110
107
|
// Don't generate custom properties if the value is not arbitrary
|
|
111
|
-
if (!value || (typeof value === 'string' && propValues
|
|
108
|
+
if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {
|
|
112
109
|
return undefined;
|
|
113
110
|
}
|
|
114
111
|
|
|
112
|
+
let styles: Record<string, string | undefined> | undefined;
|
|
113
|
+
|
|
115
114
|
if (typeof value === 'string') {
|
|
116
|
-
|
|
115
|
+
const parsed = parseValue(value);
|
|
116
|
+
styles = {};
|
|
117
|
+
for (const customProperty of customProperties) {
|
|
118
|
+
styles[customProperty] = parsed;
|
|
119
|
+
}
|
|
120
|
+
return styles;
|
|
117
121
|
}
|
|
118
122
|
|
|
119
123
|
if (isResponsiveObject(value)) {
|
|
@@ -128,25 +132,20 @@ function getResponsiveCustomProperties({
|
|
|
128
132
|
const value = object[bp];
|
|
129
133
|
|
|
130
134
|
// Don't generate a custom property if the value is not arbitrary
|
|
131
|
-
if (propValues
|
|
135
|
+
if (value === undefined || includesValue(propValues, propValueSet, value)) {
|
|
132
136
|
continue;
|
|
133
137
|
}
|
|
134
138
|
|
|
139
|
+
const parsed = parseValue(value);
|
|
140
|
+
styles ??= {};
|
|
135
141
|
for (const customProperty of customProperties) {
|
|
136
142
|
const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;
|
|
137
|
-
styles[bpProperty] =
|
|
143
|
+
styles[bpProperty] = parsed;
|
|
138
144
|
}
|
|
139
145
|
}
|
|
140
146
|
}
|
|
141
147
|
|
|
142
|
-
|
|
143
|
-
const value = styles[key];
|
|
144
|
-
if (value !== undefined) {
|
|
145
|
-
styles[key] = parseValue(value);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return styles;
|
|
148
|
+
return styles ?? {};
|
|
150
149
|
}
|
|
151
150
|
|
|
152
151
|
export { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
const PANEL_BACKGROUND_MESSAGE = 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.';
|
|
4
|
+
|
|
5
|
+
const warned = new Set<string>();
|
|
6
|
+
|
|
7
|
+
function warnOnce(message: string) {
|
|
8
|
+
if (warned.has(message)) return;
|
|
9
|
+
warned.add(message);
|
|
10
|
+
console.warn(message);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Warns, in development only, that `panelBackground` is deprecated.
|
|
15
|
+
*
|
|
16
|
+
* The `process.env.NODE_ENV` check is a compile-time constant, so a production
|
|
17
|
+
* bundle minifies the effect body away to an empty function instead of reading
|
|
18
|
+
* props and formatting a message per mounted component. The message is also
|
|
19
|
+
* logged once per session rather than once per component instance.
|
|
20
|
+
*/
|
|
21
|
+
export function useDeprecatedPanelBackgroundWarning(panelBackground: unknown) {
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
if (process.env.NODE_ENV === 'production') return;
|
|
24
|
+
if (panelBackground !== undefined) warnOnce(PANEL_BACKGROUND_MESSAGE);
|
|
25
|
+
}, [panelBackground]);
|
|
26
|
+
}
|