From 853f7b4c59914d61acb451fe7a3737f404e47dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emin=20Can=20=C3=96ZGE?= Date: Fri, 22 Mar 2024 14:17:28 +0300 Subject: [PATCH 1/3] Add Card component --- README.md | 16 ++++++++++++++++ SiemensIXBlazor/Components/Card/Card.razor | 14 ++++++++++++++ SiemensIXBlazor/Components/Card/Card.razor.cs | 17 +++++++++++++++++ SiemensIXBlazor/Enums/Card/CardVariant.cs | 16 ++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 SiemensIXBlazor/Components/Card/Card.razor create mode 100644 SiemensIXBlazor/Components/Card/Card.razor.cs create mode 100644 SiemensIXBlazor/Enums/Card/CardVariant.cs diff --git a/README.md b/README.md index 98e2acb..5e4037c 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ public partial class Index - [Blind](#blind) - [Breadcrumb](#breadcrumb) - [Button](#button) +- [Card](#card) - [Card List](#card-list) **(since v0.3.3)** - [Push Card](#push-card) **(since v0.3.3)** - [Action Card](#action-card) **(since v0.3.3)** @@ -418,6 +419,21 @@ Test content ``` +## Card + +```razor + + + Number of components + + Item 1
+ Item 2
+ Item 3 +
+ 3 +
+``` + ## Card List ```razor diff --git a/SiemensIXBlazor/Components/Card/Card.razor b/SiemensIXBlazor/Components/Card/Card.razor new file mode 100644 index 0000000..13fc9f9 --- /dev/null +++ b/SiemensIXBlazor/Components/Card/Card.razor @@ -0,0 +1,14 @@ +@namespace SiemensIXBlazor.Components +@inherits IXBaseComponent +@using SiemensIXBlazor.Helpers + + + + @ChildContent + + \ No newline at end of file diff --git a/SiemensIXBlazor/Components/Card/Card.razor.cs b/SiemensIXBlazor/Components/Card/Card.razor.cs new file mode 100644 index 0000000..a35d0df --- /dev/null +++ b/SiemensIXBlazor/Components/Card/Card.razor.cs @@ -0,0 +1,17 @@ +using Microsoft.AspNetCore.Components; +using SiemensIXBlazor.Enums; + +namespace SiemensIXBlazor.Components +{ + public partial class Card + { + [Parameter, EditorRequired] + public string Id { get; set; } = string.Empty; + [Parameter] + public bool? Selected { get; set; } + [Parameter] + public CardVariant Variant { get; set; } = CardVariant.insight; + [Parameter] + public RenderFragment? ChildContent { get; set; } + } +} diff --git a/SiemensIXBlazor/Enums/Card/CardVariant.cs b/SiemensIXBlazor/Enums/Card/CardVariant.cs new file mode 100644 index 0000000..7185fa6 --- /dev/null +++ b/SiemensIXBlazor/Enums/Card/CardVariant.cs @@ -0,0 +1,16 @@ + +namespace SiemensIXBlazor.Enums +{ + public enum CardVariant + { + alarm, + critical, + info, + insight, + neutral, + notification, + primary, + success, + warning + } +} From 4ff1688c0673cd604d93966ec853aff4c3d2f4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emin=20Can=20=C3=96ZGE?= Date: Fri, 22 Mar 2024 15:42:27 +0300 Subject: [PATCH 2/3] Remove Id parameter --- SiemensIXBlazor/Components/Card/Card.razor | 1 - SiemensIXBlazor/Components/Card/Card.razor.cs | 2 -- 2 files changed, 3 deletions(-) diff --git a/SiemensIXBlazor/Components/Card/Card.razor b/SiemensIXBlazor/Components/Card/Card.razor index 13fc9f9..f294692 100644 --- a/SiemensIXBlazor/Components/Card/Card.razor +++ b/SiemensIXBlazor/Components/Card/Card.razor @@ -3,7 +3,6 @@ @using SiemensIXBlazor.Helpers Date: Fri, 22 Mar 2024 15:51:51 +0300 Subject: [PATCH 3/3] Update Card example in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e4037c..8fed191 100644 --- a/README.md +++ b/README.md @@ -422,7 +422,7 @@ Test content ## Card ```razor - + Number of components @@ -1062,7 +1062,7 @@ div[data-tab-content].show { ```razor
Tile header
-
92.8 °C
+
92.8 °C
```