@psnext/design-system 1.0.0 → 1.2.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/README.md +103 -90
- package/dist/Header.cjs +890 -0
- package/dist/Header.cjs.map +1 -0
- package/dist/Header.js +798 -0
- package/dist/Header.js.map +1 -0
- package/dist/Icon.cjs +1969 -0
- package/dist/Icon.cjs.map +1 -0
- package/dist/Icon.js +1956 -0
- package/dist/Icon.js.map +1 -0
- package/dist/Logo.cjs +813 -0
- package/dist/Logo.cjs.map +1 -0
- package/dist/Logo.js +808 -0
- package/dist/Logo.js.map +1 -0
- package/dist/Sidebar.cjs +562 -0
- package/dist/Sidebar.cjs.map +1 -0
- package/dist/Sidebar.js +416 -0
- package/dist/Sidebar.js.map +1 -0
- package/dist/chunk.cjs +28 -0
- package/dist/cn.cjs +15 -0
- package/dist/cn.cjs.map +1 -0
- package/dist/cn.js +10 -0
- package/dist/cn.js.map +1 -0
- package/dist/contexts/index.cjs +0 -60
- package/dist/contexts/index.d.cts +1 -23
- package/dist/contexts/index.d.ts +1 -23
- package/dist/contexts/index.js +1 -58
- package/dist/index.cjs +414 -272
- package/dist/index.d.cts +17 -1424
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +17 -1424
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +72 -7
- package/dist/index10.d.cts +38 -0
- package/dist/index10.d.cts.map +1 -0
- package/dist/index10.d.ts +38 -0
- package/dist/index10.d.ts.map +1 -0
- package/dist/index11.d.cts +30 -0
- package/dist/index11.d.cts.map +1 -0
- package/dist/index11.d.ts +30 -0
- package/dist/index11.d.ts.map +1 -0
- package/dist/index12.d.cts +75 -0
- package/dist/index12.d.cts.map +1 -0
- package/dist/index12.d.ts +75 -0
- package/dist/index12.d.ts.map +1 -0
- package/dist/index13.d.cts +57 -0
- package/dist/index13.d.cts.map +1 -0
- package/dist/index13.d.ts +57 -0
- package/dist/index13.d.ts.map +1 -0
- package/dist/index14.d.cts +98 -0
- package/dist/index14.d.cts.map +1 -0
- package/dist/index14.d.ts +98 -0
- package/dist/index14.d.ts.map +1 -0
- package/dist/index15.d.cts +29 -0
- package/dist/index15.d.cts.map +1 -0
- package/dist/index15.d.ts +29 -0
- package/dist/index15.d.ts.map +1 -0
- package/dist/index16.d.cts +38 -0
- package/dist/index16.d.cts.map +1 -0
- package/dist/index16.d.ts +38 -0
- package/dist/index16.d.ts.map +1 -0
- package/dist/index17.d.cts +19 -0
- package/dist/index17.d.cts.map +1 -0
- package/dist/index17.d.ts +19 -0
- package/dist/index17.d.ts.map +1 -0
- package/dist/index18.d.cts +73 -0
- package/dist/index18.d.cts.map +1 -0
- package/dist/index18.d.ts +73 -0
- package/dist/index18.d.ts.map +1 -0
- package/dist/index19.d.cts +66 -0
- package/dist/index19.d.cts.map +1 -0
- package/dist/index19.d.ts +66 -0
- package/dist/index19.d.ts.map +1 -0
- package/dist/index2.d.cts +41 -13
- package/dist/index2.d.cts.map +1 -1
- package/dist/index2.d.ts +41 -13
- package/dist/index2.d.ts.map +1 -1
- package/dist/index20.d.cts +96 -0
- package/dist/index20.d.cts.map +1 -0
- package/dist/index20.d.ts +96 -0
- package/dist/index20.d.ts.map +1 -0
- package/dist/index21.d.cts +34 -0
- package/dist/index21.d.cts.map +1 -0
- package/dist/index21.d.ts +34 -0
- package/dist/index21.d.ts.map +1 -0
- package/dist/index22.d.cts +62 -0
- package/dist/index22.d.cts.map +1 -0
- package/dist/index22.d.ts +62 -0
- package/dist/index22.d.ts.map +1 -0
- package/dist/index23.d.cts +99 -0
- package/dist/index23.d.cts.map +1 -0
- package/dist/index23.d.ts +99 -0
- package/dist/index23.d.ts.map +1 -0
- package/dist/index24.d.cts +49 -0
- package/dist/index24.d.cts.map +1 -0
- package/dist/index24.d.ts +49 -0
- package/dist/index24.d.ts.map +1 -0
- package/dist/index25.d.cts +17 -0
- package/dist/index25.d.cts.map +1 -0
- package/dist/index25.d.ts +17 -0
- package/dist/index25.d.ts.map +1 -0
- package/dist/index26.d.cts +80 -0
- package/dist/index26.d.cts.map +1 -0
- package/dist/index26.d.ts +80 -0
- package/dist/index26.d.ts.map +1 -0
- package/dist/index27.d.cts +71 -0
- package/dist/index27.d.cts.map +1 -0
- package/dist/index27.d.ts +71 -0
- package/dist/index27.d.ts.map +1 -0
- package/dist/index28.d.cts +37 -0
- package/dist/index28.d.cts.map +1 -0
- package/dist/index28.d.ts +37 -0
- package/dist/index28.d.ts.map +1 -0
- package/dist/index29.d.cts +25 -0
- package/dist/index29.d.cts.map +1 -0
- package/dist/index29.d.ts +25 -0
- package/dist/index29.d.ts.map +1 -0
- package/dist/index3.d.cts +62 -0
- package/dist/index3.d.cts.map +1 -0
- package/dist/index3.d.ts +62 -0
- package/dist/index3.d.ts.map +1 -0
- package/dist/index30.d.cts +59 -0
- package/dist/index30.d.cts.map +1 -0
- package/dist/index30.d.ts +59 -0
- package/dist/index30.d.ts.map +1 -0
- package/dist/index31.d.cts +40 -0
- package/dist/index31.d.cts.map +1 -0
- package/dist/index31.d.ts +40 -0
- package/dist/index31.d.ts.map +1 -0
- package/dist/index32.d.cts +23 -0
- package/dist/index32.d.cts.map +1 -0
- package/dist/index32.d.ts +23 -0
- package/dist/index32.d.ts.map +1 -0
- package/dist/index33.d.cts +55 -0
- package/dist/index33.d.cts.map +1 -0
- package/dist/index33.d.ts +55 -0
- package/dist/index33.d.ts.map +1 -0
- package/dist/index34.d.cts +43 -0
- package/dist/index34.d.cts.map +1 -0
- package/dist/index34.d.ts +43 -0
- package/dist/index34.d.ts.map +1 -0
- package/dist/index35.d.cts +77 -0
- package/dist/index35.d.cts.map +1 -0
- package/dist/index35.d.ts +77 -0
- package/dist/index35.d.ts.map +1 -0
- package/dist/index36.d.cts +19 -0
- package/dist/index36.d.cts.map +1 -0
- package/dist/index36.d.ts +19 -0
- package/dist/index36.d.ts.map +1 -0
- package/dist/index37.d.cts +29 -0
- package/dist/index37.d.cts.map +1 -0
- package/dist/index37.d.ts +29 -0
- package/dist/index37.d.ts.map +1 -0
- package/dist/index38.d.cts +20 -0
- package/dist/index38.d.cts.map +1 -0
- package/dist/index38.d.ts +20 -0
- package/dist/index38.d.ts.map +1 -0
- package/dist/index39.d.cts +105 -0
- package/dist/index39.d.cts.map +1 -0
- package/dist/index39.d.ts +105 -0
- package/dist/index39.d.ts.map +1 -0
- package/dist/index4.d.cts +11 -0
- package/dist/index4.d.cts.map +1 -0
- package/dist/index4.d.ts +11 -0
- package/dist/index4.d.ts.map +1 -0
- package/dist/index40.d.cts +22 -0
- package/dist/index40.d.cts.map +1 -0
- package/dist/index40.d.ts +22 -0
- package/dist/index40.d.ts.map +1 -0
- package/dist/index41.d.cts +56 -0
- package/dist/index41.d.cts.map +1 -0
- package/dist/index41.d.ts +56 -0
- package/dist/index41.d.ts.map +1 -0
- package/dist/index42.d.cts +45 -0
- package/dist/index42.d.cts.map +1 -0
- package/dist/index42.d.ts +45 -0
- package/dist/index42.d.ts.map +1 -0
- package/dist/index43.d.cts +96 -0
- package/dist/index43.d.cts.map +1 -0
- package/dist/index43.d.ts +96 -0
- package/dist/index43.d.ts.map +1 -0
- package/dist/index44.d.cts +48 -0
- package/dist/index44.d.cts.map +1 -0
- package/dist/index44.d.ts +48 -0
- package/dist/index44.d.ts.map +1 -0
- package/dist/index45.d.cts +28 -0
- package/dist/index45.d.cts.map +1 -0
- package/dist/index45.d.ts +28 -0
- package/dist/index45.d.ts.map +1 -0
- package/dist/index46.d.cts +41 -0
- package/dist/index46.d.cts.map +1 -0
- package/dist/index46.d.ts +41 -0
- package/dist/index46.d.ts.map +1 -0
- package/dist/index47.d.cts +25 -0
- package/dist/index47.d.cts.map +1 -0
- package/dist/index47.d.ts +25 -0
- package/dist/index47.d.ts.map +1 -0
- package/dist/index48.d.cts +21 -0
- package/dist/index48.d.cts.map +1 -0
- package/dist/index48.d.ts +21 -0
- package/dist/index48.d.ts.map +1 -0
- package/dist/index49.d.cts +69 -0
- package/dist/index49.d.cts.map +1 -0
- package/dist/index49.d.ts +69 -0
- package/dist/index49.d.ts.map +1 -0
- package/dist/index5.d.cts +45 -0
- package/dist/index5.d.cts.map +1 -0
- package/dist/index5.d.ts +45 -0
- package/dist/index5.d.ts.map +1 -0
- package/dist/index50.d.cts +63 -0
- package/dist/index50.d.cts.map +1 -0
- package/dist/index50.d.ts +63 -0
- package/dist/index50.d.ts.map +1 -0
- package/dist/index51.d.cts +31 -0
- package/dist/index51.d.cts.map +1 -0
- package/dist/index51.d.ts +31 -0
- package/dist/index51.d.ts.map +1 -0
- package/dist/index52.d.cts +209 -0
- package/dist/index52.d.cts.map +1 -0
- package/dist/index52.d.ts +209 -0
- package/dist/index52.d.ts.map +1 -0
- package/dist/index53.d.cts +26 -0
- package/dist/index53.d.cts.map +1 -0
- package/dist/index53.d.ts +26 -0
- package/dist/index53.d.ts.map +1 -0
- package/dist/index54.d.cts +28 -0
- package/dist/index54.d.cts.map +1 -0
- package/dist/index54.d.ts +28 -0
- package/dist/index54.d.ts.map +1 -0
- package/dist/index55.d.cts +25 -0
- package/dist/index55.d.cts.map +1 -0
- package/dist/index55.d.ts +25 -0
- package/dist/index55.d.ts.map +1 -0
- package/dist/index56.d.cts +12 -0
- package/dist/index56.d.cts.map +1 -0
- package/dist/index56.d.ts +12 -0
- package/dist/index56.d.ts.map +1 -0
- package/dist/index57.d.cts +50 -0
- package/dist/index57.d.cts.map +1 -0
- package/dist/index57.d.ts +50 -0
- package/dist/index57.d.ts.map +1 -0
- package/dist/index58.d.cts +51 -0
- package/dist/index58.d.cts.map +1 -0
- package/dist/index58.d.ts +51 -0
- package/dist/index58.d.ts.map +1 -0
- package/dist/index59.d.cts +58 -0
- package/dist/index59.d.cts.map +1 -0
- package/dist/index59.d.ts +58 -0
- package/dist/index59.d.ts.map +1 -0
- package/dist/index6.d.cts +26 -0
- package/dist/index6.d.cts.map +1 -0
- package/dist/index6.d.ts +26 -0
- package/dist/index6.d.ts.map +1 -0
- package/dist/index60.d.cts +45 -0
- package/dist/index60.d.cts.map +1 -0
- package/dist/index60.d.ts +45 -0
- package/dist/index60.d.ts.map +1 -0
- package/dist/index61.d.cts +21 -0
- package/dist/index61.d.cts.map +1 -0
- package/dist/index61.d.ts +21 -0
- package/dist/index61.d.ts.map +1 -0
- package/dist/index62.d.cts +45 -0
- package/dist/index62.d.cts.map +1 -0
- package/dist/index62.d.ts +45 -0
- package/dist/index62.d.ts.map +1 -0
- package/dist/index63.d.cts +23 -0
- package/dist/index63.d.cts.map +1 -0
- package/dist/index63.d.ts +23 -0
- package/dist/index63.d.ts.map +1 -0
- package/dist/index64.d.cts +48 -0
- package/dist/index64.d.cts.map +1 -0
- package/dist/index64.d.ts +48 -0
- package/dist/index64.d.ts.map +1 -0
- package/dist/index65.d.cts +25 -0
- package/dist/index65.d.cts.map +1 -0
- package/dist/index65.d.ts +25 -0
- package/dist/index65.d.ts.map +1 -0
- package/dist/index66.d.cts +19 -0
- package/dist/index66.d.cts.map +1 -0
- package/dist/index66.d.ts +19 -0
- package/dist/index66.d.ts.map +1 -0
- package/dist/index67.d.cts +37 -0
- package/dist/index67.d.cts.map +1 -0
- package/dist/index67.d.ts +37 -0
- package/dist/index67.d.ts.map +1 -0
- package/dist/index68.d.cts +36 -0
- package/dist/index68.d.cts.map +1 -0
- package/dist/index68.d.ts +36 -0
- package/dist/index68.d.ts.map +1 -0
- package/dist/index69.d.cts +69 -0
- package/dist/index69.d.ts +69 -0
- package/dist/index7.d.cts +46 -0
- package/dist/index7.d.cts.map +1 -0
- package/dist/index7.d.ts +46 -0
- package/dist/index7.d.ts.map +1 -0
- package/dist/index70.d.cts +242 -0
- package/dist/index70.d.cts.map +1 -0
- package/dist/index70.d.ts +242 -0
- package/dist/index70.d.ts.map +1 -0
- package/dist/index8.d.cts +26 -0
- package/dist/index8.d.cts.map +1 -0
- package/dist/index8.d.ts +26 -0
- package/dist/index8.d.ts.map +1 -0
- package/dist/index9.d.cts +20 -0
- package/dist/index9.d.cts.map +1 -0
- package/dist/index9.d.ts +20 -0
- package/dist/index9.d.ts.map +1 -0
- package/dist/layouts/Container/index.cjs +39 -0
- package/dist/layouts/Container/index.cjs.map +1 -0
- package/dist/layouts/Container/index.d.cts +2 -0
- package/dist/layouts/Container/index.d.ts +2 -0
- package/dist/layouts/Container/index.js +38 -0
- package/dist/layouts/Container/index.js.map +1 -0
- package/dist/layouts/PageBackground/index.cjs +22 -0
- package/dist/layouts/PageBackground/index.cjs.map +1 -0
- package/dist/layouts/PageBackground/index.d.cts +2 -0
- package/dist/layouts/PageBackground/index.d.ts +2 -0
- package/dist/layouts/PageBackground/index.js +21 -0
- package/dist/layouts/PageBackground/index.js.map +1 -0
- package/dist/layouts/Stack/index.cjs +56 -0
- package/dist/layouts/Stack/index.cjs.map +1 -0
- package/dist/layouts/Stack/index.d.cts +2 -0
- package/dist/layouts/Stack/index.d.ts +2 -0
- package/dist/layouts/Stack/index.js +55 -0
- package/dist/layouts/Stack/index.js.map +1 -0
- package/dist/layouts/TwoColumn/index.cjs +51 -0
- package/dist/layouts/TwoColumn/index.cjs.map +1 -0
- package/dist/layouts/TwoColumn/index.d.cts +2 -0
- package/dist/layouts/TwoColumn/index.d.ts +2 -0
- package/dist/layouts/TwoColumn/index.js +48 -0
- package/dist/layouts/TwoColumn/index.js.map +1 -0
- package/dist/layouts/index.cjs +13 -12
- package/dist/layouts/index.d.cts +5 -133
- package/dist/layouts/index.d.ts +5 -133
- package/dist/layouts/index.js +5 -2
- package/dist/patterns/DataTable/index.cjs +114 -0
- package/dist/patterns/DataTable/index.cjs.map +1 -0
- package/dist/patterns/DataTable/index.d.cts +43 -0
- package/dist/patterns/DataTable/index.d.cts.map +1 -0
- package/dist/patterns/DataTable/index.d.ts +43 -0
- package/dist/patterns/DataTable/index.d.ts.map +1 -0
- package/dist/patterns/DataTable/index.js +110 -0
- package/dist/patterns/DataTable/index.js.map +1 -0
- package/dist/patterns/Footer/index.cjs +76 -0
- package/dist/patterns/Footer/index.cjs.map +1 -0
- package/dist/patterns/Footer/index.d.cts +54 -0
- package/dist/patterns/Footer/index.d.cts.map +1 -0
- package/dist/patterns/Footer/index.d.ts +54 -0
- package/dist/patterns/Footer/index.d.ts.map +1 -0
- package/dist/patterns/Footer/index.js +70 -0
- package/dist/patterns/Footer/index.js.map +1 -0
- package/dist/patterns/Header/index.cjs +17 -0
- package/dist/patterns/Header/index.d.cts +2 -0
- package/dist/patterns/Header/index.d.ts +2 -0
- package/dist/patterns/Header/index.js +2 -0
- package/dist/patterns/MediaObject/index.cjs +108 -0
- package/dist/patterns/MediaObject/index.cjs.map +1 -0
- package/dist/patterns/MediaObject/index.d.cts +71 -0
- package/dist/patterns/MediaObject/index.d.cts.map +1 -0
- package/dist/patterns/MediaObject/index.d.ts +71 -0
- package/dist/patterns/MediaObject/index.d.ts.map +1 -0
- package/dist/patterns/MediaObject/index.js +99 -0
- package/dist/patterns/MediaObject/index.js.map +1 -0
- package/dist/patterns/SectionCard/index.cjs +35 -0
- package/dist/patterns/SectionCard/index.cjs.map +1 -0
- package/dist/patterns/SectionCard/index.d.cts +21 -0
- package/dist/patterns/SectionCard/index.d.cts.map +1 -0
- package/dist/patterns/SectionCard/index.d.ts +21 -0
- package/dist/patterns/SectionCard/index.d.ts.map +1 -0
- package/dist/patterns/SectionCard/index.js +34 -0
- package/dist/patterns/SectionCard/index.js.map +1 -0
- package/dist/patterns/SectionHeading/index.cjs +44 -0
- package/dist/patterns/SectionHeading/index.cjs.map +1 -0
- package/dist/patterns/SectionHeading/index.d.cts +37 -0
- package/dist/patterns/SectionHeading/index.d.cts.map +1 -0
- package/dist/patterns/SectionHeading/index.d.ts +37 -0
- package/dist/patterns/SectionHeading/index.d.ts.map +1 -0
- package/dist/patterns/SectionHeading/index.js +43 -0
- package/dist/patterns/SectionHeading/index.js.map +1 -0
- package/dist/patterns/index.cjs +40 -7374
- package/dist/patterns/index.d.cts +7 -418
- package/dist/patterns/index.d.ts +7 -418
- package/dist/patterns/index.js +7 -7344
- package/dist/primitives/Accordion/index.cjs +54 -0
- package/dist/primitives/Accordion/index.cjs.map +1 -0
- package/dist/primitives/Accordion/index.d.cts +2 -0
- package/dist/primitives/Accordion/index.d.ts +2 -0
- package/dist/primitives/Accordion/index.js +50 -0
- package/dist/primitives/Accordion/index.js.map +1 -0
- package/dist/primitives/Alert/index.cjs +61 -0
- package/dist/primitives/Alert/index.cjs.map +1 -0
- package/dist/primitives/Alert/index.d.cts +2 -0
- package/dist/primitives/Alert/index.d.ts +2 -0
- package/dist/primitives/Alert/index.js +57 -0
- package/dist/primitives/Alert/index.js.map +1 -0
- package/dist/primitives/AlertDialog/index.cjs +102 -0
- package/dist/primitives/AlertDialog/index.cjs.map +1 -0
- package/dist/primitives/AlertDialog/index.d.cts +2 -0
- package/dist/primitives/AlertDialog/index.d.ts +2 -0
- package/dist/primitives/AlertDialog/index.js +90 -0
- package/dist/primitives/AlertDialog/index.js.map +1 -0
- package/dist/primitives/AspectRatio/index.cjs +15 -0
- package/dist/primitives/AspectRatio/index.cjs.map +1 -0
- package/dist/primitives/AspectRatio/index.d.cts +2 -0
- package/dist/primitives/AspectRatio/index.d.ts +2 -0
- package/dist/primitives/AspectRatio/index.js +14 -0
- package/dist/primitives/AspectRatio/index.js.map +1 -0
- package/dist/primitives/Avatar/index.cjs +64 -0
- package/dist/primitives/Avatar/index.cjs.map +1 -0
- package/dist/primitives/Avatar/index.d.cts +2 -0
- package/dist/primitives/Avatar/index.d.ts +2 -0
- package/dist/primitives/Avatar/index.js +58 -0
- package/dist/primitives/Avatar/index.js.map +1 -0
- package/dist/primitives/Badge/index.cjs +44 -0
- package/dist/primitives/Badge/index.cjs.map +1 -0
- package/dist/primitives/Badge/index.d.cts +2 -0
- package/dist/primitives/Badge/index.d.ts +2 -0
- package/dist/primitives/Badge/index.js +43 -0
- package/dist/primitives/Badge/index.js.map +1 -0
- package/dist/primitives/Breadcrumb/index.cjs +82 -0
- package/dist/primitives/Breadcrumb/index.cjs.map +1 -0
- package/dist/primitives/Breadcrumb/index.d.cts +2 -0
- package/dist/primitives/Breadcrumb/index.d.ts +2 -0
- package/dist/primitives/Breadcrumb/index.js +75 -0
- package/dist/primitives/Breadcrumb/index.js.map +1 -0
- package/dist/primitives/Button/index.cjs +61 -0
- package/dist/primitives/Button/index.cjs.map +1 -0
- package/dist/primitives/Button/index.d.cts +2 -0
- package/dist/primitives/Button/index.d.ts +2 -0
- package/dist/primitives/Button/index.js +60 -0
- package/dist/primitives/Button/index.js.map +1 -0
- package/dist/primitives/ButtonGroup/index.cjs +46 -0
- package/dist/primitives/ButtonGroup/index.cjs.map +1 -0
- package/dist/primitives/ButtonGroup/index.d.cts +2 -0
- package/dist/primitives/ButtonGroup/index.d.ts +2 -0
- package/dist/primitives/ButtonGroup/index.js +43 -0
- package/dist/primitives/ButtonGroup/index.js.map +1 -0
- package/dist/primitives/Calendar/index.cjs +112 -0
- package/dist/primitives/Calendar/index.cjs.map +1 -0
- package/dist/primitives/Calendar/index.d.cts +2 -0
- package/dist/primitives/Calendar/index.d.ts +2 -0
- package/dist/primitives/Calendar/index.js +108 -0
- package/dist/primitives/Calendar/index.js.map +1 -0
- package/dist/primitives/Card/index.cjs +128 -0
- package/dist/primitives/Card/index.cjs.map +1 -0
- package/dist/primitives/Card/index.d.cts +2 -0
- package/dist/primitives/Card/index.d.ts +2 -0
- package/dist/primitives/Card/index.js +121 -0
- package/dist/primitives/Card/index.js.map +1 -0
- package/dist/primitives/Carousel/index.cjs +146 -0
- package/dist/primitives/Carousel/index.cjs.map +1 -0
- package/dist/primitives/Carousel/index.d.cts +2 -0
- package/dist/primitives/Carousel/index.d.ts +2 -0
- package/dist/primitives/Carousel/index.js +138 -0
- package/dist/primitives/Carousel/index.js.map +1 -0
- package/dist/primitives/Chart/index.cjs +162 -0
- package/dist/primitives/Chart/index.cjs.map +1 -0
- package/dist/primitives/Chart/index.d.cts +2 -0
- package/dist/primitives/Chart/index.d.ts +2 -0
- package/dist/primitives/Chart/index.js +153 -0
- package/dist/primitives/Chart/index.js.map +1 -0
- package/dist/primitives/Checkbox/index.cjs +53 -0
- package/dist/primitives/Checkbox/index.cjs.map +1 -0
- package/dist/primitives/Checkbox/index.d.cts +2 -0
- package/dist/primitives/Checkbox/index.d.ts +2 -0
- package/dist/primitives/Checkbox/index.js +51 -0
- package/dist/primitives/Checkbox/index.js.map +1 -0
- package/dist/primitives/CheckboxTree/index.cjs +106 -0
- package/dist/primitives/CheckboxTree/index.cjs.map +1 -0
- package/dist/primitives/CheckboxTree/index.d.cts +2 -0
- package/dist/primitives/CheckboxTree/index.d.ts +2 -0
- package/dist/primitives/CheckboxTree/index.js +103 -0
- package/dist/primitives/CheckboxTree/index.js.map +1 -0
- package/dist/primitives/Collapsible/index.cjs +31 -0
- package/dist/primitives/Collapsible/index.cjs.map +1 -0
- package/dist/primitives/Collapsible/index.d.cts +2 -0
- package/dist/primitives/Collapsible/index.d.ts +2 -0
- package/dist/primitives/Collapsible/index.js +28 -0
- package/dist/primitives/Collapsible/index.js.map +1 -0
- package/dist/primitives/Command/index.cjs +104 -0
- package/dist/primitives/Command/index.cjs.map +1 -0
- package/dist/primitives/Command/index.d.cts +2 -0
- package/dist/primitives/Command/index.d.ts +2 -0
- package/dist/primitives/Command/index.js +95 -0
- package/dist/primitives/Command/index.js.map +1 -0
- package/dist/primitives/ContextMenu/index.cjs +152 -0
- package/dist/primitives/ContextMenu/index.cjs.map +1 -0
- package/dist/primitives/ContextMenu/index.d.cts +2 -0
- package/dist/primitives/ContextMenu/index.d.ts +2 -0
- package/dist/primitives/ContextMenu/index.js +137 -0
- package/dist/primitives/ContextMenu/index.js.map +1 -0
- package/dist/primitives/Credits/index.cjs +39 -0
- package/dist/primitives/Credits/index.cjs.map +1 -0
- package/dist/primitives/Credits/index.d.cts +2 -0
- package/dist/primitives/Credits/index.d.ts +2 -0
- package/dist/primitives/Credits/index.js +38 -0
- package/dist/primitives/Credits/index.js.map +1 -0
- package/dist/primitives/Dialog/index.cjs +121 -0
- package/dist/primitives/Dialog/index.cjs.map +1 -0
- package/dist/primitives/Dialog/index.d.cts +2 -0
- package/dist/primitives/Dialog/index.d.ts +2 -0
- package/dist/primitives/Dialog/index.js +111 -0
- package/dist/primitives/Dialog/index.js.map +1 -0
- package/dist/primitives/Drawer/index.cjs +98 -0
- package/dist/primitives/Drawer/index.cjs.map +1 -0
- package/dist/primitives/Drawer/index.d.cts +2 -0
- package/dist/primitives/Drawer/index.d.ts +2 -0
- package/dist/primitives/Drawer/index.js +88 -0
- package/dist/primitives/Drawer/index.js.map +1 -0
- package/dist/primitives/DropdownMenu/index.cjs +153 -0
- package/dist/primitives/DropdownMenu/index.cjs.map +1 -0
- package/dist/primitives/DropdownMenu/index.d.cts +2 -0
- package/dist/primitives/DropdownMenu/index.d.ts +2 -0
- package/dist/primitives/DropdownMenu/index.js +138 -0
- package/dist/primitives/DropdownMenu/index.js.map +1 -0
- package/dist/primitives/Empty/index.cjs +84 -0
- package/dist/primitives/Empty/index.cjs.map +1 -0
- package/dist/primitives/Empty/index.d.cts +2 -0
- package/dist/primitives/Empty/index.d.ts +2 -0
- package/dist/primitives/Empty/index.js +77 -0
- package/dist/primitives/Empty/index.js.map +1 -0
- package/dist/primitives/Field/index.cjs +139 -0
- package/dist/primitives/Field/index.cjs.map +1 -0
- package/dist/primitives/Field/index.d.cts +2 -0
- package/dist/primitives/Field/index.d.ts +2 -0
- package/dist/primitives/Field/index.js +129 -0
- package/dist/primitives/Field/index.js.map +1 -0
- package/dist/primitives/Form/index.cjs +104 -0
- package/dist/primitives/Form/index.cjs.map +1 -0
- package/dist/primitives/Form/index.d.cts +2 -0
- package/dist/primitives/Form/index.d.ts +2 -0
- package/dist/primitives/Form/index.js +94 -0
- package/dist/primitives/Form/index.js.map +1 -0
- package/dist/primitives/Heading/index.cjs +53 -0
- package/dist/primitives/Heading/index.cjs.map +1 -0
- package/dist/primitives/Heading/index.d.cts +2 -0
- package/dist/primitives/Heading/index.d.ts +2 -0
- package/dist/primitives/Heading/index.js +52 -0
- package/dist/primitives/Heading/index.js.map +1 -0
- package/dist/primitives/HoverCard/index.cjs +38 -0
- package/dist/primitives/HoverCard/index.cjs.map +1 -0
- package/dist/primitives/HoverCard/index.d.cts +2 -0
- package/dist/primitives/HoverCard/index.d.ts +2 -0
- package/dist/primitives/HoverCard/index.js +35 -0
- package/dist/primitives/HoverCard/index.js.map +1 -0
- package/dist/primitives/Icon/index.cjs +4 -0
- package/dist/primitives/Icon/index.d.cts +2 -0
- package/dist/primitives/Icon/index.d.ts +2 -0
- package/dist/primitives/Icon/index.js +2 -0
- package/dist/primitives/InfoBanner/index.cjs +79 -0
- package/dist/primitives/InfoBanner/index.cjs.map +1 -0
- package/dist/primitives/InfoBanner/index.d.cts +2 -0
- package/dist/primitives/InfoBanner/index.d.ts +2 -0
- package/dist/primitives/InfoBanner/index.js +78 -0
- package/dist/primitives/InfoBanner/index.js.map +1 -0
- package/dist/primitives/Input/index.cjs +39 -0
- package/dist/primitives/Input/index.cjs.map +1 -0
- package/dist/primitives/Input/index.d.cts +2 -0
- package/dist/primitives/Input/index.d.ts +2 -0
- package/dist/primitives/Input/index.js +38 -0
- package/dist/primitives/Input/index.js.map +1 -0
- package/dist/primitives/InputGroup/index.cjs +91 -0
- package/dist/primitives/InputGroup/index.cjs.map +1 -0
- package/dist/primitives/InputGroup/index.d.cts +2 -0
- package/dist/primitives/InputGroup/index.d.ts +2 -0
- package/dist/primitives/InputGroup/index.js +85 -0
- package/dist/primitives/InputGroup/index.js.map +1 -0
- package/dist/primitives/InputOtp/index.cjs +80 -0
- package/dist/primitives/InputOtp/index.cjs.map +1 -0
- package/dist/primitives/InputOtp/index.d.cts +2 -0
- package/dist/primitives/InputOtp/index.d.ts +2 -0
- package/dist/primitives/InputOtp/index.js +74 -0
- package/dist/primitives/InputOtp/index.js.map +1 -0
- package/dist/primitives/Item/index.cjs +137 -0
- package/dist/primitives/Item/index.cjs.map +1 -0
- package/dist/primitives/Item/index.d.cts +2 -0
- package/dist/primitives/Item/index.d.ts +2 -0
- package/dist/primitives/Item/index.js +127 -0
- package/dist/primitives/Item/index.js.map +1 -0
- package/dist/primitives/Kbd/index.cjs +25 -0
- package/dist/primitives/Kbd/index.cjs.map +1 -0
- package/dist/primitives/Kbd/index.d.cts +2 -0
- package/dist/primitives/Kbd/index.d.ts +2 -0
- package/dist/primitives/Kbd/index.js +23 -0
- package/dist/primitives/Kbd/index.js.map +1 -0
- package/dist/primitives/Label/index.cjs +18 -0
- package/dist/primitives/Label/index.cjs.map +1 -0
- package/dist/primitives/Label/index.d.cts +2 -0
- package/dist/primitives/Label/index.d.ts +2 -0
- package/dist/primitives/Label/index.js +17 -0
- package/dist/primitives/Label/index.js.map +1 -0
- package/dist/primitives/Link/index.cjs +38 -0
- package/dist/primitives/Link/index.cjs.map +1 -0
- package/dist/primitives/Link/index.d.cts +2 -0
- package/dist/primitives/Link/index.d.ts +2 -0
- package/dist/primitives/Link/index.js +37 -0
- package/dist/primitives/Link/index.js.map +1 -0
- package/dist/primitives/Logo/index.cjs +3 -0
- package/dist/primitives/Logo/index.d.cts +2 -0
- package/dist/primitives/Logo/index.d.ts +2 -0
- package/dist/primitives/Logo/index.js +2 -0
- package/dist/primitives/Menubar/index.cjs +165 -0
- package/dist/primitives/Menubar/index.cjs.map +1 -0
- package/dist/primitives/Menubar/index.d.cts +2 -0
- package/dist/primitives/Menubar/index.d.ts +2 -0
- package/dist/primitives/Menubar/index.js +149 -0
- package/dist/primitives/Menubar/index.js.map +1 -0
- package/dist/primitives/NativeSelect/index.cjs +40 -0
- package/dist/primitives/NativeSelect/index.cjs.map +1 -0
- package/dist/primitives/NativeSelect/index.d.cts +2 -0
- package/dist/primitives/NativeSelect/index.d.ts +2 -0
- package/dist/primitives/NativeSelect/index.js +39 -0
- package/dist/primitives/NativeSelect/index.js.map +1 -0
- package/dist/primitives/NavRail/index.cjs +195 -0
- package/dist/primitives/NavRail/index.cjs.map +1 -0
- package/dist/primitives/NavRail/index.d.cts +2 -0
- package/dist/primitives/NavRail/index.d.ts +2 -0
- package/dist/primitives/NavRail/index.js +185 -0
- package/dist/primitives/NavRail/index.js.map +1 -0
- package/dist/primitives/NavigationMenu/index.cjs +98 -0
- package/dist/primitives/NavigationMenu/index.cjs.map +1 -0
- package/dist/primitives/NavigationMenu/index.d.cts +2 -0
- package/dist/primitives/NavigationMenu/index.d.ts +2 -0
- package/dist/primitives/NavigationMenu/index.js +89 -0
- package/dist/primitives/NavigationMenu/index.js.map +1 -0
- package/dist/primitives/Pagination/index.cjs +93 -0
- package/dist/primitives/Pagination/index.cjs.map +1 -0
- package/dist/primitives/Pagination/index.d.cts +2 -0
- package/dist/primitives/Pagination/index.d.ts +2 -0
- package/dist/primitives/Pagination/index.js +86 -0
- package/dist/primitives/Pagination/index.js.map +1 -0
- package/dist/primitives/Popover/index.cjs +70 -0
- package/dist/primitives/Popover/index.cjs.map +1 -0
- package/dist/primitives/Popover/index.d.cts +2 -0
- package/dist/primitives/Popover/index.d.ts +2 -0
- package/dist/primitives/Popover/index.js +63 -0
- package/dist/primitives/Popover/index.js.map +1 -0
- package/dist/primitives/Progress/index.cjs +44 -0
- package/dist/primitives/Progress/index.cjs.map +1 -0
- package/dist/primitives/Progress/index.d.cts +2 -0
- package/dist/primitives/Progress/index.d.ts +2 -0
- package/dist/primitives/Progress/index.js +43 -0
- package/dist/primitives/Progress/index.js.map +1 -0
- package/dist/primitives/RadioGroup/index.cjs +65 -0
- package/dist/primitives/RadioGroup/index.cjs.map +1 -0
- package/dist/primitives/RadioGroup/index.d.cts +2 -0
- package/dist/primitives/RadioGroup/index.d.ts +2 -0
- package/dist/primitives/RadioGroup/index.js +62 -0
- package/dist/primitives/RadioGroup/index.js.map +1 -0
- package/dist/primitives/Resizable/index.cjs +41 -0
- package/dist/primitives/Resizable/index.cjs.map +1 -0
- package/dist/primitives/Resizable/index.d.cts +2 -0
- package/dist/primitives/Resizable/index.d.ts +2 -0
- package/dist/primitives/Resizable/index.js +36 -0
- package/dist/primitives/Resizable/index.js.map +1 -0
- package/dist/primitives/ScrollArea/index.cjs +40 -0
- package/dist/primitives/ScrollArea/index.cjs.map +1 -0
- package/dist/primitives/ScrollArea/index.d.cts +2 -0
- package/dist/primitives/ScrollArea/index.d.ts +2 -0
- package/dist/primitives/ScrollArea/index.js +38 -0
- package/dist/primitives/ScrollArea/index.js.map +1 -0
- package/dist/primitives/Select/index.cjs +126 -0
- package/dist/primitives/Select/index.cjs.map +1 -0
- package/dist/primitives/Select/index.d.cts +2 -0
- package/dist/primitives/Select/index.d.ts +2 -0
- package/dist/primitives/Select/index.js +116 -0
- package/dist/primitives/Select/index.js.map +1 -0
- package/dist/primitives/Separator/index.cjs +25 -0
- package/dist/primitives/Separator/index.cjs.map +1 -0
- package/dist/primitives/Separator/index.d.cts +2 -0
- package/dist/primitives/Separator/index.d.ts +2 -0
- package/dist/primitives/Separator/index.js +24 -0
- package/dist/primitives/Separator/index.js.map +1 -0
- package/dist/primitives/Sheet/index.cjs +107 -0
- package/dist/primitives/Sheet/index.cjs.map +1 -0
- package/dist/primitives/Sheet/index.d.cts +2 -0
- package/dist/primitives/Sheet/index.d.ts +2 -0
- package/dist/primitives/Sheet/index.js +99 -0
- package/dist/primitives/Sheet/index.js.map +1 -0
- package/dist/primitives/Sidebar/index.cjs +26 -0
- package/dist/primitives/Sidebar/index.d.cts +2 -0
- package/dist/primitives/Sidebar/index.d.ts +2 -0
- package/dist/primitives/Sidebar/index.js +2 -0
- package/dist/primitives/Skeleton/index.cjs +43 -0
- package/dist/primitives/Skeleton/index.cjs.map +1 -0
- package/dist/primitives/Skeleton/index.d.cts +2 -0
- package/dist/primitives/Skeleton/index.d.ts +2 -0
- package/dist/primitives/Skeleton/index.js +39 -0
- package/dist/primitives/Skeleton/index.js.map +1 -0
- package/dist/primitives/Slider/index.cjs +46 -0
- package/dist/primitives/Slider/index.cjs.map +1 -0
- package/dist/primitives/Slider/index.d.cts +2 -0
- package/dist/primitives/Slider/index.d.ts +2 -0
- package/dist/primitives/Slider/index.js +43 -0
- package/dist/primitives/Slider/index.js.map +1 -0
- package/dist/primitives/Sonner/index.cjs +42 -0
- package/dist/primitives/Sonner/index.cjs.map +1 -0
- package/dist/primitives/Sonner/index.d.cts +2 -0
- package/dist/primitives/Sonner/index.d.ts +2 -0
- package/dist/primitives/Sonner/index.js +41 -0
- package/dist/primitives/Sonner/index.js.map +1 -0
- package/dist/primitives/Spinner/index.cjs +19 -0
- package/dist/primitives/Spinner/index.cjs.map +1 -0
- package/dist/primitives/Spinner/index.d.cts +2 -0
- package/dist/primitives/Spinner/index.d.ts +2 -0
- package/dist/primitives/Spinner/index.js +18 -0
- package/dist/primitives/Spinner/index.js.map +1 -0
- package/dist/primitives/Switch/index.cjs +71 -0
- package/dist/primitives/Switch/index.cjs.map +1 -0
- package/dist/primitives/Switch/index.d.cts +2 -0
- package/dist/primitives/Switch/index.d.ts +2 -0
- package/dist/primitives/Switch/index.js +68 -0
- package/dist/primitives/Switch/index.js.map +1 -0
- package/dist/primitives/Table/index.cjs +84 -0
- package/dist/primitives/Table/index.cjs.map +1 -0
- package/dist/primitives/Table/index.d.cts +2 -0
- package/dist/primitives/Table/index.d.ts +2 -0
- package/dist/primitives/Table/index.js +76 -0
- package/dist/primitives/Table/index.js.map +1 -0
- package/dist/primitives/Tabs/index.cjs +267 -0
- package/dist/primitives/Tabs/index.cjs.map +1 -0
- package/dist/primitives/Tabs/index.d.cts +2 -0
- package/dist/primitives/Tabs/index.d.ts +2 -0
- package/dist/primitives/Tabs/index.js +258 -0
- package/dist/primitives/Tabs/index.js.map +1 -0
- package/dist/primitives/Text/index.cjs +64 -0
- package/dist/primitives/Text/index.cjs.map +1 -0
- package/dist/primitives/Text/index.d.cts +2 -0
- package/dist/primitives/Text/index.d.ts +2 -0
- package/dist/primitives/Text/index.js +63 -0
- package/dist/primitives/Text/index.js.map +1 -0
- package/dist/primitives/Textarea/index.cjs +24 -0
- package/dist/primitives/Textarea/index.cjs.map +1 -0
- package/dist/primitives/Textarea/index.d.cts +2 -0
- package/dist/primitives/Textarea/index.d.ts +2 -0
- package/dist/primitives/Textarea/index.js +23 -0
- package/dist/primitives/Textarea/index.js.map +1 -0
- package/dist/primitives/ThemeProvider/index.cjs +93 -0
- package/dist/primitives/ThemeProvider/index.cjs.map +1 -0
- package/dist/primitives/ThemeProvider/index.d.cts +2 -0
- package/dist/primitives/ThemeProvider/index.d.ts +2 -0
- package/dist/primitives/ThemeProvider/index.js +88 -0
- package/dist/primitives/ThemeProvider/index.js.map +1 -0
- package/dist/primitives/Toggle/index.cjs +59 -0
- package/dist/primitives/Toggle/index.cjs.map +1 -0
- package/dist/primitives/Toggle/index.d.cts +2 -0
- package/dist/primitives/Toggle/index.d.ts +2 -0
- package/dist/primitives/Toggle/index.js +58 -0
- package/dist/primitives/Toggle/index.js.map +1 -0
- package/dist/primitives/ToggleGroup/index.cjs +65 -0
- package/dist/primitives/ToggleGroup/index.cjs.map +1 -0
- package/dist/primitives/ToggleGroup/index.d.cts +2 -0
- package/dist/primitives/ToggleGroup/index.d.ts +2 -0
- package/dist/primitives/ToggleGroup/index.js +61 -0
- package/dist/primitives/ToggleGroup/index.js.map +1 -0
- package/dist/primitives/Tooltip/index.cjs +47 -0
- package/dist/primitives/Tooltip/index.cjs.map +1 -0
- package/dist/primitives/Tooltip/index.d.cts +2 -0
- package/dist/primitives/Tooltip/index.d.ts +2 -0
- package/dist/primitives/Tooltip/index.js +43 -0
- package/dist/primitives/Tooltip/index.js.map +1 -0
- package/dist/primitives/index.cjs +398 -255
- package/dist/primitives/index.d.cts +65 -2
- package/dist/primitives/index.d.ts +65 -2
- package/dist/primitives/index.js +65 -5
- package/dist/styles/base.css +113 -0
- package/dist/styles/glass.css +75 -0
- package/dist/styles/index.css +43 -23
- package/dist/styles/semantic.css +167 -0
- package/dist/styles/theme.css +54 -24
- package/dist/styles/tokens/alpha.css +39 -0
- package/dist/styles/tokens/border-radius.css +17 -0
- package/dist/styles/tokens/chart-colors-dark.css +18 -0
- package/dist/styles/tokens/chart-colors-light.css +18 -0
- package/dist/styles/tokens/colors.css +251 -0
- package/dist/styles/tokens/mode-dark.css +101 -0
- package/dist/styles/tokens/mode-light.css +101 -0
- package/dist/styles/tokens/shadows.css +14 -0
- package/dist/styles/tokens/spacing.css +44 -0
- package/dist/styles/tokens/theme-bodhi.css +35 -0
- package/dist/styles/tokens/theme-slingshot.css +35 -0
- package/dist/styles/tokens/theme-sustain.css +35 -0
- package/dist/styles/tokens/typography.css +83 -0
- package/package.json +33 -40
- package/dist/AiChatPanel.cjs +0 -1603
- package/dist/AiChatPanel.cjs.map +0 -1
- package/dist/AiChatPanel.js +0 -1526
- package/dist/AiChatPanel.js.map +0 -1
- package/dist/BodhiLogo.cjs +0 -240
- package/dist/BodhiLogo.cjs.map +0 -1
- package/dist/BodhiLogo.js +0 -194
- package/dist/BodhiLogo.js.map +0 -1
- package/dist/Skeleton.cjs +0 -19
- package/dist/Skeleton.cjs.map +0 -1
- package/dist/Skeleton.js +0 -14
- package/dist/Skeleton.js.map +0 -1
- package/dist/SustainLogo.cjs +0 -415
- package/dist/SustainLogo.cjs.map +0 -1
- package/dist/SustainLogo.js +0 -378
- package/dist/SustainLogo.js.map +0 -1
- package/dist/contexts/index.cjs.map +0 -1
- package/dist/contexts/index.d.cts.map +0 -1
- package/dist/contexts/index.d.ts.map +0 -1
- package/dist/contexts/index.js.map +0 -1
- package/dist/layouts/index.d.cts.map +0 -1
- package/dist/layouts/index.d.ts.map +0 -1
- package/dist/layouts.cjs +0 -3245
- package/dist/layouts.cjs.map +0 -1
- package/dist/layouts.js +0 -3180
- package/dist/layouts.js.map +0 -1
- package/dist/patterns/index.cjs.map +0 -1
- package/dist/patterns/index.d.cts.map +0 -1
- package/dist/patterns/index.d.ts.map +0 -1
- package/dist/patterns/index.js.map +0 -1
- package/dist/primitives.cjs +0 -4292
- package/dist/primitives.cjs.map +0 -1
- package/dist/primitives.js +0 -2807
- package/dist/primitives.js.map +0 -1
- package/dist/styles/base/colors.css +0 -300
- package/dist/styles/base/component-tokens.css +0 -240
- package/dist/styles/base/elevation.css +0 -7
- package/dist/styles/base/fonts.css +0 -14
- package/dist/styles/base/global.css +0 -305
- package/dist/styles/base/radius.css +0 -22
- package/dist/styles/base/semantic-aliases.css +0 -53
- package/dist/styles/base/spacing.css +0 -33
- package/dist/styles/base/typography.css +0 -48
- package/dist/styles/generated/bodhi-vars.css +0 -34
- package/dist/styles/generated/dark.css +0 -87
- package/dist/styles/generated/light.css +0 -87
- package/dist/styles/generated/slingshot-vars.css +0 -34
- package/dist/styles/generated/sustain-vars.css +0 -34
- package/dist/styles/themes/bodhi.css +0 -166
- package/dist/styles/themes/slingshot.css +0 -144
- package/dist/styles/themes/sustain.css +0 -130
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_cn = require("../../cn.cjs");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
let class_variance_authority = require("class-variance-authority");
|
|
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-lg p-6 text-center text-balance md:p-12", {
|
|
7
|
+
variants: { variant: {
|
|
8
|
+
default: "",
|
|
9
|
+
outline: "border",
|
|
10
|
+
background: "bg-muted",
|
|
11
|
+
"outline-dashed": "border border-dashed"
|
|
12
|
+
} },
|
|
13
|
+
defaultVariants: { variant: "default" }
|
|
14
|
+
});
|
|
15
|
+
/** Centered empty-state container; compose Header/Media/Title/Description/Content inside it. */
|
|
16
|
+
function Empty({ className, variant = "default", ...props }) {
|
|
17
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
18
|
+
"data-slot": "empty",
|
|
19
|
+
"data-variant": variant,
|
|
20
|
+
className: require_cn.cn(emptyVariants({ variant }), className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** Groups the media, title, and description with centered alignment. */
|
|
25
|
+
function EmptyHeader({ className, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
27
|
+
"data-slot": "empty-header",
|
|
28
|
+
className: require_cn.cn("flex max-w-sm flex-col items-center gap-2 text-center", className),
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
}
|
|
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
|
+
variants: { variant: {
|
|
34
|
+
default: "bg-transparent",
|
|
35
|
+
icon: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"
|
|
36
|
+
} },
|
|
37
|
+
defaultVariants: { variant: "default" }
|
|
38
|
+
});
|
|
39
|
+
/** Holds the leading illustration or icon above the title. */
|
|
40
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
41
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
42
|
+
"data-slot": "empty-icon",
|
|
43
|
+
"data-variant": variant,
|
|
44
|
+
className: require_cn.cn(emptyMediaVariants({
|
|
45
|
+
variant,
|
|
46
|
+
className
|
|
47
|
+
})),
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** The primary heading line of the empty state. */
|
|
52
|
+
function EmptyTitle({ className, ...props }) {
|
|
53
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
54
|
+
"data-slot": "empty-title",
|
|
55
|
+
className: require_cn.cn("text-lg font-medium tracking-tight", className),
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/** Muted supporting copy explaining the empty state. */
|
|
60
|
+
function EmptyDescription({ className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
62
|
+
"data-slot": "empty-description",
|
|
63
|
+
className: require_cn.cn("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** Slot for actions or follow-up content below the header. */
|
|
68
|
+
function EmptyContent({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
70
|
+
"data-slot": "empty-content",
|
|
71
|
+
className: require_cn.cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className),
|
|
72
|
+
...props
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
exports.Empty = Empty;
|
|
77
|
+
exports.EmptyContent = EmptyContent;
|
|
78
|
+
exports.EmptyDescription = EmptyDescription;
|
|
79
|
+
exports.EmptyHeader = EmptyHeader;
|
|
80
|
+
exports.EmptyMedia = EmptyMedia;
|
|
81
|
+
exports.EmptyTitle = EmptyTitle;
|
|
82
|
+
exports.emptyVariants = emptyVariants;
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +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-lg 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\",\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-lg bg-muted text-foreground [&_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-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary\",\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,kHACA;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,2GACA,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"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { t as cn } from "../../cn.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
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-lg p-6 text-center text-balance md:p-12", {
|
|
6
|
+
variants: { variant: {
|
|
7
|
+
default: "",
|
|
8
|
+
outline: "border",
|
|
9
|
+
background: "bg-muted",
|
|
10
|
+
"outline-dashed": "border border-dashed"
|
|
11
|
+
} },
|
|
12
|
+
defaultVariants: { variant: "default" }
|
|
13
|
+
});
|
|
14
|
+
/** Centered empty-state container; compose Header/Media/Title/Description/Content inside it. */
|
|
15
|
+
function Empty({ className, variant = "default", ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx("div", {
|
|
17
|
+
"data-slot": "empty",
|
|
18
|
+
"data-variant": variant,
|
|
19
|
+
className: cn(emptyVariants({ variant }), className),
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/** Groups the media, title, and description with centered alignment. */
|
|
24
|
+
function EmptyHeader({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx("div", {
|
|
26
|
+
"data-slot": "empty-header",
|
|
27
|
+
className: cn("flex max-w-sm flex-col items-center gap-2 text-center", className),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const emptyMediaVariants = cva("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
32
|
+
variants: { variant: {
|
|
33
|
+
default: "bg-transparent",
|
|
34
|
+
icon: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"
|
|
35
|
+
} },
|
|
36
|
+
defaultVariants: { variant: "default" }
|
|
37
|
+
});
|
|
38
|
+
/** Holds the leading illustration or icon above the title. */
|
|
39
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsx("div", {
|
|
41
|
+
"data-slot": "empty-icon",
|
|
42
|
+
"data-variant": variant,
|
|
43
|
+
className: cn(emptyMediaVariants({
|
|
44
|
+
variant,
|
|
45
|
+
className
|
|
46
|
+
})),
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/** The primary heading line of the empty state. */
|
|
51
|
+
function EmptyTitle({ className, ...props }) {
|
|
52
|
+
return /* @__PURE__ */ jsx("div", {
|
|
53
|
+
"data-slot": "empty-title",
|
|
54
|
+
className: cn("text-lg font-medium tracking-tight", className),
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/** Muted supporting copy explaining the empty state. */
|
|
59
|
+
function EmptyDescription({ className, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx("div", {
|
|
61
|
+
"data-slot": "empty-description",
|
|
62
|
+
className: cn("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/** Slot for actions or follow-up content below the header. */
|
|
67
|
+
function EmptyContent({ className, ...props }) {
|
|
68
|
+
return /* @__PURE__ */ jsx("div", {
|
|
69
|
+
"data-slot": "empty-content",
|
|
70
|
+
className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className),
|
|
71
|
+
...props
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, emptyVariants };
|
|
76
|
+
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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-lg 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\",\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-lg bg-muted text-foreground [&_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-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary\",\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,kHACA;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,2GACA,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"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_cn = require("../../cn.cjs");
|
|
3
|
+
const require_primitives_Separator_index = require("../Separator/index.cjs");
|
|
4
|
+
const require_primitives_Label_index = require("../Label/index.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let class_variance_authority = require("class-variance-authority");
|
|
8
|
+
//#region src/primitives/Field/Field.tsx
|
|
9
|
+
/** A `<fieldset>` wrapper that groups related fields with consistent spacing. */
|
|
10
|
+
function FieldSet({ className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("fieldset", {
|
|
12
|
+
"data-slot": "field-set",
|
|
13
|
+
className: require_cn.cn("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className),
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** The caption for a `FieldSet`, rendered as a `<legend>`. */
|
|
18
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
19
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("legend", {
|
|
20
|
+
"data-slot": "field-legend",
|
|
21
|
+
"data-variant": variant,
|
|
22
|
+
className: require_cn.cn("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className),
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/** A container that stacks multiple `Field`s with group-level spacing and a responsive container. */
|
|
27
|
+
function FieldGroup({ className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
29
|
+
"data-slot": "field-group",
|
|
30
|
+
className: require_cn.cn("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", className),
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const fieldVariants = (0, class_variance_authority.cva)("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
|
|
35
|
+
variants: { orientation: {
|
|
36
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
37
|
+
horizontal: [
|
|
38
|
+
"flex-row items-center",
|
|
39
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
40
|
+
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
41
|
+
],
|
|
42
|
+
responsive: [
|
|
43
|
+
"flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto",
|
|
44
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
45
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
46
|
+
]
|
|
47
|
+
} },
|
|
48
|
+
defaultVariants: { orientation: "vertical" }
|
|
49
|
+
});
|
|
50
|
+
/** A single labelled form field that lays out a control with its label, description, and error. */
|
|
51
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
|
52
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
53
|
+
role: "group",
|
|
54
|
+
"data-slot": "field",
|
|
55
|
+
"data-orientation": orientation,
|
|
56
|
+
className: require_cn.cn(fieldVariants({ orientation }), className),
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** Stacks a label and description next to a control (used in horizontal checkbox/radio fields). */
|
|
61
|
+
function FieldContent({ className, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
63
|
+
"data-slot": "field-content",
|
|
64
|
+
className: require_cn.cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className),
|
|
65
|
+
...props
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** The accessible label for a field's control; wraps the `Label` primitive. */
|
|
69
|
+
function FieldLabel({ className, ...props }) {
|
|
70
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Label_index.Label, {
|
|
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-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4", "has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10", className),
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** A non-`<label>` title for a field group, styled like a label but not bound to a control. */
|
|
77
|
+
function FieldTitle({ className, ...props }) {
|
|
78
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
79
|
+
"data-slot": "field-label",
|
|
80
|
+
className: require_cn.cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className),
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/** Muted helper text shown beneath (or beside) a field's control. */
|
|
85
|
+
function FieldDescription({ className, ...props }) {
|
|
86
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
87
|
+
"data-slot": "field-description",
|
|
88
|
+
className: require_cn.cn("text-sm leading-normal font-normal text-muted-foreground 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", className),
|
|
89
|
+
...props
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** A horizontal divider between groups of fields, optionally with centered label content. */
|
|
93
|
+
function FieldSeparator({ children, className, ...props }) {
|
|
94
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
95
|
+
"data-slot": "field-separator",
|
|
96
|
+
"data-content": !!children,
|
|
97
|
+
className: require_cn.cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
|
|
98
|
+
...props,
|
|
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-background px-2 text-muted-foreground",
|
|
101
|
+
"data-slot": "field-separator-content",
|
|
102
|
+
children
|
|
103
|
+
})]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/** A destructive `role="alert"` message for a field, rendered from `children` or a list of `errors`. */
|
|
107
|
+
function FieldError({ className, children, errors, ...props }) {
|
|
108
|
+
const content = (0, react.useMemo)(() => {
|
|
109
|
+
if (children) return children;
|
|
110
|
+
if (!errors?.length) return null;
|
|
111
|
+
const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];
|
|
112
|
+
if (uniqueErrors?.length === 1) return uniqueErrors[0]?.message;
|
|
113
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
114
|
+
className: "ml-4 flex list-disc flex-col gap-1",
|
|
115
|
+
children: uniqueErrors.map((error, index) => error?.message && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: error.message }, index))
|
|
116
|
+
});
|
|
117
|
+
}, [children, errors]);
|
|
118
|
+
if (!content) return null;
|
|
119
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
120
|
+
role: "alert",
|
|
121
|
+
"data-slot": "field-error",
|
|
122
|
+
className: require_cn.cn("text-sm font-normal text-destructive", className),
|
|
123
|
+
...props,
|
|
124
|
+
children: content
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
exports.Field = Field;
|
|
129
|
+
exports.FieldContent = FieldContent;
|
|
130
|
+
exports.FieldDescription = FieldDescription;
|
|
131
|
+
exports.FieldError = FieldError;
|
|
132
|
+
exports.FieldGroup = FieldGroup;
|
|
133
|
+
exports.FieldLabel = FieldLabel;
|
|
134
|
+
exports.FieldLegend = FieldLegend;
|
|
135
|
+
exports.FieldSeparator = FieldSeparator;
|
|
136
|
+
exports.FieldSet = FieldSet;
|
|
137
|
+
exports.FieldTitle = FieldTitle;
|
|
138
|
+
|
|
139
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +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 dark:has-data-[state=checked]:bg-primary/10\",\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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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as FieldGroup, c as FieldSeparator, i as FieldError, l as FieldSet, n as FieldContent, o as FieldLabel, r as FieldDescription, s as FieldLegend, t as Field, u as FieldTitle } from "../../index26.cjs";
|
|
2
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as FieldGroup, c as FieldSeparator, i as FieldError, l as FieldSet, n as FieldContent, o as FieldLabel, r as FieldDescription, s as FieldLegend, t as Field, u as FieldTitle } from "../../index26.js";
|
|
2
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { t as cn } from "../../cn.js";
|
|
2
|
+
import { Separator } from "../Separator/index.js";
|
|
3
|
+
import { Label } from "../Label/index.js";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
//#region src/primitives/Field/Field.tsx
|
|
8
|
+
/** A `<fieldset>` wrapper that groups related fields with consistent spacing. */
|
|
9
|
+
function FieldSet({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx("fieldset", {
|
|
11
|
+
"data-slot": "field-set",
|
|
12
|
+
className: cn("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/** The caption for a `FieldSet`, rendered as a `<legend>`. */
|
|
17
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx("legend", {
|
|
19
|
+
"data-slot": "field-legend",
|
|
20
|
+
"data-variant": variant,
|
|
21
|
+
className: cn("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className),
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** A container that stacks multiple `Field`s with group-level spacing and a responsive container. */
|
|
26
|
+
function FieldGroup({ className, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx("div", {
|
|
28
|
+
"data-slot": "field-group",
|
|
29
|
+
className: cn("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", className),
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const fieldVariants = cva("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
|
|
34
|
+
variants: { orientation: {
|
|
35
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
36
|
+
horizontal: [
|
|
37
|
+
"flex-row items-center",
|
|
38
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
39
|
+
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
40
|
+
],
|
|
41
|
+
responsive: [
|
|
42
|
+
"flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto",
|
|
43
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
44
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
45
|
+
]
|
|
46
|
+
} },
|
|
47
|
+
defaultVariants: { orientation: "vertical" }
|
|
48
|
+
});
|
|
49
|
+
/** A single labelled form field that lays out a control with its label, description, and error. */
|
|
50
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
|
51
|
+
return /* @__PURE__ */ jsx("div", {
|
|
52
|
+
role: "group",
|
|
53
|
+
"data-slot": "field",
|
|
54
|
+
"data-orientation": orientation,
|
|
55
|
+
className: cn(fieldVariants({ orientation }), className),
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/** Stacks a label and description next to a control (used in horizontal checkbox/radio fields). */
|
|
60
|
+
function FieldContent({ className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsx("div", {
|
|
62
|
+
"data-slot": "field-content",
|
|
63
|
+
className: cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className),
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** The accessible label for a field's control; wraps the `Label` primitive. */
|
|
68
|
+
function FieldLabel({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(Label, {
|
|
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-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4", "has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10", className),
|
|
72
|
+
...props
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/** A non-`<label>` title for a field group, styled like a label but not bound to a control. */
|
|
76
|
+
function FieldTitle({ className, ...props }) {
|
|
77
|
+
return /* @__PURE__ */ jsx("div", {
|
|
78
|
+
"data-slot": "field-label",
|
|
79
|
+
className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className),
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/** Muted helper text shown beneath (or beside) a field's control. */
|
|
84
|
+
function FieldDescription({ className, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsx("p", {
|
|
86
|
+
"data-slot": "field-description",
|
|
87
|
+
className: cn("text-sm leading-normal font-normal text-muted-foreground 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", className),
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/** A horizontal divider between groups of fields, optionally with centered label content. */
|
|
92
|
+
function FieldSeparator({ children, className, ...props }) {
|
|
93
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
94
|
+
"data-slot": "field-separator",
|
|
95
|
+
"data-content": !!children,
|
|
96
|
+
className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
|
|
97
|
+
...props,
|
|
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-background px-2 text-muted-foreground",
|
|
100
|
+
"data-slot": "field-separator-content",
|
|
101
|
+
children
|
|
102
|
+
})]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/** A destructive `role="alert"` message for a field, rendered from `children` or a list of `errors`. */
|
|
106
|
+
function FieldError({ className, children, errors, ...props }) {
|
|
107
|
+
const content = useMemo(() => {
|
|
108
|
+
if (children) return children;
|
|
109
|
+
if (!errors?.length) return null;
|
|
110
|
+
const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];
|
|
111
|
+
if (uniqueErrors?.length === 1) return uniqueErrors[0]?.message;
|
|
112
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
113
|
+
className: "ml-4 flex list-disc flex-col gap-1",
|
|
114
|
+
children: uniqueErrors.map((error, index) => error?.message && /* @__PURE__ */ jsx("li", { children: error.message }, index))
|
|
115
|
+
});
|
|
116
|
+
}, [children, errors]);
|
|
117
|
+
if (!content) return null;
|
|
118
|
+
return /* @__PURE__ */ jsx("div", {
|
|
119
|
+
role: "alert",
|
|
120
|
+
"data-slot": "field-error",
|
|
121
|
+
className: cn("text-sm font-normal text-destructive", className),
|
|
122
|
+
...props,
|
|
123
|
+
children: content
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
128
|
+
|
|
129
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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-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 dark:has-data-[state=checked]:bg-primary/10\",\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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"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("../../chunk.cjs");
|
|
3
|
+
const require_cn = require("../../cn.cjs");
|
|
4
|
+
const require_primitives_Field_index = require("../Field/index.cjs");
|
|
5
|
+
let react = require("react");
|
|
6
|
+
react = require_chunk.__toESM(react);
|
|
7
|
+
let radix_ui = require("radix-ui");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let react_hook_form = require("react-hook-form");
|
|
10
|
+
//#region src/primitives/Form/Form.tsx
|
|
11
|
+
/** Root provider that shares one react-hook-form instance with all nested form pieces. */
|
|
12
|
+
const Form = react_hook_form.FormProvider;
|
|
13
|
+
const FormFieldContext = react.createContext({});
|
|
14
|
+
/** Connects a single input to the form via RHF's `Controller`, exposing `field` to its render prop. */
|
|
15
|
+
const FormField = ({ ...props }) => {
|
|
16
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FormFieldContext.Provider, {
|
|
17
|
+
value: { name: props.name },
|
|
18
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_hook_form.Controller, { ...props })
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
/** Hook for form pieces to read the current field's id, name, ARIA ids, and validation state. */
|
|
22
|
+
const useFormField = () => {
|
|
23
|
+
const fieldContext = react.useContext(FormFieldContext);
|
|
24
|
+
const itemContext = react.useContext(FormItemContext);
|
|
25
|
+
const { getFieldState } = (0, react_hook_form.useFormContext)();
|
|
26
|
+
const formState = (0, react_hook_form.useFormState)({ name: fieldContext.name });
|
|
27
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
28
|
+
if (!fieldContext) throw new Error("useFormField should be used within <FormField>");
|
|
29
|
+
const { id } = itemContext;
|
|
30
|
+
return {
|
|
31
|
+
id,
|
|
32
|
+
name: fieldContext.name,
|
|
33
|
+
formItemId: `${id}-form-item`,
|
|
34
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
35
|
+
formMessageId: `${id}-form-item-message`,
|
|
36
|
+
...fieldState
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
const FormItemContext = react.createContext({});
|
|
40
|
+
/** Wraps one field, generating an id so its label, control, and messages stay linked. */
|
|
41
|
+
function FormItem({ ...props }) {
|
|
42
|
+
const id = react.useId();
|
|
43
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FormItemContext.Provider, {
|
|
44
|
+
value: { id },
|
|
45
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Field_index.Field, {
|
|
46
|
+
"data-slot": "form-item",
|
|
47
|
+
...props
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** Field label wired to the control's id and tinted destructive when the field is invalid. */
|
|
52
|
+
function FormLabel({ className, ...props }) {
|
|
53
|
+
const { error, formItemId } = useFormField();
|
|
54
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Field_index.FieldLabel, {
|
|
55
|
+
"data-slot": "form-label",
|
|
56
|
+
"data-error": !!error,
|
|
57
|
+
className: require_cn.cn("data-[error=true]:text-destructive", className),
|
|
58
|
+
htmlFor: formItemId,
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/** Slots the actual input, applying the field's id, `aria-describedby`, and `aria-invalid`. */
|
|
63
|
+
function FormControl({ ...props }) {
|
|
64
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
65
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(radix_ui.Slot.Root, {
|
|
66
|
+
"data-slot": "form-control",
|
|
67
|
+
id: formItemId,
|
|
68
|
+
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
69
|
+
"aria-invalid": !!error,
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** Helper text for a field, linked to its control via `aria-describedby`. */
|
|
74
|
+
function FormDescription({ ...props }) {
|
|
75
|
+
const { formDescriptionId } = useFormField();
|
|
76
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Field_index.FieldDescription, {
|
|
77
|
+
"data-slot": "form-description",
|
|
78
|
+
id: formDescriptionId,
|
|
79
|
+
...props
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/** Renders the field's validation error (or `children`), and nothing when there is no message. */
|
|
83
|
+
function FormMessage({ children, ...props }) {
|
|
84
|
+
const { error, formMessageId } = useFormField();
|
|
85
|
+
const body = error ? String(error?.message ?? "") : children;
|
|
86
|
+
if (!body) return null;
|
|
87
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Field_index.FieldError, {
|
|
88
|
+
"data-slot": "form-message",
|
|
89
|
+
id: formMessageId,
|
|
90
|
+
...props,
|
|
91
|
+
children: body
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
exports.Form = Form;
|
|
96
|
+
exports.FormControl = FormControl;
|
|
97
|
+
exports.FormDescription = FormDescription;
|
|
98
|
+
exports.FormField = FormField;
|
|
99
|
+
exports.FormItem = FormItem;
|
|
100
|
+
exports.FormLabel = FormLabel;
|
|
101
|
+
exports.FormMessage = FormMessage;
|
|
102
|
+
exports.useFormField = useFormField;
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=index.cjs.map
|