-module(glaze@oat@table). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/glaze/oat/table.gleam"). -export([container/2, table/2, thead/2, tbody/2, tr/2, th/2, td/2]). -if(?OTP_RELEASE >= 27). -define(MODULEDOC(Str), -moduledoc(Str)). -define(DOC(Str), -doc(Str)). -else. -define(MODULEDOC(Str), -compile([])). -define(DOC(Str), -compile([])). -endif. ?MODULEDOC( " Oat documentation: \n" "\n" " Table helpers for data grids and record lists.\n" "\n" " ## Anatomy\n" "\n" " Wrap tables with [`container`](#container) for Oat table styling, then build\n" " rows and cells with regular table primitives.\n" "\n" " ## Recipe\n" "\n" " ```gleam\n" " import glaze/oat/table\n" " import lustre/element/html\n" "\n" " table.container([], [\n" " table.table([], [\n" " table.thead([], [\n" " table.tr([], [\n" " table.th([], [html.text(\"Name\")]),\n" " table.th([], [html.text(\"Role\")]),\n" " ]),\n" " ]),\n" " table.tbody([], [\n" " table.tr([], [\n" " table.td([], [html.text(\"Casey\")]),\n" " table.td([], [html.text(\"Admin\")]),\n" " ]),\n" " ]),\n" " ]),\n" " ])\n" " ```\n" ). -file("src/glaze/oat/table.gleam", 40). ?DOC(" Render the table wrapper used by Oat styling.\n"). -spec container( list(lustre@vdom@vattr:attribute(PXZ)), list(lustre@vdom@vnode:element(PXZ)) ) -> lustre@vdom@vnode:element(PXZ). container(Attrs, Children) -> lustre@element@html:'div'( [lustre@attribute:class(<<"table"/utf8>>) | Attrs], Children ). -file("src/glaze/oat/table.gleam", 47). -spec table( list(lustre@vdom@vattr:attribute(PYF)), list(lustre@vdom@vnode:element(PYF)) ) -> lustre@vdom@vnode:element(PYF). table(Attrs, Children) -> lustre@element@html:table(Attrs, Children). -file("src/glaze/oat/table.gleam", 54). -spec thead( list(lustre@vdom@vattr:attribute(PYL)), list(lustre@vdom@vnode:element(PYL)) ) -> lustre@vdom@vnode:element(PYL). thead(Attrs, Children) -> lustre@element@html:thead(Attrs, Children). -file("src/glaze/oat/table.gleam", 61). -spec tbody( list(lustre@vdom@vattr:attribute(PYR)), list(lustre@vdom@vnode:element(PYR)) ) -> lustre@vdom@vnode:element(PYR). tbody(Attrs, Children) -> lustre@element@html:tbody(Attrs, Children). -file("src/glaze/oat/table.gleam", 68). -spec tr( list(lustre@vdom@vattr:attribute(PYX)), list(lustre@vdom@vnode:element(PYX)) ) -> lustre@vdom@vnode:element(PYX). tr(Attrs, Children) -> lustre@element@html:tr(Attrs, Children). -file("src/glaze/oat/table.gleam", 75). -spec th( list(lustre@vdom@vattr:attribute(PZD)), list(lustre@vdom@vnode:element(PZD)) ) -> lustre@vdom@vnode:element(PZD). th(Attrs, Children) -> lustre@element@html:th(Attrs, Children). -file("src/glaze/oat/table.gleam", 82). -spec td( list(lustre@vdom@vattr:attribute(PZJ)), list(lustre@vdom@vnode:element(PZJ)) ) -> lustre@vdom@vnode:element(PZJ). td(Attrs, Children) -> lustre@element@html:td(Attrs, Children).