← Back to Official Package Registry
Tier 6: Local-First, IoT, Web & Media • Light-First HTML5 UI Kitv1.0.0 • 17 KB • Ed25519 Verified

veko_ui_kit@1.0.0

Accessible Daylight-First semantic HTML5 KPI cards, sortable data tables, status pills, alerts, breadcrumbs, tabs, and modal dialogs.

use [veko_ui_kit/kit]use [veko_ui_kit]
veko pkg add veko_ui_kit@1.0.0
Run in Browser PlaygroundDownload 1.0.0.vkpRaw demo.vk

veko_ui_kit

Accessible Light-First HTML5 UI component library for Veko web applications, built directly on lib/html homoiconic Hiccup blocks.

Installation

powershell
veko pkg add veko_ui_kit@1.0.0

Import in any Veko module:

rebol
use [ui = veko_ui_kit]

Existing imports of veko_ui_kit/kit remain supported via re-exports.

Architecture Notes

  • Pure Homoiconic Hiccup Nodes: Every component returns standard [.tag { ... } [...]] Hiccup blocks compatible with lib/html (html/render), lib/web (web/view, web/page), and web_live (live/diff-trees virtual DOM morphing).
  • WAI-ARIA Accessibility Defaults:
  • alert-banner automatically selects role="alert" for warning/danger tones and role="status" for informational tones.
  • modal-dialog emits native <dialog aria-modal="true"> wired to its heading via aria-labelledby and <form method="dialog"> dismissal.
  • breadcrumb marks the active leaf with aria-current="page".
  • tabs-nav emits role="tablist" buttons with roving tabindex, aria-selected, and aria-controls.
  • form-field links <label for="...">, aria-required, aria-invalid, and aria-describedby across hint and validation error paragraphs.
  • Light-First Design Tokens: ui/light-theme-css provides clean Slate/Sky CSS custom properties (--vk-bg, --vk-surface, --vk-border, --vk-text, --vk-accent) ready for <style> embedding with zero external asset pipelines.

API Reference

  • ui/status-pill tone label -> block
  • ui/kpi-card title value delta [/tone str] [/subtitle str] -> block
  • ui/alert-banner tone title message [/dismissible bool] -> block
  • ui/data-table columns rows [/caption str] [/empty-text str] -> block
  • ui/modal-dialog id title body_children [/footer block] [/open bool] -> block
  • ui/breadcrumb items -> block
  • ui/tabs-nav group_id tabs active_id -> block
  • ui/form-field id label_text input_type [/value str] [/placeholder str] [/hint str] [/error str] [/required bool] -> block
  • ui/light-theme-css -> str
  • ui/render node -> str

Idiomatic Veko Example

rebol
use [ui = veko_ui_kit, html]

cols = [
    { key = 'name', label = 'Service' }
    { key = 'status', label = 'Health' }
]
rows = [
    { name = 'auth-api', status = (ui/status-pill 'ok' 'Operational') }
]

doc = html/document 'System Status' [(html/style-el (ui/light-theme-css))] [
    (ui/kpi-card/tone 'Uptime' '99.99%' '+0.02%' 'ok')
    (ui/data-table/caption cols rows 'Core Services')
]
println (html/render doc)
packages/veko_ui_kit/examples/demo.vkSelf-contained runnable example & assertion suite
Raw .vk
// packages/veko_ui_kit/examples/demo.vk
// Verification suite for `veko_ui_kit` (`1.0.0`) and `veko_ui_kit/kit`:
// Light-First accessible HTML5 components (`status-pill`, `kpi-card`, `alert-banner`,
// `data-table`, `modal-dialog`, `breadcrumb`, `tabs-nav`, `form-field`) over `lib/html`.

use [ui = veko_ui_kit, kit = veko_ui_kit/kit, html]

assert-true = fn [label str, cond bool] [
	if not cond [
		println `[FAIL] {label}`
		return (err `assertion failed: {label}`)
	]
	println `[PASS] {label}`
	.ok
]

