@navikt/aksel-stylelint 4.12.1 → 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.
@@ -20,4 +20,16 @@ exports.deprecations = [
20
20
  classes: ["navds-chips--icon-left"],
21
21
  message: "In v4.1.0 Chips. Toggle no longer handles special alignment for checkmark-icon, thus removing this class",
22
22
  },
23
+ {
24
+ classes: ["navds-modal__overlay"],
25
+ message: "Removed in v5.0.0, use `.navds-modal::backdrop` and `.navds-modal--polyfilled + .backdrop` instead",
26
+ },
27
+ {
28
+ classes: ["navds-modal__button--shake"],
29
+ message: "Removed in v5.0.0",
30
+ },
31
+ {
32
+ classes: ["navds-modal__content"],
33
+ message: "Renamed to `.navds-modal__body` in v5.0.0",
34
+ },
23
35
  ];
package/dist/index.css CHANGED
@@ -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 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,10 @@ body,
2619
2619
  transform: translate(0.25rem, -10%);
2620
2620
  height: 1.25rem;
2621
2621
  }
2622
+ /* Tailwind sets all svg to block */
2623
+ .navds-checkbox__icon > svg {
2624
+ display: inline;
2625
+ }
2622
2626
  .navds-checkbox--small > .navds-checkbox__input:checked + .navds-checkbox__label::before {
2623
2627
  background-position: 0.25rem center;
2624
2628
  }
@@ -3954,65 +3958,137 @@ button.navds-internalheader__title:active,
3954
3958
  stroke-dashoffset: -120px;
3955
3959
  }
3956
3960
  }
3957
- .ReactModal__Body--open {
3961
+ .navds-modal__document-body {
3958
3962
  overflow: hidden;
3959
3963
  }
3960
3964
  .navds-modal {
3961
3965
  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%;
3966
+ border: 1px solid var(--ac-modal-border, var(--a-border-subtle));
3967
+ border-radius: var(--a-border-radius-large);
3967
3968
  box-shadow: var(--a-shadow-xlarge);
3969
+ padding: 0;
3970
+ position: fixed;
3971
+ max-height: 100%;
3972
+ max-width: 100%;
3968
3973
  }
3969
- .navds-modal__content {
3970
- 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);
3971
3978
  }
3972
- .navds-modal:focus-visible,
3973
- .navds-modal--focus {
3974
- box-shadow: var(--a-shadow-focus);
3975
- 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;
3976
3990
  }
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
- }
3991
+ .navds-modal--polyfilled:not([open]) {
3992
+ display: none; /* from polyfill */
3983
3993
  }
3984
- .navds-modal__overlay {
3994
+ ._dialog_overlay {
3995
+ /* From polyfill */
3985
3996
  position: fixed;
3986
- z-index: var(--a-z-index-modal);
3987
3997
  top: 0;
3998
+ right: 0;
3988
3999
  bottom: 0;
3989
4000
  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
4001
  }
3997
- .navds-modal__button--shake {
3998
- transform: rotate(0deg);
3999
- transition: transform 100ms cubic-bezier(0.82, 2, 1, 0.3);
4002
+ .navds-modal--small {
4003
+ width: var(--ac-modal-width-small, 450px);
4000
4004
  }
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);
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;
4005
4036
  }
4006
4037
  .navds-modal__button {
4007
- position: absolute;
4008
- top: var(--a-spacing-4);
4009
- 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 {
4010
4062
  display: flex;
4011
- 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);
4012
4066
  }
4013
- .navds-modal__button svg {
4014
- height: 1.5rem;
4015
- 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
+ }
4016
4092
  }
