@helsenorge/designsystem-react 1.0.0-beta89 → 1.0.0-beta94

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 (171) hide show
  1. package/Button-72f96290.js +2 -0
  2. package/Button-72f96290.js.map +1 -0
  3. package/Checkbox-0ba01292.js +2 -0
  4. package/Checkbox-0ba01292.js.map +1 -0
  5. package/Close-80751ae6.js +2 -0
  6. package/Close-80751ae6.js.map +1 -0
  7. package/FormGroup-68288be3.js +2 -0
  8. package/FormGroup-68288be3.js.map +1 -0
  9. package/Icon-9b4a8a2d.js +2 -0
  10. package/Icon-9b4a8a2d.js.map +1 -0
  11. package/Loader-b3fd59f4.js +2 -0
  12. package/Loader-b3fd59f4.js.map +1 -0
  13. package/Modal-6b4a2c9c.js +2 -0
  14. package/Modal-6b4a2c9c.js.map +1 -0
  15. package/RadioButton-84ca988e.js +2 -0
  16. package/RadioButton-84ca988e.js.map +1 -0
  17. package/Textarea-9c91191a.js +2 -0
  18. package/Textarea-9c91191a.js.map +1 -0
  19. package/Title-90910763.js +2 -0
  20. package/Title-90910763.js.map +1 -0
  21. package/Validation-ef9ee0ae.js +2 -0
  22. package/Validation-ef9ee0ae.js.map +1 -0
  23. package/components/AnchorLink/index.d.ts +1 -0
  24. package/components/AnchorLink/index.d.ts.map +1 -1
  25. package/components/AnchorLink/index.js +1 -1
  26. package/components/Avatar/index.d.ts +1 -0
  27. package/components/Avatar/index.d.ts.map +1 -1
  28. package/components/Avatar/index.js +1 -1
  29. package/components/Badge/index.d.ts +1 -0
  30. package/components/Badge/index.d.ts.map +1 -1
  31. package/components/Button/index.d.ts +1 -0
  32. package/components/Button/index.d.ts.map +1 -1
  33. package/components/Button/index.js +1 -1
  34. package/components/ButtonWithModal/componentdata.json +61 -1
  35. package/components/ButtonWithModal/index.d.ts +1 -0
  36. package/components/ButtonWithModal/index.d.ts.map +1 -1
  37. package/components/ButtonWithModal/index.js +1 -1
  38. package/components/Checkbox/Checkbox.d.ts +3 -3
  39. package/components/Checkbox/Checkbox.d.ts.map +1 -1
  40. package/components/Checkbox/componentdata.json +13 -7
  41. package/components/Checkbox/index.d.ts +1 -0
  42. package/components/Checkbox/index.d.ts.map +1 -1
  43. package/components/Checkbox/index.js +1 -1
  44. package/components/Close/index.d.ts +1 -0
  45. package/components/Close/index.d.ts.map +1 -1
  46. package/components/Close/index.js +1 -1
  47. package/components/ExpanderList/index.d.ts +1 -0
  48. package/components/ExpanderList/index.d.ts.map +1 -1
  49. package/components/ExpanderList/index.js +1 -1
  50. package/components/FormExample/FormExample.d.ts +7 -5
  51. package/components/FormExample/FormExample.d.ts.map +1 -1
  52. package/components/FormExample/componentdata.json +9 -3
  53. package/components/FormExample/index.d.ts +1 -0
  54. package/components/FormExample/index.d.ts.map +1 -1
  55. package/components/FormExample/index.js +1 -1
  56. package/components/FormExample/index.js.map +1 -1
  57. package/components/FormGroup/FormGroup.d.ts +5 -6
  58. package/components/FormGroup/FormGroup.d.ts.map +1 -1
  59. package/components/FormGroup/componentdata.json +32 -7
  60. package/components/FormGroup/index.d.ts +1 -0
  61. package/components/FormGroup/index.d.ts.map +1 -1
  62. package/components/FormGroup/index.js +1 -1
  63. package/components/FormGroup/styles.module.scss +12 -3
  64. package/components/HighlightBox/HighlightBox.d.ts +24 -0
  65. package/components/HighlightBox/HighlightBox.d.ts.map +1 -0
  66. package/components/HighlightBox/componentdata.json +484 -0
  67. package/components/HighlightBox/index.d.ts +4 -0
  68. package/components/HighlightBox/index.d.ts.map +1 -0
  69. package/components/HighlightBox/index.js +2 -0
  70. package/components/HighlightBox/index.js.map +1 -0
  71. package/components/HighlightBox/styles.module.scss +89 -0
  72. package/components/Icons/AcupunctureBack.js +1 -1
  73. package/components/Icons/Icon.js +1 -1
  74. package/components/Icons/NoEye.js +1 -1
  75. package/components/Icons/SectionSign.js +1 -1
  76. package/components/Icons/SpeechBubble.js +1 -1
  77. package/components/Icons/SupportingPerson.js +1 -1
  78. package/components/Icons/Syringe.js +1 -1
  79. package/components/Icons/index.js +1 -1
  80. package/components/LinkList/index.d.ts +1 -0
  81. package/components/LinkList/index.d.ts.map +1 -1
  82. package/components/LinkList/index.js +1 -1
  83. package/components/List/index.d.ts +1 -0
  84. package/components/List/index.d.ts.map +1 -1
  85. package/components/Loader/Loader.d.ts +7 -1
  86. package/components/Loader/Loader.d.ts.map +1 -1
  87. package/components/Loader/componentdata.json +32 -1
  88. package/components/Loader/index.d.ts +1 -0
  89. package/components/Loader/index.d.ts.map +1 -1
  90. package/components/Loader/index.js +1 -1
  91. package/components/Loader/styles.module.scss +19 -4
  92. package/components/Logo/index.d.ts +1 -0
  93. package/components/Logo/index.d.ts.map +1 -1
  94. package/components/Modal/Modal.d.ts +9 -0
  95. package/components/Modal/Modal.d.ts.map +1 -1
  96. package/components/Modal/componentdata.json +63 -1
  97. package/components/Modal/index.d.ts +1 -0
  98. package/components/Modal/index.d.ts.map +1 -1
  99. package/components/Modal/index.js +1 -1
  100. package/components/Modal/styles.module.scss +35 -4
  101. package/components/Modal/styles.module.scss.d.ts +3 -0
  102. package/components/NotificationPanel/index.d.ts +1 -0
  103. package/components/NotificationPanel/index.d.ts.map +1 -1
  104. package/components/NotificationPanel/index.js +1 -1
  105. package/components/Portal/componentdata.json +80 -0
  106. package/components/Portal/index.d.ts +13 -0
  107. package/components/Portal/index.d.ts.map +1 -0
  108. package/components/Portal/index.js +2 -0
  109. package/components/Portal/index.js.map +1 -0
  110. package/components/RadioButton/RadioButton.d.ts +31 -0
  111. package/components/RadioButton/RadioButton.d.ts.map +1 -0
  112. package/components/RadioButton/componentdata.json +265 -0
  113. package/components/RadioButton/index.d.ts +4 -0
  114. package/components/RadioButton/index.d.ts.map +1 -0
  115. package/components/RadioButton/index.js +2 -0
  116. package/components/RadioButton/index.js.map +1 -0
  117. package/components/RadioButton/styles.module.scss +236 -0
  118. package/components/RadioButton/styles.module.scss.d.ts +23 -0
  119. package/components/Slider/index.d.ts +1 -0
  120. package/components/Slider/index.d.ts.map +1 -1
  121. package/components/Slider/index.js +1 -1
  122. package/components/Spacer/index.d.ts +1 -0
  123. package/components/Spacer/index.d.ts.map +1 -1
  124. package/components/Textarea/Textarea.d.ts +31 -0
  125. package/components/Textarea/Textarea.d.ts.map +1 -0
  126. package/components/Textarea/componentdata.json +527 -0
  127. package/components/Textarea/index.d.ts +4 -0
  128. package/components/Textarea/index.d.ts.map +1 -0
  129. package/components/Textarea/index.js +2 -0
  130. package/components/Textarea/index.js.map +1 -0
  131. package/components/Textarea/styles.module.scss +154 -0
  132. package/components/Textarea/styles.module.scss.d.ts +21 -0
  133. package/components/Tile/index.d.ts +1 -0
  134. package/components/Tile/index.d.ts.map +1 -1
  135. package/components/Tile/index.js +1 -1
  136. package/components/Title/index.d.ts +1 -0
  137. package/components/Title/index.d.ts.map +1 -1
  138. package/components/Title/index.js +1 -1
  139. package/components/Validation/Validation.d.ts +2 -2
  140. package/components/Validation/Validation.d.ts.map +1 -1
  141. package/components/Validation/componentdata.json +3 -3
  142. package/components/Validation/index.d.ts +1 -0
  143. package/components/Validation/index.d.ts.map +1 -1
  144. package/components/Validation/index.js +1 -1
  145. package/constants-a4b0b501.js +2 -0
  146. package/constants-a4b0b501.js.map +1 -0
  147. package/constants.d.ts +29 -0
  148. package/constants.d.ts.map +1 -1
  149. package/index.d.ts +1 -0
  150. package/index.d.ts.map +1 -1
  151. package/index.js +1 -1
  152. package/package.json +2 -1
  153. package/scss/_title.scss +16 -12
  154. package/Button-48132cc3.js +0 -2
  155. package/Button-48132cc3.js.map +0 -1
  156. package/Checkbox-46666e69.js +0 -2
  157. package/Checkbox-46666e69.js.map +0 -1
  158. package/Close-591125bb.js +0 -2
  159. package/Close-591125bb.js.map +0 -1
  160. package/FormGroup-56d60079.js +0 -2
  161. package/FormGroup-56d60079.js.map +0 -1
  162. package/Loader-6ff0d481.js +0 -2
  163. package/Loader-6ff0d481.js.map +0 -1
  164. package/Modal-47bc1814.js +0 -2
  165. package/Modal-47bc1814.js.map +0 -1
  166. package/Title-72851d51.js +0 -2
  167. package/Title-72851d51.js.map +0 -1
  168. package/Validation-372a97b9.js +0 -2
  169. package/Validation-372a97b9.js.map +0 -1
  170. package/constants-d919236e.js +0 -2
  171. package/constants-d919236e.js.map +0 -1
