@btndprojects/loam-ui-native 0.0.0-stage → 0.1.1

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 (269) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +55 -2
  3. package/dist/accordion/index.js +3 -0
  4. package/dist/adaptive/index.js +2 -0
  5. package/dist/alert/index.js +3 -0
  6. package/dist/analyzer/index.js +6 -0
  7. package/dist/announcement/index.js +6 -0
  8. package/dist/audio-player/index.js +3 -0
  9. package/dist/avatar/index.js +3 -0
  10. package/dist/avatar-group/index.js +3 -0
  11. package/dist/badge/index.js +5 -0
  12. package/dist/banner/index.js +2 -0
  13. package/dist/board/index.js +7 -0
  14. package/dist/button/index.js +5 -0
  15. package/dist/camera-permission/index.js +13 -0
  16. package/dist/capture-result/index.js +18 -0
  17. package/dist/card/index.js +4 -0
  18. package/dist/card-form/index.js +10 -0
  19. package/dist/carousel/index.js +2 -0
  20. package/dist/chart/index.js +6 -0
  21. package/dist/charts/index.js +7 -0
  22. package/dist/checkbox/index.js +7 -0
  23. package/dist/checklist/index.js +10 -0
  24. package/dist/checkout/index.js +13 -0
  25. package/dist/chip/index.js +7 -0
  26. package/dist/chunk-223Q2T2Q.js +229 -0
  27. package/dist/chunk-2A5NIQAK.js +254 -0
  28. package/dist/chunk-2GK6PHGE.js +363 -0
  29. package/dist/chunk-2WUTXHMU.js +1 -0
  30. package/dist/chunk-2ZZ7TDJ4.js +324 -0
  31. package/dist/chunk-35OFI3JG.js +499 -0
  32. package/dist/chunk-3ARE4TES.js +195 -0
  33. package/dist/chunk-3ECPOSKO.js +1 -0
  34. package/dist/chunk-3ENTMPQY.js +229 -0
  35. package/dist/chunk-3HJH6FF4.js +98 -0
  36. package/dist/chunk-3NMD74ZU.js +4 -0
  37. package/dist/chunk-3WPW4KUN.js +182 -0
  38. package/dist/chunk-423B7SPN.js +993 -0
  39. package/dist/chunk-47FWHGUN.js +394 -0
  40. package/dist/chunk-4BXMXBJO.js +141 -0
  41. package/dist/chunk-4DS5ZWVC.js +83 -0
  42. package/dist/chunk-4GBOGOTV.js +295 -0
  43. package/dist/chunk-4SZYY6AN.js +99 -0
  44. package/dist/chunk-4YIP3CWS.js +237 -0
  45. package/dist/chunk-4YQOR7JM.js +204 -0
  46. package/dist/chunk-4ZAHCY44.js +177 -0
  47. package/dist/chunk-52X2VYTD.js +228 -0
  48. package/dist/chunk-5P26LBDL.js +1 -0
  49. package/dist/chunk-5XLRYDAX.js +1 -0
  50. package/dist/chunk-5YNTNN5A.js +177 -0
  51. package/dist/chunk-6HT2LP62.js +504 -0
  52. package/dist/chunk-6N33LFQA.js +35 -0
  53. package/dist/chunk-6X6PQ443.js +432 -0
  54. package/dist/chunk-7CFF4HXS.js +126 -0
  55. package/dist/chunk-7O2FMUPT.js +755 -0
  56. package/dist/chunk-AI4DWZCD.js +162 -0
  57. package/dist/chunk-AWJOCGFZ.js +213 -0
  58. package/dist/chunk-AZRX6SAC.js +285 -0
  59. package/dist/chunk-B54QE2FN.js +1 -0
  60. package/dist/chunk-BC475SJH.js +1 -0
  61. package/dist/chunk-BEDBFJND.js +202 -0
  62. package/dist/chunk-BTTFCMKG.js +166 -0
  63. package/dist/chunk-BV3B2HYZ.js +1635 -0
  64. package/dist/chunk-C2NTXVWM.js +98 -0
  65. package/dist/chunk-CDRZHT42.js +424 -0
  66. package/dist/chunk-CJ5EOYZE.js +62 -0
  67. package/dist/chunk-CUMUNPXY.js +128 -0
  68. package/dist/chunk-CUS3ZSCU.js +1 -0
  69. package/dist/chunk-CYRBHQQZ.js +411 -0
  70. package/dist/chunk-DHWADYZX.js +144 -0
  71. package/dist/chunk-DKCSPATL.js +1 -0
  72. package/dist/chunk-DM5QUKKO.js +326 -0
  73. package/dist/chunk-DYBH2I6W.js +1 -0
  74. package/dist/chunk-DZ255O2F.js +1 -0
  75. package/dist/chunk-E35BPSGW.js +1 -0
  76. package/dist/chunk-EJBDRVIH.js +166 -0
  77. package/dist/chunk-F43NP42L.js +1 -0
  78. package/dist/chunk-F5XNPWS7.js +1024 -0
  79. package/dist/chunk-FMYDDECK.js +1521 -0
  80. package/dist/chunk-G3HOYSF7.js +1 -0
  81. package/dist/chunk-GDKZTW34.js +395 -0
  82. package/dist/chunk-GL7B2DOW.js +134 -0
  83. package/dist/chunk-GNNJ4GCC.js +471 -0
  84. package/dist/chunk-GNZ56EUI.js +1 -0
  85. package/dist/chunk-H6NIOQHK.js +346 -0
  86. package/dist/chunk-H6PC7RDA.js +1 -0
  87. package/dist/chunk-HET4LLMX.js +129 -0
  88. package/dist/chunk-HPPW424V.js +334 -0
  89. package/dist/chunk-HQOQIBJI.js +1 -0
  90. package/dist/chunk-HU2EQNRZ.js +44 -0
  91. package/dist/chunk-HZ6CNMAF.js +870 -0
  92. package/dist/chunk-IIQTAY3J.js +715 -0
  93. package/dist/chunk-ITTYJZWX.js +271 -0
  94. package/dist/chunk-IVNRBPGC.js +1018 -0
  95. package/dist/chunk-J4KLDGI4.js +1 -0
  96. package/dist/chunk-J7Q7VCVC.js +254 -0
  97. package/dist/chunk-JDEOITQ2.js +1 -0
  98. package/dist/chunk-JNH2TYIN.js +96 -0
  99. package/dist/chunk-JNY4ZHAR.js +634 -0
  100. package/dist/chunk-JRLTGLN4.js +1 -0
  101. package/dist/chunk-JTRJJLKL.js +1 -0
  102. package/dist/chunk-JUAMLEHX.js +379 -0
  103. package/dist/chunk-JXJB2X6M.js +131 -0
  104. package/dist/chunk-KMI5ML5I.js +262 -0
  105. package/dist/chunk-KTAC4MGE.js +4 -0
  106. package/dist/chunk-LAECSR4H.js +178 -0
  107. package/dist/chunk-LK4BCSGX.js +1 -0
  108. package/dist/chunk-LOE5YNN3.js +470 -0
  109. package/dist/chunk-LRJNDEIA.js +302 -0
  110. package/dist/chunk-LSS54GLJ.js +116 -0
  111. package/dist/chunk-LZLHELAG.js +137 -0
  112. package/dist/chunk-M2LUXGKZ.js +1 -0
  113. package/dist/chunk-MOUJOP55.js +425 -0
  114. package/dist/chunk-N32RGOA5.js +159 -0
  115. package/dist/chunk-N5ZNE2YE.js +1 -0
  116. package/dist/chunk-NBNCBML6.js +1 -0
  117. package/dist/chunk-NKB7BZYK.js +167 -0
  118. package/dist/chunk-NQYBUO3K.js +1795 -0
  119. package/dist/chunk-NY2U3PBI.js +59 -0
  120. package/dist/chunk-O4AEHWII.js +464 -0
  121. package/dist/chunk-O7AE6DAF.js +146 -0
  122. package/dist/chunk-OETCUXQP.js +134 -0
  123. package/dist/chunk-OOPPQH27.js +179 -0
  124. package/dist/chunk-OPXFZ4Y5.js +204 -0
  125. package/dist/chunk-P23EQNRQ.js +338 -0
  126. package/dist/chunk-PJXUJYS6.js +248 -0
  127. package/dist/chunk-PNWUWOBF.js +1 -0
  128. package/dist/chunk-PUPM2YGF.js +376 -0
  129. package/dist/chunk-PZXZJBMP.js +620 -0
  130. package/dist/chunk-Q72LJOVE.js +169 -0
  131. package/dist/chunk-QCDXZBC5.js +247 -0
  132. package/dist/chunk-QDYDBCFP.js +197 -0
  133. package/dist/chunk-QJJ6MADV.js +274 -0
  134. package/dist/chunk-QKXCPTFS.js +349 -0
  135. package/dist/chunk-QWCMU5B2.js +860 -0
  136. package/dist/chunk-RIBDXGUG.js +108 -0
  137. package/dist/chunk-RJQOOHT2.js +214 -0
  138. package/dist/chunk-RNGLIHFA.js +191 -0
  139. package/dist/chunk-RQ3HASCC.js +6 -0
  140. package/dist/chunk-RSOJT5YW.js +124 -0
  141. package/dist/chunk-RTIKSY6A.js +1 -0
  142. package/dist/chunk-RUZHTGKB.js +237 -0
  143. package/dist/chunk-RW6ZL2FQ.js +284 -0
  144. package/dist/chunk-S7F6XLTK.js +540 -0
  145. package/dist/chunk-SBMNWWBV.js +155 -0
  146. package/dist/chunk-SDTQPRRB.js +1 -0
  147. package/dist/chunk-SYNOJOQO.js +377 -0
  148. package/dist/chunk-T753XT36.js +1 -0
  149. package/dist/chunk-TKQYWZ5V.js +196 -0
  150. package/dist/chunk-TKVFVF5D.js +95 -0
  151. package/dist/chunk-TOXAGRDQ.js +144 -0
  152. package/dist/chunk-TUTI5HOZ.js +112 -0
  153. package/dist/chunk-U7TFM2JA.js +140 -0
  154. package/dist/chunk-UC2WGUP3.js +627 -0
  155. package/dist/chunk-UWFLYMAR.js +1126 -0
  156. package/dist/chunk-UWSZB7BJ.js +1 -0
  157. package/dist/chunk-UYG5L34B.js +87 -0
  158. package/dist/chunk-VBOXAEPI.js +336 -0
  159. package/dist/chunk-VCDBXW5H.js +188 -0
  160. package/dist/chunk-VCXPHHDS.js +1 -0
  161. package/dist/chunk-VEAYTRPX.js +414 -0
  162. package/dist/chunk-VFCUIDRT.js +1 -0
  163. package/dist/chunk-VQHPQEUH.js +273 -0
  164. package/dist/chunk-VXDZFJGP.js +874 -0
  165. package/dist/chunk-WS56BL3D.js +1 -0
  166. package/dist/chunk-WSW6ZFAQ.js +98 -0
  167. package/dist/chunk-XNUVB5OL.js +375 -0
  168. package/dist/chunk-XOSCY2CW.js +242 -0
  169. package/dist/chunk-XXXEFXY5.js +99 -0
  170. package/dist/chunk-Y5CSSPV4.js +1 -0
  171. package/dist/chunk-Y6DU4J47.js +1 -0
  172. package/dist/chunk-YC6WORFL.js +535 -0
  173. package/dist/chunk-YDGVJETP.js +60 -0
  174. package/dist/chunk-YF4NSSMT.js +366 -0
  175. package/dist/chunk-YG3ZJHGU.js +223 -0
  176. package/dist/chunk-YIJ55TBC.js +1 -0
  177. package/dist/chunk-YKZ4RZZF.js +1 -0
  178. package/dist/chunk-YLLCXTMC.js +37 -0
  179. package/dist/chunk-YTA74UZR.js +1 -0
  180. package/dist/chunk-YTFKPRUK.js +845 -0
  181. package/dist/chunk-Z7H7VSFZ.js +323 -0
  182. package/dist/chunk-ZK2H4O5P.js +1 -0
  183. package/dist/chunk-ZVFE5QGU.js +524 -0
  184. package/dist/coachmark/index.js +4 -0
  185. package/dist/code-block/index.js +4 -0
  186. package/dist/color-field/index.js +7 -0
  187. package/dist/commerce/index.js +20 -0
  188. package/dist/connectivity/index.js +2 -0
  189. package/dist/context-menu/index.js +5 -0
  190. package/dist/copy-button/index.js +3 -0
  191. package/dist/data-grid/index.js +24 -0
  192. package/dist/date-range-picker/index.js +13 -0
  193. package/dist/description-list/index.js +2 -0
  194. package/dist/dialog/index.js +3 -0
  195. package/dist/empty-state/index.js +3 -0
  196. package/dist/error-summary/index.js +3 -0
  197. package/dist/fab/index.js +2 -0
  198. package/dist/file-upload/index.js +9 -0
  199. package/dist/filter-bar/index.js +8 -0
  200. package/dist/flow-run/index.js +14 -0
  201. package/dist/form/index.js +3 -0
  202. package/dist/gallery/index.js +2 -0
  203. package/dist/header/index.js +5 -0
  204. package/dist/hold-to-confirm/index.js +4 -0
  205. package/dist/index.d.ts +22883 -0
  206. package/dist/index.js +158 -0
  207. package/dist/infinite-list/index.js +2 -0
  208. package/dist/inline-edit/index.js +5 -0
  209. package/dist/input/index.js +5 -0
  210. package/dist/interactions/index.js +2 -0
  211. package/dist/invoice/index.js +10 -0
  212. package/dist/kbd/index.js +1 -0
  213. package/dist/keyboard/index.js +3 -0
  214. package/dist/list-row/index.js +7 -0
  215. package/dist/log-viewer/index.js +2 -0
  216. package/dist/map-view/index.js +3 -0
  217. package/dist/markdown/index.js +6 -0
  218. package/dist/metric/index.js +4 -0
  219. package/dist/money/index.js +3 -0
  220. package/dist/nav-drawer/index.js +2 -0
  221. package/dist/navigation/index.js +2 -0
  222. package/dist/notification-center/index.js +16 -0
  223. package/dist/number-roll/index.js +3 -0
  224. package/dist/one-handed/index.js +5 -0
  225. package/dist/os-surfaces/index.js +3 -0
  226. package/dist/otp/index.js +7 -0
  227. package/dist/page-header/index.js +1 -0
  228. package/dist/payment-method/index.js +12 -0
  229. package/dist/payment-status/index.js +16 -0
  230. package/dist/permission/index.js +2 -0
  231. package/dist/picker/index.js +7 -0
  232. package/dist/progress/index.js +5 -0
  233. package/dist/pull-to-refresh/index.js +4 -0
  234. package/dist/radio-group/index.js +6 -0
  235. package/dist/rating/index.js +2 -0
  236. package/dist/receivables/index.js +20 -0
  237. package/dist/refund/index.js +16 -0
  238. package/dist/save-status/index.js +3 -0
  239. package/dist/scroll-area/index.js +1 -0
  240. package/dist/search-bar/index.js +5 -0
  241. package/dist/segmented-control/index.js +5 -0
  242. package/dist/sheet/index.js +4 -0
  243. package/dist/skeleton/index.js +2 -0
  244. package/dist/slider/index.js +5 -0
  245. package/dist/spinner/index.js +2 -0
  246. package/dist/split-button/index.js +7 -0
  247. package/dist/spotlight/index.js +2 -0
  248. package/dist/stage-timeline/index.js +4 -0
  249. package/dist/status-dot/index.js +2 -0
  250. package/dist/stepper/index.js +6 -0
  251. package/dist/streaming-text/index.js +3 -0
  252. package/dist/survey/index.js +19 -0
  253. package/dist/switch/index.js +5 -0
  254. package/dist/system-state/index.js +4 -0
  255. package/dist/tab-bar/index.js +2 -0
  256. package/dist/tabs/index.js +2 -0
  257. package/dist/textarea/index.js +6 -0
  258. package/dist/thinking/index.js +2 -0
  259. package/dist/timeline/index.js +4 -0
  260. package/dist/toast/index.js +2 -0
  261. package/dist/toolbar/index.js +2 -0
  262. package/dist/tour/index.js +11 -0
  263. package/dist/truncation-notice/index.js +2 -0
  264. package/dist/update-notice/index.js +11 -0
  265. package/dist/video-player/index.js +2 -0
  266. package/dist/viewfinder/index.js +5 -0
  267. package/dist/widget/index.js +4 -0
  268. package/dist/wizard/index.js +6 -0
  269. package/package.json +76 -3
