@allsrvsonline/vue-component-library 0.5.0 → 0.6.1

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
@@ -15,7 +15,7 @@ A modern, type-safe Vue 3 component library built with TypeScript and Vite. This
15
15
  ## Installation
16
16
 
17
17
  ```bash
18
- npm install @your-org/vue-component-library
18
+ npm install @allsrvsonline/vue-component-library
19
19
  ```
20
20
 
21
21
  ## Usage
@@ -29,9 +29,15 @@ import {
29
29
  BaseSelect,
30
30
  BaseCard,
31
31
  CollapsibleCard,
32
- BaseDeleteButton
33
- } from '@your-org/vue-component-library'
34
- import '@your-org/vue-component-library/style.css'
32
+ BaseDeleteButton,
33
+ Header,
34
+ Title,
35
+ Logo,
36
+ Main,
37
+ Footer,
38
+ Copyright
39
+ } from '@allsrvsonline/vue-component-library'
40
+ import '@allsrvsonline/vue-component-library/style.css'
35
41
  ```
36
42
 
37
43
  ### Component Examples
@@ -44,7 +50,7 @@ import '@your-org/vue-component-library/style.css'
44
50
  </template>
45
51
 
46
52
  <script setup lang="ts">
47
- import { BaseButton } from '@your-org/vue-component-library'
53
+ import { BaseButton } from '@allsrvsonline/vue-component-library'
48
54
 
49
55
  const handleClick = () => {
50
56
  console.log('Button clicked!')
@@ -76,7 +82,7 @@ const handleClick = () => {
76
82
 
77
83
  <script setup lang="ts">
78
84
  import { ref } from 'vue'
79
- import { BaseInput } from '@your-org/vue-component-library'
85
+ import { BaseInput } from '@allsrvsonline/vue-component-library'
80
86
 
81
87
  const email = ref('')
82
88
  const emailError = ref('')
@@ -117,7 +123,7 @@ const emailError = ref('')
117
123
 
118
124
  <script setup lang="ts">
119
125
  import { ref } from 'vue'
120
- import { BaseSelect } from '@your-org/vue-component-library'
126
+ import { BaseSelect } from '@allsrvsonline/vue-component-library'
121
127
 
122
128
  const selectedFruit = ref('')
123
129
  const selectedCountry = ref('')
@@ -151,7 +157,7 @@ const countryError = ref('')
151
157
  </template>
152
158
 
153
159
  <script setup lang="ts">
154
- import { BaseCard, BaseButton } from '@your-org/vue-component-library'
160
+ import { BaseCard, BaseButton } from '@allsrvsonline/vue-component-library'
155
161
  </script>
156
162
  ```
157
163
 
@@ -169,7 +175,7 @@ import { BaseCard, BaseButton } from '@your-org/vue-component-library'
169
175
  </template>
170
176
 
171
177
  <script setup lang="ts">
172
- import { CollapsibleCard, BaseButton } from '@your-org/vue-component-library'
178
+ import { CollapsibleCard, BaseButton } from '@allsrvsonline/vue-component-library'
173
179
  </script>
