@stihl-design-system/components 1.0.0-RC.0 → 1.0.0-RC.1

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 (105) hide show
  1. package/README.md +10 -1
  2. package/assets/Asterisk.288a3f48.css +1 -0
  3. package/assets/Button.c09c516e.css +1 -0
  4. package/assets/ButtonRound.fd628e54.css +1 -0
  5. package/assets/Checkbox.cde01607.css +1 -0
  6. package/assets/CustomReactSelect.cdb5f164.css +1 -0
  7. package/assets/Fieldset.729910fe.css +1 -0
  8. package/assets/Heading.50f5e903.css +1 -0
  9. package/assets/Input.92913cfe.css +1 -0
  10. package/assets/InputPassword.d7b9c937.css +1 -0
  11. package/assets/InputSearch.888f630a.css +1 -0
  12. package/assets/InputStepper.969db0d2.css +1 -0
  13. package/assets/Link.75834750.css +1 -0
  14. package/assets/LinkStandalone.19bdab0d.css +1 -0
  15. package/assets/OptionCheckbox.c56568a3.css +1 -0
  16. package/assets/Radio.79d98dde.css +1 -0
  17. package/assets/Select.b9c135c2.css +1 -0
  18. package/assets/Switch.781e3de6.css +1 -0
  19. package/assets/SystemFeedback.c30264c0.css +1 -0
  20. package/assets/Text.ac70cc84.css +1 -0
  21. package/assets/Textarea.12046393.css +1 -0
  22. package/assets/Title.e9e5a7e6.css +1 -0
  23. package/asterisk.cb74ea72.js +8 -0
  24. package/button.87ad387c.js +135 -0
  25. package/buttonround.ecb24c29.js +118 -0
  26. package/checkbox.42617f46.js +112 -0
  27. package/{checkboxgroup.e9e25471.js → checkboxgroup.fa110fdf.js} +2 -2
  28. package/chunks/{CustomReactSelect.9d0a378a.js → CustomReactSelect.2e4e7ba0.js} +342 -338
  29. package/chunks/Link.module.15dedc23.js +37 -0
  30. package/{combobox.f98a4472.js → combobox.d93091e0.js} +1 -1
  31. package/{customreactselect.a53f9932.js → customreactselect.7c77375a.js} +4 -4
  32. package/fieldset.fdd84bda.js +98 -0
  33. package/heading.c02dcb70.js +44 -0
  34. package/index.es.js +19 -19
  35. package/input.064e0bbf.js +230 -0
  36. package/inputpassword.f76c2f62.js +139 -0
  37. package/inputsearch.6e913fc6.js +188 -0
  38. package/inputstepper.2047ec77.js +286 -0
  39. package/{link.cd3720d1.js → link.5eb13d6e.js} +1 -1
  40. package/linkstandalone.edfd6288.js +80 -0
  41. package/optioncheckbox.2369560b.js +43 -0
  42. package/package.json +10 -1
  43. package/radio.fd841ab0.js +79 -0
  44. package/{radiogroup.6a22fe96.js → radiogroup.e1c8ea3d.js} +2 -2
  45. package/select.88d40c51.js +188 -0
  46. package/styles/fonts/STIHLContrafaceDigitalDisplayTitling.woff +0 -0
  47. package/styles/fonts/STIHLContrafaceDigitalDisplayTitling.woff2 +0 -0
  48. package/styles/fonts/STIHLContrafaceDigitalText-Bold.woff +0 -0
  49. package/styles/fonts/STIHLContrafaceDigitalText-Bold.woff2 +0 -0
  50. package/styles/fonts/STIHLContrafaceDigitalText.woff +0 -0
  51. package/styles/fonts/STIHLContrafaceDigitalText.woff2 +0 -0
  52. package/styles/fonts/font-face.min.css +1 -1
  53. package/styles/scss/lib/_heading.scss +14 -6
  54. package/styles/scss/lib/_text.scss +12 -12
  55. package/switch.96fd1689.js +65 -0
  56. package/{systemfeedback.6bbd1505.js → systemfeedback.8515a4e0.js} +10 -10
  57. package/text.de8facb9.js +57 -0
  58. package/textarea.b8c40c8b.js +189 -0
  59. package/title.7be43d50.js +36 -0
  60. package/assets/Asterisk.582f2067.css +0 -1
  61. package/assets/Button.684e8bda.css +0 -1
  62. package/assets/ButtonRound.ca8748cf.css +0 -1
  63. package/assets/Checkbox.84cf6398.css +0 -1
  64. package/assets/CustomReactSelect.d89ccccb.css +0 -1
  65. package/assets/Fieldset.5297efb8.css +0 -1
  66. package/assets/Heading.32278621.css +0 -1
  67. package/assets/Input.2c508b2f.css +0 -1
  68. package/assets/InputPassword.a534f047.css +0 -1
  69. package/assets/InputSearch.8f986307.css +0 -1
  70. package/assets/InputStepper.52fb45ca.css +0 -1
  71. package/assets/Link.03deeca0.css +0 -1
  72. package/assets/LinkStandalone.7e23a8ac.css +0 -1
  73. package/assets/OptionCheckbox.9c20f6f1.css +0 -1
  74. package/assets/Radio.be8f06f5.css +0 -1
  75. package/assets/Select.b2423b5f.css +0 -1
  76. package/assets/Switch.f3ab20de.css +0 -1
  77. package/assets/SystemFeedback.f4421d60.css +0 -1
  78. package/assets/Text.4756effe.css +0 -1
  79. package/assets/Textarea.eecf04b3.css +0 -1
  80. package/assets/Title.60d50d3e.css +0 -1
  81. package/asterisk.91abccec.js +0 -8
  82. package/button.89b2675b.js +0 -135
  83. package/buttonround.c60c8034.js +0 -118
  84. package/checkbox.7d414047.js +0 -112
  85. package/chunks/Link.module.b8230547.js +0 -37
  86. package/fieldset.fb7b7e49.js +0 -98
  87. package/heading.cb7698f4.js +0 -44
  88. package/input.abb902e3.js +0 -228
  89. package/inputpassword.11c12c66.js +0 -139
  90. package/inputsearch.0c88e71a.js +0 -188
  91. package/inputstepper.b74dac4d.js +0 -284
  92. package/linkstandalone.26b52de0.js +0 -80
  93. package/optioncheckbox.7195f001.js +0 -43
  94. package/radio.1b205d64.js +0 -79
  95. package/select.2ff31eab.js +0 -188
  96. package/styles/fonts/STIHLContrafaceDisplayTitling.woff +0 -0
  97. package/styles/fonts/STIHLContrafaceDisplayTitling.woff2 +0 -0
  98. package/styles/fonts/STIHLContrafaceText-Bold.woff +0 -0
  99. package/styles/fonts/STIHLContrafaceText-Bold.woff2 +0 -0
  100. package/styles/fonts/STIHLContrafaceText.woff +0 -0
  101. package/styles/fonts/STIHLContrafaceText.woff2 +0 -0
  102. package/switch.2f011fcc.js +0 -65
  103. package/text.8d80704f.js +0 -57
  104. package/textarea.e156b0ce.js +0 -189
  105. package/title.d855a8e4.js +0 -36
