From 15ce57678d2b6fee974ac7bd3f87ccc7fa047b54 Mon Sep 17 00:00:00 2001 From: Angelika Cathor Date: Wed, 25 Sep 2024 10:28:12 +0200 Subject: [PATCH] Upgrade bitstyles to 6.0.0 (#127) * Set version 6.0.0 as highest * Upgrade badge * New sizing values; fix tests * Upgrade flash * Fix description list color * Fix card tests * Rebase bug * Make sidebar demo look better * Only replace utility classes with new sizes * Fix rebase mistake * Fix rebsing mistakes * Add changelog entry --- CHANGELOG.md | 9 ++- README.md | 2 +- lib/bitstyles_phoenix.ex | 2 +- lib/bitstyles_phoenix/alpine3/dropdown.ex | 4 +- lib/bitstyles_phoenix/alpine3/sidebar.ex | 24 ++++---- lib/bitstyles_phoenix/bitstyles.ex | 53 ++++++++++++++++- lib/bitstyles_phoenix/bitstyles/version.ex | 2 +- lib/bitstyles_phoenix/component/avatar.ex | 4 +- lib/bitstyles_phoenix/component/badge.ex | 38 ++++++++++--- .../component/breadcrumbs.ex | 57 ++++++++++++++----- lib/bitstyles_phoenix/component/button.ex | 26 +++++++++ lib/bitstyles_phoenix/component/card.ex | 4 +- .../component/description_list.ex | 14 ++--- lib/bitstyles_phoenix/component/dropdown.ex | 39 +++++++++++-- lib/bitstyles_phoenix/component/error.ex | 18 +++++- lib/bitstyles_phoenix/component/flash.ex | 53 +++++++++++------ lib/bitstyles_phoenix/component/form.ex | 2 +- lib/bitstyles_phoenix/component/heading.ex | 14 ++--- lib/bitstyles_phoenix/component/modal.ex | 10 ++-- lib/bitstyles_phoenix/component/sidebar.ex | 50 ++++++++-------- lib/bitstyles_phoenix/component/tabs.ex | 20 +++---- scripts/generate_version_showcase.ex | 1 + test/bitstyles_phoenix/bitstyles_test.exs | 42 +++++++++++++- 23 files changed, 361 insertions(+), 127 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 487d58a..2726af0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,14 @@ ## Unreleased - Switched bitstyles version comparisons from string comparisons to tuple comparisons, which will ensure correct output if bitstyles version ever contains a number above 9. -- Modified the process of downgrading classnames to the target bitstyles version by chaining renames. This is necessary preparation work to support bitstyles 6.0.0. +- Modified the process of downgrading classnames to the target bitstyles version by chaining renames. This is necessary preparation work to support bitstyles `v6.0.0`. +- Added support for bitstyles `v6.0.0`. You can continue using bitstyles_phoenix with a lower bitstyles version, or migrate your codebase to bitstyles `v6.0.0`. + +### How to migrate to bitstyles `v6.0.0` + +Follow the [bitstyles changelog](https://github.com/bitcrowd/bitstyles/blob/main/CHANGELOG.md#600---2023-06-08) for version 6.0.0. + +There are no changes to bitstyles_phoenix component APIs. ## v2.4.0 - 2024-07-18 diff --git a/README.md b/README.md index 2039994..0bbfb83 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/bitstyles_phoenix.ex b/lib/bitstyles_phoenix.ex index 1485211..18d6f07 100644 --- a/lib/bitstyles_phoenix.ex +++ b/lib/bitstyles_phoenix.ex @@ -109,7 +109,7 @@ defmodule BitstylesPhoenix do You can control how required labels are rendered. By default you will get this appended to your labels if the input is required: ```html - + ``` You can override it by specifying your own component to render the required labels. The component will get the form and the field as assigns, as well as any optional parameters you pass in the MFA as `@opts`. diff --git a/lib/bitstyles_phoenix/alpine3/dropdown.ex b/lib/bitstyles_phoenix/alpine3/dropdown.ex index 553fa7f..048451f 100644 --- a/lib/bitstyles_phoenix/alpine3/dropdown.ex +++ b/lib/bitstyles_phoenix/alpine3/dropdown.ex @@ -56,7 +56,7 @@ defmodule BitstylesPhoenix.Alpine3.Dropdown do -