@pequity/squirrel 8.4.4 → 8.4.5

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 (151) hide show
  1. package/README.md +2 -1
  2. package/dist/cjs/chunks/p-alert.js +3 -0
  3. package/dist/cjs/chunks/p-avatar.js +16 -0
  4. package/dist/cjs/chunks/p-btn.js +3 -0
  5. package/dist/cjs/chunks/p-card.js +4 -0
  6. package/dist/cjs/chunks/p-dropdown-select.js +34 -0
  7. package/dist/cjs/chunks/p-input-number.js +32 -0
  8. package/dist/cjs/chunks/p-input-percent.js +13 -2
  9. package/dist/cjs/chunks/p-input.js +28 -0
  10. package/dist/cjs/chunks/p-pagination-info.js +9 -5
  11. package/dist/cjs/chunks/p-pagination.js +23 -13
  12. package/dist/cjs/chunks/p-select-btn.js +2 -1
  13. package/dist/cjs/chunks/p-select.js +33 -0
  14. package/dist/cjs/chunks/p-table-loader.js +20 -0
  15. package/dist/cjs/chunks/p-tabs.js +12 -0
  16. package/dist/cjs/chunks/p-textarea.js +20 -0
  17. package/dist/cjs/index.js +40 -3
  18. package/dist/cjs/p-checkbox.js +8 -1
  19. package/dist/cjs/p-chips.js +17 -1
  20. package/dist/cjs/p-close-btn.js +6 -1
  21. package/dist/cjs/p-drawer.js +90 -2
  22. package/dist/cjs/p-dropdown.js +2 -1
  23. package/dist/cjs/p-input-search.js +13 -1
  24. package/dist/cjs/p-loading.js +1 -1
  25. package/dist/cjs/p-modal.js +82 -2
  26. package/dist/cjs/p-select-pill.js +36 -2
  27. package/dist/cjs/p-skeleton-loader.js +17 -1
  28. package/dist/cjs/p-table-filter-icon.js +4 -1
  29. package/dist/cjs/p-table-header-cell.js +29 -0
  30. package/dist/cjs/p-table-td.js +1 -1
  31. package/dist/cjs/p-toggle.js +22 -1
  32. package/dist/es/chunks/p-alert.js +3 -0
  33. package/dist/es/chunks/p-avatar.js +16 -0
  34. package/dist/es/chunks/p-btn.js +3 -0
  35. package/dist/es/chunks/p-card.js +4 -0
  36. package/dist/es/chunks/p-dropdown-select.js +34 -0
  37. package/dist/es/chunks/p-input-number.js +32 -0
  38. package/dist/es/chunks/p-input-percent.js +13 -2
  39. package/dist/es/chunks/p-input.js +28 -0
  40. package/dist/es/chunks/p-pagination-info.js +9 -5
  41. package/dist/es/chunks/p-pagination.js +24 -14
  42. package/dist/es/chunks/p-select-btn.js +2 -1
  43. package/dist/es/chunks/p-select.js +33 -0
  44. package/dist/es/chunks/p-table-loader.js +20 -0
  45. package/dist/es/chunks/p-tabs.js +12 -0
  46. package/dist/es/chunks/p-textarea.js +20 -0
  47. package/dist/es/index.js +40 -3
  48. package/dist/es/p-checkbox.js +8 -1
  49. package/dist/es/p-chips.js +17 -1
  50. package/dist/es/p-close-btn.js +6 -1
  51. package/dist/es/p-drawer.js +90 -2
  52. package/dist/es/p-dropdown.js +2 -1
  53. package/dist/es/p-input-search.js +13 -1
  54. package/dist/es/p-loading.js +1 -1
  55. package/dist/es/p-modal.js +82 -2
  56. package/dist/es/p-select-pill.js +36 -2
  57. package/dist/es/p-skeleton-loader.js +17 -1
  58. package/dist/es/p-table-filter-icon.js +4 -1
  59. package/dist/es/p-table-header-cell.js +29 -0
  60. package/dist/es/p-table-td.js +1 -1
  61. package/dist/es/p-toggle.js +22 -1
  62. package/dist/squirrel/components/p-action-bar/p-action-bar.vue.d.ts +14 -2
  63. package/dist/squirrel/components/p-alert/p-alert.vue.d.ts +16 -3
  64. package/dist/squirrel/components/p-avatar/p-avatar.vue.d.ts +35 -0
  65. package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +18 -2
  66. package/dist/squirrel/components/p-card/p-card.vue.d.ts +20 -7
  67. package/dist/squirrel/components/p-checkbox/p-checkbox.vue.d.ts +25 -7
  68. package/dist/squirrel/components/p-chips/p-chips.vue.d.ts +24 -0
  69. package/dist/squirrel/components/p-close-btn/p-close-btn.vue.d.ts +13 -0
  70. package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +16 -0
  71. package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +141 -3
  72. package/dist/squirrel/components/p-dropdown/p-dropdown.vue.d.ts +11 -2
  73. package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +69 -1
  74. package/dist/squirrel/components/p-file-upload/p-file-upload.vue.d.ts +70 -6
  75. package/dist/squirrel/components/p-icon/p-icon.vue.d.ts +4 -0
  76. package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +11 -4
  77. package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +27 -7
  78. package/dist/squirrel/components/p-input/p-input.vue.d.ts +73 -8
  79. package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +83 -12
  80. package/dist/squirrel/components/p-input-percent/p-input-percent.vue.d.ts +22 -2
  81. package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +24 -0
  82. package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +185 -15
  83. package/dist/squirrel/components/p-pagination/p-pagination.vue.d.ts +22 -12
  84. package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +16 -8
  85. package/dist/squirrel/components/p-progress-bar/p-progress-bar.vue.d.ts +20 -0
  86. package/dist/squirrel/components/p-ring-loader/p-ring-loader.vue.d.ts +10 -0
  87. package/dist/squirrel/components/p-select/p-select.vue.d.ts +76 -6
  88. package/dist/squirrel/components/p-select-btn/p-select-btn.vue.d.ts +67 -10
  89. package/dist/squirrel/components/p-select-list/p-select-list.vue.d.ts +1 -1
  90. package/dist/squirrel/components/p-select-pill/p-select-pill.vue.d.ts +72 -2
  91. package/dist/squirrel/components/p-skeleton-loader/p-skeleton-loader.vue.d.ts +40 -0
  92. package/dist/squirrel/components/p-steps/p-steps.vue.d.ts +12 -0
  93. package/dist/squirrel/components/p-table/p-table.vue.d.ts +32 -0
  94. package/dist/squirrel/components/p-table-header-cell/p-table-filter-icon.vue.d.ts +6 -0
  95. package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +56 -1
  96. package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +40 -0
  97. package/dist/squirrel/components/p-table-sort/p-table-sort.vue.d.ts +12 -2
  98. package/dist/squirrel/components/p-table-td/p-table-td.vue.d.ts +12 -0
  99. package/dist/squirrel/components/p-tabs/p-tabs.vue.d.ts +33 -2
  100. package/dist/squirrel/components/p-tabs-pills/p-tabs-pills.vue.d.ts +22 -0
  101. package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +52 -8
  102. package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +50 -3
  103. package/dist/squirrel.css +68 -68
  104. package/package.json +15 -15
  105. package/squirrel/components/p-action-bar/p-action-bar.stories.js +5 -5
  106. package/squirrel/components/p-action-bar/p-action-bar.vue +30 -3
  107. package/squirrel/components/p-alert/p-alert.vue +24 -0
  108. package/squirrel/components/p-avatar/p-avatar.vue +28 -0
  109. package/squirrel/components/p-btn/p-btn.vue +35 -0
  110. package/squirrel/components/p-card/p-card.vue +24 -1
  111. package/squirrel/components/p-checkbox/p-checkbox.vue +23 -1
  112. package/squirrel/components/p-chips/p-chips.vue +24 -0
  113. package/squirrel/components/p-close-btn/p-close-btn.vue +15 -0
  114. package/squirrel/components/p-date-picker/p-date-picker.vue +23 -1
  115. package/squirrel/components/p-drawer/p-drawer.vue +95 -0
  116. package/squirrel/components/p-dropdown/p-dropdown.vue +12 -1
  117. package/squirrel/components/p-dropdown-select/p-dropdown-select.vue +41 -0
  118. package/squirrel/components/p-file-upload/p-file-upload.vue +58 -3
  119. package/squirrel/components/p-icon/p-icon.vue +16 -0
  120. package/squirrel/components/p-info-icon/p-info-icon.vue +19 -0
  121. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue +32 -0
  122. package/squirrel/components/p-input/p-input.vue +61 -1
  123. package/squirrel/components/p-input-number/p-input-number.vue +78 -1
  124. package/squirrel/components/p-input-percent/p-input-percent.vue +27 -3
  125. package/squirrel/components/p-input-search/p-input-search.vue +30 -2
  126. package/squirrel/components/p-link/p-link.vue +13 -0
  127. package/squirrel/components/p-loading/p-loading.vue +9 -2
  128. package/squirrel/components/p-modal/p-modal.vue +138 -2
  129. package/squirrel/components/p-pagination/p-pagination.vue +28 -8
  130. package/squirrel/components/p-pagination-info/p-pagination-info.vue +16 -4
  131. package/squirrel/components/p-progress-bar/p-progress-bar.vue +31 -4
  132. package/squirrel/components/p-ring-loader/p-ring-loader.vue +17 -0
  133. package/squirrel/components/p-select/p-select.vue +50 -1
  134. package/squirrel/components/p-select-btn/p-select-btn.vue +90 -2
  135. package/squirrel/components/p-select-list/p-select-list.vue +7 -0
  136. package/squirrel/components/p-select-pill/p-select-pill.vue +52 -2
  137. package/squirrel/components/p-skeleton-loader/p-skeleton-loader.vue +24 -0
  138. package/squirrel/components/p-steps/p-steps.vue +25 -0
  139. package/squirrel/components/p-table/p-table.vue +39 -0
  140. package/squirrel/components/p-table-header-cell/p-table-filter-icon.vue +9 -0
  141. package/squirrel/components/p-table-header-cell/p-table-header-cell.vue +36 -0
  142. package/squirrel/components/p-table-loader/p-table-loader.vue +28 -0
  143. package/squirrel/components/p-table-sort/p-table-sort.vue +19 -1
  144. package/squirrel/components/p-table-td/p-table-td.vue +20 -0
  145. package/squirrel/components/p-tabs/p-tabs.stories.js +2 -2
  146. package/squirrel/components/p-tabs/p-tabs.vue +33 -1
  147. package/squirrel/components/p-tabs-pills/p-tabs-pills.vue +33 -0
  148. package/squirrel/components/p-textarea/p-textarea.vue +43 -1
  149. package/squirrel/components/p-toggle/p-toggle.vue +44 -1
  150. package/squirrel/assets/pagination-left-icon.svg +0 -5
  151. package/squirrel/assets/pagination-right-icon.svg +0 -5
