@danske/sapphire-css 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/LICENSE +7 -0
- package/README.md +57 -0
- package/build/themes/cjs/default-dark.d.ts +3 -0
- package/build/themes/cjs/default-dark.js +8 -0
- package/build/themes/cjs/default.d.ts +3 -0
- package/build/themes/cjs/default.js +8 -0
- package/build/themes/cjs/index.d.ts +1 -0
- package/build/themes/cjs/index.js +16 -0
- package/build/themes/cjs/june-dark.d.ts +4 -0
- package/build/themes/cjs/june-dark.js +9 -0
- package/build/themes/cjs/june.d.ts +4 -0
- package/build/themes/cjs/june.js +9 -0
- package/build/themes/esm/default-dark.d.ts +3 -0
- package/build/themes/esm/default-dark.js +3 -0
- package/build/themes/esm/default.d.ts +3 -0
- package/build/themes/esm/default.js +3 -0
- package/build/themes/esm/index.d.ts +1 -0
- package/build/themes/esm/index.js +1 -0
- package/build/themes/esm/june-dark.d.ts +4 -0
- package/build/themes/esm/june-dark.js +4 -0
- package/build/themes/esm/june.d.ts +4 -0
- package/build/themes/esm/june.js +4 -0
- package/components/accordion/accordion.module.css.d.ts +19 -0
- package/components/avatar/avatar.module.css.d.ts +27 -0
- package/components/backdrop/backdrop.module.css +8 -0
- package/components/backdrop/backdrop.module.css.d.ts +5 -0
- package/components/badge/badge.module.css +121 -0
- package/components/badge/badge.module.css.d.ts +16 -0
- package/components/button/button.module.css +278 -0
- package/components/button/button.module.css.d.ts +23 -0
- package/components/buttonGroup/buttonGroup.module.css +24 -0
- package/components/buttonGroup/buttonGroup.module.css.d.ts +10 -0
- package/components/calendar/calendar.module.css +406 -0
- package/components/calendar/calendar.module.css.d.ts +47 -0
- package/components/checkbox/checkbox.module.css +182 -0
- package/components/checkbox/checkbox.module.css.d.ts +18 -0
- package/components/contextualHelp/contextualHelp.module.css +35 -0
- package/components/contextualHelp/contextualHelp.module.css.d.ts +7 -0
- package/components/dateField/dateField.module.css +239 -0
- package/components/dateField/dateField.module.css.d.ts +22 -0
- package/components/dialog/dialog.module.css +81 -0
- package/components/dialog/dialog.module.css.d.ts +15 -0
- package/components/feedbackMessage/feedbackMessage.module.css +42 -0
- package/components/feedbackMessage/feedbackMessage.module.css.d.ts +10 -0
- package/components/field/field.module.css.d.ts +17 -0
- package/components/fieldGroup/fieldGroup.module.css +64 -0
- package/components/fieldGroup/fieldGroup.module.css.d.ts +12 -0
- package/components/heading/heading.module.css +143 -0
- package/components/heading/heading.module.css.d.ts +12 -0
- package/components/icon/icon.module.css +14 -0
- package/components/icon/icon.module.css.d.ts +8 -0
- package/components/iconButton/iconButton.module.css +225 -0
- package/components/iconButton/iconButton.module.css.d.ts +19 -0
- package/components/label/label.module.css.d.ts +9 -0
- package/components/link/link.module.css +35 -0
- package/components/link/link.module.css.d.ts +10 -0
- package/components/list/list.module.css +160 -0
- package/components/list/list.module.css.d.ts +19 -0
- package/components/listbox/listbox.module.css +211 -0
- package/components/listbox/listbox.module.css.d.ts +21 -0
- package/components/notificationBadge/notificationBadge.module.css.d.ts +16 -0
- package/components/pagination/pagination.module.css +44 -0
- package/components/pagination/pagination.module.css.d.ts +8 -0
- package/components/panel/panel.module.css +87 -0
- package/components/panel/panel.module.css.d.ts +18 -0
- package/components/paragraph/paragraph.module.css +35 -0
- package/components/paragraph/paragraph.module.css.d.ts +8 -0
- package/components/popover/popover.module.css +39 -0
- package/components/popover/popover.module.css.d.ts +8 -0
- package/components/radio/radio.module.css +117 -0
- package/components/radio/radio.module.css.d.ts +14 -0
- package/components/searchField/searchField.module.css +148 -0
- package/components/searchField/searchField.module.css.d.ts +14 -0
- package/components/segmentedControl/segmentedControl.module.css +140 -0
- package/components/segmentedControl/segmentedControl.module.css.d.ts +16 -0
- package/components/select/select.module.css +166 -0
- package/components/select/select.module.css.d.ts +19 -0
- package/components/skeleton/skeleton.module.css +52 -0
- package/components/skeleton/skeleton.module.css.d.ts +9 -0
- package/components/spinner/spinner.module.css.d.ts +14 -0
- package/components/surface/surface.module.css +19 -0
- package/components/surface/surface.module.css.d.ts +5 -0
- package/components/switch/switch.module.css +170 -0
- package/components/switch/switch.module.css.d.ts +13 -0
- package/components/table/table.module.css +303 -0
- package/components/table/table.module.css.d.ts +37 -0
- package/components/tabs/tabs.module.css +83 -0
- package/components/tabs/tabs.module.css.d.ts +17 -0
- package/components/text/text.module.css.d.ts +21 -0
- package/components/textField/textField.module.css +208 -0
- package/components/textField/textField.module.css.d.ts +22 -0
- package/components/toast/toast.module.css.d.ts +12 -0
- package/components/tooltip/tooltip.module.css +41 -0
- package/components/tooltip/tooltip.module.css.d.ts +6 -0
- package/package.json +68 -0
- package/themes/default-dark.css +2 -0
- package/themes/default-dark.d.ts +3 -0
- package/themes/default-dark.js +8 -0
- package/themes/default.css +2 -0
- package/themes/default.d.ts +3 -0
- package/themes/default.js +8 -0
- package/themes/index.d.ts +1 -0
- package/themes/index.js +16 -0
- package/themes/june-dark.css +3 -0
- package/themes/june-dark.d.ts +4 -0
- package/themes/june-dark.js +9 -0
- package/themes/june.css +3 -0
- package/themes/june.d.ts +4 -0
- package/themes/june.js +9 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
.sapphire-icon-button {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
vertical-align: middle;
|
|
7
|
+
white-space: nowrap;
|
|
8
|
+
|
|
9
|
+
/* In Safari buttons get a 2px border
|
|
10
|
+
* https://github.com/necolas/normalize.css/blob/master/normalize.css#L160-L169
|
|
11
|
+
*/
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
|
|
15
|
+
/* The below is meant to address a font rendering quirk in OSX where the text
|
|
16
|
+
* looks bolder than intended due to subpixel rendering. This quirk generally
|
|
17
|
+
* occurs for bold fonts on dark backgrounds but depending on the font, it
|
|
18
|
+
* can happen in other contexts as well.
|
|
19
|
+
*
|
|
20
|
+
* These do not do anything except in webkit browsers & firefox on OSX.
|
|
21
|
+
*
|
|
22
|
+
* For more details see:
|
|
23
|
+
* - https://azuredevops/Main/WCCJ/_git/sapphire/pullRequest/212710?path=%2Fpackages%2Fcss%2Fcomponents%2Fbutton%2Fbutton.module.css&discussionId=1507702&_a=files
|
|
24
|
+
* - https://usabilitypost.com/2012/11/05/stop-fixing-font-smoothing/
|
|
25
|
+
*/
|
|
26
|
+
-webkit-font-smoothing: antialiased;
|
|
27
|
+
-moz-osx-font-smoothing: grayscale;
|
|
28
|
+
|
|
29
|
+
/* sizing */
|
|
30
|
+
height: var(--sapphire-icon-button-size-height-medium);
|
|
31
|
+
width: var(--sapphire-icon-button-size-width-medium);
|
|
32
|
+
flex-shrink: 0; /* When part of flex layout the button will otherwise be squashed */
|
|
33
|
+
|
|
34
|
+
/* shape */
|
|
35
|
+
border-radius: var(--sapphire-icon-button-size-radius-medium);
|
|
36
|
+
border-style: solid;
|
|
37
|
+
border-width: 0;
|
|
38
|
+
border-color: transparent;
|
|
39
|
+
|
|
40
|
+
/* transition */
|
|
41
|
+
/* we don't want to transition outline-offset */
|
|
42
|
+
transition-property: opacity, background-color, color;
|
|
43
|
+
transition-duration: var(--sapphire-icon-button-time-transition);
|
|
44
|
+
transition-timing-function: ease-in-out;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
a.sapphire-icon-button {
|
|
49
|
+
text-decoration: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Diasbled state for all variants */
|
|
53
|
+
.sapphire-icon-button:disabled,
|
|
54
|
+
.sapphire-icon-button.is-disabled {
|
|
55
|
+
opacity: var(--sapphire-icon-button-opacity-disabled);
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Focused state for all variants */
|
|
60
|
+
.sapphire-icon-button:focus {
|
|
61
|
+
outline: none;
|
|
62
|
+
}
|
|
63
|
+
.sapphire-icon-button.is-focus,
|
|
64
|
+
.sapphire-icon-button:not(.js-focus):focus-visible {
|
|
65
|
+
outline: var(--sapphire-icon-button-size-focus-ring-border) solid
|
|
66
|
+
var(--sapphire-icon-button-color-focus-ring);
|
|
67
|
+
outline-offset: var(--sapphire-icon-button-size-focus-ring-offset);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Skin rules
|
|
72
|
+
*/
|
|
73
|
+
/* primary */
|
|
74
|
+
.sapphire-icon-button--primary {
|
|
75
|
+
background-color: var(
|
|
76
|
+
--sapphire-icon-button-color-background-primary-default
|
|
77
|
+
);
|
|
78
|
+
color: var(--sapphire-icon-button-color-content-primary-default);
|
|
79
|
+
}
|
|
80
|
+
.sapphire-icon-button--primary:not(:disabled):not(.is-disabled):not(:active):not(.is-active):not(.js-hover):hover,
|
|
81
|
+
.sapphire-icon-button--primary:not(:disabled):not(.is-disabled):not(:active):not(.is-active).is-hover {
|
|
82
|
+
background-color: var(--sapphire-icon-button-color-background-primary-hover);
|
|
83
|
+
color: var(--sapphire-icon-button-color-content-primary-hover);
|
|
84
|
+
}
|
|
85
|
+
.sapphire-icon-button--primary.is-focus,
|
|
86
|
+
.sapphire-icon-button--primary:not(.js-focus):focus-visible {
|
|
87
|
+
background-color: var(--sapphire-icon-button-color-background-primary-focus);
|
|
88
|
+
color: var(--sapphire-icon-button-color-content-primary-focus);
|
|
89
|
+
}
|
|
90
|
+
.sapphire-icon-button--primary:not(:disabled):not(.is-disabled).is-active,
|
|
91
|
+
.sapphire-icon-button--primary:not(:disabled):not(.is-disabled):active,
|
|
92
|
+
.sapphire-icon-button--primary:not(:disabled):not(.is-disabled):focus-visible:active {
|
|
93
|
+
background-color: var(--sapphire-icon-button-color-background-primary-active);
|
|
94
|
+
color: var(--sapphire-icon-button-color-content-primary-active);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* secondary */
|
|
98
|
+
.sapphire-icon-button--secondary {
|
|
99
|
+
background-color: var(
|
|
100
|
+
--sapphire-icon-button-color-background-secondary-default
|
|
101
|
+
);
|
|
102
|
+
color: var(--sapphire-icon-button-color-content-secondary-default);
|
|
103
|
+
}
|
|
104
|
+
.sapphire-icon-button--secondary:not(:disabled):not(.is-disabled):not(:active):not(.is-active):not(.js-hover):hover,
|
|
105
|
+
.sapphire-icon-button--secondary:not(:disabled):not(.is-disabled):not(:active):not(.is-active).is-hover {
|
|
106
|
+
background-color: var(
|
|
107
|
+
--sapphire-icon-button-color-background-secondary-hover
|
|
108
|
+
);
|
|
109
|
+
color: var(--sapphire-icon-button-color-content-secondary-hover);
|
|
110
|
+
}
|
|
111
|
+
.sapphire-icon-button--secondary.is-focus,
|
|
112
|
+
.sapphire-icon-button--secondary:not(.js-focus):focus-visible {
|
|
113
|
+
background-color: var(
|
|
114
|
+
--sapphire-icon-button-color-background-secondary-focus
|
|
115
|
+
);
|
|
116
|
+
color: var(--sapphire-icon-button-color-content-secondary-focus);
|
|
117
|
+
}
|
|
118
|
+
.sapphire-icon-button--secondary:not(:disabled):not(.is-disabled).is-active,
|
|
119
|
+
.sapphire-icon-button--secondary:not(:disabled):not(.is-disabled):active,
|
|
120
|
+
.sapphire-icon-button--secondary:not(:disabled):not(.is-disabled):focus-visible:active {
|
|
121
|
+
background-color: var(
|
|
122
|
+
--sapphire-icon-button-color-background-secondary-active
|
|
123
|
+
);
|
|
124
|
+
color: var(--sapphire-icon-button-color-content-secondary-active);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* neutral */
|
|
128
|
+
.sapphire-icon-button--neutral {
|
|
129
|
+
background-color: var(
|
|
130
|
+
--sapphire-icon-button-color-background-neutral-default
|
|
131
|
+
);
|
|
132
|
+
color: var(--sapphire-icon-button-color-content-neutral-default);
|
|
133
|
+
}
|
|
134
|
+
.sapphire-icon-button--neutral:not(:disabled):not(.is-disabled):not(:active):not(.is-active):not(.js-hover):hover,
|
|
135
|
+
.sapphire-icon-button--neutral:not(:disabled):not(.is-disabled):not(:active):not(.is-active).is-hover {
|
|
136
|
+
background-color: var(--sapphire-icon-button-color-background-neutral-hover);
|
|
137
|
+
color: var(--sapphire-icon-button-color-content-neutral-hover);
|
|
138
|
+
}
|
|
139
|
+
.sapphire-icon-button--neutral.is-focus,
|
|
140
|
+
.sapphire-icon-button--neutral:not(.js-focus):focus-visible {
|
|
141
|
+
background-color: var(--sapphire-icon-button-color-background-neutral-focus);
|
|
142
|
+
color: var(--sapphire-icon-button-color-content-neutral-focus);
|
|
143
|
+
}
|
|
144
|
+
.sapphire-icon-button--neutral:not(:disabled):not(.is-disabled).is-active,
|
|
145
|
+
.sapphire-icon-button--neutral:not(:disabled):not(.is-disabled):focus-visible:active,
|
|
146
|
+
.sapphire-icon-button--neutral:not(:disabled):not(.is-disabled):active {
|
|
147
|
+
background-color: var(--sapphire-icon-button-color-background-neutral-active);
|
|
148
|
+
color: var(--sapphire-icon-button-color-content-neutral-active);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* danger */
|
|
152
|
+
.sapphire-icon-button--danger {
|
|
153
|
+
background-color: var(--sapphire-icon-button-color-background-danger-default);
|
|
154
|
+
color: var(--sapphire-icon-button-color-content-danger-default);
|
|
155
|
+
}
|
|
156
|
+
.sapphire-icon-button--danger:not(:disabled):not(.is-disabled):not(:active):not(.is-active):not(.js-hover):hover,
|
|
157
|
+
.sapphire-icon-button--danger:not(:disabled):not(.is-disabled):not(:active):not(.is-active).is-hover {
|
|
158
|
+
background-color: var(--sapphire-icon-button-color-background-danger-hover);
|
|
159
|
+
color: var(--sapphire-icon-button-color-content-danger-hover);
|
|
160
|
+
}
|
|
161
|
+
.sapphire-icon-button--danger.is-focus,
|
|
162
|
+
.sapphire-icon-button--danger:not(.js-focus):focus-visible {
|
|
163
|
+
background-color: var(--sapphire-icon-button-color-background-danger-focus);
|
|
164
|
+
color: var(--sapphire-icon-button-color-content-danger-focus);
|
|
165
|
+
}
|
|
166
|
+
.sapphire-icon-button--danger:not(:disabled):not(.is-disabled).is-active,
|
|
167
|
+
.sapphire-icon-button--danger:not(:disabled):not(.is-disabled):focus-visible:active,
|
|
168
|
+
.sapphire-icon-button--danger:not(:disabled):not(.is-disabled):active {
|
|
169
|
+
background-color: var(--sapphire-icon-button-color-background-danger-active);
|
|
170
|
+
color: var(--sapphire-icon-button-color-content-danger-active);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Icon
|
|
175
|
+
*/
|
|
176
|
+
.sapphire-icon-button__icon {
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: column;
|
|
179
|
+
justify-content: center;
|
|
180
|
+
align-items: center;
|
|
181
|
+
height: var(--sapphire-icon-button-size-icon-medium);
|
|
182
|
+
width: var(--sapphire-icon-button-size-icon-medium);
|
|
183
|
+
}
|
|
184
|
+
.sapphire-icon-button--large .sapphire-icon-button__icon {
|
|
185
|
+
height: var(--sapphire-icon-button-size-icon-large);
|
|
186
|
+
width: var(--sapphire-icon-button-size-icon-large);
|
|
187
|
+
}
|
|
188
|
+
.sapphire-icon-button--small .sapphire-icon-button__icon {
|
|
189
|
+
height: var(--sapphire-icon-button-size-icon-small);
|
|
190
|
+
width: var(--sapphire-icon-button-size-icon-small);
|
|
191
|
+
}
|
|
192
|
+
.sapphire-icon-button--extra-small .sapphire-icon-button__icon {
|
|
193
|
+
height: var(--sapphire-icon-button-size-icon-extra-small);
|
|
194
|
+
width: var(--sapphire-icon-button-size-icon-extra-small);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Size variations
|
|
199
|
+
*/
|
|
200
|
+
/**
|
|
201
|
+
* LARGE
|
|
202
|
+
*/
|
|
203
|
+
.sapphire-icon-button--large {
|
|
204
|
+
height: var(--sapphire-icon-button-size-height-large);
|
|
205
|
+
width: var(--sapphire-icon-button-size-width-large);
|
|
206
|
+
border-radius: var(--sapphire-icon-button-size-radius-large);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* SMALL
|
|
211
|
+
*/
|
|
212
|
+
.sapphire-icon-button--small {
|
|
213
|
+
height: var(--sapphire-icon-button-size-height-small);
|
|
214
|
+
width: var(--sapphire-icon-button-size-width-small);
|
|
215
|
+
border-radius: var(--sapphire-icon-button-size-radius-small);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* EXTRA SMALL
|
|
220
|
+
*/
|
|
221
|
+
.sapphire-icon-button--extra-small {
|
|
222
|
+
height: var(--sapphire-icon-button-size-height-extra-small);
|
|
223
|
+
width: var(--sapphire-icon-button-size-width-extra-small);
|
|
224
|
+
border-radius: var(--sapphire-icon-button-size-radius-extra-small);
|
|
225
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const styles: {
|
|
2
|
+
readonly "sapphire-icon-button": string;
|
|
3
|
+
readonly "is-disabled": string;
|
|
4
|
+
readonly "is-focus": string;
|
|
5
|
+
readonly "js-focus": string;
|
|
6
|
+
readonly "sapphire-icon-button--primary": string;
|
|
7
|
+
readonly "is-active": string;
|
|
8
|
+
readonly "js-hover": string;
|
|
9
|
+
readonly "is-hover": string;
|
|
10
|
+
readonly "sapphire-icon-button--secondary": string;
|
|
11
|
+
readonly "sapphire-icon-button--neutral": string;
|
|
12
|
+
readonly "sapphire-icon-button--danger": string;
|
|
13
|
+
readonly "sapphire-icon-button__icon": string;
|
|
14
|
+
readonly "sapphire-icon-button--large": string;
|
|
15
|
+
readonly "sapphire-icon-button--small": string;
|
|
16
|
+
readonly "sapphire-icon-button--extra-small": string;
|
|
17
|
+
};
|
|
18
|
+
export = styles;
|
|
19
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const styles: {
|
|
2
|
+
readonly "sapphire-label": string;
|
|
3
|
+
readonly "sapphire-label--medium": string;
|
|
4
|
+
readonly "sapphire-label__text": string;
|
|
5
|
+
readonly "sapphire-label__required-indicator": string;
|
|
6
|
+
readonly "sapphire-label__optional-indicator": string;
|
|
7
|
+
};
|
|
8
|
+
export = styles;
|
|
9
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.sapphire-link {
|
|
2
|
+
/* The below is meant to address a font rendering quirk in OSX where the text
|
|
3
|
+
* looks bolder than intended due to subpixel rendering. This quirk generally
|
|
4
|
+
* occurs for bold fonts on dark backgrounds but depending on the font, it
|
|
5
|
+
* can happen in other contexts as well.
|
|
6
|
+
*
|
|
7
|
+
* These do not do anything except in webkit browsers & firefox on OSX.
|
|
8
|
+
*
|
|
9
|
+
* For more details see:
|
|
10
|
+
* - https://azuredevops/Main/WCCJ/_git/sapphire/pullRequest/212710?path=%2Fpackages%2Fcss%2Fcomponents%2Fbutton%2Fbutton.module.css&discussionId=1507702&_a=files
|
|
11
|
+
* - https://usabilitypost.com/2012/11/05/stop-fixing-font-smoothing/
|
|
12
|
+
*/
|
|
13
|
+
-webkit-font-smoothing: antialiased;
|
|
14
|
+
-moz-osx-font-smoothing: grayscale;
|
|
15
|
+
|
|
16
|
+
font-family: var(--sapphire-link-font-name);
|
|
17
|
+
color: var(--sapphire-link-color-text-default);
|
|
18
|
+
text-decoration: none;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
outline: 0;
|
|
21
|
+
text-decoration: underline;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.sapphire-link:active .sapphire-link.is-active {
|
|
25
|
+
color: var(--sapphire-link-color-text-active);
|
|
26
|
+
}
|
|
27
|
+
.sapphire-link:not(.js-focus):focus-visible,
|
|
28
|
+
.sapphire-link.is-focus {
|
|
29
|
+
color: var(--sapphire-link-color-text-default);
|
|
30
|
+
outline: 2px solid var(--sapphire-link-color-focus-ring);
|
|
31
|
+
}
|
|
32
|
+
.sapphire-link:not(.js-hover):hover,
|
|
33
|
+
.sapphire-link.is-hover {
|
|
34
|
+
color: var(--sapphire-link-color-text-hover);
|
|
35
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
.sapphire-list {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
width: 100%;
|
|
4
|
+
|
|
5
|
+
/* sizing */
|
|
6
|
+
padding: 0;
|
|
7
|
+
margin: 0;
|
|
8
|
+
|
|
9
|
+
/* The below is meant to address a font rendering quirk in OSX where the text
|
|
10
|
+
* looks bolder than intended due to subpixel rendering. This quirk generally
|
|
11
|
+
* occurs for bold fonts on dark backgrounds but depending on the font, it
|
|
12
|
+
* can happen in other contexts as well.
|
|
13
|
+
*
|
|
14
|
+
* These do not do anything except in webkit browsers & firefox on OSX.
|
|
15
|
+
*
|
|
16
|
+
* For more details see:
|
|
17
|
+
* - https://azuredevops/Main/WCCJ/_git/sapphire/pullRequest/212710?path=%2Fpackages%2Fcss%2Fcomponents%2Fbutton%2Fbutton.module.css&discussionId=1507702&_a=files
|
|
18
|
+
* - https://usabilitypost.com/2012/11/05/stop-fixing-font-smoothing/
|
|
19
|
+
*/
|
|
20
|
+
-webkit-font-smoothing: antialiased;
|
|
21
|
+
-moz-osx-font-smoothing: grayscale;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.sapphire-list__item {
|
|
25
|
+
position: relative;
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
padding: var(--sapphire-list-spacing-item-vertical-default)
|
|
29
|
+
var(--sapphire-list-spacing-item-horizontal-default);
|
|
30
|
+
background-color: var(--sapphire-list-color-background-item-default);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* pure css approach, not properly supported in all browsers at the moment */
|
|
34
|
+
.sapphire-list__item:has(.sapphire-list__item-content-wrapper) {
|
|
35
|
+
padding: 0;
|
|
36
|
+
}
|
|
37
|
+
/* fallback js-based solution */
|
|
38
|
+
.sapphire-list__item--content-wrapped {
|
|
39
|
+
padding: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.sapphire-list__item-content-wrapper {
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
width: 100%;
|
|
46
|
+
/*
|
|
47
|
+
* Same as outermost element (li) as this should control padding instead
|
|
48
|
+
* if element is a (href prop has value) or button (action prop has value).
|
|
49
|
+
*/
|
|
50
|
+
padding: var(--sapphire-list-spacing-item-vertical-default)
|
|
51
|
+
var(--sapphire-list-spacing-item-horizontal-default);
|
|
52
|
+
|
|
53
|
+
/* Counterstyling anything passed as custom content wrapper */
|
|
54
|
+
text-decoration: none;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
background-color: inherit;
|
|
57
|
+
color: inherit;
|
|
58
|
+
font-family: inherit;
|
|
59
|
+
font-size: inherit;
|
|
60
|
+
font-weight: inherit;
|
|
61
|
+
border: none;
|
|
62
|
+
text-align: inherit;
|
|
63
|
+
align-items: inherit;
|
|
64
|
+
}
|
|
65
|
+
.sapphire-list__item-content-wrapper:disabled,
|
|
66
|
+
.sapphire-list__item-content-wrapper[aria-disabled='true'] {
|
|
67
|
+
cursor: inherit;
|
|
68
|
+
/* TODO: Ask designers to provide disabled styles and apply them here */
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.sapphire-list__item-content-wrapper:not(.is-focus, :not(.js-focus):focus-visible)::after,
|
|
72
|
+
.sapphire-list__item:not(.sapphire-list__item--content-wrapped)::after {
|
|
73
|
+
content: '';
|
|
74
|
+
position: absolute;
|
|
75
|
+
height: var(--sapphire-list-size-width-border-item-default);
|
|
76
|
+
background: var(--sapphire-list-color-border-item-default);
|
|
77
|
+
bottom: 0;
|
|
78
|
+
left: var(--sapphire-list-spacing-item-horizontal-default);
|
|
79
|
+
right: var(--sapphire-list-spacing-item-horizontal-default);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.sapphire-list--without-last-divider
|
|
83
|
+
.sapphire-list__item:last-child
|
|
84
|
+
.sapphire-list__item-content-wrapper::after,
|
|
85
|
+
.sapphire-list--without-last-divider .sapphire-list__item:last-child::after {
|
|
86
|
+
height: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/*
|
|
90
|
+
* Hover
|
|
91
|
+
*/
|
|
92
|
+
.sapphire-list__item-content-wrapper.is-hover,
|
|
93
|
+
.sapphire-list__item-content-wrapper:not(.js-hover):not([aria-disabled='true']):not(:disabled):hover {
|
|
94
|
+
background-color: var(--sapphire-list-color-background-item-hover);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
* Focus
|
|
99
|
+
*/
|
|
100
|
+
.sapphire-list__item-content-wrapper:focus,
|
|
101
|
+
.sapphire-list__item-content-wrapper:focus-visible {
|
|
102
|
+
outline: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.sapphire-list__item-content-wrapper.is-focus,
|
|
106
|
+
.sapphire-list__item-content-wrapper:not(.js-focus):focus {
|
|
107
|
+
outline: none;
|
|
108
|
+
box-shadow: inset 0px 0px 0px
|
|
109
|
+
var(--sapphire-list-size-width-border-item-focus)
|
|
110
|
+
var(--sapphire-list-color-border-item-focus);
|
|
111
|
+
border: 0;
|
|
112
|
+
background-color: var(--sapphire-list-color-background-item-focus);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.sapphire-list__item-content-left {
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
margin-right: var(--sapphire-list-spacing-item-horizontal-content);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.sapphire-list__item-content-right {
|
|
122
|
+
display: flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
text-align: right;
|
|
125
|
+
margin-left: var(--sapphire-list-spacing-item-horizontal-content);
|
|
126
|
+
color: var(--sapphire-list-color-content-primary-text);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.sapphire-list__item-text {
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
font-family: var(--sapphire-list-font-name);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.sapphire-list__item-text--reversedOrder {
|
|
136
|
+
flex-direction: column-reverse;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* If sibling is present before the text, we apply margin to the left on the text */
|
|
140
|
+
* + .sapphire-list__item-text {
|
|
141
|
+
margin-left: var(--sapphire-list-spacing-item-horizontal-content);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* If sibling is present after the text, we apply margin to the left on that sibling */
|
|
145
|
+
.sapphire-list__item-text + * {
|
|
146
|
+
margin-left: var(--sapphire-list-spacing-item-horizontal-content);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.sapphire-list__item-text-primary {
|
|
150
|
+
color: var(--sapphire-list-color-content-primary-text);
|
|
151
|
+
line-height: var(--sapphire-list-size-line-height);
|
|
152
|
+
font-size: var(--sapphire-list-size-font-primary-text);
|
|
153
|
+
font-weight: var(--sapphire-list-font-weight-primary-text);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.sapphire-list__item-text-secondary {
|
|
157
|
+
color: var(--sapphire-list-color-content-secondary-text);
|
|
158
|
+
line-height: var(--sapphire-list-size-line-height);
|
|
159
|
+
font-size: var(--sapphire-list-size-font-secondary-text);
|
|
160
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const styles: {
|
|
2
|
+
readonly "sapphire-list": string;
|
|
3
|
+
readonly "sapphire-list__item": string;
|
|
4
|
+
readonly "sapphire-list__item-content-wrapper": string;
|
|
5
|
+
readonly "sapphire-list__item--content-wrapped": string;
|
|
6
|
+
readonly "is-focus": string;
|
|
7
|
+
readonly "js-focus": string;
|
|
8
|
+
readonly "sapphire-list--without-last-divider": string;
|
|
9
|
+
readonly "is-hover": string;
|
|
10
|
+
readonly "js-hover": string;
|
|
11
|
+
readonly "sapphire-list__item-content-left": string;
|
|
12
|
+
readonly "sapphire-list__item-content-right": string;
|
|
13
|
+
readonly "sapphire-list__item-text": string;
|
|
14
|
+
readonly "sapphire-list__item-text--reversedOrder": string;
|
|
15
|
+
readonly "sapphire-list__item-text-primary": string;
|
|
16
|
+
readonly "sapphire-list__item-text-secondary": string;
|
|
17
|
+
};
|
|
18
|
+
export = styles;
|
|
19
|
+
|