@postenbring/hedwig-react 0.0.80 → 0.0.82

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 (528) hide show
  1. package/dist/accordion/accordion-content.d.ts +6 -2
  2. package/dist/accordion/accordion-content.d.ts.map +1 -0
  3. package/dist/accordion/accordion-content.js +1 -1
  4. package/dist/accordion/accordion-content.js.map +1 -1
  5. package/dist/accordion/accordion-content.mjs +1 -1
  6. package/dist/accordion/accordion-header.d.ts +6 -2
  7. package/dist/accordion/accordion-header.d.ts.map +1 -0
  8. package/dist/accordion/accordion-item.d.ts +24 -3
  9. package/dist/accordion/accordion-item.d.ts.map +1 -0
  10. package/dist/accordion/accordion.d.ts +44 -2
  11. package/dist/accordion/accordion.d.ts.map +1 -0
  12. package/dist/accordion/accordion.js +102 -4
  13. package/dist/accordion/accordion.js.map +1 -1
  14. package/dist/accordion/accordion.mjs +5 -1
  15. package/dist/accordion/context.d.ts +7 -2
  16. package/dist/accordion/context.d.ts.map +1 -0
  17. package/dist/accordion/index.d.ts +9 -9
  18. package/dist/accordion/index.d.ts.map +1 -0
  19. package/dist/accordion/index.js +53 -54
  20. package/dist/accordion/index.js.map +1 -1
  21. package/dist/accordion/index.mjs +8 -8
  22. package/dist/badge/badge.d.ts +21 -5
  23. package/dist/badge/badge.d.ts.map +1 -0
  24. package/dist/badge/index.d.ts +3 -6
  25. package/dist/badge/index.d.ts.map +1 -0
  26. package/dist/box/box.d.ts +50 -4
  27. package/dist/box/box.d.ts.map +1 -0
  28. package/dist/box/box.js +15 -14
  29. package/dist/box/box.js.map +1 -1
  30. package/dist/box/box.mjs +1 -1
  31. package/dist/box/index.d.ts +3 -4
  32. package/dist/box/index.d.ts.map +1 -0
  33. package/dist/box/index.js +16 -19
  34. package/dist/box/index.js.map +1 -1
  35. package/dist/box/index.mjs +4 -5
  36. package/dist/breadcrumbs/breadcrumbs.d.ts +33 -2
  37. package/dist/breadcrumbs/breadcrumbs.d.ts.map +1 -0
  38. package/dist/breadcrumbs/index.d.ts +3 -2
  39. package/dist/breadcrumbs/index.d.ts.map +1 -0
  40. package/dist/button/button.d.ts +33 -3
  41. package/dist/button/button.d.ts.map +1 -0
  42. package/dist/button/index.d.ts +3 -3
  43. package/dist/button/index.d.ts.map +1 -0
  44. package/dist/card/card.d.ts +69 -12
  45. package/dist/card/card.d.ts.map +1 -0
  46. package/dist/card/card.js +17 -6
  47. package/dist/card/card.js.map +1 -1
  48. package/dist/card/card.mjs +1 -1
  49. package/dist/card/index.d.ts +3 -12
  50. package/dist/card/index.d.ts.map +1 -0
  51. package/dist/card/index.js +18 -19
  52. package/dist/card/index.js.map +1 -1
  53. package/dist/card/index.mjs +4 -5
  54. package/dist/{chunk-XC3UHH2U.mjs → chunk-3WVRY6CC.mjs} +4 -4
  55. package/dist/{chunk-XC3UHH2U.mjs.map → chunk-3WVRY6CC.mjs.map} +1 -1
  56. package/dist/{chunk-GSJPTZT3.mjs → chunk-6AGDK5V3.mjs} +34 -19
  57. package/dist/chunk-6AGDK5V3.mjs.map +1 -0
  58. package/dist/{chunk-3MQKXNZ6.mjs → chunk-7UD72WOC.mjs} +13 -1
  59. package/dist/chunk-7UD72WOC.mjs.map +1 -0
  60. package/dist/chunk-7YWW46R3.mjs +1 -0
  61. package/dist/chunk-7YWW46R3.mjs.map +1 -0
  62. package/dist/{chunk-ENKVTAJB.mjs → chunk-AJWSQEDP.mjs} +18 -17
  63. package/dist/chunk-AJWSQEDP.mjs.map +1 -0
  64. package/dist/chunk-ARHJZUZG.mjs +1 -0
  65. package/dist/chunk-ARHJZUZG.mjs.map +1 -0
  66. package/dist/chunk-BCFV6VOE.mjs +1 -0
  67. package/dist/chunk-BCFV6VOE.mjs.map +1 -0
  68. package/dist/{chunk-GXYUJ5MA.mjs → chunk-C34HEQXO.mjs} +33 -29
  69. package/dist/chunk-C34HEQXO.mjs.map +1 -0
  70. package/dist/{chunk-PLXB3TNA.mjs → chunk-D7QPJIUZ.mjs} +5 -5
  71. package/dist/{chunk-PLXB3TNA.mjs.map → chunk-D7QPJIUZ.mjs.map} +1 -1
  72. package/dist/chunk-FYFJ75NX.mjs +1 -0
  73. package/dist/chunk-FYFJ75NX.mjs.map +1 -0
  74. package/dist/chunk-G65EYZFQ.mjs +1 -0
  75. package/dist/chunk-G65EYZFQ.mjs.map +1 -0
  76. package/dist/{chunk-2UWPZNXC.mjs → chunk-GLAEI3SD.mjs} +2 -2
  77. package/dist/{chunk-2UWPZNXC.mjs.map → chunk-GLAEI3SD.mjs.map} +1 -1
  78. package/dist/chunk-H3E546OT.mjs +1 -0
  79. package/dist/chunk-H3E546OT.mjs.map +1 -0
  80. package/dist/chunk-HQVL3ZJ2.mjs +1 -0
  81. package/dist/chunk-HQVL3ZJ2.mjs.map +1 -0
  82. package/dist/{chunk-XUWZ4HGD.mjs → chunk-LCJSUBCZ.mjs} +48 -45
  83. package/dist/chunk-LCJSUBCZ.mjs.map +1 -0
  84. package/dist/{chunk-KPGSRU4I.mjs → chunk-M3Y3XOGC.mjs} +13 -1
  85. package/dist/chunk-M3Y3XOGC.mjs.map +1 -0
  86. package/dist/{chunk-CIHZDFSQ.mjs → chunk-NU6OSFAU.mjs} +20 -9
  87. package/dist/chunk-NU6OSFAU.mjs.map +1 -0
  88. package/dist/chunk-RC76SXBP.mjs +1 -0
  89. package/dist/chunk-RC76SXBP.mjs.map +1 -0
  90. package/dist/{chunk-TQDUBRCZ.mjs → chunk-SQ63E7KM.mjs} +24 -22
  91. package/dist/chunk-SQ63E7KM.mjs.map +1 -0
  92. package/dist/{chunk-ES6ISHOV.mjs → chunk-UP3M3NEZ.mjs} +14 -13
  93. package/dist/{chunk-ES6ISHOV.mjs.map → chunk-UP3M3NEZ.mjs.map} +1 -1
  94. package/dist/chunk-ZKMFJZSH.mjs +1 -0
  95. package/dist/chunk-ZKMFJZSH.mjs.map +1 -0
  96. package/dist/description-list/description-list.d.ts +42 -2
  97. package/dist/description-list/description-list.d.ts.map +1 -0
  98. package/dist/description-list/index.d.ts +3 -2
  99. package/dist/description-list/index.d.ts.map +1 -0
  100. package/dist/footer/footer.d.ts +67 -7
  101. package/dist/footer/footer.d.ts.map +1 -0
  102. package/dist/footer/footer.js +80 -77
  103. package/dist/footer/footer.js.map +1 -1
  104. package/dist/footer/footer.mjs +5 -5
  105. package/dist/footer/index.d.ts +3 -7
  106. package/dist/footer/index.d.ts.map +1 -0
  107. package/dist/footer/index.js +81 -85
  108. package/dist/footer/index.js.map +1 -1
  109. package/dist/footer/index.mjs +8 -9
  110. package/dist/form/checkbox/checkbox.d.ts +28 -2
  111. package/dist/form/checkbox/checkbox.d.ts.map +1 -0
  112. package/dist/form/checkbox/index.d.ts +3 -2
  113. package/dist/form/checkbox/index.d.ts.map +1 -0
  114. package/dist/form/date-picker/date-picker.d.ts +33 -2
  115. package/dist/form/date-picker/date-picker.d.ts.map +1 -0
  116. package/dist/form/date-picker/index.d.ts +3 -2
  117. package/dist/form/date-picker/index.d.ts.map +1 -0
  118. package/dist/form/error-message/error-message.d.ts +8 -2
  119. package/dist/form/error-message/error-message.d.ts.map +1 -0
  120. package/dist/form/error-message/index.d.ts +3 -2
  121. package/dist/form/error-message/index.d.ts.map +1 -0
  122. package/dist/form/fieldset/fieldset.d.ts +22 -3
  123. package/dist/form/fieldset/fieldset.d.ts.map +1 -0
  124. package/dist/form/fieldset/index.d.ts +3 -3
  125. package/dist/form/fieldset/index.d.ts.map +1 -0
  126. package/dist/form/index.d.ts +9 -20
  127. package/dist/form/index.d.ts.map +1 -0
  128. package/dist/form/input/index.d.ts +3 -2
  129. package/dist/form/input/index.d.ts.map +1 -0
  130. package/dist/form/input/input.d.ts +5 -2
  131. package/dist/form/input/input.d.ts.map +1 -0
  132. package/dist/form/input-group/index.d.ts +3 -2
  133. package/dist/form/input-group/index.d.ts.map +1 -0
  134. package/dist/form/input-group/input-group.d.ts +27 -2
  135. package/dist/form/input-group/input-group.d.ts.map +1 -0
  136. package/dist/form/radiobutton/index.d.ts +5 -5
  137. package/dist/form/radiobutton/index.d.ts.map +1 -0
  138. package/dist/form/radiobutton/radiobutton.d.ts +17 -2
  139. package/dist/form/radiobutton/radiobutton.d.ts.map +1 -0
  140. package/dist/form/radiobutton/radiogroup.d.ts +24 -3
  141. package/dist/form/radiobutton/radiogroup.d.ts.map +1 -0
  142. package/dist/form/select/index.d.ts +3 -2
  143. package/dist/form/select/index.d.ts.map +1 -0
  144. package/dist/form/select/select.d.ts +9 -2
  145. package/dist/form/select/select.d.ts.map +1 -0
  146. package/dist/form/textarea/index.d.ts +3 -2
  147. package/dist/form/textarea/index.d.ts.map +1 -0
  148. package/dist/form/textarea/textarea.d.ts +5 -2
  149. package/dist/form/textarea/textarea.d.ts.map +1 -0
  150. package/dist/help-text/help-text.d.ts +51 -1
  151. package/dist/help-text/help-text.d.ts.map +1 -0
  152. package/dist/help-text/help-text.js +17 -20
  153. package/dist/help-text/help-text.js.map +1 -1
  154. package/dist/help-text/help-text.mjs +3 -3
  155. package/dist/help-text/index.d.ts +3 -1
  156. package/dist/help-text/index.d.ts.map +1 -0
  157. package/dist/help-text/index.js +17 -20
  158. package/dist/help-text/index.js.map +1 -1
  159. package/dist/help-text/index.mjs +3 -3
  160. package/dist/index-no-css.d.ts +26 -128
  161. package/dist/index-no-css.d.ts.map +1 -0
  162. package/dist/index-no-css.js +373 -394
  163. package/dist/index-no-css.js.map +1 -1
  164. package/dist/index-no-css.mjs +50 -57
  165. package/dist/index.d.ts +11 -128
  166. package/dist/index.d.ts.map +1 -0
  167. package/dist/index.js +373 -394
  168. package/dist/index.js.map +1 -1
  169. package/dist/index.mjs +50 -57
  170. package/dist/index.mjs.map +1 -1
  171. package/dist/layout/container/container.d.ts +23 -2
  172. package/dist/layout/container/container.d.ts.map +1 -0
  173. package/dist/layout/grid/grid.d.ts +101 -4
  174. package/dist/layout/grid/grid.d.ts.map +1 -0
  175. package/dist/layout/grid/grid.js +11 -10
  176. package/dist/layout/grid/grid.js.map +1 -1
  177. package/dist/layout/grid/grid.mjs +1 -1
  178. package/dist/layout/grid/index.d.ts +3 -4
  179. package/dist/layout/grid/index.d.ts.map +1 -0
  180. package/dist/layout/grid/index.js +12 -15
  181. package/dist/layout/grid/index.js.map +1 -1
  182. package/dist/layout/grid/index.mjs +4 -5
  183. package/dist/layout/index.d.ts +4 -10
  184. package/dist/layout/index.d.ts.map +1 -0
  185. package/dist/layout/index.js +12 -15
  186. package/dist/layout/index.js.map +1 -1
  187. package/dist/layout/index.mjs +4 -5
  188. package/dist/layout/responsive.d.ts +10 -2
  189. package/dist/layout/responsive.d.ts.map +1 -0
  190. package/dist/layout/spacing.d.ts +33 -3
  191. package/dist/layout/spacing.d.ts.map +1 -0
  192. package/dist/layout/stack/index.d.ts +3 -4
  193. package/dist/layout/stack/index.d.ts.map +1 -0
  194. package/dist/layout/stack/stack.d.ts +62 -4
  195. package/dist/layout/stack/stack.d.ts.map +1 -0
  196. package/dist/link/index.d.ts +3 -2
  197. package/dist/link/index.d.ts.map +1 -0
  198. package/dist/link/link.d.ts +20 -2
  199. package/dist/link/link.d.ts.map +1 -0
  200. package/dist/list/index.d.ts +5 -5
  201. package/dist/list/index.d.ts.map +1 -0
  202. package/dist/list/link-list.d.ts +12 -2
  203. package/dist/list/link-list.d.ts.map +1 -0
  204. package/dist/list/list.d.ts +40 -3
  205. package/dist/list/list.d.ts.map +1 -0
  206. package/dist/message/index.d.ts +3 -3
  207. package/dist/message/index.d.ts.map +1 -0
  208. package/dist/message/index.js +36 -38
  209. package/dist/message/index.js.map +1 -1
  210. package/dist/message/index.mjs +5 -6
  211. package/dist/message/message.d.ts +36 -4
  212. package/dist/message/message.d.ts.map +1 -0
  213. package/dist/message/message.js +35 -32
  214. package/dist/message/message.js.map +1 -1
  215. package/dist/message/message.mjs +2 -2
  216. package/dist/modal/index.d.ts +3 -5
  217. package/dist/modal/index.d.ts.map +1 -0
  218. package/dist/modal/index.js +60 -62
  219. package/dist/modal/index.js.map +1 -1
  220. package/dist/modal/index.mjs +5 -6
  221. package/dist/modal/modal.d.ts +81 -5
  222. package/dist/modal/modal.d.ts.map +1 -0
  223. package/dist/modal/modal.js +59 -55
  224. package/dist/modal/modal.js.map +1 -1
  225. package/dist/modal/modal.mjs +2 -2
  226. package/dist/navbar/icons.d.ts +3 -2
  227. package/dist/navbar/icons.d.ts.map +1 -0
  228. package/dist/navbar/index.d.ts +4 -13
  229. package/dist/navbar/index.d.ts.map +1 -0
  230. package/dist/navbar/index.js +144 -145
  231. package/dist/navbar/index.js.map +1 -1
  232. package/dist/navbar/index.mjs +4 -5
  233. package/dist/navbar/navbar-expandable-menu.d.ts +35 -7
  234. package/dist/navbar/navbar-expandable-menu.d.ts.map +1 -0
  235. package/dist/navbar/navbar.d.ts +130 -9
  236. package/dist/navbar/navbar.d.ts.map +1 -0
  237. package/dist/navbar/navbar.js +237 -28
  238. package/dist/navbar/navbar.js.map +1 -1
  239. package/dist/navbar/navbar.mjs +4 -1
  240. package/dist/show-more/index.d.ts +5 -4
  241. package/dist/show-more/index.d.ts.map +1 -0
  242. package/dist/show-more/show-more.d.ts +42 -2
  243. package/dist/show-more/show-more.d.ts.map +1 -0
  244. package/dist/skeleton/index.d.ts +3 -2
  245. package/dist/skeleton/index.d.ts.map +1 -0
  246. package/dist/skeleton/skeleton.d.ts +67 -2
  247. package/dist/skeleton/skeleton.d.ts.map +1 -0
  248. package/dist/step-indicator/index.d.ts +3 -1
  249. package/dist/step-indicator/index.d.ts.map +1 -0
  250. package/dist/step-indicator/step-indicator.d.ts +36 -1
  251. package/dist/step-indicator/step-indicator.d.ts.map +1 -0
  252. package/dist/styled-html/index.d.ts +3 -2
  253. package/dist/styled-html/index.d.ts.map +1 -0
  254. package/dist/styled-html/styled-html.d.ts +36 -2
  255. package/dist/styled-html/styled-html.d.ts.map +1 -0
  256. package/dist/table/index.d.ts +3 -1
  257. package/dist/table/index.d.ts.map +1 -0
  258. package/dist/table/table.d.ts +25 -1
  259. package/dist/table/table.d.ts.map +1 -0
  260. package/dist/tabs/context.d.ts +8 -3
  261. package/dist/tabs/context.d.ts.map +1 -0
  262. package/dist/tabs/index.d.ts +7 -10
  263. package/dist/tabs/index.d.ts.map +1 -0
  264. package/dist/tabs/index.js +34 -37
  265. package/dist/tabs/index.js.map +1 -1
  266. package/dist/tabs/index.mjs +4 -4
  267. package/dist/tabs/tabs-content.d.ts +26 -4
  268. package/dist/tabs/tabs-content.d.ts.map +1 -0
  269. package/dist/tabs/tabs-list.d.ts +21 -4
  270. package/dist/tabs/tabs-list.d.ts.map +1 -0
  271. package/dist/tabs/tabs.d.ts +26 -2
  272. package/dist/tabs/tabs.d.ts.map +1 -0
  273. package/dist/tabs/tabs.js +205 -8
  274. package/dist/tabs/tabs.js.map +1 -1
  275. package/dist/tabs/tabs.mjs +4 -1
  276. package/dist/text/index.d.ts +4 -2
  277. package/dist/text/index.d.ts.map +1 -0
  278. package/dist/text/text.d.ts +58 -2
  279. package/dist/text/text.d.ts.map +1 -0
  280. package/dist/utilities/auto-animate-height.d.ts +33 -2
  281. package/dist/utilities/auto-animate-height.d.ts.map +1 -0
  282. package/dist/utilities/index.d.ts +3 -2
  283. package/dist/utilities/index.d.ts.map +1 -0
  284. package/dist/utils.d.ts +28 -5
  285. package/dist/utils.d.ts.map +1 -0
  286. package/dist/warning-banner/index.d.ts +3 -2
  287. package/dist/warning-banner/index.d.ts.map +1 -0
  288. package/dist/warning-banner/index.js +16 -19
  289. package/dist/warning-banner/index.js.map +1 -1
  290. package/dist/warning-banner/index.mjs +3 -3
  291. package/dist/warning-banner/warning-banner.d.ts +8 -2
  292. package/dist/warning-banner/warning-banner.d.ts.map +1 -0
  293. package/dist/warning-banner/warning-banner.js +16 -19
  294. package/dist/warning-banner/warning-banner.js.map +1 -1
  295. package/dist/warning-banner/warning-banner.mjs +3 -3
  296. package/package.json +11 -7
  297. package/src/accordion/accordion-content.tsx +31 -0
  298. package/src/accordion/accordion-header.tsx +36 -0
  299. package/src/accordion/accordion-item.tsx +62 -0
  300. package/src/accordion/accordion.stories.tsx +154 -0
  301. package/src/accordion/accordion.tsx +68 -0
  302. package/src/accordion/context.ts +8 -0
  303. package/src/accordion/index.tsx +9 -0
  304. package/src/badge/badge.stories.tsx +44 -0
  305. package/src/badge/badge.tsx +63 -0
  306. package/src/badge/index.tsx +3 -0
  307. package/src/box/box.stories.tsx +112 -0
  308. package/src/box/box.tsx +122 -0
  309. package/src/box/index.tsx +3 -0
  310. package/src/breadcrumbs/breadcrumbs.stories.tsx +50 -0
  311. package/src/breadcrumbs/breadcrumbs.tsx +47 -0
  312. package/src/breadcrumbs/index.tsx +3 -0
  313. package/src/button/button.stories.tsx +104 -0
  314. package/src/button/button.tsx +87 -0
  315. package/src/button/index.tsx +3 -0
  316. package/src/card/card.stories.tsx +82 -0
  317. package/src/card/card.tsx +222 -0
  318. package/src/card/index.tsx +14 -0
  319. package/src/description-list/description-list.stories.tsx +95 -0
  320. package/src/description-list/description-list.tsx +61 -0
  321. package/src/description-list/index.tsx +2 -0
  322. package/src/footer/footer.tsx +169 -0
  323. package/src/footer/index.tsx +9 -0
  324. package/src/form/checkbox/checkbox.stories.tsx +104 -0
  325. package/src/form/checkbox/checkbox.tsx +82 -0
  326. package/src/form/checkbox/index.tsx +2 -0
  327. package/src/form/date-picker/date-picker.stories.tsx +27 -0
  328. package/src/form/date-picker/date-picker.tsx +85 -0
  329. package/src/form/date-picker/index.tsx +2 -0
  330. package/src/form/error-message/error-message.stories.tsx +19 -0
  331. package/src/form/error-message/error-message.tsx +25 -0
  332. package/src/form/error-message/index.tsx +2 -0
  333. package/src/form/fieldset/fieldset.stories.tsx +86 -0
  334. package/src/form/fieldset/fieldset.tsx +64 -0
  335. package/src/form/fieldset/index.tsx +2 -0
  336. package/src/form/index.tsx +8 -0
  337. package/src/form/input/index.tsx +2 -0
  338. package/src/form/input/input.stories.tsx +166 -0
  339. package/src/form/input/input.tsx +30 -0
  340. package/src/form/input-group/index.tsx +2 -0
  341. package/src/form/input-group/input-group.tsx +106 -0
  342. package/src/form/radiobutton/index.tsx +4 -0
  343. package/src/form/radiobutton/radiobutton.stories.tsx +93 -0
  344. package/src/form/radiobutton/radiobutton.tsx +85 -0
  345. package/src/form/radiobutton/radiogroup.stories.tsx +39 -0
  346. package/src/form/radiobutton/radiogroup.tsx +52 -0
  347. package/src/form/select/index.tsx +2 -0
  348. package/src/form/select/select.stories.tsx +93 -0
  349. package/src/form/select/select.tsx +33 -0
  350. package/src/form/textarea/index.tsx +2 -0
  351. package/src/form/textarea/textarea.stories.tsx +106 -0
  352. package/src/form/textarea/textarea.tsx +33 -0
  353. package/src/help-text/help-text.tsx +98 -0
  354. package/src/help-text/index.ts +2 -0
  355. package/src/index-no-css.tsx +25 -0
  356. package/src/index.tsx +11 -0
  357. package/src/layout/container/container.stories.tsx +62 -0
  358. package/src/layout/container/container.tsx +47 -0
  359. package/src/layout/grid/grid.tsx +163 -0
  360. package/src/layout/grid/index.tsx +3 -0
  361. package/src/layout/index.tsx +3 -0
  362. package/src/layout/responsive.ts +26 -0
  363. package/src/layout/spacing.ts +37 -0
  364. package/src/layout/stack/index.tsx +2 -0
  365. package/src/layout/stack/stack.tsx +128 -0
  366. package/src/link/index.tsx +3 -0
  367. package/src/link/link.stories.tsx +64 -0
  368. package/src/link/link.tsx +46 -0
  369. package/src/list/index.tsx +5 -0
  370. package/src/list/link-list.stories.tsx +38 -0
  371. package/src/list/link-list.tsx +26 -0
  372. package/src/list/list.stories.tsx +71 -0
  373. package/src/list/list.tsx +65 -0
  374. package/src/message/index.tsx +2 -0
  375. package/src/message/message.stories.tsx +93 -0
  376. package/src/message/message.tsx +89 -0
  377. package/src/modal/index.tsx +3 -0
  378. package/src/modal/modal.stories.tsx +147 -0
  379. package/src/modal/modal.tsx +199 -0
  380. package/src/navbar/icons.tsx +21 -0
  381. package/src/navbar/index.tsx +18 -0
  382. package/src/navbar/navbar-expandable-menu.tsx +176 -0
  383. package/src/navbar/navbar.stories.tsx +99 -0
  384. package/src/navbar/navbar.tsx +264 -0
  385. package/src/show-more/index.ts +5 -0
  386. package/src/show-more/show-more.stories.tsx +119 -0
  387. package/src/show-more/show-more.tsx +66 -0
  388. package/src/skeleton/index.ts +2 -0
  389. package/src/skeleton/skeleton.stories.tsx +152 -0
  390. package/src/skeleton/skeleton.tsx +114 -0
  391. package/src/step-indicator/index.ts +2 -0
  392. package/src/step-indicator/step-indicator.stories.tsx +50 -0
  393. package/src/step-indicator/step-indicator.tsx +116 -0
  394. package/src/styled-html/index.ts +2 -0
  395. package/src/styled-html/styled-html.stories.tsx +189 -0
  396. package/src/styled-html/styled-html.tsx +59 -0
  397. package/src/table/index.ts +2 -0
  398. package/src/table/table.tsx +59 -0
  399. package/src/tabs/context.ts +18 -0
  400. package/src/tabs/index.tsx +7 -0
  401. package/src/tabs/tabs-content.tsx +62 -0
  402. package/src/tabs/tabs-list.tsx +129 -0
  403. package/src/tabs/tabs.stories.tsx +138 -0
  404. package/src/tabs/tabs.tsx +50 -0
  405. package/src/text/index.tsx +4 -0
  406. package/src/text/text.stories.tsx +112 -0
  407. package/src/text/text.tsx +129 -0
  408. package/src/utilities/auto-animate-height.tsx +139 -0
  409. package/src/utilities/index.ts +2 -0
  410. package/src/utils.ts +110 -0
  411. package/src/warning-banner/index.tsx +2 -0
  412. package/src/warning-banner/warning-banner.stories.tsx +43 -0
  413. package/src/warning-banner/warning-banner.tsx +79 -0
  414. package/dist/_tsup-dts-rollup.d.mts +0 -2600
  415. package/dist/_tsup-dts-rollup.d.ts +0 -2600
  416. package/dist/accordion/accordion-content.d.mts +0 -2
  417. package/dist/accordion/accordion-header.d.mts +0 -2
  418. package/dist/accordion/accordion-item.d.mts +0 -3
  419. package/dist/accordion/accordion.d.mts +0 -2
  420. package/dist/accordion/context.d.mts +0 -2
  421. package/dist/accordion/index.d.mts +0 -9
  422. package/dist/badge/badge.d.mts +0 -5
  423. package/dist/badge/index.d.mts +0 -6
  424. package/dist/box/box.d.mts +0 -4
  425. package/dist/box/index.d.mts +0 -4
  426. package/dist/breadcrumbs/breadcrumbs.d.mts +0 -2
  427. package/dist/breadcrumbs/index.d.mts +0 -2
  428. package/dist/button/button.d.mts +0 -3
  429. package/dist/button/index.d.mts +0 -3
  430. package/dist/card/card.d.mts +0 -12
  431. package/dist/card/index.d.mts +0 -12
  432. package/dist/chunk-3MQKXNZ6.mjs.map +0 -1
  433. package/dist/chunk-3NL3TOZF.mjs +0 -13
  434. package/dist/chunk-3NL3TOZF.mjs.map +0 -1
  435. package/dist/chunk-722MZPXO.mjs +0 -13
  436. package/dist/chunk-722MZPXO.mjs.map +0 -1
  437. package/dist/chunk-CIHZDFSQ.mjs.map +0 -1
  438. package/dist/chunk-CYEYGPRH.mjs +0 -17
  439. package/dist/chunk-CYEYGPRH.mjs.map +0 -1
  440. package/dist/chunk-ENKVTAJB.mjs.map +0 -1
  441. package/dist/chunk-GSJPTZT3.mjs.map +0 -1
  442. package/dist/chunk-GXYUJ5MA.mjs.map +0 -1
  443. package/dist/chunk-HBSDJAFF.mjs +0 -23
  444. package/dist/chunk-HBSDJAFF.mjs.map +0 -1
  445. package/dist/chunk-IJAX6APL.mjs +0 -23
  446. package/dist/chunk-IJAX6APL.mjs.map +0 -1
  447. package/dist/chunk-IKJJWKXM.mjs +0 -15
  448. package/dist/chunk-IKJJWKXM.mjs.map +0 -1
  449. package/dist/chunk-KPGSRU4I.mjs.map +0 -1
  450. package/dist/chunk-MKVI42QR.mjs +0 -19
  451. package/dist/chunk-MKVI42QR.mjs.map +0 -1
  452. package/dist/chunk-PT5H3QV6.mjs +0 -29
  453. package/dist/chunk-PT5H3QV6.mjs.map +0 -1
  454. package/dist/chunk-TQDUBRCZ.mjs.map +0 -1
  455. package/dist/chunk-V6UKKHKD.mjs +0 -33
  456. package/dist/chunk-V6UKKHKD.mjs.map +0 -1
  457. package/dist/chunk-XUWZ4HGD.mjs.map +0 -1
  458. package/dist/description-list/description-list.d.mts +0 -2
  459. package/dist/description-list/index.d.mts +0 -2
  460. package/dist/footer/footer.d.mts +0 -7
  461. package/dist/footer/index.d.mts +0 -7
  462. package/dist/form/checkbox/checkbox.d.mts +0 -2
  463. package/dist/form/checkbox/index.d.mts +0 -2
  464. package/dist/form/date-picker/date-picker.d.mts +0 -2
  465. package/dist/form/date-picker/index.d.mts +0 -2
  466. package/dist/form/error-message/error-message.d.mts +0 -2
  467. package/dist/form/error-message/index.d.mts +0 -2
  468. package/dist/form/fieldset/fieldset.d.mts +0 -3
  469. package/dist/form/fieldset/index.d.mts +0 -3
  470. package/dist/form/index.d.mts +0 -20
  471. package/dist/form/input/index.d.mts +0 -2
  472. package/dist/form/input/input.d.mts +0 -2
  473. package/dist/form/input-group/index.d.mts +0 -2
  474. package/dist/form/input-group/input-group.d.mts +0 -2
  475. package/dist/form/radiobutton/index.d.mts +0 -5
  476. package/dist/form/radiobutton/radiobutton.d.mts +0 -2
  477. package/dist/form/radiobutton/radiogroup.d.mts +0 -3
  478. package/dist/form/select/index.d.mts +0 -2
  479. package/dist/form/select/select.d.mts +0 -2
  480. package/dist/form/textarea/index.d.mts +0 -2
  481. package/dist/form/textarea/textarea.d.mts +0 -2
  482. package/dist/help-text/help-text.d.mts +0 -1
  483. package/dist/help-text/index.d.mts +0 -1
  484. package/dist/index-no-css.d.mts +0 -128
  485. package/dist/index.d.mts +0 -128
  486. package/dist/layout/container/container.d.mts +0 -2
  487. package/dist/layout/grid/grid.d.mts +0 -4
  488. package/dist/layout/grid/index.d.mts +0 -4
  489. package/dist/layout/index.d.mts +0 -10
  490. package/dist/layout/responsive.d.mts +0 -2
  491. package/dist/layout/spacing.d.mts +0 -3
  492. package/dist/layout/stack/index.d.mts +0 -4
  493. package/dist/layout/stack/stack.d.mts +0 -4
  494. package/dist/link/index.d.mts +0 -2
  495. package/dist/link/link.d.mts +0 -2
  496. package/dist/list/index.d.mts +0 -5
  497. package/dist/list/link-list.d.mts +0 -2
  498. package/dist/list/list.d.mts +0 -3
  499. package/dist/message/index.d.mts +0 -3
  500. package/dist/message/message.d.mts +0 -4
  501. package/dist/modal/index.d.mts +0 -5
  502. package/dist/modal/modal.d.mts +0 -5
  503. package/dist/navbar/icons.d.mts +0 -2
  504. package/dist/navbar/index.d.mts +0 -13
  505. package/dist/navbar/navbar-expandable-menu.d.mts +0 -7
  506. package/dist/navbar/navbar.d.mts +0 -9
  507. package/dist/show-more/index.d.mts +0 -4
  508. package/dist/show-more/show-more.d.mts +0 -2
  509. package/dist/skeleton/index.d.mts +0 -2
  510. package/dist/skeleton/skeleton.d.mts +0 -2
  511. package/dist/step-indicator/index.d.mts +0 -1
  512. package/dist/step-indicator/step-indicator.d.mts +0 -1
  513. package/dist/styled-html/index.d.mts +0 -2
  514. package/dist/styled-html/styled-html.d.mts +0 -2
  515. package/dist/table/index.d.mts +0 -1
  516. package/dist/table/table.d.mts +0 -1
  517. package/dist/tabs/context.d.mts +0 -3
  518. package/dist/tabs/index.d.mts +0 -10
  519. package/dist/tabs/tabs-content.d.mts +0 -4
  520. package/dist/tabs/tabs-list.d.mts +0 -4
  521. package/dist/tabs/tabs.d.mts +0 -2
  522. package/dist/text/index.d.mts +0 -2
  523. package/dist/text/text.d.mts +0 -2
  524. package/dist/utilities/auto-animate-height.d.mts +0 -2
  525. package/dist/utilities/index.d.mts +0 -2
  526. package/dist/utils.d.mts +0 -5
  527. package/dist/warning-banner/index.d.mts +0 -2
  528. package/dist/warning-banner/warning-banner.d.mts +0 -2
