Slot Board
Days with their delivery windows as radio chips, beside the zone card.
Install
npx ui8kit add slot-boardPulls in: box, button, compose, empty-state, field, inline, kit-box, kit-button, kit-select, kit-text, list, list-item, section-frame, select, select-option, slot-grid, stack, text, utils, zone-table
Preview
Pick a delivery window
Windows close two hours before they start.
Today, 8 October
2 windows left
Tomorrow, 9 October
6 windows
- Delivery$12
- Free from$75
- Time90 minutes
The courier calls ten minutes before arriving.
Code
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework svelte --dir src --registry-url https://registry.buildy.tw/svelte --strict-cdnnpx ui8kit add slot-board<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
Pick a delivery window: the days with their windows as radio chips, beside a card with the zone, its price and
the buttons. Static markup. Axes: layout (split: the card beside the days, stacked: the days only), item
(card, plain), tone.
-->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { SlotLabels } from "./slot-board.types";
import type { Day } from "../components/slot-grid.types";
import type { Zone } from "./zone-table.types";
export type SlotBoardProps = {
id: string;
title: string;
lead?: string;
days: Day[];
empty?: string;
zone: Zone;
labels: SlotLabels;
layout?: "split" | "stacked";
item?: "card" | "plain";
tone?: "default" | "muted";
landmarkLabel?: string;
};
</script>
<script lang="ts">
import Box from "../compose/Box.svelte";
import Button from "../compose/Button.svelte";
import Inline from "../compose/Inline.svelte";
import List from "../compose/List.svelte";
import ListItem from "../compose/ListItem.svelte";
import Select from "../compose/Select.svelte";
import SelectOption from "../compose/SelectOption.svelte";
import Stack from "../compose/Stack.svelte";
import Text from "../compose/Text.svelte";
import EmptyState from "../components/empty-state.svelte";
import Field from "../components/field.svelte";
import SectionFrame from "../components/section-frame.svelte";
import SlotGrid from "../components/slot-grid.svelte";
import { fmtMoney, tpl } from "../utils";
let {
id,
title,
lead = "",
days,
empty = "",
zone,
labels,
layout = "split",
item = "card",
tone = "default",
landmarkLabel,
}: SlotBoardProps = $props();
</script>
<SectionFrame id={id} title={title} lead={lead} tone={tone} landmarkLabel={landmarkLabel}>
{#if ((days?.length ?? 0) === 0)}
<EmptyState icon="calendar" title={empty} />
{:else}
<Box class="grid grid-cols-1 items-start gap-8 lg:grid-cols-3">
<Box class={(((layout as string) === "split") ? "lg:col-span-2" : "lg:col-span-3")}>
<SlotGrid days={days} name={tpl("{0}-slot", id)} item={item} />
</Box>
{#if ((layout as string) === "split")}
<Stack gap="4" align="stretch" class="rounded bg-card inset-ring inset-ring-border p-6" data-slot="aside">
<Field label={labels.zone} htmlFor={tpl("{0}-zone", id)}>
<Select name={tpl("{0}-zone", id)} id={tpl("{0}-zone", id)}>
<SelectOption value={zone.id} label={zone.name} selected={true} />
</Select>
</Field>
<List tag="ul" class="flex flex-col gap-2">
<ListItem class="flex items-center justify-between gap-4 text-sm">
<Inline class="text-muted-foreground">
{labels.price}
</Inline>
<Inline class="font-medium">
{fmtMoney(zone.price, zone.currency)}
</Inline>
</ListItem>
<ListItem class="flex items-center justify-between gap-4 text-sm">
<Inline class="text-muted-foreground">
{labels.freeFrom}
</Inline>
<Inline class="font-medium">
{fmtMoney(zone.freeFrom, zone.currency)}
</Inline>
</ListItem>
<ListItem class="flex items-center justify-between gap-4 text-sm">
<Inline class="text-muted-foreground">
{labels.time}
</Inline>
<Inline class="font-medium">
{zone.time}
</Inline>
</ListItem>
</List>
<Button variant="default" size="default" class="w-full">
{labels.primary}
</Button>
<Button variant="outline" size="default" class="w-full">
{labels.secondary}
</Button>
<Text size="xs" class="text-muted-foreground">
{labels.note}
</Text>
</Stack>
{/if}
</Box>
{/if}
</SectionFrame>
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
export type SlotLabels = {
zone: string;
price: string;
freeFrom: string;
time: string;
primary: string;
secondary: string;
note: string;
};
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework react --dir src --registry-url https://registry.buildy.tw/react --strict-cdnnpx ui8kit add slot-board// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
* Pick a delivery window: the days with their windows as radio chips, beside a card with the zone, its price and
* the buttons. Static markup. Axes: layout (split: the card beside the days, stacked: the days only), item
* (card, plain), tone.
*/
import { type ReactNode } from "react";
import { Box, Button, Inline, List, ListItem, Select, SelectOption, Stack, Text } from "../compose";
import { EmptyState } from "../components/empty-state";
import { Field } from "../components/field";
import { SectionFrame } from "../components/section-frame";
import { SlotGrid } from "../components/slot-grid";
import { fmtMoney, tpl } from "../utils";
import type { SlotLabels } from "./slot-board.types";
import type { Day } from "../components/slot-grid.types";
import type { Zone } from "./zone-table.types";
export type SlotBoardProps = {
id: string;
title: string;
lead?: string;
days: Day[];
empty?: string;
zone: Zone;
labels: SlotLabels;
layout?: "split" | "stacked";
item?: "card" | "plain";
tone?: "default" | "muted";
landmarkLabel?: string;
};
export function SlotBoard({
id,
title,
lead = "",
days,
empty = "",
zone,
labels,
layout = "split",
item = "card",
tone = "default",
landmarkLabel,
}: SlotBoardProps) {
return (
<SectionFrame id={id} title={title} lead={lead} tone={tone} landmarkLabel={landmarkLabel}>
{((days?.length ?? 0) === 0) ? (
<EmptyState icon="calendar" title={empty} />
) : (
<Box className="grid grid-cols-1 items-start gap-8 lg:grid-cols-3">
<Box className={(((layout as string) === "split") ? "lg:col-span-2" : "lg:col-span-3")}>
<SlotGrid days={days} name={tpl("{0}-slot", id)} item={item} />
</Box>
{((layout as string) === "split") ? (
<Stack gap="4" align="stretch" className="rounded bg-card inset-ring inset-ring-border p-6" data-slot="aside">
<Field label={labels.zone} htmlFor={tpl("{0}-zone", id)}>
<Select name={tpl("{0}-zone", id)} id={tpl("{0}-zone", id)}>
<SelectOption value={zone.id} label={zone.name} selected={true} />
</Select>
</Field>
<List tag="ul" className="flex flex-col gap-2">
<ListItem className="flex items-center justify-between gap-4 text-sm">
<Inline className="text-muted-foreground">
{labels.price}
</Inline>
<Inline className="font-medium">
{fmtMoney(zone.price, zone.currency)}
</Inline>
</ListItem>
<ListItem className="flex items-center justify-between gap-4 text-sm">
<Inline className="text-muted-foreground">
{labels.freeFrom}
</Inline>
<Inline className="font-medium">
{fmtMoney(zone.freeFrom, zone.currency)}
</Inline>
</ListItem>
<ListItem className="flex items-center justify-between gap-4 text-sm">
<Inline className="text-muted-foreground">
{labels.time}
</Inline>
<Inline className="font-medium">
{zone.time}
</Inline>
</ListItem>
</List>
<Button variant="default" size="default" className="w-full">
{labels.primary}
</Button>
<Button variant="outline" size="default" className="w-full">
{labels.secondary}
</Button>
<Text size="xs" className="text-muted-foreground">
{labels.note}
</Text>
</Stack>
) : null}
</Box>
)}
</SectionFrame>
);
}
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
export type SlotLabels = {
zone: string;
price: string;
freeFrom: string;
time: string;
primary: string;
secondary: string;
note: string;
};
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework vue --dir src --registry-url https://registry.buildy.tw/vue --strict-cdnnpx ui8kit add slot-board// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
export type SlotLabels = {
zone: string;
price: string;
freeFrom: string;
time: string;
primary: string;
secondary: string;
note: string;
};
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
Pick a delivery window: the days with their windows as radio chips, beside a card with the zone, its price and
the buttons. Static markup. Axes: layout (split: the card beside the days, stacked: the days only), item
(card, plain), tone.
-->
<script lang="ts">
import type { SlotLabels } from "./slot-board.types";
import type { Day } from "../components/slot-grid.types";
import type { Zone } from "./zone-table.types";
export type SlotBoardProps = {
id: string;
title: string;
lead?: string;
days: Day[];
empty?: string;
zone: Zone;
labels: SlotLabels;
layout?: "split" | "stacked";
item?: "card" | "plain";
tone?: "default" | "muted";
landmarkLabel?: string;
};
</script>
<script setup lang="ts">
import Box from "../compose/Box.vue";
import Button from "../compose/Button.vue";
import Inline from "../compose/Inline.vue";
import List from "../compose/List.vue";
import ListItem from "../compose/ListItem.vue";
import Select from "../compose/Select.vue";
import SelectOption from "../compose/SelectOption.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import EmptyState from "../components/empty-state.vue";
import Field from "../components/field.vue";
import SectionFrame from "../components/section-frame.vue";
import SlotGrid from "../components/slot-grid.vue";
import { fmtMoney, tpl } from "../utils";
const {
id,
title,
lead = "",
days,
empty = "",
zone,
labels,
layout = "split",
item = "card",
tone = "default",
landmarkLabel,
} = defineProps<SlotBoardProps>();
</script>
<template>
<SectionFrame :id="id" :title="title" :lead="lead" :tone="tone" :landmarkLabel="landmarkLabel">
<EmptyState v-if="((days?.length ?? 0) === 0)" icon="calendar" :title="empty" />
<Box v-else class="grid grid-cols-1 items-start gap-8 lg:grid-cols-3">
<Box :class="(((layout as string) === 'split') ? 'lg:col-span-2' : 'lg:col-span-3')">
<SlotGrid :days="days" :name="tpl('{0}-slot', id)" :item="item" />
</Box>
<Stack
v-if="((layout as string) === 'split')"
gap="4"
align="stretch"
class="rounded bg-card inset-ring inset-ring-border p-6"
data-slot="aside"
>
<Field :label="labels.zone" :htmlFor="tpl('{0}-zone', id)">
<Select :name="tpl('{0}-zone', id)" :id="tpl('{0}-zone', id)">
<SelectOption :value="zone.id" :label="zone.name" :selected="true" />
</Select>
</Field>
<List tag="ul" class="flex flex-col gap-2">
<ListItem class="flex items-center justify-between gap-4 text-sm">
<Inline class="text-muted-foreground">
{{ labels.price }}
</Inline>
<Inline class="font-medium">
{{ fmtMoney(zone.price, zone.currency) }}
</Inline>
</ListItem>
<ListItem class="flex items-center justify-between gap-4 text-sm">
<Inline class="text-muted-foreground">
{{ labels.freeFrom }}
</Inline>
<Inline class="font-medium">
{{ fmtMoney(zone.freeFrom, zone.currency) }}
</Inline>
</ListItem>
<ListItem class="flex items-center justify-between gap-4 text-sm">
<Inline class="text-muted-foreground">
{{ labels.time }}
</Inline>
<Inline class="font-medium">
{{ zone.time }}
</Inline>
</ListItem>
</List>
<Button variant="default" size="default" class="w-full">
{{ labels.primary }}
</Button>
<Button variant="outline" size="default" class="w-full">
{{ labels.secondary }}
</Button>
<Text size="xs" class="text-muted-foreground">
{{ labels.note }}
</Text>
</Stack>
</Box>
</SectionFrame>
</template>
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework solid --dir src --registry-url https://registry.buildy.tw/solid --strict-cdnnpx ui8kit add slot-board// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
* Pick a delivery window: the days with their windows as radio chips, beside a card with the zone, its price and
* the buttons. Static markup. Axes: layout (split: the card beside the days, stacked: the days only), item
* (card, plain), tone.
*/
import { type JSX } from "solid-js";
import { Box, Button, Inline, List, ListItem, Select, SelectOption, Stack, Text } from "../compose";
import { EmptyState } from "../components/empty-state";
import { Field } from "../components/field";
import { SectionFrame } from "../components/section-frame";
import { SlotGrid } from "../components/slot-grid";
import { fmtMoney, tpl } from "../utils";
import type { SlotLabels } from "./slot-board.types";
import type { Day } from "../components/slot-grid.types";
import type { Zone } from "./zone-table.types";
export type SlotBoardProps = {
id: string;
title: string;
lead?: string;
days: Day[];
empty?: string;
zone: Zone;
labels: SlotLabels;
layout?: "split" | "stacked";
item?: "card" | "plain";
tone?: "default" | "muted";
landmarkLabel?: string;
};
export function SlotBoard({
id,
title,
lead = "",
days,
empty = "",
zone,
labels,
layout = "split",
item = "card",
tone = "default",
landmarkLabel,
}: SlotBoardProps) {
return (
<SectionFrame id={id} title={title} lead={lead} tone={tone} landmarkLabel={landmarkLabel}>
{((days?.length ?? 0) === 0) ? (
<EmptyState icon="calendar" title={empty} />
) : (
<Box class="grid grid-cols-1 items-start gap-8 lg:grid-cols-3">
<Box class={(((layout as string) === "split") ? "lg:col-span-2" : "lg:col-span-3")}>
<SlotGrid days={days} name={tpl("{0}-slot", id)} item={item} />
</Box>
{((layout as string) === "split") ? (
<Stack gap="4" align="stretch" class="rounded bg-card inset-ring inset-ring-border p-6" data-slot="aside">
<Field label={labels.zone} htmlFor={tpl("{0}-zone", id)}>
<Select name={tpl("{0}-zone", id)} id={tpl("{0}-zone", id)}>
<SelectOption value={zone.id} label={zone.name} selected={true} />
</Select>
</Field>
<List tag="ul" class="flex flex-col gap-2">
<ListItem class="flex items-center justify-between gap-4 text-sm">
<Inline class="text-muted-foreground">
{labels.price}
</Inline>
<Inline class="font-medium">
{fmtMoney(zone.price, zone.currency)}
</Inline>
</ListItem>
<ListItem class="flex items-center justify-between gap-4 text-sm">
<Inline class="text-muted-foreground">
{labels.freeFrom}
</Inline>
<Inline class="font-medium">
{fmtMoney(zone.freeFrom, zone.currency)}
</Inline>
</ListItem>
<ListItem class="flex items-center justify-between gap-4 text-sm">
<Inline class="text-muted-foreground">
{labels.time}
</Inline>
<Inline class="font-medium">
{zone.time}
</Inline>
</ListItem>
</List>
<Button variant="default" size="default" class="w-full">
{labels.primary}
</Button>
<Button variant="outline" size="default" class="w-full">
{labels.secondary}
</Button>
<Text size="xs" class="text-muted-foreground">
{labels.note}
</Text>
</Stack>
) : null}
</Box>
)}
</SectionFrame>
);
}
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
export type SlotLabels = {
zone: string;
price: string;
freeFrom: string;
time: string;
primary: string;
secondary: string;
note: string;
};
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework templ --dir src --registry-url https://registry.buildy.tw/templ --strict-cdnnpx ui8kit add slot-board// Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
// Source: packages/compose-gen/specs/organisms/slot-board.json
package blocks
import (
"github.com/ui8kit/codegen/generated/templ/ui/box"
"github.com/ui8kit/codegen/generated/templ/ui/button"
"github.com/ui8kit/codegen/generated/templ/compose"
selectfield "github.com/ui8kit/codegen/generated/templ/ui/select"
"github.com/ui8kit/codegen/generated/templ/ui/text"
uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)
// SlotBoardProps are the props of SlotBoard; the values are the JSON shapes of the TypeScript props.
type SlotBoardProps struct {
Id any `json:"id"`
Title any `json:"title"`
Lead any `json:"lead"`
Days any `json:"days"`
Empty any `json:"empty"`
Zone any `json:"zone"`
Labels any `json:"labels"`
Layout any `json:"layout"`
Item any `json:"item"`
Tone any `json:"tone"`
LandmarkLabel any `json:"landmarkLabel"`
}
// Pick a delivery window: the days with their windows as radio chips, beside a card with the zone, its price and the buttons. Static markup. Axes: layout (split: the card beside the days, stacked: the days only), item (card, plain), tone.
templ SlotBoard(p SlotBoardProps) {
{{ vId := p.Id }}
{{ vTitle := p.Title }}
{{ vLead := uiutils.Def(p.Lead, "") }}
{{ vDays := p.Days }}
{{ vEmpty := uiutils.Def(p.Empty, "") }}
{{ vZone := p.Zone }}
{{ vLabels := p.Labels }}
{{ vLayout := uiutils.Def(p.Layout, "split") }}
{{ vItem := uiutils.Def(p.Item, "card") }}
{{ vTone := uiutils.Def(p.Tone, "default") }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Tone: vTone, LandmarkLabel: vLandmarkLabel}) {
if uiutils.Eq(uiutils.Len(vDays), float64(0)) {
@EmptyState(EmptyStateProps{Icon: "calendar", Title: vEmpty})
} else {
@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "grid grid-cols-1 items-start gap-8 lg:grid-cols-3"}}) {
@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "split")), "lg:col-span-2", "lg:col-span-3"))}}) {
@SlotGrid(SlotGridProps{Days: vDays, Name: uiutils.Tpl("{0}-slot", vId), Item: vItem})
}
if uiutils.Eq(vLayout, "split") {
@compose.Stack(compose.StackProps{Gap: "4", Align: "stretch", BoxProps: box.BoxProps{Class: "rounded bg-card inset-ring inset-ring-border p-6", Attrs: uiutils.Attrs("data-slot", "aside")}}) {
@Field(FieldProps{Label: uiutils.Get(vLabels, "zone"), HtmlFor: uiutils.Tpl("{0}-zone", vId)}) {
@compose.Select(compose.SelectProps{SelectProps: selectfield.SelectProps{Name: uiutils.S(uiutils.Tpl("{0}-zone", vId)), Attrs: uiutils.Attrs("id", uiutils.Tpl("{0}-zone", vId))}}) {
@selectfield.SelectOption(selectfield.SelectOptionProps{Value: uiutils.SP(uiutils.Get(vZone, "id")), Selected: true, Attrs: uiutils.Attrs("label", uiutils.Get(vZone, "name"))})
}
}
@compose.List(compose.ListProps{BoxProps: box.BoxProps{Tag: "ul", Class: "flex flex-col gap-2"}}) {
@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: "flex items-center justify-between gap-4 text-sm"}}) {
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "price")) }
}
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "font-medium"}}) {
{ uiutils.Text(uiutils.Money(uiutils.Get(vZone, "price"), uiutils.Get(vZone, "currency"))) }
}
}
@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: "flex items-center justify-between gap-4 text-sm"}}) {
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "freeFrom")) }
}
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "font-medium"}}) {
{ uiutils.Text(uiutils.Money(uiutils.Get(vZone, "freeFrom"), uiutils.Get(vZone, "currency"))) }
}
}
@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: "flex items-center justify-between gap-4 text-sm"}}) {
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "time")) }
}
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "font-medium"}}) {
{ uiutils.Text(uiutils.Get(vZone, "time")) }
}
}
}
@compose.Button(compose.ButtonProps{Variant: "default", Size: "default", ButtonProps: button.ButtonProps{Class: "w-full"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "primary")) }
}
@compose.Button(compose.ButtonProps{Variant: "outline", Size: "default", ButtonProps: button.ButtonProps{Class: "w-full"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "secondary")) }
}
@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "note")) }
}
}
}
}
}
}
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework twig --dir src --registry-url https://registry.buildy.tw/twig --strict-cdnnpx ui8kit add slot-board{#- Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
Source: packages/compose-gen/specs/organisms/slot-board.json
Pick a delivery window: the days with their windows as radio chips, beside a card with the zone, its price and the buttons. Static markup. Axes: layout (split: the card beside the days, stacked: the days only), item (card, plain), tone.
Props (p): id, title, lead, days, empty, zone, labels, layout, item, tone, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_lead = (p.lead ?? '') -%}
{%- set v_days = (p.days ?? null) -%}
{%- set v_empty = (p.empty ?? '') -%}
{%- set v_zone = (p.zone ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_layout = (p.layout ?? 'split') -%}
{%- set v_item = (p.item ?? 'card') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_19 -%}
{%- if og_t(og_eq(og_len(v_days), 0)) %}
{{ include('blocks/empty-state.html.twig', {'p': {'icon': 'calendar', 'title': v_empty}}, with_context = false) }}
{%- else %}
{%- set c_18 -%}
{%- set c_1 -%}
{{ include('blocks/slot-grid.html.twig', {'p': {'days': v_days, 'name': og_tpl('{0}-slot', [v_id]), 'item': v_item}}, with_context = false) }}
{%- endset -%}
{{ include('compose/Box.html.twig', {'class': og_s((og_t(og_eq(v_layout, 'split')) ? 'lg:col-span-2' : 'lg:col-span-3')), 'children': c_1}, with_context = false) }}
{%- if og_t(og_eq(v_layout, 'split')) %}
{%- set c_17 -%}
{%- set c_3 -%}
{%- set c_2 -%}
{{ include('ui/select/SelectOption.html.twig', {'value': og_s(og_get(v_zone, ['id'])), 'selected': true, 'attrs': og_attrs(['label', og_get(v_zone, ['name'])])}, with_context = false) }}
{%- endset -%}
{{ include('compose/Select.html.twig', {'name': og_s(og_tpl('{0}-zone', [v_id])), 'attrs': og_attrs(['id', og_tpl('{0}-zone', [v_id])]), 'children': c_2}, with_context = false) }}
{%- endset -%}
{{ include('blocks/field.html.twig', {'p': {'label': og_get(v_labels, ['zone']), 'htmlFor': og_tpl('{0}-zone', [v_id])}, 'children': og_markup(c_3)}, with_context = false) }}
{%- set c_13 -%}
{%- set c_6 -%}
{%- set c_4 -%}
{{ og_text(og_get(v_labels, ['price'])) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'text-muted-foreground', 'children': c_4}, with_context = false) }}
{%- set c_5 -%}
{{ og_text(og_money(og_get(v_zone, ['price']), og_get(v_zone, ['currency']))) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'font-medium', 'children': c_5}, with_context = false) }}
{%- endset -%}
{{ include('compose/ListItem.html.twig', {'class': 'flex items-center justify-between gap-4 text-sm', 'children': c_6}, with_context = false) }}
{%- set c_9 -%}
{%- set c_7 -%}
{{ og_text(og_get(v_labels, ['freeFrom'])) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'text-muted-foreground', 'children': c_7}, with_context = false) }}
{%- set c_8 -%}
{{ og_text(og_money(og_get(v_zone, ['freeFrom']), og_get(v_zone, ['currency']))) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'font-medium', 'children': c_8}, with_context = false) }}
{%- endset -%}
{{ include('compose/ListItem.html.twig', {'class': 'flex items-center justify-between gap-4 text-sm', 'children': c_9}, with_context = false) }}
{%- set c_12 -%}
{%- set c_10 -%}
{{ og_text(og_get(v_labels, ['time'])) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'text-muted-foreground', 'children': c_10}, with_context = false) }}
{%- set c_11 -%}
{{ og_text(og_get(v_zone, ['time'])) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'font-medium', 'children': c_11}, with_context = false) }}
{%- endset -%}
{{ include('compose/ListItem.html.twig', {'class': 'flex items-center justify-between gap-4 text-sm', 'children': c_12}, with_context = false) }}
{%- endset -%}
{{ include('compose/List.html.twig', {'tag': 'ul', 'class': 'flex flex-col gap-2', 'children': c_13}, with_context = false) }}
{%- set c_14 -%}
{{ og_text(og_get(v_labels, ['primary'])) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'default', 'size': 'default', 'class': 'w-full', 'children': c_14}, with_context = false) }}
{%- set c_15 -%}
{{ og_text(og_get(v_labels, ['secondary'])) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'outline', 'size': 'default', 'class': 'w-full', 'children': c_15}, with_context = false) }}
{%- set c_16 -%}
{{ og_text(og_get(v_labels, ['note'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_16}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'stretch', 'class': 'rounded bg-card inset-ring inset-ring-border p-6', 'attrs': og_attrs(['data-slot', 'aside']), 'children': c_17}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('compose/Box.html.twig', {'class': 'grid grid-cols-1 items-start gap-8 lg:grid-cols-3', 'children': c_18}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'lead': v_lead, 'tone': v_tone, 'landmarkLabel': v_landmarkLabel}, 'children': og_markup(c_19)}, with_context = false) }}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework latte --dir src --registry-url https://registry.buildy.tw/latte --strict-cdnnpx ui8kit add slot-board{* Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
Source: packages/compose-gen/specs/organisms/slot-board.json
Pick a delivery window: the days with their windows as radio chips, beside a card with the zone, its price and the buttons. Static markup. Axes: layout (split: the card beside the days, stacked: the days only), item (card, plain), tone.
Props (p): id, title, lead, days, empty, zone, labels, layout, item, tone, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_lead = ($p['lead'] ?? '')}
{var $v_days = ($p['days'] ?? null)}
{var $v_empty = ($p['empty'] ?? '')}
{var $v_zone = ($p['zone'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_layout = ($p['layout'] ?? 'split')}
{var $v_item = ($p['item'] ?? 'card')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_19}
{if og_t(og_eq(og_len($v_days), 0))}
{=og_include('blocks/empty-state.latte', ['p' => ['icon' => 'calendar', 'title' => $v_empty]])|noescape}
{else}
{capture $c_18}
{capture $c_1}
{=og_include('blocks/slot-grid.latte', ['p' => ['days' => $v_days, 'name' => og_tpl('{0}-slot', [$v_id]), 'item' => $v_item]])|noescape}
{/capture}
{=og_include('compose/Box.latte', ['class' => og_s((og_t(og_eq($v_layout, 'split')) ? 'lg:col-span-2' : 'lg:col-span-3')), 'children' => (string) $c_1])|noescape}
{if og_t(og_eq($v_layout, 'split'))}
{capture $c_17}
{capture $c_3}
{capture $c_2}
{=og_include('ui/select/SelectOption.latte', ['value' => og_s(og_get($v_zone, ['id'])), 'selected' => true, 'attrs' => og_attrs(['label', og_get($v_zone, ['name'])])])|noescape}
{/capture}
{=og_include('compose/Select.latte', ['name' => og_s(og_tpl('{0}-zone', [$v_id])), 'attrs' => og_attrs(['id', og_tpl('{0}-zone', [$v_id])]), 'children' => (string) $c_2])|noescape}
{/capture}
{=og_include('blocks/field.latte', ['p' => ['label' => og_get($v_labels, ['zone']), 'htmlFor' => og_tpl('{0}-zone', [$v_id])], 'children' => og_markup($c_3)])|noescape}
{capture $c_13}
{capture $c_6}
{capture $c_4}
{=og_text(og_get($v_labels, ['price']))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'text-muted-foreground', 'children' => (string) $c_4])|noescape}
{capture $c_5}
{=og_text(og_money(og_get($v_zone, ['price']), og_get($v_zone, ['currency'])))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'font-medium', 'children' => (string) $c_5])|noescape}
{/capture}
{=og_include('compose/ListItem.latte', ['class' => 'flex items-center justify-between gap-4 text-sm', 'children' => (string) $c_6])|noescape}
{capture $c_9}
{capture $c_7}
{=og_text(og_get($v_labels, ['freeFrom']))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'text-muted-foreground', 'children' => (string) $c_7])|noescape}
{capture $c_8}
{=og_text(og_money(og_get($v_zone, ['freeFrom']), og_get($v_zone, ['currency'])))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'font-medium', 'children' => (string) $c_8])|noescape}
{/capture}
{=og_include('compose/ListItem.latte', ['class' => 'flex items-center justify-between gap-4 text-sm', 'children' => (string) $c_9])|noescape}
{capture $c_12}
{capture $c_10}
{=og_text(og_get($v_labels, ['time']))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'text-muted-foreground', 'children' => (string) $c_10])|noescape}
{capture $c_11}
{=og_text(og_get($v_zone, ['time']))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'font-medium', 'children' => (string) $c_11])|noescape}
{/capture}
{=og_include('compose/ListItem.latte', ['class' => 'flex items-center justify-between gap-4 text-sm', 'children' => (string) $c_12])|noescape}
{/capture}
{=og_include('compose/List.latte', ['tag' => 'ul', 'class' => 'flex flex-col gap-2', 'children' => (string) $c_13])|noescape}
{capture $c_14}
{=og_text(og_get($v_labels, ['primary']))}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'default', 'size' => 'default', 'class' => 'w-full', 'children' => (string) $c_14])|noescape}
{capture $c_15}
{=og_text(og_get($v_labels, ['secondary']))}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'outline', 'size' => 'default', 'class' => 'w-full', 'children' => (string) $c_15])|noescape}
{capture $c_16}
{=og_text(og_get($v_labels, ['note']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_16])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'stretch', 'class' => 'rounded bg-card inset-ring inset-ring-border p-6', 'attrs' => og_attrs(['data-slot', 'aside']), 'children' => (string) $c_17])|noescape}
{/if}
{/capture}
{=og_include('compose/Box.latte', ['class' => 'grid grid-cols-1 items-start gap-8 lg:grid-cols-3', 'children' => (string) $c_18])|noescape}
{/if}
{/capture}
{=og_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'lead' => $v_lead, 'tone' => $v_tone, 'landmarkLabel' => $v_landmarkLabel], 'children' => og_markup($c_19)])|noescape}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework jinja2 --dir src --registry-url https://registry.buildy.tw/jinja2 --strict-cdnnpx ui8kit add slot-board{#- Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
Source: packages/compose-gen/specs/organisms/slot-board.json
Pick a delivery window: the days with their windows as radio chips, beside a card with the zone, its price and the buttons. Static markup. Axes: layout (split: the card beside the days, stacked: the days only), item (card, plain), tone.
Props (p): id, title, lead, days, empty, zone, labels, layout, item, tone, landmarkLabel. -#}
{%- set v_id = og_def(p['id'], none) -%}
{%- set v_title = og_def(p['title'], none) -%}
{%- set v_lead = og_def(p['lead'], '') -%}
{%- set v_days = og_def(p['days'], none) -%}
{%- set v_empty = og_def(p['empty'], '') -%}
{%- set v_zone = og_def(p['zone'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set v_layout = og_def(p['layout'], 'split') -%}
{%- set v_item = og_def(p['item'], 'card') -%}
{%- set v_tone = og_def(p['tone'], 'default') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set c_19 -%}
{%- if og_t(og_eq(og_len(v_days), 0)) %}
{{ og_include('blocks/empty-state.html.j2', {'p': {'icon': 'calendar', 'title': v_empty}}) }}
{%- else %}
{%- set c_18 -%}
{%- set c_1 -%}
{{ og_include('blocks/slot-grid.html.j2', {'p': {'days': v_days, 'name': og_tpl('{0}-slot', [v_id]), 'item': v_item}}) }}
{%- endset -%}
{{ og_include('compose/box.html.j2', {'p': {'Class': og_s(('lg:col-span-2' if og_t(og_eq(v_layout, 'split')) else 'lg:col-span-3'))}, 'children': c_1}) }}
{%- if og_t(og_eq(v_layout, 'split')) %}
{%- set c_17 -%}
{%- set c_3 -%}
{%- set c_2 -%}
{{ og_include('ui/select/select-option.html.j2', {'p': {'Value': og_s(og_get(v_zone, ['id'])), 'Selected': true, 'Attrs': og_attrs(['label', og_get(v_zone, ['name'])])}}) }}
{%- endset -%}
{{ og_include('compose/select.html.j2', {'p': {'Name': og_s(og_tpl('{0}-zone', [v_id])), 'Attrs': og_attrs(['id', og_tpl('{0}-zone', [v_id])])}, 'children': c_2}) }}
{%- endset -%}
{{ og_include('blocks/field.html.j2', {'p': {'label': og_get(v_labels, ['zone']), 'htmlFor': og_tpl('{0}-zone', [v_id])}, 'children': og_markup(c_3)}) }}
{%- set c_13 -%}
{%- set c_6 -%}
{%- set c_4 -%}
{{ og_text(og_get(v_labels, ['price'])) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'text-muted-foreground'}, 'children': c_4}) }}
{%- set c_5 -%}
{{ og_text(og_money(og_get(v_zone, ['price']), og_get(v_zone, ['currency']))) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'font-medium'}, 'children': c_5}) }}
{%- endset -%}
{{ og_include('compose/list-item.html.j2', {'p': {'Class': 'flex items-center justify-between gap-4 text-sm'}, 'children': c_6}) }}
{%- set c_9 -%}
{%- set c_7 -%}
{{ og_text(og_get(v_labels, ['freeFrom'])) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'text-muted-foreground'}, 'children': c_7}) }}
{%- set c_8 -%}
{{ og_text(og_money(og_get(v_zone, ['freeFrom']), og_get(v_zone, ['currency']))) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'font-medium'}, 'children': c_8}) }}
{%- endset -%}
{{ og_include('compose/list-item.html.j2', {'p': {'Class': 'flex items-center justify-between gap-4 text-sm'}, 'children': c_9}) }}
{%- set c_12 -%}
{%- set c_10 -%}
{{ og_text(og_get(v_labels, ['time'])) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'text-muted-foreground'}, 'children': c_10}) }}
{%- set c_11 -%}
{{ og_text(og_get(v_zone, ['time'])) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'font-medium'}, 'children': c_11}) }}
{%- endset -%}
{{ og_include('compose/list-item.html.j2', {'p': {'Class': 'flex items-center justify-between gap-4 text-sm'}, 'children': c_12}) }}
{%- endset -%}
{{ og_include('compose/list.html.j2', {'p': {'Tag': 'ul', 'Class': 'flex flex-col gap-2'}, 'children': c_13}) }}
{%- set c_14 -%}
{{ og_text(og_get(v_labels, ['primary'])) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'default', 'Size': 'default', 'Class': 'w-full'}, 'children': c_14}) }}
{%- set c_15 -%}
{{ og_text(og_get(v_labels, ['secondary'])) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'outline', 'Size': 'default', 'Class': 'w-full'}, 'children': c_15}) }}
{%- set c_16 -%}
{{ og_text(og_get(v_labels, ['note'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_16}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Class': 'rounded bg-card inset-ring inset-ring-border p-6', 'Attrs': og_attrs(['data-slot', 'aside'])}, 'children': c_17}) }}
{%- endif %}
{%- endset -%}
{{ og_include('compose/box.html.j2', {'p': {'Class': 'grid grid-cols-1 items-start gap-8 lg:grid-cols-3'}, 'children': c_18}) }}
{%- endif %}
{%- endset -%}
{{ og_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'lead': v_lead, 'tone': v_tone, 'landmarkLabel': v_landmarkLabel}, 'children': og_markup(c_19)}) }}
Props
Names and types come from the xgen specs of the source. Standard HTML attributes (id, role, tabIndex, aria-*) pass through to the root element; the class prop is className in React.
Pick a delivery window: the days with their windows as radio chips, beside a card with the zone, its price and the buttons. Static markup. Axes: layout (split: the card beside the days, stacked: the days only), item (card, plain), tone.
| Prop | Type | Default | Description |
|---|---|---|---|
| id (required) | string | - | |
| title (required) | string | - | |
| lead | string | "" | |
| days (required) | Day[] | - | |
| empty | string | "" | the text of the empty state (no records), from the dictionary |
| zone (required) | Zone | - | the zone of the address |
| labels (required) | SlotLabels | - | |
| layout | "split" | "stacked" | "split" | |
| item | "card" | "plain" | "card" | |
| tone | "default" | "muted" | "default" | |
| landmarkLabel | string | - | accessible name of the landmark of this component when the page shows it more than once (a variant); replaces the heading name of the root landmark, follows the name of a nested one |