@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.
- package/dist/module.json +2 -2
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Aria/Aria.vue +5 -9
- package/dist/runtime/components/Aria/Aria.vue.d.ts +5 -0
- package/dist/runtime/components/Icon/Icon.vue +10 -31
- package/dist/runtime/components/Icon/Icon.vue.d.ts +21 -0
- package/dist/runtime/components/LibButton/LibButton.vue +58 -77
- package/dist/runtime/components/LibButton/LibButton.vue.d.ts +36 -0
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +48 -75
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +42 -0
- package/dist/runtime/components/LibColorInput/LibColorInput.vue +63 -108
- package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +63 -0
- package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +271 -352
- package/dist/runtime/components/LibColorPicker/LibColorPicker.vue.d.ts +61 -0
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +32 -57
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts +22 -0
- package/dist/runtime/components/LibDatePicker/LibDatePicker.vue +17 -38
- package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +40 -0
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +53 -82
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +34 -0
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +50 -67
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue.d.ts +34 -0
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue +7 -8
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +22 -0
- package/dist/runtime/components/LibDebug/LibDebug.vue +42 -70
- package/dist/runtime/components/LibDebug/LibDebug.vue.d.ts +32 -0
- package/dist/runtime/components/LibDevOnly/LibDevOnly.vue +18 -31
- package/dist/runtime/components/LibDevOnly/LibDevOnly.vue.d.ts +22 -0
- package/dist/runtime/components/LibFileInput/LibFileInput.vue +113 -157
- package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +43 -0
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +215 -242
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +165 -0
- package/dist/runtime/components/LibLabel/LibLabel.vue +30 -46
- package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +27 -0
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +44 -59
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +29 -0
- package/dist/runtime/components/LibNotifications/LibNotification.vue +32 -49
- package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +17 -0
- package/dist/runtime/components/LibNotifications/LibNotifications.vue +63 -84
- package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +13 -0
- package/dist/runtime/components/LibPagination/LibPagination.vue +67 -112
- package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +104 -0
- package/dist/runtime/components/LibPalette/LibPalette.vue +20 -23
- package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +14 -0
- package/dist/runtime/components/LibPopup/LibPopup.vue +314 -352
- package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +46 -0
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +70 -92
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue.d.ts +41 -0
- package/dist/runtime/components/LibRecorder/LibRecorder.vue +133 -178
- package/dist/runtime/components/LibRecorder/LibRecorder.vue.d.ts +77 -0
- package/dist/runtime/components/LibRoot/LibRoot.vue +73 -100
- package/dist/runtime/components/LibRoot/LibRoot.vue.d.ts +41 -0
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +49 -78
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +35 -0
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +123 -157
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +94 -0
- package/dist/runtime/components/LibTable/LibTable.vue +63 -100
- package/dist/runtime/components/LibTable/LibTable.vue.d.ts +45 -0
- package/dist/runtime/components/Template/NAME.vue +15 -36
- package/dist/runtime/components/Template/NAME.vue.d.ts +17 -0
- package/dist/runtime/components/TestControls/TestControls.vue +6 -9
- package/dist/runtime/components/TestControls/TestControls.vue.d.ts +5 -0
- package/dist/runtime/directives/vResizableCols.js +89 -83
- package/dist/types.d.mts +2 -6
- package/package.json +11 -11
- package/src/runtime/components/Focus.stories.ts +3 -2
- package/src/runtime/components/Icon/Icon.vue +0 -1
- package/src/runtime/components/LibButton/LibButton.vue +0 -1
- package/src/runtime/components/LibCheckbox/LibCheckbox.vue +0 -1
- package/src/runtime/components/LibColorInput/LibColorInput.vue +0 -1
- package/src/runtime/components/LibColorPicker/utils/safeConvertToHsva.ts +0 -1
- package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +0 -1
- package/src/runtime/components/LibFileInput/LibFileInput.vue +0 -1
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -1
- package/src/runtime/components/LibMultiValues/LibMultiValues.vue +0 -1
- package/src/runtime/components/LibNotifications/LibNotification.vue +0 -1
- package/src/runtime/components/LibNotifications/LibNotifications.vue +0 -1
- package/src/runtime/components/LibPagination/LibPagination.vue +0 -1
- package/src/runtime/components/LibPopup/LibPopup.vue +0 -1
- package/src/runtime/components/LibProgressBar/LibProgressBar.vue +0 -1
- package/src/runtime/components/LibRecorder/LibRecorder.vue +0 -1
- package/src/runtime/components/LibSimpleInput/LibSimpleInput.vue +0 -1
- package/src/runtime/components/LibSuggestions/LibSuggestions.vue +0 -1
- package/src/runtime/components/LibTable/LibTable.vue +0 -1
- package/src/runtime/directives/vResizableCols.ts +79 -73
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -36
- package/dist/runtime/components/Focus.stories.d.ts +0 -11
- package/dist/runtime/components/Focus.stories.js +0 -53
- package/dist/runtime/components/LibButton/LibButton.stories.d.ts +0 -12
- package/dist/runtime/components/LibButton/LibButton.stories.js +0 -94
- package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.d.ts +0 -14
- package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.js +0 -29
- package/dist/runtime/components/LibColorInput/LibColorInput.stories.d.ts +0 -7
- package/dist/runtime/components/LibColorInput/LibColorInput.stories.js +0 -58
- package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.d.ts +0 -9
- package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.js +0 -68
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.d.ts +0 -7
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.js +0 -36
- package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.d.ts +0 -11
- package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.js +0 -98
- package/dist/runtime/components/LibDebug/LibDebug.stories.d.ts +0 -9
- package/dist/runtime/components/LibDebug/LibDebug.stories.js +0 -46
- package/dist/runtime/components/LibFileInput/LibFileInput.stories.d.ts +0 -10
- package/dist/runtime/components/LibFileInput/LibFileInput.stories.js +0 -63
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.d.ts +0 -33
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.js +0 -384
- package/dist/runtime/components/LibLabel/LibLabel.stories.d.ts +0 -6
- package/dist/runtime/components/LibLabel/LibLabel.stories.js +0 -25
- package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.d.ts +0 -23
- package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.js +0 -61
- package/dist/runtime/components/LibNotifications/LibNotification.stories.d.ts +0 -15
- package/dist/runtime/components/LibNotifications/LibNotification.stories.js +0 -126
- package/dist/runtime/components/LibNotifications/LibNotifications.stories.d.ts +0 -6
- package/dist/runtime/components/LibNotifications/LibNotifications.stories.js +0 -109
- package/dist/runtime/components/LibPagination/LibPagination.stories.d.ts +0 -6
- package/dist/runtime/components/LibPagination/LibPagination.stories.js +0 -40
- package/dist/runtime/components/LibPalette/LibPalette.stories.d.ts +0 -6
- package/dist/runtime/components/LibPalette/LibPalette.stories.js +0 -20
- package/dist/runtime/components/LibPopup/LibPopup.stories.d.ts +0 -14
- package/dist/runtime/components/LibPopup/LibPopup.stories.js +0 -147
- package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.d.ts +0 -10
- package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.js +0 -81
- package/dist/runtime/components/LibRecorder/LibRecorder.stories.d.ts +0 -19
- package/dist/runtime/components/LibRecorder/LibRecorder.stories.js +0 -63
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.d.ts +0 -26
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.js +0 -78
- package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.d.ts +0 -27
- package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.js +0 -112
- package/dist/runtime/components/LibTable/LibTable.stories.d.ts +0 -16
- package/dist/runtime/components/LibTable/LibTable.stories.js +0 -156
- package/dist/runtime/components/Reset.stories.d.ts +0 -5
- package/dist/runtime/components/Reset.stories.js +0 -19
- package/dist/runtime/components/Scrolling.stories.d.ts +0 -6
- package/dist/runtime/components/Scrolling.stories.js +0 -44
- package/dist/runtime/composables/useScrollNearContainerEdges.stories.d.ts +0 -7
- package/dist/runtime/composables/useScrollNearContainerEdges.stories.js +0 -85
- package/dist/types.d.ts +0 -7
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { onMounted, ref } from "vue";
|
|
2
|
-
import { useScrollNearContainerEdges } from "./useScrollNearContainerEdges.js";
|
|
3
|
-
import { twMerge } from "../utils/twMerge.js";
|
|
4
|
-
const meta = {
|
|
5
|
-
title: "Composables/ScrollNearContainerEdges"
|
|
6
|
-
};
|
|
7
|
-
export default meta;
|
|
8
|
-
export const Primary = {
|
|
9
|
-
render: (args) => ({
|
|
10
|
-
setup: () => {
|
|
11
|
-
const containerEl = ref(null);
|
|
12
|
-
const {
|
|
13
|
-
resetScrollIndicator,
|
|
14
|
-
scrollEdges,
|
|
15
|
-
endScroll,
|
|
16
|
-
scrollIndicator,
|
|
17
|
-
isScrolling
|
|
18
|
-
} = useScrollNearContainerEdges({
|
|
19
|
-
containerEl,
|
|
20
|
-
scrollMargin: 20,
|
|
21
|
-
outerScrollMargin: 20
|
|
22
|
-
});
|
|
23
|
-
const pos = ref({ x: 0, y: 0 });
|
|
24
|
-
onMounted(() => {
|
|
25
|
-
pos.value.x = containerEl.value.getBoundingClientRect().left;
|
|
26
|
-
pos.value.y = containerEl.value.getBoundingClientRect().top;
|
|
27
|
-
});
|
|
28
|
-
const moveDrag = (e) => {
|
|
29
|
-
pos.value.x = e.clientX;
|
|
30
|
-
pos.value.y = e.clientY;
|
|
31
|
-
scrollEdges(e.clientX, e.clientY);
|
|
32
|
-
};
|
|
33
|
-
const endDrag = (_e) => {
|
|
34
|
-
endScroll();
|
|
35
|
-
document.removeEventListener("mousemove", moveDrag);
|
|
36
|
-
document.removeEventListener("mouseup", endDrag);
|
|
37
|
-
};
|
|
38
|
-
const startDrag = (_e) => {
|
|
39
|
-
document.addEventListener("mousemove", moveDrag);
|
|
40
|
-
document.addEventListener("mouseup", endDrag);
|
|
41
|
-
};
|
|
42
|
-
return {
|
|
43
|
-
args,
|
|
44
|
-
containerEl,
|
|
45
|
-
resetScrollIndicator,
|
|
46
|
-
scrollEdges,
|
|
47
|
-
endScroll,
|
|
48
|
-
startDrag,
|
|
49
|
-
scrollIndicator,
|
|
50
|
-
isScrolling,
|
|
51
|
-
twMerge,
|
|
52
|
-
pos
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
|
-
template: `
|
|
56
|
-
<div>
|
|
57
|
-
<p>Scroll the container by dragging the red box (which represents the dragging mouse position).</p>
|
|
58
|
-
<p>It should drag slow, then faster as the mouse nears the edges and scroll indicators should appear on the scrolling edges.</p>
|
|
59
|
-
</div>
|
|
60
|
-
<div
|
|
61
|
-
:class="twMerge(
|
|
62
|
-
'relative flex flex-col max-h-[300px] max-w-[300px] border-2 border-red-500',
|
|
63
|
-
isScrolling && 'after:content-[\\'\\'] after:absolute after:inset-0 after:border-transparent after:border-[15px]',
|
|
64
|
-
scrollIndicator.right && 'after:border-r-accent-500/60',
|
|
65
|
-
scrollIndicator.down && 'after:border-b-accent-500/60',
|
|
66
|
-
scrollIndicator.left && 'after:border-l-accent-500/60',
|
|
67
|
-
scrollIndicator.up && 'after:border-t-accent-500/60',
|
|
68
|
-
)"
|
|
69
|
-
|
|
70
|
-
>
|
|
71
|
-
<div
|
|
72
|
-
class="overflow-auto"
|
|
73
|
-
ref="containerEl"
|
|
74
|
-
>
|
|
75
|
-
<div class="h-[1000px] w-[1000px]"/>
|
|
76
|
-
<div
|
|
77
|
-
@mousedown="startDrag"
|
|
78
|
-
:style="\`top:\${pos.y}px; left:\${pos.x}px;\`"
|
|
79
|
-
class="h-[20px] w-[20px] -ml-[10px] -mt-[10px] bg-red-500 cursor-move fixed"
|
|
80
|
-
></div>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
`
|
|
84
|
-
})
|
|
85
|
-
};
|
package/dist/types.d.ts
DELETED