kit

Fact group

Built revision v17.10.0

Phoenix
Topics

Human support

Bring a missing role, layout, or state, or a rendering against the standard, to the session working on kit. Name the package and the entry.

On Shell, Home, List, Record, Form, Stepped flow, Settings, Reports, Issued document

Fact group

A long date and time and a date range stay within four facts.

Starts
Dates
People
24
Standing
Draft

A lone fact stands in its group.

Amount due
£240.00

Amount and Stamp values pair at Phone; a value wider than its half takes its own line.

Standing
Awaiting the hirer’s countersignature
Deposit held
£50.00
Amount due
£240.00

A plain-text value keeps one fact to a line at Phone, with a form following.

Hirer
Oakmere Primary School
Amount due
£240.00
Standing
Draft
Oakmere Village Hall

A Fact group stands before Record rows.

Invoice
OH-INV-003
Amount due
£84.00
Bookings on this invoice
Booking Amount
£48.00
£36.00

A Fact group stands before a List.

Series
Choir rehearsal, weekly
Occurrences
2
Occurrences in this series
Occurrence Amount
£30.00
£30.00

A choice keeps Form groups before its action.

Deposit, part kept

What happens to the deposit?
25
Two chairs were damaged.

A choice has no Form group before its action.

Deposit, released

What happens to the deposit?

Source
<p class="specimen-case-line">A long date and time and a date range stay within four facts.</p>
<Kit.Phoenix.Roles.FactGroup.fact_group>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Starts</:name><:value words={[Kit.Phoenix.Words.time(Kit.Phoenix.Time.moment(reader(), ~U[2026-09-28 00:35:00Z]))]} />
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Dates</:name><:value words={[Kit.Phoenix.Words.time(Kit.Phoenix.Time.day_range(reader(), ~D[2026-09-28], ~D[2027-10-28]))]} />
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>People</:name><:value words={[Kit.Phoenix.Words.amount(Kit.Phoenix.Amount.count(reader(), 24))]} />
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Standing</:name><:value stamp="neutral">Draft</:value>
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
</Kit.Phoenix.Roles.FactGroup.fact_group>
<p class="specimen-case-line">A lone fact stands in its group.</p>
<Kit.Phoenix.Roles.FactGroup.fact_group>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Amount due</:name><:value words={[Kit.Phoenix.Words.amount(Kit.Phoenix.Amount.money(reader(), Money.new(:GBP, "240.00")))]} />
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
</Kit.Phoenix.Roles.FactGroup.fact_group>
<p class="specimen-case-line">Amount and Stamp values pair at Phone; a value wider than its half takes its own line.</p>
<Kit.Phoenix.Roles.FactGroup.fact_group>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Standing</:name><:value stamp="attention">Awaiting the hirer’s countersignature</:value>
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Deposit held</:name><:value words={[Kit.Phoenix.Words.amount(Kit.Phoenix.Amount.money(reader(), Money.new(:GBP, "50.00")))]} />
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Amount due</:name><:value words={[Kit.Phoenix.Words.amount(Kit.Phoenix.Amount.money(reader(), Money.new(:GBP, "240.00")))]} />
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
</Kit.Phoenix.Roles.FactGroup.fact_group>
<p class="specimen-case-line">A plain-text value keeps one fact to a line at Phone, with a form following.</p>
<Kit.Phoenix.Roles.FactGroup.fact_group>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Hirer</:name><:value>Oakmere Primary School</:value>
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Amount due</:name><:value words={[Kit.Phoenix.Words.amount(Kit.Phoenix.Amount.money(reader(), Money.new(:GBP, "240.00")))]} />
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Standing</:name><:value stamp="neutral">Draft</:value>
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
</Kit.Phoenix.Roles.FactGroup.fact_group>
<Kit.Phoenix.Layouts.Form.form id="role-fact-group-form" subject_state={Kit.Phoenix.State.none()}>
  <:form_groups>
  <Kit.Phoenix.Roles.FormGroup.form_group id="fact-group-text-form-group" kind={Kit.Phoenix.Roles.FormGroup.Kind.text(:medium)} control_rest={%{id: "fact-group-text", name: "text", value: "Oakmere Village Hall"}}><:printed_value>Oakmere Village Hall</:printed_value>
    <:label rest={%{for: "fact-group-text"}}>Text</:label>
  </Kit.Phoenix.Roles.FormGroup.form_group>
  </:form_groups>
  <:submit_return><Kit.Phoenix.Roles.PrimaryAction.primary_action type="submit">Issue refund</Kit.Phoenix.Roles.PrimaryAction.primary_action></:submit_return>
