Skip to content

v0.8.0

Choose a tag to compare

@davafons davafons released this 06 Nov 01:07
14ea02b

Upgrading from 0.7

Everything else in 0.8 is additive. These changes need edits in an app built on 0.7:

  • A named lc_toggle_group renders native radios. Before: lc_toggle_group(name:) rendered radio
    buttons, a hidden input and the lc-selection controller. After: each item is a label around an
    input type=radio with that name, so listen for the inputs' change instead of lc-selection:change, and
    mark the selected item with checked: or the group's value: instead of selected:. A group without
    name: keeps the radio buttons and lc-selection:change; it no longer has an input target.
  • lc_sheet_data is gone. Before: tag.dialog data: lc_sheet_data({ controller: "picker" }, detents: "large").
    After: lc_sheet tag: :dialog, detents: "large", data: { controller: "picker" }. lc_sheet also renders
    non-dialog sheets, so drop any hand-written data-controller="lc-sheet" and handle element too.
  • The lc-confirm-dialog controller is gone. Before: a pre-rendered confirm <dialog> wired to
    lc-confirm-dialog. After: render lc_confirm_sheet once in the layout and put data-turbo-confirm on
    the form, with data-turbo-confirm-description, data-turbo-confirm-accept and
    data-turbo-confirm-tone for its description, label and tone.
  • A modal lc_dialog is 32rem wide on desktop. Before: min(92vw, 31rem). After: size: :md,
    min(32rem, 100vw - 2rem). Pass size: :sm (24rem) for a narrower dialog, or set --lc-dialog-width.
  • lc_dialog puts your content in a body slot. Before: the block rendered straight after the header
    inside [data-slot=dialog-content]. After: it renders inside [data-slot=dialog-body], which scrolls on
    desktop, and the close button sits in [data-slot=dialog-actions]. Update CSS that selects children of
    dialog-content.
  • A swiped-away popover sheet hides itself. Before: lc-sheet:dismiss only notified listeners on a
    non-dialog sheet. After: an open [popover] sheet hides unless a listener calls preventDefault().
  • An unpadded lc_card no longer gaps its children. Before: lc_card(padding: :none) stacked its
    children --lc-inset apart. After: they meet edge to edge, as rows and empty states in an unpadded card
    expect. Pass class: "gap-inset" to keep the old spacing.
  • lc_text(size: :label) is semibold. Before: weight 500. After: 600, the same as a field label, so
    one label role serves both. Add class: "font-medium" where the lighter weight was intended.