174
180
  ```
175
181
 
@@ -190,7 +196,7 @@ import { CollapsibleCard, BaseButton } from '@your-org/vue-component-library'
190
196
  </template>
191
197
 
192
198
  <script setup lang="ts">
193
- import { BaseDeleteButton } from '@your-org/vue-component-library'
199
+ import { BaseDeleteButton } from '@allsrvsonline/vue-component-library'
194
200
 
195
201
  const handleDelete = () => {
196
202
  // Handle delete action
@@ -207,10 +213,138 @@ const handleDelete = () => {
207
213
  - `type`: `'button' | 'submit' | 'reset'` (default: `'button'`)
208
214
  - `ariaLabel`: `string` - Accessibility label (default: `'Delete'`)
209
215
 
216
+ #### Header
217
+
218
+ ```vue
219
+ <template>
220
+ <Header>
221
+ <template #left>
222
+ <Logo />
223
+ <Title title="My App" subtitle="Welcome" />
224
+ </template>
225
+ <template #middle>
226
+ <nav>
227
+ <BaseButton variant="secondary" size="small">Home</BaseButton>
228
+ <BaseButton variant="secondary" size="small">About</BaseButton>
229
+ </nav>
230
+ </template>
231
+ <template #right>
232
+ <BaseButton>Settings</BaseButton>
233
+ </template>
234
+ </Header>
235
+ </template>
236
+
237
+ <script setup lang="ts">
238
+ import { Header, Logo, Title, BaseButton } from '@allsrvsonline/vue-component-library'
239
+ </script>
240
+ ```
241
+
242
+ **Features:**
243
+
244
+ - Fixed positioning at the top of the page
245
+ - Responsive design with theme support
246
+ - Three named slots: left, middle, and right for proper content alignment
247
+ - Automatic spacing and centering of middle content
248
+ - Automatic theming (light/dark mode)
249
+
250
+ #### Title
251
+
252
+ ```vue
253
+ <template>
254
+ <Title title="My Application" subtitle="A modern Vue.js app" />
255
+ </template>
256
+
257
+ <script setup lang="ts">
258
+ import { Title } from '@allsrvsonline/vue-component-library'
259
+ </script>
260
+ ```
261
+
262
+ **Props:**
263
+
264
+ - `title`: `string` (default: `'TITLE PLACEHOLDER'`) - The main title text
265
+ - `subtitle`: `string` (optional) - The subtitle text (only rendered when provided)
266
+
267
+ #### Logo
268
+
269
+ ```vue
270
+ <template>
271
+ <Logo src="/path/to/logo.svg" alt="Company Logo" />
272
+ </template>
273
+
274
+ <script setup lang="ts">
275
+ import { Logo } from '@allsrvsonline/vue-component-library'
276
+ </script>
277
+ ```
278
+
279
+ **Props:**
280
+
281
+ - `src`: `string` (default: `'/logo.svg'`) - The image source path
282
+ - `alt`: `string` (default: `'Logo'`) - The alt text for accessibility
283
+
284
+ #### Main
285
+
286
+ ```vue
287
+ <template>
288
+ <Main>
289
+ <h1>Welcome to my app</h1>
290
+ <p>This is the main content area.</p>
291
+ </Main>
292
+ </template>
293
+
294
+ <script setup lang="ts">
295
+ import { Main } from '@allsrvsonline/vue-component-library'
296
+ </script>
297
+ ```
298
+
299
+ **Features:**
300
+
301
+ - Fixed positioning between header and footer
302
+ - Scrollable content area with proper overflow handling
303
+ - Responsive design with automatic spacing
304
+ - Accepts any content via slots
305
+
306
+ #### Footer
307
+
308
+ ```vue
309
+ <template>
310
+ <Footer>
311
+ <Copyright :startYear="2020" name="My Company" />
312
+ </Footer>
313
+ </template>
314
+
315
+ <script setup lang="ts">
316
+ import { Footer, Copyright } from '@allsrvsonline/vue-component-library'
317
+ </script>
318
+ ```
319
+
320
+ **Features:**
321
+
322
+ - Fixed positioning at the bottom of the page
323
+ - Responsive design with theme support
324
+ - Accepts any content via slots
325
+ - Automatic theming (light/dark mode)
326
+
327
+ #### Copyright
328
+
329
+ ```vue
330
+ <template>
331
+ <Copyright :startYear="2020" name="My Company" />
332
+ </template>
333
+
334
+ <script setup lang="ts">
335
+ import { Copyright } from '@allsrvsonline/vue-component-library'
336
+ </script>
337
+ ```
338
+
339
+ **Props:**
340
+
341
+ - `startYear`: `number` - The year the copyright started
342
+ - `name`: `string` - The company or person name
343
+
210
344
  ### Using Composables
211
345
 
212
346
  ```typescript
213
- import { useValidation, useClickOutside } from '@your-org/vue-component-library'
347
+ import { useValidation, useClickOutside } from '@allsrvsonline/vue-component-library'
214
348
 
215
349
  // Form validation
