@shopgate/pwa-ui-shared 7.30.0-alpha.7 → 7.30.0-alpha.9

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.
Files changed (266) hide show
  1. package/AccordionContainer/index.js +39 -5
  2. package/AccordionContainer/spec.js +25 -2
  3. package/ActionButton/index.js +63 -7
  4. package/ActionButton/spec.js +63 -2
  5. package/ActionButton/style.js +22 -1
  6. package/AddToCartButton/index.js +184 -27
  7. package/AddToCartButton/mock.js +18 -4
  8. package/AddToCartButton/spec.js +65 -2
  9. package/AddToCartButton/style.js +127 -11
  10. package/Availability/index.js +34 -2
  11. package/Availability/spec.js +41 -1
  12. package/Availability/style.js +19 -1
  13. package/Button/index.js +76 -5
  14. package/Button/spec.js +33 -1
  15. package/Button/style.js +130 -21
  16. package/ButtonLink/connector.js +11 -2
  17. package/ButtonLink/index.js +44 -6
  18. package/ButtonLink/spec.js +23 -1
  19. package/Card/index.js +19 -2
  20. package/Card/style.js +11 -1
  21. package/CardList/components/Item/index.js +26 -2
  22. package/CardList/components/Item/style.js +7 -1
  23. package/CardList/index.js +34 -3
  24. package/CartTotalLine/components/Amount/index.js +28 -2
  25. package/CartTotalLine/components/Amount/style.js +8 -1
  26. package/CartTotalLine/components/Hint/index.js +23 -2
  27. package/CartTotalLine/components/Hint/style.js +12 -1
  28. package/CartTotalLine/components/Label/index.js +36 -2
  29. package/CartTotalLine/components/Label/style.js +17 -1
  30. package/CartTotalLine/components/Spacer/index.js +16 -2
  31. package/CartTotalLine/index.js +39 -2
  32. package/CartTotalLine/style.js +31 -1
  33. package/Checkbox/index.js +31 -2
  34. package/Checkbox/style.js +18 -1
  35. package/Chip/index.js +61 -2
  36. package/Chip/spec.js +24 -1
  37. package/Chip/style.js +71 -3
  38. package/ContextMenu/ContextMenu.hooks.js +6 -2
  39. package/ContextMenu/ContextMenuProvider.context.js +9 -3
  40. package/ContextMenu/ContextMenuProvider.js +21 -2
  41. package/ContextMenu/components/Item/index.js +67 -5
  42. package/ContextMenu/components/Item/style.js +32 -3
  43. package/ContextMenu/components/Position/index.js +61 -10
  44. package/ContextMenu/components/Position/style.js +11 -1
  45. package/ContextMenu/index.js +124 -3
  46. package/ContextMenu/spec.js +101 -2
  47. package/ContextMenu/style.js +45 -1
  48. package/Dialog/components/BasicDialog/index.js +5 -1
  49. package/Dialog/components/HtmlContentDialog/index.js +22 -2
  50. package/Dialog/components/HtmlContentDialog/spec.js +59 -1
  51. package/Dialog/components/PipelineErrorDialog/index.js +114 -25
  52. package/Dialog/components/PipelineErrorDialog/spec.js +92 -12
  53. package/Dialog/components/TextMessageDialog/index.js +28 -2
  54. package/Dialog/components/TextMessageDialog/spec.js +59 -1
  55. package/Dialog/components/VariantSelectModal/connector.js +11 -2
  56. package/Dialog/components/VariantSelectModal/index.js +65 -6
  57. package/Dialog/components/VariantSelectModal/spec.js +51 -2
  58. package/Dialog/constants.js +6 -1
  59. package/Dialog/index.js +114 -7
  60. package/Dialog/spec.js +81 -3
  61. package/DiscountBadge/index.js +30 -2
  62. package/DiscountBadge/spec.js +19 -1
  63. package/DiscountBadge/style.js +34 -2
  64. package/FavoritesButton/connector.js +18 -3
  65. package/FavoritesButton/index.js +118 -15
  66. package/FavoritesButton/mock.js +50 -4
  67. package/FavoritesButton/spec.js +120 -2
  68. package/FavoritesButton/style.js +26 -1
  69. package/Form/Builder/builders/buildCountryList.js +40 -6
  70. package/Form/Builder/builders/buildFormDefaults.js +35 -6
  71. package/Form/Builder/builders/buildFormElements.js +68 -10
  72. package/Form/Builder/builders/buildProvinceList.js +19 -2
  73. package/Form/Builder/builders/buildValidationErrorList.js +7 -2
  74. package/Form/Builder/classes/ActionListener/constants.js +22 -2
  75. package/Form/Builder/classes/ActionListener/index.js +441 -93
  76. package/Form/Builder/classes/ActionListener/spec.js +321 -19
  77. package/Form/Builder/components/CheckboxElement.js +35 -3
  78. package/Form/Builder/components/CountryElement.js +40 -3
  79. package/Form/Builder/components/ProvinceElement.js +40 -3
  80. package/Form/Builder/components/RadioElement.js +41 -3
  81. package/Form/Builder/components/SelectElement.js +39 -3
  82. package/Form/Builder/components/TextElement.js +49 -4
  83. package/Form/Builder/elementTypes.js +11 -1
  84. package/Form/Builder/index.js +298 -52
  85. package/Form/Builder/iso-3166-2.js +4943 -1
  86. package/Form/Builder/spec.js +308 -16
  87. package/Form/Checkbox/index.js +66 -4
  88. package/Form/Checkbox/style.js +25 -2
  89. package/Form/InfoField/index.js +50 -2
  90. package/Form/InfoField/spec.js +9 -1
  91. package/Form/InfoField/style.js +11 -1
  92. package/Form/Password/index.js +51 -6
  93. package/Form/Password/spec.js +34 -1
  94. package/Form/Password/style.js +11 -1
  95. package/Form/RadioGroup/components/Item/index.js +59 -3
  96. package/Form/RadioGroup/components/Item/style.js +32 -2
  97. package/Form/RadioGroup/index.js +101 -9
  98. package/Form/RadioGroup/spec.js +83 -3
  99. package/Form/RadioGroup/style.js +18 -2
  100. package/Form/Select/index.js +158 -10
  101. package/Form/Select/spec.js +36 -5
  102. package/Form/Select/style.js +27 -1
  103. package/Form/SelectContextChoices/index.js +77 -3
  104. package/Form/SelectContextChoices/spec.js +33 -4
  105. package/Form/SelectContextChoices/style.js +23 -1
  106. package/Form/TextField/index.js +92 -8
  107. package/Form/TextField/spec.js +110 -1
  108. package/Form/TextField/style.js +66 -8
  109. package/Form/index.js +54 -13
  110. package/FormElement/components/ErrorText/index.js +31 -2
  111. package/FormElement/components/ErrorText/style.js +13 -1
  112. package/FormElement/components/Label/index.js +35 -2
  113. package/FormElement/components/Label/style.js +76 -8
  114. package/FormElement/components/Placeholder/index.js +26 -2
  115. package/FormElement/components/Placeholder/style.js +48 -6
  116. package/FormElement/components/Underline/index.js +18 -2
  117. package/FormElement/components/Underline/style.js +51 -4
  118. package/FormElement/index.js +91 -6
  119. package/FormElement/spec.js +67 -2
  120. package/FormElement/style.js +13 -2
  121. package/Glow/index.js +90 -7
  122. package/Glow/spec.js +9 -1
  123. package/Glow/style.js +18 -1
  124. package/IndicatorCircle/index.js +33 -3
  125. package/IndicatorCircle/spec.js +28 -1
  126. package/IndicatorCircle/style.js +57 -3
  127. package/LoadingIndicator/index.js +29 -2
  128. package/LoadingIndicator/style.js +20 -1
  129. package/Manufacturer/index.js +20 -2
  130. package/Manufacturer/style.js +5 -1
  131. package/MessageBar/index.js +36 -2
  132. package/MessageBar/spec.js +79 -1
  133. package/MessageBar/style.js +38 -1
  134. package/NoResults/components/Icon/index.js +130 -2
  135. package/NoResults/components/Icon/style.js +17 -1
  136. package/NoResults/index.js +46 -2
  137. package/NoResults/style.js +31 -1
  138. package/Placeholder/index.js +25 -3
  139. package/Placeholder/style.js +11 -1
  140. package/PlaceholderLabel/index.js +27 -2
  141. package/PlaceholderLabel/spec.js +19 -1
  142. package/PlaceholderLabel/style.js +12 -1
  143. package/PlaceholderParagraph/index.js +36 -2
  144. package/PlaceholderParagraph/spec.js +19 -1
  145. package/Price/index.js +88 -7
  146. package/Price/style.js +22 -1
  147. package/PriceInfo/index.js +20 -2
  148. package/PriceInfo/style.js +5 -1
  149. package/PriceStriked/index.js +83 -12
  150. package/PriceStriked/style.js +33 -3
  151. package/ProductProperties/index.js +32 -2
  152. package/ProgressBar/index.js +101 -13
  153. package/ProgressBar/spec.js +13 -1
  154. package/ProgressBar/style.js +83 -2
  155. package/RadioButton/index.js +18 -2
  156. package/RadioButton/spec.js +21 -1
  157. package/RadioButton/style.js +21 -1
  158. package/RatingNumber/index.js +29 -2
  159. package/RatingStars/constants.js +2 -1
  160. package/RatingStars/index.js +130 -12
  161. package/RatingStars/spec.js +90 -3
  162. package/RatingStars/style.js +51 -2
  163. package/Ripple/components/RippleAnimation/index.js +88 -6
  164. package/Ripple/index.js +218 -40
  165. package/Ripple/style.js +18 -1
  166. package/RippleButton/index.js +52 -5
  167. package/RippleButton/spec.js +45 -1
  168. package/ScannerOverlay/components/CameraOverlay/index.js +13 -2
  169. package/ScannerOverlay/components/CameraOverlay/style.js +40 -1
  170. package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/index.js +34 -2
  171. package/ScannerOverlay/components/ScannerBar/components/FlashlightButton/style.js +28 -1
  172. package/ScannerOverlay/components/ScannerBar/components/ScannerInstructions/index.js +11 -2
  173. package/ScannerOverlay/components/ScannerBar/index.js +31 -2
  174. package/ScannerOverlay/components/ScannerBar/style.js +20 -1
  175. package/ScannerOverlay/index.js +47 -7
  176. package/Sheet/components/Header/components/SearchBar/index.js +46 -2
  177. package/Sheet/components/Header/components/SearchBar/spec.js +21 -3
  178. package/Sheet/components/Header/components/SearchBar/style.js +47 -1
  179. package/Sheet/components/Header/index.js +75 -7
  180. package/Sheet/components/Header/spec.js +14 -1
  181. package/Sheet/components/Header/style.js +50 -1
  182. package/Sheet/index.js +170 -17
  183. package/Sheet/spec.js +85 -5
  184. package/Sheet/style.js +143 -2
  185. package/TaxDisclaimer/index.js +34 -4
  186. package/TaxDisclaimer/spec.js +31 -3
  187. package/TaxDisclaimer/style.js +9 -1
  188. package/TextField/components/ErrorText/index.js +33 -2
  189. package/TextField/components/ErrorText/style.js +25 -3
  190. package/TextField/components/FormElement/index.js +19 -2
  191. package/TextField/components/FormElement/style.js +32 -4
  192. package/TextField/components/Hint/index.js +21 -2
  193. package/TextField/components/Hint/style.js +40 -5
  194. package/TextField/components/Label/index.js +32 -3
  195. package/TextField/components/Label/style.js +68 -8
  196. package/TextField/components/Underline/index.js +19 -2
  197. package/TextField/components/Underline/style.js +51 -4
  198. package/TextField/index.js +189 -27
  199. package/TextField/spec.js +128 -3
  200. package/TextField/style.js +34 -4
  201. package/ToggleIcon/index.js +58 -8
  202. package/ToggleIcon/spec.js +35 -1
  203. package/icons/AccountBoxIcon.js +11 -2
  204. package/icons/AddMoreIcon.js +11 -2
  205. package/icons/ArrowDropIcon.js +11 -2
  206. package/icons/ArrowIcon.js +21 -2
  207. package/icons/BarcodeScannerIcon.js +11 -2
  208. package/icons/BoxIcon.js +11 -2
  209. package/icons/BrowseIcon.js +11 -2
  210. package/icons/BurgerIcon.js +11 -2
  211. package/icons/CalendarIcon.js +15 -3
  212. package/icons/CartCouponIcon.js +72 -2
  213. package/icons/CartIcon.js +11 -2
  214. package/icons/CartPlusIcon.js +11 -2
  215. package/icons/CheckIcon.js +11 -2
  216. package/icons/CheckedIcon.js +11 -2
  217. package/icons/ChevronIcon.js +11 -2
  218. package/icons/CreditCardIcon.js +11 -2
  219. package/icons/CrossIcon.js +11 -2
  220. package/icons/DescriptionIcon.js +11 -2
  221. package/icons/FilterIcon.js +11 -2
  222. package/icons/FlashDisabledIcon.js +11 -2
  223. package/icons/FlashEnabledIcon.js +11 -2
  224. package/icons/GridIcon.js +11 -2
  225. package/icons/HeartIcon.js +11 -2
  226. package/icons/HeartOutlineIcon.js +11 -2
  227. package/icons/HeartPlusIcon.js +12 -2
  228. package/icons/HeartPlusOutlineIcon.js +12 -2
  229. package/icons/HomeIcon.js +11 -2
  230. package/icons/InfoIcon.js +11 -2
  231. package/icons/InfoOutlineIcon.js +11 -2
  232. package/icons/ListIcon.js +11 -2
  233. package/icons/LocalShippingIcon.js +11 -2
  234. package/icons/LocationIcon.js +13 -3
  235. package/icons/LocatorIcon.js +11 -2
  236. package/icons/LockIcon.js +11 -2
  237. package/icons/LogoutIcon.js +11 -2
  238. package/icons/MagnifierIcon.js +11 -2
  239. package/icons/MapMarkerIcon.js +24 -3
  240. package/icons/MoreIcon.js +11 -2
  241. package/icons/MoreVertIcon.js +11 -2
  242. package/icons/NotificationIcon.js +14 -3
  243. package/icons/PersonIcon.js +12 -2
  244. package/icons/PhoneIcon.js +13 -3
  245. package/icons/PlaceholderIcon.js +11 -2
  246. package/icons/RadioCheckedIcon.js +11 -2
  247. package/icons/RadioUncheckedIcon.js +11 -2
  248. package/icons/SecurityIcon.js +11 -2
  249. package/icons/ShippingMethodIcon.js +18 -3
  250. package/icons/ShoppingCartIcon.js +11 -2
  251. package/icons/SortIcon.js +11 -2
  252. package/icons/StarHalfIcon.js +18 -2
  253. package/icons/StarIcon.js +18 -2
  254. package/icons/StarOutlineIcon.js +11 -2
  255. package/icons/StopIcon.js +11 -2
  256. package/icons/TickIcon.js +11 -2
  257. package/icons/TimeIcon.js +14 -3
  258. package/icons/TrashIcon.js +11 -2
  259. package/icons/TrashOutlineIcon.js +12 -2
  260. package/icons/UncheckedIcon.js +11 -2
  261. package/icons/ViewListIcon.js +11 -2
  262. package/icons/VisibilityIcon.js +11 -2
  263. package/icons/VisibilityOffIcon.js +11 -2
  264. package/icons/WarningIcon.js +11 -2
  265. package/index.js +13 -1
  266. package/package.json +5 -5
