@psnext/design-system 1.1.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 +137 -30
- 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/{ThemeProvider.cjs → Logo.cjs} +2 -1075
- package/dist/Logo.cjs.map +1 -0
- package/dist/{ThemeProvider.js → Logo.js} +4 -704
- 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/{utils.cjs → chunk.cjs} +0 -39
- 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/index.cjs +413 -346
- package/dist/index.d.cts +12 -1996
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +12 -1996
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -5
- 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 +44 -4
- package/dist/index2.d.cts.map +1 -0
- package/dist/index2.d.ts +44 -4
- package/dist/index2.d.ts.map +1 -0
- 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/{Stack.cjs → layouts/Stack/index.cjs} +7 -15
- 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/{Stack.js → layouts/Stack/index.js} +4 -3
- 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 -100
- package/dist/layouts/index.d.cts +5 -76
- package/dist/layouts/index.d.ts +5 -76
- package/dist/layouts/index.js +4 -91
- 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 -1124
- package/dist/patterns/index.d.cts +7 -410
- package/dist/patterns/index.d.ts +7 -410
- package/dist/patterns/index.js +6 -1088
- 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 -335
- package/dist/primitives/index.d.cts +65 -3
- package/dist/primitives/index.d.ts +65 -3
- package/dist/primitives/index.js +65 -3
- package/dist/styles/base.css +70 -0
- package/dist/styles/semantic.css +62 -2
- package/dist/styles/theme.css +12 -0
- package/package.json +21 -2
- package/dist/Stack.cjs.map +0 -1
- package/dist/Stack.js.map +0 -1
- package/dist/ThemeProvider.cjs.map +0 -1
- package/dist/ThemeProvider.d.cts +0 -85
- package/dist/ThemeProvider.d.cts.map +0 -1
- package/dist/ThemeProvider.d.ts +0 -85
- package/dist/ThemeProvider.d.ts.map +0 -1
- package/dist/ThemeProvider.js.map +0 -1
- package/dist/layouts/index.cjs.map +0 -1
- package/dist/layouts/index.d.cts.map +0 -1
- package/dist/layouts/index.d.ts.map +0 -1
- package/dist/layouts/index.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 -6979
- package/dist/primitives.cjs.map +0 -1
- package/dist/primitives.js +0 -5357
- package/dist/primitives.js.map +0 -1
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.js +0 -27
- package/dist/utils.js.map +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
//#region src/primitives/Input/Input.tsx
|
|
5
|
+
const inputVariants = (0, require("class-variance-authority").cva)(require_cn.cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input bg-input-background flex w-full min-w-0 border transition-[color,box-shadow] outline-none file:inline-flex file:border-0 file:bg-transparent file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"), {
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
xs: "h-6 px-2 py-0.5 text-xs file:h-5 file:text-xs",
|
|
9
|
+
sm: "h-8 px-2.5 py-1 text-sm file:h-6 file:text-xs",
|
|
10
|
+
default: "h-9 px-3 py-1 text-base md:text-sm file:h-7 file:text-sm",
|
|
11
|
+
lg: "h-10 px-4 py-2 text-base file:h-8 file:text-sm"
|
|
12
|
+
},
|
|
13
|
+
shape: {
|
|
14
|
+
default: "rounded-md",
|
|
15
|
+
round: "rounded-full"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: "default",
|
|
20
|
+
shape: "default"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
/** Styled text input that supports the Figma size and roundness axes; forwards all native `<input>` props. */
|
|
24
|
+
function Input({ className, type, size, shape, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
26
|
+
type,
|
|
27
|
+
"data-slot": "input",
|
|
28
|
+
className: require_cn.cn(inputVariants({
|
|
29
|
+
size,
|
|
30
|
+
shape
|
|
31
|
+
}), className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
exports.Input = Input;
|
|
37
|
+
exports.inputVariants = inputVariants;
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["cn"],"sources":["../../../src/primitives/Input/Input.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nconst inputVariants = cva(\n cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input bg-input-background flex w-full min-w-0 border transition-[color,box-shadow] outline-none file:inline-flex file:border-0 file:bg-transparent file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n ),\n {\n variants: {\n // Sizes map to the Figma \"Input\" spec: Mini 24px / Small 32px / Regular 36px / Large 40px.\n size: {\n xs: \"h-6 px-2 py-0.5 text-xs file:h-5 file:text-xs\",\n sm: \"h-8 px-2.5 py-1 text-sm file:h-6 file:text-xs\",\n default: \"h-9 px-3 py-1 text-base md:text-sm file:h-7 file:text-sm\",\n lg: \"h-10 px-4 py-2 text-base file:h-8 file:text-sm\",\n },\n // Roundness: Default (rounded-md) and Round (pill).\n shape: {\n default: \"rounded-md\",\n round: \"rounded-full\",\n },\n },\n defaultVariants: {\n size: \"default\",\n shape: \"default\",\n },\n },\n);\n\n/** Styled text input that supports the Figma size and roundness axes; forwards all native `<input>` props. */\nfunction Input({\n className,\n type,\n /** Height/typography preset — Mini (`xs`), Small (`sm`), Regular (`default`), or Large (`lg`). */\n size,\n /** Corner roundness — `default` (rounded-md) or `round` (pill). */\n shape,\n ...props\n}: Omit<React.ComponentProps<\"input\">, \"size\"> & VariantProps<typeof inputVariants>) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(inputVariants({ size, shape }), className)}\n {...props}\n />\n );\n}\n\nexport { Input, inputVariants };\n"],"mappings":";;;;AAKA,MAAM,iBAAA,qCAAA,EAAA,KACJA,WAAAA,GACE,0XACA,iFACA,wGACF,GACA;CACE,UAAU;EAER,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,SAAS;GACT,IAAI;EACN;EAEA,OAAO;GACL,SAAS;GACT,OAAO;EACT;CACF;CACA,iBAAiB;EACf,MAAM;EACN,OAAO;CACT;AACF,CACF;;AAGA,SAAS,MAAM,EACb,WACA,MAEA,MAEA,OACA,GAAG,SACgF;CACnF,OACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;EACQ;EACN,aAAU;EACV,WAAWA,WAAAA,GAAG,cAAc;GAAE;GAAM;EAAM,CAAC,GAAG,SAAS;EACvD,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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/Input/Input.tsx
|
|
5
|
+
const inputVariants = cva(cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input bg-input-background flex w-full min-w-0 border transition-[color,box-shadow] outline-none file:inline-flex file:border-0 file:bg-transparent file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"), {
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
xs: "h-6 px-2 py-0.5 text-xs file:h-5 file:text-xs",
|
|
9
|
+
sm: "h-8 px-2.5 py-1 text-sm file:h-6 file:text-xs",
|
|
10
|
+
default: "h-9 px-3 py-1 text-base md:text-sm file:h-7 file:text-sm",
|
|
11
|
+
lg: "h-10 px-4 py-2 text-base file:h-8 file:text-sm"
|
|
12
|
+
},
|
|
13
|
+
shape: {
|
|
14
|
+
default: "rounded-md",
|
|
15
|
+
round: "rounded-full"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: "default",
|
|
20
|
+
shape: "default"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
/** Styled text input that supports the Figma size and roundness axes; forwards all native `<input>` props. */
|
|
24
|
+
function Input({ className, type, size, shape, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx("input", {
|
|
26
|
+
type,
|
|
27
|
+
"data-slot": "input",
|
|
28
|
+
className: cn(inputVariants({
|
|
29
|
+
size,
|
|
30
|
+
shape
|
|
31
|
+
}), className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { Input, inputVariants };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Input/Input.tsx"],"sourcesContent":["import { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\nconst inputVariants = cva(\n cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input bg-input-background flex w-full min-w-0 border transition-[color,box-shadow] outline-none file:inline-flex file:border-0 file:bg-transparent file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n ),\n {\n variants: {\n // Sizes map to the Figma \"Input\" spec: Mini 24px / Small 32px / Regular 36px / Large 40px.\n size: {\n xs: \"h-6 px-2 py-0.5 text-xs file:h-5 file:text-xs\",\n sm: \"h-8 px-2.5 py-1 text-sm file:h-6 file:text-xs\",\n default: \"h-9 px-3 py-1 text-base md:text-sm file:h-7 file:text-sm\",\n lg: \"h-10 px-4 py-2 text-base file:h-8 file:text-sm\",\n },\n // Roundness: Default (rounded-md) and Round (pill).\n shape: {\n default: \"rounded-md\",\n round: \"rounded-full\",\n },\n },\n defaultVariants: {\n size: \"default\",\n shape: \"default\",\n },\n },\n);\n\n/** Styled text input that supports the Figma size and roundness axes; forwards all native `<input>` props. */\nfunction Input({\n className,\n type,\n /** Height/typography preset — Mini (`xs`), Small (`sm`), Regular (`default`), or Large (`lg`). */\n size,\n /** Corner roundness — `default` (rounded-md) or `round` (pill). */\n shape,\n ...props\n}: Omit<React.ComponentProps<\"input\">, \"size\"> & VariantProps<typeof inputVariants>) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(inputVariants({ size, shape }), className)}\n {...props}\n />\n );\n}\n\nexport { Input, inputVariants };\n"],"mappings":";;;;AAKA,MAAM,gBAAgB,IACpB,GACE,0XACA,iFACA,wGACF,GACA;CACE,UAAU;EAER,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,SAAS;GACT,IAAI;EACN;EAEA,OAAO;GACL,SAAS;GACT,OAAO;EACT;CACF;CACA,iBAAiB;EACf,MAAM;EACN,OAAO;CACT;AACF,CACF;;AAGA,SAAS,MAAM,EACb,WACA,MAEA,MAEA,OACA,GAAG,SACgF;CACnF,OACE,oBAAC,SAAD;EACQ;EACN,aAAU;EACV,WAAW,GAAG,cAAc;GAAE;GAAM;EAAM,CAAC,GAAG,SAAS;EACvD,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_cn = require("../../cn.cjs");
|
|
3
|
+
const require_primitives_Button_index = require("../Button/index.cjs");
|
|
4
|
+
const require_primitives_Input_index = require("../Input/index.cjs");
|
|
5
|
+
const require_primitives_Textarea_index = require("../Textarea/index.cjs");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let class_variance_authority = require("class-variance-authority");
|
|
8
|
+
//#region src/primitives/InputGroup/InputGroup.tsx
|
|
9
|
+
/** Bordered container that groups a control (input/textarea) with addons, buttons, and text into one focusable field. */
|
|
10
|
+
function InputGroup({ className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
12
|
+
"data-slot": "input-group",
|
|
13
|
+
role: "group",
|
|
14
|
+
className: require_cn.cn("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30", "h-9 min-w-0 has-[>textarea]:h-auto", "has-[>[data-align=inline-start]]:[&>input]:pl-2", "has-[>[data-align=inline-end]]:[&>input]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3", "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50", "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", className),
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const inputGroupAddonVariants = (0, class_variance_authority.cva)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
19
|
+
variants: { align: {
|
|
20
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
21
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
22
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
|
|
23
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"
|
|
24
|
+
} },
|
|
25
|
+
defaultVariants: { align: "inline-start" }
|
|
26
|
+
});
|
|
27
|
+
/** A leading/trailing or stacked slot for icons, text, or buttons; clicking it focuses the group's input. */
|
|
28
|
+
function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
29
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
30
|
+
role: "group",
|
|
31
|
+
"data-slot": "input-group-addon",
|
|
32
|
+
"data-align": align,
|
|
33
|
+
className: require_cn.cn(inputGroupAddonVariants({ align }), className),
|
|
34
|
+
onClick: (e) => {
|
|
35
|
+
if (e.target.closest("button")) return;
|
|
36
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
37
|
+
},
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const inputGroupButtonVariants = (0, class_variance_authority.cva)("flex items-center gap-2 text-sm shadow-none", {
|
|
42
|
+
variants: { size: {
|
|
43
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
|
|
44
|
+
sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
|
|
45
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
46
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
47
|
+
} },
|
|
48
|
+
defaultVariants: { size: "xs" }
|
|
49
|
+
});
|
|
50
|
+
/** A compact Button sized to sit inside an addon without overflowing the group's height. */
|
|
51
|
+
function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
|
|
52
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Button_index.Button, {
|
|
53
|
+
type,
|
|
54
|
+
"data-size": size,
|
|
55
|
+
variant,
|
|
56
|
+
className: require_cn.cn(inputGroupButtonVariants({ size }), className),
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** Muted inline text for prefixes, suffixes, or counts placed inside an addon (e.g. `$`, `USD`, `12 results`). */
|
|
61
|
+
function InputGroupText({ className, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
63
|
+
className: require_cn.cn("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** The Input control for the group: borderless and transparent so the group container provides the chrome. */
|
|
68
|
+
function InputGroupInput({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Input_index.Input, {
|
|
70
|
+
"data-slot": "input-group-control",
|
|
71
|
+
className: require_cn.cn("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
72
|
+
...props
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/** The Textarea control for the group: borderless, transparent, and non-resizing so the group provides the chrome. */
|
|
76
|
+
function InputGroupTextarea({ className, ...props }) {
|
|
77
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Textarea_index.Textarea, {
|
|
78
|
+
"data-slot": "input-group-control",
|
|
79
|
+
className: require_cn.cn("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
exports.InputGroup = InputGroup;
|
|
85
|
+
exports.InputGroupAddon = InputGroupAddon;
|
|
86
|
+
exports.InputGroupButton = InputGroupButton;
|
|
87
|
+
exports.InputGroupInput = InputGroupInput;
|
|
88
|
+
exports.InputGroupText = InputGroupText;
|
|
89
|
+
exports.InputGroupTextarea = InputGroupTextarea;
|
|
90
|
+
|
|
91
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["cn","Button","Input","Textarea"],"sources":["../../../src/primitives/InputGroup/InputGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { Button } from \"@/primitives/Button\";\nimport { Input } from \"@/primitives/Input\";\nimport { Textarea } from \"@/primitives/Textarea\";\nimport { cn } from \"@/utils\";\n\n/** Bordered container that groups a control (input/textarea) with addons, buttons, and text into one focusable field. */\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30\",\n \"h-9 min-w-0 has-[>textarea]:h-auto\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3\",\n\n // Focus state.\n \"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50\",\n\n // Error state.\n \"has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40\",\n\n className,\n )}\n {...props}\n />\n );\n}\n\nconst inputGroupAddonVariants = cva(\n \"flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n align: {\n \"inline-start\": \"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]\",\n \"inline-end\": \"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]\",\n \"block-start\":\n \"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3\",\n \"block-end\":\n \"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n },\n);\n\n/** A leading/trailing or stacked slot for icons, text, or buttons; clicking it focuses the group's input. */\nfunction InputGroupAddon({\n className,\n /** Where the addon sits relative to the control: inline (left/right) or block (top/bottom). */\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return;\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus();\n }}\n {...props}\n />\n );\n}\n\nconst inputGroupButtonVariants = cva(\"flex items-center gap-2 text-sm shadow-none\", {\n variants: {\n size: {\n xs: \"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5\",\n sm: \"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5\",\n \"icon-xs\": \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n});\n\n/** A compact Button sized to sit inside an addon without overflowing the group's height. */\nfunction InputGroupButton({\n className,\n /** The button's HTML type; defaults to `\"button\"` so it does not submit forms. */\n type = \"button\",\n /** Visual style forwarded to the underlying Button; defaults to `\"ghost\"`. */\n variant = \"ghost\",\n /** Compact sizing tuned for the group: text (`xs`/`sm`) or square icon (`icon-xs`/`icon-sm`). */\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n );\n}\n\n/** Muted inline text for prefixes, suffixes, or counts placed inside an addon (e.g. `$`, `USD`, `12 results`). */\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** The Input control for the group: borderless and transparent so the group container provides the chrome. */\nfunction InputGroupInput({ className, ...props }: React.ComponentProps<typeof Input>) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** The Textarea control for the group: borderless, transparent, and non-resizing so the group provides the chrome. */\nfunction InputGroupTextarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <Textarea\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n};\n"],"mappings":";;;;;;;;;AAWA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,MAAK;EACL,WAAWA,WAAAA,GACT,4JACA,sCAGA,mDACA,iDACA,kIACA,4HAGA,mMAGA,kLAEA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,2BAAA,GAAA,yBAAA,KACJ,2PACA;CACE,UAAU,EACR,OAAO;EACL,gBAAgB;EAChB,cAAc;EACd,eACE;EACF,aACE;CACJ,EACF;CACA,iBAAiB,EACf,OAAO,eACT;AACF,CACF;;AAGA,SAAS,gBAAgB,EACvB,WAEA,QAAQ,gBACR,GAAG,SAC0E;CAC7E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,MAAK;EACL,aAAU;EACV,cAAY;EACZ,WAAWA,WAAAA,GAAG,wBAAwB,EAAE,MAAM,CAAC,GAAG,SAAS;EAC3D,UAAU,MAAM;GACd,IAAK,EAAE,OAAuB,QAAQ,QAAQ,GAC5C;GAEF,EAAE,cAAc,eAAe,cAAc,OAAO,GAAG,MAAM;EAC/D;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,4BAAA,GAAA,yBAAA,KAA+B,+CAA+C;CAClF,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,WAAW;EACX,WAAW;CACb,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CAAC;;AAGD,SAAS,iBAAiB,EACxB,WAEA,OAAO,UAEP,UAAU,SAEV,OAAO,MACP,GAAG,SAE4C;CAC/C,OACE,iBAAA,GAAA,kBAAA,KAACC,gCAAAA,QAAD;EACQ;EACN,aAAW;EACF;EACT,WAAWD,WAAAA,GAAG,yBAAyB,EAAE,KAAK,CAAC,GAAG,SAAS;EAC3D,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,eAAe,EAAE,WAAW,GAAG,SAAuC;CAC7E,OACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;EACE,WAAWA,WAAAA,GACT,0HACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAA6C;CACpF,OACE,iBAAA,GAAA,kBAAA,KAACE,+BAAAA,OAAD;EACE,aAAU;EACV,WAAWF,WAAAA,GACT,oGACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAA2C;CACrF,OACE,iBAAA,GAAA,kBAAA,KAACG,kCAAAA,UAAD;EACE,aAAU;EACV,WAAWH,WAAAA,GACT,qHACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as InputGroupText, i as InputGroupInput, n as InputGroupAddon, o as InputGroupTextarea, r as InputGroupButton, t as InputGroup } from "../../index33.cjs";
|
|
2
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { t as cn } from "../../cn.js";
|
|
2
|
+
import { Button } from "../Button/index.js";
|
|
3
|
+
import { Input } from "../Input/index.js";
|
|
4
|
+
import { Textarea } from "../Textarea/index.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
//#region src/primitives/InputGroup/InputGroup.tsx
|
|
8
|
+
/** Bordered container that groups a control (input/textarea) with addons, buttons, and text into one focusable field. */
|
|
9
|
+
function InputGroup({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx("div", {
|
|
11
|
+
"data-slot": "input-group",
|
|
12
|
+
role: "group",
|
|
13
|
+
className: cn("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30", "h-9 min-w-0 has-[>textarea]:h-auto", "has-[>[data-align=inline-start]]:[&>input]:pl-2", "has-[>[data-align=inline-end]]:[&>input]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3", "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50", "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", className),
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const inputGroupAddonVariants = cva("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
18
|
+
variants: { align: {
|
|
19
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
20
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
21
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
|
|
22
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"
|
|
23
|
+
} },
|
|
24
|
+
defaultVariants: { align: "inline-start" }
|
|
25
|
+
});
|
|
26
|
+
/** A leading/trailing or stacked slot for icons, text, or buttons; clicking it focuses the group's input. */
|
|
27
|
+
function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx("div", {
|
|
29
|
+
role: "group",
|
|
30
|
+
"data-slot": "input-group-addon",
|
|
31
|
+
"data-align": align,
|
|
32
|
+
className: cn(inputGroupAddonVariants({ align }), className),
|
|
33
|
+
onClick: (e) => {
|
|
34
|
+
if (e.target.closest("button")) return;
|
|
35
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
36
|
+
},
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
|
|
41
|
+
variants: { size: {
|
|
42
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
|
|
43
|
+
sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
|
|
44
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
45
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
46
|
+
} },
|
|
47
|
+
defaultVariants: { size: "xs" }
|
|
48
|
+
});
|
|
49
|
+
/** A compact Button sized to sit inside an addon without overflowing the group's height. */
|
|
50
|
+
function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
|
|
51
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
52
|
+
type,
|
|
53
|
+
"data-size": size,
|
|
54
|
+
variant,
|
|
55
|
+
className: cn(inputGroupButtonVariants({ size }), className),
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/** Muted inline text for prefixes, suffixes, or counts placed inside an addon (e.g. `$`, `USD`, `12 results`). */
|
|
60
|
+
function InputGroupText({ className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsx("span", {
|
|
62
|
+
className: cn("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/** The Input control for the group: borderless and transparent so the group container provides the chrome. */
|
|
67
|
+
function InputGroupInput({ className, ...props }) {
|
|
68
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
69
|
+
"data-slot": "input-group-control",
|
|
70
|
+
className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
71
|
+
...props
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/** The Textarea control for the group: borderless, transparent, and non-resizing so the group provides the chrome. */
|
|
75
|
+
function InputGroupTextarea({ className, ...props }) {
|
|
76
|
+
return /* @__PURE__ */ jsx(Textarea, {
|
|
77
|
+
"data-slot": "input-group-control",
|
|
78
|
+
className: cn("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
79
|
+
...props
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
84
|
+
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/InputGroup/InputGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { Button } from \"@/primitives/Button\";\nimport { Input } from \"@/primitives/Input\";\nimport { Textarea } from \"@/primitives/Textarea\";\nimport { cn } from \"@/utils\";\n\n/** Bordered container that groups a control (input/textarea) with addons, buttons, and text into one focusable field. */\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30\",\n \"h-9 min-w-0 has-[>textarea]:h-auto\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3\",\n\n // Focus state.\n \"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50\",\n\n // Error state.\n \"has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40\",\n\n className,\n )}\n {...props}\n />\n );\n}\n\nconst inputGroupAddonVariants = cva(\n \"flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n align: {\n \"inline-start\": \"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]\",\n \"inline-end\": \"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]\",\n \"block-start\":\n \"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3\",\n \"block-end\":\n \"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n },\n);\n\n/** A leading/trailing or stacked slot for icons, text, or buttons; clicking it focuses the group's input. */\nfunction InputGroupAddon({\n className,\n /** Where the addon sits relative to the control: inline (left/right) or block (top/bottom). */\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return;\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus();\n }}\n {...props}\n />\n );\n}\n\nconst inputGroupButtonVariants = cva(\"flex items-center gap-2 text-sm shadow-none\", {\n variants: {\n size: {\n xs: \"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5\",\n sm: \"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5\",\n \"icon-xs\": \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n});\n\n/** A compact Button sized to sit inside an addon without overflowing the group's height. */\nfunction InputGroupButton({\n className,\n /** The button's HTML type; defaults to `\"button\"` so it does not submit forms. */\n type = \"button\",\n /** Visual style forwarded to the underlying Button; defaults to `\"ghost\"`. */\n variant = \"ghost\",\n /** Compact sizing tuned for the group: text (`xs`/`sm`) or square icon (`icon-xs`/`icon-sm`). */\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n );\n}\n\n/** Muted inline text for prefixes, suffixes, or counts placed inside an addon (e.g. `$`, `USD`, `12 results`). */\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** The Input control for the group: borderless and transparent so the group container provides the chrome. */\nfunction InputGroupInput({ className, ...props }: React.ComponentProps<typeof Input>) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** The Textarea control for the group: borderless, transparent, and non-resizing so the group provides the chrome. */\nfunction InputGroupTextarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <Textarea\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n};\n"],"mappings":";;;;;;;;AAWA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,MAAK;EACL,WAAW,GACT,4JACA,sCAGA,mDACA,iDACA,kIACA,4HAGA,mMAGA,kLAEA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,0BAA0B,IAC9B,2PACA;CACE,UAAU,EACR,OAAO;EACL,gBAAgB;EAChB,cAAc;EACd,eACE;EACF,aACE;CACJ,EACF;CACA,iBAAiB,EACf,OAAO,eACT;AACF,CACF;;AAGA,SAAS,gBAAgB,EACvB,WAEA,QAAQ,gBACR,GAAG,SAC0E;CAC7E,OACE,oBAAC,OAAD;EACE,MAAK;EACL,aAAU;EACV,cAAY;EACZ,WAAW,GAAG,wBAAwB,EAAE,MAAM,CAAC,GAAG,SAAS;EAC3D,UAAU,MAAM;GACd,IAAK,EAAE,OAAuB,QAAQ,QAAQ,GAC5C;GAEF,EAAE,cAAc,eAAe,cAAc,OAAO,GAAG,MAAM;EAC/D;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,2BAA2B,IAAI,+CAA+C;CAClF,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;EACJ,WAAW;EACX,WAAW;CACb,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CAAC;;AAGD,SAAS,iBAAiB,EACxB,WAEA,OAAO,UAEP,UAAU,SAEV,OAAO,MACP,GAAG,SAE4C;CAC/C,OACE,oBAAC,QAAD;EACQ;EACN,aAAW;EACF;EACT,WAAW,GAAG,yBAAyB,EAAE,KAAK,CAAC,GAAG,SAAS;EAC3D,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,eAAe,EAAE,WAAW,GAAG,SAAuC;CAC7E,OACE,oBAAC,QAAD;EACE,WAAW,GACT,0HACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAA6C;CACpF,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,oGACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAA2C;CACrF,OACE,oBAAC,UAAD;EACE,aAAU;EACV,WAAW,GACT,qHACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("../../chunk.cjs");
|
|
3
|
+
const require_cn = require("../../cn.cjs");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_chunk.__toESM(react);
|
|
6
|
+
let lucide_react = require("lucide-react");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let input_otp = require("input-otp");
|
|
9
|
+
//#region src/primitives/InputOtp/InputOtp.tsx
|
|
10
|
+
const InputOTPSettingsContext = react.createContext({ size: "default" });
|
|
11
|
+
const inputOTPSlotSizes = {
|
|
12
|
+
xs: "size-6 text-xs",
|
|
13
|
+
sm: "size-8 text-sm",
|
|
14
|
+
default: "size-9 text-sm",
|
|
15
|
+
lg: "size-10 text-base"
|
|
16
|
+
};
|
|
17
|
+
/** One-time-passcode field: a row of single-character slots backed by a hidden input. */
|
|
18
|
+
function InputOTP({ className, containerClassName, size = "default", placeholder, ...props }) {
|
|
19
|
+
const settings = react.useMemo(() => ({
|
|
20
|
+
size,
|
|
21
|
+
placeholder
|
|
22
|
+
}), [size, placeholder]);
|
|
23
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InputOTPSettingsContext.Provider, {
|
|
24
|
+
value: settings,
|
|
25
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(input_otp.OTPInput, {
|
|
26
|
+
"data-slot": "input-otp",
|
|
27
|
+
containerClassName: require_cn.cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
|
|
28
|
+
className: require_cn.cn("disabled:cursor-not-allowed", className),
|
|
29
|
+
...props
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Visual cluster of adjacent slots; use multiple groups around an `InputOTPSeparator`. */
|
|
34
|
+
function InputOTPGroup({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
36
|
+
"data-slot": "input-otp-group",
|
|
37
|
+
className: require_cn.cn("flex items-center gap-1", className),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/** A single character cell rendering its char, active ring, fake caret, and placeholder. */
|
|
42
|
+
function InputOTPSlot({ index, className, ...props }) {
|
|
43
|
+
const inputOTPContext = react.useContext(input_otp.OTPInputContext);
|
|
44
|
+
const { size, placeholder } = react.useContext(InputOTPSettingsContext);
|
|
45
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
46
|
+
const isEmpty = char == null || char === "";
|
|
47
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
48
|
+
"data-slot": "input-otp-slot",
|
|
49
|
+
"data-active": isActive,
|
|
50
|
+
className: require_cn.cn("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex items-center justify-center border-y border-r bg-input-background transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]", inputOTPSlotSizes[size], className),
|
|
51
|
+
...props,
|
|
52
|
+
children: [
|
|
53
|
+
char,
|
|
54
|
+
isEmpty && placeholder && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
55
|
+
className: "text-muted-foreground pointer-events-none",
|
|
56
|
+
children: placeholder
|
|
57
|
+
}),
|
|
58
|
+
hasFakeCaret && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
59
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
60
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" })
|
|
61
|
+
})
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/** Decorative divider (a minus icon) placed between two `InputOTPGroup`s. */
|
|
66
|
+
function InputOTPSeparator({ ...props }) {
|
|
67
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
68
|
+
"data-slot": "input-otp-separator",
|
|
69
|
+
role: "separator",
|
|
70
|
+
...props,
|
|
71
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.MinusIcon, {})
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
exports.InputOTP = InputOTP;
|
|
76
|
+
exports.InputOTPGroup = InputOTPGroup;
|
|
77
|
+
exports.InputOTPSeparator = InputOTPSeparator;
|
|
78
|
+
exports.InputOTPSlot = InputOTPSlot;
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["React","OTPInput","cn","OTPInputContext","MinusIcon"],"sources":["../../../src/primitives/InputOtp/InputOtp.tsx"],"sourcesContent":["\"use client\";\n\nimport { OTPInput, OTPInputContext } from \"input-otp\";\nimport { MinusIcon } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\n\ntype InputOTPSize = \"default\" | \"lg\" | \"sm\" | \"xs\";\n\ntype InputOTPContextValue = {\n size: InputOTPSize;\n placeholder?: string;\n};\n\nconst InputOTPSettingsContext = React.createContext<InputOTPContextValue>({\n size: \"default\",\n});\n\n// Sizes mirror the Figma \"Input\" spec: Mini 24px / Small 32px / Default 36px / Large 40px.\nconst inputOTPSlotSizes: Record<InputOTPSize, string> = {\n xs: \"size-6 text-xs\",\n sm: \"size-8 text-sm\",\n default: \"size-9 text-sm\",\n lg: \"size-10 text-base\",\n};\n\n/** One-time-passcode field: a row of single-character slots backed by a hidden input. */\nfunction InputOTP({\n className,\n containerClassName,\n size = \"default\",\n placeholder,\n ...props\n}: DistributiveOmit<React.ComponentProps<typeof OTPInput>, \"size\" | \"placeholder\"> & {\n /** Class applied to the outer flex container that wraps the slot groups. */\n containerClassName?: string;\n /** Slot dimensions and type scale: Mini 24px / Small 32px / Default 36px / Large 40px. */\n size?: InputOTPSize;\n /** Single character shown in empty slots as a hint until the user types. */\n placeholder?: string;\n}) {\n const settings = React.useMemo<InputOTPContextValue>(\n () => ({ size, placeholder }),\n [size, placeholder],\n );\n\n return (\n <InputOTPSettingsContext.Provider value={settings}>\n <OTPInput\n data-slot=\"input-otp\"\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n </InputOTPSettingsContext.Provider>\n );\n}\n\n/** Visual cluster of adjacent slots; use multiple groups around an `InputOTPSeparator`. */\nfunction InputOTPGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-otp-group\"\n className={cn(\"flex items-center gap-1\", className)}\n {...props}\n />\n );\n}\n\n/** A single character cell rendering its char, active ring, fake caret, and placeholder. */\nfunction InputOTPSlot({\n index,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Zero-based position of this slot within the input's character buffer. */\n index: number;\n}) {\n const inputOTPContext = React.useContext(OTPInputContext);\n const { size, placeholder } = React.useContext(InputOTPSettingsContext);\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};\n const isEmpty = char == null || char === \"\";\n\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-active={isActive}\n className={cn(\n \"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex items-center justify-center border-y border-r bg-input-background transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]\",\n inputOTPSlotSizes[size],\n className,\n )}\n {...props}\n >\n {char}\n {isEmpty && placeholder && (\n <span className=\"text-muted-foreground pointer-events-none\">{placeholder}</span>\n )}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n )}\n </div>\n );\n}\n\n/** Decorative divider (a minus icon) placed between two `InputOTPGroup`s. */\nfunction InputOTPSeparator({ ...props }: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"input-otp-separator\" role=\"separator\" {...props}>\n <MinusIcon />\n </div>\n );\n}\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };\n"],"mappings":";;;;;;;;;AAiBA,MAAM,0BAA0BA,MAAM,cAAoC,EACxE,MAAM,UACR,CAAC;AAGD,MAAM,oBAAkD;CACtD,IAAI;CACJ,IAAI;CACJ,SAAS;CACT,IAAI;AACN;;AAGA,SAAS,SAAS,EAChB,WACA,oBACA,OAAO,WACP,aACA,GAAG,SAQF;CACD,MAAM,WAAWA,MAAM,eACd;EAAE;EAAM;CAAY,IAC3B,CAAC,MAAM,WAAW,CACpB;CAEA,OACE,iBAAA,GAAA,kBAAA,KAAC,wBAAwB,UAAzB;EAAkC,OAAO;YACvC,iBAAA,GAAA,kBAAA,KAACC,UAAAA,UAAD;GACE,aAAU;GACV,oBAAoBC,WAAAA,GAClB,mDACA,kBACF;GACA,WAAWA,WAAAA,GAAG,+BAA+B,SAAS;GACtD,GAAI;EACL,CAAA;CAC+B,CAAA;AAEtC;;AAGA,SAAS,cAAc,EAAE,WAAW,GAAG,SAAsC;CAC3E,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GAAG,2BAA2B,SAAS;EAClD,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,aAAa,EACpB,OACA,WACA,GAAG,SAIF;CACD,MAAM,kBAAkBF,MAAM,WAAWG,UAAAA,eAAe;CACxD,MAAM,EAAE,MAAM,gBAAgBH,MAAM,WAAW,uBAAuB;CACtE,MAAM,EAAE,MAAM,cAAc,aAAa,iBAAiB,MAAM,UAAU,CAAC;CAC3E,MAAM,UAAU,QAAQ,QAAQ,SAAS;CAEzC,OACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EACE,aAAU;EACV,eAAa;EACb,WAAWE,WAAAA,GACT,sfACA,kBAAkB,OAClB,SACF;EACA,GAAI;YARN;GAUG;GACA,WAAW,eACV,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAU;cAA6C;GAAkB,CAAA;GAEhF,gBACC,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,WAAU;cACb,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAU,2DAA4D,CAAA;GACxE,CAAA;EAEJ;;AAET;;AAGA,SAAS,kBAAkB,EAAE,GAAG,SAAsC;CACpE,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,aAAU;EAAsB,MAAK;EAAY,GAAI;YACxD,iBAAA,GAAA,kBAAA,KAACE,aAAAA,WAAD,CAAY,CAAA;CACT,CAAA;AAET"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { t as cn } from "../../cn.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { MinusIcon } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { OTPInput, OTPInputContext } from "input-otp";
|
|
6
|
+
//#region src/primitives/InputOtp/InputOtp.tsx
|
|
7
|
+
const InputOTPSettingsContext = React.createContext({ size: "default" });
|
|
8
|
+
const inputOTPSlotSizes = {
|
|
9
|
+
xs: "size-6 text-xs",
|
|
10
|
+
sm: "size-8 text-sm",
|
|
11
|
+
default: "size-9 text-sm",
|
|
12
|
+
lg: "size-10 text-base"
|
|
13
|
+
};
|
|
14
|
+
/** One-time-passcode field: a row of single-character slots backed by a hidden input. */
|
|
15
|
+
function InputOTP({ className, containerClassName, size = "default", placeholder, ...props }) {
|
|
16
|
+
const settings = React.useMemo(() => ({
|
|
17
|
+
size,
|
|
18
|
+
placeholder
|
|
19
|
+
}), [size, placeholder]);
|
|
20
|
+
return /* @__PURE__ */ jsx(InputOTPSettingsContext.Provider, {
|
|
21
|
+
value: settings,
|
|
22
|
+
children: /* @__PURE__ */ jsx(OTPInput, {
|
|
23
|
+
"data-slot": "input-otp",
|
|
24
|
+
containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
|
|
25
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
26
|
+
...props
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** Visual cluster of adjacent slots; use multiple groups around an `InputOTPSeparator`. */
|
|
31
|
+
function InputOTPGroup({ className, ...props }) {
|
|
32
|
+
return /* @__PURE__ */ jsx("div", {
|
|
33
|
+
"data-slot": "input-otp-group",
|
|
34
|
+
className: cn("flex items-center gap-1", className),
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** A single character cell rendering its char, active ring, fake caret, and placeholder. */
|
|
39
|
+
function InputOTPSlot({ index, className, ...props }) {
|
|
40
|
+
const inputOTPContext = React.useContext(OTPInputContext);
|
|
41
|
+
const { size, placeholder } = React.useContext(InputOTPSettingsContext);
|
|
42
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
43
|
+
const isEmpty = char == null || char === "";
|
|
44
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
45
|
+
"data-slot": "input-otp-slot",
|
|
46
|
+
"data-active": isActive,
|
|
47
|
+
className: cn("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex items-center justify-center border-y border-r bg-input-background transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]", inputOTPSlotSizes[size], className),
|
|
48
|
+
...props,
|
|
49
|
+
children: [
|
|
50
|
+
char,
|
|
51
|
+
isEmpty && placeholder && /* @__PURE__ */ jsx("span", {
|
|
52
|
+
className: "text-muted-foreground pointer-events-none",
|
|
53
|
+
children: placeholder
|
|
54
|
+
}),
|
|
55
|
+
hasFakeCaret && /* @__PURE__ */ jsx("div", {
|
|
56
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
57
|
+
children: /* @__PURE__ */ jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" })
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/** Decorative divider (a minus icon) placed between two `InputOTPGroup`s. */
|
|
63
|
+
function InputOTPSeparator({ ...props }) {
|
|
64
|
+
return /* @__PURE__ */ jsx("div", {
|
|
65
|
+
"data-slot": "input-otp-separator",
|
|
66
|
+
role: "separator",
|
|
67
|
+
...props,
|
|
68
|
+
children: /* @__PURE__ */ jsx(MinusIcon, {})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/InputOtp/InputOtp.tsx"],"sourcesContent":["\"use client\";\n\nimport { OTPInput, OTPInputContext } from \"input-otp\";\nimport { MinusIcon } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils\";\n\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\n\ntype InputOTPSize = \"default\" | \"lg\" | \"sm\" | \"xs\";\n\ntype InputOTPContextValue = {\n size: InputOTPSize;\n placeholder?: string;\n};\n\nconst InputOTPSettingsContext = React.createContext<InputOTPContextValue>({\n size: \"default\",\n});\n\n// Sizes mirror the Figma \"Input\" spec: Mini 24px / Small 32px / Default 36px / Large 40px.\nconst inputOTPSlotSizes: Record<InputOTPSize, string> = {\n xs: \"size-6 text-xs\",\n sm: \"size-8 text-sm\",\n default: \"size-9 text-sm\",\n lg: \"size-10 text-base\",\n};\n\n/** One-time-passcode field: a row of single-character slots backed by a hidden input. */\nfunction InputOTP({\n className,\n containerClassName,\n size = \"default\",\n placeholder,\n ...props\n}: DistributiveOmit<React.ComponentProps<typeof OTPInput>, \"size\" | \"placeholder\"> & {\n /** Class applied to the outer flex container that wraps the slot groups. */\n containerClassName?: string;\n /** Slot dimensions and type scale: Mini 24px / Small 32px / Default 36px / Large 40px. */\n size?: InputOTPSize;\n /** Single character shown in empty slots as a hint until the user types. */\n placeholder?: string;\n}) {\n const settings = React.useMemo<InputOTPContextValue>(\n () => ({ size, placeholder }),\n [size, placeholder],\n );\n\n return (\n <InputOTPSettingsContext.Provider value={settings}>\n <OTPInput\n data-slot=\"input-otp\"\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n </InputOTPSettingsContext.Provider>\n );\n}\n\n/** Visual cluster of adjacent slots; use multiple groups around an `InputOTPSeparator`. */\nfunction InputOTPGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-otp-group\"\n className={cn(\"flex items-center gap-1\", className)}\n {...props}\n />\n );\n}\n\n/** A single character cell rendering its char, active ring, fake caret, and placeholder. */\nfunction InputOTPSlot({\n index,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n /** Zero-based position of this slot within the input's character buffer. */\n index: number;\n}) {\n const inputOTPContext = React.useContext(OTPInputContext);\n const { size, placeholder } = React.useContext(InputOTPSettingsContext);\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};\n const isEmpty = char == null || char === \"\";\n\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-active={isActive}\n className={cn(\n \"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex items-center justify-center border-y border-r bg-input-background transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]\",\n inputOTPSlotSizes[size],\n className,\n )}\n {...props}\n >\n {char}\n {isEmpty && placeholder && (\n <span className=\"text-muted-foreground pointer-events-none\">{placeholder}</span>\n )}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n )}\n </div>\n );\n}\n\n/** Decorative divider (a minus icon) placed between two `InputOTPGroup`s. */\nfunction InputOTPSeparator({ ...props }: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"input-otp-separator\" role=\"separator\" {...props}>\n <MinusIcon />\n </div>\n );\n}\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };\n"],"mappings":";;;;;;AAiBA,MAAM,0BAA0B,MAAM,cAAoC,EACxE,MAAM,UACR,CAAC;AAGD,MAAM,oBAAkD;CACtD,IAAI;CACJ,IAAI;CACJ,SAAS;CACT,IAAI;AACN;;AAGA,SAAS,SAAS,EAChB,WACA,oBACA,OAAO,WACP,aACA,GAAG,SAQF;CACD,MAAM,WAAW,MAAM,eACd;EAAE;EAAM;CAAY,IAC3B,CAAC,MAAM,WAAW,CACpB;CAEA,OACE,oBAAC,wBAAwB,UAAzB;EAAkC,OAAO;YACvC,oBAAC,UAAD;GACE,aAAU;GACV,oBAAoB,GAClB,mDACA,kBACF;GACA,WAAW,GAAG,+BAA+B,SAAS;GACtD,GAAI;EACL,CAAA;CAC+B,CAAA;AAEtC;;AAGA,SAAS,cAAc,EAAE,WAAW,GAAG,SAAsC;CAC3E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,2BAA2B,SAAS;EAClD,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,aAAa,EACpB,OACA,WACA,GAAG,SAIF;CACD,MAAM,kBAAkB,MAAM,WAAW,eAAe;CACxD,MAAM,EAAE,MAAM,gBAAgB,MAAM,WAAW,uBAAuB;CACtE,MAAM,EAAE,MAAM,cAAc,aAAa,iBAAiB,MAAM,UAAU,CAAC;CAC3E,MAAM,UAAU,QAAQ,QAAQ,SAAS;CAEzC,OACE,qBAAC,OAAD;EACE,aAAU;EACV,eAAa;EACb,WAAW,GACT,sfACA,kBAAkB,OAClB,SACF;EACA,GAAI;YARN;GAUG;GACA,WAAW,eACV,oBAAC,QAAD;IAAM,WAAU;cAA6C;GAAkB,CAAA;GAEhF,gBACC,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,OAAD,EAAK,WAAU,2DAA4D,CAAA;GACxE,CAAA;EAEJ;;AAET;;AAGA,SAAS,kBAAkB,EAAE,GAAG,SAAsC;CACpE,OACE,oBAAC,OAAD;EAAK,aAAU;EAAsB,MAAK;EAAY,GAAI;YACxD,oBAAC,WAAD,CAAY,CAAA;CACT,CAAA;AAET"}
|