@xsolla/xui-icons-brand 0.172.2 → 0.173.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/README.md +25 -4
- package/native/index.d.mts +4 -1
- package/native/index.d.ts +4 -1
- package/native/index.js +8 -0
- package/native/index.js.map +1 -1
- package/native/index.mjs +8 -0
- package/native/index.mjs.map +1 -1
- package/package.json +5 -3
- package/web/index.d.mts +4 -1
- package/web/index.d.ts +4 -1
- package/web/index.js +9 -0
- package/web/index.js.map +1 -1
- package/web/index.mjs +9 -0
- package/web/index.mjs.map +1 -1
package/README.md
CHANGED
|
@@ -29,7 +29,8 @@ Switch the visual treatment with `variant`:
|
|
|
29
29
|
|
|
30
30
|
```tsx
|
|
31
31
|
<Github variant="colored" /> {/* default */}
|
|
32
|
-
<Github variant="mono" />
|
|
32
|
+
<Github variant="mono" /> {/* uses theme.colors.content.primary */}
|
|
33
|
+
<Github variant="mono" color="#FF7A00" />
|
|
33
34
|
```
|
|
34
35
|
|
|
35
36
|
## API Reference
|
|
@@ -40,8 +41,11 @@ All brand icons accept the same props (`BrandIconProps`).
|
|
|
40
41
|
|
|
41
42
|
| Prop | Type | Default | Description |
|
|
42
43
|
| --- | --- | --- | --- |
|
|
43
|
-
| `variant` | `"colored" \| "mono"` | `"colored"` | Renders the colour or monochrome glyph. Mono
|
|
44
|
+
| `variant` | `"colored" \| "mono"` | `"colored"` | Renders the colour or monochrome glyph. Mono uses the active theme `content.primary` token by default. |
|
|
44
45
|
| `size` | `number` | `24` | Pixel size (square). |
|
|
46
|
+
| `color` | `string` | `theme.colors.content.primary` | Manual color override for the mono variant. |
|
|
47
|
+
| `themeMode` | `ThemeMode` | current design-system context | Optional theme mode override used to resolve the default mono color. |
|
|
48
|
+
| `themeProductContext` | `ProductContext` | current design-system context | Optional product context override used to resolve the default mono color. |
|
|
45
49
|
| `className` | `string` | — | CSS class on the wrapper. |
|
|
46
50
|
| `style` | `CSSProperties` | — | Inline styles. |
|
|
47
51
|
| `data-testid` | `string` | — | Test ID (web). |
|
|
@@ -49,7 +53,7 @@ All brand icons accept the same props (`BrandIconProps`).
|
|
|
49
53
|
| `aria-label` | `string` | — | Accessible label. When set, the icon is exposed as `role="img"`. |
|
|
50
54
|
| `aria-hidden` | `boolean` | `true` if no `aria-label` | Hide from assistive tech. |
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
Mono icons consume `ThemeOverrideProps` so their default color follows the same theme context as the rest of the UI kit. Colored icons keep their original brand fills.
|
|
53
57
|
|
|
54
58
|
### `<BaseIcon>`
|
|
55
59
|
|
|
@@ -100,7 +104,7 @@ export default function Variants() {
|
|
|
100
104
|
<Steam size={32} aria-label="Steam" />
|
|
101
105
|
<Twitch size={32} aria-label="Twitch" />
|
|
102
106
|
</div>
|
|
103
|
-
<div style={{ display: 'flex', gap: 16
|
|
107
|
+
<div style={{ display: 'flex', gap: 16 }}>
|
|
104
108
|
<Github size={32} variant="mono" aria-label="GitHub" />
|
|
105
109
|
<Discord size={32} variant="mono" aria-label="Discord" />
|
|
106
110
|
<Steam size={32} variant="mono" aria-label="Steam" />
|
|
@@ -111,6 +115,23 @@ export default function Variants() {
|
|
|
111
115
|
}
|
|
112
116
|
```
|
|
113
117
|
|
|
118
|
+
### Mono color override
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
import * as React from 'react';
|
|
122
|
+
import { Github, Discord, Steam } from '@xsolla/xui-icons-brand';
|
|
123
|
+
|
|
124
|
+
export default function MonoColorOverride() {
|
|
125
|
+
return (
|
|
126
|
+
<div style={{ display: 'flex', gap: 16 }}>
|
|
127
|
+
<Github size={32} variant="mono" color="#FF7A00" aria-label="GitHub" />
|
|
128
|
+
<Discord size={32} variant="mono" color="#5865F2" aria-label="Discord" />
|
|
129
|
+
<Steam size={32} variant="mono" color="#1B2838" aria-label="Steam" />
|
|
130
|
+
</div>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
114
135
|
### Social media links
|
|
115
136
|
|
|
116
137
|
```tsx
|
package/native/index.d.mts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
2
3
|
|
|
3
4
|
type IconVariant = "colored" | "mono";
|
|
4
|
-
interface BrandIconProps {
|
|
5
|
+
interface BrandIconProps extends ThemeOverrideProps {
|
|
5
6
|
/** Icon variant style. Default: 'colored' */
|
|
6
7
|
variant?: IconVariant;
|
|
7
8
|
/** Size in pixels. Default: 24 */
|
|
8
9
|
size?: number;
|
|
10
|
+
/** Icon color (only applies to mono variant). Default: theme content.primary */
|
|
11
|
+
color?: string;
|
|
9
12
|
/** Additional CSS class */
|
|
10
13
|
className?: string;
|
|
11
14
|
/** Inline styles */
|
package/native/index.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
2
3
|
|
|
3
4
|
type IconVariant = "colored" | "mono";
|
|
4
|
-
interface BrandIconProps {
|
|
5
|
+
interface BrandIconProps extends ThemeOverrideProps {
|
|
5
6
|
/** Icon variant style. Default: 'colored' */
|
|
6
7
|
variant?: IconVariant;
|
|
7
8
|
/** Size in pixels. Default: 24 */
|
|
8
9
|
size?: number;
|
|
10
|
+
/** Icon color (only applies to mono variant). Default: theme content.primary */
|
|
11
|
+
color?: string;
|
|
9
12
|
/** Additional CSS class */
|
|
10
13
|
className?: string;
|
|
11
14
|
/** Inline styles */
|
package/native/index.js
CHANGED
|
@@ -188,23 +188,31 @@ module.exports = __toCommonJS(index_exports);
|
|
|
188
188
|
|
|
189
189
|
// src/BaseIcon.native.tsx
|
|
190
190
|
var import_react_native_svg = require("react-native-svg");
|
|
191
|
+
var import_xui_core = require("@xsolla/xui-core");
|
|
191
192
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
192
193
|
var BaseIcon = ({
|
|
193
194
|
variant = "colored",
|
|
194
195
|
size = 24,
|
|
196
|
+
color,
|
|
197
|
+
themeMode,
|
|
198
|
+
themeProductContext,
|
|
195
199
|
coloredContent: coloredContent163,
|
|
196
200
|
monoContent: monoContent163,
|
|
197
201
|
style,
|
|
198
202
|
testID,
|
|
199
203
|
"aria-label": ariaLabel
|
|
200
204
|
}) => {
|
|
205
|
+
const { theme } = (0, import_xui_core.useResolvedTheme)({ themeMode, themeProductContext });
|
|
206
|
+
const themeContentPrimary = theme.colors.content.primary;
|
|
201
207
|
const svgContent = variant === "colored" ? coloredContent163 : monoContent163;
|
|
208
|
+
const resolvedColor = variant === "mono" ? color != null ? color : themeContentPrimary : "currentColor";
|
|
202
209
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
203
210
|
import_react_native_svg.SvgXml,
|
|
204
211
|
{
|
|
205
212
|
xml: svgContent,
|
|
206
213
|
width: size,
|
|
207
214
|
height: size,
|
|
215
|
+
color: resolvedColor,
|
|
208
216
|
style,
|
|
209
217
|
testID,
|
|
210
218
|
accessible: !!ariaLabel,
|