@kungal/ui-core 2.43.0 → 2.44.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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @kungal/ui-core
2
2
 
3
+ ## 2.44.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7cd484e: KunAvatar draws avatar frames. `KunUser` gains an optional `avatarDecoration: { src, animatedSrc? }`, and any avatar whose user carries one gets the frame around it — `KunUserChip` included, with no change at the call site. The asset is a square canvas 1.2× the avatar with the avatar circle centred, the geometry Discord's decorations and Steam's avatar frames use; the frame hangs 10% outside the avatar on every side as an absolutely positioned, `pointer-events: none`, `aria-hidden` overlay, so it moves no layout and never takes the avatar link's click.
8
+
9
+ The new `decoration` prop decides when the animated asset plays: `hover` (the default) shows the still frame and plays the animation while the avatar is hovered or focused, `always` plays it continuously, `static` never animates, and `none` hides the frame. Frames are not drawn below the `md` size, where they are illegible, and `KunAvatarGroup` never draws them — its 4px gap cannot hold two frames overhanging by 10%. A reader who asked for reduced motion always gets the still image, through a native `<picture>` `<source media="(prefers-reduced-motion: reduce)">`, so it is right in the server-rendered HTML with no script.
10
+
11
+ Nothing changes for a user without `avatarDecoration`: no extra element, no inline style.
12
+
3
13
  ## 2.43.0
4
14
 
5
15
  ### Minor Changes
package/dist/index.d.cts CHANGED
@@ -151,6 +151,20 @@ interface KunUser {
151
151
  id: number;
152
152
  name: string;
153
153
  avatar: string;
154
+ /**
155
+ * An avatar frame drawn around the avatar (NextMoe `cosmetics.avatar_frame`).
156
+ * Absent or null → no frame.
157
+ */
158
+ avatarDecoration?: KunAvatarDecoration | null;
159
+ }
160
+ /**
161
+ * A frame asset on a square canvas 1.2× the avatar, the avatar circle centred
162
+ * in it. `src` is the still image; `animatedSrc`, when present, is played on
163
+ * hover or always, depending on KunAvatar's `decoration`.
164
+ */
165
+ interface KunAvatarDecoration {
166
+ src: string;
167
+ animatedSrc?: string;
154
168
  }
155
169
 
