@navikt/ds-css 4.12.1 → 5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @navikt/ds-css
2
2
 
3
+ ## 5.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Oppdatert Modal - Se [Migrering](https://aksel.nav.no/grunnleggende/kode/migrering) ([#2135](https://github.com/navikt/aksel/pull/2135))
8
+
9
+ - :sparkles: Støtte for header og footer
10
+ - :boom: Bruker nå native dialog i stedet for react-modal (med polyfill for eldre nettlesere)
11
+
12
+ ### Patch Changes
13
+
14
+ - Table: ExpandableRow har oppdatert knapp for å matche Accordion og ExpansionCard ([#2178](https://github.com/navikt/aksel/pull/2178))
15
+
16
+ - 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))
17
+
3
18
  ## 4.12.1
4
19
 
5
20
  ### 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",
@@ -1,7 +1,7 @@
1
1
  @charset "UTF-8";
2
2
  /**
3
3
  * Do not edit directly
4
- * Generated on Thu, 17 Aug 2023 14:06:32 GMT
4
+ * Generated on Fri, 18 Aug 2023 09:44:10 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);
@@ -3954,65 +3954,137 @@ button.navds-internalheader__title:active,
3954
3954
  stroke-dashoffset: -120px;
3955
3955
  }
3956
3956
  }
3957
- .ReactModal__Body--open {
3957
+ .navds-modal__document-body {
3958
3958
  overflow: hidden;
3959
3959
  }
3960
3960
  .navds-modal {
3961
3961
  background-color: var(--ac-modal-bg, var(--a-surface-default));
3962
- border-radius: var(--a-border-radius-medium);
3963
- display: block;
3964
- position: relative;
3965
- overflow: auto;
3966
- max-height: 100%;
3962
+ border: 1px solid var(--ac-modal-border, var(--a-border-subtle));
3963
+ border-radius: var(--a-border-radius-large);
3967
3964
  box-shadow: var(--a-shadow-xlarge);
3965
+ padding: 0;
3966
+ position: fixed;
3967
+ max-height: 100%;
3968
+ max-width: 100%;
3968
3969
  }
3969
- .navds-modal__content {
3970
- padding: var(--a-spacing-4);
3970
+ .navds-modal[open] {
3971
+ display: flex;
3972
+ flex-direction: column;
3973
+ animation: akselModalFadeIn 0.35s cubic-bezier(0.15, 1, 0.3, 1);
3971
3974
  }
3972
- .navds-modal:focus-visible,
3973
- .navds-modal--focus {
3974
- box-shadow: var(--a-shadow-focus);
3975
- outline: none;
3975
+ .navds-modal--polyfilled {
3976
+ top: 50%;
3977
+ transform: translate(0, -50%);
3978
+ overflow: auto;
3979
+
3980
+ /* From polyfill (dialog-polyfill/dist/dialog-polyfill.css): */
3981
+ left: 0;
3982
+ right: 0;
3983
+ width: fit-content;
3984
+ height: fit-content;
3985
+ margin: auto;
3976
3986
  }
