Class: Keystone::Ui::CardComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/keystone/ui/card_component.rb

Constant Summary collapse

CARD_CLASSES =
"overflow-hidden rounded-lg border border-gray-200 bg-white dark:bg-zinc-900 dark:border-zinc-700"
CARD_EDGE_CLASSES =
"overflow-hidden border-y border-gray-200 bg-white sm:rounded-lg sm:border-x dark:bg-zinc-900 dark:border-zinc-700"
BODY_CLASSES =
"px-4 py-4 sm:px-6 sm:pt-6 sm:pb-4"
CTA_CLASSES =
"px-4 pb-4 sm:px-6 sm:pb-6"
TITLE_CLASSES =
"text-lg font-semibold text-gray-900 dark:text-white m-0"
SUMMARY_CLASSES =
"mt-1 text-sm text-gray-500 dark:text-gray-400 mb-0"
"text-sm font-medium no-underline"

Instance Method Summary collapse

Constructor Details

#initialize(title:, summary:, link:, cta: "Read more", edge_to_edge: false) ⇒ CardComponent

Returns a new instance of CardComponent.



14
15
16
17
18
19
20
# File 'app/components/keystone/ui/card_component.rb', line 14

def initialize(title:, summary:, link:, cta: "Read more", edge_to_edge: false)
  @title = title
  @summary = summary
  @link = link
  @cta = cta
  @edge_to_edge = edge_to_edge
end

Instance Method Details



22
23
24
# File 'app/components/keystone/ui/card_component.rb', line 22

def link_classes
  "#{LINK_BASE_CLASSES} text-accent-600 hover:text-accent-900 dark:text-accent-400"
end