@shopgate/pwa-ui-shared 7.30.3 → 7.31.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ActionButton/index.js +66 -67
- package/AddToCartButton/index.js +217 -185
- package/Availability/index.js +24 -6
- package/Button/index.js +105 -82
- package/Button/spec.js +3 -4
- package/Card/index.js +26 -7
- package/CardList/components/Item/index.js +15 -3
- package/CartTotalLine/components/Amount/index.js +13 -4
- package/CartTotalLine/components/Hint/index.js +13 -4
- package/CartTotalLine/components/Label/index.js +23 -10
- package/CartTotalLine/index.js +41 -7
- package/Checkbox/index.js +41 -17
- package/Chip/index.js +82 -7
- package/ContextMenu/components/Item/index.js +38 -20
- package/ContextMenu/components/Position/index.js +38 -56
- package/ContextMenu/index.js +64 -28
- package/Dialog/components/BasicDialog/index.js +1 -0
- package/Dialog/components/HtmlContentDialog/spec.js +39 -0
- package/Dialog/components/PipelineErrorDialog/index.js +108 -157
- package/Dialog/components/PipelineErrorDialog/spec.js +12 -18
- package/Dialog/components/TextMessageDialog/index.js +1 -1
- package/Dialog/components/VariantSelectModal/index.js +1 -1
- package/Dialog/index.js +1 -1
- package/DiscountBadge/index.js +48 -15
- package/FavoritesButton/index.js +95 -100
- package/FavoritesButton/spec.js +5 -2
- package/Form/Builder/classes/ActionListener/index.js +1 -0
- package/Form/Checkbox/index.js +64 -56
- package/Form/InfoField/index.js +18 -6
- package/Form/Password/index.js +39 -52
- package/Form/RadioGroup/components/Item/index.js +72 -56
- package/Form/RadioGroup/index.js +79 -90
- package/Form/Select/index.js +108 -130
- package/Form/SelectContextChoices/index.js +30 -8
- package/Form/TextField/index.js +106 -82
- package/Form/TextField/spec.js +4 -3
- package/FormElement/components/ErrorText/index.js +32 -14
- package/FormElement/components/Label/index.js +56 -6
- package/FormElement/components/Placeholder/index.js +44 -11
- package/FormElement/components/Underline/index.js +63 -12
- package/FormElement/index.js +62 -85
- package/Glow/index.js +73 -83
- package/IndicatorCircle/index.js +73 -17
- package/IndicatorCircle/spec.js +2 -5
- package/LoadingIndicator/index.js +34 -12
- package/Manufacturer/index.js +21 -10
- package/MessageBar/index.js +12 -38
- package/NoResults/components/Icon/index.js +30 -14
- package/NoResults/index.js +35 -7
- package/Placeholder/index.js +34 -23
- package/PlaceholderLabel/index.js +17 -3
- package/Price/index.js +34 -21
- package/PriceInfo/index.js +23 -9
- package/PriceStriked/index.js +67 -77
- package/ProgressBar/index.js +112 -77
- package/RadioButton/index.js +29 -11
- package/RatingStars/index.js +122 -137
- package/Ripple/components/RippleAnimation/index.js +13 -3
- package/Ripple/index.js +158 -212
- package/RippleButton/index.js +63 -60
- package/RippleButton/spec.js +15 -9
- package/ScannerOverlay/components/CameraOverlay/index.js +54 -10
- package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/index.js +53 -27
- package/ScannerOverlay/components/ScannerBar/index.js +50 -26
- package/Sheet/components/Header/components/SearchBar/index.js +54 -10
- package/Sheet/components/Header/index.js +96 -76
- package/Sheet/index.js +295 -157
- package/Sheet/spec.js +8 -6
- package/TaxDisclaimer/index.js +17 -4
- package/TaxDisclaimer/spec.js +16 -5
- package/TextField/components/ErrorText/index.js +35 -14
- package/TextField/components/FormElement/index.js +29 -4
- package/TextField/components/Hint/index.js +39 -10
- package/TextField/components/Label/index.js +43 -6
- package/TextField/components/Underline/index.js +64 -13
- package/TextField/index.js +157 -171
- package/TextField/spec.js +5 -3
- package/icons/AccountBoxIcon.d.ts +7 -0
- package/icons/AccountBoxIcon.d.ts.map +1 -0
- package/icons/AccountBoxIcon.js +1 -4
- package/icons/AddMoreIcon.d.ts +7 -0
- package/icons/AddMoreIcon.d.ts.map +1 -0
- package/icons/AddMoreIcon.js +0 -3
- package/icons/ArrowDropIcon.d.ts +7 -0
- package/icons/ArrowDropIcon.d.ts.map +1 -0
- package/icons/ArrowDropIcon.js +0 -3
- package/icons/ArrowIcon.d.ts +10 -0
- package/icons/ArrowIcon.d.ts.map +1 -0
- package/icons/ArrowIcon.js +2 -11
- package/icons/BarcodeScannerIcon.d.ts +7 -0
- package/icons/BarcodeScannerIcon.d.ts.map +1 -0
- package/icons/BarcodeScannerIcon.js +0 -3
- package/icons/BoxIcon.d.ts +7 -0
- package/icons/BoxIcon.d.ts.map +1 -0
- package/icons/BoxIcon.js +0 -3
- package/icons/BrowseIcon.d.ts +7 -0
- package/icons/BrowseIcon.d.ts.map +1 -0
- package/icons/BrowseIcon.js +1 -3
- package/icons/BurgerIcon.d.ts +7 -0
- package/icons/BurgerIcon.d.ts.map +1 -0
- package/icons/BurgerIcon.js +0 -3
- package/icons/CalendarIcon.d.ts +7 -0
- package/icons/CalendarIcon.d.ts.map +1 -0
- package/icons/CalendarIcon.js +0 -2
- package/icons/CartCouponIcon.d.ts +7 -0
- package/icons/CartCouponIcon.d.ts.map +1 -0
- package/icons/CartCouponIcon.js +0 -2
- package/icons/CartIcon.d.ts +7 -0
- package/icons/CartIcon.d.ts.map +1 -0
- package/icons/CartIcon.js +0 -2
- package/icons/CartPlusIcon.d.ts +7 -0
- package/icons/CartPlusIcon.d.ts.map +1 -0
- package/icons/CartPlusIcon.js +0 -2
- package/icons/CheckIcon.d.ts +7 -0
- package/icons/CheckIcon.d.ts.map +1 -0
- package/icons/CheckIcon.js +0 -2
- package/icons/CheckedIcon.d.ts +7 -0
- package/icons/CheckedIcon.d.ts.map +1 -0
- package/icons/CheckedIcon.js +0 -3
- package/icons/ChevronIcon.d.ts +7 -0
- package/icons/ChevronIcon.d.ts.map +1 -0
- package/icons/ChevronIcon.js +0 -2
- package/icons/CreditCardIcon.d.ts +7 -0
- package/icons/CreditCardIcon.d.ts.map +1 -0
- package/icons/CreditCardIcon.js +0 -2
- package/icons/CrossIcon.d.ts +7 -0
- package/icons/CrossIcon.d.ts.map +1 -0
- package/icons/CrossIcon.js +0 -2
- package/icons/DescriptionIcon.d.ts +7 -0
- package/icons/DescriptionIcon.d.ts.map +1 -0
- package/icons/DescriptionIcon.js +0 -2
- package/icons/FilterIcon.d.ts +7 -0
- package/icons/FilterIcon.d.ts.map +1 -0
- package/icons/FilterIcon.js +0 -2
- package/icons/FlashDisabledIcon.d.ts +7 -0
- package/icons/FlashDisabledIcon.d.ts.map +1 -0
- package/icons/FlashDisabledIcon.js +0 -2
- package/icons/FlashEnabledIcon.d.ts +7 -0
- package/icons/FlashEnabledIcon.d.ts.map +1 -0
- package/icons/FlashEnabledIcon.js +0 -2
- package/icons/GridIcon.d.ts +7 -0
- package/icons/GridIcon.d.ts.map +1 -0
- package/icons/GridIcon.js +1 -3
- package/icons/HeartIcon.d.ts +7 -0
- package/icons/HeartIcon.d.ts.map +1 -0
- package/icons/HeartIcon.js +0 -2
- package/icons/HeartOutlineIcon.d.ts +7 -0
- package/icons/HeartOutlineIcon.d.ts.map +1 -0
- package/icons/HeartOutlineIcon.js +1 -3
- package/icons/HeartPlusIcon.d.ts +7 -0
- package/icons/HeartPlusIcon.d.ts.map +1 -0
- package/icons/HeartPlusIcon.js +1 -3
- package/icons/HeartPlusOutlineIcon.d.ts +7 -0
- package/icons/HeartPlusOutlineIcon.d.ts.map +1 -0
- package/icons/HeartPlusOutlineIcon.js +1 -3
- package/icons/HomeIcon.d.ts +7 -0
- package/icons/HomeIcon.d.ts.map +1 -0
- package/icons/HomeIcon.js +0 -2
- package/icons/InfoIcon.d.ts +7 -0
- package/icons/InfoIcon.d.ts.map +1 -0
- package/icons/InfoIcon.js +0 -2
- package/icons/InfoOutlineIcon.d.ts +7 -0
- package/icons/InfoOutlineIcon.d.ts.map +1 -0
- package/icons/InfoOutlineIcon.js +0 -2
- package/icons/ListIcon.d.ts +7 -0
- package/icons/ListIcon.d.ts.map +1 -0
- package/icons/ListIcon.js +0 -2
- package/icons/LocalShippingIcon.d.ts +7 -0
- package/icons/LocalShippingIcon.d.ts.map +1 -0
- package/icons/LocalShippingIcon.js +0 -2
- package/icons/LocationIcon.d.ts +7 -0
- package/icons/LocationIcon.d.ts.map +1 -0
- package/icons/LocationIcon.js +1 -4
- package/icons/LocatorIcon.d.ts +7 -0
- package/icons/LocatorIcon.d.ts.map +1 -0
- package/icons/LocatorIcon.js +1 -3
- package/icons/LockIcon.d.ts +9 -0
- package/icons/LockIcon.d.ts.map +1 -0
- package/icons/LockIcon.js +1 -2
- package/icons/LogoutIcon.d.ts +7 -0
- package/icons/LogoutIcon.d.ts.map +1 -0
- package/icons/LogoutIcon.js +0 -2
- package/icons/MagnifierIcon.d.ts +7 -0
- package/icons/MagnifierIcon.d.ts.map +1 -0
- package/icons/MagnifierIcon.js +0 -2
- package/icons/MapMarkerIcon.d.ts +7 -0
- package/icons/MapMarkerIcon.d.ts.map +1 -0
- package/icons/MapMarkerIcon.js +1 -3
- package/icons/MoreIcon.d.ts +7 -0
- package/icons/MoreIcon.d.ts.map +1 -0
- package/icons/MoreIcon.js +1 -3
- package/icons/MoreVertIcon.d.ts +7 -0
- package/icons/MoreVertIcon.d.ts.map +1 -0
- package/icons/MoreVertIcon.js +1 -3
- package/icons/NotificationIcon.d.ts +7 -0
- package/icons/NotificationIcon.d.ts.map +1 -0
- package/icons/NotificationIcon.js +1 -3
- package/icons/PersonIcon.d.ts +9 -0
- package/icons/PersonIcon.d.ts.map +1 -0
- package/icons/PersonIcon.js +0 -3
- package/icons/PhoneIcon.d.ts +7 -0
- package/icons/PhoneIcon.d.ts.map +1 -0
- package/icons/PhoneIcon.js +1 -4
- package/icons/PlaceholderIcon.d.ts +7 -0
- package/icons/PlaceholderIcon.d.ts.map +1 -0
- package/icons/PlaceholderIcon.js +0 -2
- package/icons/RadioCheckedIcon.d.ts +10 -0
- package/icons/RadioCheckedIcon.d.ts.map +1 -0
- package/icons/RadioCheckedIcon.js +0 -2
- package/icons/RadioUncheckedIcon.d.ts +10 -0
- package/icons/RadioUncheckedIcon.d.ts.map +1 -0
- package/icons/RadioUncheckedIcon.js +0 -2
- package/icons/SecurityIcon.d.ts +7 -0
- package/icons/SecurityIcon.d.ts.map +1 -0
- package/icons/SecurityIcon.js +0 -2
- package/icons/ShippingMethodIcon.d.ts +7 -0
- package/icons/ShippingMethodIcon.d.ts.map +1 -0
- package/icons/ShippingMethodIcon.js +0 -2
- package/icons/ShoppingCartIcon.d.ts +7 -0
- package/icons/ShoppingCartIcon.d.ts.map +1 -0
- package/icons/ShoppingCartIcon.js +0 -2
- package/icons/SortIcon.d.ts +7 -0
- package/icons/SortIcon.d.ts.map +1 -0
- package/icons/SortIcon.js +0 -2
- package/icons/StarHalfIcon.d.ts +7 -0
- package/icons/StarHalfIcon.d.ts.map +1 -0
- package/icons/StarHalfIcon.js +0 -9
- package/icons/StarIcon.d.ts +7 -0
- package/icons/StarIcon.d.ts.map +1 -0
- package/icons/StarIcon.js +0 -9
- package/icons/StarOutlineIcon.d.ts +7 -0
- package/icons/StarOutlineIcon.d.ts.map +1 -0
- package/icons/StarOutlineIcon.js +0 -2
- package/icons/StopIcon.d.ts +7 -0
- package/icons/StopIcon.d.ts.map +1 -0
- package/icons/StopIcon.js +0 -2
- package/icons/TickIcon.d.ts +7 -0
- package/icons/TickIcon.d.ts.map +1 -0
- package/icons/TickIcon.js +0 -2
- package/icons/TimeIcon.d.ts +7 -0
- package/icons/TimeIcon.d.ts.map +1 -0
- package/icons/TimeIcon.js +0 -2
- package/icons/TrashIcon.d.ts +7 -0
- package/icons/TrashIcon.d.ts.map +1 -0
- package/icons/TrashIcon.js +0 -3
- package/icons/TrashOutlineIcon.d.ts +8 -0
- package/icons/TrashOutlineIcon.d.ts.map +1 -0
- package/icons/TrashOutlineIcon.js +0 -2
- package/icons/UncheckedIcon.d.ts +7 -0
- package/icons/UncheckedIcon.d.ts.map +1 -0
- package/icons/UncheckedIcon.js +0 -2
- package/icons/ViewListIcon.d.ts +7 -0
- package/icons/ViewListIcon.d.ts.map +1 -0
- package/icons/ViewListIcon.js +0 -2
- package/icons/VisibilityIcon.d.ts +8 -0
- package/icons/VisibilityIcon.d.ts.map +1 -0
- package/icons/VisibilityIcon.js +2 -4
- package/icons/VisibilityOffIcon.d.ts +8 -0
- package/icons/VisibilityOffIcon.d.ts.map +1 -0
- package/icons/VisibilityOffIcon.js +2 -4
- package/icons/WarningIcon.d.ts +7 -0
- package/icons/WarningIcon.d.ts.map +1 -0
- package/icons/WarningIcon.js +1 -3
- package/package.json +5 -5
- package/tsconfig.build.json +16 -0
- package/tsconfig.json +3 -0
- package/ActionButton/style.js +0 -22
- package/AddToCartButton/style.js +0 -148
- package/Availability/style.js +0 -19
- package/Button/style.js +0 -155
- package/Card/style.js +0 -11
- package/CardList/components/Item/style.js +0 -7
- package/CartTotalLine/components/Amount/style.js +0 -8
- package/CartTotalLine/components/Hint/style.js +0 -12
- package/CartTotalLine/components/Label/style.js +0 -17
- package/CartTotalLine/style.js +0 -31
- package/Checkbox/style.js +0 -18
- package/Chip/style.js +0 -78
- package/ContextMenu/components/Item/style.js +0 -34
- package/ContextMenu/components/Position/style.js +0 -11
- package/ContextMenu/style.js +0 -45
- package/DiscountBadge/style.js +0 -36
- package/FavoritesButton/style.js +0 -26
- package/Form/Checkbox/style.js +0 -25
- package/Form/InfoField/style.js +0 -11
- package/Form/Password/style.js +0 -11
- package/Form/RadioGroup/components/Item/style.js +0 -32
- package/Form/RadioGroup/style.js +0 -20
- package/Form/Select/style.js +0 -27
- package/Form/SelectContextChoices/style.js +0 -23
- package/Form/TextField/style.js +0 -70
- package/FormElement/components/ErrorText/style.js +0 -13
- package/FormElement/components/Label/style.js +0 -89
- package/FormElement/components/Placeholder/style.js +0 -56
- package/FormElement/components/Underline/style.js +0 -60
- package/FormElement/style.js +0 -14
- package/Glow/style.js +0 -18
- package/IndicatorCircle/style.js +0 -65
- package/LoadingIndicator/style.js +0 -20
- package/Manufacturer/style.js +0 -5
- package/MessageBar/spec.js +0 -80
- package/MessageBar/style.js +0 -38
- package/NoResults/components/Icon/style.js +0 -17
- package/NoResults/style.js +0 -31
- package/Placeholder/style.js +0 -11
- package/PlaceholderLabel/style.js +0 -12
- package/Price/style.js +0 -22
- package/PriceInfo/style.js +0 -5
- package/PriceStriked/style.js +0 -36
- package/ProgressBar/style.js +0 -85
- package/RadioButton/style.js +0 -21
- package/RatingStars/style.js +0 -53
- package/Ripple/style.js +0 -18
- package/ScannerOverlay/components/CameraOverlay/style.js +0 -40
- package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/style.js +0 -28
- package/ScannerOverlay/components/ScannerBar/style.js +0 -20
- package/Sheet/components/Header/components/SearchBar/style.js +0 -47
- package/Sheet/components/Header/style.js +0 -50
- package/Sheet/style.js +0 -143
- package/TaxDisclaimer/style.js +0 -9
- package/TextField/components/ErrorText/style.js +0 -27
- package/TextField/components/FormElement/style.js +0 -34
- package/TextField/components/Hint/style.js +0 -46
- package/TextField/components/Label/style.js +0 -80
- package/TextField/components/Underline/style.js +0 -60
- package/TextField/style.js +0 -35
package/Form/TextField/style.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
|
|
3
|
-
// Selects a date input that is not focused.
|
|
4
|
-
const bluredDateSelector = 'input[type="date"]:in-range:not(:focus)';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The styles for the container element.
|
|
8
|
-
*/
|
|
9
|
-
const container = css({
|
|
10
|
-
// Fixes layout issue with webkit. Height is 0 in some webkit browsers.
|
|
11
|
-
'& input[type="date"]': {
|
|
12
|
-
minHeight: '1.3rem',
|
|
13
|
-
appearance: 'none',
|
|
14
|
-
paddingLeft: 0,
|
|
15
|
-
marginLeft: 0
|
|
16
|
-
},
|
|
17
|
-
// Removes placeholder texts on chrome when input is not focused.
|
|
18
|
-
[`& ${bluredDateSelector}::-webkit-datetime-edit-year-field, ` + `${bluredDateSelector}::-webkit-datetime-edit-month-field, ` + `${bluredDateSelector}::-webkit-datetime-edit-day-field, ` + `${bluredDateSelector}::-webkit-datetime-edit-text`]: {
|
|
19
|
-
padding: 0,
|
|
20
|
-
color: 'transparent'
|
|
21
|
-
}
|
|
22
|
-
}).toString();
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* The styles for the input field.
|
|
26
|
-
*/
|
|
27
|
-
const input = css({
|
|
28
|
-
position: 'relative',
|
|
29
|
-
padding: 0,
|
|
30
|
-
width: '100%',
|
|
31
|
-
marginTop: 24,
|
|
32
|
-
outline: 0,
|
|
33
|
-
fontSize: 16,
|
|
34
|
-
lineHeight: '19px'
|
|
35
|
-
}).toString();
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* The styles for the multiLine.
|
|
39
|
-
*/
|
|
40
|
-
const multiLine = css({
|
|
41
|
-
position: 'relative',
|
|
42
|
-
marginTop: 24,
|
|
43
|
-
marginBottom: 3,
|
|
44
|
-
padding: 0,
|
|
45
|
-
width: '100%',
|
|
46
|
-
outline: 0,
|
|
47
|
-
height: 19,
|
|
48
|
-
minHeight: 19,
|
|
49
|
-
lineHeight: '19px',
|
|
50
|
-
verticalAlign: 'top' // Important to avoid bottom whitespace.
|
|
51
|
-
}).toString();
|
|
52
|
-
const element = css({
|
|
53
|
-
marginTop: 16,
|
|
54
|
-
display: 'flex',
|
|
55
|
-
alignItems: 'flex-end'
|
|
56
|
-
}).toString();
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Additional left spacing when a left element is present
|
|
60
|
-
*/
|
|
61
|
-
const leftOffset = css({
|
|
62
|
-
marginLeft: 2
|
|
63
|
-
}).toString();
|
|
64
|
-
export default {
|
|
65
|
-
container,
|
|
66
|
-
input,
|
|
67
|
-
multiLine,
|
|
68
|
-
element,
|
|
69
|
-
leftOffset
|
|
70
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
export default css({
|
|
4
|
-
bottom: 2,
|
|
5
|
-
color: `var(--color-state-alert, ${themeConfig.colors.error})`,
|
|
6
|
-
fontSize: 12,
|
|
7
|
-
lineHeight: '14px',
|
|
8
|
-
overflow: 'hidden',
|
|
9
|
-
position: 'absolute',
|
|
10
|
-
textOverflow: 'ellipsis',
|
|
11
|
-
whiteSpace: 'nowrap',
|
|
12
|
-
width: '100%'
|
|
13
|
-
}).toString();
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The style object for a one line text element with an ellipsis on overflow.
|
|
7
|
-
*/
|
|
8
|
-
const ellipsisLine = {
|
|
9
|
-
overflow: 'hidden',
|
|
10
|
-
width: '100%',
|
|
11
|
-
whiteSpace: 'nowrap',
|
|
12
|
-
textOverflow: 'ellipsis'
|
|
13
|
-
};
|
|
14
|
-
const easing = '450ms cubic-bezier(0.23, 1, 0.32, 1)';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The styles for the error label.
|
|
18
|
-
*/
|
|
19
|
-
const labelError = css({
|
|
20
|
-
color: `var(--color-state-alert, ${themeConfig.colors.error})`
|
|
21
|
-
}).toString();
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Regular label is hidden, because placeholder is visible
|
|
25
|
-
*/
|
|
26
|
-
const labelRegular = css({
|
|
27
|
-
opacity: 0
|
|
28
|
-
}).toString();
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* The styles for the focused label.
|
|
32
|
-
*/
|
|
33
|
-
const labelFocus = css({
|
|
34
|
-
color: themeConfig.colors.focus
|
|
35
|
-
}).toString();
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* The styles for the floating label.
|
|
39
|
-
*/
|
|
40
|
-
const labelFloating = css({
|
|
41
|
-
transform: 'translate3d(0, -22px, 0) scale3d(0.75, 0.75, 0.75)',
|
|
42
|
-
opacity: 1
|
|
43
|
-
}).toString();
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* The basic styles for the label.
|
|
47
|
-
* @type {string}
|
|
48
|
-
*/
|
|
49
|
-
const label = css({
|
|
50
|
-
position: 'absolute',
|
|
51
|
-
left: 0,
|
|
52
|
-
top: 24,
|
|
53
|
-
lineHeight: '19px',
|
|
54
|
-
pointerEvents: 'none',
|
|
55
|
-
userSelect: 'none',
|
|
56
|
-
color: themeConfig.colors.shade12,
|
|
57
|
-
transformOrigin: 'left top 0px',
|
|
58
|
-
willChange: 'transform, color',
|
|
59
|
-
overflow: 'visible',
|
|
60
|
-
transition: `transform ${easing}, color ${easing}`,
|
|
61
|
-
...ellipsisLine
|
|
62
|
-
}).toString();
|
|
63
|
-
const labelStatic = css({
|
|
64
|
-
opacity: 1,
|
|
65
|
-
lineHeight: '19px',
|
|
66
|
-
pointerEvents: 'none',
|
|
67
|
-
userSelect: 'none',
|
|
68
|
-
color: themeConfig.colors.shade12
|
|
69
|
-
}).toString();
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Gets the style classes for the label.
|
|
73
|
-
* @param {boolean} focused Whether the input field is focused.
|
|
74
|
-
* @param {boolean} floating Whether the label is floating.
|
|
75
|
-
* @param {boolean} error Whether the input field shows an error message.
|
|
76
|
-
* @param {boolean} isStatic Whether the label is static.
|
|
77
|
-
* @return {string} The style classes.
|
|
78
|
-
*/
|
|
79
|
-
const labelStyles = (focused = false, floating = false, error = false, isStatic = false) => classNames({
|
|
80
|
-
[label]: !isStatic,
|
|
81
|
-
[labelStatic]: isStatic,
|
|
82
|
-
[labelFloating]: floating,
|
|
83
|
-
[labelRegular]: !focused,
|
|
84
|
-
[labelFocus]: !error && focused,
|
|
85
|
-
[labelError]: error && focused
|
|
86
|
-
});
|
|
87
|
-
export default {
|
|
88
|
-
labelStyles
|
|
89
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The style object for a one line text element with an ellipsis on overflow.
|
|
7
|
-
*/
|
|
8
|
-
const ellipsisLine = {
|
|
9
|
-
overflow: 'hidden',
|
|
10
|
-
width: '100%',
|
|
11
|
-
whiteSpace: 'nowrap',
|
|
12
|
-
textOverflow: 'ellipsis'
|
|
13
|
-
};
|
|
14
|
-
const easing = '450ms cubic-bezier(0.23, 1, 0.32, 1)';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The styles for the placeholder text.
|
|
18
|
-
*/
|
|
19
|
-
const placeholder = css({
|
|
20
|
-
position: 'absolute',
|
|
21
|
-
pointerEvents: 'none',
|
|
22
|
-
top: 24,
|
|
23
|
-
color: `var(--color-text-medium-emphasis, ${themeConfig.colors.shade6})`,
|
|
24
|
-
willChange: 'transform',
|
|
25
|
-
transition: `opacity ${easing}`,
|
|
26
|
-
...ellipsisLine
|
|
27
|
-
}).toString();
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The styles for the invisible hint text.
|
|
31
|
-
*/
|
|
32
|
-
const placeholderInactive = css({
|
|
33
|
-
opacity: 0
|
|
34
|
-
}).toString();
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Additional left spacing when a left element is present
|
|
38
|
-
*/
|
|
39
|
-
const leftOffset = css({
|
|
40
|
-
left: 'var(--form-element-left-offset, 26px)',
|
|
41
|
-
width: 'calc(100% - var(--form-element-left-offset, 26px))'
|
|
42
|
-
}).toString();
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Gets the style classes for the underline element.
|
|
46
|
-
* @param {boolean} visible Whether the hint is visible.
|
|
47
|
-
* @param {boolean} hasLeftElement - Whether a left element is present.
|
|
48
|
-
* @return {string} The style classes.
|
|
49
|
-
*/
|
|
50
|
-
const placeholderStyles = (visible = false, hasLeftElement = false) => classNames(placeholder, {
|
|
51
|
-
[placeholderInactive]: !visible,
|
|
52
|
-
[leftOffset]: hasLeftElement
|
|
53
|
-
});
|
|
54
|
-
export default {
|
|
55
|
-
placeholderStyles
|
|
56
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import color from 'color';
|
|
3
|
-
import { getCSSCustomProp } from '@shopgate/engage/styles';
|
|
4
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
5
|
-
const {
|
|
6
|
-
colors
|
|
7
|
-
} = themeConfig;
|
|
8
|
-
const easing = '450ms cubic-bezier(0.23, 1, 0.32, 1)';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The styles for the underline wrapper element.
|
|
12
|
-
*/
|
|
13
|
-
const underlineWrapper = css({
|
|
14
|
-
position: 'relative',
|
|
15
|
-
width: '100%',
|
|
16
|
-
borderBottom: `1px solid ${colors.shade12}`,
|
|
17
|
-
marginTop: 2,
|
|
18
|
-
marginBottom: 7
|
|
19
|
-
}).toString();
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* The styles for the underline element.
|
|
23
|
-
* @param {boolean} focused Whether the input field is focused.
|
|
24
|
-
* @param {boolean} error Whether the input field shows an error message.
|
|
25
|
-
* @return {string} The style class.
|
|
26
|
-
*/
|
|
27
|
-
const underline = css({
|
|
28
|
-
position: 'relative',
|
|
29
|
-
width: '100%',
|
|
30
|
-
top: 1,
|
|
31
|
-
borderBottomWidth: 2,
|
|
32
|
-
borderBottomStyle: 'solid',
|
|
33
|
-
willChange: 'transform',
|
|
34
|
-
transition: `transform ${easing}`
|
|
35
|
-
}).toString();
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Returns the underline style.
|
|
39
|
-
* @param {boolean} focused Is focused set or not.
|
|
40
|
-
* @param {boolean} hasError Has error set or not.
|
|
41
|
-
* @return {Object} style
|
|
42
|
-
*/
|
|
43
|
-
const underlineStyle = (focused, hasError) => {
|
|
44
|
-
const primaryColor = getCSSCustomProp('--color-primary') || colors.primary;
|
|
45
|
-
let focusColor = '--color-primary';
|
|
46
|
-
if (color(primaryColor).luminosity() >= 0.8) {
|
|
47
|
-
focusColor = '--color-secondary';
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
borderBottomColor: hasError ? `var(--color-state-alert, ${colors.error})` : `var(${focusColor}, ${colors.focus})`,
|
|
51
|
-
...(!focused && !hasError && {
|
|
52
|
-
transform: 'scale3d(0,1,1)'
|
|
53
|
-
})
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
export default {
|
|
57
|
-
underline,
|
|
58
|
-
underlineWrapper,
|
|
59
|
-
underlineStyle
|
|
60
|
-
};
|
package/FormElement/style.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* The styles for the container element.
|
|
6
|
-
*/
|
|
7
|
-
const formElement = css({
|
|
8
|
-
position: 'relative',
|
|
9
|
-
paddingBottom: themeConfig.variables.gap.big,
|
|
10
|
-
width: '100%'
|
|
11
|
-
}).toString();
|
|
12
|
-
export default {
|
|
13
|
-
formElement
|
|
14
|
-
};
|
package/Glow/style.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
const container = css({
|
|
3
|
-
position: 'relative'
|
|
4
|
-
}).toString();
|
|
5
|
-
const glow = css({
|
|
6
|
-
position: 'absolute',
|
|
7
|
-
left: 0,
|
|
8
|
-
top: 0,
|
|
9
|
-
width: '100%',
|
|
10
|
-
height: '100%',
|
|
11
|
-
background: 'transparent',
|
|
12
|
-
transition: 'background 100ms cubic-bezier(0.25, 0.1, 0.25, 1)',
|
|
13
|
-
zIndex: 0
|
|
14
|
-
}).toString();
|
|
15
|
-
export default {
|
|
16
|
-
container,
|
|
17
|
-
glow
|
|
18
|
-
};
|
package/IndicatorCircle/style.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
const rotate = css.keyframes({
|
|
3
|
-
'100%': {
|
|
4
|
-
transform: 'rotate(360deg)'
|
|
5
|
-
}
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Styles for spinner.
|
|
10
|
-
* @param {boolean} paused Animation should be paused.
|
|
11
|
-
* @returns {string}
|
|
12
|
-
*/
|
|
13
|
-
const spinner = paused => {
|
|
14
|
-
const styles = {
|
|
15
|
-
margin: 'auto',
|
|
16
|
-
transformOrigin: 'center center',
|
|
17
|
-
maxWidth: '100%',
|
|
18
|
-
maxHeight: '100%'
|
|
19
|
-
};
|
|
20
|
-
if (!paused) {
|
|
21
|
-
styles.animation = `${rotate} 1.6s linear infinite`;
|
|
22
|
-
}
|
|
23
|
-
return css(styles).toString();
|
|
24
|
-
};
|
|
25
|
-
const dash = css.keyframes({
|
|
26
|
-
'0%': {
|
|
27
|
-
strokeDasharray: '1, 200',
|
|
28
|
-
strokeDashoffset: '0'
|
|
29
|
-
},
|
|
30
|
-
'50%': {
|
|
31
|
-
strokeDasharray: '89, 200',
|
|
32
|
-
strokeDashoffset: '-35px'
|
|
33
|
-
},
|
|
34
|
-
'100%': {
|
|
35
|
-
strokeDasharray: '89, 200',
|
|
36
|
-
strokeDashoffset: '-124px'
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Styles for the rotating circle.
|
|
42
|
-
* @param {string} color The color of the circle. Default color is "accent".
|
|
43
|
-
* @param {string} strokeWidth The stroke width of the circle.
|
|
44
|
-
* @param {boolean} paused Animation should be paused.
|
|
45
|
-
* @return {string} CSS class name.
|
|
46
|
-
*/
|
|
47
|
-
const circle = (color, strokeWidth, paused) => {
|
|
48
|
-
const styles = {
|
|
49
|
-
fill: 'none',
|
|
50
|
-
stroke: color,
|
|
51
|
-
strokeDasharray: '1, 200',
|
|
52
|
-
strokeDashoffset: 0,
|
|
53
|
-
strokeLinecap: 'round',
|
|
54
|
-
strokeMiterlimit: 10,
|
|
55
|
-
strokeWidth
|
|
56
|
-
};
|
|
57
|
-
if (!paused) {
|
|
58
|
-
styles.animation = `${dash} 1.2s ease-in-out infinite`;
|
|
59
|
-
}
|
|
60
|
-
return css(styles).toString();
|
|
61
|
-
};
|
|
62
|
-
export default {
|
|
63
|
-
spinner,
|
|
64
|
-
circle
|
|
65
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const {
|
|
4
|
-
colors
|
|
5
|
-
} = themeConfig;
|
|
6
|
-
export const container = css({
|
|
7
|
-
display: 'block',
|
|
8
|
-
padding: '1em',
|
|
9
|
-
textAlign: 'center',
|
|
10
|
-
fontSize: '1.5em',
|
|
11
|
-
color: `var(--color-secondary, ${colors.accent})`
|
|
12
|
-
});
|
|
13
|
-
export const imgContainer = css({
|
|
14
|
-
display: 'flex',
|
|
15
|
-
justifyContent: 'center',
|
|
16
|
-
' img': {
|
|
17
|
-
maxWidth: '50vw',
|
|
18
|
-
maxHeight: '50vh'
|
|
19
|
-
}
|
|
20
|
-
});
|
package/Manufacturer/style.js
DELETED
package/MessageBar/spec.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mount } from 'enzyme';
|
|
3
|
-
import MessageBar from "./index";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
const MESSAGE1 = 'This is some information';
|
|
6
|
-
const MESSAGE2 = 'This is an error that happened here.';
|
|
7
|
-
const MESSAGE3 = 'This is just a warning. Nothing to freak out about.';
|
|
8
|
-
const MESSAGE4 = 'Normal pre-translated message.';
|
|
9
|
-
const MESSAGE5 = 'Normal pre-translated message two.';
|
|
10
|
-
const MESSAGE6 = 'some.translation.string';
|
|
11
|
-
const MESSAGE7 = 'Message with messageParams';
|
|
12
|
-
describe('<MessageBar />', () => {
|
|
13
|
-
describe('General rendering', () => {
|
|
14
|
-
it('should be empty if no messages have been set', () => {
|
|
15
|
-
const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
|
|
16
|
-
messages: []
|
|
17
|
-
}));
|
|
18
|
-
expect(wrapper).toMatchSnapshot();
|
|
19
|
-
});
|
|
20
|
-
it('should render a message as info if type is missing', () => {
|
|
21
|
-
const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
|
|
22
|
-
messages: [{
|
|
23
|
-
message: 'something'
|
|
24
|
-
}]
|
|
25
|
-
}));
|
|
26
|
-
expect(wrapper).toMatchSnapshot();
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
describe('Multiple messages rendering', () => {
|
|
30
|
-
it('should render messages without frontend translation', () => {
|
|
31
|
-
const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
|
|
32
|
-
messages: [{
|
|
33
|
-
type: 'info',
|
|
34
|
-
message: MESSAGE1
|
|
35
|
-
}, {
|
|
36
|
-
type: 'error',
|
|
37
|
-
message: MESSAGE2
|
|
38
|
-
}, {
|
|
39
|
-
type: 'warning',
|
|
40
|
-
message: MESSAGE3
|
|
41
|
-
}, {
|
|
42
|
-
message: MESSAGE4,
|
|
43
|
-
translated: null
|
|
44
|
-
}, {
|
|
45
|
-
message: MESSAGE5,
|
|
46
|
-
translated: true
|
|
47
|
-
}]
|
|
48
|
-
}));
|
|
49
|
-
expect(wrapper).toMatchSnapshot();
|
|
50
|
-
});
|
|
51
|
-
it('should translate and render all given messages', () => {
|
|
52
|
-
const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
|
|
53
|
-
messages: [{
|
|
54
|
-
message: MESSAGE6,
|
|
55
|
-
translated: false
|
|
56
|
-
}, {
|
|
57
|
-
message: MESSAGE7,
|
|
58
|
-
messageParams: {
|
|
59
|
-
myCustomParam1: '-> TEST-VALUE #1 <-',
|
|
60
|
-
myCustomParam2: '-> TEST-VALUE #2 <-'
|
|
61
|
-
},
|
|
62
|
-
translated: false
|
|
63
|
-
}]
|
|
64
|
-
}));
|
|
65
|
-
expect(wrapper).toMatchSnapshot();
|
|
66
|
-
});
|
|
67
|
-
it('should render with custom classNames', () => {
|
|
68
|
-
const wrapper = mount(/*#__PURE__*/_jsx(MessageBar, {
|
|
69
|
-
messages: [{
|
|
70
|
-
message: MESSAGE1
|
|
71
|
-
}],
|
|
72
|
-
classNames: {
|
|
73
|
-
container: 'cls-container',
|
|
74
|
-
message: 'cls-message'
|
|
75
|
-
}
|
|
76
|
-
}));
|
|
77
|
-
expect(wrapper).toMatchSnapshot();
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
});
|
package/MessageBar/style.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const {
|
|
4
|
-
colors,
|
|
5
|
-
variables
|
|
6
|
-
} = themeConfig;
|
|
7
|
-
const container = css({
|
|
8
|
-
background: colors.background,
|
|
9
|
-
display: 'flex',
|
|
10
|
-
flexDirection: 'column',
|
|
11
|
-
flexShrink: 0
|
|
12
|
-
}).toString();
|
|
13
|
-
const messageBase = {
|
|
14
|
-
padding: `${variables.gap.small}px ${variables.gap.big}px`,
|
|
15
|
-
fontSize: '0.875rem',
|
|
16
|
-
fontWeight: 500,
|
|
17
|
-
':not(:last-child)': {
|
|
18
|
-
marginBottom: variables.gap.small * 0.5
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
const info = css(messageBase, {
|
|
22
|
-
background: `var(--color-secondary, ${colors.accent})`,
|
|
23
|
-
color: `var(--color-secondary-contrast, ${colors.accentContrast})`
|
|
24
|
-
}).toString();
|
|
25
|
-
const error = css(messageBase, {
|
|
26
|
-
background: colors.error,
|
|
27
|
-
color: colors.light
|
|
28
|
-
}).toString();
|
|
29
|
-
const warning = css(messageBase, {
|
|
30
|
-
background: colors.warning,
|
|
31
|
-
color: colors.light
|
|
32
|
-
}).toString();
|
|
33
|
-
export default {
|
|
34
|
-
container,
|
|
35
|
-
info,
|
|
36
|
-
error,
|
|
37
|
-
warning
|
|
38
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeColors } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const magnifier = css({
|
|
4
|
-
fill: 'currentColor'
|
|
5
|
-
}).toString();
|
|
6
|
-
const background = css({
|
|
7
|
-
fill: themeColors.light
|
|
8
|
-
}).toString();
|
|
9
|
-
const circle = css({
|
|
10
|
-
fill: 'currentColor',
|
|
11
|
-
opacity: 0.065
|
|
12
|
-
}).toString();
|
|
13
|
-
export default {
|
|
14
|
-
magnifier,
|
|
15
|
-
background,
|
|
16
|
-
circle
|
|
17
|
-
};
|
package/NoResults/style.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const wrapper = css({
|
|
4
|
-
alignItems: 'center',
|
|
5
|
-
display: 'flex',
|
|
6
|
-
flexDirection: 'column',
|
|
7
|
-
height: '100%',
|
|
8
|
-
width: '100%',
|
|
9
|
-
justifyContent: 'center',
|
|
10
|
-
textAlign: 'center',
|
|
11
|
-
background: `var(--page-background-color, ${themeConfig.colors.shade8})`
|
|
12
|
-
}).toString();
|
|
13
|
-
const icon = css({
|
|
14
|
-
width: 216,
|
|
15
|
-
color: `var(--color-primary, ${themeConfig.colors.primary})`
|
|
16
|
-
}).toString();
|
|
17
|
-
const headline = css({
|
|
18
|
-
fontSize: '1.25rem',
|
|
19
|
-
fontWeight: 500,
|
|
20
|
-
marginTop: 30
|
|
21
|
-
}).toString();
|
|
22
|
-
const text = css({
|
|
23
|
-
marginTop: themeConfig.variables.gap.big,
|
|
24
|
-
padding: `0 ${themeConfig.variables.gap.big}px`
|
|
25
|
-
}).toString();
|
|
26
|
-
export default {
|
|
27
|
-
wrapper,
|
|
28
|
-
icon,
|
|
29
|
-
headline,
|
|
30
|
-
text
|
|
31
|
-
};
|
package/Placeholder/style.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const {
|
|
4
|
-
colors: {
|
|
5
|
-
shade7
|
|
6
|
-
}
|
|
7
|
-
} = themeConfig;
|
|
8
|
-
export default css({
|
|
9
|
-
background: `var(--color-background-accent, ${shade7})`,
|
|
10
|
-
position: 'relative'
|
|
11
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const label = css({
|
|
4
|
-
background: themeConfig.colors.dark,
|
|
5
|
-
opacity: 0.1,
|
|
6
|
-
width: '100%',
|
|
7
|
-
height: 16,
|
|
8
|
-
marginBottom: 12
|
|
9
|
-
}).toString();
|
|
10
|
-
export default {
|
|
11
|
-
label
|
|
12
|
-
};
|
package/Price/style.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const container = css({
|
|
4
|
-
display: 'flex',
|
|
5
|
-
position: 'relative',
|
|
6
|
-
whiteSpace: 'nowrap'
|
|
7
|
-
}).toString();
|
|
8
|
-
const disclaimer = css({
|
|
9
|
-
color: 'initial',
|
|
10
|
-
fontSize: 14,
|
|
11
|
-
position: 'absolute',
|
|
12
|
-
right: -10,
|
|
13
|
-
top: 0
|
|
14
|
-
}).toString();
|
|
15
|
-
const discounted = css({
|
|
16
|
-
color: `var(--color-primary, ${themeConfig.colors.primary})`
|
|
17
|
-
}).toString();
|
|
18
|
-
export default {
|
|
19
|
-
container,
|
|
20
|
-
disclaimer,
|
|
21
|
-
discounted
|
|
22
|
-
};
|
package/PriceInfo/style.js
DELETED
package/PriceStriked/style.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeColors } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const basic = css({
|
|
4
|
-
whiteSpace: 'nowrap',
|
|
5
|
-
'& span': {
|
|
6
|
-
position: 'relative',
|
|
7
|
-
':before': {
|
|
8
|
-
// The strike-through effect is achieved by using the :before pseudo-class.
|
|
9
|
-
borderColor: 'currentColor',
|
|
10
|
-
content: '""',
|
|
11
|
-
position: 'absolute',
|
|
12
|
-
left: 0,
|
|
13
|
-
right: 0,
|
|
14
|
-
top: '50%'
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
color: themeColors.shade11
|
|
18
|
-
}).toString();
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Returns a class for the rotated strike-through line.
|
|
22
|
-
* @param {number} angle The calculated angle for the strike-through line.
|
|
23
|
-
* @returns {string} Classname
|
|
24
|
-
*/
|
|
25
|
-
const getAngleStyle = angle => css({
|
|
26
|
-
'& span': {
|
|
27
|
-
':before': {
|
|
28
|
-
borderTop: '1px solid',
|
|
29
|
-
transform: `rotate(-${angle}deg)`
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}).toString();
|
|
33
|
-
export default {
|
|
34
|
-
basic,
|
|
35
|
-
getAngleStyle
|
|
36
|
-
};
|