3977
- @supports not selector(:focus-visible) {
3978
- .navds-modal:focus,
3979
- .navds-modal--focus {
3980
- box-shadow: var(--a-shadow-focus);
3981
- outline: none;
3982
- }
3987
+ .navds-modal--polyfilled:not([open]) {
3988
+ display: none; /* from polyfill */
3983
3989
  }
3984
- .navds-modal__overlay {
3990
+ ._dialog_overlay {
3991
+ /* From polyfill */
3985
3992
  position: fixed;
3986
- z-index: var(--a-z-index-modal);
3987
3993
  top: 0;
3994
+ right: 0;
3988
3995
  bottom: 0;
3989
3996
  left: 0;
3990
- right: 0;
3991
- background-color: var(--ac-modal-backdrop, var(--a-surface-backdrop));
3992
- padding: var(--a-spacing-4);
3993
- display: flex;
3994
- align-items: center;
3995
- justify-content: center;
3996
3997
  }
3997
- .navds-modal__button--shake {
3998
- transform: rotate(0deg);
3999
- transition: transform 100ms cubic-bezier(0.82, 2, 1, 0.3);
3998
+ .navds-modal--small {
3999
+ width: var(--ac-modal-width-small, 450px);
4000
4000
  }
4001
- /* prettier-ignore */
4002
- .navds-modal__overlay:active > .navds-modal:not(:active) > .navds-modal__button--shake {
4003
- transform: rotate(10deg);
4004
- transition: transform 100ms cubic-bezier(0.82, -2, 1, 0.3);
4001
+ .navds-modal--medium {
4002
+ width: var(--ac-modal-width-medium, 700px);
4003
+ }
4004
+ @media (min-width: 480px) {
4005
+ .navds-modal {
4006
+ max-width: calc((100% - 6px) - 2em);
4007
+ max-height: calc((100% - 6px) - 2em);
4008
+ }
4009
+
4010
+ .navds-modal--autowidth {
4011
+ max-width: min(700px, calc((100% - 6px) - 2em));
4012
+ }
4013
+ }
4014
+ .navds-modal::backdrop {
4015
+ /*
4016
+ * Cannot use --a-surface-backdrop because ::backdrop does not inherit from anything but itself.
4017
+ * But consumers can do `::backdrop { --ac-modal-backdrop: white; }`
4018
+ * We can add ::backdrop to tokens.css when we remove the polyfill.
4019
+ */
4020
+ background: var(--ac-modal-backdrop, rgb(2 20 49 / 0.49));
4021
+ animation: akselModalBackdropFadeIn 0.35s cubic-bezier(0.15, 1, 0.3, 1);
4022
+ }
4023
+ .navds-modal--polyfilled + .backdrop /* Cannot be combined with ::backdrop selector */ {
4024
+ background: var(--ac-modal-backdrop, rgb(2 20 49 / 0.49));
4025
+
4026
+ /* From polyfill: */
4027
+ position: fixed;
4028
+ top: 0;
4029
+ right: 0;
4030
+ bottom: 0;
4031
+ left: 0;
4005
4032
  }
4006
4033
  .navds-modal__button {
4007
- position: absolute;
4008
- top: var(--a-spacing-4);
4009
- right: var(--a-spacing-4);
4034
+ margin-left: var(--a-spacing-4);
4035
+ float: right;
4036
+ }
4037
+ .navds-modal__header {
4038
+ padding: var(--a-spacing-6) var(--a-spacing-6) var(--a-spacing-4) var(--a-spacing-6);
4039
+ }
4040
+ .navds-modal__header-icon svg {
4041
+ display: inline;
4042
+ vertical-align: -0.25rem;
4043
+ margin-right: var(--a-spacing-1);
4044
+ }
4045
+ .navds-modal__label {
4046
+ font-weight: 600;
4047
+ color: var(--a-text-subtle);
4048
+ }
4049
+ .navds-modal__body {
4050
+ padding: var(--a-spacing-6);
4051
+ overflow: auto;
4052
+ overscroll-behavior: contain;
4053
+ }
4054
+ .navds-modal__header + .navds-modal__body {
4055
+ padding-top: var(--a-spacing-0);
4056
+ }
4057
+ .navds-modal__footer {
4010
4058
  display: flex;
4011
- padding: var(--a-spacing-2);
4059
+ flex-flow: row-reverse wrap;
4060
+ gap: var(--a-spacing-4);
4061
+ padding: var(--a-spacing-4) var(--a-spacing-6) var(--a-spacing-6) var(--a-spacing-6);
4012
4062
  }
4013
- .navds-modal__button svg {
4014
- height: 1.5rem;
4015
- width: 1.5rem;
4063
+ .navds-modal__footer :nth-of-type(2) {
4064
+ margin-left: auto;
4065
+ }
4066
+ @keyframes akselModalFadeIn {
4067
+ from {
4068
+ opacity: 0;
4069
+ transform: translate3d(0, calc(5% + 4px), 0);
4070
+ }
4071
+
4072
+ 50% {
4073
+ opacity: 1;
4074
+ }
4075
+
4076
+ to {
4077
+ transform: none;
4078
+ }
4079
+ }
4080
+ @keyframes akselModalBackdropFadeIn {
4081
+ from {
4082
+ opacity: 0;
4083
+ }
4084
+
4085
+ to {
4086
+ opacity: 1;
4087
+ }
4016
4088
  }
4017
4089
  .navds-pagination__list {
4018
4090
  margin: 0;
@@ -5455,7 +5527,7 @@ button.navds-stepper__step {
5455
5527
  .navds-table__header-cell,
5456
5528
  .navds-table__data-cell {
5457
5529
  display: table-cell;
5458
- padding: var(--a-spacing-4) var(--a-spacing-3);
5530
+ padding: var(--a-spacing-3) var(--a-spacing-2);
5459
5531
  border-bottom: 1px solid var(--ac-table-row-border, var(--a-border-default));
5460
5532
  text-align: left;
5461
5533
  }
@@ -5478,9 +5550,13 @@ button.navds-stepper__step {
5478
5550
  :where(.navds-table__expandable-row--open:hover) .navds-table__data-cell {
5479
5551
  border-bottom-color: transparent;
5480
5552
  }
5553
+ .navds-table--large .navds-table__header-cell,
5554
+ .navds-table--large .navds-table__data-cell {
5555
+ padding: var(--a-spacing-4) var(--a-spacing-2);
5556
+ }
5481
5557
  .navds-table--small .navds-table__header-cell,
5482
5558
  .navds-table--small .navds-table__data-cell {
5483
- padding: var(--a-spacing-2) var(--a-spacing-3);
5559
+ padding: var(--a-spacing-1) var(--a-spacing-2);
5484
5560
  }
5485
5561
  .navds-table .navds-checkbox .navds-checkbox__input {
5486
5562
  top: -0.75rem;
@@ -5543,7 +5619,7 @@ button.navds-stepper__step {
5543
5619
  .navds-table__expandable-row:not(.navds-table__expandable-row--open) .navds-table__data-cell {
5544
5620
  transition: border-bottom-color 190ms cubic-bezier(0.6, 0.04, 0.98, 0.335);
5545
5621
  }
5546
- .navds-table__expandable-row:not(.navds-table__expandable-row--expansion-disabled):hover {
5622
+ .navds-table__expandable-row.navds-table__expandable-row--clickable:not(.navds-table__expandable-row--expansion-disabled):hover {
5547
5623
  cursor: pointer;
5548
5624
  }
5549
5625
  .navds-table__expandable-row--open .navds-table__data-cell {
@@ -5556,45 +5632,62 @@ button.navds-stepper__step {
5556
5632
  border-color: transparent;
5557
5633
  }
5558
5634
  .navds-table__toggle-expand-cell {
5559
- padding: 0;
5560
- width: 3.5rem;
5635
+ padding: 0 var(--a-spacing-2);
5636
+ position: relative;
5637
+ width: 2.5rem;
5638
+ }
5639
+ .navds-table--large .navds-table__toggle-expand-cell {
5640
+ padding: 0 var(--a-spacing-2);
5561
5641
  }
5562
5642
  .navds-table--small .navds-table__toggle-expand-cell {
5563
- padding: 0;
5564
- width: 2.25rem;
5643
+ padding: var(--a-spacing-1) var(--a-spacing-2);
5565
5644
  }
5566
5645
  .navds-table__toggle-expand-button {
5567
- all: unset;
5568
- display: flex;
5569
- align-items: center;
5646
+ display: grid;
5647
+ place-content: center;
5570
5648
  cursor: pointer;
5571
- padding: var(--a-spacing-4);
5649
+ margin: 0;
5650
+ background: transparent;
5651
+ border: none;
5652
+ border-radius: var(--a-border-radius-medium);
5653
+ height: 2rem;
5654
+ width: 2rem;
5655
+ font-size: 1.5rem;
5572
5656
  }
5573
- .navds-table--small .navds-table__toggle-expand-button {
5574
- padding: var(--a-spacing-2);
5657
+ .navds-table__expandable-icon {
5658
+ transition: transform 150ms ease-in-out;
5575
5659
  }
5576
- .navds-table__toggle-expand-button:focus-visible {
5577
- box-shadow: inset var(--a-shadow-focus);
5660
+ .navds-table__toggle-expand-button:hover,
5661
+ .navds-table__expandable-row--clickable:hover .navds-table__toggle-expand-button {
5662
+ background-color: var(--a-surface-hover);
5578
5663
  }
5579
- @supports not selector(:focus-visible) {
5580
- .navds-table__toggle-expand-button:focus {
5581
- box-shadow: inset var(--a-shadow-focus);
5582
- }
5664
+ .navds-table__toggle-expand-cell--open > :where(.navds-table__toggle-expand-button) :where(.navds-table__expandable-icon) {
5665
+ transform: translateY(0) rotate(180deg);
5583
5666
  }
5584
- .navds-table__expandable-icon {
5585
- font-size: 1.5rem;
5667
+ .navds-table__toggle-expand-button:hover > :where(.navds-table__expandable-icon) {
5668
+ transform: translateY(1px);
5586
5669
  }
5587
- .navds-table--small .navds-table__expandable-icon {
5588
- font-size: 1.25rem;
5670
+ .navds-table__toggle-expand-cell--open > .navds-table__toggle-expand-button:hover > :where(.navds-table__expandable-icon) {
5671
+ transform: translateY(-1px) rotate(180deg);
5589
5672
  }
5590
- .navds-table__toggle-expand-button:hover .navds-table__expandable-icon {
5591
- transform: translateY(1px);
5673
+ .navds-table__toggle-expand-button:focus-visible {
5674
+ outline: none;
5675
+ box-shadow: var(--a-shadow-focus);
5592
5676
  }
5593
- .navds-table__toggle-expand-cell--open .navds-table__expandable-icon {
5594
- transform: rotate(180deg);
5677
+ @supports not selector(:focus-visible) {
5678
+ .navds-table__toggle-expand-button:focus {
5679
+ outline: none;
5680
+ box-shadow: var(--a-shadow-focus);
5681
+ }
5595
5682
  }
5596
- .navds-table__toggle-expand-cell--open .navds-table__toggle-expand-button:hover .navds-table__expandable-icon {
5597
- transform: translateY(-1px) rotate(180deg);
5683
+ .navds-table__toggle-expand-button::after {
5684
+ inset: 0;
5685
+ z-index: 1;
5686
+ position: absolute;
5687
+ content: "";
5688
+ height: 100%;
5689
+ width: 100%;
5690
+ cursor: pointer;
5598
5691
  }
5599
5692
  .navds-table__expanded-row-cell {
5600
5693
  padding: 0;
@@ -5606,10 +5699,10 @@ button.navds-stepper__step {
5606
5699
  border-bottom: 1px solid var(--ac-table-row-border, var(--a-border-default));
5607
5700
  }
5608
5701
  .navds-table__expanded-row-content {
5609
- padding: var(--a-spacing-4) 4.25rem;
5702
+ padding: var(--a-spacing-4) calc(var(--a-spacing-2) + 3rem);
5610
5703
  }
5611
5704
  .navds-table--small .navds-table__expanded-row-content {
5612
- padding: var(--a-spacing-2) var(--a-spacing-12);
5705
+ padding: var(--a-spacing-2) calc(var(--a-spacing-2) + 3rem);
5613
5706
  }
5614
5707
  .navds-tabs__tablist-wrapper {
5615
5708
  box-shadow: inset 0 -1px 0 0 var(--ac-tabs-border, var(--a-border-divider));