@womp/kookie-ui 0.25.0 → 0.25.2
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/components.css +19 -3
- 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/shell-bottom.js +1 -1
- package/dist/cjs/components/_internal/shell-bottom.js.map +3 -3
- package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js +1 -1
- package/dist/cjs/components/_internal/shell-inspector.js.map +3 -3
- package/dist/cjs/components/_internal/shell-resizable.d.ts +6 -0
- package/dist/cjs/components/_internal/shell-resizable.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-resizable.js +1 -1
- package/dist/cjs/components/_internal/shell-resizable.js.map +3 -3
- package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js.map +3 -3
- package/dist/cjs/components/accordion.js +1 -1
- package/dist/cjs/components/accordion.js.map +4 -4
- 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/button.js +1 -1
- package/dist/cjs/components/button.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 +1 -1
- package/dist/cjs/components/chatbar.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/chip.js +1 -1
- package/dist/cjs/components/chip.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/context-menu.js +1 -1
- package/dist/cjs/components/context-menu.js.map +4 -4
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +4 -4
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +4 -4
- package/dist/cjs/components/index.js +2 -2
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/components/message-scroller.js +1 -1
- package/dist/cjs/components/message-scroller.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/notice.js +1 -1
- package/dist/cjs/components/notice.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/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/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/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.d.ts.map +1 -1
- package/dist/cjs/components/sidebar.js +1 -1
- package/dist/cjs/components/sidebar.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/switch.js +1 -1
- package/dist/cjs/components/switch.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/theme.js +1 -1
- package/dist/cjs/components/theme.js.map +4 -4
- package/dist/cjs/components/toggle.js +1 -1
- package/dist/cjs/components/toggle.js.map +4 -4
- package/dist/cjs/components/toolbar.d.ts.map +1 -1
- 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/helpers/index.d.ts +1 -0
- package/dist/cjs/helpers/index.d.ts.map +1 -1
- package/dist/cjs/helpers/index.js +4 -4
- package/dist/cjs/helpers/index.js.map +3 -3
- package/dist/cjs/helpers/theme-size.d.ts +8 -30
- package/dist/cjs/helpers/theme-size.d.ts.map +1 -1
- package/dist/cjs/helpers/theme-size.js +1 -1
- package/dist/cjs/helpers/theme-size.js.map +3 -3
- package/dist/cjs/hooks/theme-size.d.ts +32 -0
- package/dist/cjs/hooks/theme-size.d.ts.map +1 -0
- package/dist/cjs/hooks/theme-size.js +3 -0
- package/dist/cjs/hooks/theme-size.js.map +7 -0
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/props/index.js +1 -1
- package/dist/cjs/props/index.js.map +4 -4
- package/dist/esm/chunk-3B25RLWX.js +3 -0
- package/dist/esm/chunk-3B25RLWX.js.map +7 -0
- package/dist/esm/{chunk-PF67GJ5D.js → chunk-3CY6H4TE.js} +2 -2
- package/dist/esm/chunk-3CY6H4TE.js.map +7 -0
- package/dist/esm/{chunk-2EXOL2BR.js → chunk-3L2MDOYC.js} +2 -2
- package/dist/esm/chunk-3L2MDOYC.js.map +7 -0
- package/dist/esm/{chunk-KNBSG2WA.js → chunk-5CFSNNYS.js} +2 -2
- package/dist/esm/chunk-5CFSNNYS.js.map +7 -0
- package/dist/esm/{chunk-4ABQ6CDI.js → chunk-5EBJOOXE.js} +2 -2
- package/dist/esm/chunk-5EBJOOXE.js.map +7 -0
- package/dist/esm/{chunk-E4EMG3RC.js → chunk-5L4DZ2D3.js} +2 -2
- package/dist/esm/chunk-5L4DZ2D3.js.map +7 -0
- package/dist/esm/chunk-5ON3XLRD.js +3 -0
- package/dist/esm/chunk-5ON3XLRD.js.map +7 -0
- package/dist/esm/{chunk-UZAS4PYM.js → chunk-5TJH35TF.js} +2 -2
- package/dist/esm/{chunk-GPQSC6GL.js → chunk-5XR5PTDR.js} +2 -2
- package/dist/esm/chunk-5XR5PTDR.js.map +7 -0
- package/dist/esm/{chunk-AOBY2OUZ.js → chunk-63MUJFVF.js} +2 -2
- package/dist/esm/chunk-63MUJFVF.js.map +7 -0
- package/dist/esm/chunk-6AUIIXXE.js +2 -0
- package/dist/esm/chunk-6AUIIXXE.js.map +7 -0
- package/dist/esm/{chunk-4Q5PUIDJ.js → chunk-6RJQ5LLP.js} +2 -2
- package/dist/esm/{chunk-YVZTQA2L.js → chunk-7B3XDZXZ.js} +2 -2
- package/dist/esm/chunk-7B3XDZXZ.js.map +7 -0
- package/dist/esm/{chunk-7IHBNDCE.js → chunk-7X7VWR3F.js} +2 -2
- package/dist/esm/chunk-7X7VWR3F.js.map +7 -0
- package/dist/esm/{chunk-45O3JZWQ.js → chunk-7XHE6TOA.js} +2 -2
- package/dist/esm/chunk-7XHE6TOA.js.map +7 -0
- package/dist/esm/chunk-AQ7VUGQQ.js +3 -0
- package/dist/esm/chunk-AQ7VUGQQ.js.map +7 -0
- package/dist/esm/{chunk-54HUG34P.js → chunk-BVFHJP5E.js} +2 -2
- package/dist/esm/chunk-BVFHJP5E.js.map +7 -0
- package/dist/esm/{chunk-CRCYUJMK.js → chunk-BXZSJKWA.js} +2 -2
- package/dist/esm/chunk-BXZSJKWA.js.map +7 -0
- package/dist/esm/{chunk-IQ2RMFOM.js → chunk-CQG4U5BR.js} +2 -2
- package/dist/esm/{chunk-YNCI5PY6.js → chunk-FPGBCCML.js} +2 -2
- package/dist/esm/chunk-FPGBCCML.js.map +7 -0
- package/dist/esm/{chunk-A7QRPXXB.js → chunk-HHSFAOIO.js} +2 -2
- package/dist/esm/chunk-HHSFAOIO.js.map +7 -0
- package/dist/esm/{chunk-NMQGDBLD.js → chunk-MQEWEAH5.js} +2 -2
- package/dist/esm/chunk-MQEWEAH5.js.map +7 -0
- package/dist/esm/{chunk-YIKLO2XL.js → chunk-N3QLHFHB.js} +2 -2
- package/dist/esm/chunk-N3QLHFHB.js.map +7 -0
- package/dist/esm/{chunk-LCG3JZ3C.js → chunk-N5H7C3PZ.js} +2 -2
- package/dist/esm/chunk-N5H7C3PZ.js.map +7 -0
- package/dist/esm/{chunk-N53NJCEM.js → chunk-OQWD63AI.js} +2 -2
- package/dist/esm/chunk-OQWD63AI.js.map +7 -0
- package/dist/esm/chunk-PCLO3ZZY.js +3 -0
- package/dist/esm/chunk-PCLO3ZZY.js.map +7 -0
- package/dist/esm/{chunk-2XZ7477Y.js → chunk-PZZJH2LR.js} +2 -2
- package/dist/esm/chunk-PZZJH2LR.js.map +7 -0
- package/dist/esm/chunk-QKCNGEX4.js +3 -0
- package/dist/esm/chunk-QKCNGEX4.js.map +7 -0
- package/dist/esm/{chunk-PPQ7URZL.js → chunk-R4PGFURL.js} +2 -2
- package/dist/esm/{chunk-UUQGOQ5H.js → chunk-RB5VHWAW.js} +2 -2
- package/dist/esm/chunk-RB5VHWAW.js.map +7 -0
- package/dist/esm/{chunk-AG2YETE6.js → chunk-VPRAXHLL.js} +2 -2
- package/dist/esm/chunk-VPRAXHLL.js.map +7 -0
- package/dist/esm/{chunk-7J7RPEPB.js → chunk-VRQEWMC6.js} +2 -2
- package/dist/esm/chunk-VRQEWMC6.js.map +7 -0
- package/dist/esm/{chunk-UFJGZUKK.js → chunk-W4MQ6TEK.js} +2 -2
- package/dist/esm/chunk-W4MQ6TEK.js.map +7 -0
- package/dist/esm/{chunk-3223MHQK.js → chunk-WJ4H2O2G.js} +2 -2
- package/dist/esm/chunk-WMODMXEU.js +3 -0
- package/dist/esm/chunk-WMODMXEU.js.map +7 -0
- package/dist/esm/{chunk-JZVLP2VF.js → chunk-XPVRXQSW.js} +2 -2
- package/dist/esm/chunk-XPVRXQSW.js.map +7 -0
- package/dist/esm/{chunk-BUZGRMDD.js → chunk-Y2BTPKK6.js} +2 -2
- package/dist/esm/chunk-YOSCUA6Z.js +3 -0
- package/dist/esm/chunk-YOSCUA6Z.js.map +7 -0
- package/dist/esm/{chunk-X272YV2E.js → chunk-Z563IAE3.js} +2 -2
- package/dist/esm/chunk-Z563IAE3.js.map +7 -0
- package/dist/esm/{chunk-GZ333J7L.js → chunk-ZDSY6CJL.js} +2 -2
- package/dist/esm/chunk-ZDSY6CJL.js.map +7 -0
- package/dist/esm/{chunk-ENAW44VE.js → chunk-ZYKJTNAT.js} +2 -2
- package/dist/esm/chunk-ZYKJTNAT.js.map +7 -0
- 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/shell-bottom.js +1 -1
- package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-inspector.js +1 -1
- package/dist/esm/components/_internal/shell-resizable.d.ts +6 -0
- package/dist/esm/components/_internal/shell-resizable.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-resizable.js +1 -1
- package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -1
- package/dist/esm/components/_internal/shell-sidebar.js +1 -1
- package/dist/esm/components/accordion.js +1 -1
- package/dist/esm/components/alert-dialog.js +1 -1
- package/dist/esm/components/avatar.js +1 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/card.js +1 -1
- package/dist/esm/components/chatbar.js +1 -1
- package/dist/esm/components/checkbox-group.js +1 -1
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/chip.js +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/message-scroller.js +1 -1
- package/dist/esm/components/navbar.js +1 -1
- package/dist/esm/components/notice.js +1 -1
- package/dist/esm/components/popover.js +1 -1
- package/dist/esm/components/radio-group.js +1 -1
- package/dist/esm/components/radio.js +1 -1
- package/dist/esm/components/segmented-control.js +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/sheet.js +1 -1
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/sidebar.d.ts.map +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/slider.js +1 -1
- package/dist/esm/components/switch.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/theme.js +1 -1
- package/dist/esm/components/toggle.js +1 -1
- package/dist/esm/components/toolbar.d.ts.map +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.d.ts.map +1 -1
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/helpers/index.js.map +4 -4
- package/dist/esm/helpers/theme-size.d.ts +8 -30
- package/dist/esm/helpers/theme-size.d.ts.map +1 -1
- package/dist/esm/helpers/theme-size.js +1 -1
- package/dist/esm/hooks/theme-size.d.ts +32 -0
- package/dist/esm/hooks/theme-size.d.ts.map +1 -0
- package/dist/esm/hooks/theme-size.js +3 -0
- package/dist/esm/hooks/theme-size.js.map +7 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/props/font-family.prop.js +1 -1
- package/dist/esm/props/font-family.prop.js.map +4 -4
- package/dist/esm/props/index.js +1 -1
- package/dist/esm/props/index.js.map +4 -4
- package/package.json +1 -1
- package/src/components/_internal/base-button.tsx +56 -42
- package/src/components/_internal/shell-inspector.tsx +3 -1
- package/src/components/_internal/shell-resizable.tsx +13 -0
- package/src/components/_internal/shell-sidebar.tsx +3 -1
- package/src/components/accordion.tsx +1 -1
- package/src/components/alert-dialog.tsx +1 -1
- package/src/components/avatar.tsx +1 -1
- package/src/components/card.tsx +1 -1
- package/src/components/chatbar.tsx +1 -1
- package/src/components/checkbox-group.tsx +1 -1
- package/src/components/checkbox.tsx +1 -1
- package/src/components/combobox.tsx +1 -1
- package/src/components/context-menu.tsx +1 -1
- package/src/components/dialog.tsx +1 -1
- package/src/components/dropdown-menu.tsx +1 -1
- package/src/components/navbar.tsx +1 -1
- package/src/components/notice.tsx +1 -1
- package/src/components/popover.css +4 -2
- package/src/components/popover.tsx +1 -1
- package/src/components/radio-group.tsx +1 -1
- package/src/components/radio.tsx +1 -1
- package/src/components/segmented-control.tsx +1 -1
- package/src/components/select.tsx +1 -1
- package/src/components/sheet.css +4 -2
- package/src/components/sheet.tsx +1 -1
- package/src/components/shell.css +7 -2
- package/src/components/shell.tsx +1 -1
- package/src/components/sidebar.css +10 -0
- package/src/components/sidebar.tsx +16 -1
- package/src/components/slider.tsx +1 -1
- package/src/components/switch.tsx +1 -1
- package/src/components/table.tsx +1 -1
- package/src/components/tabs.tsx +1 -1
- package/src/components/text-area.tsx +1 -1
- package/src/components/text-field.tsx +1 -1
- package/src/components/theme.tsx +1 -1
- package/src/components/toolbar.tsx +17 -8
- package/src/helpers/index.ts +3 -0
- package/src/helpers/theme-size.ts +8 -46
- package/src/hooks/theme-size.ts +50 -0
- package/src/styles/tokens/color.css +3 -0
- package/styles.css +21 -3
- package/tokens/base.css +2 -0
- package/tokens.css +2 -0
- package/dist/esm/chunk-2EXOL2BR.js.map +0 -7
- package/dist/esm/chunk-2IUGM657.js +0 -3
- package/dist/esm/chunk-2IUGM657.js.map +0 -7
- package/dist/esm/chunk-2XZ7477Y.js.map +0 -7
- package/dist/esm/chunk-3WZLXGUE.js +0 -3
- package/dist/esm/chunk-3WZLXGUE.js.map +0 -7
- package/dist/esm/chunk-3YLYGKFB.js +0 -2
- package/dist/esm/chunk-3YLYGKFB.js.map +0 -7
- package/dist/esm/chunk-45O3JZWQ.js.map +0 -7
- package/dist/esm/chunk-4ABQ6CDI.js.map +0 -7
- package/dist/esm/chunk-54HUG34P.js.map +0 -7
- package/dist/esm/chunk-7IHBNDCE.js.map +0 -7
- package/dist/esm/chunk-7J7RPEPB.js.map +0 -7
- package/dist/esm/chunk-A7QRPXXB.js.map +0 -7
- package/dist/esm/chunk-AG2YETE6.js.map +0 -7
- package/dist/esm/chunk-AOBY2OUZ.js.map +0 -7
- package/dist/esm/chunk-CRCYUJMK.js.map +0 -7
- package/dist/esm/chunk-DI7RUMLO.js +0 -3
- package/dist/esm/chunk-DI7RUMLO.js.map +0 -7
- package/dist/esm/chunk-E4EMG3RC.js.map +0 -7
- package/dist/esm/chunk-ENAW44VE.js.map +0 -7
- package/dist/esm/chunk-EVCQ6TG5.js +0 -3
- package/dist/esm/chunk-EVCQ6TG5.js.map +0 -7
- package/dist/esm/chunk-G32GSPNO.js +0 -3
- package/dist/esm/chunk-G32GSPNO.js.map +0 -7
- package/dist/esm/chunk-GPQSC6GL.js.map +0 -7
- package/dist/esm/chunk-GZ333J7L.js.map +0 -7
- package/dist/esm/chunk-JIF77MRB.js +0 -3
- package/dist/esm/chunk-JIF77MRB.js.map +0 -7
- package/dist/esm/chunk-JZVLP2VF.js.map +0 -7
- package/dist/esm/chunk-KNBSG2WA.js.map +0 -7
- package/dist/esm/chunk-LB2HB4NG.js +0 -3
- package/dist/esm/chunk-LB2HB4NG.js.map +0 -7
- package/dist/esm/chunk-LCG3JZ3C.js.map +0 -7
- package/dist/esm/chunk-N53NJCEM.js.map +0 -7
- package/dist/esm/chunk-NMQGDBLD.js.map +0 -7
- package/dist/esm/chunk-PF67GJ5D.js.map +0 -7
- package/dist/esm/chunk-UFJGZUKK.js.map +0 -7
- package/dist/esm/chunk-UUQGOQ5H.js.map +0 -7
- package/dist/esm/chunk-VCV7RACK.js +0 -2
- package/dist/esm/chunk-VCV7RACK.js.map +0 -7
- package/dist/esm/chunk-X272YV2E.js.map +0 -7
- package/dist/esm/chunk-YIKLO2XL.js.map +0 -7
- package/dist/esm/chunk-YNCI5PY6.js.map +0 -7
- package/dist/esm/chunk-YVZTQA2L.js.map +0 -7
- /package/dist/esm/{chunk-UZAS4PYM.js.map → chunk-5TJH35TF.js.map} +0 -0
- /package/dist/esm/{chunk-4Q5PUIDJ.js.map → chunk-6RJQ5LLP.js.map} +0 -0
- /package/dist/esm/{chunk-IQ2RMFOM.js.map → chunk-CQG4U5BR.js.map} +0 -0
- /package/dist/esm/{chunk-PPQ7URZL.js.map → chunk-R4PGFURL.js.map} +0 -0
- /package/dist/esm/{chunk-3223MHQK.js.map → chunk-WJ4H2O2G.js.map} +0 -0
- /package/dist/esm/{chunk-BUZGRMDD.js.map → chunk-Y2BTPKK6.js.map} +0 -0
|
@@ -23,7 +23,7 @@ import classNames from 'classnames';
|
|
|
23
23
|
|
|
24
24
|
import { Button } from './button.js';
|
|
25
25
|
import { Text } from './text.js';
|
|
26
|
-
import { ThemeSizeContext, useThemeSize } from '../
|
|
26
|
+
import { ThemeSizeContext, useThemeSize } from '../hooks/theme-size.js';
|
|
27
27
|
import { accentColorPropDef } from '../props/color.prop.js';
|
|
28
28
|
|
|
29
29
|
type NoticeSize = '1' | '2' | '3' | '4';
|
|
@@ -35,16 +35,18 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.kui-PopoverToolbarSection {
|
|
38
|
+
/* Each section owns a column on the one row, whichever sections are present and in any order. */
|
|
39
|
+
grid-row: 1;
|
|
38
40
|
display: flex;
|
|
39
41
|
align-items: center;
|
|
40
42
|
gap: var(--space-3);
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
.kui-PopoverToolbarLeft { justify-self: start; }
|
|
45
|
+
.kui-PopoverToolbarLeft { grid-column: 1; justify-self: start; }
|
|
44
46
|
|
|
45
47
|
.kui-PopoverToolbarCenter { grid-column: 2; justify-self: center; min-width: 0; text-align: center; }
|
|
46
48
|
|
|
47
|
-
.kui-PopoverToolbarRight { justify-self: end; }
|
|
49
|
+
.kui-PopoverToolbarRight { grid-column: 3; justify-self: end; }
|
|
48
50
|
|
|
49
51
|
.kui-PopoverToolbarTitle {
|
|
50
52
|
display: inline-block;
|
|
@@ -3,7 +3,7 @@ import classNames from 'classnames';
|
|
|
3
3
|
import { Popover as PopoverPrimitive } from 'radix-ui';
|
|
4
4
|
|
|
5
5
|
import { extractProps } from '../helpers/extract-props.js';
|
|
6
|
-
import { useThemeSizeProps } from '../
|
|
6
|
+
import { useThemeSizeProps } from '../hooks/theme-size.js';
|
|
7
7
|
import { requireReactElement } from '../helpers/require-react-element.js';
|
|
8
8
|
import { popoverContentPropDefs } from './popover.props.js';
|
|
9
9
|
import { Theme } from './theme.js';
|
|
@@ -8,7 +8,7 @@ import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
|
|
|
8
8
|
import { radioGroupRootPropDefs } from './radio-group.props.js';
|
|
9
9
|
import { Text } from './text.js';
|
|
10
10
|
import { extractProps } from '../helpers/extract-props.js';
|
|
11
|
-
import { useThemeSize } from '../
|
|
11
|
+
import { useThemeSize } from '../hooks/theme-size.js';
|
|
12
12
|
|
|
13
13
|
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
14
14
|
import type { GetPropDefTypes } from '../props/prop-def.js';
|
package/src/components/radio.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import { composeEventHandlers } from 'radix-ui/internal';
|
|
|
6
6
|
|
|
7
7
|
import { radioPropDefs } from './radio.props.js';
|
|
8
8
|
import { extractProps } from '../helpers/extract-props.js';
|
|
9
|
-
import { useThemeSizeProps } from '../
|
|
9
|
+
import { useThemeSizeProps } from '../hooks/theme-size.js';
|
|
10
10
|
|
|
11
11
|
import type { ComponentPropsWithout } from '../helpers/component-props.js';
|
|
12
12
|
import type { NotInputRadioAttributes } from '../helpers/input-attributes.js';
|
|
@@ -7,7 +7,7 @@ import { useComposedRefs, useControllableState, useLayoutEffect } from 'radix-ui
|
|
|
7
7
|
|
|
8
8
|
import { segmentedControlRootPropDefs } from './segmented-control.props.js';
|
|
9
9
|
import { extractProps } from '../helpers/extract-props.js';
|
|
10
|
-
import { useThemeSizeProps } from '../
|
|
10
|
+
import { useThemeSizeProps } from '../hooks/theme-size.js';
|
|
11
11
|
|
|
12
12
|
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
13
13
|
import type { GetPropDefTypes } from '../props/prop-def.js';
|
|
@@ -5,7 +5,7 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { Select as SelectPrimitive, ScrollArea as ScrollAreaPrimitive } from 'radix-ui';
|
|
6
6
|
|
|
7
7
|
import { extractProps } from '../helpers/extract-props.js';
|
|
8
|
-
import { useThemeSize } from '../
|
|
8
|
+
import { useThemeSize } from '../hooks/theme-size.js';
|
|
9
9
|
import { ChevronDownIcon, ThickCheckIcon } from './icons.js';
|
|
10
10
|
import { Spinner } from './spinner.js';
|
|
11
11
|
import {
|
package/src/components/sheet.css
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
:where(
|
|
1
|
+
/* The class sits outside :where() so the 90vw default outranks the dialog's width: 100% in
|
|
2
|
+
base-dialog.css (same weight, later in the cascade). The width prop sets --width. */
|
|
3
|
+
.kui-SheetContent {
|
|
2
4
|
position: fixed !important;
|
|
3
5
|
/* Use physical properties to integrate with width/height responsive utilities */
|
|
4
6
|
width: var(--width, 90vw);
|
|
@@ -11,7 +13,7 @@
|
|
|
11
13
|
|
|
12
14
|
/* iOS dynamic viewport height - accounts for browser chrome */
|
|
13
15
|
@supports (height: 100dvh) {
|
|
14
|
-
|
|
16
|
+
.kui-SheetContent {
|
|
15
17
|
height: 100dvh;
|
|
16
18
|
max-height: 100dvh;
|
|
17
19
|
}
|
package/src/components/sheet.tsx
CHANGED
|
@@ -42,7 +42,7 @@ import { Theme } from './theme.js';
|
|
|
42
42
|
import { Heading } from './heading.js';
|
|
43
43
|
import { Text } from './text.js';
|
|
44
44
|
import { extractProps } from '../helpers/extract-props.js';
|
|
45
|
-
import { useThemeSizeProps } from '../
|
|
45
|
+
import { useThemeSizeProps } from '../hooks/theme-size.js';
|
|
46
46
|
import { requireReactElement } from '../helpers/require-react-element.js';
|
|
47
47
|
import { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';
|
|
48
48
|
|
package/src/components/shell.css
CHANGED
|
@@ -249,13 +249,18 @@
|
|
|
249
249
|
z-index: 1;
|
|
250
250
|
pointer-events: none;
|
|
251
251
|
|
|
252
|
-
& > :where(*)
|
|
253
|
-
& > :where(.kui-Toolbar) > :where(*) {
|
|
252
|
+
& > :where(*) {
|
|
254
253
|
pointer-events: auto;
|
|
255
254
|
}
|
|
255
|
+
/* A Toolbar spans the row, and so may a cluster inside it. pointer-events inherits, so the
|
|
256
|
+
Toolbar passes clicks through and only its controls and groups take them back: the empty
|
|
257
|
+
stretch between them lets clicks reach the content. */
|
|
256
258
|
& > :where(.kui-Toolbar) {
|
|
257
259
|
pointer-events: none;
|
|
258
260
|
}
|
|
261
|
+
& > :where(.kui-Toolbar) :where(.kui-ToolbarGroup, .kui-BaseButton, .kui-TextFieldRoot, .kui-SelectTrigger, .kui-SegmentedControlRoot, [href], [tabindex]) {
|
|
262
|
+
pointer-events: auto;
|
|
263
|
+
}
|
|
259
264
|
}
|
|
260
265
|
.kui-ShellPaneHeader[data-float] {
|
|
261
266
|
top: 0;
|
package/src/components/shell.tsx
CHANGED
|
@@ -51,7 +51,7 @@ import { navigationRest, detailRest, toPaneValue, startAnchoredGrowth, withoutRe
|
|
|
51
51
|
import { useShell, useSidebarMode } from './shell.context.js';
|
|
52
52
|
import { useResponsivePresentation } from './shell.hooks.js';
|
|
53
53
|
import { readBreakpoint } from '../hooks/use-breakpoint.js';
|
|
54
|
-
import { useThemeSize } from '../
|
|
54
|
+
import { useThemeSize } from '../hooks/theme-size.js';
|
|
55
55
|
import { PaneChromeScope, PaneFooter, PaneHeader, Scroll, ShellContentContext, ShellSizeContext } from './_internal/pane-chrome.js';
|
|
56
56
|
import type { PaneSize, PaneHeaderProps, PaneFooterProps, ScrollProps } from './_internal/pane-chrome.js';
|
|
57
57
|
import type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps, PaneMode, PaneName, PaneTarget, ResponsivePresentation, SidebarMode } from './shell.types.js';
|
|
@@ -337,6 +337,11 @@
|
|
|
337
337
|
& :where(.kui-SidebarMenuButton) {
|
|
338
338
|
flex: 1;
|
|
339
339
|
}
|
|
340
|
+
|
|
341
|
+
/* A Toolbar fills the header, so its leading and trailing groups sit at the two ends. */
|
|
342
|
+
& > :where(.kui-Toolbar) {
|
|
343
|
+
flex: 1;
|
|
344
|
+
}
|
|
340
345
|
}
|
|
341
346
|
|
|
342
347
|
.kui-SidebarFooter:where(.kui-SidebarFooter--container) {
|
|
@@ -351,6 +356,11 @@
|
|
|
351
356
|
& :where(.kui-SidebarMenuButton) {
|
|
352
357
|
flex: 1;
|
|
353
358
|
}
|
|
359
|
+
|
|
360
|
+
/* A Toolbar fills the footer, so its leading and trailing groups sit at the two ends. */
|
|
361
|
+
& > :where(.kui-Toolbar) {
|
|
362
|
+
flex: 1;
|
|
363
|
+
}
|
|
354
364
|
}
|
|
355
365
|
|
|
356
366
|
/* Header/Footer Menu Button Support */
|
|
@@ -333,6 +333,18 @@ function toDropdownItem(node: React.ReactNode, key: React.Key): React.ReactNode
|
|
|
333
333
|
return <DropdownMenu.Item key={key}>{node}</DropdownMenu.Item>;
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
+
// The sub-list is a <ul>, so each row needs its own <li>. A MenuButton written straight into
|
|
337
|
+
// MenuSubContent gets a MenuItem around it, rather than leaving an <a> or <button> in the list.
|
|
338
|
+
function wrapBareMenuButtons(children: React.ReactNode): React.ReactNode {
|
|
339
|
+
return React.Children.map(children, (child, index) =>
|
|
340
|
+
React.isValidElement(child) && child.type === SidebarMenuButton ? (
|
|
341
|
+
<SidebarMenuItem key={child.key ?? index}>{child}</SidebarMenuItem>
|
|
342
|
+
) : (
|
|
343
|
+
child
|
|
344
|
+
),
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
|
|
336
348
|
const SidebarMenuSubContent = React.forwardRef<React.ElementRef<typeof Accordion.Content>, SidebarMenuSubContentProps>(({ className, children, ...props }, forwardedRef) => {
|
|
337
349
|
const visual = useSidebarVisual();
|
|
338
350
|
const mode = React.useContext(SidebarSubMenuModeContext);
|
|
@@ -360,7 +372,7 @@ const SidebarMenuSubContent = React.forwardRef<React.ElementRef<typeof Accordion
|
|
|
360
372
|
|
|
361
373
|
return (
|
|
362
374
|
<Accordion.Content {...props} ref={forwardedRef} className={classNames('kui-SidebarMenuSubContent', className)}>
|
|
363
|
-
<ul className="kui-SidebarMenuSubList">{children}</ul>
|
|
375
|
+
<ul className="kui-SidebarMenuSubList">{wrapBareMenuButtons(children)}</ul>
|
|
364
376
|
</Accordion.Content>
|
|
365
377
|
);
|
|
366
378
|
});
|
|
@@ -473,6 +485,9 @@ const SidebarSearch = React.forwardRef<HTMLDivElement, SidebarSearchProps>(
|
|
|
473
485
|
// Arrow key navigation within the popover (input ↔ results)
|
|
474
486
|
const handlePopoverKeyDown = React.useCallback(
|
|
475
487
|
(e: React.KeyboardEvent<HTMLDivElement>) => {
|
|
488
|
+
// A result row already moved focus with its own arrow handling (focusAdjacentSidebarButton
|
|
489
|
+
// scopes to this popover); moving again would skip a row.
|
|
490
|
+
if (e.defaultPrevented) return;
|
|
476
491
|
const container = popoverRef.current;
|
|
477
492
|
if (!container) return;
|
|
478
493
|
|
|
@@ -4,7 +4,7 @@ import { Direction, Slider as SliderPrimitive } from 'radix-ui';
|
|
|
4
4
|
|
|
5
5
|
import { sliderPropDefs } from './slider.props.js';
|
|
6
6
|
import { extractProps } from '../helpers/extract-props.js';
|
|
7
|
-
import { useThemeSizeProps } from '../
|
|
7
|
+
import { useThemeSizeProps } from '../hooks/theme-size.js';
|
|
8
8
|
|
|
9
9
|
import type { ComponentPropsWithout } from '../helpers/component-props.js';
|
|
10
10
|
import type { GetPropDefTypes } from '../props/prop-def.js';
|
|
@@ -3,7 +3,7 @@ import classNames from 'classnames';
|
|
|
3
3
|
import { Switch as SwitchPrimitive } from 'radix-ui';
|
|
4
4
|
|
|
5
5
|
import { extractProps } from '../helpers/extract-props.js';
|
|
6
|
-
import { useThemeSizeProps } from '../
|
|
6
|
+
import { useThemeSizeProps } from '../hooks/theme-size.js';
|
|
7
7
|
import { switchPropDefs } from './switch.props.js';
|
|
8
8
|
|
|
9
9
|
import type { GetPropDefTypes } from '../props/prop-def.js';
|
package/src/components/table.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import classNames from 'classnames';
|
|
|
3
3
|
|
|
4
4
|
import { tableRootPropDefs, tableRowPropDefs, tableCellPropDefs } from './table.props.js';
|
|
5
5
|
import { extractProps } from '../helpers/extract-props.js';
|
|
6
|
-
import { useThemeSizeProps } from '../
|
|
6
|
+
import { useThemeSizeProps } from '../hooks/theme-size.js';
|
|
7
7
|
import { getResponsiveClassNames } from '../helpers/get-responsive-styles.js';
|
|
8
8
|
import { ScrollArea } from './scroll-area.js';
|
|
9
9
|
|
package/src/components/tabs.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { Tabs as TabsPrimitive } from 'radix-ui';
|
|
|
4
4
|
|
|
5
5
|
import { tabsListPropDefs } from './tabs.props.js';
|
|
6
6
|
import { extractProps } from '../helpers/extract-props.js';
|
|
7
|
-
import { useThemeSizeProps } from '../
|
|
7
|
+
import { useThemeSizeProps } from '../hooks/theme-size.js';
|
|
8
8
|
|
|
9
9
|
import type { tabsContentPropDefs, tabsRootPropDefs } from './tabs.props.js';
|
|
10
10
|
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
@@ -3,7 +3,7 @@ import classNames from 'classnames';
|
|
|
3
3
|
|
|
4
4
|
import { textAreaPropDefs } from './text-area.props.js';
|
|
5
5
|
import { extractProps } from '../helpers/extract-props.js';
|
|
6
|
-
import { useThemeSizeProps } from '../
|
|
6
|
+
import { useThemeSizeProps } from '../hooks/theme-size.js';
|
|
7
7
|
|
|
8
8
|
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
9
9
|
import type { GetPropDefTypes } from '../props/prop-def.js';
|
|
@@ -7,7 +7,7 @@ import { composeEventHandlers, composeRefs } from 'radix-ui/internal';
|
|
|
7
7
|
|
|
8
8
|
import { textFieldRootPropDefs, textFieldSlotPropDefs, type TextFieldSlotScrubProps } from './text-field.props.js';
|
|
9
9
|
import { extractProps } from '../helpers/extract-props.js';
|
|
10
|
-
import { useThemeSizeProps } from '../
|
|
10
|
+
import { useThemeSizeProps } from '../hooks/theme-size.js';
|
|
11
11
|
|
|
12
12
|
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
13
13
|
import type { NotInputTextualAttributes } from '../helpers/input-attributes.js';
|
package/src/components/theme.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { Direction, Slot } from 'radix-ui';
|
|
6
6
|
|
|
7
7
|
import { getMatchingGrayColor } from '../helpers/get-matching-gray-color.js';
|
|
8
|
-
import { ThemeSizeContext } from '../
|
|
8
|
+
import { ThemeSizeContext } from '../hooks/theme-size.js';
|
|
9
9
|
import { usePropSyncedState } from '../hooks/use-prop-synced-state.js';
|
|
10
10
|
import { themePropDefs } from './theme.props.js';
|
|
11
11
|
|
|
@@ -10,7 +10,7 @@ import { Button } from './button.js';
|
|
|
10
10
|
import * as DropdownMenu from './dropdown-menu.js';
|
|
11
11
|
import { Text } from './text.js';
|
|
12
12
|
import { extractProps } from '../helpers/extract-props.js';
|
|
13
|
-
import { useThemeSize } from '../
|
|
13
|
+
import { useThemeSize } from '../hooks/theme-size.js';
|
|
14
14
|
import { layoutPropDefs } from '../props/layout.props.js';
|
|
15
15
|
import { usePaneBandSize } from './_internal/pane-chrome.js';
|
|
16
16
|
|
|
@@ -197,6 +197,9 @@ type ToolbarIconButtonProps = Omit<ToolbarButtonBaseProps, 'aria-label' | 'aria-
|
|
|
197
197
|
|
|
198
198
|
type ToolbarButtonProps = ToolbarTextButtonProps | ToolbarIconButtonProps;
|
|
199
199
|
|
|
200
|
+
/** The plain DOM props, besides handlers, ARIA and data attributes, a menu row takes from a ToolbarButton. */
|
|
201
|
+
const OVERFLOW_ITEM_KEYS = new Set(['id', 'className', 'style', 'title']);
|
|
202
|
+
|
|
200
203
|
function isPressed(value: React.AriaAttributes['aria-pressed']) {
|
|
201
204
|
return value === true || value === 'true';
|
|
202
205
|
}
|
|
@@ -231,15 +234,21 @@ const ToolbarButton = React.forwardRef<HTMLButtonElement, ToolbarButtonProps>((p
|
|
|
231
234
|
const off = disabled || group?.disabled || undefined;
|
|
232
235
|
|
|
233
236
|
if (overflow) {
|
|
237
|
+
// Only what a menu row means comes across: handlers, ARIA, data attributes, id, class and
|
|
238
|
+
// style. Button's box props (size, loading, tooltip, fullWidth and the rest) would land on the
|
|
239
|
+
// DOM as unknown attributes. A wrapping menu trigger hands its open handlers (onPointerDown,
|
|
240
|
+
// onKeyDown), aria-expanded/haspopup/controls and data-state in through these, so it still
|
|
241
|
+
// opens from the row.
|
|
242
|
+
const passed: Record<string, unknown> = {};
|
|
243
|
+
for (const key of Object.keys(rest)) {
|
|
244
|
+
if (/^on[A-Z]/.test(key) || key.startsWith('aria-') || key.startsWith('data-') || OVERFLOW_ITEM_KEYS.has(key)) {
|
|
245
|
+
passed[key] = (rest as Record<string, unknown>)[key];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
if (onKeyDown) passed.onKeyDown = onKeyDown;
|
|
234
249
|
return (
|
|
235
250
|
<ToolbarOverflowItem
|
|
236
|
-
|
|
237
|
-
// tooltip, fullWidth and the rest) would land on the DOM as unknown attributes.
|
|
238
|
-
id={rest.id}
|
|
239
|
-
className={rest.className}
|
|
240
|
-
style={rest.style}
|
|
241
|
-
onClick={rest.onClick as React.MouseEventHandler<HTMLDivElement> | undefined}
|
|
242
|
-
aria-label={rest['aria-label']}
|
|
251
|
+
{...(passed as React.ComponentPropsWithoutRef<'div'>)}
|
|
243
252
|
ref={forwardedRef as unknown as React.Ref<HTMLDivElement>}
|
|
244
253
|
asChild={asChild}
|
|
245
254
|
iconOnly={iconOnly}
|
package/src/helpers/index.ts
CHANGED
|
@@ -14,3 +14,6 @@ export * from './merge-styles.js';
|
|
|
14
14
|
export * from './normalize-to-px.js';
|
|
15
15
|
export * from './require-react-element.js';
|
|
16
16
|
export * from './theme-size.js';
|
|
17
|
+
// The context and its hooks are client code. The server-safe build keeps this import external, so
|
|
18
|
+
// `/helpers` shares the one context the components read and stays loadable from a server component.
|
|
19
|
+
export { ThemeSizeContext, useThemeSize, useThemeSizeProps } from '../hooks/theme-size.js';
|
|
@@ -1,26 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The pure half of the theme size: the type, the default and the clamp. Server-safe.
|
|
3
|
+
*
|
|
4
|
+
* The context and the hooks that read it live in `hooks/theme-size.ts`, a client module, so there
|
|
5
|
+
* is one `ThemeSizeContext` and importing `/helpers` from a server component does not call
|
|
6
|
+
* `createContext`.
|
|
7
|
+
*/
|
|
4
8
|
|
|
5
9
|
type ThemeSize = '1' | '2' | '3' | '4';
|
|
6
10
|
|
|
7
11
|
/** The rest of the 1-4 index when no Theme states a size. */
|
|
8
12
|
const THEME_SIZE_DEFAULT: ThemeSize = '2';
|
|
9
13
|
|
|
10
|
-
/**
|
|
11
|
-
* The app-wide size index, provided by `Theme` beside `ThemeContext`.
|
|
12
|
-
*
|
|
13
|
-
* It is its own context, holding one string, so a component that only needs
|
|
14
|
-
* the size does not re-render when the accent colour or appearance changes.
|
|
15
|
-
*/
|
|
16
|
-
const ThemeSizeContext = React.createContext<ThemeSize>(THEME_SIZE_DEFAULT);
|
|
17
|
-
ThemeSizeContext.displayName = 'ThemeSizeContext';
|
|
18
|
-
|
|
19
|
-
interface SizePropDef {
|
|
20
|
-
values: readonly string[];
|
|
21
|
-
default?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
14
|
/**
|
|
25
15
|
* Maps the theme size onto a component's own range: the value itself when the
|
|
26
16
|
* component has it, otherwise the nearest end of the range (`4` on a 1-3 scale
|
|
@@ -41,33 +31,5 @@ function clampSize(size: ThemeSize, values: readonly string[]): string {
|
|
|
41
31
|
return nearest;
|
|
42
32
|
}
|
|
43
33
|
|
|
44
|
-
|
|
45
|
-
* The size a component on the 1-4 index takes: what the caller said, else the
|
|
46
|
-
* nearest Theme's size, mapped into the component's range.
|
|
47
|
-
*/
|
|
48
|
-
function useThemeSize<V>(explicit: V | undefined, propDef: SizePropDef): V {
|
|
49
|
-
const themeSize = React.useContext(ThemeSizeContext);
|
|
50
|
-
if (explicit !== undefined) return explicit;
|
|
51
|
-
// The clamped value is one of `propDef.values`, which is what `V` ranges over.
|
|
52
|
-
return clampSize(themeSize, propDef.values) as V;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Fills `size` from the nearest Theme when the caller left it unset, so the
|
|
57
|
-
* result can go straight into `extractProps`. An explicit size, responsive
|
|
58
|
-
* object included, wins.
|
|
59
|
-
*
|
|
60
|
-
* Returns the same props object when there is nothing to fill: when a size is
|
|
61
|
-
* set, or when the theme size resolves to the prop def's own default (the
|
|
62
|
-
* common case, a Theme with no size), so `extractProps` applies it as before.
|
|
63
|
-
*/
|
|
64
|
-
function useThemeSizeProps<P extends { size?: unknown }>(props: P, propDef: SizePropDef): P {
|
|
65
|
-
const themeSize = React.useContext(ThemeSizeContext);
|
|
66
|
-
if (props.size !== undefined) return props;
|
|
67
|
-
const size = clampSize(themeSize, propDef.values);
|
|
68
|
-
if (size === propDef.default) return props;
|
|
69
|
-
return { ...props, size };
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export { ThemeSizeContext, THEME_SIZE_DEFAULT, clampSize, useThemeSize, useThemeSizeProps };
|
|
34
|
+
export { THEME_SIZE_DEFAULT, clampSize };
|
|
73
35
|
export type { ThemeSize };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
import { THEME_SIZE_DEFAULT, clampSize } from '../helpers/theme-size.js';
|
|
6
|
+
import type { ThemeSize } from '../helpers/theme-size.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The app-wide size index, provided by `Theme` beside `ThemeContext`.
|
|
10
|
+
*
|
|
11
|
+
* It is its own context, holding one string, so a component that only needs
|
|
12
|
+
* the size does not re-render when the accent colour or appearance changes.
|
|
13
|
+
*/
|
|
14
|
+
const ThemeSizeContext = React.createContext<ThemeSize>(THEME_SIZE_DEFAULT);
|
|
15
|
+
ThemeSizeContext.displayName = 'ThemeSizeContext';
|
|
16
|
+
|
|
17
|
+
interface SizePropDef {
|
|
18
|
+
values: readonly string[];
|
|
19
|
+
default?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The size a component on the 1-4 index takes: what the caller said, else the
|
|
24
|
+
* nearest Theme's size, mapped into the component's range.
|
|
25
|
+
*/
|
|
26
|
+
function useThemeSize<V>(explicit: V | undefined, propDef: SizePropDef): V {
|
|
27
|
+
const themeSize = React.useContext(ThemeSizeContext);
|
|
28
|
+
if (explicit !== undefined) return explicit;
|
|
29
|
+
// The clamped value is one of `propDef.values`, which is what `V` ranges over.
|
|
30
|
+
return clampSize(themeSize, propDef.values) as V;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Fills `size` from the nearest Theme when the caller left it unset, so the
|
|
35
|
+
* result can go straight into `extractProps`. An explicit size, responsive
|
|
36
|
+
* object included, wins.
|
|
37
|
+
*
|
|
38
|
+
* Returns the same props object when there is nothing to fill: when a size is
|
|
39
|
+
* set, or when the theme size resolves to the prop def's own default (the
|
|
40
|
+
* common case, a Theme with no size), so `extractProps` applies it as before.
|
|
41
|
+
*/
|
|
42
|
+
function useThemeSizeProps<P extends { size?: unknown }>(props: P, propDef: SizePropDef): P {
|
|
43
|
+
const themeSize = React.useContext(ThemeSizeContext);
|
|
44
|
+
if (props.size !== undefined) return props;
|
|
45
|
+
const size = clampSize(themeSize, propDef.values);
|
|
46
|
+
if (size === propDef.default) return props;
|
|
47
|
+
return { ...props, size };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { ThemeSizeContext, useThemeSize, useThemeSizeProps };
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
--color-page: white;
|
|
9
9
|
--color-overlay: var(--black-a6);
|
|
10
10
|
--color-surface: white;
|
|
11
|
+
/* The ground a raised surface sits on: one step below it, so a white card reads as lifted. */
|
|
12
|
+
--color-ground: var(--neutral-1, var(--gray-1));
|
|
11
13
|
|
|
12
14
|
/*
|
|
13
15
|
* The neutral scale, named as in v2. It defaults to the plain gray palette; a Theme grayColor
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
--color-page: var(--neutral-1, var(--gray-1));
|
|
50
52
|
--color-overlay: var(--black-a8);
|
|
51
53
|
--color-surface: var(--neutral-2, var(--gray-2));
|
|
54
|
+
--color-ground: var(--neutral-1, var(--gray-1));
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
/* */
|
package/styles.css
CHANGED
|
@@ -3377,6 +3377,7 @@
|
|
|
3377
3377
|
--color-page: white;
|
|
3378
3378
|
--color-overlay: var(--black-a6);
|
|
3379
3379
|
--color-surface: white;
|
|
3380
|
+
--color-ground: var(--neutral-1, var(--gray-1));
|
|
3380
3381
|
--color-text: var(--neutral-12);
|
|
3381
3382
|
--neutral-1: var(--gray-1);
|
|
3382
3383
|
--neutral-2: var(--gray-2);
|
|
@@ -3457,6 +3458,7 @@
|
|
|
3457
3458
|
--color-page: var(--neutral-1, var(--gray-1));
|
|
3458
3459
|
--color-overlay: var(--black-a8);
|
|
3459
3460
|
--color-surface: var(--neutral-2, var(--gray-2));
|
|
3461
|
+
--color-ground: var(--neutral-1, var(--gray-1));
|
|
3460
3462
|
--solid-chroma-hover-filter: none;
|
|
3461
3463
|
--solid-chroma-active-filter: brightness(0.88) contrast(1.03);
|
|
3462
3464
|
--solid-chroma-open-filter: brightness(0.95) contrast(1.02);
|
|
@@ -12628,6 +12630,7 @@
|
|
|
12628
12630
|
background-color: var(--color-surface);
|
|
12629
12631
|
}
|
|
12630
12632
|
.kui-PopoverToolbarSection {
|
|
12633
|
+
grid-row: 1;
|
|
12631
12634
|
display: -webkit-box;
|
|
12632
12635
|
display: -ms-flexbox;
|
|
12633
12636
|
display: flex;
|
|
@@ -12637,6 +12640,7 @@
|
|
|
12637
12640
|
gap: var(--space-3);
|
|
12638
12641
|
}
|
|
12639
12642
|
.kui-PopoverToolbarLeft {
|
|
12643
|
+
grid-column: 1;
|
|
12640
12644
|
justify-self: start;
|
|
12641
12645
|
}
|
|
12642
12646
|
.kui-PopoverToolbarCenter {
|
|
@@ -12646,6 +12650,7 @@
|
|
|
12646
12650
|
text-align: center;
|
|
12647
12651
|
}
|
|
12648
12652
|
.kui-PopoverToolbarRight {
|
|
12653
|
+
grid-column: 3;
|
|
12649
12654
|
justify-self: end;
|
|
12650
12655
|
}
|
|
12651
12656
|
.kui-PopoverToolbarTitle {
|
|
@@ -13235,7 +13240,7 @@
|
|
|
13235
13240
|
background-color: GrayText;
|
|
13236
13241
|
}
|
|
13237
13242
|
}
|
|
13238
|
-
|
|
13243
|
+
.kui-SheetContent {
|
|
13239
13244
|
position: fixed !important;
|
|
13240
13245
|
width: var(--width, 90vw);
|
|
13241
13246
|
max-width: min(var(--overlay-w), 100vw);
|
|
@@ -13244,7 +13249,7 @@
|
|
|
13244
13249
|
margin: 0 !important;
|
|
13245
13250
|
}
|
|
13246
13251
|
@supports (height: 100dvh) {
|
|
13247
|
-
|
|
13252
|
+
.kui-SheetContent {
|
|
13248
13253
|
height: 100dvh;
|
|
13249
13254
|
max-height: 100dvh;
|
|
13250
13255
|
}
|
|
@@ -16039,6 +16044,11 @@
|
|
|
16039
16044
|
-ms-flex: 1;
|
|
16040
16045
|
flex: 1;
|
|
16041
16046
|
}
|
|
16047
|
+
.kui-SidebarHeader:where(.kui-SidebarHeader--container) > :where(.kui-Toolbar) {
|
|
16048
|
+
-webkit-box-flex: 1;
|
|
16049
|
+
-ms-flex: 1;
|
|
16050
|
+
flex: 1;
|
|
16051
|
+
}
|
|
16042
16052
|
.kui-SidebarFooter:where(.kui-SidebarFooter--container) {
|
|
16043
16053
|
display: -webkit-box;
|
|
16044
16054
|
display: -ms-flexbox;
|
|
@@ -16059,6 +16069,11 @@
|
|
|
16059
16069
|
-ms-flex: 1;
|
|
16060
16070
|
flex: 1;
|
|
16061
16071
|
}
|
|
16072
|
+
.kui-SidebarFooter:where(.kui-SidebarFooter--container) > :where(.kui-Toolbar) {
|
|
16073
|
+
-webkit-box-flex: 1;
|
|
16074
|
+
-ms-flex: 1;
|
|
16075
|
+
flex: 1;
|
|
16076
|
+
}
|
|
16062
16077
|
.kui-SidebarHeader :where(.kui-SidebarMenuButton),
|
|
16063
16078
|
.kui-SidebarFooter :where(.kui-SidebarMenuButton) {
|
|
16064
16079
|
display: -webkit-box;
|
|
@@ -17113,12 +17128,15 @@
|
|
|
17113
17128
|
z-index: 1;
|
|
17114
17129
|
pointer-events: none;
|
|
17115
17130
|
}
|
|
17116
|
-
:is(.kui-ShellPaneHeader[data-float],.kui-ShellPaneFooter[data-float]) > :where(*)
|
|
17131
|
+
:is(.kui-ShellPaneHeader[data-float],.kui-ShellPaneFooter[data-float]) > :where(*) {
|
|
17117
17132
|
pointer-events: auto;
|
|
17118
17133
|
}
|
|
17119
17134
|
:is(.kui-ShellPaneHeader[data-float],.kui-ShellPaneFooter[data-float]) > :where(.kui-Toolbar) {
|
|
17120
17135
|
pointer-events: none;
|
|
17121
17136
|
}
|
|
17137
|
+
:is(.kui-ShellPaneHeader[data-float],.kui-ShellPaneFooter[data-float]) > :where(.kui-Toolbar) :where(.kui-ToolbarGroup,.kui-BaseButton,.kui-TextFieldRoot,.kui-SelectTrigger,.kui-SegmentedControlRoot,[href],[tabindex]) {
|
|
17138
|
+
pointer-events: auto;
|
|
17139
|
+
}
|
|
17122
17140
|
.kui-ShellPaneHeader[data-float] {
|
|
17123
17141
|
top: 0;
|
|
17124
17142
|
}
|
package/tokens/base.css
CHANGED
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
--color-page: white;
|
|
62
62
|
--color-overlay: var(--black-a6);
|
|
63
63
|
--color-surface: white;
|
|
64
|
+
--color-ground: var(--neutral-1, var(--gray-1));
|
|
64
65
|
--color-text: var(--neutral-12);
|
|
65
66
|
--neutral-1: var(--gray-1);
|
|
66
67
|
--neutral-2: var(--gray-2);
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
--color-page: var(--neutral-1, var(--gray-1));
|
|
109
110
|
--color-overlay: var(--black-a8);
|
|
110
111
|
--color-surface: var(--neutral-2, var(--gray-2));
|
|
112
|
+
--color-ground: var(--neutral-1, var(--gray-1));
|
|
111
113
|
--solid-chroma-hover-filter: none;
|
|
112
114
|
--solid-chroma-active-filter: brightness(0.88) contrast(1.03);
|
|
113
115
|
--solid-chroma-open-filter: brightness(0.95) contrast(1.02);
|
package/tokens.css
CHANGED
|
@@ -3377,6 +3377,7 @@
|
|
|
3377
3377
|
--color-page: white;
|
|
3378
3378
|
--color-overlay: var(--black-a6);
|
|
3379
3379
|
--color-surface: white;
|
|
3380
|
+
--color-ground: var(--neutral-1, var(--gray-1));
|
|
3380
3381
|
--color-text: var(--neutral-12);
|
|
3381
3382
|
--neutral-1: var(--gray-1);
|
|
3382
3383
|
--neutral-2: var(--gray-2);
|
|
@@ -3454,6 +3455,7 @@
|
|
|
3454
3455
|
--color-page: var(--neutral-1, var(--gray-1));
|
|
3455
3456
|
--color-overlay: var(--black-a8);
|
|
3456
3457
|
--color-surface: var(--neutral-2, var(--gray-2));
|
|
3458
|
+
--color-ground: var(--neutral-1, var(--gray-1));
|
|
3457
3459
|
--solid-chroma-hover-filter: none;
|
|
3458
3460
|
--solid-chroma-active-filter: brightness(0.88) contrast(1.03);
|
|
3459
3461
|
--solid-chroma-open-filter: brightness(0.95) contrast(1.02);
|