@navikt/ds-css 0.12.4 → 0.12.8

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/form/index.css CHANGED
@@ -8,6 +8,7 @@
8
8
  @import "error-message.css";
9
9
  @import "radio-checkbox.css";
10
10
  @import "select.css";
11
+ @import "switch.css";
11
12
  @import "text-field.css";
12
13
  @import "textarea.css";
13
14
  @import "search-field.css";
package/form/select.css CHANGED
@@ -21,7 +21,6 @@
21
21
 
22
22
  .navds-select__input {
23
23
  appearance: none;
24
- padding: 0.5rem;
25
24
  background-color: var(--navds-select-color-background);
26
25
  border-radius: 4px;
27
26
  border: 1px solid var(--navds-select-color-border);
@@ -30,6 +29,7 @@
30
29
  min-height: 48px;
31
30
  display: inline-block;
32
31
  position: relative;
32
+ padding: 0.5rem;
33
33
  padding-right: 2.5rem;
34
34
  }
35
35
 
@@ -59,6 +59,7 @@
59
59
  .navds-form-field--small .navds-select__input {
60
60
  min-height: 32px;
61
61
  padding: 0.25rem;
62
+ padding-right: 2rem;
62
63
  }
63
64
 
64
65
  /**
@@ -0,0 +1,183 @@
1
+ :root {
2
+ --navds-switch-color-label: var(--navds-color-text-primary);
3
+ --navds-switch-color-label-hover: var(
4
+ --navds-semantic-color-interaction-primary
5
+ );
6
+ --navds-switch-color-track-background: var(--navds-semantic-color-text-muted);
7
+ --navds-switch-color-track-background-checked: var(
8
+ --navds-semantic-color-interaction-primary
9
+ );
10
+ --navds-switch-color-track-background-hover-checked: var(
11
+ --navds-semantic-color-interaction-primary-hover
12
+ );
13
+ --navds-switch-color-track-shadow-inner-focus: var(
14
+ --navds-semantic-color-component-background-light
15
+ );
16
+ --navds-switch-color-thumb: var(
17
+ --navds-semantic-color-component-background-light
18
+ );
19
+ --navds-switch-color-thumb-loader-checked: var(
20
+ --navds-semantic-color-interaction-primary
21
+ );
22
+ }
23
+
24
+ .navds-switch {
25
+ position: relative;
26
+ min-height: 48px;
27
+ width: fit-content;
28
+ }
29
+
30
+ .navds-switch--small {
31
+ position: relative;
32
+ min-height: 32px;
33
+ }
34
+
35
+ /* Input */
36
+ .navds-switch__input {
37
+ cursor: pointer;
38
+ position: absolute;
39
+ z-index: 1;
40
+ width: 48px;
41
+ height: 48px;
42
+ opacity: 0;
43
+ top: 0;
44
+ }
45
+
46
+ .navds-switch--small > .navds-switch__input {
47
+ height: 32px;
48
+ top: 0;
49
+ }
50
+
51
+ /* Label */
52
+ .navds-switch__label-wrapper {
53
+ cursor: pointer;
54
+ color: var(--navds-switch-color-label);
55
+ }
56
+
57
+ .navds-switch__content {
58
+ display: flex;
59
+ flex-direction: column;
60
+ gap: var(--navds-spacing-1);
61
+ padding: 0.75rem 0 0.75rem 3.25rem;
62
+ }
63
+
64
+ .navds-switch--small > .navds-switch__label-wrapper > .navds-switch__content {
65
+ padding: calc(var(--navds-spacing-2) - 2px) 0
66
+ calc(var(--navds-spacing-2) - 2px) 3.25rem;
67
+ }
68
+
69
+ .navds-switch--with-description,
70
+ .navds-switch--small
71
+ > .navds-switch__label-wrapper
72
+ > .navds-switch--with-description {
73
+ padding-bottom: 0;
74
+ }
75
+
76
+ .navds-switch__input:hover ~ .navds-switch__label-wrapper {
77
+ color: var(--navds-switch-color-label-hover);
78
+ }
79
+
80
+ .navds-switch__input:disabled:hover ~ .navds-switch__label-wrapper {
81
+ color: inherit;
82
+ }
83
+
84
+ /* Track */
85
+ .navds-switch__track {
86
+ width: 44px;
87
+ height: 24px;
88
+ background-color: var(--navds-switch-color-track-background);
89
+ position: absolute;
90
+ top: var(--navds-spacing-3);
91
+ left: 0;
92
+ border-radius: var(--navds-spacing-4);
93
+ transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
94
+ }
95
+
96
+ .navds-switch--small > .navds-switch__track {
97
+ top: var(--navds-spacing-1);
98
+ }
99
+
100
+ .navds-switch__input:checked ~ .navds-switch__track {
101
+ background-color: var(--navds-switch-color-track-background-checked);
102
+ }
103
+
104
+ .navds-switch__input:hover:checked ~ .navds-switch__track {
105
+ background-color: var(--navds-switch-color-track-background-hover-checked);
106
+ }
107
+
108
+ .navds-switch__input:disabled ~ .navds-switch__track {
109
+ background-color: var(--navds-switch-color-track-background);
110
+ }
111
+
112
+ .navds-switch__input:checked:disabled ~ .navds-switch__track {
113
+ background-color: var(--navds-switch-color-track-background-checked);
114
+ }
115
+
116
+ .navds-switch__input:focus ~ .navds-switch__track {
117
+ box-shadow: 0 0 0 1px var(--navds-switch-color-track-shadow-inner-focus),
118
+ var(--navds-shadow-focus);
119
+ }
120
+
121
+ /* Thumb */
122
+ .navds-switch__thumb {
123
+ background-color: var(--navds-switch-color-thumb);
124
+ border-radius: 50%;
125
+ width: 20px;
126
+ height: 20px;
127
+ position: absolute;
128
+ transform: translateX(0);
129
+ left: 2px;
130
+ top: 2px;
131
+ transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
132
+ display: flex;
133
+ align-items: center;
134
+ justify-content: center;
135
+ }
136
+
137
+ .navds-switch__input:checked ~ .navds-switch__track > .navds-switch__thumb {
138
+ transform: translateX(20px);
139
+ }
140
+
141
+ .navds-switch__input:hover ~ .navds-switch__track > .navds-switch__thumb {
142
+ transform: translateX(2px);
143
+ }
144
+
145
+ .navds-switch__input:checked:hover
146
+ ~ .navds-switch__track
147
+ > .navds-switch__thumb {
148
+ transform: translateX(18px);
149
+ }
150
+
151
+ .navds-switch__input:disabled:hover
152
+ ~ .navds-switch__track
153
+ > .navds-switch__thumb {
154
+ transform: translateX(0);
155
+ }
156
+
157
+ .navds-switch__input:checked:disabled:hover
158
+ ~ .navds-switch__track
159
+ > .navds-switch__thumb {
160
+ transform: translateX(20px);
161
+ }
162
+
163
+ /* Loader */
164
+ .navds-switch__input:checked
165
+ ~ .navds-switch__track
166
+ > .navds-switch__thumb
167
+ .navds-loader__foreground {
168
+ stroke: var(--navds-switch-color-thumb-loader-checked);
169
+ }
170
+
171
+ /* Disabled */
172
+ .navds-switch__input:disabled {
173
+ appearance: none;
174
+ }
175
+
176
+ .navds-switch--disabled {
177
+ opacity: 0.3;
178
+ }
179
+
180
+ .navds-switch__input:disabled,
181
+ .navds-switch__input:disabled ~ .navds-switch__label-wrapper {
182
+ cursor: not-allowed;
183
+ }
package/index.css CHANGED
@@ -18,6 +18,7 @@
18
18
  @import "panel.css";
