@postenbring/hedwig-react 0.0.81 → 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 (523) 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-XC3UHH2U.mjs → chunk-3WVRY6CC.mjs} +4 -4
  52. package/dist/{chunk-XC3UHH2U.mjs.map → chunk-3WVRY6CC.mjs.map} +1 -1
  53. package/dist/{chunk-GSJPTZT3.mjs → chunk-6AGDK5V3.mjs} +34 -19
  54. package/dist/chunk-6AGDK5V3.mjs.map +1 -0
  55. package/dist/{chunk-3MQKXNZ6.mjs → chunk-7UD72WOC.mjs} +13 -1
  56. package/dist/chunk-7UD72WOC.mjs.map +1 -0
  57. package/dist/chunk-7YWW46R3.mjs +1 -0
  58. package/dist/chunk-7YWW46R3.mjs.map +1 -0
  59. package/dist/{chunk-ENKVTAJB.mjs → chunk-AJWSQEDP.mjs} +18 -17
  60. package/dist/chunk-AJWSQEDP.mjs.map +1 -0
  61. package/dist/chunk-ARHJZUZG.mjs +1 -0
  62. package/dist/chunk-ARHJZUZG.mjs.map +1 -0
  63. package/dist/chunk-BCFV6VOE.mjs +1 -0
  64. package/dist/chunk-BCFV6VOE.mjs.map +1 -0
  65. package/dist/{chunk-7JRS4WEB.mjs → chunk-C34HEQXO.mjs} +33 -29
  66. package/dist/chunk-C34HEQXO.mjs.map +1 -0
  67. package/dist/{chunk-PLXB3TNA.mjs → chunk-D7QPJIUZ.mjs} +5 -5
  68. package/dist/{chunk-PLXB3TNA.mjs.map → chunk-D7QPJIUZ.mjs.map} +1 -1
  69. package/dist/chunk-FYFJ75NX.mjs +1 -0
  70. package/dist/chunk-FYFJ75NX.mjs.map +1 -0
  71. package/dist/chunk-G65EYZFQ.mjs +1 -0
  72. package/dist/chunk-G65EYZFQ.mjs.map +1 -0
  73. package/dist/chunk-H3E546OT.mjs +1 -0
  74. package/dist/chunk-H3E546OT.mjs.map +1 -0
  75. package/dist/chunk-HQVL3ZJ2.mjs +1 -0
  76. package/dist/chunk-HQVL3ZJ2.mjs.map +1 -0
  77. package/dist/{chunk-XUWZ4HGD.mjs → chunk-LCJSUBCZ.mjs} +48 -45
  78. package/dist/chunk-LCJSUBCZ.mjs.map +1 -0
  79. package/dist/{chunk-KPGSRU4I.mjs → chunk-M3Y3XOGC.mjs} +13 -1
  80. package/dist/chunk-M3Y3XOGC.mjs.map +1 -0
  81. package/dist/{chunk-CIHZDFSQ.mjs → chunk-NU6OSFAU.mjs} +20 -9
  82. package/dist/chunk-NU6OSFAU.mjs.map +1 -0
  83. package/dist/chunk-RC76SXBP.mjs +1 -0
  84. package/dist/chunk-RC76SXBP.mjs.map +1 -0
  85. package/dist/{chunk-TQDUBRCZ.mjs → chunk-SQ63E7KM.mjs} +24 -22
  86. package/dist/chunk-SQ63E7KM.mjs.map +1 -0
  87. package/dist/{chunk-ES6ISHOV.mjs → chunk-UP3M3NEZ.mjs} +14 -13
  88. package/dist/{chunk-ES6ISHOV.mjs.map → chunk-UP3M3NEZ.mjs.map} +1 -1
  89. package/dist/chunk-ZKMFJZSH.mjs +1 -0
  90. package/dist/chunk-ZKMFJZSH.mjs.map +1 -0
  91. package/dist/description-list/description-list.d.ts +42 -2
  92. package/dist/description-list/description-list.d.ts.map +1 -0
  93. package/dist/description-list/index.d.ts +3 -2
  94. package/dist/description-list/index.d.ts.map +1 -0
  95. package/dist/footer/footer.d.ts +67 -7
  96. package/dist/footer/footer.d.ts.map +1 -0
  97. package/dist/footer/footer.js +79 -76
  98. package/dist/footer/footer.js.map +1 -1
  99. package/dist/footer/footer.mjs +4 -4
  100. package/dist/footer/index.d.ts +3 -7
  101. package/dist/footer/index.d.ts.map +1 -0
  102. package/dist/footer/index.js +80 -84
  103. package/dist/footer/index.js.map +1 -1
  104. package/dist/footer/index.mjs +7 -8
  105. package/dist/form/checkbox/checkbox.d.ts +28 -2
  106. package/dist/form/checkbox/checkbox.d.ts.map +1 -0
  107. package/dist/form/checkbox/index.d.ts +3 -2
  108. package/dist/form/checkbox/index.d.ts.map +1 -0
  109. package/dist/form/date-picker/date-picker.d.ts +33 -2
  110. package/dist/form/date-picker/date-picker.d.ts.map +1 -0
  111. package/dist/form/date-picker/index.d.ts +3 -2
  112. package/dist/form/date-picker/index.d.ts.map +1 -0
  113. package/dist/form/error-message/error-message.d.ts +8 -2
  114. package/dist/form/error-message/error-message.d.ts.map +1 -0
  115. package/dist/form/error-message/index.d.ts +3 -2
  116. package/dist/form/error-message/index.d.ts.map +1 -0
  117. package/dist/form/fieldset/fieldset.d.ts +22 -3
  118. package/dist/form/fieldset/fieldset.d.ts.map +1 -0
  119. package/dist/form/fieldset/index.d.ts +3 -3
  120. package/dist/form/fieldset/index.d.ts.map +1 -0
  121. package/dist/form/index.d.ts +9 -20
  122. package/dist/form/index.d.ts.map +1 -0
  123. package/dist/form/input/index.d.ts +3 -2
  124. package/dist/form/input/index.d.ts.map +1 -0
  125. package/dist/form/input/input.d.ts +5 -2
  126. package/dist/form/input/input.d.ts.map +1 -0
  127. package/dist/form/input-group/index.d.ts +3 -2
  128. package/dist/form/input-group/index.d.ts.map +1 -0
  129. package/dist/form/input-group/input-group.d.ts +27 -2
  130. package/dist/form/input-group/input-group.d.ts.map +1 -0
  131. package/dist/form/radiobutton/index.d.ts +5 -5
  132. package/dist/form/radiobutton/index.d.ts.map +1 -0
  133. package/dist/form/radiobutton/radiobutton.d.ts +17 -2
  134. package/dist/form/radiobutton/radiobutton.d.ts.map +1 -0
  135. package/dist/form/radiobutton/radiogroup.d.ts +24 -3
  136. package/dist/form/radiobutton/radiogroup.d.ts.map +1 -0
  137. package/dist/form/select/index.d.ts +3 -2
  138. package/dist/form/select/index.d.ts.map +1 -0
  139. package/dist/form/select/select.d.ts +9 -2
  140. package/dist/form/select/select.d.ts.map +1 -0
  141. package/dist/form/textarea/index.d.ts +3 -2
  142. package/dist/form/textarea/index.d.ts.map +1 -0
  143. package/dist/form/textarea/textarea.d.ts +5 -2
  144. package/dist/form/textarea/textarea.d.ts.map +1 -0
  145. package/dist/help-text/help-text.d.ts +51 -1
  146. package/dist/help-text/help-text.d.ts.map +1 -0
  147. package/dist/help-text/help-text.js +17 -20
  148. package/dist/help-text/help-text.js.map +1 -1
  149. package/dist/help-text/help-text.mjs +3 -3
  150. package/dist/help-text/index.d.ts +3 -1
  151. package/dist/help-text/index.d.ts.map +1 -0
  152. package/dist/help-text/index.js +17 -20
  153. package/dist/help-text/index.js.map +1 -1
  154. package/dist/help-text/index.mjs +3 -3
  155. package/dist/index-no-css.d.ts +26 -128
  156. package/dist/index-no-css.d.ts.map +1 -0
  157. package/dist/index-no-css.js +372 -393
  158. package/dist/index-no-css.js.map +1 -1
  159. package/dist/index-no-css.mjs +50 -57
  160. package/dist/index.d.ts +11 -128
  161. package/dist/index.d.ts.map +1 -0
  162. package/dist/index.js +372 -393
  163. package/dist/index.js.map +1 -1
  164. package/dist/index.mjs +50 -57
  165. package/dist/index.mjs.map +1 -1
  166. package/dist/layout/container/container.d.ts +23 -2
  167. package/dist/layout/container/container.d.ts.map +1 -0
  168. package/dist/layout/grid/grid.d.ts +101 -4
  169. package/dist/layout/grid/grid.d.ts.map +1 -0
  170. package/dist/layout/grid/grid.js +11 -10
  171. package/dist/layout/grid/grid.js.map +1 -1
  172. package/dist/layout/grid/grid.mjs +1 -1
  173. package/dist/layout/grid/index.d.ts +3 -4
  174. package/dist/layout/grid/index.d.ts.map +1 -0
  175. package/dist/layout/grid/index.js +12 -15
  176. package/dist/layout/grid/index.js.map +1 -1
  177. package/dist/layout/grid/index.mjs +4 -5
  178. package/dist/layout/index.d.ts +4 -10
  179. package/dist/layout/index.d.ts.map +1 -0
  180. package/dist/layout/index.js +12 -15
  181. package/dist/layout/index.js.map +1 -1
  182. package/dist/layout/index.mjs +4 -5
  183. package/dist/layout/responsive.d.ts +10 -2
  184. package/dist/layout/responsive.d.ts.map +1 -0
  185. package/dist/layout/spacing.d.ts +33 -3
  186. package/dist/layout/spacing.d.ts.map +1 -0
  187. package/dist/layout/stack/index.d.ts +3 -4
  188. package/dist/layout/stack/index.d.ts.map +1 -0
  189. package/dist/layout/stack/stack.d.ts +62 -4
  190. package/dist/layout/stack/stack.d.ts.map +1 -0
  191. package/dist/link/index.d.ts +3 -2
  192. package/dist/link/index.d.ts.map +1 -0
  193. package/dist/link/link.d.ts +20 -2
  194. package/dist/link/link.d.ts.map +1 -0
  195. package/dist/list/index.d.ts +5 -5
  196. package/dist/list/index.d.ts.map +1 -0
  197. package/dist/list/link-list.d.ts +12 -2
  198. package/dist/list/link-list.d.ts.map +1 -0
  199. package/dist/list/list.d.ts +40 -3
  200. package/dist/list/list.d.ts.map +1 -0
  201. package/dist/message/index.d.ts +3 -3
  202. package/dist/message/index.d.ts.map +1 -0
  203. package/dist/message/index.js +36 -38
  204. package/dist/message/index.js.map +1 -1
  205. package/dist/message/index.mjs +5 -6
  206. package/dist/message/message.d.ts +36 -4
  207. package/dist/message/message.d.ts.map +1 -0
  208. package/dist/message/message.js +35 -32
  209. package/dist/message/message.js.map +1 -1
  210. package/dist/message/message.mjs +2 -2
  211. package/dist/modal/index.d.ts +3 -5
  212. package/dist/modal/index.d.ts.map +1 -0
  213. package/dist/modal/index.js +60 -62
  214. package/dist/modal/index.js.map +1 -1
  215. package/dist/modal/index.mjs +5 -6
  216. package/dist/modal/modal.d.ts +81 -5
  217. package/dist/modal/modal.d.ts.map +1 -0
  218. package/dist/modal/modal.js +59 -55
  219. package/dist/modal/modal.js.map +1 -1
  220. package/dist/modal/modal.mjs +2 -2
  221. package/dist/navbar/icons.d.ts +3 -2
  222. package/dist/navbar/icons.d.ts.map +1 -0
  223. package/dist/navbar/index.d.ts +4 -13
  224. package/dist/navbar/index.d.ts.map +1 -0
  225. package/dist/navbar/index.js +144 -145
  226. package/dist/navbar/index.js.map +1 -1
  227. package/dist/navbar/index.mjs +4 -5
  228. package/dist/navbar/navbar-expandable-menu.d.ts +35 -7
  229. package/dist/navbar/navbar-expandable-menu.d.ts.map +1 -0
  230. package/dist/navbar/navbar.d.ts +130 -9
  231. package/dist/navbar/navbar.d.ts.map +1 -0
  232. package/dist/navbar/navbar.js +237 -28
  233. package/dist/navbar/navbar.js.map +1 -1
  234. package/dist/navbar/navbar.mjs +4 -1
  235. package/dist/show-more/index.d.ts +5 -4
  236. package/dist/show-more/index.d.ts.map +1 -0
  237. package/dist/show-more/show-more.d.ts +42 -2
  238. package/dist/show-more/show-more.d.ts.map +1 -0
  239. package/dist/skeleton/index.d.ts +3 -2
  240. package/dist/skeleton/index.d.ts.map +1 -0
  241. package/dist/skeleton/skeleton.d.ts +67 -2
  242. package/dist/skeleton/skeleton.d.ts.map +1 -0
  243. package/dist/step-indicator/index.d.ts +3 -1
  244. package/dist/step-indicator/index.d.ts.map +1 -0
  245. package/dist/step-indicator/step-indicator.d.ts +36 -1
  246. package/dist/step-indicator/step-indicator.d.ts.map +1 -0
  247. package/dist/styled-html/index.d.ts +3 -2
  248. package/dist/styled-html/index.d.ts.map +1 -0
  249. package/dist/styled-html/styled-html.d.ts +36 -2
  250. package/dist/styled-html/styled-html.d.ts.map +1 -0
  251. package/dist/table/index.d.ts +3 -1
  252. package/dist/table/index.d.ts.map +1 -0
  253. package/dist/table/table.d.ts +25 -1
  254. package/dist/table/table.d.ts.map +1 -0
  255. package/dist/tabs/context.d.ts +8 -3
  256. package/dist/tabs/context.d.ts.map +1 -0
  257. package/dist/tabs/index.d.ts +7 -10
  258. package/dist/tabs/index.d.ts.map +1 -0
  259. package/dist/tabs/index.js +34 -37
  260. package/dist/tabs/index.js.map +1 -1
  261. package/dist/tabs/index.mjs +4 -4
  262. package/dist/tabs/tabs-content.d.ts +26 -4
  263. package/dist/tabs/tabs-content.d.ts.map +1 -0
  264. package/dist/tabs/tabs-list.d.ts +21 -4
  265. package/dist/tabs/tabs-list.d.ts.map +1 -0
  266. package/dist/tabs/tabs.d.ts +26 -2
  267. package/dist/tabs/tabs.d.ts.map +1 -0
  268. package/dist/tabs/tabs.js +205 -8
  269. package/dist/tabs/tabs.js.map +1 -1
  270. package/dist/tabs/tabs.mjs +4 -1
  271. package/dist/text/index.d.ts +4 -2
  272. package/dist/text/index.d.ts.map +1 -0
  273. package/dist/text/text.d.ts +58 -2
  274. package/dist/text/text.d.ts.map +1 -0
  275. package/dist/utilities/auto-animate-height.d.ts +33 -2
  276. package/dist/utilities/auto-animate-height.d.ts.map +1 -0
  277. package/dist/utilities/index.d.ts +3 -2
  278. package/dist/utilities/index.d.ts.map +1 -0
  279. package/dist/utils.d.ts +28 -5
  280. package/dist/utils.d.ts.map +1 -0
  281. package/dist/warning-banner/index.d.ts +3 -2
  282. package/dist/warning-banner/index.d.ts.map +1 -0
  283. package/dist/warning-banner/index.js +16 -19
  284. package/dist/warning-banner/index.js.map +1 -1
  285. package/dist/warning-banner/index.mjs +3 -3
  286. package/dist/warning-banner/warning-banner.d.ts +8 -2
  287. package/dist/warning-banner/warning-banner.d.ts.map +1 -0
  288. package/dist/warning-banner/warning-banner.js +16 -19
  289. package/dist/warning-banner/warning-banner.js.map +1 -1
  290. package/dist/warning-banner/warning-banner.mjs +3 -3
  291. package/package.json +9 -5
  292. package/src/accordion/accordion-content.tsx +31 -0
  293. package/src/accordion/accordion-header.tsx +36 -0
  294. package/src/accordion/accordion-item.tsx +62 -0
  295. package/src/accordion/accordion.stories.tsx +154 -0
  296. package/src/accordion/accordion.tsx +68 -0
  297. package/src/accordion/context.ts +8 -0
  298. package/src/accordion/index.tsx +9 -0
  299. package/src/badge/badge.stories.tsx +44 -0
  300. package/src/badge/badge.tsx +63 -0
  301. package/src/badge/index.tsx +3 -0
  302. package/src/box/box.stories.tsx +112 -0
  303. package/src/box/box.tsx +122 -0
  304. package/src/box/index.tsx +3 -0
  305. package/src/breadcrumbs/breadcrumbs.stories.tsx +50 -0
  306. package/src/breadcrumbs/breadcrumbs.tsx +47 -0
  307. package/src/breadcrumbs/index.tsx +3 -0
  308. package/src/button/button.stories.tsx +104 -0
  309. package/src/button/button.tsx +87 -0
  310. package/src/button/index.tsx +3 -0
  311. package/src/card/card.stories.tsx +82 -0
  312. package/src/card/card.tsx +222 -0
  313. package/src/card/index.tsx +14 -0
  314. package/src/description-list/description-list.stories.tsx +95 -0
  315. package/src/description-list/description-list.tsx +61 -0
  316. package/src/description-list/index.tsx +2 -0
  317. package/src/footer/footer.tsx +169 -0
  318. package/src/footer/index.tsx +9 -0
  319. package/src/form/checkbox/checkbox.stories.tsx +104 -0
  320. package/src/form/checkbox/checkbox.tsx +82 -0
  321. package/src/form/checkbox/index.tsx +2 -0
  322. package/src/form/date-picker/date-picker.stories.tsx +27 -0
  323. package/src/form/date-picker/date-picker.tsx +85 -0
  324. package/src/form/date-picker/index.tsx +2 -0
  325. package/src/form/error-message/error-message.stories.tsx +19 -0
  326. package/src/form/error-message/error-message.tsx +25 -0
  327. package/src/form/error-message/index.tsx +2 -0
  328. package/src/form/fieldset/fieldset.stories.tsx +86 -0
  329. package/src/form/fieldset/fieldset.tsx +64 -0
  330. package/src/form/fieldset/index.tsx +2 -0
  331. package/src/form/index.tsx +8 -0
  332. package/src/form/input/index.tsx +2 -0
  333. package/src/form/input/input.stories.tsx +166 -0
  334. package/src/form/input/input.tsx +30 -0
  335. package/src/form/input-group/index.tsx +2 -0
  336. package/src/form/input-group/input-group.tsx +106 -0
  337. package/src/form/radiobutton/index.tsx +4 -0
  338. package/src/form/radiobutton/radiobutton.stories.tsx +93 -0
  339. package/src/form/radiobutton/radiobutton.tsx +85 -0
  340. package/src/form/radiobutton/radiogroup.stories.tsx +39 -0
  341. package/src/form/radiobutton/radiogroup.tsx +52 -0
  342. package/src/form/select/index.tsx +2 -0
  343. package/src/form/select/select.stories.tsx +93 -0
  344. package/src/form/select/select.tsx +33 -0
  345. package/src/form/textarea/index.tsx +2 -0
  346. package/src/form/textarea/textarea.stories.tsx +106 -0
  347. package/src/form/textarea/textarea.tsx +33 -0
  348. package/src/help-text/help-text.tsx +98 -0
  349. package/src/help-text/index.ts +2 -0
  350. package/src/index-no-css.tsx +25 -0
  351. package/src/index.tsx +11 -0
  352. package/src/layout/container/container.stories.tsx +62 -0
  353. package/src/layout/container/container.tsx +47 -0
  354. package/src/layout/grid/grid.tsx +163 -0
  355. package/src/layout/grid/index.tsx +3 -0
  356. package/src/layout/index.tsx +3 -0
  357. package/src/layout/responsive.ts +26 -0
  358. package/src/layout/spacing.ts +37 -0
  359. package/src/layout/stack/index.tsx +2 -0
  360. package/src/layout/stack/stack.tsx +128 -0
  361. package/src/link/index.tsx +3 -0
  362. package/src/link/link.stories.tsx +64 -0
  363. package/src/link/link.tsx +46 -0
  364. package/src/list/index.tsx +5 -0
  365. package/src/list/link-list.stories.tsx +38 -0
  366. package/src/list/link-list.tsx +26 -0
  367. package/src/list/list.stories.tsx +71 -0
  368. package/src/list/list.tsx +65 -0
  369. package/src/message/index.tsx +2 -0
  370. package/src/message/message.stories.tsx +93 -0
  371. package/src/message/message.tsx +89 -0
  372. package/src/modal/index.tsx +3 -0
  373. package/src/modal/modal.stories.tsx +147 -0
  374. package/src/modal/modal.tsx +199 -0
  375. package/src/navbar/icons.tsx +21 -0
  376. package/src/navbar/index.tsx +18 -0
  377. package/src/navbar/navbar-expandable-menu.tsx +176 -0
  378. package/src/navbar/navbar.stories.tsx +99 -0
  379. package/src/navbar/navbar.tsx +264 -0
  380. package/src/show-more/index.ts +5 -0
  381. package/src/show-more/show-more.stories.tsx +119 -0
  382. package/src/show-more/show-more.tsx +66 -0
  383. package/src/skeleton/index.ts +2 -0
  384. package/src/skeleton/skeleton.stories.tsx +152 -0
  385. package/src/skeleton/skeleton.tsx +114 -0
  386. package/src/step-indicator/index.ts +2 -0
  387. package/src/step-indicator/step-indicator.stories.tsx +50 -0
  388. package/src/step-indicator/step-indicator.tsx +116 -0
  389. package/src/styled-html/index.ts +2 -0
  390. package/src/styled-html/styled-html.stories.tsx +189 -0
  391. package/src/styled-html/styled-html.tsx +59 -0
  392. package/src/table/index.ts +2 -0
  393. package/src/table/table.tsx +59 -0
  394. package/src/tabs/context.ts +18 -0
  395. package/src/tabs/index.tsx +7 -0
  396. package/src/tabs/tabs-content.tsx +62 -0
  397. package/src/tabs/tabs-list.tsx +129 -0
  398. package/src/tabs/tabs.stories.tsx +138 -0
  399. package/src/tabs/tabs.tsx +50 -0
  400. package/src/text/index.tsx +4 -0
  401. package/src/text/text.stories.tsx +112 -0
  402. package/src/text/text.tsx +129 -0
  403. package/src/utilities/auto-animate-height.tsx +139 -0
  404. package/src/utilities/index.ts +2 -0
  405. package/src/utils.ts +110 -0
  406. package/src/warning-banner/index.tsx +2 -0
  407. package/src/warning-banner/warning-banner.stories.tsx +43 -0
  408. package/src/warning-banner/warning-banner.tsx +79 -0
  409. package/dist/_tsup-dts-rollup.d.mts +0 -2600
  410. package/dist/_tsup-dts-rollup.d.ts +0 -2600
  411. package/dist/accordion/accordion-content.d.mts +0 -2
  412. package/dist/accordion/accordion-header.d.mts +0 -2
  413. package/dist/accordion/accordion-item.d.mts +0 -3
  414. package/dist/accordion/accordion.d.mts +0 -2
  415. package/dist/accordion/context.d.mts +0 -2
  416. package/dist/accordion/index.d.mts +0 -9
  417. package/dist/badge/badge.d.mts +0 -5
  418. package/dist/badge/index.d.mts +0 -6
  419. package/dist/box/box.d.mts +0 -4
  420. package/dist/box/index.d.mts +0 -4
  421. package/dist/breadcrumbs/breadcrumbs.d.mts +0 -2
  422. package/dist/breadcrumbs/index.d.mts +0 -2
  423. package/dist/button/button.d.mts +0 -3
  424. package/dist/button/index.d.mts +0 -3
  425. package/dist/card/card.d.mts +0 -12
  426. package/dist/card/index.d.mts +0 -12
  427. package/dist/chunk-3MQKXNZ6.mjs.map +0 -1
  428. package/dist/chunk-3NDUE23B.mjs +0 -19
  429. package/dist/chunk-3NDUE23B.mjs.map +0 -1
  430. package/dist/chunk-3NL3TOZF.mjs +0 -13
  431. package/dist/chunk-3NL3TOZF.mjs.map +0 -1
  432. package/dist/chunk-3ZFEUABU.mjs +0 -23
  433. package/dist/chunk-3ZFEUABU.mjs.map +0 -1
  434. package/dist/chunk-722MZPXO.mjs +0 -13
  435. package/dist/chunk-722MZPXO.mjs.map +0 -1
  436. package/dist/chunk-7JRS4WEB.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-IJAX6APL.mjs +0 -23
  443. package/dist/chunk-IJAX6APL.mjs.map +0 -1
  444. package/dist/chunk-IKJJWKXM.mjs +0 -15
  445. package/dist/chunk-IKJJWKXM.mjs.map +0 -1
  446. package/dist/chunk-KPGSRU4I.mjs.map +0 -1
  447. package/dist/chunk-PT5H3QV6.mjs +0 -29
  448. package/dist/chunk-PT5H3QV6.mjs.map +0 -1
  449. package/dist/chunk-TQDUBRCZ.mjs.map +0 -1
  450. package/dist/chunk-V6UKKHKD.mjs +0 -33
  451. package/dist/chunk-V6UKKHKD.mjs.map +0 -1
  452. package/dist/chunk-XUWZ4HGD.mjs.map +0 -1
  453. package/dist/description-list/description-list.d.mts +0 -2
  454. package/dist/description-list/index.d.mts +0 -2
  455. package/dist/footer/footer.d.mts +0 -7
  456. package/dist/footer/index.d.mts +0 -7
  457. package/dist/form/checkbox/checkbox.d.mts +0 -2
  458. package/dist/form/checkbox/index.d.mts +0 -2
  459. package/dist/form/date-picker/date-picker.d.mts +0 -2
  460. package/dist/form/date-picker/index.d.mts +0 -2
  461. package/dist/form/error-message/error-message.d.mts +0 -2
  462. package/dist/form/error-message/index.d.mts +0 -2
  463. package/dist/form/fieldset/fieldset.d.mts +0 -3
  464. package/dist/form/fieldset/index.d.mts +0 -3
  465. package/dist/form/index.d.mts +0 -20
  466. package/dist/form/input/index.d.mts +0 -2
  467. package/dist/form/input/input.d.mts +0 -2
  468. package/dist/form/input-group/index.d.mts +0 -2
  469. package/dist/form/input-group/input-group.d.mts +0 -2
  470. package/dist/form/radiobutton/index.d.mts +0 -5
  471. package/dist/form/radiobutton/radiobutton.d.mts +0 -2
  472. package/dist/form/radiobutton/radiogroup.d.mts +0 -3
  473. package/dist/form/select/index.d.mts +0 -2
  474. package/dist/form/select/select.d.mts +0 -2
  475. package/dist/form/textarea/index.d.mts +0 -2
  476. package/dist/form/textarea/textarea.d.mts +0 -2
  477. package/dist/help-text/help-text.d.mts +0 -1
  478. package/dist/help-text/index.d.mts +0 -1
  479. package/dist/index-no-css.d.mts +0 -128
  480. package/dist/index.d.mts +0 -128
  481. package/dist/layout/container/container.d.mts +0 -2
  482. package/dist/layout/grid/grid.d.mts +0 -4
  483. package/dist/layout/grid/index.d.mts +0 -4
  484. package/dist/layout/index.d.mts +0 -10
  485. package/dist/layout/responsive.d.mts +0 -2
  486. package/dist/layout/spacing.d.mts +0 -3
  487. package/dist/layout/stack/index.d.mts +0 -4
  488. package/dist/layout/stack/stack.d.mts +0 -4
  489. package/dist/link/index.d.mts +0 -2
  490. package/dist/link/link.d.mts +0 -2
  491. package/dist/list/index.d.mts +0 -5
  492. package/dist/list/link-list.d.mts +0 -2
  493. package/dist/list/list.d.mts +0 -3
  494. package/dist/message/index.d.mts +0 -3
  495. package/dist/message/message.d.mts +0 -4
  496. package/dist/modal/index.d.mts +0 -5
  497. package/dist/modal/modal.d.mts +0 -5
  498. package/dist/navbar/icons.d.mts +0 -2
  499. package/dist/navbar/index.d.mts +0 -13
  500. package/dist/navbar/navbar-expandable-menu.d.mts +0 -7
  501. package/dist/navbar/navbar.d.mts +0 -9
  502. package/dist/show-more/index.d.mts +0 -4
  503. package/dist/show-more/show-more.d.mts +0 -2
  504. package/dist/skeleton/index.d.mts +0 -2
  505. package/dist/skeleton/skeleton.d.mts +0 -2
  506. package/dist/step-indicator/index.d.mts +0 -1
  507. package/dist/step-indicator/step-indicator.d.mts +0 -1
  508. package/dist/styled-html/index.d.mts +0 -2
  509. package/dist/styled-html/styled-html.d.mts +0 -2
  510. package/dist/table/index.d.mts +0 -1
  511. package/dist/table/table.d.mts +0 -1
  512. package/dist/tabs/context.d.mts +0 -3
  513. package/dist/tabs/index.d.mts +0 -10
  514. package/dist/tabs/tabs-content.d.mts +0 -4
  515. package/dist/tabs/tabs-list.d.mts +0 -4
  516. package/dist/tabs/tabs.d.mts +0 -2
  517. package/dist/text/index.d.mts +0 -2
  518. package/dist/text/text.d.mts +0 -2
  519. package/dist/utilities/auto-animate-height.d.mts +0 -2
  520. package/dist/utilities/index.d.mts +0 -2
  521. package/dist/utils.d.mts +0 -5
  522. package/dist/warning-banner/index.d.mts +0 -2
  523. package/dist/warning-banner/warning-banner.d.mts +0 -2
