@kungal/ui-core 2.42.3 → 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,23 @@
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
+
13
+ ## 2.43.0
14
+
15
+ ### Minor Changes
16
+
17
+ - 070a75a: **`KunImages.loadingImage` reaches the Flutter icon package.** `KunLoading`'s mascot has always been inlined in `@kungal/ui-vue` as `KUN_LOADING_IMAGE`, but the Flutter generator emitted only `nullImage` and `avatarFallback`, so `kun_ui_icons` carried two of the three bitmaps KunUI draws. A Flutter port of `KunLoading` therefore could not exist: the component's default form _is_ that image, and taking it as a required parameter instead would be a different component from the web's. The generator now decodes it alongside the other two — the same 500×333 WebP the web renders, bundled as a package asset, so nothing needs declaring in a consumer's own `pubspec.yaml`. Nothing changes for a web consumer.
18
+
19
+ **`KunProgress` no longer reports a range a screen reader cannot use.** `aria-valuenow` has always carried the _percentage_, while `aria-valuemax` carried `max` — so a bar of 60 out of 60 announced "100 out of 60" to assistive technology whenever `max` was not 100, and the ratio a screen reader computes from the two was wrong for every `max` but the default. The ceiling is `100` now, which is the range `aria-valuenow` was already being measured against, and it agrees with the percentage `showLabel` renders. `max` still scales the input; it simply is not the reported ceiling. No visual change, and no template change for a consumer.
20
+
3
21
  ## 2.42.3
4
22
 
5
23
  ## 2.42.2
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.42.3",
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": [