@trafilea/afrodita-components 4.3.1-beta.2 → 4.3.1-beta.6
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.esm.js +457 -172
- package/build/index.esm.js.map +1 -1
- package/build/index.js +423 -120
- package/build/index.js.map +1 -1
- package/build/theme/shapermint.theme.js +1 -1
- package/package.json +2 -1
package/build/index.esm.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs as jsxs$1, jsx as jsx$1, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import React__default, { forwardRef, useContext, createElement, createContext, Fragment as Fragment$2, useRef, useLayoutEffect, useMemo, useState, useEffect, isValidElement, cloneElement, useCallback, useReducer, createRef } from 'react';
|
|
3
4
|
import { createPortal } from 'react-dom';
|
|
4
5
|
|
|
5
6
|
/*! *****************************************************************************
|
|
@@ -454,8 +455,8 @@ var Icon = {
|
|
|
454
455
|
SlideDots: SlideDots$1,
|
|
455
456
|
};
|
|
456
457
|
|
|
457
|
-
function _extends$
|
|
458
|
-
_extends$
|
|
458
|
+
function _extends$2() {
|
|
459
|
+
_extends$2 = Object.assign || function (target) {
|
|
459
460
|
for (var i = 1; i < arguments.length; i++) {
|
|
460
461
|
var source = arguments[i];
|
|
461
462
|
|
|
@@ -469,7 +470,7 @@ function _extends$1() {
|
|
|
469
470
|
return target;
|
|
470
471
|
};
|
|
471
472
|
|
|
472
|
-
return _extends$
|
|
473
|
+
return _extends$2.apply(this, arguments);
|
|
473
474
|
}
|
|
474
475
|
|
|
475
476
|
function memoize(fn) {
|
|
@@ -2563,7 +2564,7 @@ var getTheme = function getTheme(outerTheme, theme) {
|
|
|
2563
2564
|
throw new Error('[ThemeProvider] Please make your theme prop a plain object');
|
|
2564
2565
|
}
|
|
2565
2566
|
|
|
2566
|
-
return _extends$
|
|
2567
|
+
return _extends$2({}, outerTheme, theme);
|
|
2567
2568
|
};
|
|
2568
2569
|
|
|
2569
2570
|
var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {
|
|
@@ -3242,7 +3243,7 @@ var createStyled = function createStyled(tag, options) {
|
|
|
3242
3243
|
});
|
|
3243
3244
|
|
|
3244
3245
|
Styled.withComponent = function (nextTag, nextOptions) {
|
|
3245
|
-
return createStyled(nextTag, _extends$
|
|
3246
|
+
return createStyled(nextTag, _extends$2({}, options, nextOptions, {
|
|
3246
3247
|
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
|
|
3247
3248
|
})).apply(void 0, styles);
|
|
3248
3249
|
};
|
|
@@ -3449,7 +3450,7 @@ var AssetsProvider = function (_a) {
|
|
|
3449
3450
|
};
|
|
3450
3451
|
var useThemeAssets = function () { return useContext(AssetsContext); };
|
|
3451
3452
|
|
|
3452
|
-
var Container$
|
|
3453
|
+
var Container$F = newStyled.div(templateObject_1$13 || (templateObject_1$13 = __makeTemplateObject(["\n ", "\n width: ", ";\n background: ", ";\n border-radius: ", ";\n border: ", ";\n"], ["\n ", "\n width: ", ";\n background: ", ";\n border-radius: ", ";\n border: ", ";\n"])), function (_a) {
|
|
3453
3454
|
var flex = _a.flex;
|
|
3454
3455
|
return flex &&
|
|
3455
3456
|
"display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;";
|
|
@@ -3462,7 +3463,7 @@ var Container$E = newStyled.div(templateObject_1$13 || (templateObject_1$13 = __
|
|
|
3462
3463
|
var Card = function (_a) {
|
|
3463
3464
|
var children = _a.children, backgroundColor = _a.backgroundColor, _b = _a.widthAuto, widthAuto = _b === void 0 ? true : _b, border = _a.border, _c = _a.flex, flex = _c === void 0 ? true : _c;
|
|
3464
3465
|
var theme = useTheme();
|
|
3465
|
-
return (jsx$1(Container$
|
|
3466
|
+
return (jsx$1(Container$F, __assign({ backgroundColor: backgroundColor, widthAuto: widthAuto, border: border, flex: flex, "data-testid": "CardContainer", theme: theme }, { children: children }), void 0));
|
|
3466
3467
|
};
|
|
3467
3468
|
var Card$1 = Object.assign(Card, {
|
|
3468
3469
|
Header: CardHeader,
|
|
@@ -3588,8 +3589,8 @@ var ButtonSecondaryOutline = function (props) {
|
|
|
3588
3589
|
} }), void 0));
|
|
3589
3590
|
};
|
|
3590
3591
|
|
|
3591
|
-
function _extends() {
|
|
3592
|
-
_extends = Object.assign || function (target) {
|
|
3592
|
+
function _extends$1() {
|
|
3593
|
+
_extends$1 = Object.assign || function (target) {
|
|
3593
3594
|
for (var i = 1; i < arguments.length; i++) {
|
|
3594
3595
|
var source = arguments[i];
|
|
3595
3596
|
|
|
@@ -3603,7 +3604,7 @@ function _extends() {
|
|
|
3603
3604
|
return target;
|
|
3604
3605
|
};
|
|
3605
3606
|
|
|
3606
|
-
return _extends.apply(this, arguments);
|
|
3607
|
+
return _extends$1.apply(this, arguments);
|
|
3607
3608
|
}
|
|
3608
3609
|
|
|
3609
3610
|
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
@@ -3742,7 +3743,7 @@ function render(_ref) {
|
|
|
3742
3743
|
return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
|
|
3743
3744
|
return null;
|
|
3744
3745
|
}, _match[RenderStrategy.Hidden] = function () {
|
|
3745
|
-
return _render(_extends({}, _rest, {
|
|
3746
|
+
return _render(_extends$1({}, _rest, {
|
|
3746
3747
|
hidden: true,
|
|
3747
3748
|
style: {
|
|
3748
3749
|
display: 'none'
|
|
@@ -4203,7 +4204,7 @@ function useDescriptions() {
|
|
|
4203
4204
|
props: props.props
|
|
4204
4205
|
};
|
|
4205
4206
|
}, [register, props.slot, props.name, props.props]);
|
|
4206
|
-
return
|
|
4207
|
+
return React__default.createElement(DescriptionContext.Provider, {
|
|
4207
4208
|
value: contextBag
|
|
4208
4209
|
}, props.children);
|
|
4209
4210
|
};
|
|
@@ -4219,12 +4220,12 @@ function Description$2(props) {
|
|
|
4219
4220
|
}, [id, context.register]);
|
|
4220
4221
|
var passThroughProps = props;
|
|
4221
4222
|
|
|
4222
|
-
var propsWeControl = _extends({}, context.props, {
|
|
4223
|
+
var propsWeControl = _extends$1({}, context.props, {
|
|
4223
4224
|
id: id
|
|
4224
4225
|
});
|
|
4225
4226
|
|
|
4226
4227
|
return render({
|
|
4227
|
-
props: _extends({}, passThroughProps, propsWeControl),
|
|
4228
|
+
props: _extends$1({}, passThroughProps, propsWeControl),
|
|
4228
4229
|
slot: context.slot || {},
|
|
4229
4230
|
defaultTag: DEFAULT_DESCRIPTION_TAG,
|
|
4230
4231
|
name: context.name || 'Description'
|
|
@@ -4246,7 +4247,7 @@ function useOpenClosed() {
|
|
|
4246
4247
|
function OpenClosedProvider(_ref) {
|
|
4247
4248
|
var value = _ref.value,
|
|
4248
4249
|
children = _ref.children;
|
|
4249
|
-
return
|
|
4250
|
+
return React__default.createElement(Context.Provider, {
|
|
4250
4251
|
value: value
|
|
4251
4252
|
}, children);
|
|
4252
4253
|
}
|
|
@@ -4303,32 +4304,32 @@ var ActionTypes$2;
|
|
|
4303
4304
|
var reducers$2 = (_reducers$2 = {}, _reducers$2[ActionTypes$2.ToggleDisclosure] = function (state) {
|
|
4304
4305
|
var _match;
|
|
4305
4306
|
|
|
4306
|
-
return _extends({}, state, {
|
|
4307
|
+
return _extends$1({}, state, {
|
|
4307
4308
|
disclosureState: match(state.disclosureState, (_match = {}, _match[DisclosureStates.Open] = DisclosureStates.Closed, _match[DisclosureStates.Closed] = DisclosureStates.Open, _match))
|
|
4308
4309
|
});
|
|
4309
4310
|
}, _reducers$2[ActionTypes$2.CloseDisclosure] = function (state) {
|
|
4310
4311
|
if (state.disclosureState === DisclosureStates.Closed) return state;
|
|
4311
|
-
return _extends({}, state, {
|
|
4312
|
+
return _extends$1({}, state, {
|
|
4312
4313
|
disclosureState: DisclosureStates.Closed
|
|
4313
4314
|
});
|
|
4314
4315
|
}, _reducers$2[ActionTypes$2.LinkPanel] = function (state) {
|
|
4315
4316
|
if (state.linkedPanel === true) return state;
|
|
4316
|
-
return _extends({}, state, {
|
|
4317
|
+
return _extends$1({}, state, {
|
|
4317
4318
|
linkedPanel: true
|
|
4318
4319
|
});
|
|
4319
4320
|
}, _reducers$2[ActionTypes$2.UnlinkPanel] = function (state) {
|
|
4320
4321
|
if (state.linkedPanel === false) return state;
|
|
4321
|
-
return _extends({}, state, {
|
|
4322
|
+
return _extends$1({}, state, {
|
|
4322
4323
|
linkedPanel: false
|
|
4323
4324
|
});
|
|
4324
4325
|
}, _reducers$2[ActionTypes$2.SetButtonId] = function (state, action) {
|
|
4325
4326
|
if (state.buttonId === action.buttonId) return state;
|
|
4326
|
-
return _extends({}, state, {
|
|
4327
|
+
return _extends$1({}, state, {
|
|
4327
4328
|
buttonId: action.buttonId
|
|
4328
4329
|
});
|
|
4329
4330
|
}, _reducers$2[ActionTypes$2.SetPanelId] = function (state, action) {
|
|
4330
4331
|
if (state.panelId === action.panelId) return state;
|
|
4331
|
-
return _extends({}, state, {
|
|
4332
|
+
return _extends$1({}, state, {
|
|
4332
4333
|
panelId: action.panelId
|
|
4333
4334
|
});
|
|
4334
4335
|
}, _reducers$2);
|
|
@@ -4429,11 +4430,11 @@ function Disclosure(props) {
|
|
|
4429
4430
|
close: close
|
|
4430
4431
|
};
|
|
4431
4432
|
}, [disclosureState, close]);
|
|
4432
|
-
return
|
|
4433
|
+
return React__default.createElement(DisclosureContext.Provider, {
|
|
4433
4434
|
value: reducerBag
|
|
4434
|
-
},
|
|
4435
|
+
}, React__default.createElement(DisclosureAPIContext.Provider, {
|
|
4435
4436
|
value: api
|
|
4436
|
-
},
|
|
4437
|
+
}, React__default.createElement(OpenClosedProvider, {
|
|
4437
4438
|
value: match(disclosureState, (_match2 = {}, _match2[DisclosureStates.Open] = State.Open, _match2[DisclosureStates.Closed] = State.Closed, _match2))
|
|
4438
4439
|
}, render({
|
|
4439
4440
|
props: passthroughProps,
|
|
@@ -4533,7 +4534,7 @@ var Button$7 = /*#__PURE__*/forwardRefWithAs(function Button(props, ref) {
|
|
|
4533
4534
|
onClick: handleClick
|
|
4534
4535
|
};
|
|
4535
4536
|
return render({
|
|
4536
|
-
props: _extends({}, passthroughProps, propsWeControl),
|
|
4537
|
+
props: _extends$1({}, passthroughProps, propsWeControl),
|
|
4537
4538
|
slot: slot,
|
|
4538
4539
|
defaultTag: DEFAULT_BUTTON_TAG$1,
|
|
4539
4540
|
name: 'Disclosure.Button'
|
|
@@ -4595,10 +4596,10 @@ var Panel = /*#__PURE__*/forwardRefWithAs(function Panel(props, ref) {
|
|
|
4595
4596
|
id: state.panelId
|
|
4596
4597
|
};
|
|
4597
4598
|
var passthroughProps = props;
|
|
4598
|
-
return
|
|
4599
|
+
return React__default.createElement(DisclosurePanelContext.Provider, {
|
|
4599
4600
|
value: state.panelId
|
|
4600
4601
|
}, render({
|
|
4601
|
-
props: _extends({}, passthroughProps, propsWeControl),
|
|
4602
|
+
props: _extends$1({}, passthroughProps, propsWeControl),
|
|
4602
4603
|
slot: slot,
|
|
4603
4604
|
defaultTag: DEFAULT_PANEL_TAG,
|
|
4604
4605
|
features: PanelRenderFeatures,
|
|
@@ -4801,24 +4802,24 @@ var ActionTypes$1;
|
|
|
4801
4802
|
var reducers$1 = (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
|
|
4802
4803
|
if (state.disabled) return state;
|
|
4803
4804
|
if (state.listboxState === ListboxStates.Closed) return state;
|
|
4804
|
-
return _extends({}, state, {
|
|
4805
|
+
return _extends$1({}, state, {
|
|
4805
4806
|
activeOptionIndex: null,
|
|
4806
4807
|
listboxState: ListboxStates.Closed
|
|
4807
4808
|
});
|
|
4808
4809
|
}, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
|
|
4809
4810
|
if (state.disabled) return state;
|
|
4810
4811
|
if (state.listboxState === ListboxStates.Open) return state;
|
|
4811
|
-
return _extends({}, state, {
|
|
4812
|
+
return _extends$1({}, state, {
|
|
4812
4813
|
listboxState: ListboxStates.Open
|
|
4813
4814
|
});
|
|
4814
4815
|
}, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
|
|
4815
4816
|
if (state.disabled === action.disabled) return state;
|
|
4816
|
-
return _extends({}, state, {
|
|
4817
|
+
return _extends$1({}, state, {
|
|
4817
4818
|
disabled: action.disabled
|
|
4818
4819
|
});
|
|
4819
4820
|
}, _reducers$1[ActionTypes$1.SetOrientation] = function (state, action) {
|
|
4820
4821
|
if (state.orientation === action.orientation) return state;
|
|
4821
|
-
return _extends({}, state, {
|
|
4822
|
+
return _extends$1({}, state, {
|
|
4822
4823
|
orientation: action.orientation
|
|
4823
4824
|
});
|
|
4824
4825
|
}, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
|
|
@@ -4839,7 +4840,7 @@ var reducers$1 = (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = fu
|
|
|
4839
4840
|
}
|
|
4840
4841
|
});
|
|
4841
4842
|
if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
|
|
4842
|
-
return _extends({}, state, {
|
|
4843
|
+
return _extends$1({}, state, {
|
|
4843
4844
|
searchQuery: '',
|
|
4844
4845
|
activeOptionIndex: activeOptionIndex
|
|
4845
4846
|
});
|
|
@@ -4852,10 +4853,10 @@ var reducers$1 = (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = fu
|
|
|
4852
4853
|
|
|
4853
4854
|
return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
|
|
4854
4855
|
});
|
|
4855
|
-
if (match === -1 || match === state.activeOptionIndex) return _extends({}, state, {
|
|
4856
|
+
if (match === -1 || match === state.activeOptionIndex) return _extends$1({}, state, {
|
|
4856
4857
|
searchQuery: searchQuery
|
|
4857
4858
|
});
|
|
4858
|
-
return _extends({}, state, {
|
|
4859
|
+
return _extends$1({}, state, {
|
|
4859
4860
|
searchQuery: searchQuery,
|
|
4860
4861
|
activeOptionIndex: match
|
|
4861
4862
|
});
|
|
@@ -4863,11 +4864,11 @@ var reducers$1 = (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = fu
|
|
|
4863
4864
|
if (state.disabled) return state;
|
|
4864
4865
|
if (state.listboxState === ListboxStates.Closed) return state;
|
|
4865
4866
|
if (state.searchQuery === '') return state;
|
|
4866
|
-
return _extends({}, state, {
|
|
4867
|
+
return _extends$1({}, state, {
|
|
4867
4868
|
searchQuery: ''
|
|
4868
4869
|
});
|
|
4869
4870
|
}, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
|
|
4870
|
-
return _extends({}, state, {
|
|
4871
|
+
return _extends$1({}, state, {
|
|
4871
4872
|
options: [].concat(state.options, [{
|
|
4872
4873
|
id: action.id,
|
|
4873
4874
|
dataRef: action.dataRef
|
|
@@ -4880,7 +4881,7 @@ var reducers$1 = (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = fu
|
|
|
4880
4881
|
return a.id === action.id;
|
|
4881
4882
|
});
|
|
4882
4883
|
if (idx !== -1) nextOptions.splice(idx, 1);
|
|
4883
|
-
return _extends({}, state, {
|
|
4884
|
+
return _extends$1({}, state, {
|
|
4884
4885
|
options: nextOptions,
|
|
4885
4886
|
activeOptionIndex: function () {
|
|
4886
4887
|
if (idx === state.activeOptionIndex) return null;
|
|
@@ -4990,9 +4991,9 @@ function Listbox(props) {
|
|
|
4990
4991
|
disabled: disabled
|
|
4991
4992
|
};
|
|
4992
4993
|
}, [listboxState, disabled]);
|
|
4993
|
-
return
|
|
4994
|
+
return React__default.createElement(ListboxContext.Provider, {
|
|
4994
4995
|
value: reducerBag
|
|
4995
|
-
},
|
|
4996
|
+
}, React__default.createElement(OpenClosedProvider, {
|
|
4996
4997
|
value: match(listboxState, (_match = {}, _match[ListboxStates.Open] = State.Open, _match[ListboxStates.Closed] = State.Closed, _match))
|
|
4997
4998
|
}, render({
|
|
4998
4999
|
props: passThroughProps,
|
|
@@ -5101,7 +5102,7 @@ var Button$6 = /*#__PURE__*/forwardRefWithAs(function Button(props, ref) {
|
|
|
5101
5102
|
onClick: handleClick
|
|
5102
5103
|
};
|
|
5103
5104
|
return render({
|
|
5104
|
-
props: _extends({}, passthroughProps, propsWeControl),
|
|
5105
|
+
props: _extends$1({}, passthroughProps, propsWeControl),
|
|
5105
5106
|
slot: slot,
|
|
5106
5107
|
defaultTag: DEFAULT_BUTTON_TAG,
|
|
5107
5108
|
name: 'Listbox.Button'
|
|
@@ -5134,7 +5135,7 @@ function Label$4(props) {
|
|
|
5134
5135
|
onClick: handleClick
|
|
5135
5136
|
};
|
|
5136
5137
|
return render({
|
|
5137
|
-
props: _extends({}, props, propsWeControl),
|
|
5138
|
+
props: _extends$1({}, props, propsWeControl),
|
|
5138
5139
|
slot: slot,
|
|
5139
5140
|
defaultTag: DEFAULT_LABEL_TAG$1,
|
|
5140
5141
|
name: 'Listbox.Label'
|
|
@@ -5310,7 +5311,7 @@ var Options = /*#__PURE__*/forwardRefWithAs(function Options(props, ref) {
|
|
|
5310
5311
|
};
|
|
5311
5312
|
var passthroughProps = props;
|
|
5312
5313
|
return render({
|
|
5313
|
-
props: _extends({}, passthroughProps, propsWeControl),
|
|
5314
|
+
props: _extends$1({}, passthroughProps, propsWeControl),
|
|
5314
5315
|
slot: slot,
|
|
5315
5316
|
defaultTag: DEFAULT_OPTIONS_TAG,
|
|
5316
5317
|
features: OptionsRenderFeatures,
|
|
@@ -5454,7 +5455,7 @@ function Option$2(props) {
|
|
|
5454
5455
|
onMouseLeave: handleLeave
|
|
5455
5456
|
};
|
|
5456
5457
|
return render({
|
|
5457
|
-
props: _extends({}, passthroughProps, propsWeControl),
|
|
5458
|
+
props: _extends$1({}, passthroughProps, propsWeControl),
|
|
5458
5459
|
slot: slot,
|
|
5459
5460
|
defaultTag: DEFAULT_OPTION_TAG$1,
|
|
5460
5461
|
name: 'Listbox.Option'
|
|
@@ -5576,7 +5577,7 @@ function useLabels() {
|
|
|
5576
5577
|
props: props.props
|
|
5577
5578
|
};
|
|
5578
5579
|
}, [register, props.slot, props.name, props.props]);
|
|
5579
|
-
return
|
|
5580
|
+
return React__default.createElement(LabelContext.Provider, {
|
|
5580
5581
|
value: contextBag
|
|
5581
5582
|
}, props.children);
|
|
5582
5583
|
};
|
|
@@ -5595,11 +5596,11 @@ function Label$3(props) {
|
|
|
5595
5596
|
return context.register(id);
|
|
5596
5597
|
}, [id, context.register]);
|
|
5597
5598
|
|
|
5598
|
-
var propsWeControl = _extends({}, context.props, {
|
|
5599
|
+
var propsWeControl = _extends$1({}, context.props, {
|
|
5599
5600
|
id: id
|
|
5600
5601
|
});
|
|
5601
5602
|
|
|
5602
|
-
var allProps = _extends({}, passThroughProps, propsWeControl); // @ts-expect-error props are dynamic via context, some components will
|
|
5603
|
+
var allProps = _extends$1({}, passThroughProps, propsWeControl); // @ts-expect-error props are dynamic via context, some components will
|
|
5603
5604
|
// provide an onClick then we can delete it.
|
|
5604
5605
|
|
|
5605
5606
|
|
|
@@ -5621,7 +5622,7 @@ var ActionTypes;
|
|
|
5621
5622
|
})(ActionTypes || (ActionTypes = {}));
|
|
5622
5623
|
|
|
5623
5624
|
var reducers = (_reducers = {}, _reducers[ActionTypes.RegisterOption] = function (state, action) {
|
|
5624
|
-
return _extends({}, state, {
|
|
5625
|
+
return _extends$1({}, state, {
|
|
5625
5626
|
options: [].concat(state.options, [{
|
|
5626
5627
|
id: action.id,
|
|
5627
5628
|
element: action.element,
|
|
@@ -5635,7 +5636,7 @@ var reducers = (_reducers = {}, _reducers[ActionTypes.RegisterOption] = function
|
|
|
5635
5636
|
});
|
|
5636
5637
|
if (idx === -1) return state;
|
|
5637
5638
|
options.splice(idx, 1);
|
|
5638
|
-
return _extends({}, state, {
|
|
5639
|
+
return _extends$1({}, state, {
|
|
5639
5640
|
options: options
|
|
5640
5641
|
});
|
|
5641
5642
|
}, _reducers);
|
|
@@ -5776,7 +5777,7 @@ function RadioGroup(props) {
|
|
|
5776
5777
|
}
|
|
5777
5778
|
}, [radioGroupRef, options, triggerChange]);
|
|
5778
5779
|
var registerOption = useCallback(function (option) {
|
|
5779
|
-
dispatch(_extends({
|
|
5780
|
+
dispatch(_extends$1({
|
|
5780
5781
|
type: ActionTypes.RegisterOption
|
|
5781
5782
|
}, option));
|
|
5782
5783
|
return function () {
|
|
@@ -5804,14 +5805,14 @@ function RadioGroup(props) {
|
|
|
5804
5805
|
'aria-describedby': describedby,
|
|
5805
5806
|
onKeyDown: handleKeyDown
|
|
5806
5807
|
};
|
|
5807
|
-
return
|
|
5808
|
+
return React__default.createElement(DescriptionProvider, {
|
|
5808
5809
|
name: "RadioGroup.Description"
|
|
5809
|
-
},
|
|
5810
|
+
}, React__default.createElement(LabelProvider, {
|
|
5810
5811
|
name: "RadioGroup.Label"
|
|
5811
|
-
},
|
|
5812
|
+
}, React__default.createElement(RadioGroupContext.Provider, {
|
|
5812
5813
|
value: api
|
|
5813
5814
|
}, render({
|
|
5814
|
-
props: _extends({}, passThroughProps, propsWeControl),
|
|
5815
|
+
props: _extends$1({}, passThroughProps, propsWeControl),
|
|
5815
5816
|
defaultTag: DEFAULT_RADIO_GROUP_TAG,
|
|
5816
5817
|
name: 'RadioGroup'
|
|
5817
5818
|
}))));
|
|
@@ -5915,12 +5916,12 @@ function Option$1(props) {
|
|
|
5915
5916
|
active: hasFlag(OptionState.Active)
|
|
5916
5917
|
};
|
|
5917
5918
|
}, [checked, isDisabled, hasFlag]);
|
|
5918
|
-
return
|
|
5919
|
+
return React__default.createElement(DescriptionProvider, {
|
|
5919
5920
|
name: "RadioGroup.Description"
|
|
5920
|
-
},
|
|
5921
|
+
}, React__default.createElement(LabelProvider, {
|
|
5921
5922
|
name: "RadioGroup.Label"
|
|
5922
5923
|
}, render({
|
|
5923
|
-
props: _extends({}, passThroughProps, propsWeControl),
|
|
5924
|
+
props: _extends$1({}, passThroughProps, propsWeControl),
|
|
5924
5925
|
slot: slot,
|
|
5925
5926
|
defaultTag: DEFAULT_OPTION_TAG,
|
|
5926
5927
|
name: 'RadioGroup.Option'
|
|
@@ -6170,7 +6171,7 @@ var CustomCheckboxStyles = {
|
|
|
6170
6171
|
},
|
|
6171
6172
|
};
|
|
6172
6173
|
|
|
6173
|
-
var Container$
|
|
6174
|
+
var Container$E = newStyled.div(templateObject_1$11 || (templateObject_1$11 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n user-select: none;\n position: relative;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n user-select: none;\n position: relative;\n"])));
|
|
6174
6175
|
var CustomCheckbox = newStyled.div(CustomCheckboxStyles.baseStyles, function (props) { return [
|
|
6175
6176
|
CustomCheckboxStyles[props.size](props.theme),
|
|
6176
6177
|
CustomCheckboxStyles[props.variant](props.theme, props.isChecked, props.disabled),
|
|
@@ -6199,7 +6200,7 @@ var Checkbox = function (_a) {
|
|
|
6199
6200
|
useEffect(function () {
|
|
6200
6201
|
mounted.current = true;
|
|
6201
6202
|
}, []);
|
|
6202
|
-
return (jsxs$1(Container$
|
|
6203
|
+
return (jsxs$1(Container$E, { children: [jsx$1(Input$3, { type: "checkbox", checked: isChecked, disabled: disabled, onChange: handleChange, id: id }, void 0), jsx$1(CustomCheckbox, __assign({ theme: theme, size: size, disabled: disabled, isChecked: isChecked, "data-testid": "checkbox", variant: variant }, { children: isChecked && jsx$1(Icon.Actions.Check, { fill: "#fff" }, void 0) }), void 0), jsx$1(Label$2, __assign({ "data-testid": "checkbox-text", size: size, variant: isChecked ? 'demi' : 'regular', htmlFor: id, disabled: disabled }, { children: text }), void 0)] }, void 0));
|
|
6203
6204
|
};
|
|
6204
6205
|
var templateObject_1$11, templateObject_2$E;
|
|
6205
6206
|
|
|
@@ -6521,12 +6522,12 @@ var TextButton = function (_a) {
|
|
|
6521
6522
|
};
|
|
6522
6523
|
var templateObject_1$_;
|
|
6523
6524
|
|
|
6524
|
-
var Container$
|
|
6525
|
+
var Container$D = newStyled.div(templateObject_1$Z || (templateObject_1$Z = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n font-size: 0.88rem;\n"], ["\n display: flex;\n justify-content: space-between;\n font-size: 0.88rem;\n"])));
|
|
6525
6526
|
var P$3 = newStyled.p(templateObject_2$C || (templateObject_2$C = __makeTemplateObject(["\n margin: 0;\n"], ["\n margin: 0;\n"])));
|
|
6526
6527
|
var PercentageSpan = newStyled.span(templateObject_3$o || (templateObject_3$o = __makeTemplateObject(["\n font-weight: 700;\n text-decoration-line: underline;\n"], ["\n font-weight: 700;\n text-decoration-line: underline;\n"])));
|
|
6527
6528
|
var SizeFitGuide = function (_a) {
|
|
6528
6529
|
var title = _a.title, fitPercentageLabel = _a.fitPercentageLabel, fitPercentage = _a.fitPercentage, onClick = _a.onClick;
|
|
6529
|
-
return (jsxs$1(Container$
|
|
6530
|
+
return (jsxs$1(Container$D, { children: [jsx$1(TextButton, { LeadingIcon: Icon.PDP.Rule, size: ComponentSize.Small, text: title, onClick: onClick }, void 0), jsxs$1(P$3, { children: [fitPercentageLabel, " ", jsxs$1(PercentageSpan, { children: [fitPercentage, "%"] }, void 0)] }, void 0)] }, void 0));
|
|
6530
6531
|
};
|
|
6531
6532
|
var templateObject_1$Z, templateObject_2$C, templateObject_3$o;
|
|
6532
6533
|
|
|
@@ -6558,7 +6559,7 @@ var getStylesBySize$6 = function (size) {
|
|
|
6558
6559
|
};
|
|
6559
6560
|
}
|
|
6560
6561
|
};
|
|
6561
|
-
var Container$
|
|
6562
|
+
var Container$C = newStyled.div(templateObject_1$Y || (templateObject_1$Y = __makeTemplateObject(["\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n padding: ", ";\n display: inline-flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n width: ", ";\n height: ", ";\n text-align: center;\n cursor: default;\n"], ["\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n padding: ", ";\n display: inline-flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n width: ", ";\n height: ", ";\n text-align: center;\n cursor: default;\n"])), function (_a) {
|
|
6562
6563
|
var backgroundColor = _a.backgroundColor;
|
|
6563
6564
|
return backgroundColor;
|
|
6564
6565
|
}, function (_a) {
|
|
@@ -6595,7 +6596,7 @@ var H3$2 = newStyled.h3(templateObject_2$B || (templateObject_2$B = __makeTempla
|
|
|
6595
6596
|
var DiscountTag = function (_a) {
|
|
6596
6597
|
var discount = _a.discount, offText = _a.offText, disabled = _a.disabled, _b = _a.backgroundColor, backgroundColor = _b === void 0 ? '#fff' : _b, _c = _a.borderColor, borderColor = _c === void 0 ? 'transparent' : _c, _d = _a.textColor, textColor = _d === void 0 ? '#fff' : _d, _e = _a.size, size = _e === void 0 ? ComponentSize.Medium : _e;
|
|
6597
6598
|
var theme = useTheme();
|
|
6598
|
-
return (jsx$1(Container$
|
|
6599
|
+
return (jsx$1(Container$C, __assign({ backgroundColor: disabled ? theme.colors.shades['50'].color : backgroundColor, borderColor: disabled ? theme.colors.shades['50'].color : borderColor, size: size, "data-testid": "discount-container" }, { children: jsxs$1(H3$2, __assign({ textColor: disabled ? theme.colors.shades['250'].color : textColor, size: size }, { children: [discount, "% ", offText] }), void 0) }), void 0));
|
|
6599
6600
|
};
|
|
6600
6601
|
var templateObject_1$Y, templateObject_2$B;
|
|
6601
6602
|
|
|
@@ -6621,7 +6622,7 @@ var getStylesBySize$5 = function (size) {
|
|
|
6621
6622
|
};
|
|
6622
6623
|
}
|
|
6623
6624
|
};
|
|
6624
|
-
var Container$
|
|
6625
|
+
var Container$B = newStyled.div(templateObject_1$X || (templateObject_1$X = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
6625
6626
|
var Price = newStyled.h1(templateObject_2$A || (templateObject_2$A = __makeTemplateObject(["\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-decoration: ", ";\n margin: ", ";\n"], ["\n font-weight: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-decoration: ", ";\n margin: ", ";\n"])), function (_a) {
|
|
6626
6627
|
var weight = _a.weight;
|
|
6627
6628
|
return (weight ? weight : '400');
|
|
@@ -6652,7 +6653,7 @@ var TagContainer = newStyled.h1(templateObject_3$n || (templateObject_3$n = __ma
|
|
|
6652
6653
|
var PriceLabel = function (_a) {
|
|
6653
6654
|
var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, color = _a.color, _b = _a.size, size = _b === void 0 ? ComponentSize.Medium : _b;
|
|
6654
6655
|
var theme = useTheme();
|
|
6655
|
-
return (jsxs$1(Container$
|
|
6656
|
+
return (jsxs$1(Container$B, { children: [jsx$1(Price, __assign({ size: size, color: color || theme.colors.pallete.secondary.color, weight: 700, "data-testid": "price" }, { children: finalPrice }), void 0), originalPrice && (jsx$1(Price, __assign({ size: size, color: theme.colors.shades['300'].color, margin: true, underlined: true, "data-testid": "discount" }, { children: originalPrice }), void 0)), discount && (jsx$1(TagContainer, __assign({ size: size }, { children: jsx$1(DiscountTag, __assign({}, discount, { size: size }), void 0) }), void 0))] }, void 0));
|
|
6656
6657
|
};
|
|
6657
6658
|
var templateObject_1$X, templateObject_2$A, templateObject_3$n;
|
|
6658
6659
|
|
|
@@ -6717,7 +6718,7 @@ var ColorRadioGroup$1 = Object.assign(ColorRadioGroup, {
|
|
|
6717
6718
|
});
|
|
6718
6719
|
var templateObject_1$W, templateObject_2$z, templateObject_3$m, templateObject_4$e, templateObject_5$7;
|
|
6719
6720
|
|
|
6720
|
-
var Container$
|
|
6721
|
+
var Container$A = newStyled.div(templateObject_1$V || (templateObject_1$V = __makeTemplateObject(["\n width: 2rem;\n height: 2rem;\n border-radius: 50%;\n border: 0.081rem solid ", ";\n box-sizing: border-box;\n padding: 0.156rem;\n cursor: pointer;\n"], ["\n width: 2rem;\n height: 2rem;\n border-radius: 50%;\n border: 0.081rem solid ", ";\n box-sizing: border-box;\n padding: 0.156rem;\n cursor: pointer;\n"])), function (_a) {
|
|
6721
6722
|
var borderColor = _a.borderColor;
|
|
6722
6723
|
return borderColor;
|
|
6723
6724
|
});
|
|
@@ -6726,7 +6727,7 @@ var PatternSelector = function (_a) {
|
|
|
6726
6727
|
var url = _a.url, selected = _a.selected, testId = _a.testId;
|
|
6727
6728
|
var theme = useTheme();
|
|
6728
6729
|
var outerBorder = selected ? theme.colors.shades['550'].color : 'transparent';
|
|
6729
|
-
return (jsx$1(Container$
|
|
6730
|
+
return (jsx$1(Container$A, __assign({ "data-testid": testId, borderColor: outerBorder }, { children: jsx$1(Image$2, { src: url, alt: "pattern" }, void 0) }), void 0));
|
|
6730
6731
|
};
|
|
6731
6732
|
var templateObject_1$V, templateObject_2$y;
|
|
6732
6733
|
|
|
@@ -6791,11 +6792,11 @@ var ImageSmallPreview = function (_a) {
|
|
|
6791
6792
|
};
|
|
6792
6793
|
var templateObject_1$U;
|
|
6793
6794
|
|
|
6794
|
-
var Container$
|
|
6795
|
+
var Container$z = newStyled.div(templateObject_1$T || (templateObject_1$T = __makeTemplateObject(["\n grid-row-gap: 20px;\n display: grid;\n max-height: 45rem;\n height: min-content;\n overflow: auto;\n align-items: flex-start;\n"], ["\n grid-row-gap: 20px;\n display: grid;\n max-height: 45rem;\n height: min-content;\n overflow: auto;\n align-items: flex-start;\n"])));
|
|
6795
6796
|
var Button$5 = newStyled.button(templateObject_2$x || (templateObject_2$x = __makeTemplateObject(["\n padding: 0;\n border: none;\n text-decoration: none;\n background: transparent;\n"], ["\n padding: 0;\n border: none;\n text-decoration: none;\n background: transparent;\n"])));
|
|
6796
6797
|
var ImagePreviewList = function (_a) {
|
|
6797
6798
|
var images = _a.images, selectedImage = _a.selectedImage, onClick = _a.onClick, testId = _a.testId;
|
|
6798
|
-
return (jsx$1(Container$
|
|
6799
|
+
return (jsx$1(Container$z, __assign({ "data-testid": testId }, { children: images.map(function (item) {
|
|
6799
6800
|
return (jsx$1(Button$5, __assign({ onClick: function () { return onClick(item); } }, { children: jsx$1(ImageSmallPreview, { imageUrl: item.imageUrl, alt: item.alt, selected: item.key === selectedImage.key }, void 0) }), item.key));
|
|
6800
6801
|
}) }), void 0));
|
|
6801
6802
|
};
|
|
@@ -6808,16 +6809,16 @@ var Image = function (_a) {
|
|
|
6808
6809
|
};
|
|
6809
6810
|
var templateObject_1$S;
|
|
6810
6811
|
|
|
6811
|
-
var Container$
|
|
6812
|
+
var Container$y = newStyled.div(templateObject_1$R || (templateObject_1$R = __makeTemplateObject(["\n position: relative;\n height: 45rem;\n"], ["\n position: relative;\n height: 45rem;\n"])));
|
|
6812
6813
|
var TopTagContainer$1 = newStyled.div(templateObject_2$w || (templateObject_2$w = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n"])));
|
|
6813
6814
|
var BottomTagContainer$1 = newStyled.div(templateObject_3$l || (templateObject_3$l = __makeTemplateObject(["\n position: absolute;\n bottom: 3.75rem;\n left: 0;\n"], ["\n position: absolute;\n bottom: 3.75rem;\n left: 0;\n"])));
|
|
6814
6815
|
var ImageProductWithTags$1 = function (_a) {
|
|
6815
6816
|
var image = _a.image, DiscountTagElement = _a.DiscountTagElement, BestSellerTagElement = _a.BestSellerTagElement, testId = _a.testId;
|
|
6816
|
-
return (jsxs$1(Container$
|
|
6817
|
+
return (jsxs$1(Container$y, __assign({ "data-testid": testId }, { children: [jsx$1(Image, { src: image.imageUrl, alt: image.alt, objectFit: "cover", objectPosition: "center", width: "530px", height: "720px" }, void 0), jsx$1(TopTagContainer$1, { children: DiscountTagElement }, void 0), jsx$1(BottomTagContainer$1, { children: BestSellerTagElement }, void 0)] }), void 0));
|
|
6817
6818
|
};
|
|
6818
6819
|
var templateObject_1$R, templateObject_2$w, templateObject_3$l;
|
|
6819
6820
|
|
|
6820
|
-
var Container$
|
|
6821
|
+
var Container$x = newStyled.div(templateObject_1$Q || (templateObject_1$Q = __makeTemplateObject(["\n display: grid;\n grid-template-columns: auto auto;\n grid-column-gap: 20px;\n max-height: 45rem;\n width: fit-content;\n"], ["\n display: grid;\n grid-template-columns: auto auto;\n grid-column-gap: 20px;\n max-height: 45rem;\n width: fit-content;\n"])));
|
|
6821
6822
|
var ProductGallery = function (_a) {
|
|
6822
6823
|
var images = _a.images, selectedValue = _a.selectedValue, DiscountTagElement = _a.DiscountTagElement, BestSellerTagElement = _a.BestSellerTagElement, productImageDataTestId = _a.productImageDataTestId, previewListDataTestId = _a.previewListDataTestId;
|
|
6823
6824
|
var initialValue = selectedValue && images.includes(selectedValue) ? selectedValue : images[0];
|
|
@@ -6825,7 +6826,7 @@ var ProductGallery = function (_a) {
|
|
|
6825
6826
|
useEffect(function () {
|
|
6826
6827
|
setSelectedImage(initialValue);
|
|
6827
6828
|
}, [initialValue]);
|
|
6828
|
-
return (jsxs$1(Container$
|
|
6829
|
+
return (jsxs$1(Container$x, { children: [jsx$1(ImagePreviewList, { images: images, selectedImage: selectedImage, testId: previewListDataTestId, onClick: function (value) {
|
|
6829
6830
|
setSelectedImage(value);
|
|
6830
6831
|
} }, void 0), jsx$1(ImageProductWithTags$1, { image: selectedImage, DiscountTagElement: DiscountTagElement, BestSellerTagElement: BestSellerTagElement, testId: productImageDataTestId }, void 0)] }, void 0));
|
|
6831
6832
|
};
|
|
@@ -6867,7 +6868,7 @@ var StarStyles = {
|
|
|
6867
6868
|
});
|
|
6868
6869
|
},
|
|
6869
6870
|
};
|
|
6870
|
-
var Container$
|
|
6871
|
+
var Container$w = newStyled.div(templateObject_1$P || (templateObject_1$P = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
6871
6872
|
var templateObject_1$P;
|
|
6872
6873
|
|
|
6873
6874
|
var StarContainer = newStyled.div(function (_a) {
|
|
@@ -6885,7 +6886,7 @@ var sizes = {
|
|
|
6885
6886
|
};
|
|
6886
6887
|
var StarList = function (_a) {
|
|
6887
6888
|
var rating = _a.rating, starsNumber = _a.starsNumber, fill = _a.fill, _b = _a.size, size = _b === void 0 ? ComponentSize.Medium : _b;
|
|
6888
|
-
return (jsx$1(Container$
|
|
6889
|
+
return (jsx$1(Container$w, { children: __spreadArray([], new Array(starsNumber), true).map(function (_, index) {
|
|
6889
6890
|
return (jsx$1(StarContainer, __assign({ "data-testid": "star-container", size: size }, { children: index < Math.floor(rating) ? (jsx$1(Icon.PDP.Star, __assign({}, sizes[size], { fill: fill }), void 0)) : index === Math.floor(rating) && rating % 1 != 0 ? (jsx$1(Icon.PDP.StarHalf, __assign({}, sizes[size], { fill: fill }), void 0)) : (jsx$1(Icon.PDP.StarEmpty, __assign({}, sizes[size], { fill: fill }), void 0)) }), index));
|
|
6890
6891
|
}) }, void 0));
|
|
6891
6892
|
};
|
|
@@ -6929,7 +6930,7 @@ var LabelStyles = {
|
|
|
6929
6930
|
});
|
|
6930
6931
|
},
|
|
6931
6932
|
};
|
|
6932
|
-
var Container$
|
|
6933
|
+
var Container$v = newStyled.div(templateObject_1$O || (templateObject_1$O = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
6933
6934
|
var templateObject_1$O;
|
|
6934
6935
|
|
|
6935
6936
|
var CustomLabel = newStyled.div(function (_a) {
|
|
@@ -6943,10 +6944,10 @@ var starsNumber = 5;
|
|
|
6943
6944
|
var Rating = function (_a) {
|
|
6944
6945
|
var _b = _a.size, size = _b === void 0 ? ComponentSize.Medium : _b, reviews = _a.reviews, reviewsText = _a.reviewsText, rating = _a.rating;
|
|
6945
6946
|
var theme = useTheme();
|
|
6946
|
-
return (jsxs$1(Container$
|
|
6947
|
+
return (jsxs$1(Container$v, { children: [jsx$1(StarList, { rating: rating, size: size, starsNumber: starsNumber, fill: theme.colors.pallete.primary.color }, void 0), jsxs$1(CustomLabel, __assign({ theme: theme, size: size, "data-testid": "CustomLabel" }, { children: [reviews, " ", reviewsText] }), void 0)] }, void 0));
|
|
6947
6948
|
};
|
|
6948
6949
|
|
|
6949
|
-
var Container$
|
|
6950
|
+
var Container$u = newStyled.div(templateObject_1$N || (templateObject_1$N = __makeTemplateObject(["\n display: flex;\n align-items: center;\n font-size: 0.88rem;\n"], ["\n display: flex;\n align-items: center;\n font-size: 0.88rem;\n"])));
|
|
6950
6951
|
var P$2 = newStyled.p(templateObject_2$v || (templateObject_2$v = __makeTemplateObject(["\n margin: 0 0.25rem;\n font-weight: 700;\n color: ", ";\n"], ["\n margin: 0 0.25rem;\n font-weight: 700;\n color: ", ";\n"])), function (props) { return props.theme.colors.shades['550'].color; });
|
|
6951
6952
|
var textButtonStyles = function (theme) { return ({
|
|
6952
6953
|
border: 'none',
|
|
@@ -6960,7 +6961,7 @@ var textButtonStyles = function (theme) { return ({
|
|
|
6960
6961
|
var FitPredictor = function (_a) {
|
|
6961
6962
|
var onClick = _a.onClick;
|
|
6962
6963
|
var theme = useTheme();
|
|
6963
|
-
return (jsxs(Container$
|
|
6964
|
+
return (jsxs(Container$u, __assign({ theme: theme }, { children: [jsx(Container$u, { children: jsx(Icon.Other.FitPredictor, { width: 1.125, height: 1.125, fill: theme.colors.shades['550'].color }, void 0) }, void 0), jsx(P$2, __assign({ theme: theme }, { children: "FIT PREDICTOR" }), void 0), jsx(BaseButton, __assign({ css: textButtonStyles(theme), onClick: onClick }, { children: "Calculate your size" }), void 0)] }), void 0));
|
|
6964
6965
|
};
|
|
6965
6966
|
var templateObject_1$N, templateObject_2$v;
|
|
6966
6967
|
|
|
@@ -6999,7 +7000,7 @@ var Background = newStyled.div(function (_a) {
|
|
|
6999
7000
|
position: 'absolute',
|
|
7000
7001
|
});
|
|
7001
7002
|
});
|
|
7002
|
-
var Container$
|
|
7003
|
+
var Container$t = newStyled.div(function (_a) {
|
|
7003
7004
|
var widthAuto = _a.widthAuto;
|
|
7004
7005
|
return ({
|
|
7005
7006
|
width: widthAuto ? 'auto' : 'fit-content',
|
|
@@ -7013,7 +7014,7 @@ var getBarWithBasedOnPercent = function (percent) {
|
|
|
7013
7014
|
var ProgressBar = function (_a) {
|
|
7014
7015
|
var description = _a.description, fillColor = _a.fillColor, _b = _a.widthAuto, widthAuto = _b === void 0 ? true : _b, percent = _a.percent;
|
|
7015
7016
|
var theme = useTheme();
|
|
7016
|
-
return (jsxs$1(Container$
|
|
7017
|
+
return (jsxs$1(Container$t, __assign({ "data-testid": "PBContainer", widthAuto: widthAuto }, { children: [jsx$1(Background, __assign({ backgroundColor: theme.colors.shades['100'].color }, { children: jsx$1(Bar, { "data-testid": "PBBar", backgroundColor: fillColor, percent: percent }, void 0) }), void 0), description && jsx$1(H2$1, __assign({ color: theme.colors.pallete.secondary.color }, { children: description }), void 0)] }), void 0));
|
|
7017
7018
|
};
|
|
7018
7019
|
var templateObject_1$M;
|
|
7019
7020
|
|
|
@@ -7036,7 +7037,7 @@ var getStylesBySize$4 = function (size) {
|
|
|
7036
7037
|
};
|
|
7037
7038
|
}
|
|
7038
7039
|
};
|
|
7039
|
-
var Container$
|
|
7040
|
+
var Container$s = newStyled.div(templateObject_1$L || (templateObject_1$L = __makeTemplateObject(["\n background-color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s ease;\n\n svg {\n margin: ", ";\n }\n\n &:hover {\n background-color: ", ";\n cursor: pointer;\n }\n\n &.disabled {\n background-color: ", ";\n cursor: not-allowed;\n\n svg path {\n fill: ", ";\n }\n }\n"], ["\n background-color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s ease;\n\n svg {\n margin: ", ";\n }\n\n &:hover {\n background-color: ", ";\n cursor: pointer;\n }\n\n &.disabled {\n background-color: ", ";\n cursor: not-allowed;\n\n svg path {\n fill: ", ";\n }\n }\n"])), function (_a) {
|
|
7040
7041
|
var backgroundColor = _a.backgroundColor;
|
|
7041
7042
|
return backgroundColor;
|
|
7042
7043
|
}, function (_a) {
|
|
@@ -7064,7 +7065,7 @@ var Container$r = newStyled.div(templateObject_1$L || (templateObject_1$L = __ma
|
|
|
7064
7065
|
var IconButton = function (_a) {
|
|
7065
7066
|
var children = _a.children, disabled = _a.disabled, _b = _a.size, size = _b === void 0 ? ComponentSize.Medium : _b, onClick = _a.onClick;
|
|
7066
7067
|
var theme = useTheme();
|
|
7067
|
-
return (jsx$1(Container$
|
|
7068
|
+
return (jsx$1(Container$s, __assign({ className: disabled ? 'disabled' : '', backgroundColor: theme.component.button.primary.active.backgroundColor, hoverBackgroundColor: theme.component.button.secondary.active.backgroundColor, disabledColor: theme.colors.shades['50'].color, disabledIconColor: theme.colors.shades['200'].color, size: size, "data-testid": "Container", onClick: disabled ? function () { } : onClick }, { children: children }), void 0));
|
|
7068
7069
|
};
|
|
7069
7070
|
var templateObject_1$L;
|
|
7070
7071
|
|
|
@@ -7211,7 +7212,7 @@ var Tooltip = function (_a) {
|
|
|
7211
7212
|
var ref = tooltipRef.current;
|
|
7212
7213
|
setTooltipHeight((ref === null || ref === void 0 ? void 0 : ref.offsetHeight) || 0);
|
|
7213
7214
|
}, [tooltipRef]);
|
|
7214
|
-
return (jsxs$1(Wrapper$5, __assign({ position: position, "data-testid": "TooltipWrapper" }, { children: [jsx$1("div", __assign({ ref: childrenRef }, { children: children }), void 0), jsxs$1(TooltipContainer, __assign({ position: position, align: align, childrenWidth: childrenWidth, tooltipHeight: tooltipHeight, ref: tooltipRef, onClick: onClick, "data-testid": "TooltipContainer", className: "tooltip-container" }, { children: [jsxs$1(ContentWrapper, __assign({ borderColor: theme.colors.shades['200'].color }, { children: [header && (jsxs$1(TopSection, __assign({ "data-testid": "TooltipHeader" }, { children: [jsx$1(IconContainer$4, { children:
|
|
7215
|
+
return (jsxs$1(Wrapper$5, __assign({ position: position, "data-testid": "TooltipWrapper" }, { children: [jsx$1("div", __assign({ ref: childrenRef }, { children: children }), void 0), jsxs$1(TooltipContainer, __assign({ position: position, align: align, childrenWidth: childrenWidth, tooltipHeight: tooltipHeight, ref: tooltipRef, onClick: onClick, "data-testid": "TooltipContainer", className: "tooltip-container" }, { children: [jsxs$1(ContentWrapper, __assign({ borderColor: theme.colors.shades['200'].color }, { children: [header && (jsxs$1(TopSection, __assign({ "data-testid": "TooltipHeader" }, { children: [jsx$1(IconContainer$4, { children: React__default.createElement(header.Icon, { fill: theme.colors.pallete.secondary.color }) }, void 0), jsx$1(Title$4, __assign({ color: theme.colors.pallete.secondary.color }, { children: header.title }), void 0)] }), void 0)), jsx$1(TooltipText, __assign({ color: theme.colors.pallete.secondary.color, "data-testid": "TooltipText" }, { children: text }), void 0)] }), void 0), jsx$1(TooltipArrowContainer, __assign({ position: position, "data-testid": "TooltipArrow" }, { children: jsx$1(TooltipArrow, { width: 1.25, height: 0.75, fill: "#ffffff", stroke: theme.colors.shades['10'].color }, void 0) }), void 0)] }), void 0)] }), void 0));
|
|
7215
7216
|
};
|
|
7216
7217
|
|
|
7217
7218
|
/* base styles & variants */
|
|
@@ -7346,7 +7347,7 @@ var ContainerStyles = {
|
|
|
7346
7347
|
};
|
|
7347
7348
|
|
|
7348
7349
|
var Wrapper$4 = newStyled.div(templateObject_1$J || (templateObject_1$J = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
7349
|
-
var Container$
|
|
7350
|
+
var Container$r = newStyled.div(__assign({}, ContainerStyles.baseStyles), function (props) { return [ContainerStyles[props.size](props.theme)]; });
|
|
7350
7351
|
var Input$2 = newStyled.input(templateObject_2$t || (templateObject_2$t = __makeTemplateObject(["\n position: absolute;\n opacity: 0;\n cursor: ", ";\n height: 100%;\n width: 100%;\n margin: 0;\n"], ["\n position: absolute;\n opacity: 0;\n cursor: ", ";\n height: 100%;\n width: 100%;\n margin: 0;\n"])), function (_a) {
|
|
7351
7352
|
var disabled = _a.disabled;
|
|
7352
7353
|
return (disabled ? 'not-allowed' : 'pointer');
|
|
@@ -7362,7 +7363,7 @@ var RadioInput = function (_a) {
|
|
|
7362
7363
|
var value = event.currentTarget.value;
|
|
7363
7364
|
onChange({ value: value, label: label });
|
|
7364
7365
|
};
|
|
7365
|
-
return (jsxs$1(Wrapper$4, { children: [jsxs$1(Container$
|
|
7366
|
+
return (jsxs$1(Wrapper$4, { children: [jsxs$1(Container$r, __assign({ theme: theme, size: size, "data-testid": "container" }, { children: [jsx$1(Input$2, { id: "".concat(name, "-").concat(id), type: "radio", name: name, value: value, checked: checked, onChange: function (e) { return (disabled ? null : handleChange(e, label)); }, disabled: disabled }, void 0), jsx$1(CustomRadio, { size: size, isChecked: checked, disabled: disabled, theme: theme, "data-testid": "custom-radio" }, void 0)] }), void 0), jsx$1(Label$2, __assign({ htmlFor: "".concat(name, "-").concat(id), "data-testid": "label", variant: "regular", size: size, disabled: disabled }, { children: label }), void 0)] }, void 0));
|
|
7366
7367
|
};
|
|
7367
7368
|
var templateObject_1$J, templateObject_2$t;
|
|
7368
7369
|
|
|
@@ -7379,7 +7380,7 @@ var RadioGroupInput = function (_a) {
|
|
|
7379
7380
|
};
|
|
7380
7381
|
|
|
7381
7382
|
var Wrapper$3 = newStyled.div(templateObject_1$I || (templateObject_1$I = __makeTemplateObject(["\n padding: 0.625rem 1.5rem;\n"], ["\n padding: 0.625rem 1.5rem;\n"])));
|
|
7382
|
-
var Container$
|
|
7383
|
+
var Container$q = newStyled.div(templateObject_2$s || (templateObject_2$s = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
7383
7384
|
var Text$4 = newStyled.h4(templateObject_3$j || (templateObject_3$j = __makeTemplateObject(["\n font-size: 0.875rem;\n line-height: 1.375rem;\n color: ", ";\n font-weight: ", ";\n margin: ", ";\n"], ["\n font-size: 0.875rem;\n line-height: 1.375rem;\n color: ", ";\n font-weight: ", ";\n margin: ", ";\n"])), function (_a) {
|
|
7384
7385
|
var color = _a.color;
|
|
7385
7386
|
return color;
|
|
@@ -7393,18 +7394,18 @@ var Text$4 = newStyled.h4(templateObject_3$j || (templateObject_3$j = __makeTemp
|
|
|
7393
7394
|
var Minimalistic = function (_a) {
|
|
7394
7395
|
var _b = _a.backgroundColor, backgroundColor = _b === void 0 ? '#FCFAF7' : _b, _c = _a.borderColor, borderColor = _c === void 0 ? '#E7C9B2' : _c, originalPrice = _a.originalPrice, price = _a.price, savingPrice = _a.savingPrice, getMorePayLessText = _a.getMorePayLessText, youAreSavingText = _a.youAreSavingText, getQtyForText = _a.getQtyForText, discount = _a.discount, offText = _a.offText, _d = _a.widthAuto, widthAuto = _d === void 0 ? false : _d;
|
|
7395
7396
|
var theme = useTheme();
|
|
7396
|
-
return (jsx$1(Card$1, __assign({ backgroundColor: backgroundColor, widthAuto: widthAuto, border: { borderColor: borderColor, borderWidth: '0.063rem' }, flex: false }, { children: jsxs$1(Wrapper$3, { children: [jsxs$1(Container$
|
|
7397
|
+
return (jsx$1(Card$1, __assign({ backgroundColor: backgroundColor, widthAuto: widthAuto, border: { borderColor: borderColor, borderWidth: '0.063rem' }, flex: false }, { children: jsxs$1(Wrapper$3, { children: [jsxs$1(Container$q, __assign({ "data-testid": "TopSection" }, { children: [jsx$1(Text$4, __assign({ color: theme.colors.pallete.secondary.color, weight: "600", margin: "0 1.25rem 0 0" }, { children: getMorePayLessText }), void 0), jsx$1(PriceLabel, { finalPrice: price, originalPrice: originalPrice, color: "#3A3A3A", size: ComponentSize.Small }, void 0)] }), void 0), jsxs$1(Container$q, __assign({ "data-testid": "BottomSection" }, { children: [jsxs$1(Text$4, __assign({ color: "#d3373c", weight: "600", margin: "0 1.25rem 0 0" }, { children: [getQtyForText, " ", discount, "% ", offText] }), void 0), jsxs$1(Text$4, __assign({ color: theme.colors.pallete.secondary.color }, { children: [youAreSavingText, ": ", savingPrice] }), void 0)] }), void 0)] }, void 0) }), void 0));
|
|
7397
7398
|
};
|
|
7398
7399
|
var templateObject_1$I, templateObject_2$s, templateObject_3$j;
|
|
7399
7400
|
|
|
7400
|
-
var Container$
|
|
7401
|
+
var Container$p = newStyled.div(templateObject_1$H || (templateObject_1$H = __makeTemplateObject(["\n padding: 0.625rem 1.5rem;\n"], ["\n padding: 0.625rem 1.5rem;\n"])));
|
|
7401
7402
|
var Title$3 = newStyled.h1(templateObject_2$r || (templateObject_2$r = __makeTemplateObject(["\n font-weight: 700;\n font-size: 1rem;\n line-height: 1.25rem;\n color: ", ";\n margin: 0;\n margin-bottom: 0.125rem;\n text-align: center;\n"], ["\n font-weight: 700;\n font-size: 1rem;\n line-height: 1.25rem;\n color: ", ";\n margin: 0;\n margin-bottom: 0.125rem;\n text-align: center;\n"])), function (props) { return props.color; });
|
|
7402
7403
|
var Details$1 = newStyled.span(templateObject_3$i || (templateObject_3$i = __makeTemplateObject(["\n display: flex;\n align-items: center;\n font-weight: 400;\n font-size: 1rem;\n margin: 0;\n line-height: 1.5rem;\n justify-content: center;\n color: ", ";\n"], ["\n display: flex;\n align-items: center;\n font-weight: 400;\n font-size: 1rem;\n margin: 0;\n line-height: 1.5rem;\n justify-content: center;\n color: ", ";\n"])), function (props) { return props.color; });
|
|
7403
7404
|
var PriceContainer$1 = newStyled.span(templateObject_4$c || (templateObject_4$c = __makeTemplateObject(["\n margin: 0 0.313rem;\n display: flex;\n align-items: center;\n"], ["\n margin: 0 0.313rem;\n display: flex;\n align-items: center;\n"])));
|
|
7404
7405
|
var Simple = function (_a) {
|
|
7405
7406
|
var title = _a.title, freeShippingText = _a.freeShippingText, price = _a.price, anyQtyForText = _a.anyQtyForText, backgroundColor = _a.backgroundColor, _b = _a.widthAuto, widthAuto = _b === void 0 ? false : _b;
|
|
7406
7407
|
var theme = useTheme();
|
|
7407
|
-
return (jsx$1(Card$1, __assign({ backgroundColor: backgroundColor, widthAuto: widthAuto }, { children: jsxs$1(Container$
|
|
7408
|
+
return (jsx$1(Card$1, __assign({ backgroundColor: backgroundColor, widthAuto: widthAuto }, { children: jsxs$1(Container$p, { children: [jsx$1(Title$3, __assign({ color: theme.colors.pallete.secondary.color, "data-testid": "Title" }, { children: title }), void 0), jsxs$1(Details$1, __assign({ color: theme.colors.pallete.secondary.color, "data-testid": "Details" }, { children: [anyQtyForText, jsx$1(PriceContainer$1, __assign({ "data-testid": "Price" }, { children: jsx$1(PriceLabel, { finalPrice: price, color: "#d3373c", size: ComponentSize.Small }, void 0) }), void 0), "+ ", freeShippingText] }), void 0)] }, void 0) }), void 0));
|
|
7408
7409
|
};
|
|
7409
7410
|
var templateObject_1$H, templateObject_2$r, templateObject_3$i, templateObject_4$c;
|
|
7410
7411
|
|
|
@@ -7413,10 +7414,10 @@ var Bundle = {
|
|
|
7413
7414
|
Simple: Simple,
|
|
7414
7415
|
};
|
|
7415
7416
|
|
|
7416
|
-
var Container$
|
|
7417
|
+
var Container$o = newStyled.div(templateObject_1$G || (templateObject_1$G = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n"])));
|
|
7417
7418
|
var Tag = function (_a) {
|
|
7418
7419
|
var text = _a.text, className = _a.className;
|
|
7419
|
-
return jsx$1(Container$
|
|
7420
|
+
return jsx$1(Container$o, __assign({ className: className }, { children: text }), void 0);
|
|
7420
7421
|
};
|
|
7421
7422
|
var templateObject_1$G;
|
|
7422
7423
|
|
|
@@ -7590,7 +7591,7 @@ var Error$1 = function (_a) {
|
|
|
7590
7591
|
};
|
|
7591
7592
|
var templateObject_1$E, templateObject_2$p;
|
|
7592
7593
|
|
|
7593
|
-
var Container$
|
|
7594
|
+
var Container$n = newStyled.div(templateObject_1$D || (templateObject_1$D = __makeTemplateObject(["\n input {\n border-color: ", ";\n }\n"], ["\n input {\n border-color: ", ";\n }\n"])), function (_a) {
|
|
7594
7595
|
var color = _a.color;
|
|
7595
7596
|
return color;
|
|
7596
7597
|
});
|
|
@@ -7694,7 +7695,7 @@ var BaseInput = function (_a) {
|
|
|
7694
7695
|
highlight: theme.colors.border.highlight,
|
|
7695
7696
|
boxShadow: theme.component.input.boxShadow,
|
|
7696
7697
|
};
|
|
7697
|
-
return (jsxs$1(Container$
|
|
7698
|
+
return (jsxs$1(Container$n, __assign({ color: status === InputValidationType.Valid
|
|
7698
7699
|
? theme.colors.shades['700'].color
|
|
7699
7700
|
: status === InputValidationType.Error
|
|
7700
7701
|
? theme.colors.semantic.urgent.color
|
|
@@ -7715,7 +7716,7 @@ var Button$4 = function (_a) {
|
|
|
7715
7716
|
throw new Error("Invalid button variant ".concat(variant));
|
|
7716
7717
|
};
|
|
7717
7718
|
|
|
7718
|
-
var Container$
|
|
7719
|
+
var Container$m = newStyled.div(templateObject_1$C || (templateObject_1$C = __makeTemplateObject(["\n overflow: hidden;\n\n input {\n border-radius: ", ";\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: none;\n width: 100%;\n }\n"], ["\n overflow: hidden;\n\n input {\n border-radius: ", ";\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: none;\n width: 100%;\n }\n"])), function (_a) {
|
|
7719
7720
|
var theme = _a.theme;
|
|
7720
7721
|
return theme.component.inputCustom.input.borderRadius;
|
|
7721
7722
|
});
|
|
@@ -7732,7 +7733,7 @@ var Custom = function (_a) {
|
|
|
7732
7733
|
text: text,
|
|
7733
7734
|
disabled: rest.disabled,
|
|
7734
7735
|
}); }, [variant, onClick, text, rest.disabled]);
|
|
7735
|
-
return (jsx$1(Container$
|
|
7736
|
+
return (jsx$1(Container$m, __assign({ theme: theme }, { children: jsx$1(BaseInput, __assign({}, rest, { children: jsx$1(ButtonContainer$1, __assign({ theme: theme }, { children: jsx$1(Button$4, __assign({}, props), void 0) }), void 0) }), void 0) }), void 0));
|
|
7736
7737
|
};
|
|
7737
7738
|
var templateObject_1$C, templateObject_2$n;
|
|
7738
7739
|
|
|
@@ -7767,13 +7768,13 @@ var BasePlusButton = function (_a) {
|
|
|
7767
7768
|
};
|
|
7768
7769
|
var templateObject_1$A;
|
|
7769
7770
|
|
|
7770
|
-
var Container$
|
|
7771
|
+
var Container$l = newStyled.div(templateObject_1$z || (templateObject_1$z = __makeTemplateObject(["\n input {\n padding-right: 2.688rem;\n }\n"], ["\n input {\n padding-right: 2.688rem;\n }\n"])));
|
|
7771
7772
|
var IconContainer$3 = newStyled.div(templateObject_2$l || (templateObject_2$l = __makeTemplateObject(["\n position: absolute;\n right: 0.875rem;\n width: 1.125rem;\n height: 100%;\n display: flex;\n align-items: center;\n\n svg path {\n fill: ", ";\n }\n"], ["\n position: absolute;\n right: 0.875rem;\n width: 1.125rem;\n height: 100%;\n display: flex;\n align-items: center;\n\n svg path {\n fill: ", ";\n }\n"])), function (props) { return props.color; });
|
|
7772
7773
|
var BasePlusIcon = function (_a) {
|
|
7773
7774
|
var Icon = _a.Icon, rest = __rest(_a, ["Icon"]);
|
|
7774
7775
|
var theme = useTheme();
|
|
7775
7776
|
var _b = useState(InputValidationType.Empty), status = _b[0], setStatus = _b[1];
|
|
7776
|
-
return (jsx$1(Container$
|
|
7777
|
+
return (jsx$1(Container$l, { children: jsx$1(BaseInput, __assign({}, rest, { onValidation: setStatus }, { children: jsx$1(IconContainer$3, __assign({ color: status === InputValidationType.Valid
|
|
7777
7778
|
? theme.colors.shades['700'].color
|
|
7778
7779
|
: status === InputValidationType.Error
|
|
7779
7780
|
? theme.colors.semantic.urgent.color
|
|
@@ -7788,7 +7789,7 @@ var Input$1 = {
|
|
|
7788
7789
|
SimplePlusIcon: BasePlusIcon,
|
|
7789
7790
|
};
|
|
7790
7791
|
|
|
7791
|
-
var Container$
|
|
7792
|
+
var Container$k = newStyled.div(templateObject_1$y || (templateObject_1$y = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n border: 0.063rem solid ", ";\n border-radius: 0.25rem;\n padding: 0.375rem;\n cursor: ", ";\n"], ["\n width: ", ";\n height: ", ";\n border: 0.063rem solid ", ";\n border-radius: 0.25rem;\n padding: 0.375rem;\n cursor: ", ";\n"])), function (_a) {
|
|
7792
7793
|
var width = _a.width;
|
|
7793
7794
|
return width;
|
|
7794
7795
|
}, function (_a) {
|
|
@@ -7804,7 +7805,7 @@ var Container$j = newStyled.div(templateObject_1$y || (templateObject_1$y = __ma
|
|
|
7804
7805
|
var PaymentMethod = function (_a) {
|
|
7805
7806
|
var Icon = _a.Icon, width = _a.width, height = _a.height, onClick = _a.onClick;
|
|
7806
7807
|
var theme = useTheme();
|
|
7807
|
-
return (jsx$1(Container$
|
|
7808
|
+
return (jsx$1(Container$k, __assign({ width: width, height: height, borderColor: theme.colors.shades['100'].color, isClickable: Boolean(onClick), onClick: onClick, "data-testid": "payment-method-container" }, { children: createElement(Icon) }), void 0));
|
|
7808
7809
|
};
|
|
7809
7810
|
var templateObject_1$y;
|
|
7810
7811
|
|
|
@@ -7825,12 +7826,12 @@ var templateObject_1$x;
|
|
|
7825
7826
|
var Wrapper$2 = newStyled.div(templateObject_1$w || (templateObject_1$w = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n"])));
|
|
7826
7827
|
var GrandTotal = newStyled.h1(templateObject_2$k || (templateObject_2$k = __makeTemplateObject(["\n margin: 0;\n font-size: 1.5rem;\n line-height: 2rem;\n font-weight: 700;\n color: ", ";\n display: flex;\n align-items: center;\n"], ["\n margin: 0;\n font-size: 1.5rem;\n line-height: 2rem;\n font-weight: 700;\n color: ", ";\n display: flex;\n align-items: center;\n"])), function (props) { return props.color; });
|
|
7827
7828
|
var Currency = newStyled.span(templateObject_3$f || (templateObject_3$f = __makeTemplateObject(["\n margin: 0;\n margin-right: 0.625rem;\n font-size: 0.875rem;\n line-height: 1.375rem;\n font-weight: 600;\n"], ["\n margin: 0;\n margin-right: 0.625rem;\n font-size: 0.875rem;\n line-height: 1.375rem;\n font-weight: 600;\n"])));
|
|
7828
|
-
var Container$
|
|
7829
|
+
var Container$j = newStyled.div(templateObject_4$b || (templateObject_4$b = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-top: 0.625rem;\n color: ", ";\n"], ["\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-top: 0.625rem;\n color: ", ";\n"])), function (props) { return props.highlightColor; });
|
|
7829
7830
|
var Discount = newStyled.h3(templateObject_5$5 || (templateObject_5$5 = __makeTemplateObject(["\n margin: 0;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 600;\n"], ["\n margin: 0;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 600;\n"])));
|
|
7830
7831
|
var Total = function (_a) {
|
|
7831
7832
|
var total = _a.total, currency = _a.currency, saving = _a.saving, _b = _a.highlightColor, highlightColor = _b === void 0 ? '#2f806a' : _b;
|
|
7832
7833
|
var theme = useTheme();
|
|
7833
|
-
return (jsxs$1(Wrapper$2, __assign({ "data-testid": "total-wrapper" }, { children: [jsxs$1(GrandTotal, __assign({ color: theme.colors.shades['550'].color }, { children: [jsx$1(Currency, { children: currency }, void 0), total] }), void 0), saving && (jsxs$1(Container$
|
|
7834
|
+
return (jsxs$1(Wrapper$2, __assign({ "data-testid": "total-wrapper" }, { children: [jsxs$1(GrandTotal, __assign({ color: theme.colors.shades['550'].color }, { children: [jsx$1(Currency, { children: currency }, void 0), total] }), void 0), saving && (jsxs$1(Container$j, __assign({ "data-testid": "subtotal-container", highlightColor: highlightColor }, { children: [jsx$1(Discount, { children: saving.savingText }, void 0), jsx$1(Discount, { children: saving.amount }, void 0)] }), void 0))] }), void 0));
|
|
7834
7835
|
};
|
|
7835
7836
|
var templateObject_1$w, templateObject_2$k, templateObject_3$f, templateObject_4$b, templateObject_5$5;
|
|
7836
7837
|
|
|
@@ -7859,13 +7860,13 @@ var Totals = {
|
|
|
7859
7860
|
Subtotal: Subtotal,
|
|
7860
7861
|
};
|
|
7861
7862
|
|
|
7862
|
-
var Container$
|
|
7863
|
+
var Container$i = newStyled.div(templateObject_1$u || (templateObject_1$u = __makeTemplateObject(["\n padding: 0.625rem 1.25rem;\n background-color: ", ";\n border-radius: 0.313rem;\n display: flex;\n margin-bottom: 0.938rem;\n"], ["\n padding: 0.625rem 1.25rem;\n background-color: ", ";\n border-radius: 0.313rem;\n display: flex;\n margin-bottom: 0.938rem;\n"])), function (props) { return props.color; });
|
|
7863
7864
|
var IconContainer$2 = newStyled.div(templateObject_2$i || (templateObject_2$i = __makeTemplateObject(["\n width: 1rem;\n height: 0.875rem;\n margin-right: 0.5rem;\n margin-top: 0.125rem;\n"], ["\n width: 1rem;\n height: 0.875rem;\n margin-right: 0.5rem;\n margin-top: 0.125rem;\n"])));
|
|
7864
7865
|
var Text$2 = newStyled.p(templateObject_3$d || (templateObject_3$d = __makeTemplateObject(["\n font-size: 0.875rem;\n line-height: 1.375rem;\n font-weight: 400;\n margin: 0;\n color: ", ";\n"], ["\n font-size: 0.875rem;\n line-height: 1.375rem;\n font-weight: 400;\n margin: 0;\n color: ", ";\n"])), function (props) { return props.color; });
|
|
7865
7866
|
var Details = newStyled.span(templateObject_4$9 || (templateObject_4$9 = __makeTemplateObject(["\n color: ", ";\n font-weight: 700;\n"], ["\n color: ", ";\n font-weight: 700;\n"])), function (props) { return props.color; });
|
|
7866
7867
|
var Note = function (_a) {
|
|
7867
7868
|
var accentColor = _a.accentColor, color = _a.color, backgroundColor = _a.backgroundColor, importantNoteText = _a.importantNoteText, text = _a.text;
|
|
7868
|
-
return (jsxs$1(Container$
|
|
7869
|
+
return (jsxs$1(Container$i, __assign({ color: backgroundColor, "data-testid": "Container" }, { children: [jsx$1(IconContainer$2, { children: jsx$1(Icon.Actions.LightExclamation, { fill: accentColor }, void 0) }, void 0), jsx$1("div", { children: jsxs$1(Text$2, __assign({ color: color }, { children: [jsxs$1(Details, __assign({ color: accentColor }, { children: [importantNoteText, ":"] }), void 0), " ", text] }), void 0) }, void 0)] }), void 0));
|
|
7869
7870
|
};
|
|
7870
7871
|
var templateObject_1$u, templateObject_2$i, templateObject_3$d, templateObject_4$9;
|
|
7871
7872
|
|
|
@@ -7996,21 +7997,21 @@ var DeliveryDetails = function (_a) {
|
|
|
7996
7997
|
};
|
|
7997
7998
|
var templateObject_1$t, templateObject_2$h, templateObject_3$c, templateObject_4$8, templateObject_5$4, templateObject_6$3, templateObject_7$1, templateObject_8;
|
|
7998
7999
|
|
|
7999
|
-
var Container$
|
|
8000
|
+
var Container$h = newStyled.div(templateObject_1$s || (templateObject_1$s = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n user-select: none;\n"], ["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n user-select: none;\n"])));
|
|
8000
8001
|
var H1$2 = newStyled.h1(templateObject_2$g || (templateObject_2$g = __makeTemplateObject(["\n margin: 0;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 700;\n color: ", ";\n margin-right: 0.313rem;\n"], ["\n margin: 0;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 700;\n color: ", ";\n margin-right: 0.313rem;\n"])), function (props) { return props.color; });
|
|
8001
8002
|
var ScrollToTop = function (_a) {
|
|
8002
8003
|
var scrollToTopText = _a.scrollToTopText, onClick = _a.onClick;
|
|
8003
8004
|
var theme = useTheme();
|
|
8004
|
-
return (jsxs$1(Container$
|
|
8005
|
+
return (jsxs$1(Container$h, __assign({ onClick: onClick, "data-testid": "Container" }, { children: [jsx$1(H1$2, __assign({ color: theme.colors.shades['700'].color }, { children: scrollToTopText }), void 0), jsx$1(Icon.Arrows.ChevronUpSolid, { width: 1.375, height: 1.375, fill: theme.colors.pallete.primary.color }, void 0)] }), void 0));
|
|
8005
8006
|
};
|
|
8006
8007
|
var templateObject_1$s, templateObject_2$g;
|
|
8007
8008
|
|
|
8008
|
-
var Container$
|
|
8009
|
+
var Container$g = newStyled.div(templateObject_1$r || (templateObject_1$r = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #dfefeb;\n padding: 0.75rem 0;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #dfefeb;\n padding: 0.75rem 0;\n"])));
|
|
8009
8010
|
var H1$1 = newStyled.h1(templateObject_2$f || (templateObject_2$f = __makeTemplateObject(["\n margin: 0;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 600;\n color: ", ";\n margin-left: 0.625rem;\n"], ["\n margin: 0;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 600;\n color: ", ";\n margin-left: 0.625rem;\n"])), function (props) { return props.color; });
|
|
8010
8011
|
var OrderBar = function (_a) {
|
|
8011
8012
|
var message = _a.message;
|
|
8012
8013
|
var theme = useTheme();
|
|
8013
|
-
return (jsxs$1(Container$
|
|
8014
|
+
return (jsxs$1(Container$g, { children: [jsx$1(Icon.Actions.Check, { width: 1.25, height: 0.875, fill: "#2F806A" }, void 0), jsx$1(H1$1, __assign({ color: theme.colors.shades['700'].color }, { children: message }), void 0)] }, void 0));
|
|
8014
8015
|
};
|
|
8015
8016
|
var templateObject_1$r, templateObject_2$f;
|
|
8016
8017
|
|
|
@@ -8025,7 +8026,7 @@ var SizeTable = function (_a) {
|
|
|
8025
8026
|
};
|
|
8026
8027
|
var templateObject_1$q, templateObject_2$e, templateObject_3$b, templateObject_4$7;
|
|
8027
8028
|
|
|
8028
|
-
var Container$
|
|
8029
|
+
var Container$f = newStyled.div(templateObject_1$p || (templateObject_1$p = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n width: auto;\n"], ["\n display: flex;\n flex-direction: row;\n width: auto;\n"])));
|
|
8029
8030
|
var ImageContainer$1 = newStyled.div(templateObject_2$d || (templateObject_2$d = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
8030
8031
|
var DescriptionContainer = newStyled.div(templateObject_3$a || (templateObject_3$a = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n ", ";\n width: 100%;\n"], ["\n display: flex;\n flex-direction: column;\n ", ";\n width: 100%;\n"])), function (_a) {
|
|
8031
8032
|
var theme = _a.theme;
|
|
@@ -8066,7 +8067,7 @@ var Quantity = newStyled.div(templateObject_5$3 || (templateObject_5$3 = __makeT
|
|
|
8066
8067
|
var SimpleOrderItem = function (_a) {
|
|
8067
8068
|
var title = _a.title, subtitle = _a.subtitle, image = _a.image, price = _a.price, tag = _a.tag, quantity = _a.quantity;
|
|
8068
8069
|
var theme = useTheme();
|
|
8069
|
-
return (jsxs$1(Container$
|
|
8070
|
+
return (jsxs$1(Container$f, { children: [jsxs$1(ImageContainer$1, { children: [jsx$1(Image, { src: image.src, alt: image.alt, width: "4.063rem", height: "5.375rem", objectFit: "cover", objectPosition: "center" }, void 0), quantity ? jsx$1(Quantity, __assign({ "data-testid": "order-item-quantity" }, { children: quantity }), void 0) : null] }, void 0), jsxs$1(DescriptionContainer, __assign({ "data-testid": "order-item-description-container", theme: theme }, { children: [jsx$1(Title$1, __assign({ color: theme.colors.shades['700'].color }, { children: title }), void 0), jsx$1(Subtitle, __assign({ color: theme.colors.shades['700'].color }, { children: subtitle }), void 0), jsxs$1(PriceContainer, __assign({ "data-testid": "order-item-price-container", withTag: !!tag, theme: theme }, { children: [tag && (jsx$1(OfferBanner, { discountAppliedText: tag === null || tag === void 0 ? void 0 : tag.text, backgroundColor: tag === null || tag === void 0 ? void 0 : tag.backgroundColor }, void 0)), jsx$1(PriceLabel, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, color: price.color || theme.colors.shades['700'].color, size: ComponentSize.Small }, void 0)] }), void 0)] }), void 0)] }, void 0));
|
|
8070
8071
|
};
|
|
8071
8072
|
var templateObject_1$p, templateObject_2$d, templateObject_3$a, templateObject_4$6, templateObject_5$3;
|
|
8072
8073
|
|
|
@@ -8077,7 +8078,7 @@ function formatDate(date) {
|
|
|
8077
8078
|
return month < 10 ? "".concat(day, "/0").concat(month, "/").concat(year) : "".concat(day, "/").concat(month, "/").concat(year);
|
|
8078
8079
|
}
|
|
8079
8080
|
|
|
8080
|
-
var Container$
|
|
8081
|
+
var Container$e = newStyled.div(templateObject_1$o || (templateObject_1$o = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: auto;\n color: #292929;\n"], ["\n display: flex;\n flex-direction: column;\n width: auto;\n color: #292929;\n"])));
|
|
8081
8082
|
var Heading = newStyled.div(templateObject_2$c || (templateObject_2$c = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n ", ";\n text-align: right;\n margin-bottom: 10px;\n"], ["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n ", ";\n text-align: right;\n margin-bottom: 10px;\n"])), function (_a) {
|
|
8082
8083
|
var theme = _a.theme;
|
|
8083
8084
|
return mediaQueries({ theme: theme })({
|
|
@@ -8115,7 +8116,7 @@ var P$1 = newStyled.p(templateObject_7 || (templateObject_7 = __makeTemplateObje
|
|
|
8115
8116
|
var Review = function (_a) {
|
|
8116
8117
|
var reviewerName = _a.reviewerName, date = _a.date, rating = _a.rating, stars = _a.stars, title = _a.title, description = _a.description, image = _a.image;
|
|
8117
8118
|
var theme = useTheme();
|
|
8118
|
-
return (jsxs$1(Container$
|
|
8119
|
+
return (jsxs$1(Container$e, { children: [jsxs$1(Heading, __assign({ theme: theme }, { children: [jsx$1(H2, __assign({ theme: theme }, { children: reviewerName }), void 0), formatDate(date)] }), void 0), jsx$1(StarList, { starsNumber: 5, rating: rating, fill: stars.color, size: stars.size }, void 0), jsxs$1(Content, __assign({ "data-testid": "review-content", theme: theme }, { children: [jsxs$1(ReviewContainer, __assign({ theme: theme }, { children: [jsx$1(H3$1, __assign({ theme: theme }, { children: title }), void 0), jsx$1(P$1, { children: description }, void 0)] }), void 0), jsx$1(Image, { src: image.src, alt: image.alt, width: "7.5rem", height: "10rem" }, void 0)] }), void 0)] }, void 0));
|
|
8119
8120
|
};
|
|
8120
8121
|
var templateObject_1$o, templateObject_2$c, templateObject_3$9, templateObject_4$5, templateObject_5$2, templateObject_6$2, templateObject_7;
|
|
8121
8122
|
|
|
@@ -8326,7 +8327,7 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
8326
8327
|
return target;
|
|
8327
8328
|
}
|
|
8328
8329
|
|
|
8329
|
-
var initialState$
|
|
8330
|
+
var initialState$2 = {
|
|
8330
8331
|
animating: false,
|
|
8331
8332
|
autoplaying: null,
|
|
8332
8333
|
currentDirection: 0,
|
|
@@ -9055,7 +9056,7 @@ var extractObject = function extractObject(spec, keys) {
|
|
|
9055
9056
|
|
|
9056
9057
|
var initializedState = function initializedState(spec) {
|
|
9057
9058
|
// spec also contains listRef, trackRef
|
|
9058
|
-
var slideCount =
|
|
9059
|
+
var slideCount = React__default.Children.count(spec.children);
|
|
9059
9060
|
var listNode = spec.listRef;
|
|
9060
9061
|
var listWidth = Math.ceil(getWidth(listNode));
|
|
9061
9062
|
var trackNode = spec.trackRef && spec.trackRef.node;
|
|
@@ -9862,10 +9863,10 @@ var renderSlides = function renderSlides(spec) {
|
|
|
9862
9863
|
var slides = [];
|
|
9863
9864
|
var preCloneSlides = [];
|
|
9864
9865
|
var postCloneSlides = [];
|
|
9865
|
-
var childrenCount =
|
|
9866
|
+
var childrenCount = React__default.Children.count(spec.children);
|
|
9866
9867
|
var startIndex = lazyStartIndex(spec);
|
|
9867
9868
|
var endIndex = lazyEndIndex(spec);
|
|
9868
|
-
|
|
9869
|
+
React__default.Children.forEach(spec.children, function (elem, index) {
|
|
9869
9870
|
var child;
|
|
9870
9871
|
var childOnClickOptions = {
|
|
9871
9872
|
message: "children",
|
|
@@ -9877,7 +9878,7 @@ var renderSlides = function renderSlides(spec) {
|
|
|
9877
9878
|
if (!spec.lazyLoad || spec.lazyLoad && spec.lazyLoadedList.indexOf(index) >= 0) {
|
|
9878
9879
|
child = elem;
|
|
9879
9880
|
} else {
|
|
9880
|
-
child = /*#__PURE__*/
|
|
9881
|
+
child = /*#__PURE__*/React__default.createElement("div", null);
|
|
9881
9882
|
}
|
|
9882
9883
|
|
|
9883
9884
|
var childStyle = getSlideStyle(_objectSpread2(_objectSpread2({}, spec), {}, {
|
|
@@ -9888,7 +9889,7 @@ var renderSlides = function renderSlides(spec) {
|
|
|
9888
9889
|
index: index
|
|
9889
9890
|
})); // push a cloned element of the desired slide
|
|
9890
9891
|
|
|
9891
|
-
slides.push( /*#__PURE__*/
|
|
9892
|
+
slides.push( /*#__PURE__*/React__default.cloneElement(child, {
|
|
9892
9893
|
key: "original" + getKey(child, index),
|
|
9893
9894
|
"data-index": index,
|
|
9894
9895
|
className: classnames(slideClasses, slideClass),
|
|
@@ -9919,7 +9920,7 @@ var renderSlides = function renderSlides(spec) {
|
|
|
9919
9920
|
slideClasses = getSlideClasses(_objectSpread2(_objectSpread2({}, spec), {}, {
|
|
9920
9921
|
index: key
|
|
9921
9922
|
}));
|
|
9922
|
-
preCloneSlides.push( /*#__PURE__*/
|
|
9923
|
+
preCloneSlides.push( /*#__PURE__*/React__default.cloneElement(child, {
|
|
9923
9924
|
key: "precloned" + getKey(child, key),
|
|
9924
9925
|
"data-index": key,
|
|
9925
9926
|
tabIndex: "-1",
|
|
@@ -9946,7 +9947,7 @@ var renderSlides = function renderSlides(spec) {
|
|
|
9946
9947
|
slideClasses = getSlideClasses(_objectSpread2(_objectSpread2({}, spec), {}, {
|
|
9947
9948
|
index: key
|
|
9948
9949
|
}));
|
|
9949
|
-
postCloneSlides.push( /*#__PURE__*/
|
|
9950
|
+
postCloneSlides.push( /*#__PURE__*/React__default.cloneElement(child, {
|
|
9950
9951
|
key: "postcloned" + getKey(child, key),
|
|
9951
9952
|
"data-index": key,
|
|
9952
9953
|
tabIndex: "-1",
|
|
@@ -10010,7 +10011,7 @@ var Track = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
10010
10011
|
onMouseOver: onMouseOver,
|
|
10011
10012
|
onMouseLeave: onMouseLeave
|
|
10012
10013
|
};
|
|
10013
|
-
return /*#__PURE__*/
|
|
10014
|
+
return /*#__PURE__*/React__default.createElement("div", _extends$2({
|
|
10014
10015
|
ref: this.handleRef,
|
|
10015
10016
|
className: "slick-track",
|
|
10016
10017
|
style: this.props.trackStyle
|
|
@@ -10019,7 +10020,7 @@ var Track = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
10019
10020
|
}]);
|
|
10020
10021
|
|
|
10021
10022
|
return Track;
|
|
10022
|
-
}(
|
|
10023
|
+
}(React__default.PureComponent);
|
|
10023
10024
|
|
|
10024
10025
|
var getDotCount = function getDotCount(spec) {
|
|
10025
10026
|
var dots;
|
|
@@ -10095,22 +10096,22 @@ var Dots = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
10095
10096
|
currentSlide: currentSlide
|
|
10096
10097
|
};
|
|
10097
10098
|
var onClick = this.clickHandler.bind(this, dotOptions);
|
|
10098
|
-
dots = dots.concat( /*#__PURE__*/
|
|
10099
|
+
dots = dots.concat( /*#__PURE__*/React__default.createElement("li", {
|
|
10099
10100
|
key: i,
|
|
10100
10101
|
className: className
|
|
10101
|
-
}, /*#__PURE__*/
|
|
10102
|
+
}, /*#__PURE__*/React__default.cloneElement(this.props.customPaging(i), {
|
|
10102
10103
|
onClick: onClick
|
|
10103
10104
|
})));
|
|
10104
10105
|
}
|
|
10105
10106
|
|
|
10106
|
-
return /*#__PURE__*/
|
|
10107
|
+
return /*#__PURE__*/React__default.cloneElement(this.props.appendDots(dots), _objectSpread2({
|
|
10107
10108
|
className: this.props.dotsClass
|
|
10108
10109
|
}, mouseEvents));
|
|
10109
10110
|
}
|
|
10110
10111
|
}]);
|
|
10111
10112
|
|
|
10112
10113
|
return Dots;
|
|
10113
|
-
}(
|
|
10114
|
+
}(React__default.PureComponent);
|
|
10114
10115
|
|
|
10115
10116
|
var PrevArrow = /*#__PURE__*/function (_React$PureComponent) {
|
|
10116
10117
|
_inherits(PrevArrow, _React$PureComponent);
|
|
@@ -10164,9 +10165,9 @@ var PrevArrow = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
10164
10165
|
var prevArrow;
|
|
10165
10166
|
|
|
10166
10167
|
if (this.props.prevArrow) {
|
|
10167
|
-
prevArrow = /*#__PURE__*/
|
|
10168
|
+
prevArrow = /*#__PURE__*/React__default.cloneElement(this.props.prevArrow, _objectSpread2(_objectSpread2({}, prevArrowProps), customProps));
|
|
10168
10169
|
} else {
|
|
10169
|
-
prevArrow = /*#__PURE__*/
|
|
10170
|
+
prevArrow = /*#__PURE__*/React__default.createElement("button", _extends$2({
|
|
10170
10171
|
key: "0",
|
|
10171
10172
|
type: "button"
|
|
10172
10173
|
}, prevArrowProps), " ", "Previous");
|
|
@@ -10177,7 +10178,7 @@ var PrevArrow = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
10177
10178
|
}]);
|
|
10178
10179
|
|
|
10179
10180
|
return PrevArrow;
|
|
10180
|
-
}(
|
|
10181
|
+
}(React__default.PureComponent);
|
|
10181
10182
|
var NextArrow = /*#__PURE__*/function (_React$PureComponent2) {
|
|
10182
10183
|
_inherits(NextArrow, _React$PureComponent2);
|
|
10183
10184
|
|
|
@@ -10230,9 +10231,9 @@ var NextArrow = /*#__PURE__*/function (_React$PureComponent2) {
|
|
|
10230
10231
|
var nextArrow;
|
|
10231
10232
|
|
|
10232
10233
|
if (this.props.nextArrow) {
|
|
10233
|
-
nextArrow = /*#__PURE__*/
|
|
10234
|
+
nextArrow = /*#__PURE__*/React__default.cloneElement(this.props.nextArrow, _objectSpread2(_objectSpread2({}, nextArrowProps), customProps));
|
|
10234
10235
|
} else {
|
|
10235
|
-
nextArrow = /*#__PURE__*/
|
|
10236
|
+
nextArrow = /*#__PURE__*/React__default.createElement("button", _extends$2({
|
|
10236
10237
|
key: "1",
|
|
10237
10238
|
type: "button"
|
|
10238
10239
|
}, nextArrowProps), " ", "Next");
|
|
@@ -10243,7 +10244,7 @@ var NextArrow = /*#__PURE__*/function (_React$PureComponent2) {
|
|
|
10243
10244
|
}]);
|
|
10244
10245
|
|
|
10245
10246
|
return NextArrow;
|
|
10246
|
-
}(
|
|
10247
|
+
}(React__default.PureComponent);
|
|
10247
10248
|
|
|
10248
10249
|
/**
|
|
10249
10250
|
* A collection of shims that provide minimal functionality of the ES6 collections.
|
|
@@ -11325,10 +11326,10 @@ var InnerSlider = /*#__PURE__*/function (_React$Component) {
|
|
|
11325
11326
|
var setTrackStyle = _this.didPropsChange(prevProps);
|
|
11326
11327
|
|
|
11327
11328
|
setTrackStyle && _this.updateState(spec, setTrackStyle, function () {
|
|
11328
|
-
if (_this.state.currentSlide >=
|
|
11329
|
+
if (_this.state.currentSlide >= React__default.Children.count(_this.props.children)) {
|
|
11329
11330
|
_this.changeSlide({
|
|
11330
11331
|
message: "index",
|
|
11331
|
-
index:
|
|
11332
|
+
index: React__default.Children.count(_this.props.children) - _this.props.slidesToShow,
|
|
11332
11333
|
currentSlide: _this.state.currentSlide
|
|
11333
11334
|
});
|
|
11334
11335
|
}
|
|
@@ -11389,7 +11390,7 @@ var InnerSlider = /*#__PURE__*/function (_React$Component) {
|
|
|
11389
11390
|
});
|
|
11390
11391
|
var trackStyle = getTrackCSS(spec);
|
|
11391
11392
|
|
|
11392
|
-
if (setTrackStyle ||
|
|
11393
|
+
if (setTrackStyle || React__default.Children.count(_this.props.children) !== React__default.Children.count(spec.children)) {
|
|
11393
11394
|
updatedState["trackStyle"] = trackStyle;
|
|
11394
11395
|
}
|
|
11395
11396
|
|
|
@@ -11441,7 +11442,7 @@ var InnerSlider = /*#__PURE__*/function (_React$Component) {
|
|
|
11441
11442
|
};
|
|
11442
11443
|
}
|
|
11443
11444
|
|
|
11444
|
-
var childrenCount =
|
|
11445
|
+
var childrenCount = React__default.Children.count(_this.props.children);
|
|
11445
11446
|
|
|
11446
11447
|
var spec = _objectSpread2(_objectSpread2(_objectSpread2({}, _this.props), _this.state), {}, {
|
|
11447
11448
|
slideCount: childrenCount
|
|
@@ -11867,7 +11868,7 @@ var InnerSlider = /*#__PURE__*/function (_React$Component) {
|
|
|
11867
11868
|
onMouseOver: pauseOnDotsHover ? _this.onDotsOver : null,
|
|
11868
11869
|
onMouseLeave: pauseOnDotsHover ? _this.onDotsLeave : null
|
|
11869
11870
|
});
|
|
11870
|
-
dots = /*#__PURE__*/
|
|
11871
|
+
dots = /*#__PURE__*/React__default.createElement(Dots, dotProps);
|
|
11871
11872
|
}
|
|
11872
11873
|
|
|
11873
11874
|
var prevArrow, nextArrow;
|
|
@@ -11875,8 +11876,8 @@ var InnerSlider = /*#__PURE__*/function (_React$Component) {
|
|
|
11875
11876
|
arrowProps.clickHandler = _this.changeSlide;
|
|
11876
11877
|
|
|
11877
11878
|
if (_this.props.arrows) {
|
|
11878
|
-
prevArrow = /*#__PURE__*/
|
|
11879
|
-
nextArrow = /*#__PURE__*/
|
|
11879
|
+
prevArrow = /*#__PURE__*/React__default.createElement(PrevArrow, arrowProps);
|
|
11880
|
+
nextArrow = /*#__PURE__*/React__default.createElement(NextArrow, arrowProps);
|
|
11880
11881
|
}
|
|
11881
11882
|
|
|
11882
11883
|
var verticalHeightStyle = null;
|
|
@@ -11935,18 +11936,18 @@ var InnerSlider = /*#__PURE__*/function (_React$Component) {
|
|
|
11935
11936
|
};
|
|
11936
11937
|
}
|
|
11937
11938
|
|
|
11938
|
-
return /*#__PURE__*/
|
|
11939
|
+
return /*#__PURE__*/React__default.createElement("div", innerSliderProps, !_this.props.unslick ? prevArrow : "", /*#__PURE__*/React__default.createElement("div", _extends$2({
|
|
11939
11940
|
ref: _this.listRefHandler
|
|
11940
|
-
}, listProps), /*#__PURE__*/
|
|
11941
|
+
}, listProps), /*#__PURE__*/React__default.createElement(Track, _extends$2({
|
|
11941
11942
|
ref: _this.trackRefHandler
|
|
11942
11943
|
}, trackProps), _this.props.children)), !_this.props.unslick ? nextArrow : "", !_this.props.unslick ? dots : "");
|
|
11943
11944
|
});
|
|
11944
11945
|
|
|
11945
11946
|
_this.list = null;
|
|
11946
11947
|
_this.track = null;
|
|
11947
|
-
_this.state = _objectSpread2(_objectSpread2({}, initialState$
|
|
11948
|
+
_this.state = _objectSpread2(_objectSpread2({}, initialState$2), {}, {
|
|
11948
11949
|
currentSlide: _this.props.initialSlide,
|
|
11949
|
-
slideCount:
|
|
11950
|
+
slideCount: React__default.Children.count(_this.props.children)
|
|
11950
11951
|
});
|
|
11951
11952
|
_this.callbackTimers = [];
|
|
11952
11953
|
_this.clickable = true;
|
|
@@ -11982,12 +11983,12 @@ var InnerSlider = /*#__PURE__*/function (_React$Component) {
|
|
|
11982
11983
|
}
|
|
11983
11984
|
}
|
|
11984
11985
|
|
|
11985
|
-
return setTrackStyle ||
|
|
11986
|
+
return setTrackStyle || React__default.Children.count(this.props.children) !== React__default.Children.count(prevProps.children);
|
|
11986
11987
|
}
|
|
11987
11988
|
}]);
|
|
11988
11989
|
|
|
11989
11990
|
return InnerSlider;
|
|
11990
|
-
}(
|
|
11991
|
+
}(React__default.Component);
|
|
11991
11992
|
|
|
11992
11993
|
var camel2hyphen$1 = function (str) {
|
|
11993
11994
|
return str
|
|
@@ -12051,12 +12052,12 @@ var json2mq = function (query) {
|
|
|
12051
12052
|
|
|
12052
12053
|
var json2mq_1 = json2mq;
|
|
12053
12054
|
|
|
12054
|
-
var defaultProps = {
|
|
12055
|
+
var defaultProps$1 = {
|
|
12055
12056
|
accessibility: true,
|
|
12056
12057
|
adaptiveHeight: false,
|
|
12057
12058
|
afterChange: null,
|
|
12058
12059
|
appendDots: function appendDots(dots) {
|
|
12059
|
-
return /*#__PURE__*/
|
|
12060
|
+
return /*#__PURE__*/React__default.createElement("ul", {
|
|
12060
12061
|
style: {
|
|
12061
12062
|
display: "block"
|
|
12062
12063
|
}
|
|
@@ -12071,7 +12072,7 @@ var defaultProps = {
|
|
|
12071
12072
|
className: "",
|
|
12072
12073
|
cssEase: "ease",
|
|
12073
12074
|
customPaging: function customPaging(i) {
|
|
12074
|
-
return /*#__PURE__*/
|
|
12075
|
+
return /*#__PURE__*/React__default.createElement("button", null, i + 1);
|
|
12075
12076
|
},
|
|
12076
12077
|
dots: false,
|
|
12077
12078
|
dotsClass: "slick-dots",
|
|
@@ -12252,9 +12253,9 @@ var Slider = /*#__PURE__*/function (_React$Component) {
|
|
|
12252
12253
|
newProps = this.props.responsive.filter(function (resp) {
|
|
12253
12254
|
return resp.breakpoint === _this3.state.breakpoint;
|
|
12254
12255
|
});
|
|
12255
|
-
settings = newProps[0].settings === "unslick" ? "unslick" : _objectSpread2(_objectSpread2(_objectSpread2({}, defaultProps), this.props), newProps[0].settings);
|
|
12256
|
+
settings = newProps[0].settings === "unslick" ? "unslick" : _objectSpread2(_objectSpread2(_objectSpread2({}, defaultProps$1), this.props), newProps[0].settings);
|
|
12256
12257
|
} else {
|
|
12257
|
-
settings = _objectSpread2(_objectSpread2({}, defaultProps), this.props);
|
|
12258
|
+
settings = _objectSpread2(_objectSpread2({}, defaultProps$1), this.props);
|
|
12258
12259
|
} // force scrolling by one if centerMode is on
|
|
12259
12260
|
|
|
12260
12261
|
|
|
@@ -12281,7 +12282,7 @@ var Slider = /*#__PURE__*/function (_React$Component) {
|
|
|
12281
12282
|
} // makes sure that children is an array, even when there is only 1 child
|
|
12282
12283
|
|
|
12283
12284
|
|
|
12284
|
-
var children =
|
|
12285
|
+
var children = React__default.Children.toArray(this.props.children); // Children may contain false or null, so we should filter them
|
|
12285
12286
|
// children may also contain string filled with spaces (in certain cases where we use jsx strings)
|
|
12286
12287
|
|
|
12287
12288
|
children = children.filter(function (child) {
|
|
@@ -12312,7 +12313,7 @@ var Slider = /*#__PURE__*/function (_React$Component) {
|
|
|
12312
12313
|
}
|
|
12313
12314
|
|
|
12314
12315
|
if (k >= children.length) break;
|
|
12315
|
-
row.push( /*#__PURE__*/
|
|
12316
|
+
row.push( /*#__PURE__*/React__default.cloneElement(children[k], {
|
|
12316
12317
|
key: 100 * i + 10 * j + k,
|
|
12317
12318
|
tabIndex: -1,
|
|
12318
12319
|
style: {
|
|
@@ -12322,20 +12323,20 @@ var Slider = /*#__PURE__*/function (_React$Component) {
|
|
|
12322
12323
|
}));
|
|
12323
12324
|
}
|
|
12324
12325
|
|
|
12325
|
-
newSlide.push( /*#__PURE__*/
|
|
12326
|
+
newSlide.push( /*#__PURE__*/React__default.createElement("div", {
|
|
12326
12327
|
key: 10 * i + j
|
|
12327
12328
|
}, row));
|
|
12328
12329
|
}
|
|
12329
12330
|
|
|
12330
12331
|
if (settings.variableWidth) {
|
|
12331
|
-
newChildren.push( /*#__PURE__*/
|
|
12332
|
+
newChildren.push( /*#__PURE__*/React__default.createElement("div", {
|
|
12332
12333
|
key: i,
|
|
12333
12334
|
style: {
|
|
12334
12335
|
width: currentWidth
|
|
12335
12336
|
}
|
|
12336
12337
|
}, newSlide));
|
|
12337
12338
|
} else {
|
|
12338
|
-
newChildren.push( /*#__PURE__*/
|
|
12339
|
+
newChildren.push( /*#__PURE__*/React__default.createElement("div", {
|
|
12339
12340
|
key: i
|
|
12340
12341
|
}, newSlide));
|
|
12341
12342
|
}
|
|
@@ -12343,14 +12344,14 @@ var Slider = /*#__PURE__*/function (_React$Component) {
|
|
|
12343
12344
|
|
|
12344
12345
|
if (settings === "unslick") {
|
|
12345
12346
|
var className = "regular slider " + (this.props.className || "");
|
|
12346
|
-
return /*#__PURE__*/
|
|
12347
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
12347
12348
|
className: className
|
|
12348
12349
|
}, children);
|
|
12349
12350
|
} else if (newChildren.length <= settings.slidesToShow) {
|
|
12350
12351
|
settings.unslick = true;
|
|
12351
12352
|
}
|
|
12352
12353
|
|
|
12353
|
-
return /*#__PURE__*/
|
|
12354
|
+
return /*#__PURE__*/React__default.createElement(InnerSlider, _extends$2({
|
|
12354
12355
|
style: this.props.style,
|
|
12355
12356
|
ref: this.innerSliderRefHandler
|
|
12356
12357
|
}, settings), newChildren);
|
|
@@ -12358,7 +12359,7 @@ var Slider = /*#__PURE__*/function (_React$Component) {
|
|
|
12358
12359
|
}]);
|
|
12359
12360
|
|
|
12360
12361
|
return Slider;
|
|
12361
|
-
}(
|
|
12362
|
+
}(React__default.Component);
|
|
12362
12363
|
|
|
12363
12364
|
var StyledSlider = newStyled(Slider)(templateObject_1$n || (templateObject_1$n = __makeTemplateObject(["\n .slick-dots {\n position: static;\n display: flex !important;\n justify-content: center;\n column-gap: ", ";\n margin-top: ", ";\n }\n .slick-prev {\n left: ", ";\n }\n .slick-next {\n right: ", ";\n }\n .slick-prev,\n .slick-next {\n width: fit-content;\n height: fit-content;\n }\n .slick-prev:before,\n .slick-next:before {\n content: none;\n }\n .slick-dots li {\n margin: 0;\n width: auto;\n line-height: 0;\n height: auto;\n }\n"], ["\n .slick-dots {\n position: static;\n display: flex !important;\n justify-content: center;\n column-gap: ", ";\n margin-top: ", ";\n }\n .slick-prev {\n left: ", ";\n }\n .slick-next {\n right: ", ";\n }\n .slick-prev,\n .slick-next {\n width: fit-content;\n height: fit-content;\n }\n .slick-prev:before,\n .slick-next:before {\n content: none;\n }\n .slick-dots li {\n margin: 0;\n width: auto;\n line-height: 0;\n height: auto;\n }\n"])), function (props) { return "".concat(props.dotsSpacing, "rem"); }, function (props) { return "".concat(props.dotListMarginTop, "rem"); }, function (_a) {
|
|
12364
12365
|
var arrowPaddingOffset = _a.arrowPaddingOffset, _b = _a.arrowPadding, arrowPadding = _b === void 0 ? 0 : _b;
|
|
@@ -12491,7 +12492,8 @@ var ImageContainer = newStyled.div(function (_a) {
|
|
|
12491
12492
|
height: height,
|
|
12492
12493
|
});
|
|
12493
12494
|
});
|
|
12494
|
-
var
|
|
12495
|
+
var Container$d = newStyled.a(templateObject_1$j || (templateObject_1$j = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: min-content;\n text-decoration: none;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: min-content;\n text-decoration: none;\n"])));
|
|
12496
|
+
var H1 = newStyled.h1(templateObject_2$9 || (templateObject_2$9 = __makeTemplateObject(["\n font-size: 0.875rem;\n font-weight: normal;\n line-height: 1.375rem;\n text-align: center;\n color: ", ";\n margin: 0.25rem 0;\n text-align: ", ";\n"], ["\n font-size: 0.875rem;\n font-weight: normal;\n line-height: 1.375rem;\n text-align: center;\n color: ", ";\n margin: 0.25rem 0;\n text-align: ", ";\n"])), function (props) { return props.theme.colors.pallete.secondary.color; }, function (props) { return props.align; });
|
|
12495
12497
|
var getStylesBySize = function (size) {
|
|
12496
12498
|
switch (size) {
|
|
12497
12499
|
case ComponentSize.Medium:
|
|
@@ -12535,8 +12537,7 @@ var ProductItemMobile = function (_a) {
|
|
|
12535
12537
|
_b)[size];
|
|
12536
12538
|
return [first, second];
|
|
12537
12539
|
}, [size]);
|
|
12538
|
-
|
|
12539
|
-
return (jsxs(Container, __assign({ href: url, css: css(templateObject_2$9 || (templateObject_2$9 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: min-content;\n text-decoration: none;\n "], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n width: min-content;\n text-decoration: none;\n "]))), className: className }, { children: [tags ? (jsxs(ImageContainer, __assign({ width: styles === null || styles === void 0 ? void 0 : styles.width, height: styles === null || styles === void 0 ? void 0 : styles.height, "data-testid": "tags-image-container" }, { children: [jsx(Image, { src: image.src, alt: image.alt, width: "100%", height: "100%" }, void 0), jsx(SeasonOfferTag, { text: tags.seasonOfferTagText, size: ComponentSize.Small, css: { position: 'absolute', top: 0, left: 0 } }, void 0), jsx(CategoryTag, { text: tags.categoryTagText, size: ComponentSize.Small, css: { position: 'absolute', bottom: '1rem', left: 0 } }, void 0)] }), void 0)) : (jsx(Image, { src: image.src, alt: image.alt, width: styles === null || styles === void 0 ? void 0 : styles.width, height: styles === null || styles === void 0 ? void 0 : styles.height }, void 0)), jsx(Spacing, { size: spaces[0] }, void 0), jsx(H1, __assign({ theme: theme, align: alignName }, { children: title }), void 0), jsx(Spacing, { size: spaces[1] }, void 0), jsx(PriceLabel, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, color: price.color, size: ComponentSize.Small }, void 0), jsx(Rating, { size: size === ComponentSize.Large ? ComponentSize.Small : ComponentSize.XSmall, rating: rating.rating, reviews: rating.reviews, reviewsText: "" }, void 0)] }), void 0));
|
|
12540
|
+
return (jsxs(Container$d, __assign({ as: url ? 'a' : 'div', href: url, className: className }, { children: [tags ? (jsxs(ImageContainer, __assign({ width: styles === null || styles === void 0 ? void 0 : styles.width, height: styles === null || styles === void 0 ? void 0 : styles.height, "data-testid": "tags-image-container" }, { children: [jsx(Image, { src: image.src, alt: image.alt, width: "100%", height: "100%" }, void 0), jsx(SeasonOfferTag, { text: tags.seasonOfferTagText, size: ComponentSize.Small, css: { position: 'absolute', top: 0, left: 0 } }, void 0), jsx(CategoryTag, { text: tags.categoryTagText, size: ComponentSize.Small, css: { position: 'absolute', bottom: '1rem', left: 0 } }, void 0)] }), void 0)) : (jsx(Image, { src: image.src, alt: image.alt, width: styles === null || styles === void 0 ? void 0 : styles.width, height: styles === null || styles === void 0 ? void 0 : styles.height }, void 0)), jsx(Spacing, { size: spaces[0] }, void 0), jsx(H1, __assign({ theme: theme, align: alignName }, { children: title }), void 0), jsx(Spacing, { size: spaces[1] }, void 0), jsx(PriceLabel, { finalPrice: price.finalPrice, originalPrice: price.originalPrice, color: price.color, size: ComponentSize.Small }, void 0), jsx(Rating, { size: size === ComponentSize.Large ? ComponentSize.Small : ComponentSize.XSmall, rating: rating.rating, reviews: rating.reviews, reviewsText: "" }, void 0)] }), void 0));
|
|
12540
12541
|
};
|
|
12541
12542
|
var templateObject_1$j, templateObject_2$9;
|
|
12542
12543
|
|
|
@@ -12694,7 +12695,7 @@ var templateObject_1$e, templateObject_2$5, templateObject_3$5, templateObject_4
|
|
|
12694
12695
|
var Pagination = function (_a) {
|
|
12695
12696
|
var from = _a.from, to = _a.to, _b = _a.currentPage, currentPage = _b === void 0 ? from : _b, onChange = _a.onChange, _c = _a.underlineActive, underlineActive = _c === void 0 ? true : _c, _d = _a.boldActive, boldActive = _d === void 0 ? true : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e;
|
|
12696
12697
|
var theme = useTheme();
|
|
12697
|
-
var _f =
|
|
12698
|
+
var _f = React__default.useState(currentPage), page = _f[0], setPage = _f[1];
|
|
12698
12699
|
var handlePageChange = function (page) {
|
|
12699
12700
|
if (disabled || page < from || page > to) {
|
|
12700
12701
|
return;
|
|
@@ -12882,7 +12883,7 @@ var SearchControl = function (_a) {
|
|
|
12882
12883
|
}
|
|
12883
12884
|
};
|
|
12884
12885
|
|
|
12885
|
-
var initialState = { selectedOption: undefined, open: false, term: '' };
|
|
12886
|
+
var initialState$1 = { selectedOption: undefined, open: false, term: '' };
|
|
12886
12887
|
var reducer = function (state, action) {
|
|
12887
12888
|
switch (action.type) {
|
|
12888
12889
|
case 'UPDATE_TERM': {
|
|
@@ -12906,7 +12907,7 @@ var Container$6 = newStyled.div({
|
|
|
12906
12907
|
var SearchBar = function (_a) {
|
|
12907
12908
|
var suggestions = _a.suggestions, resultOptions = _a.resultOptions, onChange = _a.onChange, onSearch = _a.onSearch, resultsPanelDataTestId = _a.resultsPanelDataTestId;
|
|
12908
12909
|
var theme = useTheme();
|
|
12909
|
-
var _b = useReducer(reducer, initialState), state = _b[0], dispatch = _b[1];
|
|
12910
|
+
var _b = useReducer(reducer, initialState$1), state = _b[0], dispatch = _b[1];
|
|
12910
12911
|
var ref = useRef(null);
|
|
12911
12912
|
useOnClickOutside(ref, function () { return dispatch({ type: 'TOGGLE_PANEL', payload: { open: false } }); });
|
|
12912
12913
|
useEffect(function () {
|
|
@@ -12923,13 +12924,278 @@ var SearchBar = function (_a) {
|
|
|
12923
12924
|
}, onViewAll: function () { return onSearch(state.term); } }, void 0))] }), void 0));
|
|
12924
12925
|
};
|
|
12925
12926
|
|
|
12927
|
+
function _extends() {
|
|
12928
|
+
_extends = Object.assign || function (target) {
|
|
12929
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
12930
|
+
var source = arguments[i];
|
|
12931
|
+
|
|
12932
|
+
for (var key in source) {
|
|
12933
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12934
|
+
target[key] = source[key];
|
|
12935
|
+
}
|
|
12936
|
+
}
|
|
12937
|
+
}
|
|
12938
|
+
|
|
12939
|
+
return target;
|
|
12940
|
+
};
|
|
12941
|
+
|
|
12942
|
+
return _extends.apply(this, arguments);
|
|
12943
|
+
}
|
|
12944
|
+
|
|
12945
|
+
var LEFT = "Left";
|
|
12946
|
+
var RIGHT = "Right";
|
|
12947
|
+
var UP = "Up";
|
|
12948
|
+
var DOWN = "Down";
|
|
12949
|
+
|
|
12950
|
+
var defaultProps = {
|
|
12951
|
+
delta: 10,
|
|
12952
|
+
preventDefaultTouchmoveEvent: false,
|
|
12953
|
+
rotationAngle: 0,
|
|
12954
|
+
trackMouse: false,
|
|
12955
|
+
trackTouch: true
|
|
12956
|
+
};
|
|
12957
|
+
var initialState = {
|
|
12958
|
+
first: true,
|
|
12959
|
+
initial: [0, 0],
|
|
12960
|
+
start: 0,
|
|
12961
|
+
swiping: false,
|
|
12962
|
+
xy: [0, 0]
|
|
12963
|
+
};
|
|
12964
|
+
var mouseMove = "mousemove";
|
|
12965
|
+
var mouseUp = "mouseup";
|
|
12966
|
+
var touchEnd = "touchend";
|
|
12967
|
+
var touchMove = "touchmove";
|
|
12968
|
+
var touchStart = "touchstart";
|
|
12969
|
+
|
|
12970
|
+
function getDirection(absX, absY, deltaX, deltaY) {
|
|
12971
|
+
if (absX > absY) {
|
|
12972
|
+
if (deltaX > 0) {
|
|
12973
|
+
return RIGHT;
|
|
12974
|
+
}
|
|
12975
|
+
|
|
12976
|
+
return LEFT;
|
|
12977
|
+
} else if (deltaY > 0) {
|
|
12978
|
+
return DOWN;
|
|
12979
|
+
}
|
|
12980
|
+
|
|
12981
|
+
return UP;
|
|
12982
|
+
}
|
|
12983
|
+
|
|
12984
|
+
function rotateXYByAngle(pos, angle) {
|
|
12985
|
+
if (angle === 0) return pos;
|
|
12986
|
+
var angleInRadians = Math.PI / 180 * angle;
|
|
12987
|
+
var x = pos[0] * Math.cos(angleInRadians) + pos[1] * Math.sin(angleInRadians);
|
|
12988
|
+
var y = pos[1] * Math.cos(angleInRadians) - pos[0] * Math.sin(angleInRadians);
|
|
12989
|
+
return [x, y];
|
|
12990
|
+
}
|
|
12991
|
+
|
|
12992
|
+
function getHandlers(set, handlerProps) {
|
|
12993
|
+
var onStart = function onStart(event) {
|
|
12994
|
+
if (event && "touches" in event && event.touches.length > 1) return;
|
|
12995
|
+
set(function (state, props) {
|
|
12996
|
+
if (props.trackMouse) {
|
|
12997
|
+
document.addEventListener(mouseMove, onMove);
|
|
12998
|
+
document.addEventListener(mouseUp, onUp);
|
|
12999
|
+
}
|
|
13000
|
+
|
|
13001
|
+
var _ref = "touches" in event ? event.touches[0] : event,
|
|
13002
|
+
clientX = _ref.clientX,
|
|
13003
|
+
clientY = _ref.clientY;
|
|
13004
|
+
|
|
13005
|
+
var xy = rotateXYByAngle([clientX, clientY], props.rotationAngle);
|
|
13006
|
+
return _extends({}, state, initialState, {
|
|
13007
|
+
initial: [].concat(xy),
|
|
13008
|
+
xy: xy,
|
|
13009
|
+
start: event.timeStamp || 0
|
|
13010
|
+
});
|
|
13011
|
+
});
|
|
13012
|
+
};
|
|
13013
|
+
|
|
13014
|
+
var onMove = function onMove(event) {
|
|
13015
|
+
set(function (state, props) {
|
|
13016
|
+
if ("touches" in event && event.touches.length > 1) {
|
|
13017
|
+
return state;
|
|
13018
|
+
}
|
|
13019
|
+
|
|
13020
|
+
var _ref2 = "touches" in event ? event.touches[0] : event,
|
|
13021
|
+
clientX = _ref2.clientX,
|
|
13022
|
+
clientY = _ref2.clientY;
|
|
13023
|
+
|
|
13024
|
+
var _rotateXYByAngle = rotateXYByAngle([clientX, clientY], props.rotationAngle),
|
|
13025
|
+
x = _rotateXYByAngle[0],
|
|
13026
|
+
y = _rotateXYByAngle[1];
|
|
13027
|
+
|
|
13028
|
+
var deltaX = x - state.xy[0];
|
|
13029
|
+
var deltaY = y - state.xy[1];
|
|
13030
|
+
var absX = Math.abs(deltaX);
|
|
13031
|
+
var absY = Math.abs(deltaY);
|
|
13032
|
+
var time = (event.timeStamp || 0) - state.start;
|
|
13033
|
+
var velocity = Math.sqrt(absX * absX + absY * absY) / (time || 1);
|
|
13034
|
+
var vxvy = [deltaX / (time || 1), deltaY / (time || 1)];
|
|
13035
|
+
var dir = getDirection(absX, absY, deltaX, deltaY);
|
|
13036
|
+
var delta = typeof props.delta === "number" ? props.delta : props.delta[dir.toLowerCase()] || defaultProps.delta;
|
|
13037
|
+
if (absX < delta && absY < delta && !state.swiping) return state;
|
|
13038
|
+
var eventData = {
|
|
13039
|
+
absX: absX,
|
|
13040
|
+
absY: absY,
|
|
13041
|
+
deltaX: deltaX,
|
|
13042
|
+
deltaY: deltaY,
|
|
13043
|
+
dir: dir,
|
|
13044
|
+
event: event,
|
|
13045
|
+
first: state.first,
|
|
13046
|
+
initial: state.initial,
|
|
13047
|
+
velocity: velocity,
|
|
13048
|
+
vxvy: vxvy
|
|
13049
|
+
};
|
|
13050
|
+
eventData.first && props.onSwipeStart && props.onSwipeStart(eventData);
|
|
13051
|
+
props.onSwiping && props.onSwiping(eventData);
|
|
13052
|
+
var cancelablePageSwipe = false;
|
|
13053
|
+
|
|
13054
|
+
if (props.onSwiping || props.onSwiped || "onSwiped" + dir in props) {
|
|
13055
|
+
cancelablePageSwipe = true;
|
|
13056
|
+
}
|
|
13057
|
+
|
|
13058
|
+
if (cancelablePageSwipe && props.preventDefaultTouchmoveEvent && props.trackTouch && event.cancelable) event.preventDefault();
|
|
13059
|
+
return _extends({}, state, {
|
|
13060
|
+
first: false,
|
|
13061
|
+
eventData: eventData,
|
|
13062
|
+
swiping: true
|
|
13063
|
+
});
|
|
13064
|
+
});
|
|
13065
|
+
};
|
|
13066
|
+
|
|
13067
|
+
var onEnd = function onEnd(event) {
|
|
13068
|
+
set(function (state, props) {
|
|
13069
|
+
var eventData;
|
|
13070
|
+
|
|
13071
|
+
if (state.swiping && state.eventData) {
|
|
13072
|
+
eventData = _extends({}, state.eventData, {
|
|
13073
|
+
event: event
|
|
13074
|
+
});
|
|
13075
|
+
props.onSwiped && props.onSwiped(eventData);
|
|
13076
|
+
var onSwipedDir = props["onSwiped" + eventData.dir];
|
|
13077
|
+
onSwipedDir && onSwipedDir(eventData);
|
|
13078
|
+
} else {
|
|
13079
|
+
props.onTap && props.onTap({
|
|
13080
|
+
event: event
|
|
13081
|
+
});
|
|
13082
|
+
}
|
|
13083
|
+
|
|
13084
|
+
return _extends({}, state, initialState, {
|
|
13085
|
+
eventData: eventData
|
|
13086
|
+
});
|
|
13087
|
+
});
|
|
13088
|
+
};
|
|
13089
|
+
|
|
13090
|
+
var cleanUpMouse = function cleanUpMouse() {
|
|
13091
|
+
document.removeEventListener(mouseMove, onMove);
|
|
13092
|
+
document.removeEventListener(mouseUp, onUp);
|
|
13093
|
+
};
|
|
13094
|
+
|
|
13095
|
+
var onUp = function onUp(e) {
|
|
13096
|
+
cleanUpMouse();
|
|
13097
|
+
onEnd(e);
|
|
13098
|
+
};
|
|
13099
|
+
|
|
13100
|
+
var attachTouch = function attachTouch(el, passive) {
|
|
13101
|
+
var cleanup = function cleanup() {};
|
|
13102
|
+
|
|
13103
|
+
if (el && el.addEventListener) {
|
|
13104
|
+
var tls = [[touchStart, onStart], [touchMove, onMove], [touchEnd, onEnd]];
|
|
13105
|
+
tls.forEach(function (_ref3) {
|
|
13106
|
+
var e = _ref3[0],
|
|
13107
|
+
h = _ref3[1];
|
|
13108
|
+
return el.addEventListener(e, h, {
|
|
13109
|
+
passive: passive
|
|
13110
|
+
});
|
|
13111
|
+
});
|
|
13112
|
+
|
|
13113
|
+
cleanup = function cleanup() {
|
|
13114
|
+
return tls.forEach(function (_ref4) {
|
|
13115
|
+
var e = _ref4[0],
|
|
13116
|
+
h = _ref4[1];
|
|
13117
|
+
return el.removeEventListener(e, h);
|
|
13118
|
+
});
|
|
13119
|
+
};
|
|
13120
|
+
}
|
|
13121
|
+
|
|
13122
|
+
return cleanup;
|
|
13123
|
+
};
|
|
13124
|
+
|
|
13125
|
+
var onRef = function onRef(el) {
|
|
13126
|
+
if (el === null) return;
|
|
13127
|
+
set(function (state, props) {
|
|
13128
|
+
if (state.el === el) return state;
|
|
13129
|
+
var addState = {};
|
|
13130
|
+
|
|
13131
|
+
if (state.el && state.el !== el && state.cleanUpTouch) {
|
|
13132
|
+
state.cleanUpTouch();
|
|
13133
|
+
addState.cleanUpTouch = undefined;
|
|
13134
|
+
}
|
|
13135
|
+
|
|
13136
|
+
if (props.trackTouch && el) {
|
|
13137
|
+
addState.cleanUpTouch = attachTouch(el, !props.preventDefaultTouchmoveEvent);
|
|
13138
|
+
}
|
|
13139
|
+
|
|
13140
|
+
return _extends({}, state, {
|
|
13141
|
+
el: el
|
|
13142
|
+
}, addState);
|
|
13143
|
+
});
|
|
13144
|
+
};
|
|
13145
|
+
|
|
13146
|
+
var output = {
|
|
13147
|
+
ref: onRef
|
|
13148
|
+
};
|
|
13149
|
+
|
|
13150
|
+
if (handlerProps.trackMouse) {
|
|
13151
|
+
output.onMouseDown = onStart;
|
|
13152
|
+
}
|
|
13153
|
+
|
|
13154
|
+
return [output, attachTouch];
|
|
13155
|
+
}
|
|
13156
|
+
|
|
13157
|
+
function updateTransientState(state, props, attachTouch) {
|
|
13158
|
+
var addState = {};
|
|
13159
|
+
|
|
13160
|
+
if (!props.trackTouch && state.cleanUpTouch) {
|
|
13161
|
+
state.cleanUpTouch();
|
|
13162
|
+
addState.cleanUpTouch = undefined;
|
|
13163
|
+
} else if (props.trackTouch && !state.cleanUpTouch) {
|
|
13164
|
+
if (state.el) {
|
|
13165
|
+
addState.cleanUpTouch = attachTouch(state.el, !props.preventDefaultTouchmoveEvent);
|
|
13166
|
+
}
|
|
13167
|
+
}
|
|
13168
|
+
|
|
13169
|
+
return _extends({}, state, addState);
|
|
13170
|
+
}
|
|
13171
|
+
|
|
13172
|
+
function useSwipeable(options) {
|
|
13173
|
+
var trackMouse = options.trackMouse;
|
|
13174
|
+
var transientState = React.useRef(_extends({}, initialState));
|
|
13175
|
+
var transientProps = React.useRef(_extends({}, defaultProps));
|
|
13176
|
+
transientProps.current = _extends({}, defaultProps, options);
|
|
13177
|
+
|
|
13178
|
+
var _React$useMemo = React.useMemo(function () {
|
|
13179
|
+
return getHandlers(function (stateSetter) {
|
|
13180
|
+
return transientState.current = stateSetter(transientState.current, transientProps.current);
|
|
13181
|
+
}, {
|
|
13182
|
+
trackMouse: trackMouse
|
|
13183
|
+
});
|
|
13184
|
+
}, [trackMouse]),
|
|
13185
|
+
handlers = _React$useMemo[0],
|
|
13186
|
+
attachTouch = _React$useMemo[1];
|
|
13187
|
+
|
|
13188
|
+
transientState.current = updateTransientState(transientState.current, transientProps.current, attachTouch);
|
|
13189
|
+
return handlers;
|
|
13190
|
+
}
|
|
13191
|
+
|
|
12926
13192
|
var Container$5 = newStyled.div(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n position: relative;\n max-height: 31.875rem;\n"], ["\n position: relative;\n max-height: 31.875rem;\n"])));
|
|
12927
13193
|
var TopTagContainer = newStyled.div(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n"])));
|
|
12928
13194
|
var BottomTagContainer = newStyled.div(templateObject_3$3 || (templateObject_3$3 = __makeTemplateObject(["\n position: absolute;\n bottom: 3.75rem;\n left: 0;\n"], ["\n position: absolute;\n bottom: 3.75rem;\n left: 0;\n"])));
|
|
12929
|
-
var ImageProductWithTags = function (_a) {
|
|
13195
|
+
var ImageProductWithTags = forwardRef(function ImageProductWithTags(_a, ref) {
|
|
12930
13196
|
var image = _a.image, DiscountTagElement = _a.DiscountTagElement, BestSellerTagElement = _a.BestSellerTagElement, testId = _a.testId;
|
|
12931
|
-
return (jsxs$1(Container$5, __assign({ "data-testid": testId }, { children: [jsx$1(Image, { src: image.imageUrl, alt: image.alt, objectFit: "cover", objectPosition: "center top", width: "100%", height: "510px" }, void 0), jsx$1(TopTagContainer, { children: DiscountTagElement }, void 0), jsx$1(BottomTagContainer, { children: BestSellerTagElement }, void 0)] }), void 0));
|
|
12932
|
-
};
|
|
13197
|
+
return (jsxs$1(Container$5, __assign({ "data-testid": testId, ref: ref }, { children: [jsx$1(Image, { src: image.imageUrl, alt: image.alt, objectFit: "cover", objectPosition: "center top", width: "100%", height: "510px" }, void 0), jsx$1(TopTagContainer, { children: DiscountTagElement }, void 0), jsx$1(BottomTagContainer, { children: BestSellerTagElement }, void 0)] }), void 0));
|
|
13198
|
+
});
|
|
12933
13199
|
var templateObject_1$a, templateObject_2$3, templateObject_3$3;
|
|
12934
13200
|
|
|
12935
13201
|
var Button = newStyled.button(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject(["\n background: transparent;\n border: none;\n padding: 0.188rem 0.625rem;\n"], ["\n background: transparent;\n border: none;\n padding: 0.188rem 0.625rem;\n"])));
|
|
@@ -12969,12 +13235,31 @@ var templateObject_1$7, templateObject_2$2, templateObject_3$2;
|
|
|
12969
13235
|
var Container$3 = newStyled.div(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n height: fit-content;\n position: relative;\n max-width: 450px;\n"], ["\n display: flex;\n flex-direction: column;\n height: fit-content;\n position: relative;\n max-width: 450px;\n"])));
|
|
12970
13236
|
var ProductGalleryMobile = function (_a) {
|
|
12971
13237
|
var images = _a.images, selectedValue = _a.selectedValue, DiscountTagElement = _a.DiscountTagElement, BestSellerTagElement = _a.BestSellerTagElement, productImageDataTestId = _a.productImageDataTestId, slideDotsDataTestId = _a.slideDotsDataTestId;
|
|
12972
|
-
var
|
|
12973
|
-
|
|
13238
|
+
var _b = useState(function () {
|
|
13239
|
+
if (selectedValue) {
|
|
13240
|
+
return Math.max(0, images.indexOf(selectedValue));
|
|
13241
|
+
}
|
|
13242
|
+
return 0;
|
|
13243
|
+
}), index = _b[0], setIndex = _b[1];
|
|
13244
|
+
var _c = useState(function () { return images[index]; }), selectedImage = _c[0], setSelectedImage = _c[1];
|
|
13245
|
+
var handlers = useSwipeable({
|
|
13246
|
+
onSwiped: useCallback(function (_a) {
|
|
13247
|
+
var dir = _a.dir;
|
|
13248
|
+
setIndex(function (index) {
|
|
13249
|
+
if (dir === 'Left') {
|
|
13250
|
+
return Math.min(index + 1, images.length - 1);
|
|
13251
|
+
}
|
|
13252
|
+
if (dir === 'Right') {
|
|
13253
|
+
return Math.max(index - 1, 0);
|
|
13254
|
+
}
|
|
13255
|
+
return index;
|
|
13256
|
+
});
|
|
13257
|
+
}, [images.length]),
|
|
13258
|
+
});
|
|
12974
13259
|
useEffect(function () {
|
|
12975
|
-
setSelectedImage(
|
|
12976
|
-
}, [
|
|
12977
|
-
return (jsxs$1(Container$3, { children: [jsx$1(ImageProductWithTags, { image: selectedImage, DiscountTagElement: DiscountTagElement, BestSellerTagElement: BestSellerTagElement, testId: productImageDataTestId }, void 0), jsx$1(SlideNavigation, { quantity: images.length, selectedIndex: images.indexOf(selectedImage), onNavigate:
|
|
13260
|
+
setSelectedImage(images[index]);
|
|
13261
|
+
}, [index, images]);
|
|
13262
|
+
return (jsxs$1(Container$3, { children: [jsx$1(ImageProductWithTags, __assign({}, handlers, { image: selectedImage, DiscountTagElement: DiscountTagElement, BestSellerTagElement: BestSellerTagElement, testId: productImageDataTestId }), void 0), jsx$1(SlideNavigation, { quantity: images.length, selectedIndex: images.indexOf(selectedImage), onNavigate: setIndex, testId: slideDotsDataTestId }, void 0)] }, void 0));
|
|
12978
13263
|
};
|
|
12979
13264
|
var templateObject_1$6;
|
|
12980
13265
|
|