@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,115 @@
1
+ "use client";
2
+ import { j as i } from "./chunks/jsx-runtime.C115EyI4.js";
3
+ import { c as _ } from "./chunks/index.CvOaL64Y.js";
4
+ import { forwardRef as $, useRef as y, useState as E, useEffect as L, useCallback as O } from "react";
5
+ import { u as P } from "./chunks/useBreakpoint.5xBNDiCf.js";
6
+ import './assets/radio.9kpIO3HC.css';const C = (n) => n.replace(/\s+/g, ""), U = "_radio-root_o7n7v_76", q = "_radio-root--disabled_o7n7v_97", z = "_radio-root--with-custom-area_o7n7v_100", F = "_radio_o7n7v_76", G = "_dot_o7n7v_121", J = "_radio--invalid_o7n7v_145", K = "_label_o7n7v_150", M = "_label--bold_o7n7v_165", Q = "_label--hidden_o7n7v_177", T = "_label--with-custom-area_o7n7v_189", X = "_custom-area_o7n7v_193", Y = "_hint_o7n7v_201", Z = "_hint--visible_o7n7v_225", oo = "_hint--unchecked-hidden_o7n7v_229", eo = "_hint--hidden_o7n7v_234", to = "_input_o7n7v_247", o = {
7
+ "radio-root": "_radio-root_o7n7v_76",
8
+ radioRoot: U,
9
+ "radio-root--disabled": "_radio-root--disabled_o7n7v_97",
10
+ radioRootDisabled: q,
11
+ "radio-root--with-custom-area": "_radio-root--with-custom-area_o7n7v_100",
12
+ radioRootWithCustomArea: z,
13
+ radio: F,
14
+ dot: G,
15
+ "radio--invalid": "_radio--invalid_o7n7v_145",
16
+ radioInvalid: J,
17
+ label: K,
18
+ "label--bold": "_label--bold_o7n7v_165",
19
+ labelBold: M,
20
+ "label--hidden": "_label--hidden_o7n7v_177",
21
+ labelHidden: Q,
22
+ "label--with-custom-area": "_label--with-custom-area_o7n7v_189",
23
+ labelWithCustomArea: T,
24
+ "custom-area": "_custom-area_o7n7v_193",
25
+ customArea: X,
26
+ hint: Y,
27
+ "hint--visible": "_hint--visible_o7n7v_225",
28
+ hintVisible: Z,
29
+ "hint--unchecked-hidden": "_hint--unchecked-hidden_o7n7v_229",
30
+ hintUncheckedHidden: oo,
31
+ "hint--hidden": "_hint--hidden_o7n7v_234",
32
+ hintHidden: eo,
33
+ input: to
34
+ }, io = $(
35
+ ({
36
+ label: n,
37
+ name: v,
38
+ value: b,
39
+ checked: m,
40
+ className: R,
41
+ customArea: a,
42
+ defaultChecked: x = !1,
43
+ disabled: s = !1,
44
+ hideLabel: k = !1,
45
+ hint: l,
46
+ invalid: j = !1,
47
+ isBold: N = !1,
48
+ hideUncheckedHint: r = !1,
49
+ onChange: h,
50
+ ...g
51
+ }, d) => {
52
+ const H = y(null), e = y(null), [w, D] = E(x), u = m !== void 0, c = u ? m : w;
53
+ L(() => {
54
+ e.current && r && ((e.current.style.height === "0px" || e.current.style.height === "") && c ? (e.current.style.height = `${e.current.scrollHeight}px`, e.current.style.opacity = "1") : (e.current.style.opacity = "0", e.current.style.height = "0px"));
55
+ }, [e, c]);
56
+ const f = P(k), A = _(
57
+ o.radioRoot,
58
+ {
59
+ [o.radioRootDisabled]: s,
60
+ [o.radioRootWithCustomArea]: !!a
61
+ },
62
+ R
63
+ ), W = _(o.label, {
64
+ [o.labelBold]: N,
65
+ // hide label only visually to keep them available for assistive technologies
66
+ [o.labelHidden]: f,
67
+ [o.labelWithCustomArea]: !!a
68
+ }), B = () => !r && l ? !0 : !!(r && l && c), V = _(o.hint, {
69
+ [o.hintHidden]: f,
70
+ [o.hintUncheckedHidden]: r,
71
+ [o.hintVisible]: B()
72
+ }), I = _(o.radio, {
73
+ [o.radioInvalid]: j
74
+ }), S = O(
75
+ (t) => {
76
+ if (s) {
77
+ t.preventDefault();
78
+ return;
79
+ }
80
+ u || D(t.target.checked), h && h(t);
81
+ },
82
+ [s, u, h]
83
+ ), p = l ? `${C(v)}-${C(b)}-description` : void 0;
84
+ return /* @__PURE__ */ i.jsxs("label", { className: A, children: [
85
+ /* @__PURE__ */ i.jsx(
86
+ "input",
87
+ {
88
+ type: "radio",
89
+ value: b,
90
+ name: v,
91
+ className: o.input,
92
+ ref: (t) => {
93
+ typeof d == "function" ? d(t) : d !== null && (d.current = t), H.current = t;
94
+ },
95
+ onChange: S,
96
+ ...g,
97
+ disabled: s,
98
+ checked: c,
99
+ "aria-label": typeof n == "string" ? n : void 0,
100
+ "aria-describedby": p
101
+ }
102
+ ),
103
+ /* @__PURE__ */ i.jsx("span", { className: I, children: /* @__PURE__ */ i.jsx("div", { className: o.dot }) }),
104
+ /* @__PURE__ */ i.jsxs("span", { className: W, children: [
105
+ n,
106
+ a && /* @__PURE__ */ i.jsx("div", { className: o.customArea, children: a }),
107
+ /* @__PURE__ */ i.jsx("span", { id: p, className: V, ref: e, children: l })
108
+ ] })
109
+ ] });
110
+ }
111
+ );
112
+ io.displayName = "DSRadio";
113
+ export {
114
+ io as DSRadio
115
+ };
@@ -2,10 +2,10 @@
2
2
  import "./chunks/jsx-runtime.C115EyI4.js";
