@vertesia/tools-admin-ui 1.0.0-dev.20260227.112605Z → 1.0.0-dev.20260305.083323Z

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/lib/AdminApp.d.ts +3 -1
  2. package/lib/AdminApp.d.ts.map +1 -1
  3. package/lib/components/AdminTopBar.d.ts +6 -0
  4. package/lib/components/AdminTopBar.d.ts.map +1 -0
  5. package/lib/components/CollectionCard.d.ts.map +1 -1
  6. package/lib/components/DetailPage.d.ts.map +1 -1
  7. package/lib/components/EndpointPanel.d.ts.map +1 -1
  8. package/lib/components/HeroSection.d.ts.map +1 -1
  9. package/lib/components/ResourceCard.d.ts.map +1 -1
  10. package/lib/components/ResourceSection.d.ts.map +1 -1
  11. package/lib/components/SearchBar.d.ts.map +1 -1
  12. package/lib/components/SummaryBadge.d.ts.map +1 -1
  13. package/lib/components/index.d.ts +6 -5
  14. package/lib/components/index.d.ts.map +1 -1
  15. package/lib/components/typeVariants.d.ts +5 -0
  16. package/lib/components/typeVariants.d.ts.map +1 -0
  17. package/lib/hooks.d.ts +1 -1
  18. package/lib/hooks.d.ts.map +1 -1
  19. package/lib/pages/HomePage.d.ts.map +1 -1
  20. package/lib/pages/InteractionCollection.d.ts.map +1 -1
  21. package/lib/pages/InteractionDetail.d.ts.map +1 -1
  22. package/lib/pages/SkillCollection.d.ts.map +1 -1
  23. package/lib/pages/SkillDetail.d.ts.map +1 -1
  24. package/lib/pages/TemplateCollection.d.ts.map +1 -1
  25. package/lib/pages/TemplateDetail.d.ts.map +1 -1
  26. package/lib/pages/ToolCollection.d.ts.map +1 -1
  27. package/lib/pages/TypeCollection.d.ts.map +1 -1
  28. package/lib/pages/TypeDetail.d.ts.map +1 -1
  29. package/lib/tools-admin-ui.js +410 -377
  30. package/lib/tools-admin-ui.js.map +1 -1
  31. package/package.json +8 -4
  32. package/src/AdminApp.tsx +21 -17
  33. package/src/components/AdminTopBar.tsx +39 -0
  34. package/src/components/CollectionCard.tsx +18 -13
  35. package/src/components/DetailPage.tsx +20 -11
  36. package/src/components/EndpointPanel.tsx +16 -7
  37. package/src/components/HeroSection.tsx +51 -45
  38. package/src/components/ResourceCard.tsx +23 -18
  39. package/src/components/ResourceSection.tsx +7 -5
  40. package/src/components/SearchBar.tsx +8 -6
  41. package/src/components/SummaryBadge.tsx +4 -3
  42. package/src/components/index.ts +6 -5
  43. package/src/components/typeVariants.ts +18 -0
  44. package/src/dev/index.css +13 -0
  45. package/src/dev/main.tsx +5 -2
  46. package/src/hooks.ts +2 -1
  47. package/src/pages/HomePage.tsx +18 -15
  48. package/src/pages/InteractionCollection.tsx +25 -27
  49. package/src/pages/InteractionDetail.tsx +35 -34
  50. package/src/pages/SkillCollection.tsx +29 -32
  51. package/src/pages/SkillDetail.tsx +31 -41
  52. package/src/pages/TemplateCollection.tsx +25 -21
  53. package/src/pages/TemplateDetail.tsx +18 -17
  54. package/src/pages/ToolCollection.tsx +22 -16
  55. package/src/pages/TypeCollection.tsx +32 -24
  56. package/src/pages/TypeDetail.tsx +16 -18
  57. package/src/theme.css +12 -0
  58. package/src/admin.css +0 -650
@@ -1,7 +1,9 @@
1
- import { useFetch } from '@vertesia/ui/core';
1
+ import { Card, CardContent, Spinner, useFetch } from '@vertesia/ui/core';
2
2
  import { useParams } from '@vertesia/ui/router';
