accomadesc 0.4.9 → 0.4.10
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.
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let {
|
|
3
|
+
rgbColor,
|
|
4
|
+
colorChanged = () => {},
|
|
5
|
+
}: {
|
|
6
|
+
rgbColor: string;
|
|
7
|
+
colorChanged: (rgbColor: string) => void;
|
|
8
|
+
} = $props();
|
|
9
|
+
|
|
10
|
+
const cChanged = (e: Event & { currentTarget: EventTarget & HTMLInputElement }) => {
|
|
11
|
+
rgbColor = e.currentTarget.value;
|
|
12
|
+
console.log(rgbColor);
|
|
13
|
+
colorChanged(rgbColor);
|
|
14
|
+
};
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="wrapper">
|
|
18
|
+
<input type="color" value={rgbColor} onchange={cChanged} />
|
|
19
|
+
>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<style>
|
|
23
|
+
.wrapper {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: 1rem;
|
|
27
|
+
}
|
|
28
|
+
</style>
|
package/dist/basic/Icon.svelte
CHANGED
package/dist/basic/icons.js
CHANGED
|
@@ -54,11 +54,7 @@ const categoryMap = {
|
|
|
54
54
|
tv: 'amenities',
|
|
55
55
|
wifi: 'amenities',
|
|
56
56
|
};
|
|
57
|
-
const iconCache = {};
|
|
58
57
|
export const getIcon = (name, color = 'black') => {
|
|
59
|
-
if (iconCache[name]) {
|
|
60
|
-
return iconCache[name];
|
|
61
|
-
}
|
|
62
58
|
const category = categoryMap[name];
|
|
63
59
|
if (!category || !iconCategories[category]) {
|
|
64
60
|
console.warn(`Icon "${name}" not found`);
|
|
@@ -68,7 +64,6 @@ export const getIcon = (name, color = 'black') => {
|
|
|
68
64
|
const iconSvg = categoryIcons?.[name];
|
|
69
65
|
if (iconSvg) {
|
|
70
66
|
const coloredIcon = iconSvg.replace(/\{color\}|{color}/g, color);
|
|
71
|
-
iconCache[name] = coloredIcon;
|
|
72
67
|
return coloredIcon;
|
|
73
68
|
}
|
|
74
69
|
console.warn(`Icon "${name}" not found in category "${category}"`);
|