Components/Daisy/ wraps all 69 components in daisyUI's llms.txt, grouped by daisyUI's categories (Actions, DataDisplay, Navigation, Feedback, DataInput, Layout, Mockup), with part components where daisyUI has repeating parts (DTab, DMenuItem, DTimelineItem, ...). - Each enum maps to whole literal class names in a switch, so Tailwind's scanner generates them. Nothing is concatenated. - Value-holding fields derive from DInputBase<TValue>, Blazor's InputBase, so @bind-Value and EditForm validation work. Invalid fields get the component's *-error class. - Open and active state lives in C# (@bind-IsOpen, @bind-Active) and is rendered with daisyUI's *-open modifiers. DDropdown adds an outside-click layer and Escape. No component uses JS interop. - The one exception is DCalendar, which wraps the Cally web component, vendored as wwwroot/vendor/cally.js (0.9.2, MIT). /styleguide (not linked) renders every component in all its colours, sizes and states, with a theme and hue picker that previews without saving. neo.css follows what the styleguide showed: - select keeps daisyUI's arrow; - skeleton-text isn't sunk; - the phone mockup and dock are raised; - active menu items and OTP digits are inset; - a joined accordion is raised as one block. The primary, secondary and accent colours are deeper, so they still read as text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
54 lines
2.3 KiB
Plaintext
54 lines
2.3 KiB
Plaintext
@inherits DComponentBase
|
|
|
|
@* daisyUI FAB: https://daisyui.com/components/fab/ . Opening is daisyUI's own :focus-within rule (there is no
|
|
open-state class): the trigger is the focusable first child, and focus moving out of the FAB closes it. The order
|
|
of the children matters to daisyUI: trigger, then Close or MainAction, then the speed-dial items (ChildContent,
|
|
e.g. DButton Size="DSize.Lg" Shape="DButtonShape.Circle", optionally inside a <div> with a text label). *@
|
|
<div @attributes="AdditionalAttributes" class="@CssClass">
|
|
<div tabindex="0" role="button" aria-label="@LabelText" class="@Cx("btn btn-lg btn-circle", ColorClass, TriggerClass)">
|
|
@Trigger
|
|
</div>
|
|
@if (Close is not null)
|
|
{
|
|
<div class="fab-close">@Close</div>
|
|
}
|
|
@if (MainAction is not null)
|
|
{
|
|
<div class="fab-main-action">@MainAction</div>
|
|
}
|
|
@ChildContent
|
|
</div>
|
|
|
|
@code {
|
|
/// <summary>Content of the button shown while closed, usually an icon.</summary>
|
|
[Parameter] public RenderFragment Trigger { get; set; }
|
|
/// <summary>Accessible name of the trigger (aria-label), since it usually holds only an icon.</summary>
|
|
[Parameter] public string LabelText { get; set; }
|
|
[Parameter] public DColor Color { get; set; } = DColor.Primary;
|
|
[Parameter] public string TriggerClass { get; set; }
|
|
/// <summary>Replaces the trigger while open; clicking it closes the FAB. Not focusable, e.g. a text label and a
|
|
/// <span class="btn btn-circle btn-lg">.</summary>
|
|
[Parameter] public RenderFragment Close { get; set; }
|
|
/// <summary>Replaces the trigger while open with a main action, e.g. a label and a button.</summary>
|
|
[Parameter] public RenderFragment MainAction { get; set; }
|
|
/// <summary>The speed-dial items.</summary>
|
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
|
/// <summary>Arrange the items in a quarter circle (fab-flower) instead of a column.</summary>
|
|
[Parameter] public bool Flower { get; set; }
|
|
|
|
string CssClass => Cx("fab", Flower ? "fab-flower" : null, Class);
|
|
|
|
string ColorClass => Color switch
|
|
{
|
|
DColor.Neutral => "btn-neutral",
|
|
DColor.Primary => "btn-primary",
|
|
DColor.Secondary => "btn-secondary",
|
|
DColor.Accent => "btn-accent",
|
|
DColor.Info => "btn-info",
|
|
DColor.Success => "btn-success",
|
|
DColor.Warning => "btn-warning",
|
|
DColor.Error => "btn-error",
|
|
_ => null
|
|
};
|
|
}
|