Skip to content

Commit e86d220

Browse files
authored
feat(blazorui): rename Accent to Background in BitSearchBox #11184 (#11194)
1 parent 0f7d0fd commit e86d220

File tree

5 files changed

+102
-119
lines changed

5 files changed

+102
-119
lines changed

src/BlazorUI/Bit.BlazorUI/Components/Inputs/SearchBox/BitSearchBox.razor.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public partial class BitSearchBox : BitTextInputBase<string?>
2525

2626

2727
/// <summary>
28-
/// The accent color kind of the search box.
28+
/// The background color kind of the search box.
2929
/// </summary>
3030
[Parameter, ResetClassBuilder]
31-
public BitColorKind? Accent { get; set; }
31+
public BitColorKind? Background { get; set; }
3232

3333
/// <summary>
34-
/// Custom CSS classes for different parts of the BitSearchBox.
34+
/// Custom CSS classes for different parts of the search box.
3535
/// </summary>
3636
[Parameter] public BitSearchBoxClassStyles? Classes { get; set; }
3737

@@ -47,7 +47,7 @@ public partial class BitSearchBox : BitTextInputBase<string?>
4747
public BitColor? Color { get; set; }
4848

4949
/// <summary>
50-
/// The default value of the text in the SearchBox, in the case of an uncontrolled component.
50+
/// The default value of the text in the search box, in the case of an uncontrolled component.
5151
/// </summary>
5252
[Parameter] public string? DefaultValue { get; set; }
5353

@@ -70,7 +70,7 @@ public partial class BitSearchBox : BitTextInputBase<string?>
7070
public bool HideIcon { get; set; }
7171

7272
/// <summary>
73-
/// Whether to hide the clear button when the BitSearchBox has value.
73+
/// Whether to hide the clear button when the search box has value.
7474
/// </summary>
7575
[Parameter] public bool HideClearButton { get; set; }
7676

@@ -128,12 +128,12 @@ public partial class BitSearchBox : BitTextInputBase<string?>
128128
[Parameter] public string? Placeholder { get; set; }
129129

130130
/// <summary>
131-
/// Prefix text displayed before the searchbox input. This is not included in the value.
131+
/// Prefix text displayed before the search box input. This is not included in the value.
132132
/// </summary>
133133
[Parameter] public string? Prefix { get; set; }
134134

135135
/// <summary>
136-
/// The custom template for the prefix of the searchbox.
136+
/// The custom template for the prefix of the search box.
137137
/// </summary>
138138
[Parameter] public RenderFragment? PrefixTemplate { get; set; }
139139

@@ -154,17 +154,17 @@ public partial class BitSearchBox : BitTextInputBase<string?>
154154
public bool ShowSearchButton { get; set; }
155155

156156
/// <summary>
157-
/// Custom CSS styles for different parts of the BitSearchBox.
157+
/// Custom CSS styles for different parts of the search box.
158158
/// </summary>
159159
[Parameter] public BitSearchBoxClassStyles? Styles { get; set; }
160160

161161
/// <summary>
162-
/// Suffix text displayed after the searchbox input. This is not included in the value.
162+
/// Suffix text displayed after the search box input. This is not included in the value.
163163
/// </summary>
164164
[Parameter] public string? Suffix { get; set; }
165165

166166
/// <summary>
167-
/// The custom template for the suffix of the searchbox.
167+
/// The custom template for the suffix of the search box.
168168
/// </summary>
169169
[Parameter] public RenderFragment? SuffixTemplate { get; set; }
170170

@@ -184,12 +184,12 @@ public partial class BitSearchBox : BitTextInputBase<string?>
184184
[Parameter] public BitSearchBoxSuggestItemsProvider? SuggestItemsProvider { get; set; }
185185

186186
/// <summary>
187-
/// The custom template for rendering the suggest items of the BitSearchBox.
187+
/// The custom template for rendering the suggest items of the search box.
188188
/// </summary>
189189
[Parameter] public RenderFragment<string>? SuggestItemTemplate { get; set; }
190190

191191
/// <summary>
192-
/// Whether or not the SearchBox is underlined.
192+
/// Whether or not the search box is underlined.
193193
/// </summary>
194194
[Parameter, ResetClassBuilder]
195195
public bool Underlined { get; set; }
@@ -240,13 +240,13 @@ protected override void RegisterCssClasses()
240240

241241
ClassBuilder.Register(() => NoBorder ? "bit-srb-nbr" : string.Empty);
242242

243-
ClassBuilder.Register(() => Accent switch
243+
ClassBuilder.Register(() => Background switch
244244
{
245-
BitColorKind.Primary => "bit-srb-apri",
246-
BitColorKind.Secondary => "bit-srb-asec",
247-
BitColorKind.Tertiary => "bit-srb-ater",
248-
BitColorKind.Transparent => "bit-srb-atra",
249-
_ => string.Empty
245+
BitColorKind.Primary => "bit-srb-bpr",
246+
BitColorKind.Secondary => "bit-srb-bse",
247+
BitColorKind.Tertiary => "bit-srb-btr",
248+
BitColorKind.Transparent => "bit-srb-btn",
249+
_ => "bit-srb-bpr"
250250
});
251251

252252
ClassBuilder.Register(() => Color switch

src/BlazorUI/Bit.BlazorUI/Components/Inputs/SearchBox/BitSearchBox.scss

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@
137137
flex-flow: row nowrap;
138138
box-sizing: border-box;
139139
font-size: spacing(1.75);
140-
background-color: $clr-bg-pri;
141140
border-radius: $shp-border-radius;
141+
background-color: var(--bit-srb-clr-bg);
142142
border: $shp-border-width $shp-border-style $clr-brd-pri;
143143
}
144144

@@ -445,30 +445,6 @@
445445
}
446446
}
447447

448-
.bit-srb-apri {
449-
.bit-srb-cnt {
450-
background-color: $clr-bg-pri;
451-
}
452-
}
453-
454-
.bit-srb-asec {
455-
.bit-srb-cnt {
456-
background-color: $clr-bg-sec;
457-
}
458-
}
459-
460-
.bit-srb-ater {
461-
.bit-srb-cnt {
462-
background-color: $clr-bg-ter;
463-
}
464-
}
465-
466-
.bit-srb-atra {
467-
.bit-srb-cnt {
468-
background-color: transparent;
469-
}
470-
}
471-
472448
.bit-srb-hic {
473449
.bit-srb-cnt {
474450
//padding: 0 spacing(1);
@@ -556,6 +532,23 @@
556532
}
557533

558534

535+
.bit-srb-bpr {
536+
--bit-srb-clr-bg: #{$clr-bg-pri};
537+
}
538+
539+
.bit-srb-bse {
540+
--bit-srb-clr-bg: #{$clr-bg-sec};
541+
}
542+
543+
.bit-srb-btr {
544+
--bit-srb-clr-bg: #{$clr-bg-ter};
545+
}
546+
547+
.bit-srb-btn {
548+
--bit-srb-clr-bg: transparent;
549+
}
550+
551+
559552
.bit-srb-pri {
560553
--bit-srb-clr: #{$clr-pri};
561554
--bit-srb-clr-txt: #{$clr-pri-text};

0 commit comments

Comments
 (0)