@commercetools-frontend/experimental-components 0.0.2

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 (931) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/commercetools-frontend-experimental-components.cjs.dev.js +15285 -0
  3. package/dist/commercetools-frontend-experimental-components.cjs.js +7 -0
  4. package/dist/commercetools-frontend-experimental-components.cjs.prod.js +15276 -0
  5. package/dist/commercetools-frontend-experimental-components.esm.js +14983 -0
  6. package/package.json +88 -0
  7. package/src/actions/reference-search/cart-discount/cart-discount.ctp.graphql +29 -0
  8. package/src/actions/reference-search/cart-discount/cart-discount.js +69 -0
  9. package/src/actions/reference-search/cart-discount/cart-discount.spec.js +115 -0
  10. package/src/actions/reference-search/cart-discount/index.js +1 -0
  11. package/src/actions/reference-search/category/category.ctp.graphql +44 -0
  12. package/src/actions/reference-search/category/category.js +50 -0
  13. package/src/actions/reference-search/category/category.spec.js +82 -0
  14. package/src/actions/reference-search/category/index.js +1 -0
  15. package/src/components/attribute-definitions/reference-search/cart-discount-reference-search/cart-discount-reference-search.jsx +132 -0
  16. package/src/components/attribute-definitions/reference-search/cart-discount-reference-search/cart-discount-reference-search.spec.js +225 -0
  17. package/src/components/attribute-definitions/reference-search/cart-discount-reference-search/index.js +1 -0
  18. package/src/components/attribute-definitions/reference-search/cart-discount-reference-search/messages.js +33 -0
  19. package/src/components/attribute-definitions/reference-search/cart-discount-reference-search/option.jsx +45 -0
  20. package/src/components/attribute-definitions/reference-search/category-reference-search/category-reference-search.jsx +96 -0
  21. package/src/components/attribute-definitions/reference-search/category-reference-search/category-reference-search.spec.js +281 -0
  22. package/src/components/attribute-definitions/reference-search/category-reference-search/index.js +2 -0
  23. package/src/components/attribute-definitions/reference-search/category-reference-search/messages.js +37 -0
  24. package/src/components/attribute-definitions/reference-search/category-reference-search/option.jsx +71 -0
  25. package/src/components/attribute-definitions/reference-search/category-reference-search/use-cached-category-options.js +21 -0
  26. package/src/components/attribute-definitions/reference-search/index.js +10 -0
  27. package/src/components/attribute-definitions/reference-search/reference-search.jsx +179 -0
  28. package/src/components/attribute-definitions/reference-search/reference-search.module.css +13 -0
  29. package/src/components/business-unit-select-field/business-unit-select-field.jsx +141 -0
  30. package/src/components/business-unit-select-field/index.js +1 -0
  31. package/src/components/business-unit-select-input/business-unit-select-input.jsx +160 -0
  32. package/src/components/business-unit-select-input/business-unit-select-input.spec.js +118 -0
  33. package/src/components/business-unit-select-input/components/business-unit-async-select-input/business-unit-async-select-input.jsx +181 -0
  34. package/src/components/business-unit-select-input/components/business-unit-async-select-input/index.js +1 -0
  35. package/src/components/business-unit-select-input/components/business-unit-basic-select-input/business-unit-basic-select-input.jsx +150 -0
  36. package/src/components/business-unit-select-input/components/business-unit-basic-select-input/index.js +1 -0
  37. package/src/components/business-unit-select-input/components/business-unit-search-select-input/business-unit-search-select-input.jsx +187 -0
  38. package/src/components/business-unit-select-input/components/business-unit-search-select-input/fetch-business-units-by-where-predicate.ctp.graphql +9 -0
  39. package/src/components/business-unit-select-input/components/business-unit-search-select-input/index.js +1 -0
  40. package/src/components/business-unit-select-input/components/business-unit-search-select-input/mocks/handlers.js +16 -0
  41. package/src/components/business-unit-select-input/components/business-unit-search-select-input/mocks/index.js +3 -0
  42. package/src/components/business-unit-select-input/constants.js +2 -0
  43. package/src/components/business-unit-select-input/hooks/index.js +5 -0
  44. package/src/components/business-unit-select-input/hooks/use-business-units-by-field-fetcher/fetch-business-units-by-field.ctp.graphql +9 -0
  45. package/src/components/business-unit-select-input/hooks/use-business-units-by-field-fetcher/index.js +2 -0
  46. package/src/components/business-unit-select-input/hooks/use-business-units-by-field-fetcher/mocks/handlers.js +17 -0
  47. package/src/components/business-unit-select-input/hooks/use-business-units-by-field-fetcher/mocks/index.js +3 -0
  48. package/src/components/business-unit-select-input/hooks/use-business-units-by-field-fetcher/use-business-units-by-field-fetcher.js +35 -0
  49. package/src/components/business-unit-select-input/hooks/use-business-units-list-fetcher/fetch-business-units-list.ctp.graphql +21 -0
  50. package/src/components/business-unit-select-input/hooks/use-business-units-list-fetcher/index.js +2 -0
  51. package/src/components/business-unit-select-input/hooks/use-business-units-list-fetcher/mocks/handlers.js +17 -0
  52. package/src/components/business-unit-select-input/hooks/use-business-units-list-fetcher/mocks/index.js +3 -0
  53. package/src/components/business-unit-select-input/hooks/use-business-units-list-fetcher/use-business-units-list-fetcher.js +50 -0
  54. package/src/components/business-unit-select-input/hooks/use-total-number-of-business-units-fetcher/index.js +2 -0
  55. package/src/components/business-unit-select-input/hooks/use-total-number-of-business-units-fetcher/mocks/handlers.js +17 -0
  56. package/src/components/business-unit-select-input/hooks/use-total-number-of-business-units-fetcher/mocks/index.js +3 -0
  57. package/src/components/business-unit-select-input/hooks/use-total-number-of-business-units-fetcher/total-number-of-business-units.ctp.graphql +5 -0
  58. package/src/components/business-unit-select-input/hooks/use-total-number-of-business-units-fetcher/use-total-number-of-business-units-fetcher.js +20 -0
  59. package/src/components/business-unit-select-input/index.js +5 -0
  60. package/src/components/business-unit-select-input/messages.js +30 -0
  61. package/src/components/business-unit-select-input/utils.js +27 -0
  62. package/src/components/buttons/button/button.jsx +42 -0
  63. package/src/components/buttons/button/button.module.css +214 -0
  64. package/src/components/buttons/button/button.spec.js +84 -0
  65. package/src/components/buttons/button/index.js +1 -0
  66. package/src/components/buttons/button-close/__snapshots__/button-close.spec.js.snap +19 -0
  67. package/src/components/buttons/button-close/button-close.jsx +37 -0
  68. package/src/components/buttons/button-close/button-close.module.css +3 -0
  69. package/src/components/buttons/button-close/button-close.spec.js +68 -0
  70. package/src/components/buttons/button-close/index.js +1 -0
  71. package/src/components/buttons/button-group/button-group.jsx +62 -0
  72. package/src/components/buttons/button-group/button-group.module.css +53 -0
  73. package/src/components/buttons/button-group/button-group.spec.js +142 -0
  74. package/src/components/buttons/button-group/index.js +1 -0
  75. package/src/components/buttons/button-typed/button-typed.jsx +120 -0
  76. package/src/components/buttons/button-typed/button-typed.spec.js +95 -0
  77. package/src/components/buttons/button-typed/index.js +1 -0
  78. package/src/components/buttons/file-input/README.md +45 -0
  79. package/src/components/buttons/file-input/file-input.jsx +35 -0
  80. package/src/components/buttons/file-input/file-input.module.css +31 -0
  81. package/src/components/buttons/file-input/file-input.spec.js +115 -0
  82. package/src/components/buttons/file-input/index.js +1 -0
  83. package/src/components/buttons/file-input/messages.js +9 -0
  84. package/src/components/buttons/index.jsx +42 -0
  85. package/src/components/centered-loading-spinner/centered-loading-spinner.jsx +18 -0
  86. package/src/components/centered-loading-spinner/centered-loading-spinner.module.css +7 -0
  87. package/src/components/centered-loading-spinner/centered-loading-spinner.spec.js +13 -0
  88. package/src/components/centered-loading-spinner/index.js +2 -0
  89. package/src/components/channel-picker-input/channel-picker-input.ctp.graphql +24 -0
  90. package/src/components/channel-picker-input/channel-picker-input.jsx +210 -0
  91. package/src/components/channel-picker-input/channel-picker-input.spec.js +405 -0
  92. package/src/components/channel-picker-input/index.js +1 -0
  93. package/src/components/channel-picker-input/messages.js +14 -0
  94. package/src/components/channel-picker-input/tracking-events.js +24 -0
  95. package/src/components/country-picker/components/countries-async-select-dropdown/countries-async-select-dropdown.jsx +89 -0
  96. package/src/components/country-picker/components/countries-async-select-dropdown/index.js +1 -0
  97. package/src/components/country-picker/components/countries-basic-select-dropdown/countries-basic-select-dropdown.jsx +50 -0
  98. package/src/components/country-picker/components/countries-basic-select-dropdown/index.js +1 -0
  99. package/src/components/country-picker/constants.js +1 -0
  100. package/src/components/country-picker/country-picker.jsx +49 -0
  101. package/src/components/country-picker/index.js +1 -0
  102. package/src/components/country-picker/messages.js +20 -0
  103. package/src/components/divider/divider.jsx +21 -0
  104. package/src/components/divider/divider.module.css +25 -0
  105. package/src/components/divider/index.js +1 -0
  106. package/src/components/formatted-date-time/README.md +44 -0
  107. package/src/components/formatted-date-time/__snapshots__/formatted-date-time.spec.js.snap +19 -0
  108. package/src/components/formatted-date-time/formatted-date-time.jsx +35 -0
  109. package/src/components/formatted-date-time/formatted-date-time.spec.js +68 -0
  110. package/src/components/formatted-date-time/index.js +1 -0
  111. package/src/components/keep-display-name/index.js +1 -0
  112. package/src/components/keep-display-name/keep-display-name.js +6 -0
  113. package/src/components/messages.js +17 -0
  114. package/src/components/modal-container/__snapshots__/modal-container.spec.js.snap +21 -0
  115. package/src/components/modal-container/index.js +1 -0
  116. package/src/components/modal-container/modal-container.jsx +36 -0
  117. package/src/components/modal-container/modal-container.spec.js +10 -0
  118. package/src/components/modal-content-layout/index.js +1 -0
  119. package/src/components/modal-content-layout/modal-content-layout.jsx +38 -0
  120. package/src/components/modal-content-layout/modal-content-layout.module.css +69 -0
  121. package/src/components/modal-content-layout/modal-content-layout.spec.js +109 -0
  122. package/src/components/product-attributes/README.md +72 -0
  123. package/src/components/product-attributes/conversions.js +75 -0
  124. package/src/components/product-attributes/conversions.spec.js +97 -0
  125. package/src/components/product-attributes/index.js +3 -0
  126. package/src/components/product-attributes/product-attribute-input.jsx +68 -0
  127. package/src/components/product-attributes/product-attributes.jsx +79 -0
  128. package/src/components/product-picker-input/index.js +1 -0
  129. package/src/components/product-picker-input/messages.js +14 -0
  130. package/src/components/product-picker-input/product-picker-input.ctp.graphql +31 -0
  131. package/src/components/product-picker-input/product-picker-input.jsx +203 -0
  132. package/src/components/product-picker-input/product-picker-input.spec.js +357 -0
  133. package/src/components/product-picker-input/tracking-events.js +19 -0
  134. package/src/components/product-selection-picker/components/product-selection-async-select-dropdown/index.js +1 -0
  135. package/src/components/product-selection-picker/components/product-selection-async-select-dropdown/product-selection-async-select-dropdown.jsx +113 -0
  136. package/src/components/product-selection-picker/components/product-selection-basic-select-dropdown/index.js +1 -0
  137. package/src/components/product-selection-picker/components/product-selection-basic-select-dropdown/product-selection-basic-select-dropdown.jsx +98 -0
  138. package/src/components/product-selection-picker/components/product-selections-search-select-dropdown/index.js +1 -0
  139. package/src/components/product-selection-picker/components/product-selections-search-select-dropdown/product-selections-fetcher.ctp.graphql +13 -0
  140. package/src/components/product-selection-picker/components/product-selections-search-select-dropdown/product-selections-search-select-dropdown.jsx +121 -0
  141. package/src/components/product-selection-picker/constants.js +2 -0
  142. package/src/components/product-selection-picker/index.js +1 -0
  143. package/src/components/product-selection-picker/messages.js +20 -0
  144. package/src/components/product-selection-picker/product-selection-picker.jsx +84 -0
  145. package/src/components/product-type-picker-input/index.js +1 -0
  146. package/src/components/product-type-picker-input/messages.js +14 -0
  147. package/src/components/product-type-picker-input/product-type-picker-input.ctp.graphql +15 -0
  148. package/src/components/product-type-picker-input/product-type-picker-input.jsx +172 -0
  149. package/src/components/product-type-picker-input/product-type-picker-input.spec.js +266 -0
  150. package/src/components/product-type-picker-input/tracking-events.js +14 -0
  151. package/src/components/required-indicator/__snapshots__/required-indicator.spec.js.snap +17 -0
  152. package/src/components/required-indicator/index.js +1 -0
  153. package/src/components/required-indicator/required-indicator.jsx +16 -0
  154. package/src/components/required-indicator/required-indicator.module.css +3 -0
  155. package/src/components/required-indicator/required-indicator.spec.js +14 -0
  156. package/src/components/scroll-to-field-error/index.js +1 -0
  157. package/src/components/scroll-to-field-error/scroll-to-field-error.js +32 -0
  158. package/src/components/selectable-field-search-input/index.js +1 -0
  159. package/src/components/selectable-field-search-input/messages.js +14 -0
  160. package/src/components/selectable-field-search-input/selectable-field-search-input.jsx +147 -0
  161. package/src/components/selectable-field-search-input/selectable-field-search-input.module.css +14 -0
  162. package/src/components/selectable-field-search-input/selectable-field-search-input.spec.js +82 -0
  163. package/src/components/state-picker-input/index.js +1 -0
  164. package/src/components/state-picker-input/messages.js +14 -0
  165. package/src/components/state-picker-input/state-picker-input.ctp.graphql +24 -0
  166. package/src/components/state-picker-input/state-picker-input.jsx +204 -0
  167. package/src/components/state-picker-input/state-picker-input.spec.js +447 -0
  168. package/src/components/state-picker-input/tracking-events.js +24 -0
  169. package/src/components/store-select-field/index.js +1 -0
  170. package/src/components/store-select-field/store-select-field.jsx +145 -0
  171. package/src/components/store-select-input/components/stores-async-select-input/index.js +1 -0
  172. package/src/components/store-select-input/components/stores-async-select-input/stores-async-select-input.jsx +214 -0
  173. package/src/components/store-select-input/components/stores-basic-select-input/index.js +1 -0
  174. package/src/components/store-select-input/components/stores-basic-select-input/stores-basic-select-input.jsx +172 -0
  175. package/src/components/store-select-input/components/stores-search-select-input/fetch-stores-by-where-predicate.ctp.graphql +26 -0
  176. package/src/components/store-select-input/components/stores-search-select-input/index.js +2 -0
  177. package/src/components/store-select-input/components/stores-search-select-input/mocks/handlers.js +16 -0
  178. package/src/components/store-select-input/components/stores-search-select-input/mocks/index.js +3 -0
  179. package/src/components/store-select-input/components/stores-search-select-input/stores-search-select-input.jsx +261 -0
  180. package/src/components/store-select-input/constants.js +2 -0
  181. package/src/components/store-select-input/hooks/index.js +4 -0
  182. package/src/components/store-select-input/hooks/use-stores-by-field-fetcher/fetch-stores-by-field.ctp.graphql +22 -0
  183. package/src/components/store-select-input/hooks/use-stores-by-field-fetcher/index.js +2 -0
  184. package/src/components/store-select-input/hooks/use-stores-by-field-fetcher/mocks/handlers.js +16 -0
  185. package/src/components/store-select-input/hooks/use-stores-by-field-fetcher/mocks/index.js +3 -0
  186. package/src/components/store-select-input/hooks/use-stores-by-field-fetcher/use-stores-by-field-fetcher.js +47 -0
  187. package/src/components/store-select-input/hooks/use-total-number-of-stores-fetcher/index.js +2 -0
  188. package/src/components/store-select-input/hooks/use-total-number-of-stores-fetcher/mocks/handlers.js +16 -0
  189. package/src/components/store-select-input/hooks/use-total-number-of-stores-fetcher/mocks/index.js +3 -0
  190. package/src/components/store-select-input/hooks/use-total-number-of-stores-fetcher/total-number-of-stores.ctp.graphql +5 -0
  191. package/src/components/store-select-input/hooks/use-total-number-of-stores-fetcher/use-total-number-of-stores-fetcher.js +20 -0
  192. package/src/components/store-select-input/index.js +4 -0
  193. package/src/components/store-select-input/messages.js +36 -0
  194. package/src/components/store-select-input/store-select-input.jsx +163 -0
  195. package/src/components/store-select-input/store-select-input.spec.js +124 -0
  196. package/src/components/store-select-input/utils.js +40 -0
  197. package/src/components/tooltip/index.js +1 -0
  198. package/src/components/tooltip/tooltip.jsx +192 -0
  199. package/src/components/tooltip/tooltip.module.css +281 -0
  200. package/src/components/tooltip/tooltip.spec.js +138 -0
  201. package/src/components/validated-input/__snapshots__/validated-input.spec.js.snap +13 -0
  202. package/src/components/validated-input/index.js +2 -0
  203. package/src/components/validated-input/validated-input.jsx +318 -0
  204. package/src/components/validated-input/validated-input.module.css +9 -0
  205. package/src/components/validated-input/validated-input.spec.js +91 -0
  206. package/src/components/validation-error/README.md +87 -0
  207. package/src/components/validation-error/__snapshots__/validation-error-match.spec.js.snap +9 -0
  208. package/src/components/validation-error/__snapshots__/validation-error-switch.spec.js.snap +12 -0
  209. package/src/components/validation-error/index.js +4 -0
  210. package/src/components/validation-error/validation-error-match.js +31 -0
  211. package/src/components/validation-error/validation-error-match.spec.js +102 -0
  212. package/src/components/validation-error/validation-error-switch.js +45 -0
  213. package/src/components/validation-error/validation-error-switch.spec.js +78 -0
  214. package/src/components/with-mouse-over-state/README.md +33 -0
  215. package/src/components/with-mouse-over-state/index.js +1 -0
  216. package/src/components/with-mouse-over-state/with-mouse-over-state.jsx +32 -0
  217. package/src/components/with-mouse-over-state/with-mouse-over-state.spec.js +35 -0
  218. package/src/constants/index.js +114 -0
  219. package/src/custom-fields/custom-field-definitions-connector/README.md +90 -0
  220. package/src/custom-fields/custom-field-definitions-connector/__snapshots__/custom-field-definitions-connector.spec.js.snap +7 -0
  221. package/src/custom-fields/custom-field-definitions-connector/custom-field-definitions-connector.ctp.graphql +54 -0
  222. package/src/custom-fields/custom-field-definitions-connector/custom-field-definitions-connector.js +150 -0
  223. package/src/custom-fields/custom-field-definitions-connector/custom-field-definitions-connector.spec.js +288 -0
  224. package/src/custom-fields/custom-field-definitions-connector/index.js +3 -0
  225. package/src/custom-fields/custom-field-definitions-connector/mocks/handlers.js +16 -0
  226. package/src/custom-fields/custom-field-definitions-connector/mocks/index.js +4 -0
  227. package/src/custom-fields/custom-field-type-definitions-connector/README.md +193 -0
  228. package/src/custom-fields/custom-field-type-definitions-connector/__snapshots__/custom-field-type-definitions-connector.spec.js.snap +7 -0
  229. package/src/custom-fields/custom-field-type-definitions-connector/custom-field-type-definitions-connector.ctp.graphql +72 -0
  230. package/src/custom-fields/custom-field-type-definitions-connector/custom-field-type-definitions-connector.js +131 -0
  231. package/src/custom-fields/custom-field-type-definitions-connector/custom-field-type-definitions-connector.spec.js +82 -0
  232. package/src/custom-fields/custom-field-type-definitions-connector/index.js +1 -0
  233. package/src/custom-fields/custom-field-type-definitions-connector/utils.js +89 -0
  234. package/src/custom-fields/custom-field-type-definitions-connector/utils.spec.js +235 -0
  235. package/src/custom-fields/custom-fields/README.md +75 -0
  236. package/src/custom-fields/custom-fields/constants.js +38 -0
  237. package/src/custom-fields/custom-fields/custom-field-errors.jsx +60 -0
  238. package/src/custom-fields/custom-fields/custom-field-input.jsx +100 -0
  239. package/src/custom-fields/custom-fields/custom-field-tooltip.jsx +34 -0
  240. package/src/custom-fields/custom-fields/custom-fields-internal.jsx +148 -0
  241. package/src/custom-fields/custom-fields/custom-fields-label/cart-discounts-count.ctp.graphql +5 -0
  242. package/src/custom-fields/custom-fields/custom-fields-label/custom-fields-label.jsx +156 -0
  243. package/src/custom-fields/custom-fields/custom-fields-label/custom-fields-label.spec.js +92 -0
  244. package/src/custom-fields/custom-fields/custom-fields-label/index.js +1 -0
  245. package/src/custom-fields/custom-fields/custom-fields-label/messages.js +37 -0
  246. package/src/custom-fields/custom-fields/custom-fields.jsx +61 -0
  247. package/src/custom-fields/custom-fields/custom-nested-field-input/custom-nested-field-input.jsx +66 -0
  248. package/src/custom-fields/custom-fields/custom-nested-field-input/fetch-product-type.ctp.graphql +82 -0
  249. package/src/custom-fields/custom-fields/custom-nested-field-input/index.js +1 -0
  250. package/src/custom-fields/custom-fields/custom-nested-field-input/messages.js +9 -0
  251. package/src/custom-fields/custom-fields/custom-nested-field-input/product-type-reference.jsx +20 -0
  252. package/src/custom-fields/custom-fields/custom-nested-field-input/use-nested-product-type.js +72 -0
  253. package/src/custom-fields/custom-fields/index.js +5 -0
  254. package/src/custom-fields/custom-fields/nesting-level-context.js +5 -0
  255. package/src/custom-fields/custom-fields/set/custom-boolean-input-set.jsx +69 -0
  256. package/src/custom-fields/custom-fields/set/custom-boolean-input-set.spec.js +89 -0
  257. package/src/custom-fields/custom-fields/set/custom-input-set.jsx +233 -0
  258. package/src/custom-fields/custom-fields/set/custom-input-set.spec.js +193 -0
  259. package/src/custom-fields/custom-fields/set/expand-button.jsx +37 -0
  260. package/src/custom-fields/custom-fields/set/expand-button.spec.js +43 -0
  261. package/src/custom-fields/custom-fields/set/set-buttons.jsx +47 -0
  262. package/src/custom-fields/custom-fields/set/set-buttons.module.css +7 -0
  263. package/src/custom-fields/custom-fields/set/set-buttons.spec.js +39 -0
  264. package/src/custom-fields/custom-fields/test-utils.jsx +167 -0
  265. package/src/custom-fields/custom-fields/types/custom-boolean-input.jsx +49 -0
  266. package/src/custom-fields/custom-fields/types/custom-boolean-input.spec.js +51 -0
  267. package/src/custom-fields/custom-fields/types/custom-date-time-input.jsx +53 -0
  268. package/src/custom-fields/custom-fields/types/custom-date-time-input.spec.js +116 -0
  269. package/src/custom-fields/custom-fields/types/custom-enum-input.jsx +61 -0
  270. package/src/custom-fields/custom-fields/types/custom-enum-input.spec.js +113 -0
  271. package/src/custom-fields/custom-fields/types/custom-localized-enum-input.jsx +70 -0
  272. package/src/custom-fields/custom-fields/types/custom-localized-enum-input.spec.js +133 -0
  273. package/src/custom-fields/custom-fields/types/custom-localized-text-input.jsx +86 -0
  274. package/src/custom-fields/custom-fields/types/custom-localized-text-input.spec.js +99 -0
  275. package/src/custom-fields/custom-fields/types/custom-money-input.jsx +117 -0
  276. package/src/custom-fields/custom-fields/types/custom-money-input.module.css +3 -0
  277. package/src/custom-fields/custom-fields/types/custom-money-input.spec.js +124 -0
  278. package/src/custom-fields/custom-fields/types/custom-nested-input/custom-nested-input.jsx +331 -0
  279. package/src/custom-fields/custom-fields/types/custom-nested-input/custom-nested-input.spec.js +470 -0
  280. package/src/custom-fields/custom-fields/types/custom-nested-input/index.js +1 -0
  281. package/src/custom-fields/custom-fields/types/custom-nested-input/messages.js +82 -0
  282. package/src/custom-fields/custom-fields/types/custom-number-input.jsx +34 -0
  283. package/src/custom-fields/custom-fields/types/custom-number-input.spec.js +42 -0
  284. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-cart-discount-reference-input.jsx +44 -0
  285. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-cart-discount-reference-input.spec.js +132 -0
  286. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-category-reference-input.jsx +46 -0
  287. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-category-reference-input.spec.js +134 -0
  288. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-channel-reference-input.jsx +36 -0
  289. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-channel-reference-input.spec.js +130 -0
  290. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-product-reference-input.jsx +37 -0
  291. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-product-reference-input.spec.js +123 -0
  292. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-product-type-reference-input.jsx +36 -0
  293. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-product-type-reference-input.spec.js +146 -0
  294. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-raw-id-reference-input.jsx +32 -0
  295. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-raw-id-reference-input.spec.js +83 -0
  296. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-reference-input.jsx +78 -0
  297. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-state-reference-input.jsx +36 -0
  298. package/src/custom-fields/custom-fields/types/custom-reference-input/custom-state-reference-input.spec.js +130 -0
  299. package/src/custom-fields/custom-fields/types/custom-reference-input/index.js +1 -0
  300. package/src/custom-fields/custom-fields/types/custom-text-input.jsx +46 -0
  301. package/src/custom-fields/custom-fields/types/custom-text-input.spec.js +66 -0
  302. package/src/custom-fields/custom-fields/types/custom-time-input.jsx +74 -0
  303. package/src/custom-fields/custom-fields/types/custom-time-input.spec.js +91 -0
  304. package/src/custom-fields/custom-fields/utils/index.js +1 -0
  305. package/src/custom-fields/custom-fields/utils/utils.js +22 -0
  306. package/src/custom-fields/custom-fields/validations/index.js +1 -0
  307. package/src/custom-fields/custom-fields/validations/validations.js +117 -0
  308. package/src/custom-fields/custom-fields/validations/validations.spec.js +134 -0
  309. package/src/custom-fields/custom-fields-error-text-notification/custom-fields-error-text-notification.jsx +29 -0
  310. package/src/custom-fields/custom-fields-error-text-notification/custom-fields-error-text-notification.spec.js +31 -0
  311. package/src/custom-fields/custom-fields-error-text-notification/index.js +1 -0
  312. package/src/custom-fields/custom-fields-error-text-notification/messages.js +10 -0
  313. package/src/custom-fields/messages/custom-fields.js +17 -0
  314. package/src/features/picker/index.js +11 -0
  315. package/src/features/picker/shared/components/index.js +1 -0
  316. package/src/features/picker/shared/components/messages.js +9 -0
  317. package/src/features/picker/shared/components/option.jsx +51 -0
  318. package/src/features/picker/shared/hooks/use-current-option.js +24 -0
  319. package/src/features/picker/shared/hooks/use-current-option.spec.js +125 -0
  320. package/src/features/picker/shared/hooks/use-handlers.js +42 -0
  321. package/src/features/picker/shared/hooks/use-load-options.js +63 -0
  322. package/src/features/picker/shared/hooks/use-load-options.spec.js +63 -0
  323. package/src/features/picker/shared/hooks/use-product-type-options.js +190 -0
  324. package/src/features/picker/shared/hooks/use-product-type-options.spec.js +151 -0
  325. package/src/features/pim-indexer/components/index.js +5 -0
  326. package/src/features/pim-indexer/components/pim-indexer-context/index.js +1 -0
  327. package/src/features/pim-indexer/components/pim-indexer-context/pim-indexer-context.js +28 -0
  328. package/src/features/pim-indexer/components/pim-indexer-provider/fetch-indices-exist.pim-indexer.graphql +12 -0
  329. package/src/features/pim-indexer/components/pim-indexer-provider/fetch-pim-index-status.js +42 -0
  330. package/src/features/pim-indexer/components/pim-indexer-provider/fetch-pim-index-status.spec.js +128 -0
  331. package/src/features/pim-indexer/components/pim-indexer-provider/index.js +1 -0
  332. package/src/features/pim-indexer/components/pim-indexer-provider/messages.js +17 -0
  333. package/src/features/pim-indexer/components/pim-indexer-provider/pim-indexer-provider.jsx +287 -0
  334. package/src/features/pim-indexer/components/pim-indexer-provider/pim-indexer-provider.spec.js +80 -0
  335. package/src/features/pim-indexer/components/pim-indexer-provider/pim-indexer.pim-indexer.graphql +55 -0
  336. package/src/features/pim-indexer/components/with-pim-indexer/index.js +1 -0
  337. package/src/features/pim-indexer/components/with-pim-indexer/with-pim-indexer.jsx +19 -0
  338. package/src/features/pim-indexer/hocs/index.js +2 -0
  339. package/src/features/pim-indexer/hocs/inject-pim-indexer/index.js +1 -0
  340. package/src/features/pim-indexer/hocs/inject-pim-indexer/inject-pim-indexer.jsx +23 -0
  341. package/src/features/pim-indexer/hocs/inject-pim-indexer/inject-pim-indexer.spec.js +37 -0
  342. package/src/features/pim-indexer/hooks/index.js +2 -0
  343. package/src/features/pim-indexer/hooks/use-pim-indexer/index.js +1 -0
  344. package/src/features/pim-indexer/hooks/use-pim-indexer/use-pim-indexer.js +6 -0
  345. package/src/features/pim-indexer/index.js +6 -0
  346. package/src/features/platform-limits/assets/graphic-limits-reached.react.svg +50 -0
  347. package/src/features/platform-limits/customer-groups/components/index.js +5 -0
  348. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-combined/index.js +1 -0
  349. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-combined/platform-limits-customer-groups-combined.jsx +32 -0
  350. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-combined/platform-limits-customer-groups-combined.module.css +3 -0
  351. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-error-modal/index.js +1 -0
  352. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-error-modal/messages.js +15 -0
  353. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-error-modal/platform-limits-customer-groups-error-modal.jsx +43 -0
  354. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-notification/index.js +1 -0
  355. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-notification/platform-limits-customer-groups-notification.jsx +42 -0
  356. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-notification/platform-limits-customer-groups-notification.spec.js +51 -0
  357. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-status/index.js +1 -0
  358. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-status/messages.js +9 -0
  359. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-status/platform-limits-customer-groups-status.jsx +37 -0
  360. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-status/platform-limits-customer-groups-status.module.css +3 -0
  361. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-tooltip/index.js +1 -0
  362. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-tooltip/messages.js +9 -0
  363. package/src/features/platform-limits/customer-groups/components/platform-limits-customer-groups-tooltip/platform-limits-customer-groups-tooltip.jsx +18 -0
  364. package/src/features/platform-limits/customer-groups/hocs/index.js +2 -0
  365. package/src/features/platform-limits/customer-groups/hocs/inject-customer-groups-platform-limits/index.js +1 -0
  366. package/src/features/platform-limits/customer-groups/hocs/inject-customer-groups-platform-limits/inject-customer-groups-platform-limits.jsx +23 -0
  367. package/src/features/platform-limits/customer-groups/hooks/index.js +4 -0
  368. package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits/index.js +1 -0
  369. package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits/use-customer-groups-platform-limits.js +40 -0
  370. package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-fetcher/index.js +1 -0
  371. package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-fetcher/use-customer-groups-platform-limits-fetcher.js +18 -0
  372. package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-fetcher/use-customer-groups-platform-limits-fetcher.spec.js +45 -0
  373. package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-modal-state/index.js +1 -0
  374. package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-modal-state/use-customer-groups-platform-limits-modal-state.js +21 -0
  375. package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-modal-state/use-customer-groups-platform-limits-modal-state.spec.js +39 -0
  376. package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-status/index.js +1 -0
  377. package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-status/use-customer-groups-platform-limits-status.js +35 -0
  378. package/src/features/platform-limits/customer-groups/hooks/use-customer-groups-platform-limits-status/use-customer-groups-platform-limits-status.spec.js +66 -0
  379. package/src/features/platform-limits/customer-groups/index.js +3 -0
  380. package/src/features/platform-limits/customers/components/index.js +5 -0
  381. package/src/features/platform-limits/customers/components/platform-limits-customers-combined/index.js +1 -0
  382. package/src/features/platform-limits/customers/components/platform-limits-customers-combined/platform-limits-customers-combined.jsx +28 -0
  383. package/src/features/platform-limits/customers/components/platform-limits-customers-combined/platform-limits-customers-combined.module.css +3 -0
  384. package/src/features/platform-limits/customers/components/platform-limits-customers-error-modal/index.js +1 -0
  385. package/src/features/platform-limits/customers/components/platform-limits-customers-error-modal/messages.js +14 -0
  386. package/src/features/platform-limits/customers/components/platform-limits-customers-error-modal/platform-limits-customers-error-modal.jsx +43 -0
  387. package/src/features/platform-limits/customers/components/platform-limits-customers-notification/index.js +1 -0
  388. package/src/features/platform-limits/customers/components/platform-limits-customers-notification/platform-limits-customers-notification.jsx +40 -0
  389. package/src/features/platform-limits/customers/components/platform-limits-customers-notification/platform-limits-customers-notification.spec.js +51 -0
  390. package/src/features/platform-limits/customers/components/platform-limits-customers-status/index.js +1 -0
  391. package/src/features/platform-limits/customers/components/platform-limits-customers-status/messages.js +9 -0
  392. package/src/features/platform-limits/customers/components/platform-limits-customers-status/platform-limits-customers-status.jsx +36 -0
  393. package/src/features/platform-limits/customers/components/platform-limits-customers-status/platform-limits-customers-status.module.css +3 -0
  394. package/src/features/platform-limits/customers/components/platform-limits-customers-tooltip/index.js +1 -0
  395. package/src/features/platform-limits/customers/components/platform-limits-customers-tooltip/messages.js +9 -0
  396. package/src/features/platform-limits/customers/components/platform-limits-customers-tooltip/platform-limits-customers-tooltip.jsx +17 -0
  397. package/src/features/platform-limits/customers/hocs/index.js +2 -0
  398. package/src/features/platform-limits/customers/hocs/inject-customers-platform-limits/index.js +1 -0
  399. package/src/features/platform-limits/customers/hocs/inject-customers-platform-limits/inject-customers-platform-limits.jsx +23 -0
  400. package/src/features/platform-limits/customers/hooks/index.js +4 -0
  401. package/src/features/platform-limits/customers/hooks/use-customers-platform-limits/index.js +1 -0
  402. package/src/features/platform-limits/customers/hooks/use-customers-platform-limits/use-customers-platform-limits.js +38 -0
  403. package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-fetcher/index.js +1 -0
  404. package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-fetcher/use-customers-platform-limits-fetcher.js +18 -0
  405. package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-fetcher/use-customers-platform-limits-fetcher.spec.js +43 -0
  406. package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-modal-state/index.js +1 -0
  407. package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-modal-state/use-customers-platform-limits-modal-state.js +20 -0
  408. package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-modal-state/use-customers-platform-limits-modal-state.spec.js +39 -0
  409. package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-status/index.js +1 -0
  410. package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-status/use-customers-platform-limits-status.js +35 -0
  411. package/src/features/platform-limits/customers/hooks/use-customers-platform-limits-status/use-customers-platform-limits-status.spec.js +61 -0
  412. package/src/features/platform-limits/customers/index.js +3 -0
  413. package/src/features/platform-limits/index.js +21 -0
  414. package/src/features/platform-limits/shared/components/index.js +2 -0
  415. package/src/features/platform-limits/shared/components/notifications/error/error.jsx +33 -0
  416. package/src/features/platform-limits/shared/components/notifications/error/index.js +1 -0
  417. package/src/features/platform-limits/shared/components/notifications/error/messages.js +34 -0
  418. package/src/features/platform-limits/shared/components/notifications/index.js +1 -0
  419. package/src/features/platform-limits/shared/components/notifications/notifications.js +9 -0
  420. package/src/features/platform-limits/shared/components/notifications/warning/index.js +1 -0
  421. package/src/features/platform-limits/shared/components/notifications/warning/messages.js +34 -0
  422. package/src/features/platform-limits/shared/components/notifications/warning/warning.jsx +41 -0
  423. package/src/features/platform-limits/shared/components/status-text/index.js +1 -0
  424. package/src/features/platform-limits/shared/components/status-text/status-text.jsx +19 -0
  425. package/src/features/platform-limits/shared/constants.js +16 -0
  426. package/src/features/platform-limits/shared/hooks/index.js +5 -0
  427. package/src/features/platform-limits/shared/hooks/use-intercept-navigation/index.js +1 -0
  428. package/src/features/platform-limits/shared/hooks/use-intercept-navigation/use-intercept-navigation.js +31 -0
  429. package/src/features/platform-limits/shared/hooks/use-intercept-navigation/use-intercept-navigation.spec.js +76 -0
  430. package/src/features/platform-limits/shared/hooks/use-limits-modal-state/index.js +1 -0
  431. package/src/features/platform-limits/shared/hooks/use-limits-modal-state/use-limits-modal-state.js +17 -0
  432. package/src/features/platform-limits/shared/hooks/use-limits-modal-state/use-limits-modal-state.spec.js +33 -0
  433. package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/__mocks__/index.js +405 -0
  434. package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/index.js +1 -0
  435. package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/mocks/handlers.js +16 -0
  436. package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/mocks/index.js +4 -0
  437. package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/platform-limits-query-variables.js +18 -0
  438. package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/use-platform-limits-fetcher.ctp.graphql +87 -0
  439. package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/use-platform-limits-fetcher.js +30 -0
  440. package/src/features/platform-limits/shared/hooks/use-platform-limits-fetcher/use-platform-limits-fetcher.spec.js +202 -0
  441. package/src/features/platform-limits/shared/index.js +15 -0
  442. package/src/features/platform-limits/shared/utils/index.js +5 -0
  443. package/src/features/platform-limits/shared/utils/utils.js +17 -0
  444. package/src/features/platform-limits/shared/utils/utils.spec.js +126 -0
  445. package/src/features/platform-limits/shipping-methods/components/index.js +3 -0
  446. package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-notification/index.js +1 -0
  447. package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-notification/platform-limits-shipping-methods-notification.jsx +42 -0
  448. package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-notification/platform-limits-shipping-methods-notification.spec.js +51 -0
  449. package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-status/index.js +1 -0
  450. package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-status/messages.js +9 -0
  451. package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-status/platform-limits-shipping-methods-status.jsx +29 -0
  452. package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-status/platform-limits-shipping-methods-status.spec.js +37 -0
  453. package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-tooltip/index.js +1 -0
  454. package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-tooltip/messages.js +10 -0
  455. package/src/features/platform-limits/shipping-methods/components/platform-limits-shipping-methods-tooltip/platform-limits-shipping-methods-tooltip.jsx +18 -0
  456. package/src/features/platform-limits/shipping-methods/hocs/index.js +2 -0
  457. package/src/features/platform-limits/shipping-methods/hocs/inject-shipping-methods-platform-limits/index.js +1 -0
  458. package/src/features/platform-limits/shipping-methods/hocs/inject-shipping-methods-platform-limits/inject-shipping-methods-platform-limits.jsx +23 -0
  459. package/src/features/platform-limits/shipping-methods/hooks/index.js +3 -0
  460. package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits/index.js +1 -0
  461. package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits/use-shipping-methods-platform-limits.js +30 -0
  462. package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-fetcher/index.js +1 -0
  463. package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-fetcher/use-shipping-methods-platform-limits-fetcher.js +18 -0
  464. package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-fetcher/use-shipping-methods-platform-limits-fetcher.spec.js +46 -0
  465. package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-status/index.js +1 -0
  466. package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-status/use-shipping-methods-platform-limits-status.js +35 -0
  467. package/src/features/platform-limits/shipping-methods/hooks/use-shipping-methods-platform-limits-status/use-shipping-methods-platform-limits-status.spec.js +67 -0
  468. package/src/features/platform-limits/shipping-methods/index.js +3 -0
  469. package/src/features/platform-limits/stores/hooks/index.js +3 -0
  470. package/src/features/platform-limits/stores/hooks/use-store-platform-limits/index.js +1 -0
  471. package/src/features/platform-limits/stores/hooks/use-store-platform-limits/use-store-platform-limits.js +19 -0
  472. package/src/features/platform-limits/stores/hooks/use-store-platform-limits-fetcher/index.js +1 -0
  473. package/src/features/platform-limits/stores/hooks/use-store-platform-limits-fetcher/use-store-platform-limits-fetcher.js +28 -0
  474. package/src/features/platform-limits/stores/hooks/use-store-platform-limits-fetcher/use-store-platform-limits-fetcher.spec.js +51 -0
  475. package/src/features/platform-limits/stores/hooks/use-store-platform-limits-status/index.js +1 -0
  476. package/src/features/platform-limits/stores/hooks/use-store-platform-limits-status/use-store-platform-limits-status.js +35 -0
  477. package/src/features/platform-limits/stores/hooks/use-store-platform-limits-status/use-store-platform-limits-status.spec.js +61 -0
  478. package/src/features/platform-limits/stores/index.js +1 -0
  479. package/src/features/platform-limits/tax-categories/components/index.js +3 -0
  480. package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-notification/index.js +1 -0
  481. package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-notification/platform-limits-tax-categories-notification.jsx +42 -0
  482. package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-notification/platform-limits-tax-categories-notification.spec.js +51 -0
  483. package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-status/index.js +1 -0
  484. package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-status/messages.js +9 -0
  485. package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-status/platform-limits-tax-categories-status.jsx +29 -0
  486. package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-status/platform-limits-tax-categories-status.spec.js +37 -0
  487. package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-tooltip/index.js +1 -0
  488. package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-tooltip/messages.js +9 -0
  489. package/src/features/platform-limits/tax-categories/components/platform-limits-tax-categories-tooltip/platform-limits-tax-categories-tooltip.jsx +18 -0
  490. package/src/features/platform-limits/tax-categories/hocs/index.js +2 -0
  491. package/src/features/platform-limits/tax-categories/hocs/inject-tax-categories-platform-limits/index.js +1 -0
  492. package/src/features/platform-limits/tax-categories/hocs/inject-tax-categories-platform-limits/inject-tax-categories-platform-limits.jsx +23 -0
  493. package/src/features/platform-limits/tax-categories/hooks/index.js +3 -0
  494. package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits/index.js +1 -0
  495. package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits/use-tax-categories-platform-limits.js +30 -0
  496. package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-fetcher/index.js +1 -0
  497. package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-fetcher/use-tax-categories-platform-limits-fetcher.js +18 -0
  498. package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-fetcher/use-tax-categories-platform-limits-fetcher.spec.js +48 -0
  499. package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-status/index.js +1 -0
  500. package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-status/use-tax-categories-platform-limits-status.js +35 -0
  501. package/src/features/platform-limits/tax-categories/hooks/use-tax-categories-platform-limits-status/use-tax-categories-platform-limits-status.spec.js +66 -0
  502. package/src/features/platform-limits/tax-categories/index.js +3 -0
  503. package/src/features/platform-limits/test-utils/index.js +1 -0
  504. package/src/features/platform-limits/zones/components/index.js +3 -0
  505. package/src/features/platform-limits/zones/components/platform-limits-zones-notification/index.js +1 -0
  506. package/src/features/platform-limits/zones/components/platform-limits-zones-notification/platform-limits-zones-notification.jsx +40 -0
  507. package/src/features/platform-limits/zones/components/platform-limits-zones-notification/platform-limits-zones-notification.spec.js +51 -0
  508. package/src/features/platform-limits/zones/components/platform-limits-zones-status/index.js +1 -0
  509. package/src/features/platform-limits/zones/components/platform-limits-zones-status/messages.js +9 -0
  510. package/src/features/platform-limits/zones/components/platform-limits-zones-status/platform-limits-zones-status.jsx +32 -0
  511. package/src/features/platform-limits/zones/components/platform-limits-zones-status/platform-limits-zones-status.spec.js +37 -0
  512. package/src/features/platform-limits/zones/components/platform-limits-zones-tooltip/index.js +1 -0
  513. package/src/features/platform-limits/zones/components/platform-limits-zones-tooltip/messages.js +9 -0
  514. package/src/features/platform-limits/zones/components/platform-limits-zones-tooltip/platform-limits-zones-tooltip.jsx +17 -0
  515. package/src/features/platform-limits/zones/hocs/index.js +2 -0
  516. package/src/features/platform-limits/zones/hocs/inject-zones-platform-limits/index.js +1 -0
  517. package/src/features/platform-limits/zones/hocs/inject-zones-platform-limits/inject-zones-platform-limits.jsx +23 -0
  518. package/src/features/platform-limits/zones/hooks/index.js +3 -0
  519. package/src/features/platform-limits/zones/hooks/use-zones-platform-limits/index.js +1 -0
  520. package/src/features/platform-limits/zones/hooks/use-zones-platform-limits/use-zones-platform-limits.js +24 -0
  521. package/src/features/platform-limits/zones/hooks/use-zones-platform-limits-fetcher/index.js +1 -0
  522. package/src/features/platform-limits/zones/hooks/use-zones-platform-limits-fetcher/use-zones-platform-limits-fetcher.js +18 -0
  523. package/src/features/platform-limits/zones/hooks/use-zones-platform-limits-fetcher/use-zones-platform-limits-fetcher.spec.js +42 -0
  524. package/src/features/platform-limits/zones/hooks/use-zones-platform-limits-status/index.js +1 -0
  525. package/src/features/platform-limits/zones/hooks/use-zones-platform-limits-status/use-zones-platform-limits-status.js +35 -0
  526. package/src/features/platform-limits/zones/hooks/use-zones-platform-limits-status/use-zones-platform-limits-status.spec.js +61 -0
  527. package/src/features/platform-limits/zones/index.js +2 -0
  528. package/src/fields/attribute-reference-label/attribute-reference-label.jsx +38 -0
  529. package/src/fields/attribute-reference-label/attribute-reference-label.module.css +7 -0
  530. package/src/fields/attribute-reference-label/index.js +1 -0
  531. package/src/fields/autocomplete/README.md +66 -0
  532. package/src/fields/autocomplete/autocomplete.jsx +129 -0
  533. package/src/fields/autocomplete/autocomplete.module.css +3 -0
  534. package/src/fields/autocomplete/autocomplete.spec.js +144 -0
  535. package/src/fields/autocomplete/dropdown-indicator.jsx +14 -0
  536. package/src/fields/autocomplete/dropdown-indicator.module.css +5 -0
  537. package/src/fields/autocomplete/index.js +1 -0
  538. package/src/fields/boolean-field/boolean-field.jsx +82 -0
  539. package/src/fields/boolean-field/boolean-field.spec.js +80 -0
  540. package/src/fields/boolean-field/index.js +3 -0
  541. package/src/fields/boolean-field/messages.js +14 -0
  542. package/src/fields/checkbox-field/checkbox-field.jsx +50 -0
  543. package/src/fields/checkbox-field/checkbox-field.module.css +40 -0
  544. package/src/fields/checkbox-field/checkbox-field.spec.js +67 -0
  545. package/src/fields/checkbox-field/index.js +1 -0
  546. package/src/fields/checkbox-field/radio-check-icons.png +0 -0
  547. package/src/fields/expandable-field/expandable-field.jsx +93 -0
  548. package/src/fields/expandable-field/expandable-field.module.css +3 -0
  549. package/src/fields/expandable-field/expandable-field.spec.js +68 -0
  550. package/src/fields/expandable-field/index.js +1 -0
  551. package/src/fields/expandable-field/messages.js +14 -0
  552. package/src/fields/label-range/index.js +1 -0
  553. package/src/fields/label-range/label-range.jsx +28 -0
  554. package/src/fields/label-range/label-range.module.css +4 -0
  555. package/src/fields/label-range/label-range.spec.js +28 -0
  556. package/src/fields/label-required/index.js +2 -0
  557. package/src/fields/label-required/label-required.jsx +25 -0
  558. package/src/fields/localized-field/index.js +1 -0
  559. package/src/fields/localized-field/localized-field.jsx +320 -0
  560. package/src/fields/localized-field/localized-field.module.css +291 -0
  561. package/src/fields/localized-field/localized-field.spec.js +53 -0
  562. package/src/fields/localized-input/index.js +1 -0
  563. package/src/fields/localized-input/localized-input.jsx +20 -0
  564. package/src/fields/localized-textarea/index.js +1 -0
  565. package/src/fields/localized-textarea/localized-textarea.jsx +50 -0
  566. package/src/fields/missing-value-field/__snapshots__/missing-value-field.spec.js.snap +22 -0
  567. package/src/fields/missing-value-field/index.js +2 -0
  568. package/src/fields/missing-value-field/messages.js +9 -0
  569. package/src/fields/missing-value-field/missing-value-field.jsx +28 -0
  570. package/src/fields/missing-value-field/missing-value-field.spec.js +35 -0
  571. package/src/fields/multi-value-search-input/index.js +1 -0
  572. package/src/fields/multi-value-search-input/messages.js +14 -0
  573. package/src/fields/multi-value-search-input/multi-value-search-input.jsx +175 -0
  574. package/src/fields/multi-value-search-input/multi-value-search-input.module.css +45 -0
  575. package/src/fields/numeric-format-input/index.js +1 -0
  576. package/src/fields/numeric-format-input/numeric-format-input.jsx +184 -0
  577. package/src/fields/numeric-format-input/numeric-format-input.module.css +10 -0
  578. package/src/fields/numeric-format-input/numeric-format-input.spec.js +323 -0
  579. package/src/fields/search-input/index.js +1 -0
  580. package/src/fields/search-input/messages.js +14 -0
  581. package/src/fields/search-input/search-input.jsx +202 -0
  582. package/src/fields/search-input/search-input.module.css +75 -0
  583. package/src/fields/search-input/search-input.spec.js +116 -0
  584. package/src/fields/throttled-field/index.js +1 -0
  585. package/src/fields/throttled-field/throttled-field.jsx +189 -0
  586. package/src/fields/throttled-field/throttled-field.module.css +75 -0
  587. package/src/fields/throttled-field/throttled-field.spec.js +172 -0
  588. package/src/hocs/index.js +9 -0
  589. package/src/hocs/inject-data-table-pagination-state/index.js +1 -0
  590. package/src/hocs/inject-data-table-pagination-state/inject-data-table-pagination-state.jsx +41 -0
  591. package/src/hocs/inject-modal-state/index.js +1 -0
  592. package/src/hocs/inject-modal-state/inject-modal-state.jsx +31 -0
  593. package/src/hocs/inject-modal-state/inject-modal-state.spec.js +60 -0
  594. package/src/hocs/inject-notifications/README.md +43 -0
  595. package/src/hocs/inject-notifications/index.js +1 -0
  596. package/src/hocs/inject-notifications/inject-notifications.jsx +35 -0
  597. package/src/hocs/inject-notifications/inject-notifications.spec.js +55 -0
  598. package/src/hocs/inject-storage/index.js +1 -0
  599. package/src/hocs/inject-storage/inject-storage.jsx +45 -0
  600. package/src/hocs/inject-storage/inject-storage.spec.js +32 -0
  601. package/src/hocs/inject-toggle-state/index.js +1 -0
  602. package/src/hocs/inject-toggle-state/inject-toggle-state.jsx +31 -0
  603. package/src/hocs/inject-toggle-state/inject-toggle-state.spec.js +58 -0
  604. package/src/hocs/utils/get-display-name/get-display-name.js +13 -0
  605. package/src/hocs/utils/get-display-name/get-display-name.spec.js +52 -0
  606. package/src/hocs/utils/get-display-name/index.js +1 -0
  607. package/src/hocs/utils/index.js +2 -0
  608. package/src/hocs/utils/set-display-name/index.js +1 -0
  609. package/src/hocs/utils/set-display-name/set-display-name.js +8 -0
  610. package/src/hocs/utils/set-display-name/set-display-name.spec.js +9 -0
  611. package/src/hocs/with-props/index.js +1 -0
  612. package/src/hocs/with-props/with-props.jsx +21 -0
  613. package/src/hocs/with-props/with-props.spec.js +57 -0
  614. package/src/hocs/with-redirect-to/index.js +1 -0
  615. package/src/hocs/with-redirect-to/with-redirect-to.jsx +42 -0
  616. package/src/hocs/with-redirect-to/with-redirect-to.spec.js +77 -0
  617. package/src/hocs/wrap-display-name/index.js +1 -0
  618. package/src/hocs/wrap-display-name/wrap-display-name.js +6 -0
  619. package/src/hocs/wrap-display-name/wrap-display-name.spec.js +26 -0
  620. package/src/hooks/index.js +37 -0
  621. package/src/hooks/use-debounced-promise-callback.js +8 -0
  622. package/src/hooks/use-did-form-validation-fail/index.js +1 -0
  623. package/src/hooks/use-did-form-validation-fail/use-did-form-validation-fail.js +30 -0
  624. package/src/hooks/use-did-form-validation-fail/use-did-form-validation-fail.spec.js +48 -0
  625. package/src/hooks/use-event-callback/index.js +1 -0
  626. package/src/hooks/use-event-callback/use-event-callback.js +18 -0
  627. package/src/hooks/use-format-localized-field-to-string/index.js +1 -0
  628. package/src/hooks/use-format-localized-field-to-string/use-format-localized-field-to-string.js +43 -0
  629. package/src/hooks/use-format-localized-field-to-string/use-format-localized-field-to-string.spec.js +36 -0
  630. package/src/hooks/use-is-sso-user/index.js +1 -0
  631. package/src/hooks/use-is-sso-user/use-is-sso-user.js +13 -0
  632. package/src/hooks/use-is-sso-user/use-is-sso-user.spec.js +46 -0
  633. package/src/hooks/use-localized-key-fallback/index.js +1 -0
  634. package/src/hooks/use-localized-key-fallback/messages.js +9 -0
  635. package/src/hooks/use-localized-key-fallback/use-localized-key-fallback.js +31 -0
  636. package/src/hooks/use-localized-key-fallback/use-localized-key-fallback.spec.js +44 -0
  637. package/src/hooks/use-pending-requests/index.js +1 -0
  638. package/src/hooks/use-pending-requests/use-pending-requests.js +39 -0
  639. package/src/hooks/use-pending-requests/use-pending-requests.spec.js +10 -0
  640. package/src/hooks/use-persisted-reminder/index.js +1 -0
  641. package/src/hooks/use-persisted-reminder/use-persisted-reminder.js +88 -0
  642. package/src/hooks/use-persisted-reminder/use-persisted-reminder.spec.js +114 -0
  643. package/src/hooks/use-persisted-table-configuration/index.js +1 -0
  644. package/src/hooks/use-persisted-table-configuration/use-persisted-table-configuration.js +136 -0
  645. package/src/hooks/use-persisted-table-configuration/use-persisted-table-configuration.spec.js +170 -0
  646. package/src/hooks/use-previous/index.js +1 -0
  647. package/src/hooks/use-previous/use-previous.js +12 -0
  648. package/src/hooks/use-previous/use-previous.spec.js +25 -0
  649. package/src/hooks/use-product-selections-fetcher/conversions.js +15 -0
  650. package/src/hooks/use-product-selections-fetcher/fetch-product-selections.ctp.graphql +18 -0
  651. package/src/hooks/use-product-selections-fetcher/index.js +2 -0
  652. package/src/hooks/use-product-selections-fetcher/mocks/handlers.js +16 -0
  653. package/src/hooks/use-product-selections-fetcher/mocks/index.js +3 -0
  654. package/src/hooks/use-product-selections-fetcher/use-product-selections-fetcher.js +39 -0
  655. package/src/hooks/use-product-selections-fetcher/use-product-selections-fetcher.spec.js +71 -0
  656. package/src/hooks/use-product-selections-total-fetcher/fetch-product-selections-total.ctp.graphql +5 -0
  657. package/src/hooks/use-product-selections-total-fetcher/index.js +2 -0
  658. package/src/hooks/use-product-selections-total-fetcher/mocks/handlers.js +19 -0
  659. package/src/hooks/use-product-selections-total-fetcher/mocks/index.js +3 -0
  660. package/src/hooks/use-product-selections-total-fetcher/use-product-selections-total-fetcher.js +19 -0
  661. package/src/hooks/use-role-based-channels-fetcher/index.js +2 -0
  662. package/src/hooks/use-role-based-channels-fetcher/role-based-channels-fetcher.ctp.graphql +12 -0
  663. package/src/hooks/use-role-based-channels-fetcher/test-utils.js +37 -0
  664. package/src/hooks/use-role-based-channels-fetcher/use-role-based-channels-fetcher.js +44 -0
  665. package/src/hooks/use-role-notification/index.js +1 -0
  666. package/src/hooks/use-role-notification/notification-text/index.js +1 -0
  667. package/src/hooks/use-role-notification/notification-text/messages.js +21 -0
  668. package/src/hooks/use-role-notification/notification-text/notification-text.jsx +46 -0
  669. package/src/hooks/use-role-notification/use-role-notification.jsx +36 -0
  670. package/src/hooks/use-role-notification/use-role-notification.spec.js +46 -0
  671. package/src/hooks/use-role-notification-effect/index.js +1 -0
  672. package/src/hooks/use-role-notification-effect/use-role-notification-effect.js +56 -0
  673. package/src/hooks/use-role-notification-effect/use-role-notification-effect.spec.js +72 -0
  674. package/src/hooks/use-storage/__mocks__/index.js +26 -0
  675. package/src/hooks/use-storage/index.js +1 -0
  676. package/src/hooks/use-storage/use-storage.js +85 -0
  677. package/src/hooks/use-storage/use-storage.spec.js +237 -0
  678. package/src/hooks/use-store-keys-in-data-fence/index.js +1 -0
  679. package/src/hooks/use-store-keys-in-data-fence/use-store-keys-in-data-fence.js +38 -0
  680. package/src/hooks/use-store-keys-in-data-fence/use-store-keys-in-data-fence.spec.js +141 -0
  681. package/src/hooks/use-stores-list-fetcher/index.js +2 -0
  682. package/src/hooks/use-stores-list-fetcher/mocks/handlers.js +76 -0
  683. package/src/hooks/use-stores-list-fetcher/mocks/index.js +3 -0
  684. package/src/hooks/use-stores-list-fetcher/stores-list-query.ctp.graphql +52 -0
  685. package/src/hooks/use-stores-list-fetcher/use-stores-list-fetcher.js +71 -0
  686. package/src/hooks/use-stores-list-fetcher/use-stores-list-fetcher.spec.js +234 -0
  687. package/src/hooks/use-tracking/index.js +1 -0
  688. package/src/hooks/use-tracking/use-tracking.js +4 -0
  689. package/src/hooks/use-tracking/use-tracking.spec.js +29 -0
  690. package/src/hooks/use-tracking-shared/__mocks__/index.js +16 -0
  691. package/src/hooks/use-tracking-shared/index.js +1 -0
  692. package/src/hooks/use-tracking-shared/use-tracking-shared.js +58 -0
  693. package/src/index.js +489 -0
  694. package/src/internal-index.js +143 -0
  695. package/src/utils/active-modals/active-modals.js +7 -0
  696. package/src/utils/active-modals/active-modals.spec.js +27 -0
  697. package/src/utils/active-modals/index.js +1 -0
  698. package/src/utils/ariaset/ariaset.js +11 -0
  699. package/src/utils/ariaset/ariaset.spec.js +20 -0
  700. package/src/utils/ariaset/index.js +1 -0
  701. package/src/utils/array-helpers/array-helpers.js +2 -0
  702. package/src/utils/array-helpers/index.js +1 -0
  703. package/src/utils/attributes/attributes.js +38 -0
  704. package/src/utils/attributes/attributes.spec.js +180 -0
  705. package/src/utils/attributes/index.js +1 -0
  706. package/src/utils/build-search-query/build-search-query.js +27 -0
  707. package/src/utils/build-search-query/build-search-query.spec.js +129 -0
  708. package/src/utils/build-search-query/index.js +1 -0
  709. package/src/utils/bulk-notifications/get-bulk-notification.js +34 -0
  710. package/src/utils/bulk-notifications/get-bulk-notification.spec.js +142 -0
  711. package/src/utils/bulk-notifications/index.js +4 -0
  712. package/src/utils/business-roles/business-roles.js +24 -0
  713. package/src/utils/business-roles/index.js +4 -0
  714. package/src/utils/business-roles/messages.js +95 -0
  715. package/src/utils/capitalize-first/capitalize-first.js +3 -0
  716. package/src/utils/capitalize-first/capitalize-first.spec.js +7 -0
  717. package/src/utils/capitalize-first/index.js +1 -0
  718. package/src/utils/categories/categories.js +56 -0
  719. package/src/utils/categories/categories.spec.js +122 -0
  720. package/src/utils/categories/index.js +1 -0
  721. package/src/utils/clone/clone.js +3 -0
  722. package/src/utils/clone/clone.spec.js +23 -0
  723. package/src/utils/clone/index.js +1 -0
  724. package/src/utils/coerce-to-integer/coerce-to-integer.js +3 -0
  725. package/src/utils/coerce-to-integer/coerce-to-integer.spec.js +49 -0
  726. package/src/utils/coerce-to-integer/index.js +1 -0
  727. package/src/utils/connector/connector.js +30 -0
  728. package/src/utils/connector/connector.spec.js +174 -0
  729. package/src/utils/connector/index.js +1 -0
  730. package/src/utils/constants.js +43 -0
  731. package/src/utils/conversions/sort-array.js +6 -0
  732. package/src/utils/create-next-sort-definition/create-next-sort-definition.js +46 -0
  733. package/src/utils/create-next-sort-definition/create-next-sort-definition.spec.js +121 -0
  734. package/src/utils/create-next-sort-definition/index.js +1 -0
  735. package/src/utils/create-reducer/create-reducer.js +21 -0
  736. package/src/utils/create-reducer/create-reducer.spec.js +45 -0
  737. package/src/utils/create-reducer/index.js +1 -0
  738. package/src/utils/create-resource-reducer/create-resource-reducer.js +53 -0
  739. package/src/utils/create-resource-reducer/create-resource-reducer.spec.js +151 -0
  740. package/src/utils/create-resource-reducer/index.js +1 -0
  741. package/src/utils/customer/format-customer-address/format-customer-address.js +12 -0
  742. package/src/utils/customer/format-customer-address/format-customer-address.spec.js +43 -0
  743. package/src/utils/customer/format-customer-address/index.js +1 -0
  744. package/src/utils/customer/format-customer-name/format-customer-name.js +9 -0
  745. package/src/utils/customer/format-customer-name/format-customer-name.spec.js +44 -0
  746. package/src/utils/customer/format-customer-name/index.js +1 -0
  747. package/src/utils/customer/format-customer-title/format-customer-title.js +5 -0
  748. package/src/utils/customer/format-customer-title/format-customer-title.spec.js +23 -0
  749. package/src/utils/customer/format-customer-title/index.js +1 -0
  750. package/src/utils/dataset/dataset.js +34 -0
  751. package/src/utils/dataset/dataset.spec.js +70 -0
  752. package/src/utils/dataset/index.js +1 -0
  753. package/src/utils/encodings/encodings.js +24 -0
  754. package/src/utils/encodings/encodings.spec.js +21 -0
  755. package/src/utils/encodings/index.js +1 -0
  756. package/src/utils/filters/README.md +56 -0
  757. package/src/utils/filters/custom-fields/custom-fields.js +56 -0
  758. package/src/utils/filters/custom-fields/custom-fields.spec.js +328 -0
  759. package/src/utils/filters/custom-fields/index.js +1 -0
  760. package/src/utils/filters/date/date.js +114 -0
  761. package/src/utils/filters/date/date.spec.js +138 -0
  762. package/src/utils/filters/date/index.js +1 -0
  763. package/src/utils/filters/graphql/category-level/category-level.js +17 -0
  764. package/src/utils/filters/graphql/category-level/index.js +1 -0
  765. package/src/utils/filters/graphql/date/date.js +58 -0
  766. package/src/utils/filters/graphql/date/date.spec.js +122 -0
  767. package/src/utils/filters/graphql/date/index.js +1 -0
  768. package/src/utils/filters/graphql/graphql.js +42 -0
  769. package/src/utils/filters/graphql/graphql.spec.js +130 -0
  770. package/src/utils/filters/graphql/index.js +1 -0
  771. package/src/utils/filters/graphql/missing/index.js +1 -0
  772. package/src/utils/filters/graphql/missing/missing.js +7 -0
  773. package/src/utils/filters/graphql/missing/missing.spec.js +17 -0
  774. package/src/utils/filters/graphql/missing-locale/index.js +1 -0
  775. package/src/utils/filters/graphql/missing-locale/missing-locale.js +8 -0
  776. package/src/utils/filters/graphql/missing-locale/missing-locale.spec.js +17 -0
  777. package/src/utils/filters/graphql/number/index.js +1 -0
  778. package/src/utils/filters/graphql/number/number.js +37 -0
  779. package/src/utils/filters/graphql/number/number.spec.js +65 -0
  780. package/src/utils/filters/graphql/reference/index.js +1 -0
  781. package/src/utils/filters/graphql/reference/reference.js +26 -0
  782. package/src/utils/filters/graphql/reference/reference.spec.js +20 -0
  783. package/src/utils/filters/graphql/text/index.js +1 -0
  784. package/src/utils/filters/graphql/text/text.js +8 -0
  785. package/src/utils/filters/graphql/text/text.spec.js +35 -0
  786. package/src/utils/filters/is-date/index.js +1 -0
  787. package/src/utils/filters/is-date/is-date.js +17 -0
  788. package/src/utils/filters/is-date/is-date.spec.js +73 -0
  789. package/src/utils/filters/is-empty/index.js +1 -0
  790. package/src/utils/filters/is-empty/is-empty.js +9 -0
  791. package/src/utils/filters/is-empty/is-empty.spec.js +20 -0
  792. package/src/utils/filters/is-empty/range/index.js +1 -0
  793. package/src/utils/filters/is-empty/range/range.js +8 -0
  794. package/src/utils/filters/is-empty/range/range.spec.js +22 -0
  795. package/src/utils/filters/is-empty/single/index.js +1 -0
  796. package/src/utils/filters/is-empty/single/single.js +5 -0
  797. package/src/utils/filters/is-empty/single/single.spec.js +17 -0
  798. package/src/utils/filters/localized-string/index.js +1 -0
  799. package/src/utils/filters/localized-string/localized-string.js +4 -0
  800. package/src/utils/filters/localized-string/localized-string.spec.js +26 -0
  801. package/src/utils/filters/money/index.js +1 -0
  802. package/src/utils/filters/money/money.js +36 -0
  803. package/src/utils/filters/money/money.spec.js +55 -0
  804. package/src/utils/filters/time/index.js +1 -0
  805. package/src/utils/filters/time/time.js +65 -0
  806. package/src/utils/filters/time/time.spec.js +96 -0
  807. package/src/utils/filters/validation/custom-field/custom-field.js +70 -0
  808. package/src/utils/filters/validation/custom-field/custom-field.spec.js +237 -0
  809. package/src/utils/filters/validation/custom-field/index.js +1 -0
  810. package/src/utils/filters/validation/date/date.js +42 -0
  811. package/src/utils/filters/validation/date/date.spec.js +60 -0
  812. package/src/utils/filters/validation/date/index.js +1 -0
  813. package/src/utils/filters/validation/enum/enum.js +16 -0
  814. package/src/utils/filters/validation/enum/enum.spec.js +44 -0
  815. package/src/utils/filters/validation/enum/index.js +1 -0
  816. package/src/utils/filters/validation/number/index.js +1 -0
  817. package/src/utils/filters/validation/number/number.js +52 -0
  818. package/src/utils/filters/validation/number/number.spec.js +39 -0
  819. package/src/utils/filters/validation/text/index.js +1 -0
  820. package/src/utils/filters/validation/text/text.js +9 -0
  821. package/src/utils/filters/validation/text/text.spec.js +20 -0
  822. package/src/utils/formats/custom-field/custom-field.js +66 -0
  823. package/src/utils/formats/custom-field/custom-field.spec.js +91 -0
  824. package/src/utils/formats/custom-field/index.js +1 -0
  825. package/src/utils/formats/date/__mocks__/index.js +2 -0
  826. package/src/utils/formats/date/date.js +58 -0
  827. package/src/utils/formats/date/date.spec.js +241 -0
  828. package/src/utils/formats/date/index.js +1 -0
  829. package/src/utils/formats/discount/discount.js +12 -0
  830. package/src/utils/formats/discount/discount.spec.js +75 -0
  831. package/src/utils/formats/discount/index.js +1 -0
  832. package/src/utils/formats/index.js +4 -0
  833. package/src/utils/formats/money/index.js +6 -0
  834. package/src/utils/formats/money/money.js +50 -0
  835. package/src/utils/formats/money/money.spec.js +117 -0
  836. package/src/utils/formats/percentage/index.js +1 -0
  837. package/src/utils/formats/percentage/percentage.js +7 -0
  838. package/src/utils/formats/percentage/percentage.spec.js +18 -0
  839. package/src/utils/formats/product-attribute/index.js +1 -0
  840. package/src/utils/formats/product-attribute/messages.js +14 -0
  841. package/src/utils/formats/product-attribute/product-attribute.js +127 -0
  842. package/src/utils/formats/product-attribute/product-attribute.spec.js +128 -0
  843. package/src/utils/get-currency-code-data/currency-code-data.js +1247 -0
  844. package/src/utils/get-currency-code-data/get-currency-code-data.js +53 -0
  845. package/src/utils/get-currency-code-data/index.js +12 -0
  846. package/src/utils/get-prefix-search-bounds/get-prefix-search-bounds.js +26 -0
  847. package/src/utils/get-prefix-search-bounds/get-prefix-search-bounds.spec.js +14 -0
  848. package/src/utils/get-prefix-search-bounds/index.js +1 -0
  849. package/src/utils/graphql/__snapshots__/graphql.spec.js.snap +45 -0
  850. package/src/utils/graphql/fragments/address.ctp.graphql +39 -0
  851. package/src/utils/graphql/fragments/custom-fields.ctp.graphql +67 -0
  852. package/src/utils/graphql/fragments/store-basic-info.ctp.graphql +11 -0
  853. package/src/utils/graphql/graphql.js +579 -0
  854. package/src/utils/graphql/graphql.spec.js +1129 -0
  855. package/src/utils/graphql/index.js +1 -0
  856. package/src/utils/has-error-code/has-error-code.js +15 -0
  857. package/src/utils/has-error-code/has-error-code.spec.js +56 -0
  858. package/src/utils/has-error-code/has-invalid-input-error.js +7 -0
  859. package/src/utils/has-error-code/has-semantic-error.js +7 -0
  860. package/src/utils/has-error-code/has-semantic-error.spec.js +56 -0
  861. package/src/utils/has-error-code/index.js +3 -0
  862. package/src/utils/is-uuid/index.js +1 -0
  863. package/src/utils/is-uuid/is-uuid.js +6 -0
  864. package/src/utils/is-uuid/is-uuid.spec.js +25 -0
  865. package/src/utils/minusify/index.js +1 -0
  866. package/src/utils/minusify/minusify.js +4 -0
  867. package/src/utils/minusify/minusify.spec.js +9 -0
  868. package/src/utils/numbers/index.js +1 -0
  869. package/src/utils/numbers/numbers.js +32 -0
  870. package/src/utils/numbers/numbers.spec.js +57 -0
  871. package/src/utils/omit-deep/index.js +1 -0
  872. package/src/utils/omit-deep/omit-deep.js +20 -0
  873. package/src/utils/pim-query-clauses.js +43 -0
  874. package/src/utils/prices/index.js +1 -0
  875. package/src/utils/prices/prices.js +79 -0
  876. package/src/utils/prices/prices.spec.js +265 -0
  877. package/src/utils/product-selections/convert-product-selection-from-graphql.js +80 -0
  878. package/src/utils/product-selections/index.js +1 -0
  879. package/src/utils/product-types/index.js +1 -0
  880. package/src/utils/product-types/product-types.js +122 -0
  881. package/src/utils/product-types/product-types.spec.js +328 -0
  882. package/src/utils/products/index.js +1 -0
  883. package/src/utils/products/messages.js +16 -0
  884. package/src/utils/products/products.jsx +258 -0
  885. package/src/utils/products/products.spec.js +331 -0
  886. package/src/utils/query-string/index.js +1 -0
  887. package/src/utils/query-string/query-string.js +37 -0
  888. package/src/utils/query-string/query-string.spec.js +56 -0
  889. package/src/utils/request-cache/index.js +2 -0
  890. package/src/utils/request-cache/request-cache.js +52 -0
  891. package/src/utils/request-cache/request-cache.spec.js +118 -0
  892. package/src/utils/shallow-equal/index.js +1 -0
  893. package/src/utils/shallow-equal/shallow-equal.js +19 -0
  894. package/src/utils/shallow-equal/shallow-equal.spec.js +45 -0
  895. package/src/utils/should-update-attribute-input/index.js +1 -0
  896. package/src/utils/should-update-attribute-input/should-update-attribute-input.js +43 -0
  897. package/src/utils/should-update-attribute-input/should-update-attribute-input.spec.js +96 -0
  898. package/src/utils/slugify/index.js +1 -0
  899. package/src/utils/slugify/slugify.js +10 -0
  900. package/src/utils/slugify/slugify.spec.js +11 -0
  901. package/src/utils/swap-array-items/index.js +2 -0
  902. package/src/utils/swap-array-items/swap-array-items.js +13 -0
  903. package/src/utils/swap-array-items/swap-array-items.spec.js +52 -0
  904. package/src/utils/text-fallback/text-fallback.js +6 -0
  905. package/src/utils/time-zones/index.js +5 -0
  906. package/src/utils/time-zones/time-zone-utils.js +34 -0
  907. package/src/utils/time-zones/time-zone-utils.spec.js +47 -0
  908. package/src/utils/track-menu-click/index.js +1 -0
  909. package/src/utils/track-menu-click/track-menu-click.js +28 -0
  910. package/src/utils/track-menu-click/track-menu-click.spec.js +66 -0
  911. package/src/utils/transform-to-proper-noun-case/index.js +1 -0
  912. package/src/utils/transform-to-proper-noun-case/transform-to-proper-noun-case.js +10 -0
  913. package/src/utils/transform-to-proper-noun-case/transform-to-proper-noun-case.spec.js +23 -0
  914. package/src/utils/truncate/index.js +1 -0
  915. package/src/utils/truncate/truncate.js +9 -0
  916. package/src/utils/truncate/truncate.spec.js +23 -0
  917. package/src/utils/type-definitions/index.js +1 -0
  918. package/src/utils/type-definitions/type-definitions.js +118 -0
  919. package/src/utils/type-definitions/type-definitions.spec.js +547 -0
  920. package/src/utils/update-status-in-list/index.js +1 -0
  921. package/src/utils/update-status-in-list/update-status-in-list.js +16 -0
  922. package/src/utils/validation/get-indexes-of-invalid-values.js +16 -0
  923. package/src/utils/validation/get-indexes-of-invalid-values.spec.js +31 -0
  924. package/src/utils/validation/index.js +3 -0
  925. package/src/utils/validation/validation.js +169 -0
  926. package/src/utils/validation/validation.spec.js +99 -0
  927. package/src/utils/validation/without-empty-errors-by-field.js +5 -0
  928. package/src/utils/validation/without-empty-errors-by-field.spec.js +74 -0
  929. package/src/utils/with-pending-requests/index.js +1 -0
  930. package/src/utils/with-pending-requests/with-pending-requests.jsx +21 -0
  931. package/src/utils/with-pending-requests/with-pending-requests.spec.js +62 -0