main = fn [] any [
	// 1. `status-pill` (including `veko_ui_kit/kit` re-export & XSS escaping)
	pill_html = html/render (kit/status-pill 'ok' 'Healthy <100%>')
	_ = assert-true/or 'status-pill class pill-ok' (str/contains? pill_html 'class="pill pill-ok"') [e -> return e]
	_ = assert-true/or 'status-pill escapes label HTML' (str/contains? pill_html 'Healthy &lt;100%&gt;') [e -> return e]

	// 2. `kpi-card`
	kpi_html = ui/render (ui/kpi-card/tone/subtitle 'P99 Latency' '3.4 ms' '-18%' 'ok' 'Last 15 minutes')
	_ = assert-true/or 'kpi-card renders value and delta pill' ((str/contains? kpi_html '3.4 ms') and (str/contains? kpi_html 'pill-ok')) [e -> return e]
	_ = assert-true/or 'kpi-card renders subtitle' (str/contains? kpi_html 'Last 15 minutes') [e -> return e]

	// 3. `alert-banner` (ARIA role escalation + dismissible control)
	danger_html = ui/render (ui/alert-banner/dismissible 'danger' 'Quota Reached' 'Upgrade plan to continue.' true)
	info_html   = ui/render (ui/alert-banner 'info' 'Sync Complete' 'All replicas converged.')
	_ = assert-true/or 'danger alert uses role="alert"' (str/contains? danger_html 'role="alert"') [e -> return e]
	_ = assert-true/or 'dismissible alert includes Dismiss button' (str/contains? danger_html 'aria-label="Dismiss notification"') [e -> return e]
	_ = assert-true/or 'info alert uses role="status"' (str/contains? info_html 'role="status"') [e -> return e]

	// 4. `data-table` (map-keyed columns, caption, and empty state)
	cols = [
		{ key = 'service', label = 'Service' }
		{ key = 'region', label = 'Region' }
		{ key = 'state', label = 'State' }
	]
	rows = [
		{ service = 'edge-gw', region = 'us-east', state = (ui/status-pill 'ok' 'Live') }
		{ service = 'worker-q', region = 'eu-west', state = (ui/status-pill 'warn' 'Draining') }
	]
	tbl_html = ui/render (ui/data-table/caption cols rows 'Cluster Nodes')
	_ = assert-true/or 'data-table renders caption and scope="col"' ((str/contains? tbl_html '<caption') and (str/contains? tbl_html 'scope="col"')) [e -> return e]
	_ = assert-true/or 'data-table renders nested Hiccup cells' (str/contains? tbl_html 'Draining') [e -> return e]

	empty_tbl_html = ui/render (ui/data-table/empty-text cols [] 'Zero nodes registered.')
	_ = assert-true/or 'data-table empty state spans all 3 columns' ((str/contains? empty_tbl_html 'colspan="3"') and (str/contains? empty_tbl_html 'Zero nodes registered.')) [e -> return e]

	// 5. `modal-dialog`
	dlg_html = ui/render (ui/modal-dialog/footer/open 'confirm-deploy' 'Deploy Release 1.0' [
		[.p {} ['Confirm production rollout to 12 regions?']]
	] [
		[.button { type = 'button', class = 'btn-primary' } ['Confirm']]
	] true)
	_ = assert-true/or 'modal-dialog wires aria-labelledby and open attribute' ((str/contains? dlg_html 'aria-labelledby="confirm-deploy-title"') and (str/contains? dlg_html ' open')) [e -> return e]

	// 6. `breadcrumb`
	bc_html = ui/render (ui/breadcrumb [
		{ label = 'Workspace', href = '/' }
		{ label = 'Packages', href = '/packages' }
		{ label = 'veko_ui_kit', href = 'javascript:alert(1)' }
	])
	_ = assert-true/or 'breadcrumb marks final item aria-current="page"' (str/contains? bc_html 'aria-current="page"') [e -> return e]

	// 7. `tabs-nav`
	tabs_html = ui/render (ui/tabs-nav 'pkg-tabs' [
		{ id = 'readme', label = 'README' }
		{ id = 'api', label = 'API Reference' }
	] 'api')
	_ = assert-true/or 'tabs-nav sets active tab aria-selected="true"' (str/contains? tabs_html 'id="pkg-tabs-tab-api"') [e -> return e]
	_ = assert-true/or 'tabs-nav wires aria-controls panel id' (str/contains? tabs_html 'aria-controls="pkg-tabs-panel-api"') [e -> return e]

	// 8. `form-field` (validation error + hint `aria-describedby` + `aria-invalid`)
	ff_node = ui/form-field/placeholder/hint/error/required 'admin_email' 'Administrator Email' 'email' 'ops@example.com' 'Used for security advisories.' 'Must be a verified corporate domain.' true
	ff_html = ui/render ff_node
	_ = assert-true/or 'form-field sets aria-invalid="true" on error' (str/contains? ff_html 'aria-invalid="true"') [e -> return e]
	_ = assert-true/or 'form-field links hint + error in aria-describedby' (str/contains? ff_html 'aria-describedby="admin_email-hint admin_email-error"') [e -> return e]

	// 9. Complete HTML5 document assembly with `light-theme-css`
	doc = html/document 'Veko UI Kit Showcase' [(html/style-el (ui/light-theme-css))] [
		(ui/breadcrumb [{ label = 'Home', href = '/' } { label = 'Dashboard', href = '/dash' }])
		(ui/kpi-card 'Active Workers' '64' '+4')
	]
	full_page = html/render doc
	_ = assert-true/or 'Complete HTML5 document renders <!DOCTYPE html> and CSS tokens' ((str/contains? full_page '<!DOCTYPE html>') and (str/contains? full_page '--vk-surface:#ffffff')) [e -> return e]

	println 'veko_ui_kit demo: all checks passed.'
	0
]

main
Cryptographic Provenance

Ed25519 Signature & Merkle Integrity

Registry URL: https://veko-lang.org/pkg/veko_ui_kit/1.0.0.vkp
Archive SHA-256: 25a0fdc2a08274990b7600b11bdf292632d26d664a918179b3b937c6d080d4ac
Merkle Root: 198456bede6e1d1fa13b0cc2920960f851009fd52b0e4bd567541a7ed5f9aedc
Signer Trust Key: ed25519:27406074d8681da1d4e6420f5d887cac15c313334c249ac047ba9d4e2df72b70
Embedded VKP1 Manifest

manifest.json

{"name":"veko_ui_kit","version":"1.0.0","tier":6.0,"tier_label":"Tier 6: Local-First, IoT, Web & Media","category":"Light-First HTML5 UI Kit","description":"Accessible Daylight-First semantic HTML5 KPI cards, sortable data tables, status pills, alerts, breadcrumbs, tabs, and modal dialogs.","modules":["veko_ui_kit/kit","veko_ui_kit"],"homepage":"https://veko-lang.org/packages/veko_ui_kit"}
Bundle Entry PathSizeLeaf SHA-256 Digest
README.md2 KB5a15f173dc20339848b9d16cda9f94d3ce8455b8b2730cba2e0c2686972bf024
examples/demo.vk5 KBc5c77382cf188ada11c098b29763a2f15b1cdbef205d96d7a4f91229a689d42a
kit.vk1 KB6a95ceb27d4e4c44ee56f8b37ddbc436c8b604005523811d0d6ffa68769709ee
mod.vk8 KBe025de4d7d4eff3083196c7079f10140a68b84aa530423ec6152a2522cbbebf9