@dropins/tools 0.21.1 → 0.21.2-alpha2

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 (478) hide show
  1. package/components/Accordion/Accordion.d.ts +25 -0
  2. package/components/Accordion/Accordion.d.ts.map +1 -0
  3. package/components/Accordion/Accordion.jsx +59 -0
  4. package/components/Accordion/Accordion.stories.d.ts +22 -0
  5. package/components/Accordion/Accordion.stories.d.ts.map +1 -0
  6. package/components/Accordion/Accordion.stories.jsx +320 -0
  7. package/components/Accordion/Accordion.test.d.ts +3 -0
  8. package/components/Accordion/Accordion.test.d.ts.map +1 -0
  9. package/components/Accordion/Accordion.test.jsx +79 -0
  10. package/components/Accordion/index.d.ts +3 -0
  11. package/components/Accordion/index.d.ts.map +1 -0
  12. package/components/Accordion/index.js +2 -0
  13. package/components/ActionButton/ActionButton.d.ts +11 -0
  14. package/components/ActionButton/ActionButton.d.ts.map +1 -0
  15. package/components/ActionButton/ActionButton.jsx +14 -0
  16. package/components/ActionButton/ActionButton.stories.d.ts +16 -0
  17. package/components/ActionButton/ActionButton.stories.d.ts.map +1 -0
  18. package/components/ActionButton/ActionButton.stories.jsx +119 -0
  19. package/components/ActionButton/ActionButton.test.d.ts +3 -0
  20. package/components/ActionButton/ActionButton.test.d.ts.map +1 -0
  21. package/components/ActionButton/ActionButton.test.jsx +47 -0
  22. package/components/ActionButton/index.d.ts +2 -0
  23. package/components/ActionButton/index.d.ts.map +1 -0
  24. package/components/ActionButton/index.js +1 -0
  25. package/components/ActionButtonGroup/ActionButtonGroup.d.ts +20 -0
  26. package/components/ActionButtonGroup/ActionButtonGroup.d.ts.map +1 -0
  27. package/components/ActionButtonGroup/ActionButtonGroup.jsx +39 -0
  28. package/components/ActionButtonGroup/ActionButtonGroup.stories.d.ts +16 -0
  29. package/components/ActionButtonGroup/ActionButtonGroup.stories.d.ts.map +1 -0
  30. package/components/ActionButtonGroup/ActionButtonGroup.stories.jsx +72 -0
  31. package/components/ActionButtonGroup/ActionButtonGroup.test.d.ts +3 -0
  32. package/components/ActionButtonGroup/ActionButtonGroup.test.d.ts.map +1 -0
  33. package/components/ActionButtonGroup/ActionButtonGroup.test.jsx +78 -0
  34. package/components/ActionButtonGroup/index.d.ts +2 -0
  35. package/components/ActionButtonGroup/index.d.ts.map +1 -0
  36. package/components/ActionButtonGroup/index.js +1 -0
  37. package/components/AlertBanner/AlertBanner.d.ts +15 -0
  38. package/components/AlertBanner/AlertBanner.d.ts.map +1 -0
  39. package/components/AlertBanner/AlertBanner.jsx +30 -0
  40. package/components/AlertBanner/AlertBanner.stories.d.ts +17 -0
  41. package/components/AlertBanner/AlertBanner.stories.d.ts.map +1 -0
  42. package/components/AlertBanner/AlertBanner.stories.jsx +128 -0
  43. package/components/AlertBanner/AlertBanner.test.d.ts +3 -0
  44. package/components/AlertBanner/AlertBanner.test.d.ts.map +1 -0
  45. package/components/AlertBanner/AlertBanner.test.jsx +40 -0
  46. package/components/AlertBanner/index.d.ts +3 -0
  47. package/components/AlertBanner/index.d.ts.map +1 -0
  48. package/components/AlertBanner/index.js +2 -0
  49. package/components/Breadcrumbs/Breadcrumbs.d.ts +9 -0
  50. package/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -0
  51. package/components/Breadcrumbs/Breadcrumbs.jsx +26 -0
  52. package/components/Breadcrumbs/Breadcrumbs.stories.d.ts +15 -0
  53. package/components/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -0
  54. package/components/Breadcrumbs/Breadcrumbs.stories.jsx +110 -0
  55. package/components/Breadcrumbs/Breadcrumbs.test.d.ts +3 -0
  56. package/components/Breadcrumbs/Breadcrumbs.test.d.ts.map +1 -0
  57. package/components/Breadcrumbs/Breadcrumbs.test.jsx +67 -0
  58. package/components/Breadcrumbs/index.d.ts +3 -0
  59. package/components/Breadcrumbs/index.d.ts.map +1 -0
  60. package/components/Breadcrumbs/index.js +2 -0
  61. package/components/Button/Button.d.ts +15 -0
  62. package/components/Button/Button.d.ts.map +1 -0
  63. package/components/Button/Button.jsx +59 -0
  64. package/components/Button/Button.stories.d.ts +135 -0
  65. package/components/Button/Button.stories.d.ts.map +1 -0
  66. package/components/Button/Button.stories.jsx +354 -0
  67. package/components/Button/Button.test.d.ts +2 -0
  68. package/components/Button/Button.test.d.ts.map +1 -0
  69. package/components/Button/Button.test.jsx +134 -0
  70. package/components/Button/index.d.ts +3 -0
  71. package/components/Button/index.d.ts.map +1 -0
  72. package/components/Button/index.js +2 -0
  73. package/components/Card/Card.d.ts +9 -0
  74. package/components/Card/Card.d.ts.map +1 -0
  75. package/components/Card/Card.jsx +7 -0
  76. package/components/Card/Card.stories.d.ts +16 -0
  77. package/components/Card/Card.stories.d.ts.map +1 -0
  78. package/components/Card/Card.stories.jsx +47 -0
  79. package/components/Card/Card.test.d.ts +3 -0
  80. package/components/Card/Card.test.d.ts.map +1 -0
  81. package/components/Card/Card.test.jsx +26 -0
  82. package/components/Card/index.d.ts +2 -0
  83. package/components/Card/index.d.ts.map +1 -0
  84. package/components/Card/index.js +1 -0
  85. package/components/CartItem/CartItem.d.ts +25 -0
  86. package/components/CartItem/CartItem.d.ts.map +1 -0
  87. package/components/CartItem/CartItem.jsx +124 -0
  88. package/components/CartItem/CartItem.stories.d.ts +54 -0
  89. package/components/CartItem/CartItem.stories.d.ts.map +1 -0
  90. package/components/CartItem/CartItem.stories.jsx +309 -0
  91. package/components/CartItem/CartItem.test.d.ts +3 -0
  92. package/components/CartItem/CartItem.test.d.ts.map +1 -0
  93. package/components/CartItem/CartItem.test.jsx +71 -0
  94. package/components/CartItem/CartItemSkeleton.d.ts +3 -0
  95. package/components/CartItem/CartItemSkeleton.d.ts.map +1 -0
  96. package/components/CartItem/CartItemSkeleton.jsx +25 -0
  97. package/components/CartItem/CartItemSkeleton.test.d.ts +3 -0
  98. package/components/CartItem/CartItemSkeleton.test.d.ts.map +1 -0
  99. package/components/CartItem/CartItemSkeleton.test.jsx +11 -0
  100. package/components/CartItem/index.d.ts +4 -0
  101. package/components/CartItem/index.d.ts.map +1 -0
  102. package/components/CartItem/index.js +3 -0
  103. package/components/CartList/CartList.d.ts +7 -0
  104. package/components/CartList/CartList.d.ts.map +1 -0
  105. package/components/CartList/CartList.jsx +14 -0
  106. package/components/CartList/CartList.stories.d.ts +17 -0
  107. package/components/CartList/CartList.stories.d.ts.map +1 -0
  108. package/components/CartList/CartList.stories.jsx +54 -0
  109. package/components/CartList/CartList.test.d.ts +3 -0
  110. package/components/CartList/CartList.test.d.ts.map +1 -0
  111. package/components/CartList/CartList.test.jsx +12 -0
  112. package/components/CartList/index.d.ts +3 -0
  113. package/components/CartList/index.d.ts.map +1 -0
  114. package/components/CartList/index.js +2 -0
  115. package/components/Checkbox/Checkbox.d.ts +13 -0
  116. package/components/Checkbox/Checkbox.d.ts.map +1 -0
  117. package/components/Checkbox/Checkbox.jsx +51 -0
  118. package/components/Checkbox/Checkbox.stories.d.ts +22 -0
  119. package/components/Checkbox/Checkbox.stories.d.ts.map +1 -0
  120. package/components/Checkbox/Checkbox.stories.jsx +157 -0
  121. package/components/Checkbox/Checkbox.test.d.ts +3 -0
  122. package/components/Checkbox/Checkbox.test.d.ts.map +1 -0
  123. package/components/Checkbox/Checkbox.test.jsx +136 -0
  124. package/components/Checkbox/index.d.ts +2 -0
  125. package/components/Checkbox/index.d.ts.map +1 -0
  126. package/components/Checkbox/index.js +1 -0
  127. package/components/ColorSwatch/ColorSwatch.d.ts +20 -0
  128. package/components/ColorSwatch/ColorSwatch.d.ts.map +1 -0
  129. package/components/ColorSwatch/ColorSwatch.jsx +57 -0
  130. package/components/ColorSwatch/ColorSwatch.stories.d.ts +20 -0
  131. package/components/ColorSwatch/ColorSwatch.stories.d.ts.map +1 -0
  132. package/components/ColorSwatch/ColorSwatch.stories.jsx +206 -0
  133. package/components/ColorSwatch/ColorSwatch.test.d.ts +3 -0
  134. package/components/ColorSwatch/ColorSwatch.test.d.ts.map +1 -0
  135. package/components/ColorSwatch/ColorSwatch.test.jsx +87 -0
  136. package/components/ColorSwatch/index.d.ts +3 -0
  137. package/components/ColorSwatch/index.d.ts.map +1 -0
  138. package/components/ColorSwatch/index.js +2 -0
  139. package/components/Divider/Divider.d.ts +8 -0
  140. package/components/Divider/Divider.d.ts.map +1 -0
  141. package/components/Divider/Divider.jsx +9 -0
  142. package/components/Divider/Divider.stories.d.ts +11 -0
  143. package/components/Divider/Divider.stories.d.ts.map +1 -0
  144. package/components/Divider/Divider.stories.jsx +43 -0
  145. package/components/Divider/Divider.test.d.ts +2 -0
  146. package/components/Divider/Divider.test.d.ts.map +1 -0
  147. package/components/Divider/Divider.test.jsx +19 -0
  148. package/components/Divider/index.d.ts +3 -0
  149. package/components/Divider/index.d.ts.map +1 -0
  150. package/components/Divider/index.js +2 -0
  151. package/components/Field/Field.d.ts +14 -0
  152. package/components/Field/Field.d.ts.map +1 -0
  153. package/components/Field/Field.jsx +29 -0
  154. package/components/Field/Field.stories.d.ts +37 -0
  155. package/components/Field/Field.stories.d.ts.map +1 -0
  156. package/components/Field/Field.stories.jsx +174 -0
  157. package/components/Field/Field.test.d.ts +3 -0
  158. package/components/Field/Field.test.d.ts.map +1 -0
  159. package/components/Field/Field.test.jsx +91 -0
  160. package/components/Field/index.d.ts +2 -0
  161. package/components/Field/index.d.ts.map +1 -0
  162. package/components/Field/index.js +1 -0
  163. package/components/Icon/Icon.d.ts +11 -0
  164. package/components/Icon/Icon.d.ts.map +1 -0
  165. package/components/Icon/Icon.jsx +57 -0
  166. package/components/Icon/Icon.stories.d.ts +16 -0
  167. package/components/Icon/Icon.stories.d.ts.map +1 -0
  168. package/components/Icon/Icon.stories.helpers.d.ts +4 -0
  169. package/components/Icon/Icon.stories.helpers.d.ts.map +1 -0
  170. package/components/Icon/Icon.stories.helpers.jsx +7 -0
  171. package/components/Icon/Icon.stories.jsx +48 -0
  172. package/components/Icon/Icon.test.d.ts +3 -0
  173. package/components/Icon/Icon.test.d.ts.map +1 -0
  174. package/components/Icon/Icon.test.jsx +67 -0
  175. package/components/Icon/index.d.ts +2 -0
  176. package/components/Icon/index.d.ts.map +1 -0
  177. package/components/Icon/index.js +1 -0
  178. package/components/IllustratedMessage/IllustratedMessage.d.ts +13 -0
  179. package/components/IllustratedMessage/IllustratedMessage.d.ts.map +1 -0
  180. package/components/IllustratedMessage/IllustratedMessage.jsx +21 -0
  181. package/components/IllustratedMessage/IllustratedMessage.stories.d.ts +10 -0
  182. package/components/IllustratedMessage/IllustratedMessage.stories.d.ts.map +1 -0
  183. package/components/IllustratedMessage/IllustratedMessage.stories.jsx +90 -0
  184. package/components/IllustratedMessage/IllustratedMessage.test.d.ts +3 -0
  185. package/components/IllustratedMessage/IllustratedMessage.test.d.ts.map +1 -0
  186. package/components/IllustratedMessage/IllustratedMessage.test.jsx +42 -0
  187. package/components/IllustratedMessage/index.d.ts +3 -0
  188. package/components/IllustratedMessage/index.d.ts.map +1 -0
  189. package/components/IllustratedMessage/index.js +2 -0
  190. package/components/Image/Image.d.ts +11 -0
  191. package/components/Image/Image.d.ts.map +1 -0
  192. package/components/Image/Image.jsx +26 -0
  193. package/components/Image/Image.stories.d.ts +11 -0
  194. package/components/Image/Image.stories.d.ts.map +1 -0
  195. package/components/Image/Image.stories.jsx +66 -0
  196. package/components/Image/Image.test.d.ts +3 -0
  197. package/components/Image/Image.test.d.ts.map +1 -0
  198. package/components/Image/Image.test.jsx +82 -0
  199. package/components/Image/index.d.ts +2 -0
  200. package/components/Image/index.d.ts.map +1 -0
  201. package/components/Image/index.js +1 -0
  202. package/components/ImageSwatch/ImageSwatch.d.ts +20 -0
  203. package/components/ImageSwatch/ImageSwatch.d.ts.map +1 -0
  204. package/components/ImageSwatch/ImageSwatch.jsx +49 -0
  205. package/components/ImageSwatch/ImageSwatch.stories.d.ts +20 -0
  206. package/components/ImageSwatch/ImageSwatch.stories.d.ts.map +1 -0
  207. package/components/ImageSwatch/ImageSwatch.stories.jsx +206 -0
  208. package/components/ImageSwatch/ImageSwatch.test.d.ts +3 -0
  209. package/components/ImageSwatch/ImageSwatch.test.d.ts.map +1 -0
  210. package/components/ImageSwatch/ImageSwatch.test.jsx +64 -0
  211. package/components/ImageSwatch/index.d.ts +3 -0
  212. package/components/ImageSwatch/index.d.ts.map +1 -0
  213. package/components/ImageSwatch/index.js +2 -0
  214. package/components/InLineAlert/InLineAlert.d.ts +16 -0
  215. package/components/InLineAlert/InLineAlert.d.ts.map +1 -0
  216. package/components/InLineAlert/InLineAlert.jsx +38 -0
  217. package/components/InLineAlert/InLineAlert.stories.d.ts +86 -0
  218. package/components/InLineAlert/InLineAlert.stories.d.ts.map +1 -0
  219. package/components/InLineAlert/InLineAlert.stories.jsx +193 -0
  220. package/components/InLineAlert/InLineAlert.test.d.ts +3 -0
  221. package/components/InLineAlert/InLineAlert.test.d.ts.map +1 -0
  222. package/components/InLineAlert/InLineAlert.test.jsx +77 -0
  223. package/components/InLineAlert/index.d.ts +3 -0
  224. package/components/InLineAlert/index.d.ts.map +1 -0
  225. package/components/InLineAlert/index.js +2 -0
  226. package/components/Incrementer/Incrementer.d.ts +17 -0
  227. package/components/Incrementer/Incrementer.d.ts.map +1 -0
  228. package/components/Incrementer/Incrementer.jsx +87 -0
  229. package/components/Incrementer/Incrementer.stories.d.ts +10 -0
  230. package/components/Incrementer/Incrementer.stories.d.ts.map +1 -0
  231. package/components/Incrementer/Incrementer.stories.jsx +68 -0
  232. package/components/Incrementer/Incrementer.test.d.ts +3 -0
  233. package/components/Incrementer/Incrementer.test.d.ts.map +1 -0
  234. package/components/Incrementer/Incrementer.test.jsx +112 -0
  235. package/components/Incrementer/index.d.ts +2 -0
  236. package/components/Incrementer/index.d.ts.map +1 -0
  237. package/components/Incrementer/index.js +1 -0
  238. package/components/Input/Input.d.ts +19 -0
  239. package/components/Input/Input.d.ts.map +1 -0
  240. package/components/Input/Input.jsx +73 -0
  241. package/components/Input/Input.stories.d.ts +11 -0
  242. package/components/Input/Input.stories.d.ts.map +1 -0
  243. package/components/Input/Input.stories.jsx +115 -0
  244. package/components/Input/Input.test.d.ts +3 -0
  245. package/components/Input/Input.test.d.ts.map +1 -0
  246. package/components/Input/Input.test.jsx +111 -0
  247. package/components/Input/index.d.ts +3 -0
  248. package/components/Input/index.d.ts.map +1 -0
  249. package/components/Input/index.js +2 -0
  250. package/components/Modal/Modal.d.ts +15 -0
  251. package/components/Modal/Modal.d.ts.map +1 -0
  252. package/components/Modal/Modal.jsx +93 -0
  253. package/components/Modal/Modal.stories.d.ts +56 -0
  254. package/components/Modal/Modal.stories.d.ts.map +1 -0
  255. package/components/Modal/Modal.stories.jsx +189 -0
  256. package/components/Modal/Modal.test.d.ts +3 -0
  257. package/components/Modal/Modal.test.d.ts.map +1 -0
  258. package/components/Modal/Modal.test.jsx +85 -0
  259. package/components/Modal/index.d.ts +2 -0
  260. package/components/Modal/index.d.ts.map +1 -0
  261. package/components/Modal/index.js +14 -0
  262. package/components/Picker/Picker.d.ts +26 -0
  263. package/components/Picker/Picker.d.ts.map +1 -0
  264. package/components/Picker/Picker.jsx +81 -0
  265. package/components/Picker/Picker.stories.d.ts +22 -0
  266. package/components/Picker/Picker.stories.d.ts.map +1 -0
  267. package/components/Picker/Picker.stories.jsx +236 -0
  268. package/components/Picker/Picker.test.d.ts +2 -0
  269. package/components/Picker/Picker.test.d.ts.map +1 -0
  270. package/components/Picker/Picker.test.jsx +190 -0
  271. package/components/Picker/index.d.ts +2 -0
  272. package/components/Picker/index.d.ts.map +1 -0
  273. package/components/Picker/index.js +1 -0
  274. package/components/Price/Price.d.ts +17 -0
  275. package/components/Price/Price.d.ts.map +1 -0
  276. package/components/Price/Price.jsx +24 -0
  277. package/components/Price/Price.stories.d.ts +17 -0
  278. package/components/Price/Price.stories.d.ts.map +1 -0
  279. package/components/Price/Price.stories.jsx +78 -0
  280. package/components/Price/Price.test.d.ts +3 -0
  281. package/components/Price/Price.test.d.ts.map +1 -0
  282. package/components/Price/Price.test.jsx +68 -0
  283. package/components/Price/index.d.ts +2 -0
  284. package/components/Price/index.d.ts.map +1 -0
  285. package/components/Price/index.js +1 -0
  286. package/components/PriceRange/PriceRange.d.ts +17 -0
  287. package/components/PriceRange/PriceRange.d.ts.map +1 -0
  288. package/components/PriceRange/PriceRange.jsx +75 -0
  289. package/components/PriceRange/PriceRange.stories.d.ts +107 -0
  290. package/components/PriceRange/PriceRange.stories.d.ts.map +1 -0
  291. package/components/PriceRange/PriceRange.stories.jsx +210 -0
  292. package/components/PriceRange/PriceRange.test.d.ts +3 -0
  293. package/components/PriceRange/PriceRange.test.d.ts.map +1 -0
  294. package/components/PriceRange/PriceRange.test.jsx +188 -0
  295. package/components/PriceRange/index.d.ts +3 -0
  296. package/components/PriceRange/index.d.ts.map +1 -0
  297. package/components/PriceRange/index.js +2 -0
  298. package/components/PriceSummary/PriceSummary.d.ts +43 -0
  299. package/components/PriceSummary/PriceSummary.d.ts.map +1 -0
  300. package/components/PriceSummary/PriceSummary.jsx +228 -0
  301. package/components/PriceSummary/PriceSummary.stories.d.ts +127 -0
  302. package/components/PriceSummary/PriceSummary.stories.d.ts.map +1 -0
  303. package/components/PriceSummary/PriceSummary.stories.jsx +456 -0
  304. package/components/PriceSummary/PriceSummary.test.d.ts +3 -0
  305. package/components/PriceSummary/PriceSummary.test.d.ts.map +1 -0
  306. package/components/PriceSummary/PriceSummary.test.jsx +275 -0
  307. package/components/PriceSummary/index.d.ts +3 -0
  308. package/components/PriceSummary/index.d.ts.map +1 -0
  309. package/components/PriceSummary/index.js +2 -0
  310. package/components/ProgressSpinner/ProgressSpinner.d.ts +14 -0
  311. package/components/ProgressSpinner/ProgressSpinner.d.ts.map +1 -0
  312. package/components/ProgressSpinner/ProgressSpinner.jsx +31 -0
  313. package/components/ProgressSpinner/ProgressSpinner.stories.d.ts +19 -0
  314. package/components/ProgressSpinner/ProgressSpinner.stories.d.ts.map +1 -0
  315. package/components/ProgressSpinner/ProgressSpinner.stories.jsx +195 -0
  316. package/components/ProgressSpinner/ProgressSpinner.test.d.ts +3 -0
  317. package/components/ProgressSpinner/ProgressSpinner.test.d.ts.map +1 -0
  318. package/components/ProgressSpinner/ProgressSpinner.test.jsx +40 -0
  319. package/components/ProgressSpinner/index.d.ts +3 -0
  320. package/components/ProgressSpinner/index.d.ts.map +1 -0
  321. package/components/ProgressSpinner/index.js +2 -0
  322. package/components/RadioButton/RadioButton.d.ts +15 -0
  323. package/components/RadioButton/RadioButton.d.ts.map +1 -0
  324. package/components/RadioButton/RadioButton.jsx +31 -0
  325. package/components/RadioButton/RadioButton.stories.d.ts +15 -0
  326. package/components/RadioButton/RadioButton.stories.d.ts.map +1 -0
  327. package/components/RadioButton/RadioButton.stories.jsx +92 -0
  328. package/components/RadioButton/RadioButton.test.d.ts +3 -0
  329. package/components/RadioButton/RadioButton.test.d.ts.map +1 -0
  330. package/components/RadioButton/RadioButton.test.jsx +62 -0
  331. package/components/RadioButton/index.d.ts +3 -0
  332. package/components/RadioButton/index.d.ts.map +1 -0
  333. package/components/RadioButton/index.js +2 -0
  334. package/components/Skeleton/Skeleton.d.ts +17 -0
  335. package/components/Skeleton/Skeleton.d.ts.map +1 -0
  336. package/components/Skeleton/Skeleton.jsx +52 -0
  337. package/components/Skeleton/Skeleton.stories.d.ts +67 -0
  338. package/components/Skeleton/Skeleton.stories.d.ts.map +1 -0
  339. package/components/Skeleton/Skeleton.stories.jsx +184 -0
  340. package/components/Skeleton/Skeleton.test.d.ts +3 -0
  341. package/components/Skeleton/Skeleton.test.d.ts.map +1 -0
  342. package/components/Skeleton/Skeleton.test.jsx +62 -0
  343. package/components/Skeleton/index.d.ts +2 -0
  344. package/components/Skeleton/index.d.ts.map +1 -0
  345. package/components/Skeleton/index.js +1 -0
  346. package/components/TextSwatch/TextSwatch.d.ts +18 -0
  347. package/components/TextSwatch/TextSwatch.d.ts.map +1 -0
  348. package/components/TextSwatch/TextSwatch.jsx +56 -0
  349. package/components/TextSwatch/TextSwatch.stories.d.ts +21 -0
  350. package/components/TextSwatch/TextSwatch.stories.d.ts.map +1 -0
  351. package/components/TextSwatch/TextSwatch.stories.jsx +211 -0
  352. package/components/TextSwatch/TextSwatch.test.d.ts +3 -0
  353. package/components/TextSwatch/TextSwatch.test.d.ts.map +1 -0
  354. package/components/TextSwatch/TextSwatch.test.jsx +85 -0
  355. package/components/TextSwatch/index.d.ts +3 -0
  356. package/components/TextSwatch/index.d.ts.map +1 -0
  357. package/components/TextSwatch/index.js +2 -0
  358. package/components/UIProvider/UIProvider.d.ts +18 -0
  359. package/components/UIProvider/UIProvider.d.ts.map +1 -0
  360. package/components/UIProvider/UIProvider.jsx +26 -0
  361. package/components/UIProvider/UIProvider.test.d.ts +2 -0
  362. package/components/UIProvider/UIProvider.test.d.ts.map +1 -0
  363. package/components/UIProvider/UIProvider.test.jsx +9 -0
  364. package/components/UIProvider/index.d.ts +2 -0
  365. package/components/UIProvider/index.d.ts.map +1 -0
  366. package/components/UIProvider/index.js +1 -0
  367. package/components/index.d.ts +34 -0
  368. package/components/index.d.ts.map +1 -0
  369. package/components/index.js +33 -0
  370. package/docs/Design/designBlocks.d.ts +21 -0
  371. package/docs/Design/designBlocks.d.ts.map +1 -0
  372. package/docs/Design/designBlocks.jsx +59 -0
  373. package/docs/Design/getTokenData.d.ts +7 -0
  374. package/docs/Design/getTokenData.d.ts.map +1 -0
  375. package/docs/Design/getTokenData.js +18 -0
  376. package/docs/Design/getTokenData.test.d.ts +2 -0
  377. package/docs/Design/getTokenData.test.d.ts.map +1 -0
  378. package/docs/Design/getTokenData.test.js +92 -0
  379. package/event-bus.js +49 -1
  380. package/fetch-graphql.js +62 -1
  381. package/i18n/en_US.json +112 -0
  382. package/i18n/index.d.ts +341 -0
  383. package/i18n/index.d.ts.map +1 -0
  384. package/i18n/index.js +12 -0
  385. package/i18n/index.test.d.ts +2 -0
  386. package/i18n/index.test.d.ts.map +1 -0
  387. package/i18n/index.test.js +11 -0
  388. package/icons/index.d.ts +35 -0
  389. package/icons/index.d.ts.map +1 -0
  390. package/icons/index.js +34 -0
  391. package/initializer.js +61 -1
  392. package/lib/classes.d.ts +5 -0
  393. package/lib/classes.d.ts.map +1 -0
  394. package/lib/classes.js +16 -0
  395. package/lib/classes.test.d.ts +2 -0
  396. package/lib/classes.test.d.ts.map +1 -0
  397. package/lib/classes.test.js +18 -0
  398. package/lib/config.d.ts +7 -0
  399. package/lib/config.d.ts.map +1 -0
  400. package/lib/config.js +12 -0
  401. package/lib/config.test.d.ts +2 -0
  402. package/lib/config.test.d.ts.map +1 -0
  403. package/lib/config.test.js +12 -0
  404. package/lib/debounce.d.ts +2 -0
  405. package/lib/debounce.d.ts.map +1 -0
  406. package/lib/debounce.js +7 -0
  407. package/lib/debounce.test.d.ts +2 -0
  408. package/lib/debounce.test.d.ts.map +1 -0
  409. package/lib/debounce.test.js +40 -0
  410. package/lib/deepmerge.d.ts +2 -0
  411. package/lib/deepmerge.d.ts.map +1 -0
  412. package/lib/deepmerge.js +1 -0
  413. package/lib/form-values.d.ts +5 -0
  414. package/lib/form-values.d.ts.map +1 -0
  415. package/lib/form-values.js +17 -0
  416. package/lib/form-values.test.d.ts +2 -0
  417. package/lib/form-values.test.d.ts.map +1 -0
  418. package/lib/form-values.test.jsx +29 -0
  419. package/lib/i18n.d.ts +8 -0
  420. package/lib/i18n.d.ts.map +1 -0
  421. package/lib/i18n.js +9 -0
  422. package/lib/i18n.test.d.ts +2 -0
  423. package/lib/i18n.test.d.ts.map +1 -0
  424. package/lib/i18n.test.jsx +8 -0
  425. package/lib/image-params-keymap.d.ts +4 -0
  426. package/lib/image-params-keymap.d.ts.map +1 -0
  427. package/lib/image-params-keymap.js +19 -0
  428. package/lib/image-params-keymap.test.d.ts +2 -0
  429. package/lib/image-params-keymap.test.d.ts.map +1 -0
  430. package/lib/image-params-keymap.test.js +7 -0
  431. package/lib/index.d.ts +14 -0
  432. package/lib/index.d.ts.map +1 -0
  433. package/lib/index.js +13 -0
  434. package/lib/initializer.d.ts +78 -0
  435. package/lib/initializer.d.ts.map +1 -0
  436. package/lib/initializer.js +93 -0
  437. package/lib/initializer.test.d.ts +2 -0
  438. package/lib/initializer.test.d.ts.map +1 -0
  439. package/lib/initializer.test.js +64 -0
  440. package/lib/render.d.ts +10 -0
  441. package/lib/render.d.ts.map +1 -0
  442. package/lib/render.jsx +34 -0
  443. package/lib/render.test.d.ts +2 -0
  444. package/lib/render.test.d.ts.map +1 -0
  445. package/lib/render.test.jsx +70 -0
  446. package/lib/resolve-image.d.ts +10 -0
  447. package/lib/resolve-image.d.ts.map +1 -0
  448. package/lib/resolve-image.js +57 -0
  449. package/lib/resolve-image.test.d.ts +2 -0
  450. package/lib/resolve-image.test.d.ts.map +1 -0
  451. package/lib/resolve-image.test.jsx +146 -0
  452. package/lib/slot.d.ts +43 -0
  453. package/lib/slot.d.ts.map +1 -0
  454. package/lib/slot.jsx +184 -0
  455. package/lib/slot.test.d.ts +2 -0
  456. package/lib/slot.test.d.ts.map +1 -0
  457. package/lib/slot.test.jsx +325 -0
  458. package/lib/tests.d.ts +4 -0
  459. package/lib/tests.d.ts.map +1 -0
  460. package/lib/tests.jsx +19 -0
  461. package/lib/tests.test.d.ts +2 -0
  462. package/lib/tests.test.d.ts.map +1 -0
  463. package/lib/tests.test.jsx +13 -0
  464. package/lib/types.d.ts +9 -0
  465. package/lib/types.d.ts.map +1 -0
  466. package/lib/types.js +1 -0
  467. package/lib/vcomponent.d.ts +8 -0
  468. package/lib/vcomponent.d.ts.map +1 -0
  469. package/lib/vcomponent.jsx +27 -0
  470. package/lib/vcomponent.test.d.ts +2 -0
  471. package/lib/vcomponent.test.d.ts.map +1 -0
  472. package/lib/vcomponent.test.jsx +51 -0
  473. package/package.json +1 -1
  474. package/preact-compat.js +93 -1
  475. package/preact-hooks.js +40 -1
  476. package/preact-jsx-runtime.js +35 -1
  477. package/preact.js +21 -1
  478. package/runtime.js +69 -1
