@metaphor-cloud/ui 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +420 -0
- package/dist/components/Accordion.d.ts +14 -0
- package/dist/components/Accordion.d.ts.map +1 -0
- package/dist/components/Alert.d.ts +14 -0
- package/dist/components/Alert.d.ts.map +1 -0
- package/dist/components/AlertDialog.d.ts +27 -0
- package/dist/components/AlertDialog.d.ts.map +1 -0
- package/dist/components/AnimatedCounter.d.ts +13 -0
- package/dist/components/AnimatedCounter.d.ts.map +1 -0
- package/dist/components/Badge.d.ts +9 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Breadcrumb.d.ts +31 -0
- package/dist/components/Breadcrumb.d.ts.map +1 -0
- package/dist/components/Button.d.ts +10 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Card.d.ts +21 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Checkbox.d.ts +7 -0
- package/dist/components/Checkbox.d.ts.map +1 -0
- package/dist/components/CodeBlock.d.ts +8 -0
- package/dist/components/CodeBlock.d.ts.map +1 -0
- package/dist/components/Combobox.d.ts +40 -0
- package/dist/components/Combobox.d.ts.map +1 -0
- package/dist/components/Dialog.d.ts +23 -0
- package/dist/components/Dialog.d.ts.map +1 -0
- package/dist/components/DropdownMenu.d.ts +36 -0
- package/dist/components/DropdownMenu.d.ts.map +1 -0
- package/dist/components/EmptyState.d.ts +11 -0
- package/dist/components/EmptyState.d.ts.map +1 -0
- package/dist/components/Input.d.ts +7 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/Label.d.ts +7 -0
- package/dist/components/Label.d.ts.map +1 -0
- package/dist/components/MetaHead.d.ts +43 -0
- package/dist/components/MetaHead.d.ts.map +1 -0
- package/dist/components/Nav.d.ts +59 -0
- package/dist/components/Nav.d.ts.map +1 -0
- package/dist/components/PageHeader.d.ts +10 -0
- package/dist/components/PageHeader.d.ts.map +1 -0
- package/dist/components/Pagination.d.ts +12 -0
- package/dist/components/Pagination.d.ts.map +1 -0
- package/dist/components/Popover.d.ts +9 -0
- package/dist/components/Popover.d.ts.map +1 -0
- package/dist/components/Progress.d.ts +7 -0
- package/dist/components/Progress.d.ts.map +1 -0
- package/dist/components/RadioGroup.d.ts +10 -0
- package/dist/components/RadioGroup.d.ts.map +1 -0
- package/dist/components/Select.d.ts +22 -0
- package/dist/components/Select.d.ts.map +1 -0
- package/dist/components/Separator.d.ts +7 -0
- package/dist/components/Separator.d.ts.map +1 -0
- package/dist/components/Sheet.d.ts +25 -0
- package/dist/components/Sheet.d.ts.map +1 -0
- package/dist/components/Sidebar.d.ts +36 -0
- package/dist/components/Sidebar.d.ts.map +1 -0
- package/dist/components/Skeleton.d.ts +6 -0
- package/dist/components/Skeleton.d.ts.map +1 -0
- package/dist/components/StatCard.d.ts +40 -0
- package/dist/components/StatCard.d.ts.map +1 -0
- package/dist/components/StructuredData.d.ts +91 -0
- package/dist/components/StructuredData.d.ts.map +1 -0
- package/dist/components/Switch.d.ts +7 -0
- package/dist/components/Switch.d.ts.map +1 -0
- package/dist/components/Table.d.ts +27 -0
- package/dist/components/Table.d.ts.map +1 -0
- package/dist/components/Tabs.d.ts +14 -0
- package/dist/components/Tabs.d.ts.map +1 -0
- package/dist/components/Textarea.d.ts +7 -0
- package/dist/components/Textarea.d.ts.map +1 -0
- package/dist/components/ThemeProvider.d.ts +17 -0
- package/dist/components/ThemeProvider.d.ts.map +1 -0
- package/dist/components/Toast.d.ts +27 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Toaster.d.ts +2 -0
- package/dist/components/Toaster.d.ts.map +1 -0
- package/dist/components/Toggle.d.ts +9 -0
- package/dist/components/Toggle.d.ts.map +1 -0
- package/dist/components/Tooltip.d.ts +10 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/hooks/use-alternate-links.d.ts +14 -0
- package/dist/hooks/use-alternate-links.d.ts.map +1 -0
- package/dist/hooks/use-canonical.d.ts +6 -0
- package/dist/hooks/use-canonical.d.ts.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-scroll-nav.d.ts +2 -0
- package/dist/hooks/use-scroll-nav.d.ts.map +1 -0
- package/dist/hooks/use-theme.d.ts +9 -0
- package/dist/hooks/use-theme.d.ts.map +1 -0
- package/dist/hooks/use-toast.d.ts +26 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/index.d.ts +84 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/og-image.d.ts +57 -0
- package/dist/lib/og-image.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/metaphor-ui.css +3 -0
- package/dist/metaphor-ui.js +10355 -0
- package/dist/themes/adapter-all.css +149 -0
- package/dist/themes/adapter.css +142 -0
- package/dist/themes/metaphor-all.css +116 -0
- package/dist/themes/metaphor.css +109 -0
- package/dist/themes/um-all.css +155 -0
- package/dist/themes/um.css +148 -0
- package/package.json +90 -0
- package/tailwind.preset.cjs +136 -0
- package/tailwind.preset.js +162 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Metaphor
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
# @metaphor-cloud/ui
|
|
2
|
+
|
|
3
|
+
Shared React component library for Metaphor projects. Themeable, accessible, built on Radix UI primitives.
|
|
4
|
+
|
|
5
|
+
Requires **React 19+** and **Tailwind CSS 4** (optional, for extending with the preset).
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @metaphor-cloud/ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import "@metaphor-cloud/ui/metaphor"; // theme + styles in one import
|
|
15
|
+
import { ThemeProvider, Button } from "@metaphor-cloud/ui";
|
|
16
|
+
|
|
17
|
+
function App() {
|
|
18
|
+
return (
|
|
19
|
+
<ThemeProvider>
|
|
20
|
+
<Button variant="primary">Click me</Button>
|
|
21
|
+
</ThemeProvider>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
That's it. `ThemeProvider` reads the theme's default mode automatically from the CSS (`--theme-default`), persists the user's choice to localStorage, and syncs across tabs.
|
|
27
|
+
|
|
28
|
+
## Themes
|
|
29
|
+
|
|
30
|
+
Two themes ship out of the box:
|
|
31
|
+
|
|
32
|
+
| Theme | Import | Default Mode | Accent | Fonts |
|
|
33
|
+
|-------|--------|--------------|--------|-------|
|
|
34
|
+
| Metaphor | `@metaphor-cloud/ui/metaphor` | Dark | Blue | Plus Jakarta Sans, Outfit, JetBrains Mono |
|
|
35
|
+
| Um | `@metaphor-cloud/ui/um` | Light | Ocean blue | Nunito, JetBrains Mono |
|
|
36
|
+
|
|
37
|
+
### Switching themes
|
|
38
|
+
|
|
39
|
+
Replace the CSS import — no other changes needed:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import "@metaphor-cloud/ui/um"; // swap to Um theme
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Dark / light mode
|
|
46
|
+
|
|
47
|
+
`ThemeProvider` handles mode switching. Use `useThemeContext()` anywhere inside the provider:
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { useThemeContext } from "@metaphor-cloud/ui";
|
|
51
|
+
|
|
52
|
+
function ThemeToggle() {
|
|
53
|
+
const { theme, resolved, cycleTheme, setTheme } = useThemeContext();
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<button onClick={cycleTheme}>
|
|
57
|
+
{resolved === "dark" ? "🌙" : "☀️"}
|
|
58
|
+
{theme === "system" && " (auto)"}
|
|
59
|
+
</button>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Modes cycle: **dark → light → system → dark**. The `system` mode follows the OS preference.
|
|
65
|
+
|
|
66
|
+
### Creating a custom theme
|
|
67
|
+
|
|
68
|
+
Copy `src/themes/metaphor.css` and override the CSS variables:
|
|
69
|
+
|
|
70
|
+
```css
|
|
71
|
+
:root,
|
|
72
|
+
[data-theme="dark"] {
|
|
73
|
+
--theme-default: dark;
|
|
74
|
+
--accent: #your-color;
|
|
75
|
+
--bg: #your-bg;
|
|
76
|
+
/* ... */
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-theme="light"] {
|
|
80
|
+
--accent: #your-light-color;
|
|
81
|
+
--bg: #your-light-bg;
|
|
82
|
+
/* ... */
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Tailwind CSS Preset
|
|
87
|
+
|
|
88
|
+
If your app uses Tailwind CSS 4, extend from the preset to get all the theme-aware utility classes (colors, fonts, animations, border radii):
|
|
89
|
+
|
|
90
|
+
```css
|
|
91
|
+
/* your app's main CSS */
|
|
92
|
+
@import "tailwindcss";
|
|
93
|
+
@import "@metaphor-cloud/ui/metaphor";
|
|
94
|
+
|
|
95
|
+
@config "./tailwind.config.ts";
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
// tailwind.config.ts
|
|
100
|
+
import preset from "@metaphor-cloud/ui/tailwind-preset";
|
|
101
|
+
import type { Config } from "tailwindcss";
|
|
102
|
+
|
|
103
|
+
export default {
|
|
104
|
+
presets: [preset],
|
|
105
|
+
content: ["./src/**/*.{ts,tsx}"],
|
|
106
|
+
} satisfies Config;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The preset gives you:
|
|
110
|
+
|
|
111
|
+
- **Colors**: `bg-bg-elevated`, `text-accent`, `border-border`, `text-success`, etc. — all CSS variable-backed, all theme-reactive
|
|
112
|
+
- **Fonts**: `font-sans`, `font-display`, `font-mono`
|
|
113
|
+
- **Animations**: `animate-fade-in`, `animate-fade-up`, `animate-accordion-down`, etc.
|
|
114
|
+
- **Spacing**: `section-gap`
|
|
115
|
+
- **Border radius**: `rounded` / `rounded-lg` / `rounded-sm` — derived from the theme's `--radius` variable
|
|
116
|
+
|
|
117
|
+
If your app uses `data-theme` for dark mode (like this library does), add this to your CSS:
|
|
118
|
+
|
|
119
|
+
```css
|
|
120
|
+
@custom-variant dark (&:where([data-theme="dark"]), &:where([data-theme="dark"] *));
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Components
|
|
124
|
+
|
|
125
|
+
All components accept `ref` as a regular prop (React 19), support `className` for overrides via Tailwind, and are fully typed.
|
|
126
|
+
|
|
127
|
+
### Layout
|
|
128
|
+
|
|
129
|
+
| Component | Parts | Usage |
|
|
130
|
+
|-----------|-------|-------|
|
|
131
|
+
| `Card` | `CardHeader`, `CardTitle`, `CardDescription`, `CardContent`, `CardFooter` | Content container |
|
|
132
|
+
| `Separator` | — | Horizontal or vertical divider |
|
|
133
|
+
| `Table` | `TableHeader`, `TableBody`, `TableFooter`, `TableRow`, `TableHead`, `TableCell`, `TableCaption` | Data table |
|
|
134
|
+
| `Skeleton` | — | Loading placeholder |
|
|
135
|
+
|
|
136
|
+
### Forms
|
|
137
|
+
|
|
138
|
+
| Component | Usage |
|
|
139
|
+
|-----------|-------|
|
|
140
|
+
| `Button` | `variant`: primary, secondary, danger, ghost, link. `size`: sm, md, lg, icon. Supports `asChild` for custom elements. |
|
|
141
|
+
| `Input` | Text input |
|
|
142
|
+
| `Textarea` | Multi-line input |
|
|
143
|
+
| `Label` | Form label |
|
|
144
|
+
| `Select` | `SelectTrigger`, `SelectContent`, `SelectItem`, `SelectGroup`, `SelectValue`, `SelectLabel`, `SelectSeparator` |
|
|
145
|
+
| `Checkbox` | Checkable input |
|
|
146
|
+
| `Switch` | Toggle switch |
|
|
147
|
+
|
|
148
|
+
### Feedback
|
|
149
|
+
|
|
150
|
+
| Component | Usage |
|
|
151
|
+
|-----------|-------|
|
|
152
|
+
| `Alert` | `variant`: default, info, success, danger, warning. With `AlertTitle`, `AlertDescription`. |
|
|
153
|
+
| `Badge` | `variant`: default, success, danger, warning, outline |
|
|
154
|
+
| `Progress` | Progress bar with value/max |
|
|
155
|
+
| `Toast` | See [Toast notifications](#toast-notifications) below |
|
|
156
|
+
|
|
157
|
+
### Overlays
|
|
158
|
+
|
|
159
|
+
| Component | Parts | Usage |
|
|
160
|
+
|-----------|-------|-------|
|
|
161
|
+
| `Dialog` | `DialogTrigger`, `DialogContent`, `DialogHeader`, `DialogFooter`, `DialogTitle`, `DialogDescription`, `DialogClose` | Modal dialog. `DialogContent` accepts `hideCloseButton`. |
|
|
162
|
+
| `AlertDialog` | `AlertDialogTrigger`, `AlertDialogContent`, `AlertDialogHeader`, `AlertDialogFooter`, `AlertDialogTitle`, `AlertDialogDescription`, `AlertDialogAction`, `AlertDialogCancel` | Confirmation dialog |
|
|
163
|
+
| `DropdownMenu` | `DropdownMenuTrigger`, `DropdownMenuContent`, `DropdownMenuItem`, `DropdownMenuLabel`, `DropdownMenuSeparator`, `DropdownMenuCheckboxItem`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSub`, `DropdownMenuSubTrigger`, `DropdownMenuSubContent` | Context/action menu |
|
|
164
|
+
| `Tooltip` | `TooltipProvider`, `TooltipTrigger`, `TooltipContent` | Hover tooltip |
|
|
165
|
+
| `Popover` | `PopoverTrigger`, `PopoverContent` | Click popover |
|
|
166
|
+
|
|
167
|
+
### Navigation
|
|
168
|
+
|
|
169
|
+
| Component | Parts | Usage |
|
|
170
|
+
|-----------|-------|-------|
|
|
171
|
+
| `Nav` | — | Responsive navbar with theme toggle, dropdowns, mobile drawer |
|
|
172
|
+
| `Breadcrumb` | — | Semantic breadcrumb nav with automatic BreadcrumbList JSON-LD |
|
|
173
|
+
|
|
174
|
+
### SEO & Social
|
|
175
|
+
|
|
176
|
+
| Component | Usage |
|
|
177
|
+
|-----------|-------|
|
|
178
|
+
| `MetaHead` | Declarative `<head>` management — title, description, Open Graph, Twitter Cards, canonical URL, robots |
|
|
179
|
+
| `StructuredData` | Injects JSON-LD `<script>` tags — typed props for Organization, Article, Product, BreadcrumbList, FAQPage, WebSite |
|
|
180
|
+
|
|
181
|
+
### Other
|
|
182
|
+
|
|
183
|
+
| Component | Usage |
|
|
184
|
+
|-----------|-------|
|
|
185
|
+
| `Accordion` | `AccordionItem`, `AccordionTrigger`, `AccordionContent` — collapsible sections |
|
|
186
|
+
| `Tabs` | `TabsList`, `TabsTrigger`, `TabsContent` — tabbed navigation |
|
|
187
|
+
| `CodeBlock` | `inline` prop for inline code, block by default |
|
|
188
|
+
|
|
189
|
+
## Toast Notifications
|
|
190
|
+
|
|
191
|
+
Add `<Toaster />` once in your layout, then call `toast()` from anywhere:
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
import { Toaster, toast } from "@metaphor-cloud/ui";
|
|
195
|
+
|
|
196
|
+
// In your root layout
|
|
197
|
+
function Layout({ children }) {
|
|
198
|
+
return (
|
|
199
|
+
<>
|
|
200
|
+
{children}
|
|
201
|
+
<Toaster />
|
|
202
|
+
</>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Anywhere in your app
|
|
207
|
+
function SaveButton() {
|
|
208
|
+
const handleSave = async () => {
|
|
209
|
+
await save();
|
|
210
|
+
toast({
|
|
211
|
+
title: "Saved",
|
|
212
|
+
description: "Your changes have been saved.",
|
|
213
|
+
variant: "success", // "default" | "success" | "danger" | "warning"
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
return <Button onClick={handleSave}>Save</Button>;
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
`toast()` returns `{ id, dismiss, update }` for programmatic control. Up to 5 toasts show at once, auto-dismissing after 5 seconds (customisable via `duration`).
|
|
222
|
+
|
|
223
|
+
## SEO & Social Previews
|
|
224
|
+
|
|
225
|
+
### `<MetaHead>`
|
|
226
|
+
|
|
227
|
+
Manages `<title>`, meta description, Open Graph, Twitter Cards, canonical URL, and robots directives. All tags are automatically cleaned up on unmount or when props change.
|
|
228
|
+
|
|
229
|
+
```tsx
|
|
230
|
+
import { MetaHead } from "@metaphor-cloud/ui";
|
|
231
|
+
|
|
232
|
+
<MetaHead
|
|
233
|
+
title="My Page"
|
|
234
|
+
titleTemplate="%s | My Site"
|
|
235
|
+
description="A short description for search results and social previews."
|
|
236
|
+
url="https://example.com/page"
|
|
237
|
+
image="https://example.com/og.png"
|
|
238
|
+
imageAlt="Preview of My Page"
|
|
239
|
+
imageWidth={1200}
|
|
240
|
+
imageHeight={630}
|
|
241
|
+
siteName="My Site"
|
|
242
|
+
twitterCard="summary_large_image"
|
|
243
|
+
twitterSite="@mysite"
|
|
244
|
+
/>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Props: `title`, `titleTemplate`, `description`, `url`, `image`, `imageAlt`, `imageWidth`, `imageHeight`, `type` (default `"website"`), `siteName`, `locale`, `twitterCard`, `twitterSite`, `twitterCreator`, `noindex`, `nofollow`.
|
|
248
|
+
|
|
249
|
+
### `<StructuredData>`
|
|
250
|
+
|
|
251
|
+
Injects a `<script type="application/ld+json">` tag into the document head. Typed props for common schema.org types.
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
import { StructuredData } from "@metaphor-cloud/ui";
|
|
255
|
+
|
|
256
|
+
// Organization
|
|
257
|
+
<StructuredData
|
|
258
|
+
data={{
|
|
259
|
+
"@type": "Organization",
|
|
260
|
+
name: "Acme Corp",
|
|
261
|
+
url: "https://acme.com",
|
|
262
|
+
logo: "https://acme.com/logo.png",
|
|
263
|
+
sameAs: ["https://twitter.com/acme", "https://linkedin.com/company/acme"],
|
|
264
|
+
}}
|
|
265
|
+
/>
|
|
266
|
+
|
|
267
|
+
// FAQ page
|
|
268
|
+
<StructuredData
|
|
269
|
+
data={{
|
|
270
|
+
"@type": "FAQPage",
|
|
271
|
+
mainEntity: [
|
|
272
|
+
{
|
|
273
|
+
"@type": "Question",
|
|
274
|
+
name: "What is Acme?",
|
|
275
|
+
acceptedAnswer: { "@type": "Answer", text: "Acme builds widgets." },
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
}}
|
|
279
|
+
/>
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### `<Breadcrumb>`
|
|
283
|
+
|
|
284
|
+
Semantic breadcrumb navigation that automatically emits BreadcrumbList JSON-LD structured data.
|
|
285
|
+
|
|
286
|
+
```tsx
|
|
287
|
+
import { Breadcrumb } from "@metaphor-cloud/ui";
|
|
288
|
+
|
|
289
|
+
<Breadcrumb
|
|
290
|
+
items={[
|
|
291
|
+
{ label: "Home", href: "/" },
|
|
292
|
+
{ label: "Blog", href: "/blog" },
|
|
293
|
+
{ label: "My Post" },
|
|
294
|
+
]}
|
|
295
|
+
/>
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Supports `renderLink` for framework routers (Next.js, React Router, etc.), a custom `separator`, and `structuredData={false}` to disable JSON-LD output.
|
|
299
|
+
|
|
300
|
+
```tsx
|
|
301
|
+
<Breadcrumb
|
|
302
|
+
items={items}
|
|
303
|
+
separator="/"
|
|
304
|
+
renderLink={({ href, children, className }) => (
|
|
305
|
+
<Link to={href} className={className}>{children}</Link>
|
|
306
|
+
)}
|
|
307
|
+
/>
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### `createOgImageUrl`
|
|
311
|
+
|
|
312
|
+
Factory for building Open Graph image URLs. Works with any OG image service (Vercel OG, custom endpoints, etc.).
|
|
313
|
+
|
|
314
|
+
```tsx
|
|
315
|
+
import { createOgImageUrl } from "@metaphor-cloud/ui";
|
|
316
|
+
|
|
317
|
+
const ogImage = createOgImageUrl({
|
|
318
|
+
baseUrl: "https://og.mysite.com/api/image",
|
|
319
|
+
defaults: { siteName: "My Site", theme: "dark" },
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
// Returns: "https://og.mysite.com/api/image?title=Hello+World&siteName=My+Site&theme=dark"
|
|
323
|
+
ogImage({ title: "Hello World" });
|
|
324
|
+
|
|
325
|
+
// Use with MetaHead
|
|
326
|
+
<MetaHead
|
|
327
|
+
title="Hello World"
|
|
328
|
+
image={ogImage({ title: "Hello World" })}
|
|
329
|
+
imageWidth={1200}
|
|
330
|
+
imageHeight={630}
|
|
331
|
+
/>
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
For custom URL formats, pass a `buildUrl` function:
|
|
335
|
+
|
|
336
|
+
```tsx
|
|
337
|
+
const ogImage = createOgImageUrl({
|
|
338
|
+
baseUrl: "https://og.mysite.com",
|
|
339
|
+
buildUrl: (base, params) => `${base}/${encodeURIComponent(params.title)}.png`,
|
|
340
|
+
});
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
## Hooks
|
|
344
|
+
|
|
345
|
+
### `useThemeContext()`
|
|
346
|
+
|
|
347
|
+
Access theme state from inside `ThemeProvider`. Returns `{ theme, resolved, setTheme, cycleTheme }`.
|
|
348
|
+
|
|
349
|
+
### `useTheme(defaultTheme?)`
|
|
350
|
+
|
|
351
|
+
Standalone theme hook (used internally by `ThemeProvider`). Use directly if you need theme management without the context provider.
|
|
352
|
+
|
|
353
|
+
### `useMobile(breakpoint?)`
|
|
354
|
+
|
|
355
|
+
Returns `true` when the viewport is at or below the breakpoint (default 768px).
|
|
356
|
+
|
|
357
|
+
```tsx
|
|
358
|
+
import { useMobile } from "@metaphor-cloud/ui";
|
|
359
|
+
|
|
360
|
+
const isMobile = useMobile(); // default: 768px
|
|
361
|
+
const isTablet = useMobile(1024); // custom breakpoint
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### `useCanonical(url)`
|
|
365
|
+
|
|
366
|
+
Manages a `<link rel="canonical">` tag in the document head. Cleans up on unmount.
|
|
367
|
+
|
|
368
|
+
```tsx
|
|
369
|
+
import { useCanonical } from "@metaphor-cloud/ui";
|
|
370
|
+
|
|
371
|
+
useCanonical("https://example.com/page");
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### `useAlternateLinks(links)`
|
|
375
|
+
|
|
376
|
+
Manages `<link rel="alternate" hreflang="…">` tags for multi-language sites.
|
|
377
|
+
|
|
378
|
+
```tsx
|
|
379
|
+
import { useAlternateLinks } from "@metaphor-cloud/ui";
|
|
380
|
+
|
|
381
|
+
useAlternateLinks([
|
|
382
|
+
{ hreflang: "en", href: "https://example.com/en/page" },
|
|
383
|
+
{ hreflang: "fr", href: "https://example.com/fr/page" },
|
|
384
|
+
{ hreflang: "x-default", href: "https://example.com/page" },
|
|
385
|
+
]);
|
|
386
|
+
|
|
387
|
+
## CSS Imports
|
|
388
|
+
|
|
389
|
+
| Import | Contents |
|
|
390
|
+
|--------|----------|
|
|
391
|
+
| `@metaphor-cloud/ui/metaphor` | Metaphor theme variables + base styles + utilities (all-in-one) |
|
|
392
|
+
| `@metaphor-cloud/ui/um` | Um theme variables + base styles + utilities (all-in-one) |
|
|
393
|
+
| `@metaphor-cloud/ui/style.css` | Base styles + utilities only (no theme variables) |
|
|
394
|
+
| `@metaphor-cloud/ui/themes/metaphor.css` | Metaphor theme variables only |
|
|
395
|
+
| `@metaphor-cloud/ui/themes/um.css` | Um theme variables only |
|
|
396
|
+
|
|
397
|
+
Use the all-in-one imports for simplicity. Use the split imports if you need to load theme variables separately (e.g. for dynamic theme switching at the CSS level).
|
|
398
|
+
|
|
399
|
+
## TypeScript
|
|
400
|
+
|
|
401
|
+
All components and hooks are fully typed. The library re-exports Radix primitive prop types for convenience:
|
|
402
|
+
|
|
403
|
+
```tsx
|
|
404
|
+
import type {
|
|
405
|
+
ButtonProps,
|
|
406
|
+
BadgeProps,
|
|
407
|
+
InputProps,
|
|
408
|
+
DialogProps,
|
|
409
|
+
SelectProps,
|
|
410
|
+
// ... etc
|
|
411
|
+
} from "@metaphor-cloud/ui";
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
## Development
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
npm install
|
|
418
|
+
npm run build # tsc + vite build
|
|
419
|
+
npm run dev # vite dev server
|
|
420
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
declare const Accordion: any;
|
|
4
|
+
declare function AccordionItem({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> & {
|
|
5
|
+
ref?: React.Ref<React.ElementRef<typeof AccordionPrimitive.Item>>;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function AccordionTrigger({ className, children, ref, ...props }: React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger> & {
|
|
8
|
+
ref?: React.Ref<React.ElementRef<typeof AccordionPrimitive.Trigger>>;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function AccordionContent({ className, children, ref, ...props }: React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content> & {
|
|
11
|
+
ref?: React.Ref<React.ElementRef<typeof AccordionPrimitive.Content>>;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
14
|
+
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAGhE,QAAA,MAAM,SAAS,KAA0B,CAAC;AAE1C,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,GAAG;IAClE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;CACnE,2CAQA;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,GAAG;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;CACtE,2CAgCA;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,GAAG;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;CACtE,2CAUA;AAED,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const alertVariants: any;
|
|
4
|
+
declare function Alert({ className, variant, ref, ...props }: React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants> & {
|
|
5
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function AlertTitle({ className, ref, ...props }: React.HTMLAttributes<HTMLHeadingElement> & {
|
|
8
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function AlertDescription({ className, ref, ...props }: React.HTMLAttributes<HTMLParagraphElement> & {
|
|
11
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Alert, AlertTitle, AlertDescription, alertVariants };
|
|
14
|
+
//# sourceMappingURL=Alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,aAAa,KAgBlB,CAAC;AAEF,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAO,EACP,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GACrC,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IACnC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC,2CAUF;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,GAAG;IAC5C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;CACvC,2CAQA;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,GAAG;IAC9C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;CACvC,2CAQA;AAED,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
|
+
declare const AlertDialog: any;
|
|
4
|
+
declare const AlertDialogTrigger: any;
|
|
5
|
+
declare const AlertDialogPortal: any;
|
|
6
|
+
declare function AlertDialogOverlay({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay> & {
|
|
7
|
+
ref?: React.Ref<React.ElementRef<typeof AlertDialogPrimitive.Overlay>>;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function AlertDialogContent({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> & {
|
|
10
|
+
ref?: React.Ref<React.ElementRef<typeof AlertDialogPrimitive.Content>>;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const AlertDialogHeader: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const AlertDialogFooter: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function AlertDialogTitle({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title> & {
|
|
15
|
+
ref?: React.Ref<React.ElementRef<typeof AlertDialogPrimitive.Title>>;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function AlertDialogDescription({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description> & {
|
|
18
|
+
ref?: React.Ref<React.ElementRef<typeof AlertDialogPrimitive.Description>>;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function AlertDialogAction({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action> & {
|
|
21
|
+
ref?: React.Ref<React.ElementRef<typeof AlertDialogPrimitive.Action>>;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function AlertDialogCancel({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel> & {
|
|
24
|
+
ref?: React.Ref<React.ElementRef<typeof AlertDialogPrimitive.Cancel>>;
|
|
25
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
27
|
+
//# sourceMappingURL=AlertDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["AlertDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAIrE,QAAA,MAAM,WAAW,KAA4B,CAAC;AAC9C,QAAA,MAAM,kBAAkB,KAA+B,CAAC;AACxD,QAAA,MAAM,iBAAiB,KAA8B,CAAC;AAEtD,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,GAAG;IACvE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;CACxE,2CAWA;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,GAAG;IACvE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;CACxE,2CAgBA;AAED,QAAA,MAAM,iBAAiB,4BAGpB,MAAM,cAAc,CAAC,cAAc,CAAC,4CAKtC,CAAC;AAEF,QAAA,MAAM,iBAAiB,4BAGpB,MAAM,cAAc,CAAC,cAAc,CAAC,4CAQtC,CAAC;AAEF,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,GAAG;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;CACtE,2CAQA;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,WAAW,CAAC,GAAG;IAC3E,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC;CAC5E,2CAQA;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,GAAG;IACtE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;CACvE,2CAQA;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,GAAG;IACtE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;CACvE,2CAQA;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GAClB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface AnimatedCounterProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
3
|
+
/** The target numeric value to animate to. */
|
|
4
|
+
value: number;
|
|
5
|
+
/** Animation duration in milliseconds. @default 600 */
|
|
6
|
+
duration?: number;
|
|
7
|
+
/** Custom number formatter. @default (n) => Math.round(n).toLocaleString() */
|
|
8
|
+
formatter?: (value: number) => string;
|
|
9
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
10
|
+
}
|
|
11
|
+
declare function AnimatedCounter({ value, duration, formatter, className, ref, ...props }: AnimatedCounterProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { AnimatedCounter };
|
|
13
|
+
//# sourceMappingURL=AnimatedCounter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimatedCounter.d.ts","sourceRoot":"","sources":["AnimatedCounter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IAC/D,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAClC;AAED,iBAAS,eAAe,CAAC,EACvB,KAAK,EACL,QAAc,EACd,SAAiD,EACjD,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,oBAAoB,2CA+CtB;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: any;
|
|
4
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
5
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
6
|
+
}
|
|
7
|
+
declare function Badge({ className, variant, ref, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { Badge, badgeVariants };
|
|
9
|
+
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,aAAa,KAgBlB,CAAC;AAEF,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAQ/D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface BreadcrumbItem {
|
|
3
|
+
/** Display label */
|
|
4
|
+
label: string;
|
|
5
|
+
/** URL for this crumb — omit for the current (last) page */
|
|
6
|
+
href?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface BreadcrumbLinkRenderProps {
|
|
9
|
+
href: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
|
|
14
|
+
/** Ordered list of breadcrumb items (first = root, last = current page) */
|
|
15
|
+
items: BreadcrumbItem[];
|
|
16
|
+
/** Separator between items — defaults to "/" */
|
|
17
|
+
separator?: React.ReactNode;
|
|
18
|
+
/** Custom link renderer for framework routers (Next.js Link, React Router, etc.) */
|
|
19
|
+
renderLink?: (props: BreadcrumbLinkRenderProps) => React.ReactNode;
|
|
20
|
+
/** Emit BreadcrumbList JSON-LD structured data — defaults to true */
|
|
21
|
+
structuredData?: boolean;
|
|
22
|
+
ref?: React.Ref<HTMLElement>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Semantic breadcrumb navigation with optional JSON-LD structured data.
|
|
26
|
+
*
|
|
27
|
+
* Uses `<nav>` with `aria-label="Breadcrumb"` and an `<ol>` for proper
|
|
28
|
+
* accessibility. The last item is marked with `aria-current="page"`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function Breadcrumb({ items, separator, renderLink, structuredData, className, ref, ...props }: BreadcrumbProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=Breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["Breadcrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,WAAW,cAAc;IAC7B,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACxE,2EAA2E;IAC3E,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,gDAAgD;IAChD,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,oFAAoF;IACpF,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,KAAK,CAAC,SAAS,CAAC;IACnE,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B;AA+CD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,UAA8B,EAC9B,cAAqB,EACrB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,2CA6DjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: any;
|
|
4
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
7
|
+
}
|
|
8
|
+
declare function Button({ className, variant, size, asChild, ref, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Button, buttonVariants };
|
|
10
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,cAAc,KAiCnB,CAAC;AAEF,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAe,EACf,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,2CASb;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Card({ className, ref, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function CardHeader({ className, ref, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function CardTitle({ className, ref, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
9
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function CardDescription({ className, ref, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
12
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function CardContent({ className, ref, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
15
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function CardFooter({ className, ref, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
18
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter };
|
|
21
|
+
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,iBAAS,IAAI,CAAC,EACZ,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC,2CAWA;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC,2CAQA;AAED,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC,2CAQA;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC,2CAQA;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC,2CAEA;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC,2CAQA;AAED,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
declare function Checkbox({ className, ref, ...props }: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> & {
|
|
4
|
+
ref?: React.Ref<React.ElementRef<typeof CheckboxPrimitive.Root>>;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { Checkbox };
|
|
7
|
+
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAG9D,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,GAAG;IACjE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;CAClE,2CA+BA;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface CodeBlockProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
inline?: boolean;
|
|
4
|
+
ref?: React.Ref<HTMLElement>;
|
|
5
|
+
}
|
|
6
|
+
declare function CodeBlock({ className, inline, children, ref, ...props }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { CodeBlock };
|
|
8
|
+
//# sourceMappingURL=CodeBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["CodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,2CA4BhF;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|