@xsolla/xui-icon-wrapper 0.189.1 → 0.189.3

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.
Files changed (2) hide show
  1. package/README.md +36 -1
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -2,7 +2,42 @@
2
2
 
3
3
  A cross-platform container that gives icons, labels, images, and avatars a consistent box, alignment, and shape. It resolves its dimensions and default background from the active theme.
4
4
  <!-- BEGIN:xui-mcp-instructions:icon-wrapper -->
5
- This is a universal container component used to display small visual elements in a consistent and scalable way. It ensures uniform sizing, alignment, and shapes across different types of content.
5
+ A square container with an optional background shape that holds a visual element — an icon, an image, a text label, an avatar, a brand logo, or custom content. Used wherever a visual identity element needs a consistent size, padding, and shape across different content types. Acts as a unifying frame for heterogeneous visual content in lists, cards, cells, and menus.
6
+
7
+ ### When to use
8
+ - In lists, menus, table cells, and cards where different rows may contain icons, images, logos, or avatars — IconWrapper ensures they all occupy the same visual footprint
9
+ - To give a system icon a coloured or shaped background (e.g. a category icon with a tinted pill or circle)
10
+ - In ContextMenuCell left slots, Cell master slots, and AvatarGroup overflow chips where a contained visual element is expected
11
+ - When a brand logo or product image needs a neutral background container for visual consistency with surrounding icons
12
+ - As a slot in any component that accepts a *"visual identifier"* — the type of the visual can vary, but the size is always the same
13
+
14
+ ### When not to use
15
+ - As an interactive button — use Icon button instead
16
+ - When the shape or background is not needed and the icon can stand alone — use the icon directly
17
+ - As a decorative element with no semantic relationship to the content — prefer inline SVG or CSS background
18
+
19
+ ### Content guidelines
20
+ - Icon type — choose icons that are immediately recognisable for the category or entity they represent. Avoid abstract decorative icons. If no suitable icon exists, use Type=Label with initials as a fallback.
21
+ - Label type — limit label text to 1–2 characters. Use uppercase initials: *"JD"* for John Doe, *"PM"* for Product Management. Never use full words — they will overflow or be illegible at small sizes.
22
+ - Brand Logo type — use the official logo asset at the correct resolution. Provide a 2× asset for high-DPI screens. Ensure the logo has sufficient padding inside the container so it does not feel cramped — if the logo bleeds to the edges, switch to Shape=None or increase the container size.
23
+ - Alt text — for Type=Image and Type=Brand Logo, always provide descriptive alt text on the underlying <img> element. For Type=Icon and Type=Label where the content is decorative (the surrounding list item label already identifies the entity), use aria-hidden=*"true"* on the icon or label element.
24
+
25
+ ### Behaviour guidelines
26
+ - Non-interactive — IconWrapper is a display component. It has no interactive states (Hover, Press, Focus, Active). If the content it represents must be clickable, wrap it in an Icon button or a Cell master with an interactive container.
27
+ - Consistent size per group — always use the same Size for all IconWrapper instances within one list, table, or card grid. The visual alignment of the group depends on all items sharing the same square footprint.
28
+ - Shape per content type — apply Shape=Full (circle) for person-related content (avatars, user icons). Apply Shape=Smooth (rounded square) for product, app, and category icons. Apply Shape=None when the visual element defines its own shape.
29
+ - Background colour — the background fill of Shape=Full and Shape=Smooth is controlled by a design token, not a prop. Apply colour through CSS tokens or class variants at the product level — e.g. a tinted background for a category icon.
30
+ - Image fitting — Type=Image should use object-fit: cover to fill the container without distortion. Apply object-position: center by default; adjust for content that has important detail near the edges.
31
+ - Fallback for missing content — when Type=Image and the image fails to load, fall back to Type=Icon with a placeholder icon rather than showing a broken image. Handle this at the product level.
32
+
33
+ ### Accessibility
34
+ - IconWrapper itself is a presentational container — it must not have role=*"img"* or other landmark roles unless the entire component (wrapper + content) represents a standalone image with no surrounding label.
35
+ - Type=Icon: if the icon is purely decorative (the row label next to it already conveys the meaning), set aria-hidden=*"true"* on the SVG. If the icon carries meaning not communicated elsewhere, add aria-label to the SVG or the wrapper.
36
+ - Type=Image: the <img> inside must have alt text. If the image is decorative (the entity is named in the adjacent label), use alt="".
37
+ - Type=Brand Logo: the <img> must have alt text with the brand name — e.g. alt=*"Visa"*, alt=*"PayPal"*. Do not use alt="" for brand logos — they are meaningful identifiers.
38
+ - Type=Label: the text inside is rendered content. If the label is an abbreviation (initials), add aria-label on the wrapper with the full name — e.g. aria-label=*"John Doe"*.
39
+ - Type=Avatar: the Avatar's own accessibility attributes apply. IconWrapper adds no additional ARIA overhead.
40
+ - Never use IconWrapper as the only interactive element — it has no role=*"button"* or focus handling. If interaction is needed, the parent component must handle it.
6
41
  <!-- END:xui-mcp-instructions:icon-wrapper -->
7
42
 
8
43
  ## Installation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-icon-wrapper",
3
- "version": "0.189.1",
3
+ "version": "0.189.3",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -10,9 +10,9 @@
10
10
  "build:native": "PLATFORM=native tsup"
11
11
  },
12
12
  "dependencies": {
13
- "@xsolla/xui-core": "0.189.1",
14
- "@xsolla/xui-icons": "0.189.1",
15
- "@xsolla/xui-primitives-core": "0.189.1"
13
+ "@xsolla/xui-core": "0.189.3",
14
+ "@xsolla/xui-icons": "0.189.3",
15
+ "@xsolla/xui-primitives-core": "0.189.3"
16
16
  },
17
17
  "peerDependencies": {
18
18
  "react": ">=16.8.0",