@helsenorge/designsystem-react 1.0.0-beta79 → 1.0.0-beta80

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 (69) hide show
  1. package/{Button-619210b9.js → Button-7200b617.js} +2 -2
  2. package/Button-7200b617.js.map +1 -0
  3. package/Check-6291ad09.js +2 -0
  4. package/Check-6291ad09.js.map +1 -0
  5. package/Checkbox-ffdd3cb7.js +2 -0
  6. package/Checkbox-ffdd3cb7.js.map +1 -0
  7. package/FormGroup-17d2a3d3.js +2 -0
  8. package/FormGroup-17d2a3d3.js.map +1 -0
  9. package/Loader-9e099b42.js +2 -0
  10. package/Loader-9e099b42.js.map +1 -0
  11. package/Modal-5c2defa7.js +2 -0
  12. package/Modal-5c2defa7.js.map +1 -0
  13. package/Validation-e113da7e.js +2 -0
  14. package/Validation-e113da7e.js.map +1 -0
  15. package/components/Avatar/index.js +1 -1
  16. package/components/Button/index.js +1 -1
  17. package/components/ButtonWithModal/ButtonWithModal.d.ts +1 -1
  18. package/components/ButtonWithModal/ButtonWithModal.d.ts.map +1 -1
  19. package/components/ButtonWithModal/index.js +1 -1
  20. package/components/Checkbox/Checkbox.d.ts +31 -0
  21. package/components/Checkbox/Checkbox.d.ts.map +1 -0
  22. package/components/Checkbox/componentdata.json +259 -0
  23. package/components/Checkbox/index.d.ts +3 -0
  24. package/components/Checkbox/index.d.ts.map +1 -0
  25. package/components/Checkbox/index.js +2 -0
  26. package/components/Checkbox/index.js.map +1 -0
  27. package/components/Checkbox/styles.module.scss +191 -0
  28. package/components/Checkbox/styles.module.scss.d.ts +25 -0
  29. package/components/FormExample/FormExample.d.ts +13 -0
  30. package/components/FormExample/FormExample.d.ts.map +1 -0
  31. package/components/FormExample/componentdata.json +63 -0
  32. package/components/FormExample/index.d.ts +3 -0
  33. package/components/FormExample/index.d.ts.map +1 -0
  34. package/components/FormExample/index.js +2 -0
  35. package/components/FormExample/index.js.map +1 -0
  36. package/components/FormGroup/FormGroup.d.ts +26 -0
  37. package/components/FormGroup/FormGroup.d.ts.map +1 -0
  38. package/components/FormGroup/componentdata.json +183 -0
  39. package/components/FormGroup/index.d.ts +3 -0
  40. package/components/FormGroup/index.d.ts.map +1 -0
  41. package/components/FormGroup/index.js +2 -0
  42. package/components/FormGroup/index.js.map +1 -0
  43. package/components/FormGroup/styles.module.scss +79 -0
  44. package/components/FormGroup/styles.module.scss.d.ts +22 -0
  45. package/components/Loader/Loader.d.ts +2 -2
  46. package/components/Loader/Loader.d.ts.map +1 -1
  47. package/components/Loader/componentdata.json +2 -2
  48. package/components/Loader/index.js +1 -1
  49. package/components/Modal/index.js +1 -1
  50. package/components/Validation/Validation.d.ts +17 -0
  51. package/components/Validation/Validation.d.ts.map +1 -0
  52. package/components/Validation/componentdata.json +111 -0
  53. package/components/Validation/index.d.ts +3 -0
  54. package/components/Validation/index.d.ts.map +1 -0
  55. package/components/Validation/index.js +2 -0
  56. package/components/Validation/index.js.map +1 -0
  57. package/components/Validation/styles.module.scss +15 -0
  58. package/components/Validation/styles.module.scss.d.ts +10 -0
  59. package/package.json +3 -4
  60. package/scss/_palette.scss +1 -0
  61. package/utils/uuid.d.ts +2 -0
  62. package/utils/uuid.d.ts.map +1 -0
  63. package/uuid-484288be.js +2 -0
  64. package/uuid-484288be.js.map +1 -0
  65. package/Button-619210b9.js.map +0 -1
  66. package/Loader-084dd998.js +0 -2
  67. package/Loader-084dd998.js.map +0 -1
  68. package/Modal-52971fb1.js +0 -2
  69. package/Modal-52971fb1.js.map +0 -1
