comparison 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
comparison
equal deleted inserted replaced
253:fdf3816959cb 254:2b6e732087ff
1 #include "seobeo/seobeo.h" 1 #include "seobeo/seobeo.h"
2 2
3 #include <stdlib.h> 3 #include <stdlib.h>
4 #include <string.h> 4 #include <string.h>
5
6 static const char *const COMPONENT_PATHS[] = {
7 "/components/accordion",
8 "/components/alert",
9 "/components/alert-dialog",
10 "/components/aspect-ratio",
11 "/components/attachment",
12 "/components/avatar",
13 "/components/badge",
14 "/components/breadcrumb",
15 "/components/bubble",
16 "/components/button",
17 "/components/button-group",
18 "/components/calendar",
19 "/components/card",
20 "/components/carousel",
21 "/components/chart",
22 "/components/checkbox",
23 "/components/collapsible",
24 "/components/combobox",
25 "/components/command",
26 "/components/context-menu",
27 "/components/data-table",
28 "/components/date-picker",
29 "/components/dialog",
30 "/components/direction",
31 "/components/drawer",
32 "/components/dropdown-menu",
33 "/components/empty",
34 "/components/field",
35 "/components/form",
36 "/components/hover-card",
37 "/components/input",
38 "/components/input-group",
39 "/components/input-otp",
40 "/components/item",
41 "/components/kbd",
42 "/components/label",
43 "/components/marker",
44 "/components/menubar",
45 "/components/message",
46 "/components/message-scroller",
47 "/components/native-select",
48 "/components/navigation-menu",
49 "/components/notifications",
50 "/components/pagination",
51 "/components/popover",
52 "/components/progress",
53 "/components/radio-group",
54 "/components/resizable",
55 "/components/scroll-area",
56 "/components/select",
57 "/components/separator",
58 "/components/sheet",
59 "/components/sidebar",
60 "/components/skeleton",
61 "/components/slider",
62 "/components/sonner",
63 "/components/spinner",
64 "/components/stack",
65 "/components/switch",
66 "/components/table",
67 "/components/tabs",
68 "/components/textarea",
69 "/components/toast",
70 "/components/toggle",
71 "/components/toggle-group",
72 "/components/tooltip",
73 "/components/typography",
74 };
5 75
6 static Seobeo_Request_Entry *Get_Component_Catalog( 76 static Seobeo_Request_Entry *Get_Component_Catalog(
7 Seobeo_Request_Entry *request, 77 Seobeo_Request_Entry *request,
8 Dowa_Arena *arena) 78 Dowa_Arena *arena)
9 { 79 {
69 int main(void) 139 int main(void)
70 { 140 {
71 Seobeo_Router_Init(); 141 Seobeo_Router_Init();
72 Seobeo_Router_Register("GET", "/", Get_Component_Catalog); 142 Seobeo_Router_Register("GET", "/", Get_Component_Catalog);
73 Seobeo_Router_Register("GET", "/tokens", Get_Component_Catalog); 143 Seobeo_Router_Register("GET", "/tokens", Get_Component_Catalog);
144 Seobeo_Router_Register("GET", "/icons", Get_Component_Catalog);
74 Seobeo_Router_Register("GET", "/components", Get_Component_Catalog); 145 Seobeo_Router_Register("GET", "/components", Get_Component_Catalog);
75 Seobeo_Router_Register("GET", "/components/button", Get_Component_Catalog); 146 for (size_t i = 0;
76 Seobeo_Router_Register("GET", "/components/card", Get_Component_Catalog); 147 i < sizeof(COMPONENT_PATHS) / sizeof(COMPONENT_PATHS[0]);
77 Seobeo_Router_Register("GET", "/components/alert", Get_Component_Catalog); 148 i++)
78 Seobeo_Router_Register("GET", "/components/field", Get_Component_Catalog); 149 {
79 Seobeo_Router_Register("GET", "/components/notifications", Get_Component_Catalog); 150 Seobeo_Router_Register(
80 Seobeo_Router_Register("GET", "/components/stack", Get_Component_Catalog); 151 "GET",
152 COMPONENT_PATHS[i],
153 Get_Component_Catalog);
154 }
81 155
82 const char *port = getenv("DESIGN_SYSTEM_PORT"); 156 const char *port = getenv("DESIGN_SYSTEM_PORT");
83 if (!port || port[0] == '\0') 157 if (!port || port[0] == '\0')
84 port = "6980"; 158 port = "6980";
85 if (!Port_Is_Valid(port)) 159 if (!Port_Is_Valid(port))