4017
4093
  .navds-pagination__list {
4018
4094
  margin: 0;
@@ -5455,7 +5531,7 @@ button.navds-stepper__step {
5455
5531
  .navds-table__header-cell,
5456
5532
  .navds-table__data-cell {
5457
5533
  display: table-cell;
5458
- padding: var(--a-spacing-4) var(--a-spacing-3);
5534
+ padding: var(--a-spacing-3) var(--a-spacing-2);
5459
5535
  border-bottom: 1px solid var(--ac-table-row-border, var(--a-border-default));
5460
5536
  text-align: left;
5461
5537
  }
@@ -5478,9 +5554,13 @@ button.navds-stepper__step {
5478
5554
  :where(.navds-table__expandable-row--open:hover) .navds-table__data-cell {
5479
5555
  border-bottom-color: transparent;
5480
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
+ }
5481
5561
  .navds-table--small .navds-table__header-cell,
5482
5562
  .navds-table--small .navds-table__data-cell {
5483
- padding: var(--a-spacing-2) var(--a-spacing-3);
5563
+ padding: var(--a-spacing-1) var(--a-spacing-2);
5484
5564
  }
5485
5565
  .navds-table .navds-checkbox .navds-checkbox__input {
5486
5566
  top: -0.75rem;
@@ -5543,7 +5623,7 @@ button.navds-stepper__step {
5543
5623
  .navds-table__expandable-row:not(.navds-table__expandable-row--open) .navds-table__data-cell {
5544
5624
  transition: border-bottom-color 190ms cubic-bezier(0.6, 0.04, 0.98, 0.335);
5545
5625
  }
5546
- .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 {
5547
5627
  cursor: pointer;
5548
5628
  }
5549
5629
  .navds-table__expandable-row--open .navds-table__data-cell {
@@ -5556,45 +5636,62 @@ button.navds-stepper__step {
5556
5636
  border-color: transparent;
5557
5637
  }
5558
5638
  .navds-table__toggle-expand-cell {
5559
- padding: 0;
5560
- 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);
5561
5645
  }
5562
5646
  .navds-table--small .navds-table__toggle-expand-cell {
5563
- padding: 0;
5564
- width: 2.25rem;
5647
+ padding: var(--a-spacing-1) var(--a-spacing-2);
5565
5648
  }
5566
5649
  .navds-table__toggle-expand-button {
5567
- all: unset;
5568
- display: flex;
5569
- align-items: center;
5650
+ display: grid;
5651
+ place-content: center;
5570
5652
  cursor: pointer;
5571
- 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;
5572
5660
  }
5573
- .navds-table--small .navds-table__toggle-expand-button {
5574
- padding: var(--a-spacing-2);
5661
+ .navds-table__expandable-icon {
5662
+ transition: transform 150ms ease-in-out;
5575
5663
  }
5576
- .navds-table__toggle-expand-button:focus-visible {
5577
- 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);
5578
5667
  }
5579
- @supports not selector(:focus-visible) {
5580
- .navds-table__toggle-expand-button:focus {
5581
- box-shadow: inset var(--a-shadow-focus);
5582
- }
5668
+ .navds-table__toggle-expand-cell--open > :where(.navds-table__toggle-expand-button) :where(.navds-table__expandable-icon) {
5669
+ transform: translateY(0) rotate(180deg);
5583
5670
  }
5584
- .navds-table__expandable-icon {
5585
- font-size: 1.5rem;
5671
+ .navds-table__toggle-expand-button:hover > :where(.navds-table__expandable-icon) {
5672
+ transform: translateY(1px);
5586
5673
  }
5587
- .navds-table--small .navds-table__expandable-icon {
5588
- 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);
5589
5676
  }
5590
- .navds-table__toggle-expand-button:hover .navds-table__expandable-icon {
5591
- transform: translateY(1px);
5677
+ .navds-table__toggle-expand-button:focus-visible {
5678
+ outline: none;
5679
+ box-shadow: var(--a-shadow-focus);
5592
5680
  }
5593
- .navds-table__toggle-expand-cell--open .navds-table__expandable-icon {
5594
- 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
+ }
5595
5686
  }
5596
- .navds-table__toggle-expand-cell--open .navds-table__toggle-expand-button:hover .navds-table__expandable-icon {
5597
- 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;
5598
5695
  }
5599
5696
  .navds-table__expanded-row-cell {
5600
5697
  padding: 0;
@@ -5606,10 +5703,10 @@ button.navds-stepper__step {
5606
5703
  border-bottom: 1px solid var(--ac-table-row-border, var(--a-border-default));
5607
5704
  }
5608
5705
  .navds-table__expanded-row-content {
5609
- padding: var(--a-spacing-4) 4.25rem;
5706
+ padding: var(--a-spacing-4) calc(var(--a-spacing-2) + 3rem);
5610
5707
  }
5611
5708
  .navds-table--small .navds-table__expanded-row-content {
5612
- padding: var(--a-spacing-2) var(--a-spacing-12);
5709
+ padding: var(--a-spacing-2) calc(var(--a-spacing-2) + 3rem);
5613
5710
  }
5614
5711
  .navds-tabs__tablist-wrapper {
5615
5712
  box-shadow: inset 0 -1px 0 0 var(--ac-tabs-border, var(--a-border-divider));
package/dist/tokens.json CHANGED
@@ -196,7 +196,10 @@
196
196
  },
197
197
  "modal": {
198
198
  "--ac-modal-bg": "--a-surface-default",
199
- "--ac-modal-backdrop": "--a-surface-backdrop"
199
+ "--ac-modal-border": "--a-border-subtle",
200
+ "--ac-modal-backdrop": "--a-surface-backdrop",
201
+ "--ac-modal-width-small": "450px",
202
+ "--ac-modal-width-medium": "700px"
200
203
  },
201
204
  "pagination": {
202
205
  "--ac-pagination-text": "--a-text-default",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/aksel-stylelint",
3
- "version": "4.12.1",
3
+ "version": "5.0.1",
4
4
  "author": "Aksel | NAV",
5
5
  "homepage": "https://aksel.nav.no/grunnleggende/kode/stylelint",
6
6
  "repository": {
@@ -35,8 +35,8 @@
35
35
  "dev": "yarn watch:lint"
36
36
  },
37
37
  "devDependencies": {
38
- "@navikt/ds-css": "^4.12.1",
39
- "@navikt/ds-tokens": "^4.12.1",
38
+ "@navikt/ds-css": "^5.0.1",
39
+ "@navikt/ds-tokens": "^5.0.1",
40
40
  "@types/jest": "^29.0.0",
41
41
  "concurrently": "7.2.1",
42
42
  "copyfiles": "2.4.1",