@norges-domstoler/dds-components 16.1.0 → 16.3.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/README.md CHANGED
@@ -12,6 +12,12 @@ Sjekk ut [Elsa - domstolenes designsystem](https://design.domstol.no/) og [ Elsa
12
12
  pnpm add @norges-domstoler/dds-components
13
13
  ```
14
14
 
15
+ Importer styling av komponentene i CSS:
16
+
17
+ ```css
18
+ @import '@norges-domstoler/dds-components/index.css';
19
+ ```
20
+
15
21
  ## 🔨 Bruk
16
22
 
17
23
  ```js
@@ -42,6 +48,7 @@ Tilgjengelige komponenter:
42
48
 
43
49
  - Breadcrumbs
44
50
  - Button
51
+ - ButtonGroup
45
52
  - Card (inkludert CardAccordion)
46
53
  - Checkbox
47
54
  - Chip
@@ -56,6 +63,7 @@ Tilgjengelige komponenter:
56
63
  - GlobalMessage
57
64
  - Grid
58
65
  - Icon
66
+ - InlineButton
59
67
  - InputMessage
60
68
  - InternaHeader
61
69
  - List
@@ -91,7 +99,3 @@ Tilgjengelige komponenter:
91
99
  - Paragraph
92
100
  - Typography
93
101
  - VisuallyHidden
94
-
95
- ## ⌨️ For bidragsytere
96
-
97
- Sjekk ut [guiden for bidragsytere](https://design.domstol.no/987b33f71/p/34c962-bidra/b/3611d5).
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;
@@ -1049,9 +1059,6 @@
1049
1059
  min-width: 180px;
1050
1060
  max-width: 300px;
1051
1061
  box-shadow: var(--dds-shadow-1-onlight);
1052
- .OverflowMenu_divider {
1053
- margin-block: var(--dds-spacing-x0-75);
1054
- }
1055
1062
  }
1056
1063
  .OverflowMenu_list {
1057
1064
  display: flex;
@@ -1064,7 +1071,7 @@
1064
1071
  color: var(--dds-color-text-default);
1065
1072
  background-color: var(--dds-color-surface-default);
1066
1073
  text-decoration: none;
1067
- padding: var(--dds-spacing-x0-75) var(--dds-spacing-x1);
1074
+ padding: var(--dds-spacing-x0-75);
1068
1075
  gap: var(--dds-spacing-x0-25);
1069
1076
  }
1070
1077
  .OverflowMenu_list__item--link {
@@ -1090,11 +1097,16 @@
1090
1097
  font-size: var(--dds-font-body-sans-01-line-height);
1091
1098
  }
1092
1099
  .OverflowMenu_divider {
1093
- margin-inline: var(--dds-spacing-x1);
1100
+ margin-inline: var(--dds-spacing-x0-5);
1101
+ margin-block: var(--dds-spacing-x0);
1102
+ }
1103
+ .OverflowMenu_group-header {
1104
+ padding-inline: var(--dds-spacing-x0-75);
1105
+ padding-block-start: var(--dds-spacing-x0-75);
1094
1106
  }
1095
1107
 
1096
1108
  /* src/components/Divider/Divider.module.css */
1097
- .Divider_divider {
1109
+ :where(.Divider_divider) {
1098
1110
  border: 0;
1099
1111
  background-color: transparent;
1100
1112
  border-top: 1px solid;
@@ -1191,6 +1203,7 @@
1191
1203
  }
1192
1204
  .Card_container--navigation {
1193
1205
  text-decoration: none;
1206
+ display: block;
1194
1207
  &:hover {
1195
1208
  border-color: var(--dds-color-border-action-hover);
1196
1209
  box-shadow: inset 0 0 0 1px var(--dds-color-border-action-hover);
@@ -1300,7 +1313,7 @@
1300
1313
  width: max-content;
1301
1314
  font-variant-numeric: tabular-nums;
1302
1315
  outline: none;
1303
- &:focus:not([aria-readonly]) {
1316
+ &:focus {
1304
1317
  background-color: var(--dds-color-surface-action-selected);
1305
1318
  color: var(--dds-color-text-on-action);
1306
1319
  }
@@ -1310,7 +1323,7 @@
1310
1323
  width: 100%;
1311
1324
  font-variant-numeric: tabular-nums;
1312
1325
  pointer-events: none;
1313
- .DateInput_segment:focus:not([aria-readonly]) & {
1326
+ .DateInput_segment:focus & {
1314
1327
  color: var(--dds-color-text-on-action);
1315
1328
  }
1316
1329
  }
@@ -1325,7 +1338,13 @@
1325
1338
  justify-content: center;
1326
1339
  margin-inline: -1px 0;
1327
1340
  padding: var(--dds-spacing-x0-25);
1328
- color: var(--dds-color-text-default);
1341
+ color: var(--dds-color-icon-default);
1342
+ }
1343
+ .DateInput_icon-wrapper--disabled {
1344
+ color: var(--dds-color-icon-subtle);
1345
+ }
1346
+ .DateInput_icon-wrapper--readonly {
1347
+ color: var(--dds-color-icon-medium);
1329
1348
  }
1330
1349
  .DateInput_icon-wrapper--small {
1331
1350
  margin-block: calc(0px - var(--dds-icon-size-medium));
@@ -1352,6 +1371,9 @@
1352
1371
  color: var(--dds-color-text-subtle);
1353
1372
  }
1354
1373
  }
1374
+ .DateInput_popover-button--readonly:disabled {
1375
+ color: var(--dds-color-text-medium);
1376
+ }
1355
1377
  .DateInput_popover {
1356
1378
  z-index: 100;
1357
1379
  border-radius: var(--dds-border-radius-1);
@@ -1403,11 +1425,11 @@
1403
1425
  }
1404
1426
  .DateInput_calendar__cell-button--default {
1405
1427
  background-color: transparent;
1406
- color: var(--dds-text-color--default);
1428
+ color: var(--dds-color-text-default);
1407
1429
  &:hover {
1408
1430
  background-color: var(--dds-color-surface-hover-default);
1409
1431
  border-color: var(--dds-color-border-action-hover);
1410
- color: var(--dds-text-color--default);
1432
+ color: var(--dds-color-text-default);
1411
1433
  }
1412
1434
  }
1413
1435
  .DateInput_calendar__cell-button--selected {
@@ -2340,6 +2362,9 @@
2340
2362
  .Select_container--disabled {
2341
2363
  cursor: not-allowed;
2342
2364
  }
2365
+ .Select_container--readonly {
2366
+ cursor: default;
2367
+ }
2343
2368
  .Select_inner-single-value {
2344
2369
  overflow: hidden;
2345
2370
  text-overflow: ellipsis;
@@ -2352,16 +2377,16 @@
2352
2377
  margin-left: -1px;
2353
2378
  }
2354
2379
  .Select_control {
2355
- &:hover .Select_dropdown-indicator,
2380
+ &:hover:not(.Select_control--readonly) .Select_dropdown-indicator,
2356
2381
  &:focus-within .Select_dropdown-indicator {
2357
2382
  color: var(--dds-color-icon-action-hover);
2358
2383
  }
2359
- &.Select_control--readonly .Select_dropdown-indicator {
2360
- color: transparent;
2361
- }
2362
- &.Select_control--disabled .Select_dropdown-indicator {
2363
- color: transparent;
2364
- }
2384
+ }
2385
+ .Select_control--readonly .Select_dropdown-indicator {
2386
+ pointer-events: none;
2387
+ }
2388
+ .Select_control--disabled .Select_dropdown-indicator {
2389
+ pointer-events: none;
2365
2390
  }
2366
2391
 
2367
2392
  /* src/components/Select/NativeSelect/NativeSelect.module.css */
@@ -2385,14 +2410,21 @@
2385
2410
  }
2386
2411
  &:disabled {
2387
2412
  cursor: not-allowed;
2388
- color: var(--dds-color-text-medium);
2413
+ color: var(--dds-color-text-subtle);
2389
2414
  background-color: var(--dds-color-surface-field-disabled);
2415
+ border-color: var(--dds-color-border-subtle);
2416
+ + svg {
2417
+ color: var(--dds-color-icon-subtle);
2418
+ }
2390
2419
  }
2391
2420
  option {
2392
2421
  background-color: var(--dds-color-surface-default);
2393
2422
  &:hover {
2394
2423
  background-color: var(--dds-color-surface-hover-default);
2395
2424
  }
2425
+ @media (prefers-reduced-motion: no-preference) {
2426
+ transition: background-color 0.2s;
2427
+ }
2396
2428
  }
2397
2429
  optgroup {
2398
2430
  font-weight: normal;
@@ -2401,13 +2433,13 @@
2401
2433
  }
2402
2434
  .NativeSelect_select--readonly {
2403
2435
  box-shadow: none;
2404
- pointer-events: none;
2405
- border: none;
2406
2436
  outline: none;
2407
2437
  cursor: default;
2408
- background-color: transparent;
2409
- padding-left: 0;
2410
- padding-top: var(--dds-spacing-x0-125);
2438
+ color: var(--dds-color-text-subtle);
2439
+ background-color: var(--dds-color-surface-field-disabled);
2440
+ + svg {
2441
+ color: var(--dds-color-icon-subtle);
2442
+ }
2411
2443
  }
2412
2444
  .NativeSelect_select--medium {
2413
2445
  height: calc(1.5em + var(--dds-spacing-x0-75) + var(--dds-spacing-x0-75) + 2px);
@@ -2421,6 +2453,12 @@
2421
2453
  height: calc(1.5em + var(--dds-spacing-x0-25) + var(--dds-spacing-x0-25) + 2px);
2422
2454
  padding-right: var(--dds-spacing-x1);
2423
2455
  }
2456
+ .NativeSelect_select--multiple {
2457
+ padding-right: 0;
2458
+ &.NativeSelect_select--readonly option {
2459
+ background-color: var(--dds-color-surface-field-disabled);
2460
+ }
2461
+ }
2424
2462
  .NativeSelect_icon {
2425
2463
  position: absolute;
2426
2464
  top: 50%;
@@ -2677,7 +2715,7 @@
2677
2715
  var(--dds-focus-transition);
2678
2716
  }
2679
2717
  }
2680
- &:hover input:enabled:not(:checked) ~ .SelectionControl_selection-control {
2718
+ &:hover:not(.SelectionControl_label--readonly) input:enabled:not(:checked) ~ .SelectionControl_selection-control {
2681
2719
  background-color: var(--dds-color-surface-hover-default);
2682
2720
  box-shadow: inset 0 0 0 1px var(--dds-color-border-action-hover);
2683
2721
  border-color: var(--dds-color-border-action-hover);
@@ -2687,8 +2725,13 @@
2687
2725
  border-color: var(--dds-color-surface-action-selected);
2688
2726
  background-color: var(--dds-color-surface-action-selected);
2689
2727
  }
2690
- &:hover input:checked:enabled[type=checkbox] ~ .SelectionControl_selection-control,
2691
- &:hover input:enabled[data-indeterminate=true] ~ .SelectionControl_selection-control {
2728
+ &.SelectionControl_label--readonly input:checked:enabled ~ .SelectionControl_selection-control,
2729
+ &.SelectionControl_label--readonly input:enabled[data-indeterminate=true] ~ .SelectionControl_selection-control {
2730
+ border-color: var(--dds-color-surface-action-selected-disabled);
2731
+ background-color: var(--dds-color-surface-action-selected-disabled);
2732
+ }
2733
+ &:hover:not(.SelectionControl_label--readonly) input:checked:enabled[type=checkbox] ~ .SelectionControl_selection-control,
2734
+ &:hover:not(.SelectionControl_label--readonly) input:enabled[data-indeterminate=true] ~ .SelectionControl_selection-control {
2692
2735
  background-color: var(--dds-color-surface-action-hover);
2693
2736
  border-color: var(--dds-color-surface-action-hover);
2694
2737
  }
@@ -2740,6 +2783,7 @@
2740
2783
  }
2741
2784
  .SelectionControl_label--readonly {
2742
2785
  cursor: default;
2786
+ color: var(--dds-color-text-medium);
2743
2787
  input ~ .SelectionControl_selection-control {
2744
2788
  border-color: var(--dds-color-border-default);
2745
2789
  background-color: var(--dds-color-surface-field-disabled);
@@ -3119,7 +3163,14 @@
3119
3163
  }
3120
3164
 
3121
3165
  /* src/components/TextInput/TextInput.module.css */
3122
- .TextInput_container--medium {
3166
+ .TextInput_container {
3167
+ color: var(--dds-color-text-default);
3168
+ }
3169
+ .TextInput_container--readonly {
3170
+ color: var(--dds-color-text-medium);
3171
+ }
3172
+ .TextInput_container--disabled {
3173
+ color: var(--dds-color-text-subtle);
3123
3174
  }
3124
3175
  .TextInput_container--tiny {
3125
3176
  width: 210px;
@@ -3149,7 +3200,6 @@
3149
3200
  .TextInput_icon {
3150
3201
  position: absolute;
3151
3202
  z-index: 1;
3152
- color: var(--dds-color-icon-default);
3153
3203
  }
3154
3204
  .TextInput_icon--medium {
3155
3205
  left: var(--dds-spacing-x0-75);
@@ -3175,28 +3225,21 @@
3175
3225
  align-items: center;
3176
3226
  pointer-events: none;
3177
3227
  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
- }
3228
+ }
3229
+ .TextInput_prefix {
3230
+ left: 0;
3231
+ margin-left: 8px;
3232
+ padding-right: 8px;
3233
+ border-right: 1px solid var(--dds-color-border-default);
3234
+ }
3235
+ .TextInput_suffix {
3236
+ right: 0;
3237
+ margin-right: 8px;
3238
+ padding-left: 8px;
3239
+ border-left: 1px solid var(--dds-color-border-default);
3240
+ }
3241
+ .TextInput_affix--disabled {
3242
+ border-color: var(--dds-color-border-subtle);
3200
3243
  }
3201
3244
  .TextInput_message-container {
3202
3245
  display: flex;