@xsolla/xui-link-web 0.64.0-pr56.1768348754
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/index.d.mts +52 -0
- package/index.d.ts +52 -0
- package/index.js +575 -0
- package/index.js.map +1 -0
- package/index.mjs +538 -0
- package/index.mjs.map +1 -0
- package/package.json +23 -0
package/index.d.mts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type LinkSize = "sm" | "md" | "lg";
|
|
4
|
+
interface LinkProps {
|
|
5
|
+
/**
|
|
6
|
+
* Property to specify the size of the link.
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size?: LinkSize;
|
|
10
|
+
/**
|
|
11
|
+
* The URL or path for the link.
|
|
12
|
+
*/
|
|
13
|
+
href?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Callback fired when the link is clicked.
|
|
16
|
+
*/
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the link is disabled.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the link should have an underline.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
underline?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The content of the link.
|
|
30
|
+
*/
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Target attribute for the link (e.g., "_blank", "_self").
|
|
34
|
+
*/
|
|
35
|
+
target?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Rel attribute for the link (e.g., "noopener noreferrer").
|
|
38
|
+
*/
|
|
39
|
+
rel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Custom color for the link text
|
|
42
|
+
*/
|
|
43
|
+
color?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Test ID for testing frameworks
|
|
46
|
+
*/
|
|
47
|
+
testID?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare const Link: React.FC<LinkProps>;
|
|
51
|
+
|
|
52
|
+
export { Link, type LinkProps, type LinkSize };
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type LinkSize = "sm" | "md" | "lg";
|
|
4
|
+
interface LinkProps {
|
|
5
|
+
/**
|
|
6
|
+
* Property to specify the size of the link.
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size?: LinkSize;
|
|
10
|
+
/**
|
|
11
|
+
* The URL or path for the link.
|
|
12
|
+
*/
|
|
13
|
+
href?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Callback fired when the link is clicked.
|
|
16
|
+
*/
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the link is disabled.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the link should have an underline.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
underline?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The content of the link.
|
|
30
|
+
*/
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Target attribute for the link (e.g., "_blank", "_self").
|
|
34
|
+
*/
|
|
35
|
+
target?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Rel attribute for the link (e.g., "noopener noreferrer").
|
|
38
|
+
*/
|
|
39
|
+
rel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Custom color for the link text
|
|
42
|
+
*/
|
|
43
|
+
color?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Test ID for testing frameworks
|
|
46
|
+
*/
|
|
47
|
+
testID?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare const Link: React.FC<LinkProps>;
|
|
51
|
+
|
|
52
|
+
export { Link, type LinkProps, type LinkSize };
|
package/index.js
ADDED
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.tsx
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
Link: () => Link
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
|
|
37
|
+
// ../primitives-web/src/Box.tsx
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var StyledBox = import_styled_components.default.div`
|
|
42
|
+
display: flex;
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
background-color: ${(props) => props.backgroundColor || "transparent"};
|
|
45
|
+
border-color: ${(props) => props.borderColor || "transparent"};
|
|
46
|
+
border-width: ${(props) => typeof props.borderWidth === "number" ? `${props.borderWidth}px` : props.borderWidth || 0};
|
|
47
|
+
|
|
48
|
+
${(props) => props.borderBottomWidth !== void 0 && `
|
|
49
|
+
border-bottom-width: ${typeof props.borderBottomWidth === "number" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};
|
|
50
|
+
border-bottom-color: ${props.borderBottomColor || props.borderColor || "transparent"};
|
|
51
|
+
border-bottom-style: solid;
|
|
52
|
+
`}
|
|
53
|
+
${(props) => props.borderTopWidth !== void 0 && `
|
|
54
|
+
border-top-width: ${typeof props.borderTopWidth === "number" ? `${props.borderTopWidth}px` : props.borderTopWidth};
|
|
55
|
+
border-top-color: ${props.borderTopColor || props.borderColor || "transparent"};
|
|
56
|
+
border-top-style: solid;
|
|
57
|
+
`}
|
|
58
|
+
${(props) => props.borderLeftWidth !== void 0 && `
|
|
59
|
+
border-left-width: ${typeof props.borderLeftWidth === "number" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};
|
|
60
|
+
border-left-color: ${props.borderLeftColor || props.borderColor || "transparent"};
|
|
61
|
+
border-left-style: solid;
|
|
62
|
+
`}
|
|
63
|
+
${(props) => props.borderRightWidth !== void 0 && `
|
|
64
|
+
border-right-width: ${typeof props.borderRightWidth === "number" ? `${props.borderRightWidth}px` : props.borderRightWidth};
|
|
65
|
+
border-right-color: ${props.borderRightColor || props.borderColor || "transparent"};
|
|
66
|
+
border-right-style: solid;
|
|
67
|
+
`}
|
|
68
|
+
|
|
69
|
+
border-style: ${(props) => props.borderStyle || (props.borderWidth || props.borderBottomWidth || props.borderTopWidth || props.borderLeftWidth || props.borderRightWidth ? "solid" : "none")};
|
|
70
|
+
border-radius: ${(props) => typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius || 0};
|
|
71
|
+
height: ${(props) => typeof props.height === "number" ? `${props.height}px` : props.height || "auto"};
|
|
72
|
+
width: ${(props) => typeof props.width === "number" ? `${props.width}px` : props.width || "auto"};
|
|
73
|
+
min-width: ${(props) => typeof props.minWidth === "number" ? `${props.minWidth}px` : props.minWidth || "auto"};
|
|
74
|
+
min-height: ${(props) => typeof props.minHeight === "number" ? `${props.minHeight}px` : props.minHeight || "auto"};
|
|
75
|
+
|
|
76
|
+
padding: ${(props) => typeof props.padding === "number" ? `${props.padding}px` : props.padding || 0};
|
|
77
|
+
${(props) => props.paddingHorizontal && `
|
|
78
|
+
padding-left: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
|
|
79
|
+
padding-right: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
|
|
80
|
+
`}
|
|
81
|
+
${(props) => props.paddingVertical && `
|
|
82
|
+
padding-top: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
|
|
83
|
+
padding-bottom: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
|
|
84
|
+
`}
|
|
85
|
+
${(props) => props.paddingTop !== void 0 && `padding-top: ${typeof props.paddingTop === "number" ? `${props.paddingTop}px` : props.paddingTop};`}
|
|
86
|
+
${(props) => props.paddingBottom !== void 0 && `padding-bottom: ${typeof props.paddingBottom === "number" ? `${props.paddingBottom}px` : props.paddingBottom};`}
|
|
87
|
+
${(props) => props.paddingLeft !== void 0 && `padding-left: ${typeof props.paddingLeft === "number" ? `${props.paddingLeft}px` : props.paddingLeft};`}
|
|
88
|
+
${(props) => props.paddingRight !== void 0 && `padding-right: ${typeof props.paddingRight === "number" ? `${props.paddingRight}px` : props.paddingRight};`}
|
|
89
|
+
|
|
90
|
+
margin: ${(props) => typeof props.margin === "number" ? `${props.margin}px` : props.margin || 0};
|
|
91
|
+
${(props) => props.marginTop !== void 0 && `margin-top: ${typeof props.marginTop === "number" ? `${props.marginTop}px` : props.marginTop};`}
|
|
92
|
+
${(props) => props.marginBottom !== void 0 && `margin-bottom: ${typeof props.marginBottom === "number" ? `${props.marginBottom}px` : props.marginBottom};`}
|
|
93
|
+
${(props) => props.marginLeft !== void 0 && `margin-left: ${typeof props.marginLeft === "number" ? `${props.marginLeft}px` : props.marginLeft};`}
|
|
94
|
+
${(props) => props.marginRight !== void 0 && `margin-right: ${typeof props.marginRight === "number" ? `${props.marginRight}px` : props.marginRight};`}
|
|
95
|
+
|
|
96
|
+
flex-direction: ${(props) => props.flexDirection || "column"};
|
|
97
|
+
flex-wrap: ${(props) => props.flexWrap || "nowrap"};
|
|
98
|
+
align-items: ${(props) => props.alignItems || "stretch"};
|
|
99
|
+
justify-content: ${(props) => props.justifyContent || "flex-start"};
|
|
100
|
+
cursor: ${(props) => props.cursor ? props.cursor : props.onClick || props.onPress ? "pointer" : "inherit"};
|
|
101
|
+
position: ${(props) => props.position || "static"};
|
|
102
|
+
top: ${(props) => typeof props.top === "number" ? `${props.top}px` : props.top};
|
|
103
|
+
bottom: ${(props) => typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom};
|
|
104
|
+
left: ${(props) => typeof props.left === "number" ? `${props.left}px` : props.left};
|
|
105
|
+
right: ${(props) => typeof props.right === "number" ? `${props.right}px` : props.right};
|
|
106
|
+
flex: ${(props) => props.flex};
|
|
107
|
+
flex-shrink: ${(props) => props.flexShrink ?? 1};
|
|
108
|
+
gap: ${(props) => typeof props.gap === "number" ? `${props.gap}px` : props.gap || 0};
|
|
109
|
+
align-self: ${(props) => props.alignSelf || "auto"};
|
|
110
|
+
overflow: ${(props) => props.overflow || "visible"};
|
|
111
|
+
overflow-x: ${(props) => props.overflowX || "visible"};
|
|
112
|
+
overflow-y: ${(props) => props.overflowY || "visible"};
|
|
113
|
+
z-index: ${(props) => props.zIndex};
|
|
114
|
+
opacity: ${(props) => props.disabled ? 0.5 : 1};
|
|
115
|
+
pointer-events: ${(props) => props.disabled ? "none" : "auto"};
|
|
116
|
+
|
|
117
|
+
&:hover {
|
|
118
|
+
${(props) => props.hoverStyle?.backgroundColor && `background-color: ${props.hoverStyle.backgroundColor};`}
|
|
119
|
+
${(props) => props.hoverStyle?.borderColor && `border-color: ${props.hoverStyle.borderColor};`}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&:active {
|
|
123
|
+
${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
|
|
124
|
+
}
|
|
125
|
+
`;
|
|
126
|
+
var Box = import_react.default.forwardRef(
|
|
127
|
+
({
|
|
128
|
+
children,
|
|
129
|
+
onPress,
|
|
130
|
+
onKeyDown,
|
|
131
|
+
onKeyUp,
|
|
132
|
+
role,
|
|
133
|
+
"aria-label": ariaLabel,
|
|
134
|
+
"aria-labelledby": ariaLabelledBy,
|
|
135
|
+
"aria-current": ariaCurrent,
|
|
136
|
+
"aria-disabled": ariaDisabled,
|
|
137
|
+
"aria-live": ariaLive,
|
|
138
|
+
"aria-busy": ariaBusy,
|
|
139
|
+
"aria-describedby": ariaDescribedBy,
|
|
140
|
+
"aria-expanded": ariaExpanded,
|
|
141
|
+
"aria-haspopup": ariaHasPopup,
|
|
142
|
+
"aria-pressed": ariaPressed,
|
|
143
|
+
"aria-controls": ariaControls,
|
|
144
|
+
tabIndex,
|
|
145
|
+
as,
|
|
146
|
+
src,
|
|
147
|
+
alt,
|
|
148
|
+
type,
|
|
149
|
+
disabled,
|
|
150
|
+
id,
|
|
151
|
+
...props
|
|
152
|
+
}, ref) => {
|
|
153
|
+
if (as === "img" && src) {
|
|
154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
155
|
+
"img",
|
|
156
|
+
{
|
|
157
|
+
src,
|
|
158
|
+
alt: alt || "",
|
|
159
|
+
style: {
|
|
160
|
+
display: "block",
|
|
161
|
+
objectFit: "cover",
|
|
162
|
+
width: typeof props.width === "number" ? `${props.width}px` : props.width,
|
|
163
|
+
height: typeof props.height === "number" ? `${props.height}px` : props.height,
|
|
164
|
+
borderRadius: typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius,
|
|
165
|
+
position: props.position,
|
|
166
|
+
top: typeof props.top === "number" ? `${props.top}px` : props.top,
|
|
167
|
+
left: typeof props.left === "number" ? `${props.left}px` : props.left,
|
|
168
|
+
right: typeof props.right === "number" ? `${props.right}px` : props.right,
|
|
169
|
+
bottom: typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
175
|
+
StyledBox,
|
|
176
|
+
{
|
|
177
|
+
ref,
|
|
178
|
+
as,
|
|
179
|
+
id,
|
|
180
|
+
type: as === "button" ? type || "button" : void 0,
|
|
181
|
+
disabled: as === "button" ? disabled : void 0,
|
|
182
|
+
onClick: onPress,
|
|
183
|
+
onKeyDown,
|
|
184
|
+
onKeyUp,
|
|
185
|
+
role,
|
|
186
|
+
"aria-label": ariaLabel,
|
|
187
|
+
"aria-labelledby": ariaLabelledBy,
|
|
188
|
+
"aria-current": ariaCurrent,
|
|
189
|
+
"aria-disabled": ariaDisabled,
|
|
190
|
+
"aria-busy": ariaBusy,
|
|
191
|
+
"aria-describedby": ariaDescribedBy,
|
|
192
|
+
"aria-expanded": ariaExpanded,
|
|
193
|
+
"aria-haspopup": ariaHasPopup,
|
|
194
|
+
"aria-pressed": ariaPressed,
|
|
195
|
+
"aria-controls": ariaControls,
|
|
196
|
+
"aria-live": ariaLive,
|
|
197
|
+
tabIndex: tabIndex !== void 0 ? tabIndex : void 0,
|
|
198
|
+
...props,
|
|
199
|
+
children
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
Box.displayName = "Box";
|
|
205
|
+
|
|
206
|
+
// ../primitives-web/src/Text.tsx
|
|
207
|
+
var import_styled_components2 = __toESM(require("styled-components"));
|
|
208
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
209
|
+
var StyledText = import_styled_components2.default.span`
|
|
210
|
+
color: ${(props) => props.color || "inherit"};
|
|
211
|
+
font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
|
|
212
|
+
font-weight: ${(props) => props.fontWeight || "normal"};
|
|
213
|
+
font-family: ${(props) => props.fontFamily || '"Pilat Wide Bold", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important'};
|
|
214
|
+
line-height: ${(props) => typeof props.lineHeight === "number" ? `${props.lineHeight}px` : props.lineHeight || "inherit"};
|
|
215
|
+
white-space: ${(props) => props.whiteSpace || "normal"};
|
|
216
|
+
text-align: ${(props) => props.textAlign || "inherit"};
|
|
217
|
+
text-decoration: ${(props) => props.textDecoration || "none"};
|
|
218
|
+
`;
|
|
219
|
+
var Text = ({
|
|
220
|
+
style,
|
|
221
|
+
className,
|
|
222
|
+
id,
|
|
223
|
+
role,
|
|
224
|
+
...props
|
|
225
|
+
}) => {
|
|
226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
227
|
+
StyledText,
|
|
228
|
+
{
|
|
229
|
+
...props,
|
|
230
|
+
style,
|
|
231
|
+
className,
|
|
232
|
+
id,
|
|
233
|
+
role
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
// ../primitives-web/src/Spinner.tsx
|
|
239
|
+
var import_styled_components3 = __toESM(require("styled-components"));
|
|
240
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
241
|
+
var rotate = import_styled_components3.keyframes`
|
|
242
|
+
from {
|
|
243
|
+
transform: rotate(0deg);
|
|
244
|
+
}
|
|
245
|
+
to {
|
|
246
|
+
transform: rotate(360deg);
|
|
247
|
+
}
|
|
248
|
+
`;
|
|
249
|
+
var StyledSpinner = import_styled_components3.default.div`
|
|
250
|
+
width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
|
|
251
|
+
height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
|
|
252
|
+
border: ${(props) => props.strokeWidth || 2}px solid
|
|
253
|
+
${(props) => props.color || "currentColor"};
|
|
254
|
+
border-bottom-color: transparent;
|
|
255
|
+
border-radius: 50%;
|
|
256
|
+
display: inline-block;
|
|
257
|
+
box-sizing: border-box;
|
|
258
|
+
animation: ${rotate} 1s linear infinite;
|
|
259
|
+
`;
|
|
260
|
+
var Spinner = ({
|
|
261
|
+
role = "status",
|
|
262
|
+
"aria-label": ariaLabel,
|
|
263
|
+
"aria-live": ariaLive = "polite",
|
|
264
|
+
"aria-describedby": ariaDescribedBy,
|
|
265
|
+
testID,
|
|
266
|
+
...props
|
|
267
|
+
}) => {
|
|
268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
269
|
+
StyledSpinner,
|
|
270
|
+
{
|
|
271
|
+
role,
|
|
272
|
+
"aria-label": ariaLabel,
|
|
273
|
+
"aria-live": ariaLive,
|
|
274
|
+
"aria-describedby": ariaDescribedBy,
|
|
275
|
+
"data-testid": testID,
|
|
276
|
+
...props
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
Spinner.displayName = "Spinner";
|
|
281
|
+
|
|
282
|
+
// ../primitives-web/src/Icon.tsx
|
|
283
|
+
var import_styled_components4 = __toESM(require("styled-components"));
|
|
284
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
285
|
+
var StyledIcon = import_styled_components4.default.div`
|
|
286
|
+
display: flex;
|
|
287
|
+
align-items: center;
|
|
288
|
+
justify-content: center;
|
|
289
|
+
width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
|
|
290
|
+
height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
|
|
291
|
+
color: ${(props) => props.color || "currentColor"};
|
|
292
|
+
|
|
293
|
+
svg {
|
|
294
|
+
width: 100%;
|
|
295
|
+
height: 100%;
|
|
296
|
+
fill: none;
|
|
297
|
+
stroke: currentColor;
|
|
298
|
+
}
|
|
299
|
+
`;
|
|
300
|
+
|
|
301
|
+
// ../primitives-web/src/Divider.tsx
|
|
302
|
+
var import_styled_components5 = __toESM(require("styled-components"));
|
|
303
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
304
|
+
var StyledDivider = import_styled_components5.default.div`
|
|
305
|
+
background-color: ${(props) => props.dashStroke ? "transparent" : props.color || "rgba(255, 255, 255, 0.15)"};
|
|
306
|
+
width: ${(props) => props.vertical ? typeof props.width === "number" ? `${props.width}px` : props.width || "1px" : "100%"};
|
|
307
|
+
height: ${(props) => props.vertical ? "100%" : typeof props.height === "number" ? `${props.height}px` : props.height || "1px"};
|
|
308
|
+
|
|
309
|
+
${(props) => props.dashStroke && `
|
|
310
|
+
border-style: dashed;
|
|
311
|
+
border-color: ${props.color || "rgba(255, 255, 255, 0.15)"};
|
|
312
|
+
border-width: 0;
|
|
313
|
+
${props.vertical ? `
|
|
314
|
+
border-left-width: ${typeof props.width === "number" ? `${props.width}px` : props.width || "1px"};
|
|
315
|
+
height: 100%;
|
|
316
|
+
` : `
|
|
317
|
+
border-top-width: ${typeof props.height === "number" ? `${props.height}px` : props.height || "1px"};
|
|
318
|
+
width: 100%;
|
|
319
|
+
`}
|
|
320
|
+
`}
|
|
321
|
+
`;
|
|
322
|
+
|
|
323
|
+
// ../primitives-web/src/Input.tsx
|
|
324
|
+
var import_react2 = require("react");
|
|
325
|
+
var import_styled_components6 = __toESM(require("styled-components"));
|
|
326
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
327
|
+
var StyledInput = import_styled_components6.default.input`
|
|
328
|
+
background: transparent;
|
|
329
|
+
border: none;
|
|
330
|
+
outline: none;
|
|
331
|
+
width: 100%;
|
|
332
|
+
height: 100%;
|
|
333
|
+
padding: 0;
|
|
334
|
+
margin: 0;
|
|
335
|
+
color: ${(props) => props.color || "inherit"};
|
|
336
|
+
font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
|
|
337
|
+
font-family: inherit;
|
|
338
|
+
text-align: inherit;
|
|
339
|
+
|
|
340
|
+
&::placeholder {
|
|
341
|
+
color: ${(props) => props.placeholderTextColor || "rgba(255, 255, 255, 0.5)"};
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
&:disabled {
|
|
345
|
+
cursor: not-allowed;
|
|
346
|
+
}
|
|
347
|
+
`;
|
|
348
|
+
var InputPrimitive = (0, import_react2.forwardRef)(
|
|
349
|
+
({
|
|
350
|
+
value,
|
|
351
|
+
placeholder,
|
|
352
|
+
onChange,
|
|
353
|
+
onChangeText,
|
|
354
|
+
onFocus,
|
|
355
|
+
onBlur,
|
|
356
|
+
onKeyDown,
|
|
357
|
+
disabled,
|
|
358
|
+
secureTextEntry,
|
|
359
|
+
style,
|
|
360
|
+
color,
|
|
361
|
+
fontSize,
|
|
362
|
+
placeholderTextColor,
|
|
363
|
+
maxLength,
|
|
364
|
+
name,
|
|
365
|
+
type,
|
|
366
|
+
inputMode,
|
|
367
|
+
autoComplete,
|
|
368
|
+
id,
|
|
369
|
+
"aria-invalid": ariaInvalid,
|
|
370
|
+
"aria-describedby": ariaDescribedBy,
|
|
371
|
+
"aria-labelledby": ariaLabelledBy,
|
|
372
|
+
"aria-label": ariaLabel,
|
|
373
|
+
"aria-disabled": ariaDisabled,
|
|
374
|
+
"data-testid": dataTestId,
|
|
375
|
+
...rest
|
|
376
|
+
}, ref) => {
|
|
377
|
+
const handleChange = (e) => {
|
|
378
|
+
if (onChange) {
|
|
379
|
+
onChange(e);
|
|
380
|
+
}
|
|
381
|
+
if (onChangeText) {
|
|
382
|
+
onChangeText(e.target.value);
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
const inputValue = value !== void 0 ? value : "";
|
|
386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
387
|
+
StyledInput,
|
|
388
|
+
{
|
|
389
|
+
ref,
|
|
390
|
+
id,
|
|
391
|
+
value: inputValue,
|
|
392
|
+
name,
|
|
393
|
+
placeholder,
|
|
394
|
+
onChange: handleChange,
|
|
395
|
+
onFocus,
|
|
396
|
+
onBlur,
|
|
397
|
+
onKeyDown,
|
|
398
|
+
disabled,
|
|
399
|
+
type: secureTextEntry ? "password" : type || "text",
|
|
400
|
+
inputMode,
|
|
401
|
+
autoComplete,
|
|
402
|
+
style,
|
|
403
|
+
color,
|
|
404
|
+
fontSize,
|
|
405
|
+
placeholderTextColor,
|
|
406
|
+
maxLength,
|
|
407
|
+
"aria-invalid": ariaInvalid,
|
|
408
|
+
"aria-describedby": ariaDescribedBy,
|
|
409
|
+
"aria-labelledby": ariaLabelledBy,
|
|
410
|
+
"aria-label": ariaLabel,
|
|
411
|
+
"aria-disabled": ariaDisabled,
|
|
412
|
+
"data-testid": dataTestId,
|
|
413
|
+
...rest
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
);
|
|
418
|
+
InputPrimitive.displayName = "InputPrimitive";
|
|
419
|
+
|
|
420
|
+
// ../primitives-web/src/TextArea.tsx
|
|
421
|
+
var import_react3 = require("react");
|
|
422
|
+
var import_styled_components7 = __toESM(require("styled-components"));
|
|
423
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
424
|
+
var StyledTextArea = import_styled_components7.default.textarea`
|
|
425
|
+
background: transparent;
|
|
426
|
+
border: none;
|
|
427
|
+
outline: none;
|
|
428
|
+
width: 100%;
|
|
429
|
+
height: 100%;
|
|
430
|
+
padding: 0;
|
|
431
|
+
margin: 0;
|
|
432
|
+
color: ${(props) => props.color || "inherit"};
|
|
433
|
+
font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
|
|
434
|
+
font-family: inherit;
|
|
435
|
+
text-align: inherit;
|
|
436
|
+
resize: none;
|
|
437
|
+
|
|
438
|
+
&::placeholder {
|
|
439
|
+
color: ${(props) => props.placeholderTextColor || "rgba(255, 255, 255, 0.5)"};
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
&:disabled {
|
|
443
|
+
cursor: not-allowed;
|
|
444
|
+
}
|
|
445
|
+
`;
|
|
446
|
+
var TextAreaPrimitive = (0, import_react3.forwardRef)(
|
|
447
|
+
({
|
|
448
|
+
value,
|
|
449
|
+
placeholder,
|
|
450
|
+
onChangeText,
|
|
451
|
+
onFocus,
|
|
452
|
+
onBlur,
|
|
453
|
+
onKeyDown,
|
|
454
|
+
disabled,
|
|
455
|
+
style,
|
|
456
|
+
color,
|
|
457
|
+
fontSize,
|
|
458
|
+
placeholderTextColor,
|
|
459
|
+
maxLength,
|
|
460
|
+
rows
|
|
461
|
+
}, ref) => {
|
|
462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
463
|
+
StyledTextArea,
|
|
464
|
+
{
|
|
465
|
+
ref,
|
|
466
|
+
value,
|
|
467
|
+
placeholder,
|
|
468
|
+
onChange: (e) => onChangeText?.(e.target.value),
|
|
469
|
+
onFocus,
|
|
470
|
+
onBlur,
|
|
471
|
+
onKeyDown,
|
|
472
|
+
disabled,
|
|
473
|
+
style,
|
|
474
|
+
color,
|
|
475
|
+
fontSize,
|
|
476
|
+
placeholderTextColor,
|
|
477
|
+
maxLength,
|
|
478
|
+
rows
|
|
479
|
+
}
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
TextAreaPrimitive.displayName = "TextAreaPrimitive";
|
|
484
|
+
|
|
485
|
+
// src/Link.tsx
|
|
486
|
+
var import_xui_core = require("@xsolla/xui-core");
|
|
487
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
488
|
+
var Link = ({
|
|
489
|
+
size = "md",
|
|
490
|
+
href,
|
|
491
|
+
onClick,
|
|
492
|
+
disabled = false,
|
|
493
|
+
underline = false,
|
|
494
|
+
children,
|
|
495
|
+
target,
|
|
496
|
+
rel,
|
|
497
|
+
color,
|
|
498
|
+
testID
|
|
499
|
+
}) => {
|
|
500
|
+
const { theme } = (0, import_xui_core.useDesignSystem)();
|
|
501
|
+
const fontSizeMap = {
|
|
502
|
+
sm: 12,
|
|
503
|
+
md: 14,
|
|
504
|
+
lg: 16
|
|
505
|
+
};
|
|
506
|
+
const handleClick = (e) => {
|
|
507
|
+
if (disabled) {
|
|
508
|
+
e.preventDefault?.();
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
if (onClick) {
|
|
512
|
+
e.preventDefault?.();
|
|
513
|
+
onClick();
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
const getRel = () => {
|
|
517
|
+
if (target === "_blank") {
|
|
518
|
+
const securityRel = "noopener noreferrer";
|
|
519
|
+
if (rel) {
|
|
520
|
+
const relParts = rel.split(/\s+/);
|
|
521
|
+
const securityParts = securityRel.split(/\s+/);
|
|
522
|
+
const allParts = [...relParts, ...securityParts];
|
|
523
|
+
const uniqueParts = Array.from(new Set(allParts));
|
|
524
|
+
return uniqueParts.join(" ");
|
|
525
|
+
}
|
|
526
|
+
return securityRel;
|
|
527
|
+
}
|
|
528
|
+
return rel;
|
|
529
|
+
};
|
|
530
|
+
const defaultColor = theme.colors.control.link.primary;
|
|
531
|
+
const disabledColor = theme.colors.control.text.disable;
|
|
532
|
+
const textColor = disabled ? disabledColor : color || defaultColor;
|
|
533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
534
|
+
Box,
|
|
535
|
+
{
|
|
536
|
+
as: "a",
|
|
537
|
+
href: disabled ? void 0 : href,
|
|
538
|
+
onPress: handleClick,
|
|
539
|
+
onClick: handleClick,
|
|
540
|
+
target,
|
|
541
|
+
rel: getRel(),
|
|
542
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
543
|
+
flexDirection: "row",
|
|
544
|
+
alignItems: "center",
|
|
545
|
+
display: "inline-flex",
|
|
546
|
+
gap: 8,
|
|
547
|
+
testID,
|
|
548
|
+
role: "link",
|
|
549
|
+
tabIndex: disabled ? -1 : 0,
|
|
550
|
+
hoverStyle: !disabled ? { opacity: 0.8 } : void 0,
|
|
551
|
+
focusStyle: {
|
|
552
|
+
outlineColor: theme.colors.border.brand,
|
|
553
|
+
outlineWidth: 2,
|
|
554
|
+
outlineStyle: "solid",
|
|
555
|
+
outlineOffset: 2
|
|
556
|
+
},
|
|
557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
558
|
+
Text,
|
|
559
|
+
{
|
|
560
|
+
color: textColor,
|
|
561
|
+
fontSize: fontSizeMap[size],
|
|
562
|
+
fontWeight: "400",
|
|
563
|
+
textDecoration: underline ? "underline" : "none",
|
|
564
|
+
children
|
|
565
|
+
}
|
|
566
|
+
)
|
|
567
|
+
}
|
|
568
|
+
);
|
|
569
|
+
};
|
|
570
|
+
Link.displayName = "Link";
|
|
571
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
572
|
+
0 && (module.exports = {
|
|
573
|
+
Link
|
|
574
|
+
});
|
|
575
|
+
//# sourceMappingURL=index.js.map
|