3
+
3
4
  import { useAdminContext } from '../AdminContext.js';
4
5
  import { DetailPage } from '../components/DetailPage.js';
6
+ import { TYPE_VARIANTS } from '../components/typeVariants.js';
5
7
 
6
8
  interface ToolDef {
7
9
  name: string;
@@ -19,7 +21,7 @@ export function ToolCollection() {
19
21
  const collection = useParams('collection');
20
22
  const { baseUrl } = useAdminContext();
21
23
 
22
- const { data, isLoading, error } = useFetch<ToolCollectionResponse>(
24
+ const { data, error } = useFetch<ToolCollectionResponse>(
23
25
  () => fetch(`${baseUrl}/tools/${collection}`).then(r => {
24
26
  if (!r.ok) throw new Error(`Failed to load collection: ${r.statusText}`);
25
27
  return r.json();
@@ -27,8 +29,8 @@ export function ToolCollection() {
27
29
  [baseUrl, collection]
28
30
  );
29
31
 
30
- if (isLoading) return <div className="vta-loading">Loading collection...</div>;
31
- if (error || !data) return <div className="vta-error">Failed to load tool collection &ldquo;{collection}&rdquo;.</div>;
32
+ if (error) return <div className="p-6 text-destructive">Failed to load tool collection &ldquo;{collection}&rdquo;.</div>;
33
+ if (!data) return <div className="flex h-64 items-center justify-center text-muted-foreground"><Spinner /></div>;
32
34
 
33
35
  return (
34
36
  <DetailPage
@@ -37,18 +39,22 @@ export function ToolCollection() {
37
39
  description={data.description || `${data.tools.length} tool${data.tools.length !== 1 ? 's' : ''} in this collection.`}
38
40
  >
39
41
  {data.tools.map(tool => (
40
- <div key={tool.name} className="vta-detail-card">
41
- <div className="vta-detail-card-header">
42
- <span className="vta-card-type vta-card-type--tool">tool</span>
43
- <div className="vta-card-title">{tool.name}</div>
44
- </div>
45
- <div className="vta-card-desc">{tool.description || 'No description'}</div>
46
- {tool.input_schema && (
47
- <pre className="vta-detail-code">
48
- {JSON.stringify(tool.input_schema, null, 2)}
49
- </pre>
50
- )}
51
- </div>
42
+ <Card key={tool.name} className="mb-4">
43
+ <CardContent className="p-5">
44
+ <div className="mb-2 flex items-center gap-2">
45
+ <span className={`inline-block rounded-full px-2 py-0.5 text-[0.7rem] font-semibold uppercase tracking-wide ${TYPE_VARIANTS.tool}`}>
46
+ tool
47
+ </span>
48
+ <span className="font-semibold text-card-foreground">{tool.name}</span>
49
+ </div>
50
+ <div className="text-sm text-muted-foreground">{tool.description || 'No description'}</div>
51
+ {tool.input_schema && (
52
+ <pre className="mt-3 whitespace-pre-wrap wrap-break-word rounded-lg border border-border bg-muted-background p-4 font-mono text-sm text-foreground">
53
+ {JSON.stringify(tool.input_schema, null, 2)}
54
+ </pre>
55
+ )}
56
+ </CardContent>
57
+ </Card>
52
58
  ))}
53
59
  </DetailPage>
54
60
  );
@@ -1,14 +1,16 @@
1
- import { useFetch } from '@vertesia/ui/core';
2
- import { useParams, NavLink } from '@vertesia/ui/router';
3
1
  import type { InCodeTypeDefinition } from '@vertesia/common';
2
+ import { Badge, Card, CardContent, Spinner, useFetch } from '@vertesia/ui/core';
3
+ import { NavLink, useParams } from '@vertesia/ui/router';
4
+
4
5
  import { useAdminContext } from '../AdminContext.js';
5
6
  import { DetailPage } from '../components/DetailPage.js';
7
+ import { TYPE_VARIANTS } from '../components/typeVariants.js';
6
8
 
7
9
  export function TypeCollection() {
8
10
  const collection = useParams('collection');
9
11
  const { baseUrl } = useAdminContext();
10
12
 
11
- const { data: types, isLoading, error } = useFetch<InCodeTypeDefinition[]>(
13
+ const { data: types, error } = useFetch<InCodeTypeDefinition[]>(
12
14
  () => fetch(`${baseUrl}/types/${collection}`).then(r => {
13
15
  if (!r.ok) throw new Error(`Failed to load collection: ${r.statusText}`);
14
16
  return r.json();
@@ -16,8 +18,8 @@ export function TypeCollection() {
16
18
  [baseUrl, collection]
17
19
  );
18
20
 
19
- if (isLoading) return <div className="vta-loading">Loading collection...</div>;
20
- if (error || !types) return <div className="vta-error">Failed to load type collection &ldquo;{collection}&rdquo;.</div>;
21
+ if (error) return <div className="p-6 text-destructive">Failed to load type collection &ldquo;{collection}&rdquo;.</div>;
22
+ if (!types) return <div className="flex h-64 items-center justify-center text-muted-foreground"><Spinner /></div>;
21
23
 
22
24
  return (
23
25
  <DetailPage
@@ -25,32 +27,38 @@ export function TypeCollection() {
25
27
  title={collection}
26
28
  description={`${types.length} content type${types.length !== 1 ? 's' : ''} in this collection.`}
27
29
  >
28
- <div className="vta-card-grid">
30
+ <div className="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">
29
31
  {types.map(t => {
30
32
  const typeName = t.id?.split(':')[1] || t.name;
31
33
  return (
32
34
  <NavLink
33
35
  key={t.name}
34
36
  href={`/types/${collection}/${typeName}`}
35
- className="vta-card-link"
37
+ className="no-underline"
36
38
  >
37
- <div className="vta-card vta-card--link">
38
- <span className="vta-card-type vta-card-type--type">type</span>
39
- <div className="vta-card-title">{t.name}</div>
40
- <div className="vta-card-desc">{t.description || 'No description'}</div>
41
- {t.tags && t.tags.length > 0 && (
42
- <div className="vta-card-tags">
43
- {t.tags.map(tag => (
44
- <span key={tag} className="vta-tag">{tag}</span>
45
- ))}
46
- </div>
47
- )}
48
- <div className="vta-card-url">
49
- {t.is_chunkable && 'chunkable'}
50
- {t.is_chunkable && t.strict_mode && ' · '}
51
- {t.strict_mode && 'strict'}
52
- </div>
53
- </div>
39
+ <Card className="h-full transition-all hover:-translate-y-0.5 hover:shadow-md">
40
+ <CardContent className="p-5">
41
+ <span className={`mb-2 inline-block rounded-full px-2 py-0.5 text-[0.7rem] font-semibold uppercase tracking-wide ${TYPE_VARIANTS.type}`}>
42
+ type
43
+ </span>
44
+ <div className="font-semibold text-card-foreground">{t.name}</div>
45
+ <div className="mt-1 text-sm text-muted-foreground">{t.description || 'No description'}</div>
46
+ {t.tags && t.tags.length > 0 && (
47
+ <div className="mt-3 flex flex-wrap gap-1.5">
48
+ {t.tags.map(tag => (
49
+ <Badge key={tag} variant="default">{tag}</Badge>
50
+ ))}
51
+ </div>
52
+ )}
53
+ {(t.is_chunkable || t.strict_mode) && (
54
+ <div className="mt-2 truncate font-mono text-xs text-muted-foreground">
55
+ {t.is_chunkable && 'chunkable'}
56
+ {t.is_chunkable && t.strict_mode && ' · '}
57
+ {t.strict_mode && 'strict'}
58
+ </div>
59
+ )}
60
+ </CardContent>
61
+ </Card>
54
62
  </NavLink>
55
63
  );
56
64
  })}
@@ -1,6 +1,7 @@
1
- import { useFetch } from '@vertesia/ui/core';
2
- import { useParams } from '@vertesia/ui/router';
3
1
  import type { InCodeTypeDefinition } from '@vertesia/common';
2
+ import { Badge, Spinner, useFetch } from '@vertesia/ui/core';
3
+ import { useParams } from '@vertesia/ui/router';
4
+
4
5
  import { useAdminContext } from '../AdminContext.js';
5
6
  import { DetailPage } from '../components/DetailPage.js';
6
7
 
@@ -10,7 +11,7 @@ export function TypeDetail() {
10
11
  const name = params.name;
11
12
  const { baseUrl } = useAdminContext();
12
13
 
13
- const { data: typeDef, isLoading, error } = useFetch<InCodeTypeDefinition>(
14
+ const { data: typeDef, error } = useFetch<InCodeTypeDefinition>(
14
15
  () => fetch(`${baseUrl}/types/${collection}/${name}`).then(r => {
15
16
  if (!r.ok) throw new Error(`Failed to load type: ${r.statusText}`);
16
17
  return r.json();
@@ -18,8 +19,8 @@ export function TypeDetail() {
18
19
  [baseUrl, collection, name]
19
20
  );
20
21
 
21
- if (isLoading) return <div className="vta-loading">Loading type...</div>;
22
- if (error || !typeDef) return <div className="vta-error">Failed to load type &ldquo;{name}&rdquo;.</div>;
22
+ if (error) return <div className="p-6 text-destructive">Failed to load type &ldquo;{name}&rdquo;.</div>;
23
+ if (!typeDef) return <div className="flex h-64 items-center justify-center text-muted-foreground"><Spinner /></div>;
23
24
 
24
25
  return (
25
26
  <DetailPage
@@ -29,31 +30,28 @@ export function TypeDetail() {
29
30
  tags={typeDef.tags}
30
31
  backHref={`/types/${collection}`}
31
32
  >
32
- {/* Flags */}
33
33
  {(typeDef.is_chunkable || typeDef.strict_mode) && (
34
- <div className="vta-detail-section">
35
- <div className="vta-detail-flags">
36
- {typeDef.is_chunkable && <span className="vta-detail-flag">Chunkable</span>}
37
- {typeDef.strict_mode && <span className="vta-detail-flag">Strict Mode</span>}
34
+ <div className="mb-8">
35
+ <div className="flex flex-wrap gap-2">
36
+ {typeDef.is_chunkable && <Badge variant="success">Chunkable</Badge>}
37
+ {typeDef.strict_mode && <Badge variant="success">Strict Mode</Badge>}
38
38
  </div>
39
39
  </div>
40
40
  )}
41
41
 
42
- {/* Object Schema */}
43
42
  {typeDef.object_schema && (
44
- <div className="vta-detail-section">
45
- <h2>Object Schema</h2>
46
- <pre className="vta-detail-code">
43
+ <div className="mb-8">
44
+ <h2 className="mb-3 text-lg font-semibold text-foreground">Object Schema</h2>
45
+ <pre className="whitespace-pre-wrap wrap-break-word rounded-lg border border-border bg-muted-background p-4 font-mono text-sm text-foreground">
47
46
  {JSON.stringify(typeDef.object_schema, null, 2)}
48
47
  </pre>
49
48
  </div>
50
49
  )}
51
50
 
52
- {/* Table Layout */}
53
51
  {typeDef.table_layout && typeDef.table_layout.length > 0 && (
54
- <div className="vta-detail-section">
55
- <h2>Table Layout</h2>
56
- <pre className="vta-detail-code">
52
+ <div className="mb-8">
53
+ <h2 className="mb-3 text-lg font-semibold text-foreground">Table Layout</h2>
54
+ <pre className="whitespace-pre-wrap wrap-break-word rounded-lg border border-border bg-muted-background p-4 font-mono text-sm text-foreground">
57
55
  {JSON.stringify(typeDef.table_layout, null, 2)}
58
56
  </pre>
59
57
  </div>
package/src/theme.css ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Default theme for @vertesia/tools-admin-ui.
3
+ *
4
+ * Consumers should import this file (or provide their own equivalent)
5
+ * so that @vertesia/ui shadcn components resolve their CSS custom properties.
6
+ *
7
+ * @import '@vertesia/tools-admin-ui/theme.css';
8
+ */
9
+
10
+ @import "@vertesia/ui/styles/color.css";
11
+ @import "@vertesia/ui/styles/theme.css";
12
+ @import "@vertesia/ui/styles/utilities.css";