Commit 0837ab7
authored
Add badge support to TabView and refactor icon rendering (#428)
* Add badge support to TabView, move modifier
Move BadgeModifier from List.swift into AdditionalViewModifiers.swift and keep its combined(for:) helper. Add badge support across TabView: import Badge/BadgedBox, add a badge property to TabContent, Tab, and TabSection, propagate badges to section children, and render tab icons inside a BadgedBox when a badge is present. Implement TabContent.badge(...) modifier overloads to set badge values instead of being unavailable, and apply the combined BadgeModifier when building tabs. Remove the duplicate BadgeModifier definition from List.swift.
* Refactor Tab icon rendering and badge offset
Rename iconContent to renderIcon and reformat Box initializer for clarity. Import Modifier.offset and apply a small offset (8.dp, -4.dp) to Badge so the badge is positioned correctly over tab icons. Ensure badge content is rendered with a white foregroundStyle for proper contrast. Minor cleanup of render calls to use renderIcon.
* Mark .badge as supported in README
Replace the detailed/partial-support row for `.badge` with a simple supported indicator (✅) in README.md. Removes the expandable details noting limited support on `List` and lack of `TabView` support, simplifying the support table entry.1 parent f571d1e commit 0837ab7
4 files changed
Lines changed: 79 additions & 48 deletions
File tree
- Sources/SkipUI/SkipUI
- Containers
- View
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1463 | 1463 | | |
1464 | 1464 | | |
1465 | 1465 | | |
1466 | | - | |
1467 | | - | |
1468 | | - | |
1469 | | - | |
1470 | | - | |
1471 | | - | |
1472 | | - | |
1473 | | - | |
1474 | | - | |
1475 | | - | |
| 1466 | + | |
| 1467 | + | |
1476 | 1468 | | |
1477 | 1469 | | |
1478 | 1470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1407 | 1407 | | |
1408 | 1408 | | |
1409 | 1409 | | |
1410 | | - | |
1411 | | - | |
1412 | | - | |
1413 | | - | |
1414 | | - | |
1415 | | - | |
1416 | | - | |
1417 | | - | |
1418 | | - | |
1419 | | - | |
1420 | | - | |
1421 | | - | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
1425 | | - | |
1426 | | - | |
1427 | | - | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
1431 | | - | |
1432 | | - | |
1433 | | - | |
1434 | 1410 | | |
1435 | 1411 | | |
1436 | 1412 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
231 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
232 | 239 | | |
233 | 240 | | |
234 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
235 | 244 | | |
236 | 245 | | |
237 | 246 | | |
| |||
743 | 752 | | |
744 | 753 | | |
745 | 754 | | |
| 755 | + | |
746 | 756 | | |
747 | 757 | | |
748 | 758 | | |
| |||
850 | 860 | | |
851 | 861 | | |
852 | 862 | | |
| 863 | + | |
853 | 864 | | |
854 | 865 | | |
855 | 866 | | |
| |||
888 | 899 | | |
889 | 900 | | |
890 | 901 | | |
891 | | - | |
892 | | - | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
893 | 907 | | |
894 | 908 | | |
895 | 909 | | |
| |||
905 | 919 | | |
906 | 920 | | |
907 | 921 | | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
908 | 938 | | |
909 | 939 | | |
910 | 940 | | |
| |||
960 | 990 | | |
961 | 991 | | |
962 | 992 | | |
| 993 | + | |
963 | 994 | | |
964 | 995 | | |
965 | 996 | | |
| |||
971 | 1002 | | |
972 | 1003 | | |
973 | 1004 | | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
974 | 1008 | | |
975 | 1009 | | |
976 | 1010 | | |
| |||
1078 | 1112 | | |
1079 | 1113 | | |
1080 | 1114 | | |
1081 | | - | |
1082 | 1115 | | |
1083 | | - | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
1084 | 1119 | | |
1085 | 1120 | | |
1086 | | - | |
1087 | 1121 | | |
1088 | | - | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
1089 | 1125 | | |
1090 | 1126 | | |
1091 | | - | |
1092 | 1127 | | |
1093 | | - | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1094 | 1131 | | |
1095 | 1132 | | |
1096 | | - | |
1097 | 1133 | | |
1098 | | - | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
1099 | 1137 | | |
1100 | 1138 | | |
1101 | | - | |
1102 | 1139 | | |
1103 | | - | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
1104 | 1143 | | |
1105 | 1144 | | |
1106 | 1145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1487 | 1487 | | |
1488 | 1488 | | |
1489 | 1489 | | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
1490 | 1514 | | |
1491 | 1515 | | |
1492 | 1516 | | |
| |||
0 commit comments