@entropix/react-native 0.1.1 → 0.3.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/dist/index.cjs CHANGED
@@ -968,6 +968,821 @@ function MenuItem({
968
968
  }
969
969
  );
970
970
  }
971
+ var KEYBOARD_TYPE_MAP = {
972
+ text: "default",
973
+ email: "email-address",
974
+ password: "default",
975
+ number: "numeric",
976
+ tel: "phone-pad",
977
+ url: "url",
978
+ search: "default"
979
+ };
980
+ function Input({
981
+ value,
982
+ defaultValue,
983
+ onChange,
984
+ disabled,
985
+ readOnly,
986
+ required,
987
+ invalid,
988
+ label,
989
+ helperText,
990
+ errorMessage,
991
+ placeholder,
992
+ type = "text",
993
+ size = "md",
994
+ style,
995
+ inputStyle,
996
+ textStyle,
997
+ testID
998
+ }) {
999
+ const { tokens: t, baseTokens: bt } = useTheme();
1000
+ const {
1001
+ value: inputValue,
1002
+ isDisabled,
1003
+ isReadOnly,
1004
+ isInvalid,
1005
+ setValue,
1006
+ getInputProps
1007
+ } = core.useInput({
1008
+ value,
1009
+ defaultValue,
1010
+ onChange,
1011
+ disabled,
1012
+ readOnly,
1013
+ required,
1014
+ invalid,
1015
+ type,
1016
+ placeholder
1017
+ });
1018
+ const propGetterReturn = getInputProps();
1019
+ const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1020
+ const handleChangeText = react.useCallback(
1021
+ (text) => {
1022
+ setValue(text);
1023
+ },
1024
+ [setValue]
1025
+ );
1026
+ const sizeStyles = getSizeStyles(size, bt);
1027
+ const showError = isInvalid && errorMessage;
1028
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [{ gap: bt.entropixSpacing1 }, style], children: [
1029
+ label ? /* @__PURE__ */ jsxRuntime.jsxs(
1030
+ reactNative.Text,
1031
+ {
1032
+ style: [
1033
+ {
1034
+ fontSize: sizeStyles.labelFontSize,
1035
+ fontWeight: "500",
1036
+ color: t.entropixColorTextPrimary
1037
+ },
1038
+ textStyle
1039
+ ],
1040
+ children: [
1041
+ label,
1042
+ required ? " *" : ""
1043
+ ]
1044
+ }
1045
+ ) : null,
1046
+ /* @__PURE__ */ jsxRuntime.jsx(
1047
+ reactNative.TextInput,
1048
+ {
1049
+ ...rnAccessibility,
1050
+ testID,
1051
+ value: inputValue,
1052
+ onChangeText: handleChangeText,
1053
+ placeholder,
1054
+ placeholderTextColor: t.entropixColorTextTertiary,
1055
+ editable: !isDisabled && !isReadOnly,
1056
+ secureTextEntry: type === "password",
1057
+ keyboardType: KEYBOARD_TYPE_MAP[type] ?? "default",
1058
+ style: [
1059
+ {
1060
+ paddingVertical: sizeStyles.paddingVertical,
1061
+ paddingHorizontal: sizeStyles.paddingHorizontal,
1062
+ fontSize: sizeStyles.fontSize,
1063
+ borderWidth: 1,
1064
+ borderColor: showError ? t.entropixColorBorderDanger : t.entropixColorBorderDefault,
1065
+ borderRadius: bt.entropixRadiusMd,
1066
+ backgroundColor: t.entropixColorBgPrimary,
1067
+ color: t.entropixColorTextPrimary
1068
+ },
1069
+ isDisabled && { opacity: 0.5 },
1070
+ inputStyle
1071
+ ]
1072
+ }
1073
+ ),
1074
+ showError ? /* @__PURE__ */ jsxRuntime.jsx(
1075
+ reactNative.Text,
1076
+ {
1077
+ style: [
1078
+ {
1079
+ fontSize: sizeStyles.helperFontSize,
1080
+ color: t.entropixColorTextDanger
1081
+ },
1082
+ textStyle
1083
+ ],
1084
+ accessibilityRole: "alert",
1085
+ accessibilityLiveRegion: "polite",
1086
+ children: errorMessage
1087
+ }
1088
+ ) : helperText ? /* @__PURE__ */ jsxRuntime.jsx(
1089
+ reactNative.Text,
1090
+ {
1091
+ style: [
1092
+ {
1093
+ fontSize: sizeStyles.helperFontSize,
1094
+ color: t.entropixColorTextSecondary
1095
+ },
1096
+ textStyle
1097
+ ],
1098
+ children: helperText
1099
+ }
1100
+ ) : null
1101
+ ] });
1102
+ }
1103
+ function getSizeStyles(size, bt) {
1104
+ switch (size) {
1105
+ case "sm":
1106
+ return {
1107
+ paddingVertical: bt.entropixSpacing1,
1108
+ paddingHorizontal: bt.entropixSpacing2,
1109
+ fontSize: bt.entropixFontSizeXs,
1110
+ labelFontSize: bt.entropixFontSizeXs,
1111
+ helperFontSize: bt.entropixFontSizeXs - 1
1112
+ };
1113
+ case "lg":
1114
+ return {
1115
+ paddingVertical: bt.entropixSpacing3,
1116
+ paddingHorizontal: bt.entropixSpacing4,
1117
+ fontSize: bt.entropixFontSizeBase,
1118
+ labelFontSize: bt.entropixFontSizeBase,
1119
+ helperFontSize: bt.entropixFontSizeSm
1120
+ };
1121
+ default:
1122
+ return {
1123
+ paddingVertical: bt.entropixSpacing2,
1124
+ paddingHorizontal: bt.entropixSpacing3,
1125
+ fontSize: bt.entropixFontSizeSm,
1126
+ labelFontSize: bt.entropixFontSizeSm,
1127
+ helperFontSize: bt.entropixFontSizeXs
1128
+ };
1129
+ }
1130
+ }
1131
+ function Textarea({
1132
+ value,
1133
+ defaultValue,
1134
+ onChange,
1135
+ disabled,
1136
+ readOnly,
1137
+ required,
1138
+ invalid,
1139
+ label,
1140
+ helperText,
1141
+ errorMessage,
1142
+ placeholder,
1143
+ numberOfLines = 4,
1144
+ size = "md",
1145
+ style,
1146
+ inputStyle,
1147
+ textStyle,
1148
+ testID
1149
+ }) {
1150
+ const { tokens: t, baseTokens: bt } = useTheme();
1151
+ const {
1152
+ value: inputValue,
1153
+ isDisabled,
1154
+ isReadOnly,
1155
+ isInvalid,
1156
+ setValue,
1157
+ getInputProps
1158
+ } = core.useInput({
1159
+ value,
1160
+ defaultValue,
1161
+ onChange,
1162
+ disabled,
1163
+ readOnly,
1164
+ required,
1165
+ invalid,
1166
+ type: "text",
1167
+ placeholder
1168
+ });
1169
+ const propGetterReturn = getInputProps();
1170
+ const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1171
+ const handleChangeText = react.useCallback(
1172
+ (text) => {
1173
+ setValue(text);
1174
+ },
1175
+ [setValue]
1176
+ );
1177
+ const sizeStyles = getSizeStyles2(size, bt);
1178
+ const showError = isInvalid && errorMessage;
1179
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [{ gap: bt.entropixSpacing1 }, style], children: [
1180
+ label ? /* @__PURE__ */ jsxRuntime.jsxs(
1181
+ reactNative.Text,
1182
+ {
1183
+ style: [
1184
+ {
1185
+ fontSize: sizeStyles.labelFontSize,
1186
+ fontWeight: "500",
1187
+ color: t.entropixColorTextPrimary
1188
+ },
1189
+ textStyle
1190
+ ],
1191
+ children: [
1192
+ label,
1193
+ required ? " *" : ""
1194
+ ]
1195
+ }
1196
+ ) : null,
1197
+ /* @__PURE__ */ jsxRuntime.jsx(
1198
+ reactNative.TextInput,
1199
+ {
1200
+ ...rnAccessibility,
1201
+ testID,
1202
+ value: inputValue,
1203
+ onChangeText: handleChangeText,
1204
+ placeholder,
1205
+ placeholderTextColor: t.entropixColorTextTertiary,
1206
+ editable: !isDisabled && !isReadOnly,
1207
+ multiline: true,
1208
+ numberOfLines,
1209
+ textAlignVertical: "top",
1210
+ style: [
1211
+ {
1212
+ paddingVertical: sizeStyles.paddingVertical,
1213
+ paddingHorizontal: sizeStyles.paddingHorizontal,
1214
+ fontSize: sizeStyles.fontSize,
1215
+ borderWidth: 1,
1216
+ borderColor: showError ? t.entropixColorBorderDanger : t.entropixColorBorderDefault,
1217
+ borderRadius: bt.entropixRadiusMd,
1218
+ backgroundColor: t.entropixColorBgPrimary,
1219
+ color: t.entropixColorTextPrimary,
1220
+ minHeight: numberOfLines * (sizeStyles.fontSize + 8)
1221
+ },
1222
+ isDisabled && { opacity: 0.5 },
1223
+ inputStyle
1224
+ ]
1225
+ }
1226
+ ),
1227
+ showError ? /* @__PURE__ */ jsxRuntime.jsx(
1228
+ reactNative.Text,
1229
+ {
1230
+ style: [
1231
+ {
1232
+ fontSize: sizeStyles.helperFontSize,
1233
+ color: t.entropixColorTextDanger
1234
+ },
1235
+ textStyle
1236
+ ],
1237
+ accessibilityRole: "alert",
1238
+ accessibilityLiveRegion: "polite",
1239
+ children: errorMessage
1240
+ }
1241
+ ) : helperText ? /* @__PURE__ */ jsxRuntime.jsx(
1242
+ reactNative.Text,
1243
+ {
1244
+ style: [
1245
+ {
1246
+ fontSize: sizeStyles.helperFontSize,
1247
+ color: t.entropixColorTextSecondary
1248
+ },
1249
+ textStyle
1250
+ ],
1251
+ children: helperText
1252
+ }
1253
+ ) : null
1254
+ ] });
1255
+ }
1256
+ function getSizeStyles2(size, bt) {
1257
+ switch (size) {
1258
+ case "sm":
1259
+ return {
1260
+ paddingVertical: bt.entropixSpacing1,
1261
+ paddingHorizontal: bt.entropixSpacing2,
1262
+ fontSize: bt.entropixFontSizeXs,
1263
+ labelFontSize: bt.entropixFontSizeXs,
1264
+ helperFontSize: bt.entropixFontSizeXs - 1
1265
+ };
1266
+ case "lg":
1267
+ return {
1268
+ paddingVertical: bt.entropixSpacing3,
1269
+ paddingHorizontal: bt.entropixSpacing4,
1270
+ fontSize: bt.entropixFontSizeBase,
1271
+ labelFontSize: bt.entropixFontSizeBase,
1272
+ helperFontSize: bt.entropixFontSizeSm
1273
+ };
1274
+ default:
1275
+ return {
1276
+ paddingVertical: bt.entropixSpacing2,
1277
+ paddingHorizontal: bt.entropixSpacing3,
1278
+ fontSize: bt.entropixFontSizeSm,
1279
+ labelFontSize: bt.entropixFontSizeSm,
1280
+ helperFontSize: bt.entropixFontSizeXs
1281
+ };
1282
+ }
1283
+ }
1284
+ function Checkbox({
1285
+ checked,
1286
+ defaultChecked,
1287
+ onChange,
1288
+ disabled,
1289
+ indeterminate,
1290
+ label,
1291
+ size = "md",
1292
+ style,
1293
+ textStyle,
1294
+ children,
1295
+ ...rest
1296
+ }) {
1297
+ const { tokens: t, baseTokens: bt } = useTheme();
1298
+ const { isChecked, isDisabled, getToggleProps } = core.useToggle({
1299
+ checked,
1300
+ defaultChecked,
1301
+ onChange,
1302
+ disabled,
1303
+ role: "checkbox"
1304
+ });
1305
+ const propGetterReturn = getToggleProps();
1306
+ const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1307
+ if (indeterminate) {
1308
+ rnAccessibility.accessibilityState = {
1309
+ ...rnAccessibility.accessibilityState,
1310
+ checked: "mixed"
1311
+ };
1312
+ }
1313
+ if (label) {
1314
+ rnAccessibility.accessibilityLabel = label;
1315
+ }
1316
+ const handlePress = react.useCallback(() => {
1317
+ propGetterReturn.onAction?.();
1318
+ }, [propGetterReturn.onAction]);
1319
+ const sizeStyles = getSizeStyles3(size, bt);
1320
+ const isActive = indeterminate || isChecked;
1321
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1322
+ reactNative.Pressable,
1323
+ {
1324
+ ...rnAccessibility,
1325
+ ...rest,
1326
+ disabled: isDisabled,
1327
+ onPress: isDisabled ? void 0 : handlePress,
1328
+ style: [
1329
+ {
1330
+ flexDirection: "row",
1331
+ alignItems: "center",
1332
+ gap: bt.entropixSpacing2
1333
+ },
1334
+ isDisabled && { opacity: 0.5 },
1335
+ style
1336
+ ],
1337
+ children: [
1338
+ /* @__PURE__ */ jsxRuntime.jsx(
1339
+ reactNative.View,
1340
+ {
1341
+ style: {
1342
+ width: sizeStyles.boxSize,
1343
+ height: sizeStyles.boxSize,
1344
+ borderWidth: 2,
1345
+ borderColor: isActive ? t.entropixColorActionPrimaryDefault : t.entropixColorBorderDefault,
1346
+ borderRadius: bt.entropixRadiusSm,
1347
+ backgroundColor: isActive ? t.entropixColorActionPrimaryDefault : "transparent",
1348
+ alignItems: "center",
1349
+ justifyContent: "center"
1350
+ },
1351
+ children: indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(
1352
+ reactNative.Text,
1353
+ {
1354
+ style: {
1355
+ fontSize: sizeStyles.indicatorFontSize,
1356
+ fontWeight: "700",
1357
+ color: t.entropixColorTextInverse,
1358
+ lineHeight: sizeStyles.boxSize - 2
1359
+ },
1360
+ children: "\u2013"
1361
+ }
1362
+ ) : isChecked ? /* @__PURE__ */ jsxRuntime.jsx(
1363
+ reactNative.Text,
1364
+ {
1365
+ style: {
1366
+ fontSize: sizeStyles.indicatorFontSize,
1367
+ fontWeight: "700",
1368
+ color: t.entropixColorTextInverse,
1369
+ lineHeight: sizeStyles.boxSize - 2
1370
+ },
1371
+ children: "\u2713"
1372
+ }
1373
+ ) : null
1374
+ }
1375
+ ),
1376
+ typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1377
+ reactNative.Text,
1378
+ {
1379
+ style: [
1380
+ {
1381
+ fontSize: sizeStyles.fontSize,
1382
+ color: t.entropixColorTextPrimary
1383
+ },
1384
+ textStyle
1385
+ ],
1386
+ children
1387
+ }
1388
+ ) : children != null ? children : label ? /* @__PURE__ */ jsxRuntime.jsx(
1389
+ reactNative.Text,
1390
+ {
1391
+ style: [
1392
+ {
1393
+ fontSize: sizeStyles.fontSize,
1394
+ color: t.entropixColorTextPrimary
1395
+ },
1396
+ textStyle
1397
+ ],
1398
+ children: label
1399
+ }
1400
+ ) : null
1401
+ ]
1402
+ }
1403
+ );
1404
+ }
1405
+ function getSizeStyles3(size, bt) {
1406
+ switch (size) {
1407
+ case "sm":
1408
+ return {
1409
+ boxSize: 16,
1410
+ indicatorFontSize: 10,
1411
+ fontSize: bt.entropixFontSizeXs
1412
+ };
1413
+ case "lg":
1414
+ return {
1415
+ boxSize: 24,
1416
+ indicatorFontSize: 16,
1417
+ fontSize: bt.entropixFontSizeBase
1418
+ };
1419
+ default:
1420
+ return {
1421
+ boxSize: 20,
1422
+ indicatorFontSize: 13,
1423
+ fontSize: bt.entropixFontSizeSm
1424
+ };
1425
+ }
1426
+ }
1427
+ var RadioGroupContext = react.createContext(null);
1428
+ function useRadioGroupContext() {
1429
+ const context = react.useContext(RadioGroupContext);
1430
+ if (!context) {
1431
+ throw new Error(
1432
+ "Radio compound components must be used within a <RadioGroup> provider."
1433
+ );
1434
+ }
1435
+ return context;
1436
+ }
1437
+ function RadioGroup({
1438
+ label,
1439
+ style,
1440
+ textStyle,
1441
+ children,
1442
+ testID,
1443
+ ...options
1444
+ }) {
1445
+ const { tokens: t, baseTokens: bt } = useTheme();
1446
+ const radioGroup = core.useRadioGroup(options);
1447
+ const propGetterReturn = radioGroup.getRadioGroupProps();
1448
+ const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1449
+ if (label) {
1450
+ rnAccessibility.accessibilityLabel = label;
1451
+ }
1452
+ return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupContext.Provider, { value: radioGroup, children: /* @__PURE__ */ jsxRuntime.jsxs(
1453
+ reactNative.View,
1454
+ {
1455
+ ...rnAccessibility,
1456
+ testID,
1457
+ style: [
1458
+ {
1459
+ gap: bt.entropixSpacing2
1460
+ },
1461
+ style
1462
+ ],
1463
+ children: [
1464
+ label ? /* @__PURE__ */ jsxRuntime.jsx(
1465
+ reactNative.Text,
1466
+ {
1467
+ style: [
1468
+ {
1469
+ fontSize: bt.entropixFontSizeSm,
1470
+ fontWeight: "500",
1471
+ color: t.entropixColorTextPrimary
1472
+ },
1473
+ textStyle
1474
+ ],
1475
+ children: label
1476
+ }
1477
+ ) : null,
1478
+ children
1479
+ ]
1480
+ }
1481
+ ) });
1482
+ }
1483
+ function RadioItem({
1484
+ value,
1485
+ disabled,
1486
+ style,
1487
+ textStyle,
1488
+ children,
1489
+ ...rest
1490
+ }) {
1491
+ const { tokens: t, baseTokens: bt } = useTheme();
1492
+ const { getRadioProps } = useRadioGroupContext();
1493
+ const propGetterReturn = getRadioProps(value, { disabled });
1494
+ const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1495
+ const isChecked = propGetterReturn.accessibility.checked === true;
1496
+ const isDisabled = propGetterReturn.accessibility.disabled === true;
1497
+ const handlePress = react.useCallback(() => {
1498
+ propGetterReturn.onAction?.();
1499
+ }, [propGetterReturn.onAction]);
1500
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1501
+ reactNative.Pressable,
1502
+ {
1503
+ ...rnAccessibility,
1504
+ ...rest,
1505
+ disabled: isDisabled,
1506
+ onPress: isDisabled ? void 0 : handlePress,
1507
+ style: [
1508
+ {
1509
+ flexDirection: "row",
1510
+ alignItems: "center",
1511
+ gap: bt.entropixSpacing2
1512
+ },
1513
+ isDisabled && { opacity: 0.5 },
1514
+ style
1515
+ ],
1516
+ children: [
1517
+ /* @__PURE__ */ jsxRuntime.jsx(
1518
+ reactNative.View,
1519
+ {
1520
+ style: {
1521
+ width: 20,
1522
+ height: 20,
1523
+ borderRadius: 10,
1524
+ borderWidth: 2,
1525
+ borderColor: isChecked ? t.entropixColorActionPrimaryDefault : t.entropixColorBorderDefault,
1526
+ alignItems: "center",
1527
+ justifyContent: "center"
1528
+ },
1529
+ children: isChecked ? /* @__PURE__ */ jsxRuntime.jsx(
1530
+ reactNative.View,
1531
+ {
1532
+ style: {
1533
+ width: 10,
1534
+ height: 10,
1535
+ borderRadius: 5,
1536
+ backgroundColor: t.entropixColorActionPrimaryDefault
1537
+ }
1538
+ }
1539
+ ) : null
1540
+ }
1541
+ ),
1542
+ typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1543
+ reactNative.Text,
1544
+ {
1545
+ style: [
1546
+ {
1547
+ fontSize: bt.entropixFontSizeSm,
1548
+ color: t.entropixColorTextPrimary
1549
+ },
1550
+ textStyle
1551
+ ],
1552
+ children
1553
+ }
1554
+ ) : children
1555
+ ]
1556
+ }
1557
+ );
1558
+ }
1559
+ var SelectContext = react.createContext(null);
1560
+ function useSelectContext() {
1561
+ const context = react.useContext(SelectContext);
1562
+ if (!context) {
1563
+ throw new Error(
1564
+ "Select compound components must be used within a <Select> provider."
1565
+ );
1566
+ }
1567
+ return context;
1568
+ }
1569
+ function Select({
1570
+ label,
1571
+ style,
1572
+ textStyle,
1573
+ children,
1574
+ testID,
1575
+ ...options
1576
+ }) {
1577
+ const { tokens: t, baseTokens: bt } = useTheme();
1578
+ const select = core.useSelect(options);
1579
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectContext.Provider, { value: select, children: /* @__PURE__ */ jsxRuntime.jsxs(
1580
+ reactNative.View,
1581
+ {
1582
+ testID,
1583
+ style: [{ gap: bt.entropixSpacing1 }, style],
1584
+ children: [
1585
+ label ? /* @__PURE__ */ jsxRuntime.jsx(
1586
+ reactNative.Text,
1587
+ {
1588
+ style: [
1589
+ {
1590
+ fontSize: bt.entropixFontSizeSm,
1591
+ fontWeight: "500",
1592
+ color: t.entropixColorTextPrimary
1593
+ },
1594
+ textStyle
1595
+ ],
1596
+ children: label
1597
+ }
1598
+ ) : null,
1599
+ children
1600
+ ]
1601
+ }
1602
+ ) });
1603
+ }
1604
+ function SelectTrigger({
1605
+ placeholder = "Select...",
1606
+ displayValue,
1607
+ style,
1608
+ textStyle,
1609
+ ...rest
1610
+ }) {
1611
+ const { tokens: t, baseTokens: bt } = useTheme();
1612
+ const { selectedValue, isDisabled, isOpen, getTriggerProps } = useSelectContext();
1613
+ const propGetterReturn = getTriggerProps();
1614
+ const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1615
+ const handlePress = react.useCallback(() => {
1616
+ propGetterReturn.onAction?.();
1617
+ }, [propGetterReturn.onAction]);
1618
+ const hasValue = selectedValue !== "";
1619
+ const label = displayValue ?? (hasValue ? selectedValue : placeholder);
1620
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1621
+ reactNative.Pressable,
1622
+ {
1623
+ ...rnAccessibility,
1624
+ ...rest,
1625
+ disabled: isDisabled,
1626
+ onPress: isDisabled ? void 0 : handlePress,
1627
+ style: [
1628
+ {
1629
+ flexDirection: "row",
1630
+ alignItems: "center",
1631
+ justifyContent: "space-between",
1632
+ paddingVertical: bt.entropixSpacing2,
1633
+ paddingHorizontal: bt.entropixSpacing3,
1634
+ borderWidth: 1,
1635
+ borderColor: isOpen ? t.entropixColorActionPrimaryDefault : t.entropixColorBorderDefault,
1636
+ borderRadius: bt.entropixRadiusMd,
1637
+ backgroundColor: t.entropixColorBgPrimary
1638
+ },
1639
+ isDisabled && { opacity: 0.5 },
1640
+ style
1641
+ ],
1642
+ children: [
1643
+ /* @__PURE__ */ jsxRuntime.jsx(
1644
+ reactNative.Text,
1645
+ {
1646
+ style: [
1647
+ {
1648
+ fontSize: bt.entropixFontSizeSm,
1649
+ color: hasValue ? t.entropixColorTextPrimary : t.entropixColorTextTertiary,
1650
+ flex: 1
1651
+ },
1652
+ textStyle
1653
+ ],
1654
+ numberOfLines: 1,
1655
+ children: label
1656
+ }
1657
+ ),
1658
+ /* @__PURE__ */ jsxRuntime.jsx(
1659
+ reactNative.Text,
1660
+ {
1661
+ style: {
1662
+ fontSize: bt.entropixFontSizeXs,
1663
+ color: t.entropixColorTextSecondary,
1664
+ marginLeft: bt.entropixSpacing2
1665
+ },
1666
+ children: "\u25BC"
1667
+ }
1668
+ )
1669
+ ]
1670
+ }
1671
+ );
1672
+ }
1673
+ function SelectContent({ children, style, testID }) {
1674
+ const { tokens: t, baseTokens: bt } = useTheme();
1675
+ const { isOpen, close, getListboxProps } = useSelectContext();
1676
+ const propGetterReturn = getListboxProps();
1677
+ const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1678
+ if (!isOpen) return null;
1679
+ return /* @__PURE__ */ jsxRuntime.jsx(
1680
+ reactNative.Modal,
1681
+ {
1682
+ visible: isOpen,
1683
+ transparent: true,
1684
+ animationType: "fade",
1685
+ onRequestClose: close,
1686
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1687
+ reactNative.Pressable,
1688
+ {
1689
+ style: {
1690
+ flex: 1,
1691
+ justifyContent: "center",
1692
+ alignItems: "center",
1693
+ backgroundColor: "rgba(0,0,0,0.3)"
1694
+ },
1695
+ onPress: close,
1696
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1697
+ reactNative.Pressable,
1698
+ {
1699
+ onPress: () => {
1700
+ },
1701
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1702
+ reactNative.View,
1703
+ {
1704
+ ...rnAccessibility,
1705
+ testID,
1706
+ style: [
1707
+ {
1708
+ minWidth: 240,
1709
+ maxHeight: 300,
1710
+ padding: bt.entropixSpacing1,
1711
+ backgroundColor: t.entropixColorBgPrimary,
1712
+ borderWidth: 1,
1713
+ borderColor: t.entropixColorBorderDefault,
1714
+ borderRadius: bt.entropixRadiusMd,
1715
+ shadowColor: "#000",
1716
+ shadowOffset: { width: 0, height: 4 },
1717
+ shadowOpacity: 0.15,
1718
+ shadowRadius: 12,
1719
+ elevation: 8
1720
+ },
1721
+ style
1722
+ ],
1723
+ children
1724
+ }
1725
+ )
1726
+ }
1727
+ )
1728
+ }
1729
+ )
1730
+ }
1731
+ );
1732
+ }
1733
+ function SelectOption({
1734
+ value,
1735
+ index,
1736
+ disabled,
1737
+ style,
1738
+ textStyle,
1739
+ children,
1740
+ ...rest
1741
+ }) {
1742
+ const { tokens: t, baseTokens: bt } = useTheme();
1743
+ const { getOptionProps } = useSelectContext();
1744
+ const propGetterReturn = getOptionProps(value, index ?? 0, { disabled });
1745
+ const rnAccessibility = mapAccessibilityToRN(propGetterReturn.accessibility);
1746
+ const isSelected = propGetterReturn.accessibility.selected === true;
1747
+ const handlePress = react.useCallback(() => {
1748
+ propGetterReturn.onAction?.();
1749
+ }, [propGetterReturn.onAction]);
1750
+ return /* @__PURE__ */ jsxRuntime.jsx(
1751
+ reactNative.Pressable,
1752
+ {
1753
+ ...rnAccessibility,
1754
+ ...rest,
1755
+ disabled,
1756
+ onPress: propGetterReturn.onAction ? handlePress : void 0,
1757
+ style: [
1758
+ {
1759
+ flexDirection: "row",
1760
+ alignItems: "center",
1761
+ paddingVertical: bt.entropixSpacing2,
1762
+ paddingHorizontal: bt.entropixSpacing3,
1763
+ borderRadius: bt.entropixRadiusSm,
1764
+ backgroundColor: isSelected ? t.entropixColorBgSecondary : "transparent"
1765
+ },
1766
+ disabled && { opacity: 0.5 },
1767
+ style
1768
+ ],
1769
+ children: typeof children === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1770
+ reactNative.Text,
1771
+ {
1772
+ style: [
1773
+ {
1774
+ fontSize: bt.entropixFontSizeSm,
1775
+ fontWeight: isSelected ? "600" : "400",
1776
+ color: t.entropixColorTextPrimary
1777
+ },
1778
+ textStyle
1779
+ ],
1780
+ children
1781
+ }
1782
+ ) : children
1783
+ }
1784
+ );
1785
+ }
971
1786
  var BREAKPOINTS = {
972
1787
  sm: 640,
973
1788
  md: 768,
@@ -1215,6 +2030,7 @@ exports.AccordionPanel = AccordionPanel;
1215
2030
  exports.AccordionTrigger = AccordionTrigger;
1216
2031
  exports.BREAKPOINTS = BREAKPOINTS;
1217
2032
  exports.Button = Button;
2033
+ exports.Checkbox = Checkbox;
1218
2034
  exports.Container = Container;
1219
2035
  exports.Dialog = Dialog;
1220
2036
  exports.DialogClose = DialogClose;
@@ -1226,16 +2042,24 @@ exports.DialogTrigger = DialogTrigger;
1226
2042
  exports.Divider = Divider;
1227
2043
  exports.EntropixProvider = EntropixProvider;
1228
2044
  exports.Inline = Inline;
2045
+ exports.Input = Input;
1229
2046
  exports.Menu = Menu;
1230
2047
  exports.MenuContent = MenuContent;
1231
2048
  exports.MenuItem = MenuItem;
1232
2049
  exports.MenuTrigger = MenuTrigger;
2050
+ exports.RadioGroup = RadioGroup;
2051
+ exports.RadioItem = RadioItem;
2052
+ exports.Select = Select;
2053
+ exports.SelectContent = SelectContent;
2054
+ exports.SelectOption = SelectOption;
2055
+ exports.SelectTrigger = SelectTrigger;
1233
2056
  exports.Stack = Stack;
1234
2057
  exports.Switch = Switch;
1235
2058
  exports.Tab = Tab;
1236
2059
  exports.TabList = TabList;
1237
2060
  exports.TabPanel = TabPanel;
1238
2061
  exports.Tabs = Tabs;
2062
+ exports.Textarea = Textarea;
1239
2063
  exports.Toggle = Toggle;
1240
2064
  exports.mapAccessibilityToRN = mapAccessibilityToRN;
1241
2065
  exports.useBreakpoint = useBreakpoint;