Skip to content

0.9.0

Latest
Compare
Choose a tag to compare
@ArthurClemens ArthurClemens released this 03 Nov 15:44
2a4f8dd

Changes

Note: access links from the official documentation

  • Text input: Set disabled color on read-only field with inset style.
  • Checkbox group and Radio group: Show required marker in legend.
  • Action menu and Select menu: Added attribute offset_x to define the absolute offset for the menu on the horizontal axis.
  • Header: added attributes variant="base" to create a light colored header, and is_compact for a smaller vertical height.
  • Updated upstream Primer Design System libraries. This update includes a number of changes to modified CSS Custom Properties.
    • Updated upstream dependency @primer/css to 21.5.0.
    • Added @primer/view-components version 0.34.0. This is the Rails version of Primer Design, which is the most developed so far.
    • Updated Octicon icons to version v19.12.0.
  • Added support for right-to-left languages.
  • Added support for @scope, allowing PrimerLive to be used alongside other CSS libraries. See usage instructions in Installation.
  • Added documentation Styling. This contains notes about styling with custom CSS and pre-made classes, reusing styled components and support for right-to-left languages.

Depreciations

Standalone form_control as wrapper is soft-deprecated.

The use of form_control as wrapper component around a form input component was causing compatibility issues with displaying validation messages. Since input components should be able to display a validation message even when not wrapped inside a form_control, it became difficult to distinguish between a validation messages originating from the form_control and one originating from the nested input.

With the introduction of checkbox_group and radio_group in version 0.5, there has been less need for a standalone form control wrapper.

Overall, moving form_control to the background and using it only as an internal component resolves a range of problems.

See "Updating to 0.9" below.

Removals

  • form_group was soft-deprecated in 0.5.0 and has been removed, along with component attributes form_group and is_form_group.

Bug fixes

Updating to 0.9

form_control

There have 2 ways to create a form control: as a wrapper, and as an input attribute. If you've been using form_control as wrapper around inputs, change:

<.form :let={f} for={@changeset}>
  <.form_control form={f} field={:first_name} for="first-name">
    <.text_input form={f} field={:first_name} id="first-name" />
  </.form_control>
</.form>

to

<.form :let={f} for={@changeset}>
  <.text_input form={f} field={:first_name} id="first-name" is_form_control />
</.form>