@@ -0,0 +1,25 @@
1
+ import { FunctionComponent, VNode } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+ import '@adobe/elsie/components/Accordion/Accordion.css';
4
+ export interface AccordionSectionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'icon'> {
5
+ actionIconPosition?: 'left' | 'right';
6
+ iconOpen?: VNode<HTMLAttributes<SVGSVGElement>>;
7
+ iconClose?: VNode<HTMLAttributes<SVGSVGElement>>;
8
+ iconLeft?: VNode<HTMLAttributes<SVGSVGElement>>;
9
+ showIconLeft?: boolean;
10
+ secondaryText?: string | VNode<HTMLAttributes<HTMLSpanElement>>;
11
+ renderContentWhenClosed?: boolean;
12
+ onStateChange?: (open: boolean) => void;
13
+ }
14
+ export declare const AccordionSection: FunctionComponent<AccordionSectionProps>;
15
+ export interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'icon'> {
16
+ actionIconPosition?: 'left' | 'right';
17
+ iconOpen?: VNode<HTMLAttributes<SVGSVGElement>>;
18
+ iconClose?: VNode<HTMLAttributes<SVGSVGElement>>;
19
+ iconLeft?: VNode<HTMLAttributes<SVGSVGElement>>;
20
+ showIconLeft?: boolean;
21
+ secondaryText?: string | VNode<HTMLAttributes<HTMLSpanElement>>;
22
+ children: VNode<AccordionSectionProps>[] | VNode<AccordionSectionProps>;
23
+ }
24
+ export declare const Accordion: FunctionComponent<AccordionProps>;
25
+ //# sourceMappingURL=Accordion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,cAAc,EAAY,MAAM,eAAe,CAAC;AAKzD,OAAO,iDAAiD,CAAC;AACzD,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACpD,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IAChE,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,qBAAqB,CA2FrE,CAAC;AAEF,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACpD,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IAChE,QAAQ,EAAE,KAAK,CAAC,qBAAqB,CAAC,EAAE,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC;CACzE;AAED,eAAO,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,CAkCvD,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { useState } from 'preact/compat';
2
+ import { classes } from '@adobe/elsie/lib';
3
+ import { Divider, Icon } from '@adobe/elsie/components';
4
+ import { Add, Minus } from '@adobe/elsie/icons';
5
+ import { useText } from '@adobe/elsie/i18n';
6
+ import '@adobe/elsie/components/Accordion/Accordion.css';
7
+ export const AccordionSection = ({ className, children, title, secondaryText, actionIconPosition = 'left', iconOpen = Add, iconClose = Minus, iconLeft = Add, showIconLeft = false, renderContentWhenClosed = true, onStateChange, ...props }) => {
8
+ const [open, setOpen] = useState(false);
9
+ const onClickHandler = (e) => {
10
+ e.stopImmediatePropagation();
11
+ const next = !open;
12
+ setOpen(next);
13
+ onStateChange?.(next);
14
+ };
15
+ const buttonLabel = useText(`Dropin.Accordion.${open ? 'close' : 'open'}.label`).label;
16
+ const openIcon = (<Icon source={iconOpen} size="24" onClick={onClickHandler} onKeyPress={onClickHandler} className={'dropin-accordion-section__open-icon'}/>);
17
+ const closeIcon = (<Icon source={iconClose} size="24" onClick={onClickHandler} onKeyPress={onClickHandler} className={'dropin-accordion-section__close-icon'}/>);
18
+ const leftIcon = <Icon source={iconLeft} size="24"/>;
19
+ return (<div {...props} className={classes(['dropin-accordion-section', className])}>
20
+ <div className={'dropin-accordion-section__heading'}>
21
+ <div className={'dropin-accordion-section__flex'} onClick={onClickHandler} onKeyPress={onClickHandler} role="button" aria-label={`${buttonLabel} ${title}`} tabIndex={0}>
22
+ <div className={'dropin-accordion-section__title-container'}>
23
+ {actionIconPosition === 'left' && (open ? closeIcon : openIcon)}
24
+
25
+ {showIconLeft && leftIcon}
26
+
27
+ <h3 className={'dropin-accordion-section__title'}>{title}</h3>
28
+ </div>
29
+ </div>
30
+
31
+ <div className={'dropin-accordion-section__secondary-text-container'}>
32
+ {secondaryText && (<h4 className={'dropin-accordion-section__secondary-text'}>
33
+ {secondaryText}
34
+ </h4>)}
35
+
36
+ {actionIconPosition === 'right' && (open ? closeIcon : openIcon)}
37
+ </div>
38
+ </div>
39
+
40
+ <div className={'dropin-accordion-section__content-container'} style={{ display: open ? 'grid' : 'none' }}>
41
+ {(open || (renderContentWhenClosed && !open)) && children}
42
+ </div>
43
+ </div>);
44
+ };
45
+ export const Accordion = ({ className, children, actionIconPosition = 'left', iconOpen = Add, iconClose = Minus, ...props }) => {
46
+ const divider = <Divider variant="secondary"/>;
47
+ const renderAccordionSection = (child) => (<>
48
+ <AccordionSection {...child.props} actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}/>
49
+ {divider}
50
+ </>);
51
+ return (<div {...props} className={classes(['dropin-accordion', className])}>
52
+ {[
53
+ divider,
54
+ ...(Array.isArray(children)
55
+ ? children
56
+ : [children]).map(renderAccordionSection),
57
+ ]}
58
+ </div>);
59
+ };
@@ -0,0 +1,22 @@
1
+ import type { Meta, StoryObj } from '@storybook/preact';
2
+ import { AccordionProps, AccordionSectionProps } from '@adobe/elsie/components/Accordion';
3
+ declare const meta: Meta<AccordionProps & AccordionSectionProps>;
4
+ export default meta;
5
+ type Story = StoryObj<AccordionProps>;
6
+ /**
7
+ * ```ts
8
+ * import { Accordion, AccordionSection } from '@adobe/elsie/components/Accordion';
9
+ *
10
+ * <Accordion>
11
+ * <AccordionSection title={"Title"}><p>Short product details should be kept to 6 lines maximum.</p></AccordionSection>
12
+ * </Accordion>
13
+ *
14
+ * ```
15
+ */
16
+ export declare const SingleSection: Story;
17
+ export declare const SingleSectionWithLeftIcon: Story;
18
+ export declare const SingleSectionWithOptionalText: Story;
19
+ export declare const SingleSectionWithPrice: Story;
20
+ export declare const SingleSectionWithLinkAndCartItem: Story;
21
+ export declare const MultipleSection: Story;
22
+ //# sourceMappingURL=Accordion.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Accordion.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,cAAc,EAEd,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAM3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,cAAc,GAAG,qBAAqB,CAmDtD,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;AAEtC;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,KAmD3B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAsDvC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,KA8D3C,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KA8CpC,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,KA+E9C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA8G7B,CAAC"}
@@ -0,0 +1,320 @@
1
+ import { Accordion, AccordionSection, } from '@adobe/elsie/components/Accordion';
2
+ import { Price, Card, Image, CartItem } from '..';
3
+ import { expect } from '@storybook/jest';
4
+ import { within, userEvent } from '@storybook/testing-library';
5
+ import * as Icons from '@adobe/elsie/icons';
6
+ const meta = {
7
+ title: 'Components/Accordion',
8
+ component: Accordion,
9
+ tags: ['autodocs'],
10
+ parameters: {
11
+ layout: 'centered', // centered | fullscreen
12
+ },
13
+ argTypes: {
14
+ actionIconPosition: {
15
+ description: 'Position of the action icon',
16
+ options: ['left', 'right'],
17
+ control: {
18
+ type: 'select',
19
+ },
20
+ defaultValue: 'left',
21
+ },
22
+ iconOpen: {
23
+ description: 'Icon for open button (svg)',
24
+ options: Object.keys(Icons),
25
+ mapping: Icons,
26
+ control: {
27
+ type: 'select',
28
+ },
29
+ defaultValue: 'Minus',
30
+ },
31
+ iconClose: {
32
+ description: 'Icon for close button (svg)',
33
+ options: Object.keys(Icons),
34
+ mapping: Icons,
35
+ control: {
36
+ type: 'select',
37
+ },
38
+ defaultValue: 'Minus',
39
+ },
40
+ iconLeft: {
41
+ description: 'Optional icon on left side (svg)',
42
+ options: Object.keys(Icons),
43
+ mapping: Icons,
44
+ control: {
45
+ type: 'select',
46
+ },
47
+ defaultValue: 'Minus',
48
+ },
49
+ showIconLeft: {
50
+ description: 'Whether or not the display the leftIcon',
51
+ type: 'boolean',
52
+ defaultValue: {
53
+ summary: false,
54
+ },
55
+ },
56
+ },
57
+ };
58
+ export default meta;
59
+ /**
60
+ * ```ts
61
+ * import { Accordion, AccordionSection } from '@adobe/elsie/components/Accordion';
62
+ *
63
+ * <Accordion>
64
+ * <AccordionSection title={"Title"}><p>Short product details should be kept to 6 lines maximum.</p></AccordionSection>
65
+ * </Accordion>
66
+ *
67
+ * ```
68
+ */
69
+ export const SingleSection = {
70
+ args: {
71
+ actionIconPosition: 'right',
72
+ iconOpen: Icons.Add,
73
+ iconClose: Icons.Minus,
74
+ },
75
+ render: ({ actionIconPosition, iconOpen, iconClose }) => (<div>
76
+ <h2 style={{
77
+ font: 'var(--type-body-1-strong-font)',
78
+ color: 'var(--color-neutral-800)',
79
+ letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
80
+ }}>
81
+ This is the Accordion Component, this title will be longer in order to
82
+ increase width of the story
83
+ </h2>
84
+
85
+ <Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
86
+ <AccordionSection title={'Title'}>
87
+ <p>Short product details should be kept to 6 lines maximum.</p>
88
+ </AccordionSection>
89
+ </Accordion>
90
+ </div>),
91
+ play: async () => {
92
+ const canvasElement = document.querySelector('#storybook-root');
93
+ const canvas = within(canvasElement);
94
+ const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
95
+ await expect(loaderIcon).toBeVisible();
96
+ const header = document.querySelector('.dropin-accordion-section__heading');
97
+ await expect(header).toHaveTextContent('Title');
98
+ await userEvent.click(canvas.getByRole('button'));
99
+ const content = document.querySelector('.dropin-accordion-section__content-container');
100
+ await expect(content).toBeVisible();
101
+ },
102
+ };
103
+ export const SingleSectionWithLeftIcon = {
104
+ args: {
105
+ actionIconPosition: 'right',
106
+ iconOpen: Icons.Add,
107
+ iconClose: Icons.Minus,
108
+ iconLeft: Icons.Card,
109
+ showIconLeft: true,
110
+ },
111
+ render: ({ actionIconPosition, iconOpen, iconClose, iconLeft, showIconLeft, }) => (<div>
112
+ <h2 style={{
113
+ font: 'var(--type-body-1-strong-font)',
114
+ color: 'var(--color-neutral-800)',
115
+ letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
116
+ }}>
117
+ This is the Accordion Component, this title will be longer in order to
118
+ increase width of the story
119
+ </h2>
120
+
121
+ <Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
122
+ <AccordionSection title={'Title'} secondaryText={'Optional Text'} iconLeft={iconLeft} showIconLeft={showIconLeft}>
123
+ <p>Short product details should be kept to 6 lines maximum.</p>
124
+ </AccordionSection>
125
+ </Accordion>
126
+ </div>),
127
+ play: async () => {
128
+ const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
129
+ await expect(loaderIcon).toBeVisible();
130
+ const leftHeader = document.querySelector('.dropin-accordion-section__title-container');
131
+ await expect(leftHeader).toBeVisible();
132
+ await expect(leftHeader).toContainHTML('<svg');
133
+ },
134
+ };
135
+ export const SingleSectionWithOptionalText = {
136
+ args: {
137
+ actionIconPosition: 'right',
138
+ iconOpen: Icons.Add,
139
+ iconClose: Icons.Minus,
140
+ iconLeft: Icons.Card,
141
+ secondaryText: 'Optional Text',
142
+ },
143
+ argTypes: {
144
+ secondaryText: {
145
+ description: 'Add text to the button.',
146
+ table: {
147
+ type: { summary: 'ComponentChildren' },
148
+ },
149
+ control: 'text',
150
+ },
151
+ },
152
+ render: ({ actionIconPosition, iconOpen, iconClose, iconLeft, secondaryText, }) => (<div>
153
+ <h2 style={{
154
+ font: 'var(--type-body-1-strong-font)',
155
+ color: 'var(--color-neutral-800)',
156
+ letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
157
+ }}>
158
+ This is the Accordion Component, this title will be longer in order to
159
+ increase width of the story
160
+ </h2>
161
+
162
+ <Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
163
+ <AccordionSection title={'Title'} secondaryText={secondaryText} iconLeft={iconLeft}>
164
+ <p>Short product details should be kept to 6 lines maximum.</p>
165
+ </AccordionSection>
166
+ </Accordion>
167
+ </div>),
168
+ play: async () => {
169
+ const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
170
+ await expect(loaderIcon).toBeVisible();
171
+ const secondaryText = document.querySelector('.dropin-accordion-section__secondary-text');
172
+ await expect(secondaryText).toBeVisible();
173
+ await expect(secondaryText).toHaveTextContent('Optional Text');
174
+ },
175
+ };
176
+ export const SingleSectionWithPrice = {
177
+ args: {
178
+ actionIconPosition: 'right',
179
+ iconOpen: Icons.Add,
180
+ iconClose: Icons.Minus,
181
+ iconLeft: Icons.Card,
182
+ },
183
+ render: ({ actionIconPosition, iconOpen, iconClose, iconLeft }) => (<div>
184
+ <h2 style={{
185
+ font: 'var(--type-body-1-strong-font)',
186
+ color: 'var(--color-neutral-800)',
187
+ letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
188
+ }}>
189
+ This is the Accordion Component, this title will be longer in order to
190
+ increase width of the story
191
+ </h2>
192
+
193
+ <Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
194
+ <AccordionSection title={'Title'} iconLeft={iconLeft} secondaryText={<Price amount={9.99}/>}>
195
+ <p>Short product details should be kept to 6 lines maximum.</p>
196
+ </AccordionSection>
197
+ </Accordion>
198
+ </div>),
199
+ play: async () => {
200
+ const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
201
+ await expect(loaderIcon).toBeVisible();
202
+ const secondaryText = document.querySelector('.dropin-accordion-section__secondary-text');
203
+ await expect(secondaryText).toBeVisible();
204
+ await expect(secondaryText).toHaveTextContent('$9.99');
205
+ },
206
+ };
207
+ export const SingleSectionWithLinkAndCartItem = {
208
+ args: {
209
+ actionIconPosition: 'left',
210
+ iconOpen: Icons.ChevronDown,
211
+ iconClose: Icons.ChevronUp,
212
+ },
213
+ render: ({ actionIconPosition, iconOpen, iconClose }) => (<div>
214
+ <h2 style={{
215
+ font: 'var(--type-body-1-strong-font)',
216
+ color: 'var(--color-neutral-800)',
217
+ letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
218
+ }}>
219
+ This is the Accordion Component, this title will be longer in order to
220
+ increase width of the story
221
+ </h2>
222
+
223
+ <Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
224
+ <AccordionSection title={'Title'} secondaryText={<a rel="noreferrer" href="/cart">
225
+ Edit
226
+ </a>}>
227
+ <CartItem key={'uuid'} title={<div>Short Name</div>} description={<div>
228
+ Secondary product information such as brand name, description,
229
+ etc.
230
+ </div>} sku={<div>SKU: 59YK7</div>} quantity={1} image={<Image src="https://picsum.photos/132/184" width="132" height="184" alt="Some alternative text" loading="lazy"/>} price={<Price amount={53.99} style={{ fontWeight: 'inherit', color: 'inherit' }}/>} total={<>
231
+ <Price amount={59.98} variant="strikethrough"/>
232
+ <Price amount={55.95} sale/>
233
+ </>}/>
234
+ </AccordionSection>
235
+ </Accordion>
236
+ </div>),
237
+ play: async () => {
238
+ const accordionElement = document.querySelector('.dropin-accordion');
239
+ const link = accordionElement.querySelector('.dropin-accordion a');
240
+ await expect(accordionElement).toBeVisible();
241
+ await expect(link).toHaveTextContent('Edit');
242
+ await expect(link).toHaveAttribute('href', '/cart');
243
+ },
244
+ };
245
+ export const MultipleSection = {
246
+ args: {
247
+ actionIconPosition: 'right',
248
+ iconOpen: Icons.ChevronDown,
249
+ iconClose: Icons.ChevronUp,
250
+ iconLeft: Icons.Card,
251
+ showIconLeft: false,
252
+ },
253
+ argTypes: {
254
+ showIconLeft: {
255
+ table: {
256
+ disable: true,
257
+ },
258
+ },
259
+ iconLeft: {
260
+ table: {
261
+ disable: true,
262
+ },
263
+ },
264
+ },
265
+ render: ({ actionIconPosition, iconOpen, iconClose }) => (<div>
266
+ <h2 style={{
267
+ font: 'var(--type-body-1-strong-font)',
268
+ color: 'var(--color-neutral-800)',
269
+ letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
270
+ }}>
271
+ This is the Accordion Component, this title will be longer in order to
272
+ increase width of the story
273
+ </h2>
274
+
275
+ <Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
276
+ <AccordionSection title={'Cart summary'} iconLeft={Icons.Cart} showIconLeft={true} renderContentWhenClosed={false}>
277
+ <Card>
278
+ <h2 style={{ font: 'var(--type-headline-2-strong-font)' }}>
279
+ Title
280
+ </h2>
281
+ <p style={{ font: 'var(--type-body-2-default-font)' }}>
282
+ This is a short description of the item and should be kept to two
283
+ or three lines as maximum.
284
+ </p>
285
+ </Card>
286
+ </AccordionSection>
287
+ <AccordionSection title={'Card info'} iconLeft={Icons.Card} showIconLeft={true} secondaryText={'Optional Text'} renderContentWhenClosed={false}>
288
+ <p>
289
+ Short product details should be kept to 6 lines maximum.
290
+ <br />
291
+ Short product details should be kept to 6 lines maximum.
292
+ <br />
293
+ Short product details should be kept to 6 lines maximum.
294
+ <br />
295
+ Short product details should be kept to 6 lines maximum.
296
+ <br />
297
+ Short product details should be kept to 6 lines maximum.
298
+ <br />
299
+ </p>
300
+ </AccordionSection>
301
+ <AccordionSection title={'Wallet'} iconLeft={Icons.Wallet} showIconLeft={true}>
302
+ <p>Short product details should be kept to 6 lines maximum.</p>
303
+ </AccordionSection>
304
+ <AccordionSection title={'Shipping'} iconLeft={Icons.Delivery} showIconLeft={true}>
305
+ <p>Short product details should be kept to 6 lines maximum.</p>
306
+ </AccordionSection>
307
+ <AccordionSection title={'Notes'} iconLeft={Icons.Delivery} showIconLeft={false}>
308
+ <p>Short product details should be kept to 6 lines maximum.</p>
309
+ </AccordionSection>
310
+ </Accordion>
311
+ </div>),
312
+ play: async () => {
313
+ const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
314
+ await expect(loaderIcon).toBeVisible();
315
+ const section = document.querySelector('.dropin-accordion-section');
316
+ await expect(section).toBeVisible();
317
+ const divider = document.querySelector('.dropin-divider');
318
+ await expect(divider).toBeVisible();
319
+ },
320
+ };
@@ -0,0 +1,3 @@
1
+ /** https://preactjs.com/guide/v10/preact-testing-library/ */
2
+ export {};
3
+ //# sourceMappingURL=Accordion.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Accordion.test.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
@@ -0,0 +1,79 @@
1
+ /** https://preactjs.com/guide/v10/preact-testing-library/ */
2
+ import { render, fireEvent, act } from '@adobe/elsie/lib/tests';
3
+ import { Accordion, AccordionSection } from '@adobe/elsie/components/Accordion';
4
+ describe('Base/Components/Accordion', () => {
5
+ test('renders', () => {
6
+ const { container } = render(<Accordion>
7
+ <AccordionSection title={'Title'}>
8
+ <span>Content goes here</span>
9
+ </AccordionSection>
10
+ </Accordion>);
11
+ const element = container.querySelector('.dropin-accordion');
12
+ expect(element).toMatchSnapshot();
13
+ });
14
+ test('renders and open', () => {
15
+ const mockOnStateChange = jest.fn();
16
+ const { container } = render(<Accordion>
17
+ <AccordionSection showIconLeft={true} title={'Title'} onStateChange={mockOnStateChange}>
18
+ <span>Content goes here</span>
19
+ </AccordionSection>
20
+ <AccordionSection showIconLeft={true} title={'Title2'} secondaryText={'Optional Text'}>
21
+ <span>Content goes here2</span>
22
+ </AccordionSection>
23
+ </Accordion>);
24
+ const button = container.querySelector('.dropin-accordion-section__flex');
25
+ expect(button).not.toBeNull();
26
+ act(() => {
27
+ fireEvent.click(button);
28
+ });
29
+ expect(mockOnStateChange).toHaveBeenCalledTimes(1);
30
+ const element_new = container.querySelector('.dropin-accordion');
31
+ expect(element_new).toMatchSnapshot();
32
+ });
33
+ test('renders different sections with action icon on different positions', () => {
34
+ const mockOnStateChange = jest.fn();
35
+ const { container } = render(<>
36
+ <AccordionSection showIconLeft={true} title={'Title1'} onStateChange={mockOnStateChange} actionIconPosition={'right'}>
37
+ <span>Content goes here1</span>
38
+ </AccordionSection>
39
+ <AccordionSection showIconLeft={true} title={'Title2'} onStateChange={mockOnStateChange} actionIconPosition={'left'}>
40
+ <span>Content goes here2</span>
41
+ </AccordionSection>
42
+ <AccordionSection showIconLeft={true} title={'Title3'} onStateChange={mockOnStateChange}>
43
+ <span>Content goes here3</span>
44
+ </AccordionSection>
45
+ </>);
46
+ const element = container.querySelector('.dropin-accordion-section');
47
+ expect(!!container).toEqual(true);
48
+ expect(container).toMatchSnapshot();
49
+ expect(element).not.toBeNull();
50
+ const actionButton = container.querySelector('.dropin-accordion-section__open-icon');
51
+ expect(actionButton).not.toBeNull();
52
+ act(() => {
53
+ fireEvent.click(actionButton);
54
+ });
55
+ expect(mockOnStateChange).toHaveBeenCalledTimes(1);
56
+ });
57
+ test('should render content when section is closed and renderContentWhenClosed is true', () => {
58
+ const { container } = render(<Accordion>
59
+ <AccordionSection title={'Title'} renderContentWhenClosed={true}>
60
+ <span id="content">Content goes here</span>
61
+ </AccordionSection>
62
+ </Accordion>);
63
+ const element = container.querySelector('.dropin-accordion');
64
+ expect(element).toMatchSnapshot();
65
+ const content = container.querySelector('#content');
66
+ expect(content).not.toBeNull();
67
+ });
68
+ test('should not render content when section is closed and renderContentWhenClosed is false', () => {
69
+ const { container } = render(<Accordion>
70
+ <AccordionSection title={'Title'} renderContentWhenClosed={false}>
71
+ <span id="content">Content goes here</span>
72
+ </AccordionSection>
73
+ </Accordion>);
74
+ const element = container.querySelector('.dropin-accordion');
75
+ expect(element).toMatchSnapshot();
76
+ const content = container.querySelector('#content');
77
+ expect(content).toBeNull();
78
+ });
79
+ });
@@ -0,0 +1,3 @@
1
+ export * from '@adobe/elsie/components/Accordion/Accordion';
2
+ export { Accordion as default } from '@adobe/elsie/components/Accordion/Accordion';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,6CAA6C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from '@adobe/elsie/components/Accordion/Accordion';
2
+ export { Accordion as default } from '@adobe/elsie/components/Accordion/Accordion';
@@ -0,0 +1,11 @@
1
+ import { ComponentChildren, FunctionComponent, VNode } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+ import '@adobe/elsie/components/ActionButton/ActionButton.css';
4
+ export interface ActionButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'icon'> {
5
+ children?: ComponentChildren;
6
+ icon?: VNode<HTMLAttributes<SVGSVGElement>>;
7
+ active?: boolean;
8
+ disabled?: boolean;
9
+ }
10
+ export declare const ActionButton: FunctionComponent<ActionButtonProps>;
11
+ //# sourceMappingURL=ActionButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,uDAAuD,CAAC;AAE/D,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACvD,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CA8B7D,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { VComponent, classes } from '@adobe/elsie/lib';
2
+ import '@adobe/elsie/components/ActionButton/ActionButton.css';
3
+ export const ActionButton = ({ icon, className, children, active = false, disabled = false, ...props }) => {
4
+ return (<button role="button" disabled={disabled} {...props} className={classes([
5
+ 'dropin-action-button',
6
+ ['dropin-action-button--active', active],
7
+ ['dropin-action-button--disabled', disabled],
8
+ className,
9
+ ])}>
10
+ {icon && (<VComponent node={icon} className={classes(['dropin-action-button-icon'])}/>)}
11
+ {children &&
12
+ (typeof children === 'string' ? <span>{children}</span> : children)}
13
+ </button>);
14
+ };
@@ -0,0 +1,16 @@
1
+ import type { Meta, StoryObj } from '@storybook/preact';
2
+ import { ActionButtonProps } from '@adobe/elsie/components/ActionButton';
3
+ /**
4
+ * Use Action Buttons to let users complete actions or select items in a workflow.
5
+ */
6
+ declare const meta: Meta<ActionButtonProps>;
7
+ export default meta;
8
+ type Story = StoryObj<ActionButtonProps>;
9
+ export declare const Default: Story;
10
+ export declare const IconOnly: Story;
11
+ export declare const WithIcon: Story;
12
+ export declare const Disabled: Story;
13
+ export declare const Active: Story;
14
+ export declare const DisabledIcon: Story;
15
+ export declare const ActiveIcon: Story;
16
+ //# sourceMappingURL=ActionButton.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionButton.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAO9C;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAYjC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,KAcrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KA4BtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KA2BtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAiBtB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAiB1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC"}