3
3
  import "./chunks/index.CvOaL64Y.js";
4
4
  import "react";
5
- import "./chunks/Fieldset.B1vsrHNv.js";
6
- import "./radio.epf54-sG.js";
5
+ import "./chunks/Fieldset.P09LInkT.js";
6
+ import "./radio.CWGJtmKl.js";
7
7
  import "./chunks/RadioGroup.module.BBZwHDjW.js";
8
- import { D as s } from "./chunks/RadioGroup.BO4pbAJw.js";
8
+ import { D as s } from "./chunks/RadioGroup.B5jRveyI.js";
9
9
  export {
10
10
  s as DSRadioGroup
11
11
  };
@@ -3,10 +3,10 @@ import "./chunks/jsx-runtime.C115EyI4.js";
3
3
  import "./chunks/index.CvOaL64Y.js";
4
4
  import "react";
5
5
  import "./chunks/useBreakpoint.5xBNDiCf.js";
6
- import "./asterisk.Cjbk-xZi.js";
6
+ import "./asterisk.DDn-yX4P.js";
7
7
  import "./chunks/Icon.n4XZrQ4N.js";
8
- import "./systemfeedback.CUWch42u.js";
9
- import { D as s } from "./chunks/Select.COdS787F.js";
8
+ import "./systemfeedback._8gatmgR.js";
9
+ import { D as s } from "./chunks/Select.Cl2eJR1z.js";
10
10
  export {
11
11
  s as DSSelect
12
12
  };
@@ -1,19 +1,20 @@
1
1
  "use client";
2
- import { j as a } from "./chunks/jsx-runtime.C115EyI4.js";
2
+ import { j as p } from "./chunks/jsx-runtime.C115EyI4.js";
3
3
  import { c as k } from "./chunks/index.CvOaL64Y.js";
4
- import { DSLink as p } from "./link.SAcKvzJ3.js";
5
4
  import { g as n } from "./chunks/helpers.B1JT5ShS.js";
6
5
  import "react";
