@trafilea/afrodita-components 5.0.0-beta.184 → 5.0.0-beta.185

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/build/index.js CHANGED
@@ -4838,13 +4838,11 @@ var TAGS = {
4838
4838
  tag: newStyled.span(templateObject_17$2 || (templateObject_17$2 = __makeTemplateObject(["\n display: inline-block;\n text-transform: ", ";\n "], ["\n display: inline-block;\n text-transform: ", ";\n "])), function (props) { return (props.allCaps ? 'uppercase' : ''); }),
4839
4839
  };
4840
4840
  var Text$6 = function (_a) {
4841
- var variant = _a.variant, children = _a.children, testId = _a.testId, allProps = __rest(_a, ["variant", "children", "testId"]);
4841
+ var _b;
4842
+ var variant = _a.variant, children = _a.children, testId = _a.testId, asSpan = _a.asSpan, allProps = __rest(_a, ["variant", "children", "testId", "asSpan"]);
4842
4843
  var theme = useTheme();
4843
- var Tag = React$2.useMemo(function () { return TAGS[variant] || 'p'; }, [variant]);
4844
- var _b = React$2.useMemo(function () {
4845
- var _a;
4846
- return (__assign$1(__assign$1({}, ((_a = DEFAULTS === null || DEFAULTS === void 0 ? void 0 : DEFAULTS[variant]) !== null && _a !== void 0 ? _a : {})), allProps));
4847
- }, [variant, allProps]), size = _b.size, weight = _b.weight, props = __rest(_b, ["size", "weight"]);
4844
+ var Tag = asSpan ? 'span' : TAGS[variant] || 'p';
4845
+ var _c = __assign$1(__assign$1({}, ((_b = DEFAULTS === null || DEFAULTS === void 0 ? void 0 : DEFAULTS[variant]) !== null && _b !== void 0 ? _b : {})), allProps), size = _c.size, weight = _c.weight, props = __rest(_c, ["size", "weight"]);
4848
4846
  var commonCSS = React$2.useMemo(function () {
4849
4847
  var _a, _b;
4850
4848
  // These are the common style inside a `variant`.
@@ -12103,6 +12101,90 @@ var formatPrice = function (value, _a) {
12103
12101
  }).format(valueToFormat);
12104
12102
  };
12105
12103
 
12104
+ /* eslint-disable no-param-reassign */
12105
+ var index$1 = function (breakpoints) {
12106
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
12107
+ literal = _ref.literal,
12108
+ overlap = _ref.overlap;
12109
+
12110
+ var mq = literal ? breakpoints : ['&'].concat(breakpoints);
12111
+
12112
+ function flatten(obj) {
12113
+ if (typeof obj !== 'object' || obj == null) {
12114
+ return [];
12115
+ }
12116
+
12117
+ if (Array.isArray(obj)) {
12118
+ return obj.map(flatten);
12119
+ }
12120
+
12121
+ var slots = {};
12122
+ var objects = {};
12123
+ var props = {};
12124
+ Object.keys(obj).forEach(function (key) {
12125
+ // Check if value is an array, but skip if it looks like a selector.
12126
+ // key.indexOf('&') === 0
12127
+
12128
+ var item = obj[key];
12129
+ if (!Array.isArray(item) && literal) item = [item];
12130
+
12131
+ if ((literal || Array.isArray(item)) && key.charCodeAt(0) !== 38) {
12132
+ var prior = void 0;
12133
+ item.forEach(function (v, index) {
12134
+ // Optimize by removing duplicated media query entries
12135
+ // when they are explicitly known to overlap.
12136
+ if (overlap && prior === v) {
12137
+ return;
12138
+ }
12139
+
12140
+ if (v == null) {
12141
+ // Do not create entries for undefined values as this will
12142
+ // generate empty media media quries
12143
+ return;
12144
+ }
12145
+
12146
+ prior = v;
12147
+
12148
+ if (index === 0 && !literal) {
12149
+ props[key] = v;
12150
+ } else if (slots[mq[index]] === undefined) {
12151
+ var _slots$mq$index;
12152
+
12153
+ slots[mq[index]] = (_slots$mq$index = {}, _slots$mq$index[key] = v, _slots$mq$index);
12154
+ } else {
12155
+ slots[mq[index]][key] = v;
12156
+ }
12157
+ });
12158
+ } else if (typeof item === 'object') {
12159
+ objects[key] = flatten(item);
12160
+ } else {
12161
+ props[key] = item;
12162
+ }
12163
+ });
12164
+
12165
+ // Ensure that all slots and then child objects are pushed to the end
12166
+ mq.forEach(function (el) {
12167
+ if (slots[el]) {
12168
+ props[el] = slots[el];
12169
+ }
12170
+ });
12171
+ Object.assign(props, objects);
12172
+ return props;
12173
+ }
12174
+
12175
+ return function () {
12176
+ for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) {
12177
+ values[_key] = arguments[_key];
12178
+ }
12179
+
12180
+ return values.map(flatten);
12181
+ };
12182
+ };
12183
+
12184
+ var mediaQueries = index$1(["@media(max-width: 900px)", "@media(min-width: 900px)"], {
12185
+ literal: true,
12186
+ });
12187
+
12106
12188
  var ErrorText = newStyled.h3(templateObject_1$Y || (templateObject_1$Y = __makeTemplateObject(["\n color: ", " !important;\n font-size: 0.75rem;\n font-weight: 600;\n margin: 0;\n font-height: 1rem;\n margin-left: 0.313rem;\n"], ["\n color: ", " !important;\n font-size: 0.75rem;\n font-weight: 600;\n margin: 0;\n font-height: 1rem;\n margin-left: 0.313rem;\n"])), function (props) { return props.color; });
