Skip to content

Commit d56b93d

Browse files
feat(components): add the new Theme infrastructure for the BitDropDown component #4058 (#4064)
1 parent fc04fed commit d56b93d

File tree

9 files changed

+1054
-1253
lines changed

9 files changed

+1054
-1253
lines changed

src/BlazorUI/Bit.BlazorUI.Tests/Inputs/BitDropDownTests.cs

Lines changed: 146 additions & 262 deletions
Large diffs are not rendered by default.

src/BlazorUI/Bit.BlazorUI/Components/DropDown/BitDropDown.Fluent.scss

Lines changed: 0 additions & 787 deletions
This file was deleted.

src/BlazorUI/Bit.BlazorUI/Components/DropDown/BitDropDown.razor

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@
44
id="@UniqueId"
55
style="@StyleBuilder.Value"
66
class="@ClassBuilder.Value">
7-
@if (LabelFragment is not null)
7+
@if (LabelTemplate is not null)
88
{
9-
<label class="lbl" id="@DropdownLabelId">@LabelFragment</label>
9+
<label class="label" id="@_dropdownLabelId">@LabelTemplate</label>
1010
}
1111
else if (Label.HasValue())
1212
{
13-
<label class="lbl" id="@DropdownLabelId">@Label</label>
13+
<label class="label" id="@_dropdownLabelId">@Label</label>
1414
}
1515

16-
<div class="drp-overlay"
17-
id="@DropDownOverlayId"
18-
@onclick="CloseCallout"></div>
16+
<div class="overlay" id="@_dropDownOverlayId" @onclick="CloseCallout"></div>
1917

20-
<div class="drp-wrapper"
21-
id="@DropDownId"
18+
<div class="wrapper"
19+
id="@_dropDownId"
2220
tabindex=@(IsEnabled ? 0 : -1)
2321
role="combobox"
2422
data-is-focusable="true"
@@ -27,23 +25,23 @@
2725
aria-required="@IsRequired"
2826
aria-disabled="@(IsEnabled is false)"
2927
aria-haspopup="listbox"
30-
aria-controls="@(IsOpen ? $"{DropDownId}-list" : null)"
28+
aria-controls="@(IsOpen ? $"{_dropDownId}-list" : null)"
3129
title="@Title"
3230
@onclick="HandleClick">
33-
<span class="drp-wrapper-txt"
34-
id="@DropDownOptionId"
31+
<span class="text-container"
32+
id="@_dropDownOptionId"
3533
aria-live="polite"
3634
aria-atomic="true"
3735
aria-invalid="false">
38-
@if (Text.HasValue())
36+
@if (_text.HasValue())
3937
{
4038
@if (TextTemplate is not null)
4139
{
4240
@TextTemplate(this)
4341
}
4442
else
4543
{
46-
@Text
44+
@_text
4745
}
4846
}
4947
else
@@ -58,10 +56,10 @@
5856
}
5957
}
6058
</span>
61-
<span class="drp-wrapper-ic">
62-
@if (CaretDownFragment is not null)
59+
<span class="icon-container">
60+
@if (CaretDownTemplate is not null)
6361
{
64-
@CaretDownFragment
62+
@CaretDownTemplate
6563
}
6664
else
6765
{
@@ -71,20 +69,20 @@
7169
</div>
7270

7371
<div class="items-wrapper"
74-
id="@DropDownCalloutId"
72+
id="@_dropDownCalloutId"
7573
tabindex="0"
7674
role="listbox"
77-
aria-labelledby="@DropdownLabelId">
75+
aria-labelledby="@_dropdownLabelId">
7876
@if (IsResponsiveModeEnabled)
7977
{
80-
<div class="responsive-label-contianer">
81-
@if (LabelFragment is not null)
78+
<div class="responsive-label-container">
79+
@if (LabelTemplate is not null)
8280
{
83-
<label class="lbl">@LabelFragment</label>
81+
<label class="label">@LabelTemplate</label>
8482
}
8583
else if (Label.HasValue())
8684
{
87-
<label class="lbl">@Label</label>
85+
<label class="label">@Label</label>
8886
}
8987
<button class="close-btn"
9088
type="button"
@@ -117,8 +115,8 @@
117115
@oninput="@HandleFilterChange" />
118116
@if (_searchText.HasValue())
119117
{
120-
<div class="search-clear-btn-container">
121-
<button class="search-clear-btn"
118+
<div class="clear-btn-container">
119+
<button class="clear-btn"
122120
type="button"
123121
aria-label="Clear text"
124122
aria-hidden="true"
@@ -133,7 +131,7 @@
133131
</div>
134132
}
135133

136-
<div @ref="_scrollWrapperElement" id="@DropDownCalloutId" class="scroll-wrapper">
134+
<div @ref="_scrollWrapperElement" id="@_dropDownCalloutId" class="scroll-wrapper">
137135
@if (Virtualize)
138136
{
139137
if (ItemsProvider is null)
@@ -189,14 +187,14 @@
189187
@if (IsMultiSelect)
190188
{
191189
<div style="@(dropDownItem.item.IsHidden ? "display: none" : string.Empty)" class="@GetCssClassForItem(dropDownItem.item)">
192-
<label class="drp-chb-lbl" @onclick="@((e) => HandleItemClick(dropDownItem.item))">
193-
<div class="drp-chb-checkbox">
194-
<i class="drp-chb-checkmark bit-icon bit-icon--Accept"
190+
<label class="checkbox-container" @onclick="@((e) => HandleItemClick(dropDownItem.item))">
191+
<div class="checkbox">
192+
<i class="checkmark bit-icon bit-icon--Accept"
195193
aria-hidden="true"
196194
aria-label="@dropDownItem.item.Text"></i>
197195
</div>
198196

199-
<span class="drp-chb-txt no-text-select">
197+
<span class="text no-text-select">
200198
@if (ItemTemplate is not null)
201199
{
202200
@ItemTemplate(dropDownItem.item)
@@ -211,7 +209,7 @@
211209
}
212210
else
213211
{
214-
<button class="drp-item @(dropDownItem.item.IsSelected ? "drp-slc" : string.Empty)"
212+
<button class="item @(dropDownItem.item.IsSelected ? "selected" : string.Empty)"
215213
style="@(dropDownItem.item.IsHidden ? "display: none" : string.Empty)"
216214
type="button"
217215
role="option"

0 commit comments

Comments
 (0)