accomadesc 0.4.9 → 0.4.11

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>
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ rgbColor: string;
3
+ colorChanged: (rgbColor: string) => void;
4
+ };
5
+ declare const ColorPicker: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type ColorPicker = ReturnType<typeof ColorPicker>;
7
+ export default ColorPicker;
@@ -14,7 +14,9 @@
14
14
  filter?: string;
15
15
  } = $props();
16
16
 
17
- const icon = $derived(getIcon(iconName, color));
17
+ const icon = $derived.by(() => {
18
+ return getIcon(iconName, color);
19
+ });
18
20
  </script>
19
21
 
20
22
  <div
@@ -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}"`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accomadesc",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.test.*",