Packages
primer_live
0.10.0
An implementation of GitHub's Primer Design System for Phoenix LiveView.
Current section
48 Versions
Jump to
Current section
48 Versions
Compare versions
14
files changed
+41
additions
-41
deletions
| @@ -1,10 +1,24 @@ | |
| 1 1 | # Changelog |
| 2 2 | |
| 3 | + ## 0.10.0 |
| 4 | + |
| 5 | + ### LiveView 1.0 |
| 6 | + |
| 7 | + - Support for Phoenix.LiveView 1.0. |
| 8 | + |
| 9 | + See [Installation](doc-extra/installation.md) for using PrimerLive with Phoenix.LiveView 0.20. |
| 10 | + |
| 11 | + ### Other changes |
| 12 | + |
| 13 | + - Improve disabled [Toggle switch](`PrimerLive.Component.toggle_switch/1`) styles. |
| 14 | + - Updated upstream dependency `@primer/css` to `21.5.1`. |
| 15 | + - Updated upstream dependency `@primer/view-components` to `0.36.1`. |
| 16 | + |
| 3 17 | ## 0.9.1 |
| 4 18 | |
| 5 19 | Improvements for theme color CSS variables: |
| 6 20 | |
| 7 | - - The light theme variables are now set as default, so it is no longer needed to wrap components inside a theme wrapper. |
| 21 | + - Fix for a regression bug (introduced in version 0.9.0) that removed color styles unless components were wrapped in a theme wrapper. The light theme CSS variables are now set as the default. |
| 8 22 | - When using the `@scope` rule, color CSS variables now work inside the scope. |
| 9 23 | |
| 10 24 | ## 0.9.0 |
| @@ -1,10 +1,10 @@ | |
| 1 1 | {<<"links">>, |
| 2 2 | [{<<"GitHub">>,<<"https://github.com/ArthurClemens/primer_live">>}]}. |
| 3 3 | {<<"name">>,<<"primer_live">>}. |
| 4 | - {<<"version">>,<<"0.9.1">>}. |
| 4 | + {<<"version">>,<<"0.10.0">>}. |
| 5 5 | {<<"description">>, |
| 6 6 | <<"An implementation of GitHub's Primer Design System for Phoenix LiveView.">>}. |
| 7 | - {<<"elixir">>,<<"~> 1.17">>}. |
| 7 | + {<<"elixir">>,<<"~> 1.18">>}. |
| 8 8 | {<<"app">>,<<"primer_live">>}. |
| 9 9 | {<<"licenses">>,[<<"MIT">>]}. |
| 10 10 | {<<"files">>, |
| @@ -45,11 +45,11 @@ | |
| 45 45 | [{<<"name">>,<<"phoenix_html">>}, |
| 46 46 | {<<"app">>,<<"phoenix_html">>}, |
| 47 47 | {<<"optional">>,false}, |
| 48 | - {<<"requirement">>,<<"~> 4.1">>}, |
| 48 | + {<<"requirement">>,<<"~> 4.2">>}, |
| 49 49 | {<<"repository">>,<<"hexpm">>}], |
| 50 50 | [{<<"name">>,<<"phoenix_live_view">>}, |
| 51 51 | {<<"app">>,<<"phoenix_live_view">>}, |
| 52 52 | {<<"optional">>,false}, |
| 53 | - {<<"requirement">>,<<"~> 0.20">>}, |
| 53 | + {<<"requirement">>,<<"~> 1.0">>}, |
| 54 54 | {<<"repository">>,<<"hexpm">>}]]}. |
| 55 55 | {<<"build_tools">>,[<<"mix">>]}. |
unknownlib/component.ex
File is too large to be displayed (100 KB limit).
| @@ -425,7 +425,7 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 425 425 | |
| 426 426 | iex> PrimerLive.Helpers.AttributeHelpers.create_dom_id(nil) |
| 427 427 | nil |
| 428 | - |
| 428 | + |
| 429 429 | iex> PrimerLive.Helpers.AttributeHelpers.create_dom_id("") |
| 430 430 | nil |
| 431 431 | |
| @@ -715,8 +715,6 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 715 715 | do: input_name(form, field, name: name, is_multiple: is_multiple), |
| 716 716 | else: name |
| 717 717 | |
| 718 | - phx_feedback_for_id = input_name |
| 719 | - |
| 720 718 | value = assigns[:value] || rest[:value] |
| 721 719 | value_for_derived_label = checked_value || value |
| 722 720 | |
| @@ -744,7 +742,6 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 744 742 | input_id: input_id, |
| 745 743 | id: id, |
| 746 744 | input_name: input_name, |
| 747 | - phx_feedback_for_id: phx_feedback_for_id, |
| 748 745 | value: value |
| 749 746 | } |
| 750 747 | end |
| @@ -773,7 +770,7 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 773 770 | } |
| 774 771 | end |
| 775 772 | |
| 776 | - defp common_field_state_attrs(assigns, %{input_name: input_name, input_id: input_id, id: id}, %{ |
| 773 | + defp common_field_state_attrs(assigns, %{input_id: input_id, id: id}, %{ |
| 777 774 | form: form, |
| 778 775 | field_or_name: field_or_name |
| 779 776 | }) do |
| @@ -782,6 +779,7 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 782 779 | field_state = FormHelpers.field_state(form, field_or_name, validation_message, caption) |
| 783 780 | |
| 784 781 | %{ |
| 782 | + changeset: changeset, |
| 785 783 | message: message, |
| 786 784 | valid?: valid?, |
| 787 785 | required?: required?, |
| @@ -789,7 +787,7 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 789 787 | caption: caption |
| 790 788 | } = field_state |
| 791 789 | |
| 792 | - has_changeset? = !is_nil(field_state.changeset) |
| 790 | + has_changeset? = !is_nil(changeset) |
| 793 791 | show_message? = !!message && !ignore_errors? && assigns[:type] !== "hidden" |
| 794 792 | |
| 795 793 | validation_message_id = |
| @@ -810,20 +808,6 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 810 808 | end |
| 811 809 | end |
| 812 810 | |
| 813 | - ## Phoenix uses phx_feedback_for to hide form field errors that are untouched. |
| 814 | - ## However, this attribute can't be set on the element itself (the JS DOM library stalls). |
| 815 | - ## Element "validation_marker" is used as stopgap: a separate element placed just before the input element. |
| 816 | - validation_marker_attrs = |
| 817 | - case has_changeset? && show_message? do |
| 818 | - true -> |
| 819 | - [ |
| 820 | - "phx-feedback-for": input_name |
| 821 | - ] |
| 822 | - |
| 823 | - false -> |
| 824 | - nil |
| 825 | - end |
| 826 | - |
| 827 811 | %{ |
| 828 812 | message: message, |
| 829 813 | valid?: valid?, |
| @@ -831,7 +815,6 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 831 815 | ignore_errors?: ignore_errors?, |
| 832 816 | show_message?: show_message?, |
| 833 817 | validation_message_id: validation_message_id, |
| 834 | - validation_marker_attrs: validation_marker_attrs, |
| 835 818 | validation_marker_class: validation_marker_class, |
| 836 819 | caption: caption |
| 837 820 | } |
| @@ -40,10 +40,10 @@ defmodule PrimerLive.StatefulConditionComponent do | |
| 40 40 | def render(assigns) do |
| 41 41 | ~H""" |
| 42 42 | <div> |
| 43 | - <%= render_slot(@inner_block, %{ |
| 43 | + {render_slot(@inner_block, %{ |
| 44 44 | equals_initial_condition: @equals_initial_condition, |
| 45 45 | condition: @condition |
| 46 | - }) %> |
| 46 | + })} |
| 47 47 | </div> |
| 48 48 | """ |
| 49 49 | end |
Loading more files…