@nuvia/components 0.6.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 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
- 1. Configure your `tailwind.config.ts`:
13
+ ### Vite Projects
14
+
15
+ ```bash
16
+ pnpm add -D @tailwindcss/vite
17
+ ```
14
18
 
15
19
  ```typescript
16
- export { config as default } from "@nuvia/tailwind-config";
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
- 2. Import the global styles in your app:
30
+ ### Next.js / Other Projects
20
31
 
21
- ```typescript
22
- import "@nuvia/components/styles/globals.css";
32
+ ```bash
33
+ pnpm add -D @tailwindcss/postcss
23
34
  ```
24
35
 
25
- 3. Wrap your app with providers:
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
- import { ThemeProvider, TooltipProvider } from "@nuvia/components";
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
- export function App({ children }) {
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
- ```typescript
97
+ ```tsx
98
+ // Import from main entry
44
99
  import { Button, Card, Dialog } from "@nuvia/components";
45
- // Or import from specific paths
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
- - Accordion
52
- - Alert / Alert Dialog
53
- - Avatar
54
- - Badge
55
- - Breadcrumb
56
- - Button
57
- - Calendar
58
- - Card
59
- - Carousel
60
- - Chart
61
- - Checkbox
62
- - Chip
63
- - Collapsible
64
- - Combobox / Multi-Combobox
65
- - Command
66
- - Context Menu
67
- - Dialog
68
- - Drawer
69
- - Dropdown Menu
70
- - Form
71
- - Hover Card
72
- - Input / Input OTP
73
- - Label
74
- - Menubar
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(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative w-full rounded-xl border border-border overflow-auto", containerClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
3733
- "table",
3734
- {
3735
- ref,
3736
- className: cn("w-full caption-bottom text-sm", className),
3737
- ...props
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";