@@ -0,0 +1,236 @@
1
+ @import '../../scss/_spacers.scss';
2
+ @import '../../scss/_breakpoints.scss';
3
+ @import '../../scss/_palette.scss';
4
+ @import '../../scss/font-settings.scss';
5
+
6
+ .radio-button-errors {
7
+ font-size: $font-size-sm;
8
+ font-weight: 600;
9
+ color: $cherry500;
10
+ margin-top: 0;
11
+ }
12
+
13
+ .radio-button-wrapper {
14
+ cursor: pointer;
15
+ margin: getSpacer(s) 0;
16
+
17
+ &--with-error {
18
+ padding: getSpacer(s) getSpacer(xs) getSpacer(m);
19
+ background-color: $cherry50;
20
+ margin-left: -0.75rem;
21
+ border-left: 0.25rem solid $cherry500;
22
+
23
+ @media (min-width: map-get($grid-breakpoints, md)) {
24
+ padding: getSpacer(s) getSpacer(m) getSpacer(l);
25
+ }
26
+ }
27
+
28
+ &--with-error#{&}--bigform {
29
+ padding: getSpacer(m) getSpacer(m);
30
+ }
31
+
32
+ &--bigform {
33
+ margin: getSpacer(xs) 0 getSpacer(xs) 0;
34
+ }
35
+ }
36
+
37
+ .radio-button-wrapper:first-of-type {
38
+ margin-top: 0;
39
+ }
40
+
41
+ .radio-button-wrapper:last-of-type {
42
+ margin-bottom: 0;
43
+ }
44
+
45
+ .radio-button-label {
46
+ display: flex;
47
+ align-items: center;
48
+ cursor: pointer;
49
+ font-size: $font-size-sm;
50
+
51
+ @media (min-width: map-get($grid-breakpoints, md)) {
52
+ font-size: $font-size-md;
53
+ }
54
+
55
+ &--on-dark {
56
+ color: $white;
57
+ }
58
+
59
+ &--invalid {
60
+ color: $black;
61
+ }
62
+
63
+ &--disabled {
64
+ cursor: default;
65
+ color: $neutral400;
66
+ }
67
+
68
+ &--bigform {
69
+ padding: getSpacer(s);
70
+ background-color: $neutral50;
71
+ }
72
+
73
+ &--bigform#{&}--on-blueberry {
74
+ background-color: $blueberry50;
75
+ }
76
+
77
+ &--bigform#{&}--on-dark {
78
+ background-color: $blueberry800;
79
+ }
80
+
81
+ &--bigform#{&}--invalid {
82
+ background-color: $white;
83
+ }
84
+
85
+ @media (min-width: map-get($grid-breakpoints, md)) {
86
+ &--bigform {
87
+ padding: 1.68rem getSpacer(l);
88
+ }
89
+ }
90
+ }
91
+
92
+ .radio-button {
93
+ -moz-appearance: none;
94
+ -webkit-appearance: none;
95
+ -o-appearance: none;
96
+
97
+ cursor: pointer;
98
+ display: flex;
99
+ justify-content: center;
100
+ align-items: center;
101
+ border-radius: 10rem;
102
+ margin: getSpacer(3xs) getSpacer(s) getSpacer(3xs) getSpacer(3xs);
103
+ height: 1.5rem;
104
+ width: 1.5rem;
105
+ min-width: auto !important;
106
+ min-height: auto !important;
107
+ color: $neutral700;
108
+ box-shadow: 0 0 0 getSpacer(3xs);
109
+
110
+ &:checked {
111
+ color: $blueberry500;
112
+
113
+ &:hover {
114
+ background-color: $blueberry50;
115
+ }
116
+ }
117
+
118
+ &:focus {
119
+ box-shadow: 0 0 0 getSpacer(2xs);
120
+ color: $black;
121
+ }
122
+
123
+ &:hover {
124
+ box-shadow: 0 0 0 getSpacer(2xs);
125
+ background-color: $neutral100;
126
+ }
127
+
128
+ :active > & {
129
+ box-shadow: 0 0 0 getSpacer(2xs);
130
+ color: $black;
131
+ }
132
+
133
+ &--on-blueberry {
134
+ color: $blueberry500;
135
+
136
+ :hover > & {
137
+ background-color: $blueberry100;
138
+ }
139
+ }
140
+
141
+ &--on-dark {
142
+ color: $neutral200;
143
+
144
+ &:hover {
145
+ background-color: $inverted-hover;
146
+ box-shadow: 0 0 0 getSpacer(2xs);
147
+ }
148
+
149
+ &:checked {
150
+ color: $blueberry200;
151
+
152
+ &:hover {
153
+ background-color: $inverted-hover;
154
+ }
155
+ }
156
+
157
+ :active > & {
158
+ box-shadow: 0 0 0 getSpacer(2xs);
159
+ color: $white;
160
+ }
161
+
162
+ &:focus {
163
+ color: $white;
164
+ }
165
+ }
166
+
167
+ &--invalid {
168
+ color: $cherry500;
169
+
170
+ &:hover {
171
+ background-color: $cherry100;
172
+ }
173
+
174
+ &:checked {
175
+ color: $cherry500;
176
+
177
+ &:hover {
178
+ background-color: $cherry100;
179
+ }
180
+ }
181
+
182
+ &:active {
183
+ color: $black;
184
+ }
185
+
186
+ &:focus {
187
+ color: $black;
188
+ }
189
+ }
190
+
191
+ &--disabled {
192
+ cursor: default;
193
+
194
+ color: $neutral400;
195
+ &:checked {
196
+ color: $neutral400;
197
+
198
+ &:hover {
199
+ box-shadow: 0 0 0 getSpacer(3xs);
200
+ background-color: transparent;
201
+ }
202
+ }
203
+ &:hover {
204
+ box-shadow: 0 0 0 getSpacer(3xs);
205
+ background-color: transparent;
206
+ }
207
+
208
+ &:active {
209
+ color: $neutral400;
210
+ }
211
+ }
212
+
213
+ // :before er dot i RadioButton
214
+ &:checked::before {
215
+ content: '';
216
+ display: flex;
217
+ background-color: $blueberry500;
218
+ width: 0.75rem;
219
+ height: 0.75rem;
220
+ border-radius: 10rem;
221
+ }
222
+
223
+ &--on-dark:checked::before {
224
+ background-color: $blueberry200;
225
+ }
226
+
227
+ &--disabled:checked::before {
228
+ box-shadow: 0 0 0 0;
229
+ background-color: $neutral400;
230
+ color: $neutral400;
231
+ }
232
+
233
+ &--invalid:checked::before {
234
+ background-color: $cherry500;
235
+ }
236
+ }
@@ -0,0 +1,23 @@
1
+ export type Styles = {
2
+ 'radio-button': string;
3
+ 'radio-button--disabled': string;
4
+ 'radio-button--invalid': string;
5
+ 'radio-button--on-blueberry': string;
6
+ 'radio-button--on-dark': string;
7
+ 'radio-button-errors': string;
8
+ 'radio-button-label': string;
9
+ 'radio-button-label--bigform': string;
10
+ 'radio-button-label--disabled': string;
11
+ 'radio-button-label--invalid': string;
12
+ 'radio-button-label--on-blueberry': string;
13
+ 'radio-button-label--on-dark': string;
14
+ 'radio-button-wrapper': string;
15
+ 'radio-button-wrapper--bigform': string;
16
+ 'radio-button-wrapper--with-error': string;
17
+ };
18
+
19
+ export type ClassNames = keyof Styles;
20
+
21
+ declare const styles: Styles;
22
+
23
+ export default styles;
@@ -1,3 +1,4 @@
1
1
  import Slider from './Slider';
