Skip to content

A finished site to read ​

The scaffold is an example in the design system of Brumy (brumy.ch), jtakeit's maker, to be adapted; the showcase is what one looks like when an agent has finished: Atelier Nord, a three-chair hair salon in Zürich, written from a brief like any other site, in English and German, with a diary, a journal and its own design. The business is invented and the photographs are credited stock; nothing in it is a real customer's.

Its repository is public: jtakeit/showcase-salon. The links below are pinned to the tag kit-0.8.0, the version of the kit the files were written against, so they do not move under this page when the site changes. Read them for the shape of a finished file, not to copy the salon: the design is the salon's, and yours is the client's.

The showcase is still on contract 2 until it is moved: its schema is jtk/catalogue.json, its content a document per page and per language under jtk/content/, its settings jtk/bookings.json. A new site is on contract 3, and its files are where the files under jtk/ says. For contract 3's own shapes, read the kit's template on main beside the showcase: template/contract-3/ — the declaration (src/content/blocks.ts, with CONTRACT = 3), the home page as jtk/pages/index.json and the shared text with the business's contacts as jtk/shared.json — and a site in several languages for the translations. The components, the forms and the design below read the same on both contracts: the kit's door hands a template its values and their annotations either way.

The files worth reading ​

FileWhat it shows
BRIEF.mdThe brief as the brief asks for it: the facts with their sources, the one action, what was decided and by whom.
src/components/BookingForm.astroThe booking form, copied from the scaffold and dressed in the site's design. The markup is the salon's; the data-* hooks and the inputs' names are the scaffold's, untouched; the look is the file's own <style>. Compare it with the scaffold's to see what was changed and what was kept.
src/pages/[...listing].astroThe booking page: the price list and the form under it, from the same entries — the services read once, grouped, passed to the form.
src/content/blocks.tsThe schema, in contract 2's words: the blocks the owner edits by tapping, the services and masters as collections the diary reads.
jtk/content/index.jsonA page as contract-2 content: the blocks in order with the owner's words, which the panel edits and publish writes back. On contract 3 the same page is jtk/pages/index.json, each block with its _key.
jtk/bookings.jsonThe diary's settings as a first commit seeds them, in contract 2's shape: the hours, combine, where the form is. On contract 3 they are jtk/modules/bookings.json, {"v": 1, "settings": {…}}.
jtk/design.jsonThe palette and type the design pass chose, as tokens the components read.
src/components/LeadForm.astroThe enquiry form in the same clothes as the booking form.

The booking form, in one look ​

What the copied form keeps is small. The element finds every part by a hook, never by a class, so the salon's markup and classes are its own:

astro
<jtk-booking>
  <form class="book" {...form.attrs}>                     <!-- data-booking, data-api, data-sends… from bookingForm() -->
    <div class="book-row" data-field>                     <!-- data-field: what the two steps sort -->
      <label class="book-label" for="booking-day">{w.day}</label>
      <input class="book-input" id="booking-day" name="day" type="date" min={form.today} max={form.last} required />
    </div>
    <div class="book-row" data-field data-party-field hidden>   <!-- shown when the business takes parties -->
      <label class="book-label" for="booking-party">{w.party}</label>
      <select class="book-input" id="booking-party" name="party"></select>
    </div>
    <fieldset class="book-times" data-times>
      <legend class="book-label">{w.time}</legend>
      <p data-times-hint aria-live="polite">{w.pick}</p>
      <div class="book-slots" data-slots></div>            <!-- a button per free time, class booking__slot -->
    </fieldset>
    …
  </form>
</jtk-booking>
<script>import '@jtakeit/kit/elements/booking';</script>

The whole list of hooks, with which may be left out, is in the scaffold's docs/booking.md and in @jtakeit/kit/booking/hooks. Bookings on the site says what the form must do whatever it looks like; preflight with try_booking reads the built page, fails a form that lacks a hook or a field the business asks for, and books through it.