@ibobbyts/svelte-ui-utils 0.5.1 → 0.5.3
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 +21 -0
- package/dist/dropdown/Dropdown.svelte +31 -6
- package/dist/dropdown/Dropdown.svelte.d.ts.map +1 -1
- package/dist/style.css +86 -27
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -890,6 +890,27 @@ inside a theme root:
|
|
|
890
890
|
}
|
|
891
891
|
```
|
|
892
892
|
|
|
893
|
+
### Overlay surface tokens
|
|
894
|
+
|
|
895
|
+
Dropdown menus render as floating overlays: they step the page background up
|
|
896
|
+
(`--suu-color-elevated`, derived from the surface/bg palette) and lift off the
|
|
897
|
+
page with `--suu-shadow-overlay` (a deep shadow plus a hairline ring so the
|
|
898
|
+
outline stays readable over host grid lines). Both resolve against the current
|
|
899
|
+
theme palette automatically.
|
|
900
|
+
|
|
901
|
+
Inside the menu, row semantics come from `--suu-dropdown-*` tokens declared on
|
|
902
|
+
`.suu-dropdown`: `--suu-dropdown-option-separator` (faint line between
|
|
903
|
+
options), `--suu-dropdown-group-border` / `--suu-dropdown-group-bg` /
|
|
904
|
+
`--suu-dropdown-group-text` (the section header band), and
|
|
905
|
+
`--suu-dropdown-option-hover-bg` / `--suu-dropdown-option-selected-bg` /
|
|
906
|
+
`--suu-dropdown-option-selected-hover-bg`. They are palette-derived color
|
|
907
|
+
mixes, so light and dark themes keep the same hierarchy: panel frame > group
|
|
908
|
+
band boundary > option separator, and selected > hover. Only override them for
|
|
909
|
+
a deliberately different overlay treatment.
|
|
910
|
+
|
|
911
|
+
下拉选项默认最小行高为 36px,分组标题为 32px;长文本仍可撑高。
|
|
912
|
+
分组通过中性底色、加粗标题和组内选项缩进区分,未分组的选项不缩进。
|
|
913
|
+
|
|
893
914
|
### Corner-radius tokens
|
|
894
915
|
|
|
895
916
|
All non-zero component corner radii come from the token definitions in
|
|
@@ -65,7 +65,11 @@
|
|
|
65
65
|
export let onTriggerClick: DropdownTriggerClickHandler | undefined = undefined;
|
|
66
66
|
|
|
67
67
|
const viewportMargin = 20;
|
|
68
|
-
const menuGap =
|
|
68
|
+
const menuGap = 4;
|
|
69
|
+
// The menu overhangs the trigger horizontally so its edges break from the
|
|
70
|
+
// host layout's lines (table column borders, adjacent inputs) and read as an
|
|
71
|
+
// independent floating layer instead of a continuation of the grid.
|
|
72
|
+
const menuOutset = 4;
|
|
69
73
|
const instanceId = ++dropdownInstanceCount;
|
|
70
74
|
|
|
71
75
|
let open = false;
|
|
@@ -715,6 +719,26 @@
|
|
|
715
719
|
resolvedPlacement = availableBelow >= availableAbove ? 'down' : 'up';
|
|
716
720
|
}
|
|
717
721
|
|
|
722
|
+
// The panel is only part of the menu: the search box and the menu borders
|
|
723
|
+
// also consume viewport budget. When the whole budget goes to the panel, the
|
|
724
|
+
// total menu grows taller than the available space and an upward portal menu
|
|
725
|
+
// computes a negative top that escapes the viewport. The difference between
|
|
726
|
+
// the rendered menu and its panel is exactly that non-panel chrome, whatever
|
|
727
|
+
// the current max-height is.
|
|
728
|
+
function measureMenuChromeHeight(): number {
|
|
729
|
+
if (!menuElement || typeof window === 'undefined') {
|
|
730
|
+
return 0;
|
|
731
|
+
}
|
|
732
|
+
const panelElement = menuElement.querySelector<HTMLElement>('.suu-dropdown__panel');
|
|
733
|
+
if (!panelElement) {
|
|
734
|
+
return 0;
|
|
735
|
+
}
|
|
736
|
+
return Math.max(
|
|
737
|
+
0,
|
|
738
|
+
menuElement.getBoundingClientRect().height - panelElement.getBoundingClientRect().height
|
|
739
|
+
);
|
|
740
|
+
}
|
|
741
|
+
|
|
718
742
|
async function updateViewportPanelMaxHeight() {
|
|
719
743
|
await tick();
|
|
720
744
|
|
|
@@ -742,7 +766,8 @@
|
|
|
742
766
|
resolvedPlacement === 'up'
|
|
743
767
|
? rect.top - viewportMargin - menuGap
|
|
744
768
|
: window.innerHeight - rect.bottom - viewportMargin - menuGap;
|
|
745
|
-
|
|
769
|
+
const availablePanelHeight = available - measureMenuChromeHeight();
|
|
770
|
+
viewportPanelMaxHeight = `${Math.max(0, Math.floor(availablePanelHeight))}px`;
|
|
746
771
|
// Apply the value directly before measuring: the reactive style binding on
|
|
747
772
|
// this node only lands in the next flush, so the first upward open would
|
|
748
773
|
// otherwise measure the fallback 100vh height and place the menu above the
|
|
@@ -762,12 +787,12 @@
|
|
|
762
787
|
)}px`;
|
|
763
788
|
if (menuAlign === 'right') {
|
|
764
789
|
portalMenuLeft = undefined;
|
|
765
|
-
portalMenuRight = `${Math.round(window.innerWidth - rect.right)}px`;
|
|
790
|
+
portalMenuRight = `${Math.max(0, Math.round(window.innerWidth - rect.right - menuOutset))}px`;
|
|
766
791
|
} else {
|
|
767
|
-
portalMenuLeft = `${Math.round(rect.left)}px`;
|
|
792
|
+
portalMenuLeft = `${Math.max(0, Math.round(rect.left - menuOutset))}px`;
|
|
768
793
|
portalMenuRight = undefined;
|
|
769
794
|
}
|
|
770
|
-
portalMenuWidth = `${Math.round(rect.width)}px`;
|
|
795
|
+
portalMenuWidth = `${Math.round(rect.width + menuOutset * 2)}px`;
|
|
771
796
|
}
|
|
772
797
|
|
|
773
798
|
function portalMenu(node: HTMLDivElement, enabled: boolean) {
|
|
@@ -1053,7 +1078,7 @@
|
|
|
1053
1078
|
aria-expanded={!collapsedGroupIndexes.has(groupIndex)}
|
|
1054
1079
|
on:click|stopPropagation={() => toggleGroup(groupIndex)}
|
|
1055
1080
|
>
|
|
1056
|
-
<span>{group.label}</span>
|
|
1081
|
+
<span class="suu-dropdown__group-title">{group.label}</span>
|
|
1057
1082
|
<span class="suu-dropdown__group-chevron" aria-hidden="true"></span>
|
|
1058
1083
|
</button>
|
|
1059
1084
|
{/if}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown/Dropdown.svelte.ts"],"names":[],"mappings":"AAOA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAER,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EAGnB,iBAAiB,EAGjB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,8BAA8B,EAC9B,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAE5B,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Dropdown.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/dropdown/Dropdown.svelte.ts"],"names":[],"mappings":"AAOA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAER,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EAGnB,iBAAiB,EAGjB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,8BAA8B,EAC9B,2BAA2B,EAC3B,iBAAiB,EACjB,2BAA2B,EAE5B,MAAM,YAAY,CAAC;AAs9BtB,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,QAAQ;SAXw3B,MAAM,GAAG,SAAS;YAAU,iBAAiB;;cAA8C,cAAc,EAAE;mBAAiB,mBAAmB,EAAE,GAAG,SAAS;IACniC,sFAAsF,mBAAkB,cAAc,EAAE;+BAA6B,MAAM,GAAG,OAAO,GAAG,MAAM;;iBAAuC,kBAAkB;mBAAiB,uBAAuB;kBAAgB,mBAAmB,GAAG,SAAS;;;wBAAoG,MAAM,GAAG,SAAS;kBAAgB,MAAM,GAAG,SAAS;eAAa,UAAU;kBAAgB,MAAM,GAAG,SAAS;oBAAkB,MAAM,GAAG,SAAS;gBAAc,MAAM,GAAG,SAAS;gBAAc,MAAM,GAAG,SAAS;gBAAc,iBAAiB;gBAAc,iBAAiB;;;;WAAuG,MAAM,GAAG,SAAS;;YAAsC,MAAM,GAAG,SAAS;eAAa,MAAM,GAAG,SAAS;eAAa,MAAM,GAAG,SAAS;gBAAc,MAAM,GAAG,SAAS;;eAAqC,8BAA8B,GAAG,SAAS;qBAAmB,2BAA2B,GAAG,SAAS;qBAAmB,2BAA2B,GAAG,SAAS;;;;;kBAUtiC,CAAC;AAC5E,KAAK,QAAQ,GAAG,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,eAAe,QAAQ,CAAC"}
|
package/dist/style.css
CHANGED
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
--suu-color-warning: #d97706;
|
|
13
13
|
--suu-color-info: #2563eb;
|
|
14
14
|
--suu-shadow: 0 12px 30px rgb(15 23 42 / 0.14);
|
|
15
|
+
/* Overlay surfaces (dropdown menus) float above the page: they step the page
|
|
16
|
+
background up toward the surface color instead of reusing it and get a
|
|
17
|
+
deep shadow plus a hairline ring so their outline stays readable even
|
|
18
|
+
where host grid lines (table borders, adjacent inputs) run under them.
|
|
19
|
+
The elevated token references the base palette lazily, so theme and
|
|
20
|
+
consumer-side remaps of surface/border apply automatically. */
|
|
21
|
+
--suu-color-elevated: color-mix(in srgb, var(--suu-color-surface) 45%, var(--suu-color-bg));
|
|
22
|
+
--suu-shadow-overlay: 0 12px 32px rgb(15 23 42 / 0.2), 0 0 0 1px rgb(15 23 42 / 0.06);
|
|
15
23
|
--suu-radius-xs: 4px;
|
|
16
24
|
--suu-radius-sm: 6px;
|
|
17
25
|
--suu-radius-md: 8px;
|
|
@@ -37,6 +45,7 @@
|
|
|
37
45
|
--suu-color-warning: #fbbf24;
|
|
38
46
|
--suu-color-info: #60a5fa;
|
|
39
47
|
--suu-shadow: 0 16px 34px rgb(0 0 0 / 0.32);
|
|
48
|
+
--suu-shadow-overlay: 0 12px 32px rgb(0 0 0 / 0.45), 0 0 0 1px rgb(255 255 255 / 0.025);
|
|
40
49
|
}
|
|
41
50
|
|
|
42
51
|
.suu-visually-hidden {
|
|
@@ -895,6 +904,16 @@
|
|
|
895
904
|
|
|
896
905
|
.suu-dropdown {
|
|
897
906
|
--suu-dropdown-space: 14px;
|
|
907
|
+
/* Menu row semantics, all derived from the theme palette so light and dark
|
|
908
|
+
keep the same ladder: panel frame > group band boundary > option
|
|
909
|
+
separator, and selected > hover. */
|
|
910
|
+
--suu-dropdown-option-separator: color-mix(in srgb, var(--suu-color-border) 24%, transparent);
|
|
911
|
+
--suu-dropdown-group-border: color-mix(in srgb, var(--suu-color-border) 80%, transparent);
|
|
912
|
+
--suu-dropdown-group-bg: color-mix(in srgb, var(--suu-color-muted) 18%, var(--suu-color-elevated));
|
|
913
|
+
--suu-dropdown-group-text: var(--suu-color-text);
|
|
914
|
+
--suu-dropdown-option-hover-bg: color-mix(in srgb, var(--suu-color-muted) 7%, var(--suu-color-elevated));
|
|
915
|
+
--suu-dropdown-option-selected-bg: color-mix(in srgb, var(--suu-color-accent) 12%, var(--suu-color-elevated));
|
|
916
|
+
--suu-dropdown-option-selected-hover-bg: color-mix(in srgb, var(--suu-color-accent) 18%, var(--suu-color-elevated));
|
|
898
917
|
|
|
899
918
|
position: relative;
|
|
900
919
|
display: inline-flex;
|
|
@@ -1018,18 +1037,28 @@
|
|
|
1018
1037
|
transform: translateY(-20%) rotate(45deg);
|
|
1019
1038
|
}
|
|
1020
1039
|
|
|
1040
|
+
/* The menu is a floating overlay, not a table that grew downward: its
|
|
1041
|
+
background steps above the page, the shadow ring keeps the outline readable
|
|
1042
|
+
where host grid lines run under it, and it overhangs the trigger by 4px on
|
|
1043
|
+
each side so its edges never sit on the same lines as the surrounding
|
|
1044
|
+
layout. Internal lines follow the --suu-dropdown-* row tokens so the
|
|
1045
|
+
ladder stays: panel frame > group band boundary > option separator. */
|
|
1021
1046
|
.suu-dropdown__menu {
|
|
1022
1047
|
position: absolute;
|
|
1023
|
-
top: calc(100% +
|
|
1024
|
-
right:
|
|
1048
|
+
top: calc(100% + 4px);
|
|
1049
|
+
right: -4px;
|
|
1025
1050
|
left: auto;
|
|
1026
1051
|
z-index: 100;
|
|
1027
|
-
min-width: 100
|
|
1052
|
+
min-width: calc(100% + 8px);
|
|
1028
1053
|
overflow: hidden;
|
|
1029
1054
|
border: 1px solid var(--suu-color-border);
|
|
1030
1055
|
border-radius: var(--suu-radius);
|
|
1031
|
-
background: var(--suu-color-
|
|
1032
|
-
box-shadow:
|
|
1056
|
+
background: var(--suu-color-elevated);
|
|
1057
|
+
box-shadow: var(--suu-shadow-overlay);
|
|
1058
|
+
/* Reset inherited host whitespace (e.g. a nowrap table cell) so every menu
|
|
1059
|
+
text — group titles, status labels — wraps by default; the single-line
|
|
1060
|
+
fit-content rules set nowrap explicitly where needed. */
|
|
1061
|
+
white-space: normal;
|
|
1033
1062
|
}
|
|
1034
1063
|
|
|
1035
1064
|
.suu-dropdown__menu--portal {
|
|
@@ -1053,17 +1082,17 @@
|
|
|
1053
1082
|
|
|
1054
1083
|
.suu-dropdown__menu--left:not(.suu-dropdown__menu--portal) {
|
|
1055
1084
|
right: auto;
|
|
1056
|
-
left:
|
|
1085
|
+
left: -4px;
|
|
1057
1086
|
}
|
|
1058
1087
|
|
|
1059
1088
|
.suu-dropdown__menu--right:not(.suu-dropdown__menu--portal) {
|
|
1060
|
-
right:
|
|
1089
|
+
right: -4px;
|
|
1061
1090
|
left: auto;
|
|
1062
1091
|
}
|
|
1063
1092
|
|
|
1064
1093
|
.suu-dropdown__menu--up:not(.suu-dropdown__menu--portal) {
|
|
1065
1094
|
top: auto;
|
|
1066
|
-
bottom: calc(100% +
|
|
1095
|
+
bottom: calc(100% + 4px);
|
|
1067
1096
|
}
|
|
1068
1097
|
|
|
1069
1098
|
.suu-dropdown__menu--fit-content:not(.suu-dropdown__menu--portal) {
|
|
@@ -1074,13 +1103,17 @@
|
|
|
1074
1103
|
min-width: max-content;
|
|
1075
1104
|
}
|
|
1076
1105
|
|
|
1077
|
-
|
|
1106
|
+
/* The single-line rules assume the menu stretches to its longest option, which
|
|
1107
|
+
only a non-portal menu does; a portal menu keeps the trigger's fixed width,
|
|
1108
|
+
so its options fall back to the base two-line wrapping label instead of
|
|
1109
|
+
being clipped at the menu edge. */
|
|
1110
|
+
.suu-dropdown__menu--fit-content:not(.suu-dropdown__menu--portal) .suu-dropdown__option {
|
|
1078
1111
|
width: auto;
|
|
1079
1112
|
min-width: 100%;
|
|
1080
1113
|
white-space: nowrap;
|
|
1081
1114
|
}
|
|
1082
1115
|
|
|
1083
|
-
.suu-dropdown__menu--fit-content .suu-dropdown__option .suu-dropdown__label {
|
|
1116
|
+
.suu-dropdown__menu--fit-content:not(.suu-dropdown__menu--portal) .suu-dropdown__option .suu-dropdown__label {
|
|
1084
1117
|
overflow: visible;
|
|
1085
1118
|
text-overflow: clip;
|
|
1086
1119
|
display: block;
|
|
@@ -1094,32 +1127,47 @@
|
|
|
1094
1127
|
max-height: var(--suu-dropdown-panel-max-height, 100vh);
|
|
1095
1128
|
overflow-y: auto;
|
|
1096
1129
|
overflow-x: hidden;
|
|
1097
|
-
background: var(--suu-color-
|
|
1130
|
+
background: var(--suu-color-elevated);
|
|
1098
1131
|
overscroll-behavior: contain;
|
|
1099
1132
|
}
|
|
1100
1133
|
|
|
1101
1134
|
.suu-dropdown__group + .suu-dropdown__group {
|
|
1102
|
-
border-top: 1px solid var(--suu-
|
|
1135
|
+
border-top: 1px solid var(--suu-dropdown-group-border);
|
|
1103
1136
|
}
|
|
1104
1137
|
|
|
1138
|
+
/* 分组用中性底色和粗体形成标题带,避免与蓝色选中态混淆。
|
|
1139
|
+
font 简写必须位于字号和字重之前,防止覆盖标题层级。 */
|
|
1105
1140
|
.suu-dropdown__group-label {
|
|
1106
1141
|
display: flex;
|
|
1107
1142
|
width: 100%;
|
|
1108
1143
|
border: 0;
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1144
|
+
border-bottom: 1px solid var(--suu-dropdown-group-border);
|
|
1145
|
+
min-height: 32px;
|
|
1146
|
+
padding: 6px 14px;
|
|
1147
|
+
background: var(--suu-dropdown-group-bg);
|
|
1148
|
+
color: var(--suu-dropdown-group-text);
|
|
1112
1149
|
cursor: pointer;
|
|
1113
|
-
font
|
|
1150
|
+
font: inherit;
|
|
1151
|
+
font-size: 0.8125em;
|
|
1114
1152
|
font-weight: 700;
|
|
1153
|
+
line-height: 1.3;
|
|
1115
1154
|
letter-spacing: 0.02em;
|
|
1116
|
-
font: inherit;
|
|
1117
1155
|
text-align: left;
|
|
1118
1156
|
align-items: center;
|
|
1119
1157
|
justify-content: space-between;
|
|
1120
1158
|
}
|
|
1121
1159
|
|
|
1160
|
+
/* A long group title must wrap inside a narrow menu: a flex item keeps its
|
|
1161
|
+
min-content width by default, which pushes unbroken names (IDs, hashes)
|
|
1162
|
+
past the menu edge instead of folding them. */
|
|
1163
|
+
.suu-dropdown__group-title {
|
|
1164
|
+
flex: 1 1 auto;
|
|
1165
|
+
min-width: 0;
|
|
1166
|
+
overflow-wrap: break-word;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1122
1169
|
.suu-dropdown__group-chevron {
|
|
1170
|
+
flex-shrink: 0;
|
|
1123
1171
|
width: 7px;
|
|
1124
1172
|
height: 7px;
|
|
1125
1173
|
border-right: 2px solid currentColor;
|
|
@@ -1132,12 +1180,15 @@
|
|
|
1132
1180
|
transform: rotate(45deg);
|
|
1133
1181
|
}
|
|
1134
1182
|
|
|
1183
|
+
/* 收紧单行选项的留白,长名称仍由内容撑高;分隔线保持弱于分组边界。 */
|
|
1135
1184
|
.suu-dropdown__option {
|
|
1136
|
-
display:
|
|
1185
|
+
display: flex;
|
|
1186
|
+
align-items: center;
|
|
1137
1187
|
width: 100%;
|
|
1138
|
-
|
|
1188
|
+
min-height: 36px;
|
|
1189
|
+
padding: 6px 14px;
|
|
1139
1190
|
border: 0;
|
|
1140
|
-
border-bottom: 1px solid var(--suu-
|
|
1191
|
+
border-bottom: 1px solid var(--suu-dropdown-option-separator);
|
|
1141
1192
|
background: transparent;
|
|
1142
1193
|
color: var(--suu-color-text);
|
|
1143
1194
|
cursor: pointer;
|
|
@@ -1145,14 +1196,13 @@
|
|
|
1145
1196
|
text-align: left;
|
|
1146
1197
|
}
|
|
1147
1198
|
|
|
1148
|
-
|
|
1149
|
-
|
|
1199
|
+
/* 仅有标题的组选项缩进,未分组的「未选择」等操作保持原始对齐。 */
|
|
1200
|
+
.suu-dropdown__group-label ~ .suu-dropdown__option {
|
|
1201
|
+
padding-inline-start: 24px;
|
|
1150
1202
|
}
|
|
1151
1203
|
|
|
1152
1204
|
.suu-dropdown--multiselect .suu-dropdown__option {
|
|
1153
|
-
display: flex;
|
|
1154
1205
|
gap: 10px;
|
|
1155
|
-
align-items: center;
|
|
1156
1206
|
}
|
|
1157
1207
|
|
|
1158
1208
|
.suu-dropdown__checkbox {
|
|
@@ -1189,15 +1239,24 @@
|
|
|
1189
1239
|
.suu-dropdown__option:hover,
|
|
1190
1240
|
.suu-dropdown__option:focus-visible,
|
|
1191
1241
|
.suu-dropdown__option--active {
|
|
1192
|
-
background: var(--suu-
|
|
1242
|
+
background: var(--suu-dropdown-option-hover-bg);
|
|
1193
1243
|
outline: none;
|
|
1194
1244
|
}
|
|
1195
1245
|
|
|
1246
|
+
/* The selected row is a clear area, not just colored text; hover on top of it
|
|
1247
|
+
deepens the tint one step so the two states stay distinguishable. */
|
|
1196
1248
|
.suu-dropdown__option[aria-selected='true'] {
|
|
1249
|
+
background: var(--suu-dropdown-option-selected-bg);
|
|
1197
1250
|
color: var(--suu-color-accent);
|
|
1198
1251
|
font-weight: 700;
|
|
1199
1252
|
}
|
|
1200
1253
|
|
|
1254
|
+
.suu-dropdown__option[aria-selected='true']:hover,
|
|
1255
|
+
.suu-dropdown__option[aria-selected='true']:focus-visible,
|
|
1256
|
+
.suu-dropdown__option[aria-selected='true'].suu-dropdown__option--active {
|
|
1257
|
+
background: var(--suu-dropdown-option-selected-hover-bg);
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1201
1260
|
.suu-dropdown__option--disabled,
|
|
1202
1261
|
.suu-dropdown__option:disabled {
|
|
1203
1262
|
cursor: not-allowed;
|
|
@@ -1210,8 +1269,8 @@
|
|
|
1210
1269
|
gap: 8px;
|
|
1211
1270
|
align-items: center;
|
|
1212
1271
|
padding: 8px 14px;
|
|
1213
|
-
border-bottom: 1px solid var(--suu-
|
|
1214
|
-
background: var(--suu-color-
|
|
1272
|
+
border-bottom: 1px solid var(--suu-dropdown-group-border);
|
|
1273
|
+
background: var(--suu-color-surface);
|
|
1215
1274
|
}
|
|
1216
1275
|
|
|
1217
1276
|
.suu-dropdown__search-icon {
|