@witchcraft/ui 0.1.2 → 0.2.0
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 +3 -6
- package/dist/module.json +2 -2
- package/dist/module.mjs +15 -12
- package/dist/runtime/assets/utils.css +1 -1
- package/dist/runtime/build/generateTheme.js +1 -1
- package/dist/runtime/components/LibButton/LibButton.vue +10 -17
- package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +8 -13
- package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +5 -4
- package/dist/runtime/components/LibColorPicker/utils/safeConvertToHsva.js +1 -1
- package/dist/runtime/components/LibColorPicker/utils/safeConvertToRgba.js +1 -1
- package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +5 -15
- package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +5 -0
- package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +5 -0
- package/dist/runtime/components/LibDebug/LibDebug.vue +1 -0
- package/dist/runtime/components/LibFileInput/LibFileInput.vue +3 -0
- package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +14 -18
- package/dist/runtime/components/LibLabel/LibLabel.vue +9 -14
- package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +0 -1
- package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +9 -10
- package/dist/runtime/components/LibNotifications/LibNotification.vue +2 -0
- package/dist/runtime/components/LibNotifications/LibNotifications.vue +1 -1
- package/dist/runtime/components/LibPalette/LibPalette.vue +9 -12
- package/dist/runtime/components/LibPopup/LibPopup.vue +2 -2
- package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +10 -15
- package/dist/runtime/components/LibRecorder/LibRecorder.vue +12 -18
- package/dist/runtime/components/LibRoot/LibRoot.vue +3 -2
- package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +12 -19
- package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +10 -15
- package/dist/runtime/components/LibTable/LibTable.vue +2 -2
- package/dist/runtime/components/Template/NAME.vue +2 -2
- package/dist/runtime/components/shared/props.d.ts +0 -29
- package/dist/runtime/components/shared/props.js +0 -12
- package/dist/runtime/composables/useAccesibilityOutline.js +1 -1
- package/dist/runtime/composables/useDivideAttrs.js +1 -1
- package/dist/runtime/composables/useSuggestions.js +4 -4
- package/dist/runtime/directives/vDetectFlex.js +4 -4
- package/dist/runtime/directives/vExtractRootEl.d.ts +1 -1
- package/dist/runtime/directives/vResizableCols.d.ts +1 -1
- package/dist/runtime/directives/vResizableCols.js +4 -4
- package/dist/runtime/helpers/NotificationHandler.js +6 -6
- package/dist/runtime/helpers/base64ToImg.js +2 -2
- package/dist/runtime/nuxt/plugins/vue-plugin.js +1 -1
- package/dist/runtime/tailwind/themeConvertionOpts.d.ts +1 -1
- package/dist/runtime/theme.d.ts +1 -1
- package/dist/runtime/theme.js +1 -1
- package/dist/runtime/utils/notifyIfError.js +1 -1
- package/dist/runtime/vue/registerComponents.js +1 -1
- package/package.json +68 -89
- package/src/module.ts +19 -12
- package/src/runtime/assets/utils.css +5 -5
- package/src/runtime/build/generateTheme.ts +1 -1
- package/src/runtime/components/LibButton/LibButton.stories.ts +1 -1
- package/src/runtime/components/LibButton/LibButton.vue +4 -8
- package/src/runtime/components/LibCheckbox/LibCheckbox.vue +3 -7
- package/src/runtime/components/LibColorPicker/LibColorPicker.vue +6 -4
- package/src/runtime/components/LibColorPicker/utils/safeConvertToHsva.ts +1 -1
- package/src/runtime/components/LibColorPicker/utils/safeConvertToRgba.ts +1 -1
- package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +8 -15
- package/src/runtime/components/LibDatePicker/LibRangeDatePicker.vue +6 -0
- package/src/runtime/components/LibDatePicker/LibSingleDatePicker.vue +6 -0
- package/src/runtime/components/LibDebug/LibDebug.stories.ts +1 -1
- package/src/runtime/components/LibDebug/LibDebug.vue +2 -0
- package/src/runtime/components/LibFileInput/LibFileInput.vue +4 -0
- package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +7 -5
- package/src/runtime/components/LibLabel/LibLabel.vue +2 -3
- package/src/runtime/components/LibMultiValues/LibMultiValues.vue +5 -3
- package/src/runtime/components/LibNotifications/LibNotification.vue +3 -0
- package/src/runtime/components/LibNotifications/LibNotifications.vue +1 -1
- package/src/runtime/components/LibPalette/LibPalette.vue +3 -3
- package/src/runtime/components/LibPopup/LibPopup.vue +2 -2
- package/src/runtime/components/LibProgressBar/LibProgressBar.vue +2 -2
- package/src/runtime/components/LibRecorder/LibRecorder.vue +3 -3
- package/src/runtime/components/LibRoot/LibRoot.vue +3 -2
- package/src/runtime/components/LibSimpleInput/LibSimpleInput.vue +2 -2
- package/src/runtime/components/LibSuggestions/LibSuggestions.vue +2 -2
- package/src/runtime/components/LibTable/LibTable.vue +1 -1
- package/src/runtime/components/Template/NAME.vue +2 -2
- package/src/runtime/components/shared/props.ts +8 -12
- package/src/runtime/composables/useAccesibilityOutline.ts +1 -1
- package/src/runtime/composables/useDivideAttrs.ts +1 -1
- package/src/runtime/composables/useSuggestions.ts +4 -4
- package/src/runtime/directives/vDetectFlex.ts +4 -4
- package/src/runtime/directives/vExtractRootEl.ts +1 -1
- package/src/runtime/directives/vResizableCols.ts +5 -5
- package/src/runtime/helpers/NotificationHandler.ts +6 -6
- package/src/runtime/nuxt/plugins/vue-plugin.ts +1 -1
- package/src/runtime/tailwind/themeConvertionOpts.ts +1 -1
- package/src/runtime/theme.ts +2 -2
- package/src/runtime/utils/notifyIfError.ts +1 -1
- package/src/runtime/vue/registerComponents.ts +1 -1
package/README.md
CHANGED
|
@@ -79,11 +79,11 @@ Most slots where possible are passed all properties needed to replace them excep
|
|
|
79
79
|
```ts
|
|
80
80
|
import { defineConfig } from "vite"
|
|
81
81
|
|
|
82
|
-
import { WitchcraftUiResolver } from "@witchcraft/ui/build/WitchcraftUiResolver
|
|
82
|
+
import { WitchcraftUiResolver } from "@witchcraft/ui/build/WitchcraftUiResolver"
|
|
83
83
|
import IconsResolver from "unplugin-icons/resolver"
|
|
84
84
|
import Icons from "unplugin-icons/vite"
|
|
85
85
|
import Components from "unplugin-vue-components/vite"
|
|
86
|
-
import { unpluginIconViteOptions } from "@witchcraft/ui/build/unpluginIconViteOptions
|
|
86
|
+
import { unpluginIconViteOptions } from "@witchcraft/ui/build/unpluginIconViteOptions"
|
|
87
87
|
|
|
88
88
|
export default defineConfig({
|
|
89
89
|
plugins: [
|
|
@@ -206,12 +206,9 @@ interface Props
|
|
|
206
206
|
</script>
|
|
207
207
|
|
|
208
208
|
<script lang="ts" setup>
|
|
209
|
-
// eslint-disable-next-line no-duplicate-imports
|
|
210
|
-
import { baseInteractivePropsDefaults } from "../shared/props.js"
|
|
211
|
-
|
|
212
209
|
const props = withDefaults(defineProps<Props>(), {
|
|
213
210
|
id: "",
|
|
214
|
-
|
|
211
|
+
unstyle: false, disabled:false, readonly:false, border:true,
|
|
215
212
|
})
|
|
216
213
|
const $attrs = useAttrs()
|
|
217
214
|
</script>
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { indent, crop } from '@alanscodelog/utils';
|
|
2
2
|
import { createResolver, defineNuxtModule, useLogger, addTemplate, addComponent, addImports, installModule, addTypeTemplate } from '@nuxt/kit';
|
|
3
3
|
import tailwindcss from '@tailwindcss/vite';
|
|
4
|
-
import { addImportsCustom } from '@witchcraft/nuxt-utils/utils/addImportsCustom
|
|
5
|
-
import { globFiles } from '@witchcraft/nuxt-utils/utils/globFiles
|
|
4
|
+
import { addImportsCustom } from '@witchcraft/nuxt-utils/utils/addImportsCustom';
|
|
5
|
+
import { globFiles } from '@witchcraft/nuxt-utils/utils/globFiles';
|
|
6
6
|
import { defu } from 'defu';
|
|
7
7
|
import fs from 'fs';
|
|
8
8
|
import { themeAsTailwindCss } from 'metamorphosis/tailwind';
|
|
@@ -100,16 +100,19 @@ const module = defineNuxtModule({
|
|
|
100
100
|
logger.info(`Adding unplugin-icons`);
|
|
101
101
|
config.plugins ??= [];
|
|
102
102
|
config.plugins = [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
...options.includeUnpluginIconsPlugins ? [
|
|
104
|
+
// we must prepend or the custom style options don't work when the module is used
|
|
105
|
+
ViteComponents({
|
|
106
|
+
resolvers: [
|
|
107
|
+
IconsResolver({ prefix: "i" })
|
|
108
|
+
// we don't need our resolver since we use nuxt instead
|
|
109
|
+
]
|
|
110
|
+
}),
|
|
111
|
+
Icons({
|
|
112
|
+
compiler: "vue3",
|
|
113
|
+
...unpluginIconViteOptions
|
|
114
|
+
})
|
|
115
|
+
] : [],
|
|
113
116
|
tailwindcss(),
|
|
114
117
|
...config.plugins
|
|
115
118
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@custom-variant dark (&:where(.dark, .dark *));@utility focus-outline-within{@
|
|
1
|
+
@custom-variant dark (&:where(.dark, .dark *));@utility focus-outline-within{@reference outlined-within:outline-2 outlined-within:outline-accent-500 outlined-within:outline-offset-2}@utility focus-outline{@reference outlined:outline-2 outlined:outline-accent-500 outlined:outline-offset-2}@utility focus-outline-no-offset{@reference outlined:outline-2 outlined:outline-accent-500}@utility focus-outline-hidden{@reference outlined:outline-none}@utility bg-squares-gradient{--_square:var(--squareSize,5px);--_double_square:calc(var(--_square)*2);--_light_square:var(--lightSquare,var(--color-white));--_dark_square:var(--darkSquare,var(--color-black));background-color:var(--_light_square);background:repeating-conic-gradient(var(--_dark_square) 0 25%,var(--_light_square) 0 50%) 50% /var(--_double_square) var(--_double_square)}@utility square-light-*{--lightSquare:--value(--color- *)}@utility square-dark-*{--darkSquare:--value(--color- *)}@utility square-size-*{--squareSize:calc(--value(integer) * 1px)}@utility bg-bars-gradient{--_bg_color:var(--bars-bg-color,var(--color-accent-700));--_fg_color:var(--bars-fg-color,var(--color-accent-800));--_angle:var(--bars-angle,45deg);--_fg_width:var(--bars-fg-width,50%);--_bg_width:calc(100% - var(--_fg_width));background-color:var(--_bg_color);--_pos_1:calc(var(--_bg_width)/2);--_pos_2:calc(var(--_bg_width)/2 + var(--_fg_width)/2);--_pos_3:calc(var(--_bg_width) + var(--_fg_width)/2);background-image:repeating-linear-gradient(var(--_angle),var(--_bg_color),var(--_bg_color) var(--_pos_1),var(--_fg_color) var(--_pos_1),var(--_fg_color) var(--_pos_2),var(--_bg_color) var(--_pos_2),var(--_bg_color) var(--_pos_3),var(--_fg_color) var(--_pos_3),var(--_fg_color))}@utility bars-angle-*{--bars-angle:var(--value(integer) * 1deg)}@utility bars-fg-*{--bars-fg-color:--value(--color-*)}@utility bars-bg-*{--bars-bg-color:--value(--color-*)}@utility bars-w-*{--bars-fg-width:calc(--value(integer) * 1%, 50%)}@utility scrollbar-hidden{-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none}}@utility styled-scrollbar{--_scrollbar_width:var(--scrollbar-width,calc(var(--spacing)*3));--_scrollbar_border_width:var(--scrollbar-border-width,calc(var(--spacing)/2));--_scrollbar_color:var(--scrollbar-color,--alpha(var(--color-accent-500)/40%));--_scrollbar_hover_color:var(--scrollbar-hover-color,--alpha(var(--color-accent-500)/80%));--_scrollbar_bg_color:var(--scrollbar-bg-color,var(--color-bg));.dark &{--_scrollbar_bg_color:var(--scrollbar-bg-color,var(--color-fg))}&::-webkit-scrollbar{height:var(--_scrollbar_width);width:var(--_scrollbar_width)}&::-webkit-scrollbar-corner,&::-webkit-scrollbar-track{background-color:transparent}&::-webkit-scrollbar-thumb,&::-webkit-scrollbar-track{border-radius:var(--_scrollbar_width)}&::-webkit-scrollbar-thumb{background-color:var(--_scrollbar_color);border:var(--_scrollbar_border_width) solid var(--_scrollbar_bg_color)}&::-webkit-scrollbar-thumb:hover{cursor:pointer}&::-webkit-scrollbar-thumb:active,&::-webkit-scrollbar-thumb:hover{background-color:var(--_scrollbar_hover_color);border-radius:var(--_scrollbar_width)}}@utility styled-scrollbar-w-*{--scrollbar-width:--value(integer)}@utility styled-scrollbar-border-w-*{--scrollbar-border-width:--value(integer)}@utility styled-scrollbar-*{--scrollbar-color:--value(--color-*)}@utility styled-scrollbar-bg-*{--scrollbar-bg-color:--value(--color-*)}@utility styled-resizer{--_resizer_width:var(--resizer-width,8px);--_resizer_color:var(--resizer-color,var(--color-neutral-300));.dark &{--_resizer_color:var(--resizer-color,var(--color-neutral-700))}&::-webkit-resizer{border-bottom-color:var(--_resizer_color);border-left-color:transparent;border-right-color:var(--_resizer_color);border-style:solid;border-top-color:transparent;border-width:var(--_resizer_width)}}@utility styled-resizer-w-*{--resizer-width:--value(integer)}@utility styled-resizer-color-*{--resizer-color:--value(--color-*)}@utility content-vertical-holder{--tw-content:"\200b";content:var(--tw-content)}@utility no-touch-action{touch-action:none}@utility bg-transparency-squares{@reference bg-squares-gradient square-light-white square-dark-neutral-300 square-size-6}@utility link-like{@apply cursor-pointer hover:text-accent-500}
|
|
@@ -185,33 +185,26 @@
|
|
|
185
185
|
</template>
|
|
186
186
|
|
|
187
187
|
<script setup>
|
|
188
|
-
import { isBlank } from "@alanscodelog/utils/isBlank
|
|
189
|
-
import { keys } from "@alanscodelog/utils/keys.js";
|
|
190
|
-
import { pick } from "@alanscodelog/utils/pick.js";
|
|
188
|
+
import { isBlank } from "@alanscodelog/utils/isBlank";
|
|
191
189
|
import { computed, useAttrs } from "vue";
|
|
192
190
|
import { useAriaLabel } from "../../composables/useAriaLabel.js";
|
|
193
|
-
import { useDivideAttrs } from "../../composables/useDivideAttrs.js";
|
|
194
191
|
import { twMerge } from "../../utils/twMerge.js";
|
|
195
|
-
import {
|
|
192
|
+
import { getFallbackId } from "../shared/props.js";
|
|
196
193
|
const $attrs = useAttrs();
|
|
197
194
|
defineOptions({
|
|
198
195
|
name: "lib-button"
|
|
199
196
|
});
|
|
200
197
|
const fallbackId = getFallbackId();
|
|
201
|
-
const props = defineProps(
|
|
198
|
+
const props = defineProps({
|
|
202
199
|
id: { type: String, required: false },
|
|
203
|
-
label: { type: String, required: false },
|
|
204
|
-
disabled: { type: Boolean, required: false },
|
|
205
|
-
readonly: { type: Boolean, required: false },
|
|
206
|
-
border: { type: Boolean, required: false },
|
|
207
|
-
unstyle: { type: Boolean, required: false },
|
|
208
|
-
color: { type: [String, Boolean], required: false },
|
|
200
|
+
label: { type: String, required: false, default: "" },
|
|
201
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
202
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
203
|
+
border: { type: Boolean, required: false, default: true },
|
|
204
|
+
unstyle: { type: Boolean, required: false, default: false },
|
|
205
|
+
color: { type: [String, Boolean], required: false, default: false },
|
|
209
206
|
autoTitleFromAria: { type: Boolean, required: false }
|
|
210
|
-
}
|
|
211
|
-
color: false,
|
|
212
|
-
label: "",
|
|
213
|
-
...baseInteractivePropsDefaults
|
|
214
|
-
}));
|
|
207
|
+
});
|
|
215
208
|
const ariaLabel = useAriaLabel(props, fallbackId);
|
|
216
209
|
const autoTitle = computed(() => ({
|
|
217
210
|
title: props.autoTitleFromAria ? $attrs["aria-label"] ?? props.label : void 0
|
|
@@ -72,14 +72,11 @@
|
|
|
72
72
|
</template>
|
|
73
73
|
|
|
74
74
|
<script setup>
|
|
75
|
-
import {
|
|
76
|
-
import { omit } from "@alanscodelog/utils/omit.js";
|
|
77
|
-
import { pick } from "@alanscodelog/utils/pick.js";
|
|
78
|
-
import { computed, ref, useAttrs, useSlots } from "vue";
|
|
75
|
+
import { ref, useSlots } from "vue";
|
|
79
76
|
import { useDivideAttrs } from "../../composables/useDivideAttrs.js";
|
|
80
77
|
import { usePreHydrationValue } from "../../composables/usePreHydrationValue.js";
|
|
81
78
|
import { twMerge } from "../../utils/twMerge.js";
|
|
82
|
-
import {
|
|
79
|
+
import { getFallbackId } from "../shared/props.js";
|
|
83
80
|
defineOptions({
|
|
84
81
|
name: "lib-checkbox",
|
|
85
82
|
inheritAttrs: false
|
|
@@ -87,16 +84,14 @@ defineOptions({
|
|
|
87
84
|
const $ = useDivideAttrs(["label", "wrapper"]);
|
|
88
85
|
const $slots = useSlots();
|
|
89
86
|
const fallbackId = getFallbackId();
|
|
90
|
-
const props = defineProps(
|
|
87
|
+
const props = defineProps({
|
|
91
88
|
id: { type: String, required: false },
|
|
92
89
|
label: { type: String, required: false },
|
|
93
|
-
disabled: { type: Boolean, required: false },
|
|
94
|
-
readonly: { type: Boolean, required: false },
|
|
95
|
-
border: { type: Boolean, required: false },
|
|
96
|
-
unstyle: { type: Boolean, required: false }
|
|
97
|
-
}
|
|
98
|
-
...baseInteractivePropsDefaults
|
|
99
|
-
}));
|
|
90
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
91
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
92
|
+
border: { type: Boolean, required: false, default: true },
|
|
93
|
+
unstyle: { type: Boolean, required: false, default: false }
|
|
94
|
+
});
|
|
100
95
|
const emits = defineEmits(["submit"]);
|
|
101
96
|
const el = ref(null);
|
|
102
97
|
const inputEl = ref(null);
|
|
@@ -170,15 +170,16 @@
|
|
|
170
170
|
</template>
|
|
171
171
|
|
|
172
172
|
<script setup>
|
|
173
|
-
import { castType } from "@alanscodelog/utils/castType
|
|
174
|
-
import { clampNumber } from "@alanscodelog/utils/clampNumber
|
|
175
|
-
import { isArray } from "@alanscodelog/utils/isArray
|
|
176
|
-
import { unreachable } from "@alanscodelog/utils/unreachable
|
|
173
|
+
import { castType } from "@alanscodelog/utils/castType";
|
|
174
|
+
import { clampNumber } from "@alanscodelog/utils/clampNumber";
|
|
175
|
+
import { isArray } from "@alanscodelog/utils/isArray";
|
|
176
|
+
import { unreachable } from "@alanscodelog/utils/unreachable";
|
|
177
177
|
import Color from "colorjs.io";
|
|
178
178
|
import { computed, onMounted, reactive, ref, useAttrs, watch } from "vue";
|
|
179
179
|
import { safeConvertToHsva } from "./utils/safeConvertToHsva.js";
|
|
180
180
|
import { safeConvertToRgba } from "./utils/safeConvertToRgba.js";
|
|
181
181
|
import { toLowPrecisionRgbaString } from "./utils/toLowPrecisionRgbaString.js";
|
|
182
|
+
import IFa6RegularCopy from "~icons/fa-regular/copy";
|
|
182
183
|
import { useInjectedI18n } from "../../composables/useInjectedI18n.js";
|
|
183
184
|
import { copy } from "../../helpers/copy.js";
|
|
184
185
|
import { twMerge } from "../../utils/twMerge.js";
|
|
@@ -15,22 +15,9 @@
|
|
|
15
15
|
<!-- content-vertical-holder will keep the icon the height of a text line regardless of the svg used -->
|
|
16
16
|
<template #icon>
|
|
17
17
|
<icon
|
|
18
|
-
|
|
19
|
-
class="w-[1em] flex items-center content-vertical-holder"
|
|
18
|
+
class="w-[1em] items-center content-vertical-holder"
|
|
20
19
|
>
|
|
21
|
-
<
|
|
22
|
-
</icon>
|
|
23
|
-
<icon
|
|
24
|
-
v-else-if="darkModeState === 'light'"
|
|
25
|
-
class="w-[1em] content-vertical-holder"
|
|
26
|
-
>
|
|
27
|
-
<i-ph-sun-bold/>
|
|
28
|
-
</icon>
|
|
29
|
-
<icon
|
|
30
|
-
v-else
|
|
31
|
-
class="w-[1em] content-vertical-holder"
|
|
32
|
-
>
|
|
33
|
-
<i-fa6-solid-circle-half-stroke/>
|
|
20
|
+
<component :is="darkModeState === 'dark' ? IFaSolidMoon : darkModeState === 'light' ? IPhSunBold : IFa6SolidCircleHalfStroke"/>
|
|
34
21
|
</icon>
|
|
35
22
|
</template>
|
|
36
23
|
<template #default v-if="showLabel">
|
|
@@ -43,6 +30,9 @@
|
|
|
43
30
|
|
|
44
31
|
<script setup>
|
|
45
32
|
import { onMounted, useAttrs, watch } from "vue";
|
|
33
|
+
import IFaSolidMoon from "~icons/fa-solid/moon";
|
|
34
|
+
import IFa6SolidCircleHalfStroke from "~icons/fa6-solid/circle-half-stroke";
|
|
35
|
+
import IPhSunBold from "~icons/ph/sun-bold";
|
|
46
36
|
import { useInjectedDarkMode } from "../../composables/useInjectedDarkMode.js";
|
|
47
37
|
import { useInjectedI18n } from "../../composables/useInjectedI18n.js";
|
|
48
38
|
import { twMerge } from "../../utils/twMerge.js";
|
|
@@ -3,6 +3,11 @@ import { CalendarDate, getLocalTimeZone, ZonedDateTime } from "@internationalize
|
|
|
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 IRadixIconsCalendar from "~icons/radix-icons/calendar";
|
|
7
|
+
import IRadixIconsChevronLeft from "~icons/radix-icons/chevron-left";
|
|
8
|
+
import IRadixIconsChevronRight from "~icons/radix-icons/chevron-right";
|
|
9
|
+
import IRadixIconsDoubleArrowLeft from "~icons/radix-icons/double-arrow-left";
|
|
10
|
+
import IRadixIconsDoubleArrowRight from "~icons/radix-icons/double-arrow-right";
|
|
6
11
|
import { useInjectedLocale } from "../../composables/useInjectedLocale.js";
|
|
7
12
|
import { twMerge } from "../../utils/twMerge.js";
|
|
8
13
|
import Icon from "../Icon/Icon.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 IRadixIconsCalendar from "~icons/radix-icons/calendar";
|
|
7
|
+
import IRadixIconsChevronLeft from "~icons/radix-icons/chevron-left";
|
|
8
|
+
import IRadixIconsChevronRight from "~icons/radix-icons/chevron-right";
|
|
9
|
+
import IRadixIconsDoubleArrowLeft from "~icons/radix-icons/double-arrow-left";
|
|
10
|
+
import IRadixIconsDoubleArrowRight from "~icons/radix-icons/double-arrow-right";
|
|
6
11
|
import { useInjectedLocale } from "../../composables/useInjectedLocale.js";
|
|
7
12
|
import { twMerge } from "../../utils/twMerge.js";
|
|
8
13
|
import Icon from "../Icon/Icon.vue";
|
|
@@ -163,6 +163,9 @@
|
|
|
163
163
|
|
|
164
164
|
<script setup>
|
|
165
165
|
import { computed, ref, shallowReactive, watch } from "vue";
|
|
166
|
+
import IFa6RegularFile from "~icons/fa6-regular/file";
|
|
167
|
+
import IFa6SolidArrowUpFromBracket from "~icons/fa6-solid/arrow-up-from-bracket";
|
|
168
|
+
import IFa6SolidXmark from "~icons/fa6-solid/xmark";
|
|
166
169
|
import { useDivideAttrs } from "../../composables/useDivideAttrs.js";
|
|
167
170
|
import { useInjectedI18n } from "../../composables/useInjectedI18n.js";
|
|
168
171
|
import {} from "../../types/index.js";
|
|
@@ -156,10 +156,11 @@
|
|
|
156
156
|
</template>
|
|
157
157
|
|
|
158
158
|
<script setup>
|
|
159
|
-
import { isBlank } from "@alanscodelog/utils/isBlank
|
|
160
|
-
import { isObject } from "@alanscodelog/utils/isObject
|
|
161
|
-
import { pushIfNotIn } from "@alanscodelog/utils/pushIfNotIn
|
|
159
|
+
import { isBlank } from "@alanscodelog/utils/isBlank";
|
|
160
|
+
import { isObject } from "@alanscodelog/utils/isObject";
|
|
161
|
+
import { pushIfNotIn } from "@alanscodelog/utils/pushIfNotIn";
|
|
162
162
|
import { computed, nextTick, onBeforeMount, ref, toRef, useSlots, watch } from "vue";
|
|
163
|
+
import IFa6SolidChevronUp from "~icons/fa6-solid/chevron-up";
|
|
163
164
|
import { useDivideAttrs } from "../../composables/useDivideAttrs.js";
|
|
164
165
|
import { useSuggestionsInputAria } from "../../composables/useSuggestions.js";
|
|
165
166
|
import { twMerge } from "../../utils/twMerge.js";
|
|
@@ -168,7 +169,7 @@ import LibLabel from "../LibLabel/LibLabel.vue";
|
|
|
168
169
|
import LibMultiValues from "../LibMultiValues/LibMultiValues.vue";
|
|
169
170
|
import LibSimpleInput from "../LibSimpleInput/LibSimpleInput.vue";
|
|
170
171
|
import LibSuggestions from "../LibSuggestions/LibSuggestions.vue";
|
|
171
|
-
import {
|
|
172
|
+
import { getFallbackId } from "../shared/props.js";
|
|
172
173
|
defineOptions({
|
|
173
174
|
name: "lib-simple-input-deprecated",
|
|
174
175
|
inheritAttrs: false
|
|
@@ -176,11 +177,11 @@ defineOptions({
|
|
|
176
177
|
const $slots = useSlots();
|
|
177
178
|
const emit = defineEmits(["input", "submit", "keydown", "blur", "focus", "indicatorClick"]);
|
|
178
179
|
const fallbackId = getFallbackId();
|
|
179
|
-
const props = defineProps(
|
|
180
|
-
suggestions: { type: Array, required: false },
|
|
180
|
+
const props = defineProps({
|
|
181
|
+
suggestions: { type: Array, required: false, default: void 0 },
|
|
181
182
|
suggestionLabel: { type: Function, required: false },
|
|
182
183
|
restrictToSuggestions: { type: Boolean, required: false },
|
|
183
|
-
updateOnlyOnSubmit: { type: Boolean, required: false },
|
|
184
|
+
updateOnlyOnSubmit: { type: Boolean, required: false, default: false },
|
|
184
185
|
suggestionsFilter: { type: Function, required: false },
|
|
185
186
|
allowOpenEmpty: { type: Boolean, required: false },
|
|
186
187
|
canOpen: { type: Boolean, required: false },
|
|
@@ -190,17 +191,12 @@ const props = defineProps(/* @__PURE__ */ _mergeDefaults({
|
|
|
190
191
|
showSelectedValues: { type: Boolean, required: false },
|
|
191
192
|
id: { type: String, required: false },
|
|
192
193
|
label: { type: String, required: false },
|
|
193
|
-
disabled: { type: Boolean, required: false },
|
|
194
|
-
readonly: { type: Boolean, required: false },
|
|
195
|
-
border: { type: Boolean, required: false },
|
|
196
|
-
unstyle: { type: Boolean, required: false },
|
|
197
|
-
valid: { type: Boolean, required: false }
|
|
198
|
-
}
|
|
199
|
-
valid: true,
|
|
200
|
-
suggestions: void 0,
|
|
201
|
-
updateOnlyOnSubmit: false,
|
|
202
|
-
...baseInteractivePropsDefaults
|
|
203
|
-
}));
|
|
194
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
195
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
196
|
+
border: { type: Boolean, required: false, default: true },
|
|
197
|
+
unstyle: { type: Boolean, required: false, default: false },
|
|
198
|
+
valid: { type: Boolean, required: false, default: true }
|
|
199
|
+
});
|
|
204
200
|
const $ = useDivideAttrs(["wrapper", "inner-wrapper", "suggestions", "multivalues"]);
|
|
205
201
|
const $values = defineModel("values", { type: null, ...{ default: void 0 } });
|
|
206
202
|
const $modelValue = defineModel({ type: String, ...{ required: true } });
|
|
@@ -22,26 +22,21 @@
|
|
|
22
22
|
<script setup>
|
|
23
23
|
import { toRef, useAttrs } from "vue";
|
|
24
24
|
import { twMerge } from "../../utils/twMerge.js";
|
|
25
|
-
import {
|
|
25
|
+
import { getFallbackId } from "../shared/props.js";
|
|
26
26
|
defineOptions({
|
|
27
27
|
name: "lib-label"
|
|
28
28
|
});
|
|
29
29
|
const fallbackId = getFallbackId();
|
|
30
|
-
defineProps(
|
|
31
|
-
id: { type: String, required: false },
|
|
30
|
+
defineProps({
|
|
31
|
+
id: { type: String, required: false, default: "" },
|
|
32
32
|
label: { type: String, required: false },
|
|
33
|
-
disabled: { type: Boolean, required: false },
|
|
34
|
-
readonly: { type: Boolean, required: false },
|
|
35
|
-
border: { type: Boolean, required: false },
|
|
36
|
-
unstyle: { type: Boolean, required: false },
|
|
33
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
34
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
35
|
+
border: { type: Boolean, required: false, default: true },
|
|
36
|
+
unstyle: { type: Boolean, required: false, default: false },
|
|
37
37
|
unstyled: { type: Boolean, required: false },
|
|
38
|
-
valid: { type: Boolean, required: false }
|
|
39
|
-
}
|
|
40
|
-
id: "",
|
|
41
|
-
unstyled: void 0,
|
|
42
|
-
valid: true,
|
|
43
|
-
...baseInteractivePropsDefaults
|
|
44
|
-
}));
|
|
38
|
+
valid: { type: Boolean, required: false, default: true }
|
|
39
|
+
});
|
|
45
40
|
const $attrs = useAttrs();
|
|
46
41
|
</script>
|
|
47
42
|
|
|
@@ -14,7 +14,6 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, voi
|
|
|
14
14
|
readonly: boolean;
|
|
15
15
|
border: boolean;
|
|
16
16
|
unstyle: boolean;
|
|
17
|
-
unstyled: boolean;
|
|
18
17
|
valid: boolean;
|
|
19
18
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
20
19
|
default?: (props: {}) => any;
|
|
@@ -76,28 +76,27 @@
|
|
|
76
76
|
</template>
|
|
77
77
|
|
|
78
78
|
<script setup>
|
|
79
|
-
import { removeIfIn } from "@alanscodelog/utils/removeIfIn
|
|
79
|
+
import { removeIfIn } from "@alanscodelog/utils/removeIfIn";
|
|
80
80
|
import { computed } from "vue";
|
|
81
|
+
import IFa6SolidXmark from "~icons/fa6-solid/xmark";
|
|
81
82
|
import { useDivideAttrs } from "../../composables/useDivideAttrs.js";
|
|
82
83
|
import { copy } from "../../helpers/copy.js";
|
|
83
84
|
import { twMerge } from "../../utils/twMerge.js";
|
|
84
85
|
import Icon from "../Icon/Icon.vue";
|
|
85
86
|
import LibButton from "../LibButton/LibButton.vue";
|
|
86
|
-
import {
|
|
87
|
+
import {} from "../shared/props.js";
|
|
87
88
|
defineOptions({
|
|
88
89
|
name: "lib-multi-values",
|
|
89
90
|
inheritAttrs: false
|
|
90
91
|
});
|
|
91
92
|
const $ = useDivideAttrs(["item"]);
|
|
92
|
-
const props = defineProps(
|
|
93
|
+
const props = defineProps({
|
|
93
94
|
label: { type: String, required: false },
|
|
94
|
-
disabled: { type: Boolean, required: false },
|
|
95
|
-
readonly: { type: Boolean, required: false },
|
|
96
|
-
border: { type: Boolean, required: false },
|
|
97
|
-
unstyle: { type: Boolean, required: false }
|
|
98
|
-
}
|
|
99
|
-
...baseInteractivePropsDefaults
|
|
100
|
-
}));
|
|
95
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
96
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
97
|
+
border: { type: Boolean, required: false, default: true },
|
|
98
|
+
unstyle: { type: Boolean, required: false, default: false }
|
|
99
|
+
});
|
|
101
100
|
const canEdit = computed(() => !props.disabled && !props.readonly);
|
|
102
101
|
const $modelValue = defineModel({ type: Array, ...{ default: () => [] } });
|
|
103
102
|
const removeVal = (value) => {
|
|
@@ -84,6 +84,8 @@
|
|
|
84
84
|
|
|
85
85
|
<script setup>
|
|
86
86
|
import { computed, ref, useAttrs } from "vue";
|
|
87
|
+
import IFa6RegularCopy from "~icons/fa6-regular/copy";
|
|
88
|
+
import IFa6SolidXmark from "~icons/fa6-solid/xmark";
|
|
87
89
|
import { copy } from "../../helpers/copy.js";
|
|
88
90
|
import { NotificationHandler } from "../../helpers/NotificationHandler.js";
|
|
89
91
|
import { twMerge } from "../../utils/twMerge.js";
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script setup>
|
|
55
|
-
import { removeIfIn } from "@alanscodelog/utils/removeIfIn
|
|
55
|
+
import { removeIfIn } from "@alanscodelog/utils/removeIfIn";
|
|
56
56
|
import { nextTick, onBeforeUnmount, ref, shallowReactive, Transition, TransitionGroup } from "vue";
|
|
57
57
|
import LibNotification from "./LibNotification.vue";
|
|
58
58
|
import { useNotificationHandler } from "../../composables/useNotificationHandler.js";
|
|
@@ -27,20 +27,17 @@ export default { name: "lib-palette" };
|
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<script setup>
|
|
30
|
-
import { keys } from "@alanscodelog/utils/keys
|
|
30
|
+
import { keys } from "@alanscodelog/utils/keys";
|
|
31
31
|
import {} from "metamorphosis";
|
|
32
|
-
import {
|
|
33
|
-
const props = defineProps(
|
|
32
|
+
import {} from "../shared/props.js";
|
|
33
|
+
const props = defineProps({
|
|
34
34
|
id: { type: String, required: false },
|
|
35
|
-
disabled: { type: Boolean, required: false },
|
|
36
|
-
readonly: { type: Boolean, required: false },
|
|
37
|
-
border: { type: Boolean, required: false },
|
|
38
|
-
unstyle: { type: Boolean, required: false },
|
|
39
|
-
theme: { type: Object, required: true }
|
|
40
|
-
}
|
|
41
|
-
theme: () => ({}),
|
|
42
|
-
...baseInteractivePropsDefaults
|
|
43
|
-
}));
|
|
35
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
36
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
37
|
+
border: { type: Boolean, required: false, default: true },
|
|
38
|
+
unstyle: { type: Boolean, required: false, default: false },
|
|
39
|
+
theme: { type: Object, required: true, default: () => ({}) }
|
|
40
|
+
});
|
|
44
41
|
const exclude = ["--color-bg", "--color-fg"];
|
|
45
42
|
const colors = keys(props.theme.css).filter((key) => key.startsWith("--color") && !exclude.includes(key));
|
|
46
43
|
</script>
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
import { onMounted, nextTick, ref, useAttrs, watch } from "vue";
|
|
50
50
|
import { getFallbackId } from "../shared/props.js";
|
|
51
51
|
import { twMerge } from "../../utils/twMerge.js";
|
|
52
|
-
import { castType } from "@alanscodelog/utils/castType
|
|
53
|
-
import { isArray } from "@alanscodelog/utils/isArray
|
|
52
|
+
import { castType } from "@alanscodelog/utils/castType";
|
|
53
|
+
import { isArray } from "@alanscodelog/utils/isArray";
|
|
54
54
|
const fallbackId = getFallbackId();
|
|
55
55
|
const props = defineProps({
|
|
56
56
|
id: { type: String, required: false },
|
|
@@ -97,30 +97,25 @@
|
|
|
97
97
|
<script setup>
|
|
98
98
|
import { ref, watch } from "vue";
|
|
99
99
|
import { twMerge } from "../../utils/twMerge.js";
|
|
100
|
-
import {
|
|
100
|
+
import { getFallbackId } from "../shared/props.js";
|
|
101
101
|
const clampVal = (n, min, max) => Math.min(Math.max(n, min), max);
|
|
102
102
|
defineOptions({
|
|
103
103
|
name: "lib-progress-bar",
|
|
104
104
|
inheritAttrs: false
|
|
105
105
|
});
|
|
106
106
|
const fallbackId = getFallbackId();
|
|
107
|
-
const props = defineProps(
|
|
107
|
+
const props = defineProps({
|
|
108
108
|
id: { type: String, required: false },
|
|
109
|
-
disabled: { type: Boolean, required: false },
|
|
110
|
-
readonly: { type: Boolean, required: false },
|
|
111
|
-
border: { type: Boolean, required: false },
|
|
112
|
-
unstyle: { type: Boolean, required: false },
|
|
109
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
110
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
111
|
+
border: { type: Boolean, required: false, default: true },
|
|
112
|
+
unstyle: { type: Boolean, required: false, default: false },
|
|
113
113
|
label: { type: String, required: false },
|
|
114
114
|
progress: { type: Number, required: true },
|
|
115
|
-
autohideOnComplete: { type: Number, required: false },
|
|
116
|
-
keepSpaceWhenHidden: { type: Boolean, required: false },
|
|
117
|
-
clamp: { type: Array, required: false }
|
|
118
|
-
}
|
|
119
|
-
autohideOnComplete: -1,
|
|
120
|
-
keepSpaceWhenHidden: false,
|
|
121
|
-
clamp: () => [0, 100],
|
|
122
|
-
...baseInteractivePropsDefaults
|
|
123
|
-
}));
|
|
115
|
+
autohideOnComplete: { type: Number, required: false, default: -1 },
|
|
116
|
+
keepSpaceWhenHidden: { type: Boolean, required: false, default: false },
|
|
117
|
+
clamp: { type: Array, required: false, default: () => [0, 100] }
|
|
118
|
+
});
|
|
124
119
|
const hide = ref(false);
|
|
125
120
|
const psuedoHide = ref(false);
|
|
126
121
|
let timeout;
|
|
@@ -71,12 +71,12 @@
|
|
|
71
71
|
</template>
|
|
72
72
|
|
|
73
73
|
<script setup>
|
|
74
|
-
import { keys } from "@alanscodelog/utils/keys
|
|
74
|
+
import { keys } from "@alanscodelog/utils/keys";
|
|
75
75
|
import { computed, onBeforeUnmount, onMounted, ref, watch, watchPostEffect } from "vue";
|
|
76
76
|
import { useAriaLabel } from "../../composables/useAriaLabel.js";
|
|
77
77
|
import { useInjectedI18n } from "../../composables/useInjectedI18n.js";
|
|
78
78
|
import { twMerge } from "../../utils/twMerge.js";
|
|
79
|
-
import {
|
|
79
|
+
import { getFallbackId } from "../shared/props.js";
|
|
80
80
|
defineOptions({
|
|
81
81
|
name: "lib-recorder",
|
|
82
82
|
inheritAttrs: false
|
|
@@ -84,24 +84,18 @@ defineOptions({
|
|
|
84
84
|
const t = useInjectedI18n();
|
|
85
85
|
const emits = defineEmits(["recorder:blur", "recorder:click", "focus:parent"]);
|
|
86
86
|
const fallbackId = getFallbackId();
|
|
87
|
-
const props = defineProps(
|
|
88
|
-
id: { type: String, required: false },
|
|
89
|
-
disabled: { type: Boolean, required: false },
|
|
90
|
-
readonly: { type: Boolean, required: false },
|
|
91
|
-
border: { type: Boolean, required: false },
|
|
92
|
-
unstyle: { type: Boolean, required: false },
|
|
87
|
+
const props = defineProps({
|
|
88
|
+
id: { type: String, required: false, default: void 0 },
|
|
89
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
90
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
91
|
+
border: { type: Boolean, required: false, default: true },
|
|
92
|
+
unstyle: { type: Boolean, required: false, default: false },
|
|
93
93
|
label: { type: String, required: false },
|
|
94
94
|
recordingValue: { type: String, required: false },
|
|
95
|
-
recordingTitle: { type: String, required: false },
|
|
96
|
-
recorder: { type: null, required: false },
|
|
97
|
-
binders: { type: null, required: false }
|
|
98
|
-
}
|
|
99
|
-
recordingTitle: "",
|
|
100
|
-
id: void 0,
|
|
101
|
-
binders: void 0,
|
|
102
|
-
recorder: void 0,
|
|
103
|
-
...baseInteractivePropsDefaults
|
|
104
|
-
}));
|
|
95
|
+
recordingTitle: { type: String, required: false, default: "" },
|
|
96
|
+
recorder: { type: null, required: false, default: void 0 },
|
|
97
|
+
binders: { type: null, required: false, default: void 0 }
|
|
98
|
+
});
|
|
105
99
|
const recording = defineModel("recording", { type: Boolean, ...{ required: false, default: false } });
|
|
106
100
|
const modelValue = defineModel({ type: String, ...{ required: true } });
|
|
107
101
|
const recorderEl = ref(null);
|