@utrecht/form-field-description-css 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +3 -2
- package/src/story-template.jsx +0 -63
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.0.
|
|
2
|
+
"version": "3.0.1",
|
|
3
3
|
"author": "Community for NL Design System",
|
|
4
4
|
"description": "Form field description component for the Municipality of Utrecht based on the NL Design System architecture",
|
|
5
5
|
"license": "EUPL-1.2",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"nl-design-system"
|
|
19
19
|
],
|
|
20
20
|
"publishConfig": {
|
|
21
|
-
"access": "public"
|
|
21
|
+
"access": "public",
|
|
22
|
+
"provenance": true
|
|
22
23
|
},
|
|
23
24
|
"repository": {
|
|
24
25
|
"type": "git+ssh",
|
package/src/story-template.jsx
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license EUPL-1.2
|
|
3
|
-
* Copyright (c) 2020-2024 Frameless B.V.
|
|
4
|
-
* Copyright (c) 2021-2024 Gemeente Utrecht
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import clsx from 'clsx';
|
|
8
|
-
import parse from 'html-react-parser';
|
|
9
|
-
import React from 'react';
|
|
10
|
-
|
|
11
|
-
export const argTypes = {
|
|
12
|
-
id: {
|
|
13
|
-
description: 'Unique identifier to associate it with a form input',
|
|
14
|
-
control: 'text',
|
|
15
|
-
},
|
|
16
|
-
innerHTML: {
|
|
17
|
-
description: 'Set the content of the description',
|
|
18
|
-
control: 'text',
|
|
19
|
-
},
|
|
20
|
-
status: {
|
|
21
|
-
type: {
|
|
22
|
-
name: 'enum',
|
|
23
|
-
required: false,
|
|
24
|
-
},
|
|
25
|
-
description: 'Status',
|
|
26
|
-
options: ['', 'invalid', 'valid'],
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const defaultArgs = {
|
|
31
|
-
id: null,
|
|
32
|
-
innerHTML: '',
|
|
33
|
-
status: '',
|
|
34
|
-
distanced: false,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const exampleArgs = {};
|
|
38
|
-
|
|
39
|
-
export const FormFieldDescription = ({
|
|
40
|
-
id = defaultArgs.id,
|
|
41
|
-
innerHTML = defaultArgs.innerHTML,
|
|
42
|
-
status = defaultArgs.status,
|
|
43
|
-
distanced = defaultArgs.distanced,
|
|
44
|
-
className,
|
|
45
|
-
children,
|
|
46
|
-
}) => (
|
|
47
|
-
<div
|
|
48
|
-
id={id}
|
|
49
|
-
className={clsx(
|
|
50
|
-
'utrecht-form-field-description',
|
|
51
|
-
distanced && 'utrecht-form-field-description--distanced',
|
|
52
|
-
status === 'invalid' && 'utrecht-form-field-description--invalid',
|
|
53
|
-
status === 'valid' && 'utrecht-form-field-description--valid',
|
|
54
|
-
status === 'warning' && 'utrecht-form-field-description--warning',
|
|
55
|
-
className,
|
|
56
|
-
)}
|
|
57
|
-
>
|
|
58
|
-
{children}
|
|
59
|
-
{parse(innerHTML)}
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
export default FormFieldDescription;
|