@@ -133,6 +133,13 @@ import { toString } from '@squirrel/utils/string';
133
133
  import { splitStringForHighlight } from '@squirrel/utils/text';
134
134
  import { type ComponentPublicInstance, computed, onMounted, type PropType, ref, type StyleValue, useAttrs } from 'vue';
135
135
 
136
+ /**
137
+ * A select list component with advanced features like search, multiple selection, and virtual scrolling.
138
+ * Provides a customizable list interface with support for single/multiple selection, search filtering,
139
+ * and virtual scrolling for large datasets.
140
+ *
141
+ * @displayName PSelectList
142
+ */
136
143
  defineOptions({
137
144
  name: 'PSelectList',
138
145
  inheritAttrs: false,
@@ -30,10 +30,17 @@
30
30
  <script lang="ts">
31
31
  import { defineComponent, type PropType } from 'vue';
32
32
 
33
+ /**
34
+ * Represents a single option in the select pill component.
35
+ */
33
36
  type Option = Record<string, unknown> & {
37
+ /** Display text for the option */
34
38
  text: string;
39
+ /** Optional subtext displayed below the main text */
35
40
  subtext?: string;
41
+ /** Unique value identifier for the option */
36
42
  value: string | number;
43
+ /** Whether the option is disabled and cannot be selected */
37
44
  disabled?: boolean;
38
45
  };
39
46
 
@@ -46,6 +53,8 @@ const ACTIVE_CLASS = 'text-p-purple-60';
46
53
  * In cases that p-select-pill is rendered before its parent component is visible,
47
54
  * we need to calculate the offsets by cloning the container div and put it in the DOM momentarily.
48
55
  * This way the buttons actually have measurable dimensions.
56
+ * @param {HTMLElement} container - The container element to clone
57
+ * @returns {Object} Object containing width and left position of the active button
49
58
  */
50
59
  const getOffsetValues = (container: HTMLElement) => {
51
60
  const el = container.cloneNode(true) as HTMLElement;
@@ -60,29 +69,61 @@ const getOffsetValues = (container: HTMLElement) => {
60
69
  return res;
61
70
  };
62
71
 
72
+ /**
73
+ * A select pill component that displays options as connected buttons with a sliding indicator.
74
+ * Provides a pill-style selection interface with smooth animations and visual feedback.
75
+ * The active option is highlighted with a sliding background indicator.
76
+ *
77
+ * @displayName PSelectPill
78
+ */
63
79
  export default defineComponent({
64
80
  name: 'PSelectPill',
65
81
  props: {
82
+ /**
83
+ * The currently selected value (v-model).
84
+ * Should match one of the item values in the items array.
85
+ */
66
86
  modelValue: {
67
87
  type: [String, Number],
68
88
  default: '',
69
89
  },
90
+ /**
91
+ * Array of options to display as pills.
92
+ * Each option should have text, value, and optional subtext and disabled properties.
93
+ */
70
94
  items: {
71
95
  type: Array as PropType<Option[] | [] | undefined | null>,
72
96
  default: () => [],
73
97
  },
98
+ /**
99
+ * Property name to use as the item display text.
100
+ * Used for button label content.
101
+ */
74
102
  itemText: {
75
103
  type: String,
76
104
  default: 'text',
77
105
  },
106
+ /**
107
+ * Property name to use as the item subtext.
108
+ * Displayed below the main text when provided.
109
+ */
78
110
  itemSubtext: {
79
111
  type: String,
80
112
  default: 'subtext',
81
113
  },
114
+ /**
115
+ * Property name to use as the item value.
116
+ * Used for selection comparison and v-model binding.
117
+ */
82
118
  itemValue: {
83
119
  type: [String, Number],
84
120
  default: 'value',
85
121
  },
122
+ /**
123
+ * The size of the pill buttons.
124
+ * Valid values: 'sm', 'md', 'lg'
125
+ * @values sm, md, lg
126
+ */
86
127
  size: {
87
128
  type: String as PropType<Size>,
88
129
  default: 'md',
@@ -91,7 +132,13 @@ export default defineComponent({
91
132
  },
92
133
  },
93
134
  },
94
- emits: ['update:modelValue'],
135
+ emits: {
136
+ /**
137
+ * Emitted when the selected value changes.
138
+ * @param {string | number} value - The new selected value
139
+ */
140
+ 'update:modelValue': (value: string | number) => true,
141
+ },
95
142
  data() {
96
143
  return {
97
144
  SIZES,
@@ -118,7 +165,10 @@ export default defineComponent({
118
165
  methods: {
119
166
  click(e: Event, option: Option) {
120
167
  if (!option.disabled) {
121
- this.$emit('update:modelValue', option[this.itemValue]);
168
+ const value = option[this.itemValue];
169
+ if (typeof value === 'string' || typeof value === 'number') {
170
+ this.$emit('update:modelValue', value);
171
+ }
122
172
  }
123
173
  },
124
174
  setPillStyle() {
@@ -30,9 +30,21 @@ const isHexColor = (hexColor: string) => {
30
30
 
31
31
  const hexToRgb = (hex: string) => `${hex.match(/\w\w/g)?.map((x) => +`0x${x}`)}`;
32
32
 
33
+ /**
34
+ * A skeleton loader component that displays animated loading placeholders.
35
+ * Provides customizable shapes, colors, and shimmer effects to indicate
36
+ * content loading states. Supports both rectangle and circle shapes with
37
+ * configurable background and shimmer colors.
38
+ *
39
+ * @displayName PSkeletonLoader
40
+ */
33
41
  export default defineComponent({
34
42
  name: 'PSkeletonLoader',
35
43
  props: {
44
+ /**
45
+ * The shape type of the skeleton loader.
46
+ * Determines the border radius and overall appearance.
47
+ */
36
48
  type: {
37
49
  type: String as PropType<LoaderType>,
38
50
  default: LOADER_TYPES.rectangle,
@@ -40,14 +52,26 @@ export default defineComponent({
40
52
  return Object.values(LOADER_TYPES).includes(value);
41
53
  },
42
54
  },
55
+ /**
56
+ * The background CSS class for the skeleton loader.
57
+ * Controls the base color of the loading placeholder.
58
+ */
43
59
  bgClass: {
44
60
  type: String,
45
61
  default: 'bg-p-gray-30',
46
62
  },
63
+ /**
64
+ * Additional CSS classes to apply to the loader.
65
+ * Allows for custom styling beyond the default type-based classes.
66
+ */
47
67
  cssClass: {
48
68
  type: String,
49
69
  default: '',
50
70
  },
71
+ /**
72
+ * The color of the shimmer effect in hex format.
73
+ * Controls the color of the animated shimmer overlay.
74
+ */
51
75
  shimmerColor: {
52
76
  type: String,
53
77
  default: SHIMMER_COLOR,
@@ -25,13 +25,32 @@ import type { StepItem } from '@squirrel/components/p-steps/p-steps.types';
25
25
  import { startCase } from 'lodash-es';
26
26
  import { computed } from 'vue';
27
27
 
28
+ /**
29
+ * A steps component that displays a sequence of steps with visual indicators.
30
+ * Shows the current step, completed steps, and upcoming steps with different styling.
31
+ * Supports clickable steps and custom step text with automatic fallback to formatted step values.
32
+ *
33
+ * @displayName PSteps
34
+ */
28
35
  defineOptions({
29
36
  name: 'PSteps',
30
37
  });
31
38
 
32
39
  type Props = {
40
+ /**
41
+ * The currently active step value.
42
+ * Should match one of the step values in the steps array.
43
+ */
33
44
  activeStep?: StepItem['value'];
45
+ /**
46
+ * Array of step items to display.
47
+ * Each step should have a value and optional text and disabled properties.
48
+ */
34
49
  steps?: readonly StepItem[];
50
+ /**
51
+ * Whether steps are clickable to navigate between them.
52
+ * When true, steps become interactive and emit click events.
53
+ */
35
54
  clickable?: boolean;
36
55
  };
37
56
 
@@ -42,6 +61,12 @@ const props = withDefaults(defineProps<Props>(), {
42
61
  });
43
62
 
44
63
  const emit = defineEmits<{
64
+ /**
65
+ * Emitted when a step is clicked.
66
+ * Only emitted when clickable is true and the step is not disabled.
67
+ * @param {StepItem} step - The clicked step item
68
+ * @param {number} index - The index of the clicked step
69
+ */
45
70
  'click:step': [step: StepItem, index: number];
46
71
  }>();
47
72
 
@@ -114,19 +114,58 @@ import { kebabCase } from 'lodash-es';
114
114
  import { computed, onBeforeUnmount, onMounted, provide, ref, watch } from 'vue';
115
115
 
116
116
  type Props = {
117
+ /**
118
+ * Array of column definitions for the table.
119
+ * Each column defines its display properties, filtering, and styling.
120
+ */
117
121
  cols: TableCol[];
122
+ /**
123
+ * Whether columns can be resized by dragging.
124
+ * Enables column width adjustment functionality.
125
+ */
118
126
  colsResizable?: boolean;
127
+ /**
128
+ * Whether the first column is fixed in position.
129
+ * Useful for keeping important columns visible during horizontal scrolling.
130
+ */
119
131
  isFirstColFixed?: boolean;
132
+ /**
133
+ * Whether the last column is fixed in position.
134
+ * Useful for keeping action columns visible during horizontal scrolling.
135
+ */
120
136
  isLastColFixed?: boolean;
137
+ /**
138
+ * Whether to prevent horizontal scrolling.
139
+ * Forces the table to fit within its container.
140
+ */
121
141
  lockScroll?: boolean;
142
+ /**
143
+ * Whether to show subheader content below the main header.
144
+ * Provides additional header information or controls.
145
+ */
122
146
  subheader?: boolean;
147
+ /**
148
+ * Virtual scrolling configuration for large datasets.
149
+ * Controls padding for virtualized rows.
150
+ */
123
151
  virtualizer?: {
124
152
  paddingTop: number;
125
153
  paddingBottom: number;
126
154
  };
155
+ /**
156
+ * Array of data objects to display in the table.
157
+ * Each object should have properties matching the column names.
158
+ */
127
159
  data?: T[];
128
160
  };
129
161
 
162
+ /**
163
+ * A comprehensive table component with advanced features like column resizing, fixed columns, and virtual scrolling.
164
+ * Provides a flexible table interface with support for custom cell rendering, column filtering, and responsive design.
165
+ * Supports both simple data display and complex interactive features.
166
+ *
167
+ * @displayName PTable
168
+ */
130
169
  defineOptions({ name: 'PTable' });
131
170
 
132
171
  const emit = defineEmits<{
@@ -3,12 +3,21 @@
3
3
  </template>
4
4
 
5
5
  <script setup lang="ts">
6
+ /**
7
+ * A filter icon component for table headers, used to indicate and toggle filter state.
8
+ * Changes its appearance based on the active state and supports hover effects.
9
+ *
10
+ * @displayName PTableFilterIcon
11
+ */
6
12
  defineOptions({
7
13
  name: 'PTableFilterIcon',
8
14
  inheritAttrs: false,
9
15
  });
10
16
 
11
17
  defineProps({
18
+ /**
19
+ * Whether the filter icon is active (filtered state).
20
+ */
12
21
  active: {
13
22
  type: Boolean,
14
23
  default: false,
@@ -25,6 +25,13 @@ import { defineComponent } from 'vue';
25
25
 
26
26
  const DEFAULT_CLASSES = `text-xs leading-5 font-semibold truncate shrink`;
27
27
 
28
+ /**
29
+ * A table header cell component that displays text with optional tooltip and filter icon.
30
+ * Provides consistent styling for table headers with support for custom text colors,
31
+ * tooltips, and filter functionality.
32
+ *
33
+ * @displayName PTableHeaderCell
34
+ */
28
35
  export default defineComponent({
29
36
  name: 'PTableHeaderCell',
30
37
  components: {
@@ -32,31 +39,60 @@ export default defineComponent({
32
39
  PInfoIcon,
33
40
  },
34
41
  props: {
42
+ /**
43
+ * The text content to display in the header cell.
44
+ * Also used as the title attribute for accessibility.
45
+ */
35
46
  text: {
36
47
  type: String,
37
48
  default: '',
38
49
  },
50
+ /**
51
+ * CSS classes to apply to the text element.
52
+ * Can be a string, object, or array for flexible styling.
53
+ */
39
54
  textClass: {
40
55
  type: [String, Object, Array],
41
56
  default: 'text-left',
42
57
  },
58
+ /**
59
+ * Whether the filter icon is in an active state.
60
+ * Controls the visual appearance of the filter icon and text color.
61
+ */
43
62
  filterActive: {
44
63
  type: Boolean,
45
64
  default: false,
46
65
  },
66
+ /**
67
+ * Whether to show the filter icon.
68
+ * When false, the filter icon is hidden regardless of other states.
69
+ */
47
70
  showFilterIcon: {
48
71
  type: Boolean,
49
72
  default: false,
50
73
  },
74
+ /**
75
+ * Tooltip text to display when hovering over the info icon.
76
+ * When provided, shows an info icon with the tooltip content.
77
+ */
51
78
  tooltipText: {
52
79
  type: String,
53
80
  default: '',
54
81
  },
82
+ /**
83
+ * Custom text color to apply to the header text.
84
+ * Overrides the default text color when provided.
85
+ */
55
86
  textColor: {
56
87
  type: String,
57
88
  default: '',
58
89
  },
59
90
  },
91
+ /**
92
+ * Emitted when the filter icon is clicked.
93
+ * @param {Event} event - The click event
94
+ * @param {boolean} filterActive - The current filter active state
95
+ */
60
96
  emits: ['click-filter-icon'],
61
97
  data() {
62
98
  return {
@@ -25,27 +25,55 @@
25
25
  <script setup lang="ts">
26
26
  import PSkeletonLoader from '@squirrel/components/p-skeleton-loader/p-skeleton-loader.vue';
27
27
 
28
+ /**
29
+ * A table skeleton loader component that displays a loading placeholder for table data.
30
+ * Renders a complete table structure with skeleton loaders for headers and data cells.
31
+ * Supports customizable dimensions, styling, and optional subheaders to match
32
+ * the expected table layout during loading states.
33
+ *
34
+ * @displayName PTableLoader
35
+ */
28
36
  defineOptions({
29
37
  name: 'PTableLoader',
30
38
  });
31
39
 
32
40
  defineProps({
41
+ /**
42
+ * The number of rows to display in the skeleton table.
43
+ * Controls the vertical size of the loading placeholder.
44
+ */
33
45
  rows: {
34
46
  type: [Number, String],
35
47
  default: 4,
36
48
  },
49
+ /**
50
+ * The number of columns to display in the skeleton table.
51
+ * Controls the horizontal size of the loading placeholder.
52
+ */
37
53
  columns: {
38
54
  type: [Number, String],
39
55
  default: 6,
40
56
  },
57
+ /**
58
+ * CSS classes to apply to each table cell.
59
+ * Allows customization of cell padding and styling.
60
+ */
41
61
  tdClasses: {
42
62
  type: String,
43
63
  default: 'px-4 py-5',
44
64
  },
65
+ /**
66
+ * CSS classes to apply to the skeleton loader within each cell.
67
+ * Controls the height and appearance of individual skeleton elements.
68
+ */
45
69
  tdSkeletonClasses: {
46
70
  type: String,
47
71
  default: 'h-5',
48
72
  },
73
+ /**
74
+ * Whether to display subheaders in the table header.
75
+ * Adds an additional row below the main header for more complex table structures.
76
+ */
49
77
  withSubheader: {
50
78
  type: Boolean,
51
79
  default: false,
@@ -59,13 +59,31 @@
59
59
  import { SORTING_TYPES, type SortingType } from '@squirrel/components/p-table-sort/p-table-sort.config';
60
60
  import { type PropType } from 'vue';
61
61
 
62
+ /**
63
+ * A table sorting component that provides ascending, descending, and no-sorting options.
64
+ * Displays sort options with visual indicators and allows clearing the sort state.
65
+ * Used for table column sorting functionality.
66
+ *
67
+ * @displayName PTableSort
68
+ */
62
69
  defineOptions({
63
70
  name: 'PTableSort',
64
71
  });
65
72
 
66
- defineEmits(['update:modelValue']);
73
+ defineEmits<{
74
+ /**
75
+ * Emitted when the sorting state changes.
76
+ * @param {SortingType} value - The new sorting state
77
+ */
78
+ 'update:modelValue': [value: SortingType];
79
+ }>();
67
80
 
68
81
  defineProps({
82
+ /**
83
+ * The current sorting state (v-model).
84
+ * Valid values: 'asc', 'desc', 'no-sorting'
85
+ * Controls which sort option is visually active.
86
+ */
69
87
  modelValue: {
70
88
  type: String as PropType<SortingType>,
71
89
  default: SORTING_TYPES.NO_SORTING,
@@ -22,11 +22,31 @@ import {
22
22
  } from '@squirrel/components/p-table/p-table.types';
23
23
  import { computed, inject, type Ref, ref } from 'vue';
24
24
 
25
+ /**
26
+ * A table cell component that provides advanced styling and behavior for table data.
27
+ * Supports fixed columns, editable cells, selection states, and responsive design.
28
+ * Integrates with the table system through dependency injection for coordinated
29
+ * styling and behavior across the entire table structure.
30
+ *
31
+ * @displayName PTableTd
32
+ */
25
33
  defineOptions({ name: 'PTableTd', inheritAttrs: false });
26
34
 
27
35
  type Props = {
36
+ /**
37
+ * The index of the column this cell belongs to.
38
+ * Used for determining positioning and styling based on column position.
39
+ */
28
40
  colIndex: number;
41
+ /**
42
+ * Whether the cell is editable.
43
+ * Adds cursor pointer styling and enables edit functionality.
44
+ */
29
45
  isEditable?: boolean;
46
+ /**
47
+ * Whether the cell is part of a selected row.
48
+ * Applies selection styling and hover effects.
49
+ */
30
50
  isSelected?: boolean;
31
51
  };
32
52
 
@@ -1,4 +1,4 @@
1
- import PaginateRightIcon from '@squirrel/assets/pagination-right-icon.svg?inline';
1
+ import KeyboardPressEnterIcon from '@squirrel/assets/keyboard-press-enter.svg?inline';
2
2
  import PTabs from '@squirrel/components/p-tabs/p-tabs.vue';
3
3
  import { action } from 'storybook/actions';
4
4
  import { markRaw } from 'vue';
@@ -35,7 +35,7 @@ export const Default = {
35
35
  {
36
36
  title: 'Tab 2',
37
37
  name: 'tab2',
38
- icon: markRaw(PaginateRightIcon),
38
+ icon: markRaw(KeyboardPressEnterIcon),
39
39
  },
40
40
  {
41
41
  title: 'Tab 3',
@@ -30,31 +30,63 @@
30
30
  import { type ShallowRef } from 'vue';
31
31
  import { type RouteLocationRaw } from 'vue-router';
32
32
 
33
+ /**
34
+ * A tabs component for navigation between different sections.
35
+ * Displays tabs with optional icons and supports router navigation.
36
+ * Provides hover effects and active state styling.
37
+ *
38
+ * @displayName PTabs
39
+ */
33
40
  defineOptions({
34
41
  name: 'PTabs',
35
42
  });
36
43
 
44
+ /**
45
+ * Represents a single tab in the tabs component.
46
+ */
37
47
  type Tab = {
48
+ /** Unique identifier for the tab */
38
49
  name: string;
50
+ /** Display text for the tab */
39
51
  title: string;
52
+ /** Optional icon component or icon name */
40
53
  icon?: string | ShallowRef<string>;
54
+ /** Optional router link destination */
41
55
  to?: RouteLocationRaw;
42
56
  };
43
57
 
44
58
  defineProps({
59
+ /**
60
+ * Array of tab objects to display.
61
+ * Each tab should have a name, title, and optional icon and route.
62
+ */
45
63
  tabs: {
46
64
  type: Array as () => Tab[],
47
65
  required: true,
48
66
  },
67
+ /**
68
+ * The currently active tab name.
69
+ * Controls which tab is visually highlighted.
70
+ */
49
71
  activeTab: {
50
72
  type: String,
51
73
  required: true,
52
74
  },
75
+ /**
76
+ * Left padding for the tabs container in pixels.
77
+ * Useful for aligning tabs with other content.
78
+ */
53
79
  tabsLeftPadding: {
54
80
  type: Number,
55
81
  default: 0,
56
82
  },
57
83
  });
58
84
 
59
- defineEmits(['click:tab']);
85
+ defineEmits<{
86
+ /**
87
+ * Emitted when a tab is clicked.
88
+ * @param {string} tabName - The name of the clicked tab
89
+ */
90
+ 'click:tab': [tabName: string];
91
+ }>();
60
92
  </script>
@@ -30,20 +30,49 @@
30
30
  </template>
31
31
 
32
32
  <script setup lang="ts">
33
+ /**
34
+ * A tabs pills component that displays navigation tabs in a pill-style interface.
35
+ * Provides a compact tab navigation with smooth transitions and accessibility features.
36
+ * Supports disabled states and custom item text/value properties.
37
+ *
38
+ * @displayName PTabsPills
39
+ */
33
40
  defineOptions({
34
41
  name: 'PTabsPills',
35
42
  });
36
43
 
44
+ /**
45
+ * Valid value types for tab items.
46
+ */
37
47
  type Value = string | number | boolean;
38
48
 
49
+ /**
50
+ * Represents a single tab option in the pills component.
51
+ */
39
52
  type Option = {
40
53
  [key: string]: Value;
41
54
  };
42
55
 
43
56
  type Props = {
57
+ /**
58
+ * The currently selected tab value (v-model).
59
+ * Should match one of the item values in the items array.
60
+ */
44
61
  modelValue?: Value;
62
+ /**
63
+ * Array of tab items to display as pills.
64
+ * Each item should have properties matching itemValue and itemText.
65
+ */
45
66
  items?: readonly Option[];
67
+ /**
68
+ * Property name to use as the item display text.
69
+ * Used for button label content.
70
+ */
46
71
  itemText?: string;
72
+ /**
73
+ * Property name to use as the item value.
74
+ * Used for selection comparison and v-model binding.
75
+ */
47
76
  itemValue?: string;
48
77
  };
49
78
 
@@ -55,6 +84,10 @@ withDefaults(defineProps<Props>(), {
55
84
  });
56
85
 
57
86
  defineEmits<{
87
+ /**
88
+ * Emitted when the selected tab value changes.
89
+ * @param {Value} val - The new selected tab value
90
+ */
58
91
  'update:modelValue': [val: Value];
59
92
  }>();
60
93
  </script>