Class: Keystone::Ui::ColorPickerComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Keystone::Ui::ColorPickerComponent
- Defined in:
- app/components/keystone/ui/color_picker_component.rb
Constant Summary collapse
- SWATCH_CLASSES =
"w-10 h-10 rounded-lg border border-gray-300 dark:border-zinc-600 cursor-pointer"- PANEL_CLASSES =
"absolute z-50 mt-2 p-3 rounded-lg shadow-lg bg-white dark:bg-zinc-800 border border-gray-200 dark:border-zinc-700 hidden"
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #controller_name ⇒ Object
-
#initialize(name:, value: "#000000", label: nil) ⇒ ColorPickerComponent
constructor
A new instance of ColorPickerComponent.
- #panel_classes ⇒ Object
- #swatch_classes ⇒ Object
Constructor Details
#initialize(name:, value: "#000000", label: nil) ⇒ ColorPickerComponent
Returns a new instance of ColorPickerComponent.
12 13 14 15 16 |
# File 'app/components/keystone/ui/color_picker_component.rb', line 12 def initialize(name:, value: "#000000", label: nil) @name = name @value = value @label = label end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
10 11 12 |
# File 'app/components/keystone/ui/color_picker_component.rb', line 10 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'app/components/keystone/ui/color_picker_component.rb', line 10 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
10 11 12 |
# File 'app/components/keystone/ui/color_picker_component.rb', line 10 def value @value end |
Instance Method Details
#controller_name ⇒ Object
18 19 20 |
# File 'app/components/keystone/ui/color_picker_component.rb', line 18 def controller_name "color-picker" end |
#panel_classes ⇒ Object
26 27 28 |
# File 'app/components/keystone/ui/color_picker_component.rb', line 26 def panel_classes PANEL_CLASSES end |
#swatch_classes ⇒ Object
22 23 24 |
# File 'app/components/keystone/ui/color_picker_component.rb', line 22 def swatch_classes SWATCH_CLASSES end |