Skip to content

Commit

Permalink
release 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benvp committed Dec 6, 2022
1 parent 23ad959 commit dfc6491
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,49 @@

All notable changes to this project will be documented in this file.

## [v0.2.0] (2022-12-03)

### Improvements

* `variant/2` now properly supports boolean values. You can now do something like the following:

```elixir
variant :disabled,
[true: "disabled-class", false: "enabled-class"],
default: false

# or

variant :disabled,
[true: "disabled-class"],
default: nil

def button(assigns) do
~H"""
<button class={@cva_class} disabled={@disabled}>
<%= render_slot(@inner_block) %>
</button>
"""
end

# ... where you use that component

<.button disabled>Click me</.button>

# -> <button class="disabled-class" disabled>Click me</button>
```

### Changes

* `variant/2` does not automatically infer the `required` option anymore. If you want to make a variant mandatory, you have to provide the `required: true` option.

* `variant/2` now allows `nil` as a valid value.

### Bugfixes

* Fixes an issue where defining 3 variants would cause an `attr` already defined error.


## [v0.1.2] (2022-12-03)

### Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule CVA.MixProject do
use Mix.Project

@version "0.1.2"
@version "0.2.0"

def project do
[
Expand Down

0 comments on commit dfc6491

Please sign in to comment.