@navikt/ds-css 8.2.2 → 8.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/ds-css",
3
- "version": "8.2.2",
3
+ "version": "8.4.0",
4
4
  "description": "CSS for Nav Designsystem",
5
5
  "author": "Aksel | Nav designsystem team",
6
6
  "keywords": [
@@ -30,9 +30,9 @@
30
30
  "css:get-version": "node config/get-version.js"
31
31
  },
32
32
  "devDependencies": {
33
- "@navikt/ds-tokens": "^8.2.2",
33
+ "@navikt/ds-tokens": "^8.4.0",
34
34
  "browserslist": "^4.25.0",
35
- "esbuild": "^0.25.11",
35
+ "esbuild": "^0.27.2",
36
36
  "fast-glob": "3.3.3",
37
37
  "lightningcss": "^1.30.1",
38
38
  "normalize.css": "^8.0.1",
@@ -4,31 +4,16 @@
4
4
  border-radius: var(--ax-radius-12);
5
5
  border: 1px solid var(--ax-border-neutral-subtleA);
6
6
  box-shadow: var(--ax-shadow-dialog);
7
- transition: transform 250ms cubic-bezier(0, 0, 0, 1) allow-discrete;
7
+ /* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
8
+ transform-origin: var(--__axc-action-menu-content-transform-origin);
9
+ transition:
10
+ transform 150ms ease allow-discrete,
11
+ opacity 150ms ease allow-discrete;
8
12
 
9
13
  &[data-state="open"] {
10
- &[data-side="bottom"] {
11
- @starting-style {
12
- transform: translateY(-4px);
13
- }
14
- }
15
-
16
- &[data-side="top"] {
17
- @starting-style {
18
- transform: translateY(4px);
19
- }
20
- }
21
-
22
- &[data-side="right"] {
23
- @starting-style {
24
- transform: translateX(-4px);
25
- }
26
- }
27
-
28
- &[data-side="left"] {
29
- @starting-style {
30
- transform: translateX(4px);
31
- }
14
+ @starting-style {
15
+ opacity: 0.8;
16
+ transform: scale3d(0.94, 0.94, 0.94);
32
17
  }
33
18
  }
34
19
  }
@@ -43,8 +28,6 @@
43
28
  background-color: var(--ax-bg-raised);
44
29
  min-width: 128px;
45
30
  max-width: min(95vw, 640px);
46
- /* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
47
- transform-origin: var(--__axc-action-menu-content-transform-origin);
48
31
  animation-duration: 160ms;
49
32
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
50
33
  padding: var(--__axc-action-menu-content-p);
@@ -133,7 +116,7 @@
133
116
 
134
117
  .aksel-action-menu__marker-icon {
135
118
  svg {
136
- font-size: 18px;
119
+ font-size: 1.125rem;
137
120
  flex-shrink: 0;
138
121
  }
139
122
 
@@ -143,6 +126,13 @@
143
126
  }
144
127
  }
145
128
 
129
+ .aksel-action-menu__sub-icon {
130
+ display: grid;
131
+ place-content: center;
132
+ font-size: 1.125rem;
133
+ margin-left: auto;
134
+ }
135
+
146
136
  /* --------------------------- ActionMenu shortcut -------------------------- */
147
137
  .aksel-action-menu__shortcut {
148
138
  background-color: var(--ax-bg-neutral-moderateA);
package/src/chat.css CHANGED
@@ -56,6 +56,7 @@
56
56
  width: 100%;
57
57
  max-width: 1.5rem;
58
58
  max-height: 1.5rem;
59
+ font-size: 1.5rem;
59
60
  }
60
61
  }
61
62
 
