@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.
- package/dist/accordion/accordion-content.d.ts +6 -2
- package/dist/accordion/accordion-content.d.ts.map +1 -0
- package/dist/accordion/accordion-header.d.ts +6 -2
- package/dist/accordion/accordion-header.d.ts.map +1 -0
- package/dist/accordion/accordion-item.d.ts +24 -3
- package/dist/accordion/accordion-item.d.ts.map +1 -0
- package/dist/accordion/accordion.d.ts +44 -2
- package/dist/accordion/accordion.d.ts.map +1 -0
- package/dist/accordion/accordion.js +102 -4
- package/dist/accordion/accordion.js.map +1 -1
- package/dist/accordion/accordion.mjs +5 -1
- package/dist/accordion/context.d.ts +7 -2
- package/dist/accordion/context.d.ts.map +1 -0
- package/dist/accordion/index.d.ts +9 -9
- package/dist/accordion/index.d.ts.map +1 -0
- package/dist/accordion/index.js +52 -53
- package/dist/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs +7 -7
- package/dist/badge/badge.d.ts +21 -5
- package/dist/badge/badge.d.ts.map +1 -0
- package/dist/badge/index.d.ts +3 -6
- package/dist/badge/index.d.ts.map +1 -0
- package/dist/box/box.d.ts +50 -4
- package/dist/box/box.d.ts.map +1 -0
- package/dist/box/box.js +15 -14
- package/dist/box/box.js.map +1 -1
- package/dist/box/box.mjs +1 -1
- package/dist/box/index.d.ts +3 -4
- package/dist/box/index.d.ts.map +1 -0
- package/dist/box/index.js +16 -19
- package/dist/box/index.js.map +1 -1
- package/dist/box/index.mjs +4 -5
- package/dist/breadcrumbs/breadcrumbs.d.ts +33 -2
- package/dist/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/dist/breadcrumbs/index.d.ts +3 -2
- package/dist/breadcrumbs/index.d.ts.map +1 -0
- package/dist/button/button.d.ts +33 -3
- package/dist/button/button.d.ts.map +1 -0
- package/dist/button/index.d.ts +3 -3
- package/dist/button/index.d.ts.map +1 -0
- package/dist/card/card.d.ts +69 -12
- package/dist/card/card.d.ts.map +1 -0
- package/dist/card/card.js +17 -6
- package/dist/card/card.js.map +1 -1
- package/dist/card/card.mjs +1 -1
- package/dist/card/index.d.ts +3 -12
- package/dist/card/index.d.ts.map +1 -0
- package/dist/card/index.js +18 -19
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +4 -5
- package/dist/{chunk-6R7AXKBR.mjs → chunk-35TXKAUH.mjs} +2 -2
- package/dist/chunk-35TXKAUH.mjs.map +1 -0
- package/dist/{chunk-XC3UHH2U.mjs → chunk-3WVRY6CC.mjs} +4 -4
- package/dist/{chunk-XC3UHH2U.mjs.map → chunk-3WVRY6CC.mjs.map} +1 -1
- package/dist/{chunk-67TP3E2D.mjs → chunk-6FBPKLWB.mjs} +3 -3
- package/dist/chunk-6FBPKLWB.mjs.map +1 -0
- package/dist/chunk-7YWW46R3.mjs +1 -0
- package/dist/{chunk-ENKVTAJB.mjs → chunk-AJWSQEDP.mjs} +18 -17
- package/dist/chunk-AJWSQEDP.mjs.map +1 -0
- package/dist/chunk-ARHJZUZG.mjs +1 -0
- package/dist/{chunk-4WQWU5TL.mjs → chunk-AXQCREUJ.mjs} +2 -2
- package/dist/chunk-AXQCREUJ.mjs.map +1 -0
- package/dist/chunk-BCFV6VOE.mjs +1 -0
- package/dist/{chunk-F2C3KZFX.mjs → chunk-BVPSZ3JI.mjs} +2 -2
- package/dist/chunk-BVPSZ3JI.mjs.map +1 -0
- package/dist/{chunk-7JRS4WEB.mjs → chunk-C34HEQXO.mjs} +33 -29
- package/dist/chunk-C34HEQXO.mjs.map +1 -0
- package/dist/chunk-CYDWEPFL.mjs +1 -0
- package/dist/{chunk-PLXB3TNA.mjs → chunk-D7QPJIUZ.mjs} +5 -5
- package/dist/{chunk-PLXB3TNA.mjs.map → chunk-D7QPJIUZ.mjs.map} +1 -1
- package/dist/{chunk-GSJPTZT3.mjs → chunk-FC4CEI2V.mjs} +34 -19
- package/dist/chunk-FC4CEI2V.mjs.map +1 -0
- package/dist/chunk-FYFJ75NX.mjs +1 -0
- package/dist/chunk-FYFJ75NX.mjs.map +1 -0
- package/dist/chunk-G65EYZFQ.mjs +1 -0
- package/dist/chunk-G65EYZFQ.mjs.map +1 -0
- package/dist/chunk-H3E546OT.mjs +1 -0
- package/dist/chunk-H3E546OT.mjs.map +1 -0
- package/dist/chunk-HQVL3ZJ2.mjs +1 -0
- package/dist/chunk-HQVL3ZJ2.mjs.map +1 -0
- package/dist/{chunk-KPGSRU4I.mjs → chunk-M3Y3XOGC.mjs} +13 -1
- package/dist/chunk-M3Y3XOGC.mjs.map +1 -0
- package/dist/{chunk-CIHZDFSQ.mjs → chunk-NU6OSFAU.mjs} +20 -9
- package/dist/chunk-NU6OSFAU.mjs.map +1 -0
- package/dist/{chunk-XUWZ4HGD.mjs → chunk-OGZ2NBMH.mjs} +49 -46
- package/dist/chunk-OGZ2NBMH.mjs.map +1 -0
- package/dist/{chunk-3MQKXNZ6.mjs → chunk-QZZIOBF4.mjs} +13 -1
- package/dist/chunk-QZZIOBF4.mjs.map +1 -0
- package/dist/chunk-RC76SXBP.mjs +1 -0
- package/dist/chunk-RC76SXBP.mjs.map +1 -0
- package/dist/{chunk-TQDUBRCZ.mjs → chunk-SQ63E7KM.mjs} +24 -22
- package/dist/chunk-SQ63E7KM.mjs.map +1 -0
- package/dist/{chunk-DEX36MFK.mjs → chunk-TDXU2IC6.mjs} +3 -4
- package/dist/chunk-TDXU2IC6.mjs.map +1 -0
- package/dist/{chunk-ES6ISHOV.mjs → chunk-UP3M3NEZ.mjs} +14 -13
- package/dist/{chunk-ES6ISHOV.mjs.map → chunk-UP3M3NEZ.mjs.map} +1 -1
- package/dist/chunk-ZKMFJZSH.mjs +1 -0
- package/dist/chunk-ZKMFJZSH.mjs.map +1 -0
- package/dist/description-list/description-list.d.ts +42 -2
- package/dist/description-list/description-list.d.ts.map +1 -0
- package/dist/description-list/index.d.ts +3 -2
- package/dist/description-list/index.d.ts.map +1 -0
- package/dist/footer/footer.d.ts +67 -7
- package/dist/footer/footer.d.ts.map +1 -0
- package/dist/footer/footer.js +79 -76
- package/dist/footer/footer.js.map +1 -1
- package/dist/footer/footer.mjs +4 -4
- package/dist/footer/index.d.ts +3 -7
- package/dist/footer/index.d.ts.map +1 -0
- package/dist/footer/index.js +80 -84
- package/dist/footer/index.js.map +1 -1
- package/dist/footer/index.mjs +7 -8
- package/dist/form/checkbox/checkbox.d.ts +28 -2
- package/dist/form/checkbox/checkbox.d.ts.map +1 -0
- package/dist/form/checkbox/index.d.ts +3 -2
- package/dist/form/checkbox/index.d.ts.map +1 -0
- package/dist/form/date-picker/date-picker.d.ts +33 -2
- package/dist/form/date-picker/date-picker.d.ts.map +1 -0
- package/dist/form/date-picker/date-picker.js +1 -1
- package/dist/form/date-picker/date-picker.js.map +1 -1
- package/dist/form/date-picker/date-picker.mjs +2 -2
- package/dist/form/date-picker/index.d.ts +3 -2
- package/dist/form/date-picker/index.d.ts.map +1 -0
- package/dist/form/date-picker/index.js +1 -1
- package/dist/form/date-picker/index.js.map +1 -1
- package/dist/form/date-picker/index.mjs +2 -2
- package/dist/form/error-message/error-message.d.ts +8 -2
- package/dist/form/error-message/error-message.d.ts.map +1 -0
- package/dist/form/error-message/index.d.ts +3 -2
- package/dist/form/error-message/index.d.ts.map +1 -0
- package/dist/form/fieldset/fieldset.d.ts +22 -3
- package/dist/form/fieldset/fieldset.d.ts.map +1 -0
- package/dist/form/fieldset/index.d.ts +3 -3
- package/dist/form/fieldset/index.d.ts.map +1 -0
- package/dist/form/index.d.ts +9 -20
- package/dist/form/index.d.ts.map +1 -0
- package/dist/form/index.js +1 -1
- package/dist/form/index.js.map +1 -1
- package/dist/form/index.mjs +2 -2
- package/dist/form/input/index.d.ts +3 -2
- package/dist/form/input/index.d.ts.map +1 -0
- package/dist/form/input/input.d.ts +5 -2
- package/dist/form/input/input.d.ts.map +1 -0
- package/dist/form/input-group/index.d.ts +3 -2
- package/dist/form/input-group/index.d.ts.map +1 -0
- package/dist/form/input-group/input-group.d.ts +27 -2
- package/dist/form/input-group/input-group.d.ts.map +1 -0
- package/dist/form/radiobutton/index.d.ts +5 -5
- package/dist/form/radiobutton/index.d.ts.map +1 -0
- package/dist/form/radiobutton/radiobutton.d.ts +17 -2
- package/dist/form/radiobutton/radiobutton.d.ts.map +1 -0
- package/dist/form/radiobutton/radiogroup.d.ts +24 -3
- package/dist/form/radiobutton/radiogroup.d.ts.map +1 -0
- package/dist/form/select/index.d.ts +3 -2
- package/dist/form/select/index.d.ts.map +1 -0
- package/dist/form/select/select.d.ts +9 -2
- package/dist/form/select/select.d.ts.map +1 -0
- package/dist/form/textarea/index.d.ts +3 -2
- package/dist/form/textarea/index.d.ts.map +1 -0
- package/dist/form/textarea/textarea.d.ts +5 -2
- package/dist/form/textarea/textarea.d.ts.map +1 -0
- package/dist/help-text/help-text.d.ts +51 -1
- package/dist/help-text/help-text.d.ts.map +1 -0
- package/dist/help-text/help-text.js +17 -20
- package/dist/help-text/help-text.js.map +1 -1
- package/dist/help-text/help-text.mjs +3 -3
- package/dist/help-text/index.d.ts +3 -1
- package/dist/help-text/index.d.ts.map +1 -0
- package/dist/help-text/index.js +17 -20
- package/dist/help-text/index.js.map +1 -1
- package/dist/help-text/index.mjs +3 -3
- package/dist/index-no-css.d.ts +26 -128
- package/dist/index-no-css.d.ts.map +1 -0
- package/dist/index-no-css.js +385 -398
- package/dist/index-no-css.js.map +1 -1
- package/dist/index-no-css.mjs +70 -68
- package/dist/index.d.ts +11 -128
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +385 -398
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +70 -68
- package/dist/index.mjs.map +1 -1
- package/dist/layout/container/container.d.ts +23 -2
- package/dist/layout/container/container.d.ts.map +1 -0
- package/dist/layout/grid/grid.d.ts +101 -4
- package/dist/layout/grid/grid.d.ts.map +1 -0
- package/dist/layout/grid/grid.js +11 -10
- package/dist/layout/grid/grid.js.map +1 -1
- package/dist/layout/grid/grid.mjs +1 -1
- package/dist/layout/grid/index.d.ts +3 -4
- package/dist/layout/grid/index.d.ts.map +1 -0
- package/dist/layout/grid/index.js +12 -15
- package/dist/layout/grid/index.js.map +1 -1
- package/dist/layout/grid/index.mjs +4 -5
- package/dist/layout/index.d.ts +4 -10
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +12 -15
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/index.mjs +4 -5
- package/dist/layout/responsive.d.ts +10 -2
- package/dist/layout/responsive.d.ts.map +1 -0
- package/dist/layout/spacing.d.ts +33 -3
- package/dist/layout/spacing.d.ts.map +1 -0
- package/dist/layout/stack/index.d.ts +3 -4
- package/dist/layout/stack/index.d.ts.map +1 -0
- package/dist/layout/stack/stack.d.ts +62 -4
- package/dist/layout/stack/stack.d.ts.map +1 -0
- package/dist/link/index.d.ts +3 -2
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/link.d.ts +20 -2
- package/dist/link/link.d.ts.map +1 -0
- package/dist/list/index.d.ts +5 -5
- package/dist/list/index.d.ts.map +1 -0
- package/dist/list/link-list.d.ts +12 -2
- package/dist/list/link-list.d.ts.map +1 -0
- package/dist/list/list.d.ts +40 -3
- package/dist/list/list.d.ts.map +1 -0
- package/dist/message/index.d.ts +3 -3
- package/dist/message/index.d.ts.map +1 -0
- package/dist/message/index.js +36 -38
- package/dist/message/index.js.map +1 -1
- package/dist/message/index.mjs +5 -6
- package/dist/message/message.d.ts +36 -4
- package/dist/message/message.d.ts.map +1 -0
- package/dist/message/message.js +35 -32
- package/dist/message/message.js.map +1 -1
- package/dist/message/message.mjs +2 -2
- package/dist/modal/index.d.ts +3 -5
- package/dist/modal/index.d.ts.map +1 -0
- package/dist/modal/index.js +61 -63
- package/dist/modal/index.js.map +1 -1
- package/dist/modal/index.mjs +6 -7
- package/dist/modal/modal.d.ts +81 -5
- package/dist/modal/modal.d.ts.map +1 -0
- package/dist/modal/modal.js +60 -56
- package/dist/modal/modal.js.map +1 -1
- package/dist/modal/modal.mjs +3 -3
- package/dist/navbar/icons.d.ts +3 -2
- package/dist/navbar/icons.d.ts.map +1 -0
- package/dist/navbar/index.d.ts +4 -13
- package/dist/navbar/index.d.ts.map +1 -0
- package/dist/navbar/index.js +145 -146
- package/dist/navbar/index.js.map +1 -1
- package/dist/navbar/index.mjs +6 -7
- package/dist/navbar/navbar-expandable-menu.d.ts +35 -7
- package/dist/navbar/navbar-expandable-menu.d.ts.map +1 -0
- package/dist/navbar/navbar-expandable-menu.js +1 -1
- package/dist/navbar/navbar-expandable-menu.js.map +1 -1
- package/dist/navbar/navbar-expandable-menu.mjs +2 -2
- package/dist/navbar/navbar.d.ts +130 -9
- package/dist/navbar/navbar.d.ts.map +1 -0
- package/dist/navbar/navbar.js +237 -28
- package/dist/navbar/navbar.js.map +1 -1
- package/dist/navbar/navbar.mjs +4 -1
- package/dist/show-more/index.d.ts +5 -4
- package/dist/show-more/index.d.ts.map +1 -0
- package/dist/show-more/index.js +3 -3
- package/dist/show-more/index.js.map +1 -1
- package/dist/show-more/index.mjs +2 -2
- package/dist/show-more/show-more.d.ts +42 -2
- package/dist/show-more/show-more.d.ts.map +1 -0
- package/dist/skeleton/index.d.ts +3 -2
- package/dist/skeleton/index.d.ts.map +1 -0
- package/dist/skeleton/skeleton.d.ts +67 -2
- package/dist/skeleton/skeleton.d.ts.map +1 -0
- package/dist/step-indicator/index.d.ts +3 -1
- package/dist/step-indicator/index.d.ts.map +1 -0
- package/dist/step-indicator/step-indicator.d.ts +36 -1
- package/dist/step-indicator/step-indicator.d.ts.map +1 -0
- package/dist/styled-html/index.d.ts +3 -2
- package/dist/styled-html/index.d.ts.map +1 -0
- package/dist/styled-html/styled-html.d.ts +36 -2
- package/dist/styled-html/styled-html.d.ts.map +1 -0
- package/dist/table/index.d.ts +3 -1
- package/dist/table/index.d.ts.map +1 -0
- package/dist/table/table.d.ts +25 -1
- package/dist/table/table.d.ts.map +1 -0
- package/dist/tabs/context.d.ts +8 -3
- package/dist/tabs/context.d.ts.map +1 -0
- package/dist/tabs/index.d.ts +7 -10
- package/dist/tabs/index.d.ts.map +1 -0
- package/dist/tabs/index.js +35 -38
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +6 -6
- package/dist/tabs/tabs-content.d.ts +26 -4
- package/dist/tabs/tabs-content.d.ts.map +1 -0
- package/dist/tabs/tabs-list.d.ts +21 -4
- package/dist/tabs/tabs-list.d.ts.map +1 -0
- package/dist/tabs/tabs-list.js +1 -1
- package/dist/tabs/tabs-list.js.map +1 -1
- package/dist/tabs/tabs-list.mjs +2 -2
- package/dist/tabs/tabs.d.ts +26 -2
- package/dist/tabs/tabs.d.ts.map +1 -0
- package/dist/tabs/tabs.js +205 -8
- package/dist/tabs/tabs.js.map +1 -1
- package/dist/tabs/tabs.mjs +4 -1
- package/dist/text/index.d.ts +4 -2
- package/dist/text/index.d.ts.map +1 -0
- package/dist/text/text.d.ts +58 -2
- package/dist/text/text.d.ts.map +1 -0
- package/dist/utils/auto-animate-height.d.ts +33 -0
- package/dist/utils/auto-animate-height.d.ts.map +1 -0
- package/dist/{utilities → utils}/auto-animate-height.js +3 -3
- package/dist/utils/auto-animate-height.js.map +1 -0
- package/dist/utils/auto-animate-height.mjs +9 -0
- package/dist/utils/auto-animate-height.mjs.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/{utilities → utils}/index.js +81 -11
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +19 -0
- package/dist/utils/index.mjs.map +1 -0
- package/dist/utils/utils.d.ts +24 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/{utils.js → utils/utils.js} +1 -3
- package/dist/utils/utils.js.map +1 -0
- package/dist/utils/utils.mjs +14 -0
- package/dist/utils/utils.mjs.map +1 -0
- package/dist/warning-banner/index.d.ts +3 -2
- package/dist/warning-banner/index.d.ts.map +1 -0
- package/dist/warning-banner/index.js +16 -19
- package/dist/warning-banner/index.js.map +1 -1
- package/dist/warning-banner/index.mjs +3 -3
- package/dist/warning-banner/warning-banner.d.ts +8 -2
- package/dist/warning-banner/warning-banner.d.ts.map +1 -0
- package/dist/warning-banner/warning-banner.js +16 -19
- package/dist/warning-banner/warning-banner.js.map +1 -1
- package/dist/warning-banner/warning-banner.mjs +3 -3
- package/package.json +12 -8
- package/src/accordion/accordion-content.tsx +31 -0
- package/src/accordion/accordion-header.tsx +36 -0
- package/src/accordion/accordion-item.tsx +62 -0
- package/src/accordion/accordion.stories.tsx +154 -0
- package/src/accordion/accordion.tsx +68 -0
- package/src/accordion/context.ts +8 -0
- package/src/accordion/index.tsx +9 -0
- package/src/badge/badge.stories.tsx +44 -0
- package/src/badge/badge.tsx +63 -0
- package/src/badge/index.tsx +3 -0
- package/src/box/box.stories.tsx +112 -0
- package/src/box/box.tsx +122 -0
- package/src/box/index.tsx +3 -0
- package/src/breadcrumbs/breadcrumbs.stories.tsx +50 -0
- package/src/breadcrumbs/breadcrumbs.tsx +47 -0
- package/src/breadcrumbs/index.tsx +3 -0
- package/src/button/button.stories.tsx +104 -0
- package/src/button/button.tsx +87 -0
- package/src/button/index.tsx +3 -0
- package/src/card/card.stories.tsx +82 -0
- package/src/card/card.tsx +222 -0
- package/src/card/index.tsx +14 -0
- package/src/description-list/description-list.stories.tsx +95 -0
- package/src/description-list/description-list.tsx +61 -0
- package/src/description-list/index.tsx +2 -0
- package/src/footer/footer.tsx +169 -0
- package/src/footer/index.tsx +9 -0
- package/src/form/checkbox/checkbox.stories.tsx +104 -0
- package/src/form/checkbox/checkbox.tsx +82 -0
- package/src/form/checkbox/index.tsx +2 -0
- package/src/form/date-picker/date-picker.stories.tsx +27 -0
- package/src/form/date-picker/date-picker.tsx +85 -0
- package/src/form/date-picker/index.tsx +2 -0
- package/src/form/error-message/error-message.stories.tsx +19 -0
- package/src/form/error-message/error-message.tsx +25 -0
- package/src/form/error-message/index.tsx +2 -0
- package/src/form/fieldset/fieldset.stories.tsx +86 -0
- package/src/form/fieldset/fieldset.tsx +64 -0
- package/src/form/fieldset/index.tsx +2 -0
- package/src/form/index.tsx +8 -0
- package/src/form/input/index.tsx +2 -0
- package/src/form/input/input.stories.tsx +166 -0
- package/src/form/input/input.tsx +30 -0
- package/src/form/input-group/index.tsx +2 -0
- package/src/form/input-group/input-group.tsx +106 -0
- package/src/form/radiobutton/index.tsx +4 -0
- package/src/form/radiobutton/radiobutton.stories.tsx +93 -0
- package/src/form/radiobutton/radiobutton.tsx +85 -0
- package/src/form/radiobutton/radiogroup.stories.tsx +39 -0
- package/src/form/radiobutton/radiogroup.tsx +52 -0
- package/src/form/select/index.tsx +2 -0
- package/src/form/select/select.stories.tsx +93 -0
- package/src/form/select/select.tsx +33 -0
- package/src/form/textarea/index.tsx +2 -0
- package/src/form/textarea/textarea.stories.tsx +106 -0
- package/src/form/textarea/textarea.tsx +33 -0
- package/src/help-text/help-text.tsx +98 -0
- package/src/help-text/index.ts +2 -0
- package/src/index-no-css.tsx +25 -0
- package/src/index.tsx +11 -0
- package/src/layout/container/container.stories.tsx +62 -0
- package/src/layout/container/container.tsx +47 -0
- package/src/layout/grid/grid.tsx +163 -0
- package/src/layout/grid/index.tsx +3 -0
- package/src/layout/index.tsx +3 -0
- package/src/layout/responsive.ts +26 -0
- package/src/layout/spacing.ts +37 -0
- package/src/layout/stack/index.tsx +2 -0
- package/src/layout/stack/stack.tsx +128 -0
- package/src/link/index.tsx +3 -0
- package/src/link/link.stories.tsx +64 -0
- package/src/link/link.tsx +46 -0
- package/src/list/index.tsx +5 -0
- package/src/list/link-list.stories.tsx +38 -0
- package/src/list/link-list.tsx +26 -0
- package/src/list/list.stories.tsx +71 -0
- package/src/list/list.tsx +65 -0
- package/src/message/index.tsx +2 -0
- package/src/message/message.stories.tsx +93 -0
- package/src/message/message.tsx +89 -0
- package/src/modal/index.tsx +3 -0
- package/src/modal/modal.stories.tsx +147 -0
- package/src/modal/modal.tsx +199 -0
- package/src/navbar/icons.tsx +21 -0
- package/src/navbar/index.tsx +18 -0
- package/src/navbar/navbar-expandable-menu.tsx +176 -0
- package/src/navbar/navbar.stories.tsx +99 -0
- package/src/navbar/navbar.tsx +264 -0
- package/src/show-more/index.ts +5 -0
- package/src/show-more/show-more.stories.tsx +119 -0
- package/src/show-more/show-more.tsx +66 -0
- package/src/skeleton/index.ts +2 -0
- package/src/skeleton/skeleton.stories.tsx +152 -0
- package/src/skeleton/skeleton.tsx +114 -0
- package/src/step-indicator/index.ts +2 -0
- package/src/step-indicator/step-indicator.stories.tsx +50 -0
- package/src/step-indicator/step-indicator.tsx +116 -0
- package/src/styled-html/index.ts +2 -0
- package/src/styled-html/styled-html.stories.tsx +189 -0
- package/src/styled-html/styled-html.tsx +59 -0
- package/src/table/index.ts +2 -0
- package/src/table/table.tsx +59 -0
- package/src/tabs/context.ts +18 -0
- package/src/tabs/index.tsx +7 -0
- package/src/tabs/tabs-content.tsx +62 -0
- package/src/tabs/tabs-list.tsx +129 -0
- package/src/tabs/tabs.stories.tsx +138 -0
- package/src/tabs/tabs.tsx +50 -0
- package/src/text/index.tsx +4 -0
- package/src/text/text.stories.tsx +112 -0
- package/src/text/text.tsx +129 -0
- package/src/utils/auto-animate-height.tsx +139 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/utils.ts +110 -0
- package/src/warning-banner/index.tsx +2 -0
- package/src/warning-banner/warning-banner.stories.tsx +43 -0
- package/src/warning-banner/warning-banner.tsx +79 -0
- package/dist/_tsup-dts-rollup.d.mts +0 -2600
- package/dist/_tsup-dts-rollup.d.ts +0 -2600
- package/dist/accordion/accordion-content.d.mts +0 -2
- package/dist/accordion/accordion-header.d.mts +0 -2
- package/dist/accordion/accordion-item.d.mts +0 -3
- package/dist/accordion/accordion.d.mts +0 -2
- package/dist/accordion/context.d.mts +0 -2
- package/dist/accordion/index.d.mts +0 -9
- package/dist/badge/badge.d.mts +0 -5
- package/dist/badge/index.d.mts +0 -6
- package/dist/box/box.d.mts +0 -4
- package/dist/box/index.d.mts +0 -4
- package/dist/breadcrumbs/breadcrumbs.d.mts +0 -2
- package/dist/breadcrumbs/index.d.mts +0 -2
- package/dist/button/button.d.mts +0 -3
- package/dist/button/index.d.mts +0 -3
- package/dist/card/card.d.mts +0 -12
- package/dist/card/index.d.mts +0 -12
- package/dist/chunk-3MQKXNZ6.mjs.map +0 -1
- package/dist/chunk-3NDUE23B.mjs +0 -19
- package/dist/chunk-3NDUE23B.mjs.map +0 -1
- package/dist/chunk-3NL3TOZF.mjs +0 -13
- package/dist/chunk-3NL3TOZF.mjs.map +0 -1
- package/dist/chunk-3ZFEUABU.mjs +0 -23
- package/dist/chunk-3ZFEUABU.mjs.map +0 -1
- package/dist/chunk-4WQWU5TL.mjs.map +0 -1
- package/dist/chunk-67TP3E2D.mjs.map +0 -1
- package/dist/chunk-6R7AXKBR.mjs.map +0 -1
- package/dist/chunk-722MZPXO.mjs +0 -13
- package/dist/chunk-722MZPXO.mjs.map +0 -1
- package/dist/chunk-7JRS4WEB.mjs.map +0 -1
- package/dist/chunk-CIHZDFSQ.mjs.map +0 -1
- package/dist/chunk-CYEYGPRH.mjs +0 -17
- package/dist/chunk-CYEYGPRH.mjs.map +0 -1
- package/dist/chunk-DEX36MFK.mjs.map +0 -1
- package/dist/chunk-DZNH5JHY.mjs +0 -1
- package/dist/chunk-ENKVTAJB.mjs.map +0 -1
- package/dist/chunk-F2C3KZFX.mjs.map +0 -1
- package/dist/chunk-GSJPTZT3.mjs.map +0 -1
- package/dist/chunk-IJAX6APL.mjs +0 -23
- package/dist/chunk-IJAX6APL.mjs.map +0 -1
- package/dist/chunk-IKJJWKXM.mjs +0 -15
- package/dist/chunk-IKJJWKXM.mjs.map +0 -1
- package/dist/chunk-KPGSRU4I.mjs.map +0 -1
- package/dist/chunk-PT5H3QV6.mjs +0 -29
- package/dist/chunk-PT5H3QV6.mjs.map +0 -1
- package/dist/chunk-TQDUBRCZ.mjs.map +0 -1
- package/dist/chunk-V6UKKHKD.mjs +0 -33
- package/dist/chunk-V6UKKHKD.mjs.map +0 -1
- package/dist/chunk-XUWZ4HGD.mjs.map +0 -1
- package/dist/description-list/description-list.d.mts +0 -2
- package/dist/description-list/index.d.mts +0 -2
- package/dist/footer/footer.d.mts +0 -7
- package/dist/footer/index.d.mts +0 -7
- package/dist/form/checkbox/checkbox.d.mts +0 -2
- package/dist/form/checkbox/index.d.mts +0 -2
- package/dist/form/date-picker/date-picker.d.mts +0 -2
- package/dist/form/date-picker/index.d.mts +0 -2
- package/dist/form/error-message/error-message.d.mts +0 -2
- package/dist/form/error-message/index.d.mts +0 -2
- package/dist/form/fieldset/fieldset.d.mts +0 -3
- package/dist/form/fieldset/index.d.mts +0 -3
- package/dist/form/index.d.mts +0 -20
- package/dist/form/input/index.d.mts +0 -2
- package/dist/form/input/input.d.mts +0 -2
- package/dist/form/input-group/index.d.mts +0 -2
- package/dist/form/input-group/input-group.d.mts +0 -2
- package/dist/form/radiobutton/index.d.mts +0 -5
- package/dist/form/radiobutton/radiobutton.d.mts +0 -2
- package/dist/form/radiobutton/radiogroup.d.mts +0 -3
- package/dist/form/select/index.d.mts +0 -2
- package/dist/form/select/select.d.mts +0 -2
- package/dist/form/textarea/index.d.mts +0 -2
- package/dist/form/textarea/textarea.d.mts +0 -2
- package/dist/help-text/help-text.d.mts +0 -1
- package/dist/help-text/index.d.mts +0 -1
- package/dist/index-no-css.d.mts +0 -128
- package/dist/index.d.mts +0 -128
- package/dist/layout/container/container.d.mts +0 -2
- package/dist/layout/grid/grid.d.mts +0 -4
- package/dist/layout/grid/index.d.mts +0 -4
- package/dist/layout/index.d.mts +0 -10
- package/dist/layout/responsive.d.mts +0 -2
- package/dist/layout/spacing.d.mts +0 -3
- package/dist/layout/stack/index.d.mts +0 -4
- package/dist/layout/stack/stack.d.mts +0 -4
- package/dist/link/index.d.mts +0 -2
- package/dist/link/link.d.mts +0 -2
- package/dist/list/index.d.mts +0 -5
- package/dist/list/link-list.d.mts +0 -2
- package/dist/list/list.d.mts +0 -3
- package/dist/message/index.d.mts +0 -3
- package/dist/message/message.d.mts +0 -4
- package/dist/modal/index.d.mts +0 -5
- package/dist/modal/modal.d.mts +0 -5
- package/dist/navbar/icons.d.mts +0 -2
- package/dist/navbar/index.d.mts +0 -13
- package/dist/navbar/navbar-expandable-menu.d.mts +0 -7
- package/dist/navbar/navbar.d.mts +0 -9
- package/dist/show-more/index.d.mts +0 -4
- package/dist/show-more/show-more.d.mts +0 -2
- package/dist/skeleton/index.d.mts +0 -2
- package/dist/skeleton/skeleton.d.mts +0 -2
- package/dist/step-indicator/index.d.mts +0 -1
- package/dist/step-indicator/step-indicator.d.mts +0 -1
- package/dist/styled-html/index.d.mts +0 -2
- package/dist/styled-html/styled-html.d.mts +0 -2
- package/dist/table/index.d.mts +0 -1
- package/dist/table/table.d.mts +0 -1
- package/dist/tabs/context.d.mts +0 -3
- package/dist/tabs/index.d.mts +0 -10
- package/dist/tabs/tabs-content.d.mts +0 -4
- package/dist/tabs/tabs-list.d.mts +0 -4
- package/dist/tabs/tabs.d.mts +0 -2
- package/dist/text/index.d.mts +0 -2
- package/dist/text/text.d.mts +0 -2
- package/dist/utilities/auto-animate-height.d.mts +0 -2
- package/dist/utilities/auto-animate-height.d.ts +0 -2
- package/dist/utilities/auto-animate-height.js.map +0 -1
- package/dist/utilities/auto-animate-height.mjs +0 -9
- package/dist/utilities/index.d.mts +0 -2
- package/dist/utilities/index.d.ts +0 -2
- package/dist/utilities/index.js.map +0 -1
- package/dist/utilities/index.mjs +0 -10
- package/dist/utils.d.mts +0 -5
- package/dist/utils.d.ts +0 -5
- package/dist/utils.js.map +0 -1
- package/dist/utils.mjs +0 -16
- package/dist/warning-banner/index.d.mts +0 -2
- package/dist/warning-banner/warning-banner.d.mts +0 -2
- /package/dist/{chunk-DZNH5JHY.mjs.map → chunk-7YWW46R3.mjs.map} +0 -0
- /package/dist/{utilities/auto-animate-height.mjs.map → chunk-ARHJZUZG.mjs.map} +0 -0
- /package/dist/{utilities/index.mjs.map → chunk-BCFV6VOE.mjs.map} +0 -0
- /package/dist/{utils.mjs.map → chunk-CYDWEPFL.mjs.map} +0 -0
|
@@ -180,7 +180,7 @@ var InputGroup = (0, import_react2.forwardRef)(function InputGroup2(_a, ref) {
|
|
|
180
180
|
);
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
// src/utils.ts
|
|
183
|
+
// src/utils/utils.ts
|
|
184
184
|
var React = __toESM(require("react"));
|
|
185
185
|
var import_react3 = require("react");
|
|
186
186
|
function useMergeRefs(refs) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/form/date-picker/index.tsx","../../../src/form/date-picker/date-picker.tsx","../../../src/form/input-group/input-group.tsx","../../../src/form/error-message/error-message.tsx","../../../src/utils.ts"],"sourcesContent":["export { DatePicker } from \"./date-picker\";\nexport type * from \"./date-picker\";\n","import { forwardRef, useRef, type InputHTMLAttributes } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { InputGroup, type InputGroupProps } from \"../input-group\";\nimport { useMergeRefs } from \"../../utils\";\n\nexport type DatePickerProps = Omit<\n InputGroupProps & InputHTMLAttributes<HTMLInputElement>,\n \"children\" | \"type\"\n> & {\n /**\n * Accessible title for the calendar button\n *\n * This button currently only shows in Chrome.\n *\n * @defaultValue \"Åpne kalender\"\n */\n calendarButtonTitle?: string;\n};\n\n/**\n * A basic implementation of a date picker\n *\n * This date picker is an implementation of native date picker, as you get\n * with `<input type=\"date\" />`, where the input field is dressed in Hedwig styling.\n *\n * Due to accessibility concerns you will only see the appropriate Hedwig calendar\n * icon in Chrome. Firefox will show built in icon and Safari will show no icon.\n * Not tested in Edge.\n */\nexport const DatePicker = forwardRef<HTMLInputElement, DatePickerProps>(function DatePicker(\n {\n className,\n variant,\n errorMessage,\n labelProps,\n label,\n id,\n style,\n disabled,\n readOnly,\n calendarButtonTitle = \"Åpne kalender\",\n ...rest\n },\n ref,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n const mergedRef = useMergeRefs([inputRef, ref]);\n\n return (\n <InputGroup\n className={clsx(\"hds-date-picker\", className as undefined)}\n disabled={disabled}\n errorMessage={errorMessage}\n id={id}\n label={label}\n labelProps={labelProps}\n readOnly={readOnly}\n style={style}\n variant={variant}\n >\n {(inputProps) => (\n <>\n <input\n {...rest}\n {...inputProps}\n disabled={disabled}\n readOnly={readOnly}\n ref={mergedRef}\n type=\"date\"\n />\n <button\n className={clsx(\"hds-date-picker__calendar-button\")}\n type=\"button\"\n title={calendarButtonTitle}\n onClick={() => {\n inputRef.current?.showPicker();\n }}\n />\n </>\n )}\n </InputGroup>\n );\n});\n\nDatePicker.displayName = \"DatePicker\";\n","import { useId, forwardRef, Children, isValidElement, cloneElement } from \"react\";\nimport type { LabelHTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\n\ninterface InputProps {\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: boolean;\n id?: string;\n className?: string;\n}\n\nexport interface InputGroupProps {\n id?: string;\n className?: string;\n style?: CSSProperties;\n variant?: \"default\" | \"white\";\n errorMessage?: ReactNode;\n labelProps?: LabelHTMLAttributes<HTMLLabelElement>;\n label: ReactNode;\n disabled?: boolean;\n readOnly?: boolean;\n /**\n * `children` must be either a single input element or a render function.\n *\n * If you use a render function, make sure you spread the input props to the appropriate element.\n */\n children: Exclude<ReactNode, Iterable<ReactNode>> | ((inputProps: InputProps) => ReactNode);\n}\n\nexport const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function InputGroup(\n {\n id,\n className,\n style,\n variant = \"default\",\n errorMessage,\n labelProps: { className: labelClassName, ...labelProps } = {},\n label,\n disabled,\n readOnly,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n const inputId = useId();\n\n const renderInput = () => {\n const inputProps: InputProps = {\n \"aria-describedby\": errorMessage ? errorMessageId : undefined,\n \"aria-invalid\": errorMessage ? true : undefined,\n id: id ?? inputId,\n className: clsx(\"hds-input-group__input\"),\n };\n\n if (typeof children === \"function\") {\n return children(inputProps);\n }\n\n const input: ReactNode = Children.toArray(children)[0];\n\n if (!isValidElement<InputProps>(input)) {\n return;\n }\n\n return cloneElement<InputProps>(input, {\n ...inputProps,\n ...input.props,\n className: `${inputProps.className} ${input.props.className ?? \"\"}`,\n });\n };\n\n return (\n <div\n className={clsx(\n \"hds-input-group\",\n {\n [`hds-input-group--${variant}`]: variant,\n \"hds-input-group--error\": errorMessage,\n },\n className as undefined,\n )}\n ref={ref}\n style={style}\n {...rest}\n >\n <label\n className={clsx(\"hds-input-group__label\", labelClassName as undefined)}\n {...labelProps}\n htmlFor={id ?? inputId}\n >\n {label}\n </label>\n <div\n className={clsx(\"hds-input-group__input-wrapper\")}\n data-disabled={disabled}\n data-readonly={readOnly}\n >\n {renderInput()}\n </div>\n <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage>\n </div>\n );\n});\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef, type ReactNode } from \"react\";\n\nexport interface ErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n id: string;\n className?: string;\n}\n\nexport const ErrorMessage = forwardRef<HTMLDivElement, ErrorMessageProps>(\n ({ children, id, className, ...rest }, ref) => {\n return (\n <div\n aria-live=\"assertive\"\n className={clsx(\"hds-error-message\", className as undefined)}\n id={id}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\nErrorMessage.displayName = \"ErrorMessage\";\n","import * as React from \"react\";\nimport { useCallback, useEffect, useState } from \"react\";\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n * @see https://floating-ui.com/docs/useMergeRefs\n */\nexport function useMergeRefs<Instance>(\n refs: (React.Ref<Instance> | undefined)[],\n): React.RefCallback<Instance> | null {\n return React.useMemo(() => {\n if (refs.every((ref) => ref === null)) {\n return null;\n }\n\n return (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref !== null) {\n (ref as React.MutableRefObject<Instance | null>).current = value;\n }\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- It's ok\n }, refs);\n}\n\nexport function useResize<Instance extends HTMLElement>(\n ref: React.RefObject<Instance> | undefined | null,\n): { width: number; height: number } {\n const [width, setWidth] = useState<number>(0);\n const [height, setHeight] = useState<number>(0);\n const handleResize = useCallback(() => {\n if (ref?.current !== null) {\n setWidth(ref?.current?.offsetWidth ?? 0);\n setHeight(ref?.current?.offsetHeight ?? 0);\n }\n }, [ref]);\n useEffect(() => {\n window.addEventListener(\"load\", handleResize);\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"load\", handleResize);\n window.removeEventListener(\"resize\", handleResize);\n };\n }, [ref, handleResize]);\n useEffect(() => {\n handleResize();\n // eslint-disable-next-line react-hooks/exhaustive-deps -- It's ok\n }, []);\n return { width, height };\n}\n\nfunction subscribe() {\n // eslint-disable-next-line @typescript-eslint/no-empty-function -- It's ok\n return () => {};\n}\n\nexport function useHydrated() {\n return React.useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n );\n}\n\n/**\n * Trap focus inside an element using the `inert` attribute.\n *\n * Adds `inert` to all siblings of the given element, and all their ancestors up to the body.\n * Returns a cleanup function which removes the `inert` property from the elements, effectively giving focus back to rest of the document.\n *\n * NOTE: Does not support portals, i.e. elements outside the DOM hierarchy of the given element.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\n * @see https://web.dev/articles/inert\n */\nexport function focusTrap(element: HTMLElement) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function -- NOP on focus trapping the body element\n if (element === document.body) return () => {};\n\n let inertElements: HTMLElement[] = [];\n for (let el: HTMLElement | null = element; el; el = el.parentElement) {\n if (el === document.body) break;\n\n for (const sibling of el.parentElement?.children ?? []) {\n if (sibling === el) continue;\n if (!(sibling instanceof HTMLElement)) continue;\n if (sibling.hasAttribute(\"inert\")) continue;\n\n sibling.setAttribute(\"inert\", \"true\");\n inertElements.push(sibling);\n }\n }\n\n return () => {\n releaseFocusTrap(inertElements);\n inertElements = [];\n };\n}\n\n/**\n * Unset the `inert` attribute on all elements given\n */\nexport function releaseFocusTrap(inertElements: Iterable<HTMLElement>) {\n for (const el of inertElements) {\n el.removeAttribute(\"inert\");\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA6D;AAC7D,IAAAC,0BAAqB;;;ACDrB,IAAAC,gBAA0E;AAE1E,IAAAC,0BAAqB;;;ACFrB,6BAAqB;AACrB,mBAA2C;AAWrC;AAHC,IAAM,mBAAe;AAAA,EAC1B,CAAC,IAAsC,QAAQ;AAA9C,iBAAE,YAAU,IAAI,UAVnB,IAUG,IAA8B,iBAA9B,IAA8B,CAA5B,YAAU,MAAI;AACf,WACE;AAAA,MAAC;AAAA;AAAA,QACC,aAAU;AAAA,QACV,eAAW,6BAAK,qBAAqB,SAAsB;AAAA,QAC3D;AAAA,QACA;AAAA,SACI,OALL;AAAA,QAOE;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;;;ADmDvB,IAAAC,sBAAA;AA7CG,IAAM,iBAAa,0BAA4C,SAASC,YAC7E,IAaA,KACA;AAdA,eAMc;AAAA,IALZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,YAAY,KAA+C,CAAC;AAAA,EArChE,IA+BE,IAMc,SAAE,aAAW,eArC7B,IAqCgB,IAAgC,uBAAhC,IAAgC,CAA9B,eANhB,SAOE;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAzCJ,IA+BE,IAWK,iBAXL,IAWK;AAAA,IAVH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;A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ACP,SAAS,MAAM;AA1E3B,kBAAAC;AA2Ec,eAAAA,MAAA,SAAS,YAAT,gBAAAA,IAAkB;AAAA,YACpB;AAAA;AAAA,QACF;AAAA,SACF;AAAA;AAAA,EAEJ;AAEJ,CAAC;AAED,WAAW,cAAc;","names":["import_react","import_typed_classname","import_react","import_typed_classname","import_jsx_runtime","InputGroup","_a","import_react","import_jsx_runtime","DatePicker","_a"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/form/date-picker/index.tsx","../../../src/form/date-picker/date-picker.tsx","../../../src/form/input-group/input-group.tsx","../../../src/form/error-message/error-message.tsx","../../../src/utils/utils.ts"],"sourcesContent":["export { DatePicker } from \"./date-picker\";\nexport type * from \"./date-picker\";\n","import { forwardRef, useRef, type InputHTMLAttributes } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { InputGroup, type InputGroupProps } from \"../input-group\";\nimport { useMergeRefs } from \"../../utils/utils\";\n\nexport type DatePickerProps = Omit<\n InputGroupProps & InputHTMLAttributes<HTMLInputElement>,\n \"children\" | \"type\"\n> & {\n /**\n * Accessible title for the calendar button\n *\n * This button currently only shows in Chrome.\n *\n * @defaultValue \"Åpne kalender\"\n */\n calendarButtonTitle?: string;\n};\n\n/**\n * A basic implementation of a date picker\n *\n * This date picker is an implementation of native date picker, as you get\n * with `<input type=\"date\" />`, where the input field is dressed in Hedwig styling.\n *\n * Due to accessibility concerns you will only see the appropriate Hedwig calendar\n * icon in Chrome. Firefox will show built in icon and Safari will show no icon.\n * Not tested in Edge.\n */\nexport const DatePicker = forwardRef<HTMLInputElement, DatePickerProps>(function DatePicker(\n {\n className,\n variant,\n errorMessage,\n labelProps,\n label,\n id,\n style,\n disabled,\n readOnly,\n calendarButtonTitle = \"Åpne kalender\",\n ...rest\n },\n ref,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n const mergedRef = useMergeRefs([inputRef, ref]);\n\n return (\n <InputGroup\n className={clsx(\"hds-date-picker\", className as undefined)}\n disabled={disabled}\n errorMessage={errorMessage}\n id={id}\n label={label}\n labelProps={labelProps}\n readOnly={readOnly}\n style={style}\n variant={variant}\n >\n {(inputProps) => (\n <>\n <input\n {...rest}\n {...inputProps}\n disabled={disabled}\n readOnly={readOnly}\n ref={mergedRef}\n type=\"date\"\n />\n <button\n className={clsx(\"hds-date-picker__calendar-button\")}\n type=\"button\"\n title={calendarButtonTitle}\n onClick={() => {\n inputRef.current?.showPicker();\n }}\n />\n </>\n )}\n </InputGroup>\n );\n});\n\nDatePicker.displayName = \"DatePicker\";\n","import { useId, forwardRef, Children, isValidElement, cloneElement } from \"react\";\nimport type { LabelHTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\n\ninterface InputProps {\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: boolean;\n id?: string;\n className?: string;\n}\n\nexport interface InputGroupProps {\n id?: string;\n className?: string;\n style?: CSSProperties;\n variant?: \"default\" | \"white\";\n errorMessage?: ReactNode;\n labelProps?: LabelHTMLAttributes<HTMLLabelElement>;\n label: ReactNode;\n disabled?: boolean;\n readOnly?: boolean;\n /**\n * `children` must be either a single input element or a render function.\n *\n * If you use a render function, make sure you spread the input props to the appropriate element.\n */\n children: Exclude<ReactNode, Iterable<ReactNode>> | ((inputProps: InputProps) => ReactNode);\n}\n\nexport const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function InputGroup(\n {\n id,\n className,\n style,\n variant = \"default\",\n errorMessage,\n labelProps: { className: labelClassName, ...labelProps } = {},\n label,\n disabled,\n readOnly,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n const inputId = useId();\n\n const renderInput = () => {\n const inputProps: InputProps = {\n \"aria-describedby\": errorMessage ? errorMessageId : undefined,\n \"aria-invalid\": errorMessage ? true : undefined,\n id: id ?? inputId,\n className: clsx(\"hds-input-group__input\"),\n };\n\n if (typeof children === \"function\") {\n return children(inputProps);\n }\n\n const input: ReactNode = Children.toArray(children)[0];\n\n if (!isValidElement<InputProps>(input)) {\n return;\n }\n\n return cloneElement<InputProps>(input, {\n ...inputProps,\n ...input.props,\n className: `${inputProps.className} ${input.props.className ?? \"\"}`,\n });\n };\n\n return (\n <div\n className={clsx(\n \"hds-input-group\",\n {\n [`hds-input-group--${variant}`]: variant,\n \"hds-input-group--error\": errorMessage,\n },\n className as undefined,\n )}\n ref={ref}\n style={style}\n {...rest}\n >\n <label\n className={clsx(\"hds-input-group__label\", labelClassName as undefined)}\n {...labelProps}\n htmlFor={id ?? inputId}\n >\n {label}\n </label>\n <div\n className={clsx(\"hds-input-group__input-wrapper\")}\n data-disabled={disabled}\n data-readonly={readOnly}\n >\n {renderInput()}\n </div>\n <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage>\n </div>\n );\n});\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef, type ReactNode } from \"react\";\n\nexport interface ErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n id: string;\n className?: string;\n}\n\nexport const ErrorMessage = forwardRef<HTMLDivElement, ErrorMessageProps>(\n ({ children, id, className, ...rest }, ref) => {\n return (\n <div\n aria-live=\"assertive\"\n className={clsx(\"hds-error-message\", className as undefined)}\n id={id}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\nErrorMessage.displayName = \"ErrorMessage\";\n","import * as React from \"react\";\nimport { useCallback, useEffect, useState } from \"react\";\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n * @see https://floating-ui.com/docs/useMergeRefs\n */\nexport function useMergeRefs<Instance>(\n refs: (React.Ref<Instance> | undefined)[],\n): React.RefCallback<Instance> | null {\n return React.useMemo(() => {\n if (refs.every((ref) => ref === null)) {\n return null;\n }\n\n return (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref !== null) {\n (ref as React.MutableRefObject<Instance | null>).current = value;\n }\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- It's ok\n }, refs);\n}\n\nexport function useResize<Instance extends HTMLElement>(\n ref: React.RefObject<Instance> | undefined | null,\n): { width: number; height: number } {\n const [width, setWidth] = useState<number>(0);\n const [height, setHeight] = useState<number>(0);\n const handleResize = useCallback(() => {\n if (ref?.current !== null) {\n setWidth(ref?.current?.offsetWidth ?? 0);\n setHeight(ref?.current?.offsetHeight ?? 0);\n }\n }, [ref]);\n useEffect(() => {\n window.addEventListener(\"load\", handleResize);\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"load\", handleResize);\n window.removeEventListener(\"resize\", handleResize);\n };\n }, [ref, handleResize]);\n useEffect(() => {\n handleResize();\n // eslint-disable-next-line react-hooks/exhaustive-deps -- It's ok\n }, []);\n return { width, height };\n}\n\nfunction subscribe() {\n // eslint-disable-next-line @typescript-eslint/no-empty-function -- It's ok\n return () => {};\n}\n\nexport function useHydrated() {\n return React.useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n );\n}\n\n/**\n * Trap focus inside an element using the `inert` attribute.\n *\n * Adds `inert` to all siblings of the given element, and all their ancestors up to the body.\n * Returns a cleanup function which removes the `inert` property from the elements, effectively giving focus back to rest of the document.\n *\n * NOTE: Does not support portals, i.e. elements outside the DOM hierarchy of the given element.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\n * @see https://web.dev/articles/inert\n */\nexport function focusTrap(element: HTMLElement) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function -- NOP on focus trapping the body element\n if (element === document.body) return () => {};\n\n let inertElements: HTMLElement[] = [];\n for (let el: HTMLElement | null = element; el; el = el.parentElement) {\n if (el === document.body) break;\n\n for (const sibling of el.parentElement?.children ?? []) {\n if (sibling === el) continue;\n if (!(sibling instanceof HTMLElement)) continue;\n if (sibling.hasAttribute(\"inert\")) continue;\n\n sibling.setAttribute(\"inert\", \"true\");\n inertElements.push(sibling);\n }\n }\n\n return () => {\n releaseFocusTrap(inertElements);\n inertElements = [];\n };\n}\n\n/**\n * Unset the `inert` attribute on all elements given\n */\nfunction releaseFocusTrap(inertElements: Iterable<HTMLElement>) {\n for (const el of inertElements) {\n el.removeAttribute(\"inert\");\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA6D;AAC7D,IAAAC,0BAAqB;;;ACDrB,IAAAC,gBAA0E;AAE1E,IAAAC,0BAAqB;;;ACFrB,6BAAqB;AACrB,mBAA2C;AAWrC;AAHC,IAAM,mBAAe;AAAA,EAC1B,CAAC,IAAsC,QAAQ;AAA9C,iBAAE,YAAU,IAAI,UAVnB,IAUG,IAA8B,iBAA9B,IAA8B,CAA5B,YAAU,MAAI;AACf,WACE;AAAA,MAAC;AAAA;AAAA,QACC,aAAU;AAAA,QACV,eAAW,6BAAK,qBAAqB,SAAsB;AAAA,QAC3D;AAAA,QACA;AAAA,SACI,OALL;AAAA,QAOE;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;;;ADmDvB,IAAAC,sBAAA;AA7CG,IAAM,iBAAa,0BAA4C,SAASC,YAC7E,IAaA,KACA;AAdA,eAMc;AAAA,IALZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,YAAY,KAA+C,CAAC;AAAA,EArChE,IA+BE,IAMc,SAAE,aAAW,eArC7B,IAqCgB,IAAgC,uBAAhC,IAAgC,CAA9B,eANhB,SAOE;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAzCJ,IA+BE,IAWK,iBAXL,IAWK;AAAA,IAVH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAKF,QAAM,qBAAiB,qBAAM;AAC7B,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AAA,YACpB;AAAA;AAAA,QACF;AAAA,SACF;AAAA;AAAA,EAEJ;AAEJ,CAAC;AAED,WAAW,cAAc;","names":["import_react","import_typed_classname","import_react","import_typed_classname","import_jsx_runtime","InputGroup","_a","import_react","import_jsx_runtime","DatePicker","_a"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "../../chunk-TDLSHJ4Z.mjs";
|
|
2
2
|
import {
|
|
3
3
|
DatePicker
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-BVPSZ3JI.mjs";
|
|
5
5
|
import "../../chunk-Y5SUMFYJ.mjs";
|
|
6
6
|
import "../../chunk-FB5GEZNH.mjs";
|
|
7
7
|
import "../../chunk-NSLSA7F7.mjs";
|
|
8
8
|
import "../../chunk-RZZDMBB7.mjs";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-TDXU2IC6.mjs";
|
|
10
10
|
import "../../chunk-R4SQKVDQ.mjs";
|
|
11
11
|
export {
|
|
12
12
|
DatePicker
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface ErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
id: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ErrorMessage: import("react").ForwardRefExoticComponent<ErrorMessageProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
//# sourceMappingURL=error-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-message.d.ts","sourceRoot":"","sources":["../../../src/form/error-message/error-message.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E,QAAQ,EAAE,SAAS,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,8GAcxB,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
1
|
+
export { ErrorMessage } from "./error-message";
|
|
2
|
+
export type * from "./error-message";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/error-message/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,mBAAmB,iBAAiB,CAAC"}
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
1
|
+
import type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from "react";
|
|
2
|
+
export interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
3
|
+
className?: string;
|
|
4
|
+
style?: CSSProperties;
|
|
5
|
+
/**
|
|
6
|
+
* Providing an errorMessage will also give contained Checkboxes or Radiobuttons
|
|
7
|
+
* error styling and aria to indicate invalid state.
|
|
8
|
+
*
|
|
9
|
+
* For Radiobuttons you are even better off using RadioGroup.
|
|
10
|
+
*/
|
|
11
|
+
errorMessage?: ReactNode;
|
|
12
|
+
legendProps?: HTMLAttributes<HTMLElement> & {
|
|
13
|
+
size: "default" | "large";
|
|
14
|
+
};
|
|
15
|
+
legend: ReactNode;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare const useFieldsetContext: () => {
|
|
19
|
+
hasError: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const Fieldset: import("react").ForwardRefExoticComponent<FieldsetProps & import("react").RefAttributes<HTMLFieldSetElement>>;
|
|
22
|
+
//# sourceMappingURL=fieldset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldset.d.ts","sourceRoot":"","sources":["../../../src/form/fieldset/fieldset.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI9F,MAAM,WAAW,aAAc,SAAQ,sBAAsB,CAAC,mBAAmB,CAAC;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG;QAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAA;KAAE,CAAC;IAC1E,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAID,eAAO,MAAM,kBAAkB;cAFmB,OAAO;CAEU,CAAC;AAEpE,eAAO,MAAM,QAAQ,+GAuCnB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
3
|
-
|
|
1
|
+
export { Fieldset, useFieldsetContext } from "./fieldset";
|
|
2
|
+
export type * from "./fieldset";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/fieldset/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC1D,mBAAmB,YAAY,CAAC"}
|
package/dist/form/index.d.ts
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
export { Input_alias_2 as Input } from '../_tsup-dts-rollup';
|
|
11
|
-
export { InputProps_alias_2 as InputProps } from '../_tsup-dts-rollup';
|
|
12
|
-
export { Radiobutton_alias_2 as Radiobutton } from '../_tsup-dts-rollup';
|
|
13
|
-
export { RadioGroup_alias_2 as RadioGroup } from '../_tsup-dts-rollup';
|
|
14
|
-
export { useRadioGroupContext_alias_2 as useRadioGroupContext } from '../_tsup-dts-rollup';
|
|
15
|
-
export { RadiobuttonProps_alias_2 as RadiobuttonProps } from '../_tsup-dts-rollup';
|
|
16
|
-
export { RadioGroupProps_alias_2 as RadioGroupProps } from '../_tsup-dts-rollup';
|
|
17
|
-
export { Select_alias_2 as Select } from '../_tsup-dts-rollup';
|
|
18
|
-
export { SelectProps_alias_2 as SelectProps } from '../_tsup-dts-rollup';
|
|
19
|
-
export { Textarea_alias_2 as Textarea } from '../_tsup-dts-rollup';
|
|
20
|
-
export { TextareaProps_alias_2 as TextareaProps } from '../_tsup-dts-rollup';
|
|
1
|
+
export * from "./checkbox";
|
|
2
|
+
export * from "./date-picker";
|
|
3
|
+
export * from "./error-message";
|
|
4
|
+
export * from "./fieldset";
|
|
5
|
+
export * from "./input";
|
|
6
|
+
export * from "./radiobutton";
|
|
7
|
+
export * from "./select";
|
|
8
|
+
export * from "./textarea";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/form/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
package/dist/form/index.js
CHANGED
|
@@ -303,7 +303,7 @@ var InputGroup = (0, import_react4.forwardRef)(function InputGroup2(_a, ref) {
|
|
|
303
303
|
);
|
|
304
304
|
});
|
|
305
305
|
|
|
306
|
-
// src/utils.ts
|
|
306
|
+
// src/utils/utils.ts
|
|
307
307
|
var React = __toESM(require("react"));
|
|
308
308
|
var import_react5 = require("react");
|
|
309
309
|
function useMergeRefs(refs) {
|
package/dist/form/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/index.tsx","../../src/form/checkbox/checkbox.tsx","../../src/form/error-message/error-message.tsx","../../src/form/fieldset/fieldset.tsx","../../src/form/date-picker/date-picker.tsx","../../src/form/input-group/input-group.tsx","../../src/utils.ts","../../src/form/input/input.tsx","../../src/form/radiobutton/radiobutton.tsx","../../src/form/radiobutton/radiogroup.tsx","../../src/form/select/select.tsx","../../src/form/textarea/textarea.tsx"],"sourcesContent":["export * from \"./checkbox\";\nexport * from \"./date-picker\";\nexport * from \"./error-message\";\nexport * from \"./fieldset\";\nexport * from \"./input\";\nexport * from \"./radiobutton\";\nexport * from \"./select\";\nexport * from \"./textarea\";\n","import { forwardRef, useId, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\nimport { useFieldsetContext } from \"../fieldset\";\n\nexport type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"defaultValue\"> & {\n children: ReactNode;\n variant?: \"plain\" | \"bounding-box\";\n title?: string;\n} & (\n | {\n /**\n * Set to `true` to add error styling. The component will take care of aria to indicate invalid state.\n *\n * Normally you don't need this, as you should wrap your Checkboxes in the Fieldset component.\n * When providing an errorMessage to Fieldset, all contained Checkboxes will get correct hasError state.\n *\n * You can use this when your checkbox is part of a non-HDS fieldset which shows an error message.\n */\n hasError?: boolean;\n errorMessage?: never;\n }\n | {\n hasError?: never;\n /**\n * Set an error message to add error styling, and display the error message.\n * The component will take care of aria to connect the error message to the checkbox.\n *\n * Use this when your checkbox is standalone (not part of a fieldset).\n */\n errorMessage?: ReactNode;\n }\n );\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n variant = \"plain\",\n hasError: hasErrorProp,\n errorMessage,\n title,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const errorMessageId = useId();\n const { hasError: hasFieldsetError } = useFieldsetContext();\n const hasError = !!errorMessage || hasFieldsetError || hasErrorProp;\n\n return (\n <div className={clsx(\"hds-checkbox-wrapper\")}>\n <div\n className={clsx(\n \"hds-checkbox\",\n {\n [`hds-checkbox--${variant}`]: variant === \"bounding-box\",\n \"hds-checkbox--error\": hasError,\n },\n className as undefined,\n )}\n >\n <label>\n <input\n {...rest}\n aria-invalid={hasError ? true : undefined}\n aria-describedby={errorMessage ? errorMessageId : undefined}\n ref={ref}\n type=\"checkbox\"\n />\n <span aria-hidden className=\"hds-checkbox__checkmark\" />\n {title ? <p className=\"hds-checkbox__title\">{title}</p> : children}\n </label>\n {title ? children : null}\n </div>\n {errorMessage ? <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage> : null}\n </div>\n );\n },\n);\nCheckbox.displayName = \"Checkbox\";\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef, type ReactNode } from \"react\";\n\nexport interface ErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n id: string;\n className?: string;\n}\n\nexport const ErrorMessage = forwardRef<HTMLDivElement, ErrorMessageProps>(\n ({ children, id, className, ...rest }, ref) => {\n return (\n <div\n aria-live=\"assertive\"\n className={clsx(\"hds-error-message\", className as undefined)}\n id={id}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\nErrorMessage.displayName = \"ErrorMessage\";\n","import { useId, forwardRef, createContext, useContext } from \"react\";\nimport type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\n\nexport interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {\n className?: string;\n style?: CSSProperties;\n /**\n * Providing an errorMessage will also give contained Checkboxes or Radiobuttons\n * error styling and aria to indicate invalid state.\n *\n * For Radiobuttons you are even better off using RadioGroup.\n */\n errorMessage?: ReactNode;\n legendProps?: HTMLAttributes<HTMLElement> & { size: \"default\" | \"large\" };\n legend: ReactNode;\n children: ReactNode;\n}\n\nconst FieldsetContext = createContext<{ hasError: boolean }>({ hasError: false });\n\nexport const useFieldsetContext = () => useContext(FieldsetContext);\n\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(function Fieldset(\n {\n className,\n style,\n errorMessage,\n legendProps: { size: legendSize = \"default\", className: legendClassName, ...legendProps } = {},\n legend,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n\n return (\n <fieldset\n aria-describedby={errorMessage ? errorMessageId : undefined}\n aria-invalid={errorMessage ? true : undefined}\n className={clsx(\"hds-fieldset\", className as undefined)}\n ref={ref}\n style={style}\n {...rest}\n >\n <legend\n className={clsx(\n \"hds-fieldset__legend\",\n { [`hds-fieldset__legend--${legendSize}`]: legendSize },\n legendClassName as undefined,\n )}\n {...legendProps}\n >\n {legend}\n </legend>\n <FieldsetContext.Provider value={{ hasError: Boolean(errorMessage) }}>\n {children}\n </FieldsetContext.Provider>\n <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage>\n </fieldset>\n );\n});\n","import { forwardRef, useRef, type InputHTMLAttributes } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { InputGroup, type InputGroupProps } from \"../input-group\";\nimport { useMergeRefs } from \"../../utils\";\n\nexport type DatePickerProps = Omit<\n InputGroupProps & InputHTMLAttributes<HTMLInputElement>,\n \"children\" | \"type\"\n> & {\n /**\n * Accessible title for the calendar button\n *\n * This button currently only shows in Chrome.\n *\n * @defaultValue \"Åpne kalender\"\n */\n calendarButtonTitle?: string;\n};\n\n/**\n * A basic implementation of a date picker\n *\n * This date picker is an implementation of native date picker, as you get\n * with `<input type=\"date\" />`, where the input field is dressed in Hedwig styling.\n *\n * Due to accessibility concerns you will only see the appropriate Hedwig calendar\n * icon in Chrome. Firefox will show built in icon and Safari will show no icon.\n * Not tested in Edge.\n */\nexport const DatePicker = forwardRef<HTMLInputElement, DatePickerProps>(function DatePicker(\n {\n className,\n variant,\n errorMessage,\n labelProps,\n label,\n id,\n style,\n disabled,\n readOnly,\n calendarButtonTitle = \"Åpne kalender\",\n ...rest\n },\n ref,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n const mergedRef = useMergeRefs([inputRef, ref]);\n\n return (\n <InputGroup\n className={clsx(\"hds-date-picker\", className as undefined)}\n disabled={disabled}\n errorMessage={errorMessage}\n id={id}\n label={label}\n labelProps={labelProps}\n readOnly={readOnly}\n style={style}\n variant={variant}\n >\n {(inputProps) => (\n <>\n <input\n {...rest}\n {...inputProps}\n disabled={disabled}\n readOnly={readOnly}\n ref={mergedRef}\n type=\"date\"\n />\n <button\n className={clsx(\"hds-date-picker__calendar-button\")}\n type=\"button\"\n title={calendarButtonTitle}\n onClick={() => {\n inputRef.current?.showPicker();\n }}\n />\n </>\n )}\n </InputGroup>\n );\n});\n\nDatePicker.displayName = \"DatePicker\";\n","import { useId, forwardRef, Children, isValidElement, cloneElement } from \"react\";\nimport type { LabelHTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\n\ninterface InputProps {\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: boolean;\n id?: string;\n className?: string;\n}\n\nexport interface InputGroupProps {\n id?: string;\n className?: string;\n style?: CSSProperties;\n variant?: \"default\" | \"white\";\n errorMessage?: ReactNode;\n labelProps?: LabelHTMLAttributes<HTMLLabelElement>;\n label: ReactNode;\n disabled?: boolean;\n readOnly?: boolean;\n /**\n * `children` must be either a single input element or a render function.\n *\n * If you use a render function, make sure you spread the input props to the appropriate element.\n */\n children: Exclude<ReactNode, Iterable<ReactNode>> | ((inputProps: InputProps) => ReactNode);\n}\n\nexport const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function InputGroup(\n {\n id,\n className,\n style,\n variant = \"default\",\n errorMessage,\n labelProps: { className: labelClassName, ...labelProps } = {},\n label,\n disabled,\n readOnly,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n const inputId = useId();\n\n const renderInput = () => {\n const inputProps: InputProps = {\n \"aria-describedby\": errorMessage ? errorMessageId : undefined,\n \"aria-invalid\": errorMessage ? true : undefined,\n id: id ?? inputId,\n className: clsx(\"hds-input-group__input\"),\n };\n\n if (typeof children === \"function\") {\n return children(inputProps);\n }\n\n const input: ReactNode = Children.toArray(children)[0];\n\n if (!isValidElement<InputProps>(input)) {\n return;\n }\n\n return cloneElement<InputProps>(input, {\n ...inputProps,\n ...input.props,\n className: `${inputProps.className} ${input.props.className ?? \"\"}`,\n });\n };\n\n return (\n <div\n className={clsx(\n \"hds-input-group\",\n {\n [`hds-input-group--${variant}`]: variant,\n \"hds-input-group--error\": errorMessage,\n },\n className as undefined,\n )}\n ref={ref}\n style={style}\n {...rest}\n >\n <label\n className={clsx(\"hds-input-group__label\", labelClassName as undefined)}\n {...labelProps}\n htmlFor={id ?? inputId}\n >\n {label}\n </label>\n <div\n className={clsx(\"hds-input-group__input-wrapper\")}\n data-disabled={disabled}\n data-readonly={readOnly}\n >\n {renderInput()}\n </div>\n <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage>\n </div>\n );\n});\n","import * as React from \"react\";\nimport { useCallback, useEffect, useState } from \"react\";\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n * @see https://floating-ui.com/docs/useMergeRefs\n */\nexport function useMergeRefs<Instance>(\n refs: (React.Ref<Instance> | undefined)[],\n): React.RefCallback<Instance> | null {\n return React.useMemo(() => {\n if (refs.every((ref) => ref === null)) {\n return null;\n }\n\n return (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref !== null) {\n (ref as React.MutableRefObject<Instance | null>).current = value;\n }\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- It's ok\n }, refs);\n}\n\nexport function useResize<Instance extends HTMLElement>(\n ref: React.RefObject<Instance> | undefined | null,\n): { width: number; height: number } {\n const [width, setWidth] = useState<number>(0);\n const [height, setHeight] = useState<number>(0);\n const handleResize = useCallback(() => {\n if (ref?.current !== null) {\n setWidth(ref?.current?.offsetWidth ?? 0);\n setHeight(ref?.current?.offsetHeight ?? 0);\n }\n }, [ref]);\n useEffect(() => {\n window.addEventListener(\"load\", handleResize);\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"load\", handleResize);\n window.removeEventListener(\"resize\", handleResize);\n };\n }, [ref, handleResize]);\n useEffect(() => {\n handleResize();\n // eslint-disable-next-line react-hooks/exhaustive-deps -- It's ok\n }, []);\n return { width, height };\n}\n\nfunction subscribe() {\n // eslint-disable-next-line @typescript-eslint/no-empty-function -- It's ok\n return () => {};\n}\n\nexport function useHydrated() {\n return React.useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n );\n}\n\n/**\n * Trap focus inside an element using the `inert` attribute.\n *\n * Adds `inert` to all siblings of the given element, and all their ancestors up to the body.\n * Returns a cleanup function which removes the `inert` property from the elements, effectively giving focus back to rest of the document.\n *\n * NOTE: Does not support portals, i.e. elements outside the DOM hierarchy of the given element.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\n * @see https://web.dev/articles/inert\n */\nexport function focusTrap(element: HTMLElement) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function -- NOP on focus trapping the body element\n if (element === document.body) return () => {};\n\n let inertElements: HTMLElement[] = [];\n for (let el: HTMLElement | null = element; el; el = el.parentElement) {\n if (el === document.body) break;\n\n for (const sibling of el.parentElement?.children ?? []) {\n if (sibling === el) continue;\n if (!(sibling instanceof HTMLElement)) continue;\n if (sibling.hasAttribute(\"inert\")) continue;\n\n sibling.setAttribute(\"inert\", \"true\");\n inertElements.push(sibling);\n }\n }\n\n return () => {\n releaseFocusTrap(inertElements);\n inertElements = [];\n };\n}\n\n/**\n * Unset the `inert` attribute on all elements given\n */\nexport function releaseFocusTrap(inertElements: Iterable<HTMLElement>) {\n for (const el of inertElements) {\n el.removeAttribute(\"inert\");\n }\n}\n","import { forwardRef } from \"react\";\nimport type { InputHTMLAttributes } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { InputGroup } from \"../input-group\";\nimport type { InputGroupProps } from \"../input-group\";\n\nexport type InputProps = Omit<InputGroupProps & InputHTMLAttributes<HTMLInputElement>, \"children\">;\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { className, variant, errorMessage, labelProps, label, id, style, disabled, readOnly, ...rest },\n ref,\n) {\n return (\n <InputGroup\n className={clsx(\"hds-input\", className as undefined)}\n disabled={disabled}\n errorMessage={errorMessage}\n id={id}\n label={label}\n labelProps={labelProps}\n readOnly={readOnly}\n style={style}\n variant={variant}\n >\n <input {...rest} disabled={disabled} readOnly={readOnly} ref={ref} />\n </InputGroup>\n );\n});\n\nInput.displayName = \"Input\";\n","import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { useFieldsetContext } from \"../fieldset\";\nimport { type RadioGroupProps, useRadioGroupContext } from \"./radiogroup\";\n\nexport interface RadiobuttonProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"defaultValue\"> {\n children: ReactNode;\n variant?: \"plain\" | \"bounding-box\";\n /**\n * Set to `true` to add error styling. The component will take care of aria to indicate invalid state.\n *\n * Normally you don't need this, as you should wrap your Radiobuttons in the RadioGroup component.\n * When providing an errorMessage to RadioGroup, all contained Radiobuttons will get correct hasError state.\n *\n * You can use this when your Radiobutton is part of a non-HDS fieldset which shows an error message.\n */\n hasError?: boolean;\n title?: string;\n}\n\nconst isChecked = ({\n checked,\n selectedValue,\n value,\n}: Pick<RadiobuttonProps, \"checked\" | \"value\"> & {\n selectedValue: RadioGroupProps[\"value\"];\n}) => {\n if (typeof checked !== \"undefined\") return checked;\n if (typeof selectedValue !== \"undefined\") return value === selectedValue;\n return undefined;\n};\n\nexport const Radiobutton = forwardRef<HTMLInputElement, RadiobuttonProps>(\n (\n {\n checked,\n value,\n variant = \"plain\",\n hasError: hasErrorProp,\n title,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const {\n value: selectedValue,\n hasError: hasRadioGroupError,\n ...context\n } = useRadioGroupContext();\n const { hasError: hasFieldsetError } = useFieldsetContext();\n const hasError = hasFieldsetError || hasRadioGroupError || hasErrorProp;\n\n return (\n <div\n className={clsx(\n \"hds-radiobutton\",\n {\n [`hds-radiobutton--${variant}`]: variant === \"bounding-box\",\n \"hds-radiobutton--error\": hasError,\n },\n className as undefined,\n )}\n >\n <label>\n <input\n {...context}\n {...rest}\n checked={isChecked({ checked, selectedValue, value })}\n value={value}\n ref={ref}\n type=\"radio\"\n />\n <span aria-hidden className=\"hds-radiobutton__checkmark\" />\n {title ? <p className=\"hds-radiobutton__title\">{title}</p> : children}\n </label>\n {title ? children : null}\n </div>\n );\n },\n);\n\nRadiobutton.displayName = \"Radiobutton\";\n","import {\n type ChangeEventHandler,\n createContext,\n forwardRef,\n type ReactNode,\n useContext,\n} from \"react\";\nimport { Fieldset, type FieldsetProps } from \"../fieldset\";\nimport type { RadiobuttonProps } from \"./radiobutton\";\n\nexport interface RadioGroupProps extends Omit<FieldsetProps, \"onChange\"> {\n children: ReactNode;\n /** Will be passed to all Radiobuttons within the radio group */\n name?: RadiobuttonProps[\"name\"];\n /** If you want the group to be controlled, you can pass the selected value here */\n value?: RadiobuttonProps[\"value\"];\n /**\n * Error message is passed to the internal Fieldset, and will also give contained Radiobuttons\n * error styling and aria to indicate invalid state.\n */\n errorMessage?: ReactNode;\n /** Will be passed to all Radiobuttons within the radio group */\n onChange?: ChangeEventHandler<HTMLInputElement> | undefined;\n}\n\ntype RadioGroupContextProps = {\n hasError: boolean;\n} & Pick<RadioGroupProps, \"name\" | \"value\" | \"onChange\">;\n\nconst RadioGroupContext = createContext<RadioGroupContextProps>({\n hasError: false,\n onChange: () => {\n return undefined;\n },\n});\n\nexport const useRadioGroupContext = () => useContext(RadioGroupContext);\n\nexport const RadioGroup = forwardRef<HTMLFieldSetElement, RadioGroupProps>(function RadioGroup(\n { name, value, errorMessage, onChange, children, ...rest },\n ref,\n) {\n return (\n <RadioGroupContext.Provider value={{ name, value, hasError: Boolean(errorMessage), onChange }}>\n <Fieldset errorMessage={errorMessage} {...rest} ref={ref}>\n {children}\n </Fieldset>\n </RadioGroupContext.Provider>\n );\n});\n\nRadioGroup.displayName = \"RadioGroup\";\n","import { forwardRef, type ReactNode , type SelectHTMLAttributes } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { InputGroup } from \"../input-group\";\nimport type { InputGroupProps } from \"../input-group\";\n\nexport type SelectProps = Omit<\n InputGroupProps & SelectHTMLAttributes<HTMLSelectElement>,\n \"readOnly\" | \"children\"\n> & { children: ReactNode };\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { className, variant, errorMessage, labelProps, label, id, style, disabled, children, ...rest },\n ref,\n) {\n return (\n <InputGroup\n className={clsx(\"hds-select\", className as undefined)}\n disabled={disabled}\n errorMessage={errorMessage}\n id={id}\n label={label}\n labelProps={labelProps}\n style={style}\n variant={variant}\n >\n <select {...rest} disabled={disabled} ref={ref}>\n {children}\n </select>\n </InputGroup>\n );\n});\n\nSelect.displayName = \"Select\";\n","import { forwardRef } from \"react\";\nimport type { TextareaHTMLAttributes } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { InputGroup } from \"../input-group\";\nimport type { InputGroupProps } from \"../input-group\";\n\nexport type TextareaProps = Omit<\n InputGroupProps & TextareaHTMLAttributes<HTMLTextAreaElement>,\n \"children\"\n>;\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { className, variant, errorMessage, labelProps, label, id, style, disabled, readOnly, ...rest },\n ref,\n) {\n return (\n <InputGroup\n className={clsx(\"hds-textarea\", className as undefined)}\n disabled={disabled}\n errorMessage={errorMessage}\n id={id}\n label={label}\n labelProps={labelProps}\n readOnly={readOnly}\n style={style}\n variant={variant}\n >\n <textarea {...rest} disabled={disabled} readOnly={readOnly} ref={ref} />\n </InputGroup>\n );\n});\n\nTextarea.displayName = \"Textarea\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA4E;AAC5E,IAAAC,0BAAqB;;;ACDrB,6BAAqB;AACrB,mBAA2C;AAWrC;AAHC,IAAM,mBAAe;AAAA,EAC1B,CAAC,IAAsC,QAAQ;AAA9C,iBAAE,YAAU,IAAI,UAVnB,IAUG,IAA8B,iBAA9B,IAA8B,CAA5B,YAAU,MAAI;AACf,WACE;AAAA,MAAC;AAAA;AAAA,QACC,aAAU;AAAA,QACV,eAAW,6BAAK,qBAAqB,SAAsB;AAAA,QAC3D;AAAA,QACA;AAAA,SACI,OALL;AAAA,QAOE;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;;;ACxB3B,IAAAC,gBAA6D;AAE7D,IAAAC,0BAAqB;AAqCjB,IAAAC,sBAAA;AAnBJ,IAAM,sBAAkB,6BAAqC,EAAE,UAAU,MAAM,CAAC;AAEzE,IAAM,qBAAqB,UAAM,0BAAW,eAAe;AAE3D,IAAM,eAAW,0BAA+C,SAASC,UAC9E,IASA,KACA;AAVA,eAIe;AAAA,IAHb;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,KAA+E,CAAC;AAAA,EA7BjG,IAyBE,IAIe,SAAE,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AuE;AACvE,IAAAC,0BAAqB;AAwBf,IAAAC,sBAAA;AAfC,IAAM,aAAS,2BAA2C,SAASC,QACxE,IACA,KACA;AAFA,eAAE,aAAW,SAAS,cAAc,YAAY,OAAO,IAAI,OAAO,UAAU,SAX9E,IAWE,IAAyF,iBAAzF,IAAyF,CAAvF,aAAW,WAAS,gBAAc,cAAY,SAAO,MAAI,SAAO,YAAU;AAG5E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,8BAAK,cAAc,SAAsB;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA,uDAAC,2CAAW,OAAX,EAAiB,UAAoB,KACnC,WACH;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,OAAO,cAAc;;;AChCrB,IAAAC,iBAA2B;AAE3B,IAAAC,0BAAqB;AAyBf,IAAAC,uBAAA;AAhBC,IAAM,eAAW,2BAA+C,SAASC,UAC9E,IACA,KACA;AAFA,eAAE,aAAW,SAAS,cAAc,YAAY,OAAO,IAAI,OAAO,UAAU,SAZ9E,IAYE,IAAyF,iBAAzF,IAAyF,CAAvF,aAAW,WAAS,gBAAc,cAAY,SAAO,MAAI,SAAO,YAAU;AAG5E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,8BAAK,gBAAgB,SAAsB;AAAA,MACtD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA,wDAAC,6CAAa,OAAb,EAAmB,UAAoB,UAAoB,MAAU;AAAA;AAAA,EACxE;AAEJ,CAAC;AAED,SAAS,cAAc;","names":["import_react","import_typed_classname","import_react","import_typed_classname","import_jsx_runtime","Fieldset","import_jsx_runtime","import_react","import_typed_classname","import_react","import_typed_classname","import_jsx_runtime","InputGroup","_a","import_react","import_jsx_runtime","DatePicker","_a","import_react","import_typed_classname","import_jsx_runtime","Input","import_react","import_typed_classname","import_react","import_jsx_runtime","RadioGroup","import_jsx_runtime","_a","import_react","import_typed_classname","import_jsx_runtime","Select","import_react","import_typed_classname","import_jsx_runtime","Textarea"]}
|
|
1
|
+
{"version":3,"sources":["../../src/form/index.tsx","../../src/form/checkbox/checkbox.tsx","../../src/form/error-message/error-message.tsx","../../src/form/fieldset/fieldset.tsx","../../src/form/date-picker/date-picker.tsx","../../src/form/input-group/input-group.tsx","../../src/utils/utils.ts","../../src/form/input/input.tsx","../../src/form/radiobutton/radiobutton.tsx","../../src/form/radiobutton/radiogroup.tsx","../../src/form/select/select.tsx","../../src/form/textarea/textarea.tsx"],"sourcesContent":["export * from \"./checkbox\";\nexport * from \"./date-picker\";\nexport * from \"./error-message\";\nexport * from \"./fieldset\";\nexport * from \"./input\";\nexport * from \"./radiobutton\";\nexport * from \"./select\";\nexport * from \"./textarea\";\n","import { forwardRef, useId, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\nimport { useFieldsetContext } from \"../fieldset\";\n\nexport type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"defaultValue\"> & {\n children: ReactNode;\n variant?: \"plain\" | \"bounding-box\";\n title?: string;\n} & (\n | {\n /**\n * Set to `true` to add error styling. The component will take care of aria to indicate invalid state.\n *\n * Normally you don't need this, as you should wrap your Checkboxes in the Fieldset component.\n * When providing an errorMessage to Fieldset, all contained Checkboxes will get correct hasError state.\n *\n * You can use this when your checkbox is part of a non-HDS fieldset which shows an error message.\n */\n hasError?: boolean;\n errorMessage?: never;\n }\n | {\n hasError?: never;\n /**\n * Set an error message to add error styling, and display the error message.\n * The component will take care of aria to connect the error message to the checkbox.\n *\n * Use this when your checkbox is standalone (not part of a fieldset).\n */\n errorMessage?: ReactNode;\n }\n );\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n variant = \"plain\",\n hasError: hasErrorProp,\n errorMessage,\n title,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const errorMessageId = useId();\n const { hasError: hasFieldsetError } = useFieldsetContext();\n const hasError = !!errorMessage || hasFieldsetError || hasErrorProp;\n\n return (\n <div className={clsx(\"hds-checkbox-wrapper\")}>\n <div\n className={clsx(\n \"hds-checkbox\",\n {\n [`hds-checkbox--${variant}`]: variant === \"bounding-box\",\n \"hds-checkbox--error\": hasError,\n },\n className as undefined,\n )}\n >\n <label>\n <input\n {...rest}\n aria-invalid={hasError ? true : undefined}\n aria-describedby={errorMessage ? errorMessageId : undefined}\n ref={ref}\n type=\"checkbox\"\n />\n <span aria-hidden className=\"hds-checkbox__checkmark\" />\n {title ? <p className=\"hds-checkbox__title\">{title}</p> : children}\n </label>\n {title ? children : null}\n </div>\n {errorMessage ? <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage> : null}\n </div>\n );\n },\n);\nCheckbox.displayName = \"Checkbox\";\n","import { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { forwardRef, type ReactNode } from \"react\";\n\nexport interface ErrorMessageProps extends React.HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n id: string;\n className?: string;\n}\n\nexport const ErrorMessage = forwardRef<HTMLDivElement, ErrorMessageProps>(\n ({ children, id, className, ...rest }, ref) => {\n return (\n <div\n aria-live=\"assertive\"\n className={clsx(\"hds-error-message\", className as undefined)}\n id={id}\n ref={ref}\n {...rest}\n >\n {children}\n </div>\n );\n },\n);\nErrorMessage.displayName = \"ErrorMessage\";\n","import { useId, forwardRef, createContext, useContext } from \"react\";\nimport type { FieldsetHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\n\nexport interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {\n className?: string;\n style?: CSSProperties;\n /**\n * Providing an errorMessage will also give contained Checkboxes or Radiobuttons\n * error styling and aria to indicate invalid state.\n *\n * For Radiobuttons you are even better off using RadioGroup.\n */\n errorMessage?: ReactNode;\n legendProps?: HTMLAttributes<HTMLElement> & { size: \"default\" | \"large\" };\n legend: ReactNode;\n children: ReactNode;\n}\n\nconst FieldsetContext = createContext<{ hasError: boolean }>({ hasError: false });\n\nexport const useFieldsetContext = () => useContext(FieldsetContext);\n\nexport const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(function Fieldset(\n {\n className,\n style,\n errorMessage,\n legendProps: { size: legendSize = \"default\", className: legendClassName, ...legendProps } = {},\n legend,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n\n return (\n <fieldset\n aria-describedby={errorMessage ? errorMessageId : undefined}\n aria-invalid={errorMessage ? true : undefined}\n className={clsx(\"hds-fieldset\", className as undefined)}\n ref={ref}\n style={style}\n {...rest}\n >\n <legend\n className={clsx(\n \"hds-fieldset__legend\",\n { [`hds-fieldset__legend--${legendSize}`]: legendSize },\n legendClassName as undefined,\n )}\n {...legendProps}\n >\n {legend}\n </legend>\n <FieldsetContext.Provider value={{ hasError: Boolean(errorMessage) }}>\n {children}\n </FieldsetContext.Provider>\n <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage>\n </fieldset>\n );\n});\n","import { forwardRef, useRef, type InputHTMLAttributes } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { InputGroup, type InputGroupProps } from \"../input-group\";\nimport { useMergeRefs } from \"../../utils/utils\";\n\nexport type DatePickerProps = Omit<\n InputGroupProps & InputHTMLAttributes<HTMLInputElement>,\n \"children\" | \"type\"\n> & {\n /**\n * Accessible title for the calendar button\n *\n * This button currently only shows in Chrome.\n *\n * @defaultValue \"Åpne kalender\"\n */\n calendarButtonTitle?: string;\n};\n\n/**\n * A basic implementation of a date picker\n *\n * This date picker is an implementation of native date picker, as you get\n * with `<input type=\"date\" />`, where the input field is dressed in Hedwig styling.\n *\n * Due to accessibility concerns you will only see the appropriate Hedwig calendar\n * icon in Chrome. Firefox will show built in icon and Safari will show no icon.\n * Not tested in Edge.\n */\nexport const DatePicker = forwardRef<HTMLInputElement, DatePickerProps>(function DatePicker(\n {\n className,\n variant,\n errorMessage,\n labelProps,\n label,\n id,\n style,\n disabled,\n readOnly,\n calendarButtonTitle = \"Åpne kalender\",\n ...rest\n },\n ref,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n const mergedRef = useMergeRefs([inputRef, ref]);\n\n return (\n <InputGroup\n className={clsx(\"hds-date-picker\", className as undefined)}\n disabled={disabled}\n errorMessage={errorMessage}\n id={id}\n label={label}\n labelProps={labelProps}\n readOnly={readOnly}\n style={style}\n variant={variant}\n >\n {(inputProps) => (\n <>\n <input\n {...rest}\n {...inputProps}\n disabled={disabled}\n readOnly={readOnly}\n ref={mergedRef}\n type=\"date\"\n />\n <button\n className={clsx(\"hds-date-picker__calendar-button\")}\n type=\"button\"\n title={calendarButtonTitle}\n onClick={() => {\n inputRef.current?.showPicker();\n }}\n />\n </>\n )}\n </InputGroup>\n );\n});\n\nDatePicker.displayName = \"DatePicker\";\n","import { useId, forwardRef, Children, isValidElement, cloneElement } from \"react\";\nimport type { LabelHTMLAttributes, ReactNode, CSSProperties } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { ErrorMessage } from \"../error-message\";\n\ninterface InputProps {\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: boolean;\n id?: string;\n className?: string;\n}\n\nexport interface InputGroupProps {\n id?: string;\n className?: string;\n style?: CSSProperties;\n variant?: \"default\" | \"white\";\n errorMessage?: ReactNode;\n labelProps?: LabelHTMLAttributes<HTMLLabelElement>;\n label: ReactNode;\n disabled?: boolean;\n readOnly?: boolean;\n /**\n * `children` must be either a single input element or a render function.\n *\n * If you use a render function, make sure you spread the input props to the appropriate element.\n */\n children: Exclude<ReactNode, Iterable<ReactNode>> | ((inputProps: InputProps) => ReactNode);\n}\n\nexport const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function InputGroup(\n {\n id,\n className,\n style,\n variant = \"default\",\n errorMessage,\n labelProps: { className: labelClassName, ...labelProps } = {},\n label,\n disabled,\n readOnly,\n children,\n ...rest\n },\n ref,\n) {\n const errorMessageId = useId();\n const inputId = useId();\n\n const renderInput = () => {\n const inputProps: InputProps = {\n \"aria-describedby\": errorMessage ? errorMessageId : undefined,\n \"aria-invalid\": errorMessage ? true : undefined,\n id: id ?? inputId,\n className: clsx(\"hds-input-group__input\"),\n };\n\n if (typeof children === \"function\") {\n return children(inputProps);\n }\n\n const input: ReactNode = Children.toArray(children)[0];\n\n if (!isValidElement<InputProps>(input)) {\n return;\n }\n\n return cloneElement<InputProps>(input, {\n ...inputProps,\n ...input.props,\n className: `${inputProps.className} ${input.props.className ?? \"\"}`,\n });\n };\n\n return (\n <div\n className={clsx(\n \"hds-input-group\",\n {\n [`hds-input-group--${variant}`]: variant,\n \"hds-input-group--error\": errorMessage,\n },\n className as undefined,\n )}\n ref={ref}\n style={style}\n {...rest}\n >\n <label\n className={clsx(\"hds-input-group__label\", labelClassName as undefined)}\n {...labelProps}\n htmlFor={id ?? inputId}\n >\n {label}\n </label>\n <div\n className={clsx(\"hds-input-group__input-wrapper\")}\n data-disabled={disabled}\n data-readonly={readOnly}\n >\n {renderInput()}\n </div>\n <ErrorMessage id={errorMessageId}>{errorMessage}</ErrorMessage>\n </div>\n );\n});\n","import * as React from \"react\";\nimport { useCallback, useEffect, useState } from \"react\";\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n * @see https://floating-ui.com/docs/useMergeRefs\n */\nexport function useMergeRefs<Instance>(\n refs: (React.Ref<Instance> | undefined)[],\n): React.RefCallback<Instance> | null {\n return React.useMemo(() => {\n if (refs.every((ref) => ref === null)) {\n return null;\n }\n\n return (value) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref !== null) {\n (ref as React.MutableRefObject<Instance | null>).current = value;\n }\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- It's ok\n }, refs);\n}\n\nexport function useResize<Instance extends HTMLElement>(\n ref: React.RefObject<Instance> | undefined | null,\n): { width: number; height: number } {\n const [width, setWidth] = useState<number>(0);\n const [height, setHeight] = useState<number>(0);\n const handleResize = useCallback(() => {\n if (ref?.current !== null) {\n setWidth(ref?.current?.offsetWidth ?? 0);\n setHeight(ref?.current?.offsetHeight ?? 0);\n }\n }, [ref]);\n useEffect(() => {\n window.addEventListener(\"load\", handleResize);\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"load\", handleResize);\n window.removeEventListener(\"resize\", handleResize);\n };\n }, [ref, handleResize]);\n useEffect(() => {\n handleResize();\n // eslint-disable-next-line react-hooks/exhaustive-deps -- It's ok\n }, []);\n return { width, height };\n}\n\nfunction subscribe() {\n // eslint-disable-next-line @typescript-eslint/no-empty-function -- It's ok\n return () => {};\n}\n\nexport function useHydrated() {\n return React.useSyncExternalStore(\n subscribe,\n () => true,\n () => false,\n );\n}\n\n/**\n * Trap focus inside an element using the `inert` attribute.\n *\n * Adds `inert` to all siblings of the given element, and all their ancestors up to the body.\n * Returns a cleanup function which removes the `inert` property from the elements, effectively giving focus back to rest of the document.\n *\n * NOTE: Does not support portals, i.e. elements outside the DOM hierarchy of the given element.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\n * @see https://web.dev/articles/inert\n */\nexport function focusTrap(element: HTMLElement) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function -- NOP on focus trapping the body element\n if (element === document.body) return () => {};\n\n let inertElements: HTMLElement[] = [];\n for (let el: HTMLElement | null = element; el; el = el.parentElement) {\n if (el === document.body) break;\n\n for (const sibling of el.parentElement?.children ?? []) {\n if (sibling === el) continue;\n if (!(sibling instanceof HTMLElement)) continue;\n if (sibling.hasAttribute(\"inert\")) continue;\n\n sibling.setAttribute(\"inert\", \"true\");\n inertElements.push(sibling);\n }\n }\n\n return () => {\n releaseFocusTrap(inertElements);\n inertElements = [];\n };\n}\n\n/**\n * Unset the `inert` attribute on all elements given\n */\nfunction releaseFocusTrap(inertElements: Iterable<HTMLElement>) {\n for (const el of inertElements) {\n el.removeAttribute(\"inert\");\n }\n}\n","import { forwardRef } from \"react\";\nimport type { InputHTMLAttributes } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { InputGroup } from \"../input-group\";\nimport type { InputGroupProps } from \"../input-group\";\n\nexport type InputProps = Omit<InputGroupProps & InputHTMLAttributes<HTMLInputElement>, \"children\">;\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { className, variant, errorMessage, labelProps, label, id, style, disabled, readOnly, ...rest },\n ref,\n) {\n return (\n <InputGroup\n className={clsx(\"hds-input\", className as undefined)}\n disabled={disabled}\n errorMessage={errorMessage}\n id={id}\n label={label}\n labelProps={labelProps}\n readOnly={readOnly}\n style={style}\n variant={variant}\n >\n <input {...rest} disabled={disabled} readOnly={readOnly} ref={ref} />\n </InputGroup>\n );\n});\n\nInput.displayName = \"Input\";\n","import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { useFieldsetContext } from \"../fieldset\";\nimport { type RadioGroupProps, useRadioGroupContext } from \"./radiogroup\";\n\nexport interface RadiobuttonProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"defaultValue\"> {\n children: ReactNode;\n variant?: \"plain\" | \"bounding-box\";\n /**\n * Set to `true` to add error styling. The component will take care of aria to indicate invalid state.\n *\n * Normally you don't need this, as you should wrap your Radiobuttons in the RadioGroup component.\n * When providing an errorMessage to RadioGroup, all contained Radiobuttons will get correct hasError state.\n *\n * You can use this when your Radiobutton is part of a non-HDS fieldset which shows an error message.\n */\n hasError?: boolean;\n title?: string;\n}\n\nconst isChecked = ({\n checked,\n selectedValue,\n value,\n}: Pick<RadiobuttonProps, \"checked\" | \"value\"> & {\n selectedValue: RadioGroupProps[\"value\"];\n}) => {\n if (typeof checked !== \"undefined\") return checked;\n if (typeof selectedValue !== \"undefined\") return value === selectedValue;\n return undefined;\n};\n\nexport const Radiobutton = forwardRef<HTMLInputElement, RadiobuttonProps>(\n (\n {\n checked,\n value,\n variant = \"plain\",\n hasError: hasErrorProp,\n title,\n children,\n className,\n ...rest\n },\n ref,\n ) => {\n const {\n value: selectedValue,\n hasError: hasRadioGroupError,\n ...context\n } = useRadioGroupContext();\n const { hasError: hasFieldsetError } = useFieldsetContext();\n const hasError = hasFieldsetError || hasRadioGroupError || hasErrorProp;\n\n return (\n <div\n className={clsx(\n \"hds-radiobutton\",\n {\n [`hds-radiobutton--${variant}`]: variant === \"bounding-box\",\n \"hds-radiobutton--error\": hasError,\n },\n className as undefined,\n )}\n >\n <label>\n <input\n {...context}\n {...rest}\n checked={isChecked({ checked, selectedValue, value })}\n value={value}\n ref={ref}\n type=\"radio\"\n />\n <span aria-hidden className=\"hds-radiobutton__checkmark\" />\n {title ? <p className=\"hds-radiobutton__title\">{title}</p> : children}\n </label>\n {title ? children : null}\n </div>\n );\n },\n);\n\nRadiobutton.displayName = \"Radiobutton\";\n","import {\n type ChangeEventHandler,\n createContext,\n forwardRef,\n type ReactNode,\n useContext,\n} from \"react\";\nimport { Fieldset, type FieldsetProps } from \"../fieldset\";\nimport type { RadiobuttonProps } from \"./radiobutton\";\n\nexport interface RadioGroupProps extends Omit<FieldsetProps, \"onChange\"> {\n children: ReactNode;\n /** Will be passed to all Radiobuttons within the radio group */\n name?: RadiobuttonProps[\"name\"];\n /** If you want the group to be controlled, you can pass the selected value here */\n value?: RadiobuttonProps[\"value\"];\n /**\n * Error message is passed to the internal Fieldset, and will also give contained Radiobuttons\n * error styling and aria to indicate invalid state.\n */\n errorMessage?: ReactNode;\n /** Will be passed to all Radiobuttons within the radio group */\n onChange?: ChangeEventHandler<HTMLInputElement> | undefined;\n}\n\ntype RadioGroupContextProps = {\n hasError: boolean;\n} & Pick<RadioGroupProps, \"name\" | \"value\" | \"onChange\">;\n\nconst RadioGroupContext = createContext<RadioGroupContextProps>({\n hasError: false,\n onChange: () => {\n return undefined;\n },\n});\n\nexport const useRadioGroupContext = () => useContext(RadioGroupContext);\n\nexport const RadioGroup = forwardRef<HTMLFieldSetElement, RadioGroupProps>(function RadioGroup(\n { name, value, errorMessage, onChange, children, ...rest },\n ref,\n) {\n return (\n <RadioGroupContext.Provider value={{ name, value, hasError: Boolean(errorMessage), onChange }}>\n <Fieldset errorMessage={errorMessage} {...rest} ref={ref}>\n {children}\n </Fieldset>\n </RadioGroupContext.Provider>\n );\n});\n\nRadioGroup.displayName = \"RadioGroup\";\n","import { forwardRef, type ReactNode , type SelectHTMLAttributes } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { InputGroup } from \"../input-group\";\nimport type { InputGroupProps } from \"../input-group\";\n\nexport type SelectProps = Omit<\n InputGroupProps & SelectHTMLAttributes<HTMLSelectElement>,\n \"readOnly\" | \"children\"\n> & { children: ReactNode };\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { className, variant, errorMessage, labelProps, label, id, style, disabled, children, ...rest },\n ref,\n) {\n return (\n <InputGroup\n className={clsx(\"hds-select\", className as undefined)}\n disabled={disabled}\n errorMessage={errorMessage}\n id={id}\n label={label}\n labelProps={labelProps}\n style={style}\n variant={variant}\n >\n <select {...rest} disabled={disabled} ref={ref}>\n {children}\n </select>\n </InputGroup>\n );\n});\n\nSelect.displayName = \"Select\";\n","import { forwardRef } from \"react\";\nimport type { TextareaHTMLAttributes } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { InputGroup } from \"../input-group\";\nimport type { InputGroupProps } from \"../input-group\";\n\nexport type TextareaProps = Omit<\n InputGroupProps & TextareaHTMLAttributes<HTMLTextAreaElement>,\n \"children\"\n>;\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { className, variant, errorMessage, labelProps, label, id, style, disabled, readOnly, ...rest },\n ref,\n) {\n return (\n <InputGroup\n className={clsx(\"hds-textarea\", className as undefined)}\n disabled={disabled}\n errorMessage={errorMessage}\n id={id}\n label={label}\n labelProps={labelProps}\n readOnly={readOnly}\n style={style}\n variant={variant}\n >\n <textarea {...rest} disabled={disabled} readOnly={readOnly} ref={ref} />\n </InputGroup>\n );\n});\n\nTextarea.displayName = \"Textarea\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAA4E;AAC5E,IAAAC,0BAAqB;;;ACDrB,6BAAqB;AACrB,mBAA2C;AAWrC;AAHC,IAAM,mBAAe;AAAA,EAC1B,CAAC,IAAsC,QAAQ;AAA9C,iBAAE,YAAU,IAAI,UAVnB,IAUG,IAA8B,iBAA9B,IAA8B,CAA5B,YAAU,MAAI;AACf,WACE;AAAA,MAAC;AAAA;AAAA,QACC,aAAU;AAAA,QACV,eAAW,6BAAK,qBAAqB,SAAsB;AAAA,QAC3D;AAAA,QACA;AAAA,SACI,OALL;AAAA,QAOE;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,aAAa,cAAc;;;ACxB3B,IAAAC,gBAA6D;AAE7D,IAAAC,0BAAqB;AAqCjB,IAAAC,sBAAA;AAnBJ,IAAM,sBAAkB,6BAAqC,EAAE,UAAU,MAAM,CAAC;AAEzE,IAAM,qBAAqB,UAAM,0BAAW,eAAe;AAE3D,IAAM,eAAW,0BAA+C,SAASC,UAC9E,IASA,KACA;AAVA,eAIe;AAAA,IAHb;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,KAA+E,CAAC;AAAA,EA7BjG,IAyBE,IAIe,SAAE,QAAM,aAAa,WAAW,WAAW,gBA7B5D,IA6BiB,IAA+D,wBAA/D,IAA+D,CAA7D,QAA8B,eAJ/C,SAKE;AAAA;AAAA,IAC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aAAW,SAAS,cAAc,YAAY,OAAO,IAAI,OAAO,UAAU,SAX9E,IAWE,IAAyF,iBAAzF,IAAyF,CAAvF,aAAW,WAAS,gBAAc,cAAY,SAAO,MAAI,SAAO,YAAU;AAG5E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,8BAAK,cAAc,SAAsB;AAAA,MACpD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA,uDAAC,2CAAW,OAAX,EAAiB,UAAoB,KACnC,WACH;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,OAAO,cAAc;;;AChCrB,IAAAC,iBAA2B;AAE3B,IAAAC,0BAAqB;AAyBf,IAAAC,uBAAA;AAhBC,IAAM,eAAW,2BAA+C,SAASC,UAC9E,IACA,KACA;AAFA,eAAE,aAAW,SAAS,cAAc,YAAY,OAAO,IAAI,OAAO,UAAU,SAZ9E,IAYE,IAAyF,iBAAzF,IAAyF,CAAvF,aAAW,WAAS,gBAAc,cAAY,SAAO,MAAI,SAAO,YAAU;AAG5E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,8BAAK,gBAAgB,SAAsB;AAAA,MACtD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA,wDAAC,6CAAa,OAAb,EAAmB,UAAoB,UAAoB,MAAU;AAAA;AAAA,EACxE;AAEJ,CAAC;AAED,SAAS,cAAc;","names":["import_react","import_typed_classname","import_react","import_typed_classname","import_jsx_runtime","Fieldset","import_jsx_runtime","import_react","import_typed_classname","import_react","import_typed_classname","import_jsx_runtime","InputGroup","_a","import_react","import_jsx_runtime","DatePicker","_a","import_react","import_typed_classname","import_jsx_runtime","Input","import_react","import_typed_classname","import_react","import_jsx_runtime","RadioGroup","import_jsx_runtime","_a","import_react","import_typed_classname","import_jsx_runtime","Select","import_react","import_typed_classname","import_jsx_runtime","Textarea"]}
|
package/dist/form/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ import "../chunk-YJOOSTJC.mjs";
|
|
|
19
19
|
import "../chunk-TDLSHJ4Z.mjs";
|
|
20
20
|
import {
|
|
21
21
|
DatePicker
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-BVPSZ3JI.mjs";
|
|
23
23
|
import "../chunk-7LPYJC6S.mjs";
|
|
24
24
|
import {
|
|
25
25
|
Input
|
|
@@ -38,7 +38,7 @@ import "../chunk-NSLSA7F7.mjs";
|
|
|
38
38
|
import {
|
|
39
39
|
ErrorMessage
|
|
40
40
|
} from "../chunk-RZZDMBB7.mjs";
|
|
41
|
-
import "../chunk-
|
|
41
|
+
import "../chunk-TDXU2IC6.mjs";
|
|
42
42
|
import "../chunk-R4SQKVDQ.mjs";
|
|
43
43
|
export {
|
|
44
44
|
Checkbox,
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
1
|
+
export { Input } from "./input";
|
|
2
|
+
export type * from "./input";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,mBAAmB,SAAS,CAAC"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { InputHTMLAttributes } from "react";
|
|
2
|
+
import type { InputGroupProps } from "../input-group";
|
|
3
|
+
export type InputProps = Omit<InputGroupProps & InputHTMLAttributes<HTMLInputElement>, "children">;
|
|
4
|
+
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
5
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/form/input/input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,CAAC;AAEnG,eAAO,MAAM,KAAK,yGAmBhB,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { InputGroup } from
|
|
2
|
-
export
|
|
1
|
+
export { InputGroup } from "./input-group";
|
|
2
|
+
export type * from "./input-group";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/input-group/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,mBAAmB,eAAe,CAAC"}
|
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { LabelHTMLAttributes, ReactNode, CSSProperties } from "react";
|
|
2
|
+
interface InputProps {
|
|
3
|
+
"aria-describedby"?: string;
|
|
4
|
+
"aria-invalid"?: boolean;
|
|
5
|
+
id?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface InputGroupProps {
|
|
9
|
+
id?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
variant?: "default" | "white";
|
|
13
|
+
errorMessage?: ReactNode;
|
|
14
|
+
labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
|
|
15
|
+
label: ReactNode;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
readOnly?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* `children` must be either a single input element or a render function.
|
|
20
|
+
*
|
|
21
|
+
* If you use a render function, make sure you spread the input props to the appropriate element.
|
|
22
|
+
*/
|
|
23
|
+
children: Exclude<ReactNode, Iterable<ReactNode>> | ((inputProps: InputProps) => ReactNode);
|
|
24
|
+
}
|
|
25
|
+
export declare const InputGroup: import("react").ForwardRefExoticComponent<InputGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=input-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../../src/form/input-group/input-group.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3E,UAAU,UAAU;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,UAAU,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IACnD,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,UAAU,KAAK,SAAS,CAAC,CAAC;CAC7F;AAED,eAAO,MAAM,UAAU,4GA2ErB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export
|
|
5
|
-
|
|
1
|
+
export { Radiobutton } from "./radiobutton";
|
|
2
|
+
export type * from "./radiobutton";
|
|
3
|
+
export { RadioGroup, useRadioGroupContext } from "./radiogroup";
|
|
4
|
+
export type * from "./radiogroup";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/radiobutton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,mBAAmB,eAAe,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAChE,mBAAmB,cAAc,CAAC"}
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { type InputHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
export interface RadiobuttonProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue"> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
variant?: "plain" | "bounding-box";
|
|
5
|
+
/**
|
|
6
|
+
* Set to `true` to add error styling. The component will take care of aria to indicate invalid state.
|
|
7
|
+
*
|
|
8
|
+
* Normally you don't need this, as you should wrap your Radiobuttons in the RadioGroup component.
|
|
9
|
+
* When providing an errorMessage to RadioGroup, all contained Radiobuttons will get correct hasError state.
|
|
10
|
+
*
|
|
11
|
+
* You can use this when your Radiobutton is part of a non-HDS fieldset which shows an error message.
|
|
12
|
+
*/
|
|
13
|
+
hasError?: boolean;
|
|
14
|
+
title?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const Radiobutton: import("react").ForwardRefExoticComponent<RadiobuttonProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
17
|
+
//# sourceMappingURL=radiobutton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radiobutton.d.ts","sourceRoot":"","sources":["../../../src/form/radiobutton/radiobutton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK7E,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,cAAc,CAAC;IACnE,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC;IACnC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAcD,eAAO,MAAM,WAAW,+GAiDvB,CAAC"}
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type ChangeEventHandler, type ReactNode } from "react";
|
|
2
|
+
import { type FieldsetProps } from "../fieldset";
|
|
3
|
+
import type { RadiobuttonProps } from "./radiobutton";
|
|
4
|
+
export interface RadioGroupProps extends Omit<FieldsetProps, "onChange"> {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Will be passed to all Radiobuttons within the radio group */
|
|
7
|
+
name?: RadiobuttonProps["name"];
|
|
8
|
+
/** If you want the group to be controlled, you can pass the selected value here */
|
|
9
|
+
value?: RadiobuttonProps["value"];
|
|
10
|
+
/**
|
|
11
|
+
* Error message is passed to the internal Fieldset, and will also give contained Radiobuttons
|
|
12
|
+
* error styling and aria to indicate invalid state.
|
|
13
|
+
*/
|
|
14
|
+
errorMessage?: ReactNode;
|
|
15
|
+
/** Will be passed to all Radiobuttons within the radio group */
|
|
16
|
+
onChange?: ChangeEventHandler<HTMLInputElement> | undefined;
|
|
17
|
+
}
|
|
18
|
+
type RadioGroupContextProps = {
|
|
19
|
+
hasError: boolean;
|
|
20
|
+
} & Pick<RadioGroupProps, "name" | "value" | "onChange">;
|
|
21
|
+
export declare const useRadioGroupContext: () => RadioGroupContextProps;
|
|
22
|
+
export declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HTMLFieldSetElement>>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=radiogroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radiogroup.d.ts","sourceRoot":"","sources":["../../../src/form/radiobutton/radiogroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAGvB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AACf,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC;IACtE,QAAQ,EAAE,SAAS,CAAC;IACpB,gEAAgE;IAChE,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC,mFAAmF;IACnF,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;CAC7D;AAED,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC;AASzD,eAAO,MAAM,oBAAoB,8BAAsC,CAAC;AAExE,eAAO,MAAM,UAAU,iHAWrB,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
1
|
+
export { Select } from "./select";
|
|
2
|
+
export type * from "./select";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,mBAAmB,UAAU,CAAC"}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { type ReactNode, type SelectHTMLAttributes } from "react";
|
|
2
|
+
import type { InputGroupProps } from "../input-group";
|
|
3
|
+
export type SelectProps = Omit<InputGroupProps & SelectHTMLAttributes<HTMLSelectElement>, "readOnly" | "children"> & {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const Select: import("react").ForwardRefExoticComponent<Omit<InputGroupProps & SelectHTMLAttributes<HTMLSelectElement>, "children" | "readOnly"> & {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
} & import("react").RefAttributes<HTMLSelectElement>>;
|
|
9
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/form/select/select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,SAAS,EAAG,KAAK,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAG/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,eAAe,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,EACzD,UAAU,GAAG,UAAU,CACxB,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAAC;AAE5B,eAAO,MAAM,MAAM;cAFH,SAAS;qDAsBvB,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
1
|
+
export { Textarea } from "./textarea";
|
|
2
|
+
export type * from "./textarea";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/form/textarea/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,mBAAmB,YAAY,CAAC"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { TextareaHTMLAttributes } from "react";
|
|
2
|
+
import type { InputGroupProps } from "../input-group";
|
|
3
|
+
export type TextareaProps = Omit<InputGroupProps & TextareaHTMLAttributes<HTMLTextAreaElement>, "children">;
|
|
4
|
+
export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
5
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/form/textarea/textarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAGpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,eAAe,GAAG,sBAAsB,CAAC,mBAAmB,CAAC,EAC7D,UAAU,CACX,CAAC;AAEF,eAAO,MAAM,QAAQ,+GAmBnB,CAAC"}
|