vira 29.6.0 → 29.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,6 +30,8 @@ export declare const ViraSelect: import("element-vir").DeclarativeElementDefinit
|
|
|
30
30
|
icon: Readonly<ViraIconSvg>;
|
|
31
31
|
placeholder: string;
|
|
32
32
|
label: string;
|
|
33
|
+
/** If set to `true`, only minimal styles are applied. */
|
|
34
|
+
rawSelect: boolean;
|
|
33
35
|
disabled: boolean;
|
|
34
36
|
attributePassthrough: Readonly<PartialWithUndefined<{
|
|
35
37
|
label: AttributeValues;
|
|
@@ -45,4 +47,4 @@ export declare const ViraSelect: import("element-vir").DeclarativeElementDefinit
|
|
|
45
47
|
randomId: string;
|
|
46
48
|
}, {
|
|
47
49
|
valueChange: import("element-vir").DefineEvent<string>;
|
|
48
|
-
}, "vira-select-disabled" | "vira-select-error", "vira-select-padding-horizontal" | "vira-select-padding-vertical" | "vira-select-icon-padding", readonly [], readonly []>;
|
|
50
|
+
}, "vira-select-disabled" | "vira-select-error" | "vira-select-not-raw", "vira-select-padding-horizontal" | "vira-select-padding-vertical" | "vira-select-icon-padding", readonly [], readonly []>;
|
|
@@ -38,6 +38,7 @@ export const ViraSelect = defineViraElement()({
|
|
|
38
38
|
hostClasses: {
|
|
39
39
|
'vira-select-disabled': ({ inputs }) => !!inputs.disabled,
|
|
40
40
|
'vira-select-error': ({ inputs }) => !!inputs.hasError,
|
|
41
|
+
'vira-select-not-raw': ({ inputs }) => !inputs.rawSelect,
|
|
41
42
|
},
|
|
42
43
|
styles: ({ hostClasses, cssVars }) => css `
|
|
43
44
|
:host {
|
|
@@ -56,14 +57,6 @@ export const ViraSelect = defineViraElement()({
|
|
|
56
57
|
box-sizing: border-box;
|
|
57
58
|
align-items: center;
|
|
58
59
|
position: relative;
|
|
59
|
-
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
60
|
-
color: ${viraFormCssVars['vira-form-foreground-color'].value};
|
|
61
|
-
background-color: ${viraFormCssVars['vira-form-background-color'].value};
|
|
62
|
-
/*
|
|
63
|
-
Border colors are actually applied via the .wrapper-border class. However, we must
|
|
64
|
-
apply a border here still so that it takes up space.
|
|
65
|
-
*/
|
|
66
|
-
border: 1px solid transparent;
|
|
67
60
|
cursor: pointer;
|
|
68
61
|
|
|
69
62
|
& select {
|
|
@@ -76,20 +69,12 @@ export const ViraSelect = defineViraElement()({
|
|
|
76
69
|
border: none;
|
|
77
70
|
background: none;
|
|
78
71
|
border-radius: inherit;
|
|
79
|
-
padding: ${cssVars['vira-select-padding-vertical'].value} 31px
|
|
80
|
-
${cssVars['vira-select-padding-vertical'].value}
|
|
81
|
-
${cssVars['vira-select-padding-horizontal'].value};
|
|
82
72
|
cursor: pointer;
|
|
73
|
+
/* Prevent the left pixel of text getting cut off. */
|
|
74
|
+
padding-left: 0.5px;
|
|
83
75
|
overflow: hidden;
|
|
84
76
|
text-overflow: ellipsis;
|
|
85
77
|
|
|
86
|
-
&:focus:focus-visible:not([aria-disabled='true']) ~ .focus-border {
|
|
87
|
-
${createFocusStyles({
|
|
88
|
-
elementBorderSize: 0,
|
|
89
|
-
noNesting: true,
|
|
90
|
-
})}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
78
|
&.placeholder {
|
|
94
79
|
color: ${viraFormCssVars['vira-form-placeholder-color'].value};
|
|
95
80
|
}
|
|
@@ -112,24 +97,51 @@ export const ViraSelect = defineViraElement()({
|
|
|
112
97
|
left: 10px;
|
|
113
98
|
}
|
|
114
99
|
}
|
|
100
|
+
}
|
|
115
101
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
top: 0;
|
|
119
|
-
left: 0;
|
|
120
|
-
width: 100%;
|
|
121
|
-
height: 100%;
|
|
102
|
+
${hostClasses['vira-select-not-raw'].selector} {
|
|
103
|
+
.select-wrapper {
|
|
122
104
|
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
105
|
+
color: ${viraFormCssVars['vira-form-foreground-color'].value};
|
|
106
|
+
background-color: ${viraFormCssVars['vira-form-background-color'].value};
|
|
107
|
+
/*
|
|
108
|
+
Border colors are actually applied via the .wrapper-border class. However, we must
|
|
109
|
+
apply a border here still so that it takes up space.
|
|
110
|
+
*/
|
|
111
|
+
border: 1px solid transparent;
|
|
112
|
+
cursor: pointer;
|
|
126
113
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
114
|
+
& select {
|
|
115
|
+
padding: ${cssVars['vira-select-padding-vertical'].value} 31px
|
|
116
|
+
${cssVars['vira-select-padding-vertical'].value}
|
|
117
|
+
${cssVars['vira-select-padding-horizontal'].value};
|
|
118
|
+
|
|
119
|
+
&:focus:focus-visible:not([aria-disabled='true']) ~ .focus-border {
|
|
120
|
+
${createFocusStyles({
|
|
121
|
+
elementBorderSize: 0,
|
|
122
|
+
noNesting: true,
|
|
123
|
+
})}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
& .border-style {
|
|
128
|
+
position: absolute;
|
|
129
|
+
top: 0;
|
|
130
|
+
left: 0;
|
|
131
|
+
width: 100%;
|
|
132
|
+
height: 100%;
|
|
133
|
+
border-radius: ${viraFormCssVars['vira-form-radius'].value};
|
|
134
|
+
z-index: 0;
|
|
135
|
+
pointer-events: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
& .wrapper-border {
|
|
139
|
+
top: -1px;
|
|
140
|
+
left: -1px;
|
|
141
|
+
border: 1px solid ${viraFormCssVars['vira-form-border-color'].value};
|
|
142
|
+
transition: border
|
|
143
|
+
${viraAnimationDurations['vira-interaction-animation-duration'].value};
|
|
144
|
+
}
|
|
133
145
|
}
|
|
134
146
|
}
|
|
135
147
|
|
|
@@ -164,10 +176,9 @@ export const ViraSelect = defineViraElement()({
|
|
|
164
176
|
}
|
|
165
177
|
}
|
|
166
178
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
179
|
+
:host(.${hostClasses['vira-select-not-raw'].name}.${hostClasses['vira-select-error'].name})
|
|
180
|
+
.wrapper-border {
|
|
181
|
+
border-color: ${viraFormCssVars['vira-form-error-color'].value};
|
|
171
182
|
}
|
|
172
183
|
`,
|
|
173
184
|
render({ inputs, state, dispatch, events }) {
|
|
@@ -52,23 +52,7 @@ function generateThemeCss(colorVariant) {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
:host(
|
|
55
|
-
.vira-tag-color-${unsafeCSS(colorVariant)}.vira-tag-
|
|
56
|
-
)
|
|
57
|
-
button {
|
|
58
|
-
color: ${viraThemeByKeys[viraThemeColorKey]['on-self'][ContrastLevelName.BodyText]
|
|
59
|
-
.foreground.value};
|
|
60
|
-
background-color: transparent;
|
|
61
|
-
border-color: ${viraThemeByKeys[viraThemeColorKey]['on-self'][ContrastLevelName.BodyText].background.value};
|
|
62
|
-
|
|
63
|
-
&:hover {
|
|
64
|
-
background-color: ${viraThemeByKeys[viraThemeColorKey]['behind-bg'][ContrastLevelName.Invisible].background.value};
|
|
65
|
-
}
|
|
66
|
-
&:active {
|
|
67
|
-
background-color: ${viraThemeByKeys[viraThemeColorKey]['behind-bg'][ContrastLevelName.Decoration].background.value};
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
:host(
|
|
71
|
-
.vira-tag-color-${unsafeCSS(colorVariant)}.vira-tag-emphasis-${unsafeCSS(ViraEmphasis.Subtle)}.vira-tag-not-checked
|
|
55
|
+
.vira-tag-color-${unsafeCSS(colorVariant)}.vira-tag-not-checked.vira-tag-not-checked.vira-tag-not-checked
|
|
72
56
|
)
|
|
73
57
|
button {
|
|
74
58
|
color: ${viraThemeByKeys[viraThemeColorKey]['on-self'][ContrastLevelName.BodyText]
|
|
@@ -227,43 +211,52 @@ export const ViraTag = defineViraElement()({
|
|
|
227
211
|
.${hostClasses['vira-tag-color-plain'].name}.vira-tag-emphasis-${unsafeCSS(ViraEmphasis.Standard)}
|
|
228
212
|
)
|
|
229
213
|
button {
|
|
230
|
-
${colorCss(viraTheme.inverse[themeDefaultKey])}
|
|
231
|
-
border-color: ${viraTheme.inverse[themeDefaultKey].background.value}
|
|
214
|
+
${colorCss(viraTheme.inverse[themeDefaultKey])};
|
|
215
|
+
border-color: ${viraTheme.inverse[themeDefaultKey].background.value};
|
|
232
216
|
|
|
233
217
|
&:hover {
|
|
234
|
-
${colorCss(viraTheme.colors['vira-grey-behind-bg-body'])}
|
|
235
|
-
border-color: ${viraTheme.
|
|
218
|
+
${colorCss(viraTheme.colors['vira-grey-behind-bg-non-body'])};
|
|
219
|
+
border-color: ${viraTheme.colors['vira-grey-behind-bg-non-body'].background.value};
|
|
236
220
|
}
|
|
237
221
|
&:active {
|
|
238
|
-
${colorCss(viraTheme.inverse[themeDefaultKey])}
|
|
239
|
-
border-color: ${viraTheme.inverse[themeDefaultKey].background.value}
|
|
222
|
+
${colorCss(viraTheme.inverse[themeDefaultKey])};
|
|
223
|
+
border-color: ${viraTheme.inverse[themeDefaultKey].background.value};
|
|
240
224
|
}
|
|
241
225
|
}
|
|
242
226
|
:host(
|
|
243
|
-
.${hostClasses['vira-tag-color-plain'].name}.vira-tag-emphasis-${unsafeCSS(ViraEmphasis.
|
|
227
|
+
.${hostClasses['vira-tag-color-plain'].name}.vira-tag-emphasis-${unsafeCSS(ViraEmphasis.Subtle)}
|
|
244
228
|
)
|
|
245
229
|
button {
|
|
246
|
-
color: ${viraTheme.colors[themeDefaultKey].foreground.value};
|
|
247
230
|
background-color: transparent;
|
|
231
|
+
color: ${viraTheme.colors[themeDefaultKey].foreground.value};
|
|
248
232
|
border-color: transparent;
|
|
249
233
|
}
|
|
250
234
|
:host(
|
|
251
|
-
.${hostClasses['vira-tag-color-plain'].name}
|
|
235
|
+
.${hostClasses['vira-tag-color-plain'].name}.${hostClasses['vira-tag-not-checked']
|
|
236
|
+
.name}.${hostClasses['vira-tag-not-checked'].name}.${hostClasses['vira-tag-not-checked'].name}
|
|
252
237
|
)
|
|
253
238
|
button {
|
|
254
|
-
background-color: transparent;
|
|
255
239
|
color: ${viraTheme.colors[themeDefaultKey].foreground.value};
|
|
240
|
+
background-color: transparent;
|
|
256
241
|
border-color: transparent;
|
|
257
|
-
|
|
242
|
+
}
|
|
243
|
+
:host(
|
|
244
|
+
.${hostClasses['vira-tag-color-plain'].name}.vira-tag-emphasis-${unsafeCSS(ViraEmphasis.Subtle)}
|
|
245
|
+
)
|
|
246
|
+
button,
|
|
247
|
+
:host(
|
|
248
|
+
.${hostClasses['vira-tag-color-plain'].name}.${hostClasses['vira-tag-not-checked']
|
|
249
|
+
.name}.${hostClasses['vira-tag-not-checked'].name}.${hostClasses['vira-tag-not-checked'].name}
|
|
250
|
+
)
|
|
251
|
+
button {
|
|
258
252
|
&:hover {
|
|
259
253
|
${colorCss(viraTheme.colors['vira-grey-behind-fg-small-body'])}
|
|
260
254
|
border-color: ${viraTheme.colors['vira-grey-behind-fg-small-body'].background
|
|
261
255
|
.value};
|
|
262
256
|
}
|
|
263
257
|
&:active {
|
|
264
|
-
|
|
265
|
-
color: ${viraTheme.colors[
|
|
266
|
-
border-color: transparent;
|
|
258
|
+
${colorCss(viraTheme.colors['vira-grey-behind-fg-body'])}
|
|
259
|
+
border-color: ${viraTheme.colors['vira-grey-behind-fg-body'].background.value};
|
|
267
260
|
}
|
|
268
261
|
}
|
|
269
262
|
`,
|