Skip to content

Commit

Permalink
Set version 6.0.0 as highest
Browse files Browse the repository at this point in the history
  • Loading branch information
angelikatyborska committed Jul 2, 2024
1 parent c1a6fdb commit c5cb51c
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Basic helpers for [bitstyles](https://github.com/bitcrowd/bitstyles) for elixir

Bitstyles must be installed separately into the asset generation. The helpers in this project just output classes for working with bitstyles.

Bitstyles versions from 5.0.1 down to 1.3.0 are supported.
Bitstyles versions from 6.0.0 down to 1.3.0 are supported.

## Installation

Expand Down
4 changes: 2 additions & 2 deletions lib/bitstyles_phoenix/bitstyles.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule BitstylesPhoenix.Bitstyles do
@moduledoc false

@default_version "5.0.1"
@default_version "6.0.0"
@cdn_url "https://cdn.jsdelivr.net/npm/bitstyles"

def cdn_url do
Expand All @@ -14,7 +14,7 @@ defmodule BitstylesPhoenix.Bitstyles do
"""
def classname(name), do: classname(name, version())

def classname(class, version) when version > "5.0.1" do
def classname(class, version) when version > "6.0.0" do
IO.warn("Version #{version} of bitstyles is not yet supported")
class
end
Expand Down
29 changes: 29 additions & 0 deletions lib/bitstyles_phoenix/component/breadcrumbs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,35 @@ defmodule BitstylesPhoenix.Component.Breadcrumbs do
...> """
''',
[
"6.0.0": '''
"""
<nav aria-label="breadcrumbs">
<ol class="u-h6 u-list-none u-flex u-flex-wrap u-items-center">
<li class="u-margin-xs-right u-flex u-items-center">
Foo
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="a-icon a-icon--m u-fg-text u-margin-xs-left" focusable="false" height="16" width="16">
<use xlink:href="#icon-caret-right">
</use>
</svg>
</li>
<li class="u-margin-xs-right u-flex u-items-center">
Bar
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="a-icon a-icon--m u-fg-text u-margin-xs-left" focusable="false" height="16" width="16">
<use xlink:href="#icon-caret-right">
</use>
</svg>
</li>
<li class="u-margin-xs-right u-flex u-items-center">
Baz
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="a-icon a-icon--m u-fg-text u-margin-xs-left" focusable="false" height="16" width="16">
<use xlink:href="#icon-caret-right">
</use>
</svg>
</li>
</ol>
</nav>
"""
''',
"5.0.1": '''
"""
<nav aria-label="breadcrumbs">
Expand Down
26 changes: 26 additions & 0 deletions lib/bitstyles_phoenix/component/button.ex
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,19 @@ defmodule BitstylesPhoenix.Component.Button do
...> """
''',
[
"6.0.0": '''
"""
<a href="#" class="a-button a-button--square" title="Add">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="a-icon" focusable="false" height="16" width="16">
<use xlink:href="#icon-plus">
</use>
</svg>
<span class="u-sr-only">
Add
</span>
</a>
"""
''',
"5.0.1": '''
"""
<a href="#" class="a-button a-button--square" title="Add">
Expand Down Expand Up @@ -498,6 +511,19 @@ defmodule BitstylesPhoenix.Component.Button do
...> """
''',
[
"6.0.0": '''
"""
<a href="#" class="a-button a-button--square" data-theme="dark" title="Show">
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="a-icon" focusable="false" height="16" width="16">
<use xlink:href="#icon-plus">
</use>
</svg>
<span class="u-sr-only">
Show
</span>
</a>
"""
''',
"5.0.1": '''
"""
<a href="#" class="a-button a-button--square" data-theme="dark" title="Show">
Expand Down
27 changes: 27 additions & 0 deletions lib/bitstyles_phoenix/component/dropdown.ex
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,33 @@ defmodule BitstylesPhoenix.Component.Dropdown do
...> """
''',
[
"6.0.0": '''
"""
<div class="u-relative">
<button type="button" class="a-button a-button--secondary">
<span class="a-button__label">
Select me
</span>
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="a-icon a-icon--m a-button__icon" focusable="false" height="16" width="16">
<use xlink:href="#icon-caret-down">
</use>
</svg>
</button>
<ul class="a-dropdown u-overflow-y-auto a-list-reset u-margin-s-top">
<li>
<a href="#" class="a-button a-button--transparent a-button--menu u-h6">
Option 1
</a>
</li>
<li>
<a href="#" class="a-button a-button--transparent a-button--menu u-h6">
Option 2
</a>
</li>
</ul>
</div>
"""
''',
"5.0.1": '''
"""
<div class="u-relative">
Expand Down
14 changes: 14 additions & 0 deletions lib/bitstyles_phoenix/component/error.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ defmodule BitstylesPhoenix.Component.Error do
...> <.ui_errors form={@form} field={:name} />
...> """
''',
"6.0.0": '''
"""
<span class="u-fg-warning" phx-feedback-for="user[name]">
is too short
</span>
"""
''',
"5.0.1": '''
"""
<span class="u-fg-warning" phx-feedback-for="user[name]">
Expand Down Expand Up @@ -138,6 +145,13 @@ defmodule BitstylesPhoenix.Component.Error do
...> <.ui_error error={{"Foo error", []}} />
...> """
''',
"6.0.0": '''
"""
<span class="u-fg-warning">
Foo error
</span>
"""
''',
"5.0.1": '''
"""
<span class="u-fg-warning">
Expand Down
1 change: 1 addition & 0 deletions scripts/generate_version_showcase.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ defmodule Scripts.GenerateVersionShowcase do
@moduledoc "Generates static HTML pages in #{@dir_name} for manually testing bitstyles_phoenix with different bitstyles versions."

@all_supported_bitstyles_versions [
"6.0.0",
# do not use 5.0.0, it has an incorrect CSS build on the CDN
"5.0.1",
"4.3.0",
Expand Down

0 comments on commit c5cb51c

Please sign in to comment.