-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #248 from fluentcms/235-develop-primary-blazor-com…
…ponents 235 develop primary blazor components
- Loading branch information
Showing
31 changed files
with
815 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<div class="f-alert f-alert-type-@Type" id="@Id" role="alert"> | ||
<Icon Class="f-alert-icon" Pack="carbon" Name="information-filled" /> | ||
<div> | ||
@ChildContent | ||
</div> | ||
|
||
@if (Dismissible) | ||
{ | ||
<button type="button" class="f-alert-close" data-dismiss-target="#@Id" aria-label="Close"> | ||
<span class="sr-only">Close</span> | ||
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14"> | ||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" | ||
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6" /> | ||
</svg> | ||
</button> | ||
} | ||
|
||
</div> | ||
|
||
@code { | ||
[Parameter] | ||
public string Id { get; set; } = "alert-" + Guid.NewGuid().ToString(); | ||
|
||
[Parameter] | ||
public string Type { get; set; } = "default"; | ||
|
||
[Parameter] | ||
public RenderFragment ChildContent { get; set; } | ||
|
||
[Parameter] | ||
public bool Dismissible { get; set; } = false; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="f-alert-container"> | ||
@ChildContent | ||
</div> | ||
|
||
@code { | ||
[Parameter] | ||
public RenderFragment ChildContent {get; set;} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 12 additions & 12 deletions
24
src/FluentCMS.Web.UI/Components/Core/DropdownButton.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
|
||
<Button id="dropdownDefaultButton" data-dropdown-toggle="dropdown"> | ||
@Text | ||
<Button id="dropdown-123-button" data-dropdown-toggle="@Id"> | ||
@Text | ||
|
||
<svg class="f-button-icon" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6"> | ||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/> | ||
</svg> | ||
</Button> | ||
|
||
<div id="dropdown" class="f-dropdown hidden"> | ||
<ul class="f-dropdown-menu" aria-labelledby="dropdownDefaultButton"> | ||
@ChildContent | ||
</ul> | ||
</div> | ||
<DropdownMenu Id="@Id"> | ||
@ChildContent | ||
</DropdownMenu> | ||
|
||
@code { | ||
[Parameter] | ||
public string Text {get; set;} | ||
public string Text {get; set;} | ||
|
||
[Parameter] | ||
public RenderFragment ChildContent {get; set;} | ||
|
||
[Parameter] | ||
public RenderFragment ChildContent {get; set;} | ||
} | ||
[Parameter] | ||
public string Id { get; set; } = "dropdown-" + Guid.NewGuid().ToString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
<!-- Dropdown menu --> | ||
|
||
<div id="@Id" class="f-dropdown hidden"> | ||
<ul class="f-dropdown-menu" aria-labelledby="@Id"> | ||
@ChildContent | ||
</ul> | ||
</div> | ||
|
||
|
||
@code { | ||
[Parameter] | ||
public RenderFragment ChildContent {get; set;} | ||
} | ||
|
||
[Parameter] | ||
public string Id { get; set; } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<div class="flex items-center"> | ||
<input id="@Id" type="checkbox" class="f-checkbox" disabled=@Disabled required="@Required" @bind="Checked" @attributes=@RestProps> | ||
|
||
@if (ChildContent != null) | ||
{ | ||
@ChildContent | ||
} | ||
else if (Text != "") | ||
{ | ||
<FormCheckText>@Text</FormCheckText> | ||
} | ||
</div> | ||
|
||
@code { | ||
[Parameter] | ||
public string Id { get; set; } | ||
|
||
[Parameter] | ||
public bool Required { get; set; } | ||
|
||
[Parameter] | ||
public bool Disabled { get; set; } | ||
|
||
[Parameter] | ||
public bool Checked { get; set; } | ||
|
||
[Parameter] | ||
public string Text { get; set; } = ""; | ||
|
||
[Parameter] | ||
public RenderFragment ChildContent { get; set; } | ||
|
||
[Parameter(CaptureUnmatchedValues =true)] | ||
public Dictionary<string, object> RestProps { get; set; } | ||
} |
18 changes: 18 additions & 0 deletions
18
src/FluentCMS.Web.UI/Components/Core/Form/FormCheckText.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div class="f-form-check"> | ||
@* ml-3 text-sm *@ | ||
@* font-medium text-gray-900 dark:text-white *@ | ||
<label for="@Id" class="f-form-check-text"> | ||
@ChildContent | ||
</label> | ||
</div> | ||
|
||
|
||
@code { | ||
[Parameter] | ||
public string Id { get; set; } | ||
|
||
[Parameter] | ||
public RenderFragment ChildContent { get; set; } | ||
|
||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/FluentCMS.Web.UI/Components/Core/Form/FormCheckbox.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<FormField Id=@Id Label=@Label> | ||
<Checkbox Text=@Text Id=@Id Required=@Required/> | ||
</FormField> | ||
|
||
@code { | ||
[Parameter] | ||
public string Id {get; set;} = "f-" + Guid.NewGuid().ToString(); | ||
|
||
[Parameter] | ||
public string Text { get; set; } = ""; | ||
|
||
[Parameter] | ||
public string Label {get; set;} = ""; | ||
|
||
[Parameter] | ||
public bool Required {get; set;} = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/FluentCMS.Web.UI/Components/Core/Form/FormTextarea.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<FormField Id=@Id Label=@Label> | ||
<Textarea Rows=@Rows Placeholder=@Placeholder Id=@Id Required=@Required @attributes=@RestProps @bind-Value=@Value/> | ||
</FormField> | ||
|
||
@code { | ||
[Parameter] | ||
public string Placeholder {get; set;} = ""; | ||
|
||
[Parameter] | ||
public string Id {get; set;} = "f-" + Guid.NewGuid().ToString(); | ||
|
||
[Parameter] | ||
public string Rows {get; set;} | ||
|
||
[Parameter] | ||
public string Label {get; set;} = ""; | ||
|
||
[Parameter] | ||
public bool Required {get; set;} = false; | ||
|
||
[Parameter] | ||
public string Value {get; set;} | ||
|
||
[Parameter(CaptureUnmatchedValues = true)] | ||
public Dictionary<string, object> RestProps {get; set;} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<textarea class="f-textarea" id="@Id" rows="@Rows" placeholder="@Placeholder" required=@Required @attributes=@RestProps @bind="@Value" /> | ||
|
||
@code { | ||
[Parameter] | ||
public string Rows {get; set;} = "5"; | ||
|
||
[Parameter] | ||
public string Id {get; set;} | ||
|
||
[Parameter] | ||
public string Placeholder {get; set;} | ||
|
||
[Parameter] | ||
public bool Required {get; set;} = false; | ||
|
||
[Parameter] | ||
public string Value {get; set;} | ||
|
||
[Parameter(CaptureUnmatchedValues =true)] | ||
public Dictionary<string, object> RestProps {get; set;} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<span class="f-icon f-icon-size-@Size @Class" @attributes=@RestProps> | ||
<iconify-icon icon=@($"{Pack}:{Name}") width="100%" height="100%" /> | ||
</span> | ||
|
||
@code { | ||
[Parameter] | ||
public string Name {get; set;} = ""; | ||
|
||
[Parameter] | ||
public string Pack {get; set;} = "tabler"; | ||
|
||
[Parameter] | ||
public string Class {get; set;} = ""; | ||
|
||
[Parameter] | ||
public string Size {get; set;} = "md"; | ||
|
||
|
||
[Parameter(CaptureUnmatchedValues = true)] | ||
public Dictionary<string, object> RestProps {get; set;} | ||
} |
Oops, something went wrong.