@sentecacommerce-theme/lib 0.11.104 → 0.11.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/GoogleOneTap/index.js +6 -3
- package/dist/cjs/components/GoogleOneTap/index.js.map +1 -1
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/postcss/index.js +20 -0
- package/dist/cjs/postcss/index.js.map +1 -0
- package/dist/cjs/postcss/tailwind/buttons-plugin.js +91 -0
- package/dist/cjs/postcss/tailwind/buttons-plugin.js.map +1 -0
- package/dist/cjs/postcss/tailwind/default-plugin.js +62 -0
- package/dist/cjs/postcss/tailwind/default-plugin.js.map +1 -0
- package/dist/cjs/postcss/tailwind/fonts-plugin.js +73 -0
- package/dist/cjs/postcss/tailwind/fonts-plugin.js.map +1 -0
- package/dist/cjs/postcss/tailwind/forms-plugin.js +58 -0
- package/dist/cjs/postcss/tailwind/forms-plugin.js.map +1 -0
- package/dist/cjs/postcss/tailwind/index.js +28 -0
- package/dist/cjs/postcss/tailwind/index.js.map +1 -0
- package/dist/cjs/postcss/tailwind/utils.js +55 -0
- package/dist/cjs/postcss/tailwind/utils.js.map +1 -0
- package/dist/cjs/postcss/types.js +29 -0
- package/dist/cjs/postcss/types.js.map +1 -0
- package/dist/cjs/seo/api/index.js +12 -0
- package/dist/cjs/seo/api/index.js.map +1 -0
- package/dist/cjs/seo/api/ssr/fetchRedirectByFrom.js +40 -0
- package/dist/cjs/seo/api/ssr/fetchRedirectByFrom.js.map +1 -0
- package/dist/cjs/seo/api/ssr/fetchSitemaps.js +43 -0
- package/dist/cjs/seo/api/ssr/fetchSitemaps.js.map +1 -0
- package/dist/cjs/seo/api/ssr/index.js +20 -0
- package/dist/cjs/seo/api/ssr/index.js.map +1 -0
- package/dist/cjs/seo/index.js +8 -0
- package/dist/cjs/seo/index.js.map +1 -1
- package/dist/esm/components/GoogleOneTap/index.js +6 -3
- package/dist/esm/components/GoogleOneTap/index.js.map +1 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/postcss/index.js +3 -0
- package/dist/esm/postcss/index.js.map +1 -0
- package/dist/esm/postcss/tailwind/buttons-plugin.js +89 -0
- package/dist/esm/postcss/tailwind/buttons-plugin.js.map +1 -0
- package/dist/esm/postcss/tailwind/default-plugin.js +56 -0
- package/dist/esm/postcss/tailwind/default-plugin.js.map +1 -0
- package/dist/esm/postcss/tailwind/fonts-plugin.js +71 -0
- package/dist/esm/postcss/tailwind/fonts-plugin.js.map +1 -0
- package/dist/esm/postcss/tailwind/forms-plugin.js +57 -0
- package/dist/esm/postcss/tailwind/forms-plugin.js.map +1 -0
- package/dist/esm/postcss/tailwind/index.js +4 -0
- package/dist/esm/postcss/tailwind/index.js.map +1 -0
- package/dist/esm/postcss/tailwind/utils.js +29 -0
- package/dist/esm/postcss/tailwind/utils.js.map +1 -0
- package/dist/esm/postcss/types.js +23 -0
- package/dist/esm/postcss/types.js.map +1 -0
- package/dist/esm/seo/api/index.js +2 -0
- package/dist/esm/seo/api/index.js.map +1 -0
- package/dist/esm/seo/api/ssr/fetchRedirectByFrom.js +12 -0
- package/dist/esm/seo/api/ssr/fetchRedirectByFrom.js.map +1 -0
- package/dist/esm/seo/api/ssr/fetchSitemaps.js +15 -0
- package/dist/esm/seo/api/ssr/fetchSitemaps.js.map +1 -0
- package/dist/esm/seo/api/ssr/index.js +3 -0
- package/dist/esm/seo/api/ssr/index.js.map +1 -0
- package/dist/esm/seo/index.js +1 -0
- package/dist/esm/seo/index.js.map +1 -1
- package/dist/types/components/GoogleOneTap/index.d.ts +3 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/postcss/index.d.ts +2 -0
- package/dist/types/postcss/tailwind/buttons-plugin.d.ts +4 -0
- package/dist/types/postcss/tailwind/default-plugin.d.ts +4 -0
- package/dist/types/postcss/tailwind/fonts-plugin.d.ts +4 -0
- package/dist/types/postcss/tailwind/forms-plugin.d.ts +4 -0
- package/dist/types/postcss/tailwind/index.d.ts +3 -0
- package/dist/types/postcss/tailwind/utils.d.ts +9 -0
- package/dist/types/postcss/types.d.ts +110 -0
- package/dist/types/seo/api/index.d.ts +1 -0
- package/dist/types/seo/api/ssr/fetchRedirectByFrom.d.ts +1 -0
- package/dist/types/seo/api/ssr/fetchSitemaps.d.ts +1 -0
- package/dist/types/seo/api/ssr/index.d.ts +2 -0
- package/dist/types/seo/index.d.ts +1 -0
- package/package.json +5 -4
@@ -24,9 +24,12 @@ var _useConfig = require("../../hooks/useConfig");
|
|
24
24
|
var _tokens = require("../../utils/tokens");
|
25
25
|
|
26
26
|
/* eslint-disable @typescript-eslint/camelcase */
|
27
|
-
var GoogleOneTap = function GoogleOneTap() {
|
27
|
+
var GoogleOneTap = function GoogleOneTap(_ref) {
|
28
28
|
var _config$google3;
|
29
29
|
|
30
|
+
var _ref$autoSignIn = _ref.autoSignIn,
|
31
|
+
autoSignIn = _ref$autoSignIn === void 0 ? true : _ref$autoSignIn;
|
32
|
+
|
30
33
|
var _useLoginGoogle = (0, _.useLoginGoogle)(),
|
31
34
|
login = _useLoginGoogle[0];
|
32
35
|
|
@@ -69,7 +72,7 @@ var GoogleOneTap = function GoogleOneTap() {
|
|
69
72
|
|
70
73
|
return callback;
|
71
74
|
}(),
|
72
|
-
auto_select:
|
75
|
+
auto_select: autoSignIn,
|
73
76
|
context: 'use'
|
74
77
|
});
|
75
78
|
google.accounts.id.prompt(function (notification) {
|
@@ -81,7 +84,7 @@ var GoogleOneTap = function GoogleOneTap() {
|
|
81
84
|
} else {
|
82
85
|
google.accounts.id.cancel();
|
83
86
|
}
|
84
|
-
}, [config == null ? void 0 : (_config$google3 = config.google) == null ? void 0 : _config$google3.id, login]);
|
87
|
+
}, [config == null ? void 0 : (_config$google3 = config.google) == null ? void 0 : _config$google3.id, login, autoSignIn]);
|
85
88
|
return /*#__PURE__*/_react["default"].createElement(_ExternalScript.ExternalScript, {
|
86
89
|
src: "https://accounts.google.com/gsi/client",
|
87
90
|
onLoad: onLoad,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/GoogleOneTap/index.tsx"],"names":["GoogleOneTap","login","config","onLoad","token","Cookies","get","AUTH_TOKEN_KEY","google","id","accounts","initialize","client_id","callback","response","access_token","credential","auto_select","context","prompt","notification","isNotDisplayed","isSkippedMoment","reason","getNotDisplayedReason","cancel"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AANA;AAWO,IAAMA,YAAY,GAAG,SAAfA,YAAe,
|
1
|
+
{"version":3,"sources":["../../../../src/components/GoogleOneTap/index.tsx"],"names":["GoogleOneTap","autoSignIn","login","config","onLoad","token","Cookies","get","AUTH_TOKEN_KEY","google","id","accounts","initialize","client_id","callback","response","access_token","credential","auto_select","context","prompt","notification","isNotDisplayed","isSkippedMoment","reason","getNotDisplayedReason","cancel"],"mappings":";;;;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AANA;AAWO,IAAMA,YAAY,GAAG,SAAfA,YAAe,OAItB;AAAA;;AAAA,6BAHJC,UAGI;AAAA,MAHJA,UAGI,gCAHS,IAGT;;AAAA,wBACY,uBADZ;AAAA,MACGC,KADH;;AAEJ,MAAMC,MAAM,GAAG,gCAAf;AAEA,MAAMC,MAAM,GAAG,wBAAY,YAAM;AAAA;;AAC/B,QAAMC,KAAK,GAAGC,qBAAQC,GAAR,CAAYC,sBAAZ,CAAd,CAD+B,CAE/B;;;AACA,QAAI,OAAOC,MAAP,KAAkB,WAAlB,IAAiC,EAACN,MAAD,8BAACA,MAAM,CAAEM,MAAT,aAAC,eAAgBC,EAAjB,CAArC,EAA0D;;AAE1D,QAAI,CAACL,KAAL,EAAY;AAAA;;AACVI,MAAAA,MAAM,CAACE,QAAP,CAAgBD,EAAhB,CAAmBE,UAAnB,CAA8B;AAC5BC,QAAAA,SAAS,EAAEV,MAAF,uCAAEA,MAAM,CAAEM,MAAV,qBAAE,gBAAgBC,EADC;AAE5BI,QAAAA,QAAQ;AAAA,wGAAE,iBAAOC,QAAP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BACFb,KAAK,CAAC;AAAEc,sBAAAA,YAAY,EAAED,QAAQ,CAACE;AAAzB,qBAAD,CADH;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAF;;AAAA;AAAA;AAAA;;AAAA;AAAA,WAFoB;AAK5BC,QAAAA,WAAW,EAAEjB,UALe;AAM5BkB,QAAAA,OAAO,EAAE;AANmB,OAA9B;AAQAV,MAAAA,MAAM,CAACE,QAAP,CAAgBD,EAAhB,CAAmBU,MAAnB,CAA0B,UAACC,YAAD,EAAuB;AAC/C,YAAIA,YAAY,CAACC,cAAb,MAAiCD,YAAY,CAACE,eAAb,EAArC,EAAqE;AACnE,cAAMC,MAAM,GAAGH,YAAY,CAACI,qBAAb,EAAf;AACA,iBAAOD,MAAP,CAFmE,CAErD;AACf;AACF,OALD;AAMD,KAfD,MAeO;AACLf,MAAAA,MAAM,CAACE,QAAP,CAAgBD,EAAhB,CAAmBgB,MAAnB;AACD;AACF,GAvBc,EAuBZ,CAACvB,MAAD,uCAACA,MAAM,CAAEM,MAAT,qBAAC,gBAAgBC,EAAjB,EAAqBR,KAArB,EAA4BD,UAA5B,CAvBY,CAAf;AAyBA,sBACE,gCAAC,8BAAD;AACE,IAAA,GAAG,EAAC,wCADN;AAEE,IAAA,MAAM,EAAEG,MAFV;AAGE,IAAA,SAAS,EAAE,IAHb;AAIE,IAAA,SAAS,EAAE;AAAA,aAAM,CAACE,qBAAQC,GAAR,CAAYC,sBAAZ,CAAP;AAAA;AAJb,IADF;AAQD,CAzCM","sourcesContent":["/* eslint-disable @typescript-eslint/camelcase */\nimport React, { useCallback } from 'react'\nimport Cookies from 'js-cookie'\nimport { useLoginGoogle } from '../..'\nimport { ExternalScript } from '../ExternalScript'\nimport { useConfigState } from '../../hooks/useConfig'\nimport { AUTH_TOKEN_KEY } from '../../utils/tokens'\n\n// eslint-disable-next-line no-var\ndeclare var google: any\n\nexport const GoogleOneTap = ({\n autoSignIn = true,\n}: {\n autoSignIn?: boolean\n}) => {\n const [login] = useLoginGoogle()\n const config = useConfigState()\n\n const onLoad = useCallback(() => {\n const token = Cookies.get(AUTH_TOKEN_KEY)\n // Google one tap\n if (typeof google === 'undefined' || !config?.google?.id) return\n\n if (!token) {\n google.accounts.id.initialize({\n client_id: config?.google?.id,\n callback: async (response: any) => {\n await login({ access_token: response.credential })\n },\n auto_select: autoSignIn,\n context: 'use',\n })\n google.accounts.id.prompt((notification: any) => {\n if (notification.isNotDisplayed() || notification.isSkippedMoment()) {\n const reason = notification.getNotDisplayedReason()\n return reason // left for debug purposes\n }\n })\n } else {\n google.accounts.id.cancel()\n }\n }, [config?.google?.id, login, autoSignIn])\n\n return (\n <ExternalScript\n src=\"https://accounts.google.com/gsi/client\"\n onLoad={onLoad}\n loadDelay={2000}\n condition={() => !Cookies.get(AUTH_TOKEN_KEY)}\n />\n )\n}\n"],"file":"index.js"}
|
package/dist/cjs/index.js
CHANGED
@@ -913,4 +913,12 @@ Object.keys(_checkout).forEach(function (key) {
|
|
913
913
|
if (key in exports && exports[key] === _checkout[key]) return;
|
914
914
|
exports[key] = _checkout[key];
|
915
915
|
});
|
916
|
+
|
917
|
+
var _postcss = require("./postcss");
|
918
|
+
|
919
|
+
Object.keys(_postcss).forEach(function (key) {
|
920
|
+
if (key === "default" || key === "__esModule") return;
|
921
|
+
if (key in exports && exports[key] === _postcss[key]) return;
|
922
|
+
exports[key] = _postcss[key];
|
923
|
+
});
|
916
924
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAIA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;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;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAGA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAGA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAGA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAGA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAGA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAGA;;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './dto'\n\n// API\n// export * from './api/myCart'\nexport * from './api/productsApi'\nexport * from './api/pagesApi'\nexport * from './api/usersApi'\nexport * from './api/profileApi'\nexport * from './api/wishlistApi'\nexport * from './api/addressesApi'\nexport * from './api/consentsApi'\nexport * from './api/catalogApi'\nexport * from './api/categoriesApi'\nexport * from './api/brandsApi'\nexport * from './api/viewsApi'\nexport * from './api/notificationsApi'\nexport * from './api/companiesApi'\nexport * from './api/vouchersApi'\nexport * from './api/myCartApi'\nexport * from './api/myShippingsSpeedyApi'\nexport * from './api/myOrdersApi'\nexport * from './api/myShippingsEcontApi'\nexport * from './api/myShippingsEvropatApi'\nexport * from './api/cmsContentApi'\nexport * from './api/citiesApi'\nexport * from './api/searchHistoryApi'\n\nexport * from './api/walletApi'\nexport * from './api/myShippingsPickupFromStoreAPI'\n\nexport * from './api/myPaymentsBoricaApi'\n// Components\n\n// Contexts\nexport * from './contexts/Strings'\nexport * from './contexts/CheckoutForm'\nexport * from './contexts/CheckoutForm/utils'\nexport * from './contexts/CustomProductProvider'\n\n// Components\nexport * from './components'\n\n// Hooks\nexport * from './hooks/useCarousel'\nexport * from './hooks/useZoom'\nexport * from './hooks/useProduct'\nexport * from './hooks/useCatalogResult'\nexport * from './hooks/useCopyToClipboard'\nexport * from './hooks/useVouchers'\nexport * from './hooks/usePromoCode'\nexport * from './hooks/useCheckoutDelivery'\nexport * from './hooks/useCheckoutPayment'\nexport * from './hooks/useCheckoutShippingAddress'\nexport * from './hooks/useCheckoutBillingAddress'\nexport * from './hooks/useCheckoutSubmit'\nexport * from './hooks/useCheckoutDiscountCode'\nexport * from './hooks/wishlist-hooks/useWishlist'\nexport * from './hooks/useCheckoutSummary'\nexport * from './hooks/usePrice'\nexport * from './hooks/wishlist-hooks'\nexport * from './hooks/cms-content-hooks'\nexport * from './hooks/labels'\nexport * from './hooks/checkout-hooks'\n\nexport * from './hooks/basket-hooks/useBasketTotalCount'\nexport * from './hooks/useIsBasketWithFixedShippingPrice'\nexport * from './hooks/useProductCarousel'\nexport * from './hooks/useSearchbar'\nexport * from './hooks/useSEOAggregateResult'\nexport * from './hooks/useCatalogPredicates'\nexport * from './hooks/useAggregateResult'\nexport * from './hooks/useSelectedFilters'\nexport * from './hooks/useAllSelectedFilters'\nexport * from './hooks/useClearAllFilters'\nexport * from './hooks/useCheckoutPickupFromStore'\nexport * from './hooks/useCheckoutShippingModule'\nexport * from './hooks/useLoyaltyProgram'\nexport * from './hooks/useCategoryTree'\nexport * from './hooks/useWallet'\nexport * from './hooks/useSizesReducer'\nexport * from './hooks/useAvailability'\n\nexport * from './hooks/cities-hooks'\n\nexport * from './hooks/useLineItem'\nexport * from './hooks/usePrefetchProduct'\nexport * from './hooks/ui-hooks'\nexport * from './hooks/order-hooks'\nexport * from './hooks/basket-hooks'\nexport * from './hooks/useAddressList'\n// export * from './hooks/third-party'\n\nexport * from './hooks/useConfig'\nexport * from './hooks/useShippingAddress'\nexport * from './hooks/useBillingAddress'\nexport * from './hooks/useContactForm'\n\nexport * from './hooks/user-hooks'\nexport * from './hooks/error-handling'\n\nexport * from './hooks/profile-hooks'\nexport * from './hooks/addresses-hooks'\nexport * from './hooks/companies-hooks'\nexport * from './hooks/subscriptions-hooks'\nexport * from './hooks/useRouterRedirect'\nexport * from './hooks/useProgressBar'\nexport * from './hooks/useCatalogDiscounts'\nexport * from './hooks/useLocalRating'\n\n// Utils\nexport * from './utils'\nexport * from './types'\n\n// SEO\nexport * from './seo'\n\n// Analytics\nexport * from './analytics/initiateCheckout'\nexport * from './analytics/viewContent'\n\nexport * from './analytics/Releva'\nexport * from './analytics/Pixel'\n\n// WebView\nexport * from './webview'\n\n// Carousel\nexport * from 'embla-carousel/react'\n\n// CMS\nexport * from './cms'\n\n// API v2\nexport * from './config'\nexport * from './api.v2/core'\n\nexport * from './api.v2/core/misc'\n\nexport * from './ssr/'\nexport * from './listing'\nexport * from './brands'\nexport * from './navigation'\nexport * from './GDPR'\n\n// User\nexport * from './user'\n\n// UI Components and hooks\nexport * from './ui'\n\nexport * from './wishlist'\n\n// Build Scripts \nexport * from './build'\n\n// Order\nexport * from './order'\n\n// Product\nexport * from './product'\n\n// Checkout\nexport * from './checkout'\n\n"],"file":"index.js"}
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAIA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AA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;AAAA;;AAGA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAGA;;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './dto'\n\n// API\n// export * from './api/myCart'\nexport * from './api/productsApi'\nexport * from './api/pagesApi'\nexport * from './api/usersApi'\nexport * from './api/profileApi'\nexport * from './api/wishlistApi'\nexport * from './api/addressesApi'\nexport * from './api/consentsApi'\nexport * from './api/catalogApi'\nexport * from './api/categoriesApi'\nexport * from './api/brandsApi'\nexport * from './api/viewsApi'\nexport * from './api/notificationsApi'\nexport * from './api/companiesApi'\nexport * from './api/vouchersApi'\nexport * from './api/myCartApi'\nexport * from './api/myShippingsSpeedyApi'\nexport * from './api/myOrdersApi'\nexport * from './api/myShippingsEcontApi'\nexport * from './api/myShippingsEvropatApi'\nexport * from './api/cmsContentApi'\nexport * from './api/citiesApi'\nexport * from './api/searchHistoryApi'\n\nexport * from './api/walletApi'\nexport * from './api/myShippingsPickupFromStoreAPI'\n\nexport * from './api/myPaymentsBoricaApi'\n// Components\n\n// Contexts\nexport * from './contexts/Strings'\nexport * from './contexts/CheckoutForm'\nexport * from './contexts/CheckoutForm/utils'\nexport * from './contexts/CustomProductProvider'\n\n// Components\nexport * from './components'\n\n// Hooks\nexport * from './hooks/useCarousel'\nexport * from './hooks/useZoom'\nexport * from './hooks/useProduct'\nexport * from './hooks/useCatalogResult'\nexport * from './hooks/useCopyToClipboard'\nexport * from './hooks/useVouchers'\nexport * from './hooks/usePromoCode'\nexport * from './hooks/useCheckoutDelivery'\nexport * from './hooks/useCheckoutPayment'\nexport * from './hooks/useCheckoutShippingAddress'\nexport * from './hooks/useCheckoutBillingAddress'\nexport * from './hooks/useCheckoutSubmit'\nexport * from './hooks/useCheckoutDiscountCode'\nexport * from './hooks/wishlist-hooks/useWishlist'\nexport * from './hooks/useCheckoutSummary'\nexport * from './hooks/usePrice'\nexport * from './hooks/wishlist-hooks'\nexport * from './hooks/cms-content-hooks'\nexport * from './hooks/labels'\nexport * from './hooks/checkout-hooks'\n\nexport * from './hooks/basket-hooks/useBasketTotalCount'\nexport * from './hooks/useIsBasketWithFixedShippingPrice'\nexport * from './hooks/useProductCarousel'\nexport * from './hooks/useSearchbar'\nexport * from './hooks/useSEOAggregateResult'\nexport * from './hooks/useCatalogPredicates'\nexport * from './hooks/useAggregateResult'\nexport * from './hooks/useSelectedFilters'\nexport * from './hooks/useAllSelectedFilters'\nexport * from './hooks/useClearAllFilters'\nexport * from './hooks/useCheckoutPickupFromStore'\nexport * from './hooks/useCheckoutShippingModule'\nexport * from './hooks/useLoyaltyProgram'\nexport * from './hooks/useCategoryTree'\nexport * from './hooks/useWallet'\nexport * from './hooks/useSizesReducer'\nexport * from './hooks/useAvailability'\n\nexport * from './hooks/cities-hooks'\n\nexport * from './hooks/useLineItem'\nexport * from './hooks/usePrefetchProduct'\nexport * from './hooks/ui-hooks'\nexport * from './hooks/order-hooks'\nexport * from './hooks/basket-hooks'\nexport * from './hooks/useAddressList'\n// export * from './hooks/third-party'\n\nexport * from './hooks/useConfig'\nexport * from './hooks/useShippingAddress'\nexport * from './hooks/useBillingAddress'\nexport * from './hooks/useContactForm'\n\nexport * from './hooks/user-hooks'\nexport * from './hooks/error-handling'\n\nexport * from './hooks/profile-hooks'\nexport * from './hooks/addresses-hooks'\nexport * from './hooks/companies-hooks'\nexport * from './hooks/subscriptions-hooks'\nexport * from './hooks/useRouterRedirect'\nexport * from './hooks/useProgressBar'\nexport * from './hooks/useCatalogDiscounts'\nexport * from './hooks/useLocalRating'\n\n// Utils\nexport * from './utils'\nexport * from './types'\n\n// SEO\nexport * from './seo'\n\n// Analytics\nexport * from './analytics/initiateCheckout'\nexport * from './analytics/viewContent'\n\nexport * from './analytics/Releva'\nexport * from './analytics/Pixel'\n\n// WebView\nexport * from './webview'\n\n// Carousel\nexport * from 'embla-carousel/react'\n\n// CMS\nexport * from './cms'\n\n// API v2\nexport * from './config'\nexport * from './api.v2/core'\n\nexport * from './api.v2/core/misc'\n\nexport * from './ssr/'\nexport * from './listing'\nexport * from './brands'\nexport * from './navigation'\nexport * from './GDPR'\n\n// User\nexport * from './user'\n\n// UI Components and hooks\nexport * from './ui'\n\nexport * from './wishlist'\n\n// Build Scripts \nexport * from './build'\n\n// Order\nexport * from './order'\n\n// Product\nexport * from './product'\n\n// Checkout\nexport * from './checkout'\n\n// PostCSS and related configuration\nexport * from './postcss'"],"file":"index.js"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
|
5
|
+
var _tailwind = require("./tailwind");
|
6
|
+
|
7
|
+
Object.keys(_tailwind).forEach(function (key) {
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (key in exports && exports[key] === _tailwind[key]) return;
|
10
|
+
exports[key] = _tailwind[key];
|
11
|
+
});
|
12
|
+
|
13
|
+
var _types = require("./types");
|
14
|
+
|
15
|
+
Object.keys(_types).forEach(function (key) {
|
16
|
+
if (key === "default" || key === "__esModule") return;
|
17
|
+
if (key in exports && exports[key] === _types[key]) return;
|
18
|
+
exports[key] = _types[key];
|
19
|
+
});
|
20
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/postcss/index.ts"],"names":[],"mappings":";;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './tailwind'\nexport * from './types'"],"file":"index.js"}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.tailwindButtons = void 0;
|
5
|
+
|
6
|
+
var _utils = require("./utils");
|
7
|
+
|
8
|
+
var tailwindButtons = function tailwindButtons(Config) {
|
9
|
+
return function (_ref) {
|
10
|
+
var addBase = _ref.addBase,
|
11
|
+
theme = _ref.theme;
|
12
|
+
var buttons = Config.theme.buttons;
|
13
|
+
var screens = theme('screens', {});
|
14
|
+
var colors = theme('colors', {});
|
15
|
+
var newButtonStyles = {
|
16
|
+
'.btn': {
|
17
|
+
display: 'inline-flex',
|
18
|
+
'-webkit-box-align': 'center',
|
19
|
+
'align-items': 'center',
|
20
|
+
'-webkit-box-pack': 'center',
|
21
|
+
'justify-content': 'center',
|
22
|
+
cursor: 'pointer',
|
23
|
+
'max-width': '100%',
|
24
|
+
position: 'relative'
|
25
|
+
},
|
26
|
+
'.btn-full': {
|
27
|
+
width: '100%'
|
28
|
+
}
|
29
|
+
};
|
30
|
+
var buttonsMediaQueries = [];
|
31
|
+
/**
|
32
|
+
* Create all global button classes.
|
33
|
+
*
|
34
|
+
* Example usage:
|
35
|
+
* .btn .btn-primary .btn-large__screen-xl .btn-full
|
36
|
+
*/
|
37
|
+
|
38
|
+
buttons.forEach(function (button) {
|
39
|
+
var _button$hover, _button$hover2, _button$hover3, _button$hover4, _button$hover5, _button$sizes;
|
40
|
+
|
41
|
+
var font = (0, _utils.getFontByKey)(button.fontKey, Config.theme);
|
42
|
+
newButtonStyles[".btn-" + button.key] = {
|
43
|
+
color: colors[button.textColor],
|
44
|
+
fontSize: font ? font.size + 'px' : 'inherit',
|
45
|
+
lineHeight: font ? font.lineHeight : 'inherit',
|
46
|
+
fontFamily: font ? font.familyName : 'inherit',
|
47
|
+
fontWeight: font ? font.weight : 'inherit',
|
48
|
+
backgroundColor: colors[button.backgroundColor],
|
49
|
+
border: button.borderWidth + "px solid " + colors[button.borderColor],
|
50
|
+
padding: button.paddingY + "px " + button.paddingX + "px",
|
51
|
+
minHeight: button.minHeight + 'px',
|
52
|
+
minWidth: button.minWidth + 'px',
|
53
|
+
borderRadius: button.borderRadius,
|
54
|
+
opacity: button.opacity || 1,
|
55
|
+
transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
|
56
|
+
'&:hover': {
|
57
|
+
opacity: (_button$hover = button.hover) == null ? void 0 : _button$hover.opacity,
|
58
|
+
backgroundColor: colors[(_button$hover2 = button.hover) == null ? void 0 : _button$hover2.backgroundColor],
|
59
|
+
color: colors[(_button$hover3 = button.hover) == null ? void 0 : _button$hover3.textColor],
|
60
|
+
borderColor: colors[(_button$hover4 = button.hover) == null ? void 0 : _button$hover4.borderColor],
|
61
|
+
boxShadow: button.hover && "0 0 8px -4px " + colors[(_button$hover5 = button.hover) == null ? void 0 : _button$hover5.boxShadow]
|
62
|
+
},
|
63
|
+
'&:focus-visible': {
|
64
|
+
boxShadow: "0 0 0 3px " + colors[button.focusBoxShadowColor] + "40"
|
65
|
+
}
|
66
|
+
};
|
67
|
+
button == null ? void 0 : (_button$sizes = button.sizes) == null ? void 0 : _button$sizes.forEach(function (size) {
|
68
|
+
var sizeFont = (0, _utils.getFontByKey)(size.fontKey || button.fontKey || '', Config.theme);
|
69
|
+
var fields = {
|
70
|
+
padding: size.paddingY + "px " + size.paddingX + "px",
|
71
|
+
minHeight: size.minHeight + 'px',
|
72
|
+
minWidth: size.minWidth + 'px',
|
73
|
+
fontSize: sizeFont ? sizeFont.size + 'px' : 'inherit',
|
74
|
+
lineHeight: sizeFont ? sizeFont.lineHeight : 'inherit',
|
75
|
+
fontFamily: sizeFont ? sizeFont.familyName : 'inherit'
|
76
|
+
};
|
77
|
+
newButtonStyles[".btn-" + button.key + ".btn-" + size.sizeKey] = fields;
|
78
|
+
Object.keys(screens).forEach(function (screenKey) {
|
79
|
+
var _ref2, _buttonsMediaQueries$;
|
80
|
+
|
81
|
+
if (screens[screenKey] === '0px') return;
|
82
|
+
buttonsMediaQueries.push((_buttonsMediaQueries$ = {}, _buttonsMediaQueries$["" + (0, _utils.getScreenMediaQuery)(screenKey, Config.theme)] = (_ref2 = {}, _ref2[".btn-" + button.key + ".btn-" + size.sizeKey + "__screen-" + screenKey] = fields, _ref2), _buttonsMediaQueries$));
|
83
|
+
});
|
84
|
+
});
|
85
|
+
});
|
86
|
+
addBase([newButtonStyles].concat(buttonsMediaQueries));
|
87
|
+
};
|
88
|
+
};
|
89
|
+
|
90
|
+
exports.tailwindButtons = tailwindButtons;
|
91
|
+
//# sourceMappingURL=buttons-plugin.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/postcss/tailwind/buttons-plugin.ts"],"names":["tailwindButtons","Config","addBase","theme","buttons","screens","colors","newButtonStyles","display","cursor","position","width","buttonsMediaQueries","forEach","button","font","fontKey","key","color","textColor","fontSize","size","lineHeight","fontFamily","familyName","fontWeight","weight","backgroundColor","border","borderWidth","borderColor","padding","paddingY","paddingX","minHeight","minWidth","borderRadius","opacity","transition","hover","boxShadow","focusBoxShadowColor","sizes","sizeFont","fields","sizeKey","Object","keys","screenKey","push"],"mappings":";;;;;AACA;;AAEO,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,MAAD,EAEzB;AACJ,SAAO,gBAA6B;AAAA,QAA1BC,OAA0B,QAA1BA,OAA0B;AAAA,QAAjBC,KAAiB,QAAjBA,KAAiB;AAAA,QAC1BC,OAD0B,GACdH,MAAM,CAACE,KADO,CAC1BC,OAD0B;AAGlC,QAAMC,OAAO,GAAGF,KAAK,CAAC,SAAD,EAAY,EAAZ,CAArB;AACA,QAAMG,MAAM,GAAGH,KAAK,CAAC,QAAD,EAAW,EAAX,CAApB;AAEA,QAAMI,eAAe,GAAG;AACtB,cAAQ;AACNC,QAAAA,OAAO,EAAE,aADH;AAEN,6BAAqB,QAFf;AAGN,uBAAe,QAHT;AAIN,4BAAoB,QAJd;AAKN,2BAAmB,QALb;AAMNC,QAAAA,MAAM,EAAE,SANF;AAON,qBAAa,MAPP;AAQNC,QAAAA,QAAQ,EAAE;AARJ,OADc;AAWtB,mBAAa;AACXC,QAAAA,KAAK,EAAE;AADI;AAXS,KAAxB;AAgBA,QAAMC,mBAA0B,GAAG,EAAnC;AAEA;AACJ;AACA;AACA;AACA;AACA;;AACIR,IAAAA,OAAO,CAACS,OAAR,CAAgB,UAACC,MAAD,EAAY;AAAA;;AAC1B,UAAMC,IAAI,GAAG,yBA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A6B,UAACmC,SAAD,EAAoB;AAAA;;AAC/C,cAAI3C,OAAO,CAAC2C,SAAD,CAAP,KAAuB,KAA3B,EAAkC;AAElCpC,UAAAA,mBAAmB,CAACqC,IAApB,yDACM,gCAAoBD,SAApB,EAA+B/C,MAAM,CAACE,KAAtC,CADN,iCAEaW,MAAM,CAACG,GAFpB,aAE+BI,IAAI,CAACwB,OAFpC,iBAEuDG,SAFvD,IAEqEJ,MAFrE;AAKD,SARD;AASD,OA3BD;AA4BD,KAhED;AAkEA1C,IAAAA,OAAO,EAAEK,eAAF,SAAsBK,mBAAtB,EAAP;AACD,GAjGD;AAkGD,CArGM","sourcesContent":["import { TailwindStylesConfig } from '../types'\nimport { getFontByKey, getScreenMediaQuery } from './utils'\n\nexport const tailwindButtons = (Config: {\n theme: TailwindStylesConfig<any, any>\n}) => {\n return ({ addBase, theme }: any) => {\n const { buttons } = Config.theme\n\n const screens = theme('screens', {})\n const colors = theme('colors', {})\n\n const newButtonStyles = {\n '.btn': {\n display: 'inline-flex',\n '-webkit-box-align': 'center',\n 'align-items': 'center',\n '-webkit-box-pack': 'center',\n 'justify-content': 'center',\n cursor: 'pointer',\n 'max-width': '100%',\n position: 'relative',\n },\n '.btn-full': {\n width: '100%',\n },\n }\n\n const buttonsMediaQueries: any[] = []\n\n /**\n * Create all global button classes.\n *\n * Example usage:\n * .btn .btn-primary .btn-large__screen-xl .btn-full\n */\n buttons.forEach((button) => {\n const font = getFontByKey(button.fontKey as string, Config.theme)\n\n newButtonStyles[`.btn-${button.key}`] = {\n color: colors[button.textColor],\n\n fontSize: font ? font.size + 'px' : 'inherit',\n lineHeight: font ? font.lineHeight : 'inherit',\n fontFamily: font ? font.familyName : 'inherit',\n fontWeight: font ? font.weight : 'inherit',\n\n backgroundColor: colors[button.backgroundColor],\n border: `${button.borderWidth}px solid ${colors[button.borderColor]}`,\n\n padding: `${button.paddingY}px ${button.paddingX}px`,\n minHeight: button.minHeight + 'px',\n minWidth: button.minWidth + 'px',\n\n borderRadius: button.borderRadius,\n opacity: button.opacity || 1,\n transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)',\n\n '&:hover': {\n opacity: button.hover?.opacity,\n backgroundColor: colors[button.hover?.backgroundColor],\n color: colors[button.hover?.textColor],\n borderColor: colors[button.hover?.borderColor],\n boxShadow:\n button.hover && `0 0 8px -4px ${colors[button.hover?.boxShadow]}`,\n },\n\n '&:focus-visible': {\n boxShadow: `0 0 0 3px ${colors[button.focusBoxShadowColor]}40`,\n },\n }\n\n button?.sizes?.forEach((size) => {\n const sizeFont = getFontByKey(\n size.fontKey || button.fontKey || '',\n Config.theme\n )\n\n const fields = {\n padding: `${size.paddingY}px ${size.paddingX}px`,\n minHeight: size.minHeight + 'px',\n minWidth: size.minWidth + 'px',\n\n fontSize: sizeFont ? sizeFont.size + 'px' : 'inherit',\n lineHeight: sizeFont ? sizeFont.lineHeight : 'inherit',\n fontFamily: sizeFont ? sizeFont.familyName : 'inherit',\n }\n\n newButtonStyles[`.btn-${button.key}.btn-${size.sizeKey}`] = fields\n\n Object.keys(screens).forEach((screenKey: any) => {\n if (screens[screenKey] === '0px') return\n\n buttonsMediaQueries.push({\n [`${getScreenMediaQuery(screenKey, Config.theme)}`]: {\n [`.btn-${button.key}.btn-${size.sizeKey}__screen-${screenKey}`]: fields,\n },\n })\n })\n })\n })\n\n addBase([newButtonStyles, ...buttonsMediaQueries])\n }\n}\n"],"file":"buttons-plugin.js"}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.tailwindDefaults = void 0;
|
5
|
+
|
6
|
+
var _utils = require("./utils");
|
7
|
+
|
8
|
+
var tailwindDefaults = function tailwindDefaults(Config) {
|
9
|
+
return function (_ref) {
|
10
|
+
var addBase = _ref.addBase,
|
11
|
+
theme = _ref.theme;
|
12
|
+
var colors = theme('colors', {});
|
13
|
+
var newSectionStyles = {};
|
14
|
+
Config.theme.spaceBetweenSections.forEach(function (data) {
|
15
|
+
newSectionStyles["" + (0, _utils.getScreenMediaQuery)(data.screen, Config.theme)] = {
|
16
|
+
'.section': {
|
17
|
+
marginBottom: data.space + "px"
|
18
|
+
}
|
19
|
+
};
|
20
|
+
});
|
21
|
+
var newContainerStyles = {
|
22
|
+
'.container': {
|
23
|
+
marginLeft: 'auto',
|
24
|
+
marginRight: 'auto',
|
25
|
+
width: '100%'
|
26
|
+
}
|
27
|
+
};
|
28
|
+
Config.theme.containerSizes.forEach(function (data) {
|
29
|
+
newContainerStyles["" + (0, _utils.getScreenMediaQuery)(data.screen, Config.theme)] = {
|
30
|
+
'.container': {
|
31
|
+
maxWidth: data.maxWidth + "px"
|
32
|
+
},
|
33
|
+
'.container-fluid, .container': {
|
34
|
+
paddingLeft: data.paddingX + "px",
|
35
|
+
paddingRight: data.paddingX + "px"
|
36
|
+
}
|
37
|
+
};
|
38
|
+
});
|
39
|
+
var newDefaultStyles = {
|
40
|
+
// Default body style
|
41
|
+
body: {
|
42
|
+
overflowX: 'hidden',
|
43
|
+
position: 'relative',
|
44
|
+
backgroundColor: colors[Config.theme.bodyBackground]
|
45
|
+
},
|
46
|
+
'*, *:after, *:before': {
|
47
|
+
boxSizing: 'border-box',
|
48
|
+
maxWidth: '100%'
|
49
|
+
},
|
50
|
+
'*:focus': {
|
51
|
+
outline: 'none !important'
|
52
|
+
},
|
53
|
+
'picture, figure, figcaption, article, aside, details, footer, header, hgroup, menu, nav, section': {
|
54
|
+
display: 'block'
|
55
|
+
}
|
56
|
+
};
|
57
|
+
addBase([newDefaultStyles, newContainerStyles, newSectionStyles]);
|
58
|
+
};
|
59
|
+
};
|
60
|
+
|
61
|
+
exports.tailwindDefaults = tailwindDefaults;
|
62
|
+
//# sourceMappingURL=default-plugin.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/postcss/tailwind/default-plugin.ts"],"names":["tailwindDefaults","Config","addBase","theme","colors","newSectionStyles","spaceBetweenSections","forEach","data","screen","marginBottom","space","newContainerStyles","marginLeft","marginRight","width","containerSizes","maxWidth","paddingLeft","paddingX","paddingRight","newDefaultStyles","body","overflowX","position","backgroundColor","bodyBackground","boxSizing","outline","display"],"mappings":";;;;;AACA;;AAEO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,MAAD,EAE1B;AACJ,SAAO,gBAA6B;AAAA,QAA1BC,OAA0B,QAA1BA,OAA0B;AAAA,QAAjBC,KAAiB,QAAjBA,KAAiB;AAClC,QAAMC,MAAM,GAAGD,KAAK,CAAC,QAAD,EAAW,EAAX,CAApB;AAEA,QAAME,gBAAgB,GAAG,EAAzB;AAEAJ,IAAAA,MAAM,CAACE,KAAP,CAAaG,oBAAb,CAAkCC,OAAlC,CAA0C,UAACC,IAAD,EAAU;AAClDH,MAAAA,gBAAgB,MAAI,gCAAoBG,IAAI,CAACC,MAAzB,EAAiCR,MAAM,CAACE,KAAxC,CAAJ,CAAhB,GAAwE;AACtE,oBAAY;AACVO,UAAAA,YAAY,EAAKF,IAAI,CAACG,KAAV;AADF;AAD0D,OAAxE;AAKD,KAND;AAQA,QAAMC,kBAAkB,GAAG;AACzB,oBAAc;AACZC,QAAAA,UAAU,EAAE,MADA;AAEZC,QAAAA,WAAW,EAAE,MAFD;AAGZC,QAAAA,KAAK,EAAE;AAHK;AADW,KAA3B;AAQAd,IAAAA,MAAM,CAACE,KAAP,CAAaa,cAAb,CAA4BT,OAA5B,CAAoC,UAACC,IAAD,EAAU;AAC5CI,MAAAA,kBAAkB,MACb,gCAAoBJ,IAAI,CAACC,MAAzB,EAAiCR,MAAM,CAACE,KAAxC,CADa,CAAlB,GAEI;AACF,sBAAc;AACZc,UAAAA,QAAQ,EAAKT,IAAI,CAACS,QAAV;AADI,SADZ;AAIF,wCAAgC;AAC9BC,UAAAA,WAAW,EAAKV,IAAI,CAACW,QAAV,OADmB;AAE9BC,UAAAA,YAAY,EAAKZ,IAAI,CAACW,QAAV;AAFkB;AAJ9B,OAFJ;AAWD,KAZD;AAcA,QAAME,gBAAgB,GAAG;AACvB;AACAC,MAAAA,IAAI,EAAE;AACJC,QAAAA,SAAS,EAAE,QADP;AAEJC,QAAAA,QAAQ,EAAE,UAFN;AAGJC,QAAAA,eAAe,EAAErB,MAAM,CAACH,MAAM,CAACE,KAAP,CAAauB,cAAd;AAHnB,OAFiB;AAOvB,8BAAwB;AACtBC,QAAAA,SAAS,EAAE,YADW;AAEtBV,QAAAA,QAAQ,EAAE;AAFY,OAPD;AAWvB,iBAAW;AACTW,QAAAA,OAAO,EAAE;AADA,OAXY;AAcvB,0GAAoG;AAClGC,QAAAA,OAAO,EAAE;AADyF;AAd7E,KAAzB;AAmBA3B,IAAAA,OAAO,CAAC,CAACmB,gBAAD,EAAmBT,kBAAnB,EAAuCP,gBAAvC,CAAD,CAAP;AACD,GAvDD;AAwDD,CA3DM","sourcesContent":["import { TailwindStylesConfig } from '../types'\nimport { getScreenMediaQuery } from './utils'\n\nexport const tailwindDefaults = (Config: {\n theme: TailwindStylesConfig<any, any>\n}) => {\n return ({ addBase, theme }: any) => {\n const colors = theme('colors', {})\n\n const newSectionStyles = {}\n\n Config.theme.spaceBetweenSections.forEach((data) => {\n newSectionStyles[`${getScreenMediaQuery(data.screen, Config.theme)}`] = {\n '.section': {\n marginBottom: `${data.space}px`,\n },\n }\n })\n\n const newContainerStyles = {\n '.container': {\n marginLeft: 'auto',\n marginRight: 'auto',\n width: '100%',\n },\n }\n\n Config.theme.containerSizes.forEach((data) => {\n newContainerStyles[\n `${getScreenMediaQuery(data.screen, Config.theme)}`\n ] = {\n '.container': {\n maxWidth: `${data.maxWidth}px`,\n },\n '.container-fluid, .container': {\n paddingLeft: `${data.paddingX}px`,\n paddingRight: `${data.paddingX}px`,\n },\n }\n })\n\n const newDefaultStyles = {\n // Default body style\n body: {\n overflowX: 'hidden',\n position: 'relative',\n backgroundColor: colors[Config.theme.bodyBackground],\n },\n '*, *:after, *:before': {\n boxSizing: 'border-box',\n maxWidth: '100%',\n },\n '*:focus': {\n outline: 'none !important',\n },\n 'picture, figure, figcaption, article, aside, details, footer, header, hgroup, menu, nav, section': {\n display: 'block',\n },\n }\n\n addBase([newDefaultStyles, newContainerStyles, newSectionStyles])\n }\n}\n"],"file":"default-plugin.js"}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.tailwindFonts = void 0;
|
5
|
+
|
6
|
+
var _utils = require("./utils");
|
7
|
+
|
8
|
+
var tailwindFonts = function tailwindFonts(Config) {
|
9
|
+
return function (_ref) {
|
10
|
+
var addBase = _ref.addBase,
|
11
|
+
theme = _ref.theme;
|
12
|
+
var fonts = Config.theme.fonts;
|
13
|
+
var screens = theme('screens', {});
|
14
|
+
var newFontStyles = {};
|
15
|
+
var newDefaultFonts = {};
|
16
|
+
var fontsMediaQueries = [];
|
17
|
+
/**
|
18
|
+
* Create all global font classes
|
19
|
+
*/
|
20
|
+
|
21
|
+
fonts.forEach(function (font) {
|
22
|
+
var fontFamily = (0, _utils.getFontFamilyName)(font.familyName, Config.theme);
|
23
|
+
var selectors = ".font-" + font.key + " " + (font.tags.length ? "," + font.tags.join(',') : '');
|
24
|
+
var fields = {
|
25
|
+
fontSize: font.size + "px",
|
26
|
+
lineHeight: font.lineHeight,
|
27
|
+
fontFamily: fontFamily,
|
28
|
+
fontWeight: font.weight
|
29
|
+
};
|
30
|
+
newFontStyles[selectors] = fields;
|
31
|
+
Object.keys(screens).forEach(function (screenKey) {
|
32
|
+
var _ref2, _fontsMediaQueries$pu;
|
33
|
+
|
34
|
+
if (screens[screenKey] === '0px') return;
|
35
|
+
fontsMediaQueries.push((_fontsMediaQueries$pu = {}, _fontsMediaQueries$pu["" + (0, _utils.getScreenMediaQuery)(screenKey, Config.theme)] = (_ref2 = {}, _ref2[".font-" + font.key + "__screen-" + screenKey] = fields, _ref2), _fontsMediaQueries$pu));
|
36
|
+
});
|
37
|
+
});
|
38
|
+
/**
|
39
|
+
* Default Fonts
|
40
|
+
*/
|
41
|
+
|
42
|
+
Config.theme.defaultFont.forEach(function (defaultFont) {
|
43
|
+
var font = (0, _utils.getFontByKey)(defaultFont.fontKey, Config.theme);
|
44
|
+
if (!font) return;
|
45
|
+
newDefaultFonts["" + (0, _utils.getScreenMediaQuery)(defaultFont.screen, Config.theme)] = {
|
46
|
+
body: {
|
47
|
+
lineHeight: font.lineHeight ? font.lineHeight : '1.4',
|
48
|
+
fontSize: font.size ? font.size + "px" : 'inherit',
|
49
|
+
fontFamily: font.familyName
|
50
|
+
}
|
51
|
+
};
|
52
|
+
});
|
53
|
+
/**
|
54
|
+
* Load font faces
|
55
|
+
*/
|
56
|
+
|
57
|
+
var fontFaces = Config.theme.fontFamilies.map(function (font) {
|
58
|
+
return [{
|
59
|
+
'@font-face': {
|
60
|
+
fontFamily: font.name,
|
61
|
+
src: "url(" + font.woff2 + ") format('woff2')," + (font.eot ? "url(" + font.eot + "?#iefix) format('embedded-opentype')," : '') + (font.svg ? "url(" + font.svg + ") format('svg')," : '') + (font.ttf ? "url(" + font.ttf + ") format('truetype')," : '') + "url(" + font.woff + ") format('woff')",
|
62
|
+
fontWeight: font.weight,
|
63
|
+
fontStyle: 'normal',
|
64
|
+
fontDisplay: 'swap'
|
65
|
+
}
|
66
|
+
}];
|
67
|
+
});
|
68
|
+
addBase([newDefaultFonts, newFontStyles].concat(fontsMediaQueries, [fontFaces]));
|
69
|
+
};
|
70
|
+
};
|
71
|
+
|
72
|
+
exports.tailwindFonts = tailwindFonts;
|
73
|
+
//# sourceMappingURL=fonts-plugin.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/postcss/tailwind/fonts-plugin.ts"],"names":["tailwindFonts","Config","addBase","theme","fonts","screens","newFontStyles","newDefaultFonts","fontsMediaQueries","forEach","font","fontFamily","familyName","selectors","key","tags","length","join","fields","fontSize","size","lineHeight","fontWeight","weight","Object","keys","screenKey","push","defaultFont","fontKey","screen","body","fontFaces","fontFamilies","map","name","src","woff2","eot","svg","ttf","woff","fontStyle","fontDisplay"],"mappings":";;;;;AACA;;AAEO,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,MAAD,EAAuD;AAClF,SAAO,gBAA6B;AAAA,QAA1BC,OAA0B,QAA1BA,OAA0B;AAAA,QAAjBC,KAAiB,QAAjBA,KAAiB;AAAA,QAC1BC,KAD0B,GAChBH,MAAM,CAACE,KADS,CAC1BC,KAD0B;AAGlC,QAAMC,OAAO,GAAGF,KAAK,CAAC,SAAD,EAAY,EAAZ,CAArB;AAEA,QAAMG,aAAa,GAAG,EAAtB;AACA,QAAMC,eAAe,GAAG,EAAxB;AACA,QAAMC,iBAAwB,GAAG,EAAjC;AAEA;AACJ;AACA;;AACIJ,IAAAA,KAAK,CAACK,OAAN,CAAc,UAACC,IAAD,EAAU;AACtB,UAAMC,UAAU,GAAG,8BAAkBD,IAAI,CAACE,UAAvB,EAAmCX,MAAM,CAACE,KAA1C,CAAnB;AAEA,UAAMU,SAAS,cAAYH,IAAI,CAACI,GAAjB,UACbJ,IAAI,CAACK,IAAL,CAAUC,MAAV,SAAuBN,IAAI,CAACK,IAAL,CAAUE,IAAV,CAAe,GAAf,CAAvB,GAA+C,EADlC,CAAf;AAIA,UAAMC,MAAM,GAAG;AACbC,QAAAA,QAAQ,EAAKT,IAAI,CAACU,IAAV,OADK;AAEbC,QAAAA,UAAU,EAAEX,IAAI,CAACW,UAFJ;AAGbV,QAAAA,UAAU,EAAEA,UAHC;AAIbW,QAAAA,UAAU,EAAEZ,IAAI,CAACa;AAJJ,OAAf;AAOAjB,MAAAA,aAAa,CAACO,SAAD,CAAb,GAA2BK,MAA3B;AAEAM,MAAAA,MAAM,CAACC,IAAP,CAAYpB,OAAZ,EAAqBI,OAArB,CAA6B,UAACiB,SAAD,EAAoB;AAAA;;AAC/C,YAAIrB,OAAO,CAACqB,SAAD,CAAP,KAAuB,KAA3B,EAAkC;AAElClB,QAAA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AAI,CAAC+B,IANT,qBAFS;AASZnB,UAAAA,UAAU,EAAEZ,IAAI,CAACa,MATL;AAUZmB,UAAAA,SAAS,EAAE,QAVC;AAWZC,UAAAA,WAAW,EAAE;AAXD;AADhB,OADK,CAAP;AAiBD,KAlBiB,CAAlB;AAoBAzC,IAAAA,OAAO,EAAEK,eAAF,EAAmBD,aAAnB,SAAqCE,iBAArC,GAAwDwB,SAAxD,GAAP;AACD,GAjFD;AAkFD,CAnFM","sourcesContent":["import { TailwindStylesConfig } from '../types'\nimport { getFontFamilyName, getScreenMediaQuery, getFontByKey } from './utils'\n\nexport const tailwindFonts = (Config: { theme: TailwindStylesConfig<any, any> }) => {\n return ({ addBase, theme }: any) => {\n const { fonts } = Config.theme\n\n const screens = theme('screens', {})\n\n const newFontStyles = {}\n const newDefaultFonts = {}\n const fontsMediaQueries: any[] = []\n\n /**\n * Create all global font classes\n */\n fonts.forEach((font) => {\n const fontFamily = getFontFamilyName(font.familyName, Config.theme)\n\n const selectors = `.font-${font.key} ${\n font.tags.length ? `,${font.tags.join(',')}` : ''\n }`\n\n const fields = {\n fontSize: `${font.size}px`,\n lineHeight: font.lineHeight,\n fontFamily: fontFamily,\n fontWeight: font.weight,\n }\n\n newFontStyles[selectors] = fields\n\n Object.keys(screens).forEach((screenKey: any) => {\n if (screens[screenKey] === '0px') return\n\n fontsMediaQueries.push({\n [`${getScreenMediaQuery(screenKey, Config.theme)}`]: {\n [`.font-${font.key}__screen-${screenKey}`]: fields,\n },\n })\n })\n })\n\n /**\n * Default Fonts\n */\n Config.theme.defaultFont.forEach((defaultFont) => {\n const font = getFontByKey(defaultFont.fontKey, Config.theme)\n if (!font) return\n\n newDefaultFonts[\n `${getScreenMediaQuery(defaultFont.screen, Config.theme)}`\n ] = {\n body: {\n lineHeight: font.lineHeight ? font.lineHeight : '1.4',\n fontSize: font.size ? `${font.size}px` : 'inherit',\n fontFamily: font.familyName,\n },\n }\n })\n\n /**\n * Load font faces\n */\n const fontFaces = Config.theme.fontFamilies.map((font) => {\n return [\n {\n '@font-face': {\n fontFamily: font.name,\n src: `url(${font.woff2}) format('woff2'),${\n font.eot\n ? `url(${font.eot}?#iefix) format('embedded-opentype'),`\n : ''\n }${font.svg ? `url(${font.svg}) format('svg'),` : ''}${\n font.ttf ? `url(${font.ttf}) format('truetype'),` : ''\n }url(${font.woff}) format('woff')`,\n fontWeight: font.weight,\n fontStyle: 'normal',\n fontDisplay: 'swap',\n },\n },\n ]\n })\n\n addBase([newDefaultFonts, newFontStyles, ...fontsMediaQueries, fontFaces])\n }\n}\n"],"file":"fonts-plugin.js"}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.tailwindForms = void 0;
|
5
|
+
|
6
|
+
var _utils = require("./utils");
|
7
|
+
|
8
|
+
var tailwindForms = function tailwindForms(Config, withReset, withTagSelector) {
|
9
|
+
if (withReset === void 0) {
|
10
|
+
withReset = true;
|
11
|
+
}
|
12
|
+
|
13
|
+
if (withTagSelector === void 0) {
|
14
|
+
withTagSelector = true;
|
15
|
+
}
|
16
|
+
|
17
|
+
return function (_ref) {
|
18
|
+
var _ref2, _inputStyles;
|
19
|
+
|
20
|
+
var addBase = _ref.addBase,
|
21
|
+
theme = _ref.theme;
|
22
|
+
var forms = Config.theme.forms;
|
23
|
+
var allInputs = 'input, select, textarea';
|
24
|
+
if (!forms) return;
|
25
|
+
var resetStyles = withReset ? (_ref2 = {}, _ref2[allInputs] = {
|
26
|
+
border: 0,
|
27
|
+
appearance: 'none',
|
28
|
+
boxShadow: 'none',
|
29
|
+
backgroundColor: 'transparent'
|
30
|
+
}, _ref2) : {};
|
31
|
+
var style = forms.inputStyle;
|
32
|
+
var font = (0, _utils.getFontByKey)(style.fontKey, Config.theme);
|
33
|
+
var inputStyles = (_inputStyles = {}, _inputStyles[".input" + (withTagSelector ? ',' + allInputs : '')] = {
|
34
|
+
borderColor: style.borderColor,
|
35
|
+
borderRadius: style.borderRadius,
|
36
|
+
color: style.textColor,
|
37
|
+
padding: (0, _utils.toRem)(style.paddingY) + " " + (0, _utils.toRem)(style.paddingX),
|
38
|
+
height: (0, _utils.toRem)(style.height),
|
39
|
+
fontFamily: font.familyName,
|
40
|
+
fontSize: font.size,
|
41
|
+
lineHeight: font.lineHeight,
|
42
|
+
'&:hover': {
|
43
|
+
borderColor: style.hover.borderColor,
|
44
|
+
color: style.hover.textColor
|
45
|
+
},
|
46
|
+
'&:focus': {
|
47
|
+
borderColor: style.focus.borderColor,
|
48
|
+
color: style.focus.textColor
|
49
|
+
}
|
50
|
+
}, _inputStyles.textarea = {
|
51
|
+
height: 'auto'
|
52
|
+
}, _inputStyles);
|
53
|
+
addBase([resetStyles, inputStyles]);
|
54
|
+
};
|
55
|
+
};
|
56
|
+
|
57
|
+
exports.tailwindForms = tailwindForms;
|
58
|
+
//# sourceMappingURL=forms-plugin.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/postcss/tailwind/forms-plugin.ts"],"names":["tailwindForms","Config","withReset","withTagSelector","addBase","theme","forms","allInputs","resetStyles","border","appearance","boxShadow","backgroundColor","style","inputStyle","font","fontKey","inputStyles","borderColor","borderRadius","color","textColor","padding","paddingY","paddingX","height","fontFamily","familyName","fontSize","size","lineHeight","hover","focus","textarea"],"mappings":";;;;;AACA;;AAEO,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAC3BC,MAD2B,EAI3BC,SAJ2B,EAK3BC,eAL2B,EAMxB;AAAA,MAFHD,SAEG;AAFHA,IAAAA,SAEG,GAFS,IAET;AAAA;;AAAA,MADHC,eACG;AADHA,IAAAA,eACG,GADe,IACf;AAAA;;AACH,SAAO,gBAA6B;AAAA;;AAAA,QAA1BC,OAA0B,QAA1BA,OAA0B;AAAA,QAAjBC,KAAiB,QAAjBA,KAAiB;AAAA,QAC1BC,KAD0B,GAChBL,MAAM,CAACI,KADS,CAC1BC,KAD0B;AAGlC,QAAMC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M,EAAE;AADA,KAnBK,eAAjB;AAwBArB,IAAAA,OAAO,CAAC,CAACI,WAAD,EAAcS,WAAd,CAAD,CAAP;AACD,GA/CD;AAgDD,CAvDM","sourcesContent":["import { TailwindStylesConfig } from '../types'\nimport { getFontByKey, toRem } from './utils'\n\nexport const tailwindForms = (\n Config: {\n theme: TailwindStylesConfig<any, any>\n },\n withReset = true,\n withTagSelector = true\n) => {\n return ({ addBase, theme }: any) => {\n const { forms } = Config.theme\n\n const allInputs = 'input, select, textarea'\n\n if (!forms) return\n\n const resetStyles = withReset\n ? {\n [allInputs]: {\n border: 0,\n appearance: 'none',\n boxShadow: 'none',\n backgroundColor: 'transparent',\n },\n }\n : {}\n\n const style = forms.inputStyle\n\n const font = getFontByKey(style.fontKey, Config.theme)\n\n const inputStyles = {\n [`.input${withTagSelector ? ',' + allInputs : ''}`]: {\n borderColor: style.borderColor,\n borderRadius: style.borderRadius,\n color: style.textColor,\n padding: `${toRem(style.paddingY)} ${toRem(style.paddingX)}`,\n height: toRem(style.height),\n fontFamily: font.familyName,\n fontSize: font.size,\n lineHeight: font.lineHeight,\n '&:hover': {\n borderColor: style.hover.borderColor,\n color: style.hover.textColor,\n },\n '&:focus': {\n borderColor: style.focus.borderColor,\n color: style.focus.textColor,\n },\n },\n textarea: {\n height: 'auto'\n },\n }\n\n addBase([resetStyles, inputStyles])\n }\n}\n"],"file":"forms-plugin.js"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
|
5
|
+
var _defaultPlugin = require("./default-plugin");
|
6
|
+
|
7
|
+
Object.keys(_defaultPlugin).forEach(function (key) {
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (key in exports && exports[key] === _defaultPlugin[key]) return;
|
10
|
+
exports[key] = _defaultPlugin[key];
|
11
|
+
});
|
12
|
+
|
13
|
+
var _buttonsPlugin = require("./buttons-plugin");
|
14
|
+
|
15
|
+
Object.keys(_buttonsPlugin).forEach(function (key) {
|
16
|
+
if (key === "default" || key === "__esModule") return;
|
17
|
+
if (key in exports && exports[key] === _buttonsPlugin[key]) return;
|
18
|
+
exports[key] = _buttonsPlugin[key];
|
19
|
+
});
|
20
|
+
|
21
|
+
var _fontsPlugin = require("./fonts-plugin");
|
22
|
+
|
23
|
+
Object.keys(_fontsPlugin).forEach(function (key) {
|
24
|
+
if (key === "default" || key === "__esModule") return;
|
25
|
+
if (key in exports && exports[key] === _fontsPlugin[key]) return;
|
26
|
+
exports[key] = _fontsPlugin[key];
|
27
|
+
});
|
28
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/postcss/tailwind/index.ts"],"names":[],"mappings":";;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './default-plugin'\nexport * from './buttons-plugin'\nexport * from './fonts-plugin'"],"file":"index.js"}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.toRem = exports.getFontByKey = exports.getScreenMediaQuery = exports.getScreenByKey = exports.getFontFamilyName = void 0;
|
7
|
+
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
|
10
|
+
var getFontFamilyName = function getFontFamilyName(familyName, theme) {
|
11
|
+
var fontFamily = theme.fontFamilies.find(function (family) {
|
12
|
+
return family.name === familyName;
|
13
|
+
});
|
14
|
+
return fontFamily ? "\"" + fontFamily.name + "\"," + fontFamily.fallback : 'inherit';
|
15
|
+
};
|
16
|
+
|
17
|
+
exports.getFontFamilyName = getFontFamilyName;
|
18
|
+
|
19
|
+
var getScreenByKey = function getScreenByKey(key, theme) {
|
20
|
+
var foundScreen = theme.screens[key] || theme.screens["default"];
|
21
|
+
return foundScreen;
|
22
|
+
};
|
23
|
+
|
24
|
+
exports.getScreenByKey = getScreenByKey;
|
25
|
+
|
26
|
+
var getScreenMediaQuery = function getScreenMediaQuery(key, theme, withMax) {
|
27
|
+
if (withMax === void 0) {
|
28
|
+
withMax = false;
|
29
|
+
}
|
30
|
+
|
31
|
+
var screen = getScreenByKey(key, theme);
|
32
|
+
var max = screen.max && withMax ? " and max-width: " + screen.max + "px" : '';
|
33
|
+
return "@media (min-width: " + screen.min + "px" + max + ")";
|
34
|
+
};
|
35
|
+
|
36
|
+
exports.getScreenMediaQuery = getScreenMediaQuery;
|
37
|
+
|
38
|
+
var getFontByKey = function getFontByKey(key, theme) {
|
39
|
+
var foundFont = theme.fonts.find(function (font) {
|
40
|
+
return font.key === key;
|
41
|
+
});
|
42
|
+
if (!foundFont) return theme.fonts[0];
|
43
|
+
return (0, _extends2["default"])({}, foundFont, {
|
44
|
+
familyName: getFontFamilyName(foundFont.familyName, theme)
|
45
|
+
});
|
46
|
+
};
|
47
|
+
|
48
|
+
exports.getFontByKey = getFontByKey;
|
49
|
+
|
50
|
+
var toRem = function toRem(num) {
|
51
|
+
return num / 10 + 'rem';
|
52
|
+
};
|
53
|
+
|
54
|
+
exports.toRem = toRem;
|
55
|
+
//# sourceMappingURL=utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/postcss/tailwind/utils.ts"],"names":["getFontFamilyName","familyName","theme","fontFamily","fontFamilies","find","family","name","fallback","getScreenByKey","key","foundScreen","screens","getScreenMediaQuery","withMax","screen","max","min","getFontByKey","foundFont","fonts","font","toRem","num"],"mappings":";;;;;;;;;AAEO,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAC/BC,UAD+B,EAE/BC,KAF+B,EAG5B;AACH,MAAMC,UAAU,GAAGD,KAAK,CAACE,YAAN,CAAmBC,IAAnB,CACjB,UAACC,MAAD;A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AG,GAAG,EAAP,GAAa,KAApB;AACD,CAFM","sourcesContent":["import { ScreenKeysEnum, TailwindStylesConfig } from '../types'\n\nexport const getFontFamilyName = (\n familyName: string,\n theme: TailwindStylesConfig<any, any>\n) => {\n const fontFamily = theme.fontFamilies.find(\n (family) => family.name === familyName\n )\n\n return fontFamily ? `\"${fontFamily.name}\",${fontFamily.fallback}` : 'inherit'\n}\n\nexport const getScreenByKey = (\n key: ScreenKeysEnum,\n theme: TailwindStylesConfig<any, any>\n) => {\n const foundScreen = theme.screens[key] || theme.screens.default\n\n return foundScreen\n}\n\nexport const getScreenMediaQuery = (\n key: ScreenKeysEnum,\n theme: TailwindStylesConfig<any, any>,\n withMax = false\n) => {\n const screen = getScreenByKey(key, theme)\n\n const max = screen.max && withMax ? ` and max-width: ${screen.max}px` : ''\n\n return `@media (min-width: ${screen.min}px${max})`\n}\n\nexport const getFontByKey = (key: string, theme: TailwindStylesConfig<any, any>) => {\n const foundFont = theme.fonts.find((font) => font.key === key)\n\n if (!foundFont) return theme.fonts[0]\n\n return {\n ...foundFont,\n familyName: getFontFamilyName(foundFont.familyName, theme),\n }\n}\n\nexport const toRem = (num: number) => {\n return (num / 10) + 'rem'\n}"],"file":"utils.js"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.ButtonSizesEnum = exports.ScreenKeysEnum = void 0;
|
5
|
+
var ScreenKeysEnum;
|
6
|
+
exports.ScreenKeysEnum = ScreenKeysEnum;
|
7
|
+
|
8
|
+
(function (ScreenKeysEnum) {
|
9
|
+
ScreenKeysEnum["default"] = "default";
|
10
|
+
ScreenKeysEnum["sm"] = "sm";
|
11
|
+
ScreenKeysEnum["md"] = "md";
|
12
|
+
ScreenKeysEnum["lg"] = "lg";
|
13
|
+
ScreenKeysEnum["xl"] = "xl";
|
14
|
+
ScreenKeysEnum["xxl"] = "xxl";
|
15
|
+
})(ScreenKeysEnum || (exports.ScreenKeysEnum = ScreenKeysEnum = {}));
|
16
|
+
|
17
|
+
var ButtonSizesEnum;
|
18
|
+
exports.ButtonSizesEnum = ButtonSizesEnum;
|
19
|
+
|
20
|
+
(function (ButtonSizesEnum) {
|
21
|
+
ButtonSizesEnum["xs"] = "xs";
|
22
|
+
ButtonSizesEnum["sm"] = "sm";
|
23
|
+
ButtonSizesEnum["md"] = "md";
|
24
|
+
ButtonSizesEnum["reg"] = "reg";
|
25
|
+
ButtonSizesEnum["lg"] = "lg";
|
26
|
+
ButtonSizesEnum["xl"] = "xl";
|
27
|
+
ButtonSizesEnum["xxl"] = "xxl";
|
28
|
+
})(ButtonSizesEnum || (exports.ButtonSizesEnum = ButtonSizesEnum = {}));
|
29
|
+
//# sourceMappingURL=types.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/postcss/types.ts"],"names":["ScreenKeysEnum","ButtonSizesEnum"],"mappings":";;;;IAEYA,c;;;WAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;AAAAA,EAAAA,c;GAAAA,c,8BAAAA,c;;IASAC,e;;;WAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;AAAAA,EAAAA,e;GAAAA,e,+BAAAA,e","sourcesContent":["import { NumberField, TextField } from '@sentecacommerce-theme/base'\n\nexport enum ScreenKeysEnum {\n default = 'default',\n sm = 'sm',\n md = 'md',\n lg = 'lg',\n xl = 'xl',\n xxl = 'xxl',\n}\n\nexport enum ButtonSizesEnum {\n xs = 'xs',\n sm = 'sm',\n md = 'md',\n reg = 'reg',\n lg = 'lg',\n xl = 'xl',\n xxl = 'xxl',\n}\n\nexport type ScreenGroupField<T> = {\n screen: ScreenKeysEnum\n} & T\n\nexport type ButtonField<T> = {\n key: TextField\n\n fontKey?: TextField\n\n backgroundColor: T\n textColor: T\n borderColor: T\n\n minWidth: NumberField\n paddingX: NumberField\n paddingY: NumberField\n minHeight: NumberField\n borderRadius: TextField\n\n opacity?: NumberField\n\n focusBoxShadowColor?: T\n\n borderWidth: NumberField\n\n hover?: {\n backgroundColor?: T\n textColor?: T\n borderColor?: T\n opacity?: NumberField\n boxShadow?: T\n }\n\n sizes?: {\n sizeKey: ButtonSizesEnum\n\n fontKey?: TextField\n minWidth: NumberField\n minHeight: NumberField\n paddingY: NumberField\n paddingX: NumberField\n }[]\n}\n\nexport type FontField = {\n key: TextField\n size: NumberField\n lineHeight: TextField\n weight: TextField\n\n familyName: TextField\n\n tags: TextField[]\n}\n\nexport interface TailwindStylesConfig<ColorEnum, ColorsObject> {\n colors: ColorsObject\n\n screens: {\n [key in ScreenKeysEnum]: {\n min: NumberField\n max?: NumberField\n }\n }\n\n fontFamilies: {\n name: TextField\n fallback: TextField\n weight: TextField\n woff: TextField\n woff2: TextField\n eot?: TextField\n ttf?: TextField\n svg?: TextField\n }[]\n\n fonts: FontField[]\n\n defaultFont: ScreenGroupField<{ fontKey: TextField }>[]\n\n buttons: ButtonField<ColorEnum>[]\n\n forms?: {\n inputStyle: {\n borderColor: ColorEnum\n textColor: ColorEnum\n fontKey: TextField\n height: NumberField\n borderRadius: TextField\n paddingX: NumberField\n paddingY: NumberField\n\n focus: {\n textColor: ColorEnum\n borderColor: ColorEnum\n }\n\n hover: {\n textColor: ColorEnum\n borderColor: ColorEnum\n }\n }\n }\n\n spaceBetweenSections: ScreenGroupField<{ space: NumberField }>[]\n\n containerSizes: ScreenGroupField<{\n maxWidth: NumberField\n paddingX: NumberField\n }>[]\n\n bodyBackground: ColorEnum\n}"],"file":"types.js"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
|
5
|
+
var _ssr = require("./ssr");
|
6
|
+
|
7
|
+
Object.keys(_ssr).forEach(function (key) {
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (key in exports && exports[key] === _ssr[key]) return;
|
10
|
+
exports[key] = _ssr[key];
|
11
|
+
});
|
12
|
+
//# sourceMappingURL=index.js.map
|