@pequity/squirrel 5.4.7 → 5.4.9

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 (158) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/chunks/p-date-picker.js +143 -85
  3. package/dist/cjs/chunks/p-dropdown-select.js +4 -4
  4. package/dist/cjs/chunks/p-inline-date-picker.js +117 -67
  5. package/dist/cjs/chunks/p-link.js +1 -1
  6. package/dist/cjs/chunks/p-select.js +1 -1
  7. package/dist/cjs/index.js +37 -37
  8. package/dist/cjs/p-btn.js +2 -2
  9. package/dist/cjs/p-checkbox.js +1 -1
  10. package/dist/cjs/p-chips.js +2 -2
  11. package/dist/cjs/p-input-number.js +3 -3
  12. package/dist/cjs/p-input-search.js +1 -1
  13. package/dist/cjs/p-loading.js +2 -2
  14. package/dist/cjs/p-modal.js +2 -2
  15. package/dist/cjs/p-skeleton-loader.js +1 -1
  16. package/dist/cjs/p-table-td.js +1 -1
  17. package/dist/cjs/p-toggle.js +1 -1
  18. package/dist/cjs/tailwind.js +2 -2
  19. package/dist/cjs/usePTableRowVirtualizer.js +1 -1
  20. package/dist/cjs/useSelectList.js +3 -3
  21. package/dist/es/chunks/p-date-picker.js +144 -86
  22. package/dist/es/chunks/p-dropdown-select.js +4 -4
  23. package/dist/es/chunks/p-inline-date-picker.js +118 -68
  24. package/dist/es/chunks/p-link.js +1 -1
  25. package/dist/es/chunks/p-select.js +1 -1
  26. package/dist/es/index.js +35 -35
  27. package/dist/es/p-btn.js +2 -2
  28. package/dist/es/p-checkbox.js +1 -1
  29. package/dist/es/p-chips.js +2 -2
  30. package/dist/es/p-input-number.js +3 -3
  31. package/dist/es/p-input-search.js +1 -1
  32. package/dist/es/p-loading.js +2 -2
  33. package/dist/es/p-modal.js +2 -2
  34. package/dist/es/p-skeleton-loader.js +1 -1
  35. package/dist/es/p-table-td.js +1 -1
  36. package/dist/es/p-toggle.js +1 -1
  37. package/dist/es/tailwind.js +2 -2
  38. package/dist/es/usePTableRowVirtualizer.js +1 -1
  39. package/dist/es/useSelectList.js +3 -3
  40. package/dist/squirrel/components/index.d.ts +13 -13
  41. package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +2 -2
  42. package/dist/squirrel/components/p-card/p-card.vue.d.ts +3 -2
  43. package/dist/squirrel/components/p-checkbox/p-checkbox.vue.d.ts +2 -1
  44. package/dist/squirrel/components/p-close-btn/p-close-btn.vue.d.ts +1 -1
  45. package/dist/squirrel/components/p-date-picker/p-date-picker.vue.d.ts +27 -30
  46. package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +3 -3
  47. package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +8 -7
  48. package/dist/squirrel/components/p-file-upload/p-file-upload.vue.d.ts +1 -1
  49. package/dist/squirrel/components/p-icon/p-icon.vue.d.ts +2 -2
  50. package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +2 -1
  51. package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +46 -0
  52. package/dist/squirrel/components/p-input/p-input.vue.d.ts +1 -1
  53. package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +1 -1
  54. package/dist/squirrel/components/p-input-percent/p-input-percent.vue.d.ts +1 -1
  55. package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +2 -2
  56. package/dist/squirrel/components/p-link/p-link.vue.d.ts +2 -1
  57. package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +5 -4
  58. package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +2 -1
  59. package/dist/squirrel/components/p-ring-loader/p-ring-loader.vue.d.ts +1 -1
  60. package/dist/squirrel/components/p-select/p-select.vue.d.ts +3 -2
  61. package/dist/squirrel/components/p-select-btn/p-select-btn.vue.d.ts +3 -2
  62. package/dist/squirrel/components/p-select-list/p-select-list.vue.d.ts +6 -5
  63. package/dist/squirrel/components/p-select-pill/p-select-pill.vue.d.ts +1 -1
  64. package/dist/squirrel/components/p-table/p-table.vue.d.ts +3 -2
  65. package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +1 -1
  66. package/dist/squirrel/components/p-table-sort/p-table-sort.vue.d.ts +1 -1
  67. package/dist/squirrel/components/p-table-td/p-table-td.vue.d.ts +2 -1
  68. package/dist/squirrel/components/p-tabs/p-tabs.vue.d.ts +2 -2
  69. package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +1 -1
  70. package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +1 -1
  71. package/dist/squirrel/index.d.ts +1 -1
  72. package/dist/squirrel/utils/index.d.ts +8 -8
  73. package/dist/squirrel/utils/inputClassesMixin.d.ts +1 -1
  74. package/dist/style.css +98 -989
  75. package/package.json +30 -32
  76. package/squirrel/assets/squirrel.css +45 -6
  77. package/squirrel/components/index.ts +37 -37
  78. package/squirrel/components/p-action-bar/p-action-bar.spec.ts +1 -1
  79. package/squirrel/components/p-action-bar/p-action-bar.stories.js +2 -2
  80. package/squirrel/components/p-action-bar/p-action-bar.vue +1 -1
  81. package/squirrel/components/p-alert/p-alert.vue +1 -1
  82. package/squirrel/components/p-btn/p-btn.spec.js +2 -2
  83. package/squirrel/components/p-btn/p-btn.vue +4 -4
  84. package/squirrel/components/p-checkbox/p-checkbox.vue +1 -1
  85. package/squirrel/components/p-chips/p-chips.vue +1 -1
  86. package/squirrel/components/p-date-picker/p-date-picker.spec.js +292 -0
  87. package/squirrel/components/p-date-picker/p-date-picker.stories.js +3 -3
  88. package/squirrel/components/p-date-picker/p-date-picker.vue +45 -90
  89. package/squirrel/components/p-dropdown/p-dropdown.spec.js +1 -1
  90. package/squirrel/components/p-dropdown/p-dropdown.vue +1 -1
  91. package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +4 -4
  92. package/squirrel/components/p-dropdown-select/p-dropdown-select.stories.js +2 -2
  93. package/squirrel/components/p-dropdown-select/p-dropdown-select.vue +8 -8
  94. package/squirrel/components/p-file-upload/p-file-upload.vue +2 -2
  95. package/squirrel/components/p-icon/p-icon.spec.js +1 -1
  96. package/squirrel/components/p-icon/p-icon.stories.js +1 -1
  97. package/squirrel/components/p-icon/p-icon.vue +2 -2
  98. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.spec.js +21 -45
  99. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.stories.js +3 -3
  100. package/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue +16 -85
  101. package/squirrel/components/p-input/p-input.stories.js +1 -1
  102. package/squirrel/components/p-input/p-input.vue +1 -1
  103. package/squirrel/components/p-input-number/p-input-number.stories.js +1 -1
  104. package/squirrel/components/p-input-number/p-input-number.vue +3 -3
  105. package/squirrel/components/p-input-percent/p-input-percent.stories.js +1 -1
  106. package/squirrel/components/p-input-percent/p-input-percent.vue +1 -1
  107. package/squirrel/components/p-input-search/p-input-search.stories.js +1 -1
  108. package/squirrel/components/p-input-search/p-input-search.vue +1 -1
  109. package/squirrel/components/p-link/p-link.spec.js +1 -1
  110. package/squirrel/components/p-link/p-link.vue +1 -1
  111. package/squirrel/components/p-loading/p-loading.spec.js +2 -2
  112. package/squirrel/components/p-loading/p-loading.stories.js +2 -2
  113. package/squirrel/components/p-loading/p-loading.vue +1 -1
  114. package/squirrel/components/p-loading/usePLoading.ts +1 -1
  115. package/squirrel/components/p-modal/p-modal-basic.spec.js +1 -1
  116. package/squirrel/components/p-modal/p-modal-events.spec.js +1 -1
  117. package/squirrel/components/p-modal/p-modal-features.spec.js +1 -1
  118. package/squirrel/components/p-modal/p-modal.vue +3 -3
  119. package/squirrel/components/p-pagination/p-pagination.vue +1 -1
  120. package/squirrel/components/p-progress-bar/p-progess-bar.spec.js +1 -1
  121. package/squirrel/components/p-progress-bar/p-progress-bar.vue +1 -1
  122. package/squirrel/components/p-select/p-select.spec.js +1 -1
  123. package/squirrel/components/p-select/p-select.stories.js +1 -1
  124. package/squirrel/components/p-select/p-select.vue +1 -1
  125. package/squirrel/components/p-select-btn/p-select-btn.spec.js +1 -1
  126. package/squirrel/components/p-select-btn/p-select-btn.stories.js +1 -1
  127. package/squirrel/components/p-select-btn/p-select-btn.vue +1 -1
  128. package/squirrel/components/p-select-list/p-select-list.spec.js +4 -4
  129. package/squirrel/components/p-select-list/p-select-list.vue +5 -5
  130. package/squirrel/components/p-select-list/useSelectList.ts +3 -3
  131. package/squirrel/components/p-select-pill/p-select-pill.spec.js +1 -1
  132. package/squirrel/components/p-select-pill/p-select-pill.stories.js +2 -2
  133. package/squirrel/components/p-select-pill/p-select-pill.vue +1 -1
  134. package/squirrel/components/p-skeleton-loader/p-skeleton-loader.vue +1 -1
  135. package/squirrel/components/p-table/p-table.spec.js +2 -2
  136. package/squirrel/components/p-table/p-table.vue +4 -4
  137. package/squirrel/components/p-table/usePTableColResize.spec.js +1 -1
  138. package/squirrel/components/p-table/usePTableColResize.ts +1 -1
  139. package/squirrel/components/p-table/usePTableRowVirtualizer.ts +1 -1
  140. package/squirrel/components/p-table-sort/p-table-sort.spec.js +1 -1
  141. package/squirrel/components/p-table-sort/p-table-sort.stories.js +1 -1
  142. package/squirrel/components/p-table-sort/p-table-sort.vue +1 -1
  143. package/squirrel/components/p-table-td/p-table-td.spec.js +3 -3
  144. package/squirrel/components/p-table-td/p-table-td.stories.js +1 -1
  145. package/squirrel/components/p-table-td/p-table-td.vue +2 -2
  146. package/squirrel/components/p-tabs/p-tabs.vue +1 -1
  147. package/squirrel/components/p-textarea/p-textarea.stories.js +1 -1
  148. package/squirrel/components/p-textarea/p-textarea.vue +1 -1
  149. package/squirrel/components/p-toggle/p-toggle.stories.js +1 -1
  150. package/squirrel/components/p-toggle/p-toggle.vue +1 -1
  151. package/squirrel/composables/useInputClasses.spec.js +1 -1
  152. package/squirrel/index.ts +1 -1
  153. package/squirrel/utils/component.ts +1 -1
  154. package/squirrel/utils/index.ts +18 -18
  155. package/squirrel/utils/inputClassesMixin.ts +1 -1
  156. package/squirrel/utils/pagination.spec.js +2 -2
  157. package/squirrel/utils/sanitization.spec.js +1 -1
  158. package/squirrel/utils/tailwind.ts +3 -2
