@pequity/squirrel 8.4.4 → 8.5.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.
Files changed (175) hide show
  1. package/README.md +31 -1
  2. package/dist/cjs/chunks/index.js +530 -179
  3. package/dist/cjs/chunks/p-alert.js +14 -16
  4. package/dist/cjs/chunks/p-avatar.js +16 -0
  5. package/dist/cjs/chunks/p-btn.js +4 -1
  6. package/dist/cjs/chunks/p-card.js +4 -0
  7. package/dist/cjs/chunks/p-dropdown-select.js +34 -0
  8. package/dist/cjs/chunks/p-input-number.js +32 -0
  9. package/dist/cjs/chunks/p-input-percent.js +15 -4
  10. package/dist/cjs/chunks/p-input.js +28 -0
  11. package/dist/cjs/chunks/p-pagination-info.js +9 -5
  12. package/dist/cjs/chunks/p-pagination.js +23 -13
  13. package/dist/cjs/chunks/p-select-btn.js +2 -1
  14. package/dist/cjs/chunks/p-select.js +33 -0
  15. package/dist/cjs/chunks/p-table-loader.js +20 -0
  16. package/dist/cjs/chunks/p-tabs.js +12 -0
  17. package/dist/cjs/chunks/p-textarea.js +20 -0
  18. package/dist/cjs/index.js +72 -29
  19. package/dist/cjs/inputClasses.js +3 -3
  20. package/dist/cjs/p-checkbox.js +8 -1
  21. package/dist/cjs/p-chips.js +17 -1
  22. package/dist/cjs/p-close-btn.js +6 -1
  23. package/dist/cjs/p-drawer.js +90 -2
  24. package/dist/cjs/p-dropdown.js +2 -1
  25. package/dist/cjs/p-icon.js +2 -1
  26. package/dist/cjs/p-input-search.js +13 -1
  27. package/dist/cjs/p-loading.js +3 -3
  28. package/dist/cjs/p-modal.js +125 -43
  29. package/dist/cjs/p-select-pill.js +36 -2
  30. package/dist/cjs/p-skeleton-loader.js +17 -1
  31. package/dist/cjs/p-table-filter-icon.js +4 -1
  32. package/dist/cjs/p-table-header-cell.js +32 -2
  33. package/dist/cjs/p-table-td.js +1 -1
  34. package/dist/cjs/p-table.js +2 -0
  35. package/dist/cjs/p-toggle.js +22 -1
  36. package/dist/cjs/usePTableHeaderWrap.js +38 -0
  37. package/dist/es/chunks/index.js +530 -179
  38. package/dist/es/chunks/p-alert.js +14 -16
  39. package/dist/es/chunks/p-avatar.js +16 -0
  40. package/dist/es/chunks/p-btn.js +5 -2
  41. package/dist/es/chunks/p-card.js +4 -0
  42. package/dist/es/chunks/p-dropdown-select.js +34 -0
  43. package/dist/es/chunks/p-input-number.js +32 -0
  44. package/dist/es/chunks/p-input-percent.js +15 -4
  45. package/dist/es/chunks/p-input.js +28 -0
  46. package/dist/es/chunks/p-pagination-info.js +9 -5
  47. package/dist/es/chunks/p-pagination.js +24 -14
  48. package/dist/es/chunks/p-select-btn.js +2 -1
  49. package/dist/es/chunks/p-select.js +33 -0
  50. package/dist/es/chunks/p-table-loader.js +20 -0
  51. package/dist/es/chunks/p-tabs.js +12 -0
  52. package/dist/es/chunks/p-textarea.js +20 -0
  53. package/dist/es/index.js +77 -34
  54. package/dist/es/inputClasses.js +4 -4
  55. package/dist/es/p-checkbox.js +8 -1
  56. package/dist/es/p-chips.js +17 -1
  57. package/dist/es/p-close-btn.js +6 -1
  58. package/dist/es/p-drawer.js +90 -2
  59. package/dist/es/p-dropdown.js +2 -1
  60. package/dist/es/p-icon.js +2 -1
  61. package/dist/es/p-input-search.js +13 -1
  62. package/dist/es/p-loading.js +3 -3
  63. package/dist/es/p-modal.js +125 -43
  64. package/dist/es/p-select-pill.js +36 -2
  65. package/dist/es/p-skeleton-loader.js +17 -1
  66. package/dist/es/p-table-filter-icon.js +4 -1
  67. package/dist/es/p-table-header-cell.js +32 -2
  68. package/dist/es/p-table-td.js +1 -1
  69. package/dist/es/p-table.js +2 -0
  70. package/dist/es/p-toggle.js +22 -1
  71. package/dist/es/usePTableHeaderWrap.js +38 -0
  72. package/dist/squirrel/components/p-action-bar/p-action-bar.vue.d.ts +15 -3
  73. package/dist/squirrel/components/p-alert/p-alert.vue.d.ts +18 -5
  74. package/dist/squirrel/components/p-avatar/p-avatar.vue.d.ts +36 -1
  75. package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +21 -5
  76. package/dist/squirrel/components/p-card/p-card.vue.d.ts +21 -8
  77. package/dist/squirrel/components/p-checkbox/p-checkbox.vue.d.ts +26 -8
  78. package/dist/squirrel/components/p-chips/p-chips.vue.d.ts +24 -0
  79. package/dist/squirrel/components/p-close-btn/p-close-btn.vue.d.ts +14 -1
  80. package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +17 -1
  81. package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +153 -15
  82. package/dist/squirrel/components/p-dropdown/p-dropdown.vue.d.ts +11 -2
  83. package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +70 -2
  84. package/dist/squirrel/components/p-file-upload/p-file-upload.vue.d.ts +71 -7
  85. package/dist/squirrel/components/p-icon/p-icon.types.d.ts +1 -0
  86. package/dist/squirrel/components/p-icon/p-icon.vue.d.ts +5 -1
  87. package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +12 -5
  88. package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +28 -8
  89. package/dist/squirrel/components/p-input/p-input.vue.d.ts +74 -9
  90. package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +83 -12
  91. package/dist/squirrel/components/p-input-percent/p-input-percent.vue.d.ts +23 -3
  92. package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +25 -1
  93. package/dist/squirrel/components/p-link/p-link.vue.d.ts +1 -1
  94. package/dist/squirrel/components/p-loading/p-loading.vue.d.ts +1 -1
  95. package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +190 -16
  96. package/dist/squirrel/components/p-pagination/p-pagination.vue.d.ts +23 -13
  97. package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +17 -9
  98. package/dist/squirrel/components/p-progress-bar/p-progress-bar.vue.d.ts +21 -1
  99. package/dist/squirrel/components/p-ring-loader/p-ring-loader.vue.d.ts +11 -1
  100. package/dist/squirrel/components/p-select/p-select.vue.d.ts +77 -7
  101. package/dist/squirrel/components/p-select-btn/p-select-btn.vue.d.ts +68 -11
  102. package/dist/squirrel/components/p-select-list/p-select-list.vue.d.ts +2 -2
  103. package/dist/squirrel/components/p-select-pill/p-select-pill.vue.d.ts +72 -2
  104. package/dist/squirrel/components/p-skeleton-loader/p-skeleton-loader.vue.d.ts +40 -0
  105. package/dist/squirrel/components/p-steps/p-steps.vue.d.ts +13 -1
  106. package/dist/squirrel/components/p-table/p-table.types.d.ts +1 -0
  107. package/dist/squirrel/components/p-table/p-table.vue.d.ts +33 -1
  108. package/dist/squirrel/components/p-table/usePTableHeaderWrap.d.ts +4 -0
  109. package/dist/squirrel/components/p-table-header-cell/p-table-filter-icon.vue.d.ts +7 -1
  110. package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +59 -4
  111. package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +41 -1
  112. package/dist/squirrel/components/p-table-sort/p-table-sort.vue.d.ts +13 -3
  113. package/dist/squirrel/components/p-table-td/p-table-td.vue.d.ts +13 -1
  114. package/dist/squirrel/components/p-tabs/p-tabs.vue.d.ts +34 -3
  115. package/dist/squirrel/components/p-tabs-pills/p-tabs-pills.vue.d.ts +23 -1
  116. package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +53 -9
  117. package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +51 -4
  118. package/dist/squirrel.css +68 -68
  119. package/package.json +24 -22
  120. package/squirrel/components/p-action-bar/p-action-bar.stories.js +5 -5
  121. package/squirrel/components/p-action-bar/p-action-bar.vue +30 -3
  122. package/squirrel/components/p-alert/p-alert.spec.js +4 -4
  123. package/squirrel/components/p-alert/p-alert.stories.js +19 -13
  124. package/squirrel/components/p-alert/p-alert.vue +33 -11
  125. package/squirrel/components/p-avatar/p-avatar.vue +28 -0
  126. package/squirrel/components/p-btn/p-btn.vue +35 -0
  127. package/squirrel/components/p-card/p-card.vue +24 -1
  128. package/squirrel/components/p-checkbox/p-checkbox.vue +23 -1
  129. package/squirrel/components/p-chips/p-chips.vue +24 -0
  130. package/squirrel/components/p-close-btn/p-close-btn.vue +15 -0
  131. package/squirrel/components/p-date-picker/p-date-picker.vue +23 -1
  132. package/squirrel/components/p-drawer/p-drawer.vue +95 -0
  133. package/squirrel/components/p-dropdown/p-dropdown.vue +12 -1
  134. package/squirrel/components/p-dropdown-select/p-dropdown-select.vue +41 -0
  135. package/squirrel/components/p-file-upload/p-file-upload.vue +58 -3
  136. package/squirrel/components/p-icon/p-icon.types.ts +1 -0
  137. package/squirrel/components/p-icon/p-icon.vue +16 -0
  138. package/squirrel/components/p-info-icon/p-info-icon.vue +19 -0
  139. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue +32 -0
  140. package/squirrel/components/p-input/p-input.vue +61 -1
  141. package/squirrel/components/p-input-number/p-input-number.vue +78 -1
  142. package/squirrel/components/p-input-percent/p-input-percent.vue +27 -3
  143. package/squirrel/components/p-input-search/p-input-search.vue +30 -2
  144. package/squirrel/components/p-link/p-link.vue +13 -0
  145. package/squirrel/components/p-loading/p-loading.vue +9 -2
  146. package/squirrel/components/p-modal/p-modal-basic.spec.js +29 -3
  147. package/squirrel/components/p-modal/p-modal.vue +182 -35
  148. package/squirrel/components/p-pagination/p-pagination.vue +28 -8
  149. package/squirrel/components/p-pagination-info/p-pagination-info.vue +16 -4
  150. package/squirrel/components/p-progress-bar/p-progress-bar.vue +31 -4
  151. package/squirrel/components/p-ring-loader/p-ring-loader.vue +17 -0
  152. package/squirrel/components/p-select/p-select.vue +50 -1
  153. package/squirrel/components/p-select-btn/p-select-btn.vue +90 -2
  154. package/squirrel/components/p-select-list/p-select-list.vue +7 -0
  155. package/squirrel/components/p-select-pill/p-select-pill.vue +52 -2
  156. package/squirrel/components/p-skeleton-loader/p-skeleton-loader.vue +24 -0
  157. package/squirrel/components/p-steps/p-steps.vue +25 -0
  158. package/squirrel/components/p-table/p-table.spec.js +51 -15
  159. package/squirrel/components/p-table/p-table.types.ts +2 -0
  160. package/squirrel/components/p-table/p-table.vue +46 -4
  161. package/squirrel/components/p-table/usePTableHeaderWrap.spec.js +118 -0
  162. package/squirrel/components/p-table/usePTableHeaderWrap.ts +45 -0
  163. package/squirrel/components/p-table-header-cell/p-table-filter-icon.vue +9 -0
  164. package/squirrel/components/p-table-header-cell/p-table-header-cell.spec.js +5 -1
  165. package/squirrel/components/p-table-header-cell/p-table-header-cell.vue +38 -1
  166. package/squirrel/components/p-table-loader/p-table-loader.vue +28 -0
  167. package/squirrel/components/p-table-sort/p-table-sort.vue +19 -1
  168. package/squirrel/components/p-table-td/p-table-td.vue +20 -0
  169. package/squirrel/components/p-tabs/p-tabs.stories.js +2 -2
  170. package/squirrel/components/p-tabs/p-tabs.vue +33 -1
  171. package/squirrel/components/p-tabs-pills/p-tabs-pills.vue +33 -0
  172. package/squirrel/components/p-textarea/p-textarea.vue +43 -1
  173. package/squirrel/components/p-toggle/p-toggle.vue +44 -1
  174. package/squirrel/assets/pagination-left-icon.svg +0 -5
  175. package/squirrel/assets/pagination-right-icon.svg +0 -5
