pns-component-library 1.5.12 → 1.5.13
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 +112 -112
- package/dist/pns-component-library.es.js +2135 -438
- package/dist/pns-component-library.umd.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ A comprehensive Vue 3 component library built with modern development practices,
|
|
|
8
8
|
- **2 Powerful Composables** - Reusable logic for common patterns
|
|
9
9
|
- **2 Custom Directives** - Loading states and UI enhancements
|
|
10
10
|
- **Vue 3 Composition API** - Modern, performant, and type-safe
|
|
11
|
-
- **Responsive
|
|
11
|
+
- **Fully Responsive UI & UX** - Components automatically adapt to all screen sizes with optimized mobile-first design and touch-friendly interactions
|
|
12
12
|
- **Accessibility** - ARIA attributes and keyboard navigation support
|
|
13
13
|
- **Customizable Themes** - Multiple built-in color schemes
|
|
14
14
|
|
|
@@ -75,76 +75,6 @@ const handleClick = () => {
|
|
|
75
75
|
|
|
76
76
|
### Form Components
|
|
77
77
|
|
|
78
|
-
#### Checkbox
|
|
79
|
-
Customizable checkbox with multiple themes and validation support.
|
|
80
|
-
|
|
81
|
-
##### Attributes
|
|
82
|
-
|
|
83
|
-
| Attribute | Description | Type | Default |
|
|
84
|
-
|-----------|-------------|------|---------|
|
|
85
|
-
| v-model / modelValue | binding value - `true` when checked, `false` when unchecked | `boolean` | `false` |
|
|
86
|
-
| label | checkbox label | `string` | — |
|
|
87
|
-
| size | checkbox size | `'small' \| 'medium'` | `'medium'` |
|
|
88
|
-
| built_in_theme | color theme | `'green' \| 'primary-blue' \| 'secondary-blue' \| 'red'` | `'green'` |
|
|
89
|
-
| customized_class | custom CSS class | `string` | — |
|
|
90
|
-
| disabled | whether checkbox is disabled | `boolean` | `false` |
|
|
91
|
-
| autofocus | whether to auto focus | `boolean` | `false` |
|
|
92
|
-
| indeterminate | whether checkbox is indeterminate | `boolean` | `false` |
|
|
93
|
-
|
|
94
|
-
##### Events
|
|
95
|
-
|
|
96
|
-
| Event | Description | Parameters |
|
|
97
|
-
|-------|-------------|------------|
|
|
98
|
-
| change | triggers when the binding value changes | `(value: boolean)` |
|
|
99
|
-
|
|
100
|
-
##### Exposes
|
|
101
|
-
|
|
102
|
-
| Method | Description | Type |
|
|
103
|
-
|--------|-------------|------|
|
|
104
|
-
| focus | focus the checkbox | `() => void` |
|
|
105
|
-
| blur | blur the checkbox | `() => void` |
|
|
106
|
-
| alert | show error message | `(message: string) => void` |
|
|
107
|
-
| removeAlertOrErrorEffect | clear error state | `() => void` |
|
|
108
|
-
|
|
109
|
-
```vue
|
|
110
|
-
<template>
|
|
111
|
-
<Checkbox
|
|
112
|
-
v-model="agreed"
|
|
113
|
-
label="I agree to terms"
|
|
114
|
-
built_in_theme="primary-blue"
|
|
115
|
-
@change="handleChange"
|
|
116
|
-
/>
|
|
117
|
-
</template>
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
#### GroupCheckbox
|
|
121
|
-
Container for managing multiple related checkboxes as a group.
|
|
122
|
-
|
|
123
|
-
##### Attributes
|
|
124
|
-
|
|
125
|
-
| Attribute | Description | Type | Default |
|
|
126
|
-
|-----------|-------------|------|---------|
|
|
127
|
-
| v-model / modelValue | binding value - array of selected checkbox labels from child Checkbox components | `array` | `[]` |
|
|
128
|
-
|
|
129
|
-
##### Events
|
|
130
|
-
|
|
131
|
-
| Event | Description | Parameters |
|
|
132
|
-
|-------|-------------|------------|
|
|
133
|
-
| change | triggers when the binding value changes | `(value: array)` |
|
|
134
|
-
|
|
135
|
-
```vue
|
|
136
|
-
<template>
|
|
137
|
-
<GroupCheckbox v-model="selectedItems">
|
|
138
|
-
<Checkbox v-for="item in options" :key="item" :label="item" />
|
|
139
|
-
</GroupCheckbox>
|
|
140
|
-
</template>
|
|
141
|
-
|
|
142
|
-
<script setup>
|
|
143
|
-
const selectedItems = ref(['option1'])
|
|
144
|
-
const options = ['option1', 'option2', 'option3']
|
|
145
|
-
</script>
|
|
146
|
-
```
|
|
147
|
-
|
|
148
78
|
#### AreaCodePhoneInput
|
|
149
79
|
International phone number input with country selection and area code handling.
|
|
150
80
|
|
|
@@ -231,47 +161,6 @@ Versatile input field component with validation and styling options.
|
|
|
231
161
|
</InputBox>
|
|
232
162
|
```
|
|
233
163
|
|
|
234
|
-
#### Radio
|
|
235
|
-
Radio button component for single selection from multiple options.
|
|
236
|
-
|
|
237
|
-
##### Attributes
|
|
238
|
-
|
|
239
|
-
| Attribute | Description | Type | Default |
|
|
240
|
-
|-----------|-------------|------|---------|
|
|
241
|
-
| v-model / modelValue | binding value - the `value` of the currently selected radio button in the group | `string` | — |
|
|
242
|
-
| value | radio value | `string` | — |
|
|
243
|
-
| label | radio label | `string` | — |
|
|
244
|
-
| name | group name for radio group | `string` | — |
|
|
245
|
-
| size | radio size | `'small' \| 'medium'` | `'medium'` |
|
|
246
|
-
| built_in_theme | color theme | `'primary-blue' \| 'secondary-blue' \| 'red'` | `'primary-blue'` |
|
|
247
|
-
| customized_class | custom CSS class | `string` | — |
|
|
248
|
-
| disabled | whether radio is disabled | `boolean` | `false` |
|
|
249
|
-
| autofocus | whether to auto focus | `boolean` | `false` |
|
|
250
|
-
|
|
251
|
-
##### Events
|
|
252
|
-
|
|
253
|
-
| Event | Description | Parameters |
|
|
254
|
-
|-------|-------------|------------|
|
|
255
|
-
| change | triggers when the binding value changes | `(value: string)` |
|
|
256
|
-
|
|
257
|
-
##### Exposes
|
|
258
|
-
|
|
259
|
-
| Method | Description | Type |
|
|
260
|
-
|--------|-------------|------|
|
|
261
|
-
| focus | focus the radio | `() => void` |
|
|
262
|
-
| blur | blur the radio | `() => void` |
|
|
263
|
-
| alert | show alert message | `(message: string) => void` |
|
|
264
|
-
| removeAlertOrErrorEffect | clear alert/error state | `() => void` |
|
|
265
|
-
|
|
266
|
-
```vue
|
|
267
|
-
<!-- Radio Group -->
|
|
268
|
-
<Radio v-model="selected" value="option1" name="group1" label="Option 1" />
|
|
269
|
-
<Radio v-model="selected" value="option2" name="group1" label="Option 2" />
|
|
270
|
-
|
|
271
|
-
<!-- Single Radio -->
|
|
272
|
-
<Radio v-model="single" value="yes" label="Agree to terms" />
|
|
273
|
-
```
|
|
274
|
-
|
|
275
164
|
#### SingleSelector
|
|
276
165
|
Dropdown selector component with filtering and search capabilities.
|
|
277
166
|
|
|
@@ -338,6 +227,117 @@ Dropdown selector component with filtering and search capabilities.
|
|
|
338
227
|
</SingleSelector>
|
|
339
228
|
```
|
|
340
229
|
|
|
230
|
+
#### Checkbox
|
|
231
|
+
Customizable checkbox with multiple themes and validation support.
|
|
232
|
+
|
|
233
|
+
##### Attributes
|
|
234
|
+
|
|
235
|
+
| Attribute | Description | Type | Default |
|
|
236
|
+
|-----------|-------------|------|---------|
|
|
237
|
+
| v-model / modelValue | binding value - `true` when checked, `false` when unchecked | `boolean` | `false` |
|
|
238
|
+
| label | checkbox label | `string` | — |
|
|
239
|
+
| size | checkbox size | `'small' \| 'medium'` | `'medium'` |
|
|
240
|
+
| built_in_theme | color theme | `'green' \| 'primary-blue' \| 'secondary-blue' \| 'red'` | `'green'` |
|
|
241
|
+
| customized_class | custom CSS class | `string` | — |
|
|
242
|
+
| disabled | whether checkbox is disabled | `boolean` | `false` |
|
|
243
|
+
| autofocus | whether to auto focus | `boolean` | `false` |
|
|
244
|
+
| indeterminate | whether checkbox is indeterminate | `boolean` | `false` |
|
|
245
|
+
|
|
246
|
+
##### Events
|
|
247
|
+
|
|
248
|
+
| Event | Description | Parameters |
|
|
249
|
+
|-------|-------------|------------|
|
|
250
|
+
| change | triggers when the binding value changes | `(value: boolean)` |
|
|
251
|
+
|
|
252
|
+
##### Exposes
|
|
253
|
+
|
|
254
|
+
| Method | Description | Type |
|
|
255
|
+
|--------|-------------|------|
|
|
256
|
+
| focus | focus the checkbox | `() => void` |
|
|
257
|
+
| blur | blur the checkbox | `() => void` |
|
|
258
|
+
| alert | show error message | `(message: string) => void` |
|
|
259
|
+
| removeAlertOrErrorEffect | clear error state | `() => void` |
|
|
260
|
+
|
|
261
|
+
```vue
|
|
262
|
+
<template>
|
|
263
|
+
<Checkbox
|
|
264
|
+
v-model="agreed"
|
|
265
|
+
label="I agree to terms"
|
|
266
|
+
built_in_theme="primary-blue"
|
|
267
|
+
@change="handleChange"
|
|
268
|
+
/>
|
|
269
|
+
</template>
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
#### GroupCheckbox
|
|
273
|
+
Container for managing multiple related checkboxes as a group.
|
|
274
|
+
|
|
275
|
+
##### Attributes
|
|
276
|
+
|
|
277
|
+
| Attribute | Description | Type | Default |
|
|
278
|
+
|-----------|-------------|------|---------|
|
|
279
|
+
| v-model / modelValue | binding value - array of selected checkbox labels from child Checkbox components | `array` | `[]` |
|
|
280
|
+
|
|
281
|
+
##### Events
|
|
282
|
+
|
|
283
|
+
| Event | Description | Parameters |
|
|
284
|
+
|-------|-------------|------------|
|
|
285
|
+
| change | triggers when the binding value changes | `(value: array)` |
|
|
286
|
+
|
|
287
|
+
```vue
|
|
288
|
+
<template>
|
|
289
|
+
<GroupCheckbox v-model="selectedItems">
|
|
290
|
+
<Checkbox v-for="item in options" :key="item" :label="item" />
|
|
291
|
+
</GroupCheckbox>
|
|
292
|
+
</template>
|
|
293
|
+
|
|
294
|
+
<script setup>
|
|
295
|
+
const selectedItems = ref(['option1'])
|
|
296
|
+
const options = ['option1', 'option2', 'option3']
|
|
297
|
+
</script>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
#### Radio
|
|
301
|
+
Radio button component for single selection from multiple options.
|
|
302
|
+
|
|
303
|
+
##### Attributes
|
|
304
|
+
|
|
305
|
+
| Attribute | Description | Type | Default |
|
|
306
|
+
|-----------|-------------|------|---------|
|
|
307
|
+
| v-model / modelValue | binding value - the `value` of the currently selected radio button in the group | `string` | — |
|
|
308
|
+
| value | radio value | `string` | — |
|
|
309
|
+
| label | radio label | `string` | — |
|
|
310
|
+
| name | group name for radio group | `string` | — |
|
|
311
|
+
| size | radio size | `'small' \| 'medium'` | `'medium'` |
|
|
312
|
+
| built_in_theme | color theme | `'primary-blue' \| 'secondary-blue' \| 'red'` | `'primary-blue'` |
|
|
313
|
+
| customized_class | custom CSS class | `string` | — |
|
|
314
|
+
| disabled | whether radio is disabled | `boolean` | `false` |
|
|
315
|
+
| autofocus | whether to auto focus | `boolean` | `false` |
|
|
316
|
+
|
|
317
|
+
##### Events
|
|
318
|
+
|
|
319
|
+
| Event | Description | Parameters |
|
|
320
|
+
|-------|-------------|------------|
|
|
321
|
+
| change | triggers when the binding value changes | `(value: string)` |
|
|
322
|
+
|
|
323
|
+
##### Exposes
|
|
324
|
+
|
|
325
|
+
| Method | Description | Type |
|
|
326
|
+
|--------|-------------|------|
|
|
327
|
+
| focus | focus the radio | `() => void` |
|
|
328
|
+
| blur | blur the radio | `() => void` |
|
|
329
|
+
| alert | show alert message | `(message: string) => void` |
|
|
330
|
+
| removeAlertOrErrorEffect | clear alert/error state | `() => void` |
|
|
331
|
+
|
|
332
|
+
```vue
|
|
333
|
+
<!-- Radio Group -->
|
|
334
|
+
<Radio v-model="selected" value="option1" name="group1" label="Option 1" />
|
|
335
|
+
<Radio v-model="selected" value="option2" name="group1" label="Option 2" />
|
|
336
|
+
|
|
337
|
+
<!-- Single Radio -->
|
|
338
|
+
<Radio v-model="single" value="yes" label="Agree to terms" />
|
|
339
|
+
```
|
|
340
|
+
|
|
341
341
|
### Interactive Components
|
|
342
342
|
|
|
343
343
|
#### ResponsiveButton
|