@norges-domstoler/dds-components 16.1.0 → 16.2.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/dist/index.css CHANGED
@@ -594,7 +594,7 @@
594
594
  }
595
595
  :where(.Input_input) {
596
596
  position: relative;
597
- color: var(--dds-text-color--default);
597
+ color: var(--dds-color-text-default);
598
598
  border: 1px solid var(--dds-color-border-default);
599
599
  background-color: var(--dds-color-surface-default);
600
600
  padding: var(--dds-spacing-x0-75) var(--dds-spacing-x1) var(--dds-spacing-x0-75) var(--dds-spacing-x0-75);
@@ -633,28 +633,26 @@
633
633
  -webkit-appearance: textfield;
634
634
  &:enabled:-moz-read-only {
635
635
  box-shadow: none;
636
- border: none;
637
- outline: none;
636
+ border: 1px solid var(--dds-color-border-default);
637
+ background-color: var(--dds-color-surface-field-disabled);
638
+ color: var(--dds-color-text-medium);
638
639
  cursor: default;
639
- background-color: transparent;
640
- padding-left: 0;
641
- padding-top: var(--dds-spacing-x0-125);
642
640
  }
643
641
  &:not(.Input_disabled).Input_read-only,
644
642
  &:enabled:read-only {
645
643
  box-shadow: none;
646
- border: none;
647
- outline: none;
644
+ border: 1px solid var(--dds-color-border-default);
645
+ background-color: var(--dds-color-surface-field-disabled);
646
+ color: var(--dds-color-text-medium);
648
647
  cursor: default;
649
- background-color: transparent;
650
- padding-left: 0;
651
- padding-top: var(--dds-spacing-x0-125);
652
648
  }
653
649
  &.Input_disabled,
654
650
  &:disabled {
655
- cursor: not-allowed;
656
- color: var(--dds-color-text-medium);
651
+ box-shadow: none;
652
+ border: 1px solid var(--dds-color-border-subtle);
657
653
  background-color: var(--dds-color-surface-field-disabled);
654
+ color: var(--dds-color-text-subtle);
655
+ cursor: not-allowed;
658
656
  }
659
657
  }
660
658
  :where(.Input_input--hover:hover) {
@@ -778,6 +776,18 @@
778
776
  flex-shrink: 0;
779
777
  }
780
778
 
779
+ /* src/components/Typography/Label/Label.module.css */
780
+ .Label_read-only {
781
+ display: flex;
782
+ }
783
+ .Label_read-only__icon {
784
+ align-self: center;
785
+ flex-shrink: 0;
786
+ margin-inline-end: var(--dds-spacing-x0-125);
787
+ width: 1.25em;
788
+ height: 1.25em;
789
+ }
790
+
781
791
  /* src/components/helpers/Paper/Paper.module.css */
782
792
  .Paper_container {
783
793
  box-sizing: border-box;
@@ -1300,7 +1310,7 @@
1300
1310
  width: max-content;
1301
1311
  font-variant-numeric: tabular-nums;
1302
1312
  outline: none;
1303
- &:focus:not([aria-readonly]) {
1313
+ &:focus {
1304
1314
  background-color: var(--dds-color-surface-action-selected);
1305
1315
  color: var(--dds-color-text-on-action);
1306
1316
  }
@@ -1310,7 +1320,7 @@
1310
1320
  width: 100%;
1311
1321
  font-variant-numeric: tabular-nums;
1312
1322
  pointer-events: none;
1313
- .DateInput_segment:focus:not([aria-readonly]) & {
1323
+ .DateInput_segment:focus & {
1314
1324
  color: var(--dds-color-text-on-action);
1315
1325
  }
1316
1326
  }
@@ -1325,7 +1335,13 @@
1325
1335
  justify-content: center;
1326
1336
  margin-inline: -1px 0;
1327
1337
  padding: var(--dds-spacing-x0-25);
1328
- color: var(--dds-color-text-default);
1338
+ color: var(--dds-color-icon-default);
1339
+ }
1340
+ .DateInput_icon-wrapper--disabled {
1341
+ color: var(--dds-color-icon-subtle);
1342
+ }
1343
+ .DateInput_icon-wrapper--readonly {
1344
+ color: var(--dds-color-icon-medium);
1329
1345
  }
1330
1346
  .DateInput_icon-wrapper--small {
1331
1347
  margin-block: calc(0px - var(--dds-icon-size-medium));
@@ -1352,6 +1368,9 @@
1352
1368
  color: var(--dds-color-text-subtle);
1353
1369
  }
1354
1370
  }
1371
+ .DateInput_popover-button--readonly:disabled {
1372
+ color: var(--dds-color-text-medium);
1373
+ }
1355
1374
  .DateInput_popover {
1356
1375
  z-index: 100;
1357
1376
  border-radius: var(--dds-border-radius-1);
@@ -1403,11 +1422,11 @@
1403
1422
  }