@@ -0,0 +1,37 @@
1
+ import "../assets/Link.75834750.css";
2
+ const o = "_root_13jhz_49", t = "_root--highlight_13jhz_115", r = "_root--dark-highlight_13jhz_115", l = "_root--filled_13jhz_193", _ = "_root--outline_13jhz_221", h = "_root--ghost_13jhz_248", n = "_root--ghost-flush_13jhz_273", s = "_root--small_13jhz_279", i = "_root--dark-filled_13jhz_354", a = "_root--dark-outline_13jhz_413", e = "_root--dark-ghost_13jhz_471", d = "_root--dark-ghost-flush_13jhz_527", c = "_root--icon-left_13jhz_586", g = "_root--icon-only_13jhz_602", j = "_root--icon-only-small_13jhz_606", z = "_label--hidden_13jhz_613", u = {
3
+ root: o,
4
+ "root--highlight": "_root--highlight_13jhz_115",
5
+ rootHighlight: t,
6
+ "root--dark-highlight": "_root--dark-highlight_13jhz_115",
7
+ rootDarkHighlight: r,
8
+ "root--filled": "_root--filled_13jhz_193",
9
+ rootFilled: l,
10
+ "root--outline": "_root--outline_13jhz_221",
11
+ rootOutline: _,
12
+ "root--ghost": "_root--ghost_13jhz_248",
13
+ rootGhost: h,
14
+ "root--ghost-flush": "_root--ghost-flush_13jhz_273",
15
+ rootGhostFlush: n,
16
+ "root--small": "_root--small_13jhz_279",
17
+ rootSmall: s,
18
+ "root--dark-filled": "_root--dark-filled_13jhz_354",
19
+ rootDarkFilled: i,
20
+ "root--dark-outline": "_root--dark-outline_13jhz_413",
21
+ rootDarkOutline: a,
22
+ "root--dark-ghost": "_root--dark-ghost_13jhz_471",
23
+ rootDarkGhost: e,
24
+ "root--dark-ghost-flush": "_root--dark-ghost-flush_13jhz_527",
25
+ rootDarkGhostFlush: d,
26
+ "root--icon-left": "_root--icon-left_13jhz_586",
27
+ rootIconLeft: c,
28
+ "root--icon-only": "_root--icon-only_13jhz_602",
29
+ rootIconOnly: g,
30
+ "root--icon-only-small": "_root--icon-only-small_13jhz_606",
31
+ rootIconOnlySmall: j,
32
+ "label--hidden": "_label--hidden_13jhz_613",
33
+ labelHidden: z
34
+ };
35
+ export {
36
+ u as s
37
+ };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { j as p } from "./chunks/jsx-runtime.5c071667.js";
3
- import { v as u, C as x } from "./chunks/CustomReactSelect.9d0a378a.js";
3
+ import { v as u, C as x } from "./chunks/CustomReactSelect.2e4e7ba0.js";
4
4
  const j = ({
5
5
  id: s,
6
6
  label: o,
@@ -2,12 +2,12 @@
2
2
  import "./chunks/jsx-runtime.5c071667.js";
3
3
  import "./chunks/index.8021d3e0.js";
4
4
  import "react";
5
- import { C as l } from "./chunks/CustomReactSelect.9d0a378a.js";
5
+ import { C as l } from "./chunks/CustomReactSelect.2e4e7ba0.js";
6
6
  import "./chunks/useBreakpoint.6c1b06c2.js";
7
- import "./asterisk.91abccec.js";
7
+ import "./asterisk.cb74ea72.js";
8
8
  import "./icon.b4211784.js";
9
- import "./systemfeedback.6bbd1505.js";
10
- import "./optioncheckbox.7195f001.js";
9
+ import "./systemfeedback.8515a4e0.js";
10
+ import "./optioncheckbox.2369560b.js";
11
11
  export {
12
12
  l as CustomReactSelect
13
13
  };
@@ -0,0 +1,98 @@
1
+ import "./assets/Fieldset.729910fe.css";
2
+ import { j as e } from "./chunks/jsx-runtime.5c071667.js";
3
+ import { c } from "./chunks/index.8021d3e0.js";
4
+ import "react";
5
+ import { Asterisk as y } from "./asterisk.cb74ea72.js";
6
+ import { DSHeading as w } from "./heading.c02dcb70.js";
7
+ import { DSSystemFeedback as N } from "./systemfeedback.8515a4e0.js";
8
+ import { g as j } from "./chunks/helpers.ea3ca41a.js";
9
+ const v = "_root_iig2d_25", E = "_child-wrapper_iig2d_31", M = "_legend_iig2d_38", q = "_legend--utility--m_iig2d_41", C = "_description_iig2d_52", P = "_description--small_iig2d_65", T = "_system-feedback_iig2d_69", s = {
10
+ root: v,
11
+ "child-wrapper": "_child-wrapper_iig2d_31",
12
+ childWrapper: E,
13
+ legend: M,
14
+ "legend--utility--m": "_legend--utility--m_iig2d_41",
15
+ legendUtilityM: q,
16
+ description: C,
17
+ "description--small": "_description--small_iig2d_65",
18
+ descriptionSmall: P,
19
+ "system-feedback": "_system-feedback_iig2d_69",
20
+ systemFeedback: T
21
+ }, U = ({
22
+ description: l,
23
+ id: i,
24
+ legend: n,
25
+ systemFeedback: t
26
+ }) => {
27
+ if (!i && (l || t))
28
+ throw new Error(
29
+ j(
30
+ "DSFieldset",
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
+ )
33
+ );
34
+ if (!n)
35
+ throw new Error(
36
+ j(
37
+ "DSFieldset",
38
+ "The legend prop is required. Please add the legend prop to the DSFieldset component."
39
+ )
40
+ );
41
+ }, L = ({
42
+ children: l,
43
+ legend: i,
44
+ className: n,
45
+ description: t,
46
+ disabled: S = !1,
47
+ id: a,
48
+ invalid: p = !1,
49
+ required: m = !1,
50
+ systemFeedback: o,
51
+ ...b
52
+ }) => {
53
+ process.env.NODE_ENV !== "production" && U({ description: t, id: a, legend: i, systemFeedback: o });
54
+ let r, g, _;
55
+ const d = typeof i == "object" && i !== void 0;
56
+ d && ({ headingSize: r, headingTag: g, headingText: _ } = i);
57
+ const h = `${a}-feedback`, f = `${a}-description`, u = [
58
+ o && h,
59
+ t && f
60
+ ].filter(Boolean).join(" "), x = !d || r === "small" || r === "small-uppercase", D = c(s.root, n), F = c(s.legend, {
61
+ [s.legendUtilityM]: !d
62
+ }), k = c(s.description, {
63
+ [s.descriptionSmall]: x
64
+ });
65
+ return /* @__PURE__ */ e.jsxs(
66
+ "fieldset",
67
+ {
68
+ className: D,
69
+ disabled: S,
70
+ ...b,
71
+ "aria-invalid": p,
72
+ "aria-describedby": u || void 0,
73
+ children: [
74
+ /* @__PURE__ */ e.jsx("legend", { className: F, children: d ? /* @__PURE__ */ e.jsxs(w, { tag: g, size: r, children: [
75
+ _,
76
+ m && /* @__PURE__ */ e.jsx(y, {})
77
+ ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
78
+ i,
79
+ m && /* @__PURE__ */ e.jsx(y, {})
80
+ ] }) }),
81
+ t && /* @__PURE__ */ e.jsx("span", { id: f, className: k, children: t }),
82
+ p && o && /* @__PURE__ */ e.jsx(
83
+ N,
84
+ {
85
+ id: h,
86
+ type: "invalid",
87
+ message: o,
88
+ className: s.systemFeedback
89
+ }
90
+ ),
91
+ /* @__PURE__ */ e.jsx("div", { className: s.childWrapper, children: l })
92
+ ]
93
+ }
94
+ );
95
+ };
96
+ export {
97
+ L as DSFieldset
98
+ };
@@ -0,0 +1,44 @@
1
+ import "./assets/Heading.50f5e903.css";
2
+ import { j as p } from "./chunks/jsx-runtime.5c071667.js";
3
+ import { c as n } from "./chunks/index.8021d3e0.js";
4
+ const c = "_root_zvknl_25", u = "_root--x-large_zvknl_28", k = "_root--large_zvknl_42", d = "_root--medium_zvknl_56", g = "_root--medium-uppercase_zvknl_64", i = "_root--small_zvknl_72", v = "_root--small-uppercase_zvknl_80", z = "_root--theme-dark_zvknl_88", o = {
5
+ root: c,
6
+ "root--x-large": "_root--x-large_zvknl_28",
7
+ rootXLarge: u,
8
+ "root--large": "_root--large_zvknl_42",
9
+ rootLarge: k,
10
+ "root--medium": "_root--medium_zvknl_56",
11
+ rootMedium: d,
12
+ "root--medium-uppercase": "_root--medium-uppercase_zvknl_64",
13
+ rootMediumUppercase: g,
14
+ "root--small": "_root--small_zvknl_72",
15
+ rootSmall: i,
16
+ "root--small-uppercase": "_root--small-uppercase_zvknl_80",
17
+ rootSmallUppercase: v,
18
+ "root--theme-dark": "_root--theme-dark_zvknl_88",
19
+ rootThemeDark: z
20
+ }, L = ({
21
+ children: e,
22
+ className: t,
23
+ size: r = "medium",
24
+ tag: a = "h2",
25
+ // default tag because of SEO reasons (h1 should be used only once per page)
26
+ theme: l = "light",
27
+ ...m
28
+ }) => {
29
+ const _ = a, s = n(o.root, t, {
30
+ // sizes
31
+ [o.rootXLarge]: r === "x-large",
32
+ [o.rootLarge]: r === "large",
33
+ [o.rootMedium]: r == "medium",
34
+ [o.rootMediumUppercase]: r == "medium-uppercase",
35
+ [o.rootSmall]: r == "small",
36
+ [o.rootSmallUppercase]: r == "small-uppercase",
37
+ // dark theme
38
+ [o.rootThemeDark]: l === "dark"
39
+ });
40
+ return /* @__PURE__ */ p.jsx(_, { className: s, ...m, children: e });
41
+ };
42
+ export {
43
+ L as DSHeading
44
+ };
package/index.es.js CHANGED
@@ -1,27 +1,27 @@
1
1
  "use client";
2
- import { DSButton as t } from "./button.89b2675b.js";
3
- import { DSButtonRound as p } from "./buttonround.c60c8034.js";
4
- import { DSCheckbox as x } from "./checkbox.7d414047.js";
5
- import { DSCheckboxGroup as f } from "./checkboxgroup.e9e25471.js";
6
- import { DSCombobox as n } from "./combobox.f98a4472.js";
7
- import { DSFieldset as u } from "./fieldset.fb7b7e49.js";
2
+ import { DSButton as t } from "./button.87ad387c.js";
3
+ import { DSButtonRound as p } from "./buttonround.ecb24c29.js";
4
+ import { DSCheckbox as x } from "./checkbox.42617f46.js";
5
+ import { DSCheckboxGroup as f } from "./checkboxgroup.fa110fdf.js";
6
+ import { DSCombobox as n } from "./combobox.d93091e0.js";
7
+ import { DSFieldset as u } from "./fieldset.fdd84bda.js";
8
8
  import { DSFloatingActionButton as c } from "./floatingactionbutton.281b5465.js";
9
- import { DSHeading as l } from "./heading.cb7698f4.js";
9
+ import { DSHeading as l } from "./heading.c02dcb70.js";
10
10
  import { DSIcon as b } from "./icon.b4211784.js";
11
- import { DSInput as k } from "./input.abb902e3.js";
12
- import { DSInputPassword as g } from "./inputpassword.11c12c66.js";
13
- import { DSInputSearch as C } from "./inputsearch.0c88e71a.js";
14
- import { DSInputStepper as T } from "./inputstepper.b74dac4d.js";
15
- import { DSLink as F } from "./link.cd3720d1.js";
16
- import { DSLinkStandalone as R } from "./linkstandalone.26b52de0.js";
11
+ import { DSInput as k } from "./input.064e0bbf.js";
12
+ import { DSInputPassword as g } from "./inputpassword.f76c2f62.js";
13
+ import { DSInputSearch as C } from "./inputsearch.6e913fc6.js";
14
+ import { DSInputStepper as T } from "./inputstepper.2047ec77.js";
15
+ import { DSLink as F } from "./link.5eb13d6e.js";
16
+ import { DSLinkStandalone as R } from "./linkstandalone.edfd6288.js";
17
17
  import { DSLogo as H } from "./logo.e6576fe3.js";
18
- import { DSRadioGroup as j } from "./radiogroup.6a22fe96.js";
19
- import { DSSelect as v } from "./select.2ff31eab.js";
18
+ import { DSRadioGroup as j } from "./radiogroup.e1c8ea3d.js";
19
+ import { DSSelect as v } from "./select.88d40c51.js";
20
20
  import { DSSpinner as z } from "./spinner.ee015469.js";
21
- import { DSSwitch as J } from "./switch.2f011fcc.js";
22
- import { DSText as M } from "./text.8d80704f.js";
23
- import { DSTextarea as O } from "./textarea.e156b0ce.js";
24
- import { DSTitle as U } from "./title.d855a8e4.js";
21
+ import { DSSwitch as J } from "./switch.96fd1689.js";
22
+ import { DSText as M } from "./text.de8facb9.js";
23
+ import { DSTextarea as O } from "./textarea.b8c40c8b.js";
24
+ import { DSTitle as U } from "./title.7be43d50.js";
25
25
  export {
26
26
  t as DSButton,
27
27
  p as DSButtonRound,
@@ -0,0 +1,230 @@
1
+ import "./assets/Input.92913cfe.css";
2
+ import { j as i } from "./chunks/jsx-runtime.5c071667.js";
3
+ import { c as e } from "./chunks/index.8021d3e0.js";
4
+ import { useState as m, useRef as v, useLayoutEffect as D, useEffect as nt } from "react";
5
+ import { u as st } from "./chunks/useBreakpoint.6c1b06c2.js";
6
+ import { Asterisk as et } from "./asterisk.cb74ea72.js";
7
+ import { DSButton as T } from "./button.87ad387c.js";
8
+ import { DSIcon as lt } from "./icon.b4211784.js";
9
+ import { DSSystemFeedback as ot } from "./systemfeedback.8515a4e0.js";
10
+ import { v as ut, a as ct, M as dt, b as _t, s as rt, i as C, c as pt } from "./chunks/Input.utils.f8f3286f.js";
11
+ const ft = "_input_11iuy_73", mt = "_input--invalid_11iuy_183", yt = "_input--small_11iuy_190", ht = "_input--has-leading-icon_11iuy_236", bt = "_input--has-action-button_11iuy_239", xt = "_input--has-second-action-button_11iuy_242", gt = "_input--has-affix_11iuy_254", St = "_input--is-ready_11iuy_266", It = "_root_11iuy_273", Ht = "_hint_11iuy_281", kt = "_label_11iuy_281", vt = "_wrapper_11iuy_285", Ct = "_affix_11iuy_291", Lt = "_affix--small_11iuy_309", jt = "_affix--disabled_11iuy_321", At = "_prefix_11iuy_325", Rt = "_suffix_11iuy_331", Nt = "_leading-icon_11iuy_336", Bt = "_leading-icon--small_11iuy_341", wt = "_action-button_11iuy_345", Dt = "_label--hidden_11iuy_362", Tt = "_feedback_11iuy_389", t = {
12
+ input: ft,
13
+ "input--invalid": "_input--invalid_11iuy_183",
14
+ inputInvalid: mt,
15
+ "input--small": "_input--small_11iuy_190",
16
+ inputSmall: yt,
17
+ "input--has-leading-icon": "_input--has-leading-icon_11iuy_236",
18
+ inputHasLeadingIcon: ht,
19
+ "input--has-action-button": "_input--has-action-button_11iuy_239",
20
+ inputHasActionButton: bt,
21
+ "input--has-second-action-button": "_input--has-second-action-button_11iuy_242",
22
+ inputHasSecondActionButton: xt,
23
+ "input--has-affix": "_input--has-affix_11iuy_254",
24
+ inputHasAffix: gt,
25
+ "input--is-ready": "_input--is-ready_11iuy_266",
26
+ inputIsReady: St,
27
+ root: It,
28
+ hint: Ht,
29
+ label: kt,
30
+ wrapper: vt,
31
+ affix: Ct,
32
+ "affix--small": "_affix--small_11iuy_309",
33
+ affixSmall: Lt,
34
+ "affix--disabled": "_affix--disabled_11iuy_321",
35
+ affixDisabled: jt,
36
+ prefix: At,
37
+ suffix: Rt,
38
+ "leading-icon": "_leading-icon_11iuy_336",
39
+ leadingIcon: Nt,
40
+ "leading-icon--small": "_leading-icon--small_11iuy_341",
41
+ leadingIconSmall: Bt,
42
+ "action-button": "_action-button_11iuy_345",
43
+ actionButton: wt,
44
+ "label--hidden": "_label--hidden_11iuy_362",
45
+ labelHidden: Dt,
46
+ feedback: Tt
47
+ }, Ut = ({
48
+ id: c,
49
+ label: L,
50
+ actionButtonLabel: E,
51
+ actionButtonIconName: _,
52
+ actionButtonIconSource: y,
53
+ actionButtonOnClick: F,
54
+ className: P,
55
+ disabled: l = !1,
56
+ hint: h,
57
+ hideLabel: O = !1,
58
+ invalid: r = !1,
59
+ leadingIconName: p,
60
+ leadingIconSource: f,
61
+ prefix: n,
62
+ readonly: d = !1,
63
+ required: j = !1,
64
+ size: s = "medium",
65
+ suffix: a,
66
+ systemFeedback: b,
67
+ type: o = "text",
68
+ ...$
69
+ }) => {
70
+ process.env.NODE_ENV !== "production" && (ut({
71
+ id: c,
72
+ label: L,
73
+ prefix: n,
74
+ suffix: a,
75
+ leadingIconName: p,
76
+ leadingIconSource: f,
77
+ actionButtonIconName: _,
78
+ actionButtonIconSource: y
79
+ }), ct(o));
80
+ const [W, X] = m(!1), [M, V] = m(!1), [x, G] = m(!1), [U, J] = m({}), g = v(null), K = n == null ? void 0 : n.substring(0, dt), S = v(null), Q = a == null ? void 0 : a.substring(0, _t), I = v(null), Y = st(O);
81
+ D(() => {
82
+ const u = s === "medium" ? 16 : 8, H = {};
83
+ if (S.current) {
84
+ const k = S.current.offsetWidth;
85
+ H.paddingLeft = u + k + "px";
86
+ }
87
+ if (I.current) {
88
+ const k = I.current.offsetWidth;
89
+ H.paddingRight = u + k + "px";
90
+ }
91
+ J(H), X(!0);
92
+ }, [n, a, s, M]), D(() => {
93
+ (async () => {
94
+ "fonts" in document && (await document.fonts.load(
95
+ '1em "STIHL Contraface Digital Text Regular"'
96
+ ), V(!0));
97
+ })();
98
+ }, []), nt(() => {
99
+ const u = rt(
100
+ C(o),
101
+ pt(o)
102
+ );
103
+ G(u);
104
+ }, [o]);
105
+ const A = e(t.affix, {
106
+ [t.affixSmall]: s === "small",
107
+ [t.affixDisabled]: l
108
+ }), R = `${c}-label`, N = `${c}-feedback`, B = `${c}-hint`, Z = h ? ` ${B}` : "", q = e(t.root, P), z = e(t.input, {
109
+ // small input
110
+ [t.inputSmall]: s === "small",
111
+ // invalid state
112
+ [t.inputInvalid]: r,
113
+ // leading icon
114
+ [t.inputHasLeadingIcon]: p || f,
115
+ // prefix/suffix
116
+ [t.inputHasAffix]: n || a,
117
+ // action button
118
+ [t.inputHasActionButton]: _ || y || x,
119
+ [t.inputIsReady]: W
120
+ }), tt = e(t.label, {
121
+ // hide label only visually to keep them available for assistive technologies
122
+ [t.labelHidden]: Y
123
+ }), it = e(t.leadingIcon, {
124
+ [t.leadingIconSmall]: s === "small"
125
+ }), w = e(t.actionButton, {
126
+ [t.actionButtonSmall]: s === "small"
127
+ }), at = (u) => {
128
+ g.current && !l && !d && g.current.showPicker(), u.preventDefault();
129
+ };
130
+ return /* @__PURE__ */ i.jsxs("div", { className: q, children: [
131
+ /* @__PURE__ */ i.jsxs("label", { className: tt, id: R, htmlFor: c, children: [
132
+ L,
133
+ j && /* @__PURE__ */ i.jsx(et, {})
134
+ ] }),
135
+ h && /* @__PURE__ */ i.jsx("div", { className: t.hint, id: B, children: h }),
136
+ r && b && /* @__PURE__ */ i.jsx(
137
+ ot,
138
+ {
139
+ className: t.feedback,
140
+ message: b,
141
+ type: "invalid",
142
+ id: N
143
+ }
144
+ ),
145
+ /* @__PURE__ */ i.jsxs("div", { className: t.wrapper, children: [
146
+ n && /* @__PURE__ */ i.jsx(
147
+ "span",
148
+ {
149
+ className: e(A, t.prefix),
150
+ ref: S,
151
+ "aria-disabled": l,
152
+ children: K
153
+ }
154
+ ),
155
+ !n && (p || f) && /* @__PURE__ */ i.jsx(
156
+ lt,
157
+ {
158
+ name: p,
159
+ theme: "light",
160
+ source: f,
161
+ className: it,
162
+ "aria-hidden": "true"
163
+ }
164
+ ),
165
+ /* @__PURE__ */ i.jsx(
166
+ "input",
167
+ {
168
+ type: o,
169
+ className: z,
170
+ id: c,
171
+ ref: g,
172
+ ...$,
173
+ style: U,
174
+ "aria-labelledby": `${R}${Z}`,
175
+ "aria-describedby": r && b ? N : void 0,
176
+ "aria-invalid": r,
177
+ "aria-disabled": d,
178
+ readOnly: d,
179
+ required: j,
180
+ disabled: l
181
+ }
182
+ ),
183
+ a && /* @__PURE__ */ i.jsx(
184
+ "span",
185
+ {
186
+ className: e(A, t.suffix),
187
+ ref: I,
188
+ "aria-disabled": l,
189
+ children: Q
190
+ }
191
+ ),
192
+ !a && !x && (_ || y) && /* @__PURE__ */ i.jsx(
193
+ T,
194
+ {
195
+ hideLabel: !0,
196
+ theme: "light",
197
+ iconName: _,
198
+ variant: "ghost",
199
+ className: w,
200
+ size: s,
201
+ onClick: F,
202
+ type: "button",
203
+ disabled: l || d,
204
+ children: E
205
+ }
206
+ ),
207
+ !a && x && !d && !l && /* @__PURE__ */ i.jsxs(
208
+ T,
209
+ {
210
+ hideLabel: !0,
211
+ theme: "light",
212
+ iconName: C(o) ? "calendar" : "clock",
213
+ variant: "ghost",
214
+ className: w,
215
+ size: s,
216
+ onClick: at,
217
+ type: "button",
218
+ children: [
219
+ "Open ",
220
+ C(o) ? "date" : "time",
221
+ " picker"
222
+ ]
223
+ }
224
+ )
225
+ ] })
226
+ ] });
227
+ };
228
+ export {
229
+ Ut as DSInput
230
+ };
@@ -0,0 +1,139 @@
1
+ import "./assets/InputPassword.d7b9c937.css";
2
+ import { j as a } from "./chunks/jsx-runtime.5c071667.js";
3
+ import { c as o } from "./chunks/index.8021d3e0.js";
4
+ import { useState as D } from "react";
5
+ import { u as C } from "./chunks/useBreakpoint.6c1b06c2.js";
6
+ import { Asterisk as L } from "./asterisk.cb74ea72.js";
7
+ import { DSButton as $ } from "./button.87ad387c.js";
8
+ import { DSSystemFeedback as E } from "./systemfeedback.8515a4e0.js";
9
+ import { g as h } from "./chunks/helpers.ea3ca41a.js";
10
+ const q = "_input_1encj_73", R = "_input--invalid_1encj_183", V = "_input--small_1encj_190", O = "_input--has-leading-icon_1encj_236", F = "_input--has-action-button_1encj_239", M = "_input--has-second-action-button_1encj_242", T = "_input--has-affix_1encj_254", G = "_input--is-ready_1encj_266", J = "_root_1encj_273", K = "_hint_1encj_281", Q = "_label_1encj_281", U = "_wrapper_1encj_285", W = "_action-button_1encj_291", X = "_label--hidden_1encj_308", Y = "_feedback_1encj_335", n = {
11
+ input: q,
12
+ "input--invalid": "_input--invalid_1encj_183",
13
+ inputInvalid: R,
14
+ "input--small": "_input--small_1encj_190",
15
+ inputSmall: V,
16
+ "input--has-leading-icon": "_input--has-leading-icon_1encj_236",
17
+ inputHasLeadingIcon: O,
18
+ "input--has-action-button": "_input--has-action-button_1encj_239",
19
+ inputHasActionButton: F,
20
+ "input--has-second-action-button": "_input--has-second-action-button_1encj_242",
21
+ inputHasSecondActionButton: M,
22
+ "input--has-affix": "_input--has-affix_1encj_254",
23
+ inputHasAffix: T,
24
+ "input--is-ready": "_input--is-ready_1encj_266",
25
+ inputIsReady: G,
26
+ root: J,
27
+ hint: K,
28
+ label: Q,
29
+ wrapper: U,
30
+ "action-button": "_action-button_1encj_291",
31
+ actionButton: W,
32
+ "label--hidden": "_label--hidden_1encj_308",
33
+ labelHidden: X,
34
+ feedback: Y
35
+ }, Z = ({ id: t, label: e }) => {
36
+ if (!t)
37
+ throw new Error(
38
+ h(
39
+ "DSInputPassword",
40
+ 'A unique "id" prop is required. Please add an unique "id" prop to the DSInputPassword component.'
41
+ )
42
+ );
43
+ if (!e)
44
+ throw new Error(
45
+ h(
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
+ }, pn = ({
51
+ id: t,
52
+ label: e,
53
+ autocomplete: f = "new-password",
54
+ className: j,
55
+ disabled: u = !1,
56
+ hidePasswordText: w = "Hide password",
57
+ hint: i,
58
+ hideLabel: y = !1,
59
+ invalid: s = !1,
60
+ readonly: r = !1,
61
+ required: d = !1,
62
+ showPasswordText: S = "Show password",
63
+ size: c = "medium",
64
+ systemFeedback: l,
65
+ ...x
66
+ }) => {
67
+ process.env.NODE_ENV !== "production" && Z({
68
+ id: t,
69
+ label: e
70
+ });
71
+ const [p, I] = D(!1), _ = `${t}-label`, m = `${t}-feedback`, b = `${t}-hint`, B = i ? ` ${b}` : "", H = C(y), g = o(n.root, j), v = o(n.input, {
72
+ // small input
73
+ [n.inputSmall]: c === "small",
74
+ // invalid state
75
+ [n.inputInvalid]: s,
76
+ // action button - input password always has an action button
77
+ [n.inputHasActionButton]: !0
78
+ }), P = o(n.label, {
79
+ // hide label only visually to keep them available for assistive technologies
80
+ [n.labelHidden]: H
81
+ }), N = o(n.actionButton, {
82
+ [n.actionButtonSmall]: c === "small"
83
+ }), k = () => {
84
+ I((A) => !A);
85
+ };
86
+ return /* @__PURE__ */ a.jsxs("div", { className: g, children: [
87
+ /* @__PURE__ */ a.jsxs("label", { className: P, id: _, htmlFor: t, children: [
88
+ e,
89
+ d && /* @__PURE__ */ a.jsx(L, {})
90
+ ] }),
91
+ i && /* @__PURE__ */ a.jsx("div", { className: n.hint, id: b, children: i }),
92
+ s && l && /* @__PURE__ */ a.jsx(
93
+ E,
94
+ {
95
+ className: n.feedback,
96
+ message: l,
97
+ type: "invalid",
98
+ id: m
99
+ }
100
+ ),
101
+ /* @__PURE__ */ a.jsxs("div", { className: n.wrapper, children: [
102
+ /* @__PURE__ */ a.jsx(
103
+ "input",
104
+ {
105
+ className: v,
106
+ id: t,
107
+ ...x,
108
+ "aria-labelledby": `${_}${B}`,
109
+ "aria-describedby": s && l ? m : void 0,
110
+ "aria-invalid": s,
111
+ "aria-disabled": r,
112
+ readOnly: r,
113
+ required: d,
114
+ disabled: u,
115
+ autoComplete: f,
116
+ type: p ? "text" : "password"
117
+ }
118
+ ),
119
+ /* @__PURE__ */ a.jsx(
120
+ $,
121
+ {
122
+ hideLabel: !0,
123
+ theme: "light",
124
+ iconName: p ? "eye-closed" : "eye",
125
+ variant: "ghost",
126
+ className: N,
127
+ size: c,
128
+ onClick: k,
129
+ type: "button",
130
+ disabled: u,
131
+ children: p ? w : S
132
+ }
133
+ )
134
+ ] })
135
+ ] });
136
+ };
137
+ export {
138
+ pn as DSInputPassword
139
+ };