@psnext/design-system 1.0.0 → 1.2.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/README.md +103 -90
- package/dist/Header.cjs +890 -0
- package/dist/Header.cjs.map +1 -0
- package/dist/Header.js +798 -0
- package/dist/Header.js.map +1 -0
- package/dist/Icon.cjs +1969 -0
- package/dist/Icon.cjs.map +1 -0
- package/dist/Icon.js +1956 -0
- package/dist/Icon.js.map +1 -0
- package/dist/Logo.cjs +813 -0
- package/dist/Logo.cjs.map +1 -0
- package/dist/Logo.js +808 -0
- package/dist/Logo.js.map +1 -0
- package/dist/Sidebar.cjs +562 -0
- package/dist/Sidebar.cjs.map +1 -0
- package/dist/Sidebar.js +416 -0
- package/dist/Sidebar.js.map +1 -0
- package/dist/chunk.cjs +28 -0
- package/dist/cn.cjs +15 -0
- package/dist/cn.cjs.map +1 -0
- package/dist/cn.js +10 -0
- package/dist/cn.js.map +1 -0
- package/dist/contexts/index.cjs +0 -60
- package/dist/contexts/index.d.cts +1 -23
- package/dist/contexts/index.d.ts +1 -23
- package/dist/contexts/index.js +1 -58
- package/dist/index.cjs +414 -272
- package/dist/index.d.cts +17 -1424
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +17 -1424
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +72 -7
- package/dist/index10.d.cts +38 -0
- package/dist/index10.d.cts.map +1 -0
- package/dist/index10.d.ts +38 -0
- package/dist/index10.d.ts.map +1 -0
- package/dist/index11.d.cts +30 -0
- package/dist/index11.d.cts.map +1 -0
- package/dist/index11.d.ts +30 -0
- package/dist/index11.d.ts.map +1 -0
- package/dist/index12.d.cts +75 -0
- package/dist/index12.d.cts.map +1 -0
- package/dist/index12.d.ts +75 -0
- package/dist/index12.d.ts.map +1 -0
- package/dist/index13.d.cts +57 -0
- package/dist/index13.d.cts.map +1 -0
- package/dist/index13.d.ts +57 -0
- package/dist/index13.d.ts.map +1 -0
- package/dist/index14.d.cts +98 -0
- package/dist/index14.d.cts.map +1 -0
- package/dist/index14.d.ts +98 -0
- package/dist/index14.d.ts.map +1 -0
- package/dist/index15.d.cts +29 -0
- package/dist/index15.d.cts.map +1 -0
- package/dist/index15.d.ts +29 -0
- package/dist/index15.d.ts.map +1 -0
- package/dist/index16.d.cts +38 -0
- package/dist/index16.d.cts.map +1 -0
- package/dist/index16.d.ts +38 -0
- package/dist/index16.d.ts.map +1 -0
- package/dist/index17.d.cts +19 -0
- package/dist/index17.d.cts.map +1 -0
- package/dist/index17.d.ts +19 -0
- package/dist/index17.d.ts.map +1 -0
- package/dist/index18.d.cts +73 -0
- package/dist/index18.d.cts.map +1 -0
- package/dist/index18.d.ts +73 -0
- package/dist/index18.d.ts.map +1 -0
- package/dist/index19.d.cts +66 -0
- package/dist/index19.d.cts.map +1 -0
- package/dist/index19.d.ts +66 -0
- package/dist/index19.d.ts.map +1 -0
- package/dist/index2.d.cts +41 -13
- package/dist/index2.d.cts.map +1 -1
- package/dist/index2.d.ts +41 -13
- package/dist/index2.d.ts.map +1 -1
- package/dist/index20.d.cts +96 -0
- package/dist/index20.d.cts.map +1 -0
- package/dist/index20.d.ts +96 -0
- package/dist/index20.d.ts.map +1 -0
- package/dist/index21.d.cts +34 -0
- package/dist/index21.d.cts.map +1 -0
- package/dist/index21.d.ts +34 -0
- package/dist/index21.d.ts.map +1 -0
- package/dist/index22.d.cts +62 -0
- package/dist/index22.d.cts.map +1 -0
- package/dist/index22.d.ts +62 -0
- package/dist/index22.d.ts.map +1 -0
- package/dist/index23.d.cts +99 -0
- package/dist/index23.d.cts.map +1 -0
- package/dist/index23.d.ts +99 -0
- package/dist/index23.d.ts.map +1 -0
- package/dist/index24.d.cts +49 -0
- package/dist/index24.d.cts.map +1 -0
- package/dist/index24.d.ts +49 -0
- package/dist/index24.d.ts.map +1 -0
- package/dist/index25.d.cts +17 -0
- package/dist/index25.d.cts.map +1 -0
- package/dist/index25.d.ts +17 -0
- package/dist/index25.d.ts.map +1 -0
- package/dist/index26.d.cts +80 -0
- package/dist/index26.d.cts.map +1 -0
- package/dist/index26.d.ts +80 -0
- package/dist/index26.d.ts.map +1 -0
- package/dist/index27.d.cts +71 -0
- package/dist/index27.d.cts.map +1 -0
- package/dist/index27.d.ts +71 -0
- package/dist/index27.d.ts.map +1 -0
- package/dist/index28.d.cts +37 -0
- package/dist/index28.d.cts.map +1 -0
- package/dist/index28.d.ts +37 -0
- package/dist/index28.d.ts.map +1 -0
- package/dist/index29.d.cts +25 -0
- package/dist/index29.d.cts.map +1 -0
- package/dist/index29.d.ts +25 -0
- package/dist/index29.d.ts.map +1 -0
- package/dist/index3.d.cts +62 -0
- package/dist/index3.d.cts.map +1 -0
- package/dist/index3.d.ts +62 -0
- package/dist/index3.d.ts.map +1 -0
- package/dist/index30.d.cts +59 -0
- package/dist/index30.d.cts.map +1 -0
- package/dist/index30.d.ts +59 -0
- package/dist/index30.d.ts.map +1 -0
- package/dist/index31.d.cts +40 -0
- package/dist/index31.d.cts.map +1 -0
- package/dist/index31.d.ts +40 -0
- package/dist/index31.d.ts.map +1 -0
- package/dist/index32.d.cts +23 -0
- package/dist/index32.d.cts.map +1 -0
- package/dist/index32.d.ts +23 -0
- package/dist/index32.d.ts.map +1 -0
- package/dist/index33.d.cts +55 -0
- package/dist/index33.d.cts.map +1 -0
- package/dist/index33.d.ts +55 -0
- package/dist/index33.d.ts.map +1 -0
- package/dist/index34.d.cts +43 -0
- package/dist/index34.d.cts.map +1 -0
- package/dist/index34.d.ts +43 -0
- package/dist/index34.d.ts.map +1 -0
- package/dist/index35.d.cts +77 -0
- package/dist/index35.d.cts.map +1 -0
- package/dist/index35.d.ts +77 -0
- package/dist/index35.d.ts.map +1 -0
- package/dist/index36.d.cts +19 -0
- package/dist/index36.d.cts.map +1 -0
- package/dist/index36.d.ts +19 -0
- package/dist/index36.d.ts.map +1 -0
- package/dist/index37.d.cts +29 -0
- package/dist/index37.d.cts.map +1 -0
- package/dist/index37.d.ts +29 -0
- package/dist/index37.d.ts.map +1 -0
- package/dist/index38.d.cts +20 -0
- package/dist/index38.d.cts.map +1 -0
- package/dist/index38.d.ts +20 -0
- package/dist/index38.d.ts.map +1 -0
- package/dist/index39.d.cts +105 -0
- package/dist/index39.d.cts.map +1 -0
- package/dist/index39.d.ts +105 -0
- package/dist/index39.d.ts.map +1 -0
- package/dist/index4.d.cts +11 -0
- package/dist/index4.d.cts.map +1 -0
- package/dist/index4.d.ts +11 -0
- package/dist/index4.d.ts.map +1 -0
- package/dist/index40.d.cts +22 -0
- package/dist/index40.d.cts.map +1 -0
- package/dist/index40.d.ts +22 -0
- package/dist/index40.d.ts.map +1 -0
- package/dist/index41.d.cts +56 -0
- package/dist/index41.d.cts.map +1 -0
- package/dist/index41.d.ts +56 -0
- package/dist/index41.d.ts.map +1 -0
- package/dist/index42.d.cts +45 -0
- package/dist/index42.d.cts.map +1 -0
- package/dist/index42.d.ts +45 -0
- package/dist/index42.d.ts.map +1 -0
- package/dist/index43.d.cts +96 -0
- package/dist/index43.d.cts.map +1 -0
- package/dist/index43.d.ts +96 -0
- package/dist/index43.d.ts.map +1 -0
- package/dist/index44.d.cts +48 -0
- package/dist/index44.d.cts.map +1 -0
- package/dist/index44.d.ts +48 -0
- package/dist/index44.d.ts.map +1 -0
- package/dist/index45.d.cts +28 -0
- package/dist/index45.d.cts.map +1 -0
- package/dist/index45.d.ts +28 -0
- package/dist/index45.d.ts.map +1 -0
- package/dist/index46.d.cts +41 -0
- package/dist/index46.d.cts.map +1 -0
- package/dist/index46.d.ts +41 -0
- package/dist/index46.d.ts.map +1 -0
- package/dist/index47.d.cts +25 -0
- package/dist/index47.d.cts.map +1 -0
- package/dist/index47.d.ts +25 -0
- package/dist/index47.d.ts.map +1 -0
- package/dist/index48.d.cts +21 -0
- package/dist/index48.d.cts.map +1 -0
- package/dist/index48.d.ts +21 -0
- package/dist/index48.d.ts.map +1 -0
- package/dist/index49.d.cts +69 -0
- package/dist/index49.d.cts.map +1 -0
- package/dist/index49.d.ts +69 -0
- package/dist/index49.d.ts.map +1 -0
- package/dist/index5.d.cts +45 -0
- package/dist/index5.d.cts.map +1 -0
- package/dist/index5.d.ts +45 -0
- package/dist/index5.d.ts.map +1 -0
- package/dist/index50.d.cts +63 -0
- package/dist/index50.d.cts.map +1 -0
- package/dist/index50.d.ts +63 -0
- package/dist/index50.d.ts.map +1 -0
- package/dist/index51.d.cts +31 -0
- package/dist/index51.d.cts.map +1 -0
- package/dist/index51.d.ts +31 -0
- package/dist/index51.d.ts.map +1 -0
- package/dist/index52.d.cts +209 -0
- package/dist/index52.d.cts.map +1 -0
- package/dist/index52.d.ts +209 -0
- package/dist/index52.d.ts.map +1 -0
- package/dist/index53.d.cts +26 -0
- package/dist/index53.d.cts.map +1 -0
- package/dist/index53.d.ts +26 -0
- package/dist/index53.d.ts.map +1 -0
- package/dist/index54.d.cts +28 -0
- package/dist/index54.d.cts.map +1 -0
- package/dist/index54.d.ts +28 -0
- package/dist/index54.d.ts.map +1 -0
- package/dist/index55.d.cts +25 -0
- package/dist/index55.d.cts.map +1 -0
- package/dist/index55.d.ts +25 -0
- package/dist/index55.d.ts.map +1 -0
- package/dist/index56.d.cts +12 -0
- package/dist/index56.d.cts.map +1 -0
- package/dist/index56.d.ts +12 -0
- package/dist/index56.d.ts.map +1 -0
- package/dist/index57.d.cts +50 -0
- package/dist/index57.d.cts.map +1 -0
- package/dist/index57.d.ts +50 -0
- package/dist/index57.d.ts.map +1 -0
- package/dist/index58.d.cts +51 -0
- package/dist/index58.d.cts.map +1 -0
- package/dist/index58.d.ts +51 -0
- package/dist/index58.d.ts.map +1 -0
- package/dist/index59.d.cts +58 -0
- package/dist/index59.d.cts.map +1 -0
- package/dist/index59.d.ts +58 -0
- package/dist/index59.d.ts.map +1 -0
- package/dist/index6.d.cts +26 -0
- package/dist/index6.d.cts.map +1 -0
- package/dist/index6.d.ts +26 -0
- package/dist/index6.d.ts.map +1 -0
- package/dist/index60.d.cts +45 -0
- package/dist/index60.d.cts.map +1 -0
- package/dist/index60.d.ts +45 -0
- package/dist/index60.d.ts.map +1 -0
- package/dist/index61.d.cts +21 -0
- package/dist/index61.d.cts.map +1 -0
- package/dist/index61.d.ts +21 -0
- package/dist/index61.d.ts.map +1 -0
- package/dist/index62.d.cts +45 -0
- package/dist/index62.d.cts.map +1 -0
- package/dist/index62.d.ts +45 -0
- package/dist/index62.d.ts.map +1 -0
- package/dist/index63.d.cts +23 -0
- package/dist/index63.d.cts.map +1 -0
- package/dist/index63.d.ts +23 -0
- package/dist/index63.d.ts.map +1 -0
- package/dist/index64.d.cts +48 -0
- package/dist/index64.d.cts.map +1 -0
- package/dist/index64.d.ts +48 -0
- package/dist/index64.d.ts.map +1 -0
- package/dist/index65.d.cts +25 -0
- package/dist/index65.d.cts.map +1 -0
- package/dist/index65.d.ts +25 -0
- package/dist/index65.d.ts.map +1 -0
- package/dist/index66.d.cts +19 -0
- package/dist/index66.d.cts.map +1 -0
- package/dist/index66.d.ts +19 -0
- package/dist/index66.d.ts.map +1 -0
- package/dist/index67.d.cts +37 -0
- package/dist/index67.d.cts.map +1 -0
- package/dist/index67.d.ts +37 -0
- package/dist/index67.d.ts.map +1 -0
- package/dist/index68.d.cts +36 -0
- package/dist/index68.d.cts.map +1 -0
- package/dist/index68.d.ts +36 -0
- package/dist/index68.d.ts.map +1 -0
- package/dist/index69.d.cts +69 -0
- package/dist/index69.d.ts +69 -0
- package/dist/index7.d.cts +46 -0
- package/dist/index7.d.cts.map +1 -0
- package/dist/index7.d.ts +46 -0
- package/dist/index7.d.ts.map +1 -0
- package/dist/index70.d.cts +242 -0
- package/dist/index70.d.cts.map +1 -0
- package/dist/index70.d.ts +242 -0
- package/dist/index70.d.ts.map +1 -0
- package/dist/index8.d.cts +26 -0
- package/dist/index8.d.cts.map +1 -0
- package/dist/index8.d.ts +26 -0
- package/dist/index8.d.ts.map +1 -0
- package/dist/index9.d.cts +20 -0
- package/dist/index9.d.cts.map +1 -0
- package/dist/index9.d.ts +20 -0
- package/dist/index9.d.ts.map +1 -0
- package/dist/layouts/Container/index.cjs +39 -0
- package/dist/layouts/Container/index.cjs.map +1 -0
- package/dist/layouts/Container/index.d.cts +2 -0
- package/dist/layouts/Container/index.d.ts +2 -0
- package/dist/layouts/Container/index.js +38 -0
- package/dist/layouts/Container/index.js.map +1 -0
- package/dist/layouts/PageBackground/index.cjs +22 -0
- package/dist/layouts/PageBackground/index.cjs.map +1 -0
- package/dist/layouts/PageBackground/index.d.cts +2 -0
- package/dist/layouts/PageBackground/index.d.ts +2 -0
- package/dist/layouts/PageBackground/index.js +21 -0
- package/dist/layouts/PageBackground/index.js.map +1 -0
- package/dist/layouts/Stack/index.cjs +56 -0
- package/dist/layouts/Stack/index.cjs.map +1 -0
- package/dist/layouts/Stack/index.d.cts +2 -0
- package/dist/layouts/Stack/index.d.ts +2 -0
- package/dist/layouts/Stack/index.js +55 -0
- package/dist/layouts/Stack/index.js.map +1 -0
- package/dist/layouts/TwoColumn/index.cjs +51 -0
- package/dist/layouts/TwoColumn/index.cjs.map +1 -0
- package/dist/layouts/TwoColumn/index.d.cts +2 -0
- package/dist/layouts/TwoColumn/index.d.ts +2 -0
- package/dist/layouts/TwoColumn/index.js +48 -0
- package/dist/layouts/TwoColumn/index.js.map +1 -0
- package/dist/layouts/index.cjs +13 -12
- package/dist/layouts/index.d.cts +5 -133
- package/dist/layouts/index.d.ts +5 -133
- package/dist/layouts/index.js +5 -2
- package/dist/patterns/DataTable/index.cjs +114 -0
- package/dist/patterns/DataTable/index.cjs.map +1 -0
- package/dist/patterns/DataTable/index.d.cts +43 -0
- package/dist/patterns/DataTable/index.d.cts.map +1 -0
- package/dist/patterns/DataTable/index.d.ts +43 -0
- package/dist/patterns/DataTable/index.d.ts.map +1 -0
- package/dist/patterns/DataTable/index.js +110 -0
- package/dist/patterns/DataTable/index.js.map +1 -0
- package/dist/patterns/Footer/index.cjs +76 -0
- package/dist/patterns/Footer/index.cjs.map +1 -0
- package/dist/patterns/Footer/index.d.cts +54 -0
- package/dist/patterns/Footer/index.d.cts.map +1 -0
- package/dist/patterns/Footer/index.d.ts +54 -0
- package/dist/patterns/Footer/index.d.ts.map +1 -0
- package/dist/patterns/Footer/index.js +70 -0
- package/dist/patterns/Footer/index.js.map +1 -0
- package/dist/patterns/Header/index.cjs +17 -0
- package/dist/patterns/Header/index.d.cts +2 -0
- package/dist/patterns/Header/index.d.ts +2 -0
- package/dist/patterns/Header/index.js +2 -0
- package/dist/patterns/MediaObject/index.cjs +108 -0
- package/dist/patterns/MediaObject/index.cjs.map +1 -0
- package/dist/patterns/MediaObject/index.d.cts +71 -0
- package/dist/patterns/MediaObject/index.d.cts.map +1 -0
- package/dist/patterns/MediaObject/index.d.ts +71 -0
- package/dist/patterns/MediaObject/index.d.ts.map +1 -0
- package/dist/patterns/MediaObject/index.js +99 -0
- package/dist/patterns/MediaObject/index.js.map +1 -0
- package/dist/patterns/SectionCard/index.cjs +35 -0
- package/dist/patterns/SectionCard/index.cjs.map +1 -0
- package/dist/patterns/SectionCard/index.d.cts +21 -0
- package/dist/patterns/SectionCard/index.d.cts.map +1 -0
- package/dist/patterns/SectionCard/index.d.ts +21 -0
- package/dist/patterns/SectionCard/index.d.ts.map +1 -0
- package/dist/patterns/SectionCard/index.js +34 -0
- package/dist/patterns/SectionCard/index.js.map +1 -0
- package/dist/patterns/SectionHeading/index.cjs +44 -0
- package/dist/patterns/SectionHeading/index.cjs.map +1 -0
- package/dist/patterns/SectionHeading/index.d.cts +37 -0
- package/dist/patterns/SectionHeading/index.d.cts.map +1 -0
- package/dist/patterns/SectionHeading/index.d.ts +37 -0
- package/dist/patterns/SectionHeading/index.d.ts.map +1 -0
- package/dist/patterns/SectionHeading/index.js +43 -0
- package/dist/patterns/SectionHeading/index.js.map +1 -0
- package/dist/patterns/index.cjs +40 -7374
- package/dist/patterns/index.d.cts +7 -418
- package/dist/patterns/index.d.ts +7 -418
- package/dist/patterns/index.js +7 -7344
- package/dist/primitives/Accordion/index.cjs +54 -0
- package/dist/primitives/Accordion/index.cjs.map +1 -0
- package/dist/primitives/Accordion/index.d.cts +2 -0
- package/dist/primitives/Accordion/index.d.ts +2 -0
- package/dist/primitives/Accordion/index.js +50 -0
- package/dist/primitives/Accordion/index.js.map +1 -0
- package/dist/primitives/Alert/index.cjs +61 -0
- package/dist/primitives/Alert/index.cjs.map +1 -0
- package/dist/primitives/Alert/index.d.cts +2 -0
- package/dist/primitives/Alert/index.d.ts +2 -0
- package/dist/primitives/Alert/index.js +57 -0
- package/dist/primitives/Alert/index.js.map +1 -0
- package/dist/primitives/AlertDialog/index.cjs +102 -0
- package/dist/primitives/AlertDialog/index.cjs.map +1 -0
- package/dist/primitives/AlertDialog/index.d.cts +2 -0
- package/dist/primitives/AlertDialog/index.d.ts +2 -0
- package/dist/primitives/AlertDialog/index.js +90 -0
- package/dist/primitives/AlertDialog/index.js.map +1 -0
- package/dist/primitives/AspectRatio/index.cjs +15 -0
- package/dist/primitives/AspectRatio/index.cjs.map +1 -0
- package/dist/primitives/AspectRatio/index.d.cts +2 -0
- package/dist/primitives/AspectRatio/index.d.ts +2 -0
- package/dist/primitives/AspectRatio/index.js +14 -0
- package/dist/primitives/AspectRatio/index.js.map +1 -0
- package/dist/primitives/Avatar/index.cjs +64 -0
- package/dist/primitives/Avatar/index.cjs.map +1 -0
- package/dist/primitives/Avatar/index.d.cts +2 -0
- package/dist/primitives/Avatar/index.d.ts +2 -0
- package/dist/primitives/Avatar/index.js +58 -0
- package/dist/primitives/Avatar/index.js.map +1 -0
- package/dist/primitives/Badge/index.cjs +44 -0
- package/dist/primitives/Badge/index.cjs.map +1 -0
- package/dist/primitives/Badge/index.d.cts +2 -0
- package/dist/primitives/Badge/index.d.ts +2 -0
- package/dist/primitives/Badge/index.js +43 -0
- package/dist/primitives/Badge/index.js.map +1 -0
- package/dist/primitives/Breadcrumb/index.cjs +82 -0
- package/dist/primitives/Breadcrumb/index.cjs.map +1 -0
- package/dist/primitives/Breadcrumb/index.d.cts +2 -0
- package/dist/primitives/Breadcrumb/index.d.ts +2 -0
- package/dist/primitives/Breadcrumb/index.js +75 -0
- package/dist/primitives/Breadcrumb/index.js.map +1 -0
- package/dist/primitives/Button/index.cjs +61 -0
- package/dist/primitives/Button/index.cjs.map +1 -0
- package/dist/primitives/Button/index.d.cts +2 -0
- package/dist/primitives/Button/index.d.ts +2 -0
- package/dist/primitives/Button/index.js +60 -0
- package/dist/primitives/Button/index.js.map +1 -0
- package/dist/primitives/ButtonGroup/index.cjs +46 -0
- package/dist/primitives/ButtonGroup/index.cjs.map +1 -0
- package/dist/primitives/ButtonGroup/index.d.cts +2 -0
- package/dist/primitives/ButtonGroup/index.d.ts +2 -0
- package/dist/primitives/ButtonGroup/index.js +43 -0
- package/dist/primitives/ButtonGroup/index.js.map +1 -0
- package/dist/primitives/Calendar/index.cjs +112 -0
- package/dist/primitives/Calendar/index.cjs.map +1 -0
- package/dist/primitives/Calendar/index.d.cts +2 -0
- package/dist/primitives/Calendar/index.d.ts +2 -0
- package/dist/primitives/Calendar/index.js +108 -0
- package/dist/primitives/Calendar/index.js.map +1 -0
- package/dist/primitives/Card/index.cjs +128 -0
- package/dist/primitives/Card/index.cjs.map +1 -0
- package/dist/primitives/Card/index.d.cts +2 -0
- package/dist/primitives/Card/index.d.ts +2 -0
- package/dist/primitives/Card/index.js +121 -0
- package/dist/primitives/Card/index.js.map +1 -0
- package/dist/primitives/Carousel/index.cjs +146 -0
- package/dist/primitives/Carousel/index.cjs.map +1 -0
- package/dist/primitives/Carousel/index.d.cts +2 -0
- package/dist/primitives/Carousel/index.d.ts +2 -0
- package/dist/primitives/Carousel/index.js +138 -0
- package/dist/primitives/Carousel/index.js.map +1 -0
- package/dist/primitives/Chart/index.cjs +162 -0
- package/dist/primitives/Chart/index.cjs.map +1 -0
- package/dist/primitives/Chart/index.d.cts +2 -0
- package/dist/primitives/Chart/index.d.ts +2 -0
- package/dist/primitives/Chart/index.js +153 -0
- package/dist/primitives/Chart/index.js.map +1 -0
- package/dist/primitives/Checkbox/index.cjs +53 -0
- package/dist/primitives/Checkbox/index.cjs.map +1 -0
- package/dist/primitives/Checkbox/index.d.cts +2 -0
- package/dist/primitives/Checkbox/index.d.ts +2 -0
- package/dist/primitives/Checkbox/index.js +51 -0
- package/dist/primitives/Checkbox/index.js.map +1 -0
- package/dist/primitives/CheckboxTree/index.cjs +106 -0
- package/dist/primitives/CheckboxTree/index.cjs.map +1 -0
- package/dist/primitives/CheckboxTree/index.d.cts +2 -0
- package/dist/primitives/CheckboxTree/index.d.ts +2 -0
- package/dist/primitives/CheckboxTree/index.js +103 -0
- package/dist/primitives/CheckboxTree/index.js.map +1 -0
- package/dist/primitives/Collapsible/index.cjs +31 -0
- package/dist/primitives/Collapsible/index.cjs.map +1 -0
- package/dist/primitives/Collapsible/index.d.cts +2 -0
- package/dist/primitives/Collapsible/index.d.ts +2 -0
- package/dist/primitives/Collapsible/index.js +28 -0
- package/dist/primitives/Collapsible/index.js.map +1 -0
- package/dist/primitives/Command/index.cjs +104 -0
- package/dist/primitives/Command/index.cjs.map +1 -0
- package/dist/primitives/Command/index.d.cts +2 -0
- package/dist/primitives/Command/index.d.ts +2 -0
- package/dist/primitives/Command/index.js +95 -0
- package/dist/primitives/Command/index.js.map +1 -0
- package/dist/primitives/ContextMenu/index.cjs +152 -0
- package/dist/primitives/ContextMenu/index.cjs.map +1 -0
- package/dist/primitives/ContextMenu/index.d.cts +2 -0
- package/dist/primitives/ContextMenu/index.d.ts +2 -0
- package/dist/primitives/ContextMenu/index.js +137 -0
- package/dist/primitives/ContextMenu/index.js.map +1 -0
- package/dist/primitives/Credits/index.cjs +39 -0
- package/dist/primitives/Credits/index.cjs.map +1 -0
- package/dist/primitives/Credits/index.d.cts +2 -0
- package/dist/primitives/Credits/index.d.ts +2 -0
- package/dist/primitives/Credits/index.js +38 -0
- package/dist/primitives/Credits/index.js.map +1 -0
- package/dist/primitives/Dialog/index.cjs +121 -0
- package/dist/primitives/Dialog/index.cjs.map +1 -0
- package/dist/primitives/Dialog/index.d.cts +2 -0
- package/dist/primitives/Dialog/index.d.ts +2 -0
- package/dist/primitives/Dialog/index.js +111 -0
- package/dist/primitives/Dialog/index.js.map +1 -0
- package/dist/primitives/Drawer/index.cjs +98 -0
- package/dist/primitives/Drawer/index.cjs.map +1 -0
- package/dist/primitives/Drawer/index.d.cts +2 -0
- package/dist/primitives/Drawer/index.d.ts +2 -0
- package/dist/primitives/Drawer/index.js +88 -0
- package/dist/primitives/Drawer/index.js.map +1 -0
- package/dist/primitives/DropdownMenu/index.cjs +153 -0
- package/dist/primitives/DropdownMenu/index.cjs.map +1 -0
- package/dist/primitives/DropdownMenu/index.d.cts +2 -0
- package/dist/primitives/DropdownMenu/index.d.ts +2 -0
- package/dist/primitives/DropdownMenu/index.js +138 -0
- package/dist/primitives/DropdownMenu/index.js.map +1 -0
- package/dist/primitives/Empty/index.cjs +84 -0
- package/dist/primitives/Empty/index.cjs.map +1 -0
- package/dist/primitives/Empty/index.d.cts +2 -0
- package/dist/primitives/Empty/index.d.ts +2 -0
- package/dist/primitives/Empty/index.js +77 -0
- package/dist/primitives/Empty/index.js.map +1 -0
- package/dist/primitives/Field/index.cjs +139 -0
- package/dist/primitives/Field/index.cjs.map +1 -0
- package/dist/primitives/Field/index.d.cts +2 -0
- package/dist/primitives/Field/index.d.ts +2 -0
- package/dist/primitives/Field/index.js +129 -0
- package/dist/primitives/Field/index.js.map +1 -0
- package/dist/primitives/Form/index.cjs +104 -0
- package/dist/primitives/Form/index.cjs.map +1 -0
- package/dist/primitives/Form/index.d.cts +2 -0
- package/dist/primitives/Form/index.d.ts +2 -0
- package/dist/primitives/Form/index.js +94 -0
- package/dist/primitives/Form/index.js.map +1 -0
- package/dist/primitives/Heading/index.cjs +53 -0
- package/dist/primitives/Heading/index.cjs.map +1 -0
- package/dist/primitives/Heading/index.d.cts +2 -0
- package/dist/primitives/Heading/index.d.ts +2 -0
- package/dist/primitives/Heading/index.js +52 -0
- package/dist/primitives/Heading/index.js.map +1 -0
- package/dist/primitives/HoverCard/index.cjs +38 -0
- package/dist/primitives/HoverCard/index.cjs.map +1 -0
- package/dist/primitives/HoverCard/index.d.cts +2 -0
- package/dist/primitives/HoverCard/index.d.ts +2 -0
- package/dist/primitives/HoverCard/index.js +35 -0
- package/dist/primitives/HoverCard/index.js.map +1 -0
- package/dist/primitives/Icon/index.cjs +4 -0
- package/dist/primitives/Icon/index.d.cts +2 -0
- package/dist/primitives/Icon/index.d.ts +2 -0
- package/dist/primitives/Icon/index.js +2 -0
- package/dist/primitives/InfoBanner/index.cjs +79 -0
- package/dist/primitives/InfoBanner/index.cjs.map +1 -0
- package/dist/primitives/InfoBanner/index.d.cts +2 -0
- package/dist/primitives/InfoBanner/index.d.ts +2 -0
- package/dist/primitives/InfoBanner/index.js +78 -0
- package/dist/primitives/InfoBanner/index.js.map +1 -0
- package/dist/primitives/Input/index.cjs +39 -0
- package/dist/primitives/Input/index.cjs.map +1 -0
- package/dist/primitives/Input/index.d.cts +2 -0
- package/dist/primitives/Input/index.d.ts +2 -0
- package/dist/primitives/Input/index.js +38 -0
- package/dist/primitives/Input/index.js.map +1 -0
- package/dist/primitives/InputGroup/index.cjs +91 -0
- package/dist/primitives/InputGroup/index.cjs.map +1 -0
- package/dist/primitives/InputGroup/index.d.cts +2 -0
- package/dist/primitives/InputGroup/index.d.ts +2 -0
- package/dist/primitives/InputGroup/index.js +85 -0
- package/dist/primitives/InputGroup/index.js.map +1 -0
- package/dist/primitives/InputOtp/index.cjs +80 -0
- package/dist/primitives/InputOtp/index.cjs.map +1 -0
- package/dist/primitives/InputOtp/index.d.cts +2 -0
- package/dist/primitives/InputOtp/index.d.ts +2 -0
- package/dist/primitives/InputOtp/index.js +74 -0
- package/dist/primitives/InputOtp/index.js.map +1 -0
- package/dist/primitives/Item/index.cjs +137 -0
- package/dist/primitives/Item/index.cjs.map +1 -0
- package/dist/primitives/Item/index.d.cts +2 -0
- package/dist/primitives/Item/index.d.ts +2 -0
- package/dist/primitives/Item/index.js +127 -0
- package/dist/primitives/Item/index.js.map +1 -0
- package/dist/primitives/Kbd/index.cjs +25 -0
- package/dist/primitives/Kbd/index.cjs.map +1 -0
- package/dist/primitives/Kbd/index.d.cts +2 -0
- package/dist/primitives/Kbd/index.d.ts +2 -0
- package/dist/primitives/Kbd/index.js +23 -0
- package/dist/primitives/Kbd/index.js.map +1 -0
- package/dist/primitives/Label/index.cjs +18 -0
- package/dist/primitives/Label/index.cjs.map +1 -0
- package/dist/primitives/Label/index.d.cts +2 -0
- package/dist/primitives/Label/index.d.ts +2 -0
- package/dist/primitives/Label/index.js +17 -0
- package/dist/primitives/Label/index.js.map +1 -0
- package/dist/primitives/Link/index.cjs +38 -0
- package/dist/primitives/Link/index.cjs.map +1 -0
- package/dist/primitives/Link/index.d.cts +2 -0
- package/dist/primitives/Link/index.d.ts +2 -0
- package/dist/primitives/Link/index.js +37 -0
- package/dist/primitives/Link/index.js.map +1 -0
- package/dist/primitives/Logo/index.cjs +3 -0
- package/dist/primitives/Logo/index.d.cts +2 -0
- package/dist/primitives/Logo/index.d.ts +2 -0
- package/dist/primitives/Logo/index.js +2 -0
- package/dist/primitives/Menubar/index.cjs +165 -0
- package/dist/primitives/Menubar/index.cjs.map +1 -0
- package/dist/primitives/Menubar/index.d.cts +2 -0
- package/dist/primitives/Menubar/index.d.ts +2 -0
- package/dist/primitives/Menubar/index.js +149 -0
- package/dist/primitives/Menubar/index.js.map +1 -0
- package/dist/primitives/NativeSelect/index.cjs +40 -0
- package/dist/primitives/NativeSelect/index.cjs.map +1 -0
- package/dist/primitives/NativeSelect/index.d.cts +2 -0
- package/dist/primitives/NativeSelect/index.d.ts +2 -0
- package/dist/primitives/NativeSelect/index.js +39 -0
- package/dist/primitives/NativeSelect/index.js.map +1 -0
- package/dist/primitives/NavRail/index.cjs +195 -0
- package/dist/primitives/NavRail/index.cjs.map +1 -0
- package/dist/primitives/NavRail/index.d.cts +2 -0
- package/dist/primitives/NavRail/index.d.ts +2 -0
- package/dist/primitives/NavRail/index.js +185 -0
- package/dist/primitives/NavRail/index.js.map +1 -0
- package/dist/primitives/NavigationMenu/index.cjs +98 -0
- package/dist/primitives/NavigationMenu/index.cjs.map +1 -0
- package/dist/primitives/NavigationMenu/index.d.cts +2 -0
- package/dist/primitives/NavigationMenu/index.d.ts +2 -0
- package/dist/primitives/NavigationMenu/index.js +89 -0
- package/dist/primitives/NavigationMenu/index.js.map +1 -0
- package/dist/primitives/Pagination/index.cjs +93 -0
- package/dist/primitives/Pagination/index.cjs.map +1 -0
- package/dist/primitives/Pagination/index.d.cts +2 -0
- package/dist/primitives/Pagination/index.d.ts +2 -0
- package/dist/primitives/Pagination/index.js +86 -0
- package/dist/primitives/Pagination/index.js.map +1 -0
- package/dist/primitives/Popover/index.cjs +70 -0
- package/dist/primitives/Popover/index.cjs.map +1 -0
- package/dist/primitives/Popover/index.d.cts +2 -0
- package/dist/primitives/Popover/index.d.ts +2 -0
- package/dist/primitives/Popover/index.js +63 -0
- package/dist/primitives/Popover/index.js.map +1 -0
- package/dist/primitives/Progress/index.cjs +44 -0
- package/dist/primitives/Progress/index.cjs.map +1 -0
- package/dist/primitives/Progress/index.d.cts +2 -0
- package/dist/primitives/Progress/index.d.ts +2 -0
- package/dist/primitives/Progress/index.js +43 -0
- package/dist/primitives/Progress/index.js.map +1 -0
- package/dist/primitives/RadioGroup/index.cjs +65 -0
- package/dist/primitives/RadioGroup/index.cjs.map +1 -0
- package/dist/primitives/RadioGroup/index.d.cts +2 -0
- package/dist/primitives/RadioGroup/index.d.ts +2 -0
- package/dist/primitives/RadioGroup/index.js +62 -0
- package/dist/primitives/RadioGroup/index.js.map +1 -0
- package/dist/primitives/Resizable/index.cjs +41 -0
- package/dist/primitives/Resizable/index.cjs.map +1 -0
- package/dist/primitives/Resizable/index.d.cts +2 -0
- package/dist/primitives/Resizable/index.d.ts +2 -0
- package/dist/primitives/Resizable/index.js +36 -0
- package/dist/primitives/Resizable/index.js.map +1 -0
- package/dist/primitives/ScrollArea/index.cjs +40 -0
- package/dist/primitives/ScrollArea/index.cjs.map +1 -0
- package/dist/primitives/ScrollArea/index.d.cts +2 -0
- package/dist/primitives/ScrollArea/index.d.ts +2 -0
- package/dist/primitives/ScrollArea/index.js +38 -0
- package/dist/primitives/ScrollArea/index.js.map +1 -0
- package/dist/primitives/Select/index.cjs +126 -0
- package/dist/primitives/Select/index.cjs.map +1 -0
- package/dist/primitives/Select/index.d.cts +2 -0
- package/dist/primitives/Select/index.d.ts +2 -0
- package/dist/primitives/Select/index.js +116 -0
- package/dist/primitives/Select/index.js.map +1 -0
- package/dist/primitives/Separator/index.cjs +25 -0
- package/dist/primitives/Separator/index.cjs.map +1 -0
- package/dist/primitives/Separator/index.d.cts +2 -0
- package/dist/primitives/Separator/index.d.ts +2 -0
- package/dist/primitives/Separator/index.js +24 -0
- package/dist/primitives/Separator/index.js.map +1 -0
- package/dist/primitives/Sheet/index.cjs +107 -0
- package/dist/primitives/Sheet/index.cjs.map +1 -0
- package/dist/primitives/Sheet/index.d.cts +2 -0
- package/dist/primitives/Sheet/index.d.ts +2 -0
- package/dist/primitives/Sheet/index.js +99 -0
- package/dist/primitives/Sheet/index.js.map +1 -0
- package/dist/primitives/Sidebar/index.cjs +26 -0
- package/dist/primitives/Sidebar/index.d.cts +2 -0
- package/dist/primitives/Sidebar/index.d.ts +2 -0
- package/dist/primitives/Sidebar/index.js +2 -0
- package/dist/primitives/Skeleton/index.cjs +43 -0
- package/dist/primitives/Skeleton/index.cjs.map +1 -0
- package/dist/primitives/Skeleton/index.d.cts +2 -0
- package/dist/primitives/Skeleton/index.d.ts +2 -0
- package/dist/primitives/Skeleton/index.js +39 -0
- package/dist/primitives/Skeleton/index.js.map +1 -0
- package/dist/primitives/Slider/index.cjs +46 -0
- package/dist/primitives/Slider/index.cjs.map +1 -0
- package/dist/primitives/Slider/index.d.cts +2 -0
- package/dist/primitives/Slider/index.d.ts +2 -0
- package/dist/primitives/Slider/index.js +43 -0
- package/dist/primitives/Slider/index.js.map +1 -0
- package/dist/primitives/Sonner/index.cjs +42 -0
- package/dist/primitives/Sonner/index.cjs.map +1 -0
- package/dist/primitives/Sonner/index.d.cts +2 -0
- package/dist/primitives/Sonner/index.d.ts +2 -0
- package/dist/primitives/Sonner/index.js +41 -0
- package/dist/primitives/Sonner/index.js.map +1 -0
- package/dist/primitives/Spinner/index.cjs +19 -0
- package/dist/primitives/Spinner/index.cjs.map +1 -0
- package/dist/primitives/Spinner/index.d.cts +2 -0
- package/dist/primitives/Spinner/index.d.ts +2 -0
- package/dist/primitives/Spinner/index.js +18 -0
- package/dist/primitives/Spinner/index.js.map +1 -0
- package/dist/primitives/Switch/index.cjs +71 -0
- package/dist/primitives/Switch/index.cjs.map +1 -0
- package/dist/primitives/Switch/index.d.cts +2 -0
- package/dist/primitives/Switch/index.d.ts +2 -0
- package/dist/primitives/Switch/index.js +68 -0
- package/dist/primitives/Switch/index.js.map +1 -0
- package/dist/primitives/Table/index.cjs +84 -0
- package/dist/primitives/Table/index.cjs.map +1 -0
- package/dist/primitives/Table/index.d.cts +2 -0
- package/dist/primitives/Table/index.d.ts +2 -0
- package/dist/primitives/Table/index.js +76 -0
- package/dist/primitives/Table/index.js.map +1 -0
- package/dist/primitives/Tabs/index.cjs +267 -0
- package/dist/primitives/Tabs/index.cjs.map +1 -0
- package/dist/primitives/Tabs/index.d.cts +2 -0
- package/dist/primitives/Tabs/index.d.ts +2 -0
- package/dist/primitives/Tabs/index.js +258 -0
- package/dist/primitives/Tabs/index.js.map +1 -0
- package/dist/primitives/Text/index.cjs +64 -0
- package/dist/primitives/Text/index.cjs.map +1 -0
- package/dist/primitives/Text/index.d.cts +2 -0
- package/dist/primitives/Text/index.d.ts +2 -0
- package/dist/primitives/Text/index.js +63 -0
- package/dist/primitives/Text/index.js.map +1 -0
- package/dist/primitives/Textarea/index.cjs +24 -0
- package/dist/primitives/Textarea/index.cjs.map +1 -0
- package/dist/primitives/Textarea/index.d.cts +2 -0
- package/dist/primitives/Textarea/index.d.ts +2 -0
- package/dist/primitives/Textarea/index.js +23 -0
- package/dist/primitives/Textarea/index.js.map +1 -0
- package/dist/primitives/ThemeProvider/index.cjs +93 -0
- package/dist/primitives/ThemeProvider/index.cjs.map +1 -0
- package/dist/primitives/ThemeProvider/index.d.cts +2 -0
- package/dist/primitives/ThemeProvider/index.d.ts +2 -0
- package/dist/primitives/ThemeProvider/index.js +88 -0
- package/dist/primitives/ThemeProvider/index.js.map +1 -0
- package/dist/primitives/Toggle/index.cjs +59 -0
- package/dist/primitives/Toggle/index.cjs.map +1 -0
- package/dist/primitives/Toggle/index.d.cts +2 -0
- package/dist/primitives/Toggle/index.d.ts +2 -0
- package/dist/primitives/Toggle/index.js +58 -0
- package/dist/primitives/Toggle/index.js.map +1 -0
- package/dist/primitives/ToggleGroup/index.cjs +65 -0
- package/dist/primitives/ToggleGroup/index.cjs.map +1 -0
- package/dist/primitives/ToggleGroup/index.d.cts +2 -0
- package/dist/primitives/ToggleGroup/index.d.ts +2 -0
- package/dist/primitives/ToggleGroup/index.js +61 -0
- package/dist/primitives/ToggleGroup/index.js.map +1 -0
- package/dist/primitives/Tooltip/index.cjs +47 -0
- package/dist/primitives/Tooltip/index.cjs.map +1 -0
- package/dist/primitives/Tooltip/index.d.cts +2 -0
- package/dist/primitives/Tooltip/index.d.ts +2 -0
- package/dist/primitives/Tooltip/index.js +43 -0
- package/dist/primitives/Tooltip/index.js.map +1 -0
- package/dist/primitives/index.cjs +398 -255
- package/dist/primitives/index.d.cts +65 -2
- package/dist/primitives/index.d.ts +65 -2
- package/dist/primitives/index.js +65 -5
- package/dist/styles/base.css +113 -0
- package/dist/styles/glass.css +75 -0
- package/dist/styles/index.css +43 -23
- package/dist/styles/semantic.css +167 -0
- package/dist/styles/theme.css +54 -24
- package/dist/styles/tokens/alpha.css +39 -0
- package/dist/styles/tokens/border-radius.css +17 -0
- package/dist/styles/tokens/chart-colors-dark.css +18 -0
- package/dist/styles/tokens/chart-colors-light.css +18 -0
- package/dist/styles/tokens/colors.css +251 -0
- package/dist/styles/tokens/mode-dark.css +101 -0
- package/dist/styles/tokens/mode-light.css +101 -0
- package/dist/styles/tokens/shadows.css +14 -0
- package/dist/styles/tokens/spacing.css +44 -0
- package/dist/styles/tokens/theme-bodhi.css +35 -0
- package/dist/styles/tokens/theme-slingshot.css +35 -0
- package/dist/styles/tokens/theme-sustain.css +35 -0
- package/dist/styles/tokens/typography.css +83 -0
- package/package.json +33 -40
- package/dist/AiChatPanel.cjs +0 -1603
- package/dist/AiChatPanel.cjs.map +0 -1
- package/dist/AiChatPanel.js +0 -1526
- package/dist/AiChatPanel.js.map +0 -1
- package/dist/BodhiLogo.cjs +0 -240
- package/dist/BodhiLogo.cjs.map +0 -1
- package/dist/BodhiLogo.js +0 -194
- package/dist/BodhiLogo.js.map +0 -1
- package/dist/Skeleton.cjs +0 -19
- package/dist/Skeleton.cjs.map +0 -1
- package/dist/Skeleton.js +0 -14
- package/dist/Skeleton.js.map +0 -1
- package/dist/SustainLogo.cjs +0 -415
- package/dist/SustainLogo.cjs.map +0 -1
- package/dist/SustainLogo.js +0 -378
- package/dist/SustainLogo.js.map +0 -1
- package/dist/contexts/index.cjs.map +0 -1
- package/dist/contexts/index.d.cts.map +0 -1
- package/dist/contexts/index.d.ts.map +0 -1
- package/dist/contexts/index.js.map +0 -1
- package/dist/layouts/index.d.cts.map +0 -1
- package/dist/layouts/index.d.ts.map +0 -1
- package/dist/layouts.cjs +0 -3245
- package/dist/layouts.cjs.map +0 -1
- package/dist/layouts.js +0 -3180
- package/dist/layouts.js.map +0 -1
- package/dist/patterns/index.cjs.map +0 -1
- package/dist/patterns/index.d.cts.map +0 -1
- package/dist/patterns/index.d.ts.map +0 -1
- package/dist/patterns/index.js.map +0 -1
- package/dist/primitives.cjs +0 -4292
- package/dist/primitives.cjs.map +0 -1
- package/dist/primitives.js +0 -2807
- package/dist/primitives.js.map +0 -1
- package/dist/styles/base/colors.css +0 -300
- package/dist/styles/base/component-tokens.css +0 -240
- package/dist/styles/base/elevation.css +0 -7
- package/dist/styles/base/fonts.css +0 -14
- package/dist/styles/base/global.css +0 -305
- package/dist/styles/base/radius.css +0 -22
- package/dist/styles/base/semantic-aliases.css +0 -53
- package/dist/styles/base/spacing.css +0 -33
- package/dist/styles/base/typography.css +0 -48
- package/dist/styles/generated/bodhi-vars.css +0 -34
- package/dist/styles/generated/dark.css +0 -87
- package/dist/styles/generated/light.css +0 -87
- package/dist/styles/generated/slingshot-vars.css +0 -34
- package/dist/styles/generated/sustain-vars.css +0 -34
- package/dist/styles/themes/bodhi.css +0 -166
- package/dist/styles/themes/slingshot.css +0 -144
- package/dist/styles/themes/sustain.css +0 -130
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_cn = require("../../cn.cjs");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
let vaul = require("vaul");
|
|
5
|
+
//#region src/primitives/Drawer/Drawer.tsx
|
|
6
|
+
/** Root provider for a vaul-backed sliding drawer; controls open state and slide `direction`. */
|
|
7
|
+
function Drawer({ ...props }) {
|
|
8
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(vaul.Drawer.Root, {
|
|
9
|
+
"data-slot": "drawer",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
/** Element that toggles the drawer open when interacted with. */
|
|
14
|
+
function DrawerTrigger({ ...props }) {
|
|
15
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(vaul.Drawer.Trigger, {
|
|
16
|
+
"data-slot": "drawer-trigger",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** Portals the overlay and content out to the document body. */
|
|
21
|
+
function DrawerPortal({ ...props }) {
|
|
22
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(vaul.Drawer.Portal, {
|
|
23
|
+
"data-slot": "drawer-portal",
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Element that closes the drawer when interacted with. */
|
|
28
|
+
function DrawerClose({ ...props }) {
|
|
29
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(vaul.Drawer.Close, {
|
|
30
|
+
"data-slot": "drawer-close",
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/** Dimmed backdrop rendered behind the drawer content. */
|
|
35
|
+
function DrawerOverlay({ className, ...props }) {
|
|
36
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(vaul.Drawer.Overlay, {
|
|
37
|
+
"data-slot": "drawer-overlay",
|
|
38
|
+
className: require_cn.cn("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", className),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** Sliding panel that holds the drawer's content; auto-portals and renders the overlay. */
|
|
43
|
+
function DrawerContent({ className, children, ...props }) {
|
|
44
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerPortal, {
|
|
45
|
+
"data-slot": "drawer-portal",
|
|
46
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DrawerOverlay, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(vaul.Drawer.Content, {
|
|
47
|
+
"data-slot": "drawer-content",
|
|
48
|
+
className: require_cn.cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-background", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", className),
|
|
49
|
+
...props,
|
|
50
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children]
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/** Top region of the drawer; groups the title and description. */
|
|
55
|
+
function DrawerHeader({ className, ...props }) {
|
|
56
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
57
|
+
"data-slot": "drawer-header",
|
|
58
|
+
className: require_cn.cn("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", className),
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/** Bottom region of the drawer; typically holds actions, pinned to the panel base. */
|
|
63
|
+
function DrawerFooter({ className, ...props }) {
|
|
64
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
65
|
+
"data-slot": "drawer-footer",
|
|
66
|
+
className: require_cn.cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/** Accessible title for the drawer, announced to assistive tech. */
|
|
71
|
+
function DrawerTitle({ className, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(vaul.Drawer.Title, {
|
|
73
|
+
"data-slot": "drawer-title",
|
|
74
|
+
className: require_cn.cn("font-semibold text-foreground", className),
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/** Supporting description text shown beneath the drawer title. */
|
|
79
|
+
function DrawerDescription({ className, ...props }) {
|
|
80
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(vaul.Drawer.Description, {
|
|
81
|
+
"data-slot": "drawer-description",
|
|
82
|
+
className: require_cn.cn("text-sm text-muted-foreground", className),
|
|
83
|
+
...props
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
exports.Drawer = Drawer;
|
|
88
|
+
exports.DrawerClose = DrawerClose;
|
|
89
|
+
exports.DrawerContent = DrawerContent;
|
|
90
|
+
exports.DrawerDescription = DrawerDescription;
|
|
91
|
+
exports.DrawerFooter = DrawerFooter;
|
|
92
|
+
exports.DrawerHeader = DrawerHeader;
|
|
93
|
+
exports.DrawerOverlay = DrawerOverlay;
|
|
94
|
+
exports.DrawerPortal = DrawerPortal;
|
|
95
|
+
exports.DrawerTitle = DrawerTitle;
|
|
96
|
+
exports.DrawerTrigger = DrawerTrigger;
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["DrawerPrimitive","cn"],"sources":["../../../src/primitives/Drawer/Drawer.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"@/utils\";\n\n/** Root provider for a vaul-backed sliding drawer; controls open state and slide `direction`. */\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\n/** Element that toggles the drawer open when interacted with. */\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\n/** Portals the overlay and content out to the document body. */\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\n/** Element that closes the drawer when interacted with. */\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\n/** Dimmed backdrop rendered behind the drawer content. */\nfunction DrawerOverlay({\n /** Extra classes merged onto the overlay surface. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Sliding panel that holds the drawer's content; auto-portals and renders the overlay. */\nfunction DrawerContent({\n /** Extra classes merged onto the content panel. */\n className,\n /** Body of the drawer, typically header/footer plus content. */\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content fixed z-50 flex h-auto flex-col bg-background\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\n/** Top region of the drawer; groups the title and description. */\nfunction DrawerHeader({\n /** Extra classes merged onto the header wrapper. */\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Bottom region of the drawer; typically holds actions, pinned to the panel base. */\nfunction DrawerFooter({\n /** Extra classes merged onto the footer wrapper. */\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\n/** Accessible title for the drawer, announced to assistive tech. */\nfunction DrawerTitle({\n /** Extra classes merged onto the title. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"font-semibold text-foreground\", className)}\n {...props}\n />\n );\n}\n\n/** Supporting description text shown beneath the drawer title. */\nfunction DrawerDescription({\n /** Extra classes merged onto the description. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"],"mappings":";;;;;;AAMA,SAAS,OAAO,EAAE,GAAG,SAA4D;CAC/E,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;CAAQ,CAAA;AAC9D;;AAGA,SAAS,cAAc,EAAE,GAAG,SAA+D;CACzF,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;;AAGA,SAAS,aAAa,EAAE,GAAG,SAA8D;CACvF,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;;AAGA,SAAS,YAAY,EAAE,GAAG,SAA6D;CACrF,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;;AAGA,SAAS,cAAc,EAErB,WACA,GAAG,SACoD;CACvD,OACE,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,SAAjB;EACE,aAAU;EACV,WAAWC,WAAAA,GACT,0JACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,cAAc,EAErB,WAEA,UACA,GAAG,SACoD;CACvD,OACE,iBAAA,GAAA,kBAAA,MAAC,cAAD;EAAc,aAAU;YAAxB,CACE,iBAAA,GAAA,kBAAA,KAAC,eAAD,CAAgB,CAAA,GAChB,iBAAA,GAAA,kBAAA,MAACD,KAAAA,OAAgB,SAAjB;GACE,aAAU;GACV,WAAWC,WAAAA,GACT,sEACA,kQACA,uRACA,+NACA,yNACA,SACF;GACA,GAAI;aAVN,CAYE,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAU,kIAAmI,CAAA,GACjJ,QACsB;IACb;;AAElB;;AAGA,SAAS,aAAa,EAEpB,WACA,GAAG,SAC2B;CAC9B,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GACT,4LACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,aAAa,EAEpB,WACA,GAAG,SAC2B;CAC9B,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GAAG,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAEnB,WACA,GAAG,SACkD;CACrD,OACE,iBAAA,GAAA,kBAAA,KAACD,KAAAA,OAAgB,OAAjB;EACE,aAAU;EACV,WAAWC,WAAAA,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,kBAAkB,EAEzB,WACA,GAAG,SACwD;CAC3D,OACE,iBAAA,GAAA,kBAAA,KAACD,KAAAA,OAAgB,aAAjB;EACE,aAAU;EACV,WAAWC,WAAAA,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as DrawerFooter, c as DrawerPortal, i as DrawerDescription, l as DrawerTitle, n as DrawerClose, o as DrawerHeader, r as DrawerContent, s as DrawerOverlay, t as Drawer, u as DrawerTrigger } from "../../index22.cjs";
|
|
2
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as DrawerFooter, c as DrawerPortal, i as DrawerDescription, l as DrawerTitle, n as DrawerClose, o as DrawerHeader, r as DrawerContent, s as DrawerOverlay, t as Drawer, u as DrawerTrigger } from "../../index22.js";
|
|
2
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { t as cn } from "../../cn.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Drawer as Drawer$1 } from "vaul";
|
|
4
|
+
//#region src/primitives/Drawer/Drawer.tsx
|
|
5
|
+
/** Root provider for a vaul-backed sliding drawer; controls open state and slide `direction`. */
|
|
6
|
+
function Drawer({ ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Drawer$1.Root, {
|
|
8
|
+
"data-slot": "drawer",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/** Element that toggles the drawer open when interacted with. */
|
|
13
|
+
function DrawerTrigger({ ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(Drawer$1.Trigger, {
|
|
15
|
+
"data-slot": "drawer-trigger",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/** Portals the overlay and content out to the document body. */
|
|
20
|
+
function DrawerPortal({ ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(Drawer$1.Portal, {
|
|
22
|
+
"data-slot": "drawer-portal",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/** Element that closes the drawer when interacted with. */
|
|
27
|
+
function DrawerClose({ ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx(Drawer$1.Close, {
|
|
29
|
+
"data-slot": "drawer-close",
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Dimmed backdrop rendered behind the drawer content. */
|
|
34
|
+
function DrawerOverlay({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx(Drawer$1.Overlay, {
|
|
36
|
+
"data-slot": "drawer-overlay",
|
|
37
|
+
className: cn("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", className),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/** Sliding panel that holds the drawer's content; auto-portals and renders the overlay. */
|
|
42
|
+
function DrawerContent({ className, children, ...props }) {
|
|
43
|
+
return /* @__PURE__ */ jsxs(DrawerPortal, {
|
|
44
|
+
"data-slot": "drawer-portal",
|
|
45
|
+
children: [/* @__PURE__ */ jsx(DrawerOverlay, {}), /* @__PURE__ */ jsxs(Drawer$1.Content, {
|
|
46
|
+
"data-slot": "drawer-content",
|
|
47
|
+
className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-background", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", className),
|
|
48
|
+
...props,
|
|
49
|
+
children: [/* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children]
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** Top region of the drawer; groups the title and description. */
|
|
54
|
+
function DrawerHeader({ className, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsx("div", {
|
|
56
|
+
"data-slot": "drawer-header",
|
|
57
|
+
className: cn("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", className),
|
|
58
|
+
...props
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** Bottom region of the drawer; typically holds actions, pinned to the panel base. */
|
|
62
|
+
function DrawerFooter({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsx("div", {
|
|
64
|
+
"data-slot": "drawer-footer",
|
|
65
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/** Accessible title for the drawer, announced to assistive tech. */
|
|
70
|
+
function DrawerTitle({ className, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsx(Drawer$1.Title, {
|
|
72
|
+
"data-slot": "drawer-title",
|
|
73
|
+
className: cn("font-semibold text-foreground", className),
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/** Supporting description text shown beneath the drawer title. */
|
|
78
|
+
function DrawerDescription({ className, ...props }) {
|
|
79
|
+
return /* @__PURE__ */ jsx(Drawer$1.Description, {
|
|
80
|
+
"data-slot": "drawer-description",
|
|
81
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
82
|
+
...props
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["DrawerPrimitive"],"sources":["../../../src/primitives/Drawer/Drawer.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"@/utils\";\n\n/** Root provider for a vaul-backed sliding drawer; controls open state and slide `direction`. */\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\n/** Element that toggles the drawer open when interacted with. */\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\n/** Portals the overlay and content out to the document body. */\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\n/** Element that closes the drawer when interacted with. */\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\n/** Dimmed backdrop rendered behind the drawer content. */\nfunction DrawerOverlay({\n /** Extra classes merged onto the overlay surface. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Sliding panel that holds the drawer's content; auto-portals and renders the overlay. */\nfunction DrawerContent({\n /** Extra classes merged onto the content panel. */\n className,\n /** Body of the drawer, typically header/footer plus content. */\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content fixed z-50 flex h-auto flex-col bg-background\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\n/** Top region of the drawer; groups the title and description. */\nfunction DrawerHeader({\n /** Extra classes merged onto the header wrapper. */\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Bottom region of the drawer; typically holds actions, pinned to the panel base. */\nfunction DrawerFooter({\n /** Extra classes merged onto the footer wrapper. */\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\n/** Accessible title for the drawer, announced to assistive tech. */\nfunction DrawerTitle({\n /** Extra classes merged onto the title. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"font-semibold text-foreground\", className)}\n {...props}\n />\n );\n}\n\n/** Supporting description text shown beneath the drawer title. */\nfunction DrawerDescription({\n /** Extra classes merged onto the description. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"],"mappings":";;;;;AAMA,SAAS,OAAO,EAAE,GAAG,SAA4D;CAC/E,OAAO,oBAACA,SAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;CAAQ,CAAA;AAC9D;;AAGA,SAAS,cAAc,EAAE,GAAG,SAA+D;CACzF,OAAO,oBAACA,SAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;;AAGA,SAAS,aAAa,EAAE,GAAG,SAA8D;CACvF,OAAO,oBAACA,SAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;;AAGA,SAAS,YAAY,EAAE,GAAG,SAA6D;CACrF,OAAO,oBAACA,SAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;;AAGA,SAAS,cAAc,EAErB,WACA,GAAG,SACoD;CACvD,OACE,oBAACA,SAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT,0JACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,cAAc,EAErB,WAEA,UACA,GAAG,SACoD;CACvD,OACE,qBAAC,cAAD;EAAc,aAAU;YAAxB,CACE,oBAAC,eAAD,CAAgB,CAAA,GAChB,qBAACA,SAAgB,SAAjB;GACE,aAAU;GACV,WAAW,GACT,sEACA,kQACA,uRACA,+NACA,yNACA,SACF;GACA,GAAI;aAVN,CAYE,oBAAC,OAAD,EAAK,WAAU,kIAAmI,CAAA,GACjJ,QACsB;IACb;;AAElB;;AAGA,SAAS,aAAa,EAEpB,WACA,GAAG,SAC2B;CAC9B,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,4LACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,aAAa,EAEpB,WACA,GAAG,SAC2B;CAC9B,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAEnB,WACA,GAAG,SACkD;CACrD,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,kBAAkB,EAEzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAACA,SAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_cn = require("../../cn.cjs");
|
|
3
|
+
let lucide_react = require("lucide-react");
|
|
4
|
+
let radix_ui = require("radix-ui");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
//#region src/primitives/DropdownMenu/DropdownMenu.tsx
|
|
7
|
+
/** Root provider for a dropdown menu; holds open state and wires the trigger to its content. */
|
|
8
|
+
function DropdownMenu({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.Root, {
|
|
10
|
+
"data-slot": "dropdown-menu",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/** Renders the menu into a portal so it escapes overflow/stacking contexts. */
|
|
15
|
+
function DropdownMenuPortal({ ...props }) {
|
|
16
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.Portal, {
|
|
17
|
+
"data-slot": "dropdown-menu-portal",
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/** The control (usually a button) that toggles the menu open and closed. */
|
|
22
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
23
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.Trigger, {
|
|
24
|
+
"data-slot": "dropdown-menu-trigger",
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/** The floating surface that holds the menu items; portalled and animated on open/close. */
|
|
29
|
+
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
30
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.Content, {
|
|
31
|
+
"data-slot": "dropdown-menu-content",
|
|
32
|
+
sideOffset,
|
|
33
|
+
className: require_cn.cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", className),
|
|
34
|
+
...props
|
|
35
|
+
}) });
|
|
36
|
+
}
|
|
37
|
+
/** Groups related menu items together for labelling and keyboard navigation. */
|
|
38
|
+
function DropdownMenuGroup({ ...props }) {
|
|
39
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.Group, {
|
|
40
|
+
"data-slot": "dropdown-menu-group",
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** A selectable menu row that fires on click/Enter. */
|
|
45
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
46
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.Item, {
|
|
47
|
+
"data-slot": "dropdown-menu-item",
|
|
48
|
+
"data-inset": inset,
|
|
49
|
+
"data-variant": variant,
|
|
50
|
+
className: require_cn.cn("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!", className),
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/** A menu row with a toggleable checkmark indicator for boolean options. */
|
|
55
|
+
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
56
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(radix_ui.DropdownMenu.CheckboxItem, {
|
|
57
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
58
|
+
className: require_cn.cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
59
|
+
checked,
|
|
60
|
+
...props,
|
|
61
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
62
|
+
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
63
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CheckIcon, { className: "size-4" }) })
|
|
64
|
+
}), children]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** Wraps radio items so only one option in the group can be selected at a time. */
|
|
68
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
69
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.RadioGroup, {
|
|
70
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
71
|
+
...props
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/** A single mutually-exclusive option within a `DropdownMenuRadioGroup`. */
|
|
75
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
76
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(radix_ui.DropdownMenu.RadioItem, {
|
|
77
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
78
|
+
className: require_cn.cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
79
|
+
...props,
|
|
80
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
81
|
+
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
82
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleIcon, { className: "size-2 fill-current" }) })
|
|
83
|
+
}), children]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/** A non-interactive heading used to title a group of menu items. */
|
|
87
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
88
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.Label, {
|
|
89
|
+
"data-slot": "dropdown-menu-label",
|
|
90
|
+
"data-inset": inset,
|
|
91
|
+
className: require_cn.cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
|
|
92
|
+
...props
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/** A thin divider line used to visually separate groups of menu items. */
|
|
96
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
97
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.Separator, {
|
|
98
|
+
"data-slot": "dropdown-menu-separator",
|
|
99
|
+
className: require_cn.cn("-mx-1 my-1 h-px bg-border", className),
|
|
100
|
+
...props
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/** Right-aligned hint for an item's keyboard shortcut (e.g. ⇧⌘P). */
|
|
104
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
105
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
106
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
107
|
+
className: require_cn.cn("ml-auto text-xs tracking-widest text-muted-foreground", className),
|
|
108
|
+
...props
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/** Root for a nested submenu; holds the sub-trigger and its sub-content. */
|
|
112
|
+
function DropdownMenuSub({ ...props }) {
|
|
113
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.Sub, {
|
|
114
|
+
"data-slot": "dropdown-menu-sub",
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/** The item that opens a nested submenu, shown with a trailing chevron. */
|
|
119
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
120
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(radix_ui.DropdownMenu.SubTrigger, {
|
|
121
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
122
|
+
"data-inset": inset,
|
|
123
|
+
className: require_cn.cn("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className),
|
|
124
|
+
...props,
|
|
125
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRightIcon, { className: "ml-auto size-4" })]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/** The floating surface for a nested submenu's items. */
|
|
129
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
130
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.SubContent, {
|
|
131
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
132
|
+
className: require_cn.cn("z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", className),
|
|
133
|
+
...props
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
exports.DropdownMenu = DropdownMenu;
|
|
138
|
+
exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
|
|
139
|
+
exports.DropdownMenuContent = DropdownMenuContent;
|
|
140
|
+
exports.DropdownMenuGroup = DropdownMenuGroup;
|
|
141
|
+
exports.DropdownMenuItem = DropdownMenuItem;
|
|
142
|
+
exports.DropdownMenuLabel = DropdownMenuLabel;
|
|
143
|
+
exports.DropdownMenuPortal = DropdownMenuPortal;
|
|
144
|
+
exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
|
|
145
|
+
exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
|
|
146
|
+
exports.DropdownMenuSeparator = DropdownMenuSeparator;
|
|
147
|
+
exports.DropdownMenuShortcut = DropdownMenuShortcut;
|
|
148
|
+
exports.DropdownMenuSub = DropdownMenuSub;
|
|
149
|
+
exports.DropdownMenuSubContent = DropdownMenuSubContent;
|
|
150
|
+
exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
|
|
151
|
+
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
152
|
+
|
|
153
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["DropdownMenuPrimitive","cn","CheckIcon","CircleIcon","ChevronRightIcon"],"sources":["../../../src/primitives/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n/** Root provider for a dropdown menu; holds open state and wires the trigger to its content. */\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\n/** Renders the menu into a portal so it escapes overflow/stacking contexts. */\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\n/** The control (usually a button) that toggles the menu open and closed. */\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\n/** The floating surface that holds the menu items; portalled and animated on open/close. */\nfunction DropdownMenuContent({\n className,\n /** Gap in pixels between the trigger and the content edge. */\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\n/** Groups related menu items together for labelling and keyboard navigation. */\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\n/** A selectable menu row that fires on click/Enter. */\nfunction DropdownMenuItem({\n className,\n /** Indents the item to align with rows that have a leading icon/indicator. */\n inset,\n /** Visual tone of the item; `destructive` renders in the danger color. */\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A menu row with a toggleable checkmark indicator for boolean options. */\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n /** Whether the checkbox indicator is shown as checked. */\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\n/** Wraps radio items so only one option in the group can be selected at a time. */\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\n/** A single mutually-exclusive option within a `DropdownMenuRadioGroup`. */\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\n/** A non-interactive heading used to title a group of menu items. */\nfunction DropdownMenuLabel({\n className,\n /** Indents the label to align with rows that have a leading icon/indicator. */\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)}\n {...props}\n />\n );\n}\n\n/** A thin divider line used to visually separate groups of menu items. */\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n );\n}\n\n/** Right-aligned hint for an item's keyboard shortcut (e.g. ⇧⌘P). */\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n}\n\n/** Root for a nested submenu; holds the sub-trigger and its sub-content. */\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\n/** The item that opens a nested submenu, shown with a trailing chevron. */\nfunction DropdownMenuSubTrigger({\n className,\n /** Indents the trigger to align with rows that have a leading icon/indicator. */\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\n/** The floating surface for a nested submenu's items. */\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as DropdownMenuItem, c as DropdownMenuRadioGroup, d as DropdownMenuShortcut, f as DropdownMenuSub, h as DropdownMenuTrigger, i as DropdownMenuGroup, l as DropdownMenuRadioItem, m as DropdownMenuSubTrigger, n as DropdownMenuCheckboxItem, o as DropdownMenuLabel, p as DropdownMenuSubContent, r as DropdownMenuContent, s as DropdownMenuPortal, t as DropdownMenu, u as DropdownMenuSeparator } from "../../index23.cjs";
|
|
2
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as DropdownMenuItem, c as DropdownMenuRadioGroup, d as DropdownMenuShortcut, f as DropdownMenuSub, h as DropdownMenuTrigger, i as DropdownMenuGroup, l as DropdownMenuRadioItem, m as DropdownMenuSubTrigger, n as DropdownMenuCheckboxItem, o as DropdownMenuLabel, p as DropdownMenuSubContent, r as DropdownMenuContent, s as DropdownMenuPortal, t as DropdownMenu, u as DropdownMenuSeparator } from "../../index23.js";
|
|
2
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { t as cn } from "../../cn.js";
|
|
2
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
3
|
+
import { DropdownMenu as DropdownMenu$1 } from "radix-ui";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/primitives/DropdownMenu/DropdownMenu.tsx
|
|
6
|
+
/** Root provider for a dropdown menu; holds open state and wires the trigger to its content. */
|
|
7
|
+
function DropdownMenu({ ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Root, {
|
|
9
|
+
"data-slot": "dropdown-menu",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
/** Renders the menu into a portal so it escapes overflow/stacking contexts. */
|
|
14
|
+
function DropdownMenuPortal({ ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Portal, {
|
|
16
|
+
"data-slot": "dropdown-menu-portal",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** The control (usually a button) that toggles the menu open and closed. */
|
|
21
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, {
|
|
23
|
+
"data-slot": "dropdown-menu-trigger",
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** The floating surface that holds the menu items; portalled and animated on open/close. */
|
|
28
|
+
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Portal, { children: /* @__PURE__ */ jsx(DropdownMenu$1.Content, {
|
|
30
|
+
"data-slot": "dropdown-menu-content",
|
|
31
|
+
sideOffset,
|
|
32
|
+
className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", className),
|
|
33
|
+
...props
|
|
34
|
+
}) });
|
|
35
|
+
}
|
|
36
|
+
/** Groups related menu items together for labelling and keyboard navigation. */
|
|
37
|
+
function DropdownMenuGroup({ ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Group, {
|
|
39
|
+
"data-slot": "dropdown-menu-group",
|
|
40
|
+
...props
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/** A selectable menu row that fires on click/Enter. */
|
|
44
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Item, {
|
|
46
|
+
"data-slot": "dropdown-menu-item",
|
|
47
|
+
"data-inset": inset,
|
|
48
|
+
"data-variant": variant,
|
|
49
|
+
className: cn("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!", className),
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** A menu row with a toggleable checkmark indicator for boolean options. */
|
|
54
|
+
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.CheckboxItem, {
|
|
56
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
57
|
+
className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
58
|
+
checked,
|
|
59
|
+
...props,
|
|
60
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
61
|
+
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
62
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
|
|
63
|
+
}), children]
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/** Wraps radio items so only one option in the group can be selected at a time. */
|
|
67
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
68
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.RadioGroup, {
|
|
69
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** A single mutually-exclusive option within a `DropdownMenuRadioGroup`. */
|
|
74
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
75
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.RadioItem, {
|
|
76
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
77
|
+
className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
78
|
+
...props,
|
|
79
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
80
|
+
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
81
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) })
|
|
82
|
+
}), children]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/** A non-interactive heading used to title a group of menu items. */
|
|
86
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
87
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Label, {
|
|
88
|
+
"data-slot": "dropdown-menu-label",
|
|
89
|
+
"data-inset": inset,
|
|
90
|
+
className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
|
|
91
|
+
...props
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/** A thin divider line used to visually separate groups of menu items. */
|
|
95
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
96
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Separator, {
|
|
97
|
+
"data-slot": "dropdown-menu-separator",
|
|
98
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
99
|
+
...props
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/** Right-aligned hint for an item's keyboard shortcut (e.g. ⇧⌘P). */
|
|
103
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
104
|
+
return /* @__PURE__ */ jsx("span", {
|
|
105
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
106
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className),
|
|
107
|
+
...props
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/** Root for a nested submenu; holds the sub-trigger and its sub-content. */
|
|
111
|
+
function DropdownMenuSub({ ...props }) {
|
|
112
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Sub, {
|
|
113
|
+
"data-slot": "dropdown-menu-sub",
|
|
114
|
+
...props
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/** The item that opens a nested submenu, shown with a trailing chevron. */
|
|
118
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
119
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.SubTrigger, {
|
|
120
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
121
|
+
"data-inset": inset,
|
|
122
|
+
className: cn("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className),
|
|
123
|
+
...props,
|
|
124
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })]
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/** The floating surface for a nested submenu's items. */
|
|
128
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
129
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.SubContent, {
|
|
130
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
131
|
+
className: cn("z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", className),
|
|
132
|
+
...props
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["DropdownMenuPrimitive"],"sources":["../../../src/primitives/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n/** Root provider for a dropdown menu; holds open state and wires the trigger to its content. */\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\n/** Renders the menu into a portal so it escapes overflow/stacking contexts. */\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\n/** The control (usually a button) that toggles the menu open and closed. */\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\n/** The floating surface that holds the menu items; portalled and animated on open/close. */\nfunction DropdownMenuContent({\n className,\n /** Gap in pixels between the trigger and the content edge. */\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\n/** Groups related menu items together for labelling and keyboard navigation. */\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\n/** A selectable menu row that fires on click/Enter. */\nfunction DropdownMenuItem({\n className,\n /** Indents the item to align with rows that have a leading icon/indicator. */\n inset,\n /** Visual tone of the item; `destructive` renders in the danger color. */\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A menu row with a toggleable checkmark indicator for boolean options. */\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n /** Whether the checkbox indicator is shown as checked. */\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\n/** Wraps radio items so only one option in the group can be selected at a time. */\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\n/** A single mutually-exclusive option within a `DropdownMenuRadioGroup`. */\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\n/** A non-interactive heading used to title a group of menu items. */\nfunction DropdownMenuLabel({\n className,\n /** Indents the label to align with rows that have a leading icon/indicator. */\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)}\n {...props}\n />\n );\n}\n\n/** A thin divider line used to visually separate groups of menu items. */\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n );\n}\n\n/** Right-aligned hint for an item's keyboard shortcut (e.g. ⇧⌘P). */\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n}\n\n/** Root for a nested submenu; holds the sub-trigger and its sub-content. */\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\n/** The item that opens a nested submenu, shown with a trailing chevron. */\nfunction DropdownMenuSubTrigger({\n className,\n /** Indents the trigger to align with rows that have a leading icon/indicator. */\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\n/** The floating surface for a nested submenu's items. */\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"mappings":"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"}
|