@@ -0,0 +1,183 @@
1
+ {
2
+ "props": {
3
+ "title": {
4
+ "defaultValue": null,
5
+ "description": "title for the the fieldset",
6
+ "name": "title",
7
+ "parent": {
8
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
9
+ "name": "FormGroupProps"
10
+ },
11
+ "declarations": [
12
+ {
13
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
14
+ "name": "FormGroupProps"
15
+ }
16
+ ],
17
+ "required": false,
18
+ "type": {
19
+ "name": "string"
20
+ }
21
+ },
22
+ "legend": {
23
+ "defaultValue": null,
24
+ "description": "text placed in the legend tag of the fieldset",
25
+ "name": "legend",
26
+ "parent": {
27
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
28
+ "name": "FormGroupProps"
29
+ },
30
+ "declarations": [
31
+ {
32
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
33
+ "name": "FormGroupProps"
34
+ }
35
+ ],
36
+ "required": false,
37
+ "type": {
38
+ "name": "string"
39
+ }
40
+ },
41
+ "children": {
42
+ "defaultValue": null,
43
+ "description": "Items in the ExpanderList",
44
+ "name": "children",
45
+ "parent": {
46
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
47
+ "name": "FormGroupProps"
48
+ },
49
+ "declarations": [
50
+ {
51
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
52
+ "name": "FormGroupProps"
53
+ }
54
+ ],
55
+ "required": false,
56
+ "type": {
57
+ "name": "ReactNode"
58
+ }
59
+ },
60
+ "className": {
61
+ "defaultValue": null,
62
+ "description": "Adds custom classes to the element.",
63
+ "name": "className",
64
+ "parent": {
65
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
66
+ "name": "FormGroupProps"
67
+ },
68
+ "declarations": [
69
+ {
70
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
71
+ "name": "FormGroupProps"
72
+ }
73
+ ],
74
+ "required": false,
75
+ "type": {
76
+ "name": "string"
77
+ }
78
+ },
79
+ "mode": {
80
+ "defaultValue": null,
81
+ "description": "Changes the visuals of the formgroup",
82
+ "name": "mode",
83
+ "parent": {
84
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
85
+ "name": "FormGroupProps"
86
+ },
87
+ "declarations": [
88
+ {
89
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
90
+ "name": "FormGroupProps"
91
+ }
92
+ ],
93
+ "required": false,
94
+ "type": {
95
+ "name": "enum",
96
+ "raw": "\"on-white\" | \"on-blueberry\" | \"on-dark\" | undefined",
97
+ "value": [
98
+ {
99
+ "value": "undefined"
100
+ },
101
+ {
102
+ "value": "\"on-white\""
103
+ },
104
+ {
105
+ "value": "\"on-blueberry\""
106
+ },
107
+ {
108
+ "value": "\"on-dark\""
109
+ }
110
+ ]
111
+ }
112
+ },
113
+ "variant": {
114
+ "defaultValue": null,
115
+ "description": "Changes the visuals of the formgroup",
116
+ "name": "variant",
117
+ "parent": {
118
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
119
+ "name": "FormGroupProps"
120
+ },
121
+ "declarations": [
122
+ {
123
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
124
+ "name": "FormGroupProps"
125
+ }
126
+ ],
127
+ "required": false,
128
+ "type": {
129
+ "name": "enum",
130
+ "raw": "\"normal\" | \"bigform\" | undefined",
131
+ "value": [
132
+ {
133
+ "value": "undefined"
134
+ },
135
+ {
136
+ "value": "\"normal\""
137
+ },
138
+ {
139
+ "value": "\"bigform\""
140
+ }
141
+ ]
142
+ }
143
+ },
144
+ "error": {
145
+ "defaultValue": null,
146
+ "description": "Error message",
147
+ "name": "error",
148
+ "parent": {
149
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
150
+ "name": "FormGroupProps"
151
+ },
152
+ "declarations": [
153
+ {
154
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
155
+ "name": "FormGroupProps"
156
+ }
157
+ ],
158
+ "required": false,
159
+ "type": {
160
+ "name": "string"
161
+ }
162
+ },
163
+ "testId": {
164
+ "defaultValue": null,
165
+ "description": "Sets the data-testid attribute.",
166
+ "name": "testId",
167
+ "parent": {
168
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
169
+ "name": "FormGroupProps"
170
+ },
171
+ "declarations": [
172
+ {
173
+ "fileName": "src/components/FormGroup/FormGroup.tsx",
174
+ "name": "FormGroupProps"
175
+ }
176
+ ],
177
+ "required": false,
178
+ "type": {
179
+ "name": "string"
180
+ }
181
+ }
182
+ }
183
+ }
@@ -0,0 +1,3 @@
1
+ import FormGroup from './FormGroup';
2
+ export default FormGroup;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,eAAe,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{F as s}from"../../FormGroup-17d2a3d3.js";export{F as default}from"../../FormGroup-17d2a3d3.js";import"../../_rollupPluginBabelHelpers-e1c7fe69.js";import"react";import"../../index-9b84fabc.js";import"./styles.module.scss";import"../../Checkbox-ffdd3cb7.js";import"../../uuid-484288be.js";import"../../Check-6291ad09.js";import"../../constants-d1f48e8e.js";import"../../_tslib-51c8a283.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../palette-f206f488.js";import"../../grid-11a70eb7.js";import"../Checkbox/styles.module.scss";import"../../Title-863af332.js";import"../Title/styles.module.scss";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,79 @@
1
+ @import '../../scss/_spacers.scss';
2
+ @import '../../scss/_breakpoints.scss';
3
+ @import '../../scss/_palette.scss';
4
+ @import '../../scss/font-settings.scss';
5
+
6
+ .form-group-wrapper {
7
+ padding: getSpacer(s) getSpacer(xs) getSpacer(m);
8
+
9
+ @media (min-width: map-get($grid-breakpoints, md)) {
10
+ padding: getSpacer(s) getSpacer(m) getSpacer(l);
11
+ }
12
+
13
+ &--bigform {
14
+ background-color: $neutral50;
15
+ }
16
+
17
+ &--on-blueberry {
18
+ background-color: $blueberry50;
19
+ }
20
+
21
+ &--on-dark {
22
+ background-color: $blueberry800;
23
+ }
24
+
25
+ &--invalid {
26
+ background-color: $cherry50;
27
+ border-left: 0.25rem solid $cherry500;
28
+ }
29
+
30
+ &__title {
31
+ margin-bottom: getSpacer(l) !important;
32
+
33
+ &--on-dark {
34
+ color: $white;
35
+ }
36
+
37
+ &--bigform {
38
+ margin-left: getSpacer(l) !important;
39
+ }
40
+ }
41
+
42
+ &__errors {
43
+ font-size: $font-size-sm;
44
+ font-weight: 600;
45
+ color: $cherry500;
46
+ margin-top: 0;
47
+
48
+ &--bigform {
49
+ margin-left: getSpacer(l);
50
+ }
51
+ }
52
+ }
53
+
54
+ .form-group-wrapper:first-of-type {
55
+ padding-top: getSpacer(xl);
56
+ }
57
+
58
+ .form-group-wrapper:last-of-type {
59
+ padding-bottom: getSpacer(xl);
60
+ }
61
+
62
+ .form-group {
63
+ border: none;
64
+ padding: 0;
65
+ margin: 0;
66
+
67
+ &__legend {
68
+ font-size: $font-size-md;
69
+ font-weight: 600;
70
+
71
+ &--on-dark {
72
+ color: $white;
73
+ }
74
+
75
+ &--bigform {
76
+ padding: 0 getSpacer(l) getSpacer(l);
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,22 @@
1
+ export type Styles = {
2
+ 'form-group': string;
3
+ 'form-group__legend': string;
4
+ 'form-group__legend--bigform': string;
5
+ 'form-group__legend--on-dark': string;
6
+ 'form-group-wrapper': string;
7
+ 'form-group-wrapper__errors': string;
8
+ 'form-group-wrapper__errors--bigform': string;
9
+ 'form-group-wrapper__title': string;
10
+ 'form-group-wrapper__title--bigform': string;
11
+ 'form-group-wrapper__title--on-dark': string;
12
+ 'form-group-wrapper--bigform': string;
13
+ 'form-group-wrapper--invalid': string;
14
+ 'form-group-wrapper--on-blueberry': string;
15
+ 'form-group-wrapper--on-dark': string;
16
+ };
17
+
18
+ export type ClassNames = keyof Styles;
19
+
20
+ declare const styles: Styles;
21
+
22
+ export default styles;
@@ -15,9 +15,9 @@ interface LoaderProps {
15
15
  center?: boolean;
16
16
  /** Loader is displayed with grey background covering the entire screen */
17
17
  overlay?: boolean;
18
- /** individual id for loading icon (aria-labelledby). */
18
+ /** Individual id for loading icon (aria-labelledby). */
19
19
  ariaLabelledById?: string;
20
- /** individual id for loading icon (aria-labelledby). */
20
+ /** String that labels the current loading element */
21
21
  ariaLabel?: string;
22
22
  }
23
23
  declare const Loader: React.ForwardRefExoticComponent<LoaderProps & React.RefAttributes<HTMLElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../src/components/Loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,oBAAY,YAAY,GAAG,YAAY,CAAC;AACxC,oBAAY,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhE,UAAU,WAAW;IACnB,mCAAmC;IACnC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,MAAM,iFA0DV,CAAC;AAEH,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../../src/components/Loader/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,oBAAY,YAAY,GAAG,YAAY,CAAC;AACxC,oBAAY,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhE,UAAU,WAAW;IACnB,mCAAmC;IACnC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,MAAM,iFA0DV,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -164,7 +164,7 @@
164
164
  },
165
165
  "ariaLabelledById": {
166
166
  "defaultValue": null,
167
- "description": "individual id for loading icon (aria-labelledby).",
167
+ "description": "Individual id for loading icon (aria-labelledby).",
168
168
  "name": "ariaLabelledById",
169
169
  "parent": {
170
170
  "fileName": "src/components/Loader/Loader.tsx",
@@ -183,7 +183,7 @@
183
183
  },
184
184
  "ariaLabel": {
185
185
  "defaultValue": null,
186
- "description": "individual id for loading icon (aria-labelledby).",
186
+ "description": "String that labels the current loading element",
187
187
  "name": "ariaLabel",
188
188
  "parent": {
189
189
  "fileName": "src/components/Loader/Loader.tsx",
@@ -1,2 +1,2 @@
1
- import{L as r}from"../../Loader-084dd998.js";export{L as default}from"../../Loader-084dd998.js";import"../../_rollupPluginBabelHelpers-e1c7fe69.js";import"react";import"../../index-9b84fabc.js";import"./styles.module.scss";import"crypto";
1
+ import{L as e}from"../../Loader-9e099b42.js";export{L as default}from"../../Loader-9e099b42.js";import"../../_rollupPluginBabelHelpers-e1c7fe69.js";import"react";import"../../index-9b84fabc.js";import"../../uuid-484288be.js";import"./styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{M as s}from"../../Modal-52971fb1.js";export{M as default}from"../../Modal-52971fb1.js";import"react";import"../../index-9b84fabc.js";import"../../palette-f206f488.js";import"../../Button-619210b9.js";import"../../_rollupPluginBabelHelpers-e1c7fe69.js";import"../../_tslib-51c8a283.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../grid-11a70eb7.js";import"../../constants-d1f48e8e.js";import"../../Loader-084dd998.js";import"../Loader/styles.module.scss";import"crypto";import"../../useHover-57ad4df9.js";import"../../useWindowSize-c22d7634.js";import"../Button/styles.module.scss";import"../../AlertSignFill-64bfef57.js";import"./styles.module.scss";import"../../Title-863af332.js";import"../Title/styles.module.scss";
1
+ import{M as s}from"../../Modal-5c2defa7.js";export{M as default}from"../../Modal-5c2defa7.js";import"react";import"../../index-9b84fabc.js";import"../../uuid-484288be.js";import"../../palette-f206f488.js";import"../../Button-7200b617.js";import"../../_rollupPluginBabelHelpers-e1c7fe69.js";import"../../_tslib-51c8a283.js";import"../../color-acb834c6.js";import"../../index-19b48c51.js";import"../../grid-11a70eb7.js";import"../../constants-d1f48e8e.js";import"../../Loader-9e099b42.js";import"../Loader/styles.module.scss";import"../../useHover-57ad4df9.js";import"../../useWindowSize-c22d7634.js";import"../Button/styles.module.scss";import"../../AlertSignFill-64bfef57.js";import"./styles.module.scss";import"../../Title-863af332.js";import"../Title/styles.module.scss";
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { FormVariant } from '../FormGroup/FormGroup';
3
+ interface ValidationProps {
4
+ /** text placed in the legend tag of the fieldset */
5
+ errorSummary?: string;
6
+ /** Items in the ExpanderList */
7
+ children?: React.ReactNode;
8
+ /** Adds custom classes to the element. */
9
+ className?: string;
10
+ /** Changes the visuals of the formgroup */
11
+ variant?: FormVariant;
12
+ /** Sets the data-testid attribute. */
13
+ testId?: string;
14
+ }
15
+ export declare const Validation: React.ForwardRefExoticComponent<ValidationProps & React.RefAttributes<HTMLElement>>;
16
+ export default Validation;
17
+ //# sourceMappingURL=Validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Validation.d.ts","sourceRoot":"","sources":["../../../src/components/Validation/Validation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,UAAU,eAAe;IACvB,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,UAAU,qFAgBrB,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -0,0 +1,111 @@
1
+ {
2
+ "props": {
3
+ "errorSummary": {
4
+ "defaultValue": null,
5
+ "description": "text placed in the legend tag of the fieldset",
6
+ "name": "errorSummary",
7
+ "parent": {
8
+ "fileName": "src/components/Validation/Validation.tsx",
9
+ "name": "ValidationProps"
10
+ },
11
+ "declarations": [
12
+ {
13
+ "fileName": "src/components/Validation/Validation.tsx",
14
+ "name": "ValidationProps"
15
+ }
16
+ ],
17
+ "required": false,
18
+ "type": {
19
+ "name": "string"
20
+ }
21
+ },
22
+ "children": {
23
+ "defaultValue": null,
24
+ "description": "Items in the ExpanderList",
25
+ "name": "children",
26
+ "parent": {
27
+ "fileName": "src/components/Validation/Validation.tsx",
28
+ "name": "ValidationProps"
29
+ },
30
+ "declarations": [
31
+ {
32
+ "fileName": "src/components/Validation/Validation.tsx",
33
+ "name": "ValidationProps"
34
+ }
35
+ ],
36
+ "required": false,
37
+ "type": {
38
+ "name": "ReactNode"
39
+ }
40
+ },
41
+ "className": {
42
+ "defaultValue": null,
43
+ "description": "Adds custom classes to the element.",
44
+ "name": "className",
45
+ "parent": {
46
+ "fileName": "src/components/Validation/Validation.tsx",
47
+ "name": "ValidationProps"
48
+ },
49
+ "declarations": [
50
+ {
51
+ "fileName": "src/components/Validation/Validation.tsx",
52
+ "name": "ValidationProps"
53
+ }
54
+ ],
55
+ "required": false,
56
+ "type": {
57
+ "name": "string"
58
+ }
59
+ },
60
+ "variant": {
61
+ "defaultValue": null,
62
+ "description": "Changes the visuals of the formgroup",
63
+ "name": "variant",
64
+ "parent": {
65
+ "fileName": "src/components/Validation/Validation.tsx",
66
+ "name": "ValidationProps"
67
+ },
68
+ "declarations": [
69
+ {
70
+ "fileName": "src/components/Validation/Validation.tsx",
71
+ "name": "ValidationProps"
72
+ }
73
+ ],
74
+ "required": false,
75
+ "type": {
76
+ "name": "enum",
77
+ "raw": "\"normal\" | \"bigform\" | undefined",
78
+ "value": [
79
+ {
80
+ "value": "undefined"
81
+ },
82
+ {
83
+ "value": "\"normal\""
84
+ },
85
+ {
86
+ "value": "\"bigform\""
87
+ }
88
+ ]
89
+ }
90
+ },
91
+ "testId": {
92
+ "defaultValue": null,
93
+ "description": "Sets the data-testid attribute.",
94
+ "name": "testId",
95
+ "parent": {
96
+ "fileName": "src/components/Validation/Validation.tsx",
97
+ "name": "ValidationProps"
98
+ },
99
+ "declarations": [
100
+ {
101
+ "fileName": "src/components/Validation/Validation.tsx",
102
+ "name": "ValidationProps"
103
+ }
104
+ ],
105
+ "required": false,
106
+ "type": {
107
+ "name": "string"
108
+ }
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,3 @@
1
+ import Validation from './Validation';
2
+ export default Validation;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Validation/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,eAAe,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ import{V as e}from"../../Validation-e113da7e.js";export{V as default}from"../../Validation-e113da7e.js";import"../../_rollupPluginBabelHelpers-e1c7fe69.js";import"react";import"../../index-9b84fabc.js";import"./styles.module.scss";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ @import '../../scss/_spacers.scss';
2
+ @import '../../scss/_palette.scss';
3
+ @import '../../scss/font-settings.scss';
4
+
5
+ .validation {
6
+ &__errors {
7
+ font-size: $font-size-sm;
8
+ font-weight: 600;
9
+ color: $cherry500;
10
+
11
+ &--bigform {
12
+ margin-left: getSpacer(l);
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,10 @@
1
+ export type Styles = {
2
+ validation__errors: string;
3
+ 'validation__errors--bigform': string;
4
+ };
5
+
6
+ export type ClassNames = keyof Styles;
7
+
8
+ declare const styles: Styles;
9
+
10
+ export default styles;
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-beta79",
4
+ "version": "1.0.0-beta80",
5
5
  "description": "The official design system for Helsenorge built with React.",
6
6
  "repository": {
7
7
  "type": "tfs",
@@ -28,8 +28,7 @@
28
28
  "styled-components": "^5.0.0"
29
29
  },
30
30
  "dependencies": {
31
- "bootstrap": "4.4.1",
32
- "uuid": "8.3.2"
31
+ "bootstrap": "4.4.1"
33
32
  },
34
33
  "devDependencies": {
35
34
  "@babel/core": "^7.8.3",
@@ -57,7 +56,6 @@
57
56
  "@types/prettier": "1.19.0",
58
57
  "@types/styled-components": "5.0.1",
59
58
  "@types/testing-library__react": "^10.0.5",
60
- "@types/uuid": "8.3.1",
61
59
  "async": "^3.1.0",
62
60
  "babel-loader": "^8.0.6",
63
61
  "classnames": "^2.2.6",
@@ -76,6 +74,7 @@
76
74
  "react-docgen-typescript": "^1.22.0",
77
75
  "react-docgen-typescript-loader": "^3.3.0",
78
76
  "react-dom": "16.12.0",
77
+ "react-hook-form": "^6.15.8",
79
78
  "resolve-url-loader": "^3.1.1",
80
79
  "rimraf": "^3.0.2",
81
80
  "rollup": "^2.10.9",
@@ -67,6 +67,7 @@ $plum700: #5b22a6;
67
67
  $plum800: #4c1b8c;
68
68
  $plum900: #3c1471;
69
69
 
70
+ $inverted-hover: #ffffff0d;
70
71
  $transparentGrey: rgba(102, 102, 102, 0.75);
71
72
 
72
73
  $palette-map: (
@@ -0,0 +1,2 @@
1
+ export declare const uuid: () => string;
2
+ //# sourceMappingURL=uuid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/utils/uuid.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,cAMhB,CAAC"}
@@ -0,0 +1,2 @@
1
+ var x=function(){return"xxxxxxxx-xxxx-xxxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(x){var r=16*Math.random()|0;return("x"==x?r:3&r|8).toString(16)}))};export{x as u};
2
+ //# sourceMappingURL=uuid-484288be.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid-484288be.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button-619210b9.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import{a as e}from"./_rollupPluginBabelHelpers-e1c7fe69.js";import a from"react";import{c as r}from"./index-9b84fabc.js";import o from"./components/Loader/styles.module.scss";import l from"crypto";var t=new Uint8Array(256),d=t.length;function i(){return d>t.length-16&&(l.randomFillSync(t),d=0),t.slice(d,d+=16)}var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var s=[],m=0;m<256;++m)s.push((m+256).toString(16).substr(1));function c(e,a){void 0===a&&(a=0);var r=(s[e[a+0]]+s[e[a+1]]+s[e[a+2]]+s[e[a+3]]+"-"+s[e[a+4]]+s[e[a+5]]+"-"+s[e[a+6]]+s[e[a+7]]+"-"+s[e[a+8]]+s[e[a+9]]+"-"+s[e[a+10]]+s[e[a+11]]+s[e[a+12]]+s[e[a+13]]+s[e[a+14]]+s[e[a+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&n.test(e)}(r))throw TypeError("Stringified UUID is invalid");return r}function f(e,a,r){var o=(e=e||{}).random||(e.rng||i)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,a){r=r||0;for(var l=0;l<16;++l)a[r+l]=o[l];return a}return c(o)}var _=a.forwardRef((function(l,t){var d,i,n,s=l.color,m=void 0===s?"neutral":s,c=l.size,_=void 0===c?"small":c,u=l.className,v=void 0===u?"":u,p=l.testId,b=void 0===p?"":p,y=l.center,g=l.overlay,w=l.ariaLabelledById,h=l.ariaLabel,E=void 0===h?"Laster inn":h,N="small"===_,L="medium"===_,k="large"===_,x=r(o["loader-wrapper"],(e(d={},o["loader-wrapper--center"],y),e(d,o["loader-wrapper--overlay"],g),d)),I=r(o.loader,(e(i={},o["loader--small"],N),e(i,o["loader--medium"],L),e(i,o["loader--large"],k),i),v),S=r(o.loader__dot,(e(n={},o["loader__dot--small"],N),e(n,o["loader__dot--medium"],L),e(n,o["loader__dot--large"],k),e(n,o["loader__dot--banana"],"banana"===m),e(n,o["loader__dot--cherry"],"cherry"===m),e(n,o["loader__dot--kiwi"],"kiwi"===m),e(n,o["loader__dot--neutral"],"neutral"===m),e(n,o["loader__dot--plum"],"plum"===m),e(n,o["loader__dot--black"],"black"===m),e(n,o["loader__dot--white"],"white"===m),n)),U="loader".concat(f());return a.createElement("div",{role:"progressbar",className:x},a.createElement("div",{"data-testid":b,"aria-labelledby":w||U,className:I},a.createElement("div",{className:S}),a.createElement("div",{className:S}),a.createElement("div",{className:S}),a.createElement("div",{className:S}),!w&&a.createElement("span",{id:U,className:o["loader__hidden-text"]},E)))}));export{_ as L,f as v};
2
- //# sourceMappingURL=Loader-084dd998.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Loader-084dd998.js","sources":["../node_modules/uuid/dist/esm-node/rng.js","../node_modules/uuid/dist/esm-node/regex.js","../node_modules/uuid/dist/esm-node/stringify.js","../node_modules/uuid/dist/esm-node/validate.js","../node_modules/uuid/dist/esm-node/v4.js"],"sourcesContent":["import crypto from 'crypto';\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\nexport default function rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n crypto.randomFillSync(rnds8Pool);\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;"],"names":["const","rnds8Pool","Uint8Array","poolPtr","length","rng","crypto","randomFillSync","slice","byteToHex","i","push","toString","substr","stringify","arr","offset","uuid","toLowerCase","REGEX","test","validate","TypeError","v4","options","buf","rnds","random","let"],"mappings":"qMACAA,IAAMC,EAAY,IAAIC,WAAW,KAE7BC,EAAUF,EAAUG,OACT,SAASC,IAMtB,OALIF,EAAUF,EAAUG,OAAS,KAC/BE,EAAOC,eAAeN,GACtBE,EAAU,GAGLF,EAAUO,MAAML,EAASA,GAAW,ICV7C,MAAe,sHCQf,IAFAH,IAAMS,EAAY,GAETC,EAAI,EAAGA,EAAI,MAAOA,EACzBD,EAAUE,MAAMD,EAAI,KAAOE,SAAS,IAAIC,OAAO,IAGjD,SAASC,EAAUC,EAAKC,kBAAS,GAG/BhB,IAAMiB,GAAQR,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAM,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAM,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAM,IAAMP,EAAUM,EAAIC,EAAS,IAAMP,EAAUM,EAAIC,EAAS,IAAM,IAAMP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,KAAOP,EAAUM,EAAIC,EAAS,MAAME,cAM3f,ICnBF,SAAkBD,GAChB,MAAuB,iBAATA,GAAqBE,EAAMC,KAAKH,GDkBzCI,CAASJ,GACZ,MAAMK,UAAU,+BAGlB,OAAOL,EEtBT,SAASM,EAAGC,EAASC,EAAKT,GAExBhB,IAAM0B,GADNF,EAAUA,GAAW,IACAG,SAAWH,EAAQnB,KAAOA,KAK/C,GAHAqB,EAAK,GAAe,GAAVA,EAAK,GAAY,GAC3BA,EAAK,GAAe,GAAVA,EAAK,GAAY,IAEvBD,EAAK,CACPT,EAASA,GAAU,EAEnB,IAAKY,IAAIlB,EAAI,EAAGA,EAAI,KAAMA,EACxBe,EAAIT,EAASN,GAAKgB,EAAKhB,GAGzB,OAAOe,EAGT,OAAOX,EAAUY"}
package/Modal-52971fb1.js DELETED
@@ -1,2 +0,0 @@
1
- import e,{useRef as t,useEffect as a}from"react";import{c as n}from"./index-9b84fabc.js";import{p as r}from"./palette-f206f488.js";import{B as o}from"./Button-619210b9.js";import{I as l}from"./constants-d1f48e8e.js";import{X as c,A as i,a as s}from"./AlertSignFill-64bfef57.js";import m from"./components/Modal/styles.module.scss";import{T as d}from"./Title-863af332.js";import{v as u}from"./Loader-084dd998.js";function v(){var e=t(null);function n(t){var a=e.current.querySelectorAll('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select'),n=a[0],r=1===a.length?n:a[a.length-1];"Tab"===t.key&&(t.shiftKey?document.activeElement===n&&(r.focus(),t.preventDefault()):document.activeElement===r&&(n.focus(),t.preventDefault()))}function r(t){var a=e.current.querySelectorAll('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select');1===a.length&&(a[0].focus(),t.preventDefault())}return a((function(){var t=e.current;return t.addEventListener("keydown",n),t.addEventListener("click",r),function(){t.removeEventListener("keydown",n),t.removeEventListener("click",r)}}),[]),e}var p;!function(e){e.normal="normal",e.warning="warning",e.error="error",e.image="image"}(p||(p={}));var f={variant:p.normal,primaryButtonText:"OK",large:!1,className:""},y=function(t){return e.createElement("button",{className:m.modal__lukkekryss,"aria-label":t.ariaLabel||"Lukk",onClick:t.onClick,autoFocus:!0,role:"button"},e.createElement(l,{svgIcon:c,color:r.blueberry600,size:42}))},E=e.forwardRef((function(t,c){var f,E,g;function b(e){"Escape"===e.key&&t.onClose&&(e.stopPropagation(),t.onClose())}function _(e){e.target&&C.current===e.target&&t.onClose&&(e.stopPropagation(),t.onClose())}var k,h=t.variant===p.image,L=null!==(f=t.titleId)&&void 0!==f?f:u(),x=e.useRef(null),C=e.useRef(null),B=t.secondaryButtonText&&(null===(E=t.secondaryButtonText)||void 0===E?void 0:E.length)>0||t.onSuccess,N=t.ariaLabelledBy?void 0:t.ariaLabel,w=t.ariaLabelledBy?t.ariaLabelledBy:t.ariaLabel?void 0:L;return a((function(){var e=x.current,t=C.current;return document.body.style.overflow="hidden",e&&(e.addEventListener("keydown",b),t.addEventListener("click",_)),function(){document.body.style.removeProperty("overflow"),e.removeEventListener("keydown",b),t.removeEventListener("click",_)}})),e.createElement("div",{ref:x,"data-testid":"dialog-container"},e.createElement("div",{ref:C,className:m["modal-overlay"],"data-testid":t.testId},e.createElement("div",{className:m.align,ref:v()},e.createElement("div",{className:n(t.className,m.modal,m["modal--".concat(t.variant)],t.large?m["modal--large"]:""),role:"dialog","aria-label":N,"aria-labelledby":w},!t.noCloseButton&&e.createElement("div",{className:h?m["modal__close--image"]:m.modal__close},e.createElement(y,{onClick:t.onClose,ariaLabel:t.ariaLabelCloseBtn})),e.createElement("div",{className:h?m["modal__contentWrapper--image"]:m.modal__contentWrapper},e.createElement("div",{className:m.modal__contentWrapper__title},t.variant&&((k=t.variant)===p.error?e.createElement("div",null,e.createElement(l,{svgIcon:i,color:r.cherry500,hoverColor:r.cherry500})):k===p.warning?e.createElement("div",null,e.createElement(l,{svgIcon:s,color:r.black,hoverColor:r.black})):null),e.createElement("div",null,e.createElement(d,{id:L,htmlMarkup:"h3",appearance:"title3"},t.title))),e.createElement("div",{className:h?m["modal__contentWrapper__content--image"]:m.modal__contentWrapper__content},h?t.children&&e.createElement("div",null,e.createElement("div",{className:m["modal--image__img"]},t.children),e.createElement("span",{className:m["modal--image__text"]},t.description)):t.children&&e.createElement("div",null,t.children),t.description&&!t.children&&e.createElement("p",{className:m.modal__description},t.description)),B&&e.createElement("div",{className:m.modal__actions},t.onSuccess&&e.createElement(o,{onClick:t.onSuccess},t.primaryButtonText),t.secondaryButtonText&&(null===(g=t.secondaryButtonText)||void 0===g?void 0:g.length)>0&&e.createElement(o,{variant:"borderless",onClick:t.onClose},t.secondaryButtonText)))))))}));E.defaultProps=f;export{E as M};
2
- //# sourceMappingURL=Modal-52971fb1.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal-52971fb1.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}