Current section
48 Versions
Jump to
Current section
48 Versions
Compare versions
10
files changed
+90
additions
-58
deletions
| @@ -1,5 +1,26 @@ | |
| 1 1 | # Changelog |
| 2 2 | |
| 3 | + ## 0.5.1 |
| 4 | + |
| 5 | + ### Deprecated |
| 6 | + |
| 7 | + - Component `avatar_pair`: renamed `parent_child_avatar` to `avatar_pair`. |
| 8 | + - Components `action_menu` and `select_menu`: renamed `is_right_aligned` to `is_aligned_end` (added RTL support). |
| 9 | + - Component `spinner`: renamed `gap_color` to `highlight_color`. |
| 10 | + |
| 11 | + ### New component |
| 12 | + |
| 13 | + - `toggle_switch`: Toggle switch is used to immediately toggle a setting on or off. |
| 14 | + |
| 15 | + ### Updated components |
| 16 | + |
| 17 | + - `avatar`: Added attr `is_round`. |
| 18 | + - `avatar_pair`: Improved styling: support display inside flex container, add inner border to child avatar. |
| 19 | + - `button` |
| 20 | + - Improved dimensions according to Primer Style specs, including placing a trailing icon. |
| 21 | + - Added attr `is_aligned_start`. Aligns contents to the start (at the left in left-to-right languages), while the dropdown caret (if any) is placed at the far end. |
| 22 | + - `spinner`: Updated to latest Primer Style design. |
| 23 | + |
| 3 24 | ## 0.5.0 |
| 4 25 | |
| 5 26 | Form elements have been revamped and aligned with the most recent [form element documentation at Primer Style](https://primer.style/design/ui-patterns/forms/overview). |
| @@ -1,7 +1,7 @@ | |
| 1 1 | {<<"links">>, |
| 2 2 | [{<<"GitHub">>,<<"https://github.com/ArthurClemens/primer_live">>}]}. |
| 3 3 | {<<"name">>,<<"primer_live">>}. |
| 4 | - {<<"version">>,<<"0.5.0">>}. |
| 4 | + {<<"version">>,<<"0.5.1">>}. |
| 5 5 | {<<"description">>, |
| 6 6 | <<"An implementation of GitHub's Primer Design System for Phoenix LiveView.">>}. |
| 7 7 | {<<"app">>,<<"primer_live">>}. |
unknownlib/component.ex
File is too large to be displayed (100 KB limit).
| @@ -1,19 +1,19 @@ | |
| 1 1 | defmodule PrimerLive.Helpers.DeclarationHelpers do |
| 2 2 | @moduledoc false |
| 3 3 | |
| 4 | - defmacro class() do |
| 4 | + defmacro class do |
| 5 5 | quote do |
| 6 6 | attr(:class, :string, default: nil, doc: "Additional classname.") |
| 7 7 | end |
| 8 8 | end |
| 9 9 | |
| 10 | - defmacro slot_class() do |
| 10 | + defmacro slot_class do |
| 11 11 | quote do |
| 12 12 | attr(:class, :string, doc: "Additional classname.") |
| 13 13 | end |
| 14 14 | end |
| 15 15 | |
| 16 | - defmacro slot_style() do |
| 16 | + defmacro slot_style do |
| 17 17 | quote do |
| 18 18 | attr(:style, :string, |
| 19 19 | doc: """ |
| @@ -23,7 +23,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 23 23 | end |
| 24 24 | end |
| 25 25 | |
| 26 | - defmacro input_id() do |
| 26 | + defmacro input_id do |
| 27 27 | quote do |
| 28 28 | attr(:input_id, :string, |
| 29 29 | default: nil, |
| @@ -33,7 +33,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 33 33 | end |
| 34 34 | end |
| 35 35 | |
| 36 | - defmacro form() do |
| 36 | + defmacro form do |
| 37 37 | quote do |
| 38 38 | attr(:form, :any, |
| 39 39 | default: nil, |
| @@ -43,19 +43,19 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 43 43 | end |
| 44 44 | end |
| 45 45 | |
| 46 | - defmacro field() do |
| 46 | + defmacro field do |
| 47 47 | quote do |
| 48 48 | attr(:field, :any, default: nil, doc: "Field name (atom or string).") |
| 49 49 | end |
| 50 50 | end |
| 51 51 | |
| 52 | - defmacro name() do |
| 52 | + defmacro name do |
| 53 53 | quote do |
| 54 54 | attr(:name, :string, doc: "Input name attribute (when not using `form` and `field`).") |
| 55 55 | end |
| 56 56 | end |
| 57 57 | |
| 58 | - defmacro validation_message() do |
| 58 | + defmacro validation_message do |
| 59 59 | quote do |
| 60 60 | attr(:validation_message, :any, |
| 61 61 | default: nil, |
| @@ -90,7 +90,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 90 90 | end |
| 91 91 | end |
| 92 92 | |
| 93 | - defmacro validation_message_id() do |
| 93 | + defmacro validation_message_id do |
| 94 94 | quote do |
| 95 95 | attr(:validation_message_id, :any, |
| 96 96 | doc: """ |
| @@ -189,7 +189,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 189 189 | |
| 190 190 | # link attr |
| 191 191 | |
| 192 | - defmacro href() do |
| 192 | + defmacro href do |
| 193 193 | quote do |
| 194 194 | attr(:href, :any, |
| 195 195 | doc: """ |
| @@ -199,7 +199,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 199 199 | end |
| 200 200 | end |
| 201 201 | |
| 202 | - defmacro slot_href() do |
| 202 | + defmacro slot_href do |
| 203 203 | quote do |
| 204 204 | attr(:href, :any, |
| 205 205 | doc: """ |
| @@ -209,7 +209,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 209 209 | end |
| 210 210 | end |
| 211 211 | |
| 212 | - defmacro patch() do |
| 212 | + defmacro patch do |
| 213 213 | quote do |
| 214 214 | attr(:patch, :string, |
| 215 215 | doc: """ |
| @@ -219,7 +219,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 219 219 | end |
| 220 220 | end |
| 221 221 | |
| 222 | - defmacro navigate() do |
| 222 | + defmacro navigate do |
| 223 223 | quote do |
| 224 224 | attr(:navigate, :string, |
| 225 225 | doc: """ |
| @@ -237,13 +237,13 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 237 237 | end |
| 238 238 | end |
| 239 239 | |
| 240 | - defmacro rest() do |
| 240 | + defmacro rest do |
| 241 241 | quote do |
| 242 242 | attr(:rest, :global) |
| 243 243 | end |
| 244 244 | end |
| 245 245 | |
| 246 | - defmacro slot_rest() do |
| 246 | + defmacro slot_rest do |
| 247 247 | quote do |
| 248 248 | attr(:rest, :any) |
| 249 249 | end |
| @@ -251,7 +251,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 251 251 | |
| 252 252 | # form_control attrs |
| 253 253 | |
| 254 | - defmacro form_control_label() do |
| 254 | + defmacro form_control_label do |
| 255 255 | quote do |
| 256 256 | attr(:label, :string, |
| 257 257 | default: nil, |
| @@ -260,7 +260,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 260 260 | end |
| 261 261 | end |
| 262 262 | |
| 263 | - defmacro form_control_is_hide_label() do |
| 263 | + defmacro form_control_is_hide_label do |
| 264 264 | quote do |
| 265 265 | attr(:is_hide_label, :boolean, |
| 266 266 | default: false, |
| @@ -269,7 +269,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 269 269 | end |
| 270 270 | end |
| 271 271 | |
| 272 | - defmacro form_control_is_disabled() do |
| 272 | + defmacro form_control_is_disabled do |
| 273 273 | quote do |
| 274 274 | attr(:is_disabled, :boolean, |
| 275 275 | default: false, |
| @@ -278,7 +278,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 278 278 | end |
| 279 279 | end |
| 280 280 | |
| 281 | - defmacro form_control_deprecated_has_form_group() do |
| 281 | + defmacro form_control_deprecated_has_form_group do |
| 282 282 | quote do |
| 283 283 | attr(:deprecated_has_form_group, :boolean, |
| 284 284 | default: false, |
| @@ -288,7 +288,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 288 288 | end |
| 289 289 | end |
| 290 290 | |
| 291 | - defmacro form_control_required_marker() do |
| 291 | + defmacro form_control_required_marker do |
| 292 292 | quote do |
| 293 293 | attr(:required_marker, :string, |
| 294 294 | default: "*", |
| @@ -298,7 +298,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 298 298 | end |
| 299 299 | end |
| 300 300 | |
| 301 | - defmacro form_control_for() do |
| 301 | + defmacro form_control_for do |
| 302 302 | quote do |
| 303 303 | attr(:for, :string, |
| 304 304 | default: nil, |
| @@ -308,7 +308,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 308 308 | end |
| 309 309 | end |
| 310 310 | |
| 311 | - defmacro form_control_is_input_group() do |
| 311 | + defmacro form_control_is_input_group do |
| 312 312 | quote do |
| 313 313 | attr(:is_input_group, :boolean, |
| 314 314 | default: false, |
| @@ -397,7 +397,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 397 397 | end |
| 398 398 | end |
| 399 399 | |
| 400 | - defmacro checkbox_hidden_input() do |
| 400 | + defmacro checkbox_hidden_input do |
| 401 401 | quote do |
| 402 402 | attr(:hidden_input, :string, |
| 403 403 | default: "true", |
| @@ -421,7 +421,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 421 421 | end |
| 422 422 | end |
| 423 423 | |
| 424 | - defmacro checkbox_is_multiple() do |
| 424 | + defmacro checkbox_is_multiple do |
| 425 425 | quote do |
| 426 426 | attr(:is_multiple, :boolean, |
| 427 427 | default: false, |
| @@ -434,13 +434,13 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 434 434 | end |
| 435 435 | end |
| 436 436 | |
| 437 | - defmacro checkbox_is_emphasised_label() do |
| 437 | + defmacro checkbox_is_emphasised_label do |
| 438 438 | quote do |
| 439 439 | attr(:is_emphasised_label, :boolean, default: false, doc: "Adds emphasis to the label.") |
| 440 440 | end |
| 441 441 | end |
| 442 442 | |
| 443 | - defmacro checkbox_is_omit_label() do |
| 443 | + defmacro checkbox_is_omit_label do |
| 444 444 | quote do |
| 445 445 | attr(:is_omit_label, :boolean, default: false, doc: "Omits the label.") |
| 446 446 | end |
| @@ -520,7 +520,7 @@ defmodule PrimerLive.Helpers.DeclarationHelpers do | |
| 520 520 | end |
| 521 521 | end |
| 522 522 | |
| 523 | - defmacro checkbox_slot_hint() do |
| 523 | + defmacro checkbox_slot_hint do |
| 524 524 | quote do |
| 525 525 | alias PrimerLive.Helpers.DeclarationHelpers |
| @@ -22,7 +22,8 @@ defmodule PrimerLive.Helpers.TestHelpers do | |
| 22 22 | |> String.replace(~r/\s*\n\s*/, " ") |
| 23 23 | |> String.replace(~r/\s*\<\s*/, "<") |
| 24 24 | |> String.replace(~r/\s*\>\s*/, ">") |
| 25 | - |> String.replace(~r/<path .*?<\/path>/, "STRIPPED_SVG_PATHS") |
| 25 | + |> String.replace(~r/<(path|circle) .*?<\/(path|circle)>/, "STRIPPED_SVG_PATHS") |
| 26 | + |> String.replace(~r/STRIPPED_SVG_PATHSSTRIPPED_SVG_PATHS/, "STRIPPED_SVG_PATHS") |
| 26 27 | |> String.trim() |
| 27 28 | end |
| 28 29 | end |
Loading more files…