@@ -1,44 +1,138 @@
1
- .aksel-data-table__th-resize-handle {
2
- cursor: col-resize;
3
- margin-left: auto;
1
+ .aksel-data-table__border-wrapper {
2
+ border: 1px solid var(--ax-border-neutral-subtle);
3
+ border-radius: var(--ax-radius-12);
4
+ overflow: hidden;
5
+ flex-grow: 1;
4
6
  }
5
7
 
6
- /* TODO: Overflow does not currently work with fixed table layout. No idea why... */
7
- .aksel-data-table__wrapper {
8
- overflow-x: auto;
8
+ .aksel-data-table__scroll-wrapper {
9
+ overflow: auto;
9
10
  width: 100%;
11
+ height: 100%;
10
12
  position: relative;
11
13
  }
12
14
 
13
15
  .aksel-data-table {
14
16
  border-collapse: collapse;
15
17
  border-spacing: 0;
16
- inline-size: 100%;
17
18
  table-layout: fixed;
18
- width: 100%;
19
+ width: 1px; /* This is for some reason needed to make the browser respect the column width. TODO: Test in all browsers */
20
+
21
+ /*
22
+ We should NOT set min-width:100% b.c. it will cause inconsistencies in column resizing.
23
+ We could discuss whether it matters, though. But it feels buggy.
24
+ Downside is that it looks weird when the table is smaller than the container.
25
+ Maybe we could "manually" resize the other columns so that it fills the container? But that would add a lot of complexity.
26
+ We could have a toggle for the resize feature, and let the consumer decide which downside they prefer. Might need that anyways.
27
+ */
28
+
29
+ --__axc-data-table-density: var(--ax-space-16) 0;
30
+
31
+ &[data-density="condensed"] {
32
+ --__axc-data-table-density: 0 0;
33
+ }
34
+
35
+ &[data-density="spacious"] {
36
+ --__axc-data-table-density: var(--ax-space-32) 0;
37
+ }
38
+ }
39
+
40
+ .aksel-data-table--zebra-stripes {
41
+ & .aksel-data-table__tbody :where(.aksel-data-table__tr:nth-child(odd)) {
42
+ background-color: var(--ax-bg-neutral-softA);
43
+ }
44
+ }
45
+
46
+ .aksel-data-table--truncate-content {
47
+ .aksel-data-table__td > div {
48
+ text-overflow: ellipsis;
49
+ white-space: nowrap;
50
+ overflow: hidden;
51
+ }
19
52
  }
20
53
 
21
54
  .aksel-data-table__thead {
22
55
  background-color: var(--ax-bg-raised);
56
+ position: sticky;
57
+ top: 0;
58
+ box-shadow: 0 1px 0 0 var(--ax-border-neutral-subtle);
23
59
  }
24
60
 
25
61
  .aksel-data-table__tbody {
26
- inline-size: 100%;
27
62
  background-color: var(--ax-bg-raised);
28
63
  }
29
64
 
30
65
  .aksel-data-table__tr {
31
66
  border: none;
32
- block-size: 3rem;
33
- inline-size: 100%;
34
67
  }
35
68
 
36
69
  .aksel-data-table__th {
70
+ position: relative;
37
71
  background-color: var(--ax-bg-neutral-soft);
38
72
  color: var(--ax-text-neutral);
39
- padding-inline: var(--ax-space-16);
73
+ padding: var(--ax-space-8) var(--ax-space-16);
40
74
  text-align: start;
41
- vertical-align: middle;
75
+ border-block-end: 1px solid var(--ax-border-neutral-subtle);
76
+ overflow: hidden;
77
+
78
+ &:not(:first-child) {
79
+ border-inline-start: 1px solid var(--ax-border-neutral-subtle);
80
+ }
81
+ }
82
+
83
+ .aksel-data-table__th-content {
84
+ text-overflow: ellipsis;
85
+ white-space: nowrap;
86
+ overflow: hidden;
87
+ }
88
+
89
+ .aksel-data-table__th-resize-handle {
90
+ z-index: 2;
91
+ position: absolute;
92
+ inset-block: 0;
93
+ inset-inline-end: 0; /* TODO: See if we can make the handle appear right between the columns */
94
+ cursor: col-resize;
95
+ margin: 0;
96
+ padding: 0;
97
+ width: 12px; /* TODO: Violation of WCAG SC 2.5.8 Target Size https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html */
98
+ border: none;
99
+ background: transparent;
100
+
101
+ &::after {
102
+ content: "";
103
+ position: absolute;
104
+ inset-block: 0;
105
+ inset-inline-end: 0;
106
+ width: 4px;
107
+ }
108
+
109
+ &:hover::after {
110
+ /* TODO: Consider if the resize-handle should be visible already when hovering the column header */
111
+ background: var(--ax-bg-accent-strong);
112
+ }
113
+
114
+ &:active::after {
115
+ background: var(--ax-bg-accent-strong-pressed);
116
+ }
117
+ }
118
+
119
+ .aksel-data-table__th-action-button {
120
+ transition: 0.1s ease-in-out;
121
+
122
+ /* TODO: Animating all these sort of "stutters" a little now. Can some be removed? */
123
+ transition-property: opacity, width, min-width, max-width, padding;
124
+
125
+ &:focus-visible {
126
+ transition: none;
127
+ }
128
+
129
+ &:not(.aksel-data-table__th:is(:hover, :focus-within) &, &:focus-visible, &[data-expanded="true"]) {
130
+ opacity: 0;
131
+ min-width: 0;
132
+ max-width: 0;
133
+ padding: 0;
134
+ overflow: hidden;
135
+ }
42
136
  }
43
137
 
44
138
  .aksel-data-table__td {
@@ -47,12 +141,34 @@
47
141
  border-block-end: 1px solid var(--ax-border-neutral-subtle);
48
142
  border-block-start: 1px solid var(--ax-bg-raised);
49
143
  color: var(--ax-text-neutral-subtle);
144
+ padding: var(--__axc-data-table-density);
50
145
  padding-inline: 1rem;
51
146
  overflow: hidden;
52
147
 
53
- & > div {
54
- text-overflow: ellipsis;
55
- white-space: nowrap;
56
- overflow: hidden;
148
+ &:not(:first-child) {
149
+ border-inline-start: 1px solid var(--ax-border-neutral-subtle);
150
+ }
151
+
152
+ .aksel-data-table__tfoot .aksel-data-table__tr:last-child & {
153
+ border-block-end: none;
154
+ }
155
+
156
+ .aksel-data-table:not(:has(.aksel-data-table__tfoot)) .aksel-data-table__tr:last-child & {
157
+ border-block-end: none;
57
158
  }
58
159
  }
160
+
161
+ .aksel-data-table__td,
162
+ .aksel-data-table__th {
163
+ scroll-margin-block: var(--ax-space-0);
164
+ scroll-margin-inline: var(--ax-space-0);
165
+
166
+ &:focus-visible {
167
+ outline: 2px solid var(--ax-border-focus);
168
+ outline-offset: -4px;
169
+ }
170
+ }
171
+
172
+ .aksel-data-table__tfoot {
173
+ background-color: var(--ax-bg-raised);
174
+ }