@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
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/sidebar.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from './slot.js';\nimport * as Accordion from '@radix-ui/react-accordion';\nimport * as DropdownMenu from './dropdown-menu.js';\nimport * as Popover from './popover.js';\n\nimport { Separator } from './separator.js';\nimport { ThickChevronRightIcon } from './icons.js';\nimport { Kbd } from './kbd.js';\nimport { Chip } from './chip.js';\nimport { ShellSizeContext, useSidebarVisual } from './_internal/pane-chrome.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { ChipProps } from './chip.js';\n\n// Chip configuration for the `badge` slot of sidebar menu buttons\ntype BadgeConfig = {\n content: React.ReactNode;\n variant?: ChipProps['variant'];\n size?: ChipProps['size'];\n color?: ChipProps['color'];\n radius?: ChipProps['radius'];\n};\n\n// Sidebar separator\ninterface SidebarSeparatorProps extends ComponentPropsWithout<typeof Separator, RemovedProps> {}\n\nconst SidebarSeparator = React.forwardRef<React.ComponentRef<typeof Separator>, SidebarSeparatorProps>(({ className, ...props }, forwardedRef) => (\n <Separator {...props} ref={forwardedRef} className={classNames('kui-SidebarSeparator', className)} />\n));\nSidebarSeparator.displayName = 'Sidebar.Separator';\n\n// Menu components - styled like dropdown menus, but semantically a navigation list.\n// No menu/menuitem roles: those promise an application menu, which a list of links is not.\ninterface SidebarMenuProps extends React.ComponentPropsWithoutRef<'ul'> {}\n\nconst SidebarMenu = React.forwardRef<HTMLUListElement, SidebarMenuProps>(({ className, ...props }, forwardedRef) => (\n <ul {...props} ref={forwardedRef} className={classNames('kui-SidebarMenu', className)} />\n));\nSidebarMenu.displayName = 'Sidebar.Menu';\n\ninterface SidebarMenuItemProps extends React.ComponentPropsWithoutRef<'li'> {}\n\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, SidebarMenuItemProps>(({ className, ...props }, forwardedRef) => (\n <li {...props} ref={forwardedRef} className={classNames('kui-SidebarMenuItem', className)} />\n));\nSidebarMenuItem.displayName = 'Sidebar.MenuItem';\n\ninterface SidebarMenuButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n isActive?: boolean;\n shortcut?: React.ReactNode;\n badge?: string | BadgeConfig;\n}\n\n// The name a component type goes by: a function, or the function inside forwardRef or memo.\nfunction componentName(type: unknown): string | undefined {\n if (typeof type === 'function') {\n const fn = type as { displayName?: string; name?: string };\n return fn.displayName || fn.name;\n }\n if (type && typeof type === 'object') {\n const wrapped = type as { displayName?: string; render?: unknown; type?: unknown };\n return wrapped.displayName || componentName(wrapped.render) || componentName(wrapped.type);\n }\n return undefined;\n}\n\nfunction isIconElement(el: React.ReactElement<{ icon?: unknown }>): boolean {\n if (el.type === 'svg') return true;\n if (el.props?.icon) return true;\n return componentName(el.type)?.includes('Icon') ?? false;\n}\n\nfunction isText(node: React.ReactNode): node is string | number {\n return typeof node === 'string' || typeof node === 'number';\n}\n\n// Thin mode puts the row's icon in a wrapper that carries the hover and active tile. An icon is\n// an svg, a HugeiconsIcon, or a component named *Icon. Failing that, the first element ahead of\n// other content is taken as the icon (Lucide and other icon sets).\nfunction separateIconsAndLabels(node: React.ReactNode): { icons: React.ReactNode[]; labels: React.ReactNode[] } {\n const children = React.Children.toArray(node);\n const icons: React.ReactNode[] = [];\n const labels: React.ReactNode[] = [];\n\n for (const child of children) {\n if (React.isValidElement<{ icon?: unknown }>(child) && isIconElement(child)) icons.push(child);\n else labels.push(isText(child) ? <span key={labels.length} className=\"kui-SidebarMenuLabel\">{child}</span> : child);\n }\n\n if (icons.length === 0 && children.length > 1 && React.isValidElement(children[0])) {\n icons.push(children[0]);\n labels.shift();\n }\n\n return { icons, labels };\n}\n\n// Wraps the row's own text in a label span. Text inside the caller's elements is left alone.\nfunction wrapTextNodes(node: React.ReactNode): React.ReactNode {\n return React.Children.map(node, (child) => (isText(child) ? <span className=\"kui-SidebarMenuLabel\">{child}</span> : child));\n}\n\n// Arrow Up and Down move between the visible buttons of the same sidebar, as a\n// convenience on top of Tab. Sub-menu triggers take part, so the one-item Accordion\n// behind each sub-menu doesn't keep focus on its own trigger.\nfunction focusAdjacentSidebarButton(event: React.KeyboardEvent<HTMLElement>) {\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;\n const scope = event.currentTarget.closest('.kui-SidebarContent, .kui-SidebarSearchPopover');\n const buttons = scope\n ? Array.from(scope.querySelectorAll<HTMLElement>('.kui-SidebarMenuButton')).filter((el) => el.offsetParent !== null)\n : [];\n const index = buttons.indexOf(event.currentTarget);\n const next = buttons[index + (event.key === 'ArrowDown' ? 1 : -1)];\n if (index !== -1 && next) {\n event.preventDefault();\n next.focus();\n }\n}\n\nconst SidebarMenuButton = React.forwardRef<HTMLButtonElement, SidebarMenuButtonProps>(\n ({ asChild = false, isActive = false, shortcut, badge, className, children, onKeyDown, ...props }, forwardedRef) => {\n const visual = useSidebarVisual();\n // A pane with no scope (Inspector, Bottom) still takes the Shell's index.\n const shellSize = React.useContext(ShellSizeContext);\n const sidebarSize = visual?.size ?? shellSize;\n const isThinMode = visual?.presentation === 'thin';\n\n const Comp = asChild ? Slot : 'button';\n\n // Enter and Space are left to the native button or link. The caller's handler runs first,\n // so it can preventDefault to keep the arrow keys for itself.\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) focusAdjacentSidebarButton(event);\n };\n\n const extras = isThinMode ? null : (\n <>\n {badge && (\n <div className=\"kui-SidebarMenuBadge\">\n {typeof badge === 'string' ? (\n <Chip size={sidebarSize} variant=\"soft\">\n {badge}\n </Chip>\n ) : (\n <Chip size={badge.size || sidebarSize} variant={badge.variant || 'soft'} color={badge.color} radius={badge.radius}>\n {badge.content}\n </Chip>\n )}\n </div>\n )}\n {shortcut && (\n <div className=\"kui-BaseMenuShortcut kui-SidebarMenuShortcut\">\n <Kbd size={sidebarSize}>{shortcut}</Kbd>\n </div>\n )}\n </>\n );\n\n const renderContent = (content: React.ReactNode): React.ReactNode => {\n if (isThinMode) {\n const { icons, labels } = separateIconsAndLabels(content);\n if (icons.length > 0) {\n return (\n <>\n <span className=\"kui-SidebarMenuIconWrapper\">{icons}</span>\n {labels}\n </>\n );\n }\n }\n return (\n <>\n {wrapTextNodes(content)}\n {extras}\n </>\n );\n };\n\n // When rendering asChild, Slot expects a single child element. The row's content goes\n // inside that element, so a Link gets the label, icon tile, badge and shortcut.\n let body: React.ReactNode;\n if (asChild && React.isValidElement<{ children?: React.ReactNode }>(children) && React.Children.count(children) === 1) {\n body = React.cloneElement(children, undefined, renderContent(children.props.children));\n } else if (asChild) {\n body = children;\n } else {\n body = renderContent(children);\n }\n\n return (\n <Comp\n type={asChild ? undefined : 'button'}\n {...props}\n ref={forwardedRef}\n aria-current={isActive ? 'page' : undefined}\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-SidebarMenuButton', className)}\n data-active={isActive || undefined}\n onKeyDown={handleKeyDown}\n >\n {body}\n </Comp>\n );\n },\n);\nSidebarMenuButton.displayName = 'Sidebar.MenuButton';\n\n// Sub-menu components: Accordion in expanded, Dropdown in thin\nconst SidebarSubMenuModeContext = React.createContext<'accordion' | 'dropdown'>('accordion');\ninterface SidebarMenuSubProps extends React.ComponentPropsWithoutRef<'div'> {\n defaultOpen?: boolean;\n}\n\nconst SidebarMenuSub = React.forwardRef<HTMLDivElement, SidebarMenuSubProps>(({ defaultOpen = false, children, ...props }, forwardedRef) => {\n const visual = useSidebarVisual();\n const mode: 'accordion' | 'dropdown' = visual?.presentation === 'thin' ? 'dropdown' : 'accordion';\n\n if (mode === 'dropdown') {\n return (\n <div {...props} ref={forwardedRef}>\n <DropdownMenu.Root>\n <SidebarSubMenuModeContext.Provider value=\"dropdown\">{children}</SidebarSubMenuModeContext.Provider>\n </DropdownMenu.Root>\n </div>\n );\n }\n\n return (\n <div {...props} ref={forwardedRef}>\n <SidebarSubMenuModeContext.Provider value=\"accordion\">\n <Accordion.Root type=\"single\" collapsible defaultValue={defaultOpen ? 'item' : undefined}>\n <Accordion.Item value=\"item\">{children}</Accordion.Item>\n </Accordion.Root>\n </SidebarSubMenuModeContext.Provider>\n </div>\n );\n});\nSidebarMenuSub.displayName = 'Sidebar.MenuSub';\n\ninterface SidebarMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof Accordion.Trigger> {\n asChild?: boolean;\n}\n\nconst SidebarMenuSubTrigger = React.forwardRef<React.ElementRef<typeof Accordion.Trigger>, SidebarMenuSubTriggerProps>(\n ({ asChild = false, className, children, onKeyDown, ...props }, forwardedRef) => {\n const mode = React.useContext(SidebarSubMenuModeContext);\n\n if (mode === 'dropdown') {\n return (\n <DropdownMenu.Trigger>\n <button\n {...(props as any)}\n onKeyDown={onKeyDown}\n ref={forwardedRef as any}\n type=\"button\"\n aria-haspopup=\"menu\"\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-SidebarMenuButton', 'kui-SidebarMenuSubTrigger', className)}\n >\n {children}\n </button>\n </DropdownMenu.Trigger>\n );\n }\n\n return (\n <Accordion.Header asChild>\n <div>\n <Accordion.Trigger\n {...props}\n onKeyDown={(event) => {\n // Runs before the Accordion's own arrow handling, which would keep focus here.\n focusAdjacentSidebarButton(event);\n onKeyDown?.(event);\n }}\n ref={forwardedRef}\n asChild={asChild}\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-SidebarMenuButton', 'kui-SidebarMenuSubTrigger', className)}\n >\n {asChild ? (\n children\n ) : (\n <>\n {children}\n <ThickChevronRightIcon className={classNames('kui-BaseMenuSubTriggerIcon', 'kui-SidebarMenuSubTriggerIcon')} />\n </>\n )}\n </Accordion.Trigger>\n </div>\n </Accordion.Header>\n );\n },\n);\nSidebarMenuSubTrigger.displayName = 'Sidebar.MenuSubTrigger';\n\ninterface SidebarMenuSubContentProps extends React.ComponentPropsWithoutRef<typeof Accordion.Content> {}\n\n// In a Rail a sub-menu is a dropdown. Each row becomes a menu item: a MenuButton hands the item\n// its props (onClick, disabled, active), and an asChild one hands it its link.\nfunction toDropdownItem(node: React.ReactNode, key: React.Key): React.ReactNode {\n if (React.isValidElement<SidebarMenuButtonProps>(node) && node.type === SidebarMenuButton) {\n // The badge and shortcut have no place in a dropdown row; `type` belongs to a button only.\n const { asChild, isActive, shortcut, badge, type, children, ...rest } = node.props;\n const itemProps = {\n ...(rest as Omit<React.ComponentPropsWithoutRef<typeof DropdownMenu.Item>, 'color'>),\n 'data-active': isActive || undefined,\n 'aria-current': isActive ? ('page' as const) : undefined,\n };\n if (asChild && React.isValidElement(children) && React.Children.count(children) === 1) {\n return (\n <DropdownMenu.Item key={key} {...itemProps} asChild>\n {children}\n </DropdownMenu.Item>\n );\n }\n return (\n <DropdownMenu.Item key={key} {...itemProps}>\n {children}\n </DropdownMenu.Item>\n );\n }\n if (React.isValidElement(node)) {\n return (\n <DropdownMenu.Item key={key} asChild>\n {node}\n </DropdownMenu.Item>\n );\n }\n return <DropdownMenu.Item key={key}>{node}</DropdownMenu.Item>;\n}\n\nconst SidebarMenuSubContent = React.forwardRef<React.ElementRef<typeof Accordion.Content>, SidebarMenuSubContentProps>(({ className, children, ...props }, forwardedRef) => {\n const visual = useSidebarVisual();\n const mode = React.useContext(SidebarSubMenuModeContext);\n\n if (mode === 'dropdown') {\n const items = React.Children.map(children, (child, index) => {\n if (React.isValidElement<{ children?: React.ReactNode }>(child) && child.type === SidebarMenuItem) {\n const rows = React.Children.toArray(child.props.children);\n return toDropdownItem(rows.length === 1 ? rows[0] : rows, index);\n }\n return toDropdownItem(child, index);\n });\n\n return (\n <DropdownMenu.Content\n {...(props as Omit<React.ComponentPropsWithoutRef<typeof DropdownMenu.Content>, 'color'>)}\n ref={forwardedRef}\n size={visual?.size}\n className={classNames(className)}\n >\n <DropdownMenu.Group>{items}</DropdownMenu.Group>\n </DropdownMenu.Content>\n );\n }\n\n return (\n <Accordion.Content {...props} ref={forwardedRef} className={classNames('kui-SidebarMenuSubContent', className)}>\n <ul className=\"kui-SidebarMenuSubList\">{children}</ul>\n </Accordion.Content>\n );\n});\nSidebarMenuSubContent.displayName = 'Sidebar.MenuSubContent';\n\n// Group components. A group with a label is a named group; one without stays a plain div, so it\n// isn't announced as an empty group.\ntype SidebarGroupContextValue = { labelId: string; setLabelId: (id: string | null) => void };\nconst SidebarGroupContext = React.createContext<SidebarGroupContextValue | null>(null);\n\ninterface SidebarGroupProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroup = React.forwardRef<HTMLDivElement, SidebarGroupProps>(({ className, ...props }, forwardedRef) => {\n const labelId = React.useId();\n const [renderedLabelId, setLabelId] = React.useState<string | null>(null);\n const context = React.useMemo(() => ({ labelId, setLabelId }), [labelId]);\n return (\n <SidebarGroupContext.Provider value={context}>\n <div\n role={renderedLabelId ? 'group' : undefined}\n aria-labelledby={renderedLabelId ?? undefined}\n {...props}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuGroup', 'kui-SidebarGroup', className)}\n />\n </SidebarGroupContext.Provider>\n );\n});\nSidebarGroup.displayName = 'Sidebar.Group';\n\ninterface SidebarGroupLabelProps extends React.ComponentPropsWithoutRef<'div'> {\n asChild?: boolean;\n}\n\nconst SidebarGroupLabel = React.forwardRef<HTMLDivElement, SidebarGroupLabelProps>(({ asChild = false, className, id, ...props }, forwardedRef) => {\n const Comp = asChild ? Slot : 'div';\n const group = React.useContext(SidebarGroupContext);\n const labelId = id ?? group?.labelId;\n const setLabelId = group?.setLabelId;\n\n React.useEffect(() => {\n if (!setLabelId || !labelId) return;\n setLabelId(labelId);\n return () => setLabelId(null);\n }, [setLabelId, labelId]);\n\n return <Comp {...props} id={labelId} ref={forwardedRef} className={classNames('kui-BaseMenuLabel', 'kui-SidebarGroupLabel', className)} />;\n});\nSidebarGroupLabel.displayName = 'Sidebar.GroupLabel';\n\ninterface SidebarGroupContentProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst SidebarGroupContent = React.forwardRef<HTMLDivElement, SidebarGroupContentProps>(({ className, ...props }, forwardedRef) => (\n <div {...props} ref={forwardedRef} className={classNames('kui-SidebarGroupContent', className)} />\n));\nSidebarGroupContent.displayName = 'Sidebar.GroupContent';\n\n// Search component: inline input in expanded, popover trigger in thin\ninterface SidebarSearchProps extends React.ComponentPropsWithoutRef<'div'> {\n value: string;\n onValueChange: (value: string) => void;\n placeholder?: string;\n children?: React.ReactNode;\n}\n\nconst SearchIcon = ({ className }: { className?: string }) => (\n <svg className={className} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\" />\n </svg>\n);\n\nconst ClearIcon = ({ className }: { className?: string }) => (\n <svg className={className} width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n);\n\nconst SidebarSearch = React.forwardRef<HTMLDivElement, SidebarSearchProps>(\n ({ value, onValueChange, placeholder = 'Search...', children, className, ...props }, forwardedRef) => {\n const visual = useSidebarVisual();\n const isThin = visual?.presentation === 'thin';\n const inputRef = React.useRef<HTMLInputElement>(null);\n const popoverRef = React.useRef<HTMLDivElement>(null);\n const searchId = React.useId();\n const resultsId = `${searchId}-results`;\n\n // Stable refs for values used in callbacks \u2014 avoids recreating handlers on every keystroke\n const valueRef = React.useRef(value);\n valueRef.current = value;\n const onValueChangeRef = React.useRef(onValueChange);\n onValueChangeRef.current = onValueChange;\n\n // Derive a clean aria-label from placeholder (strip trailing dots/ellipsis)\n const searchLabel = placeholder.replace(/\\.+$/, '');\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Escape' && valueRef.current) {\n e.preventDefault();\n e.stopPropagation();\n onValueChangeRef.current('');\n inputRef.current?.focus();\n }\n },\n [],\n );\n\n // Arrow key navigation within the popover (input \u2194 results)\n const handlePopoverKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n const container = popoverRef.current;\n if (!container) return;\n\n const resultsGroup = container.querySelector('[role=\"group\"]');\n if (!resultsGroup) return;\n\n const items = Array.from(\n resultsGroup.querySelectorAll<HTMLElement>('a, button'),\n );\n if (items.length === 0) return;\n\n const active = document.activeElement as HTMLElement;\n const isOnInput = active === inputRef.current;\n const currentIndex = items.indexOf(active);\n\n // Typing while a result is focused \u2192 redirect focus to input\n if (\n e.key.length === 1 &&\n !e.ctrlKey &&\n !e.metaKey &&\n !e.altKey &&\n !isOnInput &&\n currentIndex !== -1\n ) {\n inputRef.current?.focus();\n return;\n }\n\n switch (e.key) {\n case 'ArrowDown': {\n e.preventDefault();\n if (isOnInput || currentIndex === -1) {\n items[0]?.focus();\n } else if (currentIndex < items.length - 1) {\n items[currentIndex + 1]?.focus();\n }\n break;\n }\n case 'ArrowUp': {\n e.preventDefault();\n if (currentIndex <= 0) {\n inputRef.current?.focus();\n } else {\n items[currentIndex - 1]?.focus();\n }\n break;\n }\n case 'Home': {\n // Only intercept when focused on a result, not the input (where Home moves cursor)\n if (!isOnInput) {\n e.preventDefault();\n items[0]?.focus();\n }\n break;\n }\n case 'End': {\n if (!isOnInput) {\n e.preventDefault();\n items[items.length - 1]?.focus();\n }\n break;\n }\n }\n },\n [],\n );\n\n if (isThin) {\n return (\n <div {...props} ref={forwardedRef} className={classNames('kui-SidebarSearch', 'kui-SidebarSearch--thin', className)}>\n <Popover.Root>\n <Popover.Trigger>\n <button\n type=\"button\"\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-SidebarMenuButton', 'kui-SidebarSearchTrigger')}\n aria-label={searchLabel}\n >\n <span className=\"kui-SidebarMenuIconWrapper\">\n <SearchIcon />\n </span>\n <span className=\"kui-SidebarMenuLabel\">Search</span>\n </button>\n </Popover.Trigger>\n <Popover.Content side=\"right\" align=\"start\" size=\"2\" width=\"280px\" aria-label={searchLabel}>\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- keyDown manages arrow-key navigation between input and results, which is accessibility-enhancing */}\n <div\n ref={popoverRef}\n className=\"kui-SidebarSearchPopover\"\n role=\"search\"\n onKeyDown={handlePopoverKeyDown}\n >\n <div className=\"kui-SidebarSearchInputWrapper\">\n <SearchIcon className=\"kui-SidebarSearchIcon\" />\n <input\n ref={inputRef}\n type=\"search\"\n className=\"kui-SidebarSearchInput\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n aria-label={searchLabel}\n aria-controls={children ? resultsId : undefined}\n // eslint-disable-next-line jsx-a11y/no-autofocus -- intentional: popover opens on user action, focusing the input is expected UX\n autoFocus\n />\n {value && (\n <button\n type=\"button\"\n className=\"kui-reset kui-SidebarSearchClear\"\n onClick={() => {\n onValueChange('');\n inputRef.current?.focus();\n }}\n aria-label=\"Clear search\"\n >\n <ClearIcon />\n </button>\n )}\n </div>\n {children && (\n <div id={resultsId} role=\"group\" aria-label=\"Search results\">\n {children}\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover.Root>\n </div>\n );\n }\n\n // Expanded mode: inline input\n return (\n <div {...props} ref={forwardedRef} className={classNames('kui-SidebarSearch', 'kui-SidebarSearch--expanded', 'kui-ShellPaneChrome', `kui-r-size-${visual?.size ?? '2'}`, className)} role=\"search\">\n <div className=\"kui-SidebarSearchInputWrapper\">\n <SearchIcon className=\"kui-SidebarSearchIcon\" />\n <input\n ref={inputRef}\n type=\"search\"\n className=\"kui-SidebarSearchInput\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n aria-label={searchLabel}\n />\n {value && (\n <button\n type=\"button\"\n className=\"kui-reset kui-SidebarSearchClear\"\n onClick={() => {\n onValueChange('');\n inputRef.current?.focus();\n }}\n aria-label=\"Clear search\"\n >\n <ClearIcon />\n </button>\n )}\n </div>\n </div>\n );\n },\n);\nSidebarSearch.displayName = 'Sidebar.Search';\n\n// Export all components following shadcn's pattern\nexport {\n SidebarSeparator as Separator,\n SidebarMenu as Menu,\n SidebarMenuItem as MenuItem,\n SidebarMenuButton as MenuButton,\n SidebarMenuSub as MenuSub,\n SidebarMenuSubTrigger as MenuSubTrigger,\n SidebarMenuSubContent as MenuSubContent,\n SidebarGroup as Group,\n SidebarGroupLabel as GroupLabel,\n SidebarGroupContent as GroupContent,\n SidebarSearch as Search,\n};\n\nexport type { BadgeConfig };\n"],
|
|
5
|
-
"mappings": ";0ZAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,WAAAE,GAAA,iBAAAC,GAAA,eAAAC,GAAA,SAAAC,EAAA,eAAAC,EAAA,aAAAC,EAAA,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,MAAOJ,EACP,SAAWU,GAAMT,EAAcS,EAAE,OAAO,KAAK,EAC7C,UAAW/C,EACX,YAAauC,EACb,aAAYO,EACd,EACCT,GACC,gBAAC,UACC,KAAK,SACL,UAAU,mCACV,QAAS,IAAM,CACbC,EAAc,EAAE,EAChBG,EAAS,SAAS,MAAM,CAC1B,EACA,aAAW,gBAEX,gBAACN,EAAA,IAAU,CACb,CAEJ,CACF,CAEJ,CACF,EACAC,GAAc,YAAc",
|
|
6
|
-
"names": ["sidebar_exports", "__export", "SidebarGroup", "SidebarGroupContent", "SidebarGroupLabel", "SidebarMenu", "SidebarMenuButton", "SidebarMenuItem", "SidebarMenuSub", "SidebarMenuSubContent", "SidebarMenuSubTrigger", "SidebarSearch", "SidebarSeparator", "React", "classNames", "Accordion", "SidebarSeparator", "className", "props", "forwardedRef", "Separator", "classNames", "SidebarMenu", "SidebarMenuItem", "componentName", "type", "fn", "wrapped", "isIconElement", "el", "isText", "node", "separateIconsAndLabels", "children", "icons", "labels", "child", "wrapTextNodes", "focusAdjacentSidebarButton", "event", "scope", "buttons", "index", "next", "SidebarMenuButton", "asChild", "isActive", "shortcut", "badge", "onKeyDown", "visual", "useSidebarVisual", "shellSize", "ShellSizeContext", "sidebarSize", "isThinMode", "Comp", "Slot", "handleKeyDown", "extras", "Chip", "Kbd", "renderContent", "content", "body", "SidebarSubMenuModeContext", "SidebarMenuSub", "defaultOpen", "DropdownMenuRoot", "SidebarMenuSubTrigger", "DropdownMenuTrigger", "ThickChevronRightIcon", "toDropdownItem", "key", "rest", "itemProps", "DropdownMenuItem", "SidebarMenuSubContent", "items", "rows", "DropdownMenuContent", "DropdownMenuGroup", "SidebarGroupContext", "SidebarGroup", "labelId", "renderedLabelId", "setLabelId", "context", "SidebarGroupLabel", "id", "group", "SidebarGroupContent", "SearchIcon", "ClearIcon", "SidebarSearch", "value", "onValueChange", "placeholder", "isThin", "inputRef", "popoverRef", "resultsId", "valueRef", "onValueChangeRef", "searchLabel", "e", "handlePopoverKeyDown", "container", "resultsGroup", "active", "isOnInput", "currentIndex", "PopoverRoot", "PopoverTrigger", "PopoverContent"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/switch.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Switch as SwitchPrimitive } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../helpers/theme-size.js';\nimport { switchPropDefs } from './switch.props.js';\n\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ComponentPropsWithout } from '../helpers/component-props.js';\n\ntype SwitchElement = React.ElementRef<typeof SwitchPrimitive.Root>;\ntype SwitchOwnProps = GetPropDefTypes<typeof switchPropDefs>;\ninterface SwitchProps\n extends ComponentPropsWithout<\n typeof SwitchPrimitive.Root,\n 'asChild' | 'color' | 'defaultValue' | 'children'\n >,\n SwitchOwnProps {}\nconst Switch = React.forwardRef<SwitchElement, SwitchProps>((ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, switchPropDefs.size);\n const { className, color, ...switchProps } = extractProps(\n props,\n switchPropDefs,\n );\n return (\n <SwitchPrimitive.Root\n data-accent-color={color}\n {...switchProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-SwitchRoot', className)}\n >\n <SwitchPrimitive.Thumb className=\"kui-SwitchThumb\" />\n </SwitchPrimitive.Root>\n );\n});\nSwitch.displayName = 'Switch';\n\nexport { Switch };\nexport type { SwitchProps };\n"],
|
|
5
|
-
"mappings": ";wHAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,UAAUC,MAAuB,WAiB1C,IAAMC,EAAe,aAAuC,CAACC,EAAUC,IAAiB,CACtF,IAAMC,EAAQC,EAAkBH,EAAUI,EAAe,IAAI,EACvD,CAAE,UAAAC,EAAW,MAAAC,EAAO,GAAGC,CAAY,EAAIC,EAC3CN,EACAE,CACF,EACA,OACE,gBAACK,EAAgB,KAAhB,CACC,oBAAmBH,EAClB,GAAGC,EACJ,QAAS,GACT,IAAKN,EACL,UAAWS,EAAW,YAAa,iBAAkBL,CAAS,GAE9D,gBAACI,EAAgB,MAAhB,CAAsB,UAAU,kBAAkB,CACrD,CAEJ,CAAC,EACDV,EAAO,YAAc",
|
|
6
|
-
"names": ["React", "classNames", "SwitchPrimitive", "Switch", "ownProps", "forwardedRef", "props", "useThemeSizeProps", "switchPropDefs", "className", "color", "switchProps", "extractProps", "SwitchPrimitive", "classNames"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/combobox.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\n/**\n * Combobox: Radix Popover for positioning, dismissal and focus; cmdk for search,\n * filtering and keyboard navigation.\n *\n * Render path. State is split so an interaction re-renders only what reads it:\n * - `ComboboxContext` (Trigger, Value, Content): config and the selected value.\n * Open state is not in it, so opening and closing re-render no consumer.\n * - `ComboboxSearchContext` (Input only): the search text.\n * - `ComboboxItemContext` (Items): stable values only. Items read \"am I selected\"\n * from a store through `useSyncExternalStore`, so a selection re-renders the old\n * and the new selected item, not all N.\n *\n * Highlight. cmdk's `data-selected` is the single highlight source, driven by both\n * the pointer and the keyboard. There is no separate CSS `:hover` highlight, so two\n * items are never lit at once and Enter always picks the lit item.\n */\n\nimport { warnDeprecated } from '../helpers/warn-deprecated.js';\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\nimport { useCallbackRef, useComposedRefs, useControllableState, useLayoutEffect } from 'radix-ui/internal';\nimport { Command as CommandPrimitive, useCommandState } from 'cmdk';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSize } from '../helpers/theme-size.js';\nimport { comboboxRootPropDefs, comboboxTriggerPropDefs, comboboxContentPropDefs } from './combobox.props.js';\nimport { ChevronDownIcon, ThickCheckIcon } from './icons.js';\nimport { Spinner } from './spinner.js';\nimport { Theme, useThemeContext } from './theme.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport * as Popover from './popover.js';\nimport { Slottable } from './slot.js';\nimport { VisuallyHidden } from './visually-hidden.js';\n\nimport type { textFieldRootPropDefs } from './text-field.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype TextFieldVariant = (typeof textFieldRootPropDefs.variant.values)[number];\ntype ComboboxValue = string | null;\ntype CommandFilter = (value: string, search: string, keywords?: string[]) => number;\n\n// Hoisted so extractProps' compiled prop-def cache (keyed by object identity) hits.\nconst triggerSizingPropDefs = { size: comboboxRootPropDefs.size };\nconst contentSizePropDefs = { size: comboboxContentPropDefs.size };\n\nconst warned = new Set<string>();\nfunction warnOnce(message: string) {\n if (warned.has(message)) return;\n warned.add(message);\n console.warn(message);\n}\n\n// ============================================================================\n// Selection store\n// ============================================================================\n\ninterface SelectionStore {\n get: () => ComboboxValue;\n set: (value: ComboboxValue) => void;\n subscribe: (listener: () => void) => () => void;\n}\n\nfunction createSelectionStore(initial: ComboboxValue): SelectionStore {\n let current = initial;\n const listeners = new Set<() => void>();\n return {\n get: () => current,\n set: (next) => {\n if (Object.is(next, current)) return;\n current = next;\n listeners.forEach((listener) => listener());\n },\n subscribe: (listener) => {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n };\n}\n\n// ============================================================================\n// Contexts\n// ============================================================================\n\ninterface ComboboxContextValue {\n value: ComboboxValue;\n displayValue?: string;\n setOpen: (open: boolean) => void;\n size?: ComboboxRootOwnProps['size'];\n placeholder?: string;\n searchPlaceholder?: string;\n disabled?: boolean;\n color?: string;\n loop: boolean;\n shouldFilter: boolean;\n filter?: CommandFilter;\n triggerRef: React.RefObject<HTMLButtonElement | null>;\n /** Reads the trigger's accessible name from the DOM (aria-label, aria-labelledby or <label>). */\n getTriggerLabel: () => string | undefined;\n}\n\nconst ComboboxContext = React.createContext<ComboboxContextValue | null>(null);\n\nconst useComboboxContext = (componentName: string) => {\n const ctx = React.useContext(ComboboxContext);\n if (!ctx) {\n throw new Error(`Combobox.${componentName} must be used within Combobox.Root`);\n }\n return ctx;\n};\n\ninterface ComboboxSearchContextValue {\n value: string;\n setValue: (value: string) => void;\n}\n\nconst ComboboxSearchContext = React.createContext<ComboboxSearchContextValue | null>(null);\n\ninterface ComboboxItemContextValue {\n store: SelectionStore;\n onSelect: (value: string) => void;\n disabled?: boolean;\n}\n\nconst ComboboxItemContext = React.createContext<ComboboxItemContextValue | null>(null);\n\n/** Values resolved by Content and read by Input and List. */\ninterface ComboboxContentContextValue {\n sizeClassName?: string;\n color?: string;\n label?: string;\n}\n\nconst ComboboxContentContext = React.createContext<ComboboxContentContextValue | null>(null);\n\nconst useComboboxContentContext = () => React.useContext(ComboboxContentContext);\n\n// ============================================================================\n// Root\n// ============================================================================\n\ntype ComboboxRootOwnProps = GetPropDefTypes<typeof comboboxRootPropDefs> & {\n value?: ComboboxValue;\n defaultValue?: ComboboxValue;\n onValueChange?: (value: ComboboxValue) => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n placeholder?: string;\n searchPlaceholder?: string;\n searchValue?: string;\n defaultSearchValue?: string;\n onSearchValueChange?: (value: string) => void;\n filter?: CommandFilter;\n shouldFilter?: boolean;\n loop?: boolean;\n disabled?: boolean;\n /** Clear the search text when an option is selected. Defaults to true. */\n resetSearchOnSelect?: boolean;\n /** Clear the search text when the popup is dismissed without a selection. Defaults to true. */\n resetSearchOnClose?: boolean;\n color?: (typeof comboboxTriggerPropDefs.color.values)[number];\n /**\n * Text shown in the trigger for the selected value. Without it the raw value is shown.\n * Can be a string or a function that receives the current value. Pass a stable\n * function (module scope or `useCallback`): an inline function runs on every render.\n * @example displayValue={(v) => items.find(i => i.value === v)?.label}\n */\n displayValue?: string | ((value: ComboboxValue) => string | undefined);\n};\n\ntype PopoverRootProps = React.ComponentPropsWithoutRef<typeof Popover.Root>;\ninterface ComboboxRootProps extends PopoverRootProps, ComboboxRootOwnProps {}\n\nfunction readElementLabel(el: HTMLElement): string | undefined {\n const ariaLabel = el.getAttribute('aria-label')?.trim();\n if (ariaLabel) return ariaLabel;\n\n const labelledBy = el.getAttribute('aria-labelledby');\n if (labelledBy) {\n const text = labelledBy\n .split(/\\s+/)\n .map((id) => el.ownerDocument.getElementById(id)?.textContent?.trim())\n .filter(Boolean)\n .join(' ');\n if (text) return text;\n }\n\n const labels = (el as HTMLButtonElement).labels;\n if (labels && labels.length > 0) {\n const text = Array.from(labels)\n .map((label) => label.textContent?.trim())\n .filter(Boolean)\n .join(' ');\n if (text) return text;\n }\n\n return undefined;\n}\n\nconst ComboboxRoot: React.FC<ComboboxRootProps> = (props) => {\n const {\n children,\n size: sizeProp,\n value: valueProp,\n defaultValue = null,\n onValueChange,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n placeholder = 'Select an option',\n searchPlaceholder = 'Search...',\n searchValue: searchValueProp,\n defaultSearchValue = '',\n onSearchValueChange,\n filter,\n shouldFilter = true,\n loop = true,\n disabled,\n resetSearchOnSelect = true,\n resetSearchOnClose = true,\n color,\n displayValue: displayValueProp,\n ...rootProps\n } = props;\n const size = useThemeSize(sizeProp, comboboxRootPropDefs.size);\n\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange,\n });\n\n const [value, setValue] = useControllableState<ComboboxValue>({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n const [searchValue, setSearchValue] = useControllableState<string>({\n prop: searchValueProp,\n defaultProp: defaultSearchValue,\n onChange: onSearchValueChange,\n });\n\n const resolvedDisplayValue = typeof displayValueProp === 'function' ? displayValueProp(value) : displayValueProp;\n\n // Items subscribe to this store instead of the context, so a selection\n // re-renders only the items whose selected state flips.\n const [store] = React.useState(() => createSelectionStore(value));\n useLayoutEffect(() => {\n store.set(value);\n }, [store, value]);\n\n // The radix setters change identity whenever their controlled prop changes.\n // Reading them through callback refs keeps these handlers stable, so the\n // contexts below do not change on every keystroke or selection.\n const handleOpenChange = useCallbackRef((nextOpen: boolean) => {\n setOpen(nextOpen);\n if (!nextOpen && resetSearchOnClose) setSearchValue('');\n });\n\n const onSelect = useCallbackRef((nextValue: string) => {\n setValue(nextValue);\n setOpen(false);\n if (resetSearchOnSelect) setSearchValue('');\n });\n\n const triggerRef = React.useRef<HTMLButtonElement | null>(null);\n const getTriggerLabel = React.useCallback(() => (triggerRef.current ? readElementLabel(triggerRef.current) : undefined), []);\n\n const contextValue = React.useMemo<ComboboxContextValue>(\n () => ({\n value,\n displayValue: resolvedDisplayValue,\n setOpen: handleOpenChange,\n size,\n placeholder,\n searchPlaceholder,\n disabled,\n color,\n loop,\n shouldFilter,\n filter,\n triggerRef,\n getTriggerLabel,\n }),\n [value, resolvedDisplayValue, handleOpenChange, size, placeholder, searchPlaceholder, disabled, color, loop, shouldFilter, filter, getTriggerLabel],\n );\n\n const searchContextValue = React.useMemo<ComboboxSearchContextValue>(() => ({ value: searchValue, setValue: setSearchValue }), [searchValue, setSearchValue]);\n\n const itemContextValue = React.useMemo<ComboboxItemContextValue>(() => ({ store, onSelect, disabled }), [store, onSelect, disabled]);\n\n return (\n <ComboboxContext.Provider value={contextValue}>\n <ComboboxSearchContext.Provider value={searchContextValue}>\n <ComboboxItemContext.Provider value={itemContextValue}>\n <Popover.Root open={open} onOpenChange={handleOpenChange} {...rootProps}>\n {children}\n </Popover.Root>\n </ComboboxItemContext.Provider>\n </ComboboxSearchContext.Provider>\n </ComboboxContext.Provider>\n );\n};\nComboboxRoot.displayName = 'Combobox.Root';\n\n// ============================================================================\n// Trigger\n// ============================================================================\n\ntype ComboboxTriggerElement = HTMLButtonElement;\ntype ComboboxTriggerOwnProps = GetPropDefTypes<typeof comboboxTriggerPropDefs>;\ntype NativeTriggerProps = Omit<React.ComponentPropsWithoutRef<'button'>, 'color'>;\ninterface ComboboxTriggerProps extends NativeTriggerProps, ComboboxTriggerOwnProps {}\n\nconst ComboboxTrigger = React.forwardRef<ComboboxTriggerElement, ComboboxTriggerProps>((props, forwardedRef) => {\n const ctx = useComboboxContext('Trigger');\n\n const {\n children,\n className,\n placeholder,\n disabled,\n readOnly,\n error,\n loading,\n color,\n radius,\n onClick,\n onKeyDown,\n type: buttonType,\n ...triggerProps\n } = extractProps({ size: ctx.size, ...props }, triggerSizingPropDefs, comboboxTriggerPropDefs);\n\n const isDisabled = disabled ?? ctx.disabled;\n const resolvedColor = color ?? ctx.color;\n // Read-only and loading triggers stay focusable but do not open.\n const isBlocked = Boolean(readOnly || loading);\n const isPlaceholder = ctx.value == null && ctx.displayValue == null;\n\n const composedRef = useComposedRefs(forwardedRef, ctx.triggerRef);\n\n const { getTriggerLabel } = ctx;\n React.useEffect(() => {\n if (process.env.NODE_ENV === 'production') return;\n if (!getTriggerLabel()) {\n warnOnce(\n 'Combobox.Trigger has no accessible name. The combobox role does not take its name from its content. Add `aria-label`, `aria-labelledby`, or a `<label htmlFor>` that points at the trigger.',\n );\n }\n }, [getTriggerLabel]);\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n // Radix skips its open toggle when the event is default-prevented.\n if (isBlocked) event.preventDefault();\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || isBlocked || isDisabled) return;\n // Both arrows open the list, as on Select (APG select-only combobox).\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n ctx.setOpen(true);\n }\n };\n\n const loadingIcon = (\n <span className=\"kui-SelectIcon kui-SelectLoadingIcon\" aria-hidden=\"true\">\n <Spinner />\n </span>\n );\n\n const defaultContent = (\n <>\n <span className=\"kui-SelectTriggerInner\">\n <span className=\"kui-ComboboxValue\">{ctx.displayValue ?? ctx.value ?? placeholder ?? ctx.placeholder}</span>\n </span>\n {loading ? loadingIcon : <ChevronDownIcon className=\"kui-SelectIcon\" />}\n </>\n );\n\n // Radix Popover.Trigger supplies aria-expanded, aria-controls (the popup id) and\n // aria-haspopup=\"dialog\", which matches the Popover dialog this opens.\n return (\n <Popover.Trigger disabled={isDisabled}>\n <button\n data-accent-color={resolvedColor}\n data-radius={radius}\n data-error={error}\n data-loading={loading}\n data-disabled={isDisabled || undefined}\n data-read-only={readOnly || undefined}\n data-placeholder={isPlaceholder ? '' : undefined}\n {...triggerProps}\n // eslint-disable-next-line jsx-a11y/role-has-required-aria-props -- Popover.Trigger (Slot) adds aria-expanded and aria-controls\n role=\"combobox\"\n // The props win when set; otherwise a caller's own aria-* (a form library's aria-invalid) stays, as on Select.\n aria-disabled={isDisabled || triggerProps['aria-disabled']}\n aria-readonly={readOnly || triggerProps['aria-readonly']}\n aria-invalid={error || triggerProps['aria-invalid']}\n aria-busy={loading || triggerProps['aria-busy']}\n type={buttonType ?? 'button'}\n disabled={isDisabled}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n ref={composedRef}\n className={classNames('kui-reset', 'kui-SelectTrigger', 'kui-ComboboxTrigger', className)}\n >\n {/* Custom children replace the value and chevron; the spinner still shows while loading. */}\n {children ? (\n <>\n {requireReactElement(children)}\n {loading ? loadingIcon : null}\n </>\n ) : (\n defaultContent\n )}\n </button>\n </Popover.Trigger>\n );\n});\nComboboxTrigger.displayName = 'Combobox.Trigger';\n\n// ============================================================================\n// Value (standalone, for custom trigger layouts)\n// ============================================================================\n\ntype ComboboxValueElement = HTMLSpanElement;\ninterface ComboboxValueProps extends React.ComponentPropsWithoutRef<'span'> {\n placeholder?: string;\n}\n\nconst ComboboxValue = React.forwardRef<ComboboxValueElement, ComboboxValueProps>(({ placeholder, children, className, ...valueProps }, forwardedRef) => {\n const ctx = useComboboxContext('Value');\n const display = ctx.displayValue ?? ctx.value ?? undefined;\n return (\n <span {...valueProps} ref={forwardedRef} className={classNames('kui-ComboboxValue', className)}>\n {display ?? children ?? placeholder ?? ctx.placeholder}\n </span>\n );\n});\nComboboxValue.displayName = 'Combobox.Value';\n\n// ============================================================================\n// Content\n// ============================================================================\n\ntype ComboboxContentElement = React.ElementRef<typeof PopoverPrimitive.Content>;\ntype ComboboxContentOwnProps = GetPropDefTypes<typeof comboboxContentPropDefs> & {\n container?: React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Portal>['container'];\n};\ninterface ComboboxContentProps extends Omit<ComponentPropsWithout<typeof PopoverPrimitive.Content, RemovedProps>, 'size'>, ComboboxContentOwnProps {}\n\n/** Announces the filtered result count to screen readers after typing settles. */\nfunction ComboboxAnnouncer() {\n const count = useCommandState((state) => state.filtered.count);\n const search = useCommandState((state) => state.search);\n const [message, setMessage] = React.useState('');\n\n React.useEffect(() => {\n const next = !search ? '' : count === 0 ? 'No results' : `${count} result${count === 1 ? '' : 's'}`;\n const timeout = window.setTimeout(() => setMessage(next), search ? 400 : 0);\n return () => window.clearTimeout(timeout);\n }, [count, search]);\n\n return (\n <VisuallyHidden role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {message}\n </VisuallyHidden>\n );\n}\n\nconst ComboboxContent = React.forwardRef<ComboboxContentElement, ComboboxContentProps>((props, forwardedRef) => {\n const ctx = useComboboxContext('Content');\n const themeContext = useThemeContext();\n\n // The list takes the field's size.\n const size = props.size ?? ctx.size ?? comboboxContentPropDefs.size.default;\n\n const {\n className,\n children,\n color,\n forceMount,\n container,\n onOpenAutoFocus,\n 'aria-label': _ariaLabel,\n 'aria-labelledby': ariaLabelledByProp,\n ...contentProps\n } = extractProps({ ...props, size }, comboboxContentPropDefs);\n\n const resolvedColor = color || ctx.color || themeContext.accentColor;\n\n\n // The trigger's name labels the popup, the search field and the listbox.\n // Read once per mount (the content remounts on every open); fall back to a\n // layout effect when the trigger was not attached yet (defaultOpen, forceMount).\n const { getTriggerLabel } = ctx;\n const [triggerLabel, setTriggerLabel] = React.useState(getTriggerLabel);\n useLayoutEffect(() => {\n if (triggerLabel !== undefined) return;\n const label = getTriggerLabel();\n if (label !== undefined) setTriggerLabel(label);\n }, [getTriggerLabel, triggerLabel]);\n\n const label = props['aria-label'] ?? triggerLabel;\n\n const contentContextValue = React.useMemo<ComboboxContentContextValue>(\n () => ({\n // Responsive-aware size class for the search field (never String() a responsive object).\n sizeClassName: extractProps({ size }, contentSizePropDefs).className || undefined,\n color: resolvedColor,\n label,\n }),\n [size, resolvedColor, label],\n );\n\n const commandRef = React.useRef<HTMLDivElement>(null);\n\n // Without a search field, focus would land on the popup itself, outside cmdk's\n // keydown handler. Focus the listbox instead so arrow keys and Enter work.\n const handleOpenAutoFocus = (event: Event) => {\n onOpenAutoFocus?.(event);\n if (event.defaultPrevented) return;\n const command = commandRef.current;\n if (!command || command.querySelector('[cmdk-input]')) return;\n event.preventDefault();\n const list = command.querySelector<HTMLElement>('[cmdk-list]');\n (list ?? command).focus({ preventScroll: true });\n };\n\n // Start the highlight on the selected option (cmdk trims item values).\n const initialHighlight = ctx.value?.trim() || undefined;\n\n return (\n <PopoverPrimitive.Portal container={container} forceMount={forceMount ? true : undefined}>\n <Theme asChild>\n <PopoverPrimitive.Content\n data-accent-color={resolvedColor}\n align=\"start\"\n sideOffset={4}\n collisionPadding={10}\n aria-label={ariaLabelledByProp ? undefined : label}\n aria-labelledby={ariaLabelledByProp}\n {...contentProps}\n forceMount={forceMount ? true : undefined}\n onOpenAutoFocus={handleOpenAutoFocus}\n ref={forwardedRef}\n className={classNames('kui-PopperContent', 'kui-BaseMenuContent',\n 'kui-variant-soft', 'kui-ComboboxContent', className)}\n >\n <ComboboxContentContext.Provider value={contentContextValue}>\n <CommandPrimitive\n ref={commandRef}\n loop={ctx.loop}\n shouldFilter={ctx.shouldFilter}\n filter={ctx.filter}\n label={label}\n defaultValue={initialHighlight}\n className=\"kui-ComboboxCommand\"\n >\n {children}\n <ComboboxAnnouncer />\n </CommandPrimitive>\n </ComboboxContentContext.Provider>\n </PopoverPrimitive.Content>\n </Theme>\n </PopoverPrimitive.Portal>\n );\n});\nComboboxContent.displayName = 'Combobox.Content';\n\n// ============================================================================\n// Input\n// ============================================================================\n\ntype ComboboxInputElement = React.ElementRef<typeof CommandPrimitive.Input>;\ninterface ComboboxInputProps extends Omit<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>, 'value' | 'onValueChange'> {\n startAdornment?: React.ReactNode;\n endAdornment?: React.ReactNode;\n variant?: TextFieldVariant;\n value?: string;\n onValueChange?: (value: string) => void;\n}\n\nconst ComboboxInput = React.forwardRef<ComboboxInputElement, ComboboxInputProps>(\n ({ className, startAdornment, endAdornment, placeholder, variant: inputVariant, value, onValueChange, ...inputProps }, forwardedRef) => {\n const ctx = useComboboxContext('Input');\n const search = React.useContext(ComboboxSearchContext);\n const contentContext = useComboboxContentContext();\n\n const textFieldVariant = inputVariant ?? 'soft';\n\n // The search text lives in Root; only this component subscribes to it.\n const searchValue = value ?? search?.value ?? '';\n const handleSearchChange = onValueChange ?? search?.setValue;\n\n const inputField = (\n <div\n className={classNames('kui-TextFieldRoot', 'kui-ComboboxInputRoot', contentContext?.sizeClassName, `kui-variant-${textFieldVariant}`)}\n data-accent-color={contentContext?.color}\n >\n {startAdornment ? <div className=\"kui-TextFieldSlot\">{startAdornment}</div> : null}\n <CommandPrimitive.Input\n {...inputProps}\n ref={forwardedRef}\n value={searchValue}\n onValueChange={handleSearchChange}\n placeholder={placeholder ?? ctx.searchPlaceholder}\n className={classNames('kui-reset', 'kui-TextFieldInput', className)}\n />\n {endAdornment ? (\n <div className=\"kui-TextFieldSlot\" data-side=\"right\">\n {endAdornment}\n </div>\n ) : null}\n </div>\n );\n\n return contentContext ? <div className=\"kui-ComboboxSearch\">{inputField}</div> : inputField;\n },\n);\nComboboxInput.displayName = 'Combobox.Input';\n\n// ============================================================================\n// List\n// ============================================================================\n\ntype ComboboxListElement = React.ElementRef<typeof CommandPrimitive.List>;\ninterface ComboboxListProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> {}\n\n// cmdk's List owns its id (referenced by the input's aria-controls), role and\n// aria-label (set from `label`), so none of them are overridden here.\nconst ComboboxList = React.forwardRef<ComboboxListElement, ComboboxListProps>(({ className, children, label, ...listProps }, forwardedRef) => {\n const contentContext = useComboboxContentContext();\n return (\n <div className=\"kui-ComboboxScrollArea\">\n <div className={classNames('kui-BaseMenuViewport', 'kui-ComboboxViewport')}>\n <CommandPrimitive.List {...listProps} label={label ?? contentContext?.label} ref={forwardedRef} className={classNames('kui-ComboboxList', className)}>\n {children}\n </CommandPrimitive.List>\n </div>\n </div>\n );\n});\nComboboxList.displayName = 'Combobox.List';\n\n// ============================================================================\n// Empty\n// ============================================================================\n\ntype ComboboxEmptyElement = React.ElementRef<typeof CommandPrimitive.Empty>;\ninterface ComboboxEmptyProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty> {}\n\nconst ComboboxEmpty = React.forwardRef<ComboboxEmptyElement, ComboboxEmptyProps>(({ className, ...emptyProps }, forwardedRef) => (\n <CommandPrimitive.Empty {...emptyProps} ref={forwardedRef} className={classNames('kui-ComboboxEmpty', className)} />\n));\nComboboxEmpty.displayName = 'Combobox.Empty';\n\n// ============================================================================\n// Group\n// ============================================================================\n\ntype ComboboxGroupElement = React.ElementRef<typeof CommandPrimitive.Group>;\ninterface ComboboxGroupProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group> {}\n\nconst ComboboxGroup = React.forwardRef<ComboboxGroupElement, ComboboxGroupProps>(({ className, ...groupProps }, forwardedRef) => (\n <CommandPrimitive.Group {...groupProps} ref={forwardedRef} className={classNames('kui-BaseMenuGroup', 'kui-ComboboxGroup', className)} />\n));\nComboboxGroup.displayName = 'Combobox.Group';\n\n// ============================================================================\n// Label\n// ============================================================================\n\ntype ComboboxLabelElement = React.ElementRef<'div'>;\ninterface ComboboxLabelProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst ComboboxLabel = React.forwardRef<ComboboxLabelElement, ComboboxLabelProps>(({ className, id: idProp, ...labelProps }, forwardedRef) => {\n const generatedId = React.useId();\n const id = idProp ?? generatedId;\n const localRef = React.useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs(forwardedRef, localRef);\n\n // cmdk renders the group's role=\"group\" element itself and gives no way to\n // label it from a child, so name it after this label when inside a Group.\n useLayoutEffect(() => {\n const group = localRef.current?.closest('[cmdk-group-items]');\n if (!group || group.hasAttribute('aria-labelledby')) return;\n group.setAttribute('aria-labelledby', id);\n return () => {\n if (group.getAttribute('aria-labelledby') === id) group.removeAttribute('aria-labelledby');\n };\n }, [id]);\n\n return <div {...labelProps} id={id} ref={composedRef} className={classNames('kui-BaseMenuLabel', 'kui-ComboboxLabel', className)} />;\n});\nComboboxLabel.displayName = 'Combobox.Label';\n\n// ============================================================================\n// Separator\n// ============================================================================\n\ntype ComboboxSeparatorElement = React.ElementRef<typeof CommandPrimitive.Separator>;\ninterface ComboboxSeparatorProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator> {}\n\nconst ComboboxSeparator = React.forwardRef<ComboboxSeparatorElement, ComboboxSeparatorProps>(({ className, ...separatorProps }, forwardedRef) => (\n <CommandPrimitive.Separator {...separatorProps} ref={forwardedRef} className={classNames('kui-BaseMenuSeparator', 'kui-ComboboxSeparator', className)} />\n));\nComboboxSeparator.displayName = 'Combobox.Separator';\n\n// ============================================================================\n// Item\n// ============================================================================\n\n/** Plain text of a React node tree, used as the item's search text. */\nfunction getNodeText(node: React.ReactNode): string {\n if (node == null || typeof node === 'boolean') return '';\n if (typeof node === 'string' || typeof node === 'number') return String(node);\n if (Array.isArray(node)) return node.map(getNodeText).join('');\n if (React.isValidElement<{ children?: React.ReactNode }>(node)) return getNodeText(node.props.children);\n return '';\n}\n\ntype ComboboxItemElement = React.ElementRef<typeof CommandPrimitive.Item>;\ninterface ComboboxItemProps extends Omit<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>, 'keywords' | 'onSelect'> {\n /**\n * Text matched by search. Defaults to the text of `children`. Set it when the\n * children are components whose text is not in the JSX (it cannot be read).\n */\n label?: string;\n /** Additional keywords for search filtering. */\n keywords?: string[];\n /** Called when the item is selected. */\n onSelect?: (value: string) => void;\n}\n\nconst ComboboxItem = React.forwardRef<ComboboxItemElement, ComboboxItemProps>(\n ({ className, children, label, value, disabled, onSelect, keywords, ...itemProps }, forwardedRef) => {\n const itemContext = React.useContext(ComboboxItemContext);\n if (!itemContext) {\n throw new Error('Combobox.Item must be used within Combobox.Root');\n }\n const { store, onSelect: onSelectFromRoot, disabled: rootDisabled } = itemContext;\n\n // Without `value`, cmdk uses the trimmed text of string children.\n const itemValue = value ?? (typeof children === 'string' ? children.trim() : undefined);\n const getIsSelected = () => itemValue !== undefined && store.get() === itemValue;\n const isSelected = React.useSyncExternalStore(store.subscribe, getIsSelected, getIsSelected);\n\n const onSelectProp = useCallbackRef(onSelect);\n // cmdk passes its resolved value (the `value` prop, or the text when `value` is omitted).\n const handleSelect = React.useCallback(\n (resolvedValue: string) => {\n const nextValue = value ?? resolvedValue;\n onSelectFromRoot(nextValue);\n onSelectProp(nextValue);\n },\n [value, onSelectFromRoot, onSelectProp],\n );\n\n // cmdk matches only `value` and `keywords`, so add the visible text as a keyword.\n const text = (label ?? getNodeText(children)).replace(/\\s+/g, ' ').trim();\n const searchKeywords = text ? (keywords ? [text, ...keywords] : [text]) : keywords;\n // cmdk stores keywords only when `value` changes. Remount the cmdk item when\n // they change so a new label or keyword list is picked up.\n const keywordsKey = searchKeywords ? searchKeywords.join('\\u0000') : '';\n\n const isDisabled = disabled ?? rootDisabled ?? false;\n\n return (\n <CommandPrimitive.Item\n key={keywordsKey}\n {...itemProps}\n value={value}\n keywords={searchKeywords}\n // cmdk owns aria-selected (the highlighted option); the chosen option is aria-checked.\n aria-checked={isSelected}\n disabled={isDisabled || undefined}\n ref={forwardedRef}\n onSelect={handleSelect}\n className={classNames('kui-reset', 'kui-BaseMenuItem', 'kui-ComboboxItem', className)}\n >\n {isSelected ? (\n <span className={classNames('kui-BaseMenuItemIndicator', 'kui-ComboboxItemIndicator')}>\n <ThickCheckIcon className={classNames('kui-BaseMenuItemIndicatorIcon', 'kui-ComboboxItemIndicatorIcon')} />\n </span>\n ) : null}\n <Slottable>{children}</Slottable>\n </CommandPrimitive.Item>\n );\n },\n);\nComboboxItem.displayName = 'Combobox.Item';\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nexport {\n ComboboxRoot as Root,\n ComboboxTrigger as Trigger,\n ComboboxValue as Value,\n ComboboxContent as Content,\n ComboboxInput as Input,\n ComboboxList as List,\n ComboboxEmpty as Empty,\n ComboboxGroup as Group,\n ComboboxLabel as Label,\n ComboboxSeparator as Separator,\n ComboboxItem as Item,\n};\n\nexport type {\n ComboboxRootProps as RootProps,\n ComboboxTriggerProps as TriggerProps,\n ComboboxValueProps as ValueProps,\n ComboboxContentProps as ContentProps,\n ComboboxInputProps as InputProps,\n ComboboxListProps as ListProps,\n ComboboxEmptyProps as EmptyProps,\n ComboboxGroupProps as GroupProps,\n ComboboxLabelProps as LabelProps,\n ComboboxSeparatorProps as SeparatorProps,\n ComboboxItemProps as ItemProps,\n};\n"],
|
|
5
|
-
"mappings": ";ieAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,GAAA,UAAAC,GAAA,UAAAC,GAAA,UAAAC,GAAA,SAAAC,GAAA,UAAAC,GAAA,SAAAC,GAAA,SAAAC,GAAA,cAAAC,GAAA,YAAAC,GAAA,UAAAC,KAoBA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,WAAWC,OAAwB,WAC5C,OAAS,kBAAAC,EAAgB,mBAAAC,GAAiB,wBAAAC,EAAsB,mBAAAC,MAAuB,oBACvF,OAAS,WAAWC,EAAkB,mBAAAC,OAAuB,OAsB7D,IAAMC,GAAwB,CAAE,KAAMC,EAAqB,IAAK,EAC1DC,GAAsB,CAAE,KAAMC,EAAwB,IAAK,EAE3DC,GAAS,IAAI,IAC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qB,cACxBC,GAA0B,CACzB,IAAMtG,EAAYX,GAASiH,EAC3BP,EAAiB/F,CAAS,EAC1BoG,EAAapG,CAAS,CACxB,EACA,CAACX,EAAO0G,EAAkBK,CAAY,CACxC,EAGMhJ,GAAQG,GAASkI,EAAY/H,CAAQ,GAAG,QAAQ,OAAQ,GAAG,EAAE,KAAK,EAClE6I,EAAiBnJ,EAAQwI,EAAW,CAACxI,EAAM,GAAGwI,CAAQ,EAAI,CAACxI,CAAI,EAAKwI,EAGpEY,EAAcD,EAAiBA,EAAe,KAAK,IAAQ,EAAI,GAE/DnF,EAAa1C,GAAYsH,GAAgB,GAE/C,OACE,gBAAC/B,EAAiB,KAAjB,CACC,IAAKuC,EACJ,GAAGX,EACJ,MAAOxG,EACP,SAAUkH,EAEV,eAAcJ,EACd,SAAU/E,GAAc,OACxB,IAAKZ,EACL,SAAU6F,EACV,UAAWnE,EAAW,YAAa,mBAAoB,mBAAoBzB,CAAS,GAEnF0F,EACC,gBAAC,QAAK,UAAWjE,EAAW,4BAA6B,2BAA2B,GAClF,gBAACuE,EAAA,CAAe,UAAWvE,EAAW,gCAAiC,+BAA+B,EAAG,CAC3G,EACE,KACJ,gBAACwE,EAAA,KAAWhJ,CAAS,CACvB,CAEJ,CACF,EACAiI,GAAa,YAAc",
|
|
6
|
-
"names": ["combobox_exports", "__export", "ComboboxContent", "ComboboxEmpty", "ComboboxGroup", "ComboboxInput", "ComboboxItem", "ComboboxLabel", "ComboboxList", "ComboboxRoot", "ComboboxSeparator", "ComboboxTrigger", "ComboboxValue", "React", "classNames", "PopoverPrimitive", "useCallbackRef", "useComposedRefs", "useControllableState", "useLayoutEffect", "CommandPrimitive", "useCommandState", "triggerSizingPropDefs", "comboboxRootPropDefs", "contentSizePropDefs", "comboboxContentPropDefs", "warned", "warnOnce", "message", "createSelectionStore", "initial", "current", "listeners", "next", "listener", "ComboboxContext", "useComboboxContext", "componentName", "ctx", "ComboboxSearchContext", "ComboboxItemContext", "ComboboxContentContext", "useComboboxContentContext", "readElementLabel", "el", "ariaLabel", "labelledBy", "text", "id", "labels", "label", "ComboboxRoot", "props", "children", "sizeProp", "valueProp", "defaultValue", "onValueChange", "openProp", "defaultOpen", "onOpenChange", "placeholder", "searchPlaceholder", "searchValueProp", "defaultSearchValue", "onSearchValueChange", "filter", "shouldFilter", "loop", "disabled", "resetSearchOnSelect", "resetSearchOnClose", "color", "displayValueProp", "rootProps", "size", "useThemeSize", "open", "setOpen", "useControllableState", "value", "setValue", "searchValue", "setSearchValue", "resolvedDisplayValue", "store", "useLayoutEffect", "handleOpenChange", "useCallbackRef", "nextOpen", "onSelect", "nextValue", "triggerRef", "getTriggerLabel", "contextValue", "searchContextValue", "itemContextValue", "PopoverRoot", "ComboboxTrigger", "forwardedRef", "className", "readOnly", "error", "loading", "radius", "onClick", "onKeyDown", "buttonType", "triggerProps", "extractProps", "comboboxTriggerPropDefs", "isDisabled", "resolvedColor", "isBlocked", "isPlaceholder", "composedRef", "useComposedRefs", "handleClick", "event", "handleKeyDown", "loadingIcon", "Spinner", "defaultContent", "ChevronDownIcon", "PopoverTrigger", "classNames", "requireReactElement", "ComboboxValue", "valueProps", "display", "ComboboxAnnouncer", "count", "useCommandState", "state", "search", "setMessage", "timeout", "VisuallyHidden", "ComboboxContent", "themeContext", "useThemeContext", "forceMount", "container", "onOpenAutoFocus", "_ariaLabel", "ariaLabelledByProp", "contentProps", "triggerLabel", "setTriggerLabel", "contentContextValue", "commandRef", "handleOpenAutoFocus", "command", "initialHighlight", "PopoverPrimitive", "Theme", "CommandPrimitive", "ComboboxInput", "startAdornment", "endAdornment", "inputVariant", "inputProps", "contentContext", "textFieldVariant", "handleSearchChange", "inputField", "ComboboxList", "listProps", "ComboboxEmpty", "emptyProps", "ComboboxGroup", "groupProps", "ComboboxLabel", "idProp", "labelProps", "generatedId", "localRef", "group", "ComboboxSeparator", "separatorProps", "getNodeText", "node", "ComboboxItem", "keywords", "itemProps", "itemContext", "onSelectFromRoot", "rootDisabled", "itemValue", "getIsSelected", "isSelected", "onSelectProp", "handleSelect", "resolvedValue", "searchKeywords", "keywordsKey", "ThickCheckIcon", "Slottable"]
|
|
7
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{e as C}from"./chunk-EAIQIW23.js";import{b as N,d as w,g as B}from"./chunk-XUCR7L4G.js";import{a as M,c as S}from"./chunk-3QWGSRYC.js";import{a as x,b as E,c as T}from"./chunk-VVBSYWUA.js";import{o as R}from"./chunk-GHWEXMF6.js";import{a as V,b as k}from"./chunk-DI7RUMLO.js";import{a as y}from"./chunk-WEBNIUEX.js";import{a as v}from"./chunk-G66WDIIV.js";import*as e from"react";import de from"classnames";import{useComposedRefs as le}from"radix-ui/internal";var I=t=>t==="collapsed"?"closed":"open",pe=t=>t==="closed"?"collapsed":"expanded";function A(t){if(t===void 0)return;if(typeof t=="string")return I(t);let n={};for(let[r,i]of Object.entries(t))i!==void 0&&(n[r]=I(i));return n}var ue={controlled:"state",default:"defaultState"},Se={initial:"overlay",sm:"fixed"},H=e.forwardRef((t,n)=>{let{className:r,presentation:i=Se,expandedSize:o=288,minSize:c=200,maxSize:b=400,resizable:m=!1,collapsible:U=!0,onExpand:D,onCollapse:L,onResize:O,onResizeStart:_,onResizeEnd:$,snapPoints:s,snapTolerance:W,collapseThreshold:d,paneId:l,persistence:p,children:j,style:q,state:F,defaultState:G,onStateChange:K,size:J,defaultSize:Q,onSizeChange:X,sizeUpdate:Y,sizeUpdateMs:Z=50,inset:f,id:ee,...u}=t,{table:P,attributes:ae}=T(i,"fixed"),a=x({name:"sidebar",label:"Sidebar",propNames:ue,id:ee,controlled:A(F),defaultValue:A(G),presentationTable:P,builtIn:N,onChange:(re,se)=>K?.(pe(re),{reason:se}),onExpand:D,onCollapse:L,size:o});R("sidebar",f),e.useEffect(()=>{(s!==void 0||d!==void 0||l!==void 0||p!==void 0)&&void 0},[s,d,l,p]);let h=e.useRef(null),te=le(n,a.setElement,h),ne=V({name:"sidebar",elementId:a.id,elementRef:h,cssVarName:"--sidebar-size",orientation:"vertical",edge:"end",growth:w,expandedSize:o,minSize:c,maxSize:b,resizable:m,collapsible:U,size:J,defaultSize:Q,onSizeChange:X,sizeUpdate:Y,sizeUpdateMs:Z,onResize:O,onResizeStart:_,onResizeEnd:$,snapPoints:s,snapTolerance:W,collapseThreshold:d,paneId:l,persistence:p,overlaying:a.overlaying,overlayingNow:()=>P[v()]==="overlay",requestCollapse:()=>a.setValue("closed","toggle"),requestToggle:()=>a.toggle("toggle")}),{handles:g,content:ie}=k(j,S),oe=m&&a.value!=="closed"&&!a.overlaying?e.createElement(y.Provider,{value:ne},g.length>0?g:e.createElement(M,null)):null,z=a.peeking?`var(--sidebar-size, ${o}px)`:void 0;return e.createElement("div",{...B(u),role:u.role??"navigation",id:a.id,ref:te,className:de("kui-ShellPane","kui-ShellSidebar",r),...E(a,ae),"data-inset":f||void 0,tabIndex:a.overlaying?-1:u.tabIndex,style:{...q,"--sidebar-expanded-size":`${o}px`,"--sidebar-min-size":`${c}px`,"--sidebar-max-size":`${b}px`,...z?{"--peek-sidebar-width":z}:{}}},e.createElement("div",{className:"kui-ShellSidebarContent"},e.createElement(C,null,ie)),oe)});H.displayName="Shell.Sidebar";H.Handle=S;export{H as a};
|
|
3
|
-
//# sourceMappingURL=chunk-LB2HB4NG.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/_internal/shell-sidebar.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useComposedRefs } from 'radix-ui/internal';\nimport { PaneResizeContext } from './shell-resize.js';\nimport { PaneHandle, SidebarHandle } from './shell-handles.js';\nimport { usePane, paneAttributes, usePresentationTable } from './shell-pane.js';\nimport { splitHandles, useResizablePane, type SizeChangeMeta } from './shell-resizable.js';\nimport { useInsetRegistration, warnOnce, type PaneValue } from './shell-store.js';\nimport { navigationRest, startAnchoredGrowth, withoutRemovedPaneProps } from './shell-rest.js';\nimport { readBreakpoint } from '../../hooks/use-breakpoint.js';\nimport { PaneChromeScope } from './pane-chrome.js';\nimport type { Breakpoint, CSSPropertiesWithVars, PaneBaseProps, Responsive, SidebarMode } from '../shell.types.js';\n\ntype SidebarStateChangeMeta = { reason: 'init' | 'toggle' | 'responsive' | 'dismiss' };\ntype SidebarControlledProps = { state: Responsive<SidebarMode>; onStateChange?: (state: SidebarMode, meta: SidebarStateChangeMeta) => void; defaultState?: never };\ntype SidebarUncontrolledProps = { defaultState?: SidebarMode | Partial<Record<Breakpoint, SidebarMode>>; onStateChange?: (state: SidebarMode, meta: SidebarStateChangeMeta) => void; state?: never };\ntype SidebarPublicProps = PaneBaseProps & {\n size?: number | string;\n defaultSize?: number | string;\n onSizeChange?: (size: number, meta: SizeChangeMeta) => void;\n sizeUpdate?: 'throttle' | 'debounce';\n sizeUpdateMs?: number;\n /** When true, adds margin and triggers the gray backdrop on the Shell. */\n inset?: boolean;\n} & (SidebarControlledProps | SidebarUncontrolledProps);\n\ntype SidebarComponent = React.ForwardRefExoticComponent<SidebarPublicProps & React.RefAttributes<HTMLDivElement>> & { Handle: typeof SidebarHandle };\n\nconst toValue = (mode: SidebarMode): PaneValue => (mode === 'collapsed' ? 'closed' : 'open');\nconst toMode = (value: PaneValue): SidebarMode => (value === 'closed' ? 'collapsed' : 'expanded');\n\nfunction modeToValue(state: Responsive<SidebarMode> | undefined): PaneValue | Partial<Record<Breakpoint, PaneValue>> | undefined {\n if (state === undefined) return undefined;\n if (typeof state === 'string') return toValue(state);\n const map: Partial<Record<Breakpoint, PaneValue>> = {};\n for (const [bp, mode] of Object.entries(state) as Array<[Breakpoint, SidebarMode | undefined]>) {\n if (mode !== undefined) map[bp] = toValue(mode);\n }\n return map;\n}\n\nconst SIDEBAR_PROP_NAMES = { controlled: 'state', default: 'defaultState' };\n\n/** Since 0.8.0 the Sidebar is in the frame from 768px up, the boundary kookie-ui-v2 uses everywhere. It was 1024px. */\nconst SIDEBAR_DEFAULT_PRESENTATION = { initial: 'overlay', sm: 'fixed' } as const;\n\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, SidebarPublicProps>((props, ref) => {\n const {\n className,\n presentation = SIDEBAR_DEFAULT_PRESENTATION,\n expandedSize = 288,\n minSize = 200,\n maxSize = 400,\n resizable = false,\n collapsible = true,\n onExpand,\n onCollapse,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n children,\n style,\n state,\n defaultState,\n onStateChange,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs = 50,\n inset,\n id,\n ...domProps\n } = props;\n\n const { table, attributes } = usePresentationTable(presentation, 'fixed');\n const pane = usePane({\n name: 'sidebar',\n label: 'Sidebar',\n propNames: SIDEBAR_PROP_NAMES,\n id,\n controlled: modeToValue(state),\n defaultValue: modeToValue(defaultState),\n presentationTable: table,\n builtIn: navigationRest,\n onChange: (value, reason) => onStateChange?.(toMode(value), { reason }),\n onExpand,\n onCollapse,\n size: expandedSize,\n });\n useInsetRegistration('sidebar', inset);\n\n React.useEffect(() => {\n if (snapPoints !== undefined || collapseThreshold !== undefined || paneId !== undefined || persistence !== undefined) {\n warnOnce('Shell.Sidebar: `snapPoints`, `collapseThreshold`, `paneId` and `persistence` are deprecated and are removed in 1.0. Keep the size in your own state with `size`/`onSizeChange`.');\n }\n }, [snapPoints, collapseThreshold, paneId, persistence]);\n\n const elementRef = React.useRef<HTMLElement | null>(null);\n const composedRef = useComposedRefs(ref, pane.setElement, elementRef);\n\n const resize = useResizablePane({\n name: 'sidebar',\n elementId: pane.id,\n elementRef,\n cssVarName: '--sidebar-size',\n orientation: 'vertical',\n edge: 'end',\n growth: startAnchoredGrowth,\n expandedSize,\n minSize,\n maxSize,\n resizable,\n collapsible,\n size,\n defaultSize,\n onSizeChange,\n sizeUpdate,\n sizeUpdateMs,\n onResize,\n onResizeStart,\n onResizeEnd,\n snapPoints,\n snapTolerance,\n collapseThreshold,\n paneId,\n persistence,\n overlaying: pane.overlaying,\n overlayingNow: () => table[readBreakpoint()] === 'overlay',\n requestCollapse: () => pane.setValue('closed', 'toggle'),\n requestToggle: () => pane.toggle('toggle'),\n });\n\n const { handles, content } = splitHandles(children, SidebarHandle);\n const handle =\n resizable && pane.value !== 'closed' && !pane.overlaying ? (\n <PaneResizeContext.Provider value={resize}>{handles.length > 0 ? handles : <PaneHandle />}</PaneResizeContext.Provider>\n ) : null;\n\n // A peek previews the width the next toggle opens to.\n const peekWidth = pane.peeking ? `var(--sidebar-size, ${expandedSize}px)` : undefined;\n\n return (\n <div\n {...withoutRemovedPaneProps(domProps)}\n role={domProps.role ?? 'navigation'}\n id={pane.id}\n ref={composedRef}\n className={classNames('kui-ShellPane', 'kui-ShellSidebar', className)}\n {...paneAttributes(pane, attributes)}\n data-inset={inset || undefined}\n tabIndex={pane.overlaying ? -1 : domProps.tabIndex}\n style={\n {\n ...style,\n '--sidebar-expanded-size': `${expandedSize}px`,\n '--sidebar-min-size': `${minSize}px`,\n '--sidebar-max-size': `${maxSize}px`,\n ...(peekWidth ? { '--peek-sidebar-width': peekWidth } : {}),\n } as CSSPropertiesWithVars\n }\n >\n <div className=\"kui-ShellSidebarContent\">\n <PaneChromeScope>{content}</PaneChromeScope>\n </div>\n {handle}\n </div>\n );\n}) as SidebarComponent;\n\nSidebar.displayName = 'Shell.Sidebar';\nSidebar.Handle = SidebarHandle;\n\nexport type { SidebarPublicProps };\n"],
|
|
5
|
-
"mappings": ";0WAEA,UAAYA,MAAW,QACvB,OAAOC,OAAgB,aACvB,OAAS,mBAAAC,OAAuB,oBA0BhC,IAAMC,EAAWC,GAAkCA,IAAS,YAAc,SAAW,OAC/EC,GAAUC,GAAmCA,IAAU,SAAW,YAAc,WAEtF,SAASC,EAAYC,EAA4G,CAC/H,GAAIA,IAAU,OAAW,OACzB,GAAI,OAAOA,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,qBAAsB,GAAGC,CAAO,KAChC,qBAAsB,GAAGC,CAAO,KAChC,GAAI+C,EAAY,CAAE,uBAAwBA,CAAU,EAAI,CAAC,CAC3D,GAGF,gBAAC,OAAI,UAAU,2BACb,gBAACI,EAAA,KAAiBV,EAAQ,CAC5B,EACCG,EACH,CAEJ,CAAC,EAEDnD,EAAQ,YAAc,gBACtBA,EAAQ,OAASkD",
|
|
6
|
-
"names": ["React", "classNames", "useComposedRefs", "toValue", "mode", "toMode", "value", "modeToValue", "state", "map", "bp", "SIDEBAR_PROP_NAMES", "SIDEBAR_DEFAULT_PRESENTATION", "Sidebar", "props", "ref", "className", "presentation", "expandedSize", "minSize", "maxSize", "resizable", "collapsible", "onExpand", "onCollapse", "onResize", "onResizeStart", "onResizeEnd", "snapPoints", "snapTolerance", "collapseThreshold", "paneId", "persistence", "children", "style", "defaultState", "onStateChange", "size", "defaultSize", "onSizeChange", "sizeUpdate", "sizeUpdateMs", "inset", "id", "domProps", "table", "attributes", "usePresentationTable", "pane", "usePane", "navigationRest", "reason", "useInsetRegistration", "elementRef", "composedRef", "useComposedRefs", "resize", "useResizablePane", "startAnchoredGrowth", "readBreakpoint", "handles", "content", "splitHandles", "SidebarHandle", "handle", "PaneResizeContext", "PaneHandle", "peekWidth", "withoutRemovedPaneProps", "classNames", "paneAttributes", "PaneChromeScope"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/radio-group.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Context } from 'radix-ui/internal';\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\n\nimport { radioGroupRootPropDefs } from './radio-group.props.js';\nimport { Text } from './text.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSize } from '../helpers/theme-size.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\nconst RADIO_GROUP_NAME = 'RadioGroup';\n\ntype ScopedProps<P> = P & { __scopeRadioGroup?: Context.Scope };\nconst [createRadioGroupContext] = Context.createContextScope(RADIO_GROUP_NAME, [\n RadioGroupPrimitive.createRadioGroupScope,\n]);\nconst useRadioGroupScope = RadioGroupPrimitive.createRadioGroupScope();\n\ntype RadioGroupRootOwnProps = GetPropDefTypes<typeof radioGroupRootPropDefs>;\ntype RadioGroupContextValue = RadioGroupRootOwnProps;\n\nconst [RadioGroupProvider, useRadioGroupContext] =\n createRadioGroupContext<RadioGroupContextValue>(RADIO_GROUP_NAME);\n\ntype RadioGroupRootElement = React.ElementRef<typeof RadioGroupPrimitive.Root>;\ninterface RadioGroupRootProps\n extends ComponentPropsWithout<\n typeof RadioGroupPrimitive.Root,\n 'asChild' | 'color' | 'defaultChecked'\n >,\n RadioGroupRootOwnProps {}\nconst RadioGroupRoot = React.forwardRef<RadioGroupRootElement, RadioGroupRootProps>(\n (\n {\n color = radioGroupRootPropDefs.color.default,\n size: sizeProp,\n variant = radioGroupRootPropDefs.variant.default,\n ...props\n }: ScopedProps<RadioGroupRootProps>,\n forwardedRef\n ) => {\n const size = useThemeSize(sizeProp, radioGroupRootPropDefs.size);\n const { __scopeRadioGroup, className, ...rootProps } = props;\n const radioGroupScope = useRadioGroupScope(__scopeRadioGroup);\n return (\n <RadioGroupProvider\n scope={__scopeRadioGroup}\n color={color}\n size={size}\n variant={variant}\n >\n <RadioGroupPrimitive.Root\n {...radioGroupScope}\n {...rootProps}\n ref={forwardedRef}\n className={classNames('kui-RadioGroupRoot', className)}\n />\n </RadioGroupProvider>\n );\n }\n);\nRadioGroupRoot.displayName = 'RadioGroup.Root';\n\ntype RadioGroupItemElement = React.ElementRef<typeof RadioGroupItemRadio>;\ninterface RadioGroupItemProps\n extends ComponentPropsWithout<typeof RadioGroupItemRadio, RemovedProps> {}\nconst RadioGroupItem = React.forwardRef<RadioGroupItemElement, RadioGroupItemProps>(\n (_props: ScopedProps<RadioGroupItemProps>, forwardedRef) => {\n const { __scopeRadioGroup, children, className, style, ...props } = _props;\n const { size } = useRadioGroupContext('RadioGroupItem', __scopeRadioGroup);\n\n // Render `<Text as=\"label\">` if children\u00A0are provided, otherwise render\n // the solo radio button to allow building out your custom layouts with it.\n if (children) {\n return (\n <Text\n as=\"label\"\n size={size}\n className={classNames('kui-RadioGroupItem', className)}\n style={style}\n >\n <RadioGroupItemRadio\n __scopeRadioGroup={__scopeRadioGroup}\n {...props}\n ref={forwardedRef}\n />\n {children && <span className=\"kui-RadioGroupItemInner\">{children}</span>}\n </Text>\n );\n }\n\n return (\n <RadioGroupItemRadio\n __scopeRadioGroup={__scopeRadioGroup}\n {...props}\n ref={forwardedRef}\n className={className}\n style={style}\n />\n );\n }\n);\nRadioGroupItem.displayName = 'RadioGroup.Item';\n\ntype RadioGroupItemRadioElement = React.ElementRef<typeof RadioGroupPrimitive.Item>;\ninterface RadioGroupItemRadioProps\n extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> {}\nconst RadioGroupItemRadio = React.forwardRef<\n RadioGroupItemRadioElement,\n ScopedProps<RadioGroupItemRadioProps>\n>(({ __scopeRadioGroup, ...props }, forwardedRef) => {\n const context = useRadioGroupContext('RadioGroupItemRadio', __scopeRadioGroup);\n const radioGroupScope = useRadioGroupScope(__scopeRadioGroup);\n const { color, className } = extractProps(\n { ...props, ...context },\n radioGroupRootPropDefs\n );\n return (\n <RadioGroupPrimitive.Item\n {...radioGroupScope}\n data-accent-color={color}\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-BaseRadioRoot', className)}\n />\n );\n});\nRadioGroupItemRadio.displayName = 'RadioGroup.ItemRadio';\n\nexport { RadioGroupRoot as Root, RadioGroupItem as Item };\nexport type { RadioGroupRootProps as RootProps, RadioGroupItemProps as ItemProps };\n"],
|
|
5
|
-
"mappings": ";wMAAA,IAAAA,EAAA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E,EAKF,gBAACG,EAAA,CACC,kBAAmBV,EAClB,GAAGJ,EACJ,IAAKC,EACL,UAAWI,EACX,MAAOO,EACT,CAEJ,CACF,EACAH,EAAe,YAAc,kBAK7B,IAAMK,EAA4B,aAGhC,CAAC,CAAE,kBAAAV,EAAmB,GAAGJ,CAAM,EAAGC,IAAiB,CACnD,IAAMc,EAAUrB,EAAqB,sBAAuBU,CAAiB,EACvEG,EAAkBf,EAAmBY,CAAiB,EACtD,CAAE,MAAAR,EAAO,UAAAS,CAAU,EAAIW,EAC3B,CAAE,GAAGhB,EAAO,GAAGe,CAAQ,EACvBlB,CACF,EACA,OACE,gBAACN,EAAoB,KAApB,CACE,GAAGgB,EACJ,oBAAmBX,EAClB,GAAGI,EACJ,QAAS,GACT,IAAKC,EACL,UAAWO,EAAW,YAAa,oBAAqBH,CAAS,EACnE,CAEJ,CAAC,EACDS,EAAoB,YAAc",
|
|
6
|
-
"names": ["radio_group_exports", "__export", "RadioGroupItem", "RadioGroupRoot", "React", "classNames", "Context", "RadioGroupPrimitive", "RADIO_GROUP_NAME", "createRadioGroupContext", "Context", "RadioGroupPrimitive", "useRadioGroupScope", "RadioGroupProvider", "useRadioGroupContext", "RadioGroupRoot", "color", "radioGroupRootPropDefs", "sizeProp", "variant", "props", "forwardedRef", "size", "useThemeSize", "__scopeRadioGroup", "className", "rootProps", "radioGroupScope", "classNames", "RadioGroupItem", "_props", "children", "style", "Text", "RadioGroupItemRadio", "context", "extractProps"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/table.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { tableRootPropDefs, tableRowPropDefs, tableCellPropDefs } from './table.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../helpers/theme-size.js';\nimport { getResponsiveClassNames } from '../helpers/get-responsive-styles.js';\nimport { ScrollArea } from './scroll-area.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype TableRootElement = React.ElementRef<'div'>;\ntype TableRootOwnProps = GetPropDefTypes<typeof tableRootPropDefs>;\ninterface TableRootProps\n extends ComponentPropsWithout<'div', RemovedProps>,\n TableRootOwnProps {}\nconst TableRoot = React.forwardRef<TableRootElement, TableRootProps>((ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, tableRootPropDefs.size);\n const { layout: layoutPropDef, ...rootPropDefs } = tableRootPropDefs;\n const {\n className,\n children,\n layout,\n // The table is what gets named, not the scroll wrapper around it.\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...rootProps\n } = extractProps(props, rootPropDefs);\n const tableLayoutClassNames = getResponsiveClassNames({\n value: layout,\n className: tableRootPropDefs.layout.className,\n propValues: tableRootPropDefs.layout.values,\n });\n return (\n <div ref={forwardedRef} className={classNames('kui-TableRoot', className)} {...rootProps}>\n {/* An overflowing scroller is a tab stop, so it carries the table's name and reads as a region. */}\n <ScrollArea aria-label={ariaLabel} aria-labelledby={ariaLabelledBy}>\n <table\n className={classNames('kui-TableRootTable', tableLayoutClassNames)}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n >\n {children}\n </table>\n </ScrollArea>\n </div>\n );\n});\nTableRoot.displayName = 'Table.Root';\n\ntype TableHeaderElement = React.ElementRef<'thead'>;\ninterface TableHeaderProps extends ComponentPropsWithout<'thead', RemovedProps> {}\nconst TableHeader = React.forwardRef<TableHeaderElement, TableHeaderProps>(\n ({ className, ...props }, forwardedRef) => (\n <thead {...props} ref={forwardedRef} className={classNames('kui-TableHeader', className)} />\n )\n);\nTableHeader.displayName = 'Table.Header';\n\ntype TableBodyElement = React.ElementRef<'tbody'>;\ninterface TableBodyProps extends ComponentPropsWithout<'tbody', RemovedProps> {}\nconst TableBody = React.forwardRef<TableBodyElement, TableBodyProps>(\n ({ className, ...props }, forwardedRef) => (\n <tbody {...props} ref={forwardedRef} className={classNames('kui-TableBody', className)} />\n )\n);\nTableBody.displayName = 'Table.Body';\n\ntype TableRowElement = React.ElementRef<'tr'>;\ntype TableRowOwnProps = GetPropDefTypes<typeof tableRowPropDefs>;\ninterface TableRowProps extends ComponentPropsWithout<'tr', RemovedProps>, TableRowOwnProps {}\nconst TableRow = React.forwardRef<TableRowElement, TableRowProps>((props, forwardedRef) => {\n const { className, ...rowProps } = extractProps(props, tableRowPropDefs);\n return <tr {...rowProps} ref={forwardedRef} className={classNames('kui-TableRow', className)} />;\n});\nTableRow.displayName = 'Table.Row';\n\ntype TableCellElement = React.ElementRef<'td'>;\ntype TableCellOwnProps = GetPropDefTypes<typeof tableCellPropDefs>;\ninterface TableCellProps\n extends ComponentPropsWithout<'td', RemovedProps | 'width'>,\n TableCellOwnProps {}\nconst TableCell = React.forwardRef<TableCellElement, TableCellProps>((props, forwardedRef) => {\n const { className, ...cellProps } = extractProps(props, tableCellPropDefs);\n return <td className={classNames('kui-TableCell', className)} ref={forwardedRef} {...cellProps} />;\n});\nTableCell.displayName = 'Table.Cell';\n\ntype TableColumnHeaderCellElement = React.ElementRef<'th'>;\ninterface TableColumnHeaderCellProps\n extends ComponentPropsWithout<'th', RemovedProps>,\n TableCellOwnProps {}\nconst TableColumnHeaderCell = React.forwardRef<\n TableColumnHeaderCellElement,\n TableColumnHeaderCellProps\n>((props, forwardedRef) => {\n const { className, ...cellProps } = extractProps(props, tableCellPropDefs);\n return (\n <th\n className={classNames('kui-TableCell', 'kui-TableColumnHeaderCell', className)}\n scope=\"col\"\n ref={forwardedRef}\n {...cellProps}\n />\n );\n});\nTableColumnHeaderCell.displayName = 'Table.ColumnHeaderCell';\n\ntype TableRowHeaderCellElement = React.ElementRef<'th'>;\ninterface TableRowHeaderCellProps\n extends ComponentPropsWithout<'th', RemovedProps>,\n TableCellOwnProps {}\nconst TableRowHeaderCell = React.forwardRef<TableRowHeaderCellElement, TableRowHeaderCellProps>(\n (props, forwardedRef) => {\n const { className, ...cellProps } = extractProps(props, tableCellPropDefs);\n return (\n <th\n className={classNames('kui-TableCell', 'kui-TableRowHeaderCell', className)}\n scope=\"row\"\n ref={forwardedRef}\n {...cellProps}\n />\n );\n }\n);\nTableRowHeaderCell.displayName = 'Table.RowHeaderCell';\n\nexport {\n TableRoot as Root,\n TableHeader as Header,\n TableBody as Body,\n TableRow as Row,\n TableCell as Cell,\n TableColumnHeaderCell as ColumnHeaderCell,\n TableRowHeaderCell as RowHeaderCell,\n};\n\nexport type {\n TableRootProps as RootProps,\n TableHeaderProps as HeaderProps,\n TableBodyProps as BodyProps,\n TableRowProps as RowProps,\n TableCellProps as CellProps,\n TableColumnHeaderCellProps as ColumnHeaderCellProps,\n TableRowHeaderCellProps as RowHeaderCellProps,\n};\n"],
|
|
5
|
-
"mappings": ";6NAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,SAAAC,EAAA,qBAAAC,EAAA,WAAAC,EAAA,SAAAC,EAAA,QAAAC,EAAA,kBAAAC,IAAA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aAgBvB,IAAMC,EAAkB,aAA6C,CAACC,EAAUC,IAAiB,CAC/F,IAAMC,EAAQC,EAAkBH,EAAUI,EAAkB,IAAI,EAC1D,CAAE,OAAQC,EAAe,GAAGC,CAAa,EAAIF,EAC7C,CACJ,UAAAG,EACA,SAAAC,EACA,OAAAC,EAEA,aAAcC,EACd,kBAAmBC,EACnB,mBAAoBC,EACpB,GAAGC,CACL,EAAIC,EAAaZ,EAAOI,CAAY,EAC9BS,EAAwBC,EAAwB,CACpD,MAAOP,EACP,UAAWL,EAAkB,OAAO,UACpC,WAAYA,EAAkB,OAAO,MACvC,CAAC,EACD,OACE,gBAAC,OAAI,IAAKH,EAAc,UAAWgB,EAAW,gBAAiBV,CAAS,EAAI,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BAA6BV,CAAS,EAC7E,MAAM,MACN,IAAKN,EACJ,GAAGwB,EACN,CAEJ,CAAC,EACDE,EAAsB,YAAc,yBAMpC,IAAMC,EAA2B,aAC/B,CAAC1B,EAAOD,IAAiB,CACvB,GAAM,CAAE,UAAAM,EAAW,GAAGkB,CAAU,EAAIX,EAAaZ,EAAOwB,CAAiB,EACzE,OACE,gBAAC,MACC,UAAWT,EAAW,gBAAiB,yBAA0BV,CAAS,EAC1E,MAAM,MACN,IAAKN,EACJ,GAAGwB,EACN,CAEJ,CACF,EACAG,EAAmB,YAAc",
|
|
6
|
-
"names": ["table_exports", "__export", "TableBody", "TableCell", "TableColumnHeaderCell", "TableHeader", "TableRoot", "TableRow", "TableRowHeaderCell", "React", "classNames", "TableRoot", "ownProps", "forwardedRef", "props", "useThemeSizeProps", "tableRootPropDefs", "layoutPropDef", "rootPropDefs", "className", "children", "layout", "ariaLabel", "ariaLabelledBy", "ariaDescribedBy", "rootProps", "extractProps", "tableLayoutClassNames", "getResponsiveClassNames", "classNames", "ScrollArea", "TableHeader", "TableBody", "TableRow", "rowProps", "tableRowPropDefs", "TableCell", "cellProps", "tableCellPropDefs", "TableColumnHeaderCell", "TableRowHeaderCell"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/segmented-control.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';\nimport { useComposedRefs, useControllableState, useLayoutEffect } from 'radix-ui/internal';\n\nimport { segmentedControlRootPropDefs } from './segmented-control.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../helpers/theme-size.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype SegmentedControlRootOwnProps = GetPropDefTypes<typeof segmentedControlRootPropDefs>;\n\ninterface SegmentedControlRootProps extends ComponentPropsWithout<'div', RemovedProps | 'dir'>, SegmentedControlRootOwnProps {\n value?: string;\n defaultValue?: string;\n onValueChange?(value: string): void;\n}\n\n// Arrow keys select as they move focus, as in a radio group. The root marks a key press, and the\n// item that takes focus from it selects itself. A click or Tab focuses without selecting.\nconst SegmentedControlContext = React.createContext<{ selectFromKeyboard(value: string): void } | null>(null);\n\nconst NAVIGATION_KEYS = new Set(['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End']);\n\nconst SegmentedControlRoot = React.forwardRef<HTMLDivElement, SegmentedControlRootProps>((ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, segmentedControlRootPropDefs.size);\n const {\n className,\n children,\n radius,\n value: valueProp,\n defaultValue: defaultValueProp,\n onValueChange: onValueChangeProp,\n style,\n disabled,\n onKeyDown,\n onPointerDown,\n ...rootProps\n } = extractProps(props, segmentedControlRootPropDefs);\n\n const [value, setValue] = useControllableState({\n prop: valueProp,\n onChange: onValueChangeProp,\n defaultProp: defaultValueProp ?? '',\n });\n\n // The indicator is sized and placed from the item count and the selected index, written\n // as custom properties. They are read from the children on render, so the server markup\n // is right, then corrected from the DOM, which also sees items inside fragments or\n // wrapper components.\n const keyboardNavigationRef = React.useRef(false);\n const context = React.useMemo(\n () => ({\n selectFromKeyboard(itemValue: string) {\n if (!keyboardNavigationRef.current) return;\n keyboardNavigationRef.current = false;\n setValue(itemValue);\n },\n }),\n [setValue],\n );\n\n const rootRef = React.useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs(forwardedRef, rootRef);\n const items = React.Children.toArray(children).filter(React.isValidElement);\n const renderedCount = items.length;\n const renderedIndex = Math.max(\n 0,\n items.findIndex((child) => (child.props as { value?: unknown }).value === value),\n );\n useLayoutEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n const domItems = Array.from(root.querySelectorAll(':scope > .kui-SegmentedControlItem'));\n const index = domItems.findIndex((item) => item.getAttribute('data-state') === 'on');\n root.style.setProperty('--segmented-control-count', String(domItems.length || 1));\n root.style.setProperty('--segmented-control-index', String(Math.max(0, index)));\n });\n\n return (\n <SegmentedControlContext.Provider value={context}>\n <ToggleGroupPrimitive.Root\n data-disabled={disabled || undefined}\n data-radius={radius}\n ref={composedRef}\n style={\n {\n '--segmented-control-count': renderedCount || 1,\n '--segmented-control-index': renderedIndex,\n ...style,\n } as React.CSSProperties\n }\n className={classNames('kui-SegmentedControlRoot', className)}\n onValueChange={(value) => {\n if (value) {\n setValue(value);\n }\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n keyboardNavigationRef.current = NAVIGATION_KEYS.has(event.key);\n }}\n onPointerDown={(event) => {\n onPointerDown?.(event);\n keyboardNavigationRef.current = false;\n }}\n {...rootProps}\n type=\"single\"\n value={value}\n asChild={false}\n disabled={!!disabled}\n >\n {children}\n <div className=\"kui-SegmentedControlIndicator\" />\n </ToggleGroupPrimitive.Root>\n </SegmentedControlContext.Provider>\n );\n});\n\nSegmentedControlRoot.displayName = 'SegmentedControl.Root';\n\ninterface SegmentedControlItemOwnProps {\n value: string;\n /** When true, this segment can't be selected. */\n disabled?: boolean;\n /** When true, applies fixed square width for icon-only segments */\n iconOnly?: boolean;\n}\n\ninterface SegmentedControlItemProps extends ComponentPropsWithout<typeof ToggleGroupPrimitive.Item, RemovedProps | 'type' | 'value'>, SegmentedControlItemOwnProps {}\n\nconst SegmentedControlItem = React.forwardRef<HTMLButtonElement, SegmentedControlItemProps>(({ children, className, iconOnly, onFocus, ...props }, forwardedRef) => {\n const context = React.useContext(SegmentedControlContext);\n return (\n <ToggleGroupPrimitive.Item\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-SegmentedControlItem', className)}\n data-icon-only={iconOnly || undefined}\n onFocus={(event) => {\n onFocus?.(event);\n context?.selectFromKeyboard(props.value);\n }}\n {...props}\n asChild={false}\n >\n <span className=\"kui-SegmentedControlItemSeparator\" />\n <span className=\"kui-SegmentedControlItemLabel\">\n <span className=\"kui-SegmentedControlItemLabelActive\">{children}</span>\n <span className=\"kui-SegmentedControlItemLabelInactive\" aria-hidden>\n {children}\n </span>\n </span>\n </ToggleGroupPrimitive.Item>\n );\n});\n\nSegmentedControlItem.displayName = 'SegmentedControl.Item';\n\nexport { SegmentedControlRoot as Root, SegmentedControlItem as Item };\nexport type { SegmentedControlRootProps as RootProps, SegmentedControlItemProps as ItemProps };\n"],
|
|
5
|
-
"mappings": ";gKAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,SAAAC,IAEA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,eAAeC,MAA4B,WACpD,OAAS,mBAAAC,EAAiB,wBAAAC,EAAsB,mBAAAC,MAAuB,oBAmBvE,IAAMC,EAAgC,gBAAkE,IAAI,EAEtGC,EAAkB,IAAI,IAAI,CAAC,YAAa,aAAc,UAAW,YAAa,OAAQ,KAAK,CAAC,EAE5FC,EAA6B,aAAsD,CAACC,EAAUC,IAAiB,CACnH,IAAMC,EAAQC,EAAkBH,EAAUI,EAA6B,IAAI,EACrE,CACJ,UAAAC,EACA,SAAAC,EACA,OAAAC,EACA,MAAOC,EACP,aAAcC,EACd,cAAeC,EACf,MAAAC,EACA,SAAAC,EACA,UAAAC,EACA,cAAAC,EACA,GAAGC,CACL,EAAIC,EAAad,EAAOE,CAA4B,EAE9C,CAACa,EAAOC,CAAQ,EAAIC,EAAqB,CAC7C,KAAMX,EACN,SAAUE,EACV,YAAaD,GAAoB,EACnC,CAAC,EAMKW,EAA8B,SAAO,EAAK,EAC1CC,EAAgB,UACpB,KAAO,CACL,mBAAmBC,EAAmB,CAC/BF,EAAsB,UAC3BA,EAAsB,QAAU,GAChCF,EAASI,CAAS,EACpB,CACF,GACA,CAACJ,CAAQ,CACX,EAEMK,EAAgB,SAAuB,IAAI,EAC3CC,EAAcC,EAAgBxB,EAAcsB,CAAO,EACnDG,EAAc,WA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B,CAClK,IAAMoB,EAAgB,aAAWxB,CAAuB,EACxD,OACE,gBAACsC,EAAqB,KAArB,CACC,IAAKlC,EACL,UAAWmC,EAAW,YAAa,2BAA4B/B,CAAS,EACxE,iBAAgBkC,GAAY,OAC5B,QAAUF,GAAU,CAClBG,IAAUH,CAAK,EACfhB,GAAS,mBAAmBnB,EAAM,KAAK,CACzC,EACC,GAAGA,EACJ,QAAS,IAET,gBAAC,QAAK,UAAU,oCAAoC,EACpD,gBAAC,QAAK,UAAU,iCACd,gBAAC,QAAK,UAAU,uCAAuCI,CAAS,EAChE,gBAAC,QAAK,UAAU,wCAAwC,cAAW,IAChEA,CACH,CACF,CACF,CAEJ,CAAC,EAEDgC,EAAqB,YAAc",
|
|
6
|
-
"names": ["segmented_control_exports", "__export", "SegmentedControlItem", "SegmentedControlRoot", "React", "classNames", "ToggleGroupPrimitive", "useComposedRefs", "useControllableState", "useLayoutEffect", "SegmentedControlContext", "NAVIGATION_KEYS", "SegmentedControlRoot", "ownProps", "forwardedRef", "props", "useThemeSizeProps", "segmentedControlRootPropDefs", "className", "children", "radius", "valueProp", "defaultValueProp", "onValueChangeProp", "style", "disabled", "onKeyDown", "onPointerDown", "rootProps", "extractProps", "value", "setValue", "useControllableState", "keyboardNavigationRef", "context", "itemValue", "rootRef", "composedRef", "useComposedRefs", "items", "renderedCount", "renderedIndex", "child", "useLayoutEffect", "root", "domItems", "index", "item", "ToggleGroupPrimitive", "classNames", "event", "SegmentedControlItem", "iconOnly", "onFocus"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/slider.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Direction, Slider as SliderPrimitive } from 'radix-ui';\n\nimport { sliderPropDefs } from './slider.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../helpers/theme-size.js';\n\nimport type { ComponentPropsWithout } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype SliderElement = React.ElementRef<typeof SliderPrimitive.Root>;\ntype SliderOwnProps = GetPropDefTypes<typeof sliderPropDefs>;\ninterface SliderProps extends ComponentPropsWithout<typeof SliderPrimitive.Root, 'asChild' | 'color' | 'children' | 'defaultChecked'>, SliderOwnProps {\n ticks?: Array<{ value: number; label?: string }>;\n unit?: string;\n}\nconst Slider = React.forwardRef<SliderElement, SliderProps>((ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, sliderPropDefs.size);\n const { className, color, radius, tabIndex, ...sliderProps } = extractProps(props, sliderPropDefs);\n const {\n ticks,\n unit,\n showTickLabels,\n snapToTicks,\n value: valueProp,\n defaultValue,\n onValueChange,\n onValueCommit,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rootProps\n } = sliderProps;\n const min = rootProps.min ?? 0;\n const max = rootProps.max ?? 100;\n\n // The slider keeps its own copy of the value when uncontrolled, so the handles, their\n // labels and a tick press all read the current value rather than the first one.\n const [uncontrolledValue, setUncontrolledValue] = React.useState<number[]>(() => defaultValue ?? [min]);\n const isControlled = valueProp !== undefined;\n const currentValue = isControlled ? valueProp : uncontrolledValue;\n const tickIdPrefix = React.useId();\n\n // For snapping to ticks, we need to handle this differently\n // Radix slider doesn't support arbitrary step values, so we'll handle snapping in the onValueChange\n const step = rootProps.step;\n\n // Optimized snap-to-ticks with memoized sorted ticks\n const sortedTicks = React.useMemo(() => (ticks ? [...ticks].sort((a, b) => a.value - b.value) : []), [ticks]);\n\n // The nearest tick to a value.\n const snapToNearestTick = React.useCallback(\n (value: number): number => {\n let nearest = sortedTicks[0].value;\n for (const tick of sortedTicks) {\n if (Math.abs(tick.value - value) < Math.abs(nearest - value)) nearest = tick.value;\n }\n return nearest;\n },\n [sortedTicks],\n );\n\n // A key press moves the handle one step, which the nearest tick would undo. So a key press\n // that does not reach another tick goes on to the next tick the way it moved.\n const snapKeyStep = React.useCallback(\n (value: number, previous: number): number => {\n const nearest = snapToNearestTick(value);\n if (value > previous && nearest <= previous) {\n return sortedTicks.find((tick) => tick.value > previous)?.value ?? previous;\n }\n if (value < previous && nearest >= previous) {\n return [...sortedTicks].reverse().find((tick) => tick.value < previous)?.value ?? previous;\n }\n return nearest;\n },\n [snapToNearestTick, sortedTicks],\n );\n\n // Whether the change under way came from the keyboard, so snapping knows how to read it.\n const keyboardChangeRef = React.useRef(false);\n\n // Format value text for accessibility\n const formatValueText = React.useCallback(\n (values: number[]): string => {\n const formatValue = (val: number) => (unit ? `${val} ${unit}` : val.toString());\n\n if (values.length === 1) {\n return `${formatValue(values[0])} out of ${formatValue(max)}`;\n } else if (values.length === 2) {\n return `${formatValue(values[0])} to ${formatValue(values[1])} out of ${formatValue(max)}`;\n } else {\n return `${values.map(formatValue).join(', ')} out of ${formatValue(max)}`;\n }\n },\n [unit, max],\n );\n\n // Ticks sit where the handle sits for their value. Radix flips the handle for a right to\n // left slider and for `inverted`, and runs a vertical slider from the bottom.\n const direction = Direction.useDirection(rootProps.dir);\n const orientation = rootProps.orientation ?? 'horizontal';\n const flipped = orientation === 'vertical' ? !rootProps.inverted : (direction === 'rtl') !== Boolean(rootProps.inverted);\n\n const tickElements = React.useMemo(() => {\n if (!ticks) return null;\n\n return ticks.map((tick, index) => {\n const percentage = ((tick.value - min) / (max - min)) * 100;\n return { ...tick, percentage: flipped ? 100 - percentage : percentage, index };\n });\n }, [ticks, min, max, flipped]);\n\n // Live region ref for accessibility announcements (no state = no re-renders)\n const announceRef = React.useRef<HTMLDivElement>(null);\n const announceTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // Says the new value after a tick press. Focus stays on the tick, so nothing else reports\n // it. The handle reports its own value on key presses and drags.\n const announce = React.useCallback(\n (values: number[]) => {\n if (!announceRef.current) return;\n announceRef.current.textContent = formatValueText(values);\n if (announceTimeoutRef.current) clearTimeout(announceTimeoutRef.current);\n announceTimeoutRef.current = setTimeout(() => {\n if (announceRef.current) announceRef.current.textContent = '';\n }, 1000);\n },\n [formatValueText],\n );\n\n // Handle value changes with snapping\n const handleValueChange = React.useCallback(\n (newValue: number[]) => {\n const snapping = snapToTicks && sortedTicks.length > 0;\n const finalValue = !snapping ? newValue : newValue.map((v, i) => (keyboardChangeRef.current && currentValue[i] !== undefined ? snapKeyStep(v, currentValue[i]) : snapToNearestTick(v)));\n\n if (!isControlled) setUncontrolledValue(finalValue);\n onValueChange?.(finalValue);\n },\n [snapToTicks, sortedTicks, snapKeyStep, snapToNearestTick, currentValue, onValueChange, isControlled],\n );\n\n // Cleanup timeout on unmount\n React.useEffect(() => {\n return () => {\n if (announceTimeoutRef.current) {\n clearTimeout(announceTimeoutRef.current);\n }\n };\n }, []);\n\n return (\n <div className=\"kui-SliderContainer\" data-orientation={orientation} data-has-ticks={tickElements ? '' : undefined}>\n {/* Live region for screen reader announcements */}\n <div ref={announceRef} aria-live=\"polite\" aria-atomic=\"true\" className=\"kui-sr-only\" />\n\n <SliderPrimitive.Root\n data-accent-color={color}\n data-radius={radius}\n ref={forwardedRef}\n {...rootProps}\n value={currentValue}\n step={step}\n onKeyDown={(event) => {\n keyboardChangeRef.current = true;\n rootProps.onKeyDown?.(event);\n }}\n onPointerDown={(event) => {\n keyboardChangeRef.current = false;\n rootProps.onPointerDown?.(event);\n }}\n onValueChange={handleValueChange}\n onValueCommit={onValueCommit}\n asChild={false}\n className={classNames('kui-SliderRoot', className)}\n >\n <SliderPrimitive.Track className=\"kui-SliderTrack\">\n <SliderPrimitive.Range className=\"kui-SliderRange\" data-inverted={rootProps.inverted ? '' : undefined} />\n </SliderPrimitive.Track>\n {currentValue.map((value, index) => (\n <SliderPrimitive.Thumb\n key={index}\n className=\"kui-SliderThumb\"\n {...(tabIndex !== undefined ? { tabIndex } : undefined)}\n // The caller's name goes to every handle. Without one, Radix names the two\n // handles of a range \"Minimum\" and \"Maximum\".\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-valuetext={unit ? `${value} ${unit}` : undefined}\n />\n ))}\n </SliderPrimitive.Root>\n {tickElements && (\n <div className=\"kui-SliderTicks\" data-orientation={orientation} role=\"group\" aria-label=\"Slider tick marks\">\n {tickElements.map((tick) => {\n return (\n <button\n key={tick.index}\n className=\"kui-SliderTick\"\n // Only the offset varies per tick; the centring transform lives in `.kui-SliderTick`.\n style={orientation === 'vertical' ? { top: `${tick.percentage}%` } : { left: `${tick.percentage}%` }}\n disabled={rootProps.disabled}\n onClick={() => {\n // Move only the handle nearest the tick. When handles share a value, a\n // tick above it moves the last of them and a tick below moves the first.\n let nearest = 0;\n currentValue.forEach((v, i) => {\n const distance = Math.abs(v - tick.value);\n const best = Math.abs(currentValue[nearest] - tick.value);\n if (distance < best || (distance === best && tick.value > v)) nearest = i;\n });\n const newValue = currentValue.map((v, i) => (i === nearest ? tick.value : v)).sort((x, y) => x - y);\n\n keyboardChangeRef.current = false;\n handleValueChange(newValue);\n onValueCommit?.(newValue);\n announce(newValue);\n }}\n aria-label={`Set to ${tick.label || (unit ? `${tick.value} ${unit}` : tick.value)}`}\n aria-describedby={tick.label ? undefined : `${tickIdPrefix}-tick-${tick.index}`}\n type=\"button\"\n >\n <div className=\"kui-SliderTickMark\" />\n {tick.label && showTickLabels !== false && <div className=\"kui-SliderTickLabel\">{tick.label}</div>}\n {!tick.label && (\n <span id={`${tickIdPrefix}-tick-${tick.index}`} className=\"kui-sr-only\">\n {unit ? `${tick.value} ${unit}` : tick.value}\n </span>\n )}\n </button>\n );\n })}\n </div>\n )}\n </div>\n );\n});\nSlider.displayName = 'Slider';\n\nexport { Slider };\nexport type { SliderProps };\n"],
|
|
5
|
-
"mappings": ";wHAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,aAAAC,EAAW,UAAUC,MAAuB,WAerD,IAAMC,GAAe,aAAuC,CAACC,EAAUC,IAAiB,CACtF,IAAMC,EAAQC,EAAkBH,EAAUI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K,IAAIxB,CAAI,GAAKwB,EAAK,KACzC,CAEJ,CAEH,CACH,CAEJ,CAEJ,CAAC,EACDrC,GAAO,YAAc",
|
|
6
|
-
"names": ["React", "classNames", "Direction", "SliderPrimitive", "Slider", "ownProps", "forwardedRef", "props", "useThemeSizeProps", "sliderPropDefs", "className", "color", "radius", "tabIndex", "sliderProps", "extractProps", "ticks", "unit", "showTickLabels", "snapToTicks", "valueProp", "defaultValue", "onValueChange", "onValueCommit", "ariaLabel", "ariaLabelledBy", "rootProps", "min", "max", "uncontrolledValue", "setUncontrolledValue", "isControlled", "currentValue", "tickIdPrefix", "step", "sortedTicks", "a", "b", "snapToNearestTick", "value", "nearest", "tick", "snapKeyStep", "previous", "keyboardChangeRef", "formatValueText", "values", "formatValue", "val", "direction", "Direction", "orientation", "flipped", "tickElements", "index", "percentage", "announceRef", "announceTimeoutRef", "announce", "handleValueChange", "newValue", "finalValue", "v", "i", "SliderPrimitive", "event", "classNames", "distance", "best", "x", "y"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/sheet.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\n/**\n * Sheet\n *\n * A side-placed overlay built on top of Radix Dialog. It inherits accessibility,\n * focus management, overlay behavior, and sizing scales from the base dialog, and\n * adds side placement and slide motion suited for navigation panels and drawers.\n *\n * Structure mirrors Dialog:\n * - Root, Trigger, Content, Title, Description, Close\n *\n * Notes\n * - Side: set with `side` on `Sheet.Content`. Aliases: `left` \u2192 `start`, `right` \u2192 `end`.\n * - Sizing: reuses Dialog content prop defs (width/min/max/height/size). Size follows the\n * Theme size; start/end sheets cap at the size's overlay width unless maxWidth is set.\n * - A11y: provide an accessible name via `Sheet.Title` or `aria-label` on `Sheet.Content`.\n * Radix owns the focus trap, initial focus and the return of focus to the trigger.\n *\n * Example\n * <Sheet.Root>\n * <Sheet.Trigger>\n * <Button>Open</Button>\n * </Sheet.Trigger>\n * <Sheet.Content side=\"end\" width={{ initial: '280px', md: '360px' }}>\n * <Sheet.Title>Details</Sheet.Title>\n * ...\n * <Sheet.Close>\n * <Button>Close</Button>\n * </Sheet.Close>\n * </Sheet.Content>\n * </Sheet.Root>\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { dialogContentPropDefs } from './dialog.props.js';\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport { Theme } from './theme.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../helpers/theme-size.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { HeadingProps } from './heading.js';\n\n/**\n * Supported sides for the Sheet.\n * Aliases are normalized RTL-aware: `left` \u2192 `start`, `right` \u2192 `end`.\n */\ntype SheetSide = 'start' | 'end' | 'top' | 'bottom' | 'left' | 'right';\n\n/**\n * Sheet is a side-placed overlay built on the Dialog primitive.\n * It reuses Dialog's accessibility, focus, overlay, and size scales, while adding side placement and slide motion.\n */\n\n// Root\n/**\n * Props for `Sheet.Root` (Radix Dialog root with `modal` forced on).\n */\ninterface SheetRootProps extends ComponentPropsWithout<typeof DialogPrimitive.Root, 'modal'> {}\nconst Root: React.FC<SheetRootProps> = (props) => <DialogPrimitive.Root {...props} modal />;\nRoot.displayName = 'Sheet.Root';\n\n// Trigger\n/** Element type for `Sheet.Trigger`. */\ntype SheetTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\n/** Props for `Sheet.Trigger` (expects a single element child). */\ninterface SheetTriggerProps extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst Trigger = React.forwardRef<SheetTriggerElement, SheetTriggerProps>(({ children, ...props }, ref) => (\n <DialogPrimitive.Trigger {...props} ref={ref} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n));\nTrigger.displayName = 'Sheet.Trigger';\n\n// Content\n/** Element type for `Sheet.Content`. */\n// Reuse dialog content prop defs for size/width/height tokens.\n// Built once at module scope: `extractProps` memoises on the identity of the\n// prop def objects it is handed, so rebuilding these per render would recompile\n// them every time a sheet renders.\nconst { align: _alignPropDef, ...dialogPropDefsForSheet } = dialogContentPropDefs;\nconst sheetPropDefs = dialogPropDefsForSheet;\n\n/** Counts the Sheet.Title elements mounted inside a Sheet.Content, for the dev-only name check. */\nconst SheetTitleCountContext = React.createContext<React.MutableRefObject<number> | null>(null);\n\ntype SheetContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface SheetContentProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>,\n Omit<DialogContentOwnProps, 'align'> {\n /** Side where the Sheet should appear. `left`/`right` alias to `start`/`end`. */\n side?: SheetSide;\n /** Optional DOM container to portal into. Defaults to `document.body`. */\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\n\n/**\n * Renders the Sheet panel. Normalizes left/right to logical start/end and\n * forwards dialog sizing props. Provide an accessible name via `Sheet.Title`\n * or `aria-label`.\n */\nconst Content = React.forwardRef<SheetContentElement, SheetContentProps>((allProps, forwardedRef) => {\n const { side = 'start', forceMount, container, className, ...ownProps } = allProps;\n const restProps = useThemeSizeProps(ownProps, sheetPropDefs.size);\n const normalizedSideMap: Record<SheetSide, 'start' | 'end' | 'top' | 'bottom'> = {\n left: 'start',\n right: 'end',\n start: 'start',\n end: 'end',\n top: 'top',\n bottom: 'bottom',\n };\n const normalizedSide = normalizedSideMap[side];\n // Size/width/height class names come from the dialog defs \u2014 see `sheetPropDefs`.\n const { className: extractedClassName, ...contentProps } = extractProps(restProps, sheetPropDefs);\n\n // Dev-only a11y guard: the panel needs a name. A Sheet.Title anywhere inside counts it\n // in a layout effect, which runs before this ref is attached, so nesting doesn't matter.\n const titleCountRef = React.useRef(0);\n const combinedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n if (process.env.NODE_ENV !== 'production' && node) {\n const hasName = titleCountRef.current > 0 || Boolean(node.getAttribute('aria-label')) || Boolean(node.getAttribute('aria-labelledby'));\n if (!hasName) {\n console.warn('Sheet.Content: Missing accessible name. Include Sheet.Title inside it or provide aria-label.');\n }\n }\n },\n [forwardedRef],\n );\n\n useBodyPointerEventsCleanup();\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <SheetTitleCountContext.Provider value={titleCountRef}>\n <Theme asChild>\n <DialogPrimitive.Overlay className=\"kui-BaseDialogOverlay kui-DialogOverlay kui-SheetOverlay\">\n <DialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('kui-BaseDialogContent', 'kui-SheetContent', className, extractedClassName)}\n data-side={normalizedSide}\n aria-modal=\"true\"\n />\n </DialogPrimitive.Overlay>\n </Theme>\n </SheetTitleCountContext.Provider>\n </DialogPrimitive.Portal>\n );\n});\nContent.displayName = 'Sheet.Content';\n\n// Title - renders as Heading with sensible defaults\ntype SheetTitleElement = React.ElementRef<typeof Heading>;\ntype SheetTitleProps = HeadingProps;\n/** Accessible title for the Sheet. Renders as Heading with sensible defaults. */\nconst Title = React.forwardRef<SheetTitleElement, SheetTitleProps>(({ size = '4', weight = 'medium', ...props }, ref) => {\n const titleCountRef = React.useContext(SheetTitleCountContext);\n React.useLayoutEffect(() => {\n if (!titleCountRef) return;\n titleCountRef.current += 1;\n return () => {\n titleCountRef.current -= 1;\n };\n }, [titleCountRef]);\n return (\n <DialogPrimitive.Title asChild>\n <Heading ref={ref} size={size} weight={weight} {...props} />\n </DialogPrimitive.Title>\n );\n});\nTitle.displayName = 'Sheet.Title';\n\n// Description - renders as Text with sensible defaults\ntype SheetDescriptionElement = React.ElementRef<typeof Text>;\ntype SheetDescriptionProps = React.ComponentPropsWithoutRef<typeof Text>;\n/** Supplementary description text for Sheet content. Renders as Text with sensible defaults. */\nconst Description = React.forwardRef<SheetDescriptionElement, SheetDescriptionProps>(({ size = '2', emphasis = 'medium', ...rest }, ref) => (\n <DialogPrimitive.Description asChild>\n <Text ref={ref} size={size} emphasis={emphasis} {...rest} />\n </DialogPrimitive.Description>\n));\nDescription.displayName = 'Sheet.Description';\n\ntype SheetCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface SheetCloseProps extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\n/** Close button for the Sheet. Expects a single element child rendered via `asChild`. */\nconst Close = React.forwardRef<SheetCloseElement, SheetCloseProps>(({ children, ...props }, ref) => (\n <DialogPrimitive.Close {...props} ref={ref} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n));\nClose.displayName = 'Sheet.Close';\n\nexport { Root, Trigger, Content, Title, Description, Close };\nexport type {\n SheetRootProps as RootProps,\n SheetTriggerProps as TriggerProps,\n SheetContentProps as ContentProps,\n SheetTitleProps as TitleProps,\n SheetDescriptionProps as DescriptionProps,\n SheetCloseProps as CloseProps,\n};\n"],
|
|
5
|
-
"mappings": ";mWAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAkCA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,UAAUC,MAAuB,WA+B1C,IAAMC,EAAkCC,GAAU,gBAACC,EAAgB,KAAhB,CAAsB,GAAGD,EAAO,MAAK,GAAC,EACzFD,EAAK,YAAc,aAOnB,IAAMG,EAAgB,aAAmD,CAAC,CAAE,SAAAC,EAAU,GAAGH,CAAM,EAAGI,IAChG,gBAACH,EAAgB,QAAhB,CAAyB,GAAGD,EAAO,IAAKI,EAAK,QAAO,IAClDC,EAAoBF,CAAQ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Ac,SAAW,EAClB,IAAM,CACXA,EAAc,SAAW,CAC3B,CACF,EAAG,CAACA,CAAa,CAAC,EAEhB,gBAACxB,EAAgB,MAAhB,CAAsB,QAAO,IAC5B,gBAACiC,EAAA,CAAQ,IAAK9B,EAAK,KAAM4B,EAAM,OAAQC,EAAS,GAAGjC,EAAO,CAC5D,CAEJ,CAAC,EACD+B,EAAM,YAAc,cAMpB,IAAMI,EAAoB,aAA2D,CAAC,CAAE,KAAAH,EAAO,IAAK,SAAAI,EAAW,SAAU,GAAGC,CAAK,EAAGjC,IAClI,gBAACH,EAAgB,YAAhB,CAA4B,QAAO,IAClC,gBAACqC,EAAA,CAAK,IAAKlC,EAAK,KAAM4B,EAAM,SAAUI,EAAW,GAAGC,EAAM,CAC5D,CACD,EACDF,EAAY,YAAc,oBAK1B,IAAMI,EAAc,aAA+C,CAAC,CAAE,SAAApC,EAAU,GAAGH,CAAM,EAAGI,IAC1F,gBAACH,EAAgB,MAAhB,CAAuB,GAAGD,EAAO,IAAKI,EAAK,QAAO,IAChDC,EAAoBF,CAAQ,CAC/B,CACD,EACDoC,EAAM,YAAc",
|
|
6
|
-
"names": ["sheet_exports", "__export", "Close", "Content", "Description", "Root", "Title", "Trigger", "React", "classNames", "DialogPrimitive", "Root", "props", "DialogPrimitive", "Trigger", "children", "ref", "requireReactElement", "_alignPropDef", "dialogPropDefsForSheet", "dialogContentPropDefs", "sheetPropDefs", "SheetTitleCountContext", "Content", "allProps", "forwardedRef", "side", "forceMount", "container", "className", "ownProps", "restProps", "useThemeSizeProps", "normalizedSide", "extractedClassName", "contentProps", "extractProps", "titleCountRef", "combinedRef", "node", "useBodyPointerEventsCleanup", "Theme", "classNames", "Title", "size", "weight", "Heading", "Description", "emphasis", "rest", "Text", "Close"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/checkbox-group.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Context } from 'radix-ui/internal';\n\nimport * as CheckboxGroupPrimitive from './checkbox-group.primitive.js';\nimport { createCheckboxGroupScope } from './checkbox-group.primitive.js';\nimport { checkboxGroupRootPropDefs } from './checkbox-group.props.js';\nimport { ThickCheckIcon } from './icons.js';\nimport { Text } from './text.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSize } from '../helpers/theme-size.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\nconst CHECKBOX_GROUP_NAME = 'CheckboxGroup';\n\ntype ScopedProps<P> = P & { __scopeCheckboxGroup?: Context.Scope };\nconst [createCheckboxGroupContext] = Context.createContextScope(CHECKBOX_GROUP_NAME, [\n createCheckboxGroupScope,\n]);\nconst useCheckboxGroupScope = createCheckboxGroupScope();\n\ntype CheckboxGroupRootOwnProps = GetPropDefTypes<typeof checkboxGroupRootPropDefs>;\ntype CheckboxGroupContextValue = CheckboxGroupRootOwnProps;\n\nconst [CheckboxGroupProvider, useCheckboxGroupContext] =\n createCheckboxGroupContext<CheckboxGroupContextValue>(CHECKBOX_GROUP_NAME);\n\ntype CheckboxGroupRootElement = React.ElementRef<typeof CheckboxGroupPrimitive.Root>;\ninterface CheckboxGroupRootProps\n extends ComponentPropsWithout<\n typeof CheckboxGroupPrimitive.Root,\n 'asChild' | 'color' | 'defaultChecked'\n >,\n CheckboxGroupRootOwnProps {}\nconst CheckboxGroupRoot = React.forwardRef<CheckboxGroupRootElement, CheckboxGroupRootProps>(\n (\n {\n color = checkboxGroupRootPropDefs.color.default,\n size: sizeProp,\n variant = checkboxGroupRootPropDefs.variant.default,\n ...props\n }: ScopedProps<CheckboxGroupRootProps>,\n forwardedRef,\n ) => {\n const size = useThemeSize(sizeProp, checkboxGroupRootPropDefs.size);\n const { __scopeCheckboxGroup, className, ...rootProps } = props;\n const checkboxGroupScope = useCheckboxGroupScope(__scopeCheckboxGroup);\n return (\n <CheckboxGroupProvider\n scope={__scopeCheckboxGroup}\n color={color}\n size={size}\n variant={variant}\n >\n <CheckboxGroupPrimitive.Root\n {...checkboxGroupScope}\n {...rootProps}\n ref={forwardedRef}\n className={classNames('kui-CheckboxGroupRoot', className)}\n />\n </CheckboxGroupProvider>\n );\n },\n);\nCheckboxGroupRoot.displayName = 'CheckboxGroup.Root';\n\ntype CheckboxGroupItemElement = React.ElementRef<typeof CheckboxGroupPrimitive.Item>;\ninterface CheckboxGroupItemProps\n extends ComponentPropsWithout<typeof CheckboxGroupPrimitive.Item, RemovedProps> {}\nconst CheckboxGroupItem = React.forwardRef<CheckboxGroupItemElement, CheckboxGroupItemProps>(\n (_props: ScopedProps<CheckboxGroupItemProps>, forwardedRef) => {\n const { __scopeCheckboxGroup, children, className, style, ...props } = _props;\n const { size } = useCheckboxGroupContext('CheckboxGroupItem', __scopeCheckboxGroup);\n\n // Render `<Text as=\"label\">` if children\u00A0are provided, otherwise render\n // the solo checkbox to allow building out your custom layouts with it.\n if (children) {\n return (\n <Text\n as=\"label\"\n size={size}\n className={classNames('kui-CheckboxGroupItem', className)}\n style={style}\n >\n <CheckboxGroupItemCheckbox\n __scopeCheckboxGroup={__scopeCheckboxGroup}\n {...props}\n ref={forwardedRef}\n />\n {children && <span className=\"kui-CheckboxGroupItemInner\">{children}</span>}\n </Text>\n );\n }\n\n return (\n <CheckboxGroupItemCheckbox\n __scopeCheckboxGroup={__scopeCheckboxGroup}\n {...props}\n ref={forwardedRef}\n className={className}\n style={style}\n />\n );\n },\n);\nCheckboxGroupItem.displayName = 'CheckboxGroup.Item';\n\ntype CheckboxGroupItemCheckboxElement = React.ElementRef<typeof CheckboxGroupPrimitive.Item>;\ninterface CheckboxGroupItemCheckboxProps\n extends ComponentPropsWithout<typeof CheckboxGroupPrimitive.Item, RemovedProps> {}\nconst CheckboxGroupItemCheckbox = React.forwardRef<\n CheckboxGroupItemCheckboxElement,\n ScopedProps<CheckboxGroupItemCheckboxProps>\n>(({ __scopeCheckboxGroup, ...props }, forwardedRef) => {\n const context = useCheckboxGroupContext('CheckboxGroupItemCheckbox', __scopeCheckboxGroup);\n const checkboxGroupScope = useCheckboxGroupScope(__scopeCheckboxGroup);\n const { color, className } = extractProps(\n { ...props, ...context },\n checkboxGroupRootPropDefs,\n );\n return (\n <CheckboxGroupPrimitive.Item\n {...checkboxGroupScope}\n data-accent-color={color}\n {...props}\n ref={forwardedRef}\n className={classNames(\n 'kui-reset',\n 'kui-BaseCheckboxRoot',\n 'kui-CheckboxGroupItemCheckbox',\n className,\n )}\n >\n <CheckboxGroupPrimitive.Indicator\n {...checkboxGroupScope}\n asChild\n className=\"kui-BaseCheckboxIndicator\"\n >\n <ThickCheckIcon />\n </CheckboxGroupPrimitive.Indicator>\n </CheckboxGroupPrimitive.Item>\n );\n});\nCheckboxGroupItemCheckbox.displayName = 'CheckboxGroup.ItemCheckbox';\n\nexport { CheckboxGroupRoot as Root, CheckboxGroupItem as Item };\nexport type { CheckboxGroupRootProps as RootProps, CheckboxGroupItemProps as ItemProps };\n"],
|
|
5
|
-
"mappings": ";wSAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,SAAAC,IAEA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,WAAAC,MAAe,oBAaxB,IAAMC,EAAsB,gBAGtB,CAACC,CAA0B,EAAIC,EAAQ,mBAAmBF,EAAqB,CACnFG,CACF,CAAC,EACKC,EAAwBD,EAAyB,EAKjD,CAACE,EAAuBC,CAAuB,EACnDL,EAAsDD,CAAmB,EASrEO,EAA0B,aAC9B,CACE,CACE,MAAAC,EAAQC,EAA0B,MAAM,QACxC,KAAMC,EACN,QAAAC,EAAUF,EAA0B,QAAQ,QAC5C,GAAGG,CACL,EACAC,IACG,CACH,IAAMC,EAAOC,EAAaL,EAAUD,EAA0B,IAAI,EAC5D,CAAE,qBAAAO,EAAsB,UAAAC,EAAW,GA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,GAAGZ,EACJ,QAAO,GACP,UAAU,6BAEV,gBAACa,EAAA,IAAe,CAClB,CACF,CAEJ,CAAC,EACDL,EAA0B,YAAc",
|
|
6
|
-
"names": ["checkbox_group_exports", "__export", "CheckboxGroupItem", "CheckboxGroupRoot", "React", "classNames", "Context", "CHECKBOX_GROUP_NAME", "createCheckboxGroupContext", "Context", "createCheckboxGroupScope", "useCheckboxGroupScope", "CheckboxGroupProvider", "useCheckboxGroupContext", "CheckboxGroupRoot", "color", "checkboxGroupRootPropDefs", "sizeProp", "variant", "props", "forwardedRef", "size", "useThemeSize", "__scopeCheckboxGroup", "className", "rootProps", "checkboxGroupScope", "Root", "classNames", "CheckboxGroupItem", "_props", "children", "style", "Text", "CheckboxGroupItemCheckbox", "context", "extractProps", "Item", "Indicator", "ThickCheckIcon"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/props/font-family.prop.ts"],
|
|
4
|
-
"sourcesContent": ["import type { PropDef } from './prop-def.js';\n\nconst fontFamilies = ['sans', 'mono', 'serif'] as const;\n\nconst fontFamilyPropDef = {\n font: {\n type: 'enum',\n className: 'kui-r-ff',\n values: fontFamilies,\n },\n} satisfies {\n font: PropDef<(typeof fontFamilies)[number]>;\n};\n\nexport { fontFamilyPropDef };\n"],
|
|
5
|
-
"mappings": "AAEA,IAAMA,EAAe,CAAC,OAAQ,OAAQ,OAAO,EAEvCC,EAAoB,CACxB,KAAM,CACJ,KAAM,OACN,UAAW,WACX,OAAQD,CACV,CACF",
|
|
6
|
-
"names": ["fontFamilies", "fontFamilyPropDef"]
|
|
7
|
-
}
|