@udixio/mcp 0.3.2 → 0.4.3

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 (42) hide show
  1. package/dist/LICENSE +202 -0
  2. package/dist/cli.mjs +3 -6
  3. package/dist/lib/loaders/components.d.ts.map +1 -1
  4. package/dist/lib/loaders/docs.d.ts.map +1 -1
  5. package/dist/lib/loaders/theme.d.ts.map +1 -1
  6. package/package.json +16 -12
  7. package/dist/bundled/components-index.json +0 -369
  8. package/dist/bundled/doc-src/components/Code.astro +0 -14
  9. package/dist/bundled/doc-src/components/ComponentPreview.astro +0 -218
  10. package/dist/bundled/doc-src/data/components/button.overview.mdx +0 -152
  11. package/dist/bundled/doc-src/data/components/card.overview.mdx +0 -91
  12. package/dist/bundled/doc-src/data/components/carousel.overview.mdx +0 -108
  13. package/dist/bundled/doc-src/data/components/checkbox.overview.mdx +0 -172
  14. package/dist/bundled/doc-src/data/components/chip.overview.mdx +0 -216
  15. package/dist/bundled/doc-src/data/components/date-picker.overview.mdx +0 -102
  16. package/dist/bundled/doc-src/data/components/divider.overview.mdx +0 -54
  17. package/dist/bundled/doc-src/data/components/fab-menu.overview.mdx +0 -69
  18. package/dist/bundled/doc-src/data/components/fab.overview.mdx +0 -80
  19. package/dist/bundled/doc-src/data/components/icon-button.overview.mdx +0 -155
  20. package/dist/bundled/doc-src/data/components/navigation-rail.overview.mdx +0 -142
  21. package/dist/bundled/doc-src/data/components/progress-indicator.overview.mdx +0 -49
  22. package/dist/bundled/doc-src/data/components/slider.overview.mdx +0 -64
  23. package/dist/bundled/doc-src/data/components/snackbar.overview.mdx +0 -37
  24. package/dist/bundled/doc-src/data/components/switch.overview.mdx +0 -41
  25. package/dist/bundled/doc-src/data/components/tabs.overview.mdx +0 -171
  26. package/dist/bundled/doc-src/data/components/temp.md +0 -506
  27. package/dist/bundled/doc-src/data/components/text-field.overview.mdx +0 -90
  28. package/dist/bundled/doc-src/data/components/tooltip.overview.mdx +0 -159
  29. package/dist/bundled/doc-src/data/pages/mcp.mdx +0 -92
  30. package/dist/bundled/doc-src/layouts/components.astro +0 -87
  31. package/dist/bundled/doc-src/layouts/layout.astro +0 -55
  32. package/dist/bundled/doc-src/pages/404.astro +0 -18
  33. package/dist/bundled/doc-src/pages/[...url].astro +0 -34
  34. package/dist/bundled/doc-src/pages/animations.astro +0 -322
  35. package/dist/bundled/doc-src/pages/components/[component]/api.astro +0 -89
  36. package/dist/bundled/doc-src/pages/components/[component]/index.astro +0 -5
  37. package/dist/bundled/doc-src/pages/components/[component]/overview.astro +0 -37
  38. package/dist/bundled/doc-src/pages/components/index.astro +0 -130
  39. package/dist/bundled/doc-src/pages/index.astro +0 -5
  40. package/dist/bundled/doc-src/pages/search.astro +0 -12
  41. package/dist/bundled/doc-src/pages/themes.astro +0 -86
  42. package/dist/bundled/theme.json +0 -359
