autumn-js 0.0.66 → 0.0.72
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/components.json +21 -0
- package/dist/libraries/backend/{chunk-NDN25XDG.mjs → chunk-2JZFMBVR.mjs} +1 -1
- package/dist/libraries/backend/chunk-45WVZY23.mjs +41 -0
- package/dist/libraries/backend/{chunk-NDS3EHT3.mjs → chunk-GUZSIYGF.mjs} +1 -1
- package/dist/libraries/backend/{chunk-W63TY2DI.mjs → chunk-J7UA442M.mjs} +70 -59
- package/dist/libraries/backend/chunk-PBBWXVWW.mjs +28 -0
- package/dist/libraries/backend/{chunk-FRL4IWBU.mjs → chunk-T4YSUMNB.mjs} +9 -5
- package/dist/libraries/backend/chunk-UNZHJTEY.mjs +18 -0
- package/dist/libraries/backend/{chunk-QXJ7YDTB.mjs → chunk-Y2VYFWJD.mjs} +1 -1
- package/dist/libraries/backend/{chunk-C2YFOJYP.mjs → chunk-ZF4V3SVZ.mjs} +13 -8
- package/dist/libraries/backend/express.d.mts +3 -2
- package/dist/libraries/backend/express.d.ts +3 -2
- package/dist/libraries/backend/express.js +168 -78
- package/dist/libraries/backend/express.mjs +15 -6
- package/dist/libraries/backend/fastify.js +149 -78
- package/dist/libraries/backend/fastify.mjs +8 -6
- package/dist/libraries/backend/hono.js +149 -78
- package/dist/libraries/backend/hono.mjs +8 -6
- package/dist/libraries/backend/next.js +259 -176
- package/dist/libraries/backend/next.mjs +116 -104
- package/dist/libraries/backend/react-router.js +149 -78
- package/dist/libraries/backend/react-router.mjs +8 -6
- package/dist/libraries/backend/{referralTypes-p6A_PZbz.d.ts → referralTypes-C-jpvu6u.d.mts} +63 -31
- package/dist/libraries/backend/{referralTypes-BdY-EkkQ.d.mts → referralTypes-qdpA4XBw.d.ts} +63 -31
- package/dist/libraries/backend/remix_dep.js +149 -78
- package/dist/libraries/backend/remix_dep.mjs +8 -6
- package/dist/libraries/backend/{response-ByHPEnHs.d.mts → response-CV6KGWH5.d.mts} +1 -0
- package/dist/libraries/backend/{response-ByHPEnHs.d.ts → response-CV6KGWH5.d.ts} +1 -0
- package/dist/libraries/backend/routes/backendRouter.js +147 -75
- package/dist/libraries/backend/routes/backendRouter.mjs +8 -6
- package/dist/libraries/backend/routes/entityRoutes.js +123 -66
- package/dist/libraries/backend/routes/entityRoutes.mjs +5 -3
- package/dist/libraries/backend/routes/genRoutes.js +124 -71
- package/dist/libraries/backend/routes/genRoutes.mjs +4 -3
- package/dist/libraries/backend/routes/productRoutes.d.mts +5 -0
- package/dist/libraries/backend/routes/productRoutes.d.ts +5 -0
- package/dist/libraries/{react/hooks/useEntityProvider.js → backend/routes/productRoutes.js} +210 -96
- package/dist/libraries/backend/routes/productRoutes.mjs +11 -0
- package/dist/libraries/backend/routes/referralRoutes.js +124 -69
- package/dist/libraries/backend/routes/referralRoutes.mjs +4 -3
- package/dist/libraries/backend/supabase.js +149 -78
- package/dist/libraries/backend/supabase.mjs +8 -6
- package/dist/libraries/backend/tanstack.js +152 -79
- package/dist/libraries/backend/tanstack.mjs +11 -9
- package/dist/libraries/backend/utils/backendRes.d.mts +1 -1
- package/dist/libraries/backend/utils/backendRes.d.ts +1 -1
- package/dist/libraries/backend/utils/backendRes.js +114 -59
- package/dist/libraries/backend/utils/backendRes.mjs +3 -1
- package/dist/libraries/backend/utils/logBackendErrors.d.mts +5 -0
- package/dist/libraries/backend/utils/logBackendErrors.d.ts +5 -0
- package/dist/libraries/backend/utils/logBackendErrors.js +84 -0
- package/dist/libraries/backend/utils/logBackendErrors.mjs +14 -0
- package/dist/libraries/backend/utils/secretKeyCheck.d.mts +13 -0
- package/dist/libraries/backend/utils/secretKeyCheck.d.ts +13 -0
- package/dist/libraries/backend/utils/secretKeyCheck.js +42 -0
- package/dist/libraries/backend/utils/secretKeyCheck.mjs +7 -0
- package/dist/libraries/backend/utils/withAuth.d.mts +3 -3
- package/dist/libraries/backend/utils/withAuth.d.ts +3 -3
- package/dist/libraries/backend/utils/withAuth.js +123 -66
- package/dist/libraries/backend/utils/withAuth.mjs +4 -2
- package/dist/libraries/react/AutumnContext.d.mts +15 -18
- package/dist/libraries/react/AutumnContext.d.ts +15 -18
- package/dist/libraries/react/AutumnContext.js +189 -101
- package/dist/libraries/react/AutumnContext.mjs +6 -4
- package/dist/libraries/react/BaseAutumnProvider.d.mts +11 -7
- package/dist/libraries/react/BaseAutumnProvider.d.ts +11 -7
- package/dist/libraries/react/BaseAutumnProvider.js +594 -263
- package/dist/libraries/react/BaseAutumnProvider.mjs +12 -8
- package/dist/libraries/react/{ReactAutumnClient-BQtmw21U.d.mts → ReactAutumnClient-4e3t4WTF.d.mts} +40 -25
- package/dist/libraries/react/{ReactAutumnClient-DNcV0gAT.d.ts → ReactAutumnClient-B-lWmwRW.d.ts} +40 -25
- package/dist/libraries/react/ReactAutumnProvider.d.mts +4 -3
- package/dist/libraries/react/ReactAutumnProvider.d.ts +4 -3
- package/dist/libraries/react/ReactAutumnProvider.js +610 -266
- package/dist/libraries/react/ReactAutumnProvider.mjs +12 -9
- package/dist/libraries/react/{response-B1KyqUB9.d.ts → checkTypes-BDNI_s2B.d.ts} +42 -55
- package/dist/libraries/react/{response-B5dHU3I9.d.mts → checkTypes-CyKIOmeF.d.mts} +42 -55
- package/dist/libraries/react/chunk-2XYYCR4J.mjs +276 -0
- package/dist/libraries/react/chunk-4CGZZYLG.mjs +2487 -0
- package/dist/libraries/react/chunk-4PX3AQKX.mjs +53 -0
- package/dist/libraries/react/chunk-7PRD7RPD.mjs +20 -0
- package/dist/libraries/react/chunk-B7HGBQCO.mjs +48 -0
- package/dist/libraries/react/chunk-BCMBFJ7E.mjs +125 -0
- package/dist/libraries/react/{chunk-STABYMUY.mjs → chunk-CE5BBB5H.mjs} +58 -27
- package/dist/libraries/react/chunk-CIBQ4BJU.mjs +19 -0
- package/dist/libraries/react/{chunk-OCZFV7OX.mjs → chunk-EH2VPTFH.mjs} +104 -56
- package/dist/libraries/react/chunk-FHANCAHB.mjs +17 -0
- package/dist/libraries/react/chunk-GTF7A5TG.mjs +76 -0
- package/dist/libraries/react/chunk-JFXBUWKA.mjs +50 -0
- package/dist/libraries/react/chunk-MY2ODATB.mjs +51 -0
- package/dist/libraries/react/chunk-NEV76K4V.mjs +552 -0
- package/dist/libraries/react/chunk-O4HHXBGR.mjs +101 -0
- package/dist/libraries/react/chunk-Q7CK32YT.mjs +172 -0
- package/dist/libraries/react/chunk-QBBE72EF.mjs +57 -0
- package/dist/libraries/react/{chunk-PW6WFMLB.mjs → chunk-QMIIDFRP.mjs} +10 -37
- package/dist/libraries/react/chunk-TFGQQAVB.mjs +38 -0
- package/dist/{next/client/hooks/useEntityProvider.js → libraries/react/chunk-X3HJKZGO.mjs} +17 -11
- package/dist/libraries/react/chunk-YUV2Y2RW.mjs +12 -0
- package/dist/libraries/react/chunk-ZKHBOCMO.mjs +17 -0
- package/dist/libraries/react/{chunk-O4SNGQNB.mjs → chunk-ZQ6LDLK5.mjs} +67 -65
- package/dist/libraries/react/chunk-ZWO4QYXI.mjs +20 -0
- package/dist/libraries/react/chunk-ZXE5MFKL.mjs +45 -0
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +6 -5
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +6 -5
- package/dist/libraries/react/client/ReactAutumnClient.js +177 -76
- package/dist/libraries/react/client/ReactAutumnClient.mjs +5 -3
- package/dist/libraries/react/client/clientCompMethods.d.mts +6 -5
- package/dist/libraries/react/client/clientCompMethods.d.ts +6 -5
- package/dist/libraries/react/client/clientCusMethods.d.mts +6 -5
- package/dist/libraries/react/client/clientCusMethods.d.ts +6 -5
- package/dist/libraries/react/client/clientEntityMethods.d.mts +6 -5
- package/dist/libraries/react/client/clientEntityMethods.d.ts +6 -5
- package/dist/libraries/react/client/clientGenMethods.d.mts +7 -6
- package/dist/libraries/react/client/clientGenMethods.d.ts +7 -6
- package/dist/libraries/react/client/clientProdMethods.d.mts +15 -0
- package/dist/libraries/react/client/clientProdMethods.d.ts +15 -0
- package/dist/libraries/react/client/clientProdMethods.js +35 -0
- package/dist/libraries/react/client/clientProdMethods.mjs +8 -0
- package/dist/libraries/react/client/clientReferralMethods.d.mts +6 -5
- package/dist/libraries/react/client/clientReferralMethods.d.ts +6 -5
- package/dist/libraries/react/client/types/clientEntTypes.d.mts +1 -1
- package/dist/libraries/react/client/types/clientEntTypes.d.ts +1 -1
- package/dist/libraries/react/client/types/clientGenTypes.d.mts +2 -2
- package/dist/libraries/react/client/types/clientGenTypes.d.ts +2 -2
- package/dist/libraries/react/client/types/clientPricingTableTypes.d.mts +8 -10
- package/dist/libraries/react/client/types/clientPricingTableTypes.d.ts +8 -10
- package/dist/libraries/react/client/types/clientProdTypes.d.mts +5 -0
- package/dist/libraries/react/client/types/clientProdTypes.d.ts +5 -0
- package/dist/libraries/react/client/types/clientProdTypes.js +20 -0
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +52 -0
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +52 -0
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +4387 -0
- package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +50 -0
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +10 -0
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +10 -0
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.js +148 -0
- package/dist/libraries/react/components/attach-dialog/lib/attach-content.mjs +8 -0
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +12 -0
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +12 -0
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.js +2895 -0
- package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +13 -0
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +9 -0
- package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +9 -0
- package/dist/libraries/react/components/check-dialog/lib/check-content.js +74 -0
- package/dist/libraries/react/components/check-dialog/lib/check-content.mjs +8 -0
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.mts +7 -0
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.d.ts +7 -0
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.js +80 -0
- package/dist/libraries/react/components/pricing-table/lib/pricing-table-content.mjs +8 -0
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +51 -0
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +51 -0
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +4684 -0
- package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +53 -0
- package/dist/libraries/react/components/ui/button.d.mts +14 -0
- package/dist/libraries/react/components/ui/button.d.ts +14 -0
- package/dist/libraries/react/components/ui/button.js +2601 -0
- package/dist/libraries/react/components/ui/button.mjs +11 -0
- package/dist/libraries/react/components/ui/dialog.d.mts +18 -0
- package/dist/libraries/react/components/ui/dialog.d.ts +18 -0
- package/dist/libraries/react/components/ui/dialog.js +2774 -0
- package/dist/libraries/react/components/ui/dialog.mjs +27 -0
- package/dist/libraries/react/components/ui/switch.d.mts +7 -0
- package/dist/libraries/react/components/ui/switch.d.ts +7 -0
- package/dist/libraries/react/components/ui/switch.js +2550 -0
- package/dist/libraries/react/components/ui/switch.mjs +9 -0
- package/dist/libraries/react/{cusTypes-Cf-s9PYP.d.ts → cusTypes-DNx5bwlw.d.mts} +13 -5
- package/dist/libraries/react/{cusTypes-Cf-s9PYP.d.mts → cusTypes-DNx5bwlw.d.ts} +13 -5
- package/dist/libraries/react/{entTypes-CV-165S-.d.mts → entTypes-8gkfAi3g.d.mts} +1 -1
- package/dist/libraries/react/{entTypes-BbIk0Toa.d.ts → entTypes-C8jD10M8.d.ts} +1 -1
- package/dist/libraries/react/{error-CG2LXoa7.d.mts → error-DHbclCVh.d.mts} +1 -0
- package/dist/libraries/react/{error-CG2LXoa7.d.ts → error-DHbclCVh.d.ts} +1 -0
- package/dist/libraries/react/errorUtils/logAuthError.d.mts +8 -0
- package/dist/libraries/react/errorUtils/logAuthError.d.ts +8 -0
- package/dist/libraries/react/{hooks/usePricingTableProvider.js → errorUtils/logAuthError.js} +129 -97
- package/dist/libraries/react/errorUtils/logAuthError.mjs +21 -0
- package/dist/libraries/react/errorUtils/logFetchError.d.mts +8 -0
- package/dist/libraries/react/errorUtils/logFetchError.d.ts +8 -0
- package/dist/libraries/react/errorUtils/logFetchError.js +42 -0
- package/dist/libraries/react/errorUtils/logFetchError.mjs +8 -0
- package/dist/libraries/react/hooks/handleAllowed.d.mts +14 -0
- package/dist/libraries/react/hooks/handleAllowed.d.ts +14 -0
- package/dist/libraries/react/hooks/handleAllowed.js +73 -0
- package/dist/libraries/react/hooks/handleAllowed.mjs +8 -0
- package/dist/libraries/react/hooks/useAutumn.d.mts +12 -40
- package/dist/libraries/react/hooks/useAutumn.d.ts +12 -40
- package/dist/libraries/react/hooks/useAutumn.js +416 -166
- package/dist/libraries/react/hooks/useAutumn.mjs +9 -5
- package/dist/libraries/react/hooks/useAutumnBase.d.mts +23 -0
- package/dist/libraries/react/hooks/useAutumnBase.d.ts +23 -0
- package/dist/libraries/react/hooks/useAutumnBase.js +1063 -0
- package/dist/libraries/react/hooks/useAutumnBase.mjs +20 -0
- package/dist/libraries/react/hooks/useCustomer.d.mts +11 -17
- package/dist/libraries/react/hooks/useCustomer.d.ts +11 -17
- package/dist/libraries/react/hooks/useCustomer.js +594 -120
- package/dist/libraries/react/hooks/useCustomer.mjs +11 -5
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +38 -0
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +38 -0
- package/dist/libraries/react/hooks/useCustomerBase.js +1168 -0
- package/dist/libraries/react/hooks/useCustomerBase.mjs +22 -0
- package/dist/libraries/react/hooks/useEntity.d.mts +14 -6
- package/dist/libraries/react/hooks/useEntity.d.ts +14 -6
- package/dist/libraries/react/hooks/useEntity.js +272 -142
- package/dist/libraries/react/hooks/useEntity.mjs +9 -6
- package/dist/libraries/react/hooks/useEntityBase.d.mts +33 -0
- package/dist/libraries/react/hooks/useEntityBase.d.ts +33 -0
- package/dist/libraries/react/hooks/useEntityBase.js +134 -0
- package/dist/libraries/react/hooks/useEntityBase.mjs +9 -0
- package/dist/libraries/react/hooks/usePricingTable.d.mts +10 -13
- package/dist/libraries/react/hooks/usePricingTable.d.ts +10 -13
- package/dist/libraries/react/hooks/usePricingTable.js +339 -125
- package/dist/libraries/react/hooks/usePricingTable.mjs +8 -5
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +27 -0
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +27 -0
- package/dist/libraries/react/hooks/usePricingTableBase.js +926 -0
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +19 -0
- package/dist/libraries/react/hooks/useProductsBase.d.mts +3 -0
- package/dist/libraries/react/hooks/useProductsBase.d.ts +3 -0
- package/dist/libraries/react/hooks/useProductsBase.js +776 -0
- package/dist/libraries/react/hooks/useProductsBase.mjs +29 -0
- package/dist/libraries/react/index.d.ts +485 -16
- package/dist/libraries/react/index.js +4201 -493
- package/dist/libraries/react/index.mjs +4869 -30
- package/dist/libraries/react/lib/utils.d.mts +5 -0
- package/dist/libraries/react/lib/utils.d.ts +5 -0
- package/dist/libraries/react/lib/utils.js +2511 -0
- package/dist/libraries/react/lib/utils.mjs +8 -0
- package/dist/libraries/react/response-9K8DyGXf.d.ts +40 -0
- package/dist/libraries/react/response-ChCmaLBk.d.mts +40 -0
- package/dist/libraries/react/utils/compareParams.mjs +18 -3
- package/dist/next/AutumnProvider-BdIwgk_j.d.mts +136 -0
- package/dist/next/AutumnProvider-BdIwgk_j.d.ts +136 -0
- package/dist/next/AutumnProvider.d.mts +2 -0
- package/dist/next/AutumnProvider.d.ts +2 -0
- package/dist/next/AutumnProvider.js +2 -2
- package/dist/next/AutumnProvider.mjs +2 -2
- package/dist/next/client/AutumnClientProvider.d.mts +2 -0
- package/dist/next/client/AutumnClientProvider.d.ts +2 -0
- package/dist/next/client/AutumnClientProvider.mjs +2 -0
- package/dist/next/client/NextAutumnClient.d.mts +102 -0
- package/dist/next/client/NextAutumnClient.d.ts +102 -0
- package/dist/next/client/NextAutumnClient.js +95 -0
- package/dist/next/client/NextAutumnClient.mjs +95 -0
- package/dist/next/client/NextAutumnProvider.d.mts +10 -0
- package/dist/next/client/NextAutumnProvider.d.ts +10 -0
- package/dist/next/client/NextAutumnProvider.js +21 -0
- package/dist/next/client/NextAutumnProvider.mjs +21 -0
- package/dist/next/client/checkTypes-BHxu_xEV.d.ts +126 -0
- package/dist/next/client/checkTypes-CEaWu4S3.d.mts +126 -0
- package/dist/next/client/clientGenTypes-BRfigzSY.d.mts +98 -0
- package/dist/next/client/clientGenTypes-i3cKamAv.d.ts +98 -0
- package/dist/{sdk/referrals.d.ts → next/client/clientReferralTypes-C9JiOk2s.d.mts} +8 -9
- package/dist/{sdk/referrals.d.mts → next/client/clientReferralTypes-C9JiOk2s.d.ts} +8 -9
- package/dist/next/client/clientUtils.d.mts +2 -2
- package/dist/next/client/clientUtils.d.ts +2 -2
- package/dist/next/client/cusTypes-CV5q3GIA.d.mts +116 -0
- package/dist/next/client/cusTypes-CV5q3GIA.d.ts +116 -0
- package/dist/next/client/{entTypes-C9TNWMk6.d.mts → entTypes-C1-bumir.d.mts} +5 -2
- package/dist/next/client/{entTypes-BDqnMLZ4.d.ts → entTypes-CKc2qHBt.d.ts} +5 -2
- package/dist/next/client/handleAllowed-B8TBAzfI.d.mts +7 -0
- package/dist/next/client/handleAllowed-B8TBAzfI.d.ts +7 -0
- package/dist/next/client/hooks/useAutumn.d.mts +8 -33
- package/dist/next/client/hooks/useAutumn.d.ts +8 -33
- package/dist/next/client/hooks/useAutumn.js +3 -236
- package/dist/next/client/hooks/useAutumn.mjs +3 -236
- package/dist/next/client/hooks/useCustomer.d.mts +26 -20
- package/dist/next/client/hooks/useCustomer.d.ts +26 -20
- package/dist/next/client/hooks/useCustomer.js +6 -120
- package/dist/next/client/hooks/useCustomer.mjs +6 -120
- package/dist/next/client/hooks/useEntity.d.mts +13 -5
- package/dist/next/client/hooks/useEntity.d.ts +13 -5
- package/dist/next/client/hooks/useEntity.js +3 -2
- package/dist/next/client/hooks/useEntity.mjs +3 -2
- package/dist/next/client/hooks/usePricingTable.d.mts +26 -13
- package/dist/next/client/hooks/usePricingTable.d.ts +26 -13
- package/dist/next/client/hooks/usePricingTable.js +4 -50
- package/dist/next/client/hooks/usePricingTable.mjs +4 -50
- package/dist/next/client/types.d.mts +12 -3
- package/dist/next/client/types.d.ts +12 -3
- package/dist/next/enums.d.mts +5 -0
- package/dist/next/enums.d.ts +5 -0
- package/dist/next/index.d.mts +372 -233
- package/dist/next/index.d.ts +372 -233
- package/dist/next/index.js +13 -8
- package/dist/next/index.mjs +6 -4
- package/dist/next/server/auth/handleAuthProvider.d.mts +2 -2
- package/dist/next/server/auth/handleAuthProvider.d.ts +2 -2
- package/dist/next/server/auth/supabase-wrapper.d.mts +1 -3
- package/dist/next/server/auth/supabase-wrapper.d.ts +1 -3
- package/dist/next/server/auth/{withAuth.d.mts → withNextAuth.d.mts} +1 -1
- package/dist/next/server/auth/{withAuth.d.ts → withNextAuth.d.ts} +1 -1
- package/dist/next/server/clientEntTypes-BOVTwIKv.d.mts +14 -0
- package/dist/next/server/clientEntTypes-BOVTwIKv.d.ts +14 -0
- package/dist/next/server/componentActions.d.mts +1 -1
- package/dist/next/server/componentActions.d.ts +1 -1
- package/dist/next/server/componentActions.js +1 -1
- package/dist/next/server/componentActions.mjs +1 -1
- package/dist/next/server/cusActions.d.mts +243 -16
- package/dist/next/server/cusActions.d.ts +243 -16
- package/dist/next/server/cusActions.js +12 -22
- package/dist/next/server/cusActions.mjs +12 -22
- package/dist/next/server/{cusTypes-BD42O-7Z.d.mts → cusTypes-Cc8NWXXF.d.mts} +12 -8
- package/dist/next/server/{cusTypes-BD42O-7Z.d.ts → cusTypes-Cc8NWXXF.d.ts} +12 -8
- package/dist/next/server/genActions.d.mts +41 -26
- package/dist/next/server/genActions.d.ts +41 -26
- package/dist/next/server/genActions.js +14 -62
- package/dist/next/server/genActions.mjs +14 -62
- package/dist/next/server/{response-BCg7kiiN.d.mts → response-eH4S4sg0.d.mts} +1 -0
- package/dist/next/server/{response-BCg7kiiN.d.ts → response-eH4S4sg0.d.ts} +1 -0
- package/dist/next/server/utils.d.mts +1 -1
- package/dist/next/server/utils.d.ts +1 -1
- package/dist/sdk/index.d.mts +406 -27
- package/dist/sdk/index.d.ts +406 -27
- package/dist/sdk/index.js +107 -72
- package/dist/sdk/index.mjs +103 -72
- package/dist/styles/global.css +1147 -0
- package/dist/utils/chunk-V7R5DCYR.mjs +41 -0
- package/dist/utils/encryptUtils.js +104 -56
- package/dist/utils/encryptUtils.mjs +70 -56
- package/dist/utils/logger.d.mts +45 -0
- package/dist/utils/logger.d.ts +45 -0
- package/dist/utils/logger.js +75 -0
- package/dist/utils/logger.mjs +6 -0
- package/dist/utils/toSnakeCase.d.mts +3 -0
- package/dist/utils/toSnakeCase.d.ts +3 -0
- package/dist/utils/toSnakeCase.js +45 -0
- package/dist/utils/toSnakeCase.mjs +20 -0
- package/package.json +25 -7
- package/postcss.config.js +7 -0
- package/scripts/sync-registry.ts +292 -0
- package/tailwind.config.js +57 -0
- package/tsup.config.ts +87 -29
- package/tsup.dev.config.ts +196 -0
- package/dist/libraries/react/chunk-5LNSASJV.mjs +0 -33
- package/dist/libraries/react/chunk-CZA5WF64.mjs +0 -51
- package/dist/libraries/react/chunk-ILWLFCTA.mjs +0 -61
- package/dist/libraries/react/chunk-KHU4NOQJ.mjs +0 -30
- package/dist/libraries/react/chunk-PIIGEXKQ.mjs +0 -77
- package/dist/libraries/react/chunk-PYM4YPRD.mjs +0 -38
- package/dist/libraries/react/chunk-Q5SSQSDP.mjs +0 -48
- package/dist/libraries/react/chunk-URAFNMTH.mjs +0 -48
- package/dist/libraries/react/chunk-VN4AVW2V.mjs +0 -24
- package/dist/libraries/react/hooks/useCustomerProvider.d.mts +0 -28
- package/dist/libraries/react/hooks/useCustomerProvider.d.ts +0 -28
- package/dist/libraries/react/hooks/useCustomerProvider.js +0 -100
- package/dist/libraries/react/hooks/useCustomerProvider.mjs +0 -8
- package/dist/libraries/react/hooks/useEntityProvider.d.mts +0 -33
- package/dist/libraries/react/hooks/useEntityProvider.d.ts +0 -33
- package/dist/libraries/react/hooks/useEntityProvider.mjs +0 -9
- package/dist/libraries/react/hooks/usePricingTableProvider.d.mts +0 -19
- package/dist/libraries/react/hooks/usePricingTableProvider.d.ts +0 -19
- package/dist/libraries/react/hooks/usePricingTableProvider.mjs +0 -9
- package/dist/libraries/react/index.d.mts +0 -16
- package/dist/next/client/AutumnContext.d.mts +0 -9
- package/dist/next/client/AutumnContext.d.ts +0 -9
- package/dist/next/client/AutumnContext.js +0 -47
- package/dist/next/client/AutumnContext.mjs +0 -47
- package/dist/next/client/AutumnProvider.d.mts +0 -11
- package/dist/next/client/AutumnProvider.d.ts +0 -11
- package/dist/next/client/AutumnProvider.js +0 -117
- package/dist/next/client/AutumnProvider.mjs +0 -117
- package/dist/next/client/clientEntTypes-pqnB95m3.d.mts +0 -9
- package/dist/next/client/clientEntTypes-pqnB95m3.d.ts +0 -9
- package/dist/next/client/cusTypes-sh5_cN7N.d.mts +0 -86
- package/dist/next/client/cusTypes-sh5_cN7N.d.ts +0 -86
- package/dist/next/client/hooks/types.d.mts +0 -27
- package/dist/next/client/hooks/types.d.ts +0 -27
- package/dist/next/client/hooks/useEntityProvider.d.mts +0 -11
- package/dist/next/client/hooks/useEntityProvider.d.ts +0 -11
- package/dist/next/client/hooks/useEntityProvider.mjs +0 -52
- package/dist/next/server/clientEntTypes-B3DRcw3U.d.mts +0 -216
- package/dist/next/server/clientEntTypes-BRUTcNUD.d.ts +0 -216
- package/dist/sdk/check.d.mts +0 -47
- package/dist/sdk/check.d.ts +0 -47
- package/dist/sdk/cusTypes-BTV6ui4e.d.ts +0 -95
- package/dist/sdk/cusTypes-wBxbodEe.d.mts +0 -95
- package/dist/sdk/customers.d.mts +0 -2
- package/dist/sdk/customers.d.ts +0 -2
- package/dist/sdk/entTypes-BwLV9Jn4.d.ts +0 -35
- package/dist/sdk/entTypes-CJjjWn54.d.mts +0 -35
- package/dist/sdk/entities.d.mts +0 -3
- package/dist/sdk/entities.d.ts +0 -3
- package/dist/sdk/general.d.mts +0 -104
- package/dist/sdk/general.d.ts +0 -104
- package/dist/sdk/prodEnums-C1lccCWI.d.mts +0 -28
- package/dist/sdk/prodEnums-C1lccCWI.d.ts +0 -28
- package/dist/sdk/products.d.mts +0 -47
- package/dist/sdk/products.d.ts +0 -47
- /package/dist/{next/client/hooks/types.js → libraries/react/client/types/clientProdTypes.mjs} +0 -0
- /package/dist/next/client/{hooks/types.mjs → AutumnClientProvider.js} +0 -0
- /package/dist/next/server/auth/{withAuth.js → withNextAuth.js} +0 -0
- /package/dist/next/server/auth/{withAuth.mjs → withNextAuth.mjs} +0 -0
|
@@ -0,0 +1,4387 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
"use client";
|
|
5
|
+
var __create = Object.create;
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
|
|
33
|
+
// src/libraries/react/components/attach-dialog/attach-dialog-synced.tsx
|
|
34
|
+
var attach_dialog_synced_exports = {};
|
|
35
|
+
__export(attach_dialog_synced_exports, {
|
|
36
|
+
OptionsInput: () => OptionsInput,
|
|
37
|
+
PriceItem: () => PriceItem,
|
|
38
|
+
PricingDialogButton: () => PricingDialogButton,
|
|
39
|
+
QuantityInput: () => QuantityInput,
|
|
40
|
+
TotalPrice: () => TotalPrice,
|
|
41
|
+
default: () => AttachDialog
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(attach_dialog_synced_exports);
|
|
44
|
+
var import_react10 = require("react");
|
|
45
|
+
|
|
46
|
+
// ../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
47
|
+
function r(e) {
|
|
48
|
+
var t, f, n = "";
|
|
49
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
50
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
51
|
+
var o = e.length;
|
|
52
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
53
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
54
|
+
return n;
|
|
55
|
+
}
|
|
56
|
+
function clsx() {
|
|
57
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
58
|
+
return n;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ../node_modules/.pnpm/tailwind-merge@2.6.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
62
|
+
var CLASS_PART_SEPARATOR = "-";
|
|
63
|
+
var createClassGroupUtils = (config) => {
|
|
64
|
+
const classMap = createClassMap(config);
|
|
65
|
+
const {
|
|
66
|
+
conflictingClassGroups,
|
|
67
|
+
conflictingClassGroupModifiers
|
|
68
|
+
} = config;
|
|
69
|
+
const getClassGroupId = (className) => {
|
|
70
|
+
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
71
|
+
if (classParts[0] === "" && classParts.length !== 1) {
|
|
72
|
+
classParts.shift();
|
|
73
|
+
}
|
|
74
|
+
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
75
|
+
};
|
|
76
|
+
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
77
|
+
const conflicts = conflictingClassGroups[classGroupId] || [];
|
|
78
|
+
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
|
|
79
|
+
return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
|
|
80
|
+
}
|
|
81
|
+
return conflicts;
|
|
82
|
+
};
|
|
83
|
+
return {
|
|
84
|
+
getClassGroupId,
|
|
85
|
+
getConflictingClassGroupIds
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
var getGroupRecursive = (classParts, classPartObject) => {
|
|
89
|
+
if (classParts.length === 0) {
|
|
90
|
+
return classPartObject.classGroupId;
|
|
91
|
+
}
|
|
92
|
+
const currentClassPart = classParts[0];
|
|
93
|
+
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
94
|
+
const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0;
|
|
95
|
+
if (classGroupFromNextClassPart) {
|
|
96
|
+
return classGroupFromNextClassPart;
|
|
97
|
+
}
|
|
98
|
+
if (classPartObject.validators.length === 0) {
|
|
99
|
+
return void 0;
|
|
100
|
+
}
|
|
101
|
+
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
102
|
+
return classPartObject.validators.find(({
|
|
103
|
+
validator
|
|
104
|
+
}) => validator(classRest))?.classGroupId;
|
|
105
|
+
};
|
|
106
|
+
var arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
107
|
+
var getGroupIdForArbitraryProperty = (className) => {
|
|
108
|
+
if (arbitraryPropertyRegex.test(className)) {
|
|
109
|
+
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
110
|
+
const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(":"));
|
|
111
|
+
if (property) {
|
|
112
|
+
return "arbitrary.." + property;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
var createClassMap = (config) => {
|
|
117
|
+
const {
|
|
118
|
+
theme,
|
|
119
|
+
prefix
|
|
120
|
+
} = config;
|
|
121
|
+
const classMap = {
|
|
122
|
+
nextPart: /* @__PURE__ */ new Map(),
|
|
123
|
+
validators: []
|
|
124
|
+
};
|
|
125
|
+
const prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);
|
|
126
|
+
prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {
|
|
127
|
+
processClassesRecursively(classGroup, classMap, classGroupId, theme);
|
|
128
|
+
});
|
|
129
|
+
return classMap;
|
|
130
|
+
};
|
|
131
|
+
var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
132
|
+
classGroup.forEach((classDefinition) => {
|
|
133
|
+
if (typeof classDefinition === "string") {
|
|
134
|
+
const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
|
|
135
|
+
classPartObjectToEdit.classGroupId = classGroupId;
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (typeof classDefinition === "function") {
|
|
139
|
+
if (isThemeGetter(classDefinition)) {
|
|
140
|
+
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
classPartObject.validators.push({
|
|
144
|
+
validator: classDefinition,
|
|
145
|
+
classGroupId
|
|
146
|
+
});
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
Object.entries(classDefinition).forEach(([key, classGroup2]) => {
|
|
150
|
+
processClassesRecursively(classGroup2, getPart(classPartObject, key), classGroupId, theme);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
var getPart = (classPartObject, path) => {
|
|
155
|
+
let currentClassPartObject = classPartObject;
|
|
156
|
+
path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
|
|
157
|
+
if (!currentClassPartObject.nextPart.has(pathPart)) {
|
|
158
|
+
currentClassPartObject.nextPart.set(pathPart, {
|
|
159
|
+
nextPart: /* @__PURE__ */ new Map(),
|
|
160
|
+
validators: []
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
|
|
164
|
+
});
|
|
165
|
+
return currentClassPartObject;
|
|
166
|
+
};
|
|
167
|
+
var isThemeGetter = (func) => func.isThemeGetter;
|
|
168
|
+
var getPrefixedClassGroupEntries = (classGroupEntries, prefix) => {
|
|
169
|
+
if (!prefix) {
|
|
170
|
+
return classGroupEntries;
|
|
171
|
+
}
|
|
172
|
+
return classGroupEntries.map(([classGroupId, classGroup]) => {
|
|
173
|
+
const prefixedClassGroup = classGroup.map((classDefinition) => {
|
|
174
|
+
if (typeof classDefinition === "string") {
|
|
175
|
+
return prefix + classDefinition;
|
|
176
|
+
}
|
|
177
|
+
if (typeof classDefinition === "object") {
|
|
178
|
+
return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));
|
|
179
|
+
}
|
|
180
|
+
return classDefinition;
|
|
181
|
+
});
|
|
182
|
+
return [classGroupId, prefixedClassGroup];
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
var createLruCache = (maxCacheSize) => {
|
|
186
|
+
if (maxCacheSize < 1) {
|
|
187
|
+
return {
|
|
188
|
+
get: () => void 0,
|
|
189
|
+
set: () => {
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
let cacheSize = 0;
|
|
194
|
+
let cache = /* @__PURE__ */ new Map();
|
|
195
|
+
let previousCache = /* @__PURE__ */ new Map();
|
|
196
|
+
const update = (key, value) => {
|
|
197
|
+
cache.set(key, value);
|
|
198
|
+
cacheSize++;
|
|
199
|
+
if (cacheSize > maxCacheSize) {
|
|
200
|
+
cacheSize = 0;
|
|
201
|
+
previousCache = cache;
|
|
202
|
+
cache = /* @__PURE__ */ new Map();
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
return {
|
|
206
|
+
get(key) {
|
|
207
|
+
let value = cache.get(key);
|
|
208
|
+
if (value !== void 0) {
|
|
209
|
+
return value;
|
|
210
|
+
}
|
|
211
|
+
if ((value = previousCache.get(key)) !== void 0) {
|
|
212
|
+
update(key, value);
|
|
213
|
+
return value;
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
set(key, value) {
|
|
217
|
+
if (cache.has(key)) {
|
|
218
|
+
cache.set(key, value);
|
|
219
|
+
} else {
|
|
220
|
+
update(key, value);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
var IMPORTANT_MODIFIER = "!";
|
|
226
|
+
var createParseClassName = (config) => {
|
|
227
|
+
const {
|
|
228
|
+
separator,
|
|
229
|
+
experimentalParseClassName
|
|
230
|
+
} = config;
|
|
231
|
+
const isSeparatorSingleCharacter = separator.length === 1;
|
|
232
|
+
const firstSeparatorCharacter = separator[0];
|
|
233
|
+
const separatorLength = separator.length;
|
|
234
|
+
const parseClassName = (className) => {
|
|
235
|
+
const modifiers = [];
|
|
236
|
+
let bracketDepth = 0;
|
|
237
|
+
let modifierStart = 0;
|
|
238
|
+
let postfixModifierPosition;
|
|
239
|
+
for (let index = 0; index < className.length; index++) {
|
|
240
|
+
let currentCharacter = className[index];
|
|
241
|
+
if (bracketDepth === 0) {
|
|
242
|
+
if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {
|
|
243
|
+
modifiers.push(className.slice(modifierStart, index));
|
|
244
|
+
modifierStart = index + separatorLength;
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
if (currentCharacter === "/") {
|
|
248
|
+
postfixModifierPosition = index;
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (currentCharacter === "[") {
|
|
253
|
+
bracketDepth++;
|
|
254
|
+
} else if (currentCharacter === "]") {
|
|
255
|
+
bracketDepth--;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
|
|
259
|
+
const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);
|
|
260
|
+
const baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;
|
|
261
|
+
const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
|
|
262
|
+
return {
|
|
263
|
+
modifiers,
|
|
264
|
+
hasImportantModifier,
|
|
265
|
+
baseClassName,
|
|
266
|
+
maybePostfixModifierPosition
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
if (experimentalParseClassName) {
|
|
270
|
+
return (className) => experimentalParseClassName({
|
|
271
|
+
className,
|
|
272
|
+
parseClassName
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
return parseClassName;
|
|
276
|
+
};
|
|
277
|
+
var sortModifiers = (modifiers) => {
|
|
278
|
+
if (modifiers.length <= 1) {
|
|
279
|
+
return modifiers;
|
|
280
|
+
}
|
|
281
|
+
const sortedModifiers = [];
|
|
282
|
+
let unsortedModifiers = [];
|
|
283
|
+
modifiers.forEach((modifier) => {
|
|
284
|
+
const isArbitraryVariant = modifier[0] === "[";
|
|
285
|
+
if (isArbitraryVariant) {
|
|
286
|
+
sortedModifiers.push(...unsortedModifiers.sort(), modifier);
|
|
287
|
+
unsortedModifiers = [];
|
|
288
|
+
} else {
|
|
289
|
+
unsortedModifiers.push(modifier);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
sortedModifiers.push(...unsortedModifiers.sort());
|
|
293
|
+
return sortedModifiers;
|
|
294
|
+
};
|
|
295
|
+
var createConfigUtils = (config) => ({
|
|
296
|
+
cache: createLruCache(config.cacheSize),
|
|
297
|
+
parseClassName: createParseClassName(config),
|
|
298
|
+
...createClassGroupUtils(config)
|
|
299
|
+
});
|
|
300
|
+
var SPLIT_CLASSES_REGEX = /\s+/;
|
|
301
|
+
var mergeClassList = (classList, configUtils) => {
|
|
302
|
+
const {
|
|
303
|
+
parseClassName,
|
|
304
|
+
getClassGroupId,
|
|
305
|
+
getConflictingClassGroupIds
|
|
306
|
+
} = configUtils;
|
|
307
|
+
const classGroupsInConflict = [];
|
|
308
|
+
const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
|
|
309
|
+
let result = "";
|
|
310
|
+
for (let index = classNames.length - 1; index >= 0; index -= 1) {
|
|
311
|
+
const originalClassName = classNames[index];
|
|
312
|
+
const {
|
|
313
|
+
modifiers,
|
|
314
|
+
hasImportantModifier,
|
|
315
|
+
baseClassName,
|
|
316
|
+
maybePostfixModifierPosition
|
|
317
|
+
} = parseClassName(originalClassName);
|
|
318
|
+
let hasPostfixModifier = Boolean(maybePostfixModifierPosition);
|
|
319
|
+
let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
|
|
320
|
+
if (!classGroupId) {
|
|
321
|
+
if (!hasPostfixModifier) {
|
|
322
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
classGroupId = getClassGroupId(baseClassName);
|
|
326
|
+
if (!classGroupId) {
|
|
327
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
hasPostfixModifier = false;
|
|
331
|
+
}
|
|
332
|
+
const variantModifier = sortModifiers(modifiers).join(":");
|
|
333
|
+
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
334
|
+
const classId = modifierId + classGroupId;
|
|
335
|
+
if (classGroupsInConflict.includes(classId)) {
|
|
336
|
+
continue;
|
|
337
|
+
}
|
|
338
|
+
classGroupsInConflict.push(classId);
|
|
339
|
+
const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
|
|
340
|
+
for (let i = 0; i < conflictGroups.length; ++i) {
|
|
341
|
+
const group = conflictGroups[i];
|
|
342
|
+
classGroupsInConflict.push(modifierId + group);
|
|
343
|
+
}
|
|
344
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
345
|
+
}
|
|
346
|
+
return result;
|
|
347
|
+
};
|
|
348
|
+
function twJoin() {
|
|
349
|
+
let index = 0;
|
|
350
|
+
let argument;
|
|
351
|
+
let resolvedValue;
|
|
352
|
+
let string = "";
|
|
353
|
+
while (index < arguments.length) {
|
|
354
|
+
if (argument = arguments[index++]) {
|
|
355
|
+
if (resolvedValue = toValue(argument)) {
|
|
356
|
+
string && (string += " ");
|
|
357
|
+
string += resolvedValue;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return string;
|
|
362
|
+
}
|
|
363
|
+
var toValue = (mix) => {
|
|
364
|
+
if (typeof mix === "string") {
|
|
365
|
+
return mix;
|
|
366
|
+
}
|
|
367
|
+
let resolvedValue;
|
|
368
|
+
let string = "";
|
|
369
|
+
for (let k = 0; k < mix.length; k++) {
|
|
370
|
+
if (mix[k]) {
|
|
371
|
+
if (resolvedValue = toValue(mix[k])) {
|
|
372
|
+
string && (string += " ");
|
|
373
|
+
string += resolvedValue;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return string;
|
|
378
|
+
};
|
|
379
|
+
function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
380
|
+
let configUtils;
|
|
381
|
+
let cacheGet;
|
|
382
|
+
let cacheSet;
|
|
383
|
+
let functionToCall = initTailwindMerge;
|
|
384
|
+
function initTailwindMerge(classList) {
|
|
385
|
+
const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
|
|
386
|
+
configUtils = createConfigUtils(config);
|
|
387
|
+
cacheGet = configUtils.cache.get;
|
|
388
|
+
cacheSet = configUtils.cache.set;
|
|
389
|
+
functionToCall = tailwindMerge;
|
|
390
|
+
return tailwindMerge(classList);
|
|
391
|
+
}
|
|
392
|
+
function tailwindMerge(classList) {
|
|
393
|
+
const cachedResult = cacheGet(classList);
|
|
394
|
+
if (cachedResult) {
|
|
395
|
+
return cachedResult;
|
|
396
|
+
}
|
|
397
|
+
const result = mergeClassList(classList, configUtils);
|
|
398
|
+
cacheSet(classList, result);
|
|
399
|
+
return result;
|
|
400
|
+
}
|
|
401
|
+
return function callTailwindMerge() {
|
|
402
|
+
return functionToCall(twJoin.apply(null, arguments));
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
var fromTheme = (key) => {
|
|
406
|
+
const themeGetter = (theme) => theme[key] || [];
|
|
407
|
+
themeGetter.isThemeGetter = true;
|
|
408
|
+
return themeGetter;
|
|
409
|
+
};
|
|
410
|
+
var arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
|
|
411
|
+
var fractionRegex = /^\d+\/\d+$/;
|
|
412
|
+
var stringLengths = /* @__PURE__ */ new Set(["px", "full", "screen"]);
|
|
413
|
+
var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
414
|
+
var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
|
|
415
|
+
var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
|
|
416
|
+
var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
417
|
+
var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
418
|
+
var isLength = (value) => isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);
|
|
419
|
+
var isArbitraryLength = (value) => getIsArbitraryValue(value, "length", isLengthOnly);
|
|
420
|
+
var isNumber = (value) => Boolean(value) && !Number.isNaN(Number(value));
|
|
421
|
+
var isArbitraryNumber = (value) => getIsArbitraryValue(value, "number", isNumber);
|
|
422
|
+
var isInteger = (value) => Boolean(value) && Number.isInteger(Number(value));
|
|
423
|
+
var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
|
|
424
|
+
var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
|
|
425
|
+
var isTshirtSize = (value) => tshirtUnitRegex.test(value);
|
|
426
|
+
var sizeLabels = /* @__PURE__ */ new Set(["length", "size", "percentage"]);
|
|
427
|
+
var isArbitrarySize = (value) => getIsArbitraryValue(value, sizeLabels, isNever);
|
|
428
|
+
var isArbitraryPosition = (value) => getIsArbitraryValue(value, "position", isNever);
|
|
429
|
+
var imageLabels = /* @__PURE__ */ new Set(["image", "url"]);
|
|
430
|
+
var isArbitraryImage = (value) => getIsArbitraryValue(value, imageLabels, isImage);
|
|
431
|
+
var isArbitraryShadow = (value) => getIsArbitraryValue(value, "", isShadow);
|
|
432
|
+
var isAny = () => true;
|
|
433
|
+
var getIsArbitraryValue = (value, label, testValue) => {
|
|
434
|
+
const result = arbitraryValueRegex.exec(value);
|
|
435
|
+
if (result) {
|
|
436
|
+
if (result[1]) {
|
|
437
|
+
return typeof label === "string" ? result[1] === label : label.has(result[1]);
|
|
438
|
+
}
|
|
439
|
+
return testValue(result[2]);
|
|
440
|
+
}
|
|
441
|
+
return false;
|
|
442
|
+
};
|
|
443
|
+
var isLengthOnly = (value) => (
|
|
444
|
+
// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
|
|
445
|
+
// For example, `hsl(0 0% 0%)` would be classified as a length without this check.
|
|
446
|
+
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
447
|
+
lengthUnitRegex.test(value) && !colorFunctionRegex.test(value)
|
|
448
|
+
);
|
|
449
|
+
var isNever = () => false;
|
|
450
|
+
var isShadow = (value) => shadowRegex.test(value);
|
|
451
|
+
var isImage = (value) => imageRegex.test(value);
|
|
452
|
+
var getDefaultConfig = () => {
|
|
453
|
+
const colors = fromTheme("colors");
|
|
454
|
+
const spacing = fromTheme("spacing");
|
|
455
|
+
const blur = fromTheme("blur");
|
|
456
|
+
const brightness = fromTheme("brightness");
|
|
457
|
+
const borderColor = fromTheme("borderColor");
|
|
458
|
+
const borderRadius = fromTheme("borderRadius");
|
|
459
|
+
const borderSpacing = fromTheme("borderSpacing");
|
|
460
|
+
const borderWidth = fromTheme("borderWidth");
|
|
461
|
+
const contrast = fromTheme("contrast");
|
|
462
|
+
const grayscale = fromTheme("grayscale");
|
|
463
|
+
const hueRotate = fromTheme("hueRotate");
|
|
464
|
+
const invert = fromTheme("invert");
|
|
465
|
+
const gap = fromTheme("gap");
|
|
466
|
+
const gradientColorStops = fromTheme("gradientColorStops");
|
|
467
|
+
const gradientColorStopPositions = fromTheme("gradientColorStopPositions");
|
|
468
|
+
const inset = fromTheme("inset");
|
|
469
|
+
const margin = fromTheme("margin");
|
|
470
|
+
const opacity = fromTheme("opacity");
|
|
471
|
+
const padding = fromTheme("padding");
|
|
472
|
+
const saturate = fromTheme("saturate");
|
|
473
|
+
const scale = fromTheme("scale");
|
|
474
|
+
const sepia = fromTheme("sepia");
|
|
475
|
+
const skew = fromTheme("skew");
|
|
476
|
+
const space = fromTheme("space");
|
|
477
|
+
const translate = fromTheme("translate");
|
|
478
|
+
const getOverscroll = () => ["auto", "contain", "none"];
|
|
479
|
+
const getOverflow = () => ["auto", "hidden", "clip", "visible", "scroll"];
|
|
480
|
+
const getSpacingWithAutoAndArbitrary = () => ["auto", isArbitraryValue, spacing];
|
|
481
|
+
const getSpacingWithArbitrary = () => [isArbitraryValue, spacing];
|
|
482
|
+
const getLengthWithEmptyAndArbitrary = () => ["", isLength, isArbitraryLength];
|
|
483
|
+
const getNumberWithAutoAndArbitrary = () => ["auto", isNumber, isArbitraryValue];
|
|
484
|
+
const getPositions = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"];
|
|
485
|
+
const getLineStyles = () => ["solid", "dashed", "dotted", "double", "none"];
|
|
486
|
+
const getBlendModes = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
|
|
487
|
+
const getAlign = () => ["start", "end", "center", "between", "around", "evenly", "stretch"];
|
|
488
|
+
const getZeroAndEmpty = () => ["", "0", isArbitraryValue];
|
|
489
|
+
const getBreaks = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"];
|
|
490
|
+
const getNumberAndArbitrary = () => [isNumber, isArbitraryValue];
|
|
491
|
+
return {
|
|
492
|
+
cacheSize: 500,
|
|
493
|
+
separator: ":",
|
|
494
|
+
theme: {
|
|
495
|
+
colors: [isAny],
|
|
496
|
+
spacing: [isLength, isArbitraryLength],
|
|
497
|
+
blur: ["none", "", isTshirtSize, isArbitraryValue],
|
|
498
|
+
brightness: getNumberAndArbitrary(),
|
|
499
|
+
borderColor: [colors],
|
|
500
|
+
borderRadius: ["none", "", "full", isTshirtSize, isArbitraryValue],
|
|
501
|
+
borderSpacing: getSpacingWithArbitrary(),
|
|
502
|
+
borderWidth: getLengthWithEmptyAndArbitrary(),
|
|
503
|
+
contrast: getNumberAndArbitrary(),
|
|
504
|
+
grayscale: getZeroAndEmpty(),
|
|
505
|
+
hueRotate: getNumberAndArbitrary(),
|
|
506
|
+
invert: getZeroAndEmpty(),
|
|
507
|
+
gap: getSpacingWithArbitrary(),
|
|
508
|
+
gradientColorStops: [colors],
|
|
509
|
+
gradientColorStopPositions: [isPercent, isArbitraryLength],
|
|
510
|
+
inset: getSpacingWithAutoAndArbitrary(),
|
|
511
|
+
margin: getSpacingWithAutoAndArbitrary(),
|
|
512
|
+
opacity: getNumberAndArbitrary(),
|
|
513
|
+
padding: getSpacingWithArbitrary(),
|
|
514
|
+
saturate: getNumberAndArbitrary(),
|
|
515
|
+
scale: getNumberAndArbitrary(),
|
|
516
|
+
sepia: getZeroAndEmpty(),
|
|
517
|
+
skew: getNumberAndArbitrary(),
|
|
518
|
+
space: getSpacingWithArbitrary(),
|
|
519
|
+
translate: getSpacingWithArbitrary()
|
|
520
|
+
},
|
|
521
|
+
classGroups: {
|
|
522
|
+
// Layout
|
|
523
|
+
/**
|
|
524
|
+
* Aspect Ratio
|
|
525
|
+
* @see https://tailwindcss.com/docs/aspect-ratio
|
|
526
|
+
*/
|
|
527
|
+
aspect: [{
|
|
528
|
+
aspect: ["auto", "square", "video", isArbitraryValue]
|
|
529
|
+
}],
|
|
530
|
+
/**
|
|
531
|
+
* Container
|
|
532
|
+
* @see https://tailwindcss.com/docs/container
|
|
533
|
+
*/
|
|
534
|
+
container: ["container"],
|
|
535
|
+
/**
|
|
536
|
+
* Columns
|
|
537
|
+
* @see https://tailwindcss.com/docs/columns
|
|
538
|
+
*/
|
|
539
|
+
columns: [{
|
|
540
|
+
columns: [isTshirtSize]
|
|
541
|
+
}],
|
|
542
|
+
/**
|
|
543
|
+
* Break After
|
|
544
|
+
* @see https://tailwindcss.com/docs/break-after
|
|
545
|
+
*/
|
|
546
|
+
"break-after": [{
|
|
547
|
+
"break-after": getBreaks()
|
|
548
|
+
}],
|
|
549
|
+
/**
|
|
550
|
+
* Break Before
|
|
551
|
+
* @see https://tailwindcss.com/docs/break-before
|
|
552
|
+
*/
|
|
553
|
+
"break-before": [{
|
|
554
|
+
"break-before": getBreaks()
|
|
555
|
+
}],
|
|
556
|
+
/**
|
|
557
|
+
* Break Inside
|
|
558
|
+
* @see https://tailwindcss.com/docs/break-inside
|
|
559
|
+
*/
|
|
560
|
+
"break-inside": [{
|
|
561
|
+
"break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
|
|
562
|
+
}],
|
|
563
|
+
/**
|
|
564
|
+
* Box Decoration Break
|
|
565
|
+
* @see https://tailwindcss.com/docs/box-decoration-break
|
|
566
|
+
*/
|
|
567
|
+
"box-decoration": [{
|
|
568
|
+
"box-decoration": ["slice", "clone"]
|
|
569
|
+
}],
|
|
570
|
+
/**
|
|
571
|
+
* Box Sizing
|
|
572
|
+
* @see https://tailwindcss.com/docs/box-sizing
|
|
573
|
+
*/
|
|
574
|
+
box: [{
|
|
575
|
+
box: ["border", "content"]
|
|
576
|
+
}],
|
|
577
|
+
/**
|
|
578
|
+
* Display
|
|
579
|
+
* @see https://tailwindcss.com/docs/display
|
|
580
|
+
*/
|
|
581
|
+
display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"],
|
|
582
|
+
/**
|
|
583
|
+
* Floats
|
|
584
|
+
* @see https://tailwindcss.com/docs/float
|
|
585
|
+
*/
|
|
586
|
+
float: [{
|
|
587
|
+
float: ["right", "left", "none", "start", "end"]
|
|
588
|
+
}],
|
|
589
|
+
/**
|
|
590
|
+
* Clear
|
|
591
|
+
* @see https://tailwindcss.com/docs/clear
|
|
592
|
+
*/
|
|
593
|
+
clear: [{
|
|
594
|
+
clear: ["left", "right", "both", "none", "start", "end"]
|
|
595
|
+
}],
|
|
596
|
+
/**
|
|
597
|
+
* Isolation
|
|
598
|
+
* @see https://tailwindcss.com/docs/isolation
|
|
599
|
+
*/
|
|
600
|
+
isolation: ["isolate", "isolation-auto"],
|
|
601
|
+
/**
|
|
602
|
+
* Object Fit
|
|
603
|
+
* @see https://tailwindcss.com/docs/object-fit
|
|
604
|
+
*/
|
|
605
|
+
"object-fit": [{
|
|
606
|
+
object: ["contain", "cover", "fill", "none", "scale-down"]
|
|
607
|
+
}],
|
|
608
|
+
/**
|
|
609
|
+
* Object Position
|
|
610
|
+
* @see https://tailwindcss.com/docs/object-position
|
|
611
|
+
*/
|
|
612
|
+
"object-position": [{
|
|
613
|
+
object: [...getPositions(), isArbitraryValue]
|
|
614
|
+
}],
|
|
615
|
+
/**
|
|
616
|
+
* Overflow
|
|
617
|
+
* @see https://tailwindcss.com/docs/overflow
|
|
618
|
+
*/
|
|
619
|
+
overflow: [{
|
|
620
|
+
overflow: getOverflow()
|
|
621
|
+
}],
|
|
622
|
+
/**
|
|
623
|
+
* Overflow X
|
|
624
|
+
* @see https://tailwindcss.com/docs/overflow
|
|
625
|
+
*/
|
|
626
|
+
"overflow-x": [{
|
|
627
|
+
"overflow-x": getOverflow()
|
|
628
|
+
}],
|
|
629
|
+
/**
|
|
630
|
+
* Overflow Y
|
|
631
|
+
* @see https://tailwindcss.com/docs/overflow
|
|
632
|
+
*/
|
|
633
|
+
"overflow-y": [{
|
|
634
|
+
"overflow-y": getOverflow()
|
|
635
|
+
}],
|
|
636
|
+
/**
|
|
637
|
+
* Overscroll Behavior
|
|
638
|
+
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
639
|
+
*/
|
|
640
|
+
overscroll: [{
|
|
641
|
+
overscroll: getOverscroll()
|
|
642
|
+
}],
|
|
643
|
+
/**
|
|
644
|
+
* Overscroll Behavior X
|
|
645
|
+
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
646
|
+
*/
|
|
647
|
+
"overscroll-x": [{
|
|
648
|
+
"overscroll-x": getOverscroll()
|
|
649
|
+
}],
|
|
650
|
+
/**
|
|
651
|
+
* Overscroll Behavior Y
|
|
652
|
+
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
653
|
+
*/
|
|
654
|
+
"overscroll-y": [{
|
|
655
|
+
"overscroll-y": getOverscroll()
|
|
656
|
+
}],
|
|
657
|
+
/**
|
|
658
|
+
* Position
|
|
659
|
+
* @see https://tailwindcss.com/docs/position
|
|
660
|
+
*/
|
|
661
|
+
position: ["static", "fixed", "absolute", "relative", "sticky"],
|
|
662
|
+
/**
|
|
663
|
+
* Top / Right / Bottom / Left
|
|
664
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
665
|
+
*/
|
|
666
|
+
inset: [{
|
|
667
|
+
inset: [inset]
|
|
668
|
+
}],
|
|
669
|
+
/**
|
|
670
|
+
* Right / Left
|
|
671
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
672
|
+
*/
|
|
673
|
+
"inset-x": [{
|
|
674
|
+
"inset-x": [inset]
|
|
675
|
+
}],
|
|
676
|
+
/**
|
|
677
|
+
* Top / Bottom
|
|
678
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
679
|
+
*/
|
|
680
|
+
"inset-y": [{
|
|
681
|
+
"inset-y": [inset]
|
|
682
|
+
}],
|
|
683
|
+
/**
|
|
684
|
+
* Start
|
|
685
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
686
|
+
*/
|
|
687
|
+
start: [{
|
|
688
|
+
start: [inset]
|
|
689
|
+
}],
|
|
690
|
+
/**
|
|
691
|
+
* End
|
|
692
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
693
|
+
*/
|
|
694
|
+
end: [{
|
|
695
|
+
end: [inset]
|
|
696
|
+
}],
|
|
697
|
+
/**
|
|
698
|
+
* Top
|
|
699
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
700
|
+
*/
|
|
701
|
+
top: [{
|
|
702
|
+
top: [inset]
|
|
703
|
+
}],
|
|
704
|
+
/**
|
|
705
|
+
* Right
|
|
706
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
707
|
+
*/
|
|
708
|
+
right: [{
|
|
709
|
+
right: [inset]
|
|
710
|
+
}],
|
|
711
|
+
/**
|
|
712
|
+
* Bottom
|
|
713
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
714
|
+
*/
|
|
715
|
+
bottom: [{
|
|
716
|
+
bottom: [inset]
|
|
717
|
+
}],
|
|
718
|
+
/**
|
|
719
|
+
* Left
|
|
720
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
721
|
+
*/
|
|
722
|
+
left: [{
|
|
723
|
+
left: [inset]
|
|
724
|
+
}],
|
|
725
|
+
/**
|
|
726
|
+
* Visibility
|
|
727
|
+
* @see https://tailwindcss.com/docs/visibility
|
|
728
|
+
*/
|
|
729
|
+
visibility: ["visible", "invisible", "collapse"],
|
|
730
|
+
/**
|
|
731
|
+
* Z-Index
|
|
732
|
+
* @see https://tailwindcss.com/docs/z-index
|
|
733
|
+
*/
|
|
734
|
+
z: [{
|
|
735
|
+
z: ["auto", isInteger, isArbitraryValue]
|
|
736
|
+
}],
|
|
737
|
+
// Flexbox and Grid
|
|
738
|
+
/**
|
|
739
|
+
* Flex Basis
|
|
740
|
+
* @see https://tailwindcss.com/docs/flex-basis
|
|
741
|
+
*/
|
|
742
|
+
basis: [{
|
|
743
|
+
basis: getSpacingWithAutoAndArbitrary()
|
|
744
|
+
}],
|
|
745
|
+
/**
|
|
746
|
+
* Flex Direction
|
|
747
|
+
* @see https://tailwindcss.com/docs/flex-direction
|
|
748
|
+
*/
|
|
749
|
+
"flex-direction": [{
|
|
750
|
+
flex: ["row", "row-reverse", "col", "col-reverse"]
|
|
751
|
+
}],
|
|
752
|
+
/**
|
|
753
|
+
* Flex Wrap
|
|
754
|
+
* @see https://tailwindcss.com/docs/flex-wrap
|
|
755
|
+
*/
|
|
756
|
+
"flex-wrap": [{
|
|
757
|
+
flex: ["wrap", "wrap-reverse", "nowrap"]
|
|
758
|
+
}],
|
|
759
|
+
/**
|
|
760
|
+
* Flex
|
|
761
|
+
* @see https://tailwindcss.com/docs/flex
|
|
762
|
+
*/
|
|
763
|
+
flex: [{
|
|
764
|
+
flex: ["1", "auto", "initial", "none", isArbitraryValue]
|
|
765
|
+
}],
|
|
766
|
+
/**
|
|
767
|
+
* Flex Grow
|
|
768
|
+
* @see https://tailwindcss.com/docs/flex-grow
|
|
769
|
+
*/
|
|
770
|
+
grow: [{
|
|
771
|
+
grow: getZeroAndEmpty()
|
|
772
|
+
}],
|
|
773
|
+
/**
|
|
774
|
+
* Flex Shrink
|
|
775
|
+
* @see https://tailwindcss.com/docs/flex-shrink
|
|
776
|
+
*/
|
|
777
|
+
shrink: [{
|
|
778
|
+
shrink: getZeroAndEmpty()
|
|
779
|
+
}],
|
|
780
|
+
/**
|
|
781
|
+
* Order
|
|
782
|
+
* @see https://tailwindcss.com/docs/order
|
|
783
|
+
*/
|
|
784
|
+
order: [{
|
|
785
|
+
order: ["first", "last", "none", isInteger, isArbitraryValue]
|
|
786
|
+
}],
|
|
787
|
+
/**
|
|
788
|
+
* Grid Template Columns
|
|
789
|
+
* @see https://tailwindcss.com/docs/grid-template-columns
|
|
790
|
+
*/
|
|
791
|
+
"grid-cols": [{
|
|
792
|
+
"grid-cols": [isAny]
|
|
793
|
+
}],
|
|
794
|
+
/**
|
|
795
|
+
* Grid Column Start / End
|
|
796
|
+
* @see https://tailwindcss.com/docs/grid-column
|
|
797
|
+
*/
|
|
798
|
+
"col-start-end": [{
|
|
799
|
+
col: ["auto", {
|
|
800
|
+
span: ["full", isInteger, isArbitraryValue]
|
|
801
|
+
}, isArbitraryValue]
|
|
802
|
+
}],
|
|
803
|
+
/**
|
|
804
|
+
* Grid Column Start
|
|
805
|
+
* @see https://tailwindcss.com/docs/grid-column
|
|
806
|
+
*/
|
|
807
|
+
"col-start": [{
|
|
808
|
+
"col-start": getNumberWithAutoAndArbitrary()
|
|
809
|
+
}],
|
|
810
|
+
/**
|
|
811
|
+
* Grid Column End
|
|
812
|
+
* @see https://tailwindcss.com/docs/grid-column
|
|
813
|
+
*/
|
|
814
|
+
"col-end": [{
|
|
815
|
+
"col-end": getNumberWithAutoAndArbitrary()
|
|
816
|
+
}],
|
|
817
|
+
/**
|
|
818
|
+
* Grid Template Rows
|
|
819
|
+
* @see https://tailwindcss.com/docs/grid-template-rows
|
|
820
|
+
*/
|
|
821
|
+
"grid-rows": [{
|
|
822
|
+
"grid-rows": [isAny]
|
|
823
|
+
}],
|
|
824
|
+
/**
|
|
825
|
+
* Grid Row Start / End
|
|
826
|
+
* @see https://tailwindcss.com/docs/grid-row
|
|
827
|
+
*/
|
|
828
|
+
"row-start-end": [{
|
|
829
|
+
row: ["auto", {
|
|
830
|
+
span: [isInteger, isArbitraryValue]
|
|
831
|
+
}, isArbitraryValue]
|
|
832
|
+
}],
|
|
833
|
+
/**
|
|
834
|
+
* Grid Row Start
|
|
835
|
+
* @see https://tailwindcss.com/docs/grid-row
|
|
836
|
+
*/
|
|
837
|
+
"row-start": [{
|
|
838
|
+
"row-start": getNumberWithAutoAndArbitrary()
|
|
839
|
+
}],
|
|
840
|
+
/**
|
|
841
|
+
* Grid Row End
|
|
842
|
+
* @see https://tailwindcss.com/docs/grid-row
|
|
843
|
+
*/
|
|
844
|
+
"row-end": [{
|
|
845
|
+
"row-end": getNumberWithAutoAndArbitrary()
|
|
846
|
+
}],
|
|
847
|
+
/**
|
|
848
|
+
* Grid Auto Flow
|
|
849
|
+
* @see https://tailwindcss.com/docs/grid-auto-flow
|
|
850
|
+
*/
|
|
851
|
+
"grid-flow": [{
|
|
852
|
+
"grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
|
|
853
|
+
}],
|
|
854
|
+
/**
|
|
855
|
+
* Grid Auto Columns
|
|
856
|
+
* @see https://tailwindcss.com/docs/grid-auto-columns
|
|
857
|
+
*/
|
|
858
|
+
"auto-cols": [{
|
|
859
|
+
"auto-cols": ["auto", "min", "max", "fr", isArbitraryValue]
|
|
860
|
+
}],
|
|
861
|
+
/**
|
|
862
|
+
* Grid Auto Rows
|
|
863
|
+
* @see https://tailwindcss.com/docs/grid-auto-rows
|
|
864
|
+
*/
|
|
865
|
+
"auto-rows": [{
|
|
866
|
+
"auto-rows": ["auto", "min", "max", "fr", isArbitraryValue]
|
|
867
|
+
}],
|
|
868
|
+
/**
|
|
869
|
+
* Gap
|
|
870
|
+
* @see https://tailwindcss.com/docs/gap
|
|
871
|
+
*/
|
|
872
|
+
gap: [{
|
|
873
|
+
gap: [gap]
|
|
874
|
+
}],
|
|
875
|
+
/**
|
|
876
|
+
* Gap X
|
|
877
|
+
* @see https://tailwindcss.com/docs/gap
|
|
878
|
+
*/
|
|
879
|
+
"gap-x": [{
|
|
880
|
+
"gap-x": [gap]
|
|
881
|
+
}],
|
|
882
|
+
/**
|
|
883
|
+
* Gap Y
|
|
884
|
+
* @see https://tailwindcss.com/docs/gap
|
|
885
|
+
*/
|
|
886
|
+
"gap-y": [{
|
|
887
|
+
"gap-y": [gap]
|
|
888
|
+
}],
|
|
889
|
+
/**
|
|
890
|
+
* Justify Content
|
|
891
|
+
* @see https://tailwindcss.com/docs/justify-content
|
|
892
|
+
*/
|
|
893
|
+
"justify-content": [{
|
|
894
|
+
justify: ["normal", ...getAlign()]
|
|
895
|
+
}],
|
|
896
|
+
/**
|
|
897
|
+
* Justify Items
|
|
898
|
+
* @see https://tailwindcss.com/docs/justify-items
|
|
899
|
+
*/
|
|
900
|
+
"justify-items": [{
|
|
901
|
+
"justify-items": ["start", "end", "center", "stretch"]
|
|
902
|
+
}],
|
|
903
|
+
/**
|
|
904
|
+
* Justify Self
|
|
905
|
+
* @see https://tailwindcss.com/docs/justify-self
|
|
906
|
+
*/
|
|
907
|
+
"justify-self": [{
|
|
908
|
+
"justify-self": ["auto", "start", "end", "center", "stretch"]
|
|
909
|
+
}],
|
|
910
|
+
/**
|
|
911
|
+
* Align Content
|
|
912
|
+
* @see https://tailwindcss.com/docs/align-content
|
|
913
|
+
*/
|
|
914
|
+
"align-content": [{
|
|
915
|
+
content: ["normal", ...getAlign(), "baseline"]
|
|
916
|
+
}],
|
|
917
|
+
/**
|
|
918
|
+
* Align Items
|
|
919
|
+
* @see https://tailwindcss.com/docs/align-items
|
|
920
|
+
*/
|
|
921
|
+
"align-items": [{
|
|
922
|
+
items: ["start", "end", "center", "baseline", "stretch"]
|
|
923
|
+
}],
|
|
924
|
+
/**
|
|
925
|
+
* Align Self
|
|
926
|
+
* @see https://tailwindcss.com/docs/align-self
|
|
927
|
+
*/
|
|
928
|
+
"align-self": [{
|
|
929
|
+
self: ["auto", "start", "end", "center", "stretch", "baseline"]
|
|
930
|
+
}],
|
|
931
|
+
/**
|
|
932
|
+
* Place Content
|
|
933
|
+
* @see https://tailwindcss.com/docs/place-content
|
|
934
|
+
*/
|
|
935
|
+
"place-content": [{
|
|
936
|
+
"place-content": [...getAlign(), "baseline"]
|
|
937
|
+
}],
|
|
938
|
+
/**
|
|
939
|
+
* Place Items
|
|
940
|
+
* @see https://tailwindcss.com/docs/place-items
|
|
941
|
+
*/
|
|
942
|
+
"place-items": [{
|
|
943
|
+
"place-items": ["start", "end", "center", "baseline", "stretch"]
|
|
944
|
+
}],
|
|
945
|
+
/**
|
|
946
|
+
* Place Self
|
|
947
|
+
* @see https://tailwindcss.com/docs/place-self
|
|
948
|
+
*/
|
|
949
|
+
"place-self": [{
|
|
950
|
+
"place-self": ["auto", "start", "end", "center", "stretch"]
|
|
951
|
+
}],
|
|
952
|
+
// Spacing
|
|
953
|
+
/**
|
|
954
|
+
* Padding
|
|
955
|
+
* @see https://tailwindcss.com/docs/padding
|
|
956
|
+
*/
|
|
957
|
+
p: [{
|
|
958
|
+
p: [padding]
|
|
959
|
+
}],
|
|
960
|
+
/**
|
|
961
|
+
* Padding X
|
|
962
|
+
* @see https://tailwindcss.com/docs/padding
|
|
963
|
+
*/
|
|
964
|
+
px: [{
|
|
965
|
+
px: [padding]
|
|
966
|
+
}],
|
|
967
|
+
/**
|
|
968
|
+
* Padding Y
|
|
969
|
+
* @see https://tailwindcss.com/docs/padding
|
|
970
|
+
*/
|
|
971
|
+
py: [{
|
|
972
|
+
py: [padding]
|
|
973
|
+
}],
|
|
974
|
+
/**
|
|
975
|
+
* Padding Start
|
|
976
|
+
* @see https://tailwindcss.com/docs/padding
|
|
977
|
+
*/
|
|
978
|
+
ps: [{
|
|
979
|
+
ps: [padding]
|
|
980
|
+
}],
|
|
981
|
+
/**
|
|
982
|
+
* Padding End
|
|
983
|
+
* @see https://tailwindcss.com/docs/padding
|
|
984
|
+
*/
|
|
985
|
+
pe: [{
|
|
986
|
+
pe: [padding]
|
|
987
|
+
}],
|
|
988
|
+
/**
|
|
989
|
+
* Padding Top
|
|
990
|
+
* @see https://tailwindcss.com/docs/padding
|
|
991
|
+
*/
|
|
992
|
+
pt: [{
|
|
993
|
+
pt: [padding]
|
|
994
|
+
}],
|
|
995
|
+
/**
|
|
996
|
+
* Padding Right
|
|
997
|
+
* @see https://tailwindcss.com/docs/padding
|
|
998
|
+
*/
|
|
999
|
+
pr: [{
|
|
1000
|
+
pr: [padding]
|
|
1001
|
+
}],
|
|
1002
|
+
/**
|
|
1003
|
+
* Padding Bottom
|
|
1004
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1005
|
+
*/
|
|
1006
|
+
pb: [{
|
|
1007
|
+
pb: [padding]
|
|
1008
|
+
}],
|
|
1009
|
+
/**
|
|
1010
|
+
* Padding Left
|
|
1011
|
+
* @see https://tailwindcss.com/docs/padding
|
|
1012
|
+
*/
|
|
1013
|
+
pl: [{
|
|
1014
|
+
pl: [padding]
|
|
1015
|
+
}],
|
|
1016
|
+
/**
|
|
1017
|
+
* Margin
|
|
1018
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1019
|
+
*/
|
|
1020
|
+
m: [{
|
|
1021
|
+
m: [margin]
|
|
1022
|
+
}],
|
|
1023
|
+
/**
|
|
1024
|
+
* Margin X
|
|
1025
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1026
|
+
*/
|
|
1027
|
+
mx: [{
|
|
1028
|
+
mx: [margin]
|
|
1029
|
+
}],
|
|
1030
|
+
/**
|
|
1031
|
+
* Margin Y
|
|
1032
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1033
|
+
*/
|
|
1034
|
+
my: [{
|
|
1035
|
+
my: [margin]
|
|
1036
|
+
}],
|
|
1037
|
+
/**
|
|
1038
|
+
* Margin Start
|
|
1039
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1040
|
+
*/
|
|
1041
|
+
ms: [{
|
|
1042
|
+
ms: [margin]
|
|
1043
|
+
}],
|
|
1044
|
+
/**
|
|
1045
|
+
* Margin End
|
|
1046
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1047
|
+
*/
|
|
1048
|
+
me: [{
|
|
1049
|
+
me: [margin]
|
|
1050
|
+
}],
|
|
1051
|
+
/**
|
|
1052
|
+
* Margin Top
|
|
1053
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1054
|
+
*/
|
|
1055
|
+
mt: [{
|
|
1056
|
+
mt: [margin]
|
|
1057
|
+
}],
|
|
1058
|
+
/**
|
|
1059
|
+
* Margin Right
|
|
1060
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1061
|
+
*/
|
|
1062
|
+
mr: [{
|
|
1063
|
+
mr: [margin]
|
|
1064
|
+
}],
|
|
1065
|
+
/**
|
|
1066
|
+
* Margin Bottom
|
|
1067
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1068
|
+
*/
|
|
1069
|
+
mb: [{
|
|
1070
|
+
mb: [margin]
|
|
1071
|
+
}],
|
|
1072
|
+
/**
|
|
1073
|
+
* Margin Left
|
|
1074
|
+
* @see https://tailwindcss.com/docs/margin
|
|
1075
|
+
*/
|
|
1076
|
+
ml: [{
|
|
1077
|
+
ml: [margin]
|
|
1078
|
+
}],
|
|
1079
|
+
/**
|
|
1080
|
+
* Space Between X
|
|
1081
|
+
* @see https://tailwindcss.com/docs/space
|
|
1082
|
+
*/
|
|
1083
|
+
"space-x": [{
|
|
1084
|
+
"space-x": [space]
|
|
1085
|
+
}],
|
|
1086
|
+
/**
|
|
1087
|
+
* Space Between X Reverse
|
|
1088
|
+
* @see https://tailwindcss.com/docs/space
|
|
1089
|
+
*/
|
|
1090
|
+
"space-x-reverse": ["space-x-reverse"],
|
|
1091
|
+
/**
|
|
1092
|
+
* Space Between Y
|
|
1093
|
+
* @see https://tailwindcss.com/docs/space
|
|
1094
|
+
*/
|
|
1095
|
+
"space-y": [{
|
|
1096
|
+
"space-y": [space]
|
|
1097
|
+
}],
|
|
1098
|
+
/**
|
|
1099
|
+
* Space Between Y Reverse
|
|
1100
|
+
* @see https://tailwindcss.com/docs/space
|
|
1101
|
+
*/
|
|
1102
|
+
"space-y-reverse": ["space-y-reverse"],
|
|
1103
|
+
// Sizing
|
|
1104
|
+
/**
|
|
1105
|
+
* Width
|
|
1106
|
+
* @see https://tailwindcss.com/docs/width
|
|
1107
|
+
*/
|
|
1108
|
+
w: [{
|
|
1109
|
+
w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", isArbitraryValue, spacing]
|
|
1110
|
+
}],
|
|
1111
|
+
/**
|
|
1112
|
+
* Min-Width
|
|
1113
|
+
* @see https://tailwindcss.com/docs/min-width
|
|
1114
|
+
*/
|
|
1115
|
+
"min-w": [{
|
|
1116
|
+
"min-w": [isArbitraryValue, spacing, "min", "max", "fit"]
|
|
1117
|
+
}],
|
|
1118
|
+
/**
|
|
1119
|
+
* Max-Width
|
|
1120
|
+
* @see https://tailwindcss.com/docs/max-width
|
|
1121
|
+
*/
|
|
1122
|
+
"max-w": [{
|
|
1123
|
+
"max-w": [isArbitraryValue, spacing, "none", "full", "min", "max", "fit", "prose", {
|
|
1124
|
+
screen: [isTshirtSize]
|
|
1125
|
+
}, isTshirtSize]
|
|
1126
|
+
}],
|
|
1127
|
+
/**
|
|
1128
|
+
* Height
|
|
1129
|
+
* @see https://tailwindcss.com/docs/height
|
|
1130
|
+
*/
|
|
1131
|
+
h: [{
|
|
1132
|
+
h: [isArbitraryValue, spacing, "auto", "min", "max", "fit", "svh", "lvh", "dvh"]
|
|
1133
|
+
}],
|
|
1134
|
+
/**
|
|
1135
|
+
* Min-Height
|
|
1136
|
+
* @see https://tailwindcss.com/docs/min-height
|
|
1137
|
+
*/
|
|
1138
|
+
"min-h": [{
|
|
1139
|
+
"min-h": [isArbitraryValue, spacing, "min", "max", "fit", "svh", "lvh", "dvh"]
|
|
1140
|
+
}],
|
|
1141
|
+
/**
|
|
1142
|
+
* Max-Height
|
|
1143
|
+
* @see https://tailwindcss.com/docs/max-height
|
|
1144
|
+
*/
|
|
1145
|
+
"max-h": [{
|
|
1146
|
+
"max-h": [isArbitraryValue, spacing, "min", "max", "fit", "svh", "lvh", "dvh"]
|
|
1147
|
+
}],
|
|
1148
|
+
/**
|
|
1149
|
+
* Size
|
|
1150
|
+
* @see https://tailwindcss.com/docs/size
|
|
1151
|
+
*/
|
|
1152
|
+
size: [{
|
|
1153
|
+
size: [isArbitraryValue, spacing, "auto", "min", "max", "fit"]
|
|
1154
|
+
}],
|
|
1155
|
+
// Typography
|
|
1156
|
+
/**
|
|
1157
|
+
* Font Size
|
|
1158
|
+
* @see https://tailwindcss.com/docs/font-size
|
|
1159
|
+
*/
|
|
1160
|
+
"font-size": [{
|
|
1161
|
+
text: ["base", isTshirtSize, isArbitraryLength]
|
|
1162
|
+
}],
|
|
1163
|
+
/**
|
|
1164
|
+
* Font Smoothing
|
|
1165
|
+
* @see https://tailwindcss.com/docs/font-smoothing
|
|
1166
|
+
*/
|
|
1167
|
+
"font-smoothing": ["antialiased", "subpixel-antialiased"],
|
|
1168
|
+
/**
|
|
1169
|
+
* Font Style
|
|
1170
|
+
* @see https://tailwindcss.com/docs/font-style
|
|
1171
|
+
*/
|
|
1172
|
+
"font-style": ["italic", "not-italic"],
|
|
1173
|
+
/**
|
|
1174
|
+
* Font Weight
|
|
1175
|
+
* @see https://tailwindcss.com/docs/font-weight
|
|
1176
|
+
*/
|
|
1177
|
+
"font-weight": [{
|
|
1178
|
+
font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", isArbitraryNumber]
|
|
1179
|
+
}],
|
|
1180
|
+
/**
|
|
1181
|
+
* Font Family
|
|
1182
|
+
* @see https://tailwindcss.com/docs/font-family
|
|
1183
|
+
*/
|
|
1184
|
+
"font-family": [{
|
|
1185
|
+
font: [isAny]
|
|
1186
|
+
}],
|
|
1187
|
+
/**
|
|
1188
|
+
* Font Variant Numeric
|
|
1189
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1190
|
+
*/
|
|
1191
|
+
"fvn-normal": ["normal-nums"],
|
|
1192
|
+
/**
|
|
1193
|
+
* Font Variant Numeric
|
|
1194
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1195
|
+
*/
|
|
1196
|
+
"fvn-ordinal": ["ordinal"],
|
|
1197
|
+
/**
|
|
1198
|
+
* Font Variant Numeric
|
|
1199
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1200
|
+
*/
|
|
1201
|
+
"fvn-slashed-zero": ["slashed-zero"],
|
|
1202
|
+
/**
|
|
1203
|
+
* Font Variant Numeric
|
|
1204
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1205
|
+
*/
|
|
1206
|
+
"fvn-figure": ["lining-nums", "oldstyle-nums"],
|
|
1207
|
+
/**
|
|
1208
|
+
* Font Variant Numeric
|
|
1209
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1210
|
+
*/
|
|
1211
|
+
"fvn-spacing": ["proportional-nums", "tabular-nums"],
|
|
1212
|
+
/**
|
|
1213
|
+
* Font Variant Numeric
|
|
1214
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
1215
|
+
*/
|
|
1216
|
+
"fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
|
|
1217
|
+
/**
|
|
1218
|
+
* Letter Spacing
|
|
1219
|
+
* @see https://tailwindcss.com/docs/letter-spacing
|
|
1220
|
+
*/
|
|
1221
|
+
tracking: [{
|
|
1222
|
+
tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", isArbitraryValue]
|
|
1223
|
+
}],
|
|
1224
|
+
/**
|
|
1225
|
+
* Line Clamp
|
|
1226
|
+
* @see https://tailwindcss.com/docs/line-clamp
|
|
1227
|
+
*/
|
|
1228
|
+
"line-clamp": [{
|
|
1229
|
+
"line-clamp": ["none", isNumber, isArbitraryNumber]
|
|
1230
|
+
}],
|
|
1231
|
+
/**
|
|
1232
|
+
* Line Height
|
|
1233
|
+
* @see https://tailwindcss.com/docs/line-height
|
|
1234
|
+
*/
|
|
1235
|
+
leading: [{
|
|
1236
|
+
leading: ["none", "tight", "snug", "normal", "relaxed", "loose", isLength, isArbitraryValue]
|
|
1237
|
+
}],
|
|
1238
|
+
/**
|
|
1239
|
+
* List Style Image
|
|
1240
|
+
* @see https://tailwindcss.com/docs/list-style-image
|
|
1241
|
+
*/
|
|
1242
|
+
"list-image": [{
|
|
1243
|
+
"list-image": ["none", isArbitraryValue]
|
|
1244
|
+
}],
|
|
1245
|
+
/**
|
|
1246
|
+
* List Style Type
|
|
1247
|
+
* @see https://tailwindcss.com/docs/list-style-type
|
|
1248
|
+
*/
|
|
1249
|
+
"list-style-type": [{
|
|
1250
|
+
list: ["none", "disc", "decimal", isArbitraryValue]
|
|
1251
|
+
}],
|
|
1252
|
+
/**
|
|
1253
|
+
* List Style Position
|
|
1254
|
+
* @see https://tailwindcss.com/docs/list-style-position
|
|
1255
|
+
*/
|
|
1256
|
+
"list-style-position": [{
|
|
1257
|
+
list: ["inside", "outside"]
|
|
1258
|
+
}],
|
|
1259
|
+
/**
|
|
1260
|
+
* Placeholder Color
|
|
1261
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
1262
|
+
* @see https://tailwindcss.com/docs/placeholder-color
|
|
1263
|
+
*/
|
|
1264
|
+
"placeholder-color": [{
|
|
1265
|
+
placeholder: [colors]
|
|
1266
|
+
}],
|
|
1267
|
+
/**
|
|
1268
|
+
* Placeholder Opacity
|
|
1269
|
+
* @see https://tailwindcss.com/docs/placeholder-opacity
|
|
1270
|
+
*/
|
|
1271
|
+
"placeholder-opacity": [{
|
|
1272
|
+
"placeholder-opacity": [opacity]
|
|
1273
|
+
}],
|
|
1274
|
+
/**
|
|
1275
|
+
* Text Alignment
|
|
1276
|
+
* @see https://tailwindcss.com/docs/text-align
|
|
1277
|
+
*/
|
|
1278
|
+
"text-alignment": [{
|
|
1279
|
+
text: ["left", "center", "right", "justify", "start", "end"]
|
|
1280
|
+
}],
|
|
1281
|
+
/**
|
|
1282
|
+
* Text Color
|
|
1283
|
+
* @see https://tailwindcss.com/docs/text-color
|
|
1284
|
+
*/
|
|
1285
|
+
"text-color": [{
|
|
1286
|
+
text: [colors]
|
|
1287
|
+
}],
|
|
1288
|
+
/**
|
|
1289
|
+
* Text Opacity
|
|
1290
|
+
* @see https://tailwindcss.com/docs/text-opacity
|
|
1291
|
+
*/
|
|
1292
|
+
"text-opacity": [{
|
|
1293
|
+
"text-opacity": [opacity]
|
|
1294
|
+
}],
|
|
1295
|
+
/**
|
|
1296
|
+
* Text Decoration
|
|
1297
|
+
* @see https://tailwindcss.com/docs/text-decoration
|
|
1298
|
+
*/
|
|
1299
|
+
"text-decoration": ["underline", "overline", "line-through", "no-underline"],
|
|
1300
|
+
/**
|
|
1301
|
+
* Text Decoration Style
|
|
1302
|
+
* @see https://tailwindcss.com/docs/text-decoration-style
|
|
1303
|
+
*/
|
|
1304
|
+
"text-decoration-style": [{
|
|
1305
|
+
decoration: [...getLineStyles(), "wavy"]
|
|
1306
|
+
}],
|
|
1307
|
+
/**
|
|
1308
|
+
* Text Decoration Thickness
|
|
1309
|
+
* @see https://tailwindcss.com/docs/text-decoration-thickness
|
|
1310
|
+
*/
|
|
1311
|
+
"text-decoration-thickness": [{
|
|
1312
|
+
decoration: ["auto", "from-font", isLength, isArbitraryLength]
|
|
1313
|
+
}],
|
|
1314
|
+
/**
|
|
1315
|
+
* Text Underline Offset
|
|
1316
|
+
* @see https://tailwindcss.com/docs/text-underline-offset
|
|
1317
|
+
*/
|
|
1318
|
+
"underline-offset": [{
|
|
1319
|
+
"underline-offset": ["auto", isLength, isArbitraryValue]
|
|
1320
|
+
}],
|
|
1321
|
+
/**
|
|
1322
|
+
* Text Decoration Color
|
|
1323
|
+
* @see https://tailwindcss.com/docs/text-decoration-color
|
|
1324
|
+
*/
|
|
1325
|
+
"text-decoration-color": [{
|
|
1326
|
+
decoration: [colors]
|
|
1327
|
+
}],
|
|
1328
|
+
/**
|
|
1329
|
+
* Text Transform
|
|
1330
|
+
* @see https://tailwindcss.com/docs/text-transform
|
|
1331
|
+
*/
|
|
1332
|
+
"text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
|
|
1333
|
+
/**
|
|
1334
|
+
* Text Overflow
|
|
1335
|
+
* @see https://tailwindcss.com/docs/text-overflow
|
|
1336
|
+
*/
|
|
1337
|
+
"text-overflow": ["truncate", "text-ellipsis", "text-clip"],
|
|
1338
|
+
/**
|
|
1339
|
+
* Text Wrap
|
|
1340
|
+
* @see https://tailwindcss.com/docs/text-wrap
|
|
1341
|
+
*/
|
|
1342
|
+
"text-wrap": [{
|
|
1343
|
+
text: ["wrap", "nowrap", "balance", "pretty"]
|
|
1344
|
+
}],
|
|
1345
|
+
/**
|
|
1346
|
+
* Text Indent
|
|
1347
|
+
* @see https://tailwindcss.com/docs/text-indent
|
|
1348
|
+
*/
|
|
1349
|
+
indent: [{
|
|
1350
|
+
indent: getSpacingWithArbitrary()
|
|
1351
|
+
}],
|
|
1352
|
+
/**
|
|
1353
|
+
* Vertical Alignment
|
|
1354
|
+
* @see https://tailwindcss.com/docs/vertical-align
|
|
1355
|
+
*/
|
|
1356
|
+
"vertical-align": [{
|
|
1357
|
+
align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", isArbitraryValue]
|
|
1358
|
+
}],
|
|
1359
|
+
/**
|
|
1360
|
+
* Whitespace
|
|
1361
|
+
* @see https://tailwindcss.com/docs/whitespace
|
|
1362
|
+
*/
|
|
1363
|
+
whitespace: [{
|
|
1364
|
+
whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"]
|
|
1365
|
+
}],
|
|
1366
|
+
/**
|
|
1367
|
+
* Word Break
|
|
1368
|
+
* @see https://tailwindcss.com/docs/word-break
|
|
1369
|
+
*/
|
|
1370
|
+
break: [{
|
|
1371
|
+
break: ["normal", "words", "all", "keep"]
|
|
1372
|
+
}],
|
|
1373
|
+
/**
|
|
1374
|
+
* Hyphens
|
|
1375
|
+
* @see https://tailwindcss.com/docs/hyphens
|
|
1376
|
+
*/
|
|
1377
|
+
hyphens: [{
|
|
1378
|
+
hyphens: ["none", "manual", "auto"]
|
|
1379
|
+
}],
|
|
1380
|
+
/**
|
|
1381
|
+
* Content
|
|
1382
|
+
* @see https://tailwindcss.com/docs/content
|
|
1383
|
+
*/
|
|
1384
|
+
content: [{
|
|
1385
|
+
content: ["none", isArbitraryValue]
|
|
1386
|
+
}],
|
|
1387
|
+
// Backgrounds
|
|
1388
|
+
/**
|
|
1389
|
+
* Background Attachment
|
|
1390
|
+
* @see https://tailwindcss.com/docs/background-attachment
|
|
1391
|
+
*/
|
|
1392
|
+
"bg-attachment": [{
|
|
1393
|
+
bg: ["fixed", "local", "scroll"]
|
|
1394
|
+
}],
|
|
1395
|
+
/**
|
|
1396
|
+
* Background Clip
|
|
1397
|
+
* @see https://tailwindcss.com/docs/background-clip
|
|
1398
|
+
*/
|
|
1399
|
+
"bg-clip": [{
|
|
1400
|
+
"bg-clip": ["border", "padding", "content", "text"]
|
|
1401
|
+
}],
|
|
1402
|
+
/**
|
|
1403
|
+
* Background Opacity
|
|
1404
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
1405
|
+
* @see https://tailwindcss.com/docs/background-opacity
|
|
1406
|
+
*/
|
|
1407
|
+
"bg-opacity": [{
|
|
1408
|
+
"bg-opacity": [opacity]
|
|
1409
|
+
}],
|
|
1410
|
+
/**
|
|
1411
|
+
* Background Origin
|
|
1412
|
+
* @see https://tailwindcss.com/docs/background-origin
|
|
1413
|
+
*/
|
|
1414
|
+
"bg-origin": [{
|
|
1415
|
+
"bg-origin": ["border", "padding", "content"]
|
|
1416
|
+
}],
|
|
1417
|
+
/**
|
|
1418
|
+
* Background Position
|
|
1419
|
+
* @see https://tailwindcss.com/docs/background-position
|
|
1420
|
+
*/
|
|
1421
|
+
"bg-position": [{
|
|
1422
|
+
bg: [...getPositions(), isArbitraryPosition]
|
|
1423
|
+
}],
|
|
1424
|
+
/**
|
|
1425
|
+
* Background Repeat
|
|
1426
|
+
* @see https://tailwindcss.com/docs/background-repeat
|
|
1427
|
+
*/
|
|
1428
|
+
"bg-repeat": [{
|
|
1429
|
+
bg: ["no-repeat", {
|
|
1430
|
+
repeat: ["", "x", "y", "round", "space"]
|
|
1431
|
+
}]
|
|
1432
|
+
}],
|
|
1433
|
+
/**
|
|
1434
|
+
* Background Size
|
|
1435
|
+
* @see https://tailwindcss.com/docs/background-size
|
|
1436
|
+
*/
|
|
1437
|
+
"bg-size": [{
|
|
1438
|
+
bg: ["auto", "cover", "contain", isArbitrarySize]
|
|
1439
|
+
}],
|
|
1440
|
+
/**
|
|
1441
|
+
* Background Image
|
|
1442
|
+
* @see https://tailwindcss.com/docs/background-image
|
|
1443
|
+
*/
|
|
1444
|
+
"bg-image": [{
|
|
1445
|
+
bg: ["none", {
|
|
1446
|
+
"gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
|
|
1447
|
+
}, isArbitraryImage]
|
|
1448
|
+
}],
|
|
1449
|
+
/**
|
|
1450
|
+
* Background Color
|
|
1451
|
+
* @see https://tailwindcss.com/docs/background-color
|
|
1452
|
+
*/
|
|
1453
|
+
"bg-color": [{
|
|
1454
|
+
bg: [colors]
|
|
1455
|
+
}],
|
|
1456
|
+
/**
|
|
1457
|
+
* Gradient Color Stops From Position
|
|
1458
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1459
|
+
*/
|
|
1460
|
+
"gradient-from-pos": [{
|
|
1461
|
+
from: [gradientColorStopPositions]
|
|
1462
|
+
}],
|
|
1463
|
+
/**
|
|
1464
|
+
* Gradient Color Stops Via Position
|
|
1465
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1466
|
+
*/
|
|
1467
|
+
"gradient-via-pos": [{
|
|
1468
|
+
via: [gradientColorStopPositions]
|
|
1469
|
+
}],
|
|
1470
|
+
/**
|
|
1471
|
+
* Gradient Color Stops To Position
|
|
1472
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1473
|
+
*/
|
|
1474
|
+
"gradient-to-pos": [{
|
|
1475
|
+
to: [gradientColorStopPositions]
|
|
1476
|
+
}],
|
|
1477
|
+
/**
|
|
1478
|
+
* Gradient Color Stops From
|
|
1479
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1480
|
+
*/
|
|
1481
|
+
"gradient-from": [{
|
|
1482
|
+
from: [gradientColorStops]
|
|
1483
|
+
}],
|
|
1484
|
+
/**
|
|
1485
|
+
* Gradient Color Stops Via
|
|
1486
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1487
|
+
*/
|
|
1488
|
+
"gradient-via": [{
|
|
1489
|
+
via: [gradientColorStops]
|
|
1490
|
+
}],
|
|
1491
|
+
/**
|
|
1492
|
+
* Gradient Color Stops To
|
|
1493
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
1494
|
+
*/
|
|
1495
|
+
"gradient-to": [{
|
|
1496
|
+
to: [gradientColorStops]
|
|
1497
|
+
}],
|
|
1498
|
+
// Borders
|
|
1499
|
+
/**
|
|
1500
|
+
* Border Radius
|
|
1501
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1502
|
+
*/
|
|
1503
|
+
rounded: [{
|
|
1504
|
+
rounded: [borderRadius]
|
|
1505
|
+
}],
|
|
1506
|
+
/**
|
|
1507
|
+
* Border Radius Start
|
|
1508
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1509
|
+
*/
|
|
1510
|
+
"rounded-s": [{
|
|
1511
|
+
"rounded-s": [borderRadius]
|
|
1512
|
+
}],
|
|
1513
|
+
/**
|
|
1514
|
+
* Border Radius End
|
|
1515
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1516
|
+
*/
|
|
1517
|
+
"rounded-e": [{
|
|
1518
|
+
"rounded-e": [borderRadius]
|
|
1519
|
+
}],
|
|
1520
|
+
/**
|
|
1521
|
+
* Border Radius Top
|
|
1522
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1523
|
+
*/
|
|
1524
|
+
"rounded-t": [{
|
|
1525
|
+
"rounded-t": [borderRadius]
|
|
1526
|
+
}],
|
|
1527
|
+
/**
|
|
1528
|
+
* Border Radius Right
|
|
1529
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1530
|
+
*/
|
|
1531
|
+
"rounded-r": [{
|
|
1532
|
+
"rounded-r": [borderRadius]
|
|
1533
|
+
}],
|
|
1534
|
+
/**
|
|
1535
|
+
* Border Radius Bottom
|
|
1536
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1537
|
+
*/
|
|
1538
|
+
"rounded-b": [{
|
|
1539
|
+
"rounded-b": [borderRadius]
|
|
1540
|
+
}],
|
|
1541
|
+
/**
|
|
1542
|
+
* Border Radius Left
|
|
1543
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1544
|
+
*/
|
|
1545
|
+
"rounded-l": [{
|
|
1546
|
+
"rounded-l": [borderRadius]
|
|
1547
|
+
}],
|
|
1548
|
+
/**
|
|
1549
|
+
* Border Radius Start Start
|
|
1550
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1551
|
+
*/
|
|
1552
|
+
"rounded-ss": [{
|
|
1553
|
+
"rounded-ss": [borderRadius]
|
|
1554
|
+
}],
|
|
1555
|
+
/**
|
|
1556
|
+
* Border Radius Start End
|
|
1557
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1558
|
+
*/
|
|
1559
|
+
"rounded-se": [{
|
|
1560
|
+
"rounded-se": [borderRadius]
|
|
1561
|
+
}],
|
|
1562
|
+
/**
|
|
1563
|
+
* Border Radius End End
|
|
1564
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1565
|
+
*/
|
|
1566
|
+
"rounded-ee": [{
|
|
1567
|
+
"rounded-ee": [borderRadius]
|
|
1568
|
+
}],
|
|
1569
|
+
/**
|
|
1570
|
+
* Border Radius End Start
|
|
1571
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1572
|
+
*/
|
|
1573
|
+
"rounded-es": [{
|
|
1574
|
+
"rounded-es": [borderRadius]
|
|
1575
|
+
}],
|
|
1576
|
+
/**
|
|
1577
|
+
* Border Radius Top Left
|
|
1578
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1579
|
+
*/
|
|
1580
|
+
"rounded-tl": [{
|
|
1581
|
+
"rounded-tl": [borderRadius]
|
|
1582
|
+
}],
|
|
1583
|
+
/**
|
|
1584
|
+
* Border Radius Top Right
|
|
1585
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1586
|
+
*/
|
|
1587
|
+
"rounded-tr": [{
|
|
1588
|
+
"rounded-tr": [borderRadius]
|
|
1589
|
+
}],
|
|
1590
|
+
/**
|
|
1591
|
+
* Border Radius Bottom Right
|
|
1592
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1593
|
+
*/
|
|
1594
|
+
"rounded-br": [{
|
|
1595
|
+
"rounded-br": [borderRadius]
|
|
1596
|
+
}],
|
|
1597
|
+
/**
|
|
1598
|
+
* Border Radius Bottom Left
|
|
1599
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
1600
|
+
*/
|
|
1601
|
+
"rounded-bl": [{
|
|
1602
|
+
"rounded-bl": [borderRadius]
|
|
1603
|
+
}],
|
|
1604
|
+
/**
|
|
1605
|
+
* Border Width
|
|
1606
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1607
|
+
*/
|
|
1608
|
+
"border-w": [{
|
|
1609
|
+
border: [borderWidth]
|
|
1610
|
+
}],
|
|
1611
|
+
/**
|
|
1612
|
+
* Border Width X
|
|
1613
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1614
|
+
*/
|
|
1615
|
+
"border-w-x": [{
|
|
1616
|
+
"border-x": [borderWidth]
|
|
1617
|
+
}],
|
|
1618
|
+
/**
|
|
1619
|
+
* Border Width Y
|
|
1620
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1621
|
+
*/
|
|
1622
|
+
"border-w-y": [{
|
|
1623
|
+
"border-y": [borderWidth]
|
|
1624
|
+
}],
|
|
1625
|
+
/**
|
|
1626
|
+
* Border Width Start
|
|
1627
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1628
|
+
*/
|
|
1629
|
+
"border-w-s": [{
|
|
1630
|
+
"border-s": [borderWidth]
|
|
1631
|
+
}],
|
|
1632
|
+
/**
|
|
1633
|
+
* Border Width End
|
|
1634
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1635
|
+
*/
|
|
1636
|
+
"border-w-e": [{
|
|
1637
|
+
"border-e": [borderWidth]
|
|
1638
|
+
}],
|
|
1639
|
+
/**
|
|
1640
|
+
* Border Width Top
|
|
1641
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1642
|
+
*/
|
|
1643
|
+
"border-w-t": [{
|
|
1644
|
+
"border-t": [borderWidth]
|
|
1645
|
+
}],
|
|
1646
|
+
/**
|
|
1647
|
+
* Border Width Right
|
|
1648
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1649
|
+
*/
|
|
1650
|
+
"border-w-r": [{
|
|
1651
|
+
"border-r": [borderWidth]
|
|
1652
|
+
}],
|
|
1653
|
+
/**
|
|
1654
|
+
* Border Width Bottom
|
|
1655
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1656
|
+
*/
|
|
1657
|
+
"border-w-b": [{
|
|
1658
|
+
"border-b": [borderWidth]
|
|
1659
|
+
}],
|
|
1660
|
+
/**
|
|
1661
|
+
* Border Width Left
|
|
1662
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
1663
|
+
*/
|
|
1664
|
+
"border-w-l": [{
|
|
1665
|
+
"border-l": [borderWidth]
|
|
1666
|
+
}],
|
|
1667
|
+
/**
|
|
1668
|
+
* Border Opacity
|
|
1669
|
+
* @see https://tailwindcss.com/docs/border-opacity
|
|
1670
|
+
*/
|
|
1671
|
+
"border-opacity": [{
|
|
1672
|
+
"border-opacity": [opacity]
|
|
1673
|
+
}],
|
|
1674
|
+
/**
|
|
1675
|
+
* Border Style
|
|
1676
|
+
* @see https://tailwindcss.com/docs/border-style
|
|
1677
|
+
*/
|
|
1678
|
+
"border-style": [{
|
|
1679
|
+
border: [...getLineStyles(), "hidden"]
|
|
1680
|
+
}],
|
|
1681
|
+
/**
|
|
1682
|
+
* Divide Width X
|
|
1683
|
+
* @see https://tailwindcss.com/docs/divide-width
|
|
1684
|
+
*/
|
|
1685
|
+
"divide-x": [{
|
|
1686
|
+
"divide-x": [borderWidth]
|
|
1687
|
+
}],
|
|
1688
|
+
/**
|
|
1689
|
+
* Divide Width X Reverse
|
|
1690
|
+
* @see https://tailwindcss.com/docs/divide-width
|
|
1691
|
+
*/
|
|
1692
|
+
"divide-x-reverse": ["divide-x-reverse"],
|
|
1693
|
+
/**
|
|
1694
|
+
* Divide Width Y
|
|
1695
|
+
* @see https://tailwindcss.com/docs/divide-width
|
|
1696
|
+
*/
|
|
1697
|
+
"divide-y": [{
|
|
1698
|
+
"divide-y": [borderWidth]
|
|
1699
|
+
}],
|
|
1700
|
+
/**
|
|
1701
|
+
* Divide Width Y Reverse
|
|
1702
|
+
* @see https://tailwindcss.com/docs/divide-width
|
|
1703
|
+
*/
|
|
1704
|
+
"divide-y-reverse": ["divide-y-reverse"],
|
|
1705
|
+
/**
|
|
1706
|
+
* Divide Opacity
|
|
1707
|
+
* @see https://tailwindcss.com/docs/divide-opacity
|
|
1708
|
+
*/
|
|
1709
|
+
"divide-opacity": [{
|
|
1710
|
+
"divide-opacity": [opacity]
|
|
1711
|
+
}],
|
|
1712
|
+
/**
|
|
1713
|
+
* Divide Style
|
|
1714
|
+
* @see https://tailwindcss.com/docs/divide-style
|
|
1715
|
+
*/
|
|
1716
|
+
"divide-style": [{
|
|
1717
|
+
divide: getLineStyles()
|
|
1718
|
+
}],
|
|
1719
|
+
/**
|
|
1720
|
+
* Border Color
|
|
1721
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
1722
|
+
*/
|
|
1723
|
+
"border-color": [{
|
|
1724
|
+
border: [borderColor]
|
|
1725
|
+
}],
|
|
1726
|
+
/**
|
|
1727
|
+
* Border Color X
|
|
1728
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
1729
|
+
*/
|
|
1730
|
+
"border-color-x": [{
|
|
1731
|
+
"border-x": [borderColor]
|
|
1732
|
+
}],
|
|
1733
|
+
/**
|
|
1734
|
+
* Border Color Y
|
|
1735
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
1736
|
+
*/
|
|
1737
|
+
"border-color-y": [{
|
|
1738
|
+
"border-y": [borderColor]
|
|
1739
|
+
}],
|
|
1740
|
+
/**
|
|
1741
|
+
* Border Color S
|
|
1742
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
1743
|
+
*/
|
|
1744
|
+
"border-color-s": [{
|
|
1745
|
+
"border-s": [borderColor]
|
|
1746
|
+
}],
|
|
1747
|
+
/**
|
|
1748
|
+
* Border Color E
|
|
1749
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
1750
|
+
*/
|
|
1751
|
+
"border-color-e": [{
|
|
1752
|
+
"border-e": [borderColor]
|
|
1753
|
+
}],
|
|
1754
|
+
/**
|
|
1755
|
+
* Border Color Top
|
|
1756
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
1757
|
+
*/
|
|
1758
|
+
"border-color-t": [{
|
|
1759
|
+
"border-t": [borderColor]
|
|
1760
|
+
}],
|
|
1761
|
+
/**
|
|
1762
|
+
* Border Color Right
|
|
1763
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
1764
|
+
*/
|
|
1765
|
+
"border-color-r": [{
|
|
1766
|
+
"border-r": [borderColor]
|
|
1767
|
+
}],
|
|
1768
|
+
/**
|
|
1769
|
+
* Border Color Bottom
|
|
1770
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
1771
|
+
*/
|
|
1772
|
+
"border-color-b": [{
|
|
1773
|
+
"border-b": [borderColor]
|
|
1774
|
+
}],
|
|
1775
|
+
/**
|
|
1776
|
+
* Border Color Left
|
|
1777
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
1778
|
+
*/
|
|
1779
|
+
"border-color-l": [{
|
|
1780
|
+
"border-l": [borderColor]
|
|
1781
|
+
}],
|
|
1782
|
+
/**
|
|
1783
|
+
* Divide Color
|
|
1784
|
+
* @see https://tailwindcss.com/docs/divide-color
|
|
1785
|
+
*/
|
|
1786
|
+
"divide-color": [{
|
|
1787
|
+
divide: [borderColor]
|
|
1788
|
+
}],
|
|
1789
|
+
/**
|
|
1790
|
+
* Outline Style
|
|
1791
|
+
* @see https://tailwindcss.com/docs/outline-style
|
|
1792
|
+
*/
|
|
1793
|
+
"outline-style": [{
|
|
1794
|
+
outline: ["", ...getLineStyles()]
|
|
1795
|
+
}],
|
|
1796
|
+
/**
|
|
1797
|
+
* Outline Offset
|
|
1798
|
+
* @see https://tailwindcss.com/docs/outline-offset
|
|
1799
|
+
*/
|
|
1800
|
+
"outline-offset": [{
|
|
1801
|
+
"outline-offset": [isLength, isArbitraryValue]
|
|
1802
|
+
}],
|
|
1803
|
+
/**
|
|
1804
|
+
* Outline Width
|
|
1805
|
+
* @see https://tailwindcss.com/docs/outline-width
|
|
1806
|
+
*/
|
|
1807
|
+
"outline-w": [{
|
|
1808
|
+
outline: [isLength, isArbitraryLength]
|
|
1809
|
+
}],
|
|
1810
|
+
/**
|
|
1811
|
+
* Outline Color
|
|
1812
|
+
* @see https://tailwindcss.com/docs/outline-color
|
|
1813
|
+
*/
|
|
1814
|
+
"outline-color": [{
|
|
1815
|
+
outline: [colors]
|
|
1816
|
+
}],
|
|
1817
|
+
/**
|
|
1818
|
+
* Ring Width
|
|
1819
|
+
* @see https://tailwindcss.com/docs/ring-width
|
|
1820
|
+
*/
|
|
1821
|
+
"ring-w": [{
|
|
1822
|
+
ring: getLengthWithEmptyAndArbitrary()
|
|
1823
|
+
}],
|
|
1824
|
+
/**
|
|
1825
|
+
* Ring Width Inset
|
|
1826
|
+
* @see https://tailwindcss.com/docs/ring-width
|
|
1827
|
+
*/
|
|
1828
|
+
"ring-w-inset": ["ring-inset"],
|
|
1829
|
+
/**
|
|
1830
|
+
* Ring Color
|
|
1831
|
+
* @see https://tailwindcss.com/docs/ring-color
|
|
1832
|
+
*/
|
|
1833
|
+
"ring-color": [{
|
|
1834
|
+
ring: [colors]
|
|
1835
|
+
}],
|
|
1836
|
+
/**
|
|
1837
|
+
* Ring Opacity
|
|
1838
|
+
* @see https://tailwindcss.com/docs/ring-opacity
|
|
1839
|
+
*/
|
|
1840
|
+
"ring-opacity": [{
|
|
1841
|
+
"ring-opacity": [opacity]
|
|
1842
|
+
}],
|
|
1843
|
+
/**
|
|
1844
|
+
* Ring Offset Width
|
|
1845
|
+
* @see https://tailwindcss.com/docs/ring-offset-width
|
|
1846
|
+
*/
|
|
1847
|
+
"ring-offset-w": [{
|
|
1848
|
+
"ring-offset": [isLength, isArbitraryLength]
|
|
1849
|
+
}],
|
|
1850
|
+
/**
|
|
1851
|
+
* Ring Offset Color
|
|
1852
|
+
* @see https://tailwindcss.com/docs/ring-offset-color
|
|
1853
|
+
*/
|
|
1854
|
+
"ring-offset-color": [{
|
|
1855
|
+
"ring-offset": [colors]
|
|
1856
|
+
}],
|
|
1857
|
+
// Effects
|
|
1858
|
+
/**
|
|
1859
|
+
* Box Shadow
|
|
1860
|
+
* @see https://tailwindcss.com/docs/box-shadow
|
|
1861
|
+
*/
|
|
1862
|
+
shadow: [{
|
|
1863
|
+
shadow: ["", "inner", "none", isTshirtSize, isArbitraryShadow]
|
|
1864
|
+
}],
|
|
1865
|
+
/**
|
|
1866
|
+
* Box Shadow Color
|
|
1867
|
+
* @see https://tailwindcss.com/docs/box-shadow-color
|
|
1868
|
+
*/
|
|
1869
|
+
"shadow-color": [{
|
|
1870
|
+
shadow: [isAny]
|
|
1871
|
+
}],
|
|
1872
|
+
/**
|
|
1873
|
+
* Opacity
|
|
1874
|
+
* @see https://tailwindcss.com/docs/opacity
|
|
1875
|
+
*/
|
|
1876
|
+
opacity: [{
|
|
1877
|
+
opacity: [opacity]
|
|
1878
|
+
}],
|
|
1879
|
+
/**
|
|
1880
|
+
* Mix Blend Mode
|
|
1881
|
+
* @see https://tailwindcss.com/docs/mix-blend-mode
|
|
1882
|
+
*/
|
|
1883
|
+
"mix-blend": [{
|
|
1884
|
+
"mix-blend": [...getBlendModes(), "plus-lighter", "plus-darker"]
|
|
1885
|
+
}],
|
|
1886
|
+
/**
|
|
1887
|
+
* Background Blend Mode
|
|
1888
|
+
* @see https://tailwindcss.com/docs/background-blend-mode
|
|
1889
|
+
*/
|
|
1890
|
+
"bg-blend": [{
|
|
1891
|
+
"bg-blend": getBlendModes()
|
|
1892
|
+
}],
|
|
1893
|
+
// Filters
|
|
1894
|
+
/**
|
|
1895
|
+
* Filter
|
|
1896
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
1897
|
+
* @see https://tailwindcss.com/docs/filter
|
|
1898
|
+
*/
|
|
1899
|
+
filter: [{
|
|
1900
|
+
filter: ["", "none"]
|
|
1901
|
+
}],
|
|
1902
|
+
/**
|
|
1903
|
+
* Blur
|
|
1904
|
+
* @see https://tailwindcss.com/docs/blur
|
|
1905
|
+
*/
|
|
1906
|
+
blur: [{
|
|
1907
|
+
blur: [blur]
|
|
1908
|
+
}],
|
|
1909
|
+
/**
|
|
1910
|
+
* Brightness
|
|
1911
|
+
* @see https://tailwindcss.com/docs/brightness
|
|
1912
|
+
*/
|
|
1913
|
+
brightness: [{
|
|
1914
|
+
brightness: [brightness]
|
|
1915
|
+
}],
|
|
1916
|
+
/**
|
|
1917
|
+
* Contrast
|
|
1918
|
+
* @see https://tailwindcss.com/docs/contrast
|
|
1919
|
+
*/
|
|
1920
|
+
contrast: [{
|
|
1921
|
+
contrast: [contrast]
|
|
1922
|
+
}],
|
|
1923
|
+
/**
|
|
1924
|
+
* Drop Shadow
|
|
1925
|
+
* @see https://tailwindcss.com/docs/drop-shadow
|
|
1926
|
+
*/
|
|
1927
|
+
"drop-shadow": [{
|
|
1928
|
+
"drop-shadow": ["", "none", isTshirtSize, isArbitraryValue]
|
|
1929
|
+
}],
|
|
1930
|
+
/**
|
|
1931
|
+
* Grayscale
|
|
1932
|
+
* @see https://tailwindcss.com/docs/grayscale
|
|
1933
|
+
*/
|
|
1934
|
+
grayscale: [{
|
|
1935
|
+
grayscale: [grayscale]
|
|
1936
|
+
}],
|
|
1937
|
+
/**
|
|
1938
|
+
* Hue Rotate
|
|
1939
|
+
* @see https://tailwindcss.com/docs/hue-rotate
|
|
1940
|
+
*/
|
|
1941
|
+
"hue-rotate": [{
|
|
1942
|
+
"hue-rotate": [hueRotate]
|
|
1943
|
+
}],
|
|
1944
|
+
/**
|
|
1945
|
+
* Invert
|
|
1946
|
+
* @see https://tailwindcss.com/docs/invert
|
|
1947
|
+
*/
|
|
1948
|
+
invert: [{
|
|
1949
|
+
invert: [invert]
|
|
1950
|
+
}],
|
|
1951
|
+
/**
|
|
1952
|
+
* Saturate
|
|
1953
|
+
* @see https://tailwindcss.com/docs/saturate
|
|
1954
|
+
*/
|
|
1955
|
+
saturate: [{
|
|
1956
|
+
saturate: [saturate]
|
|
1957
|
+
}],
|
|
1958
|
+
/**
|
|
1959
|
+
* Sepia
|
|
1960
|
+
* @see https://tailwindcss.com/docs/sepia
|
|
1961
|
+
*/
|
|
1962
|
+
sepia: [{
|
|
1963
|
+
sepia: [sepia]
|
|
1964
|
+
}],
|
|
1965
|
+
/**
|
|
1966
|
+
* Backdrop Filter
|
|
1967
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
1968
|
+
* @see https://tailwindcss.com/docs/backdrop-filter
|
|
1969
|
+
*/
|
|
1970
|
+
"backdrop-filter": [{
|
|
1971
|
+
"backdrop-filter": ["", "none"]
|
|
1972
|
+
}],
|
|
1973
|
+
/**
|
|
1974
|
+
* Backdrop Blur
|
|
1975
|
+
* @see https://tailwindcss.com/docs/backdrop-blur
|
|
1976
|
+
*/
|
|
1977
|
+
"backdrop-blur": [{
|
|
1978
|
+
"backdrop-blur": [blur]
|
|
1979
|
+
}],
|
|
1980
|
+
/**
|
|
1981
|
+
* Backdrop Brightness
|
|
1982
|
+
* @see https://tailwindcss.com/docs/backdrop-brightness
|
|
1983
|
+
*/
|
|
1984
|
+
"backdrop-brightness": [{
|
|
1985
|
+
"backdrop-brightness": [brightness]
|
|
1986
|
+
}],
|
|
1987
|
+
/**
|
|
1988
|
+
* Backdrop Contrast
|
|
1989
|
+
* @see https://tailwindcss.com/docs/backdrop-contrast
|
|
1990
|
+
*/
|
|
1991
|
+
"backdrop-contrast": [{
|
|
1992
|
+
"backdrop-contrast": [contrast]
|
|
1993
|
+
}],
|
|
1994
|
+
/**
|
|
1995
|
+
* Backdrop Grayscale
|
|
1996
|
+
* @see https://tailwindcss.com/docs/backdrop-grayscale
|
|
1997
|
+
*/
|
|
1998
|
+
"backdrop-grayscale": [{
|
|
1999
|
+
"backdrop-grayscale": [grayscale]
|
|
2000
|
+
}],
|
|
2001
|
+
/**
|
|
2002
|
+
* Backdrop Hue Rotate
|
|
2003
|
+
* @see https://tailwindcss.com/docs/backdrop-hue-rotate
|
|
2004
|
+
*/
|
|
2005
|
+
"backdrop-hue-rotate": [{
|
|
2006
|
+
"backdrop-hue-rotate": [hueRotate]
|
|
2007
|
+
}],
|
|
2008
|
+
/**
|
|
2009
|
+
* Backdrop Invert
|
|
2010
|
+
* @see https://tailwindcss.com/docs/backdrop-invert
|
|
2011
|
+
*/
|
|
2012
|
+
"backdrop-invert": [{
|
|
2013
|
+
"backdrop-invert": [invert]
|
|
2014
|
+
}],
|
|
2015
|
+
/**
|
|
2016
|
+
* Backdrop Opacity
|
|
2017
|
+
* @see https://tailwindcss.com/docs/backdrop-opacity
|
|
2018
|
+
*/
|
|
2019
|
+
"backdrop-opacity": [{
|
|
2020
|
+
"backdrop-opacity": [opacity]
|
|
2021
|
+
}],
|
|
2022
|
+
/**
|
|
2023
|
+
* Backdrop Saturate
|
|
2024
|
+
* @see https://tailwindcss.com/docs/backdrop-saturate
|
|
2025
|
+
*/
|
|
2026
|
+
"backdrop-saturate": [{
|
|
2027
|
+
"backdrop-saturate": [saturate]
|
|
2028
|
+
}],
|
|
2029
|
+
/**
|
|
2030
|
+
* Backdrop Sepia
|
|
2031
|
+
* @see https://tailwindcss.com/docs/backdrop-sepia
|
|
2032
|
+
*/
|
|
2033
|
+
"backdrop-sepia": [{
|
|
2034
|
+
"backdrop-sepia": [sepia]
|
|
2035
|
+
}],
|
|
2036
|
+
// Tables
|
|
2037
|
+
/**
|
|
2038
|
+
* Border Collapse
|
|
2039
|
+
* @see https://tailwindcss.com/docs/border-collapse
|
|
2040
|
+
*/
|
|
2041
|
+
"border-collapse": [{
|
|
2042
|
+
border: ["collapse", "separate"]
|
|
2043
|
+
}],
|
|
2044
|
+
/**
|
|
2045
|
+
* Border Spacing
|
|
2046
|
+
* @see https://tailwindcss.com/docs/border-spacing
|
|
2047
|
+
*/
|
|
2048
|
+
"border-spacing": [{
|
|
2049
|
+
"border-spacing": [borderSpacing]
|
|
2050
|
+
}],
|
|
2051
|
+
/**
|
|
2052
|
+
* Border Spacing X
|
|
2053
|
+
* @see https://tailwindcss.com/docs/border-spacing
|
|
2054
|
+
*/
|
|
2055
|
+
"border-spacing-x": [{
|
|
2056
|
+
"border-spacing-x": [borderSpacing]
|
|
2057
|
+
}],
|
|
2058
|
+
/**
|
|
2059
|
+
* Border Spacing Y
|
|
2060
|
+
* @see https://tailwindcss.com/docs/border-spacing
|
|
2061
|
+
*/
|
|
2062
|
+
"border-spacing-y": [{
|
|
2063
|
+
"border-spacing-y": [borderSpacing]
|
|
2064
|
+
}],
|
|
2065
|
+
/**
|
|
2066
|
+
* Table Layout
|
|
2067
|
+
* @see https://tailwindcss.com/docs/table-layout
|
|
2068
|
+
*/
|
|
2069
|
+
"table-layout": [{
|
|
2070
|
+
table: ["auto", "fixed"]
|
|
2071
|
+
}],
|
|
2072
|
+
/**
|
|
2073
|
+
* Caption Side
|
|
2074
|
+
* @see https://tailwindcss.com/docs/caption-side
|
|
2075
|
+
*/
|
|
2076
|
+
caption: [{
|
|
2077
|
+
caption: ["top", "bottom"]
|
|
2078
|
+
}],
|
|
2079
|
+
// Transitions and Animation
|
|
2080
|
+
/**
|
|
2081
|
+
* Tranisition Property
|
|
2082
|
+
* @see https://tailwindcss.com/docs/transition-property
|
|
2083
|
+
*/
|
|
2084
|
+
transition: [{
|
|
2085
|
+
transition: ["none", "all", "", "colors", "opacity", "shadow", "transform", isArbitraryValue]
|
|
2086
|
+
}],
|
|
2087
|
+
/**
|
|
2088
|
+
* Transition Duration
|
|
2089
|
+
* @see https://tailwindcss.com/docs/transition-duration
|
|
2090
|
+
*/
|
|
2091
|
+
duration: [{
|
|
2092
|
+
duration: getNumberAndArbitrary()
|
|
2093
|
+
}],
|
|
2094
|
+
/**
|
|
2095
|
+
* Transition Timing Function
|
|
2096
|
+
* @see https://tailwindcss.com/docs/transition-timing-function
|
|
2097
|
+
*/
|
|
2098
|
+
ease: [{
|
|
2099
|
+
ease: ["linear", "in", "out", "in-out", isArbitraryValue]
|
|
2100
|
+
}],
|
|
2101
|
+
/**
|
|
2102
|
+
* Transition Delay
|
|
2103
|
+
* @see https://tailwindcss.com/docs/transition-delay
|
|
2104
|
+
*/
|
|
2105
|
+
delay: [{
|
|
2106
|
+
delay: getNumberAndArbitrary()
|
|
2107
|
+
}],
|
|
2108
|
+
/**
|
|
2109
|
+
* Animation
|
|
2110
|
+
* @see https://tailwindcss.com/docs/animation
|
|
2111
|
+
*/
|
|
2112
|
+
animate: [{
|
|
2113
|
+
animate: ["none", "spin", "ping", "pulse", "bounce", isArbitraryValue]
|
|
2114
|
+
}],
|
|
2115
|
+
// Transforms
|
|
2116
|
+
/**
|
|
2117
|
+
* Transform
|
|
2118
|
+
* @see https://tailwindcss.com/docs/transform
|
|
2119
|
+
*/
|
|
2120
|
+
transform: [{
|
|
2121
|
+
transform: ["", "gpu", "none"]
|
|
2122
|
+
}],
|
|
2123
|
+
/**
|
|
2124
|
+
* Scale
|
|
2125
|
+
* @see https://tailwindcss.com/docs/scale
|
|
2126
|
+
*/
|
|
2127
|
+
scale: [{
|
|
2128
|
+
scale: [scale]
|
|
2129
|
+
}],
|
|
2130
|
+
/**
|
|
2131
|
+
* Scale X
|
|
2132
|
+
* @see https://tailwindcss.com/docs/scale
|
|
2133
|
+
*/
|
|
2134
|
+
"scale-x": [{
|
|
2135
|
+
"scale-x": [scale]
|
|
2136
|
+
}],
|
|
2137
|
+
/**
|
|
2138
|
+
* Scale Y
|
|
2139
|
+
* @see https://tailwindcss.com/docs/scale
|
|
2140
|
+
*/
|
|
2141
|
+
"scale-y": [{
|
|
2142
|
+
"scale-y": [scale]
|
|
2143
|
+
}],
|
|
2144
|
+
/**
|
|
2145
|
+
* Rotate
|
|
2146
|
+
* @see https://tailwindcss.com/docs/rotate
|
|
2147
|
+
*/
|
|
2148
|
+
rotate: [{
|
|
2149
|
+
rotate: [isInteger, isArbitraryValue]
|
|
2150
|
+
}],
|
|
2151
|
+
/**
|
|
2152
|
+
* Translate X
|
|
2153
|
+
* @see https://tailwindcss.com/docs/translate
|
|
2154
|
+
*/
|
|
2155
|
+
"translate-x": [{
|
|
2156
|
+
"translate-x": [translate]
|
|
2157
|
+
}],
|
|
2158
|
+
/**
|
|
2159
|
+
* Translate Y
|
|
2160
|
+
* @see https://tailwindcss.com/docs/translate
|
|
2161
|
+
*/
|
|
2162
|
+
"translate-y": [{
|
|
2163
|
+
"translate-y": [translate]
|
|
2164
|
+
}],
|
|
2165
|
+
/**
|
|
2166
|
+
* Skew X
|
|
2167
|
+
* @see https://tailwindcss.com/docs/skew
|
|
2168
|
+
*/
|
|
2169
|
+
"skew-x": [{
|
|
2170
|
+
"skew-x": [skew]
|
|
2171
|
+
}],
|
|
2172
|
+
/**
|
|
2173
|
+
* Skew Y
|
|
2174
|
+
* @see https://tailwindcss.com/docs/skew
|
|
2175
|
+
*/
|
|
2176
|
+
"skew-y": [{
|
|
2177
|
+
"skew-y": [skew]
|
|
2178
|
+
}],
|
|
2179
|
+
/**
|
|
2180
|
+
* Transform Origin
|
|
2181
|
+
* @see https://tailwindcss.com/docs/transform-origin
|
|
2182
|
+
*/
|
|
2183
|
+
"transform-origin": [{
|
|
2184
|
+
origin: ["center", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", isArbitraryValue]
|
|
2185
|
+
}],
|
|
2186
|
+
// Interactivity
|
|
2187
|
+
/**
|
|
2188
|
+
* Accent Color
|
|
2189
|
+
* @see https://tailwindcss.com/docs/accent-color
|
|
2190
|
+
*/
|
|
2191
|
+
accent: [{
|
|
2192
|
+
accent: ["auto", colors]
|
|
2193
|
+
}],
|
|
2194
|
+
/**
|
|
2195
|
+
* Appearance
|
|
2196
|
+
* @see https://tailwindcss.com/docs/appearance
|
|
2197
|
+
*/
|
|
2198
|
+
appearance: [{
|
|
2199
|
+
appearance: ["none", "auto"]
|
|
2200
|
+
}],
|
|
2201
|
+
/**
|
|
2202
|
+
* Cursor
|
|
2203
|
+
* @see https://tailwindcss.com/docs/cursor
|
|
2204
|
+
*/
|
|
2205
|
+
cursor: [{
|
|
2206
|
+
cursor: ["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", isArbitraryValue]
|
|
2207
|
+
}],
|
|
2208
|
+
/**
|
|
2209
|
+
* Caret Color
|
|
2210
|
+
* @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
|
|
2211
|
+
*/
|
|
2212
|
+
"caret-color": [{
|
|
2213
|
+
caret: [colors]
|
|
2214
|
+
}],
|
|
2215
|
+
/**
|
|
2216
|
+
* Pointer Events
|
|
2217
|
+
* @see https://tailwindcss.com/docs/pointer-events
|
|
2218
|
+
*/
|
|
2219
|
+
"pointer-events": [{
|
|
2220
|
+
"pointer-events": ["none", "auto"]
|
|
2221
|
+
}],
|
|
2222
|
+
/**
|
|
2223
|
+
* Resize
|
|
2224
|
+
* @see https://tailwindcss.com/docs/resize
|
|
2225
|
+
*/
|
|
2226
|
+
resize: [{
|
|
2227
|
+
resize: ["none", "y", "x", ""]
|
|
2228
|
+
}],
|
|
2229
|
+
/**
|
|
2230
|
+
* Scroll Behavior
|
|
2231
|
+
* @see https://tailwindcss.com/docs/scroll-behavior
|
|
2232
|
+
*/
|
|
2233
|
+
"scroll-behavior": [{
|
|
2234
|
+
scroll: ["auto", "smooth"]
|
|
2235
|
+
}],
|
|
2236
|
+
/**
|
|
2237
|
+
* Scroll Margin
|
|
2238
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2239
|
+
*/
|
|
2240
|
+
"scroll-m": [{
|
|
2241
|
+
"scroll-m": getSpacingWithArbitrary()
|
|
2242
|
+
}],
|
|
2243
|
+
/**
|
|
2244
|
+
* Scroll Margin X
|
|
2245
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2246
|
+
*/
|
|
2247
|
+
"scroll-mx": [{
|
|
2248
|
+
"scroll-mx": getSpacingWithArbitrary()
|
|
2249
|
+
}],
|
|
2250
|
+
/**
|
|
2251
|
+
* Scroll Margin Y
|
|
2252
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2253
|
+
*/
|
|
2254
|
+
"scroll-my": [{
|
|
2255
|
+
"scroll-my": getSpacingWithArbitrary()
|
|
2256
|
+
}],
|
|
2257
|
+
/**
|
|
2258
|
+
* Scroll Margin Start
|
|
2259
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2260
|
+
*/
|
|
2261
|
+
"scroll-ms": [{
|
|
2262
|
+
"scroll-ms": getSpacingWithArbitrary()
|
|
2263
|
+
}],
|
|
2264
|
+
/**
|
|
2265
|
+
* Scroll Margin End
|
|
2266
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2267
|
+
*/
|
|
2268
|
+
"scroll-me": [{
|
|
2269
|
+
"scroll-me": getSpacingWithArbitrary()
|
|
2270
|
+
}],
|
|
2271
|
+
/**
|
|
2272
|
+
* Scroll Margin Top
|
|
2273
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2274
|
+
*/
|
|
2275
|
+
"scroll-mt": [{
|
|
2276
|
+
"scroll-mt": getSpacingWithArbitrary()
|
|
2277
|
+
}],
|
|
2278
|
+
/**
|
|
2279
|
+
* Scroll Margin Right
|
|
2280
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2281
|
+
*/
|
|
2282
|
+
"scroll-mr": [{
|
|
2283
|
+
"scroll-mr": getSpacingWithArbitrary()
|
|
2284
|
+
}],
|
|
2285
|
+
/**
|
|
2286
|
+
* Scroll Margin Bottom
|
|
2287
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2288
|
+
*/
|
|
2289
|
+
"scroll-mb": [{
|
|
2290
|
+
"scroll-mb": getSpacingWithArbitrary()
|
|
2291
|
+
}],
|
|
2292
|
+
/**
|
|
2293
|
+
* Scroll Margin Left
|
|
2294
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
2295
|
+
*/
|
|
2296
|
+
"scroll-ml": [{
|
|
2297
|
+
"scroll-ml": getSpacingWithArbitrary()
|
|
2298
|
+
}],
|
|
2299
|
+
/**
|
|
2300
|
+
* Scroll Padding
|
|
2301
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2302
|
+
*/
|
|
2303
|
+
"scroll-p": [{
|
|
2304
|
+
"scroll-p": getSpacingWithArbitrary()
|
|
2305
|
+
}],
|
|
2306
|
+
/**
|
|
2307
|
+
* Scroll Padding X
|
|
2308
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2309
|
+
*/
|
|
2310
|
+
"scroll-px": [{
|
|
2311
|
+
"scroll-px": getSpacingWithArbitrary()
|
|
2312
|
+
}],
|
|
2313
|
+
/**
|
|
2314
|
+
* Scroll Padding Y
|
|
2315
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2316
|
+
*/
|
|
2317
|
+
"scroll-py": [{
|
|
2318
|
+
"scroll-py": getSpacingWithArbitrary()
|
|
2319
|
+
}],
|
|
2320
|
+
/**
|
|
2321
|
+
* Scroll Padding Start
|
|
2322
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2323
|
+
*/
|
|
2324
|
+
"scroll-ps": [{
|
|
2325
|
+
"scroll-ps": getSpacingWithArbitrary()
|
|
2326
|
+
}],
|
|
2327
|
+
/**
|
|
2328
|
+
* Scroll Padding End
|
|
2329
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2330
|
+
*/
|
|
2331
|
+
"scroll-pe": [{
|
|
2332
|
+
"scroll-pe": getSpacingWithArbitrary()
|
|
2333
|
+
}],
|
|
2334
|
+
/**
|
|
2335
|
+
* Scroll Padding Top
|
|
2336
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2337
|
+
*/
|
|
2338
|
+
"scroll-pt": [{
|
|
2339
|
+
"scroll-pt": getSpacingWithArbitrary()
|
|
2340
|
+
}],
|
|
2341
|
+
/**
|
|
2342
|
+
* Scroll Padding Right
|
|
2343
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2344
|
+
*/
|
|
2345
|
+
"scroll-pr": [{
|
|
2346
|
+
"scroll-pr": getSpacingWithArbitrary()
|
|
2347
|
+
}],
|
|
2348
|
+
/**
|
|
2349
|
+
* Scroll Padding Bottom
|
|
2350
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2351
|
+
*/
|
|
2352
|
+
"scroll-pb": [{
|
|
2353
|
+
"scroll-pb": getSpacingWithArbitrary()
|
|
2354
|
+
}],
|
|
2355
|
+
/**
|
|
2356
|
+
* Scroll Padding Left
|
|
2357
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
2358
|
+
*/
|
|
2359
|
+
"scroll-pl": [{
|
|
2360
|
+
"scroll-pl": getSpacingWithArbitrary()
|
|
2361
|
+
}],
|
|
2362
|
+
/**
|
|
2363
|
+
* Scroll Snap Align
|
|
2364
|
+
* @see https://tailwindcss.com/docs/scroll-snap-align
|
|
2365
|
+
*/
|
|
2366
|
+
"snap-align": [{
|
|
2367
|
+
snap: ["start", "end", "center", "align-none"]
|
|
2368
|
+
}],
|
|
2369
|
+
/**
|
|
2370
|
+
* Scroll Snap Stop
|
|
2371
|
+
* @see https://tailwindcss.com/docs/scroll-snap-stop
|
|
2372
|
+
*/
|
|
2373
|
+
"snap-stop": [{
|
|
2374
|
+
snap: ["normal", "always"]
|
|
2375
|
+
}],
|
|
2376
|
+
/**
|
|
2377
|
+
* Scroll Snap Type
|
|
2378
|
+
* @see https://tailwindcss.com/docs/scroll-snap-type
|
|
2379
|
+
*/
|
|
2380
|
+
"snap-type": [{
|
|
2381
|
+
snap: ["none", "x", "y", "both"]
|
|
2382
|
+
}],
|
|
2383
|
+
/**
|
|
2384
|
+
* Scroll Snap Type Strictness
|
|
2385
|
+
* @see https://tailwindcss.com/docs/scroll-snap-type
|
|
2386
|
+
*/
|
|
2387
|
+
"snap-strictness": [{
|
|
2388
|
+
snap: ["mandatory", "proximity"]
|
|
2389
|
+
}],
|
|
2390
|
+
/**
|
|
2391
|
+
* Touch Action
|
|
2392
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
2393
|
+
*/
|
|
2394
|
+
touch: [{
|
|
2395
|
+
touch: ["auto", "none", "manipulation"]
|
|
2396
|
+
}],
|
|
2397
|
+
/**
|
|
2398
|
+
* Touch Action X
|
|
2399
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
2400
|
+
*/
|
|
2401
|
+
"touch-x": [{
|
|
2402
|
+
"touch-pan": ["x", "left", "right"]
|
|
2403
|
+
}],
|
|
2404
|
+
/**
|
|
2405
|
+
* Touch Action Y
|
|
2406
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
2407
|
+
*/
|
|
2408
|
+
"touch-y": [{
|
|
2409
|
+
"touch-pan": ["y", "up", "down"]
|
|
2410
|
+
}],
|
|
2411
|
+
/**
|
|
2412
|
+
* Touch Action Pinch Zoom
|
|
2413
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
2414
|
+
*/
|
|
2415
|
+
"touch-pz": ["touch-pinch-zoom"],
|
|
2416
|
+
/**
|
|
2417
|
+
* User Select
|
|
2418
|
+
* @see https://tailwindcss.com/docs/user-select
|
|
2419
|
+
*/
|
|
2420
|
+
select: [{
|
|
2421
|
+
select: ["none", "text", "all", "auto"]
|
|
2422
|
+
}],
|
|
2423
|
+
/**
|
|
2424
|
+
* Will Change
|
|
2425
|
+
* @see https://tailwindcss.com/docs/will-change
|
|
2426
|
+
*/
|
|
2427
|
+
"will-change": [{
|
|
2428
|
+
"will-change": ["auto", "scroll", "contents", "transform", isArbitraryValue]
|
|
2429
|
+
}],
|
|
2430
|
+
// SVG
|
|
2431
|
+
/**
|
|
2432
|
+
* Fill
|
|
2433
|
+
* @see https://tailwindcss.com/docs/fill
|
|
2434
|
+
*/
|
|
2435
|
+
fill: [{
|
|
2436
|
+
fill: [colors, "none"]
|
|
2437
|
+
}],
|
|
2438
|
+
/**
|
|
2439
|
+
* Stroke Width
|
|
2440
|
+
* @see https://tailwindcss.com/docs/stroke-width
|
|
2441
|
+
*/
|
|
2442
|
+
"stroke-w": [{
|
|
2443
|
+
stroke: [isLength, isArbitraryLength, isArbitraryNumber]
|
|
2444
|
+
}],
|
|
2445
|
+
/**
|
|
2446
|
+
* Stroke
|
|
2447
|
+
* @see https://tailwindcss.com/docs/stroke
|
|
2448
|
+
*/
|
|
2449
|
+
stroke: [{
|
|
2450
|
+
stroke: [colors, "none"]
|
|
2451
|
+
}],
|
|
2452
|
+
// Accessibility
|
|
2453
|
+
/**
|
|
2454
|
+
* Screen Readers
|
|
2455
|
+
* @see https://tailwindcss.com/docs/screen-readers
|
|
2456
|
+
*/
|
|
2457
|
+
sr: ["sr-only", "not-sr-only"],
|
|
2458
|
+
/**
|
|
2459
|
+
* Forced Color Adjust
|
|
2460
|
+
* @see https://tailwindcss.com/docs/forced-color-adjust
|
|
2461
|
+
*/
|
|
2462
|
+
"forced-color-adjust": [{
|
|
2463
|
+
"forced-color-adjust": ["auto", "none"]
|
|
2464
|
+
}]
|
|
2465
|
+
},
|
|
2466
|
+
conflictingClassGroups: {
|
|
2467
|
+
overflow: ["overflow-x", "overflow-y"],
|
|
2468
|
+
overscroll: ["overscroll-x", "overscroll-y"],
|
|
2469
|
+
inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"],
|
|
2470
|
+
"inset-x": ["right", "left"],
|
|
2471
|
+
"inset-y": ["top", "bottom"],
|
|
2472
|
+
flex: ["basis", "grow", "shrink"],
|
|
2473
|
+
gap: ["gap-x", "gap-y"],
|
|
2474
|
+
p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"],
|
|
2475
|
+
px: ["pr", "pl"],
|
|
2476
|
+
py: ["pt", "pb"],
|
|
2477
|
+
m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"],
|
|
2478
|
+
mx: ["mr", "ml"],
|
|
2479
|
+
my: ["mt", "mb"],
|
|
2480
|
+
size: ["w", "h"],
|
|
2481
|
+
"font-size": ["leading"],
|
|
2482
|
+
"fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"],
|
|
2483
|
+
"fvn-ordinal": ["fvn-normal"],
|
|
2484
|
+
"fvn-slashed-zero": ["fvn-normal"],
|
|
2485
|
+
"fvn-figure": ["fvn-normal"],
|
|
2486
|
+
"fvn-spacing": ["fvn-normal"],
|
|
2487
|
+
"fvn-fraction": ["fvn-normal"],
|
|
2488
|
+
"line-clamp": ["display", "overflow"],
|
|
2489
|
+
rounded: ["rounded-s", "rounded-e", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-ss", "rounded-se", "rounded-ee", "rounded-es", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl"],
|
|
2490
|
+
"rounded-s": ["rounded-ss", "rounded-es"],
|
|
2491
|
+
"rounded-e": ["rounded-se", "rounded-ee"],
|
|
2492
|
+
"rounded-t": ["rounded-tl", "rounded-tr"],
|
|
2493
|
+
"rounded-r": ["rounded-tr", "rounded-br"],
|
|
2494
|
+
"rounded-b": ["rounded-br", "rounded-bl"],
|
|
2495
|
+
"rounded-l": ["rounded-tl", "rounded-bl"],
|
|
2496
|
+
"border-spacing": ["border-spacing-x", "border-spacing-y"],
|
|
2497
|
+
"border-w": ["border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
|
|
2498
|
+
"border-w-x": ["border-w-r", "border-w-l"],
|
|
2499
|
+
"border-w-y": ["border-w-t", "border-w-b"],
|
|
2500
|
+
"border-color": ["border-color-s", "border-color-e", "border-color-t", "border-color-r", "border-color-b", "border-color-l"],
|
|
2501
|
+
"border-color-x": ["border-color-r", "border-color-l"],
|
|
2502
|
+
"border-color-y": ["border-color-t", "border-color-b"],
|
|
2503
|
+
"scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
|
|
2504
|
+
"scroll-mx": ["scroll-mr", "scroll-ml"],
|
|
2505
|
+
"scroll-my": ["scroll-mt", "scroll-mb"],
|
|
2506
|
+
"scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"],
|
|
2507
|
+
"scroll-px": ["scroll-pr", "scroll-pl"],
|
|
2508
|
+
"scroll-py": ["scroll-pt", "scroll-pb"],
|
|
2509
|
+
touch: ["touch-x", "touch-y", "touch-pz"],
|
|
2510
|
+
"touch-x": ["touch"],
|
|
2511
|
+
"touch-y": ["touch"],
|
|
2512
|
+
"touch-pz": ["touch"]
|
|
2513
|
+
},
|
|
2514
|
+
conflictingClassGroupModifiers: {
|
|
2515
|
+
"font-size": ["leading"]
|
|
2516
|
+
}
|
|
2517
|
+
};
|
|
2518
|
+
};
|
|
2519
|
+
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
2520
|
+
|
|
2521
|
+
// src/libraries/react/lib/utils.ts
|
|
2522
|
+
function cn(...inputs) {
|
|
2523
|
+
return twMerge(clsx(inputs));
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
// src/libraries/react/components/ui/button.tsx
|
|
2527
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
2528
|
+
|
|
2529
|
+
// ../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
2530
|
+
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
2531
|
+
var cx = clsx;
|
|
2532
|
+
var cva = (base, config) => (props) => {
|
|
2533
|
+
var _config_compoundVariants;
|
|
2534
|
+
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
2535
|
+
const { variants, defaultVariants } = config;
|
|
2536
|
+
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
2537
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
2538
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
2539
|
+
if (variantProp === null) return null;
|
|
2540
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
2541
|
+
return variants[variant][variantKey];
|
|
2542
|
+
});
|
|
2543
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
2544
|
+
let [key, value] = param;
|
|
2545
|
+
if (value === void 0) {
|
|
2546
|
+
return acc;
|
|
2547
|
+
}
|
|
2548
|
+
acc[key] = value;
|
|
2549
|
+
return acc;
|
|
2550
|
+
}, {});
|
|
2551
|
+
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
2552
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
2553
|
+
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
2554
|
+
let [key, value] = param2;
|
|
2555
|
+
return Array.isArray(value) ? value.includes({
|
|
2556
|
+
...defaultVariants,
|
|
2557
|
+
...propsWithoutUndefined
|
|
2558
|
+
}[key]) : {
|
|
2559
|
+
...defaultVariants,
|
|
2560
|
+
...propsWithoutUndefined
|
|
2561
|
+
}[key] === value;
|
|
2562
|
+
}) ? [
|
|
2563
|
+
...acc,
|
|
2564
|
+
cvClass,
|
|
2565
|
+
cvClassName
|
|
2566
|
+
] : acc;
|
|
2567
|
+
}, []);
|
|
2568
|
+
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
2569
|
+
};
|
|
2570
|
+
|
|
2571
|
+
// src/libraries/react/components/ui/button.tsx
|
|
2572
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
2573
|
+
var buttonVariants = cva(
|
|
2574
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
2575
|
+
{
|
|
2576
|
+
variants: {
|
|
2577
|
+
variant: {
|
|
2578
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
2579
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/90",
|
|
2580
|
+
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
2581
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
2582
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
2583
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
2584
|
+
},
|
|
2585
|
+
size: {
|
|
2586
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
2587
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
2588
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
2589
|
+
icon: "size-9"
|
|
2590
|
+
}
|
|
2591
|
+
},
|
|
2592
|
+
defaultVariants: {
|
|
2593
|
+
variant: "default",
|
|
2594
|
+
size: "default"
|
|
2595
|
+
}
|
|
2596
|
+
}
|
|
2597
|
+
);
|
|
2598
|
+
function Button({
|
|
2599
|
+
className,
|
|
2600
|
+
variant,
|
|
2601
|
+
size,
|
|
2602
|
+
asChild = false,
|
|
2603
|
+
...props
|
|
2604
|
+
}) {
|
|
2605
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
2606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
2607
|
+
Comp,
|
|
2608
|
+
{
|
|
2609
|
+
"data-slot": "button",
|
|
2610
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
2611
|
+
...props
|
|
2612
|
+
}
|
|
2613
|
+
);
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
2617
|
+
var import_react2 = require("react");
|
|
2618
|
+
|
|
2619
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
2620
|
+
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2621
|
+
var toCamelCase = (string) => string.replace(
|
|
2622
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
2623
|
+
(match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
|
|
2624
|
+
);
|
|
2625
|
+
var toPascalCase = (string) => {
|
|
2626
|
+
const camelCase = toCamelCase(string);
|
|
2627
|
+
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
2628
|
+
};
|
|
2629
|
+
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
2630
|
+
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
2631
|
+
}).join(" ").trim();
|
|
2632
|
+
var hasA11yProp = (props) => {
|
|
2633
|
+
for (const prop in props) {
|
|
2634
|
+
if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
|
|
2635
|
+
return true;
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
};
|
|
2639
|
+
|
|
2640
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
|
2641
|
+
var import_react = require("react");
|
|
2642
|
+
|
|
2643
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
2644
|
+
var defaultAttributes = {
|
|
2645
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2646
|
+
width: 24,
|
|
2647
|
+
height: 24,
|
|
2648
|
+
viewBox: "0 0 24 24",
|
|
2649
|
+
fill: "none",
|
|
2650
|
+
stroke: "currentColor",
|
|
2651
|
+
strokeWidth: 2,
|
|
2652
|
+
strokeLinecap: "round",
|
|
2653
|
+
strokeLinejoin: "round"
|
|
2654
|
+
};
|
|
2655
|
+
|
|
2656
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
|
2657
|
+
var Icon = (0, import_react.forwardRef)(
|
|
2658
|
+
({
|
|
2659
|
+
color = "currentColor",
|
|
2660
|
+
size = 24,
|
|
2661
|
+
strokeWidth = 2,
|
|
2662
|
+
absoluteStrokeWidth,
|
|
2663
|
+
className = "",
|
|
2664
|
+
children,
|
|
2665
|
+
iconNode,
|
|
2666
|
+
...rest
|
|
2667
|
+
}, ref) => (0, import_react.createElement)(
|
|
2668
|
+
"svg",
|
|
2669
|
+
{
|
|
2670
|
+
ref,
|
|
2671
|
+
...defaultAttributes,
|
|
2672
|
+
width: size,
|
|
2673
|
+
height: size,
|
|
2674
|
+
stroke: color,
|
|
2675
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
2676
|
+
className: mergeClasses("lucide", className),
|
|
2677
|
+
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
2678
|
+
...rest
|
|
2679
|
+
},
|
|
2680
|
+
[
|
|
2681
|
+
...iconNode.map(([tag, attrs]) => (0, import_react.createElement)(tag, attrs)),
|
|
2682
|
+
...Array.isArray(children) ? children : [children]
|
|
2683
|
+
]
|
|
2684
|
+
)
|
|
2685
|
+
);
|
|
2686
|
+
|
|
2687
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
2688
|
+
var createLucideIcon = (iconName, iconNode) => {
|
|
2689
|
+
const Component = (0, import_react2.forwardRef)(
|
|
2690
|
+
({ className, ...props }, ref) => (0, import_react2.createElement)(Icon, {
|
|
2691
|
+
ref,
|
|
2692
|
+
iconNode,
|
|
2693
|
+
className: mergeClasses(
|
|
2694
|
+
`lucide-${toKebabCase(toPascalCase(iconName))}`,
|
|
2695
|
+
`lucide-${iconName}`,
|
|
2696
|
+
className
|
|
2697
|
+
),
|
|
2698
|
+
...props
|
|
2699
|
+
})
|
|
2700
|
+
);
|
|
2701
|
+
Component.displayName = toPascalCase(iconName);
|
|
2702
|
+
return Component;
|
|
2703
|
+
};
|
|
2704
|
+
|
|
2705
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/arrow-right.js
|
|
2706
|
+
var __iconNode = [
|
|
2707
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
2708
|
+
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
2709
|
+
];
|
|
2710
|
+
var ArrowRight = createLucideIcon("arrow-right", __iconNode);
|
|
2711
|
+
|
|
2712
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/loader-circle.js
|
|
2713
|
+
var __iconNode2 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
2714
|
+
var LoaderCircle = createLucideIcon("loader-circle", __iconNode2);
|
|
2715
|
+
|
|
2716
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/x.js
|
|
2717
|
+
var __iconNode3 = [
|
|
2718
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
2719
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
2720
|
+
];
|
|
2721
|
+
var X = createLucideIcon("x", __iconNode3);
|
|
2722
|
+
|
|
2723
|
+
// src/libraries/react/components/ui/dialog.tsx
|
|
2724
|
+
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
2725
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
2726
|
+
function Dialog({
|
|
2727
|
+
...props
|
|
2728
|
+
}) {
|
|
2729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
2730
|
+
}
|
|
2731
|
+
function DialogPortal({
|
|
2732
|
+
...props
|
|
2733
|
+
}) {
|
|
2734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
2735
|
+
}
|
|
2736
|
+
function DialogOverlay({
|
|
2737
|
+
className,
|
|
2738
|
+
...props
|
|
2739
|
+
}) {
|
|
2740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
2741
|
+
DialogPrimitive.Overlay,
|
|
2742
|
+
{
|
|
2743
|
+
"data-slot": "dialog-overlay",
|
|
2744
|
+
className: cn(
|
|
2745
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
2746
|
+
className
|
|
2747
|
+
),
|
|
2748
|
+
...props
|
|
2749
|
+
}
|
|
2750
|
+
);
|
|
2751
|
+
}
|
|
2752
|
+
function DialogContent({
|
|
2753
|
+
className,
|
|
2754
|
+
children,
|
|
2755
|
+
showCloseButton = true,
|
|
2756
|
+
...props
|
|
2757
|
+
}) {
|
|
2758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
2759
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DialogOverlay, {}),
|
|
2760
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2761
|
+
DialogPrimitive.Content,
|
|
2762
|
+
{
|
|
2763
|
+
"data-slot": "dialog-content",
|
|
2764
|
+
className: cn(
|
|
2765
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
2766
|
+
className
|
|
2767
|
+
),
|
|
2768
|
+
...props,
|
|
2769
|
+
children: [
|
|
2770
|
+
children,
|
|
2771
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2772
|
+
DialogPrimitive.Close,
|
|
2773
|
+
{
|
|
2774
|
+
"data-slot": "dialog-close",
|
|
2775
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
2776
|
+
children: [
|
|
2777
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(X, {}),
|
|
2778
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "sr-only", children: "Close" })
|
|
2779
|
+
]
|
|
2780
|
+
}
|
|
2781
|
+
)
|
|
2782
|
+
]
|
|
2783
|
+
}
|
|
2784
|
+
)
|
|
2785
|
+
] });
|
|
2786
|
+
}
|
|
2787
|
+
function DialogFooter({ className, ...props }) {
|
|
2788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
2789
|
+
"div",
|
|
2790
|
+
{
|
|
2791
|
+
"data-slot": "dialog-footer",
|
|
2792
|
+
className: cn(
|
|
2793
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
2794
|
+
className
|
|
2795
|
+
),
|
|
2796
|
+
...props
|
|
2797
|
+
}
|
|
2798
|
+
);
|
|
2799
|
+
}
|
|
2800
|
+
function DialogTitle({
|
|
2801
|
+
className,
|
|
2802
|
+
...props
|
|
2803
|
+
}) {
|
|
2804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
2805
|
+
DialogPrimitive.Title,
|
|
2806
|
+
{
|
|
2807
|
+
"data-slot": "dialog-title",
|
|
2808
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
2809
|
+
...props
|
|
2810
|
+
}
|
|
2811
|
+
);
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
// src/libraries/react/components/attach-dialog/lib/attach-content.tsx
|
|
2815
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
2816
|
+
var getAttachContent = (preview) => {
|
|
2817
|
+
const {
|
|
2818
|
+
scenario,
|
|
2819
|
+
product_name,
|
|
2820
|
+
recurring,
|
|
2821
|
+
current_product_name,
|
|
2822
|
+
next_cycle_at
|
|
2823
|
+
} = preview;
|
|
2824
|
+
const nextCycleAtStr = next_cycle_at ? new Date(next_cycle_at).toLocaleDateString() : void 0;
|
|
2825
|
+
switch (scenario) {
|
|
2826
|
+
case "scheduled":
|
|
2827
|
+
return {
|
|
2828
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
2829
|
+
product_name,
|
|
2830
|
+
" product already scheduled"
|
|
2831
|
+
] }),
|
|
2832
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
2833
|
+
"You are currently on product ",
|
|
2834
|
+
current_product_name,
|
|
2835
|
+
" and are scheduled to start ",
|
|
2836
|
+
product_name,
|
|
2837
|
+
" on ",
|
|
2838
|
+
nextCycleAtStr,
|
|
2839
|
+
"."
|
|
2840
|
+
] })
|
|
2841
|
+
};
|
|
2842
|
+
case "active":
|
|
2843
|
+
return {
|
|
2844
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: "Product already active" }),
|
|
2845
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: "You are already subscribed to this product." })
|
|
2846
|
+
};
|
|
2847
|
+
case "new":
|
|
2848
|
+
if (recurring) {
|
|
2849
|
+
return {
|
|
2850
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
2851
|
+
"Subscribe to ",
|
|
2852
|
+
product_name
|
|
2853
|
+
] }),
|
|
2854
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
2855
|
+
"By clicking confirm, you will be subscribed to ",
|
|
2856
|
+
product_name,
|
|
2857
|
+
" and your card will be charged immediately."
|
|
2858
|
+
] })
|
|
2859
|
+
};
|
|
2860
|
+
} else {
|
|
2861
|
+
return {
|
|
2862
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
2863
|
+
"Purchase ",
|
|
2864
|
+
product_name
|
|
2865
|
+
] }),
|
|
2866
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
2867
|
+
"By clicking confirm, you will purchase ",
|
|
2868
|
+
product_name,
|
|
2869
|
+
" and your card will be charged immediately."
|
|
2870
|
+
] })
|
|
2871
|
+
};
|
|
2872
|
+
}
|
|
2873
|
+
case "renew":
|
|
2874
|
+
return {
|
|
2875
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: "Renew" }),
|
|
2876
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
2877
|
+
"By clicking confirm, you will renew your subscription to",
|
|
2878
|
+
" ",
|
|
2879
|
+
product_name,
|
|
2880
|
+
"."
|
|
2881
|
+
] })
|
|
2882
|
+
};
|
|
2883
|
+
case "upgrade":
|
|
2884
|
+
return {
|
|
2885
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
2886
|
+
"Upgrade to ",
|
|
2887
|
+
product_name
|
|
2888
|
+
] }),
|
|
2889
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
2890
|
+
"By clicking confirm, you will upgrade to ",
|
|
2891
|
+
product_name,
|
|
2892
|
+
" and your payment method will be charged immediately."
|
|
2893
|
+
] })
|
|
2894
|
+
};
|
|
2895
|
+
case "downgrade":
|
|
2896
|
+
return {
|
|
2897
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
2898
|
+
"Downgrade to ",
|
|
2899
|
+
product_name
|
|
2900
|
+
] }),
|
|
2901
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
2902
|
+
"By clicking confirm, your current subscription to",
|
|
2903
|
+
" ",
|
|
2904
|
+
current_product_name,
|
|
2905
|
+
" will be cancelled and a new subscription to",
|
|
2906
|
+
" ",
|
|
2907
|
+
product_name,
|
|
2908
|
+
" will begin on ",
|
|
2909
|
+
nextCycleAtStr,
|
|
2910
|
+
"."
|
|
2911
|
+
] })
|
|
2912
|
+
};
|
|
2913
|
+
case "cancel":
|
|
2914
|
+
return {
|
|
2915
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: "Cancel" }),
|
|
2916
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { children: [
|
|
2917
|
+
"By clicking confirm, your subscription to ",
|
|
2918
|
+
current_product_name,
|
|
2919
|
+
" ",
|
|
2920
|
+
"will end on ",
|
|
2921
|
+
nextCycleAtStr,
|
|
2922
|
+
"."
|
|
2923
|
+
] })
|
|
2924
|
+
};
|
|
2925
|
+
default:
|
|
2926
|
+
return {
|
|
2927
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: "Change Subscription" }),
|
|
2928
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: "You are about to change your subscription." })
|
|
2929
|
+
};
|
|
2930
|
+
}
|
|
2931
|
+
};
|
|
2932
|
+
|
|
2933
|
+
// src/libraries/react/BaseAutumnProvider.tsx
|
|
2934
|
+
var import_react5 = require("react");
|
|
2935
|
+
|
|
2936
|
+
// src/libraries/react/hooks/useDialog.tsx
|
|
2937
|
+
var import_react3 = require("react");
|
|
2938
|
+
|
|
2939
|
+
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
2940
|
+
var import_swr2 = __toESM(require("swr"));
|
|
2941
|
+
|
|
2942
|
+
// src/sdk/error.ts
|
|
2943
|
+
var AutumnError = class _AutumnError extends Error {
|
|
2944
|
+
message;
|
|
2945
|
+
code;
|
|
2946
|
+
constructor(response) {
|
|
2947
|
+
super(response.message);
|
|
2948
|
+
this.message = response.message;
|
|
2949
|
+
this.code = response.code;
|
|
2950
|
+
}
|
|
2951
|
+
static fromError(error) {
|
|
2952
|
+
return new _AutumnError({
|
|
2953
|
+
message: error.message || "Unknown error",
|
|
2954
|
+
code: error.code || "unknown_error"
|
|
2955
|
+
});
|
|
2956
|
+
}
|
|
2957
|
+
toString() {
|
|
2958
|
+
return `${this.message} (code: ${this.code})`;
|
|
2959
|
+
}
|
|
2960
|
+
toJSON() {
|
|
2961
|
+
return {
|
|
2962
|
+
message: this.message,
|
|
2963
|
+
code: this.code
|
|
2964
|
+
};
|
|
2965
|
+
}
|
|
2966
|
+
};
|
|
2967
|
+
|
|
2968
|
+
// src/sdk/general/genMethods.ts
|
|
2969
|
+
var handleAttach = async ({
|
|
2970
|
+
instance,
|
|
2971
|
+
params
|
|
2972
|
+
}) => {
|
|
2973
|
+
return instance.post("/attach", params);
|
|
2974
|
+
};
|
|
2975
|
+
var handleCancel = async ({
|
|
2976
|
+
instance,
|
|
2977
|
+
params
|
|
2978
|
+
}) => {
|
|
2979
|
+
return instance.post("/cancel", params);
|
|
2980
|
+
};
|
|
2981
|
+
var handleEntitled = async ({
|
|
2982
|
+
instance,
|
|
2983
|
+
params
|
|
2984
|
+
}) => {
|
|
2985
|
+
return instance.post("/entitled", params);
|
|
2986
|
+
};
|
|
2987
|
+
var handleEvent = async ({
|
|
2988
|
+
instance,
|
|
2989
|
+
params
|
|
2990
|
+
}) => {
|
|
2991
|
+
return instance.post("/events", params);
|
|
2992
|
+
};
|
|
2993
|
+
var handleTrack = async ({
|
|
2994
|
+
instance,
|
|
2995
|
+
params
|
|
2996
|
+
}) => {
|
|
2997
|
+
return instance.post("/track", params);
|
|
2998
|
+
};
|
|
2999
|
+
var handleUsage = async ({
|
|
3000
|
+
instance,
|
|
3001
|
+
params
|
|
3002
|
+
}) => {
|
|
3003
|
+
return instance.post("/usage", params);
|
|
3004
|
+
};
|
|
3005
|
+
var handleCheck = async ({
|
|
3006
|
+
instance,
|
|
3007
|
+
params
|
|
3008
|
+
}) => {
|
|
3009
|
+
return instance.post("/check", params);
|
|
3010
|
+
};
|
|
3011
|
+
|
|
3012
|
+
// src/libraries/backend/constants.ts
|
|
3013
|
+
var autumnApiUrl = "https://api.useautumn.com/v1";
|
|
3014
|
+
|
|
3015
|
+
// src/sdk/utils.ts
|
|
3016
|
+
var staticWrapper = (callback, instance, args) => {
|
|
3017
|
+
if (!instance) {
|
|
3018
|
+
instance = new Autumn();
|
|
3019
|
+
}
|
|
3020
|
+
return callback({ instance, ...args });
|
|
3021
|
+
};
|
|
3022
|
+
|
|
3023
|
+
// src/sdk/customers/cusMethods.ts
|
|
3024
|
+
var customerMethods = (instance) => {
|
|
3025
|
+
return {
|
|
3026
|
+
get: (id, params) => staticWrapper(getCustomer, instance, { id, params }),
|
|
3027
|
+
create: (params) => staticWrapper(createCustomer, instance, { params }),
|
|
3028
|
+
update: (id, params) => staticWrapper(updateCustomer, instance, { id, params }),
|
|
3029
|
+
delete: (id) => staticWrapper(deleteCustomer, instance, { id }),
|
|
3030
|
+
billingPortal: (id, params) => staticWrapper(billingPortal, instance, { id, params })
|
|
3031
|
+
};
|
|
3032
|
+
};
|
|
3033
|
+
var getExpandStr = (expand) => {
|
|
3034
|
+
if (!expand) {
|
|
3035
|
+
return "";
|
|
3036
|
+
}
|
|
3037
|
+
return `expand=${expand.join(",")}`;
|
|
3038
|
+
};
|
|
3039
|
+
var getCustomer = async ({
|
|
3040
|
+
instance,
|
|
3041
|
+
id,
|
|
3042
|
+
params
|
|
3043
|
+
}) => {
|
|
3044
|
+
if (!id) {
|
|
3045
|
+
return {
|
|
3046
|
+
data: null,
|
|
3047
|
+
error: new AutumnError({
|
|
3048
|
+
message: "Customer ID is required",
|
|
3049
|
+
code: "CUSTOMER_ID_REQUIRED"
|
|
3050
|
+
})
|
|
3051
|
+
};
|
|
3052
|
+
}
|
|
3053
|
+
return instance.get(`/customers/${id}?${getExpandStr(params?.expand)}`);
|
|
3054
|
+
};
|
|
3055
|
+
var createCustomer = async ({
|
|
3056
|
+
instance,
|
|
3057
|
+
params
|
|
3058
|
+
}) => {
|
|
3059
|
+
return instance.post(`/customers?${getExpandStr(params?.expand)}`, params);
|
|
3060
|
+
};
|
|
3061
|
+
var updateCustomer = async ({
|
|
3062
|
+
instance,
|
|
3063
|
+
id,
|
|
3064
|
+
params
|
|
3065
|
+
}) => {
|
|
3066
|
+
return instance.post(`/customers/${id}`, params);
|
|
3067
|
+
};
|
|
3068
|
+
var deleteCustomer = async ({
|
|
3069
|
+
instance,
|
|
3070
|
+
id
|
|
3071
|
+
}) => {
|
|
3072
|
+
return instance.delete(`/customers/${id}`);
|
|
3073
|
+
};
|
|
3074
|
+
var billingPortal = async ({
|
|
3075
|
+
instance,
|
|
3076
|
+
id,
|
|
3077
|
+
params
|
|
3078
|
+
}) => {
|
|
3079
|
+
return instance.post(`/customers/${id}/billing_portal`, params);
|
|
3080
|
+
};
|
|
3081
|
+
|
|
3082
|
+
// src/sdk/customers/entities/entMethods.ts
|
|
3083
|
+
var entityMethods = (instance) => {
|
|
3084
|
+
return {
|
|
3085
|
+
get: (customer_id, entity_id, params) => staticWrapper(getEntity, instance, {
|
|
3086
|
+
customer_id,
|
|
3087
|
+
entity_id,
|
|
3088
|
+
params
|
|
3089
|
+
}),
|
|
3090
|
+
create: (customer_id, params) => staticWrapper(createEntity, instance, { customer_id, params }),
|
|
3091
|
+
delete: (customer_id, entity_id) => staticWrapper(deleteEntity, instance, { customer_id, entity_id })
|
|
3092
|
+
};
|
|
3093
|
+
};
|
|
3094
|
+
var getExpandStr2 = (expand) => {
|
|
3095
|
+
if (!expand) {
|
|
3096
|
+
return "";
|
|
3097
|
+
}
|
|
3098
|
+
return `expand=${expand.join(",")}`;
|
|
3099
|
+
};
|
|
3100
|
+
var getEntity = async ({
|
|
3101
|
+
instance,
|
|
3102
|
+
customer_id,
|
|
3103
|
+
entity_id,
|
|
3104
|
+
params
|
|
3105
|
+
}) => {
|
|
3106
|
+
return instance.get(
|
|
3107
|
+
`/customers/${customer_id}/entities/${entity_id}?${getExpandStr2(
|
|
3108
|
+
params?.expand
|
|
3109
|
+
)}`
|
|
3110
|
+
);
|
|
3111
|
+
};
|
|
3112
|
+
var createEntity = async ({
|
|
3113
|
+
instance,
|
|
3114
|
+
customer_id,
|
|
3115
|
+
params
|
|
3116
|
+
}) => {
|
|
3117
|
+
return instance.post(`/customers/${customer_id}/entities`, params);
|
|
3118
|
+
};
|
|
3119
|
+
var deleteEntity = async ({
|
|
3120
|
+
instance,
|
|
3121
|
+
customer_id,
|
|
3122
|
+
entity_id
|
|
3123
|
+
}) => {
|
|
3124
|
+
return instance.delete(`/customers/${customer_id}/entities/${entity_id}`);
|
|
3125
|
+
};
|
|
3126
|
+
|
|
3127
|
+
// src/sdk/products/prodMethods.ts
|
|
3128
|
+
var productMethods = (instance) => {
|
|
3129
|
+
return {
|
|
3130
|
+
get: (id) => staticWrapper(getProduct, instance, { id }),
|
|
3131
|
+
create: (params) => staticWrapper(createProduct, instance, { params }),
|
|
3132
|
+
list: (params) => staticWrapper(listProducts, instance, { params })
|
|
3133
|
+
};
|
|
3134
|
+
};
|
|
3135
|
+
var listProducts = async ({
|
|
3136
|
+
instance,
|
|
3137
|
+
params
|
|
3138
|
+
}) => {
|
|
3139
|
+
let path = "/products_beta";
|
|
3140
|
+
if (params) {
|
|
3141
|
+
const queryParams = new URLSearchParams();
|
|
3142
|
+
for (const [key, value] of Object.entries(params)) {
|
|
3143
|
+
if (value !== void 0) {
|
|
3144
|
+
queryParams.append(key, String(value));
|
|
3145
|
+
}
|
|
3146
|
+
}
|
|
3147
|
+
const queryString = queryParams.toString();
|
|
3148
|
+
if (queryString) {
|
|
3149
|
+
path += `?${queryString}`;
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
3152
|
+
return instance.get(path);
|
|
3153
|
+
};
|
|
3154
|
+
var getProduct = async ({
|
|
3155
|
+
instance,
|
|
3156
|
+
id
|
|
3157
|
+
}) => {
|
|
3158
|
+
return instance.get(`/products/${id}`);
|
|
3159
|
+
};
|
|
3160
|
+
var createProduct = async ({
|
|
3161
|
+
instance,
|
|
3162
|
+
params
|
|
3163
|
+
}) => {
|
|
3164
|
+
return instance.post("/products", params);
|
|
3165
|
+
};
|
|
3166
|
+
|
|
3167
|
+
// src/sdk/referrals/referralMethods.ts
|
|
3168
|
+
var referralMethods = (instance) => {
|
|
3169
|
+
return {
|
|
3170
|
+
createCode: (params) => staticWrapper(createReferralCode, instance, { params }),
|
|
3171
|
+
redeemCode: (params) => staticWrapper(redeemReferralCode, instance, { params })
|
|
3172
|
+
};
|
|
3173
|
+
};
|
|
3174
|
+
var createReferralCode = async ({
|
|
3175
|
+
instance,
|
|
3176
|
+
params
|
|
3177
|
+
}) => {
|
|
3178
|
+
return instance.post("/referrals/code", params);
|
|
3179
|
+
};
|
|
3180
|
+
var redeemReferralCode = async ({
|
|
3181
|
+
instance,
|
|
3182
|
+
params
|
|
3183
|
+
}) => {
|
|
3184
|
+
return instance.post("/referrals/redeem", params);
|
|
3185
|
+
};
|
|
3186
|
+
|
|
3187
|
+
// src/sdk/response.ts
|
|
3188
|
+
var toContainerResult = async ({ response, logger: logger2 }) => {
|
|
3189
|
+
if (response.status < 200 || response.status >= 300) {
|
|
3190
|
+
let error;
|
|
3191
|
+
try {
|
|
3192
|
+
error = await response.json();
|
|
3193
|
+
logger2.error(`[Autumn] ${error.message}`);
|
|
3194
|
+
} catch (error2) {
|
|
3195
|
+
throw error2;
|
|
3196
|
+
return {
|
|
3197
|
+
data: null,
|
|
3198
|
+
error: new AutumnError({
|
|
3199
|
+
message: "Failed to parse JSON response from Autumn",
|
|
3200
|
+
code: "internal_error"
|
|
3201
|
+
}),
|
|
3202
|
+
statusCode: response.status
|
|
3203
|
+
};
|
|
3204
|
+
}
|
|
3205
|
+
return {
|
|
3206
|
+
data: null,
|
|
3207
|
+
error: new AutumnError({
|
|
3208
|
+
message: error.message,
|
|
3209
|
+
code: error.code
|
|
3210
|
+
}),
|
|
3211
|
+
statusCode: response.status
|
|
3212
|
+
};
|
|
3213
|
+
}
|
|
3214
|
+
try {
|
|
3215
|
+
let data = await response.json();
|
|
3216
|
+
return {
|
|
3217
|
+
data,
|
|
3218
|
+
error: null,
|
|
3219
|
+
statusCode: response?.status
|
|
3220
|
+
};
|
|
3221
|
+
} catch (error) {
|
|
3222
|
+
throw error;
|
|
3223
|
+
return {
|
|
3224
|
+
data: null,
|
|
3225
|
+
error: new AutumnError({
|
|
3226
|
+
message: "Failed to parse Autumn API response",
|
|
3227
|
+
code: "internal_error"
|
|
3228
|
+
}),
|
|
3229
|
+
statusCode: response?.status
|
|
3230
|
+
};
|
|
3231
|
+
}
|
|
3232
|
+
};
|
|
3233
|
+
|
|
3234
|
+
// src/utils/logger.ts
|
|
3235
|
+
var import_chalk = __toESM(require("chalk"));
|
|
3236
|
+
var getTime = () => {
|
|
3237
|
+
let timeString = (/* @__PURE__ */ new Date()).toISOString();
|
|
3238
|
+
return `[${timeString.split("T")[1].split(".")[0]}]`;
|
|
3239
|
+
};
|
|
3240
|
+
var greaterThanLevel = (level) => {
|
|
3241
|
+
return levels.indexOf(level) >= levels.indexOf(logger.level);
|
|
3242
|
+
};
|
|
3243
|
+
var levels = ["debug", "info", "warn", "error", "fatal"];
|
|
3244
|
+
var logger = {
|
|
3245
|
+
...console,
|
|
3246
|
+
level: "info",
|
|
3247
|
+
debug: (...args) => {
|
|
3248
|
+
if (greaterThanLevel("debug")) {
|
|
3249
|
+
console.log(getTime(), import_chalk.default.gray("DEBUG"), ...args);
|
|
3250
|
+
}
|
|
3251
|
+
},
|
|
3252
|
+
log: (...args) => {
|
|
3253
|
+
console.log(getTime(), import_chalk.default.blue("INFO"), ...args);
|
|
3254
|
+
},
|
|
3255
|
+
info: (...args) => {
|
|
3256
|
+
if (greaterThanLevel("info")) {
|
|
3257
|
+
console.log(getTime(), import_chalk.default.blue("INFO"), ...args);
|
|
3258
|
+
}
|
|
3259
|
+
},
|
|
3260
|
+
warn: (...args) => {
|
|
3261
|
+
if (greaterThanLevel("warn")) {
|
|
3262
|
+
console.log(getTime(), import_chalk.default.yellow("WARN"), ...args);
|
|
3263
|
+
}
|
|
3264
|
+
},
|
|
3265
|
+
error: (...args) => {
|
|
3266
|
+
if (greaterThanLevel("error")) {
|
|
3267
|
+
console.log(getTime(), import_chalk.default.red("ERROR"), ...args);
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3270
|
+
};
|
|
3271
|
+
|
|
3272
|
+
// src/sdk/client.ts
|
|
3273
|
+
var LATEST_API_VERSION = "1.2";
|
|
3274
|
+
var Autumn = class {
|
|
3275
|
+
secretKey;
|
|
3276
|
+
publishableKey;
|
|
3277
|
+
headers;
|
|
3278
|
+
url;
|
|
3279
|
+
logger = console;
|
|
3280
|
+
constructor(options) {
|
|
3281
|
+
try {
|
|
3282
|
+
this.secretKey = options?.secretKey || process.env.AUTUMN_SECRET_KEY;
|
|
3283
|
+
this.publishableKey = options?.publishableKey || process.env.AUTUMN_PUBLISHABLE_KEY;
|
|
3284
|
+
} catch (error) {
|
|
3285
|
+
}
|
|
3286
|
+
if (!this.secretKey && !this.publishableKey && !options?.headers) {
|
|
3287
|
+
throw new Error("Autumn secret key or publishable key is required");
|
|
3288
|
+
}
|
|
3289
|
+
this.headers = options?.headers || {
|
|
3290
|
+
Authorization: `Bearer ${this.secretKey || this.publishableKey}`,
|
|
3291
|
+
"Content-Type": "application/json"
|
|
3292
|
+
};
|
|
3293
|
+
let version = options?.version || LATEST_API_VERSION;
|
|
3294
|
+
this.headers["x-api-version"] = version;
|
|
3295
|
+
this.url = options?.url || autumnApiUrl;
|
|
3296
|
+
this.logger = logger;
|
|
3297
|
+
this.logger.level = options?.logLevel || "info";
|
|
3298
|
+
}
|
|
3299
|
+
async get(path) {
|
|
3300
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
3301
|
+
headers: this.headers
|
|
3302
|
+
});
|
|
3303
|
+
return toContainerResult({ response, logger: this.logger });
|
|
3304
|
+
}
|
|
3305
|
+
async post(path, body) {
|
|
3306
|
+
try {
|
|
3307
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
3308
|
+
method: "POST",
|
|
3309
|
+
headers: this.headers,
|
|
3310
|
+
body: JSON.stringify(body)
|
|
3311
|
+
});
|
|
3312
|
+
return toContainerResult({ response, logger: this.logger });
|
|
3313
|
+
} catch (error) {
|
|
3314
|
+
console.error("Error sending request:", error);
|
|
3315
|
+
throw error;
|
|
3316
|
+
}
|
|
3317
|
+
}
|
|
3318
|
+
async delete(path) {
|
|
3319
|
+
const response = await fetch(`${this.url}${path}`, {
|
|
3320
|
+
method: "DELETE",
|
|
3321
|
+
headers: this.headers
|
|
3322
|
+
});
|
|
3323
|
+
return toContainerResult({ response, logger: this.logger });
|
|
3324
|
+
}
|
|
3325
|
+
static customers = customerMethods();
|
|
3326
|
+
static products = productMethods();
|
|
3327
|
+
static entities = entityMethods();
|
|
3328
|
+
static referrals = referralMethods();
|
|
3329
|
+
customers = customerMethods(this);
|
|
3330
|
+
products = productMethods(this);
|
|
3331
|
+
entities = entityMethods(this);
|
|
3332
|
+
referrals = referralMethods(this);
|
|
3333
|
+
static attach = (params) => staticWrapper(handleAttach, void 0, { params });
|
|
3334
|
+
static usage = (params) => staticWrapper(handleUsage, void 0, { params });
|
|
3335
|
+
async attach(params) {
|
|
3336
|
+
return handleAttach({
|
|
3337
|
+
instance: this,
|
|
3338
|
+
params
|
|
3339
|
+
});
|
|
3340
|
+
}
|
|
3341
|
+
static cancel = (params) => staticWrapper(handleCancel, void 0, { params });
|
|
3342
|
+
async cancel(params) {
|
|
3343
|
+
return handleCancel({
|
|
3344
|
+
instance: this,
|
|
3345
|
+
params
|
|
3346
|
+
});
|
|
3347
|
+
}
|
|
3348
|
+
/**
|
|
3349
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
3350
|
+
* Please use the new check() method instead.
|
|
3351
|
+
*/
|
|
3352
|
+
static entitled = (params) => staticWrapper(handleEntitled, void 0, { params });
|
|
3353
|
+
/**
|
|
3354
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
3355
|
+
* Please use the new check() method instead.
|
|
3356
|
+
*/
|
|
3357
|
+
async entitled(params) {
|
|
3358
|
+
return handleEntitled({
|
|
3359
|
+
instance: this,
|
|
3360
|
+
params
|
|
3361
|
+
});
|
|
3362
|
+
}
|
|
3363
|
+
static check = (params) => staticWrapper(handleCheck, void 0, { params });
|
|
3364
|
+
async check(params) {
|
|
3365
|
+
return handleCheck({
|
|
3366
|
+
instance: this,
|
|
3367
|
+
params
|
|
3368
|
+
});
|
|
3369
|
+
}
|
|
3370
|
+
/**
|
|
3371
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
3372
|
+
* Please use the new track() method instead.
|
|
3373
|
+
*/
|
|
3374
|
+
static event = (params) => staticWrapper(handleEvent, void 0, { params });
|
|
3375
|
+
/**
|
|
3376
|
+
* @deprecated This method is deprecated and will be removed in a future version.
|
|
3377
|
+
* Please use the new track() method instead.
|
|
3378
|
+
*/
|
|
3379
|
+
async event(params) {
|
|
3380
|
+
return handleEvent({
|
|
3381
|
+
instance: this,
|
|
3382
|
+
params
|
|
3383
|
+
});
|
|
3384
|
+
}
|
|
3385
|
+
static track = (params) => staticWrapper(handleTrack, void 0, { params });
|
|
3386
|
+
async track(params) {
|
|
3387
|
+
return handleTrack({
|
|
3388
|
+
instance: this,
|
|
3389
|
+
params
|
|
3390
|
+
});
|
|
3391
|
+
}
|
|
3392
|
+
async usage(params) {
|
|
3393
|
+
return handleUsage({
|
|
3394
|
+
instance: this,
|
|
3395
|
+
params
|
|
3396
|
+
});
|
|
3397
|
+
}
|
|
3398
|
+
};
|
|
3399
|
+
|
|
3400
|
+
// src/libraries/react/errorUtils/logFetchError.ts
|
|
3401
|
+
var logFetchError = ({
|
|
3402
|
+
method,
|
|
3403
|
+
backendUrl,
|
|
3404
|
+
path,
|
|
3405
|
+
error
|
|
3406
|
+
}) => {
|
|
3407
|
+
console.error(`[Autumn] Fetch failed: ${method} ${backendUrl}${path}
|
|
3408
|
+
|
|
3409
|
+
1. Check that backendUrl in <AutumnProvider/> is correctly set.
|
|
3410
|
+
2. Check that autumnHandler is correctly registered on your backend.`);
|
|
3411
|
+
};
|
|
3412
|
+
|
|
3413
|
+
// src/libraries/react/client/clientCompMethods.ts
|
|
3414
|
+
async function getPricingTableMethod() {
|
|
3415
|
+
const res = await this.get("/api/autumn/components/pricing_table");
|
|
3416
|
+
return res;
|
|
3417
|
+
}
|
|
3418
|
+
|
|
3419
|
+
// src/libraries/react/client/clientCusMethods.ts
|
|
3420
|
+
var createCustomerMethod = async ({
|
|
3421
|
+
client,
|
|
3422
|
+
params
|
|
3423
|
+
}) => {
|
|
3424
|
+
let result = await client.post("/api/autumn/customers", params);
|
|
3425
|
+
return result;
|
|
3426
|
+
};
|
|
3427
|
+
|
|
3428
|
+
// src/libraries/react/utils/toSnakeCase.ts
|
|
3429
|
+
function stringToSnakeCase(str) {
|
|
3430
|
+
return str.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[-\s]+/g, "_").toLowerCase();
|
|
3431
|
+
}
|
|
3432
|
+
var toSnakeCase = (obj) => {
|
|
3433
|
+
if (Array.isArray(obj)) {
|
|
3434
|
+
return obj.map(toSnakeCase);
|
|
3435
|
+
} else if (obj !== null && typeof obj === "object") {
|
|
3436
|
+
return Object.fromEntries(
|
|
3437
|
+
Object.entries(obj).map(([key, value]) => [
|
|
3438
|
+
stringToSnakeCase(key),
|
|
3439
|
+
toSnakeCase(value)
|
|
3440
|
+
])
|
|
3441
|
+
);
|
|
3442
|
+
}
|
|
3443
|
+
return obj;
|
|
3444
|
+
};
|
|
3445
|
+
|
|
3446
|
+
// src/utils/entityUtils.tsx
|
|
3447
|
+
var getEntityExpandStr = (expand) => {
|
|
3448
|
+
if (!expand) {
|
|
3449
|
+
return "";
|
|
3450
|
+
}
|
|
3451
|
+
return `expand=${expand.join(",")}`;
|
|
3452
|
+
};
|
|
3453
|
+
|
|
3454
|
+
// src/libraries/react/client/clientEntityMethods.ts
|
|
3455
|
+
async function createEntityMethod(params) {
|
|
3456
|
+
let snakeParams = toSnakeCase(params);
|
|
3457
|
+
const res = await this.post("/api/autumn/entities", snakeParams);
|
|
3458
|
+
return res;
|
|
3459
|
+
}
|
|
3460
|
+
async function getEntityMethod(entityId, params) {
|
|
3461
|
+
let snakeParams = toSnakeCase(params);
|
|
3462
|
+
let expand = getEntityExpandStr(params?.expand);
|
|
3463
|
+
const res = await this.get(`/api/autumn/entities/${entityId}?${expand}`);
|
|
3464
|
+
return res;
|
|
3465
|
+
}
|
|
3466
|
+
async function deleteEntityMethod(entityId) {
|
|
3467
|
+
const res = await this.delete(`/api/autumn/entities/${entityId}`);
|
|
3468
|
+
return res;
|
|
3469
|
+
}
|
|
3470
|
+
|
|
3471
|
+
// src/libraries/react/client/clientGenMethods.ts
|
|
3472
|
+
async function attachMethod(params) {
|
|
3473
|
+
let { dialog, ...rest } = params;
|
|
3474
|
+
let snakeParams = toSnakeCase(rest);
|
|
3475
|
+
const res = await this.post("/api/autumn/attach", snakeParams);
|
|
3476
|
+
return res;
|
|
3477
|
+
}
|
|
3478
|
+
async function cancelMethod(params) {
|
|
3479
|
+
let snakeParams = toSnakeCase(params);
|
|
3480
|
+
const res = await this.post("/api/autumn/cancel", snakeParams);
|
|
3481
|
+
return res;
|
|
3482
|
+
}
|
|
3483
|
+
async function checkMethod(params) {
|
|
3484
|
+
let { dialog, ...rest } = params;
|
|
3485
|
+
let snakeParams = toSnakeCase(rest);
|
|
3486
|
+
const res = await this.post("/api/autumn/check", snakeParams);
|
|
3487
|
+
return res;
|
|
3488
|
+
}
|
|
3489
|
+
async function trackMethod(params) {
|
|
3490
|
+
let snakeParams = toSnakeCase(params);
|
|
3491
|
+
const res = await this.post("/api/autumn/track", snakeParams);
|
|
3492
|
+
return res;
|
|
3493
|
+
}
|
|
3494
|
+
async function openBillingPortalMethod(params) {
|
|
3495
|
+
let snakeParams = toSnakeCase(params || {});
|
|
3496
|
+
const res = await this.post("/api/autumn/billing_portal", snakeParams);
|
|
3497
|
+
return res;
|
|
3498
|
+
}
|
|
3499
|
+
|
|
3500
|
+
// src/libraries/react/client/clientProdMethods.ts
|
|
3501
|
+
async function listProductsMethod() {
|
|
3502
|
+
const res = await this.get("/api/autumn/products");
|
|
3503
|
+
return res;
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3506
|
+
// src/libraries/react/client/clientReferralMethods.ts
|
|
3507
|
+
async function createCode(params) {
|
|
3508
|
+
let snakeParams = toSnakeCase(params);
|
|
3509
|
+
const res = await this.post("/api/autumn/referrals/code", snakeParams);
|
|
3510
|
+
return res;
|
|
3511
|
+
}
|
|
3512
|
+
async function redeemCode(params) {
|
|
3513
|
+
let snakeParams = toSnakeCase(params);
|
|
3514
|
+
const res = await this.post("/api/autumn/referrals/redeem", snakeParams);
|
|
3515
|
+
return res;
|
|
3516
|
+
}
|
|
3517
|
+
|
|
3518
|
+
// src/libraries/react/client/ReactAutumnClient.tsx
|
|
3519
|
+
var AutumnClient = class {
|
|
3520
|
+
backendUrl;
|
|
3521
|
+
getBearerToken;
|
|
3522
|
+
customerData;
|
|
3523
|
+
includeCredentials;
|
|
3524
|
+
constructor({
|
|
3525
|
+
backendUrl,
|
|
3526
|
+
getBearerToken,
|
|
3527
|
+
customerData,
|
|
3528
|
+
includeCredentials
|
|
3529
|
+
}) {
|
|
3530
|
+
this.backendUrl = backendUrl;
|
|
3531
|
+
this.getBearerToken = getBearerToken;
|
|
3532
|
+
this.customerData = customerData;
|
|
3533
|
+
this.includeCredentials = includeCredentials;
|
|
3534
|
+
}
|
|
3535
|
+
async getHeaders() {
|
|
3536
|
+
let headers = {
|
|
3537
|
+
"Content-Type": "application/json"
|
|
3538
|
+
};
|
|
3539
|
+
if (this.getBearerToken) {
|
|
3540
|
+
try {
|
|
3541
|
+
let token = await this.getBearerToken();
|
|
3542
|
+
headers.Authorization = `Bearer ${token}`;
|
|
3543
|
+
} catch (error) {
|
|
3544
|
+
console.error(`Failed to call getToken() in AutumnProvider`);
|
|
3545
|
+
}
|
|
3546
|
+
}
|
|
3547
|
+
return headers;
|
|
3548
|
+
}
|
|
3549
|
+
async handleFetch({
|
|
3550
|
+
path,
|
|
3551
|
+
method,
|
|
3552
|
+
body
|
|
3553
|
+
}) {
|
|
3554
|
+
body = method === "POST" ? JSON.stringify({
|
|
3555
|
+
...body,
|
|
3556
|
+
customer_data: this.customerData || void 0
|
|
3557
|
+
}) : void 0;
|
|
3558
|
+
try {
|
|
3559
|
+
const response = await fetch(`${this.backendUrl}${path}`, {
|
|
3560
|
+
method,
|
|
3561
|
+
body,
|
|
3562
|
+
headers: await this.getHeaders(),
|
|
3563
|
+
credentials: this.includeCredentials ? "include" : void 0
|
|
3564
|
+
});
|
|
3565
|
+
return await toContainerResult({ response, logger: console });
|
|
3566
|
+
} catch (error) {
|
|
3567
|
+
logFetchError({
|
|
3568
|
+
method,
|
|
3569
|
+
backendUrl: this.backendUrl || "",
|
|
3570
|
+
path,
|
|
3571
|
+
error
|
|
3572
|
+
});
|
|
3573
|
+
return {
|
|
3574
|
+
data: null,
|
|
3575
|
+
error: new AutumnError({
|
|
3576
|
+
message: error.message,
|
|
3577
|
+
code: "fetch_failed"
|
|
3578
|
+
})
|
|
3579
|
+
};
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
async post(path, body) {
|
|
3583
|
+
return await this.handleFetch({
|
|
3584
|
+
path,
|
|
3585
|
+
method: "POST",
|
|
3586
|
+
body
|
|
3587
|
+
});
|
|
3588
|
+
}
|
|
3589
|
+
async get(path) {
|
|
3590
|
+
return await this.handleFetch({
|
|
3591
|
+
path,
|
|
3592
|
+
method: "GET"
|
|
3593
|
+
});
|
|
3594
|
+
}
|
|
3595
|
+
async delete(path) {
|
|
3596
|
+
return await this.handleFetch({
|
|
3597
|
+
path,
|
|
3598
|
+
method: "DELETE"
|
|
3599
|
+
});
|
|
3600
|
+
}
|
|
3601
|
+
async createCustomer(params) {
|
|
3602
|
+
return await createCustomerMethod({
|
|
3603
|
+
client: this,
|
|
3604
|
+
params
|
|
3605
|
+
});
|
|
3606
|
+
}
|
|
3607
|
+
async getPricingTable() {
|
|
3608
|
+
return await getPricingTableMethod.bind(this)();
|
|
3609
|
+
}
|
|
3610
|
+
attach = attachMethod.bind(this);
|
|
3611
|
+
cancel = cancelMethod.bind(this);
|
|
3612
|
+
check = checkMethod.bind(this);
|
|
3613
|
+
track = trackMethod.bind(this);
|
|
3614
|
+
openBillingPortal = openBillingPortalMethod.bind(this);
|
|
3615
|
+
entities = {
|
|
3616
|
+
create: createEntityMethod.bind(this),
|
|
3617
|
+
get: getEntityMethod.bind(this),
|
|
3618
|
+
delete: deleteEntityMethod.bind(this)
|
|
3619
|
+
};
|
|
3620
|
+
referrals = {
|
|
3621
|
+
createCode: createCode.bind(this),
|
|
3622
|
+
redeemCode: redeemCode.bind(this)
|
|
3623
|
+
};
|
|
3624
|
+
products = {
|
|
3625
|
+
list: listProductsMethod.bind(this)
|
|
3626
|
+
};
|
|
3627
|
+
};
|
|
3628
|
+
|
|
3629
|
+
// src/libraries/react/AutumnContext.tsx
|
|
3630
|
+
var import_react4 = require("react");
|
|
3631
|
+
var AutumnContext = (0, import_react4.createContext)({
|
|
3632
|
+
initialized: false,
|
|
3633
|
+
disableDialogs: false,
|
|
3634
|
+
client: new AutumnClient({ backendUrl: "" }),
|
|
3635
|
+
paywallDialog: {
|
|
3636
|
+
props: null,
|
|
3637
|
+
setProps: () => {
|
|
3638
|
+
},
|
|
3639
|
+
open: false,
|
|
3640
|
+
setOpen: () => {
|
|
3641
|
+
},
|
|
3642
|
+
setComponent: () => {
|
|
3643
|
+
}
|
|
3644
|
+
},
|
|
3645
|
+
attachDialog: {
|
|
3646
|
+
props: null,
|
|
3647
|
+
setProps: () => {
|
|
3648
|
+
},
|
|
3649
|
+
open: false,
|
|
3650
|
+
setOpen: () => {
|
|
3651
|
+
},
|
|
3652
|
+
setComponent: () => {
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3655
|
+
});
|
|
3656
|
+
var useAutumnContext = ({
|
|
3657
|
+
AutumnContext: AutumnContext2,
|
|
3658
|
+
name
|
|
3659
|
+
}) => {
|
|
3660
|
+
const context = (0, import_react4.useContext)(AutumnContext2);
|
|
3661
|
+
if (!context.initialized) {
|
|
3662
|
+
throw new Error(`${name} must be used within <AutumnProvider />`);
|
|
3663
|
+
}
|
|
3664
|
+
return context;
|
|
3665
|
+
};
|
|
3666
|
+
|
|
3667
|
+
// src/libraries/react/hooks/usePricingTableBase.tsx
|
|
3668
|
+
var import_swr = __toESM(require("swr"));
|
|
3669
|
+
var mergeProductDetails = (products, productDetails) => {
|
|
3670
|
+
if (!products) {
|
|
3671
|
+
return null;
|
|
3672
|
+
}
|
|
3673
|
+
if (!productDetails) {
|
|
3674
|
+
return products;
|
|
3675
|
+
}
|
|
3676
|
+
let fetchedProducts = structuredClone(products);
|
|
3677
|
+
let mergedProducts = [];
|
|
3678
|
+
for (const overrideDetails of productDetails) {
|
|
3679
|
+
if (!overrideDetails.id) {
|
|
3680
|
+
let properties = {};
|
|
3681
|
+
let overrideItems2 = overrideDetails.items?.map((item) => ({
|
|
3682
|
+
display: {
|
|
3683
|
+
primary_text: item.primaryText,
|
|
3684
|
+
secondary_text: item.secondaryText
|
|
3685
|
+
}
|
|
3686
|
+
}));
|
|
3687
|
+
let overridePrice2 = overrideDetails.price;
|
|
3688
|
+
if (overrideDetails.price) {
|
|
3689
|
+
properties.is_free = false;
|
|
3690
|
+
overrideItems2 = [
|
|
3691
|
+
{
|
|
3692
|
+
display: {
|
|
3693
|
+
primary_text: overridePrice2?.primaryText,
|
|
3694
|
+
secondary_text: overridePrice2?.secondaryText
|
|
3695
|
+
}
|
|
3696
|
+
},
|
|
3697
|
+
...overrideItems2 || []
|
|
3698
|
+
];
|
|
3699
|
+
}
|
|
3700
|
+
mergedProducts.push({
|
|
3701
|
+
name: overrideDetails.name || "",
|
|
3702
|
+
display: {
|
|
3703
|
+
description: overrideDetails.description,
|
|
3704
|
+
button_text: overrideDetails.buttonText,
|
|
3705
|
+
recommend_text: overrideDetails.recommendText,
|
|
3706
|
+
everything_from: overrideDetails.everythingFrom,
|
|
3707
|
+
button_url: overrideDetails.buttonUrl
|
|
3708
|
+
},
|
|
3709
|
+
items: overrideItems2,
|
|
3710
|
+
properties
|
|
3711
|
+
});
|
|
3712
|
+
continue;
|
|
3713
|
+
}
|
|
3714
|
+
let fetchedProduct = fetchedProducts.find(
|
|
3715
|
+
(p) => p.id === overrideDetails.id
|
|
3716
|
+
);
|
|
3717
|
+
if (!fetchedProduct) {
|
|
3718
|
+
continue;
|
|
3719
|
+
}
|
|
3720
|
+
const originalIsFree = fetchedProduct.properties?.is_free;
|
|
3721
|
+
let overrideProperties = fetchedProduct.properties || {};
|
|
3722
|
+
let overrideItems = overrideDetails.items;
|
|
3723
|
+
let overridePrice = overrideDetails.price;
|
|
3724
|
+
let mergedItems = [];
|
|
3725
|
+
if (overridePrice) {
|
|
3726
|
+
overrideProperties.is_free = false;
|
|
3727
|
+
if (originalIsFree || overrideItems !== void 0) {
|
|
3728
|
+
mergedItems.push({
|
|
3729
|
+
display: {
|
|
3730
|
+
primary_text: overridePrice.primaryText,
|
|
3731
|
+
secondary_text: overridePrice.secondaryText
|
|
3732
|
+
}
|
|
3733
|
+
});
|
|
3734
|
+
} else {
|
|
3735
|
+
fetchedProduct.items[0].display = {
|
|
3736
|
+
primary_text: overridePrice.primaryText,
|
|
3737
|
+
secondary_text: overridePrice.secondaryText
|
|
3738
|
+
};
|
|
3739
|
+
}
|
|
3740
|
+
} else {
|
|
3741
|
+
if (overrideItems && !originalIsFree) {
|
|
3742
|
+
mergedItems.push(fetchedProduct.items[0]);
|
|
3743
|
+
}
|
|
3744
|
+
}
|
|
3745
|
+
if (overrideItems) {
|
|
3746
|
+
for (const overrideItem of overrideItems) {
|
|
3747
|
+
if (!overrideItem.featureId) {
|
|
3748
|
+
mergedItems.push({
|
|
3749
|
+
display: {
|
|
3750
|
+
primary_text: overrideItem.primaryText,
|
|
3751
|
+
secondary_text: overrideItem.secondaryText
|
|
3752
|
+
}
|
|
3753
|
+
});
|
|
3754
|
+
} else {
|
|
3755
|
+
let fetchedItem = fetchedProduct.items.find(
|
|
3756
|
+
(i) => i.feature_id === overrideItem.featureId
|
|
3757
|
+
);
|
|
3758
|
+
if (!fetchedItem) {
|
|
3759
|
+
console.error(
|
|
3760
|
+
`Feature with id ${overrideItem.featureId} not found for product ${fetchedProduct.id}`
|
|
3761
|
+
);
|
|
3762
|
+
continue;
|
|
3763
|
+
}
|
|
3764
|
+
mergedItems.push({
|
|
3765
|
+
...fetchedItem,
|
|
3766
|
+
display: {
|
|
3767
|
+
primary_text: overrideItem.primaryText || fetchedItem.display?.primary_text,
|
|
3768
|
+
secondary_text: overrideItem.secondaryText || fetchedItem.display?.secondary_text
|
|
3769
|
+
}
|
|
3770
|
+
});
|
|
3771
|
+
}
|
|
3772
|
+
}
|
|
3773
|
+
} else {
|
|
3774
|
+
mergedItems = fetchedProduct.items;
|
|
3775
|
+
}
|
|
3776
|
+
const mergedProduct = {
|
|
3777
|
+
...fetchedProduct,
|
|
3778
|
+
name: overrideDetails.name || fetchedProduct.name,
|
|
3779
|
+
items: mergedItems,
|
|
3780
|
+
properties: overrideProperties,
|
|
3781
|
+
display: {
|
|
3782
|
+
description: overrideDetails.description,
|
|
3783
|
+
button_text: overrideDetails.buttonText,
|
|
3784
|
+
recommend_text: overrideDetails.recommendText,
|
|
3785
|
+
everything_from: overrideDetails.everythingFrom,
|
|
3786
|
+
button_url: overrideDetails.buttonUrl
|
|
3787
|
+
}
|
|
3788
|
+
// description: overrideDetails.description,
|
|
3789
|
+
// button_text: overrideDetails.buttonText,
|
|
3790
|
+
// recommend_text: overrideDetails.recommendText,
|
|
3791
|
+
// everything_from: overrideDetails.everythingFrom,
|
|
3792
|
+
};
|
|
3793
|
+
mergedProducts.push(mergedProduct);
|
|
3794
|
+
}
|
|
3795
|
+
return mergedProducts;
|
|
3796
|
+
};
|
|
3797
|
+
var usePricingTableBase = ({
|
|
3798
|
+
AutumnContext: AutumnContext2,
|
|
3799
|
+
params
|
|
3800
|
+
}) => {
|
|
3801
|
+
const context = useAutumnContext({ AutumnContext: AutumnContext2, name: "usePricingTable" });
|
|
3802
|
+
const fetcher = async () => {
|
|
3803
|
+
try {
|
|
3804
|
+
const { data: data2, error: error2 } = await context.client.products.list();
|
|
3805
|
+
if (error2) throw error2;
|
|
3806
|
+
return data2?.list || [];
|
|
3807
|
+
} catch (error2) {
|
|
3808
|
+
throw new AutumnError({
|
|
3809
|
+
message: "Failed to fetch pricing table products",
|
|
3810
|
+
code: "failed_to_fetch_pricing_table_products"
|
|
3811
|
+
});
|
|
3812
|
+
}
|
|
3813
|
+
};
|
|
3814
|
+
const { data, error, mutate } = (0, import_swr.default)(
|
|
3815
|
+
"pricing-table",
|
|
3816
|
+
fetcher
|
|
3817
|
+
);
|
|
3818
|
+
return {
|
|
3819
|
+
products: mergeProductDetails(data || [], params?.productDetails),
|
|
3820
|
+
// products: data || [],
|
|
3821
|
+
isLoading: !error && !data,
|
|
3822
|
+
error,
|
|
3823
|
+
refetch: mutate
|
|
3824
|
+
};
|
|
3825
|
+
};
|
|
3826
|
+
|
|
3827
|
+
// src/libraries/react/hooks/useAutumnBase.tsx
|
|
3828
|
+
var useAutumnBase = ({
|
|
3829
|
+
AutumnContext: AutumnContext2
|
|
3830
|
+
}) => {
|
|
3831
|
+
const context = useAutumnContext({ AutumnContext: AutumnContext2, name: "useAutumn" });
|
|
3832
|
+
const { attachDialog, paywallDialog } = context;
|
|
3833
|
+
const client = context.client;
|
|
3834
|
+
const { refetch: refetchPricingTable } = usePricingTableBase({
|
|
3835
|
+
AutumnContext: AutumnContext2
|
|
3836
|
+
});
|
|
3837
|
+
let {
|
|
3838
|
+
open: attachOpen,
|
|
3839
|
+
setProps: setAttachProps,
|
|
3840
|
+
setOpen: setAttachOpen,
|
|
3841
|
+
setComponent: setAttachComponent
|
|
3842
|
+
} = attachDialog;
|
|
3843
|
+
let {
|
|
3844
|
+
setProps: setCheckProps,
|
|
3845
|
+
setOpen: setCheckOpen,
|
|
3846
|
+
setComponent: setPaywallComponent
|
|
3847
|
+
} = paywallDialog;
|
|
3848
|
+
const attachWithoutDialog = async (params) => {
|
|
3849
|
+
const result = await client.attach(params);
|
|
3850
|
+
if (result.error) {
|
|
3851
|
+
return result;
|
|
3852
|
+
}
|
|
3853
|
+
let data = result.data;
|
|
3854
|
+
if (data?.checkout_url && typeof window !== "undefined") {
|
|
3855
|
+
if (params.openInNewTab) {
|
|
3856
|
+
window.open(data.checkout_url, "_blank");
|
|
3857
|
+
} else {
|
|
3858
|
+
window.location.href = data.checkout_url;
|
|
3859
|
+
}
|
|
3860
|
+
}
|
|
3861
|
+
await refetchPricingTable();
|
|
3862
|
+
if (setAttachOpen) {
|
|
3863
|
+
setAttachOpen(false);
|
|
3864
|
+
}
|
|
3865
|
+
return result;
|
|
3866
|
+
};
|
|
3867
|
+
const attachWithDialog = async (params) => {
|
|
3868
|
+
let { dialog, ...rest } = params;
|
|
3869
|
+
const { productId, entityId, entityData } = params;
|
|
3870
|
+
const checkRes = await client.check({
|
|
3871
|
+
productId,
|
|
3872
|
+
entityId,
|
|
3873
|
+
entityData,
|
|
3874
|
+
withPreview: true
|
|
3875
|
+
});
|
|
3876
|
+
if (checkRes.error) {
|
|
3877
|
+
return checkRes;
|
|
3878
|
+
}
|
|
3879
|
+
let preview = checkRes.data.preview;
|
|
3880
|
+
if (!preview) {
|
|
3881
|
+
return await attachWithoutDialog(rest);
|
|
3882
|
+
} else {
|
|
3883
|
+
setAttachProps({ preview });
|
|
3884
|
+
setAttachOpen(true);
|
|
3885
|
+
}
|
|
3886
|
+
return checkRes;
|
|
3887
|
+
};
|
|
3888
|
+
const attach = async (params) => {
|
|
3889
|
+
const { dialog, openInNewTab } = params;
|
|
3890
|
+
let finalDialog = dialog;
|
|
3891
|
+
if (finalDialog && !attachOpen) {
|
|
3892
|
+
setAttachComponent(finalDialog);
|
|
3893
|
+
return await attachWithDialog(params);
|
|
3894
|
+
}
|
|
3895
|
+
return await attachWithoutDialog(params);
|
|
3896
|
+
};
|
|
3897
|
+
const cancel = async (params) => {
|
|
3898
|
+
const res = await client.cancel(params);
|
|
3899
|
+
if (res.error) {
|
|
3900
|
+
return res;
|
|
3901
|
+
}
|
|
3902
|
+
return res;
|
|
3903
|
+
};
|
|
3904
|
+
const check = async (params) => {
|
|
3905
|
+
let { dialog, withPreview } = params;
|
|
3906
|
+
if (dialog) {
|
|
3907
|
+
setPaywallComponent(dialog);
|
|
3908
|
+
}
|
|
3909
|
+
const res = await client.check({
|
|
3910
|
+
...params,
|
|
3911
|
+
withPreview: withPreview || dialog ? true : false
|
|
3912
|
+
});
|
|
3913
|
+
if (res.error) {
|
|
3914
|
+
return res;
|
|
3915
|
+
}
|
|
3916
|
+
let data = res.data;
|
|
3917
|
+
if (data && data.preview && dialog) {
|
|
3918
|
+
let preview = data.preview;
|
|
3919
|
+
setCheckProps({ preview });
|
|
3920
|
+
setCheckOpen(true);
|
|
3921
|
+
}
|
|
3922
|
+
return res;
|
|
3923
|
+
};
|
|
3924
|
+
const track = async (params) => {
|
|
3925
|
+
const res = await client.track(params);
|
|
3926
|
+
if (res.error) {
|
|
3927
|
+
return res;
|
|
3928
|
+
}
|
|
3929
|
+
return res;
|
|
3930
|
+
};
|
|
3931
|
+
const openBillingPortal = async (params) => {
|
|
3932
|
+
let defaultParams = {
|
|
3933
|
+
openInNewTab: false
|
|
3934
|
+
};
|
|
3935
|
+
let finalParams = {
|
|
3936
|
+
...defaultParams,
|
|
3937
|
+
...params
|
|
3938
|
+
};
|
|
3939
|
+
const res = await client.openBillingPortal(finalParams);
|
|
3940
|
+
if (res.error) {
|
|
3941
|
+
return res;
|
|
3942
|
+
}
|
|
3943
|
+
let data = res.data;
|
|
3944
|
+
if (data?.url && typeof window !== "undefined") {
|
|
3945
|
+
if (finalParams.openInNewTab) {
|
|
3946
|
+
window.open(data.url, "_blank");
|
|
3947
|
+
} else {
|
|
3948
|
+
window.open(data.url, "_self");
|
|
3949
|
+
}
|
|
3950
|
+
return res;
|
|
3951
|
+
} else {
|
|
3952
|
+
return res;
|
|
3953
|
+
}
|
|
3954
|
+
};
|
|
3955
|
+
return {
|
|
3956
|
+
attach,
|
|
3957
|
+
check,
|
|
3958
|
+
track,
|
|
3959
|
+
cancel,
|
|
3960
|
+
openBillingPortal
|
|
3961
|
+
};
|
|
3962
|
+
};
|
|
3963
|
+
|
|
3964
|
+
// src/libraries/react/hooks/handleAllowed.ts
|
|
3965
|
+
var getCusFeature = ({
|
|
3966
|
+
customer,
|
|
3967
|
+
featureId,
|
|
3968
|
+
requiredBalance = 1
|
|
3969
|
+
}) => {
|
|
3970
|
+
let creditSchema = Object.values(customer.features).find((f) => f.credit_schema && f.credit_schema.some((c) => c.feature_id === featureId));
|
|
3971
|
+
if (creditSchema) {
|
|
3972
|
+
let schemaItem = creditSchema.credit_schema?.find((c) => c.feature_id === featureId);
|
|
3973
|
+
return {
|
|
3974
|
+
feature: creditSchema,
|
|
3975
|
+
requiredBalance: schemaItem.credit_amount * requiredBalance
|
|
3976
|
+
};
|
|
3977
|
+
}
|
|
3978
|
+
return {
|
|
3979
|
+
cusFeature: customer.features[featureId],
|
|
3980
|
+
requiredBalance
|
|
3981
|
+
};
|
|
3982
|
+
};
|
|
3983
|
+
var handleFeatureAllowed = ({ customer, params }) => {
|
|
3984
|
+
let { cusFeature, requiredBalance } = getCusFeature({ customer, featureId: params.featureId });
|
|
3985
|
+
if (!cusFeature) return false;
|
|
3986
|
+
if (cusFeature.type == "static") return true;
|
|
3987
|
+
if (cusFeature.unlimited || cusFeature.overage_allowed) return true;
|
|
3988
|
+
return (cusFeature.balance || 0) >= requiredBalance;
|
|
3989
|
+
};
|
|
3990
|
+
var handleAllowed = ({ customer, params }) => {
|
|
3991
|
+
if (!customer) return false;
|
|
3992
|
+
if (!params.featureId && !params.productId) {
|
|
3993
|
+
throw new Error("allowed() requires either featureId or productId");
|
|
3994
|
+
}
|
|
3995
|
+
if (params.featureId) {
|
|
3996
|
+
return handleFeatureAllowed({ customer, params });
|
|
3997
|
+
}
|
|
3998
|
+
if (params.productId) {
|
|
3999
|
+
let product = customer.products.find((p) => p.id == params.productId);
|
|
4000
|
+
if (!product) return false;
|
|
4001
|
+
let status = product.status;
|
|
4002
|
+
if (status == "scheduled") return false;
|
|
4003
|
+
return true;
|
|
4004
|
+
}
|
|
4005
|
+
return false;
|
|
4006
|
+
};
|
|
4007
|
+
|
|
4008
|
+
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
4009
|
+
var emptyDefaultFunctions = {
|
|
4010
|
+
attach: "",
|
|
4011
|
+
check: "",
|
|
4012
|
+
track: "",
|
|
4013
|
+
cancel: "",
|
|
4014
|
+
openBillingPortal: ""
|
|
4015
|
+
};
|
|
4016
|
+
var useCustomerBase = ({
|
|
4017
|
+
params,
|
|
4018
|
+
AutumnContext: AutumnContext2,
|
|
4019
|
+
client
|
|
4020
|
+
}) => {
|
|
4021
|
+
const queryKey = ["customer"];
|
|
4022
|
+
let context;
|
|
4023
|
+
if (AutumnContext2) {
|
|
4024
|
+
context = useAutumnContext({ AutumnContext: AutumnContext2, name: "useCustomer" });
|
|
4025
|
+
}
|
|
4026
|
+
if (!client) {
|
|
4027
|
+
client = context.client;
|
|
4028
|
+
}
|
|
4029
|
+
const fetchCustomer = async () => {
|
|
4030
|
+
const { data, error: error2 } = await client.createCustomer({
|
|
4031
|
+
errorOnNotFound: params?.errorOnNotFound,
|
|
4032
|
+
expand: params?.expand
|
|
4033
|
+
});
|
|
4034
|
+
if (error2) {
|
|
4035
|
+
throw error2;
|
|
4036
|
+
}
|
|
4037
|
+
if (!data) {
|
|
4038
|
+
return null;
|
|
4039
|
+
}
|
|
4040
|
+
return data;
|
|
4041
|
+
};
|
|
4042
|
+
const { data: customer, error, isLoading, mutate } = (0, import_swr2.default)(queryKey, fetchCustomer, {
|
|
4043
|
+
fallbackData: null,
|
|
4044
|
+
onErrorRetry: (error2, key, config) => {
|
|
4045
|
+
if (error2.code == "entity_not_found") {
|
|
4046
|
+
return false;
|
|
4047
|
+
}
|
|
4048
|
+
return true;
|
|
4049
|
+
}
|
|
4050
|
+
});
|
|
4051
|
+
let autumnFunctions = emptyDefaultFunctions;
|
|
4052
|
+
if (AutumnContext2) {
|
|
4053
|
+
autumnFunctions = useAutumnBase({ AutumnContext: AutumnContext2 });
|
|
4054
|
+
}
|
|
4055
|
+
return {
|
|
4056
|
+
customer: error ? null : customer,
|
|
4057
|
+
isLoading,
|
|
4058
|
+
error,
|
|
4059
|
+
refetch: mutate,
|
|
4060
|
+
...autumnFunctions,
|
|
4061
|
+
createEntity: client.entities.create,
|
|
4062
|
+
createReferralCode: client.referrals.createCode,
|
|
4063
|
+
redeemReferralCode: client.referrals.redeemCode,
|
|
4064
|
+
allowed: (params2) => handleAllowed({ customer, params: params2 })
|
|
4065
|
+
};
|
|
4066
|
+
};
|
|
4067
|
+
|
|
4068
|
+
// src/libraries/react/BaseAutumnProvider.tsx
|
|
4069
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
4070
|
+
|
|
4071
|
+
// src/libraries/react/ReactAutumnProvider.tsx
|
|
4072
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
4073
|
+
|
|
4074
|
+
// src/libraries/react/hooks/useCustomer.tsx
|
|
4075
|
+
var useCustomer = (params) => {
|
|
4076
|
+
return useCustomerBase({
|
|
4077
|
+
params,
|
|
4078
|
+
AutumnContext
|
|
4079
|
+
});
|
|
4080
|
+
};
|
|
4081
|
+
|
|
4082
|
+
// src/libraries/react/hooks/useEntityBase.tsx
|
|
4083
|
+
var import_swr3 = __toESM(require("swr"));
|
|
4084
|
+
var import_react6 = require("react");
|
|
4085
|
+
|
|
4086
|
+
// src/libraries/react/components/check-dialog/check-dialog-synced.tsx
|
|
4087
|
+
var import_react7 = require("react");
|
|
4088
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
4089
|
+
|
|
4090
|
+
// src/libraries/react/components/pricing-table/pricing-table-synced.tsx
|
|
4091
|
+
var import_react8 = __toESM(require("react"));
|
|
4092
|
+
var import_react9 = require("react");
|
|
4093
|
+
|
|
4094
|
+
// src/libraries/react/components/ui/switch.tsx
|
|
4095
|
+
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
|
|
4096
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
4097
|
+
|
|
4098
|
+
// src/libraries/react/components/pricing-table/lib/pricing-table-content.tsx
|
|
4099
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
4100
|
+
|
|
4101
|
+
// src/libraries/react/components/pricing-table/pricing-table-synced.tsx
|
|
4102
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
4103
|
+
var PricingTableContext = (0, import_react9.createContext)({
|
|
4104
|
+
isAnnualToggle: false,
|
|
4105
|
+
setIsAnnualToggle: () => {
|
|
4106
|
+
},
|
|
4107
|
+
products: [],
|
|
4108
|
+
showFeatures: true
|
|
4109
|
+
});
|
|
4110
|
+
var PricingCardButton = import_react8.default.forwardRef(({ recommended, children, buttonUrl, onClick, className, ...props }, ref) => {
|
|
4111
|
+
const [loading, setLoading] = (0, import_react9.useState)(false);
|
|
4112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
4113
|
+
Button,
|
|
4114
|
+
{
|
|
4115
|
+
className: cn(
|
|
4116
|
+
"w-full py-3 px-4 group overflow-hidden relative transition-all duration-300 hover:brightness-90 border rounded-lg",
|
|
4117
|
+
className
|
|
4118
|
+
),
|
|
4119
|
+
variant: recommended ? "default" : "secondary",
|
|
4120
|
+
ref,
|
|
4121
|
+
disabled: loading,
|
|
4122
|
+
onClick: async (e) => {
|
|
4123
|
+
setLoading(true);
|
|
4124
|
+
try {
|
|
4125
|
+
if (onClick) {
|
|
4126
|
+
await onClick(e);
|
|
4127
|
+
return;
|
|
4128
|
+
}
|
|
4129
|
+
if (buttonUrl) {
|
|
4130
|
+
window.open(buttonUrl, "_blank");
|
|
4131
|
+
return;
|
|
4132
|
+
}
|
|
4133
|
+
} catch (error) {
|
|
4134
|
+
throw error;
|
|
4135
|
+
} finally {
|
|
4136
|
+
setLoading(false);
|
|
4137
|
+
}
|
|
4138
|
+
},
|
|
4139
|
+
...props,
|
|
4140
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LoaderCircle, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
4141
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between w-full transition-transform duration-300 group-hover:translate-y-[-130%]", children: [
|
|
4142
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children }),
|
|
4143
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm", children: "\u2192" })
|
|
4144
|
+
] }),
|
|
4145
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between w-full absolute px-4 translate-y-[130%] transition-transform duration-300 group-hover:translate-y-0 mt-2 group-hover:mt-0", children: [
|
|
4146
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children }),
|
|
4147
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm", children: "\u2192" })
|
|
4148
|
+
] })
|
|
4149
|
+
] })
|
|
4150
|
+
}
|
|
4151
|
+
);
|
|
4152
|
+
});
|
|
4153
|
+
PricingCardButton.displayName = "PricingCardButton";
|
|
4154
|
+
|
|
4155
|
+
// src/libraries/react/components/attach-dialog/attach-dialog-synced.tsx
|
|
4156
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
4157
|
+
function AttachDialog(params) {
|
|
4158
|
+
const { attach } = useCustomer();
|
|
4159
|
+
const [loading, setLoading] = (0, import_react10.useState)(false);
|
|
4160
|
+
const [optionsInput, setOptionsInput] = (0, import_react10.useState)(
|
|
4161
|
+
params?.preview?.options || []
|
|
4162
|
+
);
|
|
4163
|
+
const getTotalPrice = () => {
|
|
4164
|
+
let sum = due_today?.price || 0;
|
|
4165
|
+
optionsInput.forEach((option) => {
|
|
4166
|
+
if (option.price && option.quantity) {
|
|
4167
|
+
sum += option.price * (option.quantity / option.billing_units);
|
|
4168
|
+
}
|
|
4169
|
+
});
|
|
4170
|
+
return sum;
|
|
4171
|
+
};
|
|
4172
|
+
(0, import_react10.useEffect)(() => {
|
|
4173
|
+
setOptionsInput(params?.preview?.options || []);
|
|
4174
|
+
}, [params?.preview?.options]);
|
|
4175
|
+
if (!params || !params.preview) {
|
|
4176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, {});
|
|
4177
|
+
}
|
|
4178
|
+
const { open, setOpen, preview } = params;
|
|
4179
|
+
const { items, due_today } = preview;
|
|
4180
|
+
const { title, message } = getAttachContent(preview);
|
|
4181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4182
|
+
DialogContent,
|
|
4183
|
+
{
|
|
4184
|
+
className: cn("p-0 pt-4 gap-0 text-foreground overflow-hidden text-sm"),
|
|
4185
|
+
children: [
|
|
4186
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DialogTitle, { className: cn("px-6 mb-1 "), children: title }),
|
|
4187
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: cn("px-6 mt-1 mb-4 text-muted-foreground"), children: message }),
|
|
4188
|
+
(items || optionsInput.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "mb-6 px-6", children: [
|
|
4189
|
+
items?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(PriceItem, { children: [
|
|
4190
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "truncate flex-1", children: item.description }),
|
|
4191
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: item.price })
|
|
4192
|
+
] }, item.description)),
|
|
4193
|
+
optionsInput?.map((option, index) => {
|
|
4194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4195
|
+
OptionsInput,
|
|
4196
|
+
{
|
|
4197
|
+
option,
|
|
4198
|
+
optionsInput,
|
|
4199
|
+
setOptionsInput,
|
|
4200
|
+
index
|
|
4201
|
+
},
|
|
4202
|
+
option.feature_name
|
|
4203
|
+
);
|
|
4204
|
+
})
|
|
4205
|
+
] }),
|
|
4206
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DialogFooter, { className: "flex flex-col sm:flex-row justify-between gap-x-4 py-2 pl-6 pr-3 bg-secondary border-t shadow-inner", children: [
|
|
4207
|
+
due_today && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(TotalPrice, { children: [
|
|
4208
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Due Today" }),
|
|
4209
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: new Intl.NumberFormat("en-US", {
|
|
4210
|
+
style: "currency",
|
|
4211
|
+
currency: due_today.currency
|
|
4212
|
+
}).format(getTotalPrice()) })
|
|
4213
|
+
] }),
|
|
4214
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4215
|
+
Button,
|
|
4216
|
+
{
|
|
4217
|
+
size: "sm",
|
|
4218
|
+
onClick: async () => {
|
|
4219
|
+
setLoading(true);
|
|
4220
|
+
await attach({
|
|
4221
|
+
productId: preview.product_id,
|
|
4222
|
+
options: optionsInput.map((option) => ({
|
|
4223
|
+
featureId: option.feature_id,
|
|
4224
|
+
quantity: option.quantity || 0
|
|
4225
|
+
}))
|
|
4226
|
+
});
|
|
4227
|
+
setOpen(false);
|
|
4228
|
+
setLoading(false);
|
|
4229
|
+
},
|
|
4230
|
+
disabled: loading,
|
|
4231
|
+
className: "min-w-16 flex items-center gap-2",
|
|
4232
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LoaderCircle, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "whitespace-nowrap flex gap-1", children: "Confirm" }) })
|
|
4233
|
+
}
|
|
4234
|
+
)
|
|
4235
|
+
] })
|
|
4236
|
+
]
|
|
4237
|
+
}
|
|
4238
|
+
) });
|
|
4239
|
+
}
|
|
4240
|
+
var PriceItem = ({
|
|
4241
|
+
children,
|
|
4242
|
+
className,
|
|
4243
|
+
...props
|
|
4244
|
+
}) => {
|
|
4245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4246
|
+
"div",
|
|
4247
|
+
{
|
|
4248
|
+
className: cn(
|
|
4249
|
+
"flex flex-col pb-4 sm:pb-0 gap-1 sm:flex-row justify-between sm:h-7 sm:gap-2 sm:items-center",
|
|
4250
|
+
className
|
|
4251
|
+
),
|
|
4252
|
+
...props,
|
|
4253
|
+
children
|
|
4254
|
+
}
|
|
4255
|
+
);
|
|
4256
|
+
};
|
|
4257
|
+
var OptionsInput = ({
|
|
4258
|
+
className,
|
|
4259
|
+
option,
|
|
4260
|
+
optionsInput,
|
|
4261
|
+
setOptionsInput,
|
|
4262
|
+
index,
|
|
4263
|
+
...props
|
|
4264
|
+
}) => {
|
|
4265
|
+
const { feature_name, billing_units, quantity, price } = option;
|
|
4266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(PriceItem, { children: [
|
|
4267
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: feature_name }),
|
|
4268
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4269
|
+
QuantityInput,
|
|
4270
|
+
{
|
|
4271
|
+
value: quantity ? quantity / billing_units : "",
|
|
4272
|
+
onChange: (e) => {
|
|
4273
|
+
const newOptions = [...optionsInput];
|
|
4274
|
+
newOptions[index].quantity = parseInt(e.target.value) * billing_units;
|
|
4275
|
+
setOptionsInput(newOptions);
|
|
4276
|
+
},
|
|
4277
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "", children: [
|
|
4278
|
+
"\xD7 $",
|
|
4279
|
+
price,
|
|
4280
|
+
" per ",
|
|
4281
|
+
billing_units === 1 ? " " : billing_units,
|
|
4282
|
+
" ",
|
|
4283
|
+
feature_name
|
|
4284
|
+
] })
|
|
4285
|
+
},
|
|
4286
|
+
feature_name
|
|
4287
|
+
)
|
|
4288
|
+
] }, feature_name);
|
|
4289
|
+
};
|
|
4290
|
+
var QuantityInput = ({
|
|
4291
|
+
children,
|
|
4292
|
+
onChange,
|
|
4293
|
+
value,
|
|
4294
|
+
className,
|
|
4295
|
+
...props
|
|
4296
|
+
}) => {
|
|
4297
|
+
const currentValue = Number(value) || 0;
|
|
4298
|
+
const handleValueChange = (newValue) => {
|
|
4299
|
+
const syntheticEvent = {
|
|
4300
|
+
target: { value: String(newValue) }
|
|
4301
|
+
};
|
|
4302
|
+
onChange(syntheticEvent);
|
|
4303
|
+
};
|
|
4304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4305
|
+
"div",
|
|
4306
|
+
{
|
|
4307
|
+
className: cn(className, "flex flex-row items-center gap-4"),
|
|
4308
|
+
...props,
|
|
4309
|
+
children: [
|
|
4310
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
4311
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4312
|
+
Button,
|
|
4313
|
+
{
|
|
4314
|
+
variant: "outline",
|
|
4315
|
+
size: "icon",
|
|
4316
|
+
onClick: () => currentValue > 0 && handleValueChange(currentValue - 1),
|
|
4317
|
+
disabled: currentValue <= 0,
|
|
4318
|
+
className: "h-6 w-6 pb-0.5",
|
|
4319
|
+
children: "-"
|
|
4320
|
+
}
|
|
4321
|
+
),
|
|
4322
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w-8 text-center text-foreground", children: currentValue }),
|
|
4323
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4324
|
+
Button,
|
|
4325
|
+
{
|
|
4326
|
+
variant: "outline",
|
|
4327
|
+
size: "icon",
|
|
4328
|
+
onClick: () => handleValueChange(currentValue + 1),
|
|
4329
|
+
className: "h-6 w-6 pb-0.5",
|
|
4330
|
+
children: "+"
|
|
4331
|
+
}
|
|
4332
|
+
)
|
|
4333
|
+
] }),
|
|
4334
|
+
children
|
|
4335
|
+
]
|
|
4336
|
+
}
|
|
4337
|
+
);
|
|
4338
|
+
};
|
|
4339
|
+
var TotalPrice = ({ children }) => {
|
|
4340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "w-full font-semibold flex justify-between items-center", children });
|
|
4341
|
+
};
|
|
4342
|
+
var PricingDialogButton = ({
|
|
4343
|
+
children,
|
|
4344
|
+
size,
|
|
4345
|
+
onClick,
|
|
4346
|
+
disabled,
|
|
4347
|
+
className
|
|
4348
|
+
}) => {
|
|
4349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4350
|
+
Button,
|
|
4351
|
+
{
|
|
4352
|
+
onClick,
|
|
4353
|
+
disabled,
|
|
4354
|
+
size,
|
|
4355
|
+
className: cn(className, "shadow-sm shadow-stone-400"),
|
|
4356
|
+
children: [
|
|
4357
|
+
children,
|
|
4358
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ArrowRight, { className: "!h-3" })
|
|
4359
|
+
]
|
|
4360
|
+
}
|
|
4361
|
+
);
|
|
4362
|
+
};
|
|
4363
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4364
|
+
0 && (module.exports = {
|
|
4365
|
+
OptionsInput,
|
|
4366
|
+
PriceItem,
|
|
4367
|
+
PricingDialogButton,
|
|
4368
|
+
QuantityInput,
|
|
4369
|
+
TotalPrice
|
|
4370
|
+
});
|
|
4371
|
+
/*! Bundled license information:
|
|
4372
|
+
|
|
4373
|
+
lucide-react/dist/esm/shared/src/utils.js:
|
|
4374
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
|
4375
|
+
lucide-react/dist/esm/Icon.js:
|
|
4376
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
|
4377
|
+
lucide-react/dist/esm/icons/arrow-right.js:
|
|
4378
|
+
lucide-react/dist/esm/icons/loader-circle.js:
|
|
4379
|
+
lucide-react/dist/esm/icons/x.js:
|
|
4380
|
+
lucide-react/dist/esm/lucide-react.js:
|
|
4381
|
+
(**
|
|
4382
|
+
* @license lucide-react v0.523.0 - ISC
|
|
4383
|
+
*
|
|
4384
|
+
* This source code is licensed under the ISC license.
|
|
4385
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
4386
|
+
*)
|
|
4387
|
+
*/
|