@resee-movies/nuxt-ux 0.0.4 → 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/dist/module.json +1 -1
- package/dist/module.mjs +43 -9
- package/dist/runtime/components/{UiButton.vue → Button.vue} +6 -4
- package/dist/runtime/components/{UiButton.vue.d.ts → Button.vue.d.ts} +6 -6
- package/dist/runtime/components/{UiCard.vue → Card.vue} +4 -0
- package/dist/runtime/components/Card.vue.d.ts +21 -0
- package/dist/runtime/components/CloseButton.vue +14 -0
- package/dist/runtime/components/Dialog.vue +121 -0
- package/dist/runtime/components/Dialog.vue.d.ts +31 -0
- package/dist/runtime/components/Drawer.vue +91 -0
- package/dist/runtime/components/Drawer.vue.d.ts +23 -0
- package/dist/runtime/components/{UiHeading.vue → Heading.vue} +4 -0
- package/dist/runtime/components/Heading.vue.d.ts +17 -0
- package/dist/runtime/components/Icon.vue +24 -0
- package/dist/runtime/components/Icon.vue.d.ts +14 -0
- package/dist/runtime/components/{UiIconTextPair.vue → IconTextPair.vue} +3 -3
- package/dist/runtime/components/{UiIconTextPair.vue.d.ts → IconTextPair.vue.d.ts} +6 -6
- package/dist/runtime/components/Image.vue +149 -0
- package/dist/runtime/components/Image.vue.d.ts +59 -0
- package/dist/runtime/components/{UiLayoutPageColumn.vue → LayoutPageColumn.vue} +1 -1
- package/dist/runtime/components/{UiLayoutPageColumn.vue.d.ts → LayoutPageColumn.vue.d.ts} +3 -3
- package/dist/runtime/components/{UiLayoutPageContainer.vue.d.ts → LayoutPageContainer.vue.d.ts} +3 -3
- package/dist/runtime/components/{UiLink.vue → Link.vue} +6 -4
- package/dist/runtime/components/{UiLink.vue.d.ts → Link.vue.d.ts} +7 -7
- package/dist/runtime/components/{UiLoadingIndicator.vue → LoadingIndicator.vue} +4 -0
- package/dist/runtime/components/LoadingIndicator.vue.d.ts +9 -0
- package/dist/runtime/components/{UiLorem.vue → Lorem.vue} +4 -0
- package/dist/runtime/components/{UiLorem.vue.d.ts → Lorem.vue.d.ts} +3 -3
- package/dist/runtime/components/{UiMessage.vue → Message.vue} +2 -1
- package/dist/runtime/components/{UiMessage.vue.d.ts → Message.vue.d.ts} +3 -3
- package/dist/runtime/components/{UiNotificationContainer.vue → NotificationContainer.vue} +1 -0
- package/dist/runtime/components/NotificationContainer.vue.d.ts +3 -0
- package/dist/runtime/components/{UiProgressBar.vue → ProgressBar.vue} +5 -0
- package/dist/runtime/components/{UiProgressBar.vue.d.ts → ProgressBar.vue.d.ts} +3 -3
- package/dist/runtime/components/{UiTag.vue → Tag.vue} +9 -2
- package/dist/runtime/components/{UiTag.vue.d.ts → Tag.vue.d.ts} +3 -3
- package/dist/runtime/composables/use-load-image.d.ts +23 -0
- package/dist/runtime/composables/use-load-image.js +109 -0
- package/dist/runtime/config.d.ts +18 -0
- package/dist/runtime/config.js +15 -0
- package/dist/runtime/theme/css/brand/theme.css +1 -1
- package/dist/runtime/theme/css/brand/tooltip.css +1 -1
- package/dist/runtime/theme/css/brand/transition.css +1 -1
- package/dist/runtime/theme/css/brand/utilities.css +1 -1
- package/dist/runtime/types/index.d.ts +6 -0
- package/package.json +7 -3
- package/dist/runtime/components/UiCard.vue.d.ts +0 -24
- package/dist/runtime/components/UiHeading.vue.d.ts +0 -20
- package/dist/runtime/components/UiIcon.vue +0 -23
- package/dist/runtime/components/UiIcon.vue.d.ts +0 -12
- package/dist/runtime/components/UiLoadingIndicator.vue.d.ts +0 -9
- package/dist/runtime/composables/use-nuxt-ux-config.d.ts +0 -24
- package/dist/runtime/composables/use-nuxt-ux-config.js +0 -15
- /package/dist/runtime/components/{UiNotificationContainer.vue.d.ts → CloseButton.vue.d.ts} +0 -0
- /package/dist/runtime/components/{UiLayoutPageContainer.vue → LayoutPageContainer.vue} +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref = "container"
|
|
4
|
+
:class = "['image', {
|
|
5
|
+
loading: imgLoading || imgBgLoading || props.showLoading,
|
|
6
|
+
glass: props.glassy,
|
|
7
|
+
bordered: props.bordered,
|
|
8
|
+
beveled: props.beveled,
|
|
9
|
+
raised: props.raised
|
|
10
|
+
}]"
|
|
11
|
+
>
|
|
12
|
+
<Icon
|
|
13
|
+
v-if = "props.defaultIcon && (!imgSrc || imgError || imgLoading || props.showLoading)"
|
|
14
|
+
:name = "props.defaultIcon"
|
|
15
|
+
:size = "props.iconSize"
|
|
16
|
+
:color-cycle = "imgLoading || props.showLoading"
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
<img
|
|
20
|
+
:src = "imgSrc"
|
|
21
|
+
:alt = "altText"
|
|
22
|
+
:width = "dimensions.width"
|
|
23
|
+
:height = "dimensions.height"
|
|
24
|
+
:loading = "props.loading"
|
|
25
|
+
class = "transition-opacity duration-300"
|
|
26
|
+
:class = "[aspectRatioClass, objectFitClass, {
|
|
27
|
+
'opacity-0': !imgSrc || imgLoading
|
|
28
|
+
}]"
|
|
29
|
+
>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script>
|
|
34
|
+
export const AspectRatioClassNames = {
|
|
35
|
+
"1/1": "aspect-square",
|
|
36
|
+
"square": "aspect-square",
|
|
37
|
+
"2/3": "aspect-poster",
|
|
38
|
+
"poster": "aspect-poster",
|
|
39
|
+
"4/5": "aspect-tall",
|
|
40
|
+
"16/9": "aspect-video",
|
|
41
|
+
"video": "aspect-video"
|
|
42
|
+
};
|
|
43
|
+
export const ObjectFitClassNames = {
|
|
44
|
+
cover: "object-cover",
|
|
45
|
+
outside: "object-cover",
|
|
46
|
+
contain: "object-contain",
|
|
47
|
+
inside: "object-contain"
|
|
48
|
+
};
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<script setup>
|
|
52
|
+
import { normalizeImageFileDescriptor } from "@resee-movies/utilities/images/normalize-image-file-descriptor";
|
|
53
|
+
import { getAspectRatio } from "@resee-movies/utilities/numbers/get-aspect-ratio";
|
|
54
|
+
import { fromTmdbImageSize } from "@resee-movies/utilities/tmdb/from-tmdb-image-size";
|
|
55
|
+
import { computed, ref } from "vue";
|
|
56
|
+
import { useLoadImage } from "../composables/use-load-image";
|
|
57
|
+
import { useSharedIntersectionObserver } from "../composables/use-shared-intersection-observer";
|
|
58
|
+
import Icon from "./Icon.vue";
|
|
59
|
+
const props = defineProps({
|
|
60
|
+
src: { type: null, required: true },
|
|
61
|
+
alt: { type: [String, null, Function], required: false, default: "" },
|
|
62
|
+
type: { type: String, required: false, default: void 0 },
|
|
63
|
+
width: { type: null, required: false, default: "w185" },
|
|
64
|
+
height: { type: [String, Number], required: false, default: void 0 },
|
|
65
|
+
aspect: { type: String, required: false, default: void 0 },
|
|
66
|
+
fit: { type: String, required: false, default: "cover" },
|
|
67
|
+
showLoading: { type: Boolean, required: false, default: false },
|
|
68
|
+
defaultIcon: { type: String, required: false, default: "i-ph-image-thin" },
|
|
69
|
+
iconSize: { type: String, required: false, default: "xl" },
|
|
70
|
+
loading: { type: String, required: false, default: "lazy" },
|
|
71
|
+
glassy: { type: Boolean, required: false, default: false },
|
|
72
|
+
bordered: { type: Boolean, required: false, default: false },
|
|
73
|
+
beveled: { type: Boolean, required: false, default: false },
|
|
74
|
+
raised: { type: Boolean, required: false, default: false },
|
|
75
|
+
overlayClasses: { type: null, required: false, default: void 0 }
|
|
76
|
+
});
|
|
77
|
+
const deferLoad = ref(props.loading === "lazy");
|
|
78
|
+
const container = ref();
|
|
79
|
+
const normalizedSource = computed(() => {
|
|
80
|
+
const result = normalizeImageFileDescriptor(props.src);
|
|
81
|
+
if (props.type) {
|
|
82
|
+
result.sourceType = props.type;
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
});
|
|
86
|
+
const dimensions = computed(() => {
|
|
87
|
+
let intWidth = normalizedSource.value.width;
|
|
88
|
+
let intHeight = normalizedSource.value.height;
|
|
89
|
+
if (props.width || props.height) {
|
|
90
|
+
intWidth = fromTmdbImageSize(props.width);
|
|
91
|
+
intHeight = fromTmdbImageSize(props.height);
|
|
92
|
+
}
|
|
93
|
+
if (!props.aspect || props.aspect === "auto" || intWidth && intHeight) {
|
|
94
|
+
return { width: intWidth, height: intHeight };
|
|
95
|
+
}
|
|
96
|
+
if (intHeight) {
|
|
97
|
+
const aspect = getAspectRatio(intHeight, "y", props.aspect);
|
|
98
|
+
return { width: aspect.x, height: aspect.y };
|
|
99
|
+
}
|
|
100
|
+
if (intWidth) {
|
|
101
|
+
const aspect = getAspectRatio(intWidth, "x", props.aspect);
|
|
102
|
+
return { width: aspect.x, height: aspect.y };
|
|
103
|
+
}
|
|
104
|
+
return { width: void 0, height: void 0 };
|
|
105
|
+
});
|
|
106
|
+
const imgLoadInfo = useLoadImage(
|
|
107
|
+
() => normalizedSource.value.identifier,
|
|
108
|
+
{
|
|
109
|
+
deferLoad,
|
|
110
|
+
type: () => normalizedSource.value.sourceType,
|
|
111
|
+
width: () => props.width,
|
|
112
|
+
friendlyName: () => normalizedSource.value.friendlyName,
|
|
113
|
+
reseeConfig: () => ({
|
|
114
|
+
width: dimensions.value.width,
|
|
115
|
+
height: dimensions.value.height,
|
|
116
|
+
fit: props.fit
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
const {
|
|
121
|
+
src: imgSrc,
|
|
122
|
+
loading: imgLoading,
|
|
123
|
+
bgLoading: imgBgLoading,
|
|
124
|
+
error: imgError
|
|
125
|
+
} = imgLoadInfo;
|
|
126
|
+
if (deferLoad.value) {
|
|
127
|
+
useSharedIntersectionObserver(container, {
|
|
128
|
+
once: true,
|
|
129
|
+
onChange(isIntersecting) {
|
|
130
|
+
if (isIntersecting) {
|
|
131
|
+
deferLoad.value = false;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
const aspectRatioClass = computed(() => {
|
|
137
|
+
return !props.aspect || props.aspect === "auto" ? void 0 : AspectRatioClassNames[props.aspect];
|
|
138
|
+
});
|
|
139
|
+
const objectFitClass = computed(() => {
|
|
140
|
+
return !props.fit ? void 0 : ObjectFitClassNames[props.fit];
|
|
141
|
+
});
|
|
142
|
+
const altText = computed(() => {
|
|
143
|
+
return typeof props.alt === "function" ? props.alt(imgError.value) : props.alt ?? normalizedSource.value.description ?? "";
|
|
144
|
+
});
|
|
145
|
+
</script>
|
|
146
|
+
|
|
147
|
+
<style scoped>
|
|
148
|
+
@reference "tailwindcss";.image{background-color:#fff;overflow:clip;position:relative;width:-moz-max-content;width:max-content;@variant dark{background-color:#000}}.image.bordered{border:2px solid var(--color-global-background-accent)}.image.beveled{border-bottom-left-radius:var(--radius-xl);border-top-right-radius:var(--radius-xl)}.image.raised{box-shadow:var(--shadow-heavy)}.image.glass:after{background-image:linear-gradient(110deg,transparent 25%,hsla(0,0%,100%,.15) 80%,transparent);content:var(--zero-width-space);inset:0;position:absolute}.image .icon{color:var(--color-global-background-accent);left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%)}
|
|
149
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ImageFileDescriptor } from '@resee-movies/utilities/images/normalize-image-file-descriptor';
|
|
2
|
+
import type { AspectRatio } from '@resee-movies/utilities/numbers/get-aspect-ratio';
|
|
3
|
+
import type { MediaAssetTransformConfig } from '@resee-movies/utilities/resee/get-media-asset-url';
|
|
4
|
+
import type { TmdbImageSize } from '@resee-movies/utilities/tmdb/get-tmdb-image-url';
|
|
5
|
+
import type { LoadImageType } from '../composables/use-load-image.js';
|
|
6
|
+
import type { HTMLElementClassNames } from '../types/index.js';
|
|
7
|
+
import type { IconProps } from './Icon.vue.js';
|
|
8
|
+
export interface ImageProps {
|
|
9
|
+
src: ImageFileDescriptor | null | undefined;
|
|
10
|
+
alt?: string | null | ((error: unknown) => string);
|
|
11
|
+
type?: LoadImageType;
|
|
12
|
+
width?: TmdbImageSize | string | number;
|
|
13
|
+
height?: string | number;
|
|
14
|
+
aspect?: AspectRatio | 'auto';
|
|
15
|
+
fit?: MediaAssetTransformConfig['fit'];
|
|
16
|
+
showLoading?: boolean;
|
|
17
|
+
defaultIcon?: string;
|
|
18
|
+
iconSize?: IconProps['size'];
|
|
19
|
+
loading?: 'lazy' | 'eager';
|
|
20
|
+
glassy?: boolean;
|
|
21
|
+
bordered?: boolean;
|
|
22
|
+
beveled?: boolean;
|
|
23
|
+
raised?: boolean;
|
|
24
|
+
overlayClasses?: HTMLElementClassNames;
|
|
25
|
+
}
|
|
26
|
+
export declare const AspectRatioClassNames: {
|
|
27
|
+
readonly '1/1': "aspect-square";
|
|
28
|
+
readonly square: "aspect-square";
|
|
29
|
+
readonly '2/3': "aspect-poster";
|
|
30
|
+
readonly poster: "aspect-poster";
|
|
31
|
+
readonly '4/5': "aspect-tall";
|
|
32
|
+
readonly '16/9': "aspect-video";
|
|
33
|
+
readonly video: "aspect-video";
|
|
34
|
+
};
|
|
35
|
+
export declare const ObjectFitClassNames: {
|
|
36
|
+
readonly cover: "object-cover";
|
|
37
|
+
readonly outside: "object-cover";
|
|
38
|
+
readonly contain: "object-contain";
|
|
39
|
+
readonly inside: "object-contain";
|
|
40
|
+
};
|
|
41
|
+
declare const __VLS_export: import("vue").DefineComponent<ImageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ImageProps> & Readonly<{}>, {
|
|
42
|
+
type: LoadImageType;
|
|
43
|
+
loading: "lazy" | "eager";
|
|
44
|
+
iconSize: "sm" | "md" | "lg" | "xl";
|
|
45
|
+
bordered: boolean;
|
|
46
|
+
showLoading: boolean;
|
|
47
|
+
fit: "cover" | "contain" | "inside" | "outside";
|
|
48
|
+
width: TmdbImageSize | string | number;
|
|
49
|
+
height: string | number;
|
|
50
|
+
alt: string | null | ((error: unknown) => string);
|
|
51
|
+
aspect: AspectRatio | "auto";
|
|
52
|
+
defaultIcon: string;
|
|
53
|
+
glassy: boolean;
|
|
54
|
+
beveled: boolean;
|
|
55
|
+
raised: boolean;
|
|
56
|
+
overlayClasses: string | HTMLElementClassNames[] | Record<string, boolean> | null;
|
|
57
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
58
|
+
declare const _default: typeof __VLS_export;
|
|
59
|
+
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface LayoutPageColumn {
|
|
2
2
|
is?: string;
|
|
3
3
|
layout?: 'main' | 'vista';
|
|
4
|
-
}
|
|
5
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<
|
|
4
|
+
}
|
|
5
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LayoutPageColumn, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LayoutPageColumn> & Readonly<{}>, {
|
|
6
6
|
layout: "main" | "vista";
|
|
7
7
|
is: string;
|
|
8
8
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
package/dist/runtime/components/{UiLayoutPageContainer.vue.d.ts → LayoutPageContainer.vue.d.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { HintedString } from '../types/index.js';
|
|
2
|
-
export
|
|
2
|
+
export interface LayoutPageContainerProps {
|
|
3
3
|
is?: HintedString<'div' | 'main' | 'section' | 'article' | 'nav'>;
|
|
4
4
|
glassEffect?: boolean;
|
|
5
5
|
accentColor?: string;
|
|
6
|
-
}
|
|
7
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<
|
|
6
|
+
}
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LayoutPageContainerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LayoutPageContainerProps> & Readonly<{}>, {
|
|
8
8
|
is: HintedString<"div" | "main" | "section" | "article" | "nav">;
|
|
9
9
|
glassEffect: boolean;
|
|
10
10
|
accentColor: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<Button
|
|
3
3
|
:is = "LinkComponent"
|
|
4
4
|
:to = "props.to"
|
|
5
5
|
:variant = "props.variant"
|
|
@@ -8,15 +8,17 @@
|
|
|
8
8
|
:spacing = "props.spacing"
|
|
9
9
|
>
|
|
10
10
|
<slot />
|
|
11
|
-
</
|
|
11
|
+
</Button>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script>
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<script setup>
|
|
19
|
-
|
|
19
|
+
import { getReseeUxConstant } from "../config";
|
|
20
|
+
import Button from "./Button.vue";
|
|
21
|
+
const LinkComponent = getReseeUxConstant("UiLinkBaseComponent");
|
|
20
22
|
const props = defineProps({
|
|
21
23
|
to: { type: null, required: true },
|
|
22
24
|
external: { type: Boolean, required: false, default: false },
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { RouteLocationRaw } from 'vue-router';
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
2
|
+
import type { ButtonProps } from './Button.vue.js';
|
|
3
|
+
export interface LinkProps extends /* @vue-ignore */ Omit<ButtonProps, 'bordered' | 'variant' | 'spacing'> {
|
|
4
4
|
to: RouteLocationRaw;
|
|
5
5
|
external?: boolean;
|
|
6
6
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
|
7
7
|
underline?: boolean;
|
|
8
|
-
variant?:
|
|
9
|
-
spacing?:
|
|
10
|
-
}
|
|
11
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<
|
|
8
|
+
variant?: ButtonProps['variant'];
|
|
9
|
+
spacing?: ButtonProps['spacing'];
|
|
10
|
+
}
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LinkProps> & Readonly<{}>, {
|
|
12
12
|
target: "_blank" | "_parent" | "_self" | "_top";
|
|
13
13
|
spacing: "wide" | "normal";
|
|
14
|
-
variant: "
|
|
14
|
+
variant: "btn" | "a";
|
|
15
15
|
external: boolean;
|
|
16
16
|
underline: boolean;
|
|
17
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IconProps } from './Icon.vue.js';
|
|
2
|
+
export interface LoadingIndicatorProps {
|
|
3
|
+
size?: IconProps['size'];
|
|
4
|
+
}
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<LoadingIndicatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LoadingIndicatorProps> & Readonly<{}>, {
|
|
6
|
+
size: "sm" | "md" | "lg" | "xl";
|
|
7
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export interface LoremProps {
|
|
2
2
|
type?: 'words' | 'sentences' | 'paragraphs';
|
|
3
3
|
min?: string | number;
|
|
4
4
|
max?: string | number;
|
|
@@ -8,8 +8,8 @@ type __VLS_Props = {
|
|
|
8
8
|
maxSentenceCount?: string | number;
|
|
9
9
|
minWordCount?: string | number;
|
|
10
10
|
maxWordCount?: string | number;
|
|
11
|
-
}
|
|
12
|
-
declare const __VLS_export: import("vue").DefineComponent<
|
|
11
|
+
}
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<LoremProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LoremProps> & Readonly<{}>, {
|
|
13
13
|
type: "words" | "sentences" | "paragraphs";
|
|
14
14
|
min: string | number;
|
|
15
15
|
max: string | number;
|
|
@@ -11,6 +11,7 @@ import { computed } from "vue";
|
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<script setup>
|
|
14
|
+
import PrimeMessage from "primevue/message";
|
|
14
15
|
const props = defineProps({
|
|
15
16
|
severity: { type: String, required: false },
|
|
16
17
|
text: { type: String, required: false },
|
|
@@ -34,7 +35,7 @@ const passthroughProps = computed(() => {
|
|
|
34
35
|
class: "close"
|
|
35
36
|
},
|
|
36
37
|
transition: {
|
|
37
|
-
name: "
|
|
38
|
+
name: "grow-y",
|
|
38
39
|
appear: false
|
|
39
40
|
}
|
|
40
41
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { StatusLevel } from '../types/index.js';
|
|
2
|
-
export
|
|
2
|
+
export interface MessageProps {
|
|
3
3
|
severity?: StatusLevel;
|
|
4
4
|
text?: string;
|
|
5
5
|
class?: string;
|
|
6
6
|
style?: string;
|
|
7
7
|
accented?: boolean;
|
|
8
|
-
}
|
|
9
|
-
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<
|
|
8
|
+
}
|
|
9
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<MessageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MessageProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
10
10
|
default?: (props: {}) => any;
|
|
11
11
|
}>;
|
|
12
12
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -8,8 +8,13 @@
|
|
|
8
8
|
/>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
|
+
<script>
|
|
12
|
+
|
|
13
|
+
</script>
|
|
14
|
+
|
|
11
15
|
<script setup>
|
|
12
16
|
import { computed } from "vue";
|
|
17
|
+
import PrimeProgressBar from "primevue/progressbar";
|
|
13
18
|
const props = defineProps({
|
|
14
19
|
value: { type: null, required: false, default: void 0 },
|
|
15
20
|
showValue: { type: Boolean, required: false, default: false },
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
export interface ProgressBarProps {
|
|
2
2
|
value?: number | undefined;
|
|
3
3
|
showValue?: boolean;
|
|
4
4
|
indeterminate?: boolean;
|
|
5
|
-
}
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<ProgressBarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ProgressBarProps> & Readonly<{}>, {
|
|
7
7
|
value: number;
|
|
8
8
|
showValue: boolean;
|
|
9
9
|
indeterminate: boolean;
|
|
@@ -7,13 +7,20 @@
|
|
|
7
7
|
props.size,
|
|
8
8
|
props.tooltip ? 'has-tooltip' : void 0
|
|
9
9
|
]"
|
|
10
|
-
v-
|
|
10
|
+
v-prime-tooltip.top="{ value: props.tooltip, showDelay: 500 }"
|
|
11
11
|
>
|
|
12
|
-
<
|
|
12
|
+
<IconTextPair :icon="props.icon" :text="props.text" />
|
|
13
13
|
</PrimeTag>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
|
+
<script>
|
|
17
|
+
|
|
18
|
+
</script>
|
|
19
|
+
|
|
16
20
|
<script setup>
|
|
21
|
+
import PrimeTag from "primevue/tag";
|
|
22
|
+
import vPrimeTooltip from "primevue/tooltip";
|
|
23
|
+
import IconTextPair from "./IconTextPair.vue";
|
|
17
24
|
const props = defineProps({
|
|
18
25
|
text: { type: String, required: false, default: void 0 },
|
|
19
26
|
icon: { type: String, required: false, default: void 0 },
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { StatusLevel } from '../types/index.js';
|
|
2
|
-
|
|
2
|
+
export interface TagProps {
|
|
3
3
|
text?: string;
|
|
4
4
|
icon?: string;
|
|
5
5
|
severity?: StatusLevel;
|
|
6
6
|
size?: 'sm' | 'md' | 'lg';
|
|
7
7
|
tooltip?: string;
|
|
8
|
-
}
|
|
9
|
-
declare const __VLS_export: import("vue").DefineComponent<
|
|
8
|
+
}
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<TagProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TagProps> & Readonly<{}>, {
|
|
10
10
|
size: "sm" | "md" | "lg";
|
|
11
11
|
icon: string;
|
|
12
12
|
text: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { NormalizedFileDescriptorSource } from '@resee-movies/utilities/images/normalize-image-file-descriptor';
|
|
2
|
+
import { type MediaAssetTransformConfig } from '@resee-movies/utilities/resee/get-media-asset-url';
|
|
3
|
+
import { type MaybeRefOrGetter, type Ref } from 'vue';
|
|
4
|
+
export type LoadImageType = NormalizedFileDescriptorSource;
|
|
5
|
+
export type LoadImageOptions = {
|
|
6
|
+
friendlyName?: MaybeRefOrGetter<string | undefined>;
|
|
7
|
+
placeholderSrc?: MaybeRefOrGetter<string>;
|
|
8
|
+
errorSrc?: MaybeRefOrGetter<string>;
|
|
9
|
+
width?: MaybeRefOrGetter<string | number>;
|
|
10
|
+
type?: MaybeRefOrGetter<LoadImageType>;
|
|
11
|
+
reseeConfig?: MaybeRefOrGetter<MediaAssetTransformConfig | undefined>;
|
|
12
|
+
deferLoad?: Ref<boolean>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Exposes the {@link loadImage} utility as a set of reactive properties.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useLoadImage(source: MaybeRefOrGetter<string | null | undefined>, config?: LoadImageOptions): {
|
|
18
|
+
src: Ref<string | undefined, string | undefined>;
|
|
19
|
+
key: Ref<string | undefined, string | undefined>;
|
|
20
|
+
error: Ref<unknown, unknown>;
|
|
21
|
+
loading: Ref<boolean, boolean>;
|
|
22
|
+
bgLoading: Ref<boolean, boolean>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { useNuxtApp } from "#imports";
|
|
2
|
+
import { loadImage } from "@resee-movies/utilities/dom/load-image";
|
|
3
|
+
import { getMediaAssetUrl } from "@resee-movies/utilities/resee/get-media-asset-url";
|
|
4
|
+
import { isString } from "@resee-movies/utilities/strings/is-string";
|
|
5
|
+
import { fromTmdbImageSize } from "@resee-movies/utilities/tmdb/from-tmdb-image-size";
|
|
6
|
+
import { getTmdbImageCache } from "@resee-movies/utilities/tmdb/get-tmdb-image-cache";
|
|
7
|
+
import { getTmdbImageUrl } from "@resee-movies/utilities/tmdb/get-tmdb-image-url";
|
|
8
|
+
import { toTmdbImageSize } from "@resee-movies/utilities/tmdb/to-tmdb-image-size";
|
|
9
|
+
import { ref, toRef, toValue, watch } from "vue";
|
|
10
|
+
export function useLoadImage(source, config = {}) {
|
|
11
|
+
const nuxtApp = useNuxtApp();
|
|
12
|
+
const src = ref();
|
|
13
|
+
const key = ref();
|
|
14
|
+
const error = ref();
|
|
15
|
+
const loading = ref(false);
|
|
16
|
+
const bgLoading = ref(false);
|
|
17
|
+
watch(
|
|
18
|
+
[
|
|
19
|
+
toRef(source),
|
|
20
|
+
toRef(config.friendlyName),
|
|
21
|
+
toRef(config.placeholderSrc),
|
|
22
|
+
toRef(config.errorSrc),
|
|
23
|
+
toRef(config.width),
|
|
24
|
+
toRef(config.reseeConfig),
|
|
25
|
+
toRef(config.type),
|
|
26
|
+
toRef(config.deferLoad)
|
|
27
|
+
],
|
|
28
|
+
() => {
|
|
29
|
+
const sourceUnwrapped = toValue(source);
|
|
30
|
+
if (!isString(sourceUnwrapped) || sourceUnwrapped.trim() === "") {
|
|
31
|
+
src.value = toValue(config.errorSrc);
|
|
32
|
+
key.value = src.value;
|
|
33
|
+
error.value = new Error('"src" is not defined');
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const loadType = toValue(config.type);
|
|
37
|
+
const imgWidth = toValue(config.width);
|
|
38
|
+
if (import.meta.server || nuxtApp.isHydrating) {
|
|
39
|
+
switch (loadType) {
|
|
40
|
+
case "tmdb": {
|
|
41
|
+
src.value = getTmdbImageUrl(sourceUnwrapped, imgWidth ? toTmdbImageSize(imgWidth) : void 0);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
case "resee": {
|
|
45
|
+
const filename = toValue(config.friendlyName);
|
|
46
|
+
const reseeConfig = toValue(config.reseeConfig);
|
|
47
|
+
const width = fromTmdbImageSize(imgWidth, { originalIsUndefined: true });
|
|
48
|
+
src.value = getMediaAssetUrl(sourceUnwrapped, filename, { width, format: "webp", ...reseeConfig });
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
default: {
|
|
52
|
+
src.value = sourceUnwrapped;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
key.value = sourceUnwrapped;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (toValue(config.deferLoad)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
let pendingSource;
|
|
62
|
+
let pendingLoader;
|
|
63
|
+
if (loadType === "tmdb") {
|
|
64
|
+
const result = getTmdbImageCache().getImage(sourceUnwrapped, imgWidth);
|
|
65
|
+
pendingSource = isString(result) ? void 0 : result.placeholderUrl;
|
|
66
|
+
pendingLoader = result;
|
|
67
|
+
} else if (loadType === "resee") {
|
|
68
|
+
const filename = toValue(config.friendlyName);
|
|
69
|
+
const reseeConfig = toValue(config.reseeConfig);
|
|
70
|
+
const width = fromTmdbImageSize(imgWidth, { originalIsUndefined: true });
|
|
71
|
+
pendingLoader = loadImage(
|
|
72
|
+
getMediaAssetUrl(sourceUnwrapped, filename, { width, format: "webp", ...reseeConfig })
|
|
73
|
+
);
|
|
74
|
+
} else {
|
|
75
|
+
pendingLoader = loadImage(sourceUnwrapped);
|
|
76
|
+
}
|
|
77
|
+
if (isString(pendingLoader)) {
|
|
78
|
+
src.value = pendingLoader;
|
|
79
|
+
key.value = sourceUnwrapped;
|
|
80
|
+
loading.value = false;
|
|
81
|
+
bgLoading.value = false;
|
|
82
|
+
error.value = void 0;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
src.value = pendingSource ?? toValue(config.placeholderSrc) ?? src.value;
|
|
86
|
+
key.value = pendingSource ? sourceUnwrapped : void 0;
|
|
87
|
+
loading.value = !pendingSource;
|
|
88
|
+
bgLoading.value = !!pendingSource;
|
|
89
|
+
pendingLoader.then(
|
|
90
|
+
(loadedSrc) => {
|
|
91
|
+
src.value = loadedSrc;
|
|
92
|
+
key.value = sourceUnwrapped;
|
|
93
|
+
loading.value = false;
|
|
94
|
+
bgLoading.value = false;
|
|
95
|
+
error.value = void 0;
|
|
96
|
+
},
|
|
97
|
+
(e) => {
|
|
98
|
+
src.value = toValue(config.errorSrc) ?? toValue(config.placeholderSrc);
|
|
99
|
+
key.value = src.value;
|
|
100
|
+
loading.value = false;
|
|
101
|
+
bgLoading.value = false;
|
|
102
|
+
error.value = e;
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
},
|
|
106
|
+
{ immediate: true }
|
|
107
|
+
);
|
|
108
|
+
return { src, key, error, loading, bgLoading };
|
|
109
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Runtime constants can be set once and then used throughout this package.
|
|
4
|
+
*/
|
|
5
|
+
export type ReseeUxRuntimeConstants = {
|
|
6
|
+
UiLinkBaseComponent: Component;
|
|
7
|
+
};
|
|
8
|
+
export type ConstantsKey = keyof ReseeUxRuntimeConstants;
|
|
9
|
+
export type ConstantsValue<K extends ConstantsKey> = ReseeUxRuntimeConstants[K];
|
|
10
|
+
/**
|
|
11
|
+
* Set one or more ReSee UX package global constants.
|
|
12
|
+
*/
|
|
13
|
+
export declare function setReseeUxConstant(values: Partial<ReseeUxRuntimeConstants>): void;
|
|
14
|
+
export declare function setReseeUxConstant<K extends ConstantsKey>(key: K, value: ConstantsValue<K>): void;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieve a ReSee UX package global constant.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getReseeUxConstant<K extends ConstantsKey>(key: K): ConstantsValue<K>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NuxtLink } from "#components";
|
|
2
|
+
import { isObjectLike } from "@resee-movies/utilities/objects/is-object-like";
|
|
3
|
+
const RuntimeConstants = {
|
|
4
|
+
UiLinkBaseComponent: NuxtLink
|
|
5
|
+
};
|
|
6
|
+
export function setReseeUxConstant(keyOrObject, valueOrUndef) {
|
|
7
|
+
if (isObjectLike(keyOrObject)) {
|
|
8
|
+
Object.assign(RuntimeConstants, keyOrObject);
|
|
9
|
+
} else if (valueOrUndef) {
|
|
10
|
+
RuntimeConstants[keyOrObject] = valueOrUndef;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function getReseeUxConstant(key) {
|
|
14
|
+
return RuntimeConstants[key];
|
|
15
|
+
}
|