rimelight-components 1.2.1 → 1.3.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.mjs +6 -0
- package/dist/runtime/components/{feedback/Feedback.d.vue.ts → swatches/ColorSwatch.d.vue.ts} +5 -4
- package/dist/runtime/components/swatches/ColorSwatch.vue +90 -0
- package/dist/runtime/components/{feedback/Feedback.vue.d.ts → swatches/ColorSwatch.vue.d.ts} +5 -4
- package/package.json +2 -2
- package/dist/runtime/components/feedback/Feedback.vue +0 -207
- package/dist/runtime/components/feedback/FeedbackChart.d.vue.ts +0 -18
- package/dist/runtime/components/feedback/FeedbackChart.vue +0 -604
- package/dist/runtime/components/feedback/FeedbackChart.vue.d.ts +0 -18
- package/dist/runtime/components/feedback/FeedbackDatePicker.d.vue.ts +0 -3
- package/dist/runtime/components/feedback/FeedbackDatePicker.vue +0 -149
- package/dist/runtime/components/feedback/FeedbackDatePicker.vue.d.ts +0 -3
- package/dist/runtime/components/feedback/FeedbackItem.d.vue.ts +0 -10
- package/dist/runtime/components/feedback/FeedbackItem.vue +0 -77
- package/dist/runtime/components/feedback/FeedbackItem.vue.d.ts +0 -10
- package/dist/runtime/components/feedback/FeedbackStatCard.d.vue.ts +0 -17
- package/dist/runtime/components/feedback/FeedbackStatCard.vue +0 -66
- package/dist/runtime/components/feedback/FeedbackStatCard.vue.d.ts +0 -17
- package/dist/runtime/composables/useFeedback.d.ts +0 -50
- package/dist/runtime/composables/useFeedback.js +0 -237
- package/dist/runtime/composables/useFeedbackExports.d.ts +0 -4
- package/dist/runtime/composables/useFeedbackExports.js +0 -150
- package/dist/runtime/types/index.d.ts +0 -14
package/dist/module.mjs
CHANGED
package/dist/runtime/components/{feedback/Feedback.d.vue.ts → swatches/ColorSwatch.d.vue.ts}
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
hex?: string;
|
|
3
|
+
rgb?: string;
|
|
4
|
+
hsl?: string;
|
|
5
|
+
oklch?: string;
|
|
6
|
+
cmyk?: string;
|
|
6
7
|
};
|
|
7
8
|
declare const __VLS_export: 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>;
|
|
8
9
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const { copy } = useClipboard();
|
|
3
|
+
const toast = useToast();
|
|
4
|
+
const { hex, rgb, hsl, oklch, cmyk } = defineProps({
|
|
5
|
+
hex: { type: String, required: false },
|
|
6
|
+
rgb: { type: String, required: false },
|
|
7
|
+
hsl: { type: String, required: false },
|
|
8
|
+
oklch: { type: String, required: false },
|
|
9
|
+
cmyk: { type: String, required: false }
|
|
10
|
+
});
|
|
11
|
+
const copyToClipboard = async (text) => {
|
|
12
|
+
try {
|
|
13
|
+
await copy(`${text}`);
|
|
14
|
+
toast.add({
|
|
15
|
+
title: `Color copied to clipboard!`,
|
|
16
|
+
description: text,
|
|
17
|
+
color: `success`
|
|
18
|
+
});
|
|
19
|
+
} catch {
|
|
20
|
+
toast.add({
|
|
21
|
+
title: `Failed to copy color to clipboard.`,
|
|
22
|
+
description: `An unexpected error occurred. Please try again.`,
|
|
23
|
+
color: `error`
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const color = computed(() => {
|
|
28
|
+
if (hex) return hex;
|
|
29
|
+
if (rgb) return rgb;
|
|
30
|
+
if (hsl) return hsl;
|
|
31
|
+
if (cmyk) return cmyk;
|
|
32
|
+
if (oklch) return oklch;
|
|
33
|
+
return "primary-500";
|
|
34
|
+
});
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<UCard>
|
|
39
|
+
<div class="flex flex-row gap-sm">
|
|
40
|
+
<div class="aspect-square size-64" :class="`bg-[${color}]`" />
|
|
41
|
+
<div class="flex flex-col justify-center gap-sm">
|
|
42
|
+
<UButton
|
|
43
|
+
v-if="hex"
|
|
44
|
+
variant="outline"
|
|
45
|
+
size="sm"
|
|
46
|
+
icon="lucide:copy"
|
|
47
|
+
label="Copy HEX"
|
|
48
|
+
class="w-32"
|
|
49
|
+
@click="copyToClipboard(hex)"
|
|
50
|
+
/>
|
|
51
|
+
<UButton
|
|
52
|
+
v-if="rgb"
|
|
53
|
+
variant="outline"
|
|
54
|
+
size="sm"
|
|
55
|
+
icon="lucide:copy"
|
|
56
|
+
label="Copy RGB"
|
|
57
|
+
class="w-32"
|
|
58
|
+
@click="copyToClipboard(rgb)"
|
|
59
|
+
/>
|
|
60
|
+
<UButton
|
|
61
|
+
v-if="hsl"
|
|
62
|
+
variant="outline"
|
|
63
|
+
size="sm"
|
|
64
|
+
icon="lucide:copy"
|
|
65
|
+
label="Copy HSL"
|
|
66
|
+
class="w-32"
|
|
67
|
+
@click="copyToClipboard(hsl)"
|
|
68
|
+
/>
|
|
69
|
+
<UButton
|
|
70
|
+
v-if="oklch"
|
|
71
|
+
variant="outline"
|
|
72
|
+
size="sm"
|
|
73
|
+
icon="lucide:copy"
|
|
74
|
+
label="Copy OKLCH"
|
|
75
|
+
class="w-32"
|
|
76
|
+
@click="copyToClipboard(oklch)"
|
|
77
|
+
/>
|
|
78
|
+
<UButton
|
|
79
|
+
v-if="cmyk"
|
|
80
|
+
variant="outline"
|
|
81
|
+
size="sm"
|
|
82
|
+
icon="lucide:copy"
|
|
83
|
+
label="Copy CMYK"
|
|
84
|
+
class="w-32"
|
|
85
|
+
@click="copyToClipboard(cmyk)"
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</UCard>
|
|
90
|
+
</template>
|
package/dist/runtime/components/{feedback/Feedback.vue.d.ts → swatches/ColorSwatch.vue.d.ts}
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
hex?: string;
|
|
3
|
+
rgb?: string;
|
|
4
|
+
hsl?: string;
|
|
5
|
+
oklch?: string;
|
|
6
|
+
cmyk?: string;
|
|
6
7
|
};
|
|
7
8
|
declare const __VLS_export: 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>;
|
|
8
9
|
declare const _default: typeof __VLS_export;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rimelight-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "My new Nuxt module",
|
|
5
5
|
"repository": "Rimelight Entertainment/rimelight-components",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"./runtime/*": "./dist/runtime/*",
|
|
14
14
|
"./components/*": "./dist/runtime/components/*",
|
|
15
15
|
"./composables/*": "./dist/runtime/composables/*",
|
|
16
|
-
"./types/*": "./dist/runtime/types/*",
|
|
17
16
|
"./utils/*": {
|
|
18
17
|
"types": "./dist/runtime/utils/*.d.ts",
|
|
19
18
|
"import": "./dist/runtime/utils/*.js"
|
|
@@ -50,6 +49,7 @@
|
|
|
50
49
|
"@nuxt/kit": "^4.1.3",
|
|
51
50
|
"@nuxt/ui": "^4.0.1",
|
|
52
51
|
"@vueuse/core": "^13.9.0",
|
|
52
|
+
"@vueuse/nuxt": "^13.9.0",
|
|
53
53
|
"date-fns": "^4.1.0",
|
|
54
54
|
"nuxt": "^4.1.3",
|
|
55
55
|
"tailwind-variants": "^3.1.1",
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { AnimatePresence, MotionConfig, motion } from "motion-v";
|
|
3
|
-
const {} = defineProps({
|
|
4
|
-
page: { type: Object, required: true }
|
|
5
|
-
});
|
|
6
|
-
const {
|
|
7
|
-
formState,
|
|
8
|
-
isExpanded,
|
|
9
|
-
isSubmitted,
|
|
10
|
-
isSubmitting,
|
|
11
|
-
handleRatingSelect,
|
|
12
|
-
submitFeedback
|
|
13
|
-
} = useFeedbackForm(props);
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<template>
|
|
17
|
-
<MotionConfig
|
|
18
|
-
:transition="{ type: 'spring', visualDuration: 0.25, bounce: 0 }"
|
|
19
|
-
>
|
|
20
|
-
<motion.div layout class="max-w-md rounded-lg">
|
|
21
|
-
<AnimatePresence mode="wait">
|
|
22
|
-
<!-- Success State -->
|
|
23
|
-
<motion.div
|
|
24
|
-
v-if="isSubmitted"
|
|
25
|
-
key="success"
|
|
26
|
-
:initial="{ opacity: 0, scale: 0.95 }"
|
|
27
|
-
:animate="{ opacity: 1, scale: 1 }"
|
|
28
|
-
:transition="{ duration: 0.3 }"
|
|
29
|
-
class="flex items-center gap-3 py-2"
|
|
30
|
-
role="status"
|
|
31
|
-
aria-live="polite"
|
|
32
|
-
aria-label="Feedback submitted successfully"
|
|
33
|
-
>
|
|
34
|
-
<motion.div
|
|
35
|
-
:initial="{ scale: 0 }"
|
|
36
|
-
:animate="{ scale: 1 }"
|
|
37
|
-
:transition="{ delay: 0.1, type: 'spring', visualDuration: 0.4 }"
|
|
38
|
-
class="text-xl"
|
|
39
|
-
aria-hidden="true"
|
|
40
|
-
>
|
|
41
|
-
✨
|
|
42
|
-
</motion.div>
|
|
43
|
-
<motion.div
|
|
44
|
-
:initial="{ opacity: 0, x: 10 }"
|
|
45
|
-
:animate="{ opacity: 1, x: 0 }"
|
|
46
|
-
:transition="{ delay: 0.2, duration: 0.3 }"
|
|
47
|
-
>
|
|
48
|
-
<div class="text-sm font-medium text-highlighted">
|
|
49
|
-
Thank you for your feedback!
|
|
50
|
-
</div>
|
|
51
|
-
<div class="mt-1 text-xs text-muted">
|
|
52
|
-
Your input helps us improve the documentation.
|
|
53
|
-
</div>
|
|
54
|
-
</motion.div>
|
|
55
|
-
</motion.div>
|
|
56
|
-
|
|
57
|
-
<motion.div v-else key="feedback">
|
|
58
|
-
<fieldset>
|
|
59
|
-
<motion.div layout class="flex items-center gap-3">
|
|
60
|
-
<motion.legend
|
|
61
|
-
id="feedback-legend"
|
|
62
|
-
layout
|
|
63
|
-
class="text-sm font-medium whitespace-nowrap text-highlighted"
|
|
64
|
-
>
|
|
65
|
-
Was this helpful?
|
|
66
|
-
</motion.legend>
|
|
67
|
-
|
|
68
|
-
<motion.div
|
|
69
|
-
layout
|
|
70
|
-
class="flex gap-2"
|
|
71
|
-
role="radiogroup"
|
|
72
|
-
aria-labelledby="feedback-legend"
|
|
73
|
-
>
|
|
74
|
-
<UButton
|
|
75
|
-
v-for="option in FEEDBACK_OPTIONS"
|
|
76
|
-
:key="option.value"
|
|
77
|
-
class="flex size-8 items-center justify-center rounded-lg border grayscale-80 transition-all duration-150 hover:grayscale-0 focus:outline-2 focus:outline-offset-2 focus:outline-primary"
|
|
78
|
-
:class="[
|
|
79
|
-
formState.rating === option.value ? 'border-primary bg-primary/20 grayscale-0 hover:bg-primary/30' : 'border-default bg-accented/20 hover:border-accented/70 hover:bg-accented/80'
|
|
80
|
-
]"
|
|
81
|
-
:aria-label="`Rate as ${option.label}`"
|
|
82
|
-
:aria-pressed="formState.rating === option.value"
|
|
83
|
-
role="radio"
|
|
84
|
-
:aria-checked="formState.rating === option.value"
|
|
85
|
-
@click="handleRatingSelect(option.value)"
|
|
86
|
-
>
|
|
87
|
-
<span class="text-lg">{{ option.emoji }}</span>
|
|
88
|
-
</UButton>
|
|
89
|
-
</motion.div>
|
|
90
|
-
</motion.div>
|
|
91
|
-
</fieldset>
|
|
92
|
-
|
|
93
|
-
<AnimatePresence>
|
|
94
|
-
<motion.div
|
|
95
|
-
v-if="isExpanded"
|
|
96
|
-
key="expanded-form"
|
|
97
|
-
:initial="{ opacity: 0, height: 0, marginTop: 0 }"
|
|
98
|
-
:animate="{ opacity: 1, height: 'auto', marginTop: 8 }"
|
|
99
|
-
:exit="{ opacity: 0, height: 0, marginTop: 0 }"
|
|
100
|
-
:transition="{ duration: 0.3, ease: 'easeInOut' }"
|
|
101
|
-
class="overflow-hidden"
|
|
102
|
-
role="region"
|
|
103
|
-
aria-label="Additional feedback form"
|
|
104
|
-
>
|
|
105
|
-
<motion.div
|
|
106
|
-
:initial="{ opacity: 0 }"
|
|
107
|
-
:animate="{ opacity: 1 }"
|
|
108
|
-
:transition="{ delay: 0.15, duration: 0.2 }"
|
|
109
|
-
class="space-y-1"
|
|
110
|
-
>
|
|
111
|
-
<UForm
|
|
112
|
-
:state="formState"
|
|
113
|
-
:schema="feedbackFormSchema"
|
|
114
|
-
@submit="submitFeedback"
|
|
115
|
-
>
|
|
116
|
-
<UFormField name="feedback">
|
|
117
|
-
<label for="feedback-textarea" class="sr-only">
|
|
118
|
-
Additional feedback (optional)
|
|
119
|
-
</label>
|
|
120
|
-
<UTextarea
|
|
121
|
-
id="feedback-textarea"
|
|
122
|
-
ref="textareaRef"
|
|
123
|
-
v-model="formState.feedback"
|
|
124
|
-
class="resize-vertical w-full rounded-xl text-sm leading-relaxed"
|
|
125
|
-
placeholder="Share your thoughts... (optional)"
|
|
126
|
-
:rows="4"
|
|
127
|
-
autoresize
|
|
128
|
-
aria-describedby="feedback-help"
|
|
129
|
-
/>
|
|
130
|
-
<div id="feedback-help" class="sr-only">
|
|
131
|
-
Provide additional details about your experience with this
|
|
132
|
-
page
|
|
133
|
-
</div>
|
|
134
|
-
</UFormField>
|
|
135
|
-
<div class="mt-2 flex items-center">
|
|
136
|
-
<div class="flex gap-2">
|
|
137
|
-
<UButton
|
|
138
|
-
size="sm"
|
|
139
|
-
:disabled="isSubmitting"
|
|
140
|
-
type="submit"
|
|
141
|
-
class="focus:outline-0"
|
|
142
|
-
:aria-label="
|
|
143
|
-
isSubmitting ? 'Sending feedback...' : 'Send feedback'
|
|
144
|
-
"
|
|
145
|
-
>
|
|
146
|
-
<motion.span
|
|
147
|
-
class="flex items-center"
|
|
148
|
-
:transition="{ duration: 0.2, ease: 'easeInOut' }"
|
|
149
|
-
>
|
|
150
|
-
<motion.div
|
|
151
|
-
:animate="{
|
|
152
|
-
width: isSubmitting ? '14px' : '0px',
|
|
153
|
-
marginRight: isSubmitting ? '6px' : '0px',
|
|
154
|
-
opacity: isSubmitting ? 1 : 0,
|
|
155
|
-
scale: isSubmitting ? 1 : 0,
|
|
156
|
-
rotate: isSubmitting ? 360 : 0
|
|
157
|
-
}"
|
|
158
|
-
:transition="{
|
|
159
|
-
width: { duration: 0.2, ease: 'easeInOut' },
|
|
160
|
-
marginRight: { duration: 0.2, ease: 'easeInOut' },
|
|
161
|
-
opacity: { duration: 0.2 },
|
|
162
|
-
scale: {
|
|
163
|
-
duration: 0.2,
|
|
164
|
-
type: 'spring',
|
|
165
|
-
bounce: 0.3
|
|
166
|
-
},
|
|
167
|
-
rotate: {
|
|
168
|
-
duration: 1,
|
|
169
|
-
ease: 'linear',
|
|
170
|
-
repeat: Infinity
|
|
171
|
-
}
|
|
172
|
-
}"
|
|
173
|
-
class="flex items-center justify-center overflow-hidden"
|
|
174
|
-
>
|
|
175
|
-
<Icon
|
|
176
|
-
name="mdi:loading"
|
|
177
|
-
class="size-3.5 shrink-0"
|
|
178
|
-
/>
|
|
179
|
-
</motion.div>
|
|
180
|
-
<motion.span
|
|
181
|
-
:animate="{
|
|
182
|
-
opacity: 1
|
|
183
|
-
}"
|
|
184
|
-
:transition="{ duration: 0.2, ease: 'easeInOut' }"
|
|
185
|
-
>
|
|
186
|
-
{{ isSubmitting ? "Sending..." : "Send" }}
|
|
187
|
-
</motion.span>
|
|
188
|
-
</motion.span>
|
|
189
|
-
</UButton>
|
|
190
|
-
</div>
|
|
191
|
-
</div>
|
|
192
|
-
</UForm>
|
|
193
|
-
</motion.div>
|
|
194
|
-
</motion.div>
|
|
195
|
-
</AnimatePresence>
|
|
196
|
-
</motion.div>
|
|
197
|
-
</AnimatePresence>
|
|
198
|
-
|
|
199
|
-
<div aria-live="polite" class="sr-only">
|
|
200
|
-
<span v-if="isSubmitting">Sending your feedback...</span>
|
|
201
|
-
<span v-else-if="isExpanded && formState.rating">
|
|
202
|
-
Feedback form expanded. You can now add additional comments.
|
|
203
|
-
</span>
|
|
204
|
-
</div>
|
|
205
|
-
</motion.div>
|
|
206
|
-
</MotionConfig>
|
|
207
|
-
</template>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
type PageAnalytic = {
|
|
2
|
-
path: string;
|
|
3
|
-
total: number;
|
|
4
|
-
positive: number;
|
|
5
|
-
negative: number;
|
|
6
|
-
averageScore: number;
|
|
7
|
-
positivePercentage: number;
|
|
8
|
-
feedback: any[];
|
|
9
|
-
lastFeedback: any;
|
|
10
|
-
createdAt: Date;
|
|
11
|
-
updatedAt: Date;
|
|
12
|
-
};
|
|
13
|
-
type __VLS_Props = {
|
|
14
|
-
pageAnalytics: PageAnalytic[];
|
|
15
|
-
};
|
|
16
|
-
declare const __VLS_export: 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>;
|
|
17
|
-
declare const _default: typeof __VLS_export;
|
|
18
|
-
export default _default;
|