@btndprojects/loam-ui-native 0.1.0 → 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/README.md +56 -0
- 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-RGQWWKLA.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-FOKG57CR.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-WVKKJA6U.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-66SG2H23.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-FIF2M24N.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-DSJBXLUG.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
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { NAMED_ROLE } from './chunk-W23G6JLF.js';
|
|
2
|
+
import { useLabels } from './chunk-APCWFOZW.js';
|
|
3
|
+
import { Icon } from './chunk-UXGIW7OK.js';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { View, Text } from 'react-native';
|
|
6
|
+
import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
7
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
var COMMON_GLYPHS = {
|
|
10
|
+
enter: "\u21B5",
|
|
11
|
+
return: "\u21B5",
|
|
12
|
+
esc: "Esc",
|
|
13
|
+
escape: "Esc",
|
|
14
|
+
tab: "\u21E5",
|
|
15
|
+
backspace: "\u232B",
|
|
16
|
+
delete: "Del",
|
|
17
|
+
del: "Del",
|
|
18
|
+
space: "\u2423",
|
|
19
|
+
up: "\u2191",
|
|
20
|
+
down: "\u2193",
|
|
21
|
+
left: "\u2190",
|
|
22
|
+
right: "\u2192",
|
|
23
|
+
arrowup: "\u2191",
|
|
24
|
+
arrowdown: "\u2193",
|
|
25
|
+
arrowleft: "\u2190",
|
|
26
|
+
arrowright: "\u2192",
|
|
27
|
+
pageup: "PgUp",
|
|
28
|
+
pagedown: "PgDn",
|
|
29
|
+
home: "Home",
|
|
30
|
+
end: "End",
|
|
31
|
+
capslock: "\u21EA",
|
|
32
|
+
win: "Win"
|
|
33
|
+
};
|
|
34
|
+
var DEFAULT_LABELS = {
|
|
35
|
+
keys: {
|
|
36
|
+
command: "Command",
|
|
37
|
+
control: "Control",
|
|
38
|
+
option: "Option",
|
|
39
|
+
alt: "Alt",
|
|
40
|
+
shift: "Shift",
|
|
41
|
+
enter: "Enter",
|
|
42
|
+
return: "Return",
|
|
43
|
+
escape: "Escape",
|
|
44
|
+
tab: "Tab",
|
|
45
|
+
backspace: "Backspace",
|
|
46
|
+
delete: "Delete",
|
|
47
|
+
space: "Space",
|
|
48
|
+
up: "Up",
|
|
49
|
+
down: "Down",
|
|
50
|
+
left: "Left",
|
|
51
|
+
right: "Right",
|
|
52
|
+
pageUp: "Page Up",
|
|
53
|
+
pageDown: "Page Down",
|
|
54
|
+
home: "Home",
|
|
55
|
+
end: "End",
|
|
56
|
+
capsLock: "Caps Lock",
|
|
57
|
+
windows: "Windows"
|
|
58
|
+
},
|
|
59
|
+
caps: {
|
|
60
|
+
command: "Cmd",
|
|
61
|
+
meta: "Meta",
|
|
62
|
+
super: "Super",
|
|
63
|
+
shift: "Shift",
|
|
64
|
+
control: "Ctrl",
|
|
65
|
+
alt: "Alt",
|
|
66
|
+
escape: "Esc",
|
|
67
|
+
delete: "Del",
|
|
68
|
+
pageUp: "PgUp",
|
|
69
|
+
pageDown: "PgDn",
|
|
70
|
+
home: "Home",
|
|
71
|
+
end: "End",
|
|
72
|
+
windows: "Win"
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var KEY_ID = {
|
|
76
|
+
cmd: "command",
|
|
77
|
+
command: "command",
|
|
78
|
+
meta: "command",
|
|
79
|
+
super: "command",
|
|
80
|
+
shift: "shift",
|
|
81
|
+
ctrl: "control",
|
|
82
|
+
control: "control",
|
|
83
|
+
alt: "alt",
|
|
84
|
+
opt: "option",
|
|
85
|
+
option: "option",
|
|
86
|
+
enter: "enter",
|
|
87
|
+
return: "return",
|
|
88
|
+
esc: "escape",
|
|
89
|
+
escape: "escape",
|
|
90
|
+
tab: "tab",
|
|
91
|
+
backspace: "backspace",
|
|
92
|
+
delete: "delete",
|
|
93
|
+
del: "delete",
|
|
94
|
+
space: "space",
|
|
95
|
+
up: "up",
|
|
96
|
+
down: "down",
|
|
97
|
+
left: "left",
|
|
98
|
+
right: "right",
|
|
99
|
+
arrowup: "up",
|
|
100
|
+
arrowdown: "down",
|
|
101
|
+
arrowleft: "left",
|
|
102
|
+
arrowright: "right",
|
|
103
|
+
pageup: "pageUp",
|
|
104
|
+
pagedown: "pageDown",
|
|
105
|
+
home: "home",
|
|
106
|
+
end: "end",
|
|
107
|
+
capslock: "capsLock",
|
|
108
|
+
win: "windows"
|
|
109
|
+
};
|
|
110
|
+
var WORD_CAP_ID = {
|
|
111
|
+
esc: "escape",
|
|
112
|
+
escape: "escape",
|
|
113
|
+
delete: "delete",
|
|
114
|
+
del: "delete",
|
|
115
|
+
pageup: "pageUp",
|
|
116
|
+
pagedown: "pageDown",
|
|
117
|
+
home: "home",
|
|
118
|
+
end: "end",
|
|
119
|
+
win: "windows"
|
|
120
|
+
};
|
|
121
|
+
var TEXT_MODIFIER_ID = {
|
|
122
|
+
cmd: "command",
|
|
123
|
+
command: "command",
|
|
124
|
+
meta: "meta",
|
|
125
|
+
super: "super",
|
|
126
|
+
shift: "shift",
|
|
127
|
+
ctrl: "control",
|
|
128
|
+
control: "control",
|
|
129
|
+
alt: "alt",
|
|
130
|
+
opt: "alt",
|
|
131
|
+
option: "alt"
|
|
132
|
+
};
|
|
133
|
+
var APPLE_MODIFIERS = {
|
|
134
|
+
cmd: "\u2318",
|
|
135
|
+
command: "\u2318",
|
|
136
|
+
meta: "\u2318",
|
|
137
|
+
super: "\u2318",
|
|
138
|
+
shift: "\u21E7",
|
|
139
|
+
ctrl: "\u2303",
|
|
140
|
+
control: "\u2303",
|
|
141
|
+
alt: "\u2325",
|
|
142
|
+
opt: "\u2325",
|
|
143
|
+
option: "\u2325"
|
|
144
|
+
};
|
|
145
|
+
var TEXT_MODIFIERS = {
|
|
146
|
+
cmd: "Cmd",
|
|
147
|
+
command: "Cmd",
|
|
148
|
+
meta: "Meta",
|
|
149
|
+
super: "Super",
|
|
150
|
+
shift: "Shift",
|
|
151
|
+
ctrl: "Ctrl",
|
|
152
|
+
control: "Ctrl",
|
|
153
|
+
alt: "Alt",
|
|
154
|
+
opt: "Alt",
|
|
155
|
+
option: "Alt"
|
|
156
|
+
};
|
|
157
|
+
var GLYPH_ICON = {
|
|
158
|
+
"\u2318": "key-command",
|
|
159
|
+
"\u21E7": "key-shift",
|
|
160
|
+
"\u2325": "key-option",
|
|
161
|
+
"\u2303": "key-control",
|
|
162
|
+
"\u21A9": "key-enter",
|
|
163
|
+
"\u21B5": "key-enter",
|
|
164
|
+
"\u21E5": "key-tab",
|
|
165
|
+
"\u232B": "key-backspace",
|
|
166
|
+
"\u2423": "key-space",
|
|
167
|
+
"\u21EA": "key-capslock",
|
|
168
|
+
"\u2191": "arrow-up",
|
|
169
|
+
"\u2193": "arrow-down",
|
|
170
|
+
"\u2190": "arrow-left",
|
|
171
|
+
"\u2192": "arrow-right"
|
|
172
|
+
};
|
|
173
|
+
var ICON_SIZE = { sm: 12, md: 13 };
|
|
174
|
+
function resolveKey(key, symbols, apple, labels) {
|
|
175
|
+
if (!symbols) return key;
|
|
176
|
+
const k = key.trim().toLowerCase();
|
|
177
|
+
if (apple) {
|
|
178
|
+
const glyph = APPLE_MODIFIERS[k];
|
|
179
|
+
if (glyph) return glyph;
|
|
180
|
+
} else {
|
|
181
|
+
const modifierId = TEXT_MODIFIER_ID[k];
|
|
182
|
+
if (modifierId) return labels.caps[modifierId] ?? TEXT_MODIFIERS[k] ?? key;
|
|
183
|
+
}
|
|
184
|
+
const wordId = WORD_CAP_ID[k];
|
|
185
|
+
if (wordId) return labels.caps[wordId] ?? COMMON_GLYPHS[k] ?? key;
|
|
186
|
+
return COMMON_GLYPHS[k] ?? key;
|
|
187
|
+
}
|
|
188
|
+
function spokenKey(key, apple, labels) {
|
|
189
|
+
const k = key.trim().toLowerCase();
|
|
190
|
+
let id = KEY_ID[k];
|
|
191
|
+
if (id === "option" || id === "alt") id = apple ? "option" : "alt";
|
|
192
|
+
const word = id ? labels.keys[id] : void 0;
|
|
193
|
+
if (word) return word;
|
|
194
|
+
return key.length === 1 ? key.toUpperCase() : key;
|
|
195
|
+
}
|
|
196
|
+
function spokenLabel(parts, apple, labels) {
|
|
197
|
+
return parts.map((k) => spokenKey(k, apple, labels)).join(" ");
|
|
198
|
+
}
|
|
199
|
+
function Kbd({
|
|
200
|
+
keys,
|
|
201
|
+
symbols = true,
|
|
202
|
+
size = "md",
|
|
203
|
+
// `motion` is accepted for API parity but intentionally unused — Kbd has no
|
|
204
|
+
// animation. Destructured so it never lands on the underlying View.
|
|
205
|
+
motion: _motion = "full",
|
|
206
|
+
children,
|
|
207
|
+
accessibilityLabel,
|
|
208
|
+
labels: labelsProp
|
|
209
|
+
}) {
|
|
210
|
+
const labels = useLabels("kbd", DEFAULT_LABELS, labelsProp);
|
|
211
|
+
const { styles } = useStyles(sheet, { size });
|
|
212
|
+
const theme = useLoamTheme("kbd");
|
|
213
|
+
const apple = theme.platform === "iOS";
|
|
214
|
+
const face = (label2) => {
|
|
215
|
+
const icon = GLYPH_ICON[label2];
|
|
216
|
+
return icon ? /* @__PURE__ */ jsx(View, { testID: `kbd-glyph-${label2}`, children: /* @__PURE__ */ jsx(Icon, { name: icon, size: ICON_SIZE[size ?? "md"], color: theme.color.text2, strokeWidth: 2 }) }) : /* @__PURE__ */ jsx(Text, { style: styles.label, children: label2 });
|
|
217
|
+
};
|
|
218
|
+
if (keys === void 0) {
|
|
219
|
+
const label2 = accessibilityLabel ?? (typeof children === "string" ? spokenLabel([children], apple, labels) : void 0);
|
|
220
|
+
return /* @__PURE__ */ jsx(View, { accessible: true, accessibilityRole: NAMED_ROLE, accessibilityLabel: label2, style: styles.cap, children: typeof children === "string" ? face(children) : children });
|
|
221
|
+
}
|
|
222
|
+
const list = Array.isArray(keys) ? keys : String(keys).split("+");
|
|
223
|
+
const parts = list.map((k) => k.trim()).filter((k) => k.length > 0);
|
|
224
|
+
const label = accessibilityLabel ?? spokenLabel(parts, apple, labels);
|
|
225
|
+
return /* @__PURE__ */ jsx(View, { accessible: true, accessibilityRole: NAMED_ROLE, accessibilityLabel: label, style: styles.group, children: parts.map((key, i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
226
|
+
i > 0 ? /* @__PURE__ */ jsx(Text, { style: styles.plus, children: "+" }) : null,
|
|
227
|
+
/* @__PURE__ */ jsx(View, { style: styles.cap, children: face(resolveKey(key, symbols, apple, labels)) })
|
|
228
|
+
] }, `${key}-${i}`)) });
|
|
229
|
+
}
|
|
230
|
+
var sheet = createStyleSheet((theme) => ({
|
|
231
|
+
// The row of keycaps. `space.s1` gap matches the web `gap-1` between caps.
|
|
232
|
+
group: { flexDirection: "row", alignItems: "center", gap: theme.space.s1 },
|
|
233
|
+
// A single keycap. No native `--kbd-bg` token exists, so — as the native
|
|
234
|
+
// contract prescribes — the subtle surface falls back to `surface2` + a
|
|
235
|
+
// hairline border. The tiny `minWidth`/`minHeight` (20 / 24) mirror the web
|
|
236
|
+
// `kbd`'s raw-px `h-[20px]`/`min-w-[20px]` keycap box one-to-one.
|
|
237
|
+
cap: {
|
|
238
|
+
alignItems: "center",
|
|
239
|
+
justifyContent: "center",
|
|
240
|
+
backgroundColor: theme.color.surface2,
|
|
241
|
+
borderWidth: theme.borderWidth.base,
|
|
242
|
+
borderColor: theme.color.border,
|
|
243
|
+
borderRadius: theme.radius.sm,
|
|
244
|
+
variants: {
|
|
245
|
+
size: {
|
|
246
|
+
sm: {
|
|
247
|
+
minWidth: theme.space[20],
|
|
248
|
+
minHeight: theme.space[20],
|
|
249
|
+
paddingHorizontal: theme.space.s1
|
|
250
|
+
},
|
|
251
|
+
md: {
|
|
252
|
+
minWidth: theme.space[24],
|
|
253
|
+
minHeight: theme.space[24],
|
|
254
|
+
paddingHorizontal: theme.space.s2
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
// Monospace, tabular figures so combos line up. `text2` matches web `text-ink-2`.
|
|
260
|
+
label: {
|
|
261
|
+
fontFamily: theme.font.mono,
|
|
262
|
+
color: theme.color.text2,
|
|
263
|
+
textAlign: "center",
|
|
264
|
+
fontVariant: ["tabular-nums"],
|
|
265
|
+
variants: {
|
|
266
|
+
size: {
|
|
267
|
+
sm: {
|
|
268
|
+
fontSize: theme.type.caption2.fontSize,
|
|
269
|
+
lineHeight: theme.type.caption2.lineHeight
|
|
270
|
+
},
|
|
271
|
+
md: {
|
|
272
|
+
fontSize: theme.type.caption1.fontSize,
|
|
273
|
+
lineHeight: theme.type.caption1.lineHeight
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
// The `+` between keys — muted (`text3`, web `text-ink-3`), decorative only.
|
|
279
|
+
plus: {
|
|
280
|
+
fontFamily: theme.font.mono,
|
|
281
|
+
color: theme.color.text3,
|
|
282
|
+
fontSize: theme.type.caption1.fontSize,
|
|
283
|
+
lineHeight: theme.type.caption1.lineHeight
|
|
284
|
+
}
|
|
285
|
+
}));
|
|
286
|
+
|
|
287
|
+
export { Kbd };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/lib/labels.tsx
|
|
5
|
+
var LabelsContext = React.createContext({ labels: {}, locale: void 0 });
|
|
6
|
+
function LoamLabelsProvider({ labels, locale, children }) {
|
|
7
|
+
const outer = React.useContext(LabelsContext);
|
|
8
|
+
const value = React.useMemo(() => {
|
|
9
|
+
const merged = { ...outer.labels };
|
|
10
|
+
for (const [key, own] of Object.entries(labels ?? {})) {
|
|
11
|
+
merged[key] = { ...merged[key], ...own };
|
|
12
|
+
}
|
|
13
|
+
return { labels: merged, locale: locale ?? outer.locale };
|
|
14
|
+
}, [outer, labels, locale]);
|
|
15
|
+
return /* @__PURE__ */ jsx(LabelsContext.Provider, { value, children });
|
|
16
|
+
}
|
|
17
|
+
function useLabels(key, defaults, own) {
|
|
18
|
+
const fromContext = React.useContext(LabelsContext).labels[key];
|
|
19
|
+
return React.useMemo(
|
|
20
|
+
() => ({ ...defaults, ...fromContext, ...own }),
|
|
21
|
+
[defaults, fromContext, own]
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function useLoamLocale() {
|
|
25
|
+
return React.useContext(LabelsContext).locale;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { LoamLabelsProvider, useLabels, useLoamLocale };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { useWindowDimensions } from 'react-native';
|
|
2
|
+
import { breakpoints, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
3
|
+
|
|
4
|
+
// src/adaptive/form-factor.ts
|
|
5
|
+
var FORM_FACTORS = [
|
|
6
|
+
"phone",
|
|
7
|
+
"phoneLandscape",
|
|
8
|
+
"foldable",
|
|
9
|
+
"tablet",
|
|
10
|
+
"tabletLarge"
|
|
11
|
+
];
|
|
12
|
+
var FOLD_LIST_FLEX = 1;
|
|
13
|
+
var FOLD_DETAIL_FLEX = 1.25;
|
|
14
|
+
var TABLET_LIST_FLEX = 0.85;
|
|
15
|
+
var TABLET_DETAIL_FLEX = 1.3;
|
|
16
|
+
var FORM_FACTOR_SPECS = {
|
|
17
|
+
phone: {
|
|
18
|
+
formFactor: "phone",
|
|
19
|
+
token: "--bp-phone 430px",
|
|
20
|
+
label: "390 \xD7 844 \xB7 compact width",
|
|
21
|
+
panes: 1,
|
|
22
|
+
nav: "bottom",
|
|
23
|
+
drawerAllowed: false,
|
|
24
|
+
hinge: false,
|
|
25
|
+
listFlex: 1,
|
|
26
|
+
detailFlex: 0,
|
|
27
|
+
asideFlex: 0,
|
|
28
|
+
collapseLargeTitle: false,
|
|
29
|
+
halveVerticalPadding: false,
|
|
30
|
+
modal: "fullWidthSheet",
|
|
31
|
+
fab: "floating",
|
|
32
|
+
rule: "Single column. Detail is a push. Sheets go full-width and respect the bottom safe area."
|
|
33
|
+
},
|
|
34
|
+
phoneLandscape: {
|
|
35
|
+
formFactor: "phoneLandscape",
|
|
36
|
+
token: "--bp-phone-land 740px",
|
|
37
|
+
label: "844 \xD7 390 \xB7 compact height",
|
|
38
|
+
panes: 1,
|
|
39
|
+
nav: "rail",
|
|
40
|
+
drawerAllowed: false,
|
|
41
|
+
hinge: false,
|
|
42
|
+
listFlex: 1,
|
|
43
|
+
detailFlex: 0,
|
|
44
|
+
asideFlex: 0,
|
|
45
|
+
collapseLargeTitle: true,
|
|
46
|
+
halveVerticalPadding: true,
|
|
47
|
+
modal: "fullWidthSheet",
|
|
48
|
+
fab: "floating",
|
|
49
|
+
rule: "Landscape phone: collapse large titles to inline, move nav to a rail, halve vertical padding, never a bottom bar over the keyboard."
|
|
50
|
+
},
|
|
51
|
+
foldable: {
|
|
52
|
+
formFactor: "foldable",
|
|
53
|
+
token: "--bp-fold 585px",
|
|
54
|
+
label: "585 \xD7 800 \xB7 medium width \xB7 hinge gutter",
|
|
55
|
+
panes: 2,
|
|
56
|
+
nav: "rail",
|
|
57
|
+
drawerAllowed: false,
|
|
58
|
+
hinge: true,
|
|
59
|
+
listFlex: FOLD_LIST_FLEX,
|
|
60
|
+
detailFlex: FOLD_DETAIL_FLEX,
|
|
61
|
+
asideFlex: 0,
|
|
62
|
+
collapseLargeTitle: false,
|
|
63
|
+
halveVerticalPadding: false,
|
|
64
|
+
modal: "fullWidthSheet",
|
|
65
|
+
fab: "floating",
|
|
66
|
+
rule: "Treat the hinge as a hard gutter \u2014 no interactive element straddles it. Support half-opened (tabletop) by keeping controls in the bottom half."
|
|
67
|
+
},
|
|
68
|
+
tablet: {
|
|
69
|
+
formFactor: "tablet",
|
|
70
|
+
token: "--bp-tablet 768px",
|
|
71
|
+
label: "768 \xD7 1024 \xB7 expanded width",
|
|
72
|
+
panes: 2,
|
|
73
|
+
nav: "rail",
|
|
74
|
+
drawerAllowed: true,
|
|
75
|
+
hinge: false,
|
|
76
|
+
listFlex: TABLET_LIST_FLEX,
|
|
77
|
+
detailFlex: TABLET_DETAIL_FLEX,
|
|
78
|
+
asideFlex: 0,
|
|
79
|
+
collapseLargeTitle: false,
|
|
80
|
+
halveVerticalPadding: false,
|
|
81
|
+
modal: "centeredDialog",
|
|
82
|
+
fab: "toolbarButton",
|
|
83
|
+
rule: "List\u2013detail side by side, one selection always visible. Modals become centred dialogs; FAB becomes a toolbar button."
|
|
84
|
+
},
|
|
85
|
+
tabletLarge: {
|
|
86
|
+
formFactor: "tabletLarge",
|
|
87
|
+
token: "--bp-tablet-lg 1024px",
|
|
88
|
+
label: "1024 \xD7 768 \xB7 expanded width",
|
|
89
|
+
panes: 3,
|
|
90
|
+
nav: "rail",
|
|
91
|
+
drawerAllowed: true,
|
|
92
|
+
hinge: false,
|
|
93
|
+
listFlex: TABLET_LIST_FLEX,
|
|
94
|
+
detailFlex: TABLET_DETAIL_FLEX,
|
|
95
|
+
// The spec's Expanded row reads "Two–three" panes; the third pane mirrors
|
|
96
|
+
// the list's weight so the detail stays the widest column.
|
|
97
|
+
asideFlex: TABLET_LIST_FLEX,
|
|
98
|
+
collapseLargeTitle: false,
|
|
99
|
+
halveVerticalPadding: false,
|
|
100
|
+
modal: "centeredDialog",
|
|
101
|
+
fab: "toolbarButton",
|
|
102
|
+
rule: "List\u2013detail(\u2013aside) side by side, one selection always visible. Modals become centred dialogs; FAB becomes a toolbar button."
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
function classifyFormFactor({ width, height }) {
|
|
106
|
+
if (height < breakpoints.phone && (width >= breakpoints.phoneLand || width > height)) {
|
|
107
|
+
return "phoneLandscape";
|
|
108
|
+
}
|
|
109
|
+
if (width >= breakpoints.tabletLg) return "tabletLarge";
|
|
110
|
+
if (width >= breakpoints.tablet) return "tablet";
|
|
111
|
+
if (width >= breakpoints.fold) return "foldable";
|
|
112
|
+
return "phone";
|
|
113
|
+
}
|
|
114
|
+
function adaptivePadding(formFactor, screenPad) {
|
|
115
|
+
const { halveVerticalPadding } = FORM_FACTOR_SPECS[formFactor];
|
|
116
|
+
return {
|
|
117
|
+
paddingHorizontal: screenPad,
|
|
118
|
+
paddingVertical: halveVerticalPadding ? screenPad / 2 : screenPad
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function useFormFactor(override) {
|
|
122
|
+
const theme = useLoamTheme("adaptive");
|
|
123
|
+
const { width, height } = useWindowDimensions();
|
|
124
|
+
const formFactor = override ?? classifyFormFactor({ width, height });
|
|
125
|
+
const spec = FORM_FACTOR_SPECS[formFactor];
|
|
126
|
+
const padding = adaptivePadding(formFactor, theme.layout.screenPad);
|
|
127
|
+
return {
|
|
128
|
+
...spec,
|
|
129
|
+
...padding,
|
|
130
|
+
width,
|
|
131
|
+
height,
|
|
132
|
+
isLandscape: width > height,
|
|
133
|
+
isCompactHeight: height < breakpoints.phone,
|
|
134
|
+
reachZoneY: height * theme.layout.reachZone,
|
|
135
|
+
readingMeasure: theme.type.body.fontSize * 0.5 * theme.measure.base
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export { FORM_FACTORS, FORM_FACTOR_SPECS, adaptivePadding, classifyFormFactor, useFormFactor };
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLabels } from './chunk-APCWFOZW.js';
|
|
2
|
+
import { useResolvedMotion, useReducedMotion } from './chunk-J64KGCGX.js';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
import { View, ScrollView, Animated, Easing } from 'react-native';
|
|
4
|
+
import { Platform, View, ScrollView, Animated, Easing } from 'react-native';
|
|
4
5
|
import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
5
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
7
|
|
|
8
|
+
var DEFAULT_LABELS = {
|
|
9
|
+
carousel: "Carousel",
|
|
10
|
+
nextSlide: "Next slide",
|
|
11
|
+
previousSlide: "Previous slide",
|
|
12
|
+
slide: (n, count) => `Slide ${n} of ${count}`
|
|
13
|
+
};
|
|
7
14
|
var DOT_SIZE = 7;
|
|
8
15
|
var DOT_ACTIVE_WIDTH = 22;
|
|
9
16
|
function Dot({ active, motion }) {
|
|
10
|
-
const theme = useLoamTheme();
|
|
17
|
+
const theme = useLoamTheme("carousel");
|
|
11
18
|
const { styles } = useStyles(sheet);
|
|
12
19
|
const width = React.useRef(
|
|
13
20
|
new Animated.Value(theme.space[active ? DOT_ACTIVE_WIDTH : DOT_SIZE])
|
|
@@ -59,6 +66,7 @@ function Dot({ active, motion }) {
|
|
|
59
66
|
}
|
|
60
67
|
);
|
|
61
68
|
}
|
|
69
|
+
var webSnapStop = Platform.OS === "web" ? { scrollSnapStop: "always" } : null;
|
|
62
70
|
function Carousel({
|
|
63
71
|
items,
|
|
64
72
|
renderItem,
|
|
@@ -69,11 +77,15 @@ function Carousel({
|
|
|
69
77
|
autoPlay = false,
|
|
70
78
|
interval = 4e3,
|
|
71
79
|
loop = false,
|
|
72
|
-
accessibilityLabel
|
|
73
|
-
motion = "full"
|
|
80
|
+
accessibilityLabel,
|
|
81
|
+
motion = "full",
|
|
82
|
+
labels: labelsProp
|
|
74
83
|
}) {
|
|
84
|
+
const labels = useLabels("carousel", DEFAULT_LABELS, labelsProp);
|
|
75
85
|
const { styles } = useStyles(sheet);
|
|
76
|
-
const resolvedMotion = useResolvedMotion(motion);
|
|
86
|
+
const resolvedMotion = useResolvedMotion(motion, "carousel");
|
|
87
|
+
const osReduced = useReducedMotion();
|
|
88
|
+
const [userTookOver, setUserTookOver] = React.useState(false);
|
|
77
89
|
const slides = items && renderItem ? items.map((item, index) => renderItem(item, index)) : React.Children.toArray(children);
|
|
78
90
|
const count = slides.length;
|
|
79
91
|
const isControlled = activeIndex !== void 0;
|
|
@@ -101,12 +113,26 @@ function Carousel({
|
|
|
101
113
|
if (width <= 0) return;
|
|
102
114
|
goTo(Math.round(e.nativeEvent.contentOffset.x / width));
|
|
103
115
|
};
|
|
116
|
+
const settle = React.useRef(null);
|
|
117
|
+
React.useEffect(
|
|
118
|
+
() => () => {
|
|
119
|
+
if (settle.current) clearTimeout(settle.current);
|
|
120
|
+
},
|
|
121
|
+
[]
|
|
122
|
+
);
|
|
123
|
+
const onScroll = Platform.OS === "web" ? (e) => {
|
|
124
|
+
const x = e.nativeEvent.contentOffset.x;
|
|
125
|
+
if (settle.current) clearTimeout(settle.current);
|
|
126
|
+
settle.current = setTimeout(() => {
|
|
127
|
+
if (width > 0) goTo(Math.round(x / width));
|
|
128
|
+
}, 120);
|
|
129
|
+
} : void 0;
|
|
104
130
|
React.useEffect(() => {
|
|
105
131
|
if (width <= 0) return;
|
|
106
132
|
scrollRef.current?.scrollTo({ x: active * width, animated: resolvedMotion === "full" });
|
|
107
133
|
}, [active, width, resolvedMotion]);
|
|
108
134
|
React.useEffect(() => {
|
|
109
|
-
if (!autoPlay || count <= 1) return;
|
|
135
|
+
if (!autoPlay || count <= 1 || userTookOver || osReduced) return;
|
|
110
136
|
const id = setInterval(() => {
|
|
111
137
|
const next = active + 1;
|
|
112
138
|
if (next >= count) {
|
|
@@ -116,43 +142,61 @@ function Carousel({
|
|
|
116
142
|
}
|
|
117
143
|
}, interval);
|
|
118
144
|
return () => clearInterval(id);
|
|
119
|
-
}, [autoPlay, interval, loop, active, count, goTo]);
|
|
120
|
-
return /* @__PURE__ */ jsxs(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
145
|
+
}, [autoPlay, interval, loop, active, count, goTo, userTookOver, osReduced]);
|
|
146
|
+
return /* @__PURE__ */ jsxs(
|
|
147
|
+
View,
|
|
148
|
+
{
|
|
149
|
+
style: styles.container,
|
|
150
|
+
role: "group",
|
|
151
|
+
accessibilityLabel: accessibilityLabel ?? labels.carousel,
|
|
152
|
+
accessibilityActions: count > 1 ? [
|
|
153
|
+
{ name: "increment", label: labels.nextSlide },
|
|
154
|
+
{ name: "decrement", label: labels.previousSlide }
|
|
155
|
+
] : void 0,
|
|
156
|
+
onAccessibilityAction: (e) => {
|
|
157
|
+
if (e.nativeEvent.actionName === "increment") goTo(Math.min(count - 1, active + 1));
|
|
158
|
+
else if (e.nativeEvent.actionName === "decrement") goTo(Math.max(0, active - 1));
|
|
159
|
+
},
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ jsx(
|
|
162
|
+
ScrollView,
|
|
163
|
+
{
|
|
164
|
+
ref: scrollRef,
|
|
165
|
+
horizontal: true,
|
|
166
|
+
pagingEnabled: true,
|
|
167
|
+
focusable: true,
|
|
168
|
+
showsHorizontalScrollIndicator: false,
|
|
169
|
+
onLayout,
|
|
170
|
+
onMomentumScrollEnd,
|
|
171
|
+
onScrollBeginDrag: () => setUserTookOver(true),
|
|
172
|
+
onScroll,
|
|
173
|
+
scrollEventThrottle: 16,
|
|
174
|
+
style: styles.scroll,
|
|
175
|
+
children: slides.map((slide, index) => /* @__PURE__ */ jsx(
|
|
176
|
+
View,
|
|
177
|
+
{
|
|
178
|
+
style: [styles.page, width > 0 ? { width } : styles.pageFallback, webSnapStop],
|
|
179
|
+
accessible: true,
|
|
180
|
+
role: "group",
|
|
181
|
+
accessibilityLabel: labels.slide(index + 1, count),
|
|
182
|
+
children: slide
|
|
183
|
+
},
|
|
184
|
+
index
|
|
185
|
+
))
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
showDots && count > 1 ? /* @__PURE__ */ jsx(
|
|
134
189
|
View,
|
|
135
190
|
{
|
|
136
|
-
style:
|
|
137
|
-
accessible:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
),
|
|
146
|
-
showDots && count > 1 ? /* @__PURE__ */ jsx(
|
|
147
|
-
View,
|
|
148
|
-
{
|
|
149
|
-
style: styles.dots,
|
|
150
|
-
accessible: false,
|
|
151
|
-
importantForAccessibility: "no-hide-descendants",
|
|
152
|
-
children: slides.map((_, index) => /* @__PURE__ */ jsx(Dot, { active: index === active, motion: resolvedMotion }, index))
|
|
153
|
-
}
|
|
154
|
-
) : null
|
|
155
|
-
] });
|
|
191
|
+
style: styles.dots,
|
|
192
|
+
accessible: false,
|
|
193
|
+
importantForAccessibility: "no-hide-descendants",
|
|
194
|
+
children: slides.map((_, index) => /* @__PURE__ */ jsx(Dot, { active: index === active, motion: resolvedMotion }, index))
|
|
195
|
+
}
|
|
196
|
+
) : null
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
);
|
|
156
200
|
}
|
|
157
201
|
var sheet = createStyleSheet((theme) => ({
|
|
158
202
|
container: {
|