SXC content: docs/examples/home/reference pages + SX testing runner
New sxc/ content tree with 120 page files across docs, examples, home, and reference demos. sx/sx/testing/ adds page-runner.sx (317L) and index-runner.sx (394L) — SX-native test runner pages for browser-based evaluation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
44
sx/sxc/examples/bulk-update-demo.sx
Normal file
44
sx/sxc/examples/bulk-update-demo.sx
Normal file
@@ -0,0 +1,44 @@
|
||||
(defcomp
|
||||
(&key users)
|
||||
(div
|
||||
(~tw :tokens "space-y-3")
|
||||
(form
|
||||
:id "bulk-form"
|
||||
(div
|
||||
(~tw :tokens "flex gap-2 mb-3")
|
||||
(button
|
||||
:type "button"
|
||||
:sx-post "/sx/(geography.(hypermedia.(example.(api.bulk))))?action=activate"
|
||||
:sx-target "#bulk-table"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-include "#bulk-form"
|
||||
(~tw :tokens "px-3 py-1.5 bg-emerald-600 text-white rounded text-sm hover:bg-emerald-700")
|
||||
"Activate")
|
||||
(button
|
||||
:type "button"
|
||||
:sx-post "/sx/(geography.(hypermedia.(example.(api.bulk))))?action=deactivate"
|
||||
:sx-target "#bulk-table"
|
||||
:sx-swap "innerHTML"
|
||||
:sx-include "#bulk-form"
|
||||
(~tw :tokens "px-3 py-1.5 bg-stone-600 text-white rounded text-sm hover:bg-stone-700")
|
||||
"Deactivate"))
|
||||
(table
|
||||
(~tw :tokens "w-full text-left text-sm")
|
||||
(thead
|
||||
(tr
|
||||
(~tw :tokens "border-b border-stone-200")
|
||||
(th (~tw :tokens "px-3 py-2 w-8") "")
|
||||
(th (~tw :tokens "px-3 py-2 font-medium text-stone-600") "Name")
|
||||
(th (~tw :tokens "px-3 py-2 font-medium text-stone-600") "Email")
|
||||
(th (~tw :tokens "px-3 py-2 font-medium text-stone-600") "Status")))
|
||||
(tbody
|
||||
:id "bulk-table"
|
||||
(map
|
||||
(fn
|
||||
(u)
|
||||
(~examples/bulk-row
|
||||
:id (nth u 0)
|
||||
:name (nth u 1)
|
||||
:email (nth u 2)
|
||||
:status (nth u 3)))
|
||||
users))))))
|
||||
Reference in New Issue
Block a user