@open-tender/store 0.5.5 → 0.5.7
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/.DS_Store +0 -0
- package/dist/cjs/utils/themeCloud.js +13 -11
- package/dist/esm/utils/themeCloud.js +13 -11
- package/package.json +1 -1
package/dist/.DS_Store
CHANGED
|
Binary file
|
|
@@ -13,15 +13,15 @@ var remsToNumber = function (rems) {
|
|
|
13
13
|
return parseInt((parseFloat(rems.replace('rem', '')) * 10).toString(), 10);
|
|
14
14
|
};
|
|
15
15
|
exports.remsToNumber = remsToNumber;
|
|
16
|
-
var makeLineHeight = function (lineHeight, fontSize
|
|
16
|
+
var makeLineHeight = function (lineHeight, fontSize) {
|
|
17
17
|
var size = parseInt(fontSize.replace('px', ''));
|
|
18
|
-
return "".concat((
|
|
18
|
+
return "".concat((parseFloat(lineHeight.toString()) * size).toFixed(2), "px");
|
|
19
19
|
};
|
|
20
|
-
var makeLineHeights = function (
|
|
20
|
+
var makeLineHeights = function (lineHeight, sizes) {
|
|
21
21
|
return Object.entries(sizes).reduce(function (obj, _a) {
|
|
22
22
|
var _b;
|
|
23
23
|
var size = _a[0], fontSize = _a[1];
|
|
24
|
-
return tslib_1.__assign(tslib_1.__assign({}, obj), (_b = {}, _b[size] = makeLineHeight(lineHeight, fontSize
|
|
24
|
+
return tslib_1.__assign(tslib_1.__assign({}, obj), (_b = {}, _b[size] = makeLineHeight(lineHeight, fontSize), _b));
|
|
25
25
|
}, {});
|
|
26
26
|
};
|
|
27
27
|
var fontSizesToPixels = function (object, ratio) {
|
|
@@ -75,17 +75,17 @@ var makeButtons = function (buttons, ratio) {
|
|
|
75
75
|
return tslib_1.__assign(tslib_1.__assign({}, buttons), { sizes: sizes });
|
|
76
76
|
};
|
|
77
77
|
var makeFont = function (font, sizes, ratio) {
|
|
78
|
-
var fontStyle = tslib_1.__assign(tslib_1.__assign({}, font), { letterSpacing: (0, exports.remsToPixels)(font.letterSpacing, ratio), lineHeights: makeLineHeights(
|
|
78
|
+
var fontStyle = tslib_1.__assign(tslib_1.__assign({}, font), { letterSpacing: (0, exports.remsToPixels)(font.letterSpacing, ratio), lineHeights: makeLineHeights(font.lineHeight, sizes) });
|
|
79
79
|
if (!font.fontSize) {
|
|
80
80
|
return fontStyle;
|
|
81
81
|
}
|
|
82
82
|
var fontSize = (0, exports.remsToPixels)(font.fontSize, ratio);
|
|
83
|
-
var lineHeight = makeLineHeight(font.lineHeight, fontSize
|
|
83
|
+
var lineHeight = makeLineHeight(font.lineHeight, fontSize);
|
|
84
84
|
return tslib_1.__assign(tslib_1.__assign({}, fontStyle), { fontSize: fontSize, lineHeight: lineHeight });
|
|
85
85
|
};
|
|
86
86
|
var makeFonts = function (fonts, lineHeight, ratio) {
|
|
87
87
|
var sizes = fontSizesToPixels(fonts.sizes, ratio);
|
|
88
|
-
var lineHeights = makeLineHeights(
|
|
88
|
+
var lineHeights = makeLineHeights(lineHeight, sizes);
|
|
89
89
|
var headline = makeFont(fonts.headline, sizes, ratio);
|
|
90
90
|
var headings = makeFont(fonts.headings, sizes, ratio);
|
|
91
91
|
var body = makeFont(fonts.body, sizes, ratio);
|
|
@@ -108,7 +108,9 @@ var makeLabel = function (label, ratio) {
|
|
|
108
108
|
};
|
|
109
109
|
var makeInputs = function (inputs, ratio) {
|
|
110
110
|
var _a = inputs.padding.split(' '), vertical = _a[0], horizontal = _a[1];
|
|
111
|
-
|
|
111
|
+
var fontSize = (0, exports.remsToPixels)(inputs.fontSize, ratio);
|
|
112
|
+
var fontSizeMobile = (0, exports.remsToPixels)(inputs.fontSizeMobile, ratio);
|
|
113
|
+
return tslib_1.__assign(tslib_1.__assign({}, inputs), { borderWidth: (0, exports.remsToPixels)(inputs.borderWidth, ratio), borderWidthApp: (0, exports.remsToPixels)(inputs.borderWidthApp, ratio), fontSize: fontSize, fontSizeMobile: fontSizeMobile, iconLeft: (0, exports.remsToPixels)(inputs.iconLeft, ratio), iconPadding: (0, exports.remsToPixels)(inputs.iconPadding, ratio), label: makeLabel(inputs.label, ratio), letterSpacing: (0, exports.remsToPixels)(inputs.letterSpacing, ratio), lineHeight: makeLineHeight(inputs.lineHeight, fontSize), lineHeightMobile: makeLineHeight(inputs.lineHeight, fontSizeMobile), padding: "".concat((0, exports.remsToPixels)(vertical, ratio), " ").concat((0, exports.remsToPixels)(horizontal, ratio)), paddingBottom: (0, exports.remsToPixels)(inputs.paddingBottom, ratio), paddingBottomActive: (0, exports.remsToPixels)(inputs.paddingBottomActive, ratio), paddingHorizontal: (0, exports.remsToPixels)(inputs.paddingHorizontal, ratio), paddingTop: (0, exports.remsToPixels)(inputs.paddingTop, ratio), paddingTopActive: (0, exports.remsToPixels)(inputs.paddingTopActive, ratio), paddingVertical: (0, exports.remsToPixels)(inputs.paddingVertical, ratio), radius: (0, exports.remsToPixels)(inputs.radius, ratio), selectPaddingBottom: (0, exports.remsToPixels)(inputs.selectPaddingBottom, ratio), selectSize: (0, exports.remsToPixels)(inputs.selectSize, ratio), selectSizeMobile: (0, exports.remsToPixels)(inputs.selectSizeMobile, ratio) });
|
|
112
114
|
};
|
|
113
115
|
var makeCounts = function (counts, ratio) {
|
|
114
116
|
var alerts = counts.alerts, quantity = counts.quantity;
|
|
@@ -145,9 +147,9 @@ var makeWelcome = function (welcome, ratio) {
|
|
|
145
147
|
marginBottom: (0, exports.remsToPixels)(welcome.marginBottom, ratio),
|
|
146
148
|
titleMarginLeft: (0, exports.remsToPixels)(welcome.titleMarginLeft, ratio),
|
|
147
149
|
titleSize: titleSize,
|
|
148
|
-
titleLineHeight: makeLineHeight(welcome.titleLineHeight, titleSize
|
|
150
|
+
titleLineHeight: makeLineHeight(welcome.titleLineHeight, titleSize),
|
|
149
151
|
subtitleSize: subtitleSize,
|
|
150
|
-
subtitleLineHeight: makeLineHeight(welcome.subtitleLineHeight, subtitleSize
|
|
152
|
+
subtitleLineHeight: makeLineHeight(welcome.subtitleLineHeight, subtitleSize),
|
|
151
153
|
subtitleMarginTop: (0, exports.remsToPixels)(welcome.subtitleMarginTop, ratio)
|
|
152
154
|
};
|
|
153
155
|
};
|
|
@@ -185,7 +187,7 @@ var decorateTheme = function (theme, dimensions, responsive) {
|
|
|
185
187
|
var inputs = makeInputs(theme.inputs, ratio);
|
|
186
188
|
var item = makeItems(theme.item, ratio);
|
|
187
189
|
var layout = layoutToPixels(theme.layout, ratio);
|
|
188
|
-
var lineHeight = makeLineHeight(theme.lineHeight, fonts.sizes.main
|
|
190
|
+
var lineHeight = makeLineHeight(theme.lineHeight, fonts.sizes.main);
|
|
189
191
|
var welcome = makeWelcomes(theme.welcome, ratio);
|
|
190
192
|
return tslib_1.__assign(tslib_1.__assign({}, theme), { border: border, buttons: buttons, cards: cards, counts: counts, fonts: fonts, inputs: inputs, item: item, lineHeight: lineHeight, layout: layout, welcome: welcome });
|
|
191
193
|
};
|
|
@@ -8,15 +8,15 @@ export var remsToPixels = function (rems, ratio) {
|
|
|
8
8
|
export var remsToNumber = function (rems) {
|
|
9
9
|
return parseInt((parseFloat(rems.replace('rem', '')) * 10).toString(), 10);
|
|
10
10
|
};
|
|
11
|
-
var makeLineHeight = function (lineHeight, fontSize
|
|
11
|
+
var makeLineHeight = function (lineHeight, fontSize) {
|
|
12
12
|
var size = parseInt(fontSize.replace('px', ''));
|
|
13
|
-
return "".concat((
|
|
13
|
+
return "".concat((parseFloat(lineHeight.toString()) * size).toFixed(2), "px");
|
|
14
14
|
};
|
|
15
|
-
var makeLineHeights = function (
|
|
15
|
+
var makeLineHeights = function (lineHeight, sizes) {
|
|
16
16
|
return Object.entries(sizes).reduce(function (obj, _a) {
|
|
17
17
|
var _b;
|
|
18
18
|
var size = _a[0], fontSize = _a[1];
|
|
19
|
-
return __assign(__assign({}, obj), (_b = {}, _b[size] = makeLineHeight(lineHeight, fontSize
|
|
19
|
+
return __assign(__assign({}, obj), (_b = {}, _b[size] = makeLineHeight(lineHeight, fontSize), _b));
|
|
20
20
|
}, {});
|
|
21
21
|
};
|
|
22
22
|
var fontSizesToPixels = function (object, ratio) {
|
|
@@ -70,17 +70,17 @@ var makeButtons = function (buttons, ratio) {
|
|
|
70
70
|
return __assign(__assign({}, buttons), { sizes: sizes });
|
|
71
71
|
};
|
|
72
72
|
var makeFont = function (font, sizes, ratio) {
|
|
73
|
-
var fontStyle = __assign(__assign({}, font), { letterSpacing: remsToPixels(font.letterSpacing, ratio), lineHeights: makeLineHeights(
|
|
73
|
+
var fontStyle = __assign(__assign({}, font), { letterSpacing: remsToPixels(font.letterSpacing, ratio), lineHeights: makeLineHeights(font.lineHeight, sizes) });
|
|
74
74
|
if (!font.fontSize) {
|
|
75
75
|
return fontStyle;
|
|
76
76
|
}
|
|
77
77
|
var fontSize = remsToPixels(font.fontSize, ratio);
|
|
78
|
-
var lineHeight = makeLineHeight(font.lineHeight, fontSize
|
|
78
|
+
var lineHeight = makeLineHeight(font.lineHeight, fontSize);
|
|
79
79
|
return __assign(__assign({}, fontStyle), { fontSize: fontSize, lineHeight: lineHeight });
|
|
80
80
|
};
|
|
81
81
|
var makeFonts = function (fonts, lineHeight, ratio) {
|
|
82
82
|
var sizes = fontSizesToPixels(fonts.sizes, ratio);
|
|
83
|
-
var lineHeights = makeLineHeights(
|
|
83
|
+
var lineHeights = makeLineHeights(lineHeight, sizes);
|
|
84
84
|
var headline = makeFont(fonts.headline, sizes, ratio);
|
|
85
85
|
var headings = makeFont(fonts.headings, sizes, ratio);
|
|
86
86
|
var body = makeFont(fonts.body, sizes, ratio);
|
|
@@ -103,7 +103,9 @@ var makeLabel = function (label, ratio) {
|
|
|
103
103
|
};
|
|
104
104
|
var makeInputs = function (inputs, ratio) {
|
|
105
105
|
var _a = inputs.padding.split(' '), vertical = _a[0], horizontal = _a[1];
|
|
106
|
-
|
|
106
|
+
var fontSize = remsToPixels(inputs.fontSize, ratio);
|
|
107
|
+
var fontSizeMobile = remsToPixels(inputs.fontSizeMobile, ratio);
|
|
108
|
+
return __assign(__assign({}, inputs), { borderWidth: remsToPixels(inputs.borderWidth, ratio), borderWidthApp: remsToPixels(inputs.borderWidthApp, ratio), fontSize: fontSize, fontSizeMobile: fontSizeMobile, iconLeft: remsToPixels(inputs.iconLeft, ratio), iconPadding: remsToPixels(inputs.iconPadding, ratio), label: makeLabel(inputs.label, ratio), letterSpacing: remsToPixels(inputs.letterSpacing, ratio), lineHeight: makeLineHeight(inputs.lineHeight, fontSize), lineHeightMobile: makeLineHeight(inputs.lineHeight, fontSizeMobile), padding: "".concat(remsToPixels(vertical, ratio), " ").concat(remsToPixels(horizontal, ratio)), paddingBottom: remsToPixels(inputs.paddingBottom, ratio), paddingBottomActive: remsToPixels(inputs.paddingBottomActive, ratio), paddingHorizontal: remsToPixels(inputs.paddingHorizontal, ratio), paddingTop: remsToPixels(inputs.paddingTop, ratio), paddingTopActive: remsToPixels(inputs.paddingTopActive, ratio), paddingVertical: remsToPixels(inputs.paddingVertical, ratio), radius: remsToPixels(inputs.radius, ratio), selectPaddingBottom: remsToPixels(inputs.selectPaddingBottom, ratio), selectSize: remsToPixels(inputs.selectSize, ratio), selectSizeMobile: remsToPixels(inputs.selectSizeMobile, ratio) });
|
|
107
109
|
};
|
|
108
110
|
var makeCounts = function (counts, ratio) {
|
|
109
111
|
var alerts = counts.alerts, quantity = counts.quantity;
|
|
@@ -140,9 +142,9 @@ var makeWelcome = function (welcome, ratio) {
|
|
|
140
142
|
marginBottom: remsToPixels(welcome.marginBottom, ratio),
|
|
141
143
|
titleMarginLeft: remsToPixels(welcome.titleMarginLeft, ratio),
|
|
142
144
|
titleSize: titleSize,
|
|
143
|
-
titleLineHeight: makeLineHeight(welcome.titleLineHeight, titleSize
|
|
145
|
+
titleLineHeight: makeLineHeight(welcome.titleLineHeight, titleSize),
|
|
144
146
|
subtitleSize: subtitleSize,
|
|
145
|
-
subtitleLineHeight: makeLineHeight(welcome.subtitleLineHeight, subtitleSize
|
|
147
|
+
subtitleLineHeight: makeLineHeight(welcome.subtitleLineHeight, subtitleSize),
|
|
146
148
|
subtitleMarginTop: remsToPixels(welcome.subtitleMarginTop, ratio)
|
|
147
149
|
};
|
|
148
150
|
};
|
|
@@ -177,7 +179,7 @@ export var decorateTheme = function (theme, dimensions, responsive) {
|
|
|
177
179
|
var inputs = makeInputs(theme.inputs, ratio);
|
|
178
180
|
var item = makeItems(theme.item, ratio);
|
|
179
181
|
var layout = layoutToPixels(theme.layout, ratio);
|
|
180
|
-
var lineHeight = makeLineHeight(theme.lineHeight, fonts.sizes.main
|
|
182
|
+
var lineHeight = makeLineHeight(theme.lineHeight, fonts.sizes.main);
|
|
181
183
|
var welcome = makeWelcomes(theme.welcome, ratio);
|
|
182
184
|
return __assign(__assign({}, theme), { border: border, buttons: buttons, cards: cards, counts: counts, fonts: fonts, inputs: inputs, item: item, lineHeight: lineHeight, layout: layout, welcome: welcome });
|
|
183
185
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|