@witchcraft/ui 0.2.1-beta.3 → 0.2.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 +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/build/WitchcraftUiResolver.d.ts +2 -2
- package/dist/runtime/build/generateTheme.js +2 -2
- package/dist/runtime/components/Aria/Aria.vue +4 -2
- package/dist/runtime/components/Aria/Aria.vue.d.ts +1 -1
- package/dist/runtime/components/Icon/Icon.vue +3 -3
- package/dist/runtime/components/Icon/Icon.vue.d.ts +1 -1
- package/dist/runtime/components/LibButton/LibButton.vue +9 -4
- package/dist/runtime/components/LibButton/LibButton.vue.d.ts +1 -1
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +3 -4
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +1 -1
- package/dist/runtime/components/LibColorInput/LibColorInput.vue +15 -8
- package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +1 -1
- package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +10 -6
- package/dist/runtime/components/LibColorPicker/LibColorPicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibColorPicker/utils/truncate.js +1 -1
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +5 -2
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +8 -6
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +7 -5
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +1 -1
- package/dist/runtime/components/LibDebug/LibDebug.vue +9 -4
- package/dist/runtime/components/LibDebug/LibDebug.vue.d.ts +1 -1
- package/dist/runtime/components/LibDevOnly/LibDevOnly.vue +2 -1
- package/dist/runtime/components/LibDevOnly/LibDevOnly.vue.d.ts +4 -1
- package/dist/runtime/components/LibFileInput/LibFileInput.vue +29 -13
- package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +2 -2
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +42 -12
- package/dist/runtime/components/LibLabel/LibLabel.vue +2 -2
- package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +3 -3
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +1 -2
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +2 -2
- package/dist/runtime/components/LibNotifications/LibNotification.vue +19 -8
- package/dist/runtime/components/LibNotifications/LibNotifications.vue +10 -6
- package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +2 -2
- package/dist/runtime/components/LibPagination/LibPagination.vue +25 -12
- package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +2 -2
- package/dist/runtime/components/LibPalette/LibPalette.vue +6 -5
- package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +5 -5
- package/dist/runtime/components/LibPopup/LibPopup.vue +6 -4
- package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +3 -3
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +5 -3
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue.d.ts +9 -9
- package/dist/runtime/components/LibRecorder/LibRecorder.vue +1 -1
- package/dist/runtime/components/LibRecorder/LibRecorder.vue.d.ts +2 -2
- package/dist/runtime/components/LibRoot/LibRoot.vue +11 -6
- package/dist/runtime/components/LibRoot/LibRoot.vue.d.ts +1 -1
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +1 -1
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +1 -1
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +5 -3
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +1 -1
- package/dist/runtime/components/LibTable/LibTable.vue +23 -8
- package/dist/runtime/components/LibTable/LibTable.vue.d.ts +1 -1
- package/dist/runtime/components/Template/NAME.vue +2 -3
- package/dist/runtime/components/Template/NAME.vue.d.ts +1 -1
- package/dist/runtime/components/TestControls/TestControls.vue +4 -2
- package/dist/runtime/components/TestControls/TestControls.vue.d.ts +1 -1
- package/dist/runtime/composables/useDragWithThreshold.d.ts +1 -1
- package/dist/runtime/composables/useInjectedI18n.d.ts +1 -1
- package/dist/runtime/composables/useScrollNearContainerEdges.d.ts +1 -1
- package/dist/runtime/composables/useSetupI18n.d.ts +1 -1
- package/dist/runtime/composables/useSuggestions.d.ts +2 -2
- package/dist/runtime/helpers/NotificationHandler.d.ts +1 -1
- package/dist/runtime/helpers/base64ToImg.js +2 -2
- package/dist/runtime/tailwind/themeConvertionOpts.d.ts +1 -1
- package/dist/runtime/types/index.d.ts +1 -1
- package/dist/runtime/utils/notifyIfError.d.ts +1 -1
- package/package.json +4 -6
- package/src/module.ts +25 -28
- package/src/runtime/build/WitchcraftUiResolver.ts +3 -3
- package/src/runtime/build/generateTheme.ts +3 -2
- package/src/runtime/build/unpluginIconViteOptions.ts +1 -1
- package/src/runtime/components/Aria/Aria.vue +5 -6
- package/src/runtime/components/Focus.stories.ts +11 -12
- package/src/runtime/components/Icon/Icon.vue +5 -9
- package/src/runtime/components/LibButton/LibButton.stories.ts +21 -22
- package/src/runtime/components/LibButton/LibButton.vue +23 -21
- package/src/runtime/components/LibCheckbox/LibCheckbox.stories.ts +6 -10
- package/src/runtime/components/LibCheckbox/LibCheckbox.vue +17 -19
- package/src/runtime/components/LibColorInput/LibColorInput.stories.ts +8 -13
- package/src/runtime/components/LibColorInput/LibColorInput.vue +49 -45
- package/src/runtime/components/LibColorPicker/LibColorPicker.stories.ts +14 -18
- package/src/runtime/components/LibColorPicker/LibColorPicker.vue +50 -52
- package/src/runtime/components/LibColorPicker/utils/safeConvertToHsva.ts +1 -2
- package/src/runtime/components/LibColorPicker/utils/safeConvertToRgba.ts +1 -2
- package/src/runtime/components/LibColorPicker/utils/truncate.ts +1 -2
- package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.ts +5 -8
- package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +11 -9
- package/src/runtime/components/LibDatePicker/LibDatePicker.stories.ts +14 -15
- package/src/runtime/components/LibDatePicker/LibDatePicker.vue +1 -2
- package/src/runtime/components/LibDatePicker/LibRangeDatePicker.vue +13 -13
- package/src/runtime/components/LibDatePicker/LibSingleDatePicker.vue +9 -8
- package/src/runtime/components/LibDatePicker/LibTimeZonePicker.vue +2 -1
- package/src/runtime/components/LibDatePicker/helpers.ts +0 -2
- package/src/runtime/components/LibDebug/LibDebug.stories.ts +11 -15
- package/src/runtime/components/LibDebug/LibDebug.vue +14 -11
- package/src/runtime/components/LibDevOnly/LibDevOnly.vue +8 -4
- package/src/runtime/components/LibFileInput/LibFileInput.stories.ts +12 -15
- package/src/runtime/components/LibFileInput/LibFileInput.vue +65 -47
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.ts +59 -67
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +73 -48
- package/src/runtime/components/LibLabel/LibLabel.stories.ts +4 -8
- package/src/runtime/components/LibLabel/LibLabel.vue +8 -8
- package/src/runtime/components/LibMultiValues/LibMultiValues.stories.ts +10 -15
- package/src/runtime/components/LibMultiValues/LibMultiValues.vue +14 -18
- package/src/runtime/components/LibNotifications/LibNotification.stories.ts +30 -34
- package/src/runtime/components/LibNotifications/LibNotification.vue +27 -17
- package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +11 -15
- package/src/runtime/components/LibNotifications/LibNotifications.vue +21 -16
- package/src/runtime/components/LibPagination/LibPagination.stories.ts +5 -9
- package/src/runtime/components/LibPagination/LibPagination.vue +46 -32
- package/src/runtime/components/LibPalette/LibPalette.stories.ts +3 -7
- package/src/runtime/components/LibPalette/LibPalette.vue +13 -12
- package/src/runtime/components/LibPopup/LibPopup.stories.ts +19 -23
- package/src/runtime/components/LibPopup/LibPopup.vue +31 -35
- package/src/runtime/components/LibProgressBar/LibProgressBar.stories.ts +13 -17
- package/src/runtime/components/LibProgressBar/LibProgressBar.vue +36 -33
- package/src/runtime/components/LibRecorder/LibRecorder.stories.ts +11 -12
- package/src/runtime/components/LibRecorder/LibRecorder.vue +34 -34
- package/src/runtime/components/LibRoot/LibRoot.vue +16 -12
- package/src/runtime/components/LibSimpleInput/LibSimpleInput.stories.ts +20 -24
- package/src/runtime/components/LibSimpleInput/LibSimpleInput.vue +17 -21
- package/src/runtime/components/LibSuggestions/LibSuggestions.stories.ts +16 -19
- package/src/runtime/components/LibSuggestions/LibSuggestions.vue +27 -30
- package/src/runtime/components/LibTable/LibTable.stories.ts +30 -33
- package/src/runtime/components/LibTable/LibTable.vue +38 -24
- package/src/runtime/components/Reset.stories.ts +3 -6
- package/src/runtime/components/Scrolling.stories.ts +5 -8
- package/src/runtime/components/Template/NAME.vue +11 -11
- package/src/runtime/components/Template/TemplateStory.ts +9 -10
- package/src/runtime/components/TestControls/TestControls.vue +5 -5
- package/src/runtime/components/shared/props.ts +4 -6
- package/src/runtime/components/shared/storyHelpers/playInput.ts +2 -3
- package/src/runtime/components/shared/storyHelpers/playSuggestions.ts +5 -9
- package/src/runtime/composables/useAccesibilityOutline.ts +1 -1
- package/src/runtime/composables/useAriaLabel.ts +1 -1
- package/src/runtime/composables/useDarkMode.ts +15 -19
- package/src/runtime/composables/useDragWithThreshold.ts +6 -8
- package/src/runtime/composables/useGlobalResizeObserver.ts +0 -1
- package/src/runtime/composables/useInjectedDarkMode.ts +2 -2
- package/src/runtime/composables/useInjectedI18n.ts +1 -1
- package/src/runtime/composables/useInjectedLocale.ts +3 -4
- package/src/runtime/composables/useScrollNearContainerEdges.stories.ts +4 -4
- package/src/runtime/composables/useScrollNearContainerEdges.ts +12 -13
- package/src/runtime/composables/useSetupI18n.ts +4 -7
- package/src/runtime/composables/useSetupLocale.ts +3 -5
- package/src/runtime/composables/useSuggestions.ts +25 -30
- package/src/runtime/directives/vDetectFlex.ts +5 -8
- package/src/runtime/directives/vExtractRootEl.ts +1 -1
- package/src/runtime/directives/vResizableCols.ts +3 -7
- package/src/runtime/directives/vResizeObserver.ts +1 -2
- package/src/runtime/globalResizeObserver.ts +0 -1
- package/src/runtime/helpers/NotificationHandler.ts +8 -12
- package/src/runtime/helpers/base64ToImg.ts +2 -3
- package/src/runtime/helpers/createNoonUtcDate.ts +0 -1
- package/src/runtime/helpers/defaultTranslationFunction.ts +0 -1
- package/src/runtime/helpers/getTimeZoneList.ts +0 -1
- package/src/runtime/helpers/readFile.ts +2 -2
- package/src/runtime/helpers/resizeObserverWrapper.ts +0 -1
- package/src/runtime/helpers/storybook.ts +2 -3
- package/src/runtime/main.lib.ts +0 -2
- package/src/runtime/nuxt/plugins/vue-plugin.ts +4 -5
- package/src/runtime/tailwind/themeConvertionOpts.ts +3 -4
- package/src/runtime/theme.ts +0 -1
- package/src/runtime/types/index.ts +3 -4
- package/src/runtime/utils/notifyIfError.ts +2 -2
- package/src/runtime/utils/twMerge.ts +2 -2
- package/src/runtime/vue/VueComponentsPlugin.ts +1 -2
- package/src/runtime/vue/registerComponents.ts +0 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import tailwindcss from '@tailwindcss/vite';
|
|
|
4
4
|
import { addImportsCustom } from '@witchcraft/nuxt-utils/utils/addImportsCustom';
|
|
5
5
|
import { globFiles } from '@witchcraft/nuxt-utils/utils/globFiles';
|
|
6
6
|
import { defu } from 'defu';
|
|
7
|
-
import fs from 'fs';
|
|
8
7
|
import { themeAsTailwindCss } from 'metamorphosis/tailwind';
|
|
8
|
+
import fs from 'node:fs';
|
|
9
9
|
import IconsResolver from 'unplugin-icons/resolver';
|
|
10
10
|
import ViteComponents from 'unplugin-vue-components/vite';
|
|
11
11
|
import { unpluginIconViteOptions } from '../dist/runtime/build/unpluginIconViteOptions.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const WitchcraftUiResolver: ({ prefix, filter
|
|
1
|
+
import type { ComponentResolver } from "unplugin-vue-components";
|
|
2
|
+
export declare const WitchcraftUiResolver: ({ prefix, filter }?: {
|
|
3
3
|
prefix?: string;
|
|
4
4
|
filter?: (name: string) => boolean;
|
|
5
5
|
}) => ComponentResolver;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { themeAsTailwindCss } from "metamorphosis/tailwind";
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
-
import { resolve } from "path";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
4
|
import { themeConvertionOpts } from "../tailwind/themeConvertionOpts.js";
|
|
5
5
|
import { theme } from "../theme.js";
|
|
6
6
|
const css = themeAsTailwindCss(theme, themeConvertionOpts);
|
|
7
|
-
import url from "url";
|
|
7
|
+
import url from "node:url";
|
|
8
8
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
9
9
|
const filepath = resolve(__dirname, "../assets/theme.css");
|
|
10
10
|
const content = `/* Auto-generated, see gen:theme script. */
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div tabindex="0">
|
|
2
|
+
<div tabindex="0">
|
|
3
|
+
{{ value }}
|
|
4
|
+
</div>
|
|
3
5
|
</template>
|
|
4
6
|
|
|
5
7
|
<script setup>
|
|
6
|
-
defineOptions({ name: "
|
|
8
|
+
defineOptions({ name: "Aria" });
|
|
7
9
|
defineProps({
|
|
8
10
|
value: { type: String, required: true }
|
|
9
11
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
value: string;
|
|
3
3
|
};
|
|
4
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props,
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
5
|
export default _default;
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script setup>
|
|
11
|
-
import {
|
|
11
|
+
import { useAttrs } from "vue";
|
|
12
12
|
import { twMerge } from "../../utils/twMerge.js";
|
|
13
13
|
defineOptions({
|
|
14
|
-
name: "
|
|
14
|
+
name: "Icon",
|
|
15
15
|
inheritAttrs: false
|
|
16
16
|
});
|
|
17
17
|
const $attrs = useAttrs();
|
|
18
|
-
|
|
18
|
+
defineProps({});
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
21
|
<script>
|
|
@@ -10,7 +10,7 @@ interface Props extends
|
|
|
10
10
|
/** @vue-ignore */
|
|
11
11
|
Partial<Omit<HTMLAttributes, "class">> {
|
|
12
12
|
}
|
|
13
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props,
|
|
13
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
14
14
|
default?: (props: {}) => any;
|
|
15
15
|
}>;
|
|
16
16
|
export default _default;
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
dark:hover:shadow-accent-950/30
|
|
57
57
|
dark:active:shadow-fg/40
|
|
58
58
|
dark:active:border-neutral-900
|
|
59
|
-
dark:bg-neutral-800
|
|
60
59
|
dark:border-neutral-900
|
|
61
60
|
dark:disabled:border-neutral-800
|
|
62
61
|
dark:disabled:bg-neutral-900
|
|
@@ -168,8 +167,14 @@
|
|
|
168
167
|
...ariaLabel
|
|
169
168
|
}"
|
|
170
169
|
>
|
|
171
|
-
<slot
|
|
172
|
-
|
|
170
|
+
<slot
|
|
171
|
+
name="label"
|
|
172
|
+
v-bind="{ id: `label-${id ?? fallbackId}`, classes: 'button--label pointer-events-none flex flex-1 items-center justify-center gap-1' }"
|
|
173
|
+
>
|
|
174
|
+
<label
|
|
175
|
+
:id="`label-${id ?? fallbackId}`"
|
|
176
|
+
class="button--label pointer-events-none flex flex-1 items-center justify-center gap-1"
|
|
177
|
+
>
|
|
173
178
|
<slot name="icon"/>
|
|
174
179
|
<slot
|
|
175
180
|
v-bind="{ label }"
|
|
@@ -192,7 +197,7 @@ import { twMerge } from "../../utils/twMerge.js";
|
|
|
192
197
|
import { getFallbackId } from "../shared/props.js";
|
|
193
198
|
const $attrs = useAttrs();
|
|
194
199
|
defineOptions({
|
|
195
|
-
name: "
|
|
200
|
+
name: "LibButton"
|
|
196
201
|
});
|
|
197
202
|
const fallbackId = getFallbackId();
|
|
198
203
|
const props = defineProps({
|
|
@@ -7,7 +7,7 @@ Partial<Omit<ButtonHTMLAttributes, "class" | "color" | "disabled"> & TailwindCla
|
|
|
7
7
|
"aria-label": string;
|
|
8
8
|
}>, RealProps {
|
|
9
9
|
}
|
|
10
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props,
|
|
10
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
11
11
|
color: "warning" | "ok" | "danger" | "primary" | "secondary" | false;
|
|
12
12
|
label: string;
|
|
13
13
|
disabled: boolean;
|
|
@@ -72,17 +72,16 @@
|
|
|
72
72
|
</template>
|
|
73
73
|
|
|
74
74
|
<script setup>
|
|
75
|
-
import { ref
|
|
75
|
+
import { ref } from "vue";
|
|
76
76
|
import { useDivideAttrs } from "../../composables/useDivideAttrs.js";
|
|
77
77
|
import { usePreHydrationValue } from "../../composables/usePreHydrationValue.js";
|
|
78
78
|
import { twMerge } from "../../utils/twMerge.js";
|
|
79
79
|
import { getFallbackId } from "../shared/props.js";
|
|
80
80
|
defineOptions({
|
|
81
|
-
name: "
|
|
81
|
+
name: "LibCheckbox",
|
|
82
82
|
inheritAttrs: false
|
|
83
83
|
});
|
|
84
84
|
const $ = useDivideAttrs(["label", "wrapper"]);
|
|
85
|
-
const $slots = useSlots();
|
|
86
85
|
const fallbackId = getFallbackId();
|
|
87
86
|
const props = defineProps({
|
|
88
87
|
id: { type: String, required: false },
|
|
@@ -92,7 +91,7 @@ const props = defineProps({
|
|
|
92
91
|
border: { type: Boolean, required: false, default: true },
|
|
93
92
|
unstyle: { type: Boolean, required: false, default: false }
|
|
94
93
|
});
|
|
95
|
-
|
|
94
|
+
defineEmits(["submit"]);
|
|
96
95
|
const el = ref(null);
|
|
97
96
|
const inputEl = ref(null);
|
|
98
97
|
const $value = defineModel("modelValue", { type: Boolean, ...{ default: false } });
|
|
@@ -15,7 +15,7 @@ WrapperTypes, RealProps {
|
|
|
15
15
|
}
|
|
16
16
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props & {
|
|
17
17
|
modelValue?: boolean;
|
|
18
|
-
},
|
|
18
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
19
|
"update:modelValue": (value: boolean) => any;
|
|
20
20
|
} & {
|
|
21
21
|
submit: (val: boolean) => any;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<!-- " -->
|
|
15
15
|
<!-- v-extract-root-el="extractEl" -->
|
|
16
16
|
<!-- > -->
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
<!-- -->
|
|
19
19
|
<lib-button
|
|
20
20
|
:id="id ?? fallbackId"
|
|
@@ -38,14 +38,16 @@
|
|
|
38
38
|
@click="togglePopup"
|
|
39
39
|
>
|
|
40
40
|
<template #label>
|
|
41
|
-
<div
|
|
41
|
+
<div
|
|
42
|
+
class="
|
|
42
43
|
color-input--swatch-wrapper
|
|
43
44
|
flex
|
|
44
45
|
w-full
|
|
45
46
|
"
|
|
46
47
|
>
|
|
47
48
|
<slot v-bind="{ stringColor, classes: swatchClasses }">
|
|
48
|
-
<div
|
|
49
|
+
<div
|
|
50
|
+
:class="swatchClasses"
|
|
49
51
|
:style="`background:${stringColor}`"
|
|
50
52
|
/>
|
|
51
53
|
</slot>
|
|
@@ -54,7 +56,8 @@
|
|
|
54
56
|
v-bind="{ tempStringColor, classes: swatchClasses }"
|
|
55
57
|
name="temp"
|
|
56
58
|
>
|
|
57
|
-
<div
|
|
59
|
+
<div
|
|
60
|
+
:class="swatchClasses"
|
|
58
61
|
:style="`background:${tempStringColor}`"
|
|
59
62
|
/>
|
|
60
63
|
</slot>
|
|
@@ -63,8 +66,12 @@
|
|
|
63
66
|
</lib-button>
|
|
64
67
|
</template>
|
|
65
68
|
<template #popup="{ extractEl }">
|
|
66
|
-
<div
|
|
67
|
-
|
|
69
|
+
<div
|
|
70
|
+
class="color-input--popup-wrapper p-5"
|
|
71
|
+
v-extract-root-el="extractEl"
|
|
72
|
+
>
|
|
73
|
+
<lib-color-picker
|
|
74
|
+
v-if="showPopup"
|
|
68
75
|
:id="id ?? fallbackId"
|
|
69
76
|
:allow-alpha="allowAlpha"
|
|
70
77
|
:custom-representation="customRepresentation"
|
|
@@ -90,7 +97,7 @@ import LibColorPicker from "../LibColorPicker/LibColorPicker.vue";
|
|
|
90
97
|
import LibPopup from "../LibPopup/LibPopup.vue";
|
|
91
98
|
import { getFallbackId } from "../shared/props.js";
|
|
92
99
|
defineOptions({
|
|
93
|
-
name: "
|
|
100
|
+
name: "LibColorInput"
|
|
94
101
|
});
|
|
95
102
|
const swatchClasses = `
|
|
96
103
|
color-input--swatch
|
|
@@ -106,7 +113,7 @@ const swatchClasses = `
|
|
|
106
113
|
`;
|
|
107
114
|
const fallbackId = getFallbackId();
|
|
108
115
|
const t = useInjectedI18n();
|
|
109
|
-
|
|
116
|
+
defineProps({
|
|
110
117
|
label: { type: String, required: false },
|
|
111
118
|
id: { type: String, required: false },
|
|
112
119
|
allowAlpha: { type: Boolean, required: false, default: true },
|
|
@@ -22,7 +22,7 @@ Partial<Omit<ButtonHTMLAttributes, "class"> & TailwindClassProp & {
|
|
|
22
22
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props & {
|
|
23
23
|
modelValue?: RgbaColor;
|
|
24
24
|
tempValue?: RgbaColor | undefined;
|
|
25
|
-
},
|
|
25
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
26
26
|
"update:modelValue": (value: RgbaColor) => any;
|
|
27
27
|
"update:tempValue": (value: RgbaColor | undefined) => any;
|
|
28
28
|
} & {
|
|
@@ -114,7 +114,8 @@
|
|
|
114
114
|
/>
|
|
115
115
|
</div>
|
|
116
116
|
<div class="color-picker--footer flex w-full flex-1 gap-2">
|
|
117
|
-
<div
|
|
117
|
+
<div
|
|
118
|
+
class=" color-picker--preview-wrapper
|
|
118
119
|
bg-transparency-squares
|
|
119
120
|
relative
|
|
120
121
|
aspect-square
|
|
@@ -123,7 +124,8 @@
|
|
|
123
124
|
shadow-xs
|
|
124
125
|
"
|
|
125
126
|
>
|
|
126
|
-
<div
|
|
127
|
+
<div
|
|
128
|
+
class="
|
|
127
129
|
color-picker--footer--preview
|
|
128
130
|
size-full
|
|
129
131
|
rounded-full
|
|
@@ -144,7 +146,11 @@
|
|
|
144
146
|
@input="parseInput"
|
|
145
147
|
@blur="onBlurFixInvalidValue"
|
|
146
148
|
/>
|
|
147
|
-
<lib-button
|
|
149
|
+
<lib-button
|
|
150
|
+
class="color-picker--copy-button"
|
|
151
|
+
:aria-label="t('copy')"
|
|
152
|
+
@click="copy(copyTransform?.(localColor.val, localColorString) ?? localColorString)"
|
|
153
|
+
>
|
|
148
154
|
<icon><i-fa6-regular-copy/></icon>
|
|
149
155
|
</lib-button>
|
|
150
156
|
</slot>
|
|
@@ -171,7 +177,6 @@
|
|
|
171
177
|
|
|
172
178
|
<script setup>
|
|
173
179
|
import { castType } from "@alanscodelog/utils/castType";
|
|
174
|
-
import { clampNumber } from "@alanscodelog/utils/clampNumber";
|
|
175
180
|
import { isArray } from "@alanscodelog/utils/isArray";
|
|
176
181
|
import { unreachable } from "@alanscodelog/utils/unreachable";
|
|
177
182
|
import Color from "colorjs.io";
|
|
@@ -183,13 +188,12 @@ import IFa6RegularCopy from "~icons/fa-regular/copy";
|
|
|
183
188
|
import { useInjectedI18n } from "../../composables/useInjectedI18n.js";
|
|
184
189
|
import { copy } from "../../helpers/copy.js";
|
|
185
190
|
import { twMerge } from "../../utils/twMerge.js";
|
|
186
|
-
import aria from "../Aria/Aria.vue";
|
|
187
191
|
import Icon from "../Icon/Icon.vue";
|
|
188
192
|
import LibButton from "../LibButton/LibButton.vue";
|
|
189
193
|
import LibSimpleInput from "../LibSimpleInput/LibSimpleInput.vue";
|
|
190
194
|
import { getFallbackId } from "../shared/props.js";
|
|
191
195
|
defineOptions({
|
|
192
|
-
name: "
|
|
196
|
+
name: "LibColorPicker"
|
|
193
197
|
});
|
|
194
198
|
const $attrs = useAttrs();
|
|
195
199
|
const t = useInjectedI18n();
|
|
@@ -30,7 +30,7 @@ type __VLS_Slots = {} & {
|
|
|
30
30
|
} & {
|
|
31
31
|
buttons?: (props: typeof __VLS_27) => any;
|
|
32
32
|
};
|
|
33
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
33
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
34
|
"update:modelValue": (value: RgbaColor) => any;
|
|
35
35
|
"update:tempValue": (value: RgbaColor | undefined) => any;
|
|
36
36
|
} & {
|
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
<component :is="darkModeState === 'dark' ? IFaSolidMoon : darkModeState === 'light' ? IPhSunBold : IFa6SolidCircleHalfStroke"/>
|
|
21
21
|
</icon>
|
|
22
22
|
</template>
|
|
23
|
-
<template
|
|
23
|
+
<template
|
|
24
|
+
#default
|
|
25
|
+
v-if="showLabel"
|
|
26
|
+
>
|
|
24
27
|
<div class="dark-mode-switcher--label pr-[2px]">
|
|
25
28
|
{{ t(`dark-mode-switcher.${darkModeState}`) }}
|
|
26
29
|
</div>
|
|
@@ -58,6 +61,6 @@ onMounted(() => {
|
|
|
58
61
|
|
|
59
62
|
<script>
|
|
60
63
|
export default {
|
|
61
|
-
name: "
|
|
64
|
+
name: "LibDarkModeSwitcher"
|
|
62
65
|
};
|
|
63
66
|
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ButtonHTMLAttributes } from "vue";
|
|
2
2
|
import type { TailwindClassProp } from "../shared/props.js.js";
|
|
3
|
-
declare const _default: import("vue").DefineComponent<Props,
|
|
3
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
4
4
|
"update:darkMode": (value: boolean) => any;
|
|
5
5
|
"update:darkModeState": (value: "system" | "dark" | "light") => any;
|
|
6
6
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
@@ -21,7 +21,7 @@ declare var __VLS_8: any;
|
|
|
21
21
|
type __VLS_Slots = {} & {
|
|
22
22
|
default?: (props: typeof __VLS_8) => any;
|
|
23
23
|
};
|
|
24
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
24
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
25
|
"update:modelValue": (value: SingleDate | RangeDate) => any;
|
|
26
26
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
27
27
|
"onUpdate:modelValue"?: ((value: SingleDate | RangeDate) => any) | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
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";
|
|
@@ -76,7 +76,8 @@ const locale = useInjectedLocale().timeLocale;
|
|
|
76
76
|
`, attrs.class)"
|
|
77
77
|
>
|
|
78
78
|
<div class="date-range-picker--segments-input flex items-center flex-1 overflow-scroll scrollbar-hidden whitespace-nowrap">
|
|
79
|
-
<div
|
|
79
|
+
<div
|
|
80
|
+
:class="twMerge(`
|
|
80
81
|
date-range-picker--start-segment
|
|
81
82
|
flex
|
|
82
83
|
items-center
|
|
@@ -123,7 +124,8 @@ const locale = useInjectedLocale().timeLocale;
|
|
|
123
124
|
<div class="date-range-picker--range-separator text-center px-1">
|
|
124
125
|
–
|
|
125
126
|
</div>
|
|
126
|
-
<div
|
|
127
|
+
<div
|
|
128
|
+
:class="twMerge(`
|
|
127
129
|
date-range-picker--end-segment
|
|
128
130
|
flex
|
|
129
131
|
items-center
|
|
@@ -189,13 +191,12 @@ const locale = useInjectedLocale().timeLocale;
|
|
|
189
191
|
</DateRangePickerField>
|
|
190
192
|
|
|
191
193
|
<!-- side=bottom makes months easier to click through -->
|
|
192
|
-
<!-- @vue-expect-error to exists-->
|
|
193
194
|
<DateRangePickerContent
|
|
194
195
|
:side-offset="4"
|
|
195
196
|
:avoid-collisions="true"
|
|
196
197
|
:prioritize-position="true"
|
|
197
198
|
side="bottom"
|
|
198
|
-
|
|
199
|
+
:portal="{ to: '#root' }"
|
|
199
200
|
class="
|
|
200
201
|
date-range-picker--content
|
|
201
202
|
z-100
|
|
@@ -313,7 +314,8 @@ const locale = useInjectedLocale().timeLocale;
|
|
|
313
314
|
:key="month.value.toString()"
|
|
314
315
|
>
|
|
315
316
|
<DateRangePickerGridHead class="date-range-picker--grid-head">
|
|
316
|
-
<DateRangePickerGridRow
|
|
317
|
+
<DateRangePickerGridRow
|
|
318
|
+
class="
|
|
317
319
|
date-range-picker--grid-row
|
|
318
320
|
mb-1
|
|
319
321
|
flex
|
|
@@ -15,7 +15,7 @@ declare var __VLS_167: {
|
|
|
15
15
|
type __VLS_Slots = {} & {
|
|
16
16
|
default?: (props: typeof __VLS_167) => any;
|
|
17
17
|
};
|
|
18
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
18
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
19
|
"update:modelValue": (value: RangeDate) => any;
|
|
20
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
21
|
"onUpdate:modelValue"?: ((value: RangeDate) => any) | undefined;
|
|
@@ -74,7 +74,8 @@ onBeforeUnmount(() => {
|
|
|
74
74
|
)
|
|
75
75
|
"
|
|
76
76
|
>
|
|
77
|
-
<div
|
|
77
|
+
<div
|
|
78
|
+
:class="twMerge(`
|
|
78
79
|
date-picker--segment
|
|
79
80
|
flex
|
|
80
81
|
items-center
|
|
@@ -139,13 +140,12 @@ onBeforeUnmount(() => {
|
|
|
139
140
|
</Icon>
|
|
140
141
|
</DatePickerTrigger>
|
|
141
142
|
</DatePickerField>
|
|
142
|
-
<!-- @vue-expect-error to exists-->
|
|
143
143
|
<DatePickerContent
|
|
144
144
|
:side-offset="4"
|
|
145
145
|
:avoid-collisions="true"
|
|
146
146
|
:prioritize-position="true"
|
|
147
147
|
side="bottom"
|
|
148
|
-
|
|
148
|
+
:portal="{ to: '#root' }"
|
|
149
149
|
class="
|
|
150
150
|
date-picker--content
|
|
151
151
|
z-100
|
|
@@ -178,7 +178,8 @@ onBeforeUnmount(() => {
|
|
|
178
178
|
max-w-[calc(1.2em*4+var(--spacing)*8+14ch)]
|
|
179
179
|
"
|
|
180
180
|
>
|
|
181
|
-
<DatePickerHeader
|
|
181
|
+
<DatePickerHeader
|
|
182
|
+
class="
|
|
182
183
|
date-picker--header
|
|
183
184
|
flex
|
|
184
185
|
items-center
|
|
@@ -276,7 +277,8 @@ onBeforeUnmount(() => {
|
|
|
276
277
|
:key="month.value.toString()"
|
|
277
278
|
>
|
|
278
279
|
<DatePickerGridHead class="date-picker--grid-head">
|
|
279
|
-
<DatePickerGridRow
|
|
280
|
+
<DatePickerGridRow
|
|
281
|
+
class="
|
|
280
282
|
date-picker--grid-row
|
|
281
283
|
mb-1
|
|
282
284
|
flex
|
|
@@ -15,7 +15,7 @@ declare var __VLS_157: {
|
|
|
15
15
|
type __VLS_Slots = {} & {
|
|
16
16
|
default?: (props: typeof __VLS_157) => any;
|
|
17
17
|
};
|
|
18
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
18
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
19
|
"update:modelValue": (value: SingleDate) => any;
|
|
20
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
21
|
"onUpdate:modelValue"?: ((value: SingleDate) => any) | undefined;
|
|
@@ -6,7 +6,7 @@ declare var __VLS_7: {};
|
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
7
|
default?: (props: typeof __VLS_7) => any;
|
|
8
8
|
};
|
|
9
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
10
|
"update:modelValue": (value: string) => any;
|
|
11
11
|
"update:label": (value: string) => any;
|
|
12
12
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="debug--wrapper
|
|
3
4
|
text-fg
|
|
4
5
|
dark:text-bg
|
|
5
6
|
flex
|
|
@@ -13,11 +14,15 @@
|
|
|
13
14
|
>
|
|
14
15
|
<div class="debug--header flex justify-between">
|
|
15
16
|
<span class="debug--title font-bold">{{ title }}</span>
|
|
16
|
-
<LibButton
|
|
17
|
+
<LibButton
|
|
18
|
+
class="debug--copy-button w-min-content"
|
|
19
|
+
@click="copy()"
|
|
20
|
+
>
|
|
17
21
|
<icon><i-fa6-regular-copy/></icon>
|
|
18
22
|
</LibButton>
|
|
19
23
|
</div>
|
|
20
|
-
<pre
|
|
24
|
+
<pre
|
|
25
|
+
v-if="value"
|
|
21
26
|
:class="
|
|
22
27
|
`
|
|
23
28
|
debug--value
|
|
@@ -68,7 +73,7 @@ const copy = () => {
|
|
|
68
73
|
|
|
69
74
|
<script>
|
|
70
75
|
export default {
|
|
71
|
-
name: "
|
|
76
|
+
name: "LibDebug"
|
|
72
77
|
// https://v3.vuejs.org/guide/typescript-support.html#annotating-props
|
|
73
78
|
};
|
|
74
79
|
</script>
|
|
@@ -11,7 +11,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
11
11
|
/** Sets the tab size in css. Defaults to 3. */
|
|
12
12
|
tab?: number;
|
|
13
13
|
title?: string;
|
|
14
|
-
},
|
|
14
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
15
15
|
/** The value to debug, can be anything. */
|
|
16
16
|
value?: any;
|
|
17
17
|
/** Sets the tab size in css. Defaults to 3. */
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
show?: boolean;
|
|
3
|
+
}
|
|
1
4
|
declare module "vue" {
|
|
2
5
|
interface GlobalComponents {
|
|
3
6
|
DevOnly: any;
|
|
@@ -5,7 +8,7 @@ declare module "vue" {
|
|
|
5
8
|
}
|
|
6
9
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
7
10
|
show?: boolean;
|
|
8
|
-
},
|
|
11
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
9
12
|
show?: boolean;
|
|
10
13
|
}> & Readonly<{}>, {
|
|
11
14
|
show: boolean;
|