@psnext/design-system 1.5.1 → 2.1.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 +32 -29
- package/dist/Header.cjs.map +1 -1
- package/dist/Header.js +32 -29
- 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 +4 -4
- 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/index26.d.cts +13 -13
- 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.cts.map +1 -1
- package/dist/index27.d.ts +7 -7
- package/dist/index27.d.ts.map +1 -1
- package/dist/index28.d.cts +5 -5
- 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 +5 -5
- package/dist/index30.d.ts +5 -5
- package/dist/index31.d.cts +5 -5
- package/dist/index31.d.cts.map +1 -1
- package/dist/index31.d.ts +5 -5
- 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 +14 -10
- package/dist/index33.d.ts.map +1 -1
- package/dist/index34.d.cts +5 -5
- package/dist/index34.d.ts +5 -5
- package/dist/index35.d.cts +14 -14
- package/dist/index35.d.ts +16 -16
- 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.cts.map +1 -1
- 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.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 +55 -37
- 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 +26 -25
- 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 +249 -0
- package/dist/index71.d.cts.map +1 -0
- package/dist/index71.d.ts +249 -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.cts.map +1 -1
- 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 +13 -13
- package/dist/patterns/MediaObject/index.d.cts.map +1 -1
- package/dist/patterns/MediaObject/index.d.ts +10 -10
- 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.cts.map +1 -1
- package/dist/patterns/SectionCard/index.d.ts +2 -2
- package/dist/patterns/SectionCard/index.d.ts.map +1 -1
- package/dist/patterns/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
|
@@ -2,11 +2,11 @@ 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/Empty/Empty.tsx
|
|
5
|
-
const emptyVariants = cva("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-
|
|
5
|
+
const emptyVariants = cva("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-8 p-6 text-center text-balance md:p-12", {
|
|
6
6
|
variants: { variant: {
|
|
7
7
|
default: "",
|
|
8
8
|
outline: "border",
|
|
9
|
-
background: "bg-muted",
|
|
9
|
+
background: "bg-muted-bg",
|
|
10
10
|
"outline-dashed": "border border-dashed"
|
|
11
11
|
} },
|
|
12
12
|
defaultVariants: { variant: "default" }
|
|
@@ -31,7 +31,7 @@ function EmptyHeader({ className, ...props }) {
|
|
|
31
31
|
const emptyMediaVariants = cva("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
32
32
|
variants: { variant: {
|
|
33
33
|
default: "bg-transparent",
|
|
34
|
-
icon: "flex size-10 shrink-0 items-center justify-center rounded-
|
|
34
|
+
icon: "flex size-10 shrink-0 items-center justify-center rounded-8 bg-muted-bg text-primary-txt [&_svg:not([class*='size-'])]:size-6"
|
|
35
35
|
} },
|
|
36
36
|
defaultVariants: { variant: "default" }
|
|
37
37
|
});
|
|
@@ -59,7 +59,7 @@ function EmptyTitle({ className, ...props }) {
|
|
|
59
59
|
function EmptyDescription({ className, ...props }) {
|
|
60
60
|
return /* @__PURE__ */ jsx("div", {
|
|
61
61
|
"data-slot": "empty-description",
|
|
62
|
-
className: cn("text-sm/relaxed text-muted-
|
|
62
|
+
className: cn("text-sm/relaxed text-muted-txt [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary-txt", className),
|
|
63
63
|
...props
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Empty/Empty.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nconst emptyVariants = cva(\n \"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Empty/Empty.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nconst emptyVariants = cva(\n \"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-8 p-6 text-center text-balance md:p-12\",\n {\n variants: {\n // Container chrome — matches the Figma \"Empty\" variant axis.\n variant: {\n default: \"\",\n outline: \"border\",\n background: \"bg-muted-bg\",\n \"outline-dashed\": \"border border-dashed\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\n/** Centered empty-state container; compose Header/Media/Title/Description/Content inside it. */\nfunction Empty({\n className,\n /** Container chrome: plain, bordered, muted background, or dashed border. */\n variant = \"default\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof emptyVariants>) {\n return (\n <div\n data-slot=\"empty\"\n data-variant={variant}\n className={cn(emptyVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\n/** Groups the media, title, and description with centered alignment. */\nfunction EmptyHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty-header\"\n className={cn(\"flex max-w-sm flex-col items-center gap-2 text-center\", className)}\n {...props}\n />\n );\n}\n\nconst emptyMediaVariants = cva(\n \"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n icon: \"flex size-10 shrink-0 items-center justify-center rounded-8 bg-muted-bg text-primary-txt [&_svg:not([class*='size-'])]:size-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\n/** Holds the leading illustration or icon above the title. */\nfunction EmptyMedia({\n className,\n /** Visual treatment: bare media or a rounded muted icon badge. */\n variant = \"default\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof emptyMediaVariants>) {\n return (\n <div\n data-slot=\"empty-icon\"\n data-variant={variant}\n className={cn(emptyMediaVariants({ variant, className }))}\n {...props}\n />\n );\n}\n\n/** The primary heading line of the empty state. */\nfunction EmptyTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty-title\"\n className={cn(\"text-lg font-medium tracking-tight\", className)}\n {...props}\n />\n );\n}\n\n/** Muted supporting copy explaining the empty state. */\nfunction EmptyDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <div\n data-slot=\"empty-description\"\n className={cn(\n \"text-sm/relaxed text-muted-txt [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary-txt\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Slot for actions or follow-up content below the header. */\nfunction EmptyContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty-content\"\n className={cn(\n \"flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Empty,\n EmptyHeader,\n EmptyTitle,\n EmptyDescription,\n EmptyContent,\n EmptyMedia,\n emptyVariants,\n};\n"],"mappings":";;;;AAKA,MAAM,gBAAgB,IACpB,iHACA;CACE,UAAU,EAER,SAAS;EACP,SAAS;EACT,SAAS;EACT,YAAY;EACZ,kBAAkB;CACpB,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF;;AAGA,SAAS,MAAM,EACb,WAEA,UAAU,WACV,GAAG,SACgE;CACnE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,gBAAc;EACd,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS;EACnD,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,yDAAyD,SAAS;EAChF,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,qBAAqB,IACzB,+FACA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,MAAM;CACR,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF;;AAGA,SAAS,WAAW,EAClB,WAEA,UAAU,WACV,GAAG,SACqE;CACxE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,gBAAc;EACd,WAAW,GAAG,mBAAmB;GAAE;GAAS;EAAU,CAAC,CAAC;EACxD,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,sCAAsC,SAAS;EAC7D,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAoC;CAC5E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,wGACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,iFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -31,7 +31,7 @@ function FieldGroup({ className, ...props }) {
|
|
|
31
31
|
...props
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
const fieldVariants = (0, class_variance_authority.cva)("group/field flex w-full gap-3 data-[invalid=true]:text-
|
|
34
|
+
const fieldVariants = (0, class_variance_authority.cva)("group/field flex w-full gap-3 data-[invalid=true]:text-danger-txt", {
|
|
35
35
|
variants: { orientation: {
|
|
36
36
|
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
37
37
|
horizontal: [
|
|
@@ -69,7 +69,7 @@ function FieldContent({ className, ...props }) {
|
|
|
69
69
|
function FieldLabel({ className, ...props }) {
|
|
70
70
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Label_index.Label, {
|
|
71
71
|
"data-slot": "field-label",
|
|
72
|
-
className: require_cn.cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-
|
|
72
|
+
className: require_cn.cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-6 has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4", "has-data-[state=checked]:border-selected-border has-data-[state=checked]:bg-primary-invert-bg/5", className),
|
|
73
73
|
...props
|
|
74
74
|
});
|
|
75
75
|
}
|
|
@@ -85,7 +85,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
85
85
|
function FieldDescription({ className, ...props }) {
|
|
86
86
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
87
87
|
"data-slot": "field-description",
|
|
88
|
-
className: require_cn.cn("text-sm leading-normal font-normal text-muted-
|
|
88
|
+
className: require_cn.cn("text-sm leading-normal font-normal text-muted-txt group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary-txt", className),
|
|
89
89
|
...props
|
|
90
90
|
});
|
|
91
91
|
}
|
|
@@ -97,7 +97,7 @@ function FieldSeparator({ children, className, ...props }) {
|
|
|
97
97
|
className: require_cn.cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
|
|
98
98
|
...props,
|
|
99
99
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Separator_index.Separator, { className: "absolute inset-0 top-1/2" }), children && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
100
|
-
className: "relative mx-auto block w-fit bg-
|
|
100
|
+
className: "relative mx-auto block w-fit bg-primary-bg px-2 text-muted-txt",
|
|
101
101
|
"data-slot": "field-separator-content",
|
|
102
102
|
children
|
|
103
103
|
})]
|
|
@@ -119,7 +119,7 @@ function FieldError({ className, children, errors, ...props }) {
|
|
|
119
119
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
120
120
|
role: "alert",
|
|
121
121
|
"data-slot": "field-error",
|
|
122
|
-
className: require_cn.cn("text-sm font-normal text-
|
|
122
|
+
className: require_cn.cn("text-sm font-normal text-danger-txt", className),
|
|
123
123
|
...props,
|
|
124
124
|
children: content
|
|
125
125
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["cn","Label","Separator"],"sources":["../../../src/primitives/Field/Field.tsx"],"sourcesContent":["\"use client\";\n\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { useMemo } from \"react\";\nimport type * as React from \"react\";\n\nimport { Label } from \"@/primitives/Label\";\nimport { Separator } from \"@/primitives/Separator\";\nimport { cn } from \"@/utils\";\n\n/** A `<fieldset>` wrapper that groups related fields with consistent spacing. */\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-6\",\n \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** The caption for a `FieldSet`, rendered as a `<legend>`. */\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & {\n /** Visual scale of the legend: section header (`legend`) or smaller label-sized (`label`). */\n variant?: \"legend\" | \"label\";\n}) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A container that stacks multiple `Field`s with group-level spacing and a responsive container. */\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva(\"group/field flex w-full gap-3 data-[invalid=true]:text-destructive\", {\n variants: {\n orientation: {\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\n horizontal: [\n \"flex-row items-center\",\n \"[&>[data-slot=field-label]]:flex-auto\",\n \"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n responsive: [\n \"flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto\",\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\n \"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n});\n\n/** A single labelled form field that lays out a control with its label, description, and error. */\nfunction Field({\n className,\n /** Layout direction of the label/control: stacked (`vertical`), side-by-side (`horizontal`), or `responsive`. */\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\n/** Stacks a label and description next to a control (used in horizontal checkbox/radio fields). */\nfunction FieldContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\"group/field-content flex flex-1 flex-col gap-1.5 leading-snug\", className)}\n {...props}\n />\n );\n}\n\n/** The accessible label for a field's control; wraps the `Label` primitive. */\nfunction FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n \"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4\",\n \"has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A non-`<label>` title for a field group, styled like a label but not bound to a control. */\nfunction FieldTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Muted helper text shown beneath (or beside) a field's control. */\nfunction FieldDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance\",\n \"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5\",\n \"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A horizontal divider between groups of fields, optionally with centered label content. */\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Optional label rendered centered over the divider line. */\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\",\n className,\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"relative mx-auto block w-fit bg-background px-2 text-muted-foreground\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n\n/** A destructive `role=\"alert\"` message for a field, rendered from `children` or a list of `errors`. */\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Validation errors to render; deduped by message and listed when more than one. Ignored if `children` is provided. */\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors?.length) {\n return null;\n }\n\n const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];\n\n if (uniqueErrors?.length === 1) {\n return uniqueErrors[0]?.message;\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map((error, index) => error?.message && <li key={index}>{error.message}</li>)}\n </ul>\n );\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(\"text-sm font-normal text-destructive\", className)}\n {...props}\n >\n {content}\n </div>\n );\n}\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n};\n"],"mappings":";;;;;;;;;AAWA,SAAS,SAAS,EAAE,WAAW,GAAG,SAA2C;CAC3E,OACE,iBAAA,GAAA,kBAAA,KAAC,YAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GACT,uBACA,gFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EACnB,WACA,UAAU,UACV,GAAG,SAIF;CACD,OACE,iBAAA,GAAA,kBAAA,KAAC,UAAD;EACE,aAAU;EACV,gBAAc;EACd,WAAWA,WAAAA,GACT,oBACA,mCACA,gCACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GACT,0IACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,iBAAA,GAAA,yBAAA,KAAoB,sEAAsE;CAC9F,UAAU,EACR,aAAa;EACX,UAAU,CAAC,2CAA2C;EACtD,YAAY;GACV;GACA;GACA;EACF;EACA,YAAY;GACV;GACA;GACA;EACF;CACF,EACF;CACA,iBAAiB,EACf,aAAa,WACf;AACF,CAAC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EACG,CAAA,CAEL;;AAET;;AAGA,SAAS,WAAW,EAClB,WACA,UACA,QACA,GAAG,SAIF;CACD,MAAM,WAAA,GAAA,MAAA,eAAwB;EAC5B,IAAI,UACF,OAAO;EAGT,IAAI,CAAC,QAAQ,QACX,OAAO;EAGT,MAAM,eAAe,CAAC,GAAG,IAAI,IAAI,OAAO,KAAK,UAAU,CAAC,OAAO,SAAS,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC;EAEzF,IAAI,cAAc,WAAW,GAC3B,OAAO,aAAa,IAAI;EAG1B,OACE,iBAAA,GAAA,kBAAA,KAAC,MAAD;GAAI,WAAU;aACX,aAAa,KAAK,OAAO,UAAU,OAAO,WAAW,iBAAA,GAAA,kBAAA,KAAC,MAAD,EAAA,UAAiB,MAAM,QAAY,GAA1B,KAA0B,CAAC;EACxF,CAAA;CAER,GAAG,CAAC,UAAU,MAAM,CAAC;CAErB,IAAI,CAAC,SACH,OAAO;CAGT,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,MAAK;EACL,aAAU;EACV,WAAWF,WAAAA,GAAG,wCAAwC,SAAS;EAC/D,GAAI;YAEH;CACE,CAAA;AAET"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["cn","Label","Separator"],"sources":["../../../src/primitives/Field/Field.tsx"],"sourcesContent":["\"use client\";\n\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { useMemo } from \"react\";\nimport type * as React from \"react\";\n\nimport { Label } from \"@/primitives/Label\";\nimport { Separator } from \"@/primitives/Separator\";\nimport { cn } from \"@/utils\";\n\n/** A `<fieldset>` wrapper that groups related fields with consistent spacing. */\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-6\",\n \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** The caption for a `FieldSet`, rendered as a `<legend>`. */\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & {\n /** Visual scale of the legend: section header (`legend`) or smaller label-sized (`label`). */\n variant?: \"legend\" | \"label\";\n}) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A container that stacks multiple `Field`s with group-level spacing and a responsive container. */\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva(\"group/field flex w-full gap-3 data-[invalid=true]:text-danger-txt\", {\n variants: {\n orientation: {\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\n horizontal: [\n \"flex-row items-center\",\n \"[&>[data-slot=field-label]]:flex-auto\",\n \"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n responsive: [\n \"flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto\",\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\n \"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n});\n\n/** A single labelled form field that lays out a control with its label, description, and error. */\nfunction Field({\n className,\n /** Layout direction of the label/control: stacked (`vertical`), side-by-side (`horizontal`), or `responsive`. */\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\n/** Stacks a label and description next to a control (used in horizontal checkbox/radio fields). */\nfunction FieldContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\"group/field-content flex flex-1 flex-col gap-1.5 leading-snug\", className)}\n {...props}\n />\n );\n}\n\n/** The accessible label for a field's control; wraps the `Label` primitive. */\nfunction FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n \"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-6 has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4\",\n \"has-data-[state=checked]:border-selected-border has-data-[state=checked]:bg-primary-invert-bg/5\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A non-`<label>` title for a field group, styled like a label but not bound to a control. */\nfunction FieldTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Muted helper text shown beneath (or beside) a field's control. */\nfunction FieldDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"text-sm leading-normal font-normal text-muted-txt group-has-[[data-orientation=horizontal]]/field:text-balance\",\n \"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5\",\n \"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary-txt\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A horizontal divider between groups of fields, optionally with centered label content. */\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Optional label rendered centered over the divider line. */\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\",\n className,\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"relative mx-auto block w-fit bg-primary-bg px-2 text-muted-txt\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n\n/** A destructive `role=\"alert\"` message for a field, rendered from `children` or a list of `errors`. */\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Validation errors to render; deduped by message and listed when more than one. Ignored if `children` is provided. */\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors?.length) {\n return null;\n }\n\n const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];\n\n if (uniqueErrors?.length === 1) {\n return uniqueErrors[0]?.message;\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map((error, index) => error?.message && <li key={index}>{error.message}</li>)}\n </ul>\n );\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(\"text-sm font-normal text-danger-txt\", className)}\n {...props}\n >\n {content}\n </div>\n );\n}\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n};\n"],"mappings":";;;;;;;;;AAWA,SAAS,SAAS,EAAE,WAAW,GAAG,SAA2C;CAC3E,OACE,iBAAA,GAAA,kBAAA,KAAC,YAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GACT,uBACA,gFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA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uCAAuC,SAAS;EAC9D,GAAI;YAEH;CACE,CAAA;AAET"}
|
|
@@ -30,7 +30,7 @@ function FieldGroup({ className, ...props }) {
|
|
|
30
30
|
...props
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
const fieldVariants = cva("group/field flex w-full gap-3 data-[invalid=true]:text-
|
|
33
|
+
const fieldVariants = cva("group/field flex w-full gap-3 data-[invalid=true]:text-danger-txt", {
|
|
34
34
|
variants: { orientation: {
|
|
35
35
|
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
36
36
|
horizontal: [
|
|
@@ -68,7 +68,7 @@ function FieldContent({ className, ...props }) {
|
|
|
68
68
|
function FieldLabel({ className, ...props }) {
|
|
69
69
|
return /* @__PURE__ */ jsx(Label, {
|
|
70
70
|
"data-slot": "field-label",
|
|
71
|
-
className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-
|
|
71
|
+
className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-6 has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4", "has-data-[state=checked]:border-selected-border has-data-[state=checked]:bg-primary-invert-bg/5", className),
|
|
72
72
|
...props
|
|
73
73
|
});
|
|
74
74
|
}
|
|
@@ -84,7 +84,7 @@ function FieldTitle({ className, ...props }) {
|
|
|
84
84
|
function FieldDescription({ className, ...props }) {
|
|
85
85
|
return /* @__PURE__ */ jsx("p", {
|
|
86
86
|
"data-slot": "field-description",
|
|
87
|
-
className: cn("text-sm leading-normal font-normal text-muted-
|
|
87
|
+
className: cn("text-sm leading-normal font-normal text-muted-txt group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary-txt", className),
|
|
88
88
|
...props
|
|
89
89
|
});
|
|
90
90
|
}
|
|
@@ -96,7 +96,7 @@ function FieldSeparator({ children, className, ...props }) {
|
|
|
96
96
|
className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
|
|
97
97
|
...props,
|
|
98
98
|
children: [/* @__PURE__ */ jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && /* @__PURE__ */ jsx("span", {
|
|
99
|
-
className: "relative mx-auto block w-fit bg-
|
|
99
|
+
className: "relative mx-auto block w-fit bg-primary-bg px-2 text-muted-txt",
|
|
100
100
|
"data-slot": "field-separator-content",
|
|
101
101
|
children
|
|
102
102
|
})]
|
|
@@ -118,7 +118,7 @@ function FieldError({ className, children, errors, ...props }) {
|
|
|
118
118
|
return /* @__PURE__ */ jsx("div", {
|
|
119
119
|
role: "alert",
|
|
120
120
|
"data-slot": "field-error",
|
|
121
|
-
className: cn("text-sm font-normal text-
|
|
121
|
+
className: cn("text-sm font-normal text-danger-txt", className),
|
|
122
122
|
...props,
|
|
123
123
|
children: content
|
|
124
124
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Field/Field.tsx"],"sourcesContent":["\"use client\";\n\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { useMemo } from \"react\";\nimport type * as React from \"react\";\n\nimport { Label } from \"@/primitives/Label\";\nimport { Separator } from \"@/primitives/Separator\";\nimport { cn } from \"@/utils\";\n\n/** A `<fieldset>` wrapper that groups related fields with consistent spacing. */\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-6\",\n \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** The caption for a `FieldSet`, rendered as a `<legend>`. */\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & {\n /** Visual scale of the legend: section header (`legend`) or smaller label-sized (`label`). */\n variant?: \"legend\" | \"label\";\n}) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A container that stacks multiple `Field`s with group-level spacing and a responsive container. */\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva(\"group/field flex w-full gap-3 data-[invalid=true]:text-
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Field/Field.tsx"],"sourcesContent":["\"use client\";\n\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { useMemo } from \"react\";\nimport type * as React from \"react\";\n\nimport { Label } from \"@/primitives/Label\";\nimport { Separator } from \"@/primitives/Separator\";\nimport { cn } from \"@/utils\";\n\n/** A `<fieldset>` wrapper that groups related fields with consistent spacing. */\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-6\",\n \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** The caption for a `FieldSet`, rendered as a `<legend>`. */\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & {\n /** Visual scale of the legend: section header (`legend`) or smaller label-sized (`label`). */\n variant?: \"legend\" | \"label\";\n}) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A container that stacks multiple `Field`s with group-level spacing and a responsive container. */\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva(\"group/field flex w-full gap-3 data-[invalid=true]:text-danger-txt\", {\n variants: {\n orientation: {\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\n horizontal: [\n \"flex-row items-center\",\n \"[&>[data-slot=field-label]]:flex-auto\",\n \"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n responsive: [\n \"flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto\",\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\n \"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n});\n\n/** A single labelled form field that lays out a control with its label, description, and error. */\nfunction Field({\n className,\n /** Layout direction of the label/control: stacked (`vertical`), side-by-side (`horizontal`), or `responsive`. */\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\n/** Stacks a label and description next to a control (used in horizontal checkbox/radio fields). */\nfunction FieldContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\"group/field-content flex flex-1 flex-col gap-1.5 leading-snug\", className)}\n {...props}\n />\n );\n}\n\n/** The accessible label for a field's control; wraps the `Label` primitive. */\nfunction FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n \"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-6 has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4\",\n \"has-data-[state=checked]:border-selected-border has-data-[state=checked]:bg-primary-invert-bg/5\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A non-`<label>` title for a field group, styled like a label but not bound to a control. */\nfunction FieldTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Muted helper text shown beneath (or beside) a field's control. */\nfunction FieldDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"text-sm leading-normal font-normal text-muted-txt group-has-[[data-orientation=horizontal]]/field:text-balance\",\n \"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5\",\n \"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary-txt\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A horizontal divider between groups of fields, optionally with centered label content. */\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Optional label rendered centered over the divider line. */\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\",\n className,\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"relative mx-auto block w-fit bg-primary-bg px-2 text-muted-txt\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n\n/** A destructive `role=\"alert\"` message for a field, rendered from `children` or a list of `errors`. */\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Validation errors to render; deduped by message and listed when more than one. Ignored if `children` is provided. */\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors?.length) {\n return null;\n }\n\n const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];\n\n if (uniqueErrors?.length === 1) {\n return uniqueErrors[0]?.message;\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map((error, index) => error?.message && <li key={index}>{error.message}</li>)}\n </ul>\n );\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(\"text-sm font-normal text-danger-txt\", className)}\n {...props}\n >\n {content}\n </div>\n );\n}\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n};\n"],"mappings":";;;;;;;;AAWA,SAAS,SAAS,EAAE,WAAW,GAAG,SAA2C;CAC3E,OACE,oBAAC,YAAD;EACE,aAAU;EACV,WAAW,GACT,uBACA,gFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EACnB,WACA,UAAU,UACV,GAAG,SAIF;CACD,OACE,oBAAC,UAAD;EACE,aAAU;EACV,gBAAc;EACd,WAAW,GACT,oBACA,mCACA,gCACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,WAAW,EAAE,W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D,EAAW,WAAU,2BAA4B,CAAA,GAChD,YACC,oBAAC,QAAD;GACE,WAAU;GACV,aAAU;GAET;EACG,CAAA,CAEL;;AAET;;AAGA,SAAS,WAAW,EAClB,WACA,UACA,QACA,GAAG,SAIF;CACD,MAAM,UAAU,cAAc;EAC5B,IAAI,UACF,OAAO;EAGT,IAAI,CAAC,QAAQ,QACX,OAAO;EAGT,MAAM,eAAe,CAAC,GAAG,IAAI,IAAI,OAAO,KAAK,UAAU,CAAC,OAAO,SAAS,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC;EAEzF,IAAI,cAAc,WAAW,GAC3B,OAAO,aAAa,IAAI;EAG1B,OACE,oBAAC,MAAD;GAAI,WAAU;aACX,aAAa,KAAK,OAAO,UAAU,OAAO,WAAW,oBAAC,MAAD,EAAA,UAAiB,MAAM,QAAY,GAA1B,KAA0B,CAAC;EACxF,CAAA;CAER,GAAG,CAAC,UAAU,MAAM,CAAC;CAErB,IAAI,CAAC,SACH,OAAO;CAGT,OACE,oBAAC,OAAD;EACE,MAAK;EACL,aAAU;EACV,WAAW,GAAG,uCAAuC,SAAS;EAC9D,GAAI;YAEH;CACE,CAAA;AAET"}
|
|
@@ -54,7 +54,7 @@ function FormLabel({ className, ...props }) {
|
|
|
54
54
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Field_index.FieldLabel, {
|
|
55
55
|
"data-slot": "form-label",
|
|
56
56
|
"data-error": !!error,
|
|
57
|
-
className: require_cn.cn("data-[error=true]:text-
|
|
57
|
+
className: require_cn.cn("data-[error=true]:text-danger-txt", className),
|
|
58
58
|
htmlFor: formItemId,
|
|
59
59
|
...props
|
|
60
60
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["FormProvider","React","Controller","Field","FieldLabel","cn","Slot","FieldDescription","FieldError"],"sources":["../../../src/primitives/Form/Form.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n useFormState,\n} from \"react-hook-form\";\n\nimport { Field, FieldDescription, FieldError, FieldLabel } from \"@/primitives/Field\";\nimport { cn } from \"@/utils\";\n\n/** Root provider that shares one react-hook-form instance with all nested form pieces. */\n// Form is the react-hook-form binding layer. Its presentation pieces render the\n// Field primitives underneath so RHF forms share one visual system with non-RHF\n// forms built directly on Field.\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n /** The react-hook-form field name this context binds its descendants to. */\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\n/** Connects a single input to the form via RHF's `Controller`, exposing `field` to its render prop. */\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\n/** Hook for form pieces to read the current field's id, name, ARIA ids, and validation state. */\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n /** Generated id used to derive the field's control, description, and message ARIA ids. */\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\n/** Wraps one field, generating an id so its label, control, and messages stay linked. */\nfunction FormItem({ ...props }: React.ComponentProps<typeof Field>) {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <Field data-slot=\"form-item\" {...props} />\n </FormItemContext.Provider>\n );\n}\n\n/** Field label wired to the control's id and tinted destructive when the field is invalid. */\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof FieldLabel>) {\n const { error, formItemId } = useFormField();\n\n return (\n <FieldLabel\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn(\"data-[error=true]:text-
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["FormProvider","React","Controller","Field","FieldLabel","cn","Slot","FieldDescription","FieldError"],"sources":["../../../src/primitives/Form/Form.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n useFormState,\n} from \"react-hook-form\";\n\nimport { Field, FieldDescription, FieldError, FieldLabel } from \"@/primitives/Field\";\nimport { cn } from \"@/utils\";\n\n/** Root provider that shares one react-hook-form instance with all nested form pieces. */\n// Form is the react-hook-form binding layer. Its presentation pieces render the\n// Field primitives underneath so RHF forms share one visual system with non-RHF\n// forms built directly on Field.\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n /** The react-hook-form field name this context binds its descendants to. */\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\n/** Connects a single input to the form via RHF's `Controller`, exposing `field` to its render prop. */\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\n/** Hook for form pieces to read the current field's id, name, ARIA ids, and validation state. */\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n /** Generated id used to derive the field's control, description, and message ARIA ids. */\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\n/** Wraps one field, generating an id so its label, control, and messages stay linked. */\nfunction FormItem({ ...props }: React.ComponentProps<typeof Field>) {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <Field data-slot=\"form-item\" {...props} />\n </FormItemContext.Provider>\n );\n}\n\n/** Field label wired to the control's id and tinted destructive when the field is invalid. */\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof FieldLabel>) {\n const { error, formItemId } = useFormField();\n\n return (\n <FieldLabel\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn(\"data-[error=true]:text-danger-txt\", className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n}\n\n/** Slots the actual input, applying the field's id, `aria-describedby`, and `aria-invalid`. */\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot.Root>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot.Root\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n}\n\n/** Helper text for a field, linked to its control via `aria-describedby`. */\nfunction FormDescription({ ...props }: React.ComponentProps<typeof FieldDescription>) {\n const { formDescriptionId } = useFormField();\n\n return <FieldDescription data-slot=\"form-description\" id={formDescriptionId} {...props} />;\n}\n\n/** Renders the field's validation error (or `children`), and nothing when there is no message. */\nfunction FormMessage({ children, ...props }: React.ComponentProps<typeof FieldError>) {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? \"\") : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <FieldError data-slot=\"form-message\" id={formMessageId} {...props}>\n {body}\n </FieldError>\n );\n}\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n};\n"],"mappings":";;;;;;;;;;;AAqBA,MAAM,OAAOA,gBAAAA;AAUb,MAAM,mBAAmBC,MAAM,cAAqC,CAAC,CAA0B;;AAG/F,MAAM,aAGJ,EACA,GAAG,YACuC;CAC1C,OACE,iBAAA,GAAA,kBAAA,KAAC,iBAAiB,UAAlB;EAA2B,OAAO,EAAE,MAAM,MAAM,KAAK;YACnD,iBAAA,GAAA,kBAAA,KAACC,gBAAAA,YAAD,EAAY,GAAI,MAAQ,CAAA;CACC,CAAA;AAE/B;;AAGA,MAAM,qBAAqB;CACzB,MAAM,eAAeD,MAAM,WAAW,gBAAgB;CACtD,MAAM,cAAcA,MAAM,WAAW,eAAe;CACpD,MAAM,EAAE,mBAAA,GAAA,gBAAA,gBAAiC;CACzC,MAAM,aAAA,GAAA,gBAAA,cAAyB,EAAE,MAAM,aAAa,KAAK,CAAC;CAC1D,MAAM,aAAa,cAAc,aAAa,MAAM,SAAS;CAE7D,IAAI,CAAC,cACH,MAAM,IAAI,MAAM,gDAAgD;CAGlE,MAAM,EAAE,OAAO;CAEf,OAAO;EACL;EACA,MAAM,aAAa;EACnB,YAAY,GAAG,GAAG;EAClB,mBAAmB,GAAG,GAAG;EACzB,eAAe,GAAG,GAAG;EACrB,GAAG;CACL;AACF;AAOA,MAAM,kBAAkBA,MAAM,cAAoC,CAAC,CAAyB;;AAG5F,SAAS,SAAS,EAAE,GAA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
|
|
@@ -51,7 +51,7 @@ function FormLabel({ className, ...props }) {
|
|
|
51
51
|
return /* @__PURE__ */ jsx(FieldLabel, {
|
|
52
52
|
"data-slot": "form-label",
|
|
53
53
|
"data-error": !!error,
|
|
54
|
-
className: cn("data-[error=true]:text-
|
|
54
|
+
className: cn("data-[error=true]:text-danger-txt", className),
|
|
55
55
|
htmlFor: formItemId,
|
|
56
56
|
...props
|
|
57
57
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Form/Form.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n useFormState,\n} from \"react-hook-form\";\n\nimport { Field, FieldDescription, FieldError, FieldLabel } from \"@/primitives/Field\";\nimport { cn } from \"@/utils\";\n\n/** Root provider that shares one react-hook-form instance with all nested form pieces. */\n// Form is the react-hook-form binding layer. Its presentation pieces render the\n// Field primitives underneath so RHF forms share one visual system with non-RHF\n// forms built directly on Field.\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n /** The react-hook-form field name this context binds its descendants to. */\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\n/** Connects a single input to the form via RHF's `Controller`, exposing `field` to its render prop. */\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\n/** Hook for form pieces to read the current field's id, name, ARIA ids, and validation state. */\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n /** Generated id used to derive the field's control, description, and message ARIA ids. */\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\n/** Wraps one field, generating an id so its label, control, and messages stay linked. */\nfunction FormItem({ ...props }: React.ComponentProps<typeof Field>) {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <Field data-slot=\"form-item\" {...props} />\n </FormItemContext.Provider>\n );\n}\n\n/** Field label wired to the control's id and tinted destructive when the field is invalid. */\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof FieldLabel>) {\n const { error, formItemId } = useFormField();\n\n return (\n <FieldLabel\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn(\"data-[error=true]:text-
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Form/Form.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slot } from \"radix-ui\";\nimport * as React from \"react\";\nimport {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n useFormState,\n} from \"react-hook-form\";\n\nimport { Field, FieldDescription, FieldError, FieldLabel } from \"@/primitives/Field\";\nimport { cn } from \"@/utils\";\n\n/** Root provider that shares one react-hook-form instance with all nested form pieces. */\n// Form is the react-hook-form binding layer. Its presentation pieces render the\n// Field primitives underneath so RHF forms share one visual system with non-RHF\n// forms built directly on Field.\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n /** The react-hook-form field name this context binds its descendants to. */\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\n/** Connects a single input to the form via RHF's `Controller`, exposing `field` to its render prop. */\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\n/** Hook for form pieces to read the current field's id, name, ARIA ids, and validation state. */\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n /** Generated id used to derive the field's control, description, and message ARIA ids. */\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\n/** Wraps one field, generating an id so its label, control, and messages stay linked. */\nfunction FormItem({ ...props }: React.ComponentProps<typeof Field>) {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <Field data-slot=\"form-item\" {...props} />\n </FormItemContext.Provider>\n );\n}\n\n/** Field label wired to the control's id and tinted destructive when the field is invalid. */\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof FieldLabel>) {\n const { error, formItemId } = useFormField();\n\n return (\n <FieldLabel\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn(\"data-[error=true]:text-danger-txt\", className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n}\n\n/** Slots the actual input, applying the field's id, `aria-describedby`, and `aria-invalid`. */\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot.Root>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot.Root\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n}\n\n/** Helper text for a field, linked to its control via `aria-describedby`. */\nfunction FormDescription({ ...props }: React.ComponentProps<typeof FieldDescription>) {\n const { formDescriptionId } = useFormField();\n\n return <FieldDescription data-slot=\"form-description\" id={formDescriptionId} {...props} />;\n}\n\n/** Renders the field's validation error (or `children`), and nothing when there is no message. */\nfunction FormMessage({ children, ...props }: React.ComponentProps<typeof FieldError>) {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? \"\") : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <FieldError data-slot=\"form-message\" id={formMessageId} {...props}>\n {body}\n </FieldError>\n );\n}\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n};\n"],"mappings":";;;;;;;;AAqBA,MAAM,OAAO;AAUb,MAAM,mBAAmB,MAAM,cAAqC,CAAC,CAA0B;;AAG/F,MAAM,aAGJ,EACA,GAAG,YACuC;CAC1C,OACE,oBAAC,iBAAiB,UAAlB;EAA2B,OAAO,EAAE,MAAM,MAAM,KAAK;YACnD,oBAAC,YAAD,EAAY,GAAI,MAAQ,CAAA;CACC,CAAA;AAE/B;;AAGA,MAAM,qBAAqB;CACzB,MAAM,eAAe,MAAM,WAAW,gBAAgB;CACtD,MAAM,cAAc,MAAM,WAAW,eAAe;CACpD,MAAM,EAAE,kBAAkB,eAAe;CACzC,MAAM,YAAY,aAAa,EAAE,MAAM,aAAa,KAAK,CAAC;CAC1D,MAAM,aAAa,cAAc,aAAa,MAAM,SAAS;CAE7D,IAAI,CAAC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C,MACH,OAAO;CAGT,OACE,oBAAC,YAAD;EAAY,aAAU;EAAe,IAAI;EAAe,GAAI;YACzD;CACS,CAAA;AAEhB"}
|
|
@@ -24,8 +24,8 @@ const headingVariants = (0, require("class-variance-authority").cva)("font-headi
|
|
|
24
24
|
right: "text-right"
|
|
25
25
|
},
|
|
26
26
|
gradient: {
|
|
27
|
-
true: "bg-gradient-to-r from-[var(--
|
|
28
|
-
false: "text-
|
|
27
|
+
true: "bg-gradient-to-r from-[var(--theme-brand-700)] to-[var(--theme-brand-500-primary)] bg-clip-text text-transparent",
|
|
28
|
+
false: "text-primary-txt"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
defaultVariants: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["cn"],"sources":["../../../src/primitives/Heading/Heading.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n// Heading — display/section titles using the design-system HEADING scale\n// (Outfit): the Figma \"heading 1–7\" steps (tokens in styles/tokens/typography.css).\n// `size` drives the visual step (font-size + line-height + the spec's per-step\n// weight: 1–4 Regular, 5–7 Medium); `as` controls the semantic level\n// independently; `gradient` enables the brand gradient text fill.\nconst headingVariants = cva(\"font-heading text-balance\", {\n variants: {\n size: {\n \"1\": \"text-[length:var(--heading-1-font-size)] leading-[var(--heading-1-line-height)] font-normal\",\n \"2\": \"text-[length:var(--heading-2-font-size)] leading-[var(--heading-2-line-height)] font-normal\",\n \"3\": \"text-[length:var(--heading-3-font-size)] leading-[var(--heading-3-line-height)] font-normal\",\n \"4\": \"text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal\",\n \"5\": \"text-[length:var(--heading-5-font-size)] leading-[var(--heading-5-line-height)] font-medium\",\n \"6\": \"text-[length:var(--heading-6-font-size)] leading-[var(--heading-6-line-height)] font-medium\",\n \"7\": \"text-[length:var(--heading-7-font-size)] leading-[var(--heading-7-line-height)] font-medium\",\n },\n // Optional override of the per-step default weight.\n weight: {\n normal: \"font-normal\",\n medium: \"font-medium\",\n semibold: \"font-semibold\",\n },\n align: {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n },\n gradient: {\n true: \"bg-gradient-to-r from-[var(--
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["cn"],"sources":["../../../src/primitives/Heading/Heading.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n// Heading — display/section titles using the design-system HEADING scale\n// (Outfit): the Figma \"heading 1–7\" steps (tokens in styles/tokens/typography.css).\n// `size` drives the visual step (font-size + line-height + the spec's per-step\n// weight: 1–4 Regular, 5–7 Medium); `as` controls the semantic level\n// independently; `gradient` enables the brand gradient text fill.\nconst headingVariants = cva(\"font-heading text-balance\", {\n variants: {\n size: {\n \"1\": \"text-[length:var(--heading-1-font-size)] leading-[var(--heading-1-line-height)] font-normal\",\n \"2\": \"text-[length:var(--heading-2-font-size)] leading-[var(--heading-2-line-height)] font-normal\",\n \"3\": \"text-[length:var(--heading-3-font-size)] leading-[var(--heading-3-line-height)] font-normal\",\n \"4\": \"text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal\",\n \"5\": \"text-[length:var(--heading-5-font-size)] leading-[var(--heading-5-line-height)] font-medium\",\n \"6\": \"text-[length:var(--heading-6-font-size)] leading-[var(--heading-6-line-height)] font-medium\",\n \"7\": \"text-[length:var(--heading-7-font-size)] leading-[var(--heading-7-line-height)] font-medium\",\n },\n // Optional override of the per-step default weight.\n weight: {\n normal: \"font-normal\",\n medium: \"font-medium\",\n semibold: \"font-semibold\",\n },\n align: {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n },\n gradient: {\n true: \"bg-gradient-to-r from-[var(--theme-brand-700)] to-[var(--theme-brand-500-primary)] bg-clip-text text-transparent\",\n false: \"text-primary-txt\",\n },\n },\n defaultVariants: {\n size: \"2\",\n gradient: false,\n },\n});\n\ntype HeadingProps = React.ComponentProps<\"h2\"> &\n VariantProps<typeof headingVariants> & {\n /** Semantic heading level/element. Defaults to `h2`. */\n as?: React.ElementType;\n /** Visual step on the Figma heading scale (1 largest → 7 smallest); also sets the per-step default weight. */\n size?: VariantProps<typeof headingVariants>[\"size\"];\n /** Override the per-step default weight. */\n weight?: VariantProps<typeof headingVariants>[\"weight\"];\n /** Text alignment. */\n align?: VariantProps<typeof headingVariants>[\"align\"];\n /** When true, fills the text with the brand gradient instead of the foreground colour. */\n gradient?: VariantProps<typeof headingVariants>[\"gradient\"];\n };\n\n/** Display/section title using the design-system heading scale; `size` sets the visual step, `as` the semantic element. */\nfunction Heading({ as, className, size, weight, align, gradient, ...props }: HeadingProps) {\n const Comp = as ?? \"h2\";\n return (\n <Comp\n data-slot=\"heading\"\n className={cn(headingVariants({ size, weight, align, gradient }), className)}\n {...props}\n />\n );\n}\n\nexport { Heading, headingVariants, type HeadingProps };\n"],"mappings":";;;;AAUA,MAAM,mBAAA,qCAAA,EAAA,KAAsB,6BAA6B;CACvD,UAAU;EACR,MAAM;GACJ,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;EACP;EAEA,QAAQ;GACN,QAAQ;GACR,QAAQ;GACR,UAAU;EACZ;EACA,OAAO;GACL,MAAM;GACN,QAAQ;GACR,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,OAAO;EACT;CACF;CACA,iBAAiB;EACf,MAAM;EACN,UAAU;CACZ;AACF,CAAC;;AAiBD,SAAS,QAAQ,EAAE,IAAI,WAAW,MAAM,QAAQ,OAAO,UAAU,GAAG,SAAuB;CAEzF,OACE,iBAAA,GAAA,kBAAA,KAFW,MAAM,MAEjB;EACE,aAAU;EACV,WAAWA,WAAAA,GAAG,gBAAgB;GAAE;GAAM;GAAQ;GAAO;EAAS,CAAC,GAAG,SAAS;EAC3E,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -24,8 +24,8 @@ const headingVariants = cva("font-heading text-balance", {
|
|
|
24
24
|
right: "text-right"
|
|
25
25
|
},
|
|
26
26
|
gradient: {
|
|
27
|
-
true: "bg-gradient-to-r from-[var(--
|
|
28
|
-
false: "text-
|
|
27
|
+
true: "bg-gradient-to-r from-[var(--theme-brand-700)] to-[var(--theme-brand-500-primary)] bg-clip-text text-transparent",
|
|
28
|
+
false: "text-primary-txt"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
defaultVariants: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Heading/Heading.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n// Heading — display/section titles using the design-system HEADING scale\n// (Outfit): the Figma \"heading 1–7\" steps (tokens in styles/tokens/typography.css).\n// `size` drives the visual step (font-size + line-height + the spec's per-step\n// weight: 1–4 Regular, 5–7 Medium); `as` controls the semantic level\n// independently; `gradient` enables the brand gradient text fill.\nconst headingVariants = cva(\"font-heading text-balance\", {\n variants: {\n size: {\n \"1\": \"text-[length:var(--heading-1-font-size)] leading-[var(--heading-1-line-height)] font-normal\",\n \"2\": \"text-[length:var(--heading-2-font-size)] leading-[var(--heading-2-line-height)] font-normal\",\n \"3\": \"text-[length:var(--heading-3-font-size)] leading-[var(--heading-3-line-height)] font-normal\",\n \"4\": \"text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal\",\n \"5\": \"text-[length:var(--heading-5-font-size)] leading-[var(--heading-5-line-height)] font-medium\",\n \"6\": \"text-[length:var(--heading-6-font-size)] leading-[var(--heading-6-line-height)] font-medium\",\n \"7\": \"text-[length:var(--heading-7-font-size)] leading-[var(--heading-7-line-height)] font-medium\",\n },\n // Optional override of the per-step default weight.\n weight: {\n normal: \"font-normal\",\n medium: \"font-medium\",\n semibold: \"font-semibold\",\n },\n align: {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n },\n gradient: {\n true: \"bg-gradient-to-r from-[var(--
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Heading/Heading.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n// Heading — display/section titles using the design-system HEADING scale\n// (Outfit): the Figma \"heading 1–7\" steps (tokens in styles/tokens/typography.css).\n// `size` drives the visual step (font-size + line-height + the spec's per-step\n// weight: 1–4 Regular, 5–7 Medium); `as` controls the semantic level\n// independently; `gradient` enables the brand gradient text fill.\nconst headingVariants = cva(\"font-heading text-balance\", {\n variants: {\n size: {\n \"1\": \"text-[length:var(--heading-1-font-size)] leading-[var(--heading-1-line-height)] font-normal\",\n \"2\": \"text-[length:var(--heading-2-font-size)] leading-[var(--heading-2-line-height)] font-normal\",\n \"3\": \"text-[length:var(--heading-3-font-size)] leading-[var(--heading-3-line-height)] font-normal\",\n \"4\": \"text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal\",\n \"5\": \"text-[length:var(--heading-5-font-size)] leading-[var(--heading-5-line-height)] font-medium\",\n \"6\": \"text-[length:var(--heading-6-font-size)] leading-[var(--heading-6-line-height)] font-medium\",\n \"7\": \"text-[length:var(--heading-7-font-size)] leading-[var(--heading-7-line-height)] font-medium\",\n },\n // Optional override of the per-step default weight.\n weight: {\n normal: \"font-normal\",\n medium: \"font-medium\",\n semibold: \"font-semibold\",\n },\n align: {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n },\n gradient: {\n true: \"bg-gradient-to-r from-[var(--theme-brand-700)] to-[var(--theme-brand-500-primary)] bg-clip-text text-transparent\",\n false: \"text-primary-txt\",\n },\n },\n defaultVariants: {\n size: \"2\",\n gradient: false,\n },\n});\n\ntype HeadingProps = React.ComponentProps<\"h2\"> &\n VariantProps<typeof headingVariants> & {\n /** Semantic heading level/element. Defaults to `h2`. */\n as?: React.ElementType;\n /** Visual step on the Figma heading scale (1 largest → 7 smallest); also sets the per-step default weight. */\n size?: VariantProps<typeof headingVariants>[\"size\"];\n /** Override the per-step default weight. */\n weight?: VariantProps<typeof headingVariants>[\"weight\"];\n /** Text alignment. */\n align?: VariantProps<typeof headingVariants>[\"align\"];\n /** When true, fills the text with the brand gradient instead of the foreground colour. */\n gradient?: VariantProps<typeof headingVariants>[\"gradient\"];\n };\n\n/** Display/section title using the design-system heading scale; `size` sets the visual step, `as` the semantic element. */\nfunction Heading({ as, className, size, weight, align, gradient, ...props }: HeadingProps) {\n const Comp = as ?? \"h2\";\n return (\n <Comp\n data-slot=\"heading\"\n className={cn(headingVariants({ size, weight, align, gradient }), className)}\n {...props}\n />\n );\n}\n\nexport { Heading, headingVariants, type HeadingProps };\n"],"mappings":";;;;AAUA,MAAM,kBAAkB,IAAI,6BAA6B;CACvD,UAAU;EACR,MAAM;GACJ,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;EACP;EAEA,QAAQ;GACN,QAAQ;GACR,QAAQ;GACR,UAAU;EACZ;EACA,OAAO;GACL,MAAM;GACN,QAAQ;GACR,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,OAAO;EACT;CACF;CACA,iBAAiB;EACf,MAAM;EACN,UAAU;CACZ;AACF,CAAC;;AAiBD,SAAS,QAAQ,EAAE,IAAI,WAAW,MAAM,QAAQ,OAAO,UAAU,GAAG,SAAuB;CAEzF,OACE,oBAFW,MAAM,MAEjB;EACE,aAAU;EACV,WAAW,GAAG,gBAAgB;GAAE;GAAM;GAAQ;GAAO;EAAS,CAAC,GAAG,SAAS;EAC3E,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -25,7 +25,7 @@ function HoverCardContent({ className, align = "center", sideOffset = 4, ...prop
|
|
|
25
25
|
"data-slot": "hover-card-content",
|
|
26
26
|
align,
|
|
27
27
|
sideOffset,
|
|
28
|
-
className: require_cn.cn("z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-
|
|
28
|
+
className: require_cn.cn("z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-8 border bg-glass-none-bg p-2 text-primary-txt shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-8 data-[side=left]:slide-in-from-right-8 data-[side=right]:slide-in-from-left-8 data-[side=top]:slide-in-from-bottom-8 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", className),
|
|
29
29
|
...props
|
|
30
30
|
})
|
|
31
31
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["HoverCardPrimitive","cn"],"sources":["../../../src/primitives/HoverCard/HoverCard.tsx"],"sourcesContent":["import { HoverCard as HoverCardPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n/** Root that reveals a floating card when the user hovers (or focuses) the trigger. */\nfunction HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>) {\n return <HoverCardPrimitive.Root data-slot=\"hover-card\" {...props} />;\n}\n\n/** The element that opens the hover card on pointer hover or keyboard focus. */\nfunction HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {\n return <HoverCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />;\n}\n\n/** The floating, portalled surface shown while the trigger is hovered/focused. */\nfunction HoverCardContent({\n className,\n /** Alignment of the content relative to the trigger along the chosen side. */\n align = \"center\",\n /** Gap in pixels between the trigger and the content. */\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {\n return (\n <HoverCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <HoverCardPrimitive.Content\n data-slot=\"hover-card-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["HoverCardPrimitive","cn"],"sources":["../../../src/primitives/HoverCard/HoverCard.tsx"],"sourcesContent":["import { HoverCard as HoverCardPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n/** Root that reveals a floating card when the user hovers (or focuses) the trigger. */\nfunction HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>) {\n return <HoverCardPrimitive.Root data-slot=\"hover-card\" {...props} />;\n}\n\n/** The element that opens the hover card on pointer hover or keyboard focus. */\nfunction HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {\n return <HoverCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />;\n}\n\n/** The floating, portalled surface shown while the trigger is hovered/focused. */\nfunction HoverCardContent({\n className,\n /** Alignment of the content relative to the trigger along the chosen side. */\n align = \"center\",\n /** Gap in pixels between the trigger and the content. */\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {\n return (\n <HoverCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <HoverCardPrimitive.Content\n data-slot=\"hover-card-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-8 border bg-glass-none-bg p-2 text-primary-txt shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-8 data-[side=left]:slide-in-from-right-8 data-[side=right]:slide-in-from-left-8 data-[side=top]:slide-in-from-bottom-8 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n );\n}\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent };\n"],"mappings":";;;;;;AAMA,SAAS,UAAU,EAAE,GAAG,SAA+D;CACrF,OAAO,iBAAA,GAAA,kBAAA,KAACA,SAAAA,UAAmB,MAApB;EAAyB,aAAU;EAAa,GAAI;CAAQ,CAAA;AACrE;;AAGA,SAAS,iBAAiB,EAAE,GAAG,SAAkE;CAC/F,OAAO,iBAAA,GAAA,kBAAA,KAACA,SAAAA,UAAmB,SAApB;EAA4B,aAAU;EAAqB,GAAI;CAAQ,CAAA;AAChF;;AAGA,SAAS,iBAAiB,EACxB,WAEA,QAAQ,UAER,aAAa,GACb,GAAG,SACuD;CAC1D,OACE,iBAAA,GAAA,kBAAA,KAACA,SAAAA,UAAmB,QAApB;EAA2B,aAAU;YACnC,iBAAA,GAAA,kBAAA,KAACA,SAAAA,UAAmB,SAApB;GACE,aAAU;GACH;GACK;GACZ,WAAWC,WAAAA,GACT,meACA,SACF;GACA,GAAI;EACL,CAAA;CACwB,CAAA;AAE/B"}
|
|
@@ -24,7 +24,7 @@ function HoverCardContent({ className, align = "center", sideOffset = 4, ...prop
|
|
|
24
24
|
"data-slot": "hover-card-content",
|
|
25
25
|
align,
|
|
26
26
|
sideOffset,
|
|
27
|
-
className: cn("z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-
|
|
27
|
+
className: cn("z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-8 border bg-glass-none-bg p-2 text-primary-txt shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-8 data-[side=left]:slide-in-from-right-8 data-[side=right]:slide-in-from-left-8 data-[side=top]:slide-in-from-bottom-8 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", className),
|
|
28
28
|
...props
|
|
29
29
|
})
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["HoverCardPrimitive"],"sources":["../../../src/primitives/HoverCard/HoverCard.tsx"],"sourcesContent":["import { HoverCard as HoverCardPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n/** Root that reveals a floating card when the user hovers (or focuses) the trigger. */\nfunction HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>) {\n return <HoverCardPrimitive.Root data-slot=\"hover-card\" {...props} />;\n}\n\n/** The element that opens the hover card on pointer hover or keyboard focus. */\nfunction HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {\n return <HoverCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />;\n}\n\n/** The floating, portalled surface shown while the trigger is hovered/focused. */\nfunction HoverCardContent({\n className,\n /** Alignment of the content relative to the trigger along the chosen side. */\n align = \"center\",\n /** Gap in pixels between the trigger and the content. */\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {\n return (\n <HoverCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <HoverCardPrimitive.Content\n data-slot=\"hover-card-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-
|
|
1
|
+
{"version":3,"file":"index.js","names":["HoverCardPrimitive"],"sources":["../../../src/primitives/HoverCard/HoverCard.tsx"],"sourcesContent":["import { HoverCard as HoverCardPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n/** Root that reveals a floating card when the user hovers (or focuses) the trigger. */\nfunction HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>) {\n return <HoverCardPrimitive.Root data-slot=\"hover-card\" {...props} />;\n}\n\n/** The element that opens the hover card on pointer hover or keyboard focus. */\nfunction HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {\n return <HoverCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />;\n}\n\n/** The floating, portalled surface shown while the trigger is hovered/focused. */\nfunction HoverCardContent({\n className,\n /** Alignment of the content relative to the trigger along the chosen side. */\n align = \"center\",\n /** Gap in pixels between the trigger and the content. */\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {\n return (\n <HoverCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <HoverCardPrimitive.Content\n data-slot=\"hover-card-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-8 border bg-glass-none-bg p-2 text-primary-txt shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-8 data-[side=left]:slide-in-from-right-8 data-[side=right]:slide-in-from-left-8 data-[side=top]:slide-in-from-bottom-8 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n );\n}\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent };\n"],"mappings":";;;;;AAMA,SAAS,UAAU,EAAE,GAAG,SAA+D;CACrF,OAAO,oBAACA,YAAmB,MAApB;EAAyB,aAAU;EAAa,GAAI;CAAQ,CAAA;AACrE;;AAGA,SAAS,iBAAiB,EAAE,GAAG,SAAkE;CAC/F,OAAO,oBAACA,YAAmB,SAApB;EAA4B,aAAU;EAAqB,GAAI;CAAQ,CAAA;AAChF;;AAGA,SAAS,iBAAiB,EACxB,WAEA,QAAQ,UAER,aAAa,GACb,GAAG,SACuD;CAC1D,OACE,oBAACA,YAAmB,QAApB;EAA2B,aAAU;YACnC,oBAACA,YAAmB,SAApB;GACE,aAAU;GACH;GACK;GACZ,WAAW,GACT,meACA,SACF;GACA,GAAI;EACL,CAAA;CACwB,CAAA;AAE/B"}
|
|
@@ -4,13 +4,13 @@ let react = require("react");
|
|
|
4
4
|
let lucide_react = require("lucide-react");
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
//#region src/primitives/InfoBanner/InfoBanner.tsx
|
|
7
|
-
const infoBannerVariants = (0, require("class-variance-authority").cva)("flex w-full gap-
|
|
7
|
+
const infoBannerVariants = (0, require("class-variance-authority").cva)("flex w-full gap-4 rounded-12 px-4 py-3", {
|
|
8
8
|
variants: { variant: {
|
|
9
|
-
info: "bg-
|
|
10
|
-
success: "bg-
|
|
11
|
-
warning: "bg-
|
|
12
|
-
error: "bg-
|
|
13
|
-
neutral: "bg-muted text-
|
|
9
|
+
info: "bg-info-bg text-info-txt",
|
|
10
|
+
success: "bg-success-bg text-success-txt",
|
|
11
|
+
warning: "bg-warning-bg text-warning-txt",
|
|
12
|
+
error: "bg-danger-bg text-danger-txt",
|
|
13
|
+
neutral: "bg-muted-bg text-primary-txt"
|
|
14
14
|
} },
|
|
15
15
|
defaultVariants: { variant: "info" }
|
|
16
16
|
});
|
|
@@ -35,25 +35,25 @@ function InfoBanner({ title, description, variant, icon, dismissible = true, vis
|
|
|
35
35
|
"data-slot": "info-banner",
|
|
36
36
|
"data-variant": variant ?? "info",
|
|
37
37
|
role: "status",
|
|
38
|
-
className: require_cn.cn(infoBannerVariants({ variant }),
|
|
38
|
+
className: require_cn.cn(infoBannerVariants({ variant }), "items-start", className),
|
|
39
39
|
...props,
|
|
40
40
|
children: [
|
|
41
41
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
42
42
|
"data-slot": "info-banner-icon",
|
|
43
|
-
className: "shrink-0",
|
|
43
|
+
className: "shrink-0 pt-0.5",
|
|
44
44
|
"aria-hidden": "true",
|
|
45
45
|
children: icon ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VariantIcon, { className: "size-5" })
|
|
46
46
|
}),
|
|
47
47
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48
48
|
"data-slot": "info-banner-content",
|
|
49
|
-
className: "flex min-w-0 flex-1 flex-col gap-
|
|
49
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
50
50
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
51
51
|
"data-slot": "info-banner-title",
|
|
52
|
-
className: "font-
|
|
52
|
+
className: "font-heading text-[length:var(--heading-5-font-size)] leading-[var(--heading-5-line-height)] font-medium",
|
|
53
53
|
children: title
|
|
54
54
|
}), description != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
55
55
|
"data-slot": "info-banner-description",
|
|
56
|
-
className: "text-sm
|
|
56
|
+
className: "text-sm leading-5 font-medium text-secondary-txt",
|
|
57
57
|
children: description
|
|
58
58
|
})]
|
|
59
59
|
}),
|
|
@@ -62,7 +62,7 @@ function InfoBanner({ title, description, variant, icon, dismissible = true, vis
|
|
|
62
62
|
type: "button",
|
|
63
63
|
"aria-label": "Dismiss",
|
|
64
64
|
onClick: handleDismiss,
|
|
65
|
-
className: "-mr-
|
|
65
|
+
className: "-mr-2 flex size-8 shrink-0 items-center justify-center rounded-8 text-primary-txt transition-colors hover:bg-primary-txt/5",
|
|
66
66
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, {
|
|
67
67
|
"data-slot": "info-banner-dismiss-icon",
|
|
68
68
|
className: "size-4",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["Info","CircleCheck","TriangleAlert","CircleAlert","cn","X"],"sources":["../../../src/primitives/InfoBanner/InfoBanner.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport { CircleAlert, CircleCheck, Info, TriangleAlert, X } from \"lucide-react\";\nimport type * as React from \"react\";\nimport { useState } from \"react\";\n\nimport { cn } from \"@/utils\";\n\n// InfoBanner — a dismissible inline status banner
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["Info","CircleCheck","TriangleAlert","CircleAlert","cn","X"],"sources":["../../../src/primitives/InfoBanner/InfoBanner.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport { CircleAlert, CircleCheck, Info, TriangleAlert, X } from \"lucide-react\";\nimport type * as React from \"react\";\nimport { useState } from \"react\";\n\nimport { cn } from \"@/utils\";\n\n// InfoBanner — a dismissible inline status banner (Figma \"Toast Messages\" on\n// the Alert page, node 3962:11659): status-bg surface, rounded-12, px-4 py-3,\n// heading-5 title in the status text color, 14/20 medium secondary description.\n// Distinct from Alert (which is not dismissible).\nconst infoBannerVariants = cva(\"flex w-full gap-4 rounded-12 px-4 py-3\", {\n variants: {\n variant: {\n info: \"bg-info-bg text-info-txt\",\n success: \"bg-success-bg text-success-txt\",\n warning: \"bg-warning-bg text-warning-txt\",\n error: \"bg-danger-bg text-danger-txt\",\n neutral: \"bg-muted-bg text-primary-txt\",\n },\n },\n defaultVariants: {\n variant: \"info\",\n },\n});\n\nconst variantIcons = {\n info: Info,\n success: CircleCheck,\n warning: TriangleAlert,\n error: CircleAlert,\n neutral: Info,\n} as const;\n\nexport type InfoBannerProps = Omit<React.ComponentProps<\"div\">, \"title\"> &\n VariantProps<typeof infoBannerVariants> & {\n /** Intent that drives the banner colors and default icon. Default `info`. */\n variant?: VariantProps<typeof infoBannerVariants>[\"variant\"];\n /** Banner heading. */\n title: string;\n /** Optional supporting copy below the title. */\n description?: React.ReactNode;\n /** Override the default per-variant leading icon. */\n icon?: React.ReactNode;\n /** Show the trailing dismiss button. Default true. */\n dismissible?: boolean;\n /** Controlled visibility. When provided, overrides internal state. */\n visible?: boolean;\n /** Called when the dismiss button is pressed. */\n onDismiss?: () => void;\n };\n\n/** Dismissible inline status banner colored by intent (info/success/warning/error/neutral). */\nfunction InfoBanner({\n title,\n description,\n variant,\n icon,\n dismissible = true,\n visible,\n onDismiss,\n className,\n ...props\n}: InfoBannerProps) {\n const [internalVisible, setInternalVisible] = useState(true);\n const isControlled = visible !== undefined;\n const isVisible = isControlled ? visible : internalVisible;\n\n if (!isVisible) return null;\n\n const handleDismiss = () => {\n if (!isControlled) setInternalVisible(false);\n onDismiss?.();\n };\n\n const VariantIcon = variantIcons[variant ?? \"info\"];\n\n return (\n <div\n data-slot=\"info-banner\"\n data-variant={variant ?? \"info\"}\n role=\"status\"\n className={cn(\n infoBannerVariants({ variant }),\n // Top-aligned like Alert; the icon aligner below sits it on the first line.\n \"items-start\",\n className,\n )}\n {...props}\n >\n {/* Icon inherits the variant's text color via currentColor. */}\n <span data-slot=\"info-banner-icon\" className=\"shrink-0 pt-0.5\" aria-hidden=\"true\">\n {icon ?? <VariantIcon className=\"size-5\" />}\n </span>\n\n <div data-slot=\"info-banner-content\" className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <span\n data-slot=\"info-banner-title\"\n className=\"font-heading text-[length:var(--heading-5-font-size)] leading-[var(--heading-5-line-height)] font-medium\"\n >\n {title}\n </span>\n {description != null && (\n <span\n data-slot=\"info-banner-description\"\n className=\"text-sm leading-5 font-medium text-secondary-txt\"\n >\n {description}\n </span>\n )}\n </div>\n\n {dismissible && (\n <button\n data-slot=\"info-banner-dismiss\"\n type=\"button\"\n aria-label=\"Dismiss\"\n onClick={handleDismiss}\n className=\"-mr-2 flex size-8 shrink-0 items-center justify-center rounded-8 text-primary-txt transition-colors hover:bg-primary-txt/5\"\n >\n <X data-slot=\"info-banner-dismiss-icon\" className=\"size-4\" aria-hidden=\"true\" />\n </button>\n )}\n </div>\n );\n}\n\nexport { InfoBanner, infoBannerVariants };\n"],"mappings":";;;;;;AAWA,MAAM,sBAAA,qCAAA,EAAA,KAAyB,0CAA0C;CACvE,UAAU,EACR,SAAS;EACP,MAAM;EACN,SAAS;EACT,SAAS;EACT,OAAO;EACP,SAAS;CACX,EACF;CACA,iBAAiB,EACf,SAAS,OACX;AACF,CAAC;AAED,MAAM,eAAe;CACnB,MAAMA,aAAAA;CACN,SAASC,aAAAA;CACT,SAASC,aAAAA;CACT,OAAOC,aAAAA;CACP,SAASH,aAAAA;AACX;;AAqBA,SAAS,WAAW,EAClB,OACA,aACA,SACA,MACA,cAAc,MACd,SACA,WACA,WACA,GAAG,SACe;CAClB,MAAM,CAAC,iBAAiB,uBAAA,GAAA,MAAA,UA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