@btndprojects/loam-ui-native 0.1.1 → 0.2.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 (262) hide show
  1. package/dist/accordion/index.js +5 -3
  2. package/dist/adaptive/index.js +6 -2
  3. package/dist/alert/index.js +5 -2
  4. package/dist/analyzer/index.js +9 -6
  5. package/dist/announcement/index.js +8 -5
  6. package/dist/audio-player/index.js +5 -3
  7. package/dist/avatar/index.js +5 -2
  8. package/dist/avatar-group/index.js +7 -3
  9. package/dist/badge/index.js +7 -4
  10. package/dist/banner/index.js +5 -2
  11. package/dist/board/index.js +11 -6
  12. package/dist/button/index.js +6 -3
  13. package/dist/camera-permission/index.js +15 -12
  14. package/dist/capture-result/index.js +19 -16
  15. package/dist/card/index.js +6 -3
  16. package/dist/card-form/index.js +12 -8
  17. package/dist/carousel/index.js +4 -2
  18. package/dist/chart/index.js +8 -5
  19. package/dist/charts/index.js +8 -6
  20. package/dist/chat/index.js +16 -0
  21. package/dist/checkbox/index.js +6 -4
  22. package/dist/checklist/index.js +11 -8
  23. package/dist/checkout/index.js +16 -11
  24. package/dist/chip/index.js +7 -4
  25. package/dist/{chunk-XNUVB5OL.js → chunk-2OLKPG4E.js} +92 -28
  26. package/dist/{chunk-RUZHTGKB.js → chunk-2PKYGLQ6.js} +71 -40
  27. package/dist/{chunk-UC2WGUP3.js → chunk-2SWKL3AJ.js} +91 -252
  28. package/dist/{chunk-AI4DWZCD.js → chunk-2SY63FCH.js} +63 -16
  29. package/dist/{chunk-F5XNPWS7.js → chunk-2TXERVVA.js} +92 -35
  30. package/dist/chunk-36EC2T6P.js +581 -0
  31. package/dist/chunk-3DUWIYV5.js +437 -0
  32. package/dist/{chunk-JNY4ZHAR.js → chunk-3QMEOFW5.js} +275 -71
  33. package/dist/chunk-3WEZCGHX.js +265 -0
  34. package/dist/chunk-46MMSDGL.js +194 -0
  35. package/dist/{chunk-7O2FMUPT.js → chunk-4IZXHVFJ.js} +297 -92
  36. package/dist/{chunk-LAECSR4H.js → chunk-5LAAAXFP.js} +14 -8
  37. package/dist/{chunk-2A5NIQAK.js → chunk-5RENVKBQ.js} +134 -46
  38. package/dist/{chunk-2ZZ7TDJ4.js → chunk-5UTRIXQ6.js} +37 -31
  39. package/dist/{chunk-LOE5YNN3.js → chunk-5VFZRGVD.js} +37 -10
  40. package/dist/{chunk-52X2VYTD.js → chunk-67IZZ2MJ.js} +115 -60
  41. package/dist/{chunk-UYG5L34B.js → chunk-6YAQBXB3.js} +10 -4
  42. package/dist/{chunk-BTTFCMKG.js → chunk-74FLKD24.js} +94 -23
  43. package/dist/{chunk-ITTYJZWX.js → chunk-7BUIKDD6.js} +73 -18
  44. package/dist/{chunk-423B7SPN.js → chunk-7OVVSVEZ.js} +273 -109
  45. package/dist/chunk-AEB7KCHQ.js +287 -0
  46. package/dist/chunk-APCWFOZW.js +28 -0
  47. package/dist/chunk-AWKQIE5I.js +139 -0
  48. package/dist/{chunk-VCDBXW5H.js → chunk-B7N4ASYE.js} +86 -42
  49. package/dist/{chunk-IVNRBPGC.js → chunk-C4GTDLRC.js} +104 -20
  50. package/dist/{chunk-4ZAHCY44.js → chunk-C6APNDVA.js} +12 -5
  51. package/dist/{chunk-4SZYY6AN.js → chunk-CMTVNF3D.js} +18 -13
  52. package/dist/{chunk-HZ6CNMAF.js → chunk-CPTOADB2.js} +151 -96
  53. package/dist/chunk-D5N5QWI7.js +1325 -0
  54. package/dist/{chunk-IIQTAY3J.js → chunk-DN7MNQIP.js} +113 -29
  55. package/dist/{chunk-47FWHGUN.js → chunk-DVGBZ3TX.js} +84 -23
  56. package/dist/chunk-DW3L54DQ.js +305 -0
  57. package/dist/{chunk-3ARE4TES.js → chunk-E2E3I5W2.js} +69 -18
  58. package/dist/{chunk-DHWADYZX.js → chunk-EDCBJV7J.js} +41 -28
  59. package/dist/{chunk-WSW6ZFAQ.js → chunk-ENP3BMZU.js} +4 -4
  60. package/dist/{chunk-OOPPQH27.js → chunk-EVOIGUBI.js} +43 -19
  61. package/dist/{chunk-VEAYTRPX.js → chunk-EY4DD67D.js} +165 -97
  62. package/dist/{chunk-223Q2T2Q.js → chunk-F3H33DQX.js} +132 -61
  63. package/dist/{chunk-CYRBHQQZ.js → chunk-F5B3UINI.js} +68 -35
  64. package/dist/{chunk-6X6PQ443.js → chunk-FAJI7BSC.js} +20 -9
  65. package/dist/{chunk-MOUJOP55.js → chunk-FUMHAAF3.js} +96 -29
  66. package/dist/{chunk-6HT2LP62.js → chunk-FV6HMP7W.js} +192 -73
  67. package/dist/{chunk-S7F6XLTK.js → chunk-FYWNRX4F.js} +76 -47
  68. package/dist/{chunk-YG3ZJHGU.js → chunk-FZGAAOKS.js} +30 -8
  69. package/dist/{chunk-YDGVJETP.js → chunk-G3AFC24V.js} +1 -1
  70. package/dist/{chunk-EJBDRVIH.js → chunk-G6UESEVN.js} +15 -8
  71. package/dist/chunk-GDKVKNR2.js +339 -0
  72. package/dist/chunk-GEIGMWNF.js +10 -0
  73. package/dist/{chunk-JUAMLEHX.js → chunk-H7DWSL4O.js} +24 -12
  74. package/dist/chunk-HJFFOOJ4.js +1 -0
  75. package/dist/{chunk-RW6ZL2FQ.js → chunk-HJLPZA4X.js} +106 -21
  76. package/dist/chunk-HYEOQWT7.js +647 -0
  77. package/dist/chunk-I2KLQ2HA.js +19 -0
  78. package/dist/{chunk-CJ5EOYZE.js → chunk-I4FHVKEC.js} +11 -5
  79. package/dist/{chunk-JNH2TYIN.js → chunk-IDM7JJMO.js} +19 -5
  80. package/dist/{chunk-O4AEHWII.js → chunk-IPUNJMAQ.js} +141 -49
  81. package/dist/{chunk-J7Q7VCVC.js → chunk-IT6FUXXG.js} +13 -6
  82. package/dist/{chunk-QJJ6MADV.js → chunk-IVKMZ7BB.js} +80 -28
  83. package/dist/{chunk-Z7H7VSFZ.js → chunk-IXKWIFWZ.js} +17 -6
  84. package/dist/chunk-J64KGCGX.js +55 -0
  85. package/dist/chunk-JBMLWFSJ.js +270 -0
  86. package/dist/{chunk-4BXMXBJO.js → chunk-JJLPBRVZ.js} +22 -11
  87. package/dist/chunk-JLC6PM5S.js +406 -0
  88. package/dist/chunk-JUYWSSKW.js +335 -0
  89. package/dist/{chunk-7CFF4HXS.js → chunk-JV5YOTOB.js} +49 -11
  90. package/dist/{chunk-LZLHELAG.js → chunk-KFJGFLMW.js} +29 -8
  91. package/dist/{chunk-O7AE6DAF.js → chunk-KQZ3GLHR.js} +18 -8
  92. package/dist/{chunk-N32RGOA5.js → chunk-LKFC4CS7.js} +80 -24
  93. package/dist/{chunk-YC6WORFL.js → chunk-LMPHCVJJ.js} +82 -50
  94. package/dist/{chunk-3WPW4KUN.js → chunk-LQP4KEXZ.js} +45 -13
  95. package/dist/{chunk-TKQYWZ5V.js → chunk-LUMVGO2K.js} +47 -31
  96. package/dist/{chunk-AWJOCGFZ.js → chunk-M656FYNH.js} +25 -13
  97. package/dist/{chunk-35OFI3JG.js → chunk-MKSNFG7H.js} +73 -20
  98. package/dist/{chunk-4GBOGOTV.js → chunk-NBEF4EPJ.js} +16 -6
  99. package/dist/chunk-NNCOFLNE.js +24 -0
  100. package/dist/{chunk-4YQOR7JM.js → chunk-NTQ2F3AU.js} +73 -20
  101. package/dist/{chunk-QCDXZBC5.js → chunk-O5V4TG3V.js} +126 -44
  102. package/dist/{chunk-U7TFM2JA.js → chunk-OJQUBQWA.js} +3 -3
  103. package/dist/{chunk-VQHPQEUH.js → chunk-OWAMM2DK.js} +13 -6
  104. package/dist/chunk-PID3NJB7.js +405 -0
  105. package/dist/{chunk-HET4LLMX.js → chunk-PMMTGBBS.js} +27 -17
  106. package/dist/{chunk-RIBDXGUG.js → chunk-PNF3NKB5.js} +49 -16
  107. package/dist/{chunk-JXJB2X6M.js → chunk-Q6NKEPRE.js} +81 -32
  108. package/dist/chunk-QDZGFXQD.js +176 -0
  109. package/dist/{chunk-SYNOJOQO.js → chunk-QEYFDRHR.js} +60 -26
  110. package/dist/{chunk-VBOXAEPI.js → chunk-QHAITQIF.js} +97 -22
  111. package/dist/{chunk-VXDZFJGP.js → chunk-QHTVYA65.js} +230 -76
  112. package/dist/{chunk-TUTI5HOZ.js → chunk-QIKT7LIB.js} +14 -8
  113. package/dist/{chunk-3ENTMPQY.js → chunk-QP3KMOVF.js} +82 -42
  114. package/dist/{chunk-GNNJ4GCC.js → chunk-QPWDDJJ4.js} +62 -148
  115. package/dist/{chunk-QWCMU5B2.js → chunk-QRUMA22E.js} +205 -80
  116. package/dist/{chunk-ZVFE5QGU.js → chunk-QYPE5JX3.js} +50 -10
  117. package/dist/{chunk-PUPM2YGF.js → chunk-ROCUG24E.js} +76 -36
  118. package/dist/{chunk-NQYBUO3K.js → chunk-RU3ZPNL6.js} +333 -142
  119. package/dist/{chunk-TOXAGRDQ.js → chunk-RXSCIO6W.js} +14 -5
  120. package/dist/{chunk-FMYDDECK.js → chunk-SATMR6SG.js} +631 -203
  121. package/dist/{chunk-4YIP3CWS.js → chunk-SHHY5OMK.js} +7 -5
  122. package/dist/chunk-SKWO3SZF.js +2284 -0
  123. package/dist/{chunk-YF4NSSMT.js → chunk-SWS5JQIF.js} +41 -13
  124. package/dist/{chunk-CUMUNPXY.js → chunk-T5LTPKX6.js} +15 -7
  125. package/dist/{chunk-H6NIOQHK.js → chunk-TDMG26JI.js} +26 -6
  126. package/dist/{chunk-UWFLYMAR.js → chunk-TLCIR6RG.js} +267 -126
  127. package/dist/{chunk-SBMNWWBV.js → chunk-TN2ZNJUI.js} +47 -9
  128. package/dist/{chunk-5YNTNN5A.js → chunk-TQVAIKFD.js} +106 -41
  129. package/dist/chunk-TRGFFU6A.js +1456 -0
  130. package/dist/{chunk-2GK6PHGE.js → chunk-TY4MTKQJ.js} +100 -22
  131. package/dist/{chunk-AZRX6SAC.js → chunk-U23FYWME.js} +15 -7
  132. package/dist/{chunk-PZXZJBMP.js → chunk-U5NLHYV6.js} +26 -12
  133. package/dist/chunk-UQEN55EY.js +1 -0
  134. package/dist/chunk-UQGBTPXH.js +218 -0
  135. package/dist/chunk-UXGIW7OK.js +116 -0
  136. package/dist/{chunk-PJXUJYS6.js → chunk-UYGDJWMN.js} +55 -30
  137. package/dist/{chunk-QDYDBCFP.js → chunk-V2OEB75Z.js} +50 -51
  138. package/dist/{chunk-LSS54GLJ.js → chunk-VAOAKWUK.js} +34 -13
  139. package/dist/{chunk-DM5QUKKO.js → chunk-VDPK5CY4.js} +18 -6
  140. package/dist/chunk-W23G6JLF.js +37 -0
  141. package/dist/{chunk-CDRZHT42.js → chunk-W63AJTM7.js} +276 -12
  142. package/dist/{chunk-XXXEFXY5.js → chunk-W74TXYFB.js} +13 -5
  143. package/dist/{chunk-LRJNDEIA.js → chunk-WRDSPUE7.js} +144 -29
  144. package/dist/{chunk-C2NTXVWM.js → chunk-XBZGDDMR.js} +11 -4
  145. package/dist/{chunk-BV3B2HYZ.js → chunk-XIDTBCBA.js} +189 -131
  146. package/dist/{chunk-YTFKPRUK.js → chunk-XN4KG3P4.js} +348 -153
  147. package/dist/chunk-XQXMLMH3.js +211 -0
  148. package/dist/{chunk-HPPW424V.js → chunk-XTORZWRF.js} +19 -8
  149. package/dist/{chunk-P23EQNRQ.js → chunk-YAAHPATV.js} +181 -30
  150. package/dist/{chunk-KMI5ML5I.js → chunk-YXOAPXMU.js} +57 -18
  151. package/dist/{chunk-RJQOOHT2.js → chunk-ZECZOOSB.js} +59 -28
  152. package/dist/{chunk-QKXCPTFS.js → chunk-ZLTO5VQI.js} +121 -31
  153. package/dist/{chunk-BEDBFJND.js → chunk-ZVATDZOM.js} +16 -18
  154. package/dist/coachmark/index.js +6 -3
  155. package/dist/code-block/index.js +5 -3
  156. package/dist/color-field/index.js +6 -4
  157. package/dist/commerce/index.js +19 -16
  158. package/dist/connectivity/index.js +5 -2
  159. package/dist/context-menu/index.js +5 -3
  160. package/dist/copy-button/index.js +4 -2
  161. package/dist/data-grid/index.js +21 -16
  162. package/dist/date-range-picker/index.js +11 -8
  163. package/dist/description-list/index.js +3 -1
  164. package/dist/dialog/index.js +4 -2
  165. package/dist/empty-state/index.js +4 -2
  166. package/dist/error-summary/index.js +4 -2
  167. package/dist/fab/index.js +5 -2
  168. package/dist/file-manager/index.js +28 -0
  169. package/dist/file-upload/index.js +10 -7
  170. package/dist/filter-bar/index.js +9 -6
  171. package/dist/flow-run/index.js +15 -12
  172. package/dist/form/index.js +5 -3
  173. package/dist/gallery/index.js +5 -2
  174. package/dist/hold-to-confirm/index.js +4 -2
  175. package/dist/index.d.ts +9557 -2985
  176. package/dist/index.js +355 -122
  177. package/dist/infinite-list/index.js +4 -2
  178. package/dist/inline-edit/index.js +6 -4
  179. package/dist/input/index.js +5 -3
  180. package/dist/interactions/index.js +2 -1
  181. package/dist/invoice/index.js +13 -9
  182. package/dist/kbd/index.js +5 -1
  183. package/dist/keyboard/index.js +4 -2
  184. package/dist/list-row/index.js +6 -4
  185. package/dist/log-viewer/index.js +4 -2
  186. package/dist/map-view/index.js +5 -3
  187. package/dist/markdown/index.js +9 -6
  188. package/dist/metric/index.js +7 -4
  189. package/dist/money/index.js +9 -3
  190. package/dist/nav-drawer/index.js +4 -2
  191. package/dist/nav-header/index.js +9 -0
  192. package/dist/navigation/index.js +5 -2
  193. package/dist/notification-center/index.js +12 -10
  194. package/dist/number-roll/index.js +5 -2
  195. package/dist/one-handed/index.js +5 -3
  196. package/dist/os-surfaces/index.js +6 -3
  197. package/dist/otp/index.js +7 -4
  198. package/dist/page-header/index.js +1 -0
  199. package/dist/pagination/index.js +6 -0
  200. package/dist/payment-method/index.js +14 -10
  201. package/dist/payment-status/index.js +17 -14
  202. package/dist/permission/index.js +5 -2
  203. package/dist/picker/index.js +11 -6
  204. package/dist/progress/index.js +6 -3
  205. package/dist/pull-to-refresh/index.js +4 -2
  206. package/dist/radio-group/index.js +6 -4
  207. package/dist/rating/index.js +5 -2
  208. package/dist/receivables/index.js +21 -16
  209. package/dist/refund/index.js +18 -14
  210. package/dist/save-status/index.js +5 -3
  211. package/dist/scroll-area/index.js +3 -1
  212. package/dist/search-field/index.js +8 -0
  213. package/dist/segmented-control/index.js +4 -3
  214. package/dist/sheet/index.js +5 -3
  215. package/dist/skeleton/index.js +3 -1
  216. package/dist/slider/index.js +4 -2
  217. package/dist/sortable/index.js +7 -0
  218. package/dist/spinner/index.js +3 -1
  219. package/dist/split-button/index.js +9 -6
  220. package/dist/spotlight/index.js +3 -1
  221. package/dist/stage-timeline/index.js +5 -3
  222. package/dist/status-dot/index.js +4 -2
  223. package/dist/stepper/index.js +7 -4
  224. package/dist/streaming-text/index.js +3 -2
  225. package/dist/survey/index.js +18 -15
  226. package/dist/switch/index.js +5 -3
  227. package/dist/system-state/index.js +7 -4
  228. package/dist/tab-bar/index.js +5 -2
  229. package/dist/tabs/index.js +4 -2
  230. package/dist/tags-input/index.js +10 -0
  231. package/dist/textarea/index.js +6 -4
  232. package/dist/thinking/index.js +3 -1
  233. package/dist/time-field/index.js +12 -0
  234. package/dist/time-range-control/index.js +22 -0
  235. package/dist/timeline/index.js +4 -2
  236. package/dist/toast/index.js +4 -2
  237. package/dist/toolbar/index.js +4 -2
  238. package/dist/tour/index.js +12 -9
  239. package/dist/truncation-notice/index.js +5 -2
  240. package/dist/update-notice/index.js +12 -9
  241. package/dist/video-player/index.js +5 -2
  242. package/dist/viewfinder/index.js +6 -4
  243. package/dist/widget/index.js +7 -4
  244. package/dist/wizard/index.js +7 -4
  245. package/package.json +13 -12
  246. package/dist/chunk-6N33LFQA.js +0 -35
  247. package/dist/chunk-GDKZTW34.js +0 -395
  248. package/dist/chunk-GL7B2DOW.js +0 -134
  249. package/dist/chunk-NKB7BZYK.js +0 -167
  250. package/dist/chunk-OETCUXQP.js +0 -134
  251. package/dist/chunk-OPXFZ4Y5.js +0 -204
  252. package/dist/chunk-Q72LJOVE.js +0 -169
  253. package/dist/chunk-RNGLIHFA.js +0 -191
  254. package/dist/chunk-RQ3HASCC.js +0 -6
  255. package/dist/chunk-RSOJT5YW.js +0 -124
  256. package/dist/chunk-TKVFVF5D.js +0 -95
  257. package/dist/chunk-XOSCY2CW.js +0 -242
  258. package/dist/header/index.js +0 -5
  259. package/dist/search-bar/index.js +0 -5
  260. /package/dist/{chunk-3ECPOSKO.js → chunk-3UG6JUCV.js} +0 -0
  261. /package/dist/{chunk-JRLTGLN4.js → chunk-5WWRTEPS.js} +0 -0
  262. /package/dist/{chunk-RTIKSY6A.js → chunk-5Z5ZYMOJ.js} +0 -0
