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

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 (93) hide show
  1. package/Button-8af0be6e.js +2 -0
  2. package/Button-8af0be6e.js.map +1 -0
  3. package/Checkbox-fb5dff56.js +2 -0
  4. package/Checkbox-fb5dff56.js.map +1 -0
  5. package/{Close-80751ae6.js → Close-9f68bcd0.js} +2 -2
  6. package/Close-9f68bcd0.js.map +1 -0
  7. package/FormGroup-6c545646.js +2 -0
  8. package/FormGroup-6c545646.js.map +1 -0
  9. package/{Icon-9b4a8a2d.js → Icon-04613a89.js} +2 -2
  10. package/Icon-04613a89.js.map +1 -0
  11. package/Input-adeb7f88.js +2 -0
  12. package/Input-adeb7f88.js.map +1 -0
  13. package/{Modal-6b4a2c9c.js → Modal-b7d10081.js} +2 -2
  14. package/Modal-b7d10081.js.map +1 -0
  15. package/RadioButton-d90884c9.js +2 -0
  16. package/RadioButton-d90884c9.js.map +1 -0
  17. package/Textarea-05e33ba3.js +2 -0
  18. package/Textarea-05e33ba3.js.map +1 -0
  19. package/{Validation-ef9ee0ae.js → Validation-9bf0c0ec.js} +2 -2
  20. package/Validation-9bf0c0ec.js.map +1 -0
  21. package/components/AnchorLink/index.js +1 -1
  22. package/components/Avatar/index.js +1 -1
  23. package/components/Button/Button.d.ts.map +1 -1
  24. package/components/Button/index.js +1 -1
  25. package/components/ButtonWithModal/index.js +1 -1
  26. package/components/Checkbox/componentdata.json +9 -9
  27. package/components/Checkbox/index.js +1 -1
  28. package/components/Close/index.js +1 -1
  29. package/components/ExpanderList/index.js +1 -1
  30. package/components/FormExample/FormExample.d.ts +2 -1
  31. package/components/FormExample/FormExample.d.ts.map +1 -1
  32. package/components/FormExample/componentdata.json +6 -3
  33. package/components/FormExample/index.js +1 -1
  34. package/components/FormExample/index.js.map +1 -1
  35. package/components/FormGroup/FormGroup.d.ts.map +1 -1
  36. package/components/FormGroup/componentdata.json +9 -9
  37. package/components/FormGroup/index.js +1 -1
  38. package/components/Icons/AcupunctureBack.js +1 -1
  39. package/components/Icons/Icon.js +1 -1
  40. package/components/Icons/NoEye.js +1 -1
  41. package/components/Icons/SectionSign.js +1 -1
  42. package/components/Icons/SpeechBubble.js +1 -1
  43. package/components/Icons/SupportingPerson.js +1 -1
  44. package/components/Icons/Syringe.js +1 -1
  45. package/components/Icons/index.js +1 -1
  46. package/components/Input/Input.d.ts +55 -0
  47. package/components/Input/Input.d.ts.map +1 -0
  48. package/components/Input/componentdata.json +425 -0
  49. package/components/Input/index.d.ts +4 -0
  50. package/components/Input/index.d.ts.map +1 -0
  51. package/components/Input/index.js +2 -0
  52. package/components/Input/index.js.map +1 -0
  53. package/components/Input/styles.module.scss +55 -0
  54. package/components/Input/styles.module.scss.d.ts +23 -0
  55. package/components/LinkList/index.js +1 -1
  56. package/components/Modal/index.js +1 -1
  57. package/components/NotificationPanel/index.js +1 -1
  58. package/components/RadioButton/componentdata.json +9 -9
  59. package/components/RadioButton/index.js +1 -1
  60. package/components/Textarea/Textarea.d.ts +4 -0
  61. package/components/Textarea/Textarea.d.ts.map +1 -1
  62. package/components/Textarea/componentdata.json +44 -6
  63. package/components/Textarea/index.js +1 -1
  64. package/components/Textarea/styles.module.scss +13 -110
  65. package/components/Textarea/styles.module.scss.d.ts +13 -8
  66. package/components/Tile/index.js +1 -1
  67. package/components/Validation/componentdata.json +3 -3
  68. package/components/Validation/index.js +1 -1
  69. package/constants-42547490.js +2 -0
  70. package/constants-42547490.js.map +1 -0
  71. package/constants.d.ts +7 -7
  72. package/constants.d.ts.map +1 -1
  73. package/hooks/useIcons.d.ts +4 -0
  74. package/hooks/useIcons.d.ts.map +1 -0
  75. package/index.js +1 -1
  76. package/package.json +1 -1
  77. package/scss/_input.scss +174 -0
  78. package/Button-72f96290.js +0 -2
  79. package/Button-72f96290.js.map +0 -1
  80. package/Checkbox-0ba01292.js +0 -2
  81. package/Checkbox-0ba01292.js.map +0 -1
  82. package/Close-80751ae6.js.map +0 -1
  83. package/FormGroup-68288be3.js +0 -2
  84. package/FormGroup-68288be3.js.map +0 -1
  85. package/Icon-9b4a8a2d.js.map +0 -1
  86. package/Modal-6b4a2c9c.js.map +0 -1
  87. package/RadioButton-84ca988e.js +0 -2
  88. package/RadioButton-84ca988e.js.map +0 -1
  89. package/Textarea-9c91191a.js +0 -2
  90. package/Textarea-9c91191a.js.map +0 -1
  91. package/Validation-ef9ee0ae.js.map +0 -1
  92. package/constants-a4b0b501.js +0 -2
  93. package/constants-a4b0b501.js.map +0 -1
@@ -131,25 +131,25 @@
131
131
  "required": false,
