@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,228 @@
|
|
|
1
|
+
import "./assets/Input.2c508b2f.css";
|
|
2
|
+
import { j as n } from "./chunks/jsx-runtime.5c071667.js";
|
|
3
|
+
import { c as e } from "./chunks/index.8021d3e0.js";
|
|
4
|
+
import { useState as m, useRef as k, useLayoutEffect as w, useEffect as st } from "react";
|
|
5
|
+
import { u as it } from "./chunks/useBreakpoint.6c1b06c2.js";
|
|
6
|
+
import { Asterisk as et } from "./asterisk.91abccec.js";
|
|
7
|
+
import { DSButton as D } from "./button.89b2675b.js";
|
|
8
|
+
import { DSIcon as lt } from "./icon.b4211784.js";
|
|
9
|
+
import { DSSystemFeedback as ot } from "./systemfeedback.6bbd1505.js";
|
|
10
|
+
import { v as ut, a as ct, M as dt, b as _t, s as rt, i as v, c as pt } from "./chunks/Input.utils.f8f3286f.js";
|
|
11
|
+
const ft = "_input_qu78q_73", mt = "_input--invalid_qu78q_183", qt = "_input--small_qu78q_190", ht = "_input--has-leading-icon_qu78q_236", bt = "_input--has-action-button_qu78q_239", xt = "_input--has-second-action-button_qu78q_242", gt = "_input--has-affix_qu78q_254", St = "_input--is-ready_qu78q_266", It = "_root_qu78q_273", Ht = "_hint_qu78q_281", yt = "_label_qu78q_281", kt = "_wrapper_qu78q_285", vt = "_affix_qu78q_291", Ct = "_affix--small_qu78q_309", Lt = "_affix--disabled_qu78q_321", jt = "_prefix_qu78q_325", At = "_suffix_qu78q_331", Rt = "_leading-icon_qu78q_336", Nt = "_leading-icon--small_qu78q_341", Bt = "_action-button_qu78q_345", wt = "_label--hidden_qu78q_362", Dt = "_feedback_qu78q_389", t = {
|
|
12
|
+
input: ft,
|
|
13
|
+
"input--invalid": "_input--invalid_qu78q_183",
|
|
14
|
+
inputInvalid: mt,
|
|
15
|
+
"input--small": "_input--small_qu78q_190",
|
|
16
|
+
inputSmall: qt,
|
|
17
|
+
"input--has-leading-icon": "_input--has-leading-icon_qu78q_236",
|
|
18
|
+
inputHasLeadingIcon: ht,
|
|
19
|
+
"input--has-action-button": "_input--has-action-button_qu78q_239",
|
|
20
|
+
inputHasActionButton: bt,
|
|
21
|
+
"input--has-second-action-button": "_input--has-second-action-button_qu78q_242",
|
|
22
|
+
inputHasSecondActionButton: xt,
|
|
23
|
+
"input--has-affix": "_input--has-affix_qu78q_254",
|
|
24
|
+
inputHasAffix: gt,
|
|
25
|
+
"input--is-ready": "_input--is-ready_qu78q_266",
|
|
26
|
+
inputIsReady: St,
|
|
27
|
+
root: It,
|
|
28
|
+
hint: Ht,
|
|
29
|
+
label: yt,
|
|
30
|
+
wrapper: kt,
|
|
31
|
+
affix: vt,
|
|
32
|
+
"affix--small": "_affix--small_qu78q_309",
|
|
33
|
+
affixSmall: Ct,
|
|
34
|
+
"affix--disabled": "_affix--disabled_qu78q_321",
|
|
35
|
+
affixDisabled: Lt,
|
|
36
|
+
prefix: jt,
|
|
37
|
+
suffix: At,
|
|
38
|
+
"leading-icon": "_leading-icon_qu78q_336",
|
|
39
|
+
leadingIcon: Rt,
|
|
40
|
+
"leading-icon--small": "_leading-icon--small_qu78q_341",
|
|
41
|
+
leadingIconSmall: Nt,
|
|
42
|
+
"action-button": "_action-button_qu78q_345",
|
|
43
|
+
actionButton: Bt,
|
|
44
|
+
"label--hidden": "_label--hidden_qu78q_362",
|
|
45
|
+
labelHidden: wt,
|
|
46
|
+
feedback: Dt
|
|
47
|
+
}, Gt = ({
|
|
48
|
+
id: c,
|
|
49
|
+
label: C,
|
|
50
|
+
actionButtonLabel: T,
|
|
51
|
+
actionButtonIconName: _,
|
|
52
|
+
actionButtonIconSource: q,
|
|
53
|
+
actionButtonOnClick: E,
|
|
54
|
+
className: F,
|
|
55
|
+
disabled: l = !1,
|
|
56
|
+
hint: h,
|
|
57
|
+
hideLabel: P = !1,
|
|
58
|
+
invalid: r = !1,
|
|
59
|
+
leadingIconName: p,
|
|
60
|
+
leadingIconSource: f,
|
|
61
|
+
prefix: s,
|
|
62
|
+
readonly: d = !1,
|
|
63
|
+
required: L = !1,
|
|
64
|
+
size: i = "medium",
|
|
65
|
+
suffix: a,
|
|
66
|
+
systemFeedback: b,
|
|
67
|
+
type: o = "text",
|
|
68
|
+
...O
|
|
69
|
+
}) => {
|
|
70
|
+
process.env.NODE_ENV !== "production" && (ut({
|
|
71
|
+
id: c,
|
|
72
|
+
label: C,
|
|
73
|
+
prefix: s,
|
|
74
|
+
suffix: a,
|
|
75
|
+
leadingIconName: p,
|
|
76
|
+
leadingIconSource: f,
|
|
77
|
+
actionButtonIconName: _,
|
|
78
|
+
actionButtonIconSource: q
|
|
79
|
+
}), ct(o));
|
|
80
|
+
const [$, W] = m(!1), [X, M] = m(!1), [x, V] = m(!1), [G, U] = m({}), g = k(null), J = s == null ? void 0 : s.substring(0, dt), S = k(null), K = a == null ? void 0 : a.substring(0, _t), I = k(null), Q = it(P);
|
|
81
|
+
w(() => {
|
|
82
|
+
const u = i === "medium" ? 16 : 8, H = {};
|
|
83
|
+
if (S.current) {
|
|
84
|
+
const y = S.current.offsetWidth;
|
|
85
|
+
H.paddingLeft = u + y + "px";
|
|
86
|
+
}
|
|
87
|
+
if (I.current) {
|
|
88
|
+
const y = I.current.offsetWidth;
|
|
89
|
+
H.paddingRight = u + y + "px";
|
|
90
|
+
}
|
|
91
|
+
U(H), W(!0);
|
|
92
|
+
}, [s, a, i, X]), w(() => {
|
|
93
|
+
(async () => {
|
|
94
|
+
"fonts" in document && (await document.fonts.load('1em "STIHL Contraface Text Regular"'), M(!0));
|
|
95
|
+
})();
|
|
96
|
+
}, []), st(() => {
|
|
97
|
+
const u = rt(
|
|
98
|
+
v(o),
|
|
99
|
+
pt(o)
|
|
100
|
+
);
|
|
101
|
+
V(u);
|
|
102
|
+
}, [o]);
|
|
103
|
+
const j = e(t.affix, {
|
|
104
|
+
[t.affixSmall]: i === "small",
|
|
105
|
+
[t.affixDisabled]: l
|
|
106
|
+
}), A = `${c}-label`, R = `${c}-feedback`, N = `${c}-hint`, Y = h ? ` ${N}` : "", Z = e(t.root, F), z = e(t.input, {
|
|
107
|
+
// small input
|
|
108
|
+
[t.inputSmall]: i === "small",
|
|
109
|
+
// invalid state
|
|
110
|
+
[t.inputInvalid]: r,
|
|
111
|
+
// leading icon
|
|
112
|
+
[t.inputHasLeadingIcon]: p || f,
|
|
113
|
+
// prefix/suffix
|
|
114
|
+
[t.inputHasAffix]: s || a,
|
|
115
|
+
// action button
|
|
116
|
+
[t.inputHasActionButton]: _ || q || x,
|
|
117
|
+
[t.inputIsReady]: $
|
|
118
|
+
}), tt = e(t.label, {
|
|
119
|
+
// hide label only visually to keep them available for assistive technologies
|
|
120
|
+
[t.labelHidden]: Q
|
|
121
|
+
}), nt = e(t.leadingIcon, {
|
|
122
|
+
[t.leadingIconSmall]: i === "small"
|
|
123
|
+
}), B = e(t.actionButton, {
|
|
124
|
+
[t.actionButtonSmall]: i === "small"
|
|
125
|
+
}), at = (u) => {
|
|
126
|
+
g.current && !l && !d && g.current.showPicker(), u.preventDefault();
|
|
127
|
+
};
|
|
128
|
+
return /* @__PURE__ */ n.jsxs("div", { className: Z, children: [
|
|
129
|
+
/* @__PURE__ */ n.jsxs("label", { className: tt, id: A, htmlFor: c, children: [
|
|
130
|
+
C,
|
|
131
|
+
L && /* @__PURE__ */ n.jsx(et, {})
|
|
132
|
+
] }),
|
|
133
|
+
h && /* @__PURE__ */ n.jsx("div", { className: t.hint, id: N, children: h }),
|
|
134
|
+
r && b && /* @__PURE__ */ n.jsx(
|
|
135
|
+
ot,
|
|
136
|
+
{
|
|
137
|
+
className: t.feedback,
|
|
138
|
+
message: b,
|
|
139
|
+
type: "invalid",
|
|
140
|
+
id: R
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
/* @__PURE__ */ n.jsxs("div", { className: t.wrapper, children: [
|
|
144
|
+
s && /* @__PURE__ */ n.jsx(
|
|
145
|
+
"span",
|
|
146
|
+
{
|
|
147
|
+
className: e(j, t.prefix),
|
|
148
|
+
ref: S,
|
|
149
|
+
"aria-disabled": l,
|
|
150
|
+
children: J
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
!s && (p || f) && /* @__PURE__ */ n.jsx(
|
|
154
|
+
lt,
|
|
155
|
+
{
|
|
156
|
+
name: p,
|
|
157
|
+
theme: "light",
|
|
158
|
+
source: f,
|
|
159
|
+
className: nt,
|
|
160
|
+
"aria-hidden": "true"
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
/* @__PURE__ */ n.jsx(
|
|
164
|
+
"input",
|
|
165
|
+
{
|
|
166
|
+
type: o,
|
|
167
|
+
className: z,
|
|
168
|
+
id: c,
|
|
169
|
+
ref: g,
|
|
170
|
+
...O,
|
|
171
|
+
style: G,
|
|
172
|
+
"aria-labelledby": `${A}${Y}`,
|
|
173
|
+
"aria-describedby": r && b ? R : void 0,
|
|
174
|
+
"aria-invalid": r,
|
|
175
|
+
"aria-disabled": d,
|
|
176
|
+
readOnly: d,
|
|
177
|
+
required: L,
|
|
178
|
+
disabled: l
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
a && /* @__PURE__ */ n.jsx(
|
|
182
|
+
"span",
|
|
183
|
+
{
|
|
184
|
+
className: e(j, t.suffix),
|
|
185
|
+
ref: I,
|
|
186
|
+
"aria-disabled": l,
|
|
187
|
+
children: K
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
!a && !x && (_ || q) && /* @__PURE__ */ n.jsx(
|
|
191
|
+
D,
|
|
192
|
+
{
|
|
193
|
+
hideLabel: !0,
|
|
194
|
+
theme: "light",
|
|
195
|
+
iconName: _,
|
|
196
|
+
variant: "ghost",
|
|
197
|
+
className: B,
|
|
198
|
+
size: i,
|
|
199
|
+
onClick: E,
|
|
200
|
+
type: "button",
|
|
201
|
+
disabled: l || d,
|
|
202
|
+
children: T
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
!a && x && !d && !l && /* @__PURE__ */ n.jsxs(
|
|
206
|
+
D,
|
|
207
|
+
{
|
|
208
|
+
hideLabel: !0,
|
|
209
|
+
theme: "light",
|
|
210
|
+
iconName: v(o) ? "calendar" : "clock",
|
|
211
|
+
variant: "ghost",
|
|
212
|
+
className: B,
|
|
213
|
+
size: i,
|
|
214
|
+
onClick: at,
|
|
215
|
+
type: "button",
|
|
216
|
+
children: [
|
|
217
|
+
"Open ",
|
|
218
|
+
v(o) ? "date" : "time",
|
|
219
|
+
" picker"
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
] })
|
|
224
|
+
] });
|
|
225
|
+
};
|
|
226
|
+
export {
|
|
227
|
+
Gt as DSInput
|
|
228
|
+
};
|
package/input.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/Input/Input'
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import "./assets/InputPassword.a534f047.css";
|
|
2
|
+
import { j as a } from "./chunks/jsx-runtime.5c071667.js";
|
|
3
|
+
import { c as i } from "./chunks/index.8021d3e0.js";
|
|
4
|
+
import { useState as A } from "react";
|
|
5
|
+
import { u as D } from "./chunks/useBreakpoint.6c1b06c2.js";
|
|
6
|
+
import { Asterisk as C } from "./asterisk.91abccec.js";
|
|
7
|
+
import { DSButton as L } from "./button.89b2675b.js";
|
|
8
|
+
import { DSSystemFeedback as $ } from "./systemfeedback.6bbd1505.js";
|
|
9
|
+
import { g as b } from "./chunks/helpers.ea3ca41a.js";
|
|
10
|
+
const E = "_input_2ztxt_73", q = "_input--invalid_2ztxt_183", R = "_input--small_2ztxt_190", V = "_input--has-leading-icon_2ztxt_236", O = "_input--has-action-button_2ztxt_239", F = "_input--has-second-action-button_2ztxt_242", M = "_input--has-affix_2ztxt_254", T = "_input--is-ready_2ztxt_266", G = "_root_2ztxt_273", J = "_hint_2ztxt_281", K = "_label_2ztxt_281", Q = "_wrapper_2ztxt_285", U = "_action-button_2ztxt_291", W = "_label--hidden_2ztxt_308", X = "_feedback_2ztxt_335", t = {
|
|
11
|
+
input: E,
|
|
12
|
+
"input--invalid": "_input--invalid_2ztxt_183",
|
|
13
|
+
inputInvalid: q,
|
|
14
|
+
"input--small": "_input--small_2ztxt_190",
|
|
15
|
+
inputSmall: R,
|
|
16
|
+
"input--has-leading-icon": "_input--has-leading-icon_2ztxt_236",
|
|
17
|
+
inputHasLeadingIcon: V,
|
|
18
|
+
"input--has-action-button": "_input--has-action-button_2ztxt_239",
|
|
19
|
+
inputHasActionButton: O,
|
|
20
|
+
"input--has-second-action-button": "_input--has-second-action-button_2ztxt_242",
|
|
21
|
+
inputHasSecondActionButton: F,
|
|
22
|
+
"input--has-affix": "_input--has-affix_2ztxt_254",
|
|
23
|
+
inputHasAffix: M,
|
|
24
|
+
"input--is-ready": "_input--is-ready_2ztxt_266",
|
|
25
|
+
inputIsReady: T,
|
|
26
|
+
root: G,
|
|
27
|
+
hint: J,
|
|
28
|
+
label: K,
|
|
29
|
+
wrapper: Q,
|
|
30
|
+
"action-button": "_action-button_2ztxt_291",
|
|
31
|
+
actionButton: U,
|
|
32
|
+
"label--hidden": "_label--hidden_2ztxt_308",
|
|
33
|
+
labelHidden: W,
|
|
34
|
+
feedback: X
|
|
35
|
+
}, Y = ({ id: n, label: s }) => {
|
|
36
|
+
if (!n)
|
|
37
|
+
throw new Error(
|
|
38
|
+
b(
|
|
39
|
+
"DSInputPassword",
|
|
40
|
+
'A unique "id" prop is required. Please add an unique "id" prop to the DSInputPassword component.'
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
if (!s)
|
|
44
|
+
throw new Error(
|
|
45
|
+
b(
|
|
46
|
+
"DSInputPassword",
|
|
47
|
+
`A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSInputPassword component. If you don't want to display a label, set hideLabel={true}.`
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
}, pt = ({
|
|
51
|
+
id: n,
|
|
52
|
+
label: s,
|
|
53
|
+
autocomplete: h = "new-password",
|
|
54
|
+
className: f,
|
|
55
|
+
disabled: r = !1,
|
|
56
|
+
hidePasswordText: w = "Hide password",
|
|
57
|
+
hint: e,
|
|
58
|
+
hideLabel: z = !1,
|
|
59
|
+
invalid: o = !1,
|
|
60
|
+
readonly: c = !1,
|
|
61
|
+
required: d = !1,
|
|
62
|
+
showPasswordText: y = "Show password",
|
|
63
|
+
size: l = "medium",
|
|
64
|
+
systemFeedback: p,
|
|
65
|
+
...S
|
|
66
|
+
}) => {
|
|
67
|
+
process.env.NODE_ENV !== "production" && Y({
|
|
68
|
+
id: n,
|
|
69
|
+
label: s
|
|
70
|
+
});
|
|
71
|
+
const [u, I] = A(!1), _ = `${n}-label`, m = `${n}-feedback`, x = `${n}-hint`, B = e ? ` ${x}` : "", H = D(z), g = i(t.root, f), v = i(t.input, {
|
|
72
|
+
// small input
|
|
73
|
+
[t.inputSmall]: l === "small",
|
|
74
|
+
// invalid state
|
|
75
|
+
[t.inputInvalid]: o,
|
|
76
|
+
// action button - input password always has an action button
|
|
77
|
+
[t.inputHasActionButton]: !0
|
|
78
|
+
}), P = i(t.label, {
|
|
79
|
+
// hide label only visually to keep them available for assistive technologies
|
|
80
|
+
[t.labelHidden]: H
|
|
81
|
+
}), N = i(t.actionButton, {
|
|
82
|
+
[t.actionButtonSmall]: l === "small"
|
|
83
|
+
}), j = () => {
|
|
84
|
+
I((k) => !k);
|
|
85
|
+
};
|
|
86
|
+
return /* @__PURE__ */ a.jsxs("div", { className: g, children: [
|
|
87
|
+
/* @__PURE__ */ a.jsxs("label", { className: P, id: _, htmlFor: n, children: [
|
|
88
|
+
s,
|
|
89
|
+
d && /* @__PURE__ */ a.jsx(C, {})
|
|
90
|
+
] }),
|
|
91
|
+
e && /* @__PURE__ */ a.jsx("div", { className: t.hint, id: x, children: e }),
|
|
92
|
+
o && p && /* @__PURE__ */ a.jsx(
|
|
93
|
+
$,
|
|
94
|
+
{
|
|
95
|
+
className: t.feedback,
|
|
96
|
+
message: p,
|
|
97
|
+
type: "invalid",
|
|
98
|
+
id: m
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ a.jsxs("div", { className: t.wrapper, children: [
|
|
102
|
+
/* @__PURE__ */ a.jsx(
|
|
103
|
+
"input",
|
|
104
|
+
{
|
|
105
|
+
className: v,
|
|
106
|
+
id: n,
|
|
107
|
+
...S,
|
|
108
|
+
"aria-labelledby": `${_}${B}`,
|
|
109
|
+
"aria-describedby": o && p ? m : void 0,
|
|
110
|
+
"aria-invalid": o,
|
|
111
|
+
"aria-disabled": c,
|
|
112
|
+
readOnly: c,
|
|
113
|
+
required: d,
|
|
114
|
+
disabled: r,
|
|
115
|
+
autoComplete: h,
|
|
116
|
+
type: u ? "text" : "password"
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
/* @__PURE__ */ a.jsx(
|
|
120
|
+
L,
|
|
121
|
+
{
|
|
122
|
+
hideLabel: !0,
|
|
123
|
+
theme: "light",
|
|
124
|
+
iconName: u ? "eye-closed" : "eye",
|
|
125
|
+
variant: "ghost",
|
|
126
|
+
className: N,
|
|
127
|
+
size: l,
|
|
128
|
+
onClick: j,
|
|
129
|
+
type: "button",
|
|
130
|
+
disabled: r,
|
|
131
|
+
children: u ? w : y
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
] })
|
|
135
|
+
] });
|
|
136
|
+
};
|
|
137
|
+
export {
|
|
138
|
+
pt as DSInputPassword
|
|
139
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/InputPassword/InputPassword'
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import "./assets/InputSearch.8f986307.css";
|
|
2
|
+
import { j as a } from "./chunks/jsx-runtime.5c071667.js";
|
|
3
|
+
import { c as l } from "./chunks/index.8021d3e0.js";
|
|
4
|
+
import { useState as J, useRef as w, useEffect as A } from "react";
|
|
5
|
+
import { g as S, a as K } from "./chunks/helpers.ea3ca41a.js";
|
|
6
|
+
import { u as Q } from "./chunks/useBreakpoint.6c1b06c2.js";
|
|
7
|
+
import { Asterisk as U } from "./asterisk.91abccec.js";
|
|
8
|
+
import { DSButton as D } from "./button.89b2675b.js";
|
|
9
|
+
import { DSSystemFeedback as X } from "./systemfeedback.6bbd1505.js";
|
|
10
|
+
const Y = "_input_ps4al_73", Z = "_input--invalid_ps4al_183", z = "_input--small_ps4al_190", tt = "_input--has-leading-icon_ps4al_236", nt = "_input--has-action-button_ps4al_239", at = "_input--has-second-action-button_ps4al_242", et = "_input--has-affix_ps4al_254", st = "_input--is-ready_ps4al_266", ot = "_root_ps4al_273", it = "_hint_ps4al_281", lt = "_label_ps4al_281", ct = "_wrapper_ps4al_285", ut = "_action-button_ps4al_291", pt = "_second-action-button_ps4al_295", rt = "_label--hidden_ps4al_312", _t = "_feedback_ps4al_339", t = {
|
|
11
|
+
input: Y,
|
|
12
|
+
"input--invalid": "_input--invalid_ps4al_183",
|
|
13
|
+
inputInvalid: Z,
|
|
14
|
+
"input--small": "_input--small_ps4al_190",
|
|
15
|
+
inputSmall: z,
|
|
16
|
+
"input--has-leading-icon": "_input--has-leading-icon_ps4al_236",
|
|
17
|
+
inputHasLeadingIcon: tt,
|
|
18
|
+
"input--has-action-button": "_input--has-action-button_ps4al_239",
|
|
19
|
+
inputHasActionButton: nt,
|
|
20
|
+
"input--has-second-action-button": "_input--has-second-action-button_ps4al_242",
|
|
21
|
+
inputHasSecondActionButton: at,
|
|
22
|
+
"input--has-affix": "_input--has-affix_ps4al_254",
|
|
23
|
+
inputHasAffix: et,
|
|
24
|
+
"input--is-ready": "_input--is-ready_ps4al_266",
|
|
25
|
+
inputIsReady: st,
|
|
26
|
+
root: ot,
|
|
27
|
+
hint: it,
|
|
28
|
+
label: lt,
|
|
29
|
+
wrapper: ct,
|
|
30
|
+
"action-button": "_action-button_ps4al_291",
|
|
31
|
+
actionButton: ut,
|
|
32
|
+
"second-action-button": "_second-action-button_ps4al_295",
|
|
33
|
+
secondActionButton: pt,
|
|
34
|
+
"label--hidden": "_label--hidden_ps4al_312",
|
|
35
|
+
labelHidden: rt,
|
|
36
|
+
feedback: _t
|
|
37
|
+
}, dt = ({ id: n, label: c }) => {
|
|
38
|
+
if (!n)
|
|
39
|
+
throw new Error(
|
|
40
|
+
S(
|
|
41
|
+
"DSInputSearch",
|
|
42
|
+
'A unique "id" prop is required. Please add an unique "id" prop to the DSInputSearch component.'
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
if (!c)
|
|
46
|
+
throw new Error(
|
|
47
|
+
S(
|
|
48
|
+
"DSInputSearch",
|
|
49
|
+
`A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSInputSearch component. If you don't want to display a label, set hideLabel={true}.`
|
|
50
|
+
)
|
|
51
|
+
);
|
|
52
|
+
}, ht = (n) => !!K(n, "form"), xt = ({
|
|
53
|
+
id: n,
|
|
54
|
+
label: c,
|
|
55
|
+
className: H,
|
|
56
|
+
clearButtonLabel: E = "Clear search field",
|
|
57
|
+
disabled: u = !1,
|
|
58
|
+
hint: h,
|
|
59
|
+
hideLabel: j = !1,
|
|
60
|
+
invalid: p = !1,
|
|
61
|
+
readonly: s = !1,
|
|
62
|
+
required: I = !1,
|
|
63
|
+
size: o = "medium",
|
|
64
|
+
submitButtonLabel: C = "Search",
|
|
65
|
+
systemFeedback: m,
|
|
66
|
+
value: b,
|
|
67
|
+
submitButtonOnClick: k,
|
|
68
|
+
onChange: g,
|
|
69
|
+
...L
|
|
70
|
+
}) => {
|
|
71
|
+
process.env.NODE_ENV !== "production" && dt({
|
|
72
|
+
id: n,
|
|
73
|
+
label: c
|
|
74
|
+
});
|
|
75
|
+
const [r, v] = J(b), f = w(null), _ = w(null), V = Q(j);
|
|
76
|
+
A(() => {
|
|
77
|
+
v(b);
|
|
78
|
+
}, [b]), A(() => {
|
|
79
|
+
f.current && !ht(f.current) && process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && console.warn(
|
|
80
|
+
S(
|
|
81
|
+
"DSInputSearch",
|
|
82
|
+
`The DSInputSearch component with the id "${n}" is not within a form element. This may cause issues with form submission. Please ensure the DSInputSearch component is within a form element.`
|
|
83
|
+
)
|
|
84
|
+
);
|
|
85
|
+
}, []);
|
|
86
|
+
const B = `${n}-label`, y = `${n}-feedback`, x = `${n}-hint`, O = h ? ` ${x}` : "", N = r !== "" && r !== void 0 && r !== null, P = l(t.root, H), $ = l(t.input, {
|
|
87
|
+
// small input
|
|
88
|
+
[t.inputSmall]: o === "small",
|
|
89
|
+
// invalid state
|
|
90
|
+
[t.inputInvalid]: p,
|
|
91
|
+
// action button - input password always has an action button
|
|
92
|
+
[t.inputHasActionButton]: !0,
|
|
93
|
+
// action second action button
|
|
94
|
+
[t.inputHasSecondActionButton]: N && !s && !u
|
|
95
|
+
}), R = l(t.label, {
|
|
96
|
+
// hide label only visually to keep them available for assistive technologies
|
|
97
|
+
[t.labelHidden]: V
|
|
98
|
+
}), q = l(t.actionButton, {
|
|
99
|
+
[t.actionButtonSmall]: o === "small"
|
|
100
|
+
}), T = l(t.secondActionButton, {
|
|
101
|
+
[t.secondActionButtonSmall]: o === "small"
|
|
102
|
+
}), F = (e, i) => {
|
|
103
|
+
const G = Object.getPrototypeOf(e), d = Object.getOwnPropertyDescriptor(
|
|
104
|
+
G,
|
|
105
|
+
"value"
|
|
106
|
+
);
|
|
107
|
+
d != null && d.set ? d.set.call(e, i) : e.value = i;
|
|
108
|
+
}, M = () => {
|
|
109
|
+
var i;
|
|
110
|
+
if (!_.current)
|
|
111
|
+
return;
|
|
112
|
+
F(_.current, "");
|
|
113
|
+
const e = new Event("change", { bubbles: !0 });
|
|
114
|
+
(i = _.current) == null || i.dispatchEvent(e);
|
|
115
|
+
}, W = (e) => {
|
|
116
|
+
v(e.target.value), g && g(e);
|
|
117
|
+
};
|
|
118
|
+
return /* @__PURE__ */ a.jsxs("div", { className: P, ref: f, children: [
|
|
119
|
+
/* @__PURE__ */ a.jsxs("label", { className: R, id: B, htmlFor: n, children: [
|
|
120
|
+
c,
|
|
121
|
+
I && /* @__PURE__ */ a.jsx(U, {})
|
|
122
|
+
] }),
|
|
123
|
+
h && /* @__PURE__ */ a.jsx("div", { className: t.hint, id: x, children: h }),
|
|
124
|
+
p && m && /* @__PURE__ */ a.jsx(
|
|
125
|
+
X,
|
|
126
|
+
{
|
|
127
|
+
className: t.feedback,
|
|
128
|
+
message: m,
|
|
129
|
+
type: "invalid",
|
|
130
|
+
id: y
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ a.jsxs("div", { className: t.wrapper, children: [
|
|
134
|
+
/* @__PURE__ */ a.jsx(
|
|
135
|
+
"input",
|
|
136
|
+
{
|
|
137
|
+
className: $,
|
|
138
|
+
id: n,
|
|
139
|
+
ref: _,
|
|
140
|
+
...L,
|
|
141
|
+
"aria-labelledby": `${B}${O}`,
|
|
142
|
+
"aria-describedby": p && m ? y : void 0,
|
|
143
|
+
"aria-invalid": p,
|
|
144
|
+
"aria-disabled": s,
|
|
145
|
+
readOnly: s,
|
|
146
|
+
required: I,
|
|
147
|
+
disabled: u,
|
|
148
|
+
type: "search",
|
|
149
|
+
value: r,
|
|
150
|
+
onChange: W
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
N && !s && !u && /* @__PURE__ */ a.jsx(
|
|
154
|
+
D,
|
|
155
|
+
{
|
|
156
|
+
hideLabel: !0,
|
|
157
|
+
theme: "light",
|
|
158
|
+
iconName: "cross",
|
|
159
|
+
className: T,
|
|
160
|
+
variant: "ghost",
|
|
161
|
+
size: o,
|
|
162
|
+
onClick: M,
|
|
163
|
+
type: "button",
|
|
164
|
+
tabIndex: -1,
|
|
165
|
+
children: E
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ a.jsx(
|
|
169
|
+
D,
|
|
170
|
+
{
|
|
171
|
+
hideLabel: !0,
|
|
172
|
+
theme: "light",
|
|
173
|
+
iconName: "magnifying-glass",
|
|
174
|
+
className: q,
|
|
175
|
+
variant: "ghost",
|
|
176
|
+
size: o,
|
|
177
|
+
onClick: k,
|
|
178
|
+
type: "submit",
|
|
179
|
+
disabled: u || s,
|
|
180
|
+
children: C
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
] })
|
|
184
|
+
] });
|
|
185
|
+
};
|
|
186
|
+
export {
|
|
187
|
+
xt as DSInputSearch
|
|
188
|
+
};
|
package/inputsearch.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/InputSearch/InputSearch'
|