@witchcraft/ui 0.1.0 → 0.1.1

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 (138) hide show
  1. package/dist/module.json +2 -2
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/components/Aria/Aria.vue +5 -9
  4. package/dist/runtime/components/Aria/Aria.vue.d.ts +5 -0
  5. package/dist/runtime/components/Icon/Icon.vue +10 -31
  6. package/dist/runtime/components/Icon/Icon.vue.d.ts +21 -0
  7. package/dist/runtime/components/LibButton/LibButton.vue +58 -77
  8. package/dist/runtime/components/LibButton/LibButton.vue.d.ts +36 -0
  9. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +48 -75
  10. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +42 -0
  11. package/dist/runtime/components/LibColorInput/LibColorInput.vue +63 -108
  12. package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +63 -0
  13. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +271 -352
  14. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue.d.ts +61 -0
  15. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +32 -57
  16. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts +22 -0
  17. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue +17 -38
  18. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +40 -0
  19. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +53 -82
  20. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +34 -0
  21. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +50 -67
  22. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue.d.ts +34 -0
  23. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue +7 -8
  24. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +22 -0
  25. package/dist/runtime/components/LibDebug/LibDebug.vue +42 -70
  26. package/dist/runtime/components/LibDebug/LibDebug.vue.d.ts +32 -0
  27. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue +18 -31
  28. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue.d.ts +22 -0
  29. package/dist/runtime/components/LibFileInput/LibFileInput.vue +113 -157
  30. package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +43 -0
  31. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +215 -242
  32. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +165 -0
  33. package/dist/runtime/components/LibLabel/LibLabel.vue +30 -46
  34. package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +27 -0
  35. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +44 -59
  36. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +29 -0
  37. package/dist/runtime/components/LibNotifications/LibNotification.vue +32 -49
  38. package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +17 -0
  39. package/dist/runtime/components/LibNotifications/LibNotifications.vue +63 -84
  40. package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +13 -0
  41. package/dist/runtime/components/LibPagination/LibPagination.vue +67 -112
  42. package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +104 -0
  43. package/dist/runtime/components/LibPalette/LibPalette.vue +20 -23
  44. package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +14 -0
  45. package/dist/runtime/components/LibPopup/LibPopup.vue +314 -352
  46. package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +46 -0
  47. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +70 -92
  48. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue.d.ts +41 -0
  49. package/dist/runtime/components/LibRecorder/LibRecorder.vue +133 -178
  50. package/dist/runtime/components/LibRecorder/LibRecorder.vue.d.ts +77 -0
  51. package/dist/runtime/components/LibRoot/LibRoot.vue +73 -100
  52. package/dist/runtime/components/LibRoot/LibRoot.vue.d.ts +41 -0
  53. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +49 -78
  54. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +35 -0
  55. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +123 -157
  56. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +94 -0
  57. package/dist/runtime/components/LibTable/LibTable.vue +63 -100
  58. package/dist/runtime/components/LibTable/LibTable.vue.d.ts +45 -0
  59. package/dist/runtime/components/Template/NAME.vue +15 -36
  60. package/dist/runtime/components/Template/NAME.vue.d.ts +17 -0
  61. package/dist/runtime/components/TestControls/TestControls.vue +6 -9
  62. package/dist/runtime/components/TestControls/TestControls.vue.d.ts +5 -0
  63. package/dist/runtime/directives/vResizableCols.js +89 -83
  64. package/dist/types.d.mts +2 -6
  65. package/package.json +11 -11
  66. package/src/runtime/components/Focus.stories.ts +3 -2
  67. package/src/runtime/components/Icon/Icon.vue +0 -1
  68. package/src/runtime/components/LibButton/LibButton.vue +0 -1
  69. package/src/runtime/components/LibCheckbox/LibCheckbox.vue +0 -1
  70. package/src/runtime/components/LibColorInput/LibColorInput.vue +0 -1
  71. package/src/runtime/components/LibColorPicker/utils/safeConvertToHsva.ts +0 -1
  72. package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +0 -1
  73. package/src/runtime/components/LibFileInput/LibFileInput.vue +0 -1
  74. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -1
  75. package/src/runtime/components/LibMultiValues/LibMultiValues.vue +0 -1
  76. package/src/runtime/components/LibNotifications/LibNotification.vue +0 -1
  77. package/src/runtime/components/LibNotifications/LibNotifications.vue +0 -1
  78. package/src/runtime/components/LibPagination/LibPagination.vue +0 -1
  79. package/src/runtime/components/LibPopup/LibPopup.vue +0 -1
  80. package/src/runtime/components/LibProgressBar/LibProgressBar.vue +0 -1
  81. package/src/runtime/components/LibRecorder/LibRecorder.vue +0 -1
  82. package/src/runtime/components/LibSimpleInput/LibSimpleInput.vue +0 -1
  83. package/src/runtime/components/LibSuggestions/LibSuggestions.vue +0 -1
  84. package/src/runtime/components/LibTable/LibTable.vue +0 -1
  85. package/src/runtime/directives/vResizableCols.ts +79 -73
  86. package/dist/module.cjs +0 -5
  87. package/dist/module.d.ts +0 -36
  88. package/dist/runtime/components/Focus.stories.d.ts +0 -11
  89. package/dist/runtime/components/Focus.stories.js +0 -53
  90. package/dist/runtime/components/LibButton/LibButton.stories.d.ts +0 -12
  91. package/dist/runtime/components/LibButton/LibButton.stories.js +0 -94
  92. package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.d.ts +0 -14
  93. package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.js +0 -29
  94. package/dist/runtime/components/LibColorInput/LibColorInput.stories.d.ts +0 -7
  95. package/dist/runtime/components/LibColorInput/LibColorInput.stories.js +0 -58
  96. package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.d.ts +0 -9
  97. package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.js +0 -68
  98. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.d.ts +0 -7
  99. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.js +0 -36
  100. package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.d.ts +0 -11
  101. package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.js +0 -98
  102. package/dist/runtime/components/LibDebug/LibDebug.stories.d.ts +0 -9
  103. package/dist/runtime/components/LibDebug/LibDebug.stories.js +0 -46
  104. package/dist/runtime/components/LibFileInput/LibFileInput.stories.d.ts +0 -10
  105. package/dist/runtime/components/LibFileInput/LibFileInput.stories.js +0 -63
  106. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.d.ts +0 -33
  107. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.js +0 -384
  108. package/dist/runtime/components/LibLabel/LibLabel.stories.d.ts +0 -6
  109. package/dist/runtime/components/LibLabel/LibLabel.stories.js +0 -25
  110. package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.d.ts +0 -23
  111. package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.js +0 -61
  112. package/dist/runtime/components/LibNotifications/LibNotification.stories.d.ts +0 -15
  113. package/dist/runtime/components/LibNotifications/LibNotification.stories.js +0 -126
  114. package/dist/runtime/components/LibNotifications/LibNotifications.stories.d.ts +0 -6
  115. package/dist/runtime/components/LibNotifications/LibNotifications.stories.js +0 -109
  116. package/dist/runtime/components/LibPagination/LibPagination.stories.d.ts +0 -6
  117. package/dist/runtime/components/LibPagination/LibPagination.stories.js +0 -40
  118. package/dist/runtime/components/LibPalette/LibPalette.stories.d.ts +0 -6
  119. package/dist/runtime/components/LibPalette/LibPalette.stories.js +0 -20
  120. package/dist/runtime/components/LibPopup/LibPopup.stories.d.ts +0 -14
  121. package/dist/runtime/components/LibPopup/LibPopup.stories.js +0 -147
  122. package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.d.ts +0 -10
  123. package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.js +0 -81
  124. package/dist/runtime/components/LibRecorder/LibRecorder.stories.d.ts +0 -19
  125. package/dist/runtime/components/LibRecorder/LibRecorder.stories.js +0 -63
  126. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.d.ts +0 -26
  127. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.js +0 -78
  128. package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.d.ts +0 -27
  129. package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.js +0 -112
  130. package/dist/runtime/components/LibTable/LibTable.stories.d.ts +0 -16
  131. package/dist/runtime/components/LibTable/LibTable.stories.js +0 -156
  132. package/dist/runtime/components/Reset.stories.d.ts +0 -5
  133. package/dist/runtime/components/Reset.stories.js +0 -19
  134. package/dist/runtime/components/Scrolling.stories.d.ts +0 -6
  135. package/dist/runtime/components/Scrolling.stories.js +0 -44
  136. package/dist/runtime/composables/useScrollNearContainerEdges.stories.d.ts +0 -7
  137. package/dist/runtime/composables/useScrollNearContainerEdges.stories.js +0 -85
  138. package/dist/types.d.ts +0 -7
