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

0.5.1 #128

Merged
merged 13 commits into from
Sep 24, 2023
Prev Previous commit
Next Next commit
Rename parent_child_avatar to avatar_pair
  • Loading branch information
ArthurClemens committed Aug 25, 2023
commit 72d95ad99b92dc35257cb5a2bc30888769e59082
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

## 0.5.1

- Updated components:
- `avatar` - added attr `is_round`.
### Updated components

- `avatar` - added attr `is_round`.

### Deprecated

- Renamed `parent_child_avatar` to `avatar_pair`.

## 0.5.0

Expand Down
18 changes: 14 additions & 4 deletions lib/component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9618,7 +9618,7 @@ defmodule PrimerLive.Component do
defp avatar_size_in_range(size), do: size

# ------------------------------------------------------------------------------------
# parent_child_avatar
# avatar_pair
# ------------------------------------------------------------------------------------

@doc section: :avatar
Expand All @@ -9631,10 +9631,10 @@ defmodule PrimerLive.Component do
Use slots `parent` and `child` to create the avatars using `avatar/1` attributes:

```
<.parent_child_avatar>
<.avatar_pair>
<:parent src="emma.jpg" size="7" />
<:child src="kim.jpg" size="2" />
</.parent_child_avatar>
</.avatar_pair>
```

[INSERT LVATTRDOCS]
Expand All @@ -9654,6 +9654,7 @@ defmodule PrimerLive.Component do
doc: "Generates a parent avatar." do
attr(:size, :any, doc: "Avatar image size - see `avatar/1`.")
attr(:src, :any, doc: "Avatar image source - see `avatar/1`.")
attr(:is_round, :any, doc: "Rounded avatar - see `avatar/1`.")

DeclarationHelpers.slot_class()
DeclarationHelpers.slot_style()
Expand All @@ -9664,13 +9665,14 @@ defmodule PrimerLive.Component do
doc: "Generates a child avatar." do
attr(:size, :any, doc: "Avatar size - see `avatar/1`.")
attr(:src, :any, doc: "Avatar image source - see `avatar/1`.")
attr(:is_round, :any, doc: "Rounded avatar - see `avatar/1`.")

DeclarationHelpers.slot_class()
DeclarationHelpers.slot_style()
DeclarationHelpers.slot_rest()
end

def parent_child_avatar(assigns) do
def avatar_pair(assigns) do
classes = %{
parent_child:
AttributeHelpers.classnames([
Expand Down Expand Up @@ -9738,6 +9740,14 @@ defmodule PrimerLive.Component do
"""
end

def parent_child_avatar(assigns) do
ComponentHelpers.deprecated_message(
"Deprecated component parent_child_avatar: use avatar_pair. Since 0.5.1."
)

avatar_pair(assigns)
end

# ------------------------------------------------------------------------------------
# circle_badge
# ------------------------------------------------------------------------------------
Expand Down