Skip to content

Machine-translated – improvements welcome. Suggest an improvement

Package chip

PaketChip shows where an entry comes from – the same everywhere (#1192): package icon and package name as a small chip right after the name, tooltip “from the package Basis, version 1.4.0”, a click leads to the package page. It looks like a tag – no border, square corners (#1289, principle 8: a border means button); as a link it turns blue and underlined on hover. Entries you created yourself have no chip; what Ablago brings itself carries “Ablago”. There is no separate line for the origin.

What it is for

For the origin of an entry from a package or from Ablago itself – on folder types, views, number sequences, word lists, automations and workflow templates. Other features are shown by the Tag.

Rule: origin always via PaketChip – never “from package” without a name, never a separate line.

Matching patterns in the pattern catalogue: E2 · Updates change nothing secretly, E3 · Visibility creates trust, C14 · Kinds of buttons: fixed, the same everywhere.

How to use it

With How it works
Mouse On hover the tooltip with package and version appears. A click on the chip opens the package page in the workbench. In a list row the whole row is the link and the chip has none of its own. “Ablago” leads nowhere.
Keyboard As a link of its own, Tab reaches the chip, Enter opens the package page. In a list row it is not a stop of its own.
Touch As a link it stays small to look at and has an invisible touch target 44 px high (On a phone).

What it means

Chip with a package name – the entry comes from this package; an update of the package may change it. “Ablago” – Ablago brings it itself. No chip – created yourself. The chip is a label like a tag, without a border; as a link it only shows this under the mouse (blue, underlined).

States

State How it comes about How it looks
with link paket={{ id, name, version }} icon and name, quiet; blue and underlined under the mouse
in a list row inLink as with a link, but without a link of its own
from Ablago paket="ablago" “Ablago”, no link
created yourself paket empty no chip

“Package chip” section of the pattern page: with link, in a list row, from Ablago, created yourself

“Package chip” section, dark

Accessibility

The package name is text in the chip and is read with the entry; the tooltip only adds the version. In a list row there is deliberately no link inside a link – that would be broken for keyboard and screen readers; name and tooltip stay.

Code

import { PaketChip } from '../bausteine';
import { paketHerkunft, paketVonTyp } from './listensuche';

// In a list row (the whole row is a link): no link of its own.
<span className="titel">{typ.name}<PaketChip paket={paketHerkunft(paketVonTyp(typ, pakete), pakete)} inLink /></span>

// On a page: as a link to the package page.
<h1>{v.name}<PaketChip paket={{ id: 'basis', name: 'Basis', version: '1.4.0' }} /></h1>

// Included with Ablago:
<PaketChip paket="ablago" inLink />
Property Meaning
paket { id, name?, version? }, 'ablago' or nothing (own: no chip)
inLink stands inside a link (list row): no link of its own – a link inside a link is broken for keyboard and screen readers; name and tooltip stay
titel own tooltip (e.g. “replaces Ablago's template”)

paketHerkunft(id, pakete) in web/src/werkbank/listensuche.ts takes name and version from the installed packages.

Converted (#1192)

Folder types, views, number sequences, synonyms (before: a second line of their own), automations and workflow templates (before: “from package” without a name), create package (folder types, views, word lists).

Files and tests

  • Building block: web/src/bausteine/paketchip/PaketChip.tsx, look: PaketChip.module.css
  • Pattern page: web/src/bausteine/paketchip/muster.tsx
  • Test: web/test/baustein-paketchip.test.ts