@marv3l/canopy-ui 1.0.1 → 1.0.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.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 ShawnR04
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
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ShawnR04
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
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,261 +1,261 @@
1
- # Canopy UI
2
-
3
- > A modern, copy-and-paste CLI for adding customizable UI components directly to React and Next.js codebases.
4
-
5
- Canopy UI installs component source code into your project, giving you full ownership over the markup, styles, behavior, and design tokens. Customize components as much as you need—without being locked into a hosted UI library.
6
-
7
- ## Quick Start
8
-
9
- Add a component with one command:
10
-
11
- ```bash
12
- npx canopy-ui add toast
13
- ```
14
-
15
- Run the command without a component name to open an interactive multi-select prompt:
16
-
17
- ```bash
18
- npx canopy-ui add
19
- ```
20
-
21
- ---
22
-
23
- ## Components
24
-
25
- ### Toast
26
-
27
- A customizable, animated notification system with:
28
-
29
- - Built-in `success` and `error` variants
30
- - Configurable global default duration
31
- - Configurable screen position
32
- - Per-toast duration overrides
33
- - Custom colors using hex values, CSS variables, or design tokens
34
- - Progress-bar color controls
35
- - Direct Tailwind `className` overrides
36
-
37
- ## Installation
38
-
39
- Install the Toast component into your project:
40
-
41
- ```bash
42
- npx canopy-ui add toast
43
- ```
44
-
45
- The component is added to your local UI directory, typically under:
46
-
47
- ```text
48
- components/ui/toast.tsx
49
- components/ui/use-toast.ts
50
- ```
51
-
52
- > The exact generated paths may depend on your project's configured import aliases.
53
-
54
- ---
55
-
56
- ## Setup
57
-
58
- Mount `Toaster` once in your root `app/layout.tsx`. This provides the toast viewport for all routes in your application.
59
-
60
- ```tsx
61
- import type { Metadata } from "next";
62
- import { Geist, Geist_Mono } from "next/font/google";
63
-
64
- import "./globals.css";
65
- import { Toaster } from "@/components/ui/toast";
66
-
67
- const geistSans = Geist({
68
- variable: "--font-geist-sans",
69
- subsets: ["latin"],
70
- });
71
-
72
- const geistMono = Geist_Mono({
73
- variable: "--font-geist-mono",
74
- subsets: ["latin"],
75
- });
76
-
77
- export const metadata: Metadata = {
78
- title: "My App",
79
- description: "My application",
80
- };
81
-
82
- export default function RootLayout({
83
- children,
84
- }: Readonly<{
85
- children: React.ReactNode;
86
- }>) {
87
- return (
88
- <html
89
- lang="en"
90
- className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
91
- >
92
- <body className="flex min-h-full flex-col">
93
- {children}
94
- <Toaster defaultDuration={3500} position="top-center" />
95
- </body>
96
- </html>
97
- );
98
- }
99
- ```
100
-
101
- ### `Toaster` Props
102
-
103
- | Prop | Type | Description |
104
- | --- | --- | --- |
105
- | `defaultDuration` | `number` | Default time, in milliseconds, before a toast dismisses. Individual toasts can override it. |
106
- | `position` | `string` | Position of the toast viewport, for example `"top-center"`. |
107
-
108
- ---
109
-
110
- ## Usage
111
-
112
- Import `toast` inside a client component, then call it from an event handler or client-side action.
113
-
114
- ```tsx
115
- "use client";
116
-
117
- import { toast } from "@/components/ui/use-toast";
118
-
119
- export default function Page() {
120
- return (
121
- <button
122
- onClick={() =>
123
- toast({
124
- variant: "success",
125
- title: "Changes saved",
126
- description: "Your preferences were updated successfully.",
127
- })
128
- }
129
- >
130
- Show toast
131
- </button>
132
- );
133
- }
134
- ```
135
-
136
- ---
137
-
138
- ## Examples
139
-
140
- ### Success Toast
141
-
142
- ```tsx
143
- toast({
144
- variant: "success",
145
- title: "Changes saved",
146
- description: "Your preferences were updated successfully.",
147
- });
148
- ```
149
-
150
- ### Error Toast
151
-
152
- ```tsx
153
- toast({
154
- variant: "error",
155
- title: "Action failed",
156
- description: "Could not connect to the remote server.",
157
- });
158
- ```
159
-
160
- ### Custom Colors and Duration
161
-
162
- Use `customColor` to override the toast palette. Values can be literal CSS colors, such as hex values, or CSS custom properties such as `var(--primary)`.
163
-
164
- ```tsx
165
- toast({
166
- title: "Pro subscription unlocked",
167
- description: "Welcome to VIP perks and custom styling.",
168
- duration: 5000,
169
- customColor: {
170
- bg: "var(--card)",
171
- border: "var(--primary)",
172
- text: "var(--card-foreground)",
173
- icon: "var(--primary)",
174
- progress: "var(--primary)",
175
- },
176
- });
177
- ```
178
-
179
- ### Tailwind Class Override
180
-
181
- Use `className` when you want to apply direct Tailwind utility classes to an individual toast.
182
-
183
- ```tsx
184
- toast({
185
- title: "Tailwind classes applied",
186
- description: "Styled with direct className overrides.",
187
- duration: 3500,
188
- customColor: {
189
- progress: "var(--destructive)",
190
- },
191
- className: "border-destructive/40 bg-card text-primary",
192
- });
193
- ```
194
-
195
- ---
196
-
197
- ## Toast API
198
-
199
- ```ts
200
- toast({
201
- variant?: "success" | "error";
202
- title?: string;
203
- description?: string;
204
- duration?: number;
205
- customColor?: {
206
- bg?: string;
207
- border?: string;
208
- text?: string;
209
- icon?: string;
210
- progress?: string;
211
- };
212
- className?: string;
213
- });
214
- ```
215
-
216
- | Option | Description |
217
- | --- | --- |
218
- | `variant` | Applies a built-in visual style, such as `"success"` or `"error"`. |
219
- | `title` | Primary toast message. |
220
- | `description` | Supporting text displayed below the title. |
221
- | `duration` | Dismiss timeout in milliseconds. Overrides `Toaster`’s `defaultDuration`. |
222
- | `customColor.bg` | Toast background color. |
223
- | `customColor.border` | Toast border color. |
224
- | `customColor.text` | Toast text color. |
225
- | `customColor.icon` | Toast icon color. |
226
- | `customColor.progress` | Toast progress-bar color. |
227
- | `className` | Tailwind or custom CSS classes applied directly to the toast. |
228
-
229
- ---
230
-
231
- ## Development
232
-
233
- Build the CLI:
234
-
235
- ```bash
236
- npm run build
237
- ```
238
-
239
- Link the package locally:
240
-
241
- ```bash
242
- npm link
243
- ```
244
-
245
- Then, inside a sample React or Next.js project, install a component through the linked CLI:
246
-
247
- ```bash
248
- canopy-ui add toast
249
- ```
250
-
251
- ## Publishing
252
-
253
- Publish the package to npm:
254
-
255
- ```bash
256
- npm publish --access public
257
- ```
258
-
259
- ## License
260
-
261
- MIT © Shawn Rimai
1
+ # Canopy UI
2
+
3
+ > A modern, copy-and-paste CLI for adding customizable UI components directly to React and Next.js codebases.
4
+
5
+ Canopy UI installs component source code into your project, giving you full ownership over the markup, styles, behavior, and design tokens. Customize components as much as you need—without being locked into a hosted UI library.
6
+
7
+ ## Quick Start
8
+
9
+ Add a component with one command:
10
+
11
+ ```bash
12
+ npx canopy-ui add toast
13
+ ```
14
+
15
+ Run the command without a component name to open an interactive multi-select prompt:
16
+
17
+ ```bash
18
+ npx canopy-ui add
19
+ ```
20
+
21
+ ---
22
+
23
+ ## Components
24
+
25
+ ### Toast
26
+
27
+ A customizable, animated notification system with:
28
+
29
+ - Built-in `success` and `error` variants
30
+ - Configurable global default duration
31
+ - Configurable screen position
32
+ - Per-toast duration overrides
33
+ - Custom colors using hex values, CSS variables, or design tokens
34
+ - Progress-bar color controls
35
+ - Direct Tailwind `className` overrides
36
+
37
+ ## Installation
38
+
39
+ Install the Toast component into your project:
40
+
41
+ ```bash
42
+ npx canopy-ui add toast
43
+ ```
44
+
45
+ The component is added to your local UI directory, typically under:
46
+
47
+ ```text
48
+ components/ui/toast.tsx
49
+ components/ui/use-toast.ts
50
+ ```
51
+
52
+ > The exact generated paths may depend on your project's configured import aliases.
53
+
54
+ ---
55
+
56
+ ## Setup
57
+
58
+ Mount `Toaster` once in your root `app/layout.tsx`. This provides the toast viewport for all routes in your application.
59
+
60
+ ```tsx
61
+ import type { Metadata } from "next";
62
+ import { Geist, Geist_Mono } from "next/font/google";
63
+
64
+ import "./globals.css";
65
+ import { Toaster } from "@/components/ui/toast";
66
+
67
+ const geistSans = Geist({
68
+ variable: "--font-geist-sans",
69
+ subsets: ["latin"],
70
+ });
71
+
72
+ const geistMono = Geist_Mono({
73
+ variable: "--font-geist-mono",
74
+ subsets: ["latin"],
75
+ });
76
+
77
+ export const metadata: Metadata = {
78
+ title: "My App",
79
+ description: "My application",
80
+ };
81
+
82
+ export default function RootLayout({
83
+ children,
84
+ }: Readonly<{
85
+ children: React.ReactNode;
86
+ }>) {
87
+ return (
88
+ <html
89
+ lang="en"
90
+ className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
91
+ >
92
+ <body className="flex min-h-full flex-col">
93
+ {children}
94
+ <Toaster defaultDuration={3500} position="top-center" />
95
+ </body>
96
+ </html>
97
+ );
98
+ }
99
+ ```
100
+
101
+ ### `Toaster` Props
102
+
103
+ | Prop | Type | Description |
104
+ | --- | --- | --- |
105
+ | `defaultDuration` | `number` | Default time, in milliseconds, before a toast dismisses. Individual toasts can override it. |
106
+ | `position` | `string` | Position of the toast viewport, for example `"top-center"`. |
107
+
108
+ ---
109
+
110
+ ## Usage
111
+
112
+ Import `toast` inside a client component, then call it from an event handler or client-side action.
113
+
114
+ ```tsx
115
+ "use client";
116
+
117
+ import { toast } from "@/components/ui/use-toast";
118
+
119
+ export default function Page() {
120
+ return (
121
+ <button
122
+ onClick={() =>
123
+ toast({
124
+ variant: "success",
125
+ title: "Changes saved",
126
+ description: "Your preferences were updated successfully.",
127
+ })
128
+ }
129
+ >
130
+ Show toast
131
+ </button>
132
+ );
133
+ }
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Examples
139
+
140
+ ### Success Toast
141
+
142
+ ```tsx
143
+ toast({
144
+ variant: "success",
145
+ title: "Changes saved",
146
+ description: "Your preferences were updated successfully.",
147
+ });
148
+ ```
149
+
150
+ ### Error Toast
151
+
152
+ ```tsx
153
+ toast({
154
+ variant: "error",
155
+ title: "Action failed",
156
+ description: "Could not connect to the remote server.",
157
+ });
158
+ ```
159
+
160
+ ### Custom Colors and Duration
161
+
162
+ Use `customColor` to override the toast palette. Values can be literal CSS colors, such as hex values, or CSS custom properties such as `var(--primary)`.
163
+
164
+ ```tsx
165
+ toast({
166
+ title: "Pro subscription unlocked",
167
+ description: "Welcome to VIP perks and custom styling.",
168
+ duration: 5000,
169
+ customColor: {
170
+ bg: "var(--card)",
171
+ border: "var(--primary)",
172
+ text: "var(--card-foreground)",
173
+ icon: "var(--primary)",
174
+ progress: "var(--primary)",
175
+ },
176
+ });
177
+ ```
178
+
179
+ ### Tailwind Class Override
180
+
181
+ Use `className` when you want to apply direct Tailwind utility classes to an individual toast.
182
+
183
+ ```tsx
184
+ toast({
185
+ title: "Tailwind classes applied",
186
+ description: "Styled with direct className overrides.",
187
+ duration: 3500,
188
+ customColor: {
189
+ progress: "var(--destructive)",
190
+ },
191
+ className: "border-destructive/40 bg-card text-primary",
192
+ });
193
+ ```
194
+
195
+ ---
196
+
197
+ ## Toast API
198
+
199
+ ```ts
200
+ toast({
201
+ variant?: "success" | "error";
202
+ title?: string;
203
+ description?: string;
204
+ duration?: number;
205
+ customColor?: {
206
+ bg?: string;
207
+ border?: string;
208
+ text?: string;
209
+ icon?: string;
210
+ progress?: string;
211
+ };
212
+ className?: string;
213
+ });
214
+ ```
215
+
216
+ | Option | Description |
217
+ | --- | --- |
218
+ | `variant` | Applies a built-in visual style, such as `"success"` or `"error"`. |
219
+ | `title` | Primary toast message. |
220
+ | `description` | Supporting text displayed below the title. |
221
+ | `duration` | Dismiss timeout in milliseconds. Overrides `Toaster`’s `defaultDuration`. |
222
+ | `customColor.bg` | Toast background color. |
223
+ | `customColor.border` | Toast border color. |
224
+ | `customColor.text` | Toast text color. |
225
+ | `customColor.icon` | Toast icon color. |
226
+ | `customColor.progress` | Toast progress-bar color. |
227
+ | `className` | Tailwind or custom CSS classes applied directly to the toast. |
228
+
229
+ ---
230
+
231
+ ## Development
232
+
233
+ Build the CLI:
234
+
235
+ ```bash
236
+ npm run build
237
+ ```
238
+
239
+ Link the package locally:
240
+
241
+ ```bash
242
+ npm link
243
+ ```
244
+
245
+ Then, inside a sample React or Next.js project, install a component through the linked CLI:
246
+
247
+ ```bash
248
+ canopy-ui add toast
249
+ ```
250
+
251
+ ## Publishing
252
+
253
+ Publish the package to npm:
254
+
255
+ ```bash
256
+ npm publish --access public
257
+ ```
258
+
259
+ ## License
260
+
261
+ MIT © Shawn Rimai
package/dist/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marv3l/canopy-ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "An accessible, themable React UI component library built for fast-moving web applications.",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {