@womp/kookie-ui 0.26.2 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components.css +165 -4
- package/dist/cjs/components/_internal/base-button.js +1 -1
- package/dist/cjs/components/_internal/base-button.js.map +2 -2
- package/dist/cjs/components/_internal/pane-band-context.d.ts +4 -3
- package/dist/cjs/components/_internal/pane-band-context.d.ts.map +1 -1
- package/dist/cjs/components/_internal/pane-band-context.js.map +2 -2
- package/dist/cjs/components/_internal/pane-chrome.d.ts +7 -1
- package/dist/cjs/components/_internal/pane-chrome.d.ts.map +1 -1
- package/dist/cjs/components/_internal/pane-chrome.js +1 -1
- package/dist/cjs/components/_internal/pane-chrome.js.map +4 -4
- package/dist/cjs/components/_internal/portal-theme.d.ts +9 -0
- package/dist/cjs/components/_internal/portal-theme.d.ts.map +1 -0
- package/dist/cjs/components/_internal/portal-theme.js +3 -0
- package/dist/cjs/components/_internal/portal-theme.js.map +7 -0
- package/dist/cjs/components/_internal/shell-page-scroll.d.ts +15 -0
- package/dist/cjs/components/_internal/shell-page-scroll.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-page-scroll.js +3 -0
- package/dist/cjs/components/_internal/shell-page-scroll.js.map +7 -0
- package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
- package/dist/cjs/components/_internal/shell-sidebar.js.map +4 -4
- package/dist/cjs/components/alert-dialog.js +1 -1
- package/dist/cjs/components/alert-dialog.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/chatbar.js +1 -1
- package/dist/cjs/components/chatbar.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.d.ts.map +1 -1
- package/dist/cjs/components/combobox.js +1 -1
- package/dist/cjs/components/combobox.js.map +4 -4
- package/dist/cjs/components/context-menu.d.ts.map +1 -1
- package/dist/cjs/components/context-menu.js +1 -1
- package/dist/cjs/components/context-menu.js.map +4 -4
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +4 -4
- package/dist/cjs/components/dropdown-menu.d.ts.map +1 -1
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +4 -4
- package/dist/cjs/components/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/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/schemas/index.js +1 -1
- package/dist/cjs/components/schemas/index.js.map +2 -2
- package/dist/cjs/components/schemas/shell.schema.d.ts +1 -0
- package/dist/cjs/components/schemas/shell.schema.d.ts.map +1 -1
- package/dist/cjs/components/schemas/shell.schema.js +1 -1
- package/dist/cjs/components/schemas/shell.schema.js.map +2 -2
- package/dist/cjs/components/select.d.ts.map +1 -1
- 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.d.ts +11 -0
- package/dist/cjs/components/shell.d.ts.map +1 -1
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +4 -4
- package/dist/cjs/components/sidebar.js +1 -1
- package/dist/cjs/components/sidebar.js.map +4 -4
- package/dist/cjs/components/spinner.d.ts.map +1 -1
- package/dist/cjs/components/spinner.js +1 -1
- package/dist/cjs/components/spinner.js.map +2 -2
- package/dist/cjs/components/text-area.d.ts.map +1 -1
- package/dist/cjs/components/text-area.js +1 -1
- package/dist/cjs/components/text-area.js.map +2 -2
- package/dist/cjs/components/text-field.d.ts.map +1 -1
- package/dist/cjs/components/text-field.js +2 -2
- package/dist/cjs/components/text-field.js.map +2 -2
- package/dist/cjs/components/theme.d.ts.map +1 -1
- package/dist/cjs/components/theme.js +1 -1
- package/dist/cjs/components/theme.js.map +4 -4
- package/dist/cjs/components/toggle.js +1 -1
- package/dist/cjs/components/toggle.js.map +4 -4
- package/dist/cjs/components/toolbar.js +1 -1
- package/dist/cjs/components/toolbar.js.map +4 -4
- package/dist/cjs/components/tooltip.js +1 -1
- package/dist/cjs/components/tooltip.js.map +4 -4
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +4 -4
- package/dist/esm/{chunk-6M6HGIGN.js → chunk-25ZRMILM.js} +2 -2
- package/dist/esm/chunk-2E57H3NH.js +3 -0
- package/dist/esm/chunk-2E57H3NH.js.map +7 -0
- package/dist/esm/chunk-2S7HPQVX.js +3 -0
- package/dist/esm/chunk-2S7HPQVX.js.map +7 -0
- package/dist/esm/{chunk-UG73IGRF.js → chunk-2ZKEQS76.js} +2 -2
- package/dist/esm/{chunk-H2TSRYQ5.js → chunk-324VC67W.js} +2 -2
- package/dist/esm/{chunk-UR5BUNNT.js → chunk-3MFSQ6PN.js} +2 -2
- package/dist/esm/{chunk-OTCVSJT7.js → chunk-4MNRLB57.js} +2 -2
- package/dist/esm/{chunk-TFFU435D.js → chunk-5BX2YZV6.js} +2 -2
- package/dist/esm/chunk-5BX2YZV6.js.map +7 -0
- package/dist/esm/chunk-67UEMB4K.js +3 -0
- package/dist/esm/chunk-67UEMB4K.js.map +7 -0
- package/dist/esm/chunk-6HEORZNJ.js +3 -0
- package/dist/esm/chunk-6HEORZNJ.js.map +7 -0
- package/dist/esm/{chunk-K55IQP5H.js → chunk-6YWHNLSC.js} +2 -2
- package/dist/esm/chunk-6YWHNLSC.js.map +7 -0
- package/dist/esm/{chunk-NYBE3U3V.js → chunk-7QBNXNEN.js} +2 -2
- package/dist/esm/{chunk-E6BDD3PN.js → chunk-7V6M3MIR.js} +2 -2
- package/dist/esm/{chunk-KQIZMPSW.js → chunk-ANQLWGFN.js} +1 -1
- package/dist/esm/{chunk-KQIZMPSW.js.map → chunk-ANQLWGFN.js.map} +2 -2
- package/dist/esm/chunk-AQKSO3SW.js +3 -0
- package/dist/esm/chunk-AQKSO3SW.js.map +7 -0
- package/dist/esm/{chunk-ONJYRJ66.js → chunk-B6OFKABP.js} +2 -2
- package/dist/esm/chunk-BUXK5VGR.js +3 -0
- package/dist/esm/chunk-BUXK5VGR.js.map +7 -0
- package/dist/esm/{chunk-7QP6JFPO.js → chunk-C67MM24U.js} +2 -2
- package/dist/esm/chunk-CZ24FOFS.js +3 -0
- package/dist/esm/chunk-CZ24FOFS.js.map +7 -0
- package/dist/esm/{chunk-LFAUMDU5.js → chunk-D2C2A2ZK.js} +2 -2
- package/dist/esm/{chunk-UBUGG2OB.js → chunk-DP7MPGR7.js} +2 -2
- package/dist/esm/{chunk-BVQDDN5Q.js → chunk-EB4AG3OL.js} +2 -2
- package/dist/esm/{chunk-5PQCTVZB.js → chunk-ENQV6SEA.js} +2 -2
- package/dist/esm/{chunk-VVLUY4WR.js → chunk-EPGIYTFK.js} +2 -2
- package/dist/esm/{chunk-2TWPPDII.js → chunk-FMVOB367.js} +2 -2
- package/dist/esm/chunk-FVRVBB6O.js +3 -0
- package/dist/esm/chunk-FVRVBB6O.js.map +7 -0
- package/dist/esm/{chunk-TFFMELAL.js → chunk-FYTLUDL3.js} +2 -2
- package/dist/esm/{chunk-W4CPV4PO.js → chunk-H2J25HXP.js} +2 -2
- package/dist/esm/{chunk-C2WKAIZM.js → chunk-H73AMXCH.js} +2 -2
- package/dist/esm/{chunk-AJANJ22M.js → chunk-HBO7W7SS.js} +2 -2
- package/dist/esm/{chunk-F364PDDM.js → chunk-HLIOHDEX.js} +2 -2
- package/dist/esm/{chunk-5FWEGTP6.js → chunk-HR2VHGJ5.js} +2 -2
- package/dist/esm/chunk-HR2VHGJ5.js.map +7 -0
- package/dist/esm/{chunk-ZKQCSGL3.js → chunk-ISCZ57VL.js} +2 -2
- package/dist/esm/{chunk-TFGUTYZK.js → chunk-J54GYD7A.js} +2 -2
- package/dist/esm/{chunk-HVMRB3AH.js → chunk-JD4KR6VZ.js} +2 -2
- package/dist/esm/{chunk-MS2ONKJJ.js → chunk-JKQN6QCP.js} +2 -2
- package/dist/esm/{chunk-NS573D6O.js → chunk-JP36JSNP.js} +2 -2
- package/dist/esm/chunk-K3GDM26A.js +3 -0
- package/dist/esm/{chunk-M7IQIKB4.js.map → chunk-K3GDM26A.js.map} +2 -2
- package/dist/esm/{chunk-ULCHGKI3.js → chunk-KJZSXLIX.js} +2 -2
- package/dist/esm/{chunk-N3B6EGXL.js → chunk-LABMK6Q7.js} +2 -2
- package/dist/esm/{chunk-VIVM525H.js → chunk-MGWGD6KI.js} +2 -2
- package/dist/esm/{chunk-RD4T2MCC.js → chunk-MJKVVGGV.js} +2 -2
- package/dist/esm/chunk-MJKVVGGV.js.map +7 -0
- package/dist/esm/{chunk-TXVZOS3E.js → chunk-MMDZBPSX.js} +2 -2
- package/dist/esm/{chunk-EERKYRYI.js → chunk-NWXODCTD.js} +2 -2
- package/dist/esm/{chunk-VCZ2GYOF.js → chunk-Q5SANVIW.js} +2 -2
- package/dist/esm/chunk-QEDKL23P.js +3 -0
- package/dist/esm/chunk-QEDKL23P.js.map +7 -0
- package/dist/esm/{chunk-LGZCNQBS.js → chunk-QPRUTOLI.js} +2 -2
- package/dist/esm/{chunk-TTW3EAQT.js → chunk-QRV32INS.js} +2 -2
- package/dist/esm/{chunk-3QN4C5LW.js → chunk-REORAMUH.js} +2 -2
- package/dist/esm/{chunk-GOXGRJO6.js → chunk-SUQJ7DD4.js} +2 -2
- package/dist/esm/chunk-TSWHVZ47.js +3 -0
- package/dist/esm/chunk-TSWHVZ47.js.map +7 -0
- package/dist/esm/chunk-VQDCHBZR.js +3 -0
- package/dist/esm/chunk-VQDCHBZR.js.map +7 -0
- package/dist/esm/{chunk-TF6WAIUQ.js → chunk-W4Z6ORYO.js} +2 -2
- package/dist/esm/{chunk-F2722F7B.js → chunk-WAXRIARV.js} +2 -2
- package/dist/esm/chunk-WAXRIARV.js.map +7 -0
- package/dist/esm/{chunk-ADL3LEOQ.js → chunk-WD66RYF6.js} +2 -2
- package/dist/esm/{chunk-DIY2XQKR.js → chunk-X7JHZ3HA.js} +2 -2
- package/dist/esm/{chunk-H33NTGVF.js → chunk-XD3C3GVF.js} +2 -2
- package/dist/esm/{chunk-VPUFKJQA.js → chunk-YMUERC2J.js} +2 -2
- package/dist/esm/chunk-ZOUIIO4C.js +6 -0
- package/dist/esm/chunk-ZOUIIO4C.js.map +7 -0
- package/dist/esm/components/_internal/base-button.js +1 -1
- package/dist/esm/components/_internal/base-menu.utils.js +1 -1
- package/dist/esm/components/_internal/menu-context.js +1 -1
- package/dist/esm/components/_internal/pane-band-context.d.ts +4 -3
- package/dist/esm/components/_internal/pane-band-context.d.ts.map +1 -1
- package/dist/esm/components/_internal/pane-band-context.js +1 -1
- package/dist/esm/components/_internal/pane-chrome.d.ts +7 -1
- package/dist/esm/components/_internal/pane-chrome.d.ts.map +1 -1
- package/dist/esm/components/_internal/pane-chrome.js +1 -1
- package/dist/esm/components/_internal/portal-theme.d.ts +9 -0
- package/dist/esm/components/_internal/portal-theme.d.ts.map +1 -0
- package/dist/esm/components/_internal/portal-theme.js +3 -0
- package/dist/esm/components/_internal/portal-theme.js.map +7 -0
- package/dist/esm/components/_internal/shell-bottom.js +1 -1
- package/dist/esm/components/_internal/shell-inspector.js +1 -1
- package/dist/esm/components/_internal/shell-page-scroll.d.ts +15 -0
- package/dist/esm/components/_internal/shell-page-scroll.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-page-scroll.js +3 -0
- package/dist/esm/components/_internal/shell-page-scroll.js.map +7 -0
- 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/blockquote.js +1 -1
- package/dist/esm/components/box.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/code.js +1 -1
- package/dist/esm/components/combobox.d.ts.map +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/context-menu.d.ts.map +1 -1
- package/dist/esm/components/context-menu.js +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dropdown-menu.d.ts.map +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/flex.js +1 -1
- package/dist/esm/components/grid.js +1 -1
- package/dist/esm/components/heading.js +1 -1
- package/dist/esm/components/image.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/kbd.js +1 -1
- package/dist/esm/components/link.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/progress.js +1 -1
- package/dist/esm/components/radio-group.js +1 -1
- package/dist/esm/components/radio.js +1 -1
- package/dist/esm/components/schemas/index.js +1 -1
- package/dist/esm/components/schemas/shell.schema.d.ts +1 -0
- package/dist/esm/components/schemas/shell.schema.d.ts.map +1 -1
- package/dist/esm/components/schemas/shell.schema.js +1 -1
- package/dist/esm/components/scroll-area.js +1 -1
- package/dist/esm/components/segmented-control.js +1 -1
- package/dist/esm/components/select.d.ts.map +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/separator.js +1 -1
- package/dist/esm/components/sheet.js +1 -1
- package/dist/esm/components/shell.d.ts +11 -0
- package/dist/esm/components/shell.d.ts.map +1 -1
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/slider.js +1 -1
- package/dist/esm/components/spinner.d.ts.map +1 -1
- package/dist/esm/components/spinner.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.d.ts.map +1 -1
- package/dist/esm/components/text-area.js +1 -1
- package/dist/esm/components/text-field.d.ts.map +1 -1
- package/dist/esm/components/text-field.js +1 -1
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/theme.d.ts.map +1 -1
- package/dist/esm/components/theme.js +1 -1
- package/dist/esm/components/toggle.js +1 -1
- package/dist/esm/components/toolbar.js +1 -1
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/virtual-menu.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/schemas/index.json +6 -1
- package/schemas/shell-root.json +6 -1
- package/src/components/_internal/pane-band-context.ts +4 -3
- package/src/components/_internal/pane-chrome.tsx +15 -2
- package/src/components/_internal/portal-theme.tsx +18 -0
- package/src/components/_internal/shell-page-scroll.ts +49 -0
- package/src/components/alert-dialog.tsx +3 -3
- package/src/components/combobox.tsx +4 -3
- package/src/components/context-menu.tsx +6 -5
- package/src/components/dialog.tsx +3 -3
- package/src/components/dropdown-menu.tsx +6 -5
- package/src/components/popover.tsx +3 -3
- package/src/components/schemas/shell.schema.ts +4 -1
- package/src/components/select.tsx +4 -3
- package/src/components/sheet.tsx +3 -3
- package/src/components/shell.css +201 -0
- package/src/components/shell.tsx +128 -22
- package/src/components/spinner.css +16 -1
- package/src/components/spinner.tsx +14 -13
- package/src/components/text-area.css +7 -2
- package/src/components/text-area.tsx +10 -8
- package/src/components/text-field.css +7 -2
- package/src/components/text-field.tsx +10 -8
- package/src/components/theme.tsx +24 -30
- package/src/components/tooltip.tsx +3 -3
- package/styles.css +165 -4
- package/dist/esm/chunk-3C4Q6PMS.js +0 -3
- package/dist/esm/chunk-3C4Q6PMS.js.map +0 -7
- package/dist/esm/chunk-3ZWHKNHI.js +0 -3
- package/dist/esm/chunk-3ZWHKNHI.js.map +0 -7
- package/dist/esm/chunk-457Z4R5W.js +0 -3
- package/dist/esm/chunk-457Z4R5W.js.map +0 -7
- package/dist/esm/chunk-5FWEGTP6.js.map +0 -7
- package/dist/esm/chunk-5MEWNLNH.js +0 -3
- package/dist/esm/chunk-5MEWNLNH.js.map +0 -7
- package/dist/esm/chunk-BEHAT3GI.js +0 -3
- package/dist/esm/chunk-BEHAT3GI.js.map +0 -7
- package/dist/esm/chunk-DG2KIH54.js +0 -6
- package/dist/esm/chunk-DG2KIH54.js.map +0 -7
- package/dist/esm/chunk-DQCE7DHY.js +0 -3
- package/dist/esm/chunk-DQCE7DHY.js.map +0 -7
- package/dist/esm/chunk-F2722F7B.js.map +0 -7
- package/dist/esm/chunk-GE7FRBZ4.js +0 -3
- package/dist/esm/chunk-GE7FRBZ4.js.map +0 -7
- package/dist/esm/chunk-K55IQP5H.js.map +0 -7
- package/dist/esm/chunk-M7IQIKB4.js +0 -3
- package/dist/esm/chunk-POP5NB33.js +0 -3
- package/dist/esm/chunk-POP5NB33.js.map +0 -7
- package/dist/esm/chunk-RD4T2MCC.js.map +0 -7
- package/dist/esm/chunk-SCIFT27R.js +0 -3
- package/dist/esm/chunk-SCIFT27R.js.map +0 -7
- package/dist/esm/chunk-TFFU435D.js.map +0 -7
- /package/dist/esm/{chunk-6M6HGIGN.js.map → chunk-25ZRMILM.js.map} +0 -0
- /package/dist/esm/{chunk-UG73IGRF.js.map → chunk-2ZKEQS76.js.map} +0 -0
- /package/dist/esm/{chunk-H2TSRYQ5.js.map → chunk-324VC67W.js.map} +0 -0
- /package/dist/esm/{chunk-UR5BUNNT.js.map → chunk-3MFSQ6PN.js.map} +0 -0
- /package/dist/esm/{chunk-OTCVSJT7.js.map → chunk-4MNRLB57.js.map} +0 -0
- /package/dist/esm/{chunk-NYBE3U3V.js.map → chunk-7QBNXNEN.js.map} +0 -0
- /package/dist/esm/{chunk-E6BDD3PN.js.map → chunk-7V6M3MIR.js.map} +0 -0
- /package/dist/esm/{chunk-ONJYRJ66.js.map → chunk-B6OFKABP.js.map} +0 -0
- /package/dist/esm/{chunk-7QP6JFPO.js.map → chunk-C67MM24U.js.map} +0 -0
- /package/dist/esm/{chunk-LFAUMDU5.js.map → chunk-D2C2A2ZK.js.map} +0 -0
- /package/dist/esm/{chunk-UBUGG2OB.js.map → chunk-DP7MPGR7.js.map} +0 -0
- /package/dist/esm/{chunk-BVQDDN5Q.js.map → chunk-EB4AG3OL.js.map} +0 -0
- /package/dist/esm/{chunk-5PQCTVZB.js.map → chunk-ENQV6SEA.js.map} +0 -0
- /package/dist/esm/{chunk-VVLUY4WR.js.map → chunk-EPGIYTFK.js.map} +0 -0
- /package/dist/esm/{chunk-2TWPPDII.js.map → chunk-FMVOB367.js.map} +0 -0
- /package/dist/esm/{chunk-TFFMELAL.js.map → chunk-FYTLUDL3.js.map} +0 -0
- /package/dist/esm/{chunk-W4CPV4PO.js.map → chunk-H2J25HXP.js.map} +0 -0
- /package/dist/esm/{chunk-C2WKAIZM.js.map → chunk-H73AMXCH.js.map} +0 -0
- /package/dist/esm/{chunk-AJANJ22M.js.map → chunk-HBO7W7SS.js.map} +0 -0
- /package/dist/esm/{chunk-F364PDDM.js.map → chunk-HLIOHDEX.js.map} +0 -0
- /package/dist/esm/{chunk-ZKQCSGL3.js.map → chunk-ISCZ57VL.js.map} +0 -0
- /package/dist/esm/{chunk-TFGUTYZK.js.map → chunk-J54GYD7A.js.map} +0 -0
- /package/dist/esm/{chunk-HVMRB3AH.js.map → chunk-JD4KR6VZ.js.map} +0 -0
- /package/dist/esm/{chunk-MS2ONKJJ.js.map → chunk-JKQN6QCP.js.map} +0 -0
- /package/dist/esm/{chunk-NS573D6O.js.map → chunk-JP36JSNP.js.map} +0 -0
- /package/dist/esm/{chunk-ULCHGKI3.js.map → chunk-KJZSXLIX.js.map} +0 -0
- /package/dist/esm/{chunk-N3B6EGXL.js.map → chunk-LABMK6Q7.js.map} +0 -0
- /package/dist/esm/{chunk-VIVM525H.js.map → chunk-MGWGD6KI.js.map} +0 -0
- /package/dist/esm/{chunk-TXVZOS3E.js.map → chunk-MMDZBPSX.js.map} +0 -0
- /package/dist/esm/{chunk-EERKYRYI.js.map → chunk-NWXODCTD.js.map} +0 -0
- /package/dist/esm/{chunk-VCZ2GYOF.js.map → chunk-Q5SANVIW.js.map} +0 -0
- /package/dist/esm/{chunk-LGZCNQBS.js.map → chunk-QPRUTOLI.js.map} +0 -0
- /package/dist/esm/{chunk-TTW3EAQT.js.map → chunk-QRV32INS.js.map} +0 -0
- /package/dist/esm/{chunk-3QN4C5LW.js.map → chunk-REORAMUH.js.map} +0 -0
- /package/dist/esm/{chunk-GOXGRJO6.js.map → chunk-SUQJ7DD4.js.map} +0 -0
- /package/dist/esm/{chunk-TF6WAIUQ.js.map → chunk-W4Z6ORYO.js.map} +0 -0
- /package/dist/esm/{chunk-ADL3LEOQ.js.map → chunk-WD66RYF6.js.map} +0 -0
- /package/dist/esm/{chunk-DIY2XQKR.js.map → chunk-X7JHZ3HA.js.map} +0 -0
- /package/dist/esm/{chunk-H33NTGVF.js.map → chunk-XD3C3GVF.js.map} +0 -0
- /package/dist/esm/{chunk-VPUFKJQA.js.map → chunk-YMUERC2J.js.map} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as nt}from"./chunk-E6BDD3PN.js";import{a as Be}from"./chunk-WUCBFB25.js";import{a as we}from"./chunk-ULCHGKI3.js";import{a as Ae}from"./chunk-OTCVSJT7.js";import{a as De}from"./chunk-DQCE7DHY.js";import{a as ze}from"./chunk-KVVRFWGQ.js";import{g as Qe,h as Ze,j as et}from"./chunk-GKDGNPBD.js";import{b as U}from"./chunk-5KMEUZWN.js";import{b as tt}from"./chunk-5ON3XLRD.js";import{a as at}from"./chunk-VIVM525H.js";import{a as Ht}from"./chunk-VQPANPMI.js";var Wt={};Ht(Wt,{AttachTrigger:()=>Rt,Attachment:()=>$e,AttachmentsRow:()=>pt,InlineEnd:()=>mt,InlineStart:()=>dt,Item:()=>bt,Root:()=>lt,Row:()=>Ct,RowEnd:()=>vt,RowStart:()=>gt,Send:()=>yt,Textarea:()=>ut});import*as e from"react";import E from"classnames";import{useComposedRefs as st,useLayoutEffect as je}from"radix-ui/internal";import{useDropzone as Ft}from"react-dropzone";function ot(t,r){let{placeholder:a}=t;if(!a){r();return}t.placeholder="";try{r()}finally{t.placeholder=a}}var It={values:["1","2","3"]},it=e.createContext(null),We=e.createContext(""),I=()=>{let t=e.useContext(it);if(!t)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return t},me=t=>Array.isArray(t)?t:typeof t=="string"?t.split(",").map(r=>r.trim()).filter(Boolean):[],zt=(t,r)=>{if(r.length===0)return!0;let a=t.type.toLowerCase(),i=t.name.toLowerCase();for(let c of r){let l=c.toLowerCase();if(l.includes("/")){let[u,d]=l.split("/"),[g,y]=a.split("/");if(u==="*"||u===g&&(d==="*"||d===y))return!0}else if(l.startsWith(".")&&i.endsWith(l))return!0}return!1},Dt=/\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i,ct=(t,r)=>(r||"").toLowerCase().startsWith("image/")||Dt.test(t),Ve=t=>t.trim().length>0,rt=(t,r)=>`${t} ${r}${t===1?"":"s"}`,Bt=0,jt=()=>`chatbar-attachment-${Date.now()}-${++Bt}`,lt=e.forwardRef((t,r)=>{let{className:a,style:i,children:c,value:l,defaultValue:u="",onValueChange:d,open:g,defaultOpen:y=!1,onOpenChange:R,expandOn:p="both",minLines:v=3,maxLines:x=6,sendMode:w="whenDirty",disabled:b,readOnly:S,onSubmit:D,size:O,variant:z,color:H,radius:F,width:Q,maxWidth:f,attachments:_,defaultAttachments:B,onAttachmentsChange:se,accept:A,multiple:L=!0,maxAttachments:Z,maxFileSize:G,paste:j=!0,pasteAccept:q,clearOnSubmit:V=!0,onAttachmentReject:N,dropzone:M=!0,apiRef:ke,onBlurCapture:pe,notices:he,context:fe,...Se}=t,W=tt(O,It),Ee=l!=null,[n,C]=e.useState(u),k=Ee?l:n,ee=g!=null,[X,te]=e.useState(y),ie=ee?g:X,Y="attachments"in t,[ce,be]=e.useState(()=>B??[]),le=e.useMemo(()=>Y?_??[]:ce,[Y,_,ce]),[Ke,xt]=e.useState({text:"",id:0}),ue=e.useCallback(o=>xt(s=>({text:o,id:s.id+1})),[]),Ue=e.useRef(null),Pt=st(r,Ue),Te=e.useRef(null),Le=e.useRef(null),de=e.useRef(!1),Re=e.useRef(!1),Ce=e.useRef(void 0),Ne=e.useRef(null),_e=me(A).join(","),Me=me(q).join(","),Oe=e.useMemo(()=>me(_e),[_e]),At=e.useMemo(()=>Me?me(Me):Oe,[Me,Oe]),Ge={value:k,attachments:le,accepts:Oe,pasteAccepts:At,multiple:L,maxAttachments:Z,maxFileSize:G,disabled:b,readOnly:S,expandOn:p,isValueControlled:Ee,isOpenControlled:ee,isAttachmentsControlled:Y,onValueChange:d,onOpenChange:R,onAttachmentsChange:se,onAttachmentReject:N,onSubmit:D},P=e.useRef(Ge);P.current=Ge;let He=e.useRef(null),$=e.useCallback(()=>He.current??P.current.attachments,[]),ae=e.useCallback(o=>{P.current.isOpenControlled||te(o),P.current.onOpenChange?.(o)},[]),ge=e.useCallback(o=>{P.current.isValueControlled||C(o),P.current.onValueChange?.(o)},[]),ne=e.useCallback(o=>{He.current=o,queueMicrotask(()=>{He.current=null}),P.current.isAttachmentsControlled||be(o),P.current.onAttachmentsChange?.(o)},[]),ve=e.useRef(new Set),oe=e.useCallback((o,s,m=P.current.multiple)=>{let h=P.current;if(h.disabled||h.readOnly||o.length===0)return 0;let K=$(),J=[],re=[],Mt=typeof h.maxAttachments=="number"?Math.max(h.maxAttachments-K.length,0):1/0,Ot=m?1/0:1;for(let T of o){if(J.length>=Mt||J.length>=Ot){re.push({file:T,reason:"count"});continue}if(typeof h.maxFileSize=="number"&&T.size>h.maxFileSize){re.push({file:T,reason:"size"});continue}if(!zt(T,s)){re.push({file:T,reason:"type"});continue}let Ie=ct(T.name,T.type)?URL.createObjectURL(T):void 0;Ie&&ve.current.add(Ie),J.push({id:jt(),name:T.name,size:T.size,type:T.type,file:T,url:Ie,status:"idle"})}let Pe=[];return J.length>0&&(ne(K.concat(J)),h.expandOn!=="none"&&ae(!0),Pe.push(`${rt(J.length,"file")} attached.`)),re.length>0&&(h.onAttachmentReject?.(re),Pe.push(`${rt(re.length,"file")} could not be attached.`)),Pe.length>0&&ue(Pe.join(" ")),J.length},[$,ne,ae,ue]),ye=e.useCallback(o=>oe(o,P.current.accepts),[oe]),qe=e.useCallback(o=>oe(o,P.current.pasteAccepts),[oe]),Xe=e.useCallback(o=>{let s=$(),m=s.find(h=>h.id===o);m&&(ne(s.filter(h=>h.id!==o)),ue(`Removed ${m.name}.`))},[$,ne,ue]),Ye=e.useCallback(o=>{let s=P.current;if(s.disabled||s.readOnly)return!1;let m=$();if(!Ve(s.value)&&m.length===0)return!1;let h={value:s.value,attachments:m};if(o&&s.onSubmit)for(let K of m)K.url&&ve.current.delete(K.url);return s.onSubmit?.(h),o&&(ge(""),ne([])),!0},[$,ge,ne]);e.useEffect(()=>{let o=ve.current;if(o.size===0)return;let s=new Set(le.map(m=>m.url));for(let m of Array.from(o))s.has(m)||(URL.revokeObjectURL(m),o.delete(m))},[le]),e.useEffect(()=>{let o=ve.current;return()=>{if(!P.current.isAttachmentsControlled){for(let s of Array.from(o))URL.revokeObjectURL(s);o.clear()}}},[]);let xe=e.useCallback(o=>{let s=P.current,m=Le.current;if(clearTimeout(Ce.current),Re.current=!1,!m||s.disabled||s.readOnly)return;let h=o?.accept!=null?me(o.accept):s.accepts,K=o?.multiple??s.multiple;Ne.current={patterns:h,multiple:K},m.accept=h.join(","),m.multiple=K,de.current=!0,m.click(),setTimeout(()=>{document.hasFocus()&&(de.current=!1)},1e3)},[]),Je=e.useCallback(()=>{Re.current=!0,clearTimeout(Ce.current),Ce.current=setTimeout(()=>{Re.current=!1},800)},[]);e.useEffect(()=>()=>clearTimeout(Ce.current),[]),e.useEffect(()=>{let o=Le.current,s=()=>{de.current=!1};return window.addEventListener("focus",s),o?.addEventListener("cancel",s),()=>{window.removeEventListener("focus",s),o?.removeEventListener("cancel",s)}},[]);let wt=e.useCallback(o=>{let s=o.currentTarget,m=Array.from(s.files??[]),h=Ne.current;oe(m,h?.patterns??P.current.accepts,h?.multiple),de.current=!1,Ne.current=null,s.value=""},[oe]),kt=e.useCallback(o=>{pe?.(o);let s=P.current,m=Ue.current;if(!m||s.expandOn==="none")return;let h=o.relatedTarget;h&&m.contains(h)||de.current||Re.current||!Ve(s.value)&&$().length===0&&ae(!1)},[pe,ae,$]),St=e.useCallback(o=>{ye(o)},[ye]),{getRootProps:Et,isDragActive:Tt}=Ft({onDrop:St,onDragEnter:()=>ue(""),noClick:!0,noKeyboard:!0,noPaste:!0,disabled:!M||b||S}),Fe=M&&Tt;e.useImperativeHandle(ke,()=>({focusTextarea:()=>Te.current?.focus({preventScroll:!0}),openFilePicker:()=>xe()}),[xe]);let Lt=e.useCallback(o=>{if(b||o.pointerType==="mouse"&&o.button!==0)return;let s=o.target;s instanceof Element&&s.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')||(o.preventDefault(),Te.current?.focus({preventScroll:!0}))},[b]),Nt=e.useMemo(()=>({open:ie,setOpen:ae,setValue:ge,size:W,expandOn:p,minLines:v,maxLines:x,sendMode:w,disabled:b,readOnly:S,paste:j,clearOnSubmit:V,multiple:L,textareaRef:Te,attachments:le,removeAttachment:Xe,submit:Ye,appendFiles:ye,appendFilesFromPaste:qe,openFilePicker:xe,beginFilePickerPress:Je}),[ie,ae,ge,W,p,v,x,w,b,S,j,V,L,le,Xe,Ye,ye,qe,xe,Je]);return e.createElement(it.Provider,{value:Nt},e.createElement(We.Provider,{value:k},e.createElement(e.Fragment,null,e.createElement("div",{...Se,ref:Pt,className:E("kui-ChatbarRoot",`kui-r-size-${W}`,a),style:{position:"relative",width:Q,maxWidth:f,...i},"data-state":ie?"open":"closed","data-disabled":b?"":void 0,"data-readonly":S?"":void 0,"data-drop-active":Fe?"":void 0,"data-accent-color":H,"data-radius":F,onBlurCapture:kt},e.createElement("input",{ref:Le,type:"file",tabIndex:-1,"aria-hidden":!0,style:{display:"none"},onChange:wt}),he?e.createElement("div",{className:"kui-ChatbarNotices"},e.createElement(nt.Provider,{value:W},he)):null,e.createElement("div",{...M?Et():{},style:{width:"100%",flex:"1 1 auto",minHeight:0},onPointerDown:Lt},e.createElement("div",{className:E("kui-ChatbarBox",`kui-variant-${z??"raised"}`),style:{position:"relative"},"data-accent-color":H,"data-radius":F},e.createElement("div",{className:"kui-ChatbarGrid"},c),Fe&&e.createElement("div",{className:"kui-ChatbarDropOverlay","aria-hidden":!0},e.createElement("div",{className:"kui-ChatbarDropContent"},e.createElement(Ae,{emphasis:"medium",size:W,weight:"medium"},"Drop files here to attach"))))),fe?e.createElement(Ae,{as:"div",size:W==="3"?"2":"1",emphasis:"medium",className:"kui-ChatbarContext"},fe):null,e.createElement(Be,{role:"status","aria-live":"polite"},Fe?"Drop files here to attach.":e.createElement("span",{key:Ke.id},Ke.text))))))});lt.displayName="Chatbar.Root";var ut=e.forwardRef((t,r)=>{let{className:a,style:i,asChild:c,onFocus:l,onChange:u,onPaste:d,onKeyDown:g,onCompositionStart:y,onCompositionEnd:R,submitOnEnter:p=!1,...v}=t,x=I(),w=e.useContext(We),{open:b,minLines:S,maxLines:D,expandOn:O,disabled:z,readOnly:H,setOpen:F,setValue:Q,textareaRef:f,paste:_,appendFilesFromPaste:B,size:se,submit:A,clearOnSubmit:L}=x,Z=st(r,f),G=e.useRef(0),j=e.useRef(0),q=e.useRef(!1),V=e.useRef({open:b,minLines:S,maxLines:D});je(()=>{V.current={open:b,minLines:S,maxLines:D}},[b,S,D]);let N=e.useCallback(()=>{let n=f.current;if(!n)return;let C=window.getComputedStyle(n);G.current=parseFloat(C.lineHeight)||20,j.current=(parseFloat(C.paddingTop)||0)+(parseFloat(C.paddingBottom)||0)},[f]),M=e.useCallback((n,C)=>{let{minLines:k,maxLines:ee}=V.current,X=G.current,te=j.current,ie=Math.ceil((C?k:1)*X)+te,Y=Math.ceil((C?ee:1)*X)+te,ce=Math.max(n.scrollHeight,ie);n.style.height=`${Math.min(ce,Y)}px`;let be=ce>Y;n.style.overflowY=be?"auto":"hidden",n.style.maxHeight=be?`${Y}px`:"none"},[]);je(()=>{N()},[N,se]),je(()=>{let n=f.current;n&&(G.current===0&&N(),ot(n,()=>{n.style.height="auto";let C=b;if(!b&&(O==="overflow"||O==="both")){let k=Math.ceil(G.current)+j.current;n.scrollHeight>k+1&&(C=!0,F(!0))}M(n,C)}))},[w,b,O,S,D,se,F,f,N,M]),e.useEffect(()=>{let n=f.current;if(!n||typeof ResizeObserver>"u")return;let C=-1,k=new ResizeObserver(ee=>{let X=ee[0]?.contentRect.width??0;if(X===C)return;let te=C===-1;C=X,!te&&(N(),ot(n,()=>{n.style.height="auto",M(n,V.current.open)}))});return k.observe(n),()=>k.disconnect()},[f,N,M]),e.useEffect(()=>{},[]);let ke=e.useCallback(n=>{l?.(n),!(z||H)&&(O==="focus"||O==="both")&&!b&&F(!0)},[z,H,O,b,F,l]),pe=e.useCallback(n=>{Q(n.currentTarget.value),u?.(n)},[Q,u]),he=e.useCallback(n=>{if(d?.(n),n.defaultPrevented||!_||z||H)return;let C=Array.from(n.clipboardData?.items??[]).filter(k=>k.kind==="file").map(k=>k.getAsFile()).filter(k=>!!k);C.length!==0&&B(C)>0&&n.preventDefault()},[_,z,H,d,B]),fe=e.useCallback(n=>{q.current=!0,y?.(n)},[y]),Se=e.useCallback(n=>{q.current=!1,R?.(n)},[R]),W=e.useCallback(n=>{g?.(n),!(n.defaultPrevented||!p)&&(n.key!=="Enter"||n.shiftKey||n.altKey||n.ctrlKey||n.metaKey||q.current||n.nativeEvent.isComposing||n.nativeEvent.keyCode===229||(n.preventDefault(),A(L)))},[p,g,A,L]);return e.createElement("div",{className:"kui-ChatbarField kui-ChatbarTextarea"},e.createElement(c?U:"textarea",{...v,ref:Z,className:E("kui-ChatbarInput",a),value:w,onChange:pe,onFocus:ke,onPaste:he,onKeyDown:W,onCompositionStart:fe,onCompositionEnd:Se,disabled:z,readOnly:H,rows:b?S:1,spellCheck:v.spellCheck??!0,autoCorrect:v.autoCorrect??"on",style:i}))});ut.displayName="Chatbar.Textarea";var dt=e.forwardRef((t,r)=>{let{children:a,asChild:i,className:c,...l}=t;return I().open?null:e.createElement(i?U:"div",{...l,ref:r,className:E("kui-ChatbarInlineStart",c)},a)});dt.displayName="Chatbar.InlineStart";var mt=e.forwardRef((t,r)=>{let{children:a,asChild:i,className:c,...l}=t;return I().open?null:e.createElement(i?U:"div",{...l,ref:r,className:E("kui-ChatbarInlineEnd",c)},a)});mt.displayName="Chatbar.InlineEnd";var pt=e.forwardRef((t,r)=>{let{asChild:a,forceMount:i,renderAttachment:c,className:l,children:u,...d}=t,g=I(),y=e.Children.toArray(u).length>0;return g.attachments.length===0&&!y&&!i?null:e.createElement("div",null,e.createElement(a?U:"div",{...d,ref:r,className:E("kui-ChatbarAttachmentsRow",l),role:"list","aria-label":d["aria-label"]??"Attachments"},e.createElement(at,{className:"kui-ChatbarScrollArea",scrollbars:"horizontal"},e.createElement(ze,{align:"center",gap:"3",minWidth:"fit-content"},g.attachments.map(p=>e.createElement($e,{key:p.id,attachment:p,asChild:!!c},c?.(p))),u))))});pt.displayName="Chatbar.AttachmentsRow";function ht(t,r){let a=t.closest('[role="listitem"]'),i=a?.parentElement?Array.from(a.parentElement.children):[],c=a?i.indexOf(a):-1,u=(i[c+1]??i[c-1])?.querySelector(".kui-ChatbarItemRemove");u?u.focus():r.current?.focus({preventScroll:!0})}var ft=({lead:t,leadKind:r,label:a,detail:i,removeLabel:c,onRemove:l})=>{let u=I();return e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-ChatbarItemLead","data-kind":r,"aria-hidden":!0},t),e.createElement(Ae,{className:"kui-ChatbarItemLabel",size:u.size,truncate:!0},a,i?e.createElement(Be,null,", ",i):null),l&&e.createElement(we,{iconOnly:!0,className:"kui-ChatbarItemRemove","aria-label":c,size:"1",variant:"ghost",color:"gray",onClick:l},e.createElement(Qe,null)))},Vt={uploading:"uploading",error:"failed to upload"},$e=e.forwardRef((t,r)=>{let{attachment:a,asChild:i,className:c,children:l,...u}=t,d=I(),g=i?U:"div",y=!!a.url&&ct(a.name,a.type),R=`${Math.ceil(a.size/1024)} KB`,p=a.status?Vt[a.status]:void 0,v=d.disabled||d.readOnly,x=b=>{ht(b.currentTarget,d.textareaRef),d.removeAttachment(a.id)},w=a.status==="uploading"?e.createElement(De,null):y?e.createElement("img",{className:"kui-ChatbarAttachmentImage",src:a.url,alt:""}):e.createElement(et,null);return e.createElement(g,{...u,ref:r,className:E(l?"kui-ChatbarAttachment":"kui-ChatbarAttachment kui-ChatbarItem",c),role:"listitem","data-kind":y?"image":"file","data-status":a.status,title:a.name},l??e.createElement(ft,{lead:w,leadKind:y&&a.status!=="uploading"?"image":"icon",label:a.name,detail:p?`${R}, ${p}`:R,removeLabel:`Remove ${a.name}`,onRemove:v?void 0:x}))});$e.displayName="Chatbar.Attachment";var bt=e.forwardRef((t,r)=>{let{children:a,icon:i,image:c,color:l,onRemove:u,removeLabel:d,className:g,...y}=t,R=I(),p=R.disabled||R.readOnly,v=u?x=>{ht(x.currentTarget,R.textareaRef),u()}:void 0;return e.createElement("div",{...y,ref:r,className:E("kui-ChatbarItem",g),role:"listitem","data-accent-color":c?void 0:l??"gray",title:a},e.createElement(ft,{lead:c?e.createElement("img",{className:"kui-ChatbarAttachmentImage",src:c,alt:""}):i,leadKind:c?"image":"icon",label:a,removeLabel:d??`Remove ${a}`,onRemove:p?void 0:v}))});bt.displayName="Chatbar.Item";var Rt=e.forwardRef((t,r)=>{let{asChild:a,accept:i,multiple:c,disabled:l,onPointerDown:u,onClick:d,children:g,color:y,...R}=t,p=I(),v=l||p.disabled||p.readOnly,x={...R,ref:r,className:E("kui-ChatbarAttachTrigger",R.className),type:R.type??"button","aria-label":R["aria-label"]??"Add attachments",disabled:v,onPointerDown:w=>{u?.(w),!v&&!w.defaultPrevented&&p.beginFilePickerPress()},onClick:w=>{d?.(w),!(v||w.defaultPrevented)&&p.openFilePicker({accept:i,multiple:c})}};return a?e.createElement(U,{...x},g):e.createElement(we,{iconOnly:!0,emphasis:"quiet",color:"gray",size:p.size,...x},g??e.createElement(Ze,{"aria-hidden":!0}))});Rt.displayName="Chatbar.AttachTrigger";var Ct=e.forwardRef((t,r)=>{let{asChild:a,children:i,className:c,...l}=t;return I().open?e.createElement("div",null,e.createElement(a?U:"div",{...l,ref:r,className:E("kui-ChatbarRow",c)},e.createElement(ze,{align:"center",justify:"between",width:"100%"},i))):null});Ct.displayName="Chatbar.Row";var gt=e.forwardRef((t,r)=>{let{className:a,...i}=t;return e.createElement("div",{...i,ref:r,className:E("kui-ChatbarRowStart",a)})});gt.displayName="Chatbar.RowStart";var vt=e.forwardRef((t,r)=>{let{className:a,...i}=t;return e.createElement("div",{...i,ref:r,className:E("kui-ChatbarRowEnd",a)})});vt.displayName="Chatbar.RowEnd";var yt=e.forwardRef((t,r)=>{let{asChild:a,clearOnSend:i,disabled:c,children:l,style:u,className:d,size:g,variant:y,emphasis:R,tabIndex:p,onClick:v,status:x="ready",onStop:w,onRetry:b,stopLabel:S="Stop",retryLabel:D="Retry",stopIcon:O,retryIcon:z,"aria-label":H,"aria-labelledby":F,...Q}=t,f=I(),_=e.useContext(We),B=Ve(_)||f.attachments.length>0,A=B?"send":x==="submitted"||x==="streaming"?"stop":x==="error"?"retry":"send";if(f.sendMode==="never"&&A==="send")return null;let L=A!=="send"||f.sendMode==="always"||B,Z=A==="send"?c||f.disabled||f.readOnly||!B:c||f.disabled,j=A==="stop"?{"aria-label":S}:A==="retry"?{"aria-label":D}:F?{"aria-labelledby":F}:{"aria-label":H??"Send"},q=N=>{if(v?.(N),N.defaultPrevented||Z)return;if(A==="stop"){w?.();return}if(A==="retry"){b?.();return}let M=i??f.clearOnSubmit;f.submit(M)&&M&&f.textareaRef.current?.focus({preventScroll:!0})},V=A==="stop"?O??(x==="submitted"?e.createElement(De,null):e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},e.createElement("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2"}))):A==="retry"?z??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),e.createElement("path",{d:"M3 3v5h5"})):l??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M5 12h14"}),e.createElement("path",{d:"m12 5 7 7-7 7"}));return e.createElement(we,{iconOnly:!0,...Q,ref:r,size:g??f.size,...R?{emphasis:R}:{variant:y??(f.open||A!=="send"?"solid":"ghost")},disabled:Z,className:E("kui-ChatbarSend",d),style:{opacity:L?1:0,pointerEvents:L?void 0:"none",...u},"aria-hidden":L?void 0:!0,tabIndex:L?p:-1,asChild:a,onClick:q,"data-status":x,"data-mode":A,...j},V)});yt.displayName="Chatbar.Send";export{lt as a,ut as b,dt as c,mt as d,pt as e,$e as f,bt as g,Rt as h,Ct as i,gt as j,vt as k,yt as l,Wt as m};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as nt}from"./chunk-7V6M3MIR.js";import{a as Be}from"./chunk-WUCBFB25.js";import{a as we}from"./chunk-KJZSXLIX.js";import{a as Ae}from"./chunk-4MNRLB57.js";import{a as De}from"./chunk-BUXK5VGR.js";import{a as ze}from"./chunk-KVVRFWGQ.js";import{g as Qe,h as Ze,j as et}from"./chunk-GKDGNPBD.js";import{b as U}from"./chunk-5KMEUZWN.js";import{a as at}from"./chunk-MGWGD6KI.js";import{b as tt}from"./chunk-5ON3XLRD.js";import{a as Ht}from"./chunk-VQPANPMI.js";var Wt={};Ht(Wt,{AttachTrigger:()=>Rt,Attachment:()=>$e,AttachmentsRow:()=>pt,InlineEnd:()=>mt,InlineStart:()=>dt,Item:()=>bt,Root:()=>lt,Row:()=>Ct,RowEnd:()=>vt,RowStart:()=>gt,Send:()=>yt,Textarea:()=>ut});import*as e from"react";import E from"classnames";import{useComposedRefs as st,useLayoutEffect as je}from"radix-ui/internal";import{useDropzone as Ft}from"react-dropzone";function ot(t,r){let{placeholder:a}=t;if(!a){r();return}t.placeholder="";try{r()}finally{t.placeholder=a}}var It={values:["1","2","3"]},it=e.createContext(null),We=e.createContext(""),I=()=>{let t=e.useContext(it);if(!t)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return t},me=t=>Array.isArray(t)?t:typeof t=="string"?t.split(",").map(r=>r.trim()).filter(Boolean):[],zt=(t,r)=>{if(r.length===0)return!0;let a=t.type.toLowerCase(),i=t.name.toLowerCase();for(let c of r){let l=c.toLowerCase();if(l.includes("/")){let[u,d]=l.split("/"),[g,y]=a.split("/");if(u==="*"||u===g&&(d==="*"||d===y))return!0}else if(l.startsWith(".")&&i.endsWith(l))return!0}return!1},Dt=/\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i,ct=(t,r)=>(r||"").toLowerCase().startsWith("image/")||Dt.test(t),Ve=t=>t.trim().length>0,rt=(t,r)=>`${t} ${r}${t===1?"":"s"}`,Bt=0,jt=()=>`chatbar-attachment-${Date.now()}-${++Bt}`,lt=e.forwardRef((t,r)=>{let{className:a,style:i,children:c,value:l,defaultValue:u="",onValueChange:d,open:g,defaultOpen:y=!1,onOpenChange:R,expandOn:p="both",minLines:v=3,maxLines:x=6,sendMode:w="whenDirty",disabled:b,readOnly:S,onSubmit:D,size:O,variant:z,color:H,radius:F,width:Q,maxWidth:f,attachments:_,defaultAttachments:B,onAttachmentsChange:se,accept:A,multiple:L=!0,maxAttachments:Z,maxFileSize:G,paste:j=!0,pasteAccept:q,clearOnSubmit:V=!0,onAttachmentReject:N,dropzone:M=!0,apiRef:ke,onBlurCapture:pe,notices:he,context:fe,...Se}=t,W=tt(O,It),Ee=l!=null,[n,C]=e.useState(u),k=Ee?l:n,ee=g!=null,[X,te]=e.useState(y),ie=ee?g:X,Y="attachments"in t,[ce,be]=e.useState(()=>B??[]),le=e.useMemo(()=>Y?_??[]:ce,[Y,_,ce]),[Ke,xt]=e.useState({text:"",id:0}),ue=e.useCallback(o=>xt(s=>({text:o,id:s.id+1})),[]),Ue=e.useRef(null),Pt=st(r,Ue),Te=e.useRef(null),Le=e.useRef(null),de=e.useRef(!1),Re=e.useRef(!1),Ce=e.useRef(void 0),Ne=e.useRef(null),_e=me(A).join(","),Me=me(q).join(","),Oe=e.useMemo(()=>me(_e),[_e]),At=e.useMemo(()=>Me?me(Me):Oe,[Me,Oe]),Ge={value:k,attachments:le,accepts:Oe,pasteAccepts:At,multiple:L,maxAttachments:Z,maxFileSize:G,disabled:b,readOnly:S,expandOn:p,isValueControlled:Ee,isOpenControlled:ee,isAttachmentsControlled:Y,onValueChange:d,onOpenChange:R,onAttachmentsChange:se,onAttachmentReject:N,onSubmit:D},P=e.useRef(Ge);P.current=Ge;let He=e.useRef(null),$=e.useCallback(()=>He.current??P.current.attachments,[]),ae=e.useCallback(o=>{P.current.isOpenControlled||te(o),P.current.onOpenChange?.(o)},[]),ge=e.useCallback(o=>{P.current.isValueControlled||C(o),P.current.onValueChange?.(o)},[]),ne=e.useCallback(o=>{He.current=o,queueMicrotask(()=>{He.current=null}),P.current.isAttachmentsControlled||be(o),P.current.onAttachmentsChange?.(o)},[]),ve=e.useRef(new Set),oe=e.useCallback((o,s,m=P.current.multiple)=>{let h=P.current;if(h.disabled||h.readOnly||o.length===0)return 0;let K=$(),J=[],re=[],Mt=typeof h.maxAttachments=="number"?Math.max(h.maxAttachments-K.length,0):1/0,Ot=m?1/0:1;for(let T of o){if(J.length>=Mt||J.length>=Ot){re.push({file:T,reason:"count"});continue}if(typeof h.maxFileSize=="number"&&T.size>h.maxFileSize){re.push({file:T,reason:"size"});continue}if(!zt(T,s)){re.push({file:T,reason:"type"});continue}let Ie=ct(T.name,T.type)?URL.createObjectURL(T):void 0;Ie&&ve.current.add(Ie),J.push({id:jt(),name:T.name,size:T.size,type:T.type,file:T,url:Ie,status:"idle"})}let Pe=[];return J.length>0&&(ne(K.concat(J)),h.expandOn!=="none"&&ae(!0),Pe.push(`${rt(J.length,"file")} attached.`)),re.length>0&&(h.onAttachmentReject?.(re),Pe.push(`${rt(re.length,"file")} could not be attached.`)),Pe.length>0&&ue(Pe.join(" ")),J.length},[$,ne,ae,ue]),ye=e.useCallback(o=>oe(o,P.current.accepts),[oe]),qe=e.useCallback(o=>oe(o,P.current.pasteAccepts),[oe]),Xe=e.useCallback(o=>{let s=$(),m=s.find(h=>h.id===o);m&&(ne(s.filter(h=>h.id!==o)),ue(`Removed ${m.name}.`))},[$,ne,ue]),Ye=e.useCallback(o=>{let s=P.current;if(s.disabled||s.readOnly)return!1;let m=$();if(!Ve(s.value)&&m.length===0)return!1;let h={value:s.value,attachments:m};if(o&&s.onSubmit)for(let K of m)K.url&&ve.current.delete(K.url);return s.onSubmit?.(h),o&&(ge(""),ne([])),!0},[$,ge,ne]);e.useEffect(()=>{let o=ve.current;if(o.size===0)return;let s=new Set(le.map(m=>m.url));for(let m of Array.from(o))s.has(m)||(URL.revokeObjectURL(m),o.delete(m))},[le]),e.useEffect(()=>{let o=ve.current;return()=>{if(!P.current.isAttachmentsControlled){for(let s of Array.from(o))URL.revokeObjectURL(s);o.clear()}}},[]);let xe=e.useCallback(o=>{let s=P.current,m=Le.current;if(clearTimeout(Ce.current),Re.current=!1,!m||s.disabled||s.readOnly)return;let h=o?.accept!=null?me(o.accept):s.accepts,K=o?.multiple??s.multiple;Ne.current={patterns:h,multiple:K},m.accept=h.join(","),m.multiple=K,de.current=!0,m.click(),setTimeout(()=>{document.hasFocus()&&(de.current=!1)},1e3)},[]),Je=e.useCallback(()=>{Re.current=!0,clearTimeout(Ce.current),Ce.current=setTimeout(()=>{Re.current=!1},800)},[]);e.useEffect(()=>()=>clearTimeout(Ce.current),[]),e.useEffect(()=>{let o=Le.current,s=()=>{de.current=!1};return window.addEventListener("focus",s),o?.addEventListener("cancel",s),()=>{window.removeEventListener("focus",s),o?.removeEventListener("cancel",s)}},[]);let wt=e.useCallback(o=>{let s=o.currentTarget,m=Array.from(s.files??[]),h=Ne.current;oe(m,h?.patterns??P.current.accepts,h?.multiple),de.current=!1,Ne.current=null,s.value=""},[oe]),kt=e.useCallback(o=>{pe?.(o);let s=P.current,m=Ue.current;if(!m||s.expandOn==="none")return;let h=o.relatedTarget;h&&m.contains(h)||de.current||Re.current||!Ve(s.value)&&$().length===0&&ae(!1)},[pe,ae,$]),St=e.useCallback(o=>{ye(o)},[ye]),{getRootProps:Et,isDragActive:Tt}=Ft({onDrop:St,onDragEnter:()=>ue(""),noClick:!0,noKeyboard:!0,noPaste:!0,disabled:!M||b||S}),Fe=M&&Tt;e.useImperativeHandle(ke,()=>({focusTextarea:()=>Te.current?.focus({preventScroll:!0}),openFilePicker:()=>xe()}),[xe]);let Lt=e.useCallback(o=>{if(b||o.pointerType==="mouse"&&o.button!==0)return;let s=o.target;s instanceof Element&&s.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')||(o.preventDefault(),Te.current?.focus({preventScroll:!0}))},[b]),Nt=e.useMemo(()=>({open:ie,setOpen:ae,setValue:ge,size:W,expandOn:p,minLines:v,maxLines:x,sendMode:w,disabled:b,readOnly:S,paste:j,clearOnSubmit:V,multiple:L,textareaRef:Te,attachments:le,removeAttachment:Xe,submit:Ye,appendFiles:ye,appendFilesFromPaste:qe,openFilePicker:xe,beginFilePickerPress:Je}),[ie,ae,ge,W,p,v,x,w,b,S,j,V,L,le,Xe,Ye,ye,qe,xe,Je]);return e.createElement(it.Provider,{value:Nt},e.createElement(We.Provider,{value:k},e.createElement(e.Fragment,null,e.createElement("div",{...Se,ref:Pt,className:E("kui-ChatbarRoot",`kui-r-size-${W}`,a),style:{position:"relative",width:Q,maxWidth:f,...i},"data-state":ie?"open":"closed","data-disabled":b?"":void 0,"data-readonly":S?"":void 0,"data-drop-active":Fe?"":void 0,"data-accent-color":H,"data-radius":F,onBlurCapture:kt},e.createElement("input",{ref:Le,type:"file",tabIndex:-1,"aria-hidden":!0,style:{display:"none"},onChange:wt}),he?e.createElement("div",{className:"kui-ChatbarNotices"},e.createElement(nt.Provider,{value:W},he)):null,e.createElement("div",{...M?Et():{},style:{width:"100%",flex:"1 1 auto",minHeight:0},onPointerDown:Lt},e.createElement("div",{className:E("kui-ChatbarBox",`kui-variant-${z??"raised"}`),style:{position:"relative"},"data-accent-color":H,"data-radius":F},e.createElement("div",{className:"kui-ChatbarGrid"},c),Fe&&e.createElement("div",{className:"kui-ChatbarDropOverlay","aria-hidden":!0},e.createElement("div",{className:"kui-ChatbarDropContent"},e.createElement(Ae,{emphasis:"medium",size:W,weight:"medium"},"Drop files here to attach"))))),fe?e.createElement(Ae,{as:"div",size:W==="3"?"2":"1",emphasis:"medium",className:"kui-ChatbarContext"},fe):null,e.createElement(Be,{role:"status","aria-live":"polite"},Fe?"Drop files here to attach.":e.createElement("span",{key:Ke.id},Ke.text))))))});lt.displayName="Chatbar.Root";var ut=e.forwardRef((t,r)=>{let{className:a,style:i,asChild:c,onFocus:l,onChange:u,onPaste:d,onKeyDown:g,onCompositionStart:y,onCompositionEnd:R,submitOnEnter:p=!1,...v}=t,x=I(),w=e.useContext(We),{open:b,minLines:S,maxLines:D,expandOn:O,disabled:z,readOnly:H,setOpen:F,setValue:Q,textareaRef:f,paste:_,appendFilesFromPaste:B,size:se,submit:A,clearOnSubmit:L}=x,Z=st(r,f),G=e.useRef(0),j=e.useRef(0),q=e.useRef(!1),V=e.useRef({open:b,minLines:S,maxLines:D});je(()=>{V.current={open:b,minLines:S,maxLines:D}},[b,S,D]);let N=e.useCallback(()=>{let n=f.current;if(!n)return;let C=window.getComputedStyle(n);G.current=parseFloat(C.lineHeight)||20,j.current=(parseFloat(C.paddingTop)||0)+(parseFloat(C.paddingBottom)||0)},[f]),M=e.useCallback((n,C)=>{let{minLines:k,maxLines:ee}=V.current,X=G.current,te=j.current,ie=Math.ceil((C?k:1)*X)+te,Y=Math.ceil((C?ee:1)*X)+te,ce=Math.max(n.scrollHeight,ie);n.style.height=`${Math.min(ce,Y)}px`;let be=ce>Y;n.style.overflowY=be?"auto":"hidden",n.style.maxHeight=be?`${Y}px`:"none"},[]);je(()=>{N()},[N,se]),je(()=>{let n=f.current;n&&(G.current===0&&N(),ot(n,()=>{n.style.height="auto";let C=b;if(!b&&(O==="overflow"||O==="both")){let k=Math.ceil(G.current)+j.current;n.scrollHeight>k+1&&(C=!0,F(!0))}M(n,C)}))},[w,b,O,S,D,se,F,f,N,M]),e.useEffect(()=>{let n=f.current;if(!n||typeof ResizeObserver>"u")return;let C=-1,k=new ResizeObserver(ee=>{let X=ee[0]?.contentRect.width??0;if(X===C)return;let te=C===-1;C=X,!te&&(N(),ot(n,()=>{n.style.height="auto",M(n,V.current.open)}))});return k.observe(n),()=>k.disconnect()},[f,N,M]),e.useEffect(()=>{},[]);let ke=e.useCallback(n=>{l?.(n),!(z||H)&&(O==="focus"||O==="both")&&!b&&F(!0)},[z,H,O,b,F,l]),pe=e.useCallback(n=>{Q(n.currentTarget.value),u?.(n)},[Q,u]),he=e.useCallback(n=>{if(d?.(n),n.defaultPrevented||!_||z||H)return;let C=Array.from(n.clipboardData?.items??[]).filter(k=>k.kind==="file").map(k=>k.getAsFile()).filter(k=>!!k);C.length!==0&&B(C)>0&&n.preventDefault()},[_,z,H,d,B]),fe=e.useCallback(n=>{q.current=!0,y?.(n)},[y]),Se=e.useCallback(n=>{q.current=!1,R?.(n)},[R]),W=e.useCallback(n=>{g?.(n),!(n.defaultPrevented||!p)&&(n.key!=="Enter"||n.shiftKey||n.altKey||n.ctrlKey||n.metaKey||q.current||n.nativeEvent.isComposing||n.nativeEvent.keyCode===229||(n.preventDefault(),A(L)))},[p,g,A,L]);return e.createElement("div",{className:"kui-ChatbarField kui-ChatbarTextarea"},e.createElement(c?U:"textarea",{...v,ref:Z,className:E("kui-ChatbarInput",a),value:w,onChange:pe,onFocus:ke,onPaste:he,onKeyDown:W,onCompositionStart:fe,onCompositionEnd:Se,disabled:z,readOnly:H,rows:b?S:1,spellCheck:v.spellCheck??!0,autoCorrect:v.autoCorrect??"on",style:i}))});ut.displayName="Chatbar.Textarea";var dt=e.forwardRef((t,r)=>{let{children:a,asChild:i,className:c,...l}=t;return I().open?null:e.createElement(i?U:"div",{...l,ref:r,className:E("kui-ChatbarInlineStart",c)},a)});dt.displayName="Chatbar.InlineStart";var mt=e.forwardRef((t,r)=>{let{children:a,asChild:i,className:c,...l}=t;return I().open?null:e.createElement(i?U:"div",{...l,ref:r,className:E("kui-ChatbarInlineEnd",c)},a)});mt.displayName="Chatbar.InlineEnd";var pt=e.forwardRef((t,r)=>{let{asChild:a,forceMount:i,renderAttachment:c,className:l,children:u,...d}=t,g=I(),y=e.Children.toArray(u).length>0;return g.attachments.length===0&&!y&&!i?null:e.createElement("div",null,e.createElement(a?U:"div",{...d,ref:r,className:E("kui-ChatbarAttachmentsRow",l),role:"list","aria-label":d["aria-label"]??"Attachments"},e.createElement(at,{className:"kui-ChatbarScrollArea",scrollbars:"horizontal"},e.createElement(ze,{align:"center",gap:"3",minWidth:"fit-content"},g.attachments.map(p=>e.createElement($e,{key:p.id,attachment:p,asChild:!!c},c?.(p))),u))))});pt.displayName="Chatbar.AttachmentsRow";function ht(t,r){let a=t.closest('[role="listitem"]'),i=a?.parentElement?Array.from(a.parentElement.children):[],c=a?i.indexOf(a):-1,u=(i[c+1]??i[c-1])?.querySelector(".kui-ChatbarItemRemove");u?u.focus():r.current?.focus({preventScroll:!0})}var ft=({lead:t,leadKind:r,label:a,detail:i,removeLabel:c,onRemove:l})=>{let u=I();return e.createElement(e.Fragment,null,e.createElement("span",{className:"kui-ChatbarItemLead","data-kind":r,"aria-hidden":!0},t),e.createElement(Ae,{className:"kui-ChatbarItemLabel",size:u.size,truncate:!0},a,i?e.createElement(Be,null,", ",i):null),l&&e.createElement(we,{iconOnly:!0,className:"kui-ChatbarItemRemove","aria-label":c,size:"1",variant:"ghost",color:"gray",onClick:l},e.createElement(Qe,null)))},Vt={uploading:"uploading",error:"failed to upload"},$e=e.forwardRef((t,r)=>{let{attachment:a,asChild:i,className:c,children:l,...u}=t,d=I(),g=i?U:"div",y=!!a.url&&ct(a.name,a.type),R=`${Math.ceil(a.size/1024)} KB`,p=a.status?Vt[a.status]:void 0,v=d.disabled||d.readOnly,x=b=>{ht(b.currentTarget,d.textareaRef),d.removeAttachment(a.id)},w=a.status==="uploading"?e.createElement(De,null):y?e.createElement("img",{className:"kui-ChatbarAttachmentImage",src:a.url,alt:""}):e.createElement(et,null);return e.createElement(g,{...u,ref:r,className:E(l?"kui-ChatbarAttachment":"kui-ChatbarAttachment kui-ChatbarItem",c),role:"listitem","data-kind":y?"image":"file","data-status":a.status,title:a.name},l??e.createElement(ft,{lead:w,leadKind:y&&a.status!=="uploading"?"image":"icon",label:a.name,detail:p?`${R}, ${p}`:R,removeLabel:`Remove ${a.name}`,onRemove:v?void 0:x}))});$e.displayName="Chatbar.Attachment";var bt=e.forwardRef((t,r)=>{let{children:a,icon:i,image:c,color:l,onRemove:u,removeLabel:d,className:g,...y}=t,R=I(),p=R.disabled||R.readOnly,v=u?x=>{ht(x.currentTarget,R.textareaRef),u()}:void 0;return e.createElement("div",{...y,ref:r,className:E("kui-ChatbarItem",g),role:"listitem","data-accent-color":c?void 0:l??"gray",title:a},e.createElement(ft,{lead:c?e.createElement("img",{className:"kui-ChatbarAttachmentImage",src:c,alt:""}):i,leadKind:c?"image":"icon",label:a,removeLabel:d??`Remove ${a}`,onRemove:p?void 0:v}))});bt.displayName="Chatbar.Item";var Rt=e.forwardRef((t,r)=>{let{asChild:a,accept:i,multiple:c,disabled:l,onPointerDown:u,onClick:d,children:g,color:y,...R}=t,p=I(),v=l||p.disabled||p.readOnly,x={...R,ref:r,className:E("kui-ChatbarAttachTrigger",R.className),type:R.type??"button","aria-label":R["aria-label"]??"Add attachments",disabled:v,onPointerDown:w=>{u?.(w),!v&&!w.defaultPrevented&&p.beginFilePickerPress()},onClick:w=>{d?.(w),!(v||w.defaultPrevented)&&p.openFilePicker({accept:i,multiple:c})}};return a?e.createElement(U,{...x},g):e.createElement(we,{iconOnly:!0,emphasis:"quiet",color:"gray",size:p.size,...x},g??e.createElement(Ze,{"aria-hidden":!0}))});Rt.displayName="Chatbar.AttachTrigger";var Ct=e.forwardRef((t,r)=>{let{asChild:a,children:i,className:c,...l}=t;return I().open?e.createElement("div",null,e.createElement(a?U:"div",{...l,ref:r,className:E("kui-ChatbarRow",c)},e.createElement(ze,{align:"center",justify:"between",width:"100%"},i))):null});Ct.displayName="Chatbar.Row";var gt=e.forwardRef((t,r)=>{let{className:a,...i}=t;return e.createElement("div",{...i,ref:r,className:E("kui-ChatbarRowStart",a)})});gt.displayName="Chatbar.RowStart";var vt=e.forwardRef((t,r)=>{let{className:a,...i}=t;return e.createElement("div",{...i,ref:r,className:E("kui-ChatbarRowEnd",a)})});vt.displayName="Chatbar.RowEnd";var yt=e.forwardRef((t,r)=>{let{asChild:a,clearOnSend:i,disabled:c,children:l,style:u,className:d,size:g,variant:y,emphasis:R,tabIndex:p,onClick:v,status:x="ready",onStop:w,onRetry:b,stopLabel:S="Stop",retryLabel:D="Retry",stopIcon:O,retryIcon:z,"aria-label":H,"aria-labelledby":F,...Q}=t,f=I(),_=e.useContext(We),B=Ve(_)||f.attachments.length>0,A=B?"send":x==="submitted"||x==="streaming"?"stop":x==="error"?"retry":"send";if(f.sendMode==="never"&&A==="send")return null;let L=A!=="send"||f.sendMode==="always"||B,Z=A==="send"?c||f.disabled||f.readOnly||!B:c||f.disabled,j=A==="stop"?{"aria-label":S}:A==="retry"?{"aria-label":D}:F?{"aria-labelledby":F}:{"aria-label":H??"Send"},q=N=>{if(v?.(N),N.defaultPrevented||Z)return;if(A==="stop"){w?.();return}if(A==="retry"){b?.();return}let M=i??f.clearOnSubmit;f.submit(M)&&M&&f.textareaRef.current?.focus({preventScroll:!0})},V=A==="stop"?O??(x==="submitted"?e.createElement(De,null):e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0},e.createElement("rect",{x:"7",y:"7",width:"10",height:"10",rx:"2"}))):A==="retry"?z??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),e.createElement("path",{d:"M3 3v5h5"})):l??e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e.createElement("path",{d:"M5 12h14"}),e.createElement("path",{d:"m12 5 7 7-7 7"}));return e.createElement(we,{iconOnly:!0,...Q,ref:r,size:g??f.size,...R?{emphasis:R}:{variant:y??(f.open||A!=="send"?"solid":"ghost")},disabled:Z,className:E("kui-ChatbarSend",d),style:{opacity:L?1:0,pointerEvents:L?void 0:"none",...u},"aria-hidden":L?void 0:!0,tabIndex:L?p:-1,asChild:a,onClick:q,"data-status":x,"data-mode":A,...j},V)});yt.displayName="Chatbar.Send";export{lt as a,ut as b,dt as c,mt as d,pt as e,$e as f,bt as g,Rt as h,Ct as i,gt as j,vt as k,yt as l,Wt as m};
|
|
3
|
+
//# sourceMappingURL=chunk-LABMK6Q7.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as w}from"./chunk-KOAWATCI.js";import{a as v,b as y}from"./chunk-5KJIPH2N.js";import{a as R}from"./chunk-YOSLXJI5.js";import{
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as w}from"./chunk-KOAWATCI.js";import{a as v,b as y}from"./chunk-5KJIPH2N.js";import{a as R}from"./chunk-YOSLXJI5.js";import{a as h}from"./chunk-LPLW7OWA.js";import{a as A}from"./chunk-L54FWKJE.js";import{c as P}from"./chunk-OKQAVYW4.js";import{b as S}from"./chunk-XU74PNM2.js";import{a as b}from"./chunk-CLJ6SEGP.js";import*as r from"react";import H from"classnames";import{ScrollArea as t}from"radix-ui";import{useComposedRefs as O}from"radix-ui/internal";var k=["vertical","horizontal","both"],c={...b,...S,scrollbars:{type:"enum",values:k,default:"both"},fade:{type:"boolean",default:!1}};var W='[role="menu"], [role="listbox"]';function j(e,a){r.useEffect(()=>{if(!a||!e||e.closest(W))return;let o=0,i=()=>{o=0;let l=v(e);l.x>0||l.y>0?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")},n=()=>{o||(o=requestAnimationFrame(i))};i();let s=typeof ResizeObserver>"u"?null:new ResizeObserver(n);s?.observe(e);for(let l of Array.from(e.children))s?.observe(l);return()=>{o&&cancelAnimationFrame(o),s?.disconnect()}},[e,a])}var z=r.forwardRef((e,a)=>{let{asChild:o,children:i,className:n,style:s,type:l,scrollHideDelay:f=l!=="scroll"?0:void 0,dir:D,radius:d=c.radius.default,scrollbars:m=c.scrollbars.default,fade:u=c.fade.default,...p}=P(e,A,h),[N,T]=r.useState(null),E=y(u),x=w(),C=O(a,E,x,T);j(N,p.tabIndex===void 0);let V=p["aria-label"]!==void 0||p["aria-labelledby"]!==void 0;return r.createElement(t.Root,{type:l,scrollHideDelay:f,dir:D,className:H("kui-ScrollAreaRoot",n),"data-fade":u?"":void 0,style:s,asChild:o},R({asChild:o,children:i},g=>r.createElement(r.Fragment,null,r.createElement(t.Viewport,{role:V?"region":void 0,...p,ref:C,className:"kui-ScrollAreaViewport"},g),r.createElement("div",{className:"kui-ScrollAreaViewportFocusRing"}),m!=="vertical"?r.createElement(t.Scrollbar,{"data-radius":d,orientation:"horizontal",className:"kui-ScrollAreaScrollbar"},r.createElement(t.Thumb,{className:"kui-ScrollAreaThumb"})):null,m!=="horizontal"?r.createElement(t.Scrollbar,{"data-radius":d,orientation:"vertical",className:"kui-ScrollAreaScrollbar"},r.createElement(t.Thumb,{className:"kui-ScrollAreaThumb"})):null,m==="both"?r.createElement(t.Corner,{className:"kui-ScrollAreaCorner"}):null)))});z.displayName="ScrollArea";export{z as a};
|
|
3
|
+
//# sourceMappingURL=chunk-MGWGD6KI.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as v}from"./chunk-TGRHRMQI.js";import{
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as v}from"./chunk-TGRHRMQI.js";import{a as d}from"./chunk-LPLW7OWA.js";import{a as P}from"./chunk-L54FWKJE.js";import{c as m}from"./chunk-OKQAVYW4.js";import{a as C}from"./chunk-AQKSO3SW.js";import{c as T}from"./chunk-5ON3XLRD.js";import{a as f}from"./chunk-CLJ6SEGP.js";import{a as k}from"./chunk-VQPANPMI.js";var I={};k(I,{Anchor:()=>x,Close:()=>g,Content:()=>y,Root:()=>u,Toolbar:()=>z,Trigger:()=>h});import*as o from"react";import i from"classnames";import{Popover as n}from"radix-ui";var M=["1","2","3","4"],c={...f,size:{type:"enum",className:"kui-r-size",values:M,default:"2",responsive:!0},width:P.width,minWidth:P.minWidth,maxWidth:{...P.maxWidth,default:"480px"},...d};var R=o.createContext(null),b=e=>{let r=o.useContext(R);return r},u=e=>o.createElement(n.Root,{...e});u.displayName="Popover.Root";var h=o.forwardRef(({children:e,...r},t)=>o.createElement(n.Trigger,{...r,ref:t,asChild:!0},v(e)));h.displayName="Popover.Trigger";var y=o.forwardRef((e,r)=>{let t=T(e,c.size),{className:s,forceMount:a,container:l,...p}=m(t,c),[L,A]=o.useState(void 0),S=o.useMemo(()=>({setLabelId:A}),[]);return o.createElement(n.Portal,{container:l,forceMount:a},o.createElement(C,{asChild:!0},o.createElement(n.Content,{align:"start",sideOffset:8,collisionPadding:10,...p,ref:r,"aria-labelledby":L??p["aria-labelledby"],className:i("kui-PopperContent","kui-PopoverContent",s)},o.createElement(R.Provider,{value:S},t.children))))});y.displayName="Popover.Content";var g=o.forwardRef(({children:e,...r},t)=>o.createElement(n.Close,{...r,ref:t,asChild:!0},v(e)));g.displayName="Popover.Close";var x=o.forwardRef((e,r)=>o.createElement(n.Anchor,{...e,ref:r}));x.displayName="Popover.Anchor";var E=o.forwardRef(({className:e,children:r,...t},s)=>(b("Popover.Toolbar"),o.createElement("div",{...t,ref:s,className:i("kui-PopoverToolbar",e)},r)));E.displayName="Popover.Toolbar";var w=o.forwardRef(({className:e,...r},t)=>o.createElement("div",{...r,ref:t,className:i("kui-PopoverToolbarSection","kui-PopoverToolbarLeft",e)}));w.displayName="Popover.Toolbar.Left";var D=o.forwardRef(({className:e,...r},t)=>o.createElement("div",{...r,ref:t,className:i("kui-PopoverToolbarSection","kui-PopoverToolbarCenter",e)}));D.displayName="Popover.Toolbar.Center";var N=o.forwardRef(({className:e,...r},t)=>o.createElement("div",{...r,ref:t,className:i("kui-PopoverToolbarSection","kui-PopoverToolbarRight",e)}));N.displayName="Popover.Toolbar.Right";var W=o.forwardRef(({className:e,id:r,...t},s)=>{let a=b("Popover.Toolbar.Title"),l=o.useId(),p=r??`kui-popover-toolbar-title-${l}`;return o.useEffect(()=>(a?.setLabelId(p),()=>a?.setLabelId(void 0)),[a,p]),o.createElement("span",{...t,id:p,ref:s,className:i("kui-PopoverToolbarTitle",e)})});W.displayName="Popover.Toolbar.Title";var z=Object.assign(E,{Left:w,Center:D,Right:N,Title:W});export{u as a,h as b,y as c,g as d,x as e,z as f,I as g};
|
|
3
|
+
//# sourceMappingURL=chunk-MJKVVGGV.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/popover.tsx", "../../src/components/popover.props.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { popoverContentPropDefs } from './popover.props.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\n\nimport type { PopoverContentOwnProps } from './popover.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\n// ---------------------------------------------\n// Popover Content Context\n// ---------------------------------------------\ntype PopoverContentContextValue = {\n /** Wire up aria-labelledby for toolbar title */\n setLabelId: (id: string | undefined) => void;\n};\n\nconst PopoverContentContext = React.createContext<PopoverContentContextValue | null>(null);\nconst usePopoverContentContext = (caller: string) => {\n const ctx = React.useContext(PopoverContentContext);\n if (!ctx) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`${caller} must be used within Popover.Content`);\n }\n }\n return ctx;\n};\n\ninterface PopoverRootProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root> {}\nconst PopoverRoot: React.FC<PopoverRootProps> = (props: PopoverRootProps) => (\n <PopoverPrimitive.Root {...props} />\n);\nPopoverRoot.displayName = 'Popover.Root';\n\ntype PopoverTriggerElement = React.ElementRef<typeof PopoverPrimitive.Trigger>;\ninterface PopoverTriggerProps\n extends ComponentPropsWithout<typeof PopoverPrimitive.Trigger, RemovedProps> {}\nconst PopoverTrigger = React.forwardRef<PopoverTriggerElement, PopoverTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <PopoverPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </PopoverPrimitive.Trigger>\n ),\n);\nPopoverTrigger.displayName = 'Popover.Trigger';\n\ntype PopoverContentElement = React.ElementRef<typeof PopoverPrimitive.Content>;\ninterface PopoverContentProps\n extends ComponentPropsWithout<typeof PopoverPrimitive.Content, RemovedProps>,\n PopoverContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Portal>['container'];\n}\nconst PopoverContent = React.forwardRef<PopoverContentElement, PopoverContentProps>(\n (ownProps, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, popoverContentPropDefs.size);\n const {\n className,\n forceMount,\n container,\n ...contentProps\n } = extractProps(props, popoverContentPropDefs);\n\n const [labelId, setLabelId] = React.useState<string | undefined>(undefined);\n const contextValue = React.useMemo(() => ({ setLabelId }), []);\n\n return (\n <PopoverPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <PopoverPrimitive.Content\n align=\"start\"\n sideOffset={8}\n collisionPadding={10}\n {...contentProps}\n ref={forwardedRef}\n // A Toolbar.Title names the panel; without one, the caller's own value stands.\n aria-labelledby={labelId ?? contentProps['aria-labelledby']}\n className={classNames('kui-PopperContent', 'kui-PopoverContent', className)}\n >\n <PopoverContentContext.Provider value={contextValue}>\n {props.children}\n </PopoverContentContext.Provider>\n </PopoverPrimitive.Content>\n </PortalTheme>\n </PopoverPrimitive.Portal>\n );\n },\n);\nPopoverContent.displayName = 'Popover.Content';\n\ntype PopoverCloseElement = React.ElementRef<typeof PopoverPrimitive.Close>;\ninterface PopoverCloseProps\n extends ComponentPropsWithout<typeof PopoverPrimitive.Close, RemovedProps> {}\nconst PopoverClose = React.forwardRef<PopoverCloseElement, PopoverCloseProps>(\n ({ children, ...props }, forwardedRef) => (\n <PopoverPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </PopoverPrimitive.Close>\n ),\n);\nPopoverClose.displayName = 'Popover.Close';\n\ntype PopoverAnchorElement = React.ElementRef<typeof PopoverPrimitive.Anchor>;\ninterface PopoverAnchorProps\n extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor> {}\nconst PopoverAnchor = React.forwardRef<PopoverAnchorElement, PopoverAnchorProps>(\n (props, forwardedRef) => <PopoverPrimitive.Anchor {...props} ref={forwardedRef} />,\n);\n\nPopoverAnchor.displayName = 'Popover.Anchor';\n\n// ---------------------------------------------\n// Toolbar (Popover-only)\n// ---------------------------------------------\n\ntype PopoverToolbarElement = HTMLDivElement;\ntype PopoverToolbarProps = React.ComponentPropsWithoutRef<'div'>;\n\nconst PopoverToolbarBase = React.forwardRef<PopoverToolbarElement, PopoverToolbarProps>(\n ({ className, children, ...props }, forwardedRef) => {\n // The toolbar is sticky in the content's own CSS, so it needs no measuring; this only warns\n // when it is used outside Popover.Content.\n usePopoverContentContext('Popover.Toolbar');\n\n return (\n <div {...props} ref={forwardedRef} className={classNames('kui-PopoverToolbar', className)}>\n {children}\n </div>\n );\n },\n);\nPopoverToolbarBase.displayName = 'Popover.Toolbar';\n\ntype PopoverToolbarSectionProps = React.ComponentPropsWithoutRef<'div'>;\n\nconst PopoverToolbarLeft = React.forwardRef<HTMLDivElement, PopoverToolbarSectionProps>(\n ({ className, ...props }, ref) => (\n <div\n {...props}\n ref={ref}\n className={classNames('kui-PopoverToolbarSection', 'kui-PopoverToolbarLeft', className)}\n />\n ),\n);\nPopoverToolbarLeft.displayName = 'Popover.Toolbar.Left';\n\nconst PopoverToolbarCenter = React.forwardRef<HTMLDivElement, PopoverToolbarSectionProps>(\n ({ className, ...props }, ref) => (\n <div\n {...props}\n ref={ref}\n className={classNames('kui-PopoverToolbarSection', 'kui-PopoverToolbarCenter', className)}\n />\n ),\n);\nPopoverToolbarCenter.displayName = 'Popover.Toolbar.Center';\n\nconst PopoverToolbarRight = React.forwardRef<HTMLDivElement, PopoverToolbarSectionProps>(\n ({ className, ...props }, ref) => (\n <div\n {...props}\n ref={ref}\n className={classNames('kui-PopoverToolbarSection', 'kui-PopoverToolbarRight', className)}\n />\n ),\n);\nPopoverToolbarRight.displayName = 'Popover.Toolbar.Right';\n\ntype PopoverToolbarTitleProps = React.ComponentPropsWithoutRef<'span'>;\nconst PopoverToolbarTitle = React.forwardRef<HTMLSpanElement, PopoverToolbarTitleProps>(\n ({ className, id: idProp, ...props }, ref) => {\n const ctx = usePopoverContentContext('Popover.Toolbar.Title');\n const reactId = React.useId();\n const id = idProp ?? `kui-popover-toolbar-title-${reactId}`;\n React.useEffect(() => {\n ctx?.setLabelId(id);\n return () => ctx?.setLabelId(undefined);\n }, [ctx, id]);\n return (\n <span\n {...props}\n id={id}\n ref={ref}\n className={classNames('kui-PopoverToolbarTitle', className)}\n />\n );\n },\n);\nPopoverToolbarTitle.displayName = 'Popover.Toolbar.Title';\n\ntype PopoverToolbarComponent = React.ForwardRefExoticComponent<\n React.PropsWithoutRef<PopoverToolbarProps> & React.RefAttributes<HTMLDivElement>\n> & {\n Left: typeof PopoverToolbarLeft;\n Center: typeof PopoverToolbarCenter;\n Right: typeof PopoverToolbarRight;\n Title: typeof PopoverToolbarTitle;\n};\n\nconst PopoverToolbar = Object.assign(PopoverToolbarBase, {\n Left: PopoverToolbarLeft,\n Center: PopoverToolbarCenter,\n Right: PopoverToolbarRight,\n Title: PopoverToolbarTitle,\n}) as PopoverToolbarComponent;\n\nexport {\n PopoverRoot as Root,\n PopoverContent as Content,\n PopoverTrigger as Trigger,\n PopoverClose as Close,\n PopoverAnchor as Anchor,\n PopoverToolbar as Toolbar,\n};\nexport type {\n PopoverRootProps as RootProps,\n PopoverContentProps as ContentProps,\n PopoverTriggerProps as TriggerProps,\n PopoverCloseProps as CloseProps,\n PopoverAnchorProps as AnchorProps,\n PopoverToolbarProps as ToolbarProps,\n PopoverToolbarSectionProps as ToolbarSectionProps,\n PopoverToolbarTitleProps as ToolbarTitleProps,\n};\n", "import { asChildPropDef } from '../props/as-child.prop.js';\nimport { heightPropDefs } from '../props/height.props.js';\nimport { widthPropDefs } from '../props/width.props.js';\n\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst contentSizes = ['1', '2', '3', '4'] as const;\n\nconst popoverContentPropDefs = {\n ...asChildPropDef,\n size: {\n type: 'enum',\n className: 'kui-r-size',\n values: contentSizes,\n default: '2',\n responsive: true,\n },\n width: widthPropDefs.width,\n minWidth: widthPropDefs.minWidth,\n maxWidth: { ...widthPropDefs.maxWidth, default: '480px' },\n ...heightPropDefs,\n} satisfies {\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n size: PropDef<(typeof contentSizes)[number]>;\n};\n\ntype PopoverContentOwnProps = GetPropDefTypes<\n typeof popoverContentPropDefs &\n typeof asChildPropDef &\n typeof widthPropDefs &\n typeof heightPropDefs\n>;\n\nexport { popoverContentPropDefs };\nexport type { PopoverContentOwnProps };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["popover_exports", "__export", "PopoverAnchor", "PopoverClose", "PopoverContent", "PopoverRoot", "PopoverToolbar", "PopoverTrigger", "React", "classNames", "PopoverPrimitive", "contentSizes", "popoverContentPropDefs", "asChildPropDef", "widthPropDefs", "heightPropDefs", "PopoverContentContext", "usePopoverContentContext", "caller", "ctx", "PopoverRoot", "props", "PopoverPrimitive", "PopoverTrigger", "children", "forwardedRef", "requireReactElement", "PopoverContent", "ownProps", "useThemeSizeProps", "popoverContentPropDefs", "className", "forceMount", "container", "contentProps", "extractProps", "labelId", "setLabelId", "contextValue", "PortalTheme", "classNames", "PopoverClose", "PopoverAnchor", "PopoverToolbarBase", "PopoverToolbarLeft", "ref", "PopoverToolbarCenter", "PopoverToolbarRight", "PopoverToolbarTitle", "idProp", "reactId", "id", "PopoverToolbar"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as d}from"./chunk-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as d}from"./chunk-KJZSXLIX.js";import{b as m}from"./chunk-5KJIPH2N.js";import{a as E}from"./chunk-VQPANPMI.js";var L={};E(L,{Button:()=>R,Content:()=>M,Item:()=>P,Root:()=>S,Viewport:()=>g,useMessageScroller:()=>f,useMessageScrollerScrollable:()=>V,useMessageScrollerVisibility:()=>N});import*as e from"react";import c from"classnames";import{MessageScroller as a,useMessageScroller as f,useMessageScrollerScrollable as V,useMessageScrollerVisibility as N}from"@shadcn/react/message-scroller";import{useComposedRefs as T}from"radix-ui/internal";var S=e.forwardRef(({autoScroll:o=!0,defaultScrollPosition:t="end",scrollEdgeThreshold:r,scrollMargin:s,className:n,children:i,...l},u)=>e.createElement(a.Provider,{autoScroll:o,defaultScrollPosition:t,...r!=null?{scrollEdgeThreshold:r}:{},...s!=null?{scrollMargin:s}:{}},e.createElement(a.Root,{...l,ref:u,className:c("kui-MessageScrollerRoot",n)},i)));S.displayName="MessageScroller.Root";var g=e.forwardRef(({className:o,"aria-label":t,fade:r=!0,...s},n)=>{let i=m(r),l=T(n,i);return e.createElement(a.Viewport,{"aria-label":t??"",...s,ref:l,"data-fade":r?"":void 0,className:c("kui-MessageScrollerViewport",o)})});g.displayName="MessageScroller.Viewport";var M=e.forwardRef(({className:o,...t},r)=>e.createElement(a.Content,{...t,ref:r,className:c("kui-MessageScrollerContent",o)}));M.displayName="MessageScroller.Content";var P=e.forwardRef(({className:o,...t},r)=>e.createElement(a.Item,{...t,ref:r,className:c("kui-MessageScrollerItem",o)}));P.displayName="MessageScroller.Item";var R=e.forwardRef(({direction:o="end",behavior:t="auto",className:r,children:s,size:n,variant:i="surface",emphasis:l,color:u="gray",radius:v="full","aria-label":b,onClick:y,...B},w)=>{let{scrollToEnd:h,scrollToStart:C}=f(),k=p=>{if(y?.(p),p.defaultPrevented)return;p.preventDefault(),p.currentTarget.closest(".kui-MessageScrollerRoot")?.querySelector(".kui-MessageScrollerViewport")?.focus({preventScroll:!0}),o==="start"?C({behavior:t}):h({behavior:t})};return e.createElement(a.Button,{direction:o,behavior:t,onClick:k,render:e.createElement(d,{iconOnly:!0,...B,ref:w,size:n,...l?{emphasis:l}:{variant:i},color:u,radius:v,"aria-label":b??(o==="end"?"Jump to the latest":"Jump to the first"),className:c("kui-MessageScrollerButton",r),"data-direction":o},s??e.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":!0,style:o==="start"?{transform:"rotate(180deg)"}:void 0},e.createElement("path",{d:"M7.5 2.5v10M3.5 8.5l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})))})});R.displayName="MessageScroller.Button";export{f as a,V as b,N as c,S as d,g as e,M as f,P as g,R as h,L as i};
|
|
3
|
+
//# sourceMappingURL=chunk-MMDZBPSX.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as i}from"./chunk-KVVRFWGQ.js";import{c as
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as i}from"./chunk-KVVRFWGQ.js";import{c as m}from"./chunk-OKQAVYW4.js";import{c as l}from"./chunk-5ON3XLRD.js";import{a as y}from"./chunk-VQPANPMI.js";var u={};y(u,{Actions:()=>c,Logo:()=>N,Navigation:()=>b,Root:()=>f});import*as o from"react";import n from"classnames";var g=["static","fixed","sticky"],R=["1","2","3","4"],v={position:{type:"enum",values:g,default:"fixed"},size:{type:"enum",values:R,default:"2"}};var f=o.forwardRef((r,t)=>{let a=l(r,v.size),{children:s,className:e,...p}=m(a,v),P=a.position??"fixed",d=a.size??"2";return o.createElement("header",{...p,ref:t,className:n("kui-NavbarRoot",e),"data-position":P,"data-size":d},o.createElement("div",{className:"kui-NavbarContainer"},s))});f.displayName="Navbar.Root";var N=o.forwardRef(({gap:r="2",align:t="center",justify:a="start",className:s,...e},p)=>o.createElement(i,{ref:p,gap:r,align:t,justify:a,className:n("kui-NavbarLogo",s),...e}));N.displayName="Navbar.Logo";var b=o.forwardRef(({gap:r="4",align:t="center",justify:a="center",className:s,...e},p)=>o.createElement(i,{ref:p,gap:r,align:t,justify:a,className:n("kui-NavbarNavigation",s),role:"navigation","aria-label":e["aria-labelledby"]===void 0?"Main":void 0,...e}));b.displayName="Navbar.Navigation";var c=o.forwardRef(({gap:r="4",align:t="center",justify:a="end",className:s,...e},p)=>o.createElement(i,{ref:p,gap:r,align:t,justify:a,className:n("kui-NavbarActions",s),...e}));c.displayName="Navbar.Actions";export{f as a,N as b,b as c,c as d,u as e};
|
|
3
|
+
//# sourceMappingURL=chunk-NWXODCTD.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as i}from"./chunk-CR65RYGM.js";import{a as p,b as n}from"./chunk-7N2Q5WOM.js";import{b as a}from"./chunk-5KMEUZWN.js";import{
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as i}from"./chunk-CR65RYGM.js";import{a as p,b as n}from"./chunk-7N2Q5WOM.js";import{b as a}from"./chunk-5KMEUZWN.js";import{c as t}from"./chunk-OKQAVYW4.js";import{a as o}from"./chunk-CLJ6SEGP.js";import*as s from"react";import N from"classnames";var y=["div","span"],P=["none","inline-grid","grid"],g=["1","2","3","4","5","6","7","8","9"],v=["1","2","3","4","5","6","7","8","9"],D=["row","column","dense","row-dense","column-dense"],V=["start","center","end","baseline","stretch"],w=["start","center","end","between"],G=["start","center","end","baseline","between","around","evenly","stretch"],b=["start","center","end","baseline","stretch"],r={as:{type:"enum",values:y,default:"div"},...o,display:{type:"enum",className:"kui-r-display",values:P,responsive:!0},areas:{type:"string",className:"kui-r-gta",customProperties:["--grid-template-areas"],responsive:!0},columns:{type:"enum | string",className:"kui-r-gtc",customProperties:["--grid-template-columns"],values:g,parseValue:u,responsive:!0},rows:{type:"enum | string",className:"kui-r-gtr",customProperties:["--grid-template-rows"],values:v,parseValue:u,responsive:!0},flow:{type:"enum",className:"kui-r-gaf",values:D,responsive:!0},align:{type:"enum",className:"kui-r-ai",values:V,responsive:!0},justify:{type:"enum",className:"kui-r-jc",values:w,parseValue:j,responsive:!0},alignContent:{type:"enum",className:"kui-r-ac",values:G,parseValue:C,responsive:!0},justifyItems:{type:"enum",className:"kui-r-ji",values:b,responsive:!0},...i};function u(e){return r.columns.values.includes(e)?e:e?.match(/^\d+$/)?`repeat(${e}, minmax(0, 1fr))`:e}function j(e){return e==="between"?"space-between":e}function C(e){return e==="between"?"space-between":e==="around"?"space-around":e==="evenly"?"space-evenly":e}var h=s.forwardRef((e,m)=>{let{className:l,asChild:f,as:c="div",...d}=t(e,r,p,n);return s.createElement(f?a:c,{...d,ref:m,className:N("kui-Grid",l)})});h.displayName="Grid";export{h as a};
|
|
3
|
+
//# sourceMappingURL=chunk-Q5SANVIW.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import*as i from"react";var a="(max-width: 767.98px) and (pointer: coarse)",o,n=()=>o??(o=window.matchMedia(a));function r(e,t){return typeof e.addEventListener=="function"?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):(e.addListener?.(t),()=>e.removeListener?.(t))}function c(e){return r(n(),e)}function s(){return i.useSyncExternalStore(c,()=>n().matches,()=>!1)}function d(){return n().matches}function u(e){let t=n();return r(t,()=>e(t.matches))}export{a,s as b,d as c,u as d};
|
|
3
|
+
//# sourceMappingURL=chunk-QEDKL23P.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/_internal/shell-page-scroll.ts"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\n\n/**\n * When a window Shell lets the page scroll: a narrow window (below the `sm` breakpoint) under a\n * coarse pointer. The stylesheet decides it (shell.css, the page-scroll block), so first paint is\n * right with no script. This is the script's copy, for the few things only script can do when the\n * answer changes: carry the reading position between the two scrollers, and take the content's\n * unused viewport out of the tab order. A test holds it equal to the stylesheet's.\n */\nexport const PAGE_SCROLL_QUERY = '(max-width: 767.98px) and (pointer: coarse)';\n\nlet list: MediaQueryList | undefined;\nconst media = () => (list ??= window.matchMedia(PAGE_SCROLL_QUERY));\n\nfunction listen(m: MediaQueryList, handler: () => void): () => void {\n // Safari below 14 has only the deprecated listener API.\n if (typeof m.addEventListener === 'function') {\n m.addEventListener('change', handler);\n return () => m.removeEventListener('change', handler);\n }\n m.addListener?.(handler);\n return () => m.removeListener?.(handler);\n}\n\nfunction subscribe(onChange: () => void): () => void {\n return listen(media(), onChange);\n}\n\n/** True where a window Shell lets the page scroll. False on the server and through hydration. */\nexport function usePageScrollMedia(): boolean {\n return React.useSyncExternalStore(\n subscribe,\n () => media().matches,\n () => false,\n );\n}\n\n/** Whether the page scrolls right now. */\nexport function pageScrollMatches(): boolean {\n return media().matches;\n}\n\n/** Subscribes to the answer changing, outside React. */\nexport function onPageScrollMediaChange(onChange: (matches: boolean) => void): () => void {\n const m = media();\n return listen(m, () => onChange(m.matches));\n}\n"],
|
|
5
|
+
"mappings": ";AAEA,UAAYA,MAAW,QAShB,IAAMC,EAAoB,8CAE7BC,EACEC,EAAQ,IAAOD,MAAS,OAAO,WAAWD,CAAiB,GAEjE,SAASG,EAAOC,EAAmBC,EAAiC,CAElE,OAAI,OAAOD,EAAE,kBAAqB,YAChCA,EAAE,iBAAiB,SAAUC,CAAO,EAC7B,IAAMD,EAAE,oBAAoB,SAAUC,CAAO,IAEtDD,EAAE,cAAcC,CAAO,EAChB,IAAMD,EAAE,iBAAiBC,CAAO,EACzC,CAEA,SAASC,EAAUC,EAAkC,CACnD,OAAOJ,EAAOD,EAAM,EAAGK,CAAQ,CACjC,CAGO,SAASC,GAA8B,CAC5C,OAAa,uBACXF,EACA,IAAMJ,EAAM,EAAE,QACd,IAAM,EACR,CACF,CAGO,SAASO,GAA6B,CAC3C,OAAOP,EAAM,EAAE,OACjB,CAGO,SAASQ,EAAwBH,EAAkD,CACxF,IAAMH,EAAIF,EAAM,EAChB,OAAOC,EAAOC,EAAG,IAAMG,EAASH,EAAE,OAAO,CAAC,CAC5C",
|
|
6
|
+
"names": ["React", "PAGE_SCROLL_QUERY", "list", "media", "listen", "m", "handler", "subscribe", "onChange", "usePageScrollMedia", "pageScrollMatches", "onPageScrollMediaChange"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{c as s}from"./chunk-OKQAVYW4.js";import{a as o}from"./chunk-CLJ6SEGP.js";import*as e from"react";import P from"classnames";import{Slot as b}from"radix-ui";var f=["1","2","3","4","5","6","7","8","9"],d=["raised","soft"],r={...o,size:{type:"enum",className:"kui-r-size",values:f,responsive:!0},variant:{type:"enum",className:"kui-variant",values:d,default:"raised"}};var c=e.forwardRef((t,p)=>{let{asChild:a,className:m,...i}=s(t,r),n=a?b.Root:"kbd";return e.createElement(n,{...i,ref:p,className:P("kui-reset","kui-Kbd",m)})});c.displayName="Kbd";export{c as a};
|
|
3
|
+
//# sourceMappingURL=chunk-QPRUTOLI.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as R,b as y,c as x}from"./chunk-LTUW36HM.js";import{a as O,b as M,c as T}from"./chunk-QKCNGEX4.js";import{a as d,c as w,f as E,g as H}from"./chunk-XUCR7L4G.js";import{a as B}from"./chunk-G66WDIIV.js";import{o as S}from"./chunk-GHWEXMF6.js";import
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as v,e as p}from"./chunk-3QWGSRYC.js";import{a as R,b as y,c as x}from"./chunk-LTUW36HM.js";import{a as O,b as M,c as T}from"./chunk-QKCNGEX4.js";import{a as C}from"./chunk-WEBNIUEX.js";import{a as d,c as w,f as E,g as H}from"./chunk-XUCR7L4G.js";import{a as B}from"./chunk-G66WDIIV.js";import{o as S}from"./chunk-GHWEXMF6.js";import*as e from"react";import le from"classnames";import{useComposedRefs as re}from"radix-ui/internal";var pe={controlled:"open",default:"defaultOpen"},N=e.forwardRef((I,U)=>{let{className:k,presentation:V="fixed",defaultOpen:A,open:L,onOpenChange:$,expandedSize:t=200,minSize:n=100,maxSize:a=400,resizable:m=!1,collapsible:q=!0,onExpand:D,onCollapse:W,onResize:_,onResizeStart:j,onResizeEnd:F,snapPoints:s,snapTolerance:G,collapseThreshold:i,paneId:l,persistence:r,children:K,style:J,size:c,defaultSize:u,onSizeChange:Q,sizeUpdate:X,sizeUpdateMs:Y=50,inset:f,id:Z,...z}=I,{table:P,attributes:ee}=x(V,"fixed"),o=R({name:"bottom",label:"Bottom",propNames:pe,id:Z,controlled:d(L),defaultValue:d(A),presentationTable:P,builtIn:w,onChange:(se,ie)=>$?.(se!=="closed",{reason:ie}),onExpand:D,onCollapse:W,size:t});S("bottom",f),e.useEffect(()=>{(s!==void 0||i!==void 0||l!==void 0||r!==void 0)&&void 0},[s,i,l,r]);let b=e.useRef(null),oe=re(U,o.setElement,b),te=M({name:"bottom",elementId:o.id,elementRef:b,cssVarName:"--bottom-size",orientation:"horizontal",edge:"start",growth:E,expandedSize:t,minSize:n,maxSize:a,resizable:m,collapsible:q,size:c,defaultSize:u,onSizeChange:Q,sizeUpdate:X,sizeUpdateMs:Y,onResize:_,onResizeStart:j,onResizeEnd:F,snapPoints:s,snapTolerance:G,collapseThreshold:i,paneId:l,persistence:r,overlaying:o.overlaying,overlayingNow:()=>P[B()]==="overlay",requestCollapse:()=>o.setValue("closed","toggle"),requestToggle:()=>o.toggle("toggle")}),h=O(c,u,n,a),{handles:g,content:ne}=T(K,p),ae=m&&o.shown!==!1&&!o.overlaying?e.createElement(C.Provider,{value:te},g.length>0?g:e.createElement(v,null)):null;return e.createElement("div",{...H(z),id:o.id,ref:oe,className:le("kui-ShellPane","kui-ShellBottom",k),...y(o,ee),"data-inset":f||void 0,tabIndex:o.overlaying?-1:z.tabIndex,style:{...J,"--bottom-expanded-size":`${t}px`,...h?{"--bottom-size":h}:{},"--bottom-min-size":`${n}px`,"--bottom-max-size":`${a}px`}},e.createElement("div",{className:"kui-ShellBottomContent"},ne),ae)});N.displayName="Shell.Bottom";N.Handle=p;export{N as a};
|
|
3
|
+
//# sourceMappingURL=chunk-QRV32INS.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{c as
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{c as P}from"./chunk-OKQAVYW4.js";import{c}from"./chunk-5ON3XLRD.js";import{c as b}from"./chunk-HBWBPBSA.js";import{a as f}from"./chunk-CLJ6SEGP.js";import{a as R}from"./chunk-VQPANPMI.js";var v={};R(v,{Content:()=>g,List:()=>u,Root:()=>l,Trigger:()=>y});import*as e from"react";import p from"classnames";import{Tabs as i}from"radix-ui";var d=["1","2","3","4"],C=["nowrap","wrap","wrap-reverse"],L=["start","center","end"],a={size:{type:"enum",className:"kui-r-size",values:d,default:"2",responsive:!0},wrap:{type:"enum",className:"kui-r-fw",values:C,responsive:!0},justify:{type:"enum",className:"kui-r-jc",values:L,responsive:!0},...b};var k={...f},h={...f};var l=e.forwardRef((t,o)=>{let{className:r,...s}=t;return e.createElement(i.Root,{...s,ref:o,className:p("kui-TabsRoot",r)})});l.displayName="Tabs.Root";var u=e.forwardRef((t,o)=>{let r=c(t,a.size),{className:s,color:n,...m}=P(r,a);return e.createElement(i.List,{"data-accent-color":n,...m,asChild:!1,ref:o,className:p("kui-BaseTabList","kui-TabsList",s)})});u.displayName="Tabs.List";var y=e.forwardRef((t,o)=>{let{className:r,children:s,...n}=t,m=e.Children.toArray(s).every(T=>typeof T=="string"||typeof T=="number");return e.createElement(i.Trigger,{...n,asChild:!1,ref:o,className:p("kui-reset","kui-BaseTabListTrigger","kui-TabsTrigger",r)},e.createElement("span",{className:"kui-BaseTabListTriggerInner kui-TabsTriggerInner"},s),m?e.createElement("span",{className:"kui-BaseTabListTriggerInnerHidden kui-TabsTriggerInnerHidden","aria-hidden":!0},s):null)});y.displayName="Tabs.Trigger";var g=e.forwardRef((t,o)=>{let{className:r,...s}=t;return e.createElement(i.Content,{...s,ref:o,className:p("kui-TabsContent",r)})});g.displayName="Tabs.Content";export{l as a,u as b,y as c,g as d,v as e};
|
|
3
|
+
//# sourceMappingURL=chunk-REORAMUH.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as b}from"./chunk-YOSLXJI5.js";import{c as g}from"./chunk-OKQAVYW4.js";import{c as y}from"./chunk-5ON3XLRD.js";import{a as m,e as v}from"./chunk-HBWBPBSA.js";import{b as P}from"./chunk-XU74PNM2.js";import{a as f}from"./chunk-CLJ6SEGP.js";import*as e from"react";import A from"classnames";import{Avatar as u}from"radix-ui";var q=["1","2","3","4","5","6","7","8","9"],B=["raised","solid","soft","surface","outline"],U=["cover","contain","fill","scale-down","none"],c={...f,size:{type:"enum",className:"kui-r-size",values:q,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:B,default:"raised"},...v,...P,fallback:{type:"ReactNode",required:!0},status:{type:"enum",values:m,default:void 0},statusLabel:{type:"string",default:void 0},badge:{type:"ReactNode",default:void 0},fit:{type:"enum",className:"kui-r-fit",values:U,default:"cover",responsive:!0}};var _=e.forwardRef((a,s)=>{let o=y(a,c.size),{asChild:t,children:r,className:n,style:i,color:h,radius:N,status:d,statusLabel:l,badge:p,fallback:k,onLoadingStatusChange:D,src:C,alt:I,srcSet:z,sizes:S,crossOrigin:w,referrerPolicy:E,loading:L,decoding:x,onLoad:F,onError:O,...j}=g(o,c),T={fallback:k,onLoadingStatusChange:D,src:C,alt:I,srcSet:z,sizes:S,crossOrigin:w,referrerPolicy:E,loading:L,decoding:x,onLoad:F,onError:O},V=t&&r!=null&&e.isValidElement(r)&&(r.props.disabled===!0||r.props["data-disabled"]===!0),W=p!==void 0||d!==void 0,G=p!==void 0?e.createElement("span",{className:"kui-AvatarBadge"},p):d!==void 0?e.createElement("span",{className:"kui-AvatarStatus","data-accent-color":d,role:l?"img":void 0,"aria-label":l||void 0,"aria-hidden":l?void 0:!0}):null;return e.createElement(u.Root,{...j,ref:s,"data-accent-color":h,"data-radius":N,"data-disabled":V||void 0,"data-has-indicator":W||void 0,className:A("kui-reset","kui-AvatarRoot",n),style:i,asChild:t},b({asChild:t,children:r},e.createElement(e.Fragment,null,e.createElement(R,{...T}),G)))});_.displayName="Avatar";var R=e.memo(({fallback:a,onLoadingStatusChange:s,...o})=>{let[t,r]=e.useState("idle"),n=e.useCallback(i=>{s?.(i),r(i)},[s]);return e.createElement(e.Fragment,null,t==="idle"||t==="loading"?e.createElement("span",{className:"kui-AvatarFallback"}):null,t==="error"?e.createElement(u.Fallback,{className:A("kui-AvatarFallback",{"kui-one-letter":typeof a=="string"&&a.length===1,"kui-two-letters":typeof a=="string"&&a.length===2}),...o.alt?{role:"img","aria-label":o.alt}:{"aria-hidden":!0}},a):null,e.createElement(u.Image,{className:"kui-AvatarImage",...o,onLoadingStatusChange:n}))});R.displayName="AvatarImpl";export{_ as a};
|
|
3
|
+
//# sourceMappingURL=chunk-SUQJ7DD4.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as d}from"./chunk-MGWGD6KI.js";import{b as C}from"./chunk-QEDKL23P.js";import{a as s}from"./chunk-ANQLWGFN.js";import{j as m}from"./chunk-GHWEXMF6.js";import*as e from"react";import c from"classnames";var v=e.createContext(null);function u(){return e.useContext(v)}var S=e.createContext("2"),k=e.createContext(!1),B=e.createContext(!1);function T({children:t,presentation:n}){let o=e.useContext(S),a=e.useMemo(()=>({size:o,menuVariant:"soft",presentation:n}),[o,n]);return e.createElement(v.Provider,{value:a},t)}function P(){let t=u(),n=e.useContext(S),o=t?.size??n,a=t?.menuVariant??"soft";return["kui-ShellPaneChrome",`kui-r-size-${o}`,`kui-menu-variant-${a}`]}var N={1:"2",2:"3",3:"4",4:"4"};function f(){let t=u(),n=e.useContext(S);return N[t?.size??n]}function W(){let t=e.useContext(s),n=e.useContext(m)!==null,o=f();return t!==void 0?t:n?o:null}var H=e.forwardRef(({className:t,float:n,children:o,...a},i)=>{let r=P(),l=f();return e.createElement("div",{...a,ref:i,"data-float":n||void 0,className:c("kui-ShellPaneHeader","kui-SidebarHeader","kui-SidebarHeader--container",...r,t)},e.createElement(s.Provider,{value:l},o))});H.displayName="Shell.PaneHeader";var y=e.forwardRef(({className:t,float:n,children:o,...a},i)=>{let r=P(),l=f();return e.createElement("div",{...a,ref:i,"data-float":n||void 0,className:c("kui-ShellPaneFooter","kui-SidebarFooter","kui-SidebarFooter--container",...r,t)},e.createElement(s.Provider,{value:l},o))});y.displayName="Shell.PaneFooter";var F=e.forwardRef(({className:t,style:n,dir:o,children:a,fade:i=!1,...r},l)=>{let x=P(),p=e.useContext(k),h=u(),R=p&&h===null,z=e.useContext(B),b=C();if(R){let V=r.tabIndex??(z&&b?-1:void 0);return e.createElement(d,{...r,tabIndex:V,ref:l,type:"hover",fade:i,className:"kui-ShellScroll"},e.createElement("div",{style:n,dir:o,className:c("kui-ShellScrollContent",t)},a))}return e.createElement(d,{...r,ref:l,type:"hover",fade:i,className:"kui-ShellScroll"},e.createElement("div",{style:n,dir:o,className:c("kui-BaseMenuContent","kui-SidebarContent",...x,t)},e.createElement(s.Provider,{value:null},e.createElement("div",{className:"kui-BaseMenuViewport"},a))))});F.displayName="Shell.Scroll";export{v as a,u as b,S as c,k as d,B as e,T as f,N as g,W as h,H as i,y as j,F as k};
|
|
3
|
+
//# sourceMappingURL=chunk-TSWHVZ47.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/_internal/pane-chrome.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\n/**\n * A pane's own chrome: a header row, a scrolling region and a footer row.\n *\n * Shell.Sidebar and Shell.Panel render these as `Shell.PaneHeader`, `Shell.Scroll` and\n * `Shell.PaneFooter`. The pane renders anything; with these parts it is the presentation, so\n * Sidebar's menu parts work inside it with no `Sidebar.Root`. The index comes from the nearest\n * Shell (`Shell.Root size`), or from a deprecated `Sidebar.Root` that still wraps them.\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { ScrollArea } from '../scroll-area.js';\nimport { ShellStoreContext } from './shell-store.js';\nimport { PaneBandSizeContext, type BandSize } from './pane-band-context.js';\nimport { usePageScrollMedia } from './shell-page-scroll.js';\n\ntype PaneSize = '1' | '2' | '3';\n\ntype SidebarVisualContextValue = {\n size: PaneSize;\n menuVariant: 'solid' | 'soft';\n presentation?: 'thin' | 'expanded';\n color?: string;\n};\n\n/** Size, menu highlight and presentation for the Sidebar parts. Internal: not exported. */\nconst SidebarVisualContext = React.createContext<SidebarVisualContextValue | null>(null);\n\nfunction useSidebarVisual() {\n return React.useContext(SidebarVisualContext);\n}\n\n/** The Shell's index. `Shell.Root size` sets it; panes hand it to their chrome. */\nconst ShellSizeContext = React.createContext<PaneSize>('2');\n\n/**\n * True inside `Shell.Content`. `Shell.Root` sets it back to false, so a Shell nested in the\n * content gets pane chrome in its own panes. Read by `Shell.Scroll`: in the content it holds a\n * page, not a menu, so it takes none of the menu's padding, gap or layering.\n */\nconst ShellContentContext = React.createContext(false);\n\n/**\n * True inside a window Shell: one with no `contained` and no `height`, which lets the page scroll\n * on a narrow touch screen. Each `Shell.Root` sets its own, so a Shell nested in another answers\n * for itself.\n */\nconst ShellWindowContext = React.createContext(false);\n\n/**\n * Gives a Shell pane's children the Shell's index, so Sidebar parts size themselves. In a Rail\n * the rows are `thin`: icon tiles with a small label, sub-menus as dropdowns.\n */\nfunction PaneChromeScope({ children, presentation }: { children: React.ReactNode; presentation?: 'thin' }) {\n const size = React.useContext(ShellSizeContext);\n const value = React.useMemo<SidebarVisualContextValue>(() => ({ size, menuVariant: 'soft', presentation }), [size, presentation]);\n return <SidebarVisualContext.Provider value={value}>{children}</SidebarVisualContext.Provider>;\n}\n\nfunction useChromeClasses() {\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 size = visual?.size ?? shellSize;\n const menuVariant = visual?.menuVariant ?? 'soft';\n return ['kui-ShellPaneChrome', `kui-r-size-${size}`, `kui-menu-variant-${menuVariant}`];\n}\n\n/**\n * The index a Toolbar in a pane's header or footer rests at when it states none: one step above\n * the Shell's, so the band reads as chrome over the rows (v2 BAND_STEP). 4 has no step above.\n */\nconst BAND_STEP = { '1': '2', '2': '3', '3': '4', '4': '4' } as const satisfies Record<BandSize, BandSize>;\n\nfunction useBandSize(): BandSize {\n const visual = useSidebarVisual();\n const shellSize = React.useContext(ShellSizeContext);\n return BAND_STEP[visual?.size ?? shellSize];\n}\n\n/**\n * The size a Toolbar with no `size` of its own rests at, or null for none.\n *\n * In a pane's header or footer it is that band's size. Anywhere else inside a Shell, such as\n * `Shell.Content` or a pane's body, it is the same step: one above the Shell's index, so a\n * toolbar in the content area matches the ones in the pane headers beside it (v2 sizes every\n * toolbar this way). A pane's scrolling list, and anything outside a Shell, has none.\n */\nfunction usePaneBandSize(): BandSize | null {\n const band = React.useContext(PaneBandSizeContext);\n const inShell = React.useContext(ShellStoreContext) !== null;\n const step = useBandSize();\n if (band !== undefined) return band;\n return inShell ? step : null;\n}\n\ninterface PaneHeaderProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Floats the row over the top of `Shell.Scroll`, so the list scrolls behind it. The list\n * starts below the row, and `Shell.Scroll fade` fades it out under the row. The row paints\n * nothing and lets clicks through between its controls; a `Toolbar backdrop` in it keeps\n * the controls readable.\n */\n float?: boolean;\n}\n\n/** A pane's header row, pinned above its scrolling region. */\nconst PaneHeader = React.forwardRef<HTMLDivElement, PaneHeaderProps>(({ className, float, children, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n const band = useBandSize();\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-float={float || undefined}\n className={classNames('kui-ShellPaneHeader', 'kui-SidebarHeader', 'kui-SidebarHeader--container', ...chrome, className)}\n >\n <PaneBandSizeContext.Provider value={band}>{children}</PaneBandSizeContext.Provider>\n </div>\n );\n});\nPaneHeader.displayName = 'Shell.PaneHeader';\n\ninterface PaneFooterProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Floats the row over the bottom of `Shell.Scroll`, the way `Shell.PaneHeader float` does at the top. */\n float?: boolean;\n}\n\n/** A pane's footer row, pinned below its scrolling region. */\nconst PaneFooter = React.forwardRef<HTMLDivElement, PaneFooterProps>(({ className, float, children, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n const band = useBandSize();\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-float={float || undefined}\n className={classNames('kui-ShellPaneFooter', 'kui-SidebarFooter', 'kui-SidebarFooter--container', ...chrome, className)}\n >\n <PaneBandSizeContext.Provider value={band}>{children}</PaneBandSizeContext.Provider>\n </div>\n );\n});\nPaneFooter.displayName = 'Shell.PaneFooter';\n\ninterface ScrollProps extends React.ComponentPropsWithoutRef<'div'> {\n /** Fades the list out toward an edge with more past it, and under a floating header or footer. */\n fade?: boolean;\n}\n\n/**\n * The one region of a pane that scrolls; it takes the room the header and footer leave.\n * In `Shell.Content` it is the page's scroller, and a `Shell.PaneHeader float` beside it pins\n * the page's toolbar over it. The ref, events and ARIA props land on the element that scrolls;\n * `className`, `style` and `dir` apply to the content inside it. In a Rail, Panel or Sidebar the pane is\n * already a navigation landmark, so it needs no role of its own.\n */\nconst Scroll = React.forwardRef<HTMLDivElement, ScrollProps>(({ className, style, dir, children, fade = false, ...props }, forwardedRef) => {\n const chrome = useChromeClasses();\n // A Sidebar.Root inside the content still gets a menu.\n const contentPane = React.useContext(ShellContentContext);\n const visual = useSidebarVisual();\n const inContent = contentPane && visual === null;\n // While the page scrolls, the content's viewport scrolls nothing: as a tab stop it would take a\n // Tab, ring the whole page and move nothing. Resolved after mount; a `tabIndex` of the caller's wins.\n const windowShell = React.useContext(ShellWindowContext);\n const pageScrolls = usePageScrollMedia();\n if (inContent) {\n const tabIndex = props.tabIndex ?? (windowShell && pageScrolls ? -1 : undefined);\n return (\n <ScrollArea {...props} tabIndex={tabIndex} ref={forwardedRef} type=\"hover\" fade={fade} className=\"kui-ShellScroll\">\n <div style={style} dir={dir} className={classNames('kui-ShellScrollContent', className)}>\n {children}\n </div>\n </ScrollArea>\n );\n }\n return (\n <ScrollArea {...props} ref={forwardedRef} type=\"hover\" fade={fade} className=\"kui-ShellScroll\">\n <div style={style} dir={dir} className={classNames('kui-BaseMenuContent', 'kui-SidebarContent', ...chrome, className)}>\n {/* A header's band does not reach a Toolbar in the scrolling list. */}\n <PaneBandSizeContext.Provider value={null}>\n <div className=\"kui-BaseMenuViewport\">{children}</div>\n </PaneBandSizeContext.Provider>\n </div>\n </ScrollArea>\n );\n});\nScroll.displayName = 'Shell.Scroll';\n\nexport { SidebarVisualContext, useSidebarVisual, ShellSizeContext, ShellContentContext, ShellWindowContext, PaneChromeScope, PaneHeader, PaneFooter, Scroll, BAND_STEP, usePaneBandSize };\nexport type { SidebarVisualContextValue, PaneSize, BandSize, PaneHeaderProps, PaneFooterProps, ScrollProps };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["React", "classNames", "SidebarVisualContext", "useSidebarVisual", "ShellSizeContext", "ShellContentContext", "ShellWindowContext", "PaneChromeScope", "children", "presentation", "size", "value", "useChromeClasses", "visual", "shellSize", "menuVariant", "BAND_STEP", "useBandSize", "usePaneBandSize", "band", "PaneBandSizeContext", "inShell", "ShellStoreContext", "step", "PaneHeader", "className", "float", "props", "forwardedRef", "chrome", "classNames", "PaneFooter", "Scroll", "style", "dir", "fade", "contentPane", "inContent", "windowShell", "pageScrolls", "usePageScrollMedia", "tabIndex", "ScrollArea"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as N}from"./chunk-BUXK5VGR.js";import{b as E,c as w}from"./chunk-GKDGNPBD.js";import{a as L}from"./chunk-KOAWATCI.js";import{c as g}from"./chunk-OKQAVYW4.js";import{a as z}from"./chunk-AQKSO3SW.js";import{b as O}from"./chunk-FVRVBB6O.js";import{b as x}from"./chunk-5ON3XLRD.js";import{c as C}from"./chunk-HBWBPBSA.js";import{b as D}from"./chunk-XU74PNM2.js";import{a as q}from"./chunk-VQPANPMI.js";var $={};q($,{Content:()=>W,Group:()=>H,Item:()=>K,Label:()=>j,Root:()=>A,Separator:()=>U,Trigger:()=>B});import*as e from"react";import S from"classnames";import{Select as r,ScrollArea as R}from"radix-ui";var J=["1","2","3","4"],v={size:{type:"enum",className:"kui-r-size",values:J,default:"2",responsive:!0}},Q=["raised","surface","soft","outline","ghost"],G={variant:{type:"enum",className:"kui-variant",values:Q,default:"raised"},error:{type:"boolean"},loading:{type:"boolean"},disabled:{type:"boolean"},readOnly:{type:"boolean"},...C,...D,placeholder:{type:"ReactNode"}},M={...C};var V={size:v.size},X=[" ","Enter","ArrowUp","ArrowDown"],h=e.createContext({}),A=o=>{let{children:t,size:a,open:s,defaultOpen:n,onOpenChange:c,...P}=o,p=x(a,v.size),[f,i]=e.useState(n??!1),m=s??f,u=e.useCallback(d=>{i(d),c?.(d)},[c]);return e.createElement(r.Root,{...P,open:m,onOpenChange:u},e.createElement(h.Provider,{value:e.useMemo(()=>({size:p,open:m}),[p,m])},t))};A.displayName="Select.Root";var B=e.forwardRef((o,t)=>{let a=e.useContext(h),{children:s,className:n,color:c,radius:P,placeholder:p,error:f,loading:i,disabled:m,readOnly:u,...d}=g({size:a?.size,...o},V,G),{"aria-invalid":y,"aria-busy":b,"aria-disabled":T,"aria-readonly":k}=d,I=!!f||y===!0||y==="true",Y=e.useMemo(()=>({"aria-invalid":I?!0:y,"aria-busy":i||b,"aria-disabled":m||T,"aria-readonly":u||k}),[I,y,i,b,m,T,u,k]),F=!!(u||i)?{onPointerDown:l=>l.preventDefault(),onClick:l=>{l.preventDefault(),l.currentTarget.focus()},onKeyDown:l=>{let _=l.ctrlKey||l.altKey||l.metaKey;(X.includes(l.key)||!_&&l.key.length===1)&&l.preventDefault()}}:void 0;return e.createElement(r.Trigger,{asChild:!0,disabled:m,...F},e.createElement("button",{"data-accent-color":c,"data-radius":P,"data-error":f,"data-loading":i,...d,...Y,ref:t,className:S("kui-reset","kui-SelectTrigger",n)},e.createElement("span",{className:"kui-SelectTriggerInner"},e.createElement(r.Value,{placeholder:p},s)),e.createElement(r.Icon,{asChild:!0},i?e.createElement("span",{className:"kui-SelectIcon kui-SelectLoadingIcon","aria-hidden":"true"},e.createElement(N,null)):e.createElement(w,{className:"kui-SelectIcon"}))))});B.displayName="Select.Trigger";var W=e.forwardRef((o,t)=>{let a=e.useContext(h),{className:s,children:n,color:c,container:P,...p}=g({size:a?.size,...o},V,M),f=O();if(a.open===!1&&!p.forceMount)return e.createElement(r.Portal,{container:P},e.createElement(r.Content,{...p,asChild:!1,ref:t},n));let i=c||f.accentColor;return e.createElement(r.Portal,{container:P},e.createElement(z,{asChild:!0},e.createElement(r.Content,{"data-accent-color":i,sideOffset:4,...p,asChild:!1,ref:t,className:S("kui-PopperContent","kui-BaseMenuContent","kui-variant-soft","kui-SelectContent",s)},e.createElement(Z,null,n))))});W.displayName="Select.Content";function Z({children:o}){let t=L();return e.createElement(R.Root,{type:"auto",className:"kui-ScrollAreaRoot"},e.createElement(r.Viewport,{asChild:!0,className:S("kui-BaseMenuViewport","kui-SelectViewport")},e.createElement(R.Viewport,{ref:t,className:"kui-ScrollAreaViewport",style:{overflowY:void 0}},o)),e.createElement(R.Scrollbar,{className:"kui-ScrollAreaScrollbar",orientation:"vertical"},e.createElement(R.Thumb,{className:"kui-ScrollAreaThumb"})))}var K=e.forwardRef((o,t)=>{let{className:a,children:s,...n}=o,c=typeof s!="string";return e.createElement(r.Item,{...n,asChild:!1,ref:t,className:S("kui-reset","kui-BaseMenuItem","kui-SelectItem",{"kui-SelectItemRich":c},a)},e.createElement(r.ItemIndicator,{className:"kui-SelectItemIndicator"},e.createElement(E,{className:"kui-SelectItemIndicatorIcon"})),e.createElement(r.ItemText,null,s))});K.displayName="Select.Item";var H=e.forwardRef(({className:o,...t},a)=>e.createElement(r.Group,{...t,asChild:!1,ref:a,className:S("kui-SelectGroup",o)}));H.displayName="Select.Group";var j=e.forwardRef(({className:o,...t},a)=>e.createElement(r.Label,{...t,asChild:!1,ref:a,className:S("kui-BaseMenuLabel","kui-SelectLabel",o)}));j.displayName="Select.Label";var U=e.forwardRef(({className:o,...t},a)=>e.createElement(r.Separator,{...t,asChild:!1,ref:a,className:S("kui-BaseMenuSeparator","kui-SelectSeparator",o)}));U.displayName="Select.Separator";export{A as a,B as b,W as c,K as d,H as e,j as f,U as g,$ as h};
|
|
3
|
+
//# sourceMappingURL=chunk-VQDCHBZR.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/select.tsx", "../../src/components/select.props.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Select as SelectPrimitive, ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\n\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSize } from '../hooks/theme-size.js';\nimport { ChevronDownIcon, ThickCheckIcon } from './icons.js';\nimport { Spinner } from './spinner.js';\nimport {\n selectRootPropDefs,\n selectTriggerPropDefs,\n selectContentPropDefs,\n} from './select.props.js';\nimport { useThemeContext } from './theme.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { useThumbSync } from '../hooks/use-thumb-sync.js';\n\nimport type { GetPropDefTypes } from '../props/prop-def.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype SelectRootOwnProps = GetPropDefTypes<typeof selectRootPropDefs>;\n\n// Trigger and Content pass the size prop def as its own record. It is hoisted because\n// extractProps caches its compiled prop defs on the identity of each record it is given:\n// a literal written at the call site would be a new object, and a recompile, every render.\nconst selectSizePropDefs = { size: selectRootPropDefs.size };\n\n// Keys that open the list from the trigger, as in Radix.\nconst OPEN_KEYS = [' ', 'Enter', 'ArrowUp', 'ArrowDown'];\n\ninterface SelectContextValue extends SelectRootOwnProps {\n /** Whether the list is open. Undefined when Content is rendered outside a Kookie Select.Root. */\n open?: boolean;\n}\nconst SelectContext = React.createContext<SelectContextValue>({});\n\ninterface SelectRootProps extends SelectPrimitive.SelectProps, SelectRootOwnProps {}\nconst SelectRoot: React.FC<SelectRootProps> = (props) => {\n const {\n children,\n size: sizeProp,\n open: openProp,\n defaultOpen,\n onOpenChange,\n ...rootProps\n } = props;\n const size = useThemeSize(sizeProp, selectRootPropDefs.size);\n\n // Root owns the open state and hands Radix a controlled `open`, so Content learns of a\n // change in the same render Radix does. Radix's uncontrolled state reports changes from an\n // effect, a render late, which would mount the open list once without its wrappers.\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);\n const open = openProp ?? uncontrolledOpen;\n const handleOpenChange = React.useCallback(\n (next: boolean) => {\n setUncontrolledOpen(next);\n onOpenChange?.(next);\n },\n [onOpenChange],\n );\n\n return (\n <SelectPrimitive.Root {...rootProps} open={open} onOpenChange={handleOpenChange}>\n <SelectContext.Provider value={React.useMemo(() => ({ size, open }), [size, open])}>\n {children}\n </SelectContext.Provider>\n </SelectPrimitive.Root>\n );\n};\nSelectRoot.displayName = 'Select.Root';\n\ntype SelectTriggerElement = React.ElementRef<typeof SelectPrimitive.Trigger>;\ntype SelectTriggerOwnProps = GetPropDefTypes<typeof selectTriggerPropDefs>;\ninterface SelectTriggerProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Trigger, RemovedProps>,\n SelectTriggerOwnProps {}\nconst SelectTrigger = React.forwardRef<SelectTriggerElement, SelectTriggerProps>(\n (props, forwardedRef) => {\n const context = React.useContext(SelectContext);\n const {\n children,\n className,\n color,\n radius,\n placeholder,\n error,\n loading,\n disabled,\n readOnly,\n ...triggerProps\n } = extractProps(\n // Pass size value from the context to generate styles\n { size: context?.size, ...props },\n // Pass size prop def to allow it to be extracted\n selectSizePropDefs,\n selectTriggerPropDefs,\n );\n\n // The props win when set; otherwise a caller's own aria-* (a form library's aria-invalid)\n // stays, so both paths reach the accessibility tree and the CSS, as on TextField.\n const {\n 'aria-invalid': ariaInvalid,\n 'aria-busy': ariaBusy,\n 'aria-disabled': ariaDisabled,\n 'aria-readonly': ariaReadOnly,\n } = triggerProps;\n const isInvalid = Boolean(error) || ariaInvalid === true || ariaInvalid === 'true';\n const ariaProps = React.useMemo(\n () => ({\n 'aria-invalid': isInvalid ? true : ariaInvalid,\n 'aria-busy': loading || ariaBusy,\n 'aria-disabled': disabled || ariaDisabled,\n 'aria-readonly': readOnly || ariaReadOnly,\n }),\n [isInvalid, ariaInvalid, loading, ariaBusy, disabled, ariaDisabled, readOnly, ariaReadOnly],\n );\n\n // Read-only and loading triggers stay focusable but do not open or take typeahead,\n // as on Combobox. Radix skips its own handler when the event is default-prevented.\n const isBlocked = Boolean(readOnly || loading);\n const blockedHandlers = isBlocked\n ? {\n onPointerDown: (event: React.PointerEvent<HTMLButtonElement>) => event.preventDefault(),\n onClick: (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.currentTarget.focus();\n },\n onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => {\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (OPEN_KEYS.includes(event.key) || (!isModifierKey && event.key.length === 1)) {\n event.preventDefault();\n }\n },\n }\n : undefined;\n\n return (\n // `disabled` goes to Radix, which merges it with Root's and sets the native attribute.\n <SelectPrimitive.Trigger asChild disabled={disabled} {...blockedHandlers}>\n <button\n data-accent-color={color}\n data-radius={radius}\n data-error={error}\n data-loading={loading}\n {...triggerProps}\n {...ariaProps}\n ref={forwardedRef}\n className={classNames('kui-reset', 'kui-SelectTrigger', className)}\n >\n <span className=\"kui-SelectTriggerInner\">\n <SelectPrimitive.Value placeholder={placeholder}>{children}</SelectPrimitive.Value>\n </span>\n <SelectPrimitive.Icon asChild>\n {loading ? (\n <span className=\"kui-SelectIcon kui-SelectLoadingIcon\" aria-hidden=\"true\">\n <Spinner />\n </span>\n ) : (\n <ChevronDownIcon className=\"kui-SelectIcon\" />\n )}\n </SelectPrimitive.Icon>\n </button>\n </SelectPrimitive.Trigger>\n );\n },\n);\nSelectTrigger.displayName = 'Select.Trigger';\n\ntype SelectContentElement = React.ElementRef<typeof SelectPrimitive.Content>;\ntype SelectContentOwnProps = GetPropDefTypes<typeof selectContentPropDefs>;\ninterface SelectContentProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Content, RemovedProps>,\n SelectContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Portal>['container'];\n}\nconst SelectContent = React.forwardRef<SelectContentElement, SelectContentProps>(\n (props, forwardedRef) => {\n const context = React.useContext(SelectContext);\n const { className, children, color, container, ...contentProps } = extractProps(\n // Pass size value from the context to generate styles\n { size: context?.size, ...props },\n // Pass size prop def to allow it to be extracted\n selectSizePropDefs,\n selectContentPropDefs,\n );\n const themeContext = useThemeContext();\n\n // While closed, Radix still renders Content's children, into a detached fragment: the\n // items must exist for the trigger's value label, typeahead and the native form select.\n // Nothing in that fragment is ever shown, so the theme wrapper and the scroll area, with\n // its two resize observers, are left out until the list opens.\n if (context.open === false && !contentProps.forceMount) {\n return (\n <SelectPrimitive.Portal container={container}>\n <SelectPrimitive.Content {...contentProps} asChild={false} ref={forwardedRef}>\n {children}\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n }\n\n const resolvedColor = color || themeContext.accentColor;\n return (\n <SelectPrimitive.Portal container={container}>\n <PortalTheme asChild>\n <SelectPrimitive.Content\n data-accent-color={resolvedColor}\n sideOffset={4}\n {...contentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-PopperContent',\n 'kui-BaseMenuContent',\n 'kui-variant-soft',\n 'kui-SelectContent',\n className,\n )}\n >\n <SelectScrollArea>{children}</SelectScrollArea>\n </SelectPrimitive.Content>\n </PortalTheme>\n </SelectPrimitive.Portal>\n );\n },\n);\nSelectContent.displayName = 'Select.Content';\n\n/** The open list's scroll area. Its own component so the thumb sync hook runs only while open. */\nfunction SelectScrollArea({ children }: { children: React.ReactNode }) {\n const setThumbViewport = useThumbSync<HTMLDivElement>();\n return (\n <ScrollAreaPrimitive.Root type=\"auto\" className=\"kui-ScrollAreaRoot\">\n <SelectPrimitive.Viewport\n asChild\n className={classNames('kui-BaseMenuViewport', 'kui-SelectViewport')}\n >\n <ScrollAreaPrimitive.Viewport\n ref={setThumbViewport}\n className=\"kui-ScrollAreaViewport\"\n style={{ overflowY: undefined }}\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n </SelectPrimitive.Viewport>\n <ScrollAreaPrimitive.Scrollbar className=\"kui-ScrollAreaScrollbar\" orientation=\"vertical\">\n <ScrollAreaPrimitive.Thumb className=\"kui-ScrollAreaThumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n </ScrollAreaPrimitive.Root>\n );\n}\n\ntype SelectItemElement = React.ElementRef<typeof SelectPrimitive.Item>;\ninterface SelectItemProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Item, RemovedProps> {}\nconst SelectItem = React.forwardRef<SelectItemElement, SelectItemProps>((props, forwardedRef) => {\n const { className, children, ...itemProps } = props;\n\n // Detect if this is rich content (not just a string)\n const isRichContent = typeof children !== 'string';\n\n return (\n <SelectPrimitive.Item\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'kui-reset',\n 'kui-BaseMenuItem',\n 'kui-SelectItem',\n { 'kui-SelectItemRich': isRichContent },\n className,\n )}\n >\n <SelectPrimitive.ItemIndicator className=\"kui-SelectItemIndicator\">\n <ThickCheckIcon className=\"kui-SelectItemIndicatorIcon\" />\n </SelectPrimitive.ItemIndicator>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n );\n});\nSelectItem.displayName = 'Select.Item';\n\ntype SelectGroupElement = React.ElementRef<typeof SelectPrimitive.Group>;\ninterface SelectGroupProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Group, RemovedProps> {}\nconst SelectGroup = React.forwardRef<SelectGroupElement, SelectGroupProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Group\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-SelectGroup', className)}\n />\n ),\n);\nSelectGroup.displayName = 'Select.Group';\n\ntype SelectLabelElement = React.ElementRef<typeof SelectPrimitive.Label>;\ninterface SelectLabelProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Label, RemovedProps> {}\nconst SelectLabel = React.forwardRef<SelectLabelElement, SelectLabelProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Label\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuLabel', 'kui-SelectLabel', className)}\n />\n ),\n);\nSelectLabel.displayName = 'Select.Label';\n\ntype SelectSeparatorElement = React.ElementRef<typeof SelectPrimitive.Separator>;\ninterface SelectSeparatorProps\n extends ComponentPropsWithout<typeof SelectPrimitive.Separator, RemovedProps> {}\nconst SelectSeparator = React.forwardRef<SelectSeparatorElement, SelectSeparatorProps>(\n ({ className, ...props }, forwardedRef) => (\n <SelectPrimitive.Separator\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('kui-BaseMenuSeparator', 'kui-SelectSeparator', className)}\n />\n ),\n);\nSelectSeparator.displayName = 'Select.Separator';\n\nexport {\n SelectRoot as Root,\n SelectTrigger as Trigger,\n SelectContent as Content,\n SelectItem as Item,\n SelectGroup as Group,\n SelectLabel as Label,\n SelectSeparator as Separator,\n};\n\nexport type {\n SelectRootProps as RootProps,\n SelectTriggerProps as TriggerProps,\n SelectContentProps as ContentProps,\n SelectItemProps as ItemProps,\n SelectGroupProps as GroupProps,\n SelectLabelProps as LabelProps,\n SelectSeparatorProps as SeparatorProps,\n};\n", "import type React from 'react';\n\nimport { colorPropDef } from '../props/color.prop.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4'] as const;\n\nconst selectRootPropDefs = {\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n};\n\nconst triggerVariants = ['raised', 'surface', 'soft', 'outline', 'ghost'] as const;\n\nconst selectTriggerPropDefs = {\n variant: { type: 'enum', className: 'kui-variant', values: triggerVariants, default: 'raised' },\n error: { type: 'boolean' },\n loading: { type: 'boolean' },\n disabled: { type: 'boolean' },\n readOnly: { type: 'boolean' },\n ...colorPropDef,\n ...radiusPropDef,\n placeholder: { type: 'ReactNode' },\n} satisfies {\n variant: PropDef<(typeof triggerVariants)[number]>;\n error: PropDef<boolean>;\n loading: PropDef<boolean>;\n disabled: PropDef<boolean>;\n readOnly: PropDef<boolean>;\n placeholder: PropDef<React.ReactNode>;\n};\n\n\nconst selectContentPropDefs = {\n ...colorPropDef,\n} satisfies {\n};\n\nexport { selectRootPropDefs, selectTriggerPropDefs, selectContentPropDefs };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["select_exports", "__export", "SelectContent", "SelectGroup", "SelectItem", "SelectLabel", "SelectRoot", "SelectSeparator", "SelectTrigger", "React", "classNames", "SelectPrimitive", "ScrollAreaPrimitive", "sizes", "selectRootPropDefs", "triggerVariants", "selectTriggerPropDefs", "colorPropDef", "radiusPropDef", "selectContentPropDefs", "selectSizePropDefs", "selectRootPropDefs", "OPEN_KEYS", "SelectContext", "SelectRoot", "props", "children", "sizeProp", "openProp", "defaultOpen", "onOpenChange", "rootProps", "size", "useThemeSize", "uncontrolledOpen", "setUncontrolledOpen", "open", "handleOpenChange", "next", "SelectPrimitive", "SelectTrigger", "forwardedRef", "context", "className", "color", "radius", "placeholder", "error", "loading", "disabled", "readOnly", "triggerProps", "extractProps", "selectTriggerPropDefs", "ariaInvalid", "ariaBusy", "ariaDisabled", "ariaReadOnly", "isInvalid", "ariaProps", "blockedHandlers", "event", "isModifierKey", "classNames", "Spinner", "ChevronDownIcon", "SelectContent", "container", "contentProps", "selectContentPropDefs", "themeContext", "useThemeContext", "resolvedColor", "PortalTheme", "SelectScrollArea", "setThumbViewport", "useThumbSync", "ScrollAreaPrimitive", "SelectItem", "itemProps", "isRichContent", "ThickCheckIcon", "SelectGroup", "SelectLabel", "SelectSeparator"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{c as
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{c as y}from"./chunk-OKQAVYW4.js";import{c as v}from"./chunk-5ON3XLRD.js";import{b as R}from"./chunk-XU74PNM2.js";import{a as K}from"./chunk-VQPANPMI.js";var q={};K(q,{Item:()=>x,Root:()=>b});import*as e from"react";import S from"classnames";import{ToggleGroup as I}from"radix-ui";import{useComposedRefs as F,useControllableState as H,useLayoutEffect as j}from"radix-ui/internal";var M=["1","2","3","4"],O=["horizontal","vertical"],u={disabled:{type:"boolean",default:!1},size:{type:"enum",className:"kui-r-size",values:M,default:"2",responsive:!0},orientation:{type:"enum",className:"kui-r-orientation",values:O,default:"horizontal",responsive:!0},...R};var h=e.createContext(null),W=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"]),b=e.forwardRef((n,s)=>{let a=v(n,u.size),{className:l,children:t,radius:i,value:m,defaultValue:p,onValueChange:w,style:D,disabled:c,onKeyDown:N,onPointerDown:k,...T}=y(a,u),[f,d]=H({prop:m,onChange:w,defaultProp:p??""}),r=e.useRef(!1),A=e.useMemo(()=>({selectFromKeyboard(o){r.current&&(r.current=!1,d(o))}}),[d]),g=e.useRef(null),V=F(s,g),C=e.Children.toArray(t).filter(e.isValidElement),z=C.length,G=Math.max(0,C.findIndex(o=>o.props.value===f));return j(()=>{let o=g.current;if(!o)return;let P=Array.from(o.querySelectorAll(":scope > .kui-SegmentedControlItem")),L=P.findIndex(E=>E.getAttribute("data-state")==="on");o.style.setProperty("--segmented-control-count",String(P.length||1)),o.style.setProperty("--segmented-control-index",String(Math.max(0,L)))}),e.createElement(h.Provider,{value:A},e.createElement(I.Root,{"data-disabled":c||void 0,"data-radius":i,ref:V,style:{"--segmented-control-count":z||1,"--segmented-control-index":G,...D},className:S("kui-SegmentedControlRoot",l),onValueChange:o=>{o&&d(o)},onKeyDown:o=>{N?.(o),r.current=W.has(o.key)},onPointerDown:o=>{k?.(o),r.current=!1},...T,type:"single",value:f,asChild:!1,disabled:!!c},t,e.createElement("div",{className:"kui-SegmentedControlIndicator"})))});b.displayName="SegmentedControl.Root";var x=e.forwardRef(({children:n,className:s,iconOnly:a,onFocus:l,...t},i)=>{let m=e.useContext(h);return e.createElement(I.Item,{ref:i,className:S("kui-reset","kui-SegmentedControlItem",s),"data-icon-only":a||void 0,onFocus:p=>{l?.(p),m?.selectFromKeyboard(t.value)},...t,asChild:!1},e.createElement("span",{className:"kui-SegmentedControlItemSeparator"}),e.createElement("span",{className:"kui-SegmentedControlItemLabel"},e.createElement("span",{className:"kui-SegmentedControlItemLabelActive"},n),e.createElement("span",{className:"kui-SegmentedControlItemLabelInactive","aria-hidden":!0},n)))});x.displayName="SegmentedControl.Item";export{b as a,x as b,q as c};
|
|
3
|
+
//# sourceMappingURL=chunk-W4Z6ORYO.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as p}from"./chunk-FATCGZZE.js";import{a as m}from"./chunk-7VJF6EXN.js";import{a as g}from"./chunk-JP36JSNP.js";import{a as l}from"./chunk-TGRHRMQI.js";import{a as D}from"./chunk-4MNRLB57.js";import{c as a}from"./chunk-OKQAVYW4.js";import{a as s}from"./chunk-AQKSO3SW.js";import{c as n}from"./chunk-5ON3XLRD.js";import{a as k}from"./chunk-VQPANPMI.js";var S={};k(S,{Action:()=>R,Cancel:()=>v,Content:()=>C,Description:()=>y,Root:()=>A,Title:()=>d,Trigger:()=>f});import*as e from"react";import O from"classnames";import{AlertDialog as r}from"radix-ui";var c={...p};var A=t=>e.createElement(r.Root,{...t});A.displayName="AlertDialog.Root";var f=e.forwardRef(({children:t,...o},i)=>e.createElement(r.Trigger,{...o,ref:i,asChild:!0},l(t)));f.displayName="AlertDialog.Trigger";var{align:z,...P}=c,B={align:z},C=e.forwardRef(({align:t,...o},i)=>{let T=n(o,P.size),{className:u}=a({align:t},B),{className:h,forceMount:E,container:N,onCloseAutoFocus:x,...w}=a(T,P);return m(),e.createElement(r.Portal,{container:N,forceMount:E},e.createElement(s,{asChild:!0},e.createElement(r.Overlay,{className:"kui-BaseDialogOverlay kui-AlertDialogOverlay"},e.createElement("div",{className:"kui-BaseDialogScroll kui-AlertDialogScroll"},e.createElement("div",{className:`kui-BaseDialogScrollPadding kui-AlertDialogScrollPadding ${u}`},e.createElement(r.Content,{...w,ref:i,className:O("kui-BaseDialogContent","kui-AlertDialogContent",h),"aria-modal":"true",onCloseAutoFocus:W=>{x?.(W),document.body.style.pointerEvents=""}}))))))});C.displayName="AlertDialog.Content";var d=e.forwardRef((t,o)=>e.createElement(r.Title,{asChild:!0},e.createElement(g,{size:"5",trim:"start",...t,asChild:!1,ref:o})));d.displayName="AlertDialog.Title";var y=e.forwardRef((t,o)=>e.createElement(r.Description,{asChild:!0},e.createElement(D,{as:"p",size:"3",...t,asChild:!1,ref:o})));y.displayName="AlertDialog.Description";var R=e.forwardRef(({children:t,...o},i)=>e.createElement(r.Action,{...o,ref:i,asChild:!0},l(t)));R.displayName="AlertDialog.Action";var v=e.forwardRef(({children:t,...o},i)=>e.createElement(r.Cancel,{...o,ref:i,asChild:!0},l(t)));v.displayName="AlertDialog.Cancel";export{A as a,f as b,C as c,d,y as e,R as f,v as g,S as h};
|
|
3
|
+
//# sourceMappingURL=chunk-WAXRIARV.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/alert-dialog.tsx", "../../src/components/alert-dialog.props.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\n\nimport { alertDialogContentPropDefs } from './alert-dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { AlertDialogContentOwnProps } from './alert-dialog.props.js';\nimport type { ComponentPropsWithout, RemovedProps, ComponentPropsAs } from '../helpers/component-props.js';\n\ninterface AlertDialogRootProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Root> {}\nconst AlertDialogRoot: React.FC<AlertDialogRootProps> = (props) => <AlertDialogPrimitive.Root {...props} />;\nAlertDialogRoot.displayName = 'AlertDialog.Root';\n\ntype AlertDialogTriggerElement = React.ElementRef<typeof AlertDialogPrimitive.Trigger>;\ninterface AlertDialogTriggerProps extends ComponentPropsWithout<typeof AlertDialogPrimitive.Trigger, RemovedProps> {}\nconst AlertDialogTrigger = React.forwardRef<AlertDialogTriggerElement, AlertDialogTriggerProps>(({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Trigger>\n));\nAlertDialogTrigger.displayName = 'AlertDialog.Trigger';\n\n// Split 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 on every render.\nconst { align: alignPropDef, ...contentPropDefs } = alertDialogContentPropDefs;\nconst alignPropDefs = { align: alignPropDef };\n\ntype AlertDialogContentElement = React.ElementRef<typeof AlertDialogPrimitive.Content>;\ninterface AlertDialogContentProps extends ComponentPropsWithout<typeof AlertDialogPrimitive.Content, RemovedProps>, AlertDialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Portal>['container'];\n}\nconst AlertDialogContent = React.forwardRef<AlertDialogContentElement, AlertDialogContentProps>(({ align, ...ownProps }, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, contentPropDefs.size);\n const { className: alignClassName } = extractProps({ align }, alignPropDefs);\n\n const { className, forceMount, container, onCloseAutoFocus, ...contentProps } = extractProps(props, contentPropDefs);\n\n // Same stuck pointer-events fallback as Dialog and Sheet.\n useBodyPointerEventsCleanup();\n\n return (\n <AlertDialogPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <AlertDialogPrimitive.Overlay className=\"kui-BaseDialogOverlay kui-AlertDialogOverlay\">\n <div className=\"kui-BaseDialogScroll kui-AlertDialogScroll\">\n <div className={`kui-BaseDialogScrollPadding kui-AlertDialogScrollPadding ${alignClassName}`}>\n <AlertDialogPrimitive.Content\n {...contentProps}\n ref={forwardedRef}\n className={classNames('kui-BaseDialogContent', 'kui-AlertDialogContent', className)}\n aria-modal=\"true\"\n onCloseAutoFocus={(event) => {\n // Radix returns focus to the trigger unless the caller prevents it.\n onCloseAutoFocus?.(event);\n // Restore pointer-events to body (Radix UI fix for issue #1241)\n document.body.style.pointerEvents = '';\n }}\n />\n </div>\n </div>\n </AlertDialogPrimitive.Overlay>\n </PortalTheme>\n </AlertDialogPrimitive.Portal>\n );\n});\nAlertDialogContent.displayName = 'AlertDialog.Content';\n\ntype AlertDialogTitleElement = React.ElementRef<typeof Heading>;\ntype AlertDialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst AlertDialogTitle = React.forwardRef<AlertDialogTitleElement, AlertDialogTitleProps>((props, forwardedRef) => (\n <AlertDialogPrimitive.Title asChild>\n <Heading size=\"5\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Title>\n));\nAlertDialogTitle.displayName = 'AlertDialog.Title';\n\ntype AlertDialogDescriptionElement = HTMLParagraphElement;\ntype AlertDialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst AlertDialogDescription = React.forwardRef<AlertDialogDescriptionElement, AlertDialogDescriptionProps>((props, forwardedRef) => (\n <AlertDialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </AlertDialogPrimitive.Description>\n));\nAlertDialogDescription.displayName = 'AlertDialog.Description';\n\ntype AlertDialogActionElement = React.ElementRef<typeof AlertDialogPrimitive.Action>;\ninterface AlertDialogActionProps extends ComponentPropsWithout<typeof AlertDialogPrimitive.Action, RemovedProps> {}\nconst AlertDialogAction = React.forwardRef<AlertDialogActionElement, AlertDialogActionProps>(({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Action {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Action>\n));\nAlertDialogAction.displayName = 'AlertDialog.Action';\n\ntype AlertDialogCancelElement = React.ElementRef<typeof AlertDialogPrimitive.Cancel>;\ninterface AlertDialogCancelProps extends ComponentPropsWithout<typeof AlertDialogPrimitive.Cancel, RemovedProps> {}\nconst AlertDialogCancel = React.forwardRef<AlertDialogCancelElement, AlertDialogCancelProps>(({ children, ...props }, forwardedRef) => (\n <AlertDialogPrimitive.Cancel {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </AlertDialogPrimitive.Cancel>\n));\nAlertDialogCancel.displayName = 'AlertDialog.Cancel';\n\nexport {\n AlertDialogRoot as Root,\n AlertDialogTrigger as Trigger,\n AlertDialogContent as Content,\n AlertDialogTitle as Title,\n AlertDialogDescription as Description,\n AlertDialogAction as Action,\n AlertDialogCancel as Cancel,\n};\n\nexport type {\n AlertDialogRootProps as RootProps,\n AlertDialogTriggerProps as TriggerProps,\n AlertDialogContentProps as ContentProps,\n AlertDialogTitleProps as TitleProps,\n AlertDialogDescriptionProps as DescriptionProps,\n AlertDialogActionProps as ActionProps,\n AlertDialogCancelProps as CancelProps,\n};\n", "import { dialogContentPropDefs } from './dialog.props.js';\nimport type { PropDef, GetPropDefTypes } from '../props/prop-def.js';\n\nconst alertDialogContentPropDefs = {\n ...dialogContentPropDefs,\n} satisfies {\n align: PropDef<'start' | 'center'>;\n size: PropDef<'1' | '2' | '3' | '4'>;\n width: PropDef<string>;\n minWidth: PropDef<string>;\n maxWidth: PropDef<string>;\n};\n\ntype AlertDialogContentOwnProps = GetPropDefTypes<typeof alertDialogContentPropDefs>;\n\nexport { alertDialogContentPropDefs };\nexport type { AlertDialogContentOwnProps };\n"],
|
|
5
|
+
"mappings": ";wWAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,WAAAC,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,eAAeC,MAA4B,WCCpD,IAAMC,EAA6B,CACjC,GAAGC,CACL,EDYA,IAAMC,EAAmDC,GAAU,gBAACC,EAAqB,KAArB,CAA2B,GAAGD,EAAO,EACzGD,EAAgB,YAAc,mBAI9B,IAAMG,EAA2B,aAA+D,CAAC,CAAE,SAAAC,EAAU,GAAGH,CAAM,EAAGI,IACvH,gBAACH,EAAqB,QAArB,CAA8B,GAAGD,EAAO,IAAKI,EAAc,QAAO,IAChEC,EAAoBF,CAAQ,CAC/B,CACD,EACDD,EAAmB,YAAc,sBAKjC,GAAM,CAAE,MAAOI,EAAc,GAAGC,CAAgB,EAAIC,EAC9CC,EAAgB,CAAE,MAAOH,CAAa,EAMtCI,EAA2B,aAA+D,CAAC,CAAE,MAAAC,EAAO,GAAGC,CAAS,EAAGR,IAAiB,CACxI,IAAMJ,EAAQa,EAAkBD,EAAUL,EAAgB,IAAI,EACxD,CAAE,UAAWO,CAAe,EAAIC,EAAa,CAAE,MAAAJ,CAAM,EAAGF,CAAa,EAErE,CAAE,UAAAO,EAAW,WAAAC,EAAY,UAAAC,EAAW,iBAAAC,EAAkB,GAAGC,CAAa,EAAIL,EAAaf,EAAOO,CAAe,EAGnH,OAAAc,EAA4B,EAG1B,gBAACpB,EAAqB,OAArB,CAA4B,UAAWiB,EAAW,WAAYD,GAC7D,gBAACK,EAAA,CAAY,QAAO,IAClB,gBAACrB,EAAqB,QAArB,CAA6B,UAAU,gDACtC,gBAAC,OAAI,UAAU,8CACb,gBAAC,OAAI,UAAW,4DAA4Da,CAAc,IACxF,gBAACb,EAAqB,QAArB,CACE,GAAGmB,EACJ,IAAKhB,EACL,UAAWmB,EAAW,wBAAyB,yBAA0BP,CAAS,EAClF,aAAW,OACX,iBAAmBQ,GAAU,CAE3BL,IAAmBK,CAAK,EAExB,SAAS,KAAK,MAAM,cAAgB,EACtC,EACF,CACF,CACF,CACF,CACF,CACF,CAEJ,CAAC,EACDd,EAAmB,YAAc,sBAIjC,IAAMe,EAAyB,aAA2D,CAACzB,EAAOI,IAChG,gBAACH,EAAqB,MAArB,CAA2B,QAAO,IACjC,gBAACyB,EAAA,CAAQ,KAAK,IAAI,KAAK,QAAS,GAAG1B,EAAO,QAAS,GAAO,IAAKI,EAAc,CAC/E,CACD,EACDqB,EAAiB,YAAc,oBAI/B,IAAME,EAA+B,aAAuE,CAAC3B,EAAOI,IAClH,gBAACH,EAAqB,YAArB,CAAiC,QAAO,IACvC,gBAAC2B,EAAA,CAAK,GAAG,IAAI,KAAK,IAAK,GAAG5B,EAAO,QAAS,GAAO,IAAKI,EAAc,CACtE,CACD,EACDuB,EAAuB,YAAc,0BAIrC,IAAME,EAA0B,aAA6D,CAAC,CAAE,SAAA1B,EAAU,GAAGH,CAAM,EAAGI,IACpH,gBAACH,EAAqB,OAArB,CAA6B,GAAGD,EAAO,IAAKI,EAAc,QAAO,IAC/DC,EAAoBF,CAAQ,CAC/B,CACD,EACD0B,EAAkB,YAAc,qBAIhC,IAAMC,EAA0B,aAA6D,CAAC,CAAE,SAAA3B,EAAU,GAAGH,CAAM,EAAGI,IACpH,gBAACH,EAAqB,OAArB,CAA6B,GAAGD,EAAO,IAAKI,EAAc,QAAO,IAC/DC,EAAoBF,CAAQ,CAC/B,CACD,EACD2B,EAAkB,YAAc",
|
|
6
|
+
"names": ["alert_dialog_exports", "__export", "AlertDialogAction", "AlertDialogCancel", "AlertDialogContent", "AlertDialogDescription", "AlertDialogRoot", "AlertDialogTitle", "AlertDialogTrigger", "React", "classNames", "AlertDialogPrimitive", "alertDialogContentPropDefs", "dialogContentPropDefs", "AlertDialogRoot", "props", "AlertDialogPrimitive", "AlertDialogTrigger", "children", "forwardedRef", "requireReactElement", "alignPropDef", "contentPropDefs", "alertDialogContentPropDefs", "alignPropDefs", "AlertDialogContent", "align", "ownProps", "useThemeSizeProps", "alignClassName", "extractProps", "className", "forceMount", "container", "onCloseAutoFocus", "contentProps", "useBodyPointerEventsCleanup", "PortalTheme", "classNames", "event", "AlertDialogTitle", "Heading", "AlertDialogDescription", "Text", "AlertDialogAction", "AlertDialogCancel"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as p,b as m,c as a,d as f}from"./chunk-UJ7JERJ5.js";import{
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as p,b as m,c as a,d as f}from"./chunk-UJ7JERJ5.js";import{c as s}from"./chunk-OKQAVYW4.js";import{e as t}from"./chunk-HBWBPBSA.js";import{a as r}from"./chunk-CLJ6SEGP.js";import*as o from"react";import v from"classnames";import{Slot as h}from"radix-ui";var y=["1","2","3","4","5","6","7","8","9"],D=["solid","soft","outline","ghost"],i={...r,size:{type:"enum",className:"kui-r-size",values:y,responsive:!0},variant:{type:"enum",className:"kui-variant",values:D,default:"soft"},...f,...t,...p,...a,...m};var R=o.forwardRef((e,n)=>{let{asChild:c,className:d,color:P,...l}=s(e,i),u=e.variant==="ghost"&&!e.color?void 0:P,C=c?h.Root:"code";return o.createElement(C,{"data-accent-color":u,...l,ref:n,className:v("kui-reset","kui-Code",d)})});R.displayName="Code";export{R as a};
|
|
3
|
+
//# sourceMappingURL=chunk-WD66RYF6.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as d}from"./chunk-OAJ5DARR.js";import{
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as d}from"./chunk-OAJ5DARR.js";import{a as u}from"./chunk-MGWGD6KI.js";import{a as f}from"./chunk-L54FWKJE.js";import{a as b,c as r}from"./chunk-OKQAVYW4.js";import{c}from"./chunk-5ON3XLRD.js";import{a as g}from"./chunk-VQPANPMI.js";var G={};g(G,{Body:()=>y,Cell:()=>w,ColumnHeaderCell:()=>v,Header:()=>T,Root:()=>R,Row:()=>C,RowHeaderCell:()=>H});import*as e from"react";import t from"classnames";var O=["1","2","3","4"],W=["surface","ghost"],j=["auto","fixed"],p={size:{type:"enum",className:"kui-r-size",values:O,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:W,default:"ghost"},layout:{type:"enum",className:"kui-r-tl",values:j,responsive:!0}},z=["start","center","end","baseline"],P={align:{type:"enum",className:"kui-r-va",values:z,parseValue:V,responsive:!0}};function V(a){return{baseline:"baseline",start:"top",center:"middle",end:"bottom"}[a]}var A=["start","center","end"],n={justify:{type:"enum",className:"kui-r-ta",values:A,responsive:!0},...f,...d};var R=e.forwardRef((a,o)=>{let l=c(a,p.size),{layout:s,...N}=p,{className:h,children:D,layout:E,"aria-label":m,"aria-labelledby":i,"aria-describedby":k,...x}=r(l,N),B=b({value:E,className:p.layout.className,propValues:p.layout.values});return e.createElement("div",{ref:o,className:t("kui-TableRoot",h),...x},e.createElement(u,{"aria-label":m,"aria-labelledby":i},e.createElement("table",{className:t("kui-TableRootTable",B),"aria-label":m,"aria-labelledby":i,"aria-describedby":k},D)))});R.displayName="Table.Root";var T=e.forwardRef(({className:a,...o},l)=>e.createElement("thead",{...o,ref:l,className:t("kui-TableHeader",a)}));T.displayName="Table.Header";var y=e.forwardRef(({className:a,...o},l)=>e.createElement("tbody",{...o,ref:l,className:t("kui-TableBody",a)}));y.displayName="Table.Body";var C=e.forwardRef((a,o)=>{let{className:l,...s}=r(a,P);return e.createElement("tr",{...s,ref:o,className:t("kui-TableRow",l)})});C.displayName="Table.Row";var w=e.forwardRef((a,o)=>{let{className:l,...s}=r(a,n);return e.createElement("td",{className:t("kui-TableCell",l),ref:o,...s})});w.displayName="Table.Cell";var v=e.forwardRef((a,o)=>{let{className:l,...s}=r(a,n);return e.createElement("th",{className:t("kui-TableCell","kui-TableColumnHeaderCell",l),scope:"col",ref:o,...s})});v.displayName="Table.ColumnHeaderCell";var H=e.forwardRef((a,o)=>{let{className:l,...s}=r(a,n);return e.createElement("th",{className:t("kui-TableCell","kui-TableRowHeaderCell",l),scope:"row",ref:o,...s})});H.displayName="Table.RowHeaderCell";export{R as a,T as b,y as c,C as d,w as e,v as f,H as g,G as h};
|
|
3
|
+
//# sourceMappingURL=chunk-X7JHZ3HA.js.map
|