Update new functions
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// components/Label.js
|
||||
import { $, $html } from "../sigpro.js";
|
||||
import { $, Tag } from "../sigpro.js";
|
||||
import { ui, val } from "../core/utils.js";
|
||||
|
||||
/**
|
||||
@@ -13,16 +13,16 @@ export const Label = (props) => {
|
||||
const { children, value, floating = false, error, required, class: className, ...rest } = props;
|
||||
|
||||
if (floating) {
|
||||
return $html("label", { class: ui("floating-label w-full", className), ...rest }, () => [
|
||||
value ? $html("span", {}, value) : null,
|
||||
return Tag("label", { class: ui("floating-label w-full", className), ...rest }, () => [
|
||||
value ? Tag("span", {}, value) : null,
|
||||
children,
|
||||
error ? $html("span", { class: "text-error text-xs" }, val(error)) : null,
|
||||
error ? Tag("span", { class: "text-error text-xs" }, val(error)) : null,
|
||||
]);
|
||||
}
|
||||
|
||||
return $html("label", { class: ui("input w-full", className), ...rest }, () => [
|
||||
value ? $html("span", { class: "label" }, value) : null,
|
||||
return Tag("label", { class: ui("input w-full", className), ...rest }, () => [
|
||||
value ? Tag("span", { class: "label" }, value) : null,
|
||||
children,
|
||||
error ? $html("span", { class: "text-error text-xs" }, val(error)) : null,
|
||||
error ? Tag("span", { class: "text-error text-xs" }, val(error)) : null,
|
||||
]);
|
||||
};
|
||||
Reference in New Issue
Block a user