@open-tender/store 0.5.10 → 0.5.12

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 CHANGED
Binary file
@@ -1,5 +1,5 @@
1
1
  import { RequestedAt } from '../datetimes';
2
- import { Decimal, Money, ServiceType, TaxTypeInt, Temperature } from '../global';
2
+ import { Decimal, Money, OrderType, ServiceType, TaxTypeInt, Temperature } from '../global';
3
3
  export interface NutritionalInfo {
4
4
  calories: number;
5
5
  cholesterol: number;
@@ -115,6 +115,7 @@ export interface MenuCategory {
115
115
  items: MenuItems;
116
116
  large_image_url: string | null;
117
117
  name: string;
118
+ order_type: OrderType;
118
119
  pos_display_color: string;
119
120
  pos_display_order: number;
120
121
  pos_section_id: number;
@@ -1,8 +1,8 @@
1
- import { Dimensions, HEX, Rems, ThemeCloud } from '../types';
1
+ import { HEX, Rems, ThemeCloud } from '../types';
2
+ export declare const hexToRgbA: (hex: HEX, opacity: string) => string | null;
2
3
  export declare const remsToPixels: (rems: string, ratio: number) => string;
3
4
  export declare const remsToNumber: (rems: Rems) => number;
4
5
  export declare const makeRatio: (width: number, height: number) => number;
5
6
  export declare const makeWidthRatio: (width: number) => number;
6
7
  export declare const makeHeightRatio: (height: number) => number;
7
- export declare const decorateTheme: (theme: ThemeCloud, dimensions: Dimensions, responsive?: boolean) => ThemeCloud;
8
- export declare function hexToRgbA(hex: HEX, opacity: string): string | null;
8
+ export declare const decorateTheme: (theme: ThemeCloud, ratio: number) => ThemeCloud;
@@ -1,7 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hexToRgbA = exports.decorateTheme = exports.makeHeightRatio = exports.makeWidthRatio = exports.makeRatio = exports.remsToNumber = exports.remsToPixels = void 0;
3
+ exports.decorateTheme = exports.makeHeightRatio = exports.makeWidthRatio = exports.makeRatio = exports.remsToNumber = exports.remsToPixels = exports.hexToRgbA = void 0;
4
4
  var tslib_1 = require("tslib");
5
+ var hexToRgbA = function (hex, opacity) {
6
+ var c;
7
+ if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {
8
+ c = hex.substring(1).split('');
9
+ if (c.length === 3) {
10
+ c = [c[0], c[0], c[1], c[1], c[2], c[2]];
11
+ }
12
+ c = '0x' + c.join('');
13
+ return ('rgba(' +
14
+ [(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',') +
15
+ ",".concat(opacity, ")"));
16
+ }
17
+ return null;
18
+ };
19
+ exports.hexToRgbA = hexToRgbA;
5
20
  var remsToPixels = function (rems, ratio) {
6
21
  var pixels = parseFloat(rems.replace('rem', '')) * 10;
7
22
  var adjustedPixels = pixels * ratio;
@@ -174,11 +189,7 @@ var makeHeightRatio = function (height) {
174
189
  return height / DEFAULT_HEIGHT;
175
190
  };
176
191
  exports.makeHeightRatio = makeHeightRatio;
177
- var decorateTheme = function (theme, dimensions, responsive) {
178
- if (responsive === void 0) { responsive = true; }
179
- var width = dimensions.width;
180
- // const ratio = responsive ? makeRatio(width, height) : 1.0
181
- var ratio = responsive ? (0, exports.makeWidthRatio)(width) : 1.0;
192
+ var decorateTheme = function (theme, ratio) {
182
193
  var border = makeBorder(theme.border, ratio);
183
194
  var buttons = makeButtons(theme.buttons, ratio);
184
195
  var cards = makeCards(theme.cards, ratio);
@@ -192,18 +203,3 @@ var decorateTheme = function (theme, dimensions, responsive) {
192
203
  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 });
193
204
  };
194
205
  exports.decorateTheme = decorateTheme;
195
- function hexToRgbA(hex, opacity) {
196
- var c;
197
- if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {
198
- c = hex.substring(1).split('');
199
- if (c.length === 3) {
200
- c = [c[0], c[0], c[1], c[1], c[2], c[2]];
201
- }
202
- c = '0x' + c.join('');
203
- return ('rgba(' +
204
- [(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',') +
205
- ",".concat(opacity, ")"));
206
- }
207
- return null;
208
- }
209
- exports.hexToRgbA = hexToRgbA;
@@ -1,5 +1,5 @@
1
1
  import { RequestedAt } from '../datetimes';
2
- import { Decimal, Money, ServiceType, TaxTypeInt, Temperature } from '../global';
2
+ import { Decimal, Money, OrderType, ServiceType, TaxTypeInt, Temperature } from '../global';
3
3
  export interface NutritionalInfo {
4
4
  calories: number;
5
5
  cholesterol: number;
@@ -115,6 +115,7 @@ export interface MenuCategory {
115
115
  items: MenuItems;
116
116
  large_image_url: string | null;
117
117
  name: string;
118
+ order_type: OrderType;
118
119
  pos_display_color: string;
119
120
  pos_display_order: number;
120
121
  pos_section_id: number;
@@ -1,8 +1,8 @@
1
- import { Dimensions, HEX, Rems, ThemeCloud } from '../types';
1
+ import { HEX, Rems, ThemeCloud } from '../types';
2
+ export declare const hexToRgbA: (hex: HEX, opacity: string) => string | null;
2
3
  export declare const remsToPixels: (rems: string, ratio: number) => string;
3
4
  export declare const remsToNumber: (rems: Rems) => number;
4
5
  export declare const makeRatio: (width: number, height: number) => number;
5
6
  export declare const makeWidthRatio: (width: number) => number;
6
7
  export declare const makeHeightRatio: (height: number) => number;
7
- export declare const decorateTheme: (theme: ThemeCloud, dimensions: Dimensions, responsive?: boolean) => ThemeCloud;
8
- export declare function hexToRgbA(hex: HEX, opacity: string): string | null;
8
+ export declare const decorateTheme: (theme: ThemeCloud, ratio: number) => ThemeCloud;
@@ -1,4 +1,18 @@
1
1
  import { __assign } from "tslib";
2
+ export var hexToRgbA = function (hex, opacity) {
3
+ var c;
4
+ if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {
5
+ c = hex.substring(1).split('');
6
+ if (c.length === 3) {
7
+ c = [c[0], c[0], c[1], c[1], c[2], c[2]];
8
+ }
9
+ c = '0x' + c.join('');
10
+ return ('rgba(' +
11
+ [(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',') +
12
+ ",".concat(opacity, ")"));
13
+ }
14
+ return null;
15
+ };
2
16
  export var remsToPixels = function (rems, ratio) {
3
17
  var pixels = parseFloat(rems.replace('rem', '')) * 10;
4
18
  var adjustedPixels = pixels * ratio;
@@ -166,11 +180,7 @@ export var makeWidthRatio = function (width) {
166
180
  export var makeHeightRatio = function (height) {
167
181
  return height / DEFAULT_HEIGHT;
168
182
  };
169
- export var decorateTheme = function (theme, dimensions, responsive) {
170
- if (responsive === void 0) { responsive = true; }
171
- var width = dimensions.width;
172
- // const ratio = responsive ? makeRatio(width, height) : 1.0
173
- var ratio = responsive ? makeWidthRatio(width) : 1.0;
183
+ export var decorateTheme = function (theme, ratio) {
174
184
  var border = makeBorder(theme.border, ratio);
175
185
  var buttons = makeButtons(theme.buttons, ratio);
176
186
  var cards = makeCards(theme.cards, ratio);
@@ -183,17 +193,3 @@ export var decorateTheme = function (theme, dimensions, responsive) {
183
193
  var welcome = makeWelcomes(theme.welcome, ratio);
184
194
  return __assign(__assign({}, theme), { border: border, buttons: buttons, cards: cards, counts: counts, fonts: fonts, inputs: inputs, item: item, lineHeight: lineHeight, layout: layout, welcome: welcome });
185
195
  };
186
- export function hexToRgbA(hex, opacity) {
187
- var c;
188
- if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {
189
- c = hex.substring(1).split('');
190
- if (c.length === 3) {
191
- c = [c[0], c[0], c[1], c[1], c[2], c[2]];
192
- }
193
- c = '0x' + c.join('');
194
- return ('rgba(' +
195
- [(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',') +
196
- ",".concat(opacity, ")"));
197
- }
198
- return null;
199
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/store",
3
- "version": "0.5.10",
3
+ "version": "0.5.12",
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",