@stihl-design-system/components 1.0.0-RC.3 → 1.0.0-RC.5

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.
Files changed (176) hide show
  1. package/Klarna.svg +1 -0
  2. package/Mastercard.svg +2 -0
  3. package/PayPal.svg +2 -0
  4. package/Placeholder.svg +1 -0
  5. package/Visa.svg +2 -0
  6. package/arialiveregions.BvZhV6hb.js +27 -0
  7. package/arialiveregions.d.ts +1 -0
  8. package/assets/CustomReactSelect.Bsphydqt.css +1 -0
  9. package/assets/Fieldset.D0jHAGRL.css +1 -0
  10. package/assets/Icon.Duy_0R8w.css +1 -0
  11. package/assets/InputPassword.VCNO8ANM.css +1 -0
  12. package/assets/InputSearch.BMRAb95l.css +1 -0
  13. package/assets/InputStepper.BKjqNi-i.css +1 -0
  14. package/assets/Notification.Bg63cvs4.css +1 -0
  15. package/assets/RadioGroup.Bz3_xkZU.css +1 -0
  16. package/assets/Select.Bz1TImkI.css +1 -0
  17. package/assets/Textarea.D2h5cW_t.css +1 -0
  18. package/assets/Toast.BzVaebc0.css +1 -0
  19. package/assets/arialiveregions.GsGx2USO.css +1 -0
  20. package/assets/{asterisk.C-o6rbGQ.css → asterisk.JlyPArZu.css} +1 -1
  21. package/assets/button.BdxtFZKx.css +1 -0
  22. package/assets/buttonround.pR4StXA7.css +1 -0
  23. package/assets/checkbox.BjIn2stV.css +1 -0
  24. package/assets/dialog.CKwM2EBH.css +1 -0
  25. package/assets/floatingactionbutton.CUvMbEMf.css +1 -0
  26. package/assets/heading.CCbuI4X-.css +1 -0
  27. package/assets/input.71tOIrpp.css +1 -0
  28. package/assets/link.D61tKkSK.css +1 -0
  29. package/assets/linkstandalone.Bx8Uvo0G.css +1 -0
  30. package/assets/logo.C05WqGId.css +1 -0
  31. package/assets/optioncheckbox.BdRJHcSw.css +1 -0
  32. package/assets/radio.ewRpPo4W.css +1 -0
  33. package/assets/spinner.LuV09jaU.css +1 -0
  34. package/assets/switch.Ds-I_ybT.css +1 -0
  35. package/assets/{systemfeedback.WE3wClZ3.css → systemfeedback.BzJATHDd.css} +1 -1
  36. package/assets/text.B-CTuGgI.css +1 -0
  37. package/assets/{title.CE0Dm7PI.css → title.DlhX9K3W.css} +1 -1
  38. package/asterisk.Cjbk-xZi.js +8 -0
  39. package/button.DlFWwHuA.js +135 -0
  40. package/buttonround.eYOQM994.js +118 -0
  41. package/checkbox.DNHdo6_n.js +113 -0
  42. package/checkboxgroup.DqWlzAeR.js +9 -0
  43. package/chunks/AriaLiveRegions.utils.DzWI5KCU.js +31 -0
  44. package/{checkboxgroup.Cfxz9bk6.js → chunks/CheckboxGroup.DsQ6lI5a.js} +38 -31
  45. package/chunks/{CustomReactSelect.uzWNynay.js → CustomReactSelect.5dHi6PEO.js} +873 -917
  46. package/chunks/Fieldset.B1vsrHNv.js +99 -0
  47. package/chunks/Icon.n4XZrQ4N.js +223 -0
  48. package/chunks/{Input.utils.Bly6ZzLI.js → Input.utils.AKWCNkpA.js} +12 -8
  49. package/chunks/InputPassword.DTqI58Z4.js +140 -0
  50. package/chunks/InputSearch.IwQATLKh.js +189 -0
  51. package/chunks/InputStepper.Jew1ETB6.js +291 -0
  52. package/chunks/Notification.DbflCBIL.js +93 -0
  53. package/chunks/RadioGroup.BO4pbAJw.js +132 -0
  54. package/chunks/RadioGroup.module.BBZwHDjW.js +11 -0
  55. package/chunks/Select.COdS787F.js +191 -0
  56. package/chunks/Textarea.oqCrSopu.js +195 -0
  57. package/chunks/Toast.BLGKvAvZ.js +89 -0
  58. package/chunks/{circle-info-colored.DLY6BTL4.js → circle-info-colored.D2pp54gf.js} +3 -3
  59. package/chunks/{jsx-runtime.C-kxDJ4g.js → jsx-runtime.C115EyI4.js} +3 -7
  60. package/{combobox.BXHAo4Wx.js → combobox.CRlhqmuO.js} +8 -8
  61. package/components/AriaLiveRegions/AriaLiveRegions.d.ts +4 -0
  62. package/components/AriaLiveRegions/AriaLiveRegions.utils.d.ts +5 -0
  63. package/components/AriaLiveRegions/AriaLiveRegions.utils.test.d.ts +1 -0
  64. package/components/Checkbox/Checkbox.d.ts +1 -1
  65. package/components/CheckboxGroup/CheckboxGroup.utils.d.ts +1 -1
  66. package/components/Dialog/Dialog.d.ts +11 -0
  67. package/components/Dialog/Dialog.utils.d.ts +0 -0
  68. package/components/Fieldset/Fieldset.utils.d.ts +1 -1
  69. package/components/Notification/Notification.d.ts +26 -0
  70. package/components/Notification/Notification.test.d.ts +1 -0
  71. package/components/Notification/Notification.utils.d.ts +5 -0
  72. package/components/Radio/Radio.d.ts +11 -3
  73. package/components/RadioGroup/RadioGroup.d.ts +6 -3
  74. package/components/RadioGroup/RadioGroup.utils.d.ts +5 -3
  75. package/components/RadioGroup/RadioGroup.utils.test.d.ts +1 -0
  76. package/components/Toast/Toast.d.ts +21 -0
  77. package/components/Toast/Toast.utils.d.ts +9 -0
  78. package/components/Toast/ToastManager.d.ts +6 -0
  79. package/components/Toast/ToastManager.test.d.ts +1 -0
  80. package/components/Toast/ToastManager.utils.d.ts +2 -0
  81. package/components/Toast/ToastManager.utils.test.d.ts +1 -0
  82. package/customreactselect.CD58gwtp.js +13 -0
  83. package/dialog.d.ts +1 -0
  84. package/dialog.qd2pOyVc.js +45 -0
  85. package/fieldset.aY3V2jK2.js +11 -0
  86. package/floatingactionbutton.CGV3YFQq.js +87 -0
  87. package/heading.BTNroD1E.js +50 -0
  88. package/icon.D3RXjzh4.js +8 -0
  89. package/index.d.ts +24 -0
  90. package/index.es.js +140 -45
  91. package/input.BAxvG272.js +236 -0
  92. package/inputpassword.mn9qFlfs.js +12 -0
  93. package/inputsearch.qQJj9yFd.js +13 -0
  94. package/inputstepper.DhbHujiM.js +13 -0
  95. package/link.SAcKvzJ3.js +115 -0
  96. package/linkstandalone.DNe0Nydm.js +79 -0
  97. package/{logo.C_oJ8isW.js → logo.BR_CUXFl.js} +16 -16
  98. package/notification.CnJOdQza.js +9 -0
  99. package/notification.d.ts +1 -0
  100. package/{optioncheckbox.-DRnW_ch.js → optioncheckbox.C4l2UIak.js} +9 -9
  101. package/package.json +30 -26
  102. package/partials/index.js +51 -79
  103. package/radio.epf54-sG.js +115 -0
  104. package/radiogroup.CiENWRos.js +11 -0
  105. package/select.DLYav8gw.js +12 -0
  106. package/spinner.DEtbkdfi.js +58 -0
  107. package/styles/scss/_index.scss +1 -0
  108. package/styles/scss/lib/_animation.scss +20 -5
  109. package/styles/scss/lib/_container-query.scss +3 -3
  110. package/styles/scss/lib/_grid-sidebar-sidebar.scss +2 -0
  111. package/styles/scss/lib/_grid-sidebar.scss +14 -7
  112. package/styles/scss/lib/_link.scss +48 -41
  113. package/styles/scss/lib/_media-query.scss +3 -3
  114. package/styles/scss/lib/_shadow.scss +10 -0
  115. package/styles/scss/lib/_theme.scss +7 -5
  116. package/styles/scss/lib/_transition.scss +26 -7
  117. package/switch.BezS5z0Y.js +65 -0
  118. package/{systemfeedback.C7iXO5A1.js → systemfeedback.CUWch42u.js} +3 -3
  119. package/text.CrYUewrP.js +57 -0
  120. package/textarea.hLgeYdsI.js +12 -0
  121. package/title.Dvp8LKJt.js +36 -0
  122. package/toast.BR7QuHOG.js +10 -0
  123. package/toast.d.ts +1 -0
  124. package/toastmanager.DBp8B1e3.js +96 -0
  125. package/toastmanager.d.ts +1 -0
  126. package/utils/index.d.ts +1 -0
  127. package/utils/remove-spaces.d.ts +6 -0
  128. package/utils/remove-spaces.test.d.ts +1 -0
  129. package/utils/vitest.setup.d.ts +2 -0
  130. package/assets/CustomReactSelect.BdwXfLLO.css +0 -1
  131. package/assets/RadioGroup.Ur8Ro-XL.css +0 -1
  132. package/assets/button.DJvR-58w.css +0 -1
  133. package/assets/buttonround.BlfQkmMV.css +0 -1
  134. package/assets/checkbox.BsFEWfQe.css +0 -1
  135. package/assets/fieldset.xazpUXJX.css +0 -1
  136. package/assets/floatingactionbutton.D7ywURL3.css +0 -1
  137. package/assets/heading.CGFucb-C.css +0 -1
  138. package/assets/icon.CB-KQmw4.css +0 -1
  139. package/assets/input.BcP5kkZ2.css +0 -1
  140. package/assets/inputpassword.C3Uyj7oA.css +0 -1
  141. package/assets/inputsearch.tL3e9-Ob.css +0 -1
  142. package/assets/inputstepper.paPJix5A.css +0 -1
  143. package/assets/link.V7pJOW1p.css +0 -1
  144. package/assets/linkstandalone.D3RbBp23.css +0 -1
  145. package/assets/logo.BbHYgnWo.css +0 -1
  146. package/assets/optioncheckbox.C-K1FLhc.css +0 -1
  147. package/assets/radio.CSHQGdpr.css +0 -1
  148. package/assets/select.D2qBxaHP.css +0 -1
  149. package/assets/spinner.C5rBmKiF.css +0 -1
  150. package/assets/switch.sqve8ApJ.css +0 -1
  151. package/assets/text.DDAveG7E.css +0 -1
  152. package/assets/textarea.BKbocznb.css +0 -1
  153. package/asterisk.DU8THnoC.js +0 -8
  154. package/button.BUUGRxIp.js +0 -135
  155. package/buttonround.CKc-a-hd.js +0 -118
  156. package/checkbox.C2Ga9yTK.js +0 -112
  157. package/chunks/RadioGroup.module.bi3leRes.js +0 -11
  158. package/customreactselect.CipgVXTR.js +0 -13
  159. package/fieldset.DGcIKzDI.js +0 -98
  160. package/floatingactionbutton.DzHD39NY.js +0 -87
  161. package/heading.DqGbFfj2.js +0 -50
  162. package/icon.PX9_1kNB.js +0 -215
  163. package/input.o8OT6rxJ.js +0 -236
  164. package/inputpassword.-MXq8baU.js +0 -139
  165. package/inputsearch.CoYTSjox.js +0 -188
  166. package/inputstepper.BBMQr6kM.js +0 -290
  167. package/link.BN6AZfhG.js +0 -115
  168. package/linkstandalone.4-fyRd08.js +0 -79
  169. package/radio.Bhu9OUY-.js +0 -79
  170. package/radiogroup.oILRMrX-.js +0 -102
  171. package/select.OGcreXnT.js +0 -190
  172. package/spinner.Diy_EeFY.js +0 -58
  173. package/switch.BjoFKMQC.js +0 -65
  174. package/text.CPU8IUqY.js +0 -57
  175. package/textarea.kc_Sfbgr.js +0 -193
  176. package/title.icX0VDiO.js +0 -36
