@papillonarts/components 0.10.0 → 0.12.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 (368) hide show
  1. package/build/index.d.ts +2 -0
  2. package/build/index.d.ts.map +1 -0
  3. package/build/index.js +12 -0
  4. package/build/primer/Alert/Alert.d.ts +3 -0
  5. package/build/primer/Alert/Alert.d.ts.map +1 -0
  6. package/build/primer/Alert/Alert.js +122 -0
  7. package/build/primer/Alert/Alert.prop.d.ts +35 -0
  8. package/build/primer/Alert/Alert.prop.d.ts.map +1 -0
  9. package/build/primer/Alert/Alert.prop.js +19 -0
  10. package/build/primer/Alert/index.d.ts +3 -0
  11. package/build/primer/Alert/index.d.ts.map +1 -0
  12. package/build/primer/Alert/index.js +19 -0
  13. package/build/primer/Blankslate/Blankslate.d.ts +3 -0
  14. package/build/primer/Blankslate/Blankslate.d.ts.map +1 -0
  15. package/build/primer/Blankslate/Blankslate.js +30 -0
  16. package/build/primer/Blankslate/Blankslate.prop.d.ts +20 -0
  17. package/build/primer/Blankslate/Blankslate.prop.d.ts.map +1 -0
  18. package/build/primer/Blankslate/Blankslate.prop.js +18 -0
  19. package/build/primer/Blankslate/index.d.ts +3 -0
  20. package/build/primer/Blankslate/index.d.ts.map +1 -0
  21. package/build/primer/Blankslate/index.js +19 -0
  22. package/build/primer/Breadcrumb/Breadcrumb.d.ts +3 -0
  23. package/build/primer/Breadcrumb/Breadcrumb.d.ts.map +1 -0
  24. package/build/primer/Breadcrumb/Breadcrumb.js +75 -0
  25. package/build/primer/Breadcrumb/Breadcrumb.prop.d.ts +25 -0
  26. package/build/primer/Breadcrumb/Breadcrumb.prop.d.ts.map +1 -0
  27. package/build/primer/Breadcrumb/Breadcrumb.prop.js +14 -0
  28. package/build/primer/Breadcrumb/index.d.ts +3 -0
  29. package/build/primer/Breadcrumb/index.d.ts.map +1 -0
  30. package/build/primer/Breadcrumb/index.js +19 -0
  31. package/build/primer/Button/Button.d.ts +3 -0
  32. package/build/primer/Button/Button.d.ts.map +1 -0
  33. package/build/primer/Button/Button.js +108 -0
  34. package/build/primer/Button/Button.prop.d.ts +63 -0
  35. package/build/primer/Button/Button.prop.d.ts.map +1 -0
  36. package/build/primer/Button/Button.prop.js +48 -0
  37. package/build/primer/Button/index.d.ts +3 -0
  38. package/build/primer/Button/index.d.ts.map +1 -0
  39. package/build/primer/Button/index.js +49 -0
  40. package/build/primer/Dropdown/Dropdown.d.ts +3 -0
  41. package/build/primer/Dropdown/Dropdown.d.ts.map +1 -0
  42. package/build/primer/Dropdown/Dropdown.js +102 -0
  43. package/build/primer/Dropdown/Dropdown.prop.d.ts +30 -0
  44. package/build/primer/Dropdown/Dropdown.prop.d.ts.map +1 -0
  45. package/build/primer/Dropdown/Dropdown.prop.js +18 -0
  46. package/build/primer/Dropdown/index.d.ts +3 -0
  47. package/build/primer/Dropdown/index.d.ts.map +1 -0
  48. package/build/primer/Dropdown/index.js +19 -0
  49. package/build/primer/ErrorBoundary/ErrorBoundary.d.ts +11 -0
  50. package/build/primer/ErrorBoundary/ErrorBoundary.d.ts.map +1 -0
  51. package/build/primer/ErrorBoundary/ErrorBoundary.js +59 -0
  52. package/build/primer/ErrorBoundary/ErrorBoundary.prop.d.ts +5 -0
  53. package/build/primer/ErrorBoundary/ErrorBoundary.prop.d.ts.map +1 -0
  54. package/build/primer/ErrorBoundary/ErrorBoundary.prop.js +7 -0
  55. package/build/primer/ErrorBoundary/index.d.ts +2 -0
  56. package/build/primer/ErrorBoundary/index.d.ts.map +1 -0
  57. package/build/primer/ErrorBoundary/index.js +12 -0
  58. package/build/primer/Form/Checkbox/Checkbox.d.ts +3 -0
  59. package/build/primer/Form/Checkbox/Checkbox.d.ts.map +1 -0
  60. package/build/primer/Form/Checkbox/Checkbox.js +48 -0
  61. package/build/primer/Form/Checkbox/Checkbox.prop.d.ts +31 -0
  62. package/build/primer/Form/Checkbox/Checkbox.prop.d.ts.map +1 -0
  63. package/build/primer/Form/Checkbox/Checkbox.prop.js +22 -0
  64. package/build/primer/Form/Checkbox/index.d.ts +3 -0
  65. package/build/primer/Form/Checkbox/index.d.ts.map +1 -0
  66. package/build/primer/Form/Checkbox/index.js +19 -0
  67. package/build/primer/Form/Input/Input.d.ts +3 -0
  68. package/build/primer/Form/Input/Input.d.ts.map +1 -0
  69. package/build/primer/Form/Input/Input.js +55 -0
  70. package/build/primer/Form/Input/Input.prop.d.ts +40 -0
  71. package/build/primer/Form/Input/Input.prop.d.ts.map +1 -0
  72. package/build/primer/Form/Input/Input.prop.js +27 -0
  73. package/build/primer/Form/Input/index.d.ts +3 -0
  74. package/build/primer/Form/Input/index.d.ts.map +1 -0
  75. package/build/primer/Form/Input/index.js +25 -0
  76. package/build/primer/Form/Radio/Radio.d.ts +3 -0
  77. package/build/primer/Form/Radio/Radio.d.ts.map +1 -0
  78. package/build/primer/Form/Radio/Radio.js +47 -0
  79. package/build/primer/Form/Radio/Radio.prop.d.ts +28 -0
  80. package/build/primer/Form/Radio/Radio.prop.d.ts.map +1 -0
  81. package/build/primer/Form/Radio/Radio.prop.js +22 -0
  82. package/build/primer/Form/Radio/index.d.ts +3 -0
  83. package/build/primer/Form/Radio/index.d.ts.map +1 -0
  84. package/build/primer/Form/Radio/index.js +19 -0
  85. package/build/primer/Form/index.d.ts +31 -0
  86. package/build/primer/Form/index.d.ts.map +1 -0
  87. package/build/primer/Form/index.js +24 -0
  88. package/build/primer/Grid/DisplayTable/DisplayTable.d.ts +3 -0
  89. package/build/primer/Grid/DisplayTable/DisplayTable.d.ts.map +1 -0
  90. package/build/primer/Grid/DisplayTable/DisplayTable.js +57 -0
  91. package/build/primer/Grid/DisplayTable/DisplayTable.prop.d.ts +19 -0
  92. package/build/primer/Grid/DisplayTable/DisplayTable.prop.d.ts.map +1 -0
  93. package/build/primer/Grid/DisplayTable/DisplayTable.prop.js +11 -0
  94. package/build/primer/Grid/DisplayTable/index.d.ts +2 -0
  95. package/build/primer/Grid/DisplayTable/index.d.ts.map +1 -0
  96. package/build/primer/Grid/DisplayTable/index.js +12 -0
  97. package/build/primer/Grid/FlexGrid/FlexGrid.d.ts +3 -0
  98. package/build/primer/Grid/FlexGrid/FlexGrid.d.ts.map +1 -0
  99. package/build/primer/Grid/FlexGrid/FlexGrid.js +249 -0
  100. package/build/primer/Grid/FlexGrid/FlexGrid.prop.d.ts +53 -0
  101. package/build/primer/Grid/FlexGrid/FlexGrid.prop.d.ts.map +1 -0
  102. package/build/primer/Grid/FlexGrid/FlexGrid.prop.js +28 -0
  103. package/build/primer/Grid/FlexGrid/index.d.ts +3 -0
  104. package/build/primer/Grid/FlexGrid/index.d.ts.map +1 -0
  105. package/build/primer/Grid/FlexGrid/index.js +25 -0
  106. package/build/primer/Grid/index.d.ts +15 -0
  107. package/build/primer/Grid/index.d.ts.map +1 -0
  108. package/build/primer/Grid/index.js +14 -0
  109. package/build/primer/Icon/Icon.d.ts +3 -0
  110. package/build/primer/Icon/Icon.d.ts.map +1 -0
  111. package/build/primer/Icon/Icon.js +70 -0
  112. package/build/primer/Icon/Icon.part.d.ts +646 -0
  113. package/build/primer/Icon/Icon.part.d.ts.map +1 -0
  114. package/build/primer/Icon/Icon.part.js +1295 -0
  115. package/build/primer/Icon/Icon.prop.d.ts +684 -0
  116. package/build/primer/Icon/Icon.prop.d.ts.map +1 -0
  117. package/build/primer/Icon/Icon.prop.js +678 -0
  118. package/build/primer/Icon/index.d.ts +3 -0
  119. package/build/primer/Icon/index.d.ts.map +1 -0
  120. package/build/primer/Icon/index.js +25 -0
  121. package/build/primer/Label/Label.d.ts +3 -0
  122. package/build/primer/Label/Label.d.ts.map +1 -0
  123. package/build/primer/Label/Label.js +30 -0
  124. package/build/primer/Label/Label.prop.d.ts +28 -0
  125. package/build/primer/Label/Label.prop.d.ts.map +1 -0
  126. package/build/primer/Label/Label.prop.js +26 -0
  127. package/build/primer/Label/index.d.ts +2 -0
  128. package/build/primer/Label/index.d.ts.map +1 -0
  129. package/build/primer/Label/index.js +12 -0
  130. package/build/primer/Loader/Loader.d.ts +3 -0
  131. package/build/primer/Loader/Loader.d.ts.map +1 -0
  132. package/build/primer/Loader/Loader.js +64 -0
  133. package/build/primer/Loader/Loader.prop.d.ts +15 -0
  134. package/build/primer/Loader/Loader.prop.d.ts.map +1 -0
  135. package/build/primer/Loader/Loader.prop.js +15 -0
  136. package/build/primer/Loader/index.d.ts +3 -0
  137. package/build/primer/Loader/index.d.ts.map +1 -0
  138. package/build/primer/Loader/index.js +19 -0
  139. package/build/primer/Navigation/Menu/Menu.d.ts +3 -0
  140. package/build/primer/Navigation/Menu/Menu.d.ts.map +1 -0
  141. package/build/primer/Navigation/Menu/Menu.js +69 -0
  142. package/build/primer/Navigation/Menu/Menu.prop.d.ts +24 -0
  143. package/build/primer/Navigation/Menu/Menu.prop.d.ts.map +1 -0
  144. package/build/primer/Navigation/Menu/Menu.prop.js +10 -0
  145. package/build/primer/Navigation/Menu/index.d.ts +2 -0
  146. package/build/primer/Navigation/Menu/index.d.ts.map +1 -0
  147. package/build/primer/Navigation/Menu/index.js +12 -0
  148. package/build/primer/Navigation/TabNav/TabNav.d.ts +3 -0
  149. package/build/primer/Navigation/TabNav/TabNav.d.ts.map +1 -0
  150. package/build/primer/Navigation/TabNav/TabNav.js +124 -0
  151. package/build/primer/Navigation/TabNav/TabNav.prop.d.ts +35 -0
  152. package/build/primer/Navigation/TabNav/TabNav.prop.d.ts.map +1 -0
  153. package/build/primer/Navigation/TabNav/TabNav.prop.js +16 -0
  154. package/build/primer/Navigation/TabNav/index.d.ts +3 -0
  155. package/build/primer/Navigation/TabNav/index.d.ts.map +1 -0
  156. package/build/primer/Navigation/TabNav/index.js +19 -0
  157. package/build/primer/Navigation/UnderlineNav/UnderlineNav.d.ts +3 -0
  158. package/build/primer/Navigation/UnderlineNav/UnderlineNav.d.ts.map +1 -0
  159. package/build/primer/Navigation/UnderlineNav/UnderlineNav.js +122 -0
  160. package/build/primer/Navigation/UnderlineNav/UnderlineNav.prop.d.ts +37 -0
  161. package/build/primer/Navigation/UnderlineNav/UnderlineNav.prop.d.ts.map +1 -0
  162. package/build/primer/Navigation/UnderlineNav/UnderlineNav.prop.js +20 -0
  163. package/build/primer/Navigation/UnderlineNav/index.d.ts +3 -0
  164. package/build/primer/Navigation/UnderlineNav/index.d.ts.map +1 -0
  165. package/build/primer/Navigation/UnderlineNav/index.js +25 -0
  166. package/build/primer/Navigation/index.d.ts +21 -0
  167. package/build/primer/Navigation/index.d.ts.map +1 -0
  168. package/build/primer/Navigation/index.js +17 -0
  169. package/build/primer/Pagination/PreviousNext/PreviousNext.d.ts +3 -0
  170. package/build/primer/Pagination/PreviousNext/PreviousNext.d.ts.map +1 -0
  171. package/build/primer/Pagination/PreviousNext/PreviousNext.js +84 -0
  172. package/build/primer/Pagination/PreviousNext/PreviousNext.prop.d.ts +49 -0
  173. package/build/primer/Pagination/PreviousNext/PreviousNext.prop.d.ts.map +1 -0
  174. package/build/primer/Pagination/PreviousNext/PreviousNext.prop.js +30 -0
  175. package/build/primer/Pagination/PreviousNext/index.d.ts +3 -0
  176. package/build/primer/Pagination/PreviousNext/index.d.ts.map +1 -0
  177. package/build/primer/Pagination/PreviousNext/index.js +19 -0
  178. package/build/primer/Pagination/index.d.ts +9 -0
  179. package/build/primer/Pagination/index.d.ts.map +1 -0
  180. package/build/primer/Pagination/index.js +11 -0
  181. package/build/primer/Popover/Popover.d.ts +3 -0
  182. package/build/primer/Popover/Popover.d.ts.map +1 -0
  183. package/build/primer/Popover/Popover.js +63 -0
  184. package/build/primer/Popover/Popover.prop.d.ts +35 -0
  185. package/build/primer/Popover/Popover.prop.d.ts.map +1 -0
  186. package/build/primer/Popover/Popover.prop.js +29 -0
  187. package/build/primer/Popover/index.d.ts +3 -0
  188. package/build/primer/Popover/index.d.ts.map +1 -0
  189. package/build/primer/Popover/index.js +25 -0
  190. package/build/primer/Progress/Progress.d.ts +3 -0
  191. package/build/primer/Progress/Progress.d.ts.map +1 -0
  192. package/build/primer/Progress/Progress.js +30 -0
  193. package/build/primer/Progress/Progress.prop.d.ts +15 -0
  194. package/build/primer/Progress/Progress.prop.d.ts.map +1 -0
  195. package/build/primer/Progress/Progress.prop.js +15 -0
  196. package/build/primer/Progress/index.d.ts +3 -0
  197. package/build/primer/Progress/index.d.ts.map +1 -0
  198. package/build/primer/Progress/index.js +19 -0
  199. package/build/primer/Select/Select.d.ts +3 -0
  200. package/build/primer/Select/Select.d.ts.map +1 -0
  201. package/build/primer/Select/Select.js +67 -0
  202. package/build/primer/Select/Select.prop.d.ts +22 -0
  203. package/build/primer/Select/Select.prop.d.ts.map +1 -0
  204. package/build/primer/Select/Select.prop.js +15 -0
  205. package/build/primer/Select/index.d.ts +3 -0
  206. package/build/primer/Select/index.d.ts.map +1 -0
  207. package/build/primer/Select/index.js +19 -0
  208. package/build/primer/SelectMenu/SelectMenu.d.ts +3 -0
  209. package/build/primer/SelectMenu/SelectMenu.d.ts.map +1 -0
  210. package/build/primer/SelectMenu/SelectMenu.js +94 -0
  211. package/build/primer/SelectMenu/SelectMenu.prop.d.ts +22 -0
  212. package/build/primer/SelectMenu/SelectMenu.prop.d.ts.map +1 -0
  213. package/build/primer/SelectMenu/SelectMenu.prop.js +10 -0
  214. package/build/primer/SelectMenu/index.d.ts +2 -0
  215. package/build/primer/SelectMenu/index.d.ts.map +1 -0
  216. package/build/primer/SelectMenu/index.js +12 -0
  217. package/build/primer/Subhead/Subhead.d.ts +3 -0
  218. package/build/primer/Subhead/Subhead.d.ts.map +1 -0
  219. package/build/primer/Subhead/Subhead.js +26 -0
  220. package/build/primer/Subhead/Subhead.prop.d.ts +10 -0
  221. package/build/primer/Subhead/Subhead.prop.d.ts.map +1 -0
  222. package/build/primer/Subhead/Subhead.prop.js +10 -0
  223. package/build/primer/Subhead/index.d.ts +2 -0
  224. package/build/primer/Subhead/index.d.ts.map +1 -0
  225. package/build/primer/Subhead/index.js +12 -0
  226. package/build/primer/Toast/Toast.d.ts +3 -0
  227. package/build/primer/Toast/Toast.d.ts.map +1 -0
  228. package/build/primer/Toast/Toast.js +54 -0
  229. package/build/primer/Toast/Toast.prop.d.ts +20 -0
  230. package/build/primer/Toast/Toast.prop.d.ts.map +1 -0
  231. package/build/primer/Toast/Toast.prop.js +18 -0
  232. package/build/primer/Toast/index.d.ts +3 -0
  233. package/build/primer/Toast/index.d.ts.map +1 -0
  234. package/build/primer/Toast/index.js +19 -0
  235. package/build/primer/Typing/index.d.js +1 -0
  236. package/build/primer/index.d.ts +860 -0
  237. package/build/primer/index.d.ts.map +1 -0
  238. package/build/primer/index.js +87 -0
  239. package/package.json +8 -6
  240. package/build/index.ts +0 -1
  241. package/build/primer/Alert/Alert.prop.ts +0 -45
  242. package/build/primer/Alert/Alert.tsx +0 -101
  243. package/build/primer/Alert/__tests__/Alert.int.story.tsx +0 -86
  244. package/build/primer/Alert/__tests__/Alert.int.test.ts +0 -37
  245. package/build/primer/Alert/index.ts +0 -2
  246. package/build/primer/Blankslate/Blankslate.prop.ts +0 -26
  247. package/build/primer/Blankslate/Blankslate.tsx +0 -26
  248. package/build/primer/Blankslate/__tests__/Blankslate.int.story.tsx +0 -43
  249. package/build/primer/Blankslate/__tests__/Blankslate.int.test.ts +0 -29
  250. package/build/primer/Blankslate/index.ts +0 -2
  251. package/build/primer/Breadcrumb/Breadcrumb.prop.ts +0 -28
  252. package/build/primer/Breadcrumb/Breadcrumb.tsx +0 -57
  253. package/build/primer/Breadcrumb/__tests__/Breadcrumb.int.story.tsx +0 -40
  254. package/build/primer/Breadcrumb/__tests__/Breadcrumb.int.test.ts +0 -40
  255. package/build/primer/Breadcrumb/index.ts +0 -2
  256. package/build/primer/Button/Button.prop.ts +0 -77
  257. package/build/primer/Button/Button.tsx +0 -91
  258. package/build/primer/Button/__tests__/Button.int.story.tsx +0 -173
  259. package/build/primer/Button/__tests__/Button.int.test.ts +0 -191
  260. package/build/primer/Button/index.ts +0 -2
  261. package/build/primer/Dropdown/Dropdown.prop.ts +0 -33
  262. package/build/primer/Dropdown/Dropdown.tsx +0 -102
  263. package/build/primer/Dropdown/__tests__/Dropdown.int.story.tsx +0 -43
  264. package/build/primer/Dropdown/__tests__/Dropdown.int.test.ts +0 -53
  265. package/build/primer/Dropdown/index.ts +0 -2
  266. package/build/primer/ErrorBoundary/ErrorBoundary.prop.ts +0 -5
  267. package/build/primer/ErrorBoundary/ErrorBoundary.tsx +0 -35
  268. package/build/primer/ErrorBoundary/__tests__/ErrorBoundary.int.story.tsx +0 -23
  269. package/build/primer/ErrorBoundary/__tests__/ErrorBoundary.int.test.ts +0 -9
  270. package/build/primer/ErrorBoundary/index.ts +0 -1
  271. package/build/primer/Form/Checkbox/Checkbox.prop.ts +0 -34
  272. package/build/primer/Form/Checkbox/Checkbox.tsx +0 -40
  273. package/build/primer/Form/Checkbox/__tests__/Checkbox.int.story.tsx +0 -50
  274. package/build/primer/Form/Checkbox/__tests__/Checkbox.int.test.ts +0 -23
  275. package/build/primer/Form/Checkbox/index.ts +0 -2
  276. package/build/primer/Form/Input/Input.prop.ts +0 -43
  277. package/build/primer/Form/Input/Input.tsx +0 -43
  278. package/build/primer/Form/Input/__tests__/Input.int.story.tsx +0 -54
  279. package/build/primer/Form/Input/__tests__/Input.int.test.ts +0 -15
  280. package/build/primer/Form/Input/index.ts +0 -2
  281. package/build/primer/Form/Radio/Radio.prop.ts +0 -30
  282. package/build/primer/Form/Radio/Radio.tsx +0 -38
  283. package/build/primer/Form/Radio/__tests__/Radio.int.story.tsx +0 -42
  284. package/build/primer/Form/Radio/__tests__/Radio.int.test.ts +0 -13
  285. package/build/primer/Form/Radio/index.ts +0 -2
  286. package/build/primer/Form/index.ts +0 -19
  287. package/build/primer/Grid/DisplayTable/DisplayTable.prop.ts +0 -21
  288. package/build/primer/Grid/DisplayTable/DisplayTable.tsx +0 -68
  289. package/build/primer/Grid/DisplayTable/__tests__/DisplayTable.int.data.ts +0 -289
  290. package/build/primer/Grid/DisplayTable/__tests__/DisplayTable.int.story.tsx +0 -27
  291. package/build/primer/Grid/DisplayTable/__tests__/DisplayTable.int.test.ts +0 -9
  292. package/build/primer/Grid/DisplayTable/index.ts +0 -1
  293. package/build/primer/Grid/FlexGrid/FlexGrid.prop.ts +0 -59
  294. package/build/primer/Grid/FlexGrid/FlexGrid.tsx +0 -274
  295. package/build/primer/Grid/FlexGrid/__tests__/FlexGrid.int.data.ts +0 -289
  296. package/build/primer/Grid/FlexGrid/__tests__/FlexGrid.int.story.tsx +0 -146
  297. package/build/primer/Grid/FlexGrid/__tests__/FlexGrid.int.test.ts +0 -46
  298. package/build/primer/Grid/FlexGrid/index.ts +0 -2
  299. package/build/primer/Grid/index.ts +0 -9
  300. package/build/primer/Icon/Icon.part.ts +0 -1289
  301. package/build/primer/Icon/Icon.prop.ts +0 -1337
  302. package/build/primer/Icon/Icon.tsx +0 -49
  303. package/build/primer/Icon/__tests__/Icon.int.story.tsx +0 -58
  304. package/build/primer/Icon/__tests__/Icon.int.test.ts +0 -13
  305. package/build/primer/Icon/index.ts +0 -2
  306. package/build/primer/Label/Label.prop.ts +0 -31
  307. package/build/primer/Label/Label.tsx +0 -27
  308. package/build/primer/Label/__tests__/Label.int.story.tsx +0 -19
  309. package/build/primer/Label/__tests__/Label.int.test.ts +0 -9
  310. package/build/primer/Label/index.ts +0 -1
  311. package/build/primer/Loader/Loader.prop.ts +0 -16
  312. package/build/primer/Loader/Loader.tsx +0 -43
  313. package/build/primer/Loader/__tests__/Loader.int.story.tsx +0 -34
  314. package/build/primer/Loader/__tests__/Loader.int.test.ts +0 -21
  315. package/build/primer/Loader/index.ts +0 -2
  316. package/build/primer/Navigation/Menu/Menu.prop.ts +0 -26
  317. package/build/primer/Navigation/Menu/Menu.tsx +0 -42
  318. package/build/primer/Navigation/Menu/__tests__/Menu.int.story.tsx +0 -55
  319. package/build/primer/Navigation/Menu/__tests__/Menu.int.test.ts +0 -57
  320. package/build/primer/Navigation/Menu/index.ts +0 -1
  321. package/build/primer/Navigation/TabNav/TabNav.prop.ts +0 -39
  322. package/build/primer/Navigation/TabNav/TabNav.tsx +0 -105
  323. package/build/primer/Navigation/TabNav/__tests__/TabNav.int.story.tsx +0 -168
  324. package/build/primer/Navigation/TabNav/__tests__/TabNav.int.test.ts +0 -55
  325. package/build/primer/Navigation/TabNav/index.ts +0 -2
  326. package/build/primer/Navigation/UnderlineNav/UnderlineNav.prop.ts +0 -41
  327. package/build/primer/Navigation/UnderlineNav/UnderlineNav.tsx +0 -106
  328. package/build/primer/Navigation/UnderlineNav/__tests__/UnderlineNav.int.story.tsx +0 -140
  329. package/build/primer/Navigation/UnderlineNav/__tests__/UnderlineNav.int.test.ts +0 -81
  330. package/build/primer/Navigation/UnderlineNav/index.ts +0 -2
  331. package/build/primer/Navigation/index.ts +0 -12
  332. package/build/primer/Pagination/PreviousNext/PreviousNext.prop.ts +0 -53
  333. package/build/primer/Pagination/PreviousNext/PreviousNext.tsx +0 -71
  334. package/build/primer/Pagination/PreviousNext/__tests__/PreviousNext.int.story.tsx +0 -48
  335. package/build/primer/Pagination/PreviousNext/__tests__/PreviousNext.int.test.ts +0 -15
  336. package/build/primer/Pagination/PreviousNext/index.ts +0 -2
  337. package/build/primer/Pagination/index.ts +0 -6
  338. package/build/primer/Popover/Popover.prop.ts +0 -49
  339. package/build/primer/Popover/Popover.tsx +0 -80
  340. package/build/primer/Popover/__tests__/Popover.int.story.tsx +0 -216
  341. package/build/primer/Popover/__tests__/Popover.int.test.ts +0 -71
  342. package/build/primer/Popover/index.ts +0 -2
  343. package/build/primer/Progress/Progress.prop.ts +0 -16
  344. package/build/primer/Progress/Progress.tsx +0 -19
  345. package/build/primer/Progress/__tests__/Progress.int.story.tsx +0 -28
  346. package/build/primer/Progress/__tests__/Progress.int.test.ts +0 -17
  347. package/build/primer/Progress/index.ts +0 -2
  348. package/build/primer/Select/Select.prop.ts +0 -24
  349. package/build/primer/Select/Select.tsx +0 -58
  350. package/build/primer/Select/__tests__/Select.int.story.tsx +0 -38
  351. package/build/primer/Select/__tests__/Select.int.test.ts +0 -42
  352. package/build/primer/Select/index.ts +0 -2
  353. package/build/primer/SelectMenu/SelectMenu.prop.ts +0 -25
  354. package/build/primer/SelectMenu/SelectMenu.tsx +0 -68
  355. package/build/primer/SelectMenu/__tests__/SelectMenu.int.story.tsx +0 -50
  356. package/build/primer/SelectMenu/__tests__/SelectMenu.int.test.ts +0 -56
  357. package/build/primer/SelectMenu/index.ts +0 -1
  358. package/build/primer/Subhead/Subhead.prop.ts +0 -10
  359. package/build/primer/Subhead/Subhead.tsx +0 -15
  360. package/build/primer/Subhead/__tests__/Subhead.int.story.tsx +0 -23
  361. package/build/primer/Subhead/__tests__/Subhead.int.test.ts +0 -13
  362. package/build/primer/Subhead/index.ts +0 -1
  363. package/build/primer/Toast/Toast.prop.ts +0 -21
  364. package/build/primer/Toast/Toast.tsx +0 -38
  365. package/build/primer/Toast/__tests__/Toast.int.story.tsx +0 -50
  366. package/build/primer/Toast/__tests__/Toast.int.test.ts +0 -25
  367. package/build/primer/Toast/index.ts +0 -2
  368. package/build/primer/index.ts +0 -83
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAgB,MAAM,SAAS,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAqB,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAyF,MAAM,UAAU,CAAA;AACxH,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,OAAO,EAAE,IAAI,EAAsB,MAAM,QAAQ,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAiB,MAAM,UAAU,CAAA;AAGhD,OAAO,EAAE,OAAO,EAA+B,MAAM,WAAW,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAmB,MAAM,YAAY,CAAA;AACtD,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,KAAK,EAAgB,MAAM,SAAS,CAAA;AAE7C,OAAO,2CAA2C,CAAA;AAElD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DlB,CAAA"}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.primer = void 0;
7
+ var _Alert = require("./Alert");
8
+ var _Breadcrumb = require("./Breadcrumb");
9
+ var _Blankslate = require("./Blankslate");
10
+ var _Button = require("./Button");
11
+ var _Dropdown = require("./Dropdown");
12
+ var _ErrorBoundary = require("./ErrorBoundary");
13
+ var _Form = require("./Form");
14
+ var _Grid = require("./Grid");
15
+ var _Icon = require("./Icon");
16
+ var _Label = require("./Label");
17
+ var _Loader = require("./Loader");
18
+ var _Navigation = require("./Navigation");
19
+ var _Pagination = require("./Pagination");
20
+ var _Popover = require("./Popover");
21
+ var _Progress = require("./Progress");
22
+ var _Select = require("./Select");
23
+ var _SelectMenu = require("./SelectMenu");
24
+ var _Subhead = require("./Subhead");
25
+ var _Toast = require("./Toast");
26
+ require("@papillonarts/css/build/primer/index.scss");
27
+ var primer = exports.primer = {
28
+ Alert: {
29
+ Alert: _Alert.Alert,
30
+ alertVariant: _Alert.alertVariant
31
+ },
32
+ Breadcrumb: {
33
+ Breadcrumb: _Breadcrumb.Breadcrumb,
34
+ breadcrumbState: _Breadcrumb.breadcrumbState
35
+ },
36
+ Blankslate: {
37
+ Blankslate: _Blankslate.Blankslate,
38
+ blankslateVariant: _Blankslate.blankslateVariant
39
+ },
40
+ Button: {
41
+ Button: _Button.Button,
42
+ buttonElement: _Button.buttonElement,
43
+ buttonVariant: _Button.buttonVariant,
44
+ buttonSize: _Button.buttonSize,
45
+ buttonState: _Button.buttonState,
46
+ iconAlignment: _Button.iconAlignment,
47
+ buttonInputType: _Button.buttonInputType
48
+ },
49
+ Dropdown: {
50
+ Dropdown: _Dropdown.Dropdown,
51
+ dropdownState: _Dropdown.dropdownState
52
+ },
53
+ ErrorBoundary: _ErrorBoundary.ErrorBoundary,
54
+ Form: _Form.Form,
55
+ Grid: _Grid.Grid,
56
+ Icon: {
57
+ Icon: _Icon.Icon,
58
+ iconName: _Icon.iconName,
59
+ iconSize: _Icon.iconSize
60
+ },
61
+ Label: _Label.Label,
62
+ Loader: {
63
+ Loader: _Loader.Loader,
64
+ loaderVariant: _Loader.loaderVariant
65
+ },
66
+ Navigation: _Navigation.Navigation,
67
+ Pagination: _Pagination.Pagination,
68
+ Popover: {
69
+ Popover: _Popover.Popover,
70
+ popoverVariant: _Popover.popoverVariant,
71
+ popoverSize: _Popover.popoverSize
72
+ },
73
+ Progress: {
74
+ Progress: _Progress.Progress,
75
+ progressVariant: _Progress.progressVariant
76
+ },
77
+ Select: {
78
+ Select: _Select.Select,
79
+ selectState: _Select.selectState
80
+ },
81
+ SelectMenu: _SelectMenu.SelectMenu,
82
+ Subhead: _Subhead.Subhead,
83
+ Toast: {
84
+ Toast: _Toast.Toast,
85
+ toastVariant: _Toast.toastVariant
86
+ }
87
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@papillonarts/components",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "Papillon Arts Components",
5
5
  "homepage": "https://github.com/papillonarts/papillonarts/tree/master/packages/components",
6
6
  "repository": {
@@ -21,16 +21,18 @@
21
21
  "remove-test-folders": "rm -rf src/**/**/__tests__ && rm -rf src/**/**/**/__tests__ && rm -rf src/primer/Concept",
22
22
  "remove-snapshot-folders": "rm -rf src/**/**/__tests__/__snapshots__",
23
23
  "remove-build-folder": "rm -rf build",
24
- "transpile": "babel --copy-files --no-copy-ignored --out-dir build src --ignore **/__tests__",
24
+ "transpile": "babel --copy-files --no-copy-ignored --extensions '.js,.jsx,.ts,.tsx' --out-dir build src --ignore **/__tests__",
25
25
  "remove-markdown-files": "find build -maxdepth 3 -type f -name \"*.md\" -delete",
26
- "build": "npm-run-all remove-snapshot-folders remove-build-folder transpile remove-markdown-files",
26
+ "generate-typing": "tsc",
27
+ "generate-commonjs": "npm-run-all remove-snapshot-folders remove-build-folder transpile remove-markdown-files",
28
+ "build": "npm-run-all generate-commonjs generate-typing",
27
29
  "build-test": "npm run build",
28
30
  "build-acceptance": "npm run build",
29
31
  "build-release": "npm run build"
30
32
  },
31
33
  "dependencies": {
32
- "@papillonarts/css": "^0.10.0",
33
- "@papillonarts/library": "^0.10.0"
34
+ "@papillonarts/css": "^0.12.0",
35
+ "@papillonarts/library": "^0.12.0"
34
36
  },
35
- "gitHead": "bd716a6232e363ba61f8c1367faefbb20d4b503f"
37
+ "gitHead": "a3d3650b3ada16291938971ccb30fa08dfb71b33"
36
38
  }
