@customafk/lunas-ui 0.2.40 → 0.2.41
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/dist/{alert-BztgYPpW.d.cts → alert-BVsYpWFX.d.cts} +5 -5
- package/dist/{alert-BzBDfGk2.js → alert-D5VmhFT9.js} +2 -2
- package/dist/{alert-BzBDfGk2.js.map → alert-D5VmhFT9.js.map} +1 -1
- package/dist/{alert-DFvMshuq.d.ts → alert-DXmXDeGs.d.ts} +5 -5
- package/dist/{alert-B2PaDJp6.cjs → alert-JwECRZfz.cjs} +2 -2
- package/dist/{alert-B2PaDJp6.cjs.map → alert-JwECRZfz.cjs.map} +1 -1
- package/dist/{button-DloFFxkz.d.ts → button-BBfGvggN.d.ts} +3 -3
- package/dist/{button-CRSezlCi.d.cts → button-BEjRVw6s.d.cts} +3 -3
- package/dist/{button.variants-CoSpd71B.js → button.variants-BruXd4VM.js} +1 -1
- package/dist/{button.variants-CoSpd71B.js.map → button.variants-BruXd4VM.js.map} +1 -1
- package/dist/{button.variants-4kw6plrv.cjs → button.variants-DgVFNsVc.cjs} +2 -2
- package/dist/{button.variants-4kw6plrv.cjs.map → button.variants-DgVFNsVc.cjs.map} +1 -1
- package/dist/cards/grid-product-card.cjs +1 -1
- package/dist/cards/grid-product-card.cjs.map +1 -1
- package/dist/cards/grid-product-card.js +1 -1
- package/dist/cards/grid-product-card.js.map +1 -1
- package/dist/cards/product-card.cjs +1 -1
- package/dist/cards/product-card.cjs.map +1 -1
- package/dist/cards/product-card.js +1 -1
- package/dist/cards/product-card.js.map +1 -1
- package/dist/cards/simple-card.cjs +1 -1
- package/dist/cards/simple-card.d.ts +2 -2
- package/dist/cards/simple-card.js +1 -1
- package/dist/chunk-Bmb41Sf3.cjs +1 -0
- package/dist/{close-Dlo1bI8x.cjs → close-Dflkky9q.cjs} +2 -2
- package/dist/{close-Dlo1bI8x.cjs.map → close-Dflkky9q.cjs.map} +1 -1
- package/dist/{close-C0PdZGxr.js → close-DrkwaVXK.js} +1 -1
- package/dist/{close-C0PdZGxr.js.map → close-DrkwaVXK.js.map} +1 -1
- package/dist/cms-layout-B8maJRLp.cjs +2 -0
- package/dist/{cms-layout-BCH4NroR.cjs.map → cms-layout-B8maJRLp.cjs.map} +1 -1
- package/dist/cms-layout-CLeGdpMb.js +2 -0
- package/dist/{cms-layout-tPwrgJZc.js.map → cms-layout-CLeGdpMb.js.map} +1 -1
- package/dist/data-display/country.cjs +1 -1
- package/dist/data-display/country.cjs.map +1 -1
- package/dist/data-display/country.d.cts +1 -1
- package/dist/data-display/country.d.ts +1 -1
- package/dist/data-display/country.js +1 -1
- package/dist/data-display/country.js.map +1 -1
- package/dist/data-display/data-list.cjs +1 -1
- package/dist/data-display/date-tooltip.cjs +1 -1
- package/dist/data-display/date-tooltip.cjs.map +1 -1
- package/dist/data-display/date-tooltip.js +1 -1
- package/dist/data-display/date-tooltip.js.map +1 -1
- package/dist/data-display/date.cjs +2 -1
- package/dist/data-display/date.cjs.map +1 -0
- package/dist/data-display/date.js +2 -1
- package/dist/data-display/date.js.map +1 -0
- package/dist/data-display/empty.cjs +1 -1
- package/dist/data-display/name.cjs +1 -1
- package/dist/data-display/name.cjs.map +1 -1
- package/dist/data-display/name.js +1 -1
- package/dist/data-display/name.js.map +1 -1
- package/dist/data-display/phone-number.cjs +1 -1
- package/dist/data-display/phone-number.cjs.map +1 -1
- package/dist/data-display/phone-number.js +1 -1
- package/dist/data-display/phone-number.js.map +1 -1
- package/dist/data-display/role-badge.cjs +1 -1
- package/dist/data-display/role-badge.cjs.map +1 -1
- package/dist/data-display/role-badge.d.cts +1 -1
- package/dist/data-display/role-badge.d.ts +1 -1
- package/dist/data-display/role-badge.js +1 -1
- package/dist/data-display/role-badge.js.map +1 -1
- package/dist/data-display/statistic.cjs +2 -1
- package/dist/data-display/statistic.cjs.map +1 -0
- package/dist/data-display/statistic.d.cts +3 -3
- package/dist/data-display/statistic.d.ts +3 -3
- package/dist/data-display/statistic.js +2 -1
- package/dist/data-display/statistic.js.map +1 -0
- package/dist/data-display/user.cjs +2 -1
- package/dist/data-display/user.cjs.map +1 -0
- package/dist/data-display/user.js +2 -1
- package/dist/data-display/user.js.map +1 -0
- package/dist/dialogs/confirm-dialog.cjs +1 -1
- package/dist/dialogs/confirm-dialog.js +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.cjs +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +26 -26
- package/dist/dialogs/detail-dialog/components/sidebar.d.ts +26 -26
- package/dist/dialogs/detail-dialog/components/sidebar.js +1 -1
- package/dist/dialogs/detail-dialog/index.cjs +1 -1
- package/dist/dialogs/detail-dialog/index.cjs.map +1 -1
- package/dist/dialogs/detail-dialog/index.js +1 -1
- package/dist/dialogs/detail-dialog/index.js.map +1 -1
- package/dist/dialogs/error-dialog.cjs +1 -1
- package/dist/dialogs/error-dialog.js +1 -1
- package/dist/dialogs/loading-dialog.cjs +1 -1
- package/dist/dialogs/loading-dialog.cjs.map +1 -1
- package/dist/dialogs/loading-dialog.js +1 -1
- package/dist/dialogs/loading-dialog.js.map +1 -1
- package/dist/features/descriptions/index.cjs +1 -1
- package/dist/features/descriptions/index.cjs.map +1 -1
- package/dist/features/descriptions/index.d.cts +3 -3
- package/dist/features/descriptions/index.d.ts +4 -4
- package/dist/features/descriptions/index.js +1 -1
- package/dist/features/descriptions/index.js.map +1 -1
- package/dist/features/search-modal/index.cjs +1 -1
- package/dist/features/search-modal/index.d.cts +2 -2
- package/dist/features/search-modal/index.d.ts +2 -2
- package/dist/features/search-modal/index.js +1 -1
- package/dist/features/tables/index.cjs +1 -1
- package/dist/features/tables/index.d.cts +1 -1
- package/dist/features/tables/index.d.ts +1 -2
- package/dist/features/tables/index.js +1 -1
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.d.cts +1 -1
- package/dist/features/tanstack-form/index.d.ts +1 -1
- package/dist/features/tanstack-form/index.js +1 -1
- package/dist/features/text-editor/index.cjs +1 -1
- package/dist/features/text-editor/index.d.cts +1 -1
- package/dist/features/text-editor/index.d.ts +1 -1
- package/dist/features/text-editor/index.js +1 -1
- package/dist/field-0gaEKxov.cjs +2 -0
- package/dist/{field-BrlETeXX.cjs.map → field-0gaEKxov.cjs.map} +1 -1
- package/dist/field-DG-kX3HU.js +2 -0
- package/dist/{field-DpoKF1nY.js.map → field-DG-kX3HU.js.map} +1 -1
- package/dist/{flex-DmWmOBn5.cjs → flex-BAfCk_in.cjs} +2 -2
- package/dist/{flex-DmWmOBn5.cjs.map → flex-BAfCk_in.cjs.map} +1 -1
- package/dist/{flex-CinRrgEy.js → flex-D_XtSjf4.js} +2 -2
- package/dist/{flex-CinRrgEy.js.map → flex-D_XtSjf4.js.map} +1 -1
- package/dist/{heading-tGTqk3pA.cjs → heading-BX7ZVnVg.cjs} +2 -2
- package/dist/{heading-tGTqk3pA.cjs.map → heading-BX7ZVnVg.cjs.map} +1 -1
- package/dist/{heading-Bz-hSatD.js → heading-Bw3eo6IT.js} +1 -1
- package/dist/{heading-Bz-hSatD.js.map → heading-Bw3eo6IT.js.map} +1 -1
- package/dist/{index-FIl1Am8j.d.cts → index--eHW_BCk.d.ts} +7 -7
- package/dist/{index-BlQGXGqt.d.ts → index-C257sc-c.d.ts} +1 -1
- package/dist/{index-DSciiDhn.d.cts → index-C4ZFmaZm.d.cts} +326 -326
- package/dist/{index-BX_ZHO1J.d.cts → index-DWEpRM8i.d.cts} +31 -31
- package/dist/{index-B3NschgB.d.ts → index-DnQeeNHV.d.ts} +3 -3
- package/dist/{index-0jdHH3H_.d.ts → index-_MFRCXuJ.d.cts} +2 -2
- package/dist/{index-KO98y6L0.d.cts → index-rNI5ia8r.d.cts} +1 -1
- package/dist/{index-DZVn4x4Q.d.ts → index-rZ2RtGJp.d.ts} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +1 -1
- package/dist/layouts/cms-layout/index.cjs +1 -1
- package/dist/layouts/cms-layout/index.d.cts +1 -1
- package/dist/layouts/cms-layout/index.d.ts +1 -1
- package/dist/layouts/cms-layout/index.js +1 -1
- package/dist/layouts/flex.cjs +1 -1
- package/dist/layouts/flex.d.cts +5 -5
- package/dist/layouts/flex.d.ts +3 -3
- package/dist/layouts/flex.js +1 -1
- package/dist/layouts/grid.cjs +1 -1
- package/dist/layouts/payment-layout/index.cjs +1 -1
- package/dist/layouts/payment-layout/index.js +1 -1
- package/dist/pages/FeatureDeveloping.cjs +1 -1
- package/dist/pages/FeatureDeveloping.cjs.map +1 -1
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.ts +2 -2
- package/dist/pages/FeatureDeveloping.js +1 -1
- package/dist/pages/FeatureDeveloping.js.map +1 -1
- package/dist/pages/FeatureFixing.cjs +1 -1
- package/dist/pages/FeatureFixing.cjs.map +1 -1
- package/dist/pages/FeatureFixing.d.cts +2 -2
- package/dist/pages/FeatureFixing.d.ts +2 -2
- package/dist/pages/FeatureFixing.js +1 -1
- package/dist/pages/FeatureFixing.js.map +1 -1
- package/dist/pages/LoginPage.cjs +1 -1
- package/dist/pages/LoginPage.cjs.map +1 -1
- package/dist/pages/LoginPage.d.cts +2 -2
- package/dist/pages/LoginPage.d.ts +2 -2
- package/dist/pages/LoginPage.js +1 -1
- package/dist/pages/LoginPage.js.map +1 -1
- package/dist/pages/NotAuthorized.cjs +1 -1
- package/dist/pages/NotAuthorized.cjs.map +1 -1
- package/dist/pages/NotAuthorized.d.ts +2 -2
- package/dist/pages/NotAuthorized.js +1 -1
- package/dist/pages/NotAuthorized.js.map +1 -1
- package/dist/pages/NotFound.cjs +1 -1
- package/dist/pages/NotFound.cjs.map +1 -1
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.ts +2 -2
- package/dist/pages/NotFound.js +1 -1
- package/dist/pages/NotFound.js.map +1 -1
- package/dist/pages/RegisterPage.cjs +1 -1
- package/dist/pages/RegisterPage.cjs.map +1 -1
- package/dist/pages/RegisterPage.d.cts +2 -2
- package/dist/pages/RegisterPage.d.ts +2 -2
- package/dist/pages/RegisterPage.js +1 -1
- package/dist/pages/RegisterPage.js.map +1 -1
- package/dist/pages/VerifyEmailPage.cjs +1 -1
- package/dist/pages/VerifyEmailPage.cjs.map +1 -1
- package/dist/pages/VerifyEmailPage.d.cts +2 -2
- package/dist/pages/VerifyEmailPage.d.ts +2 -2
- package/dist/pages/VerifyEmailPage.js +1 -1
- package/dist/pages/VerifyEmailPage.js.map +1 -1
- package/dist/{paragraph-DvTZvbzw.cjs → paragraph-D0x3Jc6W.cjs} +2 -2
- package/dist/{paragraph-DvTZvbzw.cjs.map → paragraph-D0x3Jc6W.cjs.map} +1 -1
- package/dist/{paragraph-Cc13ZI4d.js → paragraph-ESjXXqHU.js} +1 -1
- package/dist/{paragraph-Cc13ZI4d.js.map → paragraph-ESjXXqHU.js.map} +1 -1
- package/dist/payment-layout-CksJbGsl.js +2 -0
- package/dist/{payment-layout-giaGvs8T.js.map → payment-layout-CksJbGsl.js.map} +1 -1
- package/dist/payment-layout-O7TNw2Cr.cjs +2 -0
- package/dist/{payment-layout-DyILfyVG.cjs.map → payment-layout-O7TNw2Cr.cjs.map} +1 -1
- package/dist/search-modal-Db8Xp2L4.cjs +2 -0
- package/dist/{search-modal-B-pzGcfP.cjs.map → search-modal-Db8Xp2L4.cjs.map} +1 -1
- package/dist/search-modal-DdonKbwA.js +2 -0
- package/dist/{search-modal-b2AE5WEW.js.map → search-modal-DdonKbwA.js.map} +1 -1
- package/dist/sidebar-BCuXtop_.js +2 -0
- package/dist/sidebar-BCuXtop_.js.map +1 -0
- package/dist/sidebar-CQZlWCK4.cjs +2 -0
- package/dist/{sidebar-D5J2gcTw.cjs.map → sidebar-CQZlWCK4.cjs.map} +1 -1
- package/dist/{skeleton-DlRDNM97.js → skeleton-DAcbjBGp.js} +1 -1
- package/dist/{skeleton-DlRDNM97.js.map → skeleton-DAcbjBGp.js.map} +1 -1
- package/dist/{skeleton-CX1USu1w.cjs → skeleton-oQFT4xR2.cjs} +2 -2
- package/dist/{skeleton-CX1USu1w.cjs.map → skeleton-oQFT4xR2.cjs.map} +1 -1
- package/dist/systems/google.cjs +1 -1
- package/dist/systems/google.js +1 -1
- package/dist/tables-DbwtCMRI.js +4 -0
- package/dist/{tables-DWQytYNm.js.map → tables-DbwtCMRI.js.map} +1 -1
- package/dist/tables-DgZbLZQP.cjs +4 -0
- package/dist/{tables-CPKHe3k-.cjs.map → tables-DgZbLZQP.cjs.map} +1 -1
- package/dist/tanstack-form-C3SGhsmN.cjs +2 -0
- package/dist/tanstack-form-C3SGhsmN.cjs.map +1 -0
- package/dist/tanstack-form-Ds_Zjt20.js +2 -0
- package/dist/tanstack-form-Ds_Zjt20.js.map +1 -0
- package/dist/text-editor-DhTxCxvH.cjs +2 -0
- package/dist/{text-editor-CvJN3nSL.cjs.map → text-editor-DhTxCxvH.cjs.map} +1 -1
- package/dist/text-editor-DwisU9_U.js +2 -0
- package/dist/{text-editor-WbS7pJJs.js.map → text-editor-DwisU9_U.js.map} +1 -1
- package/dist/typography/paragraph.cjs +1 -1
- package/dist/typography/paragraph.d.cts +4 -4
- package/dist/typography/paragraph.d.ts +3 -3
- package/dist/typography/paragraph.js +1 -1
- package/dist/typography/title.cjs +1 -1
- package/dist/ui/alert-dialog.cjs +1 -1
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.ts +12 -12
- package/dist/ui/alert-dialog.js +1 -1
- package/dist/ui/alert.cjs +1 -1
- package/dist/ui/alert.d.cts +1 -1
- package/dist/ui/alert.d.ts +1 -1
- package/dist/ui/alert.js +1 -1
- package/dist/ui/aspect-ratio.cjs +1 -1
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.ts +2 -2
- package/dist/ui/avatar.cjs +2 -1
- package/dist/ui/avatar.cjs.map +1 -0
- package/dist/ui/avatar.d.cts +4 -4
- package/dist/ui/avatar.d.ts +4 -4
- package/dist/ui/avatar.js +2 -1
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/badge.cjs +2 -1
- package/dist/ui/badge.cjs.map +1 -0
- package/dist/ui/badge.d.cts +42 -2
- package/dist/ui/badge.d.ts +42 -2
- package/dist/ui/badge.js +2 -1
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/breadcrumb.cjs +1 -1
- package/dist/ui/breadcrumb.cjs.map +1 -1
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.ts +8 -8
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/breadcrumb.js.map +1 -1
- package/dist/ui/button-group.cjs +1 -1
- package/dist/ui/button-group.cjs.map +1 -1
- package/dist/ui/button-group.d.cts +7 -7
- package/dist/ui/button-group.d.ts +7 -7
- package/dist/ui/button-group.js +1 -1
- package/dist/ui/button-group.js.map +1 -1
- package/dist/ui/button.cjs +2 -1
- package/dist/ui/button.cjs.map +1 -0
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +2 -1
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/buttons/add-new.cjs +1 -1
- package/dist/ui/buttons/add-new.cjs.map +1 -1
- package/dist/ui/buttons/add-new.js +1 -1
- package/dist/ui/buttons/add-new.js.map +1 -1
- package/dist/ui/buttons/edit.cjs +1 -1
- package/dist/ui/buttons/edit.cjs.map +1 -1
- package/dist/ui/buttons/edit.js +1 -1
- package/dist/ui/buttons/edit.js.map +1 -1
- package/dist/ui/buttons/refresh.cjs +1 -1
- package/dist/ui/buttons/refresh.cjs.map +1 -1
- package/dist/ui/buttons/refresh.js +1 -1
- package/dist/ui/buttons/refresh.js.map +1 -1
- package/dist/ui/buttons/trash.cjs +1 -1
- package/dist/ui/buttons/trash.cjs.map +1 -1
- package/dist/ui/buttons/trash.js +1 -1
- package/dist/ui/buttons/trash.js.map +1 -1
- package/dist/ui/buttons/upload-image.cjs +1 -1
- package/dist/ui/buttons/upload-image.cjs.map +1 -1
- package/dist/ui/buttons/upload-image.js +1 -1
- package/dist/ui/buttons/upload-image.js.map +1 -1
- package/dist/ui/calendar.cjs +2 -1
- package/dist/ui/calendar.cjs.map +1 -0
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.ts +4 -4
- package/dist/ui/calendar.js +2 -1
- package/dist/ui/calendar.js.map +1 -0
- package/dist/ui/card.cjs +1 -1
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.ts +8 -8
- package/dist/ui/card.js +1 -1
- package/dist/ui/carousel.cjs +1 -1
- package/dist/ui/carousel.cjs.map +1 -1
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.ts +7 -7
- package/dist/ui/carousel.js +1 -1
- package/dist/ui/carousel.js.map +1 -1
- package/dist/ui/checkbox.cjs +2 -1
- package/dist/ui/checkbox.cjs.map +1 -0
- package/dist/ui/checkbox.d.cts +2 -2
- package/dist/ui/checkbox.js +2 -1
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/collapsible.cjs +1 -1
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/command.cjs +2 -1
- package/dist/ui/command.cjs.map +1 -0
- package/dist/ui/command.d.cts +11 -11
- package/dist/ui/command.d.ts +11 -11
- package/dist/ui/command.js +2 -1
- package/dist/ui/command.js.map +1 -0
- package/dist/ui/context-menu.cjs +1 -1
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.ts +16 -16
- package/dist/ui/dialog.cjs +2 -1
- package/dist/ui/dialog.cjs.map +1 -0
- package/dist/ui/dialog.d.cts +90 -2
- package/dist/ui/dialog.d.ts +90 -2
- package/dist/ui/dialog.js +2 -1
- package/dist/ui/dialog.js.map +1 -0
- package/dist/ui/drawer.cjs +2 -1
- package/dist/ui/drawer.cjs.map +1 -0
- package/dist/ui/drawer.d.cts +11 -11
- package/dist/ui/drawer.d.ts +11 -11
- package/dist/ui/drawer.js +2 -1
- package/dist/ui/drawer.js.map +1 -0
- package/dist/ui/dropdown-menu.cjs +2 -1
- package/dist/ui/dropdown-menu.cjs.map +1 -0
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.ts +16 -16
- package/dist/ui/dropdown-menu.js +2 -1
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/empty.cjs +1 -1
- package/dist/ui/empty.d.cts +9 -9
- package/dist/ui/empty.d.ts +7 -7
- package/dist/ui/field.cjs +1 -1
- package/dist/ui/field.d.cts +24 -24
- package/dist/ui/field.d.ts +24 -24
- package/dist/ui/field.js +1 -1
- package/dist/ui/file-uploader.cjs +2 -2
- package/dist/ui/file-uploader.cjs.map +1 -1
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.ts +2 -2
- package/dist/ui/file-uploader.js +2 -2
- package/dist/ui/file-uploader.js.map +1 -1
- package/dist/ui/form.cjs +1 -1
- package/dist/ui/form.cjs.map +1 -1
- package/dist/ui/form.d.cts +10 -10
- package/dist/ui/form.d.ts +10 -10
- package/dist/ui/form.js +1 -1
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/hover-card.cjs +1 -1
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.ts +4 -4
- package/dist/ui/image.cjs +2 -1
- package/dist/ui/image.cjs.map +1 -0
- package/dist/ui/image.js +2 -1
- package/dist/ui/image.js.map +1 -0
- package/dist/ui/input-otp.cjs +1 -1
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.ts +5 -5
- package/dist/ui/input-otp.js +1 -1
- package/dist/ui/input.cjs +2 -1
- package/dist/ui/input.cjs.map +1 -0
- package/dist/ui/input.d.cts +44 -2
- package/dist/ui/input.d.ts +44 -2
- package/dist/ui/input.js +2 -1
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/inputs/search-input.cjs +1 -1
- package/dist/ui/inputs/search-input.cjs.map +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.ts +3 -3
- package/dist/ui/inputs/search-input.js +1 -1
- package/dist/ui/inputs/search-input.js.map +1 -1
- package/dist/ui/item.cjs +1 -1
- package/dist/ui/item.cjs.map +1 -1
- package/dist/ui/item.d.cts +15 -15
- package/dist/ui/item.d.ts +15 -15
- package/dist/ui/item.js +1 -1
- package/dist/ui/item.js.map +1 -1
- package/dist/ui/label.cjs +2 -1
- package/dist/ui/label.cjs.map +1 -0
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.ts +2 -2
- package/dist/ui/label.js +2 -1
- package/dist/ui/label.js.map +1 -0
- package/dist/ui/menubar.cjs +1 -1
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.ts +17 -17
- package/dist/ui/multi-select.cjs +1 -1
- package/dist/ui/multi-select.cjs.map +1 -1
- package/dist/ui/multi-select.d.cts +3 -3
- package/dist/ui/multi-select.d.ts +6 -7
- package/dist/ui/multi-select.js +1 -1
- package/dist/ui/multi-select.js.map +1 -1
- package/dist/ui/navigation-menu.cjs +1 -1
- package/dist/ui/navigation-menu.d.cts +9 -9
- package/dist/ui/navigation-menu.d.ts +9 -9
- package/dist/ui/pagination.cjs +1 -1
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.ts +9 -9
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/popover.cjs +2 -1
- package/dist/ui/popover.cjs.map +1 -0
- package/dist/ui/popover.d.cts +6 -6
- package/dist/ui/popover.d.ts +6 -6
- package/dist/ui/popover.js +2 -1
- package/dist/ui/popover.js.map +1 -0
- package/dist/ui/progress.cjs +2 -1
- package/dist/ui/progress.cjs.map +1 -0
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.ts +2 -2
- package/dist/ui/progress.js +2 -1
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/radio-group.cjs +2 -1
- package/dist/ui/radio-group.cjs.map +1 -0
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.ts +3 -3
- package/dist/ui/radio-group.js +2 -1
- package/dist/ui/radio-group.js.map +1 -0
- package/dist/ui/resizable.cjs +2 -1
- package/dist/ui/resizable.cjs.map +1 -0
- package/dist/ui/resizable.d.cts +9 -9
- package/dist/ui/resizable.d.ts +9 -9
- package/dist/ui/resizable.js +2 -1
- package/dist/ui/resizable.js.map +1 -0
- package/dist/ui/scroll-area.cjs +1 -1
- package/dist/ui/scroll-area.d.cts +5 -5
- package/dist/ui/scroll-area.d.ts +5 -5
- package/dist/ui/scroll-area.js +1 -1
- package/dist/ui/select.cjs +2 -1
- package/dist/ui/select.cjs.map +1 -0
- package/dist/ui/select.d.cts +9 -9
- package/dist/ui/select.d.ts +9 -9
- package/dist/ui/select.js +2 -1
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/separator.cjs +2 -1
- package/dist/ui/separator.cjs.map +1 -0
- package/dist/ui/separator.d.cts +2 -2
- package/dist/ui/separator.d.ts +2 -2
- package/dist/ui/separator.js +2 -1
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/sheet.cjs +2 -1
- package/dist/ui/sheet.cjs.map +1 -0
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.ts +9 -9
- package/dist/ui/sheet.js +2 -1
- package/dist/ui/sheet.js.map +1 -0
- package/dist/ui/skeleton.cjs +1 -1
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.ts +2 -2
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/slider.cjs +1 -1
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.ts +2 -2
- package/dist/ui/slider.js +1 -1
- package/dist/ui/sonner.cjs +1 -1
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.ts +2 -2
- package/dist/ui/spinner.cjs +2 -1
- package/dist/ui/spinner.cjs.map +1 -0
- package/dist/ui/spinner.d.cts +2 -2
- package/dist/ui/spinner.d.ts +2 -2
- package/dist/ui/spinner.js +2 -1
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/switch.cjs +2 -1
- package/dist/ui/switch.cjs.map +1 -0
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.ts +2 -2
- package/dist/ui/switch.js +2 -1
- package/dist/ui/switch.js.map +1 -0
- package/dist/ui/table.cjs +1 -1
- package/dist/ui/table.d.cts +17 -17
- package/dist/ui/table.d.ts +17 -17
- package/dist/ui/table.js +1 -1
- package/dist/ui/tabs.cjs +1 -1
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.ts +5 -5
- package/dist/ui/textarea.cjs +2 -1
- package/dist/ui/textarea.cjs.map +1 -0
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.ts +2 -2
- package/dist/ui/textarea.js +2 -1
- package/dist/ui/textarea.js.map +1 -0
- package/dist/ui/toggle-group.cjs +1 -1
- package/dist/ui/toggle-group.cjs.map +1 -1
- package/dist/ui/toggle-group.d.cts +4 -4
- package/dist/ui/toggle-group.d.ts +4 -4
- package/dist/ui/toggle-group.js +1 -1
- package/dist/ui/toggle-group.js.map +1 -1
- package/dist/ui/toggle.cjs +1 -1
- package/dist/ui/toggle.d.cts +4 -4
- package/dist/ui/toggle.d.ts +4 -4
- package/dist/ui/tooltip.cjs +2 -1
- package/dist/ui/tooltip.cjs.map +1 -0
- package/dist/ui/tooltip.d.cts +5 -5
- package/dist/ui/tooltip.d.ts +5 -5
- package/dist/ui/tooltip.js +2 -1
- package/dist/ui/tooltip.js.map +1 -0
- package/package.json +1 -1
- package/dist/avatar-Hpj8lmux.js +0 -2
- package/dist/avatar-Hpj8lmux.js.map +0 -1
- package/dist/avatar-TyOphzGo.cjs +0 -2
- package/dist/avatar-TyOphzGo.cjs.map +0 -1
- package/dist/badge-BvKBYsIh.d.ts +0 -42
- package/dist/badge-CRpRXSuO.js +0 -2
- package/dist/badge-CRpRXSuO.js.map +0 -1
- package/dist/badge-KW7xu5Ca.cjs +0 -2
- package/dist/badge-KW7xu5Ca.cjs.map +0 -1
- package/dist/badge-Y-DJHIVI.d.cts +0 -42
- package/dist/button-C--DAN1D.cjs +0 -2
- package/dist/button-C--DAN1D.cjs.map +0 -1
- package/dist/button-LMMbL-uH.js +0 -2
- package/dist/button-LMMbL-uH.js.map +0 -1
- package/dist/calendar-4weBDnXz.cjs +0 -2
- package/dist/calendar-4weBDnXz.cjs.map +0 -1
- package/dist/calendar-DzPt7b6k.js +0 -2
- package/dist/calendar-DzPt7b6k.js.map +0 -1
- package/dist/checkbox-DLGDoU-1.js +0 -2
- package/dist/checkbox-DLGDoU-1.js.map +0 -1
- package/dist/checkbox-Dsq-MSbH.cjs +0 -2
- package/dist/checkbox-Dsq-MSbH.cjs.map +0 -1
- package/dist/chunk-350yNsax.cjs +0 -1
- package/dist/cms-layout-BCH4NroR.cjs +0 -2
- package/dist/cms-layout-tPwrgJZc.js +0 -2
- package/dist/command-2gUejA6g.js +0 -2
- package/dist/command-2gUejA6g.js.map +0 -1
- package/dist/command-CsP8a1Un.cjs +0 -2
- package/dist/command-CsP8a1Un.cjs.map +0 -1
- package/dist/date-BIqCFM1Z.js +0 -2
- package/dist/date-BIqCFM1Z.js.map +0 -1
- package/dist/date-D4NVl6C9.cjs +0 -2
- package/dist/date-D4NVl6C9.cjs.map +0 -1
- package/dist/dialog-BXkm3_Bk.d.ts +0 -90
- package/dist/dialog-BigPrWIj.cjs +0 -2
- package/dist/dialog-BigPrWIj.cjs.map +0 -1
- package/dist/dialog-CmutQ3rp.js +0 -2
- package/dist/dialog-CmutQ3rp.js.map +0 -1
- package/dist/dialog-DAl7wicp.d.cts +0 -90
- package/dist/dist-Cx5ufCdr.cjs +0 -2
- package/dist/dist-Cx5ufCdr.cjs.map +0 -1
- package/dist/dist-EPxjIRJp.js +0 -2
- package/dist/dist-EPxjIRJp.js.map +0 -1
- package/dist/drawer-B3qXaN5p.js +0 -2
- package/dist/drawer-B3qXaN5p.js.map +0 -1
- package/dist/drawer-BB8BZzDG.cjs +0 -2
- package/dist/drawer-BB8BZzDG.cjs.map +0 -1
- package/dist/dropdown-menu-CVh520yG.cjs +0 -2
- package/dist/dropdown-menu-CVh520yG.cjs.map +0 -1
- package/dist/dropdown-menu-DeHCVyby.js +0 -2
- package/dist/dropdown-menu-DeHCVyby.js.map +0 -1
- package/dist/field-BrlETeXX.cjs +0 -2
- package/dist/field-DpoKF1nY.js +0 -2
- package/dist/image-BpTuF_1w.js +0 -2
- package/dist/image-BpTuF_1w.js.map +0 -1
- package/dist/image-W_Yb0xTB.cjs +0 -2
- package/dist/image-W_Yb0xTB.cjs.map +0 -1
- package/dist/input-BBxY18n7.d.ts +0 -44
- package/dist/input-D59Pfu7U.d.cts +0 -44
- package/dist/input-DAfP6LZ7.js +0 -2
- package/dist/input-DAfP6LZ7.js.map +0 -1
- package/dist/input-WJ0DLHTR.cjs +0 -2
- package/dist/input-WJ0DLHTR.cjs.map +0 -1
- package/dist/label-B8cAG2kc.js +0 -2
- package/dist/label-B8cAG2kc.js.map +0 -1
- package/dist/label-CC6fXVbC.cjs +0 -2
- package/dist/label-CC6fXVbC.cjs.map +0 -1
- package/dist/payment-layout-DyILfyVG.cjs +0 -2
- package/dist/payment-layout-giaGvs8T.js +0 -2
- package/dist/popover-6233wU1s.js +0 -2
- package/dist/popover-6233wU1s.js.map +0 -1
- package/dist/popover-DBsC8Ltp.cjs +0 -2
- package/dist/popover-DBsC8Ltp.cjs.map +0 -1
- package/dist/progress-AYknlEgK.js +0 -2
- package/dist/progress-AYknlEgK.js.map +0 -1
- package/dist/progress-gvBqNiHp.cjs +0 -2
- package/dist/progress-gvBqNiHp.cjs.map +0 -1
- package/dist/radio-group-ImoBjpqZ.js +0 -2
- package/dist/radio-group-ImoBjpqZ.js.map +0 -1
- package/dist/radio-group-_TdMkv8w.cjs +0 -2
- package/dist/radio-group-_TdMkv8w.cjs.map +0 -1
- package/dist/resizable-C-M-mu6b.js +0 -2
- package/dist/resizable-C-M-mu6b.js.map +0 -1
- package/dist/resizable-sgpaHAb8.cjs +0 -2
- package/dist/resizable-sgpaHAb8.cjs.map +0 -1
- package/dist/search-modal-B-pzGcfP.cjs +0 -2
- package/dist/search-modal-b2AE5WEW.js +0 -2
- package/dist/select-CWLQHh8x.cjs +0 -2
- package/dist/select-CWLQHh8x.cjs.map +0 -1
- package/dist/select-CryLzZA0.js +0 -2
- package/dist/select-CryLzZA0.js.map +0 -1
- package/dist/separator-BM8hA4DP.js +0 -2
- package/dist/separator-BM8hA4DP.js.map +0 -1
- package/dist/separator-KuymG9g0.cjs +0 -2
- package/dist/separator-KuymG9g0.cjs.map +0 -1
- package/dist/sheet-CvKSi0UC.cjs +0 -2
- package/dist/sheet-CvKSi0UC.cjs.map +0 -1
- package/dist/sheet-DGXXYgWB.js +0 -2
- package/dist/sheet-DGXXYgWB.js.map +0 -1
- package/dist/sidebar-BDrsbzo5.js +0 -2
- package/dist/sidebar-BDrsbzo5.js.map +0 -1
- package/dist/sidebar-D5J2gcTw.cjs +0 -2
- package/dist/spinner-C1eamx3w.js +0 -2
- package/dist/spinner-C1eamx3w.js.map +0 -1
- package/dist/spinner-CFxorYEt.cjs +0 -2
- package/dist/spinner-CFxorYEt.cjs.map +0 -1
- package/dist/statistic-CYMqAYNc.js +0 -2
- package/dist/statistic-CYMqAYNc.js.map +0 -1
- package/dist/statistic-DDXilD7q.cjs +0 -2
- package/dist/statistic-DDXilD7q.cjs.map +0 -1
- package/dist/switch-BLHmdRq2.js +0 -2
- package/dist/switch-BLHmdRq2.js.map +0 -1
- package/dist/switch-DVfOV7wP.cjs +0 -2
- package/dist/switch-DVfOV7wP.cjs.map +0 -1
- package/dist/tables-CPKHe3k-.cjs +0 -4
- package/dist/tables-DWQytYNm.js +0 -4
- package/dist/tanstack-form-DatI41wz.cjs +0 -12
- package/dist/tanstack-form-DatI41wz.cjs.map +0 -1
- package/dist/tanstack-form-YVdm9V01.js +0 -12
- package/dist/tanstack-form-YVdm9V01.js.map +0 -1
- package/dist/text-editor-CvJN3nSL.cjs +0 -2
- package/dist/text-editor-WbS7pJJs.js +0 -2
- package/dist/textarea-Bp6VvhiA.js +0 -2
- package/dist/textarea-Bp6VvhiA.js.map +0 -1
- package/dist/textarea-Cc9CF8wD.cjs +0 -2
- package/dist/textarea-Cc9CF8wD.cjs.map +0 -1
- package/dist/tooltip-CBdoIzoM.cjs +0 -2
- package/dist/tooltip-CBdoIzoM.cjs.map +0 -1
- package/dist/tooltip-CVIl6Hln.js +0 -2
- package/dist/tooltip-CVIl6Hln.js.map +0 -1
- package/dist/types-BD1t0Bj8.cjs +0 -2
- package/dist/types-BD1t0Bj8.cjs.map +0 -1
- package/dist/types-BVSfF-1o.d.ts +0 -24
- package/dist/types-BZqffRVJ.js +0 -2
- package/dist/types-BZqffRVJ.js.map +0 -1
- package/dist/types-Cc_mLRAn.d.cts +0 -24
- package/dist/user-BSpgswEC.js +0 -2
- package/dist/user-BSpgswEC.js.map +0 -1
- package/dist/user-ii4FBhO1.cjs +0 -2
- package/dist/user-ii4FBhO1.cjs.map +0 -1
package/dist/ui/form.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react156 from "react";
|
|
2
2
|
import { Label, Slot } from "radix-ui";
|
|
3
3
|
import * as react_hook_form0 from "react-hook-form";
|
|
4
4
|
import { ControllerProps, FieldPath, FieldValues } from "react-hook-form";
|
|
@@ -57,7 +57,7 @@ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransfor
|
|
|
57
57
|
*/
|
|
58
58
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({
|
|
59
59
|
...props
|
|
60
|
-
}: ControllerProps<TFieldValues, TName>) =>
|
|
60
|
+
}: ControllerProps<TFieldValues, TName>) => react156.JSX.Element;
|
|
61
61
|
/**
|
|
62
62
|
* Hook that returns the field state and IDs for the enclosing FormField.
|
|
63
63
|
* Must be called inside a component rendered within a `<FormField>`.
|
|
@@ -81,32 +81,32 @@ declare const useFormField: () => {
|
|
|
81
81
|
*
|
|
82
82
|
* @param orientation - Layout direction: `'vertical'`, `'horizontal'`, or `'responsive'` (default).
|
|
83
83
|
*/
|
|
84
|
-
declare const FormItem:
|
|
84
|
+
declare const FormItem: react156.MemoExoticComponent<({
|
|
85
85
|
className,
|
|
86
86
|
orientation,
|
|
87
87
|
...props
|
|
88
88
|
}: React.ComponentProps<"div"> & {
|
|
89
89
|
orientation?: "vertical" | "horizontal" | "responsive";
|
|
90
|
-
}) =>
|
|
90
|
+
}) => react156.JSX.Element>;
|
|
91
91
|
/** Styled label automatically associated with the FormItem's control via `htmlFor`. */
|
|
92
|
-
declare const FormLabel:
|
|
92
|
+
declare const FormLabel: react156.MemoExoticComponent<({
|
|
93
93
|
...props
|
|
94
|
-
}: React.ComponentProps<typeof Label.Root>) =>
|
|
94
|
+
}: React.ComponentProps<typeof Label.Root>) => react156.JSX.Element>;
|
|
95
95
|
/** Radix Slot wrapper that wires the correct `id`, `aria-describedby`, and `aria-invalid` attributes onto the underlying control element. */
|
|
96
|
-
declare const FormControl:
|
|
96
|
+
declare const FormControl: react156.MemoExoticComponent<({
|
|
97
97
|
...props
|
|
98
|
-
}: React.ComponentProps<typeof Slot.Slot>) =>
|
|
98
|
+
}: React.ComponentProps<typeof Slot.Slot>) => react156.JSX.Element>;
|
|
99
99
|
/** Helper text displayed below the control that provides additional context about the field. */
|
|
100
100
|
declare function FormDescription({
|
|
101
101
|
className,
|
|
102
102
|
...props
|
|
103
|
-
}: React.ComponentProps<'p'>):
|
|
103
|
+
}: React.ComponentProps<'p'>): react156.JSX.Element;
|
|
104
104
|
/** Displays the validation error message for the field, or falls back to `children` when there is no error. */
|
|
105
105
|
declare function FormMessage({
|
|
106
106
|
className,
|
|
107
107
|
children,
|
|
108
108
|
...props
|
|
109
|
-
}: React.ComponentProps<'p'>):
|
|
109
|
+
}: React.ComponentProps<'p'>): react156.JSX.Element;
|
|
110
110
|
//#endregion
|
|
111
111
|
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|
|
112
112
|
//# sourceMappingURL=form.d.ts.map
|
package/dist/ui/form.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import
|
|
1
|
+
"use client";import{o as e,r as t,t as n}from"../field-DG-kX3HU.js";import{cn as r}from"@customafk/react-toolkit/utils";import{jsx as i}from"react/jsx-runtime";import{createContext as a,memo as o,use as s,useId as c}from"react";import{Slot as l}from"radix-ui";import{Controller as u,FormProvider as d,useFormContext as f,useFormState as p}from"react-hook-form";const m=d,h=a({}),g=({...e})=>i(h.Provider,{value:{name:e.name},children:i(u,{...e})}),_=()=>{let e=s(h),t=s(v),{getFieldState:n,control:r,resetField:i}=f(),a=p({name:e.name}),o=n(e.name,a);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:c}=t;return{id:c,control:r,resetField:i,name:e.name,formItemId:`${c}-form-item`,formDescriptionId:`${c}-form-item-description`,formMessageId:`${c}-form-item-message`,...o}},v=a({}),y=o(({className:e,orientation:t=`responsive`,...r})=>{let a=c();return i(v.Provider,{value:{id:a},children:i(n,{orientation:t,...r,className:e})})});y.displayName=`FormItem`;const b=o(({...t})=>{let{formItemId:n}=_();return i(e,{htmlFor:n,...t})});b.displayName=`FormLabel`;const x=o(({...e})=>{let{error:t,formItemId:n,formDescriptionId:r,formMessageId:a}=_();return i(l.Slot,{"data-slot":`form-control`,id:n,"aria-describedby":t?`${r} ${a}`:`${r}`,"aria-invalid":!!t,...e})});x.displayName=`FormControl`;function S({className:e,...n}){let{formDescriptionId:a}=_();return i(t,{id:a,className:r(`text-text-positive-weak text-sm/6 leading-normal font-normal`,`group-has-data-[orientation=horizontal]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...n})}function C({className:e,children:t,...n}){let{error:a,formMessageId:o}=_();return i(`span`,{"data-slot":`form-message`,id:o,className:r(`text-danger text-xs`,e),...n,children:a?String(a?.message??``):t})}export{m as Form,x as FormControl,S as FormDescription,g as FormField,y as FormItem,b as FormLabel,C as FormMessage,_ as useFormField};
|
|
2
2
|
//# sourceMappingURL=form.js.map
|
package/dist/ui/form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","names":["SlotPrimitive"],"sources":["../../packages/components/ui/form.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\nimport { type Label as LabelPrimitive, Slot as SlotPrimitive } from 'radix-ui';\nimport { createContext, memo, use, useId } from 'react';\nimport type { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';\nimport { Controller, FormProvider, useFormContext, useFormState } from 'react-hook-form';\nimport { Field, FieldDescription, FieldLabel } from './field';\n\n/**\n * Re-export of react-hook-form's `FormProvider`; wrap your form with this to give all nested form components access to the form context.\n *\n * @example\n * ```tsx\n * import { Form, FormField, FormItem, FormLabel, FormControl, FormMessage } from '@customafk/lunas-ui/ui/form';\n * import { useForm } from 'react-hook-form';\n *\n * const form = useForm<{ username: string }>();\n *\n * <Form {...form}>\n * <form onSubmit={form.handleSubmit(onSubmit)}>\n * <FormField\n * control={form.control}\n * name=\"username\"\n * render={({ field }) => (\n * <FormItem>\n * <FormLabel>Username</FormLabel>\n * <FormControl><input {...field} /></FormControl>\n * <FormMessage />\n * </FormItem>\n * )}\n * />\n * </form>\n * </Form>\n * ```\n */\nconst Form = FormProvider;\n\ntype FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {\n name: TName;\n};\n\nconst FormFieldContext = createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\n/**\n * Connects a single react-hook-form field to the form context; renders a `Controller` and passes `name` down to nested FormItem, FormLabel, FormControl, and FormMessage.\n */\nconst FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\n/**\n * Hook that returns the field state and IDs for the enclosing FormField.\n * Must be called inside a component rendered within a `<FormField>`.\n */\nconst useFormField = () => {\n const fieldContext = use(FormFieldContext);\n const itemContext = use(FormItemContext);\n const { getFieldState, control, resetField } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const { id } = itemContext;\n\n return {\n id,\n control,\n resetField,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = createContext<FormItemContextValue>({} as FormItemContextValue);\n\n/**\n * Container for a single form field — generates a unique ID and provides it via context to FormLabel, FormControl, and FormMessage.\n *\n * @param orientation - Layout direction: `'vertical'`, `'horizontal'`, or `'responsive'` (default).\n */\nconst FormItem = memo(\n ({\n className,\n orientation = 'responsive',\n ...props\n }: React.ComponentProps<'div'> & {\n orientation?: 'vertical' | 'horizontal' | 'responsive';\n }) => {\n const id = useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <Field orientation={orientation} {...props} className={className} />\n </FormItemContext.Provider>\n );\n }\n);\nFormItem.displayName = 'FormItem';\n\n/** Styled label automatically associated with the FormItem's control via `htmlFor`. */\nconst FormLabel = memo(({ ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) => {\n const { formItemId } = useFormField();\n return <FieldLabel htmlFor={formItemId} {...props} />;\n});\nFormLabel.displayName = 'FormLabel';\n\n/** Radix Slot wrapper that wires the correct `id`, `aria-describedby`, and `aria-invalid` attributes onto the underlying control element. */\nconst FormControl = memo(({ ...props }: React.ComponentProps<typeof SlotPrimitive.Slot>) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <SlotPrimitive.Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n});\nFormControl.displayName = 'FormControl';\n\n/** Helper text displayed below the control that provides additional context about the field. */\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { formDescriptionId } = useFormField();\n\n return (\n <FieldDescription\n id={formDescriptionId}\n className={cn(\n 'text-text-positive-weak text-sm/6 leading-normal font-normal',\n 'group-has-data-[orientation=horizontal]/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n );\n}\n\n/** Displays the validation error message for the field, or falls back to `children` when there is no error. */\nfunction FormMessage({ className, children, ...props }: React.ComponentProps<'p'>) {\n const { error, formMessageId } = useFormField();\n\n return (\n <span data-slot=\"form-message\" id={formMessageId} className={cn('text-danger text-xs', className)} {...props}>\n {error ? String(error?.message ?? '') : children}\n </span>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"form.js","names":["SlotPrimitive"],"sources":["../../packages/components/ui/form.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@customafk/react-toolkit/utils';\nimport { type Label as LabelPrimitive, Slot as SlotPrimitive } from 'radix-ui';\nimport { createContext, memo, use, useId } from 'react';\nimport type { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';\nimport { Controller, FormProvider, useFormContext, useFormState } from 'react-hook-form';\nimport { Field, FieldDescription, FieldLabel } from './field';\n\n/**\n * Re-export of react-hook-form's `FormProvider`; wrap your form with this to give all nested form components access to the form context.\n *\n * @example\n * ```tsx\n * import { Form, FormField, FormItem, FormLabel, FormControl, FormMessage } from '@customafk/lunas-ui/ui/form';\n * import { useForm } from 'react-hook-form';\n *\n * const form = useForm<{ username: string }>();\n *\n * <Form {...form}>\n * <form onSubmit={form.handleSubmit(onSubmit)}>\n * <FormField\n * control={form.control}\n * name=\"username\"\n * render={({ field }) => (\n * <FormItem>\n * <FormLabel>Username</FormLabel>\n * <FormControl><input {...field} /></FormControl>\n * <FormMessage />\n * </FormItem>\n * )}\n * />\n * </form>\n * </Form>\n * ```\n */\nconst Form = FormProvider;\n\ntype FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {\n name: TName;\n};\n\nconst FormFieldContext = createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\n/**\n * Connects a single react-hook-form field to the form context; renders a `Controller` and passes `name` down to nested FormItem, FormLabel, FormControl, and FormMessage.\n */\nconst FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\n/**\n * Hook that returns the field state and IDs for the enclosing FormField.\n * Must be called inside a component rendered within a `<FormField>`.\n */\nconst useFormField = () => {\n const fieldContext = use(FormFieldContext);\n const itemContext = use(FormItemContext);\n const { getFieldState, control, resetField } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const { id } = itemContext;\n\n return {\n id,\n control,\n resetField,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = createContext<FormItemContextValue>({} as FormItemContextValue);\n\n/**\n * Container for a single form field — generates a unique ID and provides it via context to FormLabel, FormControl, and FormMessage.\n *\n * @param orientation - Layout direction: `'vertical'`, `'horizontal'`, or `'responsive'` (default).\n */\nconst FormItem = memo(\n ({\n className,\n orientation = 'responsive',\n ...props\n }: React.ComponentProps<'div'> & {\n orientation?: 'vertical' | 'horizontal' | 'responsive';\n }) => {\n const id = useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <Field orientation={orientation} {...props} className={className} />\n </FormItemContext.Provider>\n );\n }\n);\nFormItem.displayName = 'FormItem';\n\n/** Styled label automatically associated with the FormItem's control via `htmlFor`. */\nconst FormLabel = memo(({ ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) => {\n const { formItemId } = useFormField();\n return <FieldLabel htmlFor={formItemId} {...props} />;\n});\nFormLabel.displayName = 'FormLabel';\n\n/** Radix Slot wrapper that wires the correct `id`, `aria-describedby`, and `aria-invalid` attributes onto the underlying control element. */\nconst FormControl = memo(({ ...props }: React.ComponentProps<typeof SlotPrimitive.Slot>) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <SlotPrimitive.Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n});\nFormControl.displayName = 'FormControl';\n\n/** Helper text displayed below the control that provides additional context about the field. */\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { formDescriptionId } = useFormField();\n\n return (\n <FieldDescription\n id={formDescriptionId}\n className={cn(\n 'text-text-positive-weak text-sm/6 leading-normal font-normal',\n 'group-has-data-[orientation=horizontal]/field:text-balance',\n 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',\n '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',\n className\n )}\n {...props}\n />\n );\n}\n\n/** Displays the validation error message for the field, or falls back to `children` when there is no error. */\nfunction FormMessage({ className, children, ...props }: React.ComponentProps<'p'>) {\n const { error, formMessageId } = useFormField();\n\n return (\n <span data-slot=\"form-message\" id={formMessageId} className={cn('text-danger text-xs', className)} {...props}>\n {error ? String(error?.message ?? '') : children}\n </span>\n );\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };\n"],"mappings":"yWAoCA,MAAM,EAAO,EAMP,EAAmB,EAAqC,EAAE,CAA0B,CAKpF,GAA8H,CAClI,GAAG,KAGD,EAAC,EAAiB,SAAA,CAAS,MAAO,CAAE,KAAM,EAAM,KAAM,UACpD,EAAC,EAAA,CAAW,GAAI,EAAA,CAAS,EACC,CAQ1B,MAAqB,CACzB,IAAM,EAAe,EAAI,EAAiB,CACpC,EAAc,EAAI,EAAgB,CAClC,CAAE,gBAAe,UAAS,cAAe,GAAgB,CACzD,EAAY,EAAa,CAAE,KAAM,EAAa,KAAM,CAAC,CACrD,EAAa,EAAc,EAAa,KAAM,EAAU,CAE9D,GAAI,CAAC,EACH,MAAU,MAAM,iDAAiD,CAGnE,GAAM,CAAE,MAAO,EAEf,MAAO,CACL,KACA,UACA,aACA,KAAM,EAAa,KACnB,WAAY,GAAG,EAAG,YAClB,kBAAmB,GAAG,EAAG,wBACzB,cAAe,GAAG,EAAG,oBACrB,GAAG,EACJ,EAOG,EAAkB,EAAoC,EAAE,CAAyB,CAOjF,EAAW,GACd,CACC,YACA,cAAc,aACd,GAAG,KAGC,CACJ,IAAM,EAAK,GAAO,CAElB,OACE,EAAC,EAAgB,SAAA,CAAS,MAAO,CAAE,KAAI,UACrC,EAAC,EAAA,CAAmB,cAAa,GAAI,EAAkB,aAAa,EAC3C,EAGhC,CACD,EAAS,YAAc,WAGvB,MAAM,EAAY,GAAM,CAAE,GAAG,KAA8D,CACzF,GAAM,CAAE,cAAe,GAAc,CACrC,OAAO,EAAC,EAAA,CAAW,QAAS,EAAY,GAAI,GAAS,EACrD,CACF,EAAU,YAAc,YAGxB,MAAM,EAAc,GAAM,CAAE,GAAG,KAA6D,CAC1F,GAAM,CAAE,QAAO,aAAY,oBAAmB,iBAAkB,GAAc,CAE9E,OACE,EAACA,EAAc,KAAA,CACb,YAAU,eACV,GAAI,EACJ,mBAAmB,EAAiC,GAAG,EAAkB,GAAG,IAAjD,GAAG,IAC9B,eAAc,CAAC,CAAC,EAChB,GAAI,GACJ,EAEJ,CACF,EAAY,YAAc,cAG1B,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAoC,CAC3E,GAAM,CAAE,qBAAsB,GAAc,CAE5C,OACE,EAAC,EAAA,CACC,GAAI,EACJ,UAAW,EACT,+DACA,6DACA,+DACA,oEACA,EACD,CACD,GAAI,GACJ,CAKN,SAAS,EAAY,CAAE,YAAW,WAAU,GAAG,GAAoC,CACjF,GAAM,CAAE,QAAO,iBAAkB,GAAc,CAE/C,OACE,EAAC,OAAA,CAAK,YAAU,eAAe,GAAI,EAAe,UAAW,EAAG,sBAAuB,EAAU,CAAE,GAAI,WACpG,EAAQ,OAAO,GAAO,SAAW,GAAG,CAAG,GACnC"}
|
package/dist/ui/hover-card.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-
|
|
1
|
+
"use client";const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`@customafk/react-toolkit/utils`),n=require(`react/jsx-runtime`),r=require(`radix-ui`);function i({...e}){return(0,n.jsx)(r.HoverCard.Root,{"data-slot":`hover-card`,...e})}function a({...e}){return(0,n.jsx)(r.HoverCard.Trigger,{"data-slot":`hover-card-trigger`,...e})}function o({className:e,align:i=`center`,sideOffset:a=4,...o}){return(0,n.jsx)(r.HoverCard.Portal,{"data-slot":`hover-card-portal`,children:(0,n.jsx)(r.HoverCard.Content,{"data-slot":`hover-card-content`,align:i,sideOffset:a,className:(0,t.cn)(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden`,e),...o})})}exports.HoverCard=i,exports.HoverCardContent=o,exports.HoverCardTrigger=a;
|
|
2
2
|
//# sourceMappingURL=hover-card.cjs.map
|
package/dist/ui/hover-card.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react161 from "react";
|
|
2
2
|
import { HoverCard as HoverCard$1 } from "radix-ui";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/hover-card.d.ts
|
|
@@ -20,18 +20,18 @@ import { HoverCard as HoverCard$1 } from "radix-ui";
|
|
|
20
20
|
*/
|
|
21
21
|
declare function HoverCard({
|
|
22
22
|
...props
|
|
23
|
-
}: React.ComponentProps<typeof HoverCard$1.Root>):
|
|
23
|
+
}: React.ComponentProps<typeof HoverCard$1.Root>): react161.JSX.Element;
|
|
24
24
|
/** The element that triggers the HoverCard on pointer enter. */
|
|
25
25
|
declare function HoverCardTrigger({
|
|
26
26
|
...props
|
|
27
|
-
}: React.ComponentProps<typeof HoverCard$1.Trigger>):
|
|
27
|
+
}: React.ComponentProps<typeof HoverCard$1.Trigger>): react161.JSX.Element;
|
|
28
28
|
/** The floating card panel displayed when the trigger is hovered. */
|
|
29
29
|
declare function HoverCardContent({
|
|
30
30
|
className,
|
|
31
31
|
align,
|
|
32
32
|
sideOffset,
|
|
33
33
|
...props
|
|
34
|
-
}: React.ComponentProps<typeof HoverCard$1.Content>):
|
|
34
|
+
}: React.ComponentProps<typeof HoverCard$1.Content>): react161.JSX.Element;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { HoverCard, HoverCardContent, HoverCardTrigger };
|
|
37
37
|
//# sourceMappingURL=hover-card.d.cts.map
|
package/dist/ui/hover-card.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react153 from "react";
|
|
2
2
|
import { HoverCard as HoverCard$1 } from "radix-ui";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/hover-card.d.ts
|
|
@@ -20,18 +20,18 @@ import { HoverCard as HoverCard$1 } from "radix-ui";
|
|
|
20
20
|
*/
|
|
21
21
|
declare function HoverCard({
|
|
22
22
|
...props
|
|
23
|
-
}: React.ComponentProps<typeof HoverCard$1.Root>):
|
|
23
|
+
}: React.ComponentProps<typeof HoverCard$1.Root>): react153.JSX.Element;
|
|
24
24
|
/** The element that triggers the HoverCard on pointer enter. */
|
|
25
25
|
declare function HoverCardTrigger({
|
|
26
26
|
...props
|
|
27
|
-
}: React.ComponentProps<typeof HoverCard$1.Trigger>):
|
|
27
|
+
}: React.ComponentProps<typeof HoverCard$1.Trigger>): react153.JSX.Element;
|
|
28
28
|
/** The floating card panel displayed when the trigger is hovered. */
|
|
29
29
|
declare function HoverCardContent({
|
|
30
30
|
className,
|
|
31
31
|
align,
|
|
32
32
|
sideOffset,
|
|
33
33
|
...props
|
|
34
|
-
}: React.ComponentProps<typeof HoverCard$1.Content>):
|
|
34
|
+
}: React.ComponentProps<typeof HoverCard$1.Content>): react153.JSX.Element;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { HoverCard, HoverCardContent, HoverCardTrigger };
|
|
37
37
|
//# sourceMappingURL=hover-card.d.ts.map
|
package/dist/ui/image.cjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
require(`../skeleton-
|
|
1
|
+
const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../skeleton-oQFT4xR2.cjs`);let n=require(`lucide-react`),r=require(`@customafk/react-toolkit/utils`),i=require(`react/jsx-runtime`),a=require(`react`);const o=({src:e,alt:o,width:s,height:c,maxRetries:l=3,retryDelay:u=500,className:d,imageClassName:f,onClick:p})=>{let m=(0,a.useRef)(null),[h,g]=(0,a.useState)(e),[_,v]=(0,a.useState)(0),[y,b]=(0,a.useState)(!1),[x,S]=(0,a.useState)(!1),C=(0,a.useCallback)(()=>{b(!0)},[]),w=(0,a.useCallback)(()=>{if(_<l){S(!1);let t=_+1;v(t),setTimeout(()=>{g(e+`?retry=${Date.now()}&attempt=${t}`)},u*t);return}S(!0),b(!0),g(e)},[l,_,u,e]);return x?(0,i.jsx)(`div`,{style:{width:s,height:c},className:(0,r.cn)(`@container relative inline-block`,d),children:(0,i.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-y-2 rounded bg-danger-muted shadow-card`,children:[(0,i.jsx)(n.AlertCircleIcon,{className:`@max-[52px]:size-6 size-8 text-danger`}),(0,i.jsx)(`span`,{className:`@max-[96px]:sr-only text-center text-danger-weak text-xs`,children:`Image failed to load`})]})}):(0,i.jsxs)(`div`,{style:{width:s,height:c},className:(0,r.cn)(`relative flex items-center justify-center overflow-hidden rounded`,d),onClick:p,children:[!y&&(0,i.jsx)(t.t,{className:`absolute inset-0 flex size-full animate-pulse items-center justify-center`}),(0,i.jsx)(`img`,{src:h,className:`absolute inset-0 z-0 size-full scale-110 object-cover blur-xl brightness-60`}),(0,i.jsx)(`img`,{id:h,ref:m,src:h,alt:o,loading:`lazy`,className:(0,r.cn)(`relative h-6/5 w-auto object-cover shadow-card transition-opacity duration-300`,y&&`opacity-100`,!y&&`pointer-events-none opacity-0`,f),onLoad:C,onError:w})]})};exports.Image=o;
|
|
2
|
+
//# sourceMappingURL=image.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.cjs","names":["Image: React.FC<Props>","AlertCircleIcon","Skeleton"],"sources":["../../packages/components/ui/image.tsx"],"sourcesContent":["import { useCallback, useRef, useState } from 'react';\n\nimport { AlertCircleIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Skeleton } from './skeleton';\n\n/** Props for the Image component. */\ntype Props = {\n /** URL of the image to display. */\n src?: string;\n /** Accessible alt text for the image. */\n alt?: string;\n /** Width of the image container (number treated as pixels). */\n width?: number | string;\n /** Height of the image container (number treated as pixels). */\n height?: number | string;\n /** Maximum number of retry attempts on load failure before showing an error state. @default 3 */\n maxRetries?: number;\n /** Base delay in milliseconds between retry attempts (multiplied by the attempt count). @default 500 */\n retryDelay?: number;\n /** Class name applied to the outer container div. */\n className?: string;\n /** Class name applied to the `<img>` element. */\n imageClassName?: string;\n /** Click handler for the image container. */\n onClick?: () => void;\n};\n\n/**\n * A lazy-loading image with an automatic retry mechanism, a blurred background placeholder, a skeleton loader, and an error fallback.\n *\n * @example\n * ```tsx\n * import { Image } from '@customafk/lunas-ui/ui/image';\n *\n * <Image src=\"/hero.jpg\" alt=\"Hero\" width={400} height={300} maxRetries={3} />\n * ```\n */\nexport const Image: React.FC<Props> = ({ src, alt, width, height, maxRetries = 3, retryDelay = 500, className, imageClassName, onClick }) => {\n const imageRef = useRef<HTMLImageElement>(null);\n const [currentSrc, setCurrentSrc] = useState<string | undefined>(src);\n const [retryCount, setRetryCount] = useState<number>(0);\n const [isLoaded, setIsLoaded] = useState<boolean>(false);\n const [hasError, setHasError] = useState<boolean>(false);\n\n const handleLoad = useCallback(() => {\n setIsLoaded(true);\n }, []);\n\n const handleError = useCallback(() => {\n if (retryCount < maxRetries) {\n // imageRef.current?.style.setProperty('display', 'none')\n setHasError(false);\n const newRetryCount = retryCount + 1;\n setRetryCount(newRetryCount);\n\n // Retry with exponential backoff and cache busting\n setTimeout(() => {\n const cacheBuster = `?retry=${Date.now()}&attempt=${newRetryCount}`;\n setCurrentSrc(src + cacheBuster);\n }, retryDelay * newRetryCount);\n return;\n }\n\n setHasError(true);\n setIsLoaded(true);\n setCurrentSrc(src);\n }, [maxRetries, retryCount, retryDelay, src]);\n\n if (hasError) {\n return (\n <div style={{ width, height }} className={cn('@container relative inline-block', className)}>\n <div className=\"flex size-full flex-col items-center justify-center gap-y-2 rounded bg-danger-muted shadow-card\">\n <AlertCircleIcon className=\"@max-[52px]:size-6 size-8 text-danger\" />\n <span className=\"@max-[96px]:sr-only text-center text-danger-weak text-xs\">Image failed to load</span>\n </div>\n </div>\n );\n }\n\n return (\n <div style={{ width, height }} className={cn('relative flex items-center justify-center overflow-hidden rounded', className)} onClick={onClick}>\n {!isLoaded && <Skeleton className=\"absolute inset-0 flex size-full animate-pulse items-center justify-center\" />}\n <img src={currentSrc} className=\"absolute inset-0 z-0 size-full scale-110 object-cover blur-xl brightness-60\" />\n <img\n id={currentSrc}\n ref={imageRef}\n src={currentSrc}\n alt={alt}\n loading=\"lazy\"\n className={cn(\n 'relative h-6/5 w-auto object-cover shadow-card transition-opacity duration-300',\n isLoaded && 'opacity-100',\n !isLoaded && 'pointer-events-none opacity-0',\n imageClassName\n )}\n onLoad={handleLoad}\n onError={handleError}\n />\n </div>\n );\n};\n"],"mappings":"2MAwCA,MAAaA,GAA0B,CAAE,MAAK,MAAK,QAAO,SAAQ,aAAa,EAAG,aAAa,IAAK,YAAW,iBAAgB,aAAc,CAC3I,IAAM,GAAA,EAAA,EAAA,QAAoC,KAAK,CACzC,CAAC,EAAY,IAAA,EAAA,EAAA,UAA8C,EAAI,CAC/D,CAAC,EAAY,IAAA,EAAA,EAAA,UAAkC,EAAE,CACjD,CAAC,EAAU,IAAA,EAAA,EAAA,UAAiC,GAAM,CAClD,CAAC,EAAU,IAAA,EAAA,EAAA,UAAiC,GAAM,CAElD,GAAA,EAAA,EAAA,iBAA+B,CACnC,EAAY,GAAK,EAChB,EAAE,CAAC,CAEA,GAAA,EAAA,EAAA,iBAAgC,CACpC,GAAI,EAAa,EAAY,CAE3B,EAAY,GAAM,CAClB,IAAM,EAAgB,EAAa,EACnC,EAAc,EAAc,CAG5B,eAAiB,CAEf,EAAc,EADM,UAAU,KAAK,KAAK,CAAC,WAAW,IACpB,EAC/B,EAAa,EAAc,CAC9B,OAGF,EAAY,GAAK,CACjB,EAAY,GAAK,CACjB,EAAc,EAAI,EACjB,CAAC,EAAY,EAAY,EAAY,EAAI,CAAC,CAa7C,OAXI,GAEA,EAAA,EAAA,KAAC,MAAA,CAAI,MAAO,CAAE,QAAO,SAAQ,CAAE,WAAA,EAAA,EAAA,IAAc,mCAAoC,EAAU,WACzF,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,6GACb,EAAA,EAAA,KAACC,EAAAA,gBAAAA,CAAgB,UAAU,wCAAA,CAA0C,EACrE,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,oEAA2D,wBAA2B,CAAA,EAClG,EACF,EAKR,EAAA,EAAA,MAAC,MAAA,CAAI,MAAO,CAAE,QAAO,SAAQ,CAAE,WAAA,EAAA,EAAA,IAAc,oEAAqE,EAAU,CAAW,oBACpI,CAAC,IAAY,EAAA,EAAA,KAACC,EAAAA,EAAAA,CAAS,UAAU,4EAAA,CAA8E,EAChH,EAAA,EAAA,KAAC,MAAA,CAAI,IAAK,EAAY,UAAU,+EAAgF,EAChH,EAAA,EAAA,KAAC,MAAA,CACC,GAAI,EACJ,IAAK,EACL,IAAK,EACA,MACL,QAAQ,OACR,WAAA,EAAA,EAAA,IACE,iFACA,GAAY,cACZ,CAAC,GAAY,gCACb,EACD,CACD,OAAQ,EACR,QAAS,GACT,GACE"}
|
package/dist/ui/image.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import"../skeleton-
|
|
1
|
+
import{t as e}from"../skeleton-DAcbjBGp.js";import{AlertCircleIcon as t}from"lucide-react";import{cn as n}from"@customafk/react-toolkit/utils";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{useCallback as a,useRef as o,useState as s}from"react";const c=({src:c,alt:l,width:u,height:d,maxRetries:f=3,retryDelay:p=500,className:m,imageClassName:h,onClick:g})=>{let _=o(null),[v,y]=s(c),[b,x]=s(0),[S,C]=s(!1),[w,T]=s(!1),E=a(()=>{C(!0)},[]),D=a(()=>{if(b<f){T(!1);let e=b+1;x(e),setTimeout(()=>{y(c+`?retry=${Date.now()}&attempt=${e}`)},p*e);return}T(!0),C(!0),y(c)},[f,b,p,c]);return w?r(`div`,{style:{width:u,height:d},className:n(`@container relative inline-block`,m),children:i(`div`,{className:`flex size-full flex-col items-center justify-center gap-y-2 rounded bg-danger-muted shadow-card`,children:[r(t,{className:`@max-[52px]:size-6 size-8 text-danger`}),r(`span`,{className:`@max-[96px]:sr-only text-center text-danger-weak text-xs`,children:`Image failed to load`})]})}):i(`div`,{style:{width:u,height:d},className:n(`relative flex items-center justify-center overflow-hidden rounded`,m),onClick:g,children:[!S&&r(e,{className:`absolute inset-0 flex size-full animate-pulse items-center justify-center`}),r(`img`,{src:v,className:`absolute inset-0 z-0 size-full scale-110 object-cover blur-xl brightness-60`}),r(`img`,{id:v,ref:_,src:v,alt:l,loading:`lazy`,className:n(`relative h-6/5 w-auto object-cover shadow-card transition-opacity duration-300`,S&&`opacity-100`,!S&&`pointer-events-none opacity-0`,h),onLoad:E,onError:D})]})};export{c as Image};
|
|
2
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.js","names":["Image: React.FC<Props>"],"sources":["../../packages/components/ui/image.tsx"],"sourcesContent":["import { useCallback, useRef, useState } from 'react';\n\nimport { AlertCircleIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Skeleton } from './skeleton';\n\n/** Props for the Image component. */\ntype Props = {\n /** URL of the image to display. */\n src?: string;\n /** Accessible alt text for the image. */\n alt?: string;\n /** Width of the image container (number treated as pixels). */\n width?: number | string;\n /** Height of the image container (number treated as pixels). */\n height?: number | string;\n /** Maximum number of retry attempts on load failure before showing an error state. @default 3 */\n maxRetries?: number;\n /** Base delay in milliseconds between retry attempts (multiplied by the attempt count). @default 500 */\n retryDelay?: number;\n /** Class name applied to the outer container div. */\n className?: string;\n /** Class name applied to the `<img>` element. */\n imageClassName?: string;\n /** Click handler for the image container. */\n onClick?: () => void;\n};\n\n/**\n * A lazy-loading image with an automatic retry mechanism, a blurred background placeholder, a skeleton loader, and an error fallback.\n *\n * @example\n * ```tsx\n * import { Image } from '@customafk/lunas-ui/ui/image';\n *\n * <Image src=\"/hero.jpg\" alt=\"Hero\" width={400} height={300} maxRetries={3} />\n * ```\n */\nexport const Image: React.FC<Props> = ({ src, alt, width, height, maxRetries = 3, retryDelay = 500, className, imageClassName, onClick }) => {\n const imageRef = useRef<HTMLImageElement>(null);\n const [currentSrc, setCurrentSrc] = useState<string | undefined>(src);\n const [retryCount, setRetryCount] = useState<number>(0);\n const [isLoaded, setIsLoaded] = useState<boolean>(false);\n const [hasError, setHasError] = useState<boolean>(false);\n\n const handleLoad = useCallback(() => {\n setIsLoaded(true);\n }, []);\n\n const handleError = useCallback(() => {\n if (retryCount < maxRetries) {\n // imageRef.current?.style.setProperty('display', 'none')\n setHasError(false);\n const newRetryCount = retryCount + 1;\n setRetryCount(newRetryCount);\n\n // Retry with exponential backoff and cache busting\n setTimeout(() => {\n const cacheBuster = `?retry=${Date.now()}&attempt=${newRetryCount}`;\n setCurrentSrc(src + cacheBuster);\n }, retryDelay * newRetryCount);\n return;\n }\n\n setHasError(true);\n setIsLoaded(true);\n setCurrentSrc(src);\n }, [maxRetries, retryCount, retryDelay, src]);\n\n if (hasError) {\n return (\n <div style={{ width, height }} className={cn('@container relative inline-block', className)}>\n <div className=\"flex size-full flex-col items-center justify-center gap-y-2 rounded bg-danger-muted shadow-card\">\n <AlertCircleIcon className=\"@max-[52px]:size-6 size-8 text-danger\" />\n <span className=\"@max-[96px]:sr-only text-center text-danger-weak text-xs\">Image failed to load</span>\n </div>\n </div>\n );\n }\n\n return (\n <div style={{ width, height }} className={cn('relative flex items-center justify-center overflow-hidden rounded', className)} onClick={onClick}>\n {!isLoaded && <Skeleton className=\"absolute inset-0 flex size-full animate-pulse items-center justify-center\" />}\n <img src={currentSrc} className=\"absolute inset-0 z-0 size-full scale-110 object-cover blur-xl brightness-60\" />\n <img\n id={currentSrc}\n ref={imageRef}\n src={currentSrc}\n alt={alt}\n loading=\"lazy\"\n className={cn(\n 'relative h-6/5 w-auto object-cover shadow-card transition-opacity duration-300',\n isLoaded && 'opacity-100',\n !isLoaded && 'pointer-events-none opacity-0',\n imageClassName\n )}\n onLoad={handleLoad}\n onError={handleError}\n />\n </div>\n );\n};\n"],"mappings":"+PAwCA,MAAaA,GAA0B,CAAE,MAAK,MAAK,QAAO,SAAQ,aAAa,EAAG,aAAa,IAAK,YAAW,iBAAgB,aAAc,CAC3I,IAAM,EAAW,EAAyB,KAAK,CACzC,CAAC,EAAY,GAAiB,EAA6B,EAAI,CAC/D,CAAC,EAAY,GAAiB,EAAiB,EAAE,CACjD,CAAC,EAAU,GAAe,EAAkB,GAAM,CAClD,CAAC,EAAU,GAAe,EAAkB,GAAM,CAElD,EAAa,MAAkB,CACnC,EAAY,GAAK,EAChB,EAAE,CAAC,CAEA,EAAc,MAAkB,CACpC,GAAI,EAAa,EAAY,CAE3B,EAAY,GAAM,CAClB,IAAM,EAAgB,EAAa,EACnC,EAAc,EAAc,CAG5B,eAAiB,CAEf,EAAc,EADM,UAAU,KAAK,KAAK,CAAC,WAAW,IACpB,EAC/B,EAAa,EAAc,CAC9B,OAGF,EAAY,GAAK,CACjB,EAAY,GAAK,CACjB,EAAc,EAAI,EACjB,CAAC,EAAY,EAAY,EAAY,EAAI,CAAC,CAa7C,OAXI,EAEA,EAAC,MAAA,CAAI,MAAO,CAAE,QAAO,SAAQ,CAAE,UAAW,EAAG,mCAAoC,EAAU,UACzF,EAAC,MAAA,CAAI,UAAU,4GACb,EAAC,EAAA,CAAgB,UAAU,wCAAA,CAA0C,CACrE,EAAC,OAAA,CAAK,UAAU,oEAA2D,wBAA2B,CAAA,EAClG,EACF,CAKR,EAAC,MAAA,CAAI,MAAO,CAAE,QAAO,SAAQ,CAAE,UAAW,EAAG,oEAAqE,EAAU,CAAW,oBACpI,CAAC,GAAY,EAAC,EAAA,CAAS,UAAU,4EAAA,CAA8E,CAChH,EAAC,MAAA,CAAI,IAAK,EAAY,UAAU,+EAAgF,CAChH,EAAC,MAAA,CACC,GAAI,EACJ,IAAK,EACL,IAAK,EACA,MACL,QAAQ,OACR,UAAW,EACT,iFACA,GAAY,cACZ,CAAC,GAAY,gCACb,EACD,CACD,OAAQ,EACR,QAAS,GACT,GACE"}
|
package/dist/ui/input-otp.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../chunk-
|
|
1
|
+
"use client";const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`lucide-react`),n=require(`@customafk/react-toolkit/utils`),r=require(`react/jsx-runtime`),i=require(`react`),a=require(`input-otp`);function o({className:e,containerClassName:t,...i}){return(0,r.jsx)(a.OTPInput,{"data-slot":`input-otp`,containerClassName:(0,n.cn)(`flex items-center gap-2 has-disabled:opacity-50`,t),className:(0,n.cn)(`disabled:cursor-not-allowed`,e),...i})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`input-otp-group`,className:(0,n.cn)(`flex items-center`,e),...t})}function c({index:e,className:t,...o}){let{char:s,hasFakeCaret:c,isActive:l}=(0,i.use)(a.OTPInputContext)?.slots[e]??{};return(0,r.jsxs)(`div`,{"data-slot":`input-otp-slot`,"data-active":l,className:(0,n.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 h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs 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]`,t),...o,children:[s,c&&(0,r.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,r.jsx)(`div`,{className:`animate-caret-blink bg-foreground h-4 w-px duration-1000`})})]})}function l({...e}){return(0,r.jsx)(`div`,{"data-slot":`input-otp-separator`,role:`separator`,...e,children:(0,r.jsx)(t.MinusIcon,{})})}exports.InputOTP=o,exports.InputOTPGroup=s,exports.InputOTPSeparator=l,exports.InputOTPSlot=c;
|
|
2
2
|
//# sourceMappingURL=input-otp.cjs.map
|
package/dist/ui/input-otp.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react197 from "react";
|
|
2
2
|
import { OTPInput } from "input-otp";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/input-otp.d.ts
|
|
@@ -32,12 +32,12 @@ declare function InputOTP({
|
|
|
32
32
|
}: React.ComponentProps<typeof OTPInput> & {
|
|
33
33
|
/** Class name applied to the outer container div. */
|
|
34
34
|
containerClassName?: string;
|
|
35
|
-
}):
|
|
35
|
+
}): react197.JSX.Element;
|
|
36
36
|
/** Flex container that groups a sequence of InputOTPSlot elements. */
|
|
37
37
|
declare function InputOTPGroup({
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<'div'>):
|
|
40
|
+
}: React.ComponentProps<'div'>): react197.JSX.Element;
|
|
41
41
|
/**
|
|
42
42
|
* A single character slot in an InputOTP — displays the typed character and a blinking caret when focused.
|
|
43
43
|
*
|
|
@@ -49,11 +49,11 @@ declare function InputOTPSlot({
|
|
|
49
49
|
...props
|
|
50
50
|
}: React.ComponentProps<'div'> & {
|
|
51
51
|
index: number;
|
|
52
|
-
}):
|
|
52
|
+
}): react197.JSX.Element;
|
|
53
53
|
/** Visual separator (dash) placed between InputOTPGroup elements. */
|
|
54
54
|
declare function InputOTPSeparator({
|
|
55
55
|
...props
|
|
56
|
-
}: React.ComponentProps<'div'>):
|
|
56
|
+
}: React.ComponentProps<'div'>): react197.JSX.Element;
|
|
57
57
|
//#endregion
|
|
58
58
|
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
59
59
|
//# sourceMappingURL=input-otp.d.cts.map
|
package/dist/ui/input-otp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react186 from "react";
|
|
2
2
|
import { OTPInput } from "input-otp";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/input-otp.d.ts
|
|
@@ -32,12 +32,12 @@ declare function InputOTP({
|
|
|
32
32
|
}: React.ComponentProps<typeof OTPInput> & {
|
|
33
33
|
/** Class name applied to the outer container div. */
|
|
34
34
|
containerClassName?: string;
|
|
35
|
-
}):
|
|
35
|
+
}): react186.JSX.Element;
|
|
36
36
|
/** Flex container that groups a sequence of InputOTPSlot elements. */
|
|
37
37
|
declare function InputOTPGroup({
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<'div'>):
|
|
40
|
+
}: React.ComponentProps<'div'>): react186.JSX.Element;
|
|
41
41
|
/**
|
|
42
42
|
* A single character slot in an InputOTP — displays the typed character and a blinking caret when focused.
|
|
43
43
|
*
|
|
@@ -49,11 +49,11 @@ declare function InputOTPSlot({
|
|
|
49
49
|
...props
|
|
50
50
|
}: React.ComponentProps<'div'> & {
|
|
51
51
|
index: number;
|
|
52
|
-
}):
|
|
52
|
+
}): react186.JSX.Element;
|
|
53
53
|
/** Visual separator (dash) placed between InputOTPGroup elements. */
|
|
54
54
|
declare function InputOTPSeparator({
|
|
55
55
|
...props
|
|
56
|
-
}: React.ComponentProps<'div'>):
|
|
56
|
+
}: React.ComponentProps<'div'>): react186.JSX.Element;
|
|
57
57
|
//#endregion
|
|
58
58
|
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
59
59
|
//# sourceMappingURL=input-otp.d.ts.map
|
package/dist/ui/input-otp.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{MinusIcon as e}from"lucide-react";import{
|
|
1
|
+
"use client";import{MinusIcon as e}from"lucide-react";import{cn as t}from"@customafk/react-toolkit/utils";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{use as i}from"react";import{OTPInput as a,OTPInputContext as o}from"input-otp";function s({className:e,containerClassName:r,...i}){return n(a,{"data-slot":`input-otp`,containerClassName:t(`flex items-center gap-2 has-disabled:opacity-50`,r),className:t(`disabled:cursor-not-allowed`,e),...i})}function c({className:e,...r}){return n(`div`,{"data-slot":`input-otp-group`,className:t(`flex items-center`,e),...r})}function l({index:e,className:a,...s}){let{char:c,hasFakeCaret:l,isActive:u}=i(o)?.slots[e]??{};return r(`div`,{"data-slot":`input-otp-slot`,"data-active":u,className:t(`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 h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs 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]`,a),...s,children:[c,l&&n(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:n(`div`,{className:`animate-caret-blink bg-foreground h-4 w-px duration-1000`})})]})}function u({...t}){return n(`div`,{"data-slot":`input-otp-separator`,role:`separator`,...t,children:n(e,{})})}export{s as InputOTP,c as InputOTPGroup,u as InputOTPSeparator,l as InputOTPSlot};
|
|
2
2
|
//# sourceMappingURL=input-otp.js.map
|
package/dist/ui/input.cjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use client";const e=require(`../
|
|
1
|
+
"use client";const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`class-variance-authority`),n=require(`react/jsx-runtime`),r=require(`react`);const i=(0,t.cva)([`w-full rounded font-normal text-text-positive caret-primary transition-all tabular-nums`,`placeholder:text-text-positive-muted`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`read-only:pointer-events-none read-only:bg-muted-muted read-only:placeholder:text-text-positive-weak`],{variants:{variant:{outline:[`outline-1 outline-border -outline-offset-1 bg-transparent shadow-input`,`focus-visible:outline-primary-strong`,`focus-visible:ring-4`,`focus-visible:ring-primary-weak`,`aria-invalid:outline-danger`,`aria-invalid:ring-danger-weak`,`aria-invalid:bg-danger-bg-subtle`,`aria-invalid:focus-visible:outline-danger-strong`,`aria-invalid:focus-visible:ring-4`,`aria-invalid:placeholder:text-text-positive-weak`],ghost:``,none:``,soft:``,subtle:``},size:{xs:`px-2 py-1 text-xs leading-4`,sm:`px-2.5 py-1.5 text-xs leading-4`,md:`px-2.5 py-2 text-sm leading-5`,lg:`px-3 py-2 text-sm leading-5`,xl:`px-3 py-2 text-base leading-6`}},defaultVariants:{variant:`outline`,size:`md`}});function a({className:e,variant:t,size:a,onChange:o,onValueChange:s,...c}){let l=(0,r.useCallback)(e=>{o?.(e),s?.(e.target.value)},[o,s]);return(0,n.jsx)(`input`,{"data-slot":`input`,className:i({variant:t,size:a,className:e}),...c,onChange:l})}exports.Input=a,exports.inputVariants=i;
|
|
2
|
+
//# sourceMappingURL=input.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.cjs","names":[],"sources":["../../packages/components/ui/input.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useCallback } from 'react';\n\n/** CVA variant definitions for the `Input` component — controls sizing and visual style. */\nexport const inputVariants = cva(\n [\n 'w-full rounded font-normal text-text-positive caret-primary transition-all tabular-nums',\n 'placeholder:text-text-positive-muted',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n 'read-only:pointer-events-none read-only:bg-muted-muted read-only:placeholder:text-text-positive-weak',\n ],\n {\n variants: {\n variant: {\n outline: [\n 'outline-1 outline-border -outline-offset-1 bg-transparent shadow-input',\n 'focus-visible:outline-primary-strong',\n 'focus-visible:ring-4',\n 'focus-visible:ring-primary-weak',\n 'aria-invalid:outline-danger',\n 'aria-invalid:ring-danger-weak',\n 'aria-invalid:bg-danger-bg-subtle',\n 'aria-invalid:focus-visible:outline-danger-strong',\n 'aria-invalid:focus-visible:ring-4',\n 'aria-invalid:placeholder:text-text-positive-weak',\n ],\n ghost: '',\n none: '',\n soft: '',\n subtle: '',\n },\n size: {\n xs: 'px-2 py-1 text-xs leading-4',\n sm: 'px-2.5 py-1.5 text-xs leading-4',\n md: 'px-2.5 py-2 text-sm leading-5',\n lg: 'px-3 py-2 text-sm leading-5',\n xl: 'px-3 py-2 text-base leading-6',\n },\n },\n defaultVariants: {\n variant: 'outline',\n size: 'md',\n },\n }\n);\n\nexport type InputVariantProps = VariantProps<typeof inputVariants>;\n\n/**\n * Styled text input field built on the native `<input>` element with CVA-driven size and variant tokens.\n *\n * @example\n * ```tsx\n * import { Input } from '@customafk/lunas-ui/ui/input';\n *\n * <Input\n * placeholder=\"Enter your name\"\n * variant=\"outline\"\n * size=\"md\"\n * onValueChange={(value) => console.log(value)}\n * />\n * ```\n */\nfunction Input({\n className,\n variant,\n size,\n onChange,\n onValueChange,\n ...props\n}: Omit<React.ComponentProps<'input'>, 'size'> & {\n /** Visual style of the input border — `'outline'` (default), `'ghost'`, `'none'`, `'soft'`, or `'subtle'`. */\n variant?: InputVariantProps['variant'];\n /** Controls padding and font size — `'xs'` | `'sm'` | `'md'` (default) | `'lg'` | `'xl'`. */\n size?: InputVariantProps['size'];\n /** Convenience callback that receives the raw string value on every change, bypassing the synthetic event. */\n onValueChange?: (value: string) => void;\n}) {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e);\n onValueChange?.(e.target.value);\n },\n [onChange, onValueChange]\n );\n return <input data-slot=\"input\" className={inputVariants({ variant, size, className })} {...props} onChange={handleChange} />;\n}\n\nexport { Input };\n"],"mappings":"kJAMA,MAAa,GAAA,EAAA,EAAA,KACX,CACE,0FACA,uCACA,+EACA,uGACD,CACD,CACE,SAAU,CACR,QAAS,CACP,QAAS,CACP,yEACA,uCACA,uBACA,kCACA,8BACA,gCACA,mCACA,mDACA,oCACA,mDACD,CACD,MAAO,GACP,KAAM,GACN,KAAM,GACN,OAAQ,GACT,CACD,KAAM,CACJ,GAAI,8BACJ,GAAI,kCACJ,GAAI,gCACJ,GAAI,8BACJ,GAAI,gCACL,CACF,CACD,gBAAiB,CACf,QAAS,UACT,KAAM,KACP,CACF,CACF,CAmBD,SAAS,EAAM,CACb,YACA,UACA,OACA,WACA,gBACA,GAAG,GAQF,CACD,IAAM,GAAA,EAAA,EAAA,aACH,GAA2C,CAC1C,IAAW,EAAE,CACb,IAAgB,EAAE,OAAO,MAAM,EAEjC,CAAC,EAAU,EAAc,CAC1B,CACD,OAAO,EAAA,EAAA,KAAC,QAAA,CAAM,YAAU,QAAQ,UAAW,EAAc,CAAE,UAAS,OAAM,YAAW,CAAC,CAAE,GAAI,EAAO,SAAU,GAAgB"}
|
package/dist/ui/input.d.cts
CHANGED
|
@@ -1,2 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as react196 from "react";
|
|
2
|
+
import * as class_variance_authority_types7 from "class-variance-authority/types";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
//#region packages/components/ui/input.d.ts
|
|
6
|
+
/** CVA variant definitions for the `Input` component — controls sizing and visual style. */
|
|
7
|
+
declare const inputVariants: (props?: ({
|
|
8
|
+
variant?: "outline" | "none" | "soft" | "ghost" | "subtle" | null | undefined;
|
|
9
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types7.ClassProp) | undefined) => string;
|
|
11
|
+
type InputVariantProps = VariantProps<typeof inputVariants>;
|
|
12
|
+
/**
|
|
13
|
+
* Styled text input field built on the native `<input>` element with CVA-driven size and variant tokens.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { Input } from '@customafk/lunas-ui/ui/input';
|
|
18
|
+
*
|
|
19
|
+
* <Input
|
|
20
|
+
* placeholder="Enter your name"
|
|
21
|
+
* variant="outline"
|
|
22
|
+
* size="md"
|
|
23
|
+
* onValueChange={(value) => console.log(value)}
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare function Input({
|
|
28
|
+
className,
|
|
29
|
+
variant,
|
|
30
|
+
size,
|
|
31
|
+
onChange,
|
|
32
|
+
onValueChange,
|
|
33
|
+
...props
|
|
34
|
+
}: Omit<React.ComponentProps<'input'>, 'size'> & {
|
|
35
|
+
/** Visual style of the input border — `'outline'` (default), `'ghost'`, `'none'`, `'soft'`, or `'subtle'`. */
|
|
36
|
+
variant?: InputVariantProps['variant'];
|
|
37
|
+
/** Controls padding and font size — `'xs'` | `'sm'` | `'md'` (default) | `'lg'` | `'xl'`. */
|
|
38
|
+
size?: InputVariantProps['size'];
|
|
39
|
+
/** Convenience callback that receives the raw string value on every change, bypassing the synthetic event. */
|
|
40
|
+
onValueChange?: (value: string) => void;
|
|
41
|
+
}): react196.JSX.Element;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Input, InputVariantProps, inputVariants };
|
|
44
|
+
//# sourceMappingURL=input.d.cts.map
|
package/dist/ui/input.d.ts
CHANGED
|
@@ -1,2 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as react190 from "react";
|
|
3
|
+
import * as class_variance_authority_types7 from "class-variance-authority/types";
|
|
4
|
+
|
|
5
|
+
//#region packages/components/ui/input.d.ts
|
|
6
|
+
/** CVA variant definitions for the `Input` component — controls sizing and visual style. */
|
|
7
|
+
declare const inputVariants: (props?: ({
|
|
8
|
+
variant?: "outline" | "none" | "soft" | "ghost" | "subtle" | null | undefined;
|
|
9
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types7.ClassProp) | undefined) => string;
|
|
11
|
+
type InputVariantProps = VariantProps<typeof inputVariants>;
|
|
12
|
+
/**
|
|
13
|
+
* Styled text input field built on the native `<input>` element with CVA-driven size and variant tokens.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { Input } from '@customafk/lunas-ui/ui/input';
|
|
18
|
+
*
|
|
19
|
+
* <Input
|
|
20
|
+
* placeholder="Enter your name"
|
|
21
|
+
* variant="outline"
|
|
22
|
+
* size="md"
|
|
23
|
+
* onValueChange={(value) => console.log(value)}
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare function Input({
|
|
28
|
+
className,
|
|
29
|
+
variant,
|
|
30
|
+
size,
|
|
31
|
+
onChange,
|
|
32
|
+
onValueChange,
|
|
33
|
+
...props
|
|
34
|
+
}: Omit<React.ComponentProps<'input'>, 'size'> & {
|
|
35
|
+
/** Visual style of the input border — `'outline'` (default), `'ghost'`, `'none'`, `'soft'`, or `'subtle'`. */
|
|
36
|
+
variant?: InputVariantProps['variant'];
|
|
37
|
+
/** Controls padding and font size — `'xs'` | `'sm'` | `'md'` (default) | `'lg'` | `'xl'`. */
|
|
38
|
+
size?: InputVariantProps['size'];
|
|
39
|
+
/** Convenience callback that receives the raw string value on every change, bypassing the synthetic event. */
|
|
40
|
+
onValueChange?: (value: string) => void;
|
|
41
|
+
}): react190.JSX.Element;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Input, InputVariantProps, inputVariants };
|
|
44
|
+
//# sourceMappingURL=input.d.ts.map
|
package/dist/ui/input.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{cva as e}from"class-variance-authority";import{jsx as t}from"react/jsx-runtime";import{useCallback as n}from"react";const r=e([`w-full rounded font-normal text-text-positive caret-primary transition-all tabular-nums`,`placeholder:text-text-positive-muted`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`read-only:pointer-events-none read-only:bg-muted-muted read-only:placeholder:text-text-positive-weak`],{variants:{variant:{outline:[`outline-1 outline-border -outline-offset-1 bg-transparent shadow-input`,`focus-visible:outline-primary-strong`,`focus-visible:ring-4`,`focus-visible:ring-primary-weak`,`aria-invalid:outline-danger`,`aria-invalid:ring-danger-weak`,`aria-invalid:bg-danger-bg-subtle`,`aria-invalid:focus-visible:outline-danger-strong`,`aria-invalid:focus-visible:ring-4`,`aria-invalid:placeholder:text-text-positive-weak`],ghost:``,none:``,soft:``,subtle:``},size:{xs:`px-2 py-1 text-xs leading-4`,sm:`px-2.5 py-1.5 text-xs leading-4`,md:`px-2.5 py-2 text-sm leading-5`,lg:`px-3 py-2 text-sm leading-5`,xl:`px-3 py-2 text-base leading-6`}},defaultVariants:{variant:`outline`,size:`md`}});function i({className:e,variant:i,size:a,onChange:o,onValueChange:s,...c}){let l=n(e=>{o?.(e),s?.(e.target.value)},[o,s]);return t(`input`,{"data-slot":`input`,className:r({variant:i,size:a,className:e}),...c,onChange:l})}export{i as Input,r as inputVariants};
|
|
2
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","names":[],"sources":["../../packages/components/ui/input.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useCallback } from 'react';\n\n/** CVA variant definitions for the `Input` component — controls sizing and visual style. */\nexport const inputVariants = cva(\n [\n 'w-full rounded font-normal text-text-positive caret-primary transition-all tabular-nums',\n 'placeholder:text-text-positive-muted',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n 'read-only:pointer-events-none read-only:bg-muted-muted read-only:placeholder:text-text-positive-weak',\n ],\n {\n variants: {\n variant: {\n outline: [\n 'outline-1 outline-border -outline-offset-1 bg-transparent shadow-input',\n 'focus-visible:outline-primary-strong',\n 'focus-visible:ring-4',\n 'focus-visible:ring-primary-weak',\n 'aria-invalid:outline-danger',\n 'aria-invalid:ring-danger-weak',\n 'aria-invalid:bg-danger-bg-subtle',\n 'aria-invalid:focus-visible:outline-danger-strong',\n 'aria-invalid:focus-visible:ring-4',\n 'aria-invalid:placeholder:text-text-positive-weak',\n ],\n ghost: '',\n none: '',\n soft: '',\n subtle: '',\n },\n size: {\n xs: 'px-2 py-1 text-xs leading-4',\n sm: 'px-2.5 py-1.5 text-xs leading-4',\n md: 'px-2.5 py-2 text-sm leading-5',\n lg: 'px-3 py-2 text-sm leading-5',\n xl: 'px-3 py-2 text-base leading-6',\n },\n },\n defaultVariants: {\n variant: 'outline',\n size: 'md',\n },\n }\n);\n\nexport type InputVariantProps = VariantProps<typeof inputVariants>;\n\n/**\n * Styled text input field built on the native `<input>` element with CVA-driven size and variant tokens.\n *\n * @example\n * ```tsx\n * import { Input } from '@customafk/lunas-ui/ui/input';\n *\n * <Input\n * placeholder=\"Enter your name\"\n * variant=\"outline\"\n * size=\"md\"\n * onValueChange={(value) => console.log(value)}\n * />\n * ```\n */\nfunction Input({\n className,\n variant,\n size,\n onChange,\n onValueChange,\n ...props\n}: Omit<React.ComponentProps<'input'>, 'size'> & {\n /** Visual style of the input border — `'outline'` (default), `'ghost'`, `'none'`, `'soft'`, or `'subtle'`. */\n variant?: InputVariantProps['variant'];\n /** Controls padding and font size — `'xs'` | `'sm'` | `'md'` (default) | `'lg'` | `'xl'`. */\n size?: InputVariantProps['size'];\n /** Convenience callback that receives the raw string value on every change, bypassing the synthetic event. */\n onValueChange?: (value: string) => void;\n}) {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e);\n onValueChange?.(e.target.value);\n },\n [onChange, onValueChange]\n );\n return <input data-slot=\"input\" className={inputVariants({ variant, size, className })} {...props} onChange={handleChange} />;\n}\n\nexport { Input };\n"],"mappings":"wIAMA,MAAa,EAAgB,EAC3B,CACE,0FACA,uCACA,+EACA,uGACD,CACD,CACE,SAAU,CACR,QAAS,CACP,QAAS,CACP,yEACA,uCACA,uBACA,kCACA,8BACA,gCACA,mCACA,mDACA,oCACA,mDACD,CACD,MAAO,GACP,KAAM,GACN,KAAM,GACN,OAAQ,GACT,CACD,KAAM,CACJ,GAAI,8BACJ,GAAI,kCACJ,GAAI,gCACJ,GAAI,8BACJ,GAAI,gCACL,CACF,CACD,gBAAiB,CACf,QAAS,UACT,KAAM,KACP,CACF,CACF,CAmBD,SAAS,EAAM,CACb,YACA,UACA,OACA,WACA,gBACA,GAAG,GAQF,CACD,IAAM,EAAe,EAClB,GAA2C,CAC1C,IAAW,EAAE,CACb,IAAgB,EAAE,OAAO,MAAM,EAEjC,CAAC,EAAU,EAAc,CAC1B,CACD,OAAO,EAAC,QAAA,CAAM,YAAU,QAAQ,UAAW,EAAc,CAAE,UAAS,OAAM,YAAW,CAAC,CAAE,GAAI,EAAO,SAAU,GAAgB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../chunk-
|
|
1
|
+
const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../input.cjs`);let n=require(`lucide-react`),r=require(`@customafk/react-toolkit/utils`),i=require(`react/jsx-runtime`);const a=({className:e,...a})=>(0,i.jsxs)(`div`,{className:`relative`,children:[(0,i.jsx)(t.Input,{...a,type:`search`,className:(0,r.cn)(`ps-9 pe-9`,e)}),(0,i.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-text-positive-weak peer-disabled:opacity-50`,children:(0,i.jsx)(n.SearchIcon,{size:16})}),(0,i.jsx)(`button`,{className:`absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:z-10 focus-visible:border focus-visible:border-primary-strong focus-visible:ring-[3px] focus-visible:ring-primary-weak disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Submit search`,type:`submit`,children:(0,i.jsx)(n.ArrowRightIcon,{size:16,"aria-hidden":`true`})})]});exports.SearchInput=a;
|
|
2
2
|
//# sourceMappingURL=search-input.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-input.cjs","names":["Input","SearchIcon","ArrowRightIcon"],"sources":["../../../packages/components/ui/inputs/search-input.tsx"],"sourcesContent":["import { ArrowRightIcon, SearchIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Input } from '../input';\n\n/**\n * Props for {@link SearchInput}. Accepts all native props of the underlying\n * `Input` component (itself a thin wrapper around `<input>`), including\n * `value`, `defaultValue`, `onChange`, `placeholder`, `disabled`, etc.\n * The `type` prop is fixed to `\"search\"` and cannot be overridden.\n */\ntype Props = React.ComponentPropsWithoutRef<typeof Input>;\n\n/**\n * A search input field with a leading search icon and a trailing arrow submit button, intended for use inside an HTML `<form>` element.\n *\n * @example\n * import { SearchInput } from '@customafk/lunas-ui/ui/inputs/search-input';\n *\n * <form onSubmit={handleSearch}>\n * <SearchInput placeholder=\"Search…\" value={query} onChange={(e) => setQuery(e.target.value)} />\n * </form>\n */\nexport const SearchInput = ({ className, ...rest }: Props) => {\n return (\n <div className=\"relative\">\n <Input {...rest} type=\"search\" className={cn('ps-9 pe-9', className)} />\n <div className=\"pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-text-positive-weak peer-disabled:opacity-50\">\n <SearchIcon size={16} />\n </div>\n <button\n className=\"absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:z-10 focus-visible:border focus-visible:border-primary-strong focus-visible:ring-[3px] focus-visible:ring-primary-weak disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n aria-label=\"Submit search\"\n type=\"submit\"\n >\n <ArrowRightIcon size={16} aria-hidden=\"true\" />\n </button>\n </div>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"search-input.cjs","names":["Input","SearchIcon","ArrowRightIcon"],"sources":["../../../packages/components/ui/inputs/search-input.tsx"],"sourcesContent":["import { ArrowRightIcon, SearchIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Input } from '../input';\n\n/**\n * Props for {@link SearchInput}. Accepts all native props of the underlying\n * `Input` component (itself a thin wrapper around `<input>`), including\n * `value`, `defaultValue`, `onChange`, `placeholder`, `disabled`, etc.\n * The `type` prop is fixed to `\"search\"` and cannot be overridden.\n */\ntype Props = React.ComponentPropsWithoutRef<typeof Input>;\n\n/**\n * A search input field with a leading search icon and a trailing arrow submit button, intended for use inside an HTML `<form>` element.\n *\n * @example\n * import { SearchInput } from '@customafk/lunas-ui/ui/inputs/search-input';\n *\n * <form onSubmit={handleSearch}>\n * <SearchInput placeholder=\"Search…\" value={query} onChange={(e) => setQuery(e.target.value)} />\n * </form>\n */\nexport const SearchInput = ({ className, ...rest }: Props) => {\n return (\n <div className=\"relative\">\n <Input {...rest} type=\"search\" className={cn('ps-9 pe-9', className)} />\n <div className=\"pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-text-positive-weak peer-disabled:opacity-50\">\n <SearchIcon size={16} />\n </div>\n <button\n className=\"absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:z-10 focus-visible:border focus-visible:border-primary-strong focus-visible:ring-[3px] focus-visible:ring-primary-weak disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n aria-label=\"Submit search\"\n type=\"submit\"\n >\n <ArrowRightIcon size={16} aria-hidden=\"true\" />\n </button>\n </div>\n );\n};\n"],"mappings":"+KAwBA,MAAa,GAAe,CAAE,YAAW,GAAG,MAExC,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,sBACb,EAAA,EAAA,KAACA,EAAAA,MAAAA,CAAM,GAAI,EAAM,KAAK,SAAS,WAAA,EAAA,EAAA,IAAc,YAAa,EAAU,EAAI,EACxE,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,kJACb,EAAA,EAAA,KAACC,EAAAA,WAAAA,CAAW,KAAM,GAAA,CAAM,EACpB,EACN,EAAA,EAAA,KAAC,SAAA,CACC,UAAU,0XACV,aAAW,gBACX,KAAK,mBAEL,EAAA,EAAA,KAACC,EAAAA,eAAAA,CAAe,KAAM,GAAI,cAAY,QAAS,EACxC,GACL"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
1
|
+
import { Input } from "../input.cjs";
|
|
2
|
+
import * as react51 from "react";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/inputs/search-input.d.ts
|
|
5
5
|
|
|
@@ -23,7 +23,7 @@ type Props = React.ComponentPropsWithoutRef<typeof Input>;
|
|
|
23
23
|
declare const SearchInput: ({
|
|
24
24
|
className,
|
|
25
25
|
...rest
|
|
26
|
-
}: Props) =>
|
|
26
|
+
}: Props) => react51.JSX.Element;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { SearchInput };
|
|
29
29
|
//# sourceMappingURL=search-input.d.cts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
1
|
+
import { Input } from "../input.js";
|
|
2
|
+
import * as react42 from "react";
|
|
3
3
|
|
|
4
4
|
//#region packages/components/ui/inputs/search-input.d.ts
|
|
5
5
|
|
|
@@ -23,7 +23,7 @@ type Props = React.ComponentPropsWithoutRef<typeof Input>;
|
|
|
23
23
|
declare const SearchInput: ({
|
|
24
24
|
className,
|
|
25
25
|
...rest
|
|
26
|
-
}: Props) =>
|
|
26
|
+
}: Props) => react42.JSX.Element;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { SearchInput };
|
|
29
29
|
//# sourceMappingURL=search-input.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Input as e}from"../input.js";import{ArrowRightIcon as t,SearchIcon as n}from"lucide-react";import{cn as r}from"@customafk/react-toolkit/utils";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=({className:o,...s})=>a(`div`,{className:`relative`,children:[i(e,{...s,type:`search`,className:r(`ps-9 pe-9`,o)}),i(`div`,{className:`pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-text-positive-weak peer-disabled:opacity-50`,children:i(n,{size:16})}),i(`button`,{className:`absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:z-10 focus-visible:border focus-visible:border-primary-strong focus-visible:ring-[3px] focus-visible:ring-primary-weak disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":`Submit search`,type:`submit`,children:i(t,{size:16,"aria-hidden":`true`})})]});export{o as SearchInput};
|
|
2
2
|
//# sourceMappingURL=search-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-input.js","names":[],"sources":["../../../packages/components/ui/inputs/search-input.tsx"],"sourcesContent":["import { ArrowRightIcon, SearchIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Input } from '../input';\n\n/**\n * Props for {@link SearchInput}. Accepts all native props of the underlying\n * `Input` component (itself a thin wrapper around `<input>`), including\n * `value`, `defaultValue`, `onChange`, `placeholder`, `disabled`, etc.\n * The `type` prop is fixed to `\"search\"` and cannot be overridden.\n */\ntype Props = React.ComponentPropsWithoutRef<typeof Input>;\n\n/**\n * A search input field with a leading search icon and a trailing arrow submit button, intended for use inside an HTML `<form>` element.\n *\n * @example\n * import { SearchInput } from '@customafk/lunas-ui/ui/inputs/search-input';\n *\n * <form onSubmit={handleSearch}>\n * <SearchInput placeholder=\"Search…\" value={query} onChange={(e) => setQuery(e.target.value)} />\n * </form>\n */\nexport const SearchInput = ({ className, ...rest }: Props) => {\n return (\n <div className=\"relative\">\n <Input {...rest} type=\"search\" className={cn('ps-9 pe-9', className)} />\n <div className=\"pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-text-positive-weak peer-disabled:opacity-50\">\n <SearchIcon size={16} />\n </div>\n <button\n className=\"absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:z-10 focus-visible:border focus-visible:border-primary-strong focus-visible:ring-[3px] focus-visible:ring-primary-weak disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n aria-label=\"Submit search\"\n type=\"submit\"\n >\n <ArrowRightIcon size={16} aria-hidden=\"true\" />\n </button>\n </div>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"search-input.js","names":[],"sources":["../../../packages/components/ui/inputs/search-input.tsx"],"sourcesContent":["import { ArrowRightIcon, SearchIcon } from 'lucide-react';\n\nimport { cn } from '@customafk/react-toolkit/utils';\n\nimport { Input } from '../input';\n\n/**\n * Props for {@link SearchInput}. Accepts all native props of the underlying\n * `Input` component (itself a thin wrapper around `<input>`), including\n * `value`, `defaultValue`, `onChange`, `placeholder`, `disabled`, etc.\n * The `type` prop is fixed to `\"search\"` and cannot be overridden.\n */\ntype Props = React.ComponentPropsWithoutRef<typeof Input>;\n\n/**\n * A search input field with a leading search icon and a trailing arrow submit button, intended for use inside an HTML `<form>` element.\n *\n * @example\n * import { SearchInput } from '@customafk/lunas-ui/ui/inputs/search-input';\n *\n * <form onSubmit={handleSearch}>\n * <SearchInput placeholder=\"Search…\" value={query} onChange={(e) => setQuery(e.target.value)} />\n * </form>\n */\nexport const SearchInput = ({ className, ...rest }: Props) => {\n return (\n <div className=\"relative\">\n <Input {...rest} type=\"search\" className={cn('ps-9 pe-9', className)} />\n <div className=\"pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 text-text-positive-weak peer-disabled:opacity-50\">\n <SearchIcon size={16} />\n </div>\n <button\n className=\"absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:z-10 focus-visible:border focus-visible:border-primary-strong focus-visible:ring-[3px] focus-visible:ring-primary-weak disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\"\n aria-label=\"Submit search\"\n type=\"submit\"\n >\n <ArrowRightIcon size={16} aria-hidden=\"true\" />\n </button>\n </div>\n );\n};\n"],"mappings":"wMAwBA,MAAa,GAAe,CAAE,YAAW,GAAG,KAExC,EAAC,MAAA,CAAI,UAAU,qBACb,EAAC,EAAA,CAAM,GAAI,EAAM,KAAK,SAAS,UAAW,EAAG,YAAa,EAAU,EAAI,CACxE,EAAC,MAAA,CAAI,UAAU,iJACb,EAAC,EAAA,CAAW,KAAM,GAAA,CAAM,EACpB,CACN,EAAC,SAAA,CACC,UAAU,0XACV,aAAW,gBACX,KAAK,kBAEL,EAAC,EAAA,CAAe,KAAM,GAAI,cAAY,QAAS,EACxC,GACL"}
|
package/dist/ui/item.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../chunk-
|
|
1
|
+
const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`@radix-ui/react-slot`),n=require(`@customafk/react-toolkit/utils`),r=require(`class-variance-authority`),i=require(`react/jsx-runtime`),a=require(`@/components/ui/separator`);function o({className:e,...t}){return(0,i.jsx)(`div`,{role:`list`,"data-slot":`item-group`,className:(0,n.cn)(`group/item-group flex flex-col`,e),...t})}function s({className:e,...t}){return(0,i.jsx)(a.Separator,{"data-slot":`item-separator`,orientation:`horizontal`,className:(0,n.cn)(`my-0`,e),...t})}const c=(0,r.cva)(`group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-primary-strong focus-visible:ring-primary-weak focus-visible:ring-[3px]`,{variants:{variant:{default:`bg-transparent`,outline:`border-border`,muted:`bg-muted-weak`},size:{default:`p-4 gap-4 `,sm:`py-3 px-4 gap-2.5`}},defaultVariants:{variant:`default`,size:`default`}});function l({className:e,variant:r=`default`,size:a=`default`,asChild:o=!1,...s}){return(0,i.jsx)(o?t.Slot:`div`,{"data-slot":`item`,"data-variant":r,"data-size":a,className:(0,n.cn)(c({variant:r,size:a,className:e})),...s})}const u=(0,r.cva)(`flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5`,{variants:{variant:{default:`bg-transparent`,icon:`size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4`,image:`size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover`}},defaultVariants:{variant:`default`}});function d({className:e,variant:t=`default`,...r}){return(0,i.jsx)(`div`,{"data-slot":`item-media`,"data-variant":t,className:(0,n.cn)(u({variant:t,className:e})),...r})}function f({className:e,...t}){return(0,i.jsx)(`div`,{"data-slot":`item-content`,className:(0,n.cn)(`flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none`,e),...t})}function p({className:e,...t}){return(0,i.jsx)(`div`,{"data-slot":`item-title`,className:(0,n.cn)(`flex w-fit items-center gap-2 text-sm leading-snug font-medium`,e),...t})}function m({className:e,...t}){return(0,i.jsx)(`p`,{"data-slot":`item-description`,className:(0,n.cn)(`text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance`,`[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function h({className:e,...t}){return(0,i.jsx)(`div`,{"data-slot":`item-actions`,className:(0,n.cn)(`flex items-center gap-2`,e),...t})}function g({className:e,...t}){return(0,i.jsx)(`div`,{"data-slot":`item-header`,className:(0,n.cn)(`flex basis-full items-center justify-between gap-2`,e),...t})}function _({className:e,...t}){return(0,i.jsx)(`div`,{"data-slot":`item-footer`,className:(0,n.cn)(`flex basis-full items-center justify-between gap-2`,e),...t})}exports.Item=l,exports.ItemActions=h,exports.ItemContent=f,exports.ItemDescription=m,exports.ItemFooter=_,exports.ItemGroup=o,exports.ItemHeader=g,exports.ItemMedia=d,exports.ItemSeparator=s,exports.ItemTitle=p;
|
|
2
2
|
//# sourceMappingURL=item.cjs.map
|