@@ -1,159 +0,0 @@
1
- ---
2
- ---
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
- import { CodePreview } from '@/components/CodePreview.js';
11
-
12
- ## Usage
13
-
14
- Tooltip displays informative text when users hover, focus, or click a target.
15
-
16
- ```bash
17
- import { Tooltip, Button } from "@udixio/ui-react"
18
- ```
19
-
20
- <CodePreview client:load
21
- code={`
22
- <Tooltip text="Copy to clipboard">
23
- <Button label="Hover me" />
24
- </Tooltip>
25
- `}
26
- />
27
-
28
- ## Content
29
-
30
- Use `content` to render fully custom tooltip content (Markdown, rich text, or components). When `content` is provided, `title`, `text`, and `buttons` are ignored.
31
-
32
- ```jsx
33
- <Tooltip
34
- variant="rich"
35
- content={
36
- <div>
37
- <strong>Shortcuts</strong>
38
- <p>Press ⌘K to open the command palette.</p>
39
- </div>
40
- }
41
- >
42
- <Button label="Help" />
43
- </Tooltip>
44
- ```
45
-
46
- ## Variants
47
-
48
- Plain is a small text bubble. Rich is card-like with title, text, and actions.
49
-
50
- ```jsx
51
- <div className="flex gap-6">
52
- <Tooltip text="Plain tooltip">
53
- <Button label="Plain" />
54
- </Tooltip>
55
- <Tooltip variant="rich" title="Saved" text="Item added to favorites" buttons={[{ label: 'Undo', variant: 'text' }] }>
56
- <Button label="Rich" />
57
- </Tooltip>
58
- </div>
59
- ```
60
-
61
- ## Triggers
62
-
63
- Control how the tooltip appears using `trigger`: "hover", "focus", "click" or an array of these.
64
-
65
- ```jsx
66
- <Tooltip text="Opens on click" trigger="click">
67
- <Button label="Click" />
68
- </Tooltip>
69
- ```
70
-
71
- ## Guidelines (M3 aligned)
72
-
73
- Use plain tooltips to label icon-only controls; rich tooltips are for longer explanations and optional actions.
74
-
75
- ```jsx
76
- <div className="flex gap-6">
77
- <Tooltip text="Present now">
78
- <Button label="🎥" />
79
- </Tooltip>
80
- <Tooltip
81
- variant="rich"
82
- title="New setting"
83
- text="Choose who can see your activity status."
84
- buttons={[{ label: 'Learn more', variant: 'text' }]}
85
- >
86
- <Button label="Privacy" />
87
- </Tooltip>
88
- </div>
89
- ```
90
-
91
- Avoid hiding critical info inside a tooltip; use a dialog for destructive or required decisions.
92
-
93
- ```jsx
94
- <Tooltip
95
- variant="rich"
96
- title="Delete project"
97
- text="This action is permanent."
98
- buttons={[{ label: 'Learn more', variant: 'text' }]}
99
- >
100
- <Button label="Delete" />
101
- </Tooltip>
102
- ```
103
-
104
- ## Delays
105
-
106
- Use `openDelay` and `closeDelay` (ms) to tune the hover/focus behavior. Defaults: `openDelay={400}`, `closeDelay={150}`.
107
-
108
- ```jsx
109
- <Tooltip text="Slightly slower open" openDelay={600} closeDelay={100}>
110
- <Button label="Hover" />
111
- </Tooltip>
112
- ```
113
-
114
- ## Controlled open state
115
-
116
- Use `isOpen` with `onOpenChange` to fully control the visibility. Use `defaultOpen` for uncontrolled initial state.
117
-
118
- ```jsx
119
- function ControlledTooltip() {
120
- const [open, setOpen] = React.useState(false);
121
- return (
122
- <Tooltip text="Controlled" isOpen={open} onOpenChange={setOpen}>
123
- <Button label={open ? 'Hide' : 'Show'} onClick={() => setOpen(!open)} />
124
- </Tooltip>
125
- );
126
- }
127
- ```
128
-
129
- ## Position
130
-
131
- Provide an explicit `position` or let it auto-place based on target position.
132
-
133
- ```jsx
134
- <Tooltip text="Top left" variant="rich" position="top-left">
135
- <Button label="Positioned" />
136
- </Tooltip>
137
- ```
138
-
139
- ## Behavior
140
-
141
- On desktop, tooltips open on hover or focus. Use `trigger="click"` for persistent rich tooltips that stay open until another interaction.
142
-
143
- ```jsx
144
- <Tooltip variant="rich" text="Persistent tooltip" trigger="click">
145
- <Button label="Click to toggle" />
146
- </Tooltip>
147
- ```
148
-
149
- ## Keyboard
150
-
151
- | Keys | Actions |
152
- | --- | --- |
153
- | Tab | Focus lands on button, if available |
154
- | Space or Enter | Activates the focused element |
155
-
156
- ## Accessibility
157
-
158
- - The tooltip uses `role="tooltip"` and links to its trigger via `aria-describedby` when open.
159
- - Press `Escape` to close an open tooltip.
@@ -1,92 +0,0 @@
1
- ---
2
- title: MCP — Utiliser le package @udixio/mcp
3
- description: Guide pour installer, lancer et connecter le serveur MCP de la lib UI Udixio.
4
- ---
5
-
6
-
7
- # MCP — Utiliser le package `@udixio/mcp`
8
-
9
- Ce guide explique comment utiliser le serveur MCP pour exposer aux assistants IA (Claude Desktop, Cursor, MCP Inspector, etc.) les informations de la librairie UI :
10
-
11
- - Liste des composants du design system
12
- - Recherche dans la documentation (MD/MDX)
13
- - Tokens de thème (couleurs, espaces, etc.)
14
- - Accès à des fichiers de doc via une resource `doc://{path}`
15
-
16
- Le serveur MCP est publié sous le nom npm public `@udixio/mcp` et expose un binaire `udixio-mcp`.
17
-
18
-
19
- ## Prérequis
20
-
21
- - Node.js ≥ 18
22
-
23
- Le package `@udixio/mcp` est auto‑contenu: il embarque un instantané (docs, thème, index des composants) et fonctionne sans aucune configuration.
24
-
25
- ## Utilisation (zéro setup)
26
-
27
- ```bash
28
- # Installer le binaire globalement
29
- npm i -g @udixio/mcp
30
-
31
- # Lancer le serveur MCP (utilise les données embarquées)
32
- udixio-mcp
33
- ```
34
-
35
- Intégration côté client (ex. Claude Desktop):
36
-
37
- ```json
38
- {
39
- "mcpServers": {
40
- "udixio-ui": { "command": "udixio-mcp" }
41
- }
42
- }
43
- ```
44
-
45
-
46
- ## Outils MCP exposés (Tools)
47
-
48
- Le serveur enregistre plusieurs « tools » accessibles côté client MCP :
49
-
50
- - `listComponents` — retourne la liste des composants et leurs fichiers source relatifs (données embarquées).
51
- - `getComponentDoc` — prend `{ name: string }` et renvoie des chemins de doc/story correspondants (données embarquées).
52
- - `searchDocs` — prend `{ query: string, limit?: number }` et effectue une recherche plein texte dans la documentation embarquée.
53
- - `getThemeTokens` — renvoie l’objet de thème issu du snapshot embarqué.
54
-
55
- Exemple d’appel (depuis un client MCP) :
56
-
57
- ```json
58
- {
59
- "tool": "searchDocs",
60
- "input": { "query": "Button", "limit": 5 }
61
- }
62
- ```
63
-
64
-
65
- ## Resources MCP
66
-
67
- Une resource est enregistrée pour lire directement des fichiers de doc par chemin relatif à `apps/doc/src` :
68
-
69
- - Template: `doc://{path}`
70
- - Exemple: `doc://components/button.mdx`
71
-
72
-
73
- ## Intégration avec un client MCP (Claude Desktop)
74
-
75
- Ajoutez/éditez votre configuration utilisateur pour déclarer le serveur MCP. Exemple minimal :
76
-
77
- ```json
78
- {
79
- "mcpServers": {
80
- "udixio-ui": {
81
- "command": "udixio-mcp"
82
- }
83
- }
84
- }
85
- ```
86
-
87
- Ensuite, dans le client, demandez par exemple :
88
-
89
- - « Appelle `listComponents` »
90
- - « Recherche dans la doc: `searchDocs` avec query=`colors` »
91
- - « Donne-moi les tokens de thème via `getThemeTokens` »
92
- - « Ouvre la resource `doc://path/vers/un/fichier.mdx` »
@@ -1,87 +0,0 @@
1
- ---
2
- import '@/styles/global.css';
3
- import { getCollection, render } from 'astro:content';
4
- import { Button, Divider , Tabs, Tab} from '@udixio/ui-react';
5
- import { sentenceCase, kebabCase } from 'change-case';
6
- import { ComponentSidebar } from '@/components/ComponentSidebar';
7
- import { ComponentNavigation } from '@/components/ComponentNavigation';
8
- import { Navigation } from '@/components/Navigation';
9
- import { ClientRouter } from 'astro:transitions';
10
- import { DocSidebar } from '@/components/DocSidebar';
11
- import Layout from '@/layouts/layout.astro';
12
- import {Card, Icon}from "@udixio/ui-react";
13
- import { renderMarkdown } from '@/lib/markdown';
14
- import { faExclamation, faInfo, faInfoCircle, } from '@fortawesome/free-solid-svg-icons';
15
-
16
- const apis = await getCollection('api');
17
- const overviews = await getCollection('overviews');
18
-
19
- const pathName = Astro.url.pathname;
20
-
21
- const { component } = Astro.params;
22
-
23
- const componentApi = apis.find(api => api.id === component);
24
-
25
- if (!componentApi) {
26
- return Astro.redirect('/404', 404);
27
- }
28
-
29
- const limitation = componentApi.data.tags.limitations
30
-
31
- // Build robust, sanitized HTML from Markdown and style elements via classes
32
- const limitationHtml = typeof limitation === 'string' && limitation.trim().length > 0
33
- ? renderMarkdown(limitation, {
34
- classes: {
35
- // ul: 'list-disc pl-6',
36
- li: '!text-on-secondary-container',
37
- // p: 'mb-2',
38
- },
39
- })
40
- : '';
41
-
42
- const overviewIds = new Set(
43
- overviews.map((overview) => overview.id.replaceAll('overview', '')),
44
- );
45
-
46
- const components =apis .filter((api) => !api.data.tags?.parent) .filter((api) => overviewIds.has(api.id)).map(({ id }) => ({
47
- slug: id
48
- })).sort((a, b) => a.slug.localeCompare(b.slug))
49
- ---
50
- <Layout docSidebar>
51
- <Fragment slot="sidebar"> <!-- pass table header -->
52
- <ComponentSidebar client:load transition:name="component-sidebar" transition:persist
53
- current={pathName.startsWith('/components') ? pathName.split('/').filter(Boolean)[1] : null}
54
- components={components}
55
- />
56
- </Fragment>
57
- <div class="max-w-screen-xl mx-auto">
58
- <Card variant="filled" className="mt-8 bg-surface-container">
59
- <div class="p-8">
60
- <slot name="header" />
61
- </div>
62
- <ComponentNavigation client:load transition:name="component-navigation" transition:persist componentApi={componentApi}/>
63
- </Card>
64
- {limitation && (
65
- <Card
66
- className="my-12 theme-warning prose-markdown"
67
- role="note"
68
- aria-labelledby="limitations-title"
69
- >
70
- <div class="flex items-start gap-4 p-6 md:p-7">
71
- <div class="p-2 rounded-full bg-primary-container">
72
- <Icon icon={faExclamation} className="size-5 md:size-6 text-on-primary-container" />
73
- </div>
74
- <div>
75
- <h3 id="limitations-title" class="text-base md:text-lg font-medium mb-2 text-on-secondary-container ml-2 !mt-0">
76
- Known Limitations (Beta)
77
- </h3>
78
- <div class="text-sm leading-6 md:text-base md:leading-7 [&_ul]:list-disc [&_ul]:pl-5" set:html={limitationHtml}></div>
79
- </div>
80
- </div>
81
- </Card>
82
- )}
83
-
84
- <slot/>
85
- </div>
86
-
87
- </Layout>
@@ -1,55 +0,0 @@
1
- ---
2
- import '@/styles/global.css';
3
- import { getCollection, render } from 'astro:content';
4
- import { Button, Divider, SmoothScroll } from '@udixio/ui-react';
5
- import { sentenceCase, kebabCase } from 'change-case';
6
- import { ComponentSidebar } from '@/components/ComponentSidebar';
7
- import { Navigation } from '@/components/Navigation';
8
- import { ClientRouter } from 'astro:transitions';
9
- import { DocSidebar } from '@/components/DocSidebar';
10
- import { ThemeProvider } from '@/components/theme/ThemeProvider';
11
-
12
- const apis = await getCollection('api');
13
-
14
- const pathName = Astro.url.pathname;
15
-
16
-
17
- const {docSidebar} = Astro.props
18
- ---
19
-
20
- <html lang="en">
21
- <head>
22
- <meta charset="utf-8" />
23
- <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
24
- <meta name="viewport" content="width=device-width" />
25
- <title>Astro</title>
26
- <ClientRouter />
27
- </head>
28
- <body class="dark dynamic bg-surface text-on-surface" data-udx-color-keys="surface surface-dim surface-bright surface-container-lowest surface-container-low surface-container surface-container-high surface-container-highest on-surface on-surface-variant outline outline-variant inverse-surface inverse-on-surface primary primary-dim on-primary primary-container on-primary-container primary-fixed primary-fixed-dim on-primary-fixed on-primary-fixed-variant inverse-primary secondary secondary-dim on-secondary secondary-container on-secondary-container secondary-fixed secondary-fixed-dim on-secondary-fixed on-secondary-fixed-variant tertiary tertiary-dim on-tertiary tertiary-container on-tertiary-container tertiary-fixed tertiary-fixed-dim on-tertiary-fixed on-tertiary-fixed-variant error error-dim on-error error-container on-error-container surface-variant surface-tint background on-background success success-dim on-success success-container on-success-container success-fixed success-fixed-dim on-success-fixed on-success-fixed-variant">
29
- <SmoothScroll client:idle />
30
- <main class="mx-auto flex justify-between">
31
- <div class="flex sticky top-0 h-screen">
32
- <Navigation client:load transition:name="navigation" transition:persist/>
33
- <Divider orientation="vertical" />
34
- <slot name="sidebar" />
35
- </div>
36
- <div class=" flex flex-1 gap-8">
37
-
38
- <div class="flex-1">
39
-
40
- <slot />
41
-
42
- </div>
43
-
44
- </div>
45
- <div>
46
- {docSidebar && <DocSidebar client:load />}
47
- </div>
48
- </main>
49
- <script >
50
- import { initAnimateOnScroll as animateOnScroll } from '@udixio/ui-react';
51
- animateOnScroll({ once: false });
52
- </script>
53
- <ThemeProvider client:idle transition:name="theme-provider" transition:persist />
54
- </body>
55
- </html>
@@ -1,18 +0,0 @@
1
- ---
2
- import Layout from '@/layouts/layout.astro';
3
- import { Button } from '@udixio/ui-react';
4
- ---
5
- <Layout>
6
- <div class="flex items-center justify-center min-h-[70vh] px-8">
7
- <div class="text-center space-y-6">
8
- <h1 class="text-4xl font-extrabold tracking-tight">404 — Page introuvable</h1>
9
- <p class="text-base text-muted-foreground max-w-prose mx-auto">
10
- La page que vous recherchez n'existe pas ou a été déplacée.
11
- </p>
12
- <div class="flex items-center justify-center gap-3">
13
- <Button href="/">Retour à l’accueil</Button>
14
- <Button variant="outlined" href="/search">Rechercher dans la documentation</Button>
15
- </div>
16
- </div>
17
- </div>
18
- </Layout>
@@ -1,34 +0,0 @@
1
- ---
2
- import Layout from '@/layouts/layout.astro';
3
- import { getCollection, render } from 'astro:content';
4
- import Code from '@/components/Code.astro';
5
-
6
- export async function getStaticPaths() {
7
- const pages = await getCollection('pages');
8
-
9
- return pages.map((page )=>{
10
- let url = page.filePath!.replace(/\.(md|mdx)$/, '');
11
- url = url.replace(/\/index$/, '');
12
- url = url.replace('src/data/pages/', '/');
13
-
14
- return{
15
- params: { url: url },
16
- props: { page }
17
- }
18
- });
19
- }
20
-
21
- const { page } = Astro.props;
22
-
23
- const { Content, headings } = await render(page);
24
-
25
- ---
26
- <Layout>
27
- {/* Render the matched MD/MDX content component. Given getStaticPaths(), this should always be defined. */}
28
- <section class="px-8 py-10 max-w-screen-lg mx-auto">
29
- <div class="prose-markdown">
30
- <Content components={{ pre: Code }} />
31
- </div>
32
- </section>
33
-
34
- </Layout>