@danske/sapphire-css 16.3.0 → 26.1.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 +2 -12
- package/build/themes/cjs/default-dark.d.ts +3 -2
- package/build/themes/cjs/default-dark.js +5 -1
- package/build/themes/cjs/default.d.ts +3 -2
- package/build/themes/cjs/default.js +5 -1
- package/build/themes/cjs/index.d.ts +4 -0
- package/build/themes/cjs/june-dark.d.ts +3 -2
- package/build/themes/cjs/june-dark.js +5 -1
- package/build/themes/cjs/june.d.ts +3 -2
- package/build/themes/cjs/june.js +5 -1
- package/build/themes/esm/default-dark.d.ts +3 -2
- package/build/themes/esm/default-dark.js +5 -1
- package/build/themes/esm/default.d.ts +3 -2
- package/build/themes/esm/default.js +5 -1
- package/build/themes/esm/index.d.ts +4 -0
- package/build/themes/esm/june-dark.d.ts +3 -2
- package/build/themes/esm/june-dark.js +5 -1
- package/build/themes/esm/june.d.ts +3 -2
- package/build/themes/esm/june.js +5 -1
- package/components/accordion/accordion.module.css +163 -0
- package/components/avatar/avatar.module.css +137 -0
- package/components/badge/badge.module.css +246 -79
- package/components/badge/badge.module.css.d.ts +42 -10
- package/components/button/button.module.css +413 -74
- package/components/button/button.module.css.d.ts +11 -5
- package/components/buttonGroup/buttonGroup.module.css +20 -4
- package/components/buttonGroup/buttonGroup.module.css.d.ts +2 -1
- package/components/calendar/calendar.module.css +9 -2
- package/components/calendar/calendar.module.css.d.ts +1 -2
- package/components/checkbox/checkbox.module.css +44 -11
- package/components/checkbox/checkbox.module.css.d.ts +3 -0
- package/components/dateField/dateField.module.css +81 -86
- package/components/dateField/dateField.module.css.d.ts +3 -6
- package/components/dialog/dialog.module.css +34 -15
- package/components/dialog/dialog.module.css.d.ts +2 -2
- package/components/field/field.module.css +164 -0
- package/components/fieldGroup/fieldGroup.module.css +8 -54
- package/components/fieldGroup/fieldGroup.module.css.d.ts +4 -8
- package/components/icon/icon.module.css +11 -6
- package/components/icon/icon.module.css.d.ts +1 -0
- package/components/iconButton/iconButton.module.css +356 -70
- package/components/iconButton/iconButton.module.css.d.ts +8 -4
- package/components/label/label.module.css +29 -0
- package/components/link/link.module.css +71 -13
- package/components/link/link.module.css.d.ts +7 -2
- package/components/list/list.module.css +47 -21
- package/components/list/list.module.css.d.ts +1 -1
- package/components/listbox/listbox.module.css +53 -13
- package/components/listbox/listbox.module.css.d.ts +3 -1
- package/components/notificationBadge/notificationBadge.module.css +126 -0
- package/components/panel/panel.module.css +32 -14
- package/components/panel/panel.module.css.d.ts +3 -2
- package/components/paragraph/paragraph.module.css +4 -7
- package/components/paragraph/paragraph.module.css.d.ts +1 -2
- package/components/radio/radio.module.css +34 -9
- package/components/radio/radio.module.css.d.ts +2 -0
- package/components/searchField/searchField.module.css +43 -19
- package/components/searchField/searchField.module.css.d.ts +2 -0
- package/components/segmentedControl/segmentedControl.module.css +7 -7
- package/components/select/select.module.css +22 -63
- package/components/select/select.module.css.d.ts +1 -5
- package/components/spinner/spinner.module.css +64 -0
- package/components/surface/surface.module.css +5 -1
- package/components/surface/surface.module.css.d.ts +1 -0
- package/components/switch/switch.module.css +44 -44
- package/components/switch/switch.module.css.d.ts +1 -0
- package/components/table/table.module.css +26 -41
- package/components/tabs/tabs.module.css +155 -23
- package/components/tabs/tabs.module.css.d.ts +9 -2
- package/components/text/text.module.css +207 -0
- package/components/textField/textField.module.css +67 -89
- package/components/textField/textField.module.css.d.ts +3 -7
- package/components/toast/toast.module.css +101 -0
- package/components/tooltip/tooltip.module.css +13 -8
- package/components/tooltip/tooltip.module.css.d.ts +1 -0
- package/package.json +13 -9
- package/themes/default-dark.assets.css +1 -0
- package/themes/default-dark.d.ts +3 -2
- package/themes/default-dark.js +5 -1
- package/themes/default-dark.tokens.scss +1 -0
- package/themes/default.assets.css +1 -0
- package/themes/default.d.ts +3 -2
- package/themes/default.js +5 -1
- package/themes/default.tokens.scss +1 -0
- package/themes/index.d.ts +4 -0
- package/themes/june-dark.d.ts +3 -2
- package/themes/june-dark.js +5 -1
- package/themes/june-dark.scss +3 -0
- package/themes/june.d.ts +3 -2
- package/themes/june.js +5 -1
- package/themes/june.scss +3 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
.sapphire-radio {
|
|
2
|
-
align-items: center;
|
|
3
2
|
display: inline-flex;
|
|
4
3
|
font-family: var(--sapphire-radio-font-label-name);
|
|
5
4
|
max-width: 100%;
|
|
@@ -21,8 +20,8 @@
|
|
|
21
20
|
|
|
22
21
|
.sapphire-radio__label {
|
|
23
22
|
margin-left: var(--sapphire-radio-size-spacing-label);
|
|
24
|
-
font-size: var(--sapphire-radio-size-font);
|
|
25
|
-
line-height: var(--sapphire-radio-size-height-label);
|
|
23
|
+
font-size: var(--sapphire-radio-size-font-l);
|
|
24
|
+
line-height: var(--sapphire-radio-size-height-label-l);
|
|
26
25
|
color: var(--sapphire-radio-color-label);
|
|
27
26
|
|
|
28
27
|
/* The below is meant to address a font rendering quirk in OSX where the text
|
|
@@ -40,6 +39,11 @@
|
|
|
40
39
|
-moz-osx-font-smoothing: grayscale;
|
|
41
40
|
}
|
|
42
41
|
|
|
42
|
+
.sapphire-radio--medium .sapphire-radio__label {
|
|
43
|
+
font-size: var(--sapphire-radio-size-font-m);
|
|
44
|
+
line-height: var(--sapphire-radio-size-height-label-m);
|
|
45
|
+
}
|
|
46
|
+
|
|
43
47
|
/* The radio box */
|
|
44
48
|
|
|
45
49
|
.sapphire-radio__box {
|
|
@@ -47,24 +51,41 @@
|
|
|
47
51
|
background-color: var(
|
|
48
52
|
--sapphire-radio-color-background-box-unchecked-default
|
|
49
53
|
);
|
|
50
|
-
width: var(--sapphire-radio-size-width-box);
|
|
51
|
-
height: var(--sapphire-radio-size-height-box);
|
|
54
|
+
width: var(--sapphire-radio-size-width-box-l);
|
|
55
|
+
height: var(--sapphire-radio-size-height-box-l);
|
|
52
56
|
flex-shrink: 0;
|
|
53
57
|
border-radius: 50%;
|
|
54
58
|
border: var(--sapphire-radio-size-width-border-unchecked) solid
|
|
55
59
|
var(--sapphire-radio-color-border-box-unchecked-default);
|
|
56
60
|
position: relative;
|
|
61
|
+
margin-top: var(--sapphire-radio-size-spacing-box);
|
|
57
62
|
|
|
58
63
|
transition-property: background-color, border-color, border-width;
|
|
59
64
|
transition-duration: var(--sapphire-radio-time-transition);
|
|
60
65
|
transition-timing-function: ease-in-out;
|
|
61
66
|
}
|
|
62
67
|
|
|
68
|
+
.sapphire-radio--medium .sapphire-radio__box {
|
|
69
|
+
width: var(--sapphire-radio-size-width-box-m);
|
|
70
|
+
height: var(--sapphire-radio-size-height-box-m);
|
|
71
|
+
}
|
|
72
|
+
|
|
63
73
|
.sapphire-radio--checked .sapphire-radio__box {
|
|
64
74
|
border-color: var(--sapphire-radio-color-background-box-checked-default);
|
|
65
75
|
border-width: calc(
|
|
66
|
-
(
|
|
67
|
-
|
|
76
|
+
(
|
|
77
|
+
var(--sapphire-radio-size-height-box-l) -
|
|
78
|
+
var(--sapphire-radio-size-circle-l)
|
|
79
|
+
) / 2
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.sapphire-radio--medium.sapphire-radio--checked .sapphire-radio__box {
|
|
84
|
+
border-width: calc(
|
|
85
|
+
(
|
|
86
|
+
var(--sapphire-radio-size-height-box-m) -
|
|
87
|
+
var(--sapphire-radio-size-circle-m)
|
|
88
|
+
) / 2
|
|
68
89
|
);
|
|
69
90
|
}
|
|
70
91
|
|
|
@@ -111,7 +132,11 @@
|
|
|
111
132
|
cursor: not-allowed;
|
|
112
133
|
}
|
|
113
134
|
|
|
114
|
-
.sapphire-
|
|
115
|
-
.sapphire-radio__input:disabled
|
|
135
|
+
.sapphire-radio:not(.sapphire-radio--no-disabled)
|
|
136
|
+
.sapphire-radio__input:disabled
|
|
137
|
+
~ .sapphire-radio__box,
|
|
138
|
+
.sapphire-radio:not(.sapphire-radio--no-disabled)
|
|
139
|
+
.sapphire-radio__input:disabled
|
|
140
|
+
~ .sapphire-radio__label {
|
|
116
141
|
opacity: var(--sapphire-radio-opacity-disabled);
|
|
117
142
|
}
|
|
@@ -2,6 +2,7 @@ declare const styles: {
|
|
|
2
2
|
readonly "sapphire-radio": string;
|
|
3
3
|
readonly "sapphire-radio__input": string;
|
|
4
4
|
readonly "sapphire-radio__label": string;
|
|
5
|
+
readonly "sapphire-radio--medium": string;
|
|
5
6
|
readonly "sapphire-radio__box": string;
|
|
6
7
|
readonly "sapphire-radio--checked": string;
|
|
7
8
|
readonly "is-active": string;
|
|
@@ -9,6 +10,7 @@ declare const styles: {
|
|
|
9
10
|
readonly "js-hover": string;
|
|
10
11
|
readonly "is-focus": string;
|
|
11
12
|
readonly "js-focus": string;
|
|
13
|
+
readonly "sapphire-radio--no-disabled": string;
|
|
12
14
|
};
|
|
13
15
|
export = styles;
|
|
14
16
|
|
|
@@ -15,39 +15,36 @@
|
|
|
15
15
|
*/
|
|
16
16
|
-webkit-font-smoothing: antialiased;
|
|
17
17
|
-moz-osx-font-smoothing: grayscale;
|
|
18
|
-
|
|
19
|
-
/*
|
|
20
|
-
showing border with box-shadow, since the width changes between focused and
|
|
21
|
-
non-focused state. Using border will cause content to jump, due to resize.
|
|
22
|
-
Using outline will render border and focus ring outside the component's
|
|
23
|
-
boundary, which can lead to issues where it's clipped or overlapped with
|
|
24
|
-
the adjacent element.
|
|
25
|
-
*/
|
|
26
|
-
box-shadow: inset 0 0 0 var(--sapphire-search-field-size-width-border)
|
|
27
|
-
var(--sapphire-search-field-color-border-default);
|
|
28
18
|
display: inline-flex;
|
|
29
19
|
align-items: center;
|
|
30
20
|
gap: var(--sapphire-search-field-size-spacing-control-gap);
|
|
31
|
-
border-radius: var(--sapphire-search-field-size-radius);
|
|
21
|
+
border-radius: var(--sapphire-search-field-size-radius-l);
|
|
32
22
|
cursor: text;
|
|
33
23
|
color: var(--sapphire-search-field-color-content-input);
|
|
34
|
-
font-size: var(--sapphire-search-field-size-font-
|
|
35
|
-
height: var(--sapphire-search-field-size-height-field);
|
|
36
|
-
background-color: var(--sapphire-search-field-color-background);
|
|
24
|
+
font-size: var(--sapphire-search-field-size-font-l);
|
|
25
|
+
height: var(--sapphire-search-field-size-height-field-l);
|
|
26
|
+
background-color: var(--sapphire-search-field-color-background-default);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.sapphire-search-field--surface-secondary {
|
|
30
|
+
background-color: var(
|
|
31
|
+
--sapphire-search-field-color-background-surface-secondary
|
|
32
|
+
);
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
.sapphire-search-field .sapphire-search-field__input:last-child {
|
|
40
|
-
padding-right: var(--sapphire-search-field-size-spacing-control-horizontal);
|
|
36
|
+
padding-right: var(--sapphire-search-field-size-spacing-control-horizontal-l);
|
|
41
37
|
}
|
|
42
38
|
|
|
43
39
|
.sapphire-search-field__input {
|
|
44
40
|
all: unset;
|
|
45
41
|
flex: 1;
|
|
46
42
|
height: 100%;
|
|
43
|
+
min-width: 0;
|
|
47
44
|
font-weight: var(--sapphire-search-field-size-font-weight-input);
|
|
48
45
|
caret-color: var(--sapphire-search-field-color-caret);
|
|
49
46
|
position: relative;
|
|
50
|
-
padding-left:
|
|
47
|
+
padding-left: var(--sapphire-search-field-size-height-field-l);
|
|
51
48
|
}
|
|
52
49
|
|
|
53
50
|
/**
|
|
@@ -91,10 +88,11 @@
|
|
|
91
88
|
display: flex;
|
|
92
89
|
justify-content: center;
|
|
93
90
|
align-items: center;
|
|
94
|
-
height: var(--sapphire-search-field-size-height-field);
|
|
95
|
-
width: var(--sapphire-search-field-size-height-field);
|
|
91
|
+
height: var(--sapphire-search-field-size-height-field-l);
|
|
92
|
+
width: var(--sapphire-search-field-size-height-field-l);
|
|
96
93
|
color: var(--sapphire-search-field-color-content-button-default);
|
|
97
94
|
cursor: default;
|
|
95
|
+
flex-shrink: 0;
|
|
98
96
|
|
|
99
97
|
transition: transform var(--sapphire-search-field-time-transition);
|
|
100
98
|
}
|
|
@@ -144,5 +142,31 @@
|
|
|
144
142
|
color: var(--sapphire-search-field-color-content-icon);
|
|
145
143
|
display: inline-flex; /* Not to take more height than the icon */
|
|
146
144
|
position: absolute;
|
|
147
|
-
margin-left: var(--sapphire-search-field-size-spacing-control-horizontal);
|
|
145
|
+
margin-left: var(--sapphire-search-field-size-spacing-control-horizontal-l);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Medium Size
|
|
150
|
+
*/
|
|
151
|
+
.sapphire-search-field--medium {
|
|
152
|
+
font-size: var(--sapphire-search-field-size-font-m);
|
|
153
|
+
height: var(--sapphire-search-field-size-height-field-m);
|
|
154
|
+
border-radius: var(--sapphire-search-field-size-radius-l);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.sapphire-search-field--medium .sapphire-search-field__input {
|
|
158
|
+
padding-left: var(--sapphire-search-field-size-height-field-m);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.sapphire-search-field--medium .sapphire-search-field__button {
|
|
162
|
+
height: var(--sapphire-search-field-size-height-field-m);
|
|
163
|
+
width: var(--sapphire-search-field-size-height-field-m);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.sapphire-search-field--medium .sapphire-search-field__input:last-child {
|
|
167
|
+
padding-right: var(--sapphire-search-field-size-spacing-control-horizontal-m);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.sapphire-search-field--medium .sapphire-search-field__icon {
|
|
171
|
+
margin-left: var(--sapphire-search-field-size-spacing-control-horizontal-m);
|
|
148
172
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const styles: {
|
|
2
2
|
readonly "sapphire-search-field": string;
|
|
3
|
+
readonly "sapphire-search-field--surface-secondary": string;
|
|
3
4
|
readonly "sapphire-search-field__input": string;
|
|
4
5
|
readonly "is-focus": string;
|
|
5
6
|
readonly "is-disabled": string;
|
|
@@ -9,6 +10,7 @@ declare const styles: {
|
|
|
9
10
|
readonly "is-active": string;
|
|
10
11
|
readonly "sapphire-search-field__input--empty": string;
|
|
11
12
|
readonly "sapphire-search-field__icon": string;
|
|
13
|
+
readonly "sapphire-search-field--medium": string;
|
|
12
14
|
};
|
|
13
15
|
export = styles;
|
|
14
16
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
border-radius: var(--sapphire-segmented-control-size-radius);
|
|
4
4
|
padding: var(--sapphire-segmented-control-size-spacing-tray);
|
|
5
5
|
display: inline-block;
|
|
6
|
-
height: var(--sapphire-segmented-control-size-height-
|
|
6
|
+
height: var(--sapphire-segmented-control-size-height-m);
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
height: 100%;
|
|
22
22
|
display: block;
|
|
23
23
|
background-color: var(--sapphire-segmented-control-color-glider);
|
|
24
|
-
box-shadow: var(--sapphire-
|
|
24
|
+
box-shadow: var(--sapphire-segmented-control-shadow-glider);
|
|
25
25
|
box-sizing: border-box;
|
|
26
26
|
z-index: 1;
|
|
27
27
|
border-radius: var(--sapphire-segmented-control-size-radius);
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
.sapphire-segmented-control__button {
|
|
37
37
|
font-family: var(--sapphire-segmented-control-font-name);
|
|
38
38
|
font-weight: var(--sapphire-segmented-control-font-weight);
|
|
39
|
-
font-size: var(--sapphire-segmented-control-size-font-
|
|
39
|
+
font-size: var(--sapphire-segmented-control-size-font-m);
|
|
40
40
|
/* The below is meant to address a font rendering quirk in OSX where the text
|
|
41
41
|
* looks bolder than intended due to subpixel rendering. This quirk generally
|
|
42
42
|
* occurs for bold fonts on dark backgrounds but depending on the font, it
|
|
@@ -105,19 +105,19 @@
|
|
|
105
105
|
|
|
106
106
|
/* Sizes */
|
|
107
107
|
.sapphire-segmented-control--large {
|
|
108
|
-
height: var(--sapphire-segmented-control-size-height-
|
|
108
|
+
height: var(--sapphire-segmented-control-size-height-l);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
.sapphire-segmented-control--large .sapphire-segmented-control__button {
|
|
112
|
-
font-size: var(--sapphire-segmented-control-size-font-
|
|
112
|
+
font-size: var(--sapphire-segmented-control-size-font-l);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
.sapphire-segmented-control--small {
|
|
116
|
-
height: var(--sapphire-segmented-control-size-height-
|
|
116
|
+
height: var(--sapphire-segmented-control-size-height-s);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.sapphire-segmented-control--small .sapphire-segmented-control__button {
|
|
120
|
-
font-size: var(--sapphire-segmented-control-size-font-
|
|
120
|
+
font-size: var(--sapphire-segmented-control-size-font-s);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
/* Radio-specific */
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
.sapphire-select {
|
|
2
|
-
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
3
4
|
color: var(--sapphire-select-color-content);
|
|
4
5
|
width: var(--sapphire-select-size-width-control);
|
|
5
|
-
|
|
6
|
-
position: relative;
|
|
7
|
-
|
|
6
|
+
font-family: var(--sapphire-select-font-name);
|
|
8
7
|
/* The below is meant to address a font rendering quirk in OSX where the text
|
|
9
8
|
* looks bolder than intended due to subpixel rendering. This quirk generally
|
|
10
9
|
* occurs for bold fonts on dark backgrounds but depending on the font, it
|
|
@@ -20,18 +19,13 @@
|
|
|
20
19
|
-moz-osx-font-smoothing: grayscale;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
.sapphire-select__button-container {
|
|
24
|
-
position: relative;
|
|
25
|
-
width: 100%;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
22
|
.sapphire-select__button {
|
|
29
23
|
display: flex;
|
|
30
24
|
align-items: center;
|
|
31
|
-
height: var(--sapphire-select-size-height-field-
|
|
25
|
+
height: var(--sapphire-select-size-height-field-l);
|
|
32
26
|
box-sizing: border-box;
|
|
33
27
|
cursor: pointer;
|
|
34
|
-
padding: 0 var(--sapphire-select-size-spacing-control-horizontal);
|
|
28
|
+
padding: 0 var(--sapphire-select-size-spacing-control-horizontal-l);
|
|
35
29
|
border: none;
|
|
36
30
|
background-color: var(--sapphire-select-color-background-field);
|
|
37
31
|
width: 100%;
|
|
@@ -44,24 +38,15 @@
|
|
|
44
38
|
border-radius: var(--sapphire-select-size-radius-field);
|
|
45
39
|
}
|
|
46
40
|
|
|
47
|
-
.sapphire-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
gap: var(--sapphire-select-size-spacing-label-horizontal-default);
|
|
51
|
-
min-height: var(--sapphire-select-size-height-label);
|
|
52
|
-
margin-bottom: var(--sapphire-select-size-spacing-label-vertical-default);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.sapphire-select__label-text {
|
|
56
|
-
font-size: var(--sapphire-select-size-font-label-default);
|
|
57
|
-
font-weight: var(--sapphire-select-size-font-weight-label-default);
|
|
58
|
-
line-height: var(--sapphire-select-size-line-height-label-default);
|
|
41
|
+
.sapphire-select--medium .sapphire-select__button {
|
|
42
|
+
height: var(--sapphire-select-size-height-field-m);
|
|
43
|
+
padding: 0 var(--sapphire-select-size-spacing-control-horizontal-m);
|
|
59
44
|
}
|
|
60
45
|
|
|
61
46
|
.sapphire-select__value {
|
|
62
47
|
flex: 1 0 0;
|
|
63
48
|
min-width: 0;
|
|
64
|
-
font-size: var(--sapphire-select-size-font-content-
|
|
49
|
+
font-size: var(--sapphire-select-size-font-content-l);
|
|
65
50
|
width: 100%;
|
|
66
51
|
font-weight: var(--sapphire-select-size-font-weight-item);
|
|
67
52
|
overflow: hidden;
|
|
@@ -69,6 +54,10 @@
|
|
|
69
54
|
white-space: nowrap;
|
|
70
55
|
}
|
|
71
56
|
|
|
57
|
+
.sapphire-select--medium .sapphire-select__value {
|
|
58
|
+
font-size: var(--sapphire-select-size-font-content-m);
|
|
59
|
+
}
|
|
60
|
+
|
|
72
61
|
.sapphire-select__placeholder {
|
|
73
62
|
overflow: hidden;
|
|
74
63
|
text-overflow: ellipsis;
|
|
@@ -78,26 +67,21 @@
|
|
|
78
67
|
|
|
79
68
|
.sapphire-select__icon-container {
|
|
80
69
|
line-height: 0;
|
|
70
|
+
width: var(--sapphire-select-size-width-icon-l);
|
|
71
|
+
height: var(--sapphire-select-size-height-icon-l);
|
|
81
72
|
}
|
|
82
73
|
|
|
83
|
-
.sapphire-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
justify-content: center;
|
|
87
|
-
width: var(--sapphire-select-size-width-avatar);
|
|
88
|
-
height: var(--sapphire-select-size-height-avatar);
|
|
89
|
-
flex: 0 0 auto;
|
|
90
|
-
background-color: var(--sapphire-select-color-background-avatar);
|
|
91
|
-
border-radius: 50%;
|
|
92
|
-
overflow: hidden;
|
|
93
|
-
font-weight: var(--sapphire-select-size-font-weight-item);
|
|
94
|
-
color: var(--sapphire-select-color-content);
|
|
74
|
+
.sapphire-select--medium .sapphire-select__icon-container {
|
|
75
|
+
width: var(--sapphire-select-size-width-icon-m);
|
|
76
|
+
height: var(--sapphire-select-size-height-icon-m);
|
|
95
77
|
}
|
|
96
78
|
|
|
97
79
|
/*
|
|
98
|
-
* Search input
|
|
80
|
+
* Search input. If visually-hidden styles are not inline,
|
|
81
|
+
* data-hidden="true" can be added when the input is visually hidden,
|
|
82
|
+
* for the default styles to not interfere with visually-hidden styles.
|
|
99
83
|
*/
|
|
100
|
-
.sapphire-select__search-input {
|
|
84
|
+
.sapphire-select__search-input:not([data-hidden='true']) {
|
|
101
85
|
all: inherit;
|
|
102
86
|
}
|
|
103
87
|
.sapphire-select__search-input::placeholder {
|
|
@@ -115,34 +99,17 @@
|
|
|
115
99
|
z-index: 1;
|
|
116
100
|
}
|
|
117
101
|
|
|
118
|
-
/**
|
|
119
|
-
* Note
|
|
120
|
-
*/
|
|
121
|
-
|
|
122
|
-
.sapphire-select__note {
|
|
123
|
-
color: var(--sapphire-select-color-note-default);
|
|
124
|
-
font-size: var(--sapphire-select-size-font-note-default);
|
|
125
|
-
line-height: var(--sapphire-select-size-line-height-note-default);
|
|
126
|
-
margin-top: var(--sapphire-select-size-spacing-note-vertical-default);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
102
|
/**
|
|
130
103
|
* Error
|
|
131
104
|
*/
|
|
132
|
-
|
|
133
105
|
.sapphire-select--error:not(.is-disabled) .sapphire-select__button {
|
|
134
106
|
box-shadow: inset 0px 0px 0px 1px
|
|
135
107
|
var(--sapphire-select-color-border-field-error);
|
|
136
108
|
}
|
|
137
109
|
|
|
138
|
-
.sapphire-select--error .sapphire-select__note {
|
|
139
|
-
color: var(--sapphire-select-color-note-error);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
110
|
/*
|
|
143
111
|
* Focus
|
|
144
112
|
*/
|
|
145
|
-
|
|
146
113
|
.sapphire-select:not(.is-disabled).is-focus .sapphire-select__button {
|
|
147
114
|
box-shadow: inset 0px 0px 0px var(--sapphire-select-size-focus-ring)
|
|
148
115
|
var(--sapphire-select-color-focus-ring);
|
|
@@ -153,14 +120,6 @@
|
|
|
153
120
|
var(--sapphire-select-color-border-field-error);
|
|
154
121
|
}
|
|
155
122
|
|
|
156
|
-
/**
|
|
157
|
-
* Disabled
|
|
158
|
-
*/
|
|
159
|
-
.sapphire-select.is-disabled {
|
|
160
|
-
opacity: var(--sapphire-select-opacity-disabled);
|
|
161
|
-
cursor: not-allowed;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
123
|
.sapphire-select.is-disabled .sapphire-select__button {
|
|
165
124
|
cursor: not-allowed;
|
|
166
125
|
}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
declare const styles: {
|
|
2
2
|
readonly "sapphire-select": string;
|
|
3
|
-
readonly "sapphire-select__button-container": string;
|
|
4
3
|
readonly "sapphire-select__button": string;
|
|
5
|
-
readonly "sapphire-
|
|
6
|
-
readonly "sapphire-select__label-text": string;
|
|
4
|
+
readonly "sapphire-select--medium": string;
|
|
7
5
|
readonly "sapphire-select__value": string;
|
|
8
6
|
readonly "sapphire-select__placeholder": string;
|
|
9
7
|
readonly "sapphire-select__icon-container": string;
|
|
10
|
-
readonly "sapphire-select__avatar": string;
|
|
11
8
|
readonly "sapphire-select__search-input": string;
|
|
12
9
|
readonly "sapphire-select__native-select": string;
|
|
13
|
-
readonly "sapphire-select__note": string;
|
|
14
10
|
readonly "sapphire-select--error": string;
|
|
15
11
|
readonly "is-disabled": string;
|
|
16
12
|
readonly "is-focus": string;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
@keyframes rotate {
|
|
2
|
+
0% {
|
|
3
|
+
transform: rotate(0deg);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
80% {
|
|
7
|
+
transform: rotate(360deg);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
100% {
|
|
11
|
+
transform: rotate(360deg);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.sapphire-spinner {
|
|
16
|
+
width: var(--sapphire-spinner-size-m);
|
|
17
|
+
height: var(--sapphire-spinner-size-m);
|
|
18
|
+
|
|
19
|
+
animation: rotate var(--sapphire-spinner-time-transition)
|
|
20
|
+
cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
21
|
+
animation-iteration-count: infinite;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.sapphire-spinner__track {
|
|
25
|
+
fill: var(--sapphire-spinner-color-default);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.sapphire-spinner__accent {
|
|
29
|
+
fill: var(--sapphire-spinner-color-accent);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
* Sizes
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
.sapphire-spinner--xxxs {
|
|
37
|
+
width: var(--sapphire-spinner-size-xxxs);
|
|
38
|
+
height: var(--sapphire-spinner-size-xxxs);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.sapphire-spinner--xxs {
|
|
42
|
+
width: var(--sapphire-spinner-size-xxs);
|
|
43
|
+
height: var(--sapphire-spinner-size-xxs);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.sapphire-spinner--xs {
|
|
47
|
+
width: var(--sapphire-spinner-size-xs);
|
|
48
|
+
height: var(--sapphire-spinner-size-xs);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.sapphire-spinner--s {
|
|
52
|
+
width: var(--sapphire-spinner-size-s);
|
|
53
|
+
height: var(--sapphire-spinner-size-s);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.sapphire-spinner--l {
|
|
57
|
+
width: var(--sapphire-spinner-size-l);
|
|
58
|
+
height: var(--sapphire-spinner-size-l);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.sapphire-spinner--xl {
|
|
62
|
+
width: var(--sapphire-spinner-size-xl);
|
|
63
|
+
height: var(--sapphire-spinner-size-xl);
|
|
64
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.sapphire-surface {
|
|
2
2
|
font-family: var(--sapphire-surface-font-name);
|
|
3
|
-
background-color: var(--sapphire-surface-color-background);
|
|
3
|
+
background-color: var(--sapphire-surface-color-background-default);
|
|
4
4
|
color: var(--sapphire-surface-color-content);
|
|
5
5
|
|
|
6
6
|
/* The below is meant to address a font rendering quirk in OSX where the text
|
|
@@ -17,3 +17,7 @@
|
|
|
17
17
|
-webkit-font-smoothing: antialiased;
|
|
18
18
|
-moz-osx-font-smoothing: grayscale;
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
.sapphire-surface--secondary {
|
|
22
|
+
background-color: var(--sapphire-surface-color-background-secondary);
|
|
23
|
+
}
|
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
display: inline-flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
position: relative;
|
|
9
|
-
min-height: var(--sapphire-switch-size-height);
|
|
10
9
|
max-width: 100%;
|
|
11
|
-
gap: var(--sapphire-switch-size-spacing-label);
|
|
10
|
+
gap: var(--sapphire-switch-size-spacing-label-l);
|
|
12
11
|
}
|
|
13
12
|
|
|
13
|
+
.sapphire-switch--medium {
|
|
14
|
+
gap: var(--sapphire-switch-size-spacing-label-m);
|
|
15
|
+
}
|
|
14
16
|
/**
|
|
15
17
|
* hidden html input
|
|
16
18
|
*/
|
|
@@ -34,11 +36,11 @@
|
|
|
34
36
|
.sapphire-switch-label {
|
|
35
37
|
display: flex;
|
|
36
38
|
align-items: center;
|
|
37
|
-
gap: var(--sapphire-switch-size-spacing-label);
|
|
39
|
+
gap: var(--sapphire-switch-size-spacing-label-l);
|
|
38
40
|
font-family: var(--sapphire-switch-font-label-name);
|
|
39
41
|
font-weight: var(--sapphire-switch-font-label-weight);
|
|
40
|
-
font-size: var(--sapphire-switch-size-font);
|
|
41
|
-
line-height: var(--sapphire-switch-size-
|
|
42
|
+
font-size: var(--sapphire-switch-size-font-l);
|
|
43
|
+
line-height: var(--sapphire-switch-size-height-l);
|
|
42
44
|
color: var(--sapphire-switch-color-label);
|
|
43
45
|
|
|
44
46
|
/* The below is meant to address a font rendering quirk in OSX where the text
|
|
@@ -56,6 +58,12 @@
|
|
|
56
58
|
-moz-osx-font-smoothing: grayscale;
|
|
57
59
|
}
|
|
58
60
|
|
|
61
|
+
.sapphire-switch--medium .sapphire-switch-label {
|
|
62
|
+
gap: var(--sapphire-switch-size-spacing-label-m);
|
|
63
|
+
font-size: var(--sapphire-switch-size-font-m);
|
|
64
|
+
line-height: var(--sapphire-switch-size-height-m);
|
|
65
|
+
}
|
|
66
|
+
|
|
59
67
|
/**
|
|
60
68
|
* knob track
|
|
61
69
|
*/
|
|
@@ -63,17 +71,10 @@
|
|
|
63
71
|
background: var(--sapphire-switch-color-background-off-default);
|
|
64
72
|
box-sizing: border-box;
|
|
65
73
|
position: relative;
|
|
66
|
-
width: var(--sapphire-switch-size-width);
|
|
74
|
+
width: var(--sapphire-switch-size-width-l);
|
|
67
75
|
transition: background var(--sapphire-switch-time-transition) ease-in-out;
|
|
68
|
-
height: var(--sapphire-switch-size-height);
|
|
69
|
-
border-radius: calc(var(--sapphire-switch-size-height) / 2);
|
|
70
|
-
}
|
|
71
|
-
.sapphire-switch-track::before {
|
|
72
|
-
content: '';
|
|
73
|
-
position: absolute;
|
|
74
|
-
top: 50%;
|
|
75
|
-
left: 50%;
|
|
76
|
-
transform: translateY(-50%) translateX(-50%);
|
|
76
|
+
height: var(--sapphire-switch-size-height-l);
|
|
77
|
+
border-radius: calc(var(--sapphire-switch-size-height-l) / 2);
|
|
77
78
|
}
|
|
78
79
|
.sapphire-switch-input:checked ~ .sapphire-switch-track {
|
|
79
80
|
background-color: var(--sapphire-switch-color-background-on-default);
|
|
@@ -97,25 +98,11 @@
|
|
|
97
98
|
/* focus */
|
|
98
99
|
.sapphire-switch:not(.js-focus)
|
|
99
100
|
.sapphire-switch-input:focus-visible
|
|
100
|
-
~ .sapphire-switch-track
|
|
101
|
-
.sapphire-switch.is-focus .sapphire-switch-track
|
|
102
|
-
|
|
103
|
-
var(--sapphire-switch-
|
|
104
|
-
|
|
105
|
-
var(--sapphire-switch-size-focus-ring-inner-border)
|
|
106
|
-
);
|
|
107
|
-
height: calc(
|
|
108
|
-
var(--sapphire-switch-size-height) + 2 *
|
|
109
|
-
var(--sapphire-switch-size-focus-ring-outer-border) + 2 *
|
|
110
|
-
var(--sapphire-switch-size-focus-ring-inner-border)
|
|
111
|
-
);
|
|
112
|
-
border: var(--sapphire-switch-size-focus-ring-outer-border) solid
|
|
113
|
-
var(--sapphire-switch-color-focus-ring-outer-border);
|
|
114
|
-
border-radius: 1000px; /* percentage value does not work here */
|
|
115
|
-
box-sizing: border-box;
|
|
116
|
-
box-shadow: inset 0px 0px 0px
|
|
117
|
-
var(--sapphire-switch-size-focus-ring-inner-border)
|
|
118
|
-
var(--sapphire-switch-color-focus-ring-inner-border);
|
|
101
|
+
~ .sapphire-switch-track,
|
|
102
|
+
.sapphire-switch.is-focus .sapphire-switch-track {
|
|
103
|
+
outline: var(--sapphire-switch-size-focus-ring-border) solid
|
|
104
|
+
var(--sapphire-switch-color-focus-ring);
|
|
105
|
+
outline-offset: var(--sapphire-switch-size-focus-ring-offset);
|
|
119
106
|
}
|
|
120
107
|
/* active (checked) */
|
|
121
108
|
.sapphire-switch:active
|
|
@@ -137,7 +124,7 @@
|
|
|
137
124
|
}
|
|
138
125
|
/* disabled */
|
|
139
126
|
.sapphire-switch-input:disabled {
|
|
140
|
-
cursor:
|
|
127
|
+
cursor: not-allowed;
|
|
141
128
|
}
|
|
142
129
|
|
|
143
130
|
.sapphire-switch-input:disabled ~ .sapphire-switch-track,
|
|
@@ -151,20 +138,33 @@
|
|
|
151
138
|
.sapphire-switch-track::after {
|
|
152
139
|
content: '';
|
|
153
140
|
position: absolute;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
|
|
143
|
+
/* a padding would be simpler and achieve the same UI but we need a shadow
|
|
144
|
+
* around the edges of the knob */
|
|
145
|
+
height: calc(100% - (2 * var(--sapphire-switch-size-spacing-knob)));
|
|
146
|
+
margin: var(--sapphire-switch-size-spacing-knob);
|
|
147
|
+
|
|
148
|
+
aspect-ratio: 1/1;
|
|
162
149
|
border-radius: 50%;
|
|
163
150
|
background-color: var(--sapphire-switch-color-background-knob);
|
|
164
151
|
background-clip: content-box;
|
|
165
152
|
left: 0;
|
|
166
153
|
transition: left var(--sapphire-switch-time-transition) ease-in-out;
|
|
154
|
+
box-shadow: var(--sapphire-switch-shadow-knob);
|
|
167
155
|
}
|
|
168
156
|
.sapphire-switch-input:checked ~ .sapphire-switch-track::after {
|
|
169
|
-
left: calc(100% - var(--sapphire-switch-size-height));
|
|
157
|
+
left: calc(100% - var(--sapphire-switch-size-height-l));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.sapphire-switch--medium .sapphire-switch-track {
|
|
161
|
+
width: var(--sapphire-switch-size-width-m);
|
|
162
|
+
height: var(--sapphire-switch-size-height-m);
|
|
163
|
+
border-radius: calc(var(--sapphire-switch-size-height-m) / 2);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.sapphire-switch--medium
|
|
167
|
+
.sapphire-switch-input:checked
|
|
168
|
+
~ .sapphire-switch-track::after {
|
|
169
|
+
left: calc(100% - var(--sapphire-switch-size-height-m));
|
|
170
170
|
}
|