@stihl-design-system/components 1.0.0-RC.7 → 1.0.0-RC.9

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 (155) hide show
  1. package/Notification-additional-information.jpeg +0 -0
  2. package/Notification-confirm-error.jpg +0 -0
  3. package/Notification-confirm-warn.jpeg +0 -0
  4. package/Notification-overview.jpeg +0 -0
  5. package/Notification-success.jpeg +0 -0
  6. package/assets/CustomReactSelect.CMkn-EGK.css +1 -0
  7. package/assets/Dialog.DdLMmOLt.css +1 -0
  8. package/assets/Drawer.BqBgbSuP.css +1 -0
  9. package/assets/Fieldset.qHYeUFZt.css +1 -0
  10. package/assets/InputPassword.Cf394z47.css +1 -0
  11. package/assets/InputSearch.eCRQoxjN.css +1 -0
  12. package/assets/InputStepper.B80KulYE.css +1 -0
  13. package/assets/Notification.DK6agBGS.css +1 -0
  14. package/assets/Select.BptsMxz4.css +1 -0
  15. package/assets/Textarea.CIIVh03G.css +1 -0
  16. package/assets/Toast.Dsvs1zdM.css +1 -0
  17. package/assets/asterisk.DlJ4YtSZ.css +1 -0
  18. package/assets/button.B1O7Yw3Q.css +1 -0
  19. package/assets/buttonround.DlH_ipDo.css +1 -0
  20. package/assets/checkbox.K4CVYK9g.css +1 -0
  21. package/assets/heading.6bER-Eac.css +1 -0
  22. package/assets/input.C0MrSbQu.css +1 -0
  23. package/assets/link.vtTST2ki.css +1 -0
  24. package/assets/linkstandalone.BtAcziZ7.css +1 -0
  25. package/assets/logo.pETQEsvZ.css +1 -0
  26. package/assets/optioncheckbox.BJJAph5_.css +1 -0
  27. package/assets/radio.9kpIO3HC.css +1 -0
  28. package/assets/skiptocontent.CHcqLS7S.css +1 -0
  29. package/assets/switch.2DQF2zH-.css +1 -0
  30. package/assets/systemfeedback.Sq0bAIyf.css +1 -0
  31. package/assets/text.Dhb_l50R.css +1 -0
  32. package/assets/title.f74Bosn-.css +1 -0
  33. package/{asterisk.Cjbk-xZi.js → asterisk.DDn-yX4P.js} +1 -1
  34. package/button.CkHCQg3Y.js +135 -0
  35. package/buttonround.DX3u2Fio.js +118 -0
  36. package/checkbox.BbmCDJCm.js +112 -0
  37. package/{checkboxgroup.DqWlzAeR.js → checkboxgroup.CPENWSuk.js} +2 -2
  38. package/chunks/{CheckboxGroup.DsQ6lI5a.js → CheckboxGroup.Dx_Hn8Dl.js} +2 -2
  39. package/chunks/CustomReactSelect.C4rTVlvy.js +3593 -0
  40. package/chunks/Dialog.TPjJ_yxK.js +148 -0
  41. package/chunks/Drawer.DrLGSch-.js +154 -0
  42. package/chunks/{Fieldset.B1vsrHNv.js → Fieldset.P09LInkT.js} +29 -29
  43. package/chunks/{Input.utils.BGUhXCNP.js → Input.utils.ChV6RJsh.js} +19 -17
  44. package/chunks/InputPassword.CSc1c98k.js +140 -0
  45. package/chunks/{InputSearch.DITRiB92.js → InputSearch.DrgdGFT_.js} +49 -49
  46. package/chunks/{InputStepper.Bf8NZ9pb.js → InputStepper.DJEuIr4C.js} +76 -76
  47. package/chunks/{Notification.DVVuSOqG.js → Notification.B68mMDiB.js} +24 -24
  48. package/chunks/{RadioGroup.BO4pbAJw.js → RadioGroup.B5jRveyI.js} +2 -2
  49. package/chunks/Select.Cl2eJR1z.js +191 -0
  50. package/chunks/Textarea.Sk9-GXfs.js +195 -0
  51. package/chunks/{Toast.RON4bFPY.js → Toast.D9DAuz2m.js} +33 -33
  52. package/{combobox.CRlhqmuO.js → combobox.jDpV6bv-.js} +1 -1
  53. package/components/Button/Button.d.ts +1 -1
  54. package/components/Checkbox/Checkbox.d.ts +1 -1
  55. package/components/CustomReactSelect/CustomReactSelect.d.ts +2 -2
  56. package/components/Dialog/Dialog.d.ts +22 -3
  57. package/components/Dialog/Dialog.test.d.ts +1 -0
  58. package/components/Dialog/Dialog.utils.d.ts +12 -0
  59. package/components/Dialog/Dialog.utils.test.d.ts +1 -0
  60. package/components/Drawer/Drawer.d.ts +31 -0
  61. package/components/Drawer/Drawer.test.d.ts +1 -0
  62. package/components/Drawer/Drawer.utils.d.ts +14 -0
  63. package/components/Drawer/Drawer.utils.test.d.ts +1 -0
  64. package/components/Input/Input.d.ts +1 -1
  65. package/components/InputSearch/InputSearch.d.ts +1 -1
  66. package/components/LinkStandalone/LinkStandalone.d.ts +1 -1
  67. package/components/Notification/Notification.d.ts +3 -1
  68. package/components/Radio/Radio.d.ts +1 -1
  69. package/components/RadioGroup/RadioGroup.d.ts +1 -1
  70. package/components/SkipToContent/SkipToContent.d.ts +1 -1
  71. package/components/Switch/Switch.d.ts +1 -1
  72. package/components/Toast/Toast.d.ts +3 -0
  73. package/{customreactselect.CD58gwtp.js → customreactselect.C2QK_Q8T.js} +4 -4
  74. package/dialog.BPX7RJtQ.js +9 -0
  75. package/drawer.BfEPcSsQ.js +9 -0
  76. package/drawer.d.ts +1 -0
  77. package/fieldset.4yvz0e7M.js +11 -0
  78. package/heading.CAkraI2D.js +50 -0
  79. package/index.d.ts +4 -0
  80. package/index.es.js +99 -92
  81. package/input.lLMqAG-6.js +236 -0
  82. package/{inputpassword.Ba9SUUIK.js → inputpassword.BIdYGrhB.js} +4 -4
  83. package/{inputsearch.BK-0OTwA.js → inputsearch.DleOblJp.js} +4 -4
  84. package/inputstepper.DWkHwOAn.js +13 -0
  85. package/link.KZaBufPM.js +116 -0
  86. package/linkstandalone.B6tN-NXD.js +80 -0
  87. package/{logo.BR_CUXFl.js → logo.CqukakYv.js} +32 -36
  88. package/{notification.Csn5QCR2.js → notification.DdJjbSdM.js} +2 -2
  89. package/optioncheckbox.DwQEfxGG.js +43 -0
  90. package/package.json +6 -4
  91. package/partials/index.js +442 -442
  92. package/radio.CWGJtmKl.js +115 -0
  93. package/{radiogroup.CiENWRos.js → radiogroup.FfK4DLsV.js} +3 -3
  94. package/{select.DLYav8gw.js → select.BEuTuEFZ.js} +3 -3
  95. package/{skiptocontent._YZRKxnc.js → skiptocontent.fP4SOp-p.js} +16 -14
  96. package/styles/scss/lib/_heading.scss +50 -9
  97. package/styles/scss/lib/_helpers.scss +12 -0
  98. package/styles/scss/lib/_link.scss +58 -94
  99. package/styles/scss/lib/_text.scss +57 -14
  100. package/switch.KO8HZPNL.js +65 -0
  101. package/{systemfeedback.CUWch42u.js → systemfeedback._8gatmgR.js} +1 -1
  102. package/text.rgDKQBrU.js +57 -0
  103. package/{textarea.hLgeYdsI.js → textarea.DV1yVty7.js} +3 -3
  104. package/title.LY1ylQsb.js +36 -0
  105. package/{toast.r_yhGYEe.js → toast.BB8L0ixD.js} +2 -2
  106. package/{toastmanager.BncH_rUP.js → toastmanager.DifUvJcg.js} +27 -25
  107. package/utils/index.d.ts +1 -0
  108. package/utils/render-in-iframe.d.ts +15 -0
  109. package/utils/useIsomorphicLayoutEffect.d.ts +26 -0
  110. package/utils/vitest.setup.d.ts +2 -0
  111. package/assets/CustomReactSelect.Bsphydqt.css +0 -1
  112. package/assets/Fieldset.D0jHAGRL.css +0 -1
  113. package/assets/InputPassword.VCNO8ANM.css +0 -1
  114. package/assets/InputSearch.BMRAb95l.css +0 -1
  115. package/assets/InputStepper.BKjqNi-i.css +0 -1
  116. package/assets/Notification.Bg63cvs4.css +0 -1
  117. package/assets/Select.Bz1TImkI.css +0 -1
  118. package/assets/Textarea.D2h5cW_t.css +0 -1
  119. package/assets/Toast.BzVaebc0.css +0 -1
  120. package/assets/asterisk.JlyPArZu.css +0 -1
  121. package/assets/button.BdxtFZKx.css +0 -1
  122. package/assets/buttonround.pR4StXA7.css +0 -1
  123. package/assets/checkbox.BjIn2stV.css +0 -1
  124. package/assets/dialog.CKwM2EBH.css +0 -1
  125. package/assets/heading.CCbuI4X-.css +0 -1
  126. package/assets/input.71tOIrpp.css +0 -1
  127. package/assets/link.D61tKkSK.css +0 -1
  128. package/assets/linkstandalone.Bx8Uvo0G.css +0 -1
  129. package/assets/logo.C05WqGId.css +0 -1
  130. package/assets/optioncheckbox.BdRJHcSw.css +0 -1
  131. package/assets/radio.ewRpPo4W.css +0 -1
  132. package/assets/skiptocontent.DGVJ77cj.css +0 -1
  133. package/assets/switch.Ds-I_ybT.css +0 -1
  134. package/assets/systemfeedback.BzJATHDd.css +0 -1
  135. package/assets/text.B-CTuGgI.css +0 -1
  136. package/assets/title.DlhX9K3W.css +0 -1
  137. package/button.L1lgCuM9.js +0 -135
  138. package/buttonround.ddSqXjYf.js +0 -118
  139. package/checkbox.DNHdo6_n.js +0 -113
  140. package/chunks/CustomReactSelect.5dHi6PEO.js +0 -4983
  141. package/chunks/InputPassword.a7zHKrmM.js +0 -140
  142. package/chunks/Select.COdS787F.js +0 -191
  143. package/chunks/Textarea.oqCrSopu.js +0 -195
  144. package/dialog.0qPUVJha.js +0 -45
  145. package/fieldset.aY3V2jK2.js +0 -11
  146. package/heading.BTNroD1E.js +0 -50
  147. package/input.DqSOhSMX.js +0 -236
  148. package/inputstepper.DFQ4zC15.js +0 -13
  149. package/link.SAcKvzJ3.js +0 -115
  150. package/linkstandalone.DNe0Nydm.js +0 -79
  151. package/optioncheckbox.C4l2UIak.js +0 -43
  152. package/radio.epf54-sG.js +0 -115
  153. package/switch.rd7PdLc9.js +0 -65
  154. package/text.CrYUewrP.js +0 -57
  155. package/title.Dvp8LKJt.js +0 -36
