@stihl-design-system/components 1.0.0-RC.0
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/LICENSE.md +42 -0
- package/README.md +56 -0
- package/apple-icon.png +0 -0
- package/assets/Asterisk.582f2067.css +1 -0
- package/assets/Button.684e8bda.css +1 -0
- package/assets/ButtonRound.ca8748cf.css +1 -0
- package/assets/Checkbox.84cf6398.css +1 -0
- package/assets/CustomReactSelect.d89ccccb.css +1 -0
- package/assets/Fieldset.5297efb8.css +1 -0
- package/assets/FloatingActionButton.de295f5d.css +1 -0
- package/assets/Heading.32278621.css +1 -0
- package/assets/Icon.8890ee9a.css +1 -0
- package/assets/Input.2c508b2f.css +1 -0
- package/assets/InputPassword.a534f047.css +1 -0
- package/assets/InputSearch.8f986307.css +1 -0
- package/assets/InputStepper.52fb45ca.css +1 -0
- package/assets/Link.03deeca0.css +1 -0
- package/assets/LinkStandalone.7e23a8ac.css +1 -0
- package/assets/Logo.09e48e82.css +1 -0
- package/assets/OptionCheckbox.9c20f6f1.css +1 -0
- package/assets/Radio.be8f06f5.css +1 -0
- package/assets/RadioGroup.8b55ee38.css +1 -0
- package/assets/Select.b2423b5f.css +1 -0
- package/assets/Spinner.af45d460.css +1 -0
- package/assets/Switch.f3ab20de.css +1 -0
- package/assets/SystemFeedback.f4421d60.css +1 -0
- package/assets/Text.4756effe.css +1 -0
- package/assets/Textarea.eecf04b3.css +1 -0
- package/assets/Title.60d50d3e.css +1 -0
- package/asterisk.91abccec.js +8 -0
- package/asterisk.d.ts +1 -0
- package/button.89b2675b.js +135 -0
- package/button.d.ts +1 -0
- package/buttonround.c60c8034.js +118 -0
- package/buttonround.d.ts +1 -0
- package/checkbox.7d414047.js +112 -0
- package/checkbox.d.ts +1 -0
- package/checkboxgroup.d.ts +1 -0
- package/checkboxgroup.e9e25471.js +78 -0
- package/chunks/360.3f3132d9.js +11 -0
- package/chunks/CustomReactSelect.9d0a378a.js +5011 -0
- package/chunks/Input.utils.f8f3286f.js +106 -0
- package/chunks/Link.module.b8230547.js +37 -0
- package/chunks/RadioGroup.module.59ca486a.js +11 -0
- package/chunks/academic-cap.a6849ffc.js +11 -0
- package/chunks/alarm-clock.542230f3.js +11 -0
- package/chunks/arrow-clockwise.0496f663.js +11 -0
- package/chunks/arrow-counterclockwise.635a0130.js +11 -0
- package/chunks/arrow-down-line.0976611e.js +11 -0
- package/chunks/arrow-down.9780d975.js +11 -0
- package/chunks/arrow-edge.3288acdd.js +11 -0
- package/chunks/arrow-left.ace9c808.js +11 -0
- package/chunks/arrow-out.0499f39e.js +11 -0
- package/chunks/arrow-outline-left.efc33275.js +11 -0
- package/chunks/arrow-right.133feef2.js +11 -0
- package/chunks/arrow-up-arrow-down.b612e9b1.js +11 -0
- package/chunks/arrow-up.3be6430a.js +11 -0
- package/chunks/at.6279d12b.js +11 -0
- package/chunks/barcode-scanner.0a4a314d.js +11 -0
- package/chunks/battery.e1249ee1.js +11 -0
- package/chunks/bell.87fe4f0b.js +11 -0
- package/chunks/bin-open.be4290d8.js +11 -0
- package/chunks/bin.b36466f3.js +11 -0
- package/chunks/bluetooth.54b89b90.js +11 -0
- package/chunks/bookmark.4d5ce4c3.js +11 -0
- package/chunks/burger.1301d91e.js +11 -0
- package/chunks/calendar.ba39a664.js +11 -0
- package/chunks/camera.3bed4f3b.js +11 -0
- package/chunks/cart-check.9fb6abdb.js +11 -0
- package/chunks/cart-plus.fd5c4674.js +11 -0
- package/chunks/cart.7516d35c.js +11 -0
- package/chunks/catalog.bd0c7830.js +11 -0
- package/chunks/certificate.1639c28e.js +11 -0
- package/chunks/chain-link.45025ed0.js +11 -0
- package/chunks/chainsaw.56d43a9f.js +11 -0
- package/chunks/check.a08beeae.js +11 -0
- package/chunks/chevron-down.80b0dc85.js +11 -0
- package/chunks/chevron-left.f5feade0.js +11 -0
- package/chunks/chevron-line-left.17b172d1.js +11 -0
- package/chunks/chevron-line-right.7cd234b7.js +11 -0
- package/chunks/chevron-right.259bc1a3.js +11 -0
- package/chunks/chevron-up.d1335850.js +11 -0
- package/chunks/circle-check-colored.98e13ab9.js +11 -0
- package/chunks/circle-check-inverted.db29ab06.js +11 -0
- package/chunks/circle-info-colored.8da47e36.js +11 -0
- package/chunks/circle-info-inverted.0ed118fb.js +11 -0
- package/chunks/circle-pause.55300d1b.js +11 -0
- package/chunks/circle-stroke.203dd7aa.js +11 -0
- package/chunks/circle.33ec82eb.js +11 -0
- package/chunks/clock.3014a102.js +11 -0
- package/chunks/coffee-cup.98d6531f.js +11 -0
- package/chunks/compare.c76b221b.js +11 -0
- package/chunks/connected-box-mobile.9cd742dd.js +11 -0
- package/chunks/connected-box-stationary.191a3ed0.js +11 -0
- package/chunks/connected-box.fe21c39b.js +11 -0
- package/chunks/cross.fe709ee7.js +11 -0
- package/chunks/diamond-exclamationmark-colored.bf3ffccf.js +11 -0
- package/chunks/diamond-exclamationmark-inverted.b5648587.js +11 -0
- package/chunks/diamond.e962c289.js +11 -0
- package/chunks/diskette.04733444.js +11 -0
- package/chunks/distance.9e6b56ff.js +11 -0
- package/chunks/dots-connected.9869fae1.js +11 -0
- package/chunks/download-complete.0b84a7cc.js +11 -0
- package/chunks/envelope-open.3c3fd714.js +11 -0
- package/chunks/envelope.5c9ff834.js +11 -0
- package/chunks/exclamationmark.92afe58f.js +11 -0
- package/chunks/exit.bde46887.js +11 -0
- package/chunks/eye-closed.0b517bb7.js +11 -0
- package/chunks/eye.8f4b311b.js +11 -0
- package/chunks/facebook.4a040606.js +11 -0
- package/chunks/filter.dee66683.js +11 -0
- package/chunks/finger-double-arrow.9cd4c623.js +11 -0
- package/chunks/flash.15646b5e.js +11 -0
- package/chunks/fullscreen.fdd976fe.js +11 -0
- package/chunks/gear.1f5f6fe9.js +11 -0
- package/chunks/globe.7f419498.js +11 -0
- package/chunks/grid.2c1cdc21.js +11 -0
- package/chunks/guidance.63bebf3e.js +11 -0
- package/chunks/haircross.0ac15319.js +11 -0
- package/chunks/hanger.edc848f4.js +11 -0
- package/chunks/headphones.a023699e.js +11 -0
- package/chunks/heart.d4440641.js +11 -0
- package/chunks/helpers.ea3ca41a.js +7 -0
- package/chunks/hexagon-arrow-clockwise.98e9b555.js +11 -0
- package/chunks/horizontal-ellipsis.84419429.js +11 -0
- package/chunks/house.70059642.js +11 -0
- package/chunks/imow.3374e620.js +11 -0
- package/chunks/index.8021d3e0.js +45 -0
- package/chunks/info.1787448e.js +11 -0
- package/chunks/instagram.e12dd682.js +11 -0
- package/chunks/jsx-runtime.5c071667.js +632 -0
- package/chunks/leave-fullscreen.def46043.js +11 -0
- package/chunks/lightbulb.b73d3ebf.js +11 -0
- package/chunks/linkedin.ce0c68cb.js +11 -0
- package/chunks/list-three-rows.ef44c7ef.js +11 -0
- package/chunks/list-two-rows.5ed8f1af.js +11 -0
- package/chunks/loading-spinner.8293421e.js +11 -0
- package/chunks/lock.3cbc8ced.js +11 -0
- package/chunks/magnifying-glass-minus.b0f906e5.js +11 -0
- package/chunks/magnifying-glass-plus.6ffc69c5.js +11 -0
- package/chunks/magnifying-glass.c297e41f.js +11 -0
- package/chunks/map.c96b1dcd.js +11 -0
- package/chunks/minus.7f6676e8.js +11 -0
- package/chunks/mobile.416ee5b0.js +11 -0
- package/chunks/nine-squares.34eeb0d4.js +11 -0
- package/chunks/note-check.aaf92ef9.js +11 -0
- package/chunks/note-plus.e7ab1b93.js +11 -0
- package/chunks/note.cc96375c.js +11 -0
- package/chunks/number-input.076fcf63.js +11 -0
- package/chunks/paperclip.e8831256.js +11 -0
- package/chunks/parcel.75534dbd.js +11 -0
- package/chunks/pause.901567cf.js +11 -0
- package/chunks/pdf.92c1781a.js +11 -0
- package/chunks/pen.ecbcb50d.js +11 -0
- package/chunks/percent.4b7fa587.js +11 -0
- package/chunks/petrol.41999bec.js +11 -0
- package/chunks/phone.3c23c041.js +11 -0
- package/chunks/pin-s.a5519070.js +11 -0
- package/chunks/pin.1137362d.js +11 -0
- package/chunks/pinterest.88763b51.js +11 -0
- package/chunks/placeholder.d6fdaf8f.js +11 -0
- package/chunks/play.dd0f1d8c.js +11 -0
- package/chunks/plug.00f114c4.js +11 -0
- package/chunks/plus.42721ebf.js +11 -0
- package/chunks/printer.5bb7ee0d.js +11 -0
- package/chunks/prohibition-sign.af5616b3.js +11 -0
- package/chunks/questionmark.db94a06d.js +11 -0
- package/chunks/security.2be491e3.js +11 -0
- package/chunks/share.ddae7aef.js +11 -0
- package/chunks/shirt.135d58c1.js +11 -0
- package/chunks/shop.f120426b.js +11 -0
- package/chunks/sound-off.c6f5ed43.js +11 -0
- package/chunks/sound-on.212c36bc.js +11 -0
- package/chunks/speechbubble.9428546e.js +11 -0
- package/chunks/speechbubbles.65cb946e.js +11 -0
- package/chunks/square.452f505f.js +11 -0
- package/chunks/star-half.1458bc5b.js +11 -0
- package/chunks/star.fab17456.js +11 -0
- package/chunks/tag.4d730d72.js +11 -0
- package/chunks/thumbs-down.cbf6e4ec.js +11 -0
- package/chunks/thumbs-up.435754e1.js +11 -0
- package/chunks/triangle-exclamationmark-colored.94025893.js +11 -0
- package/chunks/triangle-exclamationmark-inverted.bc4eed15.js +11 -0
- package/chunks/triangle.bff84ddf.js +11 -0
- package/chunks/truck.a904d6d3.js +11 -0
- package/chunks/two-people-screen.3e509922.js +11 -0
- package/chunks/two-sheets.d1cfef0f.js +11 -0
- package/chunks/upload.7f1850a3.js +11 -0
- package/chunks/useBreakpoint.6c1b06c2.js +48 -0
- package/chunks/user.bf5b30a5.js +11 -0
- package/chunks/vertical-ellipsis.1cac00e5.js +11 -0
- package/chunks/wc.9d108bd0.js +11 -0
- package/chunks/wifi-1bar.b6fc33aa.js +11 -0
- package/chunks/wifi-2bars.27e9da59.js +11 -0
- package/chunks/wifi-off.e5daf3a9.js +11 -0
- package/chunks/wifi.40bb915d.js +11 -0
- package/chunks/wind-rose.27fa658a.js +11 -0
- package/chunks/wrench.69493ef3.js +11 -0
- package/chunks/x.d9da4202.js +11 -0
- package/chunks/xing.e17c1a24.js +11 -0
- package/chunks/youtube.dbf50787.js +11 -0
- package/combobox.d.ts +1 -0
- package/combobox.f98a4472.js +45 -0
- package/components/Asterisk/Asterisk.d.ts +2 -0
- package/components/Button/Button.d.ts +45 -0
- package/components/Button/Button.test.d.ts +1 -0
- package/components/Button/Button.utils.d.ts +6 -0
- package/components/ButtonRound/ButtonRound.d.ts +11 -0
- package/components/ButtonRound/ButtonRound.test.d.ts +1 -0
- package/components/ButtonRound/ButtonRound.utils.d.ts +2 -0
- package/components/Checkbox/Checkbox.d.ts +26 -0
- package/components/Checkbox/Checkbox.test.d.ts +1 -0
- package/components/CheckboxGroup/CheckboxGroup.d.ts +41 -0
- package/components/CheckboxGroup/CheckboxGroup.test.d.ts +1 -0
- package/components/CheckboxGroup/CheckboxGroup.utils.d.ts +4 -0
- package/components/Combobox/Combobox.d.ts +18 -0
- package/components/Combobox/Combobox.test.d.ts +1 -0
- package/components/Combobox/Combobox.utils.d.ts +57 -0
- package/components/Combobox/Combobox.utils.test.d.ts +1 -0
- package/components/CustomReactSelect/CustomReactSelect.d.ts +60 -0
- package/components/CustomReactSelect/CustomReactSelect.utils.d.ts +15 -0
- package/components/CustomReactSelect/CustomReactSelect.utils.test.d.ts +1 -0
- package/components/CustomReactSelect/OptionCheckbox.d.ts +13 -0
- package/components/Fieldset/Fieldset.d.ts +35 -0
- package/components/Fieldset/Fieldset.test.d.ts +1 -0
- package/components/Fieldset/Fieldset.utils.d.ts +10 -0
- package/components/FloatingActionButton/FloatingActionButton.d.ts +13 -0
- package/components/FloatingActionButton/FloatingActionButton.test.d.ts +1 -0
- package/components/Heading/Heading.d.ts +18 -0
- package/components/Heading/Heading.test.d.ts +1 -0
- package/components/Heading/Heading.utils.d.ts +4 -0
- package/components/Icon/Icon.d.ts +23 -0
- package/components/Icon/Icon.test.d.ts +1 -0
- package/components/Icon/Icon.utils.d.ts +12 -0
- package/components/Input/Input.d.ts +54 -0
- package/components/Input/Input.test.d.ts +1 -0
- package/components/Input/Input.utils.d.ts +59 -0
- package/components/Input/Input.utils.test.d.ts +1 -0
- package/components/InputPassword/InputPassword.d.ts +41 -0
- package/components/InputPassword/InputPassword.test.d.ts +1 -0
- package/components/InputPassword/InputPassword.utils.d.ts +12 -0
- package/components/InputPassword/InputPassword.utils.test.d.ts +1 -0
- package/components/InputSearch/InputSearch.d.ts +44 -0
- package/components/InputSearch/InputSearch.test.d.ts +1 -0
- package/components/InputSearch/InputSearch.utils.d.ts +23 -0
- package/components/InputSearch/InputSearch.utils.test.d.ts +1 -0
- package/components/InputStepper/InputStepper.d.ts +52 -0
- package/components/InputStepper/InputStepper.test.d.ts +1 -0
- package/components/InputStepper/InputStepper.utils.d.ts +12 -0
- package/components/InputStepper/InputStepper.utils.test.d.ts +1 -0
- package/components/Link/Link.d.ts +50 -0
- package/components/Link/Link.test.d.ts +1 -0
- package/components/Link/Link.utils.d.ts +8 -0
- package/components/LinkStandalone/LinkStandalone.d.ts +15 -0
- package/components/LinkStandalone/LinkStandalone.test.d.ts +1 -0
- package/components/LinkStandalone/LinkStandalone.utils.d.ts +2 -0
- package/components/Logo/Logo.d.ts +21 -0
- package/components/Logo/Logo.utils.d.ts +3 -0
- package/components/Radio/Radio.d.ts +27 -0
- package/components/Radio/Radio.test.d.ts +1 -0
- package/components/RadioGroup/RadioGroup.d.ts +56 -0
- package/components/RadioGroup/RadioGroup.test.d.ts +1 -0
- package/components/RadioGroup/RadioGroup.utils.d.ts +6 -0
- package/components/Select/Select.d.ts +43 -0
- package/components/Select/Select.test.d.ts +1 -0
- package/components/Select/Select.utils.d.ts +35 -0
- package/components/Select/Select.utils.test.d.ts +1 -0
- package/components/Spinner/Spinner.d.ts +14 -0
- package/components/Spinner/Spinner.test.d.ts +1 -0
- package/components/Spinner/Spinner.utils.d.ts +3 -0
- package/components/Switch/Switch.d.ts +29 -0
- package/components/Switch/Switch.test.d.ts +1 -0
- package/components/Switch/Switch.utils.d.ts +2 -0
- package/components/SystemFeedback/SystemFeedback.d.ts +9 -0
- package/components/SystemFeedback/SystemFeedback.test.d.ts +1 -0
- package/components/SystemFeedback/SystemFeedback.utils.d.ts +8 -0
- package/components/Text/Text.d.ts +21 -0
- package/components/Text/Text.test.d.ts +1 -0
- package/components/Text/Text.utils.d.ts +6 -0
- package/components/Textarea/Textarea.d.ts +42 -0
- package/components/Textarea/Textarea.test.d.ts +1 -0
- package/components/Textarea/Textarea.utils.d.ts +13 -0
- package/components/Textarea/Textarea.utils.test.d.ts +1 -0
- package/components/Title/Title.d.ts +20 -0
- package/components/Title/Title.test.d.ts +1 -0
- package/components/Title/Title.utils.d.ts +3 -0
- package/customreactselect.a53f9932.js +13 -0
- package/customreactselect.d.ts +1 -0
- package/favicon.ico +0 -0
- package/fieldset.d.ts +1 -0
- package/fieldset.fb7b7e49.js +98 -0
- package/floatingactionbutton.281b5465.js +87 -0
- package/floatingactionbutton.d.ts +1 -0
- package/heading.cb7698f4.js +44 -0
- package/heading.d.ts +1 -0
- package/icon-192.png +0 -0
- package/icon-512.png +0 -0
- package/icon.b4211784.js +215 -0
- package/icon.d.ts +1 -0
- package/icon.svg +1 -0
- package/index.d.ts +23 -0
- package/index.es.js +49 -0
- package/input.abb902e3.js +228 -0
- package/input.d.ts +1 -0
- package/inputpassword.11c12c66.js +139 -0
- package/inputpassword.d.ts +1 -0
- package/inputsearch.0c88e71a.js +188 -0
- package/inputsearch.d.ts +1 -0
- package/inputstepper.b74dac4d.js +284 -0
- package/inputstepper.d.ts +1 -0
- package/link.cd3720d1.js +84 -0
- package/link.d.ts +1 -0
- package/linkstandalone.26b52de0.js +80 -0
- package/linkstandalone.d.ts +1 -0
- package/logo.d.ts +1 -0
- package/logo.e6576fe3.js +68 -0
- package/manifest.json +6 -0
- package/manifest.webmanifest +6 -0
- package/optioncheckbox.7195f001.js +43 -0
- package/optioncheckbox.d.ts +1 -0
- package/package.json +125 -0
- package/partials/apple-icon.png +0 -0
- package/partials/copyAssets.js +84 -0
- package/partials/favicon.ico +0 -0
- package/partials/icon-192.png +0 -0
- package/partials/icon-512.png +0 -0
- package/partials/icon.svg +1 -0
- package/partials/index.d.ts +2 -0
- package/partials/index.js +2167 -0
- package/partials/lib/partials.d.ts +17 -0
- package/partials/manifest.json +6 -0
- package/partials/manifest.webmanifest +6 -0
- package/partials/shared.d.ts +2 -0
- package/radio.1b205d64.js +79 -0
- package/radio.d.ts +1 -0
- package/radiogroup.6a22fe96.js +100 -0
- package/radiogroup.d.ts +1 -0
- package/react.svg +1 -0
- package/select.2ff31eab.js +188 -0
- package/select.d.ts +1 -0
- package/spinner.d.ts +1 -0
- package/spinner.ee015469.js +58 -0
- package/styles/fonts/STIHLContrafaceDisplayTitling.woff +0 -0
- package/styles/fonts/STIHLContrafaceDisplayTitling.woff2 +0 -0
- package/styles/fonts/STIHLContrafaceText-Bold.woff +0 -0
- package/styles/fonts/STIHLContrafaceText-Bold.woff2 +0 -0
- package/styles/fonts/STIHLContrafaceText.woff +0 -0
- package/styles/fonts/STIHLContrafaceText.woff2 +0 -0
- package/styles/fonts/font-face.min.css +1 -0
- package/styles/fonts/index.es.js +1 -0
- package/styles/scss/_index.scss +21 -0
- package/styles/scss/lib/_a11y.scss +15 -0
- package/styles/scss/lib/_animation.scss +6 -0
- package/styles/scss/lib/_breakpoints.scss +16 -0
- package/styles/scss/lib/_container-query.scss +58 -0
- package/styles/scss/lib/_focus.scss +61 -0
- package/styles/scss/lib/_grid-extended.scss +11 -0
- package/styles/scss/lib/_grid-full.scss +6 -0
- package/styles/scss/lib/_grid-main.scss +117 -0
- package/styles/scss/lib/_grid-narrow.scss +14 -0
- package/styles/scss/lib/_grid-sidebar-sidebar.scss +48 -0
- package/styles/scss/lib/_grid-sidebar.scss +174 -0
- package/styles/scss/lib/_grid.scss +86 -0
- package/styles/scss/lib/_heading.scss +45 -0
- package/styles/scss/lib/_helpers.scss +3 -0
- package/styles/scss/lib/_hover.scss +10 -0
- package/styles/scss/lib/_link.scss +155 -0
- package/styles/scss/lib/_media-query.scss +32 -0
- package/styles/scss/lib/_spacing.scss +18 -0
- package/styles/scss/lib/_text.scss +63 -0
- package/styles/scss/lib/_theme.scss +160 -0
- package/styles/scss/lib/_transition.scss +26 -0
- package/switch.2f011fcc.js +65 -0
- package/switch.d.ts +1 -0
- package/systemfeedback.6bbd1505.js +25 -0
- package/systemfeedback.d.ts +1 -0
- package/text.8d80704f.js +57 -0
- package/text.d.ts +1 -0
- package/textarea.d.ts +1 -0
- package/textarea.e156b0ce.js +189 -0
- package/title.d.ts +1 -0
- package/title.d855a8e4.js +36 -0
- package/types/aria-types.d.ts +330 -0
- package/types/common-types.d.ts +13 -0
- package/types/icon-types.d.ts +2 -0
- package/types/index.d.ts +3 -0
- package/utils/breakpoint-customizable.d.ts +12 -0
- package/utils/has-document.d.ts +1 -0
- package/utils/has-window.d.ts +1 -0
- package/utils/helpers.d.ts +27 -0
- package/utils/helpers.test.d.ts +1 -0
- package/utils/index.d.ts +4 -0
- package/utils/link-target.d.ts +2 -0
- package/utils/render-documentation.d.ts +26 -0
- package/utils/theme.d.ts +2 -0
- package/utils/useBreakpoint.d.ts +12 -0
- package/utils/useBreakpoint.test.d.ts +1 -0
- package/utils/vitest.setup.d.ts +0 -0
- package/utils/wait-for-icon.d.ts +25 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { IconName } from '../../types';
|
|
2
|
+
import type { ComboboxProps } from './Combobox';
|
|
3
|
+
import type { GroupBase, OptionsOrGroups } from 'react-select';
|
|
4
|
+
export type ComboboxVariant = 'single' | 'multi';
|
|
5
|
+
type ValidationProps = Pick<ComboboxProps, 'id' | 'label' | 'options'>;
|
|
6
|
+
/**
|
|
7
|
+
* Validates the given properties of the DSCombobox component for common configuration errors.
|
|
8
|
+
* This function is intended to be used in development mode to provide developers with
|
|
9
|
+
* warnings about potential misuse of the component.
|
|
10
|
+
*
|
|
11
|
+
* @param validationProps - The subset of DSCombobox properties to validate. This includes
|
|
12
|
+
* id and label.
|
|
13
|
+
*/
|
|
14
|
+
export declare const validateComboboxProps: ({ id, label, options, }: ValidationProps) => void;
|
|
15
|
+
export declare const COMBOBOX_SIZE: readonly ["medium", "small"];
|
|
16
|
+
export type ComboboxSize = (typeof COMBOBOX_SIZE)[number];
|
|
17
|
+
export interface ComboboxOption {
|
|
18
|
+
label: string;
|
|
19
|
+
value: string | number;
|
|
20
|
+
leadingIconName?: IconName;
|
|
21
|
+
isDisabled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type ComboboxOptionsGroup = GroupBase<ComboboxOption>;
|
|
24
|
+
export type ComboboxOptionsOrOptGroups = OptionsOrGroups<ComboboxOption, ComboboxOptionsGroup>;
|
|
25
|
+
export type ComboboxLanguage = 'de' | 'en';
|
|
26
|
+
export type ComboboxAriaTranslations = typeof DS_COMBOBOX_TRANSLATIONS_EN;
|
|
27
|
+
export declare const DS_COMBOBOX_TRANSLATIONS_EN: {
|
|
28
|
+
placeholder: string;
|
|
29
|
+
navigationGuidance: string;
|
|
30
|
+
selectGuidance: string;
|
|
31
|
+
exitGuidance: string;
|
|
32
|
+
tabGuidance: string;
|
|
33
|
+
searchGuidance: string;
|
|
34
|
+
inputGuidance: string;
|
|
35
|
+
selectOptionDisabled: string;
|
|
36
|
+
focusValue: string;
|
|
37
|
+
of: string;
|
|
38
|
+
disabled: string;
|
|
39
|
+
selected: string;
|
|
40
|
+
deselected: string;
|
|
41
|
+
focusSelectedMultiGuidance: string;
|
|
42
|
+
valueGuidance: string;
|
|
43
|
+
deleteGuidance: string;
|
|
44
|
+
clearAllOptions: string;
|
|
45
|
+
filterTermHint: string;
|
|
46
|
+
filterNoOptions: string;
|
|
47
|
+
option_one: string;
|
|
48
|
+
option_other: string;
|
|
49
|
+
result_one: string;
|
|
50
|
+
result_other: string;
|
|
51
|
+
resultsAvailable: string;
|
|
52
|
+
};
|
|
53
|
+
export declare const DS_COMBOBOX_TRANSLATIONS_DE: ComboboxAriaTranslations;
|
|
54
|
+
export declare const DS_COMBOBOX_TRANSLATIONS: {
|
|
55
|
+
[key in ComboboxLanguage]: ComboboxAriaTranslations;
|
|
56
|
+
};
|
|
57
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type GroupBase } from 'react-select';
|
|
3
|
+
import type { BreakpointCustomizable, Optional } from '../../types';
|
|
4
|
+
import { type ComboboxAriaTranslations, type ComboboxLanguage, type ComboboxOption, type ComboboxOptionsGroup, type ComboboxOptionsOrOptGroups, type ComboboxSize } from '../Combobox/Combobox.utils';
|
|
5
|
+
import type { PublicBaseSelectProps } from 'react-select/dist/declarations/src/Select';
|
|
6
|
+
import type { StateManagerProps } from 'react-select/dist/declarations/src/useStateManager';
|
|
7
|
+
type IncludedReactSelectKeys = 'className' | 'form' | 'inputValue' | 'menuIsOpen' | 'name' | 'onBlur' | 'onFocus' | 'openMenuOnClick' | 'openMenuOnFocus' | 'tabIndex';
|
|
8
|
+
type PickedReactSelectProps<OptionType, IsMulti extends boolean, GroupType extends GroupBase<OptionType>> = Pick<Optional<PublicBaseSelectProps<OptionType, IsMulti, GroupType>, 'inputValue'>, IncludedReactSelectKeys>;
|
|
9
|
+
type PickedReactSelectStateManagerProps<OptionType, IsMulti extends boolean, GroupType extends GroupBase<OptionType>> = Pick<StateManagerProps<OptionType, IsMulti, GroupType>, 'defaultInputValue'>;
|
|
10
|
+
export interface CustomReactSelectProps<IsMulti extends boolean> extends PickedReactSelectProps<ComboboxOption, IsMulti, ComboboxOptionsGroup>, PickedReactSelectStateManagerProps<ComboboxOption, IsMulti, ComboboxOptionsGroup> {
|
|
11
|
+
/** Unique id for the DSCombobox */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Label text displayed above the DSCombobox */
|
|
14
|
+
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* Defines the options, can be a mixed array of options and option groups
|
|
17
|
+
* `type ComboboxOption = {label: string; value: string | number; leadingIconName?: IconName; isDisabled?: boolean;}`
|
|
18
|
+
* `type ComboboxOptionsGroup = {label: string; options: ComboboxOption[];}`
|
|
19
|
+
* `type ComboboxOptionsOrOptGroups = (ComboboxOption | ComboboxOptionsGroup)[];`
|
|
20
|
+
* */
|
|
21
|
+
options: ComboboxOptionsOrOptGroups;
|
|
22
|
+
/** The value of autocomplete to use for the DSCombobox */
|
|
23
|
+
autoComplete?: string;
|
|
24
|
+
/** Value of the selected Option in **uncontrolled DSCombobox** component */
|
|
25
|
+
defaultValue?: IsMulti extends true ? ComboboxOption[] : ComboboxOption;
|
|
26
|
+
/** Disables the DSCombobox, preventing user interaction */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** Hides the DSCombobox label, can be responsive
|
|
29
|
+
* `boolean | { base: boolean; s?: boolean; m?: boolean; l?: boolean; xl?: boolean; }`
|
|
30
|
+
*/
|
|
31
|
+
hideLabel?: BreakpointCustomizable<boolean>;
|
|
32
|
+
/** Short descriptive text displayed beneath the label */
|
|
33
|
+
hint?: string;
|
|
34
|
+
/** Marks the DSCombobox as invalid, typically used for form validation */
|
|
35
|
+
invalid?: boolean;
|
|
36
|
+
/** Allows selection of multiple options */
|
|
37
|
+
isMulti: boolean;
|
|
38
|
+
/** Sets language to use for the screen reader messages and "No Options found" message, if no translations object is provided */
|
|
39
|
+
lang?: ComboboxLanguage;
|
|
40
|
+
/** Indicates that the DSCombobox is required */
|
|
41
|
+
required?: boolean;
|
|
42
|
+
/** Size of the input */
|
|
43
|
+
size?: ComboboxSize;
|
|
44
|
+
/** Defines a system feedback message, shown when `invalid={true}` */
|
|
45
|
+
systemFeedback?: string;
|
|
46
|
+
/** Translations for the DSCombobox. Use our [customization page](/?path=/story/components-combobox-translations--documentation) for creating custom translations. */
|
|
47
|
+
translations?: ComboboxAriaTranslations;
|
|
48
|
+
/** Value of the DSCombobox */
|
|
49
|
+
value?: IsMulti extends true ? ComboboxOption[] : ComboboxOption;
|
|
50
|
+
/** Callback function triggered when the selection of the DSCombobox changes */
|
|
51
|
+
onChange?: (newValue: IsMulti extends true ? ComboboxOption[] : ComboboxOption) => void;
|
|
52
|
+
/** Callback function triggered when the value of the DSCombobox input changes */
|
|
53
|
+
onInputChange?: (newValue: string) => void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Internal customized react select component, which is in parts exposed to our consumers
|
|
57
|
+
* via the DSCombobox component
|
|
58
|
+
* */
|
|
59
|
+
export declare const CustomReactSelect: <IsMulti extends boolean>({ id, label, options, className, disabled, hint, hideLabel, invalid, isMulti, lang, required, size, systemFeedback, translations, value, onChange, onInputChange, ...rest }: CustomReactSelectProps<IsMulti>) => JSX.Element;
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AriaLiveMessages, GroupBase } from 'react-select';
|
|
2
|
+
import type { ComboboxAriaTranslations } from '../Combobox/Combobox.utils';
|
|
3
|
+
type ComboboxAriaTranslationKey = keyof ComboboxAriaTranslations;
|
|
4
|
+
/**
|
|
5
|
+
* Translates a given key using specified translations and dynamic replacements of placeholders like {0} or {1}.
|
|
6
|
+
* Unmatched placeholders in the translation are removed.
|
|
7
|
+
*
|
|
8
|
+
* @param {ComboboxAriaTranslationKey} key - The key identifying the text to be translated.
|
|
9
|
+
* @param {ComboboxAriaTranslations} translations - Object containing translation mappings.
|
|
10
|
+
* @param {string[]} [replacements=[]] - Optional array of replacement strings for placeholders in the translation.
|
|
11
|
+
* @returns {string} The translated string with placeholders replaced by corresponding values in replacements array or removed if no match is found.
|
|
12
|
+
*/
|
|
13
|
+
export declare const translate: (key: ComboboxAriaTranslationKey, translations: ComboboxAriaTranslations, replacements?: string[]) => string;
|
|
14
|
+
export declare const defaultAriaLiveMessages: (translations: ComboboxAriaTranslations) => AriaLiveMessages<unknown, boolean, GroupBase<unknown>>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export interface CheckboxProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Content displayed next to the checkbox */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Controls whether the checkbox is checked. */
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
/** Disables the checkbox, preventing user interaction */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A simplified visual representation of a checkbox.
|
|
12
|
+
*/
|
|
13
|
+
export declare const OptionCheckbox: ({ label, checked, className, disabled, }: CheckboxProps) => JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type FieldsetHTMLAttributes } from 'react';
|
|
2
|
+
import { type Legend } from './Fieldset.utils';
|
|
3
|
+
export interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
4
|
+
/** Child elements within the fieldset */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* The `legend` prop can either be a simple `string` or an object with specific properties.
|
|
8
|
+
* When provided as a string, it represents the legend text directly.
|
|
9
|
+
* When provided as an object, it allows for more detailed configuration, including:
|
|
10
|
+
* - `headingText: string` The text content for the legend.
|
|
11
|
+
* - `headingSize?: 'x-large' | 'large' | 'medium' | 'medium-uppercase' | 'small' | 'small-uppercase'` Defines the size of the heading, using predefined size types, defaults to `'medium'`
|
|
12
|
+
* - `headingTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'` Specifies the HTML tag to be used for the heading, such as 'h1', 'h2', etc., defaults to `'h2'`
|
|
13
|
+
*
|
|
14
|
+
* @prop {string | { headingText: string; headingSize?: HeadingSize; headingTag?: HeadingTag; }} legend
|
|
15
|
+
*/
|
|
16
|
+
legend: Legend;
|
|
17
|
+
/** Short descriptive text displayed beneath the legend */
|
|
18
|
+
description?: string | React.ReactNode;
|
|
19
|
+
/** Disables the fieldset, preventing user interaction */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Unique id for the fieldset, needs to be set for proper accessibility functionality, if `description` or `systemFeedback` are set */
|
|
22
|
+
id?: string;
|
|
23
|
+
/** Marks the fieldset as invalid, typically used for form validation */
|
|
24
|
+
invalid?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Undocumented property for visually setting the Asterisk
|
|
27
|
+
*/
|
|
28
|
+
required?: boolean;
|
|
29
|
+
/** Defines a system feedback message, shown when `invalid={true}` */
|
|
30
|
+
systemFeedback?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The `DSFieldset` component is a versatile and accessible way to group related elements and labels in your forms.
|
|
34
|
+
* */
|
|
35
|
+
export declare const DSFieldset: ({ children, legend, className, description, disabled, id, invalid, required, systemFeedback, ...rest }: FieldsetProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HeadingSize, HeadingTag } from '../Heading/Heading.utils';
|
|
2
|
+
import type { FieldsetProps } from './Fieldset';
|
|
3
|
+
export type Legend = string | {
|
|
4
|
+
headingText: string;
|
|
5
|
+
headingSize?: HeadingSize;
|
|
6
|
+
headingTag?: HeadingTag;
|
|
7
|
+
};
|
|
8
|
+
type ValidationProps = Pick<FieldsetProps, 'description' | 'id' | 'legend' | 'systemFeedback'>;
|
|
9
|
+
export declare const validateProps: ({ description, id, legend, systemFeedback, }: ValidationProps) => void;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ButtonProps } from '../Button/Button';
|
|
3
|
+
export interface FloatingActionButtonProps extends Omit<ButtonProps, 'hideLabel' | 'iconPosition' | 'variant' | 'isFlush'> {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* FABs are used to highlight actions by laying over the content.
|
|
8
|
+
*
|
|
9
|
+
* Sizes:
|
|
10
|
+
* - medium (e.g. back-to-top)
|
|
11
|
+
* - small (e.g. menu drawer of the sidebar navigation)
|
|
12
|
+
* */
|
|
13
|
+
export declare const DSFloatingActionButton: ({ aria, children, className, dataTrackingid, disabled, iconName, iconSource, loading, size, theme, onClick, ...rest }: FloatingActionButtonProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { Theme } from '../../types';
|
|
3
|
+
import type { HeadingSize, HeadingTag } from './Heading.utils';
|
|
4
|
+
export interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
5
|
+
/** Content within the heading */
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/** Size of the heading */
|
|
8
|
+
size?: HeadingSize;
|
|
9
|
+
/** Specifies the HTML tag to be used for the heading */
|
|
10
|
+
tag?: HeadingTag;
|
|
11
|
+
/** Defines the theme */
|
|
12
|
+
theme?: Theme;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The `DSHeading` component is used to specify heading styling and hierarchy in documents.
|
|
16
|
+
* It allows for consistent heading styles across different parts of your application.
|
|
17
|
+
* */
|
|
18
|
+
export declare const DSHeading: ({ children, className, size, tag, theme, ...rest }: HeadingProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const HEADING_SIZE: readonly ["x-large", "large", "medium", "medium-uppercase", "small", "small-uppercase"];
|
|
2
|
+
export type HeadingSize = typeof HEADING_SIZE[number];
|
|
3
|
+
export declare const HEADING_TAG: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
4
|
+
export type HeadingTag = typeof HEADING_TAG[number];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type HTMLProps, type SVGProps } from 'react';
|
|
2
|
+
import type { IconName, SelectedAriaAttributes, Theme } from '../../types';
|
|
3
|
+
import { type IconAriaAttribute, type IconSize } from './Icon.utils';
|
|
4
|
+
export interface IconProps {
|
|
5
|
+
/** ARIA attributes to enhance accessibility
|
|
6
|
+
* `{'aria-label'? string;}`
|
|
7
|
+
*/
|
|
8
|
+
aria?: SelectedAriaAttributes<IconAriaAttribute>;
|
|
9
|
+
/** Name of the icon to display */
|
|
10
|
+
name?: IconName;
|
|
11
|
+
/** Size of the icon */
|
|
12
|
+
size?: IconSize;
|
|
13
|
+
/** URL or path for a custom icon */
|
|
14
|
+
source?: string;
|
|
15
|
+
/** Defines the theme */
|
|
16
|
+
theme?: Theme;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The STIHL Iconography ranges from content and feature icons to product or system icons.
|
|
20
|
+
* The STIHL Design System is using an SVG icon system to visually present an icon object.
|
|
21
|
+
* Icons are provided as assets and can be bundled into the application.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DSIcon: ({ aria, className, name, size, source, theme, ...rest }: IconProps & (HTMLProps<HTMLImageElement> | SVGProps<SVGSVGElement>)) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { IconName } from '../../types';
|
|
3
|
+
export type IconAriaAttribute = 'aria-label';
|
|
4
|
+
export declare const ICON_SIZE: readonly ["large", "medium", "small", "x-small"];
|
|
5
|
+
export type IconSize = (typeof ICON_SIZE)[number];
|
|
6
|
+
export declare const useDynamicSvgImport: (iconName: IconName) => {
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
SVGIcon: import("react").FunctionComponent<import("react").SVGProps<SVGSVGElement> & {
|
|
9
|
+
title?: string | undefined;
|
|
10
|
+
}> | undefined;
|
|
11
|
+
setShouldLoad: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type InputHTMLAttributes } from 'react';
|
|
2
|
+
import type { BreakpointCustomizable, IconName } from '../../types';
|
|
3
|
+
import { type IconProps } from '../Icon/Icon';
|
|
4
|
+
import { type InputSize, type SupportedInputTypes } from './Input.utils';
|
|
5
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
6
|
+
/** Unique id for the input */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Label text displayed above the input */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Accessibility label for the action button or icon */
|
|
11
|
+
actionButtonLabel?: string;
|
|
12
|
+
/** Name of the icon used in the action button */
|
|
13
|
+
actionButtonIconName?: IconName;
|
|
14
|
+
/** Custom source URL for the action button icon */
|
|
15
|
+
actionButtonIconSource?: IconProps['source'];
|
|
16
|
+
/** Callback function triggered when the action button is clicked */
|
|
17
|
+
actionButtonOnClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
18
|
+
/** Disables the input, preventing user interaction */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Hides the input label, can be responsive
|
|
21
|
+
* `boolean | { base: boolean; s?: boolean; m?: boolean; l?: boolean; xl?: boolean; }`
|
|
22
|
+
*/
|
|
23
|
+
hideLabel?: BreakpointCustomizable<boolean>;
|
|
24
|
+
/** Short descriptive text displayed beneath the label */
|
|
25
|
+
hint?: string;
|
|
26
|
+
/** Name of the leading icon */
|
|
27
|
+
leadingIconName?: IconName;
|
|
28
|
+
/** URL or path for a custom leading icon */
|
|
29
|
+
leadingIconSource?: IconProps['source'];
|
|
30
|
+
/** Marks the input as invalid, typically used for form validation */
|
|
31
|
+
invalid?: boolean;
|
|
32
|
+
/** Text displayed as a prefix inside the input, maximum 8 characters */
|
|
33
|
+
prefix?: string;
|
|
34
|
+
/** Enables the readonly state of the input */
|
|
35
|
+
readonly?: boolean;
|
|
36
|
+
/** Indicates that the input is required */
|
|
37
|
+
required?: boolean;
|
|
38
|
+
/** Text displayed as a suffix inside the input, maximum 5 characters */
|
|
39
|
+
suffix?: string;
|
|
40
|
+
/** Defines a system feedback message, shown when `invalid={true}` */
|
|
41
|
+
systemFeedback?: string;
|
|
42
|
+
/** Size of the input */
|
|
43
|
+
size?: InputSize;
|
|
44
|
+
/** Type of the input */
|
|
45
|
+
type?: SupportedInputTypes;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The `<DSInput />` component is a versatile input field that allows users to enter and edit text.
|
|
49
|
+
* It comes in two sizes (medium & small) and supports various customizations including an action button,
|
|
50
|
+
* a leading icon, prefix and suffix.
|
|
51
|
+
*
|
|
52
|
+
* Depending on the `type` prop it expects different input types.
|
|
53
|
+
*/
|
|
54
|
+
export declare const DSInput: ({ id, label, actionButtonLabel, actionButtonIconName, actionButtonIconSource, actionButtonOnClick, className, disabled, hint, hideLabel, invalid, leadingIconName, leadingIconSource, prefix, readonly, required, size, suffix, systemFeedback, type, ...rest }: InputProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { InputProps } from './Input';
|
|
2
|
+
export declare const MAX_PREFIX_LENGTH = 8;
|
|
3
|
+
export declare const MAX_SUFFIX_LENGTH = 5;
|
|
4
|
+
export declare const INPUT_SIZE: readonly ["medium", "small"];
|
|
5
|
+
export type InputSize = (typeof INPUT_SIZE)[number];
|
|
6
|
+
export declare const SUPPORTED_INPUT_TYPES: readonly ["color", "date", "datetime-local", "email", "file", "month", "number", "range", "tel", "text", "time", "url"];
|
|
7
|
+
export type SupportedInputTypes = (typeof SUPPORTED_INPUT_TYPES)[number];
|
|
8
|
+
export declare const UNSUPPORTED_INPUT_TYPES: readonly ["week", "hidden", "button", "checkbox", "password", "radio", "search", "reset", "submit", "image", "datetime"];
|
|
9
|
+
export type UnSupportedInputTypes = (typeof UNSUPPORTED_INPUT_TYPES)[number];
|
|
10
|
+
type ValidationProps = Pick<InputProps, 'id' | 'label' | 'prefix' | 'suffix' | 'leadingIconName' | 'leadingIconSource' | 'actionButtonIconName' | 'actionButtonIconSource'>;
|
|
11
|
+
/**
|
|
12
|
+
* Validates the given properties of the DSInput component for common configuration errors.
|
|
13
|
+
* This function is intended to be used in development mode to provide developers with
|
|
14
|
+
* warnings about potential misuse of the component.
|
|
15
|
+
*
|
|
16
|
+
* @param validationProps - The subset of DSInput properties to validate. This includes
|
|
17
|
+
* properties related to the prefix, suffix, icons and action button of the input.
|
|
18
|
+
*/
|
|
19
|
+
export declare const validateInputProps: ({ id, label, prefix, suffix, leadingIconName, leadingIconSource, actionButtonIconName, actionButtonIconSource, }: ValidationProps) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Validates the input type for the DSInput component and provides warnings for certain unsupported types.
|
|
22
|
+
*
|
|
23
|
+
* @param {SupportedInputTypes} type - The input type to validate.
|
|
24
|
+
* @throws {Error} Throws an error if the input type is not supported by the DSInput component.
|
|
25
|
+
*/
|
|
26
|
+
export declare const validateType: (type: SupportedInputTypes | UnSupportedInputTypes) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Checks if the current browser supports the 'showPicker' attribute for date/time input fields
|
|
29
|
+
* and is a compatible browser (Chrome, Chromium, Chrome on iOS, or Microsoft Edge).
|
|
30
|
+
*
|
|
31
|
+
* @returns {boolean} Returns `true` if 'showPicker' is supported in the current browser; otherwise, `false`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const hasShowPickerSupport: () => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Determines whether to show a custom calendar or time indicator based on browser support and specified flags.
|
|
36
|
+
*
|
|
37
|
+
* @param {boolean} isCalendar - Indicates whether to show the calendar.
|
|
38
|
+
* @param {boolean} isTime - Indicates whether to show the time indicator.
|
|
39
|
+
* @returns {boolean} Returns `true` if the browser supports the 'showPicker' attribute and
|
|
40
|
+
* either 'isCalendar' or 'isTime' is `true`, otherwise returns `false`.
|
|
41
|
+
*/
|
|
42
|
+
export declare const showCustomCalendarOrTimeIndicator: (isCalendar: boolean, isTime: boolean) => boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Checks if the given input type is related to date or calendar input.
|
|
45
|
+
*
|
|
46
|
+
* @param {SupportedInputTypes} type - The input type to check.
|
|
47
|
+
* @returns {boolean} Returns `true` if the input type is related to date or calendar input;
|
|
48
|
+
* otherwise, returns `false`.
|
|
49
|
+
*/
|
|
50
|
+
export declare const isCalendarInput: (type: SupportedInputTypes) => boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Checks if the given input type is related to time input.
|
|
53
|
+
*
|
|
54
|
+
* @param {SupportedInputTypes} type - The input type to check.
|
|
55
|
+
* @returns {boolean} Returns `true` if the input type is 'time';
|
|
56
|
+
* otherwise, returns `false`.
|
|
57
|
+
*/
|
|
58
|
+
export declare const isTimeInput: (type: SupportedInputTypes) => boolean;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type InputHTMLAttributes } from 'react';
|
|
2
|
+
import type { BreakpointCustomizable } from '../../types';
|
|
3
|
+
import type { InputSize } from '../Input/Input.utils';
|
|
4
|
+
export interface InputPasswordProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
5
|
+
/** Unique id for the input */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Label text displayed above the input */
|
|
8
|
+
label: string;
|
|
9
|
+
/** The value of autocomplete to use for the input */
|
|
10
|
+
autocomplete?: 'new-password' | 'current-password' | 'off';
|
|
11
|
+
/** Disables the input, preventing user interaction */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Hides the input label, can be responsive
|
|
14
|
+
* `boolean | { base: boolean; s?: boolean; m?: boolean; l?: boolean; xl?: boolean; }`
|
|
15
|
+
*/
|
|
16
|
+
hideLabel?: BreakpointCustomizable<boolean>;
|
|
17
|
+
/** Short descriptive text displayed beneath the label */
|
|
18
|
+
hint?: string;
|
|
19
|
+
/** Marks the input as invalid, typically used for form validation */
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
/** Enables the readonly state of the input */
|
|
22
|
+
readonly?: boolean;
|
|
23
|
+
/** Indicates that the input is required */
|
|
24
|
+
required?: boolean;
|
|
25
|
+
/** Defines a system feedback message, shown when `invalid={true}` */
|
|
26
|
+
systemFeedback?: string;
|
|
27
|
+
/** Size of the input */
|
|
28
|
+
size?: InputSize;
|
|
29
|
+
/** The show password button text label (for assistive technologies) */
|
|
30
|
+
showPasswordText?: string;
|
|
31
|
+
/** The hide password button text label (for assistive technologies) */
|
|
32
|
+
hidePasswordText?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The `<DSInputPassword />` component is an input field that allows users to enter and edit passwords.
|
|
36
|
+
* It comes in two sizes (medium & small) and supports various customizations including a label,
|
|
37
|
+
* a hint and a system feedback message.
|
|
38
|
+
*
|
|
39
|
+
* The user can toggle the visibility of the password by clicking on the action button.
|
|
40
|
+
*/
|
|
41
|
+
export declare const DSInputPassword: ({ id, label, autocomplete, className, disabled, hidePasswordText, hint, hideLabel, invalid, readonly, required, showPasswordText, size, systemFeedback, ...rest }: InputPasswordProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { InputPasswordProps } from './InputPassword';
|
|
2
|
+
type ValidationProps = Pick<InputPasswordProps, 'id' | 'label'>;
|
|
3
|
+
/**
|
|
4
|
+
* Validates the given properties of the DSInputPassword component for common configuration errors.
|
|
5
|
+
* This function is intended to be used in development mode to provide developers with
|
|
6
|
+
* warnings about potential misuse of the component.
|
|
7
|
+
*
|
|
8
|
+
* @param validationProps - The subset of DSInputPassword properties to validate. This includes
|
|
9
|
+
* id and label.
|
|
10
|
+
*/
|
|
11
|
+
export declare const validateInputPasswordProps: ({ id, label }: ValidationProps) => void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type InputHTMLAttributes } from 'react';
|
|
2
|
+
import type { BreakpointCustomizable } from '../../types';
|
|
3
|
+
import type { InputSize } from '../Input/Input.utils';
|
|
4
|
+
export interface InputSearchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
5
|
+
/** Unique id for the input */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Label text displayed above the input */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Accessibility label for the clear button */
|
|
10
|
+
clearButtonLabel?: string;
|
|
11
|
+
/** Disables the input, preventing user interaction */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Hides the input label, can be responsive
|
|
14
|
+
* `boolean | { base: boolean; s?: boolean; m?: boolean; l?: boolean; xl?: boolean; }`
|
|
15
|
+
*/
|
|
16
|
+
hideLabel?: BreakpointCustomizable<boolean>;
|
|
17
|
+
/** Short descriptive text displayed beneath the label */
|
|
18
|
+
hint?: string;
|
|
19
|
+
/** Marks the input as invalid, typically used for form validation */
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
/** Enables the readonly state of the input */
|
|
22
|
+
readonly?: boolean;
|
|
23
|
+
/** Indicates that the input is required */
|
|
24
|
+
required?: boolean;
|
|
25
|
+
/** Accessibility label for the submit button */
|
|
26
|
+
submitButtonLabel?: string;
|
|
27
|
+
/** Defines a system feedback message, shown when `invalid={true}` */
|
|
28
|
+
systemFeedback?: string;
|
|
29
|
+
/** Size of the input */
|
|
30
|
+
size?: InputSize;
|
|
31
|
+
/** Value of the input */
|
|
32
|
+
value?: string;
|
|
33
|
+
/** Callback function triggered when the submit button is clicked */
|
|
34
|
+
submitButtonOnClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The `<DSInputSearch />` component can be used as a dedicated search field input.
|
|
38
|
+
* It comes in two sizes (medium & small) and supports various customizations including a label,
|
|
39
|
+
* a hint and a system feedback message.
|
|
40
|
+
*
|
|
41
|
+
* A search button is always available on the right to submit the search request.
|
|
42
|
+
* Additionally when the input is filled, a button to clear the input value becomes visible.
|
|
43
|
+
*/
|
|
44
|
+
export declare const DSInputSearch: ({ id, label, className, clearButtonLabel, disabled, hint, hideLabel, invalid, readonly, required, size, submitButtonLabel, systemFeedback, value, submitButtonOnClick, onChange, ...rest }: InputSearchProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { InputSearchProps } from './InputSearch';
|
|
2
|
+
type ValidationProps = Pick<InputSearchProps, 'id' | 'label'>;
|
|
3
|
+
/**
|
|
4
|
+
* Validates the given properties of the DSInputSearch component for common configuration errors.
|
|
5
|
+
* This function is intended to be used in development mode to provide developers with
|
|
6
|
+
* warnings about potential misuse of the component.
|
|
7
|
+
*
|
|
8
|
+
* @param validationProps - The subset of DSInputSearch properties to validate. This includes
|
|
9
|
+
* id and label.
|
|
10
|
+
*/
|
|
11
|
+
export declare const validateInputSearchProps: ({ id, label }: ValidationProps) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Determines whether the specified HTMLElement is within a form element.
|
|
14
|
+
*
|
|
15
|
+
* This function checks if the given HTMLElement (`host`) is a descendant of
|
|
16
|
+
* a `<form>` element in the DOM tree. It utilizes the `getClosestHTMLElement`
|
|
17
|
+
* function to find the closest ancestor that matches the 'form' selector.
|
|
18
|
+
*
|
|
19
|
+
* @param {HTMLElement} host - The HTMLElement to check for being within a form.
|
|
20
|
+
* @returns {boolean} `true` if the `host` element is within a `<form>` element; otherwise, `false`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const isWithinForm: (host: HTMLElement) => boolean;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type InputHTMLAttributes } from 'react';
|
|
2
|
+
import type { BreakpointCustomizable } from '../../types';
|
|
3
|
+
import { type InputSize } from '../Input/Input.utils';
|
|
4
|
+
export interface InputStepperProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
5
|
+
/** Unique id for the input */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Label text displayed above the input */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Text used for assistive technologies when the value changes */
|
|
10
|
+
announcementText?: string;
|
|
11
|
+
/** Disables the input, preventing user interaction */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Accessibility label for the decrease button */
|
|
14
|
+
decreaseAmountButtonLabel?: string;
|
|
15
|
+
/** Hides the input label, can be responsive
|
|
16
|
+
* `boolean | { base: boolean; s?: boolean; m?: boolean; l?: boolean; xl?: boolean; }`
|
|
17
|
+
*/
|
|
18
|
+
hideLabel?: BreakpointCustomizable<boolean>;
|
|
19
|
+
/** Short descriptive text displayed beneath the label */
|
|
20
|
+
hint?: string;
|
|
21
|
+
/** Accessibility label for the increase button */
|
|
22
|
+
increaseAmountButtonLabel?: string;
|
|
23
|
+
/** Marks the input as invalid, typically used for form validation */
|
|
24
|
+
invalid?: boolean;
|
|
25
|
+
/** The maximum value for the input */
|
|
26
|
+
max?: number;
|
|
27
|
+
/** The minimum value for the input */
|
|
28
|
+
min?: number;
|
|
29
|
+
/** Text displayed as a prefix inside the input, maximum 8 characters */
|
|
30
|
+
prefix?: string;
|
|
31
|
+
/** Enables the readonly state of the input */
|
|
32
|
+
readonly?: boolean;
|
|
33
|
+
/** Indicates that the input is required */
|
|
34
|
+
required?: boolean;
|
|
35
|
+
/** The interval between legal numbers of the input */
|
|
36
|
+
step?: number;
|
|
37
|
+
/** Text displayed as a suffix inside the input, maximum 5 characters */
|
|
38
|
+
suffix?: string;
|
|
39
|
+
/** Defines a system feedback message, shown when `invalid={true}` */
|
|
40
|
+
systemFeedback?: string;
|
|
41
|
+
/** Size of the input */
|
|
42
|
+
size?: InputSize;
|
|
43
|
+
/** Value of the input */
|
|
44
|
+
value?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The `<DSInputStepper />` component is a versatile input field that allows users to easily enter a value and decrease or increase it as needed.
|
|
48
|
+
* It comes in two sizes (medium & small) and supports various customizations including a prefix and suffix.
|
|
49
|
+
*
|
|
50
|
+
* Next to the input field, there are two buttons to increase or decrease the input value.
|
|
51
|
+
*/
|
|
52
|
+
export declare const DSInputStepper: ({ id, label, announcementText, className, disabled, decreaseAmountButtonLabel, hint, hideLabel, invalid, increaseAmountButtonLabel, prefix, max, min, readonly, required, size, step, suffix, systemFeedback, value, onChange, ...rest }: InputStepperProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { InputStepperProps } from './InputStepper';
|
|
2
|
+
type ValidationProps = Pick<InputStepperProps, 'id' | 'label' | 'prefix' | 'suffix'>;
|
|
3
|
+
/**
|
|
4
|
+
* Validates the given properties of the DSInputStepper component for common configuration errors.
|
|
5
|
+
* This function is intended to be used in development mode to provide developers with
|
|
6
|
+
* warnings about potential misuse of the component.
|
|
7
|
+
*
|
|
8
|
+
* @param validationProps - The subset of DSInputStepper properties to validate. This includes
|
|
9
|
+
* properties related to the prefix, suffix, icons and action button of the input.
|
|
10
|
+
*/
|
|
11
|
+
export declare const validateInputStepperProps: ({ id, label, prefix, suffix, }: ValidationProps) => void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|