@open-tender/utils 0.1.167 → 0.1.169
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/utils/theme.js +11 -1
- package/dist/esm/utils/theme.js +11 -1
- package/package.json +1 -1
package/dist/cjs/utils/theme.js
CHANGED
|
@@ -60,12 +60,16 @@ const buttonToPixels = (button) => {
|
|
|
60
60
|
? (0, exports.remsToPixels)(button.borderWidthApp)
|
|
61
61
|
: (0, exports.remsToPixels)(button.borderWidth), fontSize: button.fontSize ? (0, exports.remsToPixels)(button.fontSize, true) : null, letterSpacing: button.letterSpacing
|
|
62
62
|
? (0, exports.remsToPixels)(button.letterSpacing)
|
|
63
|
+
: null, minHeightMobile: button.minHeightMobile
|
|
64
|
+
? paddingToPixels(button.minHeightMobile)
|
|
63
65
|
: null, padding: button.padding ? paddingToPixels(button.padding) : null, subtitleFontSizeMobile: button.subtitleFontSizeMobile
|
|
64
66
|
? (0, exports.remsToPixels)(button.subtitleFontSizeMobile)
|
|
65
67
|
: null, subtitleMarginTopMobile: button.subtitleMarginTopMobile
|
|
66
68
|
? (0, exports.remsToPixels)(button.subtitleMarginTopMobile)
|
|
67
69
|
: null, titleFontSizeMobile: button.titleFontSizeMobile
|
|
68
70
|
? (0, exports.remsToPixels)(button.titleFontSizeMobile)
|
|
71
|
+
: null, titleMarginTopMobile: button.titleMarginTopMobile
|
|
72
|
+
? (0, exports.remsToPixels)(button.titleMarginTopMobile)
|
|
69
73
|
: null, titleMarginLeftMobile: button.titleMarginLeftMobile
|
|
70
74
|
? (0, exports.remsToPixels)(button.titleMarginLeftMobile)
|
|
71
75
|
: null });
|
|
@@ -183,6 +187,10 @@ const makeMenuItems = (menuItems, lineHeight) => {
|
|
|
183
187
|
title: Object.assign(Object.assign({}, title), { fontSize: (0, exports.remsToPixels)(title.fontSize), fontSizeMobile: (0, exports.remsToPixels)(title.fontSizeMobile), lineHeight: fontSizeToLineHeight(lineHeight, title.fontSizeMobile), padding: boxRemsToPixels(title.padding), paddingMobile: boxRemsToPixels(title.paddingMobile) })
|
|
184
188
|
};
|
|
185
189
|
};
|
|
190
|
+
const makeModifiers = (modifiers, lineHeight) => {
|
|
191
|
+
const { box, calories, content, image, price, text, title } = modifiers;
|
|
192
|
+
return Object.assign(Object.assign({}, modifiers), { box: Object.assign(Object.assign({}, box), { border: boxRemsToPixels(box.border), borderMobile: boxRemsToPixels(box.borderMobile), borderRadius: (0, exports.remsToPixels)(box.borderRadius), gap: (0, exports.remsToPixels)(box.gap), gapHalf: (0, exports.remsToPixels)(box.gapHalf), margin: boxRemsToPixels(box.margin), marginMobile: boxRemsToPixels(box.marginMobile), minHeight: (0, exports.remsToPixels)(box.minHeight), minHeightWithGap: (0, exports.remsToPixels)(box.minHeightWithGap), minWidth: (0, exports.remsToPixels)(box.minWidth), padding: boxRemsToPixels(box.padding), paddingMobile: boxRemsToPixels(box.paddingMobile) }), calories: Object.assign(Object.assign({}, calories), { fontSize: (0, exports.remsToPixels)(calories.fontSize), lineHeight: fontSizeToLineHeight(calories.fontSize, lineHeight) }), content: Object.assign(Object.assign({}, content), { padding: boxRemsToPixels(content.padding) }), image: Object.assign(Object.assign({}, image), { border: boxRemsToPixels(image.border), borderRadius: (0, exports.remsToPixels)(image.borderRadius), height: (0, exports.remsToPixels)(image.height), margin: boxRemsToPixels(image.margin), padding: boxRemsToPixels(image.padding), width: (0, exports.remsToPixels)(image.width) }), price: Object.assign(Object.assign({}, price), { fontSize: (0, exports.remsToPixels)(price.fontSize), lineHeight: fontSizeToLineHeight(price.fontSize, lineHeight) }), text: Object.assign(Object.assign({}, text), { fontSize: (0, exports.remsToPixels)(text.fontSize), lineHeight: fontSizeToLineHeight(text.fontSize, lineHeight) }), title: Object.assign(Object.assign({}, title), { fontSize: (0, exports.remsToPixels)(title.fontSize), lineHeight: fontSizeToLineHeight(title.fontSize, lineHeight) }) });
|
|
193
|
+
};
|
|
186
194
|
const makeLogo = (logo) => {
|
|
187
195
|
return {
|
|
188
196
|
marginTop: (0, exports.remsToPixels)(logo.marginTop),
|
|
@@ -206,10 +214,12 @@ const decorateTheme = (theme) => {
|
|
|
206
214
|
const item = makeItem(theme.item);
|
|
207
215
|
const categories = makeCategories(theme.categories);
|
|
208
216
|
const menuItems = makeMenuItems(theme.menuItems, theme.lineHeight);
|
|
217
|
+
const modifiers = makeModifiers(theme.modifiers, theme.lineHeight);
|
|
209
218
|
return Object.assign(Object.assign({}, theme), { logo,
|
|
210
219
|
logoFooter, fonts: fonts, lineHeight, layout: layout, buttons: buttons, border, inputs: inputs, counts,
|
|
211
220
|
cards, welcome: welcome, item: item, categories,
|
|
212
|
-
menuItems
|
|
221
|
+
menuItems,
|
|
222
|
+
modifiers });
|
|
213
223
|
};
|
|
214
224
|
exports.decorateTheme = decorateTheme;
|
|
215
225
|
const hexToRgbA = (hex, opacity) => {
|
package/dist/esm/utils/theme.js
CHANGED
|
@@ -51,12 +51,16 @@ const buttonToPixels = (button) => {
|
|
|
51
51
|
? remsToPixels(button.borderWidthApp)
|
|
52
52
|
: remsToPixels(button.borderWidth), fontSize: button.fontSize ? remsToPixels(button.fontSize, true) : null, letterSpacing: button.letterSpacing
|
|
53
53
|
? remsToPixels(button.letterSpacing)
|
|
54
|
+
: null, minHeightMobile: button.minHeightMobile
|
|
55
|
+
? paddingToPixels(button.minHeightMobile)
|
|
54
56
|
: null, padding: button.padding ? paddingToPixels(button.padding) : null, subtitleFontSizeMobile: button.subtitleFontSizeMobile
|
|
55
57
|
? remsToPixels(button.subtitleFontSizeMobile)
|
|
56
58
|
: null, subtitleMarginTopMobile: button.subtitleMarginTopMobile
|
|
57
59
|
? remsToPixels(button.subtitleMarginTopMobile)
|
|
58
60
|
: null, titleFontSizeMobile: button.titleFontSizeMobile
|
|
59
61
|
? remsToPixels(button.titleFontSizeMobile)
|
|
62
|
+
: null, titleMarginTopMobile: button.titleMarginTopMobile
|
|
63
|
+
? remsToPixels(button.titleMarginTopMobile)
|
|
60
64
|
: null, titleMarginLeftMobile: button.titleMarginLeftMobile
|
|
61
65
|
? remsToPixels(button.titleMarginLeftMobile)
|
|
62
66
|
: null });
|
|
@@ -174,6 +178,10 @@ const makeMenuItems = (menuItems, lineHeight) => {
|
|
|
174
178
|
title: Object.assign(Object.assign({}, title), { fontSize: remsToPixels(title.fontSize), fontSizeMobile: remsToPixels(title.fontSizeMobile), lineHeight: fontSizeToLineHeight(lineHeight, title.fontSizeMobile), padding: boxRemsToPixels(title.padding), paddingMobile: boxRemsToPixels(title.paddingMobile) })
|
|
175
179
|
};
|
|
176
180
|
};
|
|
181
|
+
const makeModifiers = (modifiers, lineHeight) => {
|
|
182
|
+
const { box, calories, content, image, price, text, title } = modifiers;
|
|
183
|
+
return Object.assign(Object.assign({}, modifiers), { box: Object.assign(Object.assign({}, box), { border: boxRemsToPixels(box.border), borderMobile: boxRemsToPixels(box.borderMobile), borderRadius: remsToPixels(box.borderRadius), gap: remsToPixels(box.gap), gapHalf: remsToPixels(box.gapHalf), margin: boxRemsToPixels(box.margin), marginMobile: boxRemsToPixels(box.marginMobile), minHeight: remsToPixels(box.minHeight), minHeightWithGap: remsToPixels(box.minHeightWithGap), minWidth: remsToPixels(box.minWidth), padding: boxRemsToPixels(box.padding), paddingMobile: boxRemsToPixels(box.paddingMobile) }), calories: Object.assign(Object.assign({}, calories), { fontSize: remsToPixels(calories.fontSize), lineHeight: fontSizeToLineHeight(calories.fontSize, lineHeight) }), content: Object.assign(Object.assign({}, content), { padding: boxRemsToPixels(content.padding) }), image: Object.assign(Object.assign({}, image), { border: boxRemsToPixels(image.border), borderRadius: remsToPixels(image.borderRadius), height: remsToPixels(image.height), margin: boxRemsToPixels(image.margin), padding: boxRemsToPixels(image.padding), width: remsToPixels(image.width) }), price: Object.assign(Object.assign({}, price), { fontSize: remsToPixels(price.fontSize), lineHeight: fontSizeToLineHeight(price.fontSize, lineHeight) }), text: Object.assign(Object.assign({}, text), { fontSize: remsToPixels(text.fontSize), lineHeight: fontSizeToLineHeight(text.fontSize, lineHeight) }), title: Object.assign(Object.assign({}, title), { fontSize: remsToPixels(title.fontSize), lineHeight: fontSizeToLineHeight(title.fontSize, lineHeight) }) });
|
|
184
|
+
};
|
|
177
185
|
const makeLogo = (logo) => {
|
|
178
186
|
return {
|
|
179
187
|
marginTop: remsToPixels(logo.marginTop),
|
|
@@ -197,10 +205,12 @@ export const decorateTheme = (theme) => {
|
|
|
197
205
|
const item = makeItem(theme.item);
|
|
198
206
|
const categories = makeCategories(theme.categories);
|
|
199
207
|
const menuItems = makeMenuItems(theme.menuItems, theme.lineHeight);
|
|
208
|
+
const modifiers = makeModifiers(theme.modifiers, theme.lineHeight);
|
|
200
209
|
return Object.assign(Object.assign({}, theme), { logo,
|
|
201
210
|
logoFooter, fonts: fonts, lineHeight, layout: layout, buttons: buttons, border, inputs: inputs, counts,
|
|
202
211
|
cards, welcome: welcome, item: item, categories,
|
|
203
|
-
menuItems
|
|
212
|
+
menuItems,
|
|
213
|
+
modifiers });
|
|
204
214
|
};
|
|
205
215
|
export const hexToRgbA = (hex, opacity) => {
|
|
206
216
|
let c;
|
package/package.json
CHANGED