7
- import './assets/skiptocontent.DGVJ77cj.css';const c = "_skip-to-content_4ockd_76", h = "_skip-to-content--dark_4ockd_83", s = {
8
- "skip-to-content": "_skip-to-content_4ockd_76",
9
- skipToContent: c,
10
- "skip-to-content--dark": "_skip-to-content--dark_4ockd_83",
11
- skipToContentDark: h
12
- }, C = ({
6
+ import { DSLink as c } from "./link.KZaBufPM.js";
7
+ import './assets/skiptocontent.CHcqLS7S.css';const h = "_skip-to-content_cxg2l_76", l = "_skip-to-content--dark_cxg2l_83", s = {
8
+ "skip-to-content": "_skip-to-content_cxg2l_76",
9
+ skipToContent: h,
10
+ "skip-to-content--dark": "_skip-to-content--dark_cxg2l_83",
11
+ skipToContentDark: l
12
+ }, f = ({
13
13
  children: e = "Skip to main content",
14
14
  className: i,
15
15
  targetElementId: t = "main",
16
- theme: o = "light"
16
+ theme: o = "light",
17
+ ...r
17
18
  }) => {
18
19
  t.startsWith("#") && console.warn(
19
20
  n(
@@ -26,13 +27,14 @@ import './assets/skiptocontent.DGVJ77cj.css';const c = "_skip-to-content_4ockd_7
26
27
  'The targetElementId should not start with "http" or ".". Please provide the id of the element you want to skip to.'
27
28
  )
28
29
  );
29
- const r = k(s.skipToContent, i, {
30
+ const a = k(s.skipToContent, i, {
30
31
  [s.skipToContentDark]: o === "dark"
31
32
  });
32
- return /* @__PURE__ */ a.jsx(
33
- p,
33
+ return /* @__PURE__ */ p.jsx(
34
+ c,
34
35
  {
35
- className: r,
36
+ ...r,
37
+ className: a,
36
38
  href: `#${t}`,
37
39
  theme: o,
38
40
  children: e
@@ -40,5 +42,5 @@ import './assets/skiptocontent.DGVJ77cj.css';const c = "_skip-to-content_4ockd_7
40
42
  );
41
43
  };
42
44
  export {
43
- C as DSSkipToContent
45
+ f as DSSkipToContent
44
46
  };
@@ -1,7 +1,8 @@
1
1
  // Base mixin to define common styles
2
2
  @mixin base-heading($fontFamily, $fontSize, $lineHeight) {
3
3
  font-family: #{unquote(
4
- $fontFamily + ', Arial Narrow, Arial, Heiti SC, sans-serif'
4
+ $fontFamily +
5
+ ', -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif'
5
6
  )};
6
7
  font-style: normal;
7
8
  font-variant: normal;
@@ -10,6 +11,21 @@
10
11
  line-height: $lineHeight;
11
12
  }
12
13
 
14
+ // Mixin for bold title
15
+ @mixin base-heading-bold($fontFamily, $fontSize, $lineHeight) {
16
+ @include base-heading($fontFamily, $fontSize, $lineHeight);
17
+
18
+ /* x-height 426 https://vertical-metrics.netlify.app/ */
19
+ font-size-adjust: 0.426;
20
+ }
21
+
22
+ // Mixin for display title text
23
+ @mixin base-heading-display-title($fontFamily, $fontSize, $lineHeight) {
24
+ @include base-heading($fontFamily, $fontSize, $lineHeight);
25
+ /* cap-height 680 https://vertical-metrics.netlify.app/*/
26
+ font-size-adjust: cap-height 0.68;
27
+ }
28
+
13
29
  @mixin responsive-heading($min, $fontSize, $lineHeight) {
14
30
  @include ds-media-query-min($min: $min) {
15
31
  font-size: $fontSize;
@@ -20,47 +36,72 @@
20
36
  // Mixins for specific heading sizes
21
37
  // XL
22
38
  @mixin ds-heading-x-large {
23
- @include base-heading('STIHL Contraface Digital Text Bold', 1.625rem, 1.2);
39
+ @include base-heading-bold(
40
+ 'STIHL Contraface Digital Text Bold',
41
+ 1.625rem,
42
+ 1.2
43
+ );
24
44
  @include responsive-heading('l', 1.875rem, 1.25);
25
45
  }
26
46
 
27
47
  @mixin ds-heading-x-large-uppercase {
28
- @include base-heading(
48
+ @include base-heading-display-title(
29
49
  'STIHL Contraface Digital Display Title',
30
50
  1.625rem,
31
51
  1.2
32
52
  );
53
+ text-transform: uppercase;
33
54
  @include responsive-heading('l', 1.875rem, 1.25);
34
55
  }
35
56
 
36
57
  // Large
37
58
  @mixin ds-heading-large {
38
- @include base-heading('STIHL Contraface Digital Text Bold', 1.375rem, 1.25);
59
+ @include base-heading-bold(
60
+ 'STIHL Contraface Digital Text Bold',
61
+ 1.375rem,
62
+ 1.25
63
+ );
39
64
  @include responsive-heading('l', 1.625rem, 1.2);
40
65
  }
41
66
 
42
67
  @mixin ds-heading-large-uppercase {
43
- @include base-heading(
68
+ @include base-heading-display-title(
44
69
  'STIHL Contraface Digital Display Title',
45
70
  1.375rem,
46
71
  1.25
47
72
  );
73
+ text-transform: uppercase;
48
74
  @include responsive-heading('l', 1.625rem, 1.2);
49
75
  }
50
76
 
51
77
  // Medium
52
78
  @mixin ds-heading-medium {
53
- @include base-heading('STIHL Contraface Digital Text Bold', 1.25rem, 1.2);
79
+ @include base-heading-bold(
80
+ 'STIHL Contraface Digital Text Bold',
81
+ 1.25rem,
82
+ 1.2
83
+ );
54
84
  }
55
85
 
56
86
  @mixin ds-heading-medium-uppercase {
57
- @include base-heading('STIHL Contraface Digital Display Title', 1.25rem, 1.2);
87
+ @include base-heading-display-title(
88
+ 'STIHL Contraface Digital Display Title',
89
+ 1.25rem,
90
+ 1.2
91
+ );
92
+ text-transform: uppercase;
58
93
  }
59
94
 
60
95
  // Small
61
96
  @mixin ds-heading-small {
62
- @include base-heading('STIHL Contraface Digital Text Bold', 1rem, 1.5);
97
+ @include base-heading-bold('STIHL Contraface Digital Text Bold', 1rem, 1.5);
63
98
  }
99
+
64
100
  @mixin ds-heading-small-uppercase {
65
- @include base-heading('STIHL Contraface Digital Display Title', 1rem, 1.5);
101
+ @include base-heading-display-title(
102
+ 'STIHL Contraface Digital Display Title',
103
+ 1rem,
104
+ 1.5
105
+ );
106
+ text-transform: uppercase;
66
107
  }
@@ -1,3 +1,15 @@
1
1
  @function px-to-rem($pixels, $base-font-size: 16px) {
2
2
  @return #{calc($pixels / $base-font-size)}rem;
3
3
  }
4
+
5
+ // Encode a color to be used in a data url.
6
+ @function urlEncodeHexColor($string) {
7
+ @if type-of($string) == 'color' and str-index(#{$string}, '#') == 1 {
8
+ $hex: str-slice(ie-hex-str($string), 4);
9
+ $string: unquote('#{$hex}');
10
+
11
+ @return '%23' + $string;
12
+ }
13
+
14
+ @return $string;
15
+ }
@@ -1,24 +1,17 @@
1
+ @import '_helpers';
1
2
  @import '_hover';
2
- @import '_transition';
3
3
  @import '_spacing';
4
+ @import '_transition';
4
5
 
5
- // Encode a color to be used in a data url.
6
- @function urlEncodeHexColor($string) {
7
- @if type-of($string) == 'color' and str-index(#{$string}, '#') == 1 {
8
- $hex: str-slice(ie-hex-str($string), 4);
9
- $string: unquote('#{$hex}');
10
-
11
- @return '%23' + $string;
12
- }
13
-
14
- @return $string;
15
- }
6
+ // IMPORTANT: DSLinkStandalone and ds-link mixin have same visual appearance
7
+ // so if any changes are made to this component, they should be reflected in LinkStandalone as well.
16
8
 
17
9
  // Set the link variant colors
18
10
  @mixin link-variant(
19
11
  $content-color,
20
12
  $background-color-hover,
21
- $content-color-hover
13
+ $content-color-hover,
14
+ $theme: 'light'
22
15
  ) {
23
16
  & {
24
17
  color: $content-color;
@@ -29,6 +22,11 @@
29
22
  color: $content-color;
30
23
  }
31
24
 
25
+ &:active {
26
+ background-color: $background-color-hover;
27
+ color: $content-color-hover;
28
+ }
29
+
32
30
  @include hover-media-query {
33
31
  &:hover {
34
32
  background-color: $background-color-hover;
@@ -36,14 +34,24 @@
36
34
  }
37
35
  }
38
36
 
39
- &:active {
40
- background-color: $background-color-hover;
41
- color: $content-color-hover;
37
+ &[href^="http://"]::after,
38
+ &[href^="https://"]::after
39
+ {
40
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{urlEncodeHexColor($content-color)}' viewBox='0 0 16 16' focusable='false' width='100%25' height='100%25'%3E%3Cpath fill-rule='evenodd' d='M9 2V0h7v7h-2V3.4L8.1 9.3 6.7 7.9 12.6 2H9Zm5 8h-2v4H2V4h4V2H0v14h14v-6Z' clip-rule='evenodd'/%3E%3C/svg%3E");
41
+ }
42
+
43
+ &[href^='#']::after {
44
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{urlEncodeHexColor($content-color)}' viewBox='0 0 16 16' focusable='false' width='100%25' height='100%25'%3E%3Cpath d='M14.4 9.6 8 16 1.6 9.6 3 8.2l4 4V0h2v12.2l4-4 1.4 1.4Z'/%3E%3C/svg%3E");
42
45
  }
46
+
47
+ // The offset is set to 0 since Inline Links do not have a 2px
48
+ // outline offset like the Button component. See designs for reference.
49
+ @include ds-focus($theme, $offset: 0);
43
50
  }
44
51
 
45
52
  // Mixin for underlined links (inline link or active standalone link)
46
53
  @mixin link-underline {
54
+ text-decoration-skip-ink: auto;
47
55
  text-decoration-line: underline;
48
56
  text-underline-offset: 2px;
49
57
  text-decoration-thickness: 1px;
@@ -51,112 +59,68 @@
51
59
  }
52
60
 
53
61
  // Public Link mixin that can be used to style links.
54
- // Is also used to style the LinkStandalone component.
55
- // The $type variable is used to determine if the link is inline or standalone,
56
62
  // since there a few design differences between the two.
57
- @mixin ds-link($variant: 'neutral', $theme: 'light', $type: 'inline') {
58
- // Default link color (neutral/light)
59
- $link-color: $ds-theme-light-content-color-interaction-neutral;
60
-
61
- // The offset is set to 0 since LinkStandalone does not have a 2px
62
- // outline offset like the Button component. See designs for reference.
63
- @include ds-focus($theme, $offset: 0);
63
+ @mixin ds-link($variant: 'neutral', $theme: 'light') {
64
+ display: inline;
65
+ padding-inline-end: $ds-spacing-2;
66
+ padding-inline-start: $ds-spacing-2;
67
+ padding-block-start: 0;
68
+ padding-block-end: 0;
69
+ line-height: inherit;
70
+ font-size: inherit;
71
+
72
+ // Inline links are always underlined
73
+ @include link-underline;
74
+
75
+ // Inline links do have two predefined icons for external links and anchors.
76
+ // The icons are added via the ::after pseudo element as svg data urls to
77
+ // enable the change of the icon color via the fill property.
78
+ // Setting the icon & icon color is done in the link-variant mixin since
79
+ // it depends on the actual link color.
80
+ :where(&)[href^="http://"]::after,
81
+ :where(&)[href^="https://"]::after,
82
+ :where(&)[href^='#']::after {
83
+ display: inline-block;
84
+ margin-inline-start: 0.375em;
85
+ width: 0.75em;
86
+ height: 0.75em;
87
+ }
64
88
 
65
89
  // Variants & themes
66
90
  @if ($variant == 'neutral' and $theme == 'light') {
67
91
  @include link-variant(
68
- $link-color,
92
+ $ds-theme-light-content-color-interaction-neutral,
69
93
  $ds-theme-light-background-color-transparent-hover,
70
- $link-color
94
+ $ds-theme-light-content-color-interaction-neutral
71
95
  );
72
96
  }
73
97
 
74
98
  @if ($variant == 'highlight' and $theme == 'light') {
75
- $link-color: $ds-theme-light-content-color-interaction-accent;
76
99
  @include link-variant(
77
- $link-color,
100
+ $ds-theme-light-content-color-interaction-accent,
78
101
  $ds-theme-light-background-color-transparent-hover,
79
102
  $ds-theme-light-content-color-interaction-accent-hover
80
103
  );
81
104
  }
82
105
 
83
106
  @if ($variant == 'neutral' and $theme == 'dark') {
84
- $link-color: $ds-theme-dark-content-color-interaction-neutral;
85
107
  @include link-variant(
86
- $link-color,
108
+ $ds-theme-dark-content-color-interaction-neutral,
87
109
  $ds-theme-dark-background-color-transparent-hover,
88
- $link-color
110
+ $ds-theme-dark-content-color-interaction-neutral,
111
+ $theme: 'dark'
89
112
  );
90
113
  }
91
114
 
92
115
  @if ($variant == 'highlight' and $theme == 'dark') {
93
- $link-color: $ds-theme-dark-content-color-interaction-accent;
94
116
  @include link-variant(
95
- $link-color,
117
+ $ds-theme-dark-content-color-interaction-accent,
96
118
  $ds-theme-dark-background-color-transparent-hover,
97
- $link-color
119
+ $ds-theme-dark-content-color-interaction-accent,
120
+ $theme: 'dark'
98
121
  );
99
122
  }
100
123
 
101
- // Type
102
- @if ($type == 'inline') {
103
- & {
104
- // Inline link
105
- @include link-underline;
106
-
107
- display: inline;
108
- padding-inline-end: $ds-spacing-2;
109
- padding-inline-start: $ds-spacing-2;
110
- padding-block-start: 0;
111
- padding-block-end: 0;
112
- line-height: inherit;
113
- font-size: inherit;
114
-
115
- // Inline links do have two predefined icons for external links and anchors.
116
- // The icons are added via the ::after pseudo element as svg data urls to
117
- // enable the change of the icon color via the fill property.
118
- :where(&)[href^="http://"]::after,
119
- :where(&)[href^="https://"]::after,
120
- :where(&)[href^='#']::after {
121
- display: inline-block;
122
- margin-inline-start: 0.375em;
123
- width: 0.75em;
124
- height: 0.75em;
125
- }
126
- }
127
- &[href^="http://"]::after,
128
- &[href^="https://"]::after
129
- {
130
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{urlEncodeHexColor($link-color)}' viewBox='0 0 16 16' focusable='false' width='100%25' height='100%25'%3E%3Cpath fill-rule='evenodd' d='M9 2V0h7v7h-2V3.4L8.1 9.3 6.7 7.9 12.6 2H9Zm5 8h-2v4H2V4h4V2H0v14h14v-6Z' clip-rule='evenodd'/%3E%3C/svg%3E");
131
- }
132
-
133
- &[href^='#']::after {
134
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{urlEncodeHexColor($link-color)}' viewBox='0 0 16 16' focusable='false' width='100%25' height='100%25'%3E%3Cpath d='M14.4 9.6 8 16 1.6 9.6 3 8.2l4 4V0h2v12.2l4-4 1.4 1.4Z'/%3E%3C/svg%3E");
135
- }
136
- } @else {
137
- & {
138
- // Standalone link
139
- @include ds-utility-medium;
140
-
141
- display: inline-flex;
142
- align-items: center;
143
- height: fit-content;
144
- gap: $ds-spacing-6;
145
- padding-inline-end: $ds-spacing-4;
146
- padding-inline-start: $ds-spacing-4;
147
- padding-block-start: $ds-spacing-2;
148
- padding-block-end: $ds-spacing-2;
149
- // Set color to transparent instead of text-decoration: none to support forced colors link decoration
150
- text-decoration-color: transparent;
151
-
152
- // The DSLinkStandalone component uses the DSIcon component to render a
153
- // selectable icon. The icon is colored with the current text color.
154
- svg {
155
- fill: currentColor;
156
- }
157
- }
158
- }
159
-
160
124
  // Transition
161
125
  @include ds-transition((background-color, border-color, color));
162
126
  }
@@ -1,7 +1,8 @@
1
1
  // Base mixin for text styles
2
2
  @mixin base-text($fontFamily, $fontSize, $lineHeight) {
3
3
  font-family: #{unquote(
4
- $fontFamily + ', Arial Narrow, Arial, Heiti SC, sans-serif'
4
+ $fontFamily +
5
+ ', -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif'
5
6
  )};
6
7
  font-style: normal;
7
8
  font-variant: normal;
@@ -12,56 +13,98 @@
12
13
  line-height: $lineHeight;
13
14
  }
14
15
 
16
+ // Mixin for regular text
17
+ @mixin base-text-regular($fontFamily, $fontSize, $lineHeight) {
18
+ @include base-text($fontFamily, $fontSize, $lineHeight);
19
+ /* x-height 414 https://vertical-metrics.netlify.app/ */
20
+ font-size-adjust: 0.414;
21
+ }
22
+
23
+ // Mixin for bold text
24
+ @mixin base-text-bold($fontFamily, $fontSize, $lineHeight) {
25
+ @include base-text($fontFamily, $fontSize, $lineHeight);
26
+ /* x-height 426 https://vertical-metrics.netlify.app/ */
27
+ font-size-adjust: 0.426;
28
+ }
29
+
15
30
  // Mixins for specific text sizes
16
31
  @mixin ds-text-large {
17
- @include base-text('STIHL Contraface Digital Text Regular', 1.25rem, 1.6);
32
+ @include base-text-regular(
33
+ 'STIHL Contraface Digital Text Regular',
34
+ 1.25rem,
35
+ 1.6
36
+ );
18
37
  }
19
38
 
20
39
  @mixin ds-text-large-bold {
21
- @include base-text('STIHL Contraface Digital Text Bold', 1.25rem, 1.6);
40
+ @include base-text-bold('STIHL Contraface Digital Text Bold', 1.25rem, 1.6);
22
41
  }
23
42
 
24
43
  @mixin ds-text-medium {
25
- @include base-text('STIHL Contraface Digital Text Regular', 1rem, 1.5);
44
+ @include base-text-regular(
45
+ 'STIHL Contraface Digital Text Regular',
46
+ 1rem,
47
+ 1.5
48
+ );
26
49
  }
27
50
 
28
51
  @mixin ds-text-medium-bold {
29
- @include base-text('STIHL Contraface Digital Text Bold', 1rem, 1.5);
52
+ @include base-text-bold('STIHL Contraface Digital Text Bold', 1rem, 1.5);
30
53
  }
31
54
 
32
55
  @mixin ds-text-small {
33
- @include base-text('STIHL Contraface Digital Text Regular', 0.875rem, 1.14);
56
+ @include base-text-regular(
57
+ 'STIHL Contraface Digital Text Regular',
58
+ 0.875rem,
59
+ 1.14
60
+ );
34
61
  }
35
62
 
36
63
  @mixin ds-text-small-bold {
37
- @include base-text('STIHL Contraface Digital Text Bold', 0.875rem, 1.14);
64
+ @include base-text-bold('STIHL Contraface Digital Text Bold', 0.875rem, 1.14);
38
65
  }
39
66
 
40
67
  @mixin ds-text-x-small {
41
- @include base-text('STIHL Contraface Digital Text Regular', 0.75rem, 1.33);
68
+ @include base-text-regular(
69
+ 'STIHL Contraface Digital Text Regular',
70
+ 0.75rem,
71
+ 1.33
72
+ );
42
73
  }
43
74
 
44
75
  @mixin ds-text-x-small-bold {
45
- @include base-text('STIHL Contraface Digital Text Bold', 0.75rem, 1.33);
76
+ @include base-text-bold('STIHL Contraface Digital Text Bold', 0.75rem, 1.33);
46
77
  }
47
78
 
48
79
  @mixin ds-text-xx-small {
49
- @include base-text('STIHL Contraface Digital Text Regular', 0.625rem, 1.6);
80
+ @include base-text-regular(
81
+ 'STIHL Contraface Digital Text Regular',
82
+ 0.625rem,
83
+ 1.6
84
+ );
50
85
  }
51
86
 
52
87
  // Utility text styles
53
88
  @mixin ds-utility-medium {
54
- @include base-text('STIHL Contraface Digital Text Regular', 1rem, 1.25);
89
+ @include base-text-regular(
90
+ 'STIHL Contraface Digital Text Regular',
91
+ 1rem,
92
+ 1.25
93
+ );
55
94
  }
56
95
 
57
96
  @mixin ds-utility-medium-bold {
58
- @include base-text('STIHL Contraface Digital Text Bold', 1rem, 1.25);
97
+ @include base-text-bold('STIHL Contraface Digital Text Bold', 1rem, 1.25);
59
98
  }
60
99
 
61
100
  @mixin ds-utility-small {
62
- @include base-text('STIHL Contraface Digital Text Regular', 0.875rem, 1.14);
101
+ @include base-text-regular(
102
+ 'STIHL Contraface Digital Text Regular',
103
+ 0.875rem,
104
+ 1.14
105
+ );
63
106
  }
64
107
 
65
108
  @mixin ds-utility-small-bold {
66
- @include base-text('STIHL Contraface Digital Text Bold', 0.875rem, 1.14);
109
+ @include base-text-bold('STIHL Contraface Digital Text Bold', 0.875rem, 1.14);
67
110
  }