@@ -0,0 +1,45 @@
1
+ import { type TableHTMLAttributes } from "vue";
2
+ import type { ResizableOptions, TableColConfig } from "../../types/index.js.js";
3
+ import type { TailwindClassProp } from "../shared/props.js.js";
4
+ type T = any;
5
+ type RealProps = {
6
+ resizable?: Partial<ResizableOptions>;
7
+ values?: T[];
8
+ itemKey?: keyof T | ((item: T) => string);
9
+ /** Let's the table know the shape of the data since values might be empty. */
10
+ cols?: (keyof T)[];
11
+ rounded?: boolean;
12
+ border?: boolean;
13
+ cellBorder?: boolean;
14
+ header?: boolean;
15
+ colConfig?: TableColConfig<T>;
16
+ };
17
+ interface Props extends
18
+ /** @vue-ignore */
19
+ Partial<Omit<TableHTMLAttributes, "class" | "readonly" | "disabled"> & TailwindClassProp>, RealProps {
20
+ }
21
+ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
22
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & Props & Partial<{}>> & import("vue").PublicProps;
23
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
24
+ attrs: any;
25
+ slots: {
26
+ [x: string]: ((props: {
27
+ colKey: any;
28
+ style: string;
29
+ class: string;
30
+ }) => any) | undefined;
31
+ } & {
32
+ [x: string]: ((props: {
33
+ class: string;
34
+ item: any;
35
+ value: any;
36
+ }) => any) | undefined;
37
+ };
38
+ emit: {};
39
+ }>) => import("vue").VNode & {
40
+ __ctx?: Awaited<typeof __VLS_setup>;
41
+ };
42
+ export default _default;
43
+ type __VLS_PrettifyLocal<T> = {
44
+ [K in keyof T as K]: T[K];
45
+ } & {};
@@ -1,49 +1,28 @@
1
- <!-- eslint-disable -->
2
1
  <template>
