@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,134 +0,0 @@
1
- import { Icon } from './chunk-TKVFVF5D.js';
2
- import 'react';
3
- import { View, Text, Pressable } from 'react-native';
4
- import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
5
- import { jsxs, jsx } from 'react/jsx-runtime';
6
-
7
- var TONE_ICON = {
8
- info: "info",
9
- good: "check-circle",
10
- warn: "alert-triangle",
11
- danger: "alert-circle",
12
- neutral: "info"
13
- };
14
- function alertToneColors(theme, tone) {
15
- switch (tone) {
16
- case "good":
17
- return {
18
- glyph: theme.color.goodOnSoft,
19
- border: theme.color.good,
20
- tint: theme.color.goodSoft
21
- };
22
- case "warn":
23
- return {
24
- glyph: theme.color.warnOnSoft,
25
- border: theme.color.warn,
26
- tint: theme.color.warnSoft
27
- };
28
- case "danger":
29
- return {
30
- glyph: theme.color.dangerOnSoft,
31
- border: theme.color.danger,
32
- tint: theme.color.dangerSoft
33
- };
34
- case "neutral":
35
- return {
36
- glyph: theme.color.text2,
37
- border: theme.color.borderStrong,
38
- tint: theme.color.surface2
39
- };
40
- default:
41
- return {
42
- glyph: theme.color.infoOnSoft,
43
- border: theme.color.info,
44
- tint: theme.color.infoSoft
45
- };
46
- }
47
- }
48
- function Alert({
49
- title,
50
- description,
51
- tone = "info",
52
- icon,
53
- dismissible = false,
54
- onDismiss,
55
- action,
56
- children
57
- }) {
58
- const { styles } = useStyles(sheet, { tone });
59
- const theme = useLoamTheme();
60
- const toneColors = alertToneColors(theme, tone);
61
- const showDismiss = dismissible || onDismiss != null;
62
- const iconName = icon === false ? void 0 : icon ?? TONE_ICON[tone];
63
- const dismissHitSlop = Math.max(0, Math.round((theme.tapMin - theme.icon.sm) / 2));
64
- return /* @__PURE__ */ jsxs(View, { accessibilityRole: "alert", style: [styles.base, { borderColor: toneColors.border }], children: [
65
- iconName ? /* @__PURE__ */ jsx(View, { style: styles.iconSlot, children: /* @__PURE__ */ jsx(Icon, { name: iconName, size: theme.icon.md, color: toneColors.glyph }) }) : null,
66
- /* @__PURE__ */ jsxs(View, { style: styles.content, children: [
67
- /* @__PURE__ */ jsx(Text, { style: styles.title, children: title }),
68
- description ? /* @__PURE__ */ jsx(Text, { style: styles.description, children: description }) : null,
69
- children,
70
- action ? /* @__PURE__ */ jsx(View, { style: styles.action, children: action }) : null
71
- ] }),
72
- showDismiss ? /* @__PURE__ */ jsx(
73
- Pressable,
74
- {
75
- accessibilityRole: "button",
76
- accessibilityLabel: "Dismiss",
77
- onPress: onDismiss,
78
- hitSlop: dismissHitSlop,
79
- style: styles.dismiss,
80
- children: /* @__PURE__ */ jsx(Icon, { name: "x", size: theme.icon.sm, color: toneColors.glyph })
81
- }
82
- ) : null
83
- ] });
84
- }
85
- var sheet = createStyleSheet((theme) => ({
86
- base: {
87
- flexDirection: "row",
88
- alignItems: "flex-start",
89
- gap: theme.space.s3,
90
- padding: theme.space.s4,
91
- borderRadius: theme.radius.lg,
92
- borderWidth: theme.borderWidth.thin,
93
- variants: {
94
- tone: {
95
- info: { backgroundColor: theme.color.infoSoft },
96
- good: { backgroundColor: theme.color.goodSoft },
97
- warn: { backgroundColor: theme.color.warnSoft },
98
- danger: { backgroundColor: theme.color.dangerSoft },
99
- neutral: { backgroundColor: theme.color.surface2 }
100
- }
101
- }
102
- },
103
- iconSlot: {
104
- // Nudge the icon onto the title's optical baseline.
105
- paddingTop: theme.space[1]
106
- },
107
- content: {
108
- flex: 1,
109
- gap: theme.space.s1
110
- },
111
- title: {
112
- fontFamily: theme.font.sans,
113
- fontWeight: theme.fontWeight.bold,
114
- fontSize: theme.fontSize[14],
115
- color: theme.color.text
116
- },
117
- description: {
118
- fontFamily: theme.font.sans,
119
- fontSize: theme.fontSize[14],
120
- color: theme.color.text
121
- },
122
- action: {
123
- flexDirection: "row",
124
- alignItems: "center",
125
- gap: theme.space.s2,
126
- marginTop: theme.space.s2
127
- },
128
- // `marginStart`, not `marginLeft`: RN's layout engine mirrors it under RTL.
129
- dismiss: {
130
- marginStart: theme.space.s2
131
- }
132
- }));
133
-
134
- export { Alert };
@@ -1,204 +0,0 @@
1
- import { Icon } from './chunk-TKVFVF5D.js';
2
- import * as React from 'react';
3
- import { Animated, Pressable, Easing, Modal, View, Text } from 'react-native';
4
- import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
5
- import { jsx, jsxs } from 'react/jsx-runtime';
6
-
7
- var AnimatedPressable = Animated.createAnimatedComponent(Pressable);
8
- var memoryStore = /* @__PURE__ */ new Map();
9
- var defaultRememberStorage = {
10
- getItem: (key) => memoryStore.get(key) ?? null,
11
- setItem: (key, value) => {
12
- memoryStore.set(key, value);
13
- }
14
- };
15
- function Dialog({
16
- open,
17
- defaultOpen = false,
18
- onClose,
19
- onOpenChange,
20
- dismissible = true,
21
- remember = false,
22
- rememberKey,
23
- storage = defaultRememberStorage,
24
- title,
25
- description,
26
- showClose = dismissible,
27
- accessibilityLabel,
28
- motion = "full",
29
- children
30
- }) {
31
- const theme = useLoamTheme();
32
- const { styles } = useStyles(sheet);
33
- const controlled = open !== void 0;
34
- const persist = remember && rememberKey != null;
35
- const reducedMotion = theme.reduceMotion || motion === "reduced";
36
- const instantMotion = motion === "none";
37
- const [internalOpen, setInternalOpen] = React.useState(() => {
38
- if (!controlled && persist) {
39
- const v = storage.getItem(rememberKey);
40
- if (v === "open") return true;
41
- if (v === "closed") return false;
42
- }
43
- return defaultOpen;
44
- });
45
- const actualOpen = controlled ? open : internalOpen;
46
- const setOpen = React.useCallback(
47
- (next) => {
48
- if (persist) storage.setItem(rememberKey, next ? "open" : "closed");
49
- if (!controlled) setInternalOpen(next);
50
- onOpenChange?.(next);
51
- },
52
- [persist, rememberKey, storage, controlled, onOpenChange]
53
- );
54
- const requestDismiss = React.useCallback(() => {
55
- if (!dismissible) return;
56
- setOpen(false);
57
- onClose?.();
58
- }, [dismissible, setOpen, onClose]);
59
- const [mounted, setMounted] = React.useState(actualOpen);
60
- const progress = React.useRef(new Animated.Value(actualOpen ? 1 : 0)).current;
61
- React.useEffect(() => {
62
- const easing = Easing.bezier(...theme.easing.base);
63
- if (actualOpen) {
64
- setMounted(true);
65
- if (instantMotion) {
66
- progress.setValue(1);
67
- return;
68
- }
69
- Animated.timing(progress, {
70
- toValue: 1,
71
- duration: theme.duration.base,
72
- easing,
73
- useNativeDriver: true
74
- }).start();
75
- } else {
76
- if (instantMotion) {
77
- progress.setValue(0);
78
- setMounted(false);
79
- return;
80
- }
81
- Animated.timing(progress, {
82
- toValue: 0,
83
- duration: theme.duration.base,
84
- easing,
85
- useNativeDriver: true
86
- }).start(({ finished }) => {
87
- if (finished) setMounted(false);
88
- });
89
- }
90
- }, [actualOpen, progress, theme.duration.base, theme.easing.base, instantMotion]);
91
- if (!mounted) return null;
92
- const cardScale = reducedMotion ? 1 : progress.interpolate({ inputRange: [0, 1], outputRange: [0.96, 1] });
93
- return /* @__PURE__ */ jsx(Modal, { transparent: true, visible: mounted, animationType: "none", onRequestClose: requestDismiss, children: /* @__PURE__ */ jsxs(View, { style: styles.root, children: [
94
- /* @__PURE__ */ jsx(
95
- AnimatedPressable,
96
- {
97
- accessibilityRole: "button",
98
- accessibilityLabel: "Close dialog",
99
- accessibilityElementsHidden: !dismissible,
100
- importantForAccessibility: dismissible ? "auto" : "no-hide-descendants",
101
- onPress: dismissible ? requestDismiss : void 0,
102
- style: [styles.scrim, { opacity: progress }]
103
- }
104
- ),
105
- /* @__PURE__ */ jsxs(
106
- Animated.View,
107
- {
108
- role: "dialog",
109
- accessibilityViewIsModal: true,
110
- accessibilityLabel: accessibilityLabel ?? title,
111
- style: [styles.card, { opacity: progress, transform: [{ scale: cardScale }] }],
112
- children: [
113
- showClose ? /* @__PURE__ */ jsx(
114
- Pressable,
115
- {
116
- accessibilityRole: "button",
117
- accessibilityLabel: "Close",
118
- onPress: requestDismiss,
119
- style: styles.close,
120
- hitSlop: 8,
121
- children: /* @__PURE__ */ jsx(Icon, { name: "x", size: 20, color: theme.color.text3 })
122
- }
123
- ) : null,
124
- title ? /* @__PURE__ */ jsx(DialogTitle, { children: title }) : null,
125
- description ? /* @__PURE__ */ jsx(DialogDescription, { children: description }) : null,
126
- children
127
- ]
128
- }
129
- )
130
- ] }) });
131
- }
132
- function DialogTitle({ children }) {
133
- const { styles } = useStyles(sheet);
134
- return /* @__PURE__ */ jsx(Text, { style: styles.title, children });
135
- }
136
- function DialogDescription({ children }) {
137
- const { styles } = useStyles(sheet);
138
- return /* @__PURE__ */ jsx(Text, { style: styles.description, children });
139
- }
140
- function DialogFooter({ children }) {
141
- const { styles } = useStyles(sheet);
142
- return /* @__PURE__ */ jsx(View, { style: styles.footer, children });
143
- }
144
- var sheet = createStyleSheet((theme) => ({
145
- root: {
146
- flex: 1,
147
- alignItems: "center",
148
- justifyContent: "center",
149
- padding: theme.space.s5
150
- },
151
- scrim: {
152
- position: "absolute",
153
- top: 0,
154
- left: 0,
155
- right: 0,
156
- bottom: 0,
157
- backgroundColor: theme.color.scrim
158
- },
159
- // loam-contrast-ignore — the boundary here is the scrim, not the shadow.
160
- // `color.scrim` is a 44% wash and is *not* re-resolved by high contrast, so
161
- // this surface is still separated from the page when the elevation zeroes
162
- // out. A border would put a hairline around every modal for no gain.
163
- card: {
164
- width: "100%",
165
- // The reference width, which is now a named tier rather than a literal.
166
- maxWidth: theme.panel.xl,
167
- alignSelf: "center",
168
- backgroundColor: theme.color.surface,
169
- borderRadius: theme.radius.xl,
170
- padding: theme.space.s5,
171
- gap: theme.space.s3,
172
- ...theme.shadow.lg
173
- },
174
- close: {
175
- position: "absolute",
176
- top: theme.space.s3,
177
- right: theme.space.s3,
178
- zIndex: 1,
179
- padding: theme.space.s1,
180
- borderRadius: theme.radius.full
181
- },
182
- title: {
183
- fontFamily: theme.font.display,
184
- fontWeight: `${theme.font.displayWeight}`,
185
- fontSize: theme.fontSize[26],
186
- color: theme.color.text
187
- },
188
- description: {
189
- fontFamily: theme.font.sans,
190
- // Reference (buildOverlays, Android): font-size:14px — sm token matches exactly.
191
- fontSize: theme.fontSize[14],
192
- lineHeight: theme.fontSize[14] * 1.5,
193
- color: theme.color.text2
194
- },
195
- footer: {
196
- flexDirection: "row",
197
- justifyContent: "flex-end",
198
- alignItems: "center",
199
- gap: theme.space.s2,
200
- marginTop: theme.space.s2
201
- }
202
- }));
203
-
204
- export { Dialog, DialogDescription, DialogFooter, DialogTitle, defaultRememberStorage };
@@ -1,169 +0,0 @@
1
- import { Chip } from './chunk-AI4DWZCD.js';
2
- import { NumberRoll } from './chunk-CUMUNPXY.js';
3
- import * as React from 'react';
4
- import { AccessibilityInfo, View, ScrollView, Text, Pressable } from 'react-native';
5
- import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
6
- import { jsxs, jsx } from 'react/jsx-runtime';
7
-
8
- function FilterBar({
9
- filters,
10
- resultCount,
11
- resultNoun = "results",
12
- onClearAll,
13
- children,
14
- density = "comfortable",
15
- motion = "full",
16
- animateCount = false,
17
- accessibilityLabel = "Active filters"
18
- }) {
19
- const { styles } = useStyles(sheet, { density });
20
- const theme = useLoamTheme();
21
- const hasFilters = filters.length > 0;
22
- const showClearAll = hasFilters && onClearAll != null;
23
- const hasCount = resultCount != null;
24
- const countLabel = hasCount ? `${resultCount} ${resultNoun}` : void 0;
25
- React.useEffect(() => {
26
- if (countLabel !== void 0 && !animateCount)
27
- AccessibilityInfo.announceForAccessibility(countLabel);
28
- }, [countLabel, animateCount]);
29
- return /* @__PURE__ */ jsxs(
30
- View,
31
- {
32
- accessibilityRole: "toolbar",
33
- accessibilityLabel,
34
- style: styles.root,
35
- children: [
36
- children,
37
- hasFilters ? /* @__PURE__ */ jsx(
38
- ScrollView,
39
- {
40
- horizontal: true,
41
- showsHorizontalScrollIndicator: false,
42
- style: styles.scrollRoot,
43
- contentContainerStyle: styles.scrollContent,
44
- children: filters.map((filter) => /* @__PURE__ */ jsx(
45
- Chip,
46
- {
47
- selectable: true,
48
- selected: true,
49
- removable: true,
50
- onRemove: filter.onRemove,
51
- onSelectedChange: filter.onRemove,
52
- accessibilityLabel: filter.label,
53
- children: filter.label
54
- },
55
- filter.id
56
- ))
57
- }
58
- ) : /* @__PURE__ */ jsx(Text, { style: styles.empty, children: "No filters" }),
59
- showClearAll ? /* @__PURE__ */ jsx(
60
- Pressable,
61
- {
62
- accessibilityRole: "button",
63
- accessibilityLabel: "Clear all",
64
- onPress: onClearAll,
65
- hitSlop: 8,
66
- style: ({ pressed }) => [
67
- styles.clearAll,
68
- pressed ? { backgroundColor: theme.state.pressed } : null
69
- ],
70
- children: /* @__PURE__ */ jsx(Text, { style: styles.clearAllLabel, children: "Clear all" })
71
- }
72
- ) : null,
73
- hasCount ? animateCount ? /* @__PURE__ */ jsx(
74
- NumberRoll,
75
- {
76
- value: resultCount,
77
- formatValue: () => countLabel,
78
- textStyle: {
79
- fontFamily: theme.font.sans,
80
- fontWeight: theme.fontWeight.semibold,
81
- fontSize: theme.type.footnote.fontSize,
82
- lineHeight: theme.type.footnote.lineHeight,
83
- color: theme.color.text2
84
- },
85
- motion,
86
- announce: true,
87
- style: styles.countRoll
88
- }
89
- ) : (
90
- // `accessibilityLiveRegion` re-announces on Android; the effect above
91
- // covers iOS, where the prop is a no-op.
92
- /* @__PURE__ */ jsx(
93
- Text,
94
- {
95
- accessibilityLiveRegion: "polite",
96
- accessibilityLabel: countLabel,
97
- style: styles.count,
98
- children: countLabel
99
- }
100
- )
101
- ) : /* @__PURE__ */ jsx(View, { style: styles.countSpacer })
102
- ]
103
- }
104
- );
105
- }
106
- var sheet = createStyleSheet((theme) => ({
107
- root: {
108
- flexDirection: "row",
109
- alignItems: "center",
110
- variants: {
111
- density: {
112
- comfortable: { gap: theme.space.s3 },
113
- compact: { gap: theme.space.s2 }
114
- }
115
- }
116
- },
117
- // The scroll container must not grow to fill the cross axis, so `flexShrink: 1`
118
- // lets it give room to the count + clear-all while `flexGrow: 0` keeps it to
119
- // its content height.
120
- scrollRoot: { flexGrow: 0, flexShrink: 1 },
121
- scrollContent: {
122
- flexDirection: "row",
123
- alignItems: "center",
124
- variants: {
125
- density: {
126
- comfortable: { gap: theme.space.s2 },
127
- compact: { gap: theme.space.s1 }
128
- }
129
- }
130
- },
131
- empty: {
132
- fontFamily: theme.font.sans,
133
- fontSize: theme.type.footnote.fontSize,
134
- lineHeight: theme.type.footnote.lineHeight,
135
- color: theme.color.text3
136
- },
137
- // Never shrinks: the tokens scroll, the count does not, so "62 results"
138
- // stays on one line instead of stacking into two.
139
- count: {
140
- marginStart: "auto",
141
- flexShrink: 0,
142
- fontFamily: theme.font.sans,
143
- fontWeight: theme.fontWeight.semibold,
144
- fontSize: theme.type.footnote.fontSize,
145
- lineHeight: theme.type.footnote.lineHeight,
146
- fontVariant: ["tabular-nums"],
147
- color: theme.color.text2
148
- },
149
- // Keeps clear-all pinned to the inline start edge when there is no count to
150
- // push it there with `marginStart: 'auto'`.
151
- countSpacer: { marginStart: "auto", width: 0 },
152
- // The rolling count sits where the static one does — pushed to the inline end.
153
- countRoll: { marginStart: "auto", flexShrink: 0 },
154
- clearAll: {
155
- flexShrink: 0,
156
- paddingHorizontal: theme.space.s2,
157
- paddingVertical: theme.space.s1,
158
- borderRadius: theme.radius.sm
159
- },
160
- clearAllLabel: {
161
- fontFamily: theme.font.sans,
162
- fontWeight: theme.fontWeight.semibold,
163
- fontSize: theme.type.footnote.fontSize,
164
- lineHeight: theme.type.footnote.lineHeight,
165
- color: theme.color.text2
166
- }
167
- }));
168
-
169
- export { FilterBar };
@@ -1,191 +0,0 @@
1
- import * as React from 'react';
2
- import { View, Text } from 'react-native';
3
- import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
4
- import { jsx, jsxs } from 'react/jsx-runtime';
5
-
6
- // src/kbd/kbd.tsx
7
- var COMMON_GLYPHS = {
8
- enter: "\u21B5",
9
- return: "\u21B5",
10
- esc: "Esc",
11
- escape: "Esc",
12
- tab: "\u21E5",
13
- backspace: "\u232B",
14
- delete: "\u2326",
15
- del: "\u2326",
16
- space: "\u2423",
17
- up: "\u2191",
18
- down: "\u2193",
19
- left: "\u2190",
20
- right: "\u2192",
21
- arrowup: "\u2191",
22
- arrowdown: "\u2193",
23
- arrowleft: "\u2190",
24
- arrowright: "\u2192",
25
- pageup: "\u21DE",
26
- pagedown: "\u21DF",
27
- home: "\u2196",
28
- end: "\u2198",
29
- capslock: "\u21EA",
30
- win: "\u229E"
31
- };
32
- var APPLE_MODIFIERS = {
33
- cmd: "\u2318",
34
- command: "\u2318",
35
- meta: "\u2318",
36
- super: "\u2318",
37
- shift: "\u21E7",
38
- ctrl: "\u2303",
39
- control: "\u2303",
40
- alt: "\u2325",
41
- opt: "\u2325",
42
- option: "\u2325"
43
- };
44
- var TEXT_MODIFIERS = {
45
- cmd: "Cmd",
46
- command: "Cmd",
47
- meta: "Meta",
48
- super: "Super",
49
- shift: "Shift",
50
- ctrl: "Ctrl",
51
- control: "Ctrl",
52
- alt: "Alt",
53
- opt: "Alt",
54
- option: "Alt"
55
- };
56
- var SPOKEN = {
57
- cmd: "Command",
58
- command: "Command",
59
- meta: "Command",
60
- super: "Command",
61
- shift: "Shift",
62
- ctrl: "Control",
63
- control: "Control",
64
- alt: "Option",
65
- opt: "Option",
66
- option: "Option",
67
- enter: "Enter",
68
- return: "Return",
69
- esc: "Escape",
70
- escape: "Escape",
71
- tab: "Tab",
72
- backspace: "Backspace",
73
- delete: "Delete",
74
- del: "Delete",
75
- space: "Space",
76
- up: "Up",
77
- down: "Down",
78
- left: "Left",
79
- right: "Right",
80
- arrowup: "Up",
81
- arrowdown: "Down",
82
- arrowleft: "Left",
83
- arrowright: "Right",
84
- pageup: "Page Up",
85
- pagedown: "Page Down",
86
- home: "Home",
87
- end: "End",
88
- capslock: "Caps Lock",
89
- win: "Windows"
90
- };
91
- function resolveKey(key, symbols, apple) {
92
- if (!symbols) return key;
93
- const k = key.trim().toLowerCase();
94
- const modifiers = apple ? APPLE_MODIFIERS : TEXT_MODIFIERS;
95
- return modifiers[k] ?? COMMON_GLYPHS[k] ?? key;
96
- }
97
- function spokenKey(key, apple) {
98
- const k = key.trim().toLowerCase();
99
- const word = SPOKEN[k];
100
- if (word) {
101
- if (!apple && (k === "alt" || k === "opt" || k === "option")) return "Alt";
102
- return word;
103
- }
104
- return key.length === 1 ? key.toUpperCase() : key;
105
- }
106
- function spokenLabel(parts, apple) {
107
- return parts.map((k) => spokenKey(k, apple)).join(" ");
108
- }
109
- function Kbd({
110
- keys,
111
- symbols = true,
112
- size = "md",
113
- // `motion` is accepted for API parity but intentionally unused — Kbd has no
114
- // animation. Destructured so it never lands on the underlying View.
115
- motion: _motion = "full",
116
- children,
117
- accessibilityLabel
118
- }) {
119
- const { styles } = useStyles(sheet, { size });
120
- const theme = useLoamTheme();
121
- const apple = theme.platform === "iOS";
122
- if (keys === void 0) {
123
- const label2 = accessibilityLabel ?? (typeof children === "string" ? spokenLabel([children], apple) : void 0);
124
- return /* @__PURE__ */ jsx(View, { accessible: true, accessibilityRole: "text", accessibilityLabel: label2, style: styles.cap, children: typeof children === "string" ? /* @__PURE__ */ jsx(Text, { style: styles.label, children }) : children });
125
- }
126
- const list = Array.isArray(keys) ? keys : String(keys).split("+");
127
- const parts = list.map((k) => k.trim()).filter((k) => k.length > 0);
128
- const label = accessibilityLabel ?? spokenLabel(parts, apple);
129
- return /* @__PURE__ */ jsx(View, { accessible: true, accessibilityRole: "text", accessibilityLabel: label, style: styles.group, children: parts.map((key, i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
130
- i > 0 ? /* @__PURE__ */ jsx(Text, { style: styles.plus, children: "+" }) : null,
131
- /* @__PURE__ */ jsx(View, { style: styles.cap, children: /* @__PURE__ */ jsx(Text, { style: styles.label, children: resolveKey(key, symbols, apple) }) })
132
- ] }, `${key}-${i}`)) });
133
- }
134
- var sheet = createStyleSheet((theme) => ({
135
- // The row of keycaps. `space.s1` gap matches the web `gap-1` between caps.
136
- group: { flexDirection: "row", alignItems: "center", gap: theme.space.s1 },
137
- // A single keycap. No native `--kbd-bg` token exists, so — as the native
138
- // contract prescribes — the subtle surface falls back to `surface2` + a
139
- // hairline border. The tiny `minWidth`/`minHeight` (20 / 24) mirror the web
140
- // `kbd`'s raw-px `h-[20px]`/`min-w-[20px]` keycap box one-to-one.
141
- cap: {
142
- alignItems: "center",
143
- justifyContent: "center",
144
- backgroundColor: theme.color.surface2,
145
- borderWidth: theme.borderWidth.base,
146
- borderColor: theme.color.border,
147
- borderRadius: theme.radius.sm,
148
- variants: {
149
- size: {
150
- sm: {
151
- minWidth: theme.space[20],
152
- minHeight: theme.space[20],
153
- paddingHorizontal: theme.space.s1
154
- },
155
- md: {
156
- minWidth: theme.space[24],
157
- minHeight: theme.space[24],
158
- paddingHorizontal: theme.space.s2
159
- }
160
- }
161
- }
162
- },
163
- // Monospace, tabular figures so combos line up. `text2` matches web `text-ink-2`.
164
- label: {
165
- fontFamily: theme.font.mono,
166
- color: theme.color.text2,
167
- textAlign: "center",
168
- fontVariant: ["tabular-nums"],
169
- variants: {
170
- size: {
171
- sm: {
172
- fontSize: theme.type.caption2.fontSize,
173
- lineHeight: theme.type.caption2.lineHeight
174
- },
175
- md: {
176
- fontSize: theme.type.caption1.fontSize,
177
- lineHeight: theme.type.caption1.lineHeight
178
- }
179
- }
180
- }
181
- },
182
- // The `+` between keys — muted (`text3`, web `text-ink-3`), decorative only.
183
- plus: {
184
- fontFamily: theme.font.mono,
185
- color: theme.color.text3,
186
- fontSize: theme.type.caption1.fontSize,
187
- lineHeight: theme.type.caption1.lineHeight
188
- }
189
- }));
190
-
191
- export { Kbd };
@@ -1,6 +0,0 @@
1
- // src/lib/a11y.ts
2
- function expandedProps(expanded) {
3
- return { "aria-expanded": expanded };
4
- }
5
-
6
- export { expandedProps };