@navikt/ds-css 0.12.5 → 0.12.9

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,220 @@
1
+ :root {
2
+ --navds-switch-color-label: var(--navds-semantic-color-text);
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-feedback-success-border
9
+ );
10
+ --navds-switch-color-track-background-hover: var(
11
+ --navds-global-color-gray-800
12
+ );
13
+ --navds-switch-color-track-background-hover-checked: var(
14
+ --navds-semantic-color-feedback-success-icon
15
+ );
16
+ --navds-switch-color-track-shadow-inner-focus: var(
17
+ --navds-semantic-color-component-background-light
18
+ );
19
+ --navds-switch-color-thumb: var(
20
+ --navds-semantic-color-component-background-light
21
+ );
22
+ --navds-switch-color-thumb-icon: var(--navds-semantic-color-text-muted);
23
+ --navds-switch-color-thumb-icon-checked: var(
24
+ --navds-semantic-color-feedback-success-border
25
+ );
26
+ --navds-switch-color-thumb-loader-checked: var(
27
+ --navds-semantic-color-feedback-success-border
28
+ );
29
+ }
30
+
31
+ .navds-switch {
32
+ position: relative;
33
+ min-height: 48px;
34
+ width: fit-content;
35
+ }
36
+
37
+ .navds-switch--right {
38
+ width: auto;
39
+ }
40
+
41
+ .navds-switch--small {
42
+ position: relative;
43
+ min-height: 32px;
44
+ }
45
+
46
+ /* Input */
47
+ .navds-switch__input {
48
+ cursor: pointer;
49
+ position: absolute;
50
+ z-index: 1;
51
+ width: 48px;
52
+ height: 48px;
53
+ opacity: 0;
54
+ top: 0;
55
+ }
56
+
57
+ .navds-switch--small > .navds-switch__input {
58
+ height: 32px;
59
+ top: 0;
60
+ }
61
+
62
+ /* Label */
63
+ .navds-switch__label-wrapper {
64
+ cursor: pointer;
65
+ color: var(--navds-switch-color-label);
66
+ }
67
+
68
+ .navds-switch__content {
69
+ display: flex;
70
+ flex-direction: column;
71
+ gap: var(--navds-spacing-1);
72
+ padding: 0.75rem 0 0.75rem 3.25rem;
73
+ }
74
+
75
+ .navds-switch--right > .navds-switch__label-wrapper > .navds-switch__content {
76
+ padding: 0.75rem 3.25rem 0.75rem 0;
77
+ }
78
+
79
+ .navds-switch--small > .navds-switch__label-wrapper > .navds-switch__content {
80
+ padding: calc(var(--navds-spacing-2) - 2px) 0
81
+ calc(var(--navds-spacing-2) - 2px) 3.25rem;
82
+ }
83
+
84
+ .navds-switch--right.navds-switch--small
85
+ > .navds-switch__label-wrapper
86
+ > .navds-switch__content {
87
+ padding: calc(var(--navds-spacing-2) - 2px) 3.25rem
88
+ calc(var(--navds-spacing-2) - 2px) 0;
89
+ }
90
+
91
+ .navds-switch--with-description,
92
+ .navds-switch--small
93
+ > .navds-switch__label-wrapper
94
+ > .navds-switch--with-description {
95
+ padding-bottom: 0;
96
+ }
97
+
98
+ .navds-switch__input:hover ~ .navds-switch__label-wrapper,
99
+ .navds-switch__label-wrapper:hover {
100
+ color: var(--navds-switch-color-label-hover);
101
+ }
102
+
103
+ .navds-switch__input:disabled:hover ~ .navds-switch__label-wrapper {
104
+ color: inherit;
105
+ }
106
+
107
+ /* Track */
108
+ .navds-switch__track {
109
+ width: 44px;
110
+ height: 24px;
111
+ background-color: var(--navds-switch-color-track-background);
112
+ position: absolute;
113
+ top: var(--navds-spacing-3);
114
+ left: 0;
115
+ border-radius: 4px;
116
+ transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
117
+ }
118
+
119
+ .navds-switch--small > .navds-switch__track {
120
+ top: var(--navds-spacing-1);
121
+ }
122
+
123
+ .navds-switch--right > .navds-switch__input,
124
+ .navds-switch--right > .navds-switch__track {
125
+ right: 0;
126
+ left: auto;
127
+ }
128
+
129
+ .navds-switch__input:checked ~ .navds-switch__track {
130
+ background-color: var(--navds-switch-color-track-background-checked);
131
+ }
132
+
133
+ .navds-switch__input:hover ~ .navds-switch__track {
134
+ background-color: var(--navds-switch-color-track-background-hover);
135
+ }
136
+
137
+ .navds-switch__input:hover:checked ~ .navds-switch__track {
138
+ background-color: var(--navds-switch-color-track-background-hover-checked);
139
+ }
140
+
141
+ .navds-switch__input:disabled ~ .navds-switch__track {
142
+ background-color: var(--navds-switch-color-track-background);
143
+ }
144
+
145
+ .navds-switch__input:checked:disabled ~ .navds-switch__track {
146
+ background-color: var(--navds-switch-color-track-background-checked);
147
+ }
148
+
149
+ .navds-switch__input:focus ~ .navds-switch__track {
150
+ box-shadow: 0 0 0 1px var(--navds-switch-color-track-shadow-inner-focus),
151
+ var(--navds-shadow-focus);
152
+ }
153
+
154
+ /* Thumb */
155
+ .navds-switch__thumb {
156
+ background-color: var(--navds-switch-color-thumb);
157
+ color: var(--navds-switch-color-thumb-icon);
158
+ border-radius: 2.5px;
159
+ width: 20px;
160
+ height: 20px;
161
+ position: absolute;
162
+ transform: translateX(0);
163
+ left: 2px;
164
+ top: 2px;
165
+ transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
166
+ display: flex;
167
+ align-items: center;
168
+ justify-content: center;
169
+ }
170
+
171
+ .navds-switch__input:checked ~ .navds-switch__track > .navds-switch__thumb {
172
+ transform: translateX(20px);
173
+ color: var(--navds-switch-color-thumb-icon-checked);
174
+ }
175
+
176
+ @media (hover: hover) and (pointer: fine) {
177
+ .navds-switch__input:hover ~ .navds-switch__track > .navds-switch__thumb {
178
+ transform: translateX(2px);
179
+ }
180
+
181
+ .navds-switch__input:checked:hover
182
+ ~ .navds-switch__track
183
+ > .navds-switch__thumb {
184
+ transform: translateX(18px);
185
+ }
186
+ }
187
+
188
+ .navds-switch__input:disabled:hover
189
+ ~ .navds-switch__track
190
+ > .navds-switch__thumb {
191
+ transform: translateX(0);
192
+ }
193
+
194
+ .navds-switch__input:checked:disabled:hover
195
+ ~ .navds-switch__track
196
+ > .navds-switch__thumb {
197
+ transform: translateX(20px);
198
+ }
199
+
200
+ /* Loader */
201
+ .navds-switch__input:checked
202
+ ~ .navds-switch__track
203
+ > .navds-switch__thumb
204
+ .navds-loader__foreground {
205
+ stroke: var(--navds-switch-color-thumb-loader-checked);
206
+ }
207
+
208
+ /* Disabled */
209
+ .navds-switch__input:disabled {
210
+ appearance: none;
211
+ }
212
+
213
+ .navds-switch--disabled {
214
+ opacity: 0.3;
215
+ }
216
+
217
+ .navds-switch__input:disabled,
218
+ .navds-switch__input:disabled ~ .navds-switch__label-wrapper {
219
+ cursor: not-allowed;
220
+ }
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.5",
3
+ "version": "0.12.9",
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": "ab038205919b0d5509f8bf8025a2ff735ef28e15"
30
+ "gitHead": "d9359d1a862061125816b15efa464a8da14639cb"
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
+ }