@xaui/native 0.0.27 → 0.0.28

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.
Files changed (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -228
  3. package/dist/alert/index.cjs +92 -166
  4. package/dist/alert/index.js +2 -1
  5. package/dist/app-bar/index.cjs +24 -98
  6. package/dist/app-bar/index.js +2 -1
  7. package/dist/autocomplete/index.cjs +192 -281
  8. package/dist/autocomplete/index.js +36 -48
  9. package/dist/avatar/index.cjs +59 -133
  10. package/dist/avatar/index.js +2 -1
  11. package/dist/badge/index.cjs +26 -99
  12. package/dist/badge/index.js +2 -1
  13. package/dist/bottom-sheet/index.cjs +5 -456
  14. package/dist/bottom-sheet/index.js +4 -363
  15. package/dist/bottom-tab-bar/index.cjs +93 -167
  16. package/dist/bottom-tab-bar/index.js +2 -2
  17. package/dist/button/index.cjs +73 -525
  18. package/dist/button/index.js +3 -2
  19. package/dist/card/index.cjs +76 -169
  20. package/dist/card/index.js +2 -2
  21. package/dist/carousel/index.cjs +68 -145
  22. package/dist/carousel/index.js +1 -1
  23. package/dist/chart/index.cjs +132 -173
  24. package/dist/checkbox/index.cjs +70 -143
  25. package/dist/checkbox/index.js +2 -1
  26. package/dist/chip/index.cjs +89 -164
  27. package/dist/chip/index.js +2 -1
  28. package/dist/chunk-BD72HIPR.cjs +75 -0
  29. package/dist/chunk-DHSTKO3K.cjs +19 -0
  30. package/dist/{chunk-CZFDZPAS.js → chunk-DXXNBF5P.js} +5 -0
  31. package/dist/{chunk-UI5L26KD.js → chunk-F7WH4DMG.js} +1 -1
  32. package/dist/chunk-GBHQCAKW.js +19 -0
  33. package/dist/chunk-HC2SSHNU.js +368 -0
  34. package/dist/chunk-HSPTLUFA.cjs +7 -0
  35. package/dist/chunk-JEGEPGVU.js +287 -0
  36. package/dist/chunk-KTLGDLCB.cjs +287 -0
  37. package/dist/{chunk-GHCVNQET.js → chunk-LTKYHG5V.js} +5 -12
  38. package/dist/{chunk-ULJSCNPE.js → chunk-LUBWRVI2.js} +1 -1
  39. package/dist/chunk-OQ2BLOOG.cjs +138 -0
  40. package/dist/chunk-QMYWIWSX.cjs +384 -0
  41. package/dist/chunk-XFPPR2VB.cjs +368 -0
  42. package/dist/core/index.cjs +22 -168
  43. package/dist/core/index.d.cts +1 -1
  44. package/dist/core/index.d.ts +1 -1
  45. package/dist/core/index.js +5 -3
  46. package/dist/datepicker/index.cjs +239 -320
  47. package/dist/datepicker/index.js +2 -1
  48. package/dist/divider/index.cjs +5 -145
  49. package/dist/divider/index.js +3 -2
  50. package/dist/drawer/index.cjs +39 -112
  51. package/dist/drawer/index.js +2 -1
  52. package/dist/expansion-panel/index.cjs +91 -230
  53. package/dist/expansion-panel/index.js +3 -2
  54. package/dist/fab/index.cjs +6 -722
  55. package/dist/fab/index.js +4 -3
  56. package/dist/fab-menu/index.cjs +81 -814
  57. package/dist/fab-menu/index.js +4 -3
  58. package/dist/feature-discovery/index.cjs +72 -139
  59. package/dist/feature-discovery/index.js +2 -2
  60. package/dist/index.cjs +1 -18
  61. package/dist/indicator/index.cjs +5 -445
  62. package/dist/indicator/index.js +3 -2
  63. package/dist/input/index.cjs +214 -282
  64. package/dist/input/index.js +2 -2
  65. package/dist/list/index.cjs +71 -146
  66. package/dist/list/index.js +2 -1
  67. package/dist/menu/index.cjs +59 -127
  68. package/dist/menu/index.js +2 -2
  69. package/dist/menubox/index.cjs +60 -132
  70. package/dist/menubox/index.js +2 -1
  71. package/dist/pager/index.cjs +42 -80
  72. package/dist/progress/index.cjs +43 -114
  73. package/dist/progress/index.js +2 -1
  74. package/dist/radio/index.cjs +82 -154
  75. package/dist/radio/index.js +2 -1
  76. package/dist/segment-button/index.cjs +60 -147
  77. package/dist/segment-button/index.js +2 -2
  78. package/dist/select/index.cjs +149 -224
  79. package/dist/select/index.js +10 -22
  80. package/dist/skeleton/index.cjs +23 -94
  81. package/dist/skeleton/index.js +2 -2
  82. package/dist/slider/index.cjs +77 -156
  83. package/dist/slider/index.js +2 -1
  84. package/dist/snackbar/index.cjs +420 -0
  85. package/dist/snackbar/index.d.cts +175 -0
  86. package/dist/snackbar/index.d.ts +175 -0
  87. package/dist/snackbar/index.js +420 -0
  88. package/dist/stepper/index.cjs +121 -195
  89. package/dist/stepper/index.js +2 -1
  90. package/dist/switch/index.cjs +48 -121
  91. package/dist/switch/index.js +2 -1
  92. package/dist/tabs/index.cjs +67 -151
  93. package/dist/tabs/index.js +2 -1
  94. package/dist/timepicker/index.cjs +135 -593
  95. package/dist/timepicker/index.js +24 -383
  96. package/dist/toolbar/index.cjs +59 -128
  97. package/dist/toolbar/index.js +2 -1
  98. package/dist/typography/index.cjs +37 -92
  99. package/dist/typography/index.d.cts +1 -1
  100. package/dist/typography/index.d.ts +1 -1
  101. package/dist/typography/index.js +20 -1
  102. package/dist/view/index.cjs +178 -223
  103. package/package.json +6 -1
  104. package/dist/chunk-3XSXTM3G.js +0 -661
  105. package/dist/chunk-4KSZLONZ.js +0 -79
  106. package/dist/chunk-I4V5Y5GD.js +0 -76
  107. package/dist/chunk-URBEEDFX.js +0 -79
@@ -1,10 +1,14 @@
1
+ import {
2
+ CheckmarkIcon
3
+ } from "../chunk-GBHQCAKW.js";
4
+ import "../chunk-DXXNBF5P.js";
1
5
  import {
2
6
  Portal,
3
7
  useXUITheme
4
- } from "../chunk-URBEEDFX.js";
8
+ } from "../chunk-LTKYHG5V.js";
5
9
 