132
132
  "type": {
133
133
  "name": "enum",
134
- "raw": "\"OnWhite\" | \"OnGrey\" | \"OnBlueberry\" | \"OnDark\" | \"OnError\" | undefined",
134
+ "raw": "\"onwhite\" | \"ongrey\" | \"onblueberry\" | \"ondark\" | \"oninvalid\" | undefined",
135
135
  "value": [
136
136
  {
137
137
  "value": "undefined"
138
138
  },
139
139
  {
140
- "value": "\"OnWhite\""
140
+ "value": "\"onwhite\""
141
141
  },
142
142
  {
143
- "value": "\"OnGrey\""
143
+ "value": "\"ongrey\""
144
144
  },
145
145
  {
146
- "value": "\"OnBlueberry\""
146
+ "value": "\"onblueberry\""
147
147
  },
148
148
  {
149
- "value": "\"OnDark\""
149
+ "value": "\"ondark\""
150
150
  },
151
151
  {
152
- "value": "\"OnError\""
152
+ "value": "\"oninvalid\""
153
153
  }
154
154
  ]
155
155
  }
@@ -249,6 +249,44 @@
249
249
  "name": "string"
250
250
  }
251
251
  },
252
+ "afterLabelChildren": {
253
+ "defaultValue": null,
254
+ "description": "Component shown after label",
255
+ "name": "afterLabelChildren",
256
+ "parent": {
257
+ "fileName": "src/components/Textarea/Textarea.tsx",
258
+ "name": "TextareaProps"
259
+ },
260
+ "declarations": [
261
+ {
262
+ "fileName": "src/components/Textarea/Textarea.tsx",
263
+ "name": "TextareaProps"
264
+ }
265
+ ],
266
+ "required": false,
267
+ "type": {
268
+ "name": "ReactNode"
269
+ }
270
+ },
271
+ "belowLabelChildren": {
272
+ "defaultValue": null,
273
+ "description": "Component shown under label",
274
+ "name": "belowLabelChildren",
275
+ "parent": {
276
+ "fileName": "src/components/Textarea/Textarea.tsx",
277
+ "name": "TextareaProps"
278
+ },
279
+ "declarations": [
280
+ {
281
+ "fileName": "src/components/Textarea/Textarea.tsx",
282
+ "name": "TextareaProps"
283
+ }
284
+ ],
285
+ "required": false,
286
+ "type": {
287
+ "name": "ReactNode"
288
+ }
289
+ },
252
290
  "autoFocus": {
253
291
  "defaultValue": null,
254
292
  "description": "",
@@ -1,2 +1,2 @@
1
- import{T as s}from"../../Textarea-9c91191a.js";export{T as default}from"../../Textarea-9c91191a.js";import"../../_rollupPluginBabelHelpers-d0752906.js";import"../../_tslib-51c8a283.js";import"react";import"../../index-9b84fabc.js";import"./styles.module.scss";import"../../constants-a4b0b501.js";import"../../uuid-8870ab4b.js";
1
+ import{T as s}from"../../Textarea-05e33ba3.js";export{T as default}from"../../Textarea-05e33ba3.js";import"../../_rollupPluginBabelHelpers-d0752906.js";import"../../_tslib-51c8a283.js";import"react";import"../../index-9b84fabc.js";import"./styles.module.scss";import"../../constants-42547490.js";import"../../uuid-8870ab4b.js";
2
2
  //# sourceMappingURL=index.js.map
@@ -2,10 +2,10 @@
2
2
  @import '../../scss/_breakpoints.scss';
3
3
  @import '../../scss/_palette.scss';
4
4
  @import '../../scss/_font-settings.scss';
5
+ @import '../../scss/_input.scss';
5
6
 
6
7
  .textarea {
7
- width: 100%;
8
- line-height: 0;
8
+ @include input-wrapper;
9
9
 
10
10
  &__error-text {
11
11
  font-size: $font-size-sm;
@@ -19,113 +19,6 @@
19
19
  margin-bottom: getSpacer(s);
20
20
  }
21
21
 
22
- &__label {
23
- line-height: getSpacer(m);
24
- font-size: $font-size-sm;
25
- font-weight: 600;
26
- padding-bottom: getSpacer(2xs);
27
-
28
- @media (min-width: map-get($grid-breakpoints, md)) {
29
- line-height: getSpacer(l);
30
- font-size: $font-size-md;
31
- }
32
-
33
- &--OnDark {
34
- color: $white;
35
- }
36
- }
37
-
38
- &__input {
39
- line-height: 26px;
40
- font-size: $font-size-sm;
41
- width: 100%;
42
- padding: 16px;
43
- resize: none;
44
- border: $neutral700 2px solid;
45
- outline: none;
46
-
47
- @media (min-width: map-get($grid-breakpoints, md)) {
48
- line-height: 28px;
49
- font-size: $font-size-md;
50
- }
51
-
52
- &:hover {
53
- background: $neutral50;
54
- border-color: $neutral700;
55
- box-shadow: 0px 0px 0px 1px $neutral700;
56
- }
57
- &:focus {
58
- background: $white;
59
- border-radius: 0;
60
- border-color: $neutral900;
61
- box-shadow: 0px 0px 0px 2px $neutral900;
62
- }
63
-
64
- &:disabled {
65
- cursor: not-allowed;
66
- background: $neutral50;
67
- border-color: $neutral500;
68
- color: $neutral500;
69
- }
70
- &::placeholder {
71
- color: $neutral500;
72
- }
73
-
74
- &--OnBlueberry {
75
- border-color: $blueberry500;
76
-
77
- &:hover {
78
- background: $blueberry50;
79
- box-shadow: 0px 0px 0px 1px $blueberry500;
80
- border-color: $blueberry500;
81
- }
82
-
83
- &:focus {
84
- background: $white;
85
- border-color: $neutral900;
86
- box-shadow: 0px 0px 0px 2px $neutral900;
87
- }
88
- &:disabled {
89
- background: $neutral50;
90
- border-color: $neutral500;
91
- color: $neutral500;
92
- }
93
- }
94
- &--OnDark {
95
- border-color: $blueberry900;
96
- &:hover {
97
- background: $blueberry50;
98
- border-color: $blueberry900;
99
- box-shadow: 0px 0px 0px 1px $blueberry900;
100
- }
101
- &:focus {
102
- background: $white;
103
- border-color: $neutral900;
104
- box-shadow: 0px 0px 0px 2px $neutral900;
105
- }
106
- &:disabled {
107
- background: $neutral50;
108
- }
109
- }
110
- &--invalid {
111
- border-color: $cherry500;
112
- &:focus {
113
- border-color: $cherry500;
114
- box-shadow: 0px 0px 0px 2px $cherry500;
115
- }
116
- }
117
-
118
- &--transparent {
119
- background: transparent;
120
- &:hover {
121
- background: transparent;
122
- }
123
- &:focus {
124
- background: $white;
125
- }
126
- }
127
- }
128
-
129
22
  &__counter-wrapper {
130
23
  display: flex;
131
24
  justify-content: end;
@@ -143,7 +36,7 @@
143
36
  margin: 0;
144
37
  }
145
38
 
146
- &--OnDark {
39
+ &--on-dark {
147
40
  color: $white;
148
41
  }
149
42
  &--invalid {
@@ -152,3 +45,13 @@
152
45
  }
153
46
  }
154
47
  }
48
+
49
+ .content-wrapper {
50
+ @include content-wrapper;
51
+ &__input {
52
+ line-height: 28px;
53
+ height: auto;
54
+ padding: 16px;
55
+ resize: none;
56
+ }
57
+ }
@@ -1,16 +1,21 @@
1
1
  export type Styles = {
2
+ 'content-wrapper': string;
3
+ 'content-wrapper__input': string;
4
+ 'content-wrapper__input--disabled': string;
5
+ 'content-wrapper--bigform': string;
6
+ 'content-wrapper--disabled': string;
7
+ 'content-wrapper--invalid': string;
8
+ 'content-wrapper--on-blueberry': string;
9
+ 'content-wrapper--on-dark': string;
10
+ 'content-wrapper--transparent': string;
2
11
  textarea: string;
12
+ 'textarea__after-label-children': string;
3
13
  'textarea__counter-wrapper': string;
4
14
  'textarea__counter-wrapper--invalid': string;
5
- 'textarea__counter-wrapper--OnDark': string;
15
+ 'textarea__counter-wrapper--on-dark': string;
6
16
  'textarea__error-text': string;
7
- textarea__input: string;
8
- 'textarea__input--invalid': string;
9
- 'textarea__input--OnBlueberry': string;
10
- 'textarea__input--OnDark': string;
11
- 'textarea__input--transparent': string;
12
- textarea__label: string;
13
- 'textarea__label--OnDark': string;
17
+ 'textarea__label-wrapper': string;
18
+ 'textarea__label-wrapper--on-dark': string;
14
19
  'textarea--gutterBottom': string;
15
20
  };
16
21
 
@@ -1,2 +1,2 @@
1
- import{_ as e,a as t}from"../../_rollupPluginBabelHelpers-d0752906.js";import{_ as i}from"../../_tslib-51c8a283.js";import r,{useState as l}from"react";import{c as o}from"../../index-9b84fabc.js";import"../../Icon-9b4a8a2d.js";import{I as a}from"../../constants-a4b0b501.js";import n from"./styles.module.scss";var s=r.forwardRef((function(e,i){var l,a=e.children,s=e.className,c=e.htmlMarkup,m=void 0===c?"span":c,d=e.highlighted,p=e.compact,f=o(n.tile__title,(t(l={},n["tile__title--highlighted"],d),t(l,n["tile__title--compact"],p),l),s),u=m;return r.createElement(u,{className:f,ref:i},a)})),c=r.forwardRef((function(s,c){var m,d=s.icon,p=s.title,f=s.className,u=void 0===f?"":f,h=s.description,g=s.fixed,_=void 0!==g&&g,b=s.highlighted,v=void 0!==b&&b,E=s.testId,N=i(s,["icon","title","className","description","fixed","highlighted","testId"]),j=l(!1),x=e(j,2),w=x[0],I=x[1],M=!h,k=o(n.tile,(t(m={},n["tile--fixed"],_),t(m,n["tile--compact"],M),t(m,n["tile--highlighted"],v),m),u),B=o(n["title-wrapper"],t({},n["title-wrapper--compact"],M));return r.createElement("a",Object.assign({ref:c,className:k,onMouseEnter:function(){return I(!0)},onMouseLeave:function(){return I(!1)},onFocus:function(){return I(!0)},onBlur:function(){return I(!1)},"data-testid":E,rel:"_blank"===s.target?"noopener noreferrer":s.rel},N),r.createElement("div",{className:B},r.cloneElement(d,{size:a.Medium,isHovered:w,color:v?"white":"black"}),r.cloneElement(p,{highlighted:v,compact:M})),h?r.createElement("p",{className:n.tile__description},h):null)}));c.Title=s;export default c;export{c as Tile};
1
+ import{_ as e,a as t}from"../../_rollupPluginBabelHelpers-d0752906.js";import{_ as i}from"../../_tslib-51c8a283.js";import r,{useState as l}from"react";import{c as o}from"../../index-9b84fabc.js";import"../../Icon-04613a89.js";import{I as a}from"../../constants-42547490.js";import n from"./styles.module.scss";var s=r.forwardRef((function(e,i){var l,a=e.children,s=e.className,c=e.htmlMarkup,m=void 0===c?"span":c,d=e.highlighted,p=e.compact,f=o(n.tile__title,(t(l={},n["tile__title--highlighted"],d),t(l,n["tile__title--compact"],p),l),s),u=m;return r.createElement(u,{className:f,ref:i},a)})),c=r.forwardRef((function(s,c){var m,d=s.icon,p=s.title,f=s.className,u=void 0===f?"":f,h=s.description,g=s.fixed,_=void 0!==g&&g,v=s.highlighted,b=void 0!==v&&v,E=s.testId,N=i(s,["icon","title","className","description","fixed","highlighted","testId"]),j=l(!1),x=e(j,2),w=x[0],I=x[1],M=!h,k=o(n.tile,(t(m={},n["tile--fixed"],_),t(m,n["tile--compact"],M),t(m,n["tile--highlighted"],b),m),u),B=o(n["title-wrapper"],t({},n["title-wrapper--compact"],M));return r.createElement("a",Object.assign({ref:c,className:k,onMouseEnter:function(){return I(!0)},onMouseLeave:function(){return I(!1)},onFocus:function(){return I(!0)},onBlur:function(){return I(!1)},"data-testid":E,rel:"_blank"===s.target?"noopener noreferrer":s.rel},N),r.createElement("div",{className:B},r.cloneElement(d,{size:a.Medium,isHovered:w,color:b?"white":"black"}),r.cloneElement(p,{highlighted:b,compact:M})),h?r.createElement("p",{className:n.tile__description},h):null)}));c.Title=s;export default c;export{c as Tile};
2
2
  //# sourceMappingURL=index.js.map
@@ -74,16 +74,16 @@
74
74
  "required": false,
75
75
  "type": {
76
76
  "name": "enum",
77
- "raw": "\"Normal\" | \"BigForm\" | undefined",
77
+ "raw": "\"normal\" | \"bigform\" | undefined",
78
78
  "value": [
79
79
  {
80
80
  "value": "undefined"
81
81
  },
82
82
  {
83
- "value": "\"Normal\""
83
+ "value": "\"normal\""
84
84
  },
85
85
  {
86
- "value": "\"BigForm\""
86
+ "value": "\"bigform\""
87
87
  }
88
88
  ]
89
89
  }
@@ -1,2 +1,2 @@
1
- import{V as s}from"../../Validation-ef9ee0ae.js";export{V as Validation,V as default}from"../../Validation-ef9ee0ae.js";import"react";import"../../index-9b84fabc.js";import"../../FormGroup-68288be3.js";import"../../_rollupPluginBabelHelpers-d0752906.js";import"../FormGroup/styles.module.scss";import"../../Checkbox-0ba01292.js";import"../../uuid-8870ab4b.js";import"../../Check-6291ad09.js";import"../../Icon-9b4a8a2d.js";import"../../_tslib-51c8a283.js";import"../../constants-a4b0b501.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../Checkbox/styles.module.scss";import"../../Title-90910763.js";import"../Title/styles.module.scss";import"../../RadioButton-84ca988e.js";import"../RadioButton/styles.module.scss";import"./styles.module.scss";
1
+ import{V as s}from"../../Validation-9bf0c0ec.js";export{V as Validation,V as default}from"../../Validation-9bf0c0ec.js";import"react";import"../../index-9b84fabc.js";import"../../FormGroup-6c545646.js";import"../../_rollupPluginBabelHelpers-d0752906.js";import"../FormGroup/styles.module.scss";import"../../Checkbox-fb5dff56.js";import"../../uuid-8870ab4b.js";import"../../Check-6291ad09.js";import"../../Icon-04613a89.js";import"../../_tslib-51c8a283.js";import"../../constants-42547490.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../Checkbox/styles.module.scss";import"../../RadioButton-d90884c9.js";import"../RadioButton/styles.module.scss";import"../../Input-adeb7f88.js";import"../../useBreakpoint-324a9b14.js";import"../../useWindowSize-73b47451.js";import"../Input/styles.module.scss";import"../../Title-90910763.js";import"../Title/styles.module.scss";import"./styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ var a,n,o,r;!function(a){a[a.XSmall=38]="XSmall",a[a.Small=48]="Small",a[a.Medium=64]="Medium",a[a.Large=80]="Large",a[a.XLarge=130]="XLarge"}(a||(a={})),function(a){a[a.Modal=13e5]="Modal"}(n||(n={})),function(a){a.onwhite="onwhite",a.ongrey="ongrey",a.onblueberry="onblueberry",a.ondark="ondark",a.oninvalid="oninvalid"}(o||(o={})),function(a){a.normal="normal",a.bigform="bigform"}(r||(r={}));export{o as F,a as I,n as Z,r as a};
2
+ //# sourceMappingURL=constants-42547490.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants-42547490.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/constants.d.ts CHANGED
@@ -48,14 +48,14 @@ export interface HTMLAnchorProps {
48
48
  }
49
49
  export declare type ButtonVariant = 'secondary' | 'tertiary' | string | undefined | null;
50
50
  export declare enum FormMode {
51
- OnWhite = "OnWhite",
52
- OnGrey = "OnGrey",
53
- OnBlueberry = "OnBlueberry",
54
- OnDark = "OnDark",
55
- OnError = "OnError"
51
+ onwhite = "onwhite",
52
+ ongrey = "ongrey",
53
+ onblueberry = "onblueberry",
54
+ ondark = "ondark",
55
+ oninvalid = "oninvalid"
56
56
  }
57
57
  export declare enum FormVariant {
58
- Normal = "Normal",
59
- BigForm = "BigForm"
58
+ normal = "normal",
59
+ bigform = "bigform"
60
60
  }
61
61
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,MAAM;CACb;AAED,oBAAY,MAAM;IAChB,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAC1C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EACX,EAAE,GACF,aAAa,GACb,aAAa,GACb,4BAA4B,GAC5B,QAAQ,GACR,0BAA0B,GAC1B,eAAe,GACf,iCAAiC,GACjC,YAAY,CAAC;CAClB;AAED,oBAAY,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAEjF,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,MAAM,MAAM;CACb;AAED,oBAAY,MAAM;IAChB,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAC1C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EACX,EAAE,GACF,aAAa,GACb,aAAa,GACb,4BAA4B,GAC5B,QAAQ,GACR,0BAA0B,GAC1B,eAAe,GACf,iCAAiC,GACjC,YAAY,CAAC;CAClB;AAED,oBAAY,aAAa,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAEjF,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;IACjB,SAAS,cAAc;CACxB;AAED,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB"}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from '../components/Icons';
3
+ export declare const useIcons: (children: import("react").ReactNode[]) => (string | number | boolean | {} | import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)> | import("react").ReactNodeArray | import("react").ReactPortal | import("react").ReactElement<IconProps, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)> | null | undefined)[];
4
+ //# sourceMappingURL=useIcons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIcons.d.ts","sourceRoot":"","sources":["../../src/hooks/useIcons.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,eAAO,MAAM,QAAQ,qgBAapB,CAAC"}
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{t as theme}from"./index-19b48c51.js";export{u as useHover}from"./useHover-037be19d.js";export{F as FormMode,a as FormVariant,I as IconSize,Z as ZIndex}from"./constants-a4b0b501.js";import"./palette-f206f488.js";import"./grid-11a70eb7.js";import"./_rollupPluginBabelHelpers-d0752906.js";import"react";
1
+ export{t as theme}from"./index-19b48c51.js";export{u as useHover}from"./useHover-037be19d.js";export{F as FormMode,a as FormVariant,I as IconSize,Z as ZIndex}from"./constants-42547490.js";import"./palette-f206f488.js";import"./grid-11a70eb7.js";import"./_rollupPluginBabelHelpers-d0752906.js";import"react";
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@helsenorge/designsystem-react",
3
3
  "sideEffects": false,
