@witchcraft/ui 0.4.0-beta.1 → 0.4.0-beta.10
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/README.md +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/build/WitchcraftUiResolver.js +1 -1
- package/dist/runtime/components/WCheckbox/WCheckbox.vue +1 -0
- package/dist/runtime/components/WColorInput/WColorInput.d.vue.ts +1 -1
- package/dist/runtime/components/WColorInput/WColorInput.vue.d.ts +1 -1
- package/dist/runtime/components/WColorPicker/WColorPicker.d.vue.ts +2 -2
- package/dist/runtime/components/WColorPicker/WColorPicker.vue +1 -0
- package/dist/runtime/components/WColorPicker/WColorPicker.vue.d.ts +2 -2
- package/dist/runtime/components/WCombobox/WCombobox.d.vue.ts +3 -1
- package/dist/runtime/components/WCombobox/WCombobox.vue +8 -5
- package/dist/runtime/components/WCombobox/WCombobox.vue.d.ts +3 -1
- package/dist/runtime/components/WDatePicker/WRangeDatePicker.vue +5 -0
- package/dist/runtime/components/WDatePicker/WSingleDatePicker.vue +5 -0
- package/dist/runtime/components/WDebug/WDebug.vue +1 -0
- package/dist/runtime/components/WFileInput/WFileInput.vue +3 -0
- package/dist/runtime/components/WMultiValues/WMultiValues.vue +1 -0
- package/dist/runtime/components/WNotifications/WNotification.vue +2 -0
- package/dist/runtime/components/WPopover/WPopover.d.vue.ts +5 -3
- package/dist/runtime/components/WPopover/WPopover.vue +26 -20
- package/dist/runtime/components/WPopover/WPopover.vue.d.ts +5 -3
- package/dist/runtime/components/WPopup/WPopup.d.vue.ts +11 -1
- package/dist/runtime/components/WPopup/WPopup.vue +35 -3
- package/dist/runtime/components/WPopup/WPopup.vue.d.ts +11 -1
- package/dist/runtime/components/WSimpleInput/WSimpleInput.d.vue.ts +2 -1
- package/dist/runtime/components/WSimpleInput/WSimpleInput.vue +2 -1
- package/dist/runtime/components/WSimpleInput/WSimpleInput.vue.d.ts +2 -1
- package/dist/runtime/components/WTooltip/WTooltip.vue +1 -0
- package/package.json +1 -1
- package/src/module.ts +1 -1
- package/src/runtime/build/WitchcraftUiResolver.ts +1 -1
- package/src/runtime/components/WCheckbox/WCheckbox.vue +2 -0
- package/src/runtime/components/WColorPicker/WColorPicker.vue +2 -0
- package/src/runtime/components/WCombobox/WCombobox.vue +9 -5
- package/src/runtime/components/WDatePicker/WRangeDatePicker.vue +6 -0
- package/src/runtime/components/WDatePicker/WSingleDatePicker.vue +6 -0
- package/src/runtime/components/WDebug/WDebug.vue +2 -0
- package/src/runtime/components/WFileInput/WFileInput.vue +4 -0
- package/src/runtime/components/WMultiValues/WMultiValues.vue +2 -0
- package/src/runtime/components/WNotifications/WNotification.vue +3 -0
- package/src/runtime/components/WPopover/WPopover.vue +29 -22
- package/src/runtime/components/WPopup/WPopup.stories.ts +59 -15
- package/src/runtime/components/WPopup/WPopup.vue +35 -3
- package/src/runtime/components/WSimpleInput/WSimpleInput.vue +2 -1
- package/src/runtime/components/WTable/WTable.vue +0 -1
- package/src/runtime/components/WTooltip/WTooltip.vue +2 -0
- package/types/components.d.ts +1 -0
package/README.md
CHANGED
|
@@ -206,7 +206,7 @@ usePreHydrationValue(finalId, modelValue)
|
|
|
206
206
|
* If the component requires general docs, they should be written here over the export default.
|
|
207
207
|
*/
|
|
208
208
|
export default {
|
|
209
|
-
name: "
|
|
209
|
+
name: "WComponentName"
|
|
210
210
|
// https://v3.vuejs.org/guide/typescript-support.html#annotating-props
|
|
211
211
|
}
|
|
212
212
|
</script>```
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -19,7 +19,7 @@ const componentsInfo = globFiles([
|
|
|
19
19
|
`!**/Template/**.vue`
|
|
20
20
|
], [], (filepath, name) => ({
|
|
21
21
|
originalName: name,
|
|
22
|
-
name: name.startsWith("
|
|
22
|
+
name: name.startsWith("W") ? name.replace("W", "PREFIX") : `PREFIX${name}`,
|
|
23
23
|
filepath
|
|
24
24
|
}));
|
|
25
25
|
const module$1 = defineNuxtModule({
|
|
@@ -5,7 +5,7 @@ export const WitchcraftUiResolver = ({
|
|
|
5
5
|
} = {}) => (componentName) => {
|
|
6
6
|
if (componentName.startsWith(prefix)) {
|
|
7
7
|
const n = componentName.slice(1);
|
|
8
|
-
const filename = prefixless.includes(n) ? n : `
|
|
8
|
+
const filename = prefixless.includes(n) ? n : `W${n}`;
|
|
9
9
|
if (!filter(n)) {
|
|
10
10
|
return void 0;
|
|
11
11
|
}
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
<script setup>
|
|
85
85
|
import { CheckboxIndicator, CheckboxRoot } from "reka-ui";
|
|
86
86
|
import { useAttrs } from "vue";
|
|
87
|
+
import ILucideCheck from "~icons/lucide/check";
|
|
87
88
|
import { useFallbackId } from "../../composables/useFallbackId.js";
|
|
88
89
|
import { usePreHydrationValue } from "../../composables/usePreHydrationValue.js";
|
|
89
90
|
import { twMerge } from "../../utils/twMerge.js";
|
|
@@ -35,11 +35,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
35
35
|
}>, {
|
|
36
36
|
border: boolean;
|
|
37
37
|
allowAlpha: boolean;
|
|
38
|
+
copyTransform: (val: HsvaColor, stringVal: string) => any;
|
|
38
39
|
stringPrecision: number;
|
|
39
40
|
customRepresentation: {
|
|
40
41
|
fromHsvaToString: (hsva: HsvaColor, includeAlpha: boolean) => string;
|
|
41
42
|
};
|
|
42
|
-
copyTransform: (val: HsvaColor, stringVal: string) => any;
|
|
43
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
44
|
declare const _default: typeof __VLS_export;
|
|
45
45
|
export default _default;
|
|
@@ -35,11 +35,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
35
35
|
}>, {
|
|
36
36
|
border: boolean;
|
|
37
37
|
allowAlpha: boolean;
|
|
38
|
+
copyTransform: (val: HsvaColor, stringVal: string) => any;
|
|
38
39
|
stringPrecision: number;
|
|
39
40
|
customRepresentation: {
|
|
40
41
|
fromHsvaToString: (hsva: HsvaColor, includeAlpha: boolean) => string;
|
|
41
42
|
};
|
|
42
|
-
copyTransform: (val: HsvaColor, stringVal: string) => any;
|
|
43
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
44
|
declare const _default: typeof __VLS_export;
|
|
45
45
|
export default _default;
|
|
@@ -45,14 +45,14 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
45
45
|
"onUpdate:tempValue"?: ((value: RgbaColor | undefined) => any) | undefined;
|
|
46
46
|
}>, {
|
|
47
47
|
border: boolean;
|
|
48
|
-
valid: boolean;
|
|
49
48
|
allowAlpha: boolean;
|
|
49
|
+
copyTransform: (val: HsvaColor, stringVal: string) => any;
|
|
50
50
|
stringPrecision: number;
|
|
51
51
|
customRepresentation: {
|
|
52
52
|
fromHsvaToString: (hsva: HsvaColor, includeAlpha: boolean) => string;
|
|
53
53
|
fromStringToHsva?: (string: string) => HsvaColor | undefined;
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
valid: boolean;
|
|
56
56
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
57
57
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
58
58
|
declare const _default: typeof __VLS_export;
|
|
@@ -189,6 +189,7 @@ import { computed, onMounted, reactive, ref, useAttrs, watch } from "vue";
|
|
|
189
189
|
import { safeConvertToHsva } from "./utils/safeConvertToHsva.js";
|
|
190
190
|
import { safeConvertToRgba } from "./utils/safeConvertToRgba.js";
|
|
191
191
|
import { toLowPrecisionRgbaString } from "./utils/toLowPrecisionRgbaString.js";
|
|
192
|
+
import ILucideCopy from "~icons/lucide/copy";
|
|
192
193
|
import { useFallbackId } from "../../composables/useFallbackId.js";
|
|
193
194
|
import { useInjectedI18n } from "../../composables/useInjectedI18n.js";
|
|
194
195
|
import { copy } from "../../helpers/copy.js";
|
|
@@ -45,14 +45,14 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
45
45
|
"onUpdate:tempValue"?: ((value: RgbaColor | undefined) => any) | undefined;
|
|
46
46
|
}>, {
|
|
47
47
|
border: boolean;
|
|
48
|
-
valid: boolean;
|
|
49
48
|
allowAlpha: boolean;
|
|
49
|
+
copyTransform: (val: HsvaColor, stringVal: string) => any;
|
|
50
50
|
stringPrecision: number;
|
|
51
51
|
customRepresentation: {
|
|
52
52
|
fromHsvaToString: (hsva: HsvaColor, includeAlpha: boolean) => string;
|
|
53
53
|
fromStringToHsva?: (string: string) => HsvaColor | undefined;
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
valid: boolean;
|
|
56
56
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
57
57
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
58
58
|
declare const _default: typeof __VLS_export;
|
|
@@ -43,9 +43,9 @@ declare const __VLS_export: <TSuggestion extends NonNullable<AcceptableValue>>(_
|
|
|
43
43
|
}) & {
|
|
44
44
|
"onUpdate:modelValue"?: ((value: TSuggestion) => any) | undefined;
|
|
45
45
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
46
|
+
onSave?: ((value: string) => any) | undefined;
|
|
46
47
|
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
47
48
|
"onUpdate:loading"?: ((value: boolean) => any) | undefined;
|
|
48
|
-
onSave?: ((value: string) => any) | undefined;
|
|
49
49
|
onNew?: ((value: string) => any) | undefined;
|
|
50
50
|
}> & (typeof globalThis extends {
|
|
51
51
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -54,6 +54,8 @@ declare const __VLS_export: <TSuggestion extends NonNullable<AcceptableValue>>(_
|
|
|
54
54
|
attrs: any;
|
|
55
55
|
slots: {
|
|
56
56
|
'loading-indicator'?: (props: {}) => any;
|
|
57
|
+
} & {
|
|
58
|
+
right?: (props: {}) => any;
|
|
57
59
|
} & {
|
|
58
60
|
trigger?: (props: {
|
|
59
61
|
open: boolean;
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
border
|
|
39
39
|
border-neutral-300
|
|
40
40
|
dark:border-neutral-700
|
|
41
|
-
bg-
|
|
41
|
+
bg-white
|
|
42
42
|
dark:bg-neutral-800/50
|
|
43
43
|
focus:bg-bg
|
|
44
44
|
dark:focus:bg-neutral-800
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
has-[input:invalid]:border-danger-500
|
|
49
49
|
invalid:border-danger-500
|
|
50
50
|
`,
|
|
51
|
-
open && popupSide === 'top' && `rounded-tl-none rounded-tr-none`,
|
|
52
|
-
open && popupSide === 'bottom' && `rounded-bl-none rounded-br-none`
|
|
51
|
+
filtered.length > 0 && open && popupSide === 'top' && `rounded-tl-none rounded-tr-none`,
|
|
52
|
+
filtered.length > 0 && open && popupSide === 'bottom' && `rounded-bl-none rounded-br-none`
|
|
53
53
|
)"
|
|
54
54
|
>
|
|
55
55
|
<!-- @vue-expect-error aria/keydown can be defined -->
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
</WIcon>
|
|
96
96
|
</slot>
|
|
97
97
|
</Transition>
|
|
98
|
+
<slot name="right"/>
|
|
98
99
|
<ComboboxTrigger
|
|
99
100
|
:as-child="true"
|
|
100
101
|
>
|
|
@@ -104,7 +105,7 @@
|
|
|
104
105
|
>
|
|
105
106
|
<WButton
|
|
106
107
|
:border="false"
|
|
107
|
-
class="combobox--toggle p-0"
|
|
108
|
+
class="combobox--toggle p-0 text-neutral-800 dark:text-neutral-200"
|
|
108
109
|
:aria-label="open ? 'Close' : 'Open'"
|
|
109
110
|
>
|
|
110
111
|
<slot
|
|
@@ -114,7 +115,7 @@
|
|
|
114
115
|
<WIcon
|
|
115
116
|
:class="twMerge(`combobox--toggle scale-150`, open && `rotate-180`)"
|
|
116
117
|
>
|
|
117
|
-
<i-chevron-
|
|
118
|
+
<i-lucide-chevron-down/>
|
|
118
119
|
</WIcon>
|
|
119
120
|
</slot>
|
|
120
121
|
</WButton>
|
|
@@ -308,6 +309,8 @@ import {
|
|
|
308
309
|
useFilter
|
|
309
310
|
} from "reka-ui";
|
|
310
311
|
import { computed, nextTick, ref, useAttrs, useSlots, useTemplateRef, watch } from "vue";
|
|
312
|
+
import ILucideChevronDown from "~icons/lucide/chevron-down";
|
|
313
|
+
import ILucideLoaderCircle from "~icons/lucide/loader-circle";
|
|
311
314
|
import { useDelayedLoadingIndicator } from "../../composables/useDelayedLoadingIndicator.js";
|
|
312
315
|
import { useDisplayForReka } from "../../composables/useDisplayForReka.js";
|
|
313
316
|
import { useFallbackId } from "../../composables/useFallbackId.js";
|
|
@@ -43,9 +43,9 @@ declare const __VLS_export: <TSuggestion extends NonNullable<AcceptableValue>>(_
|
|
|
43
43
|
}) & {
|
|
44
44
|
"onUpdate:modelValue"?: ((value: TSuggestion) => any) | undefined;
|
|
45
45
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
46
|
+
onSave?: ((value: string) => any) | undefined;
|
|
46
47
|
"onUpdate:searchTerm"?: ((value: string) => any) | undefined;
|
|
47
48
|
"onUpdate:loading"?: ((value: boolean) => any) | undefined;
|
|
48
|
-
onSave?: ((value: string) => any) | undefined;
|
|
49
49
|
onNew?: ((value: string) => any) | undefined;
|
|
50
50
|
}> & (typeof globalThis extends {
|
|
51
51
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -54,6 +54,8 @@ declare const __VLS_export: <TSuggestion extends NonNullable<AcceptableValue>>(_
|
|
|
54
54
|
attrs: any;
|
|
55
55
|
slots: {
|
|
56
56
|
'loading-indicator'?: (props: {}) => any;
|
|
57
|
+
} & {
|
|
58
|
+
right?: (props: {}) => any;
|
|
57
59
|
} & {
|
|
58
60
|
trigger?: (props: {
|
|
59
61
|
open: boolean;
|
|
@@ -3,6 +3,11 @@ import { getLocalTimeZone } from "@internationalized/date";
|
|
|
3
3
|
import { DateRangePickerArrow, DateRangePickerCalendar, DateRangePickerCell, DateRangePickerCellTrigger, DateRangePickerContent, DateRangePickerField, DateRangePickerGrid, DateRangePickerGridBody, DateRangePickerGridHead, DateRangePickerGridRow, DateRangePickerHeadCell, DateRangePickerHeader, DateRangePickerHeading, DateRangePickerInput, DateRangePickerNext, DateRangePickerPrev, DateRangePickerRoot, DateRangePickerTrigger } from "reka-ui";
|
|
4
4
|
import { onBeforeUnmount, ref, toRaw, useAttrs, watch } from "vue";
|
|
5
5
|
import { convertDateWithFallback, getNow, toEmittableDate } from "./helpers.js";
|
|
6
|
+
import ILucideCalendarRange from "~icons/lucide/calendar-range";
|
|
7
|
+
import ILucideChevronLeft from "~icons/lucide/chevron-left";
|
|
8
|
+
import ILucideChevronRight from "~icons/lucide/chevron-right";
|
|
9
|
+
import ILucideChevronsLeft from "~icons/lucide/chevrons-left";
|
|
10
|
+
import ILucideChevronsRight from "~icons/lucide/chevrons-right";
|
|
6
11
|
import { useInjectedLocale } from "../../composables/useInjectedLocale.js";
|
|
7
12
|
import { twMerge } from "../../utils/twMerge.js";
|
|
8
13
|
import WIcon from "../WIcon/WIcon.vue";
|
|
@@ -3,6 +3,11 @@ import { getLocalTimeZone } from "@internationalized/date";
|
|
|
3
3
|
import { DatePickerArrow, DatePickerCalendar, DatePickerCell, DatePickerCellTrigger, DatePickerContent, DatePickerField, DatePickerGrid, DatePickerGridBody, DatePickerGridHead, DatePickerGridRow, DatePickerHeadCell, DatePickerHeader, DatePickerHeading, DatePickerInput, DatePickerNext, DatePickerPrev, DatePickerRoot, DatePickerTrigger } from "reka-ui";
|
|
4
4
|
import { onBeforeUnmount, ref, toRaw, useAttrs, watch } from "vue";
|
|
5
5
|
import { convertDateWithFallback, getNow, toEmittableDate } from "./helpers.js";
|
|
6
|
+
import ILucideCalendarDays from "~icons/lucide/calendar-days";
|
|
7
|
+
import ILucideChevronLeft from "~icons/lucide/chevron-left";
|
|
8
|
+
import ILucideChevronRight from "~icons/lucide/chevron-right";
|
|
9
|
+
import ILucideChevronsLeft from "~icons/lucide/chevrons-left";
|
|
10
|
+
import ILucideChevronsRight from "~icons/lucide/chevrons-right";
|
|
6
11
|
import { useInjectedLocale } from "../../composables/useInjectedLocale.js";
|
|
7
12
|
import { twMerge } from "../../utils/twMerge.js";
|
|
8
13
|
import WIcon from "../WIcon/WIcon.vue";
|
|
@@ -226,6 +226,9 @@
|
|
|
226
226
|
|
|
227
227
|
<script setup>
|
|
228
228
|
import { computed, onBeforeUnmount, ref, shallowReactive, watch } from "vue";
|
|
229
|
+
import ILucideFile from "~icons/lucide/file";
|
|
230
|
+
import ILucideUpload from "~icons/lucide/upload";
|
|
231
|
+
import ILucideX from "~icons/lucide/x";
|
|
229
232
|
import { useFallbackId } from "../../composables/useFallbackId.js";
|
|
230
233
|
import { useInjectedI18n } from "../../composables/useInjectedI18n.js";
|
|
231
234
|
import { twMerge } from "../../utils/twMerge.js";
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
<script setup>
|
|
87
87
|
import { removeIfIn } from "@alanscodelog/utils/removeIfIn";
|
|
88
88
|
import { computed, nextTick, ref, useAttrs } from "vue";
|
|
89
|
+
import ILucideX from "~icons/lucide/x";
|
|
89
90
|
import { copy } from "../../helpers/copy.js";
|
|
90
91
|
import { twMerge } from "../../utils/twMerge.js";
|
|
91
92
|
import WButton from "../WButton/WButton.vue";
|
|
@@ -177,6 +177,8 @@
|
|
|
177
177
|
|
|
178
178
|
<script setup>
|
|
179
179
|
import { computed, onMounted, ref, useAttrs } from "vue";
|
|
180
|
+
import ILucideCopy from "~icons/lucide/copy";
|
|
181
|
+
import ILucideX from "~icons/lucide/x";
|
|
180
182
|
import { useSlotVars } from "../../composables/useSlotVars.js";
|
|
181
183
|
import { copy } from "../../helpers/copy.js";
|
|
182
184
|
import { NotificationHandler } from "../../helpers/NotificationHandler.js";
|
|
@@ -4,7 +4,8 @@ import type { EmitsToProps, PopupConstrainToProps, TailwindClassProp } from "../
|
|
|
4
4
|
type __VLS_Props = PopupConstrainToProps & {
|
|
5
5
|
backdropClass?: string;
|
|
6
6
|
showBackdrop?: boolean;
|
|
7
|
-
|
|
7
|
+
showArrow?: boolean;
|
|
8
|
+
animationDirection?: "use-side" | "use-align" | "left" | "right" | "up" | "down" | "show" | "none";
|
|
8
9
|
/** Overrides teleport target. */
|
|
9
10
|
to?: string;
|
|
10
11
|
/** Overrides reka-ui's PopoverRootProps */
|
|
@@ -29,9 +30,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
29
30
|
}>, {
|
|
30
31
|
constrainWidthTo: number | "trigger" | "available" | string | null;
|
|
31
32
|
constrainHeightTo: number | "trigger" | "available" | string | null;
|
|
32
|
-
to: string;
|
|
33
33
|
showBackdrop: boolean;
|
|
34
|
-
|
|
34
|
+
showArrow: boolean;
|
|
35
|
+
animationDirection: "use-side" | "use-align" | "left" | "right" | "up" | "down" | "show" | "none";
|
|
36
|
+
to: string;
|
|
35
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
37
39
|
declare const _default: typeof __VLS_export;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<transition>
|
|
15
15
|
<div
|
|
16
16
|
v-if="showBackdrop && modelValue"
|
|
17
|
-
:class="twMerge(`
|
|
17
|
+
:class="twMerge(`popover--backdrop absolute inset-0 bg-black/50`, backdropClass)"
|
|
18
18
|
@click="modelValue = false"
|
|
19
19
|
/>
|
|
20
20
|
</transition>
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
:style="contentStyle"
|
|
39
39
|
:class="twMerge(
|
|
40
40
|
`
|
|
41
|
-
|
|
41
|
+
popover--content
|
|
42
42
|
focus:outline-none
|
|
43
43
|
overflow-auto
|
|
44
44
|
scrollbar-hidden
|
|
@@ -71,38 +71,43 @@
|
|
|
71
71
|
animationDirection === `down` && `
|
|
72
72
|
animate-slideInDown
|
|
73
73
|
`,
|
|
74
|
+
animationDirection === `show` && `
|
|
75
|
+
animate-contentShow
|
|
76
|
+
`,
|
|
74
77
|
contentProps?.class
|
|
75
78
|
)"
|
|
76
79
|
>
|
|
77
80
|
<div
|
|
78
81
|
:class="twMerge(`
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
`)"
|
|
82
|
+
popover--content-inner
|
|
83
|
+
flex
|
|
84
|
+
flex-col
|
|
85
|
+
bg-neutral-50
|
|
86
|
+
dark:bg-neutral-900
|
|
87
|
+
rounded-sm
|
|
88
|
+
p-2
|
|
89
|
+
shadow-sm
|
|
90
|
+
shadow-black/30
|
|
91
|
+
border
|
|
92
|
+
border-black/30
|
|
93
|
+
whitespace-pre-wrap
|
|
94
|
+
overflow-auto
|
|
95
|
+
`)"
|
|
94
96
|
>
|
|
95
97
|
<slot name="popover"/>
|
|
96
98
|
</div>
|
|
97
99
|
|
|
98
100
|
<PopoverArrow
|
|
99
|
-
|
|
101
|
+
v-if="showArrow"
|
|
102
|
+
:class="twMerge(`
|
|
103
|
+
popover--arrow
|
|
100
104
|
-mt-px
|
|
101
105
|
fill-neutral-50
|
|
102
106
|
dark:fill-neutral-800
|
|
103
107
|
drop-shadow-[0_2px_1px_rgba(0,0,0,0.3)]
|
|
104
108
|
relative
|
|
105
|
-
|
|
109
|
+
stroke-black/30
|
|
110
|
+
`)"
|
|
106
111
|
/>
|
|
107
112
|
</PopoverContent>
|
|
108
113
|
</PopoverPortal>
|
|
@@ -120,7 +125,7 @@ import {
|
|
|
120
125
|
import { usePopupConstrainToStyle } from "../../composables/usePopupConstrainToStyle.js";
|
|
121
126
|
import { twMerge } from "../../utils/twMerge.js";
|
|
122
127
|
defineOptions({
|
|
123
|
-
name: "
|
|
128
|
+
name: "WPopover",
|
|
124
129
|
inheritAttrs: false
|
|
125
130
|
});
|
|
126
131
|
const props = defineProps({
|
|
@@ -128,6 +133,7 @@ const props = defineProps({
|
|
|
128
133
|
constrainHeightTo: { type: [Number, String, null], required: false, default: "available" },
|
|
129
134
|
backdropClass: { type: String, required: false },
|
|
130
135
|
showBackdrop: { type: Boolean, required: false, default: false },
|
|
136
|
+
showArrow: { type: Boolean, required: false, default: true },
|
|
131
137
|
animationDirection: { type: String, required: false, default: "use-side" },
|
|
132
138
|
to: { type: String, required: false, default: "#root" },
|
|
133
139
|
rootProps: { type: Object, required: false },
|
|
@@ -4,7 +4,8 @@ import type { EmitsToProps, PopupConstrainToProps, TailwindClassProp } from "../
|
|
|
4
4
|
type __VLS_Props = PopupConstrainToProps & {
|
|
5
5
|
backdropClass?: string;
|
|
6
6
|
showBackdrop?: boolean;
|
|
7
|
-
|
|
7
|
+
showArrow?: boolean;
|
|
8
|
+
animationDirection?: "use-side" | "use-align" | "left" | "right" | "up" | "down" | "show" | "none";
|
|
8
9
|
/** Overrides teleport target. */
|
|
9
10
|
to?: string;
|
|
10
11
|
/** Overrides reka-ui's PopoverRootProps */
|
|
@@ -29,9 +30,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
29
30
|
}>, {
|
|
30
31
|
constrainWidthTo: number | "trigger" | "available" | string | null;
|
|
31
32
|
constrainHeightTo: number | "trigger" | "available" | string | null;
|
|
32
|
-
to: string;
|
|
33
33
|
showBackdrop: boolean;
|
|
34
|
-
|
|
34
|
+
showArrow: boolean;
|
|
35
|
+
animationDirection: "use-side" | "use-align" | "left" | "right" | "up" | "down" | "show" | "none";
|
|
36
|
+
to: string;
|
|
35
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
37
39
|
declare const _default: typeof __VLS_export;
|
|
@@ -2,6 +2,8 @@ import type { DialogContentEmits, DialogContentProps, DialogRootEmits, DialogRoo
|
|
|
2
2
|
import type { EmitsToProps, HTMLAttributes } from "vue";
|
|
3
3
|
import type { TailwindClassProp } from "../../types/index.js";
|
|
4
4
|
type __VLS_Props = {
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
5
7
|
backdropClass?: string;
|
|
6
8
|
/** Overrides reka-ui's DialogContentProps */
|
|
7
9
|
contentProps?: DialogContentProps & EmitsToProps<DialogContentEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
|
|
@@ -16,13 +18,21 @@ type __VLS_ModelProps = {
|
|
|
16
18
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
17
19
|
declare var __VLS_14: {}, __VLS_28: {
|
|
18
20
|
class: string;
|
|
19
|
-
}, __VLS_36: {};
|
|
21
|
+
}, __VLS_36: {}, __VLS_38: {}, __VLS_46: {}, __VLS_54: {}, __VLS_62: {};
|
|
20
22
|
type __VLS_Slots = {} & {
|
|
21
23
|
button?: (props: typeof __VLS_14) => any;
|
|
22
24
|
} & {
|
|
23
25
|
backdrop?: (props: typeof __VLS_28) => any;
|
|
24
26
|
} & {
|
|
25
27
|
popup?: (props: typeof __VLS_36) => any;
|
|
28
|
+
} & {
|
|
29
|
+
title?: (props: typeof __VLS_38) => any;
|
|
30
|
+
} & {
|
|
31
|
+
description?: (props: typeof __VLS_46) => any;
|
|
32
|
+
} & {
|
|
33
|
+
extra?: (props: typeof __VLS_54) => any;
|
|
34
|
+
} & {
|
|
35
|
+
close?: (props: typeof __VLS_62) => any;
|
|
26
36
|
};
|
|
27
37
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
38
|
"update:modelValue": (value: boolean) => any;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<DialogContent
|
|
28
28
|
v-bind="{ ...contentProps, class: void 0 }"
|
|
29
29
|
:class="twMerge(`
|
|
30
|
-
popup--content
|
|
30
|
+
popup--content
|
|
31
31
|
z-100
|
|
32
32
|
focus:outline-none
|
|
33
33
|
fixed
|
|
@@ -45,15 +45,44 @@
|
|
|
45
45
|
>
|
|
46
46
|
<div
|
|
47
47
|
:class="twMerge(`
|
|
48
|
-
popup--content
|
|
48
|
+
popup--content-inner
|
|
49
49
|
flex
|
|
50
50
|
flex-col
|
|
51
51
|
bg-neutral-100
|
|
52
52
|
dark:bg-neutral-800
|
|
53
53
|
rounded-md
|
|
54
|
+
flex
|
|
55
|
+
flex-col
|
|
56
|
+
gap-3
|
|
57
|
+
p-2
|
|
54
58
|
`)"
|
|
55
59
|
>
|
|
56
|
-
<slot name="popup"
|
|
60
|
+
<slot name="popup">
|
|
61
|
+
<slot name="title">
|
|
62
|
+
<DialogTitle
|
|
63
|
+
v-if="title"
|
|
64
|
+
class="text-lg font-bold"
|
|
65
|
+
>
|
|
66
|
+
{{ title }}
|
|
67
|
+
</DialogTitle>
|
|
68
|
+
</slot>
|
|
69
|
+
<slot name="description">
|
|
70
|
+
<DialogDescription v-if="description">
|
|
71
|
+
{{ description }}
|
|
72
|
+
</DialogDescription>
|
|
73
|
+
</slot>
|
|
74
|
+
<slot name="extra"/>
|
|
75
|
+
</slot>
|
|
76
|
+
<DialogCloseButton as-child>
|
|
77
|
+
<slot name="close">
|
|
78
|
+
<WButton
|
|
79
|
+
class="justify-self-end"
|
|
80
|
+
@click="modelValue = false"
|
|
81
|
+
>
|
|
82
|
+
Close
|
|
83
|
+
</WButton>
|
|
84
|
+
</slot>
|
|
85
|
+
</DialogCloseButton>
|
|
57
86
|
</div>
|
|
58
87
|
</DialogContent>
|
|
59
88
|
</DialogPortal>
|
|
@@ -63,8 +92,11 @@
|
|
|
63
92
|
<script setup>
|
|
64
93
|
import { DialogContent, DialogOverlay, DialogPortal, DialogRoot, DialogTrigger } from "reka-ui";
|
|
65
94
|
import { twMerge } from "../../utils/twMerge.js";
|
|
95
|
+
import WButton from "../WButton/WButton.vue";
|
|
66
96
|
defineOptions({ name: "WPopup", inheritAttrs: false });
|
|
67
97
|
defineProps({
|
|
98
|
+
title: { type: String, required: false },
|
|
99
|
+
description: { type: String, required: false },
|
|
68
100
|
backdropClass: { type: String, required: false },
|
|
69
101
|
contentProps: { type: Object, required: false },
|
|
70
102
|
rootProps: { type: Object, required: false },
|
|
@@ -2,6 +2,8 @@ import type { DialogContentEmits, DialogContentProps, DialogRootEmits, DialogRoo
|
|
|
2
2
|
import type { EmitsToProps, HTMLAttributes } from "vue";
|
|
3
3
|
import type { TailwindClassProp } from "../../types/index.js";
|
|
4
4
|
type __VLS_Props = {
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
5
7
|
backdropClass?: string;
|
|
6
8
|
/** Overrides reka-ui's DialogContentProps */
|
|
7
9
|
contentProps?: DialogContentProps & EmitsToProps<DialogContentEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
|
|
@@ -16,13 +18,21 @@ type __VLS_ModelProps = {
|
|
|
16
18
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
17
19
|
declare var __VLS_14: {}, __VLS_28: {
|
|
18
20
|
class: string;
|
|
19
|
-
}, __VLS_36: {};
|
|
21
|
+
}, __VLS_36: {}, __VLS_38: {}, __VLS_46: {}, __VLS_54: {}, __VLS_62: {};
|
|
20
22
|
type __VLS_Slots = {} & {
|
|
21
23
|
button?: (props: typeof __VLS_14) => any;
|
|
22
24
|
} & {
|
|
23
25
|
backdrop?: (props: typeof __VLS_28) => any;
|
|
24
26
|
} & {
|
|
25
27
|
popup?: (props: typeof __VLS_36) => any;
|
|
28
|
+
} & {
|
|
29
|
+
title?: (props: typeof __VLS_38) => any;
|
|
30
|
+
} & {
|
|
31
|
+
description?: (props: typeof __VLS_46) => any;
|
|
32
|
+
} & {
|
|
33
|
+
extra?: (props: typeof __VLS_54) => any;
|
|
34
|
+
} & {
|
|
35
|
+
close?: (props: typeof __VLS_62) => any;
|
|
26
36
|
};
|
|
27
37
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
38
|
"update:modelValue": (value: boolean) => any;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type InputHTMLAttributes } from "vue";
|
|
2
2
|
import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js";
|
|
3
3
|
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
-
props: import("vue").PublicProps & __VLS_PrettifyLocal<(Omit<InputHTMLAttributes, "class" | "onInput" | "onSubmit" | "disabled" | "readonly" | "autocomplete"> & TailwindClassProp & Pick<BaseInteractiveProps, "border" | "unstyle"> & {
|
|
4
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(Omit<InputHTMLAttributes, "class" | "onInput" | "onSubmit" | "disabled" | "type" | "readonly" | "autocomplete"> & TailwindClassProp & Pick<BaseInteractiveProps, "border" | "unstyle"> & {
|
|
5
5
|
id?: string;
|
|
6
6
|
label?: string;
|
|
7
7
|
valid?: boolean;
|
|
8
|
+
type?: InputHTMLAttributes["type"];
|
|
8
9
|
} & {
|
|
9
10
|
modelValue: T;
|
|
10
11
|
}) & {
|
|
@@ -96,7 +96,8 @@ const props = defineProps({
|
|
|
96
96
|
border: { type: Boolean, required: false, default: true },
|
|
97
97
|
id: { type: String, required: false, default: "" },
|
|
98
98
|
label: { type: String, required: false, default: "" },
|
|
99
|
-
valid: { type: Boolean, required: false, default: true }
|
|
99
|
+
valid: { type: Boolean, required: false, default: true },
|
|
100
|
+
type: { type: null, required: false, default: void 0 }
|
|
100
101
|
});
|
|
101
102
|
const finalId = useFallbackId(props);
|
|
102
103
|
const modelValue = defineModel({ type: null, ...{ required: true } });
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type InputHTMLAttributes } from "vue";
|
|
2
2
|
import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js";
|
|
3
3
|
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
-
props: import("vue").PublicProps & __VLS_PrettifyLocal<(Omit<InputHTMLAttributes, "class" | "onInput" | "onSubmit" | "disabled" | "readonly" | "autocomplete"> & TailwindClassProp & Pick<BaseInteractiveProps, "border" | "unstyle"> & {
|
|
4
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(Omit<InputHTMLAttributes, "class" | "onInput" | "onSubmit" | "disabled" | "type" | "readonly" | "autocomplete"> & TailwindClassProp & Pick<BaseInteractiveProps, "border" | "unstyle"> & {
|
|
5
5
|
id?: string;
|
|
6
6
|
label?: string;
|
|
7
7
|
valid?: boolean;
|
|
8
|
+
type?: InputHTMLAttributes["type"];
|
|
8
9
|
} & {
|
|
9
10
|
modelValue: T;
|
|
10
11
|
}) & {
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
|
|
93
93
|
<script setup>
|
|
94
94
|
import { TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger } from "reka-ui";
|
|
95
|
+
import ILucideInfo from "~icons/lucide/info";
|
|
95
96
|
import { usePopupConstrainToStyle } from "../../composables/usePopupConstrainToStyle.js";
|
|
96
97
|
import { twMerge } from "../../utils/twMerge.js";
|
|
97
98
|
import WIcon from "../WIcon/WIcon.vue";
|
package/package.json
CHANGED
package/src/module.ts
CHANGED
|
@@ -35,7 +35,7 @@ const componentsInfo: {
|
|
|
35
35
|
`!**/Template/**.vue`
|
|
36
36
|
], [], (filepath: string, name: string) => ({
|
|
37
37
|
originalName: name,
|
|
38
|
-
name: name.startsWith("
|
|
38
|
+
name: name.startsWith("W") ? name.replace("W", "PREFIX") : `PREFIX${name}`,
|
|
39
39
|
filepath
|
|
40
40
|
}))
|
|
41
41
|
|
|
@@ -15,7 +15,7 @@ export const WitchcraftUiResolver = (
|
|
|
15
15
|
): { from: string } | undefined => {
|
|
16
16
|
if (componentName.startsWith(prefix)) {
|
|
17
17
|
const n = componentName.slice(1)
|
|
18
|
-
const filename = prefixless.includes(n) ? n : `
|
|
18
|
+
const filename = prefixless.includes(n) ? n : `W${n}`
|
|
19
19
|
if (!filter(n)) {
|
|
20
20
|
return undefined
|
|
21
21
|
}
|
|
@@ -84,6 +84,8 @@ import { CheckboxIndicator, CheckboxRoot } from "reka-ui"
|
|
|
84
84
|
import type { HTMLAttributes, InputHTMLAttributes } from "vue"
|
|
85
85
|
import { useAttrs } from "vue"
|
|
86
86
|
|
|
87
|
+
import ILucideCheck from "~icons/lucide/check"
|
|
88
|
+
|
|
87
89
|
import { useFallbackId } from "../../composables/useFallbackId.js"
|
|
88
90
|
import { usePreHydrationValue } from "../../composables/usePreHydrationValue.js"
|
|
89
91
|
import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js"
|
|
@@ -191,6 +191,8 @@ import { safeConvertToHsva } from "./utils/safeConvertToHsva.js"
|
|
|
191
191
|
import { safeConvertToRgba } from "./utils/safeConvertToRgba.js"
|
|
192
192
|
import { toLowPrecisionRgbaString } from "./utils/toLowPrecisionRgbaString.js"
|
|
193
193
|
|
|
194
|
+
import ILucideCopy from "~icons/lucide/copy"
|
|
195
|
+
|
|
194
196
|
import { useFallbackId } from "../../composables/useFallbackId.js"
|
|
195
197
|
import { useInjectedI18n } from "../../composables/useInjectedI18n.js"
|
|
196
198
|
import { copy } from "../../helpers/copy.js"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
border
|
|
37
37
|
border-neutral-300
|
|
38
38
|
dark:border-neutral-700
|
|
39
|
-
bg-
|
|
39
|
+
bg-white
|
|
40
40
|
dark:bg-neutral-800/50
|
|
41
41
|
focus:bg-bg
|
|
42
42
|
dark:focus:bg-neutral-800
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
has-[input:invalid]:border-danger-500
|
|
47
47
|
invalid:border-danger-500
|
|
48
48
|
`,
|
|
49
|
-
open && popupSide === 'top' && `rounded-tl-none rounded-tr-none`,
|
|
50
|
-
open && popupSide === 'bottom' && `rounded-bl-none rounded-br-none`
|
|
49
|
+
filtered.length > 0 && open && popupSide === 'top' && `rounded-tl-none rounded-tr-none`,
|
|
50
|
+
filtered.length > 0 && open && popupSide === 'bottom' && `rounded-bl-none rounded-br-none`
|
|
51
51
|
)"
|
|
52
52
|
>
|
|
53
53
|
<!-- @vue-expect-error aria/keydown can be defined -->
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
</WIcon>
|
|
93
93
|
</slot>
|
|
94
94
|
</Transition>
|
|
95
|
+
<slot name="right"/>
|
|
95
96
|
<ComboboxTrigger
|
|
96
97
|
:as-child="true"
|
|
97
98
|
>
|
|
@@ -101,7 +102,7 @@
|
|
|
101
102
|
>
|
|
102
103
|
<WButton
|
|
103
104
|
:border="false"
|
|
104
|
-
class="combobox--toggle p-0"
|
|
105
|
+
class="combobox--toggle p-0 text-neutral-800 dark:text-neutral-200"
|
|
105
106
|
:aria-label="open ? 'Close' : 'Open'"
|
|
106
107
|
>
|
|
107
108
|
<slot
|
|
@@ -111,7 +112,7 @@
|
|
|
111
112
|
<WIcon
|
|
112
113
|
:class="twMerge(`combobox--toggle scale-150`, open && `rotate-180`)"
|
|
113
114
|
>
|
|
114
|
-
<i-chevron-
|
|
115
|
+
<i-lucide-chevron-down/>
|
|
115
116
|
</WIcon>
|
|
116
117
|
</slot>
|
|
117
118
|
</WButton>
|
|
@@ -306,6 +307,9 @@ import {
|
|
|
306
307
|
import type { EmitsToProps, HTMLAttributes, InputHTMLAttributes } from "vue"
|
|
307
308
|
import { computed, nextTick, ref, useAttrs, useSlots, useTemplateRef, watch } from "vue"
|
|
308
309
|
|
|
310
|
+
import ILucideChevronDown from "~icons/lucide/chevron-down"
|
|
311
|
+
import ILucideLoaderCircle from "~icons/lucide/loader-circle"
|
|
312
|
+
|
|
309
313
|
import { useDelayedLoadingIndicator } from "../../composables/useDelayedLoadingIndicator.js"
|
|
310
314
|
import { type SuggestionsDisplayProps, useDisplayForReka } from "../../composables/useDisplayForReka.js"
|
|
311
315
|
import { useFallbackId } from "../../composables/useFallbackId.js"
|
|
@@ -7,6 +7,12 @@ import { onBeforeUnmount, ref, toRaw, useAttrs, watch } from "vue"
|
|
|
7
7
|
|
|
8
8
|
import { convertDateWithFallback, getNow, toEmittableDate } from "./helpers.js"
|
|
9
9
|
|
|
10
|
+
import ILucideCalendarRange from "~icons/lucide/calendar-range"
|
|
11
|
+
import ILucideChevronLeft from "~icons/lucide/chevron-left"
|
|
12
|
+
import ILucideChevronRight from "~icons/lucide/chevron-right"
|
|
13
|
+
import ILucideChevronsLeft from "~icons/lucide/chevrons-left"
|
|
14
|
+
import ILucideChevronsRight from "~icons/lucide/chevrons-right"
|
|
15
|
+
|
|
10
16
|
import { useInjectedLocale } from "../../composables/useInjectedLocale.js"
|
|
11
17
|
import type { RangeDate } from "../../types/index.js"
|
|
12
18
|
import { twMerge } from "../../utils/twMerge.js"
|
|
@@ -5,6 +5,12 @@ import { onBeforeUnmount, ref, toRaw, useAttrs, watch } from "vue"
|
|
|
5
5
|
|
|
6
6
|
import { convertDateWithFallback, getNow, toEmittableDate } from "./helpers.js"
|
|
7
7
|
|
|
8
|
+
import ILucideCalendarDays from "~icons/lucide/calendar-days"
|
|
9
|
+
import ILucideChevronLeft from "~icons/lucide/chevron-left"
|
|
10
|
+
import ILucideChevronRight from "~icons/lucide/chevron-right"
|
|
11
|
+
import ILucideChevronsLeft from "~icons/lucide/chevrons-left"
|
|
12
|
+
import ILucideChevronsRight from "~icons/lucide/chevrons-right"
|
|
13
|
+
|
|
8
14
|
import { useInjectedLocale } from "../../composables/useInjectedLocale.js"
|
|
9
15
|
import type { SingleDate } from "../../types/index.js"
|
|
10
16
|
import { twMerge } from "../../utils/twMerge.js"
|
|
@@ -231,6 +231,10 @@
|
|
|
231
231
|
import type { HTMLAttributes, InputHTMLAttributes } from "vue"
|
|
232
232
|
import { computed, onBeforeUnmount, ref, shallowReactive, watch } from "vue"
|
|
233
233
|
|
|
234
|
+
import ILucideFile from "~icons/lucide/file"
|
|
235
|
+
import ILucideUpload from "~icons/lucide/upload"
|
|
236
|
+
import ILucideX from "~icons/lucide/x"
|
|
237
|
+
|
|
234
238
|
import { useFallbackId } from "../../composables/useFallbackId.js"
|
|
235
239
|
import { useInjectedI18n } from "../../composables/useInjectedI18n.js"
|
|
236
240
|
import type { FileInputError, TailwindClassProp } from "../../types/index.js"
|
|
@@ -83,6 +83,8 @@
|
|
|
83
83
|
import { removeIfIn } from "@alanscodelog/utils/removeIfIn"
|
|
84
84
|
import { computed, type HTMLAttributes, nextTick, ref, useAttrs } from "vue"
|
|
85
85
|
|
|
86
|
+
import ILucideX from "~icons/lucide/x"
|
|
87
|
+
|
|
86
88
|
import { copy } from "../../helpers/copy.js"
|
|
87
89
|
import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js"
|
|
88
90
|
import { twMerge } from "../../utils/twMerge.js"
|
|
@@ -176,6 +176,9 @@
|
|
|
176
176
|
<script setup lang="ts">
|
|
177
177
|
import { computed, type HTMLAttributes, onMounted, ref, useAttrs } from "vue"
|
|
178
178
|
|
|
179
|
+
import ILucideCopy from "~icons/lucide/copy"
|
|
180
|
+
import ILucideX from "~icons/lucide/x"
|
|
181
|
+
|
|
179
182
|
import { useSlotVars } from "../../composables/useSlotVars.js"
|
|
180
183
|
import { copy } from "../../helpers/copy.js"
|
|
181
184
|
import { type NotificationEntry, NotificationHandler } from "../../helpers/NotificationHandler.js"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<transition>
|
|
15
15
|
<div
|
|
16
16
|
v-if="showBackdrop && modelValue"
|
|
17
|
-
:class="twMerge(`
|
|
17
|
+
:class="twMerge(`popover--backdrop absolute inset-0 bg-black/50`, backdropClass)"
|
|
18
18
|
@click="modelValue = false"
|
|
19
19
|
/>
|
|
20
20
|
</transition>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
}"
|
|
38
38
|
:style="contentStyle"
|
|
39
39
|
:class="twMerge(`
|
|
40
|
-
|
|
40
|
+
popover--content
|
|
41
41
|
focus:outline-none
|
|
42
42
|
overflow-auto
|
|
43
43
|
scrollbar-hidden
|
|
@@ -70,37 +70,42 @@
|
|
|
70
70
|
animationDirection === `down` && `
|
|
71
71
|
animate-slideInDown
|
|
72
72
|
`,
|
|
73
|
+
animationDirection === `show` && `
|
|
74
|
+
animate-contentShow
|
|
75
|
+
`,
|
|
73
76
|
contentProps?.class)"
|
|
74
77
|
>
|
|
75
78
|
<div
|
|
76
79
|
:class="twMerge(`
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
`)"
|
|
80
|
+
popover--content-inner
|
|
81
|
+
flex
|
|
82
|
+
flex-col
|
|
83
|
+
bg-neutral-50
|
|
84
|
+
dark:bg-neutral-900
|
|
85
|
+
rounded-sm
|
|
86
|
+
p-2
|
|
87
|
+
shadow-sm
|
|
88
|
+
shadow-black/30
|
|
89
|
+
border
|
|
90
|
+
border-black/30
|
|
91
|
+
whitespace-pre-wrap
|
|
92
|
+
overflow-auto
|
|
93
|
+
`)"
|
|
92
94
|
>
|
|
93
95
|
<slot name="popover"/>
|
|
94
96
|
</div>
|
|
95
97
|
|
|
96
98
|
<PopoverArrow
|
|
97
|
-
|
|
99
|
+
v-if="showArrow"
|
|
100
|
+
:class="twMerge(`
|
|
101
|
+
popover--arrow
|
|
98
102
|
-mt-px
|
|
99
103
|
fill-neutral-50
|
|
100
104
|
dark:fill-neutral-800
|
|
101
105
|
drop-shadow-[0_2px_1px_rgba(0,0,0,0.3)]
|
|
102
106
|
relative
|
|
103
|
-
|
|
107
|
+
stroke-black/30
|
|
108
|
+
`)"
|
|
104
109
|
/>
|
|
105
110
|
</PopoverContent>
|
|
106
111
|
</PopoverPortal>
|
|
@@ -127,7 +132,7 @@ import { twMerge } from "../../utils/twMerge.js"
|
|
|
127
132
|
|
|
128
133
|
/** Wrapper around reka-ui's `Popover` component. */
|
|
129
134
|
defineOptions({
|
|
130
|
-
name: "
|
|
135
|
+
name: "WPopover",
|
|
131
136
|
inheritAttrs: false
|
|
132
137
|
})
|
|
133
138
|
|
|
@@ -136,9 +141,10 @@ const props = withDefaults(defineProps<
|
|
|
136
141
|
& PopupConstrainToProps
|
|
137
142
|
& {
|
|
138
143
|
backdropClass?: string
|
|
139
|
-
/* If true, a backdrop is shown behind the
|
|
144
|
+
/* If true, a backdrop is shown behind the popover. Whether interaction is allowed outside the popover is still determined by `disableOutsidePointerEvents`. */
|
|
140
145
|
showBackdrop?: boolean
|
|
141
|
-
|
|
146
|
+
showArrow?: boolean
|
|
147
|
+
animationDirection?: "use-side" | "use-align" | "left" | "right" | "up" | "down" | "show" | "none"
|
|
142
148
|
/** Overrides teleport target. */
|
|
143
149
|
to?: string
|
|
144
150
|
/** Overrides reka-ui's PopoverRootProps */
|
|
@@ -148,6 +154,7 @@ const props = withDefaults(defineProps<
|
|
|
148
154
|
}
|
|
149
155
|
>(), {
|
|
150
156
|
showBackdrop: false,
|
|
157
|
+
showArrow: true,
|
|
151
158
|
constrainWidthTo: 400,
|
|
152
159
|
constrainHeightTo: "available",
|
|
153
160
|
animationDirection: "use-side",
|
|
@@ -6,42 +6,86 @@ import WPopup from "./WPopup.vue"
|
|
|
6
6
|
|
|
7
7
|
import * as components from "../index.js"
|
|
8
8
|
|
|
9
|
+
type ExtraTestArgs = {
|
|
10
|
+
_slots: string
|
|
11
|
+
}
|
|
9
12
|
const meta: Meta<typeof WPopup> = {
|
|
10
13
|
component: WPopup,
|
|
11
|
-
title: "Components/Popup"
|
|
14
|
+
title: "Components/Popup",
|
|
15
|
+
args: {
|
|
16
|
+
title: "Popup Title",
|
|
17
|
+
description: "Popup Description"
|
|
18
|
+
}
|
|
12
19
|
}
|
|
13
20
|
|
|
14
21
|
export default meta
|
|
15
|
-
type Story = StoryObj<typeof WPopup>
|
|
22
|
+
type Story = StoryObj<typeof WPopup> & { args?: ExtraTestArgs }
|
|
16
23
|
|
|
17
24
|
export const Primary: Story = {
|
|
18
|
-
render: args =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
render: args => {
|
|
26
|
+
const extraArgs = args as ExtraTestArgs
|
|
27
|
+
return {
|
|
28
|
+
components,
|
|
29
|
+
setup: () => {
|
|
30
|
+
const value = ref(false)
|
|
31
|
+
return { args, value }
|
|
32
|
+
},
|
|
33
|
+
template: `
|
|
25
34
|
<div class="test bg-transparency-squares flex items-center justify-center" style="height:80vh;border:1px solid black;">
|
|
26
|
-
<WPopup
|
|
35
|
+
<WPopup
|
|
36
|
+
:title="args.title"
|
|
37
|
+
:description="args.description"
|
|
38
|
+
v-model="value"
|
|
39
|
+
v-bind="args"
|
|
40
|
+
>
|
|
41
|
+
${extraArgs._slots}
|
|
27
42
|
<template #button>
|
|
28
43
|
<WButton>Open Modal Popup</WButton>
|
|
29
44
|
</template>
|
|
30
|
-
<template #
|
|
45
|
+
<template #extra>
|
|
31
46
|
<div
|
|
32
47
|
:style="{width: args.width, height: args.height}"
|
|
33
|
-
class="p-3"
|
|
34
48
|
>
|
|
35
|
-
<div>
|
|
36
|
-
<WButton class="mt-4" @click="value = false">Close</WButton>
|
|
49
|
+
<div>Extra Slot</div>
|
|
37
50
|
</div>
|
|
38
51
|
</template>
|
|
39
52
|
</WPopup>
|
|
40
53
|
</div>
|
|
41
54
|
`
|
|
42
|
-
|
|
55
|
+
}
|
|
56
|
+
}
|
|
43
57
|
}
|
|
44
58
|
|
|
59
|
+
export const OtherSlots = {
|
|
60
|
+
...Primary,
|
|
61
|
+
args: {
|
|
62
|
+
_slots: `
|
|
63
|
+
<template #title>
|
|
64
|
+
<div>Title Slot</div>
|
|
65
|
+
</template>
|
|
66
|
+
<template #description>
|
|
67
|
+
<div>Description Slot</div>
|
|
68
|
+
</template>
|
|
69
|
+
<template #close>
|
|
70
|
+
<div>Close Slot</div>
|
|
71
|
+
</template>
|
|
72
|
+
<template #backdrop>
|
|
73
|
+
<div>Backdrop Slot</div>
|
|
74
|
+
</template>
|
|
75
|
+
`
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const PopupSlots = {
|
|
80
|
+
...Primary,
|
|
81
|
+
args: {
|
|
82
|
+
_slots: `
|
|
83
|
+
<template #popup>
|
|
84
|
+
<div>Popup Slot - Replaces Other Slots except Close (note, you must provide reka's DialogTitle and DialogDescription to avoid it's warnings</div>
|
|
85
|
+
</template>
|
|
86
|
+
`
|
|
87
|
+
}
|
|
88
|
+
}
|
|
45
89
|
export const PopupLarge = {
|
|
46
90
|
...Primary,
|
|
47
91
|
args: {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<DialogContent
|
|
29
29
|
v-bind="{ ...contentProps, class: undefined }"
|
|
30
30
|
:class="twMerge(`
|
|
31
|
-
popup--content
|
|
31
|
+
popup--content
|
|
32
32
|
z-100
|
|
33
33
|
focus:outline-none
|
|
34
34
|
fixed
|
|
@@ -46,15 +46,44 @@
|
|
|
46
46
|
>
|
|
47
47
|
<div
|
|
48
48
|
:class="twMerge(`
|
|
49
|
-
popup--content
|
|
49
|
+
popup--content-inner
|
|
50
50
|
flex
|
|
51
51
|
flex-col
|
|
52
52
|
bg-neutral-100
|
|
53
53
|
dark:bg-neutral-800
|
|
54
54
|
rounded-md
|
|
55
|
+
flex
|
|
56
|
+
flex-col
|
|
57
|
+
gap-3
|
|
58
|
+
p-2
|
|
55
59
|
`)"
|
|
56
60
|
>
|
|
57
|
-
<slot name="popup"
|
|
61
|
+
<slot name="popup">
|
|
62
|
+
<slot name="title">
|
|
63
|
+
<DialogTitle
|
|
64
|
+
v-if="title"
|
|
65
|
+
class="text-lg font-bold"
|
|
66
|
+
>
|
|
67
|
+
{{ title }}
|
|
68
|
+
</DialogTitle>
|
|
69
|
+
</slot>
|
|
70
|
+
<slot name="description">
|
|
71
|
+
<DialogDescription v-if="description">
|
|
72
|
+
{{ description }}
|
|
73
|
+
</DialogDescription>
|
|
74
|
+
</slot>
|
|
75
|
+
<slot name="extra"/>
|
|
76
|
+
</slot>
|
|
77
|
+
<DialogCloseButton as-child>
|
|
78
|
+
<slot name="close">
|
|
79
|
+
<WButton
|
|
80
|
+
class="justify-self-end"
|
|
81
|
+
@click="modelValue = false"
|
|
82
|
+
>
|
|
83
|
+
Close
|
|
84
|
+
</WButton>
|
|
85
|
+
</slot>
|
|
86
|
+
</DialogCloseButton>
|
|
58
87
|
</div>
|
|
59
88
|
</DialogContent>
|
|
60
89
|
</DialogPortal>
|
|
@@ -72,11 +101,14 @@ import type { EmitsToProps, HTMLAttributes } from "vue"
|
|
|
72
101
|
|
|
73
102
|
import type { TailwindClassProp } from "../../types/index.js"
|
|
74
103
|
import { twMerge } from "../../utils/twMerge.js"
|
|
104
|
+
import WButton from "../WButton/WButton.vue"
|
|
75
105
|
|
|
76
106
|
defineOptions({ name: "WPopup", inheritAttrs: false })
|
|
77
107
|
|
|
78
108
|
withDefaults(defineProps<
|
|
79
109
|
& {
|
|
110
|
+
title?: string
|
|
111
|
+
description?: string
|
|
80
112
|
backdropClass?: string
|
|
81
113
|
/** Overrides reka-ui's DialogContentProps */
|
|
82
114
|
contentProps?: DialogContentProps & EmitsToProps<DialogContentEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp
|
|
@@ -98,7 +98,7 @@ defineOptions({
|
|
|
98
98
|
const props = withDefaults(defineProps<
|
|
99
99
|
& /** @vue-ignore */ Omit<
|
|
100
100
|
InputHTMLAttributes,
|
|
101
|
-
| "class" | "readonly" | "disabled" | "onSubmit" | "onInput"
|
|
101
|
+
| "class" | "readonly" | "disabled" | "onSubmit" | "onInput" | "type"
|
|
102
102
|
// https://github.com/vuejs/core/pull/14237
|
|
103
103
|
| "autocomplete"
|
|
104
104
|
>
|
|
@@ -108,6 +108,7 @@ const props = withDefaults(defineProps<
|
|
|
108
108
|
id?: string
|
|
109
109
|
label?: string
|
|
110
110
|
valid?: boolean
|
|
111
|
+
type?: InputHTMLAttributes["type"]
|
|
111
112
|
}
|
|
112
113
|
>(), {
|
|
113
114
|
id: "",
|
|
@@ -92,6 +92,8 @@
|
|
|
92
92
|
<script setup lang="ts">
|
|
93
93
|
import { TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger } from "reka-ui"
|
|
94
94
|
|
|
95
|
+
import ILucideInfo from "~icons/lucide/info"
|
|
96
|
+
|
|
95
97
|
import { usePopupConstrainToStyle } from "../../composables/usePopupConstrainToStyle.js"
|
|
96
98
|
import type { PopupConstrainToProps } from "../../types/index.js"
|
|
97
99
|
import { twMerge } from "../../utils/twMerge.js"
|
package/types/components.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ declare module 'vue' {
|
|
|
11
11
|
ILucideCalendarDays: typeof import('~icons/lucide/calendar-days')['default']
|
|
12
12
|
ILucideCalendarRange: typeof import('~icons/lucide/calendar-range')['default']
|
|
13
13
|
ILucideCheck: typeof import('~icons/lucide/check')['default']
|
|
14
|
+
ILucideChevronDown: typeof import('~icons/lucide/chevron-down')['default']
|
|
14
15
|
ILucideChevronLeft: typeof import('~icons/lucide/chevron-left')['default']
|
|
15
16
|
ILucideChevronRight: typeof import('~icons/lucide/chevron-right')['default']
|
|
16
17
|
ILucideChevronsLeft: typeof import('~icons/lucide/chevrons-left')['default']
|