@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
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { Spinner } from './chunk-
|
|
2
|
-
import { Skeleton, SkeletonText } from './chunk-
|
|
1
|
+
import { Spinner } from './chunk-KQZ3GLHR.js';
|
|
2
|
+
import { Skeleton, SkeletonText } from './chunk-PNF3NKB5.js';
|
|
3
|
+
import { useLabels } from './chunk-APCWFOZW.js';
|
|
4
|
+
import { motionTiming, springConfig } from './chunk-J64KGCGX.js';
|
|
3
5
|
import * as React from 'react';
|
|
4
6
|
import { StyleSheet, Animated, View, Pressable, Text, Image } from 'react-native';
|
|
5
7
|
import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
|
|
6
8
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
9
|
|
|
10
|
+
var DEFAULT_LABELS = {
|
|
11
|
+
loading: "Loading"
|
|
12
|
+
};
|
|
8
13
|
function Card({
|
|
9
14
|
children,
|
|
10
15
|
variant = "default",
|
|
@@ -13,13 +18,15 @@ function Card({
|
|
|
13
18
|
accessibilityLabel,
|
|
14
19
|
selected = false,
|
|
15
20
|
busy = false,
|
|
16
|
-
busyLabel
|
|
21
|
+
busyLabel,
|
|
17
22
|
skeleton = false,
|
|
18
23
|
emphasized = false,
|
|
19
24
|
dragging = false,
|
|
20
|
-
motion = "full"
|
|
25
|
+
motion = "full",
|
|
26
|
+
labels: labelsProp
|
|
21
27
|
}) {
|
|
22
|
-
const
|
|
28
|
+
const labels = useLabels("card", DEFAULT_LABELS, labelsProp);
|
|
29
|
+
const theme = useLoamTheme("card");
|
|
23
30
|
const { styles } = useStyles(sheet, {
|
|
24
31
|
variant: variant === "default" ? void 0 : variant,
|
|
25
32
|
selected,
|
|
@@ -27,12 +34,23 @@ function Card({
|
|
|
27
34
|
dragging
|
|
28
35
|
});
|
|
29
36
|
const scale = React.useRef(new Animated.Value(1)).current;
|
|
30
|
-
const spring = (to) =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
const spring = (to) => {
|
|
38
|
+
if (theme.reduceMotion) return;
|
|
39
|
+
Animated.spring(scale, {
|
|
40
|
+
...springConfig(theme, "fs"),
|
|
41
|
+
toValue: to,
|
|
42
|
+
useNativeDriver: true
|
|
43
|
+
}).start();
|
|
44
|
+
};
|
|
45
|
+
const tintOn = dragging || selected;
|
|
46
|
+
const tintOpacity = React.useRef(new Animated.Value(tintOn ? 1 : 0)).current;
|
|
47
|
+
React.useEffect(() => {
|
|
48
|
+
Animated.timing(tintOpacity, {
|
|
49
|
+
toValue: tintOn ? 1 : 0,
|
|
50
|
+
...motionTiming(theme.reduceMotion ? "reduced" : "full"),
|
|
51
|
+
useNativeDriver: true
|
|
52
|
+
}).start();
|
|
53
|
+
}, [tintOn, tintOpacity, theme.reduceMotion]);
|
|
36
54
|
if (skeleton) {
|
|
37
55
|
return /* @__PURE__ */ jsx(
|
|
38
56
|
View,
|
|
@@ -52,7 +70,12 @@ function Card({
|
|
|
52
70
|
);
|
|
53
71
|
}
|
|
54
72
|
const tint = dragging ? theme.state.dragged : selected ? theme.state.selected : null;
|
|
55
|
-
const tintOverlay = tint ? /* @__PURE__ */ jsx(
|
|
73
|
+
const tintOverlay = tint ? /* @__PURE__ */ jsx(
|
|
74
|
+
Animated.View,
|
|
75
|
+
{
|
|
76
|
+
style: [StyleSheet.absoluteFill, { backgroundColor: tint, opacity: tintOpacity, pointerEvents: "none" }]
|
|
77
|
+
}
|
|
78
|
+
) : null;
|
|
56
79
|
const lift = dragging && motion === "full" && !theme.reduceMotion;
|
|
57
80
|
const dragTransform = lift ? [{ scale: 1.022 }, { rotate: theme.rtl ? "-1.2deg" : "1.2deg" }] : [];
|
|
58
81
|
const withBusy = (node) => busy ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -65,7 +88,7 @@ function Card({
|
|
|
65
88
|
importantForAccessibility: "no-hide-descendants"
|
|
66
89
|
}
|
|
67
90
|
),
|
|
68
|
-
/* @__PURE__ */ jsx(View, { style: styles.busySpinner, children: /* @__PURE__ */ jsx(Spinner, { size: "sm", accessibilityLabel: busyLabel }) })
|
|
91
|
+
/* @__PURE__ */ jsx(View, { style: styles.busySpinner, children: /* @__PURE__ */ jsx(Spinner, { size: "sm", accessibilityLabel: busyLabel ?? labels.loading }) })
|
|
69
92
|
] }) : node;
|
|
70
93
|
if (onPress) {
|
|
71
94
|
return /* @__PURE__ */ jsxs(Animated.View, { style: [styles.base, style, { transform: [{ scale }, ...dragTransform] }], children: [
|
|
@@ -77,7 +100,7 @@ function Card({
|
|
|
77
100
|
accessibilityLabel,
|
|
78
101
|
accessibilityState: { selected: selected || void 0, busy: busy || void 0 },
|
|
79
102
|
onPress,
|
|
80
|
-
onPressIn: () => spring(0.
|
|
103
|
+
onPressIn: () => spring(0.97),
|
|
81
104
|
onPressOut: () => spring(1),
|
|
82
105
|
style: StyleSheet.absoluteFill
|
|
83
106
|
}
|
|
@@ -174,8 +197,19 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
174
197
|
variant: {
|
|
175
198
|
// Reference (buildWidgets): `box-shadow:0 12px 30px rgba(30,25,15,.14)` → md token is
|
|
176
199
|
// the nearest match; elevated steps up to lg for the stronger treatment.
|
|
177
|
-
|
|
178
|
-
|
|
200
|
+
// The resting card reads the theme's `card` style (edge + shadow), so one
|
|
201
|
+
// theme setting restyles every card. `outline` keeps its own edge — it
|
|
202
|
+
// is the variant that *is* a border.
|
|
203
|
+
default: {
|
|
204
|
+
borderWidth: theme.card.borderWidth,
|
|
205
|
+
borderColor: theme.card.borderColor,
|
|
206
|
+
...theme.card.shadow
|
|
207
|
+
},
|
|
208
|
+
elevated: {
|
|
209
|
+
borderWidth: theme.card.borderWidth,
|
|
210
|
+
borderColor: theme.card.borderColor,
|
|
211
|
+
...theme.shadow.lg
|
|
212
|
+
},
|
|
179
213
|
outline: {}
|
|
180
214
|
},
|
|
181
215
|
// Selection: an accent border. The `state-selected` tint is a translucent
|
|
@@ -189,7 +223,8 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
189
223
|
// it derives the accent at the hard-edge strength every such edge needs,
|
|
190
224
|
// and it is a no-op on an accent that already clears.
|
|
191
225
|
selected: {
|
|
192
|
-
|
|
226
|
+
// Width too: a theme may draw cards edgeless, and the mark must survive it.
|
|
227
|
+
true: { borderColor: theme.focus.ringColor, borderWidth: theme.borderWidth.thin },
|
|
193
228
|
false: {}
|
|
194
229
|
},
|
|
195
230
|
// Von Restorff emphasis — a 2px accent border + the stronger `lg`
|
|
@@ -206,7 +241,11 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
206
241
|
// Dragging: a raised shadow + accent border over the card's own surface;
|
|
207
242
|
// the `state-dragged` tint and the scale/tilt are applied in the component.
|
|
208
243
|
dragging: {
|
|
209
|
-
true: {
|
|
244
|
+
true: {
|
|
245
|
+
borderColor: theme.focus.ringColor,
|
|
246
|
+
borderWidth: theme.borderWidth.thin,
|
|
247
|
+
...theme.shadow.lg
|
|
248
|
+
},
|
|
210
249
|
false: {}
|
|
211
250
|
}
|
|
212
251
|
}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { Dialog, DialogTitle, DialogFooter } from './chunk-
|
|
2
|
-
import { Button } from './chunk-
|
|
3
|
-
import {
|
|
1
|
+
import { Dialog, DialogTitle, DialogFooter } from './chunk-GDKVKNR2.js';
|
|
2
|
+
import { Button } from './chunk-E2E3I5W2.js';
|
|
3
|
+
import { useLabels } from './chunk-APCWFOZW.js';
|
|
4
|
+
import { Icon } from './chunk-UXGIW7OK.js';
|
|
5
|
+
import { springConfig, motionTiming } from './chunk-J64KGCGX.js';
|
|
4
6
|
import * as React from 'react';
|
|
5
|
-
import { Animated,
|
|
7
|
+
import { Animated, Text, Pressable, View, LayoutAnimation } from 'react-native';
|
|
6
8
|
import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
|
|
7
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
10
|
|
|
11
|
+
var DEFAULT_LABELS = {
|
|
12
|
+
dismiss: "Dismiss",
|
|
13
|
+
primary: "See what changed",
|
|
14
|
+
secondary: "Later"
|
|
15
|
+
};
|
|
9
16
|
function AnnouncementBar({
|
|
10
17
|
tone = "info",
|
|
11
18
|
children,
|
|
@@ -13,22 +20,38 @@ function AnnouncementBar({
|
|
|
13
20
|
actionLabel,
|
|
14
21
|
onAction,
|
|
15
22
|
onDismiss,
|
|
16
|
-
dismissLabel
|
|
23
|
+
dismissLabel,
|
|
17
24
|
wrap = false,
|
|
18
|
-
motion = "full"
|
|
25
|
+
motion = "full",
|
|
26
|
+
labels: labelsProp
|
|
19
27
|
}) {
|
|
20
|
-
const
|
|
28
|
+
const labels = useLabels("announcement", DEFAULT_LABELS, labelsProp);
|
|
29
|
+
const theme = useLoamTheme("announcement");
|
|
21
30
|
const { styles } = useStyles(sheet, { tone });
|
|
22
31
|
const slide = React.useRef(new Animated.Value(0)).current;
|
|
23
32
|
const animate = motion === "full" && !theme.reduceMotion;
|
|
24
33
|
React.useEffect(() => {
|
|
25
|
-
|
|
26
|
-
toValue: 1,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
if (animate) {
|
|
35
|
+
Animated.spring(slide, { ...springConfig(theme, "ds"), toValue: 1, useNativeDriver: true }).start();
|
|
36
|
+
} else {
|
|
37
|
+
Animated.timing(slide, { ...motionTiming(motion === "none" ? "none" : "reduced"), toValue: 1, useNativeDriver: true }).start();
|
|
38
|
+
}
|
|
39
|
+
}, [slide, animate]);
|
|
40
|
+
const dismiss = () => {
|
|
41
|
+
if (animate) {
|
|
42
|
+
LayoutAnimation.configureNext({
|
|
43
|
+
duration: theme.spring.ds.duration,
|
|
44
|
+
update: { type: LayoutAnimation.Types.spring, springDamping: theme.spring.ds.dampingRatio },
|
|
45
|
+
delete: { type: LayoutAnimation.Types.easeOut, property: LayoutAnimation.Properties.opacity }
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
onDismiss?.();
|
|
49
|
+
};
|
|
50
|
+
const actionSlopY = Math.max(
|
|
51
|
+
theme.space[10],
|
|
52
|
+
Math.round((theme.tapMin - theme.type.footnote.lineHeight) / 2)
|
|
53
|
+
);
|
|
54
|
+
const dismissSlop = Math.max(theme.space[10], Math.round((theme.tapMin - theme.ctl.xs) / 2));
|
|
32
55
|
const ink = tone === "info" ? theme.color.infoOnSoft : tone === "warn" ? theme.color.warnOnSoft : tone === "danger" ? theme.color.dangerOnSoft : tone === "good" ? theme.color.goodOnSoft : theme.color.accentOnSoft;
|
|
33
56
|
const defaultIcon = tone === "warn" ? "alert-triangle" : tone === "danger" ? "alert-circle" : tone === "good" ? "check-circle" : tone === "accent" ? "star" : "info";
|
|
34
57
|
return /* @__PURE__ */ jsxs(
|
|
@@ -38,11 +61,11 @@ function AnnouncementBar({
|
|
|
38
61
|
accessibilityLiveRegion: "polite",
|
|
39
62
|
style: [
|
|
40
63
|
styles.bar,
|
|
41
|
-
{
|
|
64
|
+
animate ? {
|
|
42
65
|
transform: [
|
|
43
66
|
{ translateY: slide.interpolate({ inputRange: [0, 1], outputRange: [-theme.space[40], 0] }) }
|
|
44
67
|
]
|
|
45
|
-
}
|
|
68
|
+
} : { opacity: slide }
|
|
46
69
|
],
|
|
47
70
|
children: [
|
|
48
71
|
/* @__PURE__ */ jsx(Icon, { name: icon ?? defaultIcon, size: theme.icon.sm, color: ink }),
|
|
@@ -53,8 +76,13 @@ function AnnouncementBar({
|
|
|
53
76
|
accessibilityRole: "button",
|
|
54
77
|
accessibilityLabel: actionLabel,
|
|
55
78
|
onPress: onAction,
|
|
56
|
-
hitSlop:
|
|
57
|
-
|
|
79
|
+
hitSlop: {
|
|
80
|
+
top: actionSlopY,
|
|
81
|
+
bottom: actionSlopY,
|
|
82
|
+
left: theme.space[10],
|
|
83
|
+
right: theme.space[10]
|
|
84
|
+
},
|
|
85
|
+
style: ({ pressed }) => [styles.action, pressed ? styles.pressed : null],
|
|
58
86
|
children: [
|
|
59
87
|
/* @__PURE__ */ jsx(Text, { style: [styles.actionLabel, { color: ink }], children: actionLabel }),
|
|
60
88
|
/* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: theme.icon.xs, color: ink })
|
|
@@ -65,10 +93,10 @@ function AnnouncementBar({
|
|
|
65
93
|
Pressable,
|
|
66
94
|
{
|
|
67
95
|
accessibilityRole: "button",
|
|
68
|
-
accessibilityLabel: dismissLabel,
|
|
69
|
-
onPress:
|
|
70
|
-
hitSlop:
|
|
71
|
-
style: styles.iconButton,
|
|
96
|
+
accessibilityLabel: dismissLabel ?? labels.dismiss,
|
|
97
|
+
onPress: dismiss,
|
|
98
|
+
hitSlop: dismissSlop,
|
|
99
|
+
style: ({ pressed }) => [styles.iconButton, pressed ? styles.pressed : null],
|
|
72
100
|
children: /* @__PURE__ */ jsx(Icon, { name: "x", size: theme.icon.xs, color: ink })
|
|
73
101
|
}
|
|
74
102
|
) : null
|
|
@@ -79,7 +107,7 @@ function AnnouncementBar({
|
|
|
79
107
|
function AnnouncementHighlights({
|
|
80
108
|
items
|
|
81
109
|
}) {
|
|
82
|
-
const theme = useLoamTheme();
|
|
110
|
+
const theme = useLoamTheme("announcement");
|
|
83
111
|
const { styles } = useStyles(sheet, { tone: "info" });
|
|
84
112
|
if (!items.length) return null;
|
|
85
113
|
return /* @__PURE__ */ jsx(View, { style: styles.highlights, children: items.map((h) => /* @__PURE__ */ jsxs(View, { style: styles.highlightRow, children: [
|
|
@@ -95,12 +123,14 @@ function AnnouncementModal({
|
|
|
95
123
|
body,
|
|
96
124
|
media,
|
|
97
125
|
highlights,
|
|
98
|
-
primaryLabel
|
|
126
|
+
primaryLabel,
|
|
99
127
|
onPrimary,
|
|
100
|
-
secondaryLabel
|
|
128
|
+
secondaryLabel,
|
|
101
129
|
onSecondary,
|
|
102
|
-
motion = "full"
|
|
130
|
+
motion = "full",
|
|
131
|
+
labels: labelsProp
|
|
103
132
|
}) {
|
|
133
|
+
const labels = useLabels("announcement", DEFAULT_LABELS, labelsProp);
|
|
104
134
|
const { styles } = useStyles(sheet, { tone: "info" });
|
|
105
135
|
return /* @__PURE__ */ jsxs(Dialog, { open, onClose: () => onOpenChange(false), accessibilityLabel: title, motion, children: [
|
|
106
136
|
/* @__PURE__ */ jsxs(View, { style: styles.modalBody, children: [
|
|
@@ -120,7 +150,7 @@ function AnnouncementModal({
|
|
|
120
150
|
onSecondary?.();
|
|
121
151
|
onOpenChange(false);
|
|
122
152
|
},
|
|
123
|
-
children: secondaryLabel
|
|
153
|
+
children: secondaryLabel ?? labels.secondary
|
|
124
154
|
}
|
|
125
155
|
),
|
|
126
156
|
/* @__PURE__ */ jsx(
|
|
@@ -132,7 +162,7 @@ function AnnouncementModal({
|
|
|
132
162
|
onPrimary?.();
|
|
133
163
|
onOpenChange(false);
|
|
134
164
|
},
|
|
135
|
-
children: primaryLabel
|
|
165
|
+
children: primaryLabel ?? labels.primary
|
|
136
166
|
}
|
|
137
167
|
)
|
|
138
168
|
] })
|
|
@@ -165,6 +195,7 @@ var sheet = createStyleSheet((theme) => ({
|
|
|
165
195
|
fontSize: theme.type.footnote.fontSize,
|
|
166
196
|
lineHeight: theme.type.footnote.lineHeight
|
|
167
197
|
},
|
|
198
|
+
pressed: { opacity: theme.state.pressedOpacity },
|
|
168
199
|
action: { flexDirection: "row", alignItems: "center", gap: theme.space[2] },
|
|
169
200
|
actionLabel: {
|
|
170
201
|
fontFamily: theme.font.sans,
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLabels } from './chunk-APCWFOZW.js';
|
|
2
|
+
import { Icon } from './chunk-UXGIW7OK.js';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
import { Dimensions, Animated, Easing, View, StyleSheet, Pressable, Text, Modal } from 'react-native';
|
|
4
|
+
import { Dimensions, Animated, Easing, PanResponder, View, Platform, findNodeHandle, AccessibilityInfo, StyleSheet, Pressable, Text, Modal } from 'react-native';
|
|
4
5
|
import { createStyleSheet, useLoamTheme, useStyles } from '@btndprojects/loam-theme-native';
|
|
5
|
-
import {
|
|
6
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
7
|
|
|
8
|
+
var DEFAULT_LABELS = {
|
|
9
|
+
navigation: "Navigation",
|
|
10
|
+
close: "Close navigation"
|
|
11
|
+
};
|
|
7
12
|
var PANEL_FRACTION = 0.78;
|
|
13
|
+
var SWIPE_SLOP = 10;
|
|
14
|
+
var SWIPE_DISMISS_FRACTION = 0.3;
|
|
15
|
+
var SWIPE_FLICK_VELOCITY = 0.4;
|
|
8
16
|
var SPEC = {
|
|
9
17
|
/** Panel top padding, before the safe-area inset is added. */
|
|
10
18
|
panelPadTop: 34,
|
|
@@ -33,12 +41,15 @@ function NavDrawer({
|
|
|
33
41
|
userName,
|
|
34
42
|
userEmail,
|
|
35
43
|
avatarInitials,
|
|
36
|
-
closeLabel
|
|
44
|
+
closeLabel,
|
|
37
45
|
safeAreaTop = 0,
|
|
38
46
|
motion = "full",
|
|
39
|
-
inline = false
|
|
47
|
+
inline = false,
|
|
48
|
+
onOpen,
|
|
49
|
+
labels: labelsProp
|
|
40
50
|
}) {
|
|
41
|
-
const
|
|
51
|
+
const labels = useLabels("navDrawer", DEFAULT_LABELS, labelsProp);
|
|
52
|
+
const theme = useLoamTheme("nav-drawer");
|
|
42
53
|
const { styles } = useStyles(navDrawer);
|
|
43
54
|
const panelWidth = React.useMemo(() => Dimensions.get("window").width * PANEL_FRACTION, []);
|
|
44
55
|
const reducedMotion = theme.reduceMotion || motion === "reduced";
|
|
@@ -47,6 +58,17 @@ function NavDrawer({
|
|
|
47
58
|
const translateX = React.useRef(new Animated.Value(-panelWidth)).current;
|
|
48
59
|
const scrimOpacity = React.useRef(new Animated.Value(0)).current;
|
|
49
60
|
const panelOpacity = React.useRef(new Animated.Value(1)).current;
|
|
61
|
+
const scrimShown = React.useMemo(
|
|
62
|
+
() => Animated.multiply(
|
|
63
|
+
scrimOpacity,
|
|
64
|
+
translateX.interpolate({
|
|
65
|
+
inputRange: [-panelWidth, 0],
|
|
66
|
+
outputRange: [0, 1],
|
|
67
|
+
extrapolate: "clamp"
|
|
68
|
+
})
|
|
69
|
+
),
|
|
70
|
+
[scrimOpacity, translateX, panelWidth]
|
|
71
|
+
);
|
|
50
72
|
const slideDuration = theme.motion.enter.duration;
|
|
51
73
|
const slideEasing = React.useMemo(
|
|
52
74
|
() => Easing.bezier(...theme.motion.enter.easing),
|
|
@@ -54,6 +76,12 @@ function NavDrawer({
|
|
|
54
76
|
);
|
|
55
77
|
const fadeDuration = theme.duration.base;
|
|
56
78
|
const fadeEasing = React.useMemo(() => Easing.bezier(...theme.easing.base), [theme.easing.base]);
|
|
79
|
+
const exitSlideDuration = theme.motion.exit.duration;
|
|
80
|
+
const exitSlideEasing = React.useMemo(
|
|
81
|
+
() => Easing.bezier(...theme.motion.exit.easing),
|
|
82
|
+
[theme.motion.exit.easing]
|
|
83
|
+
);
|
|
84
|
+
const exitFadeDuration = Math.min(fadeDuration, exitSlideDuration);
|
|
57
85
|
const animateIn = React.useCallback(() => {
|
|
58
86
|
if (instantMotion) {
|
|
59
87
|
translateX.setValue(0);
|
|
@@ -121,13 +149,13 @@ function NavDrawer({
|
|
|
121
149
|
Animated.parallel([
|
|
122
150
|
Animated.timing(panelOpacity, {
|
|
123
151
|
toValue: 0,
|
|
124
|
-
duration:
|
|
152
|
+
duration: exitFadeDuration,
|
|
125
153
|
easing: fadeEasing,
|
|
126
154
|
useNativeDriver: true
|
|
127
155
|
}),
|
|
128
156
|
Animated.timing(scrimOpacity, {
|
|
129
157
|
toValue: 0,
|
|
130
|
-
duration:
|
|
158
|
+
duration: exitFadeDuration,
|
|
131
159
|
easing: fadeEasing,
|
|
132
160
|
useNativeDriver: true
|
|
133
161
|
})
|
|
@@ -139,13 +167,13 @@ function NavDrawer({
|
|
|
139
167
|
Animated.parallel([
|
|
140
168
|
Animated.timing(translateX, {
|
|
141
169
|
toValue: -panelWidth,
|
|
142
|
-
duration:
|
|
143
|
-
easing:
|
|
170
|
+
duration: exitSlideDuration,
|
|
171
|
+
easing: exitSlideEasing,
|
|
144
172
|
useNativeDriver: true
|
|
145
173
|
}),
|
|
146
174
|
Animated.timing(scrimOpacity, {
|
|
147
175
|
toValue: 0,
|
|
148
|
-
duration:
|
|
176
|
+
duration: exitFadeDuration,
|
|
149
177
|
easing: fadeEasing,
|
|
150
178
|
useNativeDriver: true
|
|
151
179
|
})
|
|
@@ -157,9 +185,9 @@ function NavDrawer({
|
|
|
157
185
|
scrimOpacity,
|
|
158
186
|
panelOpacity,
|
|
159
187
|
panelWidth,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
188
|
+
exitSlideDuration,
|
|
189
|
+
exitSlideEasing,
|
|
190
|
+
exitFadeDuration,
|
|
163
191
|
fadeEasing,
|
|
164
192
|
reducedMotion,
|
|
165
193
|
instantMotion
|
|
@@ -174,26 +202,76 @@ function NavDrawer({
|
|
|
174
202
|
React.useEffect(() => {
|
|
175
203
|
if (visible && open) animateIn();
|
|
176
204
|
}, [visible]);
|
|
205
|
+
const pan = React.useMemo(
|
|
206
|
+
() => PanResponder.create({
|
|
207
|
+
onMoveShouldSetPanResponder: (_e, g) => g.dx < -SWIPE_SLOP && Math.abs(g.dx) > Math.abs(g.dy) * 1.5,
|
|
208
|
+
onPanResponderMove: (_e, g) => {
|
|
209
|
+
translateX.setValue(Math.min(0, g.dx));
|
|
210
|
+
},
|
|
211
|
+
onPanResponderRelease: (_e, g) => {
|
|
212
|
+
if (g.dx < -panelWidth * SWIPE_DISMISS_FRACTION || g.vx < -SWIPE_FLICK_VELOCITY) {
|
|
213
|
+
onClose();
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
Animated.timing(translateX, {
|
|
217
|
+
toValue: 0,
|
|
218
|
+
duration: exitSlideDuration,
|
|
219
|
+
easing: exitSlideEasing,
|
|
220
|
+
useNativeDriver: true
|
|
221
|
+
}).start();
|
|
222
|
+
},
|
|
223
|
+
onPanResponderTerminate: () => translateX.setValue(0)
|
|
224
|
+
}),
|
|
225
|
+
[translateX, panelWidth, onClose, exitSlideDuration, exitSlideEasing]
|
|
226
|
+
);
|
|
227
|
+
const edgePan = React.useMemo(
|
|
228
|
+
() => PanResponder.create({
|
|
229
|
+
onMoveShouldSetPanResponder: (_e, g) => g.dx > SWIPE_SLOP && Math.abs(g.dx) > Math.abs(g.dy) * 1.5,
|
|
230
|
+
onPanResponderRelease: (_e, g) => {
|
|
231
|
+
if (g.dx > panelWidth * SWIPE_DISMISS_FRACTION || g.vx > SWIPE_FLICK_VELOCITY) onOpen?.();
|
|
232
|
+
}
|
|
233
|
+
}),
|
|
234
|
+
[panelWidth, onOpen]
|
|
235
|
+
);
|
|
236
|
+
const edge = onOpen && !open ? /* @__PURE__ */ jsx(
|
|
237
|
+
View,
|
|
238
|
+
{
|
|
239
|
+
testID: "nav-drawer-edge",
|
|
240
|
+
...edgePan.panHandlers,
|
|
241
|
+
style: styles.edge,
|
|
242
|
+
importantForAccessibility: "no-hide-descendants",
|
|
243
|
+
accessibilityElementsHidden: true
|
|
244
|
+
}
|
|
245
|
+
) : null;
|
|
246
|
+
const panelRef = React.useRef(null);
|
|
247
|
+
React.useEffect(() => {
|
|
248
|
+
if (!visible || !open || Platform.OS === "web") return;
|
|
249
|
+
const node = panelRef.current;
|
|
250
|
+
const tag = node ? findNodeHandle(node) : null;
|
|
251
|
+
if (tag !== null) AccessibilityInfo.setAccessibilityFocus(tag);
|
|
252
|
+
}, [visible, open]);
|
|
177
253
|
const handleItemPress = (item) => {
|
|
178
254
|
item.onPress?.();
|
|
179
255
|
onClose();
|
|
180
256
|
};
|
|
181
257
|
const body = /* @__PURE__ */ jsxs(View, { style: [styles.root, inline && StyleSheet.absoluteFill], children: [
|
|
182
|
-
/* @__PURE__ */ jsx(Animated.View, { style: [StyleSheet.absoluteFill, styles.scrim, { opacity:
|
|
258
|
+
/* @__PURE__ */ jsx(Animated.View, { style: [StyleSheet.absoluteFill, styles.scrim, { opacity: scrimShown }], children: /* @__PURE__ */ jsx(
|
|
183
259
|
Pressable,
|
|
184
260
|
{
|
|
185
261
|
style: StyleSheet.absoluteFill,
|
|
186
262
|
accessibilityRole: "button",
|
|
187
|
-
accessibilityLabel: closeLabel,
|
|
263
|
+
accessibilityLabel: closeLabel ?? labels.close,
|
|
188
264
|
onPress: onClose
|
|
189
265
|
}
|
|
190
266
|
) }),
|
|
191
267
|
/* @__PURE__ */ jsxs(
|
|
192
268
|
Animated.View,
|
|
193
269
|
{
|
|
270
|
+
ref: panelRef,
|
|
271
|
+
...pan.panHandlers,
|
|
194
272
|
accessibilityViewIsModal: true,
|
|
195
|
-
|
|
196
|
-
accessibilityLabel: userName ??
|
|
273
|
+
role: "navigation",
|
|
274
|
+
accessibilityLabel: userName ?? labels.navigation,
|
|
197
275
|
style: [
|
|
198
276
|
styles.panel,
|
|
199
277
|
{
|
|
@@ -217,9 +295,10 @@ function NavDrawer({
|
|
|
217
295
|
return /* @__PURE__ */ jsxs(
|
|
218
296
|
Pressable,
|
|
219
297
|
{
|
|
220
|
-
accessibilityRole: "
|
|
298
|
+
accessibilityRole: "link",
|
|
221
299
|
accessibilityLabel: item.label,
|
|
222
300
|
accessibilityState: { selected: active },
|
|
301
|
+
...active ? { "aria-current": "page" } : null,
|
|
223
302
|
onPress: () => handleItemPress(item),
|
|
224
303
|
style: [styles.item, active ? styles.itemActive : null],
|
|
225
304
|
children: [
|
|
@@ -234,24 +313,35 @@ function NavDrawer({
|
|
|
234
313
|
}
|
|
235
314
|
)
|
|
236
315
|
] });
|
|
237
|
-
if (inline) return visible ? body : /* @__PURE__ */ jsx(Fragment, {});
|
|
238
|
-
return /* @__PURE__ */
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
316
|
+
if (inline) return visible ? body : /* @__PURE__ */ jsx(Fragment, { children: edge });
|
|
317
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
318
|
+
edge,
|
|
319
|
+
/* @__PURE__ */ jsx(
|
|
320
|
+
Modal,
|
|
321
|
+
{
|
|
322
|
+
visible,
|
|
323
|
+
transparent: true,
|
|
324
|
+
animationType: "none",
|
|
325
|
+
onRequestClose: onClose,
|
|
326
|
+
statusBarTranslucent: true,
|
|
327
|
+
children: body
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
] });
|
|
249
331
|
}
|
|
250
332
|
var navDrawer = createStyleSheet((theme) => ({
|
|
251
333
|
root: {
|
|
252
334
|
flex: 1,
|
|
253
335
|
flexDirection: "row"
|
|
254
336
|
},
|
|
337
|
+
edge: {
|
|
338
|
+
position: "absolute",
|
|
339
|
+
left: 0,
|
|
340
|
+
top: 0,
|
|
341
|
+
bottom: 0,
|
|
342
|
+
// The closed-drawer edge strip that catches a swipe-to-open.
|
|
343
|
+
width: theme.space[20]
|
|
344
|
+
},
|
|
255
345
|
scrim: {
|
|
256
346
|
backgroundColor: theme.color.scrim,
|
|
257
347
|
zIndex: theme.z.overlay
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { expandedProps } from './chunk-
|
|
2
|
-
import { Icon } from './chunk-
|
|
1
|
+
import { expandedProps } from './chunk-W23G6JLF.js';
|
|
2
|
+
import { Icon } from './chunk-UXGIW7OK.js';
|
|
3
|
+
import { springConfig } from './chunk-J64KGCGX.js';
|
|
3
4
|
import * as React from 'react';
|
|
4
|
-
import { Platform, UIManager, LayoutAnimation, View, Animated,
|
|
5
|
+
import { Platform, UIManager, LayoutAnimation, View, Animated, Pressable, Text } from 'react-native';
|
|
5
6
|
import { createStyleSheet, useStyles, useLoamTheme } from '@btndprojects/loam-theme-native';
|
|
6
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
8
|
|
|
@@ -31,13 +32,12 @@ function Accordion({
|
|
|
31
32
|
value,
|
|
32
33
|
defaultValue,
|
|
33
34
|
onValueChange,
|
|
34
|
-
anchored = false,
|
|
35
35
|
motion = "full",
|
|
36
36
|
items,
|
|
37
37
|
children
|
|
38
38
|
}) {
|
|
39
39
|
const { styles } = useStyles(sheet);
|
|
40
|
-
const theme = useLoamTheme();
|
|
40
|
+
const theme = useLoamTheme("accordion");
|
|
41
41
|
const effectiveMotion = motion === "none" ? "none" : theme.reduceMotion ? "reduced" : motion;
|
|
42
42
|
const isControlled = value !== void 0;
|
|
43
43
|
const [internal, setInternal] = React.useState(() => toArray(defaultValue));
|
|
@@ -54,15 +54,15 @@ function Accordion({
|
|
|
54
54
|
});
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
+
const ds = theme.spring.ds;
|
|
58
|
+
const fade = theme.spring.fe.duration;
|
|
57
59
|
LayoutAnimation.configureNext({
|
|
58
|
-
duration,
|
|
59
|
-
update: { type:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
delete: { type: type2, property: LayoutAnimation.Properties.opacity, duration }
|
|
63
|
-
} : {}
|
|
60
|
+
duration: ds.duration,
|
|
61
|
+
update: { type: LayoutAnimation.Types.spring, springDamping: ds.dampingRatio },
|
|
62
|
+
create: { type: LayoutAnimation.Types.easeOut, property: LayoutAnimation.Properties.opacity, duration: fade },
|
|
63
|
+
delete: { type: LayoutAnimation.Types.easeOut, property: LayoutAnimation.Properties.opacity, duration: fade }
|
|
64
64
|
});
|
|
65
|
-
}, [
|
|
65
|
+
}, [effectiveMotion, theme.motion.expand.duration, theme.spring.ds, theme.spring.fe.duration]);
|
|
66
66
|
const commit = React.useCallback(
|
|
67
67
|
(next) => {
|
|
68
68
|
if (!isControlled) setInternal(next);
|
|
@@ -113,7 +113,7 @@ function AccordionTrigger({ children }) {
|
|
|
113
113
|
const { isOpen, toggle, motion } = useAccordionContext();
|
|
114
114
|
const { value } = useAccordionItemContext();
|
|
115
115
|
const { styles } = useStyles(sheet);
|
|
116
|
-
const theme = useLoamTheme();
|
|
116
|
+
const theme = useLoamTheme("accordion");
|
|
117
117
|
const expanded = isOpen(value);
|
|
118
118
|
const rotate = React.useRef(new Animated.Value(expanded ? 1 : 0)).current;
|
|
119
119
|
React.useEffect(() => {
|
|
@@ -121,14 +121,12 @@ function AccordionTrigger({ children }) {
|
|
|
121
121
|
rotate.setValue(expanded ? 1 : 0);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
Animated.spring(rotate, {
|
|
125
|
+
...springConfig(theme, "ds"),
|
|
126
126
|
toValue: expanded ? 1 : 0,
|
|
127
|
-
duration: spec.duration,
|
|
128
|
-
easing: Easing.bezier(...spec.easing),
|
|
129
127
|
useNativeDriver: true
|
|
130
128
|
}).start();
|
|
131
|
-
}, [expanded, motion, rotate, theme
|
|
129
|
+
}, [expanded, motion, rotate, theme]);
|
|
132
130
|
const rotation = rotate.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "180deg"] });
|
|
133
131
|
return /* @__PURE__ */ jsxs(
|
|
134
132
|
Pressable,
|
package/dist/coachmark/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import '../chunk-J4KLDGI4.js';
|
|
2
|
-
export { Coachmark, CoachmarkArrow, CoachmarkDots, CoachmarkHint, Hotspot } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
2
|
+
export { Coachmark, CoachmarkArrow, CoachmarkDots, CoachmarkHint, Hotspot } from '../chunk-YAAHPATV.js';
|
|
3
|
+
import '../chunk-H7DWSL4O.js';
|
|
4
|
+
import '../chunk-APCWFOZW.js';
|
|
5
|
+
import '../chunk-UXGIW7OK.js';
|
|
6
|
+
import '../chunk-J64KGCGX.js';
|
|
7
|
+
import '../chunk-I2KLQ2HA.js';
|
package/dist/code-block/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import '../chunk-ZK2H4O5P.js';
|
|
2
|
-
export { CodeBlock } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
2
|
+
export { CodeBlock } from '../chunk-RXSCIO6W.js';
|
|
3
|
+
import '../chunk-C6APNDVA.js';
|
|
4
|
+
import '../chunk-APCWFOZW.js';
|
|
5
|
+
import '../chunk-UXGIW7OK.js';
|
|
6
|
+
import '../chunk-I2KLQ2HA.js';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export { ColorField } from '../chunk-
|
|
1
|
+
export { ColorField } from '../chunk-W63AJTM7.js';
|
|
2
2
|
import '../chunk-KTAC4MGE.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-7BUIKDD6.js';
|
|
4
4
|
import '../chunk-3NMD74ZU.js';
|
|
5
5
|
import '../chunk-NY2U3PBI.js';
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-APCWFOZW.js';
|
|
7
|
+
import '../chunk-UXGIW7OK.js';
|
|
8
|
+
import '../chunk-J64KGCGX.js';
|
|
9
|
+
import '../chunk-I2KLQ2HA.js';
|