@krizaka/ui 3.74.0 → 3.75.0
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 +2 -6
- package/dist/{chunk-GSQRSWOE.js → chunk-RI3AA2E3.js} +3 -3
- package/dist/{chunk-E4FMPPDL.js → chunk-WC3SO4CE.js} +2 -2
- package/dist/{chunk-KF7UB3LM.js → chunk-YQWYGQTV.js} +11 -9
- package/dist/{chunk-KF7UB3LM.js.map → chunk-YQWYGQTV.js.map} +1 -1
- package/dist/{chunk-M3GEYLMR.js → chunk-ZPOVOEO3.js} +1 -2
- package/dist/data-table.js +3 -3
- package/dist/filter-bar.d.ts +12 -4
- package/dist/filter-bar.js +1 -1
- package/dist/gallery-page.js +3 -3
- package/dist/genui.js +101 -35
- package/dist/genui.js.map +1 -1
- package/dist/language-switch.d.ts +9 -9
- package/dist/{lightbox-D5NAHFEA.js → lightbox-Q45BZ3HW.js} +3 -3
- package/dist/match-dialog.js +2 -2
- package/dist/motion.css +1 -25
- package/dist/native/list.js +1 -1
- package/dist/native/list.js.map +1 -1
- package/dist/native.d.ts +2 -54
- package/dist/native.js +464 -560
- package/dist/native.js.map +1 -1
- package/dist/product-page.js +3 -3
- package/dist/shop-gallery.js +1 -1
- package/dist/tag-selector.js +16 -10
- package/dist/tag-selector.js.map +1 -1
- package/dist/vertical-video.js +1 -1
- package/dist/waveform.js.map +1 -1
- package/package.json +5 -81
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +1 -1
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-frame.json +2 -2
- package/registry/app-header.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +3 -3
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/collection-switcher.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/copy-button.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/desktop-window.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +1 -1
- package/registry/embed-facade.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/entity-header.json +1 -1
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +2 -2
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +10 -185
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/margin-layout.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/media-gallery.json +3 -14
- package/registry/meter.json +1 -1
- package/registry/money-input.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/price-catalogue-editor.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +2 -6
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/promo-code-field.json +1 -1
- package/registry/proposal.json +1 -1
- package/registry/qr-code.json +1 -1
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/rail-nav.json +2 -2
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +2 -3
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/schema-form.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +1 -1
- package/registry/shop-gallery.json +3 -8
- package/registry/shop.json +2 -2
- package/registry/showcase.json +2 -7
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +2 -2
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-chip.json +1 -1
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +1 -1
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +3 -4
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +2 -2
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/text-style.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/usage.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +2 -6
- package/registry/video-player.json +2 -7
- package/registry/video-trimmer.json +3 -4
- package/registry/virtual.json +1 -1
- package/registry/wall.json +3 -9
- package/registry/waveform.json +4 -9
- package/dist/audio-player.d.ts +0 -115
- package/dist/audio-player.js +0 -211
- package/dist/audio-player.js.map +0 -1
- package/dist/chunk-YKOLME7R.js +0 -126
- package/dist/chunk-YKOLME7R.js.map +0 -1
- package/dist/how-it-works-page.d.ts +0 -49
- package/dist/how-it-works-page.js +0 -28
- package/dist/how-it-works-page.js.map +0 -1
- package/dist/marquee.d.ts +0 -34
- package/dist/marquee.js +0 -52
- package/dist/marquee.js.map +0 -1
- package/dist/media-grid.d.ts +0 -246
- package/dist/media-grid.js +0 -468
- package/dist/media-grid.js.map +0 -1
- package/dist/photo-grid.d.ts +0 -123
- package/dist/photo-grid.js +0 -94
- package/dist/photo-grid.js.map +0 -1
- package/registry/audio-player.json +0 -300
- package/registry/examples/audio-player/podcast.d.ts +0 -4
- package/registry/examples/audio-player/podcast.js +0 -22
- package/registry/examples/audio-player/podcast.tsx +0 -19
- package/registry/examples/audio-player/voice-note.d.ts +0 -4
- package/registry/examples/audio-player/voice-note.js +0 -12
- package/registry/examples/audio-player/voice-note.tsx +0 -12
- package/registry/examples/how-it-works-page/orazaka.d.ts +0 -4
- package/registry/examples/how-it-works-page/orazaka.js +0 -30
- package/registry/examples/how-it-works-page/orazaka.tsx +0 -26
- package/registry/examples/marquee/cards.d.ts +0 -4
- package/registry/examples/marquee/cards.js +0 -23
- package/registry/examples/marquee/cards.tsx +0 -21
- package/registry/examples/marquee/logos.d.ts +0 -4
- package/registry/examples/marquee/logos.js +0 -12
- package/registry/examples/marquee/logos.tsx +0 -17
- package/registry/examples/media-grid/feed.d.ts +0 -4
- package/registry/examples/media-grid/feed.js +0 -31
- package/registry/examples/media-grid/feed.tsx +0 -30
- package/registry/examples/media-grid/loading.d.ts +0 -4
- package/registry/examples/media-grid/loading.js +0 -28
- package/registry/examples/media-grid/loading.tsx +0 -25
- package/registry/examples/media-grid/uniform.d.ts +0 -4
- package/registry/examples/media-grid/uniform.js +0 -29
- package/registry/examples/media-grid/uniform.tsx +0 -26
- package/registry/examples/photo-grid/native/profile-photos.d.ts +0 -4
- package/registry/examples/photo-grid/native/profile-photos.dark.png +0 -0
- package/registry/examples/photo-grid/native/profile-photos.js +0 -27
- package/registry/examples/photo-grid/native/profile-photos.light.png +0 -0
- package/registry/examples/photo-grid/native/profile-photos.tsx +0 -24
- package/registry/examples/photo-grid/profile-photos.d.ts +0 -4
- package/registry/examples/photo-grid/profile-photos.js +0 -28
- package/registry/examples/photo-grid/profile-photos.tsx +0 -25
- package/registry/how-it-works-page.json +0 -258
- package/registry/marquee.json +0 -241
- package/registry/media-grid.json +0 -1034
- package/registry/photo-grid.json +0 -316
- /package/dist/{chunk-GSQRSWOE.js.map → chunk-RI3AA2E3.js.map} +0 -0
- /package/dist/{chunk-E4FMPPDL.js.map → chunk-WC3SO4CE.js.map} +0 -0
- /package/dist/{chunk-M3GEYLMR.js.map → chunk-ZPOVOEO3.js.map} +0 -0
- /package/dist/{lightbox-D5NAHFEA.js.map → lightbox-Q45BZ3HW.js.map} +0 -0
package/dist/native.js
CHANGED
|
@@ -5226,114 +5226,19 @@ function Phoenix({ tone: tone3 = "own", size = 120, animated = true, title, styl
|
|
|
5226
5226
|
] }) }) });
|
|
5227
5227
|
}
|
|
5228
5228
|
|
|
5229
|
-
// src/native/
|
|
5229
|
+
// src/native/profile-card.tsx
|
|
5230
5230
|
import * as React39 from "react";
|
|
5231
|
-
import {
|
|
5232
|
-
import Svg21, {
|
|
5231
|
+
import { Animated as Animated18, StyleSheet as StyleSheet46, View as View51 } from "react-native";
|
|
5232
|
+
import Svg21, { Defs as Defs9, LinearGradient as LinearGradient8, Rect as Rect3, Stop as Stop9 } from "react-native-svg";
|
|
5233
5233
|
import { jsx as jsx57, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5234
|
-
function PhotoGrid({ value, onValueChange, onAdd, slots = 6, required = 1, columns = 3, labels, style }) {
|
|
5235
|
-
const { theme, radius: radius3, haptic } = useTheme();
|
|
5236
|
-
const [menu, setMenu] = React39.useState(null);
|
|
5237
|
-
const move2 = (from, to) => {
|
|
5238
|
-
if (to < 0 || to >= value.length || from === to) return;
|
|
5239
|
-
const next = [...value];
|
|
5240
|
-
const [photo] = next.splice(from, 1);
|
|
5241
|
-
next.splice(to, 0, photo);
|
|
5242
|
-
haptic("selection");
|
|
5243
|
-
onValueChange(next);
|
|
5244
|
-
};
|
|
5245
|
-
const remove = (i) => {
|
|
5246
|
-
haptic("impact");
|
|
5247
|
-
onValueChange(value.filter((_, j) => j !== i));
|
|
5248
|
-
};
|
|
5249
|
-
const width = `${100 / columns}%`;
|
|
5250
|
-
return /* @__PURE__ */ jsxs51(View51, { style: [styles46.grid, style], children: [
|
|
5251
|
-
Array.from({ length: slots }, (_, i) => {
|
|
5252
|
-
const photo = value[i];
|
|
5253
|
-
const cell = [styles46.slot, { borderRadius: radius3.lg, aspectRatio: 3 / 4 }];
|
|
5254
|
-
return /* @__PURE__ */ jsx57(View51, { style: [styles46.cell, { width }], children: photo ? /* @__PURE__ */ jsxs51(
|
|
5255
|
-
Pressable25,
|
|
5256
|
-
{
|
|
5257
|
-
role: "button",
|
|
5258
|
-
"aria-label": [labels.photo(i + 1), photo.alt, i === 0 ? labels.main : null].filter(Boolean).join(", "),
|
|
5259
|
-
onPress: () => setMenu(i),
|
|
5260
|
-
onLongPress: () => {
|
|
5261
|
-
haptic("impact");
|
|
5262
|
-
setMenu(i);
|
|
5263
|
-
},
|
|
5264
|
-
accessibilityActions: [
|
|
5265
|
-
...i > 0 ? [{ name: "makeMain", label: labels.makeMain }, { name: "earlier", label: labels.moveEarlier }] : [],
|
|
5266
|
-
...i < value.length - 1 ? [{ name: "later", label: labels.moveLater }] : [],
|
|
5267
|
-
{ name: "remove", label: labels.remove }
|
|
5268
|
-
],
|
|
5269
|
-
onAccessibilityAction: (e) => {
|
|
5270
|
-
const name = e.nativeEvent.actionName;
|
|
5271
|
-
if (name === "makeMain") move2(i, 0);
|
|
5272
|
-
if (name === "earlier") move2(i, i - 1);
|
|
5273
|
-
if (name === "later") move2(i, i + 1);
|
|
5274
|
-
if (name === "remove") remove(i);
|
|
5275
|
-
},
|
|
5276
|
-
style: [...cell, { backgroundColor: theme.surface3, overflow: "hidden" }],
|
|
5277
|
-
children: [
|
|
5278
|
-
/* @__PURE__ */ jsx57(Image4, { source: { uri: photo.uri }, style: StyleSheet46.absoluteFill, resizeMode: "cover" }),
|
|
5279
|
-
i === 0 ? /* @__PURE__ */ jsx57(View51, { style: [styles46.main, { backgroundColor: theme.accent, borderRadius: radius3.full }], children: /* @__PURE__ */ jsx57(Txt, { variant: "caption", tone: "onAccent", style: styles46.mainText, children: labels.main }) }) : null
|
|
5280
|
-
]
|
|
5281
|
-
}
|
|
5282
|
-
) : /* @__PURE__ */ jsx57(
|
|
5283
|
-
Pressable25,
|
|
5284
|
-
{
|
|
5285
|
-
role: "button",
|
|
5286
|
-
"aria-label": labels.add,
|
|
5287
|
-
disabled: !onAdd || i > value.length,
|
|
5288
|
-
onPress: onAdd,
|
|
5289
|
-
style: ({ pressed }) => [
|
|
5290
|
-
...cell,
|
|
5291
|
-
styles46.empty,
|
|
5292
|
-
{ borderColor: i < required ? theme.accent : theme.borderStrong, backgroundColor: pressed ? theme.surface2 : theme.surface1, opacity: i > value.length ? 0.5 : 1 }
|
|
5293
|
-
],
|
|
5294
|
-
children: /* @__PURE__ */ jsx57(View51, { style: [styles46.plus, { backgroundColor: i === value.length ? theme.accent : theme.surface3, borderRadius: radius3.full }], children: /* @__PURE__ */ jsx57(Svg21, { width: 16, height: 16, viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsx57(Path18, { d: "M12 5v14M5 12h14", stroke: i === value.length ? theme.onAccent : theme.textSecondary, strokeWidth: 2.6, strokeLinecap: "round" }) }) })
|
|
5295
|
-
}
|
|
5296
|
-
) }, photo?.id ?? `empty-${i}`);
|
|
5297
|
-
}),
|
|
5298
|
-
/* @__PURE__ */ jsx57(
|
|
5299
|
-
ActionSheet,
|
|
5300
|
-
{
|
|
5301
|
-
open: menu !== null,
|
|
5302
|
-
onOpenChange: (open) => !open && setMenu(null),
|
|
5303
|
-
title: menu !== null ? labels.photo(menu + 1) : "",
|
|
5304
|
-
cancelLabel: labels.cancel,
|
|
5305
|
-
actions: menu === null ? [] : [
|
|
5306
|
-
...menu > 0 ? [{ label: labels.makeMain, onPress: () => move2(menu, 0) }, { label: labels.moveEarlier, onPress: () => move2(menu, menu - 1) }] : [],
|
|
5307
|
-
...menu < value.length - 1 ? [{ label: labels.moveLater, onPress: () => move2(menu, menu + 1) }] : [],
|
|
5308
|
-
{ label: labels.remove, destructive: true, onPress: () => remove(menu) }
|
|
5309
|
-
]
|
|
5310
|
-
}
|
|
5311
|
-
)
|
|
5312
|
-
] });
|
|
5313
|
-
}
|
|
5314
|
-
var styles46 = StyleSheet46.create({
|
|
5315
|
-
grid: { flexDirection: "row", flexWrap: "wrap", marginHorizontal: -4 },
|
|
5316
|
-
cell: { padding: 4 },
|
|
5317
|
-
slot: { width: "100%" },
|
|
5318
|
-
empty: { borderWidth: 1.5, borderStyle: "dashed", alignItems: "center", justifyContent: "center" },
|
|
5319
|
-
plus: { width: 32, height: 32, alignItems: "center", justifyContent: "center" },
|
|
5320
|
-
main: { position: "absolute", left: 6, bottom: 6, paddingHorizontal: 8, paddingVertical: 2 },
|
|
5321
|
-
mainText: { fontWeight: "800", textTransform: "uppercase", letterSpacing: 0.5 }
|
|
5322
|
-
});
|
|
5323
|
-
|
|
5324
|
-
// src/native/profile-card.tsx
|
|
5325
|
-
import * as React40 from "react";
|
|
5326
|
-
import { Animated as Animated18, StyleSheet as StyleSheet47, View as View52 } from "react-native";
|
|
5327
|
-
import Svg22, { Defs as Defs9, LinearGradient as LinearGradient8, Rect as Rect3, Stop as Stop9 } from "react-native-svg";
|
|
5328
|
-
import { jsx as jsx58, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5329
5234
|
var ratioOf = (value, max = 100) => Math.min(1, Math.max(0, value / (max || 1)));
|
|
5330
5235
|
function Bar({ label, ratio, words: words2, animated, delay }) {
|
|
5331
5236
|
const { theme } = useTheme();
|
|
5332
5237
|
const t = useEntrance(animated, delay, 900);
|
|
5333
|
-
const [width, setWidth] =
|
|
5238
|
+
const [width, setWidth] = React39.useState(0);
|
|
5334
5239
|
const translateX = t.interpolate({ inputRange: [0, 1], outputRange: [-width * ratio, 0] });
|
|
5335
|
-
return /* @__PURE__ */
|
|
5336
|
-
|
|
5240
|
+
return /* @__PURE__ */ jsx57(
|
|
5241
|
+
View51,
|
|
5337
5242
|
{
|
|
5338
5243
|
accessible: true,
|
|
5339
5244
|
role: "meter",
|
|
@@ -5343,42 +5248,42 @@ function Bar({ label, ratio, words: words2, animated, delay }) {
|
|
|
5343
5248
|
"aria-valuenow": Math.round(ratio * 100),
|
|
5344
5249
|
"aria-valuetext": words2,
|
|
5345
5250
|
onLayout: (e) => setWidth(e.nativeEvent.layout.width),
|
|
5346
|
-
style: [
|
|
5347
|
-
children: /* @__PURE__ */
|
|
5251
|
+
style: [styles46.track, { backgroundColor: theme.surface3 }],
|
|
5252
|
+
children: /* @__PURE__ */ jsx57(Animated18.View, { style: [styles46.fill, { width: `${ratio * 100}%`, backgroundColor: theme.accent, transform: [{ translateX }] }] })
|
|
5348
5253
|
}
|
|
5349
5254
|
);
|
|
5350
5255
|
}
|
|
5351
5256
|
function ProfileCard({ visual, name, statLabel, value = 100, valueText, stats, caption, children, animated = true, style, ...props }) {
|
|
5352
5257
|
const { theme, radius: radius3 } = useTheme();
|
|
5353
5258
|
const ratio = ratioOf(value);
|
|
5354
|
-
return /* @__PURE__ */
|
|
5355
|
-
/* @__PURE__ */
|
|
5356
|
-
/* @__PURE__ */
|
|
5357
|
-
/* @__PURE__ */
|
|
5358
|
-
statLabel ? /* @__PURE__ */
|
|
5259
|
+
return /* @__PURE__ */ jsxs51(View51, { ...props, style: [styles46.root, { backgroundColor: theme.surface1, borderColor: theme.borderSubtle, borderRadius: radius3.xl }, style], children: [
|
|
5260
|
+
/* @__PURE__ */ jsx57(View51, { "aria-hidden": true, style: [styles46.disc, { backgroundColor: theme.surface2, borderColor: theme.accentSoft }], children: visual }),
|
|
5261
|
+
/* @__PURE__ */ jsxs51(View51, { style: styles46.head, children: [
|
|
5262
|
+
/* @__PURE__ */ jsx57(Txt, { variant: "title", style: styles46.name, children: name }),
|
|
5263
|
+
statLabel ? /* @__PURE__ */ jsxs51(Txt, { variant: "caption", tone: "secondary", children: [
|
|
5359
5264
|
statLabel,
|
|
5360
5265
|
" ",
|
|
5361
|
-
/* @__PURE__ */
|
|
5266
|
+
/* @__PURE__ */ jsx57(Txt, { variant: "caption", children: valueText ?? `${Math.round(ratio * 100)} %` })
|
|
5362
5267
|
] }) : null
|
|
5363
5268
|
] }),
|
|
5364
|
-
statLabel ? /* @__PURE__ */
|
|
5269
|
+
statLabel ? /* @__PURE__ */ jsx57(Bar, { label: statLabel, ratio, words: valueText ?? `${Math.round(ratio * 100)} %`, animated, delay: 200 }) : null,
|
|
5365
5270
|
stats?.map((s, i) => {
|
|
5366
5271
|
const r = ratioOf(s.value, s.max);
|
|
5367
5272
|
const words2 = s.valueText ?? `${Math.round(r * 100)} %`;
|
|
5368
|
-
return /* @__PURE__ */
|
|
5369
|
-
/* @__PURE__ */
|
|
5370
|
-
/* @__PURE__ */
|
|
5371
|
-
/* @__PURE__ */
|
|
5273
|
+
return /* @__PURE__ */ jsxs51(View51, { style: styles46.stat, children: [
|
|
5274
|
+
/* @__PURE__ */ jsxs51(View51, { "aria-hidden": true, style: styles46.statHead, children: [
|
|
5275
|
+
/* @__PURE__ */ jsx57(Txt, { variant: "caption", tone: "secondary", children: s.label }),
|
|
5276
|
+
/* @__PURE__ */ jsx57(Txt, { variant: "caption", children: words2 })
|
|
5372
5277
|
] }),
|
|
5373
|
-
/* @__PURE__ */
|
|
5278
|
+
/* @__PURE__ */ jsx57(Bar, { label: s.label, ratio: r, words: words2, animated, delay: 320 + i * 120 })
|
|
5374
5279
|
] }, s.label);
|
|
5375
5280
|
}),
|
|
5376
|
-
caption ? /* @__PURE__ */
|
|
5377
|
-
children ? /* @__PURE__ */
|
|
5281
|
+
caption ? /* @__PURE__ */ jsx57(Txt, { variant: "caption", tone: "secondary", style: styles46.caption, children: caption }) : null,
|
|
5282
|
+
children ? /* @__PURE__ */ jsx57(View51, { style: styles46.extra, children }) : null
|
|
5378
5283
|
] });
|
|
5379
5284
|
}
|
|
5380
|
-
var
|
|
5381
|
-
root: { alignItems: "center", gap: 12, padding: 20, borderWidth:
|
|
5285
|
+
var styles46 = StyleSheet46.create({
|
|
5286
|
+
root: { alignItems: "center", gap: 12, padding: 20, borderWidth: StyleSheet46.hairlineWidth },
|
|
5382
5287
|
disc: { width: 104, height: 104, borderRadius: 52, borderWidth: 1, alignItems: "center", justifyContent: "center", overflow: "hidden" },
|
|
5383
5288
|
head: { flexDirection: "row", alignSelf: "stretch", alignItems: "center", justifyContent: "space-between", gap: 8 },
|
|
5384
5289
|
name: { flexShrink: 1, fontSize: 17 },
|
|
@@ -5391,29 +5296,29 @@ var styles47 = StyleSheet47.create({
|
|
|
5391
5296
|
});
|
|
5392
5297
|
function ProfileBanner({ banner, avatar, eyebrow, title, status, meta, actions, style, ...props }) {
|
|
5393
5298
|
const { theme, radius: radius3 } = useTheme();
|
|
5394
|
-
const id = `kz-banner-${
|
|
5395
|
-
return /* @__PURE__ */
|
|
5396
|
-
/* @__PURE__ */
|
|
5397
|
-
/* @__PURE__ */
|
|
5398
|
-
/* @__PURE__ */
|
|
5399
|
-
/* @__PURE__ */
|
|
5400
|
-
/* @__PURE__ */
|
|
5299
|
+
const id = `kz-banner-${React39.useId().replace(/:/g, "")}`;
|
|
5300
|
+
return /* @__PURE__ */ jsxs51(View51, { style: [bannerStyles.root, style], ...props, children: [
|
|
5301
|
+
/* @__PURE__ */ jsx57(View51, { "aria-hidden": true, style: [bannerStyles.cover, { borderRadius: radius3.lg, backgroundColor: theme.accentSoft }], children: banner ?? /* @__PURE__ */ jsxs51(Svg21, { width: "100%", height: "100%", preserveAspectRatio: "none", viewBox: "0 0 100 100", children: [
|
|
5302
|
+
/* @__PURE__ */ jsx57(Defs9, { children: /* @__PURE__ */ jsxs51(LinearGradient8, { id, x1: "0", y1: "0", x2: "1", y2: "1", children: [
|
|
5303
|
+
/* @__PURE__ */ jsx57(Stop9, { offset: "0", stopColor: theme.accent, stopOpacity: 0.3 }),
|
|
5304
|
+
/* @__PURE__ */ jsx57(Stop9, { offset: "0.5", stopColor: theme.accentSoft }),
|
|
5305
|
+
/* @__PURE__ */ jsx57(Stop9, { offset: "1", stopColor: theme.surface2 })
|
|
5401
5306
|
] }) }),
|
|
5402
|
-
/* @__PURE__ */
|
|
5307
|
+
/* @__PURE__ */ jsx57(Rect3, { x: "0", y: "0", width: "100", height: "100", fill: `url(#${id})` })
|
|
5403
5308
|
] }) }),
|
|
5404
|
-
/* @__PURE__ */
|
|
5405
|
-
/* @__PURE__ */
|
|
5406
|
-
eyebrow ? /* @__PURE__ */
|
|
5407
|
-
/* @__PURE__ */
|
|
5408
|
-
/* @__PURE__ */
|
|
5309
|
+
/* @__PURE__ */ jsx57(View51, { style: [bannerStyles.avatar, { borderColor: theme.surface0, backgroundColor: theme.surface3, borderRadius: radius3.lg }], children: avatar }),
|
|
5310
|
+
/* @__PURE__ */ jsxs51(View51, { style: bannerStyles.text, children: [
|
|
5311
|
+
eyebrow ? /* @__PURE__ */ jsx57(Txt, { variant: "mono", tone: "accent", children: eyebrow }) : null,
|
|
5312
|
+
/* @__PURE__ */ jsxs51(View51, { style: bannerStyles.titleRow, children: [
|
|
5313
|
+
/* @__PURE__ */ jsx57(Txt, { variant: "title", role: "heading", style: bannerStyles.title, children: title }),
|
|
5409
5314
|
status
|
|
5410
5315
|
] }),
|
|
5411
|
-
meta ? /* @__PURE__ */
|
|
5316
|
+
meta ? /* @__PURE__ */ jsx57(Txt, { tone: "secondary", children: meta }) : null
|
|
5412
5317
|
] }),
|
|
5413
|
-
actions ? /* @__PURE__ */
|
|
5318
|
+
actions ? /* @__PURE__ */ jsx57(View51, { style: bannerStyles.actions, children: actions }) : null
|
|
5414
5319
|
] });
|
|
5415
5320
|
}
|
|
5416
|
-
var bannerStyles =
|
|
5321
|
+
var bannerStyles = StyleSheet46.create({
|
|
5417
5322
|
root: { gap: 10 },
|
|
5418
5323
|
cover: { height: 112, width: "100%", overflow: "hidden" },
|
|
5419
5324
|
avatar: { width: 80, height: 80, marginTop: -50, marginLeft: 4, borderWidth: 4, overflow: "hidden", alignItems: "center", justifyContent: "center" },
|
|
@@ -5424,10 +5329,10 @@ var bannerStyles = StyleSheet47.create({
|
|
|
5424
5329
|
});
|
|
5425
5330
|
|
|
5426
5331
|
// src/native/progress.tsx
|
|
5427
|
-
import * as
|
|
5428
|
-
import { Animated as Animated19, Easing as Easing10, StyleSheet as
|
|
5429
|
-
import
|
|
5430
|
-
import { jsx as
|
|
5332
|
+
import * as React40 from "react";
|
|
5333
|
+
import { Animated as Animated19, Easing as Easing10, StyleSheet as StyleSheet47, View as View52 } from "react-native";
|
|
5334
|
+
import Svg22, { Circle as Circle11, Defs as Defs10, LinearGradient as LinearGradient9, Rect as Rect4, Stop as Stop10 } from "react-native-svg";
|
|
5335
|
+
import { jsx as jsx58, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5431
5336
|
var AnimatedCircle = Animated19.createAnimatedComponent(Circle11);
|
|
5432
5337
|
var BAR2 = { sm: 4, md: 8, lg: 12 };
|
|
5433
5338
|
var RING2 = { sm: 40, md: 80, lg: 144 };
|
|
@@ -5439,10 +5344,10 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
5439
5344
|
const known = typeof value === "number" && Number.isFinite(value);
|
|
5440
5345
|
const ratio = known ? Math.min(1, Math.max(0, value / (max || 1))) : 0;
|
|
5441
5346
|
const percent2 = Math.round(ratio * 100);
|
|
5442
|
-
const [progress] =
|
|
5443
|
-
const [spin] =
|
|
5444
|
-
const [track, setTrack] =
|
|
5445
|
-
|
|
5347
|
+
const [progress] = React40.useState(() => new Animated19.Value(ratio));
|
|
5348
|
+
const [spin] = React40.useState(() => new Animated19.Value(0));
|
|
5349
|
+
const [track, setTrack] = React40.useState(0);
|
|
5350
|
+
React40.useEffect(() => {
|
|
5446
5351
|
if (reduce) {
|
|
5447
5352
|
progress.setValue(ratio);
|
|
5448
5353
|
return;
|
|
@@ -5451,7 +5356,7 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
5451
5356
|
animation.start();
|
|
5452
5357
|
return () => animation.stop();
|
|
5453
5358
|
}, [ratio, reduce, progress]);
|
|
5454
|
-
|
|
5359
|
+
React40.useEffect(() => {
|
|
5455
5360
|
if (known || reduce) return;
|
|
5456
5361
|
const loop = Animated19.loop(Animated19.timing(spin, { toValue: 1, duration: 1200, easing: Easing10.linear, useNativeDriver: true }));
|
|
5457
5362
|
loop.start();
|
|
@@ -5469,9 +5374,9 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
5469
5374
|
"aria-valuenow": known ? Math.min(max, Math.max(0, value)) : void 0,
|
|
5470
5375
|
"aria-valuetext": known ? valueText ?? `${percent2}%` : valueText
|
|
5471
5376
|
};
|
|
5472
|
-
const gradient = /* @__PURE__ */
|
|
5473
|
-
/* @__PURE__ */
|
|
5474
|
-
/* @__PURE__ */
|
|
5377
|
+
const gradient = /* @__PURE__ */ jsx58(Defs10, { children: /* @__PURE__ */ jsxs52(LinearGradient9, { id, x1: "0", y1: "0", x2: "1", y2: variant === "ring" ? "1" : "0", children: [
|
|
5378
|
+
/* @__PURE__ */ jsx58(Stop10, { offset: "0", stopColor: theme.accent }),
|
|
5379
|
+
/* @__PURE__ */ jsx58(Stop10, { offset: "1", stopColor: theme.accent2 })
|
|
5475
5380
|
] }) });
|
|
5476
5381
|
if (variant === "ring") {
|
|
5477
5382
|
const side = RING2[size];
|
|
@@ -5480,11 +5385,11 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
5480
5385
|
const circumference = 2 * Math.PI * r;
|
|
5481
5386
|
const offset = known ? progress.interpolate({ inputRange: [0, 1], outputRange: [circumference, 0] }) : circumference * 0.75;
|
|
5482
5387
|
const rotate = spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] });
|
|
5483
|
-
return /* @__PURE__ */
|
|
5484
|
-
/* @__PURE__ */
|
|
5388
|
+
return /* @__PURE__ */ jsxs52(View52, { ...a11y, style: [styles47.ring, { width: side, height: side }, style], children: [
|
|
5389
|
+
/* @__PURE__ */ jsx58(Animated19.View, { style: [StyleSheet47.absoluteFill, { transform: [{ rotate: known ? "-90deg" : rotate }] }], children: /* @__PURE__ */ jsxs52(Svg22, { width: side, height: side, viewBox: "0 0 100 100", children: [
|
|
5485
5390
|
gradient,
|
|
5486
|
-
/* @__PURE__ */
|
|
5487
|
-
/* @__PURE__ */
|
|
5391
|
+
/* @__PURE__ */ jsx58(Circle11, { cx: 50, cy: 50, r, fill: "none", stroke: theme.borderDefault, strokeWidth: stroke }),
|
|
5392
|
+
/* @__PURE__ */ jsx58(
|
|
5488
5393
|
AnimatedCircle,
|
|
5489
5394
|
{
|
|
5490
5395
|
cx: 50,
|
|
@@ -5504,29 +5409,29 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
5504
5409
|
}
|
|
5505
5410
|
const width = known ? progress.interpolate({ inputRange: [0, 1], outputRange: ["0%", "100%"] }) : "40%";
|
|
5506
5411
|
const translate = spin.interpolate({ inputRange: [0, 1], outputRange: [-0.4 * track, track] });
|
|
5507
|
-
return /* @__PURE__ */
|
|
5508
|
-
|
|
5412
|
+
return /* @__PURE__ */ jsx58(
|
|
5413
|
+
View52,
|
|
5509
5414
|
{
|
|
5510
5415
|
...a11y,
|
|
5511
5416
|
onLayout: known ? void 0 : (event) => setTrack(event.nativeEvent.layout.width),
|
|
5512
|
-
style: [
|
|
5513
|
-
children: /* @__PURE__ */
|
|
5417
|
+
style: [styles47.bar, { height: BAR2[size], backgroundColor: theme.surface3 }, style],
|
|
5418
|
+
children: /* @__PURE__ */ jsx58(Animated19.View, { style: [styles47.fill, { width }, known || reduce ? null : { transform: [{ translateX: translate }] }], children: /* @__PURE__ */ jsxs52(Svg22, { width: "100%", height: "100%", preserveAspectRatio: "none", children: [
|
|
5514
5419
|
gradient,
|
|
5515
|
-
/* @__PURE__ */
|
|
5420
|
+
/* @__PURE__ */ jsx58(Rect4, { x: 0, y: 0, width: "100%", height: "100%", fill: `url(#${id})` })
|
|
5516
5421
|
] }) })
|
|
5517
5422
|
}
|
|
5518
5423
|
);
|
|
5519
5424
|
}
|
|
5520
|
-
var
|
|
5425
|
+
var styles47 = StyleSheet47.create({
|
|
5521
5426
|
ring: { alignItems: "center", justifyContent: "center" },
|
|
5522
5427
|
bar: { width: "100%", overflow: "hidden", borderRadius: 9999 },
|
|
5523
5428
|
fill: { height: "100%", overflow: "hidden", borderRadius: 9999 }
|
|
5524
5429
|
});
|
|
5525
5430
|
|
|
5526
5431
|
// src/native/qr-code.tsx
|
|
5527
|
-
import * as
|
|
5528
|
-
import { View as
|
|
5529
|
-
import
|
|
5432
|
+
import * as React41 from "react";
|
|
5433
|
+
import { View as View53 } from "react-native";
|
|
5434
|
+
import Svg23, { Path as Path18, Rect as Rect5 } from "react-native-svg";
|
|
5530
5435
|
|
|
5531
5436
|
// src/qr-code/encode.ts
|
|
5532
5437
|
var LEVEL_INDEX = { L: 0, M: 1, Q: 2, H: 3 };
|
|
@@ -5813,52 +5718,52 @@ function qrPath(matrix, quiet) {
|
|
|
5813
5718
|
}
|
|
5814
5719
|
|
|
5815
5720
|
// src/native/qr-code.tsx
|
|
5816
|
-
import { jsx as
|
|
5721
|
+
import { jsx as jsx59, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
5817
5722
|
var TILE = "#ffffff";
|
|
5818
5723
|
var MODULE = "#0b0f19";
|
|
5819
5724
|
function QrCode({ value, label, size = 176, quietZone = 4, level = "M", copyLabel, onCopy, style, ...props }) {
|
|
5820
5725
|
const { theme } = useTheme();
|
|
5821
5726
|
const quiet = Math.max(2, Math.round(quietZone));
|
|
5822
|
-
const { modules, path } =
|
|
5727
|
+
const { modules, path } = React41.useMemo(() => {
|
|
5823
5728
|
const matrix = encodeQr(value, level);
|
|
5824
5729
|
return { modules: matrix.length + quiet * 2, path: qrPath(matrix, quiet) };
|
|
5825
5730
|
}, [value, level, quiet]);
|
|
5826
|
-
return /* @__PURE__ */
|
|
5827
|
-
/* @__PURE__ */
|
|
5828
|
-
|
|
5731
|
+
return /* @__PURE__ */ jsxs53(View53, { ...props, style: [{ alignItems: "flex-start", rowGap: 12 }, style], children: [
|
|
5732
|
+
/* @__PURE__ */ jsx59(
|
|
5733
|
+
View53,
|
|
5829
5734
|
{
|
|
5830
5735
|
accessible: true,
|
|
5831
5736
|
accessibilityRole: "image",
|
|
5832
5737
|
accessibilityLabel: label,
|
|
5833
5738
|
style: { width: size, height: size, borderRadius: 8, overflow: "hidden", borderWidth: 1, borderColor: theme.borderDefault },
|
|
5834
|
-
children: /* @__PURE__ */
|
|
5835
|
-
/* @__PURE__ */
|
|
5836
|
-
/* @__PURE__ */
|
|
5739
|
+
children: /* @__PURE__ */ jsxs53(Svg23, { width: size, height: size, viewBox: `0 0 ${modules} ${modules}`, children: [
|
|
5740
|
+
/* @__PURE__ */ jsx59(Rect5, { width: modules, height: modules, fill: TILE }),
|
|
5741
|
+
/* @__PURE__ */ jsx59(Path18, { d: path, fill: MODULE })
|
|
5837
5742
|
] })
|
|
5838
5743
|
}
|
|
5839
5744
|
),
|
|
5840
|
-
copyLabel ? /* @__PURE__ */
|
|
5745
|
+
copyLabel ? /* @__PURE__ */ jsx59(Button, { label: copyLabel, size: "sm", onPress: () => onCopy?.(value) }) : null
|
|
5841
5746
|
] });
|
|
5842
5747
|
}
|
|
5843
5748
|
|
|
5844
5749
|
// src/native/radio-group.tsx
|
|
5845
|
-
import * as
|
|
5846
|
-
import { Animated as Animated20, Pressable as
|
|
5847
|
-
import
|
|
5848
|
-
import { jsx as
|
|
5750
|
+
import * as React42 from "react";
|
|
5751
|
+
import { Animated as Animated20, Pressable as Pressable25, StyleSheet as StyleSheet48, Text as Text17, View as View54 } from "react-native";
|
|
5752
|
+
import Svg24, { Path as Path19 } from "react-native-svg";
|
|
5753
|
+
import { jsx as jsx60, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
5849
5754
|
function Check({ color }) {
|
|
5850
|
-
return /* @__PURE__ */
|
|
5755
|
+
return /* @__PURE__ */ jsx60(Svg24, { width: 12, height: 12, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 3.2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx60(Path19, { d: "M20 6 9 17l-5-5" }) });
|
|
5851
5756
|
}
|
|
5852
5757
|
function Key({ option, checked, disabled, onPress }) {
|
|
5853
5758
|
const { theme, radius: radius3, motion: motion3 } = useTheme();
|
|
5854
|
-
const [held, setHeld] =
|
|
5855
|
-
const [sink] =
|
|
5759
|
+
const [held, setHeld] = React42.useState(false);
|
|
5760
|
+
const [sink] = React42.useState(() => new Animated20.Value(checked ? 1 : 0));
|
|
5856
5761
|
const down = checked || held;
|
|
5857
|
-
|
|
5762
|
+
React42.useEffect(() => {
|
|
5858
5763
|
Animated20.timing(sink, { toValue: down ? 1 : 0, duration: motion3.duration.fast, useNativeDriver: true }).start();
|
|
5859
5764
|
}, [down, sink, motion3.duration.fast]);
|
|
5860
|
-
return /* @__PURE__ */
|
|
5861
|
-
|
|
5765
|
+
return /* @__PURE__ */ jsxs54(
|
|
5766
|
+
Pressable25,
|
|
5862
5767
|
{
|
|
5863
5768
|
role: "radio",
|
|
5864
5769
|
"aria-checked": checked,
|
|
@@ -5868,14 +5773,14 @@ function Key({ option, checked, disabled, onPress }) {
|
|
|
5868
5773
|
onPress,
|
|
5869
5774
|
onPressIn: () => setHeld(true),
|
|
5870
5775
|
onPressOut: () => setHeld(false),
|
|
5871
|
-
style: [
|
|
5776
|
+
style: [styles48.keySlot, disabled ? styles48.disabled : null],
|
|
5872
5777
|
children: [
|
|
5873
|
-
/* @__PURE__ */
|
|
5874
|
-
/* @__PURE__ */
|
|
5778
|
+
/* @__PURE__ */ jsx60(View54, { style: [styles48.ledge, { borderRadius: radius3.lg, backgroundColor: checked ? theme.accentHover : theme.borderStrong }] }),
|
|
5779
|
+
/* @__PURE__ */ jsxs54(
|
|
5875
5780
|
Animated20.View,
|
|
5876
5781
|
{
|
|
5877
5782
|
style: [
|
|
5878
|
-
|
|
5783
|
+
styles48.key,
|
|
5879
5784
|
{
|
|
5880
5785
|
borderRadius: radius3.lg,
|
|
5881
5786
|
backgroundColor: checked ? theme.accent : theme.surface2,
|
|
@@ -5884,8 +5789,8 @@ function Key({ option, checked, disabled, onPress }) {
|
|
|
5884
5789
|
}
|
|
5885
5790
|
],
|
|
5886
5791
|
children: [
|
|
5887
|
-
/* @__PURE__ */
|
|
5888
|
-
option.hint ? /* @__PURE__ */
|
|
5792
|
+
/* @__PURE__ */ jsx60(Text17, { style: [styles48.keyLabel, { color: checked ? theme.onAccent : theme.textPrimary }], children: option.label }),
|
|
5793
|
+
option.hint ? /* @__PURE__ */ jsx60(Text17, { style: [styles48.keyHint, { color: checked ? theme.onAccent : theme.textSecondary }], children: option.hint }) : null
|
|
5889
5794
|
]
|
|
5890
5795
|
}
|
|
5891
5796
|
)
|
|
@@ -5895,7 +5800,7 @@ function Key({ option, checked, disabled, onPress }) {
|
|
|
5895
5800
|
}
|
|
5896
5801
|
function RadioGroup({ label, options, value: valueProp, defaultValue = null, onValueChange, variant = "list", error, disabled, style }) {
|
|
5897
5802
|
const { theme, radius: radius3, haptic } = useTheme();
|
|
5898
|
-
const [own, setOwn] =
|
|
5803
|
+
const [own, setOwn] = React42.useState(defaultValue);
|
|
5899
5804
|
const value = valueProp !== void 0 ? valueProp : own;
|
|
5900
5805
|
const pick = (v) => {
|
|
5901
5806
|
haptic(variant === "buttons" ? "impact" : "selection");
|
|
@@ -5906,10 +5811,10 @@ function RadioGroup({ label, options, value: valueProp, defaultValue = null, onV
|
|
|
5906
5811
|
const checked = o.value === value;
|
|
5907
5812
|
const off = Boolean(disabled || o.disabled);
|
|
5908
5813
|
const name = o.description ? `${o.label}, ${o.description}` : o.label;
|
|
5909
|
-
if (variant === "buttons") return /* @__PURE__ */
|
|
5814
|
+
if (variant === "buttons") return /* @__PURE__ */ jsx60(Key, { option: o, checked, disabled: off, onPress: () => pick(o.value) }, o.value);
|
|
5910
5815
|
if (variant === "segmented")
|
|
5911
|
-
return /* @__PURE__ */
|
|
5912
|
-
|
|
5816
|
+
return /* @__PURE__ */ jsx60(
|
|
5817
|
+
Pressable25,
|
|
5913
5818
|
{
|
|
5914
5819
|
role: "radio",
|
|
5915
5820
|
"aria-checked": checked,
|
|
@@ -5917,14 +5822,14 @@ function RadioGroup({ label, options, value: valueProp, defaultValue = null, onV
|
|
|
5917
5822
|
"aria-disabled": off || void 0,
|
|
5918
5823
|
disabled: off,
|
|
5919
5824
|
onPress: () => pick(o.value),
|
|
5920
|
-
style: [
|
|
5921
|
-
children: /* @__PURE__ */
|
|
5825
|
+
style: [styles48.segment, { borderRadius: radius3.md }, checked ? { backgroundColor: theme.surface0, borderColor: theme.borderDefault } : null, off ? styles48.disabled : null],
|
|
5826
|
+
children: /* @__PURE__ */ jsx60(Text17, { numberOfLines: 1, style: [styles48.segmentLabel, { color: checked ? theme.textPrimary : theme.textSecondary }], children: o.label })
|
|
5922
5827
|
},
|
|
5923
5828
|
o.value
|
|
5924
5829
|
);
|
|
5925
5830
|
if (variant === "cards")
|
|
5926
|
-
return /* @__PURE__ */
|
|
5927
|
-
|
|
5831
|
+
return /* @__PURE__ */ jsxs54(
|
|
5832
|
+
Pressable25,
|
|
5928
5833
|
{
|
|
5929
5834
|
role: "radio",
|
|
5930
5835
|
"aria-checked": checked,
|
|
@@ -5933,40 +5838,40 @@ function RadioGroup({ label, options, value: valueProp, defaultValue = null, onV
|
|
|
5933
5838
|
disabled: off,
|
|
5934
5839
|
onPress: () => pick(o.value),
|
|
5935
5840
|
style: ({ pressed }) => [
|
|
5936
|
-
|
|
5841
|
+
styles48.card,
|
|
5937
5842
|
{ borderRadius: radius3.xl, backgroundColor: checked ? theme.accentSoft : theme.surface1, borderColor: checked ? theme.accent : theme.borderDefault, transform: [{ scale: pressed ? 0.98 : 1 }] },
|
|
5938
|
-
off ?
|
|
5843
|
+
off ? styles48.disabled : null
|
|
5939
5844
|
],
|
|
5940
5845
|
children: [
|
|
5941
|
-
/* @__PURE__ */
|
|
5942
|
-
/* @__PURE__ */
|
|
5943
|
-
o.description ? /* @__PURE__ */
|
|
5846
|
+
/* @__PURE__ */ jsx60(View54, { style: [styles48.cardCheck, { borderColor: checked ? theme.accent : theme.borderStrong, backgroundColor: checked ? theme.accent : theme.surface1 }], children: checked ? /* @__PURE__ */ jsx60(Check, { color: theme.onAccent }) : null }),
|
|
5847
|
+
/* @__PURE__ */ jsx60(Text17, { style: [styles48.cardLabel, { color: theme.textPrimary }], children: o.label }),
|
|
5848
|
+
o.description ? /* @__PURE__ */ jsx60(Text17, { style: [styles48.cardDescription, { color: theme.textSecondary }], children: o.description }) : null
|
|
5944
5849
|
]
|
|
5945
5850
|
},
|
|
5946
5851
|
o.value
|
|
5947
5852
|
);
|
|
5948
|
-
return /* @__PURE__ */
|
|
5949
|
-
/* @__PURE__ */
|
|
5950
|
-
/* @__PURE__ */
|
|
5951
|
-
/* @__PURE__ */
|
|
5952
|
-
o.description ? /* @__PURE__ */
|
|
5853
|
+
return /* @__PURE__ */ jsxs54(Pressable25, { role: "radio", "aria-checked": checked, "aria-label": name, "aria-disabled": off || void 0, disabled: off, onPress: () => pick(o.value), style: [styles48.row, off ? styles48.disabled : null], children: [
|
|
5854
|
+
/* @__PURE__ */ jsx60(View54, { style: [styles48.dot, { borderColor: checked ? theme.accent : theme.borderStrong, backgroundColor: checked ? theme.accent : theme.surface1 }], children: checked ? /* @__PURE__ */ jsx60(View54, { style: [styles48.dotIn, { backgroundColor: theme.onAccent }] }) : null }),
|
|
5855
|
+
/* @__PURE__ */ jsxs54(View54, { style: styles48.rowText, children: [
|
|
5856
|
+
/* @__PURE__ */ jsx60(Text17, { style: [styles48.rowLabel, { color: theme.textPrimary }], children: o.label }),
|
|
5857
|
+
o.description ? /* @__PURE__ */ jsx60(Text17, { style: [styles48.cardDescription, { color: theme.textSecondary }], children: o.description }) : null
|
|
5953
5858
|
] })
|
|
5954
5859
|
] }, o.value);
|
|
5955
5860
|
});
|
|
5956
|
-
return /* @__PURE__ */
|
|
5957
|
-
/* @__PURE__ */
|
|
5958
|
-
|
|
5861
|
+
return /* @__PURE__ */ jsxs54(View54, { style: [styles48.root, style], children: [
|
|
5862
|
+
/* @__PURE__ */ jsx60(
|
|
5863
|
+
View54,
|
|
5959
5864
|
{
|
|
5960
5865
|
role: "radiogroup",
|
|
5961
5866
|
"aria-label": label,
|
|
5962
|
-
style: variant === "segmented" ? [
|
|
5867
|
+
style: variant === "segmented" ? [styles48.track, { borderRadius: radius3.lg, backgroundColor: theme.surface2, borderColor: error ? theme.danger : theme.borderDefault }] : variant === "buttons" ? styles48.keys : variant === "cards" ? styles48.cards : styles48.list,
|
|
5963
5868
|
children: body
|
|
5964
5869
|
}
|
|
5965
5870
|
),
|
|
5966
|
-
error ? /* @__PURE__ */
|
|
5871
|
+
error ? /* @__PURE__ */ jsx60(Text17, { role: "alert", "aria-live": "polite", style: [styles48.error, { color: theme.dangerText }], children: error }) : null
|
|
5967
5872
|
] });
|
|
5968
5873
|
}
|
|
5969
|
-
var
|
|
5874
|
+
var styles48 = StyleSheet48.create({
|
|
5970
5875
|
root: { gap: 6, alignSelf: "stretch" },
|
|
5971
5876
|
list: { gap: 2 },
|
|
5972
5877
|
row: { flexDirection: "row", alignItems: "center", gap: 12, minHeight: 44 },
|
|
@@ -5985,8 +5890,8 @@ var styles49 = StyleSheet49.create({
|
|
|
5985
5890
|
key: { minHeight: 48, paddingHorizontal: 16, paddingVertical: 8, alignItems: "center", justifyContent: "center", gap: 1, borderWidth: 1 },
|
|
5986
5891
|
keyLabel: { fontSize: 15, fontWeight: "700" },
|
|
5987
5892
|
keyHint: { fontSize: 11, fontWeight: "500" },
|
|
5988
|
-
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth:
|
|
5989
|
-
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth:
|
|
5893
|
+
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth: StyleSheet48.hairlineWidth, height: 42 },
|
|
5894
|
+
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth: StyleSheet48.hairlineWidth, borderColor: "transparent" },
|
|
5990
5895
|
segmentLabel: { fontSize: 13, fontWeight: "600" },
|
|
5991
5896
|
error: { fontSize: 12, lineHeight: 16 },
|
|
5992
5897
|
disabled: { opacity: 0.4 }
|
|
@@ -5994,15 +5899,15 @@ var styles49 = StyleSheet49.create({
|
|
|
5994
5899
|
|
|
5995
5900
|
// src/native/search-field.tsx
|
|
5996
5901
|
import { useDebouncedCallback } from "@krizaka/pacer/react";
|
|
5997
|
-
import * as
|
|
5998
|
-
import { Pressable as
|
|
5999
|
-
import
|
|
6000
|
-
import { jsx as
|
|
5902
|
+
import * as React43 from "react";
|
|
5903
|
+
import { Pressable as Pressable26, StyleSheet as StyleSheet49, TextInput as TextInput7, View as View55 } from "react-native";
|
|
5904
|
+
import Svg25, { Circle as Circle12, Path as Path20 } from "react-native-svg";
|
|
5905
|
+
import { jsx as jsx61, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
6001
5906
|
function SearchField({ label, value, defaultValue = "", onValueChange, onSearch, debounce = 300, onSubmit, clearLabel, cancelLabel, onCancel, style, placeholder, onFocus, onBlur, ...props }) {
|
|
6002
|
-
const [focused, setFocused] =
|
|
6003
|
-
const input =
|
|
5907
|
+
const [focused, setFocused] = React43.useState(false);
|
|
5908
|
+
const input = React43.useRef(null);
|
|
6004
5909
|
const { theme, radius: radius3 } = useTheme();
|
|
6005
|
-
const [own, setOwn] =
|
|
5910
|
+
const [own, setOwn] = React43.useState(defaultValue);
|
|
6006
5911
|
const query = value ?? own;
|
|
6007
5912
|
const search = useDebouncedCallback((next) => onSearch?.(next), debounce);
|
|
6008
5913
|
const change = (next) => {
|
|
@@ -6011,12 +5916,12 @@ function SearchField({ label, value, defaultValue = "", onValueChange, onSearch,
|
|
|
6011
5916
|
search.cancel();
|
|
6012
5917
|
if (onSearch) search(next);
|
|
6013
5918
|
};
|
|
6014
|
-
const field = /* @__PURE__ */
|
|
6015
|
-
/* @__PURE__ */
|
|
6016
|
-
/* @__PURE__ */
|
|
6017
|
-
/* @__PURE__ */
|
|
5919
|
+
const field = /* @__PURE__ */ jsxs55(View55, { style: [styles49.frame, { borderRadius: radius3.md, borderColor: theme.borderDefault, backgroundColor: theme.surface2 }, style], children: [
|
|
5920
|
+
/* @__PURE__ */ jsxs55(Svg25, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: theme.textSecondary, strokeWidth: 2, strokeLinecap: "round", "aria-hidden": true, children: [
|
|
5921
|
+
/* @__PURE__ */ jsx61(Circle12, { cx: 11, cy: 11, r: 7 }),
|
|
5922
|
+
/* @__PURE__ */ jsx61(Path20, { d: "m20 20-3.5-3.5" })
|
|
6018
5923
|
] }),
|
|
6019
|
-
/* @__PURE__ */
|
|
5924
|
+
/* @__PURE__ */ jsx61(
|
|
6020
5925
|
TextInput7,
|
|
6021
5926
|
{
|
|
6022
5927
|
ref: input,
|
|
@@ -6035,7 +5940,7 @@ function SearchField({ label, value, defaultValue = "", onValueChange, onSearch,
|
|
|
6035
5940
|
onSearch?.(query);
|
|
6036
5941
|
onSubmit?.(query);
|
|
6037
5942
|
},
|
|
6038
|
-
style: [
|
|
5943
|
+
style: [styles49.input, { color: theme.textPrimary }],
|
|
6039
5944
|
onFocus: (e) => {
|
|
6040
5945
|
setFocused(true);
|
|
6041
5946
|
onFocus?.(e);
|
|
@@ -6047,13 +5952,13 @@ function SearchField({ label, value, defaultValue = "", onValueChange, onSearch,
|
|
|
6047
5952
|
...props
|
|
6048
5953
|
}
|
|
6049
5954
|
),
|
|
6050
|
-
query ? /* @__PURE__ */
|
|
5955
|
+
query ? /* @__PURE__ */ jsx61(Pressable26, { role: "button", "aria-label": clearLabel, hitSlop: 10, onPress: () => change(""), style: styles49.clear, children: /* @__PURE__ */ jsx61(Svg25, { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: theme.textSecondary, strokeWidth: 2.4, strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx61(Path20, { d: "M18 6 6 18M6 6l12 12" }) }) }) : null
|
|
6051
5956
|
] });
|
|
6052
5957
|
if (!cancelLabel || !onCancel) return field;
|
|
6053
|
-
return /* @__PURE__ */
|
|
6054
|
-
/* @__PURE__ */
|
|
6055
|
-
focused || query ? /* @__PURE__ */
|
|
6056
|
-
|
|
5958
|
+
return /* @__PURE__ */ jsxs55(View55, { style: styles49.bar, children: [
|
|
5959
|
+
/* @__PURE__ */ jsx61(View55, { style: styles49.grow, children: field }),
|
|
5960
|
+
focused || query ? /* @__PURE__ */ jsx61(
|
|
5961
|
+
Pressable26,
|
|
6057
5962
|
{
|
|
6058
5963
|
role: "button",
|
|
6059
5964
|
onPress: () => {
|
|
@@ -6062,14 +5967,14 @@ function SearchField({ label, value, defaultValue = "", onValueChange, onSearch,
|
|
|
6062
5967
|
onCancel();
|
|
6063
5968
|
},
|
|
6064
5969
|
hitSlop: 8,
|
|
6065
|
-
style:
|
|
6066
|
-
children: /* @__PURE__ */
|
|
5970
|
+
style: styles49.cancel,
|
|
5971
|
+
children: /* @__PURE__ */ jsx61(Txt, { variant: "label", tone: "accent", children: cancelLabel })
|
|
6067
5972
|
}
|
|
6068
5973
|
) : null
|
|
6069
5974
|
] });
|
|
6070
5975
|
}
|
|
6071
|
-
var
|
|
6072
|
-
frame: { flexDirection: "row", alignItems: "center", gap: 8, height: 44, paddingLeft: 12, paddingRight: 6, borderWidth:
|
|
5976
|
+
var styles49 = StyleSheet49.create({
|
|
5977
|
+
frame: { flexDirection: "row", alignItems: "center", gap: 8, height: 44, paddingLeft: 12, paddingRight: 6, borderWidth: StyleSheet49.hairlineWidth },
|
|
6073
5978
|
input: { flex: 1, height: "100%", fontSize: 15, paddingVertical: 0 },
|
|
6074
5979
|
bar: { flexDirection: "row", alignItems: "center", gap: 10 },
|
|
6075
5980
|
grow: { flex: 1 },
|
|
@@ -6078,20 +5983,20 @@ var styles50 = StyleSheet50.create({
|
|
|
6078
5983
|
});
|
|
6079
5984
|
|
|
6080
5985
|
// src/native/segmented.tsx
|
|
6081
|
-
import { Pressable as
|
|
6082
|
-
import { jsx as
|
|
5986
|
+
import { Pressable as Pressable27, StyleSheet as StyleSheet50, Text as Text18, View as View56 } from "react-native";
|
|
5987
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
6083
5988
|
function Segmented({ options, value, onValueChange, size = "md", "aria-label": label, style }) {
|
|
6084
5989
|
const { theme, radius: radius3 } = useTheme();
|
|
6085
|
-
return /* @__PURE__ */
|
|
6086
|
-
|
|
5990
|
+
return /* @__PURE__ */ jsx62(
|
|
5991
|
+
View56,
|
|
6087
5992
|
{
|
|
6088
5993
|
role: "tablist",
|
|
6089
5994
|
"aria-label": label,
|
|
6090
|
-
style: [
|
|
5995
|
+
style: [styles50.track, { backgroundColor: theme.surface2, borderColor: theme.borderSubtle, borderRadius: radius3.md, height: size === "sm" ? 32 : 40 }, style],
|
|
6091
5996
|
children: options.map((option) => {
|
|
6092
5997
|
const selected = option.value === value;
|
|
6093
|
-
return /* @__PURE__ */
|
|
6094
|
-
|
|
5998
|
+
return /* @__PURE__ */ jsx62(
|
|
5999
|
+
Pressable27,
|
|
6095
6000
|
{
|
|
6096
6001
|
role: "tab",
|
|
6097
6002
|
"aria-selected": selected,
|
|
@@ -6101,12 +6006,12 @@ function Segmented({ options, value, onValueChange, size = "md", "aria-label": l
|
|
|
6101
6006
|
if (!selected) onValueChange(option.value);
|
|
6102
6007
|
},
|
|
6103
6008
|
style: [
|
|
6104
|
-
|
|
6009
|
+
styles50.segment,
|
|
6105
6010
|
{ borderRadius: radius3.sm },
|
|
6106
6011
|
selected ? { backgroundColor: theme.surface0, borderColor: theme.borderDefault } : null,
|
|
6107
|
-
option.disabled ?
|
|
6012
|
+
option.disabled ? styles50.disabled : null
|
|
6108
6013
|
],
|
|
6109
|
-
children: /* @__PURE__ */
|
|
6014
|
+
children: /* @__PURE__ */ jsx62(Text18, { numberOfLines: 1, style: [styles50.label, { color: selected ? theme.textPrimary : theme.textSecondary, fontSize: size === "sm" ? 12 : 13 }], children: option.label })
|
|
6110
6015
|
},
|
|
6111
6016
|
option.value
|
|
6112
6017
|
);
|
|
@@ -6114,62 +6019,62 @@ function Segmented({ options, value, onValueChange, size = "md", "aria-label": l
|
|
|
6114
6019
|
}
|
|
6115
6020
|
);
|
|
6116
6021
|
}
|
|
6117
|
-
var
|
|
6118
|
-
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth:
|
|
6119
|
-
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth:
|
|
6022
|
+
var styles50 = StyleSheet50.create({
|
|
6023
|
+
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth: StyleSheet50.hairlineWidth },
|
|
6024
|
+
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth: StyleSheet50.hairlineWidth, borderColor: "transparent" },
|
|
6120
6025
|
label: { fontWeight: "600" },
|
|
6121
6026
|
disabled: { opacity: 0.4 }
|
|
6122
6027
|
});
|
|
6123
6028
|
|
|
6124
6029
|
// src/native/settings-layout.tsx
|
|
6125
|
-
import * as
|
|
6126
|
-
import { Pressable as
|
|
6127
|
-
import
|
|
6128
|
-
import { Fragment as Fragment11, jsx as
|
|
6030
|
+
import * as React44 from "react";
|
|
6031
|
+
import { Pressable as Pressable28, StyleSheet as StyleSheet51, View as View57 } from "react-native";
|
|
6032
|
+
import Svg26, { Path as Path21 } from "react-native-svg";
|
|
6033
|
+
import { Fragment as Fragment11, jsx as jsx63, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
6129
6034
|
function SettingsRow({ label, description, icon, value, trailing, onPress, destructive, accessibilityLabel, disabled }) {
|
|
6130
6035
|
const { theme } = useTheme();
|
|
6131
|
-
const body = /* @__PURE__ */
|
|
6132
|
-
icon ? /* @__PURE__ */
|
|
6133
|
-
/* @__PURE__ */
|
|
6134
|
-
/* @__PURE__ */
|
|
6135
|
-
description ? /* @__PURE__ */
|
|
6036
|
+
const body = /* @__PURE__ */ jsxs56(Fragment11, { children: [
|
|
6037
|
+
icon ? /* @__PURE__ */ jsx63(View57, { style: [styles51.tile, { backgroundColor: theme.surface3 }], children: icon }) : null,
|
|
6038
|
+
/* @__PURE__ */ jsxs56(View57, { style: styles51.text, children: [
|
|
6039
|
+
/* @__PURE__ */ jsx63(Txt, { variant: "body", tone: destructive ? "danger" : "text", children: label }),
|
|
6040
|
+
description ? /* @__PURE__ */ jsx63(Txt, { variant: "caption", tone: "secondary", children: description }) : null
|
|
6136
6041
|
] }),
|
|
6137
|
-
value ? /* @__PURE__ */
|
|
6042
|
+
value ? /* @__PURE__ */ jsx63(Txt, { variant: "caption", tone: "secondary", numberOfLines: 1, style: styles51.value, children: value }) : null,
|
|
6138
6043
|
trailing,
|
|
6139
|
-
onPress && !trailing ? /* @__PURE__ */
|
|
6044
|
+
onPress && !trailing ? /* @__PURE__ */ jsx63(Svg26, { width: 16, height: 16, viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsx63(Path21, { d: "m9 6 6 6-6 6", fill: "none", stroke: theme.textMuted, strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round" }) }) : null
|
|
6140
6045
|
] });
|
|
6141
6046
|
if (onPress && !trailing) {
|
|
6142
|
-
return /* @__PURE__ */
|
|
6143
|
-
|
|
6047
|
+
return /* @__PURE__ */ jsx63(
|
|
6048
|
+
Pressable28,
|
|
6144
6049
|
{
|
|
6145
6050
|
role: "button",
|
|
6146
6051
|
accessibilityLabel,
|
|
6147
6052
|
accessibilityState: { disabled: !!disabled },
|
|
6148
6053
|
disabled,
|
|
6149
6054
|
onPress,
|
|
6150
|
-
style: ({ pressed }) => [
|
|
6055
|
+
style: ({ pressed }) => [styles51.row, pressed ? { backgroundColor: theme.surface2 } : null, disabled ? styles51.disabled : null],
|
|
6151
6056
|
children: body
|
|
6152
6057
|
}
|
|
6153
6058
|
);
|
|
6154
6059
|
}
|
|
6155
|
-
return /* @__PURE__ */
|
|
6060
|
+
return /* @__PURE__ */ jsx63(View57, { accessible: !trailing, accessibilityLabel: trailing ? void 0 : accessibilityLabel, style: [styles51.row, disabled ? styles51.disabled : null], children: body });
|
|
6156
6061
|
}
|
|
6157
6062
|
function SettingsGroup({ title, children, style, ...props }) {
|
|
6158
6063
|
const { theme } = useTheme();
|
|
6159
|
-
const rows =
|
|
6160
|
-
return /* @__PURE__ */
|
|
6161
|
-
title ? /* @__PURE__ */
|
|
6162
|
-
/* @__PURE__ */
|
|
6163
|
-
i > 0 ? /* @__PURE__ */
|
|
6064
|
+
const rows = React44.Children.toArray(children).filter(Boolean);
|
|
6065
|
+
return /* @__PURE__ */ jsxs56(View57, { ...props, style: [styles51.group, style], children: [
|
|
6066
|
+
title ? /* @__PURE__ */ jsx63(Txt, { variant: "caption", tone: "muted", role: "heading", style: styles51.title, children: title }) : null,
|
|
6067
|
+
/* @__PURE__ */ jsx63(View57, { style: [styles51.card, { backgroundColor: theme.surface1, borderColor: theme.borderSubtle }], children: rows.map((row, i) => /* @__PURE__ */ jsxs56(React44.Fragment, { children: [
|
|
6068
|
+
i > 0 ? /* @__PURE__ */ jsx63(View57, { style: [styles51.hairline, { backgroundColor: theme.borderSubtle }] }) : null,
|
|
6164
6069
|
row
|
|
6165
6070
|
] }, i)) })
|
|
6166
6071
|
] });
|
|
6167
6072
|
}
|
|
6168
|
-
var
|
|
6073
|
+
var styles51 = StyleSheet51.create({
|
|
6169
6074
|
group: { rowGap: 8 },
|
|
6170
6075
|
title: { textTransform: "uppercase", letterSpacing: 0.6, fontWeight: "700", paddingHorizontal: 4 },
|
|
6171
|
-
card: { borderWidth:
|
|
6172
|
-
hairline: { height:
|
|
6076
|
+
card: { borderWidth: StyleSheet51.hairlineWidth, borderRadius: 16, overflow: "hidden" },
|
|
6077
|
+
hairline: { height: StyleSheet51.hairlineWidth, marginLeft: 16 },
|
|
6173
6078
|
row: { minHeight: 52, flexDirection: "row", alignItems: "center", columnGap: 12, paddingHorizontal: 16, paddingVertical: 10 },
|
|
6174
6079
|
tile: { width: 32, height: 32, borderRadius: 8, alignItems: "center", justifyContent: "center" },
|
|
6175
6080
|
text: { flex: 1, rowGap: 2 },
|
|
@@ -6178,10 +6083,10 @@ var styles52 = StyleSheet52.create({
|
|
|
6178
6083
|
});
|
|
6179
6084
|
|
|
6180
6085
|
// src/native/showcase.tsx
|
|
6181
|
-
import * as
|
|
6182
|
-
import { Animated as Animated21, AppState, Easing as Easing11, FlatList, Pressable as
|
|
6183
|
-
import
|
|
6184
|
-
import { jsx as
|
|
6086
|
+
import * as React45 from "react";
|
|
6087
|
+
import { Animated as Animated21, AppState, Easing as Easing11, FlatList, Pressable as Pressable29, StyleSheet as StyleSheet52, View as View58 } from "react-native";
|
|
6088
|
+
import Svg27, { Path as Path22 } from "react-native-svg";
|
|
6089
|
+
import { jsx as jsx64, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
6185
6090
|
var showcaseLabels = {
|
|
6186
6091
|
previous: "Previous slide",
|
|
6187
6092
|
next: "Next slide",
|
|
@@ -6195,16 +6100,16 @@ function Showcase({ label, items: items2, getId, renderItem, getTitle, interval
|
|
|
6195
6100
|
const { theme } = useTheme();
|
|
6196
6101
|
const reduced = useReducedMotion();
|
|
6197
6102
|
const total = items2.length;
|
|
6198
|
-
const [current, setCurrent] =
|
|
6199
|
-
const [width, setWidth] =
|
|
6200
|
-
const [paused, setPaused] =
|
|
6201
|
-
const [dragging, setDragging] =
|
|
6202
|
-
const [background, setBackground] =
|
|
6203
|
-
const [announce, setAnnounce] =
|
|
6204
|
-
const list =
|
|
6205
|
-
const [fill] =
|
|
6206
|
-
const progress =
|
|
6207
|
-
|
|
6103
|
+
const [current, setCurrent] = React45.useState(0);
|
|
6104
|
+
const [width, setWidth] = React45.useState(0);
|
|
6105
|
+
const [paused, setPaused] = React45.useState(false);
|
|
6106
|
+
const [dragging, setDragging] = React45.useState(false);
|
|
6107
|
+
const [background, setBackground] = React45.useState(false);
|
|
6108
|
+
const [announce, setAnnounce] = React45.useState(false);
|
|
6109
|
+
const list = React45.useRef(null);
|
|
6110
|
+
const [fill] = React45.useState(() => new Animated21.Value(0));
|
|
6111
|
+
const progress = React45.useRef(0);
|
|
6112
|
+
React45.useEffect(() => {
|
|
6208
6113
|
const id = fill.addListener(({ value }) => {
|
|
6209
6114
|
progress.current = value;
|
|
6210
6115
|
});
|
|
@@ -6225,11 +6130,11 @@ function Showcase({ label, items: items2, getId, renderItem, getTitle, interval
|
|
|
6225
6130
|
};
|
|
6226
6131
|
const playing = autoplay && !reduced && total > 1;
|
|
6227
6132
|
const running = playing && !paused && !dragging && !background && !(!loop && current === total - 1);
|
|
6228
|
-
|
|
6133
|
+
React45.useEffect(() => {
|
|
6229
6134
|
fill.setValue(0);
|
|
6230
6135
|
progress.current = 0;
|
|
6231
6136
|
}, [current, fill]);
|
|
6232
|
-
|
|
6137
|
+
React45.useEffect(() => {
|
|
6233
6138
|
if (!running) return;
|
|
6234
6139
|
const animation = Animated21.timing(fill, { toValue: 1, duration: Math.max(1, interval * (1 - progress.current)), easing: Easing11.linear, useNativeDriver: false });
|
|
6235
6140
|
animation.start(({ finished }) => {
|
|
@@ -6239,10 +6144,10 @@ function Showcase({ label, items: items2, getId, renderItem, getTitle, interval
|
|
|
6239
6144
|
}, [running, current, interval]);
|
|
6240
6145
|
const item = items2[current];
|
|
6241
6146
|
const title = item !== void 0 ? getTitle?.(item) : void 0;
|
|
6242
|
-
const control = [
|
|
6243
|
-
const icon = (d) => /* @__PURE__ */
|
|
6244
|
-
return /* @__PURE__ */
|
|
6245
|
-
/* @__PURE__ */
|
|
6147
|
+
const control = [styles52.control, { borderColor: theme.borderDefault, backgroundColor: theme.surface1 }];
|
|
6148
|
+
const icon = (d) => /* @__PURE__ */ jsx64(Svg27, { width: 16, height: 16, viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsx64(Path22, { d, stroke: theme.textSecondary, strokeWidth: 2.2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
6149
|
+
return /* @__PURE__ */ jsxs57(View58, { role: "group", "aria-label": label, style: [styles52.root, style], children: [
|
|
6150
|
+
/* @__PURE__ */ jsx64(View58, { "aria-live": announce ? "polite" : "off", onLayout: (e) => setWidth(e.nativeEvent.layout.width), children: /* @__PURE__ */ jsx64(
|
|
6246
6151
|
FlatList,
|
|
6247
6152
|
{
|
|
6248
6153
|
ref: list,
|
|
@@ -6263,25 +6168,25 @@ function Showcase({ label, items: items2, getId, renderItem, getTitle, interval
|
|
|
6263
6168
|
onIndexChange?.(next, true);
|
|
6264
6169
|
}
|
|
6265
6170
|
},
|
|
6266
|
-
renderItem: ({ item: slide, index }) => /* @__PURE__ */
|
|
6171
|
+
renderItem: ({ item: slide, index }) => /* @__PURE__ */ jsx64(View58, { role: "group", "aria-label": labels.slide(index + 1, total), style: { width }, children: Math.abs(index - current) <= 1 ? renderItem(slide, { index, active: index === current }) : null })
|
|
6267
6172
|
}
|
|
6268
6173
|
) }),
|
|
6269
|
-
/* @__PURE__ */
|
|
6270
|
-
i < current || i === current && !playing ? /* @__PURE__ */
|
|
6271
|
-
i === current && playing ? /* @__PURE__ */
|
|
6174
|
+
/* @__PURE__ */ jsx64(View58, { style: styles52.segments, children: items2.map((slide, i) => /* @__PURE__ */ jsx64(Pressable29, { role: "button", "aria-label": labels.goTo(i + 1, total), "aria-current": i === current ? true : void 0, onPress: () => go(i, true), style: styles52.segment, children: /* @__PURE__ */ jsxs57(View58, { style: [styles52.track, { backgroundColor: theme.surface3 }], children: [
|
|
6175
|
+
i < current || i === current && !playing ? /* @__PURE__ */ jsx64(View58, { style: [StyleSheet52.absoluteFill, { backgroundColor: theme.accent }] }) : null,
|
|
6176
|
+
i === current && playing ? /* @__PURE__ */ jsx64(Animated21.View, { style: [styles52.fill, { backgroundColor: theme.accent, width: fill.interpolate({ inputRange: [0, 1], outputRange: ["0%", "100%"] }) }] }) : null
|
|
6272
6177
|
] }) }, getId(slide))) }),
|
|
6273
|
-
/* @__PURE__ */
|
|
6274
|
-
/* @__PURE__ */
|
|
6178
|
+
/* @__PURE__ */ jsxs57(View58, { style: styles52.bar, children: [
|
|
6179
|
+
/* @__PURE__ */ jsxs57(Txt, { variant: "caption", tone: "secondary", numberOfLines: 1, style: styles52.counter, children: [
|
|
6275
6180
|
title ? `${title} \xB7 ` : "",
|
|
6276
6181
|
labels.counter(current + 1, total)
|
|
6277
6182
|
] }),
|
|
6278
|
-
/* @__PURE__ */
|
|
6279
|
-
playing ? /* @__PURE__ */
|
|
6280
|
-
/* @__PURE__ */
|
|
6183
|
+
/* @__PURE__ */ jsx64(Pressable29, { role: "button", "aria-label": labels.previous, disabled: !loop && current === 0, hitSlop: 6, onPress: () => go(current - 1, true), style: control, children: icon("M15 5l-7 7 7 7") }),
|
|
6184
|
+
playing ? /* @__PURE__ */ jsx64(Pressable29, { role: "button", "aria-label": paused ? labels.play : labels.pause, hitSlop: 6, onPress: () => setPaused(!paused), style: control, children: icon(paused ? "M8 5.5v13l10-6.5Z" : "M8 5v14M16 5v14") }) : null,
|
|
6185
|
+
/* @__PURE__ */ jsx64(Pressable29, { role: "button", "aria-label": labels.next, disabled: !loop && current === total - 1, hitSlop: 6, onPress: () => go(current + 1, true), style: control, children: icon("M9 5l7 7-7 7") })
|
|
6281
6186
|
] })
|
|
6282
6187
|
] });
|
|
6283
6188
|
}
|
|
6284
|
-
var
|
|
6189
|
+
var styles52 = StyleSheet52.create({
|
|
6285
6190
|
root: { gap: 8 },
|
|
6286
6191
|
segments: { flexDirection: "row", gap: 4 },
|
|
6287
6192
|
segment: { flex: 1, height: 24, justifyContent: "center" },
|
|
@@ -6293,9 +6198,9 @@ var styles53 = StyleSheet53.create({
|
|
|
6293
6198
|
});
|
|
6294
6199
|
|
|
6295
6200
|
// src/native/skeleton.tsx
|
|
6296
|
-
import * as
|
|
6201
|
+
import * as React46 from "react";
|
|
6297
6202
|
import { Animated as Animated22 } from "react-native";
|
|
6298
|
-
import { jsx as
|
|
6203
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
6299
6204
|
var SHAPE = {
|
|
6300
6205
|
text: { width: "100%", height: 12, radius: 4 },
|
|
6301
6206
|
circle: { width: 40, height: 40, radius: 9999 },
|
|
@@ -6304,8 +6209,8 @@ var SHAPE = {
|
|
|
6304
6209
|
function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
6305
6210
|
const { theme } = useTheme();
|
|
6306
6211
|
const reduce = useReducedMotion();
|
|
6307
|
-
const [opacity] =
|
|
6308
|
-
|
|
6212
|
+
const [opacity] = React46.useState(() => new Animated22.Value(1));
|
|
6213
|
+
React46.useEffect(() => {
|
|
6309
6214
|
if (reduce) return;
|
|
6310
6215
|
const loop = Animated22.loop(
|
|
6311
6216
|
Animated22.sequence([
|
|
@@ -6321,7 +6226,7 @@ function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
|
6321
6226
|
}, [reduce, opacity]);
|
|
6322
6227
|
const s = SHAPE[shape];
|
|
6323
6228
|
const side = shape === "circle" ? width ?? height ?? s.width : void 0;
|
|
6324
|
-
return /* @__PURE__ */
|
|
6229
|
+
return /* @__PURE__ */ jsx65(
|
|
6325
6230
|
Animated22.View,
|
|
6326
6231
|
{
|
|
6327
6232
|
testID,
|
|
@@ -6335,10 +6240,10 @@ function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
|
6335
6240
|
}
|
|
6336
6241
|
|
|
6337
6242
|
// src/native/slider.tsx
|
|
6338
|
-
import * as
|
|
6339
|
-
import { PanResponder as PanResponder2, StyleSheet as
|
|
6340
|
-
import
|
|
6341
|
-
import { jsx as
|
|
6243
|
+
import * as React47 from "react";
|
|
6244
|
+
import { PanResponder as PanResponder2, StyleSheet as StyleSheet53, Text as Text19, View as View59 } from "react-native";
|
|
6245
|
+
import Svg28, { Defs as Defs11, LinearGradient as LinearGradient10, Rect as Rect6, Stop as Stop11 } from "react-native-svg";
|
|
6246
|
+
import { jsx as jsx66, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
6342
6247
|
var THUMB = 26;
|
|
6343
6248
|
var toArray = (v) => v === void 0 ? void 0 : typeof v === "number" ? [v] : [...v];
|
|
6344
6249
|
function Slider({
|
|
@@ -6364,20 +6269,20 @@ function Slider({
|
|
|
6364
6269
|
const { theme, radius: radius3, haptic } = useTheme();
|
|
6365
6270
|
const range = Array.isArray(value ?? defaultValue);
|
|
6366
6271
|
const vertical = orientation === "vertical";
|
|
6367
|
-
const [inner, setInner] =
|
|
6272
|
+
const [inner, setInner] = React47.useState(() => toArray(defaultValue) ?? [min]);
|
|
6368
6273
|
const current = toArray(value) ?? inner;
|
|
6369
|
-
const [length, setLength] =
|
|
6370
|
-
const [dragging, setDragging] =
|
|
6274
|
+
const [length, setLength] = React47.useState(0);
|
|
6275
|
+
const [dragging, setDragging] = React47.useState(null);
|
|
6371
6276
|
const gradientId = useSvgId("kzs");
|
|
6372
6277
|
const out = (next) => range ? [next[0], next[1]] : next[0];
|
|
6373
6278
|
const snap = (v) => Math.min(max, Math.max(min, Math.round((v - min) / step) * step + min));
|
|
6374
6279
|
const pct = (v) => (v - min) / (max - min || 1);
|
|
6375
|
-
const live =
|
|
6376
|
-
|
|
6280
|
+
const live = React47.useRef({ current, length, vertical, disabled });
|
|
6281
|
+
React47.useLayoutEffect(() => {
|
|
6377
6282
|
live.current = { current, length, vertical, disabled };
|
|
6378
6283
|
});
|
|
6379
|
-
const active =
|
|
6380
|
-
const start =
|
|
6284
|
+
const active = React47.useRef(0);
|
|
6285
|
+
const start = React47.useRef(0);
|
|
6381
6286
|
const set = (next) => {
|
|
6382
6287
|
if (value === void 0) setInner(next);
|
|
6383
6288
|
onValueChange?.(out(next));
|
|
@@ -6398,11 +6303,11 @@ function Slider({
|
|
|
6398
6303
|
return min + p * (max - min);
|
|
6399
6304
|
};
|
|
6400
6305
|
const commit = () => onValueCommit?.(out(live.current.current));
|
|
6401
|
-
const handlers =
|
|
6402
|
-
|
|
6306
|
+
const handlers = React47.useRef({ move: move2, at, commit });
|
|
6307
|
+
React47.useLayoutEffect(() => {
|
|
6403
6308
|
handlers.current = { move: move2, at, commit };
|
|
6404
6309
|
});
|
|
6405
|
-
const [responder] =
|
|
6310
|
+
const [responder] = React47.useState(
|
|
6406
6311
|
() => PanResponder2.create({
|
|
6407
6312
|
onStartShouldSetPanResponder: () => !live.current.disabled,
|
|
6408
6313
|
onMoveShouldSetPanResponder: () => !live.current.disabled,
|
|
@@ -6430,24 +6335,24 @@ function Slider({
|
|
|
6430
6335
|
const along = (p) => vertical ? { bottom: p * length } : { left: p * length };
|
|
6431
6336
|
const onLayout = (e) => setLength(vertical ? e.nativeEvent.layout.height : e.nativeEvent.layout.width);
|
|
6432
6337
|
const fill = vertical ? { bottom: pct(lo) * length, height: (pct(hi) - pct(lo)) * length, left: 0, right: 0 } : { left: pct(lo) * length, width: (pct(hi) - pct(lo)) * length, top: 0, bottom: 0 };
|
|
6433
|
-
return /* @__PURE__ */
|
|
6434
|
-
showLabel ? /* @__PURE__ */
|
|
6435
|
-
/* @__PURE__ */
|
|
6436
|
-
/* @__PURE__ */
|
|
6338
|
+
return /* @__PURE__ */ jsxs58(View59, { style: [styles53.root, vertical ? styles53.rootVertical : null, disabled ? styles53.disabled : null, style], children: [
|
|
6339
|
+
showLabel ? /* @__PURE__ */ jsxs58(View59, { style: styles53.header, children: [
|
|
6340
|
+
/* @__PURE__ */ jsx66(Text19, { style: [styles53.label, { color: theme.textSecondary }], children: label }),
|
|
6341
|
+
/* @__PURE__ */ jsx66(Text19, { "aria-hidden": true, style: [styles53.value, { color: theme.textSecondary }], children: current.map(formatValue).join(" \u2013 ") })
|
|
6437
6342
|
] }) : null,
|
|
6438
|
-
/* @__PURE__ */
|
|
6439
|
-
/* @__PURE__ */
|
|
6440
|
-
/* @__PURE__ */
|
|
6441
|
-
/* @__PURE__ */
|
|
6442
|
-
/* @__PURE__ */
|
|
6443
|
-
/* @__PURE__ */
|
|
6343
|
+
/* @__PURE__ */ jsxs58(View59, { ...responder.panHandlers, style: vertical ? styles53.controlVertical : styles53.control, children: [
|
|
6344
|
+
/* @__PURE__ */ jsxs58(View59, { onLayout, pointerEvents: "none", style: [vertical ? styles53.trackVertical : styles53.track, { borderRadius: radius3.full, backgroundColor: theme.surface3 }], children: [
|
|
6345
|
+
/* @__PURE__ */ jsx66(View59, { style: [styles53.fill, fill, { borderRadius: radius3.full, overflow: "hidden", backgroundColor: theme.accent }], children: tone3 === "gradient" ? /* @__PURE__ */ jsxs58(Svg28, { width: "100%", height: "100%", "aria-hidden": true, children: [
|
|
6346
|
+
/* @__PURE__ */ jsx66(Defs11, { children: /* @__PURE__ */ jsxs58(LinearGradient10, { id: gradientId, x1: "0", y1: vertical ? "1" : "0", x2: vertical ? "0" : "1", y2: "0", children: [
|
|
6347
|
+
/* @__PURE__ */ jsx66(Stop11, { offset: "0", stopColor: theme.accent }),
|
|
6348
|
+
/* @__PURE__ */ jsx66(Stop11, { offset: "1", stopColor: theme.accent2 })
|
|
6444
6349
|
] }) }),
|
|
6445
|
-
/* @__PURE__ */
|
|
6350
|
+
/* @__PURE__ */ jsx66(Rect6, { width: "100%", height: "100%", fill: `url(#${gradientId})` })
|
|
6446
6351
|
] }) : null }),
|
|
6447
|
-
tickValues.map((t) => /* @__PURE__ */
|
|
6352
|
+
tickValues.map((t) => /* @__PURE__ */ jsx66(View59, { style: [vertical ? styles53.tickVertical : styles53.tick, along(pct(t)), { backgroundColor: t > lo && t < hi ? theme.onAccent : theme.borderStrong }] }, t))
|
|
6448
6353
|
] }),
|
|
6449
|
-
current.map((v, i) => /* @__PURE__ */
|
|
6450
|
-
|
|
6354
|
+
current.map((v, i) => /* @__PURE__ */ jsx66(
|
|
6355
|
+
View59,
|
|
6451
6356
|
{
|
|
6452
6357
|
accessible: true,
|
|
6453
6358
|
role: "slider",
|
|
@@ -6466,16 +6371,16 @@ function Slider({
|
|
|
6466
6371
|
onValueCommit?.(out(values));
|
|
6467
6372
|
},
|
|
6468
6373
|
pointerEvents: "none",
|
|
6469
|
-
style: [
|
|
6470
|
-
children: floatingValue === "always" || floatingValue && dragging === i ? /* @__PURE__ */
|
|
6374
|
+
style: [styles53.thumb, vertical ? { bottom: pct(v) * length, left: (44 - THUMB) / 2, marginLeft: 0, marginTop: 0 } : { left: pct(v) * length - THUMB / 2, top: 0 }, { borderColor: theme.accent, backgroundColor: theme.textOnMedia, shadowColor: theme.scrimStrong }],
|
|
6375
|
+
children: floatingValue === "always" || floatingValue && dragging === i ? /* @__PURE__ */ jsx66(View59, { "aria-hidden": true, style: [vertical ? styles53.bubbleVertical : styles53.bubble, { backgroundColor: theme.textPrimary, borderRadius: radius3.md }], children: /* @__PURE__ */ jsx66(Text19, { style: [styles53.bubbleText, { color: theme.surface0 }], children: formatValue(v) }) }) : null
|
|
6471
6376
|
},
|
|
6472
6377
|
i
|
|
6473
6378
|
))
|
|
6474
6379
|
] }),
|
|
6475
|
-
marks2?.length && !vertical ? /* @__PURE__ */
|
|
6380
|
+
marks2?.length && !vertical ? /* @__PURE__ */ jsx66(View59, { "aria-hidden": true, style: styles53.marks, children: marks2.map((m) => /* @__PURE__ */ jsx66(Text19, { style: [styles53.mark, { left: pct(m.value) * length, color: theme.textSecondary, transform: [{ translateX: m.value === min ? 0 : m.value === max ? -40 : -20 }], textAlign: m.value === min ? "left" : m.value === max ? "right" : "center" }], children: m.label }, m.value)) }) : null
|
|
6476
6381
|
] });
|
|
6477
6382
|
}
|
|
6478
|
-
var
|
|
6383
|
+
var styles53 = StyleSheet53.create({
|
|
6479
6384
|
root: { gap: 8, alignSelf: "stretch" },
|
|
6480
6385
|
rootVertical: { alignSelf: "flex-start", alignItems: "center" },
|
|
6481
6386
|
header: { flexDirection: "row", justifyContent: "space-between", alignItems: "baseline", gap: 12 },
|
|
@@ -6511,10 +6416,10 @@ var styles54 = StyleSheet54.create({
|
|
|
6511
6416
|
|
|
6512
6417
|
// src/native/spinner.tsx
|
|
6513
6418
|
import { ActivityIndicator as ActivityIndicator2 } from "react-native";
|
|
6514
|
-
import { jsx as
|
|
6419
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
6515
6420
|
function Spinner({ label, size = "md", ...props }) {
|
|
6516
6421
|
const { theme } = useTheme();
|
|
6517
|
-
return /* @__PURE__ */
|
|
6422
|
+
return /* @__PURE__ */ jsx67(
|
|
6518
6423
|
ActivityIndicator2,
|
|
6519
6424
|
{
|
|
6520
6425
|
accessible: true,
|
|
@@ -6529,15 +6434,15 @@ function Spinner({ label, size = "md", ...props }) {
|
|
|
6529
6434
|
}
|
|
6530
6435
|
|
|
6531
6436
|
// src/native/splash-handoff.tsx
|
|
6532
|
-
import * as
|
|
6533
|
-
import { Animated as Animated23, Easing as Easing12, StyleSheet as
|
|
6534
|
-
import { jsx as
|
|
6437
|
+
import * as React48 from "react";
|
|
6438
|
+
import { Animated as Animated23, Easing as Easing12, StyleSheet as StyleSheet54, View as View60 } from "react-native";
|
|
6439
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
6535
6440
|
function SplashHandoff({ product, ready, onShown, onDone, size = 96, background, label, duration = 320, style }) {
|
|
6536
6441
|
const { theme } = useTheme();
|
|
6537
6442
|
const reduce = useReducedMotion();
|
|
6538
|
-
const [opacity] =
|
|
6539
|
-
const [gone, setGone] =
|
|
6540
|
-
|
|
6443
|
+
const [opacity] = React48.useState(() => new Animated23.Value(1));
|
|
6444
|
+
const [gone, setGone] = React48.useState(false);
|
|
6445
|
+
React48.useEffect(() => {
|
|
6541
6446
|
if (!ready) return;
|
|
6542
6447
|
const animation = Animated23.timing(opacity, { toValue: 0, duration: reduce ? 0 : duration, easing: Easing12.out(Easing12.ease), useNativeDriver: true });
|
|
6543
6448
|
animation.start(({ finished }) => {
|
|
@@ -6549,7 +6454,7 @@ function SplashHandoff({ product, ready, onShown, onDone, size = 96, background,
|
|
|
6549
6454
|
return () => animation.stop();
|
|
6550
6455
|
}, [ready, reduce, duration, opacity, onDone]);
|
|
6551
6456
|
if (gone) return null;
|
|
6552
|
-
return /* @__PURE__ */
|
|
6457
|
+
return /* @__PURE__ */ jsx68(
|
|
6553
6458
|
Animated23.View,
|
|
6554
6459
|
{
|
|
6555
6460
|
accessible: true,
|
|
@@ -6558,17 +6463,17 @@ function SplashHandoff({ product, ready, onShown, onDone, size = 96, background,
|
|
|
6558
6463
|
"aria-busy": true,
|
|
6559
6464
|
pointerEvents: ready ? "none" : "auto",
|
|
6560
6465
|
onLayout: onShown,
|
|
6561
|
-
style: [
|
|
6562
|
-
children: /* @__PURE__ */
|
|
6466
|
+
style: [StyleSheet54.absoluteFill, styles54.root, { backgroundColor: background ?? theme.surface0, opacity }, style],
|
|
6467
|
+
children: /* @__PURE__ */ jsx68(View60, { children: /* @__PURE__ */ jsx68(ProductMark, { id: product, size, animated: true }) })
|
|
6563
6468
|
}
|
|
6564
6469
|
);
|
|
6565
6470
|
}
|
|
6566
|
-
var
|
|
6471
|
+
var styles54 = StyleSheet54.create({ root: { alignItems: "center", justifyContent: "center", zIndex: 100 } });
|
|
6567
6472
|
|
|
6568
6473
|
// src/native/state-screen.tsx
|
|
6569
|
-
import { StyleSheet as
|
|
6570
|
-
import
|
|
6571
|
-
import { Fragment as Fragment12, jsx as
|
|
6474
|
+
import { StyleSheet as StyleSheet55, View as View61 } from "react-native";
|
|
6475
|
+
import Svg29, { Path as Path23 } from "react-native-svg";
|
|
6476
|
+
import { Fragment as Fragment12, jsx as jsx69, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
6572
6477
|
var PATHS = {
|
|
6573
6478
|
empty: ["M4 13l2-7h12l2 7", "M4 13v5h16v-5", "M4 13h5l1 2h4l1-2h5"],
|
|
6574
6479
|
error: ["M12 4 3 20h18L12 4z", "M12 10v4", "M12 17h.01"],
|
|
@@ -6576,31 +6481,31 @@ var PATHS = {
|
|
|
6576
6481
|
};
|
|
6577
6482
|
function KindIcon({ kind }) {
|
|
6578
6483
|
const { theme } = useTheme();
|
|
6579
|
-
return /* @__PURE__ */
|
|
6484
|
+
return /* @__PURE__ */ jsx69(Svg29, { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: kind === "error" ? theme.dangerText : theme.textSecondary, strokeWidth: 1.8, strokeLinecap: "round", strokeLinejoin: "round", children: PATHS[kind].map((d) => /* @__PURE__ */ jsx69(Path23, { d }, d)) });
|
|
6580
6485
|
}
|
|
6581
6486
|
function StateScreen({ kind, title, description, action, secondary, icon, inline, testID, style }) {
|
|
6582
|
-
const body = /* @__PURE__ */
|
|
6487
|
+
const body = /* @__PURE__ */ jsx69(
|
|
6583
6488
|
EmptyState,
|
|
6584
6489
|
{
|
|
6585
|
-
icon: icon ?? /* @__PURE__ */
|
|
6490
|
+
icon: icon ?? /* @__PURE__ */ jsx69(KindIcon, { kind }),
|
|
6586
6491
|
title,
|
|
6587
6492
|
description,
|
|
6588
|
-
action: action || secondary ? /* @__PURE__ */
|
|
6589
|
-
action ? /* @__PURE__ */
|
|
6590
|
-
secondary ? /* @__PURE__ */
|
|
6493
|
+
action: action || secondary ? /* @__PURE__ */ jsxs59(Fragment12, { children: [
|
|
6494
|
+
action ? /* @__PURE__ */ jsx69(Button, { label: action.label, variant: "primary", onPress: action.onPress }) : null,
|
|
6495
|
+
secondary ? /* @__PURE__ */ jsx69(Button, { label: secondary.label, variant: "ghost", onPress: secondary.onPress }) : null
|
|
6591
6496
|
] }) : void 0
|
|
6592
6497
|
}
|
|
6593
6498
|
);
|
|
6594
|
-
return /* @__PURE__ */
|
|
6499
|
+
return /* @__PURE__ */ jsx69(View61, { testID, role: kind === "error" ? "alert" : kind === "offline" ? "status" : void 0, "data-state": kind, style: [inline ? styles55.inline : styles55.fill, style], children: body });
|
|
6595
6500
|
}
|
|
6596
6501
|
function OfflineBanner({ label, actionLabel, onAction, testID }) {
|
|
6597
6502
|
const { theme, insets } = useTheme();
|
|
6598
|
-
return /* @__PURE__ */
|
|
6599
|
-
/* @__PURE__ */
|
|
6600
|
-
actionLabel && onAction ? /* @__PURE__ */
|
|
6503
|
+
return /* @__PURE__ */ jsxs59(View61, { testID, role: "status", style: [styles55.banner, { backgroundColor: theme.warningSoft, paddingTop: 8 + insets.top }], children: [
|
|
6504
|
+
/* @__PURE__ */ jsx69(Txt, { variant: "caption", style: styles55.bannerText, children: label }),
|
|
6505
|
+
actionLabel && onAction ? /* @__PURE__ */ jsx69(Button, { label: actionLabel, size: "sm", variant: "ghost", onPress: onAction }) : null
|
|
6601
6506
|
] });
|
|
6602
6507
|
}
|
|
6603
|
-
var
|
|
6508
|
+
var styles55 = StyleSheet55.create({
|
|
6604
6509
|
fill: { flex: 1, alignSelf: "stretch", alignItems: "center", justifyContent: "center" },
|
|
6605
6510
|
inline: { alignSelf: "stretch", alignItems: "center" },
|
|
6606
6511
|
banner: { flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: 16, paddingBottom: 8 },
|
|
@@ -6608,9 +6513,9 @@ var styles56 = StyleSheet56.create({
|
|
|
6608
6513
|
});
|
|
6609
6514
|
|
|
6610
6515
|
// src/native/status-chip.tsx
|
|
6611
|
-
import * as
|
|
6612
|
-
import { Pressable as
|
|
6613
|
-
import { Fragment as Fragment13, jsx as
|
|
6516
|
+
import * as React49 from "react";
|
|
6517
|
+
import { Pressable as Pressable30 } from "react-native";
|
|
6518
|
+
import { Fragment as Fragment13, jsx as jsx70, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
6614
6519
|
function StatusChip({
|
|
6615
6520
|
label,
|
|
6616
6521
|
tone: tone3 = "neutral",
|
|
@@ -6622,14 +6527,14 @@ function StatusChip({
|
|
|
6622
6527
|
cancelLabel = "Cancel",
|
|
6623
6528
|
size = "sm"
|
|
6624
6529
|
}) {
|
|
6625
|
-
const [open, setOpen] =
|
|
6626
|
-
const [armed, setArmed] =
|
|
6627
|
-
const [asking, setAsking] =
|
|
6628
|
-
const badge = /* @__PURE__ */
|
|
6530
|
+
const [open, setOpen] = React49.useState(false);
|
|
6531
|
+
const [armed, setArmed] = React49.useState(null);
|
|
6532
|
+
const [asking, setAsking] = React49.useState(null);
|
|
6533
|
+
const badge = /* @__PURE__ */ jsx70(Badge, { tone: tone3, size, dot: true, children: label });
|
|
6629
6534
|
if (!onMove || moves.length === 0) return badge;
|
|
6630
|
-
return /* @__PURE__ */
|
|
6631
|
-
/* @__PURE__ */
|
|
6632
|
-
/* @__PURE__ */
|
|
6535
|
+
return /* @__PURE__ */ jsxs60(Fragment13, { children: [
|
|
6536
|
+
/* @__PURE__ */ jsx70(Pressable30, { role: "button", "aria-label": menuLabel(label), "aria-haspopup": "menu", hitSlop: 8, onPress: () => setOpen(true), style: { alignSelf: "flex-start" }, children: badge }),
|
|
6537
|
+
/* @__PURE__ */ jsx70(
|
|
6633
6538
|
ActionSheet,
|
|
6634
6539
|
{
|
|
6635
6540
|
open,
|
|
@@ -6657,7 +6562,7 @@ function StatusChip({
|
|
|
6657
6562
|
}))
|
|
6658
6563
|
}
|
|
6659
6564
|
),
|
|
6660
|
-
/* @__PURE__ */
|
|
6565
|
+
/* @__PURE__ */ jsx70(
|
|
6661
6566
|
ActionSheet,
|
|
6662
6567
|
{
|
|
6663
6568
|
open: asking !== null,
|
|
@@ -6678,36 +6583,36 @@ function StatusChip({
|
|
|
6678
6583
|
}
|
|
6679
6584
|
|
|
6680
6585
|
// src/native/stepper.tsx
|
|
6681
|
-
import { StyleSheet as
|
|
6682
|
-
import
|
|
6683
|
-
import { jsx as
|
|
6586
|
+
import { StyleSheet as StyleSheet56, View as View62 } from "react-native";
|
|
6587
|
+
import Svg30, { Circle as Circle13, Path as Path24 } from "react-native-svg";
|
|
6588
|
+
import { jsx as jsx71, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
6684
6589
|
var WORDS = { done: "done", current: "in progress", upcoming: "to come", error: "failed" };
|
|
6685
6590
|
function Stepper({ steps, current = 0, orientation = "vertical", statusLabels, "aria-label": label, style }) {
|
|
6686
6591
|
const { theme } = useTheme();
|
|
6687
6592
|
const words2 = { ...WORDS, ...statusLabels };
|
|
6688
6593
|
const vertical = orientation === "vertical";
|
|
6689
|
-
return /* @__PURE__ */
|
|
6594
|
+
return /* @__PURE__ */ jsx71(View62, { role: "list", "aria-label": label, style: [vertical ? styles56.column : styles56.row, style], children: steps.map((step, i) => {
|
|
6690
6595
|
const status = step.status ?? (i < current ? "done" : i === current ? "current" : "upcoming");
|
|
6691
6596
|
const last = i === steps.length - 1;
|
|
6692
|
-
const node = status === "current" ? /* @__PURE__ */
|
|
6693
|
-
/* @__PURE__ */
|
|
6694
|
-
status === "done" ? /* @__PURE__ */
|
|
6597
|
+
const node = status === "current" ? /* @__PURE__ */ jsx71(LoaderGlyph, { value: step.value ?? null, size: 24 }) : status === "error" ? /* @__PURE__ */ jsx71(LoaderGlyph, { state: "error", size: 24 }) : /* @__PURE__ */ jsxs61(Svg30, { width: 24, height: 24, viewBox: "0 0 24 24", "aria-hidden": true, children: [
|
|
6598
|
+
/* @__PURE__ */ jsx71(Circle13, { cx: 12, cy: 12, r: 10, fill: status === "done" ? theme.accent : "none", stroke: status === "done" ? theme.accent : theme.borderStrong, strokeWidth: 2 }),
|
|
6599
|
+
status === "done" ? /* @__PURE__ */ jsx71(Path24, { d: "M7.5 12.3l3 3 6-6.3", stroke: theme.onAccent, strokeWidth: 2.2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) : null
|
|
6695
6600
|
] });
|
|
6696
|
-
const connector = !last ? /* @__PURE__ */
|
|
6697
|
-
return /* @__PURE__ */
|
|
6698
|
-
/* @__PURE__ */
|
|
6601
|
+
const connector = !last ? /* @__PURE__ */ jsx71(View62, { "aria-hidden": true, style: [vertical ? styles56.vLine : styles56.hLine, { backgroundColor: status === "done" ? theme.accent : theme.borderDefault }] }) : null;
|
|
6602
|
+
return /* @__PURE__ */ jsxs61(View62, { role: "listitem", accessible: true, "aria-label": `${step.title}, ${words2[status]}`, style: vertical ? styles56.vStep : styles56.hStep, children: [
|
|
6603
|
+
/* @__PURE__ */ jsxs61(View62, { style: vertical ? styles56.vRail : styles56.hRail, children: [
|
|
6699
6604
|
node,
|
|
6700
6605
|
connector
|
|
6701
6606
|
] }),
|
|
6702
|
-
/* @__PURE__ */
|
|
6703
|
-
/* @__PURE__ */
|
|
6704
|
-
step.description ? /* @__PURE__ */
|
|
6705
|
-
step.content && (status === "current" || status === "error") ? /* @__PURE__ */
|
|
6607
|
+
/* @__PURE__ */ jsxs61(View62, { style: [styles56.body, vertical && !last ? { paddingBottom: 20 } : null], children: [
|
|
6608
|
+
/* @__PURE__ */ jsx71(Txt, { variant: "label", tone: status === "upcoming" ? "secondary" : "text", numberOfLines: vertical ? void 0 : 2, children: step.title }),
|
|
6609
|
+
step.description ? /* @__PURE__ */ jsx71(Txt, { variant: "caption", tone: "secondary", children: step.description }) : null,
|
|
6610
|
+
step.content && (status === "current" || status === "error") ? /* @__PURE__ */ jsx71(View62, { style: styles56.content, children: step.content }) : null
|
|
6706
6611
|
] })
|
|
6707
6612
|
] }, i);
|
|
6708
6613
|
}) });
|
|
6709
6614
|
}
|
|
6710
|
-
var
|
|
6615
|
+
var styles56 = StyleSheet56.create({
|
|
6711
6616
|
column: { gap: 0 },
|
|
6712
6617
|
row: { flexDirection: "row" },
|
|
6713
6618
|
vStep: { flexDirection: "row", gap: 12 },
|
|
@@ -6721,59 +6626,59 @@ var styles57 = StyleSheet57.create({
|
|
|
6721
6626
|
});
|
|
6722
6627
|
|
|
6723
6628
|
// src/native/swipe-deck.tsx
|
|
6724
|
-
import * as
|
|
6725
|
-
import { AccessibilityInfo as AccessibilityInfo13, Animated as Animated24, Image as
|
|
6726
|
-
import
|
|
6727
|
-
import { Fragment as Fragment14, jsx as
|
|
6629
|
+
import * as React50 from "react";
|
|
6630
|
+
import { AccessibilityInfo as AccessibilityInfo13, Animated as Animated24, Image as Image4, PanResponder as PanResponder3, Platform as Platform4, Pressable as Pressable31, StyleSheet as StyleSheet57, useWindowDimensions as useWindowDimensions3, View as View63 } from "react-native";
|
|
6631
|
+
import Svg31, { Defs as Defs12, LinearGradient as LinearGradient11, Path as Path25, Rect as Rect7, Stop as Stop12 } from "react-native-svg";
|
|
6632
|
+
import { Fragment as Fragment14, jsx as jsx72, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
6728
6633
|
function PersonCard({ photos, name, age, badge, meta, bio, footer, photoLabel = (n, t) => `Photo ${n} of ${t}`, style }) {
|
|
6729
6634
|
const { theme, radius: radius3 } = useTheme();
|
|
6730
|
-
const [index, setIndex] =
|
|
6635
|
+
const [index, setIndex] = React50.useState(0);
|
|
6731
6636
|
const gradient = useSvgId("kz-profile-");
|
|
6732
|
-
const [box, setBox] =
|
|
6637
|
+
const [box, setBox] = React50.useState(null);
|
|
6733
6638
|
const photo = photos[index];
|
|
6734
|
-
return /* @__PURE__ */
|
|
6735
|
-
|
|
6639
|
+
return /* @__PURE__ */ jsxs62(
|
|
6640
|
+
View63,
|
|
6736
6641
|
{
|
|
6737
6642
|
accessible: Platform4.OS !== "web",
|
|
6738
6643
|
accessibilityActions: photos.length > 1 ? [{ name: "increment" }, { name: "decrement" }] : [],
|
|
6739
6644
|
onAccessibilityAction: (e) => setIndex((i) => Math.max(0, Math.min(photos.length - 1, i + (e.nativeEvent.actionName === "increment" ? 1 : -1)))),
|
|
6740
6645
|
role: Platform4.OS === "web" ? "group" : "img",
|
|
6741
6646
|
"aria-label": [`${name}${age !== void 0 ? `, ${age}` : ""}`, bio, photos.length > 1 ? photoLabel(index + 1, photos.length) : null].filter(Boolean).join(". "),
|
|
6742
|
-
style: [
|
|
6647
|
+
style: [styles57.card, { borderRadius: radius3.xl, backgroundColor: theme.media }, style],
|
|
6743
6648
|
children: [
|
|
6744
|
-
photo ? /* @__PURE__ */
|
|
6745
|
-
photos.length > 1 ? /* @__PURE__ */
|
|
6746
|
-
/* @__PURE__ */
|
|
6747
|
-
/* @__PURE__ */
|
|
6748
|
-
/* @__PURE__ */
|
|
6649
|
+
photo ? /* @__PURE__ */ jsx72(Image4, { testID: "person-card-photo", source: { uri: photo.uri }, style: StyleSheet57.absoluteFill, resizeMode: "cover" }) : null,
|
|
6650
|
+
photos.length > 1 ? /* @__PURE__ */ jsxs62(Fragment14, { children: [
|
|
6651
|
+
/* @__PURE__ */ jsx72(View63, { style: styles57.bars, "aria-hidden": true, children: photos.map((_, i) => /* @__PURE__ */ jsx72(View63, { style: [styles57.bar, { backgroundColor: theme.textOnMedia, opacity: i === index ? 1 : 0.4 }] }, i)) }),
|
|
6652
|
+
/* @__PURE__ */ jsx72(Pressable31, { "aria-hidden": true, accessible: false, focusable: false, tabIndex: -1, style: [styles57.half, { left: 0 }], onPress: () => setIndex((i) => Math.max(0, i - 1)) }),
|
|
6653
|
+
/* @__PURE__ */ jsx72(Pressable31, { "aria-hidden": true, accessible: false, focusable: false, tabIndex: -1, style: [styles57.half, { right: 0 }], onPress: () => setIndex((i) => Math.min(photos.length - 1, i + 1)) })
|
|
6749
6654
|
] }) : null,
|
|
6750
|
-
/* @__PURE__ */
|
|
6751
|
-
|
|
6655
|
+
/* @__PURE__ */ jsxs62(
|
|
6656
|
+
View63,
|
|
6752
6657
|
{
|
|
6753
6658
|
testID: "person-card-overlay",
|
|
6754
6659
|
pointerEvents: "box-none",
|
|
6755
|
-
style:
|
|
6660
|
+
style: styles57.bottom,
|
|
6756
6661
|
onLayout: (e) => setBox({ width: e.nativeEvent.layout.width, height: e.nativeEvent.layout.height }),
|
|
6757
6662
|
children: [
|
|
6758
|
-
box ? /* @__PURE__ */
|
|
6759
|
-
/* @__PURE__ */
|
|
6760
|
-
/* @__PURE__ */
|
|
6761
|
-
/* @__PURE__ */
|
|
6762
|
-
/* @__PURE__ */
|
|
6663
|
+
box ? /* @__PURE__ */ jsxs62(Svg31, { testID: "person-card-scrim", style: styles57.scrim, width: box.width, height: box.height, "aria-hidden": true, children: [
|
|
6664
|
+
/* @__PURE__ */ jsx72(Defs12, { children: /* @__PURE__ */ jsxs62(LinearGradient11, { id: gradient, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6665
|
+
/* @__PURE__ */ jsx72(Stop12, { offset: "0", stopColor: theme.scrimStrong, stopOpacity: 0 }),
|
|
6666
|
+
/* @__PURE__ */ jsx72(Stop12, { offset: "0.5", stopColor: theme.scrimStrong, stopOpacity: 0.8 }),
|
|
6667
|
+
/* @__PURE__ */ jsx72(Stop12, { offset: "1", stopColor: theme.scrimStrong, stopOpacity: 1 })
|
|
6763
6668
|
] }) }),
|
|
6764
|
-
/* @__PURE__ */
|
|
6669
|
+
/* @__PURE__ */ jsx72(Rect7, { x: 0, y: 0, width: box.width, height: box.height, fill: `url(#${gradient})` })
|
|
6765
6670
|
] }) : null,
|
|
6766
|
-
/* @__PURE__ */
|
|
6767
|
-
/* @__PURE__ */
|
|
6768
|
-
/* @__PURE__ */
|
|
6671
|
+
/* @__PURE__ */ jsxs62(View63, { style: styles57.text, children: [
|
|
6672
|
+
/* @__PURE__ */ jsxs62(View63, { style: styles57.nameRow, children: [
|
|
6673
|
+
/* @__PURE__ */ jsxs62(Txt, { variant: "display", tone: "onMedia", style: styles57.name, numberOfLines: 1, children: [
|
|
6769
6674
|
name,
|
|
6770
|
-
age !== void 0 ? /* @__PURE__ */
|
|
6675
|
+
age !== void 0 ? /* @__PURE__ */ jsx72(Txt, { variant: "display", tone: "onMedia", style: styles57.age, children: ` ${age}` }) : null
|
|
6771
6676
|
] }),
|
|
6772
6677
|
badge
|
|
6773
6678
|
] }),
|
|
6774
6679
|
meta,
|
|
6775
|
-
bio ? /* @__PURE__ */
|
|
6776
|
-
footer ? /* @__PURE__ */
|
|
6680
|
+
bio ? /* @__PURE__ */ jsx72(Txt, { tone: "onMedia", numberOfLines: 2, children: bio }) : null,
|
|
6681
|
+
footer ? /* @__PURE__ */ jsx72(View63, { style: styles57.footer, children: footer }) : null
|
|
6777
6682
|
] })
|
|
6778
6683
|
]
|
|
6779
6684
|
}
|
|
@@ -6786,9 +6691,9 @@ function SwipeDeck({ items: items2, getId, renderCard, onSwipe, empty: empty2, l
|
|
|
6786
6691
|
const { theme, haptic } = useTheme();
|
|
6787
6692
|
const reduce = useReducedMotion();
|
|
6788
6693
|
const { width } = useWindowDimensions3();
|
|
6789
|
-
const [x] =
|
|
6694
|
+
const [x] = React50.useState(() => new Animated24.Value(0));
|
|
6790
6695
|
const top = items2[0];
|
|
6791
|
-
const decide =
|
|
6696
|
+
const decide = React50.useCallback(
|
|
6792
6697
|
(direction) => {
|
|
6793
6698
|
if (!top) return;
|
|
6794
6699
|
haptic("impact");
|
|
@@ -6802,7 +6707,7 @@ function SwipeDeck({ items: items2, getId, renderCard, onSwipe, empty: empty2, l
|
|
|
6802
6707
|
},
|
|
6803
6708
|
[top, haptic, reduce, x, width, onSwipe, items2.length, labels.empty]
|
|
6804
6709
|
);
|
|
6805
|
-
const pan =
|
|
6710
|
+
const pan = React50.useMemo(
|
|
6806
6711
|
() => PanResponder3.create({
|
|
6807
6712
|
onMoveShouldSetPanResponder: (_, g) => Math.abs(g.dx) > 8 && Math.abs(g.dx) > Math.abs(g.dy),
|
|
6808
6713
|
onPanResponderMove: (_, g) => x.setValue(g.dx),
|
|
@@ -6817,26 +6722,26 @@ function SwipeDeck({ items: items2, getId, renderCard, onSwipe, empty: empty2, l
|
|
|
6817
6722
|
const rotate = x.interpolate({ inputRange: [-width, 0, width], outputRange: ["-14deg", "0deg", "14deg"] });
|
|
6818
6723
|
const likeOpacity = x.interpolate({ inputRange: [0, width / 4], outputRange: [0, 1], extrapolate: "clamp" });
|
|
6819
6724
|
const passOpacity = x.interpolate({ inputRange: [-width / 4, 0], outputRange: [1, 0], extrapolate: "clamp" });
|
|
6820
|
-
const button = (direction) => /* @__PURE__ */
|
|
6821
|
-
|
|
6725
|
+
const button = (direction) => /* @__PURE__ */ jsx72(
|
|
6726
|
+
Pressable31,
|
|
6822
6727
|
{
|
|
6823
6728
|
role: "button",
|
|
6824
6729
|
"aria-label": direction === "like" ? labels.like : labels.pass,
|
|
6825
6730
|
disabled: !top,
|
|
6826
6731
|
onPress: () => decide(direction),
|
|
6827
6732
|
style: ({ pressed }) => [
|
|
6828
|
-
|
|
6733
|
+
styles57.button,
|
|
6829
6734
|
{ borderColor: direction === "like" ? theme.success : theme.danger, backgroundColor: theme.surface1, transform: [{ scale: pressed ? 0.92 : 1 }], opacity: top ? 1 : 0.4 }
|
|
6830
6735
|
],
|
|
6831
|
-
children: /* @__PURE__ */
|
|
6736
|
+
children: /* @__PURE__ */ jsx72(Svg31, { width: 28, height: 28, viewBox: "0 0 24 24", "aria-hidden": true, children: direction === "like" ? /* @__PURE__ */ jsx72(Path25, { d: "M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z", fill: theme.success }) : /* @__PURE__ */ jsx72(Path25, { d: "M6 6l12 12M18 6 6 18", stroke: theme.danger, strokeWidth: 3, strokeLinecap: "round" }) })
|
|
6832
6737
|
}
|
|
6833
6738
|
);
|
|
6834
|
-
return /* @__PURE__ */
|
|
6835
|
-
/* @__PURE__ */
|
|
6739
|
+
return /* @__PURE__ */ jsxs62(View63, { style: [styles57.deck, style], children: [
|
|
6740
|
+
/* @__PURE__ */ jsxs62(View63, { style: styles57.stack, children: [
|
|
6836
6741
|
!top ? empty2 ?? null : null,
|
|
6837
6742
|
items2.slice(0, 2).reverse().map((item) => {
|
|
6838
6743
|
const isTop = item === top;
|
|
6839
|
-
return /* @__PURE__ */
|
|
6744
|
+
return /* @__PURE__ */ jsxs62(
|
|
6840
6745
|
Animated24.View,
|
|
6841
6746
|
{
|
|
6842
6747
|
...isTop ? pan.panHandlers : {},
|
|
@@ -6845,12 +6750,12 @@ function SwipeDeck({ items: items2, getId, renderCard, onSwipe, empty: empty2, l
|
|
|
6845
6750
|
"aria-hidden": !isTop,
|
|
6846
6751
|
importantForAccessibility: isTop ? "auto" : "no-hide-descendants",
|
|
6847
6752
|
pointerEvents: isTop ? "auto" : "none",
|
|
6848
|
-
style: [
|
|
6753
|
+
style: [StyleSheet57.absoluteFill, isTop ? { transform: [{ translateX: x }, { rotate }] } : { transform: [{ scale: 0.96 }], opacity: 0.9 }],
|
|
6849
6754
|
children: [
|
|
6850
6755
|
renderCard(item),
|
|
6851
|
-
isTop ? /* @__PURE__ */
|
|
6852
|
-
/* @__PURE__ */
|
|
6853
|
-
/* @__PURE__ */
|
|
6756
|
+
isTop ? /* @__PURE__ */ jsxs62(Fragment14, { children: [
|
|
6757
|
+
/* @__PURE__ */ jsx72(Animated24.View, { pointerEvents: "none", style: [styles57.stamp, styles57.stampLike, { borderColor: theme.success, opacity: likeOpacity }], "aria-hidden": true, children: /* @__PURE__ */ jsx72(Txt, { variant: "title", style: { color: theme.success }, children: labels.likeStamp ?? labels.like.toUpperCase() }) }),
|
|
6758
|
+
/* @__PURE__ */ jsx72(Animated24.View, { pointerEvents: "none", style: [styles57.stamp, styles57.stampPass, { borderColor: theme.danger, opacity: passOpacity }], "aria-hidden": true, children: /* @__PURE__ */ jsx72(Txt, { variant: "title", style: { color: theme.danger }, children: labels.passStamp ?? labels.pass.toUpperCase() }) })
|
|
6854
6759
|
] }) : null
|
|
6855
6760
|
]
|
|
6856
6761
|
},
|
|
@@ -6858,13 +6763,13 @@ function SwipeDeck({ items: items2, getId, renderCard, onSwipe, empty: empty2, l
|
|
|
6858
6763
|
);
|
|
6859
6764
|
})
|
|
6860
6765
|
] }),
|
|
6861
|
-
hideButtons ? null : /* @__PURE__ */
|
|
6766
|
+
hideButtons ? null : /* @__PURE__ */ jsxs62(View63, { style: styles57.buttons, children: [
|
|
6862
6767
|
button("pass"),
|
|
6863
6768
|
button("like")
|
|
6864
6769
|
] })
|
|
6865
6770
|
] });
|
|
6866
6771
|
}
|
|
6867
|
-
var
|
|
6772
|
+
var styles57 = StyleSheet57.create({
|
|
6868
6773
|
card: { flex: 1, overflow: "hidden" },
|
|
6869
6774
|
bars: { position: "absolute", top: 8, left: 8, right: 8, flexDirection: "row", gap: 4 },
|
|
6870
6775
|
bar: { flex: 1, height: 3, borderRadius: 2 },
|
|
@@ -6886,18 +6791,18 @@ var styles58 = StyleSheet58.create({
|
|
|
6886
6791
|
});
|
|
6887
6792
|
|
|
6888
6793
|
// src/native/swipeable-row.tsx
|
|
6889
|
-
import * as
|
|
6890
|
-
import { Animated as Animated25, PanResponder as PanResponder4, Pressable as
|
|
6891
|
-
import { jsx as
|
|
6794
|
+
import * as React51 from "react";
|
|
6795
|
+
import { Animated as Animated25, PanResponder as PanResponder4, Pressable as Pressable32, StyleSheet as StyleSheet58, View as View64 } from "react-native";
|
|
6796
|
+
import { jsx as jsx73, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
6892
6797
|
var toneColor = (t, tone3) => ({ neutral: t.surface3, accent: t.accent, success: t.success, warning: t.warning, danger: t.danger })[tone3 ?? "neutral"];
|
|
6893
6798
|
var toneText = (tone3) => tone3 === "neutral" || tone3 === void 0 ? "text" : "onAccent";
|
|
6894
6799
|
function SwipeableRow({ children, trailing = [], leading = [], fullSwipe = 0.6, actionWidth = 80, onActivate, testID, style }) {
|
|
6895
6800
|
const { theme, haptic } = useTheme();
|
|
6896
6801
|
const reduce = useReducedMotion();
|
|
6897
|
-
const [x] =
|
|
6898
|
-
const [width, setWidth] =
|
|
6899
|
-
const rest =
|
|
6900
|
-
const armed =
|
|
6802
|
+
const [x] = React51.useState(() => new Animated25.Value(0));
|
|
6803
|
+
const [width, setWidth] = React51.useState(0);
|
|
6804
|
+
const rest = React51.useRef(0);
|
|
6805
|
+
const armed = React51.useRef(false);
|
|
6901
6806
|
const settle = (to) => {
|
|
6902
6807
|
rest.current = to;
|
|
6903
6808
|
if (reduce) x.setValue(to);
|
|
@@ -6907,7 +6812,7 @@ function SwipeableRow({ children, trailing = [], leading = [], fullSwipe = 0.6,
|
|
|
6907
6812
|
settle(0);
|
|
6908
6813
|
action.onPress();
|
|
6909
6814
|
};
|
|
6910
|
-
const pan =
|
|
6815
|
+
const pan = React51.useMemo(
|
|
6911
6816
|
() => PanResponder4.create({
|
|
6912
6817
|
onMoveShouldSetPanResponder: (_, g) => Math.abs(g.dx) > 8 && Math.abs(g.dx) > Math.abs(g.dy) * 1.5,
|
|
6913
6818
|
onPanResponderMove: (_, g) => {
|
|
@@ -6936,18 +6841,18 @@ function SwipeableRow({ children, trailing = [], leading = [], fullSwipe = 0.6,
|
|
|
6936
6841
|
[trailing, leading, fullSwipe, width, actionWidth]
|
|
6937
6842
|
// eslint-disable-line react-hooks/exhaustive-deps -- run/settle are stable in effect
|
|
6938
6843
|
);
|
|
6939
|
-
const side = (actions, edge) => /* @__PURE__ */
|
|
6844
|
+
const side = (actions, edge) => /* @__PURE__ */ jsx73(View64, { "aria-hidden": true, style: [styles58.side, edge === "left" ? { left: 0 } : { right: 0, flexDirection: "row-reverse" }], children: actions.map((action, i) => (
|
|
6940
6845
|
// eslint-disable-next-line react-hooks/refs -- runs on a press, never during render
|
|
6941
|
-
/* @__PURE__ */
|
|
6846
|
+
/* @__PURE__ */ jsxs63(Pressable32, { focusable: false, tabIndex: -1, onPress: () => run(action), style: [styles58.action, { width: actionWidth, backgroundColor: toneColor(theme, action.tone) }], children: [
|
|
6942
6847
|
action.icon,
|
|
6943
|
-
/* @__PURE__ */
|
|
6848
|
+
/* @__PURE__ */ jsx73(Txt, { variant: "caption", tone: toneText(action.tone), style: styles58.actionText, numberOfLines: 1, children: action.label })
|
|
6944
6849
|
] }, i)
|
|
6945
6850
|
)) });
|
|
6946
6851
|
const all = [...leading, ...trailing];
|
|
6947
|
-
return /* @__PURE__ */
|
|
6852
|
+
return /* @__PURE__ */ jsxs63(View64, { style: [styles58.root, style], onLayout: (e) => setWidth(e.nativeEvent.layout.width), children: [
|
|
6948
6853
|
leading.length > 0 ? side(leading, "left") : null,
|
|
6949
6854
|
trailing.length > 0 ? side(trailing, "right") : null,
|
|
6950
|
-
/* @__PURE__ */
|
|
6855
|
+
/* @__PURE__ */ jsx73(
|
|
6951
6856
|
Animated25.View,
|
|
6952
6857
|
{
|
|
6953
6858
|
...pan.panHandlers,
|
|
@@ -6959,13 +6864,13 @@ function SwipeableRow({ children, trailing = [], leading = [], fullSwipe = 0.6,
|
|
|
6959
6864
|
const action = all.find((a) => a.label === e.nativeEvent.actionName);
|
|
6960
6865
|
if (action) action.onPress();
|
|
6961
6866
|
},
|
|
6962
|
-
style: [
|
|
6867
|
+
style: [styles58.front, { backgroundColor: theme.surface0, transform: [{ translateX: x }] }],
|
|
6963
6868
|
children
|
|
6964
6869
|
}
|
|
6965
6870
|
)
|
|
6966
6871
|
] });
|
|
6967
6872
|
}
|
|
6968
|
-
var
|
|
6873
|
+
var styles58 = StyleSheet58.create({
|
|
6969
6874
|
root: { overflow: "hidden" },
|
|
6970
6875
|
side: { position: "absolute", top: 0, bottom: 0, flexDirection: "row" },
|
|
6971
6876
|
action: { alignItems: "center", justifyContent: "center", gap: 4, paddingHorizontal: 6 },
|
|
@@ -6974,16 +6879,16 @@ var styles59 = StyleSheet59.create({
|
|
|
6974
6879
|
});
|
|
6975
6880
|
|
|
6976
6881
|
// src/native/tab-bar.tsx
|
|
6977
|
-
import { Pressable as
|
|
6978
|
-
import { jsx as
|
|
6882
|
+
import { Pressable as Pressable33, StyleSheet as StyleSheet59, Text as Text20, View as View65 } from "react-native";
|
|
6883
|
+
import { jsx as jsx74, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
6979
6884
|
function TabBar({ items: items2, value, onValueChange, onReselect, "aria-label": label, style }) {
|
|
6980
6885
|
const { theme, insets, haptic } = useTheme();
|
|
6981
|
-
return /* @__PURE__ */
|
|
6886
|
+
return /* @__PURE__ */ jsx74(View65, { role: "tablist", "aria-label": label, style: [styles59.bar, { backgroundColor: theme.glassBg, borderTopColor: theme.glassBorder, paddingBottom: Math.max(6, insets.bottom) }, style], children: items2.map((item) => {
|
|
6982
6887
|
const selected = item.value === value;
|
|
6983
6888
|
const color = selected ? theme.accentText : theme.textSecondary;
|
|
6984
6889
|
const badge = item.badge === true ? "" : typeof item.badge === "number" && item.badge > 0 ? item.badge > 99 ? "99+" : String(item.badge) : null;
|
|
6985
|
-
return /* @__PURE__ */
|
|
6986
|
-
|
|
6890
|
+
return /* @__PURE__ */ jsxs64(
|
|
6891
|
+
Pressable33,
|
|
6987
6892
|
{
|
|
6988
6893
|
role: "tab",
|
|
6989
6894
|
"aria-selected": selected,
|
|
@@ -6992,22 +6897,22 @@ function TabBar({ items: items2, value, onValueChange, onReselect, "aria-label":
|
|
|
6992
6897
|
if (selected) onReselect?.(item.value);
|
|
6993
6898
|
else onValueChange(item.value);
|
|
6994
6899
|
},
|
|
6995
|
-
style: ({ pressed }) => [
|
|
6900
|
+
style: ({ pressed }) => [styles59.item, { opacity: pressed ? 0.7 : 1 }],
|
|
6996
6901
|
children: [
|
|
6997
|
-
/* @__PURE__ */
|
|
6902
|
+
/* @__PURE__ */ jsxs64(View65, { "aria-hidden": true, style: styles59.icon, children: [
|
|
6998
6903
|
item.icon(selected, color),
|
|
6999
|
-
badge !== null ? /* @__PURE__ */
|
|
6904
|
+
badge !== null ? /* @__PURE__ */ jsx74(View65, { style: [badge ? styles59.count : styles59.dot, { backgroundColor: theme.danger, borderColor: theme.surface1 }], children: badge ? /* @__PURE__ */ jsx74(Text20, { style: [styles59.countText, { color: theme.onAccent }], children: badge }) : null }) : null
|
|
7000
6905
|
] }),
|
|
7001
|
-
/* @__PURE__ */
|
|
7002
|
-
badge !== null && item.badgeLabel ? /* @__PURE__ */
|
|
6906
|
+
/* @__PURE__ */ jsx74(Text20, { numberOfLines: 1, style: [styles59.label, { color, fontWeight: selected ? "700" : "500" }], children: item.label }),
|
|
6907
|
+
badge !== null && item.badgeLabel ? /* @__PURE__ */ jsx74(Text20, { style: styles59.unseen, children: `, ${item.badgeLabel}` }) : null
|
|
7003
6908
|
]
|
|
7004
6909
|
},
|
|
7005
6910
|
item.value
|
|
7006
6911
|
);
|
|
7007
6912
|
}) });
|
|
7008
6913
|
}
|
|
7009
|
-
var
|
|
7010
|
-
bar: { flexDirection: "row", borderTopWidth:
|
|
6914
|
+
var styles59 = StyleSheet59.create({
|
|
6915
|
+
bar: { flexDirection: "row", borderTopWidth: StyleSheet59.hairlineWidth, paddingTop: 6 },
|
|
7011
6916
|
item: { flex: 1, alignItems: "center", gap: 2, minHeight: 48, justifyContent: "center" },
|
|
7012
6917
|
icon: { width: 28, height: 26, alignItems: "center", justifyContent: "center" },
|
|
7013
6918
|
label: { fontSize: 11, lineHeight: 14 },
|
|
@@ -7018,12 +6923,12 @@ var styles60 = StyleSheet60.create({
|
|
|
7018
6923
|
});
|
|
7019
6924
|
|
|
7020
6925
|
// src/native/tabs.tsx
|
|
7021
|
-
import * as
|
|
7022
|
-
import { Pressable as
|
|
7023
|
-
import { jsx as
|
|
6926
|
+
import * as React52 from "react";
|
|
6927
|
+
import { Pressable as Pressable34, ScrollView as ScrollView7, StyleSheet as StyleSheet60, View as View66 } from "react-native";
|
|
6928
|
+
import { jsx as jsx75, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
7024
6929
|
function Tabs({ items: items2, value, defaultValue, onValueChange, "aria-label": label, variant = "underline", add, style }) {
|
|
7025
6930
|
const { theme, radius: radius3, haptic } = useTheme();
|
|
7026
|
-
const [own, setOwn] =
|
|
6931
|
+
const [own, setOwn] = React52.useState(defaultValue ?? items2[0]?.value);
|
|
7027
6932
|
const current = value ?? own;
|
|
7028
6933
|
const select = (next) => {
|
|
7029
6934
|
if (next === current) return;
|
|
@@ -7036,8 +6941,8 @@ function Tabs({ items: items2, value, defaultValue, onValueChange, "aria-label":
|
|
|
7036
6941
|
const hueOf = (hue) => ({ accent: theme.accent, success: theme.successText, warning: theme.warningText, danger: theme.dangerText, neutral: theme.textMuted })[hue ?? "accent"];
|
|
7037
6942
|
const tabs = items2.map((item) => {
|
|
7038
6943
|
const selected = item.value === current;
|
|
7039
|
-
return /* @__PURE__ */
|
|
7040
|
-
|
|
6944
|
+
return /* @__PURE__ */ jsx75(
|
|
6945
|
+
Pressable34,
|
|
7041
6946
|
{
|
|
7042
6947
|
role: "tab",
|
|
7043
6948
|
"aria-selected": selected,
|
|
@@ -7045,52 +6950,52 @@ function Tabs({ items: items2, value, defaultValue, onValueChange, "aria-label":
|
|
|
7045
6950
|
disabled: item.disabled,
|
|
7046
6951
|
onPress: () => select(item.value),
|
|
7047
6952
|
style: [
|
|
7048
|
-
binder ? [
|
|
7049
|
-
binder ? null : segmented ?
|
|
6953
|
+
binder ? [styles60.divider, { borderTopColor: hueOf(item.hue), borderColor: theme.borderDefault, borderTopLeftRadius: radius3.md, borderTopRightRadius: radius3.md, backgroundColor: selected ? theme.surface1 : theme.surface2 }] : null,
|
|
6954
|
+
binder ? null : segmented ? styles60.segment : styles60.tab,
|
|
7050
6955
|
segmented && selected ? { backgroundColor: theme.surface0, borderColor: theme.borderDefault, borderRadius: radius3.sm } : null,
|
|
7051
6956
|
!segmented && !binder ? { borderBottomColor: selected ? theme.accent : "transparent" } : null,
|
|
7052
|
-
item.disabled ?
|
|
6957
|
+
item.disabled ? styles60.disabled : null
|
|
7053
6958
|
],
|
|
7054
|
-
children: /* @__PURE__ */
|
|
6959
|
+
children: /* @__PURE__ */ jsxs65(Txt, { variant: "label", tone: selected ? "text" : "secondary", numberOfLines: 1, children: [
|
|
7055
6960
|
item.label,
|
|
7056
|
-
item.count !== void 0 ? /* @__PURE__ */
|
|
6961
|
+
item.count !== void 0 ? /* @__PURE__ */ jsx75(Txt, { variant: "caption", tone: "secondary", children: ` ${item.count}` }) : null
|
|
7057
6962
|
] })
|
|
7058
6963
|
},
|
|
7059
6964
|
item.value
|
|
7060
6965
|
);
|
|
7061
6966
|
});
|
|
7062
6967
|
const panel = items2.find((i) => i.value === current)?.content;
|
|
7063
|
-
return /* @__PURE__ */
|
|
7064
|
-
segmented ? /* @__PURE__ */
|
|
7065
|
-
/* @__PURE__ */
|
|
7066
|
-
binder && add ? /* @__PURE__ */
|
|
6968
|
+
return /* @__PURE__ */ jsxs65(View66, { style: [styles60.root, style], children: [
|
|
6969
|
+
segmented ? /* @__PURE__ */ jsx75(View66, { role: "tablist", "aria-label": label, style: [styles60.track, { backgroundColor: theme.surface2, borderColor: theme.borderSubtle, borderRadius: radius3.md }], children: tabs }) : /* @__PURE__ */ jsxs65(View66, { style: [styles60.underline, binder ? styles60.binderRow : null, { borderBottomColor: binder ? theme.borderDefault : theme.borderSubtle }], children: [
|
|
6970
|
+
/* @__PURE__ */ jsx75(ScrollView7, { horizontal: true, showsHorizontalScrollIndicator: false, role: "tablist", "aria-label": label, contentContainerStyle: [styles60.scroll, binder ? styles60.binderScroll : null], children: tabs }),
|
|
6971
|
+
binder && add ? /* @__PURE__ */ jsx75(Pressable34, { role: "button", "aria-label": add.label, onPress: add.onAdd, hitSlop: 4, style: styles60.add, children: /* @__PURE__ */ jsx75(Txt, { variant: "label", tone: "secondary", children: `+ ${add.label}` }) }) : null
|
|
7067
6972
|
] }),
|
|
7068
|
-
panel !== void 0 ? /* @__PURE__ */
|
|
6973
|
+
panel !== void 0 ? /* @__PURE__ */ jsx75(View66, { role: "tabpanel", children: panel }) : null
|
|
7069
6974
|
] });
|
|
7070
6975
|
}
|
|
7071
|
-
var
|
|
6976
|
+
var styles60 = StyleSheet60.create({
|
|
7072
6977
|
root: { gap: 12 },
|
|
7073
|
-
underline: { borderBottomWidth:
|
|
6978
|
+
underline: { borderBottomWidth: StyleSheet60.hairlineWidth },
|
|
7074
6979
|
scroll: { gap: 4, paddingHorizontal: 4 },
|
|
7075
6980
|
tab: { minHeight: 44, justifyContent: "center", paddingHorizontal: 12, borderBottomWidth: 2 },
|
|
7076
|
-
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth:
|
|
7077
|
-
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth:
|
|
6981
|
+
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth: StyleSheet60.hairlineWidth, height: 40 },
|
|
6982
|
+
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth: StyleSheet60.hairlineWidth, borderColor: "transparent" },
|
|
7078
6983
|
disabled: { opacity: 0.4 },
|
|
7079
6984
|
// A divider: a coloured top edge, its words; the selected one is the page's colour and sits on the line.
|
|
7080
|
-
divider: { minHeight: 44, justifyContent: "center", paddingHorizontal: 14, borderWidth:
|
|
6985
|
+
divider: { minHeight: 44, justifyContent: "center", paddingHorizontal: 14, borderWidth: StyleSheet60.hairlineWidth, borderTopWidth: 3, borderBottomWidth: 0, marginBottom: -StyleSheet60.hairlineWidth },
|
|
7081
6986
|
binderScroll: { alignItems: "flex-end", paddingHorizontal: 8 },
|
|
7082
6987
|
binderRow: { flexDirection: "row", alignItems: "flex-end" },
|
|
7083
6988
|
add: { minHeight: 44, justifyContent: "center", paddingHorizontal: 10 }
|
|
7084
6989
|
});
|
|
7085
6990
|
|
|
7086
6991
|
// src/native/tag-selector.tsx
|
|
7087
|
-
import { StyleSheet as
|
|
7088
|
-
import { jsx as
|
|
6992
|
+
import { StyleSheet as StyleSheet61, View as View67 } from "react-native";
|
|
6993
|
+
import { jsx as jsx76, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
7089
6994
|
function TagSelector({ label, options, value, onValueChange, max, countLabel, style }) {
|
|
7090
6995
|
const { haptic } = useTheme();
|
|
7091
6996
|
const full = max !== void 0 && value.length >= max;
|
|
7092
|
-
return /* @__PURE__ */
|
|
7093
|
-
/* @__PURE__ */
|
|
6997
|
+
return /* @__PURE__ */ jsxs66(View67, { style: [styles61.root, style], children: [
|
|
6998
|
+
/* @__PURE__ */ jsx76(View67, { role: "group", "aria-label": label, style: styles61.wrap, children: options.map((option) => {
|
|
7094
6999
|
const on = value.includes(option.value);
|
|
7095
7000
|
const props = {
|
|
7096
7001
|
selected: on,
|
|
@@ -7100,17 +7005,17 @@ function TagSelector({ label, options, value, onValueChange, max, countLabel, st
|
|
|
7100
7005
|
onValueChange(next ? [...value, option.value] : value.filter((v) => v !== option.value));
|
|
7101
7006
|
}
|
|
7102
7007
|
};
|
|
7103
|
-
return option.marker ? /* @__PURE__ */
|
|
7008
|
+
return option.marker ? /* @__PURE__ */ jsx76(TagChip, { marker: option.marker, ...props, children: option.label }, option.value) : /* @__PURE__ */ jsx76(Chip, { ...props, children: option.label }, option.value);
|
|
7104
7009
|
}) }),
|
|
7105
|
-
max !== void 0 && countLabel ? /* @__PURE__ */
|
|
7010
|
+
max !== void 0 && countLabel ? /* @__PURE__ */ jsx76(Txt, { variant: "caption", tone: full ? "accent" : "secondary", "aria-live": "polite", children: countLabel(value.length, max) }) : null
|
|
7106
7011
|
] });
|
|
7107
7012
|
}
|
|
7108
|
-
var
|
|
7013
|
+
var styles61 = StyleSheet61.create({ root: { gap: 8 }, wrap: { flexDirection: "row", flexWrap: "wrap", gap: 8 } });
|
|
7109
7014
|
|
|
7110
7015
|
// src/native/toast.tsx
|
|
7111
|
-
import * as
|
|
7112
|
-
import { AccessibilityInfo as AccessibilityInfo14, Animated as Animated26, PanResponder as PanResponder5, Pressable as
|
|
7113
|
-
import { Fragment as Fragment15, jsx as
|
|
7016
|
+
import * as React53 from "react";
|
|
7017
|
+
import { AccessibilityInfo as AccessibilityInfo14, Animated as Animated26, PanResponder as PanResponder5, Pressable as Pressable35, StyleSheet as StyleSheet62, Text as Text21, View as View68 } from "react-native";
|
|
7018
|
+
import { Fragment as Fragment15, jsx as jsx77, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
7114
7019
|
var items = [];
|
|
7115
7020
|
var listeners2 = /* @__PURE__ */ new Set();
|
|
7116
7021
|
var counter = 0;
|
|
@@ -7145,8 +7050,8 @@ var toast = Object.assign(show, {
|
|
|
7145
7050
|
function ToastView({ item, closeLabel, duration }) {
|
|
7146
7051
|
const { theme, radius: radius3, haptic } = useTheme();
|
|
7147
7052
|
const reduce = useReducedMotion();
|
|
7148
|
-
const [swipe] =
|
|
7149
|
-
const drag =
|
|
7053
|
+
const [swipe] = React53.useState(() => new Animated26.Value(0));
|
|
7054
|
+
const drag = React53.useMemo(
|
|
7150
7055
|
() => PanResponder5.create({
|
|
7151
7056
|
onMoveShouldSetPanResponder: (_, g) => Math.abs(g.dx) > 8 && Math.abs(g.dx) > Math.abs(g.dy),
|
|
7152
7057
|
onPanResponderMove: (_, g) => swipe.setValue(g.dx),
|
|
@@ -7158,80 +7063,80 @@ function ToastView({ item, closeLabel, duration }) {
|
|
|
7158
7063
|
}),
|
|
7159
7064
|
[swipe, item.id]
|
|
7160
7065
|
);
|
|
7161
|
-
|
|
7066
|
+
React53.useEffect(() => {
|
|
7162
7067
|
if (item.tone === "success" || item.tone === "warning") haptic(item.tone);
|
|
7163
7068
|
if (item.tone === "error") haptic("warning");
|
|
7164
7069
|
}, [item.id]);
|
|
7165
|
-
const [enter] =
|
|
7166
|
-
|
|
7070
|
+
const [enter] = React53.useState(() => new Animated26.Value(reduce ? 1 : 0));
|
|
7071
|
+
React53.useEffect(() => {
|
|
7167
7072
|
if (reduce) enter.setValue(1);
|
|
7168
7073
|
else Animated26.timing(enter, { toValue: 1, duration: 220, useNativeDriver: true }).start();
|
|
7169
7074
|
}, [enter, reduce]);
|
|
7170
|
-
|
|
7075
|
+
React53.useEffect(() => {
|
|
7171
7076
|
AccessibilityInfo14.announceForAccessibility(item.description ? `${item.title}. ${item.description}` : item.title);
|
|
7172
7077
|
}, [item.title, item.description]);
|
|
7173
7078
|
const ms = item.duration ?? duration;
|
|
7174
|
-
|
|
7079
|
+
React53.useEffect(() => {
|
|
7175
7080
|
if (!Number.isFinite(ms)) return;
|
|
7176
7081
|
const timer2 = setTimeout(() => dismiss(item.id), ms);
|
|
7177
7082
|
return () => clearTimeout(timer2);
|
|
7178
7083
|
}, [item.id, ms]);
|
|
7179
7084
|
const edge = { success: theme.success, warning: theme.warning, error: theme.danger, info: theme.info, default: theme.borderDefault }[item.tone ?? "default"];
|
|
7180
|
-
const text = /* @__PURE__ */
|
|
7181
|
-
item.icon ? /* @__PURE__ */
|
|
7182
|
-
/* @__PURE__ */
|
|
7183
|
-
/* @__PURE__ */
|
|
7184
|
-
item.description ? /* @__PURE__ */
|
|
7085
|
+
const text = /* @__PURE__ */ jsxs67(Fragment15, { children: [
|
|
7086
|
+
item.icon ? /* @__PURE__ */ jsx77(View68, { "aria-hidden": true, children: item.icon }) : null,
|
|
7087
|
+
/* @__PURE__ */ jsxs67(View68, { style: styles62.content, children: [
|
|
7088
|
+
/* @__PURE__ */ jsx77(Txt, { variant: "label", numberOfLines: 2, children: item.title }),
|
|
7089
|
+
item.description ? /* @__PURE__ */ jsx77(Txt, { variant: "caption", tone: "secondary", numberOfLines: 3, children: item.description }) : null
|
|
7185
7090
|
] })
|
|
7186
7091
|
] });
|
|
7187
|
-
const body = /* @__PURE__ */
|
|
7188
|
-
item.onPress ? /* @__PURE__ */
|
|
7189
|
-
|
|
7092
|
+
const body = /* @__PURE__ */ jsxs67(Fragment15, { children: [
|
|
7093
|
+
item.onPress ? /* @__PURE__ */ jsx77(
|
|
7094
|
+
Pressable35,
|
|
7190
7095
|
{
|
|
7191
7096
|
role: "button",
|
|
7192
7097
|
onPress: () => {
|
|
7193
7098
|
item.onPress?.();
|
|
7194
7099
|
dismiss(item.id);
|
|
7195
7100
|
},
|
|
7196
|
-
style: ({ pressed }) => [
|
|
7101
|
+
style: ({ pressed }) => [styles62.main, { opacity: pressed ? 0.8 : 1 }],
|
|
7197
7102
|
children: text
|
|
7198
7103
|
}
|
|
7199
|
-
) : /* @__PURE__ */
|
|
7200
|
-
item.action ? /* @__PURE__ */
|
|
7201
|
-
|
|
7104
|
+
) : /* @__PURE__ */ jsx77(View68, { style: styles62.main, children: text }),
|
|
7105
|
+
item.action ? /* @__PURE__ */ jsx77(
|
|
7106
|
+
Pressable35,
|
|
7202
7107
|
{
|
|
7203
7108
|
role: "button",
|
|
7204
7109
|
onPress: () => {
|
|
7205
7110
|
item.action?.onPress();
|
|
7206
7111
|
dismiss(item.id);
|
|
7207
7112
|
},
|
|
7208
|
-
style: [
|
|
7209
|
-
children: /* @__PURE__ */
|
|
7113
|
+
style: [styles62.action, { backgroundColor: theme.accent, borderRadius: radius3.sm }],
|
|
7114
|
+
children: /* @__PURE__ */ jsx77(Text21, { style: [styles62.actionLabel, { color: theme.onAccent }], children: item.action.label })
|
|
7210
7115
|
}
|
|
7211
7116
|
) : null,
|
|
7212
|
-
/* @__PURE__ */
|
|
7117
|
+
/* @__PURE__ */ jsx77(Pressable35, { role: "button", "aria-label": closeLabel, hitSlop: 10, onPress: () => dismiss(item.id), style: styles62.close, children: /* @__PURE__ */ jsx77(Text21, { style: [styles62.cross, { color: theme.textSecondary }], children: "\xD7" }) })
|
|
7213
7118
|
] });
|
|
7214
7119
|
const frame = [
|
|
7215
|
-
|
|
7120
|
+
styles62.toast,
|
|
7216
7121
|
{ backgroundColor: theme.surface2, borderColor: theme.borderDefault, borderLeftColor: edge, borderRadius: radius3.lg, shadowColor: theme.scrimStrong }
|
|
7217
7122
|
];
|
|
7218
7123
|
const motion3 = { transform: [{ translateY: enter.interpolate({ inputRange: [0, 1], outputRange: [-8, 0] }) }, { translateX: swipe }] };
|
|
7219
|
-
return /* @__PURE__ */
|
|
7124
|
+
return /* @__PURE__ */ jsx77(Animated26.View, { "aria-live": "polite", style: motion3, ...drag.panHandlers, children: /* @__PURE__ */ jsx77(View68, { style: frame, children: body }) });
|
|
7220
7125
|
}
|
|
7221
7126
|
function Toaster({ closeLabel, position = "top", offset = 12, duration = 6e3, max = 3 }) {
|
|
7222
|
-
const all =
|
|
7127
|
+
const all = React53.useSyncExternalStore(subscribe2, snapshot, snapshot);
|
|
7223
7128
|
const shown = all.slice(-max);
|
|
7224
7129
|
if (shown.length === 0) return null;
|
|
7225
|
-
return /* @__PURE__ */
|
|
7130
|
+
return /* @__PURE__ */ jsx77(View68, { pointerEvents: "box-none", style: [styles62.stack, position === "top" ? { top: offset } : { bottom: offset }], children: (position === "top" ? shown : [...shown].reverse()).map((item) => /* @__PURE__ */ jsx77(ToastView, { item, closeLabel, duration }, item.id)) });
|
|
7226
7131
|
}
|
|
7227
|
-
var
|
|
7132
|
+
var styles62 = StyleSheet62.create({
|
|
7228
7133
|
stack: { position: "absolute", left: 12, right: 12, gap: 8, zIndex: 100 },
|
|
7229
7134
|
toast: {
|
|
7230
7135
|
flexDirection: "row",
|
|
7231
7136
|
alignItems: "center",
|
|
7232
7137
|
gap: 10,
|
|
7233
7138
|
padding: 12,
|
|
7234
|
-
borderWidth:
|
|
7139
|
+
borderWidth: StyleSheet62.hairlineWidth,
|
|
7235
7140
|
borderLeftWidth: 4,
|
|
7236
7141
|
shadowOpacity: 0.3,
|
|
7237
7142
|
shadowRadius: 16,
|
|
@@ -7247,35 +7152,35 @@ var styles63 = StyleSheet63.create({
|
|
|
7247
7152
|
});
|
|
7248
7153
|
|
|
7249
7154
|
// src/native/update-prompt.tsx
|
|
7250
|
-
import { StyleSheet as
|
|
7251
|
-
import { jsx as
|
|
7155
|
+
import { StyleSheet as StyleSheet63, View as View69 } from "react-native";
|
|
7156
|
+
import { jsx as jsx78, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
7252
7157
|
function UpdatePrompt({ title, message, versionLabel, mark, updateLabel, onUpdate, laterLabel, onLater, style }) {
|
|
7253
7158
|
const { theme, radius: radius3 } = useTheme();
|
|
7254
|
-
return /* @__PURE__ */
|
|
7255
|
-
|
|
7159
|
+
return /* @__PURE__ */ jsxs68(
|
|
7160
|
+
View69,
|
|
7256
7161
|
{
|
|
7257
7162
|
role: "region",
|
|
7258
7163
|
"aria-label": title,
|
|
7259
|
-
style: [
|
|
7164
|
+
style: [styles63.root, { backgroundColor: theme.surface1, borderColor: theme.borderSubtle, borderRadius: radius3.xl }, style],
|
|
7260
7165
|
children: [
|
|
7261
|
-
/* @__PURE__ */
|
|
7262
|
-
mark ? /* @__PURE__ */
|
|
7263
|
-
/* @__PURE__ */
|
|
7264
|
-
/* @__PURE__ */
|
|
7265
|
-
message ? /* @__PURE__ */
|
|
7266
|
-
versionLabel ? /* @__PURE__ */
|
|
7166
|
+
/* @__PURE__ */ jsxs68(View69, { style: styles63.head, children: [
|
|
7167
|
+
mark ? /* @__PURE__ */ jsx78(View69, { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", style: styles63.mark, children: mark }) : null,
|
|
7168
|
+
/* @__PURE__ */ jsxs68(View69, { style: styles63.text, children: [
|
|
7169
|
+
/* @__PURE__ */ jsx78(Txt, { variant: "label", children: title }),
|
|
7170
|
+
message ? /* @__PURE__ */ jsx78(Txt, { tone: "secondary", children: message }) : null,
|
|
7171
|
+
versionLabel ? /* @__PURE__ */ jsx78(Txt, { variant: "mono", tone: "secondary", children: versionLabel }) : null
|
|
7267
7172
|
] })
|
|
7268
7173
|
] }),
|
|
7269
|
-
/* @__PURE__ */
|
|
7270
|
-
/* @__PURE__ */
|
|
7271
|
-
/* @__PURE__ */
|
|
7174
|
+
/* @__PURE__ */ jsxs68(View69, { style: styles63.actions, children: [
|
|
7175
|
+
/* @__PURE__ */ jsx78(Button, { label: laterLabel, variant: "ghost", size: "sm", onPress: onLater }),
|
|
7176
|
+
/* @__PURE__ */ jsx78(Button, { label: updateLabel, variant: "primary", size: "sm", onPress: onUpdate })
|
|
7272
7177
|
] })
|
|
7273
7178
|
]
|
|
7274
7179
|
}
|
|
7275
7180
|
);
|
|
7276
7181
|
}
|
|
7277
|
-
var
|
|
7278
|
-
root: { gap: 12, padding: 16, borderWidth:
|
|
7182
|
+
var styles63 = StyleSheet63.create({
|
|
7183
|
+
root: { gap: 12, padding: 16, borderWidth: StyleSheet63.hairlineWidth },
|
|
7279
7184
|
head: { flexDirection: "row", gap: 12, alignItems: "center" },
|
|
7280
7185
|
mark: { width: 40, height: 40, alignItems: "center", justifyContent: "center" },
|
|
7281
7186
|
text: { flex: 1, gap: 2 },
|
|
@@ -7283,15 +7188,15 @@ var styles64 = StyleSheet64.create({
|
|
|
7283
7188
|
});
|
|
7284
7189
|
|
|
7285
7190
|
// src/native/verified-badge.tsx
|
|
7286
|
-
import { StyleSheet as
|
|
7287
|
-
import
|
|
7288
|
-
import { jsx as
|
|
7191
|
+
import { StyleSheet as StyleSheet64, View as View70 } from "react-native";
|
|
7192
|
+
import Svg32, { Path as Path26 } from "react-native-svg";
|
|
7193
|
+
import { jsx as jsx79, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
7289
7194
|
function VerifiedBadge({ label, showLabel, size = 16, on = "surface" }) {
|
|
7290
7195
|
const { theme } = useTheme();
|
|
7291
|
-
return /* @__PURE__ */
|
|
7292
|
-
/* @__PURE__ */
|
|
7293
|
-
/* @__PURE__ */
|
|
7294
|
-
|
|
7196
|
+
return /* @__PURE__ */ jsxs69(View70, { accessible: true, role: "img", "aria-label": label, style: styles64.row, children: [
|
|
7197
|
+
/* @__PURE__ */ jsxs69(Svg32, { width: size, height: size, viewBox: "0 0 24 24", "aria-hidden": true, children: [
|
|
7198
|
+
/* @__PURE__ */ jsx79(
|
|
7199
|
+
Path26,
|
|
7295
7200
|
{
|
|
7296
7201
|
d: "M12 2.5l2.4 1.7 2.9-.1.9 2.8 2.3 1.8-.9 2.8.9 2.8-2.3 1.8-.9 2.8-2.9-.1L12 21.5l-2.4-1.7-2.9.1-.9-2.8-2.3-1.8.9-2.8-.9-2.8 2.3-1.8.9-2.8 2.9.1z",
|
|
7297
7202
|
fill: theme.accent,
|
|
@@ -7299,16 +7204,16 @@ function VerifiedBadge({ label, showLabel, size = 16, on = "surface" }) {
|
|
|
7299
7204
|
strokeWidth: 1.2
|
|
7300
7205
|
}
|
|
7301
7206
|
),
|
|
7302
|
-
/* @__PURE__ */
|
|
7207
|
+
/* @__PURE__ */ jsx79(Path26, { d: "M8.3 12.3l2.5 2.5 4.9-5.2", fill: "none", stroke: theme.onAccent, strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round" })
|
|
7303
7208
|
] }),
|
|
7304
|
-
showLabel ? /* @__PURE__ */
|
|
7209
|
+
showLabel ? /* @__PURE__ */ jsx79(Txt, { variant: "caption", tone: on === "media" ? "onMedia" : "accent", style: styles64.text, children: label }) : null
|
|
7305
7210
|
] });
|
|
7306
7211
|
}
|
|
7307
|
-
var
|
|
7212
|
+
var styles64 = StyleSheet64.create({ row: { flexDirection: "row", alignItems: "center", gap: 4 }, text: { fontWeight: "700" } });
|
|
7308
7213
|
|
|
7309
7214
|
// src/native/waveform.tsx
|
|
7310
|
-
import * as
|
|
7311
|
-
import { Animated as Animated27, AppState as AppState2, Easing as Easing13, StyleSheet as
|
|
7215
|
+
import * as React54 from "react";
|
|
7216
|
+
import { Animated as Animated27, AppState as AppState2, Easing as Easing13, StyleSheet as StyleSheet65, View as View71 } from "react-native";
|
|
7312
7217
|
|
|
7313
7218
|
// src/waveform/bars.ts
|
|
7314
7219
|
function resamplePeaks(peaks, count) {
|
|
@@ -7323,20 +7228,20 @@ function resamplePeaks(peaks, count) {
|
|
|
7323
7228
|
}
|
|
7324
7229
|
|
|
7325
7230
|
// src/native/waveform.tsx
|
|
7326
|
-
import { jsx as
|
|
7231
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
7327
7232
|
var HEIGHT = { sm: 24, md: 40, lg: 64 };
|
|
7328
7233
|
function Waveform({ peaks, bars = 32, size = "md", tone: tone3 = "accent", playing = false, label, style, ...props }) {
|
|
7329
7234
|
const { theme } = useTheme();
|
|
7330
7235
|
const reduce = useReducedMotion();
|
|
7331
|
-
const [active, setActive] =
|
|
7332
|
-
|
|
7236
|
+
const [active, setActive] = React54.useState(() => AppState2.currentState === "active");
|
|
7237
|
+
React54.useEffect(() => {
|
|
7333
7238
|
const subscription = AppState2.addEventListener("change", (state) => setActive(state === "active"));
|
|
7334
7239
|
return () => subscription.remove();
|
|
7335
7240
|
}, []);
|
|
7336
|
-
const shape =
|
|
7337
|
-
const values =
|
|
7241
|
+
const shape = React54.useMemo(() => resamplePeaks(peaks ?? [], bars), [peaks, bars]);
|
|
7242
|
+
const values = React54.useMemo(() => shape.map(() => new Animated27.Value(1)), [shape]);
|
|
7338
7243
|
const moving = playing && !reduce && active;
|
|
7339
|
-
|
|
7244
|
+
React54.useEffect(() => {
|
|
7340
7245
|
if (!moving) {
|
|
7341
7246
|
values.forEach((value) => value.setValue(1));
|
|
7342
7247
|
return;
|
|
@@ -7356,8 +7261,8 @@ function Waveform({ peaks, bars = 32, size = "md", tone: tone3 = "accent", playi
|
|
|
7356
7261
|
}, [moving, values]);
|
|
7357
7262
|
const named = label !== void 0;
|
|
7358
7263
|
const barColour = tone3 === "neutral" ? theme.borderStrong : theme.accent;
|
|
7359
|
-
return /* @__PURE__ */
|
|
7360
|
-
|
|
7264
|
+
return /* @__PURE__ */ jsx80(
|
|
7265
|
+
View71,
|
|
7361
7266
|
{
|
|
7362
7267
|
...props,
|
|
7363
7268
|
accessible: named,
|
|
@@ -7365,13 +7270,13 @@ function Waveform({ peaks, bars = 32, size = "md", tone: tone3 = "accent", playi
|
|
|
7365
7270
|
accessibilityLabel: label,
|
|
7366
7271
|
"aria-hidden": named ? void 0 : true,
|
|
7367
7272
|
importantForAccessibility: named ? "yes" : "no-hide-descendants",
|
|
7368
|
-
style: [
|
|
7369
|
-
children: shape.map((peak, i) => /* @__PURE__ */
|
|
7273
|
+
style: [styles65.root, { height: HEIGHT[size] }, style],
|
|
7274
|
+
children: shape.map((peak, i) => /* @__PURE__ */ jsx80(
|
|
7370
7275
|
Animated27.View,
|
|
7371
7276
|
{
|
|
7372
7277
|
testID: "waveform-bar",
|
|
7373
7278
|
style: [
|
|
7374
|
-
|
|
7279
|
+
styles65.bar,
|
|
7375
7280
|
{ height: `${Math.round(peak * 100)}%`, backgroundColor: barColour },
|
|
7376
7281
|
{ transform: [{ scaleY: values[i].interpolate({ inputRange: [0, 1], outputRange: [0.45, 1] }) }] }
|
|
7377
7282
|
]
|
|
@@ -7381,7 +7286,7 @@ function Waveform({ peaks, bars = 32, size = "md", tone: tone3 = "accent", playi
|
|
|
7381
7286
|
}
|
|
7382
7287
|
);
|
|
7383
7288
|
}
|
|
7384
|
-
var
|
|
7289
|
+
var styles65 = StyleSheet65.create({
|
|
7385
7290
|
root: { width: "100%", flexDirection: "row", alignItems: "center", justifyContent: "center", columnGap: 2 },
|
|
7386
7291
|
bar: { flex: 1, minWidth: 2, borderRadius: 9999 }
|
|
7387
7292
|
});
|
|
@@ -7458,7 +7363,6 @@ export {
|
|
|
7458
7363
|
PermissionPrompt,
|
|
7459
7364
|
PersonCard,
|
|
7460
7365
|
Phoenix,
|
|
7461
|
-
PhotoGrid,
|
|
7462
7366
|
ProductMark,
|
|
7463
7367
|
ProfileBanner,
|
|
7464
7368
|
ProfileCard,
|