@postenbring/hedwig-react 0.0.81 → 0.0.83

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 (580) 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-header.d.ts +6 -2
  4. package/dist/accordion/accordion-header.d.ts.map +1 -0
  5. package/dist/accordion/accordion-item.d.ts +24 -3
  6. package/dist/accordion/accordion-item.d.ts.map +1 -0
  7. package/dist/accordion/accordion.d.ts +44 -2
  8. package/dist/accordion/accordion.d.ts.map +1 -0
  9. package/dist/accordion/accordion.js +102 -4
  10. package/dist/accordion/accordion.js.map +1 -1
  11. package/dist/accordion/accordion.mjs +5 -1
  12. package/dist/accordion/context.d.ts +7 -2
  13. package/dist/accordion/context.d.ts.map +1 -0
  14. package/dist/accordion/index.d.ts +9 -9
  15. package/dist/accordion/index.d.ts.map +1 -0
  16. package/dist/accordion/index.js +52 -53
  17. package/dist/accordion/index.js.map +1 -1
  18. package/dist/accordion/index.mjs +7 -7
  19. package/dist/badge/badge.d.ts +21 -5
  20. package/dist/badge/badge.d.ts.map +1 -0
  21. package/dist/badge/index.d.ts +3 -6
  22. package/dist/badge/index.d.ts.map +1 -0
  23. package/dist/box/box.d.ts +50 -4
  24. package/dist/box/box.d.ts.map +1 -0
  25. package/dist/box/box.js +15 -14
  26. package/dist/box/box.js.map +1 -1
  27. package/dist/box/box.mjs +1 -1
  28. package/dist/box/index.d.ts +3 -4
  29. package/dist/box/index.d.ts.map +1 -0
  30. package/dist/box/index.js +16 -19
  31. package/dist/box/index.js.map +1 -1
  32. package/dist/box/index.mjs +4 -5
  33. package/dist/breadcrumbs/breadcrumbs.d.ts +33 -2
  34. package/dist/breadcrumbs/breadcrumbs.d.ts.map +1 -0
  35. package/dist/breadcrumbs/index.d.ts +3 -2
  36. package/dist/breadcrumbs/index.d.ts.map +1 -0
  37. package/dist/button/button.d.ts +33 -3
  38. package/dist/button/button.d.ts.map +1 -0
  39. package/dist/button/index.d.ts +3 -3
  40. package/dist/button/index.d.ts.map +1 -0
  41. package/dist/card/card.d.ts +69 -12
  42. package/dist/card/card.d.ts.map +1 -0
  43. package/dist/card/card.js +17 -6
  44. package/dist/card/card.js.map +1 -1
  45. package/dist/card/card.mjs +1 -1
  46. package/dist/card/index.d.ts +3 -12
  47. package/dist/card/index.d.ts.map +1 -0
  48. package/dist/card/index.js +18 -19
  49. package/dist/card/index.js.map +1 -1
  50. package/dist/card/index.mjs +4 -5
  51. package/dist/{chunk-6R7AXKBR.mjs → chunk-35TXKAUH.mjs} +2 -2
  52. package/dist/chunk-35TXKAUH.mjs.map +1 -0
  53. package/dist/{chunk-XC3UHH2U.mjs → chunk-3WVRY6CC.mjs} +4 -4
  54. package/dist/{chunk-XC3UHH2U.mjs.map → chunk-3WVRY6CC.mjs.map} +1 -1
  55. package/dist/{chunk-67TP3E2D.mjs → chunk-6FBPKLWB.mjs} +3 -3
  56. package/dist/chunk-6FBPKLWB.mjs.map +1 -0
  57. package/dist/chunk-7YWW46R3.mjs +1 -0
  58. package/dist/{chunk-ENKVTAJB.mjs → chunk-AJWSQEDP.mjs} +18 -17
  59. package/dist/chunk-AJWSQEDP.mjs.map +1 -0
  60. package/dist/chunk-ARHJZUZG.mjs +1 -0
  61. package/dist/{chunk-4WQWU5TL.mjs → chunk-AXQCREUJ.mjs} +2 -2
  62. package/dist/chunk-AXQCREUJ.mjs.map +1 -0
  63. package/dist/chunk-BCFV6VOE.mjs +1 -0
  64. package/dist/{chunk-F2C3KZFX.mjs → chunk-BVPSZ3JI.mjs} +2 -2
  65. package/dist/chunk-BVPSZ3JI.mjs.map +1 -0
  66. package/dist/{chunk-7JRS4WEB.mjs → chunk-C34HEQXO.mjs} +33 -29
  67. package/dist/chunk-C34HEQXO.mjs.map +1 -0
  68. package/dist/chunk-CYDWEPFL.mjs +1 -0
  69. package/dist/{chunk-PLXB3TNA.mjs → chunk-D7QPJIUZ.mjs} +5 -5
  70. package/dist/{chunk-PLXB3TNA.mjs.map → chunk-D7QPJIUZ.mjs.map} +1 -1
  71. package/dist/{chunk-GSJPTZT3.mjs → chunk-FC4CEI2V.mjs} +34 -19
  72. package/dist/chunk-FC4CEI2V.mjs.map +1 -0
  73. package/dist/chunk-FYFJ75NX.mjs +1 -0
  74. package/dist/chunk-FYFJ75NX.mjs.map +1 -0
  75. package/dist/chunk-G65EYZFQ.mjs +1 -0
  76. package/dist/chunk-G65EYZFQ.mjs.map +1 -0
  77. package/dist/chunk-H3E546OT.mjs +1 -0
  78. package/dist/chunk-H3E546OT.mjs.map +1 -0
  79. package/dist/chunk-HQVL3ZJ2.mjs +1 -0
  80. package/dist/chunk-HQVL3ZJ2.mjs.map +1 -0
  81. package/dist/{chunk-KPGSRU4I.mjs → chunk-M3Y3XOGC.mjs} +13 -1
  82. package/dist/chunk-M3Y3XOGC.mjs.map +1 -0
  83. package/dist/{chunk-CIHZDFSQ.mjs → chunk-NU6OSFAU.mjs} +20 -9
  84. package/dist/chunk-NU6OSFAU.mjs.map +1 -0
  85. package/dist/{chunk-XUWZ4HGD.mjs → chunk-OGZ2NBMH.mjs} +49 -46
  86. package/dist/chunk-OGZ2NBMH.mjs.map +1 -0
  87. package/dist/{chunk-3MQKXNZ6.mjs → chunk-QZZIOBF4.mjs} +13 -1
  88. package/dist/chunk-QZZIOBF4.mjs.map +1 -0
  89. package/dist/chunk-RC76SXBP.mjs +1 -0
  90. package/dist/chunk-RC76SXBP.mjs.map +1 -0
  91. package/dist/{chunk-TQDUBRCZ.mjs → chunk-SQ63E7KM.mjs} +24 -22
  92. package/dist/chunk-SQ63E7KM.mjs.map +1 -0
  93. package/dist/{chunk-DEX36MFK.mjs → chunk-TDXU2IC6.mjs} +3 -4
  94. package/dist/chunk-TDXU2IC6.mjs.map +1 -0
  95. package/dist/{chunk-ES6ISHOV.mjs → chunk-UP3M3NEZ.mjs} +14 -13
  96. package/dist/{chunk-ES6ISHOV.mjs.map → chunk-UP3M3NEZ.mjs.map} +1 -1
  97. package/dist/chunk-ZKMFJZSH.mjs +1 -0
  98. package/dist/chunk-ZKMFJZSH.mjs.map +1 -0
  99. package/dist/description-list/description-list.d.ts +42 -2
  100. package/dist/description-list/description-list.d.ts.map +1 -0
  101. package/dist/description-list/index.d.ts +3 -2
  102. package/dist/description-list/index.d.ts.map +1 -0
  103. package/dist/footer/footer.d.ts +67 -7
  104. package/dist/footer/footer.d.ts.map +1 -0
  105. package/dist/footer/footer.js +79 -76
  106. package/dist/footer/footer.js.map +1 -1
  107. package/dist/footer/footer.mjs +4 -4
  108. package/dist/footer/index.d.ts +3 -7
  109. package/dist/footer/index.d.ts.map +1 -0
  110. package/dist/footer/index.js +80 -84
  111. package/dist/footer/index.js.map +1 -1
  112. package/dist/footer/index.mjs +7 -8
  113. package/dist/form/checkbox/checkbox.d.ts +28 -2
  114. package/dist/form/checkbox/checkbox.d.ts.map +1 -0
  115. package/dist/form/checkbox/index.d.ts +3 -2
  116. package/dist/form/checkbox/index.d.ts.map +1 -0
  117. package/dist/form/date-picker/date-picker.d.ts +33 -2
  118. package/dist/form/date-picker/date-picker.d.ts.map +1 -0
  119. package/dist/form/date-picker/date-picker.js +1 -1
  120. package/dist/form/date-picker/date-picker.js.map +1 -1
  121. package/dist/form/date-picker/date-picker.mjs +2 -2
  122. package/dist/form/date-picker/index.d.ts +3 -2
  123. package/dist/form/date-picker/index.d.ts.map +1 -0
  124. package/dist/form/date-picker/index.js +1 -1
  125. package/dist/form/date-picker/index.js.map +1 -1
  126. package/dist/form/date-picker/index.mjs +2 -2
  127. package/dist/form/error-message/error-message.d.ts +8 -2
  128. package/dist/form/error-message/error-message.d.ts.map +1 -0
  129. package/dist/form/error-message/index.d.ts +3 -2
  130. package/dist/form/error-message/index.d.ts.map +1 -0
  131. package/dist/form/fieldset/fieldset.d.ts +22 -3
  132. package/dist/form/fieldset/fieldset.d.ts.map +1 -0
  133. package/dist/form/fieldset/index.d.ts +3 -3
  134. package/dist/form/fieldset/index.d.ts.map +1 -0
  135. package/dist/form/index.d.ts +9 -20
  136. package/dist/form/index.d.ts.map +1 -0
  137. package/dist/form/index.js +1 -1
  138. package/dist/form/index.js.map +1 -1
  139. package/dist/form/index.mjs +2 -2
  140. package/dist/form/input/index.d.ts +3 -2
  141. package/dist/form/input/index.d.ts.map +1 -0
  142. package/dist/form/input/input.d.ts +5 -2
  143. package/dist/form/input/input.d.ts.map +1 -0
  144. package/dist/form/input-group/index.d.ts +3 -2
  145. package/dist/form/input-group/index.d.ts.map +1 -0
  146. package/dist/form/input-group/input-group.d.ts +27 -2
  147. package/dist/form/input-group/input-group.d.ts.map +1 -0
  148. package/dist/form/radiobutton/index.d.ts +5 -5
  149. package/dist/form/radiobutton/index.d.ts.map +1 -0
  150. package/dist/form/radiobutton/radiobutton.d.ts +17 -2
  151. package/dist/form/radiobutton/radiobutton.d.ts.map +1 -0
  152. package/dist/form/radiobutton/radiogroup.d.ts +24 -3
  153. package/dist/form/radiobutton/radiogroup.d.ts.map +1 -0
  154. package/dist/form/select/index.d.ts +3 -2
  155. package/dist/form/select/index.d.ts.map +1 -0
  156. package/dist/form/select/select.d.ts +9 -2
  157. package/dist/form/select/select.d.ts.map +1 -0
  158. package/dist/form/textarea/index.d.ts +3 -2
  159. package/dist/form/textarea/index.d.ts.map +1 -0
  160. package/dist/form/textarea/textarea.d.ts +5 -2
  161. package/dist/form/textarea/textarea.d.ts.map +1 -0
  162. package/dist/help-text/help-text.d.ts +51 -1
  163. package/dist/help-text/help-text.d.ts.map +1 -0
  164. package/dist/help-text/help-text.js +17 -20
  165. package/dist/help-text/help-text.js.map +1 -1
  166. package/dist/help-text/help-text.mjs +3 -3
  167. package/dist/help-text/index.d.ts +3 -1
  168. package/dist/help-text/index.d.ts.map +1 -0
  169. package/dist/help-text/index.js +17 -20
  170. package/dist/help-text/index.js.map +1 -1
  171. package/dist/help-text/index.mjs +3 -3
  172. package/dist/index-no-css.d.ts +26 -128
  173. package/dist/index-no-css.d.ts.map +1 -0
  174. package/dist/index-no-css.js +385 -398
  175. package/dist/index-no-css.js.map +1 -1
  176. package/dist/index-no-css.mjs +70 -68
  177. package/dist/index.d.ts +11 -128
  178. package/dist/index.d.ts.map +1 -0
  179. package/dist/index.js +385 -398
  180. package/dist/index.js.map +1 -1
  181. package/dist/index.mjs +70 -68
  182. package/dist/index.mjs.map +1 -1
  183. package/dist/layout/container/container.d.ts +23 -2
  184. package/dist/layout/container/container.d.ts.map +1 -0
  185. package/dist/layout/grid/grid.d.ts +101 -4
  186. package/dist/layout/grid/grid.d.ts.map +1 -0
  187. package/dist/layout/grid/grid.js +11 -10
  188. package/dist/layout/grid/grid.js.map +1 -1
  189. package/dist/layout/grid/grid.mjs +1 -1
  190. package/dist/layout/grid/index.d.ts +3 -4
  191. package/dist/layout/grid/index.d.ts.map +1 -0
  192. package/dist/layout/grid/index.js +12 -15
  193. package/dist/layout/grid/index.js.map +1 -1
  194. package/dist/layout/grid/index.mjs +4 -5
  195. package/dist/layout/index.d.ts +4 -10
  196. package/dist/layout/index.d.ts.map +1 -0
  197. package/dist/layout/index.js +12 -15
  198. package/dist/layout/index.js.map +1 -1
  199. package/dist/layout/index.mjs +4 -5
  200. package/dist/layout/responsive.d.ts +10 -2
  201. package/dist/layout/responsive.d.ts.map +1 -0
  202. package/dist/layout/spacing.d.ts +33 -3
  203. package/dist/layout/spacing.d.ts.map +1 -0
  204. package/dist/layout/stack/index.d.ts +3 -4
  205. package/dist/layout/stack/index.d.ts.map +1 -0
  206. package/dist/layout/stack/stack.d.ts +62 -4
  207. package/dist/layout/stack/stack.d.ts.map +1 -0
  208. package/dist/link/index.d.ts +3 -2
  209. package/dist/link/index.d.ts.map +1 -0
  210. package/dist/link/link.d.ts +20 -2
  211. package/dist/link/link.d.ts.map +1 -0
  212. package/dist/list/index.d.ts +5 -5
  213. package/dist/list/index.d.ts.map +1 -0
  214. package/dist/list/link-list.d.ts +12 -2
  215. package/dist/list/link-list.d.ts.map +1 -0
  216. package/dist/list/list.d.ts +40 -3
  217. package/dist/list/list.d.ts.map +1 -0
  218. package/dist/message/index.d.ts +3 -3
  219. package/dist/message/index.d.ts.map +1 -0
  220. package/dist/message/index.js +36 -38
  221. package/dist/message/index.js.map +1 -1
  222. package/dist/message/index.mjs +5 -6
  223. package/dist/message/message.d.ts +36 -4
  224. package/dist/message/message.d.ts.map +1 -0
  225. package/dist/message/message.js +35 -32
  226. package/dist/message/message.js.map +1 -1
  227. package/dist/message/message.mjs +2 -2
  228. package/dist/modal/index.d.ts +3 -5
  229. package/dist/modal/index.d.ts.map +1 -0
  230. package/dist/modal/index.js +61 -63
  231. package/dist/modal/index.js.map +1 -1
  232. package/dist/modal/index.mjs +6 -7
  233. package/dist/modal/modal.d.ts +81 -5
  234. package/dist/modal/modal.d.ts.map +1 -0
  235. package/dist/modal/modal.js +60 -56
  236. package/dist/modal/modal.js.map +1 -1
  237. package/dist/modal/modal.mjs +3 -3
  238. package/dist/navbar/icons.d.ts +3 -2
  239. package/dist/navbar/icons.d.ts.map +1 -0
  240. package/dist/navbar/index.d.ts +4 -13
  241. package/dist/navbar/index.d.ts.map +1 -0
  242. package/dist/navbar/index.js +145 -146
  243. package/dist/navbar/index.js.map +1 -1
  244. package/dist/navbar/index.mjs +6 -7
  245. package/dist/navbar/navbar-expandable-menu.d.ts +35 -7
  246. package/dist/navbar/navbar-expandable-menu.d.ts.map +1 -0
  247. package/dist/navbar/navbar-expandable-menu.js +1 -1
  248. package/dist/navbar/navbar-expandable-menu.js.map +1 -1
  249. package/dist/navbar/navbar-expandable-menu.mjs +2 -2
  250. package/dist/navbar/navbar.d.ts +130 -9
  251. package/dist/navbar/navbar.d.ts.map +1 -0
  252. package/dist/navbar/navbar.js +237 -28
  253. package/dist/navbar/navbar.js.map +1 -1
  254. package/dist/navbar/navbar.mjs +4 -1
  255. package/dist/show-more/index.d.ts +5 -4
  256. package/dist/show-more/index.d.ts.map +1 -0
  257. package/dist/show-more/index.js +3 -3
  258. package/dist/show-more/index.js.map +1 -1
  259. package/dist/show-more/index.mjs +2 -2
  260. package/dist/show-more/show-more.d.ts +42 -2
  261. package/dist/show-more/show-more.d.ts.map +1 -0
  262. package/dist/skeleton/index.d.ts +3 -2
  263. package/dist/skeleton/index.d.ts.map +1 -0
  264. package/dist/skeleton/skeleton.d.ts +67 -2
  265. package/dist/skeleton/skeleton.d.ts.map +1 -0
  266. package/dist/step-indicator/index.d.ts +3 -1
  267. package/dist/step-indicator/index.d.ts.map +1 -0
  268. package/dist/step-indicator/step-indicator.d.ts +36 -1
  269. package/dist/step-indicator/step-indicator.d.ts.map +1 -0
  270. package/dist/styled-html/index.d.ts +3 -2
  271. package/dist/styled-html/index.d.ts.map +1 -0
  272. package/dist/styled-html/styled-html.d.ts +36 -2
  273. package/dist/styled-html/styled-html.d.ts.map +1 -0
  274. package/dist/table/index.d.ts +3 -1
  275. package/dist/table/index.d.ts.map +1 -0
  276. package/dist/table/table.d.ts +25 -1
  277. package/dist/table/table.d.ts.map +1 -0
  278. package/dist/tabs/context.d.ts +8 -3
  279. package/dist/tabs/context.d.ts.map +1 -0
  280. package/dist/tabs/index.d.ts +7 -10
  281. package/dist/tabs/index.d.ts.map +1 -0
  282. package/dist/tabs/index.js +35 -38
  283. package/dist/tabs/index.js.map +1 -1
  284. package/dist/tabs/index.mjs +6 -6
  285. package/dist/tabs/tabs-content.d.ts +26 -4
  286. package/dist/tabs/tabs-content.d.ts.map +1 -0
  287. package/dist/tabs/tabs-list.d.ts +21 -4
  288. package/dist/tabs/tabs-list.d.ts.map +1 -0
  289. package/dist/tabs/tabs-list.js +1 -1
  290. package/dist/tabs/tabs-list.js.map +1 -1
  291. package/dist/tabs/tabs-list.mjs +2 -2
  292. package/dist/tabs/tabs.d.ts +26 -2
  293. package/dist/tabs/tabs.d.ts.map +1 -0
  294. package/dist/tabs/tabs.js +205 -8
  295. package/dist/tabs/tabs.js.map +1 -1
  296. package/dist/tabs/tabs.mjs +4 -1
  297. package/dist/text/index.d.ts +4 -2
  298. package/dist/text/index.d.ts.map +1 -0
  299. package/dist/text/text.d.ts +58 -2
  300. package/dist/text/text.d.ts.map +1 -0
  301. package/dist/utils/auto-animate-height.d.ts +33 -0
  302. package/dist/utils/auto-animate-height.d.ts.map +1 -0
  303. package/dist/{utilities → utils}/auto-animate-height.js +3 -3
  304. package/dist/utils/auto-animate-height.js.map +1 -0
  305. package/dist/utils/auto-animate-height.mjs +9 -0
  306. package/dist/utils/auto-animate-height.mjs.map +1 -0
  307. package/dist/utils/index.d.ts +4 -0
  308. package/dist/utils/index.d.ts.map +1 -0
  309. package/dist/{utilities → utils}/index.js +81 -11
  310. package/dist/utils/index.js.map +1 -0
  311. package/dist/utils/index.mjs +19 -0
  312. package/dist/utils/index.mjs.map +1 -0
  313. package/dist/utils/utils.d.ts +24 -0
  314. package/dist/utils/utils.d.ts.map +1 -0
  315. package/dist/{utils.js → utils/utils.js} +1 -3
  316. package/dist/utils/utils.js.map +1 -0
  317. package/dist/utils/utils.mjs +14 -0
  318. package/dist/utils/utils.mjs.map +1 -0
  319. package/dist/warning-banner/index.d.ts +3 -2
  320. package/dist/warning-banner/index.d.ts.map +1 -0
  321. package/dist/warning-banner/index.js +16 -19
  322. package/dist/warning-banner/index.js.map +1 -1
  323. package/dist/warning-banner/index.mjs +3 -3
  324. package/dist/warning-banner/warning-banner.d.ts +8 -2
  325. package/dist/warning-banner/warning-banner.d.ts.map +1 -0
  326. package/dist/warning-banner/warning-banner.js +16 -19
  327. package/dist/warning-banner/warning-banner.js.map +1 -1
  328. package/dist/warning-banner/warning-banner.mjs +3 -3
  329. package/package.json +12 -8
  330. package/src/accordion/accordion-content.tsx +31 -0
  331. package/src/accordion/accordion-header.tsx +36 -0
  332. package/src/accordion/accordion-item.tsx +62 -0
  333. package/src/accordion/accordion.stories.tsx +154 -0
  334. package/src/accordion/accordion.tsx +68 -0
  335. package/src/accordion/context.ts +8 -0
  336. package/src/accordion/index.tsx +9 -0
  337. package/src/badge/badge.stories.tsx +44 -0
  338. package/src/badge/badge.tsx +63 -0
  339. package/src/badge/index.tsx +3 -0
  340. package/src/box/box.stories.tsx +112 -0
  341. package/src/box/box.tsx +122 -0
  342. package/src/box/index.tsx +3 -0
  343. package/src/breadcrumbs/breadcrumbs.stories.tsx +50 -0
  344. package/src/breadcrumbs/breadcrumbs.tsx +47 -0
  345. package/src/breadcrumbs/index.tsx +3 -0
  346. package/src/button/button.stories.tsx +104 -0
  347. package/src/button/button.tsx +87 -0
  348. package/src/button/index.tsx +3 -0
  349. package/src/card/card.stories.tsx +82 -0
  350. package/src/card/card.tsx +222 -0
  351. package/src/card/index.tsx +14 -0
  352. package/src/description-list/description-list.stories.tsx +95 -0
  353. package/src/description-list/description-list.tsx +61 -0
  354. package/src/description-list/index.tsx +2 -0
  355. package/src/footer/footer.tsx +169 -0
  356. package/src/footer/index.tsx +9 -0
  357. package/src/form/checkbox/checkbox.stories.tsx +104 -0
  358. package/src/form/checkbox/checkbox.tsx +82 -0
  359. package/src/form/checkbox/index.tsx +2 -0
  360. package/src/form/date-picker/date-picker.stories.tsx +27 -0
  361. package/src/form/date-picker/date-picker.tsx +85 -0
  362. package/src/form/date-picker/index.tsx +2 -0
  363. package/src/form/error-message/error-message.stories.tsx +19 -0
  364. package/src/form/error-message/error-message.tsx +25 -0
  365. package/src/form/error-message/index.tsx +2 -0
  366. package/src/form/fieldset/fieldset.stories.tsx +86 -0
  367. package/src/form/fieldset/fieldset.tsx +64 -0
  368. package/src/form/fieldset/index.tsx +2 -0
  369. package/src/form/index.tsx +8 -0
  370. package/src/form/input/index.tsx +2 -0
  371. package/src/form/input/input.stories.tsx +166 -0
  372. package/src/form/input/input.tsx +30 -0
  373. package/src/form/input-group/index.tsx +2 -0
  374. package/src/form/input-group/input-group.tsx +106 -0
  375. package/src/form/radiobutton/index.tsx +4 -0
  376. package/src/form/radiobutton/radiobutton.stories.tsx +93 -0
  377. package/src/form/radiobutton/radiobutton.tsx +85 -0
  378. package/src/form/radiobutton/radiogroup.stories.tsx +39 -0
  379. package/src/form/radiobutton/radiogroup.tsx +52 -0
  380. package/src/form/select/index.tsx +2 -0
  381. package/src/form/select/select.stories.tsx +93 -0
  382. package/src/form/select/select.tsx +33 -0
  383. package/src/form/textarea/index.tsx +2 -0
  384. package/src/form/textarea/textarea.stories.tsx +106 -0
  385. package/src/form/textarea/textarea.tsx +33 -0
  386. package/src/help-text/help-text.tsx +98 -0
  387. package/src/help-text/index.ts +2 -0
  388. package/src/index-no-css.tsx +25 -0
  389. package/src/index.tsx +11 -0
  390. package/src/layout/container/container.stories.tsx +62 -0
  391. package/src/layout/container/container.tsx +47 -0
  392. package/src/layout/grid/grid.tsx +163 -0
  393. package/src/layout/grid/index.tsx +3 -0
  394. package/src/layout/index.tsx +3 -0
  395. package/src/layout/responsive.ts +26 -0
  396. package/src/layout/spacing.ts +37 -0
  397. package/src/layout/stack/index.tsx +2 -0
  398. package/src/layout/stack/stack.tsx +128 -0
  399. package/src/link/index.tsx +3 -0
  400. package/src/link/link.stories.tsx +64 -0
  401. package/src/link/link.tsx +46 -0
  402. package/src/list/index.tsx +5 -0
  403. package/src/list/link-list.stories.tsx +38 -0
  404. package/src/list/link-list.tsx +26 -0
  405. package/src/list/list.stories.tsx +71 -0
  406. package/src/list/list.tsx +65 -0
  407. package/src/message/index.tsx +2 -0
  408. package/src/message/message.stories.tsx +93 -0
  409. package/src/message/message.tsx +89 -0
  410. package/src/modal/index.tsx +3 -0
  411. package/src/modal/modal.stories.tsx +147 -0
  412. package/src/modal/modal.tsx +199 -0
  413. package/src/navbar/icons.tsx +21 -0
  414. package/src/navbar/index.tsx +18 -0
  415. package/src/navbar/navbar-expandable-menu.tsx +176 -0
  416. package/src/navbar/navbar.stories.tsx +99 -0
  417. package/src/navbar/navbar.tsx +264 -0
  418. package/src/show-more/index.ts +5 -0
  419. package/src/show-more/show-more.stories.tsx +119 -0
  420. package/src/show-more/show-more.tsx +66 -0
  421. package/src/skeleton/index.ts +2 -0
  422. package/src/skeleton/skeleton.stories.tsx +152 -0
  423. package/src/skeleton/skeleton.tsx +114 -0
  424. package/src/step-indicator/index.ts +2 -0
  425. package/src/step-indicator/step-indicator.stories.tsx +50 -0
  426. package/src/step-indicator/step-indicator.tsx +116 -0
  427. package/src/styled-html/index.ts +2 -0
  428. package/src/styled-html/styled-html.stories.tsx +189 -0
  429. package/src/styled-html/styled-html.tsx +59 -0
  430. package/src/table/index.ts +2 -0
  431. package/src/table/table.tsx +59 -0
  432. package/src/tabs/context.ts +18 -0
  433. package/src/tabs/index.tsx +7 -0
  434. package/src/tabs/tabs-content.tsx +62 -0
  435. package/src/tabs/tabs-list.tsx +129 -0
  436. package/src/tabs/tabs.stories.tsx +138 -0
  437. package/src/tabs/tabs.tsx +50 -0
  438. package/src/text/index.tsx +4 -0
  439. package/src/text/text.stories.tsx +112 -0
  440. package/src/text/text.tsx +129 -0
  441. package/src/utils/auto-animate-height.tsx +139 -0
  442. package/src/utils/index.ts +4 -0
  443. package/src/utils/utils.ts +110 -0
  444. package/src/warning-banner/index.tsx +2 -0
  445. package/src/warning-banner/warning-banner.stories.tsx +43 -0
  446. package/src/warning-banner/warning-banner.tsx +79 -0
  447. package/dist/_tsup-dts-rollup.d.mts +0 -2600
  448. package/dist/_tsup-dts-rollup.d.ts +0 -2600
  449. package/dist/accordion/accordion-content.d.mts +0 -2
  450. package/dist/accordion/accordion-header.d.mts +0 -2
  451. package/dist/accordion/accordion-item.d.mts +0 -3
  452. package/dist/accordion/accordion.d.mts +0 -2
  453. package/dist/accordion/context.d.mts +0 -2
  454. package/dist/accordion/index.d.mts +0 -9
  455. package/dist/badge/badge.d.mts +0 -5
  456. package/dist/badge/index.d.mts +0 -6
  457. package/dist/box/box.d.mts +0 -4
  458. package/dist/box/index.d.mts +0 -4
  459. package/dist/breadcrumbs/breadcrumbs.d.mts +0 -2
  460. package/dist/breadcrumbs/index.d.mts +0 -2
  461. package/dist/button/button.d.mts +0 -3
  462. package/dist/button/index.d.mts +0 -3
  463. package/dist/card/card.d.mts +0 -12
  464. package/dist/card/index.d.mts +0 -12
  465. package/dist/chunk-3MQKXNZ6.mjs.map +0 -1
  466. package/dist/chunk-3NDUE23B.mjs +0 -19
  467. package/dist/chunk-3NDUE23B.mjs.map +0 -1
  468. package/dist/chunk-3NL3TOZF.mjs +0 -13
  469. package/dist/chunk-3NL3TOZF.mjs.map +0 -1
  470. package/dist/chunk-3ZFEUABU.mjs +0 -23
  471. package/dist/chunk-3ZFEUABU.mjs.map +0 -1
  472. package/dist/chunk-4WQWU5TL.mjs.map +0 -1
  473. package/dist/chunk-67TP3E2D.mjs.map +0 -1
  474. package/dist/chunk-6R7AXKBR.mjs.map +0 -1
  475. package/dist/chunk-722MZPXO.mjs +0 -13
  476. package/dist/chunk-722MZPXO.mjs.map +0 -1
  477. package/dist/chunk-7JRS4WEB.mjs.map +0 -1
  478. package/dist/chunk-CIHZDFSQ.mjs.map +0 -1
  479. package/dist/chunk-CYEYGPRH.mjs +0 -17
  480. package/dist/chunk-CYEYGPRH.mjs.map +0 -1
  481. package/dist/chunk-DEX36MFK.mjs.map +0 -1
  482. package/dist/chunk-DZNH5JHY.mjs +0 -1
  483. package/dist/chunk-ENKVTAJB.mjs.map +0 -1
  484. package/dist/chunk-F2C3KZFX.mjs.map +0 -1
  485. package/dist/chunk-GSJPTZT3.mjs.map +0 -1
  486. package/dist/chunk-IJAX6APL.mjs +0 -23
  487. package/dist/chunk-IJAX6APL.mjs.map +0 -1
  488. package/dist/chunk-IKJJWKXM.mjs +0 -15
  489. package/dist/chunk-IKJJWKXM.mjs.map +0 -1
  490. package/dist/chunk-KPGSRU4I.mjs.map +0 -1
  491. package/dist/chunk-PT5H3QV6.mjs +0 -29
  492. package/dist/chunk-PT5H3QV6.mjs.map +0 -1
  493. package/dist/chunk-TQDUBRCZ.mjs.map +0 -1
  494. package/dist/chunk-V6UKKHKD.mjs +0 -33
  495. package/dist/chunk-V6UKKHKD.mjs.map +0 -1
  496. package/dist/chunk-XUWZ4HGD.mjs.map +0 -1
  497. package/dist/description-list/description-list.d.mts +0 -2
  498. package/dist/description-list/index.d.mts +0 -2
  499. package/dist/footer/footer.d.mts +0 -7
  500. package/dist/footer/index.d.mts +0 -7
  501. package/dist/form/checkbox/checkbox.d.mts +0 -2
  502. package/dist/form/checkbox/index.d.mts +0 -2
  503. package/dist/form/date-picker/date-picker.d.mts +0 -2
  504. package/dist/form/date-picker/index.d.mts +0 -2
  505. package/dist/form/error-message/error-message.d.mts +0 -2
  506. package/dist/form/error-message/index.d.mts +0 -2
  507. package/dist/form/fieldset/fieldset.d.mts +0 -3
  508. package/dist/form/fieldset/index.d.mts +0 -3
  509. package/dist/form/index.d.mts +0 -20
  510. package/dist/form/input/index.d.mts +0 -2
  511. package/dist/form/input/input.d.mts +0 -2
  512. package/dist/form/input-group/index.d.mts +0 -2
  513. package/dist/form/input-group/input-group.d.mts +0 -2
  514. package/dist/form/radiobutton/index.d.mts +0 -5
  515. package/dist/form/radiobutton/radiobutton.d.mts +0 -2
  516. package/dist/form/radiobutton/radiogroup.d.mts +0 -3
  517. package/dist/form/select/index.d.mts +0 -2
  518. package/dist/form/select/select.d.mts +0 -2
  519. package/dist/form/textarea/index.d.mts +0 -2
  520. package/dist/form/textarea/textarea.d.mts +0 -2
  521. package/dist/help-text/help-text.d.mts +0 -1
  522. package/dist/help-text/index.d.mts +0 -1
  523. package/dist/index-no-css.d.mts +0 -128
  524. package/dist/index.d.mts +0 -128
  525. package/dist/layout/container/container.d.mts +0 -2
  526. package/dist/layout/grid/grid.d.mts +0 -4
  527. package/dist/layout/grid/index.d.mts +0 -4
  528. package/dist/layout/index.d.mts +0 -10
  529. package/dist/layout/responsive.d.mts +0 -2
  530. package/dist/layout/spacing.d.mts +0 -3
  531. package/dist/layout/stack/index.d.mts +0 -4
  532. package/dist/layout/stack/stack.d.mts +0 -4
  533. package/dist/link/index.d.mts +0 -2
  534. package/dist/link/link.d.mts +0 -2
  535. package/dist/list/index.d.mts +0 -5
  536. package/dist/list/link-list.d.mts +0 -2
  537. package/dist/list/list.d.mts +0 -3
  538. package/dist/message/index.d.mts +0 -3
  539. package/dist/message/message.d.mts +0 -4
  540. package/dist/modal/index.d.mts +0 -5
  541. package/dist/modal/modal.d.mts +0 -5
  542. package/dist/navbar/icons.d.mts +0 -2
  543. package/dist/navbar/index.d.mts +0 -13
  544. package/dist/navbar/navbar-expandable-menu.d.mts +0 -7
  545. package/dist/navbar/navbar.d.mts +0 -9
  546. package/dist/show-more/index.d.mts +0 -4
  547. package/dist/show-more/show-more.d.mts +0 -2
  548. package/dist/skeleton/index.d.mts +0 -2
  549. package/dist/skeleton/skeleton.d.mts +0 -2
  550. package/dist/step-indicator/index.d.mts +0 -1
  551. package/dist/step-indicator/step-indicator.d.mts +0 -1
  552. package/dist/styled-html/index.d.mts +0 -2
  553. package/dist/styled-html/styled-html.d.mts +0 -2
  554. package/dist/table/index.d.mts +0 -1
  555. package/dist/table/table.d.mts +0 -1
  556. package/dist/tabs/context.d.mts +0 -3
  557. package/dist/tabs/index.d.mts +0 -10
  558. package/dist/tabs/tabs-content.d.mts +0 -4
  559. package/dist/tabs/tabs-list.d.mts +0 -4
  560. package/dist/tabs/tabs.d.mts +0 -2
  561. package/dist/text/index.d.mts +0 -2
  562. package/dist/text/text.d.mts +0 -2
  563. package/dist/utilities/auto-animate-height.d.mts +0 -2
  564. package/dist/utilities/auto-animate-height.d.ts +0 -2
  565. package/dist/utilities/auto-animate-height.js.map +0 -1
  566. package/dist/utilities/auto-animate-height.mjs +0 -9
  567. package/dist/utilities/index.d.mts +0 -2
  568. package/dist/utilities/index.d.ts +0 -2
  569. package/dist/utilities/index.js.map +0 -1
  570. package/dist/utilities/index.mjs +0 -10
  571. package/dist/utils.d.mts +0 -5
  572. package/dist/utils.d.ts +0 -5
  573. package/dist/utils.js.map +0 -1
  574. package/dist/utils.mjs +0 -16
  575. package/dist/warning-banner/index.d.mts +0 -2
  576. package/dist/warning-banner/warning-banner.d.mts +0 -2
  577. /package/dist/{chunk-DZNH5JHY.mjs.map → chunk-7YWW46R3.mjs.map} +0 -0
  578. /package/dist/{utilities/auto-animate-height.mjs.map → chunk-ARHJZUZG.mjs.map} +0 -0
  579. /package/dist/{utilities/index.mjs.map → chunk-BCFV6VOE.mjs.map} +0 -0
  580. /package/dist/{utils.mjs.map → chunk-CYDWEPFL.mjs.map} +0 -0
