Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLAY-1627] Fix Height Prop for HtmlOptions Support #3873

Merged
merged 20 commits into from
Nov 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added Max and Min
  • Loading branch information
jasperfurniss committed Oct 14, 2024
commit 95a66a13d16633fc6a66abc8d21381c1b4bb7441
8 changes: 5 additions & 3 deletions playbook/lib/playbook/kit_base.rb
Original file line number Diff line number Diff line change
@@ -75,6 +75,8 @@ class KitBase < ViewComponent::Base
prop :children, type: Playbook::Props::Proc
prop :style, type: Playbook::Props::HashProp, default: {}
prop :height
prop :min_height
prop :max_height

def object
self
@@ -84,11 +86,11 @@ def combined_html_options
default_html_options.merge(html_options.deep_merge(data_attributes))
end

# Method to generate inline styles based on kit properties
def global_inline_props
{
height: height,
# Add other global props here
min_height: min_height,
max_height: max_height,
}.compact
end

@@ -136,7 +138,7 @@ def default_html_options
{}
end

def data_attributes
def data_attributesx
{
data: data,
aria: aria,
Loading