@nuvia/components 1.0.0 → 1.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/README.md +103 -58
- package/dist/index.cjs +19 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -8
- package/dist/index.js.map +1 -1
- package/dist/ui/alert.d.cts +1 -1
- package/dist/ui/alert.d.ts +1 -1
- package/dist/ui/command.d.cts +7 -7
- package/dist/ui/command.d.ts +7 -7
- package/dist/ui/input-otp.d.cts +2 -2
- package/dist/ui/input-otp.d.ts +2 -2
- package/dist/ui/resizable.d.cts +1 -1
- package/dist/ui/resizable.d.ts +1 -1
- package/dist/ui/table.cjs +19 -8
- package/dist/ui/table.cjs.map +1 -1
- package/dist/ui/table.d.cts +1 -1
- package/dist/ui/table.d.ts +1 -1
- package/dist/ui/table.js +19 -8
- package/dist/ui/table.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @nuvia/components
|
|
2
2
|
|
|
3
|
-
React UI components for Nuvia applications, built with Radix UI primitives and Tailwind CSS.
|
|
3
|
+
React UI components for Nuvia applications, built with Radix UI primitives and Tailwind CSS v4.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,28 +10,82 @@ pnpm add @nuvia/components @nuvia/tailwind-config
|
|
|
10
10
|
|
|
11
11
|
## Setup
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
### Vite Projects
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add -D @tailwindcss/vite
|
|
17
|
+
```
|
|
14
18
|
|
|
15
19
|
```typescript
|
|
16
|
-
|
|
20
|
+
// vite.config.ts
|
|
21
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
22
|
+
import react from "@vitejs/plugin-react";
|
|
23
|
+
import { defineConfig } from "vite";
|
|
24
|
+
|
|
25
|
+
export default defineConfig({
|
|
26
|
+
plugins: [react(), tailwindcss()],
|
|
27
|
+
});
|
|
17
28
|
```
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
### Next.js / Other Projects
|
|
20
31
|
|
|
21
|
-
```
|
|
22
|
-
|
|
32
|
+
```bash
|
|
33
|
+
pnpm add -D @tailwindcss/postcss
|
|
23
34
|
```
|
|
24
35
|
|
|
25
|
-
|
|
36
|
+
```javascript
|
|
37
|
+
// postcss.config.mjs
|
|
38
|
+
/** @type {import('postcss-load-config').Config} */
|
|
39
|
+
const config = {
|
|
40
|
+
plugins: {
|
|
41
|
+
"@tailwindcss/postcss": {},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default config;
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Tailwind Config (All Projects)
|
|
26
49
|
|
|
27
50
|
```typescript
|
|
28
|
-
|
|
51
|
+
// tailwind.config.ts
|
|
52
|
+
import { config } from "@nuvia/tailwind-config";
|
|
53
|
+
import type { Config } from "tailwindcss";
|
|
54
|
+
|
|
55
|
+
export default {
|
|
56
|
+
...config,
|
|
57
|
+
content: [
|
|
58
|
+
"./src/**/*.{ts,tsx}", // or "./app/**/*.{ts,tsx}" for Next.js
|
|
59
|
+
"./node_modules/@nuvia/components/**/*.{js,ts,jsx,tsx}",
|
|
60
|
+
],
|
|
61
|
+
} satisfies Config;
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### CSS Entry Point (All Projects)
|
|
65
|
+
|
|
66
|
+
```css
|
|
67
|
+
/* globals.css or index.css */
|
|
68
|
+
@import "tailwindcss";
|
|
69
|
+
@import "@nuvia/components/styles/globals.css";
|
|
70
|
+
|
|
71
|
+
@config "./tailwind.config.ts";
|
|
72
|
+
```
|
|
29
73
|
|
|
30
|
-
|
|
74
|
+
> **Important:** `@import` must come before `@config` in Tailwind v4.
|
|
75
|
+
|
|
76
|
+
### Add Providers
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import { ThemeProvider } from "@nuvia/components/providers/theme";
|
|
80
|
+
import { TooltipProvider } from "@nuvia/components/ui/tooltip";
|
|
81
|
+
import { Toaster } from "@nuvia/components/ui/sonner";
|
|
82
|
+
|
|
83
|
+
export function Providers({ children }: { children: React.ReactNode }) {
|
|
31
84
|
return (
|
|
32
|
-
<ThemeProvider>
|
|
85
|
+
<ThemeProvider defaultTheme="system" storageKey="app-theme">
|
|
33
86
|
<TooltipProvider>
|
|
34
87
|
{children}
|
|
88
|
+
<Toaster />
|
|
35
89
|
</TooltipProvider>
|
|
36
90
|
</ThemeProvider>
|
|
37
91
|
);
|
|
@@ -40,57 +94,48 @@ export function App({ children }) {
|
|
|
40
94
|
|
|
41
95
|
## Usage
|
|
42
96
|
|
|
43
|
-
```
|
|
97
|
+
```tsx
|
|
98
|
+
// Import from main entry
|
|
44
99
|
import { Button, Card, Dialog } from "@nuvia/components";
|
|
45
|
-
|
|
100
|
+
|
|
101
|
+
// Or import from specific paths (better tree-shaking)
|
|
46
102
|
import { Button } from "@nuvia/components/ui/button";
|
|
103
|
+
import { Card } from "@nuvia/components/ui/card";
|
|
47
104
|
```
|
|
48
105
|
|
|
106
|
+
## What's Included
|
|
107
|
+
|
|
108
|
+
When you import `@nuvia/components/styles/globals.css`, you get:
|
|
109
|
+
|
|
110
|
+
- **Tailwind v4 theme registration** — All design tokens as utility classes (`bg-muted`, `text-primary`, etc.)
|
|
111
|
+
- **CSS variables** — Full color palette with light/dark theme support
|
|
112
|
+
- **Dark mode** — Automatic via `@custom-variant dark`
|
|
113
|
+
- **Base styles** — Body defaults, border colors, font family
|
|
114
|
+
- **Utility classes** — `.flex-center`, gradients, typography tokens
|
|
115
|
+
|
|
49
116
|
## Components
|
|
50
117
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
- Navigation Menu
|
|
76
|
-
- Pagination
|
|
77
|
-
- Popover
|
|
78
|
-
- Progress
|
|
79
|
-
- Radio Group
|
|
80
|
-
- Resizable
|
|
81
|
-
- Scroll Area
|
|
82
|
-
- Select
|
|
83
|
-
- Separator
|
|
84
|
-
- Sheet
|
|
85
|
-
- Sidebar
|
|
86
|
-
- Skeleton
|
|
87
|
-
- Slider
|
|
88
|
-
- Sonner (Toast)
|
|
89
|
-
- Spinner
|
|
90
|
-
- Switch
|
|
91
|
-
- Table
|
|
92
|
-
- Tabs
|
|
93
|
-
- Textarea
|
|
94
|
-
- Toast / Toaster
|
|
95
|
-
- Toggle / Toggle Group
|
|
96
|
-
- Tooltip
|
|
118
|
+
| Category | Components |
|
|
119
|
+
|----------|------------|
|
|
120
|
+
| **Layout** | Card, Separator, Resizable, Scroll Area, Aspect Ratio |
|
|
121
|
+
| **Navigation** | Breadcrumb, Navigation Menu, Pagination, Sidebar, Tabs |
|
|
122
|
+
| **Forms** | Button, Checkbox, Input, Radio Group, Select, Slider, Switch, Textarea, Form, Combobox |
|
|
123
|
+
| **Feedback** | Alert, Progress, Skeleton, Spinner, Toast/Sonner |
|
|
124
|
+
| **Overlay** | Dialog, Drawer, Sheet, Popover, Tooltip, Hover Card, Alert Dialog |
|
|
125
|
+
| **Data Display** | Avatar, Badge, Chip, Table, Calendar, Chart, Carousel |
|
|
126
|
+
| **Menu** | Dropdown Menu, Context Menu, Menubar, Command |
|
|
127
|
+
| **Other** | Accordion, Collapsible, Toggle, Logo |
|
|
128
|
+
|
|
129
|
+
## Theming
|
|
130
|
+
|
|
131
|
+
Toggle between light and dark themes by adding/removing the `dark` class on the root element. The `ThemeProvider` handles this automatically based on user preference.
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
// Manual theme toggle
|
|
135
|
+
document.documentElement.classList.toggle("dark");
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Peer Dependencies
|
|
139
|
+
|
|
140
|
+
- `react` ^18.0.0 || ^19.0.0
|
|
141
|
+
- `react-dom` ^18.0.0 || ^19.0.0
|
package/dist/index.cjs
CHANGED
|
@@ -3729,14 +3729,25 @@ var Switch = React36__namespace.forwardRef(({ className, size, ...props }, ref)
|
|
|
3729
3729
|
}
|
|
3730
3730
|
));
|
|
3731
3731
|
Switch.displayName = SwitchPrimitives__namespace.Root.displayName;
|
|
3732
|
-
var Table = React36__namespace.forwardRef(
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
)
|
|
3732
|
+
var Table = React36__namespace.forwardRef(
|
|
3733
|
+
({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3734
|
+
"div",
|
|
3735
|
+
{
|
|
3736
|
+
className: cn(
|
|
3737
|
+
"relative w-full rounded-xl border border-border overflow-auto",
|
|
3738
|
+
containerClassName
|
|
3739
|
+
),
|
|
3740
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3741
|
+
"table",
|
|
3742
|
+
{
|
|
3743
|
+
ref,
|
|
3744
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
3745
|
+
...props
|
|
3746
|
+
}
|
|
3747
|
+
)
|
|
3748
|
+
}
|
|
3749
|
+
)
|
|
3750
|
+
);
|
|
3740
3751
|
Table.displayName = "Table";
|
|
3741
3752
|
var TableHeader = React36__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
3742
3753
|
TableHeader.displayName = "TableHeader";
|