@@ -4,15 +4,15 @@ import {
4
4
  type ModelValue,
5
5
  type Size,
6
6
  } from '@squirrel/components/p-select-list/p-select-list.types';
7
- import { type ComponentPublicInstance, type Ref, computed, nextTick, onUnmounted, ref, watch } from 'vue';
7
+ import { createInternalItems, createInternalValue } from '@squirrel/components/p-select-list/p-select-list.utils';
8
8
  import {
9
9
  type ListKeyboardNavigationInstance,
10
10
  setupListKeyboardNavigation,
11
11
  } from '@squirrel/utils/listKeyboardNavigation';
12
- import { cloneDeep, uniqBy } from 'lodash-es';
13
- import { createInternalItems, createInternalValue } from '@squirrel/components/p-select-list/p-select-list.utils';
14
12
  import { toString } from '@squirrel/utils/string';
15
13
  import { useVirtualizer } from '@tanstack/vue-virtual';
14
+ import { cloneDeep, uniqBy } from 'lodash-es';
15
+ import { type ComponentPublicInstance, computed, nextTick, onUnmounted, type Ref, ref, watch } from 'vue';
16
16
 
17
17
  type Emits = {
18
18
  (e: 'update:modelValue', modelValue: ModelValue): void;
@@ -106,7 +106,7 @@ describe('PSelectPill.vue', () => {
106
106
  ['sm', ['h-7', 'px-4', 'text-xs']],
107
107
  ['md', ['h-9', 'px-5', 'text-sm']],
108
108
  ['lg', ['h-11', 'px-7', 'text-base']],
109
- ])(`supports %s size `, async (size, classes) => {
109
+ ])(`supports %s size`, async (size, classes) => {
110
110
  const wrapper = createWrapperFor(PSelectPill, {
111
111
  props: {
112
112
  items: selectItems,
@@ -1,7 +1,7 @@
1
- import PSelectPill from '@squirrel/components/p-select-pill/p-select-pill.vue';
2
- import { expect, userEvent, within } from '@storybook/test';
3
1
  import { fieldArgTypes } from '@root/stories/common/field';
4
2
  import { getCSSTransitionDuration, sleep } from '@root/stories/common/helpers';
3
+ import PSelectPill from '@squirrel/components/p-select-pill/p-select-pill.vue';
4
+ import { expect, userEvent, within } from '@storybook/test';
5
5
 
6
6
  const ACTIVE_CLASS = 'text-p-purple-60';
7
7
 
@@ -27,7 +27,7 @@
27
27
  </template>
28
28
 
29
29
  <script lang="ts">
30
- import { type PropType, defineComponent } from 'vue';
30
+ import { defineComponent, type PropType } from 'vue';
31
31
 
32
32
  type Option = Record<string, unknown> & {
33
33
  text: string;
@@ -6,7 +6,7 @@
6
6
  </template>
7
7
 
8
8
  <script lang="ts">
9
- import { type PropType, defineComponent } from 'vue';
9
+ import { defineComponent, type PropType } from 'vue';
10
10
 
11
11
  const LOADER_TYPES = {
12
12
  rectangle: 'rectangle',
@@ -1,11 +1,11 @@
1
- import PTable from '@squirrel/components/p-table/p-table.vue';
2
- import { cloneDeep } from 'lodash-es';
3
1
  import {
4
2
  colsInjectionKey,
5
3
  isFirstColFixedInjectionKey,
6
4
  isLastColFixedInjectionKey,
7
5
  } from '@squirrel/components/p-table/p-table.types';
6
+ import PTable from '@squirrel/components/p-table/p-table.vue';
8
7
  import { createWrapperFor } from '@tests/vitest.helpers';
8
+ import { cloneDeep } from 'lodash-es';
9
9
  import { defineComponent, h, inject } from 'vue';
10
10
 
11
11
  const columns = [
@@ -79,17 +79,17 @@
79
79
  </template>
80
80
 
81
81
  <script setup lang="ts">
82
- import PTableHeaderCell from '@squirrel/components/p-table-header-cell/p-table-header-cell.vue';
83
82
  import {
84
- type TableCol,
85
83
  colsInjectionKey,
86
84
  isColsResizableInjectionKey,
87
85
  isFirstColFixedInjectionKey,
88
86
  isLastColFixedInjectionKey,
87
+ type TableCol,
89
88
  } from '@squirrel/components/p-table/p-table.types';
90
- import { computed, onBeforeUnmount, onMounted, provide, ref, watch } from 'vue';
91
- import { kebabCase } from 'lodash-es';
92
89
  import { usePTableColResize } from '@squirrel/components/p-table/usePTableColResize';
90
+ import PTableHeaderCell from '@squirrel/components/p-table-header-cell/p-table-header-cell.vue';
91
+ import { kebabCase } from 'lodash-es';
92
+ import { computed, onBeforeUnmount, onMounted, provide, ref, watch } from 'vue';
93
93
 
94
94
  type Props = {
95
95
  cols: TableCol[];
@@ -1,5 +1,5 @@
1
- import { createApp, nextTick, ref } from 'vue';
2
1
  import { usePTableColResize } from '@squirrel/components/p-table/usePTableColResize';
2
+ import { createApp, nextTick, ref } from 'vue';
3
3
 
4
4
  const withSetup = (composable) => {
5
5
  let result;
@@ -1,5 +1,5 @@
1
1
  import { MIN_WIDTH_COL_RESIZE } from '@squirrel/components/p-table/p-table.types';
2
- import { type Ref, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
2
+ import { nextTick, onBeforeUnmount, onMounted, type Ref, ref, watch } from 'vue';
3
3
 
4
4
  type Options = {
5
5
  enabled: Ref<boolean>;
@@ -1,5 +1,5 @@
1
- import { type ComponentPublicInstance, type ComputedRef, type Ref, computed, isRef, nextTick, ref, unref } from 'vue';
2
1
  import { useVirtualizer } from '@tanstack/vue-virtual';
2
+ import { type ComponentPublicInstance, computed, type ComputedRef, isRef, nextTick, type Ref, ref, unref } from 'vue';
3
3
 
4
4
  type Options = ComputedRef<{
5
5
  count: number;
@@ -1,5 +1,5 @@
1
- import PTableSort from '@squirrel/components/p-table-sort/p-table-sort.vue';
2
1
  import { SORTING_TYPES } from '@squirrel/components/p-table-sort/p-table-sort.config';
2
+ import PTableSort from '@squirrel/components/p-table-sort/p-table-sort.vue';
3
3
  import { createWrapperFor } from '@tests/vitest.helpers';
4
4
 
5
5
  describe('PTableSort.vue', () => {
@@ -1,5 +1,5 @@
1
- import PTableSort from '@squirrel/components/p-table-sort/p-table-sort.vue';
2
1
  import { SORTING_TYPES } from '@squirrel/components/p-table-sort/p-table-sort.config';
2
+ import PTableSort from '@squirrel/components/p-table-sort/p-table-sort.vue';
3
3
 
4
4
  export default {
5
5
  title: 'Components/PTableSort',
@@ -56,8 +56,8 @@
56
56
  </template>
57
57
 
58
58
  <script lang="ts">
59
- import { type PropType, defineComponent } from 'vue';
60
59
  import { SORTING_TYPES, type SortingType } from '@squirrel/components/p-table-sort/p-table-sort.config';
60
+ import { defineComponent, type PropType } from 'vue';
61
61
 
62
62
  export default defineComponent({
63
63
  name: 'PTableSort',
@@ -1,10 +1,10 @@
1
- import PTableTd from '@squirrel/components/p-table-td/p-table-td.vue';
2
1
  import {
3
2
  colsInjectionKey,
4
3
  isColsResizableInjectionKey,
5
4
  isFirstColFixedInjectionKey,
6
5
  isLastColFixedInjectionKey,
7
6
  } from '@squirrel/components/p-table/p-table.types';
7
+ import PTableTd from '@squirrel/components/p-table-td/p-table-td.vue';
8
8
  import { createWrapperFor } from '@tests/vitest.helpers';
9
9
  import { ref } from 'vue';
10
10
 
@@ -123,7 +123,7 @@ describe('PTableTd.vue', () => {
123
123
  });
124
124
  });
125
125
 
126
- it('it applies spacing on the first non-sticky column', async () => {
126
+ it('applies spacing on the first non-sticky column', async () => {
127
127
  const wrapper = createWrapperFor(PTableTd, {
128
128
  props: { colIndex: 1 },
129
129
  slots: { default: `Cell content` },
@@ -140,7 +140,7 @@ describe('PTableTd.vue', () => {
140
140
  expect([...innerDiv.classes()].sort()).toEqual(['w-max', 'pl-4', 'pr-2'].sort());
141
141
  });
142
142
 
143
- it('it applies spacing on the last non-sticky column', async () => {
143
+ it('applies spacing on the last non-sticky column', async () => {
144
144
  const wrapper = createWrapperFor(PTableTd, {
145
145
  props: { colIndex: 1 },
146
146
  slots: { default: `Cell content` },
@@ -1,5 +1,5 @@
1
- import PTableTd from '@squirrel/components/p-table-td/p-table-td.vue';
2
1
  import { colsInjectionKey } from '@squirrel/components/p-table/p-table.types';
2
+ import PTableTd from '@squirrel/components/p-table-td/p-table-td.vue';
3
3
  import { defineComponent, h, provide } from 'vue';
4
4
 
5
5
  const columns = [{ id: 1 }, { id: 2 }];
@@ -13,14 +13,14 @@
13
13
  </template>
14
14
 
15
15
  <script setup lang="ts">
16
- import { type Ref, computed, inject, ref } from 'vue';
17
16
  import {
18
- type TableCol,
19
17
  colsInjectionKey,
20
18
  isColsResizableInjectionKey,
21
19
  isFirstColFixedInjectionKey,
22
20
  isLastColFixedInjectionKey,
21
+ type TableCol,
23
22
  } from '@squirrel/components/p-table/p-table.types';
23
+ import { computed, inject, type Ref, ref } from 'vue';
24
24
 
25
25
  defineOptions({ name: 'PTableTd', inheritAttrs: false });
26
26
 
@@ -27,8 +27,8 @@
27
27
  </template>
28
28
 
29
29
  <script setup lang="ts">
30
- import { type RouteLocationRaw } from 'vue-router';
31
30
  import { type ShallowRef } from 'vue';
31
+ import { type RouteLocationRaw } from 'vue-router';
32
32
 
33
33
  // types
34
34
  type Tab = {
@@ -1,5 +1,5 @@
1
- import PTextarea from '@squirrel/components/p-textarea/p-textarea.vue';
2
1
  import { fieldArgTypes } from '@root/stories/common/field';
2
+ import PTextarea from '@squirrel/components/p-textarea/p-textarea.vue';
3
3
 
4
4
  export default {
5
5
  title: 'Components/PTextarea',
@@ -12,7 +12,7 @@
12
12
 
13
13
  <script lang="ts">
14
14
  import inputClassesMixin from '@squirrel/utils/inputClassesMixin';
15
- import { type StyleValue, defineComponent } from 'vue';
15
+ import { defineComponent, type StyleValue } from 'vue';
16
16
 
17
17
  export default defineComponent({
18
18
  name: 'PTextarea',
@@ -1,5 +1,5 @@
1
- import PToggle from '@squirrel/components/p-toggle/p-toggle.vue';
2
1
  import { fieldArgTypes } from '@root/stories/common/field';
2
+ import PToggle from '@squirrel/components/p-toggle/p-toggle.vue';
3
3
 
4
4
  export default {
5
5
  title: 'Components/PToggle',
@@ -26,7 +26,7 @@
26
26
 
27
27
  <script lang="ts">
28
28
  import inputClassesMixin from '@squirrel/utils/inputClassesMixin';
29
- import { type StyleValue, defineComponent } from 'vue';
29
+ import { defineComponent, type StyleValue } from 'vue';
30
30
 
31
31
  const TOGGLE_SIZES = {
32
32
  sm: `w-7 h-4 after:top-[2px] after:left-[2px] after:h-3 after:w-3`,
@@ -1,6 +1,6 @@
1
+ import { useInputClasses } from '@squirrel/composables/useInputClasses';
1
2
  import { SPACING_LEFT, SPACING_PREFIX, SPACING_RIGHT, SPACING_SUFFIX } from '@squirrel/utils/inputClassesShared';
2
3
  import { reactive } from 'vue';
3
- import { useInputClasses } from '@squirrel/composables/useInputClasses';
4
4
 
5
5
  const baseInputClasses = () =>
6
6
  [
package/squirrel/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import '@squirrel/assets/squirrel.css';
2
2
 
3
- export * from '@squirrel/tailwind/config';
4
3
  export * from '@squirrel/components';
5
4
  export * from '@squirrel/composables';
5
+ export * from '@squirrel/tailwind/config';
6
6
  export * from '@squirrel/utils';
@@ -1,5 +1,5 @@
1
- import { type Component } from 'vue';
2
1
  import { isPlainObject } from 'lodash-es';
2
+ import { type Component } from 'vue';
3
3
 
4
4
  // Vue produces a different type of object in dev and prod mode, so we cannot check for e.g `typeof val.render === 'function`
5
5
  export const isComponent = (val: unknown): val is Component => isPlainObject(val);
@@ -1,6 +1,6 @@
1
- import inputClassesMixin from '@squirrel/utils/inputClassesMixin';
2
1
  import { CURRENCY_INPUT_DEFAULTS } from '@squirrel/utils/currency';
3
- import { type Color, getColor, getColorDeep, getScreen } from '@squirrel/utils/tailwind';
2
+ import { getNextActiveElement, isElement, isVisible } from '@squirrel/utils/dom';
3
+ import inputClassesMixin from '@squirrel/utils/inputClassesMixin';
4
4
  import {
5
5
  ERROR_MSG,
6
6
  INPUT_BASE,
@@ -20,47 +20,47 @@ import {
20
20
  SPACING_SUFFIX,
21
21
  TEXTAREA_BASE,
22
22
  } from '@squirrel/utils/inputClassesShared';
23
- import { createPagingRange } from '@squirrel/utils/pagination';
24
- import { getNextActiveElement, isElement, isVisible } from '@squirrel/utils/dom';
25
- import { isObject } from '@squirrel/utils/object';
26
- import { sanitizeUrl } from '@squirrel/utils/sanitization';
27
23
  import { setupListKeyboardNavigation } from '@squirrel/utils/listKeyboardNavigation';
28
- import { splitStringForHighlight } from '@squirrel/utils/text';
29
24
  import { toNumberOrNull } from '@squirrel/utils/number';
25
+ import { isObject } from '@squirrel/utils/object';
26
+ import { createPagingRange } from '@squirrel/utils/pagination';
27
+ import { sanitizeUrl } from '@squirrel/utils/sanitization';
30
28
  import { toString } from '@squirrel/utils/string';
29
+ import { type Color, getColor, getColorDeep, getScreen } from '@squirrel/utils/tailwind';
30
+ import { splitStringForHighlight } from '@squirrel/utils/text';
31
31
 
32
32
  export {
33
- inputClassesMixin,
34
- CURRENCY_INPUT_DEFAULTS,
35
33
  Color,
34
+ createPagingRange,
35
+ CURRENCY_INPUT_DEFAULTS,
36
+ ERROR_MSG,
36
37
  getColor,
37
38
  getColorDeep,
39
+ getNextActiveElement,
38
40
  getScreen,
39
- ERROR_MSG,
40
41
  INPUT_BASE,
41
42
  INPUT_ERROR,
42
43
  INPUT_NORMAL,
43
44
  INPUT_SIZES,
45
+ inputClassesMixin,
44
46
  InputSize,
47
+ isElement,
48
+ isObject,
49
+ isVisible,
45
50
  LABEL_BASE,
46
51
  LABEL_REQUIRED,
47
52
  LABEL_SIZES,
53
+ sanitizeUrl,
48
54
  SELECT_ARROW,
49
55
  SELECT_BASE,
50
56
  SELECT_SIZES,
57
+ setupListKeyboardNavigation,
51
58
  SPACING_LEFT,
52
59
  SPACING_PREFIX,
53
60
  SPACING_RIGHT,
54
61
  SPACING_SUFFIX,
55
- TEXTAREA_BASE,
56
- createPagingRange,
57
- getNextActiveElement,
58
- isElement,
59
- isVisible,
60
- isObject,
61
- sanitizeUrl,
62
- setupListKeyboardNavigation,
63
62
  splitStringForHighlight,
63
+ TEXTAREA_BASE,
64
64
  toNumberOrNull,
65
65
  toString,
66
66
  };
@@ -17,7 +17,7 @@ import {
17
17
  SPACING_SUFFIX,
18
18
  TEXTAREA_BASE,
19
19
  } from '@squirrel/utils/inputClassesShared';
20
- import { type PropType, defineComponent } from 'vue';
20
+ import { defineComponent, type PropType } from 'vue';
21
21
 
22
22
  export default defineComponent({
23
23
  props: {
@@ -22,7 +22,7 @@ describe('pagination', () => {
22
22
  [18, [1, '...', 17, 18, 19, 20]],
23
23
  [19, [1, '...', 17, 18, 19, 20]],
24
24
  [20, [1, '...', 18, 19, 20]],
25
- ])('it creates paging range (%i, 20)', (currentPage, res) => {
25
+ ])('creates paging range (%i, 20)', (currentPage, res) => {
26
26
  expect(createPagingRange(currentPage, 20)).toStrictEqual(res);
27
27
  });
28
28
 
@@ -47,7 +47,7 @@ describe('pagination', () => {
47
47
  [18, [1, '...', 15, 16, 17, 18, 19, 20]],
48
48
  [19, [1, '...', 16, 17, 18, 19, 20]],
49
49
  [20, [1, '...', 17, 18, 19, 20]],
50
- ])('it creates paging range (%i, 20) with the offset set to 3', (currentPage, res) => {
50
+ ])('creates paging range (%i, 20) with the offset set to 3', (currentPage, res) => {
51
51
  expect(createPagingRange(currentPage, 20, 3)).toStrictEqual(res);
52
52
  });
53
53
 
@@ -51,7 +51,7 @@ describe('sanitizeUrl', () => {
51
51
  '&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A;',
52
52
  'jav&#x09;ascript:alert();',
53
53
  'jav\u0000ascript:alert();',
54
- ])('it adds an "unsafe:" prefix if the URL is invalid (%s)', (urlVal) => {
54
+ ])('adds an "unsafe:" prefix if the URL is invalid (%s)', (urlVal) => {
55
55
  expect(sanitizeUrl(urlVal)).toMatch(/^unsafe:/);
56
56
  });
57
57
  });
@@ -1,13 +1,14 @@
1
- import resolveConfig from 'tailwindcss/resolveConfig';
1
+ import { config as squirrelTailwindConfig } from '@squirrel/tailwind/config';
2
2
  // Relative import is used here because of
3
3
  // "Module source URI is not allowed in this document: “http://tailwind.config/”" error
4
4
  import { get } from 'lodash-es';
5
- import { config as squirrelTailwindConfig } from '@squirrel/tailwind/config';
6
5
  import type { Config } from 'tailwindcss';
6
+ import resolveConfig from 'tailwindcss/resolveConfig';
7
7
 
8
8
  const config = resolveConfig(squirrelTailwindConfig);
9
9
  const theme = config.theme as Config['theme'];
10
10
  const colors = theme?.colors;
11
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
12
  const extendedColors = theme?.extend?.colors;
12
13
  const screens = theme?.screens;
13
14