@krizaka/ui 3.9.0 → 3.11.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 +3 -1
- package/dist/blocks.css +9 -2
- package/dist/chunk-HG65YAV4.js +379 -0
- package/dist/chunk-HG65YAV4.js.map +1 -0
- package/dist/chunk-OT6HX3PN.js +85 -0
- package/dist/chunk-OT6HX3PN.js.map +1 -0
- package/dist/index.js +9 -367
- package/dist/index.js.map +1 -1
- package/dist/link-card.d.ts +7 -1
- package/dist/link-card.js +8 -5
- package/dist/link-card.js.map +1 -1
- package/dist/native.d.ts +48 -1
- package/dist/native.js +374 -257
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.d.ts +86 -3
- package/dist/nav-bar.js +88 -2
- package/dist/nav-bar.js.map +1 -1
- package/dist/showcase.d.ts +69 -0
- package/dist/showcase.js +218 -0
- package/dist/showcase.js.map +1 -0
- package/dist/site-footer.d.ts +172 -0
- package/dist/site-footer.js +105 -0
- package/dist/site-footer.js.map +1 -0
- package/dist/sites-CgJrxejx.d.ts +32 -0
- package/dist/sites.d.ts +64 -0
- package/dist/sites.js +69 -0
- package/dist/sites.js.map +1 -0
- package/package.json +47 -9
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +1 -1
- package/registry/card-grid.json +11 -2
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.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/combobox.json +1 -1
- package/registry/command.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/countdown.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/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/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/card-grid/aligned.d.ts +4 -0
- package/registry/examples/card-grid/aligned.js +18 -0
- package/registry/examples/card-grid/aligned.tsx +16 -0
- package/registry/examples/nav-bar/family-admin.d.ts +4 -0
- package/registry/examples/nav-bar/family-admin.js +21 -0
- package/registry/examples/nav-bar/family-admin.tsx +20 -0
- package/registry/examples/nav-bar/family-java.d.ts +4 -0
- package/registry/examples/nav-bar/family-java.js +33 -0
- package/registry/examples/nav-bar/family-java.tsx +34 -0
- package/registry/examples/nav-bar/family-product.d.ts +4 -0
- package/registry/examples/nav-bar/family-product.js +35 -0
- package/registry/examples/nav-bar/family-product.tsx +39 -0
- package/registry/examples/nav-bar/family-ui.d.ts +4 -0
- package/registry/examples/nav-bar/family-ui.js +34 -0
- package/registry/examples/nav-bar/family-ui.tsx +35 -0
- package/registry/examples/nav-bar/family-www.d.ts +4 -0
- package/registry/examples/nav-bar/family-www.js +34 -0
- package/registry/examples/nav-bar/family-www.tsx +36 -0
- package/registry/examples/showcase/native/slides.d.ts +4 -0
- package/registry/examples/showcase/native/slides.dark.png +0 -0
- package/registry/examples/showcase/native/slides.js +27 -0
- package/registry/examples/showcase/native/slides.light.png +0 -0
- package/registry/examples/showcase/native/slides.tsx +28 -0
- package/registry/examples/showcase/prompt-image.d.ts +4 -0
- package/registry/examples/showcase/prompt-image.js +29 -0
- package/registry/examples/showcase/prompt-image.tsx +28 -0
- package/registry/examples/showcase/slides.d.ts +4 -0
- package/registry/examples/showcase/slides.js +29 -0
- package/registry/examples/showcase/slides.tsx +24 -0
- package/registry/examples/site-footer/company.d.ts +4 -0
- package/registry/examples/site-footer/company.js +26 -0
- package/registry/examples/site-footer/company.tsx +23 -0
- package/registry/examples/site-footer/open-source-fr.d.ts +4 -0
- package/registry/examples/site-footer/open-source-fr.js +17 -0
- package/registry/examples/site-footer/open-source-fr.tsx +17 -0
- package/registry/examples/site-footer/product.d.ts +4 -0
- package/registry/examples/site-footer/product.js +22 -0
- package/registry/examples/site-footer/product.tsx +19 -0
- package/registry/examples/sites/family.d.ts +4 -0
- package/registry/examples/sites/family.js +20 -0
- package/registry/examples/sites/family.tsx +30 -0
- package/registry/examples/sites/french.d.ts +4 -0
- package/registry/examples/sites/french.js +25 -0
- package/registry/examples/sites/french.tsx +25 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +65 -7
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +18 -3
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/map.json +2 -2
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.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/meter.json +1 -1
- package/registry/nav-bar.json +257 -13
- package/registry/number-ticker.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/photo-grid.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/recipes.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/settings-layout.json +1 -1
- package/registry/showcase.json +421 -0
- package/registry/site-footer.json +389 -0
- package/registry/sites.json +93 -0
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot.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-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +1 -1
- package/registry/terminal-replay.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/verified-badge.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
package/dist/native.js
CHANGED
|
@@ -2752,7 +2752,7 @@ function useMarkMotion(size, animated, spinMs = 3e4) {
|
|
|
2752
2752
|
import { Fragment as Fragment5, jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2753
2753
|
function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
2754
2754
|
const { theme } = useTheme();
|
|
2755
|
-
const { Animated:
|
|
2755
|
+
const { Animated: Animated28, layer, spinStyle, pulseStyle } = useMarkMotion(size, animated);
|
|
2756
2756
|
const id = useSvgId("kzm");
|
|
2757
2757
|
const viewBox = size < 48 ? KRIZAKA.croppedViewBox : KRIZAKA.viewBox;
|
|
2758
2758
|
const stroke = neutral ?? theme.textMuted;
|
|
@@ -2778,8 +2778,8 @@ function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
2778
2778
|
/* @__PURE__ */ jsx25(Circle2, { cx: 200, cy: 200, r: KRIZAKA.ring.r, stroke, strokeWidth: KRIZAKA.ring.width, opacity: 0.35, fill: "none" }),
|
|
2779
2779
|
/* @__PURE__ */ jsx25(Group, { transform: `translate(${KRIZAKA.offset} ${KRIZAKA.offset})`, children: /* @__PURE__ */ jsx25(Path6, { d: KRIZAKA.shield, stroke: `url(#${id}i)`, strokeWidth: KRIZAKA.stroke, strokeLinecap: "round", strokeLinejoin: "round", fill: "none" }) })
|
|
2780
2780
|
] }),
|
|
2781
|
-
/* @__PURE__ */ jsx25(
|
|
2782
|
-
/* @__PURE__ */ jsx25(
|
|
2781
|
+
/* @__PURE__ */ jsx25(Animated28.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsx25(Svg8, { viewBox, style: layer, children: /* @__PURE__ */ jsx25(Circle2, { cx: 200, cy: 200, r: KRIZAKA.orbit.r, stroke, strokeWidth: KRIZAKA.orbit.width, strokeDasharray: KRIZAKA.orbit.dash, opacity: 0.6, fill: "none" }) }) }),
|
|
2782
|
+
/* @__PURE__ */ jsx25(Animated28.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs22(Svg8, { viewBox, style: layer, children: [
|
|
2783
2783
|
/* @__PURE__ */ jsx25(Defs3, { children: blue }),
|
|
2784
2784
|
/* @__PURE__ */ jsxs22(Group, { transform: `translate(${KRIZAKA.offset} ${KRIZAKA.offset})`, children: [
|
|
2785
2785
|
dot(KRIZAKA.node),
|
|
@@ -2828,7 +2828,7 @@ var ORAZAKA = {
|
|
|
2828
2828
|
import { jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2829
2829
|
function OrazakaMark({ size = 48, animated = true, title, neutral }) {
|
|
2830
2830
|
const { theme } = useTheme();
|
|
2831
|
-
const { Animated:
|
|
2831
|
+
const { Animated: Animated28, layer, spinStyle, pulseStyle } = useMarkMotion(size, animated);
|
|
2832
2832
|
const id = useSvgId("ozm");
|
|
2833
2833
|
const viewBox = size < 48 ? ORAZAKA.croppedViewBox : ORAZAKA.viewBox;
|
|
2834
2834
|
const stroke = neutral ?? theme.textMuted;
|
|
@@ -2844,11 +2844,11 @@ function OrazakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
2844
2844
|
/* @__PURE__ */ jsx26(Circle3, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.orbit.r, stroke, strokeWidth: ORAZAKA.orbit.width, strokeDasharray: ORAZAKA.orbit.dash, opacity: 0.6, fill: "none" }),
|
|
2845
2845
|
/* @__PURE__ */ jsx26(Circle3, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.ring.r, stroke, strokeWidth: ORAZAKA.ring.width, opacity: 0.35, fill: "none" })
|
|
2846
2846
|
] }),
|
|
2847
|
-
/* @__PURE__ */ jsx26(
|
|
2847
|
+
/* @__PURE__ */ jsx26(Animated28.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsxs23(Svg9, { viewBox, style: layer, children: [
|
|
2848
2848
|
/* @__PURE__ */ jsx26(Defs4, { children: gradient }),
|
|
2849
2849
|
ORAZAKA.shards.map((d) => /* @__PURE__ */ jsx26(Path7, { d, fill, stroke: fill, strokeWidth: ORAZAKA.shardStroke, strokeLinejoin: "round" }, d))
|
|
2850
2850
|
] }) }),
|
|
2851
|
-
/* @__PURE__ */ jsx26(
|
|
2851
|
+
/* @__PURE__ */ jsx26(Animated28.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs23(Svg9, { viewBox, style: layer, children: [
|
|
2852
2852
|
/* @__PURE__ */ jsx26(Defs4, { children: gradient }),
|
|
2853
2853
|
/* @__PURE__ */ jsx26(Circle3, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.core.r, fill }),
|
|
2854
2854
|
/* @__PURE__ */ jsx26(Circle3, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.core.inner, fill: ORAZAKA.highlight })
|
|
@@ -2986,7 +2986,7 @@ var YASAKIA = {
|
|
|
2986
2986
|
import { jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2987
2987
|
function YasakiaMark({ size = 48, animated = true, title, neutral }) {
|
|
2988
2988
|
const { theme } = useTheme();
|
|
2989
|
-
const { Animated:
|
|
2989
|
+
const { Animated: Animated28, layer, spinStyle, pulseStyle } = useMarkMotion(size, animated);
|
|
2990
2990
|
const id = useSvgId("yzm");
|
|
2991
2991
|
const viewBox = size < 48 ? YASAKIA.croppedViewBox : YASAKIA.viewBox;
|
|
2992
2992
|
const stroke = neutral ?? theme.textMuted;
|
|
@@ -3009,12 +3009,12 @@ function YasakiaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
3009
3009
|
i === 0 ? /* @__PURE__ */ jsx28(Path9, { d: `${v.body} ${v.tail}`, fill: YASAKIA.shade.color, opacity: YASAKIA.shade.opacity }) : null
|
|
3010
3010
|
] }, v.body))
|
|
3011
3011
|
] }),
|
|
3012
|
-
/* @__PURE__ */ jsx28(
|
|
3012
|
+
/* @__PURE__ */ jsx28(Animated28.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsxs25(Svg11, { viewBox, style: layer, children: [
|
|
3013
3013
|
/* @__PURE__ */ jsx28(Defs6, { children: gradient }),
|
|
3014
3014
|
/* @__PURE__ */ jsx28(Circle5, { cx: YASAKIA.center, cy: YASAKIA.center, r: YASAKIA.orbit.r, stroke, strokeWidth: YASAKIA.orbit.width, strokeDasharray: YASAKIA.orbit.dash, opacity: 0.6, fill: "none" }),
|
|
3015
3015
|
YASAKIA.pair.at.map(([cx, cy]) => /* @__PURE__ */ jsx28(Circle5, { cx, cy, r: YASAKIA.pair.r, fill }, cx))
|
|
3016
3016
|
] }) }),
|
|
3017
|
-
/* @__PURE__ */ jsx28(
|
|
3017
|
+
/* @__PURE__ */ jsx28(Animated28.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs25(Svg11, { viewBox, style: layer, children: [
|
|
3018
3018
|
/* @__PURE__ */ jsxs25(Defs6, { children: [
|
|
3019
3019
|
gradient,
|
|
3020
3020
|
/* @__PURE__ */ jsxs25(LinearGradient6, { id: `${id}l`, gradientUnits: "userSpaceOnUse", x1: 0, y1: YASAKIA.lens.y1, x2: 0, y2: YASAKIA.lens.y2, children: [
|
|
@@ -3070,7 +3070,7 @@ var YORORIS = {
|
|
|
3070
3070
|
import { jsx as jsx29, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3071
3071
|
function YororisMark({ size = 48, animated = true, title, neutral }) {
|
|
3072
3072
|
const { theme } = useTheme();
|
|
3073
|
-
const { Animated:
|
|
3073
|
+
const { Animated: Animated28, layer, spinStyle, pulseStyle } = useMarkMotion(size, animated, 36e3);
|
|
3074
3074
|
const id = useSvgId("yrm");
|
|
3075
3075
|
const viewBox = size < 48 ? YORORIS.croppedViewBox : YORORIS.viewBox;
|
|
3076
3076
|
const stroke = neutral ?? theme.textMuted;
|
|
@@ -3091,12 +3091,12 @@ function YororisMark({ size = 48, animated = true, title, neutral }) {
|
|
|
3091
3091
|
YORORIS.leaves.map((d) => /* @__PURE__ */ jsx29(Path10, { d, fill }, d)),
|
|
3092
3092
|
/* @__PURE__ */ jsx29(Path10, { d: YORORIS.veins, stroke: YORORIS.vein.color, strokeOpacity: YORORIS.vein.opacity, strokeWidth: YORORIS.vein.width, strokeLinecap: "round", strokeDasharray: YORORIS.vein.dash, fill: "none" })
|
|
3093
3093
|
] }),
|
|
3094
|
-
/* @__PURE__ */ jsx29(
|
|
3094
|
+
/* @__PURE__ */ jsx29(Animated28.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsxs26(Svg12, { viewBox, style: layer, children: [
|
|
3095
3095
|
/* @__PURE__ */ jsx29(Defs7, { children: gradient }),
|
|
3096
3096
|
/* @__PURE__ */ jsx29(Circle6, { cx: YORORIS.center, cy: YORORIS.center, r: YORORIS.orbit.r, stroke, strokeWidth: YORORIS.orbit.width, strokeDasharray: YORORIS.orbit.dash, opacity: 0.6, fill: "none" }),
|
|
3097
3097
|
/* @__PURE__ */ jsx29(Circle6, { cx: YORORIS.moment.at[0], cy: YORORIS.moment.at[1], r: YORORIS.moment.r, fill })
|
|
3098
3098
|
] }) }),
|
|
3099
|
-
/* @__PURE__ */ jsx29(
|
|
3099
|
+
/* @__PURE__ */ jsx29(Animated28.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs26(Svg12, { viewBox, style: layer, children: [
|
|
3100
3100
|
/* @__PURE__ */ jsx29(Defs7, { children: /* @__PURE__ */ jsx29(LinearGradient7, { id: `${id}c`, x1: "50%", y1: "100%", x2: "50%", y2: "0%", children: YORORIS.coreGradient.stops.map(([offset, color]) => /* @__PURE__ */ jsx29(Stop7, { offset, stopColor: color }, offset)) }) }),
|
|
3101
3101
|
/* @__PURE__ */ jsx29(Circle6, { cx: YORORIS.core.cx, cy: YORORIS.core.cy, r: YORORIS.core.r, fill: `url(#${id}c)` }),
|
|
3102
3102
|
/* @__PURE__ */ jsx29(Circle6, { cx: YORORIS.core.cx, cy: YORORIS.core.cy, r: YORORIS.core.inner, fill: YORORIS.highlight })
|
|
@@ -4537,10 +4537,125 @@ var styles39 = StyleSheet39.create({
|
|
|
4537
4537
|
disabled: { opacity: 0.4 }
|
|
4538
4538
|
});
|
|
4539
4539
|
|
|
4540
|
-
// src/native/
|
|
4540
|
+
// src/native/showcase.tsx
|
|
4541
4541
|
import * as React36 from "react";
|
|
4542
|
-
import { Animated as Animated21 } from "react-native";
|
|
4543
|
-
import {
|
|
4542
|
+
import { Animated as Animated21, AppState, Easing as Easing12, FlatList, Pressable as Pressable21, StyleSheet as StyleSheet40, View as View44 } from "react-native";
|
|
4543
|
+
import Svg23, { Path as Path19 } from "react-native-svg";
|
|
4544
|
+
import { jsx as jsx50, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4545
|
+
var showcaseLabels = {
|
|
4546
|
+
previous: "Previous slide",
|
|
4547
|
+
next: "Next slide",
|
|
4548
|
+
pause: "Pause the slideshow",
|
|
4549
|
+
play: "Play the slideshow",
|
|
4550
|
+
goTo: (n) => `Go to slide ${n}`,
|
|
4551
|
+
counter: (n, total) => `Slide ${n} of ${total}`,
|
|
4552
|
+
slide: (n, total) => `${n} of ${total}`
|
|
4553
|
+
};
|
|
4554
|
+
function Showcase({ label, items: items2, getId, renderItem, getTitle, interval = 6e3, autoplay = true, loop = true, onIndexChange, labels = showcaseLabels, style }) {
|
|
4555
|
+
const { theme } = useTheme();
|
|
4556
|
+
const reduced = useReducedMotion();
|
|
4557
|
+
const total = items2.length;
|
|
4558
|
+
const [current, setCurrent] = React36.useState(0);
|
|
4559
|
+
const [width, setWidth] = React36.useState(0);
|
|
4560
|
+
const [paused, setPaused] = React36.useState(false);
|
|
4561
|
+
const [dragging, setDragging] = React36.useState(false);
|
|
4562
|
+
const [background, setBackground] = React36.useState(false);
|
|
4563
|
+
const [announce, setAnnounce] = React36.useState(false);
|
|
4564
|
+
const list = React36.useRef(null);
|
|
4565
|
+
const [fill] = React36.useState(() => new Animated21.Value(0));
|
|
4566
|
+
const progress = React36.useRef(0);
|
|
4567
|
+
React36.useEffect(() => {
|
|
4568
|
+
const id = fill.addListener(({ value }) => {
|
|
4569
|
+
progress.current = value;
|
|
4570
|
+
});
|
|
4571
|
+
const subscription = AppState.addEventListener("change", (state) => setBackground(state !== "active"));
|
|
4572
|
+
return () => {
|
|
4573
|
+
fill.removeListener(id);
|
|
4574
|
+
subscription.remove();
|
|
4575
|
+
};
|
|
4576
|
+
}, [fill]);
|
|
4577
|
+
const go = (to, user) => {
|
|
4578
|
+
if (total === 0) return;
|
|
4579
|
+
const next = loop ? (to + total) % total : Math.min(Math.max(to, 0), total - 1);
|
|
4580
|
+
if (next === current) return;
|
|
4581
|
+
setAnnounce(user);
|
|
4582
|
+
setCurrent(next);
|
|
4583
|
+
list.current?.scrollToOffset({ offset: next * width, animated: !reduced });
|
|
4584
|
+
onIndexChange?.(next, user);
|
|
4585
|
+
};
|
|
4586
|
+
const playing = autoplay && !reduced && total > 1;
|
|
4587
|
+
const running = playing && !paused && !dragging && !background && !(!loop && current === total - 1);
|
|
4588
|
+
React36.useEffect(() => {
|
|
4589
|
+
fill.setValue(0);
|
|
4590
|
+
progress.current = 0;
|
|
4591
|
+
}, [current, fill]);
|
|
4592
|
+
React36.useEffect(() => {
|
|
4593
|
+
if (!running) return;
|
|
4594
|
+
const animation = Animated21.timing(fill, { toValue: 1, duration: Math.max(1, interval * (1 - progress.current)), easing: Easing12.linear, useNativeDriver: false });
|
|
4595
|
+
animation.start(({ finished }) => {
|
|
4596
|
+
if (finished) go(current + 1, false);
|
|
4597
|
+
});
|
|
4598
|
+
return () => animation.stop();
|
|
4599
|
+
}, [running, current, interval]);
|
|
4600
|
+
const item = items2[current];
|
|
4601
|
+
const title = item !== void 0 ? getTitle?.(item) : void 0;
|
|
4602
|
+
const control = [styles40.control, { borderColor: theme.borderDefault, backgroundColor: theme.surface1 }];
|
|
4603
|
+
const icon = (d) => /* @__PURE__ */ jsx50(Svg23, { width: 16, height: 16, viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsx50(Path19, { d, stroke: theme.textSecondary, strokeWidth: 2.2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
4604
|
+
return /* @__PURE__ */ jsxs44(View44, { role: "group", "aria-label": label, style: [styles40.root, style], children: [
|
|
4605
|
+
/* @__PURE__ */ jsx50(View44, { "aria-live": announce ? "polite" : "off", onLayout: (e) => setWidth(e.nativeEvent.layout.width), children: /* @__PURE__ */ jsx50(
|
|
4606
|
+
FlatList,
|
|
4607
|
+
{
|
|
4608
|
+
ref: list,
|
|
4609
|
+
horizontal: true,
|
|
4610
|
+
pagingEnabled: true,
|
|
4611
|
+
focusable: true,
|
|
4612
|
+
showsHorizontalScrollIndicator: false,
|
|
4613
|
+
data: items2,
|
|
4614
|
+
keyExtractor: getId,
|
|
4615
|
+
getItemLayout: (_, index) => ({ length: width, offset: width * index, index }),
|
|
4616
|
+
onScrollBeginDrag: () => setDragging(true),
|
|
4617
|
+
onScrollEndDrag: () => setDragging(false),
|
|
4618
|
+
onMomentumScrollEnd: (e) => {
|
|
4619
|
+
const next = Math.round(e.nativeEvent.contentOffset.x / Math.max(width, 1));
|
|
4620
|
+
if (next !== current && next >= 0 && next < total) {
|
|
4621
|
+
setAnnounce(true);
|
|
4622
|
+
setCurrent(next);
|
|
4623
|
+
onIndexChange?.(next, true);
|
|
4624
|
+
}
|
|
4625
|
+
},
|
|
4626
|
+
renderItem: ({ item: slide, index }) => /* @__PURE__ */ jsx50(View44, { role: "group", "aria-label": labels.slide(index + 1, total), style: { width }, children: Math.abs(index - current) <= 1 ? renderItem(slide, { index, active: index === current }) : null })
|
|
4627
|
+
}
|
|
4628
|
+
) }),
|
|
4629
|
+
/* @__PURE__ */ jsx50(View44, { style: styles40.segments, children: items2.map((slide, i) => /* @__PURE__ */ jsx50(Pressable21, { role: "button", "aria-label": labels.goTo(i + 1, total), "aria-current": i === current ? true : void 0, onPress: () => go(i, true), style: styles40.segment, children: /* @__PURE__ */ jsxs44(View44, { style: [styles40.track, { backgroundColor: theme.surface3 }], children: [
|
|
4630
|
+
i < current || i === current && !playing ? /* @__PURE__ */ jsx50(View44, { style: [StyleSheet40.absoluteFill, { backgroundColor: theme.accent }] }) : null,
|
|
4631
|
+
i === current && playing ? /* @__PURE__ */ jsx50(Animated21.View, { style: [styles40.fill, { backgroundColor: theme.accent, width: fill.interpolate({ inputRange: [0, 1], outputRange: ["0%", "100%"] }) }] }) : null
|
|
4632
|
+
] }) }, getId(slide))) }),
|
|
4633
|
+
/* @__PURE__ */ jsxs44(View44, { style: styles40.bar, children: [
|
|
4634
|
+
/* @__PURE__ */ jsxs44(Txt, { variant: "caption", tone: "secondary", numberOfLines: 1, style: styles40.counter, children: [
|
|
4635
|
+
title ? `${title} \xB7 ` : "",
|
|
4636
|
+
labels.counter(current + 1, total)
|
|
4637
|
+
] }),
|
|
4638
|
+
/* @__PURE__ */ jsx50(Pressable21, { 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") }),
|
|
4639
|
+
playing ? /* @__PURE__ */ jsx50(Pressable21, { 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,
|
|
4640
|
+
/* @__PURE__ */ jsx50(Pressable21, { 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") })
|
|
4641
|
+
] })
|
|
4642
|
+
] });
|
|
4643
|
+
}
|
|
4644
|
+
var styles40 = StyleSheet40.create({
|
|
4645
|
+
root: { gap: 8 },
|
|
4646
|
+
segments: { flexDirection: "row", gap: 4 },
|
|
4647
|
+
segment: { flex: 1, height: 24, justifyContent: "center" },
|
|
4648
|
+
track: { height: 4, borderRadius: 2, overflow: "hidden" },
|
|
4649
|
+
fill: { position: "absolute", left: 0, top: 0, bottom: 0 },
|
|
4650
|
+
bar: { flexDirection: "row", alignItems: "center", gap: 8 },
|
|
4651
|
+
counter: { flex: 1 },
|
|
4652
|
+
control: { width: 36, height: 36, borderRadius: 18, borderWidth: 1, alignItems: "center", justifyContent: "center" }
|
|
4653
|
+
});
|
|
4654
|
+
|
|
4655
|
+
// src/native/skeleton.tsx
|
|
4656
|
+
import * as React37 from "react";
|
|
4657
|
+
import { Animated as Animated22 } from "react-native";
|
|
4658
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
4544
4659
|
var SHAPE = {
|
|
4545
4660
|
text: { width: "100%", height: 12, radius: 4 },
|
|
4546
4661
|
circle: { width: 40, height: 40, radius: 9999 },
|
|
@@ -4549,13 +4664,13 @@ var SHAPE = {
|
|
|
4549
4664
|
function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
4550
4665
|
const { theme } = useTheme();
|
|
4551
4666
|
const reduce = useReducedMotion();
|
|
4552
|
-
const [opacity] =
|
|
4553
|
-
|
|
4667
|
+
const [opacity] = React37.useState(() => new Animated22.Value(1));
|
|
4668
|
+
React37.useEffect(() => {
|
|
4554
4669
|
if (reduce) return;
|
|
4555
|
-
const loop =
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4670
|
+
const loop = Animated22.loop(
|
|
4671
|
+
Animated22.sequence([
|
|
4672
|
+
Animated22.timing(opacity, { toValue: 0.5, duration: 900, useNativeDriver: true }),
|
|
4673
|
+
Animated22.timing(opacity, { toValue: 1, duration: 900, useNativeDriver: true })
|
|
4559
4674
|
])
|
|
4560
4675
|
);
|
|
4561
4676
|
loop.start();
|
|
@@ -4566,8 +4681,8 @@ function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
|
4566
4681
|
}, [reduce, opacity]);
|
|
4567
4682
|
const s = SHAPE[shape];
|
|
4568
4683
|
const side = shape === "circle" ? width ?? height ?? s.width : void 0;
|
|
4569
|
-
return /* @__PURE__ */
|
|
4570
|
-
|
|
4684
|
+
return /* @__PURE__ */ jsx51(
|
|
4685
|
+
Animated22.View,
|
|
4571
4686
|
{
|
|
4572
4687
|
testID,
|
|
4573
4688
|
"aria-hidden": true,
|
|
@@ -4580,10 +4695,10 @@ function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
|
4580
4695
|
}
|
|
4581
4696
|
|
|
4582
4697
|
// src/native/slider.tsx
|
|
4583
|
-
import * as
|
|
4584
|
-
import { PanResponder as PanResponder2, StyleSheet as
|
|
4585
|
-
import
|
|
4586
|
-
import { jsx as
|
|
4698
|
+
import * as React38 from "react";
|
|
4699
|
+
import { PanResponder as PanResponder2, StyleSheet as StyleSheet41, Text as Text17, View as View45 } from "react-native";
|
|
4700
|
+
import Svg24, { Defs as Defs11, LinearGradient as LinearGradient11, Rect as Rect4, Stop as Stop11 } from "react-native-svg";
|
|
4701
|
+
import { jsx as jsx52, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4587
4702
|
var THUMB = 26;
|
|
4588
4703
|
var toArray = (v) => v === void 0 ? void 0 : typeof v === "number" ? [v] : [...v];
|
|
4589
4704
|
function Slider({
|
|
@@ -4609,20 +4724,20 @@ function Slider({
|
|
|
4609
4724
|
const { theme, radius: radius3, haptic } = useTheme();
|
|
4610
4725
|
const range = Array.isArray(value ?? defaultValue);
|
|
4611
4726
|
const vertical = orientation === "vertical";
|
|
4612
|
-
const [inner, setInner] =
|
|
4727
|
+
const [inner, setInner] = React38.useState(() => toArray(defaultValue) ?? [min]);
|
|
4613
4728
|
const current = toArray(value) ?? inner;
|
|
4614
|
-
const [length, setLength] =
|
|
4615
|
-
const [dragging, setDragging] =
|
|
4729
|
+
const [length, setLength] = React38.useState(0);
|
|
4730
|
+
const [dragging, setDragging] = React38.useState(null);
|
|
4616
4731
|
const gradientId = useSvgId("kzs");
|
|
4617
4732
|
const out = (next) => range ? [next[0], next[1]] : next[0];
|
|
4618
4733
|
const snap = (v) => Math.min(max, Math.max(min, Math.round((v - min) / step) * step + min));
|
|
4619
4734
|
const pct = (v) => (v - min) / (max - min || 1);
|
|
4620
|
-
const live =
|
|
4621
|
-
|
|
4735
|
+
const live = React38.useRef({ current, length, vertical, disabled });
|
|
4736
|
+
React38.useLayoutEffect(() => {
|
|
4622
4737
|
live.current = { current, length, vertical, disabled };
|
|
4623
4738
|
});
|
|
4624
|
-
const active =
|
|
4625
|
-
const start =
|
|
4739
|
+
const active = React38.useRef(0);
|
|
4740
|
+
const start = React38.useRef(0);
|
|
4626
4741
|
const set = (next) => {
|
|
4627
4742
|
if (value === void 0) setInner(next);
|
|
4628
4743
|
onValueChange?.(out(next));
|
|
@@ -4643,11 +4758,11 @@ function Slider({
|
|
|
4643
4758
|
return min + p * (max - min);
|
|
4644
4759
|
};
|
|
4645
4760
|
const commit = () => onValueCommit?.(out(live.current.current));
|
|
4646
|
-
const handlers =
|
|
4647
|
-
|
|
4761
|
+
const handlers = React38.useRef({ move, at, commit });
|
|
4762
|
+
React38.useLayoutEffect(() => {
|
|
4648
4763
|
handlers.current = { move, at, commit };
|
|
4649
4764
|
});
|
|
4650
|
-
const [responder] =
|
|
4765
|
+
const [responder] = React38.useState(
|
|
4651
4766
|
() => PanResponder2.create({
|
|
4652
4767
|
onStartShouldSetPanResponder: () => !live.current.disabled,
|
|
4653
4768
|
onMoveShouldSetPanResponder: () => !live.current.disabled,
|
|
@@ -4675,24 +4790,24 @@ function Slider({
|
|
|
4675
4790
|
const along = (p) => vertical ? { bottom: p * length } : { left: p * length };
|
|
4676
4791
|
const onLayout = (e) => setLength(vertical ? e.nativeEvent.layout.height : e.nativeEvent.layout.width);
|
|
4677
4792
|
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 };
|
|
4678
|
-
return /* @__PURE__ */
|
|
4679
|
-
showLabel ? /* @__PURE__ */
|
|
4680
|
-
/* @__PURE__ */
|
|
4681
|
-
/* @__PURE__ */
|
|
4793
|
+
return /* @__PURE__ */ jsxs45(View45, { style: [styles41.root, vertical ? styles41.rootVertical : null, disabled ? styles41.disabled : null, style], children: [
|
|
4794
|
+
showLabel ? /* @__PURE__ */ jsxs45(View45, { style: styles41.header, children: [
|
|
4795
|
+
/* @__PURE__ */ jsx52(Text17, { style: [styles41.label, { color: theme.textSecondary }], children: label }),
|
|
4796
|
+
/* @__PURE__ */ jsx52(Text17, { "aria-hidden": true, style: [styles41.value, { color: theme.textSecondary }], children: current.map(formatValue).join(" \u2013 ") })
|
|
4682
4797
|
] }) : null,
|
|
4683
|
-
/* @__PURE__ */
|
|
4684
|
-
/* @__PURE__ */
|
|
4685
|
-
/* @__PURE__ */
|
|
4686
|
-
/* @__PURE__ */
|
|
4687
|
-
/* @__PURE__ */
|
|
4688
|
-
/* @__PURE__ */
|
|
4798
|
+
/* @__PURE__ */ jsxs45(View45, { ...responder.panHandlers, style: vertical ? styles41.controlVertical : styles41.control, children: [
|
|
4799
|
+
/* @__PURE__ */ jsxs45(View45, { onLayout, pointerEvents: "none", style: [vertical ? styles41.trackVertical : styles41.track, { borderRadius: radius3.full, backgroundColor: theme.surface3 }], children: [
|
|
4800
|
+
/* @__PURE__ */ jsx52(View45, { style: [styles41.fill, fill, { borderRadius: radius3.full, overflow: "hidden", backgroundColor: theme.accent }], children: tone3 === "gradient" ? /* @__PURE__ */ jsxs45(Svg24, { width: "100%", height: "100%", "aria-hidden": true, children: [
|
|
4801
|
+
/* @__PURE__ */ jsx52(Defs11, { children: /* @__PURE__ */ jsxs45(LinearGradient11, { id: gradientId, x1: "0", y1: vertical ? "1" : "0", x2: vertical ? "0" : "1", y2: "0", children: [
|
|
4802
|
+
/* @__PURE__ */ jsx52(Stop11, { offset: "0", stopColor: theme.accent }),
|
|
4803
|
+
/* @__PURE__ */ jsx52(Stop11, { offset: "1", stopColor: theme.accent2 })
|
|
4689
4804
|
] }) }),
|
|
4690
|
-
/* @__PURE__ */
|
|
4805
|
+
/* @__PURE__ */ jsx52(Rect4, { width: "100%", height: "100%", fill: `url(#${gradientId})` })
|
|
4691
4806
|
] }) : null }),
|
|
4692
|
-
tickValues.map((t) => /* @__PURE__ */
|
|
4807
|
+
tickValues.map((t) => /* @__PURE__ */ jsx52(View45, { style: [vertical ? styles41.tickVertical : styles41.tick, along(pct(t)), { backgroundColor: t > lo && t < hi ? theme.onAccent : theme.borderStrong }] }, t))
|
|
4693
4808
|
] }),
|
|
4694
|
-
current.map((v, i) => /* @__PURE__ */
|
|
4695
|
-
|
|
4809
|
+
current.map((v, i) => /* @__PURE__ */ jsx52(
|
|
4810
|
+
View45,
|
|
4696
4811
|
{
|
|
4697
4812
|
accessible: true,
|
|
4698
4813
|
role: "slider",
|
|
@@ -4711,16 +4826,16 @@ function Slider({
|
|
|
4711
4826
|
onValueCommit?.(out(values));
|
|
4712
4827
|
},
|
|
4713
4828
|
pointerEvents: "none",
|
|
4714
|
-
style: [
|
|
4715
|
-
children: floatingValue === "always" || floatingValue && dragging === i ? /* @__PURE__ */
|
|
4829
|
+
style: [styles41.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 }],
|
|
4830
|
+
children: floatingValue === "always" || floatingValue && dragging === i ? /* @__PURE__ */ jsx52(View45, { "aria-hidden": true, style: [vertical ? styles41.bubbleVertical : styles41.bubble, { backgroundColor: theme.textPrimary, borderRadius: radius3.md }], children: /* @__PURE__ */ jsx52(Text17, { style: [styles41.bubbleText, { color: theme.surface0 }], children: formatValue(v) }) }) : null
|
|
4716
4831
|
},
|
|
4717
4832
|
i
|
|
4718
4833
|
))
|
|
4719
4834
|
] }),
|
|
4720
|
-
marks2?.length && !vertical ? /* @__PURE__ */
|
|
4835
|
+
marks2?.length && !vertical ? /* @__PURE__ */ jsx52(View45, { "aria-hidden": true, style: styles41.marks, children: marks2.map((m) => /* @__PURE__ */ jsx52(Text17, { style: [styles41.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
|
|
4721
4836
|
] });
|
|
4722
4837
|
}
|
|
4723
|
-
var
|
|
4838
|
+
var styles41 = StyleSheet41.create({
|
|
4724
4839
|
root: { gap: 8, alignSelf: "stretch" },
|
|
4725
4840
|
rootVertical: { alignSelf: "flex-start", alignItems: "center" },
|
|
4726
4841
|
header: { flexDirection: "row", justifyContent: "space-between", alignItems: "baseline", gap: 12 },
|
|
@@ -4756,10 +4871,10 @@ var styles40 = StyleSheet40.create({
|
|
|
4756
4871
|
|
|
4757
4872
|
// src/native/spinner.tsx
|
|
4758
4873
|
import { ActivityIndicator as ActivityIndicator2 } from "react-native";
|
|
4759
|
-
import { jsx as
|
|
4874
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
4760
4875
|
function Spinner({ label, size = "md", ...props }) {
|
|
4761
4876
|
const { theme } = useTheme();
|
|
4762
|
-
return /* @__PURE__ */
|
|
4877
|
+
return /* @__PURE__ */ jsx53(
|
|
4763
4878
|
ActivityIndicator2,
|
|
4764
4879
|
{
|
|
4765
4880
|
accessible: true,
|
|
@@ -4774,17 +4889,17 @@ function Spinner({ label, size = "md", ...props }) {
|
|
|
4774
4889
|
}
|
|
4775
4890
|
|
|
4776
4891
|
// src/native/splash-handoff.tsx
|
|
4777
|
-
import * as
|
|
4778
|
-
import { Animated as
|
|
4779
|
-
import { jsx as
|
|
4892
|
+
import * as React39 from "react";
|
|
4893
|
+
import { Animated as Animated23, Easing as Easing13, StyleSheet as StyleSheet42, View as View46 } from "react-native";
|
|
4894
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
4780
4895
|
function SplashHandoff({ product, ready, onShown, onDone, size = 96, background, label, duration = 320, style }) {
|
|
4781
4896
|
const { theme } = useTheme();
|
|
4782
4897
|
const reduce = useReducedMotion();
|
|
4783
|
-
const [opacity] =
|
|
4784
|
-
const [gone, setGone] =
|
|
4785
|
-
|
|
4898
|
+
const [opacity] = React39.useState(() => new Animated23.Value(1));
|
|
4899
|
+
const [gone, setGone] = React39.useState(false);
|
|
4900
|
+
React39.useEffect(() => {
|
|
4786
4901
|
if (!ready) return;
|
|
4787
|
-
const animation =
|
|
4902
|
+
const animation = Animated23.timing(opacity, { toValue: 0, duration: reduce ? 0 : duration, easing: Easing13.out(Easing13.ease), useNativeDriver: true });
|
|
4788
4903
|
animation.start(({ finished }) => {
|
|
4789
4904
|
if (finished) {
|
|
4790
4905
|
setGone(true);
|
|
@@ -4794,8 +4909,8 @@ function SplashHandoff({ product, ready, onShown, onDone, size = 96, background,
|
|
|
4794
4909
|
return () => animation.stop();
|
|
4795
4910
|
}, [ready, reduce, duration, opacity, onDone]);
|
|
4796
4911
|
if (gone) return null;
|
|
4797
|
-
return /* @__PURE__ */
|
|
4798
|
-
|
|
4912
|
+
return /* @__PURE__ */ jsx54(
|
|
4913
|
+
Animated23.View,
|
|
4799
4914
|
{
|
|
4800
4915
|
accessible: true,
|
|
4801
4916
|
role: "progressbar",
|
|
@@ -4803,30 +4918,30 @@ function SplashHandoff({ product, ready, onShown, onDone, size = 96, background,
|
|
|
4803
4918
|
"aria-busy": true,
|
|
4804
4919
|
pointerEvents: ready ? "none" : "auto",
|
|
4805
4920
|
onLayout: onShown,
|
|
4806
|
-
style: [
|
|
4807
|
-
children: /* @__PURE__ */
|
|
4921
|
+
style: [StyleSheet42.absoluteFill, styles42.root, { backgroundColor: background ?? theme.surface0, opacity }, style],
|
|
4922
|
+
children: /* @__PURE__ */ jsx54(View46, { children: /* @__PURE__ */ jsx54(ProductMark, { id: product, size, animated: true }) })
|
|
4808
4923
|
}
|
|
4809
4924
|
);
|
|
4810
4925
|
}
|
|
4811
|
-
var
|
|
4926
|
+
var styles42 = StyleSheet42.create({ root: { alignItems: "center", justifyContent: "center", zIndex: 100 } });
|
|
4812
4927
|
|
|
4813
4928
|
// src/native/step-progress.tsx
|
|
4814
|
-
import { Pressable as
|
|
4815
|
-
import
|
|
4816
|
-
import { jsx as
|
|
4929
|
+
import { Pressable as Pressable22, StyleSheet as StyleSheet43, View as View47 } from "react-native";
|
|
4930
|
+
import Svg25, { Path as Path20 } from "react-native-svg";
|
|
4931
|
+
import { jsx as jsx55, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4817
4932
|
function StepProgress({ step, total, label, backLabel, onBack, trailing, style }) {
|
|
4818
4933
|
const { theme, insets } = useTheme();
|
|
4819
4934
|
const words2 = label(step, total);
|
|
4820
|
-
return /* @__PURE__ */
|
|
4821
|
-
/* @__PURE__ */
|
|
4822
|
-
onBack && backLabel ? /* @__PURE__ */
|
|
4823
|
-
/* @__PURE__ */
|
|
4824
|
-
/* @__PURE__ */
|
|
4935
|
+
return /* @__PURE__ */ jsxs46(View47, { style: [styles43.root, { paddingTop: insets.top + 8 }, style], children: [
|
|
4936
|
+
/* @__PURE__ */ jsxs46(View47, { style: styles43.row, children: [
|
|
4937
|
+
onBack && backLabel ? /* @__PURE__ */ jsx55(Pressable22, { role: "button", "aria-label": backLabel, hitSlop: 10, onPress: onBack, style: styles43.back, children: /* @__PURE__ */ jsx55(Svg25, { width: 22, height: 22, viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsx55(Path20, { d: "M15 5l-7 7 7 7", stroke: theme.textPrimary, strokeWidth: 2.4, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) }) }) : /* @__PURE__ */ jsx55(View47, { style: styles43.back }),
|
|
4938
|
+
/* @__PURE__ */ jsx55(View47, { accessible: true, role: "progressbar", "aria-label": words2, "aria-valuemin": 1, "aria-valuemax": total, "aria-valuenow": step, "aria-valuetext": words2, style: styles43.bars, children: Array.from({ length: total }, (_, i) => /* @__PURE__ */ jsx55(View47, { style: [styles43.bar, { backgroundColor: i < step ? theme.accent : theme.surface3 }] }, i)) }),
|
|
4939
|
+
/* @__PURE__ */ jsx55(View47, { style: styles43.trailing, children: trailing })
|
|
4825
4940
|
] }),
|
|
4826
|
-
/* @__PURE__ */
|
|
4941
|
+
/* @__PURE__ */ jsx55(Txt, { variant: "caption", tone: "secondary", style: styles43.words, "aria-hidden": true, children: words2 })
|
|
4827
4942
|
] });
|
|
4828
4943
|
}
|
|
4829
|
-
var
|
|
4944
|
+
var styles43 = StyleSheet43.create({
|
|
4830
4945
|
root: { paddingHorizontal: 12, gap: 6 },
|
|
4831
4946
|
row: { flexDirection: "row", alignItems: "center", gap: 8 },
|
|
4832
4947
|
back: { width: 40, height: 40, alignItems: "center", justifyContent: "center" },
|
|
@@ -4837,36 +4952,36 @@ var styles42 = StyleSheet42.create({
|
|
|
4837
4952
|
});
|
|
4838
4953
|
|
|
4839
4954
|
// src/native/stepper.tsx
|
|
4840
|
-
import { StyleSheet as
|
|
4841
|
-
import
|
|
4842
|
-
import { jsx as
|
|
4955
|
+
import { StyleSheet as StyleSheet44, View as View48 } from "react-native";
|
|
4956
|
+
import Svg26, { Circle as Circle13, Path as Path21 } from "react-native-svg";
|
|
4957
|
+
import { jsx as jsx56, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4843
4958
|
var WORDS = { done: "done", current: "in progress", upcoming: "to come", error: "failed" };
|
|
4844
4959
|
function Stepper({ steps, current = 0, orientation = "vertical", statusLabels, "aria-label": label, style }) {
|
|
4845
4960
|
const { theme } = useTheme();
|
|
4846
4961
|
const words2 = { ...WORDS, ...statusLabels };
|
|
4847
4962
|
const vertical = orientation === "vertical";
|
|
4848
|
-
return /* @__PURE__ */
|
|
4963
|
+
return /* @__PURE__ */ jsx56(View48, { role: "list", "aria-label": label, style: [vertical ? styles44.column : styles44.row, style], children: steps.map((step, i) => {
|
|
4849
4964
|
const status = step.status ?? (i < current ? "done" : i === current ? "current" : "upcoming");
|
|
4850
4965
|
const last = i === steps.length - 1;
|
|
4851
|
-
const node = status === "current" ? /* @__PURE__ */
|
|
4852
|
-
/* @__PURE__ */
|
|
4853
|
-
status === "done" ? /* @__PURE__ */
|
|
4966
|
+
const node = status === "current" ? /* @__PURE__ */ jsx56(LoaderGlyph, { value: step.value ?? null, size: 24 }) : status === "error" ? /* @__PURE__ */ jsx56(LoaderGlyph, { state: "error", size: 24 }) : /* @__PURE__ */ jsxs47(Svg26, { width: 24, height: 24, viewBox: "0 0 24 24", "aria-hidden": true, children: [
|
|
4967
|
+
/* @__PURE__ */ jsx56(Circle13, { cx: 12, cy: 12, r: 10, fill: status === "done" ? theme.accent : "none", stroke: status === "done" ? theme.accent : theme.borderStrong, strokeWidth: 2 }),
|
|
4968
|
+
status === "done" ? /* @__PURE__ */ jsx56(Path21, { d: "M7.5 12.3l3 3 6-6.3", stroke: theme.onAccent, strokeWidth: 2.2, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }) : null
|
|
4854
4969
|
] });
|
|
4855
|
-
const connector = !last ? /* @__PURE__ */
|
|
4856
|
-
return /* @__PURE__ */
|
|
4857
|
-
/* @__PURE__ */
|
|
4970
|
+
const connector = !last ? /* @__PURE__ */ jsx56(View48, { "aria-hidden": true, style: [vertical ? styles44.vLine : styles44.hLine, { backgroundColor: status === "done" ? theme.accent : theme.borderDefault }] }) : null;
|
|
4971
|
+
return /* @__PURE__ */ jsxs47(View48, { role: "listitem", accessible: true, "aria-label": `${step.title}, ${words2[status]}`, style: vertical ? styles44.vStep : styles44.hStep, children: [
|
|
4972
|
+
/* @__PURE__ */ jsxs47(View48, { style: vertical ? styles44.vRail : styles44.hRail, children: [
|
|
4858
4973
|
node,
|
|
4859
4974
|
connector
|
|
4860
4975
|
] }),
|
|
4861
|
-
/* @__PURE__ */
|
|
4862
|
-
/* @__PURE__ */
|
|
4863
|
-
step.description ? /* @__PURE__ */
|
|
4864
|
-
step.content && (status === "current" || status === "error") ? /* @__PURE__ */
|
|
4976
|
+
/* @__PURE__ */ jsxs47(View48, { style: [styles44.body, vertical && !last ? { paddingBottom: 20 } : null], children: [
|
|
4977
|
+
/* @__PURE__ */ jsx56(Txt, { variant: "label", tone: status === "upcoming" ? "secondary" : "text", numberOfLines: vertical ? void 0 : 2, children: step.title }),
|
|
4978
|
+
step.description ? /* @__PURE__ */ jsx56(Txt, { variant: "caption", tone: "secondary", children: step.description }) : null,
|
|
4979
|
+
step.content && (status === "current" || status === "error") ? /* @__PURE__ */ jsx56(View48, { style: styles44.content, children: step.content }) : null
|
|
4865
4980
|
] })
|
|
4866
4981
|
] }, i);
|
|
4867
4982
|
}) });
|
|
4868
4983
|
}
|
|
4869
|
-
var
|
|
4984
|
+
var styles44 = StyleSheet44.create({
|
|
4870
4985
|
column: { gap: 0 },
|
|
4871
4986
|
row: { flexDirection: "row" },
|
|
4872
4987
|
vStep: { flexDirection: "row", gap: 12 },
|
|
@@ -4880,59 +4995,59 @@ var styles43 = StyleSheet43.create({
|
|
|
4880
4995
|
});
|
|
4881
4996
|
|
|
4882
4997
|
// src/native/swipe-deck.tsx
|
|
4883
|
-
import * as
|
|
4884
|
-
import { AccessibilityInfo as AccessibilityInfo14, Animated as
|
|
4885
|
-
import
|
|
4886
|
-
import { Fragment as Fragment8, jsx as
|
|
4998
|
+
import * as React40 from "react";
|
|
4999
|
+
import { AccessibilityInfo as AccessibilityInfo14, Animated as Animated24, Image as Image5, PanResponder as PanResponder3, Platform as Platform4, Pressable as Pressable23, StyleSheet as StyleSheet45, useWindowDimensions as useWindowDimensions2, View as View49 } from "react-native";
|
|
5000
|
+
import Svg27, { Defs as Defs12, LinearGradient as LinearGradient12, Path as Path22, Rect as Rect5, Stop as Stop12 } from "react-native-svg";
|
|
5001
|
+
import { Fragment as Fragment8, jsx as jsx57, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4887
5002
|
function PersonCard({ photos, name, age, badge, meta, bio, footer, photoLabel = (n, t) => `Photo ${n} of ${t}`, style }) {
|
|
4888
5003
|
const { theme, radius: radius3 } = useTheme();
|
|
4889
|
-
const [index, setIndex] =
|
|
5004
|
+
const [index, setIndex] = React40.useState(0);
|
|
4890
5005
|
const gradient = useSvgId("kz-profile-");
|
|
4891
|
-
const [box, setBox] =
|
|
5006
|
+
const [box, setBox] = React40.useState(null);
|
|
4892
5007
|
const photo = photos[index];
|
|
4893
|
-
return /* @__PURE__ */
|
|
4894
|
-
|
|
5008
|
+
return /* @__PURE__ */ jsxs48(
|
|
5009
|
+
View49,
|
|
4895
5010
|
{
|
|
4896
5011
|
accessible: Platform4.OS !== "web",
|
|
4897
5012
|
accessibilityActions: photos.length > 1 ? [{ name: "increment" }, { name: "decrement" }] : [],
|
|
4898
5013
|
onAccessibilityAction: (e) => setIndex((i) => Math.max(0, Math.min(photos.length - 1, i + (e.nativeEvent.actionName === "increment" ? 1 : -1)))),
|
|
4899
5014
|
role: Platform4.OS === "web" ? "group" : "img",
|
|
4900
5015
|
"aria-label": [`${name}${age !== void 0 ? `, ${age}` : ""}`, bio, photos.length > 1 ? photoLabel(index + 1, photos.length) : null].filter(Boolean).join(". "),
|
|
4901
|
-
style: [
|
|
5016
|
+
style: [styles45.card, { borderRadius: radius3.xl, backgroundColor: theme.media }, style],
|
|
4902
5017
|
children: [
|
|
4903
|
-
photo ? /* @__PURE__ */
|
|
4904
|
-
photos.length > 1 ? /* @__PURE__ */
|
|
4905
|
-
/* @__PURE__ */
|
|
4906
|
-
/* @__PURE__ */
|
|
4907
|
-
/* @__PURE__ */
|
|
5018
|
+
photo ? /* @__PURE__ */ jsx57(Image5, { testID: "person-card-photo", source: { uri: photo.uri }, style: StyleSheet45.absoluteFill, resizeMode: "cover" }) : null,
|
|
5019
|
+
photos.length > 1 ? /* @__PURE__ */ jsxs48(Fragment8, { children: [
|
|
5020
|
+
/* @__PURE__ */ jsx57(View49, { style: styles45.bars, "aria-hidden": true, children: photos.map((_, i) => /* @__PURE__ */ jsx57(View49, { style: [styles45.bar, { backgroundColor: theme.textOnMedia, opacity: i === index ? 1 : 0.4 }] }, i)) }),
|
|
5021
|
+
/* @__PURE__ */ jsx57(Pressable23, { "aria-hidden": true, accessible: false, focusable: false, tabIndex: -1, style: [styles45.half, { left: 0 }], onPress: () => setIndex((i) => Math.max(0, i - 1)) }),
|
|
5022
|
+
/* @__PURE__ */ jsx57(Pressable23, { "aria-hidden": true, accessible: false, focusable: false, tabIndex: -1, style: [styles45.half, { right: 0 }], onPress: () => setIndex((i) => Math.min(photos.length - 1, i + 1)) })
|
|
4908
5023
|
] }) : null,
|
|
4909
|
-
/* @__PURE__ */
|
|
4910
|
-
|
|
5024
|
+
/* @__PURE__ */ jsxs48(
|
|
5025
|
+
View49,
|
|
4911
5026
|
{
|
|
4912
5027
|
testID: "person-card-overlay",
|
|
4913
5028
|
pointerEvents: "box-none",
|
|
4914
|
-
style:
|
|
5029
|
+
style: styles45.bottom,
|
|
4915
5030
|
onLayout: (e) => setBox({ width: e.nativeEvent.layout.width, height: e.nativeEvent.layout.height }),
|
|
4916
5031
|
children: [
|
|
4917
|
-
box ? /* @__PURE__ */
|
|
4918
|
-
/* @__PURE__ */
|
|
4919
|
-
/* @__PURE__ */
|
|
4920
|
-
/* @__PURE__ */
|
|
4921
|
-
/* @__PURE__ */
|
|
5032
|
+
box ? /* @__PURE__ */ jsxs48(Svg27, { testID: "person-card-scrim", style: styles45.scrim, width: box.width, height: box.height, "aria-hidden": true, children: [
|
|
5033
|
+
/* @__PURE__ */ jsx57(Defs12, { children: /* @__PURE__ */ jsxs48(LinearGradient12, { id: gradient, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
5034
|
+
/* @__PURE__ */ jsx57(Stop12, { offset: "0", stopColor: theme.scrimStrong, stopOpacity: 0 }),
|
|
5035
|
+
/* @__PURE__ */ jsx57(Stop12, { offset: "0.5", stopColor: theme.scrimStrong, stopOpacity: 0.8 }),
|
|
5036
|
+
/* @__PURE__ */ jsx57(Stop12, { offset: "1", stopColor: theme.scrimStrong, stopOpacity: 1 })
|
|
4922
5037
|
] }) }),
|
|
4923
|
-
/* @__PURE__ */
|
|
5038
|
+
/* @__PURE__ */ jsx57(Rect5, { x: 0, y: 0, width: box.width, height: box.height, fill: `url(#${gradient})` })
|
|
4924
5039
|
] }) : null,
|
|
4925
|
-
/* @__PURE__ */
|
|
4926
|
-
/* @__PURE__ */
|
|
4927
|
-
/* @__PURE__ */
|
|
5040
|
+
/* @__PURE__ */ jsxs48(View49, { style: styles45.text, children: [
|
|
5041
|
+
/* @__PURE__ */ jsxs48(View49, { style: styles45.nameRow, children: [
|
|
5042
|
+
/* @__PURE__ */ jsxs48(Txt, { variant: "display", tone: "onMedia", style: styles45.name, numberOfLines: 1, children: [
|
|
4928
5043
|
name,
|
|
4929
|
-
age !== void 0 ? /* @__PURE__ */
|
|
5044
|
+
age !== void 0 ? /* @__PURE__ */ jsx57(Txt, { variant: "display", tone: "onMedia", style: styles45.age, children: ` ${age}` }) : null
|
|
4930
5045
|
] }),
|
|
4931
5046
|
badge
|
|
4932
5047
|
] }),
|
|
4933
5048
|
meta,
|
|
4934
|
-
bio ? /* @__PURE__ */
|
|
4935
|
-
footer ? /* @__PURE__ */
|
|
5049
|
+
bio ? /* @__PURE__ */ jsx57(Txt, { tone: "onMedia", numberOfLines: 2, children: bio }) : null,
|
|
5050
|
+
footer ? /* @__PURE__ */ jsx57(View49, { style: styles45.footer, children: footer }) : null
|
|
4936
5051
|
] })
|
|
4937
5052
|
]
|
|
4938
5053
|
}
|
|
@@ -4945,9 +5060,9 @@ function SwipeDeck({ items: items2, getId, renderCard, onSwipe, empty: empty2, l
|
|
|
4945
5060
|
const { theme, haptic } = useTheme();
|
|
4946
5061
|
const reduce = useReducedMotion();
|
|
4947
5062
|
const { width } = useWindowDimensions2();
|
|
4948
|
-
const [x] =
|
|
5063
|
+
const [x] = React40.useState(() => new Animated24.Value(0));
|
|
4949
5064
|
const top = items2[0];
|
|
4950
|
-
const decide =
|
|
5065
|
+
const decide = React40.useCallback(
|
|
4951
5066
|
(direction) => {
|
|
4952
5067
|
if (!top) return;
|
|
4953
5068
|
haptic("impact");
|
|
@@ -4957,18 +5072,18 @@ function SwipeDeck({ items: items2, getId, renderCard, onSwipe, empty: empty2, l
|
|
|
4957
5072
|
if (items2.length === 1 && labels.empty) AccessibilityInfo14.announceForAccessibility(labels.empty);
|
|
4958
5073
|
};
|
|
4959
5074
|
if (reduce) return done();
|
|
4960
|
-
|
|
5075
|
+
Animated24.timing(x, { toValue: (direction === "like" ? 1.4 : -1.4) * width, duration: 220, useNativeDriver: true }).start(done);
|
|
4961
5076
|
},
|
|
4962
5077
|
[top, haptic, reduce, x, width, onSwipe, items2.length, labels.empty]
|
|
4963
5078
|
);
|
|
4964
|
-
const pan =
|
|
5079
|
+
const pan = React40.useMemo(
|
|
4965
5080
|
() => PanResponder3.create({
|
|
4966
5081
|
onMoveShouldSetPanResponder: (_, g) => Math.abs(g.dx) > 8 && Math.abs(g.dx) > Math.abs(g.dy),
|
|
4967
5082
|
onPanResponderMove: (_, g) => x.setValue(g.dx),
|
|
4968
5083
|
onPanResponderRelease: (_, g) => {
|
|
4969
5084
|
if (g.dx > width / 3 || g.vx > 1) decide("like");
|
|
4970
5085
|
else if (g.dx < -width / 3 || g.vx < -1) decide("pass");
|
|
4971
|
-
else
|
|
5086
|
+
else Animated24.spring(x, { toValue: 0, useNativeDriver: true, friction: 6 }).start();
|
|
4972
5087
|
}
|
|
4973
5088
|
}),
|
|
4974
5089
|
[x, width, decide]
|
|
@@ -4976,27 +5091,27 @@ function SwipeDeck({ items: items2, getId, renderCard, onSwipe, empty: empty2, l
|
|
|
4976
5091
|
const rotate = x.interpolate({ inputRange: [-width, 0, width], outputRange: ["-14deg", "0deg", "14deg"] });
|
|
4977
5092
|
const likeOpacity = x.interpolate({ inputRange: [0, width / 4], outputRange: [0, 1], extrapolate: "clamp" });
|
|
4978
5093
|
const passOpacity = x.interpolate({ inputRange: [-width / 4, 0], outputRange: [1, 0], extrapolate: "clamp" });
|
|
4979
|
-
const button = (direction) => /* @__PURE__ */
|
|
4980
|
-
|
|
5094
|
+
const button = (direction) => /* @__PURE__ */ jsx57(
|
|
5095
|
+
Pressable23,
|
|
4981
5096
|
{
|
|
4982
5097
|
role: "button",
|
|
4983
5098
|
"aria-label": direction === "like" ? labels.like : labels.pass,
|
|
4984
5099
|
disabled: !top,
|
|
4985
5100
|
onPress: () => decide(direction),
|
|
4986
5101
|
style: ({ pressed }) => [
|
|
4987
|
-
|
|
5102
|
+
styles45.button,
|
|
4988
5103
|
{ borderColor: direction === "like" ? theme.success : theme.danger, backgroundColor: theme.surface1, transform: [{ scale: pressed ? 0.92 : 1 }], opacity: top ? 1 : 0.4 }
|
|
4989
5104
|
],
|
|
4990
|
-
children: /* @__PURE__ */
|
|
5105
|
+
children: /* @__PURE__ */ jsx57(Svg27, { width: 28, height: 28, viewBox: "0 0 24 24", "aria-hidden": true, children: direction === "like" ? /* @__PURE__ */ jsx57(Path22, { 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__ */ jsx57(Path22, { d: "M6 6l12 12M18 6 6 18", stroke: theme.danger, strokeWidth: 3, strokeLinecap: "round" }) })
|
|
4991
5106
|
}
|
|
4992
5107
|
);
|
|
4993
|
-
return /* @__PURE__ */
|
|
4994
|
-
/* @__PURE__ */
|
|
5108
|
+
return /* @__PURE__ */ jsxs48(View49, { style: [styles45.deck, style], children: [
|
|
5109
|
+
/* @__PURE__ */ jsxs48(View49, { style: styles45.stack, children: [
|
|
4995
5110
|
!top ? empty2 ?? null : null,
|
|
4996
5111
|
items2.slice(0, 2).reverse().map((item) => {
|
|
4997
5112
|
const isTop = item === top;
|
|
4998
|
-
return /* @__PURE__ */
|
|
4999
|
-
|
|
5113
|
+
return /* @__PURE__ */ jsxs48(
|
|
5114
|
+
Animated24.View,
|
|
5000
5115
|
{
|
|
5001
5116
|
...isTop ? pan.panHandlers : {},
|
|
5002
5117
|
accessibilityActions: isTop ? [{ name: "like", label: labels.like }, { name: "pass", label: labels.pass }] : [],
|
|
@@ -5004,12 +5119,12 @@ function SwipeDeck({ items: items2, getId, renderCard, onSwipe, empty: empty2, l
|
|
|
5004
5119
|
"aria-hidden": !isTop,
|
|
5005
5120
|
importantForAccessibility: isTop ? "auto" : "no-hide-descendants",
|
|
5006
5121
|
pointerEvents: isTop ? "auto" : "none",
|
|
5007
|
-
style: [
|
|
5122
|
+
style: [StyleSheet45.absoluteFill, isTop ? { transform: [{ translateX: x }, { rotate }] } : { transform: [{ scale: 0.96 }], opacity: 0.9 }],
|
|
5008
5123
|
children: [
|
|
5009
5124
|
renderCard(item),
|
|
5010
|
-
isTop ? /* @__PURE__ */
|
|
5011
|
-
/* @__PURE__ */
|
|
5012
|
-
/* @__PURE__ */
|
|
5125
|
+
isTop ? /* @__PURE__ */ jsxs48(Fragment8, { children: [
|
|
5126
|
+
/* @__PURE__ */ jsx57(Animated24.View, { pointerEvents: "none", style: [styles45.stamp, styles45.stampLike, { borderColor: theme.success, opacity: likeOpacity }], "aria-hidden": true, children: /* @__PURE__ */ jsx57(Txt, { variant: "title", style: { color: theme.success }, children: labels.likeStamp ?? labels.like.toUpperCase() }) }),
|
|
5127
|
+
/* @__PURE__ */ jsx57(Animated24.View, { pointerEvents: "none", style: [styles45.stamp, styles45.stampPass, { borderColor: theme.danger, opacity: passOpacity }], "aria-hidden": true, children: /* @__PURE__ */ jsx57(Txt, { variant: "title", style: { color: theme.danger }, children: labels.passStamp ?? labels.pass.toUpperCase() }) })
|
|
5013
5128
|
] }) : null
|
|
5014
5129
|
]
|
|
5015
5130
|
},
|
|
@@ -5017,13 +5132,13 @@ function SwipeDeck({ items: items2, getId, renderCard, onSwipe, empty: empty2, l
|
|
|
5017
5132
|
);
|
|
5018
5133
|
})
|
|
5019
5134
|
] }),
|
|
5020
|
-
hideButtons ? null : /* @__PURE__ */
|
|
5135
|
+
hideButtons ? null : /* @__PURE__ */ jsxs48(View49, { style: styles45.buttons, children: [
|
|
5021
5136
|
button("pass"),
|
|
5022
5137
|
button("like")
|
|
5023
5138
|
] })
|
|
5024
5139
|
] });
|
|
5025
5140
|
}
|
|
5026
|
-
var
|
|
5141
|
+
var styles45 = StyleSheet45.create({
|
|
5027
5142
|
card: { flex: 1, overflow: "hidden" },
|
|
5028
5143
|
bars: { position: "absolute", top: 8, left: 8, right: 8, flexDirection: "row", gap: 4 },
|
|
5029
5144
|
bar: { flex: 1, height: 3, borderRadius: 2 },
|
|
@@ -5045,28 +5160,28 @@ var styles44 = StyleSheet44.create({
|
|
|
5045
5160
|
});
|
|
5046
5161
|
|
|
5047
5162
|
// src/native/swipeable-row.tsx
|
|
5048
|
-
import * as
|
|
5049
|
-
import { Animated as
|
|
5050
|
-
import { jsx as
|
|
5163
|
+
import * as React41 from "react";
|
|
5164
|
+
import { Animated as Animated25, PanResponder as PanResponder4, Pressable as Pressable24, StyleSheet as StyleSheet46, View as View50 } from "react-native";
|
|
5165
|
+
import { jsx as jsx58, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
5051
5166
|
var toneColor = (t, tone3) => ({ neutral: t.surface3, accent: t.accent, success: t.success, warning: t.warning, danger: t.danger })[tone3 ?? "neutral"];
|
|
5052
5167
|
var toneText = (tone3) => tone3 === "neutral" || tone3 === void 0 ? "text" : "onAccent";
|
|
5053
5168
|
function SwipeableRow({ children, trailing = [], leading = [], fullSwipe = 0.6, actionWidth = 80, onActivate, testID, style }) {
|
|
5054
5169
|
const { theme, haptic } = useTheme();
|
|
5055
5170
|
const reduce = useReducedMotion();
|
|
5056
|
-
const [x] =
|
|
5057
|
-
const [width, setWidth] =
|
|
5058
|
-
const rest =
|
|
5059
|
-
const armed =
|
|
5171
|
+
const [x] = React41.useState(() => new Animated25.Value(0));
|
|
5172
|
+
const [width, setWidth] = React41.useState(0);
|
|
5173
|
+
const rest = React41.useRef(0);
|
|
5174
|
+
const armed = React41.useRef(false);
|
|
5060
5175
|
const settle = (to) => {
|
|
5061
5176
|
rest.current = to;
|
|
5062
5177
|
if (reduce) x.setValue(to);
|
|
5063
|
-
else
|
|
5178
|
+
else Animated25.spring(x, { toValue: to, useNativeDriver: true, damping: 22, stiffness: 240 }).start();
|
|
5064
5179
|
};
|
|
5065
5180
|
const run = (action) => {
|
|
5066
5181
|
settle(0);
|
|
5067
5182
|
action.onPress();
|
|
5068
5183
|
};
|
|
5069
|
-
const pan =
|
|
5184
|
+
const pan = React41.useMemo(
|
|
5070
5185
|
() => PanResponder4.create({
|
|
5071
5186
|
onMoveShouldSetPanResponder: (_, g) => Math.abs(g.dx) > 8 && Math.abs(g.dx) > Math.abs(g.dy) * 1.5,
|
|
5072
5187
|
onPanResponderMove: (_, g) => {
|
|
@@ -5095,19 +5210,19 @@ function SwipeableRow({ children, trailing = [], leading = [], fullSwipe = 0.6,
|
|
|
5095
5210
|
[trailing, leading, fullSwipe, width, actionWidth]
|
|
5096
5211
|
// eslint-disable-line react-hooks/exhaustive-deps -- run/settle are stable in effect
|
|
5097
5212
|
);
|
|
5098
|
-
const side = (actions, edge) => /* @__PURE__ */
|
|
5213
|
+
const side = (actions, edge) => /* @__PURE__ */ jsx58(View50, { "aria-hidden": true, style: [styles46.side, edge === "left" ? { left: 0 } : { right: 0, flexDirection: "row-reverse" }], children: actions.map((action, i) => (
|
|
5099
5214
|
// eslint-disable-next-line react-hooks/refs -- runs on a press, never during render
|
|
5100
|
-
/* @__PURE__ */
|
|
5215
|
+
/* @__PURE__ */ jsxs49(Pressable24, { focusable: false, tabIndex: -1, onPress: () => run(action), style: [styles46.action, { width: actionWidth, backgroundColor: toneColor(theme, action.tone) }], children: [
|
|
5101
5216
|
action.icon,
|
|
5102
|
-
/* @__PURE__ */
|
|
5217
|
+
/* @__PURE__ */ jsx58(Txt, { variant: "caption", tone: toneText(action.tone), style: styles46.actionText, numberOfLines: 1, children: action.label })
|
|
5103
5218
|
] }, i)
|
|
5104
5219
|
)) });
|
|
5105
5220
|
const all = [...leading, ...trailing];
|
|
5106
|
-
return /* @__PURE__ */
|
|
5221
|
+
return /* @__PURE__ */ jsxs49(View50, { style: [styles46.root, style], onLayout: (e) => setWidth(e.nativeEvent.layout.width), children: [
|
|
5107
5222
|
leading.length > 0 ? side(leading, "left") : null,
|
|
5108
5223
|
trailing.length > 0 ? side(trailing, "right") : null,
|
|
5109
|
-
/* @__PURE__ */
|
|
5110
|
-
|
|
5224
|
+
/* @__PURE__ */ jsx58(
|
|
5225
|
+
Animated25.View,
|
|
5111
5226
|
{
|
|
5112
5227
|
...pan.panHandlers,
|
|
5113
5228
|
accessible: true,
|
|
@@ -5118,13 +5233,13 @@ function SwipeableRow({ children, trailing = [], leading = [], fullSwipe = 0.6,
|
|
|
5118
5233
|
const action = all.find((a) => a.label === e.nativeEvent.actionName);
|
|
5119
5234
|
if (action) action.onPress();
|
|
5120
5235
|
},
|
|
5121
|
-
style: [
|
|
5236
|
+
style: [styles46.front, { backgroundColor: theme.surface0, transform: [{ translateX: x }] }],
|
|
5122
5237
|
children
|
|
5123
5238
|
}
|
|
5124
5239
|
)
|
|
5125
5240
|
] });
|
|
5126
5241
|
}
|
|
5127
|
-
var
|
|
5242
|
+
var styles46 = StyleSheet46.create({
|
|
5128
5243
|
root: { overflow: "hidden" },
|
|
5129
5244
|
side: { position: "absolute", top: 0, bottom: 0, flexDirection: "row" },
|
|
5130
5245
|
action: { alignItems: "center", justifyContent: "center", gap: 4, paddingHorizontal: 6 },
|
|
@@ -5133,30 +5248,30 @@ var styles45 = StyleSheet45.create({
|
|
|
5133
5248
|
});
|
|
5134
5249
|
|
|
5135
5250
|
// src/native/switch.tsx
|
|
5136
|
-
import * as
|
|
5137
|
-
import { Animated as
|
|
5138
|
-
import { jsx as
|
|
5251
|
+
import * as React42 from "react";
|
|
5252
|
+
import { Animated as Animated26, Pressable as Pressable25, StyleSheet as StyleSheet47, Text as Text18, View as View51 } from "react-native";
|
|
5253
|
+
import { jsx as jsx59, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5139
5254
|
var SIZES = { sm: { w: 40, h: 24, knob: 18 }, md: { w: 52, h: 32, knob: 26 } };
|
|
5140
5255
|
function Switch({ label, checked, defaultChecked = false, onCheckedChange, description, showLabel, size = "md", error, disabled, style }) {
|
|
5141
5256
|
const { theme, motion: motion3, haptic } = useTheme();
|
|
5142
|
-
const [own, setOwn] =
|
|
5257
|
+
const [own, setOwn] = React42.useState(defaultChecked);
|
|
5143
5258
|
const on = checked ?? own;
|
|
5144
5259
|
const d = SIZES[size];
|
|
5145
5260
|
const travel = d.w - d.knob - (d.h - d.knob);
|
|
5146
|
-
const [x] =
|
|
5147
|
-
|
|
5148
|
-
|
|
5261
|
+
const [x] = React42.useState(() => new Animated26.Value(on ? 1 : 0));
|
|
5262
|
+
React42.useEffect(() => {
|
|
5263
|
+
Animated26.timing(x, { toValue: on ? 1 : 0, duration: motion3.duration.base, useNativeDriver: true }).start();
|
|
5149
5264
|
}, [on, x, motion3.duration.base]);
|
|
5150
5265
|
const toggle = () => {
|
|
5151
5266
|
haptic("selection");
|
|
5152
5267
|
if (checked === void 0) setOwn(!on);
|
|
5153
5268
|
onCheckedChange?.(!on);
|
|
5154
5269
|
};
|
|
5155
|
-
const track = /* @__PURE__ */
|
|
5156
|
-
|
|
5270
|
+
const track = /* @__PURE__ */ jsx59(View51, { style: [styles47.track, { width: d.w, height: d.h, borderRadius: d.h / 2, backgroundColor: on ? theme.accent : theme.surface3, borderColor: error ? theme.danger : on ? theme.accent : theme.borderDefault }], children: /* @__PURE__ */ jsx59(
|
|
5271
|
+
Animated26.View,
|
|
5157
5272
|
{
|
|
5158
5273
|
style: [
|
|
5159
|
-
|
|
5274
|
+
styles47.knob,
|
|
5160
5275
|
{
|
|
5161
5276
|
width: d.knob,
|
|
5162
5277
|
height: d.knob,
|
|
@@ -5178,19 +5293,19 @@ function Switch({ label, checked, defaultChecked = false, onCheckedChange, descr
|
|
|
5178
5293
|
onPress: toggle
|
|
5179
5294
|
};
|
|
5180
5295
|
if (!showLabel)
|
|
5181
|
-
return /* @__PURE__ */
|
|
5182
|
-
return /* @__PURE__ */
|
|
5183
|
-
/* @__PURE__ */
|
|
5184
|
-
/* @__PURE__ */
|
|
5185
|
-
/* @__PURE__ */
|
|
5186
|
-
description ? /* @__PURE__ */
|
|
5296
|
+
return /* @__PURE__ */ jsx59(Pressable25, { ...a11y, hitSlop: { top: (44 - d.h) / 2, bottom: (44 - d.h) / 2, left: Math.max(0, (44 - d.w) / 2), right: Math.max(0, (44 - d.w) / 2) }, style: [disabled ? styles47.disabled : null, style], children: track });
|
|
5297
|
+
return /* @__PURE__ */ jsxs50(View51, { style: [styles47.root, style], children: [
|
|
5298
|
+
/* @__PURE__ */ jsxs50(Pressable25, { ...a11y, style: [styles47.row, disabled ? styles47.disabled : null], children: [
|
|
5299
|
+
/* @__PURE__ */ jsxs50(View51, { style: styles47.text, children: [
|
|
5300
|
+
/* @__PURE__ */ jsx59(Text18, { style: [styles47.label, { color: theme.textPrimary }], children: label }),
|
|
5301
|
+
description ? /* @__PURE__ */ jsx59(Text18, { style: [styles47.description, { color: theme.textSecondary }], children: description }) : null
|
|
5187
5302
|
] }),
|
|
5188
5303
|
track
|
|
5189
5304
|
] }),
|
|
5190
|
-
error ? /* @__PURE__ */
|
|
5305
|
+
error ? /* @__PURE__ */ jsx59(Text18, { role: "alert", "aria-live": "polite", style: [styles47.description, { color: theme.dangerText }], children: error }) : null
|
|
5191
5306
|
] });
|
|
5192
5307
|
}
|
|
5193
|
-
var
|
|
5308
|
+
var styles47 = StyleSheet47.create({
|
|
5194
5309
|
root: { gap: 2, alignSelf: "stretch" },
|
|
5195
5310
|
row: { flexDirection: "row", alignItems: "center", gap: 16, minHeight: 48 },
|
|
5196
5311
|
text: { flex: 1, gap: 2 },
|
|
@@ -5202,16 +5317,16 @@ var styles46 = StyleSheet46.create({
|
|
|
5202
5317
|
});
|
|
5203
5318
|
|
|
5204
5319
|
// src/native/tab-bar.tsx
|
|
5205
|
-
import { Pressable as
|
|
5206
|
-
import { jsx as
|
|
5320
|
+
import { Pressable as Pressable26, StyleSheet as StyleSheet48, Text as Text19, View as View52 } from "react-native";
|
|
5321
|
+
import { jsx as jsx60, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5207
5322
|
function TabBar({ items: items2, value, onValueChange, onReselect, "aria-label": label, style }) {
|
|
5208
5323
|
const { theme, insets, haptic } = useTheme();
|
|
5209
|
-
return /* @__PURE__ */
|
|
5324
|
+
return /* @__PURE__ */ jsx60(View52, { role: "tablist", "aria-label": label, style: [styles48.bar, { backgroundColor: theme.glassBg, borderTopColor: theme.glassBorder, paddingBottom: Math.max(6, insets.bottom) }, style], children: items2.map((item) => {
|
|
5210
5325
|
const selected = item.value === value;
|
|
5211
5326
|
const color = selected ? theme.accentText : theme.textSecondary;
|
|
5212
5327
|
const badge = item.badge === true ? "" : typeof item.badge === "number" && item.badge > 0 ? item.badge > 99 ? "99+" : String(item.badge) : null;
|
|
5213
|
-
return /* @__PURE__ */
|
|
5214
|
-
|
|
5328
|
+
return /* @__PURE__ */ jsxs51(
|
|
5329
|
+
Pressable26,
|
|
5215
5330
|
{
|
|
5216
5331
|
role: "tab",
|
|
5217
5332
|
"aria-selected": selected,
|
|
@@ -5220,22 +5335,22 @@ function TabBar({ items: items2, value, onValueChange, onReselect, "aria-label":
|
|
|
5220
5335
|
if (selected) onReselect?.(item.value);
|
|
5221
5336
|
else onValueChange(item.value);
|
|
5222
5337
|
},
|
|
5223
|
-
style: ({ pressed }) => [
|
|
5338
|
+
style: ({ pressed }) => [styles48.item, { opacity: pressed ? 0.7 : 1 }],
|
|
5224
5339
|
children: [
|
|
5225
|
-
/* @__PURE__ */
|
|
5340
|
+
/* @__PURE__ */ jsxs51(View52, { "aria-hidden": true, style: styles48.icon, children: [
|
|
5226
5341
|
item.icon(selected, color),
|
|
5227
|
-
badge !== null ? /* @__PURE__ */
|
|
5342
|
+
badge !== null ? /* @__PURE__ */ jsx60(View52, { style: [badge ? styles48.count : styles48.dot, { backgroundColor: theme.danger, borderColor: theme.surface1 }], children: badge ? /* @__PURE__ */ jsx60(Text19, { style: [styles48.countText, { color: theme.onAccent }], children: badge }) : null }) : null
|
|
5228
5343
|
] }),
|
|
5229
|
-
/* @__PURE__ */
|
|
5230
|
-
badge !== null && item.badgeLabel ? /* @__PURE__ */
|
|
5344
|
+
/* @__PURE__ */ jsx60(Text19, { numberOfLines: 1, style: [styles48.label, { color, fontWeight: selected ? "700" : "500" }], children: item.label }),
|
|
5345
|
+
badge !== null && item.badgeLabel ? /* @__PURE__ */ jsx60(Text19, { style: styles48.unseen, children: `, ${item.badgeLabel}` }) : null
|
|
5231
5346
|
]
|
|
5232
5347
|
},
|
|
5233
5348
|
item.value
|
|
5234
5349
|
);
|
|
5235
5350
|
}) });
|
|
5236
5351
|
}
|
|
5237
|
-
var
|
|
5238
|
-
bar: { flexDirection: "row", borderTopWidth:
|
|
5352
|
+
var styles48 = StyleSheet48.create({
|
|
5353
|
+
bar: { flexDirection: "row", borderTopWidth: StyleSheet48.hairlineWidth, paddingTop: 6 },
|
|
5239
5354
|
item: { flex: 1, alignItems: "center", gap: 2, minHeight: 48, justifyContent: "center" },
|
|
5240
5355
|
icon: { width: 28, height: 26, alignItems: "center", justifyContent: "center" },
|
|
5241
5356
|
label: { fontSize: 11, lineHeight: 14 },
|
|
@@ -5246,12 +5361,12 @@ var styles47 = StyleSheet47.create({
|
|
|
5246
5361
|
});
|
|
5247
5362
|
|
|
5248
5363
|
// src/native/tabs.tsx
|
|
5249
|
-
import * as
|
|
5250
|
-
import { Pressable as
|
|
5251
|
-
import { jsx as
|
|
5364
|
+
import * as React43 from "react";
|
|
5365
|
+
import { Pressable as Pressable27, ScrollView as ScrollView7, StyleSheet as StyleSheet49, View as View53 } from "react-native";
|
|
5366
|
+
import { jsx as jsx61, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5252
5367
|
function Tabs({ items: items2, value, defaultValue, onValueChange, "aria-label": label, variant = "underline", style }) {
|
|
5253
5368
|
const { theme, radius: radius3, haptic } = useTheme();
|
|
5254
|
-
const [own, setOwn] =
|
|
5369
|
+
const [own, setOwn] = React43.useState(defaultValue ?? items2[0]?.value);
|
|
5255
5370
|
const current = value ?? own;
|
|
5256
5371
|
const select = (next) => {
|
|
5257
5372
|
if (next === current) return;
|
|
@@ -5262,8 +5377,8 @@ function Tabs({ items: items2, value, defaultValue, onValueChange, "aria-label":
|
|
|
5262
5377
|
const segmented = variant === "segmented";
|
|
5263
5378
|
const tabs = items2.map((item) => {
|
|
5264
5379
|
const selected = item.value === current;
|
|
5265
|
-
return /* @__PURE__ */
|
|
5266
|
-
|
|
5380
|
+
return /* @__PURE__ */ jsx61(
|
|
5381
|
+
Pressable27,
|
|
5267
5382
|
{
|
|
5268
5383
|
role: "tab",
|
|
5269
5384
|
"aria-selected": selected,
|
|
@@ -5271,45 +5386,45 @@ function Tabs({ items: items2, value, defaultValue, onValueChange, "aria-label":
|
|
|
5271
5386
|
disabled: item.disabled,
|
|
5272
5387
|
onPress: () => select(item.value),
|
|
5273
5388
|
style: [
|
|
5274
|
-
segmented ?
|
|
5389
|
+
segmented ? styles49.segment : styles49.tab,
|
|
5275
5390
|
segmented && selected ? { backgroundColor: theme.surface0, borderColor: theme.borderDefault, borderRadius: radius3.sm } : null,
|
|
5276
5391
|
!segmented ? { borderBottomColor: selected ? theme.accent : "transparent" } : null,
|
|
5277
|
-
item.disabled ?
|
|
5392
|
+
item.disabled ? styles49.disabled : null
|
|
5278
5393
|
],
|
|
5279
|
-
children: /* @__PURE__ */
|
|
5394
|
+
children: /* @__PURE__ */ jsxs52(Txt, { variant: "label", tone: selected ? "text" : "secondary", numberOfLines: 1, children: [
|
|
5280
5395
|
item.label,
|
|
5281
|
-
item.count !== void 0 ? /* @__PURE__ */
|
|
5396
|
+
item.count !== void 0 ? /* @__PURE__ */ jsx61(Txt, { variant: "caption", tone: "secondary", children: ` ${item.count}` }) : null
|
|
5282
5397
|
] })
|
|
5283
5398
|
},
|
|
5284
5399
|
item.value
|
|
5285
5400
|
);
|
|
5286
5401
|
});
|
|
5287
5402
|
const panel = items2.find((i) => i.value === current)?.content;
|
|
5288
|
-
return /* @__PURE__ */
|
|
5289
|
-
segmented ? /* @__PURE__ */
|
|
5290
|
-
panel !== void 0 ? /* @__PURE__ */
|
|
5403
|
+
return /* @__PURE__ */ jsxs52(View53, { style: [styles49.root, style], children: [
|
|
5404
|
+
segmented ? /* @__PURE__ */ jsx61(View53, { role: "tablist", "aria-label": label, style: [styles49.track, { backgroundColor: theme.surface2, borderColor: theme.borderSubtle, borderRadius: radius3.md }], children: tabs }) : /* @__PURE__ */ jsx61(View53, { style: [styles49.underline, { borderBottomColor: theme.borderSubtle }], children: /* @__PURE__ */ jsx61(ScrollView7, { horizontal: true, showsHorizontalScrollIndicator: false, role: "tablist", "aria-label": label, contentContainerStyle: styles49.scroll, children: tabs }) }),
|
|
5405
|
+
panel !== void 0 ? /* @__PURE__ */ jsx61(View53, { role: "tabpanel", children: panel }) : null
|
|
5291
5406
|
] });
|
|
5292
5407
|
}
|
|
5293
|
-
var
|
|
5408
|
+
var styles49 = StyleSheet49.create({
|
|
5294
5409
|
root: { gap: 12 },
|
|
5295
|
-
underline: { borderBottomWidth:
|
|
5410
|
+
underline: { borderBottomWidth: StyleSheet49.hairlineWidth },
|
|
5296
5411
|
scroll: { gap: 4, paddingHorizontal: 4 },
|
|
5297
5412
|
tab: { minHeight: 44, justifyContent: "center", paddingHorizontal: 12, borderBottomWidth: 2 },
|
|
5298
|
-
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth:
|
|
5299
|
-
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth:
|
|
5413
|
+
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth: StyleSheet49.hairlineWidth, height: 40 },
|
|
5414
|
+
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth: StyleSheet49.hairlineWidth, borderColor: "transparent" },
|
|
5300
5415
|
disabled: { opacity: 0.4 }
|
|
5301
5416
|
});
|
|
5302
5417
|
|
|
5303
5418
|
// src/native/tag-selector.tsx
|
|
5304
|
-
import { StyleSheet as
|
|
5305
|
-
import { jsx as
|
|
5419
|
+
import { StyleSheet as StyleSheet50, View as View54 } from "react-native";
|
|
5420
|
+
import { jsx as jsx62, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
5306
5421
|
function TagSelector({ label, options, value, onValueChange, max, countLabel, style }) {
|
|
5307
5422
|
const { haptic } = useTheme();
|
|
5308
5423
|
const full = max !== void 0 && value.length >= max;
|
|
5309
|
-
return /* @__PURE__ */
|
|
5310
|
-
/* @__PURE__ */
|
|
5424
|
+
return /* @__PURE__ */ jsxs53(View54, { style: [styles50.root, style], children: [
|
|
5425
|
+
/* @__PURE__ */ jsx62(View54, { role: "group", "aria-label": label, style: styles50.wrap, children: options.map((option) => {
|
|
5311
5426
|
const on = value.includes(option.value);
|
|
5312
|
-
return /* @__PURE__ */
|
|
5427
|
+
return /* @__PURE__ */ jsx62(
|
|
5313
5428
|
Chip,
|
|
5314
5429
|
{
|
|
5315
5430
|
selected: on,
|
|
@@ -5323,15 +5438,15 @@ function TagSelector({ label, options, value, onValueChange, max, countLabel, st
|
|
|
5323
5438
|
option.value
|
|
5324
5439
|
);
|
|
5325
5440
|
}) }),
|
|
5326
|
-
max !== void 0 && countLabel ? /* @__PURE__ */
|
|
5441
|
+
max !== void 0 && countLabel ? /* @__PURE__ */ jsx62(Txt, { variant: "caption", tone: full ? "accent" : "secondary", "aria-live": "polite", children: countLabel(value.length, max) }) : null
|
|
5327
5442
|
] });
|
|
5328
5443
|
}
|
|
5329
|
-
var
|
|
5444
|
+
var styles50 = StyleSheet50.create({ root: { gap: 8 }, wrap: { flexDirection: "row", flexWrap: "wrap", gap: 8 } });
|
|
5330
5445
|
|
|
5331
5446
|
// src/native/toast.tsx
|
|
5332
|
-
import * as
|
|
5333
|
-
import { AccessibilityInfo as AccessibilityInfo15, Animated as
|
|
5334
|
-
import { Fragment as Fragment9, jsx as
|
|
5447
|
+
import * as React44 from "react";
|
|
5448
|
+
import { AccessibilityInfo as AccessibilityInfo15, Animated as Animated27, PanResponder as PanResponder5, Pressable as Pressable28, StyleSheet as StyleSheet51, Text as Text20, View as View55 } from "react-native";
|
|
5449
|
+
import { Fragment as Fragment9, jsx as jsx63, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
5335
5450
|
var items = [];
|
|
5336
5451
|
var listeners2 = /* @__PURE__ */ new Set();
|
|
5337
5452
|
var counter = 0;
|
|
@@ -5366,93 +5481,93 @@ var toast = Object.assign(show, {
|
|
|
5366
5481
|
function ToastView({ item, closeLabel, duration }) {
|
|
5367
5482
|
const { theme, radius: radius3, haptic } = useTheme();
|
|
5368
5483
|
const reduce = useReducedMotion();
|
|
5369
|
-
const [swipe] =
|
|
5370
|
-
const drag =
|
|
5484
|
+
const [swipe] = React44.useState(() => new Animated27.Value(0));
|
|
5485
|
+
const drag = React44.useMemo(
|
|
5371
5486
|
() => PanResponder5.create({
|
|
5372
5487
|
onMoveShouldSetPanResponder: (_, g) => Math.abs(g.dx) > 8 && Math.abs(g.dx) > Math.abs(g.dy),
|
|
5373
5488
|
onPanResponderMove: (_, g) => swipe.setValue(g.dx),
|
|
5374
5489
|
onPanResponderRelease: (_, g) => {
|
|
5375
5490
|
if (Math.abs(g.dx) > 96 || Math.abs(g.vx) > 0.9) {
|
|
5376
|
-
|
|
5377
|
-
} else
|
|
5491
|
+
Animated27.timing(swipe, { toValue: Math.sign(g.dx) * 480, duration: 160, useNativeDriver: true }).start(() => dismiss(item.id));
|
|
5492
|
+
} else Animated27.spring(swipe, { toValue: 0, useNativeDriver: true }).start();
|
|
5378
5493
|
}
|
|
5379
5494
|
}),
|
|
5380
5495
|
[swipe, item.id]
|
|
5381
5496
|
);
|
|
5382
|
-
|
|
5497
|
+
React44.useEffect(() => {
|
|
5383
5498
|
if (item.tone === "success" || item.tone === "warning") haptic(item.tone);
|
|
5384
5499
|
if (item.tone === "error") haptic("warning");
|
|
5385
5500
|
}, [item.id]);
|
|
5386
|
-
const [enter] =
|
|
5387
|
-
|
|
5501
|
+
const [enter] = React44.useState(() => new Animated27.Value(reduce ? 1 : 0));
|
|
5502
|
+
React44.useEffect(() => {
|
|
5388
5503
|
if (reduce) enter.setValue(1);
|
|
5389
|
-
else
|
|
5504
|
+
else Animated27.timing(enter, { toValue: 1, duration: 220, useNativeDriver: true }).start();
|
|
5390
5505
|
}, [enter, reduce]);
|
|
5391
|
-
|
|
5506
|
+
React44.useEffect(() => {
|
|
5392
5507
|
AccessibilityInfo15.announceForAccessibility(item.description ? `${item.title}. ${item.description}` : item.title);
|
|
5393
5508
|
}, [item.title, item.description]);
|
|
5394
5509
|
const ms = item.duration ?? duration;
|
|
5395
|
-
|
|
5510
|
+
React44.useEffect(() => {
|
|
5396
5511
|
if (!Number.isFinite(ms)) return;
|
|
5397
5512
|
const timer2 = setTimeout(() => dismiss(item.id), ms);
|
|
5398
5513
|
return () => clearTimeout(timer2);
|
|
5399
5514
|
}, [item.id, ms]);
|
|
5400
5515
|
const edge = { success: theme.success, warning: theme.warning, error: theme.danger, info: theme.info, default: theme.borderDefault }[item.tone ?? "default"];
|
|
5401
|
-
const text = /* @__PURE__ */
|
|
5402
|
-
item.icon ? /* @__PURE__ */
|
|
5403
|
-
/* @__PURE__ */
|
|
5404
|
-
/* @__PURE__ */
|
|
5405
|
-
item.description ? /* @__PURE__ */
|
|
5516
|
+
const text = /* @__PURE__ */ jsxs54(Fragment9, { children: [
|
|
5517
|
+
item.icon ? /* @__PURE__ */ jsx63(View55, { "aria-hidden": true, children: item.icon }) : null,
|
|
5518
|
+
/* @__PURE__ */ jsxs54(View55, { style: styles51.content, children: [
|
|
5519
|
+
/* @__PURE__ */ jsx63(Txt, { variant: "label", numberOfLines: 2, children: item.title }),
|
|
5520
|
+
item.description ? /* @__PURE__ */ jsx63(Txt, { variant: "caption", tone: "secondary", numberOfLines: 3, children: item.description }) : null
|
|
5406
5521
|
] })
|
|
5407
5522
|
] });
|
|
5408
|
-
const body = /* @__PURE__ */
|
|
5409
|
-
item.onPress ? /* @__PURE__ */
|
|
5410
|
-
|
|
5523
|
+
const body = /* @__PURE__ */ jsxs54(Fragment9, { children: [
|
|
5524
|
+
item.onPress ? /* @__PURE__ */ jsx63(
|
|
5525
|
+
Pressable28,
|
|
5411
5526
|
{
|
|
5412
5527
|
role: "button",
|
|
5413
5528
|
onPress: () => {
|
|
5414
5529
|
item.onPress?.();
|
|
5415
5530
|
dismiss(item.id);
|
|
5416
5531
|
},
|
|
5417
|
-
style: ({ pressed }) => [
|
|
5532
|
+
style: ({ pressed }) => [styles51.main, { opacity: pressed ? 0.8 : 1 }],
|
|
5418
5533
|
children: text
|
|
5419
5534
|
}
|
|
5420
|
-
) : /* @__PURE__ */
|
|
5421
|
-
item.action ? /* @__PURE__ */
|
|
5422
|
-
|
|
5535
|
+
) : /* @__PURE__ */ jsx63(View55, { style: styles51.main, children: text }),
|
|
5536
|
+
item.action ? /* @__PURE__ */ jsx63(
|
|
5537
|
+
Pressable28,
|
|
5423
5538
|
{
|
|
5424
5539
|
role: "button",
|
|
5425
5540
|
onPress: () => {
|
|
5426
5541
|
item.action?.onPress();
|
|
5427
5542
|
dismiss(item.id);
|
|
5428
5543
|
},
|
|
5429
|
-
style: [
|
|
5430
|
-
children: /* @__PURE__ */
|
|
5544
|
+
style: [styles51.action, { backgroundColor: theme.accent, borderRadius: radius3.sm }],
|
|
5545
|
+
children: /* @__PURE__ */ jsx63(Text20, { style: [styles51.actionLabel, { color: theme.onAccent }], children: item.action.label })
|
|
5431
5546
|
}
|
|
5432
5547
|
) : null,
|
|
5433
|
-
/* @__PURE__ */
|
|
5548
|
+
/* @__PURE__ */ jsx63(Pressable28, { role: "button", "aria-label": closeLabel, hitSlop: 10, onPress: () => dismiss(item.id), style: styles51.close, children: /* @__PURE__ */ jsx63(Text20, { style: [styles51.cross, { color: theme.textSecondary }], children: "\xD7" }) })
|
|
5434
5549
|
] });
|
|
5435
5550
|
const frame = [
|
|
5436
|
-
|
|
5551
|
+
styles51.toast,
|
|
5437
5552
|
{ backgroundColor: theme.surface2, borderColor: theme.borderDefault, borderLeftColor: edge, borderRadius: radius3.lg, shadowColor: theme.scrimStrong }
|
|
5438
5553
|
];
|
|
5439
5554
|
const motion3 = { transform: [{ translateY: enter.interpolate({ inputRange: [0, 1], outputRange: [-8, 0] }) }, { translateX: swipe }] };
|
|
5440
|
-
return /* @__PURE__ */
|
|
5555
|
+
return /* @__PURE__ */ jsx63(Animated27.View, { "aria-live": "polite", style: motion3, ...drag.panHandlers, children: /* @__PURE__ */ jsx63(View55, { style: frame, children: body }) });
|
|
5441
5556
|
}
|
|
5442
5557
|
function Toaster({ closeLabel, position = "top", offset = 12, duration = 6e3, max = 3 }) {
|
|
5443
|
-
const all =
|
|
5558
|
+
const all = React44.useSyncExternalStore(subscribe2, snapshot, snapshot);
|
|
5444
5559
|
const shown = all.slice(-max);
|
|
5445
5560
|
if (shown.length === 0) return null;
|
|
5446
|
-
return /* @__PURE__ */
|
|
5561
|
+
return /* @__PURE__ */ jsx63(View55, { pointerEvents: "box-none", style: [styles51.stack, position === "top" ? { top: offset } : { bottom: offset }], children: (position === "top" ? shown : [...shown].reverse()).map((item) => /* @__PURE__ */ jsx63(ToastView, { item, closeLabel, duration }, item.id)) });
|
|
5447
5562
|
}
|
|
5448
|
-
var
|
|
5563
|
+
var styles51 = StyleSheet51.create({
|
|
5449
5564
|
stack: { position: "absolute", left: 12, right: 12, gap: 8, zIndex: 100 },
|
|
5450
5565
|
toast: {
|
|
5451
5566
|
flexDirection: "row",
|
|
5452
5567
|
alignItems: "center",
|
|
5453
5568
|
gap: 10,
|
|
5454
5569
|
padding: 12,
|
|
5455
|
-
borderWidth:
|
|
5570
|
+
borderWidth: StyleSheet51.hairlineWidth,
|
|
5456
5571
|
borderLeftWidth: 4,
|
|
5457
5572
|
shadowOpacity: 0.3,
|
|
5458
5573
|
shadowRadius: 16,
|
|
@@ -5468,15 +5583,15 @@ var styles50 = StyleSheet50.create({
|
|
|
5468
5583
|
});
|
|
5469
5584
|
|
|
5470
5585
|
// src/native/verified-badge.tsx
|
|
5471
|
-
import { StyleSheet as
|
|
5472
|
-
import
|
|
5473
|
-
import { jsx as
|
|
5586
|
+
import { StyleSheet as StyleSheet52, View as View56 } from "react-native";
|
|
5587
|
+
import Svg28, { Path as Path23 } from "react-native-svg";
|
|
5588
|
+
import { jsx as jsx64, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
5474
5589
|
function VerifiedBadge({ label, showLabel, size = 16, on = "surface" }) {
|
|
5475
5590
|
const { theme } = useTheme();
|
|
5476
|
-
return /* @__PURE__ */
|
|
5477
|
-
/* @__PURE__ */
|
|
5478
|
-
/* @__PURE__ */
|
|
5479
|
-
|
|
5591
|
+
return /* @__PURE__ */ jsxs55(View56, { accessible: true, role: "img", "aria-label": label, style: styles52.row, children: [
|
|
5592
|
+
/* @__PURE__ */ jsxs55(Svg28, { width: size, height: size, viewBox: "0 0 24 24", "aria-hidden": true, children: [
|
|
5593
|
+
/* @__PURE__ */ jsx64(
|
|
5594
|
+
Path23,
|
|
5480
5595
|
{
|
|
5481
5596
|
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",
|
|
5482
5597
|
fill: theme.accent,
|
|
@@ -5484,12 +5599,12 @@ function VerifiedBadge({ label, showLabel, size = 16, on = "surface" }) {
|
|
|
5484
5599
|
strokeWidth: 1.2
|
|
5485
5600
|
}
|
|
5486
5601
|
),
|
|
5487
|
-
/* @__PURE__ */
|
|
5602
|
+
/* @__PURE__ */ jsx64(Path23, { d: "M8.3 12.3l2.5 2.5 4.9-5.2", fill: "none", stroke: theme.onAccent, strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round" })
|
|
5488
5603
|
] }),
|
|
5489
|
-
showLabel ? /* @__PURE__ */
|
|
5604
|
+
showLabel ? /* @__PURE__ */ jsx64(Txt, { variant: "caption", tone: on === "media" ? "onMedia" : "accent", style: styles52.text, children: label }) : null
|
|
5490
5605
|
] });
|
|
5491
5606
|
}
|
|
5492
|
-
var
|
|
5607
|
+
var styles52 = StyleSheet52.create({ row: { flexDirection: "row", alignItems: "center", gap: 4 }, text: { fontWeight: "700" } });
|
|
5493
5608
|
export {
|
|
5494
5609
|
ActionSheet,
|
|
5495
5610
|
ActivityFeed,
|
|
@@ -5556,6 +5671,7 @@ export {
|
|
|
5556
5671
|
Segmented,
|
|
5557
5672
|
Select,
|
|
5558
5673
|
Sheet,
|
|
5674
|
+
Showcase,
|
|
5559
5675
|
Skeleton,
|
|
5560
5676
|
Slider,
|
|
5561
5677
|
Spinner,
|
|
@@ -5598,6 +5714,7 @@ export {
|
|
|
5598
5714
|
latestBirthDate,
|
|
5599
5715
|
monthNames,
|
|
5600
5716
|
prefetchNeighbours,
|
|
5717
|
+
showcaseLabels,
|
|
5601
5718
|
splitDuration,
|
|
5602
5719
|
textStyles,
|
|
5603
5720
|
timeSlots,
|