@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
@@ -1,102 +0,0 @@
1
- import cx from 'classnames'
2
- import { v1 as uuidv1 } from 'uuid'
3
- import detailsUtilityStyles from '@papillonarts/css/build/primer/utilities/details.scss'
4
- import displayStyles from '@papillonarts/css/build/primer/utilities/visibility-display.scss'
5
- import layoutStyles from '@papillonarts/css/build/primer/utilities/layout.scss'
6
- import flexboxStyles from '@papillonarts/css/build/primer/utilities/flexbox.scss'
7
- import { getIndexItems, getIndexItemsWithSelected } from '@papillonarts/library/array'
8
- import { useRef } from '@papillonarts/library/hooks'
9
- import buttonStyles from '../Button/Button.scss'
10
- import { DropdownProps, defaultProps, dropdownState } from './Dropdown.prop'
11
- import styles from './Dropdown.scss'
12
-
13
- export function Dropdown({
14
- className = defaultProps.className,
15
- summary,
16
- ariaAttr = defaultProps.ariaAttr,
17
- items,
18
- onClick,
19
- state = defaultProps.state,
20
- }: DropdownProps) {
21
- const details = useRef(null)
22
-
23
- if (!items) {
24
- return null
25
- }
26
-
27
- const indexItems = getIndexItems(items)
28
-
29
- return (
30
- <div className={className}>
31
- <details
32
- ref={details}
33
- className={cx(
34
- styles.dropdown,
35
- detailsUtilityStyles['details-reset'],
36
- detailsUtilityStyles['details-overlay'],
37
- displayStyles['d-inline-block'],
38
- {
39
- [styles['dropdown-inactive']]: state === dropdownState.inactive,
40
- },
41
- )}
42
- >
43
- <summary className={cx(buttonStyles.btn)} aria-haspopup={ariaAttr?.haspopup ?? false}>
44
- <div
45
- className={cx(displayStyles['d-flex'], flexboxStyles['flex-justify-between'], flexboxStyles['flex-items-center'], {
46
- [styles['dropdown-inactive']]: state === dropdownState.inactive,
47
- })}
48
- >
49
- <div>{summary}</div> <div className={styles['dropdown-caret']} />
50
- </div>
51
- </summary>
52
-
53
- <ul className={cx(styles['dropdown-menu'], styles['dropdown-menu-se'], layoutStyles['width-full'])}>
54
- {indexItems.map((indexItem) => {
55
- const { href, text /* isSelected */ } = indexItem
56
-
57
- // const itemOtherProps = isSelected ? { ...{ 'aria-current': ariaAttr?.current } } : null
58
-
59
- return (
60
- <li key={uuidv1()}>
61
- <a
62
- onClick={(e) => {
63
- e.preventDefault()
64
- const newIndexItems = getIndexItemsWithSelected(indexItems, indexItem)
65
- onClick({
66
- summary: text,
67
- ariaAttr,
68
- items: newIndexItems.map((newIndexItem) =>
69
- (({
70
- id: newIndexItemId,
71
- href: newIndexItemHref,
72
- text: newIndexItemText,
73
- 'date-modified': dateModified,
74
- 'date-created': dateCreated,
75
- isSelected: newIndexItemIsSelected,
76
- }) => ({
77
- id: newIndexItemId,
78
- href: newIndexItemHref,
79
- text: newIndexItemText,
80
- 'date-modified': dateModified,
81
- 'date-created': dateCreated,
82
- isSelected: newIndexItemIsSelected,
83
- }))(newIndexItem),
84
- ),
85
- })
86
- details.current.removeAttribute('open')
87
- }}
88
- className={styles['dropdown-item']}
89
- href={href}
90
- // @ts-ignore
91
- // {...itemOtherProps}
92
- >
93
- {text}
94
- </a>
95
- </li>
96
- )
97
- })}
98
- </ul>
99
- </details>
100
- </div>
101
- )
102
- }
@@ -1,43 +0,0 @@
1
- import { action } from 'storybook/actions'
2
- import { withTests } from '@storybook/addon-jest'
3
- import { dropdownState } from '../Dropdown.prop'
4
- import results from '../../../../../../.jest-test-results.json'
5
-
6
- const Dropdown =
7
- process.env.NODE_ENV === 'develop' || process.env.NODE_ENV === 'test'
8
- ? require('../../../index').primer.Dropdown.Dropdown
9
- : require('../../../../build').primer.Dropdown.Dropdown
10
-
11
- export default {
12
- title: 'Primer/Atom/Dropdown',
13
- component: Dropdown,
14
- decorators: [withTests({ results })],
15
- parameters: { jest: ['Dropdown.int.test.js'] },
16
- excludeStories: ['summary', 'ariaAttr', 'items', 'custom'],
17
- }
18
-
19
- export const summary = 'Dropdown'
20
-
21
- export const ariaAttr = {
22
- haspopup: true,
23
- current: 'page',
24
- }
25
-
26
- export const items = [
27
- { href: '#url', text: 'Dropdown Item 1', isSelected: true },
28
- { href: '#url', text: 'Dropdown Item 2', isSelected: false },
29
- { href: '#url', text: 'Dropdown Item 3', isSelected: false },
30
- { href: '#url', text: 'Dropdown Item 4', isSelected: false },
31
- ]
32
-
33
- export function custom(onClick) {
34
- return <Dropdown summary={summary} ariaAttr={ariaAttr} items={items} onClick={onClick} />
35
- }
36
-
37
- export function regular() {
38
- return <Dropdown summary={summary} ariaAttr={ariaAttr} items={items} onClick={action('onClick')} />
39
- }
40
-
41
- export function inactive() {
42
- return <Dropdown summary={summary} ariaAttr={ariaAttr} items={items} onClick={action('onClick')} state={dropdownState.inactive} />
43
- }
@@ -1,53 +0,0 @@
1
- import { items, regular, inactive } from './Dropdown.int.story'
2
-
3
- jest.mock('@papillonarts/library/array', () => ({
4
- getIndexItems: () => {},
5
- getIndexItemsWithSelected: () => {},
6
- }))
7
-
8
- jest.mock('@papillonarts/library/hooks', () => ({
9
- useRef: () => {},
10
- }))
11
-
12
- const libraryArrayMockObject = require('@papillonarts/library/array')
13
- const libraryHooksMockObject = require('@papillonarts/library/hooks')
14
-
15
- describe('<Dropdown />', () => {
16
- const indexItemsDataObject = [
17
- { ...items[0], index: 0 },
18
- { ...items[1], index: 1 },
19
- { ...items[2], index: 2 },
20
- { ...items[3], index: 3 },
21
- ]
22
-
23
- const newIndexItemsWithSelectedDataObject = [
24
- { ...items[0], index: 0, isSelected: true },
25
- { ...items[1], index: 1, isSelected: false },
26
- { ...items[2], index: 2, isSelected: false },
27
- { ...items[3], index: 3, isSelected: false },
28
- ]
29
-
30
- beforeEach(() => {
31
- jest.spyOn(libraryArrayMockObject, 'getIndexItems').mockReturnValue(indexItemsDataObject)
32
-
33
- jest.spyOn(libraryArrayMockObject, 'getIndexItemsWithSelected').mockReturnValue(newIndexItemsWithSelectedDataObject)
34
-
35
- jest.spyOn(libraryHooksMockObject, 'useRef').mockImplementation(() => ({
36
- current: {
37
- removeAttribute: () => {},
38
- },
39
- }))
40
- })
41
-
42
- afterEach(() => jest.clearAllMocks())
43
-
44
- describe('Render', () => {
45
- test('must match regular()', () => {
46
- expect(global.renderToJSON(regular())).toMatchSnapshot()
47
- })
48
-
49
- test('must match inacive()', () => {
50
- expect(global.renderToJSON(inactive())).toMatchSnapshot()
51
- })
52
- })
53
- })
@@ -1,2 +0,0 @@
1
- export { Dropdown } from './Dropdown'
2
- export { dropdownState } from './Dropdown.prop'
@@ -1,5 +0,0 @@
1
- export const defaultProps = {}
2
-
3
- export interface ErrorBoundaryProps {
4
- children: React.ReactNode // https://react.dev/learn/typescript#typing-children,
5
- }
@@ -1,35 +0,0 @@
1
- /* eslint-disable no-unused-vars, no-console */
2
- import { Component } from 'react'
3
- import { ErrorBoundaryProps } from './ErrorBoundary.prop'
4
-
5
- export class ErrorBoundary extends Component<ErrorBoundaryProps> {
6
- constructor(props) {
7
- super(props)
8
- this.state = { hasError: false }
9
- }
10
-
11
- static getDerivedStateFromError(error) {
12
- // Update state so the next render will show the fallback UI.
13
- return { hasError: true }
14
- }
15
-
16
- componentDidCatch(error, errorInfo) {
17
- // You can also log the error to an error reporting service
18
- console.log('~error~', error)
19
- console.log('~errorInfo~', errorInfo)
20
- }
21
-
22
- render() {
23
- // @ts-ignore
24
- const { hasError } = this.state
25
- // @ts-ignore
26
- const { children } = this.props
27
-
28
- if (hasError) {
29
- // You can render any custom fallback UI
30
- return <h1>Something went wrong.</h1>
31
- }
32
-
33
- return children
34
- }
35
- }
@@ -1,23 +0,0 @@
1
- import { withTests } from '@storybook/addon-jest'
2
- import results from '../../../../../../.jest-test-results.json'
3
-
4
- const ErrorBoundary =
5
- process.env.NODE_ENV === 'develop' || process.env.NODE_ENV === 'test'
6
- ? require('../../../index').primer.ErrorBoundary
7
- : require('../../../../build').primer.ErrorBoundary
8
-
9
- export default {
10
- title: 'Primer/Molecule/ErrorBoundary',
11
- component: ErrorBoundary,
12
- decorators: [withTests({ results })],
13
- parameters: { jest: ['ErrorBoundary.int.test.js'] },
14
- excludeStories: ['custom'],
15
- }
16
-
17
- export function regular() {
18
- return (
19
- <ErrorBoundary>
20
- <div />
21
- </ErrorBoundary>
22
- )
23
- }
@@ -1,9 +0,0 @@
1
- import { regular } from './ErrorBoundary.int.story'
2
-
3
- describe('<ErrorBoundary />', () => {
4
- describe('Render', () => {
5
- test('must match regular()', () => {
6
- expect(global.renderToJSON(regular())).toMatchSnapshot()
7
- })
8
- })
9
- })
@@ -1 +0,0 @@
1
- export { ErrorBoundary } from './ErrorBoundary'
@@ -1,34 +0,0 @@
1
- export const checkboxState = {
2
- active: 'active',
3
- inactive: 'inactive',
4
- }
5
-
6
- export const inputType = {
7
- checkbox: 'checkbox',
8
- }
9
-
10
- export const defaultProps = {
11
- dataTest: null,
12
- className: null,
13
- htmlFor: 'checkbox',
14
- inputType: inputType.checkbox,
15
- isChecked: false,
16
- text: null,
17
- state: checkboxState.active,
18
- }
19
-
20
- export interface AriaAttrType {
21
- describedBy: string
22
- }
23
-
24
- export interface CheckboxProps {
25
- dataTest?: string
26
- className?: string
27
- htmlFor?: string
28
- ariaAttr: AriaAttrType
29
- inputType?: typeof inputType.checkbox
30
- isChecked?: boolean
31
- text?: string
32
- onChange: (value) => void
33
- state?: typeof checkboxState.active | typeof checkboxState.inactive
34
- }
@@ -1,40 +0,0 @@
1
- import cx from 'classnames'
2
- import marginStyles from '@papillonarts/css/build/primer/utilities/margin.scss'
3
- import { CheckboxProps, defaultProps, checkboxState } from './Checkbox.prop'
4
- import styles from './Checkbox.scss'
5
- import formStyles from '../index.scss'
6
-
7
- export function Checkbox({
8
- dataTest = defaultProps.dataTest,
9
- className = defaultProps.className,
10
- htmlFor = defaultProps.htmlFor,
11
- ariaAttr,
12
- inputType = defaultProps.inputType,
13
- isChecked = defaultProps.isChecked,
14
- text = defaultProps.text,
15
- onChange,
16
- state = defaultProps.state,
17
- }: CheckboxProps) {
18
- const { describedBy } = ariaAttr
19
-
20
- return (
21
- <div
22
- data-test={dataTest}
23
- className={cx(className, marginStyles['m-0'], formStyles['form-checkbox'], {
24
- [styles['checkbox-inactive']]: state === checkboxState.inactive,
25
- })}
26
- >
27
- <label htmlFor={htmlFor}>
28
- <input
29
- type={inputType}
30
- aria-describedby={describedBy}
31
- onChange={(event) => {
32
- onChange(event)
33
- }}
34
- checked={isChecked}
35
- />
36
- {text}
37
- </label>
38
- </div>
39
- )
40
- }
@@ -1,50 +0,0 @@
1
- import { action } from 'storybook/actions'
2
- import { withTests } from '@storybook/addon-jest'
3
- import { checkboxState } from '../Checkbox.prop'
4
- import results from '../../../../../../../.jest-test-results.json'
5
-
6
- const Checkbox =
7
- process.env.NODE_ENV === 'develop' || process.env.NODE_ENV === 'test'
8
- ? require('../../../../index').primer.Form.Checkbox.Checkbox
9
- : require('../../../../../build').primer.Form.Checkbox.Checkbox
10
-
11
- export default {
12
- title: 'Primer/Atom/Form/Checkbox',
13
- component: Checkbox,
14
- decorators: [withTests({ results })],
15
- parameters: { jest: ['Checkbox.int.test.js'] },
16
- excludeStories: ['ariaAttr', 'text', 'custom'],
17
- }
18
-
19
- const ariaAttr = {
20
- describedBy: 'help-text-for-checkbox',
21
- }
22
-
23
- export const text = {
24
- isChecked: 'is checked',
25
- isNotChecked: 'is not checked',
26
- }
27
-
28
- export function custom(onChange) {
29
- return <Checkbox ariaAttr={ariaAttr} isChecked={true} onChange={onChange} text="is checked" />
30
- }
31
-
32
- export function isChecked() {
33
- return <Checkbox ariaAttr={ariaAttr} isChecked={true} onChange={action('onChange')} text={text.isChecked} />
34
- }
35
-
36
- export function isCheckedInactive() {
37
- return (
38
- <Checkbox ariaAttr={ariaAttr} isChecked={true} onChange={action('onChange')} text={text.isChecked} state={checkboxState.inactive} />
39
- )
40
- }
41
-
42
- export function isNotChecked() {
43
- return <Checkbox ariaAttr={ariaAttr} isChecked={false} onChange={action('onChange')} text={text.isNotChecked} />
44
- }
45
-
46
- export function isNotCheckedInactive() {
47
- return (
48
- <Checkbox ariaAttr={ariaAttr} isChecked={false} onChange={action('onChange')} text={text.isNotChecked} state={checkboxState.inactive} />
49
- )
50
- }
@@ -1,23 +0,0 @@
1
- import { isChecked, isNotChecked, isCheckedInactive, isNotCheckedInactive } from './Checkbox.int.story'
2
-
3
- describe('<Checkbox />', () => {
4
- afterEach(() => jest.clearAllMocks())
5
-
6
- describe('Render', () => {
7
- test('must match isChecked()', () => {
8
- expect(global.renderToJSON(isChecked())).toMatchSnapshot()
9
- })
10
-
11
- test('must match isCheckedInactive()', () => {
12
- expect(global.renderToJSON(isCheckedInactive())).toMatchSnapshot()
13
- })
14
-
15
- test('must match isNotChecked()', () => {
16
- expect(global.renderToJSON(isNotChecked())).toMatchSnapshot()
17
- })
18
-
19
- test('must match isNotCheckedInactive()', () => {
20
- expect(global.renderToJSON(isNotCheckedInactive())).toMatchSnapshot()
21
- })
22
- })
23
- })
@@ -1,2 +0,0 @@
1
- export { Checkbox } from './Checkbox'
2
- export { checkboxState } from './Checkbox.prop'
@@ -1,43 +0,0 @@
1
- export const inputState = {
2
- active: 'active',
3
- inactive: 'inactive',
4
- }
5
-
6
- export const inputType = {
7
- text: 'text',
8
- password: 'password',
9
- }
10
-
11
- export const defaultProps = {
12
- dataTest: null,
13
- id: null,
14
- className: null,
15
- placeholder: null,
16
- ariaAttr: {
17
- label: '',
18
- },
19
- inputType: inputType.text,
20
- onFocus: () => {},
21
- onBlur: () => {},
22
- state: inputState.active,
23
- }
24
-
25
- export interface AriaAttrType {
26
- label: string
27
- }
28
-
29
- export interface InputProps {
30
- dataTest?: string
31
- id?: string
32
- className?: string
33
- placeholder?: string
34
- ariaAttr?: AriaAttrType
35
- inputType?: typeof inputType.text | typeof inputType.password
36
- value: string
37
- onChange: (value) => void
38
- onKeyUp: (value) => void
39
- onFocus?: (value) => void
40
- onBlur?: (value) => void
41
- autoFocus: boolean
42
- state?: typeof inputState.active | typeof inputState.inactive
43
- }
@@ -1,43 +0,0 @@
1
- import cx from 'classnames'
2
- import { InputProps, defaultProps, inputState } from './Input.prop'
3
- import styles from './Input.scss'
4
- import formStyles from '../index.scss'
5
-
6
- export function Input({
7
- dataTest = defaultProps.dataTest,
8
- id = defaultProps.id,
9
- className = defaultProps.className,
10
- placeholder = defaultProps.placeholder,
11
- ariaAttr = defaultProps.ariaAttr,
12
- inputType = defaultProps.inputType,
13
- value,
14
- onChange,
15
- onKeyUp,
16
- onFocus = defaultProps.onFocus,
17
- onBlur = defaultProps.onBlur,
18
- autoFocus,
19
- state = defaultProps.state,
20
- }: InputProps) {
21
- return (
22
- <input
23
- data-test={dataTest}
24
- id={id}
25
- className={cx(className, formStyles['form-control'], {
26
- [styles['input-inactive']]: state === inputState.inactive,
27
- })}
28
- value={value}
29
- onChange={(event) => {
30
- onChange(event)
31
- }}
32
- onKeyUp={(event) => {
33
- onKeyUp(event)
34
- }}
35
- onFocus={onFocus}
36
- onBlur={onBlur}
37
- type={inputType}
38
- placeholder={placeholder}
39
- aria-label={ariaAttr.label}
40
- autoFocus={autoFocus} // eslint-disable-line
41
- />
42
- )
43
- }
@@ -1,54 +0,0 @@
1
- import { action } from 'storybook/actions'
2
- import { withTests } from '@storybook/addon-jest'
3
- import { inputState } from '../Input.prop'
4
- import results from '../../../../../../../.jest-test-results.json'
5
-
6
- const Input =
7
- process.env.NODE_ENV === 'develop' || process.env.NODE_ENV === 'test'
8
- ? require('../../../../index').primer.Form.Input.Input
9
- : require('../../../../../build').primer.Form.Input.Input
10
-
11
- export default {
12
- title: 'Primer/Atom/Form/Input',
13
- component: Input,
14
- decorators: [withTests({ results })],
15
- parameters: { jest: ['Input.int.test.js'] },
16
- excludeStories: ['placeholder', 'ariaAttr', 'custom'],
17
- }
18
-
19
- const placeholder = 'Fantastic placeholder'
20
-
21
- const ariaAttr = {
22
- label: 'Repository description',
23
- }
24
-
25
- export function custom(onChange, onKeyUp, onFocus, onBlur) {
26
- return <Input placeholder={placeholder} ariaAttr={ariaAttr} onChange={onChange} onKeyUp={onKeyUp} onFocus={onFocus} onBlur={onBlur} />
27
- }
28
-
29
- export function regular() {
30
- return (
31
- <Input
32
- placeholder={placeholder}
33
- ariaAttr={ariaAttr}
34
- onChange={action('onChange')}
35
- onKeyUp={action('onKeyUp')}
36
- onFocus={action('onFocus')}
37
- onBlur={action('onBlur')}
38
- />
39
- )
40
- }
41
-
42
- export function inactive() {
43
- return (
44
- <Input
45
- placeholder={placeholder}
46
- ariaAttr={ariaAttr}
47
- onChange={action('onChange')}
48
- onKeyUp={action('onKeyUp')}
49
- onFocus={action('onFocus')}
50
- onBlur={action('onBlur')}
51
- state={inputState.inactive}
52
- />
53
- )
54
- }
@@ -1,15 +0,0 @@
1
- import { regular, inactive } from './Input.int.story'
2
-
3
- describe('<Input />', () => {
4
- afterEach(() => jest.clearAllMocks())
5
-
6
- describe('Render', () => {
7
- test('must match regular()', () => {
8
- expect(global.renderToJSON(regular())).toMatchSnapshot()
9
- })
10
-
11
- test('must match inactive()', () => {
12
- expect(global.renderToJSON(inactive())).toMatchSnapshot()
13
- })
14
- })
15
- })
@@ -1,2 +0,0 @@
1
- export { Input } from './Input'
2
- export { inputType, inputState } from './Input.prop'
@@ -1,30 +0,0 @@
1
- export const radioState = {
2
- active: 'active',
3
- inactive: 'inactive',
4
- }
5
-
6
- export const inputType = {
7
- radio: 'radio',
8
- }
9
-
10
- export const defaultProps = {
11
- dataTest: null,
12
- className: null,
13
- htmlFor: 'checkbox',
14
- inputType: inputType.radio,
15
- isChecked: false,
16
- text: null,
17
- state: radioState.active,
18
- }
19
-
20
- export interface RadioProps {
21
- dataTest?: string
22
- className?: string
23
- htmlFor?: string
24
- inputType?: typeof inputType.radio
25
- name: string
26
- isChecked?: boolean
27
- text?: string
28
- onChange: (value) => void
29
- state?: typeof radioState.active | typeof radioState.inactive
30
- }
@@ -1,38 +0,0 @@
1
- import cx from 'classnames'
2
- import marginStyles from '@papillonarts/css/build/primer/utilities/margin.scss'
3
- import { RadioProps, defaultProps, radioState } from './Radio.prop'
4
- import styles from './Radio.scss'
5
- import formStyles from '../index.scss'
6
-
7
- export function Radio({
8
- dataTest = defaultProps.dataTest,
9
- className = defaultProps.className,
10
- htmlFor = defaultProps.htmlFor,
11
- inputType = defaultProps.inputType,
12
- name,
13
- isChecked = defaultProps.isChecked,
14
- text = defaultProps.text,
15
- onChange,
16
- state = defaultProps.state,
17
- }: RadioProps) {
18
- return (
19
- <div
20
- data-test={dataTest}
21
- className={cx(className, marginStyles['m-0'], formStyles['form-checkbox'], {
22
- [styles['radio-inactive']]: state === radioState.inactive,
23
- })}
24
- >
25
- <label htmlFor={htmlFor}>
26
- <input
27
- type={inputType}
28
- name={name}
29
- onChange={(event) => {
30
- onChange(event)
31
- }}
32
- checked={isChecked}
33
- />
34
- {text}
35
- </label>
36
- </div>
37
- )
38
- }