Class: Plutonium::UI::Breadcrumbs

Inherits:
Component::Base show all
Includes:
Phlex::Rails::Helpers::ActionName, Phlex::Rails::Helpers::LinkTo
Defined in:
lib/plutonium/ui/breadcrumbs.rb

Constant Summary collapse

LABEL_CLASSES =

Shared styling for an inline breadcrumb label.

"ms-1 md:ms-2 flex items-center min-w-0 text-sm font-medium " \
"text-[var(--pu-text-muted)] transition-colors"
"#{LABEL_CLASSES} hover:text-primary-600"
"flex items-center gap-1.5 py-1.5 px-3 text-sm text-[var(--pu-text-muted)] " \
"hover:text-[var(--pu-text)] hover:bg-[var(--pu-surface-alt)] transition-colors"
CHEVRON_INLINE_CLASSES =
"rtl:rotate-180 block w-3 h-3 mx-1 shrink-0 text-[var(--pu-text-subtle)]"
CHEVRON_MENU_CLASSES =
"rtl:rotate-180 block w-3 h-3 shrink-0 text-[var(--pu-text-subtle)]"

Instance Method Summary collapse

Methods included from Component::Behaviour

#around_template

Methods included from Component::Tokens

#classes, #tokens

Methods included from Component::Kit

#BuildActionButton, #BuildActionsDropdown, #BuildAvatar, #BuildBlock, #BuildBreadcrumbs, #BuildBulkActionsToolbar, #BuildColorModeSelector, #BuildDynaFrameContent, #BuildDynaFrameHost, #BuildEmptyCard, #BuildFrameNavigatorPanel, #BuildModalCentered, #BuildModalSlideover, #BuildPageHeader, #BuildPanel, #BuildRowActionsDropdown, #BuildSkeletonTable, #BuildTabList, #BuildTableFilterPills, #BuildTableInfo, #BuildTablePagination, #BuildTableScopesBar, #BuildTableScopesPills, #BuildTableSearchBar, #BuildTableToolbar, #BuildTableViewSwitcher, #method_missing, #respond_to_missing?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Plutonium::UI::Component::Kit

Instance Method Details

#view_templateObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/plutonium/ui/breadcrumbs.rb', line 21

def view_template
  # `overflow-hidden` keeps the un-collapsed trail from spilling in the
  # instant before the controller's first reflow.
  nav(
    class: "flex min-w-0 py-3 mb-2 overflow-hidden",
    aria_label: "Breadcrumb",
    data: {controller: "breadcrumbs"}
  ) do
    ol(
      class: "flex flex-nowrap w-full min-w-0 items-center gap-1 md:gap-2",
      data: {breadcrumbs_target: "list"}
    ) do
      render_dashboard_link
      render_overflow_menu if middle_items.any?
      render_items
      render_trailing_separator
    end
  end
end