@xsolla/xui-cell 0.118.0 → 0.119.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/native/index.d.mts +21 -3
- package/native/index.d.ts +21 -3
- package/native/index.js +213 -17
- package/native/index.js.flow +51 -3
- package/native/index.js.map +1 -1
- package/native/index.mjs +217 -18
- package/native/index.mjs.map +1 -1
- package/package.json +5 -5
- package/web/index.d.mts +21 -3
- package/web/index.d.ts +21 -3
- package/web/index.js +183 -17
- package/web/index.js.flow +51 -3
- package/web/index.js.map +1 -1
- package/web/index.mjs +184 -18
- package/web/index.mjs.map +1 -1
package/native/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/Cell.tsx
|
|
2
|
-
import { forwardRef } from "react";
|
|
2
|
+
import { forwardRef, useMemo } from "react";
|
|
3
3
|
|
|
4
4
|
// ../primitives-native/src/Box.tsx
|
|
5
5
|
import {
|
|
@@ -171,13 +171,106 @@ var Box = ({
|
|
|
171
171
|
);
|
|
172
172
|
};
|
|
173
173
|
|
|
174
|
+
// ../primitives-native/src/Text.tsx
|
|
175
|
+
import {
|
|
176
|
+
Text as RNText,
|
|
177
|
+
StyleSheet
|
|
178
|
+
} from "react-native";
|
|
179
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
180
|
+
var roleMap = {
|
|
181
|
+
alert: "alert",
|
|
182
|
+
heading: "header",
|
|
183
|
+
button: "button",
|
|
184
|
+
link: "link",
|
|
185
|
+
text: "text"
|
|
186
|
+
};
|
|
187
|
+
var parseNumericValue = (value) => {
|
|
188
|
+
if (value === void 0) return void 0;
|
|
189
|
+
if (typeof value === "number") return value;
|
|
190
|
+
const parsed = parseFloat(value);
|
|
191
|
+
return isNaN(parsed) ? void 0 : parsed;
|
|
192
|
+
};
|
|
193
|
+
var Text = ({
|
|
194
|
+
children,
|
|
195
|
+
color,
|
|
196
|
+
fontSize,
|
|
197
|
+
fontWeight,
|
|
198
|
+
fontFamily,
|
|
199
|
+
textAlign,
|
|
200
|
+
lineHeight,
|
|
201
|
+
numberOfLines,
|
|
202
|
+
id,
|
|
203
|
+
role,
|
|
204
|
+
style: styleProp,
|
|
205
|
+
...props
|
|
206
|
+
}) => {
|
|
207
|
+
let resolvedFontFamily = fontFamily ? fontFamily.split(",")[0].replace(/['"]/g, "").trim() : void 0;
|
|
208
|
+
if (resolvedFontFamily === "Pilat Wide" || resolvedFontFamily === "Pilat Wide Bold" || resolvedFontFamily === "Aktiv Grotesk") {
|
|
209
|
+
resolvedFontFamily = void 0;
|
|
210
|
+
}
|
|
211
|
+
const incomingStyle = StyleSheet.flatten(styleProp);
|
|
212
|
+
const baseStyle = {
|
|
213
|
+
color,
|
|
214
|
+
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
215
|
+
fontWeight,
|
|
216
|
+
fontFamily: resolvedFontFamily,
|
|
217
|
+
textDecorationLine: props.textDecoration,
|
|
218
|
+
textAlign: textAlign ?? incomingStyle?.textAlign,
|
|
219
|
+
lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),
|
|
220
|
+
marginTop: parseNumericValue(
|
|
221
|
+
incomingStyle?.marginTop
|
|
222
|
+
),
|
|
223
|
+
marginBottom: parseNumericValue(
|
|
224
|
+
incomingStyle?.marginBottom
|
|
225
|
+
)
|
|
226
|
+
};
|
|
227
|
+
const accessibilityRole = role ? roleMap[role] : void 0;
|
|
228
|
+
return /* @__PURE__ */ jsx2(
|
|
229
|
+
RNText,
|
|
230
|
+
{
|
|
231
|
+
style: baseStyle,
|
|
232
|
+
numberOfLines,
|
|
233
|
+
testID: id,
|
|
234
|
+
accessibilityRole,
|
|
235
|
+
children
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
};
|
|
239
|
+
|
|
174
240
|
// src/Cell.tsx
|
|
175
241
|
import { useDesignSystem } from "@xsolla/xui-core";
|
|
176
|
-
import { jsx as
|
|
242
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
177
243
|
var CellRoot = forwardRef(
|
|
178
|
-
({ children,
|
|
244
|
+
({ children, view: viewProp, withBoard, style, ...props }, ref) => {
|
|
179
245
|
const { theme } = useDesignSystem();
|
|
180
|
-
|
|
246
|
+
const view = viewProp ?? (withBoard ? "stroke" : "default");
|
|
247
|
+
const viewStyles = useMemo(() => {
|
|
248
|
+
const hoverBg = theme.colors.background.secondary;
|
|
249
|
+
switch (view) {
|
|
250
|
+
case "stroke":
|
|
251
|
+
return {
|
|
252
|
+
borderRadius: 8,
|
|
253
|
+
borderWidth: 1,
|
|
254
|
+
borderColor: theme.colors.border.secondary,
|
|
255
|
+
padding: 12,
|
|
256
|
+
hoverStyle: { backgroundColor: hoverBg }
|
|
257
|
+
};
|
|
258
|
+
case "surface":
|
|
259
|
+
return {
|
|
260
|
+
backgroundColor: theme.colors.background.secondary,
|
|
261
|
+
borderRadius: 8,
|
|
262
|
+
padding: 12,
|
|
263
|
+
hoverStyle: { backgroundColor: hoverBg }
|
|
264
|
+
};
|
|
265
|
+
default:
|
|
266
|
+
return {
|
|
267
|
+
minHeight: 56,
|
|
268
|
+
hoverStyle: { backgroundColor: hoverBg }
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
}, [view, theme]);
|
|
272
|
+
const hasPress = props.onPress != null;
|
|
273
|
+
return /* @__PURE__ */ jsx3(
|
|
181
274
|
Box,
|
|
182
275
|
{
|
|
183
276
|
ref,
|
|
@@ -185,18 +278,10 @@ var CellRoot = forwardRef(
|
|
|
185
278
|
width: "100%",
|
|
186
279
|
flexDirection: "row",
|
|
187
280
|
gap: 12,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
...withBoard ? {
|
|
191
|
-
backgroundColor: theme.colors.background.secondary,
|
|
192
|
-
borderRadius: 8,
|
|
193
|
-
borderWidth: 1,
|
|
194
|
-
borderColor: theme.colors.border.secondary,
|
|
195
|
-
paddingVertical: 12
|
|
196
|
-
} : {
|
|
197
|
-
paddingVertical: 8
|
|
198
|
-
},
|
|
281
|
+
cursor: hasPress ? "pointer" : void 0,
|
|
282
|
+
...viewStyles,
|
|
199
283
|
...props,
|
|
284
|
+
style: { color: theme.colors.content.primary, ...style },
|
|
200
285
|
children
|
|
201
286
|
}
|
|
202
287
|
);
|
|
@@ -205,7 +290,7 @@ var CellRoot = forwardRef(
|
|
|
205
290
|
CellRoot.displayName = "Cell";
|
|
206
291
|
var CellSlot = forwardRef(
|
|
207
292
|
({ children, ...props }, ref) => {
|
|
208
|
-
return /* @__PURE__ */
|
|
293
|
+
return /* @__PURE__ */ jsx3(
|
|
209
294
|
Box,
|
|
210
295
|
{
|
|
211
296
|
ref,
|
|
@@ -222,7 +307,7 @@ var CellSlot = forwardRef(
|
|
|
222
307
|
CellSlot.displayName = "Cell.Slot";
|
|
223
308
|
var CellContent = forwardRef(
|
|
224
309
|
({ children, ...props }, ref) => {
|
|
225
|
-
return /* @__PURE__ */
|
|
310
|
+
return /* @__PURE__ */ jsx3(
|
|
226
311
|
Box,
|
|
227
312
|
{
|
|
228
313
|
ref,
|
|
@@ -236,9 +321,123 @@ var CellContent = forwardRef(
|
|
|
236
321
|
}
|
|
237
322
|
);
|
|
238
323
|
CellContent.displayName = "Cell.Content";
|
|
324
|
+
var CellTextRow = ({
|
|
325
|
+
left,
|
|
326
|
+
right,
|
|
327
|
+
leftProps,
|
|
328
|
+
rightProps
|
|
329
|
+
}) => {
|
|
330
|
+
if (!left && !right) return null;
|
|
331
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "row", gap: 12, alignItems: "center", width: "100%", children: [
|
|
332
|
+
left != null && /* @__PURE__ */ jsx3(
|
|
333
|
+
Box,
|
|
334
|
+
{
|
|
335
|
+
flexDirection: "row",
|
|
336
|
+
alignItems: "center",
|
|
337
|
+
gap: 2,
|
|
338
|
+
style: { flex: 1, minWidth: 0, minHeight: 1 },
|
|
339
|
+
children: typeof left === "string" ? /* @__PURE__ */ jsx3(Text, { ...leftProps, children: left }) : left
|
|
340
|
+
}
|
|
341
|
+
),
|
|
342
|
+
right != null && /* @__PURE__ */ jsx3(
|
|
343
|
+
Box,
|
|
344
|
+
{
|
|
345
|
+
flexDirection: "row",
|
|
346
|
+
alignItems: "center",
|
|
347
|
+
justifyContent: "flex-end",
|
|
348
|
+
gap: 2,
|
|
349
|
+
style: { flex: 1, minWidth: 0, minHeight: 1 },
|
|
350
|
+
children: typeof right === "string" ? /* @__PURE__ */ jsx3(Text, { ...rightProps, children: right }) : right
|
|
351
|
+
}
|
|
352
|
+
)
|
|
353
|
+
] });
|
|
354
|
+
};
|
|
355
|
+
var CellText = forwardRef(
|
|
356
|
+
({
|
|
357
|
+
title,
|
|
358
|
+
titleRight,
|
|
359
|
+
description,
|
|
360
|
+
descriptionRight,
|
|
361
|
+
caption,
|
|
362
|
+
captionRight,
|
|
363
|
+
...props
|
|
364
|
+
}, ref) => {
|
|
365
|
+
const { theme } = useDesignSystem();
|
|
366
|
+
const hasDescriptions = description != null || descriptionRight != null;
|
|
367
|
+
const hasCaptions = caption != null || captionRight != null;
|
|
368
|
+
return /* @__PURE__ */ jsxs(
|
|
369
|
+
Box,
|
|
370
|
+
{
|
|
371
|
+
ref,
|
|
372
|
+
flexDirection: "column",
|
|
373
|
+
justifyContent: "center",
|
|
374
|
+
gap: 2,
|
|
375
|
+
...props,
|
|
376
|
+
style: { flex: 1, minWidth: 0, minHeight: 1, ...props.style },
|
|
377
|
+
children: [
|
|
378
|
+
/* @__PURE__ */ jsx3(
|
|
379
|
+
CellTextRow,
|
|
380
|
+
{
|
|
381
|
+
left: title,
|
|
382
|
+
right: titleRight,
|
|
383
|
+
leftProps: {
|
|
384
|
+
fontWeight: "500",
|
|
385
|
+
fontSize: 16,
|
|
386
|
+
lineHeight: 20
|
|
387
|
+
},
|
|
388
|
+
rightProps: {
|
|
389
|
+
fontWeight: "400",
|
|
390
|
+
fontSize: 12,
|
|
391
|
+
lineHeight: 18
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
),
|
|
395
|
+
hasDescriptions && /* @__PURE__ */ jsx3(
|
|
396
|
+
CellTextRow,
|
|
397
|
+
{
|
|
398
|
+
left: description,
|
|
399
|
+
right: descriptionRight,
|
|
400
|
+
leftProps: {
|
|
401
|
+
fontWeight: "400",
|
|
402
|
+
fontSize: 12,
|
|
403
|
+
lineHeight: 18
|
|
404
|
+
},
|
|
405
|
+
rightProps: {
|
|
406
|
+
fontWeight: "400",
|
|
407
|
+
fontSize: 12,
|
|
408
|
+
lineHeight: 18
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
),
|
|
412
|
+
hasCaptions && /* @__PURE__ */ jsx3(
|
|
413
|
+
CellTextRow,
|
|
414
|
+
{
|
|
415
|
+
left: caption,
|
|
416
|
+
right: captionRight,
|
|
417
|
+
leftProps: {
|
|
418
|
+
fontWeight: "400",
|
|
419
|
+
fontSize: 12,
|
|
420
|
+
lineHeight: 18,
|
|
421
|
+
color: theme.colors.content.tertiary
|
|
422
|
+
},
|
|
423
|
+
rightProps: {
|
|
424
|
+
fontWeight: "400",
|
|
425
|
+
fontSize: 12,
|
|
426
|
+
lineHeight: 18,
|
|
427
|
+
color: theme.colors.content.tertiary
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
)
|
|
431
|
+
]
|
|
432
|
+
}
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
);
|
|
436
|
+
CellText.displayName = "Cell.Text";
|
|
239
437
|
var Cell = Object.assign(CellRoot, {
|
|
240
438
|
Slot: CellSlot,
|
|
241
|
-
Content: CellContent
|
|
439
|
+
Content: CellContent,
|
|
440
|
+
Text: CellText
|
|
242
441
|
});
|
|
243
442
|
export {
|
|
244
443
|
Cell
|
package/native/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Cell.tsx","../../../primitives-native/src/Box.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport { CellContentProps, CellProps, CellSlotProps } from \"./types\";\n\nconst CellRoot = forwardRef<any, CellProps>(\n ({ children, withBoard = false, ...props }, ref) => {\n const { theme } = useDesignSystem();\n\n return (\n <Box\n ref={ref}\n alignItems=\"center\"\n width=\"100%\"\n flexDirection=\"row\"\n gap={12}\n paddingHorizontal={16}\n minHeight={56}\n {...(withBoard\n ? {\n backgroundColor: theme.colors.background.secondary,\n borderRadius: 8,\n borderWidth: 1,\n borderColor: theme.colors.border.secondary,\n paddingVertical: 12,\n }\n : {\n paddingVertical: 8,\n })}\n {...props}\n >\n {children}\n </Box>\n );\n }\n);\n\nCellRoot.displayName = \"Cell\";\n\nconst CellSlot = forwardRef<any, CellSlotProps>(\n ({ children, ...props }, ref) => {\n return (\n <Box\n ref={ref}\n alignItems=\"center\"\n justifyContent=\"center\"\n flexDirection=\"row\"\n {...props}\n style={{ flexShrink: 0, ...props.style }}\n >\n {children}\n </Box>\n );\n }\n);\n\nCellSlot.displayName = \"Cell.Slot\";\n\nconst CellContent = forwardRef<any, CellContentProps>(\n ({ children, ...props }, ref) => {\n return (\n <Box\n ref={ref}\n flexDirection=\"column\"\n justifyContent=\"center\"\n {...props}\n style={{ flex: 1, ...props.style }}\n >\n {children}\n </Box>\n );\n }\n);\n\nCellContent.displayName = \"Cell.Content\";\n\nexport const Cell = Object.assign(CellRoot, {\n Slot: CellSlot,\n Content: CellContent,\n});\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n alignItems,\n justifyContent,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": _ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": _ariaDisabled,\n \"aria-live\": _ariaLive,\n className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n"],"mappings":";AAAA,SAAS,kBAAkB;;;ACC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAmID;AAhIC,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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,QAAQ;AAC/B,WACE,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,YAAW;AAAA,QACX,gBAAe;AAAA,QACf,eAAc;AAAA,QACb,GAAG;AAAA,QACJ,OAAO,EAAE,YAAY,GAAG,GAAG,MAAM,MAAM;AAAA,QAEtC;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,SAAS,cAAc;AAEvB,IAAM,cAAc;AAAA,EAClB,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ;AAC/B,WACE,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAc;AAAA,QACd,gBAAe;AAAA,QACd,GAAG;AAAA,QACJ,OAAO,EAAE,MAAM,GAAG,GAAG,MAAM,MAAM;AAAA,QAEhC;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;AAEnB,IAAM,OAAO,OAAO,OAAO,UAAU;AAAA,EAC1C,MAAM;AAAA,EACN,SAAS;AACX,CAAC;","names":["jsx"]}
|
|
1
|
+
{"version":3,"sources":["../../src/Cell.tsx","../../../primitives-native/src/Box.tsx","../../../primitives-native/src/Text.tsx"],"sourcesContent":["import { forwardRef, useMemo } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text } from \"@xsolla/xui-primitives\";\nimport { useDesignSystem } from \"@xsolla/xui-core\";\nimport {\n CellContentProps,\n CellProps,\n CellSlotProps,\n CellTextProps,\n CellView,\n} from \"./types\";\n\nconst CellRoot = forwardRef<any, CellProps>(\n ({ children, view: viewProp, withBoard, style, ...props }, ref) => {\n const { theme } = useDesignSystem();\n\n const view: CellView = viewProp ?? (withBoard ? \"stroke\" : \"default\");\n\n const viewStyles = useMemo(() => {\n const hoverBg = theme.colors.background.secondary;\n\n switch (view) {\n case \"stroke\":\n return {\n borderRadius: 8,\n borderWidth: 1,\n borderColor: theme.colors.border.secondary,\n padding: 12,\n hoverStyle: { backgroundColor: hoverBg },\n };\n case \"surface\":\n return {\n backgroundColor: theme.colors.background.secondary,\n borderRadius: 8,\n padding: 12,\n hoverStyle: { backgroundColor: hoverBg },\n };\n default:\n return {\n minHeight: 56,\n hoverStyle: { backgroundColor: hoverBg },\n };\n }\n }, [view, theme]);\n\n const hasPress = props.onPress != null;\n\n return (\n <Box\n ref={ref}\n alignItems=\"center\"\n width=\"100%\"\n flexDirection=\"row\"\n gap={12}\n cursor={hasPress ? \"pointer\" : undefined}\n {...viewStyles}\n {...props}\n style={{ color: theme.colors.content.primary, ...style }}\n >\n {children}\n </Box>\n );\n }\n);\n\nCellRoot.displayName = \"Cell\";\n\nconst CellSlot = forwardRef<any, CellSlotProps>(\n ({ children, ...props }, ref) => {\n return (\n <Box\n ref={ref}\n alignItems=\"center\"\n justifyContent=\"center\"\n flexDirection=\"row\"\n {...props}\n style={{ flexShrink: 0, ...props.style }}\n >\n {children}\n </Box>\n );\n }\n);\n\nCellSlot.displayName = \"Cell.Slot\";\n\nconst CellContent = forwardRef<any, CellContentProps>(\n ({ children, ...props }, ref) => {\n return (\n <Box\n ref={ref}\n flexDirection=\"column\"\n justifyContent=\"center\"\n {...props}\n style={{ flex: 1, ...props.style }}\n >\n {children}\n </Box>\n );\n }\n);\n\nCellContent.displayName = \"Cell.Content\";\n\nconst CellTextRow = ({\n left,\n right,\n leftProps,\n rightProps,\n}: {\n left?: React.ReactNode;\n right?: React.ReactNode;\n leftProps?: Record<string, unknown>;\n rightProps?: Record<string, unknown>;\n}) => {\n if (!left && !right) return null;\n return (\n <Box flexDirection=\"row\" gap={12} alignItems=\"center\" width=\"100%\">\n {left != null && (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={2}\n style={{ flex: 1, minWidth: 0, minHeight: 1 }}\n >\n {typeof left === \"string\" ? <Text {...leftProps}>{left}</Text> : left}\n </Box>\n )}\n {right != null && (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"flex-end\"\n gap={2}\n style={{ flex: 1, minWidth: 0, minHeight: 1 }}\n >\n {typeof right === \"string\" ? (\n <Text {...rightProps}>{right}</Text>\n ) : (\n right\n )}\n </Box>\n )}\n </Box>\n );\n};\n\nconst CellText = forwardRef<any, CellTextProps>(\n (\n {\n title,\n titleRight,\n description,\n descriptionRight,\n caption,\n captionRight,\n ...props\n },\n ref\n ) => {\n const { theme } = useDesignSystem();\n\n const hasDescriptions = description != null || descriptionRight != null;\n const hasCaptions = caption != null || captionRight != null;\n\n return (\n <Box\n ref={ref}\n flexDirection=\"column\"\n justifyContent=\"center\"\n gap={2}\n {...props}\n style={{ flex: 1, minWidth: 0, minHeight: 1, ...props.style }}\n >\n <CellTextRow\n left={title}\n right={titleRight}\n leftProps={{\n fontWeight: \"500\",\n fontSize: 16,\n lineHeight: 20,\n }}\n rightProps={{\n fontWeight: \"400\",\n fontSize: 12,\n lineHeight: 18,\n }}\n />\n {hasDescriptions && (\n <CellTextRow\n left={description}\n right={descriptionRight}\n leftProps={{\n fontWeight: \"400\",\n fontSize: 12,\n lineHeight: 18,\n }}\n rightProps={{\n fontWeight: \"400\",\n fontSize: 12,\n lineHeight: 18,\n }}\n />\n )}\n {hasCaptions && (\n <CellTextRow\n left={caption}\n right={captionRight}\n leftProps={{\n fontWeight: \"400\",\n fontSize: 12,\n lineHeight: 18,\n color: theme.colors.content.tertiary,\n }}\n rightProps={{\n fontWeight: \"400\",\n fontSize: 12,\n lineHeight: 18,\n color: theme.colors.content.tertiary,\n }}\n />\n )}\n </Box>\n );\n }\n);\n\nCellText.displayName = \"Cell.Text\";\n\nexport const Cell = Object.assign(CellRoot, {\n Slot: CellSlot,\n Content: CellContent,\n Text: CellText,\n});\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n alignItems,\n justifyContent,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": _ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": _ariaDisabled,\n \"aria-live\": _ariaLive,\n className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n"],"mappings":";AAAA,SAAS,YAAY,eAAe;;;ACCpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAmID;AAhIC,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,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AAA,gBACV,YAAY;AAAA,cACd;AAAA,cACA,YAAY;AAAA,gBACV,YAAY;AAAA,gBACZ,UAAU;AAAA,gBACV,YAAY;AAAA,cACd;AAAA;AAAA,UACF;AAAA,UACC,mBACC,gBAAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,cACP,WAAW;AAAA,gBACT,YAAY;AAAA,gBACZ,UAAU;AAAA,gBACV,YAAY;AAAA,cACd;AAAA,cACA,YAAY;AAAA,gBACV,YAAY;AAAA,gBACZ,UAAU;AAAA,gBACV,YAAY;AAAA,cACd;AAAA;AAAA,UACF;AAAA,UAED,eACC,gBAAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAM;AAAA,cACN,OAAO;AAAA,cACP,WAAW;AAAA,gBACT,YAAY;AAAA,gBACZ,UAAU;AAAA,gBACV,YAAY;AAAA,gBACZ,OAAO,MAAM,OAAO,QAAQ;AAAA,cAC9B;AAAA,cACA,YAAY;AAAA,gBACV,YAAY;AAAA,gBACZ,UAAU;AAAA,gBACV,YAAY;AAAA,gBACZ,OAAO,MAAM,OAAO,QAAQ;AAAA,cAC9B;AAAA;AAAA,UACF;AAAA;AAAA;AAAA,IAEJ;AAAA,EAEJ;AACF;AAEA,SAAS,cAAc;AAEhB,IAAM,OAAO,OAAO,OAAO,UAAU;AAAA,EAC1C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AACR,CAAC;","names":["jsx","jsx"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-cell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.119.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"build:native": "PLATFORM=native tsup"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xsolla/xui-avatar": "0.
|
|
14
|
-
"@xsolla/xui-button": "0.
|
|
15
|
-
"@xsolla/xui-core": "0.
|
|
16
|
-
"@xsolla/xui-primitives-core": "0.
|
|
13
|
+
"@xsolla/xui-avatar": "0.119.0",
|
|
14
|
+
"@xsolla/xui-button": "0.119.0",
|
|
15
|
+
"@xsolla/xui-core": "0.119.0",
|
|
16
|
+
"@xsolla/xui-primitives-core": "0.119.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": ">=16.8.0",
|
package/web/index.d.mts
CHANGED
|
@@ -2,11 +2,14 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { BoxProps } from '@xsolla/xui-primitives-core';
|
|
4
4
|
|
|
5
|
+
type CellView = "default" | "stroke" | "surface";
|
|
5
6
|
interface CellProps extends BoxProps {
|
|
6
7
|
children?: ReactNode;
|
|
8
|
+
/** Visual variant of the cell container. */
|
|
9
|
+
view?: CellView;
|
|
7
10
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
11
|
+
* @deprecated Use `view="stroke"` instead.
|
|
12
|
+
* If true, applies the "stroke" view style.
|
|
10
13
|
*/
|
|
11
14
|
withBoard?: boolean;
|
|
12
15
|
}
|
|
@@ -16,10 +19,25 @@ interface CellSlotProps extends BoxProps {
|
|
|
16
19
|
interface CellContentProps extends BoxProps {
|
|
17
20
|
children?: ReactNode;
|
|
18
21
|
}
|
|
22
|
+
interface CellTextProps extends BoxProps {
|
|
23
|
+
/** Primary title on the left. */
|
|
24
|
+
title?: ReactNode;
|
|
25
|
+
/** Secondary text on the right of the title row. */
|
|
26
|
+
titleRight?: ReactNode;
|
|
27
|
+
/** Description text on the left (second row). */
|
|
28
|
+
description?: ReactNode;
|
|
29
|
+
/** Description text on the right (second row). */
|
|
30
|
+
descriptionRight?: ReactNode;
|
|
31
|
+
/** Caption text on the left (third row, tertiary color). */
|
|
32
|
+
caption?: ReactNode;
|
|
33
|
+
/** Caption text on the right (third row, tertiary color). */
|
|
34
|
+
captionRight?: ReactNode;
|
|
35
|
+
}
|
|
19
36
|
|
|
20
37
|
declare const Cell: react.ForwardRefExoticComponent<CellProps & react.RefAttributes<any>> & {
|
|
21
38
|
Slot: react.ForwardRefExoticComponent<CellSlotProps & react.RefAttributes<any>>;
|
|
22
39
|
Content: react.ForwardRefExoticComponent<CellContentProps & react.RefAttributes<any>>;
|
|
40
|
+
Text: react.ForwardRefExoticComponent<CellTextProps & react.RefAttributes<any>>;
|
|
23
41
|
};
|
|
24
42
|
|
|
25
|
-
export { Cell, type CellContentProps, type CellProps, type CellSlotProps };
|
|
43
|
+
export { Cell, type CellContentProps, type CellProps, type CellSlotProps, type CellTextProps, type CellView };
|
package/web/index.d.ts
CHANGED
|
@@ -2,11 +2,14 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { BoxProps } from '@xsolla/xui-primitives-core';
|
|
4
4
|
|
|
5
|
+
type CellView = "default" | "stroke" | "surface";
|
|
5
6
|
interface CellProps extends BoxProps {
|
|
6
7
|
children?: ReactNode;
|
|
8
|
+
/** Visual variant of the cell container. */
|
|
9
|
+
view?: CellView;
|
|
7
10
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
11
|
+
* @deprecated Use `view="stroke"` instead.
|
|
12
|
+
* If true, applies the "stroke" view style.
|
|
10
13
|
*/
|
|
11
14
|
withBoard?: boolean;
|
|
12
15
|
}
|
|
@@ -16,10 +19,25 @@ interface CellSlotProps extends BoxProps {
|
|
|
16
19
|
interface CellContentProps extends BoxProps {
|
|
17
20
|
children?: ReactNode;
|
|
18
21
|
}
|
|
22
|
+
interface CellTextProps extends BoxProps {
|
|
23
|
+
/** Primary title on the left. */
|
|
24
|
+
title?: ReactNode;
|
|
25
|
+
/** Secondary text on the right of the title row. */
|
|
26
|
+
titleRight?: ReactNode;
|
|
27
|
+
/** Description text on the left (second row). */
|
|
28
|
+
description?: ReactNode;
|
|
29
|
+
/** Description text on the right (second row). */
|
|
30
|
+
descriptionRight?: ReactNode;
|
|
31
|
+
/** Caption text on the left (third row, tertiary color). */
|
|
32
|
+
caption?: ReactNode;
|
|
33
|
+
/** Caption text on the right (third row, tertiary color). */
|
|
34
|
+
captionRight?: ReactNode;
|
|
35
|
+
}
|
|
19
36
|
|
|
20
37
|
declare const Cell: react.ForwardRefExoticComponent<CellProps & react.RefAttributes<any>> & {
|
|
21
38
|
Slot: react.ForwardRefExoticComponent<CellSlotProps & react.RefAttributes<any>>;
|
|
22
39
|
Content: react.ForwardRefExoticComponent<CellContentProps & react.RefAttributes<any>>;
|
|
40
|
+
Text: react.ForwardRefExoticComponent<CellTextProps & react.RefAttributes<any>>;
|
|
23
41
|
};
|
|
24
42
|
|
|
25
|
-
export { Cell, type CellContentProps, type CellProps, type CellSlotProps };
|
|
43
|
+
export { Cell, type CellContentProps, type CellProps, type CellSlotProps, type CellTextProps, type CellView };
|