Skip to content

Commit 4f9bdc8

Browse files
committed
Release v0.7.0
1 parent 6d6e5d3 commit 4f9bdc8

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
1-
## [Unreleased]
1+
## [0.7.0] - 2026-03-01
22

33
### Added
44

55
- **Radio and checkbox groups** via `Field(:plan).radios(...)` and `Field(:roles).checkboxes(...)`.
6-
Now return renderable Phlex components (like `input`, `select`) so they work as one-liners
6+
Return renderable Phlex components (like `input`, `select`) so they work as one-liners
77
via Kit. Without a block, renders default `<label><input> Text</label>` markup per choice.
8-
With a block, yields each `Choice` for custom markup — choice methods (`.input`,
9-
`.label`) render directly into the component's output. Accepts the same option formats as
8+
With a block, yields each `Choice` for custom markup — `choice.input` and
9+
`choice.label` render directly into the component's output. Accepts the same option formats as
1010
`select`. Auto-detects Rails enums when called with no arguments.
1111
`choice.label` without a block defaults to rendering `choice.text`.
12+
Subclass `Components::Radios` or `Components::Checkboxes` to customize defaults.
1213
- **Hash options** for `select`, `radios`, and `checkboxes` — e.g. `radios(1 => "Basic", 2 => "Pro")`.
1314
- **Radio component** with `field(:gender).radio("male")` API. Automatically handles name, value, and checked state. Each radio gets a unique DOM id based on its value (e.g. `user_gender_male`).
1415
- **Checkbox collection support** — three modes:
1516
- **Boolean** (on/off toggle): `Field(:featured).checkbox` renders with hidden "0" input
1617
- **All-options** (pick from known set): `Field(:role_ids).checkbox(value: role.id)` with `[]` name and unique ids per value
1718
- **Field collection** (from existing array): `field(:role_ids).collection { |r| r.checkbox }` for values already on the model
19+
- **Choices module** (`Superform::Rails::Choices`) — `Choices::Choice` holds per-option state,
20+
`Choices::Mapper` (renamed from `OptionMapper`) maps option args to `(value, text)` pairs.
1821
- **Unique DOM ids** for radio and checkbox groups via `DOM#id(*suffixes)`. Prevents duplicate ids in valid HTML and allows labels to target individual inputs.
1922
- **Select improvements**: blank options (`nil`) at any position, `multiple: true` support with hidden input for empty submissions, ActiveRecord relations as options.
2023
- **Preview server** — run `bin/preview` to view example forms at localhost:3000 with hot-reloading.
2124

2225
### Changed
2326

27+
- `OptionMapper` renamed to `Choices::Mapper`. If you referenced `Superform::Rails::OptionMapper` directly, update to `Superform::Rails::Choices::Mapper`.
2428
- **Deprecation**: Components now accept HTML attributes as keyword arguments directly instead of wrapping them in `attributes:`. The old `attributes:` keyword still works but emits a deprecation warning and will be removed in a future version.
2529

2630
```ruby

lib/superform/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Superform
4-
VERSION = "0.6.1"
4+
VERSION = "0.7.0"
55
end

0 commit comments

Comments
 (0)