1404
1423
  .DateInput_calendar__cell-button--default {
1405
1424
  background-color: transparent;
1406
- color: var(--dds-text-color--default);
1425
+ color: var(--dds-color-text-default);
1407
1426
  &:hover {
1408
1427
  background-color: var(--dds-color-surface-hover-default);
1409
1428
  border-color: var(--dds-color-border-action-hover);
1410
- color: var(--dds-text-color--default);
1429
+ color: var(--dds-color-text-default);
1411
1430
  }
1412
1431
  }
1413
1432
  .DateInput_calendar__cell-button--selected {
@@ -2340,6 +2359,9 @@
2340
2359
  .Select_container--disabled {
2341
2360
  cursor: not-allowed;
2342
2361
  }
2362
+ .Select_container--readonly {
2363
+ cursor: default;
2364
+ }
2343
2365
  .Select_inner-single-value {
2344
2366
  overflow: hidden;
2345
2367
  text-overflow: ellipsis;
@@ -2352,16 +2374,16 @@
2352
2374
  margin-left: -1px;
2353
2375
  }
2354
2376
  .Select_control {
2355
- &:hover .Select_dropdown-indicator,
2377
+ &:hover:not(.Select_control--readonly) .Select_dropdown-indicator,
2356
2378
  &:focus-within .Select_dropdown-indicator {
2357
2379
  color: var(--dds-color-icon-action-hover);
2358
2380
  }
2359
- &.Select_control--readonly .Select_dropdown-indicator {
2360
- color: transparent;
2361
- }
2362
- &.Select_control--disabled .Select_dropdown-indicator {
2363
- color: transparent;
2364
- }
2381
+ }
2382
+ .Select_control--readonly .Select_dropdown-indicator {
2383
+ pointer-events: none;
2384
+ }
2385
+ .Select_control--disabled .Select_dropdown-indicator {
2386
+ pointer-events: none;
2365
2387
  }
2366
2388
 
2367
2389
  /* src/components/Select/NativeSelect/NativeSelect.module.css */
@@ -2385,14 +2407,21 @@
2385
2407
  }
2386
2408
  &:disabled {
2387
2409
  cursor: not-allowed;
2388
- color: var(--dds-color-text-medium);
2410
+ color: var(--dds-color-text-subtle);
2389
2411
  background-color: var(--dds-color-surface-field-disabled);
2412
+ border-color: var(--dds-color-border-subtle);
2413
+ + svg {
2414
+ color: var(--dds-color-icon-subtle);
2415
+ }
2390
2416
  }
2391
2417
  option {
2392
2418
  background-color: var(--dds-color-surface-default);
2393
2419
  &:hover {
2394
2420
  background-color: var(--dds-color-surface-hover-default);
2395
2421
  }
2422
+ @media (prefers-reduced-motion: no-preference) {
2423
+ transition: background-color 0.2s;
2424
+ }
2396
2425
  }
2397
2426
  optgroup {
2398
2427
  font-weight: normal;
@@ -2401,13 +2430,13 @@
2401
2430
  }
2402
2431
  .NativeSelect_select--readonly {
2403
2432
  box-shadow: none;
2404
- pointer-events: none;
2405
- border: none;
2406
2433
  outline: none;
2407
2434
  cursor: default;
2408
- background-color: transparent;
2409
- padding-left: 0;
2410
- padding-top: var(--dds-spacing-x0-125);
2435
+ color: var(--dds-color-text-subtle);
2436
+ background-color: var(--dds-color-surface-field-disabled);
2437
+ + svg {
2438
+ color: var(--dds-color-icon-subtle);
2439
+ }
2411
2440
  }
2412
2441
  .NativeSelect_select--medium {
2413
2442
  height: calc(1.5em + var(--dds-spacing-x0-75) + var(--dds-spacing-x0-75) + 2px);
@@ -2421,6 +2450,12 @@
2421
2450
  height: calc(1.5em + var(--dds-spacing-x0-25) + var(--dds-spacing-x0-25) + 2px);
2422
2451
  padding-right: var(--dds-spacing-x1);
2423
2452
  }
2453
+ .NativeSelect_select--multiple {
2454
+ padding-right: 0;
2455
+ &.NativeSelect_select--readonly option {
2456
+ background-color: var(--dds-color-surface-field-disabled);
2457
+ }
2458
+ }
2424
2459
  .NativeSelect_icon {
2425
2460
  position: absolute;
2426
2461
  top: 50%;
@@ -2677,7 +2712,7 @@
2677
2712
  var(--dds-focus-transition);
2678
2713
  }
2679
2714
  }
