ordering-ui-external 1.6.4 → 1.6.5
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/_bundles/{0.ordering-ui.2b0f914882a17cd0b389.js → 0.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{1.ordering-ui.2b0f914882a17cd0b389.js → 1.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{2.ordering-ui.2b0f914882a17cd0b389.js → 2.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{4.ordering-ui.2b0f914882a17cd0b389.js → 4.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{5.ordering-ui.2b0f914882a17cd0b389.js → 5.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{6.ordering-ui.2b0f914882a17cd0b389.js → 6.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{7.ordering-ui.2b0f914882a17cd0b389.js → 7.ordering-ui.bc9da3762eb1b844224f.js} +1 -1
- package/_bundles/{7.ordering-ui.2b0f914882a17cd0b389.js.LICENSE.txt → 7.ordering-ui.bc9da3762eb1b844224f.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.2b0f914882a17cd0b389.js → 8.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{9.ordering-ui.2b0f914882a17cd0b389.js → 9.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{ordering-ui.2b0f914882a17cd0b389.js → ordering-ui.bc9da3762eb1b844224f.js} +2 -2
- package/_bundles/{ordering-ui.2b0f914882a17cd0b389.js.LICENSE.txt → ordering-ui.bc9da3762eb1b844224f.js.LICENSE.txt} +0 -0
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +8 -3
- package/_modules/themes/five/src/components/BusinessController/index.js +2 -2
- package/_modules/themes/five/src/components/BusinessController/styles.js +2 -2
- package/_modules/utils/index.js +27 -16
- package/package.json +1 -1
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +26 -0
- package/src/themes/five/src/components/BusinessController/index.js +3 -3
- package/src/themes/five/src/components/BusinessController/styles.js +2 -2
- package/src/utils/index.js +32 -27
|
File without changes
|
|
@@ -4,10 +4,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.WrapperSearch = exports.WrapperBusinessLogo = exports.TitleWrapper = exports.SocialList = exports.SearchIconWrapper = exports.SearchComponentContainer = exports.RibbonBox = exports.IconWrapper = exports.BusinessMoreDetail = exports.BusinessLogo = exports.BusinessInfoWrapper = exports.BusinessInfoItem = exports.BusinessInfoContent = exports.BusinessInfoContainer = exports.BusinessInfo = exports.BusinessDetail = exports.BusinessContent = exports.BusinessContainer = void 0;
|
|
7
|
+
exports.WrapperSearch = exports.WrapperFloatingSearch = exports.WrapperBusinessLogo = exports.TitleWrapper = exports.SocialList = exports.SearchIconWrapper = exports.SearchComponentContainer = exports.RibbonBox = exports.IconWrapper = exports.BusinessMoreDetail = exports.BusinessLogo = exports.BusinessInfoWrapper = exports.BusinessInfoItem = exports.BusinessInfoContent = exports.BusinessInfoContainer = exports.BusinessInfo = exports.BusinessDetail = exports.BusinessContent = exports.BusinessContainer = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37, _templateObject38, _templateObject39, _templateObject40, _templateObject41, _templateObject42;
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37, _templateObject38, _templateObject39, _templateObject40, _templateObject41, _templateObject42, _templateObject43;
|
|
11
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -148,4 +148,9 @@ var IconWrapper = _styledComponents.default.a(_templateObject40 || (_templateObj
|
|
|
148
148
|
});
|
|
149
149
|
exports.IconWrapper = IconWrapper;
|
|
150
150
|
var BusinessInfoWrapper = _styledComponents.default.div(_templateObject42 || (_templateObject42 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column-reverse;\n @media (min-width: 768px) {\n flex-direction: column;\n }\n"])));
|
|
151
|
-
exports.BusinessInfoWrapper = BusinessInfoWrapper;
|
|
151
|
+
exports.BusinessInfoWrapper = BusinessInfoWrapper;
|
|
152
|
+
var WrapperFloatingSearch = _styledComponents.default.div(_templateObject43 || (_templateObject43 = _taggedTemplateLiteral(["\n position: absolute;\n color: ", ";\n display: flex;\n background: rgba(0,0,0,0.2);\n top: 80px;\n right: 10px;\n width: 80%;\n border-bottom: 1px solid #FFFFFF;\n #select-input {\n color: #FFFFFF !important;\n background: transparent;\n }\n svg, span {\n color: #FFFFFF !important;\n }\n @media (min-width: 681px){\n top: 23px;\n right: 60px;\n width: 300px;\n input {\n width: 80%;\n }\n }\n"])), function (_ref11) {
|
|
153
|
+
var theme = _ref11.theme;
|
|
154
|
+
return theme.colors.white;
|
|
155
|
+
});
|
|
156
|
+
exports.WrapperFloatingSearch = WrapperFloatingSearch;
|
|
@@ -165,8 +165,8 @@ var BusinessControllerUI = function BusinessControllerUI(props) {
|
|
|
165
165
|
}
|
|
166
166
|
}, (business === null || business === void 0 ? void 0 : (_business$ribbon = business.ribbon) === null || _business$ribbon === void 0 ? void 0 : _business$ribbon.enabled) && /*#__PURE__*/_react.default.createElement(_styles.RibbonBox, {
|
|
167
167
|
bgColor: business === null || business === void 0 ? void 0 : (_business$ribbon2 = business.ribbon) === null || _business$ribbon2 === void 0 ? void 0 : _business$ribbon2.color,
|
|
168
|
-
colorText: (0, _utils.
|
|
169
|
-
borderRibbon: (0, _utils.
|
|
168
|
+
colorText: (0, _utils.lightenDarkenColor)(business === null || business === void 0 ? void 0 : (_business$ribbon3 = business.ribbon) === null || _business$ribbon3 === void 0 ? void 0 : _business$ribbon3.color, -200),
|
|
169
|
+
borderRibbon: (0, _utils.lightenDarkenColor)(business === null || business === void 0 ? void 0 : (_business$ribbon4 = business.ribbon) === null || _business$ribbon4 === void 0 ? void 0 : _business$ribbon4.color, -200),
|
|
170
170
|
isRoundRect: (business === null || business === void 0 ? void 0 : (_business$ribbon5 = business.ribbon) === null || _business$ribbon5 === void 0 ? void 0 : _business$ribbon5.shape) === (_utils.shape === null || _utils.shape === void 0 ? void 0 : _utils.shape.rectangleRound),
|
|
171
171
|
isCapsule: (business === null || business === void 0 ? void 0 : (_business$ribbon6 = business.ribbon) === null || _business$ribbon6 === void 0 ? void 0 : _business$ribbon6.shape) === (_utils.shape === null || _utils.shape === void 0 ? void 0 : _utils.shape.capsuleShape)
|
|
172
172
|
}, business === null || business === void 0 ? void 0 : (_business$ribbon7 = business.ribbon) === null || _business$ribbon7 === void 0 ? void 0 : _business$ribbon7.text), /*#__PURE__*/_react.default.createElement(_styles.BusinessHero, null, isSkeleton ? /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
@@ -160,10 +160,10 @@ var RibbonBox = _styledComponents.default.div(_templateObject40 || (_templateObj
|
|
|
160
160
|
return isCapsule && (0, _styledComponents.css)(_templateObject44 || (_templateObject44 = _taggedTemplateLiteral(["\n border-radius: 50px;\n "])));
|
|
161
161
|
}, function (_ref21) {
|
|
162
162
|
var colorText = _ref21.colorText;
|
|
163
|
-
return colorText && (0, _styledComponents.css)(_templateObject45 || (_templateObject45 = _taggedTemplateLiteral(["\n color: ", ";\n "])), colorText);
|
|
163
|
+
return colorText && (0, _styledComponents.css)(_templateObject45 || (_templateObject45 = _taggedTemplateLiteral(["\n color: ", ";\n "])), colorText ? 'black' : 'white');
|
|
164
164
|
}, function (_ref22) {
|
|
165
165
|
var borderRibbon = _ref22.borderRibbon;
|
|
166
|
-
return borderRibbon && (0, _styledComponents.css)(_templateObject46 || (_templateObject46 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), borderRibbon);
|
|
166
|
+
return borderRibbon && (0, _styledComponents.css)(_templateObject46 || (_templateObject46 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), borderRibbon ? 'black' : 'white');
|
|
167
167
|
});
|
|
168
168
|
exports.RibbonBox = RibbonBox;
|
|
169
169
|
var FavoriteWrapper = _styledComponents.default.div(_templateObject47 || (_templateObject47 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n margin-left: 15px;\n ", "\n\n svg {\n font-size: 16px;\n color: ", ";\n }\n"])), function (props) {
|
package/_modules/utils/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.verifyDecimals = exports.sortInputFields = exports.shape = exports.scrollTo = exports.reviewCommentList = exports.priceList = exports.getTraduction = exports.getIconCard = exports.getHourMin = exports.getGoogleMapImage = exports.getDistance = exports.formatUrlVideo = exports.formatSeconds = exports.flatArray = exports.fieldsToSort = exports.convertToRadian = exports.convertHoursToMinutes = exports.checkSiteUrl = exports.capitalize = exports.bytesConverter =
|
|
6
|
+
exports.verifyDecimals = exports.sortInputFields = exports.shape = exports.scrollTo = exports.reviewCommentList = exports.priceList = exports.lightenDarkenColor = exports.getTraduction = exports.getIconCard = exports.getHourMin = exports.getGoogleMapImage = exports.getDistance = exports.formatUrlVideo = exports.formatSeconds = exports.flatArray = exports.fieldsToSort = exports.convertToRadian = exports.convertHoursToMinutes = exports.checkSiteUrl = exports.capitalize = exports.bytesConverter = void 0;
|
|
7
7
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
8
8
|
var _styledComponents = require("styled-components");
|
|
9
9
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -168,29 +168,40 @@ var bytesConverter = function bytesConverter(bytes) {
|
|
|
168
168
|
};
|
|
169
169
|
|
|
170
170
|
/**
|
|
171
|
-
* Function to get
|
|
171
|
+
* Function to get brightness of color.
|
|
172
172
|
*/
|
|
173
173
|
exports.bytesConverter = bytesConverter;
|
|
174
|
-
var
|
|
175
|
-
var
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
var lightenDarkenColor = function lightenDarkenColor(color) {
|
|
175
|
+
var r, g, b, hsp;
|
|
176
|
+
if (color.match(/^rgb/)) {
|
|
177
|
+
// If HEX --> store the red, green, blue values in separate variables
|
|
178
|
+
color = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);
|
|
179
|
+
r = color[1];
|
|
180
|
+
g = color[2];
|
|
181
|
+
b = color[3];
|
|
182
|
+
} else {
|
|
183
|
+
// If RGB --> Convert it to HEX
|
|
184
|
+
color = +("0x" + color.slice(1).replace(color.length < 5 && /./g, '$&$&'));
|
|
185
|
+
r = color >> 16;
|
|
186
|
+
g = color >> 8 & 255;
|
|
187
|
+
b = color & 255;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// HSP (Highly Sensitive Poo) equation
|
|
191
|
+
hsp = Math.sqrt(0.299 * (r * r) + 0.587 * (g * g) + 0.114 * (b * b));
|
|
192
|
+
|
|
193
|
+
// Using the HSP value, determine whether the color is light or dark
|
|
194
|
+
if (hsp > 197) {
|
|
195
|
+
return true; //is light color
|
|
196
|
+
} else {
|
|
197
|
+
return false;
|
|
179
198
|
}
|
|
180
|
-
var num = parseInt(col, 16);
|
|
181
|
-
var r = (num >> 16) + amt;
|
|
182
|
-
if (r > 255) r = 255;else if (r < 0) r = 0;
|
|
183
|
-
var b = (num >> 8 & 0x00FF) + amt;
|
|
184
|
-
if (b > 255) b = 255;else if (b < 0) b = 0;
|
|
185
|
-
var g = (num & 0x0000FF) + amt;
|
|
186
|
-
if (g > 255) g = 255;else if (g < 0) g = 0;
|
|
187
|
-
return (usePound ? "#" : "") + (g | b << 8 | r << 16).toString(16);
|
|
188
199
|
};
|
|
189
200
|
|
|
190
201
|
/**
|
|
191
202
|
* Function to get time in 12 hours format.
|
|
192
203
|
*/
|
|
193
|
-
exports.
|
|
204
|
+
exports.lightenDarkenColor = lightenDarkenColor;
|
|
194
205
|
var getHourMin = function getHourMin(hour, min) {
|
|
195
206
|
var _hour;
|
|
196
207
|
if (hour < 12) {
|
package/package.json
CHANGED
|
@@ -468,3 +468,29 @@ export const BusinessInfoWrapper = styled.div`
|
|
|
468
468
|
flex-direction: column;
|
|
469
469
|
}
|
|
470
470
|
`
|
|
471
|
+
|
|
472
|
+
export const WrapperFloatingSearch = styled.div`
|
|
473
|
+
position: absolute;
|
|
474
|
+
color: ${({ theme }) => theme.colors.white};
|
|
475
|
+
display: flex;
|
|
476
|
+
background: rgba(0,0,0,0.2);
|
|
477
|
+
top: 80px;
|
|
478
|
+
right: 10px;
|
|
479
|
+
width: 80%;
|
|
480
|
+
border-bottom: 1px solid #FFFFFF;
|
|
481
|
+
#select-input {
|
|
482
|
+
color: #FFFFFF !important;
|
|
483
|
+
background: transparent;
|
|
484
|
+
}
|
|
485
|
+
svg, span {
|
|
486
|
+
color: #FFFFFF !important;
|
|
487
|
+
}
|
|
488
|
+
@media (min-width: 681px){
|
|
489
|
+
top: 23px;
|
|
490
|
+
right: 60px;
|
|
491
|
+
width: 300px;
|
|
492
|
+
input {
|
|
493
|
+
width: 80%;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
`
|
|
@@ -8,7 +8,7 @@ import { Modal } from '../Modal'
|
|
|
8
8
|
import { LoginForm } from '../LoginForm'
|
|
9
9
|
import { SignUpForm } from '../SignUpForm'
|
|
10
10
|
import { ForgotPasswordForm } from '../ForgotPasswordForm'
|
|
11
|
-
import { convertHoursToMinutes,
|
|
11
|
+
import { convertHoursToMinutes, lightenDarkenColor, shape } from '../../../../../utils'
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
ContainerCard,
|
|
@@ -153,8 +153,8 @@ const BusinessControllerUI = (props) => {
|
|
|
153
153
|
{business?.ribbon?.enabled && (
|
|
154
154
|
<RibbonBox
|
|
155
155
|
bgColor={business?.ribbon?.color}
|
|
156
|
-
colorText={
|
|
157
|
-
borderRibbon={
|
|
156
|
+
colorText={lightenDarkenColor(business?.ribbon?.color, -200)}
|
|
157
|
+
borderRibbon={lightenDarkenColor(business?.ribbon?.color, -200)}
|
|
158
158
|
isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
|
|
159
159
|
isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
|
|
160
160
|
>
|
|
@@ -451,11 +451,11 @@ export const RibbonBox = styled.div`
|
|
|
451
451
|
`}
|
|
452
452
|
|
|
453
453
|
${({ colorText }) => colorText && css`
|
|
454
|
-
color: ${colorText};
|
|
454
|
+
color: ${colorText ? 'black' : 'white'};
|
|
455
455
|
`}
|
|
456
456
|
|
|
457
457
|
${({ borderRibbon }) => borderRibbon && css`
|
|
458
|
-
border: 1px solid ${borderRibbon};
|
|
458
|
+
border: 1px solid ${borderRibbon ? 'black' : 'white'};
|
|
459
459
|
`}
|
|
460
460
|
`
|
|
461
461
|
|
package/src/utils/index.js
CHANGED
|
@@ -132,35 +132,40 @@ export const bytesConverter = bytes => {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
/**
|
|
135
|
-
* Function to get
|
|
135
|
+
* Function to get brightness of color.
|
|
136
136
|
*/
|
|
137
|
-
export const
|
|
137
|
+
export const lightenDarkenColor = (color) => {
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
139
|
+
let r, g, b, hsp;
|
|
140
|
+
if (color.match(/^rgb/)) {
|
|
141
|
+
// If HEX --> store the red, green, blue values in separate variables
|
|
142
|
+
color = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);
|
|
143
|
+
|
|
144
|
+
r = color[1];
|
|
145
|
+
g = color[2];
|
|
146
|
+
b = color[3];
|
|
147
|
+
} else {
|
|
148
|
+
// If RGB --> Convert it to HEX
|
|
149
|
+
color = +("0x" + color.slice(1).replace(color.length < 5 && /./g, '$&$&'));
|
|
150
|
+
|
|
151
|
+
r = color >> 16;
|
|
152
|
+
g = color >> 8 & 255;
|
|
153
|
+
b = color & 255;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// HSP (Highly Sensitive Poo) equation
|
|
157
|
+
hsp = Math.sqrt(
|
|
158
|
+
0.299 * (r * r) +
|
|
159
|
+
0.587 * (g * g) +
|
|
160
|
+
0.114 * (b * b)
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
// Using the HSP value, determine whether the color is light or dark
|
|
164
|
+
if (hsp > 197) {
|
|
165
|
+
return true; //is light color
|
|
166
|
+
} else {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
164
169
|
}
|
|
165
170
|
|
|
166
171
|
/**
|