@xsolla/xui-supporting-text 0.174.2 → 0.175.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.
Files changed (2) hide show
  1. package/README.md +53 -0
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,6 +1,59 @@
1
1
  # SupportingText
2
2
 
3
3
  A small, accessible text component for labels, helpers, descriptions, and error messages around form fields.
4
+ <!-- BEGIN:xui-mcp-instructions:supporting-text -->
5
+ Label is the short, descriptive caption that titles a form control — the text shown above an input, select, slider, or other control — telling the user what value is expected. It can include an optional info icon that reveals extra guidance on demand.
6
+
7
+ ### When to use
8
+
9
+ When you need to name a form control so users know what to enter or choose (above an input, select, slider, etc.)
10
+
11
+ When a control needs a persistent, always-visible name rather than a hint that disappears
12
+
13
+ When a field benefits from supplementary help, exposed through the optional info icon
14
+
15
+ ### When not to use
16
+
17
+ As a substitute for the placeholder inside a field — the label should stay visible and sit outside the control
18
+
19
+ For long instructions or help text — use helper / description text below the field instead
20
+ - As a heading for a whole section or page — use a Heading text instead
21
+ - For decorative or body text unrelated to a control — use plain Text instead
22
+
23
+ ### Content guidelines
24
+
25
+ Keep the label short and noun-based (*"Email"*, *"Country"*), and use consistent casing across all fields.
26
+
27
+ Describe what the field is, not the action the user takes.
28
+
29
+ Mark required or optional fields consistently across the product, and never by color alone.
30
+
31
+ Use Primary for the main, default field label and Tertiary for secondary or de-emphasized labels; apply Accent (Primary only) when a label needs extra emphasis.
32
+
33
+ Keep the label itself concise and move any longer explanation behind the info icon rather than into the label text.
34
+
35
+ ### Behaviour guidelines
36
+
37
+ Type — Primary is the strong default treatment; Tertiary is muted for secondary contexts. The Accent variant exists for Primary only, so a Tertiary label has no accent state.
38
+
39
+ Size — XL, L, M, S, and XS scale the label to match the control it titles and the surrounding density; pair the label size with its field consistently.
40
+
41
+ Info icon — reveals supplementary guidance on hover, focus, or click; keep it optional and only for genuinely helpful context, not essential instructions.
42
+
43
+ Association — the label must sit directly above or beside its control and stay visually tied to it even when the layout wraps or scrolls.
44
+
45
+ ### Accessibility
46
+
47
+ Programmatically associate the label with its control (e.g. for / id or by wrapping) so screen readers announce it when the field receives focus.
48
+
49
+ Clicking or tapping the label should move focus to — or activate — its associated control.
50
+
51
+ The info icon's content must be reachable and readable by keyboard and screen reader, not available on hover alone.
52
+
53
+ Ensure contrast meets minimums for every type and size, including the muted Tertiary treatment.
54
+
55
+ Never communicate required, optional, or error state through color alone — pair it with text or an icon.
56
+ <!-- END:xui-mcp-instructions:supporting-text -->
4
57
 
5
58
  ## Installation
6
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-supporting-text",
3
- "version": "0.174.2",
3
+ "version": "0.175.0",
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.174.2",
14
- "@xsolla/xui-icons": "0.174.2",
15
- "@xsolla/xui-primitives-core": "0.174.2"
13
+ "@xsolla/xui-core": "0.175.0",
14
+ "@xsolla/xui-icons": "0.175.0",
15
+ "@xsolla/xui-primitives-core": "0.175.0"
16
16
  },
17
17
  "peerDependencies": {
18
18
  "react": ">=16.8.0",