@customafk/lunas-ui 0.1.93 → 0.1.94
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/{avatar-DjCXs3FZ.mjs → avatar-DReNH6rV.mjs} +1 -1
- package/dist/{avatar-DjCXs3FZ.mjs.map → avatar-DReNH6rV.mjs.map} +1 -1
- package/dist/{avatar-dAu1c0bC.cjs → avatar-aVxo69zP.cjs} +1 -1
- package/dist/{avatar-dAu1c0bC.cjs.map → avatar-aVxo69zP.cjs.map} +1 -1
- package/dist/badge-B4Fa7-J3.mjs +2 -0
- package/dist/badge-B4Fa7-J3.mjs.map +1 -0
- package/dist/badge-cvLJyaCA.cjs +2 -0
- package/dist/badge-cvLJyaCA.cjs.map +1 -0
- package/dist/button-8Snjc8iT.cjs +2 -0
- package/dist/{button-BLYTfCyl.cjs.map → button-8Snjc8iT.cjs.map} +1 -1
- package/dist/{button-CFDexiLY.d.cts → button-CHTjm4n8.d.cts} +8 -8
- package/dist/button-C_yZHudZ.mjs +2 -0
- package/dist/{button-BlQN92Jt.mjs.map → button-C_yZHudZ.mjs.map} +1 -1
- package/dist/{button-CePXFHnA.d.mts → button-c61Vw1Ns.d.mts} +8 -8
- package/dist/{button.variants-Bo2vzQp5.cjs → button.variants-8QOIR433.cjs} +1 -1
- package/dist/{button.variants-Bo2vzQp5.cjs.map → button.variants-8QOIR433.cjs.map} +1 -1
- package/dist/{button.variants-DBOg9vCn.mjs → button.variants-CL2rLGYO.mjs} +1 -1
- package/dist/{button.variants-DBOg9vCn.mjs.map → button.variants-CL2rLGYO.mjs.map} +1 -1
- package/dist/calendar-DgLMLD8R.cjs +2 -0
- package/dist/calendar-DgLMLD8R.cjs.map +1 -0
- package/dist/calendar-e9Pu8pNj.mjs +2 -0
- package/dist/calendar-e9Pu8pNj.mjs.map +1 -0
- 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.mjs +1 -1
- package/dist/cards/grid-product-card.mjs.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.mjs +1 -1
- package/dist/cards/product-card.mjs.map +1 -1
- package/dist/cards/simple-card.cjs +1 -1
- package/dist/cards/simple-card.cjs.map +1 -1
- package/dist/cards/simple-card.d.mts +2 -2
- package/dist/cards/simple-card.mjs +1 -1
- package/dist/cards/simple-card.mjs.map +1 -1
- package/dist/checkbox-Bg2FiuQw.mjs +2 -0
- package/dist/checkbox-Bg2FiuQw.mjs.map +1 -0
- package/dist/checkbox-C0fSWwmD.cjs +2 -0
- package/dist/checkbox-C0fSWwmD.cjs.map +1 -0
- package/dist/{close-rM-Ao1Gf.cjs → close-D_Ge7gnP.cjs} +1 -1
- package/dist/{close-rM-Ao1Gf.cjs.map → close-D_Ge7gnP.cjs.map} +1 -1
- package/dist/{close-BSZehrQx.mjs → close-DfuHB7kq.mjs} +1 -1
- package/dist/{close-BSZehrQx.mjs.map → close-DfuHB7kq.mjs.map} +1 -1
- package/dist/{command-CzE8NTMm.cjs → command-BciJADha.cjs} +2 -2
- package/dist/{command-CzE8NTMm.cjs.map → command-BciJADha.cjs.map} +1 -1
- package/dist/{command-OYUOsPvN.mjs → command-DSvEsWG8.mjs} +2 -2
- package/dist/{command-OYUOsPvN.mjs.map → command-DSvEsWG8.mjs.map} +1 -1
- package/dist/data-display/country.cjs +1 -1
- package/dist/data-display/country.d.cts +1 -1
- package/dist/data-display/country.d.mts +1 -1
- package/dist/data-display/country.mjs +1 -1
- package/dist/data-display/data-list.cjs +1 -1
- package/dist/data-display/data-list.mjs +1 -1
- package/dist/data-display/date-tooltip.cjs +1 -1
- package/dist/data-display/date-tooltip.mjs +1 -1
- package/dist/data-display/date.cjs +1 -1
- package/dist/data-display/date.mjs +1 -1
- package/dist/data-display/empty.cjs +1 -1
- package/dist/data-display/empty.d.cts +2 -2
- package/dist/data-display/empty.mjs +1 -1
- package/dist/data-display/name.cjs +1 -1
- package/dist/data-display/name.mjs +1 -1
- package/dist/data-display/phone-number.cjs +1 -1
- package/dist/data-display/phone-number.mjs +1 -1
- package/dist/data-display/role-badge.cjs +1 -1
- package/dist/data-display/role-badge.d.cts +1 -1
- package/dist/data-display/role-badge.d.mts +1 -1
- package/dist/data-display/role-badge.mjs +1 -1
- package/dist/data-display/statistic.cjs +1 -1
- package/dist/data-display/statistic.d.cts +2 -2
- package/dist/data-display/statistic.d.mts +2 -2
- package/dist/data-display/statistic.mjs +1 -1
- package/dist/data-display/user.cjs +1 -1
- package/dist/data-display/user.mjs +1 -1
- package/dist/{date-Bznq86tY.mjs → date-CK7XBqG9.mjs} +2 -2
- package/dist/{date-Bznq86tY.mjs.map → date-CK7XBqG9.mjs.map} +1 -1
- package/dist/{date-CuRT4hmU.cjs → date-CTmoK8tv.cjs} +2 -2
- package/dist/{date-CuRT4hmU.cjs.map → date-CTmoK8tv.cjs.map} +1 -1
- package/dist/{dialog-DigNrfAO.d.mts → dialog-CyLgmqny.d.cts} +12 -12
- package/dist/dialog-D5TBBX99.cjs +2 -0
- package/dist/dialog-D5TBBX99.cjs.map +1 -0
- package/dist/dialog-DSvmcuYl.mjs +2 -0
- package/dist/dialog-DSvmcuYl.mjs.map +1 -0
- package/dist/{dialog-UWrYag-8.d.cts → dialog-DdkuhWsq.d.mts} +12 -12
- package/dist/dialogs/confirm-dialog.cjs +1 -1
- package/dist/dialogs/confirm-dialog.cjs.map +1 -1
- package/dist/dialogs/confirm-dialog.mjs +1 -1
- package/dist/dialogs/confirm-dialog.mjs.map +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.cjs +1 -1
- package/dist/dialogs/detail-dialog/components/sidebar.d.cts +25 -25
- package/dist/dialogs/detail-dialog/components/sidebar.d.mts +27 -27
- package/dist/dialogs/detail-dialog/components/sidebar.mjs +1 -1
- package/dist/dialogs/detail-dialog/index.cjs +1 -1
- package/dist/dialogs/detail-dialog/index.mjs +1 -1
- package/dist/dialogs/error-dialog.cjs +1 -1
- package/dist/dialogs/error-dialog.cjs.map +1 -1
- package/dist/dialogs/error-dialog.mjs +1 -1
- package/dist/dialogs/error-dialog.mjs.map +1 -1
- package/dist/dialogs/loading-dialog.cjs +1 -1
- package/dist/dialogs/loading-dialog.cjs.map +1 -1
- package/dist/dialogs/loading-dialog.mjs +1 -1
- package/dist/dialogs/loading-dialog.mjs.map +1 -1
- package/dist/dist-BudM04oj.cjs +2 -0
- package/dist/{dist-BqoK5OAd.cjs.map → dist-BudM04oj.cjs.map} +1 -1
- package/dist/dist-CvmzZ_6C.mjs +2 -0
- package/dist/{dist-D2ydYRc4.mjs.map → dist-CvmzZ_6C.mjs.map} +1 -1
- package/dist/{dropdown-menu-BwcDzb4B.mjs → dropdown-menu-B8GUTfTp.mjs} +1 -1
- package/dist/{dropdown-menu-BwcDzb4B.mjs.map → dropdown-menu-B8GUTfTp.mjs.map} +1 -1
- package/dist/{dropdown-menu-5Zyw5t_J.cjs → dropdown-menu-BuyuU6uF.cjs} +1 -1
- package/dist/{dropdown-menu-5Zyw5t_J.cjs.map → dropdown-menu-BuyuU6uF.cjs.map} +1 -1
- package/dist/features/descriptions/index.cjs +1 -1
- package/dist/features/descriptions/index.d.cts +4 -4
- package/dist/features/descriptions/index.d.mts +4 -4
- package/dist/features/descriptions/index.mjs +1 -1
- package/dist/features/search-modal/index.cjs +1 -1
- package/dist/features/search-modal/index.cjs.map +1 -1
- package/dist/features/search-modal/index.d.cts +2 -2
- package/dist/features/search-modal/index.d.mts +2 -2
- package/dist/features/search-modal/index.mjs +1 -1
- package/dist/features/search-modal/index.mjs.map +1 -1
- package/dist/features/tables/index.cjs +1 -1
- package/dist/features/tables/index.cjs.map +1 -1
- package/dist/features/tables/index.d.cts +152 -31
- package/dist/features/tables/index.d.mts +152 -31
- package/dist/features/tables/index.mjs +1 -1
- package/dist/features/tables/index.mjs.map +1 -1
- package/dist/features/tanstack-form/index.cjs +1 -1
- package/dist/features/tanstack-form/index.cjs.map +1 -1
- package/dist/features/tanstack-form/index.d.cts +280 -280
- package/dist/features/tanstack-form/index.d.mts +280 -280
- package/dist/features/tanstack-form/index.mjs +1 -1
- package/dist/features/tanstack-form/index.mjs.map +1 -1
- package/dist/{flex-_tvOU0u1.mjs → flex-BP8sTi70.mjs} +2 -2
- package/dist/{flex-_tvOU0u1.mjs.map → flex-BP8sTi70.mjs.map} +1 -1
- package/dist/{flex-DGPQRbN6.cjs → flex-twCgWyx1.cjs} +2 -2
- package/dist/{flex-DGPQRbN6.cjs.map → flex-twCgWyx1.cjs.map} +1 -1
- package/dist/heading--VmdIi7C.mjs +2 -0
- package/dist/heading--VmdIi7C.mjs.map +1 -0
- package/dist/heading-BEm5CCSE.cjs +2 -0
- package/dist/heading-BEm5CCSE.cjs.map +1 -0
- package/dist/image-CS_Q0WA7.mjs +2 -0
- package/dist/{image-Dgxtk54D.mjs.map → image-CS_Q0WA7.mjs.map} +1 -1
- package/dist/image-DuFv8sPr.cjs +2 -0
- package/dist/{image-D2PTBG_7.cjs.map → image-DuFv8sPr.cjs.map} +1 -1
- package/dist/input-BFWWaN-v.cjs +2 -0
- package/dist/input-BFWWaN-v.cjs.map +1 -0
- package/dist/input-BMz2evzs.d.mts +25 -0
- package/dist/input-DBtIgQB6.mjs +2 -0
- package/dist/input-DBtIgQB6.mjs.map +1 -0
- package/dist/input-mGRGirZ_.d.cts +25 -0
- package/dist/{label-D6vHFlHX.cjs → label-BzfsTrVt.cjs} +1 -1
- package/dist/{label-D6vHFlHX.cjs.map → label-BzfsTrVt.cjs.map} +1 -1
- package/dist/{label-DW6shAXZ.mjs → label-Dqr8nxWi.mjs} +1 -1
- package/dist/{label-DW6shAXZ.mjs.map → label-Dqr8nxWi.mjs.map} +1 -1
- package/dist/layouts/cms-layout/index.cjs +1 -1
- package/dist/layouts/cms-layout/index.mjs +1 -1
- package/dist/layouts/flex.cjs +1 -1
- package/dist/layouts/flex.d.cts +5 -5
- package/dist/layouts/flex.d.mts +6 -6
- package/dist/layouts/flex.mjs +1 -1
- package/dist/layouts/payment-layout/index.cjs +1 -1
- package/dist/layouts/payment-layout/index.mjs +1 -1
- package/dist/pages/FeatureDeveloping.cjs +1 -1
- package/dist/pages/FeatureDeveloping.d.cts +2 -2
- package/dist/pages/FeatureDeveloping.d.mts +2 -2
- package/dist/pages/FeatureDeveloping.mjs +1 -1
- package/dist/pages/FeatureFixing.cjs +1 -1
- package/dist/pages/FeatureFixing.d.cts +2 -2
- package/dist/pages/FeatureFixing.d.mts +2 -2
- package/dist/pages/FeatureFixing.mjs +1 -1
- package/dist/pages/NotAuthorized.cjs +1 -1
- package/dist/pages/NotAuthorized.d.cts +2 -2
- package/dist/pages/NotAuthorized.d.mts +2 -2
- package/dist/pages/NotAuthorized.mjs +1 -1
- package/dist/pages/NotFound.cjs +1 -1
- package/dist/pages/NotFound.d.cts +2 -2
- package/dist/pages/NotFound.d.mts +2 -2
- package/dist/pages/NotFound.mjs +1 -1
- package/dist/paragraph-4z_6Z5aj.cjs +2 -0
- package/dist/paragraph-4z_6Z5aj.cjs.map +1 -0
- package/dist/paragraph-BTJV4aeF.mjs +2 -0
- package/dist/paragraph-BTJV4aeF.mjs.map +1 -0
- package/dist/popover-BckwBuuD.mjs +2 -0
- package/dist/popover-BckwBuuD.mjs.map +1 -0
- package/dist/popover-DzDrgttC.cjs +2 -0
- package/dist/popover-DzDrgttC.cjs.map +1 -0
- package/dist/radio-group-CBhRsUjN.cjs +2 -0
- package/dist/radio-group-CBhRsUjN.cjs.map +1 -0
- package/dist/radio-group-Cem8O6BK.mjs +2 -0
- package/dist/radio-group-Cem8O6BK.mjs.map +1 -0
- package/dist/resizable-DXHfkbaz.mjs +2 -0
- package/dist/resizable-DXHfkbaz.mjs.map +1 -0
- package/dist/resizable-mlGS6Zto.cjs +2 -0
- package/dist/resizable-mlGS6Zto.cjs.map +1 -0
- package/dist/select-2CgwiefV.cjs +2 -0
- package/dist/select-2CgwiefV.cjs.map +1 -0
- package/dist/select-CivtMKTM.mjs +2 -0
- package/dist/select-CivtMKTM.mjs.map +1 -0
- package/dist/{separator-CWar33xc.mjs → separator-Bf0gymN4.mjs} +1 -1
- package/dist/{separator-CWar33xc.mjs.map → separator-Bf0gymN4.mjs.map} +1 -1
- package/dist/{separator-DSZyCT2g.cjs → separator-C3ip6sbh.cjs} +1 -1
- package/dist/{separator-DSZyCT2g.cjs.map → separator-C3ip6sbh.cjs.map} +1 -1
- package/dist/{sheet-CxHNvLcP.cjs → sheet-5MJRtrfG.cjs} +1 -1
- package/dist/{sheet-CxHNvLcP.cjs.map → sheet-5MJRtrfG.cjs.map} +1 -1
- package/dist/{sheet-CUfrx04D.mjs → sheet-oadGRiie.mjs} +1 -1
- package/dist/{sheet-CUfrx04D.mjs.map → sheet-oadGRiie.mjs.map} +1 -1
- package/dist/{skeleton-6MpPv0K3.mjs → skeleton-Ba6koCVf.mjs} +1 -1
- package/dist/{skeleton-6MpPv0K3.mjs.map → skeleton-Ba6koCVf.mjs.map} +1 -1
- package/dist/{skeleton-oQFT4xR2.cjs → skeleton-CHympz8k.cjs} +1 -1
- package/dist/{skeleton-oQFT4xR2.cjs.map → skeleton-CHympz8k.cjs.map} +1 -1
- package/dist/spinner-Chm_2fLr.cjs +2 -0
- package/dist/spinner-Chm_2fLr.cjs.map +1 -0
- package/dist/spinner-D1v3Bard.mjs +2 -0
- package/dist/spinner-D1v3Bard.mjs.map +1 -0
- package/dist/systems/google.cjs +1 -1
- package/dist/systems/google.mjs +1 -1
- package/dist/textarea-COQoSVSc.cjs +2 -0
- package/dist/textarea-COQoSVSc.cjs.map +1 -0
- package/dist/textarea-bLtmb71c.mjs +2 -0
- package/dist/textarea-bLtmb71c.mjs.map +1 -0
- package/dist/{tooltip-Dd1torAV.mjs → tooltip-B3dTcgcc.mjs} +1 -1
- package/dist/{tooltip-Dd1torAV.mjs.map → tooltip-B3dTcgcc.mjs.map} +1 -1
- package/dist/{tooltip-DMFoP_sB.cjs → tooltip-DC6i1A25.cjs} +1 -1
- package/dist/{tooltip-DMFoP_sB.cjs.map → tooltip-DC6i1A25.cjs.map} +1 -1
- package/dist/{types-DmtzpUIM.cjs → types-BD1t0Bj8.cjs} +1 -1
- package/dist/{types-BQMTFD_z.mjs.map → types-BD1t0Bj8.cjs.map} +1 -1
- package/dist/{types-Dl3D4kHZ.d.cts → types-Bd0JePtp.d.cts} +3 -2
- package/dist/{types-spXc_7Mh.d.mts → types-BpHcqlOI.d.mts} +3 -2
- package/dist/{types-BQMTFD_z.mjs → types-DBD4LOem.mjs} +1 -1
- package/dist/{types-DmtzpUIM.cjs.map → types-DBD4LOem.mjs.map} +1 -1
- package/dist/typography/paragraph.cjs +1 -1
- package/dist/typography/paragraph.d.cts +15 -3
- package/dist/typography/paragraph.d.mts +15 -3
- package/dist/typography/paragraph.mjs +1 -1
- package/dist/typography/title.cjs +1 -1
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.mts +2 -2
- package/dist/typography/title.mjs +1 -1
- package/dist/ui/alert-dialog.cjs +1 -1
- package/dist/ui/alert-dialog.cjs.map +1 -1
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.mts +12 -12
- package/dist/ui/alert-dialog.mjs +1 -1
- package/dist/ui/alert-dialog.mjs.map +1 -1
- package/dist/ui/alert.cjs +1 -1
- package/dist/ui/alert.d.cts +7 -7
- package/dist/ui/alert.d.mts +7 -7
- package/dist/ui/alert.mjs +1 -1
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.mts +2 -2
- package/dist/ui/avatar.cjs +1 -1
- package/dist/ui/avatar.d.mts +4 -4
- package/dist/ui/avatar.mjs +1 -1
- package/dist/ui/badge.cjs +1 -1
- package/dist/ui/badge.d.cts +6 -6
- package/dist/ui/badge.d.mts +4 -4
- package/dist/ui/badge.mjs +1 -1
- package/dist/ui/breadcrumb.cjs +1 -1
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.mts +8 -8
- package/dist/ui/breadcrumb.mjs +1 -1
- package/dist/ui/button-group.cjs +1 -1
- package/dist/ui/button-group.d.cts +6 -6
- package/dist/ui/button-group.d.mts +6 -6
- package/dist/ui/button-group.mjs +1 -1
- package/dist/ui/button.cjs +1 -1
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.mts +1 -1
- package/dist/ui/button.mjs +1 -1
- package/dist/ui/buttons/add-new.cjs +1 -1
- package/dist/ui/buttons/add-new.mjs +1 -1
- package/dist/ui/buttons/edit.cjs +1 -1
- package/dist/ui/buttons/edit.mjs +1 -1
- package/dist/ui/buttons/refresh.cjs +1 -1
- package/dist/ui/buttons/refresh.mjs +1 -1
- package/dist/ui/buttons/trash.cjs +1 -1
- package/dist/ui/buttons/trash.mjs +1 -1
- package/dist/ui/buttons/upload-image.cjs +1 -1
- package/dist/ui/buttons/upload-image.mjs +1 -1
- package/dist/ui/calendar.cjs +1 -2
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.mts +4 -4
- package/dist/ui/calendar.mjs +1 -2
- package/dist/ui/card.cjs +1 -1
- package/dist/ui/card.cjs.map +1 -1
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.mts +8 -8
- package/dist/ui/card.mjs +1 -1
- package/dist/ui/card.mjs.map +1 -1
- package/dist/ui/carousel.cjs +1 -1
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.mts +7 -7
- package/dist/ui/carousel.mjs +1 -1
- package/dist/ui/checkbox.cjs +1 -1
- package/dist/ui/checkbox.d.cts +2 -2
- package/dist/ui/checkbox.d.mts +2 -2
- package/dist/ui/checkbox.mjs +1 -1
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.mts +4 -4
- package/dist/ui/command.cjs +1 -1
- package/dist/ui/command.d.cts +11 -11
- package/dist/ui/command.d.mts +11 -11
- package/dist/ui/command.mjs +1 -1
- package/dist/ui/context-menu.d.cts +16 -16
- package/dist/ui/context-menu.d.mts +16 -16
- package/dist/ui/dialog.cjs +1 -1
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.mts +1 -1
- package/dist/ui/dialog.mjs +1 -1
- package/dist/ui/drawer.d.cts +11 -11
- package/dist/ui/drawer.d.mts +11 -11
- package/dist/ui/dropdown-menu.cjs +1 -1
- package/dist/ui/dropdown-menu.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.mts +16 -16
- package/dist/ui/dropdown-menu.mjs +1 -1
- package/dist/ui/empty.cjs +1 -1
- package/dist/ui/empty.d.cts +9 -9
- package/dist/ui/empty.d.mts +9 -9
- package/dist/ui/empty.mjs +1 -1
- package/dist/ui/field.cjs +1 -1
- package/dist/ui/field.d.cts +13 -13
- package/dist/ui/field.d.mts +24 -24
- package/dist/ui/field.mjs +1 -1
- package/dist/ui/file-uploader.cjs +2 -2
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.mts +2 -2
- package/dist/ui/file-uploader.mjs +2 -2
- package/dist/ui/form.cjs +1 -1
- package/dist/ui/form.d.cts +11 -11
- package/dist/ui/form.d.mts +7 -7
- package/dist/ui/form.mjs +1 -1
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.mts +4 -4
- package/dist/ui/image.cjs +1 -1
- package/dist/ui/image.mjs +1 -1
- package/dist/ui/input-otp.cjs +1 -1
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.mts +5 -5
- package/dist/ui/input-otp.mjs +1 -1
- package/dist/ui/input.cjs +1 -1
- package/dist/ui/input.d.cts +2 -2
- package/dist/ui/input.d.mts +2 -2
- package/dist/ui/input.mjs +1 -1
- package/dist/ui/inputs/search-input.cjs +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.mts +3 -3
- package/dist/ui/inputs/search-input.mjs +1 -1
- package/dist/ui/item.cjs +1 -1
- package/dist/ui/item.d.cts +15 -15
- package/dist/ui/item.d.mts +12 -12
- package/dist/ui/item.mjs +1 -1
- package/dist/ui/label.cjs +1 -1
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.mts +2 -2
- package/dist/ui/label.mjs +1 -1
- package/dist/ui/menubar.d.mts +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 +2 -2
- package/dist/ui/multi-select.d.mts +3 -3
- package/dist/ui/multi-select.mjs +1 -1
- package/dist/ui/multi-select.mjs.map +1 -1
- package/dist/ui/navigation-menu.cjs +1 -1
- package/dist/ui/navigation-menu.d.cts +11 -11
- package/dist/ui/navigation-menu.d.mts +11 -11
- package/dist/ui/navigation-menu.mjs +1 -1
- package/dist/ui/pagination.cjs +1 -1
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.mts +9 -9
- package/dist/ui/pagination.mjs +1 -1
- package/dist/ui/popover.cjs +1 -2
- package/dist/ui/popover.d.cts +10 -6
- package/dist/ui/popover.d.mts +10 -6
- package/dist/ui/popover.mjs +1 -2
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.mts +2 -2
- package/dist/ui/radio-group.cjs +1 -2
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.mts +3 -3
- package/dist/ui/radio-group.mjs +1 -2
- package/dist/ui/resizable.cjs +1 -1
- package/dist/ui/resizable.d.cts +36 -14
- package/dist/ui/resizable.d.mts +36 -14
- package/dist/ui/resizable.mjs +1 -1
- package/dist/ui/scroll-area.cjs +1 -1
- package/dist/ui/scroll-area.d.cts +6 -6
- package/dist/ui/scroll-area.d.mts +6 -6
- package/dist/ui/scroll-area.mjs +1 -1
- package/dist/ui/select.cjs +1 -2
- package/dist/ui/select.d.cts +10 -18
- package/dist/ui/select.d.mts +10 -18
- package/dist/ui/select.mjs +1 -2
- package/dist/ui/separator.cjs +1 -1
- package/dist/ui/separator.d.cts +2 -2
- package/dist/ui/separator.d.mts +2 -2
- package/dist/ui/separator.mjs +1 -1
- package/dist/ui/sheet.cjs +1 -1
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.mts +9 -9
- package/dist/ui/sheet.mjs +1 -1
- package/dist/ui/sidebar.cjs +1 -1
- package/dist/ui/sidebar.d.cts +29 -29
- package/dist/ui/sidebar.d.mts +29 -29
- package/dist/ui/sidebar.mjs +1 -1
- package/dist/ui/skeleton.cjs +1 -1
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.mts +2 -2
- package/dist/ui/skeleton.mjs +1 -1
- package/dist/ui/slider.cjs +1 -1
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.mts +2 -2
- package/dist/ui/slider.mjs +1 -1
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.mts +2 -2
- package/dist/ui/spinner.cjs +1 -2
- package/dist/ui/spinner.d.cts +2 -2
- package/dist/ui/spinner.d.mts +2 -2
- package/dist/ui/spinner.mjs +1 -2
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.mts +2 -2
- package/dist/ui/table.cjs +1 -1
- package/dist/ui/table.d.cts +18 -18
- package/dist/ui/table.d.mts +18 -18
- package/dist/ui/table.mjs +1 -1
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.mts +5 -5
- package/dist/ui/textarea.cjs +1 -2
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.mts +2 -2
- package/dist/ui/textarea.mjs +1 -2
- package/dist/ui/toggle-group.cjs +1 -1
- package/dist/ui/toggle-group.d.mts +3 -3
- package/dist/ui/toggle-group.mjs +1 -1
- package/dist/ui/toggle.cjs +1 -1
- package/dist/ui/toggle.d.cts +3 -3
- package/dist/ui/toggle.d.mts +5 -5
- package/dist/ui/toggle.mjs +1 -1
- package/dist/ui/tooltip.cjs +1 -1
- package/dist/ui/tooltip.d.cts +5 -5
- package/dist/ui/tooltip.mjs +1 -1
- package/package.json +1 -1
- package/dist/badge-CJ-SG_OK.mjs +0 -2
- package/dist/badge-CJ-SG_OK.mjs.map +0 -1
- package/dist/badge-CsDmp3ys.cjs +0 -2
- package/dist/badge-CsDmp3ys.cjs.map +0 -1
- package/dist/button-BLYTfCyl.cjs +0 -2
- package/dist/button-BlQN92Jt.mjs +0 -2
- package/dist/checkbox-D4K3ZATY.mjs +0 -2
- package/dist/checkbox-D4K3ZATY.mjs.map +0 -1
- package/dist/checkbox-DDuYFG0R.cjs +0 -2
- package/dist/checkbox-DDuYFG0R.cjs.map +0 -1
- package/dist/dialog-XvFmavuI.mjs +0 -2
- package/dist/dialog-XvFmavuI.mjs.map +0 -1
- package/dist/dialog-aRCyqFr-.cjs +0 -2
- package/dist/dialog-aRCyqFr-.cjs.map +0 -1
- package/dist/dist-BqoK5OAd.cjs +0 -2
- package/dist/dist-D2ydYRc4.mjs +0 -2
- package/dist/image-D2PTBG_7.cjs +0 -2
- package/dist/image-Dgxtk54D.mjs +0 -2
- package/dist/input-B2Y92Ylo.d.cts +0 -27
- package/dist/input-B6-pu-dE.d.mts +0 -27
- package/dist/input-CqN74taK.mjs +0 -2
- package/dist/input-CqN74taK.mjs.map +0 -1
- package/dist/input-dAoEznUI.cjs +0 -2
- package/dist/input-dAoEznUI.cjs.map +0 -1
- package/dist/paragraph-B9_-MKH8.cjs +0 -2
- package/dist/paragraph-B9_-MKH8.cjs.map +0 -1
- package/dist/paragraph-C83yi9US.mjs +0 -2
- package/dist/paragraph-C83yi9US.mjs.map +0 -1
- package/dist/resizable-BS63Xwia.cjs +0 -2
- package/dist/resizable-BS63Xwia.cjs.map +0 -1
- package/dist/resizable-BfkKNflf.mjs +0 -2
- package/dist/resizable-BfkKNflf.mjs.map +0 -1
- package/dist/ui/calendar.cjs.map +0 -1
- package/dist/ui/calendar.mjs.map +0 -1
- package/dist/ui/popover.cjs.map +0 -1
- package/dist/ui/popover.mjs.map +0 -1
- package/dist/ui/radio-group.cjs.map +0 -1
- package/dist/ui/radio-group.mjs.map +0 -1
- package/dist/ui/select.cjs.map +0 -1
- package/dist/ui/select.mjs.map +0 -1
- package/dist/ui/spinner.cjs.map +0 -1
- package/dist/ui/spinner.mjs.map +0 -1
- package/dist/ui/textarea.cjs.map +0 -1
- package/dist/ui/textarea.mjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require(`../../chunk-Bmb41Sf3.cjs`),t=require(`../../button.variants-Bo2vzQp5.cjs`),n=require(`../../button-BLYTfCyl.cjs`),r=require(`../../separator-DSZyCT2g.cjs`),i=require(`../../close-rM-Ao1Gf.cjs`);let a=require(`@customafk/react-toolkit/utils`),o=require(`react/jsx-runtime`),s=require(`lucide-react`),c=require(`react`),l=require(`class-variance-authority`),u=require(`@customafk/react-toolkit/date-fns`),d=require(`radix-ui`),f=require(`@tanstack/react-form`),p=require(`react-day-picker`);function m({className:e,...t}){return(0,o.jsx)(d.Checkbox.Root,{"data-slot":`checkbox`,className:(0,a.cn)(`peer border-border`,`size-4 shrink-0 cursor-pointer rounded border shadow-xs outline-none transition-all`,`disabled:cursor-not-allowed disabled:opacity-50`,`focus-visible:border-primary-strong`,`focus-visible:ring-3`,`focus-visible:ring-primary-weak`,`aria-invalid:border-danger aria-invalid:ring-danger-weak`,`aria-readonly:bg-muted-muted`,`aria-readonly:pointer-events-none`,`data-[state=checked]:aria-readonly:bg-muted-muted`,`data-[state=checked]:aria-readonly:border-border`,`data-[state=checked]:aria-readonly:text-text-positive-strong`,`data-[state=checked]:bg-primary`,`data-[state=checked]:border-primary-strong`,`data-[state=checked]:text-text-negative-strong`,e),...t,children:(0,o.jsx)(d.Checkbox.Indicator,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center text-current transition-none`,children:(0,o.jsx)(s.CheckIcon,{size:14})})})}const h=(0,l.cva)([`flex w-fit items-center justify-center rounded-full font-bold text-text-negative-strong`],{variants:{color:{default:`bg-primary-strong`,secondary:`bg-secondary-strong`,success:`bg-success-strong`,info:`bg-info-strong`,warning:`bg-warning-strong`,danger:`border border-danger-strong bg-linear-to-b from-danger-strong/90 via-danger-strong to-danger-strong/90`},size:{xs:`px-1.5 py-0.5 text-xs`,sm:`px-2 py-0.75 text-xs`,md:`px-2.5 py-0.75 text-sm`,lg:`px-3 py-1 text-sm`}},defaultVariants:{color:`default`,size:`sm`}}),g=({label:e,color:t,size:n,className:r,children:i})=>(0,o.jsx)(`div`,{"data-slot":`required-indicator`,className:h({color:t,size:n,className:r}),children:e||i});function _({className:e,children:t,...n}){return(0,o.jsxs)(d.Label.Root,{"data-slot":`label`,className:(0,a.cn)(`text-text-positive`,`flex w-full items-center justify-between`,`select-none font-medium text-sm/6 leading-none`,`group-data-[disabled=true]:pointer-events-none`,`group-data-[disabled=true]:opacity-50`,`peer-disabled:cursor-not-allowed`,`peer-disabled:opacity-50`,`aria-required:*:data-[slot=required-indicator]:inline-block`,e),...n,children:[t,(0,o.jsx)(g,{label:`Required`,color:`danger`,size:`sm`,className:`hidden`})]})}const v=(0,l.cva)(`group/field flex w-full gap-2 data-[invalid=true]:text-danger *:data-[slot=field-content]:gap-0 @md/field-group:*:data-[slot=field-content]:gap-2`,{variants:{orientation:{vertical:[`flex-col *:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`*:data-[slot=field-label]:flex-auto`,`has-[>[data-slot=field-content]]:items-start`,`has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col *:w-full [&>.sr-only]:w-auto`,`@md/field-group:flex-row`,`@md/field-group:items-center`,`@md/field-group:gap-4`,`@md/field-group:*:w-auto`,`@md/field-group:*:data-[slot=field-content]:basis-1/2`,`@md/field-group:*:data-[slot=field-content-main]:basis-1/2`,`@md/field-group:*:data-[slot=field-label]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start`,`@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}}),y=(0,c.memo)(({className:e,...t})=>(0,o.jsx)(`fieldset`,{"data-slot":`field-set`,className:(0,a.cn)(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));y.displayName=`FieldSet`;const b=(0,c.memo)(({className:e,variant:t=`legend`,...n})=>(0,o.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:(0,a.cn)(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));b.displayName=`FieldLegend`;const x=(0,c.memo)(({className:e,...t})=>(0,o.jsx)(`div`,{"data-slot":`field-group`,className:(0,a.cn)(`group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));x.displayName=`FieldGroup`;const S=(0,c.memo)(({className:e,orientation:t=`vertical`,...n})=>(0,o.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,className:(0,a.cn)(v({orientation:t}),e),...n}));S.displayName=`Field`;const C=(0,c.memo)(({className:e,...t})=>(0,o.jsx)(`div`,{"data-slot":`field-content`,className:(0,a.cn)(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));C.displayName=`FieldContent`;const w=(0,c.memo)(({className:e,...t})=>(0,o.jsx)(`div`,{"data-slot":`field-content-main`,className:(0,a.cn)(`relative`,e),...t})),T=(0,c.memo)(({className:e,...t})=>(0,o.jsx)(_,{"data-slot":`field-label`,className:(0,a.cn)(`group/field-label peer/field-label flex h-6 gap-1 font-medium leading-snug`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`has-[>[data-slot=field]]:border-border`,`has-data-[state=checked]:border-primary`,`*:data-[slot=field]:p-4 group-data-[disabled=true]/field:opacity-50`,e),...t}));T.displayName=`FieldLabel`;const E=(0,c.memo)(({className:e,...t})=>(0,o.jsx)(`div`,{"data-slot":`field-label`,className:(0,a.cn)(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));E.displayName=`FieldTitle`;const D=(0,c.memo)(({className:e,...t})=>(0,o.jsx)(`p`,{"data-slot":`field-description`,className:(0,a.cn)(`nth-last-2:-mt-1 font-normal text-sm text-text-positive-weak leading-normal last:mt-0 [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-variant=legend]+&]:-mt-1.5`,e),...t}));D.displayName=`FieldDescription`;const O=(0,c.memo)(({isShow:e=!0,className:t,...n})=>e===!1?null:(0,o.jsx)(`div`,{"data-slot":`field-note`,className:(0,a.cn)(`text-wrap rounded border border-primary-muted bg-primary-bg-subtle p-2 text-text-positive-weak text-xs`,t),...n}));O.displayName=`FieldNote`;const k=(0,c.memo)(({children:e,className:t,...n})=>(0,o.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:(0,a.cn)(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...n,children:[(0,o.jsx)(r.t,{className:`absolute inset-0 top-1/2`}),e&&(0,o.jsx)(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));k.displayName=`FieldSeparator`;const A=(0,c.memo)(({className:e,children:t,errors:n,...r})=>{let i=(0,c.useMemo)(()=>t||(n?n?.length===1&&n[0]?.message?(0,o.jsx)(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:(0,o.jsx)(`p`,{children:n[0].message})}):(0,o.jsx)(`ul`,{className:`flex list-none flex-col`,children:n.map(e=>typeof e==`string`?(0,o.jsx)(`li`,{children:e},e):e?.message?(0,o.jsx)(`li`,{children:e.message},e.message):null)}):null),[t,n]);return i?(0,o.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:(0,a.cn)(`w-full font-semibold text-danger-strong text-xs`,e),...r,children:i}):null});A.displayName=`FieldError`;const j=({label:e,description:t,options:n,helperText:r,orientation:i})=>{let a=Q(),s=(0,f.useStore)(a.form.store,({isSubmitting:e})=>e);return(0,o.jsxs)(x,{className:`gap-y-4 px-4`,children:[(0,o.jsxs)(S,{orientation:i,children:[(0,o.jsxs)(C,{children:[(0,o.jsx)(T,{children:e}),(0,o.jsx)(D,{children:t}),(0,o.jsx)(O,{isShow:!!r,children:r})]}),(0,o.jsx)(w,{children:(0,o.jsx)(x,{className:`flex flex-col gap-y-2`,children:n.map(e=>(0,o.jsxs)(S,{orientation:`horizontal`,children:[(0,o.jsx)(m,{id:`${a.name}-${e.value}`,name:a.name,checked:a.state.value?.includes(e.value)??!1,disabled:s,onCheckedChange:t=>{if(t&&a.state.value!==null)a.pushValue(e.value);else if(t&&a.state.value===null)a.setValue([e.value]);else if(!t&&a.state.value!==null){let t=a.state.value.indexOf(e.value);t>-1&&a.removeValue(t)}else !t&&a.state.value===null&&a.setValue(null)}}),(0,o.jsx)(T,{htmlFor:`${a.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),(0,o.jsx)(k,{})]})},M=({rootRef:e,className:t,...n})=>(0,o.jsx)(`div`,{"data-slot":`calendar`,ref:e,className:(0,a.cn)(t),...n}),N=e=>e.orientation===`left`?(0,o.jsx)(s.ChevronLeftIcon,{size:16,className:e.className,...e}):e.orientation===`right`?(0,o.jsx)(s.ChevronRightIcon,{size:16,className:e.className,...e}):(0,o.jsx)(s.ChevronDownIcon,{size:16,className:e.className,...e}),P=({className:e,day:t,modifiers:r,color:i,...s})=>{let l=(0,p.getDefaultClassNames)(),u=(0,c.useRef)(null);return(0,c.useEffect)(()=>{r.focused&&u.current?.focus()},[r.focused]),(0,o.jsx)(n.t,{ref:u,variant:`ghost`,color:`muted`,"data-day":t.date.toLocaleDateString(),"data-selected-single":r.selected&&!r.range_start&&!r.range_end&&!r.range_middle,"data-range-start":r.range_start,"data-range-end":r.range_end,"data-range-middle":r.range_middle,className:(0,a.cn)(`flex aspect-square size-9 flex-col rounded font-normal text-sm tabular-nums leading-none`,`data-[selected-single=true]:bg-primary`,`data-[selected-single=true]:text-white`,`data-[range-middle=true]:bg-muted-muted`,`data-[range-middle=true]:text-text-positive`,`data-[range-start=true]:bg-primary-muted`,`data-[range-start=true]:text-text-positive-strong`,`data-[range-end=true]:bg-primary`,`data-[range-end=true]:text-text-positive-strong`,`group-data-[focused=true]/day:border-primary-strong`,`group-data-[focused=true]/day:relative`,`group-data-[focused=true]/day:z-10`,`data-[range-end=true]:rounded`,`data-[range-end=true]:rounded-r`,`data-[range-middle=true]:rounded-none`,`data-[range-start=true]:rounded`,`data-[range-start=true]:rounded-l`,`[&>span]:text-xs [&>span]:opacity-70`,l.day,e),...s})},F=({children:e,...t})=>(0,o.jsx)(`td`,{...t,children:(0,o.jsx)(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:e})});function I({className:e,classNames:n,showOutsideDays:r=!0,captionLayout:i=`label`,buttonVariant:s=`ghost`,formatters:c,components:l,...u}){let d=(0,p.getDefaultClassNames)();return(0,o.jsx)(p.DayPicker,{showOutsideDays:r,className:(0,a.cn)(`group/calendar bg-background p-3`,`[--cell-size:--spacing(8)]`,`in-data-[slot=card-content]:bg-transparent`,`in-data-[slot=popover-content]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:i,formatters:{formatMonthDropdown:e=>e.toLocaleString(`default`,{month:`short`}),...c},classNames:{root:(0,a.cn)(d.root),months:(0,a.cn)(`flex gap-4 flex-col md:flex-row relative`,d.months),month:(0,a.cn)(`flex flex-col w-full gap-4`,d.month),nav:(0,a.cn)(`flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between`,d.nav),button_previous:(0,a.cn)(t.n({variant:`outline`,color:`muted`}),`size-(--cell-size) aria-disabled:opacity-50 p-0 select-none`,d.button_previous),button_next:(0,a.cn)(t.n({variant:`outline`,color:`muted`}),`size-(--cell-size) aria-disabled:opacity-50 p-0 select-none`,d.button_next),month_caption:(0,a.cn)(`flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)`,d.month_caption),dropdowns:(0,a.cn)(`w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5`,d.dropdowns),dropdown_root:(0,a.cn)(`relative has-focus:border-primary-strong border border-border-weak shadow-xs has-focus:ring-primary-weak has-focus:ring-[3px] rounded`,d.dropdown_root),dropdown:(0,a.cn)(`absolute inset-0 opacity-0`,d.dropdown),caption_label:(0,a.cn)(`select-none font-medium`,i===`label`&&`text-sm`,i!==`label`&&`rounded shadow-xs px-2 flex items-center gap-0.5 text-sm h-8 [&>svg]:text-text-positive [&>svg]:size-3.5`,d.caption_label),table:`w-full border-collapse`,weekdays:(0,a.cn)(`flex`,d.weekdays),weekday:(0,a.cn)(`text-text-positive rounded flex-1 font-normal text-[0.8rem] select-none`,d.weekday),week:(0,a.cn)(`flex w-full mt-2`,d.week),week_number_header:(0,a.cn)(`select-none w-(--cell-size)`,d.week_number_header),week_number:(0,a.cn)(`text-[0.8rem] select-none text-text-positive`,d.week_number),day:(0,a.cn)(`relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l [&:last-child[data-selected=true]_button]:rounded-r group/day aspect-square select-none`,d.day),range_start:(0,a.cn)(`rounded-l bg-muted-muted`,d.range_start),range_middle:(0,a.cn)(`rounded-none`,d.range_middle),range_end:(0,a.cn)(`rounded-r bg-muted-muted`,d.range_end),today:(0,a.cn)(`bg-muted-muted text-text-positive rounded data-[selected=true]:rounded-none`,d.today),outside:(0,a.cn)(`[&>button]:text-text-positive-muted aria-selected:text-text-positive`),disabled:(0,a.cn)(`bg-muted-muted text-text-positive opacity-50`,d.disabled),hidden:(0,a.cn)(`invisible`,d.hidden),...n},components:{Root:M,Chevron:N,DayButton:P,WeekNumber:F,...l},...u})}function ee({...e}){return(0,o.jsx)(d.Popover.Root,{"data-slot":`popover`,...e})}function te({...e}){return(0,o.jsx)(d.Popover.Trigger,{"data-slot":`popover-trigger`,...e})}function ne({className:e,align:t=`start`,sideOffset:n=4,children:r,...i}){return(0,o.jsx)(d.Popover.Portal,{children:(0,o.jsxs)(d.Popover.Content,{"data-slot":`popover-content`,align:t,sideOffset:n,className:(0,a.cn)(`relative bg-popover`,`text-text-positive`,`z-50`,`min-w-(--radix-popover-trigger-width)`,`max-h-(--radix-popover-content-available-height)`,`origin-(--radix-popover-content-transform-origin)`,`rounded-md p-4 shadow-dropdown outline-none`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in-0`,`data-[state=open]:zoom-in-95`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0`,`data-[state=closed]:zoom-out-95`,`data-[side=top]:slide-in-from-bottom-8`,`data-[side=right]:slide-in-from-left-8`,`data-[side=bottom]:slide-in-from-top-8`,`data-[side=left]:slide-in-from-right-8`,e),...i,children:[r,(0,o.jsx)(d.Popover.Arrow,{className:`fill-popover`})]})})}const re=({label:e,description:t,placeholder:r,orientation:i=`responsive`,helperText:l,minDate:d,maxDate:f,required:p})=>{let m=Q(),h=(0,c.useMemo)(()=>p?m.state.value===null:!1,[p,m.state.value]),g=(0,c.useMemo)(()=>m.state.meta.isTouched&&!m.state.meta.isValid,[m.state.meta.isTouched,m.state.meta.isValid]);return(0,o.jsxs)(x,{className:`px-4`,children:[(0,o.jsxs)(S,{orientation:i,"data-invalid":g,children:[(0,o.jsxs)(C,{children:[(0,o.jsx)(T,{htmlFor:m.name,"aria-required":h,children:e}),(0,o.jsx)(D,{children:t})]}),(0,o.jsxs)(w,{className:`flex flex-col space-y-1`,children:[(0,o.jsx)(`div`,{className:`flex w-full flex-col`,children:(0,o.jsxs)(ee,{children:[(0,o.jsx)(te,{asChild:!0,children:(0,o.jsxs)(n.t,{variant:`outline`,color:`muted`,size:`lg`,className:(0,a.cn)(`flex items-center justify-between rounded font-normal outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-4`,`data-[state=open]:ring-primary-weak`,m.state.value===null&&`text-text-positive-muted`),children:[(0,o.jsx)(`p`,{children:m.state.value===null?r||`Select date`:(0,u.format)(m.state.value,`PPPP`)}),(0,o.jsx)(s.CalendarDaysIcon,{strokeWidth:1})]})}),(0,o.jsxs)(ne,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,onBlur:m.handleBlur,children:[(0,o.jsxs)(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[(0,o.jsx)(n.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{m.handleChange((0,u.endOfToday)())},children:`Today`}),(0,o.jsx)(n.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{m.handleChange((0,u.endOfTomorrow)())},children:`Tomorrow`}),(0,o.jsx)(n.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{m.handleChange((0,u.endOfYesterday)())},children:`Yesterday`}),(0,o.jsx)(n.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{m.handleChange((0,u.subDays)((0,u.endOfToday)(),3))},children:`Last 3 Days`}),(0,o.jsx)(n.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{m.handleChange((0,u.subDays)((0,u.endOfToday)(),7))},children:`Last 7 Days`}),(0,o.jsx)(n.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{m.handleChange((0,u.subDays)((0,u.endOfToday)(),30))},children:`Last 30 Days`}),(0,o.jsx)(n.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{m.handleChange((0,u.startOfMonth)((0,u.endOfToday)()))},children:`This Month`}),(0,o.jsx)(n.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{m.handleChange((0,u.lastDayOfMonth)((0,u.endOfToday)()))},children:`Last Month`})]}),(0,o.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,o.jsx)(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:(0,o.jsx)(I,{mode:`single`,selected:m.state.value??void 0,hidden:{before:d??new Date(1900,0,1),after:f??new Date(2100,11,31)},onSelect:e=>{e&&m.handleChange(e)}})})})]})]})}),(0,o.jsx)(O,{isShow:!!l,children:l})]})]}),(0,o.jsx)(k,{})]})},L=({className:e,onChange:t,onValueChange:n,...r})=>{let i=(0,c.useCallback)(e=>{t?.(e),n?.(e.target.value)},[t,n]);return(0,o.jsx)(`input`,{"data-slot":`input`,className:(0,a.cn)(`w-full min-w-0 bg-transparent px-2.5 py-2 transition-[color,box-shadow]`,`rounded text-sm text-text-positive-weak tabular-nums leading-5 shadow-input placeholder:text-text-positive-muted`,`-outline-offset-1 outline-1 outline-border`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-transparent disabled:opacity-50`,`read-only:pointer-events-none read-only:bg-muted-muted read-only:placeholder:text-text-positive-weak`,`focus:text-text-positive focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`aria-invalid:bg-danger-bg-subtle aria-invalid:outline-danger aria-invalid:ring-danger-weak aria-invalid:focus:outline-danger-strong aria-invalid:focus:ring-4 aria-invalid:placeholder:text-text-positive-weak`,e),...r,onChange:i})},ie=({label:e,description:t,placeholder:n,orientation:r=`responsive`,helperText:i,showErrorMessage:l=!0,maxLength:u})=>{let{form:d,name:p,state:m,handleBlur:h,handleChange:g}=Q(),_=(0,f.useStore)(d.store,({isSubmitting:e})=>e),v=(0,c.useMemo)(()=>m.meta.isTouched&&!m.meta.isValid,[m.meta.isTouched,m.meta.isValid]),y=(0,c.useCallback)(({target:{value:e}})=>{_||u&&e.length>u||g(e||null)},[_,u,g]),b=(0,c.useCallback)(()=>{_||g(null)},[_,g]);return(0,o.jsxs)(x,{className:`gap-y-4 px-4`,children:[(0,o.jsxs)(S,{"data-invalid":v,orientation:r,children:[(0,o.jsxs)(C,{children:[(0,o.jsx)(T,{htmlFor:p,children:e}),(0,o.jsx)(D,{children:t})]}),(0,o.jsxs)(w,{children:[(0,o.jsx)(L,{id:p,name:p,value:m.value===null?``:m.value,"aria-invalid":v,autoComplete:`email`,placeholder:n,className:(0,a.cn)(`pl-9`,_&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:h,onChange:y}),(0,o.jsx)(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,o.jsx)(s.AtSignIcon,{size:14})}),(0,o.jsx)(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-y-0 end-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong`,onClick:b,children:(0,o.jsx)(s.XIcon,{size:14,"aria-hidden":`true`})}),(0,o.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:l&&(0,o.jsx)(A,{errors:m.meta.errors})}),(0,o.jsx)(O,{isShow:!!i,children:i})]})]}),(0,o.jsx)(k,{})]})},ae=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,oe=e=>Number(e).toLocaleString(),R=(e,t,n)=>{if(n===`none`)return e;let r=10**t,i=e*r;switch(n){case`up`:return Math.ceil(i)/r;case`down`:return Math.floor(i)/r;case`nearest`:return i%1<.1?Math.floor(i)/r:i%1>=.59?Math.ceil(i)/r:(Math.floor(i)+.5)/r;default:return e}},z=({disabled:e=!1,readOnly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:s=null,unitText:l,decimal:u,placeholder:d,precision:f,wrapperClassName:p,className:m,onChange:h,onValueChange:g,onFocus:_,onBlur:v,...y})=>{let b=(0,c.useRef)(null),x=(0,c.useRef)(null),[S,C]=(0,c.useState)(s?.toString()??null),w=(0,c.useMemo)(()=>u?.[1]??r,[u,r]),T=(0,c.useMemo)(()=>u&&u[0]-u[1],[u]),E=(0,c.useMemo)(()=>ae(n),[n]),D=(0,c.useCallback)(e=>{if(!w||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length;return n.length<=w&&r<=(T??1/0)},[w,T]),O=(0,c.useCallback)(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=R(parseFloat(e),Math.min(w-1,f||0),i).toString().split(`.`),r=oe(t);return n?`${r}.${n}`:r},[w,f,i]),k=(0,c.useCallback)(e=>{let t=e===`0`,n=e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e);if(t){g?.(0),C(e);return}if(n){C(()=>(g?.(0),e));return}},[g]),A=(0,c.useCallback)(e=>{h?.(e);let{value:t}=e.target;if(t===``||t===void 0){g?.(null),C(null);return}k(t),!(!E.test(t)||!D(t))&&(g?.(parseFloat(t)||0),C(t))},[D,h,g,k,E]),j=(0,c.useCallback)(e=>{t||(_?.(e),C(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,_]),M=(0,c.useCallback)(e=>{t||(v?.(e),C(e=>e===null?null:e===`0`||e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e)?`0`:typeof e==`string`?O(e):null))},[t,O,v]);return(0,c.useEffect)(()=>{let e=document.activeElement===x.current;if(s==null||!E.test(s.toString())||!D(s.toString())){C(null);return}C(t=>e?t:O(s.toString()))},[O,s,D,E]),(0,c.useEffect)(()=>{if(!b.current||!x.current||!l)return;let e=b.current.offsetWidth;x.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[l]),(0,o.jsxs)(`div`,{className:(0,a.cn)(`relative`,p),children:[(0,o.jsx)(L,{...y,ref:x,value:S||(t?`0`:``),placeholder:d,disabled:e,readOnly:t,className:(0,a.cn)(`text-end font-number text-sm slashed-zero lining-nums tabular-nums`,t&&`bg-muted text-muted-foreground`,m),onChange:A,onFocus:j,onBlur:M}),l&&(0,o.jsx)(`span`,{ref:b,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:l})]})},B=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:l=!0,rounding:u,decimalPlaces:d,percision:p,unit:m,required:h,allowNegative:g})=>{let _=Q(),v=(0,f.useStore)(_.form.store,({isSubmitting:e})=>e),y=(0,c.useMemo)(()=>_.state.meta.errors,[_.state.meta.errors]),b=(0,c.useMemo)(()=>h?_.state.value===null:!1,[h,_.state.value]),E=(0,c.useCallback)(e=>{v||_.handleChange(e)},[v,_.handleChange]);return(0,o.jsxs)(x,{className:`gap-y-4 px-4`,children:[(0,o.jsxs)(S,{orientation:i,"data-invalid":_.state.meta.isTouched&&!_.state.meta.isValid,children:[(0,o.jsxs)(C,{children:[(0,o.jsx)(T,{htmlFor:_.name,"aria-required":b,children:e}),(0,o.jsx)(D,{children:t})]}),(0,o.jsxs)(w,{children:[(0,o.jsxs)(`div`,{className:`relative w-full`,children:[(0,o.jsx)(z,{id:_.name,value:_.state.value,"aria-invalid":_.state.meta.isTouched&&!_.state.meta.isValid,placeholder:n,roundingRule:u,numberAfterDecimalPoint:d,precision:p,unitText:m,allowNegative:g,className:(0,a.cn)(v&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:_.handleBlur,onValueChange:E}),v&&(0,o.jsx)(`div`,{className:`absolute inset-y-0 start-2 top-2.5 text-muted-weak [&>svg]:size-3.5`,children:(0,o.jsx)(s.Loader2Icon,{className:`animate-spin text-primary-strong`})}),l&&!!y.length&&(0,o.jsx)(`div`,{className:`absolute inset-y-0 start-2 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:(0,o.jsx)(s.BanIcon,{})}),(0,o.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:l&&(0,o.jsx)(A,{errors:y})})]}),(0,o.jsx)(O,{isShow:!!r,children:r})]})]}),(0,o.jsx)(k,{})]})},V=({label:e,description:t,placeholder:n,orientation:r=`responsive`,helperText:i,showErrorMessage:a=!0})=>{let{form:l,name:u,state:d,handleBlur:p,handleChange:m}=Q(),h=(0,f.useStore)(l.store,({isSubmitting:e})=>e),[g,_]=(0,c.useState)(!1),v=(0,c.useMemo)(()=>d.meta.isTouched&&!d.meta.isValid,[d.meta.isTouched,d.meta.isValid]),y=(0,c.useCallback)(()=>_(e=>!e),[]),b=(0,c.useCallback)(({target:{value:e}})=>{h||m(e||null)},[h,m]);return(0,o.jsx)(x,{className:`gap-y-4 px-4`,children:(0,o.jsxs)(S,{"data-invalid":v,orientation:r,children:[(0,o.jsxs)(C,{children:[(0,o.jsx)(T,{htmlFor:u,children:e}),(0,o.jsx)(D,{children:t})]}),(0,o.jsxs)(w,{children:[(0,o.jsx)(L,{id:u,type:g?`text`:`password`,placeholder:n,value:d.value??``,"aria-invalid":v,autoComplete:`new-password`,onBlur:p,onChange:b}),(0,o.jsx)(`button`,{className:`absolute inset-y-0 end-0 flex size-9 items-center justify-center rounded-e-md text-muted outline-none transition-[color,box-shadow] focus:z-10 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:y,"aria-label":g?`Hide password`:`Show password`,"aria-pressed":g,"aria-controls":`password`,children:g?(0,o.jsx)(s.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,o.jsx)(s.EyeIcon,{size:16,"aria-hidden":`true`})}),(0,o.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&(0,o.jsx)(A,{errors:d.meta.errors})}),(0,o.jsx)(O,{isShow:!!i,children:i})]})]})})};function H({className:e,...t}){return(0,o.jsx)(d.RadioGroup.Root,{"data-slot":`radio-group`,className:(0,a.cn)(`grid gap-3`,e),...t})}function U({className:e,...t}){return(0,o.jsx)(d.RadioGroup.Item,{"data-slot":`radio-group-item`,className:(0,a.cn)(`aspect-square size-4 shrink-0 rounded-full border border-border shadow-xs outline-none transition-all`,`disabled:cursor-not-allowed disabled:opacity-50`,`focus:border-border focus:ring-4 focus:ring-primary-weak`,`aria-invalid:border-danger-strong aria-invalid:ring-danger-weak`,`aria-readonly:pointer-events-none`,`aria-readonly:[&_div]:bg-muted`,`aria-readonly:[&_svg]:fill-muted-weak`,`aria-readonly:[&_svg]:text-muted-weak`,e),...t,children:(0,o.jsxs)(d.RadioGroup.Indicator,{"data-slot":`radio-group-indicator`,className:`relative flex items-center justify-center bg-primary`,children:[(0,o.jsx)(`div`,{className:`absolute size-4 rounded-full bg-primary`}),(0,o.jsx)(s.CircleIcon,{className:`-translate-1/2 absolute top-1/2 left-1/2 size-2 fill-text-negative-strong text-text-negative`})]})})}const W=({label:e,description:t,orientation:n,options:r,helperText:i})=>{let s=Q(),c=(0,f.useStore)(s.form.store,({isSubmitting:e})=>e);return(0,o.jsxs)(x,{className:`px-4`,children:[(0,o.jsxs)(S,{orientation:n,className:`flex-col gap-2`,children:[(0,o.jsxs)(C,{children:[(0,o.jsx)(T,{children:e}),(0,o.jsx)(D,{children:t}),(0,o.jsx)(O,{isShow:!!i,children:i})]}),(0,o.jsx)(w,{children:(0,o.jsx)(H,{defaultValue:s.state.value??void 0,className:`w-full`,onValueChange:s.handleChange,children:r.map(e=>(0,o.jsx)(T,{className:(0,a.cn)(`h-fit`,s.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,c&&`pointer-events-none bg-muted-muted opacity-60`,s.state.value===e.value&&c&&`border-border-strong!`),children:(0,o.jsxs)(S,{orientation:`horizontal`,className:`justify-between rounded p-2!`,children:[(0,o.jsxs)(C,{className:`gap-1!`,children:[(0,o.jsx)(E,{children:e.label}),(0,o.jsx)(D,{className:`text-xs`,children:e.description})]}),(0,o.jsx)(U,{value:e.value})]})},e.value))})})]}),(0,o.jsx)(k,{})]})};function G({...e}){return(0,o.jsx)(d.Select.Root,{"data-slot":`select`,...e})}function K({...e}){return(0,o.jsx)(d.Select.Value,{"data-slot":`select-value`,...e})}function q({className:e,children:t,...n}){return(0,o.jsxs)(d.Select.Trigger,{"data-slot":`select-trigger`,className:(0,a.cn)(`flex w-full items-center justify-between`,`outline-1 outline-border -outline-offset-1`,`gap-2 rounded bg-transparent px-3 py-2`,`rounded shadow-input transition-all`,`cursor-pointer whitespace-nowrap text-sm`,`focus-visible:text-text-positive-strong`,`focus-visible:outline-primary-strong`,`focus-visible:ring-4`,`focus-visible:ring-primary-weak`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-4`,`data-[state=open]:ring-primary-weak`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`aria-invalid:bg-danger-bg-subtle`,`aria-invalid:outline-danger`,`aria-invalid:ring-danger-weak`,`aria-invalid:focus:outline-danger-strong`,`aria-invalid:focus:ring-4`,`aria-invalid:placeholder:text-text-positive-weak`,`aria-invalid:data-[state=open]:outline-danger-strong`,`aria-invalid:data-[state=open]:ring-danger-weak`,`data-placeholder:text-text-positive-muted`,`*:data-[slot=select-value]:line-clamp-1`,`*:data-[slot=select-value]:flex`,`*:data-[slot=select-value]:items-center`,`*:data-[slot=select-value]:gap-2`,`aria-readonly:bg-muted-muted`,`aria-readonly:cursor-default`,`aria-readonly:focus:outline-none`,`aria-readonly:ring-0`,`aria-readonly:pointer-events-none`,`[&_svg]:shrink-0`,`[&_svg]:pointer-events-none`,`[&_svg:not([class*='size-'])]:size-4`,`[&_svg:not([class*='text-'])]:text-muted-foreground`,e),...n,children:[t,(0,o.jsx)(d.Select.Icon,{asChild:!0,children:(0,o.jsx)(s.ChevronDownIcon,{size:16,opacity:50})})]})}function se({className:e,children:t,position:n=`popper`,...r}){return(0,o.jsx)(d.Select.Portal,{"data-slot":`select-portal`,children:(0,o.jsx)(d.Select.Content,{"data-slot":`select-content`,className:(0,a.cn)(`relative z-50 max-h-80 min-w-32 overflow-y-auto overflow-x-hidden rounded shadow-dropdown duration-300`,`bg-white`,`w-(--radix-select-trigger-width)`,`origin-(--radix-select-content-transform-origin)`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out`,`data-[side=bottom]:slide-in-from-top-8`,`data-[side=left]:slide-in-from-right-8`,`data-[side=right]:slide-in-from-left-8`,`data-[side=top]:slide-in-from-bottom-8`,n===`popper`&&`data-[side=bottom]:translate-y-1`,n===`popper`&&`data-[side=left]:-translate-x-1`,n===`popper`&&`data-[side=right]:translate-x-1`,n===`popper`&&`data-[side=top]:-translate-y-1`,e),position:n,...r,children:(0,o.jsx)(d.Select.Viewport,{className:(0,a.cn)(`p-1`,n===`popper`&&`h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1`),children:t})})})}function ce({className:e,children:t,...n}){return(0,o.jsxs)(d.Select.Item,{"data-slot":`select-item`,className:(0,a.cn)(`relative flex select-none items-center`,`gap-2 rounded py-2.5 pr-8 pl-2`,`w-full`,`cursor-pointer outline-none transition-colors`,`font-medium text-sm text-text-positive-weak`,`focus:shadow-xs`,`focus:bg-muted-muted`,`data-disabled:opacity-50`,`data-disabled:pointer-events-none`,`[&_svg]:pointer-events-none`,`[&_svg]:shrink-0`,`[&_svg:not([class*='size-'])]:size-4`,`[&_svg:not([class*='text-'])]:text-text-positive-weak`,`*:[span]:last:flex`,`*:[span]:last:items-center`,`*:[span]:last:gap-2`,e),...n,children:[(0,o.jsx)(d.Select.ItemText,{children:t}),(0,o.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,o.jsx)(d.Select.ItemIndicator,{children:(0,o.jsx)(s.CheckIcon,{size:16})})})]})}const le=({label:e,description:t,placeholder:n,orientation:r=`responsive`,options:i,helperText:a,required:l=!1})=>{let u=Q(),d=(0,c.useMemo)(()=>u.state.meta.isTouched&&!u.state.meta.isValid,[u.state.meta.isTouched,u.state.meta.isValid]),f=(0,c.useMemo)(()=>l?u.state.value===null:!1,[l,u.state.value]),p=(0,c.useMemo)(()=>u.state.meta.errors,[u.state.meta.errors]);return(0,o.jsxs)(x,{className:`gap-y-4 px-4`,children:[(0,o.jsxs)(S,{orientation:r,"data-invalid":u.state.meta.isTouched&&!u.state.meta.isValid,children:[(0,o.jsxs)(C,{children:[(0,o.jsx)(T,{htmlFor:u.name,"aria-required":f,children:e}),(0,o.jsx)(D,{children:t})]}),(0,o.jsxs)(w,{className:`flex flex-col`,children:[(0,o.jsxs)(G,{defaultValue:u.state.value||void 0,onValueChange:u.handleChange,children:[(0,o.jsx)(q,{"aria-invalid":d?`true`:void 0,onBlur:u.handleBlur,children:(0,o.jsx)(K,{placeholder:n})}),(0,o.jsxs)(se,{children:[!!i.length&&i.map(e=>(0,o.jsx)(ce,{value:e.value,children:e.label},e.value)),!i.length&&(0,o.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[(0,o.jsx)(s.PackagePlusIcon,{strokeWidth:1}),`No options available`]})]})]}),(0,o.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:(0,o.jsx)(A,{errors:p})}),(0,o.jsx)(O,{isShow:!!a,children:a})]})]}),(0,o.jsx)(k,{})]})};function ue({className:e,...t}){return(0,o.jsx)(d.Switch.Root,{"data-slot":`switch`,className:(0,a.cn)(`peer`,`w-8 shrink-0 cursor-pointer items-center rounded-full shadow-xs transition-all`,`inline-flex h-5`,`focus-visible:border-primary-strong`,`focus-visible:ring-primary-weak`,`focus-visible:ring-4`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`-outline-offset-1 inset-shadow-2xs outline-1`,`data-[state=checked]:bg-primary`,`data-[state=checked]:outline-primary-strong`,`data-[state=unchecked]:bg-muted-weak`,`data-[state=unchecked]:outline-border`,`data-[state=unchecked]:[&_span]:size-4`,`data-[state=unchecked]:[&_span]:translate-x-0.5`,`data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5`,e),...t,children:(0,o.jsx)(d.Switch.Thumb,{"data-slot":`switch-thumb`,className:(0,a.cn)(`block size-4 bg-card shadow-xs`,`pointer-events-none rounded-full ring-0 transition-transform`,`data-[state=checked]:translate-x-[calc(100%-3px)]`,`data-[state=unchecked]:translate-x-0`)})})}const de=({label:e,description:t,helperText:n})=>{let r=Q();return(0,o.jsxs)(x,{className:`gap-y-4 px-4`,children:[(0,o.jsxs)(S,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[(0,o.jsxs)(C,{children:[(0,o.jsx)(E,{className:`cursor-pointer`,children:(0,o.jsx)(`label`,{htmlFor:r.name,children:e})}),(0,o.jsx)(D,{children:t}),(0,o.jsx)(ue,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),(0,o.jsx)(O,{isShow:!!n,children:n})]}),(0,o.jsx)(k,{})]})},fe=({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:l=`responsive`,showClearButton:u=!1,showErrorMessage:d=!0,required:p=!1,maxLength:m})=>{let{form:h,name:g,state:_,handleBlur:v,handleChange:y}=Q(),b=(0,f.useStore)(h.store,({isSubmitting:e})=>e),E=(0,c.useMemo)(()=>u&&!b,[u,b]),j=(0,c.useMemo)(()=>_.value?_.value.length:0,[_.value]),M=(0,c.useMemo)(()=>{if(!i)return``;let e=`character${[0,1].includes(j)?``:`s`}`;return i&&m?`${j} / ${m} ${e}`:`${j} ${e}`},[j,i,m]),N=(0,c.useMemo)(()=>_.meta.isTouched&&!_.meta.isValid,[_.meta.isTouched,_.meta.isValid]),P=(0,c.useMemo)(()=>p?_.value===null:!1,[p,_.value]),F=(0,c.useCallback)(({target:{value:e}})=>{b||i&&m&&e.length>m||y(e||null)},[b,i,m,y]),I=(0,c.useCallback)(()=>{b||y(``)},[b,y]);return(0,o.jsxs)(x,{className:`gap-y-4 px-4`,children:[(0,o.jsxs)(S,{orientation:l,"data-invalid":N,children:[(0,o.jsxs)(C,{children:[(0,o.jsx)(T,{"aria-required":P,htmlFor:g,children:e}),(0,o.jsx)(D,{children:t})]}),(0,o.jsxs)(w,{children:[(0,o.jsx)(L,{id:g,name:g,value:_.value===null?``:_.value,"aria-invalid":N,autoComplete:`off`,placeholder:n,className:(0,a.cn)(`pr-6`,b&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:v,onChange:F}),E&&!_.meta.errors.length&&(0,o.jsx)(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-y-0 end-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-intense [&>svg]:size-3.5`,onClick:I,children:(0,o.jsx)(s.XIcon,{"aria-hidden":`true`})}),b&&(0,o.jsx)(`div`,{className:`absolute inset-y-0 end-2 top-2.5 text-muted-weak`,children:(0,o.jsx)(s.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),d&&!!_.meta.errors.length&&(0,o.jsx)(`div`,{className:`absolute inset-y-0 end-2 top-2.5 text-danger-strong`,children:(0,o.jsx)(s.BanIcon,{size:14})}),(0,o.jsxs)(`div`,{className:`mt-1 flex w-full items-start gap-x-2`,children:[d&&(0,o.jsx)(A,{className:`flex-1`,errors:_.meta.errors}),!!i&&(0,o.jsx)(`p`,{className:`h-4 flex-0 text-nowrap text-end text-text-positive-weak text-xs tabular-nums`,children:M})]}),(0,o.jsx)(O,{isShow:!!r,children:r})]})]}),(0,o.jsx)(k,{})]})};function pe({className:e,onChange:t,onValueChange:n,...r}){let i=(0,c.useCallback)(e=>{t?.(e),n?.(e.target.value)},[t,n]);return(0,o.jsx)(`textarea`,{"data-slot":`textarea`,className:(0,a.cn)(`flex min-h-24 w-full bg-transparent px-3 py-2`,`rounded shadow-input transition-[color,box-shadow] duration-200`,`resize-y text-sm text-text-positive-weak tabular-nums caret-primary`,`-outline-offset-1 outline-1 outline-border`,`placeholder:text-text-positive-muted`,`focus:text-text-positive focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`read-only:pointer-events-none read-only:bg-muted-muted read-only:placeholder:text-text-positive-weak`,`aria-invalid:bg-danger-bg-subtle`,`aria-invalid:outline-danger`,`aria-invalid:ring-danger-weak`,`aria-invalid:focus:outline-danger-strong`,`aria-invalid:focus:ring-4`,`aria-invalid:placeholder:text-text-positive-weak`,`disabled:cursor-not-allowed disabled:opacity-50`,`disabled:pointer-events-none`,`disabled:border-border-weak/50 disabled:bg-secondary-muted/10`,e),...r,onChange:i})}const me=({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:l=`responsive`,showErrorMessage:u=!0,required:d=!1,maxLength:p})=>{let{form:m,state:h,name:g,handleBlur:_,handleChange:v}=Q(),y=(0,f.useStore)(m.store,({isSubmitting:e})=>e),b=(0,c.useMemo)(()=>h.value?h.value.length:0,[h.value]),E=(0,c.useMemo)(()=>{if(!i)return``;let e=`character${[0,1].includes(b)?``:`s`}`;return i&&p?`${b} / ${p} ${e}`:`${b} ${e}`},[b,i,p]),j=(0,c.useMemo)(()=>h.meta.isTouched&&!h.meta.isValid,[h.meta.isTouched,h.meta.isValid]),M=(0,c.useMemo)(()=>h.meta.errors,[h.meta.errors]),N=(0,c.useMemo)(()=>d?h.value===null:!1,[d,h.value]),P=(0,c.useCallback)(({target:{value:e}})=>{y||i&&p&&e.length>p||v(e||null)},[y,i,p,v]);return(0,o.jsxs)(x,{className:`px-4`,children:[(0,o.jsxs)(S,{orientation:l,"data-invalid":j,children:[(0,o.jsxs)(C,{children:[(0,o.jsx)(T,{"aria-required":N,htmlFor:g,children:e}),(0,o.jsx)(D,{children:t})]}),(0,o.jsxs)(w,{children:[(0,o.jsx)(pe,{id:g,name:g,value:h.value===null?``:h.value,"aria-invalid":j,autoComplete:`off`,placeholder:n,className:(0,a.cn)(y&&`pointer-events-none bg-muted-muted opacity-60`),onChange:P,onBlur:_}),y&&(0,o.jsx)(`div`,{className:`absolute inset-y-0 end-2 top-2.5 text-muted-weak`,children:(0,o.jsx)(s.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),u&&!!M.length&&(0,o.jsx)(`div`,{className:`absolute inset-y-0 end-2 top-2.5 text-danger-strong`,children:(0,o.jsx)(s.BanIcon,{size:14})}),(0,o.jsxs)(`div`,{className:`mt-1 flex w-full items-start gap-x-2`,children:[u&&(0,o.jsx)(A,{className:`flex-1`,errors:M}),!!i&&(0,o.jsx)(`p`,{className:`h-4 flex-0 text-nowrap text-end text-text-positive-weak text-xs tabular-nums`,children:E})]}),(0,o.jsx)(O,{isShow:!!r,children:r})]})]}),(0,o.jsx)(k,{})]})},he=({label:e,className:t})=>{let r=$(),i=(0,c.useCallback)(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return(0,o.jsx)(r.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:r,isSubmitting:s})=>(0,o.jsx)(n.t,{type:`button`,size:`md`,disabled:r,isLoading:s,className:(0,a.cn)(`min-h-8 min-w-32`,t),onClick:i,children:e??`Submit`})})},ge=({type:e=`create`})=>{let t=$();return(0,o.jsxs)(`div`,{className:`flex h-8 items-center justify-between`,children:[(0,o.jsx)(t.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,o.jsx)(n.t,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:e,className:`h-full min-w-32`,onClick:()=>t.reset(),children:`Cancel`})}),e===`create`&&(0,o.jsx)(t.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:e,isSubmitting:r})=>(0,o.jsxs)(n.t,{type:`submit`,size:`md`,disabled:e,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await t.handleSubmit({submitAction:`create`}),t.state.isSubmitSuccessful&&t.reset()},children:[(0,o.jsx)(s.PlusIcon,{}),`Add New`]})}),e===`update`&&(0,o.jsx)(t.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:e,isSubmitting:r})=>(0,o.jsxs)(n.t,{type:`submit`,size:`md`,disabled:e,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await t.handleSubmit({submitAction:`update`}),t.state.isSubmitSuccessful&&t.reset()},children:[(0,o.jsx)(s.ArrowDownToLine,{}),`Update`]})})]})};function J({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,o.jsx)(d.Separator.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:(0,a.cn)(`shrink-0 bg-border-weak`,`data-[orientation=horizontal]:h-px`,`data-[orientation=horizontal]:w-full`,`data-[orientation=vertical]:h-full`,`data-[orientation=vertical]:w-px`,e),...r})}const _e=({title:e,description:t,onDelete:r,children:i})=>(0,o.jsxs)(`section`,{"data-slot":`card-form`,className:`relative flex flex-col rounded-md bg-card pb-4 shadow-card ring-4 ring-border-weak`,children:[(0,o.jsxs)(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-1 p-4`,children:[(0,o.jsx)(`p`,{className:`font-semibold text-lg`,children:e}),!!t&&(0,o.jsx)(`p`,{className:`text-muted text-sm`,children:t})]}),(0,o.jsx)(J,{}),(0,o.jsx)(`div`,{"data-slot":`card-form-main`,className:`flex flex-col space-y-4 py-4`,children:i}),!!r&&(0,o.jsxs)(n.t,{color:`danger`,variant:`outline`,size:`sm`,className:`absolute top-2 right-2`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[(0,o.jsx)(s.Trash2Icon,{}),`Remove`]})]}),ve=({children:e})=>(0,o.jsx)(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),Y=({...e})=>(0,o.jsx)(`button`,{...e,type:`button`,className:`min-w-40 cursor-pointer rounded-sm border border-border bg-card px-4 py-2 font-semibold text-sm text-text-positive shadow-xs outline-none transition-all hover:opacity-90 focus:border-border focus:ring-3 focus:ring-border/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none`,children:`Cancel`}),X=({isSubmitting:e,submitText:t=`Submit`,...n})=>(0,o.jsx)(`button`,{...n,type:`button`,"data-loading":e?`true`:void 0,className:`relative min-h-9.5 min-w-40 cursor-pointer rounded-sm border border-primary-strong bg-primary px-4 py-2 font-semibold text-sm text-text-negative shadow-card outline-none transition-all hover:opacity-90 focus:border-transparent focus:ring-3 focus:ring-primary/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none data-[loading=true]:pointer-events-none data-[loading=true]:opacity-80`,children:e?(0,o.jsx)(s.Loader2,{size:16,strokeWidth:3,className:`absolute top-1/2 left-1/2 z-10 -translate-x-1/2 -translate-y-1/2 animate-spin`}):t}),ye=({title:e,submitText:t,open:n,onOpenChange:i,children:a})=>{let s=$(),l=(0,c.useCallback)(e=>{e||s.reset(),i?.(e)},[s.reset,i]);return(0,o.jsx)(d.Dialog.Root,{open:n,onOpenChange:l,children:(0,o.jsxs)(d.Dialog.DialogPortal,{"data-slot":`dialog-portal`,children:[(0,o.jsx)(d.Dialog.DialogOverlay,{"data-slot":`dialog-overlay`,className:`data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=closed]:animate-out data-[state=open]:animate-in`}),(0,o.jsxs)(d.Dialog.Content,{className:`data-[state=open]:fade-in-0 data-[state=open]:zoom-in-80 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-80 fixed top-1/2 left-1/2 z-50 flex size-full max-h-dvh max-w-dvw -translate-x-1/2 -translate-y-1/2 flex-col gap-0 overflow-y-auto bg-background p-0 shadow-dialog outline-none duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:h-auto sm:max-h-[85dvh] sm:max-w-2xl sm:rounded-sm`,children:[(0,o.jsx)(`div`,{"data-slot":`dialog-header`,className:`flex flex-col items-center justify-center gap-2 px-4 py-6 text-center shadow-sm sm:text-left`,children:(0,o.jsx)(d.Dialog.Title,{"data-slot":`dialog-title`,className:`font-medium text-lg text-text-positive-strong leading-none`,children:e})}),(0,o.jsx)(r.t,{}),(0,o.jsx)(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col space-y-4 overflow-y-auto p-0 pt-6 max-sm:flex-1 sm:p-4`,children:a}),(0,o.jsx)(r.t,{}),(0,o.jsxs)(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-between gap-2 px-6 py-4 shadow-sm sm:flex-row sm:justify-end max-sm:[&>button]:w-full`,children:[(0,o.jsx)(s.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>(0,o.jsx)(Y,{disabled:e,onClick:()=>{s.reset(),l(!1)}})}),(0,o.jsx)(s.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:n})=>(0,o.jsx)(X,{isSubmitting:e,disabled:n,submitText:t,onClick:()=>s.handleSubmit()})})]})]})]})})},be=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>(0,o.jsxs)(x,{className:`gap-y-4 px-4`,children:[(0,o.jsxs)(S,{orientation:r,children:[(0,o.jsxs)(C,{children:[(0,o.jsx)(T,{children:e}),(0,o.jsx)(D,{children:t})]}),(0,o.jsxs)(w,{children:[i,(0,o.jsx)(O,{isShow:!!n,children:n})]})]}),(0,o.jsx)(k,{})]}),xe=({title:e,open:t,contentClassName:n,onOpenChange:r,children:s})=>{let c=$();return(0,o.jsx)(d.Dialog.Root,{"data-slot":`dialog`,open:t,onOpenChange:r,children:(0,o.jsxs)(d.Dialog.Portal,{"data-slot":`dialog-portal`,children:[(0,o.jsx)(d.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:(0,a.cn)(`fixed inset-0 z-40 bg-black/50 backdrop-blur-sm`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out`)}),(0,o.jsx)(d.Dialog.Content,{"data-slot":`dialog-content`,className:(0,a.cn)(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background drop-shadow-lg`,`duration-300`,`data-[state=open]:animate-in`,`data-[state=open]:slide-in-from-right`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:slide-out-to-right`,`data-[state=closed]:fade-out`),children:(0,o.jsxs)(`section`,{className:`relative flex size-full flex-col`,children:[(0,o.jsx)(`header`,{className:`flex h-14 items-center border-border border-b px-4`,children:(0,o.jsx)(`h2`,{className:`font-semibold text-lg text-primary-strong`,children:e})}),(0,o.jsx)(`div`,{className:(0,a.cn)(`flex flex-1 flex-col overflow-y-auto py-4`,n),children:s}),(0,o.jsxs)(`div`,{className:`flex flex-col space-y-4 border-border border-t px-4 py-2`,children:[(0,o.jsx)(c.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>(0,o.jsx)(X,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>c.handleSubmit()})}),(0,o.jsx)(c.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,o.jsx)(Y,{disabled:e,className:`w-full`,onClick:()=>{c.reset(),r?.(!1)}})})]}),(0,o.jsx)(d.Dialog.Close,{asChild:!0,children:(0,o.jsx)(i.t,{className:`absolute top-2 right-2`})})]})})]})})},Se=({children:e})=>(0,o.jsx)(`header`,{"data-slot":`section-header`,className:`px-4 pt-2.5 pb-2 font-medium text-base text-primary-strong`,children:e}),Z=({children:e})=>(0,o.jsx)(`main`,{"data-slot":`section-main`,className:`relative flex flex-col space-y-4 py-4`,children:e}),Ce=({title:e,children:t})=>(0,o.jsxs)(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-4 ring-border-weak`,children:[(0,o.jsx)(Se,{children:e}),(0,o.jsx)(J,{}),(0,o.jsx)(Z,{children:t})]}),we=({title:e,description:t,helperText:n})=>(0,o.jsxs)(x,{className:`gap-y-4 px-4`,children:[(0,o.jsxs)(S,{className:`gap-0`,children:[(0,o.jsxs)(C,{children:[(0,o.jsx)(b,{className:`mb-1`,children:e}),(0,o.jsx)(D,{children:t})]}),(0,o.jsx)(O,{isShow:!!n,children:n})]}),(0,o.jsx)(k,{})]}),{fieldContext:Te,formContext:Ee,useFieldContext:Q,useFormContext:$}=(0,f.createFormHookContexts)(),{useAppForm:De,withForm:Oe,withFieldGroup:ke}=(0,f.createFormHook)({fieldContext:Te,formContext:Ee,fieldComponents:{TextField:fe,TextareaField:me,NumberField:B,EmailField:ie,PasswordField:V,SelectField:le,DateField:re,SwitchField:de,RadioGroupField:W,CheckboxField:j,FieldGroup:x,Field:S,FieldContent:C,FieldLabel:T,FieldContentMain:w,FieldSeparator:k,FieldError:A},formComponents:{TanStackDialogForm:ye,TanStackPopoverForm:xe,TanStackContainerForm:ve,TanStackSectionForm:Ce,TanStackCardForm:_e,TanStackFieldGroup:be,TanStackTitleField:we,TanStackActionsForm:ge,TanStackActionSubmit:he}});exports.Field=S,exports.FieldContent=C,exports.FieldContentMain=w,exports.FieldError=A,exports.FieldGroup=x,exports.FieldLabel=T,exports.FieldSeparator=k,exports.useTanStackFieldContext=Q,exports.useTanStackForm=De,exports.useTanStackFormContext=$,exports.withTanStackFieldGroup=ke,exports.withTanStackForm=Oe;
|
|
1
|
+
const e=require(`../../chunk-Bmb41Sf3.cjs`);require(`../../heading-BEm5CCSE.cjs`),require(`../../paragraph-4z_6Z5aj.cjs`),require(`../../button.variants-8QOIR433.cjs`);const t=require(`../../button-8Snjc8iT.cjs`),n=require(`../../separator-C3ip6sbh.cjs`),r=require(`../../close-D_Ge7gnP.cjs`),i=require(`../../dialog-D5TBBX99.cjs`),a=require(`../../checkbox-C0fSWwmD.cjs`),o=require(`../../input-BFWWaN-v.cjs`),s=require(`../../popover-DzDrgttC.cjs`),c=require(`../../calendar-DgLMLD8R.cjs`),l=require(`../../radio-group-CBhRsUjN.cjs`),u=require(`../../select-2CgwiefV.cjs`),d=require(`../../textarea-COQoSVSc.cjs`);let f=require(`@customafk/react-toolkit/utils`),p=require(`class-variance-authority`),m=require(`react`),h=require(`react/jsx-runtime`),g=require(`lucide-react`),_=require(`@customafk/react-toolkit/date-fns`),v=require(`radix-ui`),y=require(`@tanstack/react-form`);const b=(0,p.cva)([`flex w-fit items-center justify-center rounded-full font-bold text-text-negative-strong`],{variants:{color:{default:`bg-primary-strong`,secondary:`bg-secondary-strong`,success:`bg-success-strong`,info:`bg-info-strong`,warning:`bg-warning-strong`,danger:`border border-danger-strong bg-linear-to-b from-danger-strong/90 via-danger-strong to-danger-strong/90`},size:{xs:`px-1.5 py-0.5 text-xs`,sm:`px-2 py-0.75 text-xs`,md:`px-2.5 py-0.75 text-sm`,lg:`px-3 py-1 text-sm`}},defaultVariants:{color:`default`,size:`sm`}}),x=({label:e,color:t,size:n,className:r,children:i})=>(0,h.jsx)(`div`,{"data-slot":`required-indicator`,className:b({color:t,size:n,className:r}),children:e||i});function S({className:e,children:t,...n}){return(0,h.jsxs)(v.Label.Root,{"data-slot":`label`,className:(0,f.cn)(`text-text-positive`,`flex w-full items-center justify-between`,`select-none font-medium text-sm/6 leading-none`,`group-data-[disabled=true]:pointer-events-none`,`group-data-[disabled=true]:opacity-50`,`peer-disabled:cursor-not-allowed`,`peer-disabled:opacity-50`,`aria-required:*:data-[slot=required-indicator]:inline-block`,e),...n,children:[t,(0,h.jsx)(x,{label:`Required`,color:`danger`,size:`sm`,className:`hidden`})]})}const C=(0,p.cva)(`group/field flex w-full gap-2 data-[invalid=true]:text-danger *:data-[slot=field-content]:gap-0 @md/field-group:*:data-[slot=field-content]:gap-2`,{variants:{orientation:{vertical:[`flex-col *:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`*:data-[slot=field-label]:flex-auto`,`has-[>[data-slot=field-content]]:items-start`,`has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col *:w-full [&>.sr-only]:w-auto`,`@md/field-group:flex-row`,`@md/field-group:items-center`,`@md/field-group:gap-4`,`@md/field-group:*:w-auto`,`@md/field-group:*:data-[slot=field-content]:basis-1/2`,`@md/field-group:*:data-[slot=field-content-main]:basis-1/2`,`@md/field-group:*:data-[slot=field-label]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start`,`@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}}),w=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`fieldset`,{"data-slot":`field-set`,className:(0,f.cn)(`flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t}));w.displayName=`FieldSet`;const T=(0,m.memo)(({className:e,variant:t=`legend`,...n})=>(0,h.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:(0,f.cn)(`mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n}));T.displayName=`FieldLegend`;const E=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`div`,{"data-slot":`field-group`,className:(0,f.cn)(`group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t}));E.displayName=`FieldGroup`;const D=(0,m.memo)(({className:e,orientation:t=`vertical`,...n})=>(0,h.jsx)(`div`,{"data-slot":`field`,"data-orientation":t,className:(0,f.cn)(C({orientation:t}),e),...n}));D.displayName=`Field`;const O=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`div`,{"data-slot":`field-content`,className:(0,f.cn)(`group/field-content flex flex-col gap-1.5 leading-snug`,e),...t}));O.displayName=`FieldContent`;const k=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`div`,{"data-slot":`field-content-main`,className:(0,f.cn)(`relative`,e),...t})),A=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(S,{"data-slot":`field-label`,className:(0,f.cn)(`group/field-label peer/field-label flex h-6 gap-1 font-medium leading-snug`,`has-[>[data-slot=field]]:w-full`,`has-[>[data-slot=field]]:flex-col`,`has-[>[data-slot=field]]:rounded-md`,`has-[>[data-slot=field]]:border`,`has-[>[data-slot=field]]:border-border`,`has-data-[state=checked]:border-primary`,`*:data-[slot=field]:p-4 group-data-[disabled=true]/field:opacity-50`,e),...t}));A.displayName=`FieldLabel`;const j=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`div`,{"data-slot":`field-label`,className:(0,f.cn)(`flex w-fit items-center gap-2 font-medium text-sm leading-snug group-data-[disabled=true]/field:opacity-50`,e),...t}));j.displayName=`FieldTitle`;const M=(0,m.memo)(({className:e,...t})=>(0,h.jsx)(`p`,{"data-slot":`field-description`,className:(0,f.cn)(`nth-last-2:-mt-1 font-normal text-sm text-text-positive-weak leading-normal last:mt-0 [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-variant=legend]+&]:-mt-1.5`,e),...t}));M.displayName=`FieldDescription`;const N=(0,m.memo)(({isShow:e=!0,className:t,...n})=>e===!1?null:(0,h.jsx)(`div`,{"data-slot":`field-note`,className:(0,f.cn)(`text-wrap rounded border border-primary-muted bg-primary-bg-subtle p-2 text-text-positive-weak text-xs`,t),...n}));N.displayName=`FieldNote`;const P=(0,m.memo)(({children:e,className:t,...r})=>(0,h.jsxs)(`div`,{"data-slot":`field-separator`,"data-content":!!e,className:(0,f.cn)(`relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2`,t),...r,children:[(0,h.jsx)(n.t,{className:`absolute inset-0 top-1/2`}),e&&(0,h.jsx)(`span`,{className:`relative mx-auto block w-fit bg-background px-2 text-text-positive-weak`,"data-slot":`field-separator-content`,children:e})]}));P.displayName=`FieldSeparator`;const F=(0,m.memo)(({className:e,children:t,errors:n,...r})=>{let i=(0,m.useMemo)(()=>t||(n?n?.length===1&&n[0]?.message?(0,h.jsx)(`div`,{className:`flex flex-row items-center justify-start gap-x-0.5`,children:(0,h.jsx)(`p`,{children:n[0].message})}):(0,h.jsx)(`ul`,{className:`flex list-none flex-col`,children:n.map(e=>typeof e==`string`?(0,h.jsx)(`li`,{children:e},e):e?.message?(0,h.jsx)(`li`,{children:e.message},e.message):null)}):null),[t,n]);return i?(0,h.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:(0,f.cn)(`w-full font-semibold text-danger-strong text-xs`,e),...r,children:i}):null});F.displayName=`FieldError`;const I=({label:e,description:t,options:n,helperText:r,orientation:i})=>{let o=Z(),s=(0,y.useStore)(o.form.store,({isSubmitting:e})=>e);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:i,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{children:e}),(0,h.jsx)(M,{children:t}),(0,h.jsx)(N,{isShow:!!r,children:r})]}),(0,h.jsx)(k,{children:(0,h.jsx)(E,{className:`flex flex-col gap-y-2`,children:n.map(e=>(0,h.jsxs)(D,{orientation:`horizontal`,children:[(0,h.jsx)(a.t,{id:`${o.name}-${e.value}`,name:o.name,checked:o.state.value?.includes(e.value)??!1,disabled:s,onCheckedChange:t=>{if(t&&o.state.value!==null)o.pushValue(e.value);else if(t&&o.state.value===null)o.setValue([e.value]);else if(!t&&o.state.value!==null){let t=o.state.value.indexOf(e.value);t>-1&&o.removeValue(t)}else !t&&o.state.value===null&&o.setValue(null)}}),(0,h.jsx)(A,{htmlFor:`${o.name}-${e.value}`,className:`text-text-positive`,children:e.label})]},e.value))})})]}),(0,h.jsx)(P,{})]})},L=({label:e,description:n,placeholder:r,orientation:i=`responsive`,helperText:a,minDate:o,maxDate:l,required:u})=>{let d=Z(),p=(0,m.useMemo)(()=>u?d.state.value===null:!1,[u,d.state.value]),v=(0,m.useMemo)(()=>d.state.meta.isTouched&&!d.state.meta.isValid,[d.state.meta.isTouched,d.state.meta.isValid]);return(0,h.jsxs)(E,{className:`px-4`,children:[(0,h.jsxs)(D,{orientation:i,"data-invalid":v,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:d.name,"aria-required":p,children:e}),(0,h.jsx)(M,{children:n})]}),(0,h.jsxs)(k,{className:`flex flex-col space-y-1`,children:[(0,h.jsx)(`div`,{className:`flex w-full flex-col`,children:(0,h.jsxs)(s.t,{children:[(0,h.jsx)(s.a,{asChild:!0,children:(0,h.jsxs)(t.t,{variant:`outline`,color:`muted`,size:`lg`,className:(0,f.cn)(`flex items-center justify-between rounded font-normal outline-border`,`hover:bg-transparent`,`focus:outline-1 focus:outline-primary-strong focus:ring-4 focus:ring-primary-weak`,`data-[state=open]:text-text-positive-muted`,`data-[state=open]:outline-1`,`data-[state=open]:outline-primary-strong`,`data-[state=open]:ring-4`,`data-[state=open]:ring-primary-weak`,d.state.value===null&&`text-text-positive-muted`),children:[(0,h.jsx)(`p`,{children:d.state.value===null?r||`Select date`:(0,_.format)(d.state.value,`PPPP`)}),(0,h.jsx)(g.CalendarDaysIcon,{strokeWidth:1})]})}),(0,h.jsxs)(s.i,{align:`start`,side:`bottom`,className:`flex w-fit min-w-0 overflow-y-auto rounded p-0`,onBlur:d.handleBlur,children:[(0,h.jsxs)(`div`,{className:`flex h-full flex-col space-y-2 border-r border-r-border p-2 [&>button]:justify-start [&>button]:text-sm`,children:[(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.endOfToday)())},children:`Today`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.endOfTomorrow)())},children:`Tomorrow`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.endOfYesterday)())},children:`Yesterday`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.subDays)((0,_.endOfToday)(),3))},children:`Last 3 Days`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.subDays)((0,_.endOfToday)(),7))},children:`Last 7 Days`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.subDays)((0,_.endOfToday)(),30))},children:`Last 30 Days`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.startOfMonth)((0,_.endOfToday)()))},children:`This Month`}),(0,h.jsx)(t.t,{variant:`ghost`,color:`muted`,className:`w-32`,onClick:()=>{d.handleChange((0,_.lastDayOfMonth)((0,_.endOfToday)()))},children:`Last Month`})]}),(0,h.jsx)(`div`,{className:`flex flex-1 flex-col`,children:(0,h.jsx)(`div`,{className:`min-w-73 border-b border-b-border p-2`,children:(0,h.jsx)(c.t,{mode:`single`,selected:d.state.value??void 0,hidden:{before:o??new Date(1900,0,1),after:l??new Date(2100,11,31)},onSelect:e=>{e&&d.handleChange(e)}})})})]})]})}),(0,h.jsx)(N,{isShow:!!a,children:a})]})]}),(0,h.jsx)(P,{})]})},R=({label:e,description:t,placeholder:n,orientation:r=`responsive`,helperText:i,showErrorMessage:a=!0,maxLength:s})=>{let{form:c,name:l,state:u,handleBlur:d,handleChange:p}=Z(),_=(0,y.useStore)(c.store,({isSubmitting:e})=>e),v=(0,m.useMemo)(()=>u.meta.isTouched&&!u.meta.isValid,[u.meta.isTouched,u.meta.isValid]),b=(0,m.useCallback)(({target:{value:e}})=>{_||s&&e.length>s||p(e||null)},[_,s,p]),x=(0,m.useCallback)(()=>{_||p(null)},[_,p]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{"data-invalid":v,orientation:r,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:l,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(o.t,{id:l,name:l,value:u.value===null?``:u.value,"aria-invalid":v,autoComplete:`email`,placeholder:n,className:(0,f.cn)(`pl-9`,_&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:d,onChange:b}),(0,h.jsx)(`div`,{className:`absolute top-0 left-0 flex size-9 items-center justify-center text-muted`,children:(0,h.jsx)(g.AtSignIcon,{size:14})}),(0,h.jsx)(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-y-0 inset-e-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-strong`,onClick:x,children:(0,h.jsx)(g.XIcon,{size:14,"aria-hidden":`true`})}),(0,h.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&(0,h.jsx)(F,{errors:u.meta.errors})}),(0,h.jsx)(N,{isShow:!!i,children:i})]})]}),(0,h.jsx)(P,{})]})},ee=e=>e?/^-?\d*\.?\d*$/:/^\d*\.?\d*$/,te=e=>Number(e).toLocaleString(),ne=(e,t,n)=>{if(n===`none`)return e;let r=10**t,i=e*r;switch(n){case`up`:return Math.ceil(i)/r;case`down`:return Math.floor(i)/r;case`nearest`:return i%1<.1?Math.floor(i)/r:i%1>=.59?Math.ceil(i)/r:(Math.floor(i)+.5)/r;default:return e}},re=({disabled:e=!1,readOnly:t=!1,allowNegative:n=!1,numberAfterDecimalPoint:r=2,roundingRule:i=`none`,value:a=null,unitText:s,decimal:c,placeholder:l,precision:u,wrapperClassName:d,className:p,onChange:g,onValueChange:_,onFocus:v,onBlur:y,...b})=>{let x=(0,m.useRef)(null),S=(0,m.useRef)(null),[C,w]=(0,m.useState)(a?.toString()??null),T=(0,m.useMemo)(()=>c?.[1]??r,[c,r]),E=(0,m.useMemo)(()=>c&&c[0]-c[1],[c]),D=(0,m.useMemo)(()=>ee(n),[n]),O=(0,m.useCallback)(e=>{if(!T||e===`-`)return!0;let[t,n=``]=e.split(`.`),r=t.startsWith(`-`)?t.length-1:t.length;return n.length<=T&&r<=(E??1/0)},[T,E]),k=(0,m.useCallback)(e=>{if(e===`0`)return`0`;if(!Number(e))return null;let[t,n=``]=ne(parseFloat(e),Math.min(T-1,u||0),i).toString().split(`.`),r=te(t);return n?`${r}.${n}`:r},[T,u,i]),A=(0,m.useCallback)(e=>{let t=e===`0`,n=e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e);if(t){_?.(0),w(e);return}if(n){w(()=>(_?.(0),e));return}},[_]),j=(0,m.useCallback)(e=>{g?.(e);let{value:t}=e.target;if(t===``||t===void 0){_?.(null),w(null);return}A(t),!(!D.test(t)||!O(t))&&(_?.(parseFloat(t)||0),w(t))},[O,g,_,A,D]),M=(0,m.useCallback)(e=>{t||(v?.(e),w(e=>typeof e==`string`?e.replace(/,/g,``):null))},[t,v]),N=(0,m.useCallback)(e=>{t||(y?.(e),w(e=>e===null?null:e===`0`||e===`-`||/^-0+(\.0+)?$/.test(e)||/^-0*\.$/.test(e)?`0`:typeof e==`string`?k(e):null))},[t,k,y]);return(0,m.useEffect)(()=>{let e=document.activeElement===S.current;if(a==null||!D.test(a.toString())||!O(a.toString())){w(null);return}w(t=>e?t:k(a.toString()))},[k,a,O,D]),(0,m.useEffect)(()=>{if(!x.current||!S.current||!s)return;let e=x.current.offsetWidth;S.current.style.setProperty(`padding-right`,`${(e+10)/16}rem`)},[s]),(0,h.jsxs)(`div`,{className:(0,f.cn)(`relative`,d),children:[(0,h.jsx)(o.t,{...b,ref:S,value:C||(t?`0`:``),placeholder:l,disabled:e,readOnly:t,className:(0,f.cn)(`text-end font-number text-sm slashed-zero lining-nums tabular-nums`,t&&`bg-muted text-muted-foreground`,p),onChange:j,onFocus:M,onBlur:N}),s&&(0,h.jsx)(`span`,{ref:x,className:`-translate-y-1/2 pointer-events-none absolute top-1/2 right-2 text-muted-foreground text-sm`,children:s})]})},ie=({label:e,description:t,placeholder:n,helperText:r,orientation:i=`responsive`,showErrorMessage:a=!0,rounding:o,decimalPlaces:s,percision:c,unit:l,required:u,allowNegative:d})=>{let p=Z(),_=(0,y.useStore)(p.form.store,({isSubmitting:e})=>e),v=(0,m.useMemo)(()=>p.state.meta.errors,[p.state.meta.errors]),b=(0,m.useMemo)(()=>u?p.state.value===null:!1,[u,p.state.value]),x=(0,m.useCallback)(e=>{_||p.handleChange(e)},[_,p.handleChange]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:i,"data-invalid":p.state.meta.isTouched&&!p.state.meta.isValid,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:p.name,"aria-required":b,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsxs)(`div`,{className:`relative w-full`,children:[(0,h.jsx)(re,{id:p.name,value:p.state.value,"aria-invalid":p.state.meta.isTouched&&!p.state.meta.isValid,placeholder:n,roundingRule:o,numberAfterDecimalPoint:s,precision:c,unitText:l,allowNegative:d,className:(0,f.cn)(_&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:p.handleBlur,onValueChange:x}),_&&(0,h.jsx)(`div`,{className:`absolute inset-y-0 inset-s-2 top-2.5 text-muted-weak [&>svg]:size-3.5`,children:(0,h.jsx)(g.Loader2Icon,{className:`animate-spin text-primary-strong`})}),a&&!!v.length&&(0,h.jsx)(`div`,{className:`absolute inset-y-0 inset-s-2 top-2.75 text-danger-strong [&>svg]:size-3.5`,children:(0,h.jsx)(g.BanIcon,{})}),(0,h.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:a&&(0,h.jsx)(F,{errors:v})})]}),(0,h.jsx)(N,{isShow:!!r,children:r})]})]}),(0,h.jsx)(P,{})]})},z=({label:e,description:t,placeholder:n,orientation:r=`responsive`,helperText:i,showErrorMessage:a=!0})=>{let{form:s,name:c,state:l,handleBlur:u,handleChange:d}=Z(),f=(0,y.useStore)(s.store,({isSubmitting:e})=>e),[p,_]=(0,m.useState)(!1),v=(0,m.useMemo)(()=>l.meta.isTouched&&!l.meta.isValid,[l.meta.isTouched,l.meta.isValid]),b=(0,m.useCallback)(()=>_(e=>!e),[]),x=(0,m.useCallback)(({target:{value:e}})=>{f||d(e||null)},[f,d]);return(0,h.jsx)(E,{className:`gap-y-4 px-4`,children:(0,h.jsxs)(D,{"data-invalid":v,orientation:r,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:c,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(o.t,{id:c,type:p?`text`:`password`,placeholder:n,value:l.value??``,"aria-invalid":v,autoComplete:`new-password`,onBlur:u,onChange:x}),(0,h.jsx)(`button`,{className:`absolute inset-y-0 inset-e-0 flex size-9 items-center justify-center rounded-e-md text-muted outline-none transition-[color,box-shadow] focus:z-10 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,type:`button`,onClick:b,"aria-label":p?`Hide password`:`Show password`,"aria-pressed":p,"aria-controls":`password`,children:p?(0,h.jsx)(g.EyeOffIcon,{size:16,"aria-hidden":`true`}):(0,h.jsx)(g.EyeIcon,{size:16,"aria-hidden":`true`})}),(0,h.jsx)(`div`,{className:`mt-1 flex w-full items-start justify-start`,children:a&&(0,h.jsx)(F,{errors:l.meta.errors})}),(0,h.jsx)(N,{isShow:!!i,children:i})]})]})})},B=({label:e,description:t,orientation:n,options:r,helperText:i})=>{let a=Z(),o=(0,y.useStore)(a.form.store,({isSubmitting:e})=>e);return(0,h.jsxs)(E,{className:`px-4`,children:[(0,h.jsxs)(D,{orientation:n,className:`flex-col gap-2`,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{children:e}),(0,h.jsx)(M,{children:t}),(0,h.jsx)(N,{isShow:!!i,children:i})]}),(0,h.jsx)(k,{children:(0,h.jsx)(l.t,{defaultValue:a.state.value??void 0,className:`w-full`,onValueChange:a.handleChange,children:r.map(e=>(0,h.jsx)(A,{className:(0,f.cn)(`h-fit`,a.state.value===e.value&&`border-primary-weak! bg-primary-bg-subtle`,o&&`pointer-events-none bg-muted-muted opacity-60`,a.state.value===e.value&&o&&`border-border-strong!`),children:(0,h.jsxs)(D,{orientation:`horizontal`,className:`justify-between rounded p-2!`,children:[(0,h.jsxs)(O,{className:`gap-1!`,children:[(0,h.jsx)(j,{children:e.label}),(0,h.jsx)(M,{className:`text-xs`,children:e.description})]}),(0,h.jsx)(l.n,{value:e.value})]})},e.value))})})]}),(0,h.jsx)(P,{})]})},V=({label:e,description:t,placeholder:n,orientation:r=`responsive`,options:i,helperText:a,required:o=!1})=>{let s=Z(),c=(0,m.useMemo)(()=>s.state.meta.isTouched&&!s.state.meta.isValid,[s.state.meta.isTouched,s.state.meta.isValid]),l=(0,m.useMemo)(()=>o?s.state.value===null:!1,[o,s.state.value]),d=(0,m.useMemo)(()=>s.state.meta.errors,[s.state.meta.errors]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:r,"data-invalid":s.state.meta.isTouched&&!s.state.meta.isValid,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{htmlFor:s.name,"aria-required":l,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{className:`flex flex-col`,children:[(0,h.jsxs)(u.t,{defaultValue:s.state.value||void 0,onValueChange:s.handleChange,children:[(0,h.jsx)(u.s,{"aria-invalid":c?`true`:void 0,onBlur:s.handleBlur,children:(0,h.jsx)(u.c,{placeholder:n})}),(0,h.jsxs)(u.n,{children:[!!i.length&&i.map(e=>(0,h.jsx)(u.i,{value:e.value,children:e.label},e.value)),!i.length&&(0,h.jsxs)(`div`,{className:`flex items-center justify-center gap-x-2 rounded border border-border bg-muted-muted px-4 py-6.5 text-center text-sm text-text-positive-weak`,children:[(0,h.jsx)(g.PackagePlusIcon,{strokeWidth:1}),`No options available`]})]})]}),(0,h.jsx)(`div`,{className:`mt-1 flex w-full flex-col items-end justify-end`,children:(0,h.jsx)(F,{errors:d})}),(0,h.jsx)(N,{isShow:!!a,children:a})]})]}),(0,h.jsx)(P,{})]})};function H({className:e,...t}){return(0,h.jsx)(v.Switch.Root,{"data-slot":`switch`,className:(0,f.cn)(`peer`,`w-8 shrink-0 cursor-pointer items-center rounded-full shadow-xs transition-all`,`inline-flex h-5`,`focus-visible:border-primary-strong`,`focus-visible:ring-primary-weak`,`focus-visible:ring-4`,`disabled:cursor-not-allowed`,`disabled:opacity-50`,`-outline-offset-1 inset-shadow-2xs outline-1`,`data-[state=checked]:bg-primary`,`data-[state=checked]:outline-primary-strong`,`data-[state=unchecked]:bg-muted-weak`,`data-[state=unchecked]:outline-border`,`data-[state=unchecked]:[&_span]:size-4`,`data-[state=unchecked]:[&_span]:translate-x-0.5`,`data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5`,e),...t,children:(0,h.jsx)(v.Switch.Thumb,{"data-slot":`switch-thumb`,className:(0,f.cn)(`block size-4 bg-card shadow-xs`,`pointer-events-none rounded-full ring-0 transition-transform`,`data-[state=checked]:translate-x-[calc(100%-3px)]`,`data-[state=unchecked]:translate-x-0`)})})}const U=({label:e,description:t,helperText:n})=>{let r=Z();return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:`vertical`,className:`relative justify-between gap-y-1`,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(j,{className:`cursor-pointer`,children:(0,h.jsx)(`label`,{htmlFor:r.name,children:e})}),(0,h.jsx)(M,{children:t}),(0,h.jsx)(H,{id:r.name,checked:r.state.value??!1,className:`absolute top-1 right-1`,onBlur:r.handleBlur,onCheckedChange:r.handleChange})]}),(0,h.jsx)(N,{isShow:!!n,children:n})]}),(0,h.jsx)(P,{})]})},W=({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showClearButton:s=!1,showErrorMessage:c=!0,required:l=!1,maxLength:u})=>{let{form:d,name:p,state:_,handleBlur:v,handleChange:b}=Z(),x=(0,y.useStore)(d.store,({isSubmitting:e})=>e),S=(0,m.useMemo)(()=>s&&!x,[s,x]),C=(0,m.useMemo)(()=>_.value?_.value.length:0,[_.value]),w=(0,m.useMemo)(()=>{if(!i)return``;let e=`character${[0,1].includes(C)?``:`s`}`;return i&&u?`${C} / ${u} ${e}`:`${C} ${e}`},[C,i,u]),T=(0,m.useMemo)(()=>_.meta.isTouched&&!_.meta.isValid,[_.meta.isTouched,_.meta.isValid]),j=(0,m.useMemo)(()=>l?_.value===null:!1,[l,_.value]),I=(0,m.useCallback)(({target:{value:e}})=>{x||i&&u&&e.length>u||b(e||null)},[x,i,u,b]),L=(0,m.useCallback)(()=>{x||b(``)},[x,b]);return(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:a,"data-invalid":T,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{"aria-required":j,htmlFor:p,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(o.t,{id:p,name:p,value:_.value===null?``:_.value,"aria-invalid":T,autoComplete:`off`,placeholder:n,className:(0,f.cn)(`pr-6`,x&&`pointer-events-none bg-muted-muted opacity-60`),onBlur:v,onChange:I}),S&&!_.meta.errors.length&&(0,h.jsx)(`button`,{type:`button`,"aria-label":`Clear`,className:`absolute inset-y-0 inset-e-0 top-3 flex h-fit w-8 cursor-pointer items-center justify-center rounded-e-md text-text-positive-weak outline-none transition-[color,box-shadow] hover:text-text-positive focus:text-text-positive-intense [&>svg]:size-3.5`,onClick:L,children:(0,h.jsx)(g.XIcon,{"aria-hidden":`true`})}),x&&(0,h.jsx)(`div`,{className:`absolute inset-y-0 inset-e-2 top-2.5 text-muted-weak`,children:(0,h.jsx)(g.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),c&&!!_.meta.errors.length&&(0,h.jsx)(`div`,{className:`absolute inset-y-0 inset-e-2 top-2.5 text-danger-strong`,children:(0,h.jsx)(g.BanIcon,{size:14})}),(0,h.jsxs)(`div`,{className:`mt-1 flex w-full items-start gap-x-2`,children:[c&&(0,h.jsx)(F,{className:`flex-1`,errors:_.meta.errors}),!!i&&(0,h.jsx)(`p`,{className:`h-4 flex-0 text-nowrap text-end text-text-positive-weak text-xs tabular-nums`,children:w})]}),(0,h.jsx)(N,{isShow:!!r,children:r})]})]}),(0,h.jsx)(P,{})]})},G=({label:e,description:t,placeholder:n,helperText:r,counter:i=!1,orientation:a=`responsive`,showErrorMessage:o=!0,required:s=!1,maxLength:c})=>{let{form:l,state:u,name:p,handleBlur:_,handleChange:v}=Z(),b=(0,y.useStore)(l.store,({isSubmitting:e})=>e),x=(0,m.useMemo)(()=>u.value?u.value.length:0,[u.value]),S=(0,m.useMemo)(()=>{if(!i)return``;let e=`character${[0,1].includes(x)?``:`s`}`;return i&&c?`${x} / ${c} ${e}`:`${x} ${e}`},[x,i,c]),C=(0,m.useMemo)(()=>u.meta.isTouched&&!u.meta.isValid,[u.meta.isTouched,u.meta.isValid]),w=(0,m.useMemo)(()=>u.meta.errors,[u.meta.errors]),T=(0,m.useMemo)(()=>s?u.value===null:!1,[s,u.value]),j=(0,m.useCallback)(({target:{value:e}})=>{b||i&&c&&e.length>c||v(e||null)},[b,i,c,v]);return(0,h.jsxs)(E,{className:`px-4`,children:[(0,h.jsxs)(D,{orientation:a,"data-invalid":C,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{"aria-required":T,htmlFor:p,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[(0,h.jsx)(d.t,{id:p,name:p,value:u.value===null?``:u.value,"aria-invalid":C,autoComplete:`off`,placeholder:n,className:(0,f.cn)(b&&`pointer-events-none bg-muted-muted opacity-60`),onChange:j,onBlur:_}),b&&(0,h.jsx)(`div`,{className:`absolute inset-y-0 inset-e-2 top-2.5 text-muted-weak`,children:(0,h.jsx)(g.Loader2Icon,{size:14,className:`animate-spin text-primary-strong`})}),o&&!!w.length&&(0,h.jsx)(`div`,{className:`absolute inset-y-0 inset-e-2 top-2.5 text-danger-strong`,children:(0,h.jsx)(g.BanIcon,{size:14})}),(0,h.jsxs)(`div`,{className:`mt-1 flex w-full items-start gap-x-2`,children:[o&&(0,h.jsx)(F,{className:`flex-1`,errors:w}),!!i&&(0,h.jsx)(`p`,{className:`h-4 flex-0 text-nowrap text-end text-text-positive-weak text-xs tabular-nums`,children:S})]}),(0,h.jsx)(N,{isShow:!!r,children:r})]})]}),(0,h.jsx)(P,{})]})},K=({label:e,className:n})=>{let r=Q(),i=(0,m.useCallback)(async()=>{await r.handleSubmit({submitAction:`submit`}),r.state.isSubmitSuccessful&&r.reset()},[r]);return(0,h.jsx)(r.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:r,isSubmitting:a})=>(0,h.jsx)(t.t,{type:`button`,size:`md`,disabled:r,isLoading:a,className:(0,f.cn)(`min-h-8 min-w-32`,n),onClick:i,children:e??`Submit`})})},q=({type:e=`create`})=>{let n=Q();return(0,h.jsxs)(`div`,{className:`flex h-8 items-center justify-between`,children:[(0,h.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,h.jsx)(t.t,{color:`muted`,variant:`outline`,type:`button`,size:`md`,disabled:e,className:`h-full min-w-32`,onClick:()=>n.reset(),children:`Cancel`})}),e===`create`&&(0,h.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:e,isSubmitting:r})=>(0,h.jsxs)(t.t,{type:`submit`,size:`md`,disabled:e,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`create`}),n.state.isSubmitSuccessful&&n.reset()},children:[(0,h.jsx)(g.PlusIcon,{}),`Add New`]})}),e===`update`&&(0,h.jsx)(n.Subscribe,{selector:e=>({disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit||e.isDefaultValue,isSubmitting:e.isSubmitting}),children:({disabled:e,isSubmitting:r})=>(0,h.jsxs)(t.t,{type:`submit`,size:`md`,disabled:e,isLoading:r,className:`h-full min-w-32`,onClick:async()=>{await n.handleSubmit({submitAction:`update`}),n.state.isSubmitSuccessful&&n.reset()},children:[(0,h.jsx)(g.ArrowDownToLine,{}),`Update`]})})]})};function J({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,h.jsx)(v.Separator.Root,{"data-slot":`separator`,decorative:n,orientation:t,className:(0,f.cn)(`shrink-0 bg-border-weak`,`data-[orientation=horizontal]:h-px`,`data-[orientation=horizontal]:w-full`,`data-[orientation=vertical]:h-full`,`data-[orientation=vertical]:w-px`,e),...r})}const ae=({title:e,description:n,onDelete:r,children:i})=>(0,h.jsxs)(`section`,{"data-slot":`card-form`,className:`relative flex flex-col rounded-md bg-card pb-4 shadow-card ring-4 ring-border-weak`,children:[(0,h.jsxs)(`div`,{"data-slot":`card-form-header`,className:`flex flex-col space-y-1 p-4`,children:[(0,h.jsx)(`p`,{className:`font-semibold text-lg`,children:e}),!!n&&(0,h.jsx)(`p`,{className:`text-muted text-sm`,children:n})]}),(0,h.jsx)(J,{}),(0,h.jsx)(`div`,{"data-slot":`card-form-main`,className:`flex flex-col space-y-4 py-4`,children:i}),!!r&&(0,h.jsxs)(t.t,{color:`danger`,variant:`outline`,size:`sm`,className:`absolute top-2 right-2`,onClick:e=>{r?.(),e.preventDefault(),e.stopPropagation()},children:[(0,h.jsx)(g.Trash2Icon,{}),`Remove`]})]}),oe=({children:e})=>(0,h.jsx)(`div`,{"data-slot":`section-form`,className:`flex flex-col space-y-4`,children:e}),Y=({...e})=>(0,h.jsx)(`button`,{...e,type:`button`,className:`min-w-40 cursor-pointer rounded-sm border border-border bg-card px-4 py-2 font-semibold text-sm text-text-positive shadow-xs outline-none transition-all hover:opacity-90 focus:border-border focus:ring-3 focus:ring-border/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none`,children:`Hủy`}),X=({isSubmitting:e,submitText:t=`Submit`,...n})=>(0,h.jsx)(`button`,{...n,type:`button`,"data-loading":e?`true`:void 0,className:`relative min-h-9.5 min-w-40 cursor-pointer rounded-sm border border-primary-strong bg-primary px-4 py-2 font-semibold text-sm text-text-negative shadow-card outline-none transition-all hover:opacity-90 focus:border-transparent focus:ring-3 focus:ring-primary/80 focus:ring-offset-2 focus:drop-shadow-none disabled:pointer-events-none disabled:opacity-60 disabled:drop-shadow-none data-[loading=true]:pointer-events-none data-[loading=true]:opacity-80`,children:e?(0,h.jsx)(g.Loader2,{size:16,strokeWidth:3,className:`absolute top-1/2 left-1/2 z-10 -translate-x-1/2 -translate-y-1/2 animate-spin`}):t}),se=({title:e,submitText:t,open:r,onOpenChange:a,children:o})=>{let s=Q(),c=(0,m.useCallback)(e=>{e||s.reset(),a?.(e)},[s.reset,a]);return(0,h.jsx)(i.t,{open:r,onOpenChange:c,children:(0,h.jsxs)(i.c,{"data-slot":`dialog-portal`,children:[(0,h.jsx)(i.s,{}),(0,h.jsxs)(i.r,{className:`flex size-full max-h-dvh max-w-dvw flex-col gap-0 overflow-y-auto p-0 shadow-dialog sm:h-auto sm:max-h-[85dvh] sm:max-w-2xl sm:rounded-sm`,children:[(0,h.jsx)(`div`,{"data-slot":`dialog-header`,className:`flex flex-col items-center justify-center gap-2 px-4 py-6 text-center shadow-sm sm:text-left`,children:(0,h.jsx)(i.l,{"data-slot":`dialog-title`,children:e})}),(0,h.jsx)(n.t,{}),(0,h.jsx)(`div`,{"data-slot":`dialog-content`,className:`relative flex flex-col space-y-4 overflow-y-auto p-0 pt-6 max-sm:flex-1 sm:p-4`,children:o}),(0,h.jsx)(n.t,{}),(0,h.jsxs)(`div`,{"data-slot":`dialog-footer`,className:`flex flex-col-reverse items-center justify-between gap-2 px-6 py-4 shadow-sm sm:flex-row sm:justify-end max-sm:[&>button]:w-full`,children:[(0,h.jsx)(s.Subscribe,{selector:e=>({disabled:e.isSubmitting}),children:({disabled:e})=>(0,h.jsx)(Y,{disabled:e,onClick:()=>{s.reset(),c(!1)}})}),(0,h.jsx)(s.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:n})=>(0,h.jsx)(X,{isSubmitting:e,disabled:n,submitText:t,onClick:()=>s.handleSubmit()})})]})]})]})})},ce=({label:e,description:t,helperText:n,orientation:r=`responsive`,children:i})=>(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{orientation:r,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(A,{children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsxs)(k,{children:[i,(0,h.jsx)(N,{isShow:!!n,children:n})]})]}),(0,h.jsx)(P,{})]}),le=({title:e,open:t,contentClassName:n,onOpenChange:i,children:a})=>{let o=Q();return(0,h.jsx)(v.Dialog.Root,{"data-slot":`dialog`,open:t,onOpenChange:i,children:(0,h.jsxs)(v.Dialog.Portal,{"data-slot":`dialog-portal`,children:[(0,h.jsx)(v.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:(0,f.cn)(`fixed inset-0 z-40 bg-black/50 backdrop-blur-sm`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out`)}),(0,h.jsx)(v.Dialog.Content,{"data-slot":`dialog-content`,className:(0,f.cn)(`fixed top-4 right-4 z-50 h-[calc(100dvh-2rem)] min-w-sm max-w-xl rounded-md bg-background drop-shadow-lg`,`duration-300`,`data-[state=open]:animate-in`,`data-[state=open]:slide-in-from-right`,`data-[state=open]:fade-in`,`data-[state=closed]:animate-out`,`data-[state=closed]:slide-out-to-right`,`data-[state=closed]:fade-out`),children:(0,h.jsxs)(`section`,{className:`relative flex size-full flex-col`,children:[(0,h.jsx)(`header`,{className:`flex h-14 items-center border-border border-b px-4`,children:(0,h.jsx)(`h2`,{className:`font-semibold text-lg text-primary-strong`,children:e})}),(0,h.jsx)(`div`,{className:(0,f.cn)(`flex flex-1 flex-col overflow-y-auto py-4`,n),children:a}),(0,h.jsxs)(`div`,{className:`flex flex-col space-y-4 border-border border-t px-4 py-2`,children:[(0,h.jsx)(o.Subscribe,{selector:e=>({isSubmitting:e.isSubmitting,disabled:e.isPristine||!e.isValid||e.isValidating||e.isSubmitting||!e.canSubmit}),children:({isSubmitting:e,disabled:t})=>(0,h.jsx)(X,{isSubmitting:e,disabled:t,className:`w-full`,onClick:()=>o.handleSubmit()})}),(0,h.jsx)(o.Subscribe,{selector:e=>({disabled:e.isPristine||e.isSubmitting}),children:({disabled:e})=>(0,h.jsx)(Y,{disabled:e,className:`w-full`,onClick:()=>{o.reset(),i?.(!1)}})})]}),(0,h.jsx)(v.Dialog.Close,{asChild:!0,children:(0,h.jsx)(r.t,{className:`absolute top-2 right-2`})})]})})]})})},ue=({children:e})=>(0,h.jsx)(`header`,{"data-slot":`section-header`,className:`px-4 pt-2.5 pb-2 font-medium text-base text-primary-strong`,children:e}),de=({children:e})=>(0,h.jsx)(`main`,{"data-slot":`section-main`,className:`relative flex flex-col space-y-4 py-4`,children:e}),fe=({title:e,children:t})=>(0,h.jsxs)(`section`,{"data-slot":`section-form`,className:`flex flex-col rounded-md bg-background shadow-card ring-4 ring-border-weak`,children:[(0,h.jsx)(ue,{children:e}),(0,h.jsx)(J,{}),(0,h.jsx)(de,{children:t})]}),pe=({title:e,description:t,helperText:n})=>(0,h.jsxs)(E,{className:`gap-y-4 px-4`,children:[(0,h.jsxs)(D,{className:`gap-0`,children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(T,{className:`mb-1`,children:e}),(0,h.jsx)(M,{children:t})]}),(0,h.jsx)(N,{isShow:!!n,children:n})]}),(0,h.jsx)(P,{})]}),{fieldContext:me,formContext:he,useFieldContext:Z,useFormContext:Q}=(0,y.createFormHookContexts)(),{useAppForm:ge,withForm:$,withFieldGroup:_e}=(0,y.createFormHook)({fieldContext:me,formContext:he,fieldComponents:{TextField:W,TextareaField:G,NumberField:ie,EmailField:R,PasswordField:z,SelectField:V,DateField:L,SwitchField:U,RadioGroupField:B,CheckboxField:I,FieldGroup:E,Field:D,FieldContent:O,FieldLabel:A,FieldContentMain:k,FieldSeparator:P,FieldError:F},formComponents:{TanStackDialogForm:se,TanStackPopoverForm:le,TanStackContainerForm:oe,TanStackSectionForm:fe,TanStackCardForm:ae,TanStackFieldGroup:ce,TanStackTitleField:pe,TanStackActionsForm:q,TanStackActionSubmit:K}});exports.Field=D,exports.FieldContent=O,exports.FieldContentMain=k,exports.FieldError=F,exports.FieldGroup=E,exports.FieldLabel=A,exports.FieldSeparator=P,exports.useTanStackFieldContext=Z,exports.useTanStackForm=ge,exports.useTanStackFormContext=Q,exports.withTanStackFieldGroup=_e,exports.withTanStackForm=$;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|