@@ -1,124 +0,0 @@
1
- import { Icon } from './chunk-TKVFVF5D.js';
2
- import * as React from 'react';
3
- import { View, Pressable, Text } from 'react-native';
4
- import { Svg, Path } from 'react-native-svg';
5
- import { icons, ICON_VIEWBOX } from '@btndprojects/loam-icons';
6
- import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
7
- import { jsxs, jsx } from 'react/jsx-runtime';
8
-
9
- var ICON_SIZE = { sm: 20, md: 26, lg: 34 };
10
- var STAR_PATH = icons.star.flatMap((part) => part.t === "path" ? [part.d] : []).join(" ");
11
- function toHalfStep(value) {
12
- return Math.round(value * 2) / 2;
13
- }
14
- function Star({ fraction, size }) {
15
- const theme = useLoamTheme();
16
- const { styles } = useStyles(starSheet);
17
- const filled = Math.max(0, Math.min(1, fraction));
18
- return /* @__PURE__ */ jsxs(View, { style: { width: size, height: size }, children: [
19
- /* @__PURE__ */ jsx(Icon, { name: "star", size, color: theme.color.text3 }),
20
- filled > 0 ? /* @__PURE__ */ jsx(View, { testID: "rating-star-fill", style: [styles.clip, { width: size * filled }], children: /* @__PURE__ */ jsx(View, { style: styles.paint, children: /* @__PURE__ */ jsx(Svg, { width: size, height: size, viewBox: ICON_VIEWBOX, children: /* @__PURE__ */ jsx(
21
- Path,
22
- {
23
- d: STAR_PATH,
24
- fill: theme.color.warn,
25
- stroke: theme.color.warn,
26
- strokeWidth: theme.borderWidth.thick,
27
- strokeLinecap: "round",
28
- strokeLinejoin: "round"
29
- }
30
- ) }) }) }) : null
31
- ] });
32
- }
33
- function Rating({
34
- value,
35
- defaultValue = 0,
36
- onValueChange,
37
- max = 5,
38
- size = "md",
39
- readOnly = false,
40
- accessibilityLabel = "Rating",
41
- showValue = false,
42
- count
43
- }) {
44
- const { styles } = useStyles(sheet, { size });
45
- const theme = useLoamTheme();
46
- const iconSize = ICON_SIZE[size];
47
- const starSlopY = Math.max(0, (theme.tapMin - (iconSize + theme.space.s1 * 2)) / 2);
48
- const isControlled = value !== void 0;
49
- const [internal, setInternal] = React.useState(defaultValue);
50
- const current = isControlled ? value : internal;
51
- const setValue = (next) => {
52
- if (!isControlled) setInternal(next);
53
- onValueChange?.(next);
54
- };
55
- const snapped = toHalfStep(Math.max(0, Math.min(max, current)));
56
- const shown = Number.isInteger(snapped) ? String(snapped) : snapped.toFixed(1);
57
- const label = readOnly ? `${accessibilityLabel}: ${shown} out of ${max} stars` : accessibilityLabel;
58
- const readoutLabel = count !== void 0 ? `${shown} of ${max} \xB7 ${count} reviews` : `${shown} of ${max}`;
59
- return /* @__PURE__ */ jsxs(View, { style: styles.wrapper, children: [
60
- /* @__PURE__ */ jsx(View, { style: styles.row, role: "group", accessibilityLabel: label, children: Array.from({ length: max }, (_, i) => {
61
- const starValue = i + 1;
62
- const fraction = Math.max(0, Math.min(1, snapped - i));
63
- return /* @__PURE__ */ jsx(
64
- Pressable,
65
- {
66
- style: styles.star,
67
- accessibilityRole: "button",
68
- accessibilityLabel: `Rate ${starValue} of ${max}`,
69
- accessibilityState: { disabled: readOnly, selected: fraction >= 0.5 },
70
- disabled: readOnly,
71
- hitSlop: { top: starSlopY, bottom: starSlopY },
72
- onPress: readOnly ? void 0 : () => setValue(starValue),
73
- children: /* @__PURE__ */ jsx(Star, { fraction, size: iconSize })
74
- },
75
- i
76
- );
77
- }) }),
78
- showValue ? /* @__PURE__ */ jsx(Text, { testID: "rating-readout", style: styles.readout, children: readoutLabel }) : null
79
- ] });
80
- }
81
- var sheet = createStyleSheet((theme) => ({
82
- // Outer wrapper groups the star row with the optional readout.
83
- wrapper: {
84
- flexDirection: "row",
85
- alignItems: "center",
86
- gap: theme.space.s2
87
- },
88
- row: {
89
- flexDirection: "row",
90
- alignItems: "center",
91
- variants: {
92
- size: {
93
- sm: { gap: theme.space.s1 },
94
- md: { gap: theme.space.s1 },
95
- lg: { gap: theme.space.s2 }
96
- }
97
- }
98
- },
99
- star: {
100
- padding: theme.space.s1
101
- },
102
- // Companion readout — uses body/sm weight and text2 tone so it reads as
103
- // secondary information alongside the star icons.
104
- readout: {
105
- fontFamily: theme.font.sans,
106
- fontSize: theme.fontSize[14],
107
- color: theme.color.text2
108
- }
109
- }));
110
- var starSheet = createStyleSheet(() => ({
111
- // `start` + `overflow: 'hidden'` is the clip: the painted star inside keeps its
112
- // full width and is cropped to the fraction, from the leading edge either way
113
- // round, so RTL needs no sign flip.
114
- clip: {
115
- position: "absolute",
116
- top: 0,
117
- bottom: 0,
118
- start: 0,
119
- overflow: "hidden"
120
- },
121
- paint: { position: "absolute", top: 0, start: 0 }
122
- }));
123
-
124
- export { Rating };
@@ -1,95 +0,0 @@
1
- import 'react';
2
- import { Svg, Circle, Line, Rect, Polyline, Polygon, Ellipse, Path } from 'react-native-svg';
3
- import { icons } from '@btndprojects/loam-icons';
4
- import { useLoamTheme } from '@btndprojects/loam-theme-native';
5
- import { jsx } from 'react/jsx-runtime';
6
-
7
- // src/lib/icon.tsx
8
- function Icon({ name, size = 20, color, strokeWidth = 1.5 }) {
9
- const theme = useLoamTheme();
10
- const stroke = color ?? theme.color.text;
11
- return /* @__PURE__ */ jsx(Svg, { width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: icons[name].map((p, i) => {
12
- if (p.t === "circle")
13
- return p.fill ? /* @__PURE__ */ jsx(Circle, { cx: p.cx, cy: p.cy, r: p.r, fill: stroke }, i) : /* @__PURE__ */ jsx(Circle, { cx: p.cx, cy: p.cy, r: p.r, stroke, strokeWidth }, i);
14
- if (p.t === "line")
15
- return /* @__PURE__ */ jsx(
16
- Line,
17
- {
18
- x1: p.x1,
19
- y1: p.y1,
20
- x2: p.x2,
21
- y2: p.y2,
22
- stroke,
23
- strokeWidth,
24
- strokeLinecap: "round"
25
- },
26
- i
27
- );
28
- if (p.t === "rect")
29
- return /* @__PURE__ */ jsx(
30
- Rect,
31
- {
32
- x: p.x,
33
- y: p.y,
34
- width: p.width,
35
- height: p.height,
36
- rx: p.rx,
37
- ry: p.ry,
38
- stroke,
39
- strokeWidth,
40
- strokeLinejoin: "round"
41
- },
42
- i
43
- );
44
- if (p.t === "polyline")
45
- return /* @__PURE__ */ jsx(
46
- Polyline,
47
- {
48
- points: p.points,
49
- stroke,
50
- strokeWidth,
51
- strokeLinecap: "round",
52
- strokeLinejoin: "round"
53
- },
54
- i
55
- );
56
- if (p.t === "polygon")
57
- return /* @__PURE__ */ jsx(
58
- Polygon,
59
- {
60
- points: p.points,
61
- stroke,
62
- strokeWidth,
63
- strokeLinecap: "round",
64
- strokeLinejoin: "round"
65
- },
66
- i
67
- );
68
- if (p.t === "ellipse")
69
- return /* @__PURE__ */ jsx(
70
- Ellipse,
71
- {
72
- cx: p.cx,
73
- cy: p.cy,
74
- rx: p.rx,
75
- ry: p.ry,
76
- stroke,
77
- strokeWidth
78
- },
79
- i
80
- );
81
- return /* @__PURE__ */ jsx(
82
- Path,
83
- {
84
- d: p.d,
85
- stroke,
86
- strokeWidth,
87
- strokeLinecap: "round",
88
- strokeLinejoin: "round"
89
- },
90
- i
91
- );
92
- }) });
93
- }
94
-
95
- export { Icon };
@@ -1,242 +0,0 @@
1
- import { Icon } from './chunk-TKVFVF5D.js';
2
- import * as React from 'react';
3
- import { View, ScrollView, Pressable, Text, Modal, Animated, Easing } from 'react-native';
4
- import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
5
- import { jsxs, jsx } from 'react/jsx-runtime';
6
-
7
- var DOT = {
8
- /** Width of the active dot. */
9
- activeWidth: 16,
10
- /** Width of an inactive dot. */
11
- idleWidth: 5
12
- };
13
- function Dot({ active }) {
14
- const { styles } = useStyles(sheet);
15
- const theme = useLoamTheme();
16
- const progress = React.useRef(new Animated.Value(active ? 1 : 0)).current;
17
- React.useEffect(() => {
18
- Animated.timing(progress, {
19
- toValue: active ? 1 : 0,
20
- duration: theme.duration.base,
21
- easing: Easing.bezier(...theme.easing.base),
22
- useNativeDriver: false
23
- }).start();
24
- }, [active, progress, theme.duration.base, theme.easing.base]);
25
- return /* @__PURE__ */ jsx(
26
- Animated.View,
27
- {
28
- style: [
29
- styles.dot,
30
- {
31
- width: progress.interpolate({
32
- inputRange: [0, 1],
33
- outputRange: [DOT.idleWidth, DOT.activeWidth]
34
- }),
35
- // The carousel sits on imagery, so the dots use the mode-invariant
36
- // media ink rather than a surface token: an indicator that inverted
37
- // with the mode would vanish over a bright photo. The idle dot is the
38
- // 0.38 alpha stop — the same value the system dims a disabled control
39
- // to. Both were `#ffffff` / `rgba(255,255,255,0.4)` literals in the
40
- // module constant above, which is why they could not follow a theme.
41
- backgroundColor: progress.interpolate({
42
- inputRange: [0, 1],
43
- outputRange: [theme.white.a10, theme.media.ink]
44
- })
45
- }
46
- ]
47
- }
48
- );
49
- }
50
- function Gallery({
51
- items,
52
- columns = 3,
53
- lightbox = true,
54
- onSelect
55
- }) {
56
- const { styles } = useStyles(sheet);
57
- const [openIndex, setOpenIndex] = React.useState(null);
58
- const open = (i) => {
59
- onSelect?.(i);
60
- if (lightbox) setOpenIndex(i);
61
- };
62
- return /* @__PURE__ */ jsxs(View, { style: styles.galleryRoot, children: [
63
- /* @__PURE__ */ jsx(ScrollView, { contentContainerStyle: styles.grid, children: items.map((item, i) => /* @__PURE__ */ jsx(
64
- Pressable,
65
- {
66
- accessibilityRole: "imagebutton",
67
- accessibilityLabel: item.alt || `Item ${i + 1}`,
68
- onPress: () => open(i),
69
- style: [styles.tile, { width: `${100 / columns}%` }],
70
- children: /* @__PURE__ */ jsxs(View, { style: styles.tileInner, children: [
71
- item.render ? item.render() : /* @__PURE__ */ jsx(Text, { style: styles.tileIndex, children: i + 1 }),
72
- item.duration ? /* @__PURE__ */ jsx(View, { style: styles.durationBadge, children: /* @__PURE__ */ jsx(Text, { style: styles.durationText, children: item.duration }) }) : null
73
- ] })
74
- },
75
- item.id
76
- )) }),
77
- openIndex != null ? /* @__PURE__ */ jsx(
78
- GalleryLightbox,
79
- {
80
- items,
81
- index: openIndex,
82
- onIndexChange: setOpenIndex,
83
- onClose: () => setOpenIndex(null)
84
- }
85
- ) : null
86
- ] });
87
- }
88
- function GalleryLightbox({
89
- items,
90
- index,
91
- onIndexChange,
92
- onClose
93
- }) {
94
- const { styles } = useStyles(sheet);
95
- const theme = useLoamTheme();
96
- const item = items[index];
97
- const count = items.length;
98
- if (!item) return null;
99
- const go = (delta) => onIndexChange((index + delta + count) % count);
100
- return /* @__PURE__ */ jsx(Modal, { visible: true, transparent: true, animationType: "fade", onRequestClose: onClose, children: /* @__PURE__ */ jsxs(View, { style: styles.lightbox, children: [
101
- /* @__PURE__ */ jsxs(View, { style: styles.lightboxBar, children: [
102
- /* @__PURE__ */ jsxs(Text, { style: styles.counter, children: [
103
- index + 1,
104
- " / ",
105
- count
106
- ] }),
107
- /* @__PURE__ */ jsx(
108
- Pressable,
109
- {
110
- accessibilityRole: "button",
111
- accessibilityLabel: "Close",
112
- onPress: onClose,
113
- style: styles.lightboxAction,
114
- children: /* @__PURE__ */ jsx(Icon, { name: "x", size: theme.icon.md, color: theme.media.ink })
115
- }
116
- )
117
- ] }),
118
- /* @__PURE__ */ jsxs(View, { style: styles.lightboxStage, children: [
119
- /* @__PURE__ */ jsx(
120
- Pressable,
121
- {
122
- accessibilityRole: "button",
123
- accessibilityLabel: "Previous image",
124
- onPress: () => go(-1),
125
- style: styles.lightboxNav,
126
- children: /* @__PURE__ */ jsx(Icon, { name: "chevron-left", size: theme.icon.lg, color: theme.media.ink })
127
- }
128
- ),
129
- /* @__PURE__ */ jsx(View, { style: [styles.lightboxImage, { aspectRatio: item.aspectRatio ?? 0.8 }], children: item.render ? item.render() : /* @__PURE__ */ jsxs(Text, { style: styles.lightboxImageLabel, children: [
130
- "Image ",
131
- index + 1,
132
- " \xB7 ",
133
- item.aspectRatio ?? 0.8
134
- ] }) }),
135
- /* @__PURE__ */ jsx(
136
- Pressable,
137
- {
138
- accessibilityRole: "button",
139
- accessibilityLabel: "Next image",
140
- onPress: () => go(1),
141
- style: styles.lightboxNav,
142
- children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: theme.icon.lg, color: theme.media.ink })
143
- }
144
- )
145
- ] }),
146
- /* @__PURE__ */ jsx(View, { style: styles.dots, accessibilityElementsHidden: true, importantForAccessibility: "no", children: items.map((it, i) => /* @__PURE__ */ jsx(Dot, { active: i === index }, it.id)) })
147
- ] }) });
148
- }
149
- var sheet = createStyleSheet((theme) => ({
150
- galleryRoot: { flex: 1 },
151
- grid: { flexDirection: "row", flexWrap: "wrap", padding: theme.space[2] },
152
- tile: { padding: theme.space[2] },
153
- tileInner: {
154
- aspectRatio: 1,
155
- backgroundColor: theme.color.surface3,
156
- alignItems: "center",
157
- justifyContent: "center",
158
- overflow: "hidden"
159
- },
160
- tileIndex: {
161
- fontFamily: theme.font.mono,
162
- fontSize: theme.type.caption2.fontSize,
163
- color: theme.color.text3
164
- },
165
- durationBadge: {
166
- position: "absolute",
167
- right: theme.space[4],
168
- bottom: theme.space[4],
169
- borderRadius: theme.radius.sm,
170
- paddingHorizontal: theme.space[4],
171
- paddingVertical: theme.space[1],
172
- backgroundColor: theme.black.a12
173
- },
174
- durationText: {
175
- fontFamily: theme.font.mono,
176
- fontSize: theme.fontSize[10],
177
- color: theme.media.ink
178
- },
179
- // Not `color.scrim`: a lightbox backdrop sits on imagery rather than on a
180
- // token surface, and it is deliberately far heavier than a modal's scrim. The
181
- // alpha ramp's top stop is cut at 0.92 for exactly this surface, so the value
182
- // is a token now rather than the raw literal the doc leaves it as.
183
- lightbox: { flex: 1, backgroundColor: theme.black.a14 },
184
- lightboxBar: {
185
- flexDirection: "row",
186
- alignItems: "center",
187
- justifyContent: "space-between",
188
- paddingHorizontal: theme.space.s4,
189
- paddingVertical: theme.space[14]
190
- },
191
- counter: {
192
- fontFamily: theme.font.mono,
193
- fontSize: theme.type.caption2.fontSize,
194
- color: theme.media.ink,
195
- opacity: theme.opacity[88]
196
- },
197
- lightboxAction: {
198
- width: theme.tapMin,
199
- height: theme.tapMin,
200
- alignItems: "center",
201
- justifyContent: "center"
202
- },
203
- lightboxStage: {
204
- flex: 1,
205
- flexDirection: "row",
206
- alignItems: "center",
207
- justifyContent: "center",
208
- paddingHorizontal: theme.space[12]
209
- },
210
- lightboxNav: {
211
- width: theme.tapMin,
212
- height: theme.tapMin,
213
- alignItems: "center",
214
- justifyContent: "center"
215
- },
216
- lightboxImage: {
217
- flex: 1,
218
- borderRadius: theme.radius.md,
219
- backgroundColor: theme.color.surface3,
220
- alignItems: "center",
221
- justifyContent: "center"
222
- },
223
- lightboxImageLabel: {
224
- fontFamily: theme.font.mono,
225
- fontSize: theme.type.caption2.fontSize,
226
- // Uppercase wants the caps tracking step, which is a ratio — multiply it by
227
- // the size rather than restating the product as a bare 1.2.
228
- letterSpacing: theme.type.caption2.fontSize * theme.tracking.caps,
229
- textTransform: "uppercase",
230
- color: theme.color.text3
231
- },
232
- dots: {
233
- flexDirection: "row",
234
- justifyContent: "center",
235
- gap: DOT.idleWidth,
236
- paddingVertical: theme.space.s4
237
- },
238
- // Width and background are animated per-dot; see {@link Dot}.
239
- dot: { height: DOT.idleWidth, borderRadius: theme.radius.full }
240
- }));
241
-
242
- export { Gallery, GalleryLightbox };
@@ -1,5 +0,0 @@
1
- export { Header, HeaderAction } from '../chunk-4YQOR7JM.js';
2
- import '../chunk-47FWHGUN.js';
3
- import '../chunk-3NMD74ZU.js';
4
- import '../chunk-6N33LFQA.js';
5
- import '../chunk-TKVFVF5D.js';
@@ -1,5 +0,0 @@
1
- import '../chunk-JRLTGLN4.js';
2
- export { SearchBar, SearchExpand } from '../chunk-47FWHGUN.js';
3
- import '../chunk-3NMD74ZU.js';
4
- import '../chunk-6N33LFQA.js';
5
- import '../chunk-TKVFVF5D.js';
File without changes
File without changes
File without changes