4
- "version": "1.0.0-beta94",
4
+ "version": "1.0.0-beta95",
5
5
  "description": "The official design system for Helsenorge built with React.",
6
6
  "repository": {
7
7
  "type": "tfs",
@@ -0,0 +1,174 @@
1
+ @mixin input-wrapper {
2
+ width: 100%;
3
+ line-height: 0;
4
+
5
+ &__label-wrapper {
6
+ display: inline-flex;
7
+ align-items: center;
8
+ line-height: getSpacer(m);
9
+ font-size: $font-size-sm;
10
+ font-weight: 600;
11
+ padding-bottom: getSpacer(xs);
12
+
13
+ @media (min-width: map-get($grid-breakpoints, md)) {
14
+ line-height: getSpacer(l);
15
+ font-size: $font-size-md;
16
+ }
17
+
18
+ &--on-dark {
19
+ color: $white;
20
+ }
21
+ }
22
+
23
+ &__after-label-children {
24
+ padding-left: 0.75rem;
25
+ }
26
+ }
27
+
28
+ @mixin content-wrapper {
29
+ font-size: $font-size-sm;
30
+ width: 100%;
31
+ border: $neutral700 2px solid;
32
+ outline: none;
33
+ background: $white;
34
+
35
+ svg:first-child {
36
+ padding-left: 0.375rem;
37
+ }
38
+
39
+ svg:last-child {
40
+ padding-right: 0.375rem;
41
+ }
42
+
43
+ &--bigform {
44
+ padding: getSpacer(xs) 0;
45
+
46
+ svg:first-child {
47
+ padding-left: getSpacer(xs);
48
+ }
49
+
50
+ svg:last-child {
51
+ padding-right: getSpacer(xs);
52
+ }
53
+ }
54
+
55
+ &:hover {
56
+ background: $neutral50;
57
+ border-color: $neutral700;
58
+ box-shadow: 0px 0px 0px 1px $neutral700;
59
+
60
+ &:focus-within {
61
+ border-color: $black;
62
+ box-shadow: 0px 0px 0px 2px $black;
63
+ }
64
+ }
65
+ &:focus-within {
66
+ background: $white;
67
+ border-color: $neutral900;
68
+ box-shadow: 0px 0px 0px 2px $neutral900;
69
+ }
70
+
71
+ &--on-blueberry {
72
+ border-color: $blueberry500;
73
+
74
+ &:hover {
75
+ background: $blueberry50;
76
+ box-shadow: 0px 0px 0px 1px $blueberry500;
77
+ border-color: $blueberry500;
78
+ }
79
+
80
+ &:focus-within {
81
+ background: $white;
82
+ border-color: $neutral900;
83
+ box-shadow: 0px 0px 0px 2px $neutral900;
84
+ }
85
+ }
86
+ &--on-dark {
87
+ border-color: $blueberry900;
88
+ &:hover {
89
+ background: $blueberry50;
90
+ border-color: $blueberry900;
91
+ box-shadow: 0px 0px 0px 1px $blueberry900;
92
+ }
93
+ &:focus-within {
94
+ background: $white;
95
+ border-color: $neutral900;
96
+ box-shadow: 0px 0px 0px 2px $neutral900;
97
+ }
98
+ }
99
+ &--invalid {
100
+ border-color: $cherry500;
101
+
102
+ &:hover {
103
+ background: $cherry100;
104
+ border-color: $cherry500;
105
+ box-shadow: 0px 0px 0px 2px $cherry500;
106
+ }
107
+ &:focus-within {
108
+ background: $white;
109
+ border-color: $neutral900;
110
+ box-shadow: 0px 0px 0px 2px $neutral900;
111
+ }
112
+ }
113
+ &--transparent {
114
+ background: transparent;
115
+
116
+ &:hover {
117
+ background: $neutral100;
118
+ }
119
+
120
+ &:focus-within {
121
+ background: $white;
122
+ }
123
+ }
124
+ &--transparent#{&}--on-blueberry {
125
+ &:hover {
126
+ background: $blueberry100;
127
+ }
128
+
129
+ &:focus-within {
130
+ background: $white;
131
+ }
132
+ }
133
+
134
+ &--disabled {
135
+ background: $neutral50;
136
+ border-color: $neutral500;
137
+ color: $neutral500;
138
+
139
+ &:hover {
140
+ border-color: $neutral500;
141
+ box-shadow: none;
142
+ }
143
+ }
144
+
145
+ &__input {
146
+ line-height: 1.625rem;
147
+ font-size: $font-size-sm;
148
+ padding: 0 getSpacer(xs);
149
+ border: none;
150
+ outline: none;
151
+ background-color: transparent;
152
+ width: 100%;
153
+
154
+ @media (min-width: map-get($grid-breakpoints, md)) {
155
+ font-size: $font-size-md;
156
+ }
157
+
158
+ &::placeholder {
159
+ color: $neutral500;
160
+ }
161
+
162
+ &--disabled {
163
+ color: $neutral500;
164
+ }
165
+
166
+ &:first-child {
167
+ padding-left: getSpacer(s);
168
+ }
169
+
170
+ &:last-child {
171
+ padding-right: getSpacer(s);
172
+ }
173
+ }
174
+ }
@@ -1,2 +0,0 @@
1
- import{_ as t,a as e}from"./_rollupPluginBabelHelpers-d0752906.js";import{_ as n}from"./_tslib-51c8a283.js";import o from"react";import{g as r}from"./color-acb834c6.js";import"./Icon-9b4a8a2d.js";import{I as l}from"./constants-a4b0b501.js";import{L as i}from"./Loader-b3fd59f4.js";import{u as a}from"./useHover-037be19d.js";import{u as s}from"./useWindowSize-73b47451.js";import{b as u}from"./grid-11a70eb7.js";import{c as d}from"./index-9b84fabc.js";import c from"./components/Button/styles.module.scss";var m={primary:"blueberry",warning:"banana",danger:"cherry"};var b=function(t,e){return e&&e<u.md&&t?l.Small:t?l.Medium:l.XSmall},f=o.forwardRef((function(u,f){var p,v,_,g=u.children,h=u.className,j=void 0===h?"":h,w=u.fluid,E=void 0!==w&&w,k=u.intent,y=void 0===k?"primary":k,N=u.inverted,I=void 0!==N&&N,C=u.htmlMarkup,H=void 0===C?"button":C,O=u.onClick,S=u.large,z=void 0!==S&&S,B=u.loading,F=void 0!==B&&B,M=u.variant,x=void 0===M?"fill":M,L=u.disabled,R=void 0!==L&&L,X=u.ellipsis,A=void 0!==X&&X,P=u.testId,W=u.href,q=u.target,D=n(u,["children","className","fluid","intent","inverted","htmlMarkup","onClick","large","loading","variant","disabled","ellipsis","testId","href","target"]),G=function(t){var e,n,o,r,l=null,i=null;void 0!==(null===(n=null===(e=t[0])||void 0===e?void 0:e.props)||void 0===n?void 0:n.svgIcon)&&(l=t.shift()),void 0!==(null===(r=null===(o=t[t.length-1])||void 0===o?void 0:o.props)||void 0===r?void 0:r.svgIcon)&&(i=t.pop());var a=t.filter((function(t){return t}));return[l,i,a.length>0?a:null]}(o.Children.toArray(g)),J=t(G,3),K=J[0],Q=J[1],T=J[2],U=a(f),V=U.hoverRef,Y=U.isHovered,Z=function(t,e,n,o,l){return e?r("neutral",600):t&&!o||!t&&o?"white":r(m[n],l?700:600)}("fill"===x,R,y,I,Y),$=s(),tt="fill"===x,et="outline"===x,nt="borderless"===x,ot="warning"===y,rt="danger"===y,lt=!(!K&&!Q||F),it=Object.assign({},D),at=d(c.button,(e(p={},c["button--fluid"],E),e(p,c["button--large"],z),e(p,c["button--warning"],ot),e(p,c["button--danger"],rt),e(p,c["button--inverted"],I),e(p,c["button--fill"],tt),e(p,c["button--outline"],et),e(p,c["button--borderless"],nt),e(p,c["button--with-icon"],lt),e(p,c["button--ellipsis"],A),p),j),st=d(c.button__content,(e(v={},c["button__content--warning"],ot),e(v,c["button__content--danger"],rt),e(v,c["button__content--fill"],tt),e(v,c["button__content--borderless"],nt),e(v,c["button__content--with-icon"],lt),e(v,c["button__content--large"],z),e(v,c["button__content--ellipsis"],A),e(v,c["button__content--inverted"],I),e(v,c["button__content--fluid"],E),v)),ut=d(c["button__left-fluid-content"],(e(_={},c["button__left-fluid-content--with-icon"],lt),e(_,c["button__left-fluid-content--large"],z),_));function dt(t,e,n,r){var l=t&&t.props&&t.props.color?t.props.color:n;return t&&Object.keys(t).length>0?o.cloneElement(t,{size:e,color:l,isHovered:r}):null}var ct=function(){return T?o.createElement("span",{className:st},T):null},mt=function(){return o.createElement("span",{className:c["content-wrapper"]},F?o.createElement("div",{className:c["button__left-fluid-content"]},o.createElement(i,{testId:"test-id-loader",color:"fill"!==x||I?m[y]:"white",size:"tiny"})):o.createElement(o.Fragment,null,E?o.createElement("div",{className:ut},dt(K,b(z,$.width),Z,Y),ct()):o.createElement(o.Fragment,null,dt(K,b(z,$.width),Z,Y),ct()),dt(Q,l.XSmall,Z,Y)))};return o.createElement(o.Fragment,null,"button"===H&&o.createElement("button",Object.assign({onClick:O,disabled:R,"data-testid":P,className:at,ref:V},it),mt()),"a"===H&&o.createElement("a",Object.assign({onClick:O,"data-testid":P,className:at,href:W,target:q,rel:"_blank"===q?"noopener noreferrer":u.rel,ref:V},D),mt()))}));export{f as B,m as i};
2
- //# sourceMappingURL=Button-72f96290.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button-72f96290.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{_ as e,a as r}from"./_rollupPluginBabelHelpers-d0752906.js";import a,{useState as c,useEffect as o}from"react";import{c as b}from"./index-9b84fabc.js";import{u as l}from"./uuid-8870ab4b.js";import{C as i}from"./Check-6291ad09.js";import{I as s}from"./Icon-9b4a8a2d.js";import{F as n,a as t}from"./constants-a4b0b501.js";import{g as m}from"./color-acb834c6.js";import p from"./components/Checkbox/styles.module.scss";var d=a.forwardRef((function(d,h){var k,x,u,f=d.className,_=d.checked,v=void 0!==_&&_,w=d.disabled,g=d.label,y=d.inputid,j=void 0===y?l():y,E=d.mode,N=d.name,C=void 0===N?j:N,I=d.variant,B=d.errorText,F=d.error,O=void 0===F?!!B:F,z=d.value,D=void 0===z?g:z,H=c(v),P=e(H,2),R=P[0],T=P[1],q=O||E===n.OnError,A=E===n.OnDark,G=E===n.OnBlueberry,J=I===t.BigForm,K=b(p["checkbox-wrapper"],(r(k={},p["checkbox-wrapper--with-error"],B),r(k,p["checkbox-wrapper--bigform"],J),k)),L=b(p["checkbox-label"],(r(x={},p["checkbox-label--disabled"],w),r(x,p["checkbox-label--on-dark"],A),r(x,p["checkbox-label--on-blueberry"],G),r(x,p["checkbox-label--invalid"],q),r(x,p["checkbox-label--bigform"],J),x)),M=b(p.checkbox,f),Q=b(p["checkbox__icon-wrapper"],(r(u={},p["checkbox__icon-wrapper--checked"],R),r(u,p["checkbox__icon-wrapper--disabled"],w),r(u,p["checkbox__icon-wrapper--on-dark"],A),r(u,p["checkbox__icon-wrapper--on-blueberry"],G),r(u,p["checkbox__icon-wrapper--invalid"],q),u)),S=b(p["checkbox-errors"],r({},p["checkbox-errors--bigform"],J)),U=m("blueberry",500);return w&&(U=m("neutral",400)),A&&(U=m("blueberry",200)),q&&(U=m("cherry",500)),o((function(){T(v)}),[v]),a.createElement("div",{"data-testid":d.testId,className:K},B&&a.createElement("p",{className:S},B),a.createElement("label",{htmlFor:j,className:L},a.createElement("input",{id:j,name:C,className:M,type:"checkbox",checked:R,disabled:w,onChange:function(){T(!R)},value:D,ref:h,"aria-invalid":O}),a.createElement("span",{className:Q},R&&a.createElement(s,{color:U,className:p.checkbox__icon,svgIcon:i,size:38})),g))}));export{d as C};
2
- //# sourceMappingURL=Checkbox-0ba01292.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox-0ba01292.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Close-80751ae6.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{a as e}from"./_rollupPluginBabelHelpers-d0752906.js";import r from"react";import{c as a}from"./index-9b84fabc.js";import o from"./components/FormGroup/styles.module.scss";import{C as t}from"./Checkbox-0ba01292.js";import{F as m,a as l}from"./constants-a4b0b501.js";import{T as n}from"./Title-90910763.js";import{R as i}from"./RadioButton-84ca988e.js";var p=r.forwardRef((function(p,s){var f,d,c,u=p.className,g=p.mode,_=void 0===g?m.OnWhite:g,v=p.variant,b=void 0===v?l.Normal:v,w=p.error,E=p.name,N=_===m.OnDark,h=b===l.BigForm,j=a(o["form-group-wrapper"],(e(f={},o["form-group-wrapper--on-dark"],N),e(f,o["form-group-wrapper--invalid"],w),f),u),k=a(o["form-group-wrapper__title"],(e(d={},o["form-group-wrapper__title--on-dark"],N&&!w),e(d,o["form-group-wrapper__title--bigform"],h),d)),y=a(o["form-group"],e({},o["form-group--invalid"],w)),B=a(o["form-group-wrapper__errors"],e({},o["form-group-wrapper__errors--bigform"],h)),F=a(o["field-set__legend"],(e(c={},o["field-set__legend--on-dark"],N&&!w),e(c,o["field-set__legend--bigform"],h),c));return r.createElement("div",{"data-testid":p.testId,className:j},p.title&&r.createElement(n,{className:k,htmlMarkup:"h4",appearance:"title4",margin:{marginTop:0,marginBottom:2}},p.title),r.createElement("div",{className:y},w&&r.createElement("p",{className:B},w),r.createElement("fieldset",{name:p.title,className:o["field-set"]},p.legend&&r.createElement("legend",{className:F},p.legend),r.Children.map(p.children,(function(e){if(e.type===t){var a=e.type===t;return r.cloneElement(e,{name:null!=E?E:a.valueOf.name,mode:_,variant:b,error:!!w})}if(e.type===i){var o=e.type===i;return r.cloneElement(e,{name:null!=E?E:o.valueOf.name,mode:_,variant:b,error:!!w})}return e})))))}));export{p as F};
2
- //# sourceMappingURL=FormGroup-68288be3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormGroup-68288be3.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Icon-9b4a8a2d.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal-6b4a2c9c.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{a as r}from"./_rollupPluginBabelHelpers-d0752906.js";import a from"react";import{c as o}from"./index-9b84fabc.js";import{u as e}from"./uuid-8870ab4b.js";import t from"./components/RadioButton/styles.module.scss";import{F as i,a as d}from"./constants-a4b0b501.js";var l=a.forwardRef((function(l,n){var b,s,u,m=l.className,p=l.defaultChecked,c=void 0!==p&&p,f=l.disabled,v=l.label,g=l.inputid,k=void 0===g?e():g,w=l.mode,y=l.name,E=void 0===y?k:y,N=l.variant,h=l.errorText,j=l.error,B=void 0===j?!!h:j,x=l.value,F=void 0===x?v:x,O=B||w===i.OnError,R=w===i.OnDark,C=w===i.OnBlueberry,D=N===d.BigForm,H=o(t["radio-button-wrapper"],(r(b={},t["radio-button-wrapper--with-error"],h),r(b,t["radio-button-wrapper--bigform"],D),b)),I=o(t["radio-button-label"],(r(s={},t["radio-button-label--disabled"],f),r(s,t["radio-button-label--on-dark"],R),r(s,t["radio-button-label--on-blueberry"],C),r(s,t["radio-button-label--invalid"],O),r(s,t["radio-button-label--bigform"],D),s)),P=o(t["radio-button"],(r(u={},t["radio-button--on-dark"],R),r(u,t["radio-button--disabled"],f),r(u,t["radio-button--on-blueberry"],C),r(u,t["radio-button--invalid"],O),u),m),T=o(t["radio-button-errors"],r({},t["radio-button-errors--bigform"],D));return a.createElement("div",{"data-testid":l.testId,className:H},h&&a.createElement("p",{className:T},h),a.createElement("label",{htmlFor:k,className:I},a.createElement("input",{id:k,name:E,className:P,type:"radio",disabled:f,value:F,ref:n,"aria-invalid":B,defaultChecked:c}),v))}));export{l as R};
2
- //# sourceMappingURL=RadioButton-84ca988e.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioButton-84ca988e.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{_ as e,a}from"./_rollupPluginBabelHelpers-d0752906.js";import{_ as t}from"./_tslib-51c8a283.js";import r,{useState as n,useRef as o,useEffect as l}from"react";import{c as i}from"./index-9b84fabc.js";import s from"./components/Textarea/styles.module.scss";import{F as c}from"./constants-a4b0b501.js";import{u as m}from"./uuid-8870ab4b.js";var u=r.forwardRef((function(u,d){var p,x,v,_=u.maxCharacters,f=u.maxText,b=u.testId,g=u.defaultValue,w=u.marginBottom,h=u.transparent,E=u.mode,O=u.label,T=u.minRows,j=void 0===T?3:T,B=u.maxRows,R=void 0===B?10:B,k=u.grow,D=u.errorText,N=t(u,["maxCharacters","maxText","testId","defaultValue","marginBottom","transparent","mode","label","minRows","maxRows","grow","errorText"]),y=n(j),C=e(y,2),H=C[0],V=C[1],F=n(g||""),I=e(F,2),M=I[0],P=I[1],q=o(null),z=function(e){var a=e.rows;e.rows=j;var t=Math.floor((e.scrollHeight-16)/28);t===a&&(e.rows=t),t>=R&&(e.rows=R,e.scrollTop=e.scrollHeight),V(t<R?t:R)},A=E===c.OnDark,G=E===c.OnBlueberry,J=_&&M.length>_,K=E===c.OnError||D||J,L=i(s.textarea,(a(p={},s["textarea--gutterBottom"],w),a(p,s["textarea--invalid"],D),p)),Q=i(s.textarea__input,(a(x={},s["textarea__input--transparent"],h),a(x,s["textarea__input--".concat(c.OnBlueberry)],G),a(x,s["textarea__input--".concat(c.OnDark)],A),a(x,s["textarea__input--invalid"],K),x)),S=i(s["textarea__counter-wrapper"],(a(v={},s["textarea__counter-wrapper--".concat(c.OnDark)],A),a(v,s["textarea__counter-wrapper--invalid"],K),v)),U=i(s.textarea__label,a({},s["textarea__label--".concat(c.OnDark)],A)),W=O?m():void 0;return l((function(){var e,a,t;if(k&&(null===(e=q.current)||void 0===e?void 0:e.children)&&(null===(a=q.current)||void 0===a?void 0:a.children[0])){var r=null===(t=q.current)||void 0===t?void 0:t.children[0];z(r)}}),[]),r.createElement("div",{"data-testid":b,className:L},O&&r.createElement("div",{className:U},r.createElement("label",{htmlFor:W},O)),r.createElement("div",{ref:q},r.createElement("textarea",Object.assign({rows:H,defaultValue:g,id:W,className:Q,ref:d,onChange:function(e){k&&z(e.target),P(e.target.value)},"aria-invalid":!!K},N)),_&&r.createElement("div",{className:S},r.createElement("p",null,"".concat(M.length,"/").concat(_," ").concat(f||"tegn")))))}));export{u as T};
2
- //# sourceMappingURL=Textarea-9c91191a.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Textarea-9c91191a.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Validation-ef9ee0ae.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- var r,a,n,e;!function(r){r[r.XSmall=38]="XSmall",r[r.Small=48]="Small",r[r.Medium=64]="Medium",r[r.Large=80]="Large",r[r.XLarge=130]="XLarge"}(r||(r={})),function(r){r[r.Modal=13e5]="Modal"}(a||(a={})),function(r){r.OnWhite="OnWhite",r.OnGrey="OnGrey",r.OnBlueberry="OnBlueberry",r.OnDark="OnDark",r.OnError="OnError"}(n||(n={})),function(r){r.Normal="Normal",r.BigForm="BigForm"}(e||(e={}));export{n as F,r as I,a as Z,e as a};
2
- //# sourceMappingURL=constants-a4b0b501.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-a4b0b501.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}