From 506713f117f1245bc6ae39c1f5c2a2b7094d5192 Mon Sep 17 00:00:00 2001 From: Saleh Yusefnejad Date: Mon, 2 Sep 2024 18:30:30 +0330 Subject: [PATCH 01/38] feat(blazorui): improve BitText component #8473 (#8478) --- .../Inputs/TextField/BitTextFieldTests.cs | 62 +++---- .../Components/Utilities/Text/BitTextTests.cs | 140 +++++++-------- .../BitTextVariant.cs => BitTypography.cs} | 2 +- .../Inputs/TextField/BitTextField.razor | 24 +-- .../Inputs/TextField/BitTextField.razor.cs | 14 +- .../Inputs/TextField/BitTextField.scss | 98 +++++------ .../Components/Utilities/Text/BitText.cs | 51 +++--- .../Components/Utilities/Text/BitText.scss | 36 ++-- .../Components/ComponentClassesTable.razor | 22 +-- .../Components/ComponentDemo.razor | 10 +- .../Components/ComponentEnumsTable.razor | 14 +- .../Components/ComponentExampleBox.razor | 2 +- .../Components/ComponentParametersTable.razor | 20 +-- .../Components/SideRail.razor | 2 +- .../Layouts/Header/BitHeaderDemo.razor | 2 +- .../Layouts/Header/BitHeaderDemo.razor.cs | 2 +- .../Layouts/Spacer/BitSpacerDemo.razor | 2 +- .../Layouts/Spacer/BitSpacerDemo.razor.cs | 2 +- .../Navs/DropMenu/BitDropMenuDemo.razor | 2 +- .../DropMenu/BitDropMenuDemo.razor.samples.cs | 2 +- .../Utilities/Image/BitImageDemo.razor | 4 +- .../Utilities/Overlay/BitOverlayDemo.razor | 2 +- .../Utilities/Overlay/BitOverlayDemo.razor.cs | 2 +- .../Utilities/Text/BitTextDemo.razor | 28 +-- .../Utilities/Text/BitTextDemo.razor.cs | 41 ++--- .../Pages/GettingStartedPage.razor | 32 ++-- .../Pages/Home/BenefitsSection.razor | 18 +- .../Pages/Home/ComponentsSection.razor | 162 +++++++++--------- .../Pages/Home/HeroSection.razor | 4 +- .../Pages/Home/HomePage.razor | 4 +- .../Pages/Home/PopularComponents.razor | 2 +- .../Pages/IconographyPage.razor | 10 +- .../Pages/OverviewPage.razor | 26 +-- .../Pages/ThemingPage.razor | 70 ++++---- .../Shared/Footer.razor | 6 +- 35 files changed, 458 insertions(+), 462 deletions(-) rename src/BlazorUI/Bit.BlazorUI/Components/{Utilities/Text/BitTextVariant.cs => BitTypography.cs} (88%) diff --git a/src/BlazorUI/Bit.BlazorUI.Tests/Components/Inputs/TextField/BitTextFieldTests.cs b/src/BlazorUI/Bit.BlazorUI.Tests/Components/Inputs/TextField/BitTextFieldTests.cs index 086eb334af..4cefd8b55d 100644 --- a/src/BlazorUI/Bit.BlazorUI.Tests/Components/Inputs/TextField/BitTextFieldTests.cs +++ b/src/BlazorUI/Bit.BlazorUI.Tests/Components/Inputs/TextField/BitTextFieldTests.cs @@ -22,8 +22,8 @@ public void BitTextFieldShouldTakeCorrectTypeAndVisual(bool isEnabled, bool isMu parameters.Add(p => p.Required, required); }); - var bitTextField = component.Find(".bit-txt"); - var textField = component.Find(".bit-txt-inp"); + var bitTextField = component.Find(".bit-tfl"); + var textField = component.Find(".bit-tfl-inp"); if (isEnabled) { @@ -37,7 +37,7 @@ public void BitTextFieldShouldTakeCorrectTypeAndVisual(bool isEnabled, bool isMu Assert.AreEqual(isMultiline ? "TEXTAREA" : "INPUT", textField.TagName); Assert.AreEqual(required, textField.HasAttribute("required")); - Assert.AreEqual(required, bitTextField.ClassList.Contains("bit-txt-req")); + Assert.AreEqual(required, bitTextField.ClassList.Contains("bit-tfl-req")); } [DataTestMethod, @@ -52,7 +52,7 @@ public void BitTextFieldShouldTakeValue(bool isMultiline, string value) parameters.Add(p => p.IsMultiline, isMultiline); }); - var bitTextField = component.Find(".bit-txt-inp"); + var bitTextField = component.Find(".bit-tfl-inp"); Assert.AreEqual(bitTextField.GetAttribute("value"), value); } @@ -65,7 +65,7 @@ public void BitTextFieldLabel(string label) parameters.Add(p => p.Label, label); }); - var bitTextFieldLabel = com.Find(".bit-txt-lbl").TextContent; + var bitTextFieldLabel = com.Find(".bit-tfl-lbl").TextContent; Assert.AreEqual(label, bitTextFieldLabel); } @@ -86,7 +86,7 @@ public void BitTextFieldShouldTakeBaseParameters(int maxLength, bool isMultiline parameters.Add(p => p.ReadOnly, readOnly); }); - var bitTextField = component.Find(".bit-txt-inp"); + var bitTextField = component.Find(".bit-tfl-inp"); Assert.IsTrue(bitTextField.HasAttribute("maxlength")); Assert.AreEqual(bitTextField.GetAttribute("maxlength"), maxLength.ToString()); @@ -105,7 +105,7 @@ public void BitTextFieldShouldAcceptIcon(string iconName) parameters.Add(p => p.IconName, iconName); }); - var bitTextFieldIcon = component.Find(".bit-txt-inp + .bit-icon"); + var bitTextFieldIcon = component.Find(".bit-tfl-inp + .bit-icon"); Assert.IsTrue(bitTextFieldIcon.ClassList.Contains($"bit-icon--{iconName}")); } @@ -123,9 +123,9 @@ public void BitTextFieldCanRevealPassword(bool isEnabled) parameters.Add(p => p.CanRevealPassword, true); }); - var textField = component.Find(".bit-txt-inp"); - var revealPasswordBtn = component.Find(".bit-txt-prb"); - var revealPasswordIcon = component.Find(".bit-txt-prb > span > i"); + var textField = component.Find(".bit-tfl-inp"); + var revealPasswordBtn = component.Find(".bit-tfl-prb"); + var revealPasswordIcon = component.Find(".bit-tfl-prb > span > i"); Assert.AreEqual("password", textField.GetAttribute("type")); Assert.IsTrue(revealPasswordIcon.ClassList.Contains($"bit-icon--View")); @@ -148,7 +148,7 @@ public void BitTextFieldTypeTest(BitTextFieldType type) parameters.Add(p => p.Type, type); }); - var textField = component.Find(".bit-txt-inp"); + var textField = component.Find(".bit-tfl-inp"); Assert.AreEqual(type.GetDisplayName(toLowerDisplayName: true), textField.GetAttribute("type")); } @@ -169,7 +169,7 @@ public void BitTextFieldMustRespondToTheClickEvent(bool isEnabled, bool isMultil parameters.Add(p => p.OnClick, () => currentCount++); }); - var bitTextField = component.Find(".bit-txt-inp"); + var bitTextField = component.Find(".bit-tfl-inp"); bitTextField.Click(); @@ -196,7 +196,7 @@ public void BitTextFieldMustRespondToTheFocusEvent(bool isEnabled, bool isMultil parameters.Add(p => p.OnFocusOut, () => focusedOutValue++); }); - var bitTextField = component.Find(".bit-txt-inp"); + var bitTextField = component.Find(".bit-tfl-inp"); bitTextField.Focus(); Assert.AreEqual(isEnabled ? 1 : 0, focusedValue); @@ -226,7 +226,7 @@ public void BitTextFieldMustRespondToTheKeyEvent(bool isEnabled, bool isMultilin parameters.Add(p => p.OnKeyDown, (KeyboardEventArgs e) => keyDownedValue = e.Key); }); - var bitTextField = component.Find(".bit-txt-inp"); + var bitTextField = component.Find(".bit-tfl-inp"); bitTextField.KeyUp(keyUpValue); Assert.AreEqual(isEnabled ? keyUpValue : null, keyUppedValue); @@ -251,7 +251,7 @@ public void BitTextFieldMustRespondToTheChangeEvent(bool isEnabled, bool isMulti parameters.Add(p => p.OnChange, () => currentCount++); }); - var bitTextField = component.Find(".bit-txt-inp"); + var bitTextField = component.Find(".bit-tfl-inp"); bitTextField.Change("a"); @@ -266,7 +266,7 @@ public void BitTextFieldShowPrefix(string prefix) parameters.Add(p => p.Prefix, prefix); }); - var bitTextFieldPrefix = component.Find(".bit-txt-pre > span"); + var bitTextFieldPrefix = component.Find(".bit-tfl-pre > span"); Assert.AreEqual(prefix, bitTextFieldPrefix.TextContent); } @@ -278,7 +278,7 @@ public void BitTextFieldShowSuffix(string suffix) parameters.Add(p => p.Suffix, suffix); }); - var bitTextFieldSuffix = component.Find(".bit-txt-suf > span"); + var bitTextFieldSuffix = component.Find(".bit-tfl-suf > span"); Assert.AreEqual(suffix, bitTextFieldSuffix.TextContent); } @@ -294,7 +294,7 @@ public void BitTextFieldShouldTakeDefaultValue(bool isMultiline, string defaultV parameters.Add(p => p.IsMultiline, isMultiline); }); - var bitTextField = component.Find(".bit-txt-inp"); + var bitTextField = component.Find(".bit-tfl-inp"); Assert.AreEqual(defaultValue, bitTextField.GetAttribute("value")); } @@ -307,7 +307,7 @@ public void BitTextFieldShouldTakeDescription(string description) parameters.Add(p => p.Description, description); }); - var bitTextFieldDescription = component.Find(".bit-txt-des > span"); + var bitTextFieldDescription = component.Find(".bit-tfl-des > span"); Assert.AreEqual(description, bitTextFieldDescription.TextContent); } @@ -322,8 +322,8 @@ public void BitTextFieldShouldRespectUnderLineStyle(bool isUnderlined) parameters.Add(p => p.IsUnderlined, isUnderlined); }); - var bitTextField = component.Find(".bit-txt"); - Assert.AreEqual(isUnderlined, bitTextField.ClassList.Contains("bit-txt-und")); + var bitTextField = component.Find(".bit-tfl"); + Assert.AreEqual(isUnderlined, bitTextField.ClassList.Contains("bit-tfl-und")); } [DataTestMethod, @@ -337,8 +337,8 @@ public void BitTextFieldShouldRespectHasBorderStyle(bool hasBorder) parameters.Add(p => p.HasBorder, hasBorder); }); - var bitTextField = component.Find(".bit-txt"); - Assert.AreEqual(hasBorder is false, bitTextField.ClassList.Contains("bit-txt-nbd")); + var bitTextField = component.Find(".bit-tfl"); + Assert.AreEqual(hasBorder is false, bitTextField.ClassList.Contains("bit-tfl-nbd")); } [DataTestMethod, DataRow(5)] @@ -350,7 +350,7 @@ public void BitTextFieldShouldRespectRowsNumberWhenItIsMultiline(int rows) parameters.Add(p => p.Rows, rows); }); - var input = component.Find(".bit-txt textarea"); + var input = component.Find(".bit-tfl textarea"); Assert.AreEqual(rows.ToString(), input.GetAttribute("rows")); } @@ -366,8 +366,8 @@ public void BitTextFieldShouldRespectIsResizableWhenItIsMultiline(bool isResizab parameters.Add(p => p.IsResizable, isResizable); }); - var bitTextField = component.Find(".bit-txt"); - Assert.AreEqual(!isResizable, bitTextField.ClassList.Contains("bit-txt-mlf")); + var bitTextField = component.Find(".bit-tfl"); + Assert.AreEqual(!isResizable, bitTextField.ClassList.Contains("bit-tfl-mlf")); } [DataTestMethod, @@ -383,7 +383,7 @@ public void BitTextFieldAriaLabelTest(string ariaLabel, bool isMultiline) }); - var input = component.Find(".bit-txt-inp"); + var input = component.Find(".bit-tfl-inp"); Assert.IsTrue(input.HasAttribute("aria-label")); Assert.AreEqual(input.GetAttribute("aria-label"), ariaLabel); @@ -403,7 +403,7 @@ public void BitTextFieldAriaLabelledbyTest(bool isMultiline, string label) parameters.Add(p => p.IsMultiline, isMultiline); }); - var input = component.Find(".bit-txt-inp"); + var input = component.Find(".bit-tfl-inp"); Assert.AreEqual(label.HasValue(), input.HasAttribute("aria-labelledby")); } @@ -420,7 +420,7 @@ public void BitTextFieldAutoCompleteTest(string autoComplete) parameters.Add(p => p.AutoComplete, autoComplete); }); - var input = component.Find(".bit-txt-inp"); + var input = component.Find(".bit-tfl-inp"); if (autoComplete.HasValue()) { @@ -607,7 +607,7 @@ public void BitTextFieldValidationInvalidCssClassTest(string value) var isInvalid = value != "test@bit.com"; - var bitTextField = component.Find(".bit-txt"); + var bitTextField = component.Find(".bit-tfl"); Assert.IsFalse(bitTextField.ClassList.Contains("bit-inv")); @@ -644,7 +644,7 @@ public void BitTextFieldTrimmedDefaultValueTest(string value) parameters.Add(p => p.DefaultValue, value); }); - var bitTextField = component.Find(".bit-txt-inp"); + var bitTextField = component.Find(".bit-tfl-inp"); var trimmedValue = bitTextField.GetAttribute("value"); Assert.AreEqual(value.Trim(), trimmedValue); diff --git a/src/BlazorUI/Bit.BlazorUI.Tests/Components/Utilities/Text/BitTextTests.cs b/src/BlazorUI/Bit.BlazorUI.Tests/Components/Utilities/Text/BitTextTests.cs index ca1aefd534..dccf6534bc 100644 --- a/src/BlazorUI/Bit.BlazorUI.Tests/Components/Utilities/Text/BitTextTests.cs +++ b/src/BlazorUI/Bit.BlazorUI.Tests/Components/Utilities/Text/BitTextTests.cs @@ -8,23 +8,23 @@ namespace Bit.BlazorUI.Tests.Components.Utilities.Text; [TestClass] public class BitTextTests : BunitTestContext { - private static readonly Dictionary VariantMapping = new() + private static readonly Dictionary VariantMapping = new() { - { BitTextVariant.Body1, "p" }, - { BitTextVariant.Body2, "p" }, - { BitTextVariant.Button, "span" }, - { BitTextVariant.Caption1, "span" }, - { BitTextVariant.Caption2, "span" }, - { BitTextVariant.H1, "h1" }, - { BitTextVariant.H2, "h2" }, - { BitTextVariant.H3, "h3" }, - { BitTextVariant.H4, "h4" }, - { BitTextVariant.H5, "h5" }, - { BitTextVariant.H6, "h6" }, - { BitTextVariant.Inherit, "p" }, - { BitTextVariant.Overline, "span" }, - { BitTextVariant.Subtitle1, "h6" }, - { BitTextVariant.Subtitle2, "h6" } + { BitTypography.Body1, "p" }, + { BitTypography.Body2, "p" }, + { BitTypography.Button, "span" }, + { BitTypography.Caption1, "span" }, + { BitTypography.Caption2, "span" }, + { BitTypography.H1, "h1" }, + { BitTypography.H2, "h2" }, + { BitTypography.H3, "h3" }, + { BitTypography.H4, "h4" }, + { BitTypography.H5, "h5" }, + { BitTypography.H6, "h6" }, + { BitTypography.Inherit, "p" }, + { BitTypography.Overline, "span" }, + { BitTypography.Subtitle1, "h6" }, + { BitTypography.Subtitle2, "h6" } }; [DataTestMethod] @@ -32,37 +32,37 @@ public void BitTextShouldRenderExpectedElement() { var component = RenderComponent(); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); } [DataTestMethod, - DataRow(BitTextVariant.H1), - DataRow(BitTextVariant.H2), - DataRow(BitTextVariant.H3), - DataRow(BitTextVariant.H4), - DataRow(BitTextVariant.H5), - DataRow(BitTextVariant.H6), - DataRow(BitTextVariant.Subtitle1), - DataRow(BitTextVariant.Subtitle2), - DataRow(BitTextVariant.Body1), - DataRow(BitTextVariant.Body2), - DataRow(BitTextVariant.Button), - DataRow(BitTextVariant.Caption1), - DataRow(BitTextVariant.Caption2), - DataRow(BitTextVariant.Overline), - DataRow(BitTextVariant.Inherit), + DataRow(BitTypography.H1), + DataRow(BitTypography.H2), + DataRow(BitTypography.H3), + DataRow(BitTypography.H4), + DataRow(BitTypography.H5), + DataRow(BitTypography.H6), + DataRow(BitTypography.Subtitle1), + DataRow(BitTypography.Subtitle2), + DataRow(BitTypography.Body1), + DataRow(BitTypography.Body2), + DataRow(BitTypography.Button), + DataRow(BitTypography.Caption1), + DataRow(BitTypography.Caption2), + DataRow(BitTypography.Overline), + DataRow(BitTypography.Inherit), ] - public void BitTextShouldRespectVariant(BitTextVariant variant) + public void BitTextShouldRespectVariant(BitTypography variant) { var component = RenderComponent(parameters => { - parameters.Add(p => p.Variant, variant); + parameters.Add(p => p.Typography, variant); }); var el = VariantMapping[variant]; - var cssClass = $"bit-tpg-{variant.ToString().ToLower(CultureInfo.InvariantCulture)}"; + var cssClass = $"bit-txt-{variant.ToString().ToLower(CultureInfo.InvariantCulture)}"; - component.MarkupMatches(@$"<{el} class=""bit-tpg {cssClass}"" id:ignore>"); + component.MarkupMatches(@$"<{el} class=""bit-txt {cssClass}"" id:ignore>"); } [DataTestMethod, @@ -77,10 +77,10 @@ public void BitTextShouldRespectElement(string element) parameters.Add(p => p.Element, element); }); - var defaultVariant = BitTextVariant.Subtitle1; + var defaultVariant = BitTypography.Subtitle1; var el = element is null ? VariantMapping[defaultVariant] : element; - component.MarkupMatches(@$"<{el} class=""bit-tpg bit-tpg-subtitle1"" id:ignore>"); + component.MarkupMatches(@$"<{el} class=""bit-txt bit-txt-subtitle1"" id:ignore>"); } @@ -95,9 +95,9 @@ public void BitTextShouldRespectNoWrap(bool noWrap) parameters.Add(p => p.NoWrap, noWrap); }); - var cssClass = noWrap ? " bit-tpg-nowrap" : null; + var cssClass = noWrap ? " bit-txt-nowrap" : null; - component.MarkupMatches(@$"
"); + component.MarkupMatches(@$"
"); } [DataTestMethod] @@ -105,14 +105,14 @@ public void BitTextShouldRespectNoWrapChangingAfterRender() { var component = RenderComponent(); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); component.SetParametersAndRender(parameters => { parameters.Add(p => p.NoWrap, true); }); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); } [DataTestMethod, @@ -126,9 +126,9 @@ public void BitTextShouldRespectGutter(bool gutter) parameters.Add(p => p.Gutter, gutter); }); - var cssClass = gutter ? " bit-tpg-gutter" : null; + var cssClass = gutter ? " bit-txt-gutter" : null; - component.MarkupMatches(@$"
"); + component.MarkupMatches(@$"
"); } [DataTestMethod] @@ -136,14 +136,14 @@ public void BitTextShouldRespectGutterChangingAfterRender() { var component = RenderComponent(); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); component.SetParametersAndRender(parameters => { parameters.Add(p => p.Gutter, true); }); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); } [DataTestMethod, @@ -159,7 +159,7 @@ public void BitTextShouldRespectIsEnabled(bool isEnabled) var cssClass = isEnabled ? null : " bit-dis"; - component.MarkupMatches(@$"
"); + component.MarkupMatches(@$"
"); } [DataTestMethod] @@ -167,14 +167,14 @@ public void BitTextShouldRespectIsEnabledChangingAfterRender() { var component = RenderComponent(); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); component.SetParametersAndRender(parameters => { parameters.Add(p => p.IsEnabled, false); }); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); } [DataTestMethod, @@ -191,11 +191,11 @@ public void BitTextShouldRespectStyle(string style) if (style.HasValue()) { - component.MarkupMatches(@$"
"); + component.MarkupMatches(@$"
"); } else { - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); } } @@ -204,14 +204,14 @@ public void BitTextShouldRespectStyleChangingAfterRender() { var component = RenderComponent(); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); component.SetParametersAndRender(parameters => { parameters.Add(p => p.Style, "padding: 1rem;"); }); - component.MarkupMatches(@$"
"); + component.MarkupMatches(@$"
"); } @@ -228,7 +228,7 @@ public void BitTextShouldRespectClass(string @class) var cssClass = @class.HasValue() ? $" {@class}" : null; - component.MarkupMatches(@$"
"); + component.MarkupMatches(@$"
"); } [DataTestMethod] @@ -236,14 +236,14 @@ public void BitTextShouldRespectClassChangingAfterRender() { var component = RenderComponent(); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); component.SetParametersAndRender(parameters => { parameters.Add(p => p.Class, "test-class"); }); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); } [DataTestMethod, @@ -259,7 +259,7 @@ public void BitTextShouldRespectId(string id) var expectedId = id.HasValue() ? id : component.Instance.UniqueId.ToString(); - component.MarkupMatches(@$"
"); + component.MarkupMatches(@$"
"); } [DataTestMethod, @@ -278,11 +278,11 @@ public void BitTextShouldRespectDir(BitDir? dir) if (dir.HasValue) { var cssClass = dir is BitDir.Rtl ? " bit-rtl" : null; - component.MarkupMatches(@$"
"); + component.MarkupMatches(@$"
"); } else { - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); } } @@ -291,14 +291,14 @@ public void BitTextShouldRespectDirChangingAfterRender() { var component = RenderComponent(); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); component.SetParametersAndRender(parameters => { parameters.Add(p => p.Dir, BitDir.Ltr); }); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); } [DataTestMethod, @@ -316,13 +316,13 @@ public void BitTextShouldRespectVisibility(BitVisibility visibility) switch (visibility) { case BitVisibility.Visible: - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); break; case BitVisibility.Hidden: - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); break; case BitVisibility.Collapsed: - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); break; } } @@ -332,14 +332,14 @@ public void BitTextShouldRespectVisibilityChangingAfterRender() { var component = RenderComponent(); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); component.SetParametersAndRender(parameters => { parameters.Add(p => p.Visibility, BitVisibility.Collapsed); }); - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); } [DataTestMethod, @@ -355,11 +355,11 @@ public void BitTextShouldRespectAriaLabel(string ariaLabel) if (ariaLabel.HasValue()) { - component.MarkupMatches(@$"
"); + component.MarkupMatches(@$"
"); } else { - component.MarkupMatches(@"
"); + component.MarkupMatches(@"
"); } } @@ -375,7 +375,7 @@ public void BitTextShouldRespectChildContent(string childContent) parameters.AddChildContent(childContent); }); - component.MarkupMatches(@$"
{childContent}
"); + component.MarkupMatches(@$"
{childContent}
"); } [DataTestMethod] @@ -383,6 +383,6 @@ public void BitTextShouldRespectHtmlAttributes() { var component = RenderComponent(); - component.MarkupMatches(@"
I'm a text
"); + component.MarkupMatches(@"
I'm a text
"); } } diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Utilities/Text/BitTextVariant.cs b/src/BlazorUI/Bit.BlazorUI/Components/BitTypography.cs similarity index 88% rename from src/BlazorUI/Bit.BlazorUI/Components/Utilities/Text/BitTextVariant.cs rename to src/BlazorUI/Bit.BlazorUI/Components/BitTypography.cs index eced8e497d..1d68490e82 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Utilities/Text/BitTextVariant.cs +++ b/src/BlazorUI/Bit.BlazorUI/Components/BitTypography.cs @@ -1,6 +1,6 @@ namespace Bit.BlazorUI; -public enum BitTextVariant +public enum BitTypography { H1, H2, diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/TextField/BitTextField.razor b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/TextField/BitTextField.razor index 58e49736b8..7dfd26370c 100644 --- a/src/BlazorUI/Bit.BlazorUI/Components/Inputs/TextField/BitTextField.razor +++ b/src/BlazorUI/Bit.BlazorUI/Components/Inputs/TextField/BitTextField.razor @@ -6,7 +6,7 @@ style="@StyleBuilder.Value" class="@ClassBuilder.Value" dir="@Dir?.ToString().ToLower()"> -
+
@if (LabelTemplate is not null) {