3
2
  <div :class="twMerge(`
4
3
 
5
- `, ($attrs as any).class)"
6
- v-bind="{...$attrs, class:undefined}"
4
+ `, $attrs.class)"
5
+ v-bind="{ ...$attrs, class: void 0 }"
7
6
  >
8
7
  <slot/>
9
8
  </div>
10
9
  </template>
11
- <script setup lang="ts">
12
-
13
- import { computed, type HTMLAttributes, onBeforeUnmount, onMounted, type PropType, reactive, type Ref, ref, watch } from "vue"
14
-
15
- import { twMerge } from "../../utils/twMerge.js"
16
- import { baseInteractiveProps, type TailwindClassProp } from "../shared/props.js"
17
-
18
10
 
11
+ <script setup>
12
+ import { computed, onBeforeUnmount, onMounted, reactive, ref, watch } from "vue";
13
+ import { twMerge } from "../../utils/twMerge.js";
14
+ import { baseInteractiveProps } from "../shared/props.js";
19
15
  defineOptions({
20
- name: "lib-name", /* todo */
21
- inheritAttrs: false,
22
- })
23
-
24
-
25
- // const props = defineProps<{}>({ })
26
-
27
- const el = ref<null | HTMLElement>(null)
28
-
29
- const modelValue = defineModel<string>({ required: true })
30
-
31
-
16
+ name: "lib-name",
17
+ /* todo */
18
+ inheritAttrs: false
19
+ });
20
+ const el = ref(null);
21
+ const modelValue = defineModel({ type: String, ...{ required: true } });
32
22
  </script>
33
23
 
34
- <script lang="ts">
24
+ <script>
35
25
  export default {
36
- name: "lib-name",
37
- }
38
-
39
- type RealProps = {
40
- }
41
-
42
- interface Props
43
- extends
44
- /** @vue-ignore */
45
- Partial<Omit<HTMLAttributes, "class">
46
- & TailwindClassProp
47
- & RealProps
48
- > { }
26
+ name: "lib-name"
27
+ };
49
28
  </script>
