Mercurial
diff design_system/main.c @ 254:2b6e732087ff
[ui] Add complete native component catalog
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Tue, 04 Aug 2026 15:12:09 -0700 |
| parents | 7a7581f040e8 |
| children | 60a876c4587a |
line wrap: on
line diff
--- a/design_system/main.c Tue Aug 04 12:21:19 2026 -0700 +++ b/design_system/main.c Tue Aug 04 15:12:09 2026 -0700 @@ -3,6 +3,76 @@ #include <stdlib.h> #include <string.h> +static const char *const COMPONENT_PATHS[] = { + "/components/accordion", + "/components/alert", + "/components/alert-dialog", + "/components/aspect-ratio", + "/components/attachment", + "/components/avatar", + "/components/badge", + "/components/breadcrumb", + "/components/bubble", + "/components/button", + "/components/button-group", + "/components/calendar", + "/components/card", + "/components/carousel", + "/components/chart", + "/components/checkbox", + "/components/collapsible", + "/components/combobox", + "/components/command", + "/components/context-menu", + "/components/data-table", + "/components/date-picker", + "/components/dialog", + "/components/direction", + "/components/drawer", + "/components/dropdown-menu", + "/components/empty", + "/components/field", + "/components/form", + "/components/hover-card", + "/components/input", + "/components/input-group", + "/components/input-otp", + "/components/item", + "/components/kbd", + "/components/label", + "/components/marker", + "/components/menubar", + "/components/message", + "/components/message-scroller", + "/components/native-select", + "/components/navigation-menu", + "/components/notifications", + "/components/pagination", + "/components/popover", + "/components/progress", + "/components/radio-group", + "/components/resizable", + "/components/scroll-area", + "/components/select", + "/components/separator", + "/components/sheet", + "/components/sidebar", + "/components/skeleton", + "/components/slider", + "/components/sonner", + "/components/spinner", + "/components/stack", + "/components/switch", + "/components/table", + "/components/tabs", + "/components/textarea", + "/components/toast", + "/components/toggle", + "/components/toggle-group", + "/components/tooltip", + "/components/typography", +}; + static Seobeo_Request_Entry *Get_Component_Catalog( Seobeo_Request_Entry *request, Dowa_Arena *arena) @@ -71,13 +141,17 @@ Seobeo_Router_Init(); Seobeo_Router_Register("GET", "/", Get_Component_Catalog); Seobeo_Router_Register("GET", "/tokens", Get_Component_Catalog); + Seobeo_Router_Register("GET", "/icons", Get_Component_Catalog); Seobeo_Router_Register("GET", "/components", Get_Component_Catalog); - Seobeo_Router_Register("GET", "/components/button", Get_Component_Catalog); - Seobeo_Router_Register("GET", "/components/card", Get_Component_Catalog); - Seobeo_Router_Register("GET", "/components/alert", Get_Component_Catalog); - Seobeo_Router_Register("GET", "/components/field", Get_Component_Catalog); - Seobeo_Router_Register("GET", "/components/notifications", Get_Component_Catalog); - Seobeo_Router_Register("GET", "/components/stack", Get_Component_Catalog); + for (size_t i = 0; + i < sizeof(COMPONENT_PATHS) / sizeof(COMPONENT_PATHS[0]); + i++) + { + Seobeo_Router_Register( + "GET", + COMPONENT_PATHS[i], + Get_Component_Catalog); + } const char *port = getenv("DESIGN_SYSTEM_PORT"); if (!port || port[0] == '\0')