@psnext/design-system 2.4.0 → 2.6.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 +32 -4
- package/SKILL.md +1 -1
- package/dist/Header.cjs +3 -3
- package/dist/Header.cjs.map +1 -1
- package/dist/Header.js +3 -3
- package/dist/Header.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/index.cjs +25 -4
- 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.js +10 -5
- package/dist/index10.d.cts +5 -5
- package/dist/index10.d.ts +6 -6
- package/dist/index11.d.cts +3 -3
- package/dist/index11.d.ts +3 -3
- package/dist/index12.d.cts +12 -12
- package/dist/index12.d.cts.map +1 -1
- package/dist/index12.d.ts +12 -12
- package/dist/index12.d.ts.map +1 -1
- 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.cts.map +1 -1
- package/dist/index2.d.ts +8 -8
- package/dist/index2.d.ts.map +1 -1
- 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 +39 -28
- package/dist/index21.d.cts.map +1 -1
- package/dist/index21.d.ts +39 -28
- package/dist/index21.d.ts.map +1 -1
- package/dist/index22.d.cts +98 -44
- package/dist/index22.d.cts.map +1 -1
- package/dist/index22.d.ts +98 -44
- package/dist/index22.d.ts.map +1 -1
- package/dist/index23.d.cts +65 -68
- package/dist/index23.d.cts.map +1 -1
- package/dist/index23.d.ts +65 -68
- package/dist/index23.d.ts.map +1 -1
- package/dist/index24.d.cts +27 -42
- package/dist/index24.d.cts.map +1 -1
- package/dist/index24.d.ts +27 -42
- package/dist/index24.d.ts.map +1 -1
- package/dist/index25.d.cts +68 -11
- package/dist/index25.d.cts.map +1 -1
- package/dist/index25.d.ts +68 -11
- package/dist/index25.d.ts.map +1 -1
- package/dist/index26.d.cts +75 -56
- package/dist/index26.d.cts.map +1 -1
- package/dist/index26.d.ts +75 -56
- package/dist/index26.d.ts.map +1 -1
- package/dist/index27.d.cts +38 -60
- package/dist/index27.d.cts.map +1 -1
- package/dist/index27.d.ts +38 -60
- package/dist/index27.d.ts.map +1 -1
- package/dist/index28.d.cts +10 -30
- package/dist/index28.d.cts.map +1 -1
- package/dist/index28.d.ts +10 -30
- package/dist/index28.d.ts.map +1 -1
- package/dist/index29.d.cts +72 -17
- package/dist/index29.d.cts.map +1 -1
- package/dist/index29.d.ts +72 -17
- package/dist/index29.d.ts.map +1 -1
- package/dist/index3.d.cts +13 -13
- package/dist/index3.d.cts.map +1 -1
- package/dist/index3.d.ts +13 -13
- package/dist/index30.d.cts +46 -80
- package/dist/index30.d.cts.map +1 -1
- package/dist/index30.d.ts +46 -80
- package/dist/index30.d.ts.map +1 -1
- package/dist/index31.d.cts +64 -33
- package/dist/index31.d.cts.map +1 -1
- package/dist/index31.d.ts +64 -33
- package/dist/index31.d.ts.map +1 -1
- package/dist/index32.d.cts +29 -18
- package/dist/index32.d.cts.map +1 -1
- package/dist/index32.d.ts +29 -18
- package/dist/index32.d.ts.map +1 -1
- package/dist/index33.d.cts +17 -51
- package/dist/index33.d.cts.map +1 -1
- package/dist/index33.d.ts +17 -51
- package/dist/index33.d.ts.map +1 -1
- package/dist/index34.d.cts +81 -36
- package/dist/index34.d.cts.map +1 -1
- package/dist/index34.d.ts +81 -36
- package/dist/index34.d.ts.map +1 -1
- package/dist/index35.d.cts +32 -69
- package/dist/index35.d.cts.map +1 -1
- package/dist/index35.d.ts +32 -69
- package/dist/index35.d.ts.map +1 -1
- package/dist/index36.d.cts +20 -13
- package/dist/index36.d.cts.map +1 -1
- package/dist/index36.d.ts +20 -13
- package/dist/index36.d.ts.map +1 -1
- package/dist/index37.d.cts +51 -21
- package/dist/index37.d.cts.map +1 -1
- package/dist/index37.d.ts +51 -21
- package/dist/index37.d.ts.map +1 -1
- package/dist/index38.d.cts +38 -15
- package/dist/index38.d.cts.map +1 -1
- package/dist/index38.d.ts +38 -15
- package/dist/index38.d.ts.map +1 -1
- package/dist/index39.d.cts +53 -81
- package/dist/index39.d.cts.map +1 -1
- package/dist/index39.d.ts +53 -81
- package/dist/index39.d.ts.map +1 -1
- package/dist/index4.d.cts +2 -2
- package/dist/index4.d.ts +2 -2
- package/dist/index4.d.ts.map +1 -1
- package/dist/index40.d.cts +13 -16
- package/dist/index40.d.cts.map +1 -1
- package/dist/index40.d.ts +13 -16
- package/dist/index40.d.ts.map +1 -1
- package/dist/index41.d.cts +25 -52
- package/dist/index41.d.cts.map +1 -1
- package/dist/index41.d.ts +24 -51
- package/dist/index41.d.ts.map +1 -1
- package/dist/index42.d.cts +15 -40
- package/dist/index42.d.cts.map +1 -1
- package/dist/index42.d.ts +15 -40
- package/dist/index42.d.ts.map +1 -1
- package/dist/index43.d.cts +86 -77
- package/dist/index43.d.cts.map +1 -1
- package/dist/index43.d.ts +86 -77
- package/dist/index43.d.ts.map +1 -1
- package/dist/index44.d.cts +125 -1
- package/dist/index44.d.cts.map +1 -0
- package/dist/index44.d.ts +125 -1
- package/dist/index44.d.ts.map +1 -0
- package/dist/index45.d.cts +15 -41
- package/dist/index45.d.cts.map +1 -1
- package/dist/index45.d.ts +15 -41
- package/dist/index45.d.ts.map +1 -1
- package/dist/index46.d.cts +52 -24
- package/dist/index46.d.cts.map +1 -1
- package/dist/index46.d.ts +52 -24
- package/dist/index46.d.ts.map +1 -1
- package/dist/index47.d.cts +86 -31
- package/dist/index47.d.cts.map +1 -1
- package/dist/index47.d.ts +86 -31
- package/dist/index47.d.ts.map +1 -1
- package/dist/index48.d.cts +1 -25
- package/dist/index48.d.ts +1 -25
- package/dist/index49.d.cts +120 -14
- package/dist/index49.d.cts.map +1 -1
- package/dist/index49.d.ts +120 -14
- package/dist/index49.d.ts.map +1 -1
- package/dist/index5.d.cts +7 -7
- package/dist/index5.d.ts +7 -7
- package/dist/index50.d.cts +32 -53
- package/dist/index50.d.cts.map +1 -1
- package/dist/index50.d.ts +32 -53
- package/dist/index50.d.ts.map +1 -1
- package/dist/index51.d.cts +21 -56
- package/dist/index51.d.cts.map +1 -1
- package/dist/index51.d.ts +21 -56
- package/dist/index51.d.ts.map +1 -1
- package/dist/index52.d.cts +33 -23
- package/dist/index52.d.cts.map +1 -1
- package/dist/index52.d.ts +33 -23
- package/dist/index52.d.ts.map +1 -1
- package/dist/index53.d.cts +17 -201
- package/dist/index53.d.cts.map +1 -1
- package/dist/index53.d.ts +17 -201
- package/dist/index53.d.ts.map +1 -1
- package/dist/index54.d.cts +14 -19
- package/dist/index54.d.cts.map +1 -1
- package/dist/index54.d.ts +14 -19
- package/dist/index54.d.ts.map +1 -1
- package/dist/index55.d.cts +64 -23
- package/dist/index55.d.cts.map +1 -1
- package/dist/index55.d.ts +64 -23
- package/dist/index55.d.ts.map +1 -1
- package/dist/index56.d.cts +95 -22
- package/dist/index56.d.cts.map +1 -1
- package/dist/index56.d.ts +95 -22
- package/dist/index56.d.ts.map +1 -1
- package/dist/index57.d.cts +25 -6
- package/dist/index57.d.cts.map +1 -1
- package/dist/index57.d.ts +25 -6
- package/dist/index57.d.ts.map +1 -1
- package/dist/index58.d.cts +202 -43
- package/dist/index58.d.cts.map +1 -1
- package/dist/index58.d.ts +202 -43
- package/dist/index58.d.ts.map +1 -1
- package/dist/index59.d.cts +15 -40
- package/dist/index59.d.cts.map +1 -1
- package/dist/index59.d.ts +15 -40
- 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 +5 -5
- package/dist/index6.d.ts.map +1 -1
- package/dist/index60.d.cts +20 -55
- package/dist/index60.d.cts.map +1 -1
- package/dist/index60.d.ts +20 -55
- package/dist/index60.d.ts.map +1 -1
- package/dist/index61.d.cts +21 -41
- package/dist/index61.d.cts.map +1 -1
- package/dist/index61.d.ts +21 -41
- package/dist/index61.d.ts.map +1 -1
- package/dist/index62.d.cts +6 -18
- package/dist/index62.d.cts.map +1 -1
- package/dist/index62.d.ts +6 -18
- package/dist/index62.d.ts.map +1 -1
- package/dist/index63.d.cts +46 -41
- package/dist/index63.d.cts.map +1 -1
- package/dist/index63.d.ts +46 -41
- package/dist/index63.d.ts.map +1 -1
- package/dist/index64.d.cts +47 -19
- package/dist/index64.d.cts.map +1 -1
- package/dist/index64.d.ts +47 -19
- package/dist/index64.d.ts.map +1 -1
- package/dist/index65.d.cts +50 -35
- package/dist/index65.d.cts.map +1 -1
- package/dist/index65.d.ts +50 -35
- package/dist/index65.d.ts.map +1 -1
- package/dist/index66.d.cts +33 -13
- package/dist/index66.d.cts.map +1 -1
- package/dist/index66.d.ts +33 -13
- package/dist/index66.d.ts.map +1 -1
- package/dist/index67.d.cts +17 -84
- package/dist/index67.d.cts.map +1 -1
- package/dist/index67.d.ts +17 -84
- package/dist/index67.d.ts.map +1 -1
- package/dist/index68.d.cts +40 -14
- package/dist/index68.d.cts.map +1 -1
- package/dist/index68.d.ts +40 -14
- package/dist/index68.d.ts.map +1 -1
- package/dist/index69.d.cts +16 -30
- package/dist/index69.d.cts.map +1 -1
- package/dist/index69.d.ts +16 -30
- package/dist/index69.d.ts.map +1 -1
- package/dist/index7.d.cts +8 -8
- package/dist/index7.d.ts +8 -8
- package/dist/index70.d.cts +39 -27
- package/dist/index70.d.cts.map +1 -1
- package/dist/index70.d.ts +39 -27
- package/dist/index70.d.ts.map +1 -1
- package/dist/index71.d.cts +22 -79
- package/dist/index71.d.cts.map +1 -1
- package/dist/index71.d.ts +22 -79
- package/dist/index71.d.ts.map +1 -1
- package/dist/index72.d.cts +77 -264
- package/dist/index72.d.cts.map +1 -1
- package/dist/index72.d.ts +77 -264
- package/dist/index72.d.ts.map +1 -1
- package/dist/index73.d.cts +19 -0
- package/dist/index73.d.cts.map +1 -0
- package/dist/index73.d.ts +19 -0
- package/dist/index73.d.ts.map +1 -0
- package/dist/index74.d.cts +37 -0
- package/dist/index74.d.cts.map +1 -0
- package/dist/index74.d.ts +37 -0
- package/dist/index74.d.ts.map +1 -0
- package/dist/index75.d.cts +36 -0
- package/dist/index75.d.cts.map +1 -0
- package/dist/index75.d.ts +36 -0
- package/dist/index75.d.ts.map +1 -0
- package/dist/index76.d.cts +87 -0
- package/dist/index76.d.cts.map +1 -0
- package/dist/index76.d.ts +87 -0
- package/dist/index76.d.ts.map +1 -0
- package/dist/index77.d.cts +278 -0
- package/dist/index77.d.cts.map +1 -0
- package/dist/index77.d.ts +278 -0
- package/dist/index77.d.ts.map +1 -0
- package/dist/index8.d.cts +4 -4
- package/dist/index8.d.cts.map +1 -1
- package/dist/index8.d.ts +4 -4
- 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.d.cts +1 -1
- package/dist/layouts/Container/index.d.ts +1 -1
- package/dist/layouts/MultiColumn/index.d.cts +1 -1
- package/dist/layouts/MultiColumn/index.d.ts +1 -1
- package/dist/layouts/PageBackground/index.d.cts +1 -1
- package/dist/layouts/PageBackground/index.d.ts +1 -1
- package/dist/layouts/Stack/index.d.cts +1 -1
- package/dist/layouts/Stack/index.d.ts +1 -1
- package/dist/layouts/TwoColumn/index.d.cts +1 -1
- package/dist/layouts/TwoColumn/index.d.ts +1 -1
- package/dist/layouts/index.d.cts +5 -5
- package/dist/layouts/index.d.ts +5 -5
- 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/Footer/index.d.cts +7 -7
- 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.d.cts +14 -14
- package/dist/patterns/MediaObject/index.d.cts.map +1 -1
- package/dist/patterns/MediaObject/index.d.ts +14 -14
- package/dist/patterns/NavRail/index.d.cts +1 -1
- package/dist/patterns/NavRail/index.d.ts +1 -1
- package/dist/patterns/SectionCard/index.d.cts +2 -2
- 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.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/Checkbox/index.cjs +1 -1
- 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 +1 -1
- package/dist/primitives/Checkbox/index.js.map +1 -1
- package/dist/primitives/CheckboxTree/index.d.cts +1 -1
- package/dist/primitives/CheckboxTree/index.d.ts +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.d.cts +1 -1
- package/dist/primitives/Collapsible/index.d.ts +1 -1
- package/dist/primitives/Combobox/index.cjs +210 -0
- package/dist/primitives/Combobox/index.cjs.map +1 -0
- package/dist/primitives/Combobox/index.d.cts +2 -0
- package/dist/primitives/Combobox/index.d.ts +2 -0
- package/dist/primitives/Combobox/index.js +199 -0
- package/dist/primitives/Combobox/index.js.map +1 -0
- package/dist/primitives/Command/index.d.cts +1 -1
- package/dist/primitives/Command/index.d.ts +1 -1
- package/dist/primitives/ContextMenu/index.d.cts +1 -1
- package/dist/primitives/ContextMenu/index.d.ts +1 -1
- package/dist/primitives/Credits/index.d.cts +1 -1
- package/dist/primitives/Credits/index.d.ts +1 -1
- package/dist/primitives/Dialog/index.d.cts +1 -1
- package/dist/primitives/Dialog/index.d.ts +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.d.cts +1 -1
- package/dist/primitives/DropdownMenu/index.d.ts +1 -1
- package/dist/primitives/Empty/index.d.cts +1 -1
- package/dist/primitives/Empty/index.d.ts +1 -1
- package/dist/primitives/Field/index.d.cts +1 -1
- package/dist/primitives/Field/index.d.ts +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.d.cts +1 -1
- package/dist/primitives/Form/index.d.ts +1 -1
- package/dist/primitives/Heading/index.d.cts +1 -1
- package/dist/primitives/Heading/index.d.ts +1 -1
- package/dist/primitives/HoverCard/index.d.cts +1 -1
- package/dist/primitives/HoverCard/index.d.ts +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.d.cts +1 -1
- package/dist/primitives/InfoBanner/index.d.ts +1 -1
- package/dist/primitives/Input/index.d.cts +1 -1
- package/dist/primitives/Input/index.d.ts +1 -1
- package/dist/primitives/InputGroup/index.d.cts +1 -1
- package/dist/primitives/InputGroup/index.d.ts +1 -1
- package/dist/primitives/InputOtp/index.d.cts +1 -1
- package/dist/primitives/InputOtp/index.d.ts +1 -1
- package/dist/primitives/Item/index.d.cts +1 -1
- package/dist/primitives/Item/index.d.ts +1 -1
- package/dist/primitives/Kbd/index.d.cts +1 -1
- package/dist/primitives/Kbd/index.d.ts +1 -1
- package/dist/primitives/Label/index.d.cts +1 -1
- package/dist/primitives/Label/index.d.ts +1 -1
- package/dist/primitives/Link/index.d.cts +1 -1
- package/dist/primitives/Link/index.d.ts +1 -1
- package/dist/primitives/Logo/index.d.cts +1 -1
- package/dist/primitives/Logo/index.d.ts +1 -1
- package/dist/primitives/Menubar/index.d.cts +1 -1
- package/dist/primitives/Menubar/index.d.ts +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.d.cts +1 -1
- package/dist/primitives/NativeSelect/index.d.ts +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.d.cts +1 -1
- package/dist/primitives/NavigationMenu/index.d.ts +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.d.cts +1 -1
- package/dist/primitives/Pagination/index.d.ts +1 -1
- package/dist/primitives/Popover/index.d.cts +1 -1
- package/dist/primitives/Popover/index.d.ts +1 -1
- package/dist/primitives/Progress/index.d.cts +1 -1
- package/dist/primitives/Progress/index.d.ts +1 -1
- package/dist/primitives/RadioGroup/index.cjs +1 -1
- 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 +1 -1
- package/dist/primitives/RadioGroup/index.js.map +1 -1
- package/dist/primitives/Resizable/index.d.cts +1 -1
- package/dist/primitives/Resizable/index.d.ts +1 -1
- package/dist/primitives/ScrollArea/index.d.cts +1 -1
- package/dist/primitives/ScrollArea/index.d.ts +1 -1
- package/dist/primitives/Select/index.d.cts +1 -1
- package/dist/primitives/Select/index.d.ts +1 -1
- package/dist/primitives/Sheet/index.cjs +34 -2
- 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 +34 -2
- 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.d.cts +1 -1
- package/dist/primitives/Slider/index.d.ts +1 -1
- package/dist/primitives/Sonner/index.d.cts +1 -1
- package/dist/primitives/Sonner/index.d.ts +1 -1
- package/dist/primitives/Spinner/index.d.cts +1 -1
- package/dist/primitives/Spinner/index.d.ts +1 -1
- package/dist/primitives/Switch/index.d.cts +1 -1
- package/dist/primitives/Switch/index.d.ts +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 +153 -10
- package/dist/primitives/Tabs/index.cjs.map +1 -1
- package/dist/primitives/Tabs/index.d.cts +1 -1
- package/dist/primitives/Tabs/index.d.ts +1 -1
- package/dist/primitives/Tabs/index.js +153 -10
- package/dist/primitives/Tabs/index.js.map +1 -1
- package/dist/primitives/Text/index.d.cts +1 -1
- package/dist/primitives/Text/index.d.ts +1 -1
- package/dist/primitives/Textarea/index.d.cts +1 -1
- package/dist/primitives/Textarea/index.d.ts +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.d.cts +1 -1
- package/dist/primitives/Toggle/index.d.ts +1 -1
- package/dist/primitives/ToggleGroup/index.d.cts +1 -1
- package/dist/primitives/ToggleGroup/index.d.ts +1 -1
- package/dist/primitives/Tooltip/index.d.cts +1 -1
- package/dist/primitives/Tooltip/index.d.ts +1 -1
- package/dist/primitives/index.cjs +25 -4
- package/dist/primitives/index.d.cts +56 -51
- package/dist/primitives/index.d.ts +56 -51
- package/dist/primitives/index.js +10 -5
- package/dist/styles/tokens/mode-dark.css +1 -1
- package/package.json +1 -1
- package/dist/index48.d.cts.map +0 -1
- package/dist/index48.d.ts.map +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { t as cn } from "../../cn.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/primitives/CircularProgress/CircularProgress.tsx
|
|
4
|
+
const indicatorVariants = {
|
|
5
|
+
default: "text-primary-invert-bg",
|
|
6
|
+
brand: "text-brand-500-primary",
|
|
7
|
+
success: "text-success-txt",
|
|
8
|
+
warning: "text-warning-txt",
|
|
9
|
+
info: "text-info-txt",
|
|
10
|
+
destructive: "text-danger-txt",
|
|
11
|
+
analyzing: "text-[var(--progress-analyzing)]",
|
|
12
|
+
ingesting: "text-[var(--progress-ingesting)]"
|
|
13
|
+
};
|
|
14
|
+
const trackVariants = {
|
|
15
|
+
default: "text-primary-border",
|
|
16
|
+
brand: "text-brand-500-primary/20",
|
|
17
|
+
success: "text-success-txt/20",
|
|
18
|
+
warning: "text-warning-txt/20",
|
|
19
|
+
info: "text-info-txt/20",
|
|
20
|
+
destructive: "text-danger-txt/20",
|
|
21
|
+
analyzing: "text-primary-invert-bg/20",
|
|
22
|
+
ingesting: "text-primary-invert-bg/20"
|
|
23
|
+
};
|
|
24
|
+
function clamp(value, min, max) {
|
|
25
|
+
return Math.min(max, Math.max(min, value));
|
|
26
|
+
}
|
|
27
|
+
/** Circular progress indicator supporting determinate and indeterminate states. */
|
|
28
|
+
function CircularProgress({ className, value, min = 0, max = 100, size = 48, strokeWidth = 4, variant = "default", trackVariant, progressColor, trackColor, label, showValueLabel = false, indeterminateLabel = "Loading", style, "aria-label": ariaLabelProp, "aria-valuetext": ariaValueTextProp, ...props }) {
|
|
29
|
+
const normalizedMax = max > min ? max : min + 100;
|
|
30
|
+
const boundedValue = value == null ? void 0 : clamp(value, min, normalizedMax);
|
|
31
|
+
const indeterminate = boundedValue == null;
|
|
32
|
+
const percent = indeterminate ? void 0 : (boundedValue - min) / (normalizedMax - min) * 100;
|
|
33
|
+
const roundedPercent = percent == null ? void 0 : Math.round(percent);
|
|
34
|
+
const normalizedSize = Math.max(size, 12);
|
|
35
|
+
const normalizedStrokeWidth = clamp(strokeWidth, 1, normalizedSize / 2);
|
|
36
|
+
const radius = (normalizedSize - normalizedStrokeWidth) / 2;
|
|
37
|
+
const circumference = 2 * Math.PI * radius;
|
|
38
|
+
const centerLabel = label ?? (showValueLabel && roundedPercent != null ? `${roundedPercent}%` : null);
|
|
39
|
+
const ariaValueText = ariaValueTextProp ?? (indeterminate ? indeterminateLabel : `${roundedPercent}% complete`);
|
|
40
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
41
|
+
"data-slot": "circular-progress",
|
|
42
|
+
"data-state": indeterminate ? "indeterminate" : "determinate",
|
|
43
|
+
role: "progressbar",
|
|
44
|
+
"aria-label": ariaLabelProp ?? "Progress",
|
|
45
|
+
"aria-valuemin": min,
|
|
46
|
+
"aria-valuemax": normalizedMax,
|
|
47
|
+
"aria-valuenow": indeterminate ? void 0 : boundedValue,
|
|
48
|
+
"aria-valuetext": ariaValueText,
|
|
49
|
+
className: cn("relative inline-flex shrink-0 items-center justify-center rounded-full text-primary-txt outline-none focus-visible:ring-3 focus-visible:ring-focus", className),
|
|
50
|
+
style: {
|
|
51
|
+
width: normalizedSize,
|
|
52
|
+
height: normalizedSize,
|
|
53
|
+
...style
|
|
54
|
+
},
|
|
55
|
+
...props,
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsxs("svg", {
|
|
58
|
+
"data-slot": "circular-progress-svg",
|
|
59
|
+
width: normalizedSize,
|
|
60
|
+
height: normalizedSize,
|
|
61
|
+
viewBox: `0 0 ${normalizedSize} ${normalizedSize}`,
|
|
62
|
+
className: cn("size-full -rotate-90", indeterminate && "motion-safe:animate-spin"),
|
|
63
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
64
|
+
"data-slot": "circular-progress-track",
|
|
65
|
+
cx: normalizedSize / 2,
|
|
66
|
+
cy: normalizedSize / 2,
|
|
67
|
+
r: radius,
|
|
68
|
+
fill: "none",
|
|
69
|
+
strokeWidth: normalizedStrokeWidth,
|
|
70
|
+
className: cn("stroke-current", trackColor ? void 0 : trackVariants[trackVariant ?? variant]),
|
|
71
|
+
style: trackColor ? { stroke: trackColor } : void 0
|
|
72
|
+
}), /* @__PURE__ */ jsx("circle", {
|
|
73
|
+
"data-slot": "circular-progress-indicator",
|
|
74
|
+
cx: normalizedSize / 2,
|
|
75
|
+
cy: normalizedSize / 2,
|
|
76
|
+
r: radius,
|
|
77
|
+
fill: "none",
|
|
78
|
+
strokeWidth: normalizedStrokeWidth,
|
|
79
|
+
strokeLinecap: "round",
|
|
80
|
+
className: cn("stroke-current motion-reduce:transition-none", progressColor ? void 0 : indicatorVariants[variant], indeterminate ? void 0 : "transition-[stroke-dashoffset] duration-500 ease-out"),
|
|
81
|
+
style: {
|
|
82
|
+
strokeDasharray: indeterminate ? `${circumference * .35} ${circumference}` : `${circumference}`,
|
|
83
|
+
strokeDashoffset: indeterminate ? `${circumference * .1}` : `${circumference - (percent ?? 0) / 100 * circumference}`,
|
|
84
|
+
...progressColor ? { stroke: progressColor } : {}
|
|
85
|
+
}
|
|
86
|
+
})]
|
|
87
|
+
}),
|
|
88
|
+
centerLabel ? /* @__PURE__ */ jsx("span", {
|
|
89
|
+
"data-slot": "circular-progress-label",
|
|
90
|
+
"aria-hidden": "true",
|
|
91
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center font-medium text-[11px] leading-none",
|
|
92
|
+
children: centerLabel
|
|
93
|
+
}) : null,
|
|
94
|
+
/* @__PURE__ */ jsx("span", {
|
|
95
|
+
className: "sr-only",
|
|
96
|
+
"aria-live": "polite",
|
|
97
|
+
children: indeterminate ? indeterminateLabel : `${roundedPercent}% complete`
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
export { CircularProgress };
|
|
104
|
+
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/CircularProgress/CircularProgress.tsx"],"sourcesContent":["import type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nconst indicatorVariants = {\n default: \"text-primary-invert-bg\",\n brand: \"text-brand-500-primary\",\n success: \"text-success-txt\",\n warning: \"text-warning-txt\",\n info: \"text-info-txt\",\n destructive: \"text-danger-txt\",\n analyzing: \"text-[var(--progress-analyzing)]\",\n ingesting: \"text-[var(--progress-ingesting)]\",\n} as const;\n\nconst trackVariants = {\n default: \"text-primary-border\",\n brand: \"text-brand-500-primary/20\",\n success: \"text-success-txt/20\",\n warning: \"text-warning-txt/20\",\n info: \"text-info-txt/20\",\n destructive: \"text-danger-txt/20\",\n analyzing: \"text-primary-invert-bg/20\",\n ingesting: \"text-primary-invert-bg/20\",\n} as const;\n\ntype CircularProgressVariant = keyof typeof indicatorVariants;\n\ntype CircularProgressProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n /** Determinate value. Omit for indeterminate/loading state. */\n value?: number;\n /** Lower bound used for ARIA/value normalization. */\n min?: number;\n /** Upper bound used for ARIA/value normalization. */\n max?: number;\n /** Rendered diameter in px. */\n size?: number;\n /** Stroke thickness in px. */\n strokeWidth?: number;\n /** Semantic colour variant for the progress stroke. */\n variant?: CircularProgressVariant;\n /** Semantic colour variant for the track stroke. Defaults to `variant`. */\n trackVariant?: CircularProgressVariant;\n /** Explicit progress stroke colour (CSS colour value). Overrides `variant`. */\n progressColor?: string;\n /** Explicit track stroke colour (CSS colour value). Overrides `trackVariant`. */\n trackColor?: string;\n /** Optional centered label content. */\n label?: React.ReactNode;\n /** Render computed percentage text in the center when determinate. */\n showValueLabel?: boolean;\n /** Accessible text for indeterminate/loading state. */\n indeterminateLabel?: string;\n};\n\nfunction clamp(value: number, min: number, max: number) {\n return Math.min(max, Math.max(min, value));\n}\n\n/** Circular progress indicator supporting determinate and indeterminate states. */\nfunction CircularProgress({\n className,\n value,\n min = 0,\n max = 100,\n size = 48,\n strokeWidth = 4,\n variant = \"default\",\n trackVariant,\n progressColor,\n trackColor,\n label,\n showValueLabel = false,\n indeterminateLabel = \"Loading\",\n style,\n \"aria-label\": ariaLabelProp,\n \"aria-valuetext\": ariaValueTextProp,\n ...props\n}: CircularProgressProps) {\n const normalizedMax = max > min ? max : min + 100;\n const boundedValue = value == null ? undefined : clamp(value, min, normalizedMax);\n const indeterminate = boundedValue == null;\n\n const percent = indeterminate ? undefined : ((boundedValue - min) / (normalizedMax - min)) * 100;\n const roundedPercent = percent == null ? undefined : Math.round(percent);\n\n const normalizedSize = Math.max(size, 12);\n const normalizedStrokeWidth = clamp(strokeWidth, 1, normalizedSize / 2);\n const radius = (normalizedSize - normalizedStrokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n\n const centerLabel =\n label ?? (showValueLabel && roundedPercent != null ? `${roundedPercent}%` : null);\n const ariaValueText =\n ariaValueTextProp ?? (indeterminate ? indeterminateLabel : `${roundedPercent}% complete`);\n\n return (\n <div\n data-slot=\"circular-progress\"\n data-state={indeterminate ? \"indeterminate\" : \"determinate\"}\n role=\"progressbar\"\n aria-label={ariaLabelProp ?? \"Progress\"}\n aria-valuemin={min}\n aria-valuemax={normalizedMax}\n aria-valuenow={indeterminate ? undefined : boundedValue}\n aria-valuetext={ariaValueText}\n className={cn(\n \"relative inline-flex shrink-0 items-center justify-center rounded-full text-primary-txt outline-none focus-visible:ring-3 focus-visible:ring-focus\",\n className,\n )}\n style={{ width: normalizedSize, height: normalizedSize, ...style }}\n {...props}\n >\n <svg\n data-slot=\"circular-progress-svg\"\n width={normalizedSize}\n height={normalizedSize}\n viewBox={`0 0 ${normalizedSize} ${normalizedSize}`}\n className={cn(\"size-full -rotate-90\", indeterminate && \"motion-safe:animate-spin\")}\n >\n <circle\n data-slot=\"circular-progress-track\"\n cx={normalizedSize / 2}\n cy={normalizedSize / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={normalizedStrokeWidth}\n className={cn(\n \"stroke-current\",\n trackColor ? undefined : trackVariants[trackVariant ?? variant],\n )}\n style={trackColor ? { stroke: trackColor } : undefined}\n />\n <circle\n data-slot=\"circular-progress-indicator\"\n cx={normalizedSize / 2}\n cy={normalizedSize / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={normalizedStrokeWidth}\n strokeLinecap=\"round\"\n className={cn(\n \"stroke-current motion-reduce:transition-none\",\n progressColor ? undefined : indicatorVariants[variant],\n indeterminate ? undefined : \"transition-[stroke-dashoffset] duration-500 ease-out\",\n )}\n style={{\n strokeDasharray: indeterminate\n ? `${circumference * 0.35} ${circumference}`\n : `${circumference}`,\n strokeDashoffset: indeterminate\n ? `${circumference * 0.1}`\n : `${circumference - ((percent ?? 0) / 100) * circumference}`,\n ...(progressColor ? { stroke: progressColor } : {}),\n }}\n />\n </svg>\n\n {centerLabel ? (\n <span\n data-slot=\"circular-progress-label\"\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 flex items-center justify-center font-medium text-[11px] leading-none\"\n >\n {centerLabel}\n </span>\n ) : null}\n\n <span className=\"sr-only\" aria-live=\"polite\">\n {indeterminate ? indeterminateLabel : `${roundedPercent}% complete`}\n </span>\n </div>\n );\n}\n\nexport { CircularProgress, type CircularProgressProps, type CircularProgressVariant };\n"],"mappings":";;;AAIA,MAAM,oBAAoB;CACxB,SAAS;CACT,OAAO;CACP,SAAS;CACT,SAAS;CACT,MAAM;CACN,aAAa;CACb,WAAW;CACX,WAAW;AACb;AAEA,MAAM,gBAAgB;CACpB,SAAS;CACT,OAAO;CACP,SAAS;CACT,SAAS;CACT,MAAM;CACN,aAAa;CACb,WAAW;CACX,WAAW;AACb;AA+BA,SAAS,MAAM,OAAe,KAAa,KAAa;CACtD,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;;AAGA,SAAS,iBAAiB,EACxB,WACA,OACA,MAAM,GACN,MAAM,KACN,OAAO,IACP,cAAc,GACd,UAAU,WACV,cACA,eACA,YACA,OACA,iBAAiB,OACjB,qBAAqB,WACrB,OACA,cAAc,eACd,kBAAkB,mBAClB,GAAG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AAU;KACV,IAAI,iBAAiB;KACrB,IAAI,iBAAiB;KACrB,GAAG;KACH,MAAK;KACL,aAAa;KACb,eAAc;KACd,WAAW,GACT,gDACA,gBAAgB,KAAA,IAAY,kBAAkB,UAC9C,gBAAgB,KAAA,IAAY,sDAC9B;KACA,OAAO;MACL,iBAAiB,gBACb,GAAG,gBAAgB,IAAK,GAAG,kBAC3B,GAAG;MACP,kBAAkB,gBACd,GAAG,gBAAgB,OACnB,GAAG,iBAAkB,WAAW,KAAK,MAAO;MAChD,GAAI,gBAAgB,EAAE,QAAQ,cAAc,IAAI,CAAC;KACnD;IACD,CAAA,CACE;;GAEJ,cACC,oBAAC,QAAD;IACE,aAAU;IACV,eAAY;IACZ,WAAU;cAET;GACG,CAAA,IACJ;GAEJ,oBAAC,QAAD;IAAM,WAAU;IAAU,aAAU;cACjC,gBAAgB,qBAAqB,GAAG,eAAe;GACpD,CAAA;EACH;;AAET"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as CollapsibleContent, r as CollapsibleTrigger, t as Collapsible } from "../../
|
|
1
|
+
import { n as CollapsibleContent, r as CollapsibleTrigger, t as Collapsible } from "../../index18.cjs";
|
|
2
2
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as CollapsibleContent, r as CollapsibleTrigger, t as Collapsible } from "../../
|
|
1
|
+
import { n as CollapsibleContent, r as CollapsibleTrigger, t as Collapsible } from "../../index18.js";
|
|
2
2
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("../../chunk.cjs");
|
|
3
|
+
const require_cn = require("../../cn.cjs");
|
|
4
|
+
const require_Icon = require("../../Icon.cjs");
|
|
5
|
+
const require_primitives_Command_index = require("../Command/index.cjs");
|
|
6
|
+
const require_primitives_Input_index = require("../Input/index.cjs");
|
|
7
|
+
const require_primitives_Popover_index = require("../Popover/index.cjs");
|
|
8
|
+
let react = require("react");
|
|
9
|
+
react = require_chunk.__toESM(react);
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
let lucide_react = require("lucide-react");
|
|
12
|
+
let cmdk = require("cmdk");
|
|
13
|
+
//#region src/primitives/Combobox/Combobox.tsx
|
|
14
|
+
const ComboboxContext = react.createContext(null);
|
|
15
|
+
function useComboboxContext(caller) {
|
|
16
|
+
const ctx = react.useContext(ComboboxContext);
|
|
17
|
+
if (!ctx) throw new Error(`${caller} must be used within <Combobox>`);
|
|
18
|
+
return ctx;
|
|
19
|
+
}
|
|
20
|
+
/** Derive a plain-text label from item children (used for search keywords and the trigger display). */
|
|
21
|
+
function textLabel(children) {
|
|
22
|
+
if (typeof children === "string") return children;
|
|
23
|
+
if (typeof children === "number") return String(children);
|
|
24
|
+
if (Array.isArray(children) && children.every((c) => typeof c === "string" || typeof c === "number")) return children.join("");
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Searchable single-select dropdown (the shadcn "combobox" recipe): a Popover
|
|
28
|
+
* holding a filterable Command list. Holds the selected value and open state,
|
|
29
|
+
* and closes on selection. Search state resets automatically on close because
|
|
30
|
+
* the content unmounts.
|
|
31
|
+
*/
|
|
32
|
+
function Combobox({ value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, modal, children }) {
|
|
33
|
+
const [uncontrolledValue, setUncontrolledValue] = react.useState(defaultValue ?? "");
|
|
34
|
+
const [uncontrolledOpen, setUncontrolledOpen] = react.useState(defaultOpen ?? false);
|
|
35
|
+
const currentValue = value ?? uncontrolledValue;
|
|
36
|
+
const currentOpen = open ?? uncontrolledOpen;
|
|
37
|
+
const setOpen = react.useCallback((next) => {
|
|
38
|
+
setUncontrolledOpen(next);
|
|
39
|
+
onOpenChange?.(next);
|
|
40
|
+
}, [onOpenChange]);
|
|
41
|
+
const select = react.useCallback((next) => {
|
|
42
|
+
setUncontrolledValue(next);
|
|
43
|
+
onValueChange?.(next);
|
|
44
|
+
setOpen(false);
|
|
45
|
+
}, [onValueChange, setOpen]);
|
|
46
|
+
const [labels, setLabels] = react.useState(/* @__PURE__ */ new Map());
|
|
47
|
+
const registerItem = react.useCallback((itemValue, label) => {
|
|
48
|
+
setLabels((prev) => prev.get(itemValue) === label ? prev : new Map(prev).set(itemValue, label));
|
|
49
|
+
}, []);
|
|
50
|
+
const ctx = react.useMemo(() => ({
|
|
51
|
+
value: currentValue,
|
|
52
|
+
select,
|
|
53
|
+
registerItem,
|
|
54
|
+
labels
|
|
55
|
+
}), [
|
|
56
|
+
currentValue,
|
|
57
|
+
select,
|
|
58
|
+
registerItem,
|
|
59
|
+
labels
|
|
60
|
+
]);
|
|
61
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComboboxContext.Provider, {
|
|
62
|
+
value: ctx,
|
|
63
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Popover_index.Popover, {
|
|
64
|
+
open: currentOpen,
|
|
65
|
+
onOpenChange: setOpen,
|
|
66
|
+
modal,
|
|
67
|
+
children
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const PILL = "flex min-h-8 items-center gap-1 rounded-12 border border-primary-border bg-input-bg px-3 py-1 text-xs leading-4";
|
|
72
|
+
/**
|
|
73
|
+
* Pill-shaped trigger showing the current selection. With no `children`, it
|
|
74
|
+
* renders the selected item's label (or `placeholder` when nothing is
|
|
75
|
+
* selected); pass `children` to fully control the display — e.g. when the
|
|
76
|
+
* selected label comes from data the items haven't mounted with yet.
|
|
77
|
+
*/
|
|
78
|
+
function ComboboxTrigger({ className, label, placeholder, children, ...props }) {
|
|
79
|
+
const { value, labels } = useComboboxContext("ComboboxTrigger");
|
|
80
|
+
const display = children ?? (value ? labels.get(value) ?? value : void 0);
|
|
81
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_primitives_Popover_index.PopoverTrigger, {
|
|
82
|
+
"data-slot": "combobox-trigger",
|
|
83
|
+
className: require_cn.cn(PILL, "text-left transition-colors hover:border-focus/60", className),
|
|
84
|
+
...props,
|
|
85
|
+
children: [
|
|
86
|
+
label && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
87
|
+
className: "shrink-0 text-muted-txt",
|
|
88
|
+
children: [label, ":"]
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
91
|
+
className: require_cn.cn("min-w-0 truncate", display != null ? "font-medium" : "text-muted-txt"),
|
|
92
|
+
children: display ?? placeholder
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
95
|
+
as: lucide_react.ChevronDown,
|
|
96
|
+
className: "ml-1 size-4 shrink-0 text-muted-txt"
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/** The dropdown panel: a Command (filterable list) inside a PopoverContent. */
|
|
102
|
+
function ComboboxContent({ className, align = "start", children, filter, shouldFilter, loop, ...props }) {
|
|
103
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Popover_index.PopoverContent, {
|
|
104
|
+
"data-slot": "combobox-content",
|
|
105
|
+
align,
|
|
106
|
+
className: require_cn.cn("w-64 p-0", className),
|
|
107
|
+
...props,
|
|
108
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Command_index.Command, {
|
|
109
|
+
filter,
|
|
110
|
+
shouldFilter,
|
|
111
|
+
loop,
|
|
112
|
+
className: "bg-transparent",
|
|
113
|
+
children
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/** Bordered search field pinned above the list; typing filters the items. */
|
|
118
|
+
function ComboboxInput({ className, wrapperClassName, ...props }) {
|
|
119
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
120
|
+
"data-slot": "combobox-input-wrapper",
|
|
121
|
+
className: require_cn.cn("border-b p-2", wrapperClassName),
|
|
122
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
123
|
+
className: "relative",
|
|
124
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
125
|
+
as: lucide_react.Search,
|
|
126
|
+
className: "absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-txt"
|
|
127
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(cmdk.Command.Input, {
|
|
128
|
+
"data-slot": "combobox-input",
|
|
129
|
+
className: require_cn.cn(require_primitives_Input_index.inputVariants({ size: "sm" }), "pl-8", className),
|
|
130
|
+
...props
|
|
131
|
+
})]
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/** Scrollable container for the option rows. */
|
|
136
|
+
function ComboboxList({ className, ...props }) {
|
|
137
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Command_index.CommandList, {
|
|
138
|
+
"data-slot": "combobox-list",
|
|
139
|
+
className: require_cn.cn("max-h-64 py-1", className),
|
|
140
|
+
...props
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/** Placeholder row shown when the search matches no items. */
|
|
144
|
+
function ComboboxEmpty({ className, ...props }) {
|
|
145
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(cmdk.Command.Empty, {
|
|
146
|
+
"data-slot": "combobox-empty",
|
|
147
|
+
className: require_cn.cn("px-3 py-2 text-sm text-muted-txt", className),
|
|
148
|
+
...props
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/** A labelled group of related options, with an optional `heading`. */
|
|
152
|
+
function ComboboxGroup({ className, ...props }) {
|
|
153
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Command_index.CommandGroup, {
|
|
154
|
+
"data-slot": "combobox-group",
|
|
155
|
+
className: require_cn.cn("p-0 [&_[cmdk-group-heading]]:px-3", className),
|
|
156
|
+
...props
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/** A thin divider line between option groups. */
|
|
160
|
+
function ComboboxSeparator({ className, ...props }) {
|
|
161
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Command_index.CommandSeparator, {
|
|
162
|
+
"data-slot": "combobox-separator",
|
|
163
|
+
className: require_cn.cn("mx-0", className),
|
|
164
|
+
...props
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* A selectable option. `value` is what the combobox reports on selection;
|
|
169
|
+
* search matches the visible text (or explicit `keywords`), not the `value`.
|
|
170
|
+
*/
|
|
171
|
+
function ComboboxItem({ value, keywords, className, children, onSelect, ...props }) {
|
|
172
|
+
const ctx = useComboboxContext("ComboboxItem");
|
|
173
|
+
const isSelected = value === ctx.value;
|
|
174
|
+
const label = textLabel(children);
|
|
175
|
+
const { registerItem, select } = ctx;
|
|
176
|
+
react.useEffect(() => {
|
|
177
|
+
if (label !== void 0) registerItem(value, label);
|
|
178
|
+
}, [
|
|
179
|
+
value,
|
|
180
|
+
label,
|
|
181
|
+
registerItem
|
|
182
|
+
]);
|
|
183
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_primitives_Command_index.CommandItem, {
|
|
184
|
+
"data-slot": "combobox-item",
|
|
185
|
+
value,
|
|
186
|
+
keywords: keywords ?? (label !== void 0 ? [label] : void 0),
|
|
187
|
+
onSelect: (selected) => {
|
|
188
|
+
select(value);
|
|
189
|
+
onSelect?.(selected);
|
|
190
|
+
},
|
|
191
|
+
className: require_cn.cn("cursor-pointer rounded-none px-3 py-2 hover:bg-ghost-hover-bg active:bg-ghost-hover-bg data-[selected=true]:bg-ghost-hover-bg", isSelected && "bg-secondary-bg font-medium data-[selected=true]:bg-secondary-bg", className),
|
|
192
|
+
...props,
|
|
193
|
+
children: [children, isSelected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
194
|
+
as: lucide_react.Check,
|
|
195
|
+
className: "ml-auto size-3.5 shrink-0 text-primary"
|
|
196
|
+
})]
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
//#endregion
|
|
200
|
+
exports.Combobox = Combobox;
|
|
201
|
+
exports.ComboboxContent = ComboboxContent;
|
|
202
|
+
exports.ComboboxEmpty = ComboboxEmpty;
|
|
203
|
+
exports.ComboboxGroup = ComboboxGroup;
|
|
204
|
+
exports.ComboboxInput = ComboboxInput;
|
|
205
|
+
exports.ComboboxItem = ComboboxItem;
|
|
206
|
+
exports.ComboboxList = ComboboxList;
|
|
207
|
+
exports.ComboboxSeparator = ComboboxSeparator;
|
|
208
|
+
exports.ComboboxTrigger = ComboboxTrigger;
|
|
209
|
+
|
|
210
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["React","Popover","PopoverTrigger","cn","Icon","ChevronDown","PopoverContent","Command","Search","CommandPrimitive","inputVariants","CommandList","CommandGroup","CommandSeparator","CommandItem","Check"],"sources":["../../../src/primitives/Combobox/Combobox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { Check, ChevronDown, Search } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport {\n Command,\n CommandGroup,\n CommandItem,\n CommandList,\n CommandSeparator,\n} from \"@/primitives/Command\";\nimport { Icon } from \"@/primitives/Icon\";\nimport { inputVariants } from \"@/primitives/Input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/primitives/Popover\";\nimport { cn } from \"@/utils\";\n\ninterface ComboboxContextValue {\n value: string;\n select: (value: string) => void;\n registerItem: (value: string, label: string) => void;\n labels: ReadonlyMap<string, string>;\n}\n\nconst ComboboxContext = React.createContext<ComboboxContextValue | null>(null);\n\nfunction useComboboxContext(caller: string) {\n const ctx = React.useContext(ComboboxContext);\n if (!ctx) throw new Error(`${caller} must be used within <Combobox>`);\n return ctx;\n}\n\n/** Derive a plain-text label from item children (used for search keywords and the trigger display). */\nfunction textLabel(children: React.ReactNode): string | undefined {\n if (typeof children === \"string\") return children;\n if (typeof children === \"number\") return String(children);\n if (\n Array.isArray(children) &&\n children.every((c) => typeof c === \"string\" || typeof c === \"number\")\n )\n return children.join(\"\");\n return undefined;\n}\n\ninterface ComboboxProps {\n /** Controlled selected value. */\n value?: string;\n /** Initial selected value (uncontrolled). */\n defaultValue?: string;\n /** Called with the item's `value` when a selection is made. */\n onValueChange?: (value: string) => void;\n /** Controlled open state of the dropdown. */\n open?: boolean;\n /** Initially open (uncontrolled). */\n defaultOpen?: boolean;\n /** Called when the dropdown opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** Forwarded to the underlying Popover root. */\n modal?: boolean;\n children?: React.ReactNode;\n}\n\n/**\n * Searchable single-select dropdown (the shadcn \"combobox\" recipe): a Popover\n * holding a filterable Command list. Holds the selected value and open state,\n * and closes on selection. Search state resets automatically on close because\n * the content unmounts.\n */\nfunction Combobox({\n value,\n defaultValue,\n onValueChange,\n open,\n defaultOpen,\n onOpenChange,\n modal,\n children,\n}: Readonly<ComboboxProps>) {\n const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue ?? \"\");\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);\n const currentValue = value ?? uncontrolledValue;\n const currentOpen = open ?? uncontrolledOpen;\n\n const setOpen = React.useCallback(\n (next: boolean) => {\n setUncontrolledOpen(next);\n onOpenChange?.(next);\n },\n [onOpenChange],\n );\n\n const select = React.useCallback(\n (next: string) => {\n setUncontrolledValue(next);\n onValueChange?.(next);\n setOpen(false);\n },\n [onValueChange, setOpen],\n );\n\n // value → display-label cache fed by mounted items. Labels are kept after the\n // content unmounts (popover close) so the trigger can keep showing them.\n const [labels, setLabels] = React.useState<ReadonlyMap<string, string>>(new Map());\n const registerItem = React.useCallback((itemValue: string, label: string) => {\n setLabels((prev) =>\n prev.get(itemValue) === label ? prev : new Map(prev).set(itemValue, label),\n );\n }, []);\n\n const ctx = React.useMemo(\n () => ({ value: currentValue, select, registerItem, labels }),\n [currentValue, select, registerItem, labels],\n );\n\n return (\n <ComboboxContext.Provider value={ctx}>\n <Popover open={currentOpen} onOpenChange={setOpen} modal={modal}>\n {children}\n </Popover>\n </ComboboxContext.Provider>\n );\n}\n\n// Pill chrome shared with the Header project picker — keeps the lockup consistent.\nconst PILL =\n \"flex min-h-8 items-center gap-1 rounded-12 border border-primary-border bg-input-bg px-3 py-1 text-xs leading-4\";\n\n/**\n * Pill-shaped trigger showing the current selection. With no `children`, it\n * renders the selected item's label (or `placeholder` when nothing is\n * selected); pass `children` to fully control the display — e.g. when the\n * selected label comes from data the items haven't mounted with yet.\n */\nfunction ComboboxTrigger({\n className,\n /** Muted prefix rendered as `label:` before the value (e.g. `Project:`). */\n label,\n /** Muted text shown while nothing is selected. */\n placeholder,\n children,\n ...props\n}: React.ComponentProps<typeof PopoverTrigger> & { label?: string; placeholder?: string }) {\n const { value, labels } = useComboboxContext(\"ComboboxTrigger\");\n const display = children ?? (value ? (labels.get(value) ?? value) : undefined);\n\n return (\n <PopoverTrigger\n data-slot=\"combobox-trigger\"\n className={cn(PILL, \"text-left transition-colors hover:border-focus/60\", className)}\n {...props}\n >\n {label && <span className=\"shrink-0 text-muted-txt\">{label}:</span>}\n <span className={cn(\"min-w-0 truncate\", display != null ? \"font-medium\" : \"text-muted-txt\")}>\n {display ?? placeholder}\n </span>\n <Icon as={ChevronDown} className=\"ml-1 size-4 shrink-0 text-muted-txt\" />\n </PopoverTrigger>\n );\n}\n\n/** The dropdown panel: a Command (filterable list) inside a PopoverContent. */\nfunction ComboboxContent({\n className,\n align = \"start\",\n children,\n filter,\n shouldFilter,\n loop,\n ...props\n}: React.ComponentProps<typeof PopoverContent> &\n Pick<React.ComponentProps<typeof CommandPrimitive>, \"filter\" | \"shouldFilter\" | \"loop\">) {\n return (\n <PopoverContent\n data-slot=\"combobox-content\"\n align={align}\n className={cn(\"w-64 p-0\", className)}\n {...props}\n >\n <Command filter={filter} shouldFilter={shouldFilter} loop={loop} className=\"bg-transparent\">\n {children}\n </Command>\n </PopoverContent>\n );\n}\n\n/** Bordered search field pinned above the list; typing filters the items. */\nfunction ComboboxInput({\n className,\n /** Extra classes for the padded, bottom-bordered section around the field. */\n wrapperClassName,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input> & { wrapperClassName?: string }) {\n return (\n <div data-slot=\"combobox-input-wrapper\" className={cn(\"border-b p-2\", wrapperClassName)}>\n <div className=\"relative\">\n <Icon\n as={Search}\n className=\"absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-txt\"\n />\n <CommandPrimitive.Input\n data-slot=\"combobox-input\"\n className={cn(inputVariants({ size: \"sm\" }), \"pl-8\", className)}\n {...props}\n />\n </div>\n </div>\n );\n}\n\n/** Scrollable container for the option rows. */\nfunction ComboboxList({ className, ...props }: React.ComponentProps<typeof CommandList>) {\n return (\n <CommandList data-slot=\"combobox-list\" className={cn(\"max-h-64 py-1\", className)} {...props} />\n );\n}\n\n/** Placeholder row shown when the search matches no items. */\nfunction ComboboxEmpty({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\"px-3 py-2 text-sm text-muted-txt\", className)}\n {...props}\n />\n );\n}\n\n/** A labelled group of related options, with an optional `heading`. */\nfunction ComboboxGroup({ className, ...props }: React.ComponentProps<typeof CommandGroup>) {\n return (\n <CommandGroup\n data-slot=\"combobox-group\"\n className={cn(\"p-0 [&_[cmdk-group-heading]]:px-3\", className)}\n {...props}\n />\n );\n}\n\n/** A thin divider line between option groups. */\nfunction ComboboxSeparator({ className, ...props }: React.ComponentProps<typeof CommandSeparator>) {\n return (\n <CommandSeparator data-slot=\"combobox-separator\" className={cn(\"mx-0\", className)} {...props} />\n );\n}\n\n/**\n * A selectable option. `value` is what the combobox reports on selection;\n * search matches the visible text (or explicit `keywords`), not the `value`.\n */\nfunction ComboboxItem({\n /** The value reported by `onValueChange` when this item is chosen. */\n value,\n /** Extra strings the search should match; defaults to the item's text content. */\n keywords,\n className,\n children,\n onSelect,\n ...props\n}: Omit<React.ComponentProps<typeof CommandItem>, \"value\"> & { value: string }) {\n const ctx = useComboboxContext(\"ComboboxItem\");\n const isSelected = value === ctx.value;\n const label = textLabel(children);\n const { registerItem, select } = ctx;\n\n React.useEffect(() => {\n if (label !== undefined) registerItem(value, label);\n }, [value, label, registerItem]);\n\n return (\n <CommandItem\n data-slot=\"combobox-item\"\n value={value}\n keywords={keywords ?? (label !== undefined ? [label] : undefined)}\n onSelect={(selected) => {\n select(value);\n onSelect?.(selected);\n }}\n className={cn(\n // Header project-picker row: hover/highlight ghost, chosen bg/secondary + medium.\n \"cursor-pointer rounded-none px-3 py-2 hover:bg-ghost-hover-bg active:bg-ghost-hover-bg data-[selected=true]:bg-ghost-hover-bg\",\n isSelected && \"bg-secondary-bg font-medium data-[selected=true]:bg-secondary-bg\",\n className,\n )}\n {...props}\n >\n {children}\n {isSelected && <Icon as={Check} className=\"ml-auto size-3.5 shrink-0 text-primary\" />}\n </CommandItem>\n );\n}\n\nexport {\n Combobox,\n ComboboxTrigger,\n ComboboxContent,\n ComboboxInput,\n ComboboxList,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxItem,\n ComboboxSeparator,\n};\n"],"mappings":";;;;;;;;;;;;;AAyBA,MAAM,kBAAkBA,MAAM,cAA2C,IAAI;AAE7E,SAAS,mBAAmB,QAAgB;CAC1C,MAAM,MAAMA,MAAM,WAAW,eAAe;CAC5C,IAAI,CAAC,KAAK,MAAM,IAAI,MAAM,GAAG,OAAO,gCAAgC;CACpE,OAAO;AACT;;AAGA,SAAS,UAAU,UAA+C;CAChE,IAAI,OAAO,aAAa,UAAU,OAAO;CACzC,IAAI,OAAO,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AAAA,aAAD;EACE,aAAU;EACH;EACP,UAAU,aAAa,UAAU,KAAA,IAAY,CAAC,KAAK,IAAI,KAAA;EACvD,WAAW,aAAa;GACtB,OAAO,KAAK;GACZ,WAAW,QAAQ;EACrB;EACA,WAAWX,WAAAA,GAET,iIACA,cAAc,oEACd,SACF;EACA,GAAI;YAdN,CAgBG,UACA,cAAc,iBAAA,GAAA,kBAAA,KAACC,aAAAA,MAAD;GAAM,IAAIW,aAAAA;GAAO,WAAU;EAA0C,CAAA,CACzE;;AAEjB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ComboboxInput, c as ComboboxSeparator, i as ComboboxGroup, l as ComboboxTrigger, n as ComboboxContent, o as ComboboxItem, r as ComboboxEmpty, s as ComboboxList, t as Combobox } from "../../index22.cjs";
|
|
2
|
+
export { Combobox, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator, ComboboxTrigger };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ComboboxInput, c as ComboboxSeparator, i as ComboboxGroup, l as ComboboxTrigger, n as ComboboxContent, o as ComboboxItem, r as ComboboxEmpty, s as ComboboxList, t as Combobox } from "../../index22.js";
|
|
2
|
+
export { Combobox, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator, ComboboxTrigger };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { t as cn } from "../../cn.js";
|
|
2
|
+
import { t as Icon } from "../../Icon.js";
|
|
3
|
+
import { Command as Command$1, CommandGroup, CommandItem, CommandList, CommandSeparator } from "../Command/index.js";
|
|
4
|
+
import { inputVariants } from "../Input/index.js";
|
|
5
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../Popover/index.js";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Check, ChevronDown, Search } from "lucide-react";
|
|
9
|
+
import { Command } from "cmdk";
|
|
10
|
+
//#region src/primitives/Combobox/Combobox.tsx
|
|
11
|
+
const ComboboxContext = React.createContext(null);
|
|
12
|
+
function useComboboxContext(caller) {
|
|
13
|
+
const ctx = React.useContext(ComboboxContext);
|
|
14
|
+
if (!ctx) throw new Error(`${caller} must be used within <Combobox>`);
|
|
15
|
+
return ctx;
|
|
16
|
+
}
|
|
17
|
+
/** Derive a plain-text label from item children (used for search keywords and the trigger display). */
|
|
18
|
+
function textLabel(children) {
|
|
19
|
+
if (typeof children === "string") return children;
|
|
20
|
+
if (typeof children === "number") return String(children);
|
|
21
|
+
if (Array.isArray(children) && children.every((c) => typeof c === "string" || typeof c === "number")) return children.join("");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Searchable single-select dropdown (the shadcn "combobox" recipe): a Popover
|
|
25
|
+
* holding a filterable Command list. Holds the selected value and open state,
|
|
26
|
+
* and closes on selection. Search state resets automatically on close because
|
|
27
|
+
* the content unmounts.
|
|
28
|
+
*/
|
|
29
|
+
function Combobox({ value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, modal, children }) {
|
|
30
|
+
const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue ?? "");
|
|
31
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);
|
|
32
|
+
const currentValue = value ?? uncontrolledValue;
|
|
33
|
+
const currentOpen = open ?? uncontrolledOpen;
|
|
34
|
+
const setOpen = React.useCallback((next) => {
|
|
35
|
+
setUncontrolledOpen(next);
|
|
36
|
+
onOpenChange?.(next);
|
|
37
|
+
}, [onOpenChange]);
|
|
38
|
+
const select = React.useCallback((next) => {
|
|
39
|
+
setUncontrolledValue(next);
|
|
40
|
+
onValueChange?.(next);
|
|
41
|
+
setOpen(false);
|
|
42
|
+
}, [onValueChange, setOpen]);
|
|
43
|
+
const [labels, setLabels] = React.useState(/* @__PURE__ */ new Map());
|
|
44
|
+
const registerItem = React.useCallback((itemValue, label) => {
|
|
45
|
+
setLabels((prev) => prev.get(itemValue) === label ? prev : new Map(prev).set(itemValue, label));
|
|
46
|
+
}, []);
|
|
47
|
+
const ctx = React.useMemo(() => ({
|
|
48
|
+
value: currentValue,
|
|
49
|
+
select,
|
|
50
|
+
registerItem,
|
|
51
|
+
labels
|
|
52
|
+
}), [
|
|
53
|
+
currentValue,
|
|
54
|
+
select,
|
|
55
|
+
registerItem,
|
|
56
|
+
labels
|
|
57
|
+
]);
|
|
58
|
+
return /* @__PURE__ */ jsx(ComboboxContext.Provider, {
|
|
59
|
+
value: ctx,
|
|
60
|
+
children: /* @__PURE__ */ jsx(Popover, {
|
|
61
|
+
open: currentOpen,
|
|
62
|
+
onOpenChange: setOpen,
|
|
63
|
+
modal,
|
|
64
|
+
children
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const PILL = "flex min-h-8 items-center gap-1 rounded-12 border border-primary-border bg-input-bg px-3 py-1 text-xs leading-4";
|
|
69
|
+
/**
|
|
70
|
+
* Pill-shaped trigger showing the current selection. With no `children`, it
|
|
71
|
+
* renders the selected item's label (or `placeholder` when nothing is
|
|
72
|
+
* selected); pass `children` to fully control the display — e.g. when the
|
|
73
|
+
* selected label comes from data the items haven't mounted with yet.
|
|
74
|
+
*/
|
|
75
|
+
function ComboboxTrigger({ className, label, placeholder, children, ...props }) {
|
|
76
|
+
const { value, labels } = useComboboxContext("ComboboxTrigger");
|
|
77
|
+
const display = children ?? (value ? labels.get(value) ?? value : void 0);
|
|
78
|
+
return /* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
79
|
+
"data-slot": "combobox-trigger",
|
|
80
|
+
className: cn(PILL, "text-left transition-colors hover:border-focus/60", className),
|
|
81
|
+
...props,
|
|
82
|
+
children: [
|
|
83
|
+
label && /* @__PURE__ */ jsxs("span", {
|
|
84
|
+
className: "shrink-0 text-muted-txt",
|
|
85
|
+
children: [label, ":"]
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ jsx("span", {
|
|
88
|
+
className: cn("min-w-0 truncate", display != null ? "font-medium" : "text-muted-txt"),
|
|
89
|
+
children: display ?? placeholder
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
92
|
+
as: ChevronDown,
|
|
93
|
+
className: "ml-1 size-4 shrink-0 text-muted-txt"
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/** The dropdown panel: a Command (filterable list) inside a PopoverContent. */
|
|
99
|
+
function ComboboxContent({ className, align = "start", children, filter, shouldFilter, loop, ...props }) {
|
|
100
|
+
return /* @__PURE__ */ jsx(PopoverContent, {
|
|
101
|
+
"data-slot": "combobox-content",
|
|
102
|
+
align,
|
|
103
|
+
className: cn("w-64 p-0", className),
|
|
104
|
+
...props,
|
|
105
|
+
children: /* @__PURE__ */ jsx(Command$1, {
|
|
106
|
+
filter,
|
|
107
|
+
shouldFilter,
|
|
108
|
+
loop,
|
|
109
|
+
className: "bg-transparent",
|
|
110
|
+
children
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/** Bordered search field pinned above the list; typing filters the items. */
|
|
115
|
+
function ComboboxInput({ className, wrapperClassName, ...props }) {
|
|
116
|
+
return /* @__PURE__ */ jsx("div", {
|
|
117
|
+
"data-slot": "combobox-input-wrapper",
|
|
118
|
+
className: cn("border-b p-2", wrapperClassName),
|
|
119
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
120
|
+
className: "relative",
|
|
121
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
122
|
+
as: Search,
|
|
123
|
+
className: "absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-txt"
|
|
124
|
+
}), /* @__PURE__ */ jsx(Command.Input, {
|
|
125
|
+
"data-slot": "combobox-input",
|
|
126
|
+
className: cn(inputVariants({ size: "sm" }), "pl-8", className),
|
|
127
|
+
...props
|
|
128
|
+
})]
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/** Scrollable container for the option rows. */
|
|
133
|
+
function ComboboxList({ className, ...props }) {
|
|
134
|
+
return /* @__PURE__ */ jsx(CommandList, {
|
|
135
|
+
"data-slot": "combobox-list",
|
|
136
|
+
className: cn("max-h-64 py-1", className),
|
|
137
|
+
...props
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/** Placeholder row shown when the search matches no items. */
|
|
141
|
+
function ComboboxEmpty({ className, ...props }) {
|
|
142
|
+
return /* @__PURE__ */ jsx(Command.Empty, {
|
|
143
|
+
"data-slot": "combobox-empty",
|
|
144
|
+
className: cn("px-3 py-2 text-sm text-muted-txt", className),
|
|
145
|
+
...props
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/** A labelled group of related options, with an optional `heading`. */
|
|
149
|
+
function ComboboxGroup({ className, ...props }) {
|
|
150
|
+
return /* @__PURE__ */ jsx(CommandGroup, {
|
|
151
|
+
"data-slot": "combobox-group",
|
|
152
|
+
className: cn("p-0 [&_[cmdk-group-heading]]:px-3", className),
|
|
153
|
+
...props
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/** A thin divider line between option groups. */
|
|
157
|
+
function ComboboxSeparator({ className, ...props }) {
|
|
158
|
+
return /* @__PURE__ */ jsx(CommandSeparator, {
|
|
159
|
+
"data-slot": "combobox-separator",
|
|
160
|
+
className: cn("mx-0", className),
|
|
161
|
+
...props
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* A selectable option. `value` is what the combobox reports on selection;
|
|
166
|
+
* search matches the visible text (or explicit `keywords`), not the `value`.
|
|
167
|
+
*/
|
|
168
|
+
function ComboboxItem({ value, keywords, className, children, onSelect, ...props }) {
|
|
169
|
+
const ctx = useComboboxContext("ComboboxItem");
|
|
170
|
+
const isSelected = value === ctx.value;
|
|
171
|
+
const label = textLabel(children);
|
|
172
|
+
const { registerItem, select } = ctx;
|
|
173
|
+
React.useEffect(() => {
|
|
174
|
+
if (label !== void 0) registerItem(value, label);
|
|
175
|
+
}, [
|
|
176
|
+
value,
|
|
177
|
+
label,
|
|
178
|
+
registerItem
|
|
179
|
+
]);
|
|
180
|
+
return /* @__PURE__ */ jsxs(CommandItem, {
|
|
181
|
+
"data-slot": "combobox-item",
|
|
182
|
+
value,
|
|
183
|
+
keywords: keywords ?? (label !== void 0 ? [label] : void 0),
|
|
184
|
+
onSelect: (selected) => {
|
|
185
|
+
select(value);
|
|
186
|
+
onSelect?.(selected);
|
|
187
|
+
},
|
|
188
|
+
className: cn("cursor-pointer rounded-none px-3 py-2 hover:bg-ghost-hover-bg active:bg-ghost-hover-bg data-[selected=true]:bg-ghost-hover-bg", isSelected && "bg-secondary-bg font-medium data-[selected=true]:bg-secondary-bg", className),
|
|
189
|
+
...props,
|
|
190
|
+
children: [children, isSelected && /* @__PURE__ */ jsx(Icon, {
|
|
191
|
+
as: Check,
|
|
192
|
+
className: "ml-auto size-3.5 shrink-0 text-primary"
|
|
193
|
+
})]
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
//#endregion
|
|
197
|
+
export { Combobox, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator, ComboboxTrigger };
|
|
198
|
+
|
|
199
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["Command","CommandPrimitive"],"sources":["../../../src/primitives/Combobox/Combobox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { Check, ChevronDown, Search } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport {\n Command,\n CommandGroup,\n CommandItem,\n CommandList,\n CommandSeparator,\n} from \"@/primitives/Command\";\nimport { Icon } from \"@/primitives/Icon\";\nimport { inputVariants } from \"@/primitives/Input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/primitives/Popover\";\nimport { cn } from \"@/utils\";\n\ninterface ComboboxContextValue {\n value: string;\n select: (value: string) => void;\n registerItem: (value: string, label: string) => void;\n labels: ReadonlyMap<string, string>;\n}\n\nconst ComboboxContext = React.createContext<ComboboxContextValue | null>(null);\n\nfunction useComboboxContext(caller: string) {\n const ctx = React.useContext(ComboboxContext);\n if (!ctx) throw new Error(`${caller} must be used within <Combobox>`);\n return ctx;\n}\n\n/** Derive a plain-text label from item children (used for search keywords and the trigger display). */\nfunction textLabel(children: React.ReactNode): string | undefined {\n if (typeof children === \"string\") return children;\n if (typeof children === \"number\") return String(children);\n if (\n Array.isArray(children) &&\n children.every((c) => typeof c === \"string\" || typeof c === \"number\")\n )\n return children.join(\"\");\n return undefined;\n}\n\ninterface ComboboxProps {\n /** Controlled selected value. */\n value?: string;\n /** Initial selected value (uncontrolled). */\n defaultValue?: string;\n /** Called with the item's `value` when a selection is made. */\n onValueChange?: (value: string) => void;\n /** Controlled open state of the dropdown. */\n open?: boolean;\n /** Initially open (uncontrolled). */\n defaultOpen?: boolean;\n /** Called when the dropdown opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** Forwarded to the underlying Popover root. */\n modal?: boolean;\n children?: React.ReactNode;\n}\n\n/**\n * Searchable single-select dropdown (the shadcn \"combobox\" recipe): a Popover\n * holding a filterable Command list. Holds the selected value and open state,\n * and closes on selection. Search state resets automatically on close because\n * the content unmounts.\n */\nfunction Combobox({\n value,\n defaultValue,\n onValueChange,\n open,\n defaultOpen,\n onOpenChange,\n modal,\n children,\n}: Readonly<ComboboxProps>) {\n const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue ?? \"\");\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false);\n const currentValue = value ?? uncontrolledValue;\n const currentOpen = open ?? uncontrolledOpen;\n\n const setOpen = React.useCallback(\n (next: boolean) => {\n setUncontrolledOpen(next);\n onOpenChange?.(next);\n },\n [onOpenChange],\n );\n\n const select = React.useCallback(\n (next: string) => {\n setUncontrolledValue(next);\n onValueChange?.(next);\n setOpen(false);\n },\n [onValueChange, setOpen],\n );\n\n // value → display-label cache fed by mounted items. Labels are kept after the\n // content unmounts (popover close) so the trigger can keep showing them.\n const [labels, setLabels] = React.useState<ReadonlyMap<string, string>>(new Map());\n const registerItem = React.useCallback((itemValue: string, label: string) => {\n setLabels((prev) =>\n prev.get(itemValue) === label ? prev : new Map(prev).set(itemValue, label),\n );\n }, []);\n\n const ctx = React.useMemo(\n () => ({ value: currentValue, select, registerItem, labels }),\n [currentValue, select, registerItem, labels],\n );\n\n return (\n <ComboboxContext.Provider value={ctx}>\n <Popover open={currentOpen} onOpenChange={setOpen} modal={modal}>\n {children}\n </Popover>\n </ComboboxContext.Provider>\n );\n}\n\n// Pill chrome shared with the Header project picker — keeps the lockup consistent.\nconst PILL =\n \"flex min-h-8 items-center gap-1 rounded-12 border border-primary-border bg-input-bg px-3 py-1 text-xs leading-4\";\n\n/**\n * Pill-shaped trigger showing the current selection. With no `children`, it\n * renders the selected item's label (or `placeholder` when nothing is\n * selected); pass `children` to fully control the display — e.g. when the\n * selected label comes from data the items haven't mounted with yet.\n */\nfunction ComboboxTrigger({\n className,\n /** Muted prefix rendered as `label:` before the value (e.g. `Project:`). */\n label,\n /** Muted text shown while nothing is selected. */\n placeholder,\n children,\n ...props\n}: React.ComponentProps<typeof PopoverTrigger> & { label?: string; placeholder?: string }) {\n const { value, labels } = useComboboxContext(\"ComboboxTrigger\");\n const display = children ?? (value ? (labels.get(value) ?? value) : undefined);\n\n return (\n <PopoverTrigger\n data-slot=\"combobox-trigger\"\n className={cn(PILL, \"text-left transition-colors hover:border-focus/60\", className)}\n {...props}\n >\n {label && <span className=\"shrink-0 text-muted-txt\">{label}:</span>}\n <span className={cn(\"min-w-0 truncate\", display != null ? \"font-medium\" : \"text-muted-txt\")}>\n {display ?? placeholder}\n </span>\n <Icon as={ChevronDown} className=\"ml-1 size-4 shrink-0 text-muted-txt\" />\n </PopoverTrigger>\n );\n}\n\n/** The dropdown panel: a Command (filterable list) inside a PopoverContent. */\nfunction ComboboxContent({\n className,\n align = \"start\",\n children,\n filter,\n shouldFilter,\n loop,\n ...props\n}: React.ComponentProps<typeof PopoverContent> &\n Pick<React.ComponentProps<typeof CommandPrimitive>, \"filter\" | \"shouldFilter\" | \"loop\">) {\n return (\n <PopoverContent\n data-slot=\"combobox-content\"\n align={align}\n className={cn(\"w-64 p-0\", className)}\n {...props}\n >\n <Command filter={filter} shouldFilter={shouldFilter} loop={loop} className=\"bg-transparent\">\n {children}\n </Command>\n </PopoverContent>\n );\n}\n\n/** Bordered search field pinned above the list; typing filters the items. */\nfunction ComboboxInput({\n className,\n /** Extra classes for the padded, bottom-bordered section around the field. */\n wrapperClassName,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input> & { wrapperClassName?: string }) {\n return (\n <div data-slot=\"combobox-input-wrapper\" className={cn(\"border-b p-2\", wrapperClassName)}>\n <div className=\"relative\">\n <Icon\n as={Search}\n className=\"absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-txt\"\n />\n <CommandPrimitive.Input\n data-slot=\"combobox-input\"\n className={cn(inputVariants({ size: \"sm\" }), \"pl-8\", className)}\n {...props}\n />\n </div>\n </div>\n );\n}\n\n/** Scrollable container for the option rows. */\nfunction ComboboxList({ className, ...props }: React.ComponentProps<typeof CommandList>) {\n return (\n <CommandList data-slot=\"combobox-list\" className={cn(\"max-h-64 py-1\", className)} {...props} />\n );\n}\n\n/** Placeholder row shown when the search matches no items. */\nfunction ComboboxEmpty({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\"px-3 py-2 text-sm text-muted-txt\", className)}\n {...props}\n />\n );\n}\n\n/** A labelled group of related options, with an optional `heading`. */\nfunction ComboboxGroup({ className, ...props }: React.ComponentProps<typeof CommandGroup>) {\n return (\n <CommandGroup\n data-slot=\"combobox-group\"\n className={cn(\"p-0 [&_[cmdk-group-heading]]:px-3\", className)}\n {...props}\n />\n );\n}\n\n/** A thin divider line between option groups. */\nfunction ComboboxSeparator({ className, ...props }: React.ComponentProps<typeof CommandSeparator>) {\n return (\n <CommandSeparator data-slot=\"combobox-separator\" className={cn(\"mx-0\", className)} {...props} />\n );\n}\n\n/**\n * A selectable option. `value` is what the combobox reports on selection;\n * search matches the visible text (or explicit `keywords`), not the `value`.\n */\nfunction ComboboxItem({\n /** The value reported by `onValueChange` when this item is chosen. */\n value,\n /** Extra strings the search should match; defaults to the item's text content. */\n keywords,\n className,\n children,\n onSelect,\n ...props\n}: Omit<React.ComponentProps<typeof CommandItem>, \"value\"> & { value: string }) {\n const ctx = useComboboxContext(\"ComboboxItem\");\n const isSelected = value === ctx.value;\n const label = textLabel(children);\n const { registerItem, select } = ctx;\n\n React.useEffect(() => {\n if (label !== undefined) registerItem(value, label);\n }, [value, label, registerItem]);\n\n return (\n <CommandItem\n data-slot=\"combobox-item\"\n value={value}\n keywords={keywords ?? (label !== undefined ? [label] : undefined)}\n onSelect={(selected) => {\n select(value);\n onSelect?.(selected);\n }}\n className={cn(\n // Header project-picker row: hover/highlight ghost, chosen bg/secondary + medium.\n \"cursor-pointer rounded-none px-3 py-2 hover:bg-ghost-hover-bg active:bg-ghost-hover-bg data-[selected=true]:bg-ghost-hover-bg\",\n isSelected && \"bg-secondary-bg font-medium data-[selected=true]:bg-secondary-bg\",\n className,\n )}\n {...props}\n >\n {children}\n {isSelected && <Icon as={Check} className=\"ml-auto size-3.5 shrink-0 text-primary\" />}\n </CommandItem>\n );\n}\n\nexport {\n Combobox,\n ComboboxTrigger,\n ComboboxContent,\n ComboboxInput,\n ComboboxList,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxItem,\n ComboboxSeparator,\n};\n"],"mappings":";;;;;;;;;;AAyBA,MAAM,kBAAkB,MAAM,cAA2C,IAAI;AAE7E,SAAS,mBAAmB,QAAgB;CAC1C,MAAM,M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ator, i as CommandGroup, l as CommandShortcut, n as CommandDialog, o as CommandItem, r as CommandEmpty, s as CommandList, t as Command } from "../../
|
|
1
|
+
import { a as CommandInput, c as CommandSeparator, i as CommandGroup, l as CommandShortcut, n as CommandDialog, o as CommandItem, r as CommandEmpty, s as CommandList, t as Command } from "../../index20.cjs";
|
|
2
2
|
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CommandInput, c as CommandSeparator, i as CommandGroup, l as CommandShortcut, n as CommandDialog, o as CommandItem, r as CommandEmpty, s as CommandList, t as Command } from "../../
|
|
1
|
+
import { a as CommandInput, c as CommandSeparator, i as CommandGroup, l as CommandShortcut, n as CommandDialog, o as CommandItem, r as CommandEmpty, s as CommandList, t as Command } from "../../index20.js";
|
|
2
2
|
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ContextMenuItem, c as ContextMenuRadioGroup, d as ContextMenuShortcut, f as ContextMenuSub, h as ContextMenuTrigger, i as ContextMenuGroup, l as ContextMenuRadioItem, m as ContextMenuSubTrigger, n as ContextMenuCheckboxItem, o as ContextMenuLabel, p as ContextMenuSubContent, r as ContextMenuContent, s as ContextMenuPortal, t as ContextMenu, u as ContextMenuSeparator } from "../../
|
|
1
|
+
import { a as ContextMenuItem, c as ContextMenuRadioGroup, d as ContextMenuShortcut, f as ContextMenuSub, h as ContextMenuTrigger, i as ContextMenuGroup, l as ContextMenuRadioItem, m as ContextMenuSubTrigger, n as ContextMenuCheckboxItem, o as ContextMenuLabel, p as ContextMenuSubContent, r as ContextMenuContent, s as ContextMenuPortal, t as ContextMenu, u as ContextMenuSeparator } from "../../index23.cjs";
|
|
2
2
|
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ContextMenuItem, c as ContextMenuRadioGroup, d as ContextMenuShortcut, f as ContextMenuSub, h as ContextMenuTrigger, i as ContextMenuGroup, l as ContextMenuRadioItem, m as ContextMenuSubTrigger, n as ContextMenuCheckboxItem, o as ContextMenuLabel, p as ContextMenuSubContent, r as ContextMenuContent, s as ContextMenuPortal, t as ContextMenu, u as ContextMenuSeparator } from "../../
|
|
1
|
+
import { a as ContextMenuItem, c as ContextMenuRadioGroup, d as ContextMenuShortcut, f as ContextMenuSub, h as ContextMenuTrigger, i as ContextMenuGroup, l as ContextMenuRadioItem, m as ContextMenuSubTrigger, n as ContextMenuCheckboxItem, o as ContextMenuLabel, p as ContextMenuSubContent, r as ContextMenuContent, s as ContextMenuPortal, t as ContextMenu, u as ContextMenuSeparator } from "../../index23.js";
|
|
2
2
|
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
|