@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/Button/style.js
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const {
|
|
4
|
-
colors
|
|
5
|
-
} = themeConfig;
|
|
6
|
-
const buttonPadding = `0 ${themeConfig.variables.gap.big}px 0`;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Creates the button style.
|
|
10
|
-
* @param {string} text The text color.
|
|
11
|
-
* @param {string|null} background The fill color.
|
|
12
|
-
* @return {Object} The button style.
|
|
13
|
-
*/
|
|
14
|
-
const button = (text, background) => ({
|
|
15
|
-
position: 'relative',
|
|
16
|
-
display: 'inline-block',
|
|
17
|
-
outline: 0,
|
|
18
|
-
color: text,
|
|
19
|
-
backgroundColor: background,
|
|
20
|
-
minWidth: 64,
|
|
21
|
-
overflow: 'hidden',
|
|
22
|
-
':disabled': {
|
|
23
|
-
cursor: 'not-allowed'
|
|
24
|
-
},
|
|
25
|
-
...themeConfig.variables.buttonBase
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* The basic content wrapper styles.
|
|
30
|
-
*/
|
|
31
|
-
const contentWrapper = css({
|
|
32
|
-
padding: buttonPadding
|
|
33
|
-
}).toString();
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Creates the button styles object.
|
|
37
|
-
* @param {string} textColor The text color.
|
|
38
|
-
* @param {string|null} fillColor The fill color.
|
|
39
|
-
* @return {Object} The styles object.
|
|
40
|
-
*/
|
|
41
|
-
const createButtonStyles = (textColor, fillColor) => {
|
|
42
|
-
const buttonStyle = {
|
|
43
|
-
...button(textColor, fillColor)
|
|
44
|
-
};
|
|
45
|
-
const contentStyle = {
|
|
46
|
-
padding: buttonPadding,
|
|
47
|
-
color: buttonStyle.color
|
|
48
|
-
};
|
|
49
|
-
return {
|
|
50
|
-
button: css(buttonStyle).toString(),
|
|
51
|
-
content: css(contentStyle).toString()
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Creates a plain button style object without any styling.
|
|
57
|
-
* @return {Object}
|
|
58
|
-
*/
|
|
59
|
-
const plain = () => ({
|
|
60
|
-
button: css({
|
|
61
|
-
padding: 0,
|
|
62
|
-
outline: 0,
|
|
63
|
-
border: 0,
|
|
64
|
-
textAlign: 'left'
|
|
65
|
-
}).toString(),
|
|
66
|
-
content: ''
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Creates a simple button style object.
|
|
71
|
-
* @param {boolean} disabled Whether this button is disabled.
|
|
72
|
-
* @return {Object}
|
|
73
|
-
*/
|
|
74
|
-
const simple = disabled => {
|
|
75
|
-
if (disabled) {
|
|
76
|
-
// simple disabled button style.
|
|
77
|
-
return createButtonStyles(themeConfig.colors.shade4, themeConfig.colors.shade7);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// simple enabled button style.
|
|
81
|
-
return createButtonStyles(themeConfig.colors.dark, themeConfig.colors.shade7);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* The regular flat button style.
|
|
86
|
-
* @param {boolean} disabled Whether this button is disabled.
|
|
87
|
-
* @return {Object} An object of style definitions.
|
|
88
|
-
*/
|
|
89
|
-
const regular = disabled => {
|
|
90
|
-
if (disabled) {
|
|
91
|
-
// Flat disabled button style.
|
|
92
|
-
return createButtonStyles(colors.shade4, null);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Flat enabled button style.
|
|
96
|
-
return createButtonStyles(colors.dark, null);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* The primary button style.
|
|
101
|
-
* @param {boolean} disabled Whether this button is disabled.
|
|
102
|
-
* @param {boolean} flat Whether this button should be rendered flat.
|
|
103
|
-
* @return {Object} An object of style definitions.
|
|
104
|
-
*/
|
|
105
|
-
const primary = (disabled, flat) => {
|
|
106
|
-
if (!flat) {
|
|
107
|
-
if (disabled) {
|
|
108
|
-
// Regular disabled button style.
|
|
109
|
-
return createButtonStyles(colors.shade4, colors.shade7);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Regular enabled button style.
|
|
113
|
-
return createButtonStyles(`var(--color-secondary-contrast, ${colors.accentContrast})`, `var(--color-secondary, ${colors.accent})`);
|
|
114
|
-
}
|
|
115
|
-
if (disabled) {
|
|
116
|
-
// Flat disabled button style.
|
|
117
|
-
return createButtonStyles(colors.shade4, null);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// Flat enabled button style.
|
|
121
|
-
return createButtonStyles(`var(--color-secondary, ${colors.accent})`, null);
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* The secondary button style.
|
|
126
|
-
* @param {boolean} disabled Whether this button is disabled.
|
|
127
|
-
* @param {boolean} flat Whether this button should be rendered flat.
|
|
128
|
-
* @return {Object} An object of style definitions.
|
|
129
|
-
*/
|
|
130
|
-
const secondary = (disabled, flat) => {
|
|
131
|
-
if (!flat) {
|
|
132
|
-
if (disabled) {
|
|
133
|
-
// Regular disabled button style.
|
|
134
|
-
return createButtonStyles(colors.shade4, colors.shade7);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Regular enabled button style.
|
|
138
|
-
return createButtonStyles(`var(--color-primary-contrast, ${colors.primaryContrast})`, `var(--color-primary, ${colors.primary})`);
|
|
139
|
-
}
|
|
140
|
-
if (disabled) {
|
|
141
|
-
// Flat disabled button style.
|
|
142
|
-
return createButtonStyles(colors.shade4, null);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Flat enabled button style.
|
|
146
|
-
return createButtonStyles(`var(--color-primary, ${colors.primary})`, null);
|
|
147
|
-
};
|
|
148
|
-
export default {
|
|
149
|
-
plain,
|
|
150
|
-
regular,
|
|
151
|
-
simple,
|
|
152
|
-
primary,
|
|
153
|
-
secondary,
|
|
154
|
-
contentWrapper
|
|
155
|
-
};
|
package/Card/style.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig, themeName } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const isIOS = themeName.includes('ios');
|
|
4
|
-
export default css({
|
|
5
|
-
boxShadow: themeConfig.shadows.productCard,
|
|
6
|
-
margin: '5px 5px 10px',
|
|
7
|
-
borderRadius: isIOS ? 10 : 2,
|
|
8
|
-
background: themeConfig.colors.light,
|
|
9
|
-
overflow: 'hidden',
|
|
10
|
-
position: 'relative'
|
|
11
|
-
}).toString();
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const {
|
|
4
|
-
variables
|
|
5
|
-
} = themeConfig;
|
|
6
|
-
const hint = css({
|
|
7
|
-
paddingLeft: variables.gap.small,
|
|
8
|
-
order: 5
|
|
9
|
-
}).toString();
|
|
10
|
-
export default {
|
|
11
|
-
hint
|
|
12
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const {
|
|
4
|
-
variables
|
|
5
|
-
} = themeConfig;
|
|
6
|
-
const label = css({
|
|
7
|
-
flexGrow: 1,
|
|
8
|
-
paddingRight: variables.gap.small,
|
|
9
|
-
order: 3
|
|
10
|
-
}).toString();
|
|
11
|
-
const labelWithSuffix = css({
|
|
12
|
-
paddingRight: variables.gap.small
|
|
13
|
-
});
|
|
14
|
-
export default {
|
|
15
|
-
label,
|
|
16
|
-
labelWithSuffix
|
|
17
|
-
};
|
package/CartTotalLine/style.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const {
|
|
4
|
-
colors
|
|
5
|
-
} = themeConfig;
|
|
6
|
-
const disabled = css({
|
|
7
|
-
color: `${colors.shade4} !important`
|
|
8
|
-
}).toString();
|
|
9
|
-
const base = css({
|
|
10
|
-
color: colors.shade9
|
|
11
|
-
}).toString();
|
|
12
|
-
const subTotal = css({
|
|
13
|
-
color: `${colors.dark}`
|
|
14
|
-
}).toString();
|
|
15
|
-
const grandTotal = css({
|
|
16
|
-
color: `${colors.dark}`,
|
|
17
|
-
fontSize: '1rem !important'
|
|
18
|
-
}).toString();
|
|
19
|
-
const line = css({
|
|
20
|
-
display: 'flex',
|
|
21
|
-
justifyContent: 'space-between',
|
|
22
|
-
fontSize: '0.875rem',
|
|
23
|
-
alignItems: 'baseline'
|
|
24
|
-
}).toString();
|
|
25
|
-
export default {
|
|
26
|
-
subTotal,
|
|
27
|
-
grandTotal,
|
|
28
|
-
base,
|
|
29
|
-
line,
|
|
30
|
-
disabled
|
|
31
|
-
};
|
package/Checkbox/style.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const icon = css({
|
|
4
|
-
width: 24,
|
|
5
|
-
height: 24,
|
|
6
|
-
flexShrink: 0
|
|
7
|
-
}).toString();
|
|
8
|
-
const checkedIcon = css({
|
|
9
|
-
color: `var(--color-secondary, ${themeConfig.colors.accent})`
|
|
10
|
-
}).toString();
|
|
11
|
-
const uncheckedIcon = css({
|
|
12
|
-
color: themeConfig.colors.shade6
|
|
13
|
-
}).toString();
|
|
14
|
-
export default {
|
|
15
|
-
icon,
|
|
16
|
-
checkedIcon,
|
|
17
|
-
uncheckedIcon
|
|
18
|
-
};
|
package/Chip/style.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { responsiveMediaQuery } from '@shopgate/engage/styles';
|
|
3
|
-
import { hasNewServices } from '@shopgate/engage/core/helpers';
|
|
4
|
-
import { themeConfig } from '@shopgate/engage';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Gets a basic style object for the chip layout.
|
|
8
|
-
* @param {boolean} hasRemoveButton Whether this chip has a remove button.
|
|
9
|
-
* @returns {Object} The style object.
|
|
10
|
-
*/
|
|
11
|
-
const chipBase = (hasRemoveButton = true) => ({
|
|
12
|
-
display: 'flex',
|
|
13
|
-
alignItems: 'center',
|
|
14
|
-
borderRadius: 26,
|
|
15
|
-
outline: 0,
|
|
16
|
-
height: 26,
|
|
17
|
-
paddingRight: themeConfig.variables.gap.small,
|
|
18
|
-
paddingLeft: themeConfig.variables.gap.small * (hasRemoveButton ? 0.5 : 1),
|
|
19
|
-
marginRight: 5,
|
|
20
|
-
marginTop: 4,
|
|
21
|
-
marginBottom: 4,
|
|
22
|
-
minWidth: 0
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Gets a style class for the chip layout.
|
|
27
|
-
* @param {boolean} hasRemoveButton Whether this chip has a remove button.
|
|
28
|
-
* @param {boolean} inverted Whether the colors of the chip are inverted.
|
|
29
|
-
* @returns {string} The style class name.
|
|
30
|
-
*/
|
|
31
|
-
const chip = (hasRemoveButton = true, inverted = false) => css({
|
|
32
|
-
...chipBase(hasRemoveButton),
|
|
33
|
-
...(hasNewServices() ? {
|
|
34
|
-
backgroundColor: inverted ? 'var(--color-primary)' : 'var(--color-primary-contrast)',
|
|
35
|
-
color: inverted ? 'var(--color-primary-contrast)' : 'var(--color-primary)'
|
|
36
|
-
} : {
|
|
37
|
-
backgroundColor: inverted ? 'var(--color-secondary)' : 'var(--color-secondary-contrast)',
|
|
38
|
-
color: inverted ? 'var(--color-secondary-contrast)' : 'var(--color-secondary)',
|
|
39
|
-
'--color-text-high-emphasis': inverted ? 'var(--color-secondary-contrast)' : 'var(--color-secondary)'
|
|
40
|
-
})
|
|
41
|
-
}).toString();
|
|
42
|
-
const removeButton = css({
|
|
43
|
-
flexShrink: 0,
|
|
44
|
-
padding: 0,
|
|
45
|
-
[responsiveMediaQuery('>xs', {
|
|
46
|
-
webOnly: true
|
|
47
|
-
})]: {
|
|
48
|
-
padding: '0 5px',
|
|
49
|
-
fontSize: '1.125rem'
|
|
50
|
-
}
|
|
51
|
-
}).toString();
|
|
52
|
-
const name = css({
|
|
53
|
-
paddingLeft: themeConfig.variables.gap.small * 0.5,
|
|
54
|
-
paddingRight: themeConfig.variables.gap.small * 0.5,
|
|
55
|
-
paddingTop: 3,
|
|
56
|
-
paddingBottom: 3,
|
|
57
|
-
fontSize: 12,
|
|
58
|
-
fontWeight: 500,
|
|
59
|
-
textOverflow: 'ellipsis',
|
|
60
|
-
maxWidth: '100%',
|
|
61
|
-
whiteSpace: 'nowrap',
|
|
62
|
-
overflow: 'hidden',
|
|
63
|
-
display: 'block',
|
|
64
|
-
lineHeight: '1',
|
|
65
|
-
color: 'inherit',
|
|
66
|
-
[responsiveMediaQuery('>xs', {
|
|
67
|
-
webOnly: true
|
|
68
|
-
})]: {
|
|
69
|
-
fontSize: '0.875rem',
|
|
70
|
-
lineHeight: '1.25rem',
|
|
71
|
-
padding: '6px 8px 6px 0'
|
|
72
|
-
}
|
|
73
|
-
}).toString();
|
|
74
|
-
export default {
|
|
75
|
-
chip,
|
|
76
|
-
removeButton,
|
|
77
|
-
name
|
|
78
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import Color from 'color';
|
|
3
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
4
|
-
import { getCSSCustomProp } from '@shopgate/engage/styles';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Get the item class.
|
|
8
|
-
* @param {boolean} disabled Disabled.
|
|
9
|
-
* @returns {string}
|
|
10
|
-
*/
|
|
11
|
-
export const getItemClass = disabled => {
|
|
12
|
-
let background = themeConfig.colors.shade8;
|
|
13
|
-
const customPropColor = getCSSCustomProp('--color-primary');
|
|
14
|
-
if (customPropColor) {
|
|
15
|
-
background = Color(customPropColor).alpha(0.04);
|
|
16
|
-
}
|
|
17
|
-
return css({
|
|
18
|
-
position: 'relative',
|
|
19
|
-
whiteSpace: 'nowrap',
|
|
20
|
-
marginBottom: 2,
|
|
21
|
-
padding: `${themeConfig.variables.gap.big * 0.875}px ${themeConfig.variables.gap.big * 1.375}px`,
|
|
22
|
-
lineHeight: 1,
|
|
23
|
-
zIndex: 1,
|
|
24
|
-
color: disabled ? 'var(--color-text-low-emphasis)' : 'inherits',
|
|
25
|
-
...(!disabled ? {
|
|
26
|
-
cursor: 'pointer',
|
|
27
|
-
':hover': {
|
|
28
|
-
background
|
|
29
|
-
}
|
|
30
|
-
} : {
|
|
31
|
-
cursor: 'default'
|
|
32
|
-
})
|
|
33
|
-
}).toString();
|
|
34
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const outerGap = themeConfig.variables.gap.small;
|
|
4
|
-
const container = css({
|
|
5
|
-
position: 'absolute',
|
|
6
|
-
margin: outerGap
|
|
7
|
-
}).toString();
|
|
8
|
-
export default {
|
|
9
|
-
container,
|
|
10
|
-
outerGap
|
|
11
|
-
};
|
package/ContextMenu/style.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const container = css({
|
|
4
|
-
position: 'relative'
|
|
5
|
-
}).toString();
|
|
6
|
-
const button = css({
|
|
7
|
-
display: 'block',
|
|
8
|
-
fontSize: '1.5rem',
|
|
9
|
-
outline: 0,
|
|
10
|
-
padding: 0,
|
|
11
|
-
color: 'inherit'
|
|
12
|
-
}).toString();
|
|
13
|
-
const disabled = css({
|
|
14
|
-
cursor: 'not-allowed'
|
|
15
|
-
}).toString();
|
|
16
|
-
const overlay = css({
|
|
17
|
-
position: 'fixed',
|
|
18
|
-
top: 0,
|
|
19
|
-
right: 0,
|
|
20
|
-
bottom: 0,
|
|
21
|
-
left: 0,
|
|
22
|
-
zIndex: 10
|
|
23
|
-
}).toString();
|
|
24
|
-
const menu = css({
|
|
25
|
-
position: 'absolute',
|
|
26
|
-
top: 0,
|
|
27
|
-
left: 0,
|
|
28
|
-
padding: `${themeConfig.variables.gap.small}px 0`,
|
|
29
|
-
minWidth: 130,
|
|
30
|
-
background: themeConfig.colors.light,
|
|
31
|
-
borderRadius: 2,
|
|
32
|
-
boxShadow: themeConfig.shadows.contextMenu
|
|
33
|
-
}).toString();
|
|
34
|
-
const scrollable = css({
|
|
35
|
-
maxHeight: '30vh',
|
|
36
|
-
overflowY: 'auto'
|
|
37
|
-
}).toString();
|
|
38
|
-
export default {
|
|
39
|
-
container,
|
|
40
|
-
button,
|
|
41
|
-
menu,
|
|
42
|
-
overlay,
|
|
43
|
-
disabled,
|
|
44
|
-
scrollable
|
|
45
|
-
};
|
package/DiscountBadge/style.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const {
|
|
4
|
-
colors
|
|
5
|
-
} = themeConfig;
|
|
6
|
-
const badge = {
|
|
7
|
-
background: `var(--color-primary, ${colors.primary})`,
|
|
8
|
-
borderRadius: 2,
|
|
9
|
-
color: `var(--color-primary-contrast, ${colors.primaryContrast})`,
|
|
10
|
-
padding: 5,
|
|
11
|
-
width: '100%',
|
|
12
|
-
fontWeight: 700,
|
|
13
|
-
textAlign: 'center',
|
|
14
|
-
display: 'flex',
|
|
15
|
-
justifyContent: 'center',
|
|
16
|
-
alignItems: 'center',
|
|
17
|
-
lineHeight: 1,
|
|
18
|
-
whiteSpace: 'nowrap',
|
|
19
|
-
...themeConfig.variables.discountBadgeBase
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* The discount badge styles that can be selected by passing the style key.
|
|
24
|
-
* @type {Object}
|
|
25
|
-
*/
|
|
26
|
-
export default {
|
|
27
|
-
small: css({
|
|
28
|
-
...badge
|
|
29
|
-
}).toString(),
|
|
30
|
-
big: css({
|
|
31
|
-
...badge,
|
|
32
|
-
paddingTop: 5,
|
|
33
|
-
paddingLeft: 5,
|
|
34
|
-
paddingRight: 5
|
|
35
|
-
}).toString()
|
|
36
|
-
};
|
package/FavoritesButton/style.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeShadows, themeColors } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const buttonProto = {
|
|
4
|
-
display: 'block',
|
|
5
|
-
position: 'relative',
|
|
6
|
-
background: themeColors.light,
|
|
7
|
-
borderRadius: '50%',
|
|
8
|
-
padding: 0,
|
|
9
|
-
fontSize: 20,
|
|
10
|
-
lineHeight: 1,
|
|
11
|
-
color: `var(--color-secondary, ${themeColors.accent})`,
|
|
12
|
-
outline: 0
|
|
13
|
-
};
|
|
14
|
-
const buttonFlat = css(buttonProto).toString();
|
|
15
|
-
const button = css({
|
|
16
|
-
...buttonProto,
|
|
17
|
-
boxShadow: themeShadows.buttons.elevated
|
|
18
|
-
}).toString();
|
|
19
|
-
const ripple = css({
|
|
20
|
-
padding: 6
|
|
21
|
-
}).toString();
|
|
22
|
-
export default {
|
|
23
|
-
buttonFlat,
|
|
24
|
-
button,
|
|
25
|
-
ripple
|
|
26
|
-
};
|
package/Form/Checkbox/style.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const root = css({
|
|
4
|
-
marginLeft: -2,
|
|
5
|
-
// Removes margin caused by svg.
|
|
6
|
-
cursor: 'pointer',
|
|
7
|
-
'& svg': {
|
|
8
|
-
float: 'left'
|
|
9
|
-
}
|
|
10
|
-
}).toString();
|
|
11
|
-
const label = css({
|
|
12
|
-
lineHeight: 1.6
|
|
13
|
-
}).toString();
|
|
14
|
-
const labelWrapper = css({
|
|
15
|
-
marginLeft: themeConfig.variables.gap.xbig
|
|
16
|
-
}).toString();
|
|
17
|
-
const checked = css({
|
|
18
|
-
color: `var(--color-primary, ${themeConfig.colors.primary})`
|
|
19
|
-
}).toString();
|
|
20
|
-
export default {
|
|
21
|
-
root,
|
|
22
|
-
label,
|
|
23
|
-
labelWrapper,
|
|
24
|
-
checked
|
|
25
|
-
};
|
package/Form/InfoField/style.js
DELETED
package/Form/Password/style.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const container = css({
|
|
4
|
-
display: 'flex',
|
|
5
|
-
marginLeft: -1 // Removes margin of svg.
|
|
6
|
-
}).toString();
|
|
7
|
-
const icon = css({
|
|
8
|
-
width: 24,
|
|
9
|
-
height: 24,
|
|
10
|
-
flexShrink: 0
|
|
11
|
-
}).toString();
|
|
12
|
-
const disabled = css({
|
|
13
|
-
opacity: 0.25,
|
|
14
|
-
pointerEvents: 'none'
|
|
15
|
-
}).toString();
|
|
16
|
-
const label = css({
|
|
17
|
-
flex: 1,
|
|
18
|
-
fontSize: '1rem',
|
|
19
|
-
lineHeight: 1.5,
|
|
20
|
-
marginLeft: themeConfig.variables.gap.small,
|
|
21
|
-
marginBottom: themeConfig.variables.gap.small
|
|
22
|
-
}).toString();
|
|
23
|
-
const active = css({
|
|
24
|
-
color: `var(--color-primary, ${themeConfig.colors.primary})`
|
|
25
|
-
}).toString();
|
|
26
|
-
export default {
|
|
27
|
-
icon,
|
|
28
|
-
disabled,
|
|
29
|
-
container,
|
|
30
|
-
label,
|
|
31
|
-
active
|
|
32
|
-
};
|
package/Form/RadioGroup/style.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @param {string} direction flex direction
|
|
6
|
-
* @returns {*}
|
|
7
|
-
*/
|
|
8
|
-
const container = direction => css({
|
|
9
|
-
display: 'flex',
|
|
10
|
-
flexDirection: direction
|
|
11
|
-
}).toString();
|
|
12
|
-
const label = css({
|
|
13
|
-
fontSize: '0.8rem',
|
|
14
|
-
paddingBottom: themeConfig.variables.gap.small,
|
|
15
|
-
color: themeConfig.colors.shade12
|
|
16
|
-
}).toString();
|
|
17
|
-
export default {
|
|
18
|
-
container,
|
|
19
|
-
label
|
|
20
|
-
};
|
package/Form/Select/style.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
const select = css({
|
|
3
|
-
appearance: 'none',
|
|
4
|
-
position: 'relative',
|
|
5
|
-
overflow: 'hidden',
|
|
6
|
-
whiteSpace: 'nowrap',
|
|
7
|
-
textOverflow: 'ellipsis',
|
|
8
|
-
padding: '0 20px 0 0',
|
|
9
|
-
width: '100%',
|
|
10
|
-
margin: '24px 0 0 0',
|
|
11
|
-
outline: 0,
|
|
12
|
-
fontSize: 16,
|
|
13
|
-
lineHeight: '19px',
|
|
14
|
-
zIndex: 10
|
|
15
|
-
}).toString();
|
|
16
|
-
const chevron = css({
|
|
17
|
-
position: 'absolute',
|
|
18
|
-
top: '50%',
|
|
19
|
-
right: 0,
|
|
20
|
-
transform: 'translateY(-50%) rotateZ(-90deg)',
|
|
21
|
-
fontSize: '1.3em !important',
|
|
22
|
-
marginTop: -3
|
|
23
|
-
}).toString();
|
|
24
|
-
export default {
|
|
25
|
-
select,
|
|
26
|
-
chevron
|
|
27
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { css } from 'glamor';
|
|
2
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
const chevron = css({
|
|
4
|
-
position: 'absolute',
|
|
5
|
-
top: '50%',
|
|
6
|
-
right: 0,
|
|
7
|
-
transform: 'translateY(-50%) rotateZ(-90deg)',
|
|
8
|
-
fontSize: '1.3em !important',
|
|
9
|
-
marginTop: -3
|
|
10
|
-
}).toString();
|
|
11
|
-
const toggle = css({
|
|
12
|
-
fontSize: '1rem',
|
|
13
|
-
paddingRight: '2rem'
|
|
14
|
-
});
|
|
15
|
-
const itemSelected = css({
|
|
16
|
-
backgroundColor: themeConfig.colors.shade8,
|
|
17
|
-
fontWeight: 500
|
|
18
|
-
}).toString();
|
|
19
|
-
export default {
|
|
20
|
-
chevron,
|
|
21
|
-
toggle,
|
|
22
|
-
itemSelected
|
|
23
|
-
};
|