@porsche-design-system/components-react 2.18.0-rc.1 → 2.18.0

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 (294) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/hooks.js +0 -2
  3. package/jsdom-polyfill/index.js +1 -1
  4. package/lib/components/accordion.wrapper.d.ts +1 -1
  5. package/lib/components/accordion.wrapper.js +0 -2
  6. package/lib/components/banner.wrapper.d.ts +1 -1
  7. package/lib/components/banner.wrapper.js +0 -2
  8. package/lib/components/button-group.wrapper.d.ts +1 -1
  9. package/lib/components/button-group.wrapper.js +0 -2
  10. package/lib/components/button-pure.wrapper.d.ts +1 -1
  11. package/lib/components/button-pure.wrapper.js +0 -2
  12. package/lib/components/button.wrapper.d.ts +1 -1
  13. package/lib/components/button.wrapper.js +0 -2
  14. package/lib/components/carousel.wrapper.d.ts +1 -1
  15. package/lib/components/carousel.wrapper.js +0 -2
  16. package/lib/components/checkbox-wrapper.wrapper.d.ts +1 -1
  17. package/lib/components/checkbox-wrapper.wrapper.js +0 -2
  18. package/lib/components/content-wrapper.wrapper.d.ts +1 -1
  19. package/lib/components/content-wrapper.wrapper.js +0 -2
  20. package/lib/components/divider.wrapper.d.ts +1 -1
  21. package/lib/components/divider.wrapper.js +0 -2
  22. package/lib/components/fieldset-wrapper.wrapper.d.ts +1 -1
  23. package/lib/components/fieldset-wrapper.wrapper.js +0 -2
  24. package/lib/components/flex-item.wrapper.d.ts +1 -1
  25. package/lib/components/flex-item.wrapper.js +0 -2
  26. package/lib/components/flex.wrapper.d.ts +1 -1
  27. package/lib/components/flex.wrapper.js +0 -2
  28. package/lib/components/grid-item.wrapper.d.ts +1 -1
  29. package/lib/components/grid-item.wrapper.js +0 -2
  30. package/lib/components/grid.wrapper.d.ts +1 -1
  31. package/lib/components/grid.wrapper.js +0 -2
  32. package/lib/components/headline.wrapper.d.ts +1 -1
  33. package/lib/components/headline.wrapper.js +0 -2
  34. package/lib/components/icon.wrapper.d.ts +1 -1
  35. package/lib/components/icon.wrapper.js +0 -2
  36. package/lib/components/inline-notification.wrapper.d.ts +1 -1
  37. package/lib/components/inline-notification.wrapper.js +0 -2
  38. package/lib/components/link-pure.wrapper.d.ts +1 -1
  39. package/lib/components/link-pure.wrapper.js +0 -2
  40. package/lib/components/link-social.wrapper.d.ts +1 -1
  41. package/lib/components/link-social.wrapper.js +0 -2
  42. package/lib/components/link-tile.wrapper.d.ts +1 -1
  43. package/lib/components/link-tile.wrapper.js +0 -2
  44. package/lib/components/link.wrapper.d.ts +1 -1
  45. package/lib/components/link.wrapper.js +0 -2
  46. package/lib/components/marque.wrapper.d.ts +1 -1
  47. package/lib/components/marque.wrapper.js +0 -2
  48. package/lib/components/modal.wrapper.d.ts +1 -1
  49. package/lib/components/modal.wrapper.js +0 -2
  50. package/lib/components/pagination.wrapper.d.ts +1 -1
  51. package/lib/components/pagination.wrapper.js +0 -2
  52. package/lib/components/popover.wrapper.d.ts +1 -1
  53. package/lib/components/popover.wrapper.js +0 -2
  54. package/lib/components/radio-button-wrapper.wrapper.d.ts +1 -1
  55. package/lib/components/radio-button-wrapper.wrapper.js +0 -2
  56. package/lib/components/scroller.wrapper.d.ts +1 -1
  57. package/lib/components/scroller.wrapper.js +0 -2
  58. package/lib/components/segmented-control-item.wrapper.d.ts +1 -1
  59. package/lib/components/segmented-control-item.wrapper.js +0 -2
  60. package/lib/components/segmented-control.wrapper.d.ts +1 -1
  61. package/lib/components/segmented-control.wrapper.js +0 -2
  62. package/lib/components/select-wrapper.wrapper.d.ts +1 -1
  63. package/lib/components/select-wrapper.wrapper.js +0 -2
  64. package/lib/components/spinner.wrapper.d.ts +1 -1
  65. package/lib/components/spinner.wrapper.js +0 -2
  66. package/lib/components/stepper-horizontal-item.wrapper.d.ts +1 -1
  67. package/lib/components/stepper-horizontal-item.wrapper.js +0 -2
  68. package/lib/components/stepper-horizontal.wrapper.d.ts +1 -1
  69. package/lib/components/stepper-horizontal.wrapper.js +0 -2
  70. package/lib/components/switch.wrapper.d.ts +1 -1
  71. package/lib/components/switch.wrapper.js +0 -2
  72. package/lib/components/table-body.wrapper.d.ts +1 -1
  73. package/lib/components/table-body.wrapper.js +0 -2
  74. package/lib/components/table-cell.wrapper.d.ts +1 -1
  75. package/lib/components/table-cell.wrapper.js +0 -2
  76. package/lib/components/table-head-cell.wrapper.d.ts +1 -1
  77. package/lib/components/table-head-cell.wrapper.js +0 -2
  78. package/lib/components/table-head-row.wrapper.d.ts +1 -1
  79. package/lib/components/table-head-row.wrapper.js +0 -2
  80. package/lib/components/table-head.wrapper.d.ts +1 -1
  81. package/lib/components/table-head.wrapper.js +0 -2
  82. package/lib/components/table-row.wrapper.d.ts +1 -1
  83. package/lib/components/table-row.wrapper.js +0 -2
  84. package/lib/components/table.wrapper.d.ts +1 -1
  85. package/lib/components/table.wrapper.js +0 -2
  86. package/lib/components/tabs-bar.wrapper.d.ts +1 -1
  87. package/lib/components/tabs-bar.wrapper.js +0 -2
  88. package/lib/components/tabs-item.wrapper.d.ts +1 -1
  89. package/lib/components/tabs-item.wrapper.js +0 -2
  90. package/lib/components/tabs.wrapper.d.ts +1 -1
  91. package/lib/components/tabs.wrapper.js +0 -2
  92. package/lib/components/tag-dismissible.wrapper.d.ts +1 -1
  93. package/lib/components/tag-dismissible.wrapper.js +0 -2
  94. package/lib/components/tag.wrapper.d.ts +1 -1
  95. package/lib/components/tag.wrapper.js +0 -2
  96. package/lib/components/text-field-wrapper.wrapper.d.ts +1 -1
  97. package/lib/components/text-field-wrapper.wrapper.js +0 -2
  98. package/lib/components/text-list-item.wrapper.d.ts +1 -1
  99. package/lib/components/text-list-item.wrapper.js +0 -2
  100. package/lib/components/text-list.wrapper.d.ts +1 -1
  101. package/lib/components/text-list.wrapper.js +0 -2
  102. package/lib/components/text.wrapper.d.ts +1 -1
  103. package/lib/components/text.wrapper.js +0 -2
  104. package/lib/components/textarea-wrapper.wrapper.d.ts +1 -1
  105. package/lib/components/textarea-wrapper.wrapper.js +0 -2
  106. package/lib/components/toast.wrapper.d.ts +1 -1
  107. package/lib/components/toast.wrapper.js +0 -2
  108. package/lib/types.d.ts +5 -5
  109. package/package.json +2 -2
  110. package/provider.d.ts +1 -1
  111. package/provider.js +0 -2
  112. package/public-api.js +0 -2
  113. package/ssr/components/dist/styles/esm/styles-entry.js +2441 -2309
  114. package/ssr/components/dist/utils/esm/utils-entry.js +2220 -2035
  115. package/ssr/components-react/projects/react-ssr-wrapper/src/hooks.js +0 -2
  116. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/accordion.wrapper.js +0 -2
  117. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/banner.wrapper.js +0 -2
  118. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/button-group.wrapper.js +0 -2
  119. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/button-pure.wrapper.js +0 -2
  120. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/button.wrapper.js +0 -2
  121. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/carousel.wrapper.js +0 -2
  122. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/checkbox-wrapper.wrapper.js +0 -2
  123. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/content-wrapper.wrapper.js +0 -2
  124. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/divider.wrapper.js +0 -2
  125. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/fieldset-wrapper.wrapper.js +0 -2
  126. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/flex-item.wrapper.js +0 -2
  127. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/flex.wrapper.js +0 -2
  128. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/grid-item.wrapper.js +0 -2
  129. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/grid.wrapper.js +0 -2
  130. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/headline.wrapper.js +0 -2
  131. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/icon.wrapper.js +0 -2
  132. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/inline-notification.wrapper.js +0 -2
  133. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/link-pure.wrapper.js +0 -2
  134. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/link-social.wrapper.js +0 -2
  135. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/link-tile.wrapper.js +0 -2
  136. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/link.wrapper.js +0 -2
  137. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/marque.wrapper.js +0 -2
  138. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/modal.wrapper.js +0 -2
  139. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/pagination.wrapper.js +0 -2
  140. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/popover.wrapper.js +0 -2
  141. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/radio-button-wrapper.wrapper.js +0 -2
  142. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/scroller.wrapper.js +0 -2
  143. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/segmented-control-item.wrapper.js +0 -2
  144. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/segmented-control.wrapper.js +0 -2
  145. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/select-wrapper.wrapper.js +0 -2
  146. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/spinner.wrapper.js +0 -2
  147. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/stepper-horizontal-item.wrapper.js +0 -2
  148. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/stepper-horizontal.wrapper.js +0 -2
  149. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/switch.wrapper.js +0 -2
  150. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/table-body.wrapper.js +0 -2
  151. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/table-cell.wrapper.js +0 -2
  152. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/table-head-cell.wrapper.js +0 -2
  153. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/table-head-row.wrapper.js +0 -2
  154. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/table-head.wrapper.js +0 -2
  155. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/table-row.wrapper.js +0 -2
  156. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/table.wrapper.js +0 -2
  157. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/tabs-bar.wrapper.js +0 -2
  158. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/tabs-item.wrapper.js +0 -2
  159. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/tabs.wrapper.js +0 -2
  160. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/tag-dismissible.wrapper.js +0 -2
  161. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/tag.wrapper.js +0 -2
  162. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/text-field-wrapper.wrapper.js +0 -2
  163. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/text-list-item.wrapper.js +0 -2
  164. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/text-list.wrapper.js +0 -2
  165. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/text.wrapper.js +0 -2
  166. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/textarea-wrapper.wrapper.js +0 -2
  167. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/components/toast.wrapper.js +0 -2
  168. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.js +0 -2
  169. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.js +0 -2
  170. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-group.js +0 -2
  171. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.js +0 -2
  172. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.js +0 -2
  173. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.js +0 -2
  174. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.js +0 -2
  175. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.js +0 -2
  176. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/divider.js +0 -2
  177. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.js +0 -2
  178. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex-item.js +0 -2
  179. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex.js +0 -2
  180. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid-item.js +0 -2
  181. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid.js +0 -2
  182. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.js +0 -2
  183. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/icon.js +0 -2
  184. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.js +0 -2
  185. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-pure.js +0 -2
  186. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-social.js +0 -2
  187. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link-tile.js +0 -2
  188. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/link.js +0 -2
  189. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/marque.js +0 -2
  190. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/modal.js +0 -2
  191. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/pagination.js +0 -2
  192. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.js +0 -2
  193. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/radio-button-wrapper.js +0 -2
  194. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/required.js +0 -2
  195. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/scroller.js +0 -2
  196. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control-item.js +0 -2
  197. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/segmented-control.js +0 -2
  198. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-wrapper.js +0 -2
  199. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/spinner.js +0 -2
  200. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/state-message.js +0 -2
  201. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal-item.js +0 -2
  202. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/stepper-horizontal.js +0 -2
  203. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/switch.js +0 -2
  204. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-body.js +0 -2
  205. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-cell.js +0 -2
  206. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-cell.js +0 -2
  207. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head-row.js +0 -2
  208. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-head.js +0 -2
  209. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table-row.js +0 -2
  210. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/table.js +0 -2
  211. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-bar.js +0 -2
  212. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs-item.js +0 -2
  213. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tabs.js +0 -2
  214. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag-dismissible.js +0 -2
  215. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/tag.js +0 -2
  216. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-field-wrapper.js +0 -2
  217. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list-item.js +0 -2
  218. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text-list.js +0 -2
  219. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/text.js +0 -2
  220. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea-wrapper.js +0 -2
  221. package/ssr/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/toast.js +0 -2
  222. package/ssr/components-react/projects/react-ssr-wrapper/src/minifyCss.js +0 -2
  223. package/ssr/components-react/projects/react-ssr-wrapper/src/provider.js +0 -2
  224. package/ssr/components-react/projects/react-ssr-wrapper/src/public-api.js +0 -2
  225. package/ssr/components-react/projects/react-ssr-wrapper/src/stripFocusAndHoverStyles.js +0 -2
  226. package/ssr/components-react/projects/react-ssr-wrapper/src/utils.js +0 -2
  227. package/ssr/esm/components/dist/styles/esm/styles-entry.js +2388 -2254
  228. package/ssr/esm/components/dist/utils/esm/utils-entry.js +2219 -2032
  229. package/ssr/icons/dist/module/index.js +0 -2
  230. package/ssr/lib/components/accordion.wrapper.d.ts +1 -1
  231. package/ssr/lib/components/banner.wrapper.d.ts +1 -1
  232. package/ssr/lib/components/button-group.wrapper.d.ts +1 -1
  233. package/ssr/lib/components/button-pure.wrapper.d.ts +1 -1
  234. package/ssr/lib/components/button.wrapper.d.ts +1 -1
  235. package/ssr/lib/components/carousel.wrapper.d.ts +1 -1
  236. package/ssr/lib/components/checkbox-wrapper.wrapper.d.ts +1 -1
  237. package/ssr/lib/components/content-wrapper.wrapper.d.ts +1 -1
  238. package/ssr/lib/components/divider.wrapper.d.ts +1 -1
  239. package/ssr/lib/components/fieldset-wrapper.wrapper.d.ts +1 -1
  240. package/ssr/lib/components/flex-item.wrapper.d.ts +1 -1
  241. package/ssr/lib/components/flex.wrapper.d.ts +1 -1
  242. package/ssr/lib/components/grid-item.wrapper.d.ts +1 -1
  243. package/ssr/lib/components/grid.wrapper.d.ts +1 -1
  244. package/ssr/lib/components/headline.wrapper.d.ts +1 -1
  245. package/ssr/lib/components/icon.wrapper.d.ts +1 -1
  246. package/ssr/lib/components/inline-notification.wrapper.d.ts +1 -1
  247. package/ssr/lib/components/link-pure.wrapper.d.ts +1 -1
  248. package/ssr/lib/components/link-social.wrapper.d.ts +1 -1
  249. package/ssr/lib/components/link-tile.wrapper.d.ts +1 -1
  250. package/ssr/lib/components/link.wrapper.d.ts +1 -1
  251. package/ssr/lib/components/marque.wrapper.d.ts +1 -1
  252. package/ssr/lib/components/modal.wrapper.d.ts +1 -1
  253. package/ssr/lib/components/pagination.wrapper.d.ts +1 -1
  254. package/ssr/lib/components/popover.wrapper.d.ts +1 -1
  255. package/ssr/lib/components/radio-button-wrapper.wrapper.d.ts +1 -1
  256. package/ssr/lib/components/scroller.wrapper.d.ts +1 -1
  257. package/ssr/lib/components/segmented-control-item.wrapper.d.ts +1 -1
  258. package/ssr/lib/components/segmented-control.wrapper.d.ts +1 -1
  259. package/ssr/lib/components/select-wrapper.wrapper.d.ts +1 -1
  260. package/ssr/lib/components/spinner.wrapper.d.ts +1 -1
  261. package/ssr/lib/components/stepper-horizontal-item.wrapper.d.ts +1 -1
  262. package/ssr/lib/components/stepper-horizontal.wrapper.d.ts +1 -1
  263. package/ssr/lib/components/switch.wrapper.d.ts +1 -1
  264. package/ssr/lib/components/table-body.wrapper.d.ts +1 -1
  265. package/ssr/lib/components/table-cell.wrapper.d.ts +1 -1
  266. package/ssr/lib/components/table-head-cell.wrapper.d.ts +1 -1
  267. package/ssr/lib/components/table-head-row.wrapper.d.ts +1 -1
  268. package/ssr/lib/components/table-head.wrapper.d.ts +1 -1
  269. package/ssr/lib/components/table-row.wrapper.d.ts +1 -1
  270. package/ssr/lib/components/table.wrapper.d.ts +1 -1
  271. package/ssr/lib/components/tabs-bar.wrapper.d.ts +1 -1
  272. package/ssr/lib/components/tabs-item.wrapper.d.ts +1 -1
  273. package/ssr/lib/components/tabs.wrapper.d.ts +1 -1
  274. package/ssr/lib/components/tag-dismissible.wrapper.d.ts +1 -1
  275. package/ssr/lib/components/tag.wrapper.d.ts +1 -1
  276. package/ssr/lib/components/text-field-wrapper.wrapper.d.ts +1 -1
  277. package/ssr/lib/components/text-list-item.wrapper.d.ts +1 -1
  278. package/ssr/lib/components/text-list.wrapper.d.ts +1 -1
  279. package/ssr/lib/components/text.wrapper.d.ts +1 -1
  280. package/ssr/lib/components/textarea-wrapper.wrapper.d.ts +1 -1
  281. package/ssr/lib/components/toast.wrapper.d.ts +1 -1
  282. package/ssr/lib/dsr-components/button-pure.d.ts +0 -4
  283. package/ssr/lib/dsr-components/headline.d.ts +0 -1
  284. package/ssr/lib/dsr-components/link-pure.d.ts +0 -4
  285. package/ssr/lib/dsr-components/select-wrapper-dropdown.d.ts +0 -1
  286. package/ssr/lib/dsr-components/state-message.d.ts +1 -1
  287. package/ssr/lib/dsr-components/switch.d.ts +1 -1
  288. package/ssr/lib/dsr-components/text.d.ts +0 -1
  289. package/ssr/lib/types.d.ts +5 -5
  290. package/ssr/provider.d.ts +1 -1
  291. package/testing/index.js +0 -2
  292. package/testing.d.ts +1 -1
  293. package/utilities/js/index.js +0 -2
  294. package/utils.js +0 -2
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  /* eslint-disable prefer-arrow/prefer-arrow-functions */
6
4
  function getClosestHTMLElement(element, selector) {
7
5
  return element === null || element === void 0 ? void 0 : element.closest(selector);
@@ -120,6 +118,8 @@ const fontHyphenation = {
120
118
  hyphens: 'auto',
121
119
  };
122
120
 
121
+ const fontLineHeight = 'calc(6px + 2.125ex)'; // float px values may render differently on different browsers
122
+
123
123
  const fontWeight = {
124
124
  thin: 100,
125
125
  regular: 400,
@@ -132,13 +132,13 @@ const fontStyle = 'normal';
132
132
  const fontVariant = 'normal';
133
133
 
134
134
  const textXSmall = {
135
- font: `${fontStyle} ${fontVariant} ${fontWeight.regular} 0.75rem/1.6666666667 ${fontFamily}`,
135
+ font: `${fontStyle} ${fontVariant} ${fontWeight.regular} 0.75rem/${fontLineHeight} ${fontFamily}`,
136
136
  ...fontBehavior,
137
137
  ...fontHyphenation,
138
138
  };
139
139
 
140
140
  const textSmall = {
141
- font: `${fontStyle} ${fontVariant} ${fontWeight.regular} 1rem/1.5 ${fontFamily}`,
141
+ font: `${fontStyle} ${fontVariant} ${fontWeight.regular} 1rem/${fontLineHeight} ${fontFamily}`,
142
142
  ...fontBehavior,
143
143
  ...fontHyphenation,
144
144
  };
@@ -247,73 +247,206 @@ hasWindow &&
247
247
  .forEach((node) => childrenMutationMap.get(node)());
248
248
  });
249
249
 
250
- const getRole = (state) => {
251
- return state === 'error' ? 'alert' : state === 'success' ? 'status' : null;
252
- };
250
+ /* eslint-disable no-undefined,no-param-reassign,no-shadow */
253
251
 
254
- [
255
- { name: 'Model', id: 'model' },
256
- { name: 'Interest', id: 'interest' },
257
- { name: 'VIN', id: 'vin' },
258
- { name: 'Purchase Intention', id: 'purchaseIntention' },
259
- { name: 'Status', id: 'status' },
260
- { name: 'Comment', id: 'comment' },
261
- { name: 'Lead ID', id: 'leadId' },
262
- { name: 'Action', id: 'action', hideLabel: true },
263
- ].map((item, i) => ({
264
- ...item,
265
- ...(i > 0 &&
266
- i < 7 &&
267
- i !== 5 && {
268
- active: i === 1,
269
- direction: 'asc',
270
- }),
271
- }));
252
+ /**
253
+ * Throttle execution of a function. Especially useful for rate limiting
254
+ * execution of handlers on events like resize and scroll.
255
+ *
256
+ * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
257
+ * are most useful.
258
+ * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
259
+ * as-is, to `callback` when the throttled-function is executed.
260
+ * @param {object} [options] - An object to configure options.
261
+ * @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
262
+ * while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
263
+ * one final time after the last throttled-function call. (After the throttled-function has not been called for
264
+ * `delay` milliseconds, the internal counter is reset).
265
+ * @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
266
+ * immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
267
+ * callback will never executed if both noLeading = true and noTrailing = true.
268
+ * @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
269
+ * false (at end), schedule `callback` to execute after `delay` ms.
270
+ *
271
+ * @returns {Function} A new, throttled, function.
272
+ */
273
+ function throttle (delay, callback, options) {
274
+ var _ref = options || {},
275
+ _ref$noTrailing = _ref.noTrailing,
276
+ noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
277
+ _ref$noLeading = _ref.noLeading,
278
+ noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
279
+ _ref$debounceMode = _ref.debounceMode,
280
+ debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
281
+ /*
282
+ * After wrapper has stopped being called, this timeout ensures that
283
+ * `callback` is executed at the proper times in `throttle` and `end`
284
+ * debounce modes.
285
+ */
272
286
 
273
- [
274
- { name: 'Column 1', id: 'col1' },
275
- { name: 'Column 2', id: 'col2' },
276
- { name: 'Column 3', id: 'col3' },
277
- ].map((item, i) => ({
278
- ...item,
279
- active: i === 1,
280
- direction: 'asc',
281
- }));
282
287
 
283
- Array.from(Array(4)).map(() => ({
284
- imageUrl: 'https://nav.porsche.com/00BC524/series-assets/1366/911@2x.jpg',
285
- imageWidth: 80,
286
- imageHeight: 48,
287
- html: "<a href='#'>link</a>&nbsp;<b>bold</b>&nbsp;<i>italic</i>&nbsp;<strong>strong</strong>&nbsp;<em>emphasized</em>",
288
- longText: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr',
289
- shortText: 'Some text',
290
- }));
288
+ var timeoutID;
289
+ var cancelled = false; // Keep track of the last time `callback` was executed.
290
+
291
+ var lastExec = 0; // Function to clear existing timeout
292
+
293
+ function clearExistingTimeout() {
294
+ if (timeoutID) {
295
+ clearTimeout(timeoutID);
296
+ }
297
+ } // Function to cancel next exec
298
+
299
+
300
+ function cancel(options) {
301
+ var _ref2 = options || {},
302
+ _ref2$upcomingOnly = _ref2.upcomingOnly,
303
+ upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
304
+
305
+ clearExistingTimeout();
306
+ cancelled = !upcomingOnly;
307
+ }
308
+ /*
309
+ * The `wrapper` function encapsulates all of the throttling / debouncing
310
+ * functionality and when executed will limit the rate at which `callback`
311
+ * is executed.
312
+ */
313
+
314
+
315
+ function wrapper() {
316
+ for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
317
+ arguments_[_key] = arguments[_key];
318
+ }
319
+
320
+ var self = this;
321
+ var elapsed = Date.now() - lastExec;
322
+
323
+ if (cancelled) {
324
+ return;
325
+ } // Execute `callback` and update the `lastExec` timestamp.
326
+
327
+
328
+ function exec() {
329
+ lastExec = Date.now();
330
+ callback.apply(self, arguments_);
331
+ }
332
+ /*
333
+ * If `debounceMode` is true (at begin) this is used to clear the flag
334
+ * to allow future `callback` executions.
335
+ */
336
+
337
+
338
+ function clear() {
339
+ timeoutID = undefined;
340
+ }
341
+
342
+ if (!noLeading && debounceMode && !timeoutID) {
343
+ /*
344
+ * Since `wrapper` is being called for the first time and
345
+ * `debounceMode` is true (at begin), execute `callback`
346
+ * and noLeading != true.
347
+ */
348
+ exec();
349
+ }
350
+
351
+ clearExistingTimeout();
352
+
353
+ if (debounceMode === undefined && elapsed > delay) {
354
+ if (noLeading) {
355
+ /*
356
+ * In throttle mode with noLeading, if `delay` time has
357
+ * been exceeded, update `lastExec` and schedule `callback`
358
+ * to execute after `delay` ms.
359
+ */
360
+ lastExec = Date.now();
361
+
362
+ if (!noTrailing) {
363
+ timeoutID = setTimeout(debounceMode ? clear : exec, delay);
364
+ }
365
+ } else {
366
+ /*
367
+ * In throttle mode without noLeading, if `delay` time has been exceeded, execute
368
+ * `callback`.
369
+ */
370
+ exec();
371
+ }
372
+ } else if (noTrailing !== true) {
373
+ /*
374
+ * In trailing throttle mode, since `delay` time has not been
375
+ * exceeded, schedule `callback` to execute `delay` ms after most
376
+ * recent execution.
377
+ *
378
+ * If `debounceMode` is true (at begin), schedule `clear` to execute
379
+ * after `delay` ms.
380
+ *
381
+ * If `debounceMode` is false (at end), schedule `callback` to
382
+ * execute after `delay` ms.
383
+ */
384
+ timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
385
+ }
386
+ }
387
+
388
+ wrapper.cancel = cancel; // Return the wrapper function.
389
+
390
+ return wrapper;
391
+ }
392
+
393
+ /* eslint-disable no-undefined */
394
+ /**
395
+ * Debounce execution of a function. Debouncing, unlike throttling,
396
+ * guarantees that a function is only executed a single time, either at the
397
+ * very beginning of a series of calls, or at the very end.
398
+ *
399
+ * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
400
+ * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
401
+ * to `callback` when the debounced-function is executed.
402
+ * @param {object} [options] - An object to configure options.
403
+ * @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
404
+ * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
405
+ * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
406
+ *
407
+ * @returns {Function} A new, debounced function.
408
+ */
409
+
410
+ function debounce (delay, callback, options) {
411
+ var _ref = options || {},
412
+ _ref$atBegin = _ref.atBegin,
413
+ atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
414
+
415
+ return throttle(delay, callback, {
416
+ debounceMode: atBegin !== false
417
+ });
418
+ }
419
+ debounce(800, (el, ariaElement) => {
420
+ ariaElement.innerText = `You have ${el.maxLength - el.value.length} out of ${el.maxLength} characters left`;
421
+ });
422
+
423
+ const getRole = (state) => {
424
+ return state === 'error' ? 'alert' : state === 'success' ? 'status' : null;
425
+ };
291
426
 