@@ -0,0 +1,222 @@
1
+ import type { ReactNode } from "react";
2
+ import { forwardRef } from "react";
3
+ import { clsx } from "@postenbring/hedwig-css/typed-classname";
4
+ import { Slot } from "@radix-ui/react-slot";
5
+
6
+ export const CardMedia = forwardRef<HTMLDivElement, CardBaseProps>(
7
+ ({ asChild, className, children, ...rest }, ref) => {
8
+ const Component = asChild ? Slot : "div";
9
+ return (
10
+ <Component {...rest} className={clsx("hds-card__media", className as undefined)} ref={ref}>
11
+ {children}
12
+ </Component>
13
+ );
14
+ },
15
+ );
16
+ CardMedia.displayName = "Card.Media";
17
+
18
+ export interface CardImageMediaProps extends React.ImgHTMLAttributes<HTMLImageElement> {
19
+ /**
20
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
21
+ *
22
+ * @default false
23
+ */
24
+ asChild?: boolean;
25
+ }
26
+ export const CardMediaImg = forwardRef<HTMLImageElement, CardImageMediaProps>(
27
+ ({ asChild, className, ...rest }, ref) => {
28
+ const Component = asChild ? Slot : "img";
29
+ return (
30
+ <Component
31
+ {...rest}
32
+ className={clsx("hds-card__media__img", className as undefined)}
33
+ ref={ref}
34
+ />
35
+ );
36
+ },
37
+ );
38
+ CardMediaImg.displayName = "Card.MediaImg";
39
+
40
+ export const CardBody = forwardRef<HTMLDivElement, CardBaseProps>(
41
+ ({ asChild, className, children, ...rest }, ref) => {
42
+ const Component = asChild ? Slot : "div";
43
+ return (
44
+ <Component {...rest} className={clsx("hds-card__body", className as undefined)} ref={ref}>
45
+ {children}
46
+ </Component>
47
+ );
48
+ },
49
+ );
50
+ CardBody.displayName = "Card.Body";
51
+
52
+ export const CardBodyHeader = forwardRef<
53
+ HTMLHeadingElement,
54
+ CardBaseProps &
55
+ (
56
+ | {
57
+ /**
58
+ * Heading level of the card heading
59
+ */
60
+ as: "h2" | "h3" | "h4" | "h5" | "h6";
61
+ asChild?: never;
62
+ }
63
+ | {
64
+ asChild: true;
65
+ as?: never;
66
+ }
67
+ )
68
+ >(({ as: Tag, asChild, className, children, ...rest }, ref) => {
69
+ const Component = asChild ? Slot : Tag;
70
+ return (
71
+ <Component
72
+ {...rest}
73
+ className={clsx("hds-card__body-header", className as undefined)}
74
+ ref={ref}
75
+ >
76
+ {children}
77
+ </Component>
78
+ );
79
+ });
80
+ CardBodyHeader.displayName = "Card.BodyHeader";
81
+
82
+ export const CardBodyHeaderOverline = forwardRef<HTMLDivElement, CardBaseProps>(
83
+ ({ asChild, className, children, ...rest }, ref) => {
84
+ const Component = asChild ? Slot : "span";
85
+ return (
86
+ <Component
87
+ {...rest}
88
+ className={clsx("hds-card__body-header-overline", className as undefined)}
89
+ ref={ref}
90
+ >
91
+ {children}
92
+ </Component>
93
+ );
94
+ },
95
+ );
96
+ CardBodyHeaderOverline.displayName = "Card.BodyHeaderOverline";
97
+
98
+ export const CardBodyHeaderTitle = forwardRef<HTMLDivElement, CardBaseProps>(
99
+ ({ asChild, className, children, ...rest }, ref) => {
100
+ const Component = asChild ? Slot : "div";
101
+ return (
102
+ <Component
103
+ {...rest}
104
+ className={clsx("hds-card__body-header-title", className as undefined)}
105
+ ref={ref}
106
+ >
107
+ {children}
108
+ </Component>
109
+ );
110
+ },
111
+ );
112
+ CardBodyHeaderTitle.displayName = "Card.BodyHeaderTitle";
113
+
114
+ export const CardBodyDescription = forwardRef<HTMLParagraphElement, CardBaseProps>(
115
+ ({ asChild, className, children, ...rest }, ref) => {
116
+ const Component = asChild ? Slot : "p";
117
+ return (
118
+ <Component
119
+ {...rest}
120
+ className={clsx("hds-card__body-description", className as undefined)}
121
+ ref={ref}
122
+ >
123
+ {children}
124
+ </Component>
125
+ );
126
+ },
127
+ );
128
+ CardBodyDescription.displayName = "Card.BodyDescription";
129
+
130
+ export const CardBodyAction = forwardRef<HTMLDivElement, CardBaseProps>(
131
+ ({ asChild, className, children, ...rest }, ref) => {
132
+ const Component = asChild ? Slot : "div";
133
+ return (
134
+ <Component
135
+ {...rest}
136
+ className={clsx("hds-card__body-action", className as undefined)}
137
+ ref={ref}
138
+ >
139
+ {children}
140
+ </Component>
141
+ );
142
+ },
143
+ );
144
+ CardBodyAction.displayName = "Card.BodyAction";
145
+
146
+ interface CardBodyActionArrowProps extends React.HTMLAttributes<HTMLSpanElement> {
147
+ /**
148
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
149
+ *
150
+ * @default false
151
+ */
152
+ asChild?: boolean;
153
+ }
154
+ export const CardBodyActionArrow = forwardRef<HTMLSpanElement, CardBodyActionArrowProps>(
155
+ ({ asChild, className, ...rest }, ref) => {
156
+ const Component = asChild ? Slot : "span";
157
+ return (
158
+ <Component
159
+ {...rest}
160
+ className={clsx("hds-card__body-action-arrow", className as undefined)}
161
+ ref={ref}
162
+ />
163
+ );
164
+ },
165
+ );
166
+ CardBodyActionArrow.displayName = "Card.BodyActionArrow";
167
+
168
+ export interface CardBaseProps extends React.HTMLAttributes<HTMLDivElement> {
169
+ children: ReactNode;
170
+
171
+ /**
172
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
173
+ *
174
+ * @default false
175
+ */
176
+ asChild?: boolean;
177
+ }
178
+
179
+ export interface CardProps extends CardBaseProps {
180
+ /**
181
+ * A Card should in most cases appear as a big link,
182
+ * but the actual link should just be the header title.
183
+ * To make life better for those with screen readers we should not make
184
+ * the entire card a link, as that would cause the entire card to be read
185
+ * as a link to the user. That would be perceived as information overload.
186
+ */
187
+ as?: "section" | "div" | "article" | "aside";
188
+ }
189
+
190
+ export const Card = forwardRef<HTMLDivElement, CardProps>(
191
+ ({ as: Tag = "section", asChild, className, children, ...rest }, ref) => {
192
+ const Component = asChild ? Slot : Tag;
193
+ return (
194
+ <Component {...rest} className={clsx("hds-card", className as undefined)} ref={ref}>
195
+ {children}
196
+ </Component>
197
+ );
198
+ },
199
+ ) as CardType;
200
+ Card.displayName = "Card";
201
+
202
+ Card.Media = CardMedia;
203
+ Card.MediaImg = CardMediaImg;
204
+ Card.Body = CardBody;
205
+ Card.BodyHeader = CardBodyHeader;
206
+ Card.BodyHeaderOverline = CardBodyHeaderOverline;
207
+ Card.BodyHeaderTitle = CardBodyHeaderTitle;
208
+ Card.BodyDescription = CardBodyDescription;
209
+ Card.BodyAction = CardBodyAction;
210
+ Card.BodyActionArrow = CardBodyActionArrow;
211
+
212
+ type CardType = ReturnType<typeof forwardRef<HTMLDivElement, CardProps>> & {
213
+ Media: typeof CardMedia;
214
+ MediaImg: typeof CardMediaImg;
215
+ Body: typeof CardBody;
216
+ BodyHeader: typeof CardBodyHeader;
217
+ BodyHeaderOverline: typeof CardBodyHeaderOverline;
218
+ BodyHeaderTitle: typeof CardBodyHeaderTitle;
219
+ BodyDescription: typeof CardBodyDescription;
220
+ BodyAction: typeof CardBodyAction;
221
+ BodyActionArrow: typeof CardBodyActionArrow;
222
+ };
@@ -0,0 +1,14 @@
1
+ export {
2
+ Card,
3
+ CardMedia,
4
+ CardMediaImg,
5
+ CardBody,
6
+ CardBodyHeader,
7
+ CardBodyHeaderOverline,
8
+ CardBodyHeaderTitle,
9
+ CardBodyDescription,
10
+ CardBodyAction,
11
+ CardBodyActionArrow,
12
+ } from "./card";
13
+
14
+ export type * from "./card";
@@ -0,0 +1,95 @@
1
+ /* eslint-disable import/no-extraneous-dependencies -- storybook story */
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { DescriptionList } from ".";
4
+
5
+ type Story = StoryObj<typeof DescriptionList>;
6
+
7
+ const meta: Meta<typeof DescriptionList> = {
8
+ title: "Description List",
9
+ component: DescriptionList,
10
+ args: {
11
+ children: (
12
+ <>
13
+ <dt>Vekt</dt>
14
+ <dd>12 kg</dd>
15
+ <dt>Antall kolli</dt>
16
+ <dd>2</dd>
17
+ <dt>Sendingsnummer</dt>
18
+ <dd>7000001</dd>
19
+ <dt>Avsender</dt>
20
+ <dd>Fjellsport</dd>
21
+ </>
22
+ ),
23
+ },
24
+ };
25
+
26
+ export default meta;
27
+
28
+ export const Vertical: Story = { args: { variant: "vertical" } };
29
+ export const Horizontal: Story = { args: { variant: "horizontal" } };
30
+
31
+ export const WrappedInDivs: Story = {
32
+ args: {
33
+ children: (
34
+ <>
35
+ <div>
36
+ <dt>Vekt</dt>
37
+ <dd>12 kg</dd>
38
+ </div>
39
+ <div>
40
+ <dt>Antall kolli</dt>
41
+ <dd>2</dd>
42
+ </div>
43
+ <div>
44
+ <dt>Sendingsnummer</dt>
45
+ <dd>7000001</dd>
46
+ </div>
47
+ <div>
48
+ <dt>Avsender</dt>
49
+ <dd>Fjellsport</dd>
50
+ </div>
51
+ </>
52
+ ),
53
+ },
54
+ };
55
+
56
+ export const Paragraph: Story = {
57
+ name: "<p> tag as child",
58
+ args: {
59
+ variant: "horizontal",
60
+ children: (
61
+ <>
62
+ <dt>Vekt</dt>
63
+ <dd>12 kg</dd>
64
+ <dt>
65
+ <p>Title</p>
66
+ </dt>
67
+ <dd>
68
+ <p>Paragraph</p>
69
+ </dd>
70
+ </>
71
+ ),
72
+ },
73
+ };
74
+
75
+ export const HorizontalLongContent: Story = {
76
+ args: {
77
+ variant: "horizontal",
78
+ children: (
79
+ <>
80
+ <dt>Vekt</dt>
81
+ <dd>12 kg</dd>
82
+ <dt>
83
+ <p>Title</p>
84
+ </dt>
85
+ <dd>
86
+ <p>
87
+ ParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraphParagraph
88
+ </p>
89
+ </dd>
90
+ <dt>Avsender</dt>
91
+ <dd>Fjellsport</dd>
92
+ </>
93
+ ),
94
+ },
95
+ };
@@ -0,0 +1,61 @@
1
+ import { forwardRef, type HTMLAttributes, type ReactNode } from "react";
2
+ import { clsx } from "@postenbring/hedwig-css/typed-classname";
3
+
4
+ export interface DescriptionListProps extends HTMLAttributes<HTMLDListElement> {
5
+ /**
6
+ * Either `dt`, `dl`, or `div` elements
7
+ */
8
+ children?: ReactNode;
9
+ /**
10
+ * Direction of the description list
11
+ */
12
+ variant?: "vertical" | "horizontal";
13
+ }
14
+
15
+ /**
16
+ * Uses the HTML5 `<dl>` element
17
+ *
18
+ * Pass in corresponding `<dt>` and `<dd>` elements as children
19
+ *
20
+ * ```tsx
21
+ * <DescriptionList>
22
+ * <dt>Vekt</dt>
23
+ * <dd>12 kg</dd>
24
+ * <dt>Antall kolli</dt>
25
+ * <dd>2</dd>
26
+ * </DescriptionList>
27
+ * ```
28
+ *
29
+ * Optionally wrap them in `<div>` elements as allowed by the HTML5 spec
30
+ *
31
+ * ```tsx
32
+ * <DescriptionList>
33
+ * <div>
34
+ * <dt>Vekt</dt>
35
+ * <dd>12 kg</dd>
36
+ * </div>
37
+ * <div>
38
+ * <dt>Antall kolli</dt>
39
+ * <dd>2</dd>
40
+ * </div>
41
+ * </DescriptionList>
42
+ * ```
43
+ */
44
+ export const DescriptionList = forwardRef<HTMLDListElement, DescriptionListProps>(
45
+ ({ variant = "vertical", className, ...rest }, ref) => {
46
+ return (
47
+ <dl
48
+ ref={ref}
49
+ className={clsx(
50
+ "hds-description-list",
51
+ {
52
+ "hds-description-list--horizontal": variant === "horizontal",
53
+ },
54
+ className as undefined,
55
+ )}
56
+ {...rest}
57
+ />
58
+ );
59
+ },
60
+ );
61
+ DescriptionList.displayName = "DescriptionList";
@@ -0,0 +1,2 @@
1
+ export { DescriptionList } from "./description-list";
2
+ export type * from "./description-list";
@@ -0,0 +1,169 @@
1
+ import { forwardRef, type HTMLAttributes, type ReactElement } from "react";
2
+ import { clsx } from "@postenbring/hedwig-css/typed-classname";
3
+ import { Slot } from "@radix-ui/react-slot";
4
+ import { Accordion } from "../accordion";
5
+ import { LinkList } from "../list/link-list";
6
+ import { PrimaryButton } from "../button";
7
+
8
+ interface FooterLogoProps extends HTMLAttributes<HTMLDivElement> {
9
+ /**
10
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
11
+ *
12
+ * @default false
13
+ */
14
+ asChild?: boolean;
15
+ }
16
+
17
+ /**
18
+ * A fixed Posten or Bring logo.
19
+ *
20
+ * The logo follows the brand theme, so if the class `hds-theme-bring` is set the Bring logo will be shown instead of the Posten logo
21
+ */
22
+ export const FooterLogo = forwardRef<HTMLDivElement, FooterLogoProps>(
23
+ ({ children, className, asChild, ...rest }, ref) => {
24
+ const Component = asChild ? Slot : "div";
25
+ return (
26
+ <Component className={clsx(`hds-footer__logo`, className as undefined)} ref={ref} {...rest}>
27
+ {children}
28
+ </Component>
29
+ );
30
+ },
31
+ );
32
+ FooterLogo.displayName = "Footer.Logo";
33
+
34
+ export interface FooterButtonLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
35
+ /**
36
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
37
+ *
38
+ * @default false
39
+ */
40
+ asChild?: boolean;
41
+ }
42
+
43
+ /**
44
+ * 🚨 WORK IN PROGRESS 🚨
45
+ */
46
+ export const FooterButtonLink = forwardRef<HTMLAnchorElement, FooterButtonLinkProps>(
47
+ ({ children, className, asChild, ...rest }, ref) => {
48
+ const Component = asChild ? Slot : "a";
49
+ return (
50
+ <PrimaryButton asChild fill="outline" className={clsx(className as undefined)}>
51
+ <Component ref={ref} {...rest}>
52
+ {children}
53
+ </Component>
54
+ </PrimaryButton>
55
+ );
56
+ },
57
+ );
58
+ FooterButtonLink.displayName = "FooterButton";
59
+
60
+ interface FooterLinkSectionsProps extends HTMLAttributes<HTMLDivElement> {
61
+ children: ReactElement<FooterLinkSectionProps> | ReactElement<FooterLinkSectionProps>[];
62
+ }
63
+
64
+ /**
65
+ * Responsive sections of links. Will become an accordion on mobile.
66
+ *
67
+ * Use with {@link FooterLinkSection} for each section.
68
+ */
69
+ export const FooterLinkSections = forwardRef<HTMLDivElement, FooterLinkSectionsProps>(
70
+ ({ children, className, ...rest }, ref) => {
71
+ return (
72
+ <>
73
+ {/* Mobile and Desktop. The accordion styling gets removed on desktop */}
74
+ <Accordion
75
+ className={clsx("hds-footer__link-sections", className as undefined)}
76
+ ref={ref}
77
+ {...rest}
78
+ >
79
+ {/* @ts-expect-error -- It's ok */}
80
+ {children}
81
+ </Accordion>
82
+ </>
83
+ );
84
+ },
85
+ );
86
+ FooterLinkSections.displayName = "Footer.LinkSections";
87
+
88
+ interface FooterLinkSectionProps extends HTMLAttributes<HTMLDivElement> {
89
+ heading: React.ReactNode;
90
+ children: React.ReactNode;
91
+ }
92
+
93
+ export const FooterLinkSection = forwardRef<HTMLDivElement, FooterLinkSectionProps>(
94
+ ({ heading, children, className, ...rest }, ref) => {
95
+ // @ts-expect-error -- It's ok
96
+ const linkListChildren = <LinkList>{children}</LinkList>;
97
+ return (
98
+ <>
99
+ {/* Mobile */}
100
+ <Accordion.Item
101
+ className={clsx(`hds-footer__link-section`, className as undefined)}
102
+ ref={ref}
103
+ {...rest}
104
+ >
105
+ <Accordion.Header>{heading}</Accordion.Header>
106
+ <Accordion.Content>{linkListChildren}</Accordion.Content>
107
+ </Accordion.Item>
108
+
109
+ {/* Desktop */}
110
+ <div className={clsx(`hds-footer__link-section`, className as undefined)}>
111
+ <h2>{heading}</h2>
112
+ {linkListChildren}
113
+ </div>
114
+ </>
115
+ );
116
+ },
117
+ );
118
+ FooterLinkSection.displayName = "Footer.LinkSection";
119
+
120
+ export interface FooterProps extends HTMLAttributes<HTMLDivElement> {
121
+ /**
122
+ * Footer variant
123
+ *
124
+ * @default "default"
125
+ */
126
+ variant?: "default" | "slim";
127
+
128
+ /**
129
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
130
+ *
131
+ * @default false
132
+ */
133
+ asChild?: boolean;
134
+ }
135
+
136
+ /**
137
+ * 🚨 WORK IN PROGRESS 🚨
138
+ */
139
+ export const Footer = forwardRef<HTMLDivElement, FooterProps>(
140
+ ({ children, className, variant, asChild, ...rest }, ref) => {
141
+ const Component = asChild ? Slot : "footer";
142
+ return (
143
+ <Component
144
+ className={clsx(
145
+ `hds-footer`,
146
+ variant === "slim" && "hds-footer--slim",
147
+ className as undefined,
148
+ )}
149
+ ref={ref}
150
+ {...rest}
151
+ >
152
+ {children}
153
+ </Component>
154
+ );
155
+ },
156
+ ) as FooterType;
157
+ Footer.displayName = "Footer";
158
+
159
+ type FooterType = ReturnType<typeof forwardRef<HTMLDivElement, FooterProps>> & {
160
+ Logo: typeof FooterLogo;
161
+ ButtonLink: typeof FooterButtonLink;
162
+ LinkSections: typeof FooterLinkSections;
163
+ LinkSection: typeof FooterLinkSection;
164
+ };
165
+
166
+ Footer.Logo = FooterLogo;
167
+ Footer.ButtonLink = FooterButtonLink;
168
+ Footer.LinkSections = FooterLinkSections;
169
+ Footer.LinkSection = FooterLinkSection;
@@ -0,0 +1,9 @@
1
+ export {
2
+ Footer,
3
+ FooterLogo,
4
+ FooterButtonLink,
5
+ FooterLinkSections,
6
+ FooterLinkSection,
7
+ } from "./footer";
8
+
9
+ export type * from "./footer";
@@ -0,0 +1,104 @@
1
+ /* eslint-disable import/no-extraneous-dependencies -- storybook story */
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { Fieldset } from "../fieldset";
4
+ import { VStack } from "../../layout";
5
+ import { Checkbox } from "./index";
6
+
7
+ const meta: Meta<typeof Checkbox> = {
8
+ title: "Form/Checkbox",
9
+ component: Checkbox,
10
+ };
11
+
12
+ export default meta;
13
+
14
+ type Story = StoryObj<typeof Checkbox>;
15
+
16
+ export const JustACheckbox: Story = {
17
+ name: "Just a checkbox",
18
+ args: {
19
+ title: "",
20
+ children: "Just a checkbox",
21
+ checked: true,
22
+ errorMessage: "",
23
+ variant: "plain",
24
+ onChange: () => {
25
+ /**/
26
+ },
27
+ },
28
+ argTypes: {
29
+ variant: { control: "inline-radio", options: ["plain", "bounding-box"] },
30
+ },
31
+ };
32
+
33
+ export const PlainCheckboxes: Story = {
34
+ name: "Checkboxes",
35
+ render: (_props) => (
36
+ <Fieldset legend="Checkboxes should be grouped in a Fieldset">
37
+ <Checkbox>This is a checkbox</Checkbox>
38
+ <Checkbox>This is another checkbox</Checkbox>
39
+ </Fieldset>
40
+ ),
41
+ };
42
+
43
+ export const PlainCheckboxesWithError: Story = {
44
+ name: "Checkboxes with error",
45
+ render: (_props) => (
46
+ <Fieldset
47
+ legend="Fieldset will aid you with styling and aria when it is provided an error message"
48
+ errorMessage="Something is wrong"
49
+ >
50
+ <Checkbox>This is a checkbox</Checkbox>
51
+ <Checkbox>This is another checkbox</Checkbox>
52
+ </Fieldset>
53
+ ),
54
+ };
55
+
56
+ export const PlainCheckboxeWithError: Story = {
57
+ name: "Standalone checkbox with error message",
58
+ args: {
59
+ errorMessage: "Something is wrong",
60
+ children: "This is a checkbox with an error message",
61
+ },
62
+ };
63
+
64
+ export const BoundedCheckbox: Story = {
65
+ name: "Checkbox with bounding box",
66
+ render: (_props) => (
67
+ <VStack gap="8">
68
+ <Checkbox variant="bounding-box">This is a checkbox with bounding box</Checkbox>
69
+ <Checkbox errorMessage="Something is wrong" variant="bounding-box">
70
+ This is a checkbox with bounding box and error
71
+ </Checkbox>
72
+ </VStack>
73
+ ),
74
+ };
75
+
76
+ export const DetailedContentCheckbox: Story = {
77
+ name: "Checkbox with title",
78
+ render: (_props) => (
79
+ <VStack gap="8">
80
+ <Checkbox title="Check this box">Detailed description if needed</Checkbox>
81
+ <Checkbox errorMessage="Something is wrong" title="Checkbox with error">
82
+ Detailed description if needed
83
+ </Checkbox>
84
+ </VStack>
85
+ ),
86
+ };
87
+
88
+ export const DetailedContentCheckboxWithBoundingBox: Story = {
89
+ name: "Checkbox with bounding box and title",
90
+ render: (_props) => (
91
+ <VStack gap="8">
92
+ <Checkbox title="Check this box" variant="bounding-box">
93
+ Detailed description if needed
94
+ </Checkbox>
95
+ <Checkbox
96
+ errorMessage="Something is wrong"
97
+ title="Checkbox with error"
98
+ variant="bounding-box"
99
+ >
100
+ Detailed description if needed
101
+ </Checkbox>
102
+ </VStack>
103
+ ),
104
+ };