@@ -0,0 +1,264 @@
1
+ import { forwardRef, type HTMLAttributes } from "react";
2
+ import { clsx } from "@postenbring/hedwig-css/typed-classname";
3
+ import { Slot } from "@radix-ui/react-slot";
4
+ import {
5
+ NavbarExpandableMenu,
6
+ NavbarExpandableMenuContent,
7
+ NavbarExpandableMenuTrigger,
8
+ } from "./navbar-expandable-menu";
9
+
10
+ interface NavbarLogoProps extends React.HTMLAttributes<HTMLDivElement> {
11
+ /**
12
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
13
+ *
14
+ * @default false
15
+ */
16
+ asChild?: boolean;
17
+ }
18
+
19
+ /**
20
+ * A fixed Posten or Bring logo.
21
+ *
22
+ * 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
23
+ */
24
+ export const NavbarLogo = forwardRef<HTMLDivElement, NavbarLogoProps>(
25
+ ({ children, className, asChild, ...rest }, ref) => {
26
+ const Component = asChild ? Slot : "div";
27
+ return (
28
+ <Component className={clsx(`hds-navbar__logo`, className as undefined)} ref={ref} {...rest}>
29
+ {children}
30
+ </Component>
31
+ );
32
+ },
33
+ );
34
+ NavbarLogo.displayName = "Navbar.Logo";
35
+
36
+ interface NavbarLogoAndServiceText extends HTMLAttributes<HTMLDivElement> {
37
+ /**
38
+ * The text display next to the logo
39
+ */
40
+ children: React.ReactNode;
41
+
42
+ /**
43
+ * The text variant
44
+ *
45
+ * Use `service` for internal applications
46
+ *
47
+ * Use `flagship` for public facing applications
48
+ */
49
+ variant: "service" | "flagship";
50
+
51
+ /**
52
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
53
+ *
54
+ * @default false
55
+ */
56
+ asChild?: boolean;
57
+ }
58
+
59
+ /**
60
+ * Internal service or flagship text next to either the Posten or Bring logo
61
+ *
62
+ * 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
63
+ */
64
+ export const NavbarLogoAndServiceText = forwardRef<HTMLDivElement, NavbarLogoAndServiceText>(
65
+ ({ children, asChild, variant, className, ...rest }, ref) => {
66
+ const Component = asChild ? Slot : "div";
67
+ return (
68
+ <Component
69
+ ref={ref}
70
+ className={clsx(
71
+ "hds-navbar__logo-and-service-text",
72
+ `hds-navbar__logo-and-service-text--${variant}`,
73
+ className as undefined,
74
+ )}
75
+ {...rest}
76
+ >
77
+ {children}
78
+ </Component>
79
+ );
80
+ },
81
+ );
82
+ NavbarLogoAndServiceText.displayName = "Navbar.NavbarLogoAndText";
83
+
84
+ interface NavbarItemIconProps extends React.HTMLAttributes<HTMLDivElement> {
85
+ children: React.ReactNode;
86
+ }
87
+ /**
88
+ * Icon to be used inside a `Navbar.Item`, `Navbar.ButtonItem`, or `Navbar.LinkItem`
89
+ */
90
+ export const NavbarItemIcon = forwardRef<HTMLDivElement, NavbarItemIconProps>(
91
+ ({ children, className, ...rest }, ref) => {
92
+ return (
93
+ <Slot className={clsx("hds-navbar__item-icon", className as undefined)} ref={ref} {...rest}>
94
+ {children}
95
+ </Slot>
96
+ );
97
+ },
98
+ );
99
+ NavbarItemIcon.displayName = "Navbar.ItemIcon";
100
+
101
+ interface NavbarItemProps extends React.HTMLAttributes<HTMLDivElement> {
102
+ children: React.ReactNode;
103
+
104
+ /**
105
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
106
+ *
107
+ * @default false
108
+ */
109
+ asChild?: boolean;
110
+ }
111
+
112
+ /**
113
+ * Generic Navbar item
114
+ *
115
+ * Use `Navbar.ButtonItem` or `Navbar.LinkItem` for links and buttons
116
+ */
117
+ export const NavbarItem = forwardRef<HTMLDivElement, NavbarItemProps>(
118
+ ({ asChild, children, className, ...rest }, ref) => {
119
+ const Component = asChild ? Slot : "div";
120
+ return (
121
+ <Component className={clsx("hds-navbar__item", className as undefined)} ref={ref} {...rest}>
122
+ {children}
123
+ </Component>
124
+ );
125
+ },
126
+ );
127
+ NavbarItem.displayName = "Navbar.Item";
128
+
129
+ interface NavbarButtonItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
130
+ children: React.ReactNode;
131
+
132
+ /**
133
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
134
+ *
135
+ * @default false
136
+ */
137
+ asChild?: boolean;
138
+ }
139
+ export const NavbarButtonItem = forwardRef<HTMLButtonElement, NavbarButtonItemProps>(
140
+ ({ asChild, children, className, ...rest }, ref) => {
141
+ const Component = asChild ? Slot : "button";
142
+ return (
143
+ <Component
144
+ className={clsx("hds-navbar__item", className as undefined)}
145
+ ref={ref}
146
+ type="button"
147
+ {...rest}
148
+ >
149
+ {children}
150
+ </Component>
151
+ );
152
+ },
153
+ );
154
+ NavbarButtonItem.displayName = "Navbar.ButtonItem";
155
+
156
+ interface NavbarLinkItemProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
157
+ children: React.ReactNode;
158
+
159
+ /**
160
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
161
+ *
162
+ * @default false
163
+ */
164
+ asChild?: boolean;
165
+ }
166
+
167
+ export const NavbarLinkItem = forwardRef<HTMLAnchorElement, NavbarLinkItemProps>(
168
+ ({ asChild, children, className, ...rest }, ref) => {
169
+ const Component = asChild ? Slot : "a";
170
+ return (
171
+ <Component className={clsx("hds-navbar__item", className as undefined)} ref={ref} {...rest}>
172
+ {children}
173
+ </Component>
174
+ );
175
+ },
176
+ );
177
+ NavbarLinkItem.displayName = "Navbar.LinkItem";
178
+
179
+ interface NavbarNavigationProps extends React.HTMLAttributes<HTMLDivElement> {
180
+ children: React.ReactNode;
181
+
182
+ /**
183
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
184
+ *
185
+ * @default false
186
+ */
187
+ asChild?: boolean;
188
+ }
189
+ export const NavbarNavigation = forwardRef<HTMLDivElement, NavbarNavigationProps>(
190
+ ({ asChild, className, ...rest }, ref) => {
191
+ const Component = asChild ? Slot : "div";
192
+ return (
193
+ <Component
194
+ className={clsx("hds-navbar__navigation", className as undefined)}
195
+ ref={ref}
196
+ {...rest}
197
+ />
198
+ );
199
+ },
200
+ );
201
+ NavbarNavigation.displayName = "Navbar.Navigation";
202
+
203
+ export interface NavbarProps extends HTMLAttributes<HTMLElement> {
204
+ /**
205
+ * Navbar variant
206
+ *
207
+ * By default the `posten.no` variant is used which has a fixed logo and a fixed height of 112px
208
+ *
209
+ * For internal services or flagship services use the `service` should be used
210
+ *
211
+ * @default "default"
212
+ */
213
+ variant?: "default" | "service";
214
+
215
+ /**
216
+ * Change the default rendered element for the one passed as a child, merging their props and behavior.
217
+ *
218
+ * @default false
219
+ */
220
+ asChild?: boolean;
221
+ }
222
+
223
+ /**
224
+ * 🚨 WORK IN PROGRESS 🚨
225
+ */
226
+ export const Navbar = forwardRef<HTMLDivElement, NavbarProps>(
227
+ ({ asChild, children, className, variant, ...rest }, ref) => {
228
+ const Component = asChild ? Slot : "header";
229
+ return (
230
+ <Component
231
+ className={clsx("hds-navbar", variant && `hds-navbar--${variant}`, className as undefined)}
232
+ ref={ref}
233
+ {...rest}
234
+ >
235
+ {children}
236
+ </Component>
237
+ );
238
+ },
239
+ ) as NavbarType;
240
+ Navbar.displayName = "Navbar";
241
+
242
+ type NavbarType = ReturnType<typeof forwardRef<HTMLDivElement, NavbarProps>> & {
243
+ Logo: typeof NavbarLogo;
244
+ LogoAndServiceText: typeof NavbarLogoAndServiceText;
245
+ ExpandableMenu: typeof NavbarExpandableMenu;
246
+ ExpandableMenuTrigger: typeof NavbarExpandableMenuTrigger;
247
+ ExpandableMenuContent: typeof NavbarExpandableMenuContent;
248
+ Item: typeof NavbarItem;
249
+ ButtonItem: typeof NavbarButtonItem;
250
+ LinkItem: typeof NavbarLinkItem;
251
+ ItemIcon: typeof NavbarItemIcon;
252
+ Navigation: typeof NavbarNavigation;
253
+ };
254
+
255
+ Navbar.Logo = NavbarLogo;
256
+ Navbar.LogoAndServiceText = NavbarLogoAndServiceText;
257
+ Navbar.ExpandableMenu = NavbarExpandableMenu;
258
+ Navbar.ExpandableMenuTrigger = NavbarExpandableMenuTrigger;
259
+ Navbar.ExpandableMenuContent = NavbarExpandableMenuContent;
260
+ Navbar.Item = NavbarItem;
261
+ Navbar.ButtonItem = NavbarButtonItem;
262
+ Navbar.LinkItem = NavbarLinkItem;
263
+ Navbar.ItemIcon = NavbarItemIcon;
264
+ Navbar.Navigation = NavbarNavigation;
@@ -0,0 +1,5 @@
1
+ export { AutoAnimateHeight } from "../utilities/auto-animate-height";
2
+ export type * from "../utilities/auto-animate-height";
3
+
4
+ export { ShowMoreButton } from "./show-more";
5
+ export type * from "./show-more";
@@ -0,0 +1,119 @@
1
+ /* eslint-disable import/no-extraneous-dependencies -- storybook story */
2
+ /* eslint-disable react-hooks/rules-of-hooks -- it's ok */
3
+ import type { Meta, StoryObj } from "@storybook/react";
4
+ import { useRef, useState } from "react";
5
+ import { flushSync } from "react-dom";
6
+ import { StyledHtml } from "../styled-html";
7
+ import { AutoAnimateHeight } from "../utilities/auto-animate-height";
8
+ import { ShowMoreButton } from ".";
9
+
10
+ const meta: Meta<typeof ShowMoreButton> = {
11
+ title: "Show more",
12
+ component: ShowMoreButton,
13
+ };
14
+
15
+ export default meta;
16
+
17
+ type Story = StoryObj<typeof ShowMoreButton>;
18
+
19
+ export const ShowMore: Story = {
20
+ args: {
21
+ text: "Vis flere",
22
+ onClick: () => {
23
+ // eslint-disable-next-line no-alert -- It's an example
24
+ alert("Clicked");
25
+ },
26
+ },
27
+ };
28
+
29
+ export const ShowMoreShowLess: Story = {
30
+ args: {
31
+ text: "Vis resten",
32
+ variant: "show-more-show-less",
33
+ expanded: false,
34
+ },
35
+ };
36
+
37
+ export const ShowMoreShowLessExpanded: Story = {
38
+ args: {
39
+ text: "Skjul resten",
40
+ variant: "show-more-show-less",
41
+ expanded: true,
42
+ },
43
+ };
44
+
45
+ export const SimpleShowMoreShowLess: Story = {
46
+ render: () => {
47
+ const [expanded, setExpanded] = useState(false);
48
+ const elements = Array.from({ length: expanded ? 8 : 3 }, (_, i) => (
49
+ <li key={i}>Hallo {Math.random()}</li>
50
+ ));
51
+ return (
52
+ <>
53
+ <StyledHtml>
54
+ <AutoAnimateHeight animationDuration="quick">
55
+ <ul>{elements}</ul>
56
+ </AutoAnimateHeight>
57
+ </StyledHtml>
58
+ <ShowMoreButton
59
+ variant="show-more-show-less"
60
+ expanded={expanded}
61
+ onClick={() => {
62
+ setExpanded((prev) => !prev);
63
+ }}
64
+ style={{ marginTop: "var(--hds-spacing-24)" }}
65
+ text={expanded ? "Vis færre hendelser" : "Vis flere hendelser"}
66
+ />
67
+ </>
68
+ );
69
+ },
70
+ };
71
+
72
+ export const CompleteShowMoreShowLess: Story = {
73
+ render: () => {
74
+ const [expanded, setExpanded] = useState(false);
75
+ const ref = useRef<HTMLDivElement>(null);
76
+
77
+ const elements = Array.from({ length: expanded ? 40 : 3 }, (_, i) => (
78
+ <li key={i}>Hallo {Math.random()}</li>
79
+ ));
80
+ return (
81
+ <div>
82
+ <div
83
+ style={{
84
+ height: 1400,
85
+ background: "linear-gradient(to bottom, #051937, #004d7a, #008793, #00bf72, #a8eb12)",
86
+ }}
87
+ />
88
+ <StyledHtml ref={ref}>
89
+ <AutoAnimateHeight animationDuration="normal">
90
+ <ul>{elements}</ul>
91
+ </AutoAnimateHeight>
92
+ </StyledHtml>
93
+ <ShowMoreButton
94
+ variant="show-more-show-less"
95
+ expanded={expanded}
96
+ onClick={() => {
97
+ // Using flushSync to ensure the scrollIntoView is called after the state is updated
98
+ flushSync(() => {
99
+ setExpanded((prev) => !prev);
100
+ });
101
+ if (expanded) {
102
+ setTimeout(() => {
103
+ ref.current?.scrollIntoView({ behavior: "smooth", block: "nearest" });
104
+ }, 300); // Wait for the animation to finish
105
+ }
106
+ }}
107
+ style={{ marginTop: "var(--hds-spacing-24)" }}
108
+ text={expanded ? "Vis færre hendelser" : "Vis flere hendelser"}
109
+ />
110
+ <div
111
+ style={{
112
+ height: 1400,
113
+ background: "linear-gradient(to top, #051937, #004d7a, #008793, #00bf72, #a8eb12)",
114
+ }}
115
+ />
116
+ </div>
117
+ );
118
+ },
119
+ };
@@ -0,0 +1,66 @@
1
+ import { clsx } from "@postenbring/hedwig-css/typed-classname";
2
+ import { forwardRef } from "react";
3
+
4
+ type Variant =
5
+ | {
6
+ variant?: "show-more";
7
+ expanded?: never;
8
+ }
9
+ | {
10
+ variant: "show-more-show-less";
11
+ expanded: boolean;
12
+ };
13
+
14
+ export type ShowMoreProps = React.HTMLAttributes<HTMLButtonElement> & {
15
+ text: React.ReactNode;
16
+ } & Variant;
17
+
18
+ /**
19
+ * Simple button for triggering more content.
20
+ *
21
+ * You have to add the logic for what happens when the button is clicked yourself.
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * function Content() {
26
+ * const [items, fetchMoreItems, moreItemsAvailable] = useYourData();
27
+ * function onShowMoreItems() {
28
+ * fetchMoreItems();
29
+ * }
30
+ * return (
31
+ * <>
32
+ * <ul>
33
+ * {items.map((item) => (
34
+ * <li key={item.id}>{item.text}</li>
35
+ * ))}
36
+ * </ul>
37
+ * {moreItemsAvailable ?
38
+ * <ShowMoreButton className="mt-8" onClick={onShowMoreItems} lang="en" /> :
39
+ * null
40
+ * }
41
+ * </>
42
+ * )
43
+ * }
44
+ * ```
45
+ */
46
+ export const ShowMoreButton = forwardRef<HTMLButtonElement, ShowMoreProps>(
47
+ ({ text, variant, expanded, className, ...rest }, ref) => {
48
+ return (
49
+ <button
50
+ ref={ref}
51
+ className={clsx(
52
+ "hds-show-more",
53
+ variant === "show-more-show-less" && "hds-show-more--show-less",
54
+ className as undefined,
55
+ )}
56
+ data-state={expanded ? "expanded" : undefined}
57
+ type="button"
58
+ {...rest}
59
+ >
60
+ {text}
61
+ <span className={clsx("hds-show-more__icon")} />
62
+ </button>
63
+ );
64
+ },
65
+ );
66
+ ShowMoreButton.displayName = "ShowMoreButton";
@@ -0,0 +1,2 @@
1
+ export { Skeleton } from "./skeleton";
2
+ export type * from "./skeleton";
@@ -0,0 +1,152 @@
1
+ /* eslint-disable react-hooks/rules-of-hooks -- storybook story */
2
+ /* eslint-disable import/no-extraneous-dependencies -- storybook story */
3
+ import type { Meta, StoryObj } from "@storybook/react";
4
+ import { useEffect, useState } from "react";
5
+ import { StyledHtml } from "../styled-html";
6
+ import { Card } from "../card";
7
+ import { CardStory } from "../card/card.stories";
8
+ import { PrimaryButton } from "../button";
9
+ import { HStack, VStack } from "../layout";
10
+ import { Skeleton } from ".";
11
+
12
+ const meta: Meta<typeof Skeleton> = {
13
+ title: "Skeleton",
14
+ component: Skeleton,
15
+ };
16
+
17
+ export default meta;
18
+
19
+ type Story = StoryObj<typeof Skeleton>;
20
+
21
+ export const Default: Story = {
22
+ render: () => (
23
+ <VStack gap="8">
24
+ <Skeleton variant="circle">
25
+ <div style={{ height: "6rem", width: "6rem", background: "deeppink" }}>Avatar</div>
26
+ </Skeleton>
27
+ <div>
28
+ <Skeleton variant="text" />
29
+ <Skeleton variant="text" />
30
+ <Skeleton variant="text" width="80%" />
31
+ </div>
32
+ </VStack>
33
+ ),
34
+ };
35
+
36
+ export const LoadingCards: Story = {
37
+ render: () => {
38
+ // @ts-expect-error -- It's ok
39
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- It really is
40
+ const realCard = CardStory.render!({
41
+ style: { width: "400px" },
42
+ });
43
+
44
+ const skeletonCard = (
45
+ <Card
46
+ aria-hidden
47
+ as="div"
48
+ style={{
49
+ width: "400px",
50
+ backgroundColor: "var(--hds-ui-colors-light-grey-fill)",
51
+ }}
52
+ >
53
+ <Card.Media style={{ width: "100%", background: "white" }}>
54
+ <Skeleton variant="rectangle" style={{ width: "100%", aspectRatio: 16 / 9 }} />
55
+ </Card.Media>
56
+ <Card.Body>
57
+ <Card.BodyHeader as="h2">
58
+ <Card.BodyHeaderOverline asChild>
59
+ <Skeleton>Theme</Skeleton>
60
+ </Card.BodyHeaderOverline>
61
+ <Card.BodyHeaderTitle asChild>
62
+ <Skeleton>Cool article</Skeleton>
63
+ </Card.BodyHeaderTitle>
64
+ </Card.BodyHeader>
65
+ <Card.BodyDescription>
66
+ <Skeleton variant="text" />
67
+ <Skeleton variant="text" />
68
+ <Skeleton variant="text" />
69
+ <Skeleton variant="text" />
70
+ <Skeleton variant="text" width="80%" />
71
+ </Card.BodyDescription>
72
+ <Card.BodyAction>
73
+ <Skeleton variant="rectangle" height="1em" width="1em" />
74
+ </Card.BodyAction>
75
+ </Card.Body>
76
+ </Card>
77
+ );
78
+
79
+ const [isLoading, setIsLoading] = useState(true);
80
+ useEffect(() => {
81
+ if (isLoading) {
82
+ setTimeout(
83
+ () => {
84
+ setIsLoading(false);
85
+ },
86
+ randomNumberBetween(2000, 5000),
87
+ );
88
+ }
89
+ }, [isLoading]);
90
+
91
+ const card = isLoading ? skeletonCard : realCard;
92
+ return (
93
+ <div>
94
+ <PrimaryButton
95
+ size="small"
96
+ onClick={() => {
97
+ setIsLoading(true);
98
+ }}
99
+ >
100
+ Reload
101
+ </PrimaryButton>
102
+ <p className="hds-mt-8">Only use greytones, never any red or green colors.</p>
103
+ <HStack className="hds-mt-16" wrap gap="24">
104
+ {card}
105
+ {card}
106
+ {card}
107
+ </HStack>
108
+ </div>
109
+ );
110
+ },
111
+ };
112
+
113
+ function randomNumberBetween(min: number, max: number) {
114
+ return Math.floor(Math.random() * (max - min + 1) + min);
115
+ }
116
+ export const Article: Story = {
117
+ render: () => (
118
+ <StyledHtml aria-hidden>
119
+ <Skeleton variant="text" style={{ font: "var(--hds-typography-h1-display)" }}>
120
+ A title is loading
121
+ </Skeleton>
122
+ <Skeleton variant="rectangle">
123
+ <figure style={{ height: 300, aspectRatio: 16 / 9 }} />
124
+ </Skeleton>
125
+ <Skeleton variant="text" as="h2">
126
+ A subtitle with some more text is loading
127
+ </Skeleton>
128
+ <p>
129
+ <Skeleton variant="text" width={`${randomNumberBetween(75, 90)}%`} />
130
+ <Skeleton variant="text" width={`${randomNumberBetween(75, 90)}%`} />
131
+ <Skeleton variant="text" width={`${randomNumberBetween(25, 60)}%`} />
132
+ <Skeleton variant="text" width={`${randomNumberBetween(45, 80)}%`} />
133
+ <Skeleton variant="text" width={`${randomNumberBetween(75, 90)}%`} />
134
+ <Skeleton variant="text" width={`${randomNumberBetween(75, 90)}%`} />
135
+ <Skeleton variant="text" width={`${randomNumberBetween(75, 90)}%`} />
136
+ </p>
137
+
138
+ <Skeleton variant="text" as="h2">
139
+ Another piece of text
140
+ </Skeleton>
141
+ <p>
142
+ <Skeleton variant="text" width={`${randomNumberBetween(75, 90)}%`} />
143
+ <Skeleton variant="text" width={`${randomNumberBetween(75, 90)}%`} />
144
+ <Skeleton variant="text" width={`${randomNumberBetween(25, 60)}%`} />
145
+ <Skeleton variant="text" width={`${randomNumberBetween(45, 80)}%`} />
146
+ <Skeleton variant="text" width={`${randomNumberBetween(75, 90)}%`} />
147
+ <Skeleton variant="text" width={`${randomNumberBetween(75, 90)}%`} />
148
+ <Skeleton variant="text" width={`${randomNumberBetween(75, 90)}%`} />
149
+ </p>
150
+ </StyledHtml>
151
+ ),
152
+ };