autumn-js 0.0.67 → 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-6OVW4YXK.mjs → chunk-2JZFMBVR.mjs} +1 -1
- package/dist/libraries/backend/{chunk-AEEYR55J.mjs → chunk-GUZSIYGF.mjs} +1 -1
- package/dist/libraries/backend/{chunk-BYAXY6C4.mjs → chunk-J7UA442M.mjs} +1 -1
- package/dist/libraries/backend/chunk-PBBWXVWW.mjs +28 -0
- package/dist/libraries/backend/{chunk-46YP3QFO.mjs → chunk-T4YSUMNB.mjs} +9 -5
- package/dist/libraries/backend/chunk-UNZHJTEY.mjs +18 -0
- package/dist/libraries/backend/{chunk-IZAQ6MUN.mjs → chunk-Y2VYFWJD.mjs} +1 -1
- package/dist/libraries/backend/{chunk-6N4RVNZ5.mjs → chunk-ZF4V3SVZ.mjs} +1 -1
- package/dist/libraries/backend/express.d.mts +2 -1
- package/dist/libraries/backend/express.d.ts +2 -1
- package/dist/libraries/backend/express.js +45 -7
- package/dist/libraries/backend/express.mjs +14 -6
- package/dist/libraries/backend/fastify.js +26 -7
- package/dist/libraries/backend/fastify.mjs +7 -6
- package/dist/libraries/backend/hono.js +26 -7
- package/dist/libraries/backend/hono.mjs +7 -6
- package/dist/libraries/backend/next.js +52 -11
- package/dist/libraries/backend/next.mjs +21 -10
- package/dist/libraries/backend/react-router.js +26 -7
- package/dist/libraries/backend/react-router.mjs +7 -6
- package/dist/libraries/backend/{referralTypes-7NmhI47Z.d.mts → referralTypes-C-jpvu6u.d.mts} +57 -25
- package/dist/libraries/backend/{referralTypes-CURy8Tnw.d.ts → referralTypes-qdpA4XBw.d.ts} +57 -25
- package/dist/libraries/backend/remix_dep.js +26 -7
- package/dist/libraries/backend/remix_dep.mjs +7 -6
- package/dist/libraries/backend/routes/backendRouter.js +24 -5
- package/dist/libraries/backend/routes/backendRouter.mjs +7 -6
- package/dist/libraries/backend/routes/entityRoutes.js +1 -1
- package/dist/libraries/backend/routes/entityRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/genRoutes.js +1 -1
- package/dist/libraries/backend/routes/genRoutes.mjs +3 -3
- package/dist/libraries/backend/routes/productRoutes.d.mts +5 -0
- package/dist/libraries/backend/routes/productRoutes.d.ts +5 -0
- package/dist/libraries/backend/routes/productRoutes.js +594 -0
- package/dist/libraries/backend/routes/productRoutes.mjs +11 -0
- package/dist/libraries/backend/routes/referralRoutes.js +1 -1
- package/dist/libraries/backend/routes/referralRoutes.mjs +3 -3
- package/dist/libraries/backend/supabase.js +26 -7
- package/dist/libraries/backend/supabase.mjs +7 -6
- package/dist/libraries/backend/tanstack.js +26 -7
- package/dist/libraries/backend/tanstack.mjs +7 -6
- package/dist/libraries/backend/utils/backendRes.js +1 -1
- package/dist/libraries/backend/utils/backendRes.mjs +1 -1
- 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 +2 -2
- package/dist/libraries/backend/utils/withAuth.d.ts +2 -2
- package/dist/libraries/backend/utils/withAuth.js +1 -1
- package/dist/libraries/backend/utils/withAuth.mjs +2 -2
- package/dist/libraries/react/AutumnContext.d.mts +7 -6
- package/dist/libraries/react/AutumnContext.d.ts +7 -6
- package/dist/libraries/react/AutumnContext.js +13 -5
- package/dist/libraries/react/AutumnContext.mjs +6 -5
- package/dist/libraries/react/BaseAutumnProvider.d.mts +7 -6
- package/dist/libraries/react/BaseAutumnProvider.d.ts +7 -6
- package/dist/libraries/react/BaseAutumnProvider.js +378 -14
- package/dist/libraries/react/BaseAutumnProvider.mjs +11 -7
- package/dist/libraries/react/{ReactAutumnClient-EjsfCAgE.d.mts → ReactAutumnClient-4e3t4WTF.d.mts} +29 -6
- package/dist/libraries/react/{ReactAutumnClient-BM8hrCEC.d.ts → ReactAutumnClient-B-lWmwRW.d.ts} +29 -6
- package/dist/libraries/react/ReactAutumnProvider.d.mts +3 -2
- package/dist/libraries/react/ReactAutumnProvider.d.ts +3 -2
- package/dist/libraries/react/ReactAutumnProvider.js +389 -16
- package/dist/libraries/react/ReactAutumnProvider.mjs +12 -8
- package/dist/libraries/react/{response-B2MqTR7X.d.ts → checkTypes-BDNI_s2B.d.ts} +40 -53
- package/dist/libraries/react/{response-By38xiUq.d.mts → checkTypes-CyKIOmeF.d.mts} +40 -53
- 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-57I3B4BV.mjs → chunk-7PRD7RPD.mjs} +2 -2
- package/dist/libraries/react/{chunk-EOSHPHLH.mjs → chunk-B7HGBQCO.mjs} +4 -5
- package/dist/libraries/react/chunk-BCMBFJ7E.mjs +125 -0
- package/dist/libraries/react/{chunk-XDAZD5HF.mjs → chunk-CE5BBB5H.mjs} +18 -12
- package/dist/libraries/react/{chunk-JNJ53ZW6.mjs → chunk-EH2VPTFH.mjs} +1 -1
- package/dist/libraries/react/{chunk-5S5BL6HV.mjs → chunk-FHANCAHB.mjs} +2 -2
- package/dist/libraries/react/{chunk-A6J237PD.mjs → chunk-GTF7A5TG.mjs} +26 -7
- 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-NJFRQ6T4.mjs → chunk-QMIIDFRP.mjs} +7 -5
- package/dist/libraries/react/chunk-TFGQQAVB.mjs +38 -0
- package/dist/libraries/react/{chunk-BGEO5REY.mjs → chunk-X3HJKZGO.mjs} +5 -1
- package/dist/libraries/react/chunk-YUV2Y2RW.mjs +12 -0
- package/dist/libraries/react/{chunk-DMU3G7UZ.mjs → chunk-ZKHBOCMO.mjs} +2 -2
- package/dist/libraries/react/{chunk-CQ27LXPH.mjs → chunk-ZQ6LDLK5.mjs} +38 -35
- package/dist/libraries/react/{chunk-IXVPNA4H.mjs → chunk-ZWO4QYXI.mjs} +2 -2
- package/dist/libraries/react/{chunk-2MVQH6J5.mjs → chunk-ZXE5MFKL.mjs} +14 -5
- package/dist/libraries/react/client/ReactAutumnClient.d.mts +5 -5
- package/dist/libraries/react/client/ReactAutumnClient.d.ts +5 -5
- package/dist/libraries/react/client/ReactAutumnClient.js +10 -1
- package/dist/libraries/react/client/ReactAutumnClient.mjs +5 -4
- package/dist/libraries/react/client/clientCompMethods.d.mts +5 -5
- package/dist/libraries/react/client/clientCompMethods.d.ts +5 -5
- package/dist/libraries/react/client/clientCusMethods.d.mts +5 -5
- package/dist/libraries/react/client/clientCusMethods.d.ts +5 -5
- package/dist/libraries/react/client/clientEntityMethods.d.mts +5 -5
- package/dist/libraries/react/client/clientEntityMethods.d.ts +5 -5
- package/dist/libraries/react/client/clientGenMethods.d.mts +6 -6
- package/dist/libraries/react/client/clientGenMethods.d.ts +6 -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 +5 -5
- package/dist/libraries/react/client/clientReferralMethods.d.ts +5 -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/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/client/types/clientProdTypes.mjs +2 -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/{next/client/cusTypes-D9vXDh6B.d.mts → libraries/react/cusTypes-DNx5bwlw.d.mts} +13 -5
- package/dist/{next/client/cusTypes-D9vXDh6B.d.ts → libraries/react/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/errorUtils/logAuthError.js +1 -1
- package/dist/libraries/react/errorUtils/logAuthError.mjs +1 -1
- 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 +11 -39
- package/dist/libraries/react/hooks/useAutumn.d.ts +11 -39
- package/dist/libraries/react/hooks/useAutumn.js +167 -48
- package/dist/libraries/react/hooks/useAutumn.mjs +9 -8
- package/dist/libraries/react/hooks/useAutumnBase.d.mts +9 -41
- package/dist/libraries/react/hooks/useAutumnBase.d.ts +9 -41
- package/dist/libraries/react/hooks/useAutumnBase.js +167 -48
- package/dist/libraries/react/hooks/useAutumnBase.mjs +8 -7
- package/dist/libraries/react/hooks/useCustomer.d.mts +6 -5
- package/dist/libraries/react/hooks/useCustomer.d.ts +6 -5
- package/dist/libraries/react/hooks/useCustomer.js +375 -11
- package/dist/libraries/react/hooks/useCustomer.mjs +11 -7
- package/dist/libraries/react/hooks/useCustomerBase.d.mts +13 -6
- package/dist/libraries/react/hooks/useCustomerBase.d.ts +13 -6
- package/dist/libraries/react/hooks/useCustomerBase.js +374 -12
- package/dist/libraries/react/hooks/useCustomerBase.mjs +10 -6
- package/dist/libraries/react/hooks/useEntity.d.mts +10 -2
- package/dist/libraries/react/hooks/useEntity.d.ts +10 -2
- package/dist/libraries/react/hooks/useEntity.js +61 -6
- package/dist/libraries/react/hooks/useEntity.mjs +9 -7
- package/dist/libraries/react/hooks/useEntityBase.d.mts +13 -5
- package/dist/libraries/react/hooks/useEntityBase.d.ts +13 -5
- package/dist/libraries/react/hooks/useEntityBase.js +48 -1
- package/dist/libraries/react/hooks/useEntityBase.mjs +2 -1
- package/dist/libraries/react/hooks/usePricingTable.d.mts +4 -3
- package/dist/libraries/react/hooks/usePricingTable.d.ts +4 -3
- package/dist/libraries/react/hooks/usePricingTable.js +131 -15
- package/dist/libraries/react/hooks/usePricingTable.mjs +8 -7
- package/dist/libraries/react/hooks/usePricingTableBase.d.mts +7 -7
- package/dist/libraries/react/hooks/usePricingTableBase.d.ts +7 -7
- package/dist/libraries/react/hooks/usePricingTableBase.js +131 -15
- package/dist/libraries/react/hooks/usePricingTableBase.mjs +7 -6
- 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 -19
- package/dist/libraries/react/index.js +3965 -229
- package/dist/libraries/react/index.mjs +4869 -31
- 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/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/client/NextAutumnClient.d.mts +28 -7
- package/dist/next/client/NextAutumnClient.d.ts +28 -7
- package/dist/next/client/NextAutumnProvider.d.mts +1 -1
- package/dist/next/client/NextAutumnProvider.d.ts +1 -1
- 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/next/client/clientUtils.d.mts +2 -2
- package/dist/next/client/clientUtils.d.ts +2 -2
- package/dist/{libraries/react/cusTypes-Cf-s9PYP.d.ts → next/client/cusTypes-CV5q3GIA.d.mts} +13 -5
- package/dist/{libraries/react/cusTypes-Cf-s9PYP.d.mts → next/client/cusTypes-CV5q3GIA.d.ts} +13 -5
- package/dist/next/client/{entTypes-C2xwPhrH.d.mts → entTypes-C1-bumir.d.mts} +1 -1
- package/dist/next/client/{entTypes-D5Bk72AS.d.ts → entTypes-CKc2qHBt.d.ts} +1 -1
- 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 -41
- package/dist/next/client/hooks/useAutumn.d.ts +8 -41
- package/dist/next/client/hooks/useCustomer.d.mts +11 -4
- package/dist/next/client/hooks/useCustomer.d.ts +11 -4
- package/dist/next/client/hooks/useEntity.d.mts +10 -2
- package/dist/next/client/hooks/useEntity.d.ts +10 -2
- package/dist/next/client/hooks/usePricingTable.d.mts +16 -5
- package/dist/next/client/hooks/usePricingTable.d.ts +16 -5
- 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 +100 -192
- package/dist/next/index.d.ts +100 -192
- package/dist/next/server/auth/withNextAuth.d.mts +1 -1
- package/dist/next/server/auth/withNextAuth.d.ts +1 -1
- package/dist/next/server/{clientEntTypes-CWr4xXQ1.d.mts → clientEntTypes-BOVTwIKv.d.mts} +1 -1
- package/dist/next/server/{clientEntTypes-CWr4xXQ1.d.ts → clientEntTypes-BOVTwIKv.d.ts} +1 -1
- package/dist/next/server/componentActions.d.mts +1 -1
- package/dist/next/server/componentActions.d.ts +1 -1
- package/dist/next/server/cusActions.d.mts +48 -20
- package/dist/next/server/cusActions.d.ts +48 -20
- package/dist/next/server/{cusTypes-DYgbKGrd.d.mts → cusTypes-Cc8NWXXF.d.mts} +12 -8
- package/dist/next/server/{cusTypes-DYgbKGrd.d.ts → cusTypes-Cc8NWXXF.d.ts} +12 -8
- package/dist/next/server/genActions.d.mts +2 -2
- package/dist/next/server/genActions.d.ts +2 -2
- package/dist/sdk/index.d.mts +400 -26
- package/dist/sdk/index.d.ts +400 -26
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.mjs +1 -1
- package/dist/styles/global.css +1147 -0
- package/dist/utils/encryptUtils.js +1 -1
- package/dist/utils/encryptUtils.mjs +1 -1
- package/package.json +24 -5
- package/postcss.config.js +7 -0
- package/scripts/sync-registry.ts +292 -0
- package/tailwind.config.js +57 -0
- package/tsup.config.ts +86 -23
- package/tsup.dev.config.ts +196 -0
- package/dist/libraries/react/chunk-PSE3LKMR.mjs +0 -64
- package/dist/libraries/react/componentTypes-HF9MRJPX.d.mts +0 -15
- package/dist/libraries/react/componentTypes-HF9MRJPX.d.ts +0 -15
- package/dist/libraries/react/index.d.mts +0 -19
- package/dist/next/client/clientEntTypes-ClSxkMvK.d.mts +0 -29
- package/dist/next/client/clientEntTypes-DuYXyCN4.d.ts +0 -29
- package/dist/next/client/clientGenTypes-BvnGc6fc.d.mts +0 -156
- package/dist/next/client/clientGenTypes-F8OKtPMU.d.ts +0 -156
- package/dist/next/client/componentTypes-HF9MRJPX.d.mts +0 -15
- package/dist/next/client/componentTypes-HF9MRJPX.d.ts +0 -15
- package/dist/next/client/error-DHbclCVh.d.mts +0 -17
- package/dist/next/client/error-DHbclCVh.d.ts +0 -17
- 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/sdk/referrals.d.mts +0 -21
- package/dist/sdk/referrals.d.ts +0 -21
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
2
|
"use strict";
|
|
4
3
|
var __create = Object.create;
|
|
5
4
|
var __defProp = Object.defineProperty;
|
|
@@ -32,7 +31,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
32
31
|
// src/libraries/react/index.ts
|
|
33
32
|
var index_exports = {};
|
|
34
33
|
__export(index_exports, {
|
|
34
|
+
AttachDialog: () => AttachDialog,
|
|
35
35
|
AutumnProvider: () => ReactAutumnProvider,
|
|
36
|
+
CheckDialog: () => CheckDialog,
|
|
37
|
+
PricingTable: () => PricingTable,
|
|
36
38
|
useAutumn: () => useAutumn,
|
|
37
39
|
useCustomer: () => useCustomer,
|
|
38
40
|
useEntity: () => useEntity,
|
|
@@ -59,7 +61,7 @@ var useDialog = (component) => {
|
|
|
59
61
|
};
|
|
60
62
|
|
|
61
63
|
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
62
|
-
var
|
|
64
|
+
var import_swr2 = __toESM(require("swr"));
|
|
63
65
|
|
|
64
66
|
// src/sdk/error.ts
|
|
65
67
|
var AutumnError = class _AutumnError extends Error {
|
|
@@ -258,7 +260,7 @@ var listProducts = async ({
|
|
|
258
260
|
instance,
|
|
259
261
|
params
|
|
260
262
|
}) => {
|
|
261
|
-
let path = "/
|
|
263
|
+
let path = "/products_beta";
|
|
262
264
|
if (params) {
|
|
263
265
|
const queryParams = new URLSearchParams();
|
|
264
266
|
for (const [key, value] of Object.entries(params)) {
|
|
@@ -619,6 +621,12 @@ async function openBillingPortalMethod(params) {
|
|
|
619
621
|
return res;
|
|
620
622
|
}
|
|
621
623
|
|
|
624
|
+
// src/libraries/react/client/clientProdMethods.ts
|
|
625
|
+
async function listProductsMethod() {
|
|
626
|
+
const res = await this.get("/api/autumn/products");
|
|
627
|
+
return res;
|
|
628
|
+
}
|
|
629
|
+
|
|
622
630
|
// src/libraries/react/client/clientReferralMethods.ts
|
|
623
631
|
async function createCode(params) {
|
|
624
632
|
let snakeParams = toSnakeCase(params);
|
|
@@ -737,15 +745,17 @@ var AutumnClient = class {
|
|
|
737
745
|
createCode: createCode.bind(this),
|
|
738
746
|
redeemCode: redeemCode.bind(this)
|
|
739
747
|
};
|
|
748
|
+
products = {
|
|
749
|
+
list: listProductsMethod.bind(this)
|
|
750
|
+
};
|
|
740
751
|
};
|
|
741
752
|
|
|
742
753
|
// src/libraries/react/AutumnContext.tsx
|
|
743
754
|
var import_react2 = require("react");
|
|
744
755
|
var AutumnContext = (0, import_react2.createContext)({
|
|
745
756
|
initialized: false,
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
}),
|
|
757
|
+
disableDialogs: false,
|
|
758
|
+
client: new AutumnClient({ backendUrl: "" }),
|
|
749
759
|
paywallDialog: {
|
|
750
760
|
props: null,
|
|
751
761
|
setProps: () => {
|
|
@@ -756,7 +766,7 @@ var AutumnContext = (0, import_react2.createContext)({
|
|
|
756
766
|
setComponent: () => {
|
|
757
767
|
}
|
|
758
768
|
},
|
|
759
|
-
|
|
769
|
+
attachDialog: {
|
|
760
770
|
props: null,
|
|
761
771
|
setProps: () => {
|
|
762
772
|
},
|
|
@@ -778,154 +788,8 @@ var useAutumnContext = ({
|
|
|
778
788
|
return context;
|
|
779
789
|
};
|
|
780
790
|
|
|
781
|
-
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
782
|
-
var useCustomerBase = ({
|
|
783
|
-
params,
|
|
784
|
-
AutumnContext: AutumnContext2,
|
|
785
|
-
client
|
|
786
|
-
}) => {
|
|
787
|
-
const queryKey = ["customer"];
|
|
788
|
-
let context;
|
|
789
|
-
if (AutumnContext2) {
|
|
790
|
-
context = useAutumnContext({ AutumnContext: AutumnContext2, name: "useCustomer" });
|
|
791
|
-
}
|
|
792
|
-
if (!client) {
|
|
793
|
-
client = context.client;
|
|
794
|
-
}
|
|
795
|
-
const fetchCustomer = async () => {
|
|
796
|
-
const { data: data2, error: error2 } = await client.createCustomer({
|
|
797
|
-
errorOnNotFound: params?.errorOnNotFound,
|
|
798
|
-
expand: params?.expand
|
|
799
|
-
});
|
|
800
|
-
if (error2) {
|
|
801
|
-
throw error2;
|
|
802
|
-
}
|
|
803
|
-
if (!data2) {
|
|
804
|
-
return null;
|
|
805
|
-
}
|
|
806
|
-
return data2;
|
|
807
|
-
};
|
|
808
|
-
const { data, error, isLoading, mutate } = (0, import_swr.default)(queryKey, fetchCustomer, {
|
|
809
|
-
fallbackData: null,
|
|
810
|
-
onErrorRetry: (error2, key, config) => {
|
|
811
|
-
if (error2.code == "entity_not_found") {
|
|
812
|
-
return false;
|
|
813
|
-
}
|
|
814
|
-
return true;
|
|
815
|
-
}
|
|
816
|
-
});
|
|
817
|
-
return {
|
|
818
|
-
customer: error ? null : data,
|
|
819
|
-
isLoading,
|
|
820
|
-
error,
|
|
821
|
-
refetch: mutate,
|
|
822
|
-
createEntity: client.entities.create,
|
|
823
|
-
createReferralCode: client.referrals.createCode,
|
|
824
|
-
redeemReferralCode: client.referrals.redeemCode
|
|
825
|
-
};
|
|
826
|
-
};
|
|
827
|
-
|
|
828
|
-
// src/libraries/react/BaseAutumnProvider.tsx
|
|
829
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
830
|
-
function BaseAutumnProvider({
|
|
831
|
-
client,
|
|
832
|
-
children,
|
|
833
|
-
AutumnContext: AutumnContext2
|
|
834
|
-
}) {
|
|
835
|
-
const [components, setComponents] = (0, import_react3.useState)({});
|
|
836
|
-
const [paywallProps, setPaywallProps, paywallOpen, setPaywallOpen] = useDialog(components.paywallDialog);
|
|
837
|
-
const [
|
|
838
|
-
productChangeProps,
|
|
839
|
-
setProductChangeProps,
|
|
840
|
-
productChangeOpen,
|
|
841
|
-
setProductChangeOpen
|
|
842
|
-
] = useDialog(components.productChangeDialog);
|
|
843
|
-
useCustomerBase({ client, params: { errorOnNotFound: false } });
|
|
844
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
845
|
-
AutumnContext2.Provider,
|
|
846
|
-
{
|
|
847
|
-
value: {
|
|
848
|
-
initialized: true,
|
|
849
|
-
client,
|
|
850
|
-
paywallDialog: {
|
|
851
|
-
props: paywallProps,
|
|
852
|
-
setProps: setPaywallProps,
|
|
853
|
-
open: paywallOpen,
|
|
854
|
-
setOpen: setPaywallOpen,
|
|
855
|
-
setComponent: (component) => {
|
|
856
|
-
setComponents({
|
|
857
|
-
...components,
|
|
858
|
-
paywallDialog: component
|
|
859
|
-
});
|
|
860
|
-
}
|
|
861
|
-
},
|
|
862
|
-
prodChangeDialog: {
|
|
863
|
-
props: productChangeProps,
|
|
864
|
-
setProps: setProductChangeProps,
|
|
865
|
-
open: productChangeOpen,
|
|
866
|
-
setOpen: setProductChangeOpen,
|
|
867
|
-
setComponent: (component) => {
|
|
868
|
-
setComponents({
|
|
869
|
-
...components,
|
|
870
|
-
productChangeDialog: component
|
|
871
|
-
});
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
},
|
|
875
|
-
children: [
|
|
876
|
-
components.paywallDialog && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
877
|
-
components.paywallDialog,
|
|
878
|
-
{
|
|
879
|
-
open: paywallOpen,
|
|
880
|
-
setOpen: setPaywallOpen,
|
|
881
|
-
...paywallProps
|
|
882
|
-
}
|
|
883
|
-
),
|
|
884
|
-
components.productChangeDialog && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
885
|
-
components.productChangeDialog,
|
|
886
|
-
{
|
|
887
|
-
open: productChangeOpen,
|
|
888
|
-
setOpen: setProductChangeOpen,
|
|
889
|
-
...productChangeProps
|
|
890
|
-
}
|
|
891
|
-
),
|
|
892
|
-
children
|
|
893
|
-
]
|
|
894
|
-
}
|
|
895
|
-
);
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
// src/libraries/react/ReactAutumnProvider.tsx
|
|
899
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
900
|
-
var ReactAutumnProvider = ({
|
|
901
|
-
children,
|
|
902
|
-
getBearerToken,
|
|
903
|
-
backendUrl,
|
|
904
|
-
customerData,
|
|
905
|
-
includeCredentials = true
|
|
906
|
-
}) => {
|
|
907
|
-
if (backendUrl && !backendUrl.startsWith("http")) {
|
|
908
|
-
console.warn(`backendUrl is not a valid URL: ${backendUrl}`);
|
|
909
|
-
}
|
|
910
|
-
let client = new AutumnClient({
|
|
911
|
-
backendUrl: backendUrl || "",
|
|
912
|
-
getBearerToken,
|
|
913
|
-
customerData,
|
|
914
|
-
includeCredentials
|
|
915
|
-
});
|
|
916
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BaseAutumnProvider, { client, AutumnContext, children });
|
|
917
|
-
};
|
|
918
|
-
|
|
919
|
-
// src/libraries/react/hooks/useCustomer.tsx
|
|
920
|
-
var useCustomer = (params) => {
|
|
921
|
-
return useCustomerBase({
|
|
922
|
-
params,
|
|
923
|
-
AutumnContext
|
|
924
|
-
});
|
|
925
|
-
};
|
|
926
|
-
|
|
927
791
|
// src/libraries/react/hooks/usePricingTableBase.tsx
|
|
928
|
-
var
|
|
792
|
+
var import_swr = __toESM(require("swr"));
|
|
929
793
|
var mergeProductDetails = (products, productDetails) => {
|
|
930
794
|
if (!products) {
|
|
931
795
|
return null;
|
|
@@ -933,17 +797,124 @@ var mergeProductDetails = (products, productDetails) => {
|
|
|
933
797
|
if (!productDetails) {
|
|
934
798
|
return products;
|
|
935
799
|
}
|
|
936
|
-
let
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
if (
|
|
940
|
-
|
|
800
|
+
let fetchedProducts = structuredClone(products);
|
|
801
|
+
let mergedProducts = [];
|
|
802
|
+
for (const overrideDetails of productDetails) {
|
|
803
|
+
if (!overrideDetails.id) {
|
|
804
|
+
let properties = {};
|
|
805
|
+
let overrideItems2 = overrideDetails.items?.map((item) => ({
|
|
806
|
+
display: {
|
|
807
|
+
primary_text: item.primaryText,
|
|
808
|
+
secondary_text: item.secondaryText
|
|
809
|
+
}
|
|
810
|
+
}));
|
|
811
|
+
let overridePrice2 = overrideDetails.price;
|
|
812
|
+
if (overrideDetails.price) {
|
|
813
|
+
properties.is_free = false;
|
|
814
|
+
overrideItems2 = [
|
|
815
|
+
{
|
|
816
|
+
display: {
|
|
817
|
+
primary_text: overridePrice2?.primaryText,
|
|
818
|
+
secondary_text: overridePrice2?.secondaryText
|
|
819
|
+
}
|
|
820
|
+
},
|
|
821
|
+
...overrideItems2 || []
|
|
822
|
+
];
|
|
823
|
+
}
|
|
824
|
+
mergedProducts.push({
|
|
825
|
+
name: overrideDetails.name || "",
|
|
826
|
+
display: {
|
|
827
|
+
description: overrideDetails.description,
|
|
828
|
+
button_text: overrideDetails.buttonText,
|
|
829
|
+
recommend_text: overrideDetails.recommendText,
|
|
830
|
+
everything_from: overrideDetails.everythingFrom,
|
|
831
|
+
button_url: overrideDetails.buttonUrl
|
|
832
|
+
},
|
|
833
|
+
items: overrideItems2,
|
|
834
|
+
properties
|
|
835
|
+
});
|
|
836
|
+
continue;
|
|
837
|
+
}
|
|
838
|
+
let fetchedProduct = fetchedProducts.find(
|
|
839
|
+
(p) => p.id === overrideDetails.id
|
|
840
|
+
);
|
|
841
|
+
if (!fetchedProduct) {
|
|
941
842
|
continue;
|
|
942
843
|
}
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
844
|
+
const originalIsFree = fetchedProduct.properties?.is_free;
|
|
845
|
+
let overrideProperties = fetchedProduct.properties || {};
|
|
846
|
+
let overrideItems = overrideDetails.items;
|
|
847
|
+
let overridePrice = overrideDetails.price;
|
|
848
|
+
let mergedItems = [];
|
|
849
|
+
if (overridePrice) {
|
|
850
|
+
overrideProperties.is_free = false;
|
|
851
|
+
if (originalIsFree || overrideItems !== void 0) {
|
|
852
|
+
mergedItems.push({
|
|
853
|
+
display: {
|
|
854
|
+
primary_text: overridePrice.primaryText,
|
|
855
|
+
secondary_text: overridePrice.secondaryText
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
} else {
|
|
859
|
+
fetchedProduct.items[0].display = {
|
|
860
|
+
primary_text: overridePrice.primaryText,
|
|
861
|
+
secondary_text: overridePrice.secondaryText
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
} else {
|
|
865
|
+
if (overrideItems && !originalIsFree) {
|
|
866
|
+
mergedItems.push(fetchedProduct.items[0]);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
if (overrideItems) {
|
|
870
|
+
for (const overrideItem of overrideItems) {
|
|
871
|
+
if (!overrideItem.featureId) {
|
|
872
|
+
mergedItems.push({
|
|
873
|
+
display: {
|
|
874
|
+
primary_text: overrideItem.primaryText,
|
|
875
|
+
secondary_text: overrideItem.secondaryText
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
} else {
|
|
879
|
+
let fetchedItem = fetchedProduct.items.find(
|
|
880
|
+
(i) => i.feature_id === overrideItem.featureId
|
|
881
|
+
);
|
|
882
|
+
if (!fetchedItem) {
|
|
883
|
+
console.error(
|
|
884
|
+
`Feature with id ${overrideItem.featureId} not found for product ${fetchedProduct.id}`
|
|
885
|
+
);
|
|
886
|
+
continue;
|
|
887
|
+
}
|
|
888
|
+
mergedItems.push({
|
|
889
|
+
...fetchedItem,
|
|
890
|
+
display: {
|
|
891
|
+
primary_text: overrideItem.primaryText || fetchedItem.display?.primary_text,
|
|
892
|
+
secondary_text: overrideItem.secondaryText || fetchedItem.display?.secondary_text
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
} else {
|
|
898
|
+
mergedItems = fetchedProduct.items;
|
|
899
|
+
}
|
|
900
|
+
const mergedProduct = {
|
|
901
|
+
...fetchedProduct,
|
|
902
|
+
name: overrideDetails.name || fetchedProduct.name,
|
|
903
|
+
items: mergedItems,
|
|
904
|
+
properties: overrideProperties,
|
|
905
|
+
display: {
|
|
906
|
+
description: overrideDetails.description,
|
|
907
|
+
button_text: overrideDetails.buttonText,
|
|
908
|
+
recommend_text: overrideDetails.recommendText,
|
|
909
|
+
everything_from: overrideDetails.everythingFrom,
|
|
910
|
+
button_url: overrideDetails.buttonUrl
|
|
911
|
+
}
|
|
912
|
+
// description: overrideDetails.description,
|
|
913
|
+
// button_text: overrideDetails.buttonText,
|
|
914
|
+
// recommend_text: overrideDetails.recommendText,
|
|
915
|
+
// everything_from: overrideDetails.everythingFrom,
|
|
946
916
|
};
|
|
917
|
+
mergedProducts.push(mergedProduct);
|
|
947
918
|
}
|
|
948
919
|
return mergedProducts;
|
|
949
920
|
};
|
|
@@ -954,7 +925,7 @@ var usePricingTableBase = ({
|
|
|
954
925
|
const context = useAutumnContext({ AutumnContext: AutumnContext2, name: "usePricingTable" });
|
|
955
926
|
const fetcher = async () => {
|
|
956
927
|
try {
|
|
957
|
-
const { data: data2, error: error2 } = await context.client.
|
|
928
|
+
const { data: data2, error: error2 } = await context.client.products.list();
|
|
958
929
|
if (error2) throw error2;
|
|
959
930
|
return data2?.list || [];
|
|
960
931
|
} catch (error2) {
|
|
@@ -964,12 +935,13 @@ var usePricingTableBase = ({
|
|
|
964
935
|
});
|
|
965
936
|
}
|
|
966
937
|
};
|
|
967
|
-
const { data, error, mutate } = (0,
|
|
938
|
+
const { data, error, mutate } = (0, import_swr.default)(
|
|
968
939
|
"pricing-table",
|
|
969
940
|
fetcher
|
|
970
941
|
);
|
|
971
942
|
return {
|
|
972
|
-
products: mergeProductDetails(data ||
|
|
943
|
+
products: mergeProductDetails(data || [], params?.productDetails),
|
|
944
|
+
// products: data || [],
|
|
973
945
|
isLoading: !error && !data,
|
|
974
946
|
error,
|
|
975
947
|
refetch: mutate
|
|
@@ -981,21 +953,41 @@ var useAutumnBase = ({
|
|
|
981
953
|
AutumnContext: AutumnContext2
|
|
982
954
|
}) => {
|
|
983
955
|
const context = useAutumnContext({ AutumnContext: AutumnContext2, name: "useAutumn" });
|
|
984
|
-
const {
|
|
956
|
+
const { attachDialog, paywallDialog } = context;
|
|
985
957
|
const client = context.client;
|
|
986
958
|
const { refetch: refetchPricingTable } = usePricingTableBase({
|
|
987
959
|
AutumnContext: AutumnContext2
|
|
988
960
|
});
|
|
989
961
|
let {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
962
|
+
open: attachOpen,
|
|
963
|
+
setProps: setAttachProps,
|
|
964
|
+
setOpen: setAttachOpen,
|
|
965
|
+
setComponent: setAttachComponent
|
|
966
|
+
} = attachDialog;
|
|
994
967
|
let {
|
|
995
|
-
setProps:
|
|
996
|
-
setOpen:
|
|
968
|
+
setProps: setCheckProps,
|
|
969
|
+
setOpen: setCheckOpen,
|
|
997
970
|
setComponent: setPaywallComponent
|
|
998
971
|
} = paywallDialog;
|
|
972
|
+
const attachWithoutDialog = async (params) => {
|
|
973
|
+
const result = await client.attach(params);
|
|
974
|
+
if (result.error) {
|
|
975
|
+
return result;
|
|
976
|
+
}
|
|
977
|
+
let data = result.data;
|
|
978
|
+
if (data?.checkout_url && typeof window !== "undefined") {
|
|
979
|
+
if (params.openInNewTab) {
|
|
980
|
+
window.open(data.checkout_url, "_blank");
|
|
981
|
+
} else {
|
|
982
|
+
window.location.href = data.checkout_url;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
await refetchPricingTable();
|
|
986
|
+
if (setAttachOpen) {
|
|
987
|
+
setAttachOpen(false);
|
|
988
|
+
}
|
|
989
|
+
return result;
|
|
990
|
+
};
|
|
999
991
|
const attachWithDialog = async (params) => {
|
|
1000
992
|
let { dialog, ...rest } = params;
|
|
1001
993
|
const { productId, entityId, entityData } = params;
|
|
@@ -1010,38 +1002,21 @@ var useAutumnBase = ({
|
|
|
1010
1002
|
}
|
|
1011
1003
|
let preview = checkRes.data.preview;
|
|
1012
1004
|
if (!preview) {
|
|
1013
|
-
return await
|
|
1005
|
+
return await attachWithoutDialog(rest);
|
|
1014
1006
|
} else {
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
});
|
|
1018
|
-
setProdChangeDialogOpen(true);
|
|
1007
|
+
setAttachProps({ preview });
|
|
1008
|
+
setAttachOpen(true);
|
|
1019
1009
|
}
|
|
1020
1010
|
return checkRes;
|
|
1021
1011
|
};
|
|
1022
1012
|
const attach = async (params) => {
|
|
1023
1013
|
const { dialog, openInNewTab } = params;
|
|
1024
|
-
|
|
1025
|
-
|
|
1014
|
+
let finalDialog = dialog;
|
|
1015
|
+
if (finalDialog && !attachOpen) {
|
|
1016
|
+
setAttachComponent(finalDialog);
|
|
1026
1017
|
return await attachWithDialog(params);
|
|
1027
1018
|
}
|
|
1028
|
-
|
|
1029
|
-
if (result.error) {
|
|
1030
|
-
return result;
|
|
1031
|
-
}
|
|
1032
|
-
let data = result.data;
|
|
1033
|
-
if (data?.checkout_url && typeof window !== "undefined") {
|
|
1034
|
-
if (openInNewTab) {
|
|
1035
|
-
window.open(data.checkout_url, "_blank");
|
|
1036
|
-
} else {
|
|
1037
|
-
window.location.href = data.checkout_url;
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
await refetchPricingTable();
|
|
1041
|
-
if (setProdChangeDialogOpen) {
|
|
1042
|
-
setProdChangeDialogOpen(false);
|
|
1043
|
-
}
|
|
1044
|
-
return result;
|
|
1019
|
+
return await attachWithoutDialog(params);
|
|
1045
1020
|
};
|
|
1046
1021
|
const cancel = async (params) => {
|
|
1047
1022
|
const res = await client.cancel(params);
|
|
@@ -1065,8 +1040,8 @@ var useAutumnBase = ({
|
|
|
1065
1040
|
let data = res.data;
|
|
1066
1041
|
if (data && data.preview && dialog) {
|
|
1067
1042
|
let preview = data.preview;
|
|
1068
|
-
|
|
1069
|
-
|
|
1043
|
+
setCheckProps({ preview });
|
|
1044
|
+
setCheckOpen(true);
|
|
1070
1045
|
}
|
|
1071
1046
|
return res;
|
|
1072
1047
|
};
|
|
@@ -1110,43 +1085,85 @@ var useAutumnBase = ({
|
|
|
1110
1085
|
};
|
|
1111
1086
|
};
|
|
1112
1087
|
|
|
1113
|
-
// src/libraries/react/hooks/
|
|
1114
|
-
var
|
|
1115
|
-
|
|
1088
|
+
// src/libraries/react/hooks/handleAllowed.ts
|
|
1089
|
+
var getCusFeature = ({
|
|
1090
|
+
customer,
|
|
1091
|
+
featureId,
|
|
1092
|
+
requiredBalance = 1
|
|
1093
|
+
}) => {
|
|
1094
|
+
let creditSchema = Object.values(customer.features).find((f) => f.credit_schema && f.credit_schema.some((c) => c.feature_id === featureId));
|
|
1095
|
+
if (creditSchema) {
|
|
1096
|
+
let schemaItem = creditSchema.credit_schema?.find((c) => c.feature_id === featureId);
|
|
1097
|
+
return {
|
|
1098
|
+
feature: creditSchema,
|
|
1099
|
+
requiredBalance: schemaItem.credit_amount * requiredBalance
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
return {
|
|
1103
|
+
cusFeature: customer.features[featureId],
|
|
1104
|
+
requiredBalance
|
|
1105
|
+
};
|
|
1116
1106
|
};
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
return
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1107
|
+
var handleFeatureAllowed = ({ customer, params }) => {
|
|
1108
|
+
let { cusFeature, requiredBalance } = getCusFeature({ customer, featureId: params.featureId });
|
|
1109
|
+
if (!cusFeature) return false;
|
|
1110
|
+
if (cusFeature.type == "static") return true;
|
|
1111
|
+
if (cusFeature.unlimited || cusFeature.overage_allowed) return true;
|
|
1112
|
+
return (cusFeature.balance || 0) >= requiredBalance;
|
|
1113
|
+
};
|
|
1114
|
+
var handleAllowed = ({ customer, params }) => {
|
|
1115
|
+
if (!customer) return false;
|
|
1116
|
+
if (!params.featureId && !params.productId) {
|
|
1117
|
+
throw new Error("allowed() requires either featureId or productId");
|
|
1118
|
+
}
|
|
1119
|
+
if (params.featureId) {
|
|
1120
|
+
return handleFeatureAllowed({ customer, params });
|
|
1121
|
+
}
|
|
1122
|
+
if (params.productId) {
|
|
1123
|
+
let product = customer.products.find((p) => p.id == params.productId);
|
|
1124
|
+
if (!product) return false;
|
|
1125
|
+
let status = product.status;
|
|
1126
|
+
if (status == "scheduled") return false;
|
|
1127
|
+
return true;
|
|
1128
|
+
}
|
|
1129
|
+
return false;
|
|
1124
1130
|
};
|
|
1125
1131
|
|
|
1126
|
-
// src/libraries/react/hooks/
|
|
1127
|
-
var
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1132
|
+
// src/libraries/react/hooks/useCustomerBase.tsx
|
|
1133
|
+
var emptyDefaultFunctions = {
|
|
1134
|
+
attach: "",
|
|
1135
|
+
check: "",
|
|
1136
|
+
track: "",
|
|
1137
|
+
cancel: "",
|
|
1138
|
+
openBillingPortal: ""
|
|
1139
|
+
};
|
|
1140
|
+
var useCustomerBase = ({
|
|
1131
1141
|
params,
|
|
1132
|
-
AutumnContext: AutumnContext2
|
|
1142
|
+
AutumnContext: AutumnContext2,
|
|
1143
|
+
client
|
|
1133
1144
|
}) => {
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1145
|
+
const queryKey = ["customer"];
|
|
1146
|
+
let context;
|
|
1147
|
+
if (AutumnContext2) {
|
|
1148
|
+
context = useAutumnContext({ AutumnContext: AutumnContext2, name: "useCustomer" });
|
|
1149
|
+
}
|
|
1150
|
+
if (!client) {
|
|
1151
|
+
client = context.client;
|
|
1152
|
+
}
|
|
1153
|
+
const fetchCustomer = async () => {
|
|
1154
|
+
const { data, error: error2 } = await client.createCustomer({
|
|
1155
|
+
errorOnNotFound: params?.errorOnNotFound,
|
|
1156
|
+
expand: params?.expand
|
|
1157
|
+
});
|
|
1141
1158
|
if (error2) {
|
|
1142
1159
|
throw error2;
|
|
1143
1160
|
}
|
|
1144
|
-
if (!
|
|
1161
|
+
if (!data) {
|
|
1145
1162
|
return null;
|
|
1146
1163
|
}
|
|
1147
|
-
return
|
|
1164
|
+
return data;
|
|
1148
1165
|
};
|
|
1149
|
-
const { data, error, isLoading, mutate } = (0,
|
|
1166
|
+
const { data: customer, error, isLoading, mutate } = (0, import_swr2.default)(queryKey, fetchCustomer, {
|
|
1150
1167
|
fallbackData: null,
|
|
1151
1168
|
onErrorRetry: (error2, key, config) => {
|
|
1152
1169
|
if (error2.code == "entity_not_found") {
|
|
@@ -1155,10 +1172,177 @@ var useEntityBase = ({
|
|
|
1155
1172
|
return true;
|
|
1156
1173
|
}
|
|
1157
1174
|
});
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1175
|
+
let autumnFunctions = emptyDefaultFunctions;
|
|
1176
|
+
if (AutumnContext2) {
|
|
1177
|
+
autumnFunctions = useAutumnBase({ AutumnContext: AutumnContext2 });
|
|
1178
|
+
}
|
|
1179
|
+
return {
|
|
1180
|
+
customer: error ? null : customer,
|
|
1181
|
+
isLoading,
|
|
1182
|
+
error,
|
|
1183
|
+
refetch: mutate,
|
|
1184
|
+
...autumnFunctions,
|
|
1185
|
+
createEntity: client.entities.create,
|
|
1186
|
+
createReferralCode: client.referrals.createCode,
|
|
1187
|
+
redeemReferralCode: client.referrals.redeemCode,
|
|
1188
|
+
allowed: (params2) => handleAllowed({ customer, params: params2 })
|
|
1189
|
+
};
|
|
1190
|
+
};
|
|
1191
|
+
|
|
1192
|
+
// src/libraries/react/BaseAutumnProvider.tsx
|
|
1193
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
1194
|
+
function BaseAutumnProvider({
|
|
1195
|
+
client,
|
|
1196
|
+
children,
|
|
1197
|
+
AutumnContext: AutumnContext2,
|
|
1198
|
+
disableDialogs = false
|
|
1199
|
+
}) {
|
|
1200
|
+
const [components, setComponents] = (0, import_react3.useState)({});
|
|
1201
|
+
const [paywallProps, setPaywallProps, paywallOpen, setPaywallOpen] = useDialog(components.paywallDialog);
|
|
1202
|
+
const [
|
|
1203
|
+
productChangeProps,
|
|
1204
|
+
setProductChangeProps,
|
|
1205
|
+
productChangeOpen,
|
|
1206
|
+
setProductChangeOpen
|
|
1207
|
+
] = useDialog(components.productChangeDialog);
|
|
1208
|
+
useCustomerBase({ client, params: { errorOnNotFound: false } });
|
|
1209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1210
|
+
AutumnContext2.Provider,
|
|
1211
|
+
{
|
|
1212
|
+
value: {
|
|
1213
|
+
initialized: true,
|
|
1214
|
+
client,
|
|
1215
|
+
disableDialogs,
|
|
1216
|
+
paywallDialog: {
|
|
1217
|
+
props: paywallProps,
|
|
1218
|
+
setProps: setPaywallProps,
|
|
1219
|
+
open: paywallOpen,
|
|
1220
|
+
setOpen: setPaywallOpen,
|
|
1221
|
+
setComponent: (component) => {
|
|
1222
|
+
setComponents({
|
|
1223
|
+
...components,
|
|
1224
|
+
paywallDialog: component
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1227
|
+
},
|
|
1228
|
+
attachDialog: {
|
|
1229
|
+
props: productChangeProps,
|
|
1230
|
+
setProps: setProductChangeProps,
|
|
1231
|
+
open: productChangeOpen,
|
|
1232
|
+
setOpen: setProductChangeOpen,
|
|
1233
|
+
setComponent: (component) => {
|
|
1234
|
+
setComponents({
|
|
1235
|
+
...components,
|
|
1236
|
+
productChangeDialog: component
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
},
|
|
1241
|
+
children: [
|
|
1242
|
+
components.paywallDialog && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1243
|
+
components.paywallDialog,
|
|
1244
|
+
{
|
|
1245
|
+
open: paywallOpen,
|
|
1246
|
+
setOpen: setPaywallOpen,
|
|
1247
|
+
...paywallProps
|
|
1248
|
+
}
|
|
1249
|
+
),
|
|
1250
|
+
components.productChangeDialog && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1251
|
+
components.productChangeDialog,
|
|
1252
|
+
{
|
|
1253
|
+
open: productChangeOpen,
|
|
1254
|
+
setOpen: setProductChangeOpen,
|
|
1255
|
+
...productChangeProps
|
|
1256
|
+
}
|
|
1257
|
+
),
|
|
1258
|
+
children
|
|
1259
|
+
]
|
|
1260
|
+
}
|
|
1261
|
+
);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
// src/libraries/react/ReactAutumnProvider.tsx
|
|
1265
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1266
|
+
var ReactAutumnProvider = ({
|
|
1267
|
+
children,
|
|
1268
|
+
getBearerToken,
|
|
1269
|
+
backendUrl,
|
|
1270
|
+
customerData,
|
|
1271
|
+
includeCredentials = true,
|
|
1272
|
+
disableDialogs = false
|
|
1273
|
+
}) => {
|
|
1274
|
+
if (backendUrl && !backendUrl.startsWith("http")) {
|
|
1275
|
+
console.warn(`backendUrl is not a valid URL: ${backendUrl}`);
|
|
1276
|
+
}
|
|
1277
|
+
let client = new AutumnClient({
|
|
1278
|
+
backendUrl: backendUrl || "",
|
|
1279
|
+
getBearerToken,
|
|
1280
|
+
customerData,
|
|
1281
|
+
includeCredentials
|
|
1282
|
+
});
|
|
1283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1284
|
+
BaseAutumnProvider,
|
|
1285
|
+
{
|
|
1286
|
+
client,
|
|
1287
|
+
AutumnContext,
|
|
1288
|
+
disableDialogs,
|
|
1289
|
+
children
|
|
1290
|
+
}
|
|
1291
|
+
);
|
|
1292
|
+
};
|
|
1293
|
+
|
|
1294
|
+
// src/libraries/react/hooks/useCustomer.tsx
|
|
1295
|
+
var useCustomer = (params) => {
|
|
1296
|
+
return useCustomerBase({
|
|
1297
|
+
params,
|
|
1298
|
+
AutumnContext
|
|
1299
|
+
});
|
|
1300
|
+
};
|
|
1301
|
+
|
|
1302
|
+
// src/libraries/react/hooks/usePricingTable.tsx
|
|
1303
|
+
var usePricingTable = (params) => {
|
|
1304
|
+
return usePricingTableBase({
|
|
1305
|
+
AutumnContext,
|
|
1306
|
+
params
|
|
1307
|
+
});
|
|
1308
|
+
};
|
|
1309
|
+
|
|
1310
|
+
// src/libraries/react/hooks/useEntityBase.tsx
|
|
1311
|
+
var import_swr3 = __toESM(require("swr"));
|
|
1312
|
+
var import_react4 = require("react");
|
|
1313
|
+
var useEntityBase = ({
|
|
1314
|
+
entityId,
|
|
1315
|
+
params,
|
|
1316
|
+
AutumnContext: AutumnContext2
|
|
1317
|
+
}) => {
|
|
1318
|
+
const { client } = (0, import_react4.useContext)(AutumnContext2);
|
|
1319
|
+
const queryKey = ["entity", entityId, params?.expand];
|
|
1320
|
+
const fetchEntity = async () => {
|
|
1321
|
+
if (!entityId) {
|
|
1322
|
+
return null;
|
|
1323
|
+
}
|
|
1324
|
+
const { data: data2, error: error2 } = await client.entities.get(entityId, params);
|
|
1325
|
+
if (error2) {
|
|
1326
|
+
throw error2;
|
|
1327
|
+
}
|
|
1328
|
+
if (!data2) {
|
|
1329
|
+
return null;
|
|
1330
|
+
}
|
|
1331
|
+
return data2;
|
|
1332
|
+
};
|
|
1333
|
+
const { data, error, isLoading, mutate } = (0, import_swr3.default)(queryKey, fetchEntity, {
|
|
1334
|
+
fallbackData: null,
|
|
1335
|
+
onErrorRetry: (error2, key, config) => {
|
|
1336
|
+
if (error2.code == "entity_not_found") {
|
|
1337
|
+
return false;
|
|
1338
|
+
}
|
|
1339
|
+
return true;
|
|
1340
|
+
}
|
|
1341
|
+
});
|
|
1342
|
+
if (!entityId) {
|
|
1343
|
+
return {
|
|
1344
|
+
entity: null,
|
|
1345
|
+
isLoading: false,
|
|
1162
1346
|
error: null,
|
|
1163
1347
|
refetch: mutate
|
|
1164
1348
|
};
|
|
@@ -1167,7 +1351,8 @@ var useEntityBase = ({
|
|
|
1167
1351
|
entity: error ? null : data,
|
|
1168
1352
|
isLoading,
|
|
1169
1353
|
error,
|
|
1170
|
-
refetch: mutate
|
|
1354
|
+
refetch: mutate,
|
|
1355
|
+
allowed: (params2) => handleAllowed({ customer: data, params: params2 })
|
|
1171
1356
|
};
|
|
1172
1357
|
};
|
|
1173
1358
|
|
|
@@ -1175,11 +1360,3562 @@ var useEntityBase = ({
|
|
|
1175
1360
|
var useEntity = (entityId, params) => {
|
|
1176
1361
|
return useEntityBase({ AutumnContext, entityId, params });
|
|
1177
1362
|
};
|
|
1363
|
+
|
|
1364
|
+
// src/libraries/react/hooks/useAutumn.tsx
|
|
1365
|
+
var useAutumn = () => {
|
|
1366
|
+
return useAutumnBase({ AutumnContext });
|
|
1367
|
+
};
|
|
1368
|
+
|
|
1369
|
+
// src/libraries/react/components/attach-dialog/attach-dialog-synced.tsx
|
|
1370
|
+
var import_react7 = require("react");
|
|
1371
|
+
|
|
1372
|
+
// ../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
1373
|
+
function r(e) {
|
|
1374
|
+
var t, f, n = "";
|
|
1375
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
1376
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
1377
|
+
var o = e.length;
|
|
1378
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
1379
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
1380
|
+
return n;
|
|
1381
|
+
}
|
|
1382
|
+
function clsx() {
|
|
1383
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
1384
|
+
return n;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
// ../node_modules/.pnpm/tailwind-merge@2.6.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
1388
|
+
var CLASS_PART_SEPARATOR = "-";
|
|
1389
|
+
var createClassGroupUtils = (config) => {
|
|
1390
|
+
const classMap = createClassMap(config);
|
|
1391
|
+
const {
|
|
1392
|
+
conflictingClassGroups,
|
|
1393
|
+
conflictingClassGroupModifiers
|
|
1394
|
+
} = config;
|
|
1395
|
+
const getClassGroupId = (className) => {
|
|
1396
|
+
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
1397
|
+
if (classParts[0] === "" && classParts.length !== 1) {
|
|
1398
|
+
classParts.shift();
|
|
1399
|
+
}
|
|
1400
|
+
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
1401
|
+
};
|
|
1402
|
+
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
1403
|
+
const conflicts = conflictingClassGroups[classGroupId] || [];
|
|
1404
|
+
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
|
|
1405
|
+
return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
|
|
1406
|
+
}
|
|
1407
|
+
return conflicts;
|
|
1408
|
+
};
|
|
1409
|
+
return {
|
|
1410
|
+
getClassGroupId,
|
|
1411
|
+
getConflictingClassGroupIds
|
|
1412
|
+
};
|
|
1413
|
+
};
|
|
1414
|
+
var getGroupRecursive = (classParts, classPartObject) => {
|
|
1415
|
+
if (classParts.length === 0) {
|
|
1416
|
+
return classPartObject.classGroupId;
|
|
1417
|
+
}
|
|
1418
|
+
const currentClassPart = classParts[0];
|
|
1419
|
+
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
1420
|
+
const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0;
|
|
1421
|
+
if (classGroupFromNextClassPart) {
|
|
1422
|
+
return classGroupFromNextClassPart;
|
|
1423
|
+
}
|
|
1424
|
+
if (classPartObject.validators.length === 0) {
|
|
1425
|
+
return void 0;
|
|
1426
|
+
}
|
|
1427
|
+
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
1428
|
+
return classPartObject.validators.find(({
|
|
1429
|
+
validator
|
|
1430
|
+
}) => validator(classRest))?.classGroupId;
|
|
1431
|
+
};
|
|
1432
|
+
var arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
1433
|
+
var getGroupIdForArbitraryProperty = (className) => {
|
|
1434
|
+
if (arbitraryPropertyRegex.test(className)) {
|
|
1435
|
+
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
1436
|
+
const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(":"));
|
|
1437
|
+
if (property) {
|
|
1438
|
+
return "arbitrary.." + property;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
};
|
|
1442
|
+
var createClassMap = (config) => {
|
|
1443
|
+
const {
|
|
1444
|
+
theme,
|
|
1445
|
+
prefix
|
|
1446
|
+
} = config;
|
|
1447
|
+
const classMap = {
|
|
1448
|
+
nextPart: /* @__PURE__ */ new Map(),
|
|
1449
|
+
validators: []
|
|
1450
|
+
};
|
|
1451
|
+
const prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);
|
|
1452
|
+
prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {
|
|
1453
|
+
processClassesRecursively(classGroup, classMap, classGroupId, theme);
|
|
1454
|
+
});
|
|
1455
|
+
return classMap;
|
|
1456
|
+
};
|
|
1457
|
+
var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
1458
|
+
classGroup.forEach((classDefinition) => {
|
|
1459
|
+
if (typeof classDefinition === "string") {
|
|
1460
|
+
const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
|
|
1461
|
+
classPartObjectToEdit.classGroupId = classGroupId;
|
|
1462
|
+
return;
|
|
1463
|
+
}
|
|
1464
|
+
if (typeof classDefinition === "function") {
|
|
1465
|
+
if (isThemeGetter(classDefinition)) {
|
|
1466
|
+
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
|
|
1467
|
+
return;
|
|
1468
|
+
}
|
|
1469
|
+
classPartObject.validators.push({
|
|
1470
|
+
validator: classDefinition,
|
|
1471
|
+
classGroupId
|
|
1472
|
+
});
|
|
1473
|
+
return;
|
|
1474
|
+
}
|
|
1475
|
+
Object.entries(classDefinition).forEach(([key, classGroup2]) => {
|
|
1476
|
+
processClassesRecursively(classGroup2, getPart(classPartObject, key), classGroupId, theme);
|
|
1477
|
+
});
|
|
1478
|
+
});
|
|
1479
|
+
};
|
|
1480
|
+
var getPart = (classPartObject, path) => {
|
|
1481
|
+
let currentClassPartObject = classPartObject;
|
|
1482
|
+
path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
|
|
1483
|
+
if (!currentClassPartObject.nextPart.has(pathPart)) {
|
|
1484
|
+
currentClassPartObject.nextPart.set(pathPart, {
|
|
1485
|
+
nextPart: /* @__PURE__ */ new Map(),
|
|
1486
|
+
validators: []
|
|
1487
|
+
});
|
|
1488
|
+
}
|
|
1489
|
+
currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
|
|
1490
|
+
});
|
|
1491
|
+
return currentClassPartObject;
|
|
1492
|
+
};
|
|
1493
|
+
var isThemeGetter = (func) => func.isThemeGetter;
|
|
1494
|
+
var getPrefixedClassGroupEntries = (classGroupEntries, prefix) => {
|
|
1495
|
+
if (!prefix) {
|
|
1496
|
+
return classGroupEntries;
|
|
1497
|
+
}
|
|
1498
|
+
return classGroupEntries.map(([classGroupId, classGroup]) => {
|
|
1499
|
+
const prefixedClassGroup = classGroup.map((classDefinition) => {
|
|
1500
|
+
if (typeof classDefinition === "string") {
|
|
1501
|
+
return prefix + classDefinition;
|
|
1502
|
+
}
|
|
1503
|
+
if (typeof classDefinition === "object") {
|
|
1504
|
+
return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));
|
|
1505
|
+
}
|
|
1506
|
+
return classDefinition;
|
|
1507
|
+
});
|
|
1508
|
+
return [classGroupId, prefixedClassGroup];
|
|
1509
|
+
});
|
|
1510
|
+
};
|
|
1511
|
+
var createLruCache = (maxCacheSize) => {
|
|
1512
|
+
if (maxCacheSize < 1) {
|
|
1513
|
+
return {
|
|
1514
|
+
get: () => void 0,
|
|
1515
|
+
set: () => {
|
|
1516
|
+
}
|
|
1517
|
+
};
|
|
1518
|
+
}
|
|
1519
|
+
let cacheSize = 0;
|
|
1520
|
+
let cache = /* @__PURE__ */ new Map();
|
|
1521
|
+
let previousCache = /* @__PURE__ */ new Map();
|
|
1522
|
+
const update = (key, value) => {
|
|
1523
|
+
cache.set(key, value);
|
|
1524
|
+
cacheSize++;
|
|
1525
|
+
if (cacheSize > maxCacheSize) {
|
|
1526
|
+
cacheSize = 0;
|
|
1527
|
+
previousCache = cache;
|
|
1528
|
+
cache = /* @__PURE__ */ new Map();
|
|
1529
|
+
}
|
|
1530
|
+
};
|
|
1531
|
+
return {
|
|
1532
|
+
get(key) {
|
|
1533
|
+
let value = cache.get(key);
|
|
1534
|
+
if (value !== void 0) {
|
|
1535
|
+
return value;
|
|
1536
|
+
}
|
|
1537
|
+
if ((value = previousCache.get(key)) !== void 0) {
|
|
1538
|
+
update(key, value);
|
|
1539
|
+
return value;
|
|
1540
|
+
}
|
|
1541
|
+
},
|
|
1542
|
+
set(key, value) {
|
|
1543
|
+
if (cache.has(key)) {
|
|
1544
|
+
cache.set(key, value);
|
|
1545
|
+
} else {
|
|
1546
|
+
update(key, value);
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
};
|
|
1550
|
+
};
|
|
1551
|
+
var IMPORTANT_MODIFIER = "!";
|
|
1552
|
+
var createParseClassName = (config) => {
|
|
1553
|
+
const {
|
|
1554
|
+
separator,
|
|
1555
|
+
experimentalParseClassName
|
|
1556
|
+
} = config;
|
|
1557
|
+
const isSeparatorSingleCharacter = separator.length === 1;
|
|
1558
|
+
const firstSeparatorCharacter = separator[0];
|
|
1559
|
+
const separatorLength = separator.length;
|
|
1560
|
+
const parseClassName = (className) => {
|
|
1561
|
+
const modifiers = [];
|
|
1562
|
+
let bracketDepth = 0;
|
|
1563
|
+
let modifierStart = 0;
|
|
1564
|
+
let postfixModifierPosition;
|
|
1565
|
+
for (let index = 0; index < className.length; index++) {
|
|
1566
|
+
let currentCharacter = className[index];
|
|
1567
|
+
if (bracketDepth === 0) {
|
|
1568
|
+
if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {
|
|
1569
|
+
modifiers.push(className.slice(modifierStart, index));
|
|
1570
|
+
modifierStart = index + separatorLength;
|
|
1571
|
+
continue;
|
|
1572
|
+
}
|
|
1573
|
+
if (currentCharacter === "/") {
|
|
1574
|
+
postfixModifierPosition = index;
|
|
1575
|
+
continue;
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
if (currentCharacter === "[") {
|
|
1579
|
+
bracketDepth++;
|
|
1580
|
+
} else if (currentCharacter === "]") {
|
|
1581
|
+
bracketDepth--;
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
|
|
1585
|
+
const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);
|
|
1586
|
+
const baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;
|
|
1587
|
+
const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
|
|
1588
|
+
return {
|
|
1589
|
+
modifiers,
|
|
1590
|
+
hasImportantModifier,
|
|
1591
|
+
baseClassName,
|
|
1592
|
+
maybePostfixModifierPosition
|
|
1593
|
+
};
|
|
1594
|
+
};
|
|
1595
|
+
if (experimentalParseClassName) {
|
|
1596
|
+
return (className) => experimentalParseClassName({
|
|
1597
|
+
className,
|
|
1598
|
+
parseClassName
|
|
1599
|
+
});
|
|
1600
|
+
}
|
|
1601
|
+
return parseClassName;
|
|
1602
|
+
};
|
|
1603
|
+
var sortModifiers = (modifiers) => {
|
|
1604
|
+
if (modifiers.length <= 1) {
|
|
1605
|
+
return modifiers;
|
|
1606
|
+
}
|
|
1607
|
+
const sortedModifiers = [];
|
|
1608
|
+
let unsortedModifiers = [];
|
|
1609
|
+
modifiers.forEach((modifier) => {
|
|
1610
|
+
const isArbitraryVariant = modifier[0] === "[";
|
|
1611
|
+
if (isArbitraryVariant) {
|
|
1612
|
+
sortedModifiers.push(...unsortedModifiers.sort(), modifier);
|
|
1613
|
+
unsortedModifiers = [];
|
|
1614
|
+
} else {
|
|
1615
|
+
unsortedModifiers.push(modifier);
|
|
1616
|
+
}
|
|
1617
|
+
});
|
|
1618
|
+
sortedModifiers.push(...unsortedModifiers.sort());
|
|
1619
|
+
return sortedModifiers;
|
|
1620
|
+
};
|
|
1621
|
+
var createConfigUtils = (config) => ({
|
|
1622
|
+
cache: createLruCache(config.cacheSize),
|
|
1623
|
+
parseClassName: createParseClassName(config),
|
|
1624
|
+
...createClassGroupUtils(config)
|
|
1625
|
+
});
|
|
1626
|
+
var SPLIT_CLASSES_REGEX = /\s+/;
|
|
1627
|
+
var mergeClassList = (classList, configUtils) => {
|
|
1628
|
+
const {
|
|
1629
|
+
parseClassName,
|
|
1630
|
+
getClassGroupId,
|
|
1631
|
+
getConflictingClassGroupIds
|
|
1632
|
+
} = configUtils;
|
|
1633
|
+
const classGroupsInConflict = [];
|
|
1634
|
+
const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
|
|
1635
|
+
let result = "";
|
|
1636
|
+
for (let index = classNames.length - 1; index >= 0; index -= 1) {
|
|
1637
|
+
const originalClassName = classNames[index];
|
|
1638
|
+
const {
|
|
1639
|
+
modifiers,
|
|
1640
|
+
hasImportantModifier,
|
|
1641
|
+
baseClassName,
|
|
1642
|
+
maybePostfixModifierPosition
|
|
1643
|
+
} = parseClassName(originalClassName);
|
|
1644
|
+
let hasPostfixModifier = Boolean(maybePostfixModifierPosition);
|
|
1645
|
+
let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
|
|
1646
|
+
if (!classGroupId) {
|
|
1647
|
+
if (!hasPostfixModifier) {
|
|
1648
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
1649
|
+
continue;
|
|
1650
|
+
}
|
|
1651
|
+
classGroupId = getClassGroupId(baseClassName);
|
|
1652
|
+
if (!classGroupId) {
|
|
1653
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
1654
|
+
continue;
|
|
1655
|
+
}
|
|
1656
|
+
hasPostfixModifier = false;
|
|
1657
|
+
}
|
|
1658
|
+
const variantModifier = sortModifiers(modifiers).join(":");
|
|
1659
|
+
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
1660
|
+
const classId = modifierId + classGroupId;
|
|
1661
|
+
if (classGroupsInConflict.includes(classId)) {
|
|
1662
|
+
continue;
|
|
1663
|
+
}
|
|
1664
|
+
classGroupsInConflict.push(classId);
|
|
1665
|
+
const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
|
|
1666
|
+
for (let i = 0; i < conflictGroups.length; ++i) {
|
|
1667
|
+
const group = conflictGroups[i];
|
|
1668
|
+
classGroupsInConflict.push(modifierId + group);
|
|
1669
|
+
}
|
|
1670
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
1671
|
+
}
|
|
1672
|
+
return result;
|
|
1673
|
+
};
|
|
1674
|
+
function twJoin() {
|
|
1675
|
+
let index = 0;
|
|
1676
|
+
let argument;
|
|
1677
|
+
let resolvedValue;
|
|
1678
|
+
let string = "";
|
|
1679
|
+
while (index < arguments.length) {
|
|
1680
|
+
if (argument = arguments[index++]) {
|
|
1681
|
+
if (resolvedValue = toValue(argument)) {
|
|
1682
|
+
string && (string += " ");
|
|
1683
|
+
string += resolvedValue;
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
return string;
|
|
1688
|
+
}
|
|
1689
|
+
var toValue = (mix) => {
|
|
1690
|
+
if (typeof mix === "string") {
|
|
1691
|
+
return mix;
|
|
1692
|
+
}
|
|
1693
|
+
let resolvedValue;
|
|
1694
|
+
let string = "";
|
|
1695
|
+
for (let k = 0; k < mix.length; k++) {
|
|
1696
|
+
if (mix[k]) {
|
|
1697
|
+
if (resolvedValue = toValue(mix[k])) {
|
|
1698
|
+
string && (string += " ");
|
|
1699
|
+
string += resolvedValue;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
return string;
|
|
1704
|
+
};
|
|
1705
|
+
function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
1706
|
+
let configUtils;
|
|
1707
|
+
let cacheGet;
|
|
1708
|
+
let cacheSet;
|
|
1709
|
+
let functionToCall = initTailwindMerge;
|
|
1710
|
+
function initTailwindMerge(classList) {
|
|
1711
|
+
const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
|
|
1712
|
+
configUtils = createConfigUtils(config);
|
|
1713
|
+
cacheGet = configUtils.cache.get;
|
|
1714
|
+
cacheSet = configUtils.cache.set;
|
|
1715
|
+
functionToCall = tailwindMerge;
|
|
1716
|
+
return tailwindMerge(classList);
|
|
1717
|
+
}
|
|
1718
|
+
function tailwindMerge(classList) {
|
|
1719
|
+
const cachedResult = cacheGet(classList);
|
|
1720
|
+
if (cachedResult) {
|
|
1721
|
+
return cachedResult;
|
|
1722
|
+
}
|
|
1723
|
+
const result = mergeClassList(classList, configUtils);
|
|
1724
|
+
cacheSet(classList, result);
|
|
1725
|
+
return result;
|
|
1726
|
+
}
|
|
1727
|
+
return function callTailwindMerge() {
|
|
1728
|
+
return functionToCall(twJoin.apply(null, arguments));
|
|
1729
|
+
};
|
|
1730
|
+
}
|
|
1731
|
+
var fromTheme = (key) => {
|
|
1732
|
+
const themeGetter = (theme) => theme[key] || [];
|
|
1733
|
+
themeGetter.isThemeGetter = true;
|
|
1734
|
+
return themeGetter;
|
|
1735
|
+
};
|
|
1736
|
+
var arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
|
|
1737
|
+
var fractionRegex = /^\d+\/\d+$/;
|
|
1738
|
+
var stringLengths = /* @__PURE__ */ new Set(["px", "full", "screen"]);
|
|
1739
|
+
var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
1740
|
+
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$/;
|
|
1741
|
+
var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
|
|
1742
|
+
var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
1743
|
+
var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
1744
|
+
var isLength = (value) => isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);
|
|
1745
|
+
var isArbitraryLength = (value) => getIsArbitraryValue(value, "length", isLengthOnly);
|
|
1746
|
+
var isNumber = (value) => Boolean(value) && !Number.isNaN(Number(value));
|
|
1747
|
+
var isArbitraryNumber = (value) => getIsArbitraryValue(value, "number", isNumber);
|
|
1748
|
+
var isInteger = (value) => Boolean(value) && Number.isInteger(Number(value));
|
|
1749
|
+
var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
|
|
1750
|
+
var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
|
|
1751
|
+
var isTshirtSize = (value) => tshirtUnitRegex.test(value);
|
|
1752
|
+
var sizeLabels = /* @__PURE__ */ new Set(["length", "size", "percentage"]);
|
|
1753
|
+
var isArbitrarySize = (value) => getIsArbitraryValue(value, sizeLabels, isNever);
|
|
1754
|
+
var isArbitraryPosition = (value) => getIsArbitraryValue(value, "position", isNever);
|
|
1755
|
+
var imageLabels = /* @__PURE__ */ new Set(["image", "url"]);
|
|
1756
|
+
var isArbitraryImage = (value) => getIsArbitraryValue(value, imageLabels, isImage);
|
|
1757
|
+
var isArbitraryShadow = (value) => getIsArbitraryValue(value, "", isShadow);
|
|
1758
|
+
var isAny = () => true;
|
|
1759
|
+
var getIsArbitraryValue = (value, label, testValue) => {
|
|
1760
|
+
const result = arbitraryValueRegex.exec(value);
|
|
1761
|
+
if (result) {
|
|
1762
|
+
if (result[1]) {
|
|
1763
|
+
return typeof label === "string" ? result[1] === label : label.has(result[1]);
|
|
1764
|
+
}
|
|
1765
|
+
return testValue(result[2]);
|
|
1766
|
+
}
|
|
1767
|
+
return false;
|
|
1768
|
+
};
|
|
1769
|
+
var isLengthOnly = (value) => (
|
|
1770
|
+
// `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
|
|
1771
|
+
// For example, `hsl(0 0% 0%)` would be classified as a length without this check.
|
|
1772
|
+
// I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
|
|
1773
|
+
lengthUnitRegex.test(value) && !colorFunctionRegex.test(value)
|
|
1774
|
+
);
|
|
1775
|
+
var isNever = () => false;
|
|
1776
|
+
var isShadow = (value) => shadowRegex.test(value);
|
|
1777
|
+
var isImage = (value) => imageRegex.test(value);
|
|
1778
|
+
var getDefaultConfig = () => {
|
|
1779
|
+
const colors = fromTheme("colors");
|
|
1780
|
+
const spacing = fromTheme("spacing");
|
|
1781
|
+
const blur = fromTheme("blur");
|
|
1782
|
+
const brightness = fromTheme("brightness");
|
|
1783
|
+
const borderColor = fromTheme("borderColor");
|
|
1784
|
+
const borderRadius = fromTheme("borderRadius");
|
|
1785
|
+
const borderSpacing = fromTheme("borderSpacing");
|
|
1786
|
+
const borderWidth = fromTheme("borderWidth");
|
|
1787
|
+
const contrast = fromTheme("contrast");
|
|
1788
|
+
const grayscale = fromTheme("grayscale");
|
|
1789
|
+
const hueRotate = fromTheme("hueRotate");
|
|
1790
|
+
const invert = fromTheme("invert");
|
|
1791
|
+
const gap = fromTheme("gap");
|
|
1792
|
+
const gradientColorStops = fromTheme("gradientColorStops");
|
|
1793
|
+
const gradientColorStopPositions = fromTheme("gradientColorStopPositions");
|
|
1794
|
+
const inset = fromTheme("inset");
|
|
1795
|
+
const margin = fromTheme("margin");
|
|
1796
|
+
const opacity = fromTheme("opacity");
|
|
1797
|
+
const padding = fromTheme("padding");
|
|
1798
|
+
const saturate = fromTheme("saturate");
|
|
1799
|
+
const scale = fromTheme("scale");
|
|
1800
|
+
const sepia = fromTheme("sepia");
|
|
1801
|
+
const skew = fromTheme("skew");
|
|
1802
|
+
const space = fromTheme("space");
|
|
1803
|
+
const translate = fromTheme("translate");
|
|
1804
|
+
const getOverscroll = () => ["auto", "contain", "none"];
|
|
1805
|
+
const getOverflow = () => ["auto", "hidden", "clip", "visible", "scroll"];
|
|
1806
|
+
const getSpacingWithAutoAndArbitrary = () => ["auto", isArbitraryValue, spacing];
|
|
1807
|
+
const getSpacingWithArbitrary = () => [isArbitraryValue, spacing];
|
|
1808
|
+
const getLengthWithEmptyAndArbitrary = () => ["", isLength, isArbitraryLength];
|
|
1809
|
+
const getNumberWithAutoAndArbitrary = () => ["auto", isNumber, isArbitraryValue];
|
|
1810
|
+
const getPositions = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"];
|
|
1811
|
+
const getLineStyles = () => ["solid", "dashed", "dotted", "double", "none"];
|
|
1812
|
+
const getBlendModes = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
|
|
1813
|
+
const getAlign = () => ["start", "end", "center", "between", "around", "evenly", "stretch"];
|
|
1814
|
+
const getZeroAndEmpty = () => ["", "0", isArbitraryValue];
|
|
1815
|
+
const getBreaks = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"];
|
|
1816
|
+
const getNumberAndArbitrary = () => [isNumber, isArbitraryValue];
|
|
1817
|
+
return {
|
|
1818
|
+
cacheSize: 500,
|
|
1819
|
+
separator: ":",
|
|
1820
|
+
theme: {
|
|
1821
|
+
colors: [isAny],
|
|
1822
|
+
spacing: [isLength, isArbitraryLength],
|
|
1823
|
+
blur: ["none", "", isTshirtSize, isArbitraryValue],
|
|
1824
|
+
brightness: getNumberAndArbitrary(),
|
|
1825
|
+
borderColor: [colors],
|
|
1826
|
+
borderRadius: ["none", "", "full", isTshirtSize, isArbitraryValue],
|
|
1827
|
+
borderSpacing: getSpacingWithArbitrary(),
|
|
1828
|
+
borderWidth: getLengthWithEmptyAndArbitrary(),
|
|
1829
|
+
contrast: getNumberAndArbitrary(),
|
|
1830
|
+
grayscale: getZeroAndEmpty(),
|
|
1831
|
+
hueRotate: getNumberAndArbitrary(),
|
|
1832
|
+
invert: getZeroAndEmpty(),
|
|
1833
|
+
gap: getSpacingWithArbitrary(),
|
|
1834
|
+
gradientColorStops: [colors],
|
|
1835
|
+
gradientColorStopPositions: [isPercent, isArbitraryLength],
|
|
1836
|
+
inset: getSpacingWithAutoAndArbitrary(),
|
|
1837
|
+
margin: getSpacingWithAutoAndArbitrary(),
|
|
1838
|
+
opacity: getNumberAndArbitrary(),
|
|
1839
|
+
padding: getSpacingWithArbitrary(),
|
|
1840
|
+
saturate: getNumberAndArbitrary(),
|
|
1841
|
+
scale: getNumberAndArbitrary(),
|
|
1842
|
+
sepia: getZeroAndEmpty(),
|
|
1843
|
+
skew: getNumberAndArbitrary(),
|
|
1844
|
+
space: getSpacingWithArbitrary(),
|
|
1845
|
+
translate: getSpacingWithArbitrary()
|
|
1846
|
+
},
|
|
1847
|
+
classGroups: {
|
|
1848
|
+
// Layout
|
|
1849
|
+
/**
|
|
1850
|
+
* Aspect Ratio
|
|
1851
|
+
* @see https://tailwindcss.com/docs/aspect-ratio
|
|
1852
|
+
*/
|
|
1853
|
+
aspect: [{
|
|
1854
|
+
aspect: ["auto", "square", "video", isArbitraryValue]
|
|
1855
|
+
}],
|
|
1856
|
+
/**
|
|
1857
|
+
* Container
|
|
1858
|
+
* @see https://tailwindcss.com/docs/container
|
|
1859
|
+
*/
|
|
1860
|
+
container: ["container"],
|
|
1861
|
+
/**
|
|
1862
|
+
* Columns
|
|
1863
|
+
* @see https://tailwindcss.com/docs/columns
|
|
1864
|
+
*/
|
|
1865
|
+
columns: [{
|
|
1866
|
+
columns: [isTshirtSize]
|
|
1867
|
+
}],
|
|
1868
|
+
/**
|
|
1869
|
+
* Break After
|
|
1870
|
+
* @see https://tailwindcss.com/docs/break-after
|
|
1871
|
+
*/
|
|
1872
|
+
"break-after": [{
|
|
1873
|
+
"break-after": getBreaks()
|
|
1874
|
+
}],
|
|
1875
|
+
/**
|
|
1876
|
+
* Break Before
|
|
1877
|
+
* @see https://tailwindcss.com/docs/break-before
|
|
1878
|
+
*/
|
|
1879
|
+
"break-before": [{
|
|
1880
|
+
"break-before": getBreaks()
|
|
1881
|
+
}],
|
|
1882
|
+
/**
|
|
1883
|
+
* Break Inside
|
|
1884
|
+
* @see https://tailwindcss.com/docs/break-inside
|
|
1885
|
+
*/
|
|
1886
|
+
"break-inside": [{
|
|
1887
|
+
"break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
|
|
1888
|
+
}],
|
|
1889
|
+
/**
|
|
1890
|
+
* Box Decoration Break
|
|
1891
|
+
* @see https://tailwindcss.com/docs/box-decoration-break
|
|
1892
|
+
*/
|
|
1893
|
+
"box-decoration": [{
|
|
1894
|
+
"box-decoration": ["slice", "clone"]
|
|
1895
|
+
}],
|
|
1896
|
+
/**
|
|
1897
|
+
* Box Sizing
|
|
1898
|
+
* @see https://tailwindcss.com/docs/box-sizing
|
|
1899
|
+
*/
|
|
1900
|
+
box: [{
|
|
1901
|
+
box: ["border", "content"]
|
|
1902
|
+
}],
|
|
1903
|
+
/**
|
|
1904
|
+
* Display
|
|
1905
|
+
* @see https://tailwindcss.com/docs/display
|
|
1906
|
+
*/
|
|
1907
|
+
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"],
|
|
1908
|
+
/**
|
|
1909
|
+
* Floats
|
|
1910
|
+
* @see https://tailwindcss.com/docs/float
|
|
1911
|
+
*/
|
|
1912
|
+
float: [{
|
|
1913
|
+
float: ["right", "left", "none", "start", "end"]
|
|
1914
|
+
}],
|
|
1915
|
+
/**
|
|
1916
|
+
* Clear
|
|
1917
|
+
* @see https://tailwindcss.com/docs/clear
|
|
1918
|
+
*/
|
|
1919
|
+
clear: [{
|
|
1920
|
+
clear: ["left", "right", "both", "none", "start", "end"]
|
|
1921
|
+
}],
|
|
1922
|
+
/**
|
|
1923
|
+
* Isolation
|
|
1924
|
+
* @see https://tailwindcss.com/docs/isolation
|
|
1925
|
+
*/
|
|
1926
|
+
isolation: ["isolate", "isolation-auto"],
|
|
1927
|
+
/**
|
|
1928
|
+
* Object Fit
|
|
1929
|
+
* @see https://tailwindcss.com/docs/object-fit
|
|
1930
|
+
*/
|
|
1931
|
+
"object-fit": [{
|
|
1932
|
+
object: ["contain", "cover", "fill", "none", "scale-down"]
|
|
1933
|
+
}],
|
|
1934
|
+
/**
|
|
1935
|
+
* Object Position
|
|
1936
|
+
* @see https://tailwindcss.com/docs/object-position
|
|
1937
|
+
*/
|
|
1938
|
+
"object-position": [{
|
|
1939
|
+
object: [...getPositions(), isArbitraryValue]
|
|
1940
|
+
}],
|
|
1941
|
+
/**
|
|
1942
|
+
* Overflow
|
|
1943
|
+
* @see https://tailwindcss.com/docs/overflow
|
|
1944
|
+
*/
|
|
1945
|
+
overflow: [{
|
|
1946
|
+
overflow: getOverflow()
|
|
1947
|
+
}],
|
|
1948
|
+
/**
|
|
1949
|
+
* Overflow X
|
|
1950
|
+
* @see https://tailwindcss.com/docs/overflow
|
|
1951
|
+
*/
|
|
1952
|
+
"overflow-x": [{
|
|
1953
|
+
"overflow-x": getOverflow()
|
|
1954
|
+
}],
|
|
1955
|
+
/**
|
|
1956
|
+
* Overflow Y
|
|
1957
|
+
* @see https://tailwindcss.com/docs/overflow
|
|
1958
|
+
*/
|
|
1959
|
+
"overflow-y": [{
|
|
1960
|
+
"overflow-y": getOverflow()
|
|
1961
|
+
}],
|
|
1962
|
+
/**
|
|
1963
|
+
* Overscroll Behavior
|
|
1964
|
+
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
1965
|
+
*/
|
|
1966
|
+
overscroll: [{
|
|
1967
|
+
overscroll: getOverscroll()
|
|
1968
|
+
}],
|
|
1969
|
+
/**
|
|
1970
|
+
* Overscroll Behavior X
|
|
1971
|
+
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
1972
|
+
*/
|
|
1973
|
+
"overscroll-x": [{
|
|
1974
|
+
"overscroll-x": getOverscroll()
|
|
1975
|
+
}],
|
|
1976
|
+
/**
|
|
1977
|
+
* Overscroll Behavior Y
|
|
1978
|
+
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
1979
|
+
*/
|
|
1980
|
+
"overscroll-y": [{
|
|
1981
|
+
"overscroll-y": getOverscroll()
|
|
1982
|
+
}],
|
|
1983
|
+
/**
|
|
1984
|
+
* Position
|
|
1985
|
+
* @see https://tailwindcss.com/docs/position
|
|
1986
|
+
*/
|
|
1987
|
+
position: ["static", "fixed", "absolute", "relative", "sticky"],
|
|
1988
|
+
/**
|
|
1989
|
+
* Top / Right / Bottom / Left
|
|
1990
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
1991
|
+
*/
|
|
1992
|
+
inset: [{
|
|
1993
|
+
inset: [inset]
|
|
1994
|
+
}],
|
|
1995
|
+
/**
|
|
1996
|
+
* Right / Left
|
|
1997
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
1998
|
+
*/
|
|
1999
|
+
"inset-x": [{
|
|
2000
|
+
"inset-x": [inset]
|
|
2001
|
+
}],
|
|
2002
|
+
/**
|
|
2003
|
+
* Top / Bottom
|
|
2004
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2005
|
+
*/
|
|
2006
|
+
"inset-y": [{
|
|
2007
|
+
"inset-y": [inset]
|
|
2008
|
+
}],
|
|
2009
|
+
/**
|
|
2010
|
+
* Start
|
|
2011
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2012
|
+
*/
|
|
2013
|
+
start: [{
|
|
2014
|
+
start: [inset]
|
|
2015
|
+
}],
|
|
2016
|
+
/**
|
|
2017
|
+
* End
|
|
2018
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2019
|
+
*/
|
|
2020
|
+
end: [{
|
|
2021
|
+
end: [inset]
|
|
2022
|
+
}],
|
|
2023
|
+
/**
|
|
2024
|
+
* Top
|
|
2025
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2026
|
+
*/
|
|
2027
|
+
top: [{
|
|
2028
|
+
top: [inset]
|
|
2029
|
+
}],
|
|
2030
|
+
/**
|
|
2031
|
+
* Right
|
|
2032
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2033
|
+
*/
|
|
2034
|
+
right: [{
|
|
2035
|
+
right: [inset]
|
|
2036
|
+
}],
|
|
2037
|
+
/**
|
|
2038
|
+
* Bottom
|
|
2039
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2040
|
+
*/
|
|
2041
|
+
bottom: [{
|
|
2042
|
+
bottom: [inset]
|
|
2043
|
+
}],
|
|
2044
|
+
/**
|
|
2045
|
+
* Left
|
|
2046
|
+
* @see https://tailwindcss.com/docs/top-right-bottom-left
|
|
2047
|
+
*/
|
|
2048
|
+
left: [{
|
|
2049
|
+
left: [inset]
|
|
2050
|
+
}],
|
|
2051
|
+
/**
|
|
2052
|
+
* Visibility
|
|
2053
|
+
* @see https://tailwindcss.com/docs/visibility
|
|
2054
|
+
*/
|
|
2055
|
+
visibility: ["visible", "invisible", "collapse"],
|
|
2056
|
+
/**
|
|
2057
|
+
* Z-Index
|
|
2058
|
+
* @see https://tailwindcss.com/docs/z-index
|
|
2059
|
+
*/
|
|
2060
|
+
z: [{
|
|
2061
|
+
z: ["auto", isInteger, isArbitraryValue]
|
|
2062
|
+
}],
|
|
2063
|
+
// Flexbox and Grid
|
|
2064
|
+
/**
|
|
2065
|
+
* Flex Basis
|
|
2066
|
+
* @see https://tailwindcss.com/docs/flex-basis
|
|
2067
|
+
*/
|
|
2068
|
+
basis: [{
|
|
2069
|
+
basis: getSpacingWithAutoAndArbitrary()
|
|
2070
|
+
}],
|
|
2071
|
+
/**
|
|
2072
|
+
* Flex Direction
|
|
2073
|
+
* @see https://tailwindcss.com/docs/flex-direction
|
|
2074
|
+
*/
|
|
2075
|
+
"flex-direction": [{
|
|
2076
|
+
flex: ["row", "row-reverse", "col", "col-reverse"]
|
|
2077
|
+
}],
|
|
2078
|
+
/**
|
|
2079
|
+
* Flex Wrap
|
|
2080
|
+
* @see https://tailwindcss.com/docs/flex-wrap
|
|
2081
|
+
*/
|
|
2082
|
+
"flex-wrap": [{
|
|
2083
|
+
flex: ["wrap", "wrap-reverse", "nowrap"]
|
|
2084
|
+
}],
|
|
2085
|
+
/**
|
|
2086
|
+
* Flex
|
|
2087
|
+
* @see https://tailwindcss.com/docs/flex
|
|
2088
|
+
*/
|
|
2089
|
+
flex: [{
|
|
2090
|
+
flex: ["1", "auto", "initial", "none", isArbitraryValue]
|
|
2091
|
+
}],
|
|
2092
|
+
/**
|
|
2093
|
+
* Flex Grow
|
|
2094
|
+
* @see https://tailwindcss.com/docs/flex-grow
|
|
2095
|
+
*/
|
|
2096
|
+
grow: [{
|
|
2097
|
+
grow: getZeroAndEmpty()
|
|
2098
|
+
}],
|
|
2099
|
+
/**
|
|
2100
|
+
* Flex Shrink
|
|
2101
|
+
* @see https://tailwindcss.com/docs/flex-shrink
|
|
2102
|
+
*/
|
|
2103
|
+
shrink: [{
|
|
2104
|
+
shrink: getZeroAndEmpty()
|
|
2105
|
+
}],
|
|
2106
|
+
/**
|
|
2107
|
+
* Order
|
|
2108
|
+
* @see https://tailwindcss.com/docs/order
|
|
2109
|
+
*/
|
|
2110
|
+
order: [{
|
|
2111
|
+
order: ["first", "last", "none", isInteger, isArbitraryValue]
|
|
2112
|
+
}],
|
|
2113
|
+
/**
|
|
2114
|
+
* Grid Template Columns
|
|
2115
|
+
* @see https://tailwindcss.com/docs/grid-template-columns
|
|
2116
|
+
*/
|
|
2117
|
+
"grid-cols": [{
|
|
2118
|
+
"grid-cols": [isAny]
|
|
2119
|
+
}],
|
|
2120
|
+
/**
|
|
2121
|
+
* Grid Column Start / End
|
|
2122
|
+
* @see https://tailwindcss.com/docs/grid-column
|
|
2123
|
+
*/
|
|
2124
|
+
"col-start-end": [{
|
|
2125
|
+
col: ["auto", {
|
|
2126
|
+
span: ["full", isInteger, isArbitraryValue]
|
|
2127
|
+
}, isArbitraryValue]
|
|
2128
|
+
}],
|
|
2129
|
+
/**
|
|
2130
|
+
* Grid Column Start
|
|
2131
|
+
* @see https://tailwindcss.com/docs/grid-column
|
|
2132
|
+
*/
|
|
2133
|
+
"col-start": [{
|
|
2134
|
+
"col-start": getNumberWithAutoAndArbitrary()
|
|
2135
|
+
}],
|
|
2136
|
+
/**
|
|
2137
|
+
* Grid Column End
|
|
2138
|
+
* @see https://tailwindcss.com/docs/grid-column
|
|
2139
|
+
*/
|
|
2140
|
+
"col-end": [{
|
|
2141
|
+
"col-end": getNumberWithAutoAndArbitrary()
|
|
2142
|
+
}],
|
|
2143
|
+
/**
|
|
2144
|
+
* Grid Template Rows
|
|
2145
|
+
* @see https://tailwindcss.com/docs/grid-template-rows
|
|
2146
|
+
*/
|
|
2147
|
+
"grid-rows": [{
|
|
2148
|
+
"grid-rows": [isAny]
|
|
2149
|
+
}],
|
|
2150
|
+
/**
|
|
2151
|
+
* Grid Row Start / End
|
|
2152
|
+
* @see https://tailwindcss.com/docs/grid-row
|
|
2153
|
+
*/
|
|
2154
|
+
"row-start-end": [{
|
|
2155
|
+
row: ["auto", {
|
|
2156
|
+
span: [isInteger, isArbitraryValue]
|
|
2157
|
+
}, isArbitraryValue]
|
|
2158
|
+
}],
|
|
2159
|
+
/**
|
|
2160
|
+
* Grid Row Start
|
|
2161
|
+
* @see https://tailwindcss.com/docs/grid-row
|
|
2162
|
+
*/
|
|
2163
|
+
"row-start": [{
|
|
2164
|
+
"row-start": getNumberWithAutoAndArbitrary()
|
|
2165
|
+
}],
|
|
2166
|
+
/**
|
|
2167
|
+
* Grid Row End
|
|
2168
|
+
* @see https://tailwindcss.com/docs/grid-row
|
|
2169
|
+
*/
|
|
2170
|
+
"row-end": [{
|
|
2171
|
+
"row-end": getNumberWithAutoAndArbitrary()
|
|
2172
|
+
}],
|
|
2173
|
+
/**
|
|
2174
|
+
* Grid Auto Flow
|
|
2175
|
+
* @see https://tailwindcss.com/docs/grid-auto-flow
|
|
2176
|
+
*/
|
|
2177
|
+
"grid-flow": [{
|
|
2178
|
+
"grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
|
|
2179
|
+
}],
|
|
2180
|
+
/**
|
|
2181
|
+
* Grid Auto Columns
|
|
2182
|
+
* @see https://tailwindcss.com/docs/grid-auto-columns
|
|
2183
|
+
*/
|
|
2184
|
+
"auto-cols": [{
|
|
2185
|
+
"auto-cols": ["auto", "min", "max", "fr", isArbitraryValue]
|
|
2186
|
+
}],
|
|
2187
|
+
/**
|
|
2188
|
+
* Grid Auto Rows
|
|
2189
|
+
* @see https://tailwindcss.com/docs/grid-auto-rows
|
|
2190
|
+
*/
|
|
2191
|
+
"auto-rows": [{
|
|
2192
|
+
"auto-rows": ["auto", "min", "max", "fr", isArbitraryValue]
|
|
2193
|
+
}],
|
|
2194
|
+
/**
|
|
2195
|
+
* Gap
|
|
2196
|
+
* @see https://tailwindcss.com/docs/gap
|
|
2197
|
+
*/
|
|
2198
|
+
gap: [{
|
|
2199
|
+
gap: [gap]
|
|
2200
|
+
}],
|
|
2201
|
+
/**
|
|
2202
|
+
* Gap X
|
|
2203
|
+
* @see https://tailwindcss.com/docs/gap
|
|
2204
|
+
*/
|
|
2205
|
+
"gap-x": [{
|
|
2206
|
+
"gap-x": [gap]
|
|
2207
|
+
}],
|
|
2208
|
+
/**
|
|
2209
|
+
* Gap Y
|
|
2210
|
+
* @see https://tailwindcss.com/docs/gap
|
|
2211
|
+
*/
|
|
2212
|
+
"gap-y": [{
|
|
2213
|
+
"gap-y": [gap]
|
|
2214
|
+
}],
|
|
2215
|
+
/**
|
|
2216
|
+
* Justify Content
|
|
2217
|
+
* @see https://tailwindcss.com/docs/justify-content
|
|
2218
|
+
*/
|
|
2219
|
+
"justify-content": [{
|
|
2220
|
+
justify: ["normal", ...getAlign()]
|
|
2221
|
+
}],
|
|
2222
|
+
/**
|
|
2223
|
+
* Justify Items
|
|
2224
|
+
* @see https://tailwindcss.com/docs/justify-items
|
|
2225
|
+
*/
|
|
2226
|
+
"justify-items": [{
|
|
2227
|
+
"justify-items": ["start", "end", "center", "stretch"]
|
|
2228
|
+
}],
|
|
2229
|
+
/**
|
|
2230
|
+
* Justify Self
|
|
2231
|
+
* @see https://tailwindcss.com/docs/justify-self
|
|
2232
|
+
*/
|
|
2233
|
+
"justify-self": [{
|
|
2234
|
+
"justify-self": ["auto", "start", "end", "center", "stretch"]
|
|
2235
|
+
}],
|
|
2236
|
+
/**
|
|
2237
|
+
* Align Content
|
|
2238
|
+
* @see https://tailwindcss.com/docs/align-content
|
|
2239
|
+
*/
|
|
2240
|
+
"align-content": [{
|
|
2241
|
+
content: ["normal", ...getAlign(), "baseline"]
|
|
2242
|
+
}],
|
|
2243
|
+
/**
|
|
2244
|
+
* Align Items
|
|
2245
|
+
* @see https://tailwindcss.com/docs/align-items
|
|
2246
|
+
*/
|
|
2247
|
+
"align-items": [{
|
|
2248
|
+
items: ["start", "end", "center", "baseline", "stretch"]
|
|
2249
|
+
}],
|
|
2250
|
+
/**
|
|
2251
|
+
* Align Self
|
|
2252
|
+
* @see https://tailwindcss.com/docs/align-self
|
|
2253
|
+
*/
|
|
2254
|
+
"align-self": [{
|
|
2255
|
+
self: ["auto", "start", "end", "center", "stretch", "baseline"]
|
|
2256
|
+
}],
|
|
2257
|
+
/**
|
|
2258
|
+
* Place Content
|
|
2259
|
+
* @see https://tailwindcss.com/docs/place-content
|
|
2260
|
+
*/
|
|
2261
|
+
"place-content": [{
|
|
2262
|
+
"place-content": [...getAlign(), "baseline"]
|
|
2263
|
+
}],
|
|
2264
|
+
/**
|
|
2265
|
+
* Place Items
|
|
2266
|
+
* @see https://tailwindcss.com/docs/place-items
|
|
2267
|
+
*/
|
|
2268
|
+
"place-items": [{
|
|
2269
|
+
"place-items": ["start", "end", "center", "baseline", "stretch"]
|
|
2270
|
+
}],
|
|
2271
|
+
/**
|
|
2272
|
+
* Place Self
|
|
2273
|
+
* @see https://tailwindcss.com/docs/place-self
|
|
2274
|
+
*/
|
|
2275
|
+
"place-self": [{
|
|
2276
|
+
"place-self": ["auto", "start", "end", "center", "stretch"]
|
|
2277
|
+
}],
|
|
2278
|
+
// Spacing
|
|
2279
|
+
/**
|
|
2280
|
+
* Padding
|
|
2281
|
+
* @see https://tailwindcss.com/docs/padding
|
|
2282
|
+
*/
|
|
2283
|
+
p: [{
|
|
2284
|
+
p: [padding]
|
|
2285
|
+
}],
|
|
2286
|
+
/**
|
|
2287
|
+
* Padding X
|
|
2288
|
+
* @see https://tailwindcss.com/docs/padding
|
|
2289
|
+
*/
|
|
2290
|
+
px: [{
|
|
2291
|
+
px: [padding]
|
|
2292
|
+
}],
|
|
2293
|
+
/**
|
|
2294
|
+
* Padding Y
|
|
2295
|
+
* @see https://tailwindcss.com/docs/padding
|
|
2296
|
+
*/
|
|
2297
|
+
py: [{
|
|
2298
|
+
py: [padding]
|
|
2299
|
+
}],
|
|
2300
|
+
/**
|
|
2301
|
+
* Padding Start
|
|
2302
|
+
* @see https://tailwindcss.com/docs/padding
|
|
2303
|
+
*/
|
|
2304
|
+
ps: [{
|
|
2305
|
+
ps: [padding]
|
|
2306
|
+
}],
|
|
2307
|
+
/**
|
|
2308
|
+
* Padding End
|
|
2309
|
+
* @see https://tailwindcss.com/docs/padding
|
|
2310
|
+
*/
|
|
2311
|
+
pe: [{
|
|
2312
|
+
pe: [padding]
|
|
2313
|
+
}],
|
|
2314
|
+
/**
|
|
2315
|
+
* Padding Top
|
|
2316
|
+
* @see https://tailwindcss.com/docs/padding
|
|
2317
|
+
*/
|
|
2318
|
+
pt: [{
|
|
2319
|
+
pt: [padding]
|
|
2320
|
+
}],
|
|
2321
|
+
/**
|
|
2322
|
+
* Padding Right
|
|
2323
|
+
* @see https://tailwindcss.com/docs/padding
|
|
2324
|
+
*/
|
|
2325
|
+
pr: [{
|
|
2326
|
+
pr: [padding]
|
|
2327
|
+
}],
|
|
2328
|
+
/**
|
|
2329
|
+
* Padding Bottom
|
|
2330
|
+
* @see https://tailwindcss.com/docs/padding
|
|
2331
|
+
*/
|
|
2332
|
+
pb: [{
|
|
2333
|
+
pb: [padding]
|
|
2334
|
+
}],
|
|
2335
|
+
/**
|
|
2336
|
+
* Padding Left
|
|
2337
|
+
* @see https://tailwindcss.com/docs/padding
|
|
2338
|
+
*/
|
|
2339
|
+
pl: [{
|
|
2340
|
+
pl: [padding]
|
|
2341
|
+
}],
|
|
2342
|
+
/**
|
|
2343
|
+
* Margin
|
|
2344
|
+
* @see https://tailwindcss.com/docs/margin
|
|
2345
|
+
*/
|
|
2346
|
+
m: [{
|
|
2347
|
+
m: [margin]
|
|
2348
|
+
}],
|
|
2349
|
+
/**
|
|
2350
|
+
* Margin X
|
|
2351
|
+
* @see https://tailwindcss.com/docs/margin
|
|
2352
|
+
*/
|
|
2353
|
+
mx: [{
|
|
2354
|
+
mx: [margin]
|
|
2355
|
+
}],
|
|
2356
|
+
/**
|
|
2357
|
+
* Margin Y
|
|
2358
|
+
* @see https://tailwindcss.com/docs/margin
|
|
2359
|
+
*/
|
|
2360
|
+
my: [{
|
|
2361
|
+
my: [margin]
|
|
2362
|
+
}],
|
|
2363
|
+
/**
|
|
2364
|
+
* Margin Start
|
|
2365
|
+
* @see https://tailwindcss.com/docs/margin
|
|
2366
|
+
*/
|
|
2367
|
+
ms: [{
|
|
2368
|
+
ms: [margin]
|
|
2369
|
+
}],
|
|
2370
|
+
/**
|
|
2371
|
+
* Margin End
|
|
2372
|
+
* @see https://tailwindcss.com/docs/margin
|
|
2373
|
+
*/
|
|
2374
|
+
me: [{
|
|
2375
|
+
me: [margin]
|
|
2376
|
+
}],
|
|
2377
|
+
/**
|
|
2378
|
+
* Margin Top
|
|
2379
|
+
* @see https://tailwindcss.com/docs/margin
|
|
2380
|
+
*/
|
|
2381
|
+
mt: [{
|
|
2382
|
+
mt: [margin]
|
|
2383
|
+
}],
|
|
2384
|
+
/**
|
|
2385
|
+
* Margin Right
|
|
2386
|
+
* @see https://tailwindcss.com/docs/margin
|
|
2387
|
+
*/
|
|
2388
|
+
mr: [{
|
|
2389
|
+
mr: [margin]
|
|
2390
|
+
}],
|
|
2391
|
+
/**
|
|
2392
|
+
* Margin Bottom
|
|
2393
|
+
* @see https://tailwindcss.com/docs/margin
|
|
2394
|
+
*/
|
|
2395
|
+
mb: [{
|
|
2396
|
+
mb: [margin]
|
|
2397
|
+
}],
|
|
2398
|
+
/**
|
|
2399
|
+
* Margin Left
|
|
2400
|
+
* @see https://tailwindcss.com/docs/margin
|
|
2401
|
+
*/
|
|
2402
|
+
ml: [{
|
|
2403
|
+
ml: [margin]
|
|
2404
|
+
}],
|
|
2405
|
+
/**
|
|
2406
|
+
* Space Between X
|
|
2407
|
+
* @see https://tailwindcss.com/docs/space
|
|
2408
|
+
*/
|
|
2409
|
+
"space-x": [{
|
|
2410
|
+
"space-x": [space]
|
|
2411
|
+
}],
|
|
2412
|
+
/**
|
|
2413
|
+
* Space Between X Reverse
|
|
2414
|
+
* @see https://tailwindcss.com/docs/space
|
|
2415
|
+
*/
|
|
2416
|
+
"space-x-reverse": ["space-x-reverse"],
|
|
2417
|
+
/**
|
|
2418
|
+
* Space Between Y
|
|
2419
|
+
* @see https://tailwindcss.com/docs/space
|
|
2420
|
+
*/
|
|
2421
|
+
"space-y": [{
|
|
2422
|
+
"space-y": [space]
|
|
2423
|
+
}],
|
|
2424
|
+
/**
|
|
2425
|
+
* Space Between Y Reverse
|
|
2426
|
+
* @see https://tailwindcss.com/docs/space
|
|
2427
|
+
*/
|
|
2428
|
+
"space-y-reverse": ["space-y-reverse"],
|
|
2429
|
+
// Sizing
|
|
2430
|
+
/**
|
|
2431
|
+
* Width
|
|
2432
|
+
* @see https://tailwindcss.com/docs/width
|
|
2433
|
+
*/
|
|
2434
|
+
w: [{
|
|
2435
|
+
w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", isArbitraryValue, spacing]
|
|
2436
|
+
}],
|
|
2437
|
+
/**
|
|
2438
|
+
* Min-Width
|
|
2439
|
+
* @see https://tailwindcss.com/docs/min-width
|
|
2440
|
+
*/
|
|
2441
|
+
"min-w": [{
|
|
2442
|
+
"min-w": [isArbitraryValue, spacing, "min", "max", "fit"]
|
|
2443
|
+
}],
|
|
2444
|
+
/**
|
|
2445
|
+
* Max-Width
|
|
2446
|
+
* @see https://tailwindcss.com/docs/max-width
|
|
2447
|
+
*/
|
|
2448
|
+
"max-w": [{
|
|
2449
|
+
"max-w": [isArbitraryValue, spacing, "none", "full", "min", "max", "fit", "prose", {
|
|
2450
|
+
screen: [isTshirtSize]
|
|
2451
|
+
}, isTshirtSize]
|
|
2452
|
+
}],
|
|
2453
|
+
/**
|
|
2454
|
+
* Height
|
|
2455
|
+
* @see https://tailwindcss.com/docs/height
|
|
2456
|
+
*/
|
|
2457
|
+
h: [{
|
|
2458
|
+
h: [isArbitraryValue, spacing, "auto", "min", "max", "fit", "svh", "lvh", "dvh"]
|
|
2459
|
+
}],
|
|
2460
|
+
/**
|
|
2461
|
+
* Min-Height
|
|
2462
|
+
* @see https://tailwindcss.com/docs/min-height
|
|
2463
|
+
*/
|
|
2464
|
+
"min-h": [{
|
|
2465
|
+
"min-h": [isArbitraryValue, spacing, "min", "max", "fit", "svh", "lvh", "dvh"]
|
|
2466
|
+
}],
|
|
2467
|
+
/**
|
|
2468
|
+
* Max-Height
|
|
2469
|
+
* @see https://tailwindcss.com/docs/max-height
|
|
2470
|
+
*/
|
|
2471
|
+
"max-h": [{
|
|
2472
|
+
"max-h": [isArbitraryValue, spacing, "min", "max", "fit", "svh", "lvh", "dvh"]
|
|
2473
|
+
}],
|
|
2474
|
+
/**
|
|
2475
|
+
* Size
|
|
2476
|
+
* @see https://tailwindcss.com/docs/size
|
|
2477
|
+
*/
|
|
2478
|
+
size: [{
|
|
2479
|
+
size: [isArbitraryValue, spacing, "auto", "min", "max", "fit"]
|
|
2480
|
+
}],
|
|
2481
|
+
// Typography
|
|
2482
|
+
/**
|
|
2483
|
+
* Font Size
|
|
2484
|
+
* @see https://tailwindcss.com/docs/font-size
|
|
2485
|
+
*/
|
|
2486
|
+
"font-size": [{
|
|
2487
|
+
text: ["base", isTshirtSize, isArbitraryLength]
|
|
2488
|
+
}],
|
|
2489
|
+
/**
|
|
2490
|
+
* Font Smoothing
|
|
2491
|
+
* @see https://tailwindcss.com/docs/font-smoothing
|
|
2492
|
+
*/
|
|
2493
|
+
"font-smoothing": ["antialiased", "subpixel-antialiased"],
|
|
2494
|
+
/**
|
|
2495
|
+
* Font Style
|
|
2496
|
+
* @see https://tailwindcss.com/docs/font-style
|
|
2497
|
+
*/
|
|
2498
|
+
"font-style": ["italic", "not-italic"],
|
|
2499
|
+
/**
|
|
2500
|
+
* Font Weight
|
|
2501
|
+
* @see https://tailwindcss.com/docs/font-weight
|
|
2502
|
+
*/
|
|
2503
|
+
"font-weight": [{
|
|
2504
|
+
font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", isArbitraryNumber]
|
|
2505
|
+
}],
|
|
2506
|
+
/**
|
|
2507
|
+
* Font Family
|
|
2508
|
+
* @see https://tailwindcss.com/docs/font-family
|
|
2509
|
+
*/
|
|
2510
|
+
"font-family": [{
|
|
2511
|
+
font: [isAny]
|
|
2512
|
+
}],
|
|
2513
|
+
/**
|
|
2514
|
+
* Font Variant Numeric
|
|
2515
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
2516
|
+
*/
|
|
2517
|
+
"fvn-normal": ["normal-nums"],
|
|
2518
|
+
/**
|
|
2519
|
+
* Font Variant Numeric
|
|
2520
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
2521
|
+
*/
|
|
2522
|
+
"fvn-ordinal": ["ordinal"],
|
|
2523
|
+
/**
|
|
2524
|
+
* Font Variant Numeric
|
|
2525
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
2526
|
+
*/
|
|
2527
|
+
"fvn-slashed-zero": ["slashed-zero"],
|
|
2528
|
+
/**
|
|
2529
|
+
* Font Variant Numeric
|
|
2530
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
2531
|
+
*/
|
|
2532
|
+
"fvn-figure": ["lining-nums", "oldstyle-nums"],
|
|
2533
|
+
/**
|
|
2534
|
+
* Font Variant Numeric
|
|
2535
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
2536
|
+
*/
|
|
2537
|
+
"fvn-spacing": ["proportional-nums", "tabular-nums"],
|
|
2538
|
+
/**
|
|
2539
|
+
* Font Variant Numeric
|
|
2540
|
+
* @see https://tailwindcss.com/docs/font-variant-numeric
|
|
2541
|
+
*/
|
|
2542
|
+
"fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
|
|
2543
|
+
/**
|
|
2544
|
+
* Letter Spacing
|
|
2545
|
+
* @see https://tailwindcss.com/docs/letter-spacing
|
|
2546
|
+
*/
|
|
2547
|
+
tracking: [{
|
|
2548
|
+
tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", isArbitraryValue]
|
|
2549
|
+
}],
|
|
2550
|
+
/**
|
|
2551
|
+
* Line Clamp
|
|
2552
|
+
* @see https://tailwindcss.com/docs/line-clamp
|
|
2553
|
+
*/
|
|
2554
|
+
"line-clamp": [{
|
|
2555
|
+
"line-clamp": ["none", isNumber, isArbitraryNumber]
|
|
2556
|
+
}],
|
|
2557
|
+
/**
|
|
2558
|
+
* Line Height
|
|
2559
|
+
* @see https://tailwindcss.com/docs/line-height
|
|
2560
|
+
*/
|
|
2561
|
+
leading: [{
|
|
2562
|
+
leading: ["none", "tight", "snug", "normal", "relaxed", "loose", isLength, isArbitraryValue]
|
|
2563
|
+
}],
|
|
2564
|
+
/**
|
|
2565
|
+
* List Style Image
|
|
2566
|
+
* @see https://tailwindcss.com/docs/list-style-image
|
|
2567
|
+
*/
|
|
2568
|
+
"list-image": [{
|
|
2569
|
+
"list-image": ["none", isArbitraryValue]
|
|
2570
|
+
}],
|
|
2571
|
+
/**
|
|
2572
|
+
* List Style Type
|
|
2573
|
+
* @see https://tailwindcss.com/docs/list-style-type
|
|
2574
|
+
*/
|
|
2575
|
+
"list-style-type": [{
|
|
2576
|
+
list: ["none", "disc", "decimal", isArbitraryValue]
|
|
2577
|
+
}],
|
|
2578
|
+
/**
|
|
2579
|
+
* List Style Position
|
|
2580
|
+
* @see https://tailwindcss.com/docs/list-style-position
|
|
2581
|
+
*/
|
|
2582
|
+
"list-style-position": [{
|
|
2583
|
+
list: ["inside", "outside"]
|
|
2584
|
+
}],
|
|
2585
|
+
/**
|
|
2586
|
+
* Placeholder Color
|
|
2587
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
2588
|
+
* @see https://tailwindcss.com/docs/placeholder-color
|
|
2589
|
+
*/
|
|
2590
|
+
"placeholder-color": [{
|
|
2591
|
+
placeholder: [colors]
|
|
2592
|
+
}],
|
|
2593
|
+
/**
|
|
2594
|
+
* Placeholder Opacity
|
|
2595
|
+
* @see https://tailwindcss.com/docs/placeholder-opacity
|
|
2596
|
+
*/
|
|
2597
|
+
"placeholder-opacity": [{
|
|
2598
|
+
"placeholder-opacity": [opacity]
|
|
2599
|
+
}],
|
|
2600
|
+
/**
|
|
2601
|
+
* Text Alignment
|
|
2602
|
+
* @see https://tailwindcss.com/docs/text-align
|
|
2603
|
+
*/
|
|
2604
|
+
"text-alignment": [{
|
|
2605
|
+
text: ["left", "center", "right", "justify", "start", "end"]
|
|
2606
|
+
}],
|
|
2607
|
+
/**
|
|
2608
|
+
* Text Color
|
|
2609
|
+
* @see https://tailwindcss.com/docs/text-color
|
|
2610
|
+
*/
|
|
2611
|
+
"text-color": [{
|
|
2612
|
+
text: [colors]
|
|
2613
|
+
}],
|
|
2614
|
+
/**
|
|
2615
|
+
* Text Opacity
|
|
2616
|
+
* @see https://tailwindcss.com/docs/text-opacity
|
|
2617
|
+
*/
|
|
2618
|
+
"text-opacity": [{
|
|
2619
|
+
"text-opacity": [opacity]
|
|
2620
|
+
}],
|
|
2621
|
+
/**
|
|
2622
|
+
* Text Decoration
|
|
2623
|
+
* @see https://tailwindcss.com/docs/text-decoration
|
|
2624
|
+
*/
|
|
2625
|
+
"text-decoration": ["underline", "overline", "line-through", "no-underline"],
|
|
2626
|
+
/**
|
|
2627
|
+
* Text Decoration Style
|
|
2628
|
+
* @see https://tailwindcss.com/docs/text-decoration-style
|
|
2629
|
+
*/
|
|
2630
|
+
"text-decoration-style": [{
|
|
2631
|
+
decoration: [...getLineStyles(), "wavy"]
|
|
2632
|
+
}],
|
|
2633
|
+
/**
|
|
2634
|
+
* Text Decoration Thickness
|
|
2635
|
+
* @see https://tailwindcss.com/docs/text-decoration-thickness
|
|
2636
|
+
*/
|
|
2637
|
+
"text-decoration-thickness": [{
|
|
2638
|
+
decoration: ["auto", "from-font", isLength, isArbitraryLength]
|
|
2639
|
+
}],
|
|
2640
|
+
/**
|
|
2641
|
+
* Text Underline Offset
|
|
2642
|
+
* @see https://tailwindcss.com/docs/text-underline-offset
|
|
2643
|
+
*/
|
|
2644
|
+
"underline-offset": [{
|
|
2645
|
+
"underline-offset": ["auto", isLength, isArbitraryValue]
|
|
2646
|
+
}],
|
|
2647
|
+
/**
|
|
2648
|
+
* Text Decoration Color
|
|
2649
|
+
* @see https://tailwindcss.com/docs/text-decoration-color
|
|
2650
|
+
*/
|
|
2651
|
+
"text-decoration-color": [{
|
|
2652
|
+
decoration: [colors]
|
|
2653
|
+
}],
|
|
2654
|
+
/**
|
|
2655
|
+
* Text Transform
|
|
2656
|
+
* @see https://tailwindcss.com/docs/text-transform
|
|
2657
|
+
*/
|
|
2658
|
+
"text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
|
|
2659
|
+
/**
|
|
2660
|
+
* Text Overflow
|
|
2661
|
+
* @see https://tailwindcss.com/docs/text-overflow
|
|
2662
|
+
*/
|
|
2663
|
+
"text-overflow": ["truncate", "text-ellipsis", "text-clip"],
|
|
2664
|
+
/**
|
|
2665
|
+
* Text Wrap
|
|
2666
|
+
* @see https://tailwindcss.com/docs/text-wrap
|
|
2667
|
+
*/
|
|
2668
|
+
"text-wrap": [{
|
|
2669
|
+
text: ["wrap", "nowrap", "balance", "pretty"]
|
|
2670
|
+
}],
|
|
2671
|
+
/**
|
|
2672
|
+
* Text Indent
|
|
2673
|
+
* @see https://tailwindcss.com/docs/text-indent
|
|
2674
|
+
*/
|
|
2675
|
+
indent: [{
|
|
2676
|
+
indent: getSpacingWithArbitrary()
|
|
2677
|
+
}],
|
|
2678
|
+
/**
|
|
2679
|
+
* Vertical Alignment
|
|
2680
|
+
* @see https://tailwindcss.com/docs/vertical-align
|
|
2681
|
+
*/
|
|
2682
|
+
"vertical-align": [{
|
|
2683
|
+
align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", isArbitraryValue]
|
|
2684
|
+
}],
|
|
2685
|
+
/**
|
|
2686
|
+
* Whitespace
|
|
2687
|
+
* @see https://tailwindcss.com/docs/whitespace
|
|
2688
|
+
*/
|
|
2689
|
+
whitespace: [{
|
|
2690
|
+
whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"]
|
|
2691
|
+
}],
|
|
2692
|
+
/**
|
|
2693
|
+
* Word Break
|
|
2694
|
+
* @see https://tailwindcss.com/docs/word-break
|
|
2695
|
+
*/
|
|
2696
|
+
break: [{
|
|
2697
|
+
break: ["normal", "words", "all", "keep"]
|
|
2698
|
+
}],
|
|
2699
|
+
/**
|
|
2700
|
+
* Hyphens
|
|
2701
|
+
* @see https://tailwindcss.com/docs/hyphens
|
|
2702
|
+
*/
|
|
2703
|
+
hyphens: [{
|
|
2704
|
+
hyphens: ["none", "manual", "auto"]
|
|
2705
|
+
}],
|
|
2706
|
+
/**
|
|
2707
|
+
* Content
|
|
2708
|
+
* @see https://tailwindcss.com/docs/content
|
|
2709
|
+
*/
|
|
2710
|
+
content: [{
|
|
2711
|
+
content: ["none", isArbitraryValue]
|
|
2712
|
+
}],
|
|
2713
|
+
// Backgrounds
|
|
2714
|
+
/**
|
|
2715
|
+
* Background Attachment
|
|
2716
|
+
* @see https://tailwindcss.com/docs/background-attachment
|
|
2717
|
+
*/
|
|
2718
|
+
"bg-attachment": [{
|
|
2719
|
+
bg: ["fixed", "local", "scroll"]
|
|
2720
|
+
}],
|
|
2721
|
+
/**
|
|
2722
|
+
* Background Clip
|
|
2723
|
+
* @see https://tailwindcss.com/docs/background-clip
|
|
2724
|
+
*/
|
|
2725
|
+
"bg-clip": [{
|
|
2726
|
+
"bg-clip": ["border", "padding", "content", "text"]
|
|
2727
|
+
}],
|
|
2728
|
+
/**
|
|
2729
|
+
* Background Opacity
|
|
2730
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
2731
|
+
* @see https://tailwindcss.com/docs/background-opacity
|
|
2732
|
+
*/
|
|
2733
|
+
"bg-opacity": [{
|
|
2734
|
+
"bg-opacity": [opacity]
|
|
2735
|
+
}],
|
|
2736
|
+
/**
|
|
2737
|
+
* Background Origin
|
|
2738
|
+
* @see https://tailwindcss.com/docs/background-origin
|
|
2739
|
+
*/
|
|
2740
|
+
"bg-origin": [{
|
|
2741
|
+
"bg-origin": ["border", "padding", "content"]
|
|
2742
|
+
}],
|
|
2743
|
+
/**
|
|
2744
|
+
* Background Position
|
|
2745
|
+
* @see https://tailwindcss.com/docs/background-position
|
|
2746
|
+
*/
|
|
2747
|
+
"bg-position": [{
|
|
2748
|
+
bg: [...getPositions(), isArbitraryPosition]
|
|
2749
|
+
}],
|
|
2750
|
+
/**
|
|
2751
|
+
* Background Repeat
|
|
2752
|
+
* @see https://tailwindcss.com/docs/background-repeat
|
|
2753
|
+
*/
|
|
2754
|
+
"bg-repeat": [{
|
|
2755
|
+
bg: ["no-repeat", {
|
|
2756
|
+
repeat: ["", "x", "y", "round", "space"]
|
|
2757
|
+
}]
|
|
2758
|
+
}],
|
|
2759
|
+
/**
|
|
2760
|
+
* Background Size
|
|
2761
|
+
* @see https://tailwindcss.com/docs/background-size
|
|
2762
|
+
*/
|
|
2763
|
+
"bg-size": [{
|
|
2764
|
+
bg: ["auto", "cover", "contain", isArbitrarySize]
|
|
2765
|
+
}],
|
|
2766
|
+
/**
|
|
2767
|
+
* Background Image
|
|
2768
|
+
* @see https://tailwindcss.com/docs/background-image
|
|
2769
|
+
*/
|
|
2770
|
+
"bg-image": [{
|
|
2771
|
+
bg: ["none", {
|
|
2772
|
+
"gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
|
|
2773
|
+
}, isArbitraryImage]
|
|
2774
|
+
}],
|
|
2775
|
+
/**
|
|
2776
|
+
* Background Color
|
|
2777
|
+
* @see https://tailwindcss.com/docs/background-color
|
|
2778
|
+
*/
|
|
2779
|
+
"bg-color": [{
|
|
2780
|
+
bg: [colors]
|
|
2781
|
+
}],
|
|
2782
|
+
/**
|
|
2783
|
+
* Gradient Color Stops From Position
|
|
2784
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
2785
|
+
*/
|
|
2786
|
+
"gradient-from-pos": [{
|
|
2787
|
+
from: [gradientColorStopPositions]
|
|
2788
|
+
}],
|
|
2789
|
+
/**
|
|
2790
|
+
* Gradient Color Stops Via Position
|
|
2791
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
2792
|
+
*/
|
|
2793
|
+
"gradient-via-pos": [{
|
|
2794
|
+
via: [gradientColorStopPositions]
|
|
2795
|
+
}],
|
|
2796
|
+
/**
|
|
2797
|
+
* Gradient Color Stops To Position
|
|
2798
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
2799
|
+
*/
|
|
2800
|
+
"gradient-to-pos": [{
|
|
2801
|
+
to: [gradientColorStopPositions]
|
|
2802
|
+
}],
|
|
2803
|
+
/**
|
|
2804
|
+
* Gradient Color Stops From
|
|
2805
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
2806
|
+
*/
|
|
2807
|
+
"gradient-from": [{
|
|
2808
|
+
from: [gradientColorStops]
|
|
2809
|
+
}],
|
|
2810
|
+
/**
|
|
2811
|
+
* Gradient Color Stops Via
|
|
2812
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
2813
|
+
*/
|
|
2814
|
+
"gradient-via": [{
|
|
2815
|
+
via: [gradientColorStops]
|
|
2816
|
+
}],
|
|
2817
|
+
/**
|
|
2818
|
+
* Gradient Color Stops To
|
|
2819
|
+
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
2820
|
+
*/
|
|
2821
|
+
"gradient-to": [{
|
|
2822
|
+
to: [gradientColorStops]
|
|
2823
|
+
}],
|
|
2824
|
+
// Borders
|
|
2825
|
+
/**
|
|
2826
|
+
* Border Radius
|
|
2827
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2828
|
+
*/
|
|
2829
|
+
rounded: [{
|
|
2830
|
+
rounded: [borderRadius]
|
|
2831
|
+
}],
|
|
2832
|
+
/**
|
|
2833
|
+
* Border Radius Start
|
|
2834
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2835
|
+
*/
|
|
2836
|
+
"rounded-s": [{
|
|
2837
|
+
"rounded-s": [borderRadius]
|
|
2838
|
+
}],
|
|
2839
|
+
/**
|
|
2840
|
+
* Border Radius End
|
|
2841
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2842
|
+
*/
|
|
2843
|
+
"rounded-e": [{
|
|
2844
|
+
"rounded-e": [borderRadius]
|
|
2845
|
+
}],
|
|
2846
|
+
/**
|
|
2847
|
+
* Border Radius Top
|
|
2848
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2849
|
+
*/
|
|
2850
|
+
"rounded-t": [{
|
|
2851
|
+
"rounded-t": [borderRadius]
|
|
2852
|
+
}],
|
|
2853
|
+
/**
|
|
2854
|
+
* Border Radius Right
|
|
2855
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2856
|
+
*/
|
|
2857
|
+
"rounded-r": [{
|
|
2858
|
+
"rounded-r": [borderRadius]
|
|
2859
|
+
}],
|
|
2860
|
+
/**
|
|
2861
|
+
* Border Radius Bottom
|
|
2862
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2863
|
+
*/
|
|
2864
|
+
"rounded-b": [{
|
|
2865
|
+
"rounded-b": [borderRadius]
|
|
2866
|
+
}],
|
|
2867
|
+
/**
|
|
2868
|
+
* Border Radius Left
|
|
2869
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2870
|
+
*/
|
|
2871
|
+
"rounded-l": [{
|
|
2872
|
+
"rounded-l": [borderRadius]
|
|
2873
|
+
}],
|
|
2874
|
+
/**
|
|
2875
|
+
* Border Radius Start Start
|
|
2876
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2877
|
+
*/
|
|
2878
|
+
"rounded-ss": [{
|
|
2879
|
+
"rounded-ss": [borderRadius]
|
|
2880
|
+
}],
|
|
2881
|
+
/**
|
|
2882
|
+
* Border Radius Start End
|
|
2883
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2884
|
+
*/
|
|
2885
|
+
"rounded-se": [{
|
|
2886
|
+
"rounded-se": [borderRadius]
|
|
2887
|
+
}],
|
|
2888
|
+
/**
|
|
2889
|
+
* Border Radius End End
|
|
2890
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2891
|
+
*/
|
|
2892
|
+
"rounded-ee": [{
|
|
2893
|
+
"rounded-ee": [borderRadius]
|
|
2894
|
+
}],
|
|
2895
|
+
/**
|
|
2896
|
+
* Border Radius End Start
|
|
2897
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2898
|
+
*/
|
|
2899
|
+
"rounded-es": [{
|
|
2900
|
+
"rounded-es": [borderRadius]
|
|
2901
|
+
}],
|
|
2902
|
+
/**
|
|
2903
|
+
* Border Radius Top Left
|
|
2904
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2905
|
+
*/
|
|
2906
|
+
"rounded-tl": [{
|
|
2907
|
+
"rounded-tl": [borderRadius]
|
|
2908
|
+
}],
|
|
2909
|
+
/**
|
|
2910
|
+
* Border Radius Top Right
|
|
2911
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2912
|
+
*/
|
|
2913
|
+
"rounded-tr": [{
|
|
2914
|
+
"rounded-tr": [borderRadius]
|
|
2915
|
+
}],
|
|
2916
|
+
/**
|
|
2917
|
+
* Border Radius Bottom Right
|
|
2918
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2919
|
+
*/
|
|
2920
|
+
"rounded-br": [{
|
|
2921
|
+
"rounded-br": [borderRadius]
|
|
2922
|
+
}],
|
|
2923
|
+
/**
|
|
2924
|
+
* Border Radius Bottom Left
|
|
2925
|
+
* @see https://tailwindcss.com/docs/border-radius
|
|
2926
|
+
*/
|
|
2927
|
+
"rounded-bl": [{
|
|
2928
|
+
"rounded-bl": [borderRadius]
|
|
2929
|
+
}],
|
|
2930
|
+
/**
|
|
2931
|
+
* Border Width
|
|
2932
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2933
|
+
*/
|
|
2934
|
+
"border-w": [{
|
|
2935
|
+
border: [borderWidth]
|
|
2936
|
+
}],
|
|
2937
|
+
/**
|
|
2938
|
+
* Border Width X
|
|
2939
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2940
|
+
*/
|
|
2941
|
+
"border-w-x": [{
|
|
2942
|
+
"border-x": [borderWidth]
|
|
2943
|
+
}],
|
|
2944
|
+
/**
|
|
2945
|
+
* Border Width Y
|
|
2946
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2947
|
+
*/
|
|
2948
|
+
"border-w-y": [{
|
|
2949
|
+
"border-y": [borderWidth]
|
|
2950
|
+
}],
|
|
2951
|
+
/**
|
|
2952
|
+
* Border Width Start
|
|
2953
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2954
|
+
*/
|
|
2955
|
+
"border-w-s": [{
|
|
2956
|
+
"border-s": [borderWidth]
|
|
2957
|
+
}],
|
|
2958
|
+
/**
|
|
2959
|
+
* Border Width End
|
|
2960
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2961
|
+
*/
|
|
2962
|
+
"border-w-e": [{
|
|
2963
|
+
"border-e": [borderWidth]
|
|
2964
|
+
}],
|
|
2965
|
+
/**
|
|
2966
|
+
* Border Width Top
|
|
2967
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2968
|
+
*/
|
|
2969
|
+
"border-w-t": [{
|
|
2970
|
+
"border-t": [borderWidth]
|
|
2971
|
+
}],
|
|
2972
|
+
/**
|
|
2973
|
+
* Border Width Right
|
|
2974
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2975
|
+
*/
|
|
2976
|
+
"border-w-r": [{
|
|
2977
|
+
"border-r": [borderWidth]
|
|
2978
|
+
}],
|
|
2979
|
+
/**
|
|
2980
|
+
* Border Width Bottom
|
|
2981
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2982
|
+
*/
|
|
2983
|
+
"border-w-b": [{
|
|
2984
|
+
"border-b": [borderWidth]
|
|
2985
|
+
}],
|
|
2986
|
+
/**
|
|
2987
|
+
* Border Width Left
|
|
2988
|
+
* @see https://tailwindcss.com/docs/border-width
|
|
2989
|
+
*/
|
|
2990
|
+
"border-w-l": [{
|
|
2991
|
+
"border-l": [borderWidth]
|
|
2992
|
+
}],
|
|
2993
|
+
/**
|
|
2994
|
+
* Border Opacity
|
|
2995
|
+
* @see https://tailwindcss.com/docs/border-opacity
|
|
2996
|
+
*/
|
|
2997
|
+
"border-opacity": [{
|
|
2998
|
+
"border-opacity": [opacity]
|
|
2999
|
+
}],
|
|
3000
|
+
/**
|
|
3001
|
+
* Border Style
|
|
3002
|
+
* @see https://tailwindcss.com/docs/border-style
|
|
3003
|
+
*/
|
|
3004
|
+
"border-style": [{
|
|
3005
|
+
border: [...getLineStyles(), "hidden"]
|
|
3006
|
+
}],
|
|
3007
|
+
/**
|
|
3008
|
+
* Divide Width X
|
|
3009
|
+
* @see https://tailwindcss.com/docs/divide-width
|
|
3010
|
+
*/
|
|
3011
|
+
"divide-x": [{
|
|
3012
|
+
"divide-x": [borderWidth]
|
|
3013
|
+
}],
|
|
3014
|
+
/**
|
|
3015
|
+
* Divide Width X Reverse
|
|
3016
|
+
* @see https://tailwindcss.com/docs/divide-width
|
|
3017
|
+
*/
|
|
3018
|
+
"divide-x-reverse": ["divide-x-reverse"],
|
|
3019
|
+
/**
|
|
3020
|
+
* Divide Width Y
|
|
3021
|
+
* @see https://tailwindcss.com/docs/divide-width
|
|
3022
|
+
*/
|
|
3023
|
+
"divide-y": [{
|
|
3024
|
+
"divide-y": [borderWidth]
|
|
3025
|
+
}],
|
|
3026
|
+
/**
|
|
3027
|
+
* Divide Width Y Reverse
|
|
3028
|
+
* @see https://tailwindcss.com/docs/divide-width
|
|
3029
|
+
*/
|
|
3030
|
+
"divide-y-reverse": ["divide-y-reverse"],
|
|
3031
|
+
/**
|
|
3032
|
+
* Divide Opacity
|
|
3033
|
+
* @see https://tailwindcss.com/docs/divide-opacity
|
|
3034
|
+
*/
|
|
3035
|
+
"divide-opacity": [{
|
|
3036
|
+
"divide-opacity": [opacity]
|
|
3037
|
+
}],
|
|
3038
|
+
/**
|
|
3039
|
+
* Divide Style
|
|
3040
|
+
* @see https://tailwindcss.com/docs/divide-style
|
|
3041
|
+
*/
|
|
3042
|
+
"divide-style": [{
|
|
3043
|
+
divide: getLineStyles()
|
|
3044
|
+
}],
|
|
3045
|
+
/**
|
|
3046
|
+
* Border Color
|
|
3047
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
3048
|
+
*/
|
|
3049
|
+
"border-color": [{
|
|
3050
|
+
border: [borderColor]
|
|
3051
|
+
}],
|
|
3052
|
+
/**
|
|
3053
|
+
* Border Color X
|
|
3054
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
3055
|
+
*/
|
|
3056
|
+
"border-color-x": [{
|
|
3057
|
+
"border-x": [borderColor]
|
|
3058
|
+
}],
|
|
3059
|
+
/**
|
|
3060
|
+
* Border Color Y
|
|
3061
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
3062
|
+
*/
|
|
3063
|
+
"border-color-y": [{
|
|
3064
|
+
"border-y": [borderColor]
|
|
3065
|
+
}],
|
|
3066
|
+
/**
|
|
3067
|
+
* Border Color S
|
|
3068
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
3069
|
+
*/
|
|
3070
|
+
"border-color-s": [{
|
|
3071
|
+
"border-s": [borderColor]
|
|
3072
|
+
}],
|
|
3073
|
+
/**
|
|
3074
|
+
* Border Color E
|
|
3075
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
3076
|
+
*/
|
|
3077
|
+
"border-color-e": [{
|
|
3078
|
+
"border-e": [borderColor]
|
|
3079
|
+
}],
|
|
3080
|
+
/**
|
|
3081
|
+
* Border Color Top
|
|
3082
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
3083
|
+
*/
|
|
3084
|
+
"border-color-t": [{
|
|
3085
|
+
"border-t": [borderColor]
|
|
3086
|
+
}],
|
|
3087
|
+
/**
|
|
3088
|
+
* Border Color Right
|
|
3089
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
3090
|
+
*/
|
|
3091
|
+
"border-color-r": [{
|
|
3092
|
+
"border-r": [borderColor]
|
|
3093
|
+
}],
|
|
3094
|
+
/**
|
|
3095
|
+
* Border Color Bottom
|
|
3096
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
3097
|
+
*/
|
|
3098
|
+
"border-color-b": [{
|
|
3099
|
+
"border-b": [borderColor]
|
|
3100
|
+
}],
|
|
3101
|
+
/**
|
|
3102
|
+
* Border Color Left
|
|
3103
|
+
* @see https://tailwindcss.com/docs/border-color
|
|
3104
|
+
*/
|
|
3105
|
+
"border-color-l": [{
|
|
3106
|
+
"border-l": [borderColor]
|
|
3107
|
+
}],
|
|
3108
|
+
/**
|
|
3109
|
+
* Divide Color
|
|
3110
|
+
* @see https://tailwindcss.com/docs/divide-color
|
|
3111
|
+
*/
|
|
3112
|
+
"divide-color": [{
|
|
3113
|
+
divide: [borderColor]
|
|
3114
|
+
}],
|
|
3115
|
+
/**
|
|
3116
|
+
* Outline Style
|
|
3117
|
+
* @see https://tailwindcss.com/docs/outline-style
|
|
3118
|
+
*/
|
|
3119
|
+
"outline-style": [{
|
|
3120
|
+
outline: ["", ...getLineStyles()]
|
|
3121
|
+
}],
|
|
3122
|
+
/**
|
|
3123
|
+
* Outline Offset
|
|
3124
|
+
* @see https://tailwindcss.com/docs/outline-offset
|
|
3125
|
+
*/
|
|
3126
|
+
"outline-offset": [{
|
|
3127
|
+
"outline-offset": [isLength, isArbitraryValue]
|
|
3128
|
+
}],
|
|
3129
|
+
/**
|
|
3130
|
+
* Outline Width
|
|
3131
|
+
* @see https://tailwindcss.com/docs/outline-width
|
|
3132
|
+
*/
|
|
3133
|
+
"outline-w": [{
|
|
3134
|
+
outline: [isLength, isArbitraryLength]
|
|
3135
|
+
}],
|
|
3136
|
+
/**
|
|
3137
|
+
* Outline Color
|
|
3138
|
+
* @see https://tailwindcss.com/docs/outline-color
|
|
3139
|
+
*/
|
|
3140
|
+
"outline-color": [{
|
|
3141
|
+
outline: [colors]
|
|
3142
|
+
}],
|
|
3143
|
+
/**
|
|
3144
|
+
* Ring Width
|
|
3145
|
+
* @see https://tailwindcss.com/docs/ring-width
|
|
3146
|
+
*/
|
|
3147
|
+
"ring-w": [{
|
|
3148
|
+
ring: getLengthWithEmptyAndArbitrary()
|
|
3149
|
+
}],
|
|
3150
|
+
/**
|
|
3151
|
+
* Ring Width Inset
|
|
3152
|
+
* @see https://tailwindcss.com/docs/ring-width
|
|
3153
|
+
*/
|
|
3154
|
+
"ring-w-inset": ["ring-inset"],
|
|
3155
|
+
/**
|
|
3156
|
+
* Ring Color
|
|
3157
|
+
* @see https://tailwindcss.com/docs/ring-color
|
|
3158
|
+
*/
|
|
3159
|
+
"ring-color": [{
|
|
3160
|
+
ring: [colors]
|
|
3161
|
+
}],
|
|
3162
|
+
/**
|
|
3163
|
+
* Ring Opacity
|
|
3164
|
+
* @see https://tailwindcss.com/docs/ring-opacity
|
|
3165
|
+
*/
|
|
3166
|
+
"ring-opacity": [{
|
|
3167
|
+
"ring-opacity": [opacity]
|
|
3168
|
+
}],
|
|
3169
|
+
/**
|
|
3170
|
+
* Ring Offset Width
|
|
3171
|
+
* @see https://tailwindcss.com/docs/ring-offset-width
|
|
3172
|
+
*/
|
|
3173
|
+
"ring-offset-w": [{
|
|
3174
|
+
"ring-offset": [isLength, isArbitraryLength]
|
|
3175
|
+
}],
|
|
3176
|
+
/**
|
|
3177
|
+
* Ring Offset Color
|
|
3178
|
+
* @see https://tailwindcss.com/docs/ring-offset-color
|
|
3179
|
+
*/
|
|
3180
|
+
"ring-offset-color": [{
|
|
3181
|
+
"ring-offset": [colors]
|
|
3182
|
+
}],
|
|
3183
|
+
// Effects
|
|
3184
|
+
/**
|
|
3185
|
+
* Box Shadow
|
|
3186
|
+
* @see https://tailwindcss.com/docs/box-shadow
|
|
3187
|
+
*/
|
|
3188
|
+
shadow: [{
|
|
3189
|
+
shadow: ["", "inner", "none", isTshirtSize, isArbitraryShadow]
|
|
3190
|
+
}],
|
|
3191
|
+
/**
|
|
3192
|
+
* Box Shadow Color
|
|
3193
|
+
* @see https://tailwindcss.com/docs/box-shadow-color
|
|
3194
|
+
*/
|
|
3195
|
+
"shadow-color": [{
|
|
3196
|
+
shadow: [isAny]
|
|
3197
|
+
}],
|
|
3198
|
+
/**
|
|
3199
|
+
* Opacity
|
|
3200
|
+
* @see https://tailwindcss.com/docs/opacity
|
|
3201
|
+
*/
|
|
3202
|
+
opacity: [{
|
|
3203
|
+
opacity: [opacity]
|
|
3204
|
+
}],
|
|
3205
|
+
/**
|
|
3206
|
+
* Mix Blend Mode
|
|
3207
|
+
* @see https://tailwindcss.com/docs/mix-blend-mode
|
|
3208
|
+
*/
|
|
3209
|
+
"mix-blend": [{
|
|
3210
|
+
"mix-blend": [...getBlendModes(), "plus-lighter", "plus-darker"]
|
|
3211
|
+
}],
|
|
3212
|
+
/**
|
|
3213
|
+
* Background Blend Mode
|
|
3214
|
+
* @see https://tailwindcss.com/docs/background-blend-mode
|
|
3215
|
+
*/
|
|
3216
|
+
"bg-blend": [{
|
|
3217
|
+
"bg-blend": getBlendModes()
|
|
3218
|
+
}],
|
|
3219
|
+
// Filters
|
|
3220
|
+
/**
|
|
3221
|
+
* Filter
|
|
3222
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
3223
|
+
* @see https://tailwindcss.com/docs/filter
|
|
3224
|
+
*/
|
|
3225
|
+
filter: [{
|
|
3226
|
+
filter: ["", "none"]
|
|
3227
|
+
}],
|
|
3228
|
+
/**
|
|
3229
|
+
* Blur
|
|
3230
|
+
* @see https://tailwindcss.com/docs/blur
|
|
3231
|
+
*/
|
|
3232
|
+
blur: [{
|
|
3233
|
+
blur: [blur]
|
|
3234
|
+
}],
|
|
3235
|
+
/**
|
|
3236
|
+
* Brightness
|
|
3237
|
+
* @see https://tailwindcss.com/docs/brightness
|
|
3238
|
+
*/
|
|
3239
|
+
brightness: [{
|
|
3240
|
+
brightness: [brightness]
|
|
3241
|
+
}],
|
|
3242
|
+
/**
|
|
3243
|
+
* Contrast
|
|
3244
|
+
* @see https://tailwindcss.com/docs/contrast
|
|
3245
|
+
*/
|
|
3246
|
+
contrast: [{
|
|
3247
|
+
contrast: [contrast]
|
|
3248
|
+
}],
|
|
3249
|
+
/**
|
|
3250
|
+
* Drop Shadow
|
|
3251
|
+
* @see https://tailwindcss.com/docs/drop-shadow
|
|
3252
|
+
*/
|
|
3253
|
+
"drop-shadow": [{
|
|
3254
|
+
"drop-shadow": ["", "none", isTshirtSize, isArbitraryValue]
|
|
3255
|
+
}],
|
|
3256
|
+
/**
|
|
3257
|
+
* Grayscale
|
|
3258
|
+
* @see https://tailwindcss.com/docs/grayscale
|
|
3259
|
+
*/
|
|
3260
|
+
grayscale: [{
|
|
3261
|
+
grayscale: [grayscale]
|
|
3262
|
+
}],
|
|
3263
|
+
/**
|
|
3264
|
+
* Hue Rotate
|
|
3265
|
+
* @see https://tailwindcss.com/docs/hue-rotate
|
|
3266
|
+
*/
|
|
3267
|
+
"hue-rotate": [{
|
|
3268
|
+
"hue-rotate": [hueRotate]
|
|
3269
|
+
}],
|
|
3270
|
+
/**
|
|
3271
|
+
* Invert
|
|
3272
|
+
* @see https://tailwindcss.com/docs/invert
|
|
3273
|
+
*/
|
|
3274
|
+
invert: [{
|
|
3275
|
+
invert: [invert]
|
|
3276
|
+
}],
|
|
3277
|
+
/**
|
|
3278
|
+
* Saturate
|
|
3279
|
+
* @see https://tailwindcss.com/docs/saturate
|
|
3280
|
+
*/
|
|
3281
|
+
saturate: [{
|
|
3282
|
+
saturate: [saturate]
|
|
3283
|
+
}],
|
|
3284
|
+
/**
|
|
3285
|
+
* Sepia
|
|
3286
|
+
* @see https://tailwindcss.com/docs/sepia
|
|
3287
|
+
*/
|
|
3288
|
+
sepia: [{
|
|
3289
|
+
sepia: [sepia]
|
|
3290
|
+
}],
|
|
3291
|
+
/**
|
|
3292
|
+
* Backdrop Filter
|
|
3293
|
+
* @deprecated since Tailwind CSS v3.0.0
|
|
3294
|
+
* @see https://tailwindcss.com/docs/backdrop-filter
|
|
3295
|
+
*/
|
|
3296
|
+
"backdrop-filter": [{
|
|
3297
|
+
"backdrop-filter": ["", "none"]
|
|
3298
|
+
}],
|
|
3299
|
+
/**
|
|
3300
|
+
* Backdrop Blur
|
|
3301
|
+
* @see https://tailwindcss.com/docs/backdrop-blur
|
|
3302
|
+
*/
|
|
3303
|
+
"backdrop-blur": [{
|
|
3304
|
+
"backdrop-blur": [blur]
|
|
3305
|
+
}],
|
|
3306
|
+
/**
|
|
3307
|
+
* Backdrop Brightness
|
|
3308
|
+
* @see https://tailwindcss.com/docs/backdrop-brightness
|
|
3309
|
+
*/
|
|
3310
|
+
"backdrop-brightness": [{
|
|
3311
|
+
"backdrop-brightness": [brightness]
|
|
3312
|
+
}],
|
|
3313
|
+
/**
|
|
3314
|
+
* Backdrop Contrast
|
|
3315
|
+
* @see https://tailwindcss.com/docs/backdrop-contrast
|
|
3316
|
+
*/
|
|
3317
|
+
"backdrop-contrast": [{
|
|
3318
|
+
"backdrop-contrast": [contrast]
|
|
3319
|
+
}],
|
|
3320
|
+
/**
|
|
3321
|
+
* Backdrop Grayscale
|
|
3322
|
+
* @see https://tailwindcss.com/docs/backdrop-grayscale
|
|
3323
|
+
*/
|
|
3324
|
+
"backdrop-grayscale": [{
|
|
3325
|
+
"backdrop-grayscale": [grayscale]
|
|
3326
|
+
}],
|
|
3327
|
+
/**
|
|
3328
|
+
* Backdrop Hue Rotate
|
|
3329
|
+
* @see https://tailwindcss.com/docs/backdrop-hue-rotate
|
|
3330
|
+
*/
|
|
3331
|
+
"backdrop-hue-rotate": [{
|
|
3332
|
+
"backdrop-hue-rotate": [hueRotate]
|
|
3333
|
+
}],
|
|
3334
|
+
/**
|
|
3335
|
+
* Backdrop Invert
|
|
3336
|
+
* @see https://tailwindcss.com/docs/backdrop-invert
|
|
3337
|
+
*/
|
|
3338
|
+
"backdrop-invert": [{
|
|
3339
|
+
"backdrop-invert": [invert]
|
|
3340
|
+
}],
|
|
3341
|
+
/**
|
|
3342
|
+
* Backdrop Opacity
|
|
3343
|
+
* @see https://tailwindcss.com/docs/backdrop-opacity
|
|
3344
|
+
*/
|
|
3345
|
+
"backdrop-opacity": [{
|
|
3346
|
+
"backdrop-opacity": [opacity]
|
|
3347
|
+
}],
|
|
3348
|
+
/**
|
|
3349
|
+
* Backdrop Saturate
|
|
3350
|
+
* @see https://tailwindcss.com/docs/backdrop-saturate
|
|
3351
|
+
*/
|
|
3352
|
+
"backdrop-saturate": [{
|
|
3353
|
+
"backdrop-saturate": [saturate]
|
|
3354
|
+
}],
|
|
3355
|
+
/**
|
|
3356
|
+
* Backdrop Sepia
|
|
3357
|
+
* @see https://tailwindcss.com/docs/backdrop-sepia
|
|
3358
|
+
*/
|
|
3359
|
+
"backdrop-sepia": [{
|
|
3360
|
+
"backdrop-sepia": [sepia]
|
|
3361
|
+
}],
|
|
3362
|
+
// Tables
|
|
3363
|
+
/**
|
|
3364
|
+
* Border Collapse
|
|
3365
|
+
* @see https://tailwindcss.com/docs/border-collapse
|
|
3366
|
+
*/
|
|
3367
|
+
"border-collapse": [{
|
|
3368
|
+
border: ["collapse", "separate"]
|
|
3369
|
+
}],
|
|
3370
|
+
/**
|
|
3371
|
+
* Border Spacing
|
|
3372
|
+
* @see https://tailwindcss.com/docs/border-spacing
|
|
3373
|
+
*/
|
|
3374
|
+
"border-spacing": [{
|
|
3375
|
+
"border-spacing": [borderSpacing]
|
|
3376
|
+
}],
|
|
3377
|
+
/**
|
|
3378
|
+
* Border Spacing X
|
|
3379
|
+
* @see https://tailwindcss.com/docs/border-spacing
|
|
3380
|
+
*/
|
|
3381
|
+
"border-spacing-x": [{
|
|
3382
|
+
"border-spacing-x": [borderSpacing]
|
|
3383
|
+
}],
|
|
3384
|
+
/**
|
|
3385
|
+
* Border Spacing Y
|
|
3386
|
+
* @see https://tailwindcss.com/docs/border-spacing
|
|
3387
|
+
*/
|
|
3388
|
+
"border-spacing-y": [{
|
|
3389
|
+
"border-spacing-y": [borderSpacing]
|
|
3390
|
+
}],
|
|
3391
|
+
/**
|
|
3392
|
+
* Table Layout
|
|
3393
|
+
* @see https://tailwindcss.com/docs/table-layout
|
|
3394
|
+
*/
|
|
3395
|
+
"table-layout": [{
|
|
3396
|
+
table: ["auto", "fixed"]
|
|
3397
|
+
}],
|
|
3398
|
+
/**
|
|
3399
|
+
* Caption Side
|
|
3400
|
+
* @see https://tailwindcss.com/docs/caption-side
|
|
3401
|
+
*/
|
|
3402
|
+
caption: [{
|
|
3403
|
+
caption: ["top", "bottom"]
|
|
3404
|
+
}],
|
|
3405
|
+
// Transitions and Animation
|
|
3406
|
+
/**
|
|
3407
|
+
* Tranisition Property
|
|
3408
|
+
* @see https://tailwindcss.com/docs/transition-property
|
|
3409
|
+
*/
|
|
3410
|
+
transition: [{
|
|
3411
|
+
transition: ["none", "all", "", "colors", "opacity", "shadow", "transform", isArbitraryValue]
|
|
3412
|
+
}],
|
|
3413
|
+
/**
|
|
3414
|
+
* Transition Duration
|
|
3415
|
+
* @see https://tailwindcss.com/docs/transition-duration
|
|
3416
|
+
*/
|
|
3417
|
+
duration: [{
|
|
3418
|
+
duration: getNumberAndArbitrary()
|
|
3419
|
+
}],
|
|
3420
|
+
/**
|
|
3421
|
+
* Transition Timing Function
|
|
3422
|
+
* @see https://tailwindcss.com/docs/transition-timing-function
|
|
3423
|
+
*/
|
|
3424
|
+
ease: [{
|
|
3425
|
+
ease: ["linear", "in", "out", "in-out", isArbitraryValue]
|
|
3426
|
+
}],
|
|
3427
|
+
/**
|
|
3428
|
+
* Transition Delay
|
|
3429
|
+
* @see https://tailwindcss.com/docs/transition-delay
|
|
3430
|
+
*/
|
|
3431
|
+
delay: [{
|
|
3432
|
+
delay: getNumberAndArbitrary()
|
|
3433
|
+
}],
|
|
3434
|
+
/**
|
|
3435
|
+
* Animation
|
|
3436
|
+
* @see https://tailwindcss.com/docs/animation
|
|
3437
|
+
*/
|
|
3438
|
+
animate: [{
|
|
3439
|
+
animate: ["none", "spin", "ping", "pulse", "bounce", isArbitraryValue]
|
|
3440
|
+
}],
|
|
3441
|
+
// Transforms
|
|
3442
|
+
/**
|
|
3443
|
+
* Transform
|
|
3444
|
+
* @see https://tailwindcss.com/docs/transform
|
|
3445
|
+
*/
|
|
3446
|
+
transform: [{
|
|
3447
|
+
transform: ["", "gpu", "none"]
|
|
3448
|
+
}],
|
|
3449
|
+
/**
|
|
3450
|
+
* Scale
|
|
3451
|
+
* @see https://tailwindcss.com/docs/scale
|
|
3452
|
+
*/
|
|
3453
|
+
scale: [{
|
|
3454
|
+
scale: [scale]
|
|
3455
|
+
}],
|
|
3456
|
+
/**
|
|
3457
|
+
* Scale X
|
|
3458
|
+
* @see https://tailwindcss.com/docs/scale
|
|
3459
|
+
*/
|
|
3460
|
+
"scale-x": [{
|
|
3461
|
+
"scale-x": [scale]
|
|
3462
|
+
}],
|
|
3463
|
+
/**
|
|
3464
|
+
* Scale Y
|
|
3465
|
+
* @see https://tailwindcss.com/docs/scale
|
|
3466
|
+
*/
|
|
3467
|
+
"scale-y": [{
|
|
3468
|
+
"scale-y": [scale]
|
|
3469
|
+
}],
|
|
3470
|
+
/**
|
|
3471
|
+
* Rotate
|
|
3472
|
+
* @see https://tailwindcss.com/docs/rotate
|
|
3473
|
+
*/
|
|
3474
|
+
rotate: [{
|
|
3475
|
+
rotate: [isInteger, isArbitraryValue]
|
|
3476
|
+
}],
|
|
3477
|
+
/**
|
|
3478
|
+
* Translate X
|
|
3479
|
+
* @see https://tailwindcss.com/docs/translate
|
|
3480
|
+
*/
|
|
3481
|
+
"translate-x": [{
|
|
3482
|
+
"translate-x": [translate]
|
|
3483
|
+
}],
|
|
3484
|
+
/**
|
|
3485
|
+
* Translate Y
|
|
3486
|
+
* @see https://tailwindcss.com/docs/translate
|
|
3487
|
+
*/
|
|
3488
|
+
"translate-y": [{
|
|
3489
|
+
"translate-y": [translate]
|
|
3490
|
+
}],
|
|
3491
|
+
/**
|
|
3492
|
+
* Skew X
|
|
3493
|
+
* @see https://tailwindcss.com/docs/skew
|
|
3494
|
+
*/
|
|
3495
|
+
"skew-x": [{
|
|
3496
|
+
"skew-x": [skew]
|
|
3497
|
+
}],
|
|
3498
|
+
/**
|
|
3499
|
+
* Skew Y
|
|
3500
|
+
* @see https://tailwindcss.com/docs/skew
|
|
3501
|
+
*/
|
|
3502
|
+
"skew-y": [{
|
|
3503
|
+
"skew-y": [skew]
|
|
3504
|
+
}],
|
|
3505
|
+
/**
|
|
3506
|
+
* Transform Origin
|
|
3507
|
+
* @see https://tailwindcss.com/docs/transform-origin
|
|
3508
|
+
*/
|
|
3509
|
+
"transform-origin": [{
|
|
3510
|
+
origin: ["center", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", isArbitraryValue]
|
|
3511
|
+
}],
|
|
3512
|
+
// Interactivity
|
|
3513
|
+
/**
|
|
3514
|
+
* Accent Color
|
|
3515
|
+
* @see https://tailwindcss.com/docs/accent-color
|
|
3516
|
+
*/
|
|
3517
|
+
accent: [{
|
|
3518
|
+
accent: ["auto", colors]
|
|
3519
|
+
}],
|
|
3520
|
+
/**
|
|
3521
|
+
* Appearance
|
|
3522
|
+
* @see https://tailwindcss.com/docs/appearance
|
|
3523
|
+
*/
|
|
3524
|
+
appearance: [{
|
|
3525
|
+
appearance: ["none", "auto"]
|
|
3526
|
+
}],
|
|
3527
|
+
/**
|
|
3528
|
+
* Cursor
|
|
3529
|
+
* @see https://tailwindcss.com/docs/cursor
|
|
3530
|
+
*/
|
|
3531
|
+
cursor: [{
|
|
3532
|
+
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]
|
|
3533
|
+
}],
|
|
3534
|
+
/**
|
|
3535
|
+
* Caret Color
|
|
3536
|
+
* @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
|
|
3537
|
+
*/
|
|
3538
|
+
"caret-color": [{
|
|
3539
|
+
caret: [colors]
|
|
3540
|
+
}],
|
|
3541
|
+
/**
|
|
3542
|
+
* Pointer Events
|
|
3543
|
+
* @see https://tailwindcss.com/docs/pointer-events
|
|
3544
|
+
*/
|
|
3545
|
+
"pointer-events": [{
|
|
3546
|
+
"pointer-events": ["none", "auto"]
|
|
3547
|
+
}],
|
|
3548
|
+
/**
|
|
3549
|
+
* Resize
|
|
3550
|
+
* @see https://tailwindcss.com/docs/resize
|
|
3551
|
+
*/
|
|
3552
|
+
resize: [{
|
|
3553
|
+
resize: ["none", "y", "x", ""]
|
|
3554
|
+
}],
|
|
3555
|
+
/**
|
|
3556
|
+
* Scroll Behavior
|
|
3557
|
+
* @see https://tailwindcss.com/docs/scroll-behavior
|
|
3558
|
+
*/
|
|
3559
|
+
"scroll-behavior": [{
|
|
3560
|
+
scroll: ["auto", "smooth"]
|
|
3561
|
+
}],
|
|
3562
|
+
/**
|
|
3563
|
+
* Scroll Margin
|
|
3564
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3565
|
+
*/
|
|
3566
|
+
"scroll-m": [{
|
|
3567
|
+
"scroll-m": getSpacingWithArbitrary()
|
|
3568
|
+
}],
|
|
3569
|
+
/**
|
|
3570
|
+
* Scroll Margin X
|
|
3571
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3572
|
+
*/
|
|
3573
|
+
"scroll-mx": [{
|
|
3574
|
+
"scroll-mx": getSpacingWithArbitrary()
|
|
3575
|
+
}],
|
|
3576
|
+
/**
|
|
3577
|
+
* Scroll Margin Y
|
|
3578
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3579
|
+
*/
|
|
3580
|
+
"scroll-my": [{
|
|
3581
|
+
"scroll-my": getSpacingWithArbitrary()
|
|
3582
|
+
}],
|
|
3583
|
+
/**
|
|
3584
|
+
* Scroll Margin Start
|
|
3585
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3586
|
+
*/
|
|
3587
|
+
"scroll-ms": [{
|
|
3588
|
+
"scroll-ms": getSpacingWithArbitrary()
|
|
3589
|
+
}],
|
|
3590
|
+
/**
|
|
3591
|
+
* Scroll Margin End
|
|
3592
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3593
|
+
*/
|
|
3594
|
+
"scroll-me": [{
|
|
3595
|
+
"scroll-me": getSpacingWithArbitrary()
|
|
3596
|
+
}],
|
|
3597
|
+
/**
|
|
3598
|
+
* Scroll Margin Top
|
|
3599
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3600
|
+
*/
|
|
3601
|
+
"scroll-mt": [{
|
|
3602
|
+
"scroll-mt": getSpacingWithArbitrary()
|
|
3603
|
+
}],
|
|
3604
|
+
/**
|
|
3605
|
+
* Scroll Margin Right
|
|
3606
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3607
|
+
*/
|
|
3608
|
+
"scroll-mr": [{
|
|
3609
|
+
"scroll-mr": getSpacingWithArbitrary()
|
|
3610
|
+
}],
|
|
3611
|
+
/**
|
|
3612
|
+
* Scroll Margin Bottom
|
|
3613
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3614
|
+
*/
|
|
3615
|
+
"scroll-mb": [{
|
|
3616
|
+
"scroll-mb": getSpacingWithArbitrary()
|
|
3617
|
+
}],
|
|
3618
|
+
/**
|
|
3619
|
+
* Scroll Margin Left
|
|
3620
|
+
* @see https://tailwindcss.com/docs/scroll-margin
|
|
3621
|
+
*/
|
|
3622
|
+
"scroll-ml": [{
|
|
3623
|
+
"scroll-ml": getSpacingWithArbitrary()
|
|
3624
|
+
}],
|
|
3625
|
+
/**
|
|
3626
|
+
* Scroll Padding
|
|
3627
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3628
|
+
*/
|
|
3629
|
+
"scroll-p": [{
|
|
3630
|
+
"scroll-p": getSpacingWithArbitrary()
|
|
3631
|
+
}],
|
|
3632
|
+
/**
|
|
3633
|
+
* Scroll Padding X
|
|
3634
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3635
|
+
*/
|
|
3636
|
+
"scroll-px": [{
|
|
3637
|
+
"scroll-px": getSpacingWithArbitrary()
|
|
3638
|
+
}],
|
|
3639
|
+
/**
|
|
3640
|
+
* Scroll Padding Y
|
|
3641
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3642
|
+
*/
|
|
3643
|
+
"scroll-py": [{
|
|
3644
|
+
"scroll-py": getSpacingWithArbitrary()
|
|
3645
|
+
}],
|
|
3646
|
+
/**
|
|
3647
|
+
* Scroll Padding Start
|
|
3648
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3649
|
+
*/
|
|
3650
|
+
"scroll-ps": [{
|
|
3651
|
+
"scroll-ps": getSpacingWithArbitrary()
|
|
3652
|
+
}],
|
|
3653
|
+
/**
|
|
3654
|
+
* Scroll Padding End
|
|
3655
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3656
|
+
*/
|
|
3657
|
+
"scroll-pe": [{
|
|
3658
|
+
"scroll-pe": getSpacingWithArbitrary()
|
|
3659
|
+
}],
|
|
3660
|
+
/**
|
|
3661
|
+
* Scroll Padding Top
|
|
3662
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3663
|
+
*/
|
|
3664
|
+
"scroll-pt": [{
|
|
3665
|
+
"scroll-pt": getSpacingWithArbitrary()
|
|
3666
|
+
}],
|
|
3667
|
+
/**
|
|
3668
|
+
* Scroll Padding Right
|
|
3669
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3670
|
+
*/
|
|
3671
|
+
"scroll-pr": [{
|
|
3672
|
+
"scroll-pr": getSpacingWithArbitrary()
|
|
3673
|
+
}],
|
|
3674
|
+
/**
|
|
3675
|
+
* Scroll Padding Bottom
|
|
3676
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3677
|
+
*/
|
|
3678
|
+
"scroll-pb": [{
|
|
3679
|
+
"scroll-pb": getSpacingWithArbitrary()
|
|
3680
|
+
}],
|
|
3681
|
+
/**
|
|
3682
|
+
* Scroll Padding Left
|
|
3683
|
+
* @see https://tailwindcss.com/docs/scroll-padding
|
|
3684
|
+
*/
|
|
3685
|
+
"scroll-pl": [{
|
|
3686
|
+
"scroll-pl": getSpacingWithArbitrary()
|
|
3687
|
+
}],
|
|
3688
|
+
/**
|
|
3689
|
+
* Scroll Snap Align
|
|
3690
|
+
* @see https://tailwindcss.com/docs/scroll-snap-align
|
|
3691
|
+
*/
|
|
3692
|
+
"snap-align": [{
|
|
3693
|
+
snap: ["start", "end", "center", "align-none"]
|
|
3694
|
+
}],
|
|
3695
|
+
/**
|
|
3696
|
+
* Scroll Snap Stop
|
|
3697
|
+
* @see https://tailwindcss.com/docs/scroll-snap-stop
|
|
3698
|
+
*/
|
|
3699
|
+
"snap-stop": [{
|
|
3700
|
+
snap: ["normal", "always"]
|
|
3701
|
+
}],
|
|
3702
|
+
/**
|
|
3703
|
+
* Scroll Snap Type
|
|
3704
|
+
* @see https://tailwindcss.com/docs/scroll-snap-type
|
|
3705
|
+
*/
|
|
3706
|
+
"snap-type": [{
|
|
3707
|
+
snap: ["none", "x", "y", "both"]
|
|
3708
|
+
}],
|
|
3709
|
+
/**
|
|
3710
|
+
* Scroll Snap Type Strictness
|
|
3711
|
+
* @see https://tailwindcss.com/docs/scroll-snap-type
|
|
3712
|
+
*/
|
|
3713
|
+
"snap-strictness": [{
|
|
3714
|
+
snap: ["mandatory", "proximity"]
|
|
3715
|
+
}],
|
|
3716
|
+
/**
|
|
3717
|
+
* Touch Action
|
|
3718
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
3719
|
+
*/
|
|
3720
|
+
touch: [{
|
|
3721
|
+
touch: ["auto", "none", "manipulation"]
|
|
3722
|
+
}],
|
|
3723
|
+
/**
|
|
3724
|
+
* Touch Action X
|
|
3725
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
3726
|
+
*/
|
|
3727
|
+
"touch-x": [{
|
|
3728
|
+
"touch-pan": ["x", "left", "right"]
|
|
3729
|
+
}],
|
|
3730
|
+
/**
|
|
3731
|
+
* Touch Action Y
|
|
3732
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
3733
|
+
*/
|
|
3734
|
+
"touch-y": [{
|
|
3735
|
+
"touch-pan": ["y", "up", "down"]
|
|
3736
|
+
}],
|
|
3737
|
+
/**
|
|
3738
|
+
* Touch Action Pinch Zoom
|
|
3739
|
+
* @see https://tailwindcss.com/docs/touch-action
|
|
3740
|
+
*/
|
|
3741
|
+
"touch-pz": ["touch-pinch-zoom"],
|
|
3742
|
+
/**
|
|
3743
|
+
* User Select
|
|
3744
|
+
* @see https://tailwindcss.com/docs/user-select
|
|
3745
|
+
*/
|
|
3746
|
+
select: [{
|
|
3747
|
+
select: ["none", "text", "all", "auto"]
|
|
3748
|
+
}],
|
|
3749
|
+
/**
|
|
3750
|
+
* Will Change
|
|
3751
|
+
* @see https://tailwindcss.com/docs/will-change
|
|
3752
|
+
*/
|
|
3753
|
+
"will-change": [{
|
|
3754
|
+
"will-change": ["auto", "scroll", "contents", "transform", isArbitraryValue]
|
|
3755
|
+
}],
|
|
3756
|
+
// SVG
|
|
3757
|
+
/**
|
|
3758
|
+
* Fill
|
|
3759
|
+
* @see https://tailwindcss.com/docs/fill
|
|
3760
|
+
*/
|
|
3761
|
+
fill: [{
|
|
3762
|
+
fill: [colors, "none"]
|
|
3763
|
+
}],
|
|
3764
|
+
/**
|
|
3765
|
+
* Stroke Width
|
|
3766
|
+
* @see https://tailwindcss.com/docs/stroke-width
|
|
3767
|
+
*/
|
|
3768
|
+
"stroke-w": [{
|
|
3769
|
+
stroke: [isLength, isArbitraryLength, isArbitraryNumber]
|
|
3770
|
+
}],
|
|
3771
|
+
/**
|
|
3772
|
+
* Stroke
|
|
3773
|
+
* @see https://tailwindcss.com/docs/stroke
|
|
3774
|
+
*/
|
|
3775
|
+
stroke: [{
|
|
3776
|
+
stroke: [colors, "none"]
|
|
3777
|
+
}],
|
|
3778
|
+
// Accessibility
|
|
3779
|
+
/**
|
|
3780
|
+
* Screen Readers
|
|
3781
|
+
* @see https://tailwindcss.com/docs/screen-readers
|
|
3782
|
+
*/
|
|
3783
|
+
sr: ["sr-only", "not-sr-only"],
|
|
3784
|
+
/**
|
|
3785
|
+
* Forced Color Adjust
|
|
3786
|
+
* @see https://tailwindcss.com/docs/forced-color-adjust
|
|
3787
|
+
*/
|
|
3788
|
+
"forced-color-adjust": [{
|
|
3789
|
+
"forced-color-adjust": ["auto", "none"]
|
|
3790
|
+
}]
|
|
3791
|
+
},
|
|
3792
|
+
conflictingClassGroups: {
|
|
3793
|
+
overflow: ["overflow-x", "overflow-y"],
|
|
3794
|
+
overscroll: ["overscroll-x", "overscroll-y"],
|
|
3795
|
+
inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"],
|
|
3796
|
+
"inset-x": ["right", "left"],
|
|
3797
|
+
"inset-y": ["top", "bottom"],
|
|
3798
|
+
flex: ["basis", "grow", "shrink"],
|
|
3799
|
+
gap: ["gap-x", "gap-y"],
|
|
3800
|
+
p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"],
|
|
3801
|
+
px: ["pr", "pl"],
|
|
3802
|
+
py: ["pt", "pb"],
|
|
3803
|
+
m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"],
|
|
3804
|
+
mx: ["mr", "ml"],
|
|
3805
|
+
my: ["mt", "mb"],
|
|
3806
|
+
size: ["w", "h"],
|
|
3807
|
+
"font-size": ["leading"],
|
|
3808
|
+
"fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"],
|
|
3809
|
+
"fvn-ordinal": ["fvn-normal"],
|
|
3810
|
+
"fvn-slashed-zero": ["fvn-normal"],
|
|
3811
|
+
"fvn-figure": ["fvn-normal"],
|
|
3812
|
+
"fvn-spacing": ["fvn-normal"],
|
|
3813
|
+
"fvn-fraction": ["fvn-normal"],
|
|
3814
|
+
"line-clamp": ["display", "overflow"],
|
|
3815
|
+
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"],
|
|
3816
|
+
"rounded-s": ["rounded-ss", "rounded-es"],
|
|
3817
|
+
"rounded-e": ["rounded-se", "rounded-ee"],
|
|
3818
|
+
"rounded-t": ["rounded-tl", "rounded-tr"],
|
|
3819
|
+
"rounded-r": ["rounded-tr", "rounded-br"],
|
|
3820
|
+
"rounded-b": ["rounded-br", "rounded-bl"],
|
|
3821
|
+
"rounded-l": ["rounded-tl", "rounded-bl"],
|
|
3822
|
+
"border-spacing": ["border-spacing-x", "border-spacing-y"],
|
|
3823
|
+
"border-w": ["border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
|
|
3824
|
+
"border-w-x": ["border-w-r", "border-w-l"],
|
|
3825
|
+
"border-w-y": ["border-w-t", "border-w-b"],
|
|
3826
|
+
"border-color": ["border-color-s", "border-color-e", "border-color-t", "border-color-r", "border-color-b", "border-color-l"],
|
|
3827
|
+
"border-color-x": ["border-color-r", "border-color-l"],
|
|
3828
|
+
"border-color-y": ["border-color-t", "border-color-b"],
|
|
3829
|
+
"scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
|
|
3830
|
+
"scroll-mx": ["scroll-mr", "scroll-ml"],
|
|
3831
|
+
"scroll-my": ["scroll-mt", "scroll-mb"],
|
|
3832
|
+
"scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"],
|
|
3833
|
+
"scroll-px": ["scroll-pr", "scroll-pl"],
|
|
3834
|
+
"scroll-py": ["scroll-pt", "scroll-pb"],
|
|
3835
|
+
touch: ["touch-x", "touch-y", "touch-pz"],
|
|
3836
|
+
"touch-x": ["touch"],
|
|
3837
|
+
"touch-y": ["touch"],
|
|
3838
|
+
"touch-pz": ["touch"]
|
|
3839
|
+
},
|
|
3840
|
+
conflictingClassGroupModifiers: {
|
|
3841
|
+
"font-size": ["leading"]
|
|
3842
|
+
}
|
|
3843
|
+
};
|
|
3844
|
+
};
|
|
3845
|
+
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
3846
|
+
|
|
3847
|
+
// src/libraries/react/lib/utils.ts
|
|
3848
|
+
function cn(...inputs) {
|
|
3849
|
+
return twMerge(clsx(inputs));
|
|
3850
|
+
}
|
|
3851
|
+
|
|
3852
|
+
// src/libraries/react/components/ui/button.tsx
|
|
3853
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
3854
|
+
|
|
3855
|
+
// ../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
3856
|
+
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
3857
|
+
var cx = clsx;
|
|
3858
|
+
var cva = (base, config) => (props) => {
|
|
3859
|
+
var _config_compoundVariants;
|
|
3860
|
+
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);
|
|
3861
|
+
const { variants, defaultVariants } = config;
|
|
3862
|
+
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
3863
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
3864
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
3865
|
+
if (variantProp === null) return null;
|
|
3866
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
3867
|
+
return variants[variant][variantKey];
|
|
3868
|
+
});
|
|
3869
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
3870
|
+
let [key, value] = param;
|
|
3871
|
+
if (value === void 0) {
|
|
3872
|
+
return acc;
|
|
3873
|
+
}
|
|
3874
|
+
acc[key] = value;
|
|
3875
|
+
return acc;
|
|
3876
|
+
}, {});
|
|
3877
|
+
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) => {
|
|
3878
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
3879
|
+
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
3880
|
+
let [key, value] = param2;
|
|
3881
|
+
return Array.isArray(value) ? value.includes({
|
|
3882
|
+
...defaultVariants,
|
|
3883
|
+
...propsWithoutUndefined
|
|
3884
|
+
}[key]) : {
|
|
3885
|
+
...defaultVariants,
|
|
3886
|
+
...propsWithoutUndefined
|
|
3887
|
+
}[key] === value;
|
|
3888
|
+
}) ? [
|
|
3889
|
+
...acc,
|
|
3890
|
+
cvClass,
|
|
3891
|
+
cvClassName
|
|
3892
|
+
] : acc;
|
|
3893
|
+
}, []);
|
|
3894
|
+
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
3895
|
+
};
|
|
3896
|
+
|
|
3897
|
+
// src/libraries/react/components/ui/button.tsx
|
|
3898
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
3899
|
+
var buttonVariants = cva(
|
|
3900
|
+
"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",
|
|
3901
|
+
{
|
|
3902
|
+
variants: {
|
|
3903
|
+
variant: {
|
|
3904
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
3905
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/90",
|
|
3906
|
+
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",
|
|
3907
|
+
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",
|
|
3908
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
3909
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
3910
|
+
},
|
|
3911
|
+
size: {
|
|
3912
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
3913
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
3914
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
3915
|
+
icon: "size-9"
|
|
3916
|
+
}
|
|
3917
|
+
},
|
|
3918
|
+
defaultVariants: {
|
|
3919
|
+
variant: "default",
|
|
3920
|
+
size: "default"
|
|
3921
|
+
}
|
|
3922
|
+
}
|
|
3923
|
+
);
|
|
3924
|
+
function Button({
|
|
3925
|
+
className,
|
|
3926
|
+
variant,
|
|
3927
|
+
size,
|
|
3928
|
+
asChild = false,
|
|
3929
|
+
...props
|
|
3930
|
+
}) {
|
|
3931
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
3932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3933
|
+
Comp,
|
|
3934
|
+
{
|
|
3935
|
+
"data-slot": "button",
|
|
3936
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
3937
|
+
...props
|
|
3938
|
+
}
|
|
3939
|
+
);
|
|
3940
|
+
}
|
|
3941
|
+
|
|
3942
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
3943
|
+
var import_react6 = require("react");
|
|
3944
|
+
|
|
3945
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
3946
|
+
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
3947
|
+
var toCamelCase = (string) => string.replace(
|
|
3948
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
3949
|
+
(match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
|
|
3950
|
+
);
|
|
3951
|
+
var toPascalCase = (string) => {
|
|
3952
|
+
const camelCase = toCamelCase(string);
|
|
3953
|
+
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
3954
|
+
};
|
|
3955
|
+
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
3956
|
+
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
3957
|
+
}).join(" ").trim();
|
|
3958
|
+
var hasA11yProp = (props) => {
|
|
3959
|
+
for (const prop in props) {
|
|
3960
|
+
if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
|
|
3961
|
+
return true;
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
};
|
|
3965
|
+
|
|
3966
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
|
3967
|
+
var import_react5 = require("react");
|
|
3968
|
+
|
|
3969
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
3970
|
+
var defaultAttributes = {
|
|
3971
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3972
|
+
width: 24,
|
|
3973
|
+
height: 24,
|
|
3974
|
+
viewBox: "0 0 24 24",
|
|
3975
|
+
fill: "none",
|
|
3976
|
+
stroke: "currentColor",
|
|
3977
|
+
strokeWidth: 2,
|
|
3978
|
+
strokeLinecap: "round",
|
|
3979
|
+
strokeLinejoin: "round"
|
|
3980
|
+
};
|
|
3981
|
+
|
|
3982
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
|
3983
|
+
var Icon = (0, import_react5.forwardRef)(
|
|
3984
|
+
({
|
|
3985
|
+
color = "currentColor",
|
|
3986
|
+
size = 24,
|
|
3987
|
+
strokeWidth = 2,
|
|
3988
|
+
absoluteStrokeWidth,
|
|
3989
|
+
className = "",
|
|
3990
|
+
children,
|
|
3991
|
+
iconNode,
|
|
3992
|
+
...rest
|
|
3993
|
+
}, ref) => (0, import_react5.createElement)(
|
|
3994
|
+
"svg",
|
|
3995
|
+
{
|
|
3996
|
+
ref,
|
|
3997
|
+
...defaultAttributes,
|
|
3998
|
+
width: size,
|
|
3999
|
+
height: size,
|
|
4000
|
+
stroke: color,
|
|
4001
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
4002
|
+
className: mergeClasses("lucide", className),
|
|
4003
|
+
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
4004
|
+
...rest
|
|
4005
|
+
},
|
|
4006
|
+
[
|
|
4007
|
+
...iconNode.map(([tag, attrs]) => (0, import_react5.createElement)(tag, attrs)),
|
|
4008
|
+
...Array.isArray(children) ? children : [children]
|
|
4009
|
+
]
|
|
4010
|
+
)
|
|
4011
|
+
);
|
|
4012
|
+
|
|
4013
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
4014
|
+
var createLucideIcon = (iconName, iconNode) => {
|
|
4015
|
+
const Component = (0, import_react6.forwardRef)(
|
|
4016
|
+
({ className, ...props }, ref) => (0, import_react6.createElement)(Icon, {
|
|
4017
|
+
ref,
|
|
4018
|
+
iconNode,
|
|
4019
|
+
className: mergeClasses(
|
|
4020
|
+
`lucide-${toKebabCase(toPascalCase(iconName))}`,
|
|
4021
|
+
`lucide-${iconName}`,
|
|
4022
|
+
className
|
|
4023
|
+
),
|
|
4024
|
+
...props
|
|
4025
|
+
})
|
|
4026
|
+
);
|
|
4027
|
+
Component.displayName = toPascalCase(iconName);
|
|
4028
|
+
return Component;
|
|
4029
|
+
};
|
|
4030
|
+
|
|
4031
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/check.js
|
|
4032
|
+
var __iconNode = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
4033
|
+
var Check = createLucideIcon("check", __iconNode);
|
|
4034
|
+
|
|
4035
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/loader-circle.js
|
|
4036
|
+
var __iconNode2 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
4037
|
+
var LoaderCircle = createLucideIcon("loader-circle", __iconNode2);
|
|
4038
|
+
|
|
4039
|
+
// ../node_modules/.pnpm/lucide-react@0.523.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/x.js
|
|
4040
|
+
var __iconNode3 = [
|
|
4041
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
4042
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
4043
|
+
];
|
|
4044
|
+
var X = createLucideIcon("x", __iconNode3);
|
|
4045
|
+
|
|
4046
|
+
// src/libraries/react/components/ui/dialog.tsx
|
|
4047
|
+
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
4048
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
4049
|
+
function Dialog({
|
|
4050
|
+
...props
|
|
4051
|
+
}) {
|
|
4052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
4053
|
+
}
|
|
4054
|
+
function DialogPortal({
|
|
4055
|
+
...props
|
|
4056
|
+
}) {
|
|
4057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
4058
|
+
}
|
|
4059
|
+
function DialogOverlay({
|
|
4060
|
+
className,
|
|
4061
|
+
...props
|
|
4062
|
+
}) {
|
|
4063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4064
|
+
DialogPrimitive.Overlay,
|
|
4065
|
+
{
|
|
4066
|
+
"data-slot": "dialog-overlay",
|
|
4067
|
+
className: cn(
|
|
4068
|
+
"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",
|
|
4069
|
+
className
|
|
4070
|
+
),
|
|
4071
|
+
...props
|
|
4072
|
+
}
|
|
4073
|
+
);
|
|
4074
|
+
}
|
|
4075
|
+
function DialogContent({
|
|
4076
|
+
className,
|
|
4077
|
+
children,
|
|
4078
|
+
showCloseButton = true,
|
|
4079
|
+
...props
|
|
4080
|
+
}) {
|
|
4081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
4082
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DialogOverlay, {}),
|
|
4083
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
4084
|
+
DialogPrimitive.Content,
|
|
4085
|
+
{
|
|
4086
|
+
"data-slot": "dialog-content",
|
|
4087
|
+
className: cn(
|
|
4088
|
+
"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",
|
|
4089
|
+
className
|
|
4090
|
+
),
|
|
4091
|
+
...props,
|
|
4092
|
+
children: [
|
|
4093
|
+
children,
|
|
4094
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
4095
|
+
DialogPrimitive.Close,
|
|
4096
|
+
{
|
|
4097
|
+
"data-slot": "dialog-close",
|
|
4098
|
+
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",
|
|
4099
|
+
children: [
|
|
4100
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(X, {}),
|
|
4101
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "sr-only", children: "Close" })
|
|
4102
|
+
]
|
|
4103
|
+
}
|
|
4104
|
+
)
|
|
4105
|
+
]
|
|
4106
|
+
}
|
|
4107
|
+
)
|
|
4108
|
+
] });
|
|
4109
|
+
}
|
|
4110
|
+
function DialogFooter({ className, ...props }) {
|
|
4111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4112
|
+
"div",
|
|
4113
|
+
{
|
|
4114
|
+
"data-slot": "dialog-footer",
|
|
4115
|
+
className: cn(
|
|
4116
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
4117
|
+
className
|
|
4118
|
+
),
|
|
4119
|
+
...props
|
|
4120
|
+
}
|
|
4121
|
+
);
|
|
4122
|
+
}
|
|
4123
|
+
function DialogTitle({
|
|
4124
|
+
className,
|
|
4125
|
+
...props
|
|
4126
|
+
}) {
|
|
4127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4128
|
+
DialogPrimitive.Title,
|
|
4129
|
+
{
|
|
4130
|
+
"data-slot": "dialog-title",
|
|
4131
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
4132
|
+
...props
|
|
4133
|
+
}
|
|
4134
|
+
);
|
|
4135
|
+
}
|
|
4136
|
+
|
|
4137
|
+
// src/libraries/react/components/attach-dialog/lib/attach-content.tsx
|
|
4138
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
4139
|
+
var getAttachContent = (preview) => {
|
|
4140
|
+
const {
|
|
4141
|
+
scenario,
|
|
4142
|
+
product_name,
|
|
4143
|
+
recurring,
|
|
4144
|
+
current_product_name,
|
|
4145
|
+
next_cycle_at
|
|
4146
|
+
} = preview;
|
|
4147
|
+
const nextCycleAtStr = next_cycle_at ? new Date(next_cycle_at).toLocaleDateString() : void 0;
|
|
4148
|
+
switch (scenario) {
|
|
4149
|
+
case "scheduled":
|
|
4150
|
+
return {
|
|
4151
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
|
|
4152
|
+
product_name,
|
|
4153
|
+
" product already scheduled"
|
|
4154
|
+
] }),
|
|
4155
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
|
|
4156
|
+
"You are currently on product ",
|
|
4157
|
+
current_product_name,
|
|
4158
|
+
" and are scheduled to start ",
|
|
4159
|
+
product_name,
|
|
4160
|
+
" on ",
|
|
4161
|
+
nextCycleAtStr,
|
|
4162
|
+
"."
|
|
4163
|
+
] })
|
|
4164
|
+
};
|
|
4165
|
+
case "active":
|
|
4166
|
+
return {
|
|
4167
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "Product already active" }),
|
|
4168
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "You are already subscribed to this product." })
|
|
4169
|
+
};
|
|
4170
|
+
case "new":
|
|
4171
|
+
if (recurring) {
|
|
4172
|
+
return {
|
|
4173
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
|
|
4174
|
+
"Subscribe to ",
|
|
4175
|
+
product_name
|
|
4176
|
+
] }),
|
|
4177
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
|
|
4178
|
+
"By clicking confirm, you will be subscribed to ",
|
|
4179
|
+
product_name,
|
|
4180
|
+
" and your card will be charged immediately."
|
|
4181
|
+
] })
|
|
4182
|
+
};
|
|
4183
|
+
} else {
|
|
4184
|
+
return {
|
|
4185
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
|
|
4186
|
+
"Purchase ",
|
|
4187
|
+
product_name
|
|
4188
|
+
] }),
|
|
4189
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
|
|
4190
|
+
"By clicking confirm, you will purchase ",
|
|
4191
|
+
product_name,
|
|
4192
|
+
" and your card will be charged immediately."
|
|
4193
|
+
] })
|
|
4194
|
+
};
|
|
4195
|
+
}
|
|
4196
|
+
case "renew":
|
|
4197
|
+
return {
|
|
4198
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "Renew" }),
|
|
4199
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
|
|
4200
|
+
"By clicking confirm, you will renew your subscription to",
|
|
4201
|
+
" ",
|
|
4202
|
+
product_name,
|
|
4203
|
+
"."
|
|
4204
|
+
] })
|
|
4205
|
+
};
|
|
4206
|
+
case "upgrade":
|
|
4207
|
+
return {
|
|
4208
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
|
|
4209
|
+
"Upgrade to ",
|
|
4210
|
+
product_name
|
|
4211
|
+
] }),
|
|
4212
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
|
|
4213
|
+
"By clicking confirm, you will upgrade to ",
|
|
4214
|
+
product_name,
|
|
4215
|
+
" and your payment method will be charged immediately."
|
|
4216
|
+
] })
|
|
4217
|
+
};
|
|
4218
|
+
case "downgrade":
|
|
4219
|
+
return {
|
|
4220
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
|
|
4221
|
+
"Downgrade to ",
|
|
4222
|
+
product_name
|
|
4223
|
+
] }),
|
|
4224
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
|
|
4225
|
+
"By clicking confirm, your current subscription to",
|
|
4226
|
+
" ",
|
|
4227
|
+
current_product_name,
|
|
4228
|
+
" will be cancelled and a new subscription to",
|
|
4229
|
+
" ",
|
|
4230
|
+
product_name,
|
|
4231
|
+
" will begin on ",
|
|
4232
|
+
nextCycleAtStr,
|
|
4233
|
+
"."
|
|
4234
|
+
] })
|
|
4235
|
+
};
|
|
4236
|
+
case "cancel":
|
|
4237
|
+
return {
|
|
4238
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "Cancel" }),
|
|
4239
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { children: [
|
|
4240
|
+
"By clicking confirm, your subscription to ",
|
|
4241
|
+
current_product_name,
|
|
4242
|
+
" ",
|
|
4243
|
+
"will end on ",
|
|
4244
|
+
nextCycleAtStr,
|
|
4245
|
+
"."
|
|
4246
|
+
] })
|
|
4247
|
+
};
|
|
4248
|
+
default:
|
|
4249
|
+
return {
|
|
4250
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "Change Subscription" }),
|
|
4251
|
+
message: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "You are about to change your subscription." })
|
|
4252
|
+
};
|
|
4253
|
+
}
|
|
4254
|
+
};
|
|
4255
|
+
|
|
4256
|
+
// src/libraries/react/components/attach-dialog/attach-dialog-synced.tsx
|
|
4257
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
4258
|
+
function AttachDialog(params) {
|
|
4259
|
+
const { attach } = useCustomer();
|
|
4260
|
+
const [loading, setLoading] = (0, import_react7.useState)(false);
|
|
4261
|
+
const [optionsInput, setOptionsInput] = (0, import_react7.useState)(
|
|
4262
|
+
params?.preview?.options || []
|
|
4263
|
+
);
|
|
4264
|
+
const getTotalPrice = () => {
|
|
4265
|
+
let sum = due_today?.price || 0;
|
|
4266
|
+
optionsInput.forEach((option) => {
|
|
4267
|
+
if (option.price && option.quantity) {
|
|
4268
|
+
sum += option.price * (option.quantity / option.billing_units);
|
|
4269
|
+
}
|
|
4270
|
+
});
|
|
4271
|
+
return sum;
|
|
4272
|
+
};
|
|
4273
|
+
(0, import_react7.useEffect)(() => {
|
|
4274
|
+
setOptionsInput(params?.preview?.options || []);
|
|
4275
|
+
}, [params?.preview?.options]);
|
|
4276
|
+
if (!params || !params.preview) {
|
|
4277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {});
|
|
4278
|
+
}
|
|
4279
|
+
const { open, setOpen, preview } = params;
|
|
4280
|
+
const { items, due_today } = preview;
|
|
4281
|
+
const { title, message } = getAttachContent(preview);
|
|
4282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
4283
|
+
DialogContent,
|
|
4284
|
+
{
|
|
4285
|
+
className: cn("p-0 pt-4 gap-0 text-foreground overflow-hidden text-sm"),
|
|
4286
|
+
children: [
|
|
4287
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogTitle, { className: cn("px-6 mb-1 "), children: title }),
|
|
4288
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: cn("px-6 mt-1 mb-4 text-muted-foreground"), children: message }),
|
|
4289
|
+
(items || optionsInput.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mb-6 px-6", children: [
|
|
4290
|
+
items?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(PriceItem, { children: [
|
|
4291
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "truncate flex-1", children: item.description }),
|
|
4292
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: item.price })
|
|
4293
|
+
] }, item.description)),
|
|
4294
|
+
optionsInput?.map((option, index) => {
|
|
4295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4296
|
+
OptionsInput,
|
|
4297
|
+
{
|
|
4298
|
+
option,
|
|
4299
|
+
optionsInput,
|
|
4300
|
+
setOptionsInput,
|
|
4301
|
+
index
|
|
4302
|
+
},
|
|
4303
|
+
option.feature_name
|
|
4304
|
+
);
|
|
4305
|
+
})
|
|
4306
|
+
] }),
|
|
4307
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.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: [
|
|
4308
|
+
due_today && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(TotalPrice, { children: [
|
|
4309
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "Due Today" }),
|
|
4310
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: new Intl.NumberFormat("en-US", {
|
|
4311
|
+
style: "currency",
|
|
4312
|
+
currency: due_today.currency
|
|
4313
|
+
}).format(getTotalPrice()) })
|
|
4314
|
+
] }),
|
|
4315
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4316
|
+
Button,
|
|
4317
|
+
{
|
|
4318
|
+
size: "sm",
|
|
4319
|
+
onClick: async () => {
|
|
4320
|
+
setLoading(true);
|
|
4321
|
+
await attach({
|
|
4322
|
+
productId: preview.product_id,
|
|
4323
|
+
options: optionsInput.map((option) => ({
|
|
4324
|
+
featureId: option.feature_id,
|
|
4325
|
+
quantity: option.quantity || 0
|
|
4326
|
+
}))
|
|
4327
|
+
});
|
|
4328
|
+
setOpen(false);
|
|
4329
|
+
setLoading(false);
|
|
4330
|
+
},
|
|
4331
|
+
disabled: loading,
|
|
4332
|
+
className: "min-w-16 flex items-center gap-2",
|
|
4333
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LoaderCircle, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "whitespace-nowrap flex gap-1", children: "Confirm" }) })
|
|
4334
|
+
}
|
|
4335
|
+
)
|
|
4336
|
+
] })
|
|
4337
|
+
]
|
|
4338
|
+
}
|
|
4339
|
+
) });
|
|
4340
|
+
}
|
|
4341
|
+
var PriceItem = ({
|
|
4342
|
+
children,
|
|
4343
|
+
className,
|
|
4344
|
+
...props
|
|
4345
|
+
}) => {
|
|
4346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4347
|
+
"div",
|
|
4348
|
+
{
|
|
4349
|
+
className: cn(
|
|
4350
|
+
"flex flex-col pb-4 sm:pb-0 gap-1 sm:flex-row justify-between sm:h-7 sm:gap-2 sm:items-center",
|
|
4351
|
+
className
|
|
4352
|
+
),
|
|
4353
|
+
...props,
|
|
4354
|
+
children
|
|
4355
|
+
}
|
|
4356
|
+
);
|
|
4357
|
+
};
|
|
4358
|
+
var OptionsInput = ({
|
|
4359
|
+
className,
|
|
4360
|
+
option,
|
|
4361
|
+
optionsInput,
|
|
4362
|
+
setOptionsInput,
|
|
4363
|
+
index,
|
|
4364
|
+
...props
|
|
4365
|
+
}) => {
|
|
4366
|
+
const { feature_name, billing_units, quantity, price } = option;
|
|
4367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(PriceItem, { children: [
|
|
4368
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: feature_name }),
|
|
4369
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4370
|
+
QuantityInput,
|
|
4371
|
+
{
|
|
4372
|
+
value: quantity ? quantity / billing_units : "",
|
|
4373
|
+
onChange: (e) => {
|
|
4374
|
+
const newOptions = [...optionsInput];
|
|
4375
|
+
newOptions[index].quantity = parseInt(e.target.value) * billing_units;
|
|
4376
|
+
setOptionsInput(newOptions);
|
|
4377
|
+
},
|
|
4378
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "", children: [
|
|
4379
|
+
"\xD7 $",
|
|
4380
|
+
price,
|
|
4381
|
+
" per ",
|
|
4382
|
+
billing_units === 1 ? " " : billing_units,
|
|
4383
|
+
" ",
|
|
4384
|
+
feature_name
|
|
4385
|
+
] })
|
|
4386
|
+
},
|
|
4387
|
+
feature_name
|
|
4388
|
+
)
|
|
4389
|
+
] }, feature_name);
|
|
4390
|
+
};
|
|
4391
|
+
var QuantityInput = ({
|
|
4392
|
+
children,
|
|
4393
|
+
onChange,
|
|
4394
|
+
value,
|
|
4395
|
+
className,
|
|
4396
|
+
...props
|
|
4397
|
+
}) => {
|
|
4398
|
+
const currentValue = Number(value) || 0;
|
|
4399
|
+
const handleValueChange = (newValue) => {
|
|
4400
|
+
const syntheticEvent = {
|
|
4401
|
+
target: { value: String(newValue) }
|
|
4402
|
+
};
|
|
4403
|
+
onChange(syntheticEvent);
|
|
4404
|
+
};
|
|
4405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
4406
|
+
"div",
|
|
4407
|
+
{
|
|
4408
|
+
className: cn(className, "flex flex-row items-center gap-4"),
|
|
4409
|
+
...props,
|
|
4410
|
+
children: [
|
|
4411
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-1", children: [
|
|
4412
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4413
|
+
Button,
|
|
4414
|
+
{
|
|
4415
|
+
variant: "outline",
|
|
4416
|
+
size: "icon",
|
|
4417
|
+
onClick: () => currentValue > 0 && handleValueChange(currentValue - 1),
|
|
4418
|
+
disabled: currentValue <= 0,
|
|
4419
|
+
className: "h-6 w-6 pb-0.5",
|
|
4420
|
+
children: "-"
|
|
4421
|
+
}
|
|
4422
|
+
),
|
|
4423
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "w-8 text-center text-foreground", children: currentValue }),
|
|
4424
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4425
|
+
Button,
|
|
4426
|
+
{
|
|
4427
|
+
variant: "outline",
|
|
4428
|
+
size: "icon",
|
|
4429
|
+
onClick: () => handleValueChange(currentValue + 1),
|
|
4430
|
+
className: "h-6 w-6 pb-0.5",
|
|
4431
|
+
children: "+"
|
|
4432
|
+
}
|
|
4433
|
+
)
|
|
4434
|
+
] }),
|
|
4435
|
+
children
|
|
4436
|
+
]
|
|
4437
|
+
}
|
|
4438
|
+
);
|
|
4439
|
+
};
|
|
4440
|
+
var TotalPrice = ({ children }) => {
|
|
4441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "w-full font-semibold flex justify-between items-center", children });
|
|
4442
|
+
};
|
|
4443
|
+
|
|
4444
|
+
// src/libraries/react/components/check-dialog/check-dialog-synced.tsx
|
|
4445
|
+
var import_react8 = require("react");
|
|
4446
|
+
|
|
4447
|
+
// src/libraries/react/components/check-dialog/lib/check-content.tsx
|
|
4448
|
+
var getCheckContent = (preview) => {
|
|
4449
|
+
const { scenario, products, feature_name } = preview;
|
|
4450
|
+
if (products.length == 0) {
|
|
4451
|
+
switch (scenario) {
|
|
4452
|
+
case "usage_limit":
|
|
4453
|
+
return {
|
|
4454
|
+
title: `Feature Unavailable`,
|
|
4455
|
+
message: `You have reached the usage limit for ${feature_name}. Please contact us to increase your limit.`
|
|
4456
|
+
};
|
|
4457
|
+
default:
|
|
4458
|
+
return {
|
|
4459
|
+
title: "Feature Unavailable",
|
|
4460
|
+
message: "This feature is not available for your account. Please contact us to enable it."
|
|
4461
|
+
};
|
|
4462
|
+
}
|
|
4463
|
+
}
|
|
4464
|
+
const nextProduct = products[0];
|
|
4465
|
+
const isAddOn = nextProduct && nextProduct.is_add_on;
|
|
4466
|
+
const title = nextProduct.free_trial ? `Start trial for ${nextProduct.name}` : nextProduct.is_add_on ? `Purchase ${nextProduct.name}` : `Upgrade to ${nextProduct.name}`;
|
|
4467
|
+
let message = "";
|
|
4468
|
+
if (isAddOn) {
|
|
4469
|
+
message = `Please purchase the ${nextProduct.name} add-on to continue using ${feature_name}.`;
|
|
4470
|
+
} else {
|
|
4471
|
+
message = `Please upgrade to the ${nextProduct.name} plan to continue using ${feature_name}.`;
|
|
4472
|
+
}
|
|
4473
|
+
switch (scenario) {
|
|
4474
|
+
case "usage_limit":
|
|
4475
|
+
return {
|
|
4476
|
+
title,
|
|
4477
|
+
message: `You have reached the usage limit for ${feature_name}. ${message}`
|
|
4478
|
+
};
|
|
4479
|
+
case "feature_flag":
|
|
4480
|
+
return {
|
|
4481
|
+
title,
|
|
4482
|
+
message: `This feature is not available for your account. ${message}`
|
|
4483
|
+
};
|
|
4484
|
+
default:
|
|
4485
|
+
return {
|
|
4486
|
+
title: "Feature Unavailable",
|
|
4487
|
+
message: "This feature is not available for your account."
|
|
4488
|
+
};
|
|
4489
|
+
}
|
|
4490
|
+
};
|
|
4491
|
+
|
|
4492
|
+
// src/libraries/react/components/check-dialog/check-dialog-synced.tsx
|
|
4493
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
4494
|
+
function CheckDialog(params) {
|
|
4495
|
+
const [loading] = (0, import_react8.useState)(false);
|
|
4496
|
+
if (!params || !params.preview) {
|
|
4497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, {});
|
|
4498
|
+
}
|
|
4499
|
+
const { open, setOpen } = params;
|
|
4500
|
+
const { products } = params.preview;
|
|
4501
|
+
const { title, message } = getCheckContent(params.preview);
|
|
4502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DialogContent, { className: "p-0 pt-4 gap-0 text-foreground overflow-hidden text-sm", children: [
|
|
4503
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DialogTitle, { className: cn("font-bold text-xl px-6"), children: title }),
|
|
4504
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "px-6 my-2", children: message }),
|
|
4505
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DialogFooter, { className: "flex flex-col sm:flex-row justify-between gap-x-4 py-2 mt-4 pl-6 pr-3 bg-secondary border-t", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
4506
|
+
Button,
|
|
4507
|
+
{
|
|
4508
|
+
size: "sm",
|
|
4509
|
+
className: "font-medium shadow transition min-w-20",
|
|
4510
|
+
onClick: async () => {
|
|
4511
|
+
setOpen(false);
|
|
4512
|
+
},
|
|
4513
|
+
children: [
|
|
4514
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(LoaderCircle, { className: "w-4 h-4 mr-2 animate-spin" }),
|
|
4515
|
+
"Confirm"
|
|
4516
|
+
]
|
|
4517
|
+
}
|
|
4518
|
+
) })
|
|
4519
|
+
] }) });
|
|
4520
|
+
}
|
|
4521
|
+
|
|
4522
|
+
// src/libraries/react/components/pricing-table/pricing-table-synced.tsx
|
|
4523
|
+
var import_react9 = __toESM(require("react"));
|
|
4524
|
+
var import_react10 = require("react");
|
|
4525
|
+
|
|
4526
|
+
// src/libraries/react/components/ui/switch.tsx
|
|
4527
|
+
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
|
|
4528
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
4529
|
+
function Switch({
|
|
4530
|
+
className,
|
|
4531
|
+
...props
|
|
4532
|
+
}) {
|
|
4533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4534
|
+
SwitchPrimitive.Root,
|
|
4535
|
+
{
|
|
4536
|
+
"data-slot": "switch",
|
|
4537
|
+
className: cn(
|
|
4538
|
+
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
4539
|
+
className
|
|
4540
|
+
),
|
|
4541
|
+
...props,
|
|
4542
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
4543
|
+
SwitchPrimitive.Thumb,
|
|
4544
|
+
{
|
|
4545
|
+
"data-slot": "switch-thumb",
|
|
4546
|
+
className: cn(
|
|
4547
|
+
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
|
|
4548
|
+
)
|
|
4549
|
+
}
|
|
4550
|
+
)
|
|
4551
|
+
}
|
|
4552
|
+
);
|
|
4553
|
+
}
|
|
4554
|
+
|
|
4555
|
+
// src/libraries/react/components/pricing-table/lib/pricing-table-content.tsx
|
|
4556
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
4557
|
+
var getPricingTableContent = (product) => {
|
|
4558
|
+
const { scenario, free_trial } = product;
|
|
4559
|
+
if (free_trial && free_trial.trial_available) {
|
|
4560
|
+
return {
|
|
4561
|
+
buttonText: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "Start Free Trial" })
|
|
4562
|
+
};
|
|
4563
|
+
}
|
|
4564
|
+
switch (scenario) {
|
|
4565
|
+
case "scheduled":
|
|
4566
|
+
return {
|
|
4567
|
+
buttonText: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "Plan Scheduled" })
|
|
4568
|
+
};
|
|
4569
|
+
case "active":
|
|
4570
|
+
return {
|
|
4571
|
+
buttonText: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "Current Plan" })
|
|
4572
|
+
};
|
|
4573
|
+
case "new":
|
|
4574
|
+
if (product.properties?.is_one_off) {
|
|
4575
|
+
return {
|
|
4576
|
+
buttonText: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "Purchase" })
|
|
4577
|
+
};
|
|
4578
|
+
} else {
|
|
4579
|
+
return {
|
|
4580
|
+
buttonText: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "Get started" })
|
|
4581
|
+
};
|
|
4582
|
+
}
|
|
4583
|
+
case "renew":
|
|
4584
|
+
return {
|
|
4585
|
+
buttonText: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "Renew" })
|
|
4586
|
+
};
|
|
4587
|
+
case "upgrade":
|
|
4588
|
+
return {
|
|
4589
|
+
buttonText: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "Upgrade" })
|
|
4590
|
+
};
|
|
4591
|
+
case "downgrade":
|
|
4592
|
+
return {
|
|
4593
|
+
buttonText: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "Downgrade" })
|
|
4594
|
+
};
|
|
4595
|
+
case "cancel":
|
|
4596
|
+
return {
|
|
4597
|
+
buttonText: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "Cancel Plan" })
|
|
4598
|
+
};
|
|
4599
|
+
default:
|
|
4600
|
+
return {
|
|
4601
|
+
buttonText: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: "Get Started" })
|
|
4602
|
+
};
|
|
4603
|
+
}
|
|
4604
|
+
};
|
|
4605
|
+
|
|
4606
|
+
// src/libraries/react/components/pricing-table/pricing-table-synced.tsx
|
|
4607
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
4608
|
+
function PricingTable({
|
|
4609
|
+
productDetails
|
|
4610
|
+
}) {
|
|
4611
|
+
const { attach } = useCustomer();
|
|
4612
|
+
const [isAnnual, setIsAnnual] = (0, import_react10.useState)(false);
|
|
4613
|
+
const { products, isLoading, error } = usePricingTable({ productDetails });
|
|
4614
|
+
if (isLoading) {
|
|
4615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "w-full h-full flex justify-center items-center min-h-[300px]", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LoaderCircle, { className: "w-6 h-6 text-zinc-400 animate-spin" }) });
|
|
4616
|
+
}
|
|
4617
|
+
if (error) {
|
|
4618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: " Something went wrong..." });
|
|
4619
|
+
}
|
|
4620
|
+
const intervals = Array.from(
|
|
4621
|
+
new Set(
|
|
4622
|
+
products?.map((p) => p.properties?.interval_group).filter((i) => !!i)
|
|
4623
|
+
)
|
|
4624
|
+
);
|
|
4625
|
+
const multiInterval = intervals.length > 1;
|
|
4626
|
+
const intervalFilter = (product) => {
|
|
4627
|
+
if (!product.properties?.interval_group) {
|
|
4628
|
+
return true;
|
|
4629
|
+
}
|
|
4630
|
+
if (multiInterval) {
|
|
4631
|
+
if (isAnnual) {
|
|
4632
|
+
return product.properties?.interval_group === "year";
|
|
4633
|
+
} else {
|
|
4634
|
+
return product.properties?.interval_group === "month";
|
|
4635
|
+
}
|
|
4636
|
+
}
|
|
4637
|
+
return true;
|
|
4638
|
+
};
|
|
4639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: products && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4640
|
+
PricingTableContainer,
|
|
4641
|
+
{
|
|
4642
|
+
products,
|
|
4643
|
+
isAnnualToggle: isAnnual,
|
|
4644
|
+
setIsAnnualToggle: setIsAnnual,
|
|
4645
|
+
multiInterval,
|
|
4646
|
+
children: products.filter(intervalFilter).map((product, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4647
|
+
PricingCard,
|
|
4648
|
+
{
|
|
4649
|
+
productId: product.id,
|
|
4650
|
+
buttonProps: {
|
|
4651
|
+
disabled: product.scenario === "active" || product.scenario === "scheduled",
|
|
4652
|
+
onClick: async () => {
|
|
4653
|
+
if (product.id) {
|
|
4654
|
+
await attach({
|
|
4655
|
+
productId: product.id,
|
|
4656
|
+
dialog: AttachDialog
|
|
4657
|
+
});
|
|
4658
|
+
} else if (product.display?.button_url) {
|
|
4659
|
+
window.open(product.display?.button_url, "_blank");
|
|
4660
|
+
}
|
|
4661
|
+
}
|
|
4662
|
+
}
|
|
4663
|
+
},
|
|
4664
|
+
index
|
|
4665
|
+
))
|
|
4666
|
+
}
|
|
4667
|
+
) });
|
|
4668
|
+
}
|
|
4669
|
+
var PricingTableContext = (0, import_react10.createContext)({
|
|
4670
|
+
isAnnualToggle: false,
|
|
4671
|
+
setIsAnnualToggle: () => {
|
|
4672
|
+
},
|
|
4673
|
+
products: [],
|
|
4674
|
+
showFeatures: true
|
|
4675
|
+
});
|
|
4676
|
+
var usePricingTableContext = (componentName) => {
|
|
4677
|
+
const context = (0, import_react10.useContext)(PricingTableContext);
|
|
4678
|
+
if (context === void 0) {
|
|
4679
|
+
throw new Error(`${componentName} must be used within <PricingTable />`);
|
|
4680
|
+
}
|
|
4681
|
+
return context;
|
|
4682
|
+
};
|
|
4683
|
+
var PricingTableContainer = ({
|
|
4684
|
+
children,
|
|
4685
|
+
products,
|
|
4686
|
+
showFeatures = true,
|
|
4687
|
+
className,
|
|
4688
|
+
isAnnualToggle,
|
|
4689
|
+
setIsAnnualToggle,
|
|
4690
|
+
multiInterval
|
|
4691
|
+
}) => {
|
|
4692
|
+
if (!products) {
|
|
4693
|
+
throw new Error("products is required in <PricingTable />");
|
|
4694
|
+
}
|
|
4695
|
+
if (products.length === 0) {
|
|
4696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, {});
|
|
4697
|
+
}
|
|
4698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4699
|
+
PricingTableContext.Provider,
|
|
4700
|
+
{
|
|
4701
|
+
value: { isAnnualToggle, setIsAnnualToggle, products, showFeatures },
|
|
4702
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("flex items-center flex-col"), children: [
|
|
4703
|
+
multiInterval && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4704
|
+
"div",
|
|
4705
|
+
{
|
|
4706
|
+
className: cn(
|
|
4707
|
+
products.some((p) => p.display?.recommend_text) && "mb-8"
|
|
4708
|
+
),
|
|
4709
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4710
|
+
AnnualSwitch,
|
|
4711
|
+
{
|
|
4712
|
+
isAnnualToggle,
|
|
4713
|
+
setIsAnnualToggle
|
|
4714
|
+
}
|
|
4715
|
+
)
|
|
4716
|
+
}
|
|
4717
|
+
),
|
|
4718
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4719
|
+
"div",
|
|
4720
|
+
{
|
|
4721
|
+
className: cn(
|
|
4722
|
+
"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-[repeat(auto-fit,minmax(200px,1fr))] w-full gap-2",
|
|
4723
|
+
className
|
|
4724
|
+
),
|
|
4725
|
+
children
|
|
4726
|
+
}
|
|
4727
|
+
)
|
|
4728
|
+
] })
|
|
4729
|
+
}
|
|
4730
|
+
);
|
|
4731
|
+
};
|
|
4732
|
+
var PricingCard = ({
|
|
4733
|
+
productId,
|
|
4734
|
+
className,
|
|
4735
|
+
onButtonClick,
|
|
4736
|
+
buttonProps
|
|
4737
|
+
}) => {
|
|
4738
|
+
const { products, showFeatures } = usePricingTableContext("PricingCard");
|
|
4739
|
+
const product = products.find((p) => p.id === productId);
|
|
4740
|
+
if (!product) {
|
|
4741
|
+
throw new Error(`Product with id ${productId} not found`);
|
|
4742
|
+
}
|
|
4743
|
+
const { name, display: productDisplay, items } = product;
|
|
4744
|
+
const { buttonText } = getPricingTableContent(product);
|
|
4745
|
+
const isRecommended = productDisplay?.recommend_text ? true : false;
|
|
4746
|
+
const mainPriceDisplay = product.properties?.is_free ? {
|
|
4747
|
+
primary_text: "Free"
|
|
4748
|
+
} : product.items[0].display;
|
|
4749
|
+
const featureItems = product.properties?.is_free ? product.items : product.items.slice(1);
|
|
4750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4751
|
+
"div",
|
|
4752
|
+
{
|
|
4753
|
+
className: cn(
|
|
4754
|
+
"w-full h-full py-6 text-foreground border rounded-lg shadow-sm max-w-xl",
|
|
4755
|
+
isRecommended && "lg:-translate-y-6 lg:shadow-lg dark:shadow-zinc-800/80 lg:h-[calc(100%+48px)] bg-secondary/40",
|
|
4756
|
+
className
|
|
4757
|
+
),
|
|
4758
|
+
children: [
|
|
4759
|
+
productDisplay?.recommend_text && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RecommendedBadge, { recommended: productDisplay?.recommend_text }),
|
|
4760
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
4761
|
+
"div",
|
|
4762
|
+
{
|
|
4763
|
+
className: cn(
|
|
4764
|
+
"flex flex-col h-full flex-grow",
|
|
4765
|
+
isRecommended && "lg:translate-y-6"
|
|
4766
|
+
),
|
|
4767
|
+
children: [
|
|
4768
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "h-full", children: [
|
|
4769
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col", children: [
|
|
4770
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "pb-4", children: [
|
|
4771
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h2", { className: "text-2xl font-semibold px-6 truncate", children: name }),
|
|
4772
|
+
productDisplay?.description && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-sm text-muted-foreground px-6 h-8", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { className: "line-clamp-2", children: [
|
|
4773
|
+
"Everything from ",
|
|
4774
|
+
productDisplay?.description,
|
|
4775
|
+
", plus:"
|
|
4776
|
+
] }) })
|
|
4777
|
+
] }),
|
|
4778
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { className: "font-semibold h-16 flex px-6 items-center border-y mb-4 bg-secondary/40", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "line-clamp-2", children: [
|
|
4779
|
+
mainPriceDisplay?.primary_text,
|
|
4780
|
+
" ",
|
|
4781
|
+
mainPriceDisplay?.secondary_text && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "font-normal text-muted-foreground mt-1", children: mainPriceDisplay?.secondary_text })
|
|
4782
|
+
] }) }) })
|
|
4783
|
+
] }),
|
|
4784
|
+
showFeatures && featureItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex-grow px-6 mb-6", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4785
|
+
PricingFeatureList,
|
|
4786
|
+
{
|
|
4787
|
+
items: featureItems,
|
|
4788
|
+
showIcon: true,
|
|
4789
|
+
everythingFrom: product.display?.everything_from
|
|
4790
|
+
}
|
|
4791
|
+
) })
|
|
4792
|
+
] }),
|
|
4793
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: cn(" px-6 ", isRecommended && "lg:-translate-y-12"), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4794
|
+
PricingCardButton,
|
|
4795
|
+
{
|
|
4796
|
+
recommended: productDisplay?.recommend_text ? true : false,
|
|
4797
|
+
onClick: onButtonClick,
|
|
4798
|
+
...buttonProps,
|
|
4799
|
+
children: buttonText
|
|
4800
|
+
}
|
|
4801
|
+
) })
|
|
4802
|
+
]
|
|
4803
|
+
}
|
|
4804
|
+
)
|
|
4805
|
+
]
|
|
4806
|
+
}
|
|
4807
|
+
);
|
|
4808
|
+
};
|
|
4809
|
+
var PricingFeatureList = ({
|
|
4810
|
+
items,
|
|
4811
|
+
showIcon = true,
|
|
4812
|
+
everythingFrom,
|
|
4813
|
+
className
|
|
4814
|
+
}) => {
|
|
4815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("flex-grow", className), children: [
|
|
4816
|
+
everythingFrom && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { className: "text-sm mb-4", children: [
|
|
4817
|
+
"Everything from ",
|
|
4818
|
+
everythingFrom,
|
|
4819
|
+
", plus:"
|
|
4820
|
+
] }),
|
|
4821
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-3", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-start gap-2 text-sm", children: [
|
|
4822
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Check, { className: "h-4 w-4 text-primary flex-shrink-0 mt-0.5" }),
|
|
4823
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col", children: [
|
|
4824
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: item.display?.primary_text }),
|
|
4825
|
+
item.display?.secondary_text && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm text-muted-foreground", children: item.display?.secondary_text })
|
|
4826
|
+
] })
|
|
4827
|
+
] }, index)) })
|
|
4828
|
+
] });
|
|
4829
|
+
};
|
|
4830
|
+
var PricingCardButton = import_react9.default.forwardRef(({ recommended, children, buttonUrl, onClick, className, ...props }, ref) => {
|
|
4831
|
+
const [loading, setLoading] = (0, import_react10.useState)(false);
|
|
4832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4833
|
+
Button,
|
|
4834
|
+
{
|
|
4835
|
+
className: cn(
|
|
4836
|
+
"w-full py-3 px-4 group overflow-hidden relative transition-all duration-300 hover:brightness-90 border rounded-lg",
|
|
4837
|
+
className
|
|
4838
|
+
),
|
|
4839
|
+
variant: recommended ? "default" : "secondary",
|
|
4840
|
+
ref,
|
|
4841
|
+
disabled: loading,
|
|
4842
|
+
onClick: async (e) => {
|
|
4843
|
+
setLoading(true);
|
|
4844
|
+
try {
|
|
4845
|
+
if (onClick) {
|
|
4846
|
+
await onClick(e);
|
|
4847
|
+
return;
|
|
4848
|
+
}
|
|
4849
|
+
if (buttonUrl) {
|
|
4850
|
+
window.open(buttonUrl, "_blank");
|
|
4851
|
+
return;
|
|
4852
|
+
}
|
|
4853
|
+
} catch (error) {
|
|
4854
|
+
throw error;
|
|
4855
|
+
} finally {
|
|
4856
|
+
setLoading(false);
|
|
4857
|
+
}
|
|
4858
|
+
},
|
|
4859
|
+
...props,
|
|
4860
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LoaderCircle, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
4861
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-between w-full transition-transform duration-300 group-hover:translate-y-[-130%]", children: [
|
|
4862
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children }),
|
|
4863
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm", children: "\u2192" })
|
|
4864
|
+
] }),
|
|
4865
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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: [
|
|
4866
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children }),
|
|
4867
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm", children: "\u2192" })
|
|
4868
|
+
] })
|
|
4869
|
+
] })
|
|
4870
|
+
}
|
|
4871
|
+
);
|
|
4872
|
+
});
|
|
4873
|
+
PricingCardButton.displayName = "PricingCardButton";
|
|
4874
|
+
var AnnualSwitch = ({
|
|
4875
|
+
isAnnualToggle,
|
|
4876
|
+
setIsAnnualToggle
|
|
4877
|
+
}) => {
|
|
4878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center space-x-2 mb-4", children: [
|
|
4879
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm text-muted-foreground", children: "Monthly" }),
|
|
4880
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4881
|
+
Switch,
|
|
4882
|
+
{
|
|
4883
|
+
id: "annual-billing",
|
|
4884
|
+
checked: isAnnualToggle,
|
|
4885
|
+
onCheckedChange: setIsAnnualToggle
|
|
4886
|
+
}
|
|
4887
|
+
),
|
|
4888
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm text-muted-foreground", children: "Annual" })
|
|
4889
|
+
] });
|
|
4890
|
+
};
|
|
4891
|
+
var RecommendedBadge = ({ recommended }) => {
|
|
4892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "bg-secondary absolute border text-muted-foreground text-sm font-medium lg:rounded-full px-3 lg:py-0.5 lg:top-4 lg:right-4 top-[-1px] right-[-1px] rounded-bl-lg", children: recommended });
|
|
4893
|
+
};
|
|
1178
4894
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1179
4895
|
0 && (module.exports = {
|
|
4896
|
+
AttachDialog,
|
|
1180
4897
|
AutumnProvider,
|
|
4898
|
+
CheckDialog,
|
|
4899
|
+
PricingTable,
|
|
1181
4900
|
useAutumn,
|
|
1182
4901
|
useCustomer,
|
|
1183
4902
|
useEntity,
|
|
1184
4903
|
usePricingTable
|
|
1185
4904
|
});
|
|
4905
|
+
/*! Bundled license information:
|
|
4906
|
+
|
|
4907
|
+
lucide-react/dist/esm/shared/src/utils.js:
|
|
4908
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
|
4909
|
+
lucide-react/dist/esm/Icon.js:
|
|
4910
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
|
4911
|
+
lucide-react/dist/esm/icons/check.js:
|
|
4912
|
+
lucide-react/dist/esm/icons/loader-circle.js:
|
|
4913
|
+
lucide-react/dist/esm/icons/x.js:
|
|
4914
|
+
lucide-react/dist/esm/lucide-react.js:
|
|
4915
|
+
(**
|
|
4916
|
+
* @license lucide-react v0.523.0 - ISC
|
|
4917
|
+
*
|
|
4918
|
+
* This source code is licensed under the ISC license.
|
|
4919
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
4920
|
+
*)
|
|
4921
|
+
*/
|