@@ -1,4 +1,36 @@
1
- import React from'react';import PropTypes from'prop-types';import{SurroundPortals,ToggleIcon,FlashEnabledIcon,FlashDisabledIcon}from'@shopgate/engage/components';import{SCANNER_FLASH}from'@shopgate/engage/scanner/constants';import{i18n}from'@shopgate/engage/core';import styles from"./style";/**
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { SurroundPortals, ToggleIcon, FlashEnabledIcon, FlashDisabledIcon } from '@shopgate/engage/components';
4
+ import { SCANNER_FLASH } from '@shopgate/engage/scanner/constants';
5
+ import { i18n } from '@shopgate/engage/core';
6
+ import styles from "./style";
7
+
8
+ /**
2
9
  * The FlashlightButton component.
3
10
  * @returns {JSX.Element}
4
- */var FlashlightButton=function FlashlightButton(_ref){var flashlightState=_ref.flashlightState,onToggle=_ref.onToggle;return React.createElement(SurroundPortals,{portalName:SCANNER_FLASH},React.createElement("button",{className:styles.button,onClick:onToggle,role:"link",type:"button","aria-label":i18n.text(flashlightState?'scanner.flashlight.switchOff':'scanner.flashlight.switchOn')},React.createElement(ToggleIcon,{on:flashlightState,onIcon:React.createElement(FlashEnabledIcon,{className:styles.icon}),offIcon:React.createElement(FlashDisabledIcon,{className:styles.icon})})),React.createElement("div",{className:"sr-only",role:"status","aria-live":"polite"},i18n.text(flashlightState?'scanner.flashlight.on':'scanner.flashlight.off')));};export default FlashlightButton;
11
+ */
12
+ const FlashlightButton = ({
13
+ flashlightState,
14
+ onToggle
15
+ }) => /*#__PURE__*/React.createElement(SurroundPortals, {
16
+ portalName: SCANNER_FLASH
17
+ }, /*#__PURE__*/React.createElement("button", {
18
+ className: styles.button,
19
+ onClick: onToggle,
20
+ role: "link",
21
+ type: "button",
22
+ "aria-label": i18n.text(flashlightState ? 'scanner.flashlight.switchOff' : 'scanner.flashlight.switchOn')
23
+ }, /*#__PURE__*/React.createElement(ToggleIcon, {
24
+ on: flashlightState,
25
+ onIcon: /*#__PURE__*/React.createElement(FlashEnabledIcon, {
26
+ className: styles.icon
27
+ }),
28
+ offIcon: /*#__PURE__*/React.createElement(FlashDisabledIcon, {
29
+ className: styles.icon
30
+ })
31
+ })), /*#__PURE__*/React.createElement("div", {
32
+ className: "sr-only",
33
+ role: "status",
34
+ "aria-live": "polite"
35
+ }, i18n.text(flashlightState ? 'scanner.flashlight.on' : 'scanner.flashlight.off')));
36
+ export default FlashlightButton;
@@ -1 +1,28 @@
1
- import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var button=css({alignItems:'center',color:'inherit',display:'flex',flexShrink:0,fontSize:24,height:44,justifyContent:'center',outline:0,padding:0,position:'relative',width:44,zIndex:1}).toString();var iconWrapper=css({width:72}).toString();var icon=css({boxSizing:'content-box',color:"var(--color-secondary, ".concat(themeConfig.colors.accent,")")}).toString();export default{button:button,iconWrapper:iconWrapper,icon:icon};
1
+ import { css } from 'glamor';
2
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
+ const button = css({
4
+ alignItems: 'center',
5
+ color: 'inherit',
6
+ display: 'flex',
7
+ flexShrink: 0,
8
+ fontSize: 24,
9
+ height: 44,
10
+ justifyContent: 'center',
11
+ outline: 0,
12
+ padding: 0,
13
+ position: 'relative',
14
+ width: 44,
15
+ zIndex: 1
16
+ }).toString();
17
+ const iconWrapper = css({
18
+ width: 72
19
+ }).toString();
20
+ const icon = css({
21
+ boxSizing: 'content-box',
22
+ color: `var(--color-secondary, ${themeConfig.colors.accent})`
23
+ }).toString();
24
+ export default {
25
+ button,
26
+ iconWrapper,
27
+ icon
28
+ };
@@ -1,4 +1,13 @@
1
- import React from'react';import{I18n,SurroundPortals}from'@shopgate/engage/components';import{SCANNER_INSTRUCTIONS}from'@shopgate/engage/scanner/constants';/**
1
+ import React from 'react';
2
+ import { I18n, SurroundPortals } from '@shopgate/engage/components';
3
+ import { SCANNER_INSTRUCTIONS } from '@shopgate/engage/scanner/constants';
4
+ /**
2
5
  * The Scanner Instructions component.
3
6
  * @returns {JSX.Element}
4
- */var ScannerInstructions=function ScannerInstructions(){return React.createElement(SurroundPortals,{portalName:SCANNER_INSTRUCTIONS},React.createElement(I18n.Text,{string:"scanner.instructions"}));};export default ScannerInstructions;
7
+ */
8
+ const ScannerInstructions = () => /*#__PURE__*/React.createElement(SurroundPortals, {
9
+ portalName: SCANNER_INSTRUCTIONS
10
+ }, /*#__PURE__*/React.createElement(I18n.Text, {
11
+ string: "scanner.instructions"
12
+ }));
13
+ export default ScannerInstructions;
@@ -1,6 +1,35 @@
1
- import React from'react';import{createPortal}from'react-dom';import PropTypes from'prop-types';import{Grid,SurroundPortals}from'@shopgate/engage/components';import{SCANNER_BAR}from'@shopgate/engage/scanner/constants';import FlashlightButton from"./components/FlashlightButton";import ScannerInstructions from"./components/ScannerInstructions";import styles from"./style";/**
1
+ import React from 'react';
2
+ import { createPortal } from 'react-dom';
3
+ import PropTypes from 'prop-types';
4
+ import { Grid, SurroundPortals } from '@shopgate/engage/components';
5
+ import { SCANNER_BAR } from '@shopgate/engage/scanner/constants';
6
+ import FlashlightButton from "./components/FlashlightButton";
7
+ import ScannerInstructions from "./components/ScannerInstructions";
8
+ import styles from "./style";
9
+
10
+ /**
2
11
  * @param {Object} props The component props.
3
12
  * @param {boolean} props.flashlightState The on/off state of the flashlight.
4
13
  * @param {Function} props.onToggleFlashlight The toggle event triggered by the user.
5
14
  * @returns {React.ReactPortal} A React portal that renders the scanner bar in the AppFooter.
6
- */var ScannerBar=function ScannerBar(_ref){var flashlightState=_ref.flashlightState,onToggleFlashlight=_ref.onToggleFlashlight;return createPortal(React.createElement(SurroundPortals,{portalName:SCANNER_BAR,portalProps:{flashlightState:flashlightState,onToggleFlashlight:onToggleFlashlight}},React.createElement(Grid,{className:"".concat(styles.container," ui-shared__scanner-bar")},React.createElement(Grid.Item,{className:styles.column},React.createElement(FlashlightButton,{onToggle:onToggleFlashlight,flashlightState:flashlightState})),React.createElement(Grid.Item,{className:styles.column},React.createElement(ScannerInstructions,null)))),document.getElementById('AppFooter'));};export default ScannerBar;
15
+ */
16
+ const ScannerBar = ({
17
+ flashlightState,
18
+ onToggleFlashlight
19
+ }) => /*#__PURE__*/createPortal(/*#__PURE__*/React.createElement(SurroundPortals, {
20
+ portalName: SCANNER_BAR,
21
+ portalProps: {
22
+ flashlightState,
23
+ onToggleFlashlight
24
+ }
25
+ }, /*#__PURE__*/React.createElement(Grid, {
26
+ className: `${styles.container} ui-shared__scanner-bar`
27
+ }, /*#__PURE__*/React.createElement(Grid.Item, {
28
+ className: styles.column
29
+ }, /*#__PURE__*/React.createElement(FlashlightButton, {
30
+ onToggle: onToggleFlashlight,
31
+ flashlightState: flashlightState
32
+ })), /*#__PURE__*/React.createElement(Grid.Item, {
33
+ className: styles.column
34
+ }, /*#__PURE__*/React.createElement(ScannerInstructions, null)))), document.getElementById('AppFooter'));
35
+ export default ScannerBar;
@@ -1 +1,20 @@
1
- import{css}from'glamor';import{themeShadows,themeColors,themeVariables}from'@shopgate/pwa-common/helpers/config';var container=css({bottom:0,backgroundColor:themeColors.overlay,boxShadow:themeShadows.scannerBar,fontSize:14,alignItems:'center',paddingBottom:'var(--safe-area-inset-bottom)'}).toString();var column=css({margin:"".concat(themeVariables.gap.big,"px"),':not(:first-child)':{marginLeft:0}}).toString();export default{container:container,column:column};
1
+ import { css } from 'glamor';
2
+ import { themeShadows, themeColors, themeVariables } from '@shopgate/pwa-common/helpers/config';
3
+ const container = css({
4
+ bottom: 0,
5
+ backgroundColor: themeColors.overlay,
6
+ boxShadow: themeShadows.scannerBar,
7
+ fontSize: 14,
8
+ alignItems: 'center',
9
+ paddingBottom: 'var(--safe-area-inset-bottom)'
10
+ }).toString();
11
+ const column = css({
12
+ margin: `${themeVariables.gap.big}px`,
13
+ ':not(:first-child)': {
14
+ marginLeft: 0
15
+ }
16
+ }).toString();
17
+ export default {
18
+ container,
19
+ column
20
+ };
@@ -1,11 +1,51 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{Fragment,PureComponent}from'react';import PropTypes from'prop-types';import AppScanner from'@shopgate/pwa-core/classes/Scanner';import CameraOverlay from"./components/CameraOverlay";import ScannerBar from"./components/ScannerBar";/**
1
+ import React, { Fragment, PureComponent } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import AppScanner from '@shopgate/pwa-core/classes/Scanner';
4
+ import CameraOverlay from "./components/CameraOverlay";
5
+ import ScannerBar from "./components/ScannerBar";
6
+
7
+ /**
2
8
  * The scanner overlay component.
3
- */var ScannerOverlay=/*#__PURE__*/function(_PureComponent){function ScannerOverlay(props){var _this2;_classCallCheck(this,ScannerOverlay);_this2=_callSuper(this,ScannerOverlay,[props]);_defineProperty(_this2,"handleToggleFlashlight",function(){_this2.setState({flashlight:AppScanner.toggleFlashlight()});});_this2.state={flashlight:props.flashlight};return _this2;}/**
9
+ */
10
+ class ScannerOverlay extends PureComponent {
11
+ /**
12
+ * Initializes the component.
13
+ * @param {Object} props The components props.
14
+ */
15
+ constructor(props) {
16
+ super(props);
17
+ this.handleToggleFlashlight = () => {
18
+ this.setState({
19
+ flashlight: AppScanner.toggleFlashlight()
20
+ });
21
+ };
22
+ this.state = {
23
+ flashlight: props.flashlight
24
+ };
25
+ }
26
+
27
+ /**
4
28
  * @param {Object} nextProps New props to apply.
5
- */_inherits(ScannerOverlay,_PureComponent);return _createClass(ScannerOverlay,[{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(nextProps){if(this.state.flashlight!==nextProps.flashlight){this.setState({flashlight:nextProps.flashlight});}}},{key:"render",value:/**
29
+ */
30
+ UNSAFE_componentWillReceiveProps(nextProps) {
31
+ if (this.state.flashlight !== nextProps.flashlight) {
32
+ this.setState({
33
+ flashlight: nextProps.flashlight
34
+ });
35
+ }
36
+ }
37
+ /**
6
38
  * Render the camera overlay and the bottom bar with its contents.
7
39
  * @returns {JSX}
8
- */function render(){return React.createElement(Fragment,null,React.createElement(CameraOverlay,null),React.createElement(ScannerBar,{flashlightState:this.state.flashlight,onToggleFlashlight:this.handleToggleFlashlight}));}}]);}(PureComponent);_defineProperty(ScannerOverlay,"defaultProps",{flashlight:false/**
9
- * Initializes the component.
10
- * @param {Object} props The components props.
11
- */});export default ScannerOverlay;
40
+ */
41
+ render() {
42
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(CameraOverlay, null), /*#__PURE__*/React.createElement(ScannerBar, {
43
+ flashlightState: this.state.flashlight,
44
+ onToggleFlashlight: this.handleToggleFlashlight
45
+ }));
46
+ }
47
+ }
48
+ ScannerOverlay.defaultProps = {
49
+ flashlight: false
50
+ };
51
+ export default ScannerOverlay;
@@ -1,3 +1,47 @@
1
- function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useState}from'react';import PropTypes from'prop-types';import classNames from'classnames';import I18n from'@shopgate/pwa-common/components/I18n';import Input from'@shopgate/pwa-common/components/Input';import MagnifierIcon from"../../../../../icons/MagnifierIcon";import styles from"./style";/**
1
+ import React, { useState } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import classNames from 'classnames';
4
+ import I18n from '@shopgate/pwa-common/components/I18n';
5
+ import Input from '@shopgate/pwa-common/components/Input';
6
+ import MagnifierIcon from "../../../../../icons/MagnifierIcon";
7
+ import styles from "./style";
8
+
9
+ /**
2
10
  * @return {JSX}
3
- */var SearchBar=function SearchBar(_ref){var handleChange=_ref.handleChange;var _useState=useState(''),_useState2=_slicedToArray(_useState,2),query=_useState2[0],setQuery=_useState2[1];var name='search';return React.createElement("div",{className:"ui-shared__sheet__search-field","data-test-id":"SearchField"},React.createElement("div",{className:styles.container},React.createElement("div",{className:styles.inputWrapper},React.createElement("form",{onSubmit:function onSubmit(e){e.preventDefault();}},React.createElement("label",{htmlFor:name,className:styles.label},React.createElement("div",{className:styles.icon},React.createElement(MagnifierIcon,null)),!query.length&&React.createElement(I18n.Text,{string:"search.placeholder"})),React.createElement(Input,{name:name,autoComplete:false,className:classNames(styles.input),onChange:function onChange(value){handleChange(value);setQuery(value);},value:query,type:"search"})))));};export default SearchBar;
11
+ */
12
+ const SearchBar = ({
13
+ handleChange
14
+ }) => {
15
+ const [query, setQuery] = useState('');
16
+ const name = 'search';
17
+ return /*#__PURE__*/React.createElement("div", {
18
+ className: "ui-shared__sheet__search-field",
19
+ "data-test-id": "SearchField"
20
+ }, /*#__PURE__*/React.createElement("div", {
21
+ className: styles.container
22
+ }, /*#__PURE__*/React.createElement("div", {
23
+ className: styles.inputWrapper
24
+ }, /*#__PURE__*/React.createElement("form", {
25
+ onSubmit: e => {
26
+ e.preventDefault();
27
+ }
28
+ }, /*#__PURE__*/React.createElement("label", {
29
+ htmlFor: name,
30
+ className: styles.label
31
+ }, /*#__PURE__*/React.createElement("div", {
32
+ className: styles.icon
33
+ }, /*#__PURE__*/React.createElement(MagnifierIcon, null)), !query.length && /*#__PURE__*/React.createElement(I18n.Text, {
34
+ string: "search.placeholder"
35
+ })), /*#__PURE__*/React.createElement(Input, {
36
+ name: name,
37
+ autoComplete: false,
38
+ className: classNames(styles.input),
39
+ onChange: value => {
40
+ handleChange(value);
41
+ setQuery(value);
42
+ },
43
+ value: query,
44
+ type: "search"
45
+ })))));
46
+ };
47
+ export default SearchBar;
@@ -1,3 +1,21 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import React from'react';import{mount}from'enzyme';import SearchBar from"./index";describe('<SearchBar />',function(){it('should call handleChange on input',/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var handleChange,wrapper;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:handleChange=jest.fn();_context.next=3;return mount(React.createElement(SearchBar,{handleChange:handleChange}));case 3:wrapper=_context.sent;expect(wrapper).toMatchSnapshot();// Update input
2
- wrapper.find('input').first().simulate('change',{target:{name:'search',value:'asdf'}});// Should call with updated state.
3
- expect(handleChange).toHaveBeenCalledWith('asdf');case 7:case"end":return _context.stop();}},_callee);})));});
1
+ import React from 'react';
2
+ import { mount } from 'enzyme';
3
+ import SearchBar from "./index";
4
+ describe('<SearchBar />', () => {
5
+ it('should call handleChange on input', async () => {
6
+ const handleChange = jest.fn();
7
+ const wrapper = await mount(/*#__PURE__*/React.createElement(SearchBar, {
8
+ handleChange: handleChange
9
+ }));
10
+ expect(wrapper).toMatchSnapshot();
11
+ // Update input
12
+ wrapper.find('input').first().simulate('change', {
13
+ target: {
14
+ name: 'search',
15
+ value: 'asdf'
16
+ }
17
+ });
18
+ // Should call with updated state.
19
+ expect(handleChange).toHaveBeenCalledWith('asdf');
20
+ });
21
+ });
@@ -1 +1,47 @@
1
- import{css}from'glamor';import{themeColors}from'@shopgate/pwa-common/helpers/config';var container=css({display:'flex',flexDirection:'row',flexWrap:'nowrap',marginBottom:4,paddingLeft:16,paddingRight:16,paddingTop:5,paddingBottom:10}).toString();var inputWrapper=css({position:'relative',flexGrow:1}).toString();var input=css({borderRadius:10,width:'100%',padding:'4px 10px 4px 30px',lineHeight:'28px',outline:'none',background:themeColors.shade7,verticalAlign:'middle',WebkitAppearance:'none'}).toString();var label=css({alignItems:'center',color:themeColors.shade3,display:'flex',height:'36px',position:'absolute',pointerEvents:'none',width:'100%'}).toString();var icon=css({padding:'0 6px',color:themeColors.shade3,fontSize:'1.235rem'}).toString();export default{container:container,inputWrapper:inputWrapper,input:input,label:label,icon:icon};
1
+ import { css } from 'glamor';
2
+ import { themeColors } from '@shopgate/pwa-common/helpers/config';
3
+ const container = css({
4
+ display: 'flex',
5
+ flexDirection: 'row',
6
+ flexWrap: 'nowrap',
7
+ marginBottom: 4,
8
+ paddingLeft: 16,
9
+ paddingRight: 16,
10
+ paddingTop: 5,
11
+ paddingBottom: 10
12
+ }).toString();
13
+ const inputWrapper = css({
14
+ position: 'relative',
15
+ flexGrow: 1
16
+ }).toString();
17
+ const input = css({
18
+ borderRadius: 10,
19
+ width: '100%',
20
+ padding: '4px 10px 4px 30px',
21
+ lineHeight: '28px',
22
+ outline: 'none',
23
+ background: themeColors.shade7,
24
+ verticalAlign: 'middle',
25
+ WebkitAppearance: 'none'
26
+ }).toString();
27
+ const label = css({
28
+ alignItems: 'center',
29
+ color: themeColors.shade3,
30
+ display: 'flex',
31
+ height: '36px',
32
+ position: 'absolute',
33
+ pointerEvents: 'none',
34
+ width: '100%'
35
+ }).toString();
36
+ const icon = css({
37
+ padding: '0 6px',
38
+ color: themeColors.shade3,
39
+ fontSize: '1.235rem'
40
+ }).toString();
41
+ export default {
42
+ container,
43
+ inputWrapper,
44
+ input,
45
+ label,
46
+ icon
47
+ };
@@ -1,12 +1,80 @@
1
- function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import React,{Component}from'react';import PropTypes from'prop-types';import classNames from'classnames';import Grid from'@shopgate/pwa-common/components/Grid';import Ripple from"../../../Ripple";import CrossIcon from"../../../icons/CrossIcon";import styles from"./style";import SearchBar from"./components/SearchBar";/**
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { Component } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import classNames from 'classnames';
5
+ import Grid from '@shopgate/pwa-common/components/Grid';
6
+ import Ripple from "../../../Ripple";
7
+ import CrossIcon from "../../../icons/CrossIcon";
8
+ import styles from "./style";
9
+ import SearchBar from "./components/SearchBar";
10
+
11
+ /**
2
12
  * Header component.
3
- */var Header=/*#__PURE__*/function(_Component){function Header(){_classCallCheck(this,Header);return _callSuper(this,Header,arguments);}_inherits(Header,_Component);return _createClass(Header,[{key:"shouldComponentUpdate",value:/**
13
+ */
14
+ class Header extends Component {
15
+ /**
4
16
  * @param {Object} nextProps Next Props
5
17
  * @returns {boolean}
6
- */function shouldComponentUpdate(nextProps){return this.props.shadow!==nextProps.shadow||this.props.title!==nextProps.title;}/**
18
+ */
19
+ shouldComponentUpdate(nextProps) {
20
+ return this.props.shadow !== nextProps.shadow || this.props.title !== nextProps.title;
21
+ }
22
+
23
+ /**
7
24
  * Renders the component.
8
25
  * @returns {JSX}
9
- */},{key:"render",value:function render(){var allowClose=this.props.allowClose;var classes=classNames(styles.wrapper);var _this$context$i18n=this.context.i18n(),__=_this$context$i18n.__;return React.createElement("div",{className:classNames(_defineProperty({},styles.shadow,this.props.shadow))},React.createElement(Grid,{className:classes,component:"div",wrap:false},allowClose?React.createElement("button",{className:styles.closeButton,onClick:this.props.onToggleClose,"aria-label":__('common.close'),type:"button"},React.createElement(Ripple,{className:styles.closeIcon},React.createElement(CrossIcon,{size:24}))):React.createElement("div",{className:styles.closePlaceholder}),React.createElement(Grid.Item,_extends({className:styles.title,component:"div",grow:1,role:"heading"},allowClose?{tabIndex:0}:null),this.props.title)),this.props.showSearch&&React.createElement(SearchBar,{handleChange:this.props.handleChange}));}}]);}(Component);/**
10
- * The component's default props.
11
- * @type {Object}
12
- */_defineProperty(Header,"defaultProps",{onToggleClose:function onToggleClose(){},shadow:false,allowClose:true,handleChange:function handleChange(){},showSearch:false});_defineProperty(Header,"contextTypes",{i18n:PropTypes.func});export default Header;
26
+ */
27
+ render() {
28
+ const {
29
+ allowClose
30
+ } = this.props;
31
+ const classes = classNames(styles.wrapper);
32
+ const {
33
+ __
34
+ } = this.context.i18n();
35
+ return /*#__PURE__*/React.createElement("div", {
36
+ className: classNames({
37
+ [styles.shadow]: this.props.shadow
38
+ })
39
+ }, /*#__PURE__*/React.createElement(Grid, {
40
+ className: classes,
41
+ component: "div",
42
+ wrap: false
43
+ }, allowClose ? /*#__PURE__*/React.createElement("button", {
44
+ className: styles.closeButton,
45
+ onClick: this.props.onToggleClose,
46
+ "aria-label": __('common.close'),
47
+ type: "button"
48
+ }, /*#__PURE__*/React.createElement(Ripple, {
49
+ className: styles.closeIcon
50
+ }, /*#__PURE__*/React.createElement(CrossIcon, {
51
+ size: 24
52
+ }))) : /*#__PURE__*/React.createElement("div", {
53
+ className: styles.closePlaceholder
54
+ }), /*#__PURE__*/React.createElement(Grid.Item, _extends({
55
+ className: styles.title,
56
+ component: "div",
57
+ grow: 1,
58
+ role: "heading"
59
+ }, allowClose ? {
60
+ tabIndex: 0
61
+ } : null), this.props.title)), this.props.showSearch && /*#__PURE__*/React.createElement(SearchBar, {
62
+ handleChange: this.props.handleChange
63
+ }));
64
+ }
65
+ }
66
+ /**
67
+ * The component's default props.
68
+ * @type {Object}
69
+ */
70
+ Header.defaultProps = {
71
+ onToggleClose: () => {},
72
+ shadow: false,
73
+ allowClose: true,
74
+ handleChange: () => {},
75
+ showSearch: false
76
+ };
77
+ Header.contextTypes = {
78
+ i18n: PropTypes.func
79
+ };
80
+ export default Header;
@@ -1 +1,14 @@
1
- import React from'react';import{shallow}from'enzyme';import mockRenderOptions from'@shopgate/pwa-common/helpers/mocks/mockRenderOptions';import Header from"./index";describe('<Header />',function(){it('should render with correct title',function(){var title='My Title';var wrapper=shallow(React.createElement(Header,{title:title}),mockRenderOptions);expect(wrapper).toMatchSnapshot();expect(wrapper.find('GridItem').first().props().children).toEqual(title);});});
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+ import mockRenderOptions from '@shopgate/pwa-common/helpers/mocks/mockRenderOptions';
4
+ import Header from "./index";
5
+ describe('<Header />', () => {
6
+ it('should render with correct title', () => {
7
+ const title = 'My Title';
8
+ const wrapper = shallow(/*#__PURE__*/React.createElement(Header, {
9
+ title: title
10
+ }), mockRenderOptions);
11
+ expect(wrapper).toMatchSnapshot();
12
+ expect(wrapper.find('GridItem').first().props().children).toEqual(title);
13
+ });
14
+ });
@@ -1 +1,50 @@
1
- import{css}from'glamor';import{themeConfig}from'@shopgate/pwa-common/helpers/config';var wrapper=css({position:'relative',zIndex:2}).toString();var closePlaceholder=css({height:themeConfig.variables.navigator.height,padding:0,lineHeight:1});var closeButton=css({lineHeight:1,outline:0,padding:0,minWidth:themeConfig.variables.navigator.height,height:themeConfig.variables.navigator.height,position:'relative',zIndex:2,color:'var(--color-text-high-emphasis)'}).toString();var closeIcon=css({display:'flex',height:'100%',width:'100%',justifyContent:'center',alignItems:'center'}).toString();var title=css({fontSize:'1.25rem',fontWeight:500,position:'relative',alignItems:'center',padding:"0 ".concat(themeConfig.variables.gap.big,"px"),overflow:'hidden',textOverflow:'ellipsis',whiteSpace:'nowrap',alignSelf:'center'}).toString();var shadow=css({boxShadow:themeConfig.shadows.material});export default{wrapper:wrapper,closeButton:closeButton,closePlaceholder:closePlaceholder,closeIcon:closeIcon,title:title,shadow:shadow};
1
+ import { css } from 'glamor';
2
+ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
3
+ const wrapper = css({
4
+ position: 'relative',
5
+ zIndex: 2
6
+ }).toString();
7
+ const closePlaceholder = css({
8
+ height: themeConfig.variables.navigator.height,
9
+ padding: 0,
10
+ lineHeight: 1
11
+ });
12
+ const closeButton = css({
13
+ lineHeight: 1,
14
+ outline: 0,
15
+ padding: 0,
16
+ minWidth: themeConfig.variables.navigator.height,
17
+ height: themeConfig.variables.navigator.height,
18
+ position: 'relative',
19
+ zIndex: 2,
20
+ color: 'var(--color-text-high-emphasis)'
21
+ }).toString();
22
+ const closeIcon = css({
23
+ display: 'flex',
24
+ height: '100%',
25
+ width: '100%',
26
+ justifyContent: 'center',
27
+ alignItems: 'center'
28
+ }).toString();
29
+ const title = css({
30
+ fontSize: '1.25rem',
31
+ fontWeight: 500,
32
+ position: 'relative',
33
+ alignItems: 'center',
34
+ padding: `0 ${themeConfig.variables.gap.big}px`,
35
+ overflow: 'hidden',
36
+ textOverflow: 'ellipsis',
37
+ whiteSpace: 'nowrap',
38
+ alignSelf: 'center'
39
+ }).toString();
40
+ const shadow = css({
41
+ boxShadow: themeConfig.shadows.material
42
+ });
43
+ export default {
44
+ wrapper,
45
+ closeButton,
46
+ closePlaceholder,
47
+ closeIcon,
48
+ title,
49
+ shadow
50
+ };