Class: BetterUi::Application::Card::Component
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- BetterUi::Application::Card::Component
- Defined in:
- app/components/better_ui/application/card/component.rb
Constant Summary collapse
- CARD_THEME =
Costanti per le classi CSS
{ default: 'bg-gray-900 border-gray-800', white: 'bg-white border-gray-200', red: 'bg-red-50 border-red-200', rose: 'bg-rose-50 border-rose-200', orange: 'bg-orange-50 border-orange-200', green: 'bg-green-50 border-green-200', blue: 'bg-blue-50 border-blue-200', yellow: 'bg-yellow-50 border-yellow-200', violet: 'bg-violet-50 border-violet-200', purple: 'bg-purple-50 border-purple-200' }.freeze
- CARD_SIZE =
{ small: 'p-4', medium: 'p-6', large: 'p-8' }.freeze
- CARD_ROUNDED =
{ none: 'rounded-none', small: 'rounded-md', medium: 'rounded-lg', large: 'rounded-xl', full: 'rounded-2xl' }.freeze
- CARD_SHADOW =
{ none: 'shadow-none', small: 'shadow-sm', medium: 'shadow-md', large: 'shadow-lg' }.freeze
- CARD_TREND_COLOR =
{ green: 'text-green-600', red: 'text-red-600', blue: 'text-blue-600', yellow: 'text-yellow-600', purple: 'text-purple-600', indigo: 'text-indigo-600', gray: 'text-gray-600' }.freeze
- CARD_TITLE_SIZE =
{ small: 'text-xs', medium: 'text-sm', large: 'text-base' }.freeze
- CARD_VALUE_SIZE =
{ small: 'text-lg', medium: 'text-2xl', large: 'text-3xl' }.freeze
Instance Method Summary collapse
-
#initialize(title:, value:, trend: nil, change: nil, color: :green, theme: :default, size: :medium, rounded: :medium, shadow: :small, classes: nil, **options) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(title:, value:, trend: nil, change: nil, color: :green, theme: :default, size: :medium, rounded: :medium, shadow: :small, classes: nil, **options) ⇒ Component
Returns a new instance of Component.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'app/components/better_ui/application/card/component.rb', line 64 def initialize( title:, value:, trend: nil, change: nil, color: :green, theme: :default, size: :medium, rounded: :medium, shadow: :small, classes: nil, ** ) @title = title @value = value @trend = trend @change = change @color = color @theme = theme @size = size @rounded = rounded @shadow = shadow @classes = classes @options = validate_params end |