Merge remote-tracking branch 'playground/master'
This commit is contained in:
commit
ee882283ad
@ -2,6 +2,7 @@ import { TempstreamJSX } from "tempstream";
|
|||||||
import type { ComponentToHTMLArgs } from "@sealcode/jdd";
|
import type { ComponentToHTMLArgs } from "@sealcode/jdd";
|
||||||
import { Component, ComponentArguments, insert_nbsp } from "@sealcode/jdd";
|
import { Component, ComponentArguments, insert_nbsp } from "@sealcode/jdd";
|
||||||
import { button, button_variants } from "src/back/elements/button.js";
|
import { button, button_variants } from "src/back/elements/button.js";
|
||||||
|
import { getAllIconNames } from "src/back/icons.js";
|
||||||
|
|
||||||
const component_arguments = {
|
const component_arguments = {
|
||||||
mode: new ComponentArguments.Enum(["column", "row"]),
|
mode: new ComponentArguments.Enum(["column", "row"]),
|
||||||
@ -12,6 +13,10 @@ const component_arguments = {
|
|||||||
buttons: new ComponentArguments.List(
|
buttons: new ComponentArguments.List(
|
||||||
new ComponentArguments.Structured({
|
new ComponentArguments.Structured({
|
||||||
variant: new ComponentArguments.Enum(button_variants),
|
variant: new ComponentArguments.Enum(button_variants),
|
||||||
|
icon: new ComponentArguments.Enum(async () => [
|
||||||
|
"none",
|
||||||
|
...(await getAllIconNames()),
|
||||||
|
]).setDefaultValue("none"),
|
||||||
text: new ComponentArguments.ShortText(),
|
text: new ComponentArguments.ShortText(),
|
||||||
href: new ComponentArguments.ShortText(),
|
href: new ComponentArguments.ShortText(),
|
||||||
size: new ComponentArguments.Enum([
|
size: new ComponentArguments.Enum([
|
||||||
@ -47,6 +52,7 @@ export class Buttons extends Component<typeof component_arguments> {
|
|||||||
{buttons.map((b) =>
|
{buttons.map((b) =>
|
||||||
button({
|
button({
|
||||||
...b,
|
...b,
|
||||||
|
icon: b.icon == "none" ? undefined : b.icon,
|
||||||
text: insert_nbsp(b.text),
|
text: insert_nbsp(b.text),
|
||||||
classes: [`button--size-${b.size}`],
|
classes: [`button--size-${b.size}`],
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user