292
427
  function _extends() {
293
428
  _extends = Object.assign ? Object.assign.bind() : function (target) {
294
429
  for (var i = 1; i < arguments.length; i++) {
295
430
  var source = arguments[i];
296
-
297
431
  for (var key in source) {
298
432
  if (Object.prototype.hasOwnProperty.call(source, key)) {
299
433
  target[key] = source[key];
300
434
  }
301
435
  }
302
436
  }
303
-
304
437
  return target;
305
438
  };
306
439
  return _extends.apply(this, arguments);
307
440
  }
308
441
 
309
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
442
+ var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
310
443
 
311
- var isBrowser = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object' && document.nodeType === 9;
444
+ var isBrowser = (typeof window === "undefined" ? "undefined" : _typeof$1(window)) === "object" && (typeof document === "undefined" ? "undefined" : _typeof$1(document)) === 'object' && document.nodeType === 9;
312
445
 
313
446
  var module$1 = /*#__PURE__*/Object.freeze({
314
447
  __proto__: null,
315
448
  isBrowser: isBrowser,
316
- 'default': isBrowser
449
+ default: isBrowser
317
450
  });
318
451
 
319
452
  var isProduction = process.env.NODE_ENV === 'production';
@@ -335,16 +468,41 @@ function warning(condition, message) {
335
468
  }
336
469
  }
337
470
 
471
+ function _typeof(obj) {
472
+ "@babel/helpers - typeof";
473
+
474
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
475
+ return typeof obj;
476
+ } : function (obj) {
477
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
478
+ }, _typeof(obj);
479
+ }
480
+
481
+ function _toPrimitive(input, hint) {
482
+ if (_typeof(input) !== "object" || input === null) return input;
483
+ var prim = input[Symbol.toPrimitive];
484
+ if (prim !== undefined) {
485
+ var res = prim.call(input, hint || "default");
486
+ if (_typeof(res) !== "object") return res;
487
+ throw new TypeError("@@toPrimitive must return a primitive value.");
488
+ }
489
+ return (hint === "string" ? String : Number)(input);
490
+ }
491
+
492
+ function _toPropertyKey(arg) {
493
+ var key = _toPrimitive(arg, "string");
494
+ return _typeof(key) === "symbol" ? key : String(key);
495
+ }
496
+
338
497
  function _defineProperties(target, props) {
339
498
  for (var i = 0; i < props.length; i++) {
340
499
  var descriptor = props[i];
341
500
  descriptor.enumerable = descriptor.enumerable || false;
342
501
  descriptor.configurable = true;
343
502
  if ("value" in descriptor) descriptor.writable = true;
344
- Object.defineProperty(target, descriptor.key, descriptor);
503
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
345
504
  }
346
505
  }
347
-
348
506
  function _createClass(Constructor, protoProps, staticProps) {
349
507
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
350
508
  if (staticProps) _defineProperties(Constructor, staticProps);
@@ -372,7 +530,6 @@ function _assertThisInitialized(self) {
372
530
  if (self === void 0) {
373
531
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
374
532
  }
375
-
376
533
  return self;
377
534
  }
378
535
 
@@ -381,13 +538,11 @@ function _objectWithoutPropertiesLoose(source, excluded) {
381
538
  var target = {};
382
539
  var sourceKeys = Object.keys(source);
383
540
  var key, i;
384
-
385
541
  for (i = 0; i < sourceKeys.length; i++) {
386
542
  key = sourceKeys[i];
387
543
  if (excluded.indexOf(key) >= 0) continue;
388
544
  target[key] = source[key];
389
545
  }
390
-
391
546
  return target;
392
547
  }
393
548
 
@@ -2672,7 +2827,7 @@ var index = createJss();
2672
2827
 
2673
2828
  var jss_esm = /*#__PURE__*/Object.freeze({
2674
2829
  __proto__: null,
2675
- 'default': index,
2830
+ default: index,
2676
2831
  RuleList: RuleList,
2677
2832
  SheetsManager: SheetsManager,
2678
2833
  SheetsRegistry: SheetsRegistry,
@@ -2685,187 +2840,106 @@ var jss_esm = /*#__PURE__*/Object.freeze({
2685
2840
  toCssValue: toCssValue
2686
2841
  });
2687
2842
 
2688
- var now = Date.now();
2689
- var fnValuesNs = "fnValues" + now;
2690
- var fnRuleNs = "fnStyle" + ++now;
2843
+ function getAugmentedNamespace(n) {
2844
+ var f = n.default;
2845
+ if (typeof f == "function") {
2846
+ var a = function a () {
2847
+ if (this instanceof a) {
2848
+ var args = [null];
2849
+ args.push.apply(args, arguments);
2850
+ var Ctor = Function.bind.apply(f, args);
2851
+ return new Ctor();
2852
+ }
2853
+ return f.apply(this, arguments);
2854
+ };
2855
+ a.prototype = f.prototype;
2856
+ } else a = {};
2857
+ Object.defineProperty(a, '__esModule', {value: true});
2858
+ Object.keys(n).forEach(function (k) {
2859
+ var d = Object.getOwnPropertyDescriptor(n, k);
2860
+ Object.defineProperty(a, k, d.get ? d : {
2861
+ enumerable: true,
2862
+ get: function () {
2863
+ return n[k];
2864
+ }
2865
+ });
2866
+ });
2867
+ return a;
2868
+ }
2691
2869
 
2692
- var functionPlugin = function functionPlugin() {
2693
- return {
2694
- onCreateRule: function onCreateRule(name, decl, options) {
2695
- if (typeof decl !== 'function') return null;
2696
- var rule = createRule(name, {}, options);
2697
- rule[fnRuleNs] = decl;
2698
- return rule;
2699
- },
2700
- onProcessStyle: function onProcessStyle(style, rule) {
2701
- // We need to extract function values from the declaration, so that we can keep core unaware of them.
2702
- // We need to do that only once.
2703
- // We don't need to extract functions on each style update, since this can happen only once.
2704
- // We don't support function values inside of function rules.
2705
- if (fnValuesNs in rule || fnRuleNs in rule) return style;
2706
- var fnValues = {};
2870
+ /* eslint-disable no-var, prefer-template */
2871
+ var uppercasePattern = /[A-Z]/g;
2872
+ var msPattern = /^ms-/;
2873
+ var cache$2 = {};
2707
2874
 
2708
- for (var prop in style) {
2709
- var value = style[prop];
2710
- if (typeof value !== 'function') continue;
2711
- delete style[prop];
2712
- fnValues[prop] = value;
2713
- }
2875
+ function toHyphenLower(match) {
2876
+ return '-' + match.toLowerCase()
2877
+ }
2714
2878
 
2715
- rule[fnValuesNs] = fnValues;
2716
- return style;
2717
- },
2718
- onUpdate: function onUpdate(data, rule, sheet, options) {
2719
- var styleRule = rule;
2720
- var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object
2721
- // will be returned from that function.
2879
+ function hyphenateStyleName(name) {
2880
+ if (cache$2.hasOwnProperty(name)) {
2881
+ return cache$2[name]
2882
+ }
2722
2883
 
2723
- if (fnRule) {
2724
- // Empty object will remove all currently defined props
2725
- // in case function rule returns a falsy value.
2726
- styleRule.style = fnRule(data) || {};
2884
+ var hName = name.replace(uppercasePattern, toHyphenLower);
2885
+ return (cache$2[name] = msPattern.test(hName) ? '-' + hName : hName)
2886
+ }
2727
2887
 
2728
- if (process.env.NODE_ENV === 'development') {
2729
- for (var prop in styleRule.style) {
2730
- if (typeof styleRule.style[prop] === 'function') {
2731
- process.env.NODE_ENV !== "production" ? warning(false, '[JSS] Function values inside function rules are not supported.') : void 0;
2732
- break;
2733
- }
2734
- }
2735
- }
2736
- }
2888
+ var index_cjs = hyphenateStyleName;
2737
2889
 
2738
- var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values.
2890
+ /**
2891
+ * Convert camel cased property names to dash separated.
2892
+ */
2739
2893
 
2740
- if (fnValues) {
2741
- for (var _prop in fnValues) {
2742
- styleRule.prop(_prop, fnValues[_prop](data), options);
2743
- }
2744
- }
2745
- }
2746
- };
2747
- };
2894
+ function convertCase(style) {
2895
+ var converted = {};
2748
2896
 
2749
- function symbolObservablePonyfill(root) {
2750
- var result;
2751
- var Symbol = root.Symbol;
2897
+ for (var prop in style) {
2898
+ var key = prop.indexOf('--') === 0 ? prop : index_cjs(prop);
2899
+ converted[key] = style[prop];
2900
+ }
2752
2901
 
2753
- if (typeof Symbol === 'function') {
2754
- if (Symbol.observable) {
2755
- result = Symbol.observable;
2756
- } else {
2757
- result = Symbol('observable');
2758
- Symbol.observable = result;
2759
- }
2760
- } else {
2761
- result = '@@observable';
2762
- }
2902
+ if (style.fallbacks) {
2903
+ if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);
2904
+ }
2763
2905
 
2764
- return result;
2906
+ return converted;
2765
2907
  }
2908
+ /**
2909
+ * Allow camel cased property names by converting them back to dasherized.
2910
+ */
2766
2911
 
2767
- /* global window */
2768
2912
 
2769
- var root;
2913
+ function camelCase() {
2914
+ function onProcessStyle(style) {
2915
+ if (Array.isArray(style)) {
2916
+ // Handle rules like @font-face, which can have multiple styles in an array
2917
+ for (var index = 0; index < style.length; index++) {
2918
+ style[index] = convertCase(style[index]);
2919
+ }
2770
2920
 
2771
- if (typeof self !== 'undefined') {
2772
- root = self;
2773
- } else if (typeof window !== 'undefined') {
2774
- root = window;
2775
- } else if (typeof global !== 'undefined') {
2776
- root = global;
2777
- } else if (typeof module !== 'undefined') {
2778
- root = module;
2779
- } else {
2780
- root = Function('return this')();
2781
- }
2921
+ return style;
2922
+ }
2782
2923
 
2783
- var result = symbolObservablePonyfill(root);
2924
+ return convertCase(style);
2925
+ }
2784
2926
 
2785
- var isObservable = function isObservable(value) {
2786
- return value && value[result] && value === value[result]();
2787
- };
2927
+ function onChangeValue(value, prop, rule) {
2928
+ if (prop.indexOf('--') === 0) {
2929
+ return value;
2930
+ }
2788
2931
 
2789
- var observablePlugin = function observablePlugin(updateOptions) {
2790
- return {
2791
- onCreateRule: function onCreateRule(name, decl, options) {
2792
- if (!isObservable(decl)) return null;
2793
- var style$ = decl;
2794
- var rule = createRule(name, {}, options); // TODO
2795
- // Call `stream.subscribe()` returns a subscription, which should be explicitly
2796
- // unsubscribed from when we know this sheet is no longer needed.
2797
-
2798
- style$.subscribe(function (style) {
2799
- for (var prop in style) {
2800
- rule.prop(prop, style[prop], updateOptions);
2801
- }
2802
- });
2803
- return rule;
2804
- },
2805
- onProcessRule: function onProcessRule(rule) {
2806
- if (rule && rule.type !== 'style') return;
2807
- var styleRule = rule;
2808
- var style = styleRule.style;
2809
-
2810
- var _loop = function _loop(prop) {
2811
- var value = style[prop];
2812
- if (!isObservable(value)) return "continue";
2813
- delete style[prop];
2814
- value.subscribe({
2815
- next: function next(nextValue) {
2816
- styleRule.prop(prop, nextValue, updateOptions);
2817
- }
2818
- });
2819
- };
2820
-
2821
- for (var prop in style) {
2822
- var _ret = _loop(prop);
2823
-
2824
- if (_ret === "continue") continue;
2825
- }
2826
- }
2827
- };
2828
- };
2829
-
2830
- var semiWithNl = /;\n/;
2831
- /**
2832
- * Naive CSS parser.
2833
- * - Supports only rule body (no selectors)
2834
- * - Requires semicolon and new line after the value (except of last line)
2835
- * - No nested rules support
2836
- */
2837
-
2838
- var parse = function parse(cssText) {
2839
- var style = {};
2840
- var split = cssText.split(semiWithNl);
2841
-
2842
- for (var i = 0; i < split.length; i++) {
2843
- var decl = (split[i] || '').trim();
2844
- if (!decl) continue;
2845
- var colonIndex = decl.indexOf(':');
2846
-
2847
- if (colonIndex === -1) {
2848
- process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Malformed CSS string \"" + decl + "\"") : void 0;
2849
- continue;
2850
- }
2851
-
2852
- var prop = decl.substr(0, colonIndex).trim();
2853
- var value = decl.substr(colonIndex + 1).trim();
2854
- style[prop] = value;
2855
- }
2932
+ var hyphenatedProp = index_cjs(prop); // There was no camel case in place
2856
2933
 
2857
- return style;
2858
- };
2934
+ if (prop === hyphenatedProp) return value;
2935
+ rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.
2859
2936
 
2860
- var onProcessRule = function onProcessRule(rule) {
2861
- if (typeof rule.style === 'string') {
2862
- rule.style = parse(rule.style);
2937
+ return null;
2863
2938
  }
2864
- };
2865
2939
 
2866
- function templatePlugin() {
2867
2940
  return {
2868
- onProcessRule: onProcessRule
2941
+ onProcessStyle: onProcessStyle,
2942
+ onChangeValue: onChangeValue
2869
2943
  };
2870
2944
  }
2871
2945
 
@@ -3051,138 +3125,6 @@ function jssGlobal() {
3051
3125
  };
3052
3126
  }
3053
3127
 
3054
- var isObject$1 = function isObject(obj) {
3055
- return obj && typeof obj === 'object' && !Array.isArray(obj);
3056
- };
3057
-
3058
- var valueNs = "extendCurrValue" + Date.now();
3059
-
3060
- function mergeExtend(style, rule, sheet, newStyle) {
3061
- var extendType = typeof style.extend; // Extend using a rule name.
3062
-
3063
- if (extendType === 'string') {
3064
- if (!sheet) return;
3065
- var refRule = sheet.getRule(style.extend);
3066
- if (!refRule) return;
3067
-
3068
- if (refRule === rule) {
3069
- process.env.NODE_ENV !== "production" ? warning(false, "[JSS] A rule tries to extend itself \n" + rule.toString()) : void 0;
3070
- return;
3071
- }
3072
-
3073
- var parent = refRule.options.parent;
3074
-
3075
- if (parent) {
3076
- var originalStyle = parent.rules.raw[style.extend];
3077
- extend(originalStyle, rule, sheet, newStyle);
3078
- }
3079
-
3080
- return;
3081
- } // Extend using an array.
3082
-
3083
-
3084
- if (Array.isArray(style.extend)) {
3085
- for (var index = 0; index < style.extend.length; index++) {
3086
- var singleExtend = style.extend[index];
3087
- var singleStyle = typeof singleExtend === 'string' ? _extends({}, style, {
3088
- extend: singleExtend
3089
- }) : style.extend[index];
3090
- extend(singleStyle, rule, sheet, newStyle);
3091
- }
3092
-
3093
- return;
3094
- } // Extend is a style object.
3095
-
3096
-
3097
- for (var prop in style.extend) {
3098
- if (prop === 'extend') {
3099
- extend(style.extend.extend, rule, sheet, newStyle);
3100
- continue;
3101
- }
3102
-
3103
- if (isObject$1(style.extend[prop])) {
3104
- if (!(prop in newStyle)) newStyle[prop] = {};
3105
- extend(style.extend[prop], rule, sheet, newStyle[prop]);
3106
- continue;
3107
- }
3108
-
3109
- newStyle[prop] = style.extend[prop];
3110
- }
3111
- }
3112
-
3113
- function mergeRest(style, rule, sheet, newStyle) {
3114
- // Copy base style.
3115
- for (var prop in style) {
3116
- if (prop === 'extend') continue;
3117
-
3118
- if (isObject$1(newStyle[prop]) && isObject$1(style[prop])) {
3119
- extend(style[prop], rule, sheet, newStyle[prop]);
3120
- continue;
3121
- }
3122
-
3123
- if (isObject$1(style[prop])) {
3124
- newStyle[prop] = extend(style[prop], rule, sheet);
3125
- continue;
3126
- }
3127
-
3128
- newStyle[prop] = style[prop];
3129
- }
3130
- }
3131
- /**
3132
- * Recursively extend styles.
3133
- */
3134
-
3135
-
3136
- function extend(style, rule, sheet, newStyle) {
3137
- if (newStyle === void 0) {
3138
- newStyle = {};
3139
- }
3140
-
3141
- mergeExtend(style, rule, sheet, newStyle);
3142
- mergeRest(style, rule, sheet, newStyle);
3143
- return newStyle;
3144
- }
3145
- /**
3146
- * Handle `extend` property.
3147
- */
3148
-
3149
-
3150
- function jssExtend() {
3151
- function onProcessStyle(style, rule, sheet) {
3152
- if ('extend' in style) return extend(style, rule, sheet);
3153
- return style;
3154
- }
3155
-
3156
- function onChangeValue(value, prop, rule) {
3157
- if (prop !== 'extend') return value; // Value is empty, remove properties set previously.
3158
-
3159
- if (value == null || value === false) {
3160
- for (var key in rule[valueNs]) {
3161
- rule.prop(key, null);
3162
- }
3163
-
3164
- rule[valueNs] = null;
3165
- return null;
3166
- }
3167
-
3168
- if (typeof value === 'object') {
3169
- for (var _key in value) {
3170
- rule.prop(_key, value[_key]);
3171
- }
3172
-
3173
- rule[valueNs] = value;
3174
- } // Make sure we don't set the value in the core.
3175
-
3176
-
3177
- return null;
3178
- }
3179
-
3180
- return {
3181
- onProcessStyle: onProcessStyle,
3182
- onChangeValue: onChangeValue
3183
- };
3184
- }
3185
-
3186
3128
  var separatorRegExp = /\s*,\s*/g;
3187
3129
  var parentRegExp = /&/g;
3188
3130
  var refRegExp = /\$([\w-]+)/g;
@@ -3292,1953 +3234,2299 @@ function jssNested() {
3292
3234
  };
3293
3235
  }
3294
3236
 
3295
- /**
3296
- * Set selector.
3297
- *
3298
- * @param original rule
3299
- * @param className class string
3300
- * @return flag indicating function was successfull or not
3301
- */
3302
-
3303
- function registerClass(rule, className) {
3304
- // Skip falsy values
3305
- if (!className) return true; // Support array of class names `{composes: ['foo', 'bar']}`
3306
-
3307
- if (Array.isArray(className)) {
3308
- for (var index = 0; index < className.length; index++) {
3309
- var isSetted = registerClass(rule, className[index]);
3310
- if (!isSetted) return false;
3311
- }
3312
-
3313
- return true;
3314
- } // Support space separated class names `{composes: 'foo bar'}`
3237
+ var _tslib$1 = {};
3315
3238
 
3239
+ (function (exports) {
3316
3240
 
3317
- if (className.indexOf(' ') > -1) {
3318
- return registerClass(rule, className.split(' '));
3319
- }
3241
+ Object.defineProperty(exports, '__esModule', { value: true });
3320
3242
 
3321
- var parent = rule.options.parent; // It is a ref to a local rule.
3243
+ /*! *****************************************************************************
3244
+ Copyright (c) Microsoft Corporation.
3322
3245
 
3323
- if (className[0] === '$') {
3324
- var refRule = parent.getRule(className.substr(1));
3246
+ Permission to use, copy, modify, and/or distribute this software for any
3247
+ purpose with or without fee is hereby granted.
3325
3248
 
3326
- if (!refRule) {
3327
- process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Referenced rule is not defined. \n" + rule.toString()) : void 0;
3328
- return false;
3329
- }
3249
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
3250
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3251
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
3252
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
3253
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
3254
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
3255
+ PERFORMANCE OF THIS SOFTWARE.
3256
+ ***************************************************************************** */
3330
3257
 
3331
- if (refRule === rule) {
3332
- process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Cyclic composition detected. \n" + rule.toString()) : void 0;
3333
- return false;
3334
- }
3258
+ exports.__assign = function () {
3259
+ exports.__assign =
3260
+ Object.assign ||
3261
+ function __assign(t) {
3262
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
3263
+ s = arguments[i];
3264
+ for (var p in s)
3265
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
3266
+ }
3267
+ return t;
3268
+ };
3269
+ return exports.__assign.apply(this, arguments);
3270
+ };
3271
+ } (_tslib$1));
3335
3272
 
3336
- parent.classes[rule.key] += " " + parent.classes[refRule.key];
3337
- return true;
3338
- }
3273
+ var require$$1 = /*@__PURE__*/getAugmentedNamespace(jss_esm);
3339
3274
 
3340
- parent.classes[rule.key] += " " + className;
3341
- return true;
3342
- }
3343
3275
  /**
3344
- * Convert compose property to additional class, remove property from original styles.
3276
+ * The custom `sort` method for
3277
+ * for the [`css-mqpacker`](https://www.npmjs.com/package/css-mqpacker) or
3278
+ * [`pleeease`](https://www.npmjs.com/package/pleeease) which using `css-mqpacker`
3279
+ * or, perhaps, something else ))
3280
+ *
3281
+ * @module sort-css-media-queries
3282
+ * @author Oleg Dutchenko <dutchenko.o.wezom@gmail.com>
3283
+ * @version 1.5.0
3345
3284
  */
3346
3285
 
3286
+ // ----------------------------------------
3287
+ // Private
3288
+ // ----------------------------------------
3347
3289
 