2
+ export * from './Slider';
2
3
  export default Slider;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,eAAe,MAAM,CAAC"}
@@ -1,2 +1,2 @@
1
- import{_ as e}from"../../_rollupPluginBabelHelpers-d0752906.js";import t,{useState as n,useRef as r,useEffect as o}from"react";import{c as a}from"../../index-9b84fabc.js";import{T as i}from"../../Title-72851d51.js";import c from"./styles.module.scss";import"../Title/styles.module.scss";var u=function(e){return e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1},l=function(e){return d(e)?e.touches[0].pageX:e.pageX},s=function(e){var t=e?e.getBoundingClientRect():void 0;return t?t.right-t.left:0},d=function(e){return("touchcancel"===e.type||"touchend"===e.type||"touchenter"===e.type||"touchleave"===e.type||"touchmove"===e.type||"touchstart"===e.type)&&!(0===e.touches.length)},m=function(e,t,n){var r=e-e%t,o=Math.floor(n/t)*t;e>o&&(e>o+(n-o)/2&&(r=n));return Math.round(r)},f=t.forwardRef((function(d,f){var v=d.title,p=d.labelLeft,h=d.labelRight,_=d.disabled,g=void 0!==_&&_,E=d.step,y=void 0===E?1:E,b=d.onChange,w=d.testId,k=n(50),L=e(k,2),N=L[0],x=L[1],D=n(!1),M=e(D,2),R=M[0],A=M[1],T=n(0),j=e(T,2),B=j[0],C=j[1],P=n(0),I=e(P,2),X=I[0],H=I[1],K=n(0),S=e(K,2),U=S[0],q=S[1],z=n(0),F=e(z,2),G=F[0],J=F[1],O=f||r(null),Q=r(null),V=function(e){te(e)},W=function(e){ee(e)},Y=function(e){te(e)},Z=function(e){ee(e)};o((function(){var e=s(O.current),t=s(Q.current);q(function(e,t,n,r,o){return(t-n)/(o-r)*e}(N,e,t,0,100)),C(e),H(t)}),[]),o((function(){R&&(function(e,t){document.addEventListener("mousemove",e,!1),document.addEventListener("mouseup",t,!1)}(V,W),function(e,t){document.addEventListener("touchmove",e,!1),document.addEventListener("touchend",t,!1)}(Y,Z))}),[R]),o((function(){!g&&b&&b(N)}),[N]);var $=function(e){var t;if(!g){var n=s(O.current),r=s(Q.current),o=l(e);!function(e,t,n,r){var o=t?t.getBoundingClientRect():void 0,a=o?o.left:0;r(a?e-(a+n/2):0)}(o,Q.current,r,ne),A(!0),J(o),C(n),H(r),null===(t=Q.current)||void 0===t||t.focus(),u(e)}},ee=function(e){g||(A(!1),function(e,t){document.removeEventListener("mousemove",e,!1),document.removeEventListener("mouseup",t,!1)}(V,W),function(e,t){document.removeEventListener("touchmove",e,!1),document.removeEventListener("touchend",t,!1)}(Y,Z),u(e))},te=function(e){if(!g&&R){var t=l(e);ne(t-G),u(e)}},ne=function(e){if(0!==e){var t=function(e,t,n,r){var o=r+e;return o<0&&(o=0),o>t-n&&(o=t-n),o}(e,B,X,U);q(t),J(t+e),x(function(e,t,n,r,o,a){var i=(t-n)/(a-o),c=Math.round(e/i);return m(c,r,a)}(t,B,X,y,0,100))}};return t.createElement("div",{className:c.slider,"data-testid":w},v&&t.createElement(i,{htmlMarkup:"h3",margin:1.5,appearance:"title3"},v),t.createElement("div",{ref:O,className:a(c["slider__track-wrapper"],g?c["slider__track-wrapper--disabled"]:""),onMouseDown:$,onTouchStart:$,"data-testid":"tracker"},t.createElement("div",{className:a(c.slider__track,g?c["slider__track--disabled"]:"")}),t.createElement("div",{ref:Q,className:a(c.slider__trigger,g?c["slider__trigger--disabled"]:""),style:{left:"".concat(U,"px")},onKeyDown:function(e){if(!g){var t=(B-X)/100;"ArrowRight"!==e.key&&"ArrowDown"!==e.key||ne(y*t),"ArrowLeft"!==e.key&&"ArrowUp"!==e.key||ne(-y*t)}},role:"slider","aria-valuenow":N,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"".concat(v?v+" ":"").concat(p?p+" ":"").concat(h?h+" ":""),tabIndex:g?-1:0},t.createElement("div",{className:a(c["slider__trigger-inner"],g?c["slider__trigger-inner--disabled"]:"")}))),(p||h)&&t.createElement("span",{className:c.slider__options},t.createElement("p",{className:c.slider__text,"aria-hidden":!0},p),t.createElement("p",{className:c.slider__text,"aria-hidden":!0},h)))}));export default f;
1
+ import{_ as e}from"../../_rollupPluginBabelHelpers-d0752906.js";import t,{useState as n,useRef as r,useEffect as o}from"react";import{c as a}from"../../index-9b84fabc.js";import{T as i}from"../../Title-90910763.js";import c from"./styles.module.scss";import"../Title/styles.module.scss";var u=function(e){return e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1},l=function(e){return d(e)?e.touches[0].pageX:e.pageX},s=function(e){var t=e?e.getBoundingClientRect():void 0;return t?t.right-t.left:0},d=function(e){return("touchcancel"===e.type||"touchend"===e.type||"touchenter"===e.type||"touchleave"===e.type||"touchmove"===e.type||"touchstart"===e.type)&&!(0===e.touches.length)},m=function(e,t,n){var r=e-e%t,o=Math.floor(n/t)*t;e>o&&(e>o+(n-o)/2&&(r=n));return Math.round(r)},f=t.forwardRef((function(d,f){var v=d.title,p=d.labelLeft,h=d.labelRight,_=d.disabled,g=void 0!==_&&_,E=d.step,y=void 0===E?1:E,b=d.onChange,w=d.testId,k=n(50),L=e(k,2),x=L[0],N=L[1],D=n(!1),M=e(D,2),R=M[0],A=M[1],T=n(0),j=e(T,2),B=j[0],C=j[1],P=n(0),I=e(P,2),X=I[0],H=I[1],K=n(0),S=e(K,2),U=S[0],q=S[1],z=n(0),F=e(z,2),G=F[0],J=F[1],O=f||r(null),Q=r(null),V=function(e){te(e)},W=function(e){ee(e)},Y=function(e){te(e)},Z=function(e){ee(e)};o((function(){var e=s(O.current),t=s(Q.current);q(function(e,t,n,r,o){return(t-n)/(o-r)*e}(x,e,t,0,100)),C(e),H(t)}),[]),o((function(){R&&(function(e,t){document.addEventListener("mousemove",e,!1),document.addEventListener("mouseup",t,!1)}(V,W),function(e,t){document.addEventListener("touchmove",e,!1),document.addEventListener("touchend",t,!1)}(Y,Z))}),[R]),o((function(){!g&&b&&b(x)}),[x]);var $=function(e){var t;if(!g){var n=s(O.current),r=s(Q.current),o=l(e);!function(e,t,n,r){var o=t?t.getBoundingClientRect():void 0,a=o?o.left:0;r(a?e-(a+n/2):0)}(o,Q.current,r,ne),A(!0),J(o),C(n),H(r),null===(t=Q.current)||void 0===t||t.focus(),u(e)}},ee=function(e){g||(A(!1),function(e,t){document.removeEventListener("mousemove",e,!1),document.removeEventListener("mouseup",t,!1)}(V,W),function(e,t){document.removeEventListener("touchmove",e,!1),document.removeEventListener("touchend",t,!1)}(Y,Z),u(e))},te=function(e){if(!g&&R){var t=l(e);ne(t-G),u(e)}},ne=function(e){if(0!==e){var t=function(e,t,n,r){var o=r+e;return o<0&&(o=0),o>t-n&&(o=t-n),o}(e,B,X,U);q(t),J(t+e),N(function(e,t,n,r,o,a){var i=(t-n)/(a-o),c=Math.round(e/i);return m(c,r,a)}(t,B,X,y,0,100))}};return t.createElement("div",{className:c.slider,"data-testid":w},v&&t.createElement(i,{htmlMarkup:"h3",margin:1.5,appearance:"title3"},v),t.createElement("div",{ref:O,className:a(c["slider__track-wrapper"],g?c["slider__track-wrapper--disabled"]:""),onMouseDown:$,onTouchStart:$,"data-testid":"tracker"},t.createElement("div",{className:a(c.slider__track,g?c["slider__track--disabled"]:"")}),t.createElement("div",{ref:Q,className:a(c.slider__trigger,g?c["slider__trigger--disabled"]:""),style:{left:"".concat(U,"px")},onKeyDown:function(e){if(!g){var t=(B-X)/100;"ArrowRight"!==e.key&&"ArrowDown"!==e.key||ne(y*t),"ArrowLeft"!==e.key&&"ArrowUp"!==e.key||ne(-y*t)}},role:"slider","aria-valuenow":x,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"".concat(v?v+" ":"").concat(p?p+" ":"").concat(h?h+" ":""),tabIndex:g?-1:0},t.createElement("div",{className:a(c["slider__trigger-inner"],g?c["slider__trigger-inner--disabled"]:"")}))),(p||h)&&t.createElement("span",{className:c.slider__options},t.createElement("p",{className:c.slider__text,"aria-hidden":!0},p),t.createElement("p",{className:c.slider__text,"aria-hidden":!0},h)))}));export default f;export{f as Slider};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,4 @@
1
1
  import Spacer from './Spacer';
