@danske/sapphire-css 39.0.1 → 40.0.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/build/themes/cjs/default-dark.js +1 -0
- package/build/themes/cjs/default.js +1 -0
- package/build/themes/cjs/index.d.ts +1 -0
- package/build/themes/esm/default-dark.js +1 -0
- package/build/themes/esm/default.js +1 -0
- package/build/themes/esm/index.d.ts +1 -0
- package/components/accordion/accordion.module.css +26 -26
- package/components/avatar/avatar.module.css +55 -78
- package/components/avatar/avatar.module.css.d.ts +16 -21
- package/components/backdrop/backdrop.module.css +5 -5
- package/components/badge/badge.module.css +76 -324
- package/components/badge/badge.module.css.d.ts +16 -34
- package/components/button/button.module.css +180 -263
- package/components/button/button.module.css.d.ts +4 -8
- package/components/buttonGroup/buttonGroup.module.css +39 -13
- package/components/calendar/calendar.module.css +64 -125
- package/components/calendar/calendar.module.css.d.ts +0 -7
- package/components/checkbox/checkbox.module.css +102 -69
- package/components/checkbox/checkbox.module.css.d.ts +1 -1
- package/components/contextualHelp/contextualHelp.module.css +7 -7
- package/components/dateField/dateField.module.css +42 -29
- package/components/dateField/dateField.module.css.d.ts +3 -2
- package/components/dialog/dialog.module.css +3 -3
- package/components/dropzone/dropzone.module.css +19 -21
- package/components/feedbackMessage/feedbackMessage.module.css +2 -40
- package/components/feedbackMessage/feedbackMessage.module.css.d.ts +0 -6
- package/components/field/field.module.css +22 -13
- package/components/field/field.module.css.d.ts +2 -2
- package/components/fieldGroup/fieldGroup.module.css +3 -3
- package/components/filterDropdown/filterDropdown.module.css +1 -1
- package/components/flag/flag.module.css +6 -6
- package/components/icon/icon.module.css +31 -4
- package/components/icon/icon.module.css.d.ts +6 -0
- package/components/iconButton/iconButton.module.css +237 -189
- package/components/iconButton/iconButton.module.css.d.ts +2 -3
- package/components/label/label.module.css +4 -5
- package/components/link/link.module.css +24 -54
- package/components/link/link.module.css.d.ts +1 -4
- package/components/list/list.module.css +20 -33
- package/components/listbox/listbox.module.css +109 -131
- package/components/listbox/listbox.module.css.d.ts +2 -4
- package/components/modalLayout/modalLayout.module.css +11 -12
- package/components/notificationBadge/notificationBadge.module.css +18 -15
- package/components/pagination/pagination.module.css +9 -9
- package/components/panel/panel.module.css +3 -1
- package/components/popover/popover.module.css +3 -2
- package/components/radio/radio.module.css +32 -9
- package/components/searchField/searchField.module.css +24 -25
- package/components/segmentedControl/segmentedControl.module.css +15 -17
- package/components/select/select.module.css +34 -18
- package/components/select/select.module.css.d.ts +2 -0
- package/components/skeleton/skeleton.module.css +5 -2
- package/components/spinner/spinner.module.css +3 -3
- package/components/surface/surface.module.css +2 -2
- package/components/switch/switch.module.css +49 -46
- package/components/switch/switch.module.css.d.ts +2 -2
- package/components/table/table.module.css +164 -136
- package/components/table/table.module.css.d.ts +5 -6
- package/components/tabs/tabs.module.css +24 -20
- package/components/tag/tag.module.css +16 -30
- package/components/tag/tag.module.css.d.ts +1 -1
- package/components/text/text.module.css +69 -82
- package/components/text/text.module.css.d.ts +19 -14
- package/components/textField/textField.module.css +45 -35
- package/components/textField/textField.module.css.d.ts +2 -2
- package/components/toast/toast.module.css +33 -153
- package/components/toast/toast.module.css.d.ts +2 -6
- package/components/tooltip/tooltip.module.css +7 -6
- package/package.json +4 -4
- package/themes/default-dark.js +1 -0
- package/themes/default.js +1 -0
- package/themes/index.d.ts +1 -0
- package/components/heading/heading.module.css +0 -95
- package/components/heading/heading.module.css.d.ts +0 -12
- package/components/labeledValue/labeledValue.module.css +0 -10
- package/components/labeledValue/labeledValue.module.css.d.ts +0 -7
- package/components/paragraph/paragraph.module.css +0 -32
- package/components/paragraph/paragraph.module.css.d.ts +0 -7
|
@@ -16,14 +16,13 @@
|
|
|
16
16
|
display: inline;
|
|
17
17
|
|
|
18
18
|
font-family: var(--sapphire-semantic-font-name-default);
|
|
19
|
-
font-size: var(--sapphire-semantic-size-font-text-lg);
|
|
20
|
-
line-height: var(--sapphire-semantic-size-line-height-md);
|
|
21
19
|
cursor: pointer;
|
|
22
20
|
border-radius: var(--sapphire-semantic-size-radius-xs);
|
|
23
21
|
|
|
24
22
|
text-decoration-skip-ink: none;
|
|
25
23
|
|
|
26
24
|
outline: none;
|
|
25
|
+
color: var(--sapphire-semantic-color-foreground-action-link-default);
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
/* Disabled state for all variants */
|
|
@@ -35,64 +34,35 @@
|
|
|
35
34
|
/**
|
|
36
35
|
* Skin rules
|
|
37
36
|
*/
|
|
38
|
-
|
|
39
|
-
.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
.sapphire-link--primary:not(:disabled):not(.is-disabled):not(:active):not(
|
|
46
|
-
.is-active
|
|
47
|
-
).is-hover {
|
|
48
|
-
color: var(--sapphire-semantic-color-content-link-primary-hover);
|
|
37
|
+
.sapphire-link:not(.sapphire-link--secondary):not(:disabled):not(
|
|
38
|
+
.is-disabled
|
|
39
|
+
):not(:active):not(.is-active):not(.js-hover):hover,
|
|
40
|
+
.sapphire-link:not(.sapphire-link--secondary):not(:disabled):not(
|
|
41
|
+
.is-disabled
|
|
42
|
+
):not(:active):not(.is-active).is-hover {
|
|
43
|
+
color: var(--sapphire-semantic-color-foreground-action-link-hover);
|
|
49
44
|
}
|
|
50
|
-
.sapphire-link
|
|
51
|
-
.sapphire-link
|
|
52
|
-
color: var(--sapphire-semantic-color-content-link-primary-default);
|
|
45
|
+
.sapphire-link.is-focus,
|
|
46
|
+
.sapphire-link:not(.js-focus):focus-visible {
|
|
53
47
|
text-decoration-style: double;
|
|
54
48
|
}
|
|
55
|
-
.sapphire-link
|
|
56
|
-
.sapphire-link
|
|
57
|
-
|
|
58
|
-
color: var(--sapphire-semantic-color-content-link-primary-active);
|
|
49
|
+
.sapphire-link:not(.sapphire-link--secondary).is-focus,
|
|
50
|
+
.sapphire-link:not(.sapphire-link--secondary):not(.js-focus):focus-visible {
|
|
51
|
+
color: var(--sapphire-semantic-color-foreground-action-link-default);
|
|
59
52
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
.sapphire-link
|
|
67
|
-
.is-active
|
|
68
|
-
):not(.js-hover):hover,
|
|
69
|
-
.sapphire-link--secondary:not(:disabled):not(.is-disabled):not(:active):not(
|
|
70
|
-
.is-active
|
|
71
|
-
).is-hover {
|
|
72
|
-
color: var(--sapphire-semantic-color-content-link-secondary-hover);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.sapphire-link--secondary.is-focus,
|
|
76
|
-
.sapphire-link--secondary:not(.js-focus):focus-visible {
|
|
77
|
-
color: var(--sapphire-semantic-color-content-link-secondary-default);
|
|
78
|
-
text-decoration-style: double;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.sapphire-link--secondary:not(:disabled):not(.is-disabled).is-active,
|
|
82
|
-
.sapphire-link--secondary:not(:disabled):not(.is-disabled):active,
|
|
83
|
-
.sapphire-link--secondary:not(:disabled):not(
|
|
53
|
+
.sapphire-link:not(.sapphire-link--secondary):not(:disabled):not(
|
|
54
|
+
.is-disabled
|
|
55
|
+
).is-active,
|
|
56
|
+
.sapphire-link:not(.sapphire-link--secondary):not(:disabled):not(
|
|
57
|
+
.is-disabled
|
|
58
|
+
):active,
|
|
59
|
+
.sapphire-link:not(.sapphire-link--secondary):not(:disabled):not(
|
|
84
60
|
.is-disabled
|
|
85
61
|
):focus-visible:active {
|
|
86
|
-
color: var(--sapphire-semantic-color-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Size variations
|
|
91
|
-
*/
|
|
92
|
-
.sapphire-link--md {
|
|
93
|
-
font-size: var(--sapphire-semantic-size-font-text-md);
|
|
62
|
+
color: var(--sapphire-semantic-color-foreground-action-link-active);
|
|
94
63
|
}
|
|
95
64
|
|
|
96
|
-
|
|
97
|
-
|
|
65
|
+
/* secondary */
|
|
66
|
+
.sapphire-link--secondary {
|
|
67
|
+
color: var(--sapphire-semantic-color-foreground-primary);
|
|
98
68
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
declare const styles: {
|
|
2
2
|
readonly "sapphire-link": string;
|
|
3
3
|
readonly "is-disabled": string;
|
|
4
|
-
readonly "sapphire-link--
|
|
4
|
+
readonly "sapphire-link--secondary": string;
|
|
5
5
|
readonly "is-active": string;
|
|
6
6
|
readonly "js-hover": string;
|
|
7
7
|
readonly "is-hover": string;
|
|
8
8
|
readonly "is-focus": string;
|
|
9
9
|
readonly "js-focus": string;
|
|
10
|
-
readonly "sapphire-link--secondary": string;
|
|
11
|
-
readonly "sapphire-link--md": string;
|
|
12
|
-
readonly "sapphire-link--sm": string;
|
|
13
10
|
};
|
|
14
11
|
export = styles;
|
|
15
12
|
|
|
@@ -26,11 +26,9 @@
|
|
|
26
26
|
position: relative;
|
|
27
27
|
display: flex;
|
|
28
28
|
justify-content: space-between;
|
|
29
|
-
padding: var(--sapphire-semantic-size-spacing-
|
|
30
|
-
var(--sapphire-semantic-size-spacing-
|
|
31
|
-
background
|
|
32
|
-
--sapphire-semantic-color-background-action-tertiary-ghost-default
|
|
33
|
-
);
|
|
29
|
+
padding: var(--sapphire-semantic-size-spacing-sm)
|
|
30
|
+
var(--sapphire-semantic-size-spacing-md);
|
|
31
|
+
background: var(--sapphire-semantic-color-background-action-tertiary-default);
|
|
34
32
|
outline: none;
|
|
35
33
|
font-family: var(--sapphire-semantic-font-name-default);
|
|
36
34
|
}
|
|
@@ -74,12 +72,12 @@ instead of being applied on the list item itself */
|
|
|
74
72
|
* Same as outermost element (li) as this should control padding instead
|
|
75
73
|
* if element is a (href prop has value) or button (action prop has value).
|
|
76
74
|
*/
|
|
77
|
-
padding: var(--sapphire-semantic-size-spacing-
|
|
78
|
-
var(--sapphire-semantic-size-spacing-
|
|
75
|
+
padding: var(--sapphire-semantic-size-spacing-sm)
|
|
76
|
+
var(--sapphire-semantic-size-spacing-md);
|
|
79
77
|
|
|
80
78
|
/* Counterstyling anything passed as custom content wrapper */
|
|
81
79
|
text-decoration: none;
|
|
82
|
-
background
|
|
80
|
+
background: inherit;
|
|
83
81
|
color: inherit;
|
|
84
82
|
font-family: inherit;
|
|
85
83
|
font-size: inherit;
|
|
@@ -90,17 +88,8 @@ instead of being applied on the list item itself */
|
|
|
90
88
|
}
|
|
91
89
|
|
|
92
90
|
.sapphire-list--negative-margin-self {
|
|
93
|
-
margin-left: calc(
|
|
94
|
-
|
|
95
|
-
-1
|
|
96
|
-
);
|
|
97
|
-
width: calc(
|
|
98
|
-
100% +
|
|
99
|
-
(
|
|
100
|
-
var(--sapphire-semantic-size-spacing-data-collection-item-horizontal-lg) *
|
|
101
|
-
2
|
|
102
|
-
)
|
|
103
|
-
);
|
|
91
|
+
margin-left: calc(var(--sapphire-semantic-size-spacing-md) * -1);
|
|
92
|
+
width: calc(100% + (var(--sapphire-semantic-size-spacing-md) * 2));
|
|
104
93
|
}
|
|
105
94
|
|
|
106
95
|
.sapphire-list__item--interactive:disabled,
|
|
@@ -122,7 +111,7 @@ instead of being applied on the list item itself */
|
|
|
122
111
|
*/
|
|
123
112
|
.sapphire-list__item--interactive:not(.is-focus, :not(.js-focus):focus),
|
|
124
113
|
.sapphire-list__item:not(:has(.sapphire-list__item--interactive)) {
|
|
125
|
-
box-shadow: inset 0px -1px 0px 0px var(--sapphire-semantic-color-border-
|
|
114
|
+
box-shadow: inset 0px -1px 0px 0px var(--sapphire-semantic-color-border-secondary);
|
|
126
115
|
}
|
|
127
116
|
/* For not virtualized list */
|
|
128
117
|
.sapphire-list--without-last-divider:not(:has([role="presentation"] > [role="presentation"]))
|
|
@@ -170,9 +159,7 @@ instead of being applied on the list item itself */
|
|
|
170
159
|
.sapphire-list__item--interactive:not(.js-hover):not(
|
|
171
160
|
[aria-disabled='true']
|
|
172
161
|
):not(:disabled):not(:active):hover {
|
|
173
|
-
background
|
|
174
|
-
--sapphire-semantic-color-background-action-secondary-default
|
|
175
|
-
);
|
|
162
|
+
background: var(--sapphire-semantic-color-background-action-tertiary-hover);
|
|
176
163
|
}
|
|
177
164
|
|
|
178
165
|
/*
|
|
@@ -209,19 +196,19 @@ instead of being applied on the list item itself */
|
|
|
209
196
|
.sapphire-list__item-content-left {
|
|
210
197
|
display: flex;
|
|
211
198
|
align-items: center;
|
|
212
|
-
margin-right: var(--sapphire-semantic-size-spacing-
|
|
199
|
+
margin-right: var(--sapphire-semantic-size-spacing-sm);
|
|
213
200
|
/* This was added to accommodate nowrap + hidden text overflow situations */
|
|
214
201
|
min-width: 0;
|
|
215
|
-
gap: var(--sapphire-semantic-size-spacing-
|
|
202
|
+
gap: var(--sapphire-semantic-size-spacing-sm);
|
|
216
203
|
}
|
|
217
204
|
|
|
218
205
|
.sapphire-list__item-content-right {
|
|
219
206
|
display: flex;
|
|
220
207
|
align-items: center;
|
|
221
208
|
text-align: right;
|
|
222
|
-
margin-left: var(--sapphire-semantic-size-spacing-
|
|
223
|
-
color: var(--sapphire-semantic-color-
|
|
224
|
-
gap: var(--sapphire-semantic-size-spacing-
|
|
209
|
+
margin-left: var(--sapphire-semantic-size-spacing-sm);
|
|
210
|
+
color: var(--sapphire-semantic-color-foreground-primary);
|
|
211
|
+
gap: var(--sapphire-semantic-size-spacing-sm);
|
|
225
212
|
}
|
|
226
213
|
|
|
227
214
|
.sapphire-list__item-text {
|
|
@@ -238,14 +225,14 @@ instead of being applied on the list item itself */
|
|
|
238
225
|
}
|
|
239
226
|
|
|
240
227
|
.sapphire-list__item-text-primary {
|
|
241
|
-
color: var(--sapphire-semantic-color-
|
|
228
|
+
color: var(--sapphire-semantic-color-foreground-primary);
|
|
242
229
|
line-height: var(--sapphire-semantic-size-line-height-md);
|
|
243
|
-
font-size: var(--sapphire-semantic-size-font-
|
|
244
|
-
font-weight: var(--sapphire-semantic-font-weight-default-
|
|
230
|
+
font-size: var(--sapphire-semantic-size-font-body-md);
|
|
231
|
+
font-weight: var(--sapphire-semantic-font-weight-default-medium);
|
|
245
232
|
}
|
|
246
233
|
|
|
247
234
|
.sapphire-list__item-text-secondary {
|
|
248
|
-
color: var(--sapphire-semantic-color-
|
|
235
|
+
color: var(--sapphire-semantic-color-foreground-secondary);
|
|
249
236
|
line-height: var(--sapphire-semantic-size-line-height-md);
|
|
250
|
-
font-size: var(--sapphire-semantic-size-font-
|
|
237
|
+
font-size: var(--sapphire-semantic-size-font-body-sm);
|
|
251
238
|
}
|
|
@@ -5,6 +5,15 @@
|
|
|
5
5
|
list-style: none;
|
|
6
6
|
outline: none;
|
|
7
7
|
font-family: var(--sapphire-semantic-font-name-default);
|
|
8
|
+
/**
|
|
9
|
+
* spacing between container and list items
|
|
10
|
+
*/
|
|
11
|
+
--sapphire-listbox-spacing-outer: var(--sapphire-semantic-size-spacing-3xs);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* gap between list items
|
|
15
|
+
*/
|
|
16
|
+
--sapphire-listbox-items-gap: var(--sapphire-semantic-size-spacing-4xs);
|
|
8
17
|
|
|
9
18
|
/**
|
|
10
19
|
* tldr; Please inspect the listbox without these adding props, it's easier
|
|
@@ -24,8 +33,7 @@
|
|
|
24
33
|
*/
|
|
25
34
|
|
|
26
35
|
padding: calc(
|
|
27
|
-
var(--sapphire-
|
|
28
|
-
var(--sapphire-semantic-size-spacing-5)
|
|
36
|
+
var(--sapphire-listbox-spacing-outer) - var(--sapphire-listbox-items-gap)
|
|
29
37
|
)
|
|
30
38
|
0;
|
|
31
39
|
|
|
@@ -50,9 +58,9 @@
|
|
|
50
58
|
display: flex;
|
|
51
59
|
justify-content: space-between;
|
|
52
60
|
align-items: center;
|
|
53
|
-
padding: var(--sapphire-
|
|
54
|
-
var(--sapphire-
|
|
55
|
-
color: var(--sapphire-semantic-color-
|
|
61
|
+
padding: var(--sapphire-listbox-items-gap)
|
|
62
|
+
var(--sapphire-listbox-spacing-outer);
|
|
63
|
+
color: var(--sapphire-semantic-color-foreground-action-on-tertiary-default);
|
|
56
64
|
outline: none;
|
|
57
65
|
cursor: pointer;
|
|
58
66
|
text-decoration: none;
|
|
@@ -66,17 +74,10 @@
|
|
|
66
74
|
min-width: max-content;
|
|
67
75
|
}
|
|
68
76
|
|
|
69
|
-
.sapphire-listbox__item--danger
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
.sapphire-listbox__item--selected {
|
|
74
|
-
color: var(--sapphire-semantic-color-content-selection-selected-default);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.sapphire-listbox__item--selected .sapphire-listbox__content {
|
|
78
|
-
background-color: var(
|
|
79
|
-
--sapphire-semantic-color-background-selection-selected-default
|
|
77
|
+
.sapphire-listbox__item--danger,
|
|
78
|
+
.sapphire-listbox__item--danger .sapphire-listbox__secondary-text {
|
|
79
|
+
color: var(
|
|
80
|
+
--sapphire-semantic-color-foreground-action-on-danger-tertiary-default
|
|
80
81
|
);
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -88,58 +89,65 @@
|
|
|
88
89
|
* max-width set to mitigate the issue of not being able to set a max-width on the popover the
|
|
89
90
|
* listbox is rendered in, in use cases like Select.
|
|
90
91
|
*/
|
|
91
|
-
max-width: calc(100vw - 2 * var(--sapphire-semantic-size-icon-
|
|
92
|
+
max-width: calc(100vw - 2 * var(--sapphire-semantic-size-icon-sm));
|
|
92
93
|
display: grid;
|
|
93
94
|
grid-auto-flow: column;
|
|
94
95
|
align-items: center;
|
|
95
|
-
gap: var(--sapphire-semantic-size-spacing-
|
|
96
|
+
gap: var(--sapphire-semantic-size-spacing-xs);
|
|
96
97
|
/*
|
|
97
|
-
* We want the left-side icon column to not take space if it's empty.
|
|
98
|
-
* right-side "checkmark" icon column should always take space even if
|
|
99
|
-
* checkmark isn't there. This is to make sure the listbox doesn't jump
|
|
100
|
-
* selecting items that add the checkmark in the last column
|
|
98
|
+
* We want the left-side icon column to not take space if it's empty in the default case.
|
|
99
|
+
* The right-side "checkmark" icon column should always take space even if
|
|
100
|
+
* the checkmark isn't there. This is to make sure the listbox doesn't jump
|
|
101
|
+
* when selecting items that add the checkmark in the last column
|
|
101
102
|
*/
|
|
102
|
-
grid-template-columns: auto 1fr
|
|
103
|
+
grid-template-columns: [left-icon] auto [text-content] 1fr [right-icon] auto;
|
|
103
104
|
padding: calc(
|
|
104
|
-
var(--sapphire-semantic-size-spacing-
|
|
105
|
-
var(--sapphire-semantic-size-spacing-
|
|
105
|
+
var(--sapphire-semantic-size-spacing-sm) -
|
|
106
|
+
var(--sapphire-semantic-size-spacing-4xs)
|
|
106
107
|
)
|
|
107
|
-
var(--sapphire-semantic-size-spacing-
|
|
108
|
+
var(--sapphire-semantic-size-spacing-sm);
|
|
108
109
|
border-radius: var(--sapphire-semantic-size-radius-sm);
|
|
109
110
|
transition-property: opacity, background-color, color;
|
|
110
111
|
transition-duration: var(--sapphire-semantic-time-fade-quick);
|
|
111
|
-
transition-timing-function:
|
|
112
|
-
|
|
113
|
-
min-height: var(--sapphire-semantic-size-height-control-xs);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.sapphire-listbox--md .sapphire-listbox__content {
|
|
117
|
-
gap: var(--sapphire-semantic-size-spacing-25);
|
|
118
|
-
grid-template-columns: auto 1fr var(--sapphire-semantic-size-icon-md);
|
|
119
|
-
padding: calc(
|
|
120
|
-
var(--sapphire-semantic-size-spacing-20) -
|
|
121
|
-
var(--sapphire-semantic-size-spacing-5)
|
|
122
|
-
)
|
|
123
|
-
var(--sapphire-semantic-size-spacing-25);
|
|
112
|
+
transition-timing-function: var(--sapphire-semantic-transitions-fade);
|
|
124
113
|
}
|
|
125
114
|
|
|
126
|
-
.sapphire-listbox--
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
115
|
+
.sapphire-listbox--selection .sapphire-listbox__content {
|
|
116
|
+
/*
|
|
117
|
+
* In this case, the right-side "checkmark" icon column should always take
|
|
118
|
+
* space even if the checkmark isn't there. This is to make sure the listbox
|
|
119
|
+
* doesn't jump when selecting items that add the checkmark in the last
|
|
120
|
+
* column
|
|
121
|
+
*/
|
|
122
|
+
grid-template-columns: [left-icon] var(--sapphire-semantic-size-icon-sm) [text-content] 1fr [right-icon] auto;
|
|
134
123
|
}
|
|
135
124
|
|
|
136
125
|
/* Icon content */
|
|
137
126
|
.sapphire-listbox__icon {
|
|
138
127
|
line-height: 0;
|
|
128
|
+
align-self: start;
|
|
129
|
+
/* to align with the centered text even when the item has a description */
|
|
130
|
+
padding-top: calc(
|
|
131
|
+
(
|
|
132
|
+
(
|
|
133
|
+
var(--sapphire-semantic-size-font-body-sm) *
|
|
134
|
+
var(--sapphire-semantic-size-line-height-md)
|
|
135
|
+
) - var(--sapphire-semantic-size-icon-sm)
|
|
136
|
+
) / 2
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.sapphire-listbox__icon:last-child {
|
|
141
|
+
grid-column: right-icon / span 1;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.sapphire-listbox__icon:first-child {
|
|
145
|
+
grid-column: left-icon / span 1;
|
|
139
146
|
}
|
|
140
147
|
|
|
141
148
|
/* Text content */
|
|
142
149
|
.sapphire-listbox__text-container {
|
|
150
|
+
grid-column: text-content / span 1;
|
|
143
151
|
line-height: var(--sapphire-semantic-size-line-height-md);
|
|
144
152
|
}
|
|
145
153
|
|
|
@@ -147,40 +155,20 @@
|
|
|
147
155
|
* When there is no icon before the content we want the content
|
|
148
156
|
* to stretch 2 columns out of the 3.
|
|
149
157
|
*/
|
|
150
|
-
.sapphire-
|
|
158
|
+
.sapphire-listbox:not(.sapphire-listbox--selection)
|
|
159
|
+
.sapphire-listbox__text-container:first-child {
|
|
151
160
|
grid-column: span 2;
|
|
152
161
|
}
|
|
153
162
|
|
|
154
163
|
.sapphire-listbox__primary-text {
|
|
155
|
-
font-weight: var(--sapphire-semantic-font-weight-default-
|
|
156
|
-
font-size: var(--sapphire-semantic-size-font-
|
|
164
|
+
font-weight: var(--sapphire-semantic-font-weight-default-regular);
|
|
165
|
+
font-size: var(--sapphire-semantic-size-font-body-sm);
|
|
157
166
|
}
|
|
158
167
|
|
|
159
168
|
.sapphire-listbox__secondary-text {
|
|
160
169
|
font-weight: var(--sapphire-semantic-font-weight-default-regular);
|
|
161
|
-
font-size: var(--sapphire-semantic-size-font-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
.sapphire-listbox--md .sapphire-listbox__primary-text {
|
|
165
|
-
font-size: var(--sapphire-semantic-size-font-text-md);
|
|
166
|
-
}
|
|
167
|
-
.sapphire-listbox--sm .sapphire-listbox__primary-text {
|
|
168
|
-
font-size: var(--sapphire-semantic-size-font-text-sm);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.sapphire-listbox--md .sapphire-listbox__secondary-text {
|
|
172
|
-
font-size: var(--sapphire-semantic-size-font-text-sm);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.sapphire-listbox--sm .sapphire-listbox__secondary-text {
|
|
176
|
-
font-size: var(--sapphire-semantic-size-font-text-sm);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.sapphire-listbox__item:not(.sapphire-listbox__item--danger):not(
|
|
180
|
-
.sapphire-listbox__item--selected
|
|
181
|
-
)
|
|
182
|
-
.sapphire-listbox__secondary-text {
|
|
183
|
-
color: var(--sapphire-semantic-color-content-default-secondary);
|
|
170
|
+
font-size: var(--sapphire-semantic-size-font-body-xs);
|
|
171
|
+
color: var(--sapphire-semantic-color-foreground-secondary);
|
|
184
172
|
}
|
|
185
173
|
|
|
186
174
|
.sapphire-listbox__item.is-disabled {
|
|
@@ -194,42 +182,32 @@
|
|
|
194
182
|
}
|
|
195
183
|
|
|
196
184
|
.sapphire-listbox__section-header {
|
|
197
|
-
font-size: var(--sapphire-semantic-size-font-
|
|
198
|
-
color: var(--sapphire-semantic-color-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
var(--sapphire-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
.sapphire-listbox--sm .sapphire-listbox__section-header {
|
|
214
|
-
font-size: var(--sapphire-semantic-size-font-text-sm);
|
|
215
|
-
padding: var(--sapphire-semantic-size-spacing-20)
|
|
216
|
-
var(--sapphire-semantic-size-spacing-30)
|
|
217
|
-
var(--sapphire-semantic-size-spacing-10)
|
|
218
|
-
var(--sapphire-semantic-size-spacing-30);
|
|
185
|
+
font-size: var(--sapphire-semantic-size-font-body-xs);
|
|
186
|
+
color: var(--sapphire-semantic-color-foreground-primary);
|
|
187
|
+
font-weight: var(--sapphire-semantic-font-weight-default-medium);
|
|
188
|
+
padding: calc(
|
|
189
|
+
var(--sapphire-semantic-size-spacing-md) -
|
|
190
|
+
var(--sapphire-listbox-items-gap)
|
|
191
|
+
)
|
|
192
|
+
calc(
|
|
193
|
+
var(--sapphire-semantic-size-spacing-sm) +
|
|
194
|
+
var(--sapphire-listbox-spacing-outer)
|
|
195
|
+
)
|
|
196
|
+
var(--sapphire-semantic-size-spacing-3xs)
|
|
197
|
+
calc(
|
|
198
|
+
var(--sapphire-semantic-size-spacing-sm) +
|
|
199
|
+
var(--sapphire-listbox-spacing-outer)
|
|
200
|
+
);
|
|
219
201
|
}
|
|
220
202
|
|
|
221
203
|
.sapphire-listbox__separator {
|
|
222
204
|
height: var(--sapphire-semantic-size-border-sm);
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
margin-bottom: calc(
|
|
230
|
-
var(--sapphire-semantic-size-spacing-10) -
|
|
231
|
-
var(--sapphire-semantic-size-spacing-5)
|
|
232
|
-
);
|
|
205
|
+
background: var(--sapphire-semantic-color-border-secondary);
|
|
206
|
+
margin: var(--sapphire-listbox-items-gap)
|
|
207
|
+
calc(
|
|
208
|
+
var(--sapphire-semantic-size-spacing-sm) +
|
|
209
|
+
var(--sapphire-listbox-spacing-outer)
|
|
210
|
+
);
|
|
233
211
|
}
|
|
234
212
|
|
|
235
213
|
/* Focus */
|
|
@@ -247,10 +225,8 @@
|
|
|
247
225
|
.sapphire-listbox__content,
|
|
248
226
|
.sapphire-listbox__item:not(.is-disabled):not(.js-hover):not(.is-active):hover
|
|
249
227
|
.sapphire-listbox__content {
|
|
250
|
-
color: var(--sapphire-semantic-color-
|
|
251
|
-
background
|
|
252
|
-
--sapphire-semantic-color-background-selection-unselected-hover
|
|
253
|
-
);
|
|
228
|
+
color: var(--sapphire-semantic-color-foreground-action-on-tertiary-hover);
|
|
229
|
+
background: var(--sapphire-semantic-color-background-action-tertiary-hover);
|
|
254
230
|
}
|
|
255
231
|
|
|
256
232
|
.sapphire-listbox__item--danger:not(.is-disabled):not(.is-active).is-hover
|
|
@@ -259,45 +235,47 @@
|
|
|
259
235
|
.is-active
|
|
260
236
|
):hover
|
|
261
237
|
.sapphire-listbox__content {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
--sapphire-semantic-color-background-action-danger-default
|
|
238
|
+
background: var(
|
|
239
|
+
--sapphire-semantic-color-background-action-danger-tertiary-hover
|
|
265
240
|
);
|
|
266
241
|
}
|
|
267
242
|
|
|
268
|
-
.sapphire-listbox__item--
|
|
243
|
+
.sapphire-listbox__item--danger:not(.is-disabled):not(.is-active).is-hover
|
|
269
244
|
.sapphire-listbox__content,
|
|
270
|
-
.sapphire-listbox__item--
|
|
271
|
-
|
|
245
|
+
.sapphire-listbox__item--danger:not(.is-disabled):not(.is-active).is-hover
|
|
246
|
+
.sapphire-listbox__secondary-text,
|
|
247
|
+
.sapphire-listbox__item--danger:not(.is-disabled):not(.js-hover):not(
|
|
248
|
+
.is-active
|
|
272
249
|
):hover
|
|
273
|
-
.sapphire-listbox__content
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
250
|
+
.sapphire-listbox__content,
|
|
251
|
+
.sapphire-listbox__item--danger:not(.is-disabled):not(.js-hover):not(
|
|
252
|
+
.is-active
|
|
253
|
+
):hover
|
|
254
|
+
.sapphire-listbox__secondary-text {
|
|
255
|
+
color: var(
|
|
256
|
+
--sapphire-semantic-color-foreground-action-on-danger-tertiary-hover
|
|
277
257
|
);
|
|
278
258
|
}
|
|
279
259
|
|
|
280
260
|
/* Active */
|
|
281
261
|
|
|
282
262
|
.sapphire-listbox__item:not(.is-disabled).is-active .sapphire-listbox__content {
|
|
283
|
-
color: var(--sapphire-semantic-color-
|
|
284
|
-
background
|
|
285
|
-
--sapphire-semantic-color-background-selection-unselected-active
|
|
286
|
-
);
|
|
263
|
+
color: var(--sapphire-semantic-color-foreground-action-on-tertiary-active);
|
|
264
|
+
background: var(--sapphire-semantic-color-background-action-tertiary-active);
|
|
287
265
|
}
|
|
288
266
|
|
|
289
267
|
.sapphire-listbox__item--danger:not(.is-disabled).is-active
|
|
290
268
|
.sapphire-listbox__content {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
--sapphire-semantic-color-background-action-danger-hover
|
|
269
|
+
background: var(
|
|
270
|
+
--sapphire-semantic-color-background-action-danger-tertiary-active
|
|
294
271
|
);
|
|
295
272
|
}
|
|
296
273
|
|
|
297
|
-
.sapphire-listbox__item--
|
|
298
|
-
.sapphire-listbox__content
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
274
|
+
.sapphire-listbox__item--danger:not(.is-disabled).is-active
|
|
275
|
+
.sapphire-listbox__content,
|
|
276
|
+
.sapphire-listbox__item--danger:not(.is-disabled).is-active
|
|
277
|
+
.sapphire-listbox__secondary-text {
|
|
278
|
+
color: var(
|
|
279
|
+
--sapphire-semantic-color-foreground-action-on-danger-tertiary-active
|
|
302
280
|
);
|
|
303
281
|
}
|
|
@@ -2,14 +2,12 @@ declare const styles: {
|
|
|
2
2
|
readonly "sapphire-listbox": string;
|
|
3
3
|
readonly "sapphire-listbox__item": string;
|
|
4
4
|
readonly "sapphire-listbox__item--danger": string;
|
|
5
|
-
readonly "sapphire-
|
|
5
|
+
readonly "sapphire-listbox__secondary-text": string;
|
|
6
6
|
readonly "sapphire-listbox__content": string;
|
|
7
|
-
readonly "sapphire-listbox--
|
|
8
|
-
readonly "sapphire-listbox--sm": string;
|
|
7
|
+
readonly "sapphire-listbox--selection": string;
|
|
9
8
|
readonly "sapphire-listbox__icon": string;
|
|
10
9
|
readonly "sapphire-listbox__text-container": string;
|
|
11
10
|
readonly "sapphire-listbox__primary-text": string;
|
|
12
|
-
readonly "sapphire-listbox__secondary-text": string;
|
|
13
11
|
readonly "is-disabled": string;
|
|
14
12
|
readonly "sapphire-listbox__section": string;
|
|
15
13
|
readonly "sapphire-listbox__section-header": string;
|