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

Fix spelling of 'componeont' to 'component' #144

Merged
merged 2 commits into from
Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions docs/guide/controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ By default the name of the control in Storybook is derived from the name of the
For example this story results in two controls with names "First Name" and "Last Name"

```ruby
# test/components/stories/person_componeont_stories.rb
# test/components/stories/person_component_stories.rb
class PersonComponentStories < ViewComponent::Storybook::Stories
story :person do
constructor(
Expand All @@ -217,7 +217,7 @@ end
The control name is configured using `name`:

```ruby
# test/components/stories/person_componeont_stories.rb
# test/components/stories/person_component_stories.rb
class PersonComponentStories < ViewComponent::Storybook::Stories
story :person do
constructor(
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Returning the rendered html to Storybook:
Storybook isn't just for rendering static stories. Storybook [controls](https://storybook.js.org/docs/react/essentials/controls) enable dynamic stories with variable inputs. ViewComponent Storybook exposes a similar api to describe dynamic inputs to component stories. For example add the `text` control to make `title` and `content` dynamic:

```ruby
# test/components/stories/example_componeont_stories.rb
# test/components/stories/example_component_stories.rb
class ExampleComponentStories < ViewComponent::Storybook::Stories
story :hello_world do
constructor(title: text("my title"))
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Configure Storybook addons with `parameters`. Global parameters are defined in `


```ruby
# test/components/stories/header_componeont_stories.rb
# test/components/stories/header_component_stories.rb
class HeaderComponentStories < ViewComponent::Storybook::Stories
# disable a11y for all stories in this class
parameters(a11y: { disable: true ))
Expand Down
16 changes: 8 additions & 8 deletions docs/guide/stories.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nav_order: 2
Stories are Ruby classes that inherit from `ViewComponent::Storybook::Stories`. Stories can have one or more stories defined with `story(story_name)`:

```ruby
# test/components/stories/header_componeont_stories.rb
# test/components/stories/header_component_stories.rb
class HeaderComponentStories < ViewComponent::Storybook::Stories
story :h1 do
constructor("h1")
Expand All @@ -19,15 +19,15 @@ class HeaderComponentStories < ViewComponent::Storybook::Stories
story :h2 do
constructor("h2")
end
end
end.
```

## Stories Title

By default the stories title derives from the stories class name. The class `HeaderComponentStories` above will have a title of "Header Component". Configure a custom title with `title`:

```ruby
# test/components/stories/header_componeont_stories.rb
# test/components/stories/header_component_stories.rb
class HeaderComponentStories < ViewComponent::Storybook::Stories
title "H1 Headers Stories"

Expand All @@ -44,7 +44,7 @@ default to `HeaderComponent`. This supports a common convention of grouping all
together. The second argument to the `story` method configures the component class:

```ruby
# test/components/stories/header_componeont_stories.rb
# test/components/stories/header_component_stories.rb
class HeaderComponentStories < ViewComponent::Storybook::Stories
story :h1 do
constructor("h1")
Expand All @@ -61,7 +61,7 @@ end
Components are rendered in the default application layout. The layout for a set of stories is configured with `layout`:

```ruby
# test/components/stories/header_componeont_stories.rb
# test/components/stories/header_component_stories.rb
class HeaderComponentStories < ViewComponent::Storybook::Stories
layout :desktop

Expand All @@ -76,7 +76,7 @@ end
Individual stories can define their own layout that overrides the stories setting:

```ruby
# test/components/stories/header_componeont_stories.rb
# test/components/stories/header_component_stories.rb
class HeaderComponentStories < ViewComponent::Storybook::Stories
layout :desktop

Expand All @@ -96,7 +96,7 @@ end
Setting layout to false renders the component in isolation:

```ruby
# test/components/stories/header_componeont_stories.rb
# test/components/stories/header_component_stories.rb
class HeaderComponentStories < ViewComponent::Storybook::Stories
story :no_layout_h1 do
layout false
Expand All @@ -115,7 +115,7 @@ stories layout:
class ApplicationStories < ViewComponent::Storybook::Stories
layout :stories

# test/components/stories/header_componeont_stories.rb
# test/components/stories/header_component_stories.rb
class HeaderComponentStories < ApplicationStories
story :h1 do
constructor("h1")
Expand Down
4 changes: 2 additions & 2 deletions lib/view_component/storybook/slots/slot_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def self.from_component(component_class, slot_name, param, *args, **kwargs, &blo
)
end

def slot(componeont, params)
def slot(component, params)
resolved_method_args = slot_method_args.resolve_method_args(params)
story_content_block = resolve_content_block(params)
Slot.new(componeont, slot_name, resolved_method_args, story_content_block)
Slot.new(component, slot_name, resolved_method_args, story_content_block)
end

def controls
Expand Down