Skip to content

Commit

Permalink
remove fab
Browse files Browse the repository at this point in the history
  • Loading branch information
woylie committed Jul 29, 2024
1 parent bd25d1d commit 5259500
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 185 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

### Removed

- The `fab` component was removed. It might have made sense to have it as a
separate component before components could be customized, but since the
semantics are the same as a regular button, you can just make one with
`build_button(name: :fab, base_class: "fab")` if you need it.

## [0.8.2] - 2024-07-28

### Fixed
Expand Down
1 change: 0 additions & 1 deletion demo/lib/demo_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ defmodule DemoWeb.CoreComponents do
build_datetime()
build_disclosure_button()
build_drawer()
build_fab()
build_fallback()
build_field()
build_field_group()
Expand Down
4 changes: 0 additions & 4 deletions demo/storybook/buttons/fab.story.exs

This file was deleted.

2 changes: 0 additions & 2 deletions lib/doggo/components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ defmodule Doggo.Components do
build_datetime()
build_disclosure_button()
build_drawer()
build_fab()
build_fallback()
build_field_group()
build_frame()
Expand Down Expand Up @@ -147,7 +146,6 @@ defmodule Doggo.Components do
component(:datetime)
component(:disclosure_button)
component(:drawer)
component(:fab)
component(:fallback)
component(:field)
component(:field_group)
Expand Down
3 changes: 1 addition & 2 deletions lib/doggo/components/button.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ defmodule Doggo.Components.Button do
current page and want to style the link like a button, use `button_link/1`
instead.
See also `button_link/1`, `toggle_button/1`, `disclosure_button/1`, and
`fab/1`.
See also `button_link/1`, `toggle_button/1`, and `disclosure_button/1`.
"""
end

Expand Down
83 changes: 0 additions & 83 deletions lib/doggo/components/fab.ex

This file was deleted.

36 changes: 0 additions & 36 deletions lib/doggo/storybook/fab.ex

This file was deleted.

56 changes: 0 additions & 56 deletions test/doggo/components_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ defmodule Doggo.ComponentsTest do
build_datetime()
build_disclosure_button()
build_drawer()
build_fab()
build_fallback()
build_field(gettext_module: Doggo.Gettext)
build_field_group()
Expand Down Expand Up @@ -2268,61 +2267,6 @@ defmodule Doggo.ComponentsTest do
end
end

describe "fab/1" do
test "default" do
assigns = %{}

html =
parse_heex(~H"""
<TestComponents.fab label="Add toy">add-icon</TestComponents.fab>
""")

button = find_one(html, "button:root")
assert attribute(button, "type") == "button"
assert attribute(button, "class") == "fab is-primary is-normal is-circle"
assert attribute(button, "aria-label") == "Add toy"
assert text(button) == "add-icon"
end

test "disabled" do
assigns = %{}

html =
parse_heex(~H"""
<TestComponents.fab label="Add toy" disabled>add-icon</TestComponents.fab>
""")

assert attribute(html, "button:root", "disabled") == "disabled"
end

test "with variant" do
assigns = %{}

html =
parse_heex(~H"""
<TestComponents.fab label="Add toy" variant="success">
add-icon
</TestComponents.fab>
""")

assert attribute(html, "button:root", "class") ==
"fab is-success is-normal is-circle"
end

test "with global attribute" do
assigns = %{}

html =
parse_heex(~H"""
<TestComponents.fab label="Add toy" phx-click="add">
add-icon
</TestComponents.fab>
""")

assert attribute(html, "button:root", "phx-click") == "add"
end
end

describe "icon/1" do
test "default" do
assigns = %{}
Expand Down
1 change: 0 additions & 1 deletion test/doggo/storybook_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ defmodule Doggo.StorybookTest do
)

build_drawer(modifiers: [variant: [values: [nil, "yes"], default: nil]])
build_fab(modifiers: [variant: [values: [nil, "yes"], default: nil]])
build_fallback(modifiers: [variant: [values: [nil, "yes"], default: nil]])
build_field()

Expand Down

0 comments on commit 5259500

Please sign in to comment.