@xsolla/xui-breadcrumbs 0.64.0-pr56.1768440195
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/native/index.d.mts +53 -0
- package/native/index.d.ts +53 -0
- package/native/index.js +611 -0
- package/native/index.js.map +1 -0
- package/native/index.mjs +578 -0
- package/native/index.mjs.map +1 -0
- package/package.json +45 -0
- package/web/index.d.mts +53 -0
- package/web/index.d.ts +53 -0
- package/web/index.js +583 -0
- package/web/index.js.map +1 -0
- package/web/index.mjs +546 -0
- package/web/index.mjs.map +1 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type BreadcrumbsSize = "sm" | "md" | "lg";
|
|
4
|
+
interface BreadcrumbItem {
|
|
5
|
+
/**
|
|
6
|
+
* The label/text of the breadcrumb item.
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* The URL or path for the breadcrumb item.
|
|
11
|
+
*/
|
|
12
|
+
href?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Callback fired when the breadcrumb item is clicked.
|
|
15
|
+
*/
|
|
16
|
+
onClick?: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the breadcrumb item is disabled.
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface BreadcrumbsProps {
|
|
23
|
+
/**
|
|
24
|
+
* Property to specify the size of the breadcrumbs.
|
|
25
|
+
* @default "md"
|
|
26
|
+
*/
|
|
27
|
+
size?: BreadcrumbsSize;
|
|
28
|
+
/**
|
|
29
|
+
* Array of breadcrumb items to display.
|
|
30
|
+
*/
|
|
31
|
+
items: BreadcrumbItem[];
|
|
32
|
+
/**
|
|
33
|
+
* Property for specifying the stretch of the breadcrumbs to fit the parent element.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
stretched?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Custom separator component. If not provided, uses ChevronRight icon.
|
|
39
|
+
*/
|
|
40
|
+
separator?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Custom background color for the breadcrumbs container
|
|
43
|
+
*/
|
|
44
|
+
backgroundColor?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Test ID for testing frameworks
|
|
47
|
+
*/
|
|
48
|
+
testID?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare const Breadcrumbs: React.FC<BreadcrumbsProps>;
|
|
52
|
+
|
|
53
|
+
export { type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, type BreadcrumbsSize };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type BreadcrumbsSize = "sm" | "md" | "lg";
|
|
4
|
+
interface BreadcrumbItem {
|
|
5
|
+
/**
|
|
6
|
+
* The label/text of the breadcrumb item.
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* The URL or path for the breadcrumb item.
|
|
11
|
+
*/
|
|
12
|
+
href?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Callback fired when the breadcrumb item is clicked.
|
|
15
|
+
*/
|
|
16
|
+
onClick?: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the breadcrumb item is disabled.
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface BreadcrumbsProps {
|
|
23
|
+
/**
|
|
24
|
+
* Property to specify the size of the breadcrumbs.
|
|
25
|
+
* @default "md"
|
|
26
|
+
*/
|
|
27
|
+
size?: BreadcrumbsSize;
|
|
28
|
+
/**
|
|
29
|
+
* Array of breadcrumb items to display.
|
|
30
|
+
*/
|
|
31
|
+
items: BreadcrumbItem[];
|
|
32
|
+
/**
|
|
33
|
+
* Property for specifying the stretch of the breadcrumbs to fit the parent element.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
stretched?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Custom separator component. If not provided, uses ChevronRight icon.
|
|
39
|
+
*/
|
|
40
|
+
separator?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Custom background color for the breadcrumbs container
|
|
43
|
+
*/
|
|
44
|
+
backgroundColor?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Test ID for testing frameworks
|
|
47
|
+
*/
|
|
48
|
+
testID?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare const Breadcrumbs: React.FC<BreadcrumbsProps>;
|
|
52
|
+
|
|
53
|
+
export { type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, type BreadcrumbsSize };
|
package/native/index.js
ADDED
|
@@ -0,0 +1,611 @@
|
|
|
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
|
+
Breadcrumbs: () => Breadcrumbs
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
|
|
37
|
+
// src/Breadcrumbs.tsx
|
|
38
|
+
var import_react4 = require("react");
|
|
39
|
+
|
|
40
|
+
// ../primitives-native/src/Box.tsx
|
|
41
|
+
var import_react_native = require("react-native");
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
+
var Box = ({
|
|
44
|
+
children,
|
|
45
|
+
onPress,
|
|
46
|
+
onLayout,
|
|
47
|
+
onMoveShouldSetResponder,
|
|
48
|
+
onResponderGrant,
|
|
49
|
+
onResponderMove,
|
|
50
|
+
onResponderRelease,
|
|
51
|
+
onResponderTerminate,
|
|
52
|
+
backgroundColor,
|
|
53
|
+
borderColor,
|
|
54
|
+
borderWidth,
|
|
55
|
+
borderBottomWidth,
|
|
56
|
+
borderBottomColor,
|
|
57
|
+
borderTopWidth,
|
|
58
|
+
borderTopColor,
|
|
59
|
+
borderLeftWidth,
|
|
60
|
+
borderLeftColor,
|
|
61
|
+
borderRightWidth,
|
|
62
|
+
borderRightColor,
|
|
63
|
+
borderRadius,
|
|
64
|
+
borderStyle,
|
|
65
|
+
height,
|
|
66
|
+
padding,
|
|
67
|
+
paddingHorizontal,
|
|
68
|
+
paddingVertical,
|
|
69
|
+
margin,
|
|
70
|
+
marginTop,
|
|
71
|
+
marginBottom,
|
|
72
|
+
marginLeft,
|
|
73
|
+
marginRight,
|
|
74
|
+
flexDirection,
|
|
75
|
+
alignItems,
|
|
76
|
+
justifyContent,
|
|
77
|
+
position,
|
|
78
|
+
top,
|
|
79
|
+
bottom,
|
|
80
|
+
left,
|
|
81
|
+
right,
|
|
82
|
+
width,
|
|
83
|
+
flex,
|
|
84
|
+
overflow,
|
|
85
|
+
zIndex,
|
|
86
|
+
hoverStyle,
|
|
87
|
+
pressStyle,
|
|
88
|
+
style,
|
|
89
|
+
"data-testid": dataTestId,
|
|
90
|
+
testID,
|
|
91
|
+
as,
|
|
92
|
+
src,
|
|
93
|
+
alt,
|
|
94
|
+
...rest
|
|
95
|
+
}) => {
|
|
96
|
+
const getContainerStyle = (pressed) => ({
|
|
97
|
+
backgroundColor: pressed && pressStyle?.backgroundColor ? pressStyle.backgroundColor : backgroundColor,
|
|
98
|
+
borderColor,
|
|
99
|
+
borderWidth,
|
|
100
|
+
borderBottomWidth,
|
|
101
|
+
borderBottomColor,
|
|
102
|
+
borderTopWidth,
|
|
103
|
+
borderTopColor,
|
|
104
|
+
borderLeftWidth,
|
|
105
|
+
borderLeftColor,
|
|
106
|
+
borderRightWidth,
|
|
107
|
+
borderRightColor,
|
|
108
|
+
borderRadius,
|
|
109
|
+
borderStyle,
|
|
110
|
+
overflow,
|
|
111
|
+
zIndex,
|
|
112
|
+
height,
|
|
113
|
+
width,
|
|
114
|
+
padding,
|
|
115
|
+
paddingHorizontal,
|
|
116
|
+
paddingVertical,
|
|
117
|
+
margin,
|
|
118
|
+
marginTop,
|
|
119
|
+
marginBottom,
|
|
120
|
+
marginLeft,
|
|
121
|
+
marginRight,
|
|
122
|
+
flexDirection,
|
|
123
|
+
alignItems,
|
|
124
|
+
justifyContent,
|
|
125
|
+
position,
|
|
126
|
+
top,
|
|
127
|
+
bottom,
|
|
128
|
+
left,
|
|
129
|
+
right,
|
|
130
|
+
flex,
|
|
131
|
+
...style
|
|
132
|
+
});
|
|
133
|
+
const finalTestID = dataTestId || testID;
|
|
134
|
+
const {
|
|
135
|
+
role,
|
|
136
|
+
tabIndex,
|
|
137
|
+
onKeyDown,
|
|
138
|
+
onKeyUp,
|
|
139
|
+
"aria-label": _ariaLabel,
|
|
140
|
+
"aria-labelledby": _ariaLabelledBy,
|
|
141
|
+
"aria-current": _ariaCurrent,
|
|
142
|
+
"aria-disabled": _ariaDisabled,
|
|
143
|
+
"aria-live": _ariaLive,
|
|
144
|
+
className,
|
|
145
|
+
"data-testid": _dataTestId,
|
|
146
|
+
...nativeRest
|
|
147
|
+
} = rest;
|
|
148
|
+
if (as === "img" && src) {
|
|
149
|
+
const imageStyle = {
|
|
150
|
+
width,
|
|
151
|
+
height,
|
|
152
|
+
borderRadius,
|
|
153
|
+
position,
|
|
154
|
+
top,
|
|
155
|
+
bottom,
|
|
156
|
+
left,
|
|
157
|
+
right,
|
|
158
|
+
...style
|
|
159
|
+
};
|
|
160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
+
import_react_native.Image,
|
|
162
|
+
{
|
|
163
|
+
source: { uri: src },
|
|
164
|
+
style: imageStyle,
|
|
165
|
+
testID: finalTestID,
|
|
166
|
+
resizeMode: "cover",
|
|
167
|
+
...nativeRest
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
if (onPress) {
|
|
172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
173
|
+
import_react_native.Pressable,
|
|
174
|
+
{
|
|
175
|
+
onPress,
|
|
176
|
+
onLayout,
|
|
177
|
+
onMoveShouldSetResponder,
|
|
178
|
+
onResponderGrant,
|
|
179
|
+
onResponderMove,
|
|
180
|
+
onResponderRelease,
|
|
181
|
+
onResponderTerminate,
|
|
182
|
+
style: ({ pressed }) => getContainerStyle(pressed),
|
|
183
|
+
testID: finalTestID,
|
|
184
|
+
...nativeRest,
|
|
185
|
+
children
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
190
|
+
import_react_native.View,
|
|
191
|
+
{
|
|
192
|
+
style: getContainerStyle(),
|
|
193
|
+
testID: finalTestID,
|
|
194
|
+
onLayout,
|
|
195
|
+
onMoveShouldSetResponder,
|
|
196
|
+
onResponderGrant,
|
|
197
|
+
onResponderMove,
|
|
198
|
+
onResponderRelease,
|
|
199
|
+
onResponderTerminate,
|
|
200
|
+
...nativeRest,
|
|
201
|
+
children
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
// ../primitives-native/src/Text.tsx
|
|
207
|
+
var import_react_native2 = require("react-native");
|
|
208
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
209
|
+
var roleMap = {
|
|
210
|
+
alert: "alert",
|
|
211
|
+
heading: "header",
|
|
212
|
+
button: "button",
|
|
213
|
+
link: "link",
|
|
214
|
+
text: "text"
|
|
215
|
+
};
|
|
216
|
+
var Text = ({
|
|
217
|
+
children,
|
|
218
|
+
color,
|
|
219
|
+
fontSize,
|
|
220
|
+
fontWeight,
|
|
221
|
+
fontFamily,
|
|
222
|
+
id,
|
|
223
|
+
role,
|
|
224
|
+
...props
|
|
225
|
+
}) => {
|
|
226
|
+
let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
|
|
227
|
+
if (resolvedFontFamily === "Pilat Wide Bold") {
|
|
228
|
+
resolvedFontFamily = void 0;
|
|
229
|
+
}
|
|
230
|
+
const style = {
|
|
231
|
+
color,
|
|
232
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
233
|
+
fontWeight,
|
|
234
|
+
fontFamily: resolvedFontFamily,
|
|
235
|
+
textDecorationLine: props.textDecoration
|
|
236
|
+
};
|
|
237
|
+
const accessibilityRole = role ? roleMap[role] : void 0;
|
|
238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.Text, { style, testID: id, accessibilityRole, children });
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// ../primitives-native/src/Spinner.tsx
|
|
242
|
+
var import_react_native3 = require("react-native");
|
|
243
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
244
|
+
var Spinner = ({
|
|
245
|
+
color,
|
|
246
|
+
size,
|
|
247
|
+
role,
|
|
248
|
+
"aria-label": ariaLabel,
|
|
249
|
+
"aria-live": ariaLive,
|
|
250
|
+
"aria-describedby": ariaDescribedBy,
|
|
251
|
+
testID
|
|
252
|
+
}) => {
|
|
253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
254
|
+
import_react_native3.View,
|
|
255
|
+
{
|
|
256
|
+
accessible: true,
|
|
257
|
+
accessibilityRole: role === "status" ? "none" : void 0,
|
|
258
|
+
accessibilityLabel: ariaLabel,
|
|
259
|
+
accessibilityLiveRegion: ariaLive === "polite" ? "polite" : ariaLive === "assertive" ? "assertive" : "none",
|
|
260
|
+
testID,
|
|
261
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
262
|
+
import_react_native3.ActivityIndicator,
|
|
263
|
+
{
|
|
264
|
+
color,
|
|
265
|
+
size: typeof size === "number" ? size : "small"
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
};
|
|
271
|
+
Spinner.displayName = "Spinner";
|
|
272
|
+
|
|
273
|
+
// ../primitives-native/src/Icon.tsx
|
|
274
|
+
var import_react = __toESM(require("react"));
|
|
275
|
+
var import_react_native4 = require("react-native");
|
|
276
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
277
|
+
var Icon = ({ children, color, size }) => {
|
|
278
|
+
const style = {
|
|
279
|
+
width: typeof size === "number" ? size : void 0,
|
|
280
|
+
height: typeof size === "number" ? size : void 0,
|
|
281
|
+
alignItems: "center",
|
|
282
|
+
justifyContent: "center"
|
|
283
|
+
};
|
|
284
|
+
const childrenWithProps = import_react.default.Children.map(children, (child) => {
|
|
285
|
+
if (import_react.default.isValidElement(child)) {
|
|
286
|
+
return import_react.default.cloneElement(child, {
|
|
287
|
+
color: child.props.color || color,
|
|
288
|
+
// Also pass size if child seems to be an icon that needs it
|
|
289
|
+
size: child.props.size || size
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
return child;
|
|
293
|
+
});
|
|
294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.View, { style, children: childrenWithProps });
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
// ../primitives-native/src/Divider.tsx
|
|
298
|
+
var import_react_native5 = require("react-native");
|
|
299
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
300
|
+
|
|
301
|
+
// ../primitives-native/src/Input.tsx
|
|
302
|
+
var import_react2 = require("react");
|
|
303
|
+
var import_react_native6 = require("react-native");
|
|
304
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
305
|
+
var keyboardTypeMap = {
|
|
306
|
+
text: "default",
|
|
307
|
+
number: "numeric",
|
|
308
|
+
email: "email-address",
|
|
309
|
+
tel: "phone-pad",
|
|
310
|
+
url: "url",
|
|
311
|
+
decimal: "decimal-pad"
|
|
312
|
+
};
|
|
313
|
+
var inputModeToKeyboardType = {
|
|
314
|
+
none: "default",
|
|
315
|
+
text: "default",
|
|
316
|
+
decimal: "decimal-pad",
|
|
317
|
+
numeric: "number-pad",
|
|
318
|
+
tel: "phone-pad",
|
|
319
|
+
search: "default",
|
|
320
|
+
email: "email-address",
|
|
321
|
+
url: "url"
|
|
322
|
+
};
|
|
323
|
+
var autoCompleteToTextContentType = {
|
|
324
|
+
"one-time-code": "oneTimeCode",
|
|
325
|
+
email: "emailAddress",
|
|
326
|
+
username: "username",
|
|
327
|
+
password: "password",
|
|
328
|
+
"new-password": "newPassword",
|
|
329
|
+
tel: "telephoneNumber",
|
|
330
|
+
"postal-code": "postalCode",
|
|
331
|
+
name: "name"
|
|
332
|
+
};
|
|
333
|
+
var InputPrimitive = (0, import_react2.forwardRef)(
|
|
334
|
+
({
|
|
335
|
+
value,
|
|
336
|
+
placeholder,
|
|
337
|
+
onChange,
|
|
338
|
+
onChangeText,
|
|
339
|
+
onFocus,
|
|
340
|
+
onBlur,
|
|
341
|
+
onKeyDown,
|
|
342
|
+
disabled,
|
|
343
|
+
secureTextEntry,
|
|
344
|
+
style,
|
|
345
|
+
color,
|
|
346
|
+
fontSize,
|
|
347
|
+
placeholderTextColor,
|
|
348
|
+
maxLength,
|
|
349
|
+
name,
|
|
350
|
+
type,
|
|
351
|
+
inputMode,
|
|
352
|
+
autoComplete,
|
|
353
|
+
id,
|
|
354
|
+
"aria-invalid": ariaInvalid,
|
|
355
|
+
"aria-describedby": ariaDescribedBy,
|
|
356
|
+
"aria-labelledby": ariaLabelledBy,
|
|
357
|
+
"aria-label": ariaLabel,
|
|
358
|
+
"aria-disabled": ariaDisabled,
|
|
359
|
+
"data-testid": dataTestId
|
|
360
|
+
}, ref) => {
|
|
361
|
+
const handleChangeText = (text) => {
|
|
362
|
+
onChangeText?.(text);
|
|
363
|
+
if (onChange) {
|
|
364
|
+
const syntheticEvent = {
|
|
365
|
+
target: { value: text },
|
|
366
|
+
currentTarget: { value: text },
|
|
367
|
+
type: "change",
|
|
368
|
+
nativeEvent: { text },
|
|
369
|
+
preventDefault: () => {
|
|
370
|
+
},
|
|
371
|
+
stopPropagation: () => {
|
|
372
|
+
},
|
|
373
|
+
isTrusted: false
|
|
374
|
+
};
|
|
375
|
+
onChange(syntheticEvent);
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
const keyboardType = inputMode ? inputModeToKeyboardType[inputMode] || "default" : type ? keyboardTypeMap[type] || "default" : "default";
|
|
379
|
+
const textContentType = autoComplete ? autoCompleteToTextContentType[autoComplete] : void 0;
|
|
380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
381
|
+
import_react_native6.TextInput,
|
|
382
|
+
{
|
|
383
|
+
ref,
|
|
384
|
+
value,
|
|
385
|
+
placeholder,
|
|
386
|
+
onChangeText: handleChangeText,
|
|
387
|
+
onFocus,
|
|
388
|
+
onBlur,
|
|
389
|
+
onKeyPress: (e) => {
|
|
390
|
+
if (onKeyDown) {
|
|
391
|
+
onKeyDown({
|
|
392
|
+
key: e.nativeEvent.key,
|
|
393
|
+
preventDefault: () => {
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
editable: !disabled,
|
|
399
|
+
secureTextEntry: secureTextEntry || type === "password",
|
|
400
|
+
keyboardType,
|
|
401
|
+
textContentType,
|
|
402
|
+
style: [
|
|
403
|
+
{
|
|
404
|
+
color,
|
|
405
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
406
|
+
flex: 1,
|
|
407
|
+
padding: 0,
|
|
408
|
+
textAlign: style?.textAlign || "left"
|
|
409
|
+
},
|
|
410
|
+
style
|
|
411
|
+
],
|
|
412
|
+
placeholderTextColor,
|
|
413
|
+
maxLength,
|
|
414
|
+
testID: dataTestId || id,
|
|
415
|
+
accessibilityLabel: ariaLabel,
|
|
416
|
+
accessibilityHint: ariaDescribedBy,
|
|
417
|
+
accessibilityState: {
|
|
418
|
+
disabled: disabled || ariaDisabled
|
|
419
|
+
},
|
|
420
|
+
accessible: true
|
|
421
|
+
}
|
|
422
|
+
);
|
|
423
|
+
}
|
|
424
|
+
);
|
|
425
|
+
InputPrimitive.displayName = "InputPrimitive";
|
|
426
|
+
|
|
427
|
+
// ../primitives-native/src/TextArea.tsx
|
|
428
|
+
var import_react3 = require("react");
|
|
429
|
+
var import_react_native7 = require("react-native");
|
|
430
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
431
|
+
var TextAreaPrimitive = (0, import_react3.forwardRef)(
|
|
432
|
+
({
|
|
433
|
+
value,
|
|
434
|
+
placeholder,
|
|
435
|
+
onChange,
|
|
436
|
+
onChangeText,
|
|
437
|
+
onFocus,
|
|
438
|
+
onBlur,
|
|
439
|
+
onKeyDown,
|
|
440
|
+
disabled,
|
|
441
|
+
style,
|
|
442
|
+
color,
|
|
443
|
+
fontSize,
|
|
444
|
+
placeholderTextColor,
|
|
445
|
+
maxLength,
|
|
446
|
+
rows,
|
|
447
|
+
id,
|
|
448
|
+
"aria-invalid": ariaInvalid,
|
|
449
|
+
"aria-describedby": ariaDescribedBy,
|
|
450
|
+
"aria-labelledby": ariaLabelledBy,
|
|
451
|
+
"aria-label": ariaLabel,
|
|
452
|
+
"aria-disabled": ariaDisabled,
|
|
453
|
+
"data-testid": dataTestId
|
|
454
|
+
}, ref) => {
|
|
455
|
+
const handleChangeText = (text) => {
|
|
456
|
+
onChangeText?.(text);
|
|
457
|
+
if (onChange) {
|
|
458
|
+
const syntheticEvent = {
|
|
459
|
+
target: { value: text },
|
|
460
|
+
currentTarget: { value: text },
|
|
461
|
+
type: "change",
|
|
462
|
+
nativeEvent: { text },
|
|
463
|
+
preventDefault: () => {
|
|
464
|
+
},
|
|
465
|
+
stopPropagation: () => {
|
|
466
|
+
},
|
|
467
|
+
isTrusted: false
|
|
468
|
+
};
|
|
469
|
+
onChange(syntheticEvent);
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
473
|
+
import_react_native7.TextInput,
|
|
474
|
+
{
|
|
475
|
+
ref,
|
|
476
|
+
value,
|
|
477
|
+
placeholder,
|
|
478
|
+
onChangeText: handleChangeText,
|
|
479
|
+
onFocus,
|
|
480
|
+
onBlur,
|
|
481
|
+
onKeyPress: (e) => {
|
|
482
|
+
if (onKeyDown) {
|
|
483
|
+
onKeyDown({
|
|
484
|
+
key: e.nativeEvent.key,
|
|
485
|
+
preventDefault: () => {
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
editable: !disabled,
|
|
491
|
+
multiline: true,
|
|
492
|
+
numberOfLines: rows || 4,
|
|
493
|
+
style: [
|
|
494
|
+
{
|
|
495
|
+
color,
|
|
496
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
497
|
+
flex: 1,
|
|
498
|
+
padding: 0,
|
|
499
|
+
textAlignVertical: "top",
|
|
500
|
+
textAlign: style?.textAlign || "left"
|
|
501
|
+
},
|
|
502
|
+
style
|
|
503
|
+
],
|
|
504
|
+
placeholderTextColor,
|
|
505
|
+
maxLength,
|
|
506
|
+
testID: dataTestId || id,
|
|
507
|
+
accessibilityLabel: ariaLabel,
|
|
508
|
+
accessibilityHint: ariaDescribedBy,
|
|
509
|
+
accessibilityState: {
|
|
510
|
+
disabled: disabled || ariaDisabled
|
|
511
|
+
},
|
|
512
|
+
accessible: true
|
|
513
|
+
}
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
);
|
|
517
|
+
TextAreaPrimitive.displayName = "TextAreaPrimitive";
|
|
518
|
+
|
|
519
|
+
// src/Breadcrumbs.tsx
|
|
520
|
+
var import_xui_core = require("@xsolla/xui-core");
|
|
521
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
522
|
+
var ChevronRight = ({ size }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { viewBox: "0 0 24 24", width: size, height: size, fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("polyline", { points: "9 18 15 12 9 6" }) });
|
|
523
|
+
var Breadcrumbs = ({
|
|
524
|
+
size = "md",
|
|
525
|
+
items,
|
|
526
|
+
stretched = false,
|
|
527
|
+
separator,
|
|
528
|
+
backgroundColor,
|
|
529
|
+
testID
|
|
530
|
+
}) => {
|
|
531
|
+
const { theme } = (0, import_xui_core.useDesignSystem)();
|
|
532
|
+
const fontSizeMap = {
|
|
533
|
+
sm: 12,
|
|
534
|
+
md: 14,
|
|
535
|
+
lg: 16
|
|
536
|
+
};
|
|
537
|
+
const iconSizeMap = {
|
|
538
|
+
sm: 12,
|
|
539
|
+
md: 16,
|
|
540
|
+
lg: 20
|
|
541
|
+
};
|
|
542
|
+
const gapMap = {
|
|
543
|
+
sm: 4,
|
|
544
|
+
md: 8,
|
|
545
|
+
lg: 10
|
|
546
|
+
};
|
|
547
|
+
const iconSize = iconSizeMap[size];
|
|
548
|
+
const fontSize = fontSizeMap[size];
|
|
549
|
+
const gap = gapMap[size];
|
|
550
|
+
const defaultSeparator = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { size: iconSize, color: theme.colors.content.tertiary, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChevronRight, { size: iconSize }) }) });
|
|
551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
552
|
+
Box,
|
|
553
|
+
{
|
|
554
|
+
as: "nav",
|
|
555
|
+
flexDirection: "row",
|
|
556
|
+
alignItems: "center",
|
|
557
|
+
justifyContent: stretched ? "center" : "flex-start",
|
|
558
|
+
width: stretched ? "100%" : "auto",
|
|
559
|
+
gap,
|
|
560
|
+
flexWrap: "wrap",
|
|
561
|
+
backgroundColor,
|
|
562
|
+
testID,
|
|
563
|
+
"aria-label": "Breadcrumb",
|
|
564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box, { as: "ol", flexDirection: "row", alignItems: "center", gap, flexWrap: "wrap", style: { listStyle: "none", margin: 0, padding: 0 }, children: items.map((item, index) => {
|
|
565
|
+
const isLast = index === items.length - 1;
|
|
566
|
+
const isActive = isLast;
|
|
567
|
+
const handleClick = (e) => {
|
|
568
|
+
if (!isActive && !item.disabled && item.onClick) {
|
|
569
|
+
e.preventDefault?.();
|
|
570
|
+
item.onClick();
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
const color = isActive ? theme.colors.content.primary : theme.colors.content.tertiary;
|
|
574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react4.Fragment, { children: [
|
|
575
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box, { as: "li", flexDirection: "row", alignItems: "center", gap, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
576
|
+
Box,
|
|
577
|
+
{
|
|
578
|
+
as: !isActive && item.href ? "a" : "div",
|
|
579
|
+
href: !isActive && !item.disabled ? item.href : void 0,
|
|
580
|
+
onPress: handleClick,
|
|
581
|
+
onClick: handleClick,
|
|
582
|
+
cursor: item.disabled ? "not-allowed" : isActive ? "default" : "pointer",
|
|
583
|
+
opacity: item.disabled ? 0.6 : 1,
|
|
584
|
+
role: !isActive && item.href ? "link" : !isActive ? "button" : void 0,
|
|
585
|
+
"aria-current": isActive ? "page" : void 0,
|
|
586
|
+
tabIndex: item.disabled || isActive ? -1 : 0,
|
|
587
|
+
hoverStyle: !item.disabled && !isActive ? { opacity: 0.8 } : void 0,
|
|
588
|
+
style: { textDecoration: "none" },
|
|
589
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
590
|
+
Text,
|
|
591
|
+
{
|
|
592
|
+
color,
|
|
593
|
+
fontSize,
|
|
594
|
+
fontWeight: isActive ? "600" : "400",
|
|
595
|
+
children: item.label
|
|
596
|
+
}
|
|
597
|
+
)
|
|
598
|
+
}
|
|
599
|
+
) }),
|
|
600
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box, { as: "li", "aria-hidden": "true", children: separator || defaultSeparator })
|
|
601
|
+
] }, index);
|
|
602
|
+
}) })
|
|
603
|
+
}
|
|
604
|
+
);
|
|
605
|
+
};
|
|
606
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
607
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
608
|
+
0 && (module.exports = {
|
|
609
|
+
Breadcrumbs
|
|
610
|
+
});
|
|
611
|
+
//# sourceMappingURL=index.js.map
|