@psnext/design-system 1.5.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DESIGN.md +639 -0
- package/README.md +39 -2
- package/SKILL.md +101 -0
- package/bin/install-agent-skill.mjs +54 -0
- package/dist/Header.cjs +25 -25
- package/dist/Header.cjs.map +1 -1
- package/dist/Header.js +25 -25
- package/dist/Header.js.map +1 -1
- package/dist/Icon.cjs +19 -19
- package/dist/Icon.cjs.map +1 -1
- package/dist/Icon.js +19 -19
- package/dist/Icon.js.map +1 -1
- package/dist/Logo.cjs +4 -14
- package/dist/Logo.cjs.map +1 -1
- package/dist/Logo.js +4 -14
- package/dist/Logo.js.map +1 -1
- package/dist/Sidebar.cjs +26 -20
- package/dist/Sidebar.cjs.map +1 -1
- package/dist/Sidebar.js +21 -21
- package/dist/Sidebar.js.map +1 -1
- package/dist/cn.cjs +14 -1
- package/dist/cn.cjs.map +1 -1
- package/dist/cn.js +14 -1
- package/dist/cn.js.map +1 -1
- package/dist/index.cjs +13 -10
- package/dist/index.d.cts +5 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index10.d.cts +7 -7
- package/dist/index10.d.cts.map +1 -1
- package/dist/index10.d.ts +7 -7
- package/dist/index11.d.cts +3 -3
- package/dist/index11.d.cts.map +1 -1
- package/dist/index11.d.ts +3 -3
- package/dist/index11.d.ts.map +1 -1
- package/dist/index12.d.cts +18 -17
- package/dist/index12.d.cts.map +1 -1
- package/dist/index12.d.ts +18 -17
- package/dist/index12.d.ts.map +1 -1
- package/dist/index13.d.cts +6 -6
- package/dist/index13.d.cts.map +1 -1
- package/dist/index13.d.ts +6 -6
- package/dist/index14.d.cts +5 -5
- package/dist/index14.d.cts.map +1 -1
- package/dist/index14.d.ts +5 -5
- package/dist/index14.d.ts.map +1 -1
- package/dist/index15.d.cts +3 -3
- package/dist/index15.d.cts.map +1 -1
- package/dist/index15.d.ts +3 -3
- package/dist/index15.d.ts.map +1 -1
- package/dist/index16.d.cts +2 -2
- package/dist/index16.d.cts.map +1 -1
- package/dist/index16.d.ts +2 -2
- package/dist/index17.d.cts +4 -4
- package/dist/index17.d.cts.map +1 -1
- package/dist/index17.d.ts +4 -4
- package/dist/index17.d.ts.map +1 -1
- package/dist/index18.d.cts +11 -11
- package/dist/index18.d.cts.map +1 -1
- package/dist/index18.d.ts +11 -11
- package/dist/index19.d.cts +10 -10
- package/dist/index19.d.cts.map +1 -1
- package/dist/index19.d.ts +10 -10
- package/dist/index19.d.ts.map +1 -1
- package/dist/index2.d.cts +8 -8
- package/dist/index2.d.cts.map +1 -1
- package/dist/index2.d.ts +8 -8
- package/dist/index2.d.ts.map +1 -1
- package/dist/index20.d.cts +16 -16
- package/dist/index20.d.cts.map +1 -1
- package/dist/index20.d.ts +16 -16
- package/dist/index20.d.ts.map +1 -1
- package/dist/index21.d.cts +4 -4
- package/dist/index21.d.cts.map +1 -1
- package/dist/index21.d.ts +4 -4
- package/dist/index22.d.cts +11 -11
- package/dist/index22.d.cts.map +1 -1
- package/dist/index22.d.ts +11 -11
- package/dist/index22.d.ts.map +1 -1
- package/dist/index23.d.cts +16 -16
- package/dist/index23.d.cts.map +1 -1
- package/dist/index23.d.ts +16 -16
- package/dist/index23.d.ts.map +1 -1
- package/dist/index24.d.cts +10 -10
- package/dist/index24.d.cts.map +1 -1
- package/dist/index24.d.ts +10 -10
- package/dist/index25.d.cts +2 -2
- package/dist/index25.d.ts +2 -2
- package/dist/index25.d.ts.map +1 -1
- package/dist/index26.d.cts +14 -14
- package/dist/index26.d.cts.map +1 -1
- package/dist/index26.d.ts +14 -14
- package/dist/index26.d.ts.map +1 -1
- package/dist/index27.d.cts +7 -7
- package/dist/index27.d.ts +7 -7
- package/dist/index27.d.ts.map +1 -1
- package/dist/index28.d.cts +6 -6
- package/dist/index28.d.ts +5 -5
- package/dist/index28.d.ts.map +1 -1
- package/dist/index29.d.cts +4 -4
- package/dist/index29.d.ts +4 -4
- package/dist/index29.d.ts.map +1 -1
- package/dist/index3.d.cts +13 -13
- package/dist/index3.d.cts.map +1 -1
- package/dist/index3.d.ts +13 -13
- package/dist/index3.d.ts.map +1 -1
- package/dist/index30.d.cts +6 -6
- package/dist/index30.d.ts +4 -4
- package/dist/index31.d.cts +4 -4
- package/dist/index31.d.cts.map +1 -1
- package/dist/index31.d.ts +4 -4
- package/dist/index31.d.ts.map +1 -1
- package/dist/index32.d.cts +8 -5
- package/dist/index32.d.cts.map +1 -1
- package/dist/index32.d.ts +9 -6
- package/dist/index32.d.ts.map +1 -1
- package/dist/index33.d.cts +14 -10
- package/dist/index33.d.cts.map +1 -1
- package/dist/index33.d.ts +15 -11
- package/dist/index33.d.ts.map +1 -1
- package/dist/index34.d.cts +5 -5
- package/dist/index34.d.ts +5 -5
- package/dist/index34.d.ts.map +1 -1
- package/dist/index35.d.cts +14 -14
- package/dist/index35.d.ts +14 -14
- package/dist/index35.d.ts.map +1 -1
- package/dist/index36.d.cts +3 -3
- package/dist/index36.d.cts.map +1 -1
- package/dist/index36.d.ts +3 -3
- package/dist/index36.d.ts.map +1 -1
- package/dist/index37.d.cts +5 -5
- package/dist/index37.d.ts +4 -4
- package/dist/index37.d.ts.map +1 -1
- package/dist/index38.d.cts +2 -2
- package/dist/index38.d.ts +2 -2
- package/dist/index39.d.cts +17 -17
- package/dist/index39.d.cts.map +1 -1
- package/dist/index39.d.ts +17 -17
- package/dist/index39.d.ts.map +1 -1
- package/dist/index4.d.cts +2 -2
- package/dist/index4.d.cts.map +1 -1
- package/dist/index4.d.ts +2 -2
- package/dist/index4.d.ts.map +1 -1
- package/dist/index40.d.cts +4 -4
- package/dist/index40.d.cts.map +1 -1
- package/dist/index40.d.ts +5 -5
- package/dist/index40.d.ts.map +1 -1
- package/dist/index41.d.cts +11 -11
- package/dist/index41.d.cts.map +1 -1
- package/dist/index41.d.ts +11 -11
- package/dist/index41.d.ts.map +1 -1
- package/dist/index42.d.cts +8 -8
- package/dist/index42.d.cts.map +1 -1
- package/dist/index42.d.ts +8 -8
- package/dist/index42.d.ts.map +1 -1
- package/dist/index43.d.cts +10 -10
- package/dist/index43.d.cts.map +1 -1
- package/dist/index43.d.ts +10 -10
- package/dist/index43.d.ts.map +1 -1
- package/dist/index44.d.cts +1 -48
- package/dist/index44.d.ts +1 -48
- package/dist/index45.d.cts +42 -22
- package/dist/index45.d.cts.map +1 -1
- package/dist/index45.d.ts +42 -22
- package/dist/index45.d.ts.map +1 -1
- package/dist/index46.d.cts +21 -34
- package/dist/index46.d.cts.map +1 -1
- package/dist/index46.d.ts +21 -34
- package/dist/index46.d.ts.map +1 -1
- package/dist/index47.d.cts +33 -17
- package/dist/index47.d.cts.map +1 -1
- package/dist/index47.d.ts +33 -17
- package/dist/index47.d.ts.map +1 -1
- package/dist/index48.d.cts +18 -14
- package/dist/index48.d.cts.map +1 -1
- package/dist/index48.d.ts +18 -14
- package/dist/index48.d.ts.map +1 -1
- package/dist/index49.d.cts +12 -60
- package/dist/index49.d.cts.map +1 -1
- package/dist/index49.d.ts +12 -60
- package/dist/index49.d.ts.map +1 -1
- package/dist/index5.d.cts +7 -7
- package/dist/index5.d.cts.map +1 -1
- package/dist/index5.d.ts +7 -7
- package/dist/index5.d.ts.map +1 -1
- package/dist/index50.d.cts +55 -49
- package/dist/index50.d.cts.map +1 -1
- package/dist/index50.d.ts +55 -49
- package/dist/index50.d.ts.map +1 -1
- package/dist/index51.d.cts +56 -24
- package/dist/index51.d.cts.map +1 -1
- package/dist/index51.d.ts +56 -24
- package/dist/index51.d.ts.map +1 -1
- package/dist/index52.d.cts +25 -203
- package/dist/index52.d.cts.map +1 -1
- package/dist/index52.d.ts +25 -203
- package/dist/index52.d.ts.map +1 -1
- package/dist/index53.d.cts +198 -15
- package/dist/index53.d.cts.map +1 -1
- package/dist/index53.d.ts +198 -15
- package/dist/index53.d.ts.map +1 -1
- package/dist/index54.d.cts +21 -23
- package/dist/index54.d.cts.map +1 -1
- package/dist/index54.d.ts +21 -23
- package/dist/index54.d.ts.map +1 -1
- package/dist/index55.d.cts +21 -18
- package/dist/index55.d.cts.map +1 -1
- package/dist/index55.d.ts +21 -18
- package/dist/index55.d.ts.map +1 -1
- package/dist/index56.d.cts +21 -8
- package/dist/index56.d.cts.map +1 -1
- package/dist/index56.d.ts +21 -8
- package/dist/index56.d.ts.map +1 -1
- package/dist/index57.d.cts +6 -44
- package/dist/index57.d.cts.map +1 -1
- package/dist/index57.d.ts +6 -44
- package/dist/index57.d.ts.map +1 -1
- package/dist/index58.d.cts +46 -47
- package/dist/index58.d.cts.map +1 -1
- package/dist/index58.d.ts +46 -47
- package/dist/index58.d.ts.map +1 -1
- package/dist/index59.d.cts +47 -59
- package/dist/index59.d.cts.map +1 -1
- package/dist/index59.d.ts +47 -59
- package/dist/index59.d.ts.map +1 -1
- package/dist/index6.d.cts +7 -7
- package/dist/index6.d.cts.map +1 -1
- package/dist/index6.d.ts +7 -7
- package/dist/index6.d.ts.map +1 -1
- package/dist/index60.d.cts +56 -38
- package/dist/index60.d.cts.map +1 -1
- package/dist/index60.d.ts +56 -38
- package/dist/index60.d.ts.map +1 -1
- package/dist/index61.d.cts +38 -14
- package/dist/index61.d.cts.map +1 -1
- package/dist/index61.d.ts +38 -14
- package/dist/index61.d.ts.map +1 -1
- package/dist/index62.d.cts +20 -41
- package/dist/index62.d.cts.map +1 -1
- package/dist/index62.d.ts +20 -41
- package/dist/index62.d.ts.map +1 -1
- package/dist/index63.d.cts +41 -19
- package/dist/index63.d.cts.map +1 -1
- package/dist/index63.d.ts +41 -19
- package/dist/index63.d.ts.map +1 -1
- package/dist/index64.d.cts +14 -39
- package/dist/index64.d.cts.map +1 -1
- package/dist/index64.d.ts +14 -39
- package/dist/index64.d.ts.map +1 -1
- package/dist/index65.d.cts +39 -16
- package/dist/index65.d.cts.map +1 -1
- package/dist/index65.d.ts +39 -16
- package/dist/index65.d.ts.map +1 -1
- package/dist/index66.d.cts +18 -12
- package/dist/index66.d.cts.map +1 -1
- package/dist/index66.d.ts +18 -12
- package/dist/index66.d.ts.map +1 -1
- package/dist/index67.d.cts +12 -30
- package/dist/index67.d.cts.map +1 -1
- package/dist/index67.d.ts +12 -30
- package/dist/index67.d.ts.map +1 -1
- package/dist/index68.d.cts +28 -27
- package/dist/index68.d.cts.map +1 -1
- package/dist/index68.d.ts +28 -27
- package/dist/index68.d.ts.map +1 -1
- package/dist/index69.d.cts +36 -69
- package/dist/index69.d.cts.map +1 -0
- package/dist/index69.d.ts +36 -69
- package/dist/index69.d.ts.map +1 -0
- package/dist/index7.d.cts +8 -8
- package/dist/index7.d.cts.map +1 -1
- package/dist/index7.d.ts +8 -8
- package/dist/index70.d.cts +76 -237
- package/dist/index70.d.cts.map +1 -1
- package/dist/index70.d.ts +76 -237
- package/dist/index70.d.ts.map +1 -1
- package/dist/index71.d.cts +242 -0
- package/dist/index71.d.cts.map +1 -0
- package/dist/index71.d.ts +242 -0
- package/dist/index71.d.ts.map +1 -0
- package/dist/index8.d.cts +4 -4
- package/dist/index8.d.cts.map +1 -1
- package/dist/index8.d.ts +4 -4
- package/dist/index8.d.ts.map +1 -1
- package/dist/index9.d.cts +2 -2
- package/dist/index9.d.ts +2 -2
- package/dist/layouts/Container/index.cjs +4 -4
- package/dist/layouts/Container/index.cjs.map +1 -1
- package/dist/layouts/Container/index.d.cts +1 -1
- package/dist/layouts/Container/index.d.ts +1 -1
- package/dist/layouts/Container/index.js +4 -4
- package/dist/layouts/Container/index.js.map +1 -1
- package/dist/layouts/PageBackground/index.cjs +2 -2
- package/dist/layouts/PageBackground/index.cjs.map +1 -1
- package/dist/layouts/PageBackground/index.d.cts +1 -1
- package/dist/layouts/PageBackground/index.d.ts +1 -1
- package/dist/layouts/PageBackground/index.js +2 -2
- package/dist/layouts/PageBackground/index.js.map +1 -1
- package/dist/layouts/Stack/index.d.cts +1 -1
- package/dist/layouts/Stack/index.d.ts +1 -1
- package/dist/layouts/TwoColumn/index.d.cts +1 -1
- package/dist/layouts/TwoColumn/index.d.ts +1 -1
- package/dist/layouts/index.d.cts +4 -4
- package/dist/layouts/index.d.ts +4 -4
- package/dist/patterns/DataTable/index.cjs +12 -7
- package/dist/patterns/DataTable/index.cjs.map +1 -1
- package/dist/patterns/DataTable/index.d.cts +3 -3
- package/dist/patterns/DataTable/index.d.cts.map +1 -1
- package/dist/patterns/DataTable/index.d.ts +3 -3
- package/dist/patterns/DataTable/index.d.ts.map +1 -1
- package/dist/patterns/DataTable/index.js +12 -7
- package/dist/patterns/DataTable/index.js.map +1 -1
- package/dist/patterns/Footer/index.cjs +5 -5
- package/dist/patterns/Footer/index.cjs.map +1 -1
- package/dist/patterns/Footer/index.d.cts +9 -9
- package/dist/patterns/Footer/index.d.cts.map +1 -1
- package/dist/patterns/Footer/index.d.ts +9 -9
- package/dist/patterns/Footer/index.d.ts.map +1 -1
- package/dist/patterns/Footer/index.js +5 -5
- package/dist/patterns/Footer/index.js.map +1 -1
- package/dist/patterns/Header/index.d.cts +1 -1
- package/dist/patterns/Header/index.d.ts +1 -1
- package/dist/patterns/MediaObject/index.cjs +1 -1
- package/dist/patterns/MediaObject/index.cjs.map +1 -1
- package/dist/patterns/MediaObject/index.d.cts +12 -12
- package/dist/patterns/MediaObject/index.d.cts.map +1 -1
- package/dist/patterns/MediaObject/index.d.ts +13 -13
- package/dist/patterns/MediaObject/index.d.ts.map +1 -1
- package/dist/patterns/MediaObject/index.js +1 -1
- package/dist/patterns/MediaObject/index.js.map +1 -1
- package/dist/patterns/NavRail/index.cjs +195 -0
- package/dist/patterns/NavRail/index.cjs.map +1 -0
- package/dist/patterns/NavRail/index.d.cts +2 -0
- package/dist/patterns/NavRail/index.d.ts +2 -0
- package/dist/patterns/NavRail/index.js +185 -0
- package/dist/patterns/NavRail/index.js.map +1 -0
- package/dist/patterns/SectionCard/index.cjs +1 -1
- package/dist/patterns/SectionCard/index.cjs.map +1 -1
- package/dist/patterns/SectionCard/index.d.cts +2 -2
- package/dist/patterns/SectionCard/index.d.ts +2 -2
- package/dist/patterns/SectionCard/index.d.ts.map +1 -1
- package/dist/patterns/SectionCard/index.js +1 -1
- package/dist/patterns/SectionCard/index.js.map +1 -1
- package/dist/patterns/SectionHeading/index.d.cts +2 -2
- package/dist/patterns/SectionHeading/index.d.cts.map +1 -1
- package/dist/patterns/SectionHeading/index.d.ts +2 -2
- package/dist/patterns/SectionHeading/index.d.ts.map +1 -1
- package/dist/patterns/index.cjs +9 -0
- package/dist/patterns/index.d.cts +3 -2
- package/dist/patterns/index.d.ts +3 -2
- package/dist/patterns/index.js +2 -1
- package/dist/primitives/Accordion/index.cjs +6 -6
- package/dist/primitives/Accordion/index.cjs.map +1 -1
- package/dist/primitives/Accordion/index.js +6 -6
- package/dist/primitives/Accordion/index.js.map +1 -1
- package/dist/primitives/Alert/index.cjs +4 -4
- package/dist/primitives/Alert/index.cjs.map +1 -1
- package/dist/primitives/Alert/index.js +4 -4
- package/dist/primitives/Alert/index.js.map +1 -1
- package/dist/primitives/AlertDialog/index.cjs +4 -4
- package/dist/primitives/AlertDialog/index.cjs.map +1 -1
- package/dist/primitives/AlertDialog/index.js +4 -4
- package/dist/primitives/AlertDialog/index.js.map +1 -1
- package/dist/primitives/Avatar/index.cjs +5 -5
- package/dist/primitives/Avatar/index.cjs.map +1 -1
- package/dist/primitives/Avatar/index.js +5 -5
- package/dist/primitives/Avatar/index.js.map +1 -1
- package/dist/primitives/Badge/index.cjs +11 -10
- package/dist/primitives/Badge/index.cjs.map +1 -1
- package/dist/primitives/Badge/index.js +11 -10
- package/dist/primitives/Badge/index.js.map +1 -1
- package/dist/primitives/Breadcrumb/index.cjs +4 -4
- package/dist/primitives/Breadcrumb/index.cjs.map +1 -1
- package/dist/primitives/Breadcrumb/index.js +4 -4
- package/dist/primitives/Breadcrumb/index.js.map +1 -1
- package/dist/primitives/Button/index.cjs +20 -13
- package/dist/primitives/Button/index.cjs.map +1 -1
- package/dist/primitives/Button/index.js +20 -13
- package/dist/primitives/Button/index.js.map +1 -1
- package/dist/primitives/ButtonGroup/index.cjs +3 -3
- package/dist/primitives/ButtonGroup/index.cjs.map +1 -1
- package/dist/primitives/ButtonGroup/index.js +3 -3
- package/dist/primitives/ButtonGroup/index.js.map +1 -1
- package/dist/primitives/Calendar/index.cjs +22 -21
- package/dist/primitives/Calendar/index.cjs.map +1 -1
- package/dist/primitives/Calendar/index.js +22 -21
- package/dist/primitives/Calendar/index.js.map +1 -1
- package/dist/primitives/Card/index.cjs +18 -16
- package/dist/primitives/Card/index.cjs.map +1 -1
- package/dist/primitives/Card/index.js +18 -16
- package/dist/primitives/Card/index.js.map +1 -1
- package/dist/primitives/Carousel/index.cjs +2 -2
- package/dist/primitives/Carousel/index.cjs.map +1 -1
- package/dist/primitives/Carousel/index.js +2 -2
- package/dist/primitives/Carousel/index.js.map +1 -1
- package/dist/primitives/Chart/index.cjs +12 -12
- package/dist/primitives/Chart/index.cjs.map +1 -1
- package/dist/primitives/Chart/index.js +12 -12
- package/dist/primitives/Chart/index.js.map +1 -1
- package/dist/primitives/Checkbox/index.cjs +6 -6
- package/dist/primitives/Checkbox/index.cjs.map +1 -1
- package/dist/primitives/Checkbox/index.js +6 -6
- package/dist/primitives/Checkbox/index.js.map +1 -1
- package/dist/primitives/CheckboxTree/index.cjs +2 -2
- package/dist/primitives/CheckboxTree/index.cjs.map +1 -1
- package/dist/primitives/CheckboxTree/index.js +2 -2
- package/dist/primitives/CheckboxTree/index.js.map +1 -1
- package/dist/primitives/Command/index.cjs +9 -9
- package/dist/primitives/Command/index.cjs.map +1 -1
- package/dist/primitives/Command/index.js +9 -9
- package/dist/primitives/Command/index.js.map +1 -1
- package/dist/primitives/ContextMenu/index.cjs +10 -10
- package/dist/primitives/ContextMenu/index.cjs.map +1 -1
- package/dist/primitives/ContextMenu/index.js +10 -10
- package/dist/primitives/ContextMenu/index.js.map +1 -1
- package/dist/primitives/Credits/index.cjs +4 -4
- package/dist/primitives/Credits/index.cjs.map +1 -1
- package/dist/primitives/Credits/index.js +4 -4
- package/dist/primitives/Credits/index.js.map +1 -1
- package/dist/primitives/Dialog/index.cjs +5 -5
- package/dist/primitives/Dialog/index.cjs.map +1 -1
- package/dist/primitives/Dialog/index.js +5 -5
- package/dist/primitives/Dialog/index.js.map +1 -1
- package/dist/primitives/Drawer/index.cjs +5 -5
- package/dist/primitives/Drawer/index.cjs.map +1 -1
- package/dist/primitives/Drawer/index.js +5 -5
- package/dist/primitives/Drawer/index.js.map +1 -1
- package/dist/primitives/DropdownMenu/index.cjs +9 -9
- package/dist/primitives/DropdownMenu/index.cjs.map +1 -1
- package/dist/primitives/DropdownMenu/index.js +9 -9
- package/dist/primitives/DropdownMenu/index.js.map +1 -1
- package/dist/primitives/Empty/index.cjs +4 -4
- package/dist/primitives/Empty/index.cjs.map +1 -1
- package/dist/primitives/Empty/index.js +4 -4
- package/dist/primitives/Empty/index.js.map +1 -1
- package/dist/primitives/Field/index.cjs +5 -5
- package/dist/primitives/Field/index.cjs.map +1 -1
- package/dist/primitives/Field/index.js +5 -5
- package/dist/primitives/Field/index.js.map +1 -1
- package/dist/primitives/Form/index.cjs +1 -1
- package/dist/primitives/Form/index.cjs.map +1 -1
- package/dist/primitives/Form/index.js +1 -1
- package/dist/primitives/Form/index.js.map +1 -1
- package/dist/primitives/Heading/index.cjs +2 -2
- package/dist/primitives/Heading/index.cjs.map +1 -1
- package/dist/primitives/Heading/index.js +2 -2
- package/dist/primitives/Heading/index.js.map +1 -1
- package/dist/primitives/HoverCard/index.cjs +1 -1
- package/dist/primitives/HoverCard/index.cjs.map +1 -1
- package/dist/primitives/HoverCard/index.js +1 -1
- package/dist/primitives/HoverCard/index.js.map +1 -1
- package/dist/primitives/InfoBanner/index.cjs +12 -12
- package/dist/primitives/InfoBanner/index.cjs.map +1 -1
- package/dist/primitives/InfoBanner/index.js +12 -12
- package/dist/primitives/InfoBanner/index.js.map +1 -1
- package/dist/primitives/Input/index.cjs +13 -7
- package/dist/primitives/Input/index.cjs.map +1 -1
- package/dist/primitives/Input/index.js +13 -7
- package/dist/primitives/Input/index.js.map +1 -1
- package/dist/primitives/InputGroup/index.cjs +7 -7
- package/dist/primitives/InputGroup/index.cjs.map +1 -1
- package/dist/primitives/InputGroup/index.js +7 -7
- package/dist/primitives/InputGroup/index.js.map +1 -1
- package/dist/primitives/InputOtp/index.cjs +3 -3
- package/dist/primitives/InputOtp/index.cjs.map +1 -1
- package/dist/primitives/InputOtp/index.js +3 -3
- package/dist/primitives/InputOtp/index.js.map +1 -1
- package/dist/primitives/Item/index.cjs +6 -6
- package/dist/primitives/Item/index.cjs.map +1 -1
- package/dist/primitives/Item/index.js +6 -6
- package/dist/primitives/Item/index.js.map +1 -1
- package/dist/primitives/Kbd/index.cjs +1 -1
- package/dist/primitives/Kbd/index.cjs.map +1 -1
- package/dist/primitives/Kbd/index.js +1 -1
- package/dist/primitives/Kbd/index.js.map +1 -1
- package/dist/primitives/Link/index.cjs +4 -4
- package/dist/primitives/Link/index.cjs.map +1 -1
- package/dist/primitives/Link/index.js +4 -4
- package/dist/primitives/Link/index.js.map +1 -1
- package/dist/primitives/Menubar/index.cjs +12 -12
- package/dist/primitives/Menubar/index.cjs.map +1 -1
- package/dist/primitives/Menubar/index.js +12 -12
- package/dist/primitives/Menubar/index.js.map +1 -1
- package/dist/primitives/NativeSelect/index.cjs +5 -5
- package/dist/primitives/NativeSelect/index.cjs.map +1 -1
- package/dist/primitives/NativeSelect/index.js +5 -5
- package/dist/primitives/NativeSelect/index.js.map +1 -1
- package/dist/primitives/NavRail/index.cjs +9 -194
- package/dist/primitives/NavRail/index.d.cts +1 -0
- package/dist/primitives/NavRail/index.d.ts +1 -0
- package/dist/primitives/NavRail/index.js +1 -184
- package/dist/primitives/NavigationMenu/index.cjs +7 -7
- package/dist/primitives/NavigationMenu/index.cjs.map +1 -1
- package/dist/primitives/NavigationMenu/index.js +7 -7
- package/dist/primitives/NavigationMenu/index.js.map +1 -1
- package/dist/primitives/Pagination/index.cjs +7 -13
- package/dist/primitives/Pagination/index.cjs.map +1 -1
- package/dist/primitives/Pagination/index.d.cts +1 -1
- package/dist/primitives/Pagination/index.d.ts +1 -1
- package/dist/primitives/Pagination/index.js +8 -14
- package/dist/primitives/Pagination/index.js.map +1 -1
- package/dist/primitives/Popover/index.cjs +4 -4
- package/dist/primitives/Popover/index.cjs.map +1 -1
- package/dist/primitives/Popover/index.js +4 -4
- package/dist/primitives/Popover/index.js.map +1 -1
- package/dist/primitives/Progress/index.cjs +16 -16
- package/dist/primitives/Progress/index.cjs.map +1 -1
- package/dist/primitives/Progress/index.d.cts +1 -1
- package/dist/primitives/Progress/index.d.ts +1 -1
- package/dist/primitives/Progress/index.js +16 -16
- package/dist/primitives/Progress/index.js.map +1 -1
- package/dist/primitives/RadioGroup/index.cjs +7 -7
- package/dist/primitives/RadioGroup/index.cjs.map +1 -1
- package/dist/primitives/RadioGroup/index.d.cts +1 -1
- package/dist/primitives/RadioGroup/index.d.ts +1 -1
- package/dist/primitives/RadioGroup/index.js +7 -7
- package/dist/primitives/RadioGroup/index.js.map +1 -1
- package/dist/primitives/Resizable/index.cjs +2 -2
- package/dist/primitives/Resizable/index.cjs.map +1 -1
- package/dist/primitives/Resizable/index.d.cts +1 -1
- package/dist/primitives/Resizable/index.d.ts +1 -1
- package/dist/primitives/Resizable/index.js +2 -2
- package/dist/primitives/Resizable/index.js.map +1 -1
- package/dist/primitives/ScrollArea/index.cjs +2 -2
- package/dist/primitives/ScrollArea/index.cjs.map +1 -1
- package/dist/primitives/ScrollArea/index.d.cts +1 -1
- package/dist/primitives/ScrollArea/index.d.ts +1 -1
- package/dist/primitives/ScrollArea/index.js +2 -2
- package/dist/primitives/ScrollArea/index.js.map +1 -1
- package/dist/primitives/Select/index.cjs +8 -8
- package/dist/primitives/Select/index.cjs.map +1 -1
- package/dist/primitives/Select/index.d.cts +1 -1
- package/dist/primitives/Select/index.d.ts +1 -1
- package/dist/primitives/Select/index.js +8 -8
- package/dist/primitives/Select/index.js.map +1 -1
- package/dist/primitives/Separator/index.cjs +1 -1
- package/dist/primitives/Separator/index.cjs.map +1 -1
- package/dist/primitives/Separator/index.js +1 -1
- package/dist/primitives/Separator/index.js.map +1 -1
- package/dist/primitives/Sheet/index.cjs +8 -8
- package/dist/primitives/Sheet/index.cjs.map +1 -1
- package/dist/primitives/Sheet/index.d.cts +1 -1
- package/dist/primitives/Sheet/index.d.ts +1 -1
- package/dist/primitives/Sheet/index.js +8 -8
- package/dist/primitives/Sheet/index.js.map +1 -1
- package/dist/primitives/Sidebar/index.d.cts +1 -1
- package/dist/primitives/Sidebar/index.d.ts +1 -1
- package/dist/primitives/Skeleton/index.cjs +2 -2
- package/dist/primitives/Skeleton/index.cjs.map +1 -1
- package/dist/primitives/Skeleton/index.d.cts +1 -1
- package/dist/primitives/Skeleton/index.d.ts +1 -1
- package/dist/primitives/Skeleton/index.js +2 -2
- package/dist/primitives/Skeleton/index.js.map +1 -1
- package/dist/primitives/Slider/index.cjs +3 -3
- package/dist/primitives/Slider/index.cjs.map +1 -1
- package/dist/primitives/Slider/index.d.cts +1 -1
- package/dist/primitives/Slider/index.d.ts +1 -1
- package/dist/primitives/Slider/index.js +3 -3
- package/dist/primitives/Slider/index.js.map +1 -1
- package/dist/primitives/Sonner/index.cjs +13 -6
- package/dist/primitives/Sonner/index.cjs.map +1 -1
- package/dist/primitives/Sonner/index.d.cts +1 -1
- package/dist/primitives/Sonner/index.d.ts +1 -1
- package/dist/primitives/Sonner/index.js +13 -6
- package/dist/primitives/Sonner/index.js.map +1 -1
- package/dist/primitives/Spinner/index.d.cts +1 -1
- package/dist/primitives/Spinner/index.d.ts +1 -1
- package/dist/primitives/Switch/index.cjs +7 -7
- package/dist/primitives/Switch/index.cjs.map +1 -1
- package/dist/primitives/Switch/index.d.cts +1 -1
- package/dist/primitives/Switch/index.d.ts +1 -1
- package/dist/primitives/Switch/index.js +7 -7
- package/dist/primitives/Switch/index.js.map +1 -1
- package/dist/primitives/Table/index.cjs +7 -7
- package/dist/primitives/Table/index.cjs.map +1 -1
- package/dist/primitives/Table/index.d.cts +1 -1
- package/dist/primitives/Table/index.d.ts +1 -1
- package/dist/primitives/Table/index.js +7 -7
- package/dist/primitives/Table/index.js.map +1 -1
- package/dist/primitives/Tabs/index.cjs +21 -21
- package/dist/primitives/Tabs/index.cjs.map +1 -1
- package/dist/primitives/Tabs/index.d.cts +1 -1
- package/dist/primitives/Tabs/index.d.ts +1 -1
- package/dist/primitives/Tabs/index.js +21 -21
- package/dist/primitives/Tabs/index.js.map +1 -1
- package/dist/primitives/Text/index.cjs +5 -5
- package/dist/primitives/Text/index.cjs.map +1 -1
- package/dist/primitives/Text/index.d.cts +1 -1
- package/dist/primitives/Text/index.d.ts +1 -1
- package/dist/primitives/Text/index.js +5 -5
- package/dist/primitives/Text/index.js.map +1 -1
- package/dist/primitives/Textarea/index.cjs +20 -8
- package/dist/primitives/Textarea/index.cjs.map +1 -1
- package/dist/primitives/Textarea/index.d.cts +1 -1
- package/dist/primitives/Textarea/index.d.ts +1 -1
- package/dist/primitives/Textarea/index.js +20 -8
- package/dist/primitives/Textarea/index.js.map +1 -1
- package/dist/primitives/ThemeProvider/index.d.cts +1 -1
- package/dist/primitives/ThemeProvider/index.d.ts +1 -1
- package/dist/primitives/Toggle/index.cjs +11 -10
- package/dist/primitives/Toggle/index.cjs.map +1 -1
- package/dist/primitives/Toggle/index.d.cts +1 -1
- package/dist/primitives/Toggle/index.d.ts +1 -1
- package/dist/primitives/Toggle/index.js +11 -10
- package/dist/primitives/Toggle/index.js.map +1 -1
- package/dist/primitives/ToggleGroup/index.cjs +2 -2
- package/dist/primitives/ToggleGroup/index.cjs.map +1 -1
- package/dist/primitives/ToggleGroup/index.d.cts +1 -1
- package/dist/primitives/ToggleGroup/index.d.ts +1 -1
- package/dist/primitives/ToggleGroup/index.js +2 -2
- package/dist/primitives/ToggleGroup/index.js.map +1 -1
- package/dist/primitives/Tooltip/index.cjs +2 -2
- package/dist/primitives/Tooltip/index.cjs.map +1 -1
- package/dist/primitives/Tooltip/index.d.cts +1 -1
- package/dist/primitives/Tooltip/index.d.ts +1 -1
- package/dist/primitives/Tooltip/index.js +2 -2
- package/dist/primitives/Tooltip/index.js.map +1 -1
- package/dist/primitives/index.cjs +10 -10
- package/dist/primitives/index.d.cts +21 -21
- package/dist/primitives/index.d.ts +21 -21
- package/dist/primitives/index.js +2 -2
- package/dist/styles/base.css +23 -4
- package/dist/styles/brand-scopes.css +49 -0
- package/dist/styles/glass.css +13 -8
- package/dist/styles/index.css +8 -9
- package/dist/styles/theme.css +141 -90
- package/dist/styles/tokens/border-radius.css +8 -8
- package/dist/styles/tokens/mode-dark.css +71 -94
- package/dist/styles/tokens/mode-light.css +71 -94
- package/dist/styles/tokens/shadows.css +4 -7
- package/dist/styles/tokens/spacing.css +17 -37
- package/dist/styles/tokens/theme-bodhi.css +6 -28
- package/dist/styles/tokens/theme-slingshot.css +7 -28
- package/dist/styles/tokens/theme-sustain.css +6 -28
- package/dist/styles/typography.css +9 -9
- package/package.json +8 -2
- package/dist/index44.d.cts.map +0 -1
- package/dist/index44.d.ts.map +0 -1
- package/dist/primitives/NavRail/index.cjs.map +0 -1
- package/dist/primitives/NavRail/index.js.map +0 -1
- package/dist/styles/semantic.css +0 -178
- package/dist/styles/tokens/alpha.css +0 -39
- package/dist/styles/tokens/chart-colors-dark.css +0 -18
- package/dist/styles/tokens/chart-colors-light.css +0 -18
- package/dist/styles/tokens/colors.css +0 -251
|
@@ -29,7 +29,7 @@ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
|
29
29
|
return /* @__PURE__ */ jsx(DropdownMenu$1.Portal, { children: /* @__PURE__ */ jsx(DropdownMenu$1.Content, {
|
|
30
30
|
"data-slot": "dropdown-menu-content",
|
|
31
31
|
sideOffset,
|
|
32
|
-
className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-
|
|
32
|
+
className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-12 border border-primary-border bg-glass-60-bg backdrop-blur-glass p-2 text-primary-txt shadow-sm data-[side=bottom]:slide-in-from-top-8 data-[side=left]:slide-in-from-right-8 data-[side=right]:slide-in-from-left-8 data-[side=top]:slide-in-from-bottom-8 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", "[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-item]:not([data-inset])]:pl-8", "[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-label]:not([data-inset])]:pl-8", "[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-sub-trigger]:not([data-inset])]:pl-8", className),
|
|
33
33
|
...props
|
|
34
34
|
}) });
|
|
35
35
|
}
|
|
@@ -46,7 +46,7 @@ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
|
46
46
|
"data-slot": "dropdown-menu-item",
|
|
47
47
|
"data-inset": inset,
|
|
48
48
|
"data-variant": variant,
|
|
49
|
-
className: cn("relative flex cursor-default items-center gap-2 rounded-
|
|
49
|
+
className: cn("relative flex min-h-8 cursor-default items-center gap-2 rounded-10 px-2 py-1.5 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-danger-txt data-[variant=destructive]:focus:bg-danger-bg [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-txt data-[variant=destructive]:*:[svg]:text-danger-txt!", className),
|
|
50
50
|
...props
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -54,7 +54,7 @@ function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
|
54
54
|
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
55
55
|
return /* @__PURE__ */ jsxs(DropdownMenu$1.CheckboxItem, {
|
|
56
56
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
57
|
-
className: cn("relative flex cursor-default items-center gap-2 rounded-
|
|
57
|
+
className: cn("relative flex min-h-8 cursor-default items-center gap-2 rounded-10 py-1.5 pr-2 pl-8 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
58
58
|
checked,
|
|
59
59
|
...props,
|
|
60
60
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -74,7 +74,7 @@ function DropdownMenuRadioGroup({ ...props }) {
|
|
|
74
74
|
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
75
75
|
return /* @__PURE__ */ jsxs(DropdownMenu$1.RadioItem, {
|
|
76
76
|
"data-slot": "dropdown-menu-radio-item",
|
|
77
|
-
className: cn("relative flex cursor-default items-center gap-2 rounded-
|
|
77
|
+
className: cn("relative flex min-h-8 cursor-default items-center gap-2 rounded-10 py-1.5 pr-2 pl-8 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
78
78
|
...props,
|
|
79
79
|
children: [/* @__PURE__ */ jsx("span", {
|
|
80
80
|
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
@@ -87,7 +87,7 @@ function DropdownMenuLabel({ className, inset, ...props }) {
|
|
|
87
87
|
return /* @__PURE__ */ jsx(DropdownMenu$1.Label, {
|
|
88
88
|
"data-slot": "dropdown-menu-label",
|
|
89
89
|
"data-inset": inset,
|
|
90
|
-
className: cn("px-2 py-1.5 text-
|
|
90
|
+
className: cn("px-2 py-1.5 text-xs leading-4 font-medium text-muted-txt data-[inset]:pl-8", className),
|
|
91
91
|
...props
|
|
92
92
|
});
|
|
93
93
|
}
|
|
@@ -95,7 +95,7 @@ function DropdownMenuLabel({ className, inset, ...props }) {
|
|
|
95
95
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
96
96
|
return /* @__PURE__ */ jsx(DropdownMenu$1.Separator, {
|
|
97
97
|
"data-slot": "dropdown-menu-separator",
|
|
98
|
-
className: cn("
|
|
98
|
+
className: cn("my-1 h-px bg-primary-border", className),
|
|
99
99
|
...props
|
|
100
100
|
});
|
|
101
101
|
}
|
|
@@ -103,7 +103,7 @@ function DropdownMenuSeparator({ className, ...props }) {
|
|
|
103
103
|
function DropdownMenuShortcut({ className, ...props }) {
|
|
104
104
|
return /* @__PURE__ */ jsx("span", {
|
|
105
105
|
"data-slot": "dropdown-menu-shortcut",
|
|
106
|
-
className: cn("ml-auto text-
|
|
106
|
+
className: cn("ml-auto text-sm leading-5 text-muted-txt", className),
|
|
107
107
|
...props
|
|
108
108
|
});
|
|
109
109
|
}
|
|
@@ -119,7 +119,7 @@ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
119
119
|
return /* @__PURE__ */ jsxs(DropdownMenu$1.SubTrigger, {
|
|
120
120
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
121
121
|
"data-inset": inset,
|
|
122
|
-
className: cn("flex cursor-default items-center gap-2 rounded-
|
|
122
|
+
className: cn("flex min-h-8 cursor-default items-center gap-2 rounded-10 px-2 py-1.5 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[inset]:pl-8 data-[state=open]:bg-ghost-hover-bg [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-txt", className),
|
|
123
123
|
...props,
|
|
124
124
|
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })]
|
|
125
125
|
});
|
|
@@ -128,7 +128,7 @@ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
128
128
|
function DropdownMenuSubContent({ className, ...props }) {
|
|
129
129
|
return /* @__PURE__ */ jsx(DropdownMenu$1.SubContent, {
|
|
130
130
|
"data-slot": "dropdown-menu-sub-content",
|
|
131
|
-
className: cn("z-50 min-w-
|
|
131
|
+
className: cn("z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-12 border border-primary-border bg-glass-none-bg p-2 text-primary-txt shadow-sm data-[side=bottom]:slide-in-from-top-8 data-[side=left]:slide-in-from-right-8 data-[side=right]:slide-in-from-left-8 data-[side=top]:slide-in-from-bottom-8 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", "[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-item]:not([data-inset])]:pl-8", "[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-label]:not([data-inset])]:pl-8", "[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-sub-trigger]:not([data-inset])]:pl-8", className),
|
|
132
132
|
...props
|
|
133
133
|
});
|
|
134
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["DropdownMenuPrimitive"],"sources":["../../../src/primitives/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n/** Root provider for a dropdown menu; holds open state and wires the trigger to its content. */\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\n/** Renders the menu into a portal so it escapes overflow/stacking contexts. */\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\n/** The control (usually a button) that toggles the menu open and closed. */\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\n/** The floating surface that holds the menu items; portalled and animated on open/close. */\nfunction DropdownMenuContent({\n className,\n /** Gap in pixels between the trigger and the content edge. */\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\n/** Groups related menu items together for labelling and keyboard navigation. */\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\n/** A selectable menu row that fires on click/Enter. */\nfunction DropdownMenuItem({\n className,\n /** Indents the item to align with rows that have a leading icon/indicator. */\n inset,\n /** Visual tone of the item; `destructive` renders in the danger color. */\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive-subtle data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A menu row with a toggleable checkmark indicator for boolean options. */\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n /** Whether the checkbox indicator is shown as checked. */\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\n/** Wraps radio items so only one option in the group can be selected at a time. */\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\n/** A single mutually-exclusive option within a `DropdownMenuRadioGroup`. */\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\n/** A non-interactive heading used to title a group of menu items. */\nfunction DropdownMenuLabel({\n className,\n /** Indents the label to align with rows that have a leading icon/indicator. */\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)}\n {...props}\n />\n );\n}\n\n/** A thin divider line used to visually separate groups of menu items. */\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n );\n}\n\n/** Right-aligned hint for an item's keyboard shortcut (e.g. ⇧⌘P). */\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n}\n\n/** Root for a nested submenu; holds the sub-trigger and its sub-content. */\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\n/** The item that opens a nested submenu, shown with a trailing chevron. */\nfunction DropdownMenuSubTrigger({\n className,\n /** Indents the trigger to align with rows that have a leading icon/indicator. */\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\n/** The floating surface for a nested submenu's items. */\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["DropdownMenuPrimitive"],"sources":["../../../src/primitives/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\n/** Root provider for a dropdown menu; holds open state and wires the trigger to its content. */\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\n/** Renders the menu into a portal so it escapes overflow/stacking contexts. */\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\n/** The control (usually a button) that toggles the menu open and closed. */\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\n/** The floating surface that holds the menu items; portalled and animated on open/close. */\nfunction DropdownMenuContent({\n className,\n /** Gap in pixels between the trigger and the content edge. */\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n // Figma Menu spec (Select & Combobox page): glass-none surface, primary\n // border, radius-12, shadow-sm, 8px padding.\n \"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-12 border border-primary-border bg-glass-60-bg backdrop-blur-glass p-2 text-primary-txt shadow-sm data-[side=bottom]:slide-in-from-top-8 data-[side=left]:slide-in-from-right-8 data-[side=right]:slide-in-from-left-8 data-[side=top]:slide-in-from-bottom-8 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n // Vertical hierarchy: if any item reserves the 32px indicator column\n // (checkbox/radio items), plain items, labels and sub-triggers share it.\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-item]:not([data-inset])]:pl-8\",\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-label]:not([data-inset])]:pl-8\",\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-sub-trigger]:not([data-inset])]:pl-8\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\n/** Groups related menu items together for labelling and keyboard navigation. */\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\n/** A selectable menu row that fires on click/Enter. */\nfunction DropdownMenuItem({\n className,\n /** Indents the item to align with rows that have a leading icon/indicator. */\n inset,\n /** Visual tone of the item; `destructive` renders in the danger color. */\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"relative flex min-h-8 cursor-default items-center gap-2 rounded-10 px-2 py-1.5 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-danger-txt data-[variant=destructive]:focus:bg-danger-bg [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-txt data-[variant=destructive]:*:[svg]:text-danger-txt!\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A menu row with a toggleable checkmark indicator for boolean options. */\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n /** Whether the checkbox indicator is shown as checked. */\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"relative flex min-h-8 cursor-default items-center gap-2 rounded-10 py-1.5 pr-2 pl-8 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\n/** Wraps radio items so only one option in the group can be selected at a time. */\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\n/** A single mutually-exclusive option within a `DropdownMenuRadioGroup`. */\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"relative flex min-h-8 cursor-default items-center gap-2 rounded-10 py-1.5 pr-2 pl-8 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\n/** A non-interactive heading used to title a group of menu items. */\nfunction DropdownMenuLabel({\n className,\n /** Indents the label to align with rows that have a leading icon/indicator. */\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-xs leading-4 font-medium text-muted-txt data-[inset]:pl-8\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** A thin divider line used to visually separate groups of menu items. */\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"my-1 h-px bg-primary-border\", className)}\n {...props}\n />\n );\n}\n\n/** Right-aligned hint for an item's keyboard shortcut (e.g. ⇧⌘P). */\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\"ml-auto text-sm leading-5 text-muted-txt\", className)}\n {...props}\n />\n );\n}\n\n/** Root for a nested submenu; holds the sub-trigger and its sub-content. */\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\n/** The item that opens a nested submenu, shown with a trailing chevron. */\nfunction DropdownMenuSubTrigger({\n className,\n /** Indents the trigger to align with rows that have a leading icon/indicator. */\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex min-h-8 cursor-default items-center gap-2 rounded-10 px-2 py-1.5 text-sm leading-5 outline-hidden select-none focus:bg-ghost-hover-bg data-[inset]:pl-8 data-[state=open]:bg-ghost-hover-bg [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-txt\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\n/** The floating surface for a nested submenu's items. */\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-12 border border-primary-border bg-glass-none-bg p-2 text-primary-txt shadow-sm data-[side=bottom]:slide-in-from-top-8 data-[side=left]:slide-in-from-right-8 data-[side=right]:slide-in-from-left-8 data-[side=top]:slide-in-from-bottom-8 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n // Vertical hierarchy: if any item reserves the 32px indicator column\n // (checkbox/radio items), plain items, labels and sub-triggers share it.\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-item]:not([data-inset])]:pl-8\",\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-label]:not([data-inset])]:pl-8\",\n \"[&:has([role=menuitemcheckbox],[role=menuitemradio])_[data-slot=dropdown-menu-sub-trigger]:not([data-inset])]:pl-8\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"mappings":"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"}
|
|
@@ -3,11 +3,11 @@ const require_cn = require("../../cn.cjs");
|
|
|
3
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
4
|
let class_variance_authority = require("class-variance-authority");
|
|
5
5
|
//#region src/primitives/Empty/Empty.tsx
|
|
6
|
-
const emptyVariants = (0, class_variance_authority.cva)("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-
|
|
6
|
+
const emptyVariants = (0, class_variance_authority.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", {
|
|
7
7
|
variants: { variant: {
|
|
8
8
|
default: "",
|
|
9
9
|
outline: "border",
|
|
10
|
-
background: "bg-muted",
|
|
10
|
+
background: "bg-muted-bg",
|
|
11
11
|
"outline-dashed": "border border-dashed"
|
|
12
12
|
} },
|
|
13
13
|
defaultVariants: { variant: "default" }
|
|
@@ -32,7 +32,7 @@ function EmptyHeader({ className, ...props }) {
|
|
|
32
32
|
const emptyMediaVariants = (0, class_variance_authority.cva)("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
33
33
|
variants: { variant: {
|
|
34
34
|
default: "bg-transparent",
|
|
35
|
-
icon: "flex size-10 shrink-0 items-center justify-center rounded-
|
|
35
|
+
icon: "flex size-10 shrink-0 items-center justify-center rounded-8 bg-muted-bg text-primary-txt [&_svg:not([class*='size-'])]:size-6"
|
|
36
36
|
} },
|
|
37
37
|
defaultVariants: { variant: "default" }
|
|
38
38
|
});
|
|
@@ -60,7 +60,7 @@ function EmptyTitle({ className, ...props }) {
|
|
|
60
60
|
function EmptyDescription({ className, ...props }) {
|
|
61
61
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
62
62
|
"data-slot": "empty-description",
|
|
63
|
-
className: require_cn.cn("text-sm/relaxed text-muted-
|
|
63
|
+
className: require_cn.cn("text-sm/relaxed text-muted-txt [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary-txt", className),
|
|
64
64
|
...props
|
|
65
65
|
});
|
|
66
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["cn"],"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.cjs","names":["cn"],"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,iBAAA,GAAA,yBAAA,KACJ,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,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,gBAAc;EACd,WAAWA,WAAAA,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS;EACnD,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GAAG,yDAAyD,SAAS;EAChF,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,sBAAA,GAAA,yBAAA,KACJ,+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,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,gBAAc;EACd,WAAWA,WAAAA,GAAG,mBAAmB;GAAE;GAAS;EAAU,CAAC,CAAC;EACxD,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GAAG,sCAAsC,SAAS;EAC7D,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAoC;CAC5E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GACT,wGACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GACT,iFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -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":"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"}
|
|
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":"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"}
|
|
@@ -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,WAAW,GAAG,SAAsC;CACxE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,0IACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,gBAAgB,IAAI,qEAAqE;CAC7F,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;;AAGD,SAAS,MAAM,EACb,WAEA,cAAc,YACd,GAAG,SACgE;CACnE,OACE,oBAAC,OAAD;EACE,MAAK;EACL,aAAU;EACV,oBAAkB;EAClB,WAAW,GAAG,cAAc,EAAE,YAAY,CAAC,GAAG,SAAS;EACvD,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,iEAAiE,SAAS;EACxF,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA6C;CAC/E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,gHACA,oKACA,mGACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,8GACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAoC;CAC5E,OACE,oBAAC,KAAD;EACE,aAAU;EACV,WAAW,GACT,kHACA,gEACA,yEACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,eAAe,EACtB,UACA,WACA,GAAG,SAIF;CACD,OACE,qBAAC,OAAD;EACE,aAAU;EACV,gBAAc,CAAC,CAAC;EAChB,WAAW,GACT,6EACA,SACF;EACA,GAAI;YAPN,CASE,oBAAC,WAAD,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,GAAG,SAA6C;CAClE,MAAM,KAAKA,MAAM,MAAM;CAEvB,OACE,iBAAA,GAAA,kBAAA,KAAC,gBAAgB,UAAjB;EAA0B,OAAO,EAAE,GAAG;YACpC,iBAAA,GAAA,kBAAA,KAACE,+BAAAA,OAAD;GAAO,aAAU;GAAY,GAAI;EAAQ,CAAA;CACjB,CAAA;AAE9B;;AAGA,SAAS,UAAU,EAAE,WAAW,GAAG,SAAkD;CACnF,MAAM,EAAE,OAAO,eAAe,aAAa;CAE3C,OACE,iBAAA,GAAA,kBAAA,KAACC,+BAAAA,YAAD;EACE,aAAU;EACV,cAAY,CAAC,CAAC;EACd,WAAWC,WAAAA,GAAG,qCAAqC,SAAS;EAC5D,SAAS;EACT,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAAE,GAAG,SAAiD;CACzE,MAAM,EAAE,OAAO,YAAY,mBAAmB,kBAAkB,aAAa;CAE7E,OACE,iBAAA,GAAA,kBAAA,KAACC,SAAAA,KAAK,MAAN;EACE,aAAU;EACV,IAAI;EACJ,oBAAkB,CAAC,QAAQ,GAAG,sBAAsB,GAAG,kBAAkB,GAAG;EAC5E,gBAAc,CAAC,CAAC;EAChB,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,gBAAgB,EAAE,GAAG,SAAwD;CACpF,MAAM,EAAE,sBAAsB,aAAa;CAE3C,OAAO,iBAAA,GAAA,kBAAA,KAACC,+BAAAA,kBAAD;EAAkB,aAAU;EAAmB,IAAI;EAAmB,GAAI;CAAQ,CAAA;AAC3F;;AAGA,SAAS,YAAY,EAAE,UAAU,GAAG,SAAkD;CACpF,MAAM,EAAE,OAAO,kBAAkB,aAAa;CAC9C,MAAM,OAAO,QAAQ,OAAO,OAAO,WAAW,EAAE,IAAI;CAEpD,IAAI,CAAC,MACH,OAAO;CAGT,OACE,iBAAA,GAAA,kBAAA,KAACC,+BAAAA,YAAD;EAAY,aAAU;EAAe,IAAI;EAAe,GAAI;YACzD;CACS,CAAA;AAEhB"}
|
|
@@ -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,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,kBAAkB,MAAM,cAAoC,CAAC,CAAyB;;AAG5F,SAAS,SAAS,EAAE,GAAG,SAA6C;CAClE,MAAM,KAAK,MAAM,MAAM;CAEvB,OACE,oBAAC,gBAAgB,UAAjB;EAA0B,OAAO,EAAE,GAAG;YACpC,oBAAC,OAAD;GAAO,aAAU;GAAY,GAAI;EAAQ,CAAA;CACjB,CAAA;AAE9B;;AAGA,SAAS,UAAU,EAAE,WAAW,GAAG,SAAkD;CACnF,MAAM,EAAE,OAAO,eAAe,aAAa;CAE3C,OACE,oBAAC,YAAD;EACE,aAAU;EACV,cAAY,CAAC,CAAC;EACd,WAAW,GAAG,qCAAqC,SAAS;EAC5D,SAAS;EACT,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAAE,GAAG,SAAiD;CACzE,MAAM,EAAE,OAAO,YAAY,mBAAmB,kBAAkB,aAAa;CAE7E,OACE,oBAAC,KAAK,MAAN;EACE,aAAU;EACV,IAAI;EACJ,oBAAkB,CAAC,QAAQ,GAAG,sBAAsB,GAAG,kBAAkB,GAAG;EAC5E,gBAAc,CAAC,CAAC;EAChB,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,gBAAgB,EAAE,GAAG,SAAwD;CACpF,MAAM,EAAE,sBAAsB,aAAa;CAE3C,OAAO,oBAAC,kBAAD;EAAkB,aAAU;EAAmB,IAAI;EAAmB,GAAI;CAAQ,CAAA;AAC3F;;AAGA,SAAS,YAAY,EAAE,UAAU,GAAG,SAAkD;CACpF,MAAM,EAAE,OAAO,kBAAkB,aAAa;CAC9C,MAAM,OAAO,QAAQ,OAAO,OAAO,WAAW,EAAE,IAAI;CAEpD,IAAI,CAAC,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: {
|