3348
- function jssCompose() {
3349
- function onProcessStyle(style, rule) {
3350
- if (!('composes' in style)) return style;
3351
- registerClass(rule, style.composes); // Remove composes property to prevent infinite loop.
3290
+ const minMaxWidth = /(!?\(\s*min(-device-)?-width)(.|\n)+\(\s*max(-device)?-width/i;
3291
+ const minWidth = /\(\s*min(-device)?-width/i;
3292
+ const maxMinWidth = /(!?\(\s*max(-device)?-width)(.|\n)+\(\s*min(-device)?-width/i;
3293
+ const maxWidth = /\(\s*max(-device)?-width/i;
3352
3294
 
3353
- delete style.composes;
3354
- return style;
3295
+ const isMinWidth = _testQuery(minMaxWidth, maxMinWidth, minWidth);
3296
+ const isMaxWidth = _testQuery(maxMinWidth, minMaxWidth, maxWidth);
3297
+
3298
+ const minMaxHeight = /(!?\(\s*min(-device)?-height)(.|\n)+\(\s*max(-device)?-height/i;
3299
+ const minHeight = /\(\s*min(-device)?-height/i;
3300
+ const maxMinHeight = /(!?\(\s*max(-device)?-height)(.|\n)+\(\s*min(-device)?-height/i;
3301
+ const maxHeight = /\(\s*max(-device)?-height/i;
3302
+
3303
+ const isMinHeight = _testQuery(minMaxHeight, maxMinHeight, minHeight);
3304
+ const isMaxHeight = _testQuery(maxMinHeight, minMaxHeight, maxHeight);
3305
+
3306
+ const isPrint = /print/i;
3307
+ const isPrintOnly = /^print$/i;
3308
+
3309
+ const maxValue = Number.MAX_VALUE;
3310
+
3311
+ /**
3312
+ * Obtain the length of the media request in pixels.
3313
+ * Copy from original source `function inspectLength (length)`
3314
+ * {@link https://github.com/hail2u/node-css-mqpacker/blob/master/index.js#L58}
3315
+ * @private
3316
+ * @param {string} length
3317
+ * @return {number}
3318
+ */
3319
+ function _getQueryLength (length) {
3320
+ length = /(-?\d*\.?\d+)(ch|em|ex|px|rem)/.exec(length);
3321
+
3322
+ if (length === null) {
3323
+ return maxValue
3355
3324
  }
3356
3325
 
3357
- return {
3358
- onProcessStyle: onProcessStyle
3359
- };
3360
- }
3326
+ let number = length[1];
3327
+ const unit = length[2];
3361
3328
 
3362
- function getAugmentedNamespace(n) {
3363
- var f = n.default;
3364
- if (typeof f == "function") {
3365
- var a = function () {
3366
- return f.apply(this, arguments);
3367
- };
3368
- a.prototype = f.prototype;
3369
- } else a = {};
3370
- Object.defineProperty(a, '__esModule', {value: true});
3371
- Object.keys(n).forEach(function (k) {
3372
- var d = Object.getOwnPropertyDescriptor(n, k);
3373
- Object.defineProperty(a, k, d.get ? d : {
3374
- enumerable: true,
3375
- get: function () {
3376
- return n[k];
3377
- }
3378
- });
3379
- });
3380
- return a;
3381
- }
3329
+ switch (unit) {
3330
+ case 'ch':
3331
+ number = parseFloat(number) * 8.8984375;
3332
+ break
3382
3333
 
3383
- /* eslint-disable no-var, prefer-template */
3384
- var uppercasePattern = /[A-Z]/g;
3385
- var msPattern = /^ms-/;
3386
- var cache$2 = {};
3334
+ case 'em':
3335
+ case 'rem':
3336
+ number = parseFloat(number) * 16;
3337
+ break
3387
3338
 
3388
- function toHyphenLower(match) {
3389
- return '-' + match.toLowerCase()
3390
- }
3339
+ case 'ex':
3340
+ number = parseFloat(number) * 8.296875;
3341
+ break
3391
3342
 
3392
- function hyphenateStyleName(name) {
3393
- if (cache$2.hasOwnProperty(name)) {
3394
- return cache$2[name]
3343
+ case 'px':
3344
+ number = parseFloat(number);
3345
+ break
3395
3346
  }
3396
3347
 
3397
- var hName = name.replace(uppercasePattern, toHyphenLower);
3398
- return (cache$2[name] = msPattern.test(hName) ? '-' + hName : hName)
3348
+ return +number
3399
3349
  }
3400
3350
 
3401
- var index_cjs = hyphenateStyleName;
3351
+ /**
3352
+ * Wrapper for creating test functions
3353
+ * @private
3354
+ * @param {RegExp} doubleTestTrue
3355
+ * @param {RegExp} doubleTestFalse
3356
+ * @param {RegExp} singleTest
3357
+ * @return {Function}
3358
+ */
3359
+ function _testQuery (doubleTestTrue, doubleTestFalse, singleTest) {
3360
+ /**
3361
+ * @param {string} query
3362
+ * @return {boolean}
3363
+ */
3364
+ return function (query) {
3365
+ if (doubleTestTrue.test(query)) {
3366
+ return true
3367
+ } else if (doubleTestFalse.test(query)) {
3368
+ return false
3369
+ }
3370
+ return singleTest.test(query)
3371
+ }
3372
+ }
3402
3373
 
3403
3374
  /**
3404
- * Convert camel cased property names to dash separated.
3375
+ * @private
3376
+ * @param {string} a
3377
+ * @param {string} b
3378
+ * @return {number|null}
3405
3379
  */
3380
+ function _testIsPrint (a, b) {
3381
+ const isPrintA = isPrint.test(a);
3382
+ const isPrintOnlyA = isPrintOnly.test(a);
3406
3383
 
3407
- function convertCase(style) {
3408
- var converted = {};
3384
+ const isPrintB = isPrint.test(b);
3385
+ const isPrintOnlyB = isPrintOnly.test(b);
3409
3386
 
3410
- for (var prop in style) {
3411
- var key = prop.indexOf('--') === 0 ? prop : index_cjs(prop);
3412
- converted[key] = style[prop];
3387
+ if (isPrintA && isPrintB) {
3388
+ if (!isPrintOnlyA && isPrintOnlyB) {
3389
+ return 1
3390
+ }
3391
+ if (isPrintOnlyA && !isPrintOnlyB) {
3392
+ return -1
3393
+ }
3394
+ return a.localeCompare(b)
3413
3395
  }
3414
-
3415
- if (style.fallbacks) {
3416
- if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);
3396
+ if (isPrintA) {
3397
+ return 1
3398
+ }
3399
+ if (isPrintB) {
3400
+ return -1
3417
3401
  }
3418
3402
 
3419
- return converted;
3403
+ return null
3420
3404
  }
3405
+
3406
+ // ----------------------------------------
3407
+ // Public
3408
+ // ----------------------------------------
3409
+
3421
3410
  /**
3422
- * Allow camel cased property names by converting them back to dasherized.
3411
+ * Sorting an array with media queries
3412
+ * according to the mobile-first methodology.
3413
+ * @param {string} a
3414
+ * @param {string} b
3415
+ * @return {number} 1 / 0 / -1
3423
3416
  */
3417
+ function sortCSSmq$1 (a, b) {
3418
+ const testIsPrint = _testIsPrint(a, b);
3419
+ if (testIsPrint !== null) {
3420
+ return testIsPrint
3421
+ }
3424
3422
 
3423
+ const minA = isMinWidth(a) || isMinHeight(a);
3424
+ const maxA = isMaxWidth(a) || isMaxHeight(a);
3425
3425
 
3426
- function camelCase() {
3427
- function onProcessStyle(style) {
3428
- if (Array.isArray(style)) {
3429
- // Handle rules like @font-face, which can have multiple styles in an array
3430
- for (var index = 0; index < style.length; index++) {
3431
- style[index] = convertCase(style[index]);
3432
- }
3433
-
3434
- return style;
3435
- }
3426
+ const minB = isMinWidth(b) || isMinHeight(b);
3427
+ const maxB = isMaxWidth(b) || isMaxHeight(b);
3436
3428
 
3437
- return convertCase(style);
3429
+ if (minA && maxB) {
3430
+ return -1
3431
+ }
3432
+ if (maxA && minB) {
3433
+ return 1
3438
3434
  }
3439
3435
 
3440
- function onChangeValue(value, prop, rule) {
3441
- if (prop.indexOf('--') === 0) {
3442
- return value;
3443
- }
3436
+ let lengthA = _getQueryLength(a);
3437
+ let lengthB = _getQueryLength(b);
3444
3438
 
3445
- var hyphenatedProp = index_cjs(prop); // There was no camel case in place
3439
+ if (lengthA === maxValue && lengthB === maxValue) {
3440
+ return a.localeCompare(b)
3441
+ } else if (lengthA === maxValue) {
3442
+ return 1
3443
+ } else if (lengthB === maxValue) {
3444
+ return -1
3445
+ }
3446
3446
 
3447
- if (prop === hyphenatedProp) return value;
3448
- rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.
3447
+ if (lengthA > lengthB) {
3448
+ if (maxA) {
3449
+ return -1
3450
+ }
3451
+ return 1
3452
+ }
3449
3453
 
3450
- return null;
3454
+ if (lengthA < lengthB) {
3455
+ if (maxA) {
3456
+ return 1
3457
+ }
3458
+ return -1
3451
3459
  }
3452
3460
 
3453
- return {
3454
- onProcessStyle: onProcessStyle,
3455
- onChangeValue: onChangeValue
3456
- };
3461
+ return a.localeCompare(b)
3457
3462
  }
3458
3463
 
3459
- var px = hasCSSTOMSupport && CSS ? CSS.px : 'px';
3460
- var ms = hasCSSTOMSupport && CSS ? CSS.ms : 'ms';
3461
- var percent = hasCSSTOMSupport && CSS ? CSS.percent : '%';
3462
3464
  /**
3463
- * Generated jss-plugin-default-unit CSS property units
3464
- */
3465
-
3466
- var defaultUnits = {
3467
- // Animation properties
3468
- 'animation-delay': ms,
3469
- 'animation-duration': ms,
3470
- // Background properties
3471
- 'background-position': px,
3472
- 'background-position-x': px,
3473
- 'background-position-y': px,
3474
- 'background-size': px,
3475
- // Border Properties
3476
- border: px,
3477
- 'border-bottom': px,
3478
- 'border-bottom-left-radius': px,
3479
- 'border-bottom-right-radius': px,
3480
- 'border-bottom-width': px,
3481
- 'border-left': px,
3482
- 'border-left-width': px,
3483
- 'border-radius': px,
3484
- 'border-right': px,
3485
- 'border-right-width': px,
3486
- 'border-top': px,
3487
- 'border-top-left-radius': px,
3488
- 'border-top-right-radius': px,
3489
- 'border-top-width': px,
3490
- 'border-width': px,
3491
- 'border-block': px,
3492
- 'border-block-end': px,
3493
- 'border-block-end-width': px,
3494
- 'border-block-start': px,
3495
- 'border-block-start-width': px,
3496
- 'border-block-width': px,
3497
- 'border-inline': px,
3498
- 'border-inline-end': px,
3499
- 'border-inline-end-width': px,
3500
- 'border-inline-start': px,
3501
- 'border-inline-start-width': px,
3502
- 'border-inline-width': px,
3503
- 'border-start-start-radius': px,
3504
- 'border-start-end-radius': px,
3505
- 'border-end-start-radius': px,
3506
- 'border-end-end-radius': px,
3507
- // Margin properties
3508
- margin: px,
3509
- 'margin-bottom': px,
3510
- 'margin-left': px,
3511
- 'margin-right': px,
3512
- 'margin-top': px,
3513
- 'margin-block': px,
3514
- 'margin-block-end': px,
3515
- 'margin-block-start': px,
3516
- 'margin-inline': px,
3517
- 'margin-inline-end': px,
3518
- 'margin-inline-start': px,
3519
- // Padding properties
3520
- padding: px,
3521
- 'padding-bottom': px,
3522
- 'padding-left': px,
3523
- 'padding-right': px,
3524
- 'padding-top': px,
3525
- 'padding-block': px,
3526
- 'padding-block-end': px,
3527
- 'padding-block-start': px,
3528
- 'padding-inline': px,
3529
- 'padding-inline-end': px,
3530
- 'padding-inline-start': px,
3531
- // Mask properties
3532
- 'mask-position-x': px,
3533
- 'mask-position-y': px,
3534
- 'mask-size': px,
3535
- // Width and height properties
3536
- height: px,
3537
- width: px,
3538
- 'min-height': px,
3539
- 'max-height': px,
3540
- 'min-width': px,
3541
- 'max-width': px,
3542
- // Position properties
3543
- bottom: px,
3544
- left: px,
3545
- top: px,
3546
- right: px,
3547
- inset: px,
3548
- 'inset-block': px,
3549
- 'inset-block-end': px,
3550
- 'inset-block-start': px,
3551
- 'inset-inline': px,
3552
- 'inset-inline-end': px,
3553
- 'inset-inline-start': px,
3554
- // Shadow properties
3555
- 'box-shadow': px,
3556
- 'text-shadow': px,
3557
- // Column properties
3558
- 'column-gap': px,
3559
- 'column-rule': px,
3560
- 'column-rule-width': px,
3561
- 'column-width': px,
3562
- // Font and text properties
3563
- 'font-size': px,
3564
- 'font-size-delta': px,
3565
- 'letter-spacing': px,
3566
- 'text-decoration-thickness': px,
3567
- 'text-indent': px,
3568
- 'text-stroke': px,
3569
- 'text-stroke-width': px,
3570
- 'word-spacing': px,
3571
- // Motion properties
3572
- motion: px,
3573
- 'motion-offset': px,
3574
- // Outline properties
3575
- outline: px,
3576
- 'outline-offset': px,
3577
- 'outline-width': px,
3578
- // Perspective properties
3579
- perspective: px,
3580
- 'perspective-origin-x': percent,
3581
- 'perspective-origin-y': percent,
3582
- // Transform properties
3583
- 'transform-origin': percent,
3584
- 'transform-origin-x': percent,
3585
- 'transform-origin-y': percent,
3586
- 'transform-origin-z': percent,
3587
- // Transition properties
3588
- 'transition-delay': ms,
3589
- 'transition-duration': ms,
3590
- // Alignment properties
3591
- 'vertical-align': px,
3592
- 'flex-basis': px,
3593
- // Some random properties
3594
- 'shape-margin': px,
3595
- size: px,
3596
- gap: px,
3597
- // Grid properties
3598
- grid: px,
3599
- 'grid-gap': px,
3600
- 'row-gap': px,
3601
- 'grid-row-gap': px,
3602
- 'grid-column-gap': px,
3603
- 'grid-template-rows': px,
3604
- 'grid-template-columns': px,
3605
- 'grid-auto-rows': px,
3606
- 'grid-auto-columns': px,
3607
- // Not existing properties.
3608
- // Used to avoid issues with jss-plugin-expand integration.
3609
- 'box-shadow-x': px,
3610
- 'box-shadow-y': px,
3611
- 'box-shadow-blur': px,
3612
- 'box-shadow-spread': px,
3613
- 'font-line-height': px,
3614
- 'text-shadow-x': px,
3615
- 'text-shadow-y': px,
3616
- 'text-shadow-blur': px
3617
- };
3618
-
3619
- /**
3620
- * Clones the object and adds a camel cased property version.
3465
+ * Sorting an array with media queries
3466
+ * according to the desktop-first methodology.
3467
+ * @param {string} a
3468
+ * @param {string} b
3469
+ * @return {number} 1 / 0 / -1
3621
3470
  */
3471
+ sortCSSmq$1.desktopFirst = function (a, b) {
3472
+ const testIsPrint = _testIsPrint(a, b);
3473
+ if (testIsPrint !== null) {
3474
+ return testIsPrint
3475
+ }
3622
3476
 
3623
- function addCamelCasedVersion(obj) {
3624
- var regExp = /(-[a-z])/g;
3625
-
3626
- var replace = function replace(str) {
3627
- return str[1].toUpperCase();
3628
- };
3477
+ const minA = isMinWidth(a) || isMinHeight(a);
3478
+ const maxA = isMaxWidth(a) || isMaxHeight(a);
3629
3479
 
3630
- var newObj = {};
3480
+ const minB = isMinWidth(b) || isMinHeight(b);
3481
+ const maxB = isMaxWidth(b) || isMaxHeight(b);
3631
3482
 
3632
- for (var key in obj) {
3633
- newObj[key] = obj[key];
3634
- newObj[key.replace(regExp, replace)] = obj[key];
3483
+ if (minA && maxB) {
3484
+ return 1
3485
+ }
3486
+ if (maxA && minB) {
3487
+ return -1
3635
3488
  }
3636
3489
 
3637
- return newObj;
3638
- }
3639
-
3640
- var units = addCamelCasedVersion(defaultUnits);
3641
- /**
3642
- * Recursive deep style passing function
3643
- */
3490
+ const lengthA = _getQueryLength(a);
3491
+ const lengthB = _getQueryLength(b);
3644
3492
 
3645
- function iterate(prop, value, options) {
3646
- if (value == null) return value;
3493
+ if (lengthA === maxValue && lengthB === maxValue) {
3494
+ return a.localeCompare(b)
3495
+ } else if (lengthA === maxValue) {
3496
+ return 1
3497
+ } else if (lengthB === maxValue) {
3498
+ return -1
3499
+ }
3647
3500
 
3648
- if (Array.isArray(value)) {
3649
- for (var i = 0; i < value.length; i++) {
3650
- value[i] = iterate(prop, value[i], options);
3501
+ if (lengthA > lengthB) {
3502
+ if (maxA) {
3503
+ return -1
3651
3504
  }
3652
- } else if (typeof value === 'object') {
3653
- if (prop === 'fallbacks') {
3654
- for (var innerProp in value) {
3655
- value[innerProp] = iterate(innerProp, value[innerProp], options);
3656
- }
3657
- } else {
3658
- for (var _innerProp in value) {
3659
- value[_innerProp] = iterate(prop + "-" + _innerProp, value[_innerProp], options);
3660
- }
3661
- } // eslint-disable-next-line no-restricted-globals
3662
-
3663
- } else if (typeof value === 'number' && isNaN(value) === false) {
3664
- var unit = options[prop] || units[prop]; // Add the unit if available, except for the special case of 0px.
3505
+ return 1
3506
+ }
3665
3507
 
3666
- if (unit && !(value === 0 && unit === px)) {
3667
- return typeof unit === 'function' ? unit(value).toString() : "" + value + unit;
3508
+ if (lengthA < lengthB) {
3509
+ if (maxA) {
3510
+ return 1
3668
3511
  }
3669
-
3670
- return value.toString();
3512
+ return -1
3671
3513
  }
3672
3514
 
3673
- return value;
3674
- }
3675
- /**
3676
- * Add unit to numeric values.
3677
- */
3515
+ return -(a.localeCompare(b))
3516
+ };
3678
3517
 
3518
+ // ----------------------------------------
3519
+ // Exports
3520
+ // ----------------------------------------
3679
3521
 
3680
- function defaultUnit(options) {
3681
- if (options === void 0) {
3682
- options = {};
3683
- }
3522
+ var sortCssMediaQueries = sortCSSmq$1;
3684
3523
 
3685
- var camelCasedOptions = addCamelCasedVersion(options);
3524
+ var _tslib = _tslib$1;
3525
+ var jss$1 = require$$1;
3526
+ var sortCSSmq = sortCssMediaQueries;
3686
3527
 
3687
- function onProcessStyle(style, rule) {
3688
- if (rule.type !== 'style') return style;
3528
+ function _interopDefaultLegacy(e) {
3529
+ return e && typeof e === 'object' && 'default' in e ? e : { default: e };
3530
+ }
3689
3531
 
3690
- for (var prop in style) {
3691
- style[prop] = iterate(prop, style[prop], camelCasedOptions);
3532
+ var sortCSSmq__default = /*#__PURE__*/ _interopDefaultLegacy(sortCSSmq);
3533
+
3534
+ function isPlainObject(sample) {
3535
+ return (
3536
+ sample !== null && typeof sample === 'object' && Array.isArray(sample) === false
3537
+ );
3538
+ }
3539
+ var UN_QUERIED = '__UN_QUERIED';
3540
+ function recursiveInnerAndGetQueries(pluginOptions, rules) {
3541
+ var queries = {
3542
+ groups: {},
3543
+ groupsSortNames: []
3544
+ };
3545
+ for (var index = 0; index < rules.length; index++) {
3546
+ var rule = rules[index];
3547
+ var query =
3548
+ rule.type === 'conditional' && typeof rule.query === 'string'
3549
+ ? rule.query
3550
+ : UN_QUERIED;
3551
+ if (!queries.groups.hasOwnProperty(query)) {
3552
+ queries.groupsSortNames.push(query);
3553
+ queries.groups[query] = [];
3554
+ }
3555
+ queries.groups[query].push(index);
3556
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
3557
+ recursive(pluginOptions, rule);
3558
+ }
3559
+ queries.groupsSortNames.sort(function (a, b) {
3560
+ var aWeight = a === UN_QUERIED ? 0 : a.length;
3561
+ var bWeight = b === UN_QUERIED ? 0 : b.length;
3562
+ if (aWeight > 0 && bWeight > 0) {
3563
+ if (pluginOptions.desktopFirst) {
3564
+ return sortCSSmq__default['default'].desktopFirst(a, b);
3565
+ } else {
3566
+ return sortCSSmq__default['default'](a, b);
3567
+ }
3568
+ } else {
3569
+ return aWeight - bWeight;
3570
+ }
3571
+ });
3572
+ return queries;
3573
+ }
3574
+ function recursive(pluginOptions, data) {
3575
+ if (isPlainObject(data) && data.rules instanceof jss$1.RuleList) {
3576
+ data.rules.toString = function (options) {
3577
+ if (options === void 0) {
3578
+ options = {};
3579
+ }
3580
+ var str = '';
3581
+ var sheet = this.options.sheet;
3582
+ var link = sheet ? sheet.options.link : false;
3583
+ var _a = recursiveInnerAndGetQueries(pluginOptions, this.index),
3584
+ groups = _a.groups,
3585
+ groupsSortNames = _a.groupsSortNames;
3586
+ for (var i = 0; i < groupsSortNames.length; i++) {
3587
+ var groupName = groupsSortNames[i];
3588
+ var group = groups[groupsSortNames[i]];
3589
+ if (groupName !== UN_QUERIED && pluginOptions.combineMediaQueries) {
3590
+ str += '\n' + groupName + ' {';
3591
+ for (var i_1 = 0; i_1 < group.length; i_1++) {
3592
+ var rule = this.index[group[i_1]];
3593
+ var css = rule.rules.toString(
3594
+ _tslib.__assign(_tslib.__assign({}, options), {
3595
+ indent: (options.indent || 0) + 1
3596
+ })
3597
+ );
3598
+ if (!css && !link) continue;
3599
+ if (str) str += '\n';
3600
+ str += css;
3601
+ }
3602
+ str += '\n}\n';
3603
+ } else {
3604
+ for (var i_2 = 0; i_2 < group.length; i_2++) {
3605
+ var rule = this.index[group[i_2]];
3606
+ var css = rule.toString(options);
3607
+ if (!css && !link) continue;
3608
+ if (str) str += '\n';
3609
+ str += css;
3610
+ }
3611
+ }
3612
+ }
3613
+ return str;
3614
+ };
3615
+ }
3616
+ }
3617
+ function jssCombineAndSortMQ(options) {
3618
+ if (options === void 0) {
3619
+ options = {};
3620
+ }
3621
+ return {
3622
+ onProcessSheet: function (sheet) {
3623
+ recursive(options, sheet);
3624
+ }
3625
+ };
3626
+ }
3627
+
3628
+ var dist = jssCombineAndSortMQ;
3629
+
3630
+ /* Auto Generated Start */
3631
+ const themeLight = {
3632
+ baseColor: '#000',
3633
+ baseColorDarken: '#000000',
3634
+ brandColor: '#d5001c',
3635
+ backgroundColor: '#fff',
3636
+ backgroundSurfaceColor: '#f2f2f2',
3637
+ contrastLowColor: '#e3e4e5',
3638
+ contrastMediumColor: '#626669',
3639
+ contrastHighColor: '#323639',
3640
+ contrastHighColorDarken: '#151718',
3641
+ hoverColor: '#d5001c',
3642
+ hoverColorDarken: '#980014',
3643
+ activeColor: '#d5001c',
3644
+ focusColor: 'currentColor',
3645
+ disabledColor: '#96989a',
3646
+ errorColor: '#e00000',
3647
+ errorColorDarken: '#a30000',
3648
+ errorSoftColor: '#fae6e6',
3649
+ successColor: '#018a16',
3650
+ successColorDarken: '#014d0c',
3651
+ successSoftColor: '#e5f3e7',
3652
+ warningColor: '#ff9b00',
3653
+ warningSoftColor: '#fff5e5',
3654
+ neutralColor: '#0061bd',
3655
+ neutralSoftColor: '#e5eff8'
3656
+ };
3657
+ const themeDark = {
3658
+ baseColor: '#fff',
3659
+ baseColorDarken: '#e0e0e0',
3660
+ brandColor: '#d5001c',
3661
+ backgroundColor: '#0e1418',
3662
+ backgroundSurfaceColor: '#262b2e',
3663
+ contrastLowColor: '#4a4e51',
3664
+ contrastMediumColor: '#b0b1b2',
3665
+ contrastHighColor: '#e3e4e5',
3666
+ contrastHighColorDarken: '#c3c5c8',
3667
+ hoverColor: '#ff0223',
3668
+ hoverColorDarken: '#c4001a',
3669
+ activeColor: '#ff0223',
3670
+ focusColor: 'currentColor',
3671
+ disabledColor: '#7c7f81',
3672
+ errorColor: '#fc1717',
3673
+ errorColorDarken: '#d30303',
3674
+ errorSoftColor: '#fec5c5',
3675
+ successColor: '#01ba1d',
3676
+ successColorDarken: '#017d14',
3677
+ successSoftColor: '#bfeec6',
3678
+ warningColor: '#ff9b00',
3679
+ warningSoftColor: '#ffe6bf',
3680
+ neutralColor: '#2193ff',
3681
+ neutralSoftColor: '#c7e4ff'
3682
+ };
3683
+ const themeLightElectric = Object.assign(Object.assign({}, themeLight), { brandColor: '#00b0f4', hoverColor: '#00b0f4', hoverColorDarken: '#0084b7', activeColor: '#00b0f4' });
3684
+ const themeDarkElectric = Object.assign(Object.assign({}, themeDark), { brandColor: '#00b0f4', hoverColor: '#00b0f4', hoverColorDarken: '#0084b7', activeColor: '#00b0f4' });
3685
+ const themes = {
3686
+ 'light': themeLight,
3687
+ 'dark': themeDark,
3688
+ 'light-electric': themeLightElectric,
3689
+ 'dark-electric': themeDarkElectric
3690
+ };
3691
+ /* Auto Generated End */
3692
+ const getThemedColors = (theme) => {
3693
+ return themes[theme];
3694
+ };
3695
+
3696
+ const pxToRemWithUnit = (px) => `${px / 16}rem`;
3697
+
3698
+ // NOTE: handpicked selection of plugins from jss-preset-default
3699
+ createJss({
3700
+ plugins: [
3701
+ jssGlobal(),
3702
+ jssNested(),
3703
+ camelCase(),
3704
+ dist({ combineMediaQueries: true }),
3705
+ ],
3706
+ });
3707
+ const supportsConstructableStylesheets = () => {
3708
+ try {
3709
+ return typeof new CSSStyleSheet().replaceSync === 'function';
3692
3710
  }
3711
+ catch (_a) {
3712
+ return false;
3713
+ }
3714
+ };
3715
+ // determine it once
3716
+ supportsConstructableStylesheets();
3693
3717
 
3694
- return style;
3718
+ const paramCaseToCamelCase = (str) => {
3719
+ return str.replace(/-(\w)/g, (_, group) => group.toUpperCase());
3720
+ };
3721
+ const isScrollable = (isPrevHidden, isNextHidden) => {
3722
+ return !(isPrevHidden && isNextHidden);
3723
+ };
3724
+
3725
+ const hasDocument = typeof document !== 'undefined';
3726
+
3727
+ hasDocument && 'scrollBehavior' in document.documentElement.style;
3728
+ const win = typeof window !== 'undefined' ? window : {};
3729
+ win.document || { head: {} };
3730
+ (win.HTMLElement || class {
3731
+ });
3732
+
3733
+ [
3734
+ { name: 'Model', id: 'model' },
3735
+ { name: 'Interest', id: 'interest' },
3736
+ { name: 'VIN', id: 'vin' },
3737
+ { name: 'Purchase Intention', id: 'purchaseIntention' },
3738
+ { name: 'Status', id: 'status' },
3739
+ { name: 'Comment', id: 'comment' },
3740
+ { name: 'Lead ID', id: 'leadId' },
3741
+ { name: 'Action', id: 'action', hideLabel: true },
3742
+ ].map((item, i) => ({
3743
+ ...item,
3744
+ ...(i > 0 &&
3745
+ i < 7 &&
3746
+ i !== 5 && {
3747
+ active: i === 1,
3748
+ direction: 'asc',
3749
+ }),
3750
+ }));
3751
+
3752
+ [
3753
+ { name: 'Column 1', id: 'col1' },
3754
+ { name: 'Column 2', id: 'col2' },
3755
+ { name: 'Column 3', id: 'col3' },
3756
+ ].map((item, i) => ({
3757
+ ...item,
3758
+ active: i === 1,
3759
+ direction: 'asc',
3760
+ }));
3761
+
3762
+ Array.from(Array(4)).map(() => ({
3763
+ imageUrl: 'https://nav.porsche.com/00BC524/series-assets/1366/911@2x.jpg',
3764
+ imageWidth: 80,
3765
+ imageHeight: 48,
3766
+ html: "<a href='#'>link</a>&nbsp;<b>bold</b>&nbsp;<i>italic</i>&nbsp;<strong>strong</strong>&nbsp;<em>emphasized</em>",
3767
+ longText: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr',
3768
+ shortText: 'Some text',
3769
+ }));
3770
+
3771
+ var now = Date.now();
3772
+ var fnValuesNs = "fnValues" + now;
3773
+ var fnRuleNs = "fnStyle" + ++now;
3774
+
3775
+ var functionPlugin = function functionPlugin() {
3776
+ return {
3777
+ onCreateRule: function onCreateRule(name, decl, options) {
3778
+ if (typeof decl !== 'function') return null;
3779
+ var rule = createRule(name, {}, options);
3780
+ rule[fnRuleNs] = decl;
3781
+ return rule;
3782
+ },
3783
+ onProcessStyle: function onProcessStyle(style, rule) {
3784
+ // We need to extract function values from the declaration, so that we can keep core unaware of them.
3785
+ // We need to do that only once.
3786
+ // We don't need to extract functions on each style update, since this can happen only once.
3787
+ // We don't support function values inside of function rules.
3788
+ if (fnValuesNs in rule || fnRuleNs in rule) return style;
3789
+ var fnValues = {};
3790
+
3791
+ for (var prop in style) {
3792
+ var value = style[prop];
3793
+ if (typeof value !== 'function') continue;
3794
+ delete style[prop];
3795
+ fnValues[prop] = value;
3796
+ }
3797
+
3798
+ rule[fnValuesNs] = fnValues;
3799
+ return style;
3800
+ },
3801
+ onUpdate: function onUpdate(data, rule, sheet, options) {
3802
+ var styleRule = rule;
3803
+ var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object
3804
+ // will be returned from that function.
3805
+
3806
+ if (fnRule) {
3807
+ // Empty object will remove all currently defined props
3808
+ // in case function rule returns a falsy value.
3809
+ styleRule.style = fnRule(data) || {};
3810
+
3811
+ if (process.env.NODE_ENV === 'development') {
3812
+ for (var prop in styleRule.style) {
3813
+ if (typeof styleRule.style[prop] === 'function') {
3814
+ process.env.NODE_ENV !== "production" ? warning(false, '[JSS] Function values inside function rules are not supported.') : void 0;
3815
+ break;
3816
+ }
3817
+ }
3818
+ }
3819
+ }
3820
+
3821
+ var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values.
3822
+
3823
+ if (fnValues) {
3824
+ for (var _prop in fnValues) {
3825
+ styleRule.prop(_prop, fnValues[_prop](data), options);
3826
+ }
3827
+ }
3828
+ }
3829
+ };
3830
+ };
3831
+
3832
+ function symbolObservablePonyfill(root) {
3833
+ var result;
3834
+ var Symbol = root.Symbol;
3835
+
3836
+ if (typeof Symbol === 'function') {
3837
+ if (Symbol.observable) {
3838
+ result = Symbol.observable;
3839
+ } else {
3840
+ result = Symbol('observable');
3841
+ Symbol.observable = result;
3842
+ }
3843
+ } else {
3844
+ result = '@@observable';
3845
+ }
3846
+
3847
+ return result;
3848
+ }
3849
+
3850
+ /* global window */
3851
+
3852
+ var root;
3853
+
3854
+ if (typeof self !== 'undefined') {
3855
+ root = self;
3856
+ } else if (typeof window !== 'undefined') {
3857
+ root = window;
3858
+ } else if (typeof global !== 'undefined') {
3859
+ root = global;
3860
+ } else if (typeof module !== 'undefined') {
3861
+ root = module;
3862
+ } else {
3863
+ root = Function('return this')();
3864
+ }
3865
+
3866
+ var result = symbolObservablePonyfill(root);
3867
+
3868
+ var isObservable = function isObservable(value) {
3869
+ return value && value[result] && value === value[result]();
3870
+ };
3871
+
3872
+ var observablePlugin = function observablePlugin(updateOptions) {
3873
+ return {
3874
+ onCreateRule: function onCreateRule(name, decl, options) {
3875
+ if (!isObservable(decl)) return null;
3876
+ var style$ = decl;
3877
+ var rule = createRule(name, {}, options); // TODO
3878
+ // Call `stream.subscribe()` returns a subscription, which should be explicitly
3879
+ // unsubscribed from when we know this sheet is no longer needed.
3880
+
3881
+ style$.subscribe(function (style) {
3882
+ for (var prop in style) {
3883
+ rule.prop(prop, style[prop], updateOptions);
3884
+ }
3885
+ });
3886
+ return rule;
3887
+ },
3888
+ onProcessRule: function onProcessRule(rule) {
3889
+ if (rule && rule.type !== 'style') return;
3890
+ var styleRule = rule;
3891
+ var style = styleRule.style;
3892
+
3893
+ var _loop = function _loop(prop) {
3894
+ var value = style[prop];
3895
+ if (!isObservable(value)) return "continue";
3896
+ delete style[prop];
3897
+ value.subscribe({
3898
+ next: function next(nextValue) {
3899
+ styleRule.prop(prop, nextValue, updateOptions);
3900
+ }
3901
+ });
3902
+ };
3903
+
3904
+ for (var prop in style) {
3905
+ var _ret = _loop(prop);
3906
+
3907
+ if (_ret === "continue") continue;
3908
+ }
3909
+ }
3910
+ };
3911
+ };
3912
+
3913
+ var semiWithNl = /;\n/;
3914
+ /**
3915
+ * Naive CSS parser.
3916
+ * - Supports only rule body (no selectors)
3917
+ * - Requires semicolon and new line after the value (except of last line)
3918
+ * - No nested rules support
3919
+ */
3920
+
3921
+ var parse = function parse(cssText) {
3922
+ var style = {};
3923
+ var split = cssText.split(semiWithNl);
3924
+
3925
+ for (var i = 0; i < split.length; i++) {
3926
+ var decl = (split[i] || '').trim();
3927
+ if (!decl) continue;
3928
+ var colonIndex = decl.indexOf(':');
3929
+
3930
+ if (colonIndex === -1) {
3931
+ process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Malformed CSS string \"" + decl + "\"") : void 0;
3932
+ continue;
3933
+ }
3934
+
3935
+ var prop = decl.substr(0, colonIndex).trim();
3936
+ var value = decl.substr(colonIndex + 1).trim();
3937
+ style[prop] = value;
3938
+ }
3939
+
3940
+ return style;
3941
+ };
3942
+
3943
+ var onProcessRule = function onProcessRule(rule) {
3944
+ if (typeof rule.style === 'string') {
3945
+ rule.style = parse(rule.style);
3946
+ }
3947
+ };
3948
+
3949
+ function templatePlugin() {
3950
+ return {
3951
+ onProcessRule: onProcessRule
3952
+ };
3953
+ }
3954
+
3955
+ var isObject = function isObject(obj) {
3956
+ return obj && typeof obj === 'object' && !Array.isArray(obj);
3957
+ };
3958
+
3959
+ var valueNs = "extendCurrValue" + Date.now();
3960
+
3961
+ function mergeExtend(style, rule, sheet, newStyle) {
3962
+ var extendType = typeof style.extend; // Extend using a rule name.
3963
+
3964
+ if (extendType === 'string') {
3965
+ if (!sheet) return;
3966
+ var refRule = sheet.getRule(style.extend);
3967
+ if (!refRule) return;
3968
+
3969
+ if (refRule === rule) {
3970
+ process.env.NODE_ENV !== "production" ? warning(false, "[JSS] A rule tries to extend itself \n" + rule.toString()) : void 0;
3971
+ return;
3972
+ }
3973
+
3974
+ var parent = refRule.options.parent;
3975
+
3976
+ if (parent) {
3977
+ var originalStyle = parent.rules.raw[style.extend];
3978
+ extend(originalStyle, rule, sheet, newStyle);
3979
+ }
3980
+
3981
+ return;
3982
+ } // Extend using an array.
3983
+
3984
+
3985
+ if (Array.isArray(style.extend)) {
3986
+ for (var index = 0; index < style.extend.length; index++) {
3987
+ var singleExtend = style.extend[index];
3988
+ var singleStyle = typeof singleExtend === 'string' ? _extends({}, style, {
3989
+ extend: singleExtend
3990
+ }) : style.extend[index];
3991
+ extend(singleStyle, rule, sheet, newStyle);
3992
+ }
3993
+
3994
+ return;
3995
+ } // Extend is a style object.
3996
+
3997
+
3998
+ for (var prop in style.extend) {
3999
+ if (prop === 'extend') {
4000
+ extend(style.extend.extend, rule, sheet, newStyle);
4001
+ continue;
4002
+ }
4003
+
4004
+ if (isObject(style.extend[prop])) {
4005
+ if (!(prop in newStyle)) newStyle[prop] = {};
4006
+ extend(style.extend[prop], rule, sheet, newStyle[prop]);
4007
+ continue;
4008
+ }
4009
+
4010
+ newStyle[prop] = style.extend[prop];
3695
4011
  }
4012
+ }
4013
+
4014
+ function mergeRest(style, rule, sheet, newStyle) {
4015
+ // Copy base style.
4016
+ for (var prop in style) {
4017
+ if (prop === 'extend') continue;
4018
+
4019
+ if (isObject(newStyle[prop]) && isObject(style[prop])) {
4020
+ extend(style[prop], rule, sheet, newStyle[prop]);
4021
+ continue;
4022
+ }
4023
+
4024
+ if (isObject(style[prop])) {
4025
+ newStyle[prop] = extend(style[prop], rule, sheet);
4026
+ continue;
4027
+ }
4028
+
4029
+ newStyle[prop] = style[prop];
4030
+ }
4031
+ }
4032
+ /**
4033
+ * Recursively extend styles.
4034
+ */
3696
4035
 
3697
- function onChangeValue(value, prop) {
3698
- return iterate(prop, value, camelCasedOptions);
4036
+
4037
+ function extend(style, rule, sheet, newStyle) {
4038
+ if (newStyle === void 0) {
4039
+ newStyle = {};
3699
4040
  }
3700
4041
 
3701
- return {
3702
- onProcessStyle: onProcessStyle,
3703
- onChangeValue: onChangeValue
3704
- };
4042
+ mergeExtend(style, rule, sheet, newStyle);
4043
+ mergeRest(style, rule, sheet, newStyle);
4044
+ return newStyle;
3705
4045
  }
3706
-
3707
4046
  /**
3708
- * A scheme for converting properties from array to regular style.
3709
- * All properties listed below will be transformed to a string separated by space.
4047
+ * Handle `extend` property.
3710
4048
  */
3711
- var propArray = {
3712
- 'background-size': true,
3713
- 'background-position': true,
3714
- border: true,
3715
- 'border-bottom': true,
3716
- 'border-left': true,
3717
- 'border-top': true,
3718
- 'border-right': true,
3719
- 'border-radius': true,
3720
- 'border-image': true,
3721
- 'border-width': true,
3722
- 'border-style': true,
3723
- 'border-color': true,
3724
- 'box-shadow': true,
3725
- flex: true,
3726
- margin: true,
3727
- padding: true,
3728
- outline: true,
3729
- 'transform-origin': true,
3730
- transform: true,
3731
- transition: true
3732
- /**
3733
- * A scheme for converting arrays to regular styles inside of objects.
3734
- * For e.g.: "{position: [0, 0]}" => "background-position: 0 0;".
3735
- */
3736
4049
 
3737
- };
3738
- var propArrayInObj = {
3739
- position: true,
3740
- // background-position
3741
- size: true // background-size
3742
4050
 
3743
- /**
3744
- * A scheme for parsing and building correct styles from passed objects.
3745
- */
4051
+ function jssExtend() {
4052
+ function onProcessStyle(style, rule, sheet) {
4053
+ if ('extend' in style) return extend(style, rule, sheet);
4054
+ return style;
4055
+ }
3746
4056
 
3747
- };
3748
- var propObj = {
3749
- padding: {
3750
- top: 0,
3751
- right: 0,
3752
- bottom: 0,
3753
- left: 0
3754
- },
3755
- margin: {
3756
- top: 0,
3757
- right: 0,
3758
- bottom: 0,
3759
- left: 0
3760
- },
3761
- background: {
3762
- attachment: null,
3763
- color: null,
3764
- image: null,
3765
- position: null,
3766
- repeat: null
3767
- },
3768
- border: {
3769
- width: null,
3770
- style: null,
3771
- color: null
3772
- },
3773
- 'border-top': {
3774
- width: null,
3775
- style: null,
3776
- color: null
3777
- },
3778
- 'border-right': {
3779
- width: null,
3780
- style: null,
3781
- color: null
3782
- },
3783
- 'border-bottom': {
3784
- width: null,
3785
- style: null,
3786
- color: null
3787
- },
3788
- 'border-left': {
3789
- width: null,
3790
- style: null,
3791
- color: null
3792
- },
3793
- outline: {
3794
- width: null,
3795
- style: null,
3796
- color: null
3797
- },
3798
- 'list-style': {
3799
- type: null,
3800
- position: null,
3801
- image: null
3802
- },
3803
- transition: {
3804
- property: null,
3805
- duration: null,
3806
- 'timing-function': null,
3807
- timingFunction: null,
3808
- // Needed for avoiding comilation issues with jss-plugin-camel-case
3809
- delay: null
3810
- },
3811
- animation: {
3812
- name: null,
3813
- duration: null,
3814
- 'timing-function': null,
3815
- timingFunction: null,
3816
- // Needed to avoid compilation issues with jss-plugin-camel-case
3817
- delay: null,
3818
- 'iteration-count': null,
3819
- iterationCount: null,
3820
- // Needed to avoid compilation issues with jss-plugin-camel-case
3821
- direction: null,
3822
- 'fill-mode': null,
3823
- fillMode: null,
3824
- // Needed to avoid compilation issues with jss-plugin-camel-case
3825
- 'play-state': null,
3826
- playState: null // Needed to avoid compilation issues with jss-plugin-camel-case
4057
+ function onChangeValue(value, prop, rule) {
4058
+ if (prop !== 'extend') return value; // Value is empty, remove properties set previously.
3827
4059
 
3828
- },
3829
- 'box-shadow': {
3830
- x: 0,
3831
- y: 0,
3832
- blur: 0,
3833
- spread: 0,
3834
- color: null,
3835
- inset: null
3836
- },
3837
- 'text-shadow': {
3838
- x: 0,
3839
- y: 0,
3840
- blur: null,
3841
- color: null
3842
- }
3843
- /**
3844
- * A scheme for converting non-standart properties inside object.
3845
- * For e.g.: include 'border-radius' property inside 'border' object.
3846
- */
4060
+ if (value == null || value === false) {
4061
+ for (var key in rule[valueNs]) {
4062
+ rule.prop(key, null);
4063
+ }
3847
4064
 
3848
- };
3849
- var customPropObj = {
3850
- border: {
3851
- radius: 'border-radius',
3852
- image: 'border-image',
3853
- width: 'border-width',
3854
- style: 'border-style',
3855
- color: 'border-color'
3856
- },
3857
- 'border-bottom': {
3858
- width: 'border-bottom-width',
3859
- style: 'border-bottom-style',
3860
- color: 'border-bottom-color'
3861
- },
3862
- 'border-top': {
3863
- width: 'border-top-width',
3864
- style: 'border-top-style',
3865
- color: 'border-top-color'
3866
- },
3867
- 'border-left': {
3868
- width: 'border-left-width',
3869
- style: 'border-left-style',
3870
- color: 'border-left-color'
3871
- },
3872
- 'border-right': {
3873
- width: 'border-right-width',
3874
- style: 'border-right-style',
3875
- color: 'border-right-color'
3876
- },
3877
- background: {
3878
- size: 'background-size',
3879
- image: 'background-image'
3880
- },
3881
- font: {
3882
- style: 'font-style',
3883
- variant: 'font-variant',
3884
- weight: 'font-weight',
3885
- stretch: 'font-stretch',
3886
- size: 'font-size',
3887
- family: 'font-family',
3888
- lineHeight: 'line-height',
3889
- // Needed to avoid compilation issues with jss-plugin-camel-case
3890
- 'line-height': 'line-height'
3891
- },
3892
- flex: {
3893
- grow: 'flex-grow',
3894
- basis: 'flex-basis',
3895
- direction: 'flex-direction',
3896
- wrap: 'flex-wrap',
3897
- flow: 'flex-flow',
3898
- shrink: 'flex-shrink'
3899
- },
3900
- align: {
3901
- self: 'align-self',
3902
- items: 'align-items',
3903
- content: 'align-content'
3904
- },
3905
- grid: {
3906
- 'template-columns': 'grid-template-columns',
3907
- templateColumns: 'grid-template-columns',
3908
- 'template-rows': 'grid-template-rows',
3909
- templateRows: 'grid-template-rows',
3910
- 'template-areas': 'grid-template-areas',
3911
- templateAreas: 'grid-template-areas',
3912
- template: 'grid-template',
3913
- 'auto-columns': 'grid-auto-columns',
3914
- autoColumns: 'grid-auto-columns',
3915
- 'auto-rows': 'grid-auto-rows',
3916
- autoRows: 'grid-auto-rows',
3917
- 'auto-flow': 'grid-auto-flow',
3918
- autoFlow: 'grid-auto-flow',
3919
- row: 'grid-row',
3920
- column: 'grid-column',
3921
- 'row-start': 'grid-row-start',
3922
- rowStart: 'grid-row-start',
3923
- 'row-end': 'grid-row-end',
3924
- rowEnd: 'grid-row-end',
3925
- 'column-start': 'grid-column-start',
3926
- columnStart: 'grid-column-start',
3927
- 'column-end': 'grid-column-end',
3928
- columnEnd: 'grid-column-end',
3929
- area: 'grid-area',
3930
- gap: 'grid-gap',
3931
- 'row-gap': 'grid-row-gap',
3932
- rowGap: 'grid-row-gap',
3933
- 'column-gap': 'grid-column-gap',
3934
- columnGap: 'grid-column-gap'
4065
+ rule[valueNs] = null;
4066
+ return null;
4067
+ }
4068
+
4069
+ if (typeof value === 'object') {
4070
+ for (var _key in value) {
4071
+ rule.prop(_key, value[_key]);
4072
+ }
4073
+
4074
+ rule[valueNs] = value;
4075
+ } // Make sure we don't set the value in the core.
4076
+
4077
+
4078
+ return null;
3935
4079
  }
3936
- };
3937
4080
 
3938
- /* eslint-disable no-use-before-define */
4081
+ return {
4082
+ onProcessStyle: onProcessStyle,
4083
+ onChangeValue: onChangeValue
4084
+ };
4085
+ }
4086
+
3939
4087
  /**
3940
- * Map values by given prop.
4088
+ * Set selector.
3941
4089
  *
3942
- * @param {Array} array of values
3943
- * @param {String} original property
3944
- * @param {String} original rule
3945
- * @return {String} mapped values
4090
+ * @param original rule
4091
+ * @param className class string
4092
+ * @return flag indicating function was successfull or not
3946
4093
  */
3947
4094
 
3948
- function mapValuesByProp(value, prop, rule) {
3949
- return value.map(function (item) {
3950
- return objectToArray(item, prop, rule, false, true);
3951
- });
3952
- }
3953
- /**
3954
- * Convert array to nested array, if needed
3955
- */
4095
+ function registerClass(rule, className) {
4096
+ // Skip falsy values
4097
+ if (!className) return true; // Support array of class names `{composes: ['foo', 'bar']}`
3956
4098
 
4099
+ if (Array.isArray(className)) {
4100
+ for (var index = 0; index < className.length; index++) {
4101
+ var isSetted = registerClass(rule, className[index]);
4102
+ if (!isSetted) return false;
4103
+ }
3957
4104
 
3958
- function processArray(value, prop, scheme, rule) {
3959
- if (scheme[prop] == null) return value;
3960
- if (value.length === 0) return [];
3961
- if (Array.isArray(value[0])) return processArray(value[0], prop, scheme, rule);
4105
+ return true;
4106
+ } // Support space separated class names `{composes: 'foo bar'}`
3962
4107
 
3963
- if (typeof value[0] === 'object') {
3964
- return mapValuesByProp(value, prop, rule);
4108
+
4109
+ if (className.indexOf(' ') > -1) {
4110
+ return registerClass(rule, className.split(' '));
3965
4111
  }
3966
4112
 
3967
- return [value];
3968
- }
3969
- /**
3970
- * Convert object to array.
3971
- */
4113
+ var parent = rule.options.parent; // It is a ref to a local rule.
3972
4114
 
4115
+ if (className[0] === '$') {
4116
+ var refRule = parent.getRule(className.substr(1));
3973
4117
 
3974
- function objectToArray(value, prop, rule, isFallback, isInArray) {
3975
- if (!(propObj[prop] || customPropObj[prop])) return [];
3976
- var result = []; // Check if exists any non-standard property
4118
+ if (!refRule) {
4119
+ process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Referenced rule is not defined. \n" + rule.toString()) : void 0;
4120
+ return false;
4121
+ }
3977
4122
 
3978
- if (customPropObj[prop]) {
3979
- // eslint-disable-next-line no-param-reassign
3980
- value = customPropsToStyle(value, rule, customPropObj[prop], isFallback);
3981
- } // Pass throught all standart props
4123
+ if (refRule === rule) {
4124
+ process.env.NODE_ENV !== "production" ? warning(false, "[JSS] Cyclic composition detected. \n" + rule.toString()) : void 0;
4125
+ return false;
4126
+ }
3982
4127
 
4128
+ parent.classes[rule.key] += " " + parent.classes[refRule.key];
4129
+ return true;
4130
+ }
3983
4131
 
3984
- if (Object.keys(value).length) {
3985
- for (var baseProp in propObj[prop]) {
3986
- if (value[baseProp]) {
3987
- if (Array.isArray(value[baseProp])) {
3988
- result.push(propArrayInObj[baseProp] === null ? value[baseProp] : value[baseProp].join(' '));
3989
- } else result.push(value[baseProp]);
4132
+ parent.classes[rule.key] += " " + className;
4133
+ return true;
4134
+ }
4135
+ /**
4136
+ * Convert compose property to additional class, remove property from original styles.
4137
+ */
3990
4138
 
3991
- continue;
3992
- } // Add default value from props config.
3993
4139
 
4140
+ function jssCompose() {
4141
+ function onProcessStyle(style, rule) {
4142
+ if (!('composes' in style)) return style;
4143
+ registerClass(rule, style.composes); // Remove composes property to prevent infinite loop.
3994
4144
 
3995
- if (propObj[prop][baseProp] != null) {
3996
- result.push(propObj[prop][baseProp]);
3997
- }
3998
- }
4145
+ delete style.composes;
4146
+ return style;
3999
4147
  }
4000
4148
 
4001
- if (!result.length || isInArray) return result;
4002
- return [result];
4003
- }
4149
+ return {
4150
+ onProcessStyle: onProcessStyle
4151
+ };
4152
+ }
4153
+
4154
+ var px = hasCSSTOMSupport && CSS ? CSS.px : 'px';
4155
+ var ms = hasCSSTOMSupport && CSS ? CSS.ms : 'ms';
4156
+ var percent = hasCSSTOMSupport && CSS ? CSS.percent : '%';
4157
+ /**
4158
+ * Generated jss-plugin-default-unit CSS property units
4159
+ */
4160
+
4161
+ var defaultUnits = {
4162
+ // Animation properties
4163
+ 'animation-delay': ms,
4164
+ 'animation-duration': ms,
4165
+ // Background properties
4166
+ 'background-position': px,
4167
+ 'background-position-x': px,
4168
+ 'background-position-y': px,
4169
+ 'background-size': px,
4170
+ // Border Properties
4171
+ border: px,
4172
+ 'border-bottom': px,
4173
+ 'border-bottom-left-radius': px,
4174
+ 'border-bottom-right-radius': px,
4175
+ 'border-bottom-width': px,
4176
+ 'border-left': px,
4177
+ 'border-left-width': px,
4178
+ 'border-radius': px,
4179
+ 'border-right': px,
4180
+ 'border-right-width': px,
4181
+ 'border-top': px,
4182
+ 'border-top-left-radius': px,
4183
+ 'border-top-right-radius': px,
4184
+ 'border-top-width': px,
4185
+ 'border-width': px,
4186
+ 'border-block': px,
4187
+ 'border-block-end': px,
4188
+ 'border-block-end-width': px,
4189
+ 'border-block-start': px,
4190
+ 'border-block-start-width': px,
4191
+ 'border-block-width': px,
4192
+ 'border-inline': px,
4193
+ 'border-inline-end': px,
4194
+ 'border-inline-end-width': px,
4195
+ 'border-inline-start': px,
4196
+ 'border-inline-start-width': px,
4197
+ 'border-inline-width': px,
4198
+ 'border-start-start-radius': px,
4199
+ 'border-start-end-radius': px,
4200
+ 'border-end-start-radius': px,
4201
+ 'border-end-end-radius': px,
4202
+ // Margin properties
4203
+ margin: px,
4204
+ 'margin-bottom': px,
4205
+ 'margin-left': px,
4206
+ 'margin-right': px,
4207
+ 'margin-top': px,
4208
+ 'margin-block': px,
4209
+ 'margin-block-end': px,
4210
+ 'margin-block-start': px,
4211
+ 'margin-inline': px,
4212
+ 'margin-inline-end': px,
4213
+ 'margin-inline-start': px,
4214
+ // Padding properties
4215
+ padding: px,
4216
+ 'padding-bottom': px,
4217
+ 'padding-left': px,
4218
+ 'padding-right': px,
4219
+ 'padding-top': px,
4220
+ 'padding-block': px,
4221
+ 'padding-block-end': px,
4222
+ 'padding-block-start': px,
4223
+ 'padding-inline': px,
4224
+ 'padding-inline-end': px,
4225
+ 'padding-inline-start': px,
4226
+ // Mask properties
4227
+ 'mask-position-x': px,
4228
+ 'mask-position-y': px,
4229
+ 'mask-size': px,
4230
+ // Width and height properties
4231
+ height: px,
4232
+ width: px,
4233
+ 'min-height': px,
4234
+ 'max-height': px,
4235
+ 'min-width': px,
4236
+ 'max-width': px,
4237
+ // Position properties
4238
+ bottom: px,
4239
+ left: px,
4240
+ top: px,
4241
+ right: px,
4242
+ inset: px,
4243
+ 'inset-block': px,
4244
+ 'inset-block-end': px,
4245
+ 'inset-block-start': px,
4246
+ 'inset-inline': px,
4247
+ 'inset-inline-end': px,
4248
+ 'inset-inline-start': px,
4249
+ // Shadow properties
4250
+ 'box-shadow': px,
4251
+ 'text-shadow': px,
4252
+ // Column properties
4253
+ 'column-gap': px,
4254
+ 'column-rule': px,
4255
+ 'column-rule-width': px,
4256
+ 'column-width': px,
4257
+ // Font and text properties
4258
+ 'font-size': px,
4259
+ 'font-size-delta': px,
4260
+ 'letter-spacing': px,
4261
+ 'text-decoration-thickness': px,
4262
+ 'text-indent': px,
4263
+ 'text-stroke': px,
4264
+ 'text-stroke-width': px,
4265
+ 'word-spacing': px,
4266
+ // Motion properties
4267
+ motion: px,
4268
+ 'motion-offset': px,
4269
+ // Outline properties
4270
+ outline: px,
4271
+ 'outline-offset': px,
4272
+ 'outline-width': px,
4273
+ // Perspective properties
4274
+ perspective: px,
4275
+ 'perspective-origin-x': percent,
4276
+ 'perspective-origin-y': percent,
4277
+ // Transform properties
4278
+ 'transform-origin': percent,
4279
+ 'transform-origin-x': percent,
4280
+ 'transform-origin-y': percent,
4281
+ 'transform-origin-z': percent,
4282
+ // Transition properties
4283
+ 'transition-delay': ms,
4284
+ 'transition-duration': ms,
4285
+ // Alignment properties
4286
+ 'vertical-align': px,
4287
+ 'flex-basis': px,
4288
+ // Some random properties
4289
+ 'shape-margin': px,
4290
+ size: px,
4291
+ gap: px,
4292
+ // Grid properties
4293
+ grid: px,
4294
+ 'grid-gap': px,
4295
+ 'row-gap': px,
4296
+ 'grid-row-gap': px,
4297
+ 'grid-column-gap': px,
4298
+ 'grid-template-rows': px,
4299
+ 'grid-template-columns': px,
4300
+ 'grid-auto-rows': px,
4301
+ 'grid-auto-columns': px,
4302
+ // Not existing properties.
4303
+ // Used to avoid issues with jss-plugin-expand integration.
4304
+ 'box-shadow-x': px,
4305
+ 'box-shadow-y': px,
4306
+ 'box-shadow-blur': px,
4307
+ 'box-shadow-spread': px,
4308
+ 'font-line-height': px,
4309
+ 'text-shadow-x': px,
4310
+ 'text-shadow-y': px,
4311
+ 'text-shadow-blur': px
4312
+ };
4313
+
4004
4314
  /**
4005
- * Convert custom properties values to styles adding them to rule directly
4315
+ * Clones the object and adds a camel cased property version.
4006
4316
  */
4007
4317
 
4318
+ function addCamelCasedVersion(obj) {
4319
+ var regExp = /(-[a-z])/g;
4008
4320
 
4009
- function customPropsToStyle(value, rule, customProps, isFallback) {
4010
- for (var prop in customProps) {
4011
- var propName = customProps[prop]; // If current property doesn't exist already in rule - add new one
4012
-
4013
- if (typeof value[prop] !== 'undefined' && (isFallback || !rule.prop(propName))) {
4014
- var _styleDetector;
4015
-
4016
- var appendedValue = styleDetector((_styleDetector = {}, _styleDetector[propName] = value[prop], _styleDetector), rule)[propName]; // Add style directly in rule
4017
-
4018
- if (isFallback) rule.style.fallbacks[propName] = appendedValue;else rule.style[propName] = appendedValue;
4019
- } // Delete converted property to avoid double converting
4321
+ var replace = function replace(str) {
4322
+ return str[1].toUpperCase();
4323
+ };
4020
4324
 
4325
+ var newObj = {};
4021
4326
 
4022
- delete value[prop];
4327
+ for (var key in obj) {
4328
+ newObj[key] = obj[key];
4329
+ newObj[key.replace(regExp, replace)] = obj[key];
4023
4330
  }
4024
4331
 
4025
- return value;
4332
+ return newObj;
4026
4333
  }
4334
+
4335
+ var units = addCamelCasedVersion(defaultUnits);
4027
4336
  /**
4028
- * Detect if a style needs to be converted.
4337
+ * Recursive deep style passing function
4029
4338
  */
4030
4339
 
4340
+ function iterate(prop, value, options) {
4341
+ if (value == null) return value;
4031
4342
 
4032
- function styleDetector(style, rule, isFallback) {
4033
- for (var prop in style) {
4034
- var value = style[prop];
4035
-
4036
- if (Array.isArray(value)) {
4037
- // Check double arrays to avoid recursion.
4038
- if (!Array.isArray(value[0])) {
4039
- if (prop === 'fallbacks') {
4040
- for (var index = 0; index < style.fallbacks.length; index++) {
4041
- style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);
4042
- }
4043
-
4044
- continue;
4045
- }
4046
-
4047
- style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values
4048
-
4049
- if (!style[prop].length) delete style[prop];
4343
+ if (Array.isArray(value)) {
4344
+ for (var i = 0; i < value.length; i++) {
4345
+ value[i] = iterate(prop, value[i], options);
4346
+ }
4347
+ } else if (typeof value === 'object') {
4348
+ if (prop === 'fallbacks') {
4349
+ for (var innerProp in value) {
4350
+ value[innerProp] = iterate(innerProp, value[innerProp], options);
4050
4351
  }
4051
- } else if (typeof value === 'object') {
4052
- if (prop === 'fallbacks') {
4053
- style.fallbacks = styleDetector(style.fallbacks, rule, true);
4054
- continue;
4352
+ } else {
4353
+ for (var _innerProp in value) {
4354
+ value[_innerProp] = iterate(prop + "-" + _innerProp, value[_innerProp], options);
4055
4355
  }
4356
+ } // eslint-disable-next-line no-restricted-globals
4056
4357
 
4057
- style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values
4358
+ } else if (typeof value === 'number' && isNaN(value) === false) {
4359
+ var unit = options[prop] || units[prop]; // Add the unit if available, except for the special case of 0px.
4058
4360
 
4059
- if (!style[prop].length) delete style[prop];
4060
- } // Maybe a computed value resulting in an empty string
4061
- else if (style[prop] === '') delete style[prop];
4361
+ if (unit && !(value === 0 && unit === px)) {
4362
+ return typeof unit === 'function' ? unit(value).toString() : "" + value + unit;
4363
+ }
4364
+
4365
+ return value.toString();
4062
4366
  }
4063
4367
 
4064
- return style;
4368
+ return value;
4065
4369
  }
4066
4370
  /**
4067
- * Adds possibility to write expanded styles.
4371
+ * Add unit to numeric values.
4068
4372
  */
4069
4373
 
4070
4374
 
4071
- function jssExpand() {
4072
- function onProcessStyle(style, rule) {
4073
- if (!style || rule.type !== 'style') return style;
4074
-
4075
- if (Array.isArray(style)) {
4076
- // Pass rules one by one and reformat them
4077
- for (var index = 0; index < style.length; index++) {
4078
- style[index] = styleDetector(style[index], rule);
4079
- }
4080
-
4081
- return style;
4082
- }
4083
-
4084
- return styleDetector(style, rule);
4375
+ function defaultUnit(options) {
4376
+ if (options === void 0) {
4377
+ options = {};
4085
4378
  }
4086
4379
 
4087
- return {
4088
- onProcessStyle: onProcessStyle
4089
- };
4090
- }
4091
-
4092
- var cssVendor_cjs = {};
4093
-
4094
- var require$$0 = /*@__PURE__*/getAugmentedNamespace(module$1);
4095
-
4096
- var toConsumableArray = {exports: {}};
4097
-
4098
- var arrayWithoutHoles = {exports: {}};
4099
-
4100
- var arrayLikeToArray = {exports: {}};
4101
-
4102
- (function (module) {
4103
- function _arrayLikeToArray(arr, len) {
4104
- if (len == null || len > arr.length) len = arr.length;
4105
-
4106
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
4107
- arr2[i] = arr[i];
4108
- }
4109
-
4110
- return arr2;
4111
- }
4112
-
4113
- module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
4114
- } (arrayLikeToArray));
4115
-
4116
- (function (module) {
4117
- var arrayLikeToArray$1 = arrayLikeToArray.exports;
4118
-
4119
- function _arrayWithoutHoles(arr) {
4120
- if (Array.isArray(arr)) return arrayLikeToArray$1(arr);
4121
- }
4122
-
4123
- module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
4124
- } (arrayWithoutHoles));
4125
-
4126
- var iterableToArray = {exports: {}};
4127
-
4128
- (function (module) {
4129
- function _iterableToArray(iter) {
4130
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
4131
- }
4132
-
4133
- module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
4134
- } (iterableToArray));
4135
-
4136
- var unsupportedIterableToArray = {exports: {}};
4137
-
4138
- (function (module) {
4139
- var arrayLikeToArray$1 = arrayLikeToArray.exports;
4140
-
4141
- function _unsupportedIterableToArray(o, minLen) {
4142
- if (!o) return;
4143
- if (typeof o === "string") return arrayLikeToArray$1(o, minLen);
4144
- var n = Object.prototype.toString.call(o).slice(8, -1);
4145
- if (n === "Object" && o.constructor) n = o.constructor.name;
4146
- if (n === "Map" || n === "Set") return Array.from(o);
4147
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray$1(o, minLen);
4148
- }
4149
-
4150
- module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
4151
- } (unsupportedIterableToArray));
4152
-
4153
- var nonIterableSpread = {exports: {}};
4154
-
4155
- (function (module) {
4156
- function _nonIterableSpread() {
4157
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4158
- }
4159
-
4160
- module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
4161
- } (nonIterableSpread));
4162
-
4163
- (function (module) {
4164
- var arrayWithoutHoles$1 = arrayWithoutHoles.exports;
4165
-
4166
- var iterableToArray$1 = iterableToArray.exports;
4167
-
4168
- var unsupportedIterableToArray$1 = unsupportedIterableToArray.exports;
4169
-
4170
- var nonIterableSpread$1 = nonIterableSpread.exports;
4171
-
4172
- function _toConsumableArray(arr) {
4173
- return arrayWithoutHoles$1(arr) || iterableToArray$1(arr) || unsupportedIterableToArray$1(arr) || nonIterableSpread$1();
4174
- }
4175
-
4176
- module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
4177
- } (toConsumableArray));
4178
-
4179
- Object.defineProperty(cssVendor_cjs, '__esModule', { value: true });
4180
-
4181
- function _interopDefault$1 (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4182
-
4183
- var isInBrowser = _interopDefault$1(require$$0);
4184
- var _toConsumableArray = _interopDefault$1(toConsumableArray.exports);
4185
-
4186
- // Export javascript style and css style vendor prefixes.
4187
- var js = '';
4188
- var css = '';
4189
- var vendor = '';
4190
- var browser = '';
4191
- var isTouch = isInBrowser && 'ontouchstart' in document.documentElement; // We should not do anything if required serverside.
4192
-
4193
- if (isInBrowser) {
4194
- // Order matters. We need to check Webkit the last one because
4195
- // other vendors use to add Webkit prefixes to some properties
4196
- var jsCssMap = {
4197
- Moz: '-moz-',
4198
- ms: '-ms-',
4199
- O: '-o-',
4200
- Webkit: '-webkit-'
4201
- };
4202
-
4203
- var _document$createEleme = document.createElement('p'),
4204
- style = _document$createEleme.style;
4205
-
4206
- var testProp = 'Transform';
4207
-
4208
- for (var key in jsCssMap) {
4209
- if (key + testProp in style) {
4210
- js = key;
4211
- css = jsCssMap[key];
4212
- break;
4213
- }
4214
- } // Correctly detect the Edge browser.
4215
-
4216
-
4217
- if (js === 'Webkit' && 'msHyphens' in style) {
4218
- js = 'ms';
4219
- css = jsCssMap.ms;
4220
- browser = 'edge';
4221
- } // Correctly detect the Safari browser.
4380
+ var camelCasedOptions = addCamelCasedVersion(options);
4222
4381
 
4382
+ function onProcessStyle(style, rule) {
4383
+ if (rule.type !== 'style') return style;
4223
4384
 
4224
- if (js === 'Webkit' && '-apple-trailing-word' in style) {
4225
- vendor = 'apple';
4226
- }
4227
- }
4228
- /**
4229
- * Vendor prefix string for the current browser.
4230
- *
4231
- * @type {{js: String, css: String, vendor: String, browser: String}}
4232
- * @api public
4233
- */
4385
+ for (var prop in style) {
4386
+ style[prop] = iterate(prop, style[prop], camelCasedOptions);
4387
+ }
4234
4388
 
4389
+ return style;
4390
+ }
4235
4391
 
4236
- var prefix = {
4237
- js: js,
4238
- css: css,
4239
- vendor: vendor,
4240
- browser: browser,
4241
- isTouch: isTouch
4242
- };
4392
+ function onChangeValue(value, prop) {
4393
+ return iterate(prop, value, camelCasedOptions);
4394
+ }
4395
+
4396
+ return {
4397
+ onProcessStyle: onProcessStyle,
4398
+ onChangeValue: onChangeValue
4399
+ };
4400
+ }
4243
4401
 
4244
4402
  /**
4245
- * Test if a keyframe at-rule should be prefixed or not
4246
- *
4247
- * @param {String} vendor prefix string for the current browser.
4248
- * @return {String}
4249
- * @api public
4403
+ * A scheme for converting properties from array to regular style.
4404
+ * All properties listed below will be transformed to a string separated by space.
4250
4405
  */
4406
+ var propArray = {
4407
+ 'background-size': true,
4408
+ 'background-position': true,
4409
+ border: true,
4410
+ 'border-bottom': true,
4411
+ 'border-left': true,
4412
+ 'border-top': true,
4413
+ 'border-right': true,
4414
+ 'border-radius': true,
4415
+ 'border-image': true,
4416
+ 'border-width': true,
4417
+ 'border-style': true,
4418
+ 'border-color': true,
4419
+ 'box-shadow': true,
4420
+ flex: true,
4421
+ margin: true,
4422
+ padding: true,
4423
+ outline: true,
4424
+ 'transform-origin': true,
4425
+ transform: true,
4426
+ transition: true
4427
+ /**
4428
+ * A scheme for converting arrays to regular styles inside of objects.
4429
+ * For e.g.: "{position: [0, 0]}" => "background-position: 0 0;".
4430
+ */
4251
4431
 
4252
- function supportedKeyframes(key) {
4253
- // Keyframes is already prefixed. e.g. key = '@-webkit-keyframes a'
4254
- if (key[1] === '-') return key; // No need to prefix IE/Edge. Older browsers will ignore unsupported rules.
4255
- // https://caniuse.com/#search=keyframes
4256
-
4257
- if (prefix.js === 'ms') return key;
4258
- return "@" + prefix.css + "keyframes" + key.substr(10);
4259
- }
4432
+ };
4433
+ var propArrayInObj = {
4434
+ position: true,
4435
+ // background-position
4436
+ size: true // background-size
4260
4437
 
4261
- // https://caniuse.com/#search=appearance
4438
+ /**
4439
+ * A scheme for parsing and building correct styles from passed objects.
4440
+ */
4262
4441
 
4263
- var appearence = {
4264
- noPrefill: ['appearance'],
4265
- supportedProperty: function supportedProperty(prop) {
4266
- if (prop !== 'appearance') return false;
4267
- if (prefix.js === 'ms') return "-webkit-" + prop;
4268
- return prefix.css + prop;
4269
- }
4270
4442
  };
4443
+ var propObj = {
4444
+ padding: {
4445
+ top: 0,
4446
+ right: 0,
4447
+ bottom: 0,
4448
+ left: 0
4449
+ },
4450
+ margin: {
4451
+ top: 0,
4452
+ right: 0,
4453
+ bottom: 0,
4454
+ left: 0
4455
+ },
4456
+ background: {
4457
+ attachment: null,
4458
+ color: null,
4459
+ image: null,
4460
+ position: null,
4461
+ repeat: null
4462
+ },
4463
+ border: {
4464
+ width: null,
4465
+ style: null,
4466
+ color: null
4467
+ },
4468
+ 'border-top': {
4469
+ width: null,
4470
+ style: null,
4471
+ color: null
4472
+ },
4473
+ 'border-right': {
4474
+ width: null,
4475
+ style: null,
4476
+ color: null
4477
+ },
4478
+ 'border-bottom': {
4479
+ width: null,
4480
+ style: null,
4481
+ color: null
4482
+ },
4483
+ 'border-left': {
4484
+ width: null,
4485
+ style: null,
4486
+ color: null
4487
+ },
4488
+ outline: {
4489
+ width: null,
4490
+ style: null,
4491
+ color: null
4492
+ },
4493
+ 'list-style': {
4494
+ type: null,
4495
+ position: null,
4496
+ image: null
4497
+ },
4498
+ transition: {
4499
+ property: null,
4500
+ duration: null,
4501
+ 'timing-function': null,
4502
+ timingFunction: null,
4503
+ // Needed for avoiding comilation issues with jss-plugin-camel-case
4504
+ delay: null
4505
+ },
4506
+ animation: {
4507
+ name: null,
4508
+ duration: null,
4509
+ 'timing-function': null,
4510
+ timingFunction: null,
4511
+ // Needed to avoid compilation issues with jss-plugin-camel-case
4512
+ delay: null,
4513
+ 'iteration-count': null,
4514
+ iterationCount: null,
4515
+ // Needed to avoid compilation issues with jss-plugin-camel-case
4516
+ direction: null,
4517
+ 'fill-mode': null,
4518
+ fillMode: null,
4519
+ // Needed to avoid compilation issues with jss-plugin-camel-case
4520
+ 'play-state': null,
4521
+ playState: null // Needed to avoid compilation issues with jss-plugin-camel-case
4271
4522
 
4272
- // https://caniuse.com/#search=color-adjust
4523
+ },
4524
+ 'box-shadow': {
4525
+ x: 0,
4526
+ y: 0,
4527
+ blur: 0,
4528
+ spread: 0,
4529
+ color: null,
4530
+ inset: null
4531
+ },
4532
+ 'text-shadow': {
4533
+ x: 0,
4534
+ y: 0,
4535
+ blur: null,
4536
+ color: null
4537
+ }
4538
+ /**
4539
+ * A scheme for converting non-standart properties inside object.
4540
+ * For e.g.: include 'border-radius' property inside 'border' object.
4541
+ */
4273
4542
 
4274
- var colorAdjust = {
4275
- noPrefill: ['color-adjust'],
4276
- supportedProperty: function supportedProperty(prop) {
4277
- if (prop !== 'color-adjust') return false;
4278
- if (prefix.js === 'Webkit') return prefix.css + "print-" + prop;
4279
- return prop;
4543
+ };
4544
+ var customPropObj = {
4545
+ border: {
4546
+ radius: 'border-radius',
4547
+ image: 'border-image',
4548
+ width: 'border-width',
4549
+ style: 'border-style',
4550
+ color: 'border-color'
4551
+ },
4552
+ 'border-bottom': {
4553
+ width: 'border-bottom-width',
4554
+ style: 'border-bottom-style',
4555
+ color: 'border-bottom-color'
4556
+ },
4557
+ 'border-top': {
4558
+ width: 'border-top-width',
4559
+ style: 'border-top-style',
4560
+ color: 'border-top-color'
4561
+ },
4562
+ 'border-left': {
4563
+ width: 'border-left-width',
4564
+ style: 'border-left-style',
4565
+ color: 'border-left-color'
4566
+ },
4567
+ 'border-right': {
4568
+ width: 'border-right-width',
4569
+ style: 'border-right-style',
4570
+ color: 'border-right-color'
4571
+ },
4572
+ background: {
4573
+ size: 'background-size',
4574
+ image: 'background-image'
4575
+ },
4576
+ font: {
4577
+ style: 'font-style',
4578
+ variant: 'font-variant',
4579
+ weight: 'font-weight',
4580
+ stretch: 'font-stretch',
4581
+ size: 'font-size',
4582
+ family: 'font-family',
4583
+ lineHeight: 'line-height',
4584
+ // Needed to avoid compilation issues with jss-plugin-camel-case
4585
+ 'line-height': 'line-height'
4586
+ },
4587
+ flex: {
4588
+ grow: 'flex-grow',
4589
+ basis: 'flex-basis',
4590
+ direction: 'flex-direction',
4591
+ wrap: 'flex-wrap',
4592
+ flow: 'flex-flow',
4593
+ shrink: 'flex-shrink'
4594
+ },
4595
+ align: {
4596
+ self: 'align-self',
4597
+ items: 'align-items',
4598
+ content: 'align-content'
4599
+ },
4600
+ grid: {
4601
+ 'template-columns': 'grid-template-columns',
4602
+ templateColumns: 'grid-template-columns',
4603
+ 'template-rows': 'grid-template-rows',
4604
+ templateRows: 'grid-template-rows',
4605
+ 'template-areas': 'grid-template-areas',
4606
+ templateAreas: 'grid-template-areas',
4607
+ template: 'grid-template',
4608
+ 'auto-columns': 'grid-auto-columns',
4609
+ autoColumns: 'grid-auto-columns',
4610
+ 'auto-rows': 'grid-auto-rows',
4611
+ autoRows: 'grid-auto-rows',
4612
+ 'auto-flow': 'grid-auto-flow',
4613
+ autoFlow: 'grid-auto-flow',
4614
+ row: 'grid-row',
4615
+ column: 'grid-column',
4616
+ 'row-start': 'grid-row-start',
4617
+ rowStart: 'grid-row-start',
4618
+ 'row-end': 'grid-row-end',
4619
+ rowEnd: 'grid-row-end',
4620
+ 'column-start': 'grid-column-start',
4621
+ columnStart: 'grid-column-start',
4622
+ 'column-end': 'grid-column-end',
4623
+ columnEnd: 'grid-column-end',
4624
+ area: 'grid-area',
4625
+ gap: 'grid-gap',
4626
+ 'row-gap': 'grid-row-gap',
4627
+ rowGap: 'grid-row-gap',
4628
+ 'column-gap': 'grid-column-gap',
4629
+ columnGap: 'grid-column-gap'
4280
4630
  }
4281
4631
  };
4282
4632
 
4283
- var regExp = /[-\s]+(.)?/g;
4633
+ /* eslint-disable no-use-before-define */
4284
4634
  /**
4285
- * Replaces the letter with the capital letter
4635
+ * Map values by given prop.
4286
4636
  *
4287
- * @param {String} match
4288
- * @param {String} c
4289
- * @return {String}
4290
- * @api private
4637
+ * @param {Array} array of values
4638
+ * @param {String} original property
4639
+ * @param {String} original rule
4640
+ * @return {String} mapped values
4291
4641
  */
4292
4642
 
4293
- function toUpper(match, c) {
4294
- return c ? c.toUpperCase() : '';
4643
+ function mapValuesByProp(value, prop, rule) {
4644
+ return value.map(function (item) {
4645
+ return objectToArray(item, prop, rule, false, true);
4646
+ });
4295
4647
  }
4296
4648
  /**
4297
- * Convert dash separated strings to camel-cased.
4298
- *
4299
- * @param {String} str
4300
- * @return {String}
4301
- * @api private
4649
+ * Convert array to nested array, if needed
4302
4650
  */
4303
4651
 
4304
4652
 
4305
- function camelize(str) {
4306
- return str.replace(regExp, toUpper);
4307
- }
4653
+ function processArray(value, prop, scheme, rule) {
4654
+ if (scheme[prop] == null) return value;
4655
+ if (value.length === 0) return [];
4656
+ if (Array.isArray(value[0])) return processArray(value[0], prop, scheme, rule);
4657
+
4658
+ if (typeof value[0] === 'object') {
4659
+ return mapValuesByProp(value, prop, rule);
4660
+ }
4308
4661
 
4662
+ return [value];
4663
+ }
4309
4664
  /**
4310
- * Convert dash separated strings to pascal cased.
4311
- *
4312
- * @param {String} str
4313
- * @return {String}
4314
- * @api private
4665
+ * Convert object to array.
4315
4666
  */
4316
4667
 
4317
- function pascalize(str) {
4318
- return camelize("-" + str);
4319
- }
4320
4668
 
4321
- // but we can use a longhand property instead.
4322
- // https://caniuse.com/#search=mask
4669
+ function objectToArray(value, prop, rule, isFallback, isInArray) {
4670
+ if (!(propObj[prop] || customPropObj[prop])) return [];
4671
+ var result = []; // Check if exists any non-standard property
4323
4672
 
4324
- var mask = {
4325
- noPrefill: ['mask'],
4326
- supportedProperty: function supportedProperty(prop, style) {
4327
- if (!/^mask/.test(prop)) return false;
4673
+ if (customPropObj[prop]) {
4674
+ // eslint-disable-next-line no-param-reassign
4675
+ value = customPropsToStyle(value, rule, customPropObj[prop], isFallback);
4676
+ } // Pass throught all standart props
4328
4677
 
4329
- if (prefix.js === 'Webkit') {
4330
- var longhand = 'mask-image';
4331
4678
 
4332
- if (camelize(longhand) in style) {
4333
- return prop;
4334
- }
4679
+ if (Object.keys(value).length) {
4680
+ for (var baseProp in propObj[prop]) {
4681
+ if (value[baseProp]) {
4682
+ if (Array.isArray(value[baseProp])) {
4683
+ result.push(propArrayInObj[baseProp] === null ? value[baseProp] : value[baseProp].join(' '));
4684
+ } else result.push(value[baseProp]);
4335
4685
 
4336
- if (prefix.js + pascalize(longhand) in style) {
4337
- return prefix.css + prop;
4686
+ continue;
4687
+ } // Add default value from props config.
4688
+
4689
+
4690
+ if (propObj[prop][baseProp] != null) {
4691
+ result.push(propObj[prop][baseProp]);
4338
4692
  }
4339
4693
  }
4340
-
4341
- return prop;
4342
4694
  }
4343
- };
4344
4695
 
4345
- // https://caniuse.com/#search=text-orientation
4696
+ if (!result.length || isInArray) return result;
4697
+ return [result];
4698
+ }
4699
+ /**
4700
+ * Convert custom properties values to styles adding them to rule directly
4701
+ */
4346
4702
 
4347
- var textOrientation = {
4348
- noPrefill: ['text-orientation'],
4349
- supportedProperty: function supportedProperty(prop) {
4350
- if (prop !== 'text-orientation') return false;
4351
4703
 
4352
- if (prefix.vendor === 'apple' && !prefix.isTouch) {
4353
- return prefix.css + prop;
4354
- }
4704
+ function customPropsToStyle(value, rule, customProps, isFallback) {
4705
+ for (var prop in customProps) {
4706
+ var propName = customProps[prop]; // If current property doesn't exist already in rule - add new one
4355
4707
 
4356
- return prop;
4357
- }
4358
- };
4708
+ if (typeof value[prop] !== 'undefined' && (isFallback || !rule.prop(propName))) {
4709
+ var _styleDetector;
4359
4710
 
4360
- // https://caniuse.com/#search=transform
4711
+ var appendedValue = styleDetector((_styleDetector = {}, _styleDetector[propName] = value[prop], _styleDetector), rule)[propName]; // Add style directly in rule
4361
4712
 
4362
- var transform = {
4363
- noPrefill: ['transform'],
4364
- supportedProperty: function supportedProperty(prop, style, options) {
4365
- if (prop !== 'transform') return false;
4713
+ if (isFallback) rule.style.fallbacks[propName] = appendedValue;else rule.style[propName] = appendedValue;
4714
+ } // Delete converted property to avoid double converting
4366
4715
 
4367
- if (options.transform) {
4368
- return prop;
4369
- }
4370
4716
 
4371
- return prefix.css + prop;
4717
+ delete value[prop];
4372
4718
  }
4373
- };
4374
4719
 
4375
- // https://caniuse.com/#search=transition
4720
+ return value;
4721
+ }
4722
+ /**
4723
+ * Detect if a style needs to be converted.
4724
+ */
4376
4725
 
4377
- var transition = {
4378
- noPrefill: ['transition'],
4379
- supportedProperty: function supportedProperty(prop, style, options) {
4380
- if (prop !== 'transition') return false;
4381
4726
 
4382
- if (options.transition) {
4383
- return prop;
4384
- }
4727
+ function styleDetector(style, rule, isFallback) {
4728
+ for (var prop in style) {
4729
+ var value = style[prop];
4385
4730
 
4386
- return prefix.css + prop;
4387
- }
4388
- };
4731
+ if (Array.isArray(value)) {
4732
+ // Check double arrays to avoid recursion.
4733
+ if (!Array.isArray(value[0])) {
4734
+ if (prop === 'fallbacks') {
4735
+ for (var index = 0; index < style.fallbacks.length; index++) {
4736
+ style.fallbacks[index] = styleDetector(style.fallbacks[index], rule, true);
4737
+ }
4389
4738
 
4390
- // https://caniuse.com/#search=writing-mode
4739
+ continue;
4740
+ }
4391
4741
 
4392
- var writingMode = {
4393
- noPrefill: ['writing-mode'],
4394
- supportedProperty: function supportedProperty(prop) {
4395
- if (prop !== 'writing-mode') return false;
4742
+ style[prop] = processArray(value, prop, propArray, rule); // Avoid creating properties with empty values
4396
4743
 
4397
- if (prefix.js === 'Webkit' || prefix.js === 'ms' && prefix.browser !== 'edge') {
4398
- return prefix.css + prop;
4399
- }
4744
+ if (!style[prop].length) delete style[prop];
4745
+ }
4746
+ } else if (typeof value === 'object') {
4747
+ if (prop === 'fallbacks') {
4748
+ style.fallbacks = styleDetector(style.fallbacks, rule, true);
4749
+ continue;
4750
+ }
4400
4751
 
4401
- return prop;
4752
+ style[prop] = objectToArray(value, prop, rule, isFallback); // Avoid creating properties with empty values
4753
+
4754
+ if (!style[prop].length) delete style[prop];
4755
+ } // Maybe a computed value resulting in an empty string
4756
+ else if (style[prop] === '') delete style[prop];
4402
4757
  }
4403
- };
4404
4758
 
4405
- // https://caniuse.com/#search=user-select
4759
+ return style;
4760
+ }
4761
+ /**
4762
+ * Adds possibility to write expanded styles.
4763
+ */
4406
4764
 
4407
- var userSelect = {
4408
- noPrefill: ['user-select'],
4409
- supportedProperty: function supportedProperty(prop) {
4410
- if (prop !== 'user-select') return false;
4411
4765
 
4412
- if (prefix.js === 'Moz' || prefix.js === 'ms' || prefix.vendor === 'apple') {
4413
- return prefix.css + prop;
4766
+ function jssExpand() {
4767
+ function onProcessStyle(style, rule) {
4768
+ if (!style || rule.type !== 'style') return style;
4769
+
4770
+ if (Array.isArray(style)) {
4771
+ // Pass rules one by one and reformat them
4772
+ for (var index = 0; index < style.length; index++) {
4773
+ style[index] = styleDetector(style[index], rule);
4774
+ }
4775
+
4776
+ return style;
4414
4777
  }
4415
4778
 
4416
- return prop;
4779
+ return styleDetector(style, rule);
4417
4780
  }
4418
- };
4419
-
4420
- // https://caniuse.com/#search=multicolumn
4421
- // https://github.com/postcss/autoprefixer/issues/491
4422
- // https://github.com/postcss/autoprefixer/issues/177
4423
4781
 
4424
- var breakPropsOld = {
4425
- supportedProperty: function supportedProperty(prop, style) {
4426
- if (!/^break-/.test(prop)) return false;
4782
+ return {
4783
+ onProcessStyle: onProcessStyle
4784
+ };
4785
+ }
4427
4786
 
4428
- if (prefix.js === 'Webkit') {
4429
- var jsProp = "WebkitColumn" + pascalize(prop);
4430
- return jsProp in style ? prefix.css + "column-" + prop : false;
4431
- }
4787
+ var cssVendor_cjs = {};
4432
4788
 
4433
- if (prefix.js === 'Moz') {
4434
- var _jsProp = "page" + pascalize(prop);
4789
+ var require$$0 = /*@__PURE__*/getAugmentedNamespace(module$1);
4435
4790
 
4436
- return _jsProp in style ? "page-" + prop : false;
4437
- }
4791
+ var toConsumableArray = {exports: {}};
4438
4792
 
4439
- return false;
4440
- }
4441
- };
4793
+ var arrayWithoutHoles = {exports: {}};
4442
4794
 
4443
- // See https://github.com/postcss/autoprefixer/issues/324.
4795
+ var arrayLikeToArray = {exports: {}};
4444
4796
 
4445
- var inlineLogicalOld = {
4446
- supportedProperty: function supportedProperty(prop, style) {
4447
- if (!/^(border|margin|padding)-inline/.test(prop)) return false;
4448
- if (prefix.js === 'Moz') return prop;
4449
- var newProp = prop.replace('-inline', '');
4450
- return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;
4451
- }
4452
- };
4797
+ (function (module) {
4798
+ function _arrayLikeToArray(arr, len) {
4799
+ if (len == null || len > arr.length) len = arr.length;
4800
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
4801
+ arr2[i] = arr[i];
4802
+ }
4803
+ return arr2;
4804
+ }
4805
+ module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
4806
+ } (arrayLikeToArray));
4453
4807
 
4454
- // Camelization is required because we can't test using.
4455
- // CSS syntax for e.g. in FF.
4808
+ (function (module) {
4809
+ var arrayLikeToArray$1 = arrayLikeToArray.exports;
4810
+ function _arrayWithoutHoles(arr) {
4811
+ if (Array.isArray(arr)) return arrayLikeToArray$1(arr);
4812
+ }
4813
+ module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
4814
+ } (arrayWithoutHoles));
4456
4815
 
4457
- var unprefixed = {
4458
- supportedProperty: function supportedProperty(prop, style) {
4459
- return camelize(prop) in style ? prop : false;
4460
- }
4461
- };
4816
+ var iterableToArray = {exports: {}};
4462
4817
 
4463
- var prefixed = {
4464
- supportedProperty: function supportedProperty(prop, style) {
4465
- var pascalized = pascalize(prop); // Return custom CSS variable without prefixing.
4818
+ (function (module) {
4819
+ function _iterableToArray(iter) {
4820
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
4821
+ }
4822
+ module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
4823
+ } (iterableToArray));
4466
4824
 
4467
- if (prop[0] === '-') return prop; // Return already prefixed value without prefixing.
4825
+ var unsupportedIterableToArray = {exports: {}};
4468
4826
 
4469
- if (prop[0] === '-' && prop[1] === '-') return prop;
4470
- if (prefix.js + pascalized in style) return prefix.css + prop; // Try webkit fallback.
4827
+ (function (module) {
4828
+ var arrayLikeToArray$1 = arrayLikeToArray.exports;
4829
+ function _unsupportedIterableToArray(o, minLen) {
4830
+ if (!o) return;
4831
+ if (typeof o === "string") return arrayLikeToArray$1(o, minLen);
4832
+ var n = Object.prototype.toString.call(o).slice(8, -1);
4833
+ if (n === "Object" && o.constructor) n = o.constructor.name;
4834
+ if (n === "Map" || n === "Set") return Array.from(o);
4835
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray$1(o, minLen);
4836
+ }
4837
+ module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
4838
+ } (unsupportedIterableToArray));
4471
4839
 
4472
- if (prefix.js !== 'Webkit' && "Webkit" + pascalized in style) return "-webkit-" + prop;
4473
- return false;
4474
- }
4475
- };
4840
+ var nonIterableSpread = {exports: {}};
4476
4841
 
4477
- // https://caniuse.com/#search=scroll-snap
4842
+ (function (module) {
4843
+ function _nonIterableSpread() {
4844
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4845
+ }
4846
+ module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
4847
+ } (nonIterableSpread));
4478
4848
 
4479
- var scrollSnap = {
4480
- supportedProperty: function supportedProperty(prop) {
4481
- if (prop.substring(0, 11) !== 'scroll-snap') return false;
4849
+ (function (module) {
4850
+ var arrayWithoutHoles$1 = arrayWithoutHoles.exports;
4851
+ var iterableToArray$1 = iterableToArray.exports;
4852
+ var unsupportedIterableToArray$1 = unsupportedIterableToArray.exports;
4853
+ var nonIterableSpread$1 = nonIterableSpread.exports;
4854
+ function _toConsumableArray(arr) {
4855
+ return arrayWithoutHoles$1(arr) || iterableToArray$1(arr) || unsupportedIterableToArray$1(arr) || nonIterableSpread$1();
4856
+ }
4857
+ module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
4858
+ } (toConsumableArray));
4482
4859
 
4483
- if (prefix.js === 'ms') {
4484
- return "" + prefix.css + prop;
4485
- }
4860
+ Object.defineProperty(cssVendor_cjs, '__esModule', { value: true });
4486
4861
 
4487
- return prop;
4488
- }
4489
- };
4862
+ function _interopDefault$1 (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4490
4863
 
4491
- // https://caniuse.com/#search=overscroll-behavior
4864
+ var isInBrowser = _interopDefault$1(require$$0);
4865
+ var _toConsumableArray = _interopDefault$1(toConsumableArray.exports);
4492
4866
 
4493
- var overscrollBehavior = {
4494
- supportedProperty: function supportedProperty(prop) {
4495
- if (prop !== 'overscroll-behavior') return false;
4867
+ // Export javascript style and css style vendor prefixes.
4868
+ var js = '';
4869
+ var css = '';
4870
+ var vendor = '';
4871
+ var browser = '';
4872
+ var isTouch = isInBrowser && 'ontouchstart' in document.documentElement; // We should not do anything if required serverside.
4496
4873
 
4497
- if (prefix.js === 'ms') {
4498
- return prefix.css + "scroll-chaining";
4499
- }
4874
+ if (isInBrowser) {
4875
+ // Order matters. We need to check Webkit the last one because
4876
+ // other vendors use to add Webkit prefixes to some properties
4877
+ var jsCssMap = {
4878
+ Moz: '-moz-',
4879
+ ms: '-ms-',
4880
+ O: '-o-',
4881
+ Webkit: '-webkit-'
4882
+ };
4500
4883
 
4501
- return prop;
4502
- }
4503
- };
4884
+ var _document$createEleme = document.createElement('p'),
4885
+ style = _document$createEleme.style;
4504
4886
 
4505
- var propMap = {
4506
- 'flex-grow': 'flex-positive',
4507
- 'flex-shrink': 'flex-negative',
4508
- 'flex-basis': 'flex-preferred-size',
4509
- 'justify-content': 'flex-pack',
4510
- order: 'flex-order',
4511
- 'align-items': 'flex-align',
4512
- 'align-content': 'flex-line-pack' // 'align-self' is handled by 'align-self' plugin.
4887
+ var testProp = 'Transform';
4513
4888
 
4514
- }; // Support old flex spec from 2012.
4889
+ for (var key in jsCssMap) {
4890
+ if (key + testProp in style) {
4891
+ js = key;
4892
+ css = jsCssMap[key];
4893
+ break;
4894
+ }
4895
+ } // Correctly detect the Edge browser.
4515
4896
 
4516
- var flex2012 = {
4517
- supportedProperty: function supportedProperty(prop, style) {
4518
- var newProp = propMap[prop];
4519
- if (!newProp) return false;
4520
- return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;
4521
- }
4522
- };
4523
4897
 
4524
- var propMap$1 = {
4525
- flex: 'box-flex',
4526
- 'flex-grow': 'box-flex',
4527
- 'flex-direction': ['box-orient', 'box-direction'],
4528
- order: 'box-ordinal-group',
4529
- 'align-items': 'box-align',
4530
- 'flex-flow': ['box-orient', 'box-direction'],
4531
- 'justify-content': 'box-pack'
4532
- };
4533
- var propKeys = Object.keys(propMap$1);
4898
+ if (js === 'Webkit' && 'msHyphens' in style) {
4899
+ js = 'ms';
4900
+ css = jsCssMap.ms;
4901
+ browser = 'edge';
4902
+ } // Correctly detect the Safari browser.
4534
4903
 
4535
- var prefixCss = function prefixCss(p) {
4536
- return prefix.css + p;
4537
- }; // Support old flex spec from 2009.
4538
4904
 
4905
+ if (js === 'Webkit' && '-apple-trailing-word' in style) {
4906
+ vendor = 'apple';
4907
+ }
4908
+ }
4909
+ /**
4910
+ * Vendor prefix string for the current browser.
4911
+ *
4912
+ * @type {{js: String, css: String, vendor: String, browser: String}}
4913
+ * @api public
4914
+ */
4539
4915
 
4540
- var flex2009 = {
4541
- supportedProperty: function supportedProperty(prop, style, _ref) {
4542
- var multiple = _ref.multiple;
4543
4916
 
4544
- if (propKeys.indexOf(prop) > -1) {
4545
- var newProp = propMap$1[prop];
4917
+ var prefix = {
4918
+ js: js,
4919
+ css: css,
4920
+ vendor: vendor,
4921
+ browser: browser,
4922
+ isTouch: isTouch
4923
+ };
4546
4924
 
4547
- if (!Array.isArray(newProp)) {
4548
- return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;
4549
- }
4925
+ /**
4926
+ * Test if a keyframe at-rule should be prefixed or not
4927
+ *
4928
+ * @param {String} vendor prefix string for the current browser.
4929
+ * @return {String}
4930
+ * @api public
4931
+ */
4550
4932
 
4551
- if (!multiple) return false;
4933
+ function supportedKeyframes(key) {
4934
+ // Keyframes is already prefixed. e.g. key = '@-webkit-keyframes a'
4935
+ if (key[1] === '-') return key; // No need to prefix IE/Edge. Older browsers will ignore unsupported rules.
4936
+ // https://caniuse.com/#search=keyframes
4552
4937
 
4553
- for (var i = 0; i < newProp.length; i++) {
4554
- if (!(prefix.js + pascalize(newProp[0]) in style)) {
4555
- return false;
4556
- }
4557
- }
4938
+ if (prefix.js === 'ms') return key;
4939
+ return "@" + prefix.css + "keyframes" + key.substr(10);
4940
+ }
4558
4941
 
4559
- return newProp.map(prefixCss);
4560
- }
4942
+ // https://caniuse.com/#search=appearance
4561
4943
 
4562
- return false;
4944
+ var appearence = {
4945
+ noPrefill: ['appearance'],
4946
+ supportedProperty: function supportedProperty(prop) {
4947
+ if (prop !== 'appearance') return false;
4948
+ if (prefix.js === 'ms') return "-webkit-" + prop;
4949
+ return prefix.css + prop;
4563
4950
  }
4564
4951
  };
4565
4952
 
4566
- // plugins = [
4567
- // ...plugins,
4568
- // breakPropsOld,
4569
- // inlineLogicalOld,
4570
- // unprefixed,
4571
- // prefixed,
4572
- // scrollSnap,
4573
- // flex2012,
4574
- // flex2009
4575
- // ]
4576
- // Plugins without 'noPrefill' value, going last.
4577
- // 'flex-*' plugins should be at the bottom.
4578
- // 'flex2009' going after 'flex2012'.
4579
- // 'prefixed' going after 'unprefixed'
4580
-
4581
- var plugins = [appearence, colorAdjust, mask, textOrientation, transform, transition, writingMode, userSelect, breakPropsOld, inlineLogicalOld, unprefixed, prefixed, scrollSnap, overscrollBehavior, flex2012, flex2009];
4582
- var propertyDetectors = plugins.filter(function (p) {
4583
- return p.supportedProperty;
4584
- }).map(function (p) {
4585
- return p.supportedProperty;
4586
- });
4587
- var noPrefill = plugins.filter(function (p) {
4588
- return p.noPrefill;
4589
- }).reduce(function (a, p) {
4590
- a.push.apply(a, _toConsumableArray(p.noPrefill));
4591
- return a;
4592
- }, []);
4593
-
4594
- var el;
4595
- var cache = {};
4596
-
4597
- if (isInBrowser) {
4598
- el = document.createElement('p'); // We test every property on vendor prefix requirement.
4599
- // Once tested, result is cached. It gives us up to 70% perf boost.
4600
- // http://jsperf.com/element-style-object-access-vs-plain-object
4601
- //
4602
- // Prefill cache with known css properties to reduce amount of
4603
- // properties we need to feature test at runtime.
4604
- // http://davidwalsh.name/vendor-prefix
4953
+ // https://caniuse.com/#search=color-adjust
4605
4954
 
4606
- var computed = window.getComputedStyle(document.documentElement, '');
4955
+ var colorAdjust = {
4956
+ noPrefill: ['color-adjust'],
4957
+ supportedProperty: function supportedProperty(prop) {
4958
+ if (prop !== 'color-adjust') return false;
4959
+ if (prefix.js === 'Webkit') return prefix.css + "print-" + prop;
4960
+ return prop;
4961
+ }
4962
+ };
4607
4963
 
4608
- for (var key$1 in computed) {
4609
- // eslint-disable-next-line no-restricted-globals
4610
- if (!isNaN(key$1)) cache[computed[key$1]] = computed[key$1];
4611
- } // Properties that cannot be correctly detected using the
4612
- // cache prefill method.
4964
+ var regExp = /[-\s]+(.)?/g;
4965
+ /**
4966
+ * Replaces the letter with the capital letter
4967
+ *
4968
+ * @param {String} match
4969
+ * @param {String} c
4970
+ * @return {String}
4971
+ * @api private
4972
+ */
4613
4973
 
4974
+ function toUpper(match, c) {
4975
+ return c ? c.toUpperCase() : '';
4976
+ }
4977
+ /**
4978
+ * Convert dash separated strings to camel-cased.
4979
+ *
4980
+ * @param {String} str
4981
+ * @return {String}
4982
+ * @api private
4983
+ */
4614
4984
 
4615
- noPrefill.forEach(function (x) {
4616
- return delete cache[x];
4617
- });
4985
+
4986
+ function camelize(str) {
4987
+ return str.replace(regExp, toUpper);
4618
4988
  }
4989
+
4619
4990
  /**
4620
- * Test if a property is supported, returns supported property with vendor
4621
- * prefix if required. Returns `false` if not supported.
4991
+ * Convert dash separated strings to pascal cased.
4622
4992
  *
4623
- * @param {String} prop dash separated
4624
- * @param {Object} [options]
4625
- * @return {String|Boolean}
4626
- * @api public
4993
+ * @param {String} str
4994
+ * @return {String}
4995
+ * @api private
4627
4996
  */
4628
4997
 
4998
+ function pascalize(str) {
4999
+ return camelize("-" + str);
5000
+ }
5001
+
5002
+ // but we can use a longhand property instead.
5003
+ // https://caniuse.com/#search=mask
4629
5004
 
4630
- function supportedProperty(prop, options) {
4631
- if (options === void 0) {
4632
- options = {};
5005
+ var mask = {
5006
+ noPrefill: ['mask'],
5007
+ supportedProperty: function supportedProperty(prop, style) {
5008
+ if (!/^mask/.test(prop)) return false;
5009
+
5010
+ if (prefix.js === 'Webkit') {
5011
+ var longhand = 'mask-image';
5012
+
5013
+ if (camelize(longhand) in style) {
5014
+ return prop;
5015
+ }
5016
+
5017
+ if (prefix.js + pascalize(longhand) in style) {
5018
+ return prefix.css + prop;
5019
+ }
5020
+ }
5021
+
5022
+ return prop;
4633
5023
  }
5024
+ };
4634
5025
 
4635
- // For server-side rendering.
4636
- if (!el) return prop; // Remove cache for benchmark tests or return property from the cache.
5026
+ // https://caniuse.com/#search=text-orientation
4637
5027
 
4638
- if (process.env.NODE_ENV !== 'benchmark' && cache[prop] != null) {
4639
- return cache[prop];
4640
- } // Check if 'transition' or 'transform' natively supported in browser.
5028
+ var textOrientation = {
5029
+ noPrefill: ['text-orientation'],
5030
+ supportedProperty: function supportedProperty(prop) {
5031
+ if (prop !== 'text-orientation') return false;
4641
5032
 
5033
+ if (prefix.vendor === 'apple' && !prefix.isTouch) {
5034
+ return prefix.css + prop;
5035
+ }
4642
5036
 
4643
- if (prop === 'transition' || prop === 'transform') {
4644
- options[prop] = prop in el.style;
4645
- } // Find a plugin for current prefix property.
5037
+ return prop;
5038
+ }
5039
+ };
4646
5040
 
5041
+ // https://caniuse.com/#search=transform
4647
5042
 
4648
- for (var i = 0; i < propertyDetectors.length; i++) {
4649
- cache[prop] = propertyDetectors[i](prop, el.style, options); // Break loop, if value found.
5043
+ var transform = {
5044
+ noPrefill: ['transform'],
5045
+ supportedProperty: function supportedProperty(prop, style, options) {
5046
+ if (prop !== 'transform') return false;
4650
5047
 
4651
- if (cache[prop]) break;
4652
- } // Reset styles for current property.
4653
- // Firefox can even throw an error for invalid properties, e.g., "0".
5048
+ if (options.transform) {
5049
+ return prop;
5050
+ }
4654
5051
 
5052
+ return prefix.css + prop;
5053
+ }
5054
+ };
4655
5055
 
4656
- try {
4657
- el.style[prop] = '';
4658
- } catch (err) {
4659
- return false;
5056
+ // https://caniuse.com/#search=transition
5057
+
5058
+ var transition = {
5059
+ noPrefill: ['transition'],
5060
+ supportedProperty: function supportedProperty(prop, style, options) {
5061
+ if (prop !== 'transition') return false;
5062
+
5063
+ if (options.transition) {
5064
+ return prop;
5065
+ }
5066
+
5067
+ return prefix.css + prop;
4660
5068
  }
5069
+ };
4661
5070
 
4662
- return cache[prop];
4663
- }
5071
+ // https://caniuse.com/#search=writing-mode
4664
5072
 
4665
- var cache$1 = {};
4666
- var transitionProperties = {
4667
- transition: 1,
4668
- 'transition-property': 1,
4669
- '-webkit-transition': 1,
4670
- '-webkit-transition-property': 1
5073
+ var writingMode = {
5074
+ noPrefill: ['writing-mode'],
5075
+ supportedProperty: function supportedProperty(prop) {
5076
+ if (prop !== 'writing-mode') return false;
5077
+
5078
+ if (prefix.js === 'Webkit' || prefix.js === 'ms' && prefix.browser !== 'edge') {
5079
+ return prefix.css + prop;
5080
+ }
5081
+
5082
+ return prop;
5083
+ }
4671
5084
  };
4672
- var transPropsRegExp = /(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;
4673
- var el$1;
4674
- /**
4675
- * Returns prefixed value transition/transform if needed.
4676
- *
4677
- * @param {String} match
4678
- * @param {String} p1
4679
- * @param {String} p2
4680
- * @return {String}
4681
- * @api private
4682
- */
4683
5085
 
4684
- function prefixTransitionCallback(match, p1, p2) {
4685
- if (p1 === 'var') return 'var';
4686
- if (p1 === 'all') return 'all';
4687
- if (p2 === 'all') return ', all';
4688
- var prefixedValue = p1 ? supportedProperty(p1) : ", " + supportedProperty(p2);
4689
- if (!prefixedValue) return p1 || p2;
4690
- return prefixedValue;
4691
- }
5086
+ // https://caniuse.com/#search=user-select
4692
5087
 
4693
- if (isInBrowser) el$1 = document.createElement('p');
4694
- /**
4695
- * Returns prefixed value if needed. Returns `false` if value is not supported.
4696
- *
4697
- * @param {String} property
4698
- * @param {String} value
4699
- * @return {String|Boolean}
4700
- * @api public
4701
- */
5088
+ var userSelect = {
5089
+ noPrefill: ['user-select'],
5090
+ supportedProperty: function supportedProperty(prop) {
5091
+ if (prop !== 'user-select') return false;
4702
5092
 
4703
- function supportedValue(property, value) {
4704
- // For server-side rendering.
4705
- var prefixedValue = value;
4706
- if (!el$1 || property === 'content') return value; // It is a string or a number as a string like '1'.
4707
- // We want only prefixable values here.
4708
- // eslint-disable-next-line no-restricted-globals
5093
+ if (prefix.js === 'Moz' || prefix.js === 'ms' || prefix.vendor === 'apple') {
5094
+ return prefix.css + prop;
5095
+ }
4709
5096
 
4710
- if (typeof prefixedValue !== 'string' || !isNaN(parseInt(prefixedValue, 10))) {
4711
- return prefixedValue;
4712
- } // Create cache key for current value.
5097
+ return prop;
5098
+ }
5099
+ };
4713
5100
 
5101
+ // https://caniuse.com/#search=multicolumn
5102
+ // https://github.com/postcss/autoprefixer/issues/491
5103
+ // https://github.com/postcss/autoprefixer/issues/177
4714
5104
 
4715
- var cacheKey = property + prefixedValue; // Remove cache for benchmark tests or return value from cache.
5105
+ var breakPropsOld = {
5106
+ supportedProperty: function supportedProperty(prop, style) {
5107
+ if (!/^break-/.test(prop)) return false;
4716
5108
 
4717
- if (process.env.NODE_ENV !== 'benchmark' && cache$1[cacheKey] != null) {
4718
- return cache$1[cacheKey];
4719
- } // IE can even throw an error in some cases, for e.g. style.content = 'bar'.
5109
+ if (prefix.js === 'Webkit') {
5110
+ var jsProp = "WebkitColumn" + pascalize(prop);
5111
+ return jsProp in style ? prefix.css + "column-" + prop : false;
5112
+ }
4720
5113
 
5114
+ if (prefix.js === 'Moz') {
5115
+ var _jsProp = "page" + pascalize(prop);
5116
+
5117
+ return _jsProp in style ? "page-" + prop : false;
5118
+ }
4721
5119
 
4722
- try {
4723
- // Test value as it is.
4724
- el$1.style[property] = prefixedValue;
4725
- } catch (err) {
4726
- // Return false if value not supported.
4727
- cache$1[cacheKey] = false;
4728
5120
  return false;
4729
- } // If 'transition' or 'transition-property' property.
5121
+ }
5122
+ };
4730
5123
 
5124
+ // See https://github.com/postcss/autoprefixer/issues/324.
4731
5125
 
4732
- if (transitionProperties[property]) {
4733
- prefixedValue = prefixedValue.replace(transPropsRegExp, prefixTransitionCallback);
4734
- } else if (el$1.style[property] === '') {
4735
- // Value with a vendor prefix.
4736
- prefixedValue = prefix.css + prefixedValue; // Hardcode test to convert "flex" to "-ms-flexbox" for IE10.
5126
+ var inlineLogicalOld = {
5127
+ supportedProperty: function supportedProperty(prop, style) {
5128
+ if (!/^(border|margin|padding)-inline/.test(prop)) return false;
5129
+ if (prefix.js === 'Moz') return prop;
5130
+ var newProp = prop.replace('-inline', '');
5131
+ return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;
5132
+ }
5133
+ };
4737
5134
 
4738
- if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value.
5135
+ // Camelization is required because we can't test using.
5136
+ // CSS syntax for e.g. in FF.
4739
5137
 
4740
- el$1.style[property] = prefixedValue; // Return false if value not supported.
5138
+ var unprefixed = {
5139
+ supportedProperty: function supportedProperty(prop, style) {
5140
+ return camelize(prop) in style ? prop : false;
5141
+ }
5142
+ };
4741
5143
 
4742
- if (el$1.style[property] === '') {
4743
- cache$1[cacheKey] = false;
4744
- return false;
4745
- }
4746
- } // Reset styles for current property.
5144
+ var prefixed = {
5145
+ supportedProperty: function supportedProperty(prop, style) {
5146
+ var pascalized = pascalize(prop); // Return custom CSS variable without prefixing.
4747
5147
 
5148
+ if (prop[0] === '-') return prop; // Return already prefixed value without prefixing.
4748
5149
 
4749
- el$1.style[property] = ''; // Write current value to cache.
5150
+ if (prop[0] === '-' && prop[1] === '-') return prop;
5151
+ if (prefix.js + pascalized in style) return prefix.css + prop; // Try webkit fallback.
4750
5152
 
4751
- cache$1[cacheKey] = prefixedValue;
4752
- return cache$1[cacheKey];
4753
- }
5153
+ if (prefix.js !== 'Webkit' && "Webkit" + pascalized in style) return "-webkit-" + prop;
5154
+ return false;
5155
+ }
5156
+ };
4754
5157
 
4755
- cssVendor_cjs.prefix = prefix;
4756
- var supportedKeyframes_1 = cssVendor_cjs.supportedKeyframes = supportedKeyframes;
4757
- var supportedProperty_1 = cssVendor_cjs.supportedProperty = supportedProperty;
4758
- var supportedValue_1 = cssVendor_cjs.supportedValue = supportedValue;
5158
+ // https://caniuse.com/#search=scroll-snap
4759
5159
 
4760
- /**
4761
- * Add vendor prefix to a property name when needed.
4762
- */
5160
+ var scrollSnap = {
5161
+ supportedProperty: function supportedProperty(prop) {
5162
+ if (prop.substring(0, 11) !== 'scroll-snap') return false;
4763
5163
 
4764
- function jssVendorPrefixer() {
4765
- function onProcessRule(rule) {
4766
- if (rule.type === 'keyframes') {
4767
- var atRule = rule;
4768
- atRule.at = supportedKeyframes_1(atRule.at);
5164
+ if (prefix.js === 'ms') {
5165
+ return "" + prefix.css + prop;
4769
5166
  }
4770
- }
4771
5167
 
4772
- function prefixStyle(style) {
4773
- for (var prop in style) {
4774
- var value = style[prop];
5168
+ return prop;
5169
+ }
5170
+ };
4775
5171
 
4776
- if (prop === 'fallbacks' && Array.isArray(value)) {
4777
- style[prop] = value.map(prefixStyle);
4778
- continue;
4779
- }
5172
+ // https://caniuse.com/#search=overscroll-behavior
4780
5173
 
4781
- var changeProp = false;
4782
- var supportedProp = supportedProperty_1(prop);
4783
- if (supportedProp && supportedProp !== prop) changeProp = true;
4784
- var changeValue = false;
4785
- var supportedValue$1 = supportedValue_1(supportedProp, toCssValue(value));
4786
- if (supportedValue$1 && supportedValue$1 !== value) changeValue = true;
5174
+ var overscrollBehavior = {
5175
+ supportedProperty: function supportedProperty(prop) {
5176
+ if (prop !== 'overscroll-behavior') return false;
4787
5177
 
4788
- if (changeProp || changeValue) {
4789
- if (changeProp) delete style[prop];
4790
- style[supportedProp || prop] = supportedValue$1 || value;
4791
- }
5178
+ if (prefix.js === 'ms') {
5179
+ return prefix.css + "scroll-chaining";
4792
5180
  }
4793
5181
 
4794
- return style;
5182
+ return prop;
4795
5183
  }
5184
+ };
4796
5185
 
4797
- function onProcessStyle(style, rule) {
4798
- if (rule.type !== 'style') return style;
4799
- return prefixStyle(style);
4800
- }
5186
+ var propMap = {
5187
+ 'flex-grow': 'flex-positive',
5188
+ 'flex-shrink': 'flex-negative',
5189
+ 'flex-basis': 'flex-preferred-size',
5190
+ 'justify-content': 'flex-pack',
5191
+ order: 'flex-order',
5192
+ 'align-items': 'flex-align',
5193
+ 'align-content': 'flex-line-pack' // 'align-self' is handled by 'align-self' plugin.
4801
5194
 
4802
- function onChangeValue(value, prop) {
4803
- return supportedValue_1(prop, toCssValue(value)) || value;
5195
+ }; // Support old flex spec from 2012.
5196
+
5197
+ var flex2012 = {
5198
+ supportedProperty: function supportedProperty(prop, style) {
5199
+ var newProp = propMap[prop];
5200
+ if (!newProp) return false;
5201
+ return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;
4804
5202
  }
5203
+ };
4805
5204
 
4806
- return {
4807
- onProcessRule: onProcessRule,
4808
- onProcessStyle: onProcessStyle,
4809
- onChangeValue: onChangeValue
4810
- };
4811
- }
5205
+ var propMap$1 = {
5206
+ flex: 'box-flex',
5207
+ 'flex-grow': 'box-flex',
5208
+ 'flex-direction': ['box-orient', 'box-direction'],
5209
+ order: 'box-ordinal-group',
5210
+ 'align-items': 'box-align',
5211
+ 'flex-flow': ['box-orient', 'box-direction'],
5212
+ 'justify-content': 'box-pack'
5213
+ };
5214
+ var propKeys = Object.keys(propMap$1);
4812
5215
 
4813
- /**
4814
- * Sort props by length.
4815
- */
4816
- function jssPropsSort() {
4817
- var sort = function sort(prop0, prop1) {
4818
- if (prop0.length === prop1.length) {
4819
- return prop0 > prop1 ? 1 : -1;
4820
- }
5216
+ var prefixCss = function prefixCss(p) {
5217
+ return prefix.css + p;
5218
+ }; // Support old flex spec from 2009.
4821
5219
 
4822
- return prop0.length - prop1.length;
4823
- };
4824
5220
 
4825
- return {
4826
- onProcessStyle: function onProcessStyle(style, rule) {
4827
- if (rule.type !== 'style') return style;
4828
- var newStyle = {};
4829
- var props = Object.keys(style).sort(sort);
5221
+ var flex2009 = {
5222
+ supportedProperty: function supportedProperty(prop, style, _ref) {
5223
+ var multiple = _ref.multiple;
4830
5224
 
4831
- for (var i = 0; i < props.length; i++) {
4832
- newStyle[props[i]] = style[props[i]];
5225
+ if (propKeys.indexOf(prop) > -1) {
5226
+ var newProp = propMap$1[prop];
5227
+
5228
+ if (!Array.isArray(newProp)) {
5229
+ return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;
4833
5230
  }
4834
5231
 
4835
- return newStyle;
5232
+ if (!multiple) return false;
5233
+
5234
+ for (var i = 0; i < newProp.length; i++) {
5235
+ if (!(prefix.js + pascalize(newProp[0]) in style)) {
5236
+ return false;
5237
+ }
5238
+ }
5239
+
5240
+ return newProp.map(prefixCss);
4836
5241
  }
4837
- };
4838
- }
4839
5242
 
4840
- var create = function create(options) {
4841
- if (options === void 0) {
4842
- options = {};
5243
+ return false;
4843
5244
  }
4844
-
4845
- return {
4846
- plugins: [functionPlugin(), observablePlugin(options.observable), templatePlugin(), jssGlobal(), jssExtend(), jssNested(), jssCompose(), camelCase(), defaultUnit(options.defaultUnit), jssExpand(), jssVendorPrefixer(), jssPropsSort()]
4847
- };
4848
5245
  };
4849
5246
 
4850
- var _tslib$1 = {};
4851
-
4852
- (function (exports) {
5247
+ // plugins = [
5248
+ // ...plugins,
5249
+ // breakPropsOld,
5250
+ // inlineLogicalOld,
5251
+ // unprefixed,
5252
+ // prefixed,
5253
+ // scrollSnap,
5254
+ // flex2012,
5255
+ // flex2009
5256
+ // ]
5257
+ // Plugins without 'noPrefill' value, going last.
5258
+ // 'flex-*' plugins should be at the bottom.
5259
+ // 'flex2009' going after 'flex2012'.
5260
+ // 'prefixed' going after 'unprefixed'
4853
5261
 
4854
- Object.defineProperty(exports, '__esModule', { value: true });
5262
+ var plugins = [appearence, colorAdjust, mask, textOrientation, transform, transition, writingMode, userSelect, breakPropsOld, inlineLogicalOld, unprefixed, prefixed, scrollSnap, overscrollBehavior, flex2012, flex2009];
5263
+ var propertyDetectors = plugins.filter(function (p) {
5264
+ return p.supportedProperty;
5265
+ }).map(function (p) {
5266
+ return p.supportedProperty;
5267
+ });
5268
+ var noPrefill = plugins.filter(function (p) {
5269
+ return p.noPrefill;
5270
+ }).reduce(function (a, p) {
5271
+ a.push.apply(a, _toConsumableArray(p.noPrefill));
5272
+ return a;
5273
+ }, []);
4855
5274
 
4856
- /*! *****************************************************************************
4857
- Copyright (c) Microsoft Corporation.
5275
+ var el;
5276
+ var cache = {};
4858
5277
 
4859
- Permission to use, copy, modify, and/or distribute this software for any
4860
- purpose with or without fee is hereby granted.
5278
+ if (isInBrowser) {
5279
+ el = document.createElement('p'); // We test every property on vendor prefix requirement.
5280
+ // Once tested, result is cached. It gives us up to 70% perf boost.
5281
+ // http://jsperf.com/element-style-object-access-vs-plain-object
5282
+ //
5283
+ // Prefill cache with known css properties to reduce amount of
5284
+ // properties we need to feature test at runtime.
5285
+ // http://davidwalsh.name/vendor-prefix
4861
5286
 
4862
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
4863
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4864
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
4865
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4866
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
4867
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4868
- PERFORMANCE OF THIS SOFTWARE.
4869
- ***************************************************************************** */
5287
+ var computed = window.getComputedStyle(document.documentElement, '');
4870
5288
 
4871
- exports.__assign = function () {
4872
- exports.__assign =
4873
- Object.assign ||
4874
- function __assign(t) {
4875
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4876
- s = arguments[i];
4877
- for (var p in s)
4878
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
4879
- }
4880
- return t;
4881
- };
4882
- return exports.__assign.apply(this, arguments);
4883
- };
4884
- } (_tslib$1));
5289
+ for (var key$1 in computed) {
5290
+ // eslint-disable-next-line no-restricted-globals
5291
+ if (!isNaN(key$1)) cache[computed[key$1]] = computed[key$1];
5292
+ } // Properties that cannot be correctly detected using the
5293
+ // cache prefill method.
4885
5294
 
4886
- var require$$1 = /*@__PURE__*/getAugmentedNamespace(jss_esm);
4887
5295
 
5296
+ noPrefill.forEach(function (x) {
5297
+ return delete cache[x];
5298
+ });
5299
+ }
4888
5300
  /**
4889
- * The custom `sort` method for
4890
- * for the [`css-mqpacker`](https://www.npmjs.com/package/css-mqpacker) or
4891
- * [`pleeease`](https://www.npmjs.com/package/pleeease) which using `css-mqpacker`
4892
- * or, perhaps, something else ))
5301
+ * Test if a property is supported, returns supported property with vendor
5302
+ * prefix if required. Returns `false` if not supported.
4893
5303
  *
4894
- * @module sort-css-media-queries
4895
- * @author Oleg Dutchenko <dutchenko.o.wezom@gmail.com>
4896
- * @version 1.5.0
5304
+ * @param {String} prop dash separated
5305
+ * @param {Object} [options]
5306
+ * @return {String|Boolean}
5307
+ * @api public
4897
5308
  */
4898
5309
 
4899
- // ----------------------------------------
4900
- // Private
4901
- // ----------------------------------------
4902
-
4903
- const minMaxWidth = /(!?\(\s*min(-device-)?-width)(.|\n)+\(\s*max(-device)?-width/i;
4904
- const minWidth = /\(\s*min(-device)?-width/i;
4905
- const maxMinWidth = /(!?\(\s*max(-device)?-width)(.|\n)+\(\s*min(-device)?-width/i;
4906
- const maxWidth = /\(\s*max(-device)?-width/i;
4907
-
4908
- const isMinWidth = _testQuery(minMaxWidth, maxMinWidth, minWidth);
4909
- const isMaxWidth = _testQuery(maxMinWidth, minMaxWidth, maxWidth);
4910
-
4911
- const minMaxHeight = /(!?\(\s*min(-device)?-height)(.|\n)+\(\s*max(-device)?-height/i;
4912
- const minHeight = /\(\s*min(-device)?-height/i;
4913
- const maxMinHeight = /(!?\(\s*max(-device)?-height)(.|\n)+\(\s*min(-device)?-height/i;
4914
- const maxHeight = /\(\s*max(-device)?-height/i;
4915
5310
 
4916
- const isMinHeight = _testQuery(minMaxHeight, maxMinHeight, minHeight);
4917
- const isMaxHeight = _testQuery(maxMinHeight, minMaxHeight, maxHeight);
5311
+ function supportedProperty(prop, options) {
5312
+ if (options === void 0) {
5313
+ options = {};
5314
+ }
4918
5315
 
4919
- const isPrint = /print/i;
4920
- const isPrintOnly = /^print$/i;
5316
+ // For server-side rendering.
5317
+ if (!el) return prop; // Remove cache for benchmark tests or return property from the cache.
4921
5318
 
4922
- const maxValue = Number.MAX_VALUE;
5319
+ if (process.env.NODE_ENV !== 'benchmark' && cache[prop] != null) {
5320
+ return cache[prop];
5321
+ } // Check if 'transition' or 'transform' natively supported in browser.
4923
5322
 
4924
- /**
4925
- * Obtain the length of the media request in pixels.
4926
- * Copy from original source `function inspectLength (length)`
4927
- * {@link https://github.com/hail2u/node-css-mqpacker/blob/master/index.js#L58}
4928
- * @private
4929
- * @param {string} length
4930
- * @return {number}
4931
- */
4932
- function _getQueryLength (length) {
4933
- length = /(-?\d*\.?\d+)(ch|em|ex|px|rem)/.exec(length);
4934
5323
 
4935
- if (length === null) {
4936
- return maxValue
4937
- }
5324
+ if (prop === 'transition' || prop === 'transform') {
5325
+ options[prop] = prop in el.style;
5326
+ } // Find a plugin for current prefix property.
4938
5327
 
4939
- let number = length[1];
4940
- const unit = length[2];
4941
5328
 
4942
- switch (unit) {
4943
- case 'ch':
4944
- number = parseFloat(number) * 8.8984375;
4945
- break
5329
+ for (var i = 0; i < propertyDetectors.length; i++) {
5330
+ cache[prop] = propertyDetectors[i](prop, el.style, options); // Break loop, if value found.
4946
5331
 
4947
- case 'em':
4948
- case 'rem':
4949
- number = parseFloat(number) * 16;
4950
- break
5332
+ if (cache[prop]) break;
5333
+ } // Reset styles for current property.
5334
+ // Firefox can even throw an error for invalid properties, e.g., "0".
4951
5335
 
4952
- case 'ex':
4953
- number = parseFloat(number) * 8.296875;
4954
- break
4955
5336
 
4956
- case 'px':
4957
- number = parseFloat(number);
4958
- break
5337
+ try {
5338
+ el.style[prop] = '';
5339
+ } catch (err) {
5340
+ return false;
4959
5341
  }
4960
5342
 
4961
- return +number
5343
+ return cache[prop];
4962
5344
  }
4963
5345
 
5346
+ var cache$1 = {};
5347
+ var transitionProperties = {
5348
+ transition: 1,
5349
+ 'transition-property': 1,
5350
+ '-webkit-transition': 1,
5351
+ '-webkit-transition-property': 1
5352
+ };
5353
+ var transPropsRegExp = /(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;
5354
+ var el$1;
4964
5355
  /**
4965
- * Wrapper for creating test functions
4966
- * @private
4967
- * @param {RegExp} doubleTestTrue
4968
- * @param {RegExp} doubleTestFalse
4969
- * @param {RegExp} singleTest
4970
- * @return {Function}
5356
+ * Returns prefixed value transition/transform if needed.
5357
+ *
5358
+ * @param {String} match
5359
+ * @param {String} p1
5360
+ * @param {String} p2
5361
+ * @return {String}
5362
+ * @api private
4971
5363
  */
4972
- function _testQuery (doubleTestTrue, doubleTestFalse, singleTest) {
4973
- /**
4974
- * @param {string} query
4975
- * @return {boolean}
4976
- */
4977
- return function (query) {
4978
- if (doubleTestTrue.test(query)) {
4979
- return true
4980
- } else if (doubleTestFalse.test(query)) {
4981
- return false
4982
- }
4983
- return singleTest.test(query)
4984
- }
5364
+
5365
+ function prefixTransitionCallback(match, p1, p2) {
5366
+ if (p1 === 'var') return 'var';
5367
+ if (p1 === 'all') return 'all';
5368
+ if (p2 === 'all') return ', all';
5369
+ var prefixedValue = p1 ? supportedProperty(p1) : ", " + supportedProperty(p2);
5370
+ if (!prefixedValue) return p1 || p2;
5371
+ return prefixedValue;
4985
5372
  }
4986
5373
 
5374
+ if (isInBrowser) el$1 = document.createElement('p');
4987
5375
  /**
4988
- * @private
4989
- * @param {string} a
4990
- * @param {string} b
4991
- * @return {number|null}
5376
+ * Returns prefixed value if needed. Returns `false` if value is not supported.
5377
+ *
5378
+ * @param {String} property
5379
+ * @param {String} value
5380
+ * @return {String|Boolean}
5381
+ * @api public
4992
5382
  */
4993
- function _testIsPrint (a, b) {
4994
- const isPrintA = isPrint.test(a);
4995
- const isPrintOnlyA = isPrintOnly.test(a);
4996
5383
 
4997
- const isPrintB = isPrint.test(b);
4998
- const isPrintOnlyB = isPrintOnly.test(b);
5384
+ function supportedValue(property, value) {
5385
+ // For server-side rendering.
5386
+ var prefixedValue = value;
5387
+ if (!el$1 || property === 'content') return value; // It is a string or a number as a string like '1'.
5388
+ // We want only prefixable values here.
5389
+ // eslint-disable-next-line no-restricted-globals
4999
5390
 
5000
- if (isPrintA && isPrintB) {
5001
- if (!isPrintOnlyA && isPrintOnlyB) {
5002
- return 1
5003
- }
5004
- if (isPrintOnlyA && !isPrintOnlyB) {
5005
- return -1
5006
- }
5007
- return a.localeCompare(b)
5008
- }
5009
- if (isPrintA) {
5010
- return 1
5011
- }
5012
- if (isPrintB) {
5013
- return -1
5014
- }
5391
+ if (typeof prefixedValue !== 'string' || !isNaN(parseInt(prefixedValue, 10))) {
5392
+ return prefixedValue;
5393
+ } // Create cache key for current value.
5015
5394
 
5016
- return null
5017
- }
5018
5395
 
5019
- // ----------------------------------------
5020
- // Public
5021
- // ----------------------------------------
5396
+ var cacheKey = property + prefixedValue; // Remove cache for benchmark tests or return value from cache.
5022
5397
 
5023
- /**
5024
- * Sorting an array with media queries
5025
- * according to the mobile-first methodology.
5026
- * @param {string} a
5027
- * @param {string} b
5028
- * @return {number} 1 / 0 / -1
5029
- */
5030
- function sortCSSmq$1 (a, b) {
5031
- const testIsPrint = _testIsPrint(a, b);
5032
- if (testIsPrint !== null) {
5033
- return testIsPrint
5034
- }
5398
+ if (process.env.NODE_ENV !== 'benchmark' && cache$1[cacheKey] != null) {
5399
+ return cache$1[cacheKey];
5400
+ } // IE can even throw an error in some cases, for e.g. style.content = 'bar'.
5035
5401
 
5036
- const minA = isMinWidth(a) || isMinHeight(a);
5037
- const maxA = isMaxWidth(a) || isMaxHeight(a);
5038
5402
 
5039
- const minB = isMinWidth(b) || isMinHeight(b);
5040
- const maxB = isMaxWidth(b) || isMaxHeight(b);
5403
+ try {
5404
+ // Test value as it is.
5405
+ el$1.style[property] = prefixedValue;
5406
+ } catch (err) {
5407
+ // Return false if value not supported.
5408
+ cache$1[cacheKey] = false;
5409
+ return false;
5410
+ } // If 'transition' or 'transition-property' property.
5041
5411
 
5042
- if (minA && maxB) {
5043
- return -1
5044
- }
5045
- if (maxA && minB) {
5046
- return 1
5047
- }
5048
5412
 
5049
- let lengthA = _getQueryLength(a);
5050
- let lengthB = _getQueryLength(b);
5413
+ if (transitionProperties[property]) {
5414
+ prefixedValue = prefixedValue.replace(transPropsRegExp, prefixTransitionCallback);
5415
+ } else if (el$1.style[property] === '') {
5416
+ // Value with a vendor prefix.
5417
+ prefixedValue = prefix.css + prefixedValue; // Hardcode test to convert "flex" to "-ms-flexbox" for IE10.
5051
5418
 
5052
- if (lengthA === maxValue && lengthB === maxValue) {
5053
- return a.localeCompare(b)
5054
- } else if (lengthA === maxValue) {
5055
- return 1
5056
- } else if (lengthB === maxValue) {
5057
- return -1
5058
- }
5419
+ if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value.
5059
5420
 
5060
- if (lengthA > lengthB) {
5061
- if (maxA) {
5062
- return -1
5063
- }
5064
- return 1
5065
- }
5421
+ el$1.style[property] = prefixedValue; // Return false if value not supported.
5066
5422
 
5067
- if (lengthA < lengthB) {
5068
- if (maxA) {
5069
- return 1
5423
+ if (el$1.style[property] === '') {
5424
+ cache$1[cacheKey] = false;
5425
+ return false;
5070
5426
  }
5071
- return -1
5072
- }
5427
+ } // Reset styles for current property.
5073
5428
 
5074
- return a.localeCompare(b)
5429
+
5430
+ el$1.style[property] = ''; // Write current value to cache.
5431
+
5432
+ cache$1[cacheKey] = prefixedValue;
5433
+ return cache$1[cacheKey];
5075
5434
  }
5076
5435
 
5436
+ cssVendor_cjs.prefix = prefix;
5437
+ var supportedKeyframes_1 = cssVendor_cjs.supportedKeyframes = supportedKeyframes;
5438
+ var supportedProperty_1 = cssVendor_cjs.supportedProperty = supportedProperty;
5439
+ var supportedValue_1 = cssVendor_cjs.supportedValue = supportedValue;
5440
+
5077
5441
  /**
5078
- * Sorting an array with media queries
5079
- * according to the desktop-first methodology.
5080
- * @param {string} a
5081
- * @param {string} b
5082
- * @return {number} 1 / 0 / -1
5442
+ * Add vendor prefix to a property name when needed.
5083
5443
  */
5084
- sortCSSmq$1.desktopFirst = function (a, b) {
5085
- const testIsPrint = _testIsPrint(a, b);
5086
- if (testIsPrint !== null) {
5087
- return testIsPrint
5088
- }
5089
5444
 
5090
- const minA = isMinWidth(a) || isMinHeight(a);
5091
- const maxA = isMaxWidth(a) || isMaxHeight(a);
5092
-
5093
- const minB = isMinWidth(b) || isMinHeight(b);
5094
- const maxB = isMaxWidth(b) || isMaxHeight(b);
5095
-
5096
- if (minA && maxB) {
5097
- return 1
5098
- }
5099
- if (maxA && minB) {
5100
- return -1
5445
+ function jssVendorPrefixer() {
5446
+ function onProcessRule(rule) {
5447
+ if (rule.type === 'keyframes') {
5448
+ var atRule = rule;
5449
+ atRule.at = supportedKeyframes_1(atRule.at);
5450
+ }
5101
5451
  }
5102
5452
 
5103
- const lengthA = _getQueryLength(a);
5104
- const lengthB = _getQueryLength(b);
5453
+ function prefixStyle(style) {
5454
+ for (var prop in style) {
5455
+ var value = style[prop];
5105
5456
 
5106
- if (lengthA === maxValue && lengthB === maxValue) {
5107
- return a.localeCompare(b)
5108
- } else if (lengthA === maxValue) {
5109
- return 1
5110
- } else if (lengthB === maxValue) {
5111
- return -1
5112
- }
5457
+ if (prop === 'fallbacks' && Array.isArray(value)) {
5458
+ style[prop] = value.map(prefixStyle);
5459
+ continue;
5460
+ }
5113
5461
 
5114
- if (lengthA > lengthB) {
5115
- if (maxA) {
5116
- return -1
5462
+ var changeProp = false;
5463
+ var supportedProp = supportedProperty_1(prop);
5464
+ if (supportedProp && supportedProp !== prop) changeProp = true;
5465
+ var changeValue = false;
5466
+ var supportedValue$1 = supportedValue_1(supportedProp, toCssValue(value));
5467
+ if (supportedValue$1 && supportedValue$1 !== value) changeValue = true;
5468
+
5469
+ if (changeProp || changeValue) {
5470
+ if (changeProp) delete style[prop];
5471
+ style[supportedProp || prop] = supportedValue$1 || value;
5472
+ }
5117
5473
  }
5118
- return 1
5474
+
5475
+ return style;
5119
5476
  }
5120
5477
 
5121
- if (lengthA < lengthB) {
5122
- if (maxA) {
5123
- return 1
5124
- }
5125
- return -1
5478
+ function onProcessStyle(style, rule) {
5479
+ if (rule.type !== 'style') return style;
5480
+ return prefixStyle(style);
5126
5481
  }
5127
5482
 
5128
- return -(a.localeCompare(b))
5129
- };
5483
+ function onChangeValue(value, prop) {
5484
+ return supportedValue_1(prop, toCssValue(value)) || value;
5485
+ }
5130
5486
 
5131
- // ----------------------------------------
5132
- // Exports
5133
- // ----------------------------------------
5487
+ return {
5488
+ onProcessRule: onProcessRule,
5489
+ onProcessStyle: onProcessStyle,
5490
+ onChangeValue: onChangeValue
5491
+ };
5492
+ }
5134
5493
 
5135
- var sortCssMediaQueries = sortCSSmq$1;
5494
+ /**
5495
+ * Sort props by length.
5496
+ */
5497
+ function jssPropsSort() {
5498
+ var sort = function sort(prop0, prop1) {
5499
+ if (prop0.length === prop1.length) {
5500
+ return prop0 > prop1 ? 1 : -1;
5501
+ }
5136
5502
 
5137
- var _tslib = _tslib$1;
5138
- var jss$1 = require$$1;
5139
- var sortCSSmq = sortCssMediaQueries;
5503
+ return prop0.length - prop1.length;
5504
+ };
5140
5505
 
5141
- function _interopDefaultLegacy$1(e) {
5142
- return e && typeof e === 'object' && 'default' in e ? e : { default: e };
5143
- }
5506
+ return {
5507
+ onProcessStyle: function onProcessStyle(style, rule) {
5508
+ if (rule.type !== 'style') return style;
5509
+ var newStyle = {};
5510
+ var props = Object.keys(style).sort(sort);
5144
5511
 
5145
- var sortCSSmq__default = /*#__PURE__*/ _interopDefaultLegacy$1(sortCSSmq);
5512
+ for (var i = 0; i < props.length; i++) {
5513
+ newStyle[props[i]] = style[props[i]];
5514
+ }
5146
5515
 
5147
- function isPlainObject(sample) {
5148
- return (
5149
- sample !== null && typeof sample === 'object' && Array.isArray(sample) === false
5150
- );
5151
- }
5152
- var UN_QUERIED = '__UN_QUERIED';
5153
- function recursiveInnerAndGetQueries(pluginOptions, rules) {
5154
- var queries = {
5155
- groups: {},
5156
- groupsSortNames: []
5157
- };
5158
- for (var index = 0; index < rules.length; index++) {
5159
- var rule = rules[index];
5160
- var query =
5161
- rule.type === 'conditional' && typeof rule.query === 'string'
5162
- ? rule.query
5163
- : UN_QUERIED;
5164
- if (!queries.groups.hasOwnProperty(query)) {
5165
- queries.groupsSortNames.push(query);
5166
- queries.groups[query] = [];
5167
- }
5168
- queries.groups[query].push(index);
5169
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
5170
- recursive(pluginOptions, rule);
5171
- }
5172
- queries.groupsSortNames.sort(function (a, b) {
5173
- var aWeight = a === UN_QUERIED ? 0 : a.length;
5174
- var bWeight = b === UN_QUERIED ? 0 : b.length;
5175
- if (aWeight > 0 && bWeight > 0) {
5176
- if (pluginOptions.desktopFirst) {
5177
- return sortCSSmq__default['default'].desktopFirst(a, b);
5178
- } else {
5179
- return sortCSSmq__default['default'](a, b);
5180
- }
5181
- } else {
5182
- return aWeight - bWeight;
5183
- }
5184
- });
5185
- return queries;
5186
- }
5187
- function recursive(pluginOptions, data) {
5188
- if (isPlainObject(data) && data.rules instanceof jss$1.RuleList) {
5189
- data.rules.toString = function (options) {
5190
- if (options === void 0) {
5191
- options = {};
5192
- }
5193
- var str = '';
5194
- var sheet = this.options.sheet;
5195
- var link = sheet ? sheet.options.link : false;
5196
- var _a = recursiveInnerAndGetQueries(pluginOptions, this.index),
5197
- groups = _a.groups,
5198
- groupsSortNames = _a.groupsSortNames;
5199
- for (var i = 0; i < groupsSortNames.length; i++) {
5200
- var groupName = groupsSortNames[i];
5201
- var group = groups[groupsSortNames[i]];
5202
- if (groupName !== UN_QUERIED && pluginOptions.combineMediaQueries) {
5203
- str += '\n' + groupName + ' {';
5204
- for (var i_1 = 0; i_1 < group.length; i_1++) {
5205
- var rule = this.index[group[i_1]];
5206
- var css = rule.rules.toString(
5207
- _tslib.__assign(_tslib.__assign({}, options), {
5208
- indent: (options.indent || 0) + 1
5209
- })
5210
- );
5211
- if (!css && !link) continue;
5212
- if (str) str += '\n';
5213
- str += css;
5214
- }
5215
- str += '\n}\n';
5216
- } else {
5217
- for (var i_2 = 0; i_2 < group.length; i_2++) {
5218
- var rule = this.index[group[i_2]];
5219
- var css = rule.toString(options);
5220
- if (!css && !link) continue;
5221
- if (str) str += '\n';
5222
- str += css;
5223
- }
5224
- }
5225
- }
5226
- return str;
5227
- };
5228
- }
5229
- }
5230
- function jssCombineAndSortMQ(options) {
5231
- if (options === void 0) {
5232
- options = {};
5233
- }
5234
- return {
5235
- onProcessSheet: function (sheet) {
5236
- recursive(options, sheet);
5237
- }
5238
- };
5516
+ return newStyle;
5517
+ }
5518
+ };
5239
5519
  }
5240
5520
 
5241
- var dist = jssCombineAndSortMQ;
5521
+ var create = function create(options) {
5522
+ if (options === void 0) {
5523
+ options = {};
5524
+ }
5525
+
5526
+ return {
5527
+ plugins: [functionPlugin(), observablePlugin(options.observable), templatePlugin(), jssGlobal(), jssExtend(), jssNested(), jssCompose(), camelCase(), defaultUnit(options.defaultUnit), jssExpand(), jssVendorPrefixer(), jssPropsSort()]
5528
+ };
5529
+ };
5242
5530
 
5243
5531
  index.setup({
5244
5532
  ...create(),
@@ -5246,109 +5534,6 @@ index.setup({
5246
5534
  plugins: [...create().plugins, dist({ combineMediaQueries: true })],
5247
5535
  });
5248
5536
 
5249
- /* Auto Generated Start */
5250
- const themeLight = {
5251
- baseColor: '#000',
5252
- baseColorDarken: '#000000',
5253
- brandColor: '#d5001c',
5254
- backgroundColor: '#fff',
5255
- backgroundSurfaceColor: '#f2f2f2',
5256
- contrastLowColor: '#e3e4e5',
5257
- contrastMediumColor: '#626669',
5258
- contrastHighColor: '#323639',
5259
- contrastHighColorDarken: '#151718',
5260
- hoverColor: '#d5001c',
5261
- hoverColorDarken: '#980014',
5262
- activeColor: '#d5001c',
5263
- focusColor: 'currentColor',
5264
- disabledColor: '#96989a',
5265
- errorColor: '#e00000',
5266
- errorColorDarken: '#a30000',
5267
- errorSoftColor: '#fae6e6',
5268
- successColor: '#018a16',
5269
- successColorDarken: '#014d0c',
5270
- successSoftColor: '#e5f3e7',
5271
- warningColor: '#ff9b00',
5272
- warningSoftColor: '#fff5e5',
5273
- neutralColor: '#0061bd',
5274
- neutralSoftColor: '#e5eff8'
5275
- };
5276
- const themeDark = {
5277
- baseColor: '#fff',
5278
- baseColorDarken: '#e0e0e0',
5279
- brandColor: '#d5001c',
5280
- backgroundColor: '#0e1418',
5281
- backgroundSurfaceColor: '#262b2e',
5282
- contrastLowColor: '#4a4e51',
5283
- contrastMediumColor: '#b0b1b2',
5284
- contrastHighColor: '#e3e4e5',
5285
- contrastHighColorDarken: '#c3c5c8',
5286
- hoverColor: '#ff0223',
5287
- hoverColorDarken: '#c4001a',
5288
- activeColor: '#ff0223',
5289
- focusColor: 'currentColor',
5290
- disabledColor: '#7c7f81',
5291
- errorColor: '#fc1717',
5292
- errorColorDarken: '#d30303',
5293
- errorSoftColor: '#fec5c5',
5294
- successColor: '#01ba1d',
5295
- successColorDarken: '#017d14',
5296
- successSoftColor: '#bfeec6',
5297
- warningColor: '#ff9b00',
5298
- warningSoftColor: '#ffe6bf',
5299
- neutralColor: '#2193ff',
5300
- neutralSoftColor: '#c7e4ff'
5301
- };
5302
- const themeLightElectric = Object.assign(Object.assign({}, themeLight), { brandColor: '#00b0f4', hoverColor: '#00b0f4', hoverColorDarken: '#0084b7', activeColor: '#00b0f4' });
5303
- const themeDarkElectric = Object.assign(Object.assign({}, themeDark), { brandColor: '#00b0f4', hoverColor: '#00b0f4', hoverColorDarken: '#0084b7', activeColor: '#00b0f4' });
5304
- const themes = {
5305
- 'light': themeLight,
5306
- 'dark': themeDark,
5307
- 'light-electric': themeLightElectric,
5308
- 'dark-electric': themeDarkElectric
5309
- };
5310
- /* Auto Generated End */
5311
- const getThemedColors = (theme) => {
5312
- return themes[theme];
5313
- };
5314
-
5315
- const pxToRemWithUnit = (px) => `${px / 16}rem`;
5316
-
5317
- // NOTE: handpicked selection of plugins from jss-preset-default
5318
- createJss({
5319
- plugins: [
5320
- jssGlobal(),
5321
- jssNested(),
5322
- camelCase(),
5323
- dist({ combineMediaQueries: true }),
5324
- ],
5325
- });
5326
- const supportsConstructableStylesheets = () => {
5327
- try {
5328
- return typeof new CSSStyleSheet().replaceSync === 'function';
5329
- }
5330
- catch (_a) {
5331
- return false;
5332
- }
5333
- };
5334
- // determine it once
5335
- supportsConstructableStylesheets();
5336
-
5337
- const paramCaseToCamelCase = (str) => {
5338
- return str.replace(/-(\w)/g, (_, group) => group.toUpperCase());
5339
- };
5340
- const isScrollable = (isPrevHidden, isNextHidden) => {
5341
- return !(isPrevHidden && isNextHidden);
5342
- };
5343
-
5344
- const hasDocument = typeof document !== 'undefined';
5345
-
5346
- hasDocument && 'scrollBehavior' in document.documentElement.style;
5347
- const win = typeof window !== 'undefined' ? window : {};
5348
- win.document || { head: {} };
5349
- (win.HTMLElement || class {
5350
- });
5351
-
5352
5537
  const formatObjectOutput = (value) => {
5353
5538
  return JSON.stringify(value)
5354
5539
  .replace(/"([a-zA-Z?]+)":/g, '$1:') // remove double quotes from keys