2
+ export * from './Spacer';
2
3
  export default Spacer;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Spacer/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Spacer/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,eAAe,MAAM,CAAC"}
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { HTMLTextareaProps, FormMode } from '../../constants';
3
+ interface TextareaProps extends HTMLTextareaProps {
4
+ /** initial value for textarea */
5
+ defaultValue?: string;
6
+ /** max character limit in textarea */
7
+ maxCharacters?: number;
8
+ /** The text is displayed in the end of the text-counter */
9
+ maxText?: string;
10
+ /** Sets the data-testid attribute. */
11
+ testId?: string;
12
+ /** If true, the component will have a bottom margin. */
13
+ marginBottom?: boolean;
14
+ /** If true, the component will be transparent. */
15
+ transparent?: boolean;
16
+ /** Changes the visuals of the textarea */
17
+ mode?: keyof typeof FormMode;
18
+ /** Label of the input */
19
+ label?: string;
20
+ /** max rows */
21
+ maxRows?: number;
22
+ /** min rows */
23
+ minRows?: number;
24
+ /** auto-grows until maxRows */
25
+ grow?: boolean;
26
+ /** Error text to show above the component */
27
+ errorText?: string;
28
+ }
29
+ declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
30
+ export default Textarea;
31
+ //# sourceMappingURL=Textarea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG9D,UAAU,aAAc,SAAQ,iBAAiB;IAC/C,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kDAAkD;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC;IAC7B,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,QAAQ,2FAiHZ,CAAC;AAEH,eAAe,QAAQ,CAAC"}