@colorffy/ui 1.0.2 → 1.0.4

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,634 +1,645 @@
1
- # @colorffy/ui
2
-
3
- A modern Vue 3 component library built with TypeScript. Features a comprehensive collection of **unstyled, headless UI components** with full TypeScript support. Designed to work seamlessly with **ColorffyCSS** (optional) or your own custom styles.
4
-
5
- ## Features
6
-
7
- ✨ **70+ Vue 3 Components** - Accordion, Alerts, Buttons, Cards, Dialogs, Forms, Navigation, and more
8
- 🎨 **Style-Agnostic** - Use with ColorffyCSS or bring your own styles
9
- 📘 **Full TypeScript Support** - Complete type definitions for all components
10
- 🔌 **Flexible Installation** - Use globally or import individually
11
- 🚀 **Tree-shakeable** - Import only what you need
12
- **Nuxt 3 Compatible** - Works seamlessly with Nuxt applications
13
- 🎯 **Headless Architecture** - Full control over styling and behavior
14
-
15
- ## Installation
16
-
17
- ### Install ColorffyUI
18
-
19
- ```bash
20
- # npm
21
- npm install @colorffy/ui
22
-
23
- # yarn
24
- yarn add @colorffy/ui
25
-
26
- # pnpm
27
- pnpm add @colorffy/ui
28
- ```
29
-
30
- ### Install Peer Dependencies
31
-
32
- ColorffyUI requires the following peer dependencies:
33
-
34
- ```bash
35
- npm install @vueuse/components floating-vue vue
36
- ```
37
-
38
- ### Install ColorffyCSS (Optional, Recommended)
39
-
40
- For pre-built, beautiful styling that works out of the box:
41
-
42
- ```bash
43
- npm install @colorffy/css
44
- ```
45
-
46
- > **Note:** ColorffyUI components are **unstyled by default**. You can use ColorffyCSS for instant styling, or provide your own custom styles.
47
-
48
- ## Styling Options
49
-
50
- ### Option 1: Use ColorffyCSS (Recommended)
51
-
52
- Import the compiled CSS in your `main.ts`:
53
-
54
- ```typescript
55
- import ColorffyUI from '@colorffy/ui'
56
- import { createApp } from 'vue'
57
- import App from './App.vue'
58
- import '@colorffy/css' // Import styles
59
-
60
- const app = createApp(App)
61
- app.use(ColorffyUI)
62
- app.mount('#app')
63
- ```
64
-
65
- ### Option 2: Customize ColorffyCSS with SCSS
66
-
67
- For full customization, use SCSS to override variables:
68
-
69
- ```scss
70
- // src/assets/variables.scss
71
- // Override ColorffyCSS variables
72
- @forward '@colorffy/css/scss/abstracts/variables' with (
73
- $primary: #4f46e5,
74
- $secondary: #ec4899,
75
- $accent: #0ea5e9,
76
- );
77
-
78
- // Import the framework
79
- @use '@colorffy/css/scss/main';
80
- ```
81
-
82
- ```scss
83
- // src/assets/main.scss
84
- @use 'variables' as *;
85
-
86
- // Your custom styles
87
- :root {
88
- --custom-var: value;
89
- }
90
- ```
91
-
92
- ```typescript
93
- import ColorffyUI from '@colorffy/ui'
94
- // main.ts
95
- import { createApp } from 'vue'
96
- import App from './App.vue'
97
- import './assets/main.scss' // Import customized styles
98
-
99
- const app = createApp(App)
100
- app.use(ColorffyUI)
101
- app.mount('#app')
102
- ```
103
-
104
- ### Option 3: Custom Styles
105
-
106
- Use ColorffyUI components without any styling framework. Components use semantic class names like `.btn`, `.card`, `.alert`, etc. that you can style however you want:
107
-
108
- ```css
109
- /* your-custom-styles.css */
110
- .btn {
111
- padding: 0.5rem 1rem;
112
- border-radius: 0.25rem;
113
- /* Your custom button styles */
114
- }
115
-
116
- .card {
117
- background: white;
118
- border: 1px solid #e5e7eb;
119
- /* Your custom card styles */
120
- }
121
- ```
122
-
123
- For more details on ColorffyCSS customization, see the [ColorffyCSS README](https://www.npmjs.com/package/@colorffy/css).
124
-
125
- ## Usage
126
-
127
- ### Option 1: Global Registration (Recommended for most cases)
128
-
129
- Register all components globally in your `main.ts`:
130
-
131
- ```typescript
132
- import ColorffyUI from '@colorffy/ui'
133
- import { createApp } from 'vue'
134
- import App from './App.vue'
135
-
136
- const app = createApp(App)
137
- app.use(ColorffyUI)
138
- app.mount('#app')
139
- ```
140
-
141
- Then use components anywhere without imports:
142
-
143
- ```vue
144
- <template>
145
- <div>
146
- <UiButton variant="filled" color="primary" text="Click me!" />
147
- <UiCard>
148
- <template #body>
149
- <h2>Card Content</h2>
150
- </template>
151
- </UiCard>
152
- </div>
153
- </template>
154
- ```
155
-
156
- ### Option 2: Individual Component Imports (Better for tree-shaking)
157
-
158
- Import only the components you need:
159
-
160
- ```vue
161
- <script setup lang="ts">
162
- import { UiAlert, UiButton, UiCard } from '@colorffy/ui'
163
- </script>
164
-
165
- <template>
166
- <div>
167
- <UiButton variant="filled" color="primary" text="Click me!" />
168
- <UiCard>
169
- <template #body>
170
- <h2>Card Content</h2>
171
- </template>
172
- </UiCard>
173
- <UiAlert
174
- type="banner"
175
- variant="success"
176
- message="Operation successful!"
177
- />
178
- </div>
179
- </template>
180
- ```
181
-
182
- ### Option 3: Selective Global Registration
183
-
184
- Register only specific components globally:
185
-
186
- ```typescript
187
- import { UiAlert, UiButton, UiCard } from '@colorffy/ui'
188
- import { createApp } from 'vue'
189
- import App from './App.vue'
190
-
191
- const app = createApp(App)
192
-
193
- // Register only needed components
194
- app.component('UiButton', UiButton)
195
- app.component('UiCard', UiCard)
196
- app.component('UiAlert', UiAlert)
197
-
198
- app.mount('#app')
199
- ```
200
-
201
- ## Nuxt 3 Usage
202
-
203
- ### Install Dependencies
204
-
205
- ```bash
206
- npm install @colorffy/ui @colorffy/css
207
- ```
208
-
209
- ### Setup with ColorffyCSS
210
-
211
- Add ColorffyCSS to your `nuxt.config.ts`:
212
-
213
- ```typescript
214
- export default defineNuxtConfig({
215
- css: ['@colorffy/css']
216
- })
217
- ```
218
-
219
- ### Global Registration with Nuxt Plugin
220
-
221
- Create a plugin file `plugins/colorffy-ui.ts`:
222
-
223
- ```typescript
224
- import ColorffyUI from '@colorffy/ui'
225
-
226
- export default defineNuxtPlugin((nuxtApp) => {
227
- nuxtApp.vueApp.use(ColorffyUI)
228
- })
229
- ```
230
-
231
- ### Customize with SCSS (Advanced)
232
-
233
- For full SCSS customization in Nuxt:
234
-
235
- ```typescript
236
- // nuxt.config.ts
237
- export default defineNuxtConfig({
238
- css: ['~/assets/scss/main.scss'],
239
- vite: {
240
- css: {
241
- preprocessorOptions: {
242
- scss: {
243
- additionalData: '@use "~/assets/scss/variables.scss" as *;'
244
- }
245
- }
246
- }
247
- }
248
- })
249
- ```
250
-
251
- ```scss
252
- // assets/scss/variables.scss
253
- @forward '@colorffy/css/scss/abstracts/variables' with (
254
- $primary: #4f46e5,
255
- $secondary: #ec4899,
256
- $accent: #0ea5e9,
257
- );
258
-
259
- @use '@colorffy/css/scss/main';
260
- ```
261
-
262
- Then use components anywhere in your Nuxt app:
263
-
264
- ```vue
265
- <template>
266
- <div>
267
- <UiButton variant="filled" color="primary" text="Click me!" />
268
- <UiCard>
269
- <template #body>
270
- <h2>Card Content</h2>
271
- </template>
272
- </UiCard>
273
- </div>
274
- </template>
275
- ```
276
-
277
- ### Individual Component Imports in Nuxt
278
-
279
- Import components directly in your pages/components:
280
-
281
- ```vue
282
- <script setup lang="ts">
283
- import { UiAlert, UiButton, UiCard } from '@colorffy/ui'
284
- </script>
285
-
286
- <template>
287
- <div>
288
- <UiButton variant="filled" color="primary" text="Click me!" />
289
- <UiCard>
290
- <template #body>
291
- <h2>Card Content</h2>
292
- </template>
293
- </UiCard>
294
- </div>
295
- </template>
296
- ```
297
-
298
- ### Auto-imports (Optional)
299
-
300
- To enable auto-imports in Nuxt, add to your `nuxt.config.ts`:
301
-
302
- ```typescript
303
- export default defineNuxtConfig({
304
- components: [
305
- {
306
- path: 'node_modules/@colorffy/ui/dist',
307
- pattern: '**/*.vue',
308
- pathPrefix: false
309
- }
310
- ]
311
- })
312
- ```
313
-
314
- ## Component Categories
315
-
316
- ### Layout Components
317
- - `UiHeaderContent` - Page header with title and subtitle
318
- - `UiPaneContent` - Content container/pane
319
-
320
- ### UI Components
321
-
322
- #### Accordion
323
- - `UiAccordion` - Single accordion item
324
- - `UiAccordionGroup` - Group of accordion items
325
-
326
- #### Alerts
327
- - `UiAlert` - Alert/notification component
328
- - `UiAlertToast` - Toast notification
329
-
330
- #### Badges
331
- - `UiBadge` - Badge/tag component
332
- - `UiBadgeGroup` - Group of badges
333
-
334
- #### Buttons
335
- - `UiButton` - Standard button
336
- - `UiButtonMenu` - Button with dropdown menu
337
- - `UiButtonMenuDivider` - Menu divider
338
- - `UiButtonMenuItem` - Menu item
339
- - `UiButtonMenuText` - Menu text item
340
- - `UiButtonToggleGroup` - Toggle button group
341
- - `UiButtonTooltip` - Button with tooltip
342
-
343
- #### Cards
344
- - `UiCard` - Card container
345
-
346
- #### Dialogs
347
- - `UiModal` - Modal dialog
348
- - `UiConfirmModal` - Confirmation modal
349
-
350
- #### Icons
351
- - `UiIconApp` - Application icons
352
- - `UiIconMaterial` - Material Design icons
353
- - `UiIconShapes` - Shape icons
354
- - `UiIconTool` - Tool icons
355
-
356
- #### Images
357
- - `UiAvatar` - Avatar component
358
-
359
- #### Form Inputs
360
- - `UiInputCheck` - Checkbox input
361
- - `UiInputColorPicker` - Color picker
362
- - `UiInputFile` - File upload
363
- - `UiInputPhoneNumber` - Phone number input
364
- - `UiInputRadio` - Radio button
365
- - `UiInputRange` - Range slider
366
- - `UiInputSelect` - Select dropdown
367
- - `UiInputText` - Text input
368
- - `UiInputTextarea` - Textarea input
369
-
370
- #### Links
371
- - `UiLinkTooltip` - Link with tooltip
372
-
373
- #### Lists
374
- - `UiListGroup` - List container
375
- - `UiListItem` - List item
376
-
377
- #### Navigation
378
- - `UiDrawerLink` - Drawer navigation link
379
- - `UiNavbarLink` - Navbar link
380
- - `UiNavigationBar` - Navigation bar
381
- - `UiPopoverMenu` - Popover menu
382
- - `UiSegmentedControls` - Segmented control
383
- - `UiTabs` - Tab navigation
384
-
385
- #### Tables
386
- - `UiDatatable` - Data table component
387
-
388
- ### State Components
389
- - `UiBaseSkeleton` - Basic skeleton loader
390
- - `UiEmpty` - Empty state
391
- - `UiExpressiveLoading` - Expressive loading animation
392
- - `UiGridSkeleton` - Grid skeleton loader
393
- - `UiLoading` - Loading spinner
394
- - `UiShapeLoading` - Shape loading animation
395
- - `UiTableSkeleton` - Table skeleton loader
396
-
397
- ## Composables
398
-
399
- The library also exports useful composables:
400
-
401
- ```typescript
402
- import { useDateUtils, useTextUtils, useToast } from '@colorffy/ui'
403
-
404
- // Show toast notification
405
- const toast = useToast()
406
- toast.show({ message: 'Success!', variant: 'success' })
407
-
408
- // Date utilities
409
- const dateUtils = useDateUtils()
410
-
411
- // Text utilities
412
- const textUtils = useTextUtils()
413
- ```
414
-
415
- ## Component Examples
416
-
417
- ### Button
418
-
419
- ```vue
420
- <template>
421
- <!-- Filled buttons -->
422
- <UiButton variant="filled" text="Primary" />
423
- <UiButton variant="filled" color="success" text="Success" />
424
- <UiButton variant="filled" color="danger" text="Danger" />
425
-
426
- <!-- Tonal buttons -->
427
- <UiButton variant="tonal" color="primary" text="Tonal" />
428
-
429
- <!-- Outline buttons -->
430
- <UiButton variant="outline" text="Outline" />
431
-
432
- <!-- With icon -->
433
- <UiButton variant="filled" text="With Icon">
434
- <template #icon>
435
- <UiIconMaterial icon-code="&#xe000;" />
436
- </template>
437
- </UiButton>
438
-
439
- <!-- Sizes -->
440
- <UiButton variant="filled" size="sm" text="Small" />
441
- <UiButton variant="filled" size="md" text="Medium" />
442
- <UiButton variant="filled" size="lg" text="Large" />
443
-
444
- <!-- Loading state -->
445
- <UiButton variant="filled" :loading="true" text="Loading" />
446
- </template>
447
- ```
448
-
449
- ### Alert
450
-
451
- ```vue
452
- <template>
453
- <UiAlert
454
- type="banner"
455
- variant="success"
456
- title="Success!"
457
- message="Your operation completed successfully."
458
- />
459
-
460
- <UiAlert
461
- type="snackbar"
462
- variant="warning"
463
- message="Warning message"
464
- />
465
-
466
- <UiAlert
467
- type="tonal"
468
- variant="danger"
469
- title="Error"
470
- message="Something went wrong."
471
- :critical="true"
472
- />
473
- </template>
474
- ```
475
-
476
- ### Card
477
-
478
- ```vue
479
- <template>
480
- <UiCard variant="pane">
481
- <template #body>
482
- <h3>Card Title</h3>
483
- <p>Card content goes here...</p>
484
- </template>
485
- </UiCard>
486
- </template>
487
- ```
488
-
489
- ### Accordion
490
-
491
- ```vue
492
- <template>
493
- <UiAccordionGroup>
494
- <UiAccordion title="Section 1" name="accordion-demo">
495
- <template #content>
496
- <p>Content for section 1</p>
497
- </template>
498
- </UiAccordion>
499
-
500
- <UiAccordion title="Section 2" name="accordion-demo">
501
- <template #content>
502
- <p>Content for section 2</p>
503
- </template>
504
- </UiAccordion>
505
- </UiAccordionGroup>
506
- </template>
507
- ```
508
-
509
- ### Form Inputs
510
-
511
- ```vue
512
- <template>
513
- <UiInputText
514
- v-model="name"
515
- label="Name"
516
- placeholder="Enter your name"
517
- />
518
-
519
- <UiInputSelect
520
- v-model="selected"
521
- :options="options"
522
- label="Choose option"
523
- />
524
-
525
- <UiInputCheck
526
- v-model="agree"
527
- label="I agree to terms"
528
- />
529
- </template>
530
- ```
531
-
532
- ## TypeScript Support
533
-
534
- All components come with full TypeScript support. Import types as needed:
535
-
536
- ```typescript
537
- import type {
538
- AlertType,
539
- AlertVariant,
540
- ButtonColor,
541
- ButtonVariant
542
- } from '@colorffy/ui'
543
-
544
- // Use in your components
545
- const variant: ButtonVariant = 'filled'
546
- const color: ButtonColor = 'primary'
547
- ```
548
-
549
- ## Styling
550
-
551
- ### With ColorffyCSS (Recommended)
552
-
553
- ColorffyUI is designed to work seamlessly with ColorffyCSS, which provides:
554
- - Modern, responsive design system
555
- - Consistent color palette with tonal variants
556
- - Pre-built component styles
557
- - Utility classes for rapid development
558
- - Customizable themes with SCSS variables
559
-
560
- Install ColorffyCSS and import it in your app:
561
-
562
- ```bash
563
- npm install @colorffy/css
564
- ```
565
-
566
- ```typescript
567
- // main.ts
568
- import '@colorffy/css'
569
- ```
570
-
571
- ### Custom Styling
572
-
573
- All components use semantic class names that you can style:
574
-
575
- ```css
576
- /* Component classes */
577
- .btn { /* Button styles */ }
578
- .btn.btn-filled { /* Filled variant */ }
579
- .btn.btn-primary { /* Primary color */ }
580
-
581
- .card { /* Card styles */ }
582
- .card.card-pane { /* Pane variant */ }
583
-
584
- .alert { /* Alert styles */ }
585
- .alert.alert-success { /* Success variant */ }
586
-
587
- /* And more... */
588
- ```
589
-
590
- ### CSS Variable Overrides
591
-
592
- Override CSS custom properties for runtime theming:
593
-
594
- ```css
595
- :root {
596
- /* Theme colors */
597
- --theme-primary-base: #4f46e5;
598
- --theme-secondary-base: #ec4899;
599
-
600
- /* Component variables */
601
- --_btn-radius: 50px;
602
- --_card-bg-color: #ffffff;
603
- }
604
- ```
605
-
606
- For complete styling documentation, see the [ColorffyCSS README](https://www.npmjs.com/package/@colorffy/css).
607
-
608
- ## Browser Support
609
-
610
- - Chrome (latest)
611
- - Firefox (latest)
612
- - Safari (latest)
613
- - Edge (latest)
614
-
615
- ## Contributing
616
-
617
- Contributions are welcome! Please feel free to submit issues or pull requests.
618
-
619
- ## License
620
-
621
- ISC
622
-
623
- ## Author
624
-
625
- Giancarlos Garza
626
-
627
- ## Links
628
-
629
- - [npm Package](https://www.npmjs.com/package/@colorffy/ui)
630
- - [ColorffyCSS](https://www.npmjs.com/package/@colorffy/css)
631
-
632
- ---
633
-
634
- Made with ❤️ using Vue 3 and TypeScript
1
+ # @colorffy/ui
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@colorffy/ui?color=blue&label=npm&logo=npm&style=flat-square)](https://www.npmjs.com/package/@colorffy/ui)
4
+ [![CI](https://img.shields.io/github/actions/workflow/status/giancarlosgza/colorffy-workspace/ci.yml?branch=main&label=CI&logo=github&style=flat-square)](https://github.com/giancarlosgza/colorffy-workspace/actions/workflows/ci.yml)
5
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/@colorffy/ui?style=flat-square)](https://bundlephobia.com/package/@colorffy/ui)
6
+ [![license](https://img.shields.io/npm/l/@colorffy/ui?style=flat-square)](https://github.com/giancarlosgza/colorffy-workspace/blob/main/LICENSE)
7
+
8
+ A modern Nuxt / Vue 3 component library built with TypeScript. Features a comprehensive collection of **unstyled, headless UI components** with full TypeScript support. Designed to work seamlessly with **Colorffy CSS** (optional) or your own custom styles.
9
+
10
+ ## Features
11
+
12
+ - **70+ Vue 3 Components** - Accordion, Alerts, Buttons, Cards, Dialogs, Forms, Navigation, and more
13
+ - 🎨 **Style-Agnostic** - Use with Colorffy CSS or bring your own styles
14
+ - 📘 **Full TypeScript Support** - Complete type definitions for all components
15
+ - 🔌 **Flexible Installation** - Use globally or import individually
16
+ - 🚀 **Tree-shakeable** - Import only what you need
17
+ - ⚡ **Nuxt 3 Compatible** - Works seamlessly with Nuxt applications
18
+ - 🎯 **Headless Architecture** - Full control over styling and behavior
19
+
20
+ ## 📦 Installation
21
+
22
+ ### Install Colorffy UI
23
+
24
+ ```bash
25
+ # npm
26
+ npm install @colorffy/ui
27
+
28
+ # yarn
29
+ yarn add @colorffy/ui
30
+
31
+ # pnpm
32
+ pnpm add @colorffy/ui
33
+ ```
34
+
35
+ ### Install Peer Dependencies
36
+
37
+ Colorffy UI requires the following peer dependencies:
38
+
39
+ ```bash
40
+ npm install @vueuse/components floating-vue vue
41
+ ```
42
+
43
+ ### Install Colorffy CSS (Optional, Recommended)
44
+
45
+ For pre-built, beautiful styling that works out of the box:
46
+
47
+ ```bash
48
+ npm install @colorffy/css
49
+ ```
50
+
51
+ > **Note:** Colorffy UI components are **unstyled by default**. You can use Colorffy CSS for instant styling, or provide your own custom styles.
52
+
53
+ ## 🎨 Styling Options
54
+
55
+ ### Option 1: Use Colorffy CSS (Recommended)
56
+
57
+ Import the compiled CSS in your `main.ts`:
58
+
59
+ ```typescript
60
+ import ColorffyUI from '@colorffy/ui'
61
+ import { createApp } from 'vue'
62
+ import App from './App.vue'
63
+ import '@colorffy/css' // Import styles
64
+
65
+ const app = createApp(App)
66
+ app.use(ColorffyUI)
67
+ app.mount('#app')
68
+ ```
69
+
70
+ ### Option 2: Customize Colorffy CSS with SCSS
71
+
72
+ For full customization, use SCSS to override variables:
73
+
74
+ ```scss
75
+ // src/assets/variables.scss
76
+ // Override Colorffy CSS variables
77
+ @forward '@colorffy/css/scss/abstracts/variables' with (
78
+ $primary: #4f46e5,
79
+ $secondary: #ec4899,
80
+ $accent: #0ea5e9,
81
+ );
82
+
83
+ // Import the framework
84
+ @use '@colorffy/css/scss/main';
85
+ ```
86
+
87
+ ```scss
88
+ // src/assets/main.scss
89
+ @use 'variables' as *;
90
+
91
+ // Your custom styles
92
+ :root {
93
+ --custom-var: value;
94
+ }
95
+ ```
96
+
97
+ ```typescript
98
+ import ColorffyUI from '@colorffy/ui'
99
+ // main.ts
100
+ import { createApp } from 'vue'
101
+ import App from './App.vue'
102
+ import './assets/main.scss' // Import customized styles
103
+
104
+ const app = createApp(App)
105
+ app.use(ColorffyUI)
106
+ app.mount('#app')
107
+ ```
108
+
109
+ ### Option 3: Custom Styles
110
+
111
+ Use Colorffy UI components without any styling framework. Components use semantic class names like `.btn`, `.card`, `.alert`, etc. that you can style however you want:
112
+
113
+ ```css
114
+ /* your-custom-styles.css */
115
+ .btn {
116
+ padding: 0.5rem 1rem;
117
+ border-radius: 0.25rem;
118
+ /* Your custom button styles */
119
+ }
120
+
121
+ .card {
122
+ background: white;
123
+ border: 1px solid #e5e7eb;
124
+ /* Your custom card styles */
125
+ }
126
+ ```
127
+
128
+ For more details on Colorffy CSS customization, see the [Colorffy CSS README](https://www.npmjs.com/package/@colorffy/css).
129
+
130
+ ## 🚀 Usage
131
+
132
+ ### Option 1: Global Registration (Recommended for most cases)
133
+
134
+ Register all components globally in your `main.ts`:
135
+
136
+ ```typescript
137
+ import ColorffyUI from '@colorffy/ui'
138
+ import { createApp } from 'vue'
139
+ import App from './App.vue'
140
+
141
+ const app = createApp(App)
142
+ app.use(ColorffyUI)
143
+ app.mount('#app')
144
+ ```
145
+
146
+ Then use components anywhere without imports:
147
+
148
+ ```vue
149
+ <template>
150
+ <div>
151
+ <UiButton variant="filled" color="primary" text="Click me!" />
152
+ <UiCard>
153
+ <template #body>
154
+ <h2>Card Content</h2>
155
+ </template>
156
+ </UiCard>
157
+ </div>
158
+ </template>
159
+ ```
160
+
161
+ ### Option 2: Individual Component Imports (Better for tree-shaking)
162
+
163
+ Import only the components you need:
164
+
165
+ ```vue
166
+ <script setup lang="ts">
167
+ import { UiAlert, UiButton, UiCard } from '@colorffy/ui'
168
+ </script>
169
+
170
+ <template>
171
+ <div>
172
+ <UiButton variant="filled" color="primary" text="Click me!" />
173
+ <UiCard>
174
+ <template #body>
175
+ <h2>Card Content</h2>
176
+ </template>
177
+ </UiCard>
178
+ <UiAlert
179
+ type="banner"
180
+ variant="success"
181
+ message="Operation successful!"
182
+ />
183
+ </div>
184
+ </template>
185
+ ```
186
+
187
+ ### Option 3: Selective Global Registration
188
+
189
+ Register only specific components globally:
190
+
191
+ ```typescript
192
+ import { UiAlert, UiButton, UiCard } from '@colorffy/ui'
193
+ import { createApp } from 'vue'
194
+ import App from './App.vue'
195
+
196
+ const app = createApp(App)
197
+
198
+ // Register only needed components
199
+ app.component('UiButton', UiButton)
200
+ app.component('UiCard', UiCard)
201
+ app.component('UiAlert', UiAlert)
202
+
203
+ app.mount('#app')
204
+ ```
205
+
206
+ ## 🚀 Nuxt 3 Usage
207
+
208
+ ### Install Dependencies
209
+
210
+ ```bash
211
+ npm install @colorffy/ui @colorffy/css
212
+ ```
213
+
214
+ ### Setup with Colorffy CSS
215
+
216
+ Add Colorffy CSS to your `nuxt.config.ts`:
217
+
218
+ ```typescript
219
+ export default defineNuxtConfig({
220
+ css: ['@colorffy/css']
221
+ })
222
+ ```
223
+
224
+ ### Global Registration with Nuxt Plugin
225
+
226
+ Create a plugin file `plugins/colorffy-ui.ts`:
227
+
228
+ ```typescript
229
+ import ColorffyUI from '@colorffy/ui'
230
+
231
+ export default defineNuxtPlugin((nuxtApp) => {
232
+ nuxtApp.vueApp.use(ColorffyUI)
233
+ })
234
+ ```
235
+
236
+ ### Customize with SCSS (Advanced)
237
+
238
+ For full SCSS customization in Nuxt:
239
+
240
+ ```typescript
241
+ // nuxt.config.ts
242
+ export default defineNuxtConfig({
243
+ css: ['~/assets/scss/main.scss'],
244
+ vite: {
245
+ css: {
246
+ preprocessorOptions: {
247
+ scss: {
248
+ additionalData: '@use "~/assets/scss/variables.scss" as *;'
249
+ }
250
+ }
251
+ }
252
+ }
253
+ })
254
+ ```
255
+
256
+ ```scss
257
+ // assets/scss/variables.scss
258
+ @forward '@colorffy/css/scss/abstracts/variables' with (
259
+ $primary: #4f46e5,
260
+ $secondary: #ec4899,
261
+ $accent: #0ea5e9,
262
+ );
263
+
264
+ @use '@colorffy/css/scss/main';
265
+ ```
266
+
267
+ Then use components anywhere in your Nuxt app:
268
+
269
+ ```vue
270
+ <template>
271
+ <div>
272
+ <UiButton variant="filled" color="primary" text="Click me!" />
273
+ <UiCard>
274
+ <template #body>
275
+ <h2>Card Content</h2>
276
+ </template>
277
+ </UiCard>
278
+ </div>
279
+ </template>
280
+ ```
281
+
282
+ ### Individual Component Imports in Nuxt
283
+
284
+ Import components directly in your pages/components:
285
+
286
+ ```vue
287
+ <script setup lang="ts">
288
+ import { UiAlert, UiButton, UiCard } from '@colorffy/ui'
289
+ </script>
290
+
291
+ <template>
292
+ <div>
293
+ <UiButton variant="filled" color="primary" text="Click me!" />
294
+ <UiCard>
295
+ <template #body>
296
+ <h2>Card Content</h2>
297
+ </template>
298
+ </UiCard>
299
+ </div>
300
+ </template>
301
+ ```
302
+
303
+ ### Auto-imports (Optional)
304
+
305
+ To enable auto-imports in Nuxt, add to your `nuxt.config.ts`:
306
+
307
+ ```typescript
308
+ export default defineNuxtConfig({
309
+ components: [
310
+ {
311
+ path: 'node_modules/@colorffy/ui/dist',
312
+ pattern: '**/*.vue',
313
+ pathPrefix: false
314
+ }
315
+ ]
316
+ })
317
+ ```
318
+
319
+ ## 💻 Component Categories
320
+
321
+ ### Layout Components
322
+ - `UiHeaderContent` - Page header with title and subtitle
323
+ - `UiPaneContent` - Content container/pane
324
+
325
+ ### UI Components
326
+
327
+ #### Accordion
328
+ - `UiAccordion` - Single accordion item
329
+ - `UiAccordionGroup` - Group of accordion items
330
+
331
+ #### Alerts
332
+ - `UiAlert` - Alert/notification component
333
+ - `UiAlertToast` - Toast notification
334
+
335
+ #### Badges
336
+ - `UiBadge` - Badge/tag component
337
+ - `UiBadgeGroup` - Group of badges
338
+
339
+ #### Buttons
340
+ - `UiButton` - Standard button
341
+ - `UiButtonMenu` - Button with dropdown menu
342
+ - `UiButtonMenuDivider` - Menu divider
343
+ - `UiButtonMenuItem` - Menu item
344
+ - `UiButtonMenuText` - Menu text item
345
+ - `UiButtonToggleGroup` - Toggle button group
346
+ - `UiButtonTooltip` - Button with tooltip
347
+
348
+ #### Cards
349
+ - `UiCard` - Card container
350
+
351
+ #### Dialogs
352
+ - `UiModal` - Modal dialog
353
+ - `UiConfirmModal` - Confirmation modal
354
+
355
+ #### Icons
356
+ - `UiIconApp` - Application icons
357
+ - `UiIconMaterial` - Material Design icons
358
+ - `UiIconShapes` - Shape icons
359
+ - `UiIconTool` - Tool icons
360
+
361
+ #### Images
362
+ - `UiAvatar` - Avatar component
363
+
364
+ #### Form Inputs
365
+ - `UiInputCheck` - Checkbox input
366
+ - `UiInputColorPicker` - Color picker
367
+ - `UiInputFile` - File upload
368
+ - `UiInputPhoneNumber` - Phone number input
369
+ - `UiInputRadio` - Radio button
370
+ - `UiInputRange` - Range slider
371
+ - `UiInputSelect` - Select dropdown
372
+ - `UiInputText` - Text input
373
+ - `UiInputTextarea` - Textarea input
374
+
375
+ #### Links
376
+ - `UiLinkTooltip` - Link with tooltip
377
+
378
+ #### Lists
379
+ - `UiListGroup` - List container
380
+ - `UiListItem` - List item
381
+
382
+ #### Navigation
383
+ - `UiDrawerLink` - Drawer navigation link
384
+ - `UiNavbarLink` - Navbar link
385
+ - `UiNavigationBar` - Navigation bar
386
+ - `UiPopoverMenu` - Popover menu
387
+ - `UiSegmentedControls` - Segmented control
388
+ - `UiTabs` - Tab navigation
389
+
390
+ #### Tables
391
+ - `UiDatatable` - Data table component
392
+
393
+ ### State Components
394
+ - `UiBaseSkeleton` - Basic skeleton loader
395
+ - `UiEmpty` - Empty state
396
+ - `UiExpressiveLoading` - Expressive loading animation
397
+ - `UiGridSkeleton` - Grid skeleton loader
398
+ - `UiLoading` - Loading spinner
399
+ - `UiShapeLoading` - Shape loading animation
400
+ - `UiTableSkeleton` - Table skeleton loader
401
+
402
+ ## 💻 Composables
403
+
404
+ The library also exports useful composables:
405
+
406
+ ```typescript
407
+ import { useDateUtils, useTextUtils, useToast } from '@colorffy/ui'
408
+
409
+ // Show toast notification
410
+ const toast = useToast()
411
+ toast.show({ message: 'Success!', variant: 'success' })
412
+
413
+ // Date utilities
414
+ const dateUtils = useDateUtils()
415
+
416
+ // Text utilities
417
+ const textUtils = useTextUtils()
418
+ ```
419
+
420
+ ## 💻 Component Examples
421
+
422
+ ### Button
423
+
424
+ ```vue
425
+ <template>
426
+ <!-- Filled buttons -->
427
+ <UiButton variant="filled" text="Primary" />
428
+ <UiButton variant="filled" color="success" text="Success" />
429
+ <UiButton variant="filled" color="danger" text="Danger" />
430
+
431
+ <!-- Tonal buttons -->
432
+ <UiButton variant="tonal" color="primary" text="Tonal" />
433
+
434
+ <!-- Outline buttons -->
435
+ <UiButton variant="outline" text="Outline" />
436
+
437
+ <!-- With icon -->
438
+ <UiButton variant="filled" text="With Icon">
439
+ <template #icon>
440
+ <UiIconMaterial icon-code="&#xe000;" />
441
+ </template>
442
+ </UiButton>
443
+
444
+ <!-- Sizes -->
445
+ <UiButton variant="filled" size="sm" text="Small" />
446
+ <UiButton variant="filled" size="md" text="Medium" />
447
+ <UiButton variant="filled" size="lg" text="Large" />
448
+
449
+ <!-- Loading state -->
450
+ <UiButton variant="filled" :loading="true" text="Loading" />
451
+ </template>
452
+ ```
453
+
454
+ ### Alert
455
+
456
+ ```vue
457
+ <template>
458
+ <UiAlert
459
+ type="banner"
460
+ variant="success"
461
+ title="Success!"
462
+ message="Your operation completed successfully."
463
+ />
464
+
465
+ <UiAlert
466
+ type="snackbar"
467
+ variant="warning"
468
+ message="Warning message"
469
+ />
470
+
471
+ <UiAlert
472
+ type="tonal"
473
+ variant="danger"
474
+ title="Error"
475
+ message="Something went wrong."
476
+ :critical="true"
477
+ />
478
+ </template>
479
+ ```
480
+
481
+ ### Card
482
+
483
+ ```vue
484
+ <template>
485
+ <UiCard variant="pane">
486
+ <template #body>
487
+ <h3>Card Title</h3>
488
+ <p>Card content goes here...</p>
489
+ </template>
490
+ </UiCard>
491
+ </template>
492
+ ```
493
+
494
+ ### Accordion
495
+
496
+ ```vue
497
+ <template>
498
+ <UiAccordionGroup>
499
+ <UiAccordion title="Section 1" name="accordion-demo">
500
+ <template #content>
501
+ <p>Content for section 1</p>
502
+ </template>
503
+ </UiAccordion>
504
+
505
+ <UiAccordion title="Section 2" name="accordion-demo">
506
+ <template #content>
507
+ <p>Content for section 2</p>
508
+ </template>
509
+ </UiAccordion>
510
+ </UiAccordionGroup>
511
+ </template>
512
+ ```
513
+
514
+ ### Form Inputs
515
+
516
+ ```vue
517
+ <template>
518
+ <UiInputText
519
+ v-model="name"
520
+ label="Name"
521
+ placeholder="Enter your name"
522
+ />
523
+
524
+ <UiInputSelect
525
+ v-model="selected"
526
+ :options="options"
527
+ label="Choose option"
528
+ />
529
+
530
+ <UiInputCheck
531
+ v-model="agree"
532
+ label="I agree to terms"
533
+ />
534
+ </template>
535
+ ```
536
+
537
+ ## 🏗️ TypeScript Support
538
+
539
+ All components come with full TypeScript support. Import types as needed:
540
+
541
+ ```typescript
542
+ import type {
543
+ AlertType,
544
+ AlertVariant,
545
+ ButtonColor,
546
+ ButtonVariant
547
+ } from '@colorffy/ui'
548
+
549
+ // Use in your components
550
+ const variant: ButtonVariant = 'filled'
551
+ const color: ButtonColor = 'primary'
552
+ ```
553
+
554
+ ## 🎨 Styling
555
+
556
+ ### With Colorffy CSS (Recommended)
557
+
558
+ Colorffy UI is designed to work seamlessly with Colorffy CSS, which provides:
559
+ - Modern, responsive design system
560
+ - Consistent color palette with tonal variants
561
+ - Pre-built component styles
562
+ - Utility classes for rapid development
563
+ - Customizable themes with SCSS variables
564
+
565
+ Install Colorffy CSS and import it in your app:
566
+
567
+ ```bash
568
+ npm install @colorffy/css
569
+ ```
570
+
571
+ ```typescript
572
+ // main.ts
573
+ import '@colorffy/css'
574
+ ```
575
+
576
+ ### Custom Styling
577
+
578
+ All components use semantic class names that you can style:
579
+
580
+ ```css
581
+ /* Component classes */
582
+ .btn { /* Button styles */ }
583
+ .btn.btn-filled { /* Filled variant */ }
584
+ .btn.btn-primary { /* Primary color */ }
585
+
586
+ .card { /* Card styles */ }
587
+ .card.card-pane { /* Pane variant */ }
588
+
589
+ .alert { /* Alert styles */ }
590
+ .alert.alert-success { /* Success variant */ }
591
+
592
+ /* And more... */
593
+ ```
594
+
595
+ ### CSS Variable Overrides
596
+
597
+ Override CSS custom properties for runtime theming:
598
+
599
+ ```css
600
+ :root {
601
+ /* Theme colors */
602
+ --theme-primary-base: #4f46e5;
603
+ --theme-secondary-base: #ec4899;
604
+
605
+ /* Component variables */
606
+ --_btn-radius: 50px;
607
+ --_card-bg-color: #ffffff;
608
+ }
609
+ ```
610
+
611
+ For complete styling documentation, see the [Colorffy CSS README](https://www.npmjs.com/package/@colorffy/css).
612
+
613
+ ## 🔍 Browser Support
614
+
615
+ - Chrome (latest)
616
+ - Firefox (latest)
617
+ - Safari (latest)
618
+ - Edge (latest)
619
+
620
+ ## 🤝 Contributing
621
+
622
+ Contributions, issues, and feature requests are welcome!
623
+
624
+ Feel free to check the [issues page](https://github.com/giancarlosgza/colorffy-workspace/issues).
625
+
626
+ ## 📄 License
627
+
628
+ MIT © [Giancarlos Garza](https://github.com/giancarlosgza)
629
+
630
+ ## Author
631
+
632
+ Giancarlos Garza
633
+
634
+ ## Show your support
635
+
636
+ - [Colorffy UI](https://www.npmjs.com/package/@colorffy/ui)
637
+ - [Colorffy CSS](https://www.npmjs.com/package/@colorffy/css)
638
+
639
+ Give a ⭐️ if this project helped you!
640
+
641
+ ---
642
+
643
+ Made with ❤️ by [Giancarlos Garza](https://github.com/giancarlosgza) using Vue 3 and TypeScript.
644
+
645
+ Powered by [Colorffy](https://colorffy.com) 🎨