@allsrvsonline/vue-component-library 0.4.1 → 0.6.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
@@ -23,7 +23,20 @@ npm install @your-org/vue-component-library
23
23
  ### Importing Components
24
24
 
25
25
  ```typescript
26
- import { BaseButton, BaseInput, BaseCard } from '@your-org/vue-component-library'
26
+ import {
27
+ BaseButton,
28
+ BaseInput,
29
+ BaseSelect,
30
+ BaseCard,
31
+ CollapsibleCard,
32
+ BaseDeleteButton,
33
+ Header,
34
+ Title,
35
+ Logo,
36
+ Main,
37
+ Footer,
38
+ Copyright
39
+ } from '@your-org/vue-component-library'
27
40
  import '@your-org/vue-component-library/style.css'
28
41
  ```
29
42
 
@@ -86,6 +99,50 @@ const emailError = ref('')
86
99
  - `disabled`: `boolean` (default: `false`)
87
100
  - `required`: `boolean` (default: `false`)
88
101
 
102
+ #### BaseSelect
103
+
104
+ ```vue
105
+ <template>
106
+ <BaseSelect
107
+ v-model="selectedFruit"
108
+ label="Favorite Fruit"
109
+ placeholder="Choose a fruit"
110
+ :options="['Apple', 'Banana', 'Orange']"
111
+ />
112
+
113
+ <BaseSelect
114
+ v-model="selectedCountry"
115
+ label="Country"
116
+ :options="[
117
+ { value: 'us', label: 'United States' },
118
+ { value: 'ca', label: 'Canada' }
119
+ ]"
120
+ :error="countryError"
121
+ />
122
+ </template>
123
+
124
+ <script setup lang="ts">
125
+ import { ref } from 'vue'
126
+ import { BaseSelect } from '@your-org/vue-component-library'
127
+
128
+ const selectedFruit = ref('')
129
+ const selectedCountry = ref('')
130
+ const countryError = ref('')
131
+ </script>
132
+ ```
133
+
134
+ **Props:**
135
+
136
+ - `modelValue`: `string | number` - The select value (v-model)
137
+ - `options`: `SelectOption[]` - Array of options to display
138
+ - `placeholder`: `string` - Placeholder text
139
+ - `disabled`: `boolean` (default: `false`)
140
+ - `required`: `boolean` (default: `false`)
141
+ - `label`: `string` - Select label
142
+ - `error`: `string` - Error message to display
143
+ - `labelField`: `string` (default: `'label'`) - Field name for label when options are objects
144
+ - `valueField`: `string` (default: `'value'`) - Field name for value when options are objects
145
+
89
146
  #### BaseCard
90
147
 
91
148
  ```vue
@@ -104,6 +161,186 @@ import { BaseCard, BaseButton } from '@your-org/vue-component-library'
104
161
  </script>
105
162
  ```
106
163
 
164
+ #### CollapsibleCard
165
+
166
+ ```vue
167
+ <template>
168
+ <CollapsibleCard title="Click to expand" :initiallyCollapsed="false" elevated>
169
+ <p>This content can be toggled</p>
170
+
171
+ <template #footer>
172
+ <BaseButton variant="primary">Action</BaseButton>
173
+ </template>
174
+ </CollapsibleCard>
175
+ </template>
176
+
177
+ <script setup lang="ts">
178
+ import { CollapsibleCard, BaseButton } from '@your-org/vue-component-library'
179
+ </script>
180
+ ```
181
+
182
+ **Props:**
183
+
184
+ - `title`: `string` - Card title
185
+ - `elevated`: `boolean` (default: `false`) - Whether the card has elevated shadow
186
+ - `padding`: `boolean` (default: `true`) - Whether the card has padding
187
+ - `initiallyCollapsed`: `boolean` (default: `true`) - Initial collapsed state
188
+
189
+ #### BaseDeleteButton
190
+
191
+ ```vue
192
+ <template>
193
+ <BaseDeleteButton @click="handleDelete" />
194
+ <BaseDeleteButton size="small" @click="handleDelete" />
195
+ <BaseDeleteButton :disabled="true" @click="handleDelete" />
196
+ </template>
197
+
198
+ <script setup lang="ts">
199
+ import { BaseDeleteButton } from '@your-org/vue-component-library'
200
+
201
+ const handleDelete = () => {
202
+ // Handle delete action
203
+ }
204
+ </script>
205
+ ```
206
+
207
+ **Props:**
208
+
209
+ - `size`: `'small' | 'medium' | 'large'` (default: `'medium'`)
210
+ - `disabled`: `boolean` (default: `false`)
211
+ - `loading`: `boolean` (default: `false`)
212
+ - `fullWidth`: `boolean` (default: `false`)
213
+ - `type`: `'button' | 'submit' | 'reset'` (default: `'button'`)
214
+ - `ariaLabel`: `string` - Accessibility label (default: `'Delete'`)
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 '@your-org/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 '@your-org/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 '@your-org/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 '@your-org/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 '@your-org/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 '@your-org/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
+
107
344
  ### Using Composables
