@stihl-design-system/components 1.0.0-RC.32 → 1.0.0-RC.35
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/accordion.Dmqocj97.js +12 -0
- package/actionbutton.Du5CT-Mt.js +12 -0
- package/actionlink.BK9CaQUY.js +12 -0
- package/{arialiveregions.Fgcshs5k.js → arialiveregions.BUVY9NpY.js} +2 -2
- package/assets/Accordion.CzBGud45.css +1 -0
- package/assets/Button.CmeGVEAY.css +1 -0
- package/assets/Checkbox.CyOw3rXI.css +1 -0
- package/assets/CustomReactSelect.BihX36Uo.css +1 -0
- package/assets/Dialog.DJkn65Es.css +1 -0
- package/assets/Drawer.x3BCQvWE.css +1 -0
- package/assets/Fieldset.Oqu7pOBv.css +1 -0
- package/assets/InputFile.D7Ihod7B.css +1 -0
- package/assets/InputNumber.z_UqRYdv.css +1 -0
- package/assets/InputPassword.DZENjxJ9.css +1 -0
- package/assets/InputSearch.GBH9Eh6F.css +1 -0
- package/assets/LinkButton.88j5ckLu.css +1 -0
- package/assets/{MegaMenu.DX9gChtY.css → MegaMenu.D5EtjFeL.css} +1 -1
- package/assets/Notification.CvohYEvT.css +1 -0
- package/assets/Select.CL0fqx7X.css +1 -0
- package/assets/Slider.DWLuIsNj.css +1 -0
- package/assets/Stepper.tXJl15yL.css +1 -0
- package/assets/{SystemFeedback.RcrPepSZ.css → SystemFeedback.PKzqnXUe.css} +1 -1
- package/assets/Textarea.B1HOakic.css +1 -0
- package/assets/Toast.CGyKXb4V.css +1 -0
- package/assets/buttonround.DBpMesfr.css +1 -0
- package/assets/input.RPDR8qdT.css +1 -0
- package/assets/step.BeLporJO.css +1 -0
- package/assets/switch.B9B-n_3y.css +1 -0
- package/{asterisk.CR60hx8S.js → asterisk.B2ih8VwF.js} +1 -1
- package/{banner.o4Etkjjo.js → banner.D-RX60nJ.js} +3 -3
- package/breadcrumb.tvMByFgp.js +11 -0
- package/button.CZupaV9L.js +12 -0
- package/buttonround.9IS0tUqw.js +96 -0
- package/checkbox.XYQI-ubx.js +12 -0
- package/checkboxgroup.CjnNJ8e6.js +9 -0
- package/chip.B-pxhsdb.js +12 -0
- package/chipgroup.cGjn4LVV.js +143 -0
- package/chunks/Accordion.CYIfNOWr.js +168 -0
- package/chunks/{ActionButton.DdDesD7K.js → ActionButton.BOYQYo5M.js} +37 -37
- package/chunks/{ActionLink.DqAsPYda.js → ActionLink.BlwvrnPN.js} +36 -36
- package/chunks/{AriaLiveRegions.utils.Cb327d_2.js → AriaLiveRegions.utils.CybNIBSa.js} +2 -2
- package/chunks/{Breadcrumb.9KinNuyQ.js → Breadcrumb.Qr6bDP2N.js} +35 -37
- package/chunks/Button.Cn5yg7dG.js +138 -0
- package/chunks/Checkbox.D5X5T6Yg.js +88 -0
- package/chunks/CheckboxGroup.CUR_0VMc.js +74 -0
- package/chunks/{Chip.BrbYu6i_.js → Chip.DIp5hdRH.js} +6 -6
- package/chunks/{CustomReactSelect.Cqq70QC0.js → CustomReactSelect.BA3hUVkh.js} +897 -878
- package/chunks/Dialog.DRk_jSj5.js +102 -0
- package/chunks/Drawer.Dj6WeUC8.js +107 -0
- package/chunks/Fieldset.C0RzpI-h.js +81 -0
- package/chunks/Header.18sOO0Gf.js +370 -0
- package/chunks/{Icon.NSsVrYeq.js → Icon.CDLyB7Pv.js} +77 -79
- package/chunks/{Input.utils.Cnnzvuk4.js → Input.utils.CL1u4Ctq.js} +30 -28
- package/chunks/InputFile.Bki3bs3U.js +236 -0
- package/chunks/InputNumber.B43cqBH0.js +242 -0
- package/chunks/InputPassword.DcdMjsXr.js +121 -0
- package/chunks/InputSearch.CJm6ph8W.js +149 -0
- package/chunks/LinkButton.C6F-yuLL.js +139 -0
- package/chunks/MegaMenu.qttkjGbD.js +188 -0
- package/chunks/NavigationTabList.G_l0GiUa.js +67 -0
- package/chunks/{NavigationTabs.DspPFHPh.js → NavigationTabs.CQxlahX1.js} +13 -14
- package/chunks/Notification.Qzz88ngL.js +91 -0
- package/chunks/Popover.D7McfVaH.js +214 -0
- package/chunks/RadioGroup.B2VCD9x-.js +106 -0
- package/chunks/Select.B0uMOSSD.js +147 -0
- package/chunks/Slider.YTIktxxD.js +306 -0
- package/chunks/Stepper.BvPmbbqw.js +152 -0
- package/chunks/{SystemFeedback.CyGbUCzT.js → SystemFeedback.CjlARKki.js} +9 -9
- package/chunks/Tabs.CoO_lrhV.js +83 -0
- package/chunks/{Text.DGWeWF1y.js → Text.DpRtTpB4.js} +3 -3
- package/chunks/Textarea.lYiPXerd.js +181 -0
- package/chunks/Toast.L5HAuEOn.js +76 -0
- package/chunks/{arrow-clockwise.BefOjGPg.js → arrow-clockwise.C4iOgjOc.js} +1 -1
- package/chunks/{arrow-counterclockwise.C7Ov32BZ.js → arrow-counterclockwise.CgQAuBUe.js} +1 -1
- package/chunks/{circle-check-colored.Bye_GwLy.js → circle-check-colored.qP2s3vjI.js} +1 -1
- package/chunks/{diamond-exclamationmark-colored.WNKYwZ8q.js → diamond-exclamationmark-colored.CzYiaTZ0.js} +1 -1
- package/chunks/feather.l1E4nFBx.js +10 -0
- package/chunks/file-type-doc.B_RSSYbu.js +10 -0
- package/chunks/floating-ui.react.COTL3jH5.js +2984 -0
- package/chunks/helpers.CexwVao7.js +38 -0
- package/chunks/{index.CgTHIF3K.js → index.D-sRdssb.js} +1 -1
- package/chunks/{index.CEyLAtio.js → index.DL9mof6u.js} +2 -2
- package/chunks/{is-animation-disabled.CUl4N3LI.js → is-animation-disabled.B-V_68K-.js} +5 -5
- package/chunks/{map.CXgG1iGz.js → map.DNl7PF61.js} +1 -1
- package/chunks/moon.5yILPYXs.js +10 -0
- package/chunks/muscle.DbNjWasV.js +10 -0
- package/chunks/petrol.BGWwCsTw.js +10 -0
- package/chunks/sun.CY6ttzTL.js +10 -0
- package/chunks/{triangle-exclamationmark-colored.CbVC3Gzi.js → triangle-exclamationmark-colored.e93zvQ6Q.js} +1 -1
- package/chunks/upload.BogDfonx.js +10 -0
- package/chunks/useBreakpoint.1txsny17.js +45 -0
- package/chunks/variants.-R3_RCW8.js +10 -0
- package/chunks/weight.DUPu2UT0.js +10 -0
- package/combobox.CGEDlMo0.js +71 -0
- package/components/Button/Button.d.ts +5 -0
- package/components/Button/Button.utils.d.ts +4 -5
- package/components/CheckboxGroup/CheckboxGroup.d.ts +14 -1
- package/components/ChipGroup/ChipGroup.utils.d.ts +1 -3
- package/components/Combobox/Combobox.utils.d.ts +6 -6
- package/components/Combobox/CustomReactSelect/CustomReactSelect.d.ts +17 -2
- package/components/Fieldset/Fieldset.d.ts +14 -1
- package/components/Input/Input.d.ts +13 -0
- package/components/Input/Input.utils.d.ts +2 -2
- package/components/InputFile/InputFile.d.ts +13 -0
- package/components/InputFile/InputFile.utils.d.ts +4 -2
- package/components/{InputStepper/InputStepper.d.ts → InputNumber/InputNumber.d.ts} +21 -8
- package/components/InputNumber/InputNumber.utils.d.ts +13 -0
- package/components/InputPassword/InputPassword.d.ts +13 -0
- package/components/InputPassword/InputPassword.utils.d.ts +2 -2
- package/components/InputSearch/InputSearch.d.ts +13 -0
- package/components/InputSearch/InputSearch.utils.d.ts +2 -2
- package/components/LinkButton/LinkButton.d.ts +5 -0
- package/components/LinkButton/LinkButton.utils.d.ts +4 -5
- package/components/RadioGroup/RadioGroup.d.ts +13 -0
- package/components/Scroller/Scroller.d.ts +6 -2
- package/components/Select/Select.d.ts +13 -0
- package/components/Select/Select.utils.d.ts +2 -2
- package/components/Slider/Slider.d.ts +13 -0
- package/components/Stepper/Step.d.ts +33 -0
- package/components/Stepper/Step.utils.d.ts +5 -0
- package/components/Stepper/Stepper.d.ts +56 -0
- package/components/Stepper/Stepper.test.d.ts +1 -0
- package/components/Stepper/Stepper.utils.d.ts +30 -0
- package/components/Stepper/Stepper.utils.test.d.ts +1 -0
- package/components/Textarea/Textarea.d.ts +13 -0
- package/components/Textarea/Textarea.utils.d.ts +2 -2
- package/customreactselect.BgYf8rKE.js +15 -0
- package/dialog.Bq-ZyzR8.js +9 -0
- package/drawer.DL5UzLWf.js +9 -0
- package/fieldset.BFLW2D9H.js +12 -0
- package/{filelist.BiKMKCyg.js → filelist.BG6SGVJ8.js} +23 -24
- package/{flag.72PONA83.js → flag.CE32qHPa.js} +3 -3
- package/{floatingactionbutton.B2YChsNU.js → floatingactionbutton.B5hJ2At2.js} +5 -5
- package/header.A77yIAH3.js +12 -0
- package/{heading.BXFBZhKv.js → heading.DHLpT4dc.js} +2 -2
- package/icon.vzkPwgjZ.js +9 -0
- package/index.d.ts +4 -2
- package/index.es.js +218 -206
- package/input.hBWqQr3X.js +190 -0
- package/inputfile.BSZuRujU.js +18 -0
- package/inputnumber.CA4JiUmq.js +17 -0
- package/inputnumber.d.ts +2 -0
- package/inputpassword.Cju_crMi.js +13 -0
- package/inputsearch.CU9AhVVv.js +15 -0
- package/{link.DbnvsD3j.js → link.DoiK003-.js} +5 -5
- package/linkbutton.CWco_B7v.js +12 -0
- package/{logo.C96KaG1P.js → logo.DprmD8HU.js} +3 -3
- package/{logo100years.BcB6_c-o.js → logo100years.DDzCrczW.js} +11 -11
- package/megamenu.BurL9MfF.js +12 -0
- package/navigationtablist.CkkLyHrM.js +10 -0
- package/navigationtabs.zhRZHjgs.js +9 -0
- package/notification.BiXdWNo7.js +10 -0
- package/{numberindicator.Ddf3ESi7.js → numberindicator.BdnPMogE.js} +2 -2
- package/{optioncheckbox.DqfXuPdi.js → optioncheckbox.nBVwGv6c.js} +3 -3
- package/package.json +42 -50
- package/partials/index.js +54 -48
- package/partials/lib/partials.d.ts +1 -1
- package/popover.79Voiadz.js +12 -0
- package/{radio.7_N_alaS.js → radio.DHUfSPai.js} +2 -2
- package/radiogroup.CwBh7u9L.js +11 -0
- package/scroller.IpfbFV8B.js +98 -0
- package/select.NHaEtX_u.js +14 -0
- package/{skiptocontent.BSCde5hT.js → skiptocontent.X4USTODk.js} +4 -4
- package/slider.jnNGEyBq.js +12 -0
- package/{spinner.BUjhjAvw.js → spinner.C9qCeq0R.js} +18 -18
- package/step.D5p7qppy.js +82 -0
- package/step.d.ts +6 -0
- package/stepper.DnMc4ex6.js +16 -0
- package/stepper.d.ts +2 -0
- package/styles/scss/ds/lib/ds-internal/_input.scss +12 -3
- package/styles/scss/ds/lib/ds-internal/_link-button.scss +10 -2
- package/styles/scss/ds/lib/link-button.scss +11 -3
- package/{switch.D7BCfyyZ.js → switch.Bqdyzi2E.js} +5 -5
- package/systemfeedback.O7tj1juR.js +10 -0
- package/tablist.BFE6RAPD.js +209 -0
- package/{tabpane.CB-eudyw.js → tabpane.C4nsUlwc.js} +2 -2
- package/tabs.CsOxxQyQ.js +11 -0
- package/text.cLv2PhjQ.js +10 -0
- package/textarea.C9OAAjhG.js +14 -0
- package/{title.Bz_k5Vda.js → title.DuLPB-VK.js} +2 -2
- package/toast.OBI9qnAM.js +11 -0
- package/toastmanager.CgsA-1y_.js +89 -0
- package/tooltip.Cj3AvYgB.js +177 -0
- package/topbar.CAujTZAE.js +12 -0
- package/types/icon-types.d.ts +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/mergeRefs.d.ts +5 -0
- package/utils/mergeRefs.test.d.ts +1 -0
- package/utils/useIsomorphicLayoutEffect.d.ts +2 -2
- package/accordion.HfUSDwQJ.js +0 -12
- package/actionbutton.kgd0E_xF.js +0 -12
- package/actionlink.CwC42RWc.js +0 -12
- package/assets/Accordion.BJb4TOG0.css +0 -1
- package/assets/Button.Dw8H5nFS.css +0 -1
- package/assets/Checkbox.BKHQN_tu.css +0 -1
- package/assets/CustomReactSelect.DGIItWIh.css +0 -1
- package/assets/Dialog.CGAg7bnN.css +0 -1
- package/assets/Drawer.VOvWQoEr.css +0 -1
- package/assets/Fieldset.CW9dBvAo.css +0 -1
- package/assets/InputFile.CCQxsulT.css +0 -1
- package/assets/InputPassword.124xVOiO.css +0 -1
- package/assets/InputSearch.Bkg-1urJ.css +0 -1
- package/assets/InputStepper.DvFJk1Mi.css +0 -1
- package/assets/LinkButton.xMvg_ojf.css +0 -1
- package/assets/Notification.BOuaA5GT.css +0 -1
- package/assets/Select.C1gWF32A.css +0 -1
- package/assets/Slider.Bidyhb-B.css +0 -1
- package/assets/Textarea.Dq4rH9Tg.css +0 -1
- package/assets/Toast.CJ1zhDIT.css +0 -1
- package/assets/buttonround.Cw9hnUan.css +0 -1
- package/assets/input.CUjGh-UM.css +0 -1
- package/assets/switch.Bc9KIyw9.css +0 -1
- package/breadcrumb.BsQm0kUD.js +0 -11
- package/button.Dyy6ajX6.js +0 -13
- package/buttonround.ChKWHzsv.js +0 -96
- package/checkbox.BNnp4ztM.js +0 -12
- package/checkboxgroup.BTVnKenc.js +0 -9
- package/chip.C7NstOHt.js +0 -12
- package/chipgroup.Zo1-IOCn.js +0 -210
- package/chunks/Accordion.CnqryAUu.js +0 -170
- package/chunks/Button.Cf1CKq8N.js +0 -142
- package/chunks/Checkbox.CiwriItT.js +0 -88
- package/chunks/CheckboxGroup.Cj68J6Ee.js +0 -72
- package/chunks/Dialog.Bv7k55He.js +0 -135
- package/chunks/Drawer.BVTvx276.js +0 -140
- package/chunks/Fieldset.D7cLR5ze.js +0 -74
- package/chunks/Header.um5MlziB.js +0 -377
- package/chunks/InputFile.bVWWdePn.js +0 -220
- package/chunks/InputPassword.Da3hEKTc.js +0 -136
- package/chunks/InputSearch.GOYqFCcZ.js +0 -174
- package/chunks/InputStepper.BuhPtfl-.js +0 -268
- package/chunks/LinkButton.59oNDwPU.js +0 -132
- package/chunks/MegaMenu._o3nNDAa.js +0 -192
- package/chunks/NavigationTabList.DuT7gzhj.js +0 -57
- package/chunks/Notification.Pts2oh0R.js +0 -92
- package/chunks/Popover.BRR8YZ-P.js +0 -228
- package/chunks/RadioGroup.DeTz3c19.js +0 -104
- package/chunks/Select.D2ehd4yN.js +0 -162
- package/chunks/Slider.84lkgq3W.js +0 -292
- package/chunks/Tabs.C8ADTzJ0.js +0 -83
- package/chunks/Textarea.Cw85sxHL.js +0 -163
- package/chunks/Toast.DG3WVvau.js +0 -76
- package/chunks/file-type-doc.DlovDOBh.js +0 -10
- package/chunks/floating-ui.dom.VgHc0h4l.js +0 -989
- package/chunks/floating-ui.react.DCyAzlZ4.js +0 -2011
- package/chunks/helpers.BbWkXTr3.js +0 -37
- package/chunks/petrol.Du6qAgp0.js +0 -10
- package/chunks/upload.ZImTAIgx.js +0 -10
- package/chunks/useBreakpoint.CMOR9ZOB.js +0 -44
- package/combobox.orZ3z8CB.js +0 -60
- package/components/InputStepper/InputStepper.utils.d.ts +0 -13
- package/customreactselect.Np-RpzvU.js +0 -14
- package/dialog.D4rcbW6A.js +0 -10
- package/drawer.BCCB3Rkj.js +0 -10
- package/fieldset.ZLs9IGpE.js +0 -11
- package/header.DUbn3BZt.js +0 -12
- package/icon.CHVAZr5T.js +0 -9
- package/input.DG20x6gh.js +0 -203
- package/inputfile.Dc56lQ4t.js +0 -17
- package/inputpassword.znFHRLsI.js +0 -13
- package/inputsearch.B1G6rfVk.js +0 -14
- package/inputstepper.d.ts +0 -2
- package/inputstepper.o6rdM_CW.js +0 -16
- package/linkbutton.DU8Ih8ZF.js +0 -12
- package/megamenu.CPH8EeFF.js +0 -12
- package/navigationtablist.C0iwsAad.js +0 -9
- package/navigationtabs.JjJtbuUe.js +0 -9
- package/notification.Ds_Q7ifk.js +0 -10
- package/popover.B72W0OvU.js +0 -12
- package/radiogroup.C_3IcNBq.js +0 -11
- package/scroller.CQxmQU6U.js +0 -123
- package/select.Ceyt-zvu.js +0 -13
- package/slider.Dq2dcziy.js +0 -11
- package/systemfeedback.CSdWOWuf.js +0 -10
- package/tablist.V7DBklhE.js +0 -256
- package/tabs.DQNLPAEN.js +0 -11
- package/text.ZOUuesnU.js +0 -10
- package/textarea.CixKeQBp.js +0 -13
- package/toast.D8QprMCa.js +0 -11
- package/toastmanager.BSVjYsg9.js +0 -116
- package/tooltip.CUCSRXd3.js +0 -191
- package/topbar.CVhJy-Br.js +0 -12
- /package/components/{InputStepper/InputStepper.test.d.ts → InputNumber/InputNumber.test.d.ts} +0 -0
- /package/components/{InputStepper/InputStepper.utils.test.d.ts → InputNumber/InputNumber.utils.test.d.ts} +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as H, jsxs as F } from "react/jsx-runtime";
|
|
3
|
+
import { d as R } from "./index.D-sRdssb.js";
|
|
4
|
+
import { c as k } from "./index.DL9mof6u.js";
|
|
5
|
+
import { D as W } from "./Button.Cn5yg7dG.js";
|
|
6
|
+
import { D as j } from "./Icon.CDLyB7Pv.js";
|
|
7
|
+
import '../assets/Notification.CvohYEvT.css';const y = "ds-notification_root_trmu0_1", L = "ds-notification_root--success_trmu0_29", P = "ds-notification_root--error_trmu0_33", V = "ds-notification_root--warning_trmu0_37", z = "ds-notification_root--hide-icon_trmu0_41", Y = "ds-notification_content_trmu0_55", $ = "ds-notification_content--hide-close-button_trmu0_62", q = "ds-notification_content--hide-icon_trmu0_65", G = "ds-notification_icon_trmu0_69", J = "ds-notification_message_trmu0_73", K = "ds-notification_custom-action-area_trmu0_170", e = {
|
|
8
|
+
root: y,
|
|
9
|
+
rootSuccess: L,
|
|
10
|
+
rootError: P,
|
|
11
|
+
rootWarning: V,
|
|
12
|
+
rootHideIcon: z,
|
|
13
|
+
content: Y,
|
|
14
|
+
contentHideCloseButton: $,
|
|
15
|
+
contentHideIcon: q,
|
|
16
|
+
icon: G,
|
|
17
|
+
message: J,
|
|
18
|
+
customActionArea: K
|
|
19
|
+
}, et = ["success", "error", "warning", "info"], M = {
|
|
20
|
+
success: "circle-check-colored",
|
|
21
|
+
error: "diamond-exclamationmark-colored",
|
|
22
|
+
warning: "triangle-exclamationmark-colored",
|
|
23
|
+
info: "circle-info-colored"
|
|
24
|
+
}, Q = {
|
|
25
|
+
error: "alert",
|
|
26
|
+
warning: "alert",
|
|
27
|
+
info: "status",
|
|
28
|
+
success: "status"
|
|
29
|
+
}, nt = (S) => {
|
|
30
|
+
const t = R.c(46);
|
|
31
|
+
let i, r, a, s, n, l, h, A;
|
|
32
|
+
t[0] !== S ? ({
|
|
33
|
+
children: i,
|
|
34
|
+
variant: h,
|
|
35
|
+
className: r,
|
|
36
|
+
closeButtonProps: a,
|
|
37
|
+
customActionArea: s,
|
|
38
|
+
hideIcon: A,
|
|
39
|
+
onClose: n,
|
|
40
|
+
...l
|
|
41
|
+
} = S, t[0] = S, t[1] = i, t[2] = r, t[3] = a, t[4] = s, t[5] = n, t[6] = l, t[7] = h, t[8] = A) : (i = t[1], r = t[2], a = t[3], s = t[4], n = t[5], l = t[6], h = t[7], A = t[8]);
|
|
42
|
+
const c = h === void 0 ? "info" : h, o = A === void 0 ? !1 : A;
|
|
43
|
+
let d;
|
|
44
|
+
t[9] !== a ? (d = a || {}, t[9] = a, t[10] = d) : d = t[10];
|
|
45
|
+
let m, g;
|
|
46
|
+
t[11] !== d ? ({
|
|
47
|
+
label: g,
|
|
48
|
+
...m
|
|
49
|
+
} = d, t[11] = d, t[12] = m, t[13] = g) : (m = t[12], g = t[13]);
|
|
50
|
+
const O = g === void 0 ? "Close notification" : g, T = c === "success", x = c === "error", B = c === "warning";
|
|
51
|
+
let C;
|
|
52
|
+
t[14] !== r || t[15] !== o || t[16] !== T || t[17] !== x || t[18] !== B ? (C = k(e.root, r, {
|
|
53
|
+
[e.rootSuccess]: T,
|
|
54
|
+
[e.rootError]: x,
|
|
55
|
+
[e.rootWarning]: B,
|
|
56
|
+
[e.rootHideIcon]: o
|
|
57
|
+
}), t[14] = r, t[15] = o, t[16] = T, t[17] = x, t[18] = B, t[19] = C) : C = t[19];
|
|
58
|
+
const D = C, b = !n;
|
|
59
|
+
let p;
|
|
60
|
+
t[20] !== o || t[21] !== b ? (p = k(e.content, {
|
|
61
|
+
[e.contentHideCloseButton]: b,
|
|
62
|
+
[e.contentHideIcon]: o
|
|
63
|
+
}), t[20] = o, t[21] = b, t[22] = p) : p = t[22];
|
|
64
|
+
const w = p, E = Q[c];
|
|
65
|
+
let u;
|
|
66
|
+
t[23] !== o || t[24] !== c ? (u = !o && /* @__PURE__ */ H(j, { name: M[c], className: e.icon, "aria-hidden": "true" }), t[23] = o, t[24] = c, t[25] = u) : u = t[25];
|
|
67
|
+
let _;
|
|
68
|
+
t[26] !== i ? (_ = /* @__PURE__ */ H("div", { className: e.message, children: i }), t[26] = i, t[27] = _) : _ = t[27];
|
|
69
|
+
let f;
|
|
70
|
+
t[28] !== O || t[29] !== n || t[30] !== m ? (f = n && /* @__PURE__ */ H(W, { ...m, hideLabel: !0, iconName: "cross", isFlush: !0, variant: "ghost", size: "small", onClick: n, type: "button", children: O }), t[28] = O, t[29] = n, t[30] = m, t[31] = f) : f = t[31];
|
|
71
|
+
let I;
|
|
72
|
+
t[32] !== w || t[33] !== u || t[34] !== _ || t[35] !== f ? (I = /* @__PURE__ */ F("div", { className: w, children: [
|
|
73
|
+
u,
|
|
74
|
+
_,
|
|
75
|
+
f
|
|
76
|
+
] }), t[32] = w, t[33] = u, t[34] = _, t[35] = f, t[36] = I) : I = t[36];
|
|
77
|
+
let N;
|
|
78
|
+
t[37] !== s || t[38] !== o ? (N = s && /* @__PURE__ */ H("div", { className: k({
|
|
79
|
+
[e.customActionArea]: !o
|
|
80
|
+
}), children: s }), t[37] = s, t[38] = o, t[39] = N) : N = t[39];
|
|
81
|
+
let v;
|
|
82
|
+
return t[40] !== l || t[41] !== D || t[42] !== E || t[43] !== I || t[44] !== N ? (v = /* @__PURE__ */ F("div", { className: D, ...l, role: E, children: [
|
|
83
|
+
I,
|
|
84
|
+
N
|
|
85
|
+
] }), t[40] = l, t[41] = D, t[42] = E, t[43] = I, t[44] = N, t[45] = v) : v = t[45], v;
|
|
86
|
+
};
|
|
87
|
+
export {
|
|
88
|
+
nt as D,
|
|
89
|
+
et as N,
|
|
90
|
+
M as a
|
|
91
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m, jsxs as O, Fragment as q } from "react/jsx-runtime";
|
|
3
|
+
import { d as H } from "./index.D-sRdssb.js";
|
|
4
|
+
import { useState as J, useRef as K, useMemo as Q, createContext as X, forwardRef as I, isValidElement as Y, cloneElement as Z, useContext as ee } from "react";
|
|
5
|
+
import { u as oe, o as te, j as re, s as se, k as ne, a as ae, b as ce, c as ie, d as le, e as pe, f as j, g as de, l as ue, F as he, i as ve } from "./floating-ui.react.COTL3jH5.js";
|
|
6
|
+
import { c as k } from "./index.DL9mof6u.js";
|
|
7
|
+
import { g as b, c as M } from "./helpers.CexwVao7.js";
|
|
8
|
+
import { D as fe } from "./Button.Cn5yg7dG.js";
|
|
9
|
+
import '../assets/Popover.CXyUaXiO.css';const me = "ds-popover_popover_xg81f_5", ge = "ds-popover_popover--no-arrow_xg81f_64", we = "ds-popover_popover--variant-grey_xg81f_67", Pe = "ds-popover_arrow_xg81f_71", De = "ds-popover_arrow--variant-grey_xg81f_90", Se = "ds-popover_default-anchor_xg81f_107", _ = {
|
|
10
|
+
popover: me,
|
|
11
|
+
popoverNoArrow: ge,
|
|
12
|
+
popoverVariantGrey: we,
|
|
13
|
+
arrow: Pe,
|
|
14
|
+
arrowVariantGrey: De,
|
|
15
|
+
defaultAnchor: Se
|
|
16
|
+
}, Ae = ({
|
|
17
|
+
initialOpen: t = !1,
|
|
18
|
+
placement: o = "bottom",
|
|
19
|
+
isOpen: e,
|
|
20
|
+
popoverOffset: r = 6,
|
|
21
|
+
showArrow: a = !0,
|
|
22
|
+
variant: l = "default",
|
|
23
|
+
defaultAnchorButtonProps: p,
|
|
24
|
+
onOpenChange: d
|
|
25
|
+
} = {}) => {
|
|
26
|
+
const [s, h] = J(t), c = e ?? s, n = d ?? h, i = K(null), u = oe({
|
|
27
|
+
placement: o,
|
|
28
|
+
open: c,
|
|
29
|
+
strategy: "fixed",
|
|
30
|
+
onOpenChange: n,
|
|
31
|
+
whileElementsMounted: ae,
|
|
32
|
+
middleware: [te(r + (a ? 7 : 0)), re({
|
|
33
|
+
// default configuration taken from https://floating-ui.com/docs/flip
|
|
34
|
+
crossAxis: o.includes("-"),
|
|
35
|
+
fallbackAxisSideDirection: "end",
|
|
36
|
+
padding: r
|
|
37
|
+
}), se({
|
|
38
|
+
padding: r
|
|
39
|
+
}), ...a ? [ne({
|
|
40
|
+
element: i
|
|
41
|
+
})] : []]
|
|
42
|
+
}), v = u.context, C = ce(v, {
|
|
43
|
+
enabled: !0
|
|
44
|
+
}), w = ie(v), E = le(v), P = pe([C, w, E]);
|
|
45
|
+
return Q(() => ({
|
|
46
|
+
open: c,
|
|
47
|
+
popoverOffset: r,
|
|
48
|
+
setOpen: n,
|
|
49
|
+
arrowRef: i,
|
|
50
|
+
showArrow: a,
|
|
51
|
+
defaultAnchorButtonProps: p,
|
|
52
|
+
variant: l,
|
|
53
|
+
...P,
|
|
54
|
+
...u
|
|
55
|
+
}), [c, r, n, i, a, p, l, P, u]);
|
|
56
|
+
}, xe = ({
|
|
57
|
+
children: t,
|
|
58
|
+
hasContent: o,
|
|
59
|
+
hasAnchor: e
|
|
60
|
+
}) => {
|
|
61
|
+
if (!t)
|
|
62
|
+
throw new Error(b("DSPopover", "A DSPopover must have children."));
|
|
63
|
+
if (!o && e)
|
|
64
|
+
throw new Error(b("DSPopover", "A DSPopover must either have no child components for its most basic usage or have both a <DSPopover.Content> and <DSPopover.Anchor> component as a child. <DSPopover.Content> is missing! Please add it to the children of DSPopover."));
|
|
65
|
+
if (!e && o)
|
|
66
|
+
throw new Error(b("DSPopover", "A DSPopover must either have no child components for its most basic usage or have both a <DSPopover.Content> and <DSPopover.Anchor> component as a child. <DSPopover.Anchor> is missing! Please add it to the children of DSPopover."));
|
|
67
|
+
}, ye = ({
|
|
68
|
+
showArrow: t,
|
|
69
|
+
variant: o
|
|
70
|
+
}) => {
|
|
71
|
+
o === "grey" && t === !1 && console.warn(b("DSPopover", "The 'grey' variant is only available when 'showArrow' is true. To use the 'grey' variant, please ensure that 'showArrow' is set to true."));
|
|
72
|
+
}, B = X(null), U = () => {
|
|
73
|
+
const t = ee(B);
|
|
74
|
+
if (t == null)
|
|
75
|
+
throw new Error(b("DSPopover", "Components like DSPopover.Anchor or DSPopover.Content must be wrapped in <DSPopover />."));
|
|
76
|
+
return t;
|
|
77
|
+
}, f = (t) => {
|
|
78
|
+
const o = H.c(11), {
|
|
79
|
+
children: e,
|
|
80
|
+
...r
|
|
81
|
+
} = t, a = Ae({
|
|
82
|
+
...r
|
|
83
|
+
}), l = M(e, f.Content), p = M(e, f.Anchor);
|
|
84
|
+
process.env.NODE_ENV !== "production" && (xe({
|
|
85
|
+
children: e,
|
|
86
|
+
hasContent: l,
|
|
87
|
+
hasAnchor: p
|
|
88
|
+
}), ye({
|
|
89
|
+
showArrow: r.showArrow,
|
|
90
|
+
variant: r.variant
|
|
91
|
+
}));
|
|
92
|
+
const d = !l && !p && e !== null;
|
|
93
|
+
let s;
|
|
94
|
+
o[0] !== e || o[1] !== d ? (s = d ? /* @__PURE__ */ O(q, { children: [
|
|
95
|
+
/* @__PURE__ */ m(f.Anchor, {}),
|
|
96
|
+
/* @__PURE__ */ m(f.Content, { children: e })
|
|
97
|
+
] }) : e, o[0] = e, o[1] = d, o[2] = s) : s = o[2];
|
|
98
|
+
const h = s, c = l || d, n = p || d;
|
|
99
|
+
let i;
|
|
100
|
+
o[3] !== a || o[4] !== c || o[5] !== n ? (i = {
|
|
101
|
+
...a,
|
|
102
|
+
hasContent: c,
|
|
103
|
+
hasAnchor: n
|
|
104
|
+
}, o[3] = a, o[4] = c, o[5] = n, o[6] = i) : i = o[6];
|
|
105
|
+
const g = i;
|
|
106
|
+
let u;
|
|
107
|
+
return o[7] !== h || o[8] !== g || o[9] !== r ? (u = /* @__PURE__ */ m(B.Provider, { value: g, ...r, children: h }), o[7] = h, o[8] = g, o[9] = r, o[10] = u) : u = o[10], u;
|
|
108
|
+
}, W = I(({
|
|
109
|
+
children: t,
|
|
110
|
+
...o
|
|
111
|
+
}, e) => {
|
|
112
|
+
const {
|
|
113
|
+
context: r,
|
|
114
|
+
defaultAnchorButtonProps: a,
|
|
115
|
+
refs: l,
|
|
116
|
+
hasAnchor: p,
|
|
117
|
+
getReferenceProps: d
|
|
118
|
+
} = U(), {
|
|
119
|
+
label: s = "Toggle popover",
|
|
120
|
+
...h
|
|
121
|
+
} = a || {}, c = t ? t?.ref : null, n = j([l.setReference, e, c]);
|
|
122
|
+
return p && t && Y(t) ? Z(t, d({
|
|
123
|
+
ref: n,
|
|
124
|
+
...o,
|
|
125
|
+
...t.props,
|
|
126
|
+
"data-state": r.open ? "open" : "closed"
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
128
|
+
})) : /* @__PURE__ */ m(
|
|
129
|
+
fe,
|
|
130
|
+
{
|
|
131
|
+
...h,
|
|
132
|
+
ref: n,
|
|
133
|
+
type: "button",
|
|
134
|
+
"data-state": r.open ? "open" : "closed",
|
|
135
|
+
...d(o),
|
|
136
|
+
size: "small",
|
|
137
|
+
hideLabel: !0,
|
|
138
|
+
iconName: "circle-info-inverted",
|
|
139
|
+
variant: "ghost",
|
|
140
|
+
className: _.defaultAnchor,
|
|
141
|
+
children: t ?? s
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
});
|
|
145
|
+
W.displayName = "DSPopover.Anchor";
|
|
146
|
+
const $ = I((t, o) => {
|
|
147
|
+
const e = H.c(33), {
|
|
148
|
+
style: r,
|
|
149
|
+
className: a,
|
|
150
|
+
classNameArrow: l,
|
|
151
|
+
children: p,
|
|
152
|
+
...d
|
|
153
|
+
} = t, {
|
|
154
|
+
context: s,
|
|
155
|
+
refs: h,
|
|
156
|
+
floatingStyles: c,
|
|
157
|
+
showArrow: n,
|
|
158
|
+
variant: i,
|
|
159
|
+
getFloatingProps: g,
|
|
160
|
+
arrowRef: u
|
|
161
|
+
} = U();
|
|
162
|
+
let v;
|
|
163
|
+
e[0] !== o || e[1] !== h.setFloating ? (v = [h.setFloating, o], e[0] = o, e[1] = h.setFloating, e[2] = v) : v = e[2];
|
|
164
|
+
const C = j(v);
|
|
165
|
+
let w;
|
|
166
|
+
e[3] === Symbol.for("react.memo_cache_sentinel") ? (w = {
|
|
167
|
+
duration: {
|
|
168
|
+
open: 250,
|
|
169
|
+
close: 250
|
|
170
|
+
}
|
|
171
|
+
}, e[3] = w) : w = e[3];
|
|
172
|
+
const {
|
|
173
|
+
isMounted: E,
|
|
174
|
+
status: P
|
|
175
|
+
} = de(s, w);
|
|
176
|
+
if (!E)
|
|
177
|
+
return null;
|
|
178
|
+
const R = ve, F = he, L = !1;
|
|
179
|
+
let D;
|
|
180
|
+
e[4] !== c || e[5] !== r ? (D = {
|
|
181
|
+
...c,
|
|
182
|
+
...r
|
|
183
|
+
}, e[4] = c, e[5] = r, e[6] = D) : D = e[6];
|
|
184
|
+
const V = !n, G = i === "grey" && n;
|
|
185
|
+
let S;
|
|
186
|
+
e[7] !== a || e[8] !== V || e[9] !== G ? (S = k(_.popover, a, {
|
|
187
|
+
[_.popoverNoArrow]: V,
|
|
188
|
+
[_.popoverVariantGrey]: G
|
|
189
|
+
}), e[7] = a, e[8] = V, e[9] = G, e[10] = S) : S = e[10];
|
|
190
|
+
const z = s.placement, T = g(d);
|
|
191
|
+
let A;
|
|
192
|
+
e[11] !== u || e[12] !== l || e[13] !== s || e[14] !== n || e[15] !== i ? (A = n && /* @__PURE__ */ m(ue, { ref: u, context: s, className: k(_.arrow, l, {
|
|
193
|
+
[_.arrowVariantGrey]: i === "grey" && n
|
|
194
|
+
}), strokeWidth: 1, tipRadius: 1, width: 16, height: 7 }), e[11] = u, e[12] = l, e[13] = s, e[14] = n, e[15] = i, e[16] = A) : A = e[16];
|
|
195
|
+
let x;
|
|
196
|
+
e[17] !== p || e[18] !== s.placement || e[19] !== C || e[20] !== P || e[21] !== A || e[22] !== D || e[23] !== S || e[24] !== T ? (x = /* @__PURE__ */ O("div", { ref: C, style: D, className: S, "data-placement": z, "data-status": P, ...T, children: [
|
|
197
|
+
A,
|
|
198
|
+
p
|
|
199
|
+
] }), e[17] = p, e[18] = s.placement, e[19] = C, e[20] = P, e[21] = A, e[22] = D, e[23] = S, e[24] = T, e[25] = x) : x = e[25];
|
|
200
|
+
let y;
|
|
201
|
+
e[26] !== F || e[27] !== s || e[28] !== x ? (y = /* @__PURE__ */ m(F, { context: s, modal: L, children: x }), e[26] = F, e[27] = s, e[28] = x, e[29] = y) : y = e[29];
|
|
202
|
+
let N;
|
|
203
|
+
return e[30] !== R || e[31] !== y ? (N = /* @__PURE__ */ m(R, { children: y }), e[30] = R, e[31] = y, e[32] = N) : N = e[32], N;
|
|
204
|
+
});
|
|
205
|
+
$.displayName = "DSPopover.Content";
|
|
206
|
+
f.Anchor = W;
|
|
207
|
+
f.Content = $;
|
|
208
|
+
f.displayName = "DSPopover";
|
|
209
|
+
export {
|
|
210
|
+
f as D,
|
|
211
|
+
ye as a,
|
|
212
|
+
Ae as u,
|
|
213
|
+
xe as v
|
|
214
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as V } from "react/jsx-runtime";
|
|
3
|
+
import { d as K } from "./index.D-sRdssb.js";
|
|
4
|
+
import { c as Q } from "./index.DL9mof6u.js";
|
|
5
|
+
import { forwardRef as W, useState as X } from "react";
|
|
6
|
+
import { D as Y } from "./Fieldset.C0RzpI-h.js";
|
|
7
|
+
import { DSRadio as Z } from "../radio.DHUfSPai.js";
|
|
8
|
+
import { g as m, r as M } from "./helpers.CexwVao7.js";
|
|
9
|
+
import '../assets/RadioGroup.CM2mYOzc.css';const oo = "ds-radio-group_root_12fot_1", eo = "ds-radio-group_root--horizontal_12fot_9", to = "ds-radio-group_root--invalid_12fot_12", O = {
|
|
10
|
+
root: oo,
|
|
11
|
+
rootHorizontal: eo,
|
|
12
|
+
rootInvalid: to
|
|
13
|
+
}, j = (i) => i.some(({
|
|
14
|
+
hint: s
|
|
15
|
+
}) => !!s), T = (i) => i.some(({
|
|
16
|
+
customArea: s,
|
|
17
|
+
isCustomAreaAbove: o
|
|
18
|
+
}) => !!s && !o), ro = ({
|
|
19
|
+
legend: i,
|
|
20
|
+
name: s,
|
|
21
|
+
options: o,
|
|
22
|
+
description: l,
|
|
23
|
+
direction: c,
|
|
24
|
+
id: a,
|
|
25
|
+
systemFeedback: e
|
|
26
|
+
}) => {
|
|
27
|
+
if (!a && (l || e))
|
|
28
|
+
throw new Error(m("DSRadioGroup", 'A unique "id" prop is required when providing the description or systemFeedback property. Please add a unique "id" prop to the DSRadioGroup component.'));
|
|
29
|
+
if (!i)
|
|
30
|
+
throw new Error(m("DSRadioGroup", M("legend", "DSRadioGroup")));
|
|
31
|
+
if (!s)
|
|
32
|
+
throw new Error(m("DSRadioGroup", M("name", "DSRadioGroup")));
|
|
33
|
+
if (Array.isArray(o)) {
|
|
34
|
+
if (o.length === 0)
|
|
35
|
+
throw new Error(m("DSRadioGroup", "The options array must not be empty."));
|
|
36
|
+
} else throw new Error(m("DSRadioGroup", M("options", "DSRadioGroup")));
|
|
37
|
+
if (c === "horizontal" && j(o))
|
|
38
|
+
throw new Error(m("DSRadioGroup", "Horizontal direction is not possible when options contain a hint. Please remove hints or change direction property to 'vertical'."));
|
|
39
|
+
if (c === "horizontal" && T(o))
|
|
40
|
+
throw new Error(m("DSRadioGroup", "Horizontal direction is not possible when options contain a custom area without isCustomAreaAbove set to true. Please remove custom areas, change direction property to 'vertical' or set isCustomAreaAbove to true."));
|
|
41
|
+
}, io = W((i, s) => {
|
|
42
|
+
const o = K.c(57);
|
|
43
|
+
let l, c, a, e, u, p, h, t, v, D, w, d, b, y, H, E, _, z;
|
|
44
|
+
o[0] !== i ? ({
|
|
45
|
+
legend: u,
|
|
46
|
+
name: p,
|
|
47
|
+
options: t,
|
|
48
|
+
className: l,
|
|
49
|
+
defaultValue: c,
|
|
50
|
+
description: a,
|
|
51
|
+
direction: b,
|
|
52
|
+
disabled: y,
|
|
53
|
+
hideUncheckedHints: H,
|
|
54
|
+
id: e,
|
|
55
|
+
invalid: E,
|
|
56
|
+
popoverContent: v,
|
|
57
|
+
popoverInfoButtonProps: D,
|
|
58
|
+
required: _,
|
|
59
|
+
systemFeedback: d,
|
|
60
|
+
value: z,
|
|
61
|
+
onChange: h,
|
|
62
|
+
...w
|
|
63
|
+
} = i, o[0] = i, o[1] = l, o[2] = c, o[3] = a, o[4] = e, o[5] = u, o[6] = p, o[7] = h, o[8] = t, o[9] = v, o[10] = D, o[11] = w, o[12] = d, o[13] = b, o[14] = y, o[15] = H, o[16] = E, o[17] = _, o[18] = z) : (l = o[1], c = o[2], a = o[3], e = o[4], u = o[5], p = o[6], h = o[7], t = o[8], v = o[9], D = o[10], w = o[11], d = o[12], b = o[13], y = o[14], H = o[15], E = o[16], _ = o[17], z = o[18]);
|
|
64
|
+
const L = b === void 0 ? "vertical" : b, n = y === void 0 ? !1 : y, S = H === void 0 ? !1 : H, f = E === void 0 ? !1 : E, g = _ === void 0 ? !1 : _;
|
|
65
|
+
process.env.NODE_ENV !== "production" && ro({
|
|
66
|
+
legend: u,
|
|
67
|
+
name: p,
|
|
68
|
+
options: t,
|
|
69
|
+
description: a,
|
|
70
|
+
direction: L,
|
|
71
|
+
id: e,
|
|
72
|
+
systemFeedback: d
|
|
73
|
+
});
|
|
74
|
+
const [$, J] = X(c), C = z !== void 0, A = C ? z : $, P = L === "horizontal" && !j(t) && !T(t), U = f && !!d;
|
|
75
|
+
let k;
|
|
76
|
+
o[19] !== P || o[20] !== U ? (k = Q(O.root, {
|
|
77
|
+
[O.rootHorizontal]: P,
|
|
78
|
+
[O.rootInvalid]: U
|
|
79
|
+
}), o[19] = P, o[20] = U, o[21] = k) : k = o[21];
|
|
80
|
+
const x = k;
|
|
81
|
+
let q;
|
|
82
|
+
o[22] !== n || o[23] !== C || o[24] !== h ? (q = (r) => {
|
|
83
|
+
if (n) {
|
|
84
|
+
r.preventDefault();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
C || J(r.target.value), h && h(r);
|
|
88
|
+
}, o[22] = n, o[23] = C, o[24] = h, o[25] = q) : q = o[25];
|
|
89
|
+
const B = q;
|
|
90
|
+
let I;
|
|
91
|
+
o[26] !== S || o[27] !== t ? (I = j(t) && !S, o[26] = S, o[27] = t, o[28] = I) : I = o[28];
|
|
92
|
+
const F = I;
|
|
93
|
+
let G;
|
|
94
|
+
o[29] !== F || o[30] !== A || o[31] !== n || o[32] !== S || o[33] !== e || o[34] !== f || o[35] !== p || o[36] !== t || o[37] !== s || o[38] !== g ? (G = t.map((r) => /* @__PURE__ */ V(Z, { name: p, checked: r.value === A, disabled: n, fieldsetId: e, hideUncheckedHint: S, hint: r.hint, invalid: f, isBold: F, required: g, ref: r.value === A ? s : null, ...r }, e + r.label + r.value + r.hint)), o[29] = F, o[30] = A, o[31] = n, o[32] = S, o[33] = e, o[34] = f, o[35] = p, o[36] = t, o[37] = s, o[38] = g, o[39] = G) : G = o[39];
|
|
95
|
+
let R;
|
|
96
|
+
o[40] !== x || o[41] !== G ? (R = /* @__PURE__ */ V("div", { className: x, children: G }), o[40] = x, o[41] = G, o[42] = R) : R = o[42];
|
|
97
|
+
let N;
|
|
98
|
+
return o[43] !== l || o[44] !== a || o[45] !== n || o[46] !== B || o[47] !== e || o[48] !== f || o[49] !== u || o[50] !== v || o[51] !== D || o[52] !== g || o[53] !== w || o[54] !== d || o[55] !== R ? (N = /* @__PURE__ */ V(Y, { id: e, legend: u, className: l, description: a, disabled: n, required: g, invalid: f, systemFeedback: d, popoverContent: v, popoverInfoButtonProps: D, ...w, role: "radiogroup", onChange: B, children: R }), o[43] = l, o[44] = a, o[45] = n, o[46] = B, o[47] = e, o[48] = f, o[49] = u, o[50] = v, o[51] = D, o[52] = g, o[53] = w, o[54] = d, o[55] = R, o[56] = N) : N = o[56], N;
|
|
99
|
+
});
|
|
100
|
+
io.displayName = "DSRadioGroup";
|
|
101
|
+
export {
|
|
102
|
+
io as D,
|
|
103
|
+
T as a,
|
|
104
|
+
j as o,
|
|
105
|
+
ro as v
|
|
106
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as b, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { c as o } from "./index.DL9mof6u.js";
|
|
4
|
+
import { forwardRef as X, useRef as Y, useState as $, useEffect as z } from "react";
|
|
5
|
+
import { u as A } from "./useBreakpoint.1txsny17.js";
|
|
6
|
+
import "./index.D-sRdssb.js";
|
|
7
|
+
import { Asterisk as G } from "../asterisk.B2ih8VwF.js";
|
|
8
|
+
import { D as ee } from "./Icon.CDLyB7Pv.js";
|
|
9
|
+
import { D as le } from "./Popover.D7McfVaH.js";
|
|
10
|
+
import { D as se } from "./SystemFeedback.CjlARKki.js";
|
|
11
|
+
import { g as n, r as te } from "./helpers.CexwVao7.js";
|
|
12
|
+
import '../assets/Select.CL0fqx7X.css';const ae = "ds-select_root_1p3qq_1", re = "ds-select_hint_1p3qq_1", ce = "ds-select_label-wrapper_1p3qq_1", oe = "ds-select_label_1p3qq_1", ne = "ds-select_label--disabled_1p3qq_123", ie = "ds-select_label-wrapper--hidden_1p3qq_135", de = "ds-select_feedback_1p3qq_163", pe = "ds-select_select-wrapper_1p3qq_167", he = "ds-select_select_1p3qq_167", me = "ds-select_select--small_1p3qq_181", be = "ds-select_select--invalid_1p3qq_293", _e = "ds-select_select--placeholder_1p3qq_401", fe = "ds-select_chevron_1p3qq_451", Se = "ds-select_chevron--small_1p3qq_455", ue = "ds-select_chevron--disabled_1p3qq_458", e = {
|
|
13
|
+
root: ae,
|
|
14
|
+
hint: re,
|
|
15
|
+
labelWrapper: ce,
|
|
16
|
+
label: oe,
|
|
17
|
+
labelDisabled: ne,
|
|
18
|
+
labelWrapperHidden: ie,
|
|
19
|
+
feedback: de,
|
|
20
|
+
selectWrapper: pe,
|
|
21
|
+
select: he,
|
|
22
|
+
selectSmall: me,
|
|
23
|
+
selectInvalid: be,
|
|
24
|
+
selectPlaceholder: _e,
|
|
25
|
+
chevron: fe,
|
|
26
|
+
chevronSmall: Se,
|
|
27
|
+
chevronDisabled: ue
|
|
28
|
+
}, Ae = ["medium", "small"], qe = ({
|
|
29
|
+
id: l,
|
|
30
|
+
label: c,
|
|
31
|
+
options: r,
|
|
32
|
+
hideLabel: _,
|
|
33
|
+
popoverContent: i
|
|
34
|
+
}) => {
|
|
35
|
+
if (!l)
|
|
36
|
+
throw new Error(n("DSSelect", 'A unique "id" prop is required. Please add a unique "id" prop to the DSSelect component.'));
|
|
37
|
+
if (!c)
|
|
38
|
+
throw new Error(n("DSSelect", `A label is always required for a11y reasons. Please add a descriptive "label" prop to the DSSelect component. If you don't want to display a label, set hideLabel={true}.`));
|
|
39
|
+
if (Array.isArray(r)) {
|
|
40
|
+
if (r.length === 0)
|
|
41
|
+
throw new Error(n("DSSelect", "The options array must not be empty."));
|
|
42
|
+
} else throw new Error(n("DSSelect", te("options", "DSSelect")));
|
|
43
|
+
_ && i && console.warn(n("DSSelect", "Using a popover when hideLabel is set to true is not supported."));
|
|
44
|
+
}, ve = (l, c, r) => l === "" || c !== void 0 && c !== "" ? !1 : !(r !== void 0 && r !== ""), De = X(({
|
|
45
|
+
id: l,
|
|
46
|
+
label: c,
|
|
47
|
+
options: r,
|
|
48
|
+
className: _,
|
|
49
|
+
defaultValue: i,
|
|
50
|
+
disabled: f = !1,
|
|
51
|
+
hideLabel: D = !1,
|
|
52
|
+
hint: S,
|
|
53
|
+
invalid: d = !1,
|
|
54
|
+
popoverContent: u,
|
|
55
|
+
popoverInfoButtonProps: L,
|
|
56
|
+
placeholder: q = "Select",
|
|
57
|
+
required: w = !1,
|
|
58
|
+
size: y = "medium",
|
|
59
|
+
systemFeedback: v,
|
|
60
|
+
value: p,
|
|
61
|
+
onChange: g,
|
|
62
|
+
...B
|
|
63
|
+
}, h) => {
|
|
64
|
+
process.env.NODE_ENV !== "production" && qe({
|
|
65
|
+
id: l,
|
|
66
|
+
label: c,
|
|
67
|
+
options: r,
|
|
68
|
+
hideLabel: A(D),
|
|
69
|
+
popoverContent: u
|
|
70
|
+
});
|
|
71
|
+
const C = Y(null), [H, N] = $(p), [R, j] = $(ve(q, i, p));
|
|
72
|
+
z(() => {
|
|
73
|
+
N(p);
|
|
74
|
+
}, [p]);
|
|
75
|
+
const x = (s) => {
|
|
76
|
+
C.current = s, typeof h == "function" ? h(s) : h && (h.current = s);
|
|
77
|
+
}, P = A(D), I = `${l}-label`, E = `${l}-feedback`, W = `${l}-hint`, V = S ? ` ${W}` : "", M = [d && v && E].filter(Boolean).join(" ") || void 0, T = (s) => [q && /* @__PURE__ */ a("option", { value: "", children: q }, `${l}-hidden-option-disabled-placeholder`), ...s.map((t) => {
|
|
78
|
+
if ("options" in t) {
|
|
79
|
+
const {
|
|
80
|
+
label: m,
|
|
81
|
+
options: Q
|
|
82
|
+
} = t;
|
|
83
|
+
return /* @__PURE__ */ a("optgroup", { label: m, children: Q.map(k) }, m);
|
|
84
|
+
} else
|
|
85
|
+
return k(t);
|
|
86
|
+
})], k = ({
|
|
87
|
+
label: s,
|
|
88
|
+
value: t,
|
|
89
|
+
isDisabled: m
|
|
90
|
+
}) => /* @__PURE__ */ a("option", { value: t, disabled: m, children: s }, t), F = o(e.root, _), O = o(e.select, {
|
|
91
|
+
[e.selectSmall]: y === "small",
|
|
92
|
+
[e.selectInvalid]: d,
|
|
93
|
+
[e.selectPlaceholder]: R
|
|
94
|
+
}), U = o(e.label, {
|
|
95
|
+
[e.labelDisabled]: f
|
|
96
|
+
}), Z = o(e.labelWrapper, {
|
|
97
|
+
// hide label only visually to keep them available for assistive technologies
|
|
98
|
+
[e.labelWrapperHidden]: P
|
|
99
|
+
}), J = o(e.chevron, {
|
|
100
|
+
[e.chevronSmall]: y === "small",
|
|
101
|
+
[e.chevronDisabled]: f
|
|
102
|
+
}), K = (s) => {
|
|
103
|
+
const {
|
|
104
|
+
value: t
|
|
105
|
+
} = s.target;
|
|
106
|
+
j(t === ""), N(t), g && g(s);
|
|
107
|
+
};
|
|
108
|
+
return /* @__PURE__ */ b("div", { className: F, children: [
|
|
109
|
+
/* @__PURE__ */ b("div", { className: Z, children: [
|
|
110
|
+
/* @__PURE__ */ b("label", { className: U, id: I, htmlFor: l, children: [
|
|
111
|
+
c,
|
|
112
|
+
w && /* @__PURE__ */ a(G, {})
|
|
113
|
+
] }),
|
|
114
|
+
u && !P && /* @__PURE__ */ a(le, { placement: "top", defaultAnchorButtonProps: L, children: u })
|
|
115
|
+
] }),
|
|
116
|
+
S && /* @__PURE__ */ a("div", { className: e.hint, id: W, children: S }),
|
|
117
|
+
/* @__PURE__ */ b("div", { className: e.selectWrapper, children: [
|
|
118
|
+
/* @__PURE__ */ a(
|
|
119
|
+
"select",
|
|
120
|
+
{
|
|
121
|
+
...B,
|
|
122
|
+
id: l,
|
|
123
|
+
ref: x,
|
|
124
|
+
className: O,
|
|
125
|
+
"aria-labelledby": `${I}${V}`,
|
|
126
|
+
"aria-describedby": M,
|
|
127
|
+
"aria-invalid": d,
|
|
128
|
+
defaultValue: i,
|
|
129
|
+
value: H,
|
|
130
|
+
disabled: f,
|
|
131
|
+
required: w,
|
|
132
|
+
onChange: K,
|
|
133
|
+
children: T(r)
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ a(ee, { name: "chevron-down", className: J, "aria-hidden": "true" })
|
|
137
|
+
] }),
|
|
138
|
+
d && v && /* @__PURE__ */ a(se, { className: e.feedback, message: v, variant: "error", id: E })
|
|
139
|
+
] });
|
|
140
|
+
});
|
|
141
|
+
De.displayName = "DSSelect";
|
|
142
|
+
export {
|
|
143
|
+
De as D,
|
|
144
|
+
Ae as S,
|
|
145
|
+
ve as g,
|
|
146
|
+
qe as v
|
|
147
|
+
};
|