@@ -0,0 +1,17 @@
1
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
2
+ modelValue: string;
3
+ }, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ "update:modelValue": (value: string) => any;
5
+ }, string, import("vue").PublicProps, Readonly<{
6
+ modelValue: string;
7
+ }> & Readonly<{
8
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
10
+ default?: (props: {}) => any;
11
+ }>;
12
+ export default _default;
13
+ type __VLS_WithSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -7,13 +7,10 @@
7
7
  </div>
8
8
  </template>
9
9
 
10
- <script setup lang="ts">
11
- import LibDarkModeSwitcher from "../LibDarkModeSwitcher/LibDarkModeSwitcher.vue"
12
-
13
- defineOptions({ name: "test-controls" })
14
- defineProps< {
15
- showOutline: boolean
16
- }>()
17
-
10
+ <script setup>
11
+ import LibDarkModeSwitcher from "../LibDarkModeSwitcher/LibDarkModeSwitcher.vue";
12
+ defineOptions({ name: "test-controls" });
13
+ defineProps({
14
+ showOutline: { type: Boolean, required: true }
15
+ });
18
16
  </script>
19
-
@@ -0,0 +1,5 @@
1
+ type __VLS_Props = {
2
+ showOutline: boolean;
3
+ };
4
+ declare const _default: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ export default _default;
@@ -48,7 +48,7 @@ export const vResizableCols = {
48
48
  return {};
49
49
  }
50
50
  };
