Packages
primer_live
0.11.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
+54
additions
-30
deletions
| @@ -1,5 +1,18 @@ | |
| 1 1 | # Changelog |
| 2 2 | |
| 3 | + ## 0.11.0 |
| 4 | + |
| 5 | + ### Pagination component |
| 6 | + |
| 7 | + - Added attribute `button_attrs` to render buttons with `phx-` attributes. This is useful on pages where handling of url parameters is too complex - for example when using search within a nested component. |
| 8 | + - Changed styling from inline-block to inline-flex to prevent spaces in labels from creating redundant whitespace. |
| 9 | + |
| 10 | + ### Other changes |
| 11 | + |
| 12 | + - Added possible attributes to slots to prevent "undefined attribute" warnings. |
| 13 | + - Updated upstream dependency `@primer/view-components` to `0.40.0`. |
| 14 | + - Updated LiveView JS dependency to `1.0.0`. |
| 15 | + |
| 3 16 | ## 0.10.0 |
| 4 17 | |
| 5 18 | ### LiveView 1.0 |
| @@ -1,7 +1,7 @@ | |
| 1 1 | {<<"links">>, |
| 2 2 | [{<<"GitHub">>,<<"https://github.com/ArthurClemens/primer_live">>}]}. |
| 3 3 | {<<"name">>,<<"primer_live">>}. |
| 4 | - {<<"version">>,<<"0.10.0">>}. |
| 4 | + {<<"version">>,<<"0.11.0">>}. |
| 5 5 | {<<"description">>, |
| 6 6 | <<"An implementation of GitHub's Primer Design System for Phoenix LiveView.">>}. |
| 7 7 | {<<"elixir">>,<<"~> 1.18">>}. |
| @@ -32,11 +32,6 @@ | |
| 32 32 | {<<"optional">>,false}, |
| 33 33 | {<<"requirement">>,<<"~> 3.10">>}, |
| 34 34 | {<<"repository">>,<<"hexpm">>}], |
| 35 | - [{<<"name">>,<<"jason">>}, |
| 36 | - {<<"app">>,<<"jason">>}, |
| 37 | - {<<"optional">>,false}, |
| 38 | - {<<"requirement">>,<<"~> 1.4">>}, |
| 39 | - {<<"repository">>,<<"hexpm">>}], |
| 40 35 | [{<<"name">>,<<"phoenix_html_helpers">>}, |
| 41 36 | {<<"app">>,<<"phoenix_html_helpers">>}, |
| 42 37 | {<<"optional">>,false}, |
unknownlib/component.ex
File is too large to be displayed (100 KB limit).
| @@ -29,8 +29,8 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 29 29 | iex> is_foo = true |
| 30 30 | iex> is_bar = false |
| 31 31 | iex> PrimerLive.Helpers.AttributeHelpers.classnames([ |
| 32 | - ...> is_foo and "foo", |
| 33 | - ...> is_bar and "bar" |
| 32 | + ...> is_foo && "foo", |
| 33 | + ...> is_bar && "bar" |
| 34 34 | ...> ]) |
| 35 35 | "foo" |
| 36 36 | |
| @@ -100,8 +100,8 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 100 100 | iex> is_bar = false |
| 101 101 | iex> extra = [class: "x"] |
| 102 102 | iex> PrimerLive.Helpers.AttributeHelpers.append_attributes(extra, [ |
| 103 | - ...> is_foo and [foo: "foo"], |
| 104 | - ...> is_bar and [bar: "bar"] |
| 103 | + ...> is_foo && [foo: "foo"], |
| 104 | + ...> is_bar && [bar: "bar"] |
| 105 105 | ...> ]) |
| 106 106 | [class: "x", foo: "foo"] |
| 107 107 | |
| @@ -109,8 +109,8 @@ defmodule PrimerLive.Helpers.AttributeHelpers do | |
| 109 109 | iex> is_bar = false |
| 110 110 | iex> extra = %{class: "x"} |
| 111 111 | iex> PrimerLive.Helpers.AttributeHelpers.append_attributes(extra, [ |
| 112 | - ...> is_foo and [foo: "foo"], |
| 113 | - ...> is_bar and [bar: "bar"] |
| 112 | + ...> is_foo && [foo: "foo"], |
| 113 | + ...> is_bar && [bar: "bar"] |
| 114 114 | ...> ]) |
| 115 115 | [class: "x", foo: "foo"] |
| 116 116 | """ |
| @@ -13,12 +13,30 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 13 13 | end |
| 14 14 | end |
| 15 15 | |
| 16 | + defmacro slot_id do |
| 17 | + quote do |
| 18 | + attr(:id, :any, doc: "Component DOM id.") |
| 19 | + end |
| 20 | + end |
| 21 | + |
| 16 22 | defmacro slot_class do |
| 17 23 | quote do |
| 18 24 | attr(:class, :any, doc: "Additional classname.") |
| 19 25 | end |
| 20 26 | end |
| 21 27 | |
| 28 | + defmacro slot_aria do |
| 29 | + quote do |
| 30 | + attr(:"aria-disabled", :string, doc: "ARIA disabled attribute.") |
| 31 | + attr(:"aria-expanded", :string, doc: "ARIA disabled attribute.") |
| 32 | + attr(:"aria-hidden", :string, doc: "ARIA hiddeh attribute.") |
| 33 | + attr(:"aria-label", :string, doc: "ARIA label attribute.") |
| 34 | + attr(:"aria-labelledby", :string, doc: "ARIA labelledby attribute.") |
| 35 | + attr(:"aria-required", :string, doc: "ARIA disabled attribute.") |
| 36 | + attr(:"aria-role", :string, doc: "ARIA role attribute.") |
| 37 | + end |
| 38 | + end |
| 39 | + |
| 22 40 | defmacro slot_style do |
| 23 41 | quote do |
| 24 42 | attr(:style, :string, |
| @@ -75,7 +93,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 75 93 | is_selected={id == @selected_tab} |
| 76 94 | phx-click="set_tab" |
| 77 95 | phx-value-item={tab_id} |
| 78 | - > |
| 96 | + > |
| 79 97 | ... |
| 80 98 | |
| 81 99 | def handle_event( |
| @@ -90,7 +108,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 90 108 | <:row |
| 91 109 | phx-click="select_row" |
| 92 110 | phx-value-item={row_id} |
| 93 | - > |
| 111 | + > |
| 94 112 | ... |
| 95 113 | |
| 96 114 | def handle_event( |
| @@ -474,7 +492,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 474 492 | label: "", # {component_name_title} label |
| 475 493 | input_group_container: "", # Input group container (for checkbox_group and radio_group) |
| 476 494 | caption: "", # {component_name_title} caption |
| 477 | - fieldset: "", # Fieldset wrapper (for checkbox_group and radio_group) |
| 495 | + fieldset: "", # Fieldset wrapper (for checkbox_group and radio_group) |
| 478 496 | legend: "", # Legend (for checkbox_group and radio_group) |
| 479 497 | } |
| 480 498 | ``` |
Loading more files…