@marianmeres/stuic 2.1.15 → 2.1.16

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.
@@ -57,12 +57,12 @@
57
57
 
58
58
  let current = $derived(acp?.current!);
59
59
 
60
- let iconFn = $derived.by(() => {
61
- let out = current.iconFn;
60
+ let iconHtml = $derived.by(() => {
61
+ let fn = current.iconFn as any;
62
62
  if (current.iconFn === true) {
63
- out = defaultIcons[current.variant];
63
+ fn = defaultIcons[current.variant];
64
64
  }
65
- return out;
65
+ return fn?.();
66
66
  });
67
67
 
68
68
  let CmpButtonOk = $derived(current.CmpButtonOk ?? Button);
@@ -124,28 +124,24 @@
124
124
 
125
125
  <div class={twMerge("stuic-acp", _class, classProp)}>
126
126
  <div class={twMerge("wrap", _classWrap, classWrap)}>
127
- {#if typeof iconFn === "function"}
128
- {@const iconHtml = iconFn()}
129
- <!-- fn can return empty -->
130
- {#if iconHtml}
131
- <div
132
- class={twMerge(
133
- "icon-box",
134
- debug("outline-green-500"),
135
- _classIconBox,
136
- classIconBox
137
- )}
138
- >
139
- {@html iconFn()}
140
- </div>
141
- {/if}
127
+ {#if iconHtml}
128
+ <div
129
+ class={twMerge(
130
+ "icon-box",
131
+ debug("outline-green-500"),
132
+ _classIconBox,
133
+ classIconBox
134
+ )}
135
+ >
136
+ {@html iconHtml}
137
+ </div>
142
138
  {/if}
143
139
  <div class={twMerge("content-box", _classContentBox, classContentBox)}>
144
140
  <h1
145
141
  class={twMerge(
146
142
  "title",
147
143
  _classTitle,
148
- typeof iconFn === "function" && "pt-2",
144
+ typeof iconHtml === "function" && "pt-2",
149
145
  classTitle
150
146
  )}
151
147
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/stuic",
3
- "version": "2.1.15",
3
+ "version": "2.1.16",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",