Class: Protos::Badge

Inherits:
Component show all
Defined in:
lib/protos/badge.rb

Constant Summary collapse

Styles =
Types::Coercible::Symbol.enum(
  *Types::Styles.values,
  :ghost
)
Sizes =
Types::Coercible::Symbol.enum(:default, :xs, :sm, :md, :lg, :xl)
STYLES =
{
  default: "",
  neutral: "badge-neutral",
  success: "badge-success",
  primary: "badge-primary",
  secondary: "badge-secondary",
  info: "badge-info",
  error: "badge-error",
  warning: "badge-warning",
  ghost: "badge-ghost"
}.freeze
SIZES =
{
  default: "badge-md",
  xs: "badge-xs",
  sm: "badge-sm",
  md: "badge-md",
  lg: "badge-lg",
  xl: "badge-xl"
}.freeze

Instance Method Summary collapse

Methods inherited from Component

#initialize

Constructor Details

This class inherits a constructor from Protos::Component

Instance Method Details

#view_templateObject



39
40
41
# File 'lib/protos/badge.rb', line 39

def view_template(&)
  span(**attrs, &)
end