@@ -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
+ };
@@ -0,0 +1,82 @@
1
+ import { forwardRef, useId, type InputHTMLAttributes, type ReactNode } from "react";
2
+ import { clsx } from "@postenbring/hedwig-css/typed-classname";
3
+ import { ErrorMessage } from "../error-message";
4
+ import { useFieldsetContext } from "../fieldset";
5
+
6
+ export type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue"> & {
7
+ children: ReactNode;
8
+ variant?: "plain" | "bounding-box";
9
+ title?: string;
10
+ } & (
11
+ | {
12
+ /**
13
+ * Set to `true` to add error styling. The component will take care of aria to indicate invalid state.
14
+ *
15
+ * Normally you don't need this, as you should wrap your Checkboxes in the Fieldset component.
16
+ * When providing an errorMessage to Fieldset, all contained Checkboxes will get correct hasError state.
17
+ *
18
+ * You can use this when your checkbox is part of a non-HDS fieldset which shows an error message.
19
+ */
20
+ hasError?: boolean;
21
+ errorMessage?: never;
22
+ }
23
+ | {
24
+ hasError?: never;
25
+ /**
26
+ * Set an error message to add error styling, and display the error message.
27
+ * The component will take care of aria to connect the error message to the checkbox.
28
+ *
29
+ * Use this when your checkbox is standalone (not part of a fieldset).
30
+ */
31
+ errorMessage?: ReactNode;
32
+ }
33
+ );
34
+
35
+ export const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
36
+ (
37
+ {
38
+ variant = "plain",
39
+ hasError: hasErrorProp,
40
+ errorMessage,
41
+ title,
42
+ children,
43
+ className,
44
+ ...rest
45
+ },
46
+ ref,
47
+ ) => {
48
+ const errorMessageId = useId();
49
+ const { hasError: hasFieldsetError } = useFieldsetContext();
50
+ const hasError = !!errorMessage || hasFieldsetError || hasErrorProp;
51
+
52
+ return (
53
+ <div className={clsx("hds-checkbox-wrapper")}>
54
+ <div
55
+ className={clsx(
56
+ "hds-checkbox",
57
+ {
58
+ [`hds-checkbox--${variant}`]: variant === "bounding-box",
59
+ "hds-checkbox--error": hasError,
60
+ },
61
+ className as undefined,
62
+ )}
63
+ >
64
+ <label>
65
+ <input
66
+ {...rest}
67
+ aria-invalid={hasError ? true : undefined}
68
+ aria-describedby={errorMessage ? errorMessageId : undefined}
69
+ ref={ref}
70
+ type="checkbox"
71
+ />
72
+ <span aria-hidden className="hds-checkbox__checkmark" />
73
+ {title ? <p className="hds-checkbox__title">{title}</p> : children}
74
+ </label>
75
+ {title ? children : null}
76
+ </div>
77
+ {errorMessage ? <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage> : null}
78
+ </div>
79
+ );
80
+ },
81
+ );
82
+ Checkbox.displayName = "Checkbox";
@@ -0,0 +1,2 @@
1
+ export { Checkbox } from "./checkbox";
2
+ export type * from "./checkbox";
@@ -0,0 +1,27 @@
1
+ /* eslint-disable import/no-extraneous-dependencies -- storybook story */
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { DatePicker } from ".";
4
+
5
+ const meta: Meta<typeof DatePicker> = {
6
+ title: "Form/DatePicker",
7
+ component: DatePicker,
8
+ };
9
+
10
+ export default meta;
11
+
12
+ type Story = StoryObj<typeof DatePicker>;
13
+
14
+ export const PlainDatePicker: Story = {
15
+ args: {
16
+ label: "Some kind of date picker",
17
+ errorMessage: "",
18
+ readOnly: false,
19
+ variant: "default",
20
+ min: "2024-04-05",
21
+ max: "2026-04-04",
22
+ calendarButtonTitle: "Åpne kalender",
23
+ },
24
+ argTypes: {
25
+ variant: { control: "inline-radio", options: ["default", "white"] },
26
+ },
27
+ };
@@ -0,0 +1,85 @@
1
+ import { forwardRef, useRef, type InputHTMLAttributes } from "react";
2
+ import { clsx } from "@postenbring/hedwig-css/typed-classname";
3
+ import { InputGroup, type InputGroupProps } from "../input-group";
4
+ import { useMergeRefs } from "../../utils/utils";
5
+
6
+ export type DatePickerProps = Omit<
7
+ InputGroupProps & InputHTMLAttributes<HTMLInputElement>,
8
+ "children" | "type"
9
+ > & {
10
+ /**
11
+ * Accessible title for the calendar button
12
+ *
13
+ * This button currently only shows in Chrome.
14
+ *
15
+ * @defaultValue "Åpne kalender"
16
+ */
17
+ calendarButtonTitle?: string;
18
+ };
19
+
20
+ /**
21
+ * A basic implementation of a date picker
22
+ *
23
+ * This date picker is an implementation of native date picker, as you get
24
+ * with `<input type="date" />`, where the input field is dressed in Hedwig styling.
25
+ *
26
+ * Due to accessibility concerns you will only see the appropriate Hedwig calendar
27
+ * icon in Chrome. Firefox will show built in icon and Safari will show no icon.
28
+ * Not tested in Edge.
29
+ */
30
+ export const DatePicker = forwardRef<HTMLInputElement, DatePickerProps>(function DatePicker(
31
+ {
32
+ className,
33
+ variant,
34
+ errorMessage,
35
+ labelProps,
36
+ label,
37
+ id,
38
+ style,
39
+ disabled,
40
+ readOnly,
41
+ calendarButtonTitle = "Åpne kalender",
42
+ ...rest
43
+ },
44
+ ref,
45
+ ) {
46
+ const inputRef = useRef<HTMLInputElement>(null);
47
+ const mergedRef = useMergeRefs([inputRef, ref]);
48
+
49
+ return (
50
+ <InputGroup
51
+ className={clsx("hds-date-picker", className as undefined)}
52
+ disabled={disabled}
53
+ errorMessage={errorMessage}
54
+ id={id}
55
+ label={label}
56
+ labelProps={labelProps}
57
+ readOnly={readOnly}
58
+ style={style}
59
+ variant={variant}
60
+ >
61
+ {(inputProps) => (
62
+ <>
63
+ <input
64
+ {...rest}
65
+ {...inputProps}
66
+ disabled={disabled}
67
+ readOnly={readOnly}
68
+ ref={mergedRef}
69
+ type="date"
70
+ />
71
+ <button
72
+ className={clsx("hds-date-picker__calendar-button")}
73
+ type="button"
74
+ title={calendarButtonTitle}
75
+ onClick={() => {
76
+ inputRef.current?.showPicker();
77
+ }}
78
+ />
79
+ </>
80
+ )}
81
+ </InputGroup>
82
+ );
83
+ });
84
+
85
+ DatePicker.displayName = "DatePicker";
@@ -0,0 +1,2 @@
1
+ export { DatePicker } from "./date-picker";
2
+ export type * from "./date-picker";
@@ -0,0 +1,19 @@
1
+ /* eslint-disable import/no-extraneous-dependencies -- storybook story */
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { ErrorMessage } from ".";
4
+
5
+ const meta: Meta<typeof ErrorMessage> = {
6
+ title: "Form/ErrorMessage",
7
+ component: ErrorMessage,
8
+ };
9
+
10
+ export default meta;
11
+
12
+ type Story = StoryObj<typeof ErrorMessage>;
13
+
14
+ export const Default: Story = {
15
+ args: {
16
+ id: "id",
17
+ children: "This is an error message for use with form input components",
18
+ },
19
+ };
@@ -0,0 +1,25 @@
1
+ import { clsx } from "@postenbring/hedwig-css/typed-classname";
2
+ import { forwardRef, type ReactNode } from "react";
3
+
4
+ export interface ErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ children: ReactNode;
6
+ id: string;
7
+ className?: string;
8
+ }
9
+
10
+ export const ErrorMessage = forwardRef<HTMLDivElement, ErrorMessageProps>(
11
+ ({ children, id, className, ...rest }, ref) => {
12
+ return (
13
+ <div
14
+ aria-live="assertive"
15
+ className={clsx("hds-error-message", className as undefined)}
16
+ id={id}
17
+ ref={ref}
18
+ {...rest}
19
+ >
20
+ {children}
21
+ </div>
22
+ );
23
+ },
24
+ );
25
+ ErrorMessage.displayName = "ErrorMessage";
@@ -0,0 +1,2 @@
1
+ export { ErrorMessage } from "./error-message";
2
+ export type * from "./error-message";
@@ -0,0 +1,86 @@
1
+ /* eslint-disable import/no-extraneous-dependencies -- storybook story */
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import { Checkbox } from "../checkbox";
4
+ import { Radiobutton } from "../radiobutton";
5
+ import { Fieldset } from ".";
6
+
7
+ const meta: Meta<typeof Fieldset> = {
8
+ title: "Form/Fieldset",
9
+ component: Fieldset,
10
+ };
11
+
12
+ export default meta;
13
+
14
+ type Story = StoryObj<typeof Fieldset>;
15
+
16
+ export const Default: Story = {
17
+ args: {
18
+ legend: "Default fieldset",
19
+ errorMessage: "",
20
+ },
21
+ render: (props) => (
22
+ <Fieldset {...props}>
23
+ <Checkbox defaultChecked value="Hello">
24
+ Hello
25
+ </Checkbox>
26
+ <Checkbox value="Hello">Hello</Checkbox>
27
+ <Checkbox value="Hello">Hello</Checkbox>
28
+ </Fieldset>
29
+ ),
30
+ };
31
+
32
+ export const LargeLegend: Story = {
33
+ args: {
34
+ legend: "Fieldset with large legend",
35
+ legendProps: { size: "large" },
36
+ },
37
+ render: (props) => (
38
+ <Fieldset {...props}>
39
+ <Checkbox defaultChecked value="Hello">
40
+ Hello
41
+ </Checkbox>
42
+ <Checkbox value="Hello">Hello</Checkbox>
43
+ <Checkbox value="Hello">Hello</Checkbox>
44
+ </Fieldset>
45
+ ),
46
+ };
47
+
48
+ export const FieldsetErrorCheckboxes: Story = {
49
+ args: {
50
+ legend: "Checkboxes wrapped in Fieldset will get error styling when Fieldset has errorMessage",
51
+ errorMessage: "Something's wrong",
52
+ },
53
+ render: (props) => (
54
+ <Fieldset {...props}>
55
+ <Checkbox value="Hello">Hello</Checkbox>
56
+ <Checkbox value="Hello">Hello</Checkbox>
57
+ <Checkbox value="Hello">Hello</Checkbox>
58
+ </Fieldset>
59
+ ),
60
+ };
61
+
62
+ export const FieldsetErrorRadiobuttons: Story = {
63
+ args: {
64
+ legend: (
65
+ <>
66
+ Radiobuttons wrapped in Fieldset will get error styling when Fieldset has errorMessage
67
+ <br />
68
+ However, you should probably use RadioGroup instead of Fieldset for Radiobuttons
69
+ </>
70
+ ),
71
+ errorMessage: "Something's wrong",
72
+ },
73
+ render: (props) => (
74
+ <Fieldset {...props}>
75
+ <Radiobutton value="Hello" name="radiogroup">
76
+ Hello
77
+ </Radiobutton>
78
+ <Radiobutton value="Hello" name="radiogroup">
79
+ Hello
80
+ </Radiobutton>
81
+ <Radiobutton value="Hello" name="radiogroup">
82
+ Hello
83
+ </Radiobutton>
84
+ </Fieldset>
85
+ ),
86
+ };
@@ -0,0 +1,64 @@
1
+ import { useId, forwardRef, createContext, useContext } from "react";
2
+ import type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from "react";
3
+ import { clsx } from "@postenbring/hedwig-css/typed-classname";
4
+ import { ErrorMessage } from "../error-message";
5
+
6
+ export interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
7
+ className?: string;
8
+ style?: CSSProperties;
9
+ /**
10
+ * Providing an errorMessage will also give contained Checkboxes or Radiobuttons
11
+ * error styling and aria to indicate invalid state.
12
+ *
13
+ * For Radiobuttons you are even better off using RadioGroup.
14
+ */
15
+ errorMessage?: ReactNode;
16
+ legendProps?: HTMLAttributes<HTMLElement> & { size: "default" | "large" };
17
+ legend: ReactNode;
18
+ children: ReactNode;
19
+ }
20
+
21
+ const FieldsetContext = createContext<{ hasError: boolean }>({ hasError: false });
22
+
23
+ export const useFieldsetContext = () => useContext(FieldsetContext);
24
+
25
+ export const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(function Fieldset(
26
+ {
27
+ className,
28
+ style,
29
+ errorMessage,
30
+ legendProps: { size: legendSize = "default", className: legendClassName, ...legendProps } = {},
31
+ legend,
32
+ children,
33
+ ...rest
34
+ },
35
+ ref,
36
+ ) {
37
+ const errorMessageId = useId();
38
+
39
+ return (
40
+ <fieldset
41
+ aria-describedby={errorMessage ? errorMessageId : undefined}
42
+ aria-invalid={errorMessage ? true : undefined}
43
+ className={clsx("hds-fieldset", className as undefined)}
44
+ ref={ref}
45
+ style={style}
46
+ {...rest}
47
+ >
48
+ <legend
49
+ className={clsx(
50
+ "hds-fieldset__legend",
51
+ { [`hds-fieldset__legend--${legendSize}`]: legendSize },
52
+ legendClassName as undefined,
53
+ )}
54
+ {...legendProps}
55
+ >
56
+ {legend}
57
+ </legend>
58
+ <FieldsetContext.Provider value={{ hasError: Boolean(errorMessage) }}>
59
+ {children}
60
+ </FieldsetContext.Provider>
61
+ <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage>
62
+ </fieldset>
63
+ );
64
+ });
@@ -0,0 +1,2 @@
1
+ export { Fieldset, useFieldsetContext } from "./fieldset";
2
+ export type * from "./fieldset";