@xaui/native 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -113
- package/dist/alert/index.cjs +6 -9
- package/dist/alert/index.js +4 -7
- package/dist/app-bar/index.cjs +4 -4
- package/dist/app-bar/index.js +2 -2
- package/dist/autocomplete/index.cjs +20 -25
- package/dist/autocomplete/index.d.cts +1 -1
- package/dist/autocomplete/index.d.ts +1 -1
- package/dist/autocomplete/index.js +11 -16
- package/dist/avatar/index.cjs +9 -9
- package/dist/avatar/index.js +5 -5
- package/dist/badge/index.cjs +13 -14
- package/dist/badge/index.js +10 -11
- package/dist/bottom-sheet/index.cjs +3 -3
- package/dist/bottom-sheet/index.js +2 -2
- package/dist/bottom-tab-bar/index.cjs +2 -2
- package/dist/bottom-tab-bar/index.js +1 -1
- package/dist/button/index.cjs +19 -22
- package/dist/button/index.d.cts +3 -3
- package/dist/button/index.d.ts +3 -3
- package/dist/button/index.js +12 -15
- package/dist/card/index.cjs +8 -8
- package/dist/card/index.js +3 -3
- package/dist/carousel/index.cjs +2 -2
- package/dist/carousel/index.js +1 -1
- package/dist/checkbox/index.cjs +11 -11
- package/dist/checkbox/index.js +6 -6
- package/dist/chip/index.cjs +11 -11
- package/dist/chip/index.js +9 -9
- package/dist/{chunk-K24VDBNN.js → chunk-4JFWQ5XT.js} +2 -2
- package/dist/{chunk-RZJFCDFS.cjs → chunk-7UFBLUMV.cjs} +13 -19
- package/dist/{chunk-M6A23KUM.js → chunk-A45TVXU5.js} +29 -5
- package/dist/{chunk-3XWF77Y3.cjs → chunk-BYWUAPC4.cjs} +4 -4
- package/dist/{chunk-X5KNZ6YJ.cjs → chunk-DJ4Q37UT.cjs} +2 -2
- package/dist/{chunk-LVNBYERF.js → chunk-RBSA4NH4.js} +13 -19
- package/dist/{chunk-HYL4EU3Y.cjs → chunk-UGEINZM7.cjs} +14 -13
- package/dist/{chunk-WGWXGIZ3.js → chunk-UU4HHBDN.js} +10 -9
- package/dist/{chunk-J3BOFXIH.js → chunk-VSZEXOUN.js} +4 -4
- package/dist/{chunk-FBTBWI3P.cjs → chunk-YIEUN3G5.cjs} +7 -7
- package/dist/{chunk-43I45LX7.cjs → chunk-ZH6ZSV2Q.cjs} +33 -9
- package/dist/{chunk-2JKWVIPB.js → chunk-ZY7IUTAT.js} +1 -1
- package/dist/color-picker/index.cjs +7 -7
- package/dist/color-picker/index.d.cts +1 -1
- package/dist/color-picker/index.d.ts +1 -1
- package/dist/color-picker/index.js +4 -4
- package/dist/core/index.cjs +2 -2
- package/dist/core/index.d.cts +1 -2
- package/dist/core/index.d.ts +1 -2
- package/dist/core/index.js +1 -1
- package/dist/datepicker/index.cjs +28 -30
- package/dist/datepicker/index.d.cts +1 -1
- package/dist/datepicker/index.d.ts +1 -1
- package/dist/datepicker/index.js +17 -19
- package/dist/dialog/index.cjs +5 -5
- package/dist/dialog/index.js +1 -1
- package/dist/divider/index.cjs +3 -3
- package/dist/divider/index.js +2 -2
- package/dist/drawer/index.cjs +4 -4
- package/dist/drawer/index.js +3 -3
- package/dist/expansion-panel/index.cjs +12 -12
- package/dist/expansion-panel/index.js +3 -3
- package/dist/fab/index.cjs +4 -4
- package/dist/fab/index.js +3 -3
- package/dist/fab-menu/index.cjs +8 -8
- package/dist/fab-menu/index.js +4 -4
- package/dist/feature-discovery/index.cjs +6 -6
- package/dist/feature-discovery/index.js +5 -5
- package/dist/indicator/index.cjs +3 -3
- package/dist/indicator/index.js +2 -2
- package/dist/input/index.cjs +38 -20
- package/dist/input/index.d.cts +2 -2
- package/dist/input/index.d.ts +2 -2
- package/dist/input/index.js +36 -18
- package/dist/input-trigger/index.cjs +193 -4
- package/dist/input-trigger/index.d.cts +5 -3
- package/dist/input-trigger/index.d.ts +5 -3
- package/dist/input-trigger/index.js +192 -3
- package/dist/{input-trigger.type-BL70fHE9.d.cts → input-trigger.type-By_1ZjKd.d.cts} +86 -3
- package/dist/{input-trigger.type-BODYStHk.d.ts → input-trigger.type-DlSqg2eG.d.ts} +86 -3
- package/dist/list/index.cjs +6 -6
- package/dist/list/index.js +2 -2
- package/dist/menu/index.cjs +4 -4
- package/dist/menu/index.js +2 -2
- package/dist/menubox/index.cjs +7 -7
- package/dist/menubox/index.d.cts +1 -1
- package/dist/menubox/index.d.ts +1 -1
- package/dist/menubox/index.js +3 -3
- package/dist/picker/index.cjs +7 -7
- package/dist/picker/index.d.cts +1 -1
- package/dist/picker/index.d.ts +1 -1
- package/dist/picker/index.js +4 -4
- package/dist/progress/index.cjs +3 -3
- package/dist/progress/index.js +2 -2
- package/dist/radio/index.cjs +9 -9
- package/dist/radio/index.js +3 -3
- package/dist/refresh-control/index.cjs +45 -0
- package/dist/refresh-control/index.d.cts +55 -0
- package/dist/refresh-control/index.d.ts +55 -0
- package/dist/refresh-control/index.js +45 -0
- package/dist/segment-button/index.cjs +8 -8
- package/dist/segment-button/index.js +5 -5
- package/dist/select/index.cjs +50 -58
- package/dist/select/index.d.cts +2 -2
- package/dist/select/index.d.ts +2 -2
- package/dist/select/index.js +37 -45
- package/dist/skeleton/index.cjs +4 -4
- package/dist/skeleton/index.js +3 -3
- package/dist/slider/index.cjs +5 -5
- package/dist/slider/index.js +1 -1
- package/dist/snackbar/index.cjs +6 -6
- package/dist/snackbar/index.js +4 -4
- package/dist/snippet/index.cjs +4 -4
- package/dist/snippet/index.js +2 -2
- package/dist/stepper/index.cjs +3 -3
- package/dist/stepper/index.js +2 -2
- package/dist/switch/index.cjs +8 -8
- package/dist/switch/index.js +2 -2
- package/dist/tabs/index.cjs +7 -7
- package/dist/tabs/index.js +4 -4
- package/dist/timepicker/index.cjs +7 -7
- package/dist/timepicker/index.js +4 -4
- package/dist/toolbar/index.cjs +3 -3
- package/dist/toolbar/index.js +2 -2
- package/dist/typography/index.cjs +5 -3
- package/dist/typography/index.d.cts +4 -0
- package/dist/typography/index.d.ts +4 -0
- package/dist/typography/index.js +3 -1
- package/dist/view/index.cjs +4 -4
- package/dist/view/index.js +2 -2
- package/package.json +8 -3
package/dist/fab-menu/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var _chunkUGEINZM7cjs = require('../chunk-UGEINZM7.cjs');
|
|
4
|
+
require('../chunk-YIEUN3G5.cjs');
|
|
5
5
|
require('../chunk-56RPWZD2.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk7UFBLUMVcjs = require('../chunk-7UFBLUMV.cjs');
|
|
10
10
|
|
|
11
11
|
// src/components/fab-menu/fab-menu.tsx
|
|
12
12
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
@@ -80,12 +80,12 @@ function useFabMenuState(controlledExpanded, onToggle) {
|
|
|
80
80
|
return { expanded, toggle, close };
|
|
81
81
|
}
|
|
82
82
|
function useFabMenuItemStyles(themeColor) {
|
|
83
|
-
const theme =
|
|
83
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
84
84
|
const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
|
|
85
85
|
const colorScheme = theme.colors[safeThemeColor];
|
|
86
86
|
const itemStyles = _react.useMemo.call(void 0, () => {
|
|
87
87
|
const chipStyles = {
|
|
88
|
-
backgroundColor: colorScheme.
|
|
88
|
+
backgroundColor: colorScheme.container,
|
|
89
89
|
borderRadius: theme.borderRadius.full,
|
|
90
90
|
color: colorScheme.main,
|
|
91
91
|
fontSize: theme.fontSizes.md
|
|
@@ -96,7 +96,7 @@ function useFabMenuItemStyles(themeColor) {
|
|
|
96
96
|
return itemStyles;
|
|
97
97
|
}
|
|
98
98
|
function useFabMenuOverlayColor() {
|
|
99
|
-
const theme =
|
|
99
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
100
100
|
return _react.useMemo.call(void 0, () => {
|
|
101
101
|
return theme.mode === "dark" ? "rgba(0, 0, 0, 0.5)" : "rgba(0, 0, 0, 0.3)";
|
|
102
102
|
}, [theme.mode]);
|
|
@@ -209,7 +209,7 @@ var FabMenu = ({
|
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
211
|
/* @__PURE__ */ _react2.default.createElement(
|
|
212
|
-
|
|
212
|
+
_chunkUGEINZM7cjs.Fab,
|
|
213
213
|
{
|
|
214
214
|
icon: currentIcon,
|
|
215
215
|
label,
|
|
@@ -259,7 +259,7 @@ var FabMenu = ({
|
|
|
259
259
|
})
|
|
260
260
|
);
|
|
261
261
|
}));
|
|
262
|
-
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.container, _optionalChain([customAppearance, 'optionalAccess', _11 => _11.container])] }, isPortalVisible && /* @__PURE__ */ _react2.default.createElement(
|
|
262
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.container, _optionalChain([customAppearance, 'optionalAccess', _11 => _11.container])] }, isPortalVisible && /* @__PURE__ */ _react2.default.createElement(_chunk7UFBLUMVcjs.Portal, null, /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.portalRoot }, showOverlay && /* @__PURE__ */ _react2.default.createElement(
|
|
263
263
|
_reactnative.Animated.View,
|
|
264
264
|
{
|
|
265
265
|
style: [
|
package/dist/fab-menu/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Fab
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-UU4HHBDN.js";
|
|
4
|
+
import "../chunk-VSZEXOUN.js";
|
|
5
5
|
import "../chunk-SHBDANQN.js";
|
|
6
6
|
import {
|
|
7
7
|
Portal,
|
|
8
8
|
useXUITheme
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-RBSA4NH4.js";
|
|
10
10
|
|
|
11
11
|
// src/components/fab-menu/fab-menu.tsx
|
|
12
12
|
import React from "react";
|
|
@@ -85,7 +85,7 @@ function useFabMenuItemStyles(themeColor) {
|
|
|
85
85
|
const colorScheme = theme.colors[safeThemeColor];
|
|
86
86
|
const itemStyles = useMemo(() => {
|
|
87
87
|
const chipStyles = {
|
|
88
|
-
backgroundColor: colorScheme.
|
|
88
|
+
backgroundColor: colorScheme.container,
|
|
89
89
|
borderRadius: theme.borderRadius.full,
|
|
90
90
|
color: colorScheme.main,
|
|
91
91
|
fontSize: theme.fontSizes.md
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('../chunk-56RPWZD2.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk7UFBLUMVcjs = require('../chunk-7UFBLUMV.cjs');
|
|
5
5
|
|
|
6
6
|
// src/components/feature-discovery/feature-discovery.tsx
|
|
7
7
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
@@ -235,7 +235,7 @@ var useFeatureDiscoveryGeometry = (target, viewportWidth, viewportHeight, spotli
|
|
|
235
235
|
};
|
|
236
236
|
};
|
|
237
237
|
var useFeatureDiscoveryTheme = (themeColor, overlayColor) => {
|
|
238
|
-
const theme =
|
|
238
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
239
239
|
const colorScheme = theme.colors[_core.getSafeThemeColor.call(void 0, themeColor)];
|
|
240
240
|
const resolvedOverlayColor = _react.useMemo.call(void 0,
|
|
241
241
|
() => _nullishCoalesce(overlayColor, () => ( _core.withOpacity.call(void 0, theme.colors.foreground, 0.42))),
|
|
@@ -421,7 +421,7 @@ var FeatureDiscovery = ({
|
|
|
421
421
|
},
|
|
422
422
|
/* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.messageHeader }, /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.messageTitleWrapper }, renderContent(title, [
|
|
423
423
|
styles.title,
|
|
424
|
-
{ color: colorScheme.
|
|
424
|
+
{ color: colorScheme.onMain },
|
|
425
425
|
{ textAlign: isTargetOnLeft ? "left" : "right" },
|
|
426
426
|
_optionalChain([customAppearance, 'optionalAccess', _8 => _8.title])
|
|
427
427
|
])), /* @__PURE__ */ _react2.default.createElement(
|
|
@@ -431,11 +431,11 @@ var FeatureDiscovery = ({
|
|
|
431
431
|
style: styles.closeButton,
|
|
432
432
|
accessibilityRole: "button"
|
|
433
433
|
},
|
|
434
|
-
/* @__PURE__ */ _react2.default.createElement(_reactnative.Text, { style: [styles.closeIcon, { color: colorScheme.
|
|
434
|
+
/* @__PURE__ */ _react2.default.createElement(_reactnative.Text, { style: [styles.closeIcon, { color: colorScheme.onMain }] }, "\u2715")
|
|
435
435
|
)),
|
|
436
436
|
description ? renderContent(description, [
|
|
437
437
|
styles.description,
|
|
438
|
-
{ color: _core.withOpacity.call(void 0, colorScheme.
|
|
438
|
+
{ color: _core.withOpacity.call(void 0, colorScheme.onMain, 0.9) },
|
|
439
439
|
{ textAlign: isTargetOnLeft ? "left" : "right" },
|
|
440
440
|
_optionalChain([customAppearance, 'optionalAccess', _9 => _9.description])
|
|
441
441
|
]) : null,
|
|
@@ -451,7 +451,7 @@ var FeatureDiscovery = ({
|
|
|
451
451
|
},
|
|
452
452
|
renderContent(actionText, [
|
|
453
453
|
styles.actionText,
|
|
454
|
-
{ color: colorScheme.
|
|
454
|
+
{ color: colorScheme.onMain },
|
|
455
455
|
_optionalChain([customAppearance, 'optionalAccess', _10 => _10.actionText])
|
|
456
456
|
])
|
|
457
457
|
) : null
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-SHBDANQN.js";
|
|
2
2
|
import {
|
|
3
3
|
useXUITheme
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-RBSA4NH4.js";
|
|
5
5
|
|
|
6
6
|
// src/components/feature-discovery/feature-discovery.tsx
|
|
7
7
|
import React, { useEffect } from "react";
|
|
@@ -421,7 +421,7 @@ var FeatureDiscovery = ({
|
|
|
421
421
|
},
|
|
422
422
|
/* @__PURE__ */ React.createElement(View, { style: styles.messageHeader }, /* @__PURE__ */ React.createElement(View, { style: styles.messageTitleWrapper }, renderContent(title, [
|
|
423
423
|
styles.title,
|
|
424
|
-
{ color: colorScheme.
|
|
424
|
+
{ color: colorScheme.onMain },
|
|
425
425
|
{ textAlign: isTargetOnLeft ? "left" : "right" },
|
|
426
426
|
customAppearance?.title
|
|
427
427
|
])), /* @__PURE__ */ React.createElement(
|
|
@@ -431,11 +431,11 @@ var FeatureDiscovery = ({
|
|
|
431
431
|
style: styles.closeButton,
|
|
432
432
|
accessibilityRole: "button"
|
|
433
433
|
},
|
|
434
|
-
/* @__PURE__ */ React.createElement(Text, { style: [styles.closeIcon, { color: colorScheme.
|
|
434
|
+
/* @__PURE__ */ React.createElement(Text, { style: [styles.closeIcon, { color: colorScheme.onMain }] }, "\u2715")
|
|
435
435
|
)),
|
|
436
436
|
description ? renderContent(description, [
|
|
437
437
|
styles.description,
|
|
438
|
-
{ color: withOpacity2(colorScheme.
|
|
438
|
+
{ color: withOpacity2(colorScheme.onMain, 0.9) },
|
|
439
439
|
{ textAlign: isTargetOnLeft ? "left" : "right" },
|
|
440
440
|
customAppearance?.description
|
|
441
441
|
]) : null,
|
|
@@ -451,7 +451,7 @@ var FeatureDiscovery = ({
|
|
|
451
451
|
},
|
|
452
452
|
renderContent(actionText, [
|
|
453
453
|
styles.actionText,
|
|
454
|
-
{ color: colorScheme.
|
|
454
|
+
{ color: colorScheme.onMain },
|
|
455
455
|
customAppearance?.actionText
|
|
456
456
|
])
|
|
457
457
|
) : null
|
package/dist/indicator/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYIEUN3G5cjs = require('../chunk-YIEUN3G5.cjs');
|
|
4
4
|
require('../chunk-56RPWZD2.cjs');
|
|
5
|
-
require('../chunk-
|
|
5
|
+
require('../chunk-7UFBLUMV.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.ActivityIndicator =
|
|
8
|
+
exports.ActivityIndicator = _chunkYIEUN3G5cjs.ActivityIndicator;
|
package/dist/indicator/index.js
CHANGED
package/dist/input/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('../chunk-56RPWZD2.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk7UFBLUMVcjs = require('../chunk-7UFBLUMV.cjs');
|
|
5
5
|
|
|
6
6
|
// src/components/input/input.tsx
|
|
7
7
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
@@ -18,7 +18,7 @@ var _icons = require('@xaui/icons');
|
|
|
18
18
|
|
|
19
19
|
var _core = require('@xaui/core');
|
|
20
20
|
var useTextInputSizeStyles = (size) => {
|
|
21
|
-
const theme =
|
|
21
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
22
22
|
return _react.useMemo.call(void 0, () => {
|
|
23
23
|
const sizeMap = {
|
|
24
24
|
sm: {
|
|
@@ -53,7 +53,7 @@ var useTextInputSizeStyles = (size) => {
|
|
|
53
53
|
}, [size, theme]);
|
|
54
54
|
};
|
|
55
55
|
var useTextInputRadiusStyles = (radius) => {
|
|
56
|
-
const theme =
|
|
56
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
57
57
|
return _react.useMemo.call(void 0, () => {
|
|
58
58
|
if (radius === "full") {
|
|
59
59
|
return { borderRadius: theme.borderRadius.full };
|
|
@@ -68,7 +68,7 @@ var useTextInputVariantStyles = ({
|
|
|
68
68
|
isInvalid,
|
|
69
69
|
isDisabled
|
|
70
70
|
}) => {
|
|
71
|
-
const theme =
|
|
71
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
72
72
|
const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
|
|
73
73
|
const colorScheme = theme.colors[safeThemeColor];
|
|
74
74
|
return _react.useMemo.call(void 0, () => {
|
|
@@ -108,10 +108,9 @@ var useTextInputVariantStyles = ({
|
|
|
108
108
|
helperColor
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
if (variant === "
|
|
111
|
+
if (variant === "light") {
|
|
112
112
|
return {
|
|
113
113
|
container: {
|
|
114
|
-
backgroundColor: _core.withOpacity.call(void 0, colorScheme.background, 0.68),
|
|
115
114
|
borderColor: isFocused || isInvalid ? focusColor : "transparent",
|
|
116
115
|
borderWidth: isFocused || isInvalid ? theme.borderWidth.md : 0
|
|
117
116
|
},
|
|
@@ -125,7 +124,7 @@ var useTextInputVariantStyles = ({
|
|
|
125
124
|
}
|
|
126
125
|
return {
|
|
127
126
|
container: {
|
|
128
|
-
backgroundColor: colorScheme.
|
|
127
|
+
backgroundColor: _core.withOpacity.call(void 0, colorScheme.container, 0.5),
|
|
129
128
|
borderColor: isFocused || isInvalid ? _core.withPaletteNumber.call(void 0, focusColor, 500) : "transparent",
|
|
130
129
|
borderWidth: isFocused || isInvalid ? theme.borderWidth.md : 0
|
|
131
130
|
},
|
|
@@ -202,7 +201,7 @@ var TextInput = _react.forwardRef.call(void 0,
|
|
|
202
201
|
startContent,
|
|
203
202
|
endContent,
|
|
204
203
|
themeColor = "primary",
|
|
205
|
-
variant = "
|
|
204
|
+
variant = "colored",
|
|
206
205
|
size = "md",
|
|
207
206
|
radius = "md",
|
|
208
207
|
isSecured = false,
|
|
@@ -810,6 +809,7 @@ DateTimeInput.displayName = "DateTimeInput";
|
|
|
810
809
|
|
|
811
810
|
|
|
812
811
|
|
|
812
|
+
|
|
813
813
|
// src/components/input/otp-input.hook.ts
|
|
814
814
|
|
|
815
815
|
var segmentSizeMap = {
|
|
@@ -933,6 +933,12 @@ var otpStyles = _reactnative.StyleSheet.create({
|
|
|
933
933
|
height: 1,
|
|
934
934
|
opacity: 0
|
|
935
935
|
},
|
|
936
|
+
underline: {
|
|
937
|
+
position: "absolute",
|
|
938
|
+
left: 0,
|
|
939
|
+
right: 0,
|
|
940
|
+
bottom: 0
|
|
941
|
+
},
|
|
936
942
|
label: {
|
|
937
943
|
fontWeight: "500"
|
|
938
944
|
},
|
|
@@ -963,6 +969,7 @@ var OTPSegment = ({
|
|
|
963
969
|
onPress
|
|
964
970
|
}) => {
|
|
965
971
|
const borderAnimation = _react.useRef.call(void 0, new _reactnative.Animated.Value(0)).current;
|
|
972
|
+
const isUnderlined = variantStyles.container.borderBottomWidth !== void 0;
|
|
966
973
|
_react.useEffect.call(void 0, () => {
|
|
967
974
|
_reactnative.Animated.timing(borderAnimation, {
|
|
968
975
|
toValue: isActive ? 1 : 0,
|
|
@@ -970,6 +977,11 @@ var OTPSegment = ({
|
|
|
970
977
|
useNativeDriver: false
|
|
971
978
|
}).start();
|
|
972
979
|
}, [borderAnimation, isActive]);
|
|
980
|
+
const unfocusedLineColor = isUnderlined ? _core.withOpacity.call(void 0, variantStyles.focusedBorderColor, 0.35) : variantStyles.unfocusedBorderColor;
|
|
981
|
+
const animatedBorderColor = borderAnimation.interpolate({
|
|
982
|
+
inputRange: [0, 1],
|
|
983
|
+
outputRange: [unfocusedLineColor, variantStyles.focusedBorderColor]
|
|
984
|
+
});
|
|
973
985
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
974
986
|
_reactnative.Pressable,
|
|
975
987
|
{
|
|
@@ -989,15 +1001,9 @@ var OTPSegment = ({
|
|
|
989
1001
|
width: sizeStyles.width,
|
|
990
1002
|
height: sizeStyles.height,
|
|
991
1003
|
backgroundColor: variantStyles.container.backgroundColor,
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
borderColor:
|
|
995
|
-
inputRange: [0, 1],
|
|
996
|
-
outputRange: [
|
|
997
|
-
variantStyles.unfocusedBorderColor,
|
|
998
|
-
variantStyles.focusedBorderColor
|
|
999
|
-
]
|
|
1000
|
-
})
|
|
1004
|
+
borderRadius: isUnderlined ? 0 : radiusStyles.borderRadius,
|
|
1005
|
+
borderWidth: isUnderlined ? 0 : _nullishCoalesce(variantStyles.container.borderWidth, () => ( 0)),
|
|
1006
|
+
borderColor: isUnderlined ? void 0 : animatedBorderColor
|
|
1001
1007
|
},
|
|
1002
1008
|
_optionalChain([customSegment, 'optionalAccess', _37 => _37.segment])
|
|
1003
1009
|
]
|
|
@@ -1039,6 +1045,18 @@ var OTPSegment = ({
|
|
|
1039
1045
|
editable: !isDisabled,
|
|
1040
1046
|
caretHidden: true
|
|
1041
1047
|
}
|
|
1048
|
+
),
|
|
1049
|
+
isUnderlined && /* @__PURE__ */ _react2.default.createElement(
|
|
1050
|
+
_reactnative.Animated.View,
|
|
1051
|
+
{
|
|
1052
|
+
style: [
|
|
1053
|
+
otpStyles.underline,
|
|
1054
|
+
{
|
|
1055
|
+
height: _nullishCoalesce(variantStyles.container.borderBottomWidth, () => ( 1)),
|
|
1056
|
+
backgroundColor: animatedBorderColor
|
|
1057
|
+
}
|
|
1058
|
+
]
|
|
1059
|
+
}
|
|
1042
1060
|
)
|
|
1043
1061
|
)
|
|
1044
1062
|
);
|
|
@@ -1049,7 +1067,7 @@ var OTPInput = ({
|
|
|
1049
1067
|
defaultValue,
|
|
1050
1068
|
onValueChange,
|
|
1051
1069
|
onComplete,
|
|
1052
|
-
variant = "
|
|
1070
|
+
variant = "colored",
|
|
1053
1071
|
size = "md",
|
|
1054
1072
|
radius = "md",
|
|
1055
1073
|
themeColor = "primary",
|
|
@@ -1326,7 +1344,7 @@ var NumberInput = _react.forwardRef.call(void 0,
|
|
|
1326
1344
|
errorMessage,
|
|
1327
1345
|
placeholder,
|
|
1328
1346
|
themeColor = "primary",
|
|
1329
|
-
variant = "
|
|
1347
|
+
variant = "colored",
|
|
1330
1348
|
size = "md",
|
|
1331
1349
|
radius = "md",
|
|
1332
1350
|
isDisabled = false,
|
|
@@ -1336,7 +1354,7 @@ var NumberInput = _react.forwardRef.call(void 0,
|
|
|
1336
1354
|
fullWidth = true,
|
|
1337
1355
|
customAppearance
|
|
1338
1356
|
}, ref) => {
|
|
1339
|
-
const theme =
|
|
1357
|
+
const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
|
|
1340
1358
|
const {
|
|
1341
1359
|
displayValue,
|
|
1342
1360
|
handleTextChange,
|
package/dist/input/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ import React, { ReactNode } from 'react';
|
|
|
3
3
|
import * as react_native from 'react-native';
|
|
4
4
|
import { StyleProp, ViewStyle, TextStyle, TextInputProps as TextInputProps$1, TextInput as TextInput$1 } from 'react-native';
|
|
5
5
|
|
|
6
|
-
type TextInputVariant = '
|
|
6
|
+
type TextInputVariant = 'colored' | 'light' | 'bordered' | 'underlined';
|
|
7
7
|
type TextInputSize = 'sm' | 'md' | 'lg';
|
|
8
8
|
type TextInputLabelPlacement = 'outside' | 'inside';
|
|
9
9
|
type TextInputCustomAppearance = {
|
|
@@ -59,7 +59,7 @@ type TextInputProps = Omit<TextInputProps$1, 'value' | 'defaultValue' | 'style'>
|
|
|
59
59
|
themeColor?: ThemeColor;
|
|
60
60
|
/**
|
|
61
61
|
* Visual style variant.
|
|
62
|
-
* @default '
|
|
62
|
+
* @default 'colored'
|
|
63
63
|
*/
|
|
64
64
|
variant?: TextInputVariant;
|
|
65
65
|
/**
|
package/dist/input/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import React, { ReactNode } from 'react';
|
|
|
3
3
|
import * as react_native from 'react-native';
|
|
4
4
|
import { StyleProp, ViewStyle, TextStyle, TextInputProps as TextInputProps$1, TextInput as TextInput$1 } from 'react-native';
|
|
5
5
|
|
|
6
|
-
type TextInputVariant = '
|
|
6
|
+
type TextInputVariant = 'colored' | 'light' | 'bordered' | 'underlined';
|
|
7
7
|
type TextInputSize = 'sm' | 'md' | 'lg';
|
|
8
8
|
type TextInputLabelPlacement = 'outside' | 'inside';
|
|
9
9
|
type TextInputCustomAppearance = {
|
|
@@ -59,7 +59,7 @@ type TextInputProps = Omit<TextInputProps$1, 'value' | 'defaultValue' | 'style'>
|
|
|
59
59
|
themeColor?: ThemeColor;
|
|
60
60
|
/**
|
|
61
61
|
* Visual style variant.
|
|
62
|
-
* @default '
|
|
62
|
+
* @default 'colored'
|
|
63
63
|
*/
|
|
64
64
|
variant?: TextInputVariant;
|
|
65
65
|
/**
|
package/dist/input/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-SHBDANQN.js";
|
|
2
2
|
import {
|
|
3
3
|
useXUITheme
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-RBSA4NH4.js";
|
|
5
5
|
|
|
6
6
|
// src/components/input/input.tsx
|
|
7
7
|
import React, { forwardRef, useMemo as useMemo2, useState, useRef, useEffect } from "react";
|
|
@@ -108,10 +108,9 @@ var useTextInputVariantStyles = ({
|
|
|
108
108
|
helperColor
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
if (variant === "
|
|
111
|
+
if (variant === "light") {
|
|
112
112
|
return {
|
|
113
113
|
container: {
|
|
114
|
-
backgroundColor: withOpacity(colorScheme.background, 0.68),
|
|
115
114
|
borderColor: isFocused || isInvalid ? focusColor : "transparent",
|
|
116
115
|
borderWidth: isFocused || isInvalid ? theme.borderWidth.md : 0
|
|
117
116
|
},
|
|
@@ -125,7 +124,7 @@ var useTextInputVariantStyles = ({
|
|
|
125
124
|
}
|
|
126
125
|
return {
|
|
127
126
|
container: {
|
|
128
|
-
backgroundColor: colorScheme.
|
|
127
|
+
backgroundColor: withOpacity(colorScheme.container, 0.5),
|
|
129
128
|
borderColor: isFocused || isInvalid ? withPaletteNumber(focusColor, 500) : "transparent",
|
|
130
129
|
borderWidth: isFocused || isInvalid ? theme.borderWidth.md : 0
|
|
131
130
|
},
|
|
@@ -202,7 +201,7 @@ var TextInput = forwardRef(
|
|
|
202
201
|
startContent,
|
|
203
202
|
endContent,
|
|
204
203
|
themeColor = "primary",
|
|
205
|
-
variant = "
|
|
204
|
+
variant = "colored",
|
|
206
205
|
size = "md",
|
|
207
206
|
radius = "md",
|
|
208
207
|
isSecured = false,
|
|
@@ -809,6 +808,7 @@ import {
|
|
|
809
808
|
TextInput as RNTextInput2,
|
|
810
809
|
View as View2
|
|
811
810
|
} from "react-native";
|
|
811
|
+
import { withOpacity as withOpacity2 } from "@xaui/core";
|
|
812
812
|
|
|
813
813
|
// src/components/input/otp-input.hook.ts
|
|
814
814
|
import { useCallback as useCallback2, useMemo as useMemo4, useRef as useRef2, useState as useState2 } from "react";
|
|
@@ -933,6 +933,12 @@ var otpStyles = StyleSheet3.create({
|
|
|
933
933
|
height: 1,
|
|
934
934
|
opacity: 0
|
|
935
935
|
},
|
|
936
|
+
underline: {
|
|
937
|
+
position: "absolute",
|
|
938
|
+
left: 0,
|
|
939
|
+
right: 0,
|
|
940
|
+
bottom: 0
|
|
941
|
+
},
|
|
936
942
|
label: {
|
|
937
943
|
fontWeight: "500"
|
|
938
944
|
},
|
|
@@ -963,6 +969,7 @@ var OTPSegment = ({
|
|
|
963
969
|
onPress
|
|
964
970
|
}) => {
|
|
965
971
|
const borderAnimation = useRef3(new Animated2.Value(0)).current;
|
|
972
|
+
const isUnderlined = variantStyles.container.borderBottomWidth !== void 0;
|
|
966
973
|
useEffect2(() => {
|
|
967
974
|
Animated2.timing(borderAnimation, {
|
|
968
975
|
toValue: isActive ? 1 : 0,
|
|
@@ -970,6 +977,11 @@ var OTPSegment = ({
|
|
|
970
977
|
useNativeDriver: false
|
|
971
978
|
}).start();
|
|
972
979
|
}, [borderAnimation, isActive]);
|
|
980
|
+
const unfocusedLineColor = isUnderlined ? withOpacity2(variantStyles.focusedBorderColor, 0.35) : variantStyles.unfocusedBorderColor;
|
|
981
|
+
const animatedBorderColor = borderAnimation.interpolate({
|
|
982
|
+
inputRange: [0, 1],
|
|
983
|
+
outputRange: [unfocusedLineColor, variantStyles.focusedBorderColor]
|
|
984
|
+
});
|
|
973
985
|
return /* @__PURE__ */ React4.createElement(
|
|
974
986
|
Pressable2,
|
|
975
987
|
{
|
|
@@ -989,15 +1001,9 @@ var OTPSegment = ({
|
|
|
989
1001
|
width: sizeStyles.width,
|
|
990
1002
|
height: sizeStyles.height,
|
|
991
1003
|
backgroundColor: variantStyles.container.backgroundColor,
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
borderColor:
|
|
995
|
-
inputRange: [0, 1],
|
|
996
|
-
outputRange: [
|
|
997
|
-
variantStyles.unfocusedBorderColor,
|
|
998
|
-
variantStyles.focusedBorderColor
|
|
999
|
-
]
|
|
1000
|
-
})
|
|
1004
|
+
borderRadius: isUnderlined ? 0 : radiusStyles.borderRadius,
|
|
1005
|
+
borderWidth: isUnderlined ? 0 : variantStyles.container.borderWidth ?? 0,
|
|
1006
|
+
borderColor: isUnderlined ? void 0 : animatedBorderColor
|
|
1001
1007
|
},
|
|
1002
1008
|
customSegment?.segment
|
|
1003
1009
|
]
|
|
@@ -1039,6 +1045,18 @@ var OTPSegment = ({
|
|
|
1039
1045
|
editable: !isDisabled,
|
|
1040
1046
|
caretHidden: true
|
|
1041
1047
|
}
|
|
1048
|
+
),
|
|
1049
|
+
isUnderlined && /* @__PURE__ */ React4.createElement(
|
|
1050
|
+
Animated2.View,
|
|
1051
|
+
{
|
|
1052
|
+
style: [
|
|
1053
|
+
otpStyles.underline,
|
|
1054
|
+
{
|
|
1055
|
+
height: variantStyles.container.borderBottomWidth ?? 1,
|
|
1056
|
+
backgroundColor: animatedBorderColor
|
|
1057
|
+
}
|
|
1058
|
+
]
|
|
1059
|
+
}
|
|
1042
1060
|
)
|
|
1043
1061
|
)
|
|
1044
1062
|
);
|
|
@@ -1049,7 +1067,7 @@ var OTPInput = ({
|
|
|
1049
1067
|
defaultValue,
|
|
1050
1068
|
onValueChange,
|
|
1051
1069
|
onComplete,
|
|
1052
|
-
variant = "
|
|
1070
|
+
variant = "colored",
|
|
1053
1071
|
size = "md",
|
|
1054
1072
|
radius = "md",
|
|
1055
1073
|
themeColor = "primary",
|
|
@@ -1183,7 +1201,7 @@ OTPInput.displayName = "OTPInput";
|
|
|
1183
1201
|
import React5, { forwardRef as forwardRef3 } from "react";
|
|
1184
1202
|
import { Pressable as Pressable3, View as View3 } from "react-native";
|
|
1185
1203
|
import { AddIcon, RemoveIcon } from "@xaui/icons";
|
|
1186
|
-
import { withOpacity as
|
|
1204
|
+
import { withOpacity as withOpacity3 } from "@xaui/core";
|
|
1187
1205
|
|
|
1188
1206
|
// src/components/input/number-input.hook.ts
|
|
1189
1207
|
import { useCallback as useCallback4, useMemo as useMemo5, useState as useState3 } from "react";
|
|
@@ -1326,7 +1344,7 @@ var NumberInput = forwardRef3(
|
|
|
1326
1344
|
errorMessage,
|
|
1327
1345
|
placeholder,
|
|
1328
1346
|
themeColor = "primary",
|
|
1329
|
-
variant = "
|
|
1347
|
+
variant = "colored",
|
|
1330
1348
|
size = "md",
|
|
1331
1349
|
radius = "md",
|
|
1332
1350
|
isDisabled = false,
|
|
@@ -1356,7 +1374,7 @@ var NumberInput = forwardRef3(
|
|
|
1356
1374
|
formatOptions,
|
|
1357
1375
|
locale
|
|
1358
1376
|
});
|
|
1359
|
-
const iconColor =
|
|
1377
|
+
const iconColor = withOpacity3(theme.colors.foreground, 0.7);
|
|
1360
1378
|
const stepperContent = hideStepper || isReadOnly ? void 0 : /* @__PURE__ */ React5.createElement(
|
|
1361
1379
|
View3,
|
|
1362
1380
|
{
|