</Kit.Phoenix.Layouts.Form.form>
<p class="specimen-case-line">A Fact group stands before Record rows.</p>
<Kit.Phoenix.Roles.FactGroup.fact_group>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Invoice</:name><:value><Kit.Phoenix.Identifier.identifier value="OH-INV-003" /></:value>
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Amount due</:name><:value words={[Kit.Phoenix.Words.amount(Kit.Phoenix.Amount.money(reader(), Money.new(:GBP, "84.00")))]} />
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
</Kit.Phoenix.Roles.FactGroup.fact_group>
<Kit.Phoenix.Layouts.Record.rows>
  <Kit.Phoenix.Table.comparison_table>
    <:caption>Bookings on this invoice</:caption>
    <:subject_heading label="Booking" />
    <:column_headings label="Amount" kind="amount">Amount</:column_headings>
    <:row facts={[%Kit.Phoenix.Table.ComparisonCell{content: Kit.Phoenix.Table.Fact.words([Kit.Phoenix.Words.amount(Kit.Phoenix.Amount.money(reader(), Money.new(:GBP, "48.00")))])}]}>
      <Kit.Phoenix.Roles.Row.row>
        <:subject href="../../record/">Main Hall, <Kit.Phoenix.Roles.Time.time value={Kit.Phoenix.Time.day(reader(), ~D[2025-04-04])} /></:subject>
      </Kit.Phoenix.Roles.Row.row>
    </:row>
    <:row facts={[%Kit.Phoenix.Table.ComparisonCell{content: Kit.Phoenix.Table.Fact.words([Kit.Phoenix.Words.amount(Kit.Phoenix.Amount.money(reader(), Money.new(:GBP, "36.00")))])}]}>
      <Kit.Phoenix.Roles.Row.row>
        <:subject href="../../record/">Meeting Room, <Kit.Phoenix.Roles.Time.time value={Kit.Phoenix.Time.day(reader(), ~D[2025-04-11])} /></:subject>
      </Kit.Phoenix.Roles.Row.row>
    </:row>
  </Kit.Phoenix.Table.comparison_table>
</Kit.Phoenix.Layouts.Record.rows>
<p class="specimen-case-line">A Fact group stands before a List.</p>
<Kit.Phoenix.Roles.FactGroup.fact_group>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Series</:name><:value>Choir rehearsal, weekly</:value>
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
  <Kit.Phoenix.Roles.LabelledFact.labelled_fact>
    <:name>Occurrences</:name><:value words={[Kit.Phoenix.Words.amount(Kit.Phoenix.Amount.count(reader(), 2))]} />
  </Kit.Phoenix.Roles.LabelledFact.labelled_fact>
</Kit.Phoenix.Roles.FactGroup.fact_group>
<Kit.Phoenix.Layouts.List.list subject_state={Kit.Phoenix.State.none()}>
  <:rows rest={%{"aria-label": "Occurrences"}}>
    <Kit.Phoenix.Table.comparison_table>
      <:caption>Occurrences in this series</:caption>
      <:subject_heading label="Occurrence" />
      <:column_headings label="Amount" kind="amount">Amount</:column_headings>
      <:row facts={[%Kit.Phoenix.Table.ComparisonCell{content: Kit.Phoenix.Table.Fact.words([Kit.Phoenix.Words.amount(Kit.Phoenix.Amount.money(reader(), Money.new(:GBP, "30.00")))])}]}>
        <Kit.Phoenix.Roles.Row.row>
          <:subject href="../../record/"><Kit.Phoenix.Roles.Time.time value={Kit.Phoenix.Time.day(reader(), ~D[2025-04-17])} /></:subject>
        </Kit.Phoenix.Roles.Row.row>
      </:row>
      <:row facts={[%Kit.Phoenix.Table.ComparisonCell{content: Kit.Phoenix.Table.Fact.words([Kit.Phoenix.Words.amount(Kit.Phoenix.Amount.money(reader(), Money.new(:GBP, "30.00")))])}]}>
        <Kit.Phoenix.Roles.Row.row>
          <:subject href="../../record/"><Kit.Phoenix.Roles.Time.time value={Kit.Phoenix.Time.day(reader(), ~D[2025-04-24])} /></:subject>
        </Kit.Phoenix.Roles.Row.row>
      </:row>
    </Kit.Phoenix.Table.comparison_table>
  </:rows>
