@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
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/seo/api/index.ts"],"names":[],"mappings":";;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './ssr'"],"file":"index.js"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.fetchRedirectByFrom = void 0;
|
7
|
+
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
|
+
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
11
|
+
|
12
|
+
var _sdk = require("@sentecacommerce/sdk");
|
13
|
+
|
14
|
+
var fetchRedirectByFrom = /*#__PURE__*/function () {
|
15
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(from) {
|
16
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
17
|
+
while (1) {
|
18
|
+
switch (_context.prev = _context.next) {
|
19
|
+
case 0:
|
20
|
+
_context.next = 2;
|
21
|
+
return (0, _sdk.RedirectsGetByFrom)(from);
|
22
|
+
|
23
|
+
case 2:
|
24
|
+
return _context.abrupt("return", _context.sent);
|
25
|
+
|
26
|
+
case 3:
|
27
|
+
case "end":
|
28
|
+
return _context.stop();
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}, _callee);
|
32
|
+
}));
|
33
|
+
|
34
|
+
return function fetchRedirectByFrom(_x) {
|
35
|
+
return _ref.apply(this, arguments);
|
36
|
+
};
|
37
|
+
}();
|
38
|
+
|
39
|
+
exports.fetchRedirectByFrom = fetchRedirectByFrom;
|
40
|
+
//# sourceMappingURL=fetchRedirectByFrom.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../../src/seo/api/ssr/fetchRedirectByFrom.ts"],"names":["fetchRedirectByFrom","from"],"mappings":";;;;;;;;;;;AAAA;;AAEO,IAAMA,mBAAmB;AAAA,2FAAG,iBAAOC,IAAP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBACpB,6BAAmBA,IAAnB,CADoB;;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAAH;;AAAA,kBAAnBD,mBAAmB;AAAA;AAAA;AAAA,GAAzB","sourcesContent":["import { RedirectsGetByFrom } from '@sentecacommerce/sdk'\n\nexport const fetchRedirectByFrom = async (from: string) => {\n return await RedirectsGetByFrom(from)\n}\n"],"file":"fetchRedirectByFrom.js"}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.fetchSitemaps = void 0;
|
7
|
+
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
|
+
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
11
|
+
|
12
|
+
var _sdk = require("@sentecacommerce/sdk");
|
13
|
+
|
14
|
+
var fetchSitemaps = /*#__PURE__*/function () {
|
15
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(storeKey, interfaceKey) {
|
16
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
17
|
+
while (1) {
|
18
|
+
switch (_context.prev = _context.next) {
|
19
|
+
case 0:
|
20
|
+
_context.next = 2;
|
21
|
+
return (0, _sdk.SitemapsGetSitemapFiles)({
|
22
|
+
storeKey: storeKey,
|
23
|
+
interfaceKey: interfaceKey
|
24
|
+
});
|
25
|
+
|
26
|
+
case 2:
|
27
|
+
return _context.abrupt("return", _context.sent);
|
28
|
+
|
29
|
+
case 3:
|
30
|
+
case "end":
|
31
|
+
return _context.stop();
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}, _callee);
|
35
|
+
}));
|
36
|
+
|
37
|
+
return function fetchSitemaps(_x, _x2) {
|
38
|
+
return _ref.apply(this, arguments);
|
39
|
+
};
|
40
|
+
}();
|
41
|
+
|
42
|
+
exports.fetchSitemaps = fetchSitemaps;
|
43
|
+
//# sourceMappingURL=fetchSitemaps.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../../src/seo/api/ssr/fetchSitemaps.ts"],"names":["fetchSitemaps","storeKey","interfaceKey"],"mappings":";;;;;;;;;;;AAAA;;AAEO,IAAMA,aAAa;AAAA,2FAAG,iBAAOC,QAAP,EAAyBC,YAAzB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBACd,kCAAwB;AAAED,cAAAA,QAAQ,EAARA,QAAF;AAAYC,cAAAA,YAAY,EAAZA;AAAZ,aAAxB,CADc;;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAAH;;AAAA,kBAAbF,aAAa;AAAA;AAAA;AAAA,GAAnB","sourcesContent":["import { SitemapsGetSitemapFiles } from '@sentecacommerce/sdk'\n\nexport const fetchSitemaps = async (storeKey: string, interfaceKey: string) => {\n return await SitemapsGetSitemapFiles({ storeKey, interfaceKey })\n}"],"file":"fetchSitemaps.js"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
|
5
|
+
var _fetchSitemaps = require("./fetchSitemaps");
|
6
|
+
|
7
|
+
Object.keys(_fetchSitemaps).forEach(function (key) {
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
9
|
+
if (key in exports && exports[key] === _fetchSitemaps[key]) return;
|
10
|
+
exports[key] = _fetchSitemaps[key];
|
11
|
+
});
|
12
|
+
|
13
|
+
var _fetchRedirectByFrom = require("./fetchRedirectByFrom");
|
14
|
+
|
15
|
+
Object.keys(_fetchRedirectByFrom).forEach(function (key) {
|
16
|
+
if (key === "default" || key === "__esModule") return;
|
17
|
+
if (key in exports && exports[key] === _fetchRedirectByFrom[key]) return;
|
18
|
+
exports[key] = _fetchRedirectByFrom[key];
|
19
|
+
});
|
20
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../../src/seo/api/ssr/index.ts"],"names":[],"mappings":";;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './fetchSitemaps'\nexport * from './fetchRedirectByFrom'"],"file":"index.js"}
|
package/dist/cjs/seo/index.js
CHANGED
@@ -17,4 +17,12 @@ Object.keys(_hooks).forEach(function (key) {
|
|
17
17
|
if (key in exports && exports[key] === _hooks[key]) return;
|
18
18
|
exports[key] = _hooks[key];
|
19
19
|
});
|
20
|
+
|
21
|
+
var _api = require("./api");
|
22
|
+
|
23
|
+
Object.keys(_api).forEach(function (key) {
|
24
|
+
if (key === "default" || key === "__esModule") return;
|
25
|
+
if (key in exports && exports[key] === _api[key]) return;
|
26
|
+
exports[key] = _api[key];
|
27
|
+
});
|
20
28
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/seo/index.ts"],"names":[],"mappings":";;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './components'\nexport * from './hooks'"],"file":"index.js"}
|
1
|
+
{"version":3,"sources":["../../../src/seo/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 './components'\nexport * from './hooks'\nexport * from './api'"],"file":"index.js"}
|
@@ -8,9 +8,12 @@ import { ExternalScript } from '../ExternalScript';
|
|
8
8
|
import { useConfigState } from '../../hooks/useConfig';
|
9
9
|
import { AUTH_TOKEN_KEY } from '../../utils/tokens'; // eslint-disable-next-line no-var
|
10
10
|
|
11
|
-
export var GoogleOneTap = () => {
|
11
|
+
export var GoogleOneTap = (_ref) => {
|
12
12
|
var _config$google3;
|
13
13
|
|
14
|
+
var {
|
15
|
+
autoSignIn = true
|
16
|
+
} = _ref;
|
14
17
|
var [login] = useLoginGoogle();
|
15
18
|
var config = useConfigState();
|
16
19
|
var onLoad = useCallback(() => {
|
@@ -38,7 +41,7 @@ export var GoogleOneTap = () => {
|
|
38
41
|
|
39
42
|
return callback;
|
40
43
|
}(),
|
41
|
-
auto_select:
|
44
|
+
auto_select: autoSignIn,
|
42
45
|
context: 'use'
|
43
46
|
});
|
44
47
|
google.accounts.id.prompt(notification => {
|
@@ -50,7 +53,7 @@ export var GoogleOneTap = () => {
|
|
50
53
|
} else {
|
51
54
|
google.accounts.id.cancel();
|
52
55
|
}
|
53
|
-
}, [config == null ? void 0 : (_config$google3 = config.google) == null ? void 0 : _config$google3.id, login]);
|
56
|
+
}, [config == null ? void 0 : (_config$google3 = config.google) == null ? void 0 : _config$google3.id, login, autoSignIn]);
|
54
57
|
return /*#__PURE__*/React.createElement(ExternalScript, {
|
55
58
|
src: "https://accounts.google.com/gsi/client",
|
56
59
|
onLoad: onLoad,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/GoogleOneTap/index.tsx"],"names":["React","useCallback","Cookies","useLoginGoogle","ExternalScript","useConfigState","AUTH_TOKEN_KEY","GoogleOneTap","login","config","onLoad","token","get","google","id","accounts","initialize","client_id","callback","response","access_token","credential","auto_select","context","prompt","notification","isNotDisplayed","isSkippedMoment","reason","getNotDisplayedReason","cancel"],"mappings":";;AAAA;AACA,OAAOA,KAAP,IAAgBC,WAAhB,QAAmC,OAAnC;AACA,OAAOC,OAAP,MAAoB,WAApB;AACA,SAASC,cAAT,QAA+B,OAA/B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,cAAT,QAA+B,uBAA/B;AACA,SAASC,cAAT,QAA+B,oBAA/B,C,CAEA;;AAGA,OAAO,IAAMC,YAAY,GAAG,
|
1
|
+
{"version":3,"sources":["../../../../src/components/GoogleOneTap/index.tsx"],"names":["React","useCallback","Cookies","useLoginGoogle","ExternalScript","useConfigState","AUTH_TOKEN_KEY","GoogleOneTap","autoSignIn","login","config","onLoad","token","get","google","id","accounts","initialize","client_id","callback","response","access_token","credential","auto_select","context","prompt","notification","isNotDisplayed","isSkippedMoment","reason","getNotDisplayedReason","cancel"],"mappings":";;AAAA;AACA,OAAOA,KAAP,IAAgBC,WAAhB,QAAmC,OAAnC;AACA,OAAOC,OAAP,MAAoB,WAApB;AACA,SAASC,cAAT,QAA+B,OAA/B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,cAAT,QAA+B,uBAA/B;AACA,SAASC,cAAT,QAA+B,oBAA/B,C,CAEA;;AAGA,OAAO,IAAMC,YAAY,GAAG,UAItB;AAAA;;AAAA,MAJuB;AAC3BC,IAAAA,UAAU,GAAG;AADc,GAIvB;AACJ,MAAM,CAACC,KAAD,IAAUN,cAAc,EAA9B;AACA,MAAMO,MAAM,GAAGL,cAAc,EAA7B;AAEA,MAAMM,MAAM,GAAGV,WAAW,CAAC,MAAM;AAAA;;AAC/B,QAAMW,KAAK,GAAGV,OAAO,CAACW,GAAR,CAAYP,cAAZ,CAAd,CAD+B,CAE/B;;AACA,Q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;AAJpB,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/esm/index.js
CHANGED
@@ -131,5 +131,7 @@ export * from './order'; // Product
|
|
131
131
|
|
132
132
|
export * from './product'; // Checkout
|
133
133
|
|
134
|
-
export * from './checkout';
|
134
|
+
export * from './checkout'; // PostCSS and related configuration
|
135
|
+
|
136
|
+
export * from './postcss';
|
135
137
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAd,C,CAEA;AACA;;AACA,cAAc,mBAAd;AACA,cAAc,g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d;AAEA,cAAc,qBAAd;AACA,cAAc,4BAAd;AACA,cAAc,kBAAd;AACA,cAAc,qBAAd;AACA,cAAc,sBAAd;AACA,cAAc,wBAAd,C,CACA;;AAEA,cAAc,mBAAd;AACA,cAAc,4BAAd;AACA,cAAc,2BAAd;AACA,cAAc,wBAAd;AAEA,cAAc,oBAAd;AACA,cAAc,wBAAd;AAEA,cAAc,uBAAd;AACA,cAAc,yBAAd;AACA,cAAc,yBAAd;AACA,cAAc,6BAAd;AACA,cAAc,2BAAd;AACA,cAAc,wBAAd;AACA,cAAc,6BAAd;AACA,cAAc,wBAAd,C,CAEA;;AACA,cAAc,SAAd;AACA,cAAc,SAAd,C,CAEA;;AACA,cAAc,OAAd,C,CAEA;;AACA,cAAc,8BAAd;AACA,cAAc,yBAAd;AAEA,cAAc,oBAAd;AACA,cAAc,mBAAd,C,CAEA;;AACA,cAAc,WAAd,C,CAEA;;AACA,cAAc,sBAAd,C,CAEA;;AACA,cAAc,OAAd,C,CAEA;;AACA,cAAc,UAAd;AACA,cAAc,eAAd;AAEA,cAAc,oBAAd;AAEA,cAAc,QAAd;AACA,cAAc,WAAd;AACA,cAAc,UAAd;AACA,cAAc,cAAd;AACA,cAAc,QAAd,C,CAEA;;AACA,cAAc,QAAd,C,CAEA;;AACA,cAAc,MAAd;AAEA,cAAc,YAAd,C,CAEA;;AACA,cAAc,SAAd,C,CAEA;;AACA,cAAc,SAAd,C,CAEA;;AACA,cAAc,WAAd,C,CAEA;;AACA,cAAc,YAAd","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,cAAc,OAAd,C,CAEA;AACA;;AACA,cAAc,mBAAd;AACA,cAAc,gBAAd;AACA,cAAc,gBAAd;AACA,cAAc,kBAAd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ACA,cAAc,kBAAd;AACA,cAAc,qBAAd;AACA,cAAc,sBAAd;AACA,cAAc,wBAAd,C,CACA;;AAEA,cAAc,mBAAd;AACA,cAAc,4BAAd;AACA,cAAc,2BAAd;AACA,cAAc,wBAAd;AAEA,cAAc,oBAAd;AACA,cAAc,wBAAd;AAEA,cAAc,uBAAd;AACA,cAAc,yBAAd;AACA,cAAc,yBAAd;AACA,cAAc,6BAAd;AACA,cAAc,2BAAd;AACA,cAAc,wBAAd;AACA,cAAc,6BAAd;AACA,cAAc,wBAAd,C,CAEA;;AACA,cAAc,SAAd;AACA,cAAc,SAAd,C,CAEA;;AACA,cAAc,OAAd,C,CAEA;;AACA,cAAc,8BAAd;AACA,cAAc,yBAAd;AAEA,cAAc,oBAAd;AACA,cAAc,mBAAd,C,CAEA;;AACA,cAAc,WAAd,C,CAEA;;AACA,cAAc,sBAAd,C,CAEA;;AACA,cAAc,OAAd,C,CAEA;;AACA,cAAc,UAAd;AACA,cAAc,eAAd;AAEA,cAAc,oBAAd;AAEA,cAAc,QAAd;AACA,cAAc,WAAd;AACA,cAAc,UAAd;AACA,cAAc,cAAd;AACA,cAAc,QAAd,C,CAEA;;AACA,cAAc,QAAd,C,CAEA;;AACA,cAAc,MAAd;AAEA,cAAc,YAAd,C,CAEA;;AACA,cAAc,SAAd,C,CAEA;;AACA,cAAc,SAAd,C,CAEA;;AACA,cAAc,WAAd,C,CAEA;;AACA,cAAc,YAAd,C,CAEA;;AACA,cAAc,WAAd","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 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/postcss/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAd;AACA,cAAc,SAAd","sourcesContent":["export * from './tailwind'\nexport * from './types'"],"file":"index.js"}
|
@@ -0,0 +1,89 @@
|
|
1
|
+
import { getFontByKey, getScreenMediaQuery } from './utils';
|
2
|
+
export var tailwindButtons = Config => {
|
3
|
+
return (_ref) => {
|
4
|
+
var {
|
5
|
+
addBase,
|
6
|
+
theme
|
7
|
+
} = _ref;
|
8
|
+
var {
|
9
|
+
buttons
|
10
|
+
} = Config.theme;
|
11
|
+
var screens = theme('screens', {});
|
12
|
+
var colors = theme('colors', {});
|
13
|
+
var newButtonStyles = {
|
14
|
+
'.btn': {
|
15
|
+
display: 'inline-flex',
|
16
|
+
'-webkit-box-align': 'center',
|
17
|
+
'align-items': 'center',
|
18
|
+
'-webkit-box-pack': 'center',
|
19
|
+
'justify-content': 'center',
|
20
|
+
cursor: 'pointer',
|
21
|
+
'max-width': '100%',
|
22
|
+
position: 'relative'
|
23
|
+
},
|
24
|
+
'.btn-full': {
|
25
|
+
width: '100%'
|
26
|
+
}
|
27
|
+
};
|
28
|
+
var buttonsMediaQueries = [];
|
29
|
+
/**
|
30
|
+
* Create all global button classes.
|
31
|
+
*
|
32
|
+
* Example usage:
|
33
|
+
* .btn .btn-primary .btn-large__screen-xl .btn-full
|
34
|
+
*/
|
35
|
+
|
36
|
+
buttons.forEach(button => {
|
37
|
+
var _button$hover, _button$hover2, _button$hover3, _button$hover4, _button$hover5, _button$sizes;
|
38
|
+
|
39
|
+
var font = getFontByKey(button.fontKey, Config.theme);
|
40
|
+
newButtonStyles[".btn-" + button.key] = {
|
41
|
+
color: colors[button.textColor],
|
42
|
+
fontSize: font ? font.size + 'px' : 'inherit',
|
43
|
+
lineHeight: font ? font.lineHeight : 'inherit',
|
44
|
+
fontFamily: font ? font.familyName : 'inherit',
|
45
|
+
fontWeight: font ? font.weight : 'inherit',
|
46
|
+
backgroundColor: colors[button.backgroundColor],
|
47
|
+
border: button.borderWidth + "px solid " + colors[button.borderColor],
|
48
|
+
padding: button.paddingY + "px " + button.paddingX + "px",
|
49
|
+
minHeight: button.minHeight + 'px',
|
50
|
+
minWidth: button.minWidth + 'px',
|
51
|
+
borderRadius: button.borderRadius,
|
52
|
+
opacity: button.opacity || 1,
|
53
|
+
transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
|
54
|
+
'&:hover': {
|
55
|
+
opacity: (_button$hover = button.hover) == null ? void 0 : _button$hover.opacity,
|
56
|
+
backgroundColor: colors[(_button$hover2 = button.hover) == null ? void 0 : _button$hover2.backgroundColor],
|
57
|
+
color: colors[(_button$hover3 = button.hover) == null ? void 0 : _button$hover3.textColor],
|
58
|
+
borderColor: colors[(_button$hover4 = button.hover) == null ? void 0 : _button$hover4.borderColor],
|
59
|
+
boxShadow: button.hover && "0 0 8px -4px " + colors[(_button$hover5 = button.hover) == null ? void 0 : _button$hover5.boxShadow]
|
60
|
+
},
|
61
|
+
'&:focus-visible': {
|
62
|
+
boxShadow: "0 0 0 3px " + colors[button.focusBoxShadowColor] + "40"
|
63
|
+
}
|
64
|
+
};
|
65
|
+
button == null ? void 0 : (_button$sizes = button.sizes) == null ? void 0 : _button$sizes.forEach(size => {
|
66
|
+
var sizeFont = getFontByKey(size.fontKey || button.fontKey || '', Config.theme);
|
67
|
+
var fields = {
|
68
|
+
padding: size.paddingY + "px " + size.paddingX + "px",
|
69
|
+
minHeight: size.minHeight + 'px',
|
70
|
+
minWidth: size.minWidth + 'px',
|
71
|
+
fontSize: sizeFont ? sizeFont.size + 'px' : 'inherit',
|
72
|
+
lineHeight: sizeFont ? sizeFont.lineHeight : 'inherit',
|
73
|
+
fontFamily: sizeFont ? sizeFont.familyName : 'inherit'
|
74
|
+
};
|
75
|
+
newButtonStyles[".btn-" + button.key + ".btn-" + size.sizeKey] = fields;
|
76
|
+
Object.keys(screens).forEach(screenKey => {
|
77
|
+
if (screens[screenKey] === '0px') return;
|
78
|
+
buttonsMediaQueries.push({
|
79
|
+
["" + getScreenMediaQuery(screenKey, Config.theme)]: {
|
80
|
+
[".btn-" + button.key + ".btn-" + size.sizeKey + "__screen-" + screenKey]: fields
|
81
|
+
}
|
82
|
+
});
|
83
|
+
});
|
84
|
+
});
|
85
|
+
});
|
86
|
+
addBase([newButtonStyles, ...buttonsMediaQueries]);
|
87
|
+
};
|
88
|
+
};
|
89
|
+
//# sourceMappingURL=buttons-plugin.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/postcss/tailwind/buttons-plugin.ts"],"names":["getFontByKey","getScreenMediaQuery","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,SAASA,YAAT,EAAuBC,mBAAvB,QAAkD,SAAlD;AAEA,OAAO,IAAMC,eAAe,GAAIC,MAAD,IAEzB;AACJ,SAAO,UAA6B;AAAA,QAA5B;AAAEC,MAAAA,OAAF;AAAWC,MAAAA;AAAX,KAA4B;AAClC,QAAM;AAAEC,MAAAA;AAAF,QAAcH,MAAM,CAACE,KAA3B;AAEA,QAAME,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,EA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e,WAASO,MAAM,CAACG,GAAhB,aAA2BI,IAAI,CAACwB,OAAhC,CAAf,GAA4DD,MAA5D;AAEAE,QAAAA,MAAM,CAACC,IAAP,CAAY1C,OAAZ,EAAqBQ,OAArB,CAA8BmC,SAAD,IAAoB;AAC/C,cAAI3C,OAAO,CAAC2C,SAAD,CAAP,KAAuB,KAA3B,EAAkC;AAElCpC,UAAAA,mBAAmB,CAACqC,IAApB,CAAyB;AACvB,kBAAIlD,mBAAmB,CAACiD,SAAD,EAAY/C,MAAM,CAACE,KAAnB,CAAvB,GAAqD;AACnD,yBAASW,MAAM,CAACG,GAAhB,aAA2BI,IAAI,CAACwB,OAAhC,iBAAmDG,SAAnD,GAAiEJ;AADd;AAD9B,WAAzB;AAKD,SARD;AASD,OA3BD;AA4BD,KAhED;AAkEA1C,IAAAA,OAAO,CAAC,CAACK,eAAD,EAAkB,GAAGK,mBAArB,CAAD,CAAP;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,56 @@
|
|
1
|
+
import { getScreenMediaQuery } from './utils';
|
2
|
+
export var tailwindDefaults = Config => {
|
3
|
+
return (_ref) => {
|
4
|
+
var {
|
5
|
+
addBase,
|
6
|
+
theme
|
7
|
+
} = _ref;
|
8
|
+
var colors = theme('colors', {});
|
9
|
+
var newSectionStyles = {};
|
10
|
+
Config.theme.spaceBetweenSections.forEach(data => {
|
11
|
+
newSectionStyles["" + getScreenMediaQuery(data.screen, Config.theme)] = {
|
12
|
+
'.section': {
|
13
|
+
marginBottom: data.space + "px"
|
14
|
+
}
|
15
|
+
};
|
16
|
+
});
|
17
|
+
var newContainerStyles = {
|
18
|
+
'.container': {
|
19
|
+
marginLeft: 'auto',
|
20
|
+
marginRight: 'auto',
|
21
|
+
width: '100%'
|
22
|
+
}
|
23
|
+
};
|
24
|
+
Config.theme.containerSizes.forEach(data => {
|
25
|
+
newContainerStyles["" + getScreenMediaQuery(data.screen, Config.theme)] = {
|
26
|
+
'.container': {
|
27
|
+
maxWidth: data.maxWidth + "px"
|
28
|
+
},
|
29
|
+
'.container-fluid, .container': {
|
30
|
+
paddingLeft: data.paddingX + "px",
|
31
|
+
paddingRight: data.paddingX + "px"
|
32
|
+
}
|
33
|
+
};
|
34
|
+
});
|
35
|
+
var newDefaultStyles = {
|
36
|
+
// Default body style
|
37
|
+
body: {
|
38
|
+
overflowX: 'hidden',
|
39
|
+
position: 'relative',
|
40
|
+
backgroundColor: colors[Config.theme.bodyBackground]
|
41
|
+
},
|
42
|
+
'*, *:after, *:before': {
|
43
|
+
boxSizing: 'border-box',
|
44
|
+
maxWidth: '100%'
|
45
|
+
},
|
46
|
+
'*:focus': {
|
47
|
+
outline: 'none !important'
|
48
|
+
},
|
49
|
+
'picture, figure, figcaption, article, aside, details, footer, header, hgroup, menu, nav, section': {
|
50
|
+
display: 'block'
|
51
|
+
}
|
52
|
+
};
|
53
|
+
addBase([newDefaultStyles, newContainerStyles, newSectionStyles]);
|
54
|
+
};
|
55
|
+
};
|
56
|
+
//# sourceMappingURL=default-plugin.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/postcss/tailwind/default-plugin.ts"],"names":["getScreenMediaQuery","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,SAASA,mBAAT,QAAoC,SAApC;AAEA,OAAO,IAAMC,gBAAgB,GAAIC,MAAD,IAE1B;AACJ,SAAO,UAA6B;AAAA,QAA5B;AAAEC,MAAAA,OAAF;AAAWC,MAAAA;AAAX,KAA4B;AAClC,QAAMC,MAAM,GAAGD,KAAK,CAAC,QAAD,EAAW,EAAX,CAApB;AAEA,QAAME,gBAAgB,GAAG,EAAzB;AAEAJ,IAAAA,MAAM,CAACE,KAAP,CAAaG,oBAAb,CAAkCC,OAAlC,CAA2CC,IAAD,IAAU;AAClDH,MAAAA,gBAAgB,MAAIN,mBAAmB,CAACS,IAAI,CAACC,MAAN,EAAcR,MAAM,CAACE,KAArB,CAAvB,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,CAAqCC,IAAD,IAAU;AAC5CI,MAAAA,kBAAkB,MACbb,mBAAmB,CAACS,IAAI,CAACC,MAAN,EAAcR,MAAM,CAACE,KAArB,CADN,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,71 @@
|
|
1
|
+
import { getFontFamilyName, getScreenMediaQuery, getFontByKey } from './utils';
|
2
|
+
export var tailwindFonts = Config => {
|
3
|
+
return (_ref) => {
|
4
|
+
var {
|
5
|
+
addBase,
|
6
|
+
theme
|
7
|
+
} = _ref;
|
8
|
+
var {
|
9
|
+
fonts
|
10
|
+
} = Config.theme;
|
11
|
+
var screens = theme('screens', {});
|
12
|
+
var newFontStyles = {};
|
13
|
+
var newDefaultFonts = {};
|
14
|
+
var fontsMediaQueries = [];
|
15
|
+
/**
|
16
|
+
* Create all global font classes
|
17
|
+
*/
|
18
|
+
|
19
|
+
fonts.forEach(font => {
|
20
|
+
var fontFamily = getFontFamilyName(font.familyName, Config.theme);
|
21
|
+
var selectors = ".font-" + font.key + " " + (font.tags.length ? "," + font.tags.join(',') : '');
|
22
|
+
var fields = {
|
23
|
+
fontSize: font.size + "px",
|
24
|
+
lineHeight: font.lineHeight,
|
25
|
+
fontFamily: fontFamily,
|
26
|
+
fontWeight: font.weight
|
27
|
+
};
|
28
|
+
newFontStyles[selectors] = fields;
|
29
|
+
Object.keys(screens).forEach(screenKey => {
|
30
|
+
if (screens[screenKey] === '0px') return;
|
31
|
+
fontsMediaQueries.push({
|
32
|
+
["" + getScreenMediaQuery(screenKey, Config.theme)]: {
|
33
|
+
[".font-" + font.key + "__screen-" + screenKey]: fields
|
34
|
+
}
|
35
|
+
});
|
36
|
+
});
|
37
|
+
});
|
38
|
+
/**
|
39
|
+
* Default Fonts
|
40
|
+
*/
|
41
|
+
|
42
|
+
Config.theme.defaultFont.forEach(defaultFont => {
|
43
|
+
var font = getFontByKey(defaultFont.fontKey, Config.theme);
|
44
|
+
if (!font) return;
|
45
|
+
newDefaultFonts["" + 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(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, ...fontsMediaQueries, fontFaces]);
|
69
|
+
};
|
70
|
+
};
|
71
|
+
//# sourceMappingURL=fonts-plugin.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/postcss/tailwind/fonts-plugin.ts"],"names":["getFontFamilyName","getScreenMediaQuery","getFontByKey","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,SAASA,iBAAT,EAA4BC,mBAA5B,EAAiDC,YAAjD,QAAqE,SAArE;AAEA,OAA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AAE,QAVC;AAWZC,UAAAA,WAAW,EAAE;AAXD;AADhB,OADK,CAAP;AAiBD,KAlBiB,CAAlB;AAoBAzC,IAAAA,OAAO,CAAC,CAACK,eAAD,EAAkBD,aAAlB,EAAiC,GAAGE,iBAApC,EAAuDwB,SAAvD,CAAD,CAAP;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,57 @@
|
|
1
|
+
import { getFontByKey, toRem } from './utils';
|
2
|
+
export var tailwindForms = function tailwindForms(Config, withReset, withTagSelector) {
|
3
|
+
if (withReset === void 0) {
|
4
|
+
withReset = true;
|
5
|
+
}
|
6
|
+
|
7
|
+
if (withTagSelector === void 0) {
|
8
|
+
withTagSelector = true;
|
9
|
+
}
|
10
|
+
|
11
|
+
return (_ref) => {
|
12
|
+
var {
|
13
|
+
addBase,
|
14
|
+
theme
|
15
|
+
} = _ref;
|
16
|
+
var {
|
17
|
+
forms
|
18
|
+
} = Config.theme;
|
19
|
+
var allInputs = 'input, select, textarea';
|
20
|
+
if (!forms) return;
|
21
|
+
var resetStyles = withReset ? {
|
22
|
+
[allInputs]: {
|
23
|
+
border: 0,
|
24
|
+
appearance: 'none',
|
25
|
+
boxShadow: 'none',
|
26
|
+
backgroundColor: 'transparent'
|
27
|
+
}
|
28
|
+
} : {};
|
29
|
+
var style = forms.inputStyle;
|
30
|
+
var font = getFontByKey(style.fontKey, Config.theme);
|
31
|
+
var inputStyles = {
|
32
|
+
[".input" + (withTagSelector ? ',' + allInputs : '')]: {
|
33
|
+
borderColor: style.borderColor,
|
34
|
+
borderRadius: style.borderRadius,
|
35
|
+
color: style.textColor,
|
36
|
+
padding: toRem(style.paddingY) + " " + toRem(style.paddingX),
|
37
|
+
height: toRem(style.height),
|
38
|
+
fontFamily: font.familyName,
|
39
|
+
fontSize: font.size,
|
40
|
+
lineHeight: font.lineHeight,
|
41
|
+
'&:hover': {
|
42
|
+
borderColor: style.hover.borderColor,
|
43
|
+
color: style.hover.textColor
|
44
|
+
},
|
45
|
+
'&:focus': {
|
46
|
+
borderColor: style.focus.borderColor,
|
47
|
+
color: style.focus.textColor
|
48
|
+
}
|
49
|
+
},
|
50
|
+
textarea: {
|
51
|
+
height: 'auto'
|
52
|
+
}
|
53
|
+
};
|
54
|
+
addBase([resetStyles, inputStyles]);
|
55
|
+
};
|
56
|
+
};
|
57
|
+
//# sourceMappingURL=forms-plugin.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/postcss/tailwind/forms-plugin.ts"],"names":["getFontByKey","toRem","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,SAASA,YAAT,EAAuBC,KAAvB,QAAoC,SAApC;AAEA,OAAO,IAAMC,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,UAA6B;AAAA,QAA5B;AAAEC,MAAAA,OAAF;AAAWC,MAAAA;AAAX,KAA4B;AAClC,QAAM;AAAEC,MAAAA;AAAF,QAAYL,MAAM,CAACI,KAAzB;AAEA,QAAME,SAAS,GAAG,yBAAlB;AAEA,QAAI,CAACD,KAAL,EAAY;AAEZ,QAAME,WAAW,GAAGN,SAAS,GACzB;AACE,OAACK,SAAD,GAAa;AACXE,QAAAA,MAAM,EAAE,CADG;AAEXC,QAAAA,UAAU,EAAE,MAFD;AAGXC,QAAAA,SAAS,EAAE,MAHA;AAIXC,QAAAA,eAAe,EAAE;AAJN;AADf,KADyB,GASzB,EATJ;AAWA,QAAMC,KAAK,GAAGP,KAAK,CAACQ,UAApB;AAEA,QAAMC,IAAI,GAAGjB,YAAY,CAACe,KAAK,CAACG,OAAP,EAAgBf,MAAM,CAACI,KAAvB,CAAzB;AAEA,QAAMY,WAAW,GAAG;AAClB,mBAAUd,eAAe,GAAG,MAAMI,SAAT,GAAqB,EAA9C,IAAqD;AACnDW,QAAAA,WAAW,EAAEL,KAAK,CAACK,WADgC;AAEnDC,QAAAA,YAAY,EAAEN,KAAK,CAACM,YAF+B;AAGnDC,QAAAA,KAAK,EAAEP,KAAK,CAACQ,SAHsC;AAInDC,QAAAA,OAAO,EAAKvB,KAAK,CAACc,KAAK,CAACU,QAAP,CAAV,SAA8BxB,KAAK,CAACc,KAAK,CAACW,QAAP,CAJS;AAKnDC,QAAAA,MAAM,EAAE1B,KAAK,CAACc,KAAK,CAACY,MAAP,CALsC;AAMnDC,QAAAA,UAAU,EAAEX,IAAI,CAACY,UANkC;AAOnDC,QAAAA,QAAQ,EAAEb,IAAI,CAACc,IAPoC;AAQnDC,QAAAA,UAAU,EAAEf,IAAI,CAACe,UARkC;AASnD,mBAAW;AACTZ,UAAAA,WAAW,EAAEL,KAAK,CAACkB,KAAN,CAAYb,WADhB;AAETE,UAAAA,KAAK,EAAEP,KAAK,CAACkB,KAAN,CAAYV;AAFV,SATwC;AAanD,mBAAW;AACTH,UAAAA,WAAW,EAAEL,KAAK,CAACmB,KAAN,CAAYd,WADhB;AAETE,UAAAA,KAAK,EAAEP,KAAK,CAACmB,KAAN,CAAYX;AAFV;AAbwC,OADnC;AAmBlBY,MAAAA,QAAQ,EAAE;AACRR,QAAAA,MAAM,EAAE;AADA;AAnBQ,KAApB;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 @@
|
|
1
|
+
{"version":3,"sources":["../../../../src/postcss/tailwind/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAd;AACA,cAAc,kBAAd;AACA,cAAc,gBAAd","sourcesContent":["export * from './default-plugin'\nexport * from './buttons-plugin'\nexport * from './fonts-plugin'"],"file":"index.js"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
export var getFontFamilyName = (familyName, theme) => {
|
3
|
+
var fontFamily = theme.fontFamilies.find(family => family.name === familyName);
|
4
|
+
return fontFamily ? "\"" + fontFamily.name + "\"," + fontFamily.fallback : 'inherit';
|
5
|
+
};
|
6
|
+
export var getScreenByKey = (key, theme) => {
|
7
|
+
var foundScreen = theme.screens[key] || theme.screens.default;
|
8
|
+
return foundScreen;
|
9
|
+
};
|
10
|
+
export var getScreenMediaQuery = function getScreenMediaQuery(key, theme, withMax) {
|
11
|
+
if (withMax === void 0) {
|
12
|
+
withMax = false;
|
13
|
+
}
|
14
|
+
|
15
|
+
var screen = getScreenByKey(key, theme);
|
16
|
+
var max = screen.max && withMax ? " and max-width: " + screen.max + "px" : '';
|
17
|
+
return "@media (min-width: " + screen.min + "px" + max + ")";
|
18
|
+
};
|
19
|
+
export var getFontByKey = (key, theme) => {
|
20
|
+
var foundFont = theme.fonts.find(font => font.key === key);
|
21
|
+
if (!foundFont) return theme.fonts[0];
|
22
|
+
return _extends({}, foundFont, {
|
23
|
+
familyName: getFontFamilyName(foundFont.familyName, theme)
|
24
|
+
});
|
25
|
+
};
|
26
|
+
export var toRem = num => {
|
27
|
+
return num / 10 + 'rem';
|
28
|
+
};
|
29
|
+
//# sourceMappingURL=utils.js.map
|