6
10
  // src/components/autocomplete/autocomplete.tsx
7
- import React5, { useCallback as useCallback3, useMemo as useMemo3, useRef as useRef3, useState as useState3 } from "react";
11
+ import React4, { useCallback as useCallback3, useMemo as useMemo3, useRef as useRef3, useState as useState3 } from "react";
8
12
  import { Keyboard as Keyboard2, Text as Text3, View as View4 } from "react-native";
9
13
 
10
14
  // src/components/autocomplete/autocomplete-context.ts
@@ -314,7 +318,7 @@ var defaultFilterFunction = (textValue, inputValue) => {
314
318
  };
315
319
 
316
320
  // src/components/dialogs/autocomplete-dialog/autocomplete-dialog.tsx
317
- import React3, { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
321
+ import React2, { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
318
322
  import {
319
323
  Animated as Animated3,
320
324
  BackHandler,
@@ -327,24 +331,8 @@ import {
327
331
  useWindowDimensions
328
332
  } from "react-native";
329
333
 
330
- // src/components/select/checkmark-icon.tsx
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
334
  // src/components/dialogs/autocomplete-dialog/autocomplete-dialog-header.tsx
347
- import React2 from "react";
335
+ import React from "react";
348
336
  import {
349
337
  Animated,
350
338
  Pressable,
@@ -447,7 +435,7 @@ var AutocompleteDialogHeader = ({
447
435
  onBlur
448
436
  }) => {
449
437
  const theme = useXUITheme();
450
- return /* @__PURE__ */ React2.createElement(View, { style: styles2.header }, title ? /* @__PURE__ */ React2.createElement(View, { style: styles2.titleRow }, /* @__PURE__ */ React2.createElement(
438
+ return /* @__PURE__ */ React.createElement(View, { style: styles2.header }, title ? /* @__PURE__ */ React.createElement(View, { style: styles2.titleRow }, /* @__PURE__ */ React.createElement(
451
439
  Pressable,
452
440
  {
453
441
  style: styles2.backButton,
@@ -455,8 +443,8 @@ var AutocompleteDialogHeader = ({
455
443
  accessibilityLabel: "Back",
456
444
  accessibilityRole: "button"
457
445
  },
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(
446
+ /* @__PURE__ */ React.createElement(ArrowBackIcon, { size: 20, color: theme.colors.foreground })
447
+ ), /* @__PURE__ */ React.createElement(Text, { style: [styles2.title, { color: theme.colors.foreground }] }, title)) : null, /* @__PURE__ */ React.createElement(View, { style: styles2.inputContainer }, /* @__PURE__ */ React.createElement(Animated.View, { style: [styles2.inputWrapper, inputAnimatedStyle] }, /* @__PURE__ */ React.createElement(
460
448
  TextInput,
461
449
  {
462
450
  ref: inputRef,
@@ -478,7 +466,7 @@ var AutocompleteDialogHeader = ({
478
466
  onFocus,
479
467
  onBlur
480
468
  }
481
- ), inputValue ? /* @__PURE__ */ React2.createElement(
469
+ ), inputValue ? /* @__PURE__ */ React.createElement(
482
470
  Pressable,
483
471
  {
484
472
  style: styles2.clearInputButton,
@@ -486,7 +474,7 @@ var AutocompleteDialogHeader = ({
486
474
  accessibilityLabel: "Clear input",
487
475
  accessibilityRole: "button"
488
476
  },
489
- /* @__PURE__ */ React2.createElement(CloseIcon, { color: theme.colors.foreground })
477
+ /* @__PURE__ */ React.createElement(CloseIcon, { color: theme.colors.foreground })
490
478
  ) : null)));
491
479
  };
492
480
 
@@ -568,8 +556,8 @@ var AutocompleteDialog = ({
568
556
  };
569
557
  }, []);
570
558
  const items = useMemo2(
571
- () => React3.Children.toArray(children).filter(
572
- React3.isValidElement
559
+ () => React2.Children.toArray(children).filter(
560
+ React2.isValidElement
573
561
  ),
574
562
  [children]
575
563
  );
@@ -628,7 +616,7 @@ var AutocompleteDialog = ({
628
616
  const inputAnimatedStyle = {
629
617
  transform: [{ scaleX: scaleAnim }]
630
618
  };
631
- const listHeader = /* @__PURE__ */ React3.createElement(
619
+ const listHeader = /* @__PURE__ */ React2.createElement(
632
620
  AutocompleteDialogHeader,
633
621
  {
634
622
  title,
@@ -644,13 +632,13 @@ var AutocompleteDialog = ({
644
632
  onBlur
645
633
  }
646
634
  );
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(
635
+ return /* @__PURE__ */ React2.createElement(Portal, null, /* @__PURE__ */ React2.createElement(View2, { style: [overlayStyle, style] }, /* @__PURE__ */ React2.createElement(Animated3.View, { style: [styles2.backdrop, { opacity: fadeAnim }] }), /* @__PURE__ */ React2.createElement(Animated3.View, { style: [styles2.dialogContainer, containerAnimatedStyle] }, /* @__PURE__ */ React2.createElement(
648
636
  View2,
649
637
  {
650
638
  style: [styles2.container, { backgroundColor: theme.colors.background }]
651
639
  },
652
640
  listHeader,
653
- /* @__PURE__ */ React3.createElement(
641
+ /* @__PURE__ */ React2.createElement(
654
642
  FlatList,
655
643
  {
656
644
  data: items,
@@ -665,7 +653,7 @@ var AutocompleteDialog = ({
665
653
  showsVerticalScrollIndicator: false
666
654
  }
667
655
  ),
668
- showCheckmark ? /* @__PURE__ */ React3.createElement(View2, { style: styles2.checkmarkButtonContainer }, /* @__PURE__ */ React3.createElement(
656
+ showCheckmark ? /* @__PURE__ */ React2.createElement(View2, { style: styles2.checkmarkButtonContainer }, /* @__PURE__ */ React2.createElement(
669
657
  Pressable2,
670
658
  {
671
659
  style: [
@@ -676,13 +664,13 @@ var AutocompleteDialog = ({
676
664
  accessibilityLabel: "Confirm",
677
665
  accessibilityRole: "button"
678
666
  },
679
- checkmarkIcon ?? /* @__PURE__ */ React3.createElement(CheckmarkIcon, { color: checkmarkColor, size: 20 })
667
+ checkmarkIcon ?? /* @__PURE__ */ React2.createElement(CheckmarkIcon, { color: checkmarkColor, size: 20 })
680
668
  )) : null
681
669
  ))));
682
670
  };
683
671
 
684
672
  // src/components/autocomplete/autocomplete-trigger.tsx
685
- import React4 from "react";
673
+ import React3 from "react";
686
674
  import { Pressable as Pressable3, Text as Text2, TouchableOpacity, View as View3 } from "react-native";
687
675
  import { CloseIcon as CloseIcon2 } from "@xaui/icons";
688
676
  var AutocompleteTrigger = ({
@@ -707,7 +695,7 @@ var AutocompleteTrigger = ({
707
695
  onLayout: handleTriggerLayout
708
696
  }) => {
709
697
  const renderLabel = isLabelInside && label;
710
- return /* @__PURE__ */ React4.createElement(
698
+ return /* @__PURE__ */ React3.createElement(
711
699
  Pressable3,
712
700
  {
713
701
  ref: triggerRef,
@@ -730,7 +718,7 @@ var AutocompleteTrigger = ({
730
718
  accessibilityRole: "button",
731
719
  accessibilityState: { disabled: isDisabled }
732
720
  },
733
- /* @__PURE__ */ React4.createElement(View3, { style: styles.triggerContent }, isLabelInside && renderLabel, /* @__PURE__ */ React4.createElement(
721
+ /* @__PURE__ */ React3.createElement(View3, { style: styles.triggerContent }, isLabelInside && renderLabel, /* @__PURE__ */ React3.createElement(
734
722
  Text2,
735
723
  {
736
724
  style: [
@@ -744,14 +732,14 @@ var AutocompleteTrigger = ({
744
732
  },
745
733
  displayValue
746
734
  )),
747
- isClearable && (currentSelectedKey || currentInputValue) ? /* @__PURE__ */ React4.createElement(
735
+ isClearable && (currentSelectedKey || currentInputValue) ? /* @__PURE__ */ React3.createElement(
748
736
  TouchableOpacity,
749
737
  {
750
738
  onPress: handleClear,
751
739
  style: styles.clearButton,
752
740
  hitSlop: { top: 8, right: 8, bottom: 8, left: 8 }
753
741
  },
754
- clearIcon ?? /* @__PURE__ */ React4.createElement(CloseIcon2, { color: theme.colors.foreground, size: 20 })
742
+ clearIcon ?? /* @__PURE__ */ React3.createElement(CloseIcon2, { color: theme.colors.foreground, size: 20 })
755
743
  ) : null
756
744
  );
757
745
  };
@@ -810,9 +798,9 @@ var Autocomplete = ({
810
798
  });
811
799
  }, []);
812
800
  const items = useMemo3(() => {
813
- const elements = React5.Children.toArray(children).filter(Boolean);
801
+ const elements = React4.Children.toArray(children).filter(Boolean);
814
802
  return elements.map((child, index) => {
815
- if (!React5.isValidElement(child)) {
803
+ if (!React4.isValidElement(child)) {
816
804
  return null;
817
805
  }
818
806
  const key = child.props.value ?? String(index);
@@ -905,7 +893,7 @@ var Autocomplete = ({
905
893
  handleItemSelection(item.key, item.labelText);
906
894
  itemProps.onSelected?.();
907
895
  };
908
- return React5.cloneElement(item.element, {
896
+ return React4.cloneElement(item.element, {
909
897
  key: item.key,
910
898
  isDisabled: itemDisabled,
911
899
  isSelected: itemSelected,
@@ -916,10 +904,10 @@ var Autocomplete = ({
916
904
  const isLabelInside = labelPlacement === "inside";
917
905
  const isLabelOutsideLeft = labelPlacement === "outside-left";
918
906
  const isLabelOutside = labelPlacement === "outside" || labelPlacement === "outside-top";
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;
907
+ const renderLabel = label ? typeof label === "string" || typeof label === "number" ? /* @__PURE__ */ React4.createElement(Text3, { style: [styles.label, labelStyle] }, label) : /* @__PURE__ */ React4.createElement(View4, null, label) : null;
920
908
  const shouldShowHelper = Boolean(description || errorMessage);
921
909
  const helperContent = isInvalid && errorMessage ? errorMessage : description;
922
- const triggerContent = /* @__PURE__ */ React5.createElement(
910
+ const triggerContent = /* @__PURE__ */ React4.createElement(
923
911
  AutocompleteTrigger,
924
912
  {
925
913
  triggerRef,
@@ -944,7 +932,7 @@ var Autocomplete = ({
944
932
  }
945
933
  );
946
934
  const labelBlock = isLabelOutside || isLabelInside ? renderLabel : null;
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(
935
+ return /* @__PURE__ */ React4.createElement(View4, { style: [styles.container, fullWidth ? styles.fullWidth : styles.minWidth] }, isLabelOutside && labelBlock, isLabelOutsideLeft ? /* @__PURE__ */ React4.createElement(View4, { style: styles.outsideLeftRow }, renderLabel, triggerContent) : triggerContent, shouldShowHelper && helperContent ? typeof helperContent === "string" || typeof helperContent === "number" ? /* @__PURE__ */ React4.createElement(Text3, { style: [styles.helperText, { color: helperColor }] }, helperContent) : /* @__PURE__ */ React4.createElement(View4, null, helperContent) : null, /* @__PURE__ */ React4.createElement(
948
936
  AutocompleteDialog,
949
937
  {
950
938
  visible: isOpen,
@@ -958,12 +946,12 @@ var Autocomplete = ({
958
946
  onClose: () => setOpen(false),
959
947
  onCheckmark: handleCheckmark
960
948
  },
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)
949
+ /* @__PURE__ */ React4.createElement(AutocompleteContext.Provider, { value: { size, themeColor, isDisabled } }, showEmptyMessage ? /* @__PURE__ */ React4.createElement(Text3, { style: [styles.emptyMessage, { color: theme.colors.foreground }] }, "No results found") : listItems)
962
950
  ));
963
951
  };
964
952
 
965
953
  // src/components/autocomplete/autocomplete-item.tsx
966
- import React6, { useContext as useContext2 } from "react";
954
+ import React5, { useContext as useContext2 } from "react";
967
955
  import { Pressable as Pressable4, Text as Text4, View as View5 } from "react-native";
968
956
 
969
957
  // src/components/autocomplete/autocomplete-item.style.ts
@@ -1093,7 +1081,7 @@ var AutocompleteItem = ({
1093
1081
  }
1094
1082
  onSelected?.();
1095
1083
  };
1096
- return /* @__PURE__ */ React6.createElement(
1084
+ return /* @__PURE__ */ React5.createElement(
1097
1085
  Pressable4,
1098
1086
  {
1099
1087
  onPress: handlePress,
@@ -1110,7 +1098,7 @@ var AutocompleteItem = ({
1110
1098
  ]
1111
1099
  },
1112
1100
  startContent,
1113
- /* @__PURE__ */ React6.createElement(View5, { style: styles3.content }, /* @__PURE__ */ React6.createElement(
1101
+ /* @__PURE__ */ React5.createElement(View5, { style: styles3.content }, /* @__PURE__ */ React5.createElement(
1114
1102
  Text4,
1115
1103
  {
1116
1104
  style: [
@@ -1120,7 +1108,7 @@ var AutocompleteItem = ({
1120
1108
  ]
1121
1109
  },
1122
1110
  label
1123
- ), description && /* @__PURE__ */ React6.createElement(
1111
+ ), description && /* @__PURE__ */ React5.createElement(
1124
1112
  Text4,
1125
1113
  {
1126
1114
  style: [
@@ -1,47 +1,15 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
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-HSPTLUFA.cjs');
29
2
 
30
- // src/components/avatar/index.ts
31
- var avatar_exports = {};
32
- __export(avatar_exports, {
33
- Avatar: () => Avatar,
34
- AvatarGroup: () => AvatarGroup
35
- });
36
- module.exports = __toCommonJS(avatar_exports);
3
+
4
+ var _chunkOQ2BLOOGcjs = require('../chunk-OQ2BLOOG.cjs');
37
5
 
38
6
  // src/components/avatar/avatar.tsx
39
- var import_react7 = __toESM(require("react"), 1);
40
- var import_react_native5 = require("react-native");
7
+ var _react = require('react'); var _react2 = _interopRequireDefault(_react);
8
+ var _reactnative = require('react-native');
41
9
 
42
10
  // src/components/avatar/avatar.style.ts
43
- var import_react_native = require("react-native");
44
- var styles = import_react_native.StyleSheet.create({
11
+
12
+ var styles = _reactnative.StyleSheet.create({
45
13
  container: {
46
14
  overflow: "hidden",
47
15
  alignItems: "center",
@@ -67,49 +35,8 @@ var styles = import_react_native.StyleSheet.create({
67
35
  });
68
36
 
69
37
  // src/components/avatar/avatar.hook.ts
70
- var import_react6 = require("react");
71
- var import_core = require("@xaui/core");
72
-
73
- // src/core/theme-context.tsx
74
- var import_react4 = __toESM(require("react"), 1);
75
- var import_react_native3 = require("react-native");
76
- var import_theme = require("@xaui/core/theme");
77
- var import_palette = require("@xaui/core/palette");
78
-
79
- // src/core/portal/portal.tsx
80
- var import_react2 = require("react");
81
-
82
- // src/core/portal/portal-context.ts
83
- var import_react = require("react");
84
- var PortalContext = (0, import_react.createContext)(null);
85
-
86
- // src/core/portal/portal-host.tsx
87
- var import_react3 = __toESM(require("react"), 1);
88
- var import_react_native2 = require("react-native");
89
- var hostStyles = import_react_native2.StyleSheet.create({
90
- container: {
91
- flex: 1
92
- }
93
- });
94
38
 
95
- // src/core/theme-context.tsx
96
- var XUIThemeContext = (0, import_react4.createContext)(null);
97
-
98
- // src/core/theme-hooks.ts
99
- var import_react5 = require("react");
100
- var import_react_native4 = require("react-native");
101
- function useXUITheme() {
102
- const theme = (0, import_react5.useContext)(XUIThemeContext);
103
- if (!theme) {
104
- throw new Error("useXUITheme must be used within XUIProvider");
105
- }
106
- return theme;
107
- }
108
-
109
- // src/core/index.ts
110
- var import_theme2 = require("@xaui/core/theme");
111
-
112
- // src/components/avatar/avatar.hook.ts
39
+ var _core = require('@xaui/core');
113
40
  var sizeMap = {
114
41
  xs: 24,
115
42
  sm: 32,
@@ -123,9 +50,9 @@ function resolveAvatarSize(size) {
123
50
  return sizeMap[size];
124
51
  }
125
52
  function useAvatarSizeStyles(size) {
126
- const theme = useXUITheme();
127
- const resolvedSize = (0, import_react6.useMemo)(() => resolveAvatarSize(size), [size]);
128
- const fontSize = (0, import_react6.useMemo)(() => {
53
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
54
+ const resolvedSize = _react.useMemo.call(void 0, () => resolveAvatarSize(size), [size]);
55
+ const fontSize = _react.useMemo.call(void 0, () => {
129
56
  if (typeof size === "number") {
130
57
  return Math.max(10, Math.round(size * 0.4));
131
58
  }
@@ -137,8 +64,8 @@ function useAvatarSizeStyles(size) {
137
64
  };
138
65
  }
139
66
  function useAvatarRadiusStyles(radius, size) {
140
- const theme = useXUITheme();
141
- return (0, import_react6.useMemo)(() => {
67
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
68
+ return _react.useMemo.call(void 0, () => {
142
69
  if (radius === "full") {
143
70
  return { borderRadius: size / 2 };
144
71
  }
@@ -153,16 +80,16 @@ function useAvatarRadiusStyles(radius, size) {
153
80
  }, [radius, size, theme]);
154
81
  }
155
82
  function useAvatarColors(themeColor, isDisabled) {
156
- const theme = useXUITheme();
157
- const safeThemeColor = (0, import_core.getSafeThemeColor)(themeColor);
83
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
84
+ const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
158
85
  const colorScheme = theme.colors[safeThemeColor];
159
- const backgroundColor = (0, import_react6.useMemo)(() => {
86
+ const backgroundColor = _react.useMemo.call(void 0, () => {
160
87
  if (isDisabled) {
161
88
  return theme.colors.background;
162
89
  }
163
90
  return colorScheme.background;
164
91
  }, [colorScheme.background, isDisabled, theme.colors.background]);
165
- const textColor = (0, import_react6.useMemo)(() => {
92
+ const textColor = _react.useMemo.call(void 0, () => {
166
93
  if (safeThemeColor === "default") {
167
94
  return theme.colors.foreground;
168
95
  }
@@ -201,18 +128,18 @@ var Avatar = ({
201
128
  getInitials,
202
129
  customAppearance
203
130
  }) => {
204
- const [isError, setIsError] = import_react7.default.useState(false);
131
+ const [isError, setIsError] = _react2.default.useState(false);
205
132
  const { size: resolvedSize, fontSize } = useAvatarSizeStyles(size);
206
133
  const radiusStyles = useAvatarRadiusStyles(radius, resolvedSize);
207
134
  const { backgroundColor, textColor, borderColor } = useAvatarColors(
208
135
  themeColor,
209
136
  isDisabled
210
137
  );
211
- const accessibilityLabel = name ?? "Avatar";
138
+ const accessibilityLabel = _nullishCoalesce(name, () => ( "Avatar"));
212
139
  const shouldShowFallback = showFallback || !src || isError;
213
- const initials = name ? (getInitials ?? getDefaultInitials)(name) : "";
214
- return /* @__PURE__ */ import_react7.default.createElement(
215
- import_react_native5.View,
140
+ const initials = name ? (_nullishCoalesce(getInitials, () => ( getDefaultInitials)))(name) : "";
141
+ return /* @__PURE__ */ _react2.default.createElement(
142
+ _reactnative.View,
216
143
  {
217
144
  style: [
218
145
  styles.container,
@@ -225,22 +152,22 @@ var Avatar = ({
225
152
  borderColor: isBordered ? borderColor : "transparent"
226
153
  },
227
154
  radiusStyles,
228
- customAppearance?.container
155
+ _optionalChain([customAppearance, 'optionalAccess', _ => _.container])
229
156
  ],
230
157
  accessible: true,
231
158
  accessibilityRole: "image",
232
159
  accessibilityLabel
233
160
  },
234
- !shouldShowFallback && src ? /* @__PURE__ */ import_react7.default.createElement(
235
- import_react_native5.Image,
161
+ !shouldShowFallback && src ? /* @__PURE__ */ _react2.default.createElement(
162
+ _reactnative.Image,
236
163
  {
237
164
  source: { uri: src },
238
- style: [styles.image, radiusStyles, customAppearance?.image],
165
+ style: [styles.image, radiusStyles, _optionalChain([customAppearance, 'optionalAccess', _2 => _2.image])],
239
166
  accessibilityLabel,
240
167
  onError: () => setIsError(true)
241
168
  }
242
- ) : /* @__PURE__ */ import_react7.default.createElement(import_react_native5.View, { style: [styles.fallback, { width: "100%", height: "100%" }] }, fallback ?? icon ?? /* @__PURE__ */ import_react7.default.createElement(
243
- import_react_native5.Text,
169
+ ) : /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.fallback, { width: "100%", height: "100%" }] }, _nullishCoalesce(_nullishCoalesce(fallback, () => ( icon)), () => ( /* @__PURE__ */ _react2.default.createElement(
170
+ _reactnative.Text,
244
171
  {
245
172
  style: [
246
173
  {
@@ -248,17 +175,17 @@ var Avatar = ({
248
175
  fontSize,
249
176
  fontWeight: "600"
250
177
  },
251
- customAppearance?.text
178
+ _optionalChain([customAppearance, 'optionalAccess', _3 => _3.text])
252
179
  ]
253
180
  },
254
181
  initials
255
- ))
182
+ ))))
256
183
  );
257
184
  };
258
185
 
259
186
  // src/components/avatar/avatar-group.tsx
260
- var import_react8 = __toESM(require("react"), 1);
261
- var import_react_native6 = require("react-native");
187
+
188
+
262
189
  var AvatarGroup = ({
263
190
  children,
264
191
  max,
@@ -272,35 +199,35 @@ var AvatarGroup = ({
272
199
  renderCount,
273
200
  customAppearance
274
201
  }) => {
275
- const theme = useXUITheme();
202
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
276
203
  const resolvedSize = resolveAvatarSize(size);
277
204
  const spacing = theme.spacing.xs;
278
205
  const overlap = Math.round(resolvedSize * 0.28);
279
- const allChildren = import_react8.default.Children.toArray(children).filter(
280
- (child) => import_react8.default.isValidElement(child)
206
+ const allChildren = _react2.default.Children.toArray(children).filter(
207
+ (child) => _react2.default.isValidElement(child)
281
208
  );
282
- const totalCount = total ?? allChildren.length;
283
- const maxCount = max ?? totalCount;
209
+ const totalCount = _nullishCoalesce(total, () => ( allChildren.length));
210
+ const maxCount = _nullishCoalesce(max, () => ( totalCount));
284
211
  const visibleChildren = allChildren.slice(0, maxCount);
285
212
  const remaining = Math.max(0, totalCount - maxCount);
286
213
  const enhanced = visibleChildren.map((child, index) => {
287
214
  const childProps = child.props;
288
- return /* @__PURE__ */ import_react8.default.createElement(
289
- import_react_native6.View,
215
+ return /* @__PURE__ */ _react2.default.createElement(
216
+ _reactnative.View,
290
217
  {
291
- key: child.key ?? index,
218
+ key: _nullishCoalesce(child.key, () => ( index)),
292
219
  style: isGrid ? { marginRight: spacing, marginBottom: spacing } : { marginLeft: index === 0 ? 0 : -overlap, zIndex: index }
293
220
  },
294
- import_react8.default.cloneElement(child, {
295
- size: childProps.size ?? size,
296
- radius: childProps.radius ?? radius,
297
- themeColor: childProps.themeColor ?? themeColor,
298
- isBordered: childProps.isBordered ?? isBordered,
299
- isDisabled: childProps.isDisabled ?? isDisabled
221
+ _react2.default.cloneElement(child, {
222
+ size: _nullishCoalesce(childProps.size, () => ( size)),
223
+ radius: _nullishCoalesce(childProps.radius, () => ( radius)),
224
+ themeColor: _nullishCoalesce(childProps.themeColor, () => ( themeColor)),
225
+ isBordered: _nullishCoalesce(childProps.isBordered, () => ( isBordered)),
226
+ isDisabled: _nullishCoalesce(childProps.isDisabled, () => ( isDisabled))
300
227
  })
301
228
  );
302
229
  });
303
- const countNode = remaining > 0 ? renderCount?.(remaining) ?? /* @__PURE__ */ import_react8.default.createElement(
230
+ const countNode = remaining > 0 ? _nullishCoalesce(_optionalChain([renderCount, 'optionalCall', _4 => _4(remaining)]), () => ( /* @__PURE__ */ _react2.default.createElement(
304
231
  Avatar,
305
232
  {
306
233
  name: `+${remaining}`,
@@ -310,8 +237,8 @@ var AvatarGroup = ({
310
237
  themeColor,
311
238
  isBordered,
312
239
  isDisabled,
313
- fallback: /* @__PURE__ */ import_react8.default.createElement(
314
- import_react_native6.Text,
240
+ fallback: /* @__PURE__ */ _react2.default.createElement(
241
+ _reactnative.Text,
315
242
  {
316
243
  style: {
317
244
  color: theme.colors.foreground,
@@ -323,11 +250,11 @@ var AvatarGroup = ({
323
250
  remaining
324
251
  )
325
252
  }
326
- ) : null;
253
+ ))) : null;
327
254
  if (countNode) {
328
255
  enhanced.push(
329
- /* @__PURE__ */ import_react8.default.createElement(
330
- import_react_native6.View,
256
+ /* @__PURE__ */ _react2.default.createElement(
257
+ _reactnative.View,
331
258
  {
332
259
  key: "avatar-count",
333
260
  style: isGrid ? { marginRight: spacing, marginBottom: spacing } : {
@@ -339,17 +266,16 @@ var AvatarGroup = ({
339
266
  )
340
267
  );
341
268
  }
342
- return /* @__PURE__ */ import_react8.default.createElement(
343
- import_react_native6.View,
269
+ return /* @__PURE__ */ _react2.default.createElement(
270
+ _reactnative.View,
344
271
  {
345
- style: [isGrid ? styles.grid : styles.group, customAppearance?.container],
272
+ style: [isGrid ? styles.grid : styles.group, _optionalChain([customAppearance, 'optionalAccess', _5 => _5.container])],
346
273
  accessible: true
347
274
  },
348
275
  enhanced
349
276
  );
350
277
  };
351
- // Annotate the CommonJS export names for ESM import in node:
352
- 0 && (module.exports = {
353
- Avatar,
354
- AvatarGroup
355
- });
278
+
279
+
280
+
281
+ exports.Avatar = Avatar; exports.AvatarGroup = AvatarGroup;
@@ -1,6 +1,7 @@
1
+ import "../chunk-DXXNBF5P.js";
1
2
  import {
2
3
  useXUITheme
3
- } from "../chunk-URBEEDFX.js";
4
+ } from "../chunk-LTKYHG5V.js";
4
5
 
5
6
  // src/components/avatar/avatar.tsx
6
7
  import React from "react";