Pular para o conteúdo principal

Componentes do design system

Todos os componentes de turn.healthpass.ds, tal como o storybook os mostra. Cada captura de tela é o componente renderizado pela biblioteca e estilizado pela folha de estilos do design system, na largura de 440 px para a qual as páginas do paciente são desenhadas.

A chamada sob cada captura é a interface do componente, tirada da declaração das suas props: os marcadores são tipos, não valores de exemplo. SLOT recebe a saída de outro componente, STRING texto, ENUM um dos valores listados, TABLE uma tabela Lua, BOOLEAN true ou false.

Foundations​

Foundations: colors​

Foundations: Colors

Foundations: fonts​

Foundations: Fonts

Foundations: icons​

Foundations: Icons

Foundations: illustrations​

Foundations: Illustrations

Cards​

Cards: base card​

Cards: Base card

local cards = require("turn.healthpass.ds.components.cards")

cards.base_card({
href = STRING,
icon = SLOT,
label = STRING,
text = STRING,
number = STRING,
details = STRING,
date = STRING,
status = SLOT,
trailing_icon = SLOT,
attrs = TABLE,
download = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
hrefstringAbsolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link.
iconslotLeading visual: an icon or a small component (e.g. a date tile).
labelstringSmall heading above the values.
textstringPrimary text value.
numberstringProminent pre-formatted value, e.g. '120/80 mmHG'
detailsstringSupporting copy under the values.
datestringPre-formatted date line.
statusslotTrailing status, e.g. a badge.
trailing_iconslotRight-aligned affordance icon (chevron, check, eye).
attrstablePass-through attributes on the card link, restricted to data-, hx- and aria-*.
downloadstringDownload filename; renders the link's download attribute. Requires href.

Cards: text card​

Cards: Text card

local cards = require("turn.healthpass.ds.components.cards")

cards.text_card({
icon = SLOT,
text = STRING,
details = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
iconslotLeading icon.
textstringCard heading, e.g. 'What you reported'.
detailsstringBody copy.

Cards: vitals card​

Cards: Vitals card

local cards = require("turn.healthpass.ds.components.cards")

cards.vitals_card({
label = STRING,
number = STRING,
date = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
labelstringReading name, e.g. 'Blood pressure'.
numberstringPre-formatted reading, e.g. '120/80 mmHG'.
datestringPre-formatted date line.

Cards: prescription card​

Cards: Prescription card

local cards = require("turn.healthpass.ds.components.cards")

cards.prescription_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
textstringCard heading, e.g. 'Prescription'.
detailsstringSupporting copy.
datestringPre-formatted date line.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: sicknote card​

Cards: Sicknote card

local cards = require("turn.healthpass.ds.components.cards")

cards.sicknote_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
textstringCard heading, e.g. 'Sick note'.
detailsstringSupporting copy.
datestringPre-formatted date line.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: labresults card​

Cards: Labresults card

local cards = require("turn.healthpass.ds.components.cards")

cards.labresults_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
textstringCard heading, e.g. 'Lab results'.
detailsstringSupporting copy.
datestringPre-formatted date line.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: referral card​

Cards: Referral card

local cards = require("turn.healthpass.ds.components.cards")

cards.referral_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
textstringCard heading, e.g. 'Referral'.
detailsstringSupporting copy.
datestringPre-formatted date line.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: visitsummary card​

Cards: Visitsummary card

local cards = require("turn.healthpass.ds.components.cards")

cards.visitsummary_card({
text = STRING,
details = STRING,
date = STRING,
href = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
textstringCard heading, e.g. 'Visit summary'.
detailsstringSupporting copy.
datestringPre-formatted date line.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: visit card​

Cards: Visit card

local cards = require("turn.healthpass.ds.components.cards")

cards.visit_card({
date = DATE,
text = STRING,
details = STRING,
href = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
datedatesimVisit date for the calendar tile.
textstringSpecialty, e.g. 'Otorhinolaryngology'.
detailsstringProvider, e.g. 'Maria Silva at Turn Health'.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: consult card​

Cards: Consult card

local cards = require("turn.healthpass.ds.components.cards")

cards.consult_card({
text = STRING,
details = STRING,
date = DATE,
href = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
textstringConsult summaryCard heading.
detailsstringClinician line, e.g. 'With Ayanda Mokoena'.
datedatesimWhen the consult was; renders as '15 Jul 2026, 9:30'.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: about card​

Cards: About card

local cards = require("turn.healthpass.ds.components.cards")

cards.about_card({
label = STRING,
text = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
labelstringField name, e.g. 'Name'.
textstringField value, e.g. 'Sashi Hlophe'.

Cards: medication card​

Cards: Medication card

local cards = require("turn.healthpass.ds.components.cards")

cards.medication_card({
text = STRING,
details = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
textstringMedication, e.g. 'Amoxicilin 500MG Oral tablet'.
detailsstringDosing, e.g. '2 times daily'.

Cards: vaccination card​

Cards: Vaccination card

local cards = require("turn.healthpass.ds.components.cards")

cards.vaccination_card({
text = STRING,
date = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
textstringVaccine, e.g. 'COVID-19'.
datestringPre-formatted date line.

Cards: vitals detail card​

Cards: Vitals detail card

local cards = require("turn.healthpass.ds.components.cards")

cards.vitals_detail_card({
number = STRING,
date = STRING,
status = SLOT,
})
PropTipoObrigatóriaPadrãoDescrição
numberstringPre-formatted reading, e.g. '120/80 mmHG'.
datestringPre-formatted date line.
statusslotStatus badge, e.g. badges.badge output.

Cards: lab test result card​

Cards: Lab test result card

local cards = require("turn.healthpass.ds.components.cards")

cards.lab_test_result_card({
label = STRING,
number = STRING,
status = SLOT,
})
PropTipoObrigatóriaPadrãoDescrição
labelstringMeasure name, e.g. 'Hematocrit'.
numberstringPre-formatted value, e.g. '34%'.
statusslotStatus badge, e.g. badges.badge output.

Cards: lab test card​

Cards: Lab test card

local cards = require("turn.healthpass.ds.components.cards")

cards.lab_test_card({
text = STRING,
status = SLOT,
href = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
textstringTest name, e.g. 'CBC Panel - Blood by automated count'.
statusslotStatus badge, e.g. badges.badge output.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: allergy card​

Cards: Allergy card

local cards = require("turn.healthpass.ds.components.cards")

cards.allergy_card({
text = STRING,
details = STRING,
status = SLOT,
href = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
textstringAllergen, e.g. 'Penicilin'.
detailsstringCategory, e.g. 'Medication'.
statusslotStatus badge, e.g. badges.badge output.
hrefstringLink target; when set the card is a link and shows the chevron affordance.

Cards: menu item card​

Cards: Menu item card

local cards = require("turn.healthpass.ds.components.cards")

cards.menu_item_card({
icon = SLOT,
text = STRING,
count = NUMBER,
trailing_icon = ENUM,
href = STRING,
attrs = TABLE,
download = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
iconslotLeading illustration.
textstringsimMenu label, e.g. 'Test Results'.
countnumber0Optional tally shown in a green circle; hidden when 0.
trailing_iconenum, um de 23 nomes (ver Foundations)Trailing icon, e.g. 'eye'. Defaults to a chevron when href is set.
hrefstringLink target; when set the card is a link and shows the chevron affordance.
attrstablePass-through attributes on the card link, restricted to data-, hx- and aria-*.
downloadstringDownload filename; renders the link's download attribute. Requires href.

Cards: selection list card​

Cards: Selection list card

local cards = require("turn.healthpass.ds.components.cards")

cards.selection_list_card({
text = STRING,
selected = BOOLEAN,
})
PropTipoObrigatóriaPadrãoDescrição
textstringRow label, e.g. a family member's name.
selectedbooleanfalseWhether the row shows the selected check.

Richtext​

Richtext: elements​

Richtext: Elements

local richtext = require("turn.healthpass.ds.components.richtext")

richtext.body({
content = SLOT,
})
PropTipoObrigatóriaPadrãoDescrição
contentslotsimThe HTML rich text snippet

Section​

Section: section​

Section: Section

local section = require("turn.healthpass.ds.components.section")

section.section({
title = STRING,
color = ENUM,
variant = ENUM,
content = SLOT,
})
PropTipoObrigatóriaPadrãoDescrição
titlestringOptional heading above the panel, e.g. 'Visit Summary'.
colorenum, um de purple, green, blue, gray, orange, yellow, redgrayHeading color.
variantenum, um de cards, textcardsWhat the panel holds: a stack of cards, or a block of copy.
contentslotsimThe panel's content: ds cards, or a ds.richtext body.

Section: text​

Section: Text

local section = require("turn.healthpass.ds.components.section")

section.section({
title = STRING,
color = ENUM,
variant = ENUM,
content = SLOT,
})
PropTipoObrigatóriaPadrãoDescrição
titlestringOptional heading above the panel, e.g. 'Visit Summary'.
colorenum, um de purple, green, blue, gray, orange, yellow, redgrayHeading color.
variantenum, um de cards, textcardsWhat the panel holds: a stack of cards, or a block of copy.
contentslotsimThe panel's content: ds cards, or a ds.richtext body.

Section: colors​

Section: Colors

local section = require("turn.healthpass.ds.components.section")

section.section({
title = STRING,
color = ENUM,
variant = ENUM,
content = SLOT,
})
PropTipoObrigatóriaPadrãoDescrição
titlestringOptional heading above the panel, e.g. 'Visit Summary'.
colorenum, um de purple, green, blue, gray, orange, yellow, redgrayHeading color.
variantenum, um de cards, textcardsWhat the panel holds: a stack of cards, or a block of copy.
contentslotsimThe panel's content: ds cards, or a ds.richtext body.

Header: header​

Header: Header

local header = require("turn.healthpass.ds.components.header")

header.header({
color = ENUM,
back = STRING,
action = SLOT,
title = STRING,
text = STRING,
date = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
colorenum, um de purple, green, blue, gray, orange, white, yellow, redgrayThe color of the header
backstringAbsolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link.
actionslotAction or illustration in the top right corner
titlestringPage title
textstringOptional text.
datestringOptional pre-formatted date line.

Header: header with date​

Header: Header with date

local header = require("turn.healthpass.ds.components.header")

header.header({
color = ENUM,
back = STRING,
action = SLOT,
title = STRING,
text = STRING,
date = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
colorenum, um de purple, green, blue, gray, orange, white, yellow, redgrayThe color of the header
backstringAbsolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link.
actionslotAction or illustration in the top right corner
titlestringPage title
textstringOptional text.
datestringOptional pre-formatted date line.

Header: header with action​

Header: Header with action

local header = require("turn.healthpass.ds.components.header")

header.header({
color = ENUM,
back = STRING,
action = SLOT,
title = STRING,
text = STRING,
date = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
colorenum, um de purple, green, blue, gray, orange, white, yellow, redgrayThe color of the header
backstringAbsolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link.
actionslotAction or illustration in the top right corner
titlestringPage title
textstringOptional text.
datestringOptional pre-formatted date line.

Header: header long content​

Header: Header long content

local header = require("turn.healthpass.ds.components.header")

header.header({
color = ENUM,
back = STRING,
action = SLOT,
title = STRING,
text = STRING,
date = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
colorenum, um de purple, green, blue, gray, orange, white, yellow, redgrayThe color of the header
backstringAbsolute link target, e.g. '/apps/<uuid>/vitals'. When set, the whole card is a link.
actionslotAction or illustration in the top right corner
titlestringPage title
textstringOptional text.
datestringOptional pre-formatted date line.

Drawer​

Drawer: drawer​

Drawer: Drawer

Drawer: Drawer, open

PropTipoObrigatóriaPadrãoDescrição
idstringsimUnique DOM id of the drawer
titlestringTitle of the drawer
contentslotThe content that goes in the drawers' scrolling area.

Warnings​

Warnings: warning​

Warnings: Warning

local warnings = require("turn.healthpass.ds.components.warnings")

warnings.warning({
illustration = ENUM,
text = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
illustrationenum, um de 29 nomes (ver Foundations)simIllustration, e.g folder with exclamation mark 'error-access-denied'
textstringsimThe message under the illustration, e.g 'Access denied'.

Warnings: error​

Warnings: Error

local warnings = require("turn.healthpass.ds.components.warnings")

warnings.warning({
illustration = ENUM,
text = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
illustrationenum, um de 29 nomes (ver Foundations)simIllustration, e.g folder with exclamation mark 'error-access-denied'
textstringsimThe message under the illustration, e.g 'Access denied'.

Buttons​

Buttons: button​

Buttons: Button

local buttons = require("turn.healthpass.ds.components.buttons")

buttons.button({
variant = ENUM,
label = STRING,
icon = ENUM,
icon_class = STRING,
href = STRING,
download = STRING,
aria_label = STRING,
attrs = TABLE,
})
PropTipoObrigatóriaPadrãoDescrição
variantenum, um de primary, secondary, ghostprimaryPrimary (green background), secondary (white background) or ghost.
labelstringButton label (omit for an icon-only button)
iconenum, um de 23 nomes (ver Foundations)Optional icon name, e.g. 'arrow-right'
icon_classstringw-6 h-6Utility classes on the icon; replaces the sizing default.
hrefstringLink target. When set the button renders as an anchor, otherwise a button element.
downloadstringDownload filename; renders the anchor's download attribute. Requires href.
aria_labelstringAccessible name, required for an icon-only button.
attrstablePass-through attributes, restricted to data-, hx- and aria-*. E.g. { ['data-drawer-open'] = '' }.

Buttons: label only​

Buttons: Label only

local buttons = require("turn.healthpass.ds.components.buttons")

buttons.button({
variant = ENUM,
label = STRING,
icon = ENUM,
icon_class = STRING,
href = STRING,
download = STRING,
aria_label = STRING,
attrs = TABLE,
})
PropTipoObrigatóriaPadrãoDescrição
variantenum, um de primary, secondary, ghostprimaryPrimary (green background), secondary (white background) or ghost.
labelstringButton label (omit for an icon-only button)
iconenum, um de 23 nomes (ver Foundations)Optional icon name, e.g. 'arrow-right'
icon_classstringw-6 h-6Utility classes on the icon; replaces the sizing default.
hrefstringLink target. When set the button renders as an anchor, otherwise a button element.
downloadstringDownload filename; renders the anchor's download attribute. Requires href.
aria_labelstringAccessible name, required for an icon-only button.
attrstablePass-through attributes, restricted to data-, hx- and aria-*. E.g. { ['data-drawer-open'] = '' }.

Buttons: icon only​

Buttons: Icon only

local buttons = require("turn.healthpass.ds.components.buttons")

buttons.button({
variant = ENUM,
label = STRING,
icon = ENUM,
icon_class = STRING,
href = STRING,
download = STRING,
aria_label = STRING,
attrs = TABLE,
})
PropTipoObrigatóriaPadrãoDescrição
variantenum, um de primary, secondary, ghostprimaryPrimary (green background), secondary (white background) or ghost.
labelstringButton label (omit for an icon-only button)
iconenum, um de 23 nomes (ver Foundations)Optional icon name, e.g. 'arrow-right'
icon_classstringw-6 h-6Utility classes on the icon; replaces the sizing default.
hrefstringLink target. When set the button renders as an anchor, otherwise a button element.
downloadstringDownload filename; renders the anchor's download attribute. Requires href.
aria_labelstringAccessible name, required for an icon-only button.
attrstablePass-through attributes, restricted to data-, hx- and aria-*. E.g. { ['data-drawer-open'] = '' }.

Badges​

Badges: badge​

Badges: Badge

local badges = require("turn.healthpass.ds.components.badges")

badges.badge({
state = ENUM,
icon = ENUM,
text = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
stateenum, um de success, warning, alertsimVisual state: green, yellow or red.
iconenum, um de 23 nomes (ver Foundations)simIcon name, sized and colored to match the pill.
textstringsimShort status text, e.g. 'Done'.

Badges: count badge​

Badges: Count badge

local badges = require("turn.healthpass.ds.components.badges")

badges.count_badge({
count = NUMBER,
})
PropTipoObrigatóriaPadrãoDescrição
countnumbersimThe count to display.

Date tile​

Date tile: january​

Date tile: January

local date_tile = require("turn.healthpass.ds.components.date_tile")

date_tile.date_tile({
date = DATE,
})
PropTipoObrigatóriaPadrãoDescrição
datedatesimISO date, e.g. '2026-05-12'; the tile shows a three-letter month and the day.

Date tile: may​

Date tile: May

local date_tile = require("turn.healthpass.ds.components.date_tile")

date_tile.date_tile({
date = DATE,
})
PropTipoObrigatóriaPadrãoDescrição
datedatesimISO date, e.g. '2026-05-12'; the tile shows a three-letter month and the day.

Date tile: july​

Date tile: July

local date_tile = require("turn.healthpass.ds.components.date_tile")

date_tile.date_tile({
date = DATE,
})
PropTipoObrigatóriaPadrãoDescrição
datedatesimISO date, e.g. '2026-05-12'; the tile shows a three-letter month and the day.

Pin input​

Pin input: pin input​

Pin input: Pin input

local pin_input = require("turn.healthpass.ds.components.pin_input")

pin_input.pin_input({
invalid = BOOLEAN,
error = STRING,
submit_url = STRING,
token = STRING,
original_path = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
invalidbooleanfalseRender the error state (red cells), e.g. after a wrong PIN.
errorstringMessage announced to screen readers when the PIN is rejected, e.g. 'Incorrect PIN'.
submit_urlstringWhere the filled field posts the PIN. Without one, filling the field does nothing.
tokenstringThe one-time token from the visitor's link, posted with the PIN.
original_pathstringWhere the visitor was heading when they were asked for the PIN, posted with it.

Pin input: invalid​

Pin input: Invalid

local pin_input = require("turn.healthpass.ds.components.pin_input")

pin_input.pin_input({
invalid = BOOLEAN,
error = STRING,
submit_url = STRING,
token = STRING,
original_path = STRING,
})
PropTipoObrigatóriaPadrãoDescrição
invalidbooleanfalseRender the error state (red cells), e.g. after a wrong PIN.
errorstringMessage announced to screen readers when the PIN is rejected, e.g. 'Incorrect PIN'.
submit_urlstringWhere the filled field posts the PIN. Without one, filling the field does nothing.
tokenstringThe one-time token from the visitor's link, posted with the PIN.
original_pathstringWhere the visitor was heading when they were asked for the PIN, posted with it.

Pin input: pin code​

Pin input: Pin code

local pin_input = require("turn.healthpass.ds.components.pin_input")

pin_input.pin_code({
code = DIGITS,
})
PropTipoObrigatóriaPadrãoDescrição
codedigitssimThe digits to display.