216
350
  const { value, error, validate } = useValidation('', (val) =>
@@ -227,7 +361,7 @@ useClickOutside(dropdownRef, () => {
227
361
  ### Using Utilities
228
362
 
229
363
  ```typescript
230
- import { cn, debounce, generateId } from '@your-org/vue-component-library'
364
+ import { cn, debounce, generateId } from '@allsrvsonline/vue-component-library'
231
365
 
232
366
  // Combine class names
233
367
  const classes = cn('btn', isActive && 'btn--active')
@@ -279,6 +413,22 @@ npm run type-check
279
413
  ```
280
414
  src/
281
415
  ├── components/ # Vue components
416
+ │ ├── base/ # Base components
417
+ │ │ └── header/
418
+ │ │ ├── Header.vue
419
+ │ │ ├── Header.spec.ts
420
+ │ │ ├── Title.vue
421
+ │ │ ├── Title.spec.ts
422
+ │ │ ├── Logo.vue
423
+ │ │ └── Logo.spec.ts
424
+ │ │ └── main/
425
+ │ │ ├── Main.vue
426
+ │ │ └── Main.spec.ts
427
+ │ │ └── footer/
428
+ │ │ ├── Footer.vue
429
+ │ │ ├── Footer.spec.ts
430
+ │ │ ├── Copyright.vue
431
+ │ │ └── Copyright.spec.ts
282
432
  │ ├── BaseButton.vue
283
433
  │ ├── BaseButton.spec.ts
284
434
  │ ├── BaseInput.vue
@@ -340,69 +490,3 @@ When contributing components:
340
490
  ## License
341
491
 
342
492
  MIT
343
-
344
- ## Publishing
345
-
346
- This project uses automated releases with conventional commits and GitHub Actions.
347
-
348
- ### Prerequisites
349
-
350
- Before publishing, ensure these GitHub repository variables are configured:
351
-
352
- 1. **NPM_TOKEN** - npm authentication token
353
- - Go to npmjs.com → Account Settings → Access Tokens → Generate New Token (Automation)
354
- - Add as repository variable: `NPM_TOKEN` (in Settings → Variables)
355
-
356
- 2. **GITHUB_TOKEN** - Automatically provided by GitHub Actions (no setup needed)
357
-
358
- 3. **GITHUB_TOKEN** - Automatically provided by GitHub Actions (no setup needed)
359
-
360
- ### Release Process
361
-
362
- Create releases using these npm scripts:
363
-
364
- ```bash
365
- # Patch release (0.3.1 → 0.3.2)
366
- npm run release:patch
367
-
368
- # Minor release (0.3.1 → 0.4.0)
369
- npm run release:minor
370
-
371
- # Major release (0.3.1 → 1.0.0)
372
- npm run release:major
373
-
374
- # Preview what would happen
375
- npm run release:dry-run
376
- ```
377
-
378
- The release process automatically:
379
-
380
- - ✅ Analyzes conventional commits
381
- - ✅ Bumps version in package.json
382
- - ✅ Updates CHANGELOG.md
383
- - ✅ Creates git commit and tag
384
- - ✅ Pushes to GitHub (triggers publish workflow)
385
- - ✅ Publishes to npm
386
- - ✅ Creates GitHub Release
387
-
388
- ### Conventional Commits
389
-
390
- Use these commit message formats:
391
-
392
- ```bash
393
- feat: add new component # → Minor version bump
394
- fix: resolve button bug # → Patch version bump
395
- docs: update README # → No version bump
396
- BREAKING CHANGE: api change # → Major version bump
397
- ```
398
-
399
- ### Manual Publishing
400
-
401
- If needed, you can still publish manually:
402
-
403
- ```bash
404
- npm run build:lib
405
- npm publish --access public
406
- ```
407
-
408
- Make sure to update `@your-org/vue-component-library` in package.json with your actual organization/package name.
package/dist/index.d.ts CHANGED
@@ -31,6 +31,12 @@ padding: boolean;
31
31
  initiallyCollapsed: boolean;
32
32
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
33
33
 
34
+ declare const __VLS_component_4: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLElement>;
35
+
36
+ declare const __VLS_component_5: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLElement>;
37
+
38
+ declare const __VLS_component_6: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLElement>;
39
+
34
40
  /**
35
41
  * BaseButton - A versatile button component with multiple variants and sizes
36
42
  *
@@ -76,12 +82,47 @@ declare function __VLS_template_3(): {
76
82
  rootEl: HTMLDivElement;
77
83
  };
78
84
 
85
+ declare function __VLS_template_4(): {
86
+ attrs: Partial<{}>;
87
+ slots: {
88
+ default?(_: {}): any;
89
+ icons?(_: {}): any;
90
+ };
91
+ refs: {};
92
+ rootEl: HTMLElement;
93
+ };
94
+
95
+ declare function __VLS_template_5(): {
96
+ attrs: Partial<{}>;
97
+ slots: {
98
+ default?(_: {}): any;
99
+ };
100
+ refs: {};
101
+ rootEl: HTMLElement;
102
+ };
103
+
104
+ declare function __VLS_template_6(): {
105
+ attrs: Partial<{}>;
106
+ slots: {
107
+ default?(_: {}): any;
108
+ icons?(_: {}): any;
109
+ };
110
+ refs: {};
111
+ rootEl: HTMLElement;
112
+ };
113
+
79
114
  declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
80
115
 
81
116
  declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
82
117
 
83
118
  declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
84
119
 
120
+ declare type __VLS_TemplateResult_4 = ReturnType<typeof __VLS_template_4>;
121
+
122
+ declare type __VLS_TemplateResult_5 = ReturnType<typeof __VLS_template_5>;
123
+
124
+ declare type __VLS_TemplateResult_6 = ReturnType<typeof __VLS_template_6>;
125
+
85
126
  declare type __VLS_WithTemplateSlots<T, S> = T & {
86
127
  new (): {
87
128
  $slots: S;
@@ -100,6 +141,24 @@ declare type __VLS_WithTemplateSlots_3<T, S> = T & {
100
141
  };
101
142
  };
102
143
 
144
+ declare type __VLS_WithTemplateSlots_4<T, S> = T & {
145
+ new (): {
146
+ $slots: S;
147
+ };
148
+ };
149
+
150
+ declare type __VLS_WithTemplateSlots_5<T, S> = T & {
151
+ new (): {
152
+ $slots: S;
153
+ };
154
+ };
155
+
156
+ declare type __VLS_WithTemplateSlots_6<T, S> = T & {
157
+ new (): {
158
+ $slots: S;
159
+ };
160
+ };
161
+
103
162
  export declare const BaseButton: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
104
163
 
105
164
  /**
@@ -467,6 +526,8 @@ declare interface CollapsibleCardProps_2 {
467
526
  initiallyCollapsed?: boolean;
468
527
  }
469
528
 
529
+ export declare const Copyright: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLParagraphElement>;
530
+
470
531
  /**
471
532
  * Debounces a function call
472
533
  *
@@ -476,6 +537,8 @@ declare interface CollapsibleCardProps_2 {
476
537
  */
477
538
  export declare function debounce<T extends (...args: unknown[]) => void>(fn: T, delay: number): (...args: Parameters<T>) => void;
478
539
 
540
+ export declare const Footer: __VLS_WithTemplateSlots_6<typeof __VLS_component_6, __VLS_TemplateResult_6["slots"]>;
541
+
479
542
  /**
480
543
  * Generates a unique ID
481
544
  *
@@ -484,6 +547,41 @@ export declare function debounce<T extends (...args: unknown[]) => void>(fn: T,
484
547
  */
485
548
  export declare function generateId(prefix?: string): string;
486
549
 
550
+ export declare const Header: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
551
+
552
+ export declare const Logo: DefineComponent<LogoProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<LogoProps> & Readonly<{}>, {
553
+ src: string;
554
+ alt: string;
555
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLImageElement>;
556
+
557
+ /**
558
+ * Logo - A component for displaying a logo image
559
+ *
560
+ * @example
561
+ * ```vue
562
+ * <Logo src="/path/to/logo.svg" alt="My Company Logo" />
563
+ * ```
564
+ */
565
+ declare interface LogoProps {
566
+ /**
567
+ * The source URL/path of the logo image
568
+ * @default '/logo.svg'
569
+ */
570
+ src?: string;
571
+ /**
572
+ * The alt text for the logo image (for accessibility)
573
+ * @default 'Logo'
574
+ */
575
+ alt?: string;
576
+ }
577
+
578
+ export declare const Main: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
579
+
580
+ declare interface Props {
581
+ startYear: number;
582
+ name: string;
583
+ }
584
+
487
585
  /**
488
586
  * Select option type - can be a simple value or an object with value and label
489
587
  */
@@ -492,6 +590,30 @@ export declare type SelectOption = string | number | {
492
590
  label: string;
493
591
  } | Record<string, unknown>;
494
592
 
593
+ export declare const Title: DefineComponent<TitleProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<TitleProps> & Readonly<{}>, {
594
+ title: string;
595
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
596
+
597
+ /**
598
+ * Title - A component for displaying a title and subtitle
599
+ *
600
+ * @example
601
+ * ```vue
602
+ * <Title title="My App" subtitle="Welcome to my application" />
603
+ * ```
604
+ */
605
+ declare interface TitleProps {
606
+ /**
607
+ * The main title text
608
+ * @default 'TITLE PLACEHOLDER'
609
+ */
610
+ title?: string;
611
+ /**
612
+ * The subtitle text (optional - will not render if not provided)
613
+ */
614
+ subtitle?: string;
615
+ }
616
+
495
617
  /**
496
618
  * Composable for detecting clicks outside an element
497
619
  *