@miljodirektoratet/md-css 0.0.21 → 1.0.0
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/package.json +1 -1
- package/src/accordionitem/accordionitem.css +47 -8
- package/src/formElements/multiselect/README.md +67 -0
- package/src/formElements/{multiselect.css → multiselect/multiselect.css} +0 -0
- package/src/formElements/select/README.md +52 -0
- package/src/formElements/{select.css → select/select.css} +0 -0
- package/src/formElements/textarea/README.md +41 -0
- package/src/formElements/{textarea.css → textarea/textarea.css} +0 -0
- package/src/index.css +3 -3
- package/src/infoTag/infoTag.css +2 -4
- /package/src/tabs/{REAMDE.md → README.md} +0 -0
package/package.json
CHANGED
|
@@ -1,20 +1,51 @@
|
|
|
1
1
|
.md-accordion-item {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
background-color: var(--mdPrimaryColor10);
|
|
3
|
+
border: 1px solid var(--mdGreyColor60);
|
|
4
4
|
color: var(--mdGreyColor);
|
|
5
5
|
font-family: 'Open sans';
|
|
6
6
|
margin-bottom: 1em;
|
|
7
|
+
transition: all .2s linear;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
.md-accordion-item:focus-within {
|
|
10
|
-
outline: 2px solid var(--mdPrimaryColor80);
|
|
11
|
-
outline-offset: -2px;
|
|
11
|
+
/* outline: 2px solid var(--mdPrimaryColor80);
|
|
12
|
+
outline-offset: -2px; */
|
|
13
|
+
outline: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.md-accordion-item.md-accordion-item--rounded {
|
|
17
|
+
border-radius: 4px;
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
.md-accordion-item.md-accordion-item--secondary {
|
|
15
21
|
background-color: var(--mdSecondaryColor60);
|
|
16
22
|
}
|
|
17
23
|
|
|
24
|
+
.md-accordion-item.md-accordion-item--add {
|
|
25
|
+
background-color: transparent;
|
|
26
|
+
border: 1px dashed var(--mdGreyColor80);
|
|
27
|
+
transition: all .2s linear;
|
|
28
|
+
}
|
|
29
|
+
.md-accordion-item--expanded.md-accordion-item--add {
|
|
30
|
+
background-color: var(--mdPrimaryColor20);
|
|
31
|
+
border: 1px solid var(--mdPrimaryColor20);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.md-accordion-item:not(.md-accordion-item--expanded):hover {
|
|
35
|
+
transition: all .2s linear;
|
|
36
|
+
background-color: var(--mdPrimaryColor20);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.md-accordion-item.md-accordion-item--secondary:not(.md-accordion-item--expanded):hover {
|
|
40
|
+
transition: all .2s linear;
|
|
41
|
+
background-color: var(--mdSecondaryColor);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.md-accordion-item.md-accordion-item--add:not(.md-accordion-item--expanded):hover {
|
|
45
|
+
transition: all .2s linear;
|
|
46
|
+
background-color: transparent;
|
|
47
|
+
}
|
|
48
|
+
|
|
18
49
|
/* Header */
|
|
19
50
|
.md-accordion-item__header {
|
|
20
51
|
display: flex;
|
|
@@ -24,9 +55,10 @@
|
|
|
24
55
|
border: 0;
|
|
25
56
|
width: 100%;
|
|
26
57
|
margin: 0;
|
|
27
|
-
padding:
|
|
58
|
+
padding: 1.5em 1.8em;
|
|
28
59
|
cursor: pointer;
|
|
29
60
|
text-align: left;
|
|
61
|
+
line-height: 24px;
|
|
30
62
|
}
|
|
31
63
|
|
|
32
64
|
.md-accordion-item__header:focus {
|
|
@@ -75,20 +107,23 @@
|
|
|
75
107
|
}
|
|
76
108
|
|
|
77
109
|
.md-accordion-item__header-label {
|
|
78
|
-
font-size:
|
|
110
|
+
font-size: 20px;
|
|
79
111
|
margin-left: 1em;
|
|
80
112
|
}
|
|
113
|
+
.md-accordion-item__header:hover .md-accordion-item__header-label {
|
|
114
|
+
text-decoration: underline;
|
|
115
|
+
}
|
|
81
116
|
|
|
82
117
|
/* CONTENT */
|
|
83
118
|
.md-accordion-item__content {
|
|
84
|
-
padding: 0
|
|
119
|
+
padding: 0 1.8em;
|
|
85
120
|
max-height: 0;
|
|
86
121
|
overflow: hidden;
|
|
87
122
|
transition: all .15s linear;
|
|
88
123
|
}
|
|
89
124
|
.md-accordion-item__content--expanded {
|
|
90
125
|
max-height: 5000px;
|
|
91
|
-
padding: 1em;
|
|
126
|
+
padding: 1em 1.8em 1.5em 1.8em;
|
|
92
127
|
transition: all .15s linear;
|
|
93
128
|
}
|
|
94
129
|
|
|
@@ -103,6 +138,10 @@
|
|
|
103
138
|
font-size: 16px;
|
|
104
139
|
}
|
|
105
140
|
|
|
141
|
+
.md-accordion-item__close-button:hover {
|
|
142
|
+
text-decoration: underline;
|
|
143
|
+
}
|
|
144
|
+
|
|
106
145
|
.md-accordion-item__close-button:focus {
|
|
107
146
|
outline: 2px solid var(--mdPrimaryColor80);
|
|
108
147
|
outline-offset: 2px;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Multiselect
|
|
2
|
+
|
|
3
|
+
To use the `Multiselect` css as a standalone, without the accompanying React component, please use the following HTML structure.
|
|
4
|
+
|
|
5
|
+
Class names in brackets [] are optional-/togglable-/decorator- or state dependant classes.
|
|
6
|
+
|
|
7
|
+
See [Storybook](https://miljodir.github.io/md-components) for examples and more info.
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<div className="md-select [md-multiselect--open, md-multiselect--disabled, md-multiselect--error, md-multiselect--medium, md-multiselect--small]">
|
|
11
|
+
<div className="md-multiselect__label">
|
|
12
|
+
<div>{label}</div>
|
|
13
|
+
|
|
14
|
+
<div className="md-multiselect__help-button">
|
|
15
|
+
<MdHelpButton/> <- see MdHelpButton styles
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div className="md-multiselect__help-text [md-multiselect__help-text--open]">
|
|
20
|
+
<MdHelpText>{ helpText }</MdHelpText> <- see MdHelpText styles
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<MdClickOutsideWrapper> <- optional wrapper to close selectbox when clicking outside
|
|
24
|
+
<button
|
|
25
|
+
className="md-multiselect__button [md-multiselect__button--open]"
|
|
26
|
+
tabIndex={0}
|
|
27
|
+
onClick={function to toggle expand|collapse}
|
|
28
|
+
>
|
|
29
|
+
<div className="md-multiselect__button-text">{displayValue}</div>
|
|
30
|
+
{number of selected items > 1 && !open &&
|
|
31
|
+
<div className="md-multiselect__button-hasmultiple">+{selected.length - 1}</div>
|
|
32
|
+
}
|
|
33
|
+
<div className="md-multiselect__button-icon">
|
|
34
|
+
<MdChevronIcon />
|
|
35
|
+
</div>
|
|
36
|
+
</button>
|
|
37
|
+
|
|
38
|
+
<div className="md-multiselect__dropdown [md-multiselect__dropdown--open]">
|
|
39
|
+
<div
|
|
40
|
+
className="md-multiselect__dropdown-item [md-multiselect__dropdown-item--selected]"
|
|
41
|
+
>
|
|
42
|
+
{IMPORTANT! see MdCheckbox styles for description for the individual checkboxes}
|
|
43
|
+
<MdCheckbox
|
|
44
|
+
label={option.text}
|
|
45
|
+
tabIndex={open ? 0 : -1}
|
|
46
|
+
checked={true|false}
|
|
47
|
+
value={option.value}
|
|
48
|
+
id="id-for-checkbox"
|
|
49
|
+
disabled={true|false}
|
|
50
|
+
data-value={option.value}
|
|
51
|
+
data-text={option.text}
|
|
52
|
+
onChange={function for change handling}
|
|
53
|
+
/>
|
|
54
|
+
...
|
|
55
|
+
...
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</MdClickOutsideWrapper>
|
|
59
|
+
|
|
60
|
+
<div className="md-multiselect__error">{errorText}</div>
|
|
61
|
+
|
|
62
|
+
<div className="md-multiselect__chips">
|
|
63
|
+
To show input chips for selected options, see doc for MdInputChip. These can be listed here.
|
|
64
|
+
</div>
|
|
65
|
+
}
|
|
66
|
+
</div>
|
|
67
|
+
```
|
|
File without changes
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
To use the `Select` css as a standalone, without the accompanying React component, please use the following HTML structure.
|
|
4
|
+
|
|
5
|
+
Class names in brackets [] are optional-/togglable-/decorator- or state dependant classes.
|
|
6
|
+
|
|
7
|
+
See [Storybook](https://miljodir.github.io/md-components) for examples and more info.
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<div className="md-select [md-select--open, md-select--disabled, md-select--medium, md-select--small]">
|
|
11
|
+
<div className="md-select__label">
|
|
12
|
+
<div>{label}</div>
|
|
13
|
+
<div className="md-select__help-button">
|
|
14
|
+
{button to trigger help text}
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div className="md-select__help-text [md-select__help-text--open]">
|
|
19
|
+
{helpText}
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<MdClickOutsideWrapper> <- optional wrapper to close selectbox when clicking outside
|
|
23
|
+
<button
|
|
24
|
+
className="md-select__button [md-select__button--open]"
|
|
25
|
+
tabIndex={0}
|
|
26
|
+
onClick={function to toggle expand|collapse}
|
|
27
|
+
>
|
|
28
|
+
<div className="md-select__button-text">{displayValue}</div>
|
|
29
|
+
<div className="md-select__button-icon">
|
|
30
|
+
<MdChevronIcon />
|
|
31
|
+
</div>
|
|
32
|
+
</button>
|
|
33
|
+
|
|
34
|
+
<div className="md-select__dropdown">
|
|
35
|
+
<button
|
|
36
|
+
tabIndex={open ? 0: -1}
|
|
37
|
+
className="md-select__dropdown-item [md-select__dropdown-item--selected]"
|
|
38
|
+
onClick={function to handle select|deselect option}
|
|
39
|
+
>
|
|
40
|
+
<div className="md-select__dropdown-item-text">{option.text}</div>
|
|
41
|
+
|
|
42
|
+
{if seleceted option
|
|
43
|
+
<div className="md-select__dropdown-item-clear" title="Klikk for å fjerne valg">
|
|
44
|
+
<MdXIcon />
|
|
45
|
+
</div>
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
</button>
|
|
49
|
+
</div>
|
|
50
|
+
</MdClickOutsideWrapper>
|
|
51
|
+
</div>
|
|
52
|
+
```
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Textarea
|
|
2
|
+
|
|
3
|
+
To use the `Textarea` css as a standalone, without the accompanying React component, please use the following HTML structure.
|
|
4
|
+
|
|
5
|
+
Class names in brackets [] are optional-/togglable-/decorator- or state dependant classes.
|
|
6
|
+
|
|
7
|
+
See [Storybook](https://miljodir.github.io/md-components) for examples and more info.
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<div className="md-textarea__outer-wrapper">
|
|
11
|
+
<div className="md-textarea__label">
|
|
12
|
+
<label htmlFor="id-for-text-area">
|
|
13
|
+
{label}
|
|
14
|
+
</label>
|
|
15
|
+
|
|
16
|
+
<div className="md-textarea__help-button">
|
|
17
|
+
{button to trigger help text}
|
|
18
|
+
</div>
|
|
19
|
+
}
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div className="md-textarea__help-text [md-textarea__help-text--open]">
|
|
23
|
+
{helpText}
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div className="md-textarea__wrapper">
|
|
27
|
+
<textarea
|
|
28
|
+
id="id-for-text-area"
|
|
29
|
+
className="md-textarea [md-textarea--disabled, md-textarea--readonly, md-textarea--error]"
|
|
30
|
+
value={value}
|
|
31
|
+
rows={number}
|
|
32
|
+
placeholder="Placeholder text"
|
|
33
|
+
disabled={true requires class 'md-textarea--disabled'}
|
|
34
|
+
readOnly={true requires class 'md-textarea--readonly'}
|
|
35
|
+
...
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div className="md-textarea__error">{errorText}</div>
|
|
40
|
+
</div>
|
|
41
|
+
```
|
|
File without changes
|
package/src/index.css
CHANGED
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
@import './formElements/input/input.css';
|
|
17
17
|
@import './formElements/checkbox/checkbox.css';
|
|
18
18
|
@import './formElements/checkboxgroup/checkboxgroup.css';
|
|
19
|
-
@import './formElements/textarea.css';
|
|
20
|
-
@import './formElements/select.css';
|
|
19
|
+
@import './formElements/textarea/textarea.css';
|
|
20
|
+
@import './formElements/select/select.css';
|
|
21
21
|
@import './formElements/radiogroup.css';
|
|
22
|
-
@import './formElements/multiselect.css';
|
|
22
|
+
@import './formElements/multiselect/multiselect.css';
|
|
23
23
|
@import './formElements/fileupload/fileupload.css';
|
|
24
24
|
@import './utils.css';
|
|
25
25
|
|
package/src/infoTag/infoTag.css
CHANGED
|
@@ -8,10 +8,6 @@
|
|
|
8
8
|
padding: 4px 12px 4px 12px;
|
|
9
9
|
border-radius: 4px;
|
|
10
10
|
font-family: 'Open Sans';
|
|
11
|
-
font-size: .88em;
|
|
12
|
-
font-weight: 400;
|
|
13
|
-
line-height: 18px;
|
|
14
|
-
letter-spacing: 0em;
|
|
15
11
|
text-align: left;
|
|
16
12
|
white-space: nowrap;
|
|
17
13
|
overflow: hidden;
|
|
@@ -33,6 +29,8 @@
|
|
|
33
29
|
display: flex;
|
|
34
30
|
align-self: flex-start;
|
|
35
31
|
margin-right: 12px;
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
line-height: 18px;
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
.md-info-tag__icon {
|
|
File without changes
|