@@ -1,12 +1,11 @@
1
1
  import { defineComponent, createElementBlock, openBlock, normalizeClass, createElementVNode, renderSlot, createVNode } from "vue";
2
2
  import { _ as _sfc_main$1 } from "./p-icon.js";
3
- const _hoisted_1 = { class: "flex" };
4
- const _hoisted_2 = { class: "pr-2" };
3
+ const _hoisted_1 = { class: "flex items-center gap-4" };
5
4
  const ALERT_TYPES = {
6
- info: { classes: `bg-info text-on-info`, icon: "streamline:information-circle-solid" },
7
- warning: { classes: `bg-warning text-on-warning`, icon: "streamline:warning-triangle-solid" },
8
- error: { classes: `bg-error text-on-error`, icon: "streamline:warning-octagon-solid" },
9
- success: { classes: `bg-success text-on-success`, icon: "streamline:check-square-solid" }
5
+ info: { classes: `bg-info text-on-info`, icon: "material-symbols:info-outline" },
6
+ warning: { classes: `bg-warning text-on-warning`, icon: "warning" },
7
+ error: { classes: `bg-error text-on-error`, icon: "cancel-circle" },
8
+ success: { classes: `bg-success text-on-success`, icon: "ok-circle" }
10
9
  };
11
10
  const _sfc_main = /* @__PURE__ */ defineComponent({
12
11
  ...{
@@ -14,6 +13,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14
13
  },
15
14
  __name: "p-alert",
16
15
  props: {
16
+ /**
17
+ * The type of the alert which determines its appearance and icon
18
+ */
17
19
  type: {
18
20
  type: String,
19
21
  default: "info",
@@ -26,19 +28,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26
28
  const props = __props;
27
29
  return (_ctx, _cache) => {
28
30
  return openBlock(), createElementBlock("div", {
29
- class: normalizeClass(["rounded p-4 text-xs font-semibold", ALERT_TYPES[props.type].classes]),
31
+ class: normalizeClass(["rounded-lg p-4 text-xs font-semibold", ALERT_TYPES[props.type].classes]),
30
32
  role: "alert"
31
33
  }, [
32
34
  createElementVNode("div", _hoisted_1, [
33
- createElementVNode("div", _hoisted_2, [
34
- renderSlot(_ctx.$slots, "icon", {}, () => [
35
- createVNode(_sfc_main$1, {
36
- icon: ALERT_TYPES[props.type].icon,
37
- width: "16",
38
- class: "-mb-0.5",
39
- inline: ""
40
- }, null, 8, ["icon"])
41
- ])
35
+ renderSlot(_ctx.$slots, "icon", {}, () => [
36
+ createVNode(_sfc_main$1, {
37
+ icon: ALERT_TYPES[props.type].icon,
38
+ width: "20"
39
+ }, null, 8, ["icon"])
42
40
  ]),
43
41
  createElementVNode("div", null, [
44
42
  renderSlot(_ctx.$slots, "default")
@@ -11,23 +11,39 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
11
11
  },
12
12
  __name: "p-avatar",
13
13
  props: {
14
+ /**
15
+ * The shape of the avatar
16
+ */
14
17
  shape: {
15
18
  type: String,
16
19
  default: "circle",
17
20
  validator: (value) => SHAPES.includes(value)
18
21
  },
22
+ /**
23
+ * URL of the image to display
24
+ */
19
25
  imageSrc: {
20
26
  type: String,
21
27
  default: ""
22
28
  },
29
+ /**
30
+ * Text to display when image is not available
31
+ * Also used as the alt text for the image
32
+ */
23
33
  label: {
24
34
  type: String,
25
35
  required: true
26
36
  },
37
+ /**
38
+ * Additional CSS classes to apply to the image
39
+ */
27
40
  imageClass: {
28
41
  type: String,
29
42
  default: ""
30
43
  },
44
+ /**
45
+ * Additional CSS classes to apply to the label container
46
+ */
31
47
  labelClass: {
32
48
  type: String,
33
49
  default: ""
@@ -4,7 +4,7 @@ import { _ as _sfc_main$1 } from "./p-icon.js";
4
4
  import { _ as _sfc_main$2 } from "./p-ring-loader.js";
5
5
  import { isExternalLink } from "../link.js";
6
6
  import { sanitizeUrl } from "../sanitization.js";
7
- import { c as ce } from "./index.js";
7
+ import { T } from "./index.js";
8
8
  const _hoisted_1 = { class: "slot-wrapper empty:hidden" };
9
9
  const btnClasses = {
10
10
  slots: {
@@ -68,7 +68,7 @@ const btnClasses = {
68
68
  size: "md"
69
69
  }
70
70
  };
71
- const btn = ce(btnClasses);
71
+ const btn = T(btnClasses);
72
72
  const BUTTON_TYPES = Object.keys(btnClasses.variants.type);
73
73
  const BUTTON_NATIVE_TYPES = ["button", "submit", "reset"];
74
74
  const LOADER_SIZES = { sm: 24, md: 30, lg: 40 };
@@ -137,6 +137,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
137
137
  type: String,
138
138
  default: ""
139
139
  },
140
+ /**
141
+ * The icon to display on the right side of the button
142
+ */
140
143
  iconRight: {
141
144
  type: String,
142
145
  default: ""
@@ -5,6 +5,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
5
5
  ...{ name: "PCard" },
6
6
  __name: "p-card",
7
7
  props: {
8
+ /**
9
+ * The title of the card - displayed at the top
10
+ * If not provided, you can use the title slot instead
11
+ */
8
12
  title: {
9
13
  type: String,
10
14
  default: ""
@@ -48,6 +48,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
48
48
  },
49
49
  __name: "p-dropdown-select",
50
50
  props: {
51
+ /**
52
+ * The selected value(s) for the dropdown (v-model).
53
+ * Can be a single value or array of values depending on multiple prop.
54
+ */
51
55
  modelValue: {
52
56
  type: [String, Number, Boolean, Array, Object],
53
57
  default: null
@@ -69,18 +73,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
69
73
  type: Array,
70
74
  default: () => []
71
75
  },
76
+ /**
77
+ * Label text displayed above the dropdown.
78
+ */
72
79
  label: {
73
80
  type: String,
74
81
  default: ""
75
82
  },
83
+ /**
84
+ * Error message to display below the dropdown.
85
+ */
76
86
  errorMsg: {
77
87
  type: String,
78
88
  default: ""
79
89
  },
90
+ /**
91
+ * Whether the field is required.
92
+ */
80
93
  required: {
81
94
  type: Boolean,
82
95
  default: false
83
96
  },
97
+ /**
98
+ * The size of the dropdown component.
99
+ */
84
100
  size: {
85
101
  type: String,
86
102
  default: "md",
@@ -117,26 +133,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
117
133
  type: Number,
118
134
  default: 7
119
135
  },
136
+ /**
137
+ * Additional attributes to apply to the dropdown menu.
138
+ */
120
139
  dropdownMenuAttrs: {
121
140
  type: Object,
122
141
  default: () => ({})
123
142
  },
143
+ /**
144
+ * CSS classes to apply to the dropdown menu.
145
+ */
124
146
  dropdownMenuClass: {
125
147
  type: String,
126
148
  default: "overflow-x-hidden"
127
149
  },
150
+ /**
151
+ * Inline styles to apply to the dropdown menu.
152
+ */
128
153
  dropdownMenuStyle: {
129
154
  type: Object,
130
155
  default: () => ({})
131
156
  },
157
+ /**
158
+ * Props to pass to the underlying PDropdown component.
159
+ */
132
160
  pDropdownProps: {
133
161
  type: Object,
134
162
  default: () => ({})
135
163
  },
164
+ /**
165
+ * Whether to enable search functionality within the dropdown.
166
+ */
136
167
  searchable: {
137
168
  type: Boolean,
138
169
  default: false
139
170
  },
171
+ /**
172
+ * Whether to show a clear button when items are selected.
173
+ */
140
174
  clearable: {
141
175
  type: Boolean,
142
176
  default: false
@@ -16,22 +16,42 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
16
  },
17
17
  __name: "p-input-number",
18
18
  props: {
19
+ /**
20
+ * The current numeric value of the input (v-model).
21
+ * Supports two-way binding for form inputs.
22
+ */
19
23
  modelValue: {
20
24
  type: [Number, String],
21
25
  default: null
22
26
  },
27
+ /**
28
+ * Text label for the input field.
29
+ * If not provided, you can use the label slot instead.
30
+ */
23
31
  label: {
24
32
  type: String,
25
33
  default: ""
26
34
  },
35
+ /**
36
+ * Error message to display below the input.
37
+ * When provided, the input will show error styling.
38
+ */
27
39
  errorMsg: {
28
40
  type: String,
29
41
  default: ""
30
42
  },
43
+ /**
44
+ * Whether the input is required.
45
+ * Adds required attribute and visual indicator.
46
+ */
31
47
  required: {
32
48
  type: Boolean,
33
49
  default: false
34
50
  },
51
+ /**
52
+ * The size of the input - affects padding, font size, and spacing.
53
+ * Valid values: 'sm', 'md', 'lg'
54
+ */
35
55
  size: {
36
56
  type: String,
37
57
  default: "md",
@@ -39,14 +59,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
59
  return SIZES.includes(value);
40
60
  }
41
61
  },
62
+ /**
63
+ * Whether to select all text when the input receives focus.
64
+ * Provides better UX for number input fields.
65
+ */
42
66
  selectOnClick: {
43
67
  type: Boolean,
44
68
  default: true
45
69
  },
70
+ /**
71
+ * Text for the info tooltip displayed next to the label.
72
+ * Uses PInfoIcon component for consistent tooltip styling.
73
+ */
46
74
  tooltipText: {
47
75
  type: String,
48
76
  default: ""
49
77
  },
78
+ /**
79
+ * String to display as prefix in the input field.
80
+ * Can be overridden by the prefix slot for custom content.
81
+ */
50
82
  prefixString: {
51
83
  type: String,
52
84
  default: ""
@@ -1,5 +1,6 @@
1
1
  import { defineComponent, computed, createBlock, openBlock, withCtx, createElementVNode, normalizeClass } from "vue";
2
2
  import { _ as _sfc_main$1 } from "./p-input-number.js";
3
+ import { toNumberOrNull } from "../number.js";
3
4
  import { isNumber } from "lodash-es";
4
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
6
  ...{
@@ -7,10 +8,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7
8
  },
8
9
  __name: "p-input-percent",
9
10
  props: {
11
+ /**
12
+ * The current value (v-model).
13
+ * Stored as a decimal (0.5 = 50%) but displayed as a percentage.
14
+ * Supports two-way binding for form inputs.
15
+ */
10
16
  modelValue: {
11
17
  type: [Number, String],
12
18
  default: null
13
19
  },
20
+ /**
21
+ * The size of the input field.
22
+ * Valid values: 'sm', 'md', 'lg'
23
+ * @values sm, md, lg
24
+ */
14
25
  size: {
15
26
  type: String,
16
27
  default: "md"
@@ -26,8 +37,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26
37
  const props = __props;
27
38
  const emit = __emit;
28
39
  const convertedValue = computed({
29
- get: () => isNumber(props.modelValue) ? props.modelValue * 100 : props.modelValue,
30
- set: (nV) => emit("update:modelValue", isNumber(nV) ? nV / 100 : nV)
40
+ get: () => isNumber(props.modelValue) ? props.modelValue * 100 : toNumberOrNull(props.modelValue),
41
+ set: (nV) => emit("update:modelValue", isNumber(nV) ? nV / 100 : toNumberOrNull(nV))
31
42
  });
32
43
  return (_ctx, _cache) => {
33
44
  return openBlock(), createBlock(_sfc_main$1, {
@@ -38,9 +49,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
49
  prefix: withCtx(() => [
39
50
  createElementVNode("div", {
40
51
  class: normalizeClass(["absolute flex items-center", prefixClasses[__props.size]])
41
- }, _cache[1] || (_cache[1] = [
52
+ }, [..._cache[1] || (_cache[1] = [
42
53
  createElementVNode("div", null, "%", -1)
43
- ]), 2)
54
+ ])], 2)
44
55
  ]),
45
56
  _: 1
46
57
  }, 8, ["modelValue", "size"]);
@@ -14,10 +14,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14
14
  },
15
15
  __name: "p-input",
16
16
  props: {
17
+ /**
18
+ * The current value of the input (v-model).
19
+ * Supports two-way binding for form inputs.
20
+ */
17
21
  modelValue: {
18
22
  type: [String, Number, Boolean, null],
19
23
  default: ""
20
24
  },
25
+ /**
26
+ * The type of the input field.
27
+ * Valid values: 'text', 'password'
28
+ */
21
29
  type: {
22
30
  type: String,
23
31
  default: INPUT_TYPES.TEXT,
@@ -25,18 +33,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25
33
  return Object.values(INPUT_TYPES).includes(value);
26
34
  }
27
35
  },
36
+ /**
37
+ * Text label for the input field.
38
+ * If not provided, you can use the label slot instead.
39
+ */
28
40
  label: {
29
41
  type: String,
30
42
  default: ""
31
43
  },
44
+ /**
45
+ * Error message to display below the input.
46
+ * When provided, the input will show error styling.
47
+ */
32
48
  errorMsg: {
33
49
  type: String,
34
50
  default: ""
35
51
  },
52
+ /**
53
+ * Whether the input is required.
54
+ * Adds required attribute and visual indicator.
55
+ */
36
56
  required: {
37
57
  type: Boolean,
38
58
  default: false
39
59
  },
60
+ /**
61
+ * The size of the input - affects padding, font size, and spacing.
62
+ * Valid values: 'sm', 'md', 'lg'
63
+ */
40
64
  size: {
41
65
  type: String,
42
66
  default: "md",
@@ -44,6 +68,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
44
68
  return SIZES.includes(value);
45
69
  }
46
70
  },
71
+ /**
72
+ * Whether the input has rounded corners.
73
+ * Applies rounded styling to the input field.
74
+ */
47
75
  rounded: {
48
76
  type: Boolean,
49
77
  default: false
@@ -9,28 +9,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
9
9
  __name: "p-pagination-info",
10
10
  props: {
11
11
  /**
12
- * The current page.
12
+ * The current page number (1-based).
13
+ * Used to calculate the starting item number in the display range.
13
14
  */
14
15
  currentPage: {
15
16
  type: Number,
16
17
  default: 0
17
18
  },
18
19
  /**
19
- * The amount of data pagination iterates through.
20
+ * The total number of items across all pages.
21
+ * Used to calculate the total count and ending item number.
20
22
  */
21
23
  count: {
22
24
  type: Number,
23
25
  default: 0
24
26
  },
25
27
  /**
26
- * The amount of data to be displayed at 1 page. Used to calculate the `from` and `to` limits.
28
+ * The number of items displayed per page.
29
+ * Used to calculate the `from` and `to` limits for the current page.
27
30
  */
28
31
  pageSize: {
29
32
  type: Number,
30
33
  default: 0
31
34
  },
32
35
  /**
33
- * Whether the pagination is loading.
36
+ * Whether the pagination data is loading.
37
+ * When true, shows a skeleton loader instead of the info text.
34
38
  */
35
39
  loading: {
36
40
  type: Boolean,
@@ -56,7 +60,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
56
60
  __props.count ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
57
61
  createTextVNode("Showing " + toDisplayString(from.value) + " to " + toDisplayString(to.value) + " of " + toDisplayString(__props.count) + " results", 1)
58
62
  ], 64)) : renderSlot(_ctx.$slots, "no-results", { key: 1 }, () => [
59
- _cache[0] || (_cache[0] = createTextVNode("No results found"))
63
+ _cache[0] || (_cache[0] = createTextVNode("No results found", -1))
60
64
  ])
61
65
  ]));
62
66
  };
@@ -1,8 +1,7 @@
1
- import { defineComponent, computed, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, createElementVNode, normalizeClass, renderList, toDisplayString } from "vue";
1
+ import { defineComponent, computed, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, createElementVNode, normalizeClass, createVNode, renderList, toDisplayString } from "vue";
2
+ import { _ as _sfc_main$1 } from "./p-icon.js";
2
3
  import PSkeletonLoader from "../p-skeleton-loader.js";
3
4
  import { createPagingRange } from "../pagination.js";
4
- const _imports_0 = "data:image/svg+xml,%3csvg%20width='8'%20height='12'%20viewBox='0%200%208%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.25%205.99968C0.25%205.64968%200.4%205.34968%200.65%205.14968L6.25%200.249681C6.65%20-0.100319%207.2%20-0.0503187%207.55%200.349681C7.85%200.749681%207.85%201.29968%207.45%201.59968L2.55%205.89968C2.5%205.94968%202.5%205.99968%202.55%206.04968L7.45%2010.3497C7.85%2010.6997%207.9%2011.2497%207.55%2011.6497C7.2%2012.0497%206.65%2012.0997%206.25%2011.7497C6.25%2011.7497%206.25%2011.7497%206.2%2011.6997L0.65%206.84968C0.4%206.64968%200.25%206.29968%200.25%205.99968Z'%20fill='%23918da1'%20/%3e%3c/svg%3e";
5
- const _imports_1 = "data:image/svg+xml,%3csvg%20width='8'%20height='14'%20viewBox='0%200%208%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.75695%206.98136C7.75695%207.33136%207.60695%207.63136%207.35695%207.83136L1.75695%2012.7814C1.35695%2013.1314%200.756947%2013.0814%200.456947%2012.6814C0.156947%2012.2814%200.156947%2011.7314%200.556947%2011.3814L5.45695%207.08136C5.50695%207.03136%205.50695%206.98136%205.45695%206.88136L0.556947%202.58136C0.156947%202.23136%200.156947%201.63136%200.506947%201.28136C0.856947%200.931361%201.40695%200.881361%201.80695%201.18136L7.40695%206.08136C7.60695%206.33136%207.75695%206.63136%207.75695%206.98136Z'%20fill='%23918da1'%20/%3e%3c/svg%3e";
6
5
  const _hoisted_1 = {
7
6
  key: 1,
8
7
  class: "flex text-p-gray-40"
@@ -21,35 +20,40 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
21
20
  __name: "p-pagination",
22
21
  props: {
23
22
  /**
24
- * The current page.
23
+ * The current page number (v-model).
24
+ * Controls which page is visually active and navigable.
25
25
  */
26
26
  modelValue: {
27
27
  type: Number,
28
28
  default: null
29
29
  },
30
30
  /**
31
- * The amount of data pagination should iterate through.
31
+ * The total amount of items to paginate through.
32
+ * Used to calculate the total number of pages.
32
33
  */
33
34
  count: {
34
35
  type: Number,
35
36
  default: 0
36
37
  },
37
38
  /**
38
- * The amount of data to be displayed at 1 page. Used to calculate the length of pagination.
39
+ * The number of items to display per page.
40
+ * Used to calculate the total number of pages.
39
41
  */
40
42
  pageSize: {
41
43
  type: Number,
42
44
  default: 10
43
45
  },
44
46
  /**
45
- * The amount of pages to be displayed before and after the current page.
47
+ * The number of pages to show before and after the current page.
48
+ * Controls the range of page numbers displayed around the current page.
46
49
  */
47
50
  pageOffset: {
48
51
  type: Number,
49
52
  default: 2
50
53
  },
51
54
  /**
52
- * Whether the pagination is loading.
55
+ * Whether the pagination is in a loading state.
56
+ * When true, shows a skeleton loader instead of the pagination controls.
53
57
  */
54
58
  loading: {
55
59
  type: Boolean,
@@ -82,9 +86,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
82
86
  class: normalizeClass([BTN_CLASS, Number(__props.modelValue) <= 1 ? ARROW_INACTIVE_CLASS : ARROW_ACTIVE_CLASS]),
83
87
  "aria-label": "go to the previous page",
84
88
  onClick: _cache[0] || (_cache[0] = ($event) => setPage(Number(__props.modelValue) - 1))
85
- }, _cache[2] || (_cache[2] = [
86
- createElementVNode("img", { src: _imports_0 }, null, -1)
87
- ]), 2),
89
+ }, [
90
+ createVNode(_sfc_main$1, {
91
+ icon: "chevron-left",
92
+ width: "24px"
93
+ })
94
+ ], 2),
88
95
  (openBlock(true), createElementBlock(Fragment, null, renderList(pages.value, (page, index) => {
89
96
  return openBlock(), createElementBlock("div", {
90
97
  key: index,
@@ -106,9 +113,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
106
113
  class: normalizeClass([BTN_CLASS, __props.modelValue === pageCount.value ? ARROW_INACTIVE_CLASS : ARROW_ACTIVE_CLASS]),
107
114
  "aria-label": "go to the next page",
108
115
  onClick: _cache[1] || (_cache[1] = ($event) => setPage(Number(__props.modelValue) + 1))
109
- }, _cache[3] || (_cache[3] = [
110
- createElementVNode("img", { src: _imports_1 }, null, -1)
111
- ]), 2)
116
+ }, [
117
+ createVNode(_sfc_main$1, {
118
+ icon: "chevron-right",
119
+ width: "24px"
120
+ })
121
+ ], 2)
112
122
  ])) : createCommentVNode("", true)
113
123
  ], 64);
114
124
  };
@@ -7,7 +7,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  },
8
8
  __name: "p-select-btn",
9
9
  props: {
10
- modelValue: { default: null },
10
+ modelValue: { type: [String, Number, Boolean, null, Array], default: null },
11
11
  items: { default: () => [] },
12
12
  itemValue: { default: "value" },
13
13
  itemText: { default: "text" },
@@ -55,6 +55,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
55
55
  return index !== -1;
56
56
  }
57
57
  }
58
+ return false;
58
59
  };
59
60
  return (_ctx, _cache) => {
60
61
  const _directive_tooltip = resolveDirective("tooltip");
@@ -12,26 +12,51 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
12
12
  },
13
13
  __name: "p-select",
14
14
  props: {
15
+ /**
16
+ * The current selected value (v-model).
17
+ * Supports two-way binding for form inputs.
18
+ */
15
19
  modelValue: {
16
20
  type: [String, Number, Boolean, null],
17
21
  default: ""
18
22
  },
23
+ /**
24
+ * Array of objects representing the select options.
25
+ * Each object should have properties specified by itemText and itemValue.
26
+ * @example [{ text: 'Option 1', value: 1 }, { text: 'Option 2', value: 2 }]
27
+ */
19
28
  items: {
20
29
  type: Array,
21
30
  default: () => []
22
31
  },
32
+ /**
33
+ * Text label for the select field.
34
+ * If not provided, you can use the label slot instead.
35
+ */
23
36
  label: {
24
37
  type: String,
25
38
  default: ""
26
39
  },
40
+ /**
41
+ * Error message to display below the select.
42
+ * When provided, the select will show error styling.
43
+ */
27
44
  errorMsg: {
28
45
  type: String,
29
46
  default: ""
30
47
  },
48
+ /**
49
+ * Whether the select is required.
50
+ * Adds required attribute and visual indicator.
51
+ */
31
52
  required: {
32
53
  type: Boolean,
33
54
  default: false
34
55
  },
56
+ /**
57
+ * The size of the select - affects padding, font size, and spacing.
58
+ * Valid values: 'sm', 'md', 'lg'
59
+ */
35
60
  size: {
36
61
  type: String,
37
62
  default: "md",
@@ -39,10 +64,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
64
  return SIZES.includes(value);
40
65
  }
41
66
  },
67
+ /**
68
+ * Property name to use as the display text for each option.
69
+ * Defaults to 'text' - each item should have this property.
70
+ */
42
71
  itemText: {
43
72
  type: String,
44
73
  default: "text"
45
74
  },
75
+ /**
76
+ * Property name to use as the value for each option.
77
+ * Defaults to 'value' - each item should have this property.
78
+ */
46
79
  itemValue: {
47
80
  type: [String, Number, Boolean, null],
48
81
  default: "value"
@@ -14,22 +14,42 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14
14
  },
15
15
  __name: "p-table-loader",
16
16
  props: {
17
+ /**
18
+ * The number of rows to display in the skeleton table.
19
+ * Controls the vertical size of the loading placeholder.
20
+ */
17
21
  rows: {
18
22
  type: [Number, String],
19
23
  default: 4
20
24
  },
25
+ /**
26
+ * The number of columns to display in the skeleton table.
27
+ * Controls the horizontal size of the loading placeholder.
28
+ */
21
29
  columns: {
22
30
  type: [Number, String],
23
31
  default: 6
24
32
  },
33
+ /**
34
+ * CSS classes to apply to each table cell.
35
+ * Allows customization of cell padding and styling.
36
+ */
25
37
  tdClasses: {
26
38
  type: String,
27
39
  default: "px-4 py-5"
28
40
  },
41
+ /**
42
+ * CSS classes to apply to the skeleton loader within each cell.
43
+ * Controls the height and appearance of individual skeleton elements.
44
+ */
29
45
  tdSkeletonClasses: {
30
46
  type: String,
31
47
  default: "h-5"
32
48
  },
49
+ /**
50
+ * Whether to display subheaders in the table header.
51
+ * Adds an additional row below the main header for more complex table structures.
52
+ */
33
53
  withSubheader: {
34
54
  type: Boolean,
35
55
  default: false