rimelight-components 1.2.1 → 1.3.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.
Files changed (23) hide show
  1. package/dist/module.mjs +6 -0
  2. package/dist/runtime/components/{feedback/Feedback.d.vue.ts → swatches/ColorSwatch.d.vue.ts} +5 -4
  3. package/dist/runtime/components/swatches/ColorSwatch.vue +91 -0
  4. package/dist/runtime/components/{feedback/Feedback.vue.d.ts → swatches/ColorSwatch.vue.d.ts} +5 -4
  5. package/package.json +2 -2
  6. package/dist/runtime/components/feedback/Feedback.vue +0 -207
  7. package/dist/runtime/components/feedback/FeedbackChart.d.vue.ts +0 -18
  8. package/dist/runtime/components/feedback/FeedbackChart.vue +0 -604
  9. package/dist/runtime/components/feedback/FeedbackChart.vue.d.ts +0 -18
  10. package/dist/runtime/components/feedback/FeedbackDatePicker.d.vue.ts +0 -3
  11. package/dist/runtime/components/feedback/FeedbackDatePicker.vue +0 -149
  12. package/dist/runtime/components/feedback/FeedbackDatePicker.vue.d.ts +0 -3
  13. package/dist/runtime/components/feedback/FeedbackItem.d.vue.ts +0 -10
  14. package/dist/runtime/components/feedback/FeedbackItem.vue +0 -77
  15. package/dist/runtime/components/feedback/FeedbackItem.vue.d.ts +0 -10
  16. package/dist/runtime/components/feedback/FeedbackStatCard.d.vue.ts +0 -17
  17. package/dist/runtime/components/feedback/FeedbackStatCard.vue +0 -66
  18. package/dist/runtime/components/feedback/FeedbackStatCard.vue.d.ts +0 -17
  19. package/dist/runtime/composables/useFeedback.d.ts +0 -50
  20. package/dist/runtime/composables/useFeedback.js +0 -237
  21. package/dist/runtime/composables/useFeedbackExports.d.ts +0 -4
  22. package/dist/runtime/composables/useFeedbackExports.js +0 -150
  23. package/dist/runtime/types/index.d.ts +0 -14
package/dist/module.mjs CHANGED
@@ -40,6 +40,12 @@ const module = defineNuxtModule({
40
40
  }
41
41
  }
42
42
  },
43
+ "@vueuse/nuxt": {
44
+ version: ">=13.9.0",
45
+ optional: false,
46
+ overrides: {},
47
+ defaults: {}
48
+ },
43
49
  "motion-v/nuxt": {
44
50
  version: ">=1.7.2",
45
51
  optional: false,
@@ -1,8 +1,9 @@
1
1
  type __VLS_Props = {
2
- page: {
3
- title: string;
4
- stem: string;
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,91 @@
1
+ <script setup>
2
+ import { useClipboard } from "@vueuse/core";
3
+ const { copy } = useClipboard();
4
+ const toast = useToast();
5
+ const { hex, rgb, hsl, oklch, cmyk } = defineProps({
6
+ hex: { type: String, required: false },
7
+ rgb: { type: String, required: false },
8
+ hsl: { type: String, required: false },
9
+ oklch: { type: String, required: false },
10
+ cmyk: { type: String, required: false }
11
+ });
12
+ const copyToClipboard = async (text) => {
13
+ try {
14
+ await copy(`${text}`);
15
+ toast.add({
16
+ title: `Color copied to clipboard!`,
17
+ description: text,
18
+ color: `success`
19
+ });
20
+ } catch {
21
+ toast.add({
22
+ title: `Failed to copy color to clipboard.`,
23
+ description: `An unexpected error occurred. Please try again.`,
24
+ color: `error`
25
+ });
26
+ }
27
+ };
28
+ const color = computed(() => {
29
+ if (hex) return hex;
30
+ if (rgb) return rgb;
31
+ if (hsl) return hsl;
32
+ if (cmyk) return cmyk;
33
+ if (oklch) return oklch;
34
+ return "primary-500";
35
+ });
36
+ </script>
37
+
38
+ <template>
39
+ <UCard>
40
+ <div class="flex flex-row gap-sm">
41
+ <div class="aspect-square size-64" :class="`bg-[${color}]`" />
42
+ <div class="flex flex-col justify-center gap-sm">
43
+ <UButton
44
+ v-if="hex"
45
+ variant="outline"
46
+ size="sm"
47
+ icon="lucide:copy"
48
+ label="Copy HEX"
49
+ class="w-32"
50
+ @click="copyToClipboard(hex)"
51
+ />
52
+ <UButton
53
+ v-if="rgb"
54
+ variant="outline"
55
+ size="sm"
56
+ icon="lucide:copy"
57
+ label="Copy RGB"
58
+ class="w-32"
59
+ @click="copyToClipboard(rgb)"
60
+ />
61
+ <UButton
62
+ v-if="hsl"
63
+ variant="outline"
64
+ size="sm"
65
+ icon="lucide:copy"
66
+ label="Copy HSL"
67
+ class="w-32"
68
+ @click="copyToClipboard(hsl)"
69
+ />
70
+ <UButton
71
+ v-if="oklch"
72
+ variant="outline"
73
+ size="sm"
74
+ icon="lucide:copy"
75
+ label="Copy OKLCH"
76
+ class="w-32"
77
+ @click="copyToClipboard(oklch)"
78
+ />
79
+ <UButton
80
+ v-if="cmyk"
81
+ variant="outline"
82
+ size="sm"
83
+ icon="lucide:copy"
84
+ label="Copy CMYK"
85
+ class="w-32"
86
+ @click="copyToClipboard(cmyk)"
87
+ />
88
+ </div>
89
+ </div>
90
+ </UCard>
91
+ </template>
@@ -1,8 +1,9 @@
1
1
  type __VLS_Props = {
2
- page: {
3
- title: string;
4
- stem: string;
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.2.1",
3
+ "version": "1.3.1",
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;