@navikt/ds-css 4.6.0 → 4.7.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.
@@ -1642,6 +1642,9 @@
1642
1642
  .navds-fieldset__legend {
1643
1643
  padding: 0;
1644
1644
  }
1645
+ .navds-fieldset--readonly > :where(.navds-fieldset__legend) {
1646
+ display: inline-flex;
1647
+ }
1645
1648
  .navds-fieldset:disabled > .navds-fieldset__legend,
1646
1649
  .navds-fieldset:disabled > .navds-fieldset__description {
1647
1650
  opacity: 0.3;
@@ -1674,10 +1677,14 @@
1674
1677
  .navds-form-field__subdescription {
1675
1678
  color: var(--ac-form-subdescription, var(--a-text-subtle));
1676
1679
  }
1680
+ .navds-form-field--readonly > :where(.navds-form-field__label) {
1681
+ display: inline-flex;
1682
+ }
1677
1683
  .navds-form-field__readonly-icon {
1684
+ margin-top: var(--a-spacing-05);
1678
1685
  margin-right: var(--a-spacing-2);
1679
- vertical-align: middle;
1680
- margin-bottom: 3px;
1686
+ flex-shrink: 0;
1687
+ align-self: flex-start;
1681
1688
  }
1682
1689
  .navds-error-summary {
1683
1690
  background-color: var(--ac-error-summary-bg, var(--a-surface-default));
@@ -1955,6 +1962,9 @@
1955
1962
  .navds-radio--readonly > :where(.navds-radio__input, .navds-radio__label) {
1956
1963
  cursor: default;
1957
1964
  }
1965
+ .navds-checkbox--readonly .navds-checkbox__label-text {
1966
+ display: inline-flex;
1967
+ }
1958
1968
  .navds-checkbox--readonly > .navds-checkbox__input:hover + .navds-checkbox__label,
1959
1969
  .navds-radio--readonly > .navds-radio__input:hover + .navds-radio__label {
1960
1970
  color: var(--a-text-default);
@@ -2232,6 +2242,9 @@
2232
2242
  .navds-switch--readonly .navds-switch__label-wrapper:hover {
2233
2243
  color: var(--a-text-default);
2234
2244
  }
2245
+ .navds-switch--readonly .navds-switch__label {
2246
+ display: inline-flex;
2247
+ }
2235
2248
  .navds-switch--readonly .navds-switch__thumb {
2236
2249
  background-color: var(--a-surface-subtle);
2237
2250
  box-shadow: 0 0 0 2px var(--a-border-default);
@@ -2552,6 +2565,253 @@
2552
2565
  z-index: 1;
2553
2566
  }
2554
2567
  }
2568
+ .navds-combobox__wrapper {
2569
+ display: flex;
2570
+ flex-direction: column;
2571
+ width: 100%;
2572
+ position: relative;
2573
+ }
2574
+ .navds-combobox__wrapper-inner {
2575
+ position: relative;
2576
+ display: flex;
2577
+ flex-direction: row;
2578
+ justify-content: space-between;
2579
+ width: 100%;
2580
+ border: 1px solid black;
2581
+ }
2582
+ .navds-combobox__wrapper-inner > :first-child {
2583
+ flex: 2;
2584
+ }
2585
+ .navds-combobox__wrapper-inner > :last-child {
2586
+ display: flex;
2587
+ flex-flow: row nowrap;
2588
+ }
2589
+ .navds-form-field--small .navds-combobox__wrapper-inner {
2590
+ padding: var(--a-spacing-1) calc(var(--a-spacing-3) / 2);
2591
+ }
2592
+ .navds-combobox__wrapper-inner:hover {
2593
+ cursor: text;
2594
+ }
2595
+ .navds-combobox__selected-options {
2596
+ gap: var(--a-spacing-2);
2597
+ }
2598
+ .navds-combobox__selected-options > li {
2599
+ margin: auto 0;
2600
+ border-radius: var(--a-border-radius-full);
2601
+ }
2602
+ .navds-combobox__selected-options > li:last-of-type {
2603
+ display: flex;
2604
+ flex: 1;
2605
+ }
2606
+ .navds-combobox__selected-options--no-bg {
2607
+ font-family: inherit;
2608
+ font-size: var(--a-font-size-large);
2609
+ font-weight: var(--a-font-weight-regular);
2610
+ letter-spacing: 0;
2611
+ line-height: var(--a-font-line-height-large);
2612
+ margin: 0;
2613
+ padding-left: calc(0.5rem - 4px);
2614
+ }
2615
+ .navds-combobox__input-wrapper {
2616
+ width: 100%;
2617
+ }
2618
+ .navds-combobox__input {
2619
+ z-index: 1;
2620
+ flex: 1;
2621
+ border: none;
2622
+ padding: 0;
2623
+ margin: 0;
2624
+ min-width: 10ch;
2625
+ width: 100%;
2626
+ }
2627
+ .navds-combobox__input:focus-visible {
2628
+ outline: none;
2629
+ border: none;
2630
+ box-shadow: none;
2631
+ }
2632
+ .navds-combobox__wrapper-inner:has(.navds-combobox__input:focus-visible) {
2633
+ box-shadow: 0 0 0 1px var(--a-surface-default) inset, var(--a-shadow-focus);
2634
+ box-shadow: var(--a-shadow-focus);
2635
+ }
2636
+ .navds-combobox__wrapper-inner:has(.navds-combobox__input:focus-visible).navds-combobox__wrapper-inner--virtually-unfocused {
2637
+ box-shadow: none;
2638
+ }
2639
+ @supports not selector(:focus-visible) {
2640
+ .navds-combobox__input:focus-visible {
2641
+ outline: none;
2642
+ border: none;
2643
+ box-shadow: none;
2644
+ }
2645
+
2646
+ .navds-combobox__wrapper-inner:has(.navds-combobox__input:focus) {
2647
+ box-shadow: 0 0 0 1px var(--a-surface-default) inset, var(--a-shadow-focus);
2648
+ box-shadow: var(--a-shadow-focus);
2649
+ }
2650
+
2651
+ .navds-combobox__wrapper-inner:has(.navds-combobox__input:focus).navds-combobox__wrapper-inner--virtually-unfocused {
2652
+ box-shadow: none;
2653
+ }
2654
+ }
2655
+ .navds-combobox__button-clear {
2656
+ border-radius: var(--a-border-radius-medium);
2657
+ color: var(--ac-combobox-clear-icon, var(--a-text-subtle));
2658
+ display: flex;
2659
+ justify-content: center;
2660
+ align-items: center;
2661
+ cursor: pointer;
2662
+ background: none;
2663
+ border: none;
2664
+ font-size: 1rem;
2665
+ padding: 0;
2666
+ }
2667
+ .navds-combobox__button-clear svg {
2668
+ width: 1.5rem;
2669
+ height: 1.5rem;
2670
+ }
2671
+ .navds-combobox__input::-webkit-search-cancel-button {
2672
+ display: none;
2673
+ }
2674
+ .navds-combobox__button-toggle-list {
2675
+ border-radius: var(--a-border-radius-medium);
2676
+ color: var(--a-text-default);
2677
+ display: flex;
2678
+ justify-content: center;
2679
+ align-items: center;
2680
+ cursor: pointer;
2681
+ background: none;
2682
+ border: none;
2683
+ font-size: 1rem;
2684
+ padding: 0;
2685
+ }
2686
+ .navds-combobox__button-clear:active:hover,
2687
+ .navds-combobox__button-toggle-list:active:hover {
2688
+ color: var(--ac-combobox-clear-icon-active, var(--a-text-action));
2689
+ }
2690
+ .navds-combobox__button-clear:hover,
2691
+ .navds-combobox__button-toggle-list:hover {
2692
+ color: var(--ac-combobox-clear-icon-hover, var(--a-text-action-selected));
2693
+ }
2694
+ .navds-combobox__button-toggle-list:focus-visible {
2695
+ box-shadow: 0 0 0 1px var(--a-surface-default) inset, var(--a-shadow-focus);
2696
+ box-shadow: var(--a-shadow-focus);
2697
+ outline: none;
2698
+ }
2699
+ @supports not selector(:focus-visible) {
2700
+ .navds-combobox__button-toggle-list:focus {
2701
+ box-shadow: 0 0 0 1px var(--a-surface-default) inset, var(--a-shadow-focus);
2702
+ box-shadow: var(--a-shadow-focus);
2703
+ outline: none;
2704
+ }
2705
+ }
2706
+ .navds-combobox__button-toggle-list svg {
2707
+ width: 1.5rem;
2708
+ height: 1.5rem;
2709
+ pointer-events: none;
2710
+ }
2711
+ .navds-form-field--small .navds-combobox__button-toggle-list svg,
2712
+ .navds-form-field--small .navds-combobox__button-clear svg {
2713
+ width: 1.25rem;
2714
+ height: 1.25rem;
2715
+ }
2716
+ /* dropdown list */
2717
+ .navds-combobox__list {
2718
+ max-height: 290px;
2719
+ overflow-y: auto;
2720
+ position: absolute;
2721
+ left: 0;
2722
+ right: 0;
2723
+ z-index: 9999;
2724
+ top: calc(100% + var(--a-spacing-2));
2725
+ list-style: none;
2726
+ margin: 0;
2727
+ border: 1px solid var(--ac-combobox-list-border-color, var(--a-border-divider));
2728
+ display: flex;
2729
+ flex-direction: column;
2730
+ align-items: flex-start;
2731
+ padding: 0;
2732
+ box-shadow: var(--a-shadow-small);
2733
+ border-radius: 4px;
2734
+ gap: 4px 0;
2735
+ background-color: var(--ac-combobox-list-bg, var(--a-surface-default));
2736
+ color: var(--ac-combobox-list-text, var(--a-text-default));
2737
+ }
2738
+ .navds-combobox__list--closed {
2739
+ display: none;
2740
+ }
2741
+ .navds-combobox__list svg {
2742
+ height: 1.5rem;
2743
+ width: 1.5rem;
2744
+ }
2745
+ .navds-combobox__list-item,
2746
+ .navds-combobox__list-item__no-options,
2747
+ .navds-combobox__list-item__new-option {
2748
+ display: flex;
2749
+ flex-direction: row;
2750
+ justify-content: space-between;
2751
+ align-items: center;
2752
+ padding: var(--a-spacing-3);
2753
+ width: 100%;
2754
+ background-color: var(--ac-combobox-list-item-bg, var(--a-surface-default));
2755
+ }
2756
+ .navds-form-field--small .navds-combobox__list-item,
2757
+ .navds-form-field--small .navds-combobox__list-item__no-options,
2758
+ .navds-form-field--small .navds-combobox__list-item__new-option {
2759
+ padding: calc(var(--a-spacing-3) / 2) var(--a-spacing-2);
2760
+ }
2761
+ .navds-combobox__list-item--loading {
2762
+ display: flex;
2763
+ justify-content: center;
2764
+ padding: var(--a-spacing-3);
2765
+ background-color: var(--ac-combobox-list-item-loading-bg, var(--a-surface-default));
2766
+ width: 100%;
2767
+ }
2768
+ .navds-combobox__list-item--focus,
2769
+ .navds-combobox__list-item:hover {
2770
+ background-color: var(--ac-combobox-list-item-hover-bg, var(--a-surface-hover));
2771
+ cursor: pointer;
2772
+ border-left: 4px solid var(--ac-combobox-list-item-hover-border-left, var(--a-border-strong));
2773
+ padding-left: calc(var(--a-spacing-3) - 4px);
2774
+ }
2775
+ .navds-combobox__list-item--selected {
2776
+ background-color: var(--ac-combobox-list-item-selected-bg, var(--a-surface-selected));
2777
+ }
2778
+ .navds-combobox__list-item--selected.navds-combobox__list-item--focus,
2779
+ .navds-combobox__list-item--selected:hover {
2780
+ background-color: var(--ac-combobox-list-item-selected-hover-bg, var(--a-surface-action-subtle-hover));
2781
+ border-left: 4px solid var(--ac-combobox-list-item-selected-hover-border-left, var(--a-border-focus));
2782
+ padding-left: calc(var(--a-spacing-3) - 4px);
2783
+ }
2784
+ .navds-combobox__list-item__new-option {
2785
+ border-bottom: 1px solid var(--a-border-divider);
2786
+ background: var(--a-surface-neutral-subtle);
2787
+ cursor: pointer;
2788
+ justify-content: flex-start;
2789
+ gap: 0.25rem;
2790
+ }
2791
+ .navds-combobox__list-item__new-option:hover {
2792
+ border-bottom: 1px solid var(--a-border-divider);
2793
+ background: var(--a-surface-neutral-subtle-hover);
2794
+ }
2795
+ .navds-combobox__list-item__new-option--focus {
2796
+ box-shadow: var(--a-shadow-focus) inset, var(--a-border-action) 0 0 0 5px inset;
2797
+ border-radius: 3px;
2798
+ }
2799
+ /* Mobile */
2800
+ @media (max-width: 479px) {
2801
+ .navds-combobox__button-toggle-list {
2802
+ right: 0.5rem;
2803
+ }
2804
+
2805
+ /* add bigger click area for input */
2806
+ .navds-combobox__input {
2807
+ min-width: min-content;
2808
+ padding: 0.75rem 0;
2809
+ }
2810
+
2811
+ .navds-combobox__selected-options {
2812
+ gap: var(--a-spacing-1);
2813
+ }
2814
+ }
2555
2815
  .navds-help-text__button {
2556
2816
  margin: 0;
2557
2817
  padding: 0;