@xaui/native 0.0.21 → 0.0.24
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 +195 -2
- package/dist/alert/index.js +1 -2
- package/dist/app-bar/index.cjs +217 -0
- package/dist/app-bar/index.d.cts +52 -0
- package/dist/app-bar/index.d.ts +52 -0
- package/dist/app-bar/index.js +142 -0
- package/dist/autocomplete/index.js +48 -36
- package/dist/avatar/index.js +1 -2
- package/dist/badge/index.js +1 -2
- package/dist/bottom-sheet/index.js +1 -2
- package/dist/bottom-tab-bar/index.cjs +571 -0
- package/dist/bottom-tab-bar/index.d.cts +211 -0
- package/dist/bottom-tab-bar/index.d.ts +211 -0
- package/dist/bottom-tab-bar/index.js +497 -0
- package/dist/button/index.d.cts +102 -5
- package/dist/button/index.d.ts +102 -5
- package/dist/button/index.js +2 -3
- package/dist/button.type-j1ZdkkSl.d.cts +4 -0
- package/dist/button.type-j1ZdkkSl.d.ts +4 -0
- package/dist/card/index.cjs +2 -0
- package/dist/card/index.d.cts +6 -1
- package/dist/card/index.d.ts +6 -1
- package/dist/card/index.js +4 -2
- package/dist/carousel/index.js +1 -1
- package/dist/chart/index.cjs +1067 -0
- package/dist/chart/index.d.cts +218 -0
- package/dist/chart/index.d.ts +218 -0
- package/dist/chart/index.js +1026 -0
- package/dist/checkbox/index.js +1 -2
- package/dist/chip/index.js +1 -2
- package/dist/chunk-3XSXTM3G.js +661 -0
- package/dist/chunk-4KSZLONZ.js +79 -0
- package/dist/{chunk-DXXNBF5P.js → chunk-CZFDZPAS.js} +0 -5
- package/dist/{chunk-LTKYHG5V.js → chunk-GHCVNQET.js} +12 -5
- package/dist/chunk-I4V5Y5GD.js +76 -0
- package/dist/{chunk-F7WH4DMG.js → chunk-UI5L26KD.js} +1 -1
- package/dist/{chunk-LUBWRVI2.js → chunk-ULJSCNPE.js} +1 -1
- package/dist/chunk-URBEEDFX.js +79 -0
- package/dist/core/index.js +3 -5
- package/dist/datepicker/index.js +1 -2
- package/dist/divider/index.js +2 -3
- package/dist/drawer/index.cjs +310 -0
- package/dist/drawer/index.d.cts +58 -0
- package/dist/drawer/index.d.ts +58 -0
- package/dist/drawer/index.js +236 -0
- package/dist/{accordion → expansion-panel}/index.cjs +45 -45
- package/dist/{accordion → expansion-panel}/index.d.cts +30 -30
- package/dist/{accordion → expansion-panel}/index.d.ts +30 -30
- package/dist/{accordion → expansion-panel}/index.js +40 -41
- package/dist/fab/index.d.cts +3 -3
- package/dist/fab/index.d.ts +3 -3
- package/dist/fab/index.js +3 -4
- package/dist/fab-menu/index.d.cts +2 -2
- package/dist/fab-menu/index.d.ts +2 -2
- package/dist/fab-menu/index.js +3 -4
- package/dist/{fab.type-Ba0QMprb.d.ts → fab.type-CgIYqQlT.d.ts} +1 -1
- package/dist/{fab.type-U09H8B7D.d.cts → fab.type-l2vjG8-p.d.cts} +1 -1
- package/dist/feature-discovery/index.cjs +531 -0
- package/dist/feature-discovery/index.d.cts +82 -0
- package/dist/feature-discovery/index.d.ts +82 -0
- package/dist/feature-discovery/index.js +464 -0
- package/dist/indicator/index.js +2 -3
- package/dist/input/index.cjs +258 -164
- package/dist/input/index.d.cts +15 -1
- package/dist/input/index.d.ts +15 -1
- package/dist/input/index.js +219 -126
- package/dist/list/index.js +1 -2
- package/dist/menu/index.js +2 -2
- package/dist/menubox/index.cjs +369 -0
- package/dist/menubox/index.d.cts +98 -0
- package/dist/menubox/index.d.ts +98 -0
- package/dist/menubox/index.js +296 -0
- package/dist/pager/index.cjs +243 -0
- package/dist/pager/index.d.cts +93 -0
- package/dist/pager/index.d.ts +93 -0
- package/dist/pager/index.js +205 -0
- package/dist/progress/index.js +1 -2
- package/dist/radio/index.cjs +537 -0
- package/dist/radio/index.d.cts +145 -0
- package/dist/radio/index.d.ts +145 -0
- package/dist/radio/index.js +464 -0
- package/dist/segment-button/index.js +2 -2
- package/dist/select/index.js +22 -10
- package/dist/skeleton/index.js +2 -2
- package/dist/slider/index.cjs +655 -0
- package/dist/slider/index.d.cts +171 -0
- package/dist/slider/index.d.ts +171 -0
- package/dist/slider/index.js +575 -0
- package/dist/stepper/index.cjs +624 -0
- package/dist/stepper/index.d.cts +137 -0
- package/dist/stepper/index.d.ts +137 -0
- package/dist/stepper/index.js +549 -0
- package/dist/switch/index.js +1 -2
- package/dist/tabs/index.cjs +523 -0
- package/dist/tabs/index.d.cts +176 -0
- package/dist/tabs/index.d.ts +176 -0
- package/dist/tabs/index.js +438 -0
- package/dist/timepicker/index.cjs +1280 -0
- package/dist/timepicker/index.d.cts +215 -0
- package/dist/timepicker/index.d.ts +215 -0
- package/dist/timepicker/index.js +1181 -0
- package/dist/toolbar/index.cjs +395 -0
- package/dist/toolbar/index.d.cts +100 -0
- package/dist/toolbar/index.d.ts +100 -0
- package/dist/toolbar/index.js +325 -0
- package/dist/typography/index.js +1 -2
- package/dist/view/index.cjs +16 -2
- package/dist/view/index.js +16 -2
- package/package.json +73 -8
- package/dist/button.type-D8tzEBo7.d.ts +0 -104
- package/dist/button.type-ikaWzhIg.d.cts +0 -104
- package/dist/chunk-GBHQCAKW.js +0 -19
- package/dist/chunk-JEGEPGVU.js +0 -287
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CheckmarkIcon
|
|
3
|
-
} from "../chunk-GBHQCAKW.js";
|
|
4
|
-
import "../chunk-DXXNBF5P.js";
|
|
5
1
|
import {
|
|
6
2
|
Portal,
|
|
7
3
|
useXUITheme
|
|
8
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-URBEEDFX.js";
|
|
9
5
|
|
|
10
6
|
// src/components/autocomplete/autocomplete.tsx
|
|
11
|
-
import
|
|
7
|
+
import React5, { useCallback as useCallback3, useMemo as useMemo3, useRef as useRef3, useState as useState3 } from "react";
|
|
12
8
|
import { Keyboard as Keyboard2, Text as Text3, View as View4 } from "react-native";
|
|
13
9
|
|
|
14
10
|
// src/components/autocomplete/autocomplete-context.ts
|
|
@@ -318,7 +314,7 @@ var defaultFilterFunction = (textValue, inputValue) => {
|
|
|
318
314
|
};
|
|
319
315
|
|
|
320
316
|
// src/components/dialogs/autocomplete-dialog/autocomplete-dialog.tsx
|
|
321
|
-
import
|
|
317
|
+
import React3, { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
|
|
322
318
|
import {
|
|
323
319
|
Animated as Animated3,
|
|
324
320
|
BackHandler,
|
|
@@ -331,8 +327,24 @@ import {
|
|
|
331
327
|
useWindowDimensions
|
|
332
328
|
} from "react-native";
|
|
333
329
|
|
|
334
|
-
// src/components/
|
|
330
|
+
// src/components/select/checkmark-icon.tsx
|
|
335
331
|
import React from "react";
|
|
332
|
+
import Svg, { Polyline } from "react-native-svg";
|
|
333
|
+
function CheckmarkIcon({ color, size }) {
|
|
334
|
+
return /* @__PURE__ */ React.createElement(Svg, { width: size, height: size, viewBox: "0 0 17 18", fill: "none" }, /* @__PURE__ */ React.createElement(
|
|
335
|
+
Polyline,
|
|
336
|
+
{
|
|
337
|
+
points: "1 9 7 14 15 4",
|
|
338
|
+
stroke: color,
|
|
339
|
+
strokeWidth: 2,
|
|
340
|
+
strokeLinecap: "round",
|
|
341
|
+
strokeLinejoin: "round"
|
|
342
|
+
}
|
|
343
|
+
));
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// src/components/dialogs/autocomplete-dialog/autocomplete-dialog-header.tsx
|
|
347
|
+
import React2 from "react";
|
|
336
348
|
import {
|
|
337
349
|
Animated,
|
|
338
350
|
Pressable,
|
|
@@ -435,7 +447,7 @@ var AutocompleteDialogHeader = ({
|
|
|
435
447
|
onBlur
|
|
436
448
|
}) => {
|
|
437
449
|
const theme = useXUITheme();
|
|
438
|
-
return /* @__PURE__ */
|
|
450
|
+
return /* @__PURE__ */ React2.createElement(View, { style: styles2.header }, title ? /* @__PURE__ */ React2.createElement(View, { style: styles2.titleRow }, /* @__PURE__ */ React2.createElement(
|
|
439
451
|
Pressable,
|
|
440
452
|
{
|
|
441
453
|
style: styles2.backButton,
|
|
@@ -443,8 +455,8 @@ var AutocompleteDialogHeader = ({
|
|
|
443
455
|
accessibilityLabel: "Back",
|
|
444
456
|
accessibilityRole: "button"
|
|
445
457
|
},
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
), /* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ React2.createElement(ArrowBackIcon, { size: 20, color: theme.colors.foreground })
|
|
459
|
+
), /* @__PURE__ */ React2.createElement(Text, { style: [styles2.title, { color: theme.colors.foreground }] }, title)) : null, /* @__PURE__ */ React2.createElement(View, { style: styles2.inputContainer }, /* @__PURE__ */ React2.createElement(Animated.View, { style: [styles2.inputWrapper, inputAnimatedStyle] }, /* @__PURE__ */ React2.createElement(
|
|
448
460
|
TextInput,
|
|
449
461
|
{
|
|
450
462
|
ref: inputRef,
|
|
@@ -466,7 +478,7 @@ var AutocompleteDialogHeader = ({
|
|
|
466
478
|
onFocus,
|
|
467
479
|
onBlur
|
|
468
480
|
}
|
|
469
|
-
), inputValue ? /* @__PURE__ */
|
|
481
|
+
), inputValue ? /* @__PURE__ */ React2.createElement(
|
|
470
482
|
Pressable,
|
|
471
483
|
{
|
|
472
484
|
style: styles2.clearInputButton,
|
|
@@ -474,7 +486,7 @@ var AutocompleteDialogHeader = ({
|
|
|
474
486
|
accessibilityLabel: "Clear input",
|
|
475
487
|
accessibilityRole: "button"
|
|
476
488
|
},
|
|
477
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ React2.createElement(CloseIcon, { color: theme.colors.foreground })
|
|
478
490
|
) : null)));
|
|
479
491
|
};
|
|
480
492
|
|
|
@@ -556,8 +568,8 @@ var AutocompleteDialog = ({
|
|
|
556
568
|
};
|
|
557
569
|
}, []);
|
|
558
570
|
const items = useMemo2(
|
|
559
|
-
() =>
|
|
560
|
-
|
|
571
|
+
() => React3.Children.toArray(children).filter(
|
|
572
|
+
React3.isValidElement
|
|
561
573
|
),
|
|
562
574
|
[children]
|
|
563
575
|
);
|
|
@@ -616,7 +628,7 @@ var AutocompleteDialog = ({
|
|
|
616
628
|
const inputAnimatedStyle = {
|
|
617
629
|
transform: [{ scaleX: scaleAnim }]
|
|
618
630
|
};
|
|
619
|
-
const listHeader = /* @__PURE__ */
|
|
631
|
+
const listHeader = /* @__PURE__ */ React3.createElement(
|
|
620
632
|
AutocompleteDialogHeader,
|
|
621
633
|
{
|
|
622
634
|
title,
|
|
@@ -632,13 +644,13 @@ var AutocompleteDialog = ({
|
|
|
632
644
|
onBlur
|
|
633
645
|
}
|
|
634
646
|
);
|
|
635
|
-
return /* @__PURE__ */
|
|
647
|
+
return /* @__PURE__ */ React3.createElement(Portal, null, /* @__PURE__ */ React3.createElement(View2, { style: [overlayStyle, style] }, /* @__PURE__ */ React3.createElement(Animated3.View, { style: [styles2.backdrop, { opacity: fadeAnim }] }), /* @__PURE__ */ React3.createElement(Animated3.View, { style: [styles2.dialogContainer, containerAnimatedStyle] }, /* @__PURE__ */ React3.createElement(
|
|
636
648
|
View2,
|
|
637
649
|
{
|
|
638
650
|
style: [styles2.container, { backgroundColor: theme.colors.background }]
|
|
639
651
|
},
|
|
640
652
|
listHeader,
|
|
641
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ React3.createElement(
|
|
642
654
|
FlatList,
|
|
643
655
|
{
|
|
644
656
|
data: items,
|
|
@@ -653,7 +665,7 @@ var AutocompleteDialog = ({
|
|
|
653
665
|
showsVerticalScrollIndicator: false
|
|
654
666
|
}
|
|
655
667
|
),
|
|
656
|
-
showCheckmark ? /* @__PURE__ */
|
|
668
|
+
showCheckmark ? /* @__PURE__ */ React3.createElement(View2, { style: styles2.checkmarkButtonContainer }, /* @__PURE__ */ React3.createElement(
|
|
657
669
|
Pressable2,
|
|
658
670
|
{
|
|
659
671
|
style: [
|
|
@@ -664,13 +676,13 @@ var AutocompleteDialog = ({
|
|
|
664
676
|
accessibilityLabel: "Confirm",
|
|
665
677
|
accessibilityRole: "button"
|
|
666
678
|
},
|
|
667
|
-
checkmarkIcon ?? /* @__PURE__ */
|
|
679
|
+
checkmarkIcon ?? /* @__PURE__ */ React3.createElement(CheckmarkIcon, { color: checkmarkColor, size: 20 })
|
|
668
680
|
)) : null
|
|
669
681
|
))));
|
|
670
682
|
};
|
|
671
683
|
|
|
672
684
|
// src/components/autocomplete/autocomplete-trigger.tsx
|
|
673
|
-
import
|
|
685
|
+
import React4 from "react";
|
|
674
686
|
import { Pressable as Pressable3, Text as Text2, TouchableOpacity, View as View3 } from "react-native";
|
|
675
687
|
import { CloseIcon as CloseIcon2 } from "@xaui/icons";
|
|
676
688
|
var AutocompleteTrigger = ({
|
|
@@ -695,7 +707,7 @@ var AutocompleteTrigger = ({
|
|
|
695
707
|
onLayout: handleTriggerLayout
|
|
696
708
|
}) => {
|
|
697
709
|
const renderLabel = isLabelInside && label;
|
|
698
|
-
return /* @__PURE__ */
|
|
710
|
+
return /* @__PURE__ */ React4.createElement(
|
|
699
711
|
Pressable3,
|
|
700
712
|
{
|
|
701
713
|
ref: triggerRef,
|
|
@@ -718,7 +730,7 @@ var AutocompleteTrigger = ({
|
|
|
718
730
|
accessibilityRole: "button",
|
|
719
731
|
accessibilityState: { disabled: isDisabled }
|
|
720
732
|
},
|
|
721
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ React4.createElement(View3, { style: styles.triggerContent }, isLabelInside && renderLabel, /* @__PURE__ */ React4.createElement(
|
|
722
734
|
Text2,
|
|
723
735
|
{
|
|
724
736
|
style: [
|
|
@@ -732,14 +744,14 @@ var AutocompleteTrigger = ({
|
|
|
732
744
|
},
|
|
733
745
|
displayValue
|
|
734
746
|
)),
|
|
735
|
-
isClearable && (currentSelectedKey || currentInputValue) ? /* @__PURE__ */
|
|
747
|
+
isClearable && (currentSelectedKey || currentInputValue) ? /* @__PURE__ */ React4.createElement(
|
|
736
748
|
TouchableOpacity,
|
|
737
749
|
{
|
|
738
750
|
onPress: handleClear,
|
|
739
751
|
style: styles.clearButton,
|
|
740
752
|
hitSlop: { top: 8, right: 8, bottom: 8, left: 8 }
|
|
741
753
|
},
|
|
742
|
-
clearIcon ?? /* @__PURE__ */
|
|
754
|
+
clearIcon ?? /* @__PURE__ */ React4.createElement(CloseIcon2, { color: theme.colors.foreground, size: 20 })
|
|
743
755
|
) : null
|
|
744
756
|
);
|
|
745
757
|
};
|
|
@@ -798,9 +810,9 @@ var Autocomplete = ({
|
|
|
798
810
|
});
|
|
799
811
|
}, []);
|
|
800
812
|
const items = useMemo3(() => {
|
|
801
|
-
const elements =
|
|
813
|
+
const elements = React5.Children.toArray(children).filter(Boolean);
|
|
802
814
|
return elements.map((child, index) => {
|
|
803
|
-
if (!
|
|
815
|
+
if (!React5.isValidElement(child)) {
|
|
804
816
|
return null;
|
|
805
817
|
}
|
|
806
818
|
const key = child.props.value ?? String(index);
|
|
@@ -893,7 +905,7 @@ var Autocomplete = ({
|
|
|
893
905
|
handleItemSelection(item.key, item.labelText);
|
|
894
906
|
itemProps.onSelected?.();
|
|
895
907
|
};
|
|
896
|
-
return
|
|
908
|
+
return React5.cloneElement(item.element, {
|
|
897
909
|
key: item.key,
|
|
898
910
|
isDisabled: itemDisabled,
|
|
899
911
|
isSelected: itemSelected,
|
|
@@ -904,10 +916,10 @@ var Autocomplete = ({
|
|
|
904
916
|
const isLabelInside = labelPlacement === "inside";
|
|
905
917
|
const isLabelOutsideLeft = labelPlacement === "outside-left";
|
|
906
918
|
const isLabelOutside = labelPlacement === "outside" || labelPlacement === "outside-top";
|
|
907
|
-
const renderLabel = label ? typeof label === "string" || typeof label === "number" ? /* @__PURE__ */
|
|
919
|
+
const renderLabel = label ? typeof label === "string" || typeof label === "number" ? /* @__PURE__ */ React5.createElement(Text3, { style: [styles.label, labelStyle] }, label) : /* @__PURE__ */ React5.createElement(View4, null, label) : null;
|
|
908
920
|
const shouldShowHelper = Boolean(description || errorMessage);
|
|
909
921
|
const helperContent = isInvalid && errorMessage ? errorMessage : description;
|
|
910
|
-
const triggerContent = /* @__PURE__ */
|
|
922
|
+
const triggerContent = /* @__PURE__ */ React5.createElement(
|
|
911
923
|
AutocompleteTrigger,
|
|
912
924
|
{
|
|
913
925
|
triggerRef,
|
|
@@ -932,7 +944,7 @@ var Autocomplete = ({
|
|
|
932
944
|
}
|
|
933
945
|
);
|
|
934
946
|
const labelBlock = isLabelOutside || isLabelInside ? renderLabel : null;
|
|
935
|
-
return /* @__PURE__ */
|
|
947
|
+
return /* @__PURE__ */ React5.createElement(View4, { style: [styles.container, fullWidth ? styles.fullWidth : styles.minWidth] }, isLabelOutside && labelBlock, isLabelOutsideLeft ? /* @__PURE__ */ React5.createElement(View4, { style: styles.outsideLeftRow }, renderLabel, triggerContent) : triggerContent, shouldShowHelper && helperContent ? typeof helperContent === "string" || typeof helperContent === "number" ? /* @__PURE__ */ React5.createElement(Text3, { style: [styles.helperText, { color: helperColor }] }, helperContent) : /* @__PURE__ */ React5.createElement(View4, null, helperContent) : null, /* @__PURE__ */ React5.createElement(
|
|
936
948
|
AutocompleteDialog,
|
|
937
949
|
{
|
|
938
950
|
visible: isOpen,
|
|
@@ -946,12 +958,12 @@ var Autocomplete = ({
|
|
|
946
958
|
onClose: () => setOpen(false),
|
|
947
959
|
onCheckmark: handleCheckmark
|
|
948
960
|
},
|
|
949
|
-
/* @__PURE__ */
|
|
961
|
+
/* @__PURE__ */ React5.createElement(AutocompleteContext.Provider, { value: { size, themeColor, isDisabled } }, showEmptyMessage ? /* @__PURE__ */ React5.createElement(Text3, { style: [styles.emptyMessage, { color: theme.colors.foreground }] }, "No results found") : listItems)
|
|
950
962
|
));
|
|
951
963
|
};
|
|
952
964
|
|
|
953
965
|
// src/components/autocomplete/autocomplete-item.tsx
|
|
954
|
-
import
|
|
966
|
+
import React6, { useContext as useContext2 } from "react";
|
|
955
967
|
import { Pressable as Pressable4, Text as Text4, View as View5 } from "react-native";
|
|
956
968
|
|
|
957
969
|
// src/components/autocomplete/autocomplete-item.style.ts
|
|
@@ -1081,7 +1093,7 @@ var AutocompleteItem = ({
|
|
|
1081
1093
|
}
|
|
1082
1094
|
onSelected?.();
|
|
1083
1095
|
};
|
|
1084
|
-
return /* @__PURE__ */
|
|
1096
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1085
1097
|
Pressable4,
|
|
1086
1098
|
{
|
|
1087
1099
|
onPress: handlePress,
|
|
@@ -1098,7 +1110,7 @@ var AutocompleteItem = ({
|
|
|
1098
1110
|
]
|
|
1099
1111
|
},
|
|
1100
1112
|
startContent,
|
|
1101
|
-
/* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ React6.createElement(View5, { style: styles3.content }, /* @__PURE__ */ React6.createElement(
|
|
1102
1114
|
Text4,
|
|
1103
1115
|
{
|
|
1104
1116
|
style: [
|
|
@@ -1108,7 +1120,7 @@ var AutocompleteItem = ({
|
|
|
1108
1120
|
]
|
|
1109
1121
|
},
|
|
1110
1122
|
label
|
|
1111
|
-
), description && /* @__PURE__ */
|
|
1123
|
+
), description && /* @__PURE__ */ React6.createElement(
|
|
1112
1124
|
Text4,
|
|
1113
1125
|
{
|
|
1114
1126
|
style: [
|
package/dist/avatar/index.js
CHANGED
package/dist/badge/index.js
CHANGED