@psnext/design-system 2.3.0 → 2.5.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/DESIGN.md +493 -8
- package/README.md +3 -3
- package/SKILL.md +84 -6
- package/bin/install-agent-skill.mjs +39 -7
- package/dist/Header.cjs +152 -21
- package/dist/Header.cjs.map +1 -1
- package/dist/Header.js +152 -21
- package/dist/Header.js.map +1 -1
- package/dist/Icon.cjs +40 -8
- package/dist/Icon.cjs.map +1 -1
- package/dist/Icon.js +40 -8
- package/dist/Icon.js.map +1 -1
- package/dist/Mosaic.cjs +472 -0
- package/dist/Mosaic.cjs.map +1 -0
- package/dist/Mosaic.js +459 -0
- package/dist/Mosaic.js.map +1 -0
- package/dist/MultiColumn.cjs +354 -0
- package/dist/MultiColumn.cjs.map +1 -0
- package/dist/MultiColumn.js +335 -0
- package/dist/MultiColumn.js.map +1 -0
- package/dist/Sidebar.cjs +4 -3
- package/dist/Sidebar.cjs.map +1 -1
- package/dist/Sidebar.js +4 -3
- package/dist/Sidebar.js.map +1 -1
- package/dist/index.cjs +18 -3
- package/dist/index.d.cts +5 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index10.d.cts +6 -6
- package/dist/index10.d.cts.map +1 -1
- package/dist/index10.d.ts +6 -6
- package/dist/index11.d.cts +3 -3
- package/dist/index11.d.cts.map +1 -1
- package/dist/index11.d.ts +3 -3
- package/dist/index11.d.ts.map +1 -1
- package/dist/index12.d.cts +12 -12
- package/dist/index12.d.ts +12 -12
- package/dist/index13.d.cts +6 -6
- package/dist/index13.d.cts.map +1 -1
- package/dist/index13.d.ts +6 -6
- package/dist/index13.d.ts.map +1 -1
- package/dist/index14.d.cts +5 -5
- package/dist/index14.d.ts +5 -5
- package/dist/index15.d.cts +58 -23
- package/dist/index15.d.cts.map +1 -1
- package/dist/index15.d.ts +58 -23
- package/dist/index15.d.ts.map +1 -1
- package/dist/index16.d.cts +23 -32
- package/dist/index16.d.cts.map +1 -1
- package/dist/index16.d.ts +23 -32
- package/dist/index16.d.ts.map +1 -1
- package/dist/index17.d.cts +34 -15
- package/dist/index17.d.cts.map +1 -1
- package/dist/index17.d.ts +34 -15
- package/dist/index17.d.ts.map +1 -1
- package/dist/index18.d.cts +13 -67
- package/dist/index18.d.cts.map +1 -1
- package/dist/index18.d.ts +13 -67
- package/dist/index18.d.ts.map +1 -1
- package/dist/index19.d.cts +55 -48
- package/dist/index19.d.cts.map +1 -1
- package/dist/index19.d.ts +55 -48
- package/dist/index19.d.ts.map +1 -1
- package/dist/index2.d.cts +8 -8
- package/dist/index2.d.ts +9 -9
- package/dist/index20.d.cts +45 -75
- package/dist/index20.d.cts.map +1 -1
- package/dist/index20.d.ts +45 -75
- package/dist/index20.d.ts.map +1 -1
- package/dist/index21.d.cts +90 -28
- package/dist/index21.d.cts.map +1 -1
- package/dist/index21.d.ts +90 -28
- package/dist/index21.d.ts.map +1 -1
- package/dist/index22.d.cts +28 -56
- package/dist/index22.d.cts.map +1 -1
- package/dist/index22.d.ts +28 -56
- package/dist/index22.d.ts.map +1 -1
- package/dist/index23.d.cts +53 -78
- package/dist/index23.d.cts.map +1 -1
- package/dist/index23.d.ts +53 -78
- package/dist/index23.d.ts.map +1 -1
- package/dist/index24.d.cts +83 -33
- package/dist/index24.d.cts.map +1 -1
- package/dist/index24.d.ts +83 -33
- package/dist/index24.d.ts.map +1 -1
- package/dist/index25.d.cts +43 -11
- package/dist/index25.d.cts.map +1 -1
- package/dist/index25.d.ts +43 -11
- package/dist/index25.d.ts.map +1 -1
- package/dist/index26.d.cts +11 -74
- package/dist/index26.d.cts.map +1 -1
- package/dist/index26.d.ts +11 -74
- package/dist/index26.d.ts.map +1 -1
- package/dist/index27.d.cts +68 -59
- package/dist/index27.d.cts.map +1 -1
- package/dist/index27.d.ts +68 -59
- package/dist/index27.d.ts.map +1 -1
- package/dist/index28.d.cts +47 -30
- package/dist/index28.d.cts.map +1 -1
- package/dist/index28.d.ts +47 -30
- package/dist/index28.d.ts.map +1 -1
- package/dist/index29.d.cts +63 -17
- package/dist/index29.d.cts.map +1 -1
- package/dist/index29.d.ts +63 -17
- package/dist/index29.d.ts.map +1 -1
- package/dist/index3.d.cts +13 -13
- package/dist/index3.d.ts +13 -13
- package/dist/index30.d.cts +29 -51
- package/dist/index30.d.cts.map +1 -1
- package/dist/index30.d.ts +30 -52
- package/dist/index30.d.ts.map +1 -1
- package/dist/index31.d.cts +19 -34
- package/dist/index31.d.cts.map +1 -1
- package/dist/index31.d.ts +19 -34
- package/dist/index31.d.ts.map +1 -1
- package/dist/index32.d.cts +80 -18
- package/dist/index32.d.cts.map +1 -1
- package/dist/index32.d.ts +79 -17
- package/dist/index32.d.ts.map +1 -1
- package/dist/index33.d.cts +32 -51
- package/dist/index33.d.cts.map +1 -1
- package/dist/index33.d.ts +33 -52
- package/dist/index33.d.ts.map +1 -1
- package/dist/index34.d.cts +19 -36
- package/dist/index34.d.cts.map +1 -1
- package/dist/index34.d.ts +19 -36
- package/dist/index34.d.ts.map +1 -1
- package/dist/index35.d.cts +43 -61
- package/dist/index35.d.cts.map +1 -1
- package/dist/index35.d.ts +44 -62
- package/dist/index35.d.ts.map +1 -1
- package/dist/index36.d.cts +35 -11
- package/dist/index36.d.cts.map +1 -1
- package/dist/index36.d.ts +35 -11
- package/dist/index36.d.ts.map +1 -1
- package/dist/index37.d.cts +68 -20
- package/dist/index37.d.cts.map +1 -1
- package/dist/index37.d.ts +69 -21
- package/dist/index37.d.ts.map +1 -1
- package/dist/index38.d.cts +14 -15
- package/dist/index38.d.cts.map +1 -1
- package/dist/index38.d.ts +14 -15
- package/dist/index38.d.ts.map +1 -1
- package/dist/index39.d.cts +22 -98
- package/dist/index39.d.cts.map +1 -1
- package/dist/index39.d.ts +22 -98
- package/dist/index39.d.ts.map +1 -1
- package/dist/index4.d.cts +2 -2
- package/dist/index4.d.cts.map +1 -1
- package/dist/index4.d.ts +2 -2
- package/dist/index40.d.cts +15 -17
- package/dist/index40.d.cts.map +1 -1
- package/dist/index40.d.ts +15 -17
- package/dist/index40.d.ts.map +1 -1
- package/dist/index41.d.cts +84 -35
- package/dist/index41.d.cts.map +1 -1
- package/dist/index41.d.ts +84 -35
- package/dist/index41.d.ts.map +1 -1
- package/dist/index42.d.cts +118 -38
- package/dist/index42.d.cts.map +1 -1
- package/dist/index42.d.ts +118 -38
- package/dist/index42.d.ts.map +1 -1
- package/dist/index43.d.cts +15 -89
- package/dist/index43.d.cts.map +1 -1
- package/dist/index43.d.ts +15 -89
- package/dist/index43.d.ts.map +1 -1
- package/dist/index44.d.cts +56 -1
- package/dist/index44.d.cts.map +1 -0
- package/dist/index44.d.ts +56 -1
- package/dist/index44.d.ts.map +1 -0
- package/dist/index45.d.cts +31 -34
- package/dist/index45.d.cts.map +1 -1
- package/dist/index45.d.ts +31 -34
- package/dist/index45.d.ts.map +1 -1
- package/dist/index46.d.cts +89 -21
- package/dist/index46.d.cts.map +1 -1
- package/dist/index46.d.ts +89 -21
- package/dist/index46.d.ts.map +1 -1
- package/dist/index47.d.cts +1 -41
- package/dist/index47.d.ts +1 -41
- package/dist/index48.d.cts +122 -20
- package/dist/index48.d.cts.map +1 -1
- package/dist/index48.d.ts +122 -20
- package/dist/index48.d.ts.map +1 -1
- package/dist/index49.d.cts +40 -13
- package/dist/index49.d.cts.map +1 -1
- package/dist/index49.d.ts +40 -13
- package/dist/index49.d.ts.map +1 -1
- package/dist/index5.d.cts +7 -7
- package/dist/index5.d.cts.map +1 -1
- package/dist/index5.d.ts +7 -7
- package/dist/index50.d.cts +22 -63
- package/dist/index50.d.cts.map +1 -1
- package/dist/index50.d.ts +22 -63
- package/dist/index50.d.ts.map +1 -1
- package/dist/index51.d.cts +33 -55
- package/dist/index51.d.cts.map +1 -1
- package/dist/index51.d.ts +33 -55
- package/dist/index51.d.ts.map +1 -1
- package/dist/index52.d.cts +18 -24
- package/dist/index52.d.cts.map +1 -1
- package/dist/index52.d.ts +18 -24
- package/dist/index52.d.ts.map +1 -1
- package/dist/index53.d.cts +12 -200
- package/dist/index53.d.cts.map +1 -1
- package/dist/index53.d.ts +12 -200
- package/dist/index53.d.ts.map +1 -1
- package/dist/index54.d.cts +58 -15
- package/dist/index54.d.cts.map +1 -1
- package/dist/index54.d.ts +58 -15
- package/dist/index54.d.ts.map +1 -1
- package/dist/index55.d.cts +93 -23
- package/dist/index55.d.cts.map +1 -1
- package/dist/index55.d.ts +93 -23
- package/dist/index55.d.ts.map +1 -1
- package/dist/index56.d.cts +27 -21
- package/dist/index56.d.cts.map +1 -1
- package/dist/index56.d.ts +27 -21
- package/dist/index56.d.ts.map +1 -1
- package/dist/index57.d.cts +203 -6
- package/dist/index57.d.cts.map +1 -1
- package/dist/index57.d.ts +203 -6
- package/dist/index57.d.ts.map +1 -1
- package/dist/index58.d.cts +17 -41
- package/dist/index58.d.cts.map +1 -1
- package/dist/index58.d.ts +17 -41
- package/dist/index58.d.ts.map +1 -1
- package/dist/index59.d.cts +24 -47
- package/dist/index59.d.cts.map +1 -1
- package/dist/index59.d.ts +24 -47
- package/dist/index59.d.ts.map +1 -1
- package/dist/index6.d.cts +5 -5
- package/dist/index6.d.cts.map +1 -1
- package/dist/index6.d.ts +6 -6
- package/dist/index60.d.cts +19 -57
- package/dist/index60.d.cts.map +1 -1
- package/dist/index60.d.ts +19 -57
- package/dist/index60.d.ts.map +1 -1
- package/dist/index61.d.cts +6 -39
- package/dist/index61.d.cts.map +1 -1
- package/dist/index61.d.ts +6 -39
- package/dist/index61.d.ts.map +1 -1
- package/dist/index62.d.cts +44 -18
- package/dist/index62.d.cts.map +1 -1
- package/dist/index62.d.ts +44 -18
- package/dist/index62.d.ts.map +1 -1
- package/dist/index63.d.cts +47 -41
- package/dist/index63.d.cts.map +1 -1
- package/dist/index63.d.ts +47 -41
- package/dist/index63.d.ts.map +1 -1
- package/dist/index64.d.cts +55 -15
- package/dist/index64.d.cts.map +1 -1
- package/dist/index64.d.ts +54 -14
- package/dist/index64.d.ts.map +1 -1
- package/dist/index65.d.cts +36 -39
- package/dist/index65.d.cts.map +1 -1
- package/dist/index65.d.ts +37 -40
- package/dist/index65.d.ts.map +1 -1
- package/dist/index66.d.cts +16 -17
- package/dist/index66.d.cts.map +1 -1
- package/dist/index66.d.ts +17 -18
- package/dist/index66.d.ts.map +1 -1
- package/dist/index67.d.cts +40 -14
- package/dist/index67.d.cts.map +1 -1
- package/dist/index67.d.ts +40 -14
- package/dist/index67.d.ts.map +1 -1
- package/dist/index68.d.cts +16 -30
- package/dist/index68.d.cts.map +1 -1
- package/dist/index68.d.ts +17 -31
- package/dist/index68.d.ts.map +1 -1
- package/dist/index69.d.cts +39 -27
- package/dist/index69.d.cts.map +1 -1
- package/dist/index69.d.ts +40 -28
- package/dist/index69.d.ts.map +1 -1
- package/dist/index7.d.cts +8 -8
- package/dist/index7.d.cts.map +1 -1
- package/dist/index7.d.ts +8 -8
- package/dist/index7.d.ts.map +1 -1
- package/dist/index70.d.cts +22 -78
- package/dist/index70.d.cts.map +1 -1
- package/dist/index70.d.ts +22 -78
- package/dist/index70.d.ts.map +1 -1
- package/dist/index71.d.cts +77 -251
- package/dist/index71.d.cts.map +1 -1
- package/dist/index71.d.ts +77 -251
- package/dist/index71.d.ts.map +1 -1
- package/dist/index72.d.cts +19 -0
- package/dist/index72.d.cts.map +1 -0
- package/dist/index72.d.ts +19 -0
- package/dist/index72.d.ts.map +1 -0
- package/dist/index73.d.cts +37 -0
- package/dist/index73.d.cts.map +1 -0
- package/dist/index73.d.ts +37 -0
- package/dist/index73.d.ts.map +1 -0
- package/dist/index74.d.cts +36 -0
- package/dist/index74.d.cts.map +1 -0
- package/dist/index74.d.ts +36 -0
- package/dist/index74.d.ts.map +1 -0
- package/dist/index75.d.cts +86 -0
- package/dist/index75.d.cts.map +1 -0
- package/dist/index75.d.ts +86 -0
- package/dist/index75.d.ts.map +1 -0
- package/dist/index76.d.cts +278 -0
- package/dist/index76.d.cts.map +1 -0
- package/dist/index76.d.ts +278 -0
- package/dist/index76.d.ts.map +1 -0
- package/dist/index8.d.cts +4 -4
- package/dist/index8.d.ts +5 -5
- package/dist/index9.d.cts +2 -2
- package/dist/index9.d.ts +2 -2
- package/dist/index9.d.ts.map +1 -1
- package/dist/layouts/Container/index.cjs +2 -1
- package/dist/layouts/Container/index.cjs.map +1 -1
- package/dist/layouts/Container/index.d.cts +1 -1
- package/dist/layouts/Container/index.d.ts +1 -1
- package/dist/layouts/Container/index.js +1 -1
- package/dist/layouts/MultiColumn/index.cjs +5 -0
- package/dist/layouts/MultiColumn/index.d.cts +2 -0
- package/dist/layouts/MultiColumn/index.d.ts +2 -0
- package/dist/layouts/MultiColumn/index.js +2 -0
- package/dist/layouts/PageBackground/index.d.cts +1 -1
- package/dist/layouts/PageBackground/index.d.ts +1 -1
- package/dist/layouts/Stack/index.cjs +2 -1
- package/dist/layouts/Stack/index.cjs.map +1 -1
- package/dist/layouts/Stack/index.d.cts +1 -1
- package/dist/layouts/Stack/index.d.ts +1 -1
- package/dist/layouts/Stack/index.js +1 -1
- package/dist/layouts/TwoColumn/index.cjs +2 -1
- package/dist/layouts/TwoColumn/index.cjs.map +1 -1
- package/dist/layouts/TwoColumn/index.d.cts +1 -1
- package/dist/layouts/TwoColumn/index.d.ts +1 -1
- package/dist/layouts/TwoColumn/index.js +1 -1
- package/dist/layouts/index.cjs +4 -0
- package/dist/layouts/index.d.cts +6 -5
- package/dist/layouts/index.d.ts +6 -5
- package/dist/layouts/index.js +2 -1
- package/dist/patterns/DataTable/index.cjs +6 -2
- package/dist/patterns/DataTable/index.cjs.map +1 -1
- package/dist/patterns/DataTable/index.d.cts +3 -3
- package/dist/patterns/DataTable/index.d.cts.map +1 -1
- package/dist/patterns/DataTable/index.d.ts +3 -3
- package/dist/patterns/DataTable/index.d.ts.map +1 -1
- package/dist/patterns/DataTable/index.js +6 -2
- package/dist/patterns/DataTable/index.js.map +1 -1
- package/dist/patterns/Footer/index.d.cts +7 -7
- package/dist/patterns/Footer/index.d.cts.map +1 -1
- package/dist/patterns/Footer/index.d.ts +7 -7
- package/dist/patterns/Footer/index.d.ts.map +1 -1
- package/dist/patterns/Header/index.d.cts +1 -1
- package/dist/patterns/Header/index.d.ts +1 -1
- package/dist/patterns/MediaObject/index.cjs +1 -1
- package/dist/patterns/MediaObject/index.d.cts +14 -14
- package/dist/patterns/MediaObject/index.d.cts.map +1 -1
- package/dist/patterns/MediaObject/index.d.ts +12 -12
- package/dist/patterns/MediaObject/index.js +1 -1
- package/dist/patterns/NavRail/index.cjs +4 -2
- package/dist/patterns/NavRail/index.cjs.map +1 -1
- package/dist/patterns/NavRail/index.d.cts +1 -1
- package/dist/patterns/NavRail/index.d.ts +1 -1
- package/dist/patterns/NavRail/index.js +4 -2
- package/dist/patterns/NavRail/index.js.map +1 -1
- package/dist/patterns/SectionCard/index.d.cts +2 -2
- package/dist/patterns/SectionCard/index.d.cts.map +1 -1
- package/dist/patterns/SectionCard/index.d.ts +2 -2
- package/dist/patterns/SectionCard/index.d.ts.map +1 -1
- package/dist/patterns/SectionHeading/index.d.cts +3 -3
- package/dist/patterns/SectionHeading/index.d.cts.map +1 -1
- package/dist/patterns/SectionHeading/index.d.ts +3 -3
- package/dist/patterns/SectionHeading/index.d.ts.map +1 -1
- package/dist/patterns/index.d.cts +2 -2
- package/dist/patterns/index.d.ts +2 -2
- package/dist/primitives/Accordion/index.cjs +6 -2
- package/dist/primitives/Accordion/index.cjs.map +1 -1
- package/dist/primitives/Accordion/index.js +6 -2
- package/dist/primitives/Accordion/index.js.map +1 -1
- package/dist/primitives/Alert/index.cjs +2 -1
- package/dist/primitives/Alert/index.cjs.map +1 -1
- package/dist/primitives/Alert/index.js +1 -1
- package/dist/primitives/AlertDialog/index.cjs +1 -1
- package/dist/primitives/AlertDialog/index.js +1 -1
- package/dist/primitives/AspectRatio/index.cjs +1 -1
- package/dist/primitives/AspectRatio/index.js +1 -1
- package/dist/primitives/Avatar/index.cjs +1 -1
- package/dist/primitives/Avatar/index.js +1 -1
- package/dist/primitives/Badge/index.cjs +3 -2
- package/dist/primitives/Badge/index.cjs.map +1 -1
- package/dist/primitives/Badge/index.js +2 -2
- package/dist/primitives/Breadcrumb/index.cjs +7 -3
- package/dist/primitives/Breadcrumb/index.cjs.map +1 -1
- package/dist/primitives/Breadcrumb/index.js +7 -3
- package/dist/primitives/Breadcrumb/index.js.map +1 -1
- package/dist/primitives/Button/index.cjs +3 -2
- package/dist/primitives/Button/index.cjs.map +1 -1
- package/dist/primitives/Button/index.js +2 -2
- package/dist/primitives/ButtonGroup/index.cjs +3 -2
- package/dist/primitives/ButtonGroup/index.cjs.map +1 -1
- package/dist/primitives/ButtonGroup/index.js +2 -2
- package/dist/primitives/Calendar/index.cjs +12 -11
- package/dist/primitives/Calendar/index.cjs.map +1 -1
- package/dist/primitives/Calendar/index.js +12 -11
- package/dist/primitives/Calendar/index.js.map +1 -1
- package/dist/primitives/Card/index.cjs +2 -1
- package/dist/primitives/Card/index.cjs.map +1 -1
- package/dist/primitives/Card/index.js +1 -1
- package/dist/primitives/Carousel/index.cjs +4 -3
- package/dist/primitives/Carousel/index.cjs.map +1 -1
- package/dist/primitives/Carousel/index.js +4 -3
- package/dist/primitives/Carousel/index.js.map +1 -1
- package/dist/primitives/Checkbox/index.cjs +10 -3
- package/dist/primitives/Checkbox/index.cjs.map +1 -1
- package/dist/primitives/Checkbox/index.d.cts +1 -1
- package/dist/primitives/Checkbox/index.d.ts +1 -1
- package/dist/primitives/Checkbox/index.js +10 -3
- package/dist/primitives/Checkbox/index.js.map +1 -1
- package/dist/primitives/CheckboxTree/index.cjs +6 -2
- package/dist/primitives/CheckboxTree/index.cjs.map +1 -1
- package/dist/primitives/CheckboxTree/index.d.cts +1 -1
- package/dist/primitives/CheckboxTree/index.d.ts +1 -1
- package/dist/primitives/CheckboxTree/index.js +6 -2
- package/dist/primitives/CheckboxTree/index.js.map +1 -1
- package/dist/primitives/CircularProgress/index.cjs +106 -0
- package/dist/primitives/CircularProgress/index.cjs.map +1 -0
- package/dist/primitives/CircularProgress/index.d.cts +2 -0
- package/dist/primitives/CircularProgress/index.d.ts +2 -0
- package/dist/primitives/CircularProgress/index.js +105 -0
- package/dist/primitives/CircularProgress/index.js.map +1 -0
- package/dist/primitives/Collapsible/index.cjs +1 -1
- package/dist/primitives/Collapsible/index.d.cts +1 -1
- package/dist/primitives/Collapsible/index.d.ts +1 -1
- package/dist/primitives/Collapsible/index.js +1 -1
- package/dist/primitives/Command/index.cjs +6 -2
- package/dist/primitives/Command/index.cjs.map +1 -1
- package/dist/primitives/Command/index.d.cts +1 -1
- package/dist/primitives/Command/index.d.ts +1 -1
- package/dist/primitives/Command/index.js +6 -2
- package/dist/primitives/Command/index.js.map +1 -1
- package/dist/primitives/ContextMenu/index.cjs +14 -4
- package/dist/primitives/ContextMenu/index.cjs.map +1 -1
- package/dist/primitives/ContextMenu/index.d.cts +1 -1
- package/dist/primitives/ContextMenu/index.d.ts +1 -1
- package/dist/primitives/ContextMenu/index.js +14 -4
- package/dist/primitives/ContextMenu/index.js.map +1 -1
- package/dist/primitives/Credits/index.cjs +8 -3
- package/dist/primitives/Credits/index.cjs.map +1 -1
- package/dist/primitives/Credits/index.d.cts +1 -1
- package/dist/primitives/Credits/index.d.ts +1 -1
- package/dist/primitives/Credits/index.js +7 -3
- package/dist/primitives/Credits/index.js.map +1 -1
- package/dist/primitives/Dialog/index.cjs +3 -2
- package/dist/primitives/Dialog/index.cjs.map +1 -1
- package/dist/primitives/Dialog/index.d.cts +1 -1
- package/dist/primitives/Dialog/index.d.ts +1 -1
- package/dist/primitives/Dialog/index.js +3 -2
- package/dist/primitives/Dialog/index.js.map +1 -1
- package/dist/primitives/Drawer/index.cjs +34 -2
- package/dist/primitives/Drawer/index.cjs.map +1 -1
- package/dist/primitives/Drawer/index.d.cts +1 -1
- package/dist/primitives/Drawer/index.d.ts +1 -1
- package/dist/primitives/Drawer/index.js +34 -2
- package/dist/primitives/Drawer/index.js.map +1 -1
- package/dist/primitives/DropdownMenu/index.cjs +14 -4
- package/dist/primitives/DropdownMenu/index.cjs.map +1 -1
- package/dist/primitives/DropdownMenu/index.d.cts +1 -1
- package/dist/primitives/DropdownMenu/index.d.ts +1 -1
- package/dist/primitives/DropdownMenu/index.js +14 -4
- package/dist/primitives/DropdownMenu/index.js.map +1 -1
- package/dist/primitives/Empty/index.cjs +1 -1
- package/dist/primitives/Empty/index.d.cts +1 -1
- package/dist/primitives/Empty/index.d.ts +1 -1
- package/dist/primitives/Empty/index.js +1 -1
- package/dist/primitives/Field/index.cjs +1 -1
- package/dist/primitives/Field/index.d.cts +1 -1
- package/dist/primitives/Field/index.d.ts +1 -1
- package/dist/primitives/Field/index.js +1 -1
- package/dist/primitives/FileUpload/index.cjs +354 -0
- package/dist/primitives/FileUpload/index.cjs.map +1 -0
- package/dist/primitives/FileUpload/index.d.cts +2 -0
- package/dist/primitives/FileUpload/index.d.ts +2 -0
- package/dist/primitives/FileUpload/index.js +351 -0
- package/dist/primitives/FileUpload/index.js.map +1 -0
- package/dist/primitives/Form/index.cjs +1 -1
- package/dist/primitives/Form/index.d.cts +1 -1
- package/dist/primitives/Form/index.d.ts +1 -1
- package/dist/primitives/Form/index.js +1 -1
- package/dist/primitives/Heading/index.cjs +2 -1
- package/dist/primitives/Heading/index.cjs.map +1 -1
- package/dist/primitives/Heading/index.d.cts +1 -1
- package/dist/primitives/Heading/index.d.ts +1 -1
- package/dist/primitives/Heading/index.js +1 -1
- package/dist/primitives/HoverCard/index.cjs +1 -1
- package/dist/primitives/HoverCard/index.d.cts +1 -1
- package/dist/primitives/HoverCard/index.d.ts +1 -1
- package/dist/primitives/HoverCard/index.js +1 -1
- package/dist/primitives/Icon/index.d.cts +1 -1
- package/dist/primitives/Icon/index.d.ts +1 -1
- package/dist/primitives/InfoBanner/index.cjs +6 -3
- package/dist/primitives/InfoBanner/index.cjs.map +1 -1
- package/dist/primitives/InfoBanner/index.d.cts +1 -1
- package/dist/primitives/InfoBanner/index.d.ts +1 -1
- package/dist/primitives/InfoBanner/index.js +5 -3
- package/dist/primitives/InfoBanner/index.js.map +1 -1
- package/dist/primitives/Input/index.cjs +2 -1
- package/dist/primitives/Input/index.cjs.map +1 -1
- package/dist/primitives/Input/index.d.cts +1 -1
- package/dist/primitives/Input/index.d.ts +1 -1
- package/dist/primitives/Input/index.js +1 -1
- package/dist/primitives/InputGroup/index.cjs +1 -1
- package/dist/primitives/InputGroup/index.d.cts +1 -1
- package/dist/primitives/InputGroup/index.d.ts +1 -1
- package/dist/primitives/InputGroup/index.js +1 -1
- package/dist/primitives/InputOtp/index.cjs +3 -2
- package/dist/primitives/InputOtp/index.cjs.map +1 -1
- package/dist/primitives/InputOtp/index.d.cts +1 -1
- package/dist/primitives/InputOtp/index.d.ts +1 -1
- package/dist/primitives/InputOtp/index.js +3 -2
- package/dist/primitives/InputOtp/index.js.map +1 -1
- package/dist/primitives/Item/index.cjs +2 -2
- package/dist/primitives/Item/index.d.cts +1 -1
- package/dist/primitives/Item/index.d.ts +1 -1
- package/dist/primitives/Item/index.js +2 -2
- package/dist/primitives/Kbd/index.d.cts +1 -1
- package/dist/primitives/Kbd/index.d.ts +1 -1
- package/dist/primitives/Label/index.cjs +1 -1
- package/dist/primitives/Label/index.d.cts +1 -1
- package/dist/primitives/Label/index.d.ts +1 -1
- package/dist/primitives/Label/index.js +1 -1
- package/dist/primitives/Link/index.cjs +3 -2
- package/dist/primitives/Link/index.cjs.map +1 -1
- package/dist/primitives/Link/index.d.cts +1 -1
- package/dist/primitives/Link/index.d.ts +1 -1
- package/dist/primitives/Link/index.js +2 -2
- package/dist/primitives/Logo/index.d.cts +1 -1
- package/dist/primitives/Logo/index.d.ts +1 -1
- package/dist/primitives/Menubar/index.cjs +14 -4
- package/dist/primitives/Menubar/index.cjs.map +1 -1
- package/dist/primitives/Menubar/index.d.cts +1 -1
- package/dist/primitives/Menubar/index.d.ts +1 -1
- package/dist/primitives/Menubar/index.js +14 -4
- package/dist/primitives/Menubar/index.js.map +1 -1
- package/dist/primitives/Mosaic/index.cjs +4 -0
- package/dist/primitives/Mosaic/index.d.cts +2 -0
- package/dist/primitives/Mosaic/index.d.ts +2 -0
- package/dist/primitives/Mosaic/index.js +2 -0
- package/dist/primitives/NativeSelect/index.cjs +6 -3
- package/dist/primitives/NativeSelect/index.cjs.map +1 -1
- package/dist/primitives/NativeSelect/index.d.cts +1 -1
- package/dist/primitives/NativeSelect/index.d.ts +1 -1
- package/dist/primitives/NativeSelect/index.js +5 -3
- package/dist/primitives/NativeSelect/index.js.map +1 -1
- package/dist/primitives/NavRail/index.d.cts +2 -2
- package/dist/primitives/NavRail/index.d.ts +2 -2
- package/dist/primitives/NavigationMenu/index.cjs +5 -3
- package/dist/primitives/NavigationMenu/index.cjs.map +1 -1
- package/dist/primitives/NavigationMenu/index.d.cts +1 -1
- package/dist/primitives/NavigationMenu/index.d.ts +1 -1
- package/dist/primitives/NavigationMenu/index.js +5 -3
- package/dist/primitives/NavigationMenu/index.js.map +1 -1
- package/dist/primitives/NotchedCard/index.cjs +390 -0
- package/dist/primitives/NotchedCard/index.cjs.map +1 -0
- package/dist/primitives/NotchedCard/index.d.cts +2 -0
- package/dist/primitives/NotchedCard/index.d.ts +2 -0
- package/dist/primitives/NotchedCard/index.js +385 -0
- package/dist/primitives/NotchedCard/index.js.map +1 -0
- package/dist/primitives/Pagination/index.cjs +6 -2
- package/dist/primitives/Pagination/index.cjs.map +1 -1
- package/dist/primitives/Pagination/index.d.cts +1 -1
- package/dist/primitives/Pagination/index.d.ts +1 -1
- package/dist/primitives/Pagination/index.js +6 -2
- package/dist/primitives/Pagination/index.js.map +1 -1
- package/dist/primitives/Popover/index.cjs +1 -1
- package/dist/primitives/Popover/index.d.cts +1 -1
- package/dist/primitives/Popover/index.d.ts +1 -1
- package/dist/primitives/Popover/index.js +1 -1
- package/dist/primitives/Progress/index.cjs +1 -1
- package/dist/primitives/Progress/index.d.cts +1 -1
- package/dist/primitives/Progress/index.d.ts +1 -1
- package/dist/primitives/Progress/index.js +1 -1
- package/dist/primitives/RadioGroup/index.cjs +7 -3
- package/dist/primitives/RadioGroup/index.cjs.map +1 -1
- package/dist/primitives/RadioGroup/index.d.cts +1 -1
- package/dist/primitives/RadioGroup/index.d.ts +1 -1
- package/dist/primitives/RadioGroup/index.js +7 -3
- package/dist/primitives/RadioGroup/index.js.map +1 -1
- package/dist/primitives/Resizable/index.cjs +6 -2
- package/dist/primitives/Resizable/index.cjs.map +1 -1
- package/dist/primitives/Resizable/index.d.cts +1 -1
- package/dist/primitives/Resizable/index.d.ts +1 -1
- package/dist/primitives/Resizable/index.js +6 -2
- package/dist/primitives/Resizable/index.js.map +1 -1
- package/dist/primitives/ScrollArea/index.cjs +1 -1
- package/dist/primitives/ScrollArea/index.d.cts +1 -1
- package/dist/primitives/ScrollArea/index.d.ts +1 -1
- package/dist/primitives/ScrollArea/index.js +1 -1
- package/dist/primitives/Select/index.cjs +18 -5
- package/dist/primitives/Select/index.cjs.map +1 -1
- package/dist/primitives/Select/index.d.cts +1 -1
- package/dist/primitives/Select/index.d.ts +1 -1
- package/dist/primitives/Select/index.js +18 -5
- package/dist/primitives/Select/index.js.map +1 -1
- package/dist/primitives/Separator/index.cjs +1 -1
- package/dist/primitives/Separator/index.js +1 -1
- package/dist/primitives/Sheet/index.cjs +40 -4
- package/dist/primitives/Sheet/index.cjs.map +1 -1
- package/dist/primitives/Sheet/index.d.cts +1 -1
- package/dist/primitives/Sheet/index.d.ts +1 -1
- package/dist/primitives/Sheet/index.js +40 -4
- package/dist/primitives/Sheet/index.js.map +1 -1
- package/dist/primitives/Sidebar/index.d.cts +1 -1
- package/dist/primitives/Sidebar/index.d.ts +1 -1
- package/dist/primitives/Skeleton/index.d.cts +1 -1
- package/dist/primitives/Skeleton/index.d.ts +1 -1
- package/dist/primitives/Slider/index.cjs +1 -1
- package/dist/primitives/Slider/index.d.cts +1 -1
- package/dist/primitives/Slider/index.d.ts +1 -1
- package/dist/primitives/Slider/index.js +1 -1
- package/dist/primitives/Sonner/index.cjs +22 -6
- package/dist/primitives/Sonner/index.cjs.map +1 -1
- package/dist/primitives/Sonner/index.d.cts +1 -1
- package/dist/primitives/Sonner/index.d.ts +1 -1
- package/dist/primitives/Sonner/index.js +22 -6
- package/dist/primitives/Sonner/index.js.map +1 -1
- package/dist/primitives/Spinner/index.cjs +4 -2
- package/dist/primitives/Spinner/index.cjs.map +1 -1
- package/dist/primitives/Spinner/index.d.cts +1 -1
- package/dist/primitives/Spinner/index.d.ts +1 -1
- package/dist/primitives/Spinner/index.js +4 -2
- package/dist/primitives/Spinner/index.js.map +1 -1
- package/dist/primitives/Switch/index.cjs +1 -1
- package/dist/primitives/Switch/index.d.cts +1 -1
- package/dist/primitives/Switch/index.d.ts +1 -1
- package/dist/primitives/Switch/index.js +1 -1
- package/dist/primitives/Table/index.d.cts +1 -1
- package/dist/primitives/Table/index.d.ts +1 -1
- package/dist/primitives/Tabs/index.cjs +2 -2
- package/dist/primitives/Tabs/index.d.cts +1 -1
- package/dist/primitives/Tabs/index.d.ts +1 -1
- package/dist/primitives/Tabs/index.js +2 -2
- package/dist/primitives/Text/index.cjs +2 -1
- package/dist/primitives/Text/index.cjs.map +1 -1
- package/dist/primitives/Text/index.d.cts +1 -1
- package/dist/primitives/Text/index.d.ts +1 -1
- package/dist/primitives/Text/index.js +1 -1
- package/dist/primitives/Textarea/index.cjs +2 -1
- package/dist/primitives/Textarea/index.cjs.map +1 -1
- package/dist/primitives/Textarea/index.d.cts +1 -1
- package/dist/primitives/Textarea/index.d.ts +1 -1
- package/dist/primitives/Textarea/index.js +1 -1
- package/dist/primitives/ThemeProvider/index.d.cts +1 -1
- package/dist/primitives/ThemeProvider/index.d.ts +1 -1
- package/dist/primitives/Toggle/index.cjs +3 -2
- package/dist/primitives/Toggle/index.cjs.map +1 -1
- package/dist/primitives/Toggle/index.d.cts +1 -1
- package/dist/primitives/Toggle/index.d.ts +1 -1
- package/dist/primitives/Toggle/index.js +2 -2
- package/dist/primitives/ToggleGroup/index.cjs +1 -1
- package/dist/primitives/ToggleGroup/index.d.cts +1 -1
- package/dist/primitives/ToggleGroup/index.d.ts +1 -1
- package/dist/primitives/ToggleGroup/index.js +1 -1
- package/dist/primitives/Tooltip/index.cjs +1 -1
- package/dist/primitives/Tooltip/index.d.cts +1 -1
- package/dist/primitives/Tooltip/index.d.ts +1 -1
- package/dist/primitives/Tooltip/index.js +1 -1
- package/dist/primitives/index.cjs +14 -3
- package/dist/primitives/index.d.cts +55 -51
- package/dist/primitives/index.d.ts +55 -51
- package/dist/primitives/index.js +8 -4
- package/package.json +2 -1
- package/dist/index47.d.cts.map +0 -1
- package/dist/index47.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as creditsVariants, n as CreditsProps, r as CreditsVariant, t as Credits } from "../../
|
|
1
|
+
import { i as creditsVariants, n as CreditsProps, r as CreditsVariant, t as Credits } from "../../index22.cjs";
|
|
2
2
|
export { Credits, CreditsProps, CreditsVariant, creditsVariants };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as creditsVariants, n as CreditsProps, r as CreditsVariant, t as Credits } from "../../
|
|
1
|
+
import { i as creditsVariants, n as CreditsProps, r as CreditsVariant, t as Credits } from "../../index22.js";
|
|
2
2
|
export { Credits, CreditsProps, CreditsVariant, creditsVariants };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as cn } from "../../cn.js";
|
|
2
|
-
import {
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { t as Icon } from "../../Icon.js";
|
|
4
3
|
import { cva } from "class-variance-authority";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { CirclePlus } from "lucide-react";
|
|
5
6
|
//#region src/primitives/Credits/Credits.tsx
|
|
6
7
|
const creditsVariants = cva("inline-flex w-fit items-center gap-1 rounded-8 px-2 py-0.5 text-xs leading-4 font-semibold tabular-nums whitespace-nowrap [&>svg]:size-3 [&>svg]:shrink-0", {
|
|
7
8
|
variants: { variant: {
|
|
@@ -29,7 +30,10 @@ function Credits({ className, value, variant, lowThreshold = 200, icon, format =
|
|
|
29
30
|
"data-variant": resolved,
|
|
30
31
|
className: cn(creditsVariants({ variant: resolved }), className),
|
|
31
32
|
...props,
|
|
32
|
-
children: [icon ?? /* @__PURE__ */ jsx(
|
|
33
|
+
children: [icon ?? /* @__PURE__ */ jsx(Icon, {
|
|
34
|
+
as: CirclePlus,
|
|
35
|
+
"aria-hidden": "true"
|
|
36
|
+
}), format(value)]
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
39
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Credits/Credits.tsx"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport { CirclePlus } from \"lucide-react\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n// Credits — a pill showing a remaining-credits balance. Badge-like, but its own\n// primitive: the colour escalates with how low the balance is (Figma): neutral\n// when healthy, soft amber when low, soft red at zero. The variant is derived\n// from `value` (override with `variant`), and the value is formatted for display.\n\nexport type CreditsVariant = \"default\" | \"warning\" | \"critical\";\n\nconst creditsVariants = cva(\n \"inline-flex w-fit items-center gap-1 rounded-8 px-2 py-0.5 text-xs leading-4 font-semibold tabular-nums whitespace-nowrap [&>svg]:size-3 [&>svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"border border-primary-border bg-outline-bg text-primary-txt\",\n warning: \"border border-transparent bg-warning-bg text-warning-txt\",\n critical: \"border border-transparent bg-danger-bg text-danger-txt\",\n },\n },\n defaultVariants: { variant: \"default\" },\n },\n);\n\n/** Escalate the variant as the balance drops. */\nfunction resolveVariant(value: number, lowThreshold: number): CreditsVariant {\n if (value <= 0) return \"critical\";\n if (value <= lowThreshold) return \"warning\";\n return \"default\";\n}\n\n/** Whole-number, thousands-separated (e.g. 9995.79 → \"9,995\"). */\nfunction formatCredits(value: number): string {\n return Math.floor(value).toLocaleString();\n}\n\ntype CreditsProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n /** The numeric balance to display. */\n value: number;\n /** Force a variant; by default it is derived from `value`. */\n variant?: CreditsVariant;\n /** Balance at/below which the warning variant kicks in. Default 200. */\n lowThreshold?: number;\n /** Override the leading icon. */\n icon?: React.ReactNode;\n /** Override how the value is rendered. */\n format?: (value: number) => string;\n};\n\n/** A pill showing a remaining-credits balance, colour-escalating as it drops. */\nfunction Credits({\n className,\n value,\n variant,\n lowThreshold = 200,\n icon,\n format = formatCredits,\n ...props\n}: CreditsProps) {\n const resolved = variant ?? resolveVariant(value, lowThreshold);\n return (\n <span\n data-slot=\"credits\"\n data-variant={resolved}\n className={cn(creditsVariants({ variant: resolved }), className)}\n {...props}\n >\n {icon ?? <CirclePlus aria-hidden=\"true\" />}\n {format(value)}\n </span>\n );\n}\n\nexport { Credits, creditsVariants, type CreditsProps };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Credits/Credits.tsx"],"sourcesContent":["import { Icon } from \"@/primitives/Icon\";\nimport { cva } from \"class-variance-authority\";\nimport { CirclePlus } from \"lucide-react\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n// Credits — a pill showing a remaining-credits balance. Badge-like, but its own\n// primitive: the colour escalates with how low the balance is (Figma): neutral\n// when healthy, soft amber when low, soft red at zero. The variant is derived\n// from `value` (override with `variant`), and the value is formatted for display.\n\nexport type CreditsVariant = \"default\" | \"warning\" | \"critical\";\n\nconst creditsVariants = cva(\n \"inline-flex w-fit items-center gap-1 rounded-8 px-2 py-0.5 text-xs leading-4 font-semibold tabular-nums whitespace-nowrap [&>svg]:size-3 [&>svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"border border-primary-border bg-outline-bg text-primary-txt\",\n warning: \"border border-transparent bg-warning-bg text-warning-txt\",\n critical: \"border border-transparent bg-danger-bg text-danger-txt\",\n },\n },\n defaultVariants: { variant: \"default\" },\n },\n);\n\n/** Escalate the variant as the balance drops. */\nfunction resolveVariant(value: number, lowThreshold: number): CreditsVariant {\n if (value <= 0) return \"critical\";\n if (value <= lowThreshold) return \"warning\";\n return \"default\";\n}\n\n/** Whole-number, thousands-separated (e.g. 9995.79 → \"9,995\"). */\nfunction formatCredits(value: number): string {\n return Math.floor(value).toLocaleString();\n}\n\ntype CreditsProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n /** The numeric balance to display. */\n value: number;\n /** Force a variant; by default it is derived from `value`. */\n variant?: CreditsVariant;\n /** Balance at/below which the warning variant kicks in. Default 200. */\n lowThreshold?: number;\n /** Override the leading icon. */\n icon?: React.ReactNode;\n /** Override how the value is rendered. */\n format?: (value: number) => string;\n};\n\n/** A pill showing a remaining-credits balance, colour-escalating as it drops. */\nfunction Credits({\n className,\n value,\n variant,\n lowThreshold = 200,\n icon,\n format = formatCredits,\n ...props\n}: CreditsProps) {\n const resolved = variant ?? resolveVariant(value, lowThreshold);\n return (\n <span\n data-slot=\"credits\"\n data-variant={resolved}\n className={cn(creditsVariants({ variant: resolved }), className)}\n {...props}\n >\n {icon ?? <Icon as={CirclePlus} aria-hidden=\"true\" />}\n {format(value)}\n </span>\n );\n}\n\nexport { Credits, creditsVariants, type CreditsProps };\n"],"mappings":";;;;;;AAcA,MAAM,kBAAkB,IACtB,6JACA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,SAAS;EACT,UAAU;CACZ,EACF;CACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CACF;;AAGA,SAAS,eAAe,OAAe,cAAsC;CAC3E,IAAI,SAAS,GAAG,OAAO;CACvB,IAAI,SAAS,cAAc,OAAO;CAClC,OAAO;AACT;;AAGA,SAAS,cAAc,OAAuB;CAC5C,OAAO,KAAK,MAAM,KAAK,EAAE,eAAe;AAC1C;;AAgBA,SAAS,QAAQ,EACf,WACA,OACA,SACA,eAAe,KACf,MACA,SAAS,eACT,GAAG,SACY;CACf,MAAM,WAAW,WAAW,eAAe,OAAO,YAAY;CAC9D,OACE,qBAAC,QAAD;EACE,aAAU;EACV,gBAAc;EACd,WAAW,GAAG,gBAAgB,EAAE,SAAS,SAAS,CAAC,GAAG,SAAS;EAC/D,GAAI;YAJN,CAMG,QAAQ,oBAAC,MAAD;GAAM,IAAI;GAAY,eAAY;EAAQ,CAAA,GAClD,OAAO,KAAK,CACT;;AAEV"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_cn = require("../../cn.cjs");
|
|
3
|
+
const require_Icon = require("../../Icon.cjs");
|
|
3
4
|
const require_primitives_Button_index = require("../Button/index.cjs");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
6
|
let lucide_react = require("lucide-react");
|
|
5
7
|
let radix_ui = require("radix-ui");
|
|
6
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
8
|
//#region src/primitives/Dialog/Dialog.tsx
|
|
8
9
|
/** Modal dialog root — owns open/closed state and renders its content in a portal. */
|
|
9
10
|
function Dialog({ ...props }) {
|
|
@@ -59,7 +60,7 @@ function DialogContent({ className, children, size = "default", showCloseButton
|
|
|
59
60
|
children: [children, showCloseButton && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(radix_ui.Dialog.Close, {
|
|
60
61
|
"data-slot": "dialog-close",
|
|
61
62
|
className: "absolute top-4 right-4 rounded-2 opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-focus focus-visible:ring-3 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
62
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.XIcon
|
|
63
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, { as: lucide_react.XIcon }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
63
64
|
className: "sr-only",
|
|
64
65
|
children: "Close"
|
|
65
66
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["DialogPrimitive","cn","XIcon","Button"],"sources":["../../../src/primitives/Dialog/Dialog.tsx"],"sourcesContent":["import { XIcon } from \"lucide-react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { Button } from \"@/primitives/Button\";\nimport { cn } from \"@/utils\";\n\n/** Modal dialog root — owns open/closed state and renders its content in a portal. */\nfunction Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\n/** Element that toggles the dialog open when activated. */\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\n/** Portals the dialog overlay and content to the document body. */\nfunction DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\n/** Element that closes the dialog when activated. */\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\n/** Dimmed backdrop rendered behind the dialog content. */\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-overlay-bg 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\nconst dialogSizes = {\n sm: \"sm:max-w-sm\",\n default: \"sm:max-w-lg\",\n lg: \"sm:max-w-2xl\",\n xl: \"sm:max-w-4xl\",\n} as const;\n\n/** The dialog panel: centered, animated content with overlay and optional close button. */\nfunction DialogContent({\n className,\n children,\n size = \"default\",\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n /** Width preset for the panel. */\n size?: keyof typeof dialogSizes;\n /** Whether to render the top-right \"X\" close button. */\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n data-size={size}\n className={cn(\n \"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-16 border bg-primary-bg p-6 shadow-lg duration-200 outline-none 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 dialogSizes[size],\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"absolute top-4 right-4 rounded-2 opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-focus focus-visible:ring-3 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\n/** Top section of the dialog, holds the title and description. */\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\n/** Bottom action row of the dialog, with an optional built-in Close button. */\nfunction DialogFooter({\n className,\n showCloseButton = false,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Whether to append a built-in outline \"Close\" button after the children. */\n showCloseButton?: boolean;\n}) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\"flex flex-col-reverse gap-3 sm:flex-row sm:justify-end\", className)}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outline\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n );\n}\n\n/** Accessible heading for the dialog (announced to screen readers). */\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\n \"font-heading text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Supporting text beneath the dialog title (linked for assistive tech). */\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-sm leading-5 text-secondary-txt\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["DialogPrimitive","cn","Icon","XIcon","Button"],"sources":["../../../src/primitives/Dialog/Dialog.tsx"],"sourcesContent":["import { XIcon } from \"lucide-react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { Button } from \"@/primitives/Button\";\nimport { Icon } from \"@/primitives/Icon\";\nimport { cn } from \"@/utils\";\n\n/** Modal dialog root — owns open/closed state and renders its content in a portal. */\nfunction Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\n/** Element that toggles the dialog open when activated. */\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\n/** Portals the dialog overlay and content to the document body. */\nfunction DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\n/** Element that closes the dialog when activated. */\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\n/** Dimmed backdrop rendered behind the dialog content. */\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-overlay-bg 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\nconst dialogSizes = {\n sm: \"sm:max-w-sm\",\n default: \"sm:max-w-lg\",\n lg: \"sm:max-w-2xl\",\n xl: \"sm:max-w-4xl\",\n} as const;\n\n/** The dialog panel: centered, animated content with overlay and optional close button. */\nfunction DialogContent({\n className,\n children,\n size = \"default\",\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n /** Width preset for the panel. */\n size?: keyof typeof dialogSizes;\n /** Whether to render the top-right \"X\" close button. */\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n data-size={size}\n className={cn(\n \"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-16 border bg-primary-bg p-6 shadow-lg duration-200 outline-none 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 dialogSizes[size],\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"absolute top-4 right-4 rounded-2 opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-focus focus-visible:ring-3 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <Icon as={XIcon} />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\n/** Top section of the dialog, holds the title and description. */\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\n/** Bottom action row of the dialog, with an optional built-in Close button. */\nfunction DialogFooter({\n className,\n showCloseButton = false,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Whether to append a built-in outline \"Close\" button after the children. */\n showCloseButton?: boolean;\n}) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\"flex flex-col-reverse gap-3 sm:flex-row sm:justify-end\", className)}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outline\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n );\n}\n\n/** Accessible heading for the dialog (announced to screen readers). */\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\n \"font-heading text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Supporting text beneath the dialog title (linked for assistive tech). */\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-sm leading-5 text-secondary-txt\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as DialogFooter, c as DialogPortal, i as DialogDescription, l as DialogTitle, n as DialogClose, o as DialogHeader, r as DialogContent, s as DialogOverlay, t as Dialog, u as DialogTrigger } from "../../
|
|
1
|
+
import { a as DialogFooter, c as DialogPortal, i as DialogDescription, l as DialogTitle, n as DialogClose, o as DialogHeader, r as DialogContent, s as DialogOverlay, t as Dialog, u as DialogTrigger } from "../../index19.cjs";
|
|
2
2
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as DialogFooter, c as DialogPortal, i as DialogDescription, l as DialogTitle, n as DialogClose, o as DialogHeader, r as DialogContent, s as DialogOverlay, t as Dialog, u as DialogTrigger } from "../../
|
|
1
|
+
import { a as DialogFooter, c as DialogPortal, i as DialogDescription, l as DialogTitle, n as DialogClose, o as DialogHeader, r as DialogContent, s as DialogOverlay, t as Dialog, u as DialogTrigger } from "../../index19.js";
|
|
2
2
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { t as cn } from "../../cn.js";
|
|
2
|
+
import { t as Icon } from "../../Icon.js";
|
|
2
3
|
import { Button } from "../Button/index.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
5
|
import { XIcon } from "lucide-react";
|
|
4
6
|
import { Dialog as Dialog$1 } from "radix-ui";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
//#region src/primitives/Dialog/Dialog.tsx
|
|
7
8
|
/** Modal dialog root — owns open/closed state and renders its content in a portal. */
|
|
8
9
|
function Dialog({ ...props }) {
|
|
@@ -58,7 +59,7 @@ function DialogContent({ className, children, size = "default", showCloseButton
|
|
|
58
59
|
children: [children, showCloseButton && /* @__PURE__ */ jsxs(Dialog$1.Close, {
|
|
59
60
|
"data-slot": "dialog-close",
|
|
60
61
|
className: "absolute top-4 right-4 rounded-2 opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-focus focus-visible:ring-3 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
61
|
-
children: [/* @__PURE__ */ jsx(
|
|
62
|
+
children: [/* @__PURE__ */ jsx(Icon, { as: XIcon }), /* @__PURE__ */ jsx("span", {
|
|
62
63
|
className: "sr-only",
|
|
63
64
|
children: "Close"
|
|
64
65
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DialogPrimitive"],"sources":["../../../src/primitives/Dialog/Dialog.tsx"],"sourcesContent":["import { XIcon } from \"lucide-react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { Button } from \"@/primitives/Button\";\nimport { cn } from \"@/utils\";\n\n/** Modal dialog root — owns open/closed state and renders its content in a portal. */\nfunction Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\n/** Element that toggles the dialog open when activated. */\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\n/** Portals the dialog overlay and content to the document body. */\nfunction DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\n/** Element that closes the dialog when activated. */\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\n/** Dimmed backdrop rendered behind the dialog content. */\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-overlay-bg 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\nconst dialogSizes = {\n sm: \"sm:max-w-sm\",\n default: \"sm:max-w-lg\",\n lg: \"sm:max-w-2xl\",\n xl: \"sm:max-w-4xl\",\n} as const;\n\n/** The dialog panel: centered, animated content with overlay and optional close button. */\nfunction DialogContent({\n className,\n children,\n size = \"default\",\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n /** Width preset for the panel. */\n size?: keyof typeof dialogSizes;\n /** Whether to render the top-right \"X\" close button. */\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n data-size={size}\n className={cn(\n \"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-16 border bg-primary-bg p-6 shadow-lg duration-200 outline-none 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 dialogSizes[size],\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"absolute top-4 right-4 rounded-2 opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-focus focus-visible:ring-3 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\n/** Top section of the dialog, holds the title and description. */\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\n/** Bottom action row of the dialog, with an optional built-in Close button. */\nfunction DialogFooter({\n className,\n showCloseButton = false,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Whether to append a built-in outline \"Close\" button after the children. */\n showCloseButton?: boolean;\n}) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\"flex flex-col-reverse gap-3 sm:flex-row sm:justify-end\", className)}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outline\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n );\n}\n\n/** Accessible heading for the dialog (announced to screen readers). */\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\n \"font-heading text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Supporting text beneath the dialog title (linked for assistive tech). */\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-sm leading-5 text-secondary-txt\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["DialogPrimitive"],"sources":["../../../src/primitives/Dialog/Dialog.tsx"],"sourcesContent":["import { XIcon } from \"lucide-react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { Button } from \"@/primitives/Button\";\nimport { Icon } from \"@/primitives/Icon\";\nimport { cn } from \"@/utils\";\n\n/** Modal dialog root — owns open/closed state and renders its content in a portal. */\nfunction Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\n/** Element that toggles the dialog open when activated. */\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\n/** Portals the dialog overlay and content to the document body. */\nfunction DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\n/** Element that closes the dialog when activated. */\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\n/** Dimmed backdrop rendered behind the dialog content. */\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-overlay-bg 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\nconst dialogSizes = {\n sm: \"sm:max-w-sm\",\n default: \"sm:max-w-lg\",\n lg: \"sm:max-w-2xl\",\n xl: \"sm:max-w-4xl\",\n} as const;\n\n/** The dialog panel: centered, animated content with overlay and optional close button. */\nfunction DialogContent({\n className,\n children,\n size = \"default\",\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n /** Width preset for the panel. */\n size?: keyof typeof dialogSizes;\n /** Whether to render the top-right \"X\" close button. */\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n data-size={size}\n className={cn(\n \"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-16 border bg-primary-bg p-6 shadow-lg duration-200 outline-none 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 dialogSizes[size],\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"absolute top-4 right-4 rounded-2 opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-focus focus-visible:ring-3 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <Icon as={XIcon} />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\n/** Top section of the dialog, holds the title and description. */\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\n/** Bottom action row of the dialog, with an optional built-in Close button. */\nfunction DialogFooter({\n className,\n showCloseButton = false,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Whether to append a built-in outline \"Close\" button after the children. */\n showCloseButton?: boolean;\n}) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\"flex flex-col-reverse gap-3 sm:flex-row sm:justify-end\", className)}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outline\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n );\n}\n\n/** Accessible heading for the dialog (announced to screen readers). */\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\n \"font-heading text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Supporting text beneath the dialog title (linked for assistive tech). */\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-sm leading-5 text-secondary-txt\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":";;;;;;;;AASA,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,EACrB,WACA,GAAG,SACoD;CACvD,OACE,oBAACA,SAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT,4JACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,cAAc;CAClB,IAAI;CACJ,SAAS;CACT,IAAI;CACJ,IAAI;AACN;;AAGA,SAAS,cAAc,EACrB,WACA,UACA,OAAO,WACP,kBAAkB,MAClB,GAAG,SAMF;CACD,OACE,qBAAC,cAAD;EAAc,aAAU;YAAxB,CACE,oBAAC,eAAD,CAAgB,CAAA,GAChB,qBAACA,SAAgB,SAAjB;GACE,aAAU;GACV,aAAW;GACX,WAAW,GACT,gXACA,YAAY,OACZ,SACF;GACA,GAAI;aARN,CAUG,UACA,mBACC,qBAACA,SAAgB,OAAjB;IACE,aAAU;IACV,WAAU;cAFZ,CAIE,oBAAC,MAAD,EAAM,IAAI,MAAQ,CAAA,GAClB,oBAAC,QAAD;KAAM,WAAU;eAAU;IAAW,CAAA,CAChB;KAEF;IACb;;AAElB;;AAGA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,gDAAgD,SAAS;EACvE,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,aAAa,EACpB,WACA,kBAAkB,OAClB,UACA,GAAG,SAIF;CACD,OACE,qBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,0DAA0D,SAAS;EACjF,GAAI;YAHN,CAKG,UACA,mBACC,oBAACA,SAAgB,OAAjB;GAAuB,SAAA;aACrB,oBAAC,QAAD;IAAQ,SAAQ;cAAU;GAAa,CAAA;EAClB,CAAA,CAEtB;;AAET;;AAGA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA6D;CAChG,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GACT,4GACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAACA,SAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GAAG,wCAAwC,SAAS;EAC/D,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -39,13 +39,45 @@ function DrawerOverlay({ className, ...props }) {
|
|
|
39
39
|
...props
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
+
const drawerSizeVariants = {
|
|
43
|
+
small: [
|
|
44
|
+
"data-[vaul-drawer-direction=top]:max-h-[60vh]",
|
|
45
|
+
"data-[vaul-drawer-direction=bottom]:max-h-[60vh]",
|
|
46
|
+
"data-[vaul-drawer-direction=right]:w-2/3 data-[vaul-drawer-direction=right]:sm:max-w-xs",
|
|
47
|
+
"data-[vaul-drawer-direction=left]:w-2/3 data-[vaul-drawer-direction=left]:sm:max-w-xs"
|
|
48
|
+
].join(" "),
|
|
49
|
+
default: [
|
|
50
|
+
"data-[vaul-drawer-direction=top]:max-h-[80vh]",
|
|
51
|
+
"data-[vaul-drawer-direction=bottom]:max-h-[80vh]",
|
|
52
|
+
"data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
53
|
+
"data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm"
|
|
54
|
+
].join(" "),
|
|
55
|
+
medium: [
|
|
56
|
+
"data-[vaul-drawer-direction=top]:max-h-[85vh]",
|
|
57
|
+
"data-[vaul-drawer-direction=bottom]:max-h-[85vh]",
|
|
58
|
+
"data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md",
|
|
59
|
+
"data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md"
|
|
60
|
+
].join(" "),
|
|
61
|
+
large: [
|
|
62
|
+
"data-[vaul-drawer-direction=top]:max-h-[90vh]",
|
|
63
|
+
"data-[vaul-drawer-direction=bottom]:max-h-[90vh]",
|
|
64
|
+
"data-[vaul-drawer-direction=right]:w-11/12 data-[vaul-drawer-direction=right]:sm:max-w-lg",
|
|
65
|
+
"data-[vaul-drawer-direction=left]:w-11/12 data-[vaul-drawer-direction=left]:sm:max-w-lg"
|
|
66
|
+
].join(" "),
|
|
67
|
+
extraLarge: [
|
|
68
|
+
"data-[vaul-drawer-direction=top]:max-h-[95vh]",
|
|
69
|
+
"data-[vaul-drawer-direction=bottom]:max-h-[95vh]",
|
|
70
|
+
"data-[vaul-drawer-direction=right]:w-[95vw] data-[vaul-drawer-direction=right]:sm:max-w-2xl",
|
|
71
|
+
"data-[vaul-drawer-direction=left]:w-[95vw] data-[vaul-drawer-direction=left]:sm:max-w-2xl"
|
|
72
|
+
].join(" ")
|
|
73
|
+
};
|
|
42
74
|
/** Sliding panel that holds the drawer's content; auto-portals and renders the overlay. */
|
|
43
|
-
function DrawerContent({ className, children, ...props }) {
|
|
75
|
+
function DrawerContent({ className, children, size = "default", ...props }) {
|
|
44
76
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerPortal, {
|
|
45
77
|
"data-slot": "drawer-portal",
|
|
46
78
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DrawerOverlay, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(vaul.Drawer.Content, {
|
|
47
79
|
"data-slot": "drawer-content",
|
|
48
|
-
className: require_cn.cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-primary-bg shadow-lg", "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]:
|
|
80
|
+
className: require_cn.cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-primary-bg shadow-lg", "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]:rounded-b-10 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]:rounded-t-10 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]:border-l", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:border-r", drawerSizeVariants[size], className),
|
|
49
81
|
...props,
|
|
50
82
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "mx-auto mt-2 hidden h-0.75 w-12.5 shrink-0 rounded-2 bg-muted-bg group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children]
|
|
51
83
|
})]
|
|
@@ -1 +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-overlay-bg 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-primary-bg shadow-lg\",\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]:
|
|
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-overlay-bg 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\nconst drawerSizeVariants = {\n small: [\n \"data-[vaul-drawer-direction=top]:max-h-[60vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[60vh]\",\n \"data-[vaul-drawer-direction=right]:w-2/3 data-[vaul-drawer-direction=right]:sm:max-w-xs\",\n \"data-[vaul-drawer-direction=left]:w-2/3 data-[vaul-drawer-direction=left]:sm:max-w-xs\",\n ].join(\" \"),\n default: [\n \"data-[vaul-drawer-direction=top]:max-h-[80vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[80vh]\",\n \"data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n ].join(\" \"),\n medium: [\n \"data-[vaul-drawer-direction=top]:max-h-[85vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[85vh]\",\n \"data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md\",\n \"data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md\",\n ].join(\" \"),\n large: [\n \"data-[vaul-drawer-direction=top]:max-h-[90vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[90vh]\",\n \"data-[vaul-drawer-direction=right]:w-11/12 data-[vaul-drawer-direction=right]:sm:max-w-lg\",\n \"data-[vaul-drawer-direction=left]:w-11/12 data-[vaul-drawer-direction=left]:sm:max-w-lg\",\n ].join(\" \"),\n extraLarge: [\n \"data-[vaul-drawer-direction=top]:max-h-[95vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[95vh]\",\n \"data-[vaul-drawer-direction=right]:w-[95vw] data-[vaul-drawer-direction=right]:sm:max-w-2xl\",\n \"data-[vaul-drawer-direction=left]:w-[95vw] data-[vaul-drawer-direction=left]:sm:max-w-2xl\",\n ].join(\" \"),\n} as const;\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 /** Optional size variant for the drawer panel. */\n size = \"default\",\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content> & {\n /** Panel size. `default` matches the existing production sizing. */\n size?: keyof typeof drawerSizeVariants;\n}) {\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-primary-bg shadow-lg\",\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]:rounded-b-10 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]:rounded-t-10 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]:border-l\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:border-r\",\n drawerSizeVariants[size],\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-2 hidden h-0.75 w-12.5 shrink-0 rounded-2 bg-muted-bg 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(\n \"font-heading text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal text-primary-txt\",\n className,\n )}\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-muted-txt text-sm leading-5\", 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,4JACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,qBAAqB;CACzB,OAAO;EACL;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,SAAS;EACP;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,QAAQ;EACN;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,OAAO;EACL;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,YAAY;EACV;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;AACZ;;AAGA,SAAS,cAAc,EAErB,WAEA,UAEA,OAAO,WACP,GAAG,SAIF;CACD,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,gFACA,oNACA,sOACA,uIACA,mIACA,mBAAmB,OACnB,SACF;GACA,GAAI;aAXN,CAaE,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,GACT,6HACA,SACF;EACA,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,oCAAoC,SAAS;EAC3D,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -1,2 +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 "../../
|
|
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 "../../index23.cjs";
|
|
2
2
|
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
|
|
@@ -1,2 +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 "../../
|
|
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 "../../index23.js";
|
|
2
2
|
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
|
|
@@ -38,13 +38,45 @@ function DrawerOverlay({ className, ...props }) {
|
|
|
38
38
|
...props
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
+
const drawerSizeVariants = {
|
|
42
|
+
small: [
|
|
43
|
+
"data-[vaul-drawer-direction=top]:max-h-[60vh]",
|
|
44
|
+
"data-[vaul-drawer-direction=bottom]:max-h-[60vh]",
|
|
45
|
+
"data-[vaul-drawer-direction=right]:w-2/3 data-[vaul-drawer-direction=right]:sm:max-w-xs",
|
|
46
|
+
"data-[vaul-drawer-direction=left]:w-2/3 data-[vaul-drawer-direction=left]:sm:max-w-xs"
|
|
47
|
+
].join(" "),
|
|
48
|
+
default: [
|
|
49
|
+
"data-[vaul-drawer-direction=top]:max-h-[80vh]",
|
|
50
|
+
"data-[vaul-drawer-direction=bottom]:max-h-[80vh]",
|
|
51
|
+
"data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
52
|
+
"data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm"
|
|
53
|
+
].join(" "),
|
|
54
|
+
medium: [
|
|
55
|
+
"data-[vaul-drawer-direction=top]:max-h-[85vh]",
|
|
56
|
+
"data-[vaul-drawer-direction=bottom]:max-h-[85vh]",
|
|
57
|
+
"data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md",
|
|
58
|
+
"data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md"
|
|
59
|
+
].join(" "),
|
|
60
|
+
large: [
|
|
61
|
+
"data-[vaul-drawer-direction=top]:max-h-[90vh]",
|
|
62
|
+
"data-[vaul-drawer-direction=bottom]:max-h-[90vh]",
|
|
63
|
+
"data-[vaul-drawer-direction=right]:w-11/12 data-[vaul-drawer-direction=right]:sm:max-w-lg",
|
|
64
|
+
"data-[vaul-drawer-direction=left]:w-11/12 data-[vaul-drawer-direction=left]:sm:max-w-lg"
|
|
65
|
+
].join(" "),
|
|
66
|
+
extraLarge: [
|
|
67
|
+
"data-[vaul-drawer-direction=top]:max-h-[95vh]",
|
|
68
|
+
"data-[vaul-drawer-direction=bottom]:max-h-[95vh]",
|
|
69
|
+
"data-[vaul-drawer-direction=right]:w-[95vw] data-[vaul-drawer-direction=right]:sm:max-w-2xl",
|
|
70
|
+
"data-[vaul-drawer-direction=left]:w-[95vw] data-[vaul-drawer-direction=left]:sm:max-w-2xl"
|
|
71
|
+
].join(" ")
|
|
72
|
+
};
|
|
41
73
|
/** Sliding panel that holds the drawer's content; auto-portals and renders the overlay. */
|
|
42
|
-
function DrawerContent({ className, children, ...props }) {
|
|
74
|
+
function DrawerContent({ className, children, size = "default", ...props }) {
|
|
43
75
|
return /* @__PURE__ */ jsxs(DrawerPortal, {
|
|
44
76
|
"data-slot": "drawer-portal",
|
|
45
77
|
children: [/* @__PURE__ */ jsx(DrawerOverlay, {}), /* @__PURE__ */ jsxs(Drawer$1.Content, {
|
|
46
78
|
"data-slot": "drawer-content",
|
|
47
|
-
className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-primary-bg shadow-lg", "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]:
|
|
79
|
+
className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-primary-bg shadow-lg", "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]:rounded-b-10 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]:rounded-t-10 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]:border-l", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:border-r", drawerSizeVariants[size], className),
|
|
48
80
|
...props,
|
|
49
81
|
children: [/* @__PURE__ */ jsx("div", { className: "mx-auto mt-2 hidden h-0.75 w-12.5 shrink-0 rounded-2 bg-muted-bg group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children]
|
|
50
82
|
})]
|
|
@@ -1 +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-overlay-bg 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-primary-bg shadow-lg\",\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]:
|
|
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-overlay-bg 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\nconst drawerSizeVariants = {\n small: [\n \"data-[vaul-drawer-direction=top]:max-h-[60vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[60vh]\",\n \"data-[vaul-drawer-direction=right]:w-2/3 data-[vaul-drawer-direction=right]:sm:max-w-xs\",\n \"data-[vaul-drawer-direction=left]:w-2/3 data-[vaul-drawer-direction=left]:sm:max-w-xs\",\n ].join(\" \"),\n default: [\n \"data-[vaul-drawer-direction=top]:max-h-[80vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[80vh]\",\n \"data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n ].join(\" \"),\n medium: [\n \"data-[vaul-drawer-direction=top]:max-h-[85vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[85vh]\",\n \"data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md\",\n \"data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md\",\n ].join(\" \"),\n large: [\n \"data-[vaul-drawer-direction=top]:max-h-[90vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[90vh]\",\n \"data-[vaul-drawer-direction=right]:w-11/12 data-[vaul-drawer-direction=right]:sm:max-w-lg\",\n \"data-[vaul-drawer-direction=left]:w-11/12 data-[vaul-drawer-direction=left]:sm:max-w-lg\",\n ].join(\" \"),\n extraLarge: [\n \"data-[vaul-drawer-direction=top]:max-h-[95vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[95vh]\",\n \"data-[vaul-drawer-direction=right]:w-[95vw] data-[vaul-drawer-direction=right]:sm:max-w-2xl\",\n \"data-[vaul-drawer-direction=left]:w-[95vw] data-[vaul-drawer-direction=left]:sm:max-w-2xl\",\n ].join(\" \"),\n} as const;\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 /** Optional size variant for the drawer panel. */\n size = \"default\",\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content> & {\n /** Panel size. `default` matches the existing production sizing. */\n size?: keyof typeof drawerSizeVariants;\n}) {\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-primary-bg shadow-lg\",\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]:rounded-b-10 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]:rounded-t-10 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]:border-l\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:border-r\",\n drawerSizeVariants[size],\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-2 hidden h-0.75 w-12.5 shrink-0 rounded-2 bg-muted-bg 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(\n \"font-heading text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal text-primary-txt\",\n className,\n )}\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-muted-txt text-sm leading-5\", 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,4JACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,qBAAqB;CACzB,OAAO;EACL;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,SAAS;EACP;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,QAAQ;EACN;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,OAAO;EACL;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,YAAY;EACV;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;AACZ;;AAGA,SAAS,cAAc,EAErB,WAEA,UAEA,OAAO,WACP,GAAG,SAIF;CACD,OACE,qBAAC,cAAD;EAAc,aAAU;YAAxB,CACE,oBAAC,eAAD,CAAgB,CAAA,GAChB,qBAACA,SAAgB,SAAjB;GACE,aAAU;GACV,WAAW,GACT,gFACA,oNACA,sOACA,uIACA,mIACA,mBAAmB,OACnB,SACF;GACA,GAAI;aAXN,CAaE,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,GACT,6HACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,kBAAkB,EAEzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAACA,SAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GAAG,oCAAoC,SAAS;EAC3D,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_cn = require("../../cn.cjs");
|
|
3
|
+
const require_Icon = require("../../Icon.cjs");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
5
|
let lucide_react = require("lucide-react");
|
|
4
6
|
let radix_ui = require("radix-ui");
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
7
|
//#region src/primitives/DropdownMenu/DropdownMenu.tsx
|
|
7
8
|
/** Root provider for a dropdown menu; holds open state and wires the trigger to its content. */
|
|
8
9
|
function DropdownMenu({ ...props }) {
|
|
@@ -60,7 +61,10 @@ function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
|
60
61
|
...props,
|
|
61
62
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
62
63
|
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)(
|
|
64
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
65
|
+
as: lucide_react.CheckIcon,
|
|
66
|
+
className: "size-4"
|
|
67
|
+
}) })
|
|
64
68
|
}), children]
|
|
65
69
|
});
|
|
66
70
|
}
|
|
@@ -79,7 +83,10 @@ function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
|
79
83
|
...props,
|
|
80
84
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
81
85
|
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)(
|
|
86
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.DropdownMenu.ItemIndicator, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
87
|
+
as: lucide_react.CircleIcon,
|
|
88
|
+
className: "size-2 fill-current"
|
|
89
|
+
}) })
|
|
83
90
|
}), children]
|
|
84
91
|
});
|
|
85
92
|
}
|
|
@@ -122,7 +129,10 @@ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
122
129
|
"data-inset": inset,
|
|
123
130
|
className: require_cn.cn("flex min-h-8 cursor-default items-center gap-2 rounded-10 px-2 py-1.5 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[inset]:pl-8 data-[state=open]:bg-ghost-hover-bg [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-txt", className),
|
|
124
131
|
...props,
|
|
125
|
-
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
132
|
+
children: [children, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
133
|
+
as: lucide_react.ChevronRightIcon,
|
|
134
|
+
className: "ml-auto size-4"
|
|
135
|
+
})]
|
|
126
136
|
});
|
|
127
137
|
}
|
|
128
138
|
/** The floating surface for a nested submenu's items. */
|
|
@@ -1 +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 // Figma Menu spec (Select & Combobox page): glass-none surface, primary\n // border, radius-12, shadow-sm, 8px padding.\n \"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-12 border border-primary-border bg-glass-60-bg backdrop-blur-glass p-2 text-primary-txt shadow-sm data-[side=bottom]:slide-in-from-top-8 data-[side=left]:slide-in-from-right-8 data-[side=right]:slide-in-from-left-8 data-[side=top]:slide-in-from-bottom-8 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 // Vertical hierarchy: if any item reserves the 32px indicator column\n // (checkbox/radio items), plain items, labels and sub-triggers share it.\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-item]:not([data-inset])]:pl-8\",\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-label]:not([data-inset])]:pl-8\",\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-sub-trigger]:not([data-inset])]:pl-8\",\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 min-h-8 cursor-default items-center gap-2 rounded-10 px-2 py-1.5 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-danger-txt data-[variant=destructive]:focus:bg-danger-bg [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-txt data-[variant=destructive]:*:[svg]:text-danger-txt!\",\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 min-h-8 cursor-default items-center gap-2 rounded-10 py-1.5 pr-2 pl-8 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg 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 min-h-8 cursor-default items-center gap-2 rounded-10 py-1.5 pr-2 pl-8 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg 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(\n \"px-2 py-1.5 text-xs leading-4 font-medium text-muted-txt data-[inset]:pl-8\",\n className,\n )}\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(\"my-1 h-px bg-primary-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-sm leading-5 text-muted-txt\", 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 min-h-8 cursor-default items-center gap-2 rounded-10 px-2 py-1.5 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[inset]:pl-8 data-[state=open]:bg-ghost-hover-bg [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-txt\",\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-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-12 border border-primary-border bg-glass-none-bg p-2 text-primary-txt shadow-sm data-[side=bottom]:slide-in-from-top-8 data-[side=left]:slide-in-from-right-8 data-[side=right]:slide-in-from-left-8 data-[side=top]:slide-in-from-bottom-8 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 // Vertical hierarchy: if any item reserves the 32px indicator column\n // (checkbox/radio items), plain items, labels and sub-triggers share it.\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-item]:not([data-inset])]:pl-8\",\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-label]:not([data-inset])]:pl-8\",\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-sub-trigger]:not([data-inset])]:pl-8\",\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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"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["DropdownMenuPrimitive","cn","Icon","CheckIcon","CircleIcon","ChevronRightIcon"],"sources":["../../../src/primitives/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { Icon } from \"@/primitives/Icon\";\nimport { 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 // Figma Menu spec (Select & Combobox page): glass-none surface, primary\n // border, radius-12, shadow-sm, 8px padding.\n \"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-12 border border-primary-border bg-glass-60-bg backdrop-blur-glass p-2 text-primary-txt shadow-sm data-[side=bottom]:slide-in-from-top-8 data-[side=left]:slide-in-from-right-8 data-[side=right]:slide-in-from-left-8 data-[side=top]:slide-in-from-bottom-8 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 // Vertical hierarchy: if any item reserves the 32px indicator column\n // (checkbox/radio items), plain items, labels and sub-triggers share it.\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-item]:not([data-inset])]:pl-8\",\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-label]:not([data-inset])]:pl-8\",\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-sub-trigger]:not([data-inset])]:pl-8\",\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 min-h-8 cursor-default items-center gap-2 rounded-10 px-2 py-1.5 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-danger-txt data-[variant=destructive]:focus:bg-danger-bg [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-txt data-[variant=destructive]:*:[svg]:text-danger-txt!\",\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 min-h-8 cursor-default items-center gap-2 rounded-10 py-1.5 pr-2 pl-8 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg 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 <Icon as={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 min-h-8 cursor-default items-center gap-2 rounded-10 py-1.5 pr-2 pl-8 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg 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 <Icon as={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(\n \"px-2 py-1.5 text-xs leading-4 font-medium text-muted-txt data-[inset]:pl-8\",\n className,\n )}\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(\"my-1 h-px bg-primary-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-sm leading-5 text-muted-txt\", 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 min-h-8 cursor-default items-center gap-2 rounded-10 px-2 py-1.5 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[inset]:pl-8 data-[state=open]:bg-ghost-hover-bg [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-txt\",\n className,\n )}\n {...props}\n >\n {children}\n <Icon as={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-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-12 border border-primary-border bg-glass-none-bg p-2 text-primary-txt shadow-sm data-[side=bottom]:slide-in-from-top-8 data-[side=left]:slide-in-from-right-8 data-[side=right]:slide-in-from-left-8 data-[side=top]:slide-in-from-bottom-8 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 // Vertical hierarchy: if any item reserves the 32px indicator column\n // (checkbox/radio items), plain items, labels and sub-triggers share it.\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-item]:not([data-inset])]:pl-8\",\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-label]:not([data-inset])]:pl-8\",\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-sub-trigger]:not([data-inset])]:pl-8\",\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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"}
|
|
@@ -1,2 +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 "../../
|
|
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 "../../index24.cjs";
|
|
2
2
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -1,2 +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 "../../
|
|
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 "../../index24.js";
|
|
2
2
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as cn } from "../../cn.js";
|
|
2
|
+
import { t as Icon } from "../../Icon.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
4
|
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
3
5
|
import { DropdownMenu as DropdownMenu$1 } from "radix-ui";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
//#region src/primitives/DropdownMenu/DropdownMenu.tsx
|
|
6
7
|
/** Root provider for a dropdown menu; holds open state and wires the trigger to its content. */
|
|
7
8
|
function DropdownMenu({ ...props }) {
|
|
@@ -59,7 +60,10 @@ function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
|
59
60
|
...props,
|
|
60
61
|
children: [/* @__PURE__ */ jsx("span", {
|
|
61
62
|
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(
|
|
63
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(Icon, {
|
|
64
|
+
as: CheckIcon,
|
|
65
|
+
className: "size-4"
|
|
66
|
+
}) })
|
|
63
67
|
}), children]
|
|
64
68
|
});
|
|
65
69
|
}
|
|
@@ -78,7 +82,10 @@ function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
|
78
82
|
...props,
|
|
79
83
|
children: [/* @__PURE__ */ jsx("span", {
|
|
80
84
|
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(
|
|
85
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(Icon, {
|
|
86
|
+
as: CircleIcon,
|
|
87
|
+
className: "size-2 fill-current"
|
|
88
|
+
}) })
|
|
82
89
|
}), children]
|
|
83
90
|
});
|
|
84
91
|
}
|
|
@@ -121,7 +128,10 @@ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
121
128
|
"data-inset": inset,
|
|
122
129
|
className: cn("flex min-h-8 cursor-default items-center gap-2 rounded-10 px-2 py-1.5 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[inset]:pl-8 data-[state=open]:bg-ghost-hover-bg [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-txt", className),
|
|
123
130
|
...props,
|
|
124
|
-
children: [children, /* @__PURE__ */ jsx(
|
|
131
|
+
children: [children, /* @__PURE__ */ jsx(Icon, {
|
|
132
|
+
as: ChevronRightIcon,
|
|
133
|
+
className: "ml-auto size-4"
|
|
134
|
+
})]
|
|
125
135
|
});
|
|
126
136
|
}
|
|
127
137
|
/** The floating surface for a nested submenu's items. */
|