@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.
- package/dist/accordion/index.js +5 -3
- package/dist/adaptive/index.js +6 -2
- package/dist/alert/index.js +5 -2
- package/dist/analyzer/index.js +9 -6
- package/dist/announcement/index.js +8 -5
- package/dist/audio-player/index.js +5 -3
- package/dist/avatar/index.js +5 -2
- package/dist/avatar-group/index.js +7 -3
- package/dist/badge/index.js +7 -4
- package/dist/banner/index.js +5 -2
- package/dist/board/index.js +11 -6
- package/dist/button/index.js +6 -3
- package/dist/camera-permission/index.js +15 -12
- package/dist/capture-result/index.js +19 -16
- package/dist/card/index.js +6 -3
- package/dist/card-form/index.js +12 -8
- package/dist/carousel/index.js +4 -2
- package/dist/chart/index.js +8 -5
- package/dist/charts/index.js +8 -6
- package/dist/chat/index.js +16 -0
- package/dist/checkbox/index.js +6 -4
- package/dist/checklist/index.js +11 -8
- package/dist/checkout/index.js +16 -11
- package/dist/chip/index.js +7 -4
- package/dist/{chunk-XNUVB5OL.js → chunk-2OLKPG4E.js} +92 -28
- package/dist/{chunk-RUZHTGKB.js → chunk-2PKYGLQ6.js} +71 -40
- package/dist/{chunk-UC2WGUP3.js → chunk-2SWKL3AJ.js} +91 -252
- package/dist/{chunk-AI4DWZCD.js → chunk-2SY63FCH.js} +63 -16
- package/dist/{chunk-F5XNPWS7.js → chunk-2TXERVVA.js} +92 -35
- package/dist/chunk-36EC2T6P.js +581 -0
- package/dist/chunk-3DUWIYV5.js +437 -0
- package/dist/{chunk-JNY4ZHAR.js → chunk-3QMEOFW5.js} +275 -71
- package/dist/chunk-3WEZCGHX.js +265 -0
- package/dist/chunk-46MMSDGL.js +194 -0
- package/dist/{chunk-7O2FMUPT.js → chunk-4IZXHVFJ.js} +297 -92
- package/dist/{chunk-LAECSR4H.js → chunk-5LAAAXFP.js} +14 -8
- package/dist/{chunk-2A5NIQAK.js → chunk-5RENVKBQ.js} +134 -46
- package/dist/{chunk-2ZZ7TDJ4.js → chunk-5UTRIXQ6.js} +37 -31
- package/dist/{chunk-LOE5YNN3.js → chunk-5VFZRGVD.js} +37 -10
- package/dist/{chunk-52X2VYTD.js → chunk-67IZZ2MJ.js} +115 -60
- package/dist/{chunk-UYG5L34B.js → chunk-6YAQBXB3.js} +10 -4
- package/dist/{chunk-BTTFCMKG.js → chunk-74FLKD24.js} +94 -23
- package/dist/{chunk-ITTYJZWX.js → chunk-7BUIKDD6.js} +73 -18
- package/dist/{chunk-423B7SPN.js → chunk-7OVVSVEZ.js} +273 -109
- package/dist/chunk-AEB7KCHQ.js +287 -0
- package/dist/chunk-APCWFOZW.js +28 -0
- package/dist/chunk-AWKQIE5I.js +139 -0
- package/dist/{chunk-VCDBXW5H.js → chunk-B7N4ASYE.js} +86 -42
- package/dist/{chunk-IVNRBPGC.js → chunk-C4GTDLRC.js} +104 -20
- package/dist/{chunk-4ZAHCY44.js → chunk-C6APNDVA.js} +12 -5
- package/dist/{chunk-4SZYY6AN.js → chunk-CMTVNF3D.js} +18 -13
- package/dist/{chunk-HZ6CNMAF.js → chunk-CPTOADB2.js} +151 -96
- package/dist/chunk-D5N5QWI7.js +1325 -0
- package/dist/{chunk-IIQTAY3J.js → chunk-DN7MNQIP.js} +113 -29
- package/dist/{chunk-47FWHGUN.js → chunk-DVGBZ3TX.js} +84 -23
- package/dist/chunk-DW3L54DQ.js +305 -0
- package/dist/{chunk-3ARE4TES.js → chunk-E2E3I5W2.js} +69 -18
- package/dist/{chunk-DHWADYZX.js → chunk-EDCBJV7J.js} +41 -28
- package/dist/{chunk-WSW6ZFAQ.js → chunk-ENP3BMZU.js} +4 -4
- package/dist/{chunk-OOPPQH27.js → chunk-EVOIGUBI.js} +43 -19
- package/dist/{chunk-VEAYTRPX.js → chunk-EY4DD67D.js} +165 -97
- package/dist/{chunk-223Q2T2Q.js → chunk-F3H33DQX.js} +132 -61
- package/dist/{chunk-CYRBHQQZ.js → chunk-F5B3UINI.js} +68 -35
- package/dist/{chunk-6X6PQ443.js → chunk-FAJI7BSC.js} +20 -9
- package/dist/{chunk-MOUJOP55.js → chunk-FUMHAAF3.js} +96 -29
- package/dist/{chunk-6HT2LP62.js → chunk-FV6HMP7W.js} +192 -73
- package/dist/{chunk-S7F6XLTK.js → chunk-FYWNRX4F.js} +76 -47
- package/dist/{chunk-YG3ZJHGU.js → chunk-FZGAAOKS.js} +30 -8
- package/dist/{chunk-YDGVJETP.js → chunk-G3AFC24V.js} +1 -1
- package/dist/{chunk-EJBDRVIH.js → chunk-G6UESEVN.js} +15 -8
- package/dist/chunk-GDKVKNR2.js +339 -0
- package/dist/chunk-GEIGMWNF.js +10 -0
- package/dist/{chunk-JUAMLEHX.js → chunk-H7DWSL4O.js} +24 -12
- package/dist/chunk-HJFFOOJ4.js +1 -0
- package/dist/{chunk-RW6ZL2FQ.js → chunk-HJLPZA4X.js} +106 -21
- package/dist/chunk-HYEOQWT7.js +647 -0
- package/dist/chunk-I2KLQ2HA.js +19 -0
- package/dist/{chunk-CJ5EOYZE.js → chunk-I4FHVKEC.js} +11 -5
- package/dist/{chunk-JNH2TYIN.js → chunk-IDM7JJMO.js} +19 -5
- package/dist/{chunk-O4AEHWII.js → chunk-IPUNJMAQ.js} +141 -49
- package/dist/{chunk-J7Q7VCVC.js → chunk-IT6FUXXG.js} +13 -6
- package/dist/{chunk-QJJ6MADV.js → chunk-IVKMZ7BB.js} +80 -28
- package/dist/{chunk-Z7H7VSFZ.js → chunk-IXKWIFWZ.js} +17 -6
- package/dist/chunk-J64KGCGX.js +55 -0
- package/dist/chunk-JBMLWFSJ.js +270 -0
- package/dist/{chunk-4BXMXBJO.js → chunk-JJLPBRVZ.js} +22 -11
- package/dist/chunk-JLC6PM5S.js +406 -0
- package/dist/chunk-JUYWSSKW.js +335 -0
- package/dist/{chunk-7CFF4HXS.js → chunk-JV5YOTOB.js} +49 -11
- package/dist/{chunk-LZLHELAG.js → chunk-KFJGFLMW.js} +29 -8
- package/dist/{chunk-O7AE6DAF.js → chunk-KQZ3GLHR.js} +18 -8
- package/dist/{chunk-N32RGOA5.js → chunk-LKFC4CS7.js} +80 -24
- package/dist/{chunk-YC6WORFL.js → chunk-LMPHCVJJ.js} +82 -50
- package/dist/{chunk-3WPW4KUN.js → chunk-LQP4KEXZ.js} +45 -13
- package/dist/{chunk-TKQYWZ5V.js → chunk-LUMVGO2K.js} +47 -31
- package/dist/{chunk-AWJOCGFZ.js → chunk-M656FYNH.js} +25 -13
- package/dist/{chunk-35OFI3JG.js → chunk-MKSNFG7H.js} +73 -20
- package/dist/{chunk-4GBOGOTV.js → chunk-NBEF4EPJ.js} +16 -6
- package/dist/chunk-NNCOFLNE.js +24 -0
- package/dist/{chunk-4YQOR7JM.js → chunk-NTQ2F3AU.js} +73 -20
- package/dist/{chunk-QCDXZBC5.js → chunk-O5V4TG3V.js} +126 -44
- package/dist/{chunk-U7TFM2JA.js → chunk-OJQUBQWA.js} +3 -3
- package/dist/{chunk-VQHPQEUH.js → chunk-OWAMM2DK.js} +13 -6
- package/dist/chunk-PID3NJB7.js +405 -0
- package/dist/{chunk-HET4LLMX.js → chunk-PMMTGBBS.js} +27 -17
- package/dist/{chunk-RIBDXGUG.js → chunk-PNF3NKB5.js} +49 -16
- package/dist/{chunk-JXJB2X6M.js → chunk-Q6NKEPRE.js} +81 -32
- package/dist/chunk-QDZGFXQD.js +176 -0
- package/dist/{chunk-SYNOJOQO.js → chunk-QEYFDRHR.js} +60 -26
- package/dist/{chunk-VBOXAEPI.js → chunk-QHAITQIF.js} +97 -22
- package/dist/{chunk-VXDZFJGP.js → chunk-QHTVYA65.js} +230 -76
- package/dist/{chunk-TUTI5HOZ.js → chunk-QIKT7LIB.js} +14 -8
- package/dist/{chunk-3ENTMPQY.js → chunk-QP3KMOVF.js} +82 -42
- package/dist/{chunk-GNNJ4GCC.js → chunk-QPWDDJJ4.js} +62 -148
- package/dist/{chunk-QWCMU5B2.js → chunk-QRUMA22E.js} +205 -80
- package/dist/{chunk-ZVFE5QGU.js → chunk-QYPE5JX3.js} +50 -10
- package/dist/{chunk-PUPM2YGF.js → chunk-ROCUG24E.js} +76 -36
- package/dist/{chunk-NQYBUO3K.js → chunk-RU3ZPNL6.js} +333 -142
- package/dist/{chunk-TOXAGRDQ.js → chunk-RXSCIO6W.js} +14 -5
- package/dist/{chunk-FMYDDECK.js → chunk-SATMR6SG.js} +631 -203
- package/dist/{chunk-4YIP3CWS.js → chunk-SHHY5OMK.js} +7 -5
- package/dist/chunk-SKWO3SZF.js +2284 -0
- package/dist/{chunk-YF4NSSMT.js → chunk-SWS5JQIF.js} +41 -13
- package/dist/{chunk-CUMUNPXY.js → chunk-T5LTPKX6.js} +15 -7
- package/dist/{chunk-H6NIOQHK.js → chunk-TDMG26JI.js} +26 -6
- package/dist/{chunk-UWFLYMAR.js → chunk-TLCIR6RG.js} +267 -126
- package/dist/{chunk-SBMNWWBV.js → chunk-TN2ZNJUI.js} +47 -9
- package/dist/{chunk-5YNTNN5A.js → chunk-TQVAIKFD.js} +106 -41
- package/dist/chunk-TRGFFU6A.js +1456 -0
- package/dist/{chunk-2GK6PHGE.js → chunk-TY4MTKQJ.js} +100 -22
- package/dist/{chunk-AZRX6SAC.js → chunk-U23FYWME.js} +15 -7
- package/dist/{chunk-PZXZJBMP.js → chunk-U5NLHYV6.js} +26 -12
- package/dist/chunk-UQEN55EY.js +1 -0
- package/dist/chunk-UQGBTPXH.js +218 -0
- package/dist/chunk-UXGIW7OK.js +116 -0
- package/dist/{chunk-PJXUJYS6.js → chunk-UYGDJWMN.js} +55 -30
- package/dist/{chunk-QDYDBCFP.js → chunk-V2OEB75Z.js} +50 -51
- package/dist/{chunk-LSS54GLJ.js → chunk-VAOAKWUK.js} +34 -13
- package/dist/{chunk-DM5QUKKO.js → chunk-VDPK5CY4.js} +18 -6
- package/dist/chunk-W23G6JLF.js +37 -0
- package/dist/{chunk-CDRZHT42.js → chunk-W63AJTM7.js} +276 -12
- package/dist/{chunk-XXXEFXY5.js → chunk-W74TXYFB.js} +13 -5
- package/dist/{chunk-LRJNDEIA.js → chunk-WRDSPUE7.js} +144 -29
- package/dist/{chunk-C2NTXVWM.js → chunk-XBZGDDMR.js} +11 -4
- package/dist/{chunk-BV3B2HYZ.js → chunk-XIDTBCBA.js} +189 -131
- package/dist/{chunk-YTFKPRUK.js → chunk-XN4KG3P4.js} +348 -153
- package/dist/chunk-XQXMLMH3.js +211 -0
- package/dist/{chunk-HPPW424V.js → chunk-XTORZWRF.js} +19 -8
- package/dist/{chunk-P23EQNRQ.js → chunk-YAAHPATV.js} +181 -30
- package/dist/{chunk-KMI5ML5I.js → chunk-YXOAPXMU.js} +57 -18
- package/dist/{chunk-RJQOOHT2.js → chunk-ZECZOOSB.js} +59 -28
- package/dist/{chunk-QKXCPTFS.js → chunk-ZLTO5VQI.js} +121 -31
- package/dist/{chunk-BEDBFJND.js → chunk-ZVATDZOM.js} +16 -18
- package/dist/coachmark/index.js +6 -3
- package/dist/code-block/index.js +5 -3
- package/dist/color-field/index.js +6 -4
- package/dist/commerce/index.js +19 -16
- package/dist/connectivity/index.js +5 -2
- package/dist/context-menu/index.js +5 -3
- package/dist/copy-button/index.js +4 -2
- package/dist/data-grid/index.js +21 -16
- package/dist/date-range-picker/index.js +11 -8
- package/dist/description-list/index.js +3 -1
- package/dist/dialog/index.js +4 -2
- package/dist/empty-state/index.js +4 -2
- package/dist/error-summary/index.js +4 -2
- package/dist/fab/index.js +5 -2
- package/dist/file-manager/index.js +28 -0
- package/dist/file-upload/index.js +10 -7
- package/dist/filter-bar/index.js +9 -6
- package/dist/flow-run/index.js +15 -12
- package/dist/form/index.js +5 -3
- package/dist/gallery/index.js +5 -2
- package/dist/hold-to-confirm/index.js +4 -2
- package/dist/index.d.ts +9557 -2985
- package/dist/index.js +355 -122
- package/dist/infinite-list/index.js +4 -2
- package/dist/inline-edit/index.js +6 -4
- package/dist/input/index.js +5 -3
- package/dist/interactions/index.js +2 -1
- package/dist/invoice/index.js +13 -9
- package/dist/kbd/index.js +5 -1
- package/dist/keyboard/index.js +4 -2
- package/dist/list-row/index.js +6 -4
- package/dist/log-viewer/index.js +4 -2
- package/dist/map-view/index.js +5 -3
- package/dist/markdown/index.js +9 -6
- package/dist/metric/index.js +7 -4
- package/dist/money/index.js +9 -3
- package/dist/nav-drawer/index.js +4 -2
- package/dist/nav-header/index.js +9 -0
- package/dist/navigation/index.js +5 -2
- package/dist/notification-center/index.js +12 -10
- package/dist/number-roll/index.js +5 -2
- package/dist/one-handed/index.js +5 -3
- package/dist/os-surfaces/index.js +6 -3
- package/dist/otp/index.js +7 -4
- package/dist/page-header/index.js +1 -0
- package/dist/pagination/index.js +6 -0
- package/dist/payment-method/index.js +14 -10
- package/dist/payment-status/index.js +17 -14
- package/dist/permission/index.js +5 -2
- package/dist/picker/index.js +11 -6
- package/dist/progress/index.js +6 -3
- package/dist/pull-to-refresh/index.js +4 -2
- package/dist/radio-group/index.js +6 -4
- package/dist/rating/index.js +5 -2
- package/dist/receivables/index.js +21 -16
- package/dist/refund/index.js +18 -14
- package/dist/save-status/index.js +5 -3
- package/dist/scroll-area/index.js +3 -1
- package/dist/search-field/index.js +8 -0
- package/dist/segmented-control/index.js +4 -3
- package/dist/sheet/index.js +5 -3
- package/dist/skeleton/index.js +3 -1
- package/dist/slider/index.js +4 -2
- package/dist/sortable/index.js +7 -0
- package/dist/spinner/index.js +3 -1
- package/dist/split-button/index.js +9 -6
- package/dist/spotlight/index.js +3 -1
- package/dist/stage-timeline/index.js +5 -3
- package/dist/status-dot/index.js +4 -2
- package/dist/stepper/index.js +7 -4
- package/dist/streaming-text/index.js +3 -2
- package/dist/survey/index.js +18 -15
- package/dist/switch/index.js +5 -3
- package/dist/system-state/index.js +7 -4
- package/dist/tab-bar/index.js +5 -2
- package/dist/tabs/index.js +4 -2
- package/dist/tags-input/index.js +10 -0
- package/dist/textarea/index.js +6 -4
- package/dist/thinking/index.js +3 -1
- package/dist/time-field/index.js +12 -0
- package/dist/time-range-control/index.js +22 -0
- package/dist/timeline/index.js +4 -2
- package/dist/toast/index.js +4 -2
- package/dist/toolbar/index.js +4 -2
- package/dist/tour/index.js +12 -9
- package/dist/truncation-notice/index.js +5 -2
- package/dist/update-notice/index.js +12 -9
- package/dist/video-player/index.js +5 -2
- package/dist/viewfinder/index.js +6 -4
- package/dist/widget/index.js +7 -4
- package/dist/wizard/index.js +7 -4
- package/package.json +13 -12
- package/dist/chunk-6N33LFQA.js +0 -35
- package/dist/chunk-GDKZTW34.js +0 -395
- package/dist/chunk-GL7B2DOW.js +0 -134
- package/dist/chunk-NKB7BZYK.js +0 -167
- package/dist/chunk-OETCUXQP.js +0 -134
- package/dist/chunk-OPXFZ4Y5.js +0 -204
- package/dist/chunk-Q72LJOVE.js +0 -169
- package/dist/chunk-RNGLIHFA.js +0 -191
- package/dist/chunk-RQ3HASCC.js +0 -6
- package/dist/chunk-RSOJT5YW.js +0 -124
- package/dist/chunk-TKVFVF5D.js +0 -95
- package/dist/chunk-XOSCY2CW.js +0 -242
- package/dist/header/index.js +0 -5
- package/dist/search-bar/index.js +0 -5
- /package/dist/{chunk-3ECPOSKO.js → chunk-3UG6JUCV.js} +0 -0
- /package/dist/{chunk-JRLTGLN4.js → chunk-5WWRTEPS.js} +0 -0
- /package/dist/{chunk-RTIKSY6A.js → chunk-5Z5ZYMOJ.js} +0 -0
package/dist/chunk-GDKZTW34.js
DELETED
|
@@ -1,395 +0,0 @@
|
|
|
1
|
-
import { SummaryItemRow, PriceRow, Amount, FxNote } from './chunk-VBOXAEPI.js';
|
|
2
|
-
import { Sheet } from './chunk-ZVFE5QGU.js';
|
|
3
|
-
import { Input } from './chunk-ITTYJZWX.js';
|
|
4
|
-
import { expandedProps } from './chunk-RQ3HASCC.js';
|
|
5
|
-
import { Button } from './chunk-3ARE4TES.js';
|
|
6
|
-
import { Icon } from './chunk-TKVFVF5D.js';
|
|
7
|
-
import * as React3 from 'react';
|
|
8
|
-
import { Text, View, Pressable } from 'react-native';
|
|
9
|
-
import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
|
|
10
|
-
import { SHEET_DISMISS_FRACTION } from '@btndprojects/loam-pay';
|
|
11
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
12
|
-
import { icons } from '@btndprojects/loam-icons';
|
|
13
|
-
|
|
14
|
-
function CheckoutSheet({
|
|
15
|
-
open,
|
|
16
|
-
title,
|
|
17
|
-
titleLevel,
|
|
18
|
-
description,
|
|
19
|
-
children,
|
|
20
|
-
commit,
|
|
21
|
-
trust,
|
|
22
|
-
dismissible = true,
|
|
23
|
-
safeAreaBottom = 0,
|
|
24
|
-
closeLabel = "Close",
|
|
25
|
-
style,
|
|
26
|
-
onDismiss
|
|
27
|
-
}) {
|
|
28
|
-
const theme = useLoamTheme();
|
|
29
|
-
const { styles } = useStyles(sheet);
|
|
30
|
-
return /* @__PURE__ */ jsxs(
|
|
31
|
-
Sheet,
|
|
32
|
-
{
|
|
33
|
-
open,
|
|
34
|
-
title,
|
|
35
|
-
titleLevel,
|
|
36
|
-
dismissible,
|
|
37
|
-
closeLabel,
|
|
38
|
-
dismissFraction: SHEET_DISMISS_FRACTION,
|
|
39
|
-
onClose: onDismiss,
|
|
40
|
-
footer: (
|
|
41
|
-
/* The commit bar, outside the scroller. `safeAreaBottom` is padding on
|
|
42
|
-
the bar rather than a margin under it — or `Sheet.safeAreaBottom`, a
|
|
43
|
-
slot padding that would push this bar's own fill up off the screen
|
|
44
|
-
edge — so the surface still reaches the home indicator. */
|
|
45
|
-
/* @__PURE__ */ jsxs(View, { style: [styles.commitBar, { paddingBottom: theme.space.s4 + safeAreaBottom }], children: [
|
|
46
|
-
commit,
|
|
47
|
-
trust
|
|
48
|
-
] })
|
|
49
|
-
),
|
|
50
|
-
children: [
|
|
51
|
-
description ? /* @__PURE__ */ jsx(Text, { style: styles.description, children: description }) : null,
|
|
52
|
-
/* @__PURE__ */ jsx(View, { style: [styles.body, style], children })
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
var sheet = createStyleSheet((theme) => ({
|
|
58
|
-
description: {
|
|
59
|
-
fontFamily: theme.font.sans,
|
|
60
|
-
fontSize: theme.type.footnote.fontSize,
|
|
61
|
-
lineHeight: theme.type.footnote.fontSize * theme.lineHeight.normal,
|
|
62
|
-
color: theme.color.text2
|
|
63
|
-
},
|
|
64
|
-
body: { gap: theme.space.s4 },
|
|
65
|
-
// The bar reads as a bar rather than as another block in the form: its own
|
|
66
|
-
// fill, a hairline above it, and the safe-area inset folded into its bottom
|
|
67
|
-
// padding at the use site. The horizontal padding is the bar's own now that it
|
|
68
|
-
// lives in `Sheet`'s footer slot, which is deliberately full-bleed — so the
|
|
69
|
-
// hairline spans the panel while the button keeps the body's gutter.
|
|
70
|
-
commitBar: {
|
|
71
|
-
gap: theme.space.s3,
|
|
72
|
-
paddingTop: theme.space.s4,
|
|
73
|
-
paddingHorizontal: theme.space[22],
|
|
74
|
-
borderTopWidth: theme.borderWidth.base,
|
|
75
|
-
borderTopColor: theme.color.border,
|
|
76
|
-
backgroundColor: theme.color.surface
|
|
77
|
-
}
|
|
78
|
-
}));
|
|
79
|
-
function PayButton({
|
|
80
|
-
label,
|
|
81
|
-
state,
|
|
82
|
-
busyLabel = "Paying\u2026",
|
|
83
|
-
validatingLabel = "Checking\u2026",
|
|
84
|
-
doneLabel = "Paid",
|
|
85
|
-
showLock = true,
|
|
86
|
-
fullWidth = true,
|
|
87
|
-
size = "lg",
|
|
88
|
-
accessibilityLabel,
|
|
89
|
-
style,
|
|
90
|
-
onPress
|
|
91
|
-
}) {
|
|
92
|
-
const theme = useLoamTheme();
|
|
93
|
-
const { styles } = useStyles(sheet2);
|
|
94
|
-
const [idleWidth, setIdleWidth] = React3.useState(null);
|
|
95
|
-
const resting = state === "idle";
|
|
96
|
-
const busy = state === "validating" || state === "busy";
|
|
97
|
-
const onLayout = (event) => {
|
|
98
|
-
if (!resting || fullWidth) return;
|
|
99
|
-
const next = event.nativeEvent.layout.width;
|
|
100
|
-
if (next <= 0) return;
|
|
101
|
-
setIdleWidth((prev) => prev !== null && Math.abs(prev - next) < 1 ? prev : next);
|
|
102
|
-
};
|
|
103
|
-
const currentLabel = resting ? label : state === "validating" ? validatingLabel : state === "busy" ? busyLabel : doneLabel;
|
|
104
|
-
const leadingIcon = resting && showLock ? "lock" : state === "done" ? "check" : void 0;
|
|
105
|
-
return /* @__PURE__ */ jsx(
|
|
106
|
-
View,
|
|
107
|
-
{
|
|
108
|
-
onLayout,
|
|
109
|
-
style: [
|
|
110
|
-
fullWidth ? styles.wrapFull : styles.wrapAuto,
|
|
111
|
-
// The frozen width, and only while the label is not the resting one.
|
|
112
|
-
!resting && !fullWidth && idleWidth !== null ? { minWidth: idleWidth } : null,
|
|
113
|
-
style
|
|
114
|
-
],
|
|
115
|
-
children: /* @__PURE__ */ jsx(
|
|
116
|
-
Button,
|
|
117
|
-
{
|
|
118
|
-
size,
|
|
119
|
-
fullWidth: true,
|
|
120
|
-
loading: busy,
|
|
121
|
-
leadingIcon,
|
|
122
|
-
accessibilityLabel,
|
|
123
|
-
onPress: () => {
|
|
124
|
-
if (!resting) return;
|
|
125
|
-
onPress();
|
|
126
|
-
},
|
|
127
|
-
children: typeof currentLabel === "string" ? currentLabel : /* @__PURE__ */ jsx(View, { style: styles.labelRow, children: typeof currentLabel === "number" ? /* @__PURE__ */ jsx(Text, { style: [styles.label, { color: theme.color.accentInk }], children: currentLabel }) : currentLabel })
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
var sheet2 = createStyleSheet((theme) => ({
|
|
134
|
-
wrapFull: { alignSelf: "stretch" },
|
|
135
|
-
wrapAuto: { alignSelf: "flex-start" },
|
|
136
|
-
labelRow: {
|
|
137
|
-
flexDirection: "row",
|
|
138
|
-
alignItems: "center",
|
|
139
|
-
justifyContent: "center",
|
|
140
|
-
gap: theme.ctl.gap.lg
|
|
141
|
-
},
|
|
142
|
-
label: {
|
|
143
|
-
fontFamily: theme.font.sans,
|
|
144
|
-
fontWeight: theme.fontWeight.bold,
|
|
145
|
-
fontSize: theme.type.body.fontSize,
|
|
146
|
-
lineHeight: theme.type.body.lineHeight,
|
|
147
|
-
letterSpacing: theme.type.body.letterSpacing
|
|
148
|
-
}
|
|
149
|
-
}));
|
|
150
|
-
function summaryIcon(name) {
|
|
151
|
-
if (name === void 0) return void 0;
|
|
152
|
-
return Object.prototype.hasOwnProperty.call(icons, name) ? name : void 0;
|
|
153
|
-
}
|
|
154
|
-
function OrderSummary({
|
|
155
|
-
variant,
|
|
156
|
-
items,
|
|
157
|
-
rows,
|
|
158
|
-
total,
|
|
159
|
-
currency,
|
|
160
|
-
title = "Order summary",
|
|
161
|
-
totalLabel = "Total",
|
|
162
|
-
coupon,
|
|
163
|
-
fxNote,
|
|
164
|
-
locale,
|
|
165
|
-
style,
|
|
166
|
-
onCouponDraftChange,
|
|
167
|
-
onApplyCoupon,
|
|
168
|
-
onRemoveCoupon
|
|
169
|
-
}) {
|
|
170
|
-
const theme = useLoamTheme();
|
|
171
|
-
const { styles } = useStyles(sheet3);
|
|
172
|
-
const couponLabelId = React3.useId();
|
|
173
|
-
const couponErrorId = React3.useId();
|
|
174
|
-
const heading = `${title} \xB7 ${currency}`;
|
|
175
|
-
const showItems = variant === "itemised" && items !== void 0 && items.length > 0;
|
|
176
|
-
return /* @__PURE__ */ jsxs(
|
|
177
|
-
View,
|
|
178
|
-
{
|
|
179
|
-
role: "region",
|
|
180
|
-
accessibilityLabel: heading,
|
|
181
|
-
style: [styles.section, style],
|
|
182
|
-
children: [
|
|
183
|
-
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: styles.overline, children: heading }),
|
|
184
|
-
showItems ? /* @__PURE__ */ jsx(View, { role: "list", accessibilityRole: "list", style: styles.itemList, children: items.map((item) => /* @__PURE__ */ jsx(View, { role: "listitem", children: /* @__PURE__ */ jsx(
|
|
185
|
-
SummaryItemRow,
|
|
186
|
-
{
|
|
187
|
-
name: item.name,
|
|
188
|
-
detail: item.detail,
|
|
189
|
-
qty: item.qty,
|
|
190
|
-
minor: item.qty * item.unit,
|
|
191
|
-
currency,
|
|
192
|
-
icon: summaryIcon(item.icon),
|
|
193
|
-
locale,
|
|
194
|
-
noSymbol: true
|
|
195
|
-
}
|
|
196
|
-
) }, `${item.name}-${item.unit}`)) }) : null,
|
|
197
|
-
rows.length > 0 ? /* @__PURE__ */ jsx(View, { style: [styles.rowStack, showItems ? styles.rowStackRuled : null], children: rows.map((row, index) => /* @__PURE__ */ jsx(
|
|
198
|
-
PriceRow,
|
|
199
|
-
{
|
|
200
|
-
label: row.label,
|
|
201
|
-
minor: row.minor,
|
|
202
|
-
currency,
|
|
203
|
-
tone: row.tone,
|
|
204
|
-
strong: row.strong,
|
|
205
|
-
rule: row.rule,
|
|
206
|
-
locale,
|
|
207
|
-
noSymbol: true
|
|
208
|
-
},
|
|
209
|
-
`${index}-${String(row.label)}`
|
|
210
|
-
)) }) : null,
|
|
211
|
-
coupon ? /* @__PURE__ */ jsx(View, { style: styles.couponBlock, children: coupon.applied ? /* @__PURE__ */ jsxs(View, { style: styles.appliedRow, children: [
|
|
212
|
-
/* @__PURE__ */ jsx(Icon, { name: "tag", size: theme.icon.sm, color: theme.color.goodOnSoft }),
|
|
213
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles.appliedCode, children: coupon.applied }),
|
|
214
|
-
onRemoveCoupon ? /* @__PURE__ */ jsx(View, { style: styles.pushEnd, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "xs", onPress: onRemoveCoupon, children: "Remove" }) }) : null
|
|
215
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
216
|
-
/* @__PURE__ */ jsx(Text, { nativeID: couponLabelId, style: styles.fieldLabel, children: coupon.label ?? "Discount code" }),
|
|
217
|
-
/* @__PURE__ */ jsxs(View, { style: styles.couponRow, children: [
|
|
218
|
-
/* @__PURE__ */ jsx(View, { style: styles.couponField, children: /* @__PURE__ */ jsx(
|
|
219
|
-
Input,
|
|
220
|
-
{
|
|
221
|
-
"aria-labelledby": couponLabelId,
|
|
222
|
-
"aria-describedby": coupon.error ? couponErrorId : void 0,
|
|
223
|
-
"aria-invalid": coupon.error !== void 0 || void 0,
|
|
224
|
-
value: coupon.draft,
|
|
225
|
-
placeholder: coupon.placeholder,
|
|
226
|
-
autoComplete: "off",
|
|
227
|
-
autoCorrect: false,
|
|
228
|
-
loading: coupon.busy ?? false,
|
|
229
|
-
error: coupon.error !== void 0,
|
|
230
|
-
onChangeText: (next) => onCouponDraftChange?.(next)
|
|
231
|
-
}
|
|
232
|
-
) }),
|
|
233
|
-
/* @__PURE__ */ jsx(
|
|
234
|
-
Button,
|
|
235
|
-
{
|
|
236
|
-
variant: "outline",
|
|
237
|
-
loading: coupon.busy ?? false,
|
|
238
|
-
onPress: () => onApplyCoupon?.(coupon.draft),
|
|
239
|
-
children: "Apply"
|
|
240
|
-
}
|
|
241
|
-
)
|
|
242
|
-
] }),
|
|
243
|
-
coupon.error ? /* @__PURE__ */ jsx(Text, { nativeID: couponErrorId, style: styles.fieldError, children: coupon.error }) : null
|
|
244
|
-
] }) }) : null,
|
|
245
|
-
/* @__PURE__ */ jsxs(View, { style: styles.totalRow, children: [
|
|
246
|
-
/* @__PURE__ */ jsx(Text, { style: styles.totalLabel, children: totalLabel }),
|
|
247
|
-
/* @__PURE__ */ jsx(Amount, { minor: total, currency, size: "hero", locale })
|
|
248
|
-
] }),
|
|
249
|
-
fxNote ? /* @__PURE__ */ jsx(FxNote, { currency: fxNote.currency, rateLine: fxNote.rateLine }) : null
|
|
250
|
-
]
|
|
251
|
-
}
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
function CollapsedSummaryBar({
|
|
255
|
-
total,
|
|
256
|
-
currency,
|
|
257
|
-
open,
|
|
258
|
-
children,
|
|
259
|
-
label = "Order summary",
|
|
260
|
-
locale,
|
|
261
|
-
style,
|
|
262
|
-
onToggle
|
|
263
|
-
}) {
|
|
264
|
-
const theme = useLoamTheme();
|
|
265
|
-
const { styles } = useStyles(sheet3);
|
|
266
|
-
const panelId = React3.useId();
|
|
267
|
-
return /* @__PURE__ */ jsxs(View, { style: [styles.bar, style], children: [
|
|
268
|
-
/* @__PURE__ */ jsxs(
|
|
269
|
-
Pressable,
|
|
270
|
-
{
|
|
271
|
-
accessibilityRole: "button",
|
|
272
|
-
accessibilityState: { expanded: open },
|
|
273
|
-
...expandedProps(open),
|
|
274
|
-
"aria-controls": panelId,
|
|
275
|
-
onPress: () => onToggle(!open),
|
|
276
|
-
style: ({ pressed }) => [styles.trigger, pressed ? styles.triggerPressed : null],
|
|
277
|
-
children: [
|
|
278
|
-
/* @__PURE__ */ jsx(
|
|
279
|
-
Icon,
|
|
280
|
-
{
|
|
281
|
-
name: open ? "chevron-up" : "chevron-down",
|
|
282
|
-
size: theme.icon.sm,
|
|
283
|
-
color: theme.color.text3
|
|
284
|
-
}
|
|
285
|
-
),
|
|
286
|
-
/* @__PURE__ */ jsx(Text, { style: styles.triggerLabel, children: label }),
|
|
287
|
-
/* @__PURE__ */ jsx(View, { style: styles.pushEnd, children: /* @__PURE__ */ jsx(Amount, { minor: total, currency, size: "md", weight: "bold", locale }) })
|
|
288
|
-
]
|
|
289
|
-
}
|
|
290
|
-
),
|
|
291
|
-
open ? /* @__PURE__ */ jsx(View, { nativeID: panelId, style: styles.panel, children }) : null
|
|
292
|
-
] });
|
|
293
|
-
}
|
|
294
|
-
var sheet3 = createStyleSheet((theme) => ({
|
|
295
|
-
section: { gap: theme.space.s3 },
|
|
296
|
-
overline: {
|
|
297
|
-
fontFamily: theme.font.sans,
|
|
298
|
-
fontWeight: theme.fontWeight.bold,
|
|
299
|
-
fontSize: theme.type.caption2.fontSize,
|
|
300
|
-
lineHeight: theme.type.caption2.lineHeight,
|
|
301
|
-
letterSpacing: theme.tracking.caps,
|
|
302
|
-
textTransform: "uppercase",
|
|
303
|
-
color: theme.color.text3
|
|
304
|
-
},
|
|
305
|
-
itemList: { gap: theme.space.s3 },
|
|
306
|
-
rowStack: { gap: theme.space.s2 },
|
|
307
|
-
rowStackRuled: {
|
|
308
|
-
paddingTop: theme.space.s3,
|
|
309
|
-
borderTopWidth: theme.borderWidth.base,
|
|
310
|
-
borderTopColor: theme.color.border
|
|
311
|
-
},
|
|
312
|
-
couponBlock: { gap: theme.space.s1 },
|
|
313
|
-
appliedRow: {
|
|
314
|
-
flexDirection: "row",
|
|
315
|
-
alignItems: "center",
|
|
316
|
-
gap: theme.space.s2,
|
|
317
|
-
padding: theme.space.s2,
|
|
318
|
-
borderRadius: theme.radius.md,
|
|
319
|
-
// The soft tint always carries its tone edge: `goodSoft` collapses to the
|
|
320
|
-
// plain surface under high contrast, and the edge is the only thing left
|
|
321
|
-
// drawing the block.
|
|
322
|
-
borderWidth: theme.borderWidth.base,
|
|
323
|
-
borderColor: theme.edge.good,
|
|
324
|
-
backgroundColor: theme.color.goodSoft
|
|
325
|
-
},
|
|
326
|
-
appliedCode: {
|
|
327
|
-
flexShrink: 1,
|
|
328
|
-
fontFamily: theme.font.sans,
|
|
329
|
-
fontWeight: theme.fontWeight.semibold,
|
|
330
|
-
fontSize: theme.type.footnote.fontSize,
|
|
331
|
-
lineHeight: theme.type.footnote.lineHeight,
|
|
332
|
-
color: theme.color.goodOnSoft
|
|
333
|
-
},
|
|
334
|
-
pushEnd: { marginStart: "auto" },
|
|
335
|
-
fieldLabel: {
|
|
336
|
-
fontFamily: theme.font.sans,
|
|
337
|
-
fontWeight: theme.fontWeight.semibold,
|
|
338
|
-
fontSize: theme.type.caption1.fontSize,
|
|
339
|
-
lineHeight: theme.type.caption1.lineHeight,
|
|
340
|
-
color: theme.color.text2
|
|
341
|
-
},
|
|
342
|
-
couponRow: { flexDirection: "row", alignItems: "flex-start", gap: theme.space.s2 },
|
|
343
|
-
couponField: { flex: 1 },
|
|
344
|
-
fieldError: {
|
|
345
|
-
fontFamily: theme.font.sans,
|
|
346
|
-
fontWeight: theme.fontWeight.bold,
|
|
347
|
-
fontSize: theme.type.caption1.fontSize,
|
|
348
|
-
lineHeight: theme.type.caption1.lineHeight,
|
|
349
|
-
color: theme.color.danger
|
|
350
|
-
},
|
|
351
|
-
totalRow: {
|
|
352
|
-
flexDirection: "row",
|
|
353
|
-
alignItems: "baseline",
|
|
354
|
-
justifyContent: "space-between",
|
|
355
|
-
gap: theme.space.s4,
|
|
356
|
-
paddingTop: theme.space.s3,
|
|
357
|
-
borderTopWidth: theme.borderWidth.base,
|
|
358
|
-
borderTopColor: theme.color.border
|
|
359
|
-
},
|
|
360
|
-
totalLabel: {
|
|
361
|
-
fontFamily: theme.font.sans,
|
|
362
|
-
fontWeight: theme.fontWeight.bold,
|
|
363
|
-
fontSize: theme.type.footnote.fontSize,
|
|
364
|
-
lineHeight: theme.type.footnote.lineHeight,
|
|
365
|
-
color: theme.color.text
|
|
366
|
-
},
|
|
367
|
-
bar: {
|
|
368
|
-
borderRadius: theme.radius.md,
|
|
369
|
-
borderWidth: theme.borderWidth.base,
|
|
370
|
-
borderColor: theme.color.border,
|
|
371
|
-
backgroundColor: theme.color.surface
|
|
372
|
-
},
|
|
373
|
-
trigger: {
|
|
374
|
-
flexDirection: "row",
|
|
375
|
-
alignItems: "center",
|
|
376
|
-
gap: theme.space.s3,
|
|
377
|
-
minHeight: theme.ctl.lg,
|
|
378
|
-
padding: theme.space.s3
|
|
379
|
-
},
|
|
380
|
-
triggerPressed: { backgroundColor: theme.state.pressed },
|
|
381
|
-
triggerLabel: {
|
|
382
|
-
fontFamily: theme.font.sans,
|
|
383
|
-
fontWeight: theme.fontWeight.semibold,
|
|
384
|
-
fontSize: theme.type.footnote.fontSize,
|
|
385
|
-
lineHeight: theme.type.footnote.lineHeight,
|
|
386
|
-
color: theme.color.text
|
|
387
|
-
},
|
|
388
|
-
panel: {
|
|
389
|
-
padding: theme.space.s3,
|
|
390
|
-
borderTopWidth: theme.borderWidth.base,
|
|
391
|
-
borderTopColor: theme.color.border
|
|
392
|
-
}
|
|
393
|
-
}));
|
|
394
|
-
|
|
395
|
-
export { CheckoutSheet, CollapsedSummaryBar, OrderSummary, PayButton, summaryIcon };
|
package/dist/chunk-GL7B2DOW.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { Icon } from './chunk-TKVFVF5D.js';
|
|
2
|
-
import 'react';
|
|
3
|
-
import { Pressable, Text, View } from 'react-native';
|
|
4
|
-
import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
5
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function statusMeta(status, queued) {
|
|
8
|
-
const changes = `${queued} change${queued === 1 ? "" : "s"}`;
|
|
9
|
-
switch (status) {
|
|
10
|
-
case "offline":
|
|
11
|
-
return { icon: "wifi-off", label: `Offline \xB7 ${changes} queued` };
|
|
12
|
-
case "syncing":
|
|
13
|
-
return { icon: "refresh", label: "Back online \xB7 syncing" };
|
|
14
|
-
default:
|
|
15
|
-
return { icon: "check-circle", label: "All changes synced" };
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
function ConnectivityBanner({
|
|
19
|
-
status,
|
|
20
|
-
queuedCount = 0,
|
|
21
|
-
onRetry,
|
|
22
|
-
message
|
|
23
|
-
}) {
|
|
24
|
-
const { styles } = useStyles(sheet, { status });
|
|
25
|
-
const theme = useLoamTheme();
|
|
26
|
-
const meta = statusMeta(status, queuedCount);
|
|
27
|
-
const fg = status === "offline" ? (
|
|
28
|
-
// The offline banner rests on `surface3`, where neutral `text2` measures
|
|
29
|
-
// only 4.4:1 (WCAG fail); primary `text` clears 4.5:1.
|
|
30
|
-
theme.color.text
|
|
31
|
-
) : status === "syncing" ? theme.color.warnOnSoft : theme.color.goodOnSoft;
|
|
32
|
-
return /* @__PURE__ */ jsxs(
|
|
33
|
-
Pressable,
|
|
34
|
-
{
|
|
35
|
-
accessibilityRole: onRetry ? "button" : "text",
|
|
36
|
-
accessibilityLabel: message ?? meta.label,
|
|
37
|
-
accessibilityState: onRetry ? {} : { disabled: true },
|
|
38
|
-
onPress: onRetry,
|
|
39
|
-
style: ({ pressed }) => [styles.banner, pressed && onRetry ? styles.pressed : null],
|
|
40
|
-
children: [
|
|
41
|
-
/* @__PURE__ */ jsx(Icon, { name: meta.icon, size: 15, color: fg }),
|
|
42
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.label, { color: fg }], numberOfLines: 1, ellipsizeMode: "tail", children: message ?? meta.label }),
|
|
43
|
-
status === "offline" && onRetry ? /* @__PURE__ */ jsx(Text, { style: styles.retry, children: "RETRY" }) : null
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
var SYNC_META = {
|
|
49
|
-
queued: { icon: "refresh", label: "Queued \u2014 waiting for a connection" },
|
|
50
|
-
syncing: { icon: "refresh", label: "Syncing" },
|
|
51
|
-
synced: { icon: "check", label: "Synced" },
|
|
52
|
-
failed: { icon: "alert-circle", label: "Failed to sync" }
|
|
53
|
-
};
|
|
54
|
-
function SyncBadge({
|
|
55
|
-
state,
|
|
56
|
-
accessibilityLabel,
|
|
57
|
-
size = 26
|
|
58
|
-
}) {
|
|
59
|
-
const { styles } = useStyles(sheet, { state });
|
|
60
|
-
const theme = useLoamTheme();
|
|
61
|
-
const meta = SYNC_META[state];
|
|
62
|
-
const fg = state === "synced" ? theme.color.goodOnSoft : state === "failed" ? theme.color.dangerOnSoft : theme.color.warnOnSoft;
|
|
63
|
-
return /* @__PURE__ */ jsx(
|
|
64
|
-
View,
|
|
65
|
-
{
|
|
66
|
-
accessibilityRole: "image",
|
|
67
|
-
accessibilityLabel: accessibilityLabel ?? meta.label,
|
|
68
|
-
style: [styles.badge, { width: size, height: size }],
|
|
69
|
-
children: /* @__PURE__ */ jsx(Icon, { name: meta.icon, size: Math.round(size * 0.54), color: fg })
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
var sheet = createStyleSheet((theme) => ({
|
|
74
|
-
banner: {
|
|
75
|
-
flexDirection: "row",
|
|
76
|
-
alignItems: "center",
|
|
77
|
-
gap: theme.space[9],
|
|
78
|
-
paddingVertical: theme.space[10],
|
|
79
|
-
paddingHorizontal: theme.space.s4,
|
|
80
|
-
borderBottomWidth: theme.borderWidth.base,
|
|
81
|
-
variants: {
|
|
82
|
-
status: {
|
|
83
|
-
offline: {
|
|
84
|
-
backgroundColor: theme.color.surface3,
|
|
85
|
-
borderBottomColor: theme.color.border
|
|
86
|
-
},
|
|
87
|
-
syncing: {
|
|
88
|
-
backgroundColor: theme.color.warnSoft,
|
|
89
|
-
borderBottomColor: theme.edge.warn
|
|
90
|
-
},
|
|
91
|
-
online: {
|
|
92
|
-
backgroundColor: theme.color.goodSoft,
|
|
93
|
-
borderBottomColor: theme.edge.good
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
state: {}
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
// `minWidth: 0` lets the copy truncate rather than push `RETRY` off the edge.
|
|
100
|
-
label: {
|
|
101
|
-
flex: 1,
|
|
102
|
-
minWidth: 0,
|
|
103
|
-
fontFamily: theme.font.sans,
|
|
104
|
-
fontWeight: theme.fontWeight.semibold,
|
|
105
|
-
fontSize: theme.type.caption1.fontSize,
|
|
106
|
-
variants: { status: {}, state: {} }
|
|
107
|
-
},
|
|
108
|
-
retry: {
|
|
109
|
-
fontFamily: theme.font.mono,
|
|
110
|
-
fontSize: theme.fontSize[10],
|
|
111
|
-
// Shown only on the offline banner's `surface3` fill, where `text3` is
|
|
112
|
-
// 4.16:1 (WCAG fail); primary `text` clears 4.5:1.
|
|
113
|
-
color: theme.color.text,
|
|
114
|
-
variants: { status: {}, state: {} }
|
|
115
|
-
},
|
|
116
|
-
badge: {
|
|
117
|
-
alignItems: "center",
|
|
118
|
-
justifyContent: "center",
|
|
119
|
-
borderRadius: theme.radius.full,
|
|
120
|
-
borderWidth: theme.borderWidth.base,
|
|
121
|
-
variants: {
|
|
122
|
-
state: {
|
|
123
|
-
queued: { backgroundColor: theme.color.warnSoft, borderColor: theme.edge.warn },
|
|
124
|
-
syncing: { backgroundColor: theme.color.warnSoft, borderColor: theme.edge.warn },
|
|
125
|
-
synced: { backgroundColor: theme.color.goodSoft, borderColor: theme.edge.good },
|
|
126
|
-
failed: { backgroundColor: theme.color.dangerSoft, borderColor: theme.edge.danger }
|
|
127
|
-
},
|
|
128
|
-
status: {}
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
pressed: { opacity: theme.state.pressedOpacity }
|
|
132
|
-
}));
|
|
133
|
-
|
|
134
|
-
export { ConnectivityBanner, SyncBadge };
|
package/dist/chunk-NKB7BZYK.js
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { Sheet } from './chunk-ZVFE5QGU.js';
|
|
2
|
-
import { expandedProps } from './chunk-RQ3HASCC.js';
|
|
3
|
-
import { haptics } from './chunk-NY2U3PBI.js';
|
|
4
|
-
import { Icon } from './chunk-TKVFVF5D.js';
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import { Pressable, Text } from 'react-native';
|
|
7
|
-
import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
|
|
8
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
9
|
-
|
|
10
|
-
function Picker({
|
|
11
|
-
items,
|
|
12
|
-
value,
|
|
13
|
-
onValueChange,
|
|
14
|
-
placeholder = "Select\u2026",
|
|
15
|
-
title,
|
|
16
|
-
disabled = false,
|
|
17
|
-
size = "md",
|
|
18
|
-
accessibilityLabel
|
|
19
|
-
}) {
|
|
20
|
-
const [open, setOpen] = React.useState(false);
|
|
21
|
-
const theme = useLoamTheme();
|
|
22
|
-
const selected = items.find((item) => item.value === value);
|
|
23
|
-
const isPlaceholder = selected == null;
|
|
24
|
-
const displayText = selected?.label ?? placeholder;
|
|
25
|
-
const { styles } = useStyles(sheet, { size, disabled, placeholder: isPlaceholder });
|
|
26
|
-
const iconSize = theme.ctl.icon[size];
|
|
27
|
-
const slopY = Math.max(0, (theme.hit[size] - theme.ctl[size]) / 2);
|
|
28
|
-
const handleSelect = (next) => {
|
|
29
|
-
haptics.impact("light");
|
|
30
|
-
onValueChange?.(next);
|
|
31
|
-
setOpen(false);
|
|
32
|
-
};
|
|
33
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
-
/* @__PURE__ */ jsxs(
|
|
35
|
-
Pressable,
|
|
36
|
-
{
|
|
37
|
-
accessibilityRole: "button",
|
|
38
|
-
accessibilityLabel: accessibilityLabel ?? displayText,
|
|
39
|
-
accessibilityState: { disabled, expanded: open },
|
|
40
|
-
...expandedProps(open),
|
|
41
|
-
disabled,
|
|
42
|
-
onPress: disabled ? void 0 : () => setOpen(true),
|
|
43
|
-
hitSlop: { top: slopY, bottom: slopY },
|
|
44
|
-
style: styles.trigger,
|
|
45
|
-
children: [
|
|
46
|
-
/* @__PURE__ */ jsx(Text, { style: styles.value, numberOfLines: 1, children: displayText }),
|
|
47
|
-
/* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: iconSize, color: theme.color.text3 })
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
),
|
|
51
|
-
/* @__PURE__ */ jsx(Sheet, { open, onClose: () => setOpen(false), title, children: items.map((item) => {
|
|
52
|
-
const isSelected = item.value === value;
|
|
53
|
-
return /* @__PURE__ */ jsxs(
|
|
54
|
-
Pressable,
|
|
55
|
-
{
|
|
56
|
-
accessibilityRole: "button",
|
|
57
|
-
accessibilityLabel: item.label,
|
|
58
|
-
accessibilityState: { selected: isSelected },
|
|
59
|
-
onPress: () => handleSelect(item.value),
|
|
60
|
-
style: ({ pressed }) => [
|
|
61
|
-
styles.option,
|
|
62
|
-
isSelected ? styles.optionSelected : null,
|
|
63
|
-
pressed ? styles.optionPressed : null
|
|
64
|
-
],
|
|
65
|
-
children: [
|
|
66
|
-
/* @__PURE__ */ jsx(Text, { style: [styles.optionLabel, isSelected ? styles.optionLabelSelected : null], children: item.label }),
|
|
67
|
-
isSelected ? /* @__PURE__ */ jsx(Icon, { name: "check", size: theme.icon.md, color: theme.color.accentOnSoft }) : null
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
item.value
|
|
71
|
-
);
|
|
72
|
-
}) })
|
|
73
|
-
] });
|
|
74
|
-
}
|
|
75
|
-
var sheet = createStyleSheet((theme) => ({
|
|
76
|
-
trigger: {
|
|
77
|
-
flexDirection: "row",
|
|
78
|
-
alignItems: "center",
|
|
79
|
-
backgroundColor: theme.color.surface2,
|
|
80
|
-
// The reference draws a `1.5px` field edge — the static `w2` weight.
|
|
81
|
-
borderWidth: theme.borderWidth.thick,
|
|
82
|
-
borderColor: theme.color.borderStrong,
|
|
83
|
-
variants: {
|
|
84
|
-
// Height, padding, gap and corner radius all resolve from one control-size
|
|
85
|
-
// tier (26 / 30 / 36 / 44), matching {@link Input}.
|
|
86
|
-
size: {
|
|
87
|
-
xs: {
|
|
88
|
-
height: theme.ctl.xs,
|
|
89
|
-
paddingHorizontal: theme.ctl.px.xs,
|
|
90
|
-
gap: theme.ctl.gap.xs,
|
|
91
|
-
borderRadius: theme.ctl.r.xs
|
|
92
|
-
},
|
|
93
|
-
sm: {
|
|
94
|
-
height: theme.ctl.sm,
|
|
95
|
-
paddingHorizontal: theme.ctl.px.sm,
|
|
96
|
-
gap: theme.ctl.gap.sm,
|
|
97
|
-
borderRadius: theme.ctl.r.sm
|
|
98
|
-
},
|
|
99
|
-
md: {
|
|
100
|
-
height: theme.ctl.md,
|
|
101
|
-
paddingHorizontal: theme.ctl.px.md,
|
|
102
|
-
gap: theme.ctl.gap.md,
|
|
103
|
-
borderRadius: theme.ctl.r.md
|
|
104
|
-
},
|
|
105
|
-
lg: {
|
|
106
|
-
height: theme.ctl.lg,
|
|
107
|
-
paddingHorizontal: theme.ctl.px.lg,
|
|
108
|
-
gap: theme.ctl.gap.lg,
|
|
109
|
-
borderRadius: theme.ctl.r.lg
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
disabled: {
|
|
113
|
-
true: { opacity: theme.state.disabledOpacity },
|
|
114
|
-
false: {}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
value: {
|
|
119
|
-
flex: 1,
|
|
120
|
-
fontFamily: theme.font.sans,
|
|
121
|
-
variants: {
|
|
122
|
-
size: {
|
|
123
|
-
xs: { fontSize: theme.fontSize[14] },
|
|
124
|
-
sm: { fontSize: theme.fontSize[14] },
|
|
125
|
-
md: { fontSize: theme.fontSize[16] },
|
|
126
|
-
lg: { fontSize: theme.fontSize[16] }
|
|
127
|
-
},
|
|
128
|
-
placeholder: {
|
|
129
|
-
true: { color: theme.color.text3 },
|
|
130
|
-
false: { color: theme.color.text }
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
option: {
|
|
135
|
-
flexDirection: "row",
|
|
136
|
-
alignItems: "center",
|
|
137
|
-
gap: theme.space.s3,
|
|
138
|
-
minHeight: theme.space[48],
|
|
139
|
-
paddingHorizontal: theme.space.s3,
|
|
140
|
-
paddingVertical: theme.space.s2,
|
|
141
|
-
borderRadius: theme.radius.md,
|
|
142
|
-
// Every row carries the edge weight so selecting one does not shift the text.
|
|
143
|
-
borderWidth: theme.borderWidth.base,
|
|
144
|
-
borderColor: "transparent"
|
|
145
|
-
},
|
|
146
|
-
// The reference's selection band: an `accentSoft` `radius.md` plate behind the
|
|
147
|
-
// centred option. `-soft` tints collapse at high contrast, so it carries the
|
|
148
|
-
// matching tone edge.
|
|
149
|
-
optionSelected: {
|
|
150
|
-
backgroundColor: theme.color.accentSoft,
|
|
151
|
-
borderWidth: theme.borderWidth.base,
|
|
152
|
-
borderColor: theme.edge.accent
|
|
153
|
-
},
|
|
154
|
-
optionPressed: { backgroundColor: theme.color.surface2 },
|
|
155
|
-
optionLabel: {
|
|
156
|
-
flex: 1,
|
|
157
|
-
fontFamily: theme.font.sans,
|
|
158
|
-
fontSize: theme.fontSize[16],
|
|
159
|
-
color: theme.color.text2
|
|
160
|
-
},
|
|
161
|
-
optionLabelSelected: {
|
|
162
|
-
fontWeight: theme.fontWeight.semibold,
|
|
163
|
-
color: theme.color.accentOnSoft
|
|
164
|
-
}
|
|
165
|
-
}));
|
|
166
|
-
|
|
167
|
-
export { Picker };
|