156
170
  interface KunIconData {
@@ -163,4 +177,4 @@ declare const registerKunIcons: (icons: Record<string, KunIconData>) => void;
163
177
  declare const getKunIcon: (name: string) => KunIconData | undefined;
164
178
  declare const hasKunIcon: (name: string) => boolean;
165
179
 
166
- export { KUN_AVATAR_FALLBACK, KUN_CATALOG_ZH_CN, KUN_DEFAULT_ROUNDED, KUN_SHATTER_PHYSICS, KUN_SWIPE_DISMISS_PHYSICS, type KunIconData, KunMessageCatalog, KunMessagePath, KunMessages, type KunSelectionSize, type KunUIColor, type KunUIRounded, type KunUISize, type KunUIVariant, type KunUser, cn, decodeIfEncoded, getKunIcon, getRandomSticker, hasKunIcon, kunBgClasses, kunBorderClasses, kunChipSizeClasses, kunControlSizeClasses, kunControlSquareClasses, kunFocusRingClasses, kunFocusRingWithinClasses, kunPanelRoundedClass, kunRingClasses, kunRoundedClasses, kunSelectionSizeClasses, kunSoftBgClasses, kunSolidBgClasses, kunSolidClasses, kunSolidFgClasses, kunTextClasses, kunVariantClasses, pickAvatarFallback, randomNum, registerKunIcon, registerKunIcons, resolveRounded, translateKunMessage };
180
+ export { KUN_AVATAR_FALLBACK, KUN_CATALOG_ZH_CN, KUN_DEFAULT_ROUNDED, KUN_SHATTER_PHYSICS, KUN_SWIPE_DISMISS_PHYSICS, type KunAvatarDecoration, type KunIconData, KunMessageCatalog, KunMessagePath, KunMessages, type KunSelectionSize, type KunUIColor, type KunUIRounded, type KunUISize, type KunUIVariant, type KunUser, cn, decodeIfEncoded, getKunIcon, getRandomSticker, hasKunIcon, kunBgClasses, kunBorderClasses, kunChipSizeClasses, kunControlSizeClasses, kunControlSquareClasses, kunFocusRingClasses, kunFocusRingWithinClasses, kunPanelRoundedClass, kunRingClasses, kunRoundedClasses, kunSelectionSizeClasses, kunSoftBgClasses, kunSolidBgClasses, kunSolidClasses, kunSolidFgClasses, kunTextClasses, kunVariantClasses, pickAvatarFallback, randomNum, registerKunIcon, registerKunIcons, resolveRounded, translateKunMessage };
package/dist/index.d.ts CHANGED
@@ -151,6 +151,20 @@ interface KunUser {
151
151
  id: number;
152
152
  name: string;
153
153
  avatar: string;
154
+ /**
155
+ * An avatar frame drawn around the avatar (NextMoe `cosmetics.avatar_frame`).
156
+ * Absent or null → no frame.
157
+ */
158
+ avatarDecoration?: KunAvatarDecoration | null;
159
+ }
160
+ /**
161
+ * A frame asset on a square canvas 1.2× the avatar, the avatar circle centred
162
+ * in it. `src` is the still image; `animatedSrc`, when present, is played on
163
+ * hover or always, depending on KunAvatar's `decoration`.
164
+ */
165
+ interface KunAvatarDecoration {
166
+ src: string;
167
+ animatedSrc?: string;
154
168
  }
155
169
 
156
170
  interface KunIconData {
@@ -163,4 +177,4 @@ declare const registerKunIcons: (icons: Record<string, KunIconData>) => void;
163
177
  declare const getKunIcon: (name: string) => KunIconData | undefined;
164
178
  declare const hasKunIcon: (name: string) => boolean;
165
179
 
166
- export { KUN_AVATAR_FALLBACK, KUN_CATALOG_ZH_CN, KUN_DEFAULT_ROUNDED, KUN_SHATTER_PHYSICS, KUN_SWIPE_DISMISS_PHYSICS, type KunIconData, KunMessageCatalog, KunMessagePath, KunMessages, type KunSelectionSize, type KunUIColor, type KunUIRounded, type KunUISize, type KunUIVariant, type KunUser, cn, decodeIfEncoded, getKunIcon, getRandomSticker, hasKunIcon, kunBgClasses, kunBorderClasses, kunChipSizeClasses, kunControlSizeClasses, kunControlSquareClasses, kunFocusRingClasses, kunFocusRingWithinClasses, kunPanelRoundedClass, kunRingClasses, kunRoundedClasses, kunSelectionSizeClasses, kunSoftBgClasses, kunSolidBgClasses, kunSolidClasses, kunSolidFgClasses, kunTextClasses, kunVariantClasses, pickAvatarFallback, randomNum, registerKunIcon, registerKunIcons, resolveRounded, translateKunMessage };
180
+ export { KUN_AVATAR_FALLBACK, KUN_CATALOG_ZH_CN, KUN_DEFAULT_ROUNDED, KUN_SHATTER_PHYSICS, KUN_SWIPE_DISMISS_PHYSICS, type KunAvatarDecoration, type KunIconData, KunMessageCatalog, KunMessagePath, KunMessages, type KunSelectionSize, type KunUIColor, type KunUIRounded, type KunUISize, type KunUIVariant, type KunUser, cn, decodeIfEncoded, getKunIcon, getRandomSticker, hasKunIcon, kunBgClasses, kunBorderClasses, kunChipSizeClasses, kunControlSizeClasses, kunControlSquareClasses, kunFocusRingClasses, kunFocusRingWithinClasses, kunPanelRoundedClass, kunRingClasses, kunRoundedClasses, kunSelectionSizeClasses, kunSoftBgClasses, kunSolidBgClasses, kunSolidClasses, kunSolidFgClasses, kunTextClasses, kunVariantClasses, pickAvatarFallback, randomNum, registerKunIcon, registerKunIcons, resolveRounded, translateKunMessage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungal/ui-core",
3
- "version": "2.43.0",
3
+ "version": "2.44.0",
4
4
  "description": "KunUI framework-agnostic core — design types, cn(), variant matrix, radius system, utils. No Vue/React.",
5
5
  "type": "module",
6
6
  "keywords": [