diff --git a/lib/zin/func.php b/lib/zin/func.php index 1f347f84f6..e03f237fae 100644 --- a/lib/zin/func.php +++ b/lib/zin/func.php @@ -69,6 +69,7 @@ function divider(): divider {return createWg('divider', func_get_args());} function actionItem(): actionItem {return createWg('actionItem', func_get_args());} function nav(): nav {return createWg('nav', func_get_args());} function label(): label {return createWg('label', func_get_args());} +function statusLabel(): statusLabel {return createWg('statusLabel', func_get_args());} function dtable(): dtable {return createWg('dtable', func_get_args());} function menu(): menu {return createWg('menu', func_get_args());} function dropdown(): dropdown {return createWg('dropdown', func_get_args());} diff --git a/lib/zin/wg/statuslabel/v1.php b/lib/zin/wg/statuslabel/v1.php new file mode 100644 index 0000000000..771071534a --- /dev/null +++ b/lib/zin/wg/statuslabel/v1.php @@ -0,0 +1,32 @@ +prop(array('text', 'status')); + return span + ( + setClass('label', $status ? "status-$status" : ''), + set($this->getRestProps()), + $text, + $this->children() + ); + } + + public static function create(string $status, string $text, mixed ...$children): static + { + $props = array('status' => $status, 'text' => $text); + return new static(set($props), ...$children); + } +}