@@ -0,0 +1,118 @@
1
+ "use client";
2
+ import { j as r } from "./chunks/jsx-runtime.C115EyI4.js";
3
+ import { c as h } from "./chunks/index.CvOaL64Y.js";
4
+ import { D as H } from "./chunks/Icon.n4XZrQ4N.js";
5
+ import { DSSpinner as p } from "./spinner.DEtbkdfi.js";
6
+ import './assets/buttonround.pR4StXA7.css';const F = "_root_lfeh_151", O = "_root--highlight_lfeh_219", G = "_root--dark-highlight_lfeh_219", I = "_root--filled_lfeh_297", S = "_root--outline_lfeh_325", x = "_root--ghost_lfeh_352", j = "_root--ghost-flush_lfeh_377", L = "_root--small_lfeh_383", C = "_root--dark-filled_lfeh_460", N = "_root--dark-outline_lfeh_519", R = "_root--dark-ghost_lfeh_577", B = "_root--dark-ghost-flush_lfeh_633", E = "_root--icon-left_lfeh_692", T = "_root--icon-only_lfeh_708", q = "_root--icon-only-small_lfeh_717", w = "_loader_lfeh_734", z = "_icon--hidden_lfeh_746", A = "_label--hidden_lfeh_750", J = "_label--loading_lfeh_762", o = {
7
+ root: F,
8
+ "root--highlight": "_root--highlight_lfeh_219",
9
+ rootHighlight: O,
10
+ "root--dark-highlight": "_root--dark-highlight_lfeh_219",
11
+ rootDarkHighlight: G,
12
+ "root--filled": "_root--filled_lfeh_297",
13
+ rootFilled: I,
14
+ "root--outline": "_root--outline_lfeh_325",
15
+ rootOutline: S,
16
+ "root--ghost": "_root--ghost_lfeh_352",
17
+ rootGhost: x,
18
+ "root--ghost-flush": "_root--ghost-flush_lfeh_377",
19
+ rootGhostFlush: j,
20
+ "root--small": "_root--small_lfeh_383",
21
+ rootSmall: L,
22
+ "root--dark-filled": "_root--dark-filled_lfeh_460",
23
+ rootDarkFilled: C,
24
+ "root--dark-outline": "_root--dark-outline_lfeh_519",
25
+ rootDarkOutline: N,
26
+ "root--dark-ghost": "_root--dark-ghost_lfeh_577",
27
+ rootDarkGhost: R,
28
+ "root--dark-ghost-flush": "_root--dark-ghost-flush_lfeh_633",
29
+ rootDarkGhostFlush: B,
30
+ "root--icon-left": "_root--icon-left_lfeh_692",
31
+ rootIconLeft: E,
32
+ "root--icon-only": "_root--icon-only_lfeh_708",
33
+ rootIconOnly: T,
34
+ "root--icon-only-small": "_root--icon-only-small_lfeh_717",
35
+ rootIconOnlySmall: q,
36
+ loader: w,
37
+ "icon--hidden": "_icon--hidden_lfeh_746",
38
+ iconHidden: z,
39
+ "label--hidden": "_label--hidden_lfeh_750",
40
+ labelHidden: A,
41
+ "label--loading": "_label--loading_lfeh_762",
42
+ labelLoading: J
43
+ }, U = ({
44
+ children: d,
45
+ aria: f,
46
+ className: c,
47
+ dataTrackingid: g,
48
+ disabled: _ = !1,
49
+ iconName: i = "placeholder",
50
+ iconSource: n,
51
+ loading: l = !1,
52
+ theme: e = "light",
53
+ variant: t = "filled",
54
+ onClick: s,
55
+ ...k
56
+ }) => {
57
+ const u = h(
58
+ o.root,
59
+ o.rootIconOnlySmall,
60
+ c,
61
+ {
62
+ // variant
63
+ [o.rootFilled]: t === "filled",
64
+ [o.rootHighlight]: t === "highlight",
65
+ // dark theme
66
+ [o.rootDarkFilled]: e === "dark" && t === "filled",
67
+ [o.rootDarkHighlight]: e === "dark" && t === "highlight"
68
+ }
69
+ ), m = h(o.label, o.labelHidden, {
70
+ // set label opacity to 0 when loading to prevent button size from changing
71
+ [o.labelLoading]: l
72
+ }), b = h(o.icon, {
73
+ // set icon opacity to 0 when loading to prevent button size from changing
74
+ [o.iconHidden]: l
75
+ }), D = e === "light" && t === "filled" ? "dark" : "light", y = (a) => {
76
+ if (_ || l) {
77
+ a.preventDefault();
78
+ return;
79
+ }
80
+ s && s(a);
81
+ };
82
+ return /* @__PURE__ */ r.jsxs(
83
+ "button",
84
+ {
85
+ className: u,
86
+ "data-trackingid": g,
87
+ type: "button",
88
+ onClick: y,
89
+ ...f,
90
+ ...k,
91
+ "aria-disabled": _ || l,
92
+ "aria-busy": l,
93
+ children: [
94
+ l && /* @__PURE__ */ r.jsx(
95
+ p,
96
+ {
97
+ className: o.loader,
98
+ aria: { "aria-label": "Loading state" }
99
+ }
100
+ ),
101
+ /* @__PURE__ */ r.jsx("span", { className: m, children: d }),
102
+ (i || n) && /* @__PURE__ */ r.jsx(
103
+ H,
104
+ {
105
+ name: i,
106
+ theme: D,
107
+ source: n,
108
+ className: b,
109
+ "aria-hidden": "true"
110
+ }
111
+ )
112
+ ]
113
+ }
114
+ );
115
+ };
116
+ export {
117
+ U as DSButtonRound
118
+ };
@@ -0,0 +1,113 @@
1
+ "use client";
2
+ import { j as e } from "./chunks/jsx-runtime.C115EyI4.js";
3
+ import { c as h } from "./chunks/index.CvOaL64Y.js";
4
+ import { forwardRef as R, useRef as S, useState as I, useEffect as H, useCallback as M } from "react";
5
+ import { u as g } from "./chunks/useBreakpoint.5xBNDiCf.js";
6
+ import { D as x } from "./chunks/Icon.n4XZrQ4N.js";
7
+ import { DSSystemFeedback as B } from "./systemfeedback.CUWch42u.js";
8
+ import './assets/checkbox.BjIn2stV.css';const E = "_checkbox-root_vryww_151", V = "_checkbox-root--disabled_vryww_170", L = "_checkbox_vryww_151", O = "_icon-check_vryww_190", P = "_icon-minus_vryww_191", U = "_checkbox--invalid_vryww_215", q = "_label--hidden_vryww_220", z = "_input_vryww_233", A = "_label_vryww_220", F = "_feedback_vryww_347", c = {
9
+ "checkbox-root": "_checkbox-root_vryww_151",
10
+ checkboxRoot: E,
11
+ "checkbox-root--disabled": "_checkbox-root--disabled_vryww_170",
12
+ checkboxRootDisabled: V,
13
+ checkbox: L,
14
+ "icon-check": "_icon-check_vryww_190",
15
+ iconCheck: O,
16
+ "icon-minus": "_icon-minus_vryww_191",
17
+ iconMinus: P,
18
+ "checkbox--invalid": "_checkbox--invalid_vryww_215",
19
+ checkboxInvalid: U,
20
+ "label--hidden": "_label--hidden_vryww_220",
21
+ labelHidden: q,
22
+ input: z,
23
+ label: A,
24
+ feedback: F
25
+ }, G = R(
26
+ ({
27
+ label: b,
28
+ checked: _,
29
+ className: u,
30
+ defaultChecked: w = !1,
31
+ disabled: s = !1,
32
+ hideLabel: m = !1,
33
+ indeterminate: i = !1,
34
+ invalid: l = !1,
35
+ systemFeedback: d,
36
+ onChange: t,
37
+ ...f
38
+ }, n) => {
39
+ const a = S(null), [v, y] = I(w), p = g(m);
40
+ H(() => {
41
+ a && a.current && (a.current.indeterminate = i);
42
+ }, [i]);
43
+ const r = _ !== void 0, k = r ? _ : v, C = h(c.checkboxRoot, {
44
+ [c.checkboxRootDisabled]: s
45
+ }), j = h(c.label, {
46
+ // hide label only visually to keep them available for assistive technologies
47
+ [c.labelHidden]: p
48
+ }), D = h(c.checkbox, {
49
+ [c.checkboxInvalid]: l
50
+ }), N = M(
51
+ (o) => {
52
+ if (s) {
53
+ o.preventDefault();
54
+ return;
55
+ }
56
+ r || y(o.target.checked), t && t(o);
57
+ },
58
+ [s, r, t]
59
+ );
60
+ return /* @__PURE__ */ e.jsxs("div", { className: u, children: [
61
+ /* @__PURE__ */ e.jsxs("label", { className: C, children: [
62
+ /* @__PURE__ */ e.jsx(
63
+ "input",
64
+ {
65
+ type: "checkbox",
66
+ className: c.input,
67
+ ref: (o) => {
68
+ typeof n == "function" ? n(o) : n !== null && (n.current = o), a.current = o;
69
+ },
70
+ ...f,
71
+ checked: k,
72
+ disabled: s,
73
+ "aria-label": b,
74
+ "aria-invalid": l,
75
+ "aria-checked": i ? "mixed" : k,
76
+ onChange: N
77
+ }
78
+ ),
79
+ /* @__PURE__ */ e.jsxs("span", { className: D, children: [
80
+ /* @__PURE__ */ e.jsx(
81
+ x,
82
+ {
83
+ name: "check",
84
+ className: c.iconCheck,
85
+ "aria-hidden": "true"
86
+ }
87
+ ),
88
+ /* @__PURE__ */ e.jsx(
89
+ x,
90
+ {
91
+ name: "minus",
92
+ className: c.iconMinus,
93
+ "aria-hidden": "true"
94
+ }
95
+ )
96
+ ] }),
97
+ /* @__PURE__ */ e.jsx("span", { className: j, children: b })
98
+ ] }),
99
+ l && d && /* @__PURE__ */ e.jsx(
100
+ B,
101
+ {
102
+ className: c.feedback,
103
+ message: d,
104
+ type: "invalid"
105
+ }
106
+ )
107
+ ] });
108
+ }
109
+ );
110
+ G.displayName = "DSCheckbox";
111
+ export {
112
+ G as DSCheckbox
113
+ };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import "./chunks/jsx-runtime.C115EyI4.js";
3
+ import "./chunks/index.CvOaL64Y.js";
4
+ import "./chunks/Fieldset.B1vsrHNv.js";
5
+ import "./chunks/RadioGroup.module.BBZwHDjW.js";
6
+ import { D as e } from "./chunks/CheckboxGroup.DsQ6lI5a.js";
7
+ export {
8
+ e as DSCheckboxGroup
9
+ };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { g as i } from "./helpers.B1JT5ShS.js";
3
+ import "react";
4
+ const e = "ds-alert-live-region", n = "ds-status-live-region", r = () => document.getElementById(e), a = () => document.getElementById(n), g = () => {
5
+ const t = document.querySelectorAll(
6
+ `#${e}`
7
+ ), o = document.querySelectorAll(
8
+ `#${n}`
9
+ );
10
+ if (t.length > 1)
11
+ throw new Error(
12
+ i(
13
+ "DSAriaLiveRegions",
14
+ `The DSAriaLiveRegions component with id="${e}" should only be present once on the page. Found ${t.length} instances.`
15
+ )
16
+ );
17
+ if (o.length > 1)
18
+ throw new Error(
19
+ i(
20
+ "DSAriaLiveRegions",
21
+ `The DSAriaLiveRegions component with id="${n}" should only be present once on the page. Found ${o.length} instances.`
22
+ )
23
+ );
24
+ };
25
+ export {
26
+ e as A,
27
+ n as a,
28
+ a as b,
29
+ r as g,
30
+ g as v
31
+ };
@@ -1,80 +1,87 @@
1
1
  "use client";
