pns-component-library 1.5.12 → 1.5.14

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
@@ -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 Design** - Mobile-first approach with breakpoint handling
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,97 +75,38 @@ const handleClick = () => {
75
75
 
76
76
  ### Form Components
77
77
 
78
- #### Checkbox
79
- Customizable checkbox with multiple themes and validation support.
78
+ #### AreaCodePhoneInput
79
+ International phone number input with country selection and area code handling. Features automatic country flag display, smart focus management, and a clear button that appears on hover/focus.
80
80
 
81
81
  ##### Attributes
82
82
 
83
83
  | Attribute | Description | Type | Default |
84
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` |
85
+ | v-model / modelValue | binding value - object containing `area_code` (string) and `phone_number` (string) | `{area_code: string, phone_number: string}` | `{}` |
86
+ | country_options | custom country list with `country_name` and `country_code` properties | `Array<{country_name: string, country_code: string}>` | `[]` |
87
+ | enable_backup_country_options | use built-in country list when no custom options provided | `boolean` | `true` |
88
+ | country_filterable | enable country search/filtering in dropdown | `boolean` | `true` |
89
+ | disabled | whether input is disabled | `boolean` | `false` |
93
90
 
94
91
  ##### Events
95
92
 
96
93
  | Event | Description | Parameters |
97
94
  |-------|-------------|------------|
98
- | change | triggers when the binding value changes | `(value: boolean)` |
95
+ | change | triggers when the binding value changes | `{area_code: string, phone_number: string}` |
96
+ | focus | triggers when any part of the input gains focus | `{area_code: string, phone_number: string}` |
97
+ | blur | triggers when the entire input loses focus | `{area_code: string, phone_number: string}` |
98
+ | clear | triggers when clear button is clicked | `{area_code: string, phone_number: string}` |
99
99
 
100
100
  ##### Exposes
101
101
 
102
102
  | Method | Description | Type |
103
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
- #### AreaCodePhoneInput
149
- International phone number input with country selection and area code handling.
150
-
151
- ##### Attributes
152
-
153
- | Attribute | Description | Type | Default |
154
- |-----------|-------------|------|---------|
155
- | v-model / modelValue | binding value - object containing `area_code` (country code like "+1") and `phone_number` (local number) | `{area_code: string, phone_number: string}` | `{area_code: '', phone_number: ''}` |
156
- | country_options | custom country list | `array` | — |
157
- | enable_backup_country_options | use built-in country list | `boolean` | `true` |
158
- | country_filterable | enable country search | `boolean` | `true` |
159
- | disabled | whether input is disabled | `boolean` | `false` |
160
-
161
- ##### Events
162
-
163
- | Event | Description | Parameters |
164
- |-------|-------------|------------|
165
- | change | triggers when the binding value changes | `(value: object)` |
166
- | focus | triggers when input is focused | `(event: FocusEvent)` |
167
- | blur | triggers when input is blurred | `(event: FocusEvent)` |
168
- | clear | triggers when clear button is clicked | — |
104
+ | focus | focus the appropriate input (country selector if no country selected, phone input if country selected) | `() => void` |
105
+ | blur | blur both country selector and phone input | `() => void` |
106
+ | clear | clear both country selection and phone number | `() => void` |
107
+ | alert | show alert message below the input | `(message: string) => void` |
108
+ | error | show error message below the input | `(message: string) => void` |
109
+ | removeAlertOrErrorEffect | clear alert/error state and message | `() => void` |
169
110
 
170
111
  ```vue
171
112
  <template>
@@ -231,47 +172,6 @@ Versatile input field component with validation and styling options.
231
172
  </InputBox>
232
173
  ```
233
174
 
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
175
  #### SingleSelector
276
176
  Dropdown selector component with filtering and search capabilities.
277
177
 
@@ -338,6 +238,117 @@ Dropdown selector component with filtering and search capabilities.
338
238
  </SingleSelector>
339
239
  ```
340
240
 
241
+ #### Checkbox
242
+ Customizable checkbox with multiple themes and validation support.
243
+
244
+ ##### Attributes
245
+
246
+ | Attribute | Description | Type | Default |
247
+ |-----------|-------------|------|---------|
248
+ | v-model / modelValue | binding value - `true` when checked, `false` when unchecked | `boolean` | `false` |
249
+ | label | checkbox label | `string` | — |
250
+ | size | checkbox size | `'small' \| 'medium'` | `'medium'` |
251
+ | built_in_theme | color theme | `'green' \| 'primary-blue' \| 'secondary-blue' \| 'red'` | `'green'` |
252
+ | customized_class | custom CSS class | `string` | — |
253
+ | disabled | whether checkbox is disabled | `boolean` | `false` |
254
+ | autofocus | whether to auto focus | `boolean` | `false` |
255
+ | indeterminate | whether checkbox is indeterminate | `boolean` | `false` |
256
+
257
+ ##### Events
258
+
259
+ | Event | Description | Parameters |
260
+ |-------|-------------|------------|
261
+ | change | triggers when the binding value changes | `(value: boolean)` |
262
+
263
+ ##### Exposes
264
+
265
+ | Method | Description | Type |
266
+ |--------|-------------|------|
267
+ | focus | focus the checkbox | `() => void` |
268
+ | blur | blur the checkbox | `() => void` |
269
+ | alert | show error message | `(message: string) => void` |
270
+ | removeAlertOrErrorEffect | clear error state | `() => void` |
271
+
272
+ ```vue
273
+ <template>
274
+ <Checkbox
275
+ v-model="agreed"
276
+ label="I agree to terms"
277
+ built_in_theme="primary-blue"
278
+ @change="handleChange"
279
+ />
280
+ </template>
281
+ ```
282
+
283
+ #### GroupCheckbox
284
+ Container for managing multiple related checkboxes as a group.
285
+
286
+ ##### Attributes
287
+
288
+ | Attribute | Description | Type | Default |
289
+ |-----------|-------------|------|---------|
290
+ | v-model / modelValue | binding value - array of selected checkbox labels from child Checkbox components | `array` | `[]` |
291
+
292
+ ##### Events
293
+
294
+ | Event | Description | Parameters |
295
+ |-------|-------------|------------|
296
+ | change | triggers when the binding value changes | `(value: array)` |
297
+
298
+ ```vue
299
+ <template>
300
+ <GroupCheckbox v-model="selectedItems">
301
+ <Checkbox v-for="item in options" :key="item" :label="item" />
302
+ </GroupCheckbox>
303
+ </template>
304
+
305
+ <script setup>
306
+ const selectedItems = ref(['option1'])
307
+ const options = ['option1', 'option2', 'option3']
308
+ </script>
309
+ ```
310
+
311
+ #### Radio
312
+ Radio button component for single selection from multiple options.
313
+
314
+ ##### Attributes
315
+
316
+ | Attribute | Description | Type | Default |
317
+ |-----------|-------------|------|---------|
318
+ | v-model / modelValue | binding value - the `value` of the currently selected radio button in the group | `string` | — |
319
+ | value | radio value | `string` | — |
320
+ | label | radio label | `string` | — |
321
+ | name | group name for radio group | `string` | — |
322
+ | size | radio size | `'small' \| 'medium'` | `'medium'` |
323
+ | built_in_theme | color theme | `'primary-blue' \| 'secondary-blue' \| 'red'` | `'primary-blue'` |
324
+ | customized_class | custom CSS class | `string` | — |
325
+ | disabled | whether radio is disabled | `boolean` | `false` |
326
+ | autofocus | whether to auto focus | `boolean` | `false` |
327
+
328
+ ##### Events
329
+
330
+ | Event | Description | Parameters |
331
+ |-------|-------------|------------|
332
+ | change | triggers when the binding value changes | `(value: string)` |
333
+
334
+ ##### Exposes
335
+
336
+ | Method | Description | Type |
337
+ |--------|-------------|------|
338
+ | focus | focus the radio | `() => void` |
339
+ | blur | blur the radio | `() => void` |
340
+ | alert | show alert message | `(message: string) => void` |
341
+ | removeAlertOrErrorEffect | clear alert/error state | `() => void` |
342
+
343
+ ```vue
344
+ <!-- Radio Group -->
345
+ <Radio v-model="selected" value="option1" name="group1" label="Option 1" />
346
+ <Radio v-model="selected" value="option2" name="group1" label="Option 2" />
347
+
348
+ <!-- Single Radio -->
349
+ <Radio v-model="single" value="yes" label="Agree to terms" />
350
+ ```
351
+
341
352
  ### Interactive Components
342
353
 
343
354
  #### ResponsiveButton