19
19
  @import "link-panel.css";
20
20
  @import "speech-bubble.css";
21
+ @import "step-indicator.css";
21
22
  @import "table.css";
22
23
 
23
24
  /* Navno spesific packages */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/ds-css",
3
- "version": "0.12.4",
3
+ "version": "0.12.8",
4
4
  "private": false,
5
5
  "description": "Css for NAV Designsystem components",
6
6
  "author": "NAV Designsystem team",
@@ -21,11 +21,11 @@
21
21
  "watch": "postcss --watch --use postcss-import -o dist/index.css index.css"
22
22
  },
23
23
  "devDependencies": {
24
- "@navikt/ds-tokens": "^0.7.0",
24
+ "@navikt/ds-tokens": "^0.7.1",
25
25
  "normalize.css": "^8.0.1",
26
26
  "postcss": "^8.3.6",
27
27
  "postcss-cli": "^8.3.1",
28
28
  "postcss-import": "^14.0.2"
29
29
  },
30
- "gitHead": "99ed25a0b4d8ed777223aa55890dc995f220a36f"
30
+ "gitHead": "3db81c9b79f8be93cb23f996002d0cbb38ca2348"
31
31
  }
@@ -0,0 +1,202 @@
1
+ :root {
2
+ --navds-step-indicator-color-step-line: var(--navds-semantic-color-divider);
3
+ --navds-step-indicator-color-step-text: var(--navds-semantic-color-text);
4
+ --navds-step-indicator-color-step-label: var(
5
+ --navds-semantic-color-interaction-primary
6
+ );
7
+ --navds-step-indicator-color-step-number-background: var(
8
+ --navds-semantic-color-canvas-background-light
9
+ );
10
+ --navds-step-indicator-color-step-number-background-finished: var(
11
+ --navds-semantic-color-canvas-background
12
+ );
13
+ --navds-step-indicator-color-step-number-shadow: var(
14
+ --navds-semantic-color-border
15
+ );
16
+ --navds-step-indicator-color-step-number-shadow-active: var(
17
+ --navds-semantic-color-interaction-primary-selected
18
+ );
19
+ --navds-step-indicator-color-step-number-shadow-hover: var(
20
+ --navds-semantic-color-interaction-primary
21
+ );
22
+ --navds-step-indicator-color-step-number-background-active: var(
23
+ --navds-semantic-color-interaction-primary-selected
24
+ );
25
+ --navds-step-indicator-color-step-number-text-active: var(
26
+ --navds-semantic-color-text-inverted
27
+ );
28
+ --navds-step-indicator-color-step-number-shadow-inset: var(
29
+ --navds-semantic-color-component-background-light
30
+ );
31
+ }
32
+
33
+ /* StepIndicator */
34
+ .navds-step-indicator {
35
+ display: flex;
36
+ align-items: flex-start;
37
+ padding: 0;
38
+ margin: 0;
39
+ }
40
+
41
+ /* Step */
42
+ .navds-step-indicator__step-wrapper {
43
+ padding: 0 var(--navds-spacing-2);
44
+ flex: 1;
45
+ position: relative;
46
+ list-style: none;
47
+ min-width: 10rem;
48
+ }
49
+
50
+ .navds-step-indicator__step-wrapper--hidelabel {
51
+ min-width: 5rem;
52
+ }
53
+
54
+ .navds-step-indicator__step {
55
+ display: flex;
56
+ align-items: center;
57
+ flex-direction: column;
58
+ padding: 0;
59
+ background: none;
60
+ border: none;
61
+ appearance: none;
62
+ width: 100%;
63
+ flex-shrink: 1;
64
+ color: var(--navds-step-indicator-color-step-text);
65
+ text-decoration: none;
66
+ cursor: pointer;
67
+ }
68
+
69
+ .navds-step-indicator__step-number {
70
+ flex-shrink: 0;
71
+ display: flex;
72
+ width: 2rem;
73
+ height: 2rem;
74
+ margin: 0.5rem;
75
+ border-radius: 50%;
76
+ align-items: center;
77
+ justify-content: center;
78
+ box-shadow: 0 0 0 1px var(--navds-step-indicator-color-step-number-shadow);
79
+ background-color: var(--navds-step-indicator-color-step-number-background);
80
+ }
81
+
82
+ .navds-step-indicator__step-wrapper:first-child
83
+ > .navds-step-indicator__step
84
+ > .navds-step-indicator__step-number {
85
+ padding-right: 0;
86
+ }
87
+
88
+ .navds-step-indicator__step-wrapper:last-child
89
+ > .navds-step-indicator__step
90
+ > .navds-step-indicator__step-number {
91
+ padding-left: 0;
92
+ }
93
+
94
+ .navds-step-indicator__step-label {
95
+ width: 100%;
96
+ margin-top: var(--navds-spacing-4);
97
+ text-align: center;
98
+ color: var(--navds-step-indicator-color-step-label);
99
+ text-decoration: underline;
100
+ }
101
+
102
+ .navds-step-indicator__step-line {
103
+ flex: 1 1 100%;
104
+ position: absolute;
105
+ top: 1.5rem;
106
+ right: calc(50% + 2rem);
107
+ left: calc(-50% + 2rem);
108
+ display: block;
109
+ border-top: 2px solid var(--navds-step-indicator-color-step-line);
110
+ border-radius: 4px;
111
+ pointer-events: none;
112
+ }
113
+
114
+ .navds-step-indicator__step--active > .navds-step-indicator__step-label {
115
+ color: var(--navds-step-indicator-color-step-text);
116
+ font-weight: bold;
117
+ }
118
+
119
+ .navds-step-indicator__step--active > .navds-step-indicator__step-number {
120
+ background-color: var(
121
+ --navds-step-indicator-color-step-number-background-active
122
+ );
123
+ color: var(--navds-step-indicator-color-step-number-text-active);
124
+ box-shadow: 0 0 0 1px
125
+ var(--navds-step-indicator-color-step-number-shadow-active);
126
+ width: 2.5rem;
127
+ height: 2.5rem;
128
+ margin: 0.25rem;
129
+ }
130
+
131
+ .navds-step-indicator__step:focus {
132
+ outline: none;
133
+ }
134
+
135
+ .navds-step-indicator__step:hover > .navds-step-indicator__step-label {
136
+ text-decoration: none;
137
+ }
138
+
139
+ .navds-step-indicator__step.navds-step-indicator__step--disabled:hover
140
+ > .navds-step-indicator__step-label {
141
+ text-decoration: underline;
142
+ }
143
+
144
+ .navds-step-indicator__step--active > .navds-step-indicator__step-label,
145
+ .navds-step-indicator__step--active.navds-step-indicator__step--disabled:hover
146
+ > .navds-step-indicator__step-label {
147
+ text-decoration: none;
148
+ }
149
+
150
+ .navds-step-indicator__step:hover > .navds-step-indicator__step-number {
151
+ background: var(--navds-step-indicator-color-step-number-background);
152
+ box-shadow: 0 0 0 2px
153
+ var(--navds-step-indicator-color-step-number-shadow-hover);
154
+ }
155
+
156
+ .navds-step-indicator__step--active:hover > .navds-step-indicator__step-number {
157
+ background-color: var(
158
+ --navds-step-indicator-color-step-number-background-active
159
+ );
160
+ color: var(--navds-step-indicator-color-step-number-text-active);
161
+ box-shadow: 0 0 0 1px
162
+ var(--navds-step-indicator-color-step-number-shadow-active);
163
+ }
164
+
165
+ .navds-step-indicator__step:focus > .navds-step-indicator__step-number {
166
+ box-shadow: var(--navds-shadow-focus);
167
+ outline: none;
168
+ }
169
+
170
+ .navds-step-indicator__step--active:focus > .navds-step-indicator__step-number {
171
+ box-shadow: 0 0 0 1px inset
172
+ var(--navds-step-indicator-color-step-number-shadow-inset),
173
+ var(--navds-shadow-focus);
174
+ }
175
+
176
+ .navds-step-indicator__step--disabled:hover
177
+ > .navds-step-indicator__step-number {
178
+ box-shadow: 0 0 0 1px var(--navds-step-indicator-color-step-number-shadow);
179
+ }
180
+
181
+ .navds-step-indicator__step--disabled.navds-step-indicator__step--active:disabled
182
+ > .navds-step-indicator__step-number {
183
+ box-shadow: 0 0 0 1px
184
+ var(--navds-step-indicator-color-step-number-shadow-active);
185
+ }
186
+
187
+ /* Finished state */
188
+ .navds-step-indicator__step--finished > .navds-step-indicator__step-number,
189
+ .navds-step-indicator__step--finished.navds-step-indicator__step--disabled
190
+ > .navds-step-indicator__step-number {
191
+ background: var(--navds-step-indicator-color-step-number-background-finished);
192
+ }
193
+
194
+ /* Disabled */
195
+ .navds-step-indicator__step--disabled > .navds-step-indicator__step-number,
196
+ .navds-step-indicator__step--disabled > .navds-step-indicator__step-label {
197
+ opacity: 0.3;
198
+ }
199
+
200
+ .navds-step-indicator__step--disabled {
201
+ cursor: not-allowed;
202
+ }
package/table.css CHANGED
@@ -47,7 +47,7 @@
47
47
 
48
48
  .navds-table--zebra-stripes
49
49
  .navds-table__body
50
- .navds-table__row:nth-of-type(odd):not(:hover) {
50
+ .navds-table__row:nth-of-type(odd):not(:hover):not(.navds-table__row--selected) {
51
51
  background-color: var(--navds-table-row-color-background-zebra);
52
52
  }
53
53