</Kit.Phoenix.Layouts.List.list>
<p class="specimen-case-line">A choice keeps Form groups before its action.</p>
<Kit.Phoenix.Roles.LabelPanel.label_panel element="form" aria-label="Deposit, part kept" heading="Deposit, part kept">
  <Kit.Phoenix.Roles.SelectionControl.group id="fact-group-deposit">
    <:legend>What happens to the deposit?</:legend>
    <:choice kind={:radio} control_rest={%{name: "fact-group-deposit", value: "release"}} printed_value="Not chosen">Release it in full</:choice>
    <:choice kind={:radio} checked control_rest={%{name: "fact-group-deposit", value: "part"}} printed_value="Chosen">Keep part of it</:choice>
    <:choice kind={:radio} control_rest={%{name: "fact-group-deposit", value: "keep"}} printed_value="Not chosen">Keep all of it</:choice>
  </Kit.Phoenix.Roles.SelectionControl.group>
  <Kit.Phoenix.Roles.FormGroup.form_group id="fact-group-kept-amount-form-group" kind={Kit.Phoenix.Roles.FormGroup.Kind.text(:narrow)} control_value="25" control_rest={%{id: "fact-group-kept-amount", name: "kept-amount", inputmode: "decimal"}}><:printed_value>25</:printed_value>
    <:label rest={%{for: "fact-group-kept-amount"}}>Amount kept</:label>
  </Kit.Phoenix.Roles.FormGroup.form_group>
  <Kit.Phoenix.Roles.FormGroup.form_group id="fact-group-kept-reason-form-group" kind={Kit.Phoenix.Roles.FormGroup.Kind.textarea()} control_value="Two chairs were damaged." control_rest={%{id: "fact-group-kept-reason", name: "reason"}}><:printed_value>Two chairs were damaged.</:printed_value>
    <:label rest={%{for: "fact-group-kept-reason"}}>Reason</:label>
  </Kit.Phoenix.Roles.FormGroup.form_group>
  <:actions><Kit.Phoenix.Roles.ActionGroup.action_group>
    <:lead><Kit.Phoenix.Roles.PrimaryAction.primary_action type="submit">Settle the deposit</Kit.Phoenix.Roles.PrimaryAction.primary_action></:lead>
  </Kit.Phoenix.Roles.ActionGroup.action_group></:actions>
</Kit.Phoenix.Roles.LabelPanel.label_panel>
<p class="specimen-case-line">A choice has no Form group before its action.</p>
<Kit.Phoenix.Roles.LabelPanel.label_panel element="form" aria-label="Deposit, released" heading="Deposit, released">
  <Kit.Phoenix.Roles.SelectionControl.group id="fact-group-released">
    <:legend>What happens to the deposit?</:legend>
    <:choice kind={:radio} checked control_rest={%{name: "fact-group-released", value: "release"}} printed_value="Chosen">Release it in full</:choice>
    <:choice kind={:radio} control_rest={%{name: "fact-group-released", value: "part"}} printed_value="Not chosen">Keep part of it</:choice>
    <:choice kind={:radio} control_rest={%{name: "fact-group-released", value: "keep"}} printed_value="Not chosen">Keep all of it</:choice>
  </Kit.Phoenix.Roles.SelectionControl.group>
  <:actions><Kit.Phoenix.Roles.ActionGroup.action_group>
    <:lead><Kit.Phoenix.Roles.PrimaryAction.primary_action type="submit">Settle the deposit</Kit.Phoenix.Roles.PrimaryAction.primary_action></:lead>
  </Kit.Phoenix.Roles.ActionGroup.action_group></:actions>
</Kit.Phoenix.Roles.LabelPanel.label_panel>