@xsolla/xui-button 0.127.0 → 0.129.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 +6 -5
- package/native/index.d.ts +6 -5
- package/native/index.js +28 -10
- package/native/index.js.map +1 -1
- package/native/index.mjs +33 -15
- package/native/index.mjs.map +1 -1
- package/package.json +4 -4
- package/web/index.d.mts +6 -5
- package/web/index.d.ts +6 -5
- package/web/index.js +21 -9
- package/web/index.js.map +1 -1
- package/web/index.mjs +26 -14
- package/web/index.mjs.map +1 -1
package/native/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
2
3
|
|
|
3
|
-
interface ButtonProps {
|
|
4
|
+
interface ButtonProps extends ThemeOverrideProps {
|
|
4
5
|
/** Visual variant of the button */
|
|
5
6
|
variant?: "primary" | "secondary" | "tertiary" | "ghost";
|
|
6
7
|
/** Color tone of the button */
|
|
@@ -77,7 +78,7 @@ interface ButtonProps {
|
|
|
77
78
|
*/
|
|
78
79
|
declare const Button: React.FC<ButtonProps>;
|
|
79
80
|
|
|
80
|
-
interface IconButtonProps {
|
|
81
|
+
interface IconButtonProps extends ThemeOverrideProps {
|
|
81
82
|
/** Visual variant of the button */
|
|
82
83
|
variant?: "primary" | "secondary" | "tertiary" | "ghost";
|
|
83
84
|
/** Color tone of the button */
|
|
@@ -156,7 +157,7 @@ interface IconButtonProps {
|
|
|
156
157
|
*/
|
|
157
158
|
declare const IconButton: React.FC<IconButtonProps>;
|
|
158
159
|
|
|
159
|
-
interface FlexButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type"
|
|
160
|
+
interface FlexButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type">, ThemeOverrideProps {
|
|
160
161
|
/** Button content */
|
|
161
162
|
children: ReactNode;
|
|
162
163
|
/** Visual variant of the button */
|
|
@@ -207,7 +208,7 @@ interface FlexButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
207
208
|
*/
|
|
208
209
|
declare const FlexButton: React.FC<FlexButtonProps>;
|
|
209
210
|
|
|
210
|
-
interface AppButtonProps {
|
|
211
|
+
interface AppButtonProps extends ThemeOverrideProps {
|
|
211
212
|
/** Size of the button */
|
|
212
213
|
size?: "xl" | "lg" | "md" | "sm" | "xs";
|
|
213
214
|
/** Whether the button is disabled */
|
|
@@ -259,7 +260,7 @@ interface AppButtonProps {
|
|
|
259
260
|
*/
|
|
260
261
|
declare const AppButton: React.FC<AppButtonProps>;
|
|
261
262
|
|
|
262
|
-
interface ButtonGroupProps {
|
|
263
|
+
interface ButtonGroupProps extends ThemeOverrideProps {
|
|
263
264
|
/**
|
|
264
265
|
* Layout orientation of the buttons
|
|
265
266
|
* @default 'horizontal'
|
package/native/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
2
3
|
|
|
3
|
-
interface ButtonProps {
|
|
4
|
+
interface ButtonProps extends ThemeOverrideProps {
|
|
4
5
|
/** Visual variant of the button */
|
|
5
6
|
variant?: "primary" | "secondary" | "tertiary" | "ghost";
|
|
6
7
|
/** Color tone of the button */
|
|
@@ -77,7 +78,7 @@ interface ButtonProps {
|
|
|
77
78
|
*/
|
|
78
79
|
declare const Button: React.FC<ButtonProps>;
|
|
79
80
|
|
|
80
|
-
interface IconButtonProps {
|
|
81
|
+
interface IconButtonProps extends ThemeOverrideProps {
|
|
81
82
|
/** Visual variant of the button */
|
|
82
83
|
variant?: "primary" | "secondary" | "tertiary" | "ghost";
|
|
83
84
|
/** Color tone of the button */
|
|
@@ -156,7 +157,7 @@ interface IconButtonProps {
|
|
|
156
157
|
*/
|
|
157
158
|
declare const IconButton: React.FC<IconButtonProps>;
|
|
158
159
|
|
|
159
|
-
interface FlexButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type"
|
|
160
|
+
interface FlexButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type">, ThemeOverrideProps {
|
|
160
161
|
/** Button content */
|
|
161
162
|
children: ReactNode;
|
|
162
163
|
/** Visual variant of the button */
|
|
@@ -207,7 +208,7 @@ interface FlexButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
207
208
|
*/
|
|
208
209
|
declare const FlexButton: React.FC<FlexButtonProps>;
|
|
209
210
|
|
|
210
|
-
interface AppButtonProps {
|
|
211
|
+
interface AppButtonProps extends ThemeOverrideProps {
|
|
211
212
|
/** Size of the button */
|
|
212
213
|
size?: "xl" | "lg" | "md" | "sm" | "xs";
|
|
213
214
|
/** Whether the button is disabled */
|
|
@@ -259,7 +260,7 @@ interface AppButtonProps {
|
|
|
259
260
|
*/
|
|
260
261
|
declare const AppButton: React.FC<AppButtonProps>;
|
|
261
262
|
|
|
262
|
-
interface ButtonGroupProps {
|
|
263
|
+
interface ButtonGroupProps extends ThemeOverrideProps {
|
|
263
264
|
/**
|
|
264
265
|
* Layout orientation of the buttons
|
|
265
266
|
* @default 'horizontal'
|
package/native/index.js
CHANGED
|
@@ -84,6 +84,10 @@ var Box = ({
|
|
|
84
84
|
left,
|
|
85
85
|
right,
|
|
86
86
|
width,
|
|
87
|
+
minWidth,
|
|
88
|
+
minHeight,
|
|
89
|
+
maxWidth,
|
|
90
|
+
maxHeight,
|
|
87
91
|
flex,
|
|
88
92
|
overflow,
|
|
89
93
|
zIndex,
|
|
@@ -115,6 +119,10 @@ var Box = ({
|
|
|
115
119
|
zIndex,
|
|
116
120
|
height,
|
|
117
121
|
width,
|
|
122
|
+
minWidth,
|
|
123
|
+
minHeight,
|
|
124
|
+
maxWidth,
|
|
125
|
+
maxHeight,
|
|
118
126
|
padding,
|
|
119
127
|
paddingHorizontal,
|
|
120
128
|
paddingVertical,
|
|
@@ -243,7 +251,7 @@ var Text = ({
|
|
|
243
251
|
}
|
|
244
252
|
const incomingStyle = import_react_native2.StyleSheet.flatten(styleProp);
|
|
245
253
|
const baseStyle = {
|
|
246
|
-
color,
|
|
254
|
+
color: color ?? incomingStyle?.color,
|
|
247
255
|
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
248
256
|
fontWeight,
|
|
249
257
|
fontFamily: resolvedFontFamily,
|
|
@@ -362,9 +370,11 @@ var Button = ({
|
|
|
362
370
|
testID,
|
|
363
371
|
id,
|
|
364
372
|
type = "button",
|
|
365
|
-
fullWidth = false
|
|
373
|
+
fullWidth = false,
|
|
374
|
+
themeMode,
|
|
375
|
+
themeProductContext
|
|
366
376
|
}) => {
|
|
367
|
-
const { theme } = (0, import_xui_core.
|
|
377
|
+
const { theme } = (0, import_xui_core.useResolvedTheme)({ themeMode, themeProductContext });
|
|
368
378
|
const [isKeyboardPressed, setIsKeyboardPressed] = (0, import_react2.useState)(false);
|
|
369
379
|
const isDisabled = disabled || loading;
|
|
370
380
|
const sizeStyles = theme.sizing.button(size);
|
|
@@ -586,9 +596,11 @@ var IconButton = ({
|
|
|
586
596
|
"aria-controls": ariaControls,
|
|
587
597
|
testID,
|
|
588
598
|
id,
|
|
589
|
-
type = "button"
|
|
599
|
+
type = "button",
|
|
600
|
+
themeMode,
|
|
601
|
+
themeProductContext
|
|
590
602
|
}) => {
|
|
591
|
-
const { theme } = (0, import_xui_core2.
|
|
603
|
+
const { theme } = (0, import_xui_core2.useResolvedTheme)({ themeMode, themeProductContext });
|
|
592
604
|
const [isKeyboardPressed, setIsKeyboardPressed] = (0, import_react3.useState)(false);
|
|
593
605
|
const isDisabled = disabled || loading;
|
|
594
606
|
const sizeStyles = theme.sizing.button(size);
|
|
@@ -783,9 +795,11 @@ var FlexButton = ({
|
|
|
783
795
|
"aria-controls": ariaControls,
|
|
784
796
|
testID,
|
|
785
797
|
tabIndex = 0,
|
|
798
|
+
themeMode,
|
|
799
|
+
themeProductContext,
|
|
786
800
|
...buttonProps
|
|
787
801
|
}) => {
|
|
788
|
-
const { theme } = (0, import_xui_core3.
|
|
802
|
+
const { theme } = (0, import_xui_core3.useResolvedTheme)({ themeMode, themeProductContext });
|
|
789
803
|
const [state, setState] = (0, import_react4.useState)("default");
|
|
790
804
|
const [isFocused, setIsFocused] = (0, import_react4.useState)(false);
|
|
791
805
|
const isMouseOverRef = (0, import_react4.useRef)(false);
|
|
@@ -1093,9 +1107,11 @@ var AppButton = ({
|
|
|
1093
1107
|
testID,
|
|
1094
1108
|
id,
|
|
1095
1109
|
type = "button",
|
|
1096
|
-
fullWidth = false
|
|
1110
|
+
fullWidth = false,
|
|
1111
|
+
themeMode,
|
|
1112
|
+
themeProductContext
|
|
1097
1113
|
}) => {
|
|
1098
|
-
const { theme } = (0, import_xui_core4.
|
|
1114
|
+
const { theme } = (0, import_xui_core4.useResolvedTheme)({ themeMode, themeProductContext });
|
|
1099
1115
|
const [isKeyboardPressed, setIsKeyboardPressed] = (0, import_react5.useState)(false);
|
|
1100
1116
|
const isDisabled = disabled || loading;
|
|
1101
1117
|
const sizeStyles = theme.sizing.button(size);
|
|
@@ -1294,9 +1310,11 @@ var ButtonGroup = ({
|
|
|
1294
1310
|
"aria-labelledby": ariaLabelledBy,
|
|
1295
1311
|
"aria-describedby": ariaDescribedBy,
|
|
1296
1312
|
id,
|
|
1297
|
-
testID
|
|
1313
|
+
testID,
|
|
1314
|
+
themeMode,
|
|
1315
|
+
themeProductContext
|
|
1298
1316
|
}) => {
|
|
1299
|
-
const { theme } = (0, import_xui_core5.
|
|
1317
|
+
const { theme } = (0, import_xui_core5.useResolvedTheme)({ themeMode, themeProductContext });
|
|
1300
1318
|
const flattenChildren = (children2) => {
|
|
1301
1319
|
const result = [];
|
|
1302
1320
|
import_react6.default.Children.forEach(children2, (child) => {
|