51
- const setWidth = (col, amountInPx, el) => {
51
+ function setWidth(col, amountInPx, el) {
52
52
  const $el = getElInfo(el);
53
53
  const width = Math.max($el.margin, amountInPx);
54
54
  const index = getColEls(el).findIndex((_) => col === _);
@@ -57,12 +57,12 @@ const setWidth = (col, amountInPx, el) => {
57
57
  } else {
58
58
  $el.widths.value[index] = `${width}px`;
59
59
  }
60
- };
61
- const getBox = (el) => {
60
+ }
61
+ function getBox(el) {
62
62
  const rect = el.getBoundingClientRect();
63
63
  return { x: Math.round(rect.x), width: Math.round(rect.width) };
64
- };
65
- const getCols = (el) => {
64
+ }
65
+ function getCols(el) {
66
66
  const $el = getElInfo(el);
67
67
  if (!$el.target) unreachable();
68
68
  let col = getColEls(el)[$el.grips.get($el.target)];
@@ -77,75 +77,81 @@ const getCols = (el) => {
77
77
  }
78
78
  }
79
79
  return { col, colNext };
80
- };
81
- const createPointerDownHandler = (el) => (e) => {
82
- const $el = getElInfo(el);
83
- if (!$el.isDragging) {
84
- castType(e.target);
85
- $el.target = e.target;
86
- $el.isDragging = true;
87
- e.preventDefault();
88
- document.addEventListener("pointerup", $el.pointerUpHandler);
89
- const { col, colNext } = getCols(el);
90
- if (col === null || colNext === null) {
91
- el.classList.add("resizable-cols-error");
92
- } else {
93
- document.addEventListener("pointermove", $el.pointerMoveHandler);
94
- const box = getBox(col);
95
- if (box) {
96
- $el.offset = e.pageX - (box.x + box.width);
80
+ }
81
+ function createPointerDownHandler(el) {
82
+ return (e) => {
83
+ const $el = getElInfo(el);
84
+ if (!$el.isDragging) {
85
+ castType(e.target);
86
+ $el.target = e.target;
87
+ $el.isDragging = true;
88
+ e.preventDefault();
89
+ document.addEventListener("pointerup", $el.pointerUpHandler);
90
+ const { col, colNext } = getCols(el);
91
+ if (col === null || colNext === null) {
92
+ el.classList.add("resizable-cols-error");
93
+ } else {
94
+ document.addEventListener("pointermove", $el.pointerMoveHandler);
95
+ const box = getBox(col);
96
+ if (box) {
97
+ $el.offset = e.pageX - (box.x + box.width);
98
+ }
97
99
  }
98
100
  }
99
- }
100
- };
101
- const createPointerMoveHandler = (el) => (e) => {
102
- const $el = getElInfo(el);
103
- if ($el.isDragging) {
104
- e.preventDefault();
105
- const { col, colNext } = getCols(el);
106
- if (col !== null) {
107
- const leftBox = getBox(col);
108
- const oldWidth = leftBox.width;
109
- const leftBound = leftBox.x;
110
- const rightBox = colNext ? getBox(colNext) : getBox(el);
111
- const rightBound = rightBox.x + rightBox.width;
112
- const margin = $el.margin;
113
- const pos = e.pageX - $el.offset;
114
- if ($el.fitWidth) {
115
- if (pos > leftBound + margin && pos < rightBound - margin) {
116
- const newWidth = pos - leftBound;
117
- const diff = oldWidth - newWidth;
118
- if (rightBox.width + diff < margin) {
119
- el.classList.add("resizable-cols-error");
120
- return;
101
+ };
102
+ }
103
+ function createPointerMoveHandler(el) {
104
+ return (e) => {
105
+ const $el = getElInfo(el);
106
+ if ($el.isDragging) {
107
+ e.preventDefault();
108
+ const { col, colNext } = getCols(el);
109
+ if (col !== null) {
110
+ const leftBox = getBox(col);
111
+ const oldWidth = leftBox.width;
112
+ const leftBound = leftBox.x;
113
+ const rightBox = colNext ? getBox(colNext) : getBox(el);
114
+ const rightBound = rightBox.x + rightBox.width;
115
+ const margin = $el.margin;
116
+ const pos = e.pageX - $el.offset;
117
+ if ($el.fitWidth) {
118
+ if (pos > leftBound + margin && pos < rightBound - margin) {
119
+ const newWidth = pos - leftBound;
120
+ const diff = oldWidth - newWidth;
121
+ if (rightBox.width + diff < margin) {
122
+ el.classList.add("resizable-cols-error");
123
+ return;
124
+ }
125
+ setWidth(col, newWidth, el);
126
+ setWidth(colNext, rightBox.width + diff, el);
127
+ }
128
+ } else {
129
+ if (pos > leftBound + margin) {
130
+ const newWidth = pos - leftBound;
131
+ setWidth(col, newWidth, el);
121
132
  }
122
- setWidth(col, newWidth, el);
123
- setWidth(colNext, rightBox.width + diff, el);
124
- }
125
- } else {
126
- if (pos > leftBound + margin) {
127
- const newWidth = pos - leftBound;
128
- setWidth(col, newWidth, el);
129
133
  }
134
+ positionGrips(el);
130
135
  }
131
- positionGrips(el);
132
136
  }
133
- }
134
- };
135
- const createPointerUpHandler = (el) => (e) => {
136
- const $el = getElInfo(el);
137
- if ($el.isDragging) {
138
- e.preventDefault();
139
- $el.isDragging = false;
140
- el.classList.remove("resizable-cols-error");
141
- $el.offset = 0;
142
- delete $el.target;
143
- document.removeEventListener("pointermove", $el.pointerMoveHandler);
144
- document.removeEventListener("pointerup", $el.pointerUpHandler);
145
- document.removeEventListener("pointerleave", $el.pointerLeaveHandler);
146
- }
147
- };
148
- const createGrip = () => {
137
+ };
138
+ }
139
+ function createPointerUpHandler(el) {
140
+ return (e) => {
141
+ const $el = getElInfo(el);
142
+ if ($el.isDragging) {
143
+ e.preventDefault();
144
+ $el.isDragging = false;
145
+ el.classList.remove("resizable-cols-error");
146
+ $el.offset = 0;
147
+ delete $el.target;
148
+ document.removeEventListener("pointermove", $el.pointerMoveHandler);
149
+ document.removeEventListener("pointerup", $el.pointerUpHandler);
150
+ document.removeEventListener("pointerleave", $el.pointerLeaveHandler);
151
+ }
152
+ };
153
+ }
154
+ function createGrip() {
149
155
  const grip = document.createElement("div");
150
156
  grip.style.position = "absolute";
151
157
  grip.style.cursor = "col-resize";
@@ -153,31 +159,31 @@ const createGrip = () => {
153
159
  grip.style.bottom = "0";
154
160
  grip.classList.add("grip");
155
161
  return grip;
156
- };
162
+ }
157
163
  const removeGrips = (el) => {
158
164
  const grips = Array.from(el.querySelectorAll(".grip") ?? []);
159
165
  for (const grip of grips) {
160
166
  el.removeChild(grip);
161
167
  }
162
168
  };
163
- const getTestGripSize = (el) => {
169
+ function getTestGripSize(el) {
164
170
  const testGrip = createGrip();
165
171
  el.appendChild(testGrip);
166
172
  const dynamicMinWidth = getBox(testGrip).width * 3;
167
173
  el.removeChild(testGrip);
168
174
  return dynamicMinWidth;
169
- };
170
- const getElInfo = (el) => {
175
+ }
176
+ function getElInfo(el) {
171
177
  const $el = elMap.get(el);
172
178
  if (!$el) unreachable("El went missing.");
173
179
  return $el;
174
- };
175
- const getColEls = (el) => {
180
+ }
181
+ function getColEls(el) {
176
182
  const $el = elMap.get(el);
177
183
  if (!$el) unreachable("El went missing.");
178
184
  return [...el.querySelectorAll(`:scope ${$el.selector ? $el.selector : "tr > td"}`)];
179
- };
180
- const setupColumns = (el, opts) => {
185
+ }
186
+ function setupColumns(el, opts) {
181
187
  const gripWidth = getTestGripSize(el);
182
188
  const $el = {
183
189
  grips: /* @__PURE__ */ new Map(),
@@ -207,8 +213,8 @@ const setupColumns = (el, opts) => {
207
213
  }
208
214
  positionGrips(el);
209
215
  el.classList.add("resizable-cols-setup");
210
- };
211
- const positionGrips = (el) => {
216
+ }
217
+ function positionGrips(el) {
212
218
  let xPos = 0;
213
219
  const $el = getElInfo(el);
214
220
  for (const grip of $el.grips.keys()) {
@@ -220,8 +226,8 @@ const positionGrips = (el) => {
220
226
  grip.style.left = `${xPos + colBox.width - gripBox.width / 2}px`;
221
227
  xPos += colBox.width;
222
228
  }
223
- };
224
- const setColWidths = (el, children) => {
229
+ }
230
+ function setColWidths(el, children) {
225
231
  const $el = getElInfo(el);
226
232
  const header = children ?? getColEls(el).slice(0, $el.colCount);
227
233
  const len = $el.colCount;
@@ -239,8 +245,8 @@ const setColWidths = (el, children) => {
239
245
  } else {
240
246
  el.style.minWidth = "";
241
247
  }
242
- };
243
- const teardownColumns = (el) => {
248
+ }
249
+ function teardownColumns(el) {
244
250
  const $el = getElInfo(el);
245
251
  el.removeEventListener("pointerdown", $el.pointerDownHandler);
246
252
  document.removeEventListener("pointermove", $el.pointerMoveHandler);
@@ -251,4 +257,4 @@ const teardownColumns = (el) => {
251
257
  elMap.delete(el);
252
258
  el.classList.remove("resizable-cols-setup");
253
259
  removeGrips(el);
254
- };
260
+ }
package/dist/types.d.mts CHANGED
@@ -1,7 +1,3 @@
1
- import type { NuxtModule } from '@nuxt/schema'
1
+ export { default } from './module.mjs'
2
2
 
3
- import type { default as Module } from './module.js'
4
-
5
- export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
-
7
- export { default } from './module.js'
3
+ export { type ModuleOptions } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@witchcraft/ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Vue component library.",
5
5
  "type": "module",
6
6
  "main": "./dist/runtime/main.lib.js",
@@ -53,8 +53,8 @@
53
53
  "./utils.css": "./src/runtime/assets/utils.css",
54
54
  "./base.css": "./src/runtime/assets/base.css",
55
55
  "./nuxt": {
56
- "import": "./dist/module.mjs",
57
- "require": "./dist/module.cjs"
56
+ "types": "./dist/types.d.mts",
57
+ "import": "./dist/module.mjs"
58
58
  },
59
59
  "./types": {
60
60
  "types": "./dist/runtime/types/index.d.ts",
@@ -103,8 +103,8 @@
103
103
  "@alanscodelog/utils": "^5.1.0",
104
104
  "@egoist/vue-to-react": "^1.2.0",
105
105
  "@iconify/json": "^2.2.323",
106
- "@nuxt/kit": "^3.16.2",
107
- "@nuxt/schema": "^3.16.2",
106
+ "@nuxt/kit": "^4.0.1",
107
+ "@nuxt/schema": "^4.0.1",
108
108
  "@nuxt/types": "^2.17.3",
109
109
  "@tailwindcss/vite": "^4.1.0",
110
110
  "@witchcraft/nuxt-utils": "^0.1.0",
@@ -129,7 +129,7 @@
129
129
  "@commitlint/cli": "^19.3.0",
130
130
  "@internationalized/date": "^3.1.0",
131
131
  "@nuxt/eslint-config": "^1.3.0",
132
- "@nuxt/module-builder": "^0.8.4",
132
+ "@nuxt/module-builder": "^1.0.2",
133
133
  "@nuxtjs/i18n": "^9.5.3",
134
134
  "@playwright/test": "=1.50.0",
135
135
  "@rollup/plugin-node-resolve": "^16.0.1",
@@ -147,15 +147,15 @@
147
147
  "@storybook/vue3-vite": "^8.6.12",
148
148
  "@tailwindcss/cli": "^4.1.4",
149
149
  "@tailwindcss/postcss": "^4.1.2",
150
- "@types/node": "^22.14.0",
151
- "@vitejs/plugin-vue": "^5.0.4",
150
+ "@types/node": "^24.1.0",
151
+ "@vitejs/plugin-vue": "^6.0.0",
152
152
  "@vue/runtime-core": "^3.4.27",
153
153
  "@vue/runtime-dom": "^3.4.27",
154
154
  "@vueuse/components": "^13.0.0",
155
155
  "@vueuse/core": "^13.0.0",
156
156
  "autoprefixer": "^10.4.19",
157
157
  "concurrently": "^9.1.2",
158
- "eslint": "=9.12.0",
158
+ "eslint": "^9.32.0",
159
159
  "eslint-plugin-jsdoc": "^48.0.0",
160
160
  "http-server": "^14.1.1",
161
161
  "husky": "^9.0.11",
@@ -171,11 +171,11 @@
171
171
  "ts-node": "^10.9.2",
172
172
  "typescript": "~5.8.2",
173
173
  "unbuild": "^3.5.0",
174
- "vite": "^6.2.5",
174
+ "vite": "^7.0.6",
175
175
  "vite-plugin-externalize-deps": "^0.9.0",
176
176
  "vite-tsconfig-paths": "^5.0.1",
177
177
  "vue": "^3.5.13",
178
- "vue-tsc": "3.0.0-beta.5",
178
+ "vue-tsc": "3.0.4",
179
179
  "wait-on": "^8.0.3"
180
180
  },
181
181
  "author": "Alan <alanscodelog@gmail.com>",
@@ -24,13 +24,14 @@ const template = `
24
24
  <div class="outline-hidden focus:border-danger-500 border border-accent-600" tabindex="0">Has Manual Focus Classes</div>
25
25
  `
26
26
  export default meta
27
- type Story = StoryObj<typeof NAME>
27
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
28
+ type Story = StoryObj<{}>
28
29
 
29
30
  export const Primary: Story = {
30
31
  render: args => ({
31
32
  components,
32
33
  setup: () => {
33
- const el = ref<HTMLElement>(null)
34
+ const el = ref<HTMLElement | null>(null)
34
35
  onMounted(() => {
35
36
  // el.value.focus()
36
37
  })
@@ -20,7 +20,6 @@ defineOptions({
20
20
 
21
21
  const $attrs = useAttrs() as any
22
22
 
23
- // eslint-disable-next-line no-use-before-define
24
23
  const props = defineProps<Props>()
25
24
 
26
25
 
@@ -205,7 +205,6 @@ defineOptions({
205
205
 
206
206
  const fallbackId = getFallbackId()
207
207
 
208
- // eslint-disable-next-line no-use-before-define
209
208
  const props = withDefaults(defineProps<Props>(), {
210
209
  color: false,
211
210
  label: "",
@@ -88,7 +88,6 @@ const $slots = useSlots()
88
88
  /* todo multi states */
89
89
 
90
90
  const fallbackId = getFallbackId()
91
- // eslint-disable-next-line no-use-before-define
92
91
  const props = withDefaults(defineProps<Props>(), {
93
92
  ...baseInteractivePropsDefaults,
94
93
  })
@@ -111,7 +111,6 @@ const swatchClasses = `
111
111
  const fallbackId = getFallbackId()
112
112
 
113
113
  const t = useInjectedI18n()
114
- // eslint-disable-next-line no-use-before-define
115
114
  const props = withDefaults(defineProps<Props>(), {
116
115
  allowAlpha: true,
117
116
  border: true,
@@ -1,5 +1,4 @@
1
1
  import { clampNumber } from "@alanscodelog/utils/clampNumber.js"
2
- import { unreachable } from "@alanscodelog/utils/unreachable.js"
3
2
  import Color from "colorjs.io"
4
3
 
5
4
  import type { HsvaColor, RgbaColor } from "../../../types/index.js"
@@ -59,7 +59,6 @@ const emit = defineEmits<{
59
59
  }>()
60
60
  const $attrs = useAttrs()
61
61
 
62
- // eslint-disable-next-line no-use-before-define
63
62
  withDefaults(defineProps<Props>(), { showLabel: true })
64
63
 
65
64
 
@@ -207,7 +207,6 @@ const emits = defineEmits<{
207
207
  }>()
208
208
 
209
209
  const fallbackId = getFallbackId()
210
- // eslint-disable-next-line no-use-before-define
211
210
  const props = withDefaults(defineProps<Props>(), {
212
211
  multiple: false,
213
212
  formats: () => ["image/*", ".jpeg", ".jpg", ".png"],
@@ -185,7 +185,6 @@ const emit = defineEmits<{
185
185
 
186
186
  const fallbackId = getFallbackId()
187
187
 
188
- // eslint-disable-next-line no-use-before-define
189
188
  const props = withDefaults(defineProps<Props>(), {
190
189
  valid: true,
191
190
  suggestions: undefined,
@@ -89,7 +89,6 @@ defineOptions({
89
89
  })
90
90
 
91
91
  const $ = useDivideAttrs(["item"] as const)
92
- // eslint-disable-next-line no-use-before-define
93
92
  const props = withDefaults(defineProps<Props>(), {
94
93
  ...baseInteractivePropsDefaults
95
94
  })
@@ -95,7 +95,6 @@ defineOptions({
95
95
  })
96
96
  const $attrs = useAttrs()
97
97
 
98
- // eslint-disable-next-line no-use-before-define
99
98
  const props = withDefaults(defineProps<Props>(), {
100
99
  handler: undefined,
101
100
  })
@@ -67,7 +67,6 @@ defineOptions({
67
67
  })
68
68
 
69
69
 
70
- // eslint-disable-next-line no-use-before-define
71
70
  const props = defineProps<Props>()
72
71
 
73
72
  const dialogEl = ref<HTMLDialogElement | null>(null)
@@ -170,7 +170,6 @@ defineOptions({
170
170
  inheritAttrs: false,
171
171
  })
172
172
 
173
- // eslint-disable-next-line no-use-before-define
174
173
  const props = withDefaults(defineProps<Props>(), {
175
174
  customRoute: (route: string, i: number) => {
176
175
  if (i === 0 || i === 1) {
@@ -58,7 +58,6 @@ import { isArray } from "@alanscodelog/utils/isArray.js"
58
58
  import type { IPopupReference, PopupPosition, PopupPositioner, PopupPositionModifier, SimpleDOMRect } from "../../types/index.js"
59
59
 
60
60
  const fallbackId = getFallbackId()
61
- // eslint-disable-next-line no-use-before-define
62
61
  const props = withDefaults(defineProps<Props>(), {
63
62
  useBackdrop: true,
64
63
  useDialogForBackdrop: false,
@@ -107,7 +107,6 @@ defineOptions({
107
107
  inheritAttrs: false,
108
108
  })
109
109
  const fallbackId = getFallbackId()
110
- // eslint-disable-next-line no-use-before-define
111
110
  const props = withDefaults(defineProps<Props>(), {
112
111
  autohideOnComplete: -1,
113
112
  keepSpaceWhenHidden: false,
@@ -93,7 +93,6 @@ const emits = defineEmits<{
93
93
  (e: "focus:parent"): void
94
94
  }>()
95
95
  const fallbackId = getFallbackId()
96
- // eslint-disable-next-line no-use-before-define
97
96
  const props = withDefaults(defineProps<Props>(), {
98
97
  recordingTitle: "",
99
98
  id: undefined,
@@ -87,7 +87,6 @@ defineOptions({
87
87
 
88
88
  const fallbackId = getFallbackId()
89
89
 
90
- // eslint-disable-next-line no-use-before-define
91
90
  const props = withDefaults(defineProps<Props>(), {
92
91
  id: "",
93
92
  placeholder: "",