2680
- &:hover input:enabled:not(:checked) ~ .SelectionControl_selection-control {
2715
+ &:hover:not(.SelectionControl_label--readonly) input:enabled:not(:checked) ~ .SelectionControl_selection-control {
2681
2716
  background-color: var(--dds-color-surface-hover-default);
2682
2717
  box-shadow: inset 0 0 0 1px var(--dds-color-border-action-hover);
2683
2718
  border-color: var(--dds-color-border-action-hover);
@@ -2687,8 +2722,13 @@
2687
2722
  border-color: var(--dds-color-surface-action-selected);
2688
2723
  background-color: var(--dds-color-surface-action-selected);
2689
2724
  }
2690
- &:hover input:checked:enabled[type=checkbox] ~ .SelectionControl_selection-control,
2691
- &:hover input:enabled[data-indeterminate=true] ~ .SelectionControl_selection-control {
2725
+ &.SelectionControl_label--readonly input:checked:enabled ~ .SelectionControl_selection-control,
2726
+ &.SelectionControl_label--readonly input:enabled[data-indeterminate=true] ~ .SelectionControl_selection-control {
2727
+ border-color: var(--dds-color-surface-action-selected-disabled);
2728
+ background-color: var(--dds-color-surface-action-selected-disabled);
2729
+ }
2730
+ &:hover:not(.SelectionControl_label--readonly) input:checked:enabled[type=checkbox] ~ .SelectionControl_selection-control,
2731
+ &:hover:not(.SelectionControl_label--readonly) input:enabled[data-indeterminate=true] ~ .SelectionControl_selection-control {
2692
2732
  background-color: var(--dds-color-surface-action-hover);
2693
2733
  border-color: var(--dds-color-surface-action-hover);
2694
2734
  }
@@ -2740,6 +2780,7 @@
2740
2780
  }
2741
2781
  .SelectionControl_label--readonly {
2742
2782
  cursor: default;
2783
+ color: var(--dds-color-text-medium);
2743
2784
  input ~ .SelectionControl_selection-control {
2744
2785
  border-color: var(--dds-color-border-default);
2745
2786
  background-color: var(--dds-color-surface-field-disabled);
@@ -3119,7 +3160,14 @@
3119
3160
  }
3120
3161
 
3121
3162
  /* src/components/TextInput/TextInput.module.css */
3122
- .TextInput_container--medium {
3163
+ .TextInput_container {
3164
+ color: var(--dds-color-text-default);
3165
+ }
3166
+ .TextInput_container--readonly {
3167
+ color: var(--dds-color-text-medium);
3168
+ }
3169
+ .TextInput_container--disabled {
3170
+ color: var(--dds-color-text-subtle);
3123
3171
  }
3124
3172
  .TextInput_container--tiny {
3125
3173
  width: 210px;
@@ -3149,7 +3197,6 @@
3149
3197
  .TextInput_icon {
3150
3198
  position: absolute;
3151
3199
  z-index: 1;
3152
- color: var(--dds-color-icon-default);
3153
3200
  }
3154
3201
  .TextInput_icon--medium {
3155
3202
  left: var(--dds-spacing-x0-75);
@@ -3175,28 +3222,21 @@
3175
3222
  align-items: center;
3176
3223
  pointer-events: none;
3177
3224
  z-index: 1;
3178
- &.TextInput_prefix {
3179
- left: 0;
3180
- margin-left: 8px;
3181
- padding-right: 8px;
3182
- border-right: 1px solid var(--dds-color-border-default);
3183
- }
3184
- &.TextInput_suffix {
3185
- right: 0;
3186
- margin-right: 8px;
3187
- padding-left: 8px;
3188
- border-left: 1px solid var(--dds-color-border-default);
3189
- }
3190
- &.TextInput_prefix--readonly {
3191
- margin-left: 0;
3192
- padding-right: 0.5ch;
3193
- border-right: none;
3194
- }
3195
- &.TextInput_suffix--readonly {
3196
- margin-right: 0;
3197
- padding-left: 0.5ch;
3198
- border-left: none;
3199
- }
3225
+ }
3226
+ .TextInput_prefix {
3227
+ left: 0;
3228
+ margin-left: 8px;
3229
+ padding-right: 8px;
3230
+ border-right: 1px solid var(--dds-color-border-default);
3231
+ }
3232
+ .TextInput_suffix {
3233
+ right: 0;
3234
+ margin-right: 8px;
3235
+ padding-left: 8px;
3236
+ border-left: 1px solid var(--dds-color-border-default);
3237
+ }
3238
+ .TextInput_affix--disabled {
3239
+ border-color: var(--dds-color-border-subtle);
3200
3240
  }
3201
3241
  .TextInput_message-container {
3202
3242
  display: flex;