108
345
 
109
346
  ```typescript
@@ -176,11 +413,34 @@ npm run type-check
176
413
  ```
177
414
  src/
178
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
179
432
  │ ├── BaseButton.vue
180
433
  │ ├── BaseButton.spec.ts
181
434
  │ ├── BaseInput.vue
182
435
  │ ├── BaseInput.spec.ts
183
- └── BaseCard.vue
436
+ ├── BaseSelect.vue
437
+ │ ├── BaseSelect.spec.ts
438
+ │ ├── BaseCard.vue
439
+ │ ├── BaseCard.spec.ts
440
+ │ ├── CollapsibleCard.vue
441
+ │ ├── CollapsibleCard.spec.ts
442
+ │ ├── BaseDeleteButton.vue
443
+ │ └── BaseDeleteButton.spec.ts
184
444
  ├── composables/ # Composable functions
185
445
  │ ├── useValidation.ts
186
446
  │ └── useClickOutside.ts
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
  /**
@@ -175,6 +234,58 @@ declare interface BaseCardProps {
175
234
  padding?: boolean;
176
235
  }
177
236
 
237
+ export declare const BaseDeleteButton: DefineComponent<BaseDeleteButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
238
+ click: (event: Event) => any;
239
+ }, string, PublicProps, Readonly<BaseDeleteButtonProps> & Readonly<{
240
+ onClick?: ((event: Event) => any) | undefined;
241
+ }>, {
242
+ size: ButtonSize;
243
+ disabled: boolean;
244
+ fullWidth: boolean;
245
+ loading: boolean;
246
+ type: "button" | "submit" | "reset";
247
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
248
+
249
+ /**
250
+ * BaseDeleteButton - A specialized delete button with trash icon
251
+ *
252
+ * @example
253
+ * ```vue
254
+ * <BaseDeleteButton @click="handleDelete" />
255
+ * ```
256
+ */
257
+ declare interface BaseDeleteButtonProps {
258
+ /**
259
+ * The size of the button
260
+ * @default 'medium'
261
+ */
262
+ size?: ButtonSize;
263
+ /**
264
+ * Whether the button is disabled
265
+ * @default false
266
+ */
267
+ disabled?: boolean;
268
+ /**
269
+ * Whether the button is in loading state
270
+ * @default false
271
+ */
272
+ loading?: boolean;
273
+ /**
274
+ * Whether the button should take full width
275
+ * @default false
276
+ */
277
+ fullWidth?: boolean;
278
+ /**
279
+ * The button type
280
+ * @default 'button'
281
+ */
282
+ type?: 'button' | 'submit' | 'reset';
283
+ /**
284
+ * Accessibility label for screen readers
285
+ */
286
+ ariaLabel?: string;
287
+ }
288
+
178
289
  export declare const BaseInput: DefineComponent<BaseInputProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
179
290
  "update:modelValue": (value: string) => any;
180
291
  focus: (event: FocusEvent) => any;
@@ -415,6 +526,8 @@ declare interface CollapsibleCardProps_2 {
415
526
  initiallyCollapsed?: boolean;
416
527
  }
417
528
 
529
+ export declare const Copyright: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLParagraphElement>;
530
+
418
531
  /**
419
532
  * Debounces a function call
420
533
  *
@@ -424,6 +537,8 @@ declare interface CollapsibleCardProps_2 {
424
537
  */
425
538
  export declare function debounce<T extends (...args: unknown[]) => void>(fn: T, delay: number): (...args: Parameters<T>) => void;
426
539
 
540
+ export declare const Footer: __VLS_WithTemplateSlots_6<typeof __VLS_component_6, __VLS_TemplateResult_6["slots"]>;
541
+
427
542
  /**
428
543
  * Generates a unique ID
429
544
  *
@@ -432,6 +547,41 @@ export declare function debounce<T extends (...args: unknown[]) => void>(fn: T,
432
547
  */
433
548
  export declare function generateId(prefix?: string): string;
434
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
+
435
585
  /**
436
586
  * Select option type - can be a simple value or an object with value and label
437
587
  */
@@ -440,6 +590,30 @@ export declare type SelectOption = string | number | {
440
590
  label: string;
441
591
  } | Record<string, unknown>;
442
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
+
443
617
  /**
444
618
  * Composable for detecting clicks outside an element
445
619
  *