@@ -0,0 +1,148 @@
1
+ "use client";
2
+ import { j as n } from "./jsx-runtime.C115EyI4.js";
3
+ import { c as s } from "./index.CvOaL64Y.js";
4
+ import { useRef as v, useState as x, useEffect as b } from "react";
5
+ import { DSButton as j } from "../button.CkHCQg3Y.js";
6
+ import { g as B } from "./helpers.B1JT5ShS.js";
7
+ import '../assets/Dialog.DdLMmOLt.css';const E = "_dialog_qvh8h_80", C = "_content-wrapper_qvh8h_151", F = "_content-wrapper--no-footer_qvh8h_157", W = "_close-button_qvh8h_165", k = "_header_qvh8h_178", R = "_content_qvh8h_151", y = "_footer_qvh8h_180", z = "_header--scrollable_qvh8h_201", L = "_header--close-button_qvh8h_210", M = "_content--no-footer_qvh8h_223", H = "_footer--scrollable_qvh8h_230", o = {
8
+ dialog: E,
9
+ "content-wrapper": "_content-wrapper_qvh8h_151",
10
+ contentWrapper: C,
11
+ "content-wrapper--no-footer": "_content-wrapper--no-footer_qvh8h_157",
12
+ contentWrapperNoFooter: F,
13
+ "close-button": "_close-button_qvh8h_165",
14
+ closeButton: W,
15
+ header: k,
16
+ content: R,
17
+ footer: y,
18
+ "header--scrollable": "_header--scrollable_qvh8h_201",
19
+ headerScrollable: z,
20
+ "header--close-button": "_header--close-button_qvh8h_210",
21
+ headerCloseButton: L,
22
+ "content--no-footer": "_content--no-footer_qvh8h_223",
23
+ contentNoFooter: M,
24
+ "footer--scrollable": "_footer--scrollable_qvh8h_230",
25
+ footerScrollable: H
26
+ }, I = ({ tabIndex: r }) => {
27
+ if (r || r === 0)
28
+ throw new Error(
29
+ B(
30
+ "DSDialog",
31
+ "Do not pass the tabindex property to the DSDialog component as it is not interactive and does not receive focus. The DSDialogs contents, including the close button contained in the DSDialog, can receive focus and be interactive."
32
+ )
33
+ );
34
+ }, G = ({
35
+ children: r,
36
+ className: m,
37
+ closeButtonLabel: g = "Close dialog",
38
+ disableBackdropClose: q = !1,
39
+ footer: c,
40
+ header: D,
41
+ hideCloseButton: a = !1,
42
+ isOpen: h,
43
+ onClose: l,
44
+ ...i
45
+ }) => {
46
+ if (process.env.NODE_ENV !== "production") {
47
+ const { tabIndex: e } = i;
48
+ I({
49
+ tabIndex: e
50
+ });
51
+ }
52
+ const t = v(null), _ = v(null), [d, S] = x(!1);
53
+ b(() => {
54
+ const e = _.current;
55
+ if (e) {
56
+ const f = () => {
57
+ S(
58
+ e.scrollHeight > e.clientHeight
59
+ );
60
+ };
61
+ f();
62
+ const p = new ResizeObserver(f);
63
+ return p.observe(e), () => {
64
+ p.disconnect();
65
+ };
66
+ }
67
+ }, []), b(() => {
68
+ const e = t.current;
69
+ if (e)
70
+ return e.addEventListener("close", u), h ? e.showModal() : e.close(), () => {
71
+ e.removeEventListener("close", u);
72
+ };
73
+ }, [h, l]);
74
+ const u = () => {
75
+ l && l();
76
+ }, N = (e) => {
77
+ q || t.current && e.target === t.current && t.current.close();
78
+ }, w = () => {
79
+ t.current && t.current.close();
80
+ };
81
+ return /* @__PURE__ */ n.jsx(
82
+ "dialog",
83
+ {
84
+ ...i,
85
+ ref: t,
86
+ className: o.dialog,
87
+ onMouseDown: (e) => N(e),
88
+ "aria-modal": "true",
89
+ children: /* @__PURE__ */ n.jsxs(
90
+ "div",
91
+ {
92
+ className: s(o.contentWrapper, m, {
93
+ [o.contentWrapperNoFooter]: !c
94
+ }),
95
+ children: [
96
+ !a && /* @__PURE__ */ n.jsx(
97
+ j,
98
+ {
99
+ className: o.closeButton,
100
+ hideLabel: !0,
101
+ iconName: "cross",
102
+ size: "small",
103
+ type: "button",
104
+ variant: "ghost",
105
+ onClick: () => w(),
106
+ children: g
107
+ }
108
+ ),
109
+ /* @__PURE__ */ n.jsx(
110
+ "header",
111
+ {
112
+ className: s(o.header, {
113
+ [o.headerCloseButton]: !a,
114
+ [o.headerScrollable]: d
115
+ }),
116
+ children: D
117
+ }
118
+ ),
119
+ /* @__PURE__ */ n.jsx(
120
+ "div",
121
+ {
122
+ ref: _,
123
+ className: s(o.content, {
124
+ [o.contentNoFooter]: !c
125
+ }),
126
+ tabIndex: 0,
127
+ children: r
128
+ }
129
+ ),
130
+ c && /* @__PURE__ */ n.jsx(
131
+ "footer",
132
+ {
133
+ className: s(o.footer, {
134
+ [o.footerScrollable]: d
135
+ }),
136
+ children: c
137
+ }
138
+ )
139
+ ]
140
+ }
141
+ )
142
+ }
143
+ );
144
+ };
145
+ export {
146
+ G as D,
147
+ I as v
148
+ };
@@ -0,0 +1,154 @@
1
+ "use client";
2
+ import { j as r } from "./jsx-runtime.C115EyI4.js";
3
+ import { c as n } from "./index.CvOaL64Y.js";
4
+ import { useRef as b, useState as j, useEffect as w } from "react";
5
+ import { DSButton as B } from "../button.CkHCQg3Y.js";
6
+ import { g as R } from "./helpers.B1JT5ShS.js";
7
+ import '../assets/Drawer.BqBgbSuP.css';const W = "_drawer_h62s5_85", C = "_drawer--end_h62s5_143", F = "_content-wrapper_h62s5_161", k = "_content-wrapper--no-footer_h62s5_167", I = "_close-button_h62s5_170", O = "_header_h62s5_183", y = "_content_h62s5_161", z = "_footer_h62s5_185", L = "_header--scrollable_h62s5_206", M = "_header--close-button_h62s5_215", H = "_content--no-footer_h62s5_229", P = "_footer--scrollable_h62s5_236", o = {
8
+ drawer: W,
9
+ "drawer--end": "_drawer--end_h62s5_143",
10
+ drawerEnd: C,
11
+ "content-wrapper": "_content-wrapper_h62s5_161",
12
+ contentWrapper: F,
13
+ "content-wrapper--no-footer": "_content-wrapper--no-footer_h62s5_167",
14
+ contentWrapperNoFooter: k,
15
+ "close-button": "_close-button_h62s5_170",
16
+ closeButton: I,
17
+ header: O,
18
+ content: y,
19
+ footer: z,
20
+ "header--scrollable": "_header--scrollable_h62s5_206",
21
+ headerScrollable: L,
22
+ "header--close-button": "_header--close-button_h62s5_215",
23
+ headerCloseButton: M,
24
+ "content--no-footer": "_content--no-footer_h62s5_229",
25
+ contentNoFooter: H,
26
+ "footer--scrollable": "_footer--scrollable_h62s5_236",
27
+ footerScrollable: P
28
+ }, K = ["start", "end"], T = ({ tabIndex: s }) => {
29
+ if (s || s === 0)
30
+ throw new Error(
31
+ R(
32
+ "DSDrawer",
33
+ "Do not pass the tabindex property to the DSDrawer component as it is not interactive and does not receive focus. The DSDrawers contents, including the close button contained in the DSDrawer, can receive focus and be interactive."
34
+ )
35
+ );
36
+ }, Q = ({
37
+ children: s,
38
+ className: m,
39
+ closeButtonLabel: D = "Close modal",
40
+ disableBackdropClose: S = !1,
41
+ footer: c,
42
+ header: N,
43
+ hideCloseButton: l = !1,
44
+ position: v = "start",
45
+ isOpen: d,
46
+ onClose: a,
47
+ ..._
48
+ }) => {
49
+ if (process.env.NODE_ENV !== "production") {
50
+ const { tabIndex: e } = _;
51
+ T({
52
+ tabIndex: e
53
+ });
54
+ }
55
+ const t = b(null), h = b(null), [i, E] = j(!1);
56
+ w(() => {
57
+ const e = h.current;
58
+ if (e) {
59
+ const f = () => {
60
+ E(
61
+ e.scrollHeight > e.clientHeight
62
+ );
63
+ };
64
+ f();
65
+ const p = new ResizeObserver(f);
66
+ return p.observe(e), () => {
67
+ p.disconnect();
68
+ };
69
+ }
70
+ }, []), w(() => {
71
+ const e = t.current;
72
+ if (e)
73
+ return e.addEventListener("close", u), d ? e.showModal() : e.close(), () => {
74
+ e.removeEventListener("close", u);
75
+ };
76
+ }, [d, a]);
77
+ const u = () => {
78
+ a && a();
79
+ }, x = (e) => {
80
+ S || t.current && e.target === t.current && t.current.close();
81
+ }, g = () => {
82
+ t.current && t.current.close();
83
+ };
84
+ return /* @__PURE__ */ r.jsx(
85
+ "dialog",
86
+ {
87
+ ..._,
88
+ ref: t,
89
+ className: n(o.drawer, {
90
+ [o.drawerEnd]: v === "end"
91
+ }),
92
+ onMouseDown: (e) => x(e),
93
+ "aria-modal": "true",
94
+ children: /* @__PURE__ */ r.jsxs(
95
+ "div",
96
+ {
97
+ className: n(o.contentWrapper, m, {
98
+ [o.contentWrapperNoFooter]: !c
99
+ }),
100
+ children: [
101
+ !l && /* @__PURE__ */ r.jsx(
102
+ B,
103
+ {
104
+ className: o.closeButton,
105
+ hideLabel: !0,
106
+ iconName: "cross",
107
+ size: "small",
108
+ type: "button",
109
+ variant: "ghost",
110
+ onClick: () => g(),
111
+ children: D
112
+ }
113
+ ),
114
+ /* @__PURE__ */ r.jsx(
115
+ "header",
116
+ {
117
+ className: n(o.header, {
118
+ [o.headerCloseButton]: !l,
119
+ [o.headerScrollable]: i
120
+ }),
121
+ children: N
122
+ }
123
+ ),
124
+ /* @__PURE__ */ r.jsx(
125
+ "div",
126
+ {
127
+ ref: h,
128
+ className: n(o.content, {
129
+ [o.contentNoFooter]: !c
130
+ }),
131
+ tabIndex: 0,
132
+ children: s
133
+ }
134
+ ),
135
+ c && /* @__PURE__ */ r.jsx(
136
+ "footer",
137
+ {
138
+ className: n(o.footer, {
139
+ [o.footerScrollable]: i
140
+ }),
141
+ children: c
142
+ }
143
+ )
144
+ ]
145
+ }
146
+ )
147
+ }
148
+ );
149
+ };
150
+ export {
151
+ Q as D,
152
+ K as a,
153
+ T as v
154
+ };
@@ -2,21 +2,21 @@
2
2
  import { j as e } from "./jsx-runtime.C115EyI4.js";