@@ -0,0 +1,266 @@
1
+ import { graphql } from 'msw';
2
+ import { setupServer } from 'msw/node';
3
+ import { GtmContext } from '@commercetools-frontend/application-shell';
4
+ import {
5
+ renderAppWithRedux,
6
+ fireEvent,
7
+ screen,
8
+ waitFor,
9
+ waitForElementToBeRemoved,
10
+ } from '@commercetools-frontend/application-shell/test-utils';
11
+ import { buildGraphqlList } from '@commercetools-test-data/core';
12
+ import { ProductType } from '@commercetools-local/test-data';
13
+ import { selectInputUtils } from '@commercetools-local/test-utils';
14
+ import PropTypes from 'prop-types';
15
+ import ProductTypePickerInput from './product-type-picker-input';
16
+
17
+ const track = jest.fn();
18
+
19
+ const createTestProps = (custom) => ({
20
+ name: 'product-type-picker-input',
21
+ isClearable: true,
22
+ onChange: jest.fn(),
23
+ onError: jest.fn(),
24
+ ...custom,
25
+ });
26
+
27
+ const render = (ui, renderOptions) => {
28
+ const Wrapper = ({ children }) => (
29
+ <GtmContext.Provider value={{ track }}>
30
+ <>
31
+ <label htmlFor="product-type-picker-input">Product type picker</label>
32
+ {children}
33
+ </>
34
+ </GtmContext.Provider>
35
+ );
36
+ Wrapper.propTypes = {
37
+ children: PropTypes.element.isRequired,
38
+ };
39
+
40
+ renderAppWithRedux(ui, {
41
+ wrapper: Wrapper,
42
+ ...renderOptions,
43
+ });
44
+ };
45
+
46
+ const productType = ProductType.presets.milk();
47
+ const builtProductType = productType.buildGraphql();
48
+
49
+ let queriesSent;
50
+
51
+ const mockServer = setupServer(
52
+ graphql.query('GetProductTypeQuery', (req, res, ctx) => {
53
+ const productTypeId = req.body.variables.id;
54
+ return res(
55
+ ctx.data({
56
+ productType:
57
+ productTypeId === builtProductType.id ? builtProductType : null,
58
+ })
59
+ );
60
+ }),
61
+
62
+ graphql.query('GetProductTypesQuery', (req, res, ctx) => {
63
+ queriesSent.GetProductTypesQuery += 1;
64
+
65
+ const whereQuery = req.body.variables.where;
66
+
67
+ const foundProductTypes =
68
+ whereQuery.includes('name >= "Milk"') ||
69
+ whereQuery === `id = "${builtProductType.id}"`
70
+ ? [productType]
71
+ : [];
72
+
73
+ return res(
74
+ ctx.data({
75
+ productTypes: buildGraphqlList(foundProductTypes, {
76
+ name: 'ProductType',
77
+ total: 1,
78
+ }),
79
+ })
80
+ );
81
+ }),
82
+ graphql.query('FetchIndicesExist', (req, res, ctx) =>
83
+ res(
84
+ ctx.data({
85
+ indicesExist: {
86
+ products: {
87
+ searchableIndexExists: false,
88
+ newInProgress: false,
89
+ },
90
+ productTypes: {
91
+ searchableIndexExists: false,
92
+ newInProgress: false,
93
+ },
94
+ },
95
+ })
96
+ )
97
+ )
98
+ );
99
+
100
+ beforeEach(() => {
101
+ queriesSent = {
102
+ GetProductTypesQuery: 0,
103
+ };
104
+ console.config.addSilencedWarning(
105
+ /Can't perform a React state update on an unmounted component/
106
+ );
107
+ });
108
+
109
+ afterEach(() => {
110
+ mockServer.resetHandlers();
111
+ });
112
+
113
+ beforeAll(() => {
114
+ // This test somehow causes this: https://github.com/andyearnshaw/Intl.js/issues/256
115
+ // That's a work-around:
116
+
117
+ mockServer.listen({
118
+ onUnhandledRequest: 'error',
119
+ });
120
+ });
121
+
122
+ afterAll(() => mockServer.close());
123
+
124
+ describe('searching options', () => {
125
+ it('should debounce the search', async () => {
126
+ const props = createTestProps();
127
+ render(<ProductTypePickerInput {...props} />);
128
+
129
+ const input = await screen.findByLabelText('Product type picker');
130
+ fireEvent.focus(input);
131
+ fireEvent.keyDown(input, { key: 'ArrowDown' });
132
+ fireEvent.change(input, { target: { value: 'M' } });
133
+ fireEvent.change(input, { target: { value: 'i' } });
134
+ fireEvent.change(input, { target: { value: 'l' } });
135
+ fireEvent.change(input, { target: { value: 'k' } });
136
+
137
+ await waitFor(() => expect(queriesSent.GetProductTypesQuery).toBe(1));
138
+ });
139
+
140
+ it('should show a message when no product types are found', async () => {
141
+ const props = createTestProps();
142
+ render(<ProductTypePickerInput {...props} />);
143
+
144
+ const input = await screen.findByLabelText('Product type picker');
145
+ fireEvent.focus(input);
146
+ fireEvent.keyDown(input, { key: 'ArrowDown' });
147
+ fireEvent.change(input, { target: { value: 'Missing' } });
148
+
149
+ await screen.findByText(
150
+ /there are no product types that match your search/i
151
+ );
152
+ });
153
+
154
+ it('should call onError on network error', async () => {
155
+ mockServer.use(
156
+ graphql.query('GetProductTypesQuery', (req, res, ctx) =>
157
+ res(ctx.status(500))
158
+ )
159
+ );
160
+
161
+ const props = createTestProps();
162
+ render(<ProductTypePickerInput {...props} />);
163
+
164
+ const input = await screen.findByLabelText('Product type picker');
165
+ fireEvent.focus(input);
166
+ fireEvent.keyDown(input, { key: 'ArrowDown' });
167
+ fireEvent.change(input, { target: { value: 'Milk' } });
168
+
169
+ await waitFor(() => expect(props.onError).toHaveBeenCalled());
170
+ });
171
+
172
+ it('should render a loading spinner when initial product option is being loaded', async () => {
173
+ mockServer.use(
174
+ graphql.query('GetProductTypeQuery', () => Promise.resolve())
175
+ );
176
+ const props = createTestProps({
177
+ value: builtProductType.id,
178
+ });
179
+ render(<ProductTypePickerInput {...props} />);
180
+ expect(screen.getByTestId('centered-loading-spinner')).toBeInTheDocument();
181
+
182
+ await waitFor(() =>
183
+ expect(
184
+ screen.queryByTestId('centered-loading-spinner')
185
+ ).not.toBeInTheDocument()
186
+ );
187
+ });
188
+
189
+ it('should render the error message on loading error', async () => {
190
+ mockServer.use(
191
+ graphql.query('GetProductTypeQuery', (req, res, ctx) =>
192
+ res(ctx.status(500))
193
+ )
194
+ );
195
+
196
+ const props = createTestProps({
197
+ value: builtProductType.id,
198
+ });
199
+ render(<ProductTypePickerInput {...props} />);
200
+
201
+ await screen.findByText(
202
+ 'Unable to load resource. Check the connection and try again.'
203
+ );
204
+ });
205
+ });
206
+
207
+ describe('selecting options', () => {
208
+ it('should select option', async () => {
209
+ const props = createTestProps();
210
+ render(<ProductTypePickerInput {...props} />);
211
+
212
+ const input = await screen.findByLabelText('Product type picker');
213
+ fireEvent.focus(input);
214
+ fireEvent.keyDown(input, { key: 'ArrowDown' });
215
+ fireEvent.change(input, { target: { value: 'Milk' } });
216
+
217
+ await waitForElementToBeRemoved(() => screen.queryByText(/loading/i));
218
+ selectInputUtils.selectFirstOption(input);
219
+
220
+ await waitFor(() => {
221
+ expect(props.onChange).toHaveBeenLastCalledWith({
222
+ persist: expect.any(Function),
223
+ target: {
224
+ id: 'product-type-picker-input',
225
+ name: 'product-type-picker-input',
226
+ value: builtProductType.id,
227
+ },
228
+ });
229
+ });
230
+ });
231
+
232
+ it('should track options selections', async () => {
233
+ const props = createTestProps();
234
+ render(<ProductTypePickerInput {...props} />);
235
+
236
+ const input = await screen.findByLabelText('Product type picker');
237
+ fireEvent.focus(input);
238
+ fireEvent.keyDown(input, { key: 'ArrowDown' });
239
+ fireEvent.change(input, { target: { value: 'P' } });
240
+
241
+ const getLoadingElement = () => screen.getByText(/loading/i);
242
+
243
+ await waitForElementToBeRemoved(getLoadingElement);
244
+ selectInputUtils.selectFirstOption(input);
245
+ await waitFor(() =>
246
+ expect(track).toHaveBeenCalledWith(
247
+ 'select',
248
+ 'ReferenceProductType',
249
+ 'name'
250
+ )
251
+ );
252
+
253
+ // should track id selection
254
+ fireEvent.change(input, { target: { value: builtProductType.id } });
255
+
256
+ await waitForElementToBeRemoved(getLoadingElement);
257
+ selectInputUtils.selectFirstOption(input);
258
+ await waitFor(() =>
259
+ expect(track).toHaveBeenLastCalledWith(
260
+ 'select',
261
+ 'ReferenceProductType',
262
+ 'id'
263
+ )
264
+ );
265
+ });
266
+ });
@@ -0,0 +1,14 @@
1
+ const trackingEvents = {
2
+ selectProductTypeName: {
3
+ action: 'select',
4
+ category: 'ReferenceProductType',
5
+ label: 'name',
6
+ },
7
+ selectProductTypeId: {
8
+ action: 'select',
9
+ category: 'ReferenceProductType',
10
+ label: 'id',
11
+ },
12
+ };
13
+
14
+ export default trackingEvents;
@@ -0,0 +1,17 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`when uncolored should match snapshot 1`] = `
4
+ <em
5
+ className=""
6
+ >
7
+ *
8
+ </em>
9
+ `;
10
+
11
+ exports[`with default props should match snapshot 1`] = `
12
+ <em
13
+ className="colored"
14
+ >
15
+ *
16
+ </em>
17
+ `;
@@ -0,0 +1 @@
1
+ export { default } from './required-indicator';
@@ -0,0 +1,16 @@
1
+ // NOTE: this component is duplicated in `app-shell/from-core`.
2
+ // It's a temporary solution to avoid importing `core` components from AppShell.
3
+ // Be careful when you change something here, remember to duplicate the changes.
4
+ import PropTypes from 'prop-types';
5
+ import classnames from 'classnames';
6
+ import styles from './required-indicator.module.css';
7
+
8
+ const RequiredIndicator = ({ uncolored }) => (
9
+ <em className={classnames({ [styles.colored]: !uncolored })}>{'*'}</em>
10
+ );
11
+ RequiredIndicator.displayName = 'RequiredIndicator';
12
+ RequiredIndicator.propTypes = {
13
+ uncolored: PropTypes.bool,
14
+ };
15
+
16
+ export default RequiredIndicator;
@@ -0,0 +1,3 @@
1
+ .colored {
2
+ color: var(--color-warning);
3
+ }
@@ -0,0 +1,14 @@
1
+ import { shallow } from 'enzyme';
2
+ import RequiredIndicator from './required-indicator';
3
+
4
+ describe('with default props', () => {
5
+ it('should match snapshot', () => {
6
+ expect(shallow(<RequiredIndicator />)).toMatchSnapshot();
7
+ });
8
+ });
9
+
10
+ describe('when uncolored', () => {
11
+ it('should match snapshot', () => {
12
+ expect(shallow(<RequiredIndicator uncolored={true} />)).toMatchSnapshot();
13
+ });
14
+ });
@@ -0,0 +1 @@
1
+ export { default } from './scroll-to-field-error';
@@ -0,0 +1,32 @@
1
+ import { useEffect } from 'react';
2
+ import { useFormikContext } from 'formik';
3
+
4
+ const ScrollToFieldError = () => {
5
+ const formik = useFormikContext();
6
+ const { isValid, submitCount } = formik;
7
+
8
+ useEffect(() => {
9
+ // Do not run the effect if the form hasn't been submitted yet.
10
+ if (submitCount === 0) return;
11
+ // Do not run the effect if the form is valid.
12
+ if (isValid) return;
13
+
14
+ const firstErrorElement = document.querySelector('[aria-invalid="true"]');
15
+ if (firstErrorElement) {
16
+ // Get a reference to the label.
17
+ const id = firstErrorElement.getAttribute('id');
18
+
19
+ // Scroll to the label (if found), otherwise to the input element itself.
20
+ const elementToScrollTo =
21
+ document.querySelector(`label[for="${id}"]`) ??
22
+ document.querySelector(`label#${id}`) ??
23
+ firstErrorElement;
24
+
25
+ elementToScrollTo.scrollIntoView?.({ behavior: 'smooth' });
26
+ }
27
+ }, [isValid, submitCount]);
28
+
29
+ return null;
30
+ };
31
+
32
+ export default ScrollToFieldError;
@@ -0,0 +1 @@
1
+ export { default } from './selectable-field-search-input';
@@ -0,0 +1,14 @@
1
+ import { defineMessages } from 'react-intl';
2
+
3
+ export default defineMessages({
4
+ buttonLabel: {
5
+ id: 'SearchInput.buttonLabel',
6
+ description: 'Label for "Search" button.',
7
+ defaultMessage: 'Search',
8
+ },
9
+ placeholder: {
10
+ id: 'SearchInput.placeholder',
11
+ description: 'Placeholder for "Search" input field',
12
+ defaultMessage: 'Search',
13
+ },
14
+ });
@@ -0,0 +1,147 @@
1
+ import PropTypes from 'prop-types';
2
+ import { useState } from 'react';
3
+ import {
4
+ AccessibleHidden,
5
+ SelectInput,
6
+ Constraints,
7
+ Text,
8
+ } from '@commercetools-frontend/ui-kit';
9
+ import { SearchInput } from '../../internal-index';
10
+ import styles from './selectable-field-search-input.module.css';
11
+
12
+ const SearchModeOption = (props) => (
13
+ <SelectInput.Option {...props}>
14
+ <Text.Body
15
+ truncate={true}
16
+ title={props.title || props.label}
17
+ tone={props.isDisabled ? 'secondary' : null}
18
+ >
19
+ {props.label ?? ' '}
20
+ </Text.Body>
21
+ </SelectInput.Option>
22
+ );
23
+
24
+ SearchModeOption.displayName = 'SearchModeOption';
25
+ SearchModeOption.propTypes = {
26
+ label: PropTypes.string.isRequired,
27
+ title: PropTypes.string,
28
+ isDisabled: PropTypes.bool,
29
+ };
30
+
31
+ const SearchModeSingleValue = (props) => (
32
+ <SelectInput.SingleValue {...props}>
33
+ <Text.Body
34
+ truncate={true}
35
+ title={props.data.title || props.data.label}
36
+ tone={props.data.isDisabled ? 'primary' : null}
37
+ >
38
+ {props.data.label ?? ' '}
39
+ </Text.Body>
40
+ </SelectInput.SingleValue>
41
+ );
42
+
43
+ SearchModeSingleValue.displayName = 'SearchModeSingleValue';
44
+ SearchModeSingleValue.propTypes = {
45
+ data: PropTypes.shape({
46
+ label: PropTypes.string.isRequired,
47
+ title: PropTypes.string,
48
+ isDisabled: PropTypes.bool,
49
+ }),
50
+ };
51
+
52
+ const SearchModeMenu = (props) => (
53
+ <SelectInput.Menu className={styles['search-mode-menu']} {...props}>
54
+ {props.children}
55
+ </SelectInput.Menu>
56
+ );
57
+
58
+ SearchModeMenu.displayName = 'SearchModeMenu';
59
+ SearchModeMenu.propTypes = {
60
+ children: PropTypes.object,
61
+ getStyles: PropTypes.func,
62
+ innerRef: PropTypes.func,
63
+ innerProps: PropTypes.object,
64
+ };
65
+
66
+ export const SelectableFieldSearchInput = (props) => {
67
+ const [searchString, setSearchString] = useState(props.initialValue);
68
+ const handleChangeInput = (value) => {
69
+ if (typeof props.onTextInputChange === 'function') {
70
+ props.onTextInputChange(value);
71
+ }
72
+ setSearchString(value);
73
+ };
74
+
75
+ const selectInputProps = props.disabled
76
+ ? {}
77
+ : {
78
+ components: {
79
+ Option: SearchModeOption,
80
+ SingleValue: SearchModeSingleValue,
81
+ Menu: SearchModeMenu,
82
+ },
83
+ };
84
+
85
+ return (
86
+ <div className={styles.container}>
87
+ <AccessibleHidden>
88
+ <label htmlFor="select-search-mode">Open search mode</label>
89
+ </AccessibleHidden>
90
+ <SelectInput
91
+ id="select-search-mode"
92
+ value={props.searchMode}
93
+ aria-label="search-mode"
94
+ horizontalConstraint={3}
95
+ options={props.options}
96
+ isDisabled={props.disabled}
97
+ onChange={(option) =>
98
+ props.onChange({
99
+ option: option.target.value,
100
+ value: searchString,
101
+ })
102
+ }
103
+ showOptionGroupDivider={true}
104
+ {...selectInputProps}
105
+ />
106
+ <Constraints.Horizontal max="scale">
107
+ <SearchInput
108
+ searchMode={props.searchMode}
109
+ aria-label="search-input"
110
+ isGranular={true}
111
+ onChange={handleChangeInput}
112
+ placeholder={props.placeholder}
113
+ initialValue={props.initialValue}
114
+ onSubmit={(value) => {
115
+ props.onChange({ option: props.searchMode, value });
116
+ }}
117
+ throttleMS={
118
+ 1 /* we pass 1ms to prevent user search before state update */
119
+ }
120
+ onReset={props.onReset}
121
+ disabled={props.disabled}
122
+ enableDisabledStyle={props.enableDisabledStyle}
123
+ />
124
+ </Constraints.Horizontal>
125
+ </div>
126
+ );
127
+ };
128
+
129
+ SelectableFieldSearchInput.displayName = 'SelectableFieldSearchInput';
130
+ SelectableFieldSearchInput.propTypes = {
131
+ options: PropTypes.arrayOf(
132
+ PropTypes.shape({
133
+ value: PropTypes.string,
134
+ label: PropTypes.string,
135
+ }).isRequired
136
+ ),
137
+ onTextInputChange: PropTypes.func,
138
+ onReset: PropTypes.func,
139
+ placeholder: PropTypes.string,
140
+ onChange: PropTypes.func.isRequired,
141
+ initialValue: PropTypes.string,
142
+ searchMode: PropTypes.string,
143
+ disabled: PropTypes.bool,
144
+ enableDisabledStyle: PropTypes.bool,
145
+ };
146
+
147
+ export default SelectableFieldSearchInput;
@@ -0,0 +1,14 @@
1
+ .container {
2
+ width: 100%;
3
+ position: relative;
4
+ display: flex;
5
+ z-index: 3;
6
+ max-width: 800px;
7
+ }
8
+
9
+ .search-mode-menu {
10
+ border-radius: var(--border-radius-6);
11
+ border: 1px solid var(--color-primary);
12
+ margin-top: 2px;
13
+ position: absolute;
14
+ }
@@ -0,0 +1,82 @@
1
+ import {
2
+ renderApp,
3
+ fireEvent,
4
+ screen,
5
+ } from '@commercetools-frontend/application-shell/test-utils';
6
+ import SelectableFieldSearchInput from './selectable-field-search-input';
7
+
8
+ const createTestProps = (custom) => ({
9
+ options: [
10
+ {
11
+ value: 'lastName',
12
+ label: 'Last name',
13
+ },
14
+ {
15
+ value: 'email',
16
+ label: 'Email',
17
+ },
18
+ ],
19
+ searchMode: '',
20
+ onReset: jest.fn(),
21
+ onChange: jest.fn(),
22
+ clearSearchField: jest.fn(),
23
+ ...custom,
24
+ });
25
+
26
+ describe('<SelectableFieldSearchInput />', () => {
27
+ it('should render default placeholder', async () => {
28
+ const props = createTestProps();
29
+ renderApp(<SelectableFieldSearchInput {...props} />);
30
+ await screen.findByPlaceholderText('Search');
31
+ });
32
+
33
+ it('should render with a provided placeholder', async () => {
34
+ const props = createTestProps({ placeholder: 'enter something...' });
35
+ renderApp(<SelectableFieldSearchInput {...props} />);
36
+ await screen.findByPlaceholderText('enter something...');
37
+ });
38
+
39
+ it('should submit on search icon click', async () => {
40
+ const props = createTestProps({
41
+ initialValue: 'foo',
42
+ });
43
+ renderApp(<SelectableFieldSearchInput {...props} />);
44
+ fireEvent.click(screen.getByTestId('search-button'));
45
+
46
+ expect(props.onChange).toHaveBeenCalledWith({ option: '', value: 'foo' });
47
+ });
48
+
49
+ it('should submit on hitting Enter', async () => {
50
+ const props = createTestProps({
51
+ initialValue: 'foo',
52
+ });
53
+ renderApp(<SelectableFieldSearchInput {...props} />);
54
+ fireEvent.keyDown(screen.getByDisplayValue('foo'), {
55
+ key: 'Enter',
56
+ keyCode: 13,
57
+ });
58
+ expect(props.onChange).toHaveBeenCalledWith({ option: '', value: 'foo' });
59
+ });
60
+ it('should pass value and option as a prop if both are specified', async () => {
61
+ const props = createTestProps({});
62
+ renderApp(<SelectableFieldSearchInput {...props} />);
63
+
64
+ const searchInput = await screen.findByPlaceholderText('Search');
65
+ fireEvent.change(searchInput, { target: { value: 'foo' } });
66
+ fireEvent.keyDown(searchInput, {
67
+ key: 'Enter',
68
+ keyCode: 13,
69
+ });
70
+
71
+ const select = await screen.findByText('Select...');
72
+ fireEvent.focus(select);
73
+ fireEvent.keyDown(select, { key: 'ArrowDown' });
74
+ const option = await screen.findByText('Last name');
75
+ fireEvent.click(option);
76
+
77
+ expect(props.onChange).toHaveBeenCalledWith({
78
+ option: 'lastName',
79
+ value: 'foo',
80
+ });
81
+ });
82
+ });
@@ -0,0 +1 @@
1
+ export { default } from './state-picker-input';
@@ -0,0 +1,14 @@
1
+ import { defineMessages } from 'react-intl';
2
+
3
+ export default defineMessages({
4
+ noStatesFound: {
5
+ id: 'Products.StatePickerInput.noStatesFound',
6
+ description: 'The message to display when no states were found',
7
+ defaultMessage: 'There are no states that match your search',
8
+ },
9
+ placeholder: {
10
+ id: 'Products.StatePickerInput.placeholder',
11
+ description: 'The placeholder of the input',
12
+ defaultMessage: 'Search by state name, key or type an ID',
13
+ },
14
+ });
@@ -0,0 +1,24 @@
1
+ query GetStatesQuery($where: String, $sortByNamePath: String!) {
2
+ states(where: $where, sort: [$sortByNamePath, "key"], limit: 60) {
3
+ total
4
+ results {
5
+ id
6
+ key
7
+ nameAllLocales {
8
+ locale
9
+ value
10
+ }
11
+ }
12
+ }
13
+ }
14
+
15
+ query GetStateQuery($id: String) {
16
+ state(id: $id) {
17
+ id
18
+ key
19
+ nameAllLocales {
20
+ locale
21
+ value
22
+ }
23
+ }
24
+ }