2
- import { j as u } from "./chunks/jsx-runtime.C-kxDJ4g.js";
3
- import { c as b } from "./chunks/index.CvOaL64Y.js";
4
- import { DSFieldset as f } from "./fieldset.DGcIKzDI.js";
5
- import { s as p } from "./chunks/RadioGroup.module.bi3leRes.js";
2
+ import { j as u } from "./jsx-runtime.C115EyI4.js";
3
+ import { c as D } from "./index.CvOaL64Y.js";
4
+ import { D as b } from "./Fieldset.B1vsrHNv.js";
5
+ import { s as c } from "./RadioGroup.module.BBZwHDjW.js";
6
6
  import l from "react";
7
- import { g as i } from "./chunks/helpers.B1JT5ShS.js";
8
- import { DSCheckbox as D } from "./checkbox.C2Ga9yTK.js";
9
- const C = (o) => `The "${o}" prop is required. Please add the "${o}" prop to the DSCheckboxGroup component.`, S = ({
10
- children: o,
11
- description: e,
12
- id: s,
7
+ import { g as s } from "./helpers.B1JT5ShS.js";
8
+ import { DSCheckbox as f } from "../checkbox.DNHdo6_n.js";
9
+ const C = (e) => `The "${e}" prop is required. Please add the "${e}" prop to the DSCheckboxGroup component.`, k = ({
10
+ children: e,
11
+ description: o,
12
+ id: i,
13
13
  legend: n,
14
14
  systemFeedback: r
15
15
  }) => {
16
- if (!s && (e || r))
16
+ if (!i && (o || r))
17
17
  throw new Error(
18
- i(
18
+ s(
19
19
  "DSCheckboxGroup",
20
20
  'A unique "id" prop is required when providing the description or systemFeedback property. Please add an unique "id" prop to the DSCheckboxGroup component.'
21
21
  )
22
22
  );
23
23
  if (!n)
24
24
  throw new Error(
25
- i("DSCheckboxGroup", C("legend"))
25
+ s("DSCheckboxGroup", C("legend"))
26
26
  );
27
- if (!o)
27
+ if (!e)
28
28
  throw new Error(
29
- i(
29
+ s(
30
30
  "DSCheckboxGroup",
31
31
  "The component requires DSCheckbox components to be explicitly set as its children. Ensure that you include individual DSCheckbox components within the DSCheckboxGroup to create a cohesive checkbox group."
32
32
  )
33
33
  );
34
- l.Children.forEach(o, (t) => {
35
- if (!(l.isValidElement(t) && t.type === D))
34
+ l.Children.forEach(e, (t) => {
35
+ if (!(l.isValidElement(t) && t.type === f))
36
36
  throw new Error(
37
- i(
37
+ s(
38
38
  "DSCheckboxGroup",
39
39
  "The component requires the children to be DSCheckbox elements. Ensure that you include individual DSCheckbox components within the DSCheckboxGroup to create a cohesive checkbox group."
40
40
  )
41
41
  );
42
42
  });
43
43
  }, y = ({
44
- children: o,
45
- legend: e,
46
- alignment: s = "vertical",
44
+ children: e,
45
+ legend: o,
46
+ alignment: i = "vertical",
47
47
  className: n,
48
48
  description: r,
49
49
  disabled: t = !1,
50
50
  id: h,
51
51
  invalid: a = !1,
52
52
  required: m = !1,
53
- systemFeedback: c,
53
+ systemFeedback: p,
54
54
  ...x
55
55
  }) => {
56
- process.env.NODE_ENV !== "production" && S({ children: o, legend: e, description: r, id: h, systemFeedback: c });
57
- const d = b(p.root, {
56
+ process.env.NODE_ENV !== "production" && k({
57
+ children: e,
58
+ legend: o,
59
+ description: r,
60
+ id: h,
61
+ systemFeedback: p
62
+ });
63
+ const d = D(c.group, {
58
64
  // In case of longer copy, use vertical alignment
59
- [p.rootHorizontal]: s === "horizontal",
60
- [p.rootInvalid]: a && !!c
65
+ [c.groupHorizontal]: i === "horizontal",
66
+ [c.groupInvalid]: a && !!p
61
67
  });
62
68
  return /* @__PURE__ */ u.jsx(
63
- f,
69
+ b,
64
70
  {
65
71
  id: h,
66
- legend: e,
72
+ legend: o,
67
73
  className: n,
68
74
  description: r,
69
75
  disabled: t,
70
76
  required: m,
71
77
  invalid: a,
72
- systemFeedback: c,
78
+ systemFeedback: p,
73
79
  ...x,
74
- children: /* @__PURE__ */ u.jsx("div", { className: d, children: o })
80
+ children: /* @__PURE__ */ u.jsx("div", { className: d, children: e })
75
81
  }
76
82
  );
77
83
  };
78
84
  export {
79
- y as DSCheckboxGroup
85
+ y as D,
86
+ k as v
80
87
  };