@postenbring/hedwig-react 0.0.0-bugfix-example-darkmode-20260303124449 → 0.0.0-bump-nodejs-24-20260909105147
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.js.map +1 -1
- package/dist/accordion/accordion-content.mjs +3 -3
- package/dist/accordion/accordion.js.map +1 -1
- package/dist/accordion/accordion.mjs +4 -4
- package/dist/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs +4 -4
- package/dist/blockquote/blockquote.d.ts +4 -11
- package/dist/blockquote/blockquote.d.ts.map +1 -1
- package/dist/blockquote/blockquote.js.map +1 -1
- package/dist/blockquote/blockquote.mjs +1 -1
- package/dist/blockquote/index.js.map +1 -1
- package/dist/blockquote/index.mjs +1 -1
- package/dist/button/button.d.ts +5 -2
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.js.map +1 -1
- package/dist/button/button.mjs +1 -1
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/card/card.d.ts +1 -1
- package/dist/card/card.js +1 -1
- package/dist/card/card.js.map +1 -1
- package/dist/card/card.mjs +1 -1
- package/dist/card/index.js +1 -1
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +1 -1
- package/dist/{chunk-77M2ZTP7.mjs → chunk-3V4GFS46.mjs} +11 -1
- package/dist/chunk-3V4GFS46.mjs.map +1 -0
- package/dist/{chunk-TYCGAA35.mjs → chunk-45Q2TCH6.mjs} +1 -1
- package/dist/chunk-45Q2TCH6.mjs.map +1 -0
- package/dist/chunk-5J5LYE6Z.mjs +1 -0
- package/dist/chunk-5M6MEYM7.mjs +1 -0
- package/dist/chunk-62VLFCXX.mjs +64 -0
- package/dist/chunk-62VLFCXX.mjs.map +1 -0
- package/dist/chunk-6D5VE3DW.mjs +44 -0
- package/dist/chunk-6D5VE3DW.mjs.map +1 -0
- package/dist/chunk-CAIGPMDS.mjs +1 -0
- package/dist/chunk-CAIGPMDS.mjs.map +1 -0
- package/dist/chunk-CD4LCDK3.mjs +27 -0
- package/dist/chunk-CD4LCDK3.mjs.map +1 -0
- package/dist/chunk-CSIXGT7P.mjs +1 -0
- package/dist/chunk-CSIXGT7P.mjs.map +1 -0
- package/dist/chunk-D2XZT2RA.mjs +17 -0
- package/dist/chunk-D2XZT2RA.mjs.map +1 -0
- package/dist/{chunk-6OJINZ37.mjs → chunk-DMRQEQQK.mjs} +28 -10
- package/dist/chunk-DMRQEQQK.mjs.map +1 -0
- package/dist/{chunk-HEDGKRGC.mjs → chunk-DOW6EHBI.mjs} +6 -32
- package/dist/chunk-DOW6EHBI.mjs.map +1 -0
- package/dist/chunk-F23MNQCK.mjs +28 -0
- package/dist/chunk-F23MNQCK.mjs.map +1 -0
- package/dist/{chunk-5RXT5GLF.mjs → chunk-F6QJWZJX.mjs} +2 -2
- package/dist/chunk-FTVKPZCX.mjs +37 -0
- package/dist/chunk-FTVKPZCX.mjs.map +1 -0
- package/dist/{chunk-NUP7ZBVE.mjs → chunk-GICUX46A.mjs} +2 -2
- package/dist/chunk-HA3LRSDK.mjs +21 -0
- package/dist/chunk-HA3LRSDK.mjs.map +1 -0
- package/dist/{chunk-W6CFPK2C.mjs → chunk-HOLFVKXQ.mjs} +3 -2
- package/dist/chunk-HOLFVKXQ.mjs.map +1 -0
- package/dist/chunk-JGQTAIEP.mjs +67 -0
- package/dist/chunk-JGQTAIEP.mjs.map +1 -0
- package/dist/chunk-JGYPZ7ET.mjs +103 -0
- package/dist/chunk-JGYPZ7ET.mjs.map +1 -0
- package/dist/{chunk-GYI4NCUY.mjs → chunk-KPNAC2WN.mjs} +2 -2
- package/dist/{chunk-F7MLQ6JI.mjs → chunk-NAXSP4VU.mjs} +12 -3
- package/dist/{chunk-F7MLQ6JI.mjs.map → chunk-NAXSP4VU.mjs.map} +1 -1
- package/dist/{chunk-JYN2QSN2.mjs → chunk-NZB6BBFT.mjs} +1 -1
- package/dist/chunk-NZB6BBFT.mjs.map +1 -0
- package/dist/{chunk-R6MQFVHE.mjs → chunk-O55OTMJ5.mjs} +2 -2
- package/dist/chunk-OQD4GKOS.mjs +65 -0
- package/dist/chunk-OQD4GKOS.mjs.map +1 -0
- package/dist/{chunk-YNGU3V4J.mjs → chunk-QDG2QLFV.mjs} +3 -3
- package/dist/{chunk-E6OOFTRQ.mjs → chunk-QER35NXN.mjs} +14 -8
- package/dist/chunk-QER35NXN.mjs.map +1 -0
- package/dist/chunk-QOIBRXYT.mjs +113 -0
- package/dist/chunk-QOIBRXYT.mjs.map +1 -0
- package/dist/{chunk-B6T36QDV.mjs → chunk-QTC4ATZD.mjs} +2 -2
- package/dist/{chunk-J35DWEJX.mjs → chunk-RGZSYJFL.mjs} +14 -5
- package/dist/chunk-RGZSYJFL.mjs.map +1 -0
- package/dist/chunk-RJ763KDH.mjs +21 -0
- package/dist/chunk-RJ763KDH.mjs.map +1 -0
- package/dist/{chunk-AGIY7SFP.mjs → chunk-SO7TS4TS.mjs} +2 -2
- package/dist/{chunk-BFM6UZGI.mjs → chunk-TTDR3NZL.mjs} +2 -2
- package/dist/chunk-TTDR3NZL.mjs.map +1 -0
- package/dist/{chunk-LHIG6RW7.mjs → chunk-VNH7CZJ4.mjs} +5 -13
- package/dist/chunk-VNH7CZJ4.mjs.map +1 -0
- package/dist/{chunk-HBGFFKP3.mjs → chunk-WVCJV74B.mjs} +2 -2
- package/dist/chunk-XSID7YR7.mjs +1 -0
- package/dist/chunk-XSID7YR7.mjs.map +1 -0
- package/dist/{chunk-EDPWJWQO.mjs → chunk-YQT2TN3U.mjs} +2 -2
- package/dist/footer/footer.js.map +1 -1
- package/dist/footer/footer.mjs +6 -6
- package/dist/footer/index.js.map +1 -1
- package/dist/footer/index.mjs +6 -6
- package/dist/form/checkbox/checkbox.d.ts +10 -1
- package/dist/form/checkbox/checkbox.d.ts.map +1 -1
- package/dist/form/checkbox/checkbox.js +170 -71
- package/dist/form/checkbox/checkbox.js.map +1 -1
- package/dist/form/checkbox/checkbox.mjs +11 -4
- package/dist/form/checkbox/index.js +170 -71
- package/dist/form/checkbox/index.js.map +1 -1
- package/dist/form/checkbox/index.mjs +11 -4
- package/dist/form/date-picker/date-picker.d.ts.map +1 -1
- package/dist/form/date-picker/date-picker.js +76 -46
- package/dist/form/date-picker/date-picker.js.map +1 -1
- package/dist/form/date-picker/date-picker.mjs +8 -4
- package/dist/form/date-picker/index.js +76 -46
- package/dist/form/date-picker/index.js.map +1 -1
- package/dist/form/date-picker/index.mjs +8 -4
- package/dist/form/error-message/error-message.d.ts +2 -0
- package/dist/form/error-message/error-message.d.ts.map +1 -1
- package/dist/form/error-message/error-message.js +18 -8
- package/dist/form/error-message/error-message.js.map +1 -1
- package/dist/form/error-message/error-message.mjs +3 -1
- package/dist/form/error-message/index.js +18 -8
- package/dist/form/error-message/index.js.map +1 -1
- package/dist/form/error-message/index.mjs +3 -1
- package/dist/form/error-summary/error-summary.d.ts.map +1 -1
- package/dist/form/error-summary/error-summary.js +10 -1
- package/dist/form/error-summary/error-summary.js.map +1 -1
- package/dist/form/error-summary/error-summary.mjs +3 -3
- package/dist/form/error-summary/index.js +10 -1
- package/dist/form/error-summary/index.js.map +1 -1
- package/dist/form/error-summary/index.mjs +3 -3
- package/dist/form/fieldset/fieldset-description.d.ts +12 -0
- package/dist/form/fieldset/fieldset-description.d.ts.map +1 -0
- package/dist/form/fieldset/fieldset-description.js +51 -0
- package/dist/form/fieldset/fieldset-description.js.map +1 -0
- package/dist/form/fieldset/fieldset-description.mjs +8 -0
- package/dist/form/fieldset/fieldset-description.mjs.map +1 -0
- package/dist/form/fieldset/fieldset-legend.d.ts +9 -0
- package/dist/form/fieldset/fieldset-legend.d.ts.map +1 -0
- package/dist/form/fieldset/fieldset-legend.js +72 -0
- package/dist/form/fieldset/fieldset-legend.js.map +1 -0
- package/dist/form/fieldset/fieldset-legend.mjs +8 -0
- package/dist/form/fieldset/fieldset-legend.mjs.map +1 -0
- package/dist/form/fieldset/fieldset.d.ts +30 -6
- package/dist/form/fieldset/fieldset.d.ts.map +1 -1
- package/dist/form/fieldset/fieldset.js +110 -35
- package/dist/form/fieldset/fieldset.js.map +1 -1
- package/dist/form/fieldset/fieldset.mjs +9 -2
- package/dist/form/fieldset/index.d.ts +2 -0
- package/dist/form/fieldset/index.d.ts.map +1 -1
- package/dist/form/fieldset/index.js +114 -35
- package/dist/form/fieldset/index.js.map +1 -1
- package/dist/form/fieldset/index.mjs +16 -3
- package/dist/form/index.d.ts +3 -0
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +550 -260
- package/dist/form/index.js.map +1 -1
- package/dist/form/index.mjs +57 -24
- package/dist/form/input/index.js +103 -39
- package/dist/form/input/index.js.map +1 -1
- package/dist/form/input/index.mjs +8 -3
- package/dist/form/input/input.d.ts.map +1 -1
- package/dist/form/input/input.js +103 -39
- package/dist/form/input/input.js.map +1 -1
- package/dist/form/input/input.mjs +8 -3
- package/dist/form/input-group/index.js +59 -23
- package/dist/form/input-group/index.js.map +1 -1
- package/dist/form/input-group/index.mjs +7 -2
- package/dist/form/input-group/input-group.d.ts +9 -1
- package/dist/form/input-group/input-group.d.ts.map +1 -1
- package/dist/form/input-group/input-group.js +59 -23
- package/dist/form/input-group/input-group.js.map +1 -1
- package/dist/form/input-group/input-group.mjs +7 -2
- package/dist/form/radio-button/index.js +139 -86
- package/dist/form/radio-button/index.js.map +1 -1
- package/dist/form/radio-button/index.mjs +12 -5
- package/dist/form/radio-button/radio-button.d.ts +2 -10
- package/dist/form/radio-button/radio-button.d.ts.map +1 -1
- package/dist/form/radio-button/radio-button.js +139 -86
- package/dist/form/radio-button/radio-button.js.map +1 -1
- package/dist/form/radio-button/radio-button.mjs +12 -5
- package/dist/form/radio-button/radio-group.d.ts +11 -13
- package/dist/form/radio-button/radio-group.d.ts.map +1 -1
- package/dist/form/radio-button/radio-group.js +123 -48
- package/dist/form/radio-button/radio-group.js.map +1 -1
- package/dist/form/radio-button/radio-group.mjs +11 -4
- package/dist/form/search-wrapper/index.d.ts +3 -0
- package/dist/form/search-wrapper/index.d.ts.map +1 -0
- package/dist/form/search-wrapper/index.js +68 -0
- package/dist/form/search-wrapper/index.js.map +1 -0
- package/dist/form/search-wrapper/index.mjs +9 -0
- package/dist/form/search-wrapper/index.mjs.map +1 -0
- package/dist/form/search-wrapper/search-wrapper.d.ts +6 -0
- package/dist/form/search-wrapper/search-wrapper.d.ts.map +1 -0
- package/dist/form/search-wrapper/search-wrapper.js +66 -0
- package/dist/form/search-wrapper/search-wrapper.js.map +1 -0
- package/dist/form/search-wrapper/search-wrapper.mjs +8 -0
- package/dist/form/search-wrapper/search-wrapper.mjs.map +1 -0
- package/dist/form/select/index.js +105 -38
- package/dist/form/select/index.js.map +1 -1
- package/dist/form/select/index.mjs +8 -3
- package/dist/form/select/select.d.ts.map +1 -1
- package/dist/form/select/select.js +105 -38
- package/dist/form/select/select.js.map +1 -1
- package/dist/form/select/select.mjs +8 -3
- package/dist/form/suggestions/index.d.ts +7 -0
- package/dist/form/suggestions/index.d.ts.map +1 -0
- package/dist/form/suggestions/index.js +131 -0
- package/dist/form/suggestions/index.js.map +1 -0
- package/dist/form/suggestions/index.mjs +19 -0
- package/dist/form/suggestions/index.mjs.map +1 -0
- package/dist/form/suggestions/suggestions-item.d.ts +45 -0
- package/dist/form/suggestions/suggestions-item.d.ts.map +1 -0
- package/dist/form/suggestions/suggestions-item.js +83 -0
- package/dist/form/suggestions/suggestions-item.js.map +1 -0
- package/dist/form/suggestions/suggestions-item.mjs +10 -0
- package/dist/form/suggestions/suggestions-item.mjs.map +1 -0
- package/dist/form/suggestions/suggestions-wrapper.d.ts +41 -0
- package/dist/form/suggestions/suggestions-wrapper.d.ts.map +1 -0
- package/dist/form/suggestions/suggestions-wrapper.js +66 -0
- package/dist/form/suggestions/suggestions-wrapper.js.map +1 -0
- package/dist/form/suggestions/suggestions-wrapper.mjs +8 -0
- package/dist/form/suggestions/suggestions-wrapper.mjs.map +1 -0
- package/dist/form/suggestions/suggestions.d.ts +57 -0
- package/dist/form/suggestions/suggestions.d.ts.map +1 -0
- package/dist/form/suggestions/suggestions.js +123 -0
- package/dist/form/suggestions/suggestions.js.map +1 -0
- package/dist/form/suggestions/suggestions.mjs +10 -0
- package/dist/form/suggestions/suggestions.mjs.map +1 -0
- package/dist/form/textarea/index.js +92 -27
- package/dist/form/textarea/index.js.map +1 -1
- package/dist/form/textarea/index.mjs +8 -3
- package/dist/form/textarea/textarea.d.ts.map +1 -1
- package/dist/form/textarea/textarea.js +92 -27
- package/dist/form/textarea/textarea.js.map +1 -1
- package/dist/form/textarea/textarea.mjs +8 -3
- package/dist/form/validation-message/index.d.ts +3 -0
- package/dist/form/validation-message/index.d.ts.map +1 -0
- package/dist/form/validation-message/index.js +75 -0
- package/dist/form/validation-message/index.js.map +1 -0
- package/dist/form/validation-message/index.mjs +9 -0
- package/dist/form/validation-message/index.mjs.map +1 -0
- package/dist/form/validation-message/validation-message.d.ts +6 -0
- package/dist/form/validation-message/validation-message.d.ts.map +1 -0
- package/dist/form/validation-message/validation-message.js +73 -0
- package/dist/form/validation-message/validation-message.js.map +1 -0
- package/dist/form/validation-message/validation-message.mjs +8 -0
- package/dist/form/validation-message/validation-message.mjs.map +1 -0
- package/dist/index.js +798 -505
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +90 -55
- package/dist/layout/index.mjs +7 -7
- package/dist/modal/index.js.map +1 -1
- package/dist/modal/index.mjs +2 -2
- package/dist/modal/modal.js.map +1 -1
- package/dist/modal/modal.mjs +2 -2
- package/dist/navbar/index.js +1 -0
- package/dist/navbar/index.js.map +1 -1
- package/dist/navbar/index.mjs +3 -3
- package/dist/navbar/navbar-expandable-menu.d.ts.map +1 -1
- package/dist/navbar/navbar-expandable-menu.js +1 -0
- package/dist/navbar/navbar-expandable-menu.js.map +1 -1
- package/dist/navbar/navbar-expandable-menu.mjs +2 -2
- package/dist/navbar/navbar.js +1 -0
- package/dist/navbar/navbar.js.map +1 -1
- package/dist/navbar/navbar.mjs +3 -3
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/index.mjs +3 -3
- package/dist/skeleton/skeleton.js.map +1 -1
- package/dist/skeleton/skeleton.mjs +3 -3
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +3 -3
- package/dist/tabs/tabs-list.js.map +1 -1
- package/dist/tabs/tabs-list.mjs +2 -2
- package/dist/tabs/tabs.js.map +1 -1
- package/dist/tabs/tabs.mjs +3 -3
- package/dist/utils/auto-animate-height.js.map +1 -1
- package/dist/utils/auto-animate-height.mjs +2 -2
- package/dist/utils/index.js +11 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +4 -2
- package/dist/utils/utils.d.ts +4 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +11 -0
- package/dist/utils/utils.js.map +1 -1
- package/dist/utils/utils.mjs +3 -1
- package/package.json +5 -5
- package/src/accordion/accordion.stories.tsx +13 -20
- package/src/alert/alert.stories.tsx +1 -1
- package/src/badge/badge.stories.tsx +1 -1
- package/src/blockquote/blockquote.stories.tsx +1 -1
- package/src/blockquote/blockquote.tsx +4 -12
- package/src/box/box.stories.tsx +1 -1
- package/src/breadcrumbs/breadcrumbs.stories.tsx +1 -1
- package/src/button/button.stories.tsx +1 -1
- package/src/button/button.tsx +6 -2
- package/src/button-list/button-list.stories.tsx +1 -1
- package/src/card/card.stories.tsx +10 -9
- package/src/card/card.tsx +2 -2
- package/src/description-list/description-list.stories.tsx +1 -1
- package/src/figure/figure.stories.tsx +1 -1
- package/src/form/checkbox/checkbox.stories.tsx +1 -1
- package/src/form/checkbox/checkbox.tsx +32 -11
- package/src/form/date-picker/date-picker.stories.tsx +1 -1
- package/src/form/date-picker/date-picker.tsx +7 -1
- package/src/form/error-message/error-message.tsx +8 -14
- package/src/form/error-summary/error-summary.stories.tsx +1 -1
- package/src/form/error-summary/error-summary.tsx +6 -1
- package/src/form/fieldset/fieldset-description.tsx +17 -0
- package/src/form/fieldset/fieldset-legend.tsx +22 -0
- package/src/form/fieldset/fieldset.stories.tsx +3 -2
- package/src/form/fieldset/fieldset.tsx +95 -26
- package/src/form/fieldset/index.tsx +2 -0
- package/src/form/index.tsx +3 -0
- package/src/form/input/input.stories.tsx +1 -1
- package/src/form/input/input.tsx +23 -8
- package/src/form/input-group/input-group.tsx +32 -15
- package/src/form/radio-button/radio-button.stories.tsx +1 -2
- package/src/form/radio-button/radio-button.tsx +8 -34
- package/src/form/radio-button/radio-group.stories.tsx +1 -1
- package/src/form/radio-button/radio-group.tsx +20 -19
- package/src/form/search-wrapper/index.tsx +2 -0
- package/src/form/search-wrapper/search-wrapper.stories.tsx +34 -0
- package/src/form/search-wrapper/search-wrapper.tsx +14 -0
- package/src/form/select/select.stories.tsx +1 -1
- package/src/form/select/select.tsx +25 -8
- package/src/form/suggestions/index.tsx +6 -0
- package/src/form/suggestions/suggestions-item.tsx +70 -0
- package/src/form/suggestions/suggestions-wrapper.tsx +50 -0
- package/src/form/suggestions/suggestions.tsx +89 -0
- package/src/form/textarea/textarea.stories.tsx +1 -1
- package/src/form/textarea/textarea.tsx +19 -2
- package/src/form/validation-message/index.tsx +2 -0
- package/src/form/validation-message/validation-message.stories.tsx +20 -0
- package/src/form/validation-message/validation-message.tsx +18 -0
- package/src/help-text/help-text.stories.tsx +1 -1
- package/src/layout/container/container.stories.tsx +1 -1
- package/src/layout/grid/grid.stories.tsx +1 -1
- package/src/layout/stack/stack.stories.tsx +1 -1
- package/src/link/link.stories.tsx +1 -1
- package/src/list/link-list.stories.tsx +1 -1
- package/src/list/list.stories.tsx +1 -1
- package/src/message/message.stories.tsx +1 -1
- package/src/modal/modal.stories.tsx +5 -9
- package/src/navbar/navbar-expandable-menu.tsx +1 -0
- package/src/navbar/navbar.stories.tsx +1 -1
- package/src/show-more/show-more.stories.tsx +1 -1
- package/src/skeleton/skeleton.stories.tsx +1 -1
- package/src/spinner/spinner.stories.tsx +1 -1
- package/src/step-indicator/step-indicator.stories.tsx +1 -1
- package/src/styled-html/styled-html.stories.tsx +1 -1
- package/src/table/table.stories.tsx +1 -1
- package/src/tabs/tabs.stories.tsx +1 -1
- package/src/text/text.stories.tsx +1 -1
- package/src/utils/utils.ts +16 -0
- package/src/warning-banner/warning-banner.stories.tsx +1 -1
- package/dist/chunk-3VKESN3T.mjs +0 -37
- package/dist/chunk-3VKESN3T.mjs.map +0 -1
- package/dist/chunk-6OJINZ37.mjs.map +0 -1
- package/dist/chunk-77M2ZTP7.mjs.map +0 -1
- package/dist/chunk-BFM6UZGI.mjs.map +0 -1
- package/dist/chunk-BO3EWZGA.mjs +0 -78
- package/dist/chunk-BO3EWZGA.mjs.map +0 -1
- package/dist/chunk-E6OOFTRQ.mjs.map +0 -1
- package/dist/chunk-HEDGKRGC.mjs.map +0 -1
- package/dist/chunk-IJSEJZ3W.mjs +0 -1
- package/dist/chunk-J35DWEJX.mjs.map +0 -1
- package/dist/chunk-JYN2QSN2.mjs.map +0 -1
- package/dist/chunk-LHIG6RW7.mjs.map +0 -1
- package/dist/chunk-LMF3QGSF.mjs +0 -1
- package/dist/chunk-N4W3OMA2.mjs +0 -37
- package/dist/chunk-N4W3OMA2.mjs.map +0 -1
- package/dist/chunk-NBEGX26X.mjs +0 -36
- package/dist/chunk-NBEGX26X.mjs.map +0 -1
- package/dist/chunk-TYCGAA35.mjs.map +0 -1
- package/dist/chunk-W6CFPK2C.mjs.map +0 -1
- package/dist/chunk-Z2ZPTZ6F.mjs +0 -69
- package/dist/chunk-Z2ZPTZ6F.mjs.map +0 -1
- package/src/form/error-message/error-message.stories.tsx +0 -20
- /package/dist/{chunk-IJSEJZ3W.mjs.map → chunk-5J5LYE6Z.mjs.map} +0 -0
- /package/dist/{chunk-LMF3QGSF.mjs.map → chunk-5M6MEYM7.mjs.map} +0 -0
- /package/dist/{chunk-5RXT5GLF.mjs.map → chunk-F6QJWZJX.mjs.map} +0 -0
- /package/dist/{chunk-NUP7ZBVE.mjs.map → chunk-GICUX46A.mjs.map} +0 -0
- /package/dist/{chunk-GYI4NCUY.mjs.map → chunk-KPNAC2WN.mjs.map} +0 -0
- /package/dist/{chunk-R6MQFVHE.mjs.map → chunk-O55OTMJ5.mjs.map} +0 -0
- /package/dist/{chunk-YNGU3V4J.mjs.map → chunk-QDG2QLFV.mjs.map} +0 -0
- /package/dist/{chunk-B6T36QDV.mjs.map → chunk-QTC4ATZD.mjs.map} +0 -0
- /package/dist/{chunk-AGIY7SFP.mjs.map → chunk-SO7TS4TS.mjs.map} +0 -0
- /package/dist/{chunk-HBGFFKP3.mjs.map → chunk-WVCJV74B.mjs.map} +0 -0
- /package/dist/{chunk-EDPWJWQO.mjs.map → chunk-YQT2TN3U.mjs.map} +0 -0
|
@@ -1,68 +1,137 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
Children,
|
|
3
|
+
cloneElement,
|
|
4
|
+
isValidElement,
|
|
5
|
+
useId,
|
|
6
|
+
forwardRef,
|
|
7
|
+
createContext,
|
|
8
|
+
useContext,
|
|
9
|
+
} from "react";
|
|
10
|
+
import type {
|
|
11
|
+
FieldsetHTMLAttributes,
|
|
12
|
+
ReactElement,
|
|
13
|
+
ReactNode,
|
|
14
|
+
CSSProperties,
|
|
15
|
+
ComponentProps,
|
|
16
|
+
} from "react";
|
|
3
17
|
import { clsx } from "@postenbring/hedwig-css/typed-classname";
|
|
4
|
-
import {
|
|
18
|
+
import { ValidationMessage, type ValidationMessageProps } from "../validation-message";
|
|
19
|
+
import { type ErrorMessageProps } from "../error-message";
|
|
20
|
+
import { getValidationMessageValue } from "../../utils";
|
|
21
|
+
import { FieldsetDescription } from "./fieldset-description";
|
|
22
|
+
import { FieldsetLegend } from "./fieldset-legend";
|
|
23
|
+
|
|
24
|
+
type FieldsetLegendProps = ComponentProps<typeof FieldsetLegend>;
|
|
5
25
|
|
|
6
26
|
export interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
7
27
|
className?: string;
|
|
8
28
|
style?: CSSProperties;
|
|
29
|
+
"data-color"?: "info" | "success" | "warning" | "error";
|
|
30
|
+
validationMessage?: ReactNode | { value: ReactNode };
|
|
31
|
+
validationMessageProps?: Partial<ValidationMessageProps>;
|
|
9
32
|
/**
|
|
10
33
|
* Providing an errorMessage will also give contained Checkboxes or Radio buttons
|
|
11
34
|
* error styling and aria to indicate invalid state.
|
|
12
35
|
*
|
|
13
36
|
* For Radio buttons you are even better off using RadioGroup.
|
|
14
37
|
*/
|
|
38
|
+
|
|
39
|
+
/** @deprecated Use `validationMessage` instead */
|
|
15
40
|
errorMessage?: ReactNode;
|
|
16
|
-
|
|
17
|
-
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Pass props directly to <Fieldset.Legend> instead.
|
|
43
|
+
*/
|
|
44
|
+
legendProps?: FieldsetLegendProps;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated Use <Fieldset.Legend>...</Fieldset.Legend> instead.
|
|
47
|
+
*/
|
|
48
|
+
legend?: ReactNode;
|
|
49
|
+
size?: "small" | "";
|
|
18
50
|
children: ReactNode;
|
|
51
|
+
/** @deprecated Use `validationMessageProps` instead */
|
|
19
52
|
errorMessageProps?: Partial<ErrorMessageProps>;
|
|
20
53
|
}
|
|
21
54
|
|
|
22
|
-
|
|
55
|
+
/** @deprecated Will no longer be needed */
|
|
56
|
+
const FieldsetContext = createContext<{ hasError: boolean; size: "small" | "" }>({
|
|
57
|
+
hasError: false,
|
|
58
|
+
size: "",
|
|
59
|
+
});
|
|
23
60
|
|
|
61
|
+
/** @deprecated Will no longer be needed */
|
|
24
62
|
export const useFieldsetContext = () => useContext(FieldsetContext);
|
|
25
63
|
|
|
26
64
|
export const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(function Fieldset(
|
|
27
65
|
{
|
|
28
66
|
className,
|
|
29
67
|
style,
|
|
68
|
+
"data-color": dataColor = undefined,
|
|
69
|
+
validationMessage,
|
|
70
|
+
validationMessageProps,
|
|
30
71
|
errorMessage,
|
|
31
72
|
errorMessageProps,
|
|
32
|
-
legendProps
|
|
73
|
+
legendProps,
|
|
33
74
|
legend,
|
|
75
|
+
size = "",
|
|
34
76
|
children,
|
|
35
77
|
...rest
|
|
36
78
|
},
|
|
37
79
|
ref,
|
|
38
80
|
) {
|
|
39
|
-
const
|
|
81
|
+
const validationMessageId = useId();
|
|
82
|
+
const validationColor = errorMessage ? "error" : dataColor;
|
|
83
|
+
const validationMessageValue = getValidationMessageValue(validationMessage, errorMessage);
|
|
84
|
+
const childArray = Children.toArray(children);
|
|
85
|
+
const legendChild = childArray.find(
|
|
86
|
+
(child): child is ReactElement<FieldsetLegendProps> =>
|
|
87
|
+
isValidElement<FieldsetLegendProps>(child) && child.type === FieldsetLegend,
|
|
88
|
+
);
|
|
89
|
+
const contentChildren = legendChild
|
|
90
|
+
? childArray.filter((child) => child !== legendChild)
|
|
91
|
+
: childArray;
|
|
92
|
+
let renderedLegend = null;
|
|
93
|
+
|
|
94
|
+
if (legendChild) {
|
|
95
|
+
renderedLegend = cloneElement(legendChild, {
|
|
96
|
+
...legendProps,
|
|
97
|
+
...legendChild.props,
|
|
98
|
+
className: clsx(
|
|
99
|
+
legendProps?.className as undefined,
|
|
100
|
+
legendChild.props.className as undefined,
|
|
101
|
+
),
|
|
102
|
+
});
|
|
103
|
+
} else if (legend !== undefined) {
|
|
104
|
+
renderedLegend = <FieldsetLegend {...legendProps}>{legend}</FieldsetLegend>;
|
|
105
|
+
}
|
|
40
106
|
|
|
41
107
|
return (
|
|
42
108
|
<fieldset
|
|
43
|
-
aria-describedby={
|
|
109
|
+
aria-describedby={validationMessageValue ? validationMessageId : undefined}
|
|
44
110
|
aria-invalid={errorMessage ? true : undefined}
|
|
45
|
-
className={clsx("hds-fieldset", className as undefined)}
|
|
111
|
+
className={clsx("hds-fieldset", { [`hds-fieldset--${size}`]: size }, className as undefined)}
|
|
112
|
+
data-color={validationColor}
|
|
46
113
|
ref={ref}
|
|
47
114
|
style={style}
|
|
48
115
|
{...rest}
|
|
49
116
|
>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{ [`hds-fieldset__legend--${legendSize}`]: legendSize },
|
|
54
|
-
legendClassName as undefined,
|
|
55
|
-
)}
|
|
56
|
-
{...legendProps}
|
|
57
|
-
>
|
|
58
|
-
{legend}
|
|
59
|
-
</legend>
|
|
60
|
-
<FieldsetContext.Provider value={{ hasError: Boolean(errorMessage) }}>
|
|
61
|
-
{children}
|
|
117
|
+
{renderedLegend}
|
|
118
|
+
<FieldsetContext.Provider value={{ hasError: Boolean(errorMessage), size }}>
|
|
119
|
+
{contentChildren}
|
|
62
120
|
</FieldsetContext.Provider>
|
|
63
|
-
<
|
|
64
|
-
{
|
|
65
|
-
|
|
121
|
+
<ValidationMessage
|
|
122
|
+
id={validationMessageId}
|
|
123
|
+
{...(validationMessageProps ?? errorMessageProps)}
|
|
124
|
+
>
|
|
125
|
+
{validationMessageValue}
|
|
126
|
+
</ValidationMessage>
|
|
66
127
|
</fieldset>
|
|
67
128
|
);
|
|
68
|
-
});
|
|
129
|
+
}) as FieldsetType;
|
|
130
|
+
|
|
131
|
+
type FieldsetType = ReturnType<typeof forwardRef<HTMLFieldSetElement, FieldsetProps>> & {
|
|
132
|
+
Description: typeof FieldsetDescription;
|
|
133
|
+
Legend: typeof FieldsetLegend;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
Fieldset.Description = FieldsetDescription;
|
|
137
|
+
Fieldset.Legend = FieldsetLegend;
|
package/src/form/index.tsx
CHANGED
|
@@ -5,5 +5,8 @@ export * from "./error-summary";
|
|
|
5
5
|
export * from "./fieldset";
|
|
6
6
|
export * from "./input";
|
|
7
7
|
export * from "./radio-button";
|
|
8
|
+
export * from "./search-wrapper";
|
|
8
9
|
export * from "./select";
|
|
10
|
+
export * from "./suggestions";
|
|
9
11
|
export * from "./textarea";
|
|
12
|
+
export * from "./validation-message";
|
package/src/form/input/input.tsx
CHANGED
|
@@ -16,14 +16,28 @@ export type InputProps = Omit<
|
|
|
16
16
|
"children"
|
|
17
17
|
>;
|
|
18
18
|
|
|
19
|
-
export const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
export const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
20
|
+
(
|
|
21
|
+
{
|
|
22
|
+
className,
|
|
23
|
+
size,
|
|
24
|
+
validationMessage,
|
|
25
|
+
errorMessage,
|
|
26
|
+
labelProps,
|
|
27
|
+
label,
|
|
28
|
+
id,
|
|
29
|
+
style,
|
|
30
|
+
disabled,
|
|
31
|
+
readOnly,
|
|
32
|
+
"data-color": dataColor,
|
|
33
|
+
...rest
|
|
34
|
+
},
|
|
35
|
+
ref,
|
|
36
|
+
) => (
|
|
24
37
|
<InputGroup
|
|
25
38
|
className={clsx("hds-input", className as undefined)}
|
|
26
39
|
disabled={disabled}
|
|
40
|
+
validationMessage={validationMessage}
|
|
27
41
|
errorMessage={errorMessage}
|
|
28
42
|
id={id}
|
|
29
43
|
label={label}
|
|
@@ -31,10 +45,11 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(function Input(
|
|
|
31
45
|
readOnly={readOnly}
|
|
32
46
|
style={style}
|
|
33
47
|
size={size}
|
|
48
|
+
data-color={dataColor}
|
|
34
49
|
>
|
|
35
|
-
<input
|
|
50
|
+
<input disabled={disabled} readOnly={readOnly} ref={ref} {...rest} />
|
|
36
51
|
</InputGroup>
|
|
37
|
-
)
|
|
38
|
-
|
|
52
|
+
),
|
|
53
|
+
);
|
|
39
54
|
|
|
40
55
|
Input.displayName = "Input";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useId, forwardRef, Children, isValidElement, cloneElement } from "react";
|
|
2
2
|
import type { LabelHTMLAttributes, ReactNode, CSSProperties } from "react";
|
|
3
3
|
import { clsx } from "@postenbring/hedwig-css/typed-classname";
|
|
4
|
-
import {
|
|
4
|
+
import { ValidationMessage, type ValidationMessageProps } from "../validation-message";
|
|
5
|
+
import { type ErrorMessageProps } from "../error-message";
|
|
6
|
+
import { getValidationMessageValue } from "../../utils";
|
|
5
7
|
|
|
6
8
|
interface InputProps {
|
|
7
9
|
"aria-describedby"?: string;
|
|
@@ -14,11 +16,16 @@ export interface InputGroupProps {
|
|
|
14
16
|
id?: string;
|
|
15
17
|
className?: string;
|
|
16
18
|
style?: CSSProperties;
|
|
19
|
+
"data-color"?: "info" | "success" | "warning" | "error";
|
|
17
20
|
size?: "large" | "small";
|
|
21
|
+
validationMessage?: ReactNode | { value: ReactNode };
|
|
22
|
+
validationMessageProps?: Partial<ValidationMessageProps>;
|
|
23
|
+
/** @deprecated Use `validationMessage` instead */
|
|
18
24
|
errorMessage?: ReactNode;
|
|
25
|
+
/** @deprecated Use `validationMessageProps` instead */
|
|
19
26
|
errorMessageProps?: Partial<ErrorMessageProps>;
|
|
20
27
|
labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
|
|
21
|
-
label
|
|
28
|
+
label?: ReactNode;
|
|
22
29
|
disabled?: boolean;
|
|
23
30
|
readOnly?: boolean;
|
|
24
31
|
/**
|
|
@@ -34,7 +41,10 @@ export const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function I
|
|
|
34
41
|
id,
|
|
35
42
|
className,
|
|
36
43
|
style,
|
|
44
|
+
"data-color": dataColor = undefined,
|
|
37
45
|
size = "large",
|
|
46
|
+
validationMessage,
|
|
47
|
+
validationMessageProps,
|
|
38
48
|
errorMessage,
|
|
39
49
|
errorMessageProps,
|
|
40
50
|
labelProps: { className: labelClassName, ...labelProps } = {},
|
|
@@ -46,12 +56,14 @@ export const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function I
|
|
|
46
56
|
},
|
|
47
57
|
ref,
|
|
48
58
|
) {
|
|
49
|
-
const
|
|
59
|
+
const validationMessageId = useId();
|
|
50
60
|
const inputId = useId();
|
|
61
|
+
const validationColor = errorMessage ? "error" : dataColor;
|
|
62
|
+
const validationMessageValue = getValidationMessageValue(validationMessage, errorMessage);
|
|
51
63
|
|
|
52
64
|
const renderInput = () => {
|
|
53
65
|
const inputProps: InputProps = {
|
|
54
|
-
"aria-describedby":
|
|
66
|
+
"aria-describedby": validationMessage ? validationMessageId : undefined,
|
|
55
67
|
"aria-invalid": errorMessage ? true : undefined,
|
|
56
68
|
id: id ?? inputId,
|
|
57
69
|
className: clsx("hds-input-group__input"),
|
|
@@ -80,21 +92,23 @@ export const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function I
|
|
|
80
92
|
"hds-input-group",
|
|
81
93
|
{
|
|
82
94
|
[`hds-input-group--${size}`]: size,
|
|
83
|
-
"hds-input-group--error": errorMessage,
|
|
84
95
|
},
|
|
85
96
|
className as undefined,
|
|
86
97
|
)}
|
|
87
98
|
ref={ref}
|
|
88
99
|
style={style}
|
|
100
|
+
data-color={validationColor}
|
|
89
101
|
{...rest}
|
|
90
102
|
>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
103
|
+
{label !== null && label !== undefined && label !== false && (
|
|
104
|
+
<label
|
|
105
|
+
className={clsx("hds-input-group__label", labelClassName as undefined)}
|
|
106
|
+
{...labelProps}
|
|
107
|
+
htmlFor={id ?? inputId}
|
|
108
|
+
>
|
|
109
|
+
{label}
|
|
110
|
+
</label>
|
|
111
|
+
)}
|
|
98
112
|
<div
|
|
99
113
|
className={clsx("hds-input-group__input-wrapper")}
|
|
100
114
|
data-disabled={disabled}
|
|
@@ -102,9 +116,12 @@ export const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function I
|
|
|
102
116
|
>
|
|
103
117
|
{renderInput()}
|
|
104
118
|
</div>
|
|
105
|
-
<
|
|
106
|
-
{
|
|
107
|
-
|
|
119
|
+
<ValidationMessage
|
|
120
|
+
id={validationMessageId}
|
|
121
|
+
{...(validationMessageProps ?? errorMessageProps)}
|
|
122
|
+
>
|
|
123
|
+
{validationMessageValue}
|
|
124
|
+
</ValidationMessage>
|
|
108
125
|
</div>
|
|
109
126
|
);
|
|
110
127
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { RadioButton } from "./index";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof RadioButton> = {
|
|
@@ -17,7 +17,6 @@ export const Preview: Story = {
|
|
|
17
17
|
title: "",
|
|
18
18
|
children: "Just a RadioButton",
|
|
19
19
|
checked: true,
|
|
20
|
-
hasError: false,
|
|
21
20
|
variant: "plain",
|
|
22
21
|
},
|
|
23
22
|
argTypes: {
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
import { forwardRef, type InputHTMLAttributes, type ReactNode } from "react";
|
|
2
2
|
import { clsx } from "@postenbring/hedwig-css/typed-classname";
|
|
3
|
-
import {
|
|
4
|
-
import { type RadioGroupProps, useRadioGroupContext } from "./radio-group";
|
|
3
|
+
import { useRadioGroupContext } from "./radio-group";
|
|
5
4
|
|
|
6
5
|
export interface RadioButtonProps
|
|
7
|
-
extends Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue"> {
|
|
6
|
+
extends Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "size"> {
|
|
8
7
|
children: ReactNode;
|
|
9
8
|
variant?: "plain" | "bounding-box";
|
|
10
|
-
/**
|
|
11
|
-
* Set to `true` to add error styling. The component will take care of aria to indicate invalid state.
|
|
12
|
-
*
|
|
13
|
-
* Normally you don't need this, as you should wrap your Radio buttons in the RadioGroup component.
|
|
14
|
-
* When providing an errorMessage to RadioGroup, all contained Radio buttons will get correct hasError state.
|
|
15
|
-
*
|
|
16
|
-
* You can use this when your Radio button is part of a non-HDS fieldset which shows an error message.
|
|
17
|
-
*/
|
|
18
|
-
hasError?: boolean;
|
|
19
9
|
title?: string;
|
|
10
|
+
size?: "small" | "";
|
|
20
11
|
}
|
|
21
12
|
|
|
22
13
|
const isChecked = ({
|
|
@@ -24,7 +15,7 @@ const isChecked = ({
|
|
|
24
15
|
selectedValue,
|
|
25
16
|
value,
|
|
26
17
|
}: Pick<RadioButtonProps, "checked" | "value"> & {
|
|
27
|
-
selectedValue:
|
|
18
|
+
selectedValue: RadioButtonProps["value"];
|
|
28
19
|
}) => {
|
|
29
20
|
if (typeof checked !== "undefined") return checked;
|
|
30
21
|
if (typeof selectedValue !== "undefined") return value === selectedValue;
|
|
@@ -32,26 +23,9 @@ const isChecked = ({
|
|
|
32
23
|
};
|
|
33
24
|
|
|
34
25
|
export const RadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(
|
|
35
|
-
(
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
value,
|
|
39
|
-
variant = "plain",
|
|
40
|
-
hasError: hasErrorProp,
|
|
41
|
-
title,
|
|
42
|
-
children,
|
|
43
|
-
className,
|
|
44
|
-
...rest
|
|
45
|
-
},
|
|
46
|
-
ref,
|
|
47
|
-
) => {
|
|
48
|
-
const {
|
|
49
|
-
value: selectedValue,
|
|
50
|
-
hasError: hasRadioGroupError,
|
|
51
|
-
...context
|
|
52
|
-
} = useRadioGroupContext();
|
|
53
|
-
const { hasError: hasFieldsetError } = useFieldsetContext();
|
|
54
|
-
const hasError = hasFieldsetError || hasRadioGroupError || hasErrorProp;
|
|
26
|
+
({ checked, value, variant = "plain", title, children, className, size = "", ...rest }, ref) => {
|
|
27
|
+
const { value: selectedValue, size: groupSize, ...context } = useRadioGroupContext();
|
|
28
|
+
const effectiveSize = size || groupSize;
|
|
55
29
|
|
|
56
30
|
return (
|
|
57
31
|
<div
|
|
@@ -59,7 +33,7 @@ export const RadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(
|
|
|
59
33
|
"hds-radio-button",
|
|
60
34
|
{
|
|
61
35
|
[`hds-radio-button--${variant}`]: variant === "bounding-box",
|
|
62
|
-
|
|
36
|
+
[`hds-radio-button--${effectiveSize}`]: effectiveSize === "small",
|
|
63
37
|
},
|
|
64
38
|
className as undefined,
|
|
65
39
|
)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { RadioGroup } from "./radio-group";
|
|
4
4
|
import { RadioButton } from "./index";
|
|
5
5
|
|
|
@@ -2,52 +2,53 @@ import {
|
|
|
2
2
|
type ChangeEventHandler,
|
|
3
3
|
createContext,
|
|
4
4
|
forwardRef,
|
|
5
|
+
type InputHTMLAttributes,
|
|
5
6
|
type ReactNode,
|
|
6
7
|
useContext,
|
|
7
8
|
} from "react";
|
|
9
|
+
import { FieldsetDescription } from "../fieldset/fieldset-description";
|
|
8
10
|
import { Fieldset, type FieldsetProps } from "../fieldset";
|
|
9
|
-
import
|
|
11
|
+
import { FieldsetLegend } from "../fieldset/fieldset-legend";
|
|
10
12
|
|
|
11
13
|
export interface RadioGroupProps extends Omit<FieldsetProps, "onChange"> {
|
|
12
14
|
children: ReactNode;
|
|
13
15
|
/** Will be passed to all Radio buttons within the radio group */
|
|
14
|
-
name?:
|
|
16
|
+
name?: InputHTMLAttributes<HTMLInputElement>["name"];
|
|
15
17
|
/** If you want the group to be controlled, you can pass the selected value here */
|
|
16
|
-
value?:
|
|
17
|
-
/**
|
|
18
|
-
* Error message is passed to the internal Fieldset, and will also give contained Radio buttons
|
|
19
|
-
* error styling and aria to indicate invalid state.
|
|
20
|
-
*/
|
|
21
|
-
errorMessage?: ReactNode;
|
|
18
|
+
value?: InputHTMLAttributes<HTMLInputElement>["value"];
|
|
22
19
|
/** Will be passed to all Radio buttons within the radio group */
|
|
23
20
|
onChange?: ChangeEventHandler<HTMLInputElement> | undefined;
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
type RadioGroupContextProps =
|
|
27
|
-
hasError: boolean;
|
|
28
|
-
} & Pick<RadioGroupProps, "name" | "value" | "onChange">;
|
|
23
|
+
type RadioGroupContextProps = Pick<RadioGroupProps, "name" | "value" | "onChange" | "size">;
|
|
29
24
|
|
|
30
25
|
const RadioGroupContext = createContext<RadioGroupContextProps>({
|
|
31
26
|
name: undefined,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return undefined;
|
|
35
|
-
},
|
|
27
|
+
onChange: () => undefined,
|
|
28
|
+
size: undefined,
|
|
36
29
|
});
|
|
37
30
|
|
|
38
31
|
export const useRadioGroupContext = () => useContext(RadioGroupContext);
|
|
39
32
|
|
|
40
33
|
export const RadioGroup = forwardRef<HTMLFieldSetElement, RadioGroupProps>(function RadioGroup(
|
|
41
|
-
{ name, value,
|
|
34
|
+
{ name, value, onChange, children, size, ...rest },
|
|
42
35
|
ref,
|
|
43
36
|
) {
|
|
44
37
|
return (
|
|
45
|
-
<RadioGroupContext.Provider value={{ name, value,
|
|
46
|
-
<Fieldset
|
|
38
|
+
<RadioGroupContext.Provider value={{ name, value, onChange, size }}>
|
|
39
|
+
<Fieldset size={size} {...rest} ref={ref}>
|
|
47
40
|
{children}
|
|
48
41
|
</Fieldset>
|
|
49
42
|
</RadioGroupContext.Provider>
|
|
50
43
|
);
|
|
51
|
-
});
|
|
44
|
+
}) as RadioGroupType;
|
|
45
|
+
|
|
46
|
+
type RadioGroupType = ReturnType<typeof forwardRef<HTMLFieldSetElement, RadioGroupProps>> & {
|
|
47
|
+
Description: typeof FieldsetDescription;
|
|
48
|
+
Legend: typeof FieldsetLegend;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
RadioGroup.Description = FieldsetDescription;
|
|
52
|
+
RadioGroup.Legend = FieldsetLegend;
|
|
52
53
|
|
|
53
54
|
RadioGroup.displayName = "RadioGroup";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import { Input } from "../input";
|
|
4
|
+
import { Button } from "../../button";
|
|
5
|
+
import { SearchWrapper } from ".";
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof SearchWrapper> = {
|
|
8
|
+
title: "Form/Search wrapper",
|
|
9
|
+
component: SearchWrapper,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
function XmarkIcon() {
|
|
15
|
+
return (
|
|
16
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
|
|
17
|
+
<path d="M183.1 137.4C170.6 124.9 150.3 124.9 137.8 137.4C125.3 149.9 125.3 170.2 137.8 182.7L275.2 320L137.9 457.4C125.4 469.9 125.4 490.2 137.9 502.7C150.4 515.2 170.7 515.2 183.2 502.7L320.5 365.3L457.9 502.6C470.4 515.1 490.7 515.1 503.2 502.6C515.7 490.1 515.7 469.8 503.2 457.3L365.8 320L503.1 182.6C515.6 170.1 515.6 149.8 503.1 137.3C490.6 124.8 470.3 124.8 457.8 137.3L320.5 274.7L183.1 137.4z" />
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
type Story = StoryObj<typeof SearchWrapper>;
|
|
22
|
+
|
|
23
|
+
export const Preview: Story = {
|
|
24
|
+
tags: ["!dev"],
|
|
25
|
+
render: () => (
|
|
26
|
+
<SearchWrapper>
|
|
27
|
+
<Input name="name" />
|
|
28
|
+
<Button>Search</Button>
|
|
29
|
+
<Button variant="tertiary" icon>
|
|
30
|
+
<XmarkIcon />
|
|
31
|
+
</Button>
|
|
32
|
+
</SearchWrapper>
|
|
33
|
+
),
|
|
34
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { forwardRef, type HTMLAttributes } from "react";
|
|
2
|
+
import { clsx } from "@postenbring/hedwig-css/typed-classname";
|
|
3
|
+
|
|
4
|
+
export interface SearchWrapperProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const SearchWrapper = forwardRef<HTMLDivElement, SearchWrapperProps>(
|
|
9
|
+
({ className, ...rest }, ref) => (
|
|
10
|
+
<div className={clsx("hds-search-wrapper", className as undefined)} ref={ref} {...rest} />
|
|
11
|
+
),
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
SearchWrapper.displayName = "SearchWrapper";
|
|
@@ -8,26 +8,43 @@ export type SelectProps = Omit<
|
|
|
8
8
|
"readOnly" | "children"
|
|
9
9
|
> & { children: ReactNode };
|
|
10
10
|
|
|
11
|
-
export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
|
12
|
+
(
|
|
13
|
+
{
|
|
14
|
+
className,
|
|
15
|
+
size,
|
|
16
|
+
validationMessage,
|
|
17
|
+
validationMessageProps,
|
|
18
|
+
errorMessage,
|
|
19
|
+
labelProps,
|
|
20
|
+
label,
|
|
21
|
+
id,
|
|
22
|
+
style,
|
|
23
|
+
disabled,
|
|
24
|
+
"data-color": dataColor,
|
|
25
|
+
children,
|
|
26
|
+
...rest
|
|
27
|
+
},
|
|
28
|
+
ref,
|
|
29
|
+
) => (
|
|
16
30
|
<InputGroup
|
|
17
31
|
className={clsx("hds-select", className as undefined)}
|
|
18
32
|
disabled={disabled}
|
|
33
|
+
validationMessage={validationMessage}
|
|
34
|
+
validationMessageProps={validationMessageProps}
|
|
19
35
|
errorMessage={errorMessage}
|
|
20
36
|
id={id}
|
|
21
37
|
label={label}
|
|
22
38
|
labelProps={labelProps}
|
|
23
39
|
style={style}
|
|
24
40
|
size={size}
|
|
41
|
+
data-color={dataColor}
|
|
25
42
|
>
|
|
26
|
-
<select
|
|
43
|
+
<select disabled={disabled} ref={ref} {...rest}>
|
|
27
44
|
{children}
|
|
28
45
|
</select>
|
|
29
46
|
</InputGroup>
|
|
30
|
-
)
|
|
31
|
-
|
|
47
|
+
),
|
|
48
|
+
);
|
|
32
49
|
|
|
33
50
|
Select.displayName = "Select";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Suggestions } from "./suggestions";
|
|
2
|
+
export type * from "./suggestions";
|
|
3
|
+
export { SuggestionsItem, SuggestionsItemAction } from "./suggestions-item";
|
|
4
|
+
export type * from "./suggestions-item";
|
|
5
|
+
export { SuggestionsWrapper } from "./suggestions-wrapper";
|
|
6
|
+
export type * from "./suggestions-wrapper";
|