12107
12189
  var ErrorContainer = newStyled.div(templateObject_2$F || (templateObject_2$F = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-top: 12px;\n"], ["\n display: flex;\n align-items: center;\n margin-top: 12px;\n"])));
12108
12190
  var Error$1 = function (_a) {
@@ -12418,90 +12500,6 @@ var Note = function (_a) {
12418
12500
  };
12419
12501
  var templateObject_1$O, templateObject_2$y, templateObject_3$u, templateObject_4$l;
12420
12502
 
12421
- /* eslint-disable no-param-reassign */
12422
- var index$1 = function (breakpoints) {
12423
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
12424
- literal = _ref.literal,
12425
- overlap = _ref.overlap;
12426
-
12427
- var mq = literal ? breakpoints : ['&'].concat(breakpoints);
12428
-
12429
- function flatten(obj) {
12430
- if (typeof obj !== 'object' || obj == null) {
12431
- return [];
12432
- }
12433
-
12434
- if (Array.isArray(obj)) {
12435
- return obj.map(flatten);
12436
- }
12437
-
12438
- var slots = {};
12439
- var objects = {};
12440
- var props = {};
12441
- Object.keys(obj).forEach(function (key) {
12442
- // Check if value is an array, but skip if it looks like a selector.
12443
- // key.indexOf('&') === 0
12444
-
12445
- var item = obj[key];
12446
- if (!Array.isArray(item) && literal) item = [item];
12447
-
12448
- if ((literal || Array.isArray(item)) && key.charCodeAt(0) !== 38) {
12449
- var prior = void 0;
12450
- item.forEach(function (v, index) {
12451
- // Optimize by removing duplicated media query entries
12452
- // when they are explicitly known to overlap.
12453
- if (overlap && prior === v) {
12454
- return;
12455
- }
12456
-
12457
- if (v == null) {
12458
- // Do not create entries for undefined values as this will
12459
- // generate empty media media quries
12460
- return;
12461
- }
12462
-
12463
- prior = v;
12464
-
12465
- if (index === 0 && !literal) {
12466
- props[key] = v;
12467
- } else if (slots[mq[index]] === undefined) {
12468
- var _slots$mq$index;
12469
-
12470
- slots[mq[index]] = (_slots$mq$index = {}, _slots$mq$index[key] = v, _slots$mq$index);
12471
- } else {
12472
- slots[mq[index]][key] = v;
12473
- }
12474
- });
12475
- } else if (typeof item === 'object') {
12476
- objects[key] = flatten(item);
12477
- } else {
12478
- props[key] = item;
12479
- }
12480
- });
12481
-
12482
- // Ensure that all slots and then child objects are pushed to the end
12483
- mq.forEach(function (el) {
12484
- if (slots[el]) {
12485
- props[el] = slots[el];
12486
- }
12487
- });
12488
- Object.assign(props, objects);
12489
- return props;
12490
- }
12491
-
12492
- return function () {
12493
- for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) {
12494
- values[_key] = arguments[_key];
12495
- }
12496
-
12497
- return values.map(flatten);
12498
- };
12499
- };
12500
-
12501
- var mediaQueries = index$1(["@media(max-width: 900px)", "@media(min-width: 900px)"], {
12502
- literal: true,
12503
- });
12504
-
12505
12503
  var Title$4 = newStyled.h1(templateObject_1$N || (templateObject_1$N = __makeTemplateObject(["\n color: ", ";\n font-size: 1.25rem;\n line-height: 1.75rem;\n font-weight: 600;\n margin: 0;\n text-align: center;\n"], ["\n color: ", ";\n font-size: 1.25rem;\n line-height: 1.75rem;\n font-weight: 600;\n margin: 0;\n text-align: center;\n"])), function (props) { return props.color; });
12506
12504
  var Line = newStyled.div(templateObject_2$x || (templateObject_2$x = __makeTemplateObject(["\n width: 100%;\n height: 0.063rem;\n background-color: ", ";\n margin: 0.938rem 0;\n"], ["\n width: 100%;\n height: 0.063rem;\n background-color: ", ";\n margin: 0.938rem 0;\n"])), function (props) { return props.backgroundColor; });
12507
12505
  var Row$1 = newStyled.div(templateObject_3$t || (templateObject_3$t = __makeTemplateObject(["\n display: flex;\n ", "\n justify-content: space-between;\n align-items: flex-start;\n"], ["\n display: flex;\n ", "\n justify-content: space-between;\n align-items: flex-start;\n"])), mediaQueries({
@@ -18450,6 +18448,7 @@ exports.isEmpty = isEmpty;
18450
18448
  exports.isNumber = isNumber$1;
18451
18449
  exports.isPhoneNumber = isPhoneNumber;
18452
18450
  exports.isValidDate = isValidDate;
18451
+ exports.mediaQueries = mediaQueries;
18453
18452
  exports.modalEvent = modalEvent;
18454
18453
  exports.simulateMouseClick = simulateMouseClick;
18455
18454
  exports.sliceString = sliceString;