@@ -0,0 +1,323 @@
1
+ import { Icon } from './chunk-TKVFVF5D.js';
2
+ import * as React from 'react';
3
+ import { Animated, Easing, View, ScrollView, Pressable, Text } from 'react-native';
4
+ import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
5
+ import { jsxs, jsx } from 'react/jsx-runtime';
6
+
7
+ var CLOSE_ACTIONS = [{ name: "close", label: "Close" }];
8
+ function tabsRevealOffset(triggerX, triggerWidth, stripWidth, viewportWidth) {
9
+ const max = stripWidth - viewportWidth;
10
+ if (max <= 0) return 0;
11
+ return Math.min(Math.max(triggerX + triggerWidth / 2 - viewportWidth / 2, 0), max);
12
+ }
13
+ function Tabs({
14
+ items,
15
+ value,
16
+ defaultValue,
17
+ onValueChange,
18
+ variant = "underline",
19
+ size = "md",
20
+ onClose,
21
+ onAdd,
22
+ addLabel = "Add tab",
23
+ motion = "full"
24
+ }) {
25
+ const isControlled = value !== void 0;
26
+ const [internal, setInternal] = React.useState(
27
+ defaultValue ?? items[0]?.value
28
+ );
29
+ const current = isControlled ? value : internal;
30
+ const activeIndex = Math.max(
31
+ 0,
32
+ items.findIndex((item) => item.value === current)
33
+ );
34
+ const activeItem = items[activeIndex];
35
+ const theme = useLoamTheme();
36
+ const { styles } = useStyles(sheet, { variant, size });
37
+ const iconSize = size === "sm" ? 16 : 18;
38
+ const closeIconSize = size === "sm" ? 14 : 16;
39
+ const [layouts, setLayouts] = React.useState({});
40
+ const onTriggerLayout = (index) => (e) => {
41
+ const { x, y, width, height } = e.nativeEvent.layout;
42
+ setLayouts((prev) => {
43
+ const p = prev[index];
44
+ if (p && p.x === x && p.y === y && p.width === width && p.height === height) return prev;
45
+ return { ...prev, [index]: { x, y, width, height } };
46
+ });
47
+ };
48
+ const active = layouts[activeIndex];
49
+ const indicatorX = React.useRef(new Animated.Value(0)).current;
50
+ const indicatorWidth = React.useRef(new Animated.Value(0)).current;
51
+ const measured = React.useRef(false);
52
+ React.useEffect(() => {
53
+ if (!active) return;
54
+ if (!measured.current) {
55
+ indicatorX.setValue(active.x);
56
+ indicatorWidth.setValue(active.width);
57
+ measured.current = true;
58
+ return;
59
+ }
60
+ if (motion !== "full") {
61
+ indicatorX.setValue(active.x);
62
+ indicatorWidth.setValue(active.width);
63
+ return;
64
+ }
65
+ const { duration, easing } = theme.motion.indicator;
66
+ Animated.parallel([
67
+ Animated.timing(indicatorX, {
68
+ toValue: active.x,
69
+ duration,
70
+ easing: Easing.bezier(easing[0], easing[1], easing[2], easing[3]),
71
+ useNativeDriver: false
72
+ }),
73
+ Animated.timing(indicatorWidth, {
74
+ toValue: active.width,
75
+ duration,
76
+ easing: Easing.bezier(easing[0], easing[1], easing[2], easing[3]),
77
+ useNativeDriver: false
78
+ })
79
+ ]).start();
80
+ }, [active, motion, indicatorX, indicatorWidth, theme.motion.indicator]);
81
+ const select = (next) => {
82
+ if (!isControlled) setInternal(next);
83
+ onValueChange?.(next);
84
+ };
85
+ const scrollRef = React.useRef(null);
86
+ const [viewportWidth, setViewportWidth] = React.useState(0);
87
+ const [stripWidth, setStripWidth] = React.useState(0);
88
+ const revealed = React.useRef(false);
89
+ React.useEffect(() => {
90
+ if (!active || stripWidth <= viewportWidth) return;
91
+ scrollRef.current?.scrollTo({
92
+ x: tabsRevealOffset(active.x, active.width, stripWidth, viewportWidth),
93
+ animated: revealed.current
94
+ });
95
+ revealed.current = true;
96
+ }, [active, stripWidth, viewportWidth]);
97
+ const indicatorStyle = variant === "underline" ? [
98
+ styles.underline,
99
+ // The bar's weight is a ramp step per size — it was 2 and 3, which
100
+ // read as the same decision but came from nowhere.
101
+ { left: indicatorX, width: indicatorWidth, height: theme.space[size === "sm" ? 2 : 3] }
102
+ ] : [
103
+ styles.pill,
104
+ active ? { left: indicatorX, width: indicatorWidth, top: active.y, height: active.height } : { left: indicatorX, width: indicatorWidth }
105
+ ];
106
+ return /* @__PURE__ */ jsxs(View, { children: [
107
+ /* @__PURE__ */ jsxs(View, { style: styles.bar, children: [
108
+ /* @__PURE__ */ jsx(View, { style: styles.list, children: /* @__PURE__ */ jsx(
109
+ ScrollView,
110
+ {
111
+ ref: scrollRef,
112
+ horizontal: true,
113
+ showsHorizontalScrollIndicator: false,
114
+ onLayout: (e) => setViewportWidth(e.nativeEvent.layout.width),
115
+ style: styles.scroll,
116
+ children: /* @__PURE__ */ jsxs(
117
+ View,
118
+ {
119
+ accessibilityRole: "tablist",
120
+ style: styles.row,
121
+ onLayout: (e) => setStripWidth(e.nativeEvent.layout.width),
122
+ children: [
123
+ active ? /* @__PURE__ */ jsx(Animated.View, { pointerEvents: "none", style: indicatorStyle }) : null,
124
+ items.map((item, index) => {
125
+ const selected = item.value === current;
126
+ const fg = selected ? theme.color.onSurface : theme.color.text2;
127
+ const triggerNode = /* @__PURE__ */ jsxs(
128
+ Pressable,
129
+ {
130
+ accessibilityRole: "tab",
131
+ accessibilityState: { selected },
132
+ "aria-selected": selected,
133
+ accessibilityActions: item.closable ? CLOSE_ACTIONS : void 0,
134
+ onAccessibilityAction: item.closable && onClose ? (e) => {
135
+ if (e.nativeEvent.actionName === "close") onClose(item.value);
136
+ } : void 0,
137
+ onPress: () => select(item.value),
138
+ onLayout: onTriggerLayout(index),
139
+ style: styles.trigger,
140
+ children: [
141
+ item.icon ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: iconSize, color: fg }) : null,
142
+ /* @__PURE__ */ jsx(Text, { style: [styles.label, { color: fg }], children: item.label })
143
+ ]
144
+ }
145
+ );
146
+ if (!item.closable) {
147
+ return /* @__PURE__ */ jsx(React.Fragment, { children: triggerNode }, item.value);
148
+ }
149
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
150
+ triggerNode,
151
+ /* @__PURE__ */ jsx(
152
+ Pressable,
153
+ {
154
+ "aria-hidden": true,
155
+ accessibilityElementsHidden: true,
156
+ importantForAccessibility: "no-hide-descendants",
157
+ focusable: false,
158
+ tabIndex: -1,
159
+ testID: `tabs-close-${item.value}`,
160
+ onPress: onClose ? () => onClose(item.value) : void 0,
161
+ style: styles.close,
162
+ children: /* @__PURE__ */ jsx(Icon, { name: "x", size: closeIconSize, color: fg })
163
+ }
164
+ )
165
+ ] }, item.value);
166
+ })
167
+ ]
168
+ }
169
+ )
170
+ }
171
+ ) }),
172
+ onAdd ? /* @__PURE__ */ jsx(
173
+ Pressable,
174
+ {
175
+ accessibilityRole: "button",
176
+ accessibilityLabel: addLabel,
177
+ onPress: onAdd,
178
+ style: styles.add,
179
+ children: /* @__PURE__ */ jsx(Icon, { name: "plus", size: iconSize, color: theme.color.text2 })
180
+ }
181
+ ) : null
182
+ ] }),
183
+ activeItem?.content !== void 0 ? /* @__PURE__ */ jsx(View, { style: styles.panel, children: activeItem.content }) : null
184
+ ] });
185
+ }
186
+ var sheet = createStyleSheet((theme) => ({
187
+ // The bar row: the scrolling chrome plus the pinned add button. It sizes to
188
+ // its content (`alignSelf: 'flex-start'`) and caps at the parent's edge
189
+ // (`maxWidth`), taking over the sizing role the chrome held before an add
190
+ // button could sit beside it.
191
+ bar: {
192
+ flexDirection: "row",
193
+ alignItems: "center",
194
+ alignSelf: "flex-start",
195
+ maxWidth: "100%"
196
+ },
197
+ // The chrome: the underline's rule, or the pill variant's tray. `flexShrink`
198
+ // lets it yield width to the add button so the triggers scroll underneath the
199
+ // chrome rather than pushing the add button off the edge; with no add button
200
+ // it is the only child of the bar and still sizes to its triggers.
201
+ list: {
202
+ flexShrink: 1,
203
+ variants: {
204
+ variant: {
205
+ underline: {
206
+ borderBottomWidth: theme.borderWidth.thin,
207
+ borderBottomColor: theme.color.border
208
+ },
209
+ pill: {
210
+ backgroundColor: theme.color.surface2,
211
+ borderRadius: theme.radius.full,
212
+ padding: theme.space.s1
213
+ }
214
+ },
215
+ size: { sm: {}, md: {} }
216
+ }
217
+ },
218
+ // A scroller clips at its padding box, and the underline indicator hangs 1px
219
+ // past the triggers so it lands *on* the rule (`bottom: -1` below). A hairline
220
+ // of padding keeps that overhang inside the clip box; the negative margin hands
221
+ // the same hairline back, so the bar's height and the rule's position are the
222
+ // ones it had before the strip could scroll.
223
+ scroll: {
224
+ variants: {
225
+ variant: {
226
+ underline: { paddingBottom: theme.space[1], marginBottom: -theme.space[1] },
227
+ pill: {}
228
+ },
229
+ size: { sm: {}, md: {} }
230
+ }
231
+ },
232
+ // The triggers and the indicator, in one padding-free coordinate space.
233
+ row: {
234
+ position: "relative",
235
+ flexDirection: "row",
236
+ variants: {
237
+ variant: {
238
+ underline: { gap: theme.space.s4 },
239
+ pill: { gap: theme.space.s1 }
240
+ },
241
+ size: { sm: {}, md: {} }
242
+ }
243
+ },
244
+ underline: {
245
+ position: "absolute",
246
+ bottom: -theme.space[1],
247
+ backgroundColor: theme.color.accent,
248
+ borderRadius: theme.radius.full,
249
+ variants: {
250
+ variant: { underline: {}, pill: {} },
251
+ size: { sm: {}, md: {} }
252
+ }
253
+ },
254
+ pill: {
255
+ position: "absolute",
256
+ backgroundColor: theme.color.accentSoft,
257
+ // The tint collapses to the plain surface under `contrast: 'more'`, where
258
+ // `edge.accent` stops being transparent and carries the selection instead.
259
+ borderWidth: theme.borderWidth.base,
260
+ borderColor: theme.edge.accent,
261
+ borderRadius: theme.radius.full,
262
+ variants: {
263
+ variant: { underline: {}, pill: {} },
264
+ size: { sm: {}, md: {} }
265
+ }
266
+ },
267
+ trigger: {
268
+ flexDirection: "row",
269
+ alignItems: "center",
270
+ justifyContent: "center",
271
+ gap: theme.space.s2,
272
+ variants: {
273
+ variant: {
274
+ underline: {},
275
+ pill: { borderRadius: theme.radius.full }
276
+ },
277
+ size: {
278
+ sm: { paddingVertical: theme.space.s2, paddingHorizontal: theme.space.s3 },
279
+ md: { paddingVertical: theme.space.s3, paddingHorizontal: theme.space.s4 }
280
+ }
281
+ }
282
+ },
283
+ label: {
284
+ fontFamily: theme.font.sans,
285
+ fontWeight: theme.fontWeight.semibold,
286
+ variants: {
287
+ variant: { underline: {}, pill: {} },
288
+ size: {
289
+ sm: { fontSize: theme.fontSize[14] },
290
+ md: { fontSize: theme.fontSize[16] }
291
+ }
292
+ }
293
+ },
294
+ // The close affordance beside a `closable` tab. `alignSelf: 'stretch'` gives it
295
+ // the trigger's full height as vertical hit area; the horizontal padding widens
296
+ // the target past the glyph. The `x` glyph inherits the label's ink (`text2`
297
+ // when inactive, `onSurface` when active) — both clear the 3:1 non-text floor.
298
+ close: {
299
+ alignSelf: "stretch",
300
+ alignItems: "center",
301
+ justifyContent: "center",
302
+ paddingHorizontal: theme.space.s2,
303
+ borderRadius: theme.radius.full
304
+ },
305
+ // The add button, pinned outside the tablist at the trailing edge. A full
306
+ // 44pt touch target; the `plus` glyph inks `text2` on the surface (3:1+).
307
+ add: {
308
+ minWidth: theme.tapMin,
309
+ minHeight: theme.tapMin,
310
+ alignItems: "center",
311
+ justifyContent: "center",
312
+ marginStart: theme.space.s1
313
+ },
314
+ panel: {
315
+ paddingTop: theme.space.s4,
316
+ variants: {
317
+ variant: { underline: {}, pill: {} },
318
+ size: { sm: {}, md: {} }
319
+ }
320
+ }
321
+ }));
322
+
323
+ export { Tabs };
@@ -0,0 +1 @@
1
+