@psnext/design-system 1.5.1 → 2.0.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 +639 -0
- package/README.md +39 -2
- package/SKILL.md +101 -0
- package/bin/install-agent-skill.mjs +54 -0
- package/dist/Header.cjs +25 -25
- package/dist/Header.cjs.map +1 -1
- package/dist/Header.js +25 -25
- package/dist/Header.js.map +1 -1
- package/dist/Icon.cjs +19 -19
- package/dist/Icon.cjs.map +1 -1
- package/dist/Icon.js +19 -19
- package/dist/Icon.js.map +1 -1
- package/dist/Logo.cjs +4 -14
- package/dist/Logo.cjs.map +1 -1
- package/dist/Logo.js +4 -14
- package/dist/Logo.js.map +1 -1
- package/dist/Sidebar.cjs +26 -20
- package/dist/Sidebar.cjs.map +1 -1
- package/dist/Sidebar.js +21 -21
- package/dist/Sidebar.js.map +1 -1
- package/dist/cn.cjs +14 -1
- package/dist/cn.cjs.map +1 -1
- package/dist/cn.js +14 -1
- package/dist/cn.js.map +1 -1
- package/dist/index.cjs +13 -10
- 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 +5 -4
- package/dist/index10.d.cts +7 -7
- package/dist/index10.d.cts.map +1 -1
- package/dist/index10.d.ts +7 -7
- 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 +18 -17
- package/dist/index12.d.cts.map +1 -1
- package/dist/index12.d.ts +18 -17
- 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/index14.d.cts +5 -5
- package/dist/index14.d.cts.map +1 -1
- package/dist/index14.d.ts +5 -5
- package/dist/index14.d.ts.map +1 -1
- package/dist/index15.d.cts +3 -3
- package/dist/index15.d.cts.map +1 -1
- package/dist/index15.d.ts +3 -3
- package/dist/index15.d.ts.map +1 -1
- package/dist/index16.d.cts +2 -2
- package/dist/index16.d.cts.map +1 -1
- package/dist/index16.d.ts +2 -2
- package/dist/index17.d.cts +4 -4
- package/dist/index17.d.cts.map +1 -1
- package/dist/index17.d.ts +4 -4
- package/dist/index17.d.ts.map +1 -1
- package/dist/index18.d.cts +11 -11
- package/dist/index18.d.cts.map +1 -1
- package/dist/index18.d.ts +11 -11
- package/dist/index19.d.cts +10 -10
- package/dist/index19.d.cts.map +1 -1
- package/dist/index19.d.ts +10 -10
- 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 +16 -16
- package/dist/index20.d.cts.map +1 -1
- package/dist/index20.d.ts +16 -16
- package/dist/index20.d.ts.map +1 -1
- package/dist/index21.d.cts +4 -4
- package/dist/index21.d.cts.map +1 -1
- package/dist/index21.d.ts +4 -4
- package/dist/index22.d.cts +11 -11
- package/dist/index22.d.cts.map +1 -1
- package/dist/index22.d.ts +11 -11
- package/dist/index22.d.ts.map +1 -1
- package/dist/index23.d.cts +16 -16
- package/dist/index23.d.cts.map +1 -1
- package/dist/index23.d.ts +16 -16
- package/dist/index23.d.ts.map +1 -1
- package/dist/index24.d.cts +10 -10
- package/dist/index24.d.cts.map +1 -1
- package/dist/index24.d.ts +10 -10
- package/dist/index25.d.cts +2 -2
- package/dist/index25.d.ts +2 -2
- package/dist/index25.d.ts.map +1 -1
- package/dist/index26.d.cts +14 -14
- package/dist/index26.d.cts.map +1 -1
- package/dist/index26.d.ts +14 -14
- package/dist/index26.d.ts.map +1 -1
- package/dist/index27.d.cts +7 -7
- package/dist/index27.d.ts +7 -7
- package/dist/index27.d.ts.map +1 -1
- package/dist/index28.d.cts +6 -6
- package/dist/index28.d.ts +5 -5
- package/dist/index28.d.ts.map +1 -1
- package/dist/index29.d.cts +4 -4
- package/dist/index29.d.ts +4 -4
- 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/index3.d.ts.map +1 -1
- package/dist/index30.d.cts +6 -6
- package/dist/index30.d.ts +4 -4
- package/dist/index31.d.cts +4 -4
- package/dist/index31.d.cts.map +1 -1
- package/dist/index31.d.ts +4 -4
- package/dist/index31.d.ts.map +1 -1
- package/dist/index32.d.cts +8 -5
- package/dist/index32.d.cts.map +1 -1
- package/dist/index32.d.ts +9 -6
- package/dist/index32.d.ts.map +1 -1
- package/dist/index33.d.cts +14 -10
- package/dist/index33.d.cts.map +1 -1
- package/dist/index33.d.ts +15 -11
- package/dist/index33.d.ts.map +1 -1
- package/dist/index34.d.cts +5 -5
- package/dist/index34.d.ts +5 -5
- package/dist/index34.d.ts.map +1 -1
- package/dist/index35.d.cts +14 -14
- package/dist/index35.d.ts +14 -14
- package/dist/index35.d.ts.map +1 -1
- package/dist/index36.d.cts +3 -3
- package/dist/index36.d.cts.map +1 -1
- package/dist/index36.d.ts +3 -3
- package/dist/index36.d.ts.map +1 -1
- package/dist/index37.d.cts +5 -5
- package/dist/index37.d.ts +4 -4
- package/dist/index37.d.ts.map +1 -1
- package/dist/index38.d.cts +2 -2
- package/dist/index38.d.ts +2 -2
- package/dist/index39.d.cts +17 -17
- package/dist/index39.d.cts.map +1 -1
- package/dist/index39.d.ts +17 -17
- 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/index4.d.ts.map +1 -1
- package/dist/index40.d.cts +4 -4
- package/dist/index40.d.cts.map +1 -1
- package/dist/index40.d.ts +5 -5
- package/dist/index40.d.ts.map +1 -1
- package/dist/index41.d.cts +11 -11
- package/dist/index41.d.cts.map +1 -1
- package/dist/index41.d.ts +11 -11
- package/dist/index41.d.ts.map +1 -1
- package/dist/index42.d.cts +8 -8
- package/dist/index42.d.cts.map +1 -1
- package/dist/index42.d.ts +8 -8
- package/dist/index42.d.ts.map +1 -1
- package/dist/index43.d.cts +10 -10
- package/dist/index43.d.cts.map +1 -1
- package/dist/index43.d.ts +10 -10
- package/dist/index43.d.ts.map +1 -1
- package/dist/index44.d.cts +1 -48
- package/dist/index44.d.ts +1 -48
- package/dist/index45.d.cts +42 -22
- package/dist/index45.d.cts.map +1 -1
- package/dist/index45.d.ts +42 -22
- package/dist/index45.d.ts.map +1 -1
- package/dist/index46.d.cts +21 -34
- package/dist/index46.d.cts.map +1 -1
- package/dist/index46.d.ts +21 -34
- package/dist/index46.d.ts.map +1 -1
- package/dist/index47.d.cts +33 -17
- package/dist/index47.d.cts.map +1 -1
- package/dist/index47.d.ts +33 -17
- package/dist/index47.d.ts.map +1 -1
- package/dist/index48.d.cts +18 -14
- package/dist/index48.d.cts.map +1 -1
- package/dist/index48.d.ts +18 -14
- package/dist/index48.d.ts.map +1 -1
- package/dist/index49.d.cts +12 -60
- package/dist/index49.d.cts.map +1 -1
- package/dist/index49.d.ts +12 -60
- 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/index5.d.ts.map +1 -1
- package/dist/index50.d.cts +55 -49
- package/dist/index50.d.cts.map +1 -1
- package/dist/index50.d.ts +55 -49
- package/dist/index50.d.ts.map +1 -1
- package/dist/index51.d.cts +56 -24
- package/dist/index51.d.cts.map +1 -1
- package/dist/index51.d.ts +56 -24
- package/dist/index51.d.ts.map +1 -1
- package/dist/index52.d.cts +25 -203
- package/dist/index52.d.cts.map +1 -1
- package/dist/index52.d.ts +25 -203
- package/dist/index52.d.ts.map +1 -1
- package/dist/index53.d.cts +198 -15
- package/dist/index53.d.cts.map +1 -1
- package/dist/index53.d.ts +198 -15
- package/dist/index53.d.ts.map +1 -1
- package/dist/index54.d.cts +21 -23
- package/dist/index54.d.cts.map +1 -1
- package/dist/index54.d.ts +21 -23
- package/dist/index54.d.ts.map +1 -1
- package/dist/index55.d.cts +21 -18
- package/dist/index55.d.cts.map +1 -1
- package/dist/index55.d.ts +21 -18
- package/dist/index55.d.ts.map +1 -1
- package/dist/index56.d.cts +21 -8
- package/dist/index56.d.cts.map +1 -1
- package/dist/index56.d.ts +21 -8
- package/dist/index56.d.ts.map +1 -1
- package/dist/index57.d.cts +6 -44
- package/dist/index57.d.cts.map +1 -1
- package/dist/index57.d.ts +6 -44
- package/dist/index57.d.ts.map +1 -1
- package/dist/index58.d.cts +46 -47
- package/dist/index58.d.cts.map +1 -1
- package/dist/index58.d.ts +46 -47
- package/dist/index58.d.ts.map +1 -1
- package/dist/index59.d.cts +47 -59
- package/dist/index59.d.cts.map +1 -1
- package/dist/index59.d.ts +47 -59
- package/dist/index59.d.ts.map +1 -1
- package/dist/index6.d.cts +7 -7
- package/dist/index6.d.cts.map +1 -1
- package/dist/index6.d.ts +7 -7
- package/dist/index6.d.ts.map +1 -1
- package/dist/index60.d.cts +56 -38
- package/dist/index60.d.cts.map +1 -1
- package/dist/index60.d.ts +56 -38
- package/dist/index60.d.ts.map +1 -1
- package/dist/index61.d.cts +38 -14
- package/dist/index61.d.cts.map +1 -1
- package/dist/index61.d.ts +38 -14
- package/dist/index61.d.ts.map +1 -1
- package/dist/index62.d.cts +20 -41
- package/dist/index62.d.cts.map +1 -1
- package/dist/index62.d.ts +20 -41
- package/dist/index62.d.ts.map +1 -1
- package/dist/index63.d.cts +41 -19
- package/dist/index63.d.cts.map +1 -1
- package/dist/index63.d.ts +41 -19
- package/dist/index63.d.ts.map +1 -1
- package/dist/index64.d.cts +14 -39
- package/dist/index64.d.cts.map +1 -1
- package/dist/index64.d.ts +14 -39
- package/dist/index64.d.ts.map +1 -1
- package/dist/index65.d.cts +39 -16
- package/dist/index65.d.cts.map +1 -1
- package/dist/index65.d.ts +39 -16
- package/dist/index65.d.ts.map +1 -1
- package/dist/index66.d.cts +18 -12
- package/dist/index66.d.cts.map +1 -1
- package/dist/index66.d.ts +18 -12
- package/dist/index66.d.ts.map +1 -1
- package/dist/index67.d.cts +12 -30
- package/dist/index67.d.cts.map +1 -1
- package/dist/index67.d.ts +12 -30
- package/dist/index67.d.ts.map +1 -1
- package/dist/index68.d.cts +28 -27
- package/dist/index68.d.cts.map +1 -1
- package/dist/index68.d.ts +28 -27
- package/dist/index68.d.ts.map +1 -1
- package/dist/index69.d.cts +36 -69
- package/dist/index69.d.cts.map +1 -0
- package/dist/index69.d.ts +36 -69
- package/dist/index69.d.ts.map +1 -0
- package/dist/index7.d.cts +8 -8
- package/dist/index7.d.cts.map +1 -1
- package/dist/index7.d.ts +8 -8
- package/dist/index70.d.cts +76 -237
- package/dist/index70.d.cts.map +1 -1
- package/dist/index70.d.ts +76 -237
- package/dist/index70.d.ts.map +1 -1
- package/dist/index71.d.cts +242 -0
- package/dist/index71.d.cts.map +1 -0
- package/dist/index71.d.ts +242 -0
- package/dist/index71.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/index8.d.ts.map +1 -1
- package/dist/index9.d.cts +2 -2
- package/dist/index9.d.ts +2 -2
- package/dist/layouts/Container/index.cjs +4 -4
- 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 +4 -4
- package/dist/layouts/Container/index.js.map +1 -1
- package/dist/layouts/PageBackground/index.cjs +2 -2
- package/dist/layouts/PageBackground/index.cjs.map +1 -1
- package/dist/layouts/PageBackground/index.d.cts +1 -1
- package/dist/layouts/PageBackground/index.d.ts +1 -1
- package/dist/layouts/PageBackground/index.js +2 -2
- package/dist/layouts/PageBackground/index.js.map +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 +4 -4
- package/dist/layouts/index.d.ts +4 -4
- package/dist/patterns/DataTable/index.cjs +12 -7
- 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 +12 -7
- package/dist/patterns/DataTable/index.js.map +1 -1
- package/dist/patterns/Footer/index.cjs +5 -5
- package/dist/patterns/Footer/index.cjs.map +1 -1
- package/dist/patterns/Footer/index.d.cts +9 -9
- package/dist/patterns/Footer/index.d.cts.map +1 -1
- package/dist/patterns/Footer/index.d.ts +9 -9
- package/dist/patterns/Footer/index.d.ts.map +1 -1
- package/dist/patterns/Footer/index.js +5 -5
- package/dist/patterns/Footer/index.js.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.cjs.map +1 -1
- package/dist/patterns/MediaObject/index.d.cts +12 -12
- package/dist/patterns/MediaObject/index.d.cts.map +1 -1
- package/dist/patterns/MediaObject/index.d.ts +13 -13
- package/dist/patterns/MediaObject/index.d.ts.map +1 -1
- package/dist/patterns/MediaObject/index.js +1 -1
- package/dist/patterns/MediaObject/index.js.map +1 -1
- package/dist/patterns/NavRail/index.cjs +195 -0
- package/dist/patterns/NavRail/index.cjs.map +1 -0
- package/dist/patterns/NavRail/index.d.cts +2 -0
- package/dist/patterns/NavRail/index.d.ts +2 -0
- package/dist/patterns/NavRail/index.js +185 -0
- package/dist/patterns/NavRail/index.js.map +1 -0
- package/dist/patterns/SectionCard/index.cjs +1 -1
- package/dist/patterns/SectionCard/index.cjs.map +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/SectionCard/index.js +1 -1
- package/dist/patterns/SectionCard/index.js.map +1 -1
- package/dist/patterns/SectionHeading/index.d.cts +2 -2
- package/dist/patterns/SectionHeading/index.d.cts.map +1 -1
- package/dist/patterns/SectionHeading/index.d.ts +2 -2
- package/dist/patterns/SectionHeading/index.d.ts.map +1 -1
- package/dist/patterns/index.cjs +9 -0
- package/dist/patterns/index.d.cts +3 -2
- package/dist/patterns/index.d.ts +3 -2
- package/dist/patterns/index.js +2 -1
- package/dist/primitives/Accordion/index.cjs +6 -6
- package/dist/primitives/Accordion/index.cjs.map +1 -1
- package/dist/primitives/Accordion/index.js +6 -6
- package/dist/primitives/Accordion/index.js.map +1 -1
- package/dist/primitives/Alert/index.cjs +4 -4
- package/dist/primitives/Alert/index.cjs.map +1 -1
- package/dist/primitives/Alert/index.js +4 -4
- package/dist/primitives/Alert/index.js.map +1 -1
- package/dist/primitives/AlertDialog/index.cjs +4 -4
- package/dist/primitives/AlertDialog/index.cjs.map +1 -1
- package/dist/primitives/AlertDialog/index.js +4 -4
- package/dist/primitives/AlertDialog/index.js.map +1 -1
- package/dist/primitives/Avatar/index.cjs +5 -5
- package/dist/primitives/Avatar/index.cjs.map +1 -1
- package/dist/primitives/Avatar/index.js +5 -5
- package/dist/primitives/Avatar/index.js.map +1 -1
- package/dist/primitives/Badge/index.cjs +11 -10
- package/dist/primitives/Badge/index.cjs.map +1 -1
- package/dist/primitives/Badge/index.js +11 -10
- package/dist/primitives/Badge/index.js.map +1 -1
- package/dist/primitives/Breadcrumb/index.cjs +4 -4
- package/dist/primitives/Breadcrumb/index.cjs.map +1 -1
- package/dist/primitives/Breadcrumb/index.js +4 -4
- package/dist/primitives/Breadcrumb/index.js.map +1 -1
- package/dist/primitives/Button/index.cjs +20 -13
- package/dist/primitives/Button/index.cjs.map +1 -1
- package/dist/primitives/Button/index.js +20 -13
- package/dist/primitives/Button/index.js.map +1 -1
- package/dist/primitives/ButtonGroup/index.cjs +3 -3
- package/dist/primitives/ButtonGroup/index.cjs.map +1 -1
- package/dist/primitives/ButtonGroup/index.js +3 -3
- package/dist/primitives/ButtonGroup/index.js.map +1 -1
- package/dist/primitives/Calendar/index.cjs +22 -21
- package/dist/primitives/Calendar/index.cjs.map +1 -1
- package/dist/primitives/Calendar/index.js +22 -21
- package/dist/primitives/Calendar/index.js.map +1 -1
- package/dist/primitives/Card/index.cjs +18 -16
- package/dist/primitives/Card/index.cjs.map +1 -1
- package/dist/primitives/Card/index.js +18 -16
- package/dist/primitives/Card/index.js.map +1 -1
- package/dist/primitives/Carousel/index.cjs +2 -2
- package/dist/primitives/Carousel/index.cjs.map +1 -1
- package/dist/primitives/Carousel/index.js +2 -2
- package/dist/primitives/Carousel/index.js.map +1 -1
- package/dist/primitives/Chart/index.cjs +12 -12
- package/dist/primitives/Chart/index.cjs.map +1 -1
- package/dist/primitives/Chart/index.js +12 -12
- package/dist/primitives/Chart/index.js.map +1 -1
- package/dist/primitives/Checkbox/index.cjs +6 -6
- package/dist/primitives/Checkbox/index.cjs.map +1 -1
- package/dist/primitives/Checkbox/index.js +6 -6
- package/dist/primitives/Checkbox/index.js.map +1 -1
- package/dist/primitives/CheckboxTree/index.cjs +2 -2
- package/dist/primitives/CheckboxTree/index.cjs.map +1 -1
- package/dist/primitives/CheckboxTree/index.js +2 -2
- package/dist/primitives/CheckboxTree/index.js.map +1 -1
- package/dist/primitives/Command/index.cjs +9 -9
- package/dist/primitives/Command/index.cjs.map +1 -1
- package/dist/primitives/Command/index.js +9 -9
- package/dist/primitives/Command/index.js.map +1 -1
- package/dist/primitives/ContextMenu/index.cjs +10 -10
- package/dist/primitives/ContextMenu/index.cjs.map +1 -1
- package/dist/primitives/ContextMenu/index.js +10 -10
- package/dist/primitives/ContextMenu/index.js.map +1 -1
- package/dist/primitives/Credits/index.cjs +4 -4
- package/dist/primitives/Credits/index.cjs.map +1 -1
- package/dist/primitives/Credits/index.js +4 -4
- package/dist/primitives/Credits/index.js.map +1 -1
- package/dist/primitives/Dialog/index.cjs +5 -5
- package/dist/primitives/Dialog/index.cjs.map +1 -1
- package/dist/primitives/Dialog/index.js +5 -5
- package/dist/primitives/Dialog/index.js.map +1 -1
- package/dist/primitives/Drawer/index.cjs +5 -5
- package/dist/primitives/Drawer/index.cjs.map +1 -1
- package/dist/primitives/Drawer/index.js +5 -5
- package/dist/primitives/Drawer/index.js.map +1 -1
- package/dist/primitives/DropdownMenu/index.cjs +9 -9
- package/dist/primitives/DropdownMenu/index.cjs.map +1 -1
- package/dist/primitives/DropdownMenu/index.js +9 -9
- package/dist/primitives/DropdownMenu/index.js.map +1 -1
- package/dist/primitives/Empty/index.cjs +4 -4
- package/dist/primitives/Empty/index.cjs.map +1 -1
- package/dist/primitives/Empty/index.js +4 -4
- package/dist/primitives/Empty/index.js.map +1 -1
- package/dist/primitives/Field/index.cjs +5 -5
- package/dist/primitives/Field/index.cjs.map +1 -1
- package/dist/primitives/Field/index.js +5 -5
- package/dist/primitives/Field/index.js.map +1 -1
- package/dist/primitives/Form/index.cjs +1 -1
- package/dist/primitives/Form/index.cjs.map +1 -1
- package/dist/primitives/Form/index.js +1 -1
- package/dist/primitives/Form/index.js.map +1 -1
- package/dist/primitives/Heading/index.cjs +2 -2
- package/dist/primitives/Heading/index.cjs.map +1 -1
- package/dist/primitives/Heading/index.js +2 -2
- package/dist/primitives/Heading/index.js.map +1 -1
- package/dist/primitives/HoverCard/index.cjs +1 -1
- package/dist/primitives/HoverCard/index.cjs.map +1 -1
- package/dist/primitives/HoverCard/index.js +1 -1
- package/dist/primitives/HoverCard/index.js.map +1 -1
- package/dist/primitives/InfoBanner/index.cjs +12 -12
- package/dist/primitives/InfoBanner/index.cjs.map +1 -1
- package/dist/primitives/InfoBanner/index.js +12 -12
- package/dist/primitives/InfoBanner/index.js.map +1 -1
- package/dist/primitives/Input/index.cjs +13 -7
- package/dist/primitives/Input/index.cjs.map +1 -1
- package/dist/primitives/Input/index.js +13 -7
- package/dist/primitives/Input/index.js.map +1 -1
- package/dist/primitives/InputGroup/index.cjs +7 -7
- package/dist/primitives/InputGroup/index.cjs.map +1 -1
- package/dist/primitives/InputGroup/index.js +7 -7
- package/dist/primitives/InputGroup/index.js.map +1 -1
- package/dist/primitives/InputOtp/index.cjs +3 -3
- package/dist/primitives/InputOtp/index.cjs.map +1 -1
- package/dist/primitives/InputOtp/index.js +3 -3
- package/dist/primitives/InputOtp/index.js.map +1 -1
- package/dist/primitives/Item/index.cjs +6 -6
- package/dist/primitives/Item/index.cjs.map +1 -1
- package/dist/primitives/Item/index.js +6 -6
- package/dist/primitives/Item/index.js.map +1 -1
- package/dist/primitives/Kbd/index.cjs +1 -1
- package/dist/primitives/Kbd/index.cjs.map +1 -1
- package/dist/primitives/Kbd/index.js +1 -1
- package/dist/primitives/Kbd/index.js.map +1 -1
- package/dist/primitives/Link/index.cjs +4 -4
- package/dist/primitives/Link/index.cjs.map +1 -1
- package/dist/primitives/Link/index.js +4 -4
- package/dist/primitives/Link/index.js.map +1 -1
- package/dist/primitives/Menubar/index.cjs +12 -12
- package/dist/primitives/Menubar/index.cjs.map +1 -1
- package/dist/primitives/Menubar/index.js +12 -12
- package/dist/primitives/Menubar/index.js.map +1 -1
- package/dist/primitives/NativeSelect/index.cjs +5 -5
- package/dist/primitives/NativeSelect/index.cjs.map +1 -1
- package/dist/primitives/NativeSelect/index.js +5 -5
- package/dist/primitives/NativeSelect/index.js.map +1 -1
- package/dist/primitives/NavRail/index.cjs +9 -194
- package/dist/primitives/NavRail/index.d.cts +1 -0
- package/dist/primitives/NavRail/index.d.ts +1 -0
- package/dist/primitives/NavRail/index.js +1 -184
- package/dist/primitives/NavigationMenu/index.cjs +7 -7
- package/dist/primitives/NavigationMenu/index.cjs.map +1 -1
- package/dist/primitives/NavigationMenu/index.js +7 -7
- package/dist/primitives/NavigationMenu/index.js.map +1 -1
- package/dist/primitives/Pagination/index.cjs +7 -13
- 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 +8 -14
- package/dist/primitives/Pagination/index.js.map +1 -1
- package/dist/primitives/Popover/index.cjs +4 -4
- package/dist/primitives/Popover/index.cjs.map +1 -1
- package/dist/primitives/Popover/index.js +4 -4
- package/dist/primitives/Popover/index.js.map +1 -1
- package/dist/primitives/Progress/index.cjs +16 -16
- package/dist/primitives/Progress/index.cjs.map +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 +16 -16
- package/dist/primitives/Progress/index.js.map +1 -1
- package/dist/primitives/RadioGroup/index.cjs +7 -7
- 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 -7
- package/dist/primitives/RadioGroup/index.js.map +1 -1
- package/dist/primitives/Resizable/index.cjs +2 -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 +2 -2
- package/dist/primitives/Resizable/index.js.map +1 -1
- package/dist/primitives/ScrollArea/index.cjs +2 -2
- package/dist/primitives/ScrollArea/index.cjs.map +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 +2 -2
- package/dist/primitives/ScrollArea/index.js.map +1 -1
- package/dist/primitives/Select/index.cjs +8 -8
- 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 +8 -8
- package/dist/primitives/Select/index.js.map +1 -1
- package/dist/primitives/Separator/index.cjs +1 -1
- package/dist/primitives/Separator/index.cjs.map +1 -1
- package/dist/primitives/Separator/index.js +1 -1
- package/dist/primitives/Separator/index.js.map +1 -1
- package/dist/primitives/Sheet/index.cjs +8 -8
- 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 +8 -8
- 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.cjs +2 -2
- package/dist/primitives/Skeleton/index.cjs.map +1 -1
- package/dist/primitives/Skeleton/index.d.cts +1 -1
- package/dist/primitives/Skeleton/index.d.ts +1 -1
- package/dist/primitives/Skeleton/index.js +2 -2
- package/dist/primitives/Skeleton/index.js.map +1 -1
- package/dist/primitives/Slider/index.cjs +3 -3
- package/dist/primitives/Slider/index.cjs.map +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 +3 -3
- package/dist/primitives/Slider/index.js.map +1 -1
- package/dist/primitives/Sonner/index.cjs +13 -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 +13 -6
- package/dist/primitives/Sonner/index.js.map +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.cjs +7 -7
- package/dist/primitives/Switch/index.cjs.map +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 +7 -7
- package/dist/primitives/Switch/index.js.map +1 -1
- package/dist/primitives/Table/index.cjs +7 -7
- package/dist/primitives/Table/index.cjs.map +1 -1
- package/dist/primitives/Table/index.d.cts +1 -1
- package/dist/primitives/Table/index.d.ts +1 -1
- package/dist/primitives/Table/index.js +7 -7
- package/dist/primitives/Table/index.js.map +1 -1
- package/dist/primitives/Tabs/index.cjs +21 -21
- 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 +21 -21
- package/dist/primitives/Tabs/index.js.map +1 -1
- package/dist/primitives/Text/index.cjs +5 -5
- 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 +5 -5
- package/dist/primitives/Text/index.js.map +1 -1
- package/dist/primitives/Textarea/index.cjs +20 -8
- 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 +20 -8
- package/dist/primitives/Textarea/index.js.map +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 +11 -10
- 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 +11 -10
- package/dist/primitives/Toggle/index.js.map +1 -1
- package/dist/primitives/ToggleGroup/index.cjs +2 -2
- package/dist/primitives/ToggleGroup/index.cjs.map +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 +2 -2
- package/dist/primitives/ToggleGroup/index.js.map +1 -1
- package/dist/primitives/Tooltip/index.cjs +2 -2
- package/dist/primitives/Tooltip/index.cjs.map +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 +2 -2
- package/dist/primitives/Tooltip/index.js.map +1 -1
- package/dist/primitives/index.cjs +10 -10
- package/dist/primitives/index.d.cts +21 -21
- package/dist/primitives/index.d.ts +21 -21
- package/dist/primitives/index.js +2 -2
- package/dist/styles/base.css +23 -4
- package/dist/styles/brand-scopes.css +49 -0
- package/dist/styles/glass.css +13 -8
- package/dist/styles/index.css +8 -9
- package/dist/styles/theme.css +141 -90
- package/dist/styles/tokens/border-radius.css +8 -8
- package/dist/styles/tokens/mode-dark.css +71 -94
- package/dist/styles/tokens/mode-light.css +71 -94
- package/dist/styles/tokens/shadows.css +4 -7
- package/dist/styles/tokens/spacing.css +17 -37
- package/dist/styles/tokens/theme-bodhi.css +6 -28
- package/dist/styles/tokens/theme-slingshot.css +7 -28
- package/dist/styles/tokens/theme-sustain.css +6 -28
- package/dist/styles/typography.css +9 -9
- package/package.json +8 -2
- package/dist/index44.d.cts.map +0 -1
- package/dist/index44.d.ts.map +0 -1
- package/dist/primitives/NavRail/index.cjs.map +0 -1
- package/dist/primitives/NavRail/index.js.map +0 -1
- package/dist/styles/semantic.css +0 -178
- package/dist/styles/tokens/alpha.css +0 -39
- package/dist/styles/tokens/chart-colors-dark.css +0 -18
- package/dist/styles/tokens/chart-colors-light.css +0 -18
- package/dist/styles/tokens/colors.css +0 -251
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Calendar/Calendar.tsx"],"sourcesContent":["import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\nimport * as React from \"react\";\nimport { type DayButton, DayPicker, getDefaultClassNames } from \"react-day-picker\";\n\nimport { Button, buttonVariants } from \"@/primitives/Button\";\nimport { cn } from \"@/utils\";\n\n/** Date picker calendar built on react-day-picker, themed with the DS Button + tokens. */\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n /** Button variant used for the previous/next navigation controls. */\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"];\n}) {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\"relative flex flex-col gap-4 md:flex-row\", defaultClassNames.months),\n month: cn(\"flex w-full flex-col gap-4\", defaultClassNames.month),\n nav: cn(\n \"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1\",\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) p-0 select-none aria-disabled:opacity-50\",\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) p-0 select-none aria-disabled:opacity-50\",\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n \"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)\",\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n \"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium\",\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n \"relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50\",\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn(\"absolute inset-0 bg-popover opacity-0\", defaultClassNames.dropdown),\n caption_label: cn(\n \"font-medium select-none\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground\",\n defaultClassNames.caption_label,\n ),\n month_grid: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none\",\n defaultClassNames.weekday,\n ),\n week: cn(\"mt-2 flex w-full\", defaultClassNames.week),\n week_number_header: cn(\"w-(--cell-size) select-none\", defaultClassNames.week_number_header),\n week_number: cn(\n \"text-[0.8rem] text-muted-foreground select-none\",\n defaultClassNames.week_number,\n ),\n day: cn(\n \"group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md\",\n props.showWeekNumber\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md\"\n : \"[&:first-child[data-selected=true]_button]:rounded-l-md\",\n defaultClassNames.day,\n ),\n range_start: cn(\"rounded-l-md bg-accent\", defaultClassNames.range_start),\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\n range_end: cn(\"rounded-r-md bg-accent\", defaultClassNames.range_end),\n today: cn(\n \"font-semibold text-foreground data-[selected=true]:rounded-none\",\n defaultClassNames.today,\n ),\n outside: cn(\n \"text-muted-foreground aria-selected:text-muted-foreground\",\n defaultClassNames.outside,\n ),\n disabled: cn(\"text-muted-foreground opacity-50\", defaultClassNames.disabled),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return <div data-slot=\"calendar\" ref={rootRef} className={cn(className)} {...props} />;\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n if (orientation === \"right\") {\n return <ChevronRightIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n return <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />;\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n {...props}\n />\n );\n}\n\n/** Single day cell button, applying selected/range styling from the day's modifiers. */\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-accent data-[range-end=true]:text-accent-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-accent data-[range-start=true]:text-accent-foreground data-[selected-single=true]:bg-accent data-[selected-single=true]:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, CalendarDayButton };\n"],"mappings":";;;;;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ACX,CAAC,UAAU;EAEb,oBAAkB,UAAU;EAC5B,kBAAgB,UAAU;EAC1B,qBAAmB,UAAU;EAC7B,WAAW,GACT,40BACA,kBAAkB,KAClB,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Calendar/Calendar.tsx"],"sourcesContent":["import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\nimport * as React from \"react\";\nimport { type DayButton, DayPicker, getDefaultClassNames } from \"react-day-picker\";\n\nimport { Button, buttonVariants } from \"@/primitives/Button\";\nimport { cn } from \"@/utils\";\n\n/** Date picker calendar built on react-day-picker, themed with the DS Button + tokens. */\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"outline\",\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n /** Button variant used for the previous/next navigation controls. */\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"];\n}) {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"group/calendar bg-glass-60-bg backdrop-blur-glass p-4 [--cell-size:48px] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent rounded-16\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\"relative flex flex-col gap-4 md:flex-row\", defaultClassNames.months),\n month: cn(\"flex w-full flex-col gap-4\", defaultClassNames.month),\n nav: cn(\n \"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1\",\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-8 rounded-full p-0 select-none aria-disabled:opacity-50\",\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-8 rounded-full p-0 select-none aria-disabled:opacity-50\",\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n \"flex h-8 w-full items-center justify-center px-8 text-sm leading-5 font-medium\",\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n \"flex h-8 w-full items-center justify-center gap-1.5 text-sm font-medium\",\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n \"relative rounded-8 border border-primary-border shadow-sm has-focus:border-primary-invert-border has-focus:ring-3 has-focus:ring-focus\",\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn(\"absolute inset-0 opacity-0\", defaultClassNames.dropdown),\n caption_label: cn(\n \"font-medium select-none\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"flex h-8 items-center gap-1 rounded-8 pr-1 pl-0.5 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-txt\",\n defaultClassNames.caption_label,\n ),\n month_grid: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"flex h-8 flex-1 items-center justify-center rounded-8 text-xs leading-4 font-normal text-muted-txt select-none\",\n defaultClassNames.weekday,\n ),\n week: cn(\"mt-px flex w-full\", defaultClassNames.week),\n week_number_header: cn(\"w-(--cell-size) select-none\", defaultClassNames.week_number_header),\n week_number: cn(\n \"text-xs leading-4 text-muted-txt select-none\",\n defaultClassNames.week_number,\n ),\n day: cn(\n \"group/day relative flex h-12 w-(--cell-size) items-center justify-center p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-full\",\n props.showWeekNumber\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-full\"\n : \"[&:first-child[data-selected=true]_button]:rounded-l-full\",\n defaultClassNames.day,\n ),\n range_start: cn(\n \"bg-[linear-gradient(to_right,transparent_50%,var(--muted-bg)_50%)]\",\n defaultClassNames.range_start,\n ),\n range_middle: cn(\"rounded-none bg-muted-bg\", defaultClassNames.range_middle),\n range_end: cn(\n \"bg-[linear-gradient(to_right,var(--muted-bg)_50%,transparent_50%)]\",\n defaultClassNames.range_end,\n ),\n today: cn(\"data-[selected=true]:rounded-none\", defaultClassNames.today),\n outside: cn(\"text-muted-txt aria-selected:text-muted-txt\", defaultClassNames.outside),\n disabled: cn(\"text-muted-txt opacity-50\", defaultClassNames.disabled),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return <div data-slot=\"calendar\" ref={rootRef} className={cn(className)} {...props} />;\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n if (orientation === \"right\") {\n return <ChevronRightIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n return <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />;\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n {...props}\n />\n );\n}\n\n/** Single day cell button, applying selected/range styling from the day's modifiers. */\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon-sm\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n data-today={modifiers.today}\n className={cn(\n // Figma .Date Picker/Day: 48px cell, 32px circular button; selected and\n // range endpoints are primary-invert circles, today a muted circle.\n \"flex size-8 flex-col gap-0 rounded-full p-0 text-sm leading-5 font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-3 group-data-[focused=true]/day:ring-focus data-[today=true]:bg-muted-bg data-[range-end=true]:bg-primary-invert-bg! data-[range-end=true]:text-primary-invert-txt data-[range-middle=true]:bg-transparent data-[range-middle=true]:text-primary-txt data-[range-start=true]:bg-primary-invert-bg! data-[range-start=true]:text-primary-invert-txt data-[selected-single=true]:bg-primary-invert-bg! data-[selected-single=true]:text-primary-invert-txt [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, CalendarDayButton };\n"],"mappings":";;;;;;;;AAQA,SAAS,SAAS,EAChB,WACA,YACA,kBAAkB,MAClB,gBAAgB,SAChB,gBAAgB,WAChB,YACA,YACA,GAAG,SAIF;CACD,MAAM,oBAAoB,qBAAqB;CAE/C,OACE,oBAAC,WAAD;EACmB;EACjB,WAAW,GACT,kLACA,OAAO,GAAG,6CACV,OAAO,GAAG,iDACV,SACF;EACe;EACf,YAAY;GACV,sBAAsB,SAAS,KAAK,eAAe,WAAW,EAAE,OAAO,QAAQ,CAAC;GAChF,GAAG;EACL;EACA,YAAY;GACV,MAAM,GAAG,SAAS,kBAAkB,IAAI;GACxC,QAAQ,GAAG,4CAA4C,kBAAkB,MAAM;GAC/E,OAAO,GAAG,8BAA8B,kBAAkB,KAAK;GAC/D,KAAK,GACH,2EACA,kBAAkB,GACpB;GACA,iBAAiB,GACf,eAAe,EAAE,SAAS,cAAc,CAAC,GACzC,gEACA,kBAAkB,eACpB;GACA,aAAa,GACX,eAAe,EAAE,SAAS,cAAc,CAAC,GACzC,gEACA,kBAAkB,WACpB;GACA,eAAe,GACb,kFACA,kBAAkB,aACpB;GACA,WAAW,GACT,2EACA,kBAAkB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Aa,EAAE,UAAU,GAAG,YAAY;IACtC,OACE,oBAAC,MAAD;KAAI,GAAI;eACN,oBAAC,OAAD;MAAK,WAAU;MACZ;KACE,CAAA;IACH,CAAA;GAER;GACA,GAAG;EACL;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,kBAAkB,EACzB,WACA,KACA,WACA,GAAG,SACsC;CACzC,MAAM,oBAAoB,qBAAqB;CAE/C,MAAM,MAAM,MAAM,OAA0B,IAAI;CAChD,MAAM,gBAAgB;EACpB,IAAI,UAAU,SAAS,IAAI,SAAS,MAAM;CAC5C,GAAG,CAAC,UAAU,OAAO,CAAC;CAEtB,OACE,oBAAC,QAAD;EACO;EACL,SAAQ;EACR,MAAK;EACL,YAAU,IAAI,KAAK,mBAAmB;EACtC,wBACE,UAAU,YACV,CAAC,UAAU,eACX,CAAC,UAAU,aACX,CAAC,UAAU;EAEb,oBAAkB,UAAU;EAC5B,kBAAgB,UAAU;EAC1B,qBAAmB,UAAU;EAC7B,cAAY,UAAU;EACtB,WAAW,GAGT,wpBACA,kBAAkB,KAClB,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -2,13 +2,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_cn = require("../../cn.cjs");
|
|
3
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
4
|
//#region src/primitives/Card/Card.tsx
|
|
5
|
-
const cardVariants = (0, require("class-variance-authority").cva)("flex flex-col gap-6 rounded-
|
|
5
|
+
const cardVariants = (0, require("class-variance-authority").cva)("flex flex-col justify-between gap-6 rounded-8 border text-primary-txt", {
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
|
-
default: "bg-
|
|
8
|
+
default: "bg-glass-none-bg shadow-sm",
|
|
9
9
|
glass: "border-transparent backdrop-blur-glass",
|
|
10
|
-
brand: "border-transparent bg-[image:var(--brand-
|
|
11
|
-
|
|
10
|
+
brand: "border-transparent bg-[image:linear-gradient(to_right,var(--theme-brand-700),var(--theme-brand-500-primary))] text-white",
|
|
11
|
+
ai: "ai-border [--ai-surface:var(--glass-none-bg)]",
|
|
12
|
+
inverted: "border-transparent bg-primary-invert-bg text-primary-invert-txt"
|
|
12
13
|
},
|
|
13
14
|
tint: {
|
|
14
15
|
subtle: "",
|
|
@@ -21,22 +22,22 @@ const cardVariants = (0, require("class-variance-authority").cva)("flex flex-col
|
|
|
21
22
|
{
|
|
22
23
|
variant: "glass",
|
|
23
24
|
tint: "subtle",
|
|
24
|
-
class: "bg-
|
|
25
|
+
class: "bg-glass-20-bg backdrop-blur-glass"
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
variant: "glass",
|
|
28
29
|
tint: "light",
|
|
29
|
-
class: "bg-
|
|
30
|
+
class: "bg-glass-40-bg backdrop-blur-glass"
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
33
|
variant: "glass",
|
|
33
34
|
tint: "medium",
|
|
34
|
-
class: "bg-
|
|
35
|
+
class: "bg-glass-40-bg backdrop-blur-glass"
|
|
35
36
|
},
|
|
36
37
|
{
|
|
37
38
|
variant: "glass",
|
|
38
39
|
tint: "heavy",
|
|
39
|
-
class: "bg-
|
|
40
|
+
class: "bg-glass-60-bg backdrop-blur-glass"
|
|
40
41
|
}
|
|
41
42
|
],
|
|
42
43
|
defaultVariants: {
|
|
@@ -52,7 +53,7 @@ function Card({ className, variant, tint, ...props }) {
|
|
|
52
53
|
className: require_cn.cn(cardVariants({
|
|
53
54
|
variant,
|
|
54
55
|
tint
|
|
55
|
-
}), className
|
|
56
|
+
}), className),
|
|
56
57
|
...props
|
|
57
58
|
});
|
|
58
59
|
}
|
|
@@ -65,15 +66,16 @@ const cardHeaderAlign = {
|
|
|
65
66
|
function CardHeader({ className, align = "center", ...props }) {
|
|
66
67
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
67
68
|
"data-slot": "card-header",
|
|
68
|
-
className: require_cn.cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1
|
|
69
|
+
className: require_cn.cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", cardHeaderAlign[align], className),
|
|
69
70
|
...props
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
|
-
/** Card heading rendered as an `h4`.
|
|
73
|
+
/** Card heading rendered as an `h4`. Figma binds the body font (Inter Semibold
|
|
74
|
+
16/24), so we override the base heading styles explicitly. */
|
|
73
75
|
function CardTitle({ className, ...props }) {
|
|
74
76
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
75
77
|
"data-slot": "card-title",
|
|
76
|
-
className: require_cn.cn("leading-
|
|
78
|
+
className: require_cn.cn("font-sans text-base leading-6 font-semibold", className),
|
|
77
79
|
...props
|
|
78
80
|
});
|
|
79
81
|
}
|
|
@@ -81,7 +83,7 @@ function CardTitle({ className, ...props }) {
|
|
|
81
83
|
function CardDescription({ className, ...props }) {
|
|
82
84
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
83
85
|
"data-slot": "card-description",
|
|
84
|
-
className: require_cn.cn("text-muted-
|
|
86
|
+
className: require_cn.cn("text-sm leading-5 text-muted-txt", className),
|
|
85
87
|
...props
|
|
86
88
|
});
|
|
87
89
|
}
|
|
@@ -103,9 +105,9 @@ function CardContent({ className, ...props }) {
|
|
|
103
105
|
}
|
|
104
106
|
const cardFooterTone = {
|
|
105
107
|
default: "px-6 pb-6 [.border-t]:pt-6",
|
|
106
|
-
brand: "justify-center rounded-b-
|
|
107
|
-
muted: "justify-center rounded-b-
|
|
108
|
-
card: "justify-center rounded-b-
|
|
108
|
+
brand: "justify-center rounded-b-8 bg-brand-200 px-6 py-3 text-brand-800",
|
|
109
|
+
muted: "justify-center rounded-b-8 bg-muted-bg px-6 py-3 text-muted-txt",
|
|
110
|
+
card: "justify-center rounded-b-8 bg-glass-none-bg px-6 py-3 text-primary-txt"
|
|
109
111
|
};
|
|
110
112
|
/** Bottom region of the card — typically holds actions or summary text. */
|
|
111
113
|
function CardFooter({ className, tone = "default", ...props }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["cn"],"sources":["../../../src/primitives/Card/Card.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nconst cardVariants = cva(\"flex flex-col gap-6 rounded-
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["cn"],"sources":["../../../src/primitives/Card/Card.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n/* Figma: PS AI Helix – Core → Card (288:122714): glass-none surface,\n border/primary, radius-8, shadow-sm, 24px padding/gaps. */\nconst cardVariants = cva(\"flex flex-col justify-between gap-6 rounded-8 border text-primary-txt\", {\n variants: {\n variant: {\n // Solid surface (default).\n default: \"bg-glass-none-bg shadow-sm\",\n // Translucent, backdrop-blurred glass surface — reads over a textured\n // background (e.g. PageBackground). `tint` picks the glass-*-bg step.\n glass: \"border-transparent backdrop-blur-glass\",\n // Filled brand surface with light foreground — the active product's colour,\n // as a left-to-right gradient (darker → lighter brand shade). Uses the\n // theme-layer stops so it does NOT flip in dark mode (matches pre-swap look).\n brand:\n \"border-transparent bg-[image:linear-gradient(to_right,var(--theme-brand-700),var(--theme-brand-500-primary))] text-white\",\n // AI affordance: gradient ring around the normal surface (accessible —\n // a full ai-gradient background fails contrast on the gray end).\n ai: \"ai-border [--ai-surface:var(--glass-none-bg)]\",\n // Inverted surface — contrasts with the page (dark card in light mode,\n // light card in dark mode).\n inverted: \"border-transparent bg-primary-invert-bg text-primary-invert-txt\",\n },\n tint: {\n subtle: \"\",\n light: \"\",\n medium: \"\",\n heavy: \"\",\n },\n },\n compoundVariants: [\n { variant: \"glass\", tint: \"subtle\", class: \"bg-glass-20-bg backdrop-blur-glass\" },\n { variant: \"glass\", tint: \"light\", class: \"bg-glass-40-bg backdrop-blur-glass\" },\n // No 0.5 step exists in the new glass tokens — medium maps to 40 until\n // design adds one (flagged).\n { variant: \"glass\", tint: \"medium\", class: \"bg-glass-40-bg backdrop-blur-glass\" },\n { variant: \"glass\", tint: \"heavy\", class: \"bg-glass-60-bg backdrop-blur-glass\" },\n ],\n defaultVariants: {\n variant: \"default\",\n tint: \"light\",\n },\n});\n\ntype CardProps = React.ComponentProps<\"div\"> &\n VariantProps<typeof cardVariants> & {\n /** Surface treatment of the card. Default `default` (solid surface). */\n variant?: VariantProps<typeof cardVariants>[\"variant\"];\n /** Glass opacity step — only applies to `variant=\"glass\"`. Default `light`. */\n tint?: VariantProps<typeof cardVariants>[\"tint\"];\n };\n\n/** Surface container with composable header/content/footer slots. */\nfunction Card({ className, variant, tint, ...props }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n data-variant={variant ?? \"default\"}\n className={cn(cardVariants({ variant, tint }), className)}\n {...props}\n />\n );\n}\n\n// Vertical alignment of the header's items (title/description vs. the action).\nconst cardHeaderAlign = {\n start: \"items-start\",\n center: \"items-center\",\n end: \"items-end\",\n} as const;\n\n/** Top region of a card — holds the title, description, and optional action. */\nfunction CardHeader({\n className,\n align = \"center\",\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Vertical alignment of the header items. Default `center`. */\n align?: keyof typeof cardHeaderAlign;\n}) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6\",\n cardHeaderAlign[align],\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Card heading rendered as an `h4`. Figma binds the body font (Inter Semibold\n 16/24), so we override the base heading styles explicitly. */\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <h4\n data-slot=\"card-title\"\n className={cn(\"font-sans text-base leading-6 font-semibold\", className)}\n {...props}\n />\n );\n}\n\n/** Muted supporting text shown beneath the title. */\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <p\n data-slot=\"card-description\"\n className={cn(\"text-sm leading-5 text-muted-txt\", className)}\n {...props}\n />\n );\n}\n\n/** Action slot in the header row, aligned to the end alongside the title. */\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-action\"\n // Sits in row 1 alongside the title (not spanning rows) and has no `self-*`,\n // so it shares the title's row and follows CardHeader's `align` — the title\n // and action then truly centre against each other regardless of height.\n className={cn(\"col-start-2 row-start-1 justify-self-end\", className)}\n {...props}\n />\n );\n}\n\n/** Main body region of the card. */\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn(\"px-6 [&:last-child]:pb-6\", className)}\n {...props}\n />\n );\n}\n\n// Footer fill. `default` is transparent (the usual footer); `brand`/`muted`\n// render a full-width tinted band with the action centred — pair with\n// `<Card className=\"overflow-hidden\">` so the band clips to the card radius.\nconst cardFooterTone = {\n default: \"px-6 pb-6 [.border-t]:pt-6\",\n // Brand band = the light brand tint pair (brand-200 surface, brand-800 text).\n brand: \"justify-center rounded-b-8 bg-brand-200 px-6 py-3 text-brand-800\",\n muted: \"justify-center rounded-b-8 bg-muted-bg px-6 py-3 text-muted-txt\",\n card: \"justify-center rounded-b-8 bg-glass-none-bg px-6 py-3 text-primary-txt\",\n} as const;\n\n/** Bottom region of the card — typically holds actions or summary text. */\nfunction CardFooter({\n className,\n tone = \"default\",\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Footer fill. `brand`/`muted` render a full-width tinted band. */\n tone?: keyof typeof cardFooterTone;\n}) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\"flex items-center\", cardFooterTone[tone], className)}\n {...props}\n />\n );\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle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,OACE,iBAAA,GAAA,kBAAA,KAAC,KAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GAAG,oCAAoC,SAAS;EAC3D,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EAIV,WAAWA,WAAAA,GAAG,4CAA4C,SAAS;EACnE,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GAAG,4BAA4B,SAAS;EACnD,GAAI;CACL,CAAA;AAEL;AAKA,MAAM,iBAAiB;CACrB,SAAS;CAET,OAAO;CACP,OAAO;CACP,MAAM;AACR;;AAGA,SAAS,WAAW,EAClB,WACA,OAAO,WACP,GAAG,SAIF;CACD,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GAAG,qBAAqB,eAAe,OAAO,SAAS;EAClE,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -2,13 +2,14 @@ import { t as cn } from "../../cn.js";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
//#region src/primitives/Card/Card.tsx
|
|
5
|
-
const cardVariants = cva("flex flex-col gap-6 rounded-
|
|
5
|
+
const cardVariants = cva("flex flex-col justify-between gap-6 rounded-8 border text-primary-txt", {
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
|
-
default: "bg-
|
|
8
|
+
default: "bg-glass-none-bg shadow-sm",
|
|
9
9
|
glass: "border-transparent backdrop-blur-glass",
|
|
10
|
-
brand: "border-transparent bg-[image:var(--brand-
|
|
11
|
-
|
|
10
|
+
brand: "border-transparent bg-[image:linear-gradient(to_right,var(--theme-brand-700),var(--theme-brand-500-primary))] text-white",
|
|
11
|
+
ai: "ai-border [--ai-surface:var(--glass-none-bg)]",
|
|
12
|
+
inverted: "border-transparent bg-primary-invert-bg text-primary-invert-txt"
|
|
12
13
|
},
|
|
13
14
|
tint: {
|
|
14
15
|
subtle: "",
|
|
@@ -21,22 +22,22 @@ const cardVariants = cva("flex flex-col gap-6 rounded-xl border text-card-foregr
|
|
|
21
22
|
{
|
|
22
23
|
variant: "glass",
|
|
23
24
|
tint: "subtle",
|
|
24
|
-
class: "bg-
|
|
25
|
+
class: "bg-glass-20-bg backdrop-blur-glass"
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
variant: "glass",
|
|
28
29
|
tint: "light",
|
|
29
|
-
class: "bg-
|
|
30
|
+
class: "bg-glass-40-bg backdrop-blur-glass"
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
33
|
variant: "glass",
|
|
33
34
|
tint: "medium",
|
|
34
|
-
class: "bg-
|
|
35
|
+
class: "bg-glass-40-bg backdrop-blur-glass"
|
|
35
36
|
},
|
|
36
37
|
{
|
|
37
38
|
variant: "glass",
|
|
38
39
|
tint: "heavy",
|
|
39
|
-
class: "bg-
|
|
40
|
+
class: "bg-glass-60-bg backdrop-blur-glass"
|
|
40
41
|
}
|
|
41
42
|
],
|
|
42
43
|
defaultVariants: {
|
|
@@ -52,7 +53,7 @@ function Card({ className, variant, tint, ...props }) {
|
|
|
52
53
|
className: cn(cardVariants({
|
|
53
54
|
variant,
|
|
54
55
|
tint
|
|
55
|
-
}), className
|
|
56
|
+
}), className),
|
|
56
57
|
...props
|
|
57
58
|
});
|
|
58
59
|
}
|
|
@@ -65,15 +66,16 @@ const cardHeaderAlign = {
|
|
|
65
66
|
function CardHeader({ className, align = "center", ...props }) {
|
|
66
67
|
return /* @__PURE__ */ jsx("div", {
|
|
67
68
|
"data-slot": "card-header",
|
|
68
|
-
className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1
|
|
69
|
+
className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", cardHeaderAlign[align], className),
|
|
69
70
|
...props
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
|
-
/** Card heading rendered as an `h4`.
|
|
73
|
+
/** Card heading rendered as an `h4`. Figma binds the body font (Inter Semibold
|
|
74
|
+
16/24), so we override the base heading styles explicitly. */
|
|
73
75
|
function CardTitle({ className, ...props }) {
|
|
74
76
|
return /* @__PURE__ */ jsx("h4", {
|
|
75
77
|
"data-slot": "card-title",
|
|
76
|
-
className: cn("leading-
|
|
78
|
+
className: cn("font-sans text-base leading-6 font-semibold", className),
|
|
77
79
|
...props
|
|
78
80
|
});
|
|
79
81
|
}
|
|
@@ -81,7 +83,7 @@ function CardTitle({ className, ...props }) {
|
|
|
81
83
|
function CardDescription({ className, ...props }) {
|
|
82
84
|
return /* @__PURE__ */ jsx("p", {
|
|
83
85
|
"data-slot": "card-description",
|
|
84
|
-
className: cn("text-muted-
|
|
86
|
+
className: cn("text-sm leading-5 text-muted-txt", className),
|
|
85
87
|
...props
|
|
86
88
|
});
|
|
87
89
|
}
|
|
@@ -103,9 +105,9 @@ function CardContent({ className, ...props }) {
|
|
|
103
105
|
}
|
|
104
106
|
const cardFooterTone = {
|
|
105
107
|
default: "px-6 pb-6 [.border-t]:pt-6",
|
|
106
|
-
brand: "justify-center rounded-b-
|
|
107
|
-
muted: "justify-center rounded-b-
|
|
108
|
-
card: "justify-center rounded-b-
|
|
108
|
+
brand: "justify-center rounded-b-8 bg-brand-200 px-6 py-3 text-brand-800",
|
|
109
|
+
muted: "justify-center rounded-b-8 bg-muted-bg px-6 py-3 text-muted-txt",
|
|
110
|
+
card: "justify-center rounded-b-8 bg-glass-none-bg px-6 py-3 text-primary-txt"
|
|
109
111
|
};
|
|
110
112
|
/** Bottom region of the card — typically holds actions or summary text. */
|
|
111
113
|
function CardFooter({ className, tone = "default", ...props }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Card/Card.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nconst cardVariants = cva(\"flex flex-col gap-6 rounded-
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Card/Card.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n/* Figma: PS AI Helix – Core → Card (288:122714): glass-none surface,\n border/primary, radius-8, shadow-sm, 24px padding/gaps. */\nconst cardVariants = cva(\"flex flex-col justify-between gap-6 rounded-8 border text-primary-txt\", {\n variants: {\n variant: {\n // Solid surface (default).\n default: \"bg-glass-none-bg shadow-sm\",\n // Translucent, backdrop-blurred glass surface — reads over a textured\n // background (e.g. PageBackground). `tint` picks the glass-*-bg step.\n glass: \"border-transparent backdrop-blur-glass\",\n // Filled brand surface with light foreground — the active product's colour,\n // as a left-to-right gradient (darker → lighter brand shade). Uses the\n // theme-layer stops so it does NOT flip in dark mode (matches pre-swap look).\n brand:\n \"border-transparent bg-[image:linear-gradient(to_right,var(--theme-brand-700),var(--theme-brand-500-primary))] text-white\",\n // AI affordance: gradient ring around the normal surface (accessible —\n // a full ai-gradient background fails contrast on the gray end).\n ai: \"ai-border [--ai-surface:var(--glass-none-bg)]\",\n // Inverted surface — contrasts with the page (dark card in light mode,\n // light card in dark mode).\n inverted: \"border-transparent bg-primary-invert-bg text-primary-invert-txt\",\n },\n tint: {\n subtle: \"\",\n light: \"\",\n medium: \"\",\n heavy: \"\",\n },\n },\n compoundVariants: [\n { variant: \"glass\", tint: \"subtle\", class: \"bg-glass-20-bg backdrop-blur-glass\" },\n { variant: \"glass\", tint: \"light\", class: \"bg-glass-40-bg backdrop-blur-glass\" },\n // No 0.5 step exists in the new glass tokens — medium maps to 40 until\n // design adds one (flagged).\n { variant: \"glass\", tint: \"medium\", class: \"bg-glass-40-bg backdrop-blur-glass\" },\n { variant: \"glass\", tint: \"heavy\", class: \"bg-glass-60-bg backdrop-blur-glass\" },\n ],\n defaultVariants: {\n variant: \"default\",\n tint: \"light\",\n },\n});\n\ntype CardProps = React.ComponentProps<\"div\"> &\n VariantProps<typeof cardVariants> & {\n /** Surface treatment of the card. Default `default` (solid surface). */\n variant?: VariantProps<typeof cardVariants>[\"variant\"];\n /** Glass opacity step — only applies to `variant=\"glass\"`. Default `light`. */\n tint?: VariantProps<typeof cardVariants>[\"tint\"];\n };\n\n/** Surface container with composable header/content/footer slots. */\nfunction Card({ className, variant, tint, ...props }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n data-variant={variant ?? \"default\"}\n className={cn(cardVariants({ variant, tint }), className)}\n {...props}\n />\n );\n}\n\n// Vertical alignment of the header's items (title/description vs. the action).\nconst cardHeaderAlign = {\n start: \"items-start\",\n center: \"items-center\",\n end: \"items-end\",\n} as const;\n\n/** Top region of a card — holds the title, description, and optional action. */\nfunction CardHeader({\n className,\n align = \"center\",\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Vertical alignment of the header items. Default `center`. */\n align?: keyof typeof cardHeaderAlign;\n}) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6\",\n cardHeaderAlign[align],\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Card heading rendered as an `h4`. Figma binds the body font (Inter Semibold\n 16/24), so we override the base heading styles explicitly. */\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <h4\n data-slot=\"card-title\"\n className={cn(\"font-sans text-base leading-6 font-semibold\", className)}\n {...props}\n />\n );\n}\n\n/** Muted supporting text shown beneath the title. */\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <p\n data-slot=\"card-description\"\n className={cn(\"text-sm leading-5 text-muted-txt\", className)}\n {...props}\n />\n );\n}\n\n/** Action slot in the header row, aligned to the end alongside the title. */\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-action\"\n // Sits in row 1 alongside the title (not spanning rows) and has no `self-*`,\n // so it shares the title's row and follows CardHeader's `align` — the title\n // and action then truly centre against each other regardless of height.\n className={cn(\"col-start-2 row-start-1 justify-self-end\", className)}\n {...props}\n />\n );\n}\n\n/** Main body region of the card. */\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn(\"px-6 [&:last-child]:pb-6\", className)}\n {...props}\n />\n );\n}\n\n// Footer fill. `default` is transparent (the usual footer); `brand`/`muted`\n// render a full-width tinted band with the action centred — pair with\n// `<Card className=\"overflow-hidden\">` so the band clips to the card radius.\nconst cardFooterTone = {\n default: \"px-6 pb-6 [.border-t]:pt-6\",\n // Brand band = the light brand tint pair (brand-200 surface, brand-800 text).\n brand: \"justify-center rounded-b-8 bg-brand-200 px-6 py-3 text-brand-800\",\n muted: \"justify-center rounded-b-8 bg-muted-bg px-6 py-3 text-muted-txt\",\n card: \"justify-center rounded-b-8 bg-glass-none-bg px-6 py-3 text-primary-txt\",\n} as const;\n\n/** Bottom region of the card — typically holds actions or summary text. */\nfunction CardFooter({\n className,\n tone = \"default\",\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Footer fill. `brand`/`muted` render a full-width tinted band. */\n tone?: keyof typeof cardFooterTone;\n}) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\"flex items-center\", cardFooterTone[tone], className)}\n {...props}\n />\n );\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n cardVariants,\n type CardProps,\n};\n"],"mappings":";;;;AAOA,MAAM,eAAe,IAAI,yEAAyE;CAChG,UAAU;EACR,SAAS;GAEP,SAAS;GAGT,OAAO;G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YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,4BAA4B,SAAS;EACnD,GAAI;CACL,CAAA;AAEL;AAKA,MAAM,iBAAiB;CACrB,SAAS;CAET,OAAO;CACP,OAAO;CACP,MAAM;AACR;;AAGA,SAAS,WAAW,EAClB,WACA,OAAO,WACP,GAAG,SAIF;CACD,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,qBAAqB,eAAe,OAAO,SAAS;EAClE,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -109,7 +109,7 @@ function CarouselPrevious({ className, variant = "outline", size = "icon", ...pr
|
|
|
109
109
|
"data-slot": "carousel-previous",
|
|
110
110
|
variant,
|
|
111
111
|
size,
|
|
112
|
-
className: require_cn.cn("absolute size-
|
|
112
|
+
className: require_cn.cn("absolute size-9 rounded-8 border-primary-border", orientation === "horizontal" ? "top-1/2 -left-13 -translate-y-1/2" : "-top-13 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
113
113
|
disabled: !canScrollPrev,
|
|
114
114
|
onClick: scrollPrev,
|
|
115
115
|
...props,
|
|
@@ -126,7 +126,7 @@ function CarouselNext({ className, variant = "outline", size = "icon", ...props
|
|
|
126
126
|
"data-slot": "carousel-next",
|
|
127
127
|
variant,
|
|
128
128
|
size,
|
|
129
|
-
className: require_cn.cn("absolute size-
|
|
129
|
+
className: require_cn.cn("absolute size-9 rounded-8 border-primary-border", orientation === "horizontal" ? "top-1/2 -right-13 -translate-y-1/2" : "-bottom-13 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
130
130
|
disabled: !canScrollNext,
|
|
131
131
|
onClick: scrollNext,
|
|
132
132
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["React","cn","Button","ArrowLeft","ArrowRight"],"sources":["../../../src/primitives/Carousel/Carousel.tsx"],"sourcesContent":["\"use client\";\n\nimport useEmblaCarousel, { type UseEmblaCarouselType } from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { Button } from \"@/primitives/Button\";\nimport { cn } from \"@/utils\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n /** Embla carousel options (loop, align, dragFree, etc.). */\n opts?: CarouselOptions;\n /** Embla plugins (e.g. Autoplay) to extend the carousel behaviour. */\n plugins?: CarouselPlugin;\n /** Scroll axis of the carousel. */\n orientation?: \"horizontal\" | \"vertical\";\n /** Receives the Embla API instance once initialised, for external control. */\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\n/** Embla-backed carousel root: provides context and arrow-key navigation for its slides. */\nfunction Carousel({\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\n/** Scroll viewport that lays out the slides along the carousel's axis. */\nfunction CarouselContent({ className, ...props }: React.ComponentProps<\"div\">) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div\n className={cn(\"flex\", orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\", className)}\n {...props}\n />\n </div>\n );\n}\n\n/** A single slide within `CarouselContent`. */\nfunction CarouselItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Button that scrolls to the previous slide; auto-disables at the start. */\nfunction CarouselPrevious({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["React","cn","Button","ArrowLeft","ArrowRight"],"sources":["../../../src/primitives/Carousel/Carousel.tsx"],"sourcesContent":["\"use client\";\n\nimport useEmblaCarousel, { type UseEmblaCarouselType } from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { Button } from \"@/primitives/Button\";\nimport { cn } from \"@/utils\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n /** Embla carousel options (loop, align, dragFree, etc.). */\n opts?: CarouselOptions;\n /** Embla plugins (e.g. Autoplay) to extend the carousel behaviour. */\n plugins?: CarouselPlugin;\n /** Scroll axis of the carousel. */\n orientation?: \"horizontal\" | \"vertical\";\n /** Receives the Embla API instance once initialised, for external control. */\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\n/** Embla-backed carousel root: provides context and arrow-key navigation for its slides. */\nfunction Carousel({\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\n/** Scroll viewport that lays out the slides along the carousel's axis. */\nfunction CarouselContent({ className, ...props }: React.ComponentProps<\"div\">) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div\n className={cn(\"flex\", orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\", className)}\n {...props}\n />\n </div>\n );\n}\n\n/** A single slide within `CarouselContent`. */\nfunction CarouselItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Button that scrolls to the previous slide; auto-disables at the start. */\nfunction CarouselPrevious({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-9 rounded-8 border-primary-border\",\n orientation === \"horizontal\"\n ? \"top-1/2 -left-13 -translate-y-1/2\"\n : \"-top-13 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\n/** Button that scrolls to the next slide; auto-disables at the end. */\nfunction CarouselNext({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-9 rounded-8 border-primary-border\",\n orientation === \"horizontal\"\n ? \"top-1/2 -right-13 -translate-y-1/2\"\n : \"-bottom-13 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );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;EACD;EACH;EACN,WAAWD,WAAAA,GACT,mDACA,gBAAgB,eACZ,sCACA,+CACJ,SACF;EACA,UAAU,CAAC;EACX,SAAS;EACT,GAAI;YAbN,CAeE,iBAAA,GAAA,kBAAA,KAACE,aAAAA,WAAD,CAAY,CAAA,GACZ,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;aAAU;EAAoB,CAAA,CACxC;;AAEZ;;AAGA,SAAS,aAAa,EACpB,WACA,UAAU,WACV,OAAO,QACP,GAAG,SACmC;CACtC,MAAM,EAAE,aAAa,YAAY,kBAAkB,YAAY;CAE/D,OACE,iBAAA,GAAA,kBAAA,MAACD,gCAAAA,QAAD;EACE,aAAU;EACD;EACH;EACN,WAAWD,WAAAA,GACT,mDACA,gBAAgB,eACZ,uCACA,kDACJ,SACF;EACA,UAAU,CAAC;EACX,SAAS;EACT,GAAI;YAbN,CAeE,iBAAA,GAAA,kBAAA,KAACG,aAAAA,YAAD,CAAa,CAAA,GACb,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;aAAU;EAAgB,CAAA,CACpC;;AAEZ"}
|
|
@@ -105,7 +105,7 @@ function CarouselPrevious({ className, variant = "outline", size = "icon", ...pr
|
|
|
105
105
|
"data-slot": "carousel-previous",
|
|
106
106
|
variant,
|
|
107
107
|
size,
|
|
108
|
-
className: cn("absolute size-
|
|
108
|
+
className: cn("absolute size-9 rounded-8 border-primary-border", orientation === "horizontal" ? "top-1/2 -left-13 -translate-y-1/2" : "-top-13 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
109
109
|
disabled: !canScrollPrev,
|
|
110
110
|
onClick: scrollPrev,
|
|
111
111
|
...props,
|
|
@@ -122,7 +122,7 @@ function CarouselNext({ className, variant = "outline", size = "icon", ...props
|
|
|
122
122
|
"data-slot": "carousel-next",
|
|
123
123
|
variant,
|
|
124
124
|
size,
|
|
125
|
-
className: cn("absolute size-
|
|
125
|
+
className: cn("absolute size-9 rounded-8 border-primary-border", orientation === "horizontal" ? "top-1/2 -right-13 -translate-y-1/2" : "-bottom-13 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
126
126
|
disabled: !canScrollNext,
|
|
127
127
|
onClick: scrollNext,
|
|
128
128
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Carousel/Carousel.tsx"],"sourcesContent":["\"use client\";\n\nimport useEmblaCarousel, { type UseEmblaCarouselType } from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { Button } from \"@/primitives/Button\";\nimport { cn } from \"@/utils\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n /** Embla carousel options (loop, align, dragFree, etc.). */\n opts?: CarouselOptions;\n /** Embla plugins (e.g. Autoplay) to extend the carousel behaviour. */\n plugins?: CarouselPlugin;\n /** Scroll axis of the carousel. */\n orientation?: \"horizontal\" | \"vertical\";\n /** Receives the Embla API instance once initialised, for external control. */\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\n/** Embla-backed carousel root: provides context and arrow-key navigation for its slides. */\nfunction Carousel({\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\n/** Scroll viewport that lays out the slides along the carousel's axis. */\nfunction CarouselContent({ className, ...props }: React.ComponentProps<\"div\">) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div\n className={cn(\"flex\", orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\", className)}\n {...props}\n />\n </div>\n );\n}\n\n/** A single slide within `CarouselContent`. */\nfunction CarouselItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Button that scrolls to the previous slide; auto-disables at the start. */\nfunction CarouselPrevious({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Carousel/Carousel.tsx"],"sourcesContent":["\"use client\";\n\nimport useEmblaCarousel, { type UseEmblaCarouselType } from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { Button } from \"@/primitives/Button\";\nimport { cn } from \"@/utils\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n /** Embla carousel options (loop, align, dragFree, etc.). */\n opts?: CarouselOptions;\n /** Embla plugins (e.g. Autoplay) to extend the carousel behaviour. */\n plugins?: CarouselPlugin;\n /** Scroll axis of the carousel. */\n orientation?: \"horizontal\" | \"vertical\";\n /** Receives the Embla API instance once initialised, for external control. */\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\n/** Embla-backed carousel root: provides context and arrow-key navigation for its slides. */\nfunction Carousel({\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\n/** Scroll viewport that lays out the slides along the carousel's axis. */\nfunction CarouselContent({ className, ...props }: React.ComponentProps<\"div\">) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div\n className={cn(\"flex\", orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\", className)}\n {...props}\n />\n </div>\n );\n}\n\n/** A single slide within `CarouselContent`. */\nfunction CarouselItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Button that scrolls to the previous slide; auto-disables at the start. */\nfunction CarouselPrevious({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-9 rounded-8 border-primary-border\",\n orientation === \"horizontal\"\n ? \"top-1/2 -left-13 -translate-y-1/2\"\n : \"-top-13 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\n/** Button that scrolls to the next slide; auto-disables at the end. */\nfunction CarouselNext({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-9 rounded-8 border-primary-border\",\n orientation === \"horizontal\"\n ? \"top-1/2 -right-13 -translate-y-1/2\"\n : \"-bottom-13 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n};\n"],"mappings":";;;;;;;AAkCA,MAAM,kBAAkB,MAAM,cAA2C,IAAI;AAE7E,SAAS,cAAc;CACrB,MAAM,UAAU,MAAM,WAAW,eAAe;CAEhD,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,gDAAgD;CAGlE,OAAO;AACT;;AAGA,SAAS,SAAS,EAChB,cAAc,cACd,MACA,QACA,SACA,WACA,UACA,GAAG,SAC2C;CAC9C,MAAM,CAAC,aAAa,OAAO,iBACzB;EACE,GAAG;EACH,MAAM,gBAAgB,eAAe,MAAM;CAC7C,GACA,OACF;CACA,MAAM,CAAC,eAAe,oBAAoB,MAAM,SAAS,KAAK;CAC9D,MAAM,CAAC,eAAe,oBAAoB,MAAM,SAAS,KAAK;CAE9D,MAAM,WAAW,MAAM,aAAa,QAAqB;EACvD,IAAI,CAAC,KAAK;EACV,iBAAiB,IAAI,cAAc,CAAC;EACpC,iBAAiB,IAAI,cAAc,CAAC;CACtC,GAAG,CAAC,CAAC;CAEL,MAAM,aAAa,MAAM,kBAAkB;EACzC,KAAK,WAAW;CAClB,GAAG,CAAC,GAAG,CAAC;CAER,MAAM,aAAa,MAAM,kBAAkB;EACzC,KAAK,WAAW;CAClB,GAAG,CAAC,GAAG,CAAC;CAER,MAAM,gBAAgB,MAAM,aACzB,UAA+C;EAC9C,IAAI,MAAM,QAAQ,aAAa;GAC7B,MAAM,eAAe;GACrB,WAAW;EACb,OAAO,IAAI,MAAM,QAAQ,c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,MAAM,EAAE,aAAa,YAAY,kBAAkB,YAAY;CAE/D,OACE,qBAAC,QAAD;EACE,aAAU;EACD;EACH;EACN,WAAW,GACT,mDACA,gBAAgB,eACZ,sCACA,+CACJ,SACF;EACA,UAAU,CAAC;EACX,SAAS;EACT,GAAI;YAbN,CAeE,oBAAC,WAAD,CAAY,CAAA,GACZ,oBAAC,QAAD;GAAM,WAAU;aAAU;EAAoB,CAAA,CACxC;;AAEZ;;AAGA,SAAS,aAAa,EACpB,WACA,UAAU,WACV,OAAO,QACP,GAAG,SACmC;CACtC,MAAM,EAAE,aAAa,YAAY,kBAAkB,YAAY;CAE/D,OACE,qBAAC,QAAD;EACE,aAAU;EACD;EACH;EACN,WAAW,GACT,mDACA,gBAAgB,eACZ,uCACA,kDACJ,SACF;EACA,UAAU,CAAC;EACX,SAAS;EACT,GAAI;YAbN,CAeE,oBAAC,YAAD,CAAa,CAAA,GACb,oBAAC,QAAD;GAAM,WAAU;aAAU;EAAgB,CAAA,CACpC;;AAEZ"}
|
|
@@ -30,7 +30,7 @@ function ChartContainer({ id, className, children, config, initialDimension = IN
|
|
|
30
30
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
31
31
|
"data-slot": "chart",
|
|
32
32
|
"data-chart": chartId,
|
|
33
|
-
className: require_cn.cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-
|
|
33
|
+
className: require_cn.cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-txt [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-primary-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-primary-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-primary-border [&_.recharts-radial-bar-background-sector]:fill-muted-bg [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted-bg [&_.recharts-reference-line_[stroke='#ccc']]:stroke-primary-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className),
|
|
34
34
|
...props,
|
|
35
35
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChartStyle, {
|
|
36
36
|
id: chartId,
|
|
@@ -66,12 +66,12 @@ function ChartTooltipContent({ active, payload, className, indicator = "dot", hi
|
|
|
66
66
|
const itemConfig = getPayloadConfigFromPayload(config, item, `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`);
|
|
67
67
|
const value = !labelKey && typeof label === "string" ? config[label]?.label ?? label : itemConfig?.label;
|
|
68
68
|
if (labelFormatter) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
69
|
-
className: require_cn.cn("font-
|
|
69
|
+
className: require_cn.cn("font-semibold", labelClassName),
|
|
70
70
|
children: labelFormatter(value, payload)
|
|
71
71
|
});
|
|
72
72
|
if (!value) return null;
|
|
73
73
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
74
|
-
className: require_cn.cn("font-
|
|
74
|
+
className: require_cn.cn("font-semibold", labelClassName),
|
|
75
75
|
children: value
|
|
76
76
|
});
|
|
77
77
|
}, [
|
|
@@ -86,19 +86,19 @@ function ChartTooltipContent({ active, payload, className, indicator = "dot", hi
|
|
|
86
86
|
if (!active || !payload?.length) return null;
|
|
87
87
|
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
88
88
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
89
|
-
className: require_cn.cn("grid min-w-
|
|
89
|
+
className: require_cn.cn("grid min-w-32 items-start rounded-8 border border-primary-border bg-glass-none-bg px-3 py-2 text-xs leading-4", className),
|
|
90
90
|
children: [!nestLabel ? tooltipLabel : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
91
91
|
className: "grid gap-1.5",
|
|
92
92
|
children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
93
93
|
const itemConfig = getPayloadConfigFromPayload(config, item, `${nameKey ?? item.name ?? item.dataKey ?? "value"}`);
|
|
94
94
|
const indicatorColor = color ?? item.payload?.fill ?? item.color;
|
|
95
95
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
96
|
-
className: require_cn.cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-
|
|
96
|
+
className: require_cn.cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-txt", indicator === "dot" && "items-center"),
|
|
97
97
|
children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [itemConfig?.icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
98
|
-
className: require_cn.cn("shrink-0 rounded-
|
|
98
|
+
className: require_cn.cn("shrink-0 rounded-2 border-(--color-border) bg-(--color-bg)", {
|
|
99
99
|
"h-2.5 w-2.5": indicator === "dot",
|
|
100
|
-
"w-
|
|
101
|
-
"w-0 border-
|
|
100
|
+
"w-0.75": indicator === "line",
|
|
101
|
+
"w-0 border-2 border-dashed bg-transparent": indicator === "dashed",
|
|
102
102
|
"my-0.5": nestLabel && indicator === "dashed"
|
|
103
103
|
}),
|
|
104
104
|
style: {
|
|
@@ -110,11 +110,11 @@ function ChartTooltipContent({ active, payload, className, indicator = "dot", hi
|
|
|
110
110
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
111
111
|
className: "grid gap-1.5",
|
|
112
112
|
children: [nestLabel ? tooltipLabel : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
113
|
-
className: "text-
|
|
113
|
+
className: "text-primary-txt",
|
|
114
114
|
children: itemConfig?.label ?? item.name
|
|
115
115
|
})]
|
|
116
116
|
}), item.value != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
117
|
-
className: "font-
|
|
117
|
+
className: "font-semibold text-primary-txt tabular-nums",
|
|
118
118
|
children: typeof item.value === "number" ? item.value.toLocaleString() : String(item.value)
|
|
119
119
|
})]
|
|
120
120
|
})] })
|
|
@@ -134,9 +134,9 @@ function ChartLegendContent({ className, hideIcon = false, payload, verticalAlig
|
|
|
134
134
|
children: payload.filter((item) => item.type !== "none").map((item, index) => {
|
|
135
135
|
const itemConfig = getPayloadConfigFromPayload(config, item, `${nameKey ?? item.dataKey ?? "value"}`);
|
|
136
136
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
137
|
-
className: require_cn.cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-
|
|
137
|
+
className: require_cn.cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-txt"),
|
|
138
138
|
children: [itemConfig?.icon && !hideIcon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(itemConfig.icon, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
139
|
-
className: "h-2 w-2 shrink-0 rounded-
|
|
139
|
+
className: "h-2 w-2 shrink-0 rounded-2",
|
|
140
140
|
style: { backgroundColor: item.color }
|
|
141
141
|
}), itemConfig?.label]
|
|
142
142
|
}, index);
|