3
3
  import { c } from "./index.CvOaL64Y.js";
4
4
  import "react";
5
- import { Asterisk as y } from "../asterisk.Cjbk-xZi.js";
6
- import { DSHeading as F } from "../heading.BTNroD1E.js";
7
- import { DSSystemFeedback as k } from "../systemfeedback.CUWch42u.js";
8
- import { g as j } from "./helpers.B1JT5ShS.js";
9
- import '../assets/Fieldset.D0jHAGRL.css';const v = "_root_z5foq_76", w = "_child-wrapper_z5foq_82", N = "_legend_z5foq_89", E = "_legend--utility--m_z5foq_93", M = "_description_z5foq_104", C = "_description--small_z5foq_117", P = "_system-feedback_z5foq_121", i = {
5
+ import { Asterisk as z } from "../asterisk.DDn-yX4P.js";
6
+ import { DSHeading as F } from "../heading.CAkraI2D.js";
7
+ import { DSSystemFeedback as k } from "../systemfeedback._8gatmgR.js";
8
+ import { g as h } from "./helpers.B1JT5ShS.js";
9
+ import '../assets/Fieldset.qHYeUFZt.css';const v = "_root_xfwzz_76", N = "_child-wrapper_xfwzz_82", E = "_legend_xfwzz_89", M = "_legend--utility--m_xfwzz_93", q = "_description_xfwzz_106", C = "_description--small_xfwzz_121", P = "_system-feedback_xfwzz_125", i = {
10
10
  root: v,
11
- "child-wrapper": "_child-wrapper_z5foq_82",
12
- childWrapper: w,
13
- legend: N,
14
- "legend--utility--m": "_legend--utility--m_z5foq_93",
15
- legendUtilityM: E,
16
- description: M,
17
- "description--small": "_description--small_z5foq_117",
11
+ "child-wrapper": "_child-wrapper_xfwzz_82",
12
+ childWrapper: N,
13
+ legend: E,
14
+ "legend--utility--m": "_legend--utility--m_xfwzz_93",
15
+ legendUtilityM: M,
16
+ description: q,
17
+ "description--small": "_description--small_xfwzz_121",
18
18
  descriptionSmall: C,
19
- "system-feedback": "_system-feedback_z5foq_121",
19
+ "system-feedback": "_system-feedback_xfwzz_125",
20
20
  systemFeedback: P
21
21
  }, T = ({
22
22
  description: a,
@@ -26,14 +26,14 @@ import '../assets/Fieldset.D0jHAGRL.css';const v = "_root_z5foq_76", w = "_child
26
26
  }) => {
27
27
  if (!s && (a || t))
28
28
  throw new Error(
29
- j(
29
+ h(
30
30
  "DSFieldset",
31
31
  'A unique "id" prop is required when providing the description or systemFeedback property. Please add an unique "id" prop to the DSFieldset component.'
32
32
  )
33
33
  );
34
34
  if (!n)
35
35
  throw new Error(
36
- j(
36
+ h(
37
37
  "DSFieldset",
38
38
  "The legend prop is required. Please add the legend prop to the DSFieldset component."
39
39
  )
@@ -43,42 +43,42 @@ import '../assets/Fieldset.D0jHAGRL.css';const v = "_root_z5foq_76", w = "_child
43
43
  legend: s,
44
44
  className: n,
45
45
  description: t,
46
- disabled: q = !1,
46
+ disabled: w = !1,
47
47
  id: d,
48
48
  invalid: p = !1,
49
49
  required: m = !1,
50
50
  systemFeedback: o,
51
- ...S
51
+ ...y
52
52
  }) => {
53
53
  process.env.NODE_ENV !== "production" && T({ description: t, id: d, legend: s, systemFeedback: o });
54
54
  let r, _, f;
55
55
  const l = typeof s == "object" && s !== void 0;
56
56
  l && ({ headingSize: r, headingTag: _, headingText: f } = s);
57
- const g = `${d}-feedback`, h = `${d}-description`, b = [
57
+ const g = `${d}-feedback`, x = `${d}-description`, j = [
58
58
  o && g,
59
- t && h
60
- ].filter(Boolean).join(" "), u = !l || r === "small" || r === "small-uppercase", x = c(i.root, n), z = c(i.legend, {
59
+ t && x
60
+ ].filter(Boolean).join(" "), S = !l || r === "small" || r === "small-uppercase", b = c(i.root, n), u = c(i.legend, {
61
61
  [i.legendUtilityM]: !l
62
62
  }), D = c(i.description, {
63
- [i.descriptionSmall]: u
63
+ [i.descriptionSmall]: S
64
64
  });
65
65
  return /* @__PURE__ */ e.jsxs(
66
66
  "fieldset",
67
67
  {
68
- className: x,
69
- disabled: q,
70
- ...S,
68
+ className: b,
69
+ disabled: w,
70
+ ...y,
71
71
  "aria-invalid": p,
72
- "aria-describedby": b || void 0,
72
+ "aria-describedby": j || void 0,
73
73
  children: [
74
- /* @__PURE__ */ e.jsx("legend", { className: z, children: l ? /* @__PURE__ */ e.jsxs(F, { tag: _, size: r, children: [
74
+ /* @__PURE__ */ e.jsx("legend", { className: u, children: l ? /* @__PURE__ */ e.jsxs(F, { tag: _, size: r, children: [
75
75
  f,
76
- m && /* @__PURE__ */ e.jsx(y, {})
76
+ m && /* @__PURE__ */ e.jsx(z, {})
77
77
  ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
78
78
  s,
79
- m && /* @__PURE__ */ e.jsx(y, {})
79
+ m && /* @__PURE__ */ e.jsx(z, {})
80
80
  ] }) }),
81
- t && /* @__PURE__ */ e.jsx("span", { id: h, className: D, children: t }),
81
+ t && /* @__PURE__ */ e.jsx("span", { id: x, className: D, children: t }),
82
82
  p && o && /* @__PURE__ */ e.jsx(
83
83
  k,
84
84
  {
@@ -1,8 +1,9 @@
1
1
  "use client";
2
+ import { useLayoutEffect as p, useEffect as u } from "react";
3
+ import { h } from "./useBreakpoint.5xBNDiCf.js";
2
4
  import { g as t } from "./helpers.B1JT5ShS.js";
3
- import "react";
4
- import { h as p } from "./has-document.r9i9TxKV.js";
5
- const a = 8, i = 5, T = ["medium", "small"], u = [
5
+ import { h as l } from "./has-document.r9i9TxKV.js";
6
+ const f = h ? p : u, a = 8, i = 5, U = ["medium", "small"], S = [
6
7
  "color",
7
8
  "date",
8
9
  "datetime-local",
@@ -15,7 +16,7 @@ const a = 8, i = 5, T = ["medium", "small"], u = [
15
16
  "text",
16
17
  "time",
17
18
  "url"
18
- ], l = [
19
+ ], w = [
19
20
  "week",
20
21
  "hidden",
21
22
  "button",
@@ -27,7 +28,7 @@ const a = 8, i = 5, T = ["medium", "small"], u = [
27
28
  "submit",
28
29
  "image",
29
30
  "datetime"
30
- ], b = ({
31
+ ], P = ({
31
32
  id: e,
32
33
  label: n,
33
34
  prefix: o,
@@ -72,8 +73,8 @@ const a = 8, i = 5, T = ["medium", "small"], u = [
72
73
  "Suffix and an action button cannot be used at the same time."
73
74
  )
74
75
  );
75
- }, D = (e) => {
76
- if (!u.includes(e) && !l.includes(e))
76
+ }, g = (e) => {
77
+ if (!S.includes(e) && !w.includes(e))
77
78
  throw new Error(
78
79
  t(
79
80
  "DSInput",
@@ -95,17 +96,18 @@ const a = 8, i = 5, T = ["medium", "small"], u = [
95
96
  hidden: 'Type hidden is not supported by DSInput component. Use a default <input type="hidden" /> element instead.'
96
97
  };
97
98
  n[e] && console.warn(t("DSInput", n[e]));
98
- }, h = () => p && "showPicker" in HTMLInputElement.prototype && !!window.navigator.userAgent.match(/chrome|chromium|crios|edg/i), y = (e, n) => h() && (e || n), U = (e) => e === "date" || e === "datetime-local" || e === "month", P = (e) => e === "time";
99
+ }, I = () => l && "showPicker" in HTMLInputElement.prototype && !!window.navigator.userAgent.match(/chrome|chromium|crios|edg/i), E = (e, n) => I() && (e || n), k = (e) => e === "date" || e === "datetime-local" || e === "month", x = (e) => e === "time";
99
100
  export {
100
- T as I,
101
+ U as I,
101
102
  a as M,
102
- u as S,
103
- l as U,
103
+ S,
104
+ w as U,
104
105
  i as a,
105
- D as b,
106
- P as c,
107
- h,
108
- U as i,
109
- y as s,
110
- b as v
106
+ g as b,
107
+ x as c,
108
+ I as h,
109
+ k as i,
110
+ E as s,
111
+ f as u,
112
+ P as v
111
113
  };
@@ -0,0 +1,140 @@
1
+ "use client";
2
+ import { j as a } from "./jsx-runtime.C115EyI4.js";
3
+ import { c as i } from "./index.CvOaL64Y.js";
4
+ import { useState as A } from "react";
5
+ import { u as D } from "./useBreakpoint.5xBNDiCf.js";
6
+ import { Asterisk as C } from "../asterisk.DDn-yX4P.js";
7
+ import { DSButton as L } from "../button.CkHCQg3Y.js";
8
+ import { DSSystemFeedback as $ } from "../systemfeedback._8gatmgR.js";
9
+ import { g as x } from "./helpers.B1JT5ShS.js";
10
+ import '../assets/InputPassword.Cf394z47.css';const E = "_input_1pqhx_226", R = "_input--invalid_1pqhx_338", V = "_input--small_1pqhx_345", O = "_input--has-leading-icon_1pqhx_399", F = "_input--has-action-button_1pqhx_402", M = "_input--has-second-action-button_1pqhx_405", T = "_input--has-affix_1pqhx_417", G = "_input--is-ready_1pqhx_431", J = "_root_1pqhx_438", K = "_hint_1pqhx_446", Q = "_label_1pqhx_446", U = "_wrapper_1pqhx_450", W = "_action-button_1pqhx_456", X = "_label--hidden_1pqhx_475", Y = "_feedback_1pqhx_504", t = {
11
+ input: E,
12
+ "input--invalid": "_input--invalid_1pqhx_338",
13
+ inputInvalid: R,
14
+ "input--small": "_input--small_1pqhx_345",
15
+ inputSmall: V,
16
+ "input--has-leading-icon": "_input--has-leading-icon_1pqhx_399",
17
+ inputHasLeadingIcon: O,
18
+ "input--has-action-button": "_input--has-action-button_1pqhx_402",
19
+ inputHasActionButton: F,
20
+ "input--has-second-action-button": "_input--has-second-action-button_1pqhx_405",
21
+ inputHasSecondActionButton: M,
22
+ "input--has-affix": "_input--has-affix_1pqhx_417",
23
+ inputHasAffix: T,
24
+ "input--is-ready": "_input--is-ready_1pqhx_431",
25
+ inputIsReady: G,
26
+ root: J,
27
+ hint: K,
28
+ label: Q,
29
+ wrapper: U,
30
+ "action-button": "_action-button_1pqhx_456",
31
+ actionButton: W,
32
+ "label--hidden": "_label--hidden_1pqhx_475",
33
+ labelHidden: X,
34
+ feedback: Y
35
+ }, Z = ({ id: n, label: s }) => {
36
+ if (!n)
37
+ throw new Error(
38
+ x(
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
+ x(
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: b = "new-password",
54
+ className: f,
55
+ disabled: c = !1,
56
+ hidePasswordText: q = "Hide password",
57
+ hint: e,
58
+ hideLabel: w = !1,
59
+ invalid: o = !1,
60
+ readonly: r = !1,
61
+ required: d = !1,
62
+ showPasswordText: y = "Show password",
63
+ size: p = "medium",
64
+ systemFeedback: l,
65
+ ...S
66
+ }) => {
67
+ process.env.NODE_ENV !== "production" && Z({
68
+ id: n,
69
+ label: s
70
+ });
71
+ const [u, I] = A(!1), _ = `${n}-label`, h = `${n}-feedback`, m = `${n}-hint`, v = e ? ` ${m}` : "", B = D(w), H = i(t.root, f), g = i(t.input, {
72
+ // small input
73
+ [t.inputSmall]: p === "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]: B
81
+ }), N = i(t.actionButton, {
82
+ [t.actionButtonSmall]: p === "small"
83
+ }), j = () => {
84
+ I((k) => !k);
85
+ };
86
+ return /* @__PURE__ */ a.jsxs("div", { className: H, 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: m, children: e }),
92
+ o && l && /* @__PURE__ */ a.jsx(
93
+ $,
94
+ {
95
+ className: t.feedback,
96
+ message: l,
97
+ type: "invalid",
98
+ id: h
99
+ }
100
+ ),
101
+ /* @__PURE__ */ a.jsxs("div", { className: t.wrapper, children: [
102
+ /* @__PURE__ */ a.jsx(
103
+ "input",
104
+ {
105
+ className: g,
106
+ id: n,
107
+ ...S,
108
+ "aria-labelledby": `${_}${v}`,
109
+ "aria-describedby": o && l ? h : void 0,
110
+ "aria-invalid": o,
111
+ "aria-disabled": r,
112
+ readOnly: r,
113
+ required: d,
114
+ disabled: c,
115
+ autoComplete: b,
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: p,
128
+ onClick: j,
129
+ type: "button",
130
+ disabled: c,
131
+ children: u ? q : y
132
+ }
133
+ )
134
+ ] })
135
+ ] });
136
+ };
137
+ export {
138
+ pt as D,
139
+ Z as v
140
+ };