@xsolla/xui-link 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 +37 -1
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -2,7 +2,43 @@
2
2
 
3
3
  An accessible inline link. Renders an `<a>` element with theme-aware colour, optional underline, and automatic security attributes for external targets.
4
4
  <!-- BEGIN:xui-mcp-instructions:link -->
5
- To provide navigation, encourage actions, offer additional information
5
+ An inline interactive text element that navigates the user to another location or triggers a related action. Renders as styled text with optional leading and trailing icons. Used inside body copy, lists, form helper text, and any context where navigation or a contextual action should blend with surrounding text rather than stand out as a button.
6
+
7
+ ### When to use
8
+ - For in-text navigation links — e.g. *"Read our [Privacy Policy]"*, *"See [all results]"*
9
+ - For contextual actions inside helper text, empty states, or notifications — e.g. *"[Resend code]"*, *"[Clear filters]"*, *"[Learn more]"*
10
+ - When the action is secondary and should not visually compete with a primary Button
11
+ - In breadcrumbs, footers, settings descriptions, and legal text where navigation is part of the prose
12
+
13
+ ### When not to use
14
+ - As a primary call-to-action — use a Button
15
+ - When the interaction triggers an operation (save, delete, submit) rather than navigating — use a Button or Flex button
16
+ - For standalone navigation items in a menu or sidebar — use a Navigation component
17
+ - When the link needs a container, padding, or icon-only format — use a Flex button
18
+
19
+ ### Content guidelines
20
+ - Descriptive text — link labels must make sense out of context. Screen readers often navigate by listing all links on a page. Labels like *"here"*, *"this"*, or *"more"* are meaningless in isolation.
21
+ - Action links — use an imperative verb phrase: *"Resend code"*, *"Clear filters"*, *"View all"*, *"Download report"*.
22
+ - Navigation links — use the destination name or a descriptive noun phrase: *"Privacy Policy"*, *"API reference"*, *"Account settings"*.
23
+ - Avoid punctuation — do not include trailing commas, periods, or colons inside the link text. Place punctuation outside the link: *"See our [FAQ]."* not *"See our [FAQ.]"*
24
+ - Capitalisation — use sentence case for action links (*"View all results"*). Use title case only for proper names and document titles (*"Terms of Service"*, *"Privacy Policy"*).
25
+
26
+ ### Behaviour guidelines
27
+ - Navigation vs action — use Link for navigation (opening a URL, switching routes) and for lightweight text-level actions (resend, clear, show more). For operations that change state on the server (delete, publish, submit), use a Button even if it is visually small.
28
+ - External links — when a link opens in a new tab, always add a Right icon (external link symbol ↗) and include target=*"_blank"* with rel=*"noopener noreferrer"*. Inform screen reader users by including visually hidden text: *"(opens in new tab)"*, or include it in the aria-label.
29
+ - Visited state — style :visited links distinctly in contexts where the browsing history is meaningful (documentation, article indexes). Do not override :visited styles in application UI where it adds no value.
30
+ - Disabled links — avoid disabled links. If an action is not available, either remove the link entirely or replace it with plain text. If a disabled link is unavoidable, use aria-disabled=*"true"* and tabindex=*"-1"* rather than the disabled attribute (which does not exist on <a> elements).
31
+ - Text length — keep link text concise and descriptive. A link labelled *"here"* or *"click here"* is meaningless out of context and inaccessible. The link text should describe the destination or action: *"View invoice #1042"*, *"Reset password"*, *"Download CSV"*.
32
+ - Underline — Link text must be distinguishable from surrounding non-link text by more than colour alone (WCAG 1.4.1). Use an underline, heavier weight, or other non-colour cue in addition to the palette colour.
33
+
34
+ ### Accessibility
35
+ - Link must be implemented as a native <a href=*"…"*> element — not a <div>, <span>, or <button> with a click handler. Native <a> elements are keyboard-focusable, announced as links by screen readers, and support right-click context menus.
36
+ - The link must have a descriptive accessible name. If the visible text is not descriptive enough (e.g. it reads *"here"* in context), add aria-label with a more descriptive label.
37
+ - External links must include aria-label or visually hidden text announcing that they open in a new tab: e.g. aria-label=*"API reference (opens in new tab)"*.
38
+ - The focus state must have a visible :focus-visible ring that meets WCAG 2.4.7 (Focus Visible). Do not suppress the browser's default focus ring without providing a custom replacement.
39
+ - Do not rely on colour alone to distinguish links from surrounding text (WCAG 1.4.1). Always use an underline or weight change in addition to the palette colour.
40
+ - Icon-enriched links where the icon is decorative must have aria-hidden=*"true"* on the icon element so screen readers do not announce icon names.
41
+ - Visited links in informational contexts (docs, knowledge base) should have a distinct :visited colour to help users track what they have already read.
6
42
  <!-- END:xui-mcp-instructions:link -->
7
43
 
8
44
  ## Installation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-link",
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,8 +10,8 @@
10
10
  "build:native": "PLATFORM=native tsup"
11
11
  },
12
12
  "dependencies": {
13
- "@xsolla/xui-core": "0.189.1",
14
- "@xsolla/xui-primitives-core": "0.189.1"
13
+ "@xsolla/xui-core": "0.189.3",
14
+ "@xsolla/xui-primitives-core": "0.189.3"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "react": ">=16.8.0"