@open-tender/store 0.5.0 → 0.5.1

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 ADDED
Binary file
@@ -1,4 +1,4 @@
1
- import { KioskBrand, KioskContent, KioskTheme, RequestError, RequestStatus, Store } from '../types';
1
+ import { KioskBrand, KioskContent, ThemeCloud, RequestError, RequestStatus, Store } from '../types';
2
2
  import { AppState } from '../app';
3
3
  export interface KioskApp {
4
4
  apiUrl: string;
@@ -11,7 +11,7 @@ export interface KioskState {
11
11
  revenueCenterId: number | null;
12
12
  brand: KioskBrand | null;
13
13
  content: KioskContent | null;
14
- theme: KioskTheme | null;
14
+ theme: ThemeCloud | null;
15
15
  loading: RequestStatus;
16
16
  error: RequestError | null;
17
17
  retries: number;
@@ -24,3 +24,4 @@ export * from './settings';
24
24
  export * from './store';
25
25
  export * from './surcharges';
26
26
  export * from './taxes';
27
+ export * from './themeCloud';
@@ -27,3 +27,4 @@ tslib_1.__exportStar(require("./settings"), exports);
27
27
  tslib_1.__exportStar(require("./store"), exports);
28
28
  tslib_1.__exportStar(require("./surcharges"), exports);
29
29
  tslib_1.__exportStar(require("./taxes"), exports);
30
+ tslib_1.__exportStar(require("./themeCloud"), exports);
@@ -1,8 +1,12 @@
1
+ import { ThemeCloud } from './themeCloud';
2
+ export interface Dimensions {
3
+ width: number;
4
+ height: number;
5
+ }
1
6
  export declare type KioskBrand = Record<string, unknown>;
2
7
  export declare type KioskContent = Record<string, unknown>;
3
- export declare type KioskTheme = Record<string, unknown>;
4
8
  export interface KioskConfig {
5
9
  brand: KioskBrand;
6
10
  content: KioskContent;
7
- theme: KioskTheme;
11
+ theme: ThemeCloud;
8
12
  }
@@ -0,0 +1,344 @@
1
+ export declare type RGBA = `rgba(${number}, ${number}, ${number}, ${number})` | 'none';
2
+ export declare type HEX = `#${string}` | 'transparent';
3
+ export declare type Pixels = `${string}px`;
4
+ export declare type Rems = `${string}rem`;
5
+ export declare type PaddingRems = `${Rems} ${Rems} ${Rems}`;
6
+ export interface TCMessageColor {
7
+ bgColor: HEX;
8
+ color: HEX;
9
+ }
10
+ export interface TCBgColors {
11
+ alert: HEX;
12
+ allergens: HEX;
13
+ dark: HEX;
14
+ error: HEX;
15
+ highlight: HEX;
16
+ light: HEX;
17
+ primary: HEX;
18
+ secondary: HEX;
19
+ success: HEX;
20
+ tertiary: HEX;
21
+ toast: HEX;
22
+ }
23
+ export declare type TCBoldWeight = string;
24
+ export interface TCBorder {
25
+ color: HEX;
26
+ radius: string;
27
+ radiusSmall: string;
28
+ width: string;
29
+ widthApp: string;
30
+ }
31
+ export interface TCBoxShadow {
32
+ appBig: string;
33
+ appSmall: string;
34
+ inset: string;
35
+ outer: string;
36
+ }
37
+ export interface TCBreakpoints {
38
+ laptop: string;
39
+ mobile: string;
40
+ narrow: string;
41
+ tablet: string;
42
+ }
43
+ export interface TCButtonColor {
44
+ bgColor: HEX;
45
+ borderColor: HEX;
46
+ color: HEX;
47
+ iconColor?: HEX;
48
+ subtitleColor?: HEX;
49
+ }
50
+ export interface TCButtonColors {
51
+ cart: TCButtonColor;
52
+ cartHover: TCButtonColor;
53
+ header: TCButtonColor;
54
+ headerHover: TCButtonColor;
55
+ large: TCButtonColor;
56
+ largeHover: TCButtonColor;
57
+ light: TCButtonColor;
58
+ lightHover: TCButtonColor;
59
+ primary: TCButtonColor;
60
+ primaryHover: TCButtonColor;
61
+ secondary: TCButtonColor;
62
+ secondaryHover: TCButtonColor;
63
+ }
64
+ export interface TCButtonSize {
65
+ borderRadius: string;
66
+ borderWidth: string;
67
+ borderWidthApp: string;
68
+ family: string;
69
+ fontMobile: string;
70
+ fontSize: string;
71
+ fontSmoothing: string;
72
+ letterSpacing: string;
73
+ padding: string;
74
+ textTransform: string;
75
+ weight: string;
76
+ }
77
+ export interface TCButtonLargeSize {
78
+ borderRadius: string;
79
+ borderWidth: string;
80
+ borderWidthApp: string;
81
+ fontSize: string;
82
+ letterSpacing: string;
83
+ padding: string;
84
+ showButtonApp: boolean;
85
+ showSubtitle: boolean;
86
+ showSubtitleMobile: boolean;
87
+ subtitleFontMobile: string;
88
+ subtitleFontSize: string;
89
+ subtitleFontSizeMobile: string;
90
+ subtitleFontWeight: string;
91
+ subtitleMarginTop: string;
92
+ subtitleMarginTopMobile: string;
93
+ titleFontMobile: string;
94
+ titleFontSize: string;
95
+ titleFontSizeMobile: string;
96
+ titleFontWeight: string;
97
+ titleMarginLeft: string;
98
+ titleMarginLeftMobile: string;
99
+ }
100
+ export interface TCButtonSizes {
101
+ big: TCButtonSize;
102
+ default: TCButtonSize;
103
+ header: TCButtonSize;
104
+ large: TCButtonLargeSize;
105
+ small: TCButtonSize;
106
+ }
107
+ export interface TCButtons {
108
+ colors: TCButtonColors;
109
+ sizes: TCButtonSizes;
110
+ }
111
+ export interface TCCard {
112
+ bgColor: HEX;
113
+ borderColor: HEX;
114
+ borderRadius: string;
115
+ borderWidth: string;
116
+ borderWidthApp: string;
117
+ boxShadow: string;
118
+ overrideFontColors: boolean;
119
+ textColor: HEX;
120
+ titleColor: HEX;
121
+ }
122
+ export interface TCCards {
123
+ default: TCCard;
124
+ form: TCCard;
125
+ menuItem: TCCard;
126
+ modifier: TCCard;
127
+ }
128
+ export interface TCColors {
129
+ alert: HEX;
130
+ allergens: HEX;
131
+ dark: HEX;
132
+ error: HEX;
133
+ light: HEX;
134
+ primary: HEX;
135
+ secondary: HEX;
136
+ success: HEX;
137
+ tags: HEX;
138
+ tertiary: HEX;
139
+ title: HEX;
140
+ toast: HEX;
141
+ }
142
+ export interface TCCount {
143
+ bgColor?: HEX;
144
+ borderColor?: HEX;
145
+ borderWidth?: string;
146
+ borderWidthApp?: string;
147
+ color?: HEX;
148
+ family: string;
149
+ fontMobile: string;
150
+ fontSize: string;
151
+ fontSizeMobile: string;
152
+ fontSmoothing: string;
153
+ paddingBottom: string;
154
+ paddingTop: string;
155
+ weight: string;
156
+ }
157
+ export interface TCCounts {
158
+ alerts: TCCount;
159
+ quantity: TCCount;
160
+ }
161
+ export interface TCFavorite {
162
+ iconSize: string;
163
+ size: string;
164
+ }
165
+ export interface TCFont {
166
+ color?: HEX;
167
+ family: string;
168
+ fontMobile: string;
169
+ fontSize?: string;
170
+ fontSmoothing: string;
171
+ letterSpacing: string;
172
+ lineHeight: number;
173
+ textTransform: string;
174
+ url?: string;
175
+ weight: string;
176
+ }
177
+ export interface TCFontSizes {
178
+ big: string;
179
+ giga: string;
180
+ h1: string;
181
+ h2: string;
182
+ h3: string;
183
+ h4: string;
184
+ h5: string;
185
+ h6: string;
186
+ main: string;
187
+ mega: string;
188
+ small: string;
189
+ tera: string;
190
+ xBig: string;
191
+ xSmall: string;
192
+ xxBig: string;
193
+ xxSmall: string;
194
+ }
195
+ export interface TCFonts {
196
+ body: TCFont;
197
+ headings: TCFont;
198
+ headline: TCFont;
199
+ preface: TCFont;
200
+ sizes: TCFontSizes;
201
+ }
202
+ export interface TCHeader {
203
+ primary: HEX;
204
+ stuck: HEX;
205
+ }
206
+ export interface TCIcons {
207
+ strokeWidth: number;
208
+ }
209
+ export interface TCInputLabel {
210
+ fontSize: string;
211
+ fontSizeMobile: string;
212
+ left: string;
213
+ offset: string;
214
+ padding: string;
215
+ top: string;
216
+ }
217
+ export interface TCInputs {
218
+ bgColor: HEX;
219
+ bgColorFocus: HEX;
220
+ borderColor: HEX;
221
+ borderColorFocus: HEX;
222
+ borderStyle: string;
223
+ borderWidth: string;
224
+ borderWidthApp: string;
225
+ bottomBorderOnly: boolean;
226
+ boxShadow: string;
227
+ color: HEX;
228
+ colorFocus: HEX;
229
+ family: string;
230
+ fontMobile: string;
231
+ fontSize: string;
232
+ fontSizeMobile: string;
233
+ fontSmoothing: string;
234
+ iconLeft: string;
235
+ iconPadding: string;
236
+ label: TCInputLabel;
237
+ letterSpacing: string;
238
+ lineHeight: string;
239
+ padding: string;
240
+ paddingBottom: string;
241
+ paddingBottomActive: string;
242
+ paddingHorizontal: string;
243
+ paddingTop: string;
244
+ paddingTopActive: string;
245
+ paddingVertical: string;
246
+ placeholderColor: HEX;
247
+ radius: string;
248
+ selectPaddingBottom: string;
249
+ selectSize: string;
250
+ selectSizeMobile: string;
251
+ showIcon: boolean;
252
+ showLabel: boolean;
253
+ showOutline: boolean;
254
+ textTransform: string;
255
+ weight: string;
256
+ }
257
+ export interface TCItem {
258
+ imageHeight: string;
259
+ imageMaxHeight: string;
260
+ imageMinHeight: string;
261
+ imagePadding: string;
262
+ maxWidth: string;
263
+ padding: string;
264
+ }
265
+ export interface TCItems {
266
+ desktop: TCItem;
267
+ mobile: TCItem;
268
+ }
269
+ export interface TCLayout {
270
+ containerMaxWidth: string;
271
+ headerHeightApp: string;
272
+ headerHeightSite: string;
273
+ headerHeightSiteMobile: string;
274
+ margin: string;
275
+ marginMobile: string;
276
+ maxWidth: string;
277
+ navHeight: string;
278
+ navHeightApp: string;
279
+ navHeightMobile: string;
280
+ padding: string;
281
+ paddingMobile: string;
282
+ }
283
+ export declare type TCLineHeight = string;
284
+ export interface TCLinkColor {
285
+ color: HEX;
286
+ hover: HEX;
287
+ }
288
+ export declare type TCLinkDecoration = 'none' | 'underline' | 'line-through' | 'overline' | 'inherit';
289
+ export interface TCLinks {
290
+ dark: TCLinkColor;
291
+ light: TCLinkColor;
292
+ primary: TCLinkColor;
293
+ textDecoration: TCLinkDecoration;
294
+ transition: string;
295
+ }
296
+ export interface TCOverlay {
297
+ alert: RGBA;
298
+ dark: RGBA;
299
+ light: RGBA;
300
+ primary: RGBA;
301
+ secondary: RGBA;
302
+ tertiary: RGBA;
303
+ }
304
+ export declare type TCTextAlign = 'left' | 'right' | 'center';
305
+ export interface TCWelcome {
306
+ marginBottom: string;
307
+ marginTop: string;
308
+ subtitleLineHeight: number;
309
+ subtitleMarginTop: string;
310
+ subtitleSize: string;
311
+ textAlign: TCTextAlign;
312
+ titleLineHeight: number;
313
+ titleMarginLeft: string;
314
+ titleSize: string;
315
+ }
316
+ export interface TCWelcomes {
317
+ desktop: TCWelcome;
318
+ mobile: TCWelcome;
319
+ }
320
+ export interface ThemeCloud {
321
+ alert: TCMessageColor;
322
+ bgColors: TCBgColors;
323
+ boldWeight: TCBoldWeight;
324
+ border: TCBorder;
325
+ boxShadow: TCBoxShadow;
326
+ breakpoints: TCBreakpoints;
327
+ buttons: TCButtons;
328
+ cards: TCCards;
329
+ colors: TCColors;
330
+ counts: TCCounts;
331
+ error: TCMessageColor;
332
+ fonts: TCFonts;
333
+ header: TCHeader;
334
+ icons: TCIcons;
335
+ inputs: TCInputs;
336
+ item: TCItems;
337
+ layout: TCLayout;
338
+ lineHeight: TCLineHeight;
339
+ links: TCLinks;
340
+ overlay: TCOverlay;
341
+ success: TCMessageColor;
342
+ toast: TCMessageColor;
343
+ welcome: TCWelcomes;
344
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -11,7 +11,8 @@ export declare const addCommas: (x: number, d: number) => string;
11
11
  export declare const formatQuantity: (n: string | number) => string;
12
12
  export declare const formatDollars: (n: string | number, space?: string, decimals?: number) => string;
13
13
  export declare const remsToInt: (rems: string) => number;
14
- export declare const pixelsToInt: (rems: string) => number;
14
+ export declare const pixelsToInt: (pixels: string) => number;
15
+ export declare const pixelsToFloat: (pixels: string) => number;
15
16
  export declare const handleRespError: (err: RequestErrorAPI | string) => {
16
17
  title: string;
17
18
  detail: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.throttle = exports.makeContrastColor = exports.hexToRgb = exports.handleRespError = exports.pixelsToInt = exports.remsToInt = exports.formatDollars = exports.formatQuantity = exports.addCommas = exports.capitalize = exports.serialize = exports.convertStringToArray = exports.getHeight = exports.getWidth = exports.makeRandomNumberString = exports.contains = exports.isEmpty = void 0;
3
+ exports.throttle = exports.makeContrastColor = exports.hexToRgb = exports.handleRespError = exports.pixelsToFloat = exports.pixelsToInt = exports.remsToInt = exports.formatDollars = exports.formatQuantity = exports.addCommas = exports.capitalize = exports.serialize = exports.convertStringToArray = exports.getHeight = exports.getWidth = exports.makeRandomNumberString = exports.contains = exports.isEmpty = void 0;
4
4
  var tslib_1 = require("tslib");
5
5
  var isEmpty = function (obj) {
6
6
  return (!obj || (obj.constructor === Object && Object.entries(obj).length === 0));
@@ -69,10 +69,14 @@ var remsToInt = function (rems) {
69
69
  return parseInt((parseFloat(rems.replace('rem', '')) * 10).toString());
70
70
  };
71
71
  exports.remsToInt = remsToInt;
72
- var pixelsToInt = function (rems) {
73
- return parseInt(parseFloat(rems.replace('px', '')).toString());
72
+ var pixelsToInt = function (pixels) {
73
+ return parseInt(parseFloat(pixels.replace('px', '')).toString());
74
74
  };
75
75
  exports.pixelsToInt = pixelsToInt;
76
+ var pixelsToFloat = function (pixels) {
77
+ return parseFloat(pixels.replace('px', ''));
78
+ };
79
+ exports.pixelsToFloat = pixelsToFloat;
76
80
  var handleRespError = function (err) {
77
81
  if (typeof err === 'string') {
78
82
  return { title: 'Something went wrong', detail: err };
@@ -8,3 +8,4 @@ export * from './pos';
8
8
  export * from './punches';
9
9
  export * from './refunds';
10
10
  export * from './theme';
11
+ export * from './themeCloud';
@@ -11,3 +11,4 @@ tslib_1.__exportStar(require("./pos"), exports);
11
11
  tslib_1.__exportStar(require("./punches"), exports);
12
12
  tslib_1.__exportStar(require("./refunds"), exports);
13
13
  tslib_1.__exportStar(require("./theme"), exports);
14
+ tslib_1.__exportStar(require("./themeCloud"), exports);