@navikt/ds-css 4.12.2 → 5.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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @navikt/ds-css
2
2
 
3
+ ## 5.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Checkbox: Hotfix da checkmark ikke var sentrert hvis man brukte tailwind ([`90db7dd0c`](https://github.com/navikt/aksel/commit/90db7dd0c120c16a387d3169c05c1f33dc694323))
8
+
9
+ ## 5.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - Oppdatert Modal - Se [Migrering](https://aksel.nav.no/grunnleggende/kode/migrering) ([#2135](https://github.com/navikt/aksel/pull/2135))
14
+
15
+ - :sparkles: Støtte for header og footer
16
+ - :boom: Bruker nå native dialog i stedet for react-modal (med polyfill for eldre nettlesere)
17
+
18
+ ### Patch Changes
19
+
20
+ - Table: ExpandableRow har oppdatert knapp for å matche Accordion og ExpansionCard ([#2178](https://github.com/navikt/aksel/pull/2178))
21
+
22
+ - Table: Alle størrelser har justert padding. Small-size table bruker nå også standard typografi-størrelse (18px). ([#2178](https://github.com/navikt/aksel/pull/2178))
23
+
3
24
  ## 4.12.1
4
25
 
5
26
  ### Patch Changes
@@ -121,7 +121,7 @@ const StyleMappings = {
121
121
  {
122
122
  component: "Modal",
123
123
  main: "modal.css",
124
- dependencies: ["button.css"],
124
+ dependencies: [typoCss, "button.css"],
125
125
  },
126
126
  {
127
127
  component: "Pagination",
@@ -263,6 +263,7 @@
263
263
  transform: translate(0.25rem, -10%);
264
264
  height: 1.25rem;
265
265
  }
266
+ /* Tailwind sets all svg to block */
266
267
  .navds-checkbox__icon > svg {
267
268
  display: inline;
268
269
  }
@@ -1,7 +1,7 @@
1
1
  @charset "UTF-8";
2
2
  /**
3
3
  * Do not edit directly
4
- * Generated on Fri, 18 Aug 2023 10:19:31 GMT
4
+ * Generated on Fri, 18 Aug 2023 10:23:38 GMT
5
5
  */
6
6
  :root, :host {
7
7
  --a-spacing-05: 0.125rem;
@@ -109,26 +109,26 @@
109
109
  --a-blue-200: rgba(153, 195, 255, 1);
110
110
  --a-blue-100: rgba(204, 225, 255, 1);
111
111
  --a-blue-50: rgba(230, 240, 255, 1);
112
- --a-grayalpha-900: rgba(0, 0, 0, 0.85);
113
- --a-grayalpha-800: rgba(0, 0, 0, 0.75);
114
- --a-grayalpha-700: rgba(0, 0, 0, 0.65);
115
- --a-grayalpha-600: rgba(0, 0, 0, 0.56);
116
- --a-grayalpha-500: rgba(0, 0, 0, 0.44);
117
- --a-grayalpha-400: rgba(0, 0, 0, 0.31);
118
- --a-grayalpha-300: rgba(0, 0, 0, 0.19);
119
- --a-grayalpha-200: rgba(0, 0, 0, 0.1);
120
- --a-grayalpha-100: rgba(0, 0, 0, 0.05);
121
- --a-grayalpha-50: rgba(0, 0, 0, 0.03);
122
- --a-gray-900: rgba(38, 38, 38, 1);
123
- --a-gray-800: rgba(64, 64, 64, 1);
124
- --a-gray-700: rgba(89, 89, 89, 1);
125
- --a-gray-600: rgba(112, 112, 112, 1);
126
- --a-gray-500: rgba(143, 143, 143, 1);
127
- --a-gray-400: rgba(176, 176, 176, 1);
128
- --a-gray-300: rgba(207, 207, 207, 1);
129
- --a-gray-200: rgba(229, 229, 229, 1);
130
- --a-gray-100: rgba(241, 241, 241, 1);
131
- --a-gray-50: rgba(247, 247, 247, 1);
112
+ --a-grayalpha-900: rgba(2, 5, 9, 0.87);
113
+ --a-grayalpha-800: rgba(3, 11, 22, 0.75);
114
+ --a-grayalpha-700: rgba(1, 11, 24, 0.68);
115
+ --a-grayalpha-600: rgba(2, 15, 34, 0.6);
116
+ --a-grayalpha-500: rgba(2, 20, 49, 0.49);
117
+ --a-grayalpha-400: rgba(5, 23, 51, 0.34);
118
+ --a-grayalpha-300: rgba(7, 26, 54, 0.21);
119
+ --a-grayalpha-200: rgba(17, 41, 64, 0.13);
120
+ --a-grayalpha-100: rgba(18, 43, 68, 0.08);
121
+ --a-grayalpha-50: rgba(38, 55, 89, 0.06);
122
+ --a-gray-900: rgba(35, 38, 42, 1);
123
+ --a-gray-800: rgba(66, 71, 79, 1);
124
+ --a-gray-700: rgba(82, 89, 98, 1);
125
+ --a-gray-600: rgba(103, 111, 123, 1);
126
+ --a-gray-500: rgba(131, 140, 154, 1);
127
+ --a-gray-400: rgba(170, 176, 186, 1);
128
+ --a-gray-300: rgba(203, 207, 213, 1);
129
+ --a-gray-200: rgba(224, 227, 230, 1);
130
+ --a-gray-100: rgba(236, 238, 240, 1);
131
+ --a-gray-50: rgba(242, 243, 245, 1);
132
132
  --a-nav-red: rgba(195, 0, 0, 1);
133
133
  --a-white: rgba(255, 255, 255, 1);
134
134
  --a-transparent: rgba(255, 255, 255, 0);
@@ -188,7 +188,7 @@
188
188
  --a-icon-success: var(--a-green-500);
189
189
  --a-icon-action: var(--a-blue-500);
190
190
  --a-icon-action-on-action-subtle: var(--a-blue-600);
191
- --a-icon-action-selected: var(--a-deepblue-500);
191
+ --a-icon-action-selected: var(--a-blue-700);
192
192
  --a-icon-subtle: var(--a-grayalpha-700);
193
193
  --a-icon-default: var(--a-gray-900);
194
194
  --a-surface-alt-3: var(--a-deepblue-500);
@@ -228,16 +228,16 @@
228
228
  --a-surface-neutral-subtle: var(--a-grayalpha-100);
229
229
  --a-surface-neutral-subtle-hover: var(--a-grayalpha-200);
230
230
  --a-surface-action: var(--a-blue-500);
231
- --a-surface-action-selected: var(--a-deepblue-500);
232
- --a-surface-action-selected-hover: var(--a-deepblue-600);
233
- --a-surface-action-active: var(--a-deepblue-500);
231
+ --a-surface-action-selected: var(--a-blue-700);
232
+ --a-surface-action-selected-hover: var(--a-blue-800);
233
+ --a-surface-action-active: var(--a-blue-700);
234
234
  --a-surface-action-hover: var(--a-blue-600);
235
235
  --a-surface-action-subtle: var(--a-blue-50);
236
236
  --a-surface-action-subtle-hover: var(--a-blue-100);
237
237
  --a-surface-inverted: var(--a-gray-900);
238
238
  --a-surface-inverted-active: var(--a-gray-700);
239
239
  --a-surface-inverted-hover: var(--a-gray-800);
240
- --a-surface-backdrop: var(--a-grayalpha-700);
240
+ --a-surface-backdrop: var(--a-grayalpha-500);
241
241
  --a-surface-transparent: var(--a-transparent);
242
242
  --a-surface-subtle: var(--a-gray-50);
243
243
  --a-surface-selected: var(--a-blue-50);
@@ -258,7 +258,7 @@
258
258
  --a-text-on-inverted: var(--a-white);
259
259
  --a-text-action: var(--a-blue-500);
260
260
  --a-text-action-on-action-subtle: var(--a-blue-600);
261
- --a-text-action-selected: var(--a-deepblue-500);
261
+ --a-text-action-selected: var(--a-blue-700);
262
262
  --a-text-danger: var(--a-red-500);
263
263
  --a-text-visited: var(--a-purple-500);
264
264
  --a-text-subtle: var(--a-grayalpha-700);
@@ -294,9 +294,9 @@
294
294
  --a-border-success: var(--a-green-500);
295
295
  --a-border-selected: var(--a-blue-500);
296
296
  --a-border-action: var(--a-blue-500);
297
- --a-border-action-selected: var(--a-deepblue-500);
298
- --a-border-subtle: var(--a-grayalpha-200);
299
- --a-border-subtle-hover: var(--a-grayalpha-300);
297
+ --a-border-action-selected: var(--a-blue-700);
298
+ --a-border-subtle: var(--a-grayalpha-300);
299
+ --a-border-subtle-hover: var(--a-grayalpha-400);
300
300
  --a-border-divider: var(--a-grayalpha-300);
301
301
  --a-border-strong: var(--a-grayalpha-700);
302
302
  --a-border-default: var(--a-grayalpha-500);
@@ -2619,6 +2619,7 @@ body,
2619
2619
  transform: translate(0.25rem, -10%);
2620
2620
  height: 1.25rem;
2621
2621
  }
2622
+ /* Tailwind sets all svg to block */
2622
2623
  .navds-checkbox__icon > svg {
2623
2624
  display: inline;
2624
2625
  }
@@ -3957,65 +3958,137 @@ button.navds-internalheader__title:active,
3957
3958
  stroke-dashoffset: -120px;
3958
3959
  }
3959
3960
  }
3960
- .ReactModal__Body--open {
3961
+ .navds-modal__document-body {
3961
3962
  overflow: hidden;
3962
3963
  }
3963
3964
  .navds-modal {
3964
3965
  background-color: var(--ac-modal-bg, var(--a-surface-default));
3965
- border-radius: var(--a-border-radius-medium);
3966
- display: block;
3967
- position: relative;
3968
- overflow: auto;
3969
- max-height: 100%;
3966
+ border: 1px solid var(--ac-modal-border, var(--a-border-subtle));
3967
+ border-radius: var(--a-border-radius-large);
3970
3968
  box-shadow: var(--a-shadow-xlarge);
3969
+ padding: 0;
3970
+ position: fixed;
3971
+ max-height: 100%;
3972
+ max-width: 100%;
3971
3973
  }
3972
- .navds-modal__content {
3973
- padding: var(--a-spacing-4);
3974
+ .navds-modal[open] {
3975
+ display: flex;
3976
+ flex-direction: column;
3977
+ animation: akselModalFadeIn 0.35s cubic-bezier(0.15, 1, 0.3, 1);
3974
3978
  }
3975
- .navds-modal:focus-visible,
3976
- .navds-modal--focus {
3977
- box-shadow: var(--a-shadow-focus);
3978
- outline: none;
3979
+ .navds-modal--polyfilled {
3980
+ top: 50%;
3981
+ transform: translate(0, -50%);
3982
+ overflow: auto;
3983
+
3984
+ /* From polyfill (dialog-polyfill/dist/dialog-polyfill.css): */
3985
+ left: 0;
3986
+ right: 0;
3987
+ width: fit-content;
3988
+ height: fit-content;
3989
+ margin: auto;
3979
3990
  }
3980
- @supports not selector(:focus-visible) {
3981
- .navds-modal:focus,
3982
- .navds-modal--focus {
3983
- box-shadow: var(--a-shadow-focus);
3984
- outline: none;
3985
- }
3991
+ .navds-modal--polyfilled:not([open]) {
3992
+ display: none; /* from polyfill */
3986
3993
  }
3987
- .navds-modal__overlay {
3994
+ ._dialog_overlay {
3995
+ /* From polyfill */
3988
3996
  position: fixed;
3989
- z-index: var(--a-z-index-modal);
3990
3997
  top: 0;
3998
+ right: 0;
3991
3999
  bottom: 0;
3992
4000
  left: 0;
3993
- right: 0;
3994
- background-color: var(--ac-modal-backdrop, var(--a-surface-backdrop));
3995
- padding: var(--a-spacing-4);
3996
- display: flex;
3997
- align-items: center;
3998
- justify-content: center;
3999
4001
  }
4000
- .navds-modal__button--shake {
4001
- transform: rotate(0deg);
4002
- transition: transform 100ms cubic-bezier(0.82, 2, 1, 0.3);
4002
+ .navds-modal--small {
4003
+ width: var(--ac-modal-width-small, 450px);
4003
4004
  }
4004
- /* prettier-ignore */
4005
- .navds-modal__overlay:active > .navds-modal:not(:active) > .navds-modal__button--shake {
4006
- transform: rotate(10deg);
4007
- transition: transform 100ms cubic-bezier(0.82, -2, 1, 0.3);
4005
+ .navds-modal--medium {
4006
+ width: var(--ac-modal-width-medium, 700px);
4007
+ }
4008
+ @media (min-width: 480px) {
4009
+ .navds-modal {
4010
+ max-width: calc((100% - 6px) - 2em);
4011
+ max-height: calc((100% - 6px) - 2em);
4012
+ }
4013
+
4014
+ .navds-modal--autowidth {
4015
+ max-width: min(700px, calc((100% - 6px) - 2em));
4016
+ }
4017
+ }
4018
+ .navds-modal::backdrop {
4019
+ /*
4020
+ * Cannot use --a-surface-backdrop because ::backdrop does not inherit from anything but itself.
4021
+ * But consumers can do `::backdrop { --ac-modal-backdrop: white; }`
4022
+ * We can add ::backdrop to tokens.css when we remove the polyfill.
4023
+ */
4024
+ background: var(--ac-modal-backdrop, rgb(2 20 49 / 0.49));
4025
+ animation: akselModalBackdropFadeIn 0.35s cubic-bezier(0.15, 1, 0.3, 1);
4026
+ }
4027
+ .navds-modal--polyfilled + .backdrop /* Cannot be combined with ::backdrop selector */ {
4028
+ background: var(--ac-modal-backdrop, rgb(2 20 49 / 0.49));
4029
+
4030
+ /* From polyfill: */
4031
+ position: fixed;
4032
+ top: 0;
4033
+ right: 0;
4034
+ bottom: 0;
4035
+ left: 0;
4008
4036
  }
4009
4037
  .navds-modal__button {
4010
- position: absolute;
4011
- top: var(--a-spacing-4);
4012
- right: var(--a-spacing-4);
4038
+ margin-left: var(--a-spacing-4);
4039
+ float: right;
4040
+ }
4041
+ .navds-modal__header {
4042
+ padding: var(--a-spacing-6) var(--a-spacing-6) var(--a-spacing-4) var(--a-spacing-6);
4043
+ }
4044
+ .navds-modal__header-icon svg {
4045
+ display: inline;
4046
+ vertical-align: -0.25rem;
4047
+ margin-right: var(--a-spacing-1);
4048
+ }
4049
+ .navds-modal__label {
4050
+ font-weight: 600;
4051
+ color: var(--a-text-subtle);
4052
+ }
4053
+ .navds-modal__body {
4054
+ padding: var(--a-spacing-6);
4055
+ overflow: auto;
4056
+ overscroll-behavior: contain;
4057
+ }
4058
+ .navds-modal__header + .navds-modal__body {
4059
+ padding-top: var(--a-spacing-0);
4060
+ }
4061
+ .navds-modal__footer {
4013
4062
  display: flex;
4014
- padding: var(--a-spacing-2);
4063
+ flex-flow: row-reverse wrap;
4064
+ gap: var(--a-spacing-4);
4065
+ padding: var(--a-spacing-4) var(--a-spacing-6) var(--a-spacing-6) var(--a-spacing-6);
4015
4066
  }
4016
- .navds-modal__button svg {
4017
- height: 1.5rem;
4018
- width: 1.5rem;
4067
+ .navds-modal__footer :nth-of-type(2) {
4068
+ margin-left: auto;
4069
+ }
4070
+ @keyframes akselModalFadeIn {
4071
+ from {
4072
+ opacity: 0;
4073
+ transform: translate3d(0, calc(5% + 4px), 0);
4074
+ }
4075
+
4076
+ 50% {
4077
+ opacity: 1;
4078
+ }
4079
+
4080
+ to {
4081
+ transform: none;
4082
+ }
4083
+ }
4084
+ @keyframes akselModalBackdropFadeIn {
4085
+ from {
4086
+ opacity: 0;
4087
+ }
4088
+
4089
+ to {
4090
+ opacity: 1;
4091
+ }
4019
4092
  }
4020
4093
  .navds-pagination__list {
4021
4094
  margin: 0;
@@ -5458,7 +5531,7 @@ button.navds-stepper__step {
5458
5531
  .navds-table__header-cell,
5459
5532
  .navds-table__data-cell {
5460
5533
  display: table-cell;
5461
- padding: var(--a-spacing-4) var(--a-spacing-3);
5534
+ padding: var(--a-spacing-3) var(--a-spacing-2);
5462
5535
  border-bottom: 1px solid var(--ac-table-row-border, var(--a-border-default));
5463
5536
  text-align: left;
5464
5537
  }
@@ -5481,9 +5554,13 @@ button.navds-stepper__step {
5481
5554
  :where(.navds-table__expandable-row--open:hover) .navds-table__data-cell {
5482
5555
  border-bottom-color: transparent;
5483
5556
  }
5557
+ .navds-table--large .navds-table__header-cell,
5558
+ .navds-table--large .navds-table__data-cell {
5559
+ padding: var(--a-spacing-4) var(--a-spacing-2);
5560
+ }
5484
5561
  .navds-table--small .navds-table__header-cell,
5485
5562
  .navds-table--small .navds-table__data-cell {
5486
- padding: var(--a-spacing-2) var(--a-spacing-3);
5563
+ padding: var(--a-spacing-1) var(--a-spacing-2);
5487
5564
  }
5488
5565
  .navds-table .navds-checkbox .navds-checkbox__input {
5489
5566
  top: -0.75rem;
@@ -5546,7 +5623,7 @@ button.navds-stepper__step {
5546
5623
  .navds-table__expandable-row:not(.navds-table__expandable-row--open) .navds-table__data-cell {
5547
5624
  transition: border-bottom-color 190ms cubic-bezier(0.6, 0.04, 0.98, 0.335);
5548
5625
  }
5549
- .navds-table__expandable-row:not(.navds-table__expandable-row--expansion-disabled):hover {
5626
+ .navds-table__expandable-row.navds-table__expandable-row--clickable:not(.navds-table__expandable-row--expansion-disabled):hover {
5550
5627
  cursor: pointer;
5551
5628
  }
5552
5629
  .navds-table__expandable-row--open .navds-table__data-cell {
@@ -5559,45 +5636,62 @@ button.navds-stepper__step {
5559
5636
  border-color: transparent;
5560
5637
  }
5561
5638
  .navds-table__toggle-expand-cell {
5562
- padding: 0;
5563
- width: 3.5rem;
5639
+ padding: 0 var(--a-spacing-2);
5640
+ position: relative;
5641
+ width: 2.5rem;
5642
+ }
5643
+ .navds-table--large .navds-table__toggle-expand-cell {
5644
+ padding: 0 var(--a-spacing-2);
5564
5645
  }
5565
5646
  .navds-table--small .navds-table__toggle-expand-cell {
5566
- padding: 0;
5567
- width: 2.25rem;
5647
+ padding: var(--a-spacing-1) var(--a-spacing-2);
5568
5648
  }
5569
5649
  .navds-table__toggle-expand-button {
5570
- all: unset;
5571
- display: flex;
5572
- align-items: center;
5650
+ display: grid;
5651
+ place-content: center;
5573
5652
  cursor: pointer;
5574
- padding: var(--a-spacing-4);
5653
+ margin: 0;
5654
+ background: transparent;
5655
+ border: none;
5656
+ border-radius: var(--a-border-radius-medium);
5657
+ height: 2rem;
5658
+ width: 2rem;
5659
+ font-size: 1.5rem;
5575
5660
  }
5576
- .navds-table--small .navds-table__toggle-expand-button {
5577
- padding: var(--a-spacing-2);
5661
+ .navds-table__expandable-icon {
5662
+ transition: transform 150ms ease-in-out;
5578
5663
  }
5579
- .navds-table__toggle-expand-button:focus-visible {
5580
- box-shadow: inset var(--a-shadow-focus);
5664
+ .navds-table__toggle-expand-button:hover,
5665
+ .navds-table__expandable-row--clickable:hover .navds-table__toggle-expand-button {
5666
+ background-color: var(--a-surface-hover);
5581
5667
  }
5582
- @supports not selector(:focus-visible) {
5583
- .navds-table__toggle-expand-button:focus {
5584
- box-shadow: inset var(--a-shadow-focus);
5585
- }
5668
+ .navds-table__toggle-expand-cell--open > :where(.navds-table__toggle-expand-button) :where(.navds-table__expandable-icon) {
5669
+ transform: translateY(0) rotate(180deg);
5586
5670
  }
5587
- .navds-table__expandable-icon {
5588
- font-size: 1.5rem;
5671
+ .navds-table__toggle-expand-button:hover > :where(.navds-table__expandable-icon) {
5672
+ transform: translateY(1px);
5589
5673
  }
5590
- .navds-table--small .navds-table__expandable-icon {
5591
- font-size: 1.25rem;
5674
+ .navds-table__toggle-expand-cell--open > .navds-table__toggle-expand-button:hover > :where(.navds-table__expandable-icon) {
5675
+ transform: translateY(-1px) rotate(180deg);
5592
5676
  }
5593
- .navds-table__toggle-expand-button:hover .navds-table__expandable-icon {
5594
- transform: translateY(1px);
5677
+ .navds-table__toggle-expand-button:focus-visible {
5678
+ outline: none;
5679
+ box-shadow: var(--a-shadow-focus);
5595
5680
  }
5596
- .navds-table__toggle-expand-cell--open .navds-table__expandable-icon {
5597
- transform: rotate(180deg);
5681
+ @supports not selector(:focus-visible) {
5682
+ .navds-table__toggle-expand-button:focus {
5683
+ outline: none;
5684
+ box-shadow: var(--a-shadow-focus);
5685
+ }
5598
5686
  }
5599
- .navds-table__toggle-expand-cell--open .navds-table__toggle-expand-button:hover .navds-table__expandable-icon {
5600
- transform: translateY(-1px) rotate(180deg);
5687
+ .navds-table__toggle-expand-button::after {
5688
+ inset: 0;
5689
+ z-index: 1;
5690
+ position: absolute;
5691
+ content: "";
5692
+ height: 100%;
5693
+ width: 100%;
5694
+ cursor: pointer;
5601
5695
  }
5602
5696
  .navds-table__expanded-row-cell {
5603
5697
  padding: 0;
@@ -5609,10 +5703,10 @@ button.navds-stepper__step {
5609
5703
  border-bottom: 1px solid var(--ac-table-row-border, var(--a-border-default));
5610
5704
  }
5611
5705
  .navds-table__expanded-row-content {
5612
- padding: var(--a-spacing-4) 4.25rem;
5706
+ padding: var(--a-spacing-4) calc(var(--a-spacing-2) + 3rem);
5613
5707
  }
5614
5708
  .navds-table--small .navds-table__expanded-row-content {
5615
- padding: var(--a-spacing-2) var(--a-spacing-12);
5709
+ padding: var(--a-spacing-2) calc(var(--a-spacing-2) + 3rem);
5616
5710
  }
5617
5711
  .navds-tabs__tablist-wrapper {
5618
5712
  box-shadow: inset 0 -1px 0 0 var(--ac-tabs-border, var(--a-border-divider));