package/build/index.ts DELETED
@@ -1 +0,0 @@
1
- export { primer } from './primer'
@@ -1,45 +0,0 @@
1
- export const alertVariant = {
2
- default: 'default',
3
- info: 'info',
4
- warning: 'warning',
5
- error: 'error',
6
- success: 'success',
7
- consent: 'consent',
8
- }
9
-
10
- export const defaultProps = {
11
- dataTest: null,
12
- className: null,
13
- variant: alertVariant.default,
14
- }
15
-
16
- export interface ActionType {
17
- approve?: (value?: string) => void
18
- cancel?: (value?: string) => void
19
- }
20
-
21
- export interface ConsentType {
22
- action?: ActionType
23
- withInput?: boolean
24
- }
25
-
26
- export interface DataTestType {
27
- default?: string
28
- approve?: string
29
- cancel?: string
30
- value?: string
31
- }
32
-
33
- export interface AlertProps {
34
- dataTest?: DataTestType
35
- className?: string
36
- variant?:
37
- | typeof alertVariant.default
38
- | typeof alertVariant.info
39
- | typeof alertVariant.warning
40
- | typeof alertVariant.error
41
- | typeof alertVariant.success
42
- | typeof alertVariant.consent
43
- children: React.ReactNode // https://react.dev/learn/typescript#typing-children
44
- consent: ConsentType
45
- }
@@ -1,101 +0,0 @@
1
- import { Fragment } from 'react'
2
- import { useState } from '@papillonarts/library/hooks'
3
- import utilityStyles from '@papillonarts/css/build/primer/utilities/margin.scss'
4
- import cx from 'classnames'
5
- import { AlertProps, defaultProps, alertVariant } from './Alert.prop'
6
- import styles from './Alert.scss'
7
- import buttonStyles from '../Button/Button.scss'
8
- import { Input } from '../Form/Input'
9
- import { Button, buttonVariant, buttonInputType, iconAlignment } from '../Button'
10
- import { iconName } from '../Icon/Icon.prop'
11
- import { Icon, iconSize } from '../Icon'
12
-
13
- export function Alert({
14
- dataTest = defaultProps.dataTest,
15
- className = defaultProps.className,
16
- variant = defaultProps.variant,
17
- children,
18
- consent,
19
- }: AlertProps) {
20
- const [consentValue, setConsentValue] = useState('')
21
-
22
- return (
23
- <div data-test={dataTest?.default} className={className}>
24
- <div className={cx(styles['flash-messages'])}>
25
- <div
26
- className={cx(styles.flash, {
27
- [styles['flash-warn']]: variant === alertVariant.warning,
28
- [styles['flash-error']]: variant === alertVariant.error,
29
- [styles['flash-success']]: variant === alertVariant.success,
30
- [styles['flash-consent']]: variant === alertVariant.consent,
31
- })}
32
- >
33
- {consent && (
34
- <Fragment>
35
- <Button
36
- dataTest={dataTest?.cancel}
37
- className={cx(buttonStyles.btn, buttonStyles['btn-sm'], buttonStyles.primary, styles['flash-action'])}
38
- text="Cancel"
39
- icon={{ name: iconName.XCircleFill16, alignment: iconAlignment.left }}
40
- variant={buttonVariant.default}
41
- inputType={buttonInputType.submit}
42
- onClick={() => {
43
- consent?.action?.cancel()
44
- setConsentValue('')
45
- }}
46
- />
47
- <Button
48
- dataTest={dataTest?.approve}
49
- className={cx(buttonStyles.btn, buttonStyles['btn-sm'], buttonStyles.primary, styles['flash-action'])}
50
- text="Approve"
51
- icon={{ name: iconName.CheckCircleFill16, alignment: iconAlignment.left }}
52
- variant={buttonVariant.primary}
53
- inputType={buttonInputType.submit}
54
- autoFocus={consent?.withInput ? false : true} // eslint-disable-line
55
- onClick={
56
- consent?.withInput
57
- ? () => {
58
- if (consentValue !== '') {
59
- consent?.action?.approve(consentValue)
60
- setConsentValue('')
61
- }
62
- }
63
- : consent?.action?.approve
64
- }
65
- />
66
- </Fragment>
67
- )}
68
- {variant === alertVariant.info && <Icon className={utilityStyles['mr-2']} icon={iconName.Info16} size={iconSize.small} />}
69
- {variant === alertVariant.warning && !consent && (
70
- <Icon className={utilityStyles['mr-2']} icon={iconName.Alert16} size={iconSize.small} />
71
- )}
72
- {variant === alertVariant.warning && consent && (
73
- <Icon className={utilityStyles['mr-2']} icon={iconName.Question16} size={iconSize.small} />
74
- )}
75
- {variant === alertVariant.error && <Icon className={utilityStyles['mr-2']} icon={iconName.XCircle16} size={iconSize.small} />}
76
- {variant === alertVariant.success && (
77
- <Icon className={utilityStyles['mr-2']} icon={iconName.CheckCircle16} size={iconSize.small} />
78
- )}
79
- {variant === alertVariant.consent && <Icon className={utilityStyles['mr-2']} icon={iconName.Question16} size={iconSize.small} />}
80
- {children}
81
- {consent?.withInput && (
82
- <Input
83
- dataTest={dataTest?.value}
84
- className={styles['flash-action']}
85
- value={consentValue}
86
- placeholder=""
87
- ariaAttr={{ label: '' }}
88
- onChange={(event) => {
89
- setConsentValue(event.target.value)
90
- }}
91
- onKeyUp={(event) => {
92
- setConsentValue(event.target.value)
93
- }}
94
- autoFocus={true} // eslint-disable-line
95
- />
96
- )}
97
- </div>
98
- </div>
99
- </div>
100
- )
101
- }
@@ -1,86 +0,0 @@
1
- // https://storybook.js.org/docs/configure/integration/typescript
2
-
3
- import { action } from 'storybook/actions'
4
- import { withTests } from '@storybook/addon-jest'
5
- import { alertVariant } from '../Alert.prop'
6
- import results from '../../../../../../.jest-test-results.json'
7
-
8
- const children = 'Flash message goes here.'
9
-
10
- const Alert =
11
- process.env.NODE_ENV === 'develop' || process.env.NODE_ENV === 'test'
12
- ? require('../../../index').primer.Alert.Alert
13
- : require('../../../../build').primer.Alert.Alert
14
-
15
- export default {
16
- title: 'Primer/Molecule/Alert',
17
- component: Alert,
18
- decorators: [withTests({ results })],
19
- parameters: { jest: ['Alert.int.test.js'] },
20
- excludeStories: ['custom'],
21
- }
22
-
23
- export function regular() {
24
- return <Alert variant={alertVariant.default}>{children}</Alert>
25
- }
26
-
27
- export function regularMultipleParagraphs() {
28
- return (
29
- <Alert variant={alertVariant.default}>
30
- <p>
31
- This is a longer flash message in it&apos;s own paragraph. It ends up looking something like this. If we keep adding more text,
32
- it&apos;ll eventually wrap to a new line.
33
- </p>
34
- <p>And this is another paragraph.</p>
35
- </Alert>
36
- )
37
- }
38
-
39
- export function info() {
40
- return <Alert variant={alertVariant.info}>{children}</Alert>
41
- }
42
-
43
- export function warning() {
44
- return <Alert variant={alertVariant.warning}>{children}</Alert>
45
- }
46
-
47
- export function error() {
48
- return <Alert variant={alertVariant.error}>{children}</Alert>
49
- }
50
-
51
- export function success() {
52
- return <Alert variant={alertVariant.success}>{children}</Alert>
53
- }
54
-
55
- export function consent() {
56
- return (
57
- <Alert
58
- variant={alertVariant.consent}
59
- consent={{
60
- action: {
61
- approve: action('Approved'),
62
- cancel: action('Cancelled'),
63
- },
64
- }}
65
- >
66
- {children}
67
- </Alert>
68
- )
69
- }
70
-
71
- export function consentWithInput() {
72
- return (
73
- <Alert
74
- variant={alertVariant.consent}
75
- consent={{
76
- action: {
77
- approve: action('Approved'),
78
- cancel: action('Cancelled'),
79
- },
80
- withInput: true,
81
- }}
82
- >
83
- {children}
84
- </Alert>
85
- )
86
- }
@@ -1,37 +0,0 @@
1
- import { regular, regularMultipleParagraphs, info, warning, error, success, consent, consentWithInput } from './Alert.int.story'
2
-
3
- describe('<Alert />', () => {
4
- describe('Render', () => {
5
- test('must match regular()', () => {
6
- expect(global.renderToJSON(regular())).toMatchSnapshot()
7
- })
8
-
9
- test('must match regularMultipleParagraphs()', () => {
10
- expect(global.renderToJSON(regularMultipleParagraphs())).toMatchSnapshot()
11
- })
12
-
13
- test('must match info()', () => {
14
- expect(global.renderToJSON(info())).toMatchSnapshot()
15
- })
16
-
17
- test('must match warning()', () => {
18
- expect(global.renderToJSON(warning())).toMatchSnapshot()
19
- })
20
-
21
- test('must match error()', () => {
22
- expect(global.renderToJSON(error())).toMatchSnapshot()
23
- })
24
-
25
- test('must match success()', () => {
26
- expect(global.renderToJSON(success())).toMatchSnapshot()
27
- })
28
-
29
- test('must match consent()', () => {
30
- expect(global.renderToJSON(consent())).toMatchSnapshot()
31
- })
32
-
33
- test('must match consentWithInput()', () => {
34
- expect(global.renderToJSON(consentWithInput())).toMatchSnapshot()
35
- })
36
- })
37
- })
@@ -1,2 +0,0 @@
1
- export { Alert } from './Alert'
2
- export { alertVariant } from './Alert.prop'
@@ -1,26 +0,0 @@
1
- export const blankslateVariant = {
2
- default: 'default',
3
- narrow: 'narrow',
4
- capped: 'capped',
5
- spacious: 'spacious',
6
- large: 'large',
7
- }
8
-
9
- export const defaultProps = {
10
- className: null,
11
- variant: blankslateVariant.default,
12
- hasCleanBackground: false,
13
- }
14
-
15
- export interface BlankslateProps {
16
- className?: string
17
- heading: string
18
- text: string
19
- variant?:
20
- | typeof blankslateVariant.default
21
- | typeof blankslateVariant.narrow
22
- | typeof blankslateVariant.capped
23
- | typeof blankslateVariant.spacious
24
- | typeof blankslateVariant.large
25
- hasCleanBackground?: boolean
26
- }
@@ -1,26 +0,0 @@
1
- import cx from 'classnames'
2
- import { BlankslateProps, defaultProps, blankslateVariant } from './Blankslate.prop'
3
- import styles from './Blankslate.scss'
4
-
5
- export function Blankslate({
6
- className = defaultProps.className,
7
- heading,
8
- text,
9
- variant = defaultProps.variant,
10
- hasCleanBackground = defaultProps.hasCleanBackground,
11
- }: BlankslateProps) {
12
- return (
13
- <div
14
- className={cx(className, styles.blankslate, {
15
- [styles['blankslate-narrow']]: variant === blankslateVariant.narrow,
16
- [styles['blankslate-capped']]: (variant === blankslateVariant.capped) === true,
17
- [styles['blankslate-spacious']]: variant === blankslateVariant.spacious,
18
- [styles['blankslate-large']]: variant === blankslateVariant.large,
19
- [styles['blankslate-clean-background']]: hasCleanBackground === true,
20
- })}
21
- >
22
- <h3>{heading}</h3>
23
- <p>{text}</p>
24
- </div>
25
- )
26
- }
@@ -1,43 +0,0 @@
1
- import { withTests } from '@storybook/addon-jest'
2
- import { blankslateVariant } from '../Blankslate.prop'
3
- import results from '../../../../../../.jest-test-results.json'
4
-
5
- const Blankslate =
6
- process.env.NODE_ENV === 'develop' || process.env.NODE_ENV === 'test'
7
- ? require('../../../index').primer.Blankslate.Blankslate
8
- : require('../../../../build').primer.Blankslate.Blankslate
9
-
10
- const heading = 'This is a blank slate'
11
- const text = 'Use it to provide information when no dynamic content exists.'
12
-
13
- export default {
14
- title: 'Primer/Atom/Blankslate',
15
- component: Blankslate,
16
- decorators: [withTests({ results })],
17
- parameters: { jest: ['Blankslate.int.test.js'] },
18
- excludeStories: ['custom'],
19
- }
20
-
21
- export function regular() {
22
- return <Blankslate variant={blankslateVariant.default} heading={heading} text={text} />
23
- }
24
-
25
- export function narrow() {
26
- return <Blankslate variant={blankslateVariant.narrow} heading={heading} text={text} />
27
- }
28
-
29
- export function capped() {
30
- return <Blankslate variant={blankslateVariant.capped} heading={heading} text={text} />
31
- }
32
-
33
- export function spacious() {
34
- return <Blankslate variant={blankslateVariant.spacious} heading={heading} text={text} />
35
- }
36
-
37
- export function large() {
38
- return <Blankslate variant={blankslateVariant.large} heading={heading} text={text} />
39
- }
40
-
41
- export function cleanBackground() {
42
- return <Blankslate hasCleanBackground={true} heading={heading} text={text} />
43
- }
@@ -1,29 +0,0 @@
1
- import { regular, narrow, capped, spacious, large, cleanBackground } from './Blankslate.int.story'
2
-
3
- describe('<Blankslate />', () => {
4
- describe('Render', () => {
5
- test('must match regular()', () => {
6
- expect(global.renderToJSON(regular())).toMatchSnapshot()
7
- })
8
-
9
- test('must match narrow()', () => {
10
- expect(global.renderToJSON(narrow())).toMatchSnapshot()
11
- })
12
-
13
- test('must match capped()', () => {
14
- expect(global.renderToJSON(capped())).toMatchSnapshot()
15
- })
16
-
17
- test('must match spacious()', () => {
18
- expect(global.renderToJSON(spacious())).toMatchSnapshot()
19
- })
20
-
21
- test('must match large()', () => {
22
- expect(global.renderToJSON(large())).toMatchSnapshot()
23
- })
24
-
25
- test('must match cleanBackground()', () => {
26
- expect(global.renderToJSON(cleanBackground())).toMatchSnapshot()
27
- })
28
- })
29
- })
@@ -1,2 +0,0 @@
1
- export { Blankslate } from './Blankslate'
2
- export { blankslateVariant } from './Blankslate.prop'
@@ -1,28 +0,0 @@
1
- export const breadcrumbState = {
2
- active: 'active',
3
- inactive: 'inactive',
4
- }
5
-
6
- export const defaultProps = {
7
- className: null,
8
- state: breadcrumbState.active,
9
- }
10
-
11
- export interface AriaAttrType {
12
- label: string
13
- current: boolean | false | true | 'page' | 'step' | 'location' | 'date' | 'time'
14
- }
15
-
16
- export interface ItemType {
17
- href: string
18
- text: string
19
- isSelected: boolean
20
- }
21
-
22
- export interface BreadcrumbProps {
23
- className?: string
24
- ariaAttr: AriaAttrType
25
- items: ItemType[]
26
- onClick: (value) => void
27
- state?: typeof breadcrumbState.active | typeof breadcrumbState.inactive
28
- }
@@ -1,57 +0,0 @@
1
- /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
2
- /* eslint-disable jsx-a11y/click-events-have-key-events */
3
- import cx from 'classnames'
4
- import { v1 as uuidv1 } from 'uuid'
5
- import utilityStyles from '@papillonarts/css/build/primer/utilities/typography.scss'
6
- import { getIndexItems, getIndexItemsWithSelected } from '@papillonarts/library/array'
7
- import { BreadcrumbProps, defaultProps, breadcrumbState } from './Breadcrumb.prop'
8
- import styles from './Breadcrumb.scss'
9
-
10
- export function Breadcrumb({ className = defaultProps.className, ariaAttr, items, onClick, state = defaultProps.state }: BreadcrumbProps) {
11
- const indexItems = getIndexItems(items)
12
- const { label, current } = ariaAttr
13
-
14
- return (
15
- <nav
16
- className={cx(className, {
17
- [styles['breadcrumb-inactive']]: state === breadcrumbState.inactive,
18
- })}
19
- aria-label={label}
20
- >
21
- <ol>
22
- {indexItems.map((indexItem) => {
23
- const { href, text, isSelected } = indexItem
24
-
25
- const itemOtherProps = isSelected ? { ...{ 'aria-current': current } } : null
26
-
27
- return (
28
- <li
29
- key={uuidv1()}
30
- onClick={(e) => {
31
- e.preventDefault()
32
- const newIndexItems = getIndexItemsWithSelected(indexItems, indexItem)
33
- onClick({
34
- active: text,
35
- ariaAttr,
36
- items: newIndexItems.map(
37
- (newIndexItem) => (({ href, text, isSelected }) => ({ href, text, isSelected }))(newIndexItem), // eslint-disable-line
38
- ),
39
- })
40
- }}
41
- className={
42
- !isSelected
43
- ? cx(styles['breadcrumb-item'])
44
- : cx(styles['breadcrumb-item'], styles['breadcrumb-item-selected'], utilityStyles['text-gray'])
45
- }
46
- // @ts-ignore
47
- href={href}
48
- {...itemOtherProps}
49
- >
50
- {isSelected ? text : <a href={href}>{text}</a>}
51
- </li>
52
- )
53
- })}
54
- </ol>
55
- </nav>
56
- )
57
- }
@@ -1,40 +0,0 @@
1
- import { action } from 'storybook/actions'
2
- import { withTests } from '@storybook/addon-jest'
3
- import { breadcrumbState } from '../Breadcrumb.prop'
4
- import results from '../../../../../../.jest-test-results.json'
5
-
6
- const Breadcrumb =
7
- process.env.NODE_ENV === 'develop' || process.env.NODE_ENV === 'test'
8
- ? require('../../../index').primer.Breadcrumb.Breadcrumb
9
- : require('../../../../build').primer.Breadcrumb.Breadcrumb
10
-
11
- export default {
12
- title: 'Primer/Atom/Breadcrumb',
13
- component: Breadcrumb,
14
- decorators: [withTests({ results })],
15
- parameters: { jest: ['Breadcrumb.int.test.js'] },
16
- excludeStories: ['ariaAttr', 'items', 'custom'],
17
- }
18
-
19
- export const ariaAttr = {
20
- label: 'Breadcrumb',
21
- current: 'page',
22
- }
23
-
24
- export const items = [
25
- { href: '/fantastic-folder', text: 'Fantastic Folder', isSelected: false },
26
- { href: '/fantastic-folder/another-fantastic-folder', text: 'Another Fantastic folder', isSelected: false },
27
- { href: '', text: 'One More Fantastic Folder', isSelected: true },
28
- ]
29
-
30
- export function custom(onClick) {
31
- return <Breadcrumb ariaAttr={ariaAttr} items={items} onClick={onClick} />
32
- }
33
-
34
- export function regular() {
35
- return <Breadcrumb ariaAttr={ariaAttr} items={items} onClick={action('onClick')} />
36
- }
37
-
38
- export function inactive() {
39
- return <Breadcrumb ariaAttr={ariaAttr} items={items} onClick={action('onClick')} state={breadcrumbState.inactive} />
40
- }