@krizaka/ui 3.2.0 → 3.3.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/dist/{chunk-I5RVM5CW.js → chunk-2FRWNSRO.js} +2 -6
- package/dist/chunk-2FRWNSRO.js.map +1 -0
- package/dist/chunk-BTMFZ66D.js +135 -0
- package/dist/chunk-BTMFZ66D.js.map +1 -0
- package/dist/chunk-C2BRIFJG.js +13 -0
- package/dist/chunk-C2BRIFJG.js.map +1 -0
- package/dist/chunk-KDXRYUD3.js +39 -0
- package/dist/chunk-KDXRYUD3.js.map +1 -0
- package/dist/{chunk-2PUDI7JS.js → chunk-ZKVQGXLD.js} +5 -3
- package/dist/{chunk-2PUDI7JS.js.map → chunk-ZKVQGXLD.js.map} +1 -1
- package/dist/command.js +1 -1
- package/dist/confirm-button.js +1 -1
- package/dist/data-table.js +3 -2
- package/dist/data-table.js.map +1 -1
- package/dist/date-picker.d.ts +3 -1
- package/dist/date-picker.js +13 -13
- package/dist/date-picker.js.map +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/filter-bar.js +3 -2
- package/dist/form.d.ts +23 -12
- package/dist/form.js +11 -47
- package/dist/form.js.map +1 -1
- package/dist/glow-card.js +1 -1
- package/dist/image-cropper.js +3 -1
- package/dist/image-cropper.js.map +1 -1
- package/dist/marquee.js +1 -1
- package/dist/native/form.d.ts +60 -15
- package/dist/native/form.js +103 -42
- package/dist/native/form.js.map +1 -1
- package/dist/native.d.ts +206 -2
- package/dist/native.js +1172 -541
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/radio-group.d.ts +66 -32
- package/dist/radio-group.js +54 -10
- package/dist/radio-group.js.map +1 -1
- package/dist/slider.d.ts +96 -35
- package/dist/slider.js +67 -13
- package/dist/slider.js.map +1 -1
- package/dist/terminal-replay.js +34 -60
- package/dist/terminal-replay.js.map +1 -1
- package/dist/toast.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/video-player.js +3 -1
- package/dist/video-player.js.map +1 -1
- package/package.json +6 -6
- package/registry/combobox.json +225 -3
- package/registry/date-picker.json +16 -2
- package/registry/dialog.json +74 -3
- package/registry/examples/combobox/native/multiple.d.ts +4 -0
- package/registry/examples/combobox/native/multiple.dark.png +0 -0
- package/registry/examples/combobox/native/multiple.js +15 -0
- package/registry/examples/combobox/native/multiple.light.png +0 -0
- package/registry/examples/combobox/native/multiple.tsx +15 -0
- package/registry/examples/combobox/native/search.d.ts +4 -0
- package/registry/examples/combobox/native/search.dark.png +0 -0
- package/registry/examples/combobox/native/search.js +15 -0
- package/registry/examples/combobox/native/search.light.png +0 -0
- package/registry/examples/combobox/native/search.tsx +15 -0
- package/registry/examples/dialog/native/sheet.d.ts +4 -0
- package/registry/examples/dialog/native/sheet.dark.png +0 -0
- package/registry/examples/dialog/native/sheet.js +21 -0
- package/registry/examples/dialog/native/sheet.light.png +0 -0
- package/registry/examples/dialog/native/sheet.tsx +18 -0
- package/registry/examples/field/native/select.d.ts +4 -0
- package/registry/examples/field/native/select.dark.png +0 -0
- package/registry/examples/field/native/select.js +29 -0
- package/registry/examples/field/native/select.light.png +0 -0
- package/registry/examples/field/native/select.tsx +25 -0
- package/registry/examples/form/native/audience.dark.png +0 -0
- package/registry/examples/form/native/audience.light.png +0 -0
- package/registry/examples/form/native/profile.dark.png +0 -0
- package/registry/examples/form/native/profile.light.png +0 -0
- package/registry/examples/form/native/settings.dark.png +0 -0
- package/registry/examples/form/native/settings.light.png +0 -0
- package/registry/examples/form/native/sign-up.dark.png +0 -0
- package/registry/examples/form/native/sign-up.light.png +0 -0
- package/registry/examples/form/native/upload.dark.png +0 -0
- package/registry/examples/form/native/upload.light.png +0 -0
- package/registry/examples/radio-group/buttons.d.ts +4 -0
- package/registry/examples/radio-group/buttons.js +17 -0
- package/registry/examples/radio-group/buttons.tsx +21 -0
- package/registry/examples/radio-group/cards.js +1 -1
- package/registry/examples/radio-group/cards.tsx +2 -2
- package/registry/examples/radio-group/native/buttons.d.ts +4 -0
- package/registry/examples/radio-group/native/buttons.dark.png +0 -0
- package/registry/examples/radio-group/native/buttons.js +25 -0
- package/registry/examples/radio-group/native/buttons.light.png +0 -0
- package/registry/examples/radio-group/native/buttons.tsx +21 -0
- package/registry/examples/radio-group/native/cards.d.ts +4 -0
- package/registry/examples/radio-group/native/cards.dark.png +0 -0
- package/registry/examples/radio-group/native/cards.js +23 -0
- package/registry/examples/radio-group/native/cards.light.png +0 -0
- package/registry/examples/radio-group/native/cards.tsx +19 -0
- package/registry/examples/radio-group/native/list.d.ts +4 -0
- package/registry/examples/radio-group/native/list.dark.png +0 -0
- package/registry/examples/radio-group/native/list.js +24 -0
- package/registry/examples/radio-group/native/list.light.png +0 -0
- package/registry/examples/radio-group/native/list.tsx +20 -0
- package/registry/examples/radio-group/native/segmented.d.ts +4 -0
- package/registry/examples/radio-group/native/segmented.dark.png +0 -0
- package/registry/examples/radio-group/native/segmented.js +24 -0
- package/registry/examples/radio-group/native/segmented.light.png +0 -0
- package/registry/examples/radio-group/native/segmented.tsx +20 -0
- package/registry/examples/radio-group/segmented.d.ts +4 -0
- package/registry/examples/radio-group/segmented.js +15 -0
- package/registry/examples/radio-group/segmented.tsx +12 -0
- package/registry/examples/slider/floating.d.ts +4 -0
- package/registry/examples/slider/floating.js +11 -0
- package/registry/examples/slider/floating.tsx +12 -0
- package/registry/examples/slider/native/default.d.ts +4 -0
- package/registry/examples/slider/native/default.dark.png +0 -0
- package/registry/examples/slider/native/default.js +14 -0
- package/registry/examples/slider/native/default.light.png +0 -0
- package/registry/examples/slider/native/default.tsx +13 -0
- package/registry/examples/slider/native/range.d.ts +4 -0
- package/registry/examples/slider/native/range.dark.png +0 -0
- package/registry/examples/slider/native/range.js +12 -0
- package/registry/examples/slider/native/range.light.png +0 -0
- package/registry/examples/slider/native/range.tsx +11 -0
- package/registry/examples/slider/native/stepped.d.ts +4 -0
- package/registry/examples/slider/native/stepped.dark.png +0 -0
- package/registry/examples/slider/native/stepped.js +28 -0
- package/registry/examples/slider/native/stepped.light.png +0 -0
- package/registry/examples/slider/native/stepped.tsx +24 -0
- package/registry/examples/slider/native/vertical.d.ts +4 -0
- package/registry/examples/slider/native/vertical.dark.png +0 -0
- package/registry/examples/slider/native/vertical.js +16 -0
- package/registry/examples/slider/native/vertical.light.png +0 -0
- package/registry/examples/slider/native/vertical.tsx +13 -0
- package/registry/examples/slider/price-range.d.ts +4 -0
- package/registry/examples/slider/price-range.js +29 -0
- package/registry/examples/slider/price-range.tsx +27 -0
- package/registry/examples/slider/stepped.d.ts +4 -0
- package/registry/examples/slider/stepped.js +28 -0
- package/registry/examples/slider/stepped.tsx +24 -0
- package/registry/examples/slider/vertical.d.ts +4 -0
- package/registry/examples/slider/vertical.js +15 -0
- package/registry/examples/slider/vertical.tsx +14 -0
- package/registry/examples/switch/native/default.d.ts +4 -0
- package/registry/examples/switch/native/default.dark.png +0 -0
- package/registry/examples/switch/native/default.js +16 -0
- package/registry/examples/switch/native/default.light.png +0 -0
- package/registry/examples/switch/native/default.tsx +13 -0
- package/registry/examples/switch/native/settings.d.ts +4 -0
- package/registry/examples/switch/native/settings.dark.png +0 -0
- package/registry/examples/switch/native/settings.js +20 -0
- package/registry/examples/switch/native/settings.light.png +0 -0
- package/registry/examples/switch/native/settings.tsx +17 -0
- package/registry/field.json +15 -3
- package/registry/form.json +250 -42
- package/registry/index.json +24 -20
- package/registry/radio-group.json +227 -15
- package/registry/slider.json +314 -13
- package/registry/switch.json +115 -3
- package/registry/tabs.json +2 -2
- package/skills/choice-controls/SKILL.md +39 -0
- package/skills/form/SKILL.md +3 -0
- package/dist/chunk-I5RVM5CW.js.map +0 -1
- package/dist/chunk-RUPRYJ45.js +0 -82
- package/dist/chunk-RUPRYJ45.js.map +0 -1
package/dist/native.js
CHANGED
|
@@ -839,10 +839,239 @@ var styles7 = StyleSheet7.create({
|
|
|
839
839
|
wrap: { flexWrap: "wrap" }
|
|
840
840
|
});
|
|
841
841
|
|
|
842
|
-
// src/native/
|
|
842
|
+
// src/native/combobox.tsx
|
|
843
|
+
import * as React8 from "react";
|
|
844
|
+
import { Pressable as Pressable6, ScrollView as ScrollView2, StyleSheet as StyleSheet9, Text as Text7, TextInput, View as View7 } from "react-native";
|
|
845
|
+
import Svg3, { Path as Path2 } from "react-native-svg";
|
|
846
|
+
|
|
847
|
+
// src/native/dialog.tsx
|
|
843
848
|
import * as React7 from "react";
|
|
844
|
-
import { Animated as Animated2, StyleSheet as StyleSheet8, Text as Text6 } from "react-native";
|
|
849
|
+
import { Animated as Animated2, Modal, Pressable as Pressable5, StyleSheet as StyleSheet8, Text as Text6, View as View6 } from "react-native";
|
|
845
850
|
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
851
|
+
function Sheet({ open, onOpenChange, title, closeLabel = "Close", children, style }) {
|
|
852
|
+
const { theme, radius: radius3, motion: motion3 } = useTheme();
|
|
853
|
+
const [rise] = React7.useState(() => new Animated2.Value(0));
|
|
854
|
+
React7.useEffect(() => {
|
|
855
|
+
if (open) Animated2.timing(rise, { toValue: 1, duration: motion3.duration.base * 1.6, useNativeDriver: true }).start();
|
|
856
|
+
else rise.setValue(0);
|
|
857
|
+
}, [open, rise, motion3.duration.base]);
|
|
858
|
+
return /* @__PURE__ */ jsx9(Modal, { transparent: true, visible: open, animationType: "none", onRequestClose: () => onOpenChange(false), statusBarTranslucent: true, children: /* @__PURE__ */ jsxs6(View6, { style: styles8.backdrop, children: [
|
|
859
|
+
/* @__PURE__ */ jsx9(Animated2.View, { style: [StyleSheet8.absoluteFill, { opacity: rise }], children: /* @__PURE__ */ jsx9(Pressable5, { role: "button", "aria-label": closeLabel, onPress: () => onOpenChange(false), style: [StyleSheet8.absoluteFill, { backgroundColor: theme.scrim }] }) }),
|
|
860
|
+
/* @__PURE__ */ jsxs6(
|
|
861
|
+
Animated2.View,
|
|
862
|
+
{
|
|
863
|
+
role: "dialog",
|
|
864
|
+
"aria-label": title,
|
|
865
|
+
style: [
|
|
866
|
+
styles8.sheet,
|
|
867
|
+
{
|
|
868
|
+
backgroundColor: theme.surface1,
|
|
869
|
+
borderColor: theme.borderDefault,
|
|
870
|
+
borderTopLeftRadius: radius3["2xl"],
|
|
871
|
+
borderTopRightRadius: radius3["2xl"],
|
|
872
|
+
shadowColor: theme.scrimStrong,
|
|
873
|
+
transform: [{ translateY: rise.interpolate({ inputRange: [0, 1], outputRange: [48, 0] }) }],
|
|
874
|
+
opacity: rise.interpolate({ inputRange: [0, 1], outputRange: [0.6, 1] })
|
|
875
|
+
},
|
|
876
|
+
style
|
|
877
|
+
],
|
|
878
|
+
children: [
|
|
879
|
+
/* @__PURE__ */ jsx9(View6, { "aria-hidden": true, style: [styles8.grip, { backgroundColor: theme.borderStrong }] }),
|
|
880
|
+
title ? /* @__PURE__ */ jsx9(Text6, { role: "heading", style: [styles8.title, { color: theme.textPrimary }], children: title }) : null,
|
|
881
|
+
children
|
|
882
|
+
]
|
|
883
|
+
}
|
|
884
|
+
)
|
|
885
|
+
] }) });
|
|
886
|
+
}
|
|
887
|
+
var styles8 = StyleSheet8.create({
|
|
888
|
+
backdrop: { flex: 1, justifyContent: "flex-end" },
|
|
889
|
+
sheet: { maxHeight: "85%", paddingHorizontal: 16, paddingTop: 8, paddingBottom: 28, gap: 12, borderWidth: StyleSheet8.hairlineWidth, shadowOpacity: 0.3, shadowRadius: 16, shadowOffset: { width: 0, height: -4 }, elevation: 12 },
|
|
890
|
+
grip: { alignSelf: "center", width: 40, height: 5, borderRadius: 3, marginBottom: 4 },
|
|
891
|
+
title: { fontSize: 17, fontWeight: "700" }
|
|
892
|
+
});
|
|
893
|
+
|
|
894
|
+
// src/native/combobox.tsx
|
|
895
|
+
import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
896
|
+
function Chevron({ color }) {
|
|
897
|
+
return /* @__PURE__ */ jsx10(Svg3, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx10(Path2, { d: "m6 9 6 6 6-6" }) });
|
|
898
|
+
}
|
|
899
|
+
function Tick({ color }) {
|
|
900
|
+
return /* @__PURE__ */ jsx10(Svg3, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2.6, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx10(Path2, { d: "M20 6 9 17l-5-5" }) });
|
|
901
|
+
}
|
|
902
|
+
function Trigger({ shared, text, onPress, open }) {
|
|
903
|
+
const { theme, radius: radius3 } = useTheme();
|
|
904
|
+
const { label, placeholder, hint, error, disabled } = shared;
|
|
905
|
+
const caption = error ?? hint;
|
|
906
|
+
return /* @__PURE__ */ jsxs7(View7, { style: [styles9.field, shared.style], children: [
|
|
907
|
+
/* @__PURE__ */ jsx10(Text7, { style: [styles9.label, { color: theme.textSecondary }], children: label }),
|
|
908
|
+
/* @__PURE__ */ jsxs7(
|
|
909
|
+
Pressable6,
|
|
910
|
+
{
|
|
911
|
+
role: "button",
|
|
912
|
+
"aria-label": `${label}, ${text ?? placeholder ?? ""}`.replace(/, $/, ""),
|
|
913
|
+
"aria-expanded": open,
|
|
914
|
+
"aria-haspopup": "listbox",
|
|
915
|
+
"aria-disabled": disabled || void 0,
|
|
916
|
+
accessibilityHint: caption,
|
|
917
|
+
disabled,
|
|
918
|
+
onPress,
|
|
919
|
+
style: [styles9.trigger, { borderRadius: radius3.md, backgroundColor: theme.surface2, borderColor: error ? theme.danger : open ? theme.accent : theme.borderDefault }, disabled ? styles9.disabled : null],
|
|
920
|
+
children: [
|
|
921
|
+
/* @__PURE__ */ jsx10(Text7, { numberOfLines: 1, style: [styles9.triggerText, { color: text ? theme.textPrimary : theme.textSecondary }], children: text ?? placeholder ?? "" }),
|
|
922
|
+
/* @__PURE__ */ jsx10(Chevron, { color: theme.textSecondary })
|
|
923
|
+
]
|
|
924
|
+
}
|
|
925
|
+
),
|
|
926
|
+
caption ? /* @__PURE__ */ jsx10(Text7, { role: error ? "alert" : void 0, "aria-live": error ? "polite" : void 0, style: [styles9.caption, { color: error ? theme.dangerText : theme.textSecondary }], children: caption }) : null
|
|
927
|
+
] });
|
|
928
|
+
}
|
|
929
|
+
function Options({ options, isChosen, onPick, multiple }) {
|
|
930
|
+
const { theme, radius: radius3, haptic } = useTheme();
|
|
931
|
+
return /* @__PURE__ */ jsx10(ScrollView2, { role: multiple ? "list" : "radiogroup", keyboardShouldPersistTaps: "handled", style: styles9.options, children: options.map((o) => {
|
|
932
|
+
const chosen = isChosen(o.value);
|
|
933
|
+
return /* @__PURE__ */ jsxs7(
|
|
934
|
+
Pressable6,
|
|
935
|
+
{
|
|
936
|
+
role: multiple ? "checkbox" : "radio",
|
|
937
|
+
"aria-checked": chosen,
|
|
938
|
+
"aria-label": o.description ? `${o.label}, ${o.description}` : o.label,
|
|
939
|
+
"aria-disabled": o.disabled || void 0,
|
|
940
|
+
disabled: o.disabled,
|
|
941
|
+
onPress: () => {
|
|
942
|
+
haptic("selection");
|
|
943
|
+
onPick(o);
|
|
944
|
+
},
|
|
945
|
+
style: ({ pressed }) => [styles9.option, { borderRadius: radius3.md, backgroundColor: chosen ? theme.accentSoft : pressed ? theme.surface3 : "transparent" }, o.disabled ? styles9.disabled : null],
|
|
946
|
+
children: [
|
|
947
|
+
/* @__PURE__ */ jsxs7(View7, { style: styles9.optionText, children: [
|
|
948
|
+
/* @__PURE__ */ jsx10(Text7, { style: [styles9.optionLabel, { color: theme.textPrimary, fontWeight: chosen ? "700" : "500" }], children: o.label }),
|
|
949
|
+
o.description ? /* @__PURE__ */ jsx10(Text7, { style: [styles9.caption, { color: theme.textSecondary }], children: o.description }) : null
|
|
950
|
+
] }),
|
|
951
|
+
chosen ? /* @__PURE__ */ jsx10(Tick, { color: theme.accentText }) : null
|
|
952
|
+
]
|
|
953
|
+
},
|
|
954
|
+
o.value
|
|
955
|
+
);
|
|
956
|
+
}) });
|
|
957
|
+
}
|
|
958
|
+
function Select({ options, value: valueProp, defaultValue = null, onValueChange, sheetTitle, ...shared }) {
|
|
959
|
+
const [own, setOwn] = React8.useState(defaultValue);
|
|
960
|
+
const value = valueProp !== void 0 ? valueProp : own;
|
|
961
|
+
const [open, setOpen] = React8.useState(false);
|
|
962
|
+
const close = () => {
|
|
963
|
+
setOpen(false);
|
|
964
|
+
shared.onBlur?.();
|
|
965
|
+
};
|
|
966
|
+
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
967
|
+
/* @__PURE__ */ jsx10(Trigger, { shared, text: options.find((o) => o.value === value)?.label ?? null, open, onPress: () => setOpen(true) }),
|
|
968
|
+
/* @__PURE__ */ jsx10(Sheet, { open, onOpenChange: (o) => o ? setOpen(true) : close(), title: sheetTitle ?? shared.label, children: /* @__PURE__ */ jsx10(
|
|
969
|
+
Options,
|
|
970
|
+
{
|
|
971
|
+
options,
|
|
972
|
+
isChosen: (v) => v === value,
|
|
973
|
+
onPick: (o) => {
|
|
974
|
+
if (valueProp === void 0) setOwn(o.value);
|
|
975
|
+
onValueChange?.(o.value);
|
|
976
|
+
close();
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
) })
|
|
980
|
+
] });
|
|
981
|
+
}
|
|
982
|
+
var comboboxLabels = { search: "Search", loading: "Searching\u2026", empty: "No results", done: "Done" };
|
|
983
|
+
function Combobox({ options = [], onSearch, multiple, value, onValueChange, labels: given, ...shared }) {
|
|
984
|
+
const labels = { ...comboboxLabels, ...given };
|
|
985
|
+
const { theme, radius: radius3 } = useTheme();
|
|
986
|
+
const [open, setOpen] = React8.useState(false);
|
|
987
|
+
const [query, setQuery] = React8.useState("");
|
|
988
|
+
const [found, setFound] = React8.useState(null);
|
|
989
|
+
const [loading, setLoading] = React8.useState(false);
|
|
990
|
+
const [seen, setSeen] = React8.useState({});
|
|
991
|
+
const chosen = value == null ? [] : typeof value === "string" ? value ? [value] : [] : [...value];
|
|
992
|
+
React8.useEffect(() => {
|
|
993
|
+
if (!onSearch || !open) return;
|
|
994
|
+
const controller = new AbortController();
|
|
995
|
+
const timer2 = setTimeout(() => {
|
|
996
|
+
setLoading(true);
|
|
997
|
+
onSearch(query, controller.signal).then((result) => {
|
|
998
|
+
if (!controller.signal.aborted) setFound(result);
|
|
999
|
+
}).catch(() => void 0).finally(() => {
|
|
1000
|
+
if (!controller.signal.aborted) setLoading(false);
|
|
1001
|
+
});
|
|
1002
|
+
}, 250);
|
|
1003
|
+
return () => {
|
|
1004
|
+
clearTimeout(timer2);
|
|
1005
|
+
controller.abort();
|
|
1006
|
+
};
|
|
1007
|
+
}, [query, onSearch, open]);
|
|
1008
|
+
const q = query.trim().toLowerCase();
|
|
1009
|
+
const list = onSearch ? found ?? [] : options.filter((o) => !q || o.label.toLowerCase().includes(q));
|
|
1010
|
+
const labelOf = (v) => options.find((o) => o.value === v)?.label ?? seen[v]?.label ?? v;
|
|
1011
|
+
const close = () => {
|
|
1012
|
+
setOpen(false);
|
|
1013
|
+
setQuery("");
|
|
1014
|
+
shared.onBlur?.();
|
|
1015
|
+
};
|
|
1016
|
+
return /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1017
|
+
/* @__PURE__ */ jsx10(Trigger, { shared, text: chosen.length ? chosen.map(labelOf).join(", ") : null, open, onPress: () => setOpen(true) }),
|
|
1018
|
+
/* @__PURE__ */ jsxs7(Sheet, { open, onOpenChange: (o) => o ? setOpen(true) : close(), title: shared.label, children: [
|
|
1019
|
+
/* @__PURE__ */ jsx10(
|
|
1020
|
+
TextInput,
|
|
1021
|
+
{
|
|
1022
|
+
"aria-label": labels.search,
|
|
1023
|
+
placeholder: labels.search,
|
|
1024
|
+
placeholderTextColor: theme.textMuted,
|
|
1025
|
+
value: query,
|
|
1026
|
+
onChangeText: setQuery,
|
|
1027
|
+
autoFocus: true,
|
|
1028
|
+
autoCorrect: false,
|
|
1029
|
+
returnKeyType: "search",
|
|
1030
|
+
style: [styles9.search, { borderRadius: radius3.md, backgroundColor: theme.surface2, borderColor: theme.borderDefault, color: theme.textPrimary }]
|
|
1031
|
+
}
|
|
1032
|
+
),
|
|
1033
|
+
loading ? /* @__PURE__ */ jsx10(Text7, { style: [styles9.caption, { color: theme.textSecondary }], children: labels.loading }) : null,
|
|
1034
|
+
!loading && list.length === 0 ? /* @__PURE__ */ jsx10(Text7, { style: [styles9.caption, { color: theme.textSecondary }], children: labels.empty }) : null,
|
|
1035
|
+
/* @__PURE__ */ jsx10(
|
|
1036
|
+
Options,
|
|
1037
|
+
{
|
|
1038
|
+
options: list,
|
|
1039
|
+
multiple,
|
|
1040
|
+
isChosen: (v) => chosen.includes(v),
|
|
1041
|
+
onPick: (o) => {
|
|
1042
|
+
setSeen((known) => ({ ...known, [o.value]: o }));
|
|
1043
|
+
if (multiple) onValueChange?.(chosen.includes(o.value) ? chosen.filter((v) => v !== o.value) : [...chosen, o.value]);
|
|
1044
|
+
else {
|
|
1045
|
+
onValueChange?.(o.value);
|
|
1046
|
+
close();
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
),
|
|
1051
|
+
multiple ? /* @__PURE__ */ jsx10(Pressable6, { role: "button", onPress: close, style: [styles9.done, { borderRadius: radius3.md, backgroundColor: theme.accent }], children: /* @__PURE__ */ jsx10(Text7, { style: [styles9.doneText, { color: theme.onAccent }], children: labels.done }) }) : null
|
|
1052
|
+
] })
|
|
1053
|
+
] });
|
|
1054
|
+
}
|
|
1055
|
+
var styles9 = StyleSheet9.create({
|
|
1056
|
+
field: { gap: 6, alignSelf: "stretch" },
|
|
1057
|
+
label: { fontSize: 12, lineHeight: 16, fontWeight: "600" },
|
|
1058
|
+
trigger: { minHeight: 48, flexDirection: "row", alignItems: "center", gap: 8, paddingHorizontal: 14, borderWidth: 1 },
|
|
1059
|
+
triggerText: { flex: 1, fontSize: 16 },
|
|
1060
|
+
caption: { fontSize: 12, lineHeight: 16 },
|
|
1061
|
+
options: { flexGrow: 0 },
|
|
1062
|
+
option: { minHeight: 48, flexDirection: "row", alignItems: "center", gap: 12, paddingHorizontal: 12, paddingVertical: 8 },
|
|
1063
|
+
optionText: { flex: 1, gap: 2 },
|
|
1064
|
+
optionLabel: { fontSize: 16 },
|
|
1065
|
+
search: { height: 44, paddingHorizontal: 12, borderWidth: 1, fontSize: 16 },
|
|
1066
|
+
done: { height: 48, alignItems: "center", justifyContent: "center" },
|
|
1067
|
+
doneText: { fontSize: 15, fontWeight: "700" },
|
|
1068
|
+
disabled: { opacity: 0.4 }
|
|
1069
|
+
});
|
|
1070
|
+
|
|
1071
|
+
// src/native/countdown.tsx
|
|
1072
|
+
import * as React9 from "react";
|
|
1073
|
+
import { Animated as Animated3, StyleSheet as StyleSheet10, Text as Text8 } from "react-native";
|
|
1074
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
846
1075
|
var FONT = { sm: 14, md: 20, lg: 32 };
|
|
847
1076
|
function Countdown({ target, skewMs = 0, units, urgentBelowMs = 6e4, size = "md", label, showLabel = false, style }) {
|
|
848
1077
|
const { theme, fonts } = useTheme();
|
|
@@ -850,13 +1079,13 @@ function Countdown({ target, skewMs = 0, units, urgentBelowMs = 6e4, size = "md"
|
|
|
850
1079
|
const ms = useCountdown(target, skewMs);
|
|
851
1080
|
const urgent = ms > 0 && ms < urgentBelowMs;
|
|
852
1081
|
const parts = countdownParts(ms, units);
|
|
853
|
-
const [opacity] =
|
|
854
|
-
|
|
1082
|
+
const [opacity] = React9.useState(() => new Animated3.Value(1));
|
|
1083
|
+
React9.useEffect(() => {
|
|
855
1084
|
if (!urgent || reduce) return;
|
|
856
|
-
const loop =
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
1085
|
+
const loop = Animated3.loop(
|
|
1086
|
+
Animated3.sequence([
|
|
1087
|
+
Animated3.timing(opacity, { toValue: 0.4, duration: 500, useNativeDriver: true }),
|
|
1088
|
+
Animated3.timing(opacity, { toValue: 1, duration: 500, useNativeDriver: true })
|
|
860
1089
|
])
|
|
861
1090
|
);
|
|
862
1091
|
loop.start();
|
|
@@ -867,24 +1096,24 @@ function Countdown({ target, skewMs = 0, units, urgentBelowMs = 6e4, size = "md"
|
|
|
867
1096
|
}, [urgent, reduce, opacity]);
|
|
868
1097
|
const color = urgent ? theme.dangerText : theme.textPrimary;
|
|
869
1098
|
const text = parts.map(([value, unit]) => `${String(value).padStart(2, "0")}${unit}`).join(" ");
|
|
870
|
-
return /* @__PURE__ */
|
|
871
|
-
|
|
1099
|
+
return /* @__PURE__ */ jsxs8(
|
|
1100
|
+
Animated3.View,
|
|
872
1101
|
{
|
|
873
1102
|
accessible: true,
|
|
874
1103
|
role: "timer",
|
|
875
1104
|
"aria-label": `${label} ${text}`,
|
|
876
|
-
style: [
|
|
1105
|
+
style: [styles10.root, style],
|
|
877
1106
|
children: [
|
|
878
|
-
showLabel ? /* @__PURE__ */
|
|
879
|
-
parts.map(([value, unit], i) => /* @__PURE__ */
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */
|
|
1107
|
+
showLabel ? /* @__PURE__ */ jsx11(Text8, { style: [styles10.label, { color: theme.textSecondary, fontSize: Math.max(11, Math.round(FONT[size] * 0.6)) }], children: label }) : null,
|
|
1108
|
+
parts.map(([value, unit], i) => /* @__PURE__ */ jsxs8(Animated3.View, { style: [styles10.segment, urgent && i === parts.length - 1 ? { opacity } : null], children: [
|
|
1109
|
+
/* @__PURE__ */ jsx11(Text8, { style: [styles10.value, { color, fontSize: FONT[size] }, fonts.display ? { fontFamily: fonts.display } : null], children: String(value).padStart(2, "0") }),
|
|
1110
|
+
/* @__PURE__ */ jsx11(Text8, { style: [styles10.unit, { color: theme.textSecondary, fontSize: Math.round(FONT[size] / 2) }], children: unit })
|
|
882
1111
|
] }, unit))
|
|
883
1112
|
]
|
|
884
1113
|
}
|
|
885
1114
|
);
|
|
886
1115
|
}
|
|
887
|
-
var
|
|
1116
|
+
var styles10 = StyleSheet10.create({
|
|
888
1117
|
root: { flexDirection: "row", alignItems: "baseline", gap: 6 },
|
|
889
1118
|
segment: { flexDirection: "row", alignItems: "baseline" },
|
|
890
1119
|
value: { fontWeight: "900", fontVariant: ["tabular-nums"], letterSpacing: -0.3 },
|
|
@@ -893,18 +1122,18 @@ var styles8 = StyleSheet8.create({
|
|
|
893
1122
|
});
|
|
894
1123
|
|
|
895
1124
|
// src/native/date-picker.tsx
|
|
896
|
-
import * as
|
|
897
|
-
import { Platform, StyleSheet as
|
|
898
|
-
import { jsx as
|
|
1125
|
+
import * as React10 from "react";
|
|
1126
|
+
import { Platform, StyleSheet as StyleSheet11, Text as Text9, TextInput as TextInput2, View as View8 } from "react-native";
|
|
1127
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
899
1128
|
var LENGTH = DATE_PART_LENGTH;
|
|
900
1129
|
var dateFieldLabels = { day: "Day", month: "Month", year: "Year" };
|
|
901
1130
|
function DateField({ label, hint, error, value, defaultValue, onValueChange, onBlur, locale = "en-US", labels: given, autoComplete, disabled, inputRef, onSubmitEditing, returnKeyType = "done", style }) {
|
|
902
1131
|
const { theme, radius: radius3 } = useTheme();
|
|
903
1132
|
const labels = { ...dateFieldLabels, ...given };
|
|
904
|
-
const order =
|
|
905
|
-
const [parts, setParts] =
|
|
906
|
-
const [focused, setFocused] =
|
|
907
|
-
const refs = { day:
|
|
1133
|
+
const order = React10.useMemo(() => datePartsOrder(locale), [locale]);
|
|
1134
|
+
const [parts, setParts] = React10.useState(() => splitDate(value ?? defaultValue));
|
|
1135
|
+
const [focused, setFocused] = React10.useState(null);
|
|
1136
|
+
const refs = { day: React10.useRef(null), month: React10.useRef(null), year: React10.useRef(null) };
|
|
908
1137
|
if (value !== void 0 && value !== composeDate(parts) && composeDate(splitDate(value)) === value) setParts(splitDate(value));
|
|
909
1138
|
const caption = error ?? hint;
|
|
910
1139
|
const change = (part, text) => {
|
|
@@ -915,12 +1144,12 @@ function DateField({ label, hint, error, value, defaultValue, onValueChange, onB
|
|
|
915
1144
|
const following = order[order.indexOf(part) + 1];
|
|
916
1145
|
if (digits.length === LENGTH[part] && following) refs[following].current?.focus();
|
|
917
1146
|
};
|
|
918
|
-
return /* @__PURE__ */
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
|
|
1147
|
+
return /* @__PURE__ */ jsxs9(View8, { role: "group", "aria-label": label, style: [styles11.root, disabled ? styles11.disabled : null, style], children: [
|
|
1148
|
+
/* @__PURE__ */ jsx12(Text9, { style: [styles11.label, { color: theme.textSecondary }], children: label }),
|
|
1149
|
+
/* @__PURE__ */ jsx12(View8, { style: styles11.row, children: order.map((part, i) => /* @__PURE__ */ jsxs9(View8, { style: part === "year" ? styles11.yearBox : styles11.box, children: [
|
|
1150
|
+
/* @__PURE__ */ jsx12(Text9, { style: [styles11.part, { color: theme.textSecondary }], children: labels[part] }),
|
|
1151
|
+
/* @__PURE__ */ jsx12(
|
|
1152
|
+
TextInput2,
|
|
924
1153
|
{
|
|
925
1154
|
ref: (node) => {
|
|
926
1155
|
refs[part].current = node;
|
|
@@ -951,16 +1180,16 @@ function DateField({ label, hint, error, value, defaultValue, onValueChange, onB
|
|
|
951
1180
|
if (i === order.length - 1) onBlur?.();
|
|
952
1181
|
},
|
|
953
1182
|
style: [
|
|
954
|
-
|
|
1183
|
+
styles11.input,
|
|
955
1184
|
{ color: theme.textPrimary, backgroundColor: theme.surface2, borderRadius: radius3.md, borderColor: error ? theme.danger : focused === part ? theme.accent : theme.borderDefault }
|
|
956
1185
|
]
|
|
957
1186
|
}
|
|
958
1187
|
)
|
|
959
1188
|
] }, part)) }),
|
|
960
|
-
caption ? /* @__PURE__ */
|
|
1189
|
+
caption ? /* @__PURE__ */ jsx12(Text9, { role: error ? "alert" : void 0, "aria-live": error ? "polite" : void 0, style: [styles11.caption, { color: error ? theme.dangerText : theme.textSecondary }], children: caption }) : null
|
|
961
1190
|
] });
|
|
962
1191
|
}
|
|
963
|
-
var
|
|
1192
|
+
var styles11 = StyleSheet11.create({
|
|
964
1193
|
root: { gap: 6, alignSelf: "stretch" },
|
|
965
1194
|
label: { fontSize: 12, lineHeight: 16, fontWeight: "600" },
|
|
966
1195
|
row: { flexDirection: "row", gap: 10 },
|
|
@@ -973,26 +1202,26 @@ var styles9 = StyleSheet9.create({
|
|
|
973
1202
|
});
|
|
974
1203
|
|
|
975
1204
|
// src/native/date-time.tsx
|
|
976
|
-
import * as
|
|
977
|
-
import { Pressable as
|
|
978
|
-
import
|
|
1205
|
+
import * as React12 from "react";
|
|
1206
|
+
import { Pressable as Pressable8, ScrollView as ScrollView4, StyleSheet as StyleSheet13, Text as Text11, View as View10 } from "react-native";
|
|
1207
|
+
import Svg4, { Path as Path3 } from "react-native-svg";
|
|
979
1208
|
|
|
980
1209
|
// src/native/wheel.tsx
|
|
981
|
-
import * as
|
|
982
|
-
import { Pressable as
|
|
983
|
-
import { jsx as
|
|
1210
|
+
import * as React11 from "react";
|
|
1211
|
+
import { Pressable as Pressable7, ScrollView as ScrollView3, StyleSheet as StyleSheet12, Text as Text10, View as View9 } from "react-native";
|
|
1212
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
984
1213
|
var ITEM = 44;
|
|
985
|
-
var
|
|
986
|
-
function WheelPicker({ label, children, visible = 5, invalid, style }) {
|
|
1214
|
+
var FrameContext = React11.createContext({ visible: 5, unset: false });
|
|
1215
|
+
function WheelPicker({ label, children, visible = 5, invalid, unset = false, style }) {
|
|
987
1216
|
const { theme, radius: radius3 } = useTheme();
|
|
988
|
-
return /* @__PURE__ */
|
|
989
|
-
|
|
1217
|
+
return /* @__PURE__ */ jsx13(FrameContext.Provider, { value: React11.useMemo(() => ({ visible, unset }), [visible, unset]), children: /* @__PURE__ */ jsxs10(
|
|
1218
|
+
View9,
|
|
990
1219
|
{
|
|
991
1220
|
role: "group",
|
|
992
1221
|
"aria-label": label,
|
|
993
|
-
style: [
|
|
1222
|
+
style: [styles12.root, { height: ITEM * visible, borderRadius: radius3.xl, backgroundColor: theme.surface1, borderColor: invalid ? theme.danger : theme.borderDefault }, style],
|
|
994
1223
|
children: [
|
|
995
|
-
/* @__PURE__ */
|
|
1224
|
+
/* @__PURE__ */ jsx13(View9, { pointerEvents: "none", style: [styles12.band, { top: ITEM * (visible - 1) / 2, height: ITEM, borderRadius: radius3.lg, backgroundColor: theme.surface3, borderColor: theme.borderSubtle }] }),
|
|
996
1225
|
children
|
|
997
1226
|
]
|
|
998
1227
|
}
|
|
@@ -1000,7 +1229,7 @@ function WheelPicker({ label, children, visible = 5, invalid, style }) {
|
|
|
1000
1229
|
}
|
|
1001
1230
|
function WheelDivider({ children }) {
|
|
1002
1231
|
const { theme } = useTheme();
|
|
1003
|
-
return /* @__PURE__ */
|
|
1232
|
+
return /* @__PURE__ */ jsx13(Text10, { "aria-hidden": true, style: [styles12.divider, { color: theme.textSecondary }], children });
|
|
1004
1233
|
}
|
|
1005
1234
|
var nearestEnabled = (options, index) => {
|
|
1006
1235
|
for (let d = 0; d < options.length; d++) {
|
|
@@ -1011,14 +1240,14 @@ var nearestEnabled = (options, index) => {
|
|
|
1011
1240
|
};
|
|
1012
1241
|
function Wheel({ label, options, value: valueProp, defaultValue, onValueChange, disabled, style }) {
|
|
1013
1242
|
const { theme, haptic } = useTheme();
|
|
1014
|
-
const visible =
|
|
1015
|
-
const [own, setOwn] =
|
|
1243
|
+
const { visible, unset } = React11.useContext(FrameContext);
|
|
1244
|
+
const [own, setOwn] = React11.useState(defaultValue ?? options[0]?.value ?? "");
|
|
1016
1245
|
const value = valueProp ?? own;
|
|
1017
1246
|
const index = Math.max(0, options.findIndex((o) => o.value === value));
|
|
1018
|
-
const scroller =
|
|
1019
|
-
const passing =
|
|
1020
|
-
const [shown, setShown] =
|
|
1021
|
-
const [seen, setSeen] =
|
|
1247
|
+
const scroller = React11.useRef(null);
|
|
1248
|
+
const passing = React11.useRef(index);
|
|
1249
|
+
const [shown, setShown] = React11.useState(index);
|
|
1250
|
+
const [seen, setSeen] = React11.useState(index);
|
|
1022
1251
|
if (seen !== index) {
|
|
1023
1252
|
setSeen(index);
|
|
1024
1253
|
setShown(index);
|
|
@@ -1031,7 +1260,7 @@ function Wheel({ label, options, value: valueProp, defaultValue, onValueChange,
|
|
|
1031
1260
|
if (valueProp === void 0) setOwn(option.value);
|
|
1032
1261
|
if (option.value !== value) onValueChange?.(option.value);
|
|
1033
1262
|
};
|
|
1034
|
-
|
|
1263
|
+
React11.useEffect(() => {
|
|
1035
1264
|
passing.current = index;
|
|
1036
1265
|
scroller.current?.scrollTo({ y: index * ITEM, animated: false });
|
|
1037
1266
|
}, [index]);
|
|
@@ -1050,8 +1279,8 @@ function Wheel({ label, options, value: valueProp, defaultValue, onValueChange,
|
|
|
1050
1279
|
if (options[i]) commit(i);
|
|
1051
1280
|
};
|
|
1052
1281
|
const pad = (visible - 1) / 2 * ITEM;
|
|
1053
|
-
return /* @__PURE__ */
|
|
1054
|
-
|
|
1282
|
+
return /* @__PURE__ */ jsx13(
|
|
1283
|
+
View9,
|
|
1055
1284
|
{
|
|
1056
1285
|
accessible: true,
|
|
1057
1286
|
role: "spinbutton",
|
|
@@ -1063,9 +1292,9 @@ function Wheel({ label, options, value: valueProp, defaultValue, onValueChange,
|
|
|
1063
1292
|
"aria-disabled": disabled || void 0,
|
|
1064
1293
|
accessibilityActions: [{ name: "increment" }, { name: "decrement" }],
|
|
1065
1294
|
onAccessibilityAction: (e) => step(e.nativeEvent.actionName === "increment" ? 1 : -1),
|
|
1066
|
-
style: [
|
|
1067
|
-
children: /* @__PURE__ */
|
|
1068
|
-
|
|
1295
|
+
style: [styles12.column, disabled ? styles12.disabled : null, style],
|
|
1296
|
+
children: /* @__PURE__ */ jsx13(
|
|
1297
|
+
ScrollView3,
|
|
1069
1298
|
{
|
|
1070
1299
|
ref: scroller,
|
|
1071
1300
|
"aria-hidden": true,
|
|
@@ -1084,15 +1313,15 @@ function Wheel({ label, options, value: valueProp, defaultValue, onValueChange,
|
|
|
1084
1313
|
},
|
|
1085
1314
|
children: options.map((o, i) => {
|
|
1086
1315
|
const distance = Math.abs(i - shown);
|
|
1087
|
-
return /* @__PURE__ */
|
|
1088
|
-
|
|
1316
|
+
return /* @__PURE__ */ jsx13(Pressable7, { focusable: false, tabIndex: -1, disabled: disabled || o.disabled, onPress: () => commit(i), style: [styles12.item, { height: ITEM }], children: /* @__PURE__ */ jsx13(
|
|
1317
|
+
Text10,
|
|
1089
1318
|
{
|
|
1090
1319
|
numberOfLines: 1,
|
|
1091
1320
|
style: [
|
|
1092
|
-
|
|
1321
|
+
styles12.itemText,
|
|
1093
1322
|
{
|
|
1094
|
-
color: o.disabled ? theme.textMuted : i === shown ? theme.textPrimary : theme.textSecondary,
|
|
1095
|
-
fontWeight: i === shown ? "600" : "400",
|
|
1323
|
+
color: o.disabled ? theme.textMuted : i === shown && !unset ? theme.textPrimary : theme.textSecondary,
|
|
1324
|
+
fontWeight: i === shown && !unset ? "600" : "400",
|
|
1096
1325
|
opacity: distance === 0 ? 1 : distance === 1 ? 0.7 : 0.4,
|
|
1097
1326
|
transform: [{ scale: distance === 0 ? 1 : 0.92 }],
|
|
1098
1327
|
textDecorationLine: o.disabled ? "line-through" : "none"
|
|
@@ -1107,9 +1336,9 @@ function Wheel({ label, options, value: valueProp, defaultValue, onValueChange,
|
|
|
1107
1336
|
}
|
|
1108
1337
|
);
|
|
1109
1338
|
}
|
|
1110
|
-
var
|
|
1111
|
-
root: { flexDirection: "row", alignItems: "stretch", borderWidth:
|
|
1112
|
-
band: { position: "absolute", left: 6, right: 6, borderWidth:
|
|
1339
|
+
var styles12 = StyleSheet12.create({
|
|
1340
|
+
root: { flexDirection: "row", alignItems: "stretch", borderWidth: StyleSheet12.hairlineWidth, paddingHorizontal: 6, gap: 4, overflow: "hidden", alignSelf: "flex-start" },
|
|
1341
|
+
band: { position: "absolute", left: 6, right: 6, borderWidth: StyleSheet12.hairlineWidth },
|
|
1113
1342
|
column: { minWidth: 56, flexGrow: 1 },
|
|
1114
1343
|
item: { alignItems: "center", justifyContent: "center", paddingHorizontal: 8 },
|
|
1115
1344
|
itemText: { fontSize: 18, fontVariant: ["tabular-nums"] },
|
|
@@ -1118,19 +1347,19 @@ var styles10 = StyleSheet10.create({
|
|
|
1118
1347
|
});
|
|
1119
1348
|
|
|
1120
1349
|
// src/native/date-time.tsx
|
|
1121
|
-
import { jsx as
|
|
1350
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1122
1351
|
var longDate = (locale, iso) => new Intl.DateTimeFormat(locale, { dateStyle: "long" }).format(toLocalDate(iso));
|
|
1123
1352
|
var useOwn = (value, initial) => {
|
|
1124
|
-
const [own, setOwn] =
|
|
1353
|
+
const [own, setOwn] = React12.useState(initial);
|
|
1125
1354
|
return [value !== void 0 ? value : own, (next) => value === void 0 && setOwn(next)];
|
|
1126
1355
|
};
|
|
1127
|
-
function
|
|
1128
|
-
return /* @__PURE__ */
|
|
1356
|
+
function Chevron2({ direction, color }) {
|
|
1357
|
+
return /* @__PURE__ */ jsx14(Svg4, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx14(Path3, { d: direction === "left" ? "m15 18-6-6 6-6" : "m9 18 6-6-6-6" }) });
|
|
1129
1358
|
}
|
|
1130
1359
|
function NavButton({ label, direction, disabled, onPress }) {
|
|
1131
1360
|
const { theme, radius: radius3 } = useTheme();
|
|
1132
|
-
return /* @__PURE__ */
|
|
1133
|
-
|
|
1361
|
+
return /* @__PURE__ */ jsx14(
|
|
1362
|
+
Pressable8,
|
|
1134
1363
|
{
|
|
1135
1364
|
role: "button",
|
|
1136
1365
|
"aria-label": label,
|
|
@@ -1138,49 +1367,49 @@ function NavButton({ label, direction, disabled, onPress }) {
|
|
|
1138
1367
|
disabled,
|
|
1139
1368
|
hitSlop: 6,
|
|
1140
1369
|
onPress,
|
|
1141
|
-
style: ({ pressed }) => [
|
|
1142
|
-
children: /* @__PURE__ */
|
|
1370
|
+
style: ({ pressed }) => [styles13.nav, { borderRadius: radius3.md, backgroundColor: pressed ? theme.surface3 : theme.surface2, borderColor: theme.borderSubtle }, disabled ? styles13.disabled : null],
|
|
1371
|
+
children: /* @__PURE__ */ jsx14(Chevron2, { direction, color: theme.textSecondary })
|
|
1143
1372
|
}
|
|
1144
1373
|
);
|
|
1145
1374
|
}
|
|
1146
1375
|
function Node({ color, style }) {
|
|
1147
|
-
return /* @__PURE__ */
|
|
1376
|
+
return /* @__PURE__ */ jsx14(View10, { "aria-hidden": true, style: [styles13.node, { backgroundColor: color }, style] });
|
|
1148
1377
|
}
|
|
1149
1378
|
var calendarLabels = { previousMonth: "Previous month", nextMonth: "Next month" };
|
|
1150
1379
|
function Calendar({ locale, value, range, onSelect, defaultMonth, min, max, isDateDisabled, weekStartsOn, today: todayProp, labels: given, style }) {
|
|
1151
1380
|
const labels = { ...calendarLabels, ...given };
|
|
1152
1381
|
const { theme, radius: radius3, haptic } = useTheme();
|
|
1153
1382
|
const today = todayProp ?? todayIso();
|
|
1154
|
-
const [month, setMonth] =
|
|
1383
|
+
const [month, setMonth] = React12.useState(`${(defaultMonth ?? value ?? range?.start ?? today).slice(0, 7)}-01`);
|
|
1155
1384
|
const start = weekStartsOn ?? weekStartOf(locale);
|
|
1156
1385
|
const weeks = monthGrid(month, start);
|
|
1157
1386
|
const weekday = new Intl.DateTimeFormat(locale, { weekday: "narrow" });
|
|
1158
1387
|
const title = new Intl.DateTimeFormat(locale, { month: "long", year: "numeric" }).format(toLocalDate(month));
|
|
1159
1388
|
const [lo, hi] = range?.end ? range.start <= range.end ? [range.start, range.end] : [range.end, range.start] : [null, null];
|
|
1160
1389
|
const off = (iso) => Boolean(min && iso < min || max && iso > max || isDateDisabled?.(iso));
|
|
1161
|
-
return /* @__PURE__ */
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */
|
|
1164
|
-
/* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */
|
|
1390
|
+
return /* @__PURE__ */ jsxs11(View10, { style: [styles13.calendar, { backgroundColor: theme.surface1, borderColor: theme.borderDefault, borderRadius: radius3.xl }, style], children: [
|
|
1391
|
+
/* @__PURE__ */ jsxs11(View10, { style: styles13.header, children: [
|
|
1392
|
+
/* @__PURE__ */ jsx14(NavButton, { label: labels.previousMonth, direction: "left", disabled: Boolean(min && addDays(month, -1) < min), onPress: () => setMonth(addMonths(month, -1)) }),
|
|
1393
|
+
/* @__PURE__ */ jsx14(Text11, { role: "heading", "aria-live": "polite", style: [styles13.title, { color: theme.textPrimary }], children: title }),
|
|
1394
|
+
/* @__PURE__ */ jsx14(NavButton, { label: labels.nextMonth, direction: "right", disabled: Boolean(max && addMonths(month, 1) > max), onPress: () => setMonth(addMonths(month, 1)) })
|
|
1166
1395
|
] }),
|
|
1167
|
-
/* @__PURE__ */
|
|
1168
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ jsx14(View10, { style: styles13.week, "aria-hidden": true, children: weeks[0].map((iso) => /* @__PURE__ */ jsx14(Text11, { style: [styles13.weekday, { color: theme.textSecondary }], children: weekday.format(toLocalDate(iso)) }, iso)) }),
|
|
1397
|
+
/* @__PURE__ */ jsx14(View10, { role: "radiogroup", "aria-label": title, children: weeks.map((week) => /* @__PURE__ */ jsx14(View10, { style: styles13.week, children: week.map((iso) => {
|
|
1169
1398
|
const outside = iso.slice(0, 7) !== month.slice(0, 7);
|
|
1170
1399
|
const selected = iso === value || Boolean(range && (iso === range.start || iso === range.end));
|
|
1171
1400
|
const disabled = off(iso);
|
|
1172
1401
|
const band = lo && hi && lo !== hi && iso >= lo && iso <= hi;
|
|
1173
|
-
return /* @__PURE__ */
|
|
1174
|
-
|
|
1402
|
+
return /* @__PURE__ */ jsx14(
|
|
1403
|
+
View10,
|
|
1175
1404
|
{
|
|
1176
1405
|
style: [
|
|
1177
|
-
|
|
1406
|
+
styles13.cell,
|
|
1178
1407
|
band ? { backgroundColor: theme.accentSoft } : null,
|
|
1179
1408
|
band && iso === lo ? { borderTopLeftRadius: radius3.lg, borderBottomLeftRadius: radius3.lg } : null,
|
|
1180
1409
|
band && iso === hi ? { borderTopRightRadius: radius3.lg, borderBottomRightRadius: radius3.lg } : null
|
|
1181
1410
|
],
|
|
1182
|
-
children: /* @__PURE__ */
|
|
1183
|
-
|
|
1411
|
+
children: /* @__PURE__ */ jsxs11(
|
|
1412
|
+
Pressable8,
|
|
1184
1413
|
{
|
|
1185
1414
|
role: "radio",
|
|
1186
1415
|
"aria-label": longDate(locale, iso),
|
|
@@ -1193,16 +1422,16 @@ function Calendar({ locale, value, range, onSelect, defaultMonth, min, max, isDa
|
|
|
1193
1422
|
onSelect?.(iso);
|
|
1194
1423
|
},
|
|
1195
1424
|
style: ({ pressed }) => [
|
|
1196
|
-
|
|
1425
|
+
styles13.day,
|
|
1197
1426
|
{ borderRadius: radius3.lg },
|
|
1198
1427
|
selected ? { backgroundColor: theme.accent } : pressed ? { backgroundColor: theme.surface3 } : null
|
|
1199
1428
|
],
|
|
1200
1429
|
children: [
|
|
1201
|
-
/* @__PURE__ */
|
|
1202
|
-
|
|
1430
|
+
/* @__PURE__ */ jsx14(
|
|
1431
|
+
Text11,
|
|
1203
1432
|
{
|
|
1204
1433
|
style: [
|
|
1205
|
-
|
|
1434
|
+
styles13.dayText,
|
|
1206
1435
|
{
|
|
1207
1436
|
color: selected ? theme.onAccent : disabled ? theme.textMuted : iso === today ? theme.accentText : outside ? theme.textSecondary : theme.textPrimary,
|
|
1208
1437
|
fontWeight: selected || iso === today ? "700" : "400",
|
|
@@ -1212,7 +1441,7 @@ function Calendar({ locale, value, range, onSelect, defaultMonth, min, max, isDa
|
|
|
1212
1441
|
children: Number(iso.slice(8))
|
|
1213
1442
|
}
|
|
1214
1443
|
),
|
|
1215
|
-
iso === today ? /* @__PURE__ */
|
|
1444
|
+
iso === today ? /* @__PURE__ */ jsx14(Node, { color: selected ? theme.onAccent : theme.accent, style: styles13.todayNode }) : null
|
|
1216
1445
|
]
|
|
1217
1446
|
}
|
|
1218
1447
|
)
|
|
@@ -1224,21 +1453,21 @@ function Calendar({ locale, value, range, onSelect, defaultMonth, min, max, isDa
|
|
|
1224
1453
|
}
|
|
1225
1454
|
function MonthPicker({ locale, value, onValueChange, min, max, labels, style }) {
|
|
1226
1455
|
const { theme, radius: radius3, haptic } = useTheme();
|
|
1227
|
-
const [year, setYear] =
|
|
1456
|
+
const [year, setYear] = React12.useState(Number((value ?? todayIso()).slice(0, 4)));
|
|
1228
1457
|
const names = monthNames(locale, "short").map((n) => n.replace(/\.$/, ""));
|
|
1229
1458
|
const long = monthNames(locale, "long");
|
|
1230
|
-
return /* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1459
|
+
return /* @__PURE__ */ jsxs11(View10, { style: [styles13.calendar, { backgroundColor: theme.surface1, borderColor: theme.borderDefault, borderRadius: radius3.xl }, style], children: [
|
|
1460
|
+
/* @__PURE__ */ jsxs11(View10, { style: styles13.header, children: [
|
|
1461
|
+
/* @__PURE__ */ jsx14(NavButton, { label: labels?.previousYear ?? "Previous year", direction: "left", disabled: Boolean(min && year - 1 < Number(min.slice(0, 4))), onPress: () => setYear(year - 1) }),
|
|
1462
|
+
/* @__PURE__ */ jsx14(Text11, { role: "heading", "aria-live": "polite", style: [styles13.title, { color: theme.textPrimary }], children: year }),
|
|
1463
|
+
/* @__PURE__ */ jsx14(NavButton, { label: labels?.nextYear ?? "Next year", direction: "right", disabled: Boolean(max && year + 1 > Number(max.slice(0, 4))), onPress: () => setYear(year + 1) })
|
|
1235
1464
|
] }),
|
|
1236
|
-
/* @__PURE__ */
|
|
1465
|
+
/* @__PURE__ */ jsx14(View10, { role: "radiogroup", "aria-label": String(year), style: styles13.months, children: names.map((name, i) => {
|
|
1237
1466
|
const id = `${year}-${String(i + 1).padStart(2, "0")}`;
|
|
1238
1467
|
const selected = id === value;
|
|
1239
1468
|
const disabled = Boolean(min && id < min || max && id > max);
|
|
1240
|
-
return /* @__PURE__ */
|
|
1241
|
-
|
|
1469
|
+
return /* @__PURE__ */ jsx14(
|
|
1470
|
+
Pressable8,
|
|
1242
1471
|
{
|
|
1243
1472
|
role: "radio",
|
|
1244
1473
|
"aria-checked": selected,
|
|
@@ -1249,8 +1478,8 @@ function MonthPicker({ locale, value, onValueChange, min, max, labels, style })
|
|
|
1249
1478
|
haptic("selection");
|
|
1250
1479
|
onValueChange?.(id);
|
|
1251
1480
|
},
|
|
1252
|
-
style: ({ pressed }) => [
|
|
1253
|
-
children: /* @__PURE__ */
|
|
1481
|
+
style: ({ pressed }) => [styles13.month, { borderRadius: radius3.lg, backgroundColor: selected ? theme.accent : pressed ? theme.surface3 : "transparent" }, disabled ? styles13.disabled : null],
|
|
1482
|
+
children: /* @__PURE__ */ jsx14(Text11, { style: [styles13.monthText, { color: selected ? theme.onAccent : theme.textPrimary, fontWeight: selected ? "700" : "500" }], children: name })
|
|
1254
1483
|
},
|
|
1255
1484
|
id
|
|
1256
1485
|
);
|
|
@@ -1264,13 +1493,13 @@ function DayStrip({ label, locale, value: valueProp, defaultValue = null, onValu
|
|
|
1264
1493
|
const [value, setValue] = useOwn(valueProp, defaultValue);
|
|
1265
1494
|
const weekday = new Intl.DateTimeFormat(locale, { weekday: "short" });
|
|
1266
1495
|
const list = Array.from({ length: days }, (_, i) => addDays(first, i));
|
|
1267
|
-
return /* @__PURE__ */
|
|
1496
|
+
return /* @__PURE__ */ jsx14(ScrollView4, { horizontal: true, showsHorizontalScrollIndicator: false, role: "radiogroup", "aria-label": label, contentContainerStyle: styles13.strip, style, children: list.map((iso) => {
|
|
1268
1497
|
const selected = iso === value;
|
|
1269
1498
|
const disabled = Boolean(isDateDisabled?.(iso));
|
|
1270
1499
|
const marked = Boolean(isDateMarked?.(iso));
|
|
1271
1500
|
const name = longDate(locale, iso);
|
|
1272
|
-
return /* @__PURE__ */
|
|
1273
|
-
|
|
1501
|
+
return /* @__PURE__ */ jsxs11(
|
|
1502
|
+
Pressable8,
|
|
1274
1503
|
{
|
|
1275
1504
|
role: "radio",
|
|
1276
1505
|
"aria-checked": selected,
|
|
@@ -1284,7 +1513,7 @@ function DayStrip({ label, locale, value: valueProp, defaultValue = null, onValu
|
|
|
1284
1513
|
onValueChange?.(iso);
|
|
1285
1514
|
},
|
|
1286
1515
|
style: ({ pressed }) => [
|
|
1287
|
-
|
|
1516
|
+
styles13.stripDay,
|
|
1288
1517
|
{
|
|
1289
1518
|
borderRadius: radius3.xl,
|
|
1290
1519
|
backgroundColor: selected ? theme.accent : disabled ? "transparent" : theme.surface2,
|
|
@@ -1294,10 +1523,10 @@ function DayStrip({ label, locale, value: valueProp, defaultValue = null, onValu
|
|
|
1294
1523
|
}
|
|
1295
1524
|
],
|
|
1296
1525
|
children: [
|
|
1297
|
-
iso === today ? /* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1526
|
+
iso === today ? /* @__PURE__ */ jsx14(Node, { color: selected ? theme.onAccent : theme.accent, style: styles13.stripNode }) : null,
|
|
1527
|
+
/* @__PURE__ */ jsx14(Text11, { style: [styles13.stripWeekday, { color: selected ? theme.onAccent : disabled ? theme.textMuted : theme.textSecondary }], children: weekday.format(toLocalDate(iso)).replace(/\.$/, "").toUpperCase() }),
|
|
1528
|
+
/* @__PURE__ */ jsx14(Text11, { style: [styles13.stripNumber, { color: selected ? theme.onAccent : disabled ? theme.textMuted : theme.textPrimary }], children: Number(iso.slice(8)) }),
|
|
1529
|
+
/* @__PURE__ */ jsx14(View10, { style: [styles13.dot, marked ? { backgroundColor: selected ? theme.onAccent : theme.textSecondary } : null] })
|
|
1301
1530
|
]
|
|
1302
1531
|
},
|
|
1303
1532
|
iso
|
|
@@ -1312,11 +1541,11 @@ function TimePicker({ label, locale, value: valueProp, defaultValue = null, onVa
|
|
|
1312
1541
|
onValueChange?.(next);
|
|
1313
1542
|
};
|
|
1314
1543
|
if (variant === "slots")
|
|
1315
|
-
return /* @__PURE__ */
|
|
1544
|
+
return /* @__PURE__ */ jsx14(View10, { role: "radiogroup", "aria-label": label, style: [styles13.slots, style], children: slots.map((t) => {
|
|
1316
1545
|
const selected = t === value;
|
|
1317
1546
|
const off = disabled || Boolean(isTimeDisabled?.(t));
|
|
1318
|
-
return /* @__PURE__ */
|
|
1319
|
-
|
|
1547
|
+
return /* @__PURE__ */ jsx14(
|
|
1548
|
+
Pressable8,
|
|
1320
1549
|
{
|
|
1321
1550
|
role: "radio",
|
|
1322
1551
|
"aria-checked": selected,
|
|
@@ -1328,7 +1557,7 @@ function TimePicker({ label, locale, value: valueProp, defaultValue = null, onVa
|
|
|
1328
1557
|
set(t);
|
|
1329
1558
|
},
|
|
1330
1559
|
style: ({ pressed }) => [
|
|
1331
|
-
|
|
1560
|
+
styles13.slot,
|
|
1332
1561
|
{
|
|
1333
1562
|
borderRadius: radius3.lg,
|
|
1334
1563
|
backgroundColor: selected ? theme.accent : off ? "transparent" : theme.surface2,
|
|
@@ -1337,7 +1566,7 @@ function TimePicker({ label, locale, value: valueProp, defaultValue = null, onVa
|
|
|
1337
1566
|
transform: [{ scale: pressed ? 0.97 : 1 }]
|
|
1338
1567
|
}
|
|
1339
1568
|
],
|
|
1340
|
-
children: /* @__PURE__ */
|
|
1569
|
+
children: /* @__PURE__ */ jsx14(Text11, { style: [styles13.slotText, { color: selected ? theme.onAccent : off ? theme.textMuted : theme.textPrimary, textDecorationLine: off ? "line-through" : "none" }], children: formatTime(locale, t) })
|
|
1341
1570
|
},
|
|
1342
1571
|
t
|
|
1343
1572
|
);
|
|
@@ -1353,11 +1582,11 @@ function TimePicker({ label, locale, value: valueProp, defaultValue = null, onVa
|
|
|
1353
1582
|
const hours = twelve ? [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map((h) => ({ value: String(h), label: String(h) })) : Array.from({ length: 24 }, (_, h) => ({ value: String(h), label: two(h) }));
|
|
1354
1583
|
const minutes = Array.from({ length: Math.ceil(60 / minuteStep) }, (_, i) => ({ value: String(i * minuteStep), label: two(i * minuteStep) }));
|
|
1355
1584
|
const [am, pmLabel] = dayPeriods(locale);
|
|
1356
|
-
return /* @__PURE__ */
|
|
1357
|
-
/* @__PURE__ */
|
|
1358
|
-
/* @__PURE__ */
|
|
1359
|
-
/* @__PURE__ */
|
|
1360
|
-
twelve ? /* @__PURE__ */
|
|
1585
|
+
return /* @__PURE__ */ jsxs11(WheelPicker, { label: value ? `${label}, ${formatTime(locale, value)}` : label, style, children: [
|
|
1586
|
+
/* @__PURE__ */ jsx14(Wheel, { label: labels.hours, options: hours, disabled, value: twelve ? String(h24 % 12 === 0 ? 12 : h24 % 12) : String(h24), onValueChange: (v) => put(twelve ? Number(v) % 12 + (pm ? 12 : 0) : Number(v), minute) }),
|
|
1587
|
+
/* @__PURE__ */ jsx14(WheelDivider, { children: ":" }),
|
|
1588
|
+
/* @__PURE__ */ jsx14(Wheel, { label: labels.minutes, options: minutes, disabled, value: String(Math.min(60 - minuteStep, Math.round(minute / minuteStep) * minuteStep)), onValueChange: (v) => put(h24, Number(v)) }),
|
|
1589
|
+
twelve ? /* @__PURE__ */ jsx14(
|
|
1361
1590
|
Wheel,
|
|
1362
1591
|
{
|
|
1363
1592
|
label: labels.period,
|
|
@@ -1390,22 +1619,22 @@ function DateWheel({ label, locale, value: valueProp, defaultValue = null, onVal
|
|
|
1390
1619
|
};
|
|
1391
1620
|
const last = daysInMonth(year, month);
|
|
1392
1621
|
const columns = {
|
|
1393
|
-
day: /* @__PURE__ */
|
|
1394
|
-
month: /* @__PURE__ */
|
|
1395
|
-
year: /* @__PURE__ */
|
|
1622
|
+
day: /* @__PURE__ */ jsx14(Wheel, { label: names.day, disabled, options: Array.from({ length: last }, (_, i) => ({ value: String(i + 1), label: String(i + 1), disabled: isoOf(year, month, i + 1) > hi || isoOf(year, month, i + 1) < lo })), value: String(Math.min(day, last)), onValueChange: (v) => set(year, month, Number(v)), style: styles13.dayWheel }, "day"),
|
|
1623
|
+
month: /* @__PURE__ */ jsx14(Wheel, { label: names.month, disabled, options: months.map((n, i) => ({ value: String(i + 1), label: n, disabled: isoOf(year, i + 1, 1) > hi || isoOf(year, i + 1, daysInMonth(year, i + 1)) < lo })), value: String(month), onValueChange: (v) => set(year, Number(v), day), style: styles13.monthWheel }, "month"),
|
|
1624
|
+
year: /* @__PURE__ */ jsx14(Wheel, { label: names.year, disabled, options: yearRange(Number(hi.slice(0, 4)), Number(lo.slice(0, 4))).map((y) => ({ value: String(y), label: String(y) })), value: String(year), onValueChange: (v) => set(Number(v), month, day), style: styles13.yearWheel }, "year")
|
|
1396
1625
|
};
|
|
1397
1626
|
const caption = error ?? hint;
|
|
1398
|
-
return /* @__PURE__ */
|
|
1399
|
-
/* @__PURE__ */
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
caption ? /* @__PURE__ */
|
|
1627
|
+
return /* @__PURE__ */ jsxs11(View10, { style: [styles13.field, style], children: [
|
|
1628
|
+
/* @__PURE__ */ jsx14(Text11, { "aria-hidden": true, style: [styles13.fieldLabel, { color: theme.textSecondary }], children: label }),
|
|
1629
|
+
/* @__PURE__ */ jsx14(WheelPicker, { label, invalid: Boolean(error), unset: !value, children: datePartsOrder(locale).map((part) => columns[part]) }),
|
|
1630
|
+
caption ? /* @__PURE__ */ jsx14(Text11, { role: error ? "alert" : void 0, "aria-live": error ? "polite" : void 0, style: [styles13.caption, { color: error ? theme.dangerText : theme.textSecondary }], children: caption }) : null
|
|
1402
1631
|
] });
|
|
1403
1632
|
}
|
|
1404
|
-
var
|
|
1405
|
-
calendar: { padding: 12, gap: 4, borderWidth:
|
|
1633
|
+
var styles13 = StyleSheet13.create({
|
|
1634
|
+
calendar: { padding: 12, gap: 4, borderWidth: StyleSheet13.hairlineWidth, alignSelf: "flex-start" },
|
|
1406
1635
|
header: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", marginBottom: 6, gap: 8 },
|
|
1407
1636
|
title: { fontSize: 15, fontWeight: "700", textTransform: "capitalize" },
|
|
1408
|
-
nav: { width: 36, height: 36, alignItems: "center", justifyContent: "center", borderWidth:
|
|
1637
|
+
nav: { width: 36, height: 36, alignItems: "center", justifyContent: "center", borderWidth: StyleSheet13.hairlineWidth },
|
|
1409
1638
|
week: { flexDirection: "row" },
|
|
1410
1639
|
weekday: { width: 44, textAlign: "center", fontSize: 11, fontWeight: "700", paddingBottom: 4 },
|
|
1411
1640
|
cell: { width: 44, height: 44, marginVertical: 1 },
|
|
@@ -1435,18 +1664,18 @@ var styles11 = StyleSheet11.create({
|
|
|
1435
1664
|
});
|
|
1436
1665
|
|
|
1437
1666
|
// src/native/empty-state.tsx
|
|
1438
|
-
import { StyleSheet as
|
|
1439
|
-
import { jsx as
|
|
1667
|
+
import { StyleSheet as StyleSheet14, View as View11 } from "react-native";
|
|
1668
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1440
1669
|
function EmptyState({ icon, title, description, action, style, ...props }) {
|
|
1441
1670
|
const { theme } = useTheme();
|
|
1442
|
-
return /* @__PURE__ */
|
|
1443
|
-
icon ? /* @__PURE__ */
|
|
1444
|
-
/* @__PURE__ */
|
|
1445
|
-
description ? /* @__PURE__ */
|
|
1446
|
-
action ? /* @__PURE__ */
|
|
1671
|
+
return /* @__PURE__ */ jsxs12(View11, { ...props, style: [styles14.root, style], children: [
|
|
1672
|
+
icon ? /* @__PURE__ */ jsx15(View11, { "aria-hidden": true, style: [styles14.icon, { backgroundColor: theme.surface2 }], children: icon }) : null,
|
|
1673
|
+
/* @__PURE__ */ jsx15(Txt, { variant: "label", role: "heading", style: styles14.center, children: title }),
|
|
1674
|
+
description ? /* @__PURE__ */ jsx15(Txt, { tone: "secondary", style: styles14.center, children: description }) : null,
|
|
1675
|
+
action ? /* @__PURE__ */ jsx15(View11, { style: styles14.action, children: action }) : null
|
|
1447
1676
|
] });
|
|
1448
1677
|
}
|
|
1449
|
-
var
|
|
1678
|
+
var styles14 = StyleSheet14.create({
|
|
1450
1679
|
root: { alignItems: "center", justifyContent: "center", gap: 8, paddingVertical: 40, paddingHorizontal: 24 },
|
|
1451
1680
|
icon: { width: 48, height: 48, borderRadius: 24, alignItems: "center", justifyContent: "center", marginBottom: 4 },
|
|
1452
1681
|
center: { textAlign: "center", maxWidth: 360 },
|
|
@@ -1454,19 +1683,19 @@ var styles12 = StyleSheet12.create({
|
|
|
1454
1683
|
});
|
|
1455
1684
|
|
|
1456
1685
|
// src/native/field.tsx
|
|
1457
|
-
import * as
|
|
1458
|
-
import { StyleSheet as
|
|
1459
|
-
import { jsx as
|
|
1686
|
+
import * as React13 from "react";
|
|
1687
|
+
import { StyleSheet as StyleSheet15, Text as Text12, TextInput as TextInput3, View as View12 } from "react-native";
|
|
1688
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1460
1689
|
function TextField({ label, hint, error, value, defaultValue, onValueChange, disabled, end, inputRef, style, multiline, onFocus, onBlur, ...props }) {
|
|
1461
1690
|
const { theme, radius: radius3 } = useTheme();
|
|
1462
|
-
const [focused, setFocused] =
|
|
1691
|
+
const [focused, setFocused] = React13.useState(false);
|
|
1463
1692
|
const caption = error ?? hint;
|
|
1464
1693
|
const border = error ? theme.danger : focused ? theme.accent : theme.borderDefault;
|
|
1465
|
-
return /* @__PURE__ */
|
|
1466
|
-
/* @__PURE__ */
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
/* @__PURE__ */
|
|
1469
|
-
|
|
1694
|
+
return /* @__PURE__ */ jsxs13(View12, { style: [styles15.root, disabled ? styles15.disabled : null, style], children: [
|
|
1695
|
+
/* @__PURE__ */ jsx16(Text12, { style: [styles15.label, { color: theme.textSecondary }], children: label }),
|
|
1696
|
+
/* @__PURE__ */ jsxs13(View12, { style: [styles15.frame, multiline ? styles15.multiline : null, { borderRadius: radius3.md, borderColor: border, backgroundColor: theme.surface2 }], children: [
|
|
1697
|
+
/* @__PURE__ */ jsx16(
|
|
1698
|
+
TextInput3,
|
|
1470
1699
|
{
|
|
1471
1700
|
ref: inputRef,
|
|
1472
1701
|
"aria-label": label,
|
|
@@ -1487,16 +1716,16 @@ function TextField({ label, hint, error, value, defaultValue, onValueChange, dis
|
|
|
1487
1716
|
setFocused(false);
|
|
1488
1717
|
onBlur?.(event);
|
|
1489
1718
|
},
|
|
1490
|
-
style: [
|
|
1719
|
+
style: [styles15.input, multiline ? styles15.inputMultiline : null, { color: theme.textPrimary }],
|
|
1491
1720
|
...props
|
|
1492
1721
|
}
|
|
1493
1722
|
),
|
|
1494
|
-
end ? /* @__PURE__ */
|
|
1723
|
+
end ? /* @__PURE__ */ jsx16(View12, { style: styles15.end, children: end }) : null
|
|
1495
1724
|
] }),
|
|
1496
|
-
caption ? /* @__PURE__ */
|
|
1725
|
+
caption ? /* @__PURE__ */ jsx16(Text12, { role: error ? "alert" : void 0, "aria-live": error ? "polite" : void 0, style: [styles15.caption, { color: error ? theme.dangerText : theme.textSecondary }], children: caption }) : null
|
|
1497
1726
|
] });
|
|
1498
1727
|
}
|
|
1499
|
-
var
|
|
1728
|
+
var styles15 = StyleSheet15.create({
|
|
1500
1729
|
root: { gap: 6, alignSelf: "stretch" },
|
|
1501
1730
|
label: { fontSize: 12, lineHeight: 16, fontWeight: "600" },
|
|
1502
1731
|
frame: { flexDirection: "row", alignItems: "center", minHeight: 44, paddingHorizontal: 12, borderWidth: 1 },
|
|
@@ -1509,20 +1738,20 @@ var styles13 = StyleSheet13.create({
|
|
|
1509
1738
|
});
|
|
1510
1739
|
|
|
1511
1740
|
// src/native/goal-gauge.tsx
|
|
1512
|
-
import { Animated as
|
|
1741
|
+
import { Animated as Animated5, StyleSheet as StyleSheet16, View as View13 } from "react-native";
|
|
1513
1742
|
|
|
1514
1743
|
// src/native/story-motion.ts
|
|
1515
|
-
import * as
|
|
1516
|
-
import { AccessibilityInfo as AccessibilityInfo2, Animated as
|
|
1744
|
+
import * as React14 from "react";
|
|
1745
|
+
import { AccessibilityInfo as AccessibilityInfo2, Animated as Animated4, Easing } from "react-native";
|
|
1517
1746
|
function useEntrance(animated, delay = 0, duration = 700) {
|
|
1518
|
-
const [value] =
|
|
1519
|
-
|
|
1747
|
+
const [value] = React14.useState(() => new Animated4.Value(animated ? 0 : 1));
|
|
1748
|
+
React14.useEffect(() => {
|
|
1520
1749
|
if (!animated) return;
|
|
1521
1750
|
let cancelled = false;
|
|
1522
1751
|
void AccessibilityInfo2.isReduceMotionEnabled().then((reduce) => {
|
|
1523
1752
|
if (cancelled) return;
|
|
1524
1753
|
if (reduce) value.setValue(1);
|
|
1525
|
-
else
|
|
1754
|
+
else Animated4.timing(value, { toValue: 1, duration, delay, easing: Easing.out(Easing.cubic), useNativeDriver: true }).start();
|
|
1526
1755
|
});
|
|
1527
1756
|
return () => {
|
|
1528
1757
|
cancelled = true;
|
|
@@ -1532,17 +1761,17 @@ function useEntrance(animated, delay = 0, duration = 700) {
|
|
|
1532
1761
|
}
|
|
1533
1762
|
|
|
1534
1763
|
// src/native/goal-gauge.tsx
|
|
1535
|
-
import { jsx as
|
|
1764
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1536
1765
|
function Cell({ lit, animate, order, animated, arcade }) {
|
|
1537
1766
|
const { theme } = useTheme();
|
|
1538
1767
|
const t = useEntrance(animated && animate, 300 + order * 100, 350);
|
|
1539
1768
|
const spentOpacity = arcade ? 0.14 : 1;
|
|
1540
1769
|
const opacity = !animate ? 1 : lit ? t.interpolate({ inputRange: [0, 1], outputRange: [0.25, 1] }) : t.interpolate({ inputRange: [0, 1], outputRange: [1, arcade ? 0.14 : 1] });
|
|
1541
1770
|
const color = lit || arcade ? theme.accent : theme.surface3;
|
|
1542
|
-
return /* @__PURE__ */
|
|
1543
|
-
|
|
1771
|
+
return /* @__PURE__ */ jsx17(
|
|
1772
|
+
Animated5.View,
|
|
1544
1773
|
{
|
|
1545
|
-
style: [
|
|
1774
|
+
style: [styles16.cell, arcade ? styles16.cellArcade : null, { backgroundColor: color, opacity: lit || animate ? opacity : spentOpacity }]
|
|
1546
1775
|
}
|
|
1547
1776
|
);
|
|
1548
1777
|
}
|
|
@@ -1552,8 +1781,8 @@ function GoalGauge({ label, segments, value, valueText, mode = "fill", showLabel
|
|
|
1552
1781
|
const lit = Math.min(total, Math.max(0, Math.round(value ?? total)));
|
|
1553
1782
|
const words = valueText ?? `${lit} / ${total}`;
|
|
1554
1783
|
const arcade = variant === "arcade";
|
|
1555
|
-
return /* @__PURE__ */
|
|
1556
|
-
|
|
1784
|
+
return /* @__PURE__ */ jsxs14(
|
|
1785
|
+
View13,
|
|
1557
1786
|
{
|
|
1558
1787
|
accessible: true,
|
|
1559
1788
|
role: "meter",
|
|
@@ -1563,22 +1792,22 @@ function GoalGauge({ label, segments, value, valueText, mode = "fill", showLabel
|
|
|
1563
1792
|
"aria-valuenow": lit,
|
|
1564
1793
|
"aria-valuetext": words,
|
|
1565
1794
|
...props,
|
|
1566
|
-
style: [
|
|
1795
|
+
style: [styles16.root, style],
|
|
1567
1796
|
children: [
|
|
1568
|
-
showLabel ? /* @__PURE__ */
|
|
1569
|
-
/* @__PURE__ */
|
|
1570
|
-
arcade ? null : /* @__PURE__ */
|
|
1797
|
+
showLabel ? /* @__PURE__ */ jsxs14(View13, { "aria-hidden": true, style: [styles16.head, arcade ? styles16.headArcade : null], children: [
|
|
1798
|
+
/* @__PURE__ */ jsx17(Txt, { variant: arcade ? "mono" : "caption", tone: "secondary", children: arcade ? label.toUpperCase() : label }),
|
|
1799
|
+
arcade ? null : /* @__PURE__ */ jsx17(Txt, { variant: "caption", children: words })
|
|
1571
1800
|
] }) : null,
|
|
1572
|
-
/* @__PURE__ */
|
|
1801
|
+
/* @__PURE__ */ jsx17(View13, { "aria-hidden": true, style: [styles16.cells, arcade ? [styles16.cellsArcade, { borderColor: theme.borderSubtle, backgroundColor: theme.surface1 }] : null], children: Array.from({ length: total }, (_, i) => {
|
|
1573
1802
|
const on = i < lit;
|
|
1574
1803
|
const animate = mode === "fill" ? on : !on;
|
|
1575
|
-
return /* @__PURE__ */
|
|
1804
|
+
return /* @__PURE__ */ jsx17(Cell, { lit: on, animate, order: mode === "fill" ? i : i - lit, animated, arcade }, i);
|
|
1576
1805
|
}) })
|
|
1577
1806
|
]
|
|
1578
1807
|
}
|
|
1579
1808
|
);
|
|
1580
1809
|
}
|
|
1581
|
-
var
|
|
1810
|
+
var styles16 = StyleSheet16.create({
|
|
1582
1811
|
root: { alignSelf: "stretch", gap: 8 },
|
|
1583
1812
|
head: { flexDirection: "row", justifyContent: "space-between", alignItems: "baseline", gap: 12 },
|
|
1584
1813
|
headArcade: { justifyContent: "center" },
|
|
@@ -1589,8 +1818,8 @@ var styles14 = StyleSheet14.create({
|
|
|
1589
1818
|
});
|
|
1590
1819
|
|
|
1591
1820
|
// src/native/KrizakaMark.tsx
|
|
1592
|
-
import { View as
|
|
1593
|
-
import
|
|
1821
|
+
import { View as View14 } from "react-native";
|
|
1822
|
+
import Svg5, { Circle, Defs as Defs2, G as Group, LinearGradient as LinearGradient2, Path as Path4, RadialGradient, Stop as Stop2 } from "react-native-svg";
|
|
1594
1823
|
|
|
1595
1824
|
// src/marks/krizaka-geometry.ts
|
|
1596
1825
|
var KRIZAKA = {
|
|
@@ -1612,24 +1841,24 @@ var KRIZAKA = {
|
|
|
1612
1841
|
};
|
|
1613
1842
|
|
|
1614
1843
|
// src/native/mark-motion.ts
|
|
1615
|
-
import { useEffect as
|
|
1616
|
-
import { AccessibilityInfo as AccessibilityInfo3, Animated as
|
|
1844
|
+
import { useEffect as useEffect8, useState as useState14 } from "react";
|
|
1845
|
+
import { AccessibilityInfo as AccessibilityInfo3, Animated as Animated6, Easing as Easing2 } from "react-native";
|
|
1617
1846
|
var markA11y = (title) => title ? { accessible: true, accessibilityRole: "image", accessibilityLabel: title } : { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants" };
|
|
1618
1847
|
function useMarkMotion(size, animated, spinMs = 3e4) {
|
|
1619
|
-
const [spin] =
|
|
1620
|
-
const [pulse] =
|
|
1621
|
-
|
|
1848
|
+
const [spin] = useState14(() => new Animated6.Value(0));
|
|
1849
|
+
const [pulse] = useState14(() => new Animated6.Value(0));
|
|
1850
|
+
useEffect8(() => {
|
|
1622
1851
|
if (!animated) return;
|
|
1623
1852
|
let loops = [];
|
|
1624
1853
|
let cancelled = false;
|
|
1625
1854
|
void AccessibilityInfo3.isReduceMotionEnabled().then((reduce) => {
|
|
1626
1855
|
if (reduce || cancelled) return;
|
|
1627
1856
|
loops = [
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1857
|
+
Animated6.loop(Animated6.timing(spin, { toValue: 1, duration: spinMs, easing: Easing2.linear, useNativeDriver: true })),
|
|
1858
|
+
Animated6.loop(
|
|
1859
|
+
Animated6.sequence([
|
|
1860
|
+
Animated6.timing(pulse, { toValue: 1, duration: 1600, easing: Easing2.inOut(Easing2.ease), useNativeDriver: true }),
|
|
1861
|
+
Animated6.timing(pulse, { toValue: 0, duration: 1600, easing: Easing2.inOut(Easing2.ease), useNativeDriver: true })
|
|
1633
1862
|
])
|
|
1634
1863
|
)
|
|
1635
1864
|
];
|
|
@@ -1641,7 +1870,7 @@ function useMarkMotion(size, animated, spinMs = 3e4) {
|
|
|
1641
1870
|
};
|
|
1642
1871
|
}, [animated, spin, pulse, spinMs]);
|
|
1643
1872
|
return {
|
|
1644
|
-
Animated:
|
|
1873
|
+
Animated: Animated6,
|
|
1645
1874
|
layer: { position: "absolute", width: size, height: size },
|
|
1646
1875
|
spinStyle: { transform: [{ rotate: spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] }) }] },
|
|
1647
1876
|
pulseStyle: { opacity: pulse.interpolate({ inputRange: [0, 1], outputRange: [0.85, 1] }) }
|
|
@@ -1649,39 +1878,39 @@ function useMarkMotion(size, animated, spinMs = 3e4) {
|
|
|
1649
1878
|
}
|
|
1650
1879
|
|
|
1651
1880
|
// src/native/KrizakaMark.tsx
|
|
1652
|
-
import { Fragment as
|
|
1881
|
+
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1653
1882
|
function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
1654
1883
|
const { theme } = useTheme();
|
|
1655
|
-
const { Animated:
|
|
1884
|
+
const { Animated: Animated17, layer, spinStyle, pulseStyle } = useMarkMotion(size, animated);
|
|
1656
1885
|
const id = useSvgId("kzm");
|
|
1657
1886
|
const viewBox = size < 48 ? KRIZAKA.croppedViewBox : KRIZAKA.viewBox;
|
|
1658
1887
|
const stroke = neutral ?? theme.textMuted;
|
|
1659
|
-
const blue = /* @__PURE__ */
|
|
1660
|
-
const dot = (c) => /* @__PURE__ */
|
|
1661
|
-
/* @__PURE__ */
|
|
1662
|
-
/* @__PURE__ */
|
|
1888
|
+
const blue = /* @__PURE__ */ jsx18(LinearGradient2, { id: `${id}b`, gradientUnits: "userSpaceOnUse", x1: KRIZAKA.blue.x1 + KRIZAKA.offset, y1: KRIZAKA.blue.y1 + KRIZAKA.offset, x2: KRIZAKA.blue.x2 + KRIZAKA.offset, y2: KRIZAKA.blue.y2 + KRIZAKA.offset, children: KRIZAKA.blue.stops.map(([offset, color]) => /* @__PURE__ */ jsx18(Stop2, { offset, stopColor: color }, offset)) });
|
|
1889
|
+
const dot = (c) => /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
1890
|
+
/* @__PURE__ */ jsx18(Circle, { cx: c.cx, cy: c.cy, r: c.r, fill: `url(#${id}b)` }),
|
|
1891
|
+
/* @__PURE__ */ jsx18(Circle, { cx: c.cx, cy: c.cy, r: c.inner, fill: KRIZAKA.highlight })
|
|
1663
1892
|
] });
|
|
1664
|
-
return /* @__PURE__ */
|
|
1665
|
-
/* @__PURE__ */
|
|
1666
|
-
/* @__PURE__ */
|
|
1667
|
-
/* @__PURE__ */
|
|
1668
|
-
/* @__PURE__ */
|
|
1669
|
-
/* @__PURE__ */
|
|
1893
|
+
return /* @__PURE__ */ jsxs15(View14, { style: { width: size, height: size }, ...markA11y(title), children: [
|
|
1894
|
+
/* @__PURE__ */ jsxs15(Svg5, { viewBox, style: layer, children: [
|
|
1895
|
+
/* @__PURE__ */ jsxs15(Defs2, { children: [
|
|
1896
|
+
/* @__PURE__ */ jsxs15(RadialGradient, { id: `${id}g`, cx: "50%", cy: "50%", r: "50%", children: [
|
|
1897
|
+
/* @__PURE__ */ jsx18(Stop2, { offset: "0%", stopColor: KRIZAKA.glow.color, stopOpacity: KRIZAKA.glow.opacity }),
|
|
1898
|
+
/* @__PURE__ */ jsx18(Stop2, { offset: "100%", stopColor: KRIZAKA.glow.color, stopOpacity: 0 })
|
|
1670
1899
|
] }),
|
|
1671
|
-
/* @__PURE__ */
|
|
1672
|
-
/* @__PURE__ */
|
|
1673
|
-
/* @__PURE__ */
|
|
1900
|
+
/* @__PURE__ */ jsxs15(LinearGradient2, { id: `${id}i`, gradientUnits: "userSpaceOnUse", x1: KRIZAKA.ink.x1 + KRIZAKA.offset, y1: KRIZAKA.ink.y1 + KRIZAKA.offset, x2: KRIZAKA.ink.x2 + KRIZAKA.offset, y2: KRIZAKA.ink.y2 + KRIZAKA.offset, children: [
|
|
1901
|
+
/* @__PURE__ */ jsx18(Stop2, { offset: "0%", stopColor: theme.textSecondary }),
|
|
1902
|
+
/* @__PURE__ */ jsx18(Stop2, { offset: "100%", stopColor: theme.textPrimary })
|
|
1674
1903
|
] }),
|
|
1675
1904
|
blue
|
|
1676
1905
|
] }),
|
|
1677
|
-
size >= 48 ? /* @__PURE__ */
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1906
|
+
size >= 48 ? /* @__PURE__ */ jsx18(Circle, { cx: 200, cy: 200, r: 190, fill: `url(#${id}g)` }) : null,
|
|
1907
|
+
/* @__PURE__ */ jsx18(Circle, { cx: 200, cy: 200, r: KRIZAKA.ring.r, stroke, strokeWidth: KRIZAKA.ring.width, opacity: 0.35, fill: "none" }),
|
|
1908
|
+
/* @__PURE__ */ jsx18(Group, { transform: `translate(${KRIZAKA.offset} ${KRIZAKA.offset})`, children: /* @__PURE__ */ jsx18(Path4, { d: KRIZAKA.shield, stroke: `url(#${id}i)`, strokeWidth: KRIZAKA.stroke, strokeLinecap: "round", strokeLinejoin: "round", fill: "none" }) })
|
|
1680
1909
|
] }),
|
|
1681
|
-
/* @__PURE__ */
|
|
1682
|
-
/* @__PURE__ */
|
|
1683
|
-
/* @__PURE__ */
|
|
1684
|
-
/* @__PURE__ */
|
|
1910
|
+
/* @__PURE__ */ jsx18(Animated17.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsx18(Svg5, { viewBox, style: layer, children: /* @__PURE__ */ jsx18(Circle, { cx: 200, cy: 200, r: KRIZAKA.orbit.r, stroke, strokeWidth: KRIZAKA.orbit.width, strokeDasharray: KRIZAKA.orbit.dash, opacity: 0.6, fill: "none" }) }) }),
|
|
1911
|
+
/* @__PURE__ */ jsx18(Animated17.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs15(Svg5, { viewBox, style: layer, children: [
|
|
1912
|
+
/* @__PURE__ */ jsx18(Defs2, { children: blue }),
|
|
1913
|
+
/* @__PURE__ */ jsxs15(Group, { transform: `translate(${KRIZAKA.offset} ${KRIZAKA.offset})`, children: [
|
|
1685
1914
|
dot(KRIZAKA.node),
|
|
1686
1915
|
dot(KRIZAKA.core)
|
|
1687
1916
|
] })
|
|
@@ -1690,13 +1919,13 @@ function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
1690
1919
|
}
|
|
1691
1920
|
|
|
1692
1921
|
// src/native/mascot-state.tsx
|
|
1693
|
-
import * as
|
|
1694
|
-
import { AccessibilityInfo as AccessibilityInfo5, Animated as
|
|
1922
|
+
import * as React16 from "react";
|
|
1923
|
+
import { AccessibilityInfo as AccessibilityInfo5, Animated as Animated8, Easing as Easing4, StyleSheet as StyleSheet17, View as View16 } from "react-native";
|
|
1695
1924
|
|
|
1696
1925
|
// src/native/mascots.tsx
|
|
1697
|
-
import { useEffect as
|
|
1698
|
-
import { AccessibilityInfo as AccessibilityInfo4, Animated as
|
|
1699
|
-
import
|
|
1926
|
+
import { useEffect as useEffect9, useState as useState15 } from "react";
|
|
1927
|
+
import { AccessibilityInfo as AccessibilityInfo4, Animated as Animated7, Easing as Easing3, View as View15 } from "react-native";
|
|
1928
|
+
import Svg6, { Circle as Circle2, Defs as Defs3, Ellipse, G, LinearGradient as LinearGradient3, Path as Path5, Rect as Rect2, Stop as Stop3 } from "react-native-svg";
|
|
1700
1929
|
|
|
1701
1930
|
// src/mascots/geometry.ts
|
|
1702
1931
|
var mirror = (d) => d.replace(/(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/g, (_, x, y) => `${120 - Number(x)} ${y}`);
|
|
@@ -1854,17 +2083,17 @@ var SHADE = "#000000";
|
|
|
1854
2083
|
var PARCEL = ["#f59e0b", "#d97706", "#b45309"];
|
|
1855
2084
|
|
|
1856
2085
|
// src/native/mascots.tsx
|
|
1857
|
-
import { jsx as
|
|
2086
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1858
2087
|
function useBob(animated) {
|
|
1859
|
-
const [y] =
|
|
1860
|
-
|
|
2088
|
+
const [y] = useState15(() => new Animated7.Value(0));
|
|
2089
|
+
useEffect9(() => {
|
|
1861
2090
|
if (!animated) return;
|
|
1862
2091
|
let loop;
|
|
1863
2092
|
let cancelled = false;
|
|
1864
2093
|
void AccessibilityInfo4.isReduceMotionEnabled().then((reduce) => {
|
|
1865
2094
|
if (reduce || cancelled) return;
|
|
1866
|
-
const step = (toValue) =>
|
|
1867
|
-
loop =
|
|
2095
|
+
const step = (toValue) => Animated7.timing(y, { toValue, duration: 1800, easing: Easing3.inOut(Easing3.ease), useNativeDriver: true });
|
|
2096
|
+
loop = Animated7.loop(Animated7.sequence([step(-2.5), step(0)]));
|
|
1868
2097
|
loop.start();
|
|
1869
2098
|
});
|
|
1870
2099
|
return () => {
|
|
@@ -1888,62 +2117,62 @@ function Mascot({ bird = "owl", mood = "welcome", tone: tone2 = "brand", size =
|
|
|
1888
2117
|
const look3 = mood === "thinking" ? 1.4 : 0;
|
|
1889
2118
|
const rot = (deg, [x, y]) => `rotate(${deg} ${x} ${y})`;
|
|
1890
2119
|
const [wl, wr] = g.wings;
|
|
1891
|
-
return /* @__PURE__ */
|
|
1892
|
-
/* @__PURE__ */
|
|
1893
|
-
/* @__PURE__ */
|
|
1894
|
-
/* @__PURE__ */
|
|
2120
|
+
return /* @__PURE__ */ jsx19(View15, { style: [{ width: size, height: size }, style], ...markA11y(title), children: /* @__PURE__ */ jsx19(Animated7.View, { style: { transform: [{ translateY: bob }] }, children: /* @__PURE__ */ jsxs16(Svg6, { width: size, height: size, viewBox: "0 0 120 120", children: [
|
|
2121
|
+
/* @__PURE__ */ jsx19(Defs3, { children: /* @__PURE__ */ jsxs16(LinearGradient3, { id, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2122
|
+
/* @__PURE__ */ jsx19(Stop3, { offset: "0%", stopColor: p.from }),
|
|
2123
|
+
/* @__PURE__ */ jsx19(Stop3, { offset: "100%", stopColor: p.to })
|
|
1895
2124
|
] }) }),
|
|
1896
|
-
/* @__PURE__ */
|
|
1897
|
-
mood === "empty" && /* @__PURE__ */
|
|
1898
|
-
g.legs.map((d) => /* @__PURE__ */
|
|
1899
|
-
g.back?.map((d) => d.endsWith("Z") ? /* @__PURE__ */
|
|
1900
|
-
g.parcel?.map((d, i) => /* @__PURE__ */
|
|
1901
|
-
/* @__PURE__ */
|
|
1902
|
-
/* @__PURE__ */
|
|
2125
|
+
/* @__PURE__ */ jsx19(Ellipse, { cx: g.shadow[0], cy: g.shadow[1], rx: g.shadow[2], ry: g.shadow[3], fill: SHADE, opacity: 0.14 }),
|
|
2126
|
+
mood === "empty" && /* @__PURE__ */ jsx19(Path5, { d: MOOD_PARTS.tray, stroke: outline, strokeWidth: 1.6, strokeDasharray: "3 3", fill: "none" }),
|
|
2127
|
+
g.legs.map((d) => /* @__PURE__ */ jsx19(Path5, { d, stroke: p.beak, strokeWidth: 2.6, strokeLinecap: "round", fill: "none" }, d)),
|
|
2128
|
+
g.back?.map((d) => d.endsWith("Z") ? /* @__PURE__ */ jsx19(Path5, { d, fill: p.detail, ...line }, d) : /* @__PURE__ */ jsx19(Path5, { d, stroke: outline, strokeWidth: 1.4, fill: "none" }, d)),
|
|
2129
|
+
g.parcel?.map((d, i) => /* @__PURE__ */ jsx19(Path5, { d, fill: PARCEL[i], ...line }, d)),
|
|
2130
|
+
/* @__PURE__ */ jsx19(Path5, { d: g.body, fill: body, ...line }),
|
|
2131
|
+
/* @__PURE__ */ jsx19(Path5, { d: g.belly, fill: LIGHT, opacity: 0.28 }),
|
|
1903
2132
|
[wl, wr].map((w, i) => {
|
|
1904
2133
|
const turn = mood === "success" ? i === 0 ? 28 : -28 : mood === "welcome" && i === 1 ? -20 : 0;
|
|
1905
|
-
return /* @__PURE__ */
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
-
/* @__PURE__ */
|
|
2134
|
+
return /* @__PURE__ */ jsxs16(G, { transform: turn ? rot(turn, w.pivot) : void 0, children: [
|
|
2135
|
+
/* @__PURE__ */ jsx19(Path5, { d: w.d, fill: p.wing, ...line }),
|
|
2136
|
+
/* @__PURE__ */ jsx19(Path5, { d: w.d, fill: SHADE, opacity: 0.16 })
|
|
1908
2137
|
] }, i);
|
|
1909
2138
|
}),
|
|
1910
|
-
g.neck && /* @__PURE__ */
|
|
1911
|
-
g.head.r > 0 && /* @__PURE__ */
|
|
1912
|
-
g.details.map((d) => /* @__PURE__ */
|
|
1913
|
-
g.visor && /* @__PURE__ */
|
|
2139
|
+
g.neck && /* @__PURE__ */ jsx19(Path5, { d: g.neck.d, stroke: body, strokeWidth: g.neck.width, strokeLinecap: "round", fill: "none" }),
|
|
2140
|
+
g.head.r > 0 && /* @__PURE__ */ jsx19(Circle2, { cx: g.head.cx, cy: g.head.cy, r: g.head.r, fill: body, ...line }),
|
|
2141
|
+
g.details.map((d) => /* @__PURE__ */ jsx19(Path5, { d, fill: p.detail, ...line }, d)),
|
|
2142
|
+
g.visor && /* @__PURE__ */ jsx19(Rect2, { x: g.visor.x, y: g.visor.y, width: g.visor.w, height: g.visor.h, rx: 4, fill: theme.surface0, ...line }),
|
|
1914
2143
|
g.eyes.at.map(
|
|
1915
|
-
(at, i) => mood === "empty" && g.eyes.white > 0 ? /* @__PURE__ */
|
|
1916
|
-
/* @__PURE__ */
|
|
1917
|
-
/* @__PURE__ */
|
|
1918
|
-
/* @__PURE__ */
|
|
1919
|
-
] }, i) : mood === "success" || mood === "empty" ? /* @__PURE__ */
|
|
1920
|
-
g.eyes.white > 0 && /* @__PURE__ */
|
|
1921
|
-
/* @__PURE__ */
|
|
2144
|
+
(at, i) => mood === "empty" && g.eyes.white > 0 ? /* @__PURE__ */ jsxs16(G, { children: [
|
|
2145
|
+
/* @__PURE__ */ jsx19(Circle2, { cx: at[0], cy: at[1], r: g.eyes.white, fill: LIGHT, ...line }),
|
|
2146
|
+
/* @__PURE__ */ jsx19(Circle2, { cx: at[0], cy: at[1] + g.eyes.pupil * 0.7, r: g.eyes.pupil, fill: SHADE }),
|
|
2147
|
+
/* @__PURE__ */ jsx19(Path5, { d: upperLid(at, g.eyes.white), fill: p.detail, ...line })
|
|
2148
|
+
] }, i) : mood === "success" || mood === "empty" ? /* @__PURE__ */ jsx19(Path5, { d: mood === "success" ? archEye(at, eyeR * 0.85) : lidEye(at, eyeR * 0.8), stroke: g.visor ? p.eye : outline, strokeWidth: 2.2, strokeLinecap: "round", fill: "none" }, i) : /* @__PURE__ */ jsxs16(G, { children: [
|
|
2149
|
+
g.eyes.white > 0 && /* @__PURE__ */ jsx19(Circle2, { cx: at[0], cy: at[1], r: g.eyes.white, fill: LIGHT, ...line }),
|
|
2150
|
+
/* @__PURE__ */ jsx19(Circle2, { cx: at[0] + look3, cy: at[1] - look3, r: g.eyes.pupil, fill: g.visor ? p.eye : SHADE })
|
|
1922
2151
|
] }, i)
|
|
1923
2152
|
),
|
|
1924
|
-
g.glasses && g.eyes.at.map(([x, y]) => /* @__PURE__ */
|
|
1925
|
-
mood === "error" && g.eyes.at.map((at, i) => /* @__PURE__ */
|
|
1926
|
-
/* @__PURE__ */
|
|
1927
|
-
mood === "thinking" && MOOD_PARTS.dots.map(([cx, cy, r], i) => /* @__PURE__ */
|
|
1928
|
-
(mood === "success" || mood === "error") && /* @__PURE__ */
|
|
1929
|
-
mood === "success" && /* @__PURE__ */
|
|
1930
|
-
mood === "error" && /* @__PURE__ */
|
|
1931
|
-
mood === "error" && /* @__PURE__ */
|
|
2153
|
+
g.glasses && g.eyes.at.map(([x, y]) => /* @__PURE__ */ jsx19(Circle2, { cx: x, cy: y, r: 6.5, fill: "none", stroke: outline, strokeWidth: 1.3 }, x)),
|
|
2154
|
+
mood === "error" && g.eyes.at.map((at, i) => /* @__PURE__ */ jsx19(Path5, { d: brow(at, eyeR, g.eyes.at.length === 1 ? 1 : i === 0 ? -1 : 1), stroke: outline, strokeWidth: 2, strokeLinecap: "round" }, i)),
|
|
2155
|
+
/* @__PURE__ */ jsx19(Path5, { d: g.beak, fill: p.beak, ...line }),
|
|
2156
|
+
mood === "thinking" && MOOD_PARTS.dots.map(([cx, cy, r], i) => /* @__PURE__ */ jsx19(Circle2, { cx, cy, r, fill: theme.textSecondary, opacity: 0.5 + i * 0.25 }, cx)),
|
|
2157
|
+
(mood === "success" || mood === "error") && /* @__PURE__ */ jsx19(Circle2, { cx: MOOD_PARTS.badge.cx, cy: MOOD_PARTS.badge.cy, r: MOOD_PARTS.badge.r, fill: mood === "success" ? theme.success : theme.danger }),
|
|
2158
|
+
mood === "success" && /* @__PURE__ */ jsx19(Path5, { d: MOOD_PARTS.check, stroke: theme.surface0, strokeWidth: 2.6, strokeLinecap: "round", strokeLinejoin: "round", fill: "none" }),
|
|
2159
|
+
mood === "error" && /* @__PURE__ */ jsx19(Path5, { d: MOOD_PARTS.bang.line, stroke: theme.surface0, strokeWidth: 2.8, strokeLinecap: "round" }),
|
|
2160
|
+
mood === "error" && /* @__PURE__ */ jsx19(Circle2, { cx: MOOD_PARTS.bang.dot[0], cy: MOOD_PARTS.bang.dot[1], r: 1.6, fill: theme.surface0 })
|
|
1932
2161
|
] }) }) });
|
|
1933
2162
|
}
|
|
1934
2163
|
|
|
1935
2164
|
// src/native/mascot-state.tsx
|
|
1936
|
-
import { jsx as
|
|
2165
|
+
import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1937
2166
|
var SIZE = { sm: 64, md: 96, lg: 128 };
|
|
1938
2167
|
function useArrival(animated) {
|
|
1939
|
-
const [value] =
|
|
1940
|
-
|
|
2168
|
+
const [value] = React16.useState(() => new Animated8.Value(animated ? 0 : 1));
|
|
2169
|
+
React16.useEffect(() => {
|
|
1941
2170
|
if (!animated) return;
|
|
1942
2171
|
let cancelled = false;
|
|
1943
2172
|
void AccessibilityInfo5.isReduceMotionEnabled().then((reduce) => {
|
|
1944
2173
|
if (cancelled) return;
|
|
1945
2174
|
if (reduce) value.setValue(1);
|
|
1946
|
-
else
|
|
2175
|
+
else Animated8.timing(value, { toValue: 1, duration: 420, easing: Easing4.out(Easing4.cubic), useNativeDriver: true }).start();
|
|
1947
2176
|
});
|
|
1948
2177
|
return () => {
|
|
1949
2178
|
cancelled = true;
|
|
@@ -1954,30 +2183,30 @@ function useArrival(animated) {
|
|
|
1954
2183
|
function MascotState({ bird = "owl", mood = "empty", title, description, action, size = "md", layout = "stacked", tone: tone2, animated = true, style, ...props }) {
|
|
1955
2184
|
const opacity = useArrival(animated);
|
|
1956
2185
|
const inline = layout === "inline";
|
|
1957
|
-
return /* @__PURE__ */
|
|
1958
|
-
|
|
2186
|
+
return /* @__PURE__ */ jsxs17(
|
|
2187
|
+
Animated8.View,
|
|
1959
2188
|
{
|
|
1960
2189
|
role: mood === "error" ? "alert" : "status",
|
|
1961
2190
|
accessibilityLiveRegion: mood === "error" ? "assertive" : "polite",
|
|
1962
2191
|
"aria-busy": mood === "thinking" ? true : void 0,
|
|
1963
2192
|
...props,
|
|
1964
|
-
style: [inline ?
|
|
2193
|
+
style: [inline ? styles17.inline : styles17.stacked, { opacity, transform: [{ translateY: opacity.interpolate({ inputRange: [0, 1], outputRange: [6, 0] }) }] }, style],
|
|
1965
2194
|
children: [
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
/* @__PURE__ */
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
-
description ? /* @__PURE__ */
|
|
1970
|
-
action ? /* @__PURE__ */
|
|
2195
|
+
/* @__PURE__ */ jsx20(Mascot, { bird, mood, tone: tone2, size: SIZE[size], animated }),
|
|
2196
|
+
/* @__PURE__ */ jsxs17(View16, { style: inline ? styles17.wordsInline : styles17.words, children: [
|
|
2197
|
+
/* @__PURE__ */ jsx20(Txt, { variant: "label", role: "heading", style: inline ? null : styles17.center, children: title }),
|
|
2198
|
+
description ? /* @__PURE__ */ jsx20(Txt, { tone: "secondary", style: inline ? null : styles17.center, children: description }) : null,
|
|
2199
|
+
action ? /* @__PURE__ */ jsx20(View16, { style: [styles17.action, inline ? null : styles17.actionCentred], children: action }) : null
|
|
1971
2200
|
] })
|
|
1972
2201
|
]
|
|
1973
2202
|
}
|
|
1974
2203
|
);
|
|
1975
2204
|
}
|
|
1976
|
-
var ErrorState = (props) => /* @__PURE__ */
|
|
1977
|
-
var SuccessState = (props) => /* @__PURE__ */
|
|
1978
|
-
var LoadingState = (props) => /* @__PURE__ */
|
|
1979
|
-
var WelcomeState = (props) => /* @__PURE__ */
|
|
1980
|
-
var
|
|
2205
|
+
var ErrorState = (props) => /* @__PURE__ */ jsx20(MascotState, { mood: "error", ...props });
|
|
2206
|
+
var SuccessState = (props) => /* @__PURE__ */ jsx20(MascotState, { mood: "success", ...props });
|
|
2207
|
+
var LoadingState = (props) => /* @__PURE__ */ jsx20(MascotState, { mood: "thinking", ...props });
|
|
2208
|
+
var WelcomeState = (props) => /* @__PURE__ */ jsx20(MascotState, { mood: "welcome", ...props });
|
|
2209
|
+
var styles17 = StyleSheet17.create({
|
|
1981
2210
|
stacked: { alignItems: "center", justifyContent: "center", gap: 12, paddingVertical: 40, paddingHorizontal: 24 },
|
|
1982
2211
|
inline: { flexDirection: "row", alignItems: "center", gap: 16 },
|
|
1983
2212
|
words: { alignItems: "center", gap: 6 },
|
|
@@ -1988,8 +2217,8 @@ var styles15 = StyleSheet15.create({
|
|
|
1988
2217
|
});
|
|
1989
2218
|
|
|
1990
2219
|
// src/native/OrazakaMark.tsx
|
|
1991
|
-
import { View as
|
|
1992
|
-
import
|
|
2220
|
+
import { View as View17 } from "react-native";
|
|
2221
|
+
import Svg7, { Circle as Circle3, Defs as Defs4, LinearGradient as LinearGradient4, Path as Path6, RadialGradient as RadialGradient2, Stop as Stop4 } from "react-native-svg";
|
|
1993
2222
|
|
|
1994
2223
|
// src/marks/orazaka-geometry.ts
|
|
1995
2224
|
var orange = marks.orazaka[marks.orazaka.length - 1][1];
|
|
@@ -2018,41 +2247,41 @@ var ORAZAKA = {
|
|
|
2018
2247
|
};
|
|
2019
2248
|
|
|
2020
2249
|
// src/native/OrazakaMark.tsx
|
|
2021
|
-
import { jsx as
|
|
2250
|
+
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2022
2251
|
function OrazakaMark({ size = 48, animated = true, title, neutral }) {
|
|
2023
2252
|
const { theme } = useTheme();
|
|
2024
|
-
const { Animated:
|
|
2253
|
+
const { Animated: Animated17, layer, spinStyle, pulseStyle } = useMarkMotion(size, animated);
|
|
2025
2254
|
const id = useSvgId("ozm");
|
|
2026
2255
|
const viewBox = size < 48 ? ORAZAKA.croppedViewBox : ORAZAKA.viewBox;
|
|
2027
2256
|
const stroke = neutral ?? theme.textMuted;
|
|
2028
|
-
const gradient = /* @__PURE__ */
|
|
2257
|
+
const gradient = /* @__PURE__ */ jsx21(LinearGradient4, { id: `${id}a`, gradientUnits: "userSpaceOnUse", x1: ORAZAKA.gradient.x1, y1: ORAZAKA.gradient.y1, x2: ORAZAKA.gradient.x2, y2: ORAZAKA.gradient.y2, children: ORAZAKA.gradient.stops.map(([offset, color]) => /* @__PURE__ */ jsx21(Stop4, { offset, stopColor: color }, offset)) });
|
|
2029
2258
|
const fill = `url(#${id}a)`;
|
|
2030
|
-
return /* @__PURE__ */
|
|
2031
|
-
/* @__PURE__ */
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2034
|
-
/* @__PURE__ */
|
|
2259
|
+
return /* @__PURE__ */ jsxs18(View17, { style: { width: size, height: size }, ...markA11y(title), children: [
|
|
2260
|
+
/* @__PURE__ */ jsxs18(Svg7, { viewBox, style: layer, children: [
|
|
2261
|
+
/* @__PURE__ */ jsx21(Defs4, { children: /* @__PURE__ */ jsxs18(RadialGradient2, { id: `${id}g`, cx: "50%", cy: "50%", r: "50%", children: [
|
|
2262
|
+
/* @__PURE__ */ jsx21(Stop4, { offset: "0%", stopColor: ORAZAKA.glow.color, stopOpacity: ORAZAKA.glow.opacity }),
|
|
2263
|
+
/* @__PURE__ */ jsx21(Stop4, { offset: "100%", stopColor: ORAZAKA.glow.color, stopOpacity: 0 })
|
|
2035
2264
|
] }) }),
|
|
2036
|
-
size >= 48 ? /* @__PURE__ */
|
|
2037
|
-
/* @__PURE__ */
|
|
2038
|
-
/* @__PURE__ */
|
|
2265
|
+
size >= 48 ? /* @__PURE__ */ jsx21(Circle3, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: 190, fill: `url(#${id}g)` }) : null,
|
|
2266
|
+
/* @__PURE__ */ jsx21(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" }),
|
|
2267
|
+
/* @__PURE__ */ jsx21(Circle3, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.ring.r, stroke, strokeWidth: ORAZAKA.ring.width, opacity: 0.35, fill: "none" })
|
|
2039
2268
|
] }),
|
|
2040
|
-
/* @__PURE__ */
|
|
2041
|
-
/* @__PURE__ */
|
|
2042
|
-
ORAZAKA.shards.map((d) => /* @__PURE__ */
|
|
2269
|
+
/* @__PURE__ */ jsx21(Animated17.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsxs18(Svg7, { viewBox, style: layer, children: [
|
|
2270
|
+
/* @__PURE__ */ jsx21(Defs4, { children: gradient }),
|
|
2271
|
+
ORAZAKA.shards.map((d) => /* @__PURE__ */ jsx21(Path6, { d, fill, stroke: fill, strokeWidth: ORAZAKA.shardStroke, strokeLinejoin: "round" }, d))
|
|
2043
2272
|
] }) }),
|
|
2044
|
-
/* @__PURE__ */
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2047
|
-
/* @__PURE__ */
|
|
2273
|
+
/* @__PURE__ */ jsx21(Animated17.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs18(Svg7, { viewBox, style: layer, children: [
|
|
2274
|
+
/* @__PURE__ */ jsx21(Defs4, { children: gradient }),
|
|
2275
|
+
/* @__PURE__ */ jsx21(Circle3, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.core.r, fill }),
|
|
2276
|
+
/* @__PURE__ */ jsx21(Circle3, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.core.inner, fill: ORAZAKA.highlight })
|
|
2048
2277
|
] }) })
|
|
2049
2278
|
] });
|
|
2050
2279
|
}
|
|
2051
2280
|
|
|
2052
2281
|
// src/native/OrochiaMark.tsx
|
|
2053
|
-
import { useEffect as
|
|
2054
|
-
import { AccessibilityInfo as AccessibilityInfo6, Animated as
|
|
2055
|
-
import
|
|
2282
|
+
import { useEffect as useEffect11, useState as useState17 } from "react";
|
|
2283
|
+
import { AccessibilityInfo as AccessibilityInfo6, Animated as Animated9, Easing as Easing5, View as View18 } from "react-native";
|
|
2284
|
+
import Svg8, { Circle as Circle4, Defs as Defs5, Ellipse as Ellipse2, G as Group2, LinearGradient as LinearGradient5, Path as Path7, RadialGradient as RadialGradient3, Stop as Stop5 } from "react-native-svg";
|
|
2056
2285
|
|
|
2057
2286
|
// src/marks/orochia-geometry.ts
|
|
2058
2287
|
var OROCHIA = {
|
|
@@ -2079,25 +2308,25 @@ var OROCHIA = {
|
|
|
2079
2308
|
};
|
|
2080
2309
|
|
|
2081
2310
|
// src/native/OrochiaMark.tsx
|
|
2082
|
-
import { jsx as
|
|
2311
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2083
2312
|
var CENTER = OROCHIA.offset + 180;
|
|
2084
2313
|
function OrochiaMark({ size = 48, animated = true, title, neutral: neutralProp }) {
|
|
2085
2314
|
const { theme } = useTheme();
|
|
2086
2315
|
const neutral = neutralProp ?? theme.textMuted;
|
|
2087
|
-
const [spin] =
|
|
2088
|
-
const [pulse] =
|
|
2089
|
-
|
|
2316
|
+
const [spin] = useState17(() => new Animated9.Value(0));
|
|
2317
|
+
const [pulse] = useState17(() => new Animated9.Value(0));
|
|
2318
|
+
useEffect11(() => {
|
|
2090
2319
|
if (!animated) return;
|
|
2091
2320
|
let loops = [];
|
|
2092
2321
|
let cancelled = false;
|
|
2093
2322
|
void AccessibilityInfo6.isReduceMotionEnabled().then((reduce) => {
|
|
2094
2323
|
if (reduce || cancelled) return;
|
|
2095
2324
|
loops = [
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2325
|
+
Animated9.loop(Animated9.timing(spin, { toValue: 1, duration: 3e4, easing: Easing5.linear, useNativeDriver: true })),
|
|
2326
|
+
Animated9.loop(
|
|
2327
|
+
Animated9.sequence([
|
|
2328
|
+
Animated9.timing(pulse, { toValue: 1, duration: 1600, easing: Easing5.inOut(Easing5.ease), useNativeDriver: true }),
|
|
2329
|
+
Animated9.timing(pulse, { toValue: 0, duration: 1600, easing: Easing5.inOut(Easing5.ease), useNativeDriver: true })
|
|
2101
2330
|
])
|
|
2102
2331
|
)
|
|
2103
2332
|
];
|
|
@@ -2111,44 +2340,44 @@ function OrochiaMark({ size = 48, animated = true, title, neutral: neutralProp }
|
|
|
2111
2340
|
const viewBox = size < 48 ? OROCHIA.croppedViewBox : OROCHIA.viewBox;
|
|
2112
2341
|
const layer = { position: "absolute", width: size, height: size };
|
|
2113
2342
|
const a11y = title ? { accessible: true, accessibilityRole: "image", accessibilityLabel: title } : { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants" };
|
|
2114
|
-
const bodyGradient = /* @__PURE__ */
|
|
2115
|
-
return /* @__PURE__ */
|
|
2116
|
-
/* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
/* @__PURE__ */
|
|
2343
|
+
const bodyGradient = /* @__PURE__ */ jsx22(LinearGradient5, { id: "body", gradientUnits: "userSpaceOnUse", x1: OROCHIA.body.x1 + OROCHIA.offset, y1: OROCHIA.body.y1 + OROCHIA.offset, x2: OROCHIA.body.x2 + OROCHIA.offset, y2: OROCHIA.body.y2 + OROCHIA.offset, children: OROCHIA.body.stops.map(([offset, color]) => /* @__PURE__ */ jsx22(Stop5, { offset, stopColor: color }, offset)) });
|
|
2344
|
+
return /* @__PURE__ */ jsxs19(View18, { style: { width: size, height: size }, ...a11y, children: [
|
|
2345
|
+
/* @__PURE__ */ jsxs19(Svg8, { viewBox, style: layer, children: [
|
|
2346
|
+
/* @__PURE__ */ jsx22(Defs5, { children: /* @__PURE__ */ jsxs19(RadialGradient3, { id: "glow", cx: "50%", cy: "50%", r: "50%", children: [
|
|
2347
|
+
/* @__PURE__ */ jsx22(Stop5, { offset: "0%", stopColor: OROCHIA.glow.color, stopOpacity: OROCHIA.glow.opacity }),
|
|
2348
|
+
/* @__PURE__ */ jsx22(Stop5, { offset: "100%", stopColor: OROCHIA.glow.color, stopOpacity: 0 })
|
|
2120
2349
|
] }) }),
|
|
2121
|
-
/* @__PURE__ */
|
|
2122
|
-
/* @__PURE__ */
|
|
2350
|
+
/* @__PURE__ */ jsx22(Circle4, { cx: CENTER, cy: CENTER, r: 170, fill: "url(#glow)" }),
|
|
2351
|
+
/* @__PURE__ */ jsx22(Circle4, { cx: CENTER, cy: CENTER, r: OROCHIA.ring.r, stroke: neutral, strokeWidth: OROCHIA.ring.width, opacity: 0.35, fill: "none" })
|
|
2123
2352
|
] }),
|
|
2124
|
-
/* @__PURE__ */
|
|
2125
|
-
/* @__PURE__ */
|
|
2126
|
-
/* @__PURE__ */
|
|
2127
|
-
/* @__PURE__ */
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
-
/* @__PURE__ */
|
|
2130
|
-
/* @__PURE__ */
|
|
2131
|
-
/* @__PURE__ */
|
|
2132
|
-
/* @__PURE__ */
|
|
2133
|
-
/* @__PURE__ */
|
|
2353
|
+
/* @__PURE__ */ jsx22(Animated9.View, { style: [layer, { transform: [{ rotate: spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] }) }] }], children: /* @__PURE__ */ jsx22(Svg8, { viewBox, style: layer, children: /* @__PURE__ */ jsx22(Circle4, { cx: CENTER, cy: CENTER, r: OROCHIA.orbit.r, stroke: neutral, strokeWidth: OROCHIA.orbit.width, strokeDasharray: OROCHIA.orbit.dash, opacity: 0.6, fill: "none" }) }) }),
|
|
2354
|
+
/* @__PURE__ */ jsxs19(Svg8, { viewBox, style: layer, children: [
|
|
2355
|
+
/* @__PURE__ */ jsx22(Defs5, { children: bodyGradient }),
|
|
2356
|
+
/* @__PURE__ */ jsxs19(Group2, { transform: `translate(${OROCHIA.offset} ${OROCHIA.offset})`, children: [
|
|
2357
|
+
/* @__PURE__ */ jsx22(Path7, { d: OROCHIA.arc, stroke: "url(#body)", strokeWidth: 22, strokeLinecap: "round", fill: "none" }),
|
|
2358
|
+
/* @__PURE__ */ jsx22(Path7, { d: OROCHIA.arc, stroke: OROCHIA.scales.color, strokeOpacity: OROCHIA.scales.opacity, strokeWidth: OROCHIA.scales.width, strokeLinecap: "round", strokeDasharray: OROCHIA.scales.dash, fill: "none" }),
|
|
2359
|
+
/* @__PURE__ */ jsx22(Path7, { d: OROCHIA.neck, stroke: "url(#body)", strokeWidth: 14, strokeLinecap: "round", fill: "none" }),
|
|
2360
|
+
/* @__PURE__ */ jsx22(Path7, { d: OROCHIA.tail, stroke: "url(#body)", strokeWidth: 6, strokeLinecap: "round", fill: "none" }),
|
|
2361
|
+
/* @__PURE__ */ jsx22(Ellipse2, { cx: OROCHIA.head.cx, cy: OROCHIA.head.cy, rx: OROCHIA.head.rx, ry: OROCHIA.head.ry, rotation: OROCHIA.head.rotate, origin: `${OROCHIA.head.cx}, ${OROCHIA.head.cy}`, fill: "url(#body)" }),
|
|
2362
|
+
/* @__PURE__ */ jsx22(Path7, { d: OROCHIA.tongue.d, stroke: OROCHIA.tongue.color, strokeWidth: 3, strokeLinecap: "round", fill: "none" })
|
|
2134
2363
|
] })
|
|
2135
2364
|
] }),
|
|
2136
|
-
/* @__PURE__ */
|
|
2137
|
-
/* @__PURE__ */
|
|
2138
|
-
/* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ jsx22(Animated9.View, { style: [layer, { opacity: pulse.interpolate({ inputRange: [0, 1], outputRange: [0.85, 1] }) }], children: /* @__PURE__ */ jsxs19(Svg8, { viewBox, style: layer, children: [
|
|
2366
|
+
/* @__PURE__ */ jsx22(Defs5, { children: /* @__PURE__ */ jsx22(LinearGradient5, { id: "flame", x1: "50%", y1: "100%", x2: "50%", y2: "0%", children: OROCHIA.flameGradient.stops.map(([offset, color]) => /* @__PURE__ */ jsx22(Stop5, { offset, stopColor: color }, offset)) }) }),
|
|
2367
|
+
/* @__PURE__ */ jsxs19(Group2, { transform: `translate(${OROCHIA.offset} ${OROCHIA.offset})`, children: [
|
|
2368
|
+
/* @__PURE__ */ jsx22(Circle4, { cx: OROCHIA.eye.cx, cy: OROCHIA.eye.cy, r: OROCHIA.eye.r, fill: OROCHIA.eye.color }),
|
|
2369
|
+
/* @__PURE__ */ jsx22(Path7, { d: OROCHIA.flame.d, transform: `translate(${OROCHIA.flame.translate[0]} ${OROCHIA.flame.translate[1]}) scale(${OROCHIA.flame.scale})`, fill: "url(#flame)" })
|
|
2141
2370
|
] })
|
|
2142
2371
|
] }) })
|
|
2143
2372
|
] });
|
|
2144
2373
|
}
|
|
2145
2374
|
|
|
2146
2375
|
// src/native/pagination.tsx
|
|
2147
|
-
import { Pressable as
|
|
2148
|
-
import
|
|
2149
|
-
import { jsx as
|
|
2150
|
-
function
|
|
2151
|
-
return /* @__PURE__ */
|
|
2376
|
+
import { Pressable as Pressable9, StyleSheet as StyleSheet18, Text as Text13, View as View19 } from "react-native";
|
|
2377
|
+
import Svg9, { Path as Path8 } from "react-native-svg";
|
|
2378
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2379
|
+
function Chevron3({ direction, color }) {
|
|
2380
|
+
return /* @__PURE__ */ jsx23(Svg9, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx23(Path8, { d: direction === "left" ? "m15 6-6 6 6 6" : "m9 6 6 6-6 6" }) });
|
|
2152
2381
|
}
|
|
2153
2382
|
function Pagination({ page = 1, pageCount, onPageChange, hasPrevious, hasNext, onPrevious, onNext, status, disabled, labels, style }) {
|
|
2154
2383
|
const { theme, radius: radius3 } = useTheme();
|
|
@@ -2157,8 +2386,8 @@ function Pagination({ page = 1, pageCount, onPageChange, hasPrevious, hasNext, o
|
|
|
2157
2386
|
const current = Math.min(Math.max(1, page), count);
|
|
2158
2387
|
const canPrevious = !disabled && (paged ? current > 1 : Boolean(hasPrevious));
|
|
2159
2388
|
const canNext = !disabled && (paged ? current < count : Boolean(hasNext));
|
|
2160
|
-
const button = (direction, enabled, onPress, label) => /* @__PURE__ */
|
|
2161
|
-
|
|
2389
|
+
const button = (direction, enabled, onPress, label) => /* @__PURE__ */ jsx23(
|
|
2390
|
+
Pressable9,
|
|
2162
2391
|
{
|
|
2163
2392
|
role: "button",
|
|
2164
2393
|
"aria-label": label,
|
|
@@ -2167,29 +2396,29 @@ function Pagination({ page = 1, pageCount, onPageChange, hasPrevious, hasNext, o
|
|
|
2167
2396
|
hitSlop: 6,
|
|
2168
2397
|
onPress,
|
|
2169
2398
|
style: ({ pressed }) => [
|
|
2170
|
-
|
|
2399
|
+
styles18.button,
|
|
2171
2400
|
{ borderRadius: radius3.sm, borderColor: theme.borderDefault, backgroundColor: theme.surface1, opacity: enabled ? pressed ? 0.8 : 1 : 0.4 }
|
|
2172
2401
|
],
|
|
2173
|
-
children: /* @__PURE__ */
|
|
2402
|
+
children: /* @__PURE__ */ jsx23(Chevron3, { direction, color: theme.textPrimary })
|
|
2174
2403
|
}
|
|
2175
2404
|
);
|
|
2176
2405
|
const text = status ?? (paged ? labels.compact(current, count) : null);
|
|
2177
|
-
return /* @__PURE__ */
|
|
2406
|
+
return /* @__PURE__ */ jsxs20(View19, { role: "navigation", style: [styles18.row, style], children: [
|
|
2178
2407
|
button("left", canPrevious, paged ? () => onPageChange?.(current - 1) : onPrevious, labels.previous),
|
|
2179
|
-
text ? /* @__PURE__ */
|
|
2408
|
+
text ? /* @__PURE__ */ jsx23(Text13, { "aria-live": "polite", style: [styles18.status, { color: theme.textSecondary }], children: text }) : null,
|
|
2180
2409
|
button("right", canNext, paged ? () => onPageChange?.(current + 1) : onNext, labels.next)
|
|
2181
2410
|
] });
|
|
2182
2411
|
}
|
|
2183
|
-
var
|
|
2412
|
+
var styles18 = StyleSheet18.create({
|
|
2184
2413
|
row: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", gap: 12 },
|
|
2185
|
-
button: { width: 44, height: 44, alignItems: "center", justifyContent: "center", borderWidth:
|
|
2414
|
+
button: { width: 44, height: 44, alignItems: "center", justifyContent: "center", borderWidth: StyleSheet18.hairlineWidth },
|
|
2186
2415
|
status: { fontSize: 13, fontWeight: "600", fontVariant: ["tabular-nums"] }
|
|
2187
2416
|
});
|
|
2188
2417
|
|
|
2189
2418
|
// src/native/phoenix.tsx
|
|
2190
|
-
import { useEffect as
|
|
2191
|
-
import { AccessibilityInfo as AccessibilityInfo7, Animated as
|
|
2192
|
-
import
|
|
2419
|
+
import { useEffect as useEffect12, useState as useState18 } from "react";
|
|
2420
|
+
import { AccessibilityInfo as AccessibilityInfo7, Animated as Animated10, Easing as Easing6, View as View20 } from "react-native";
|
|
2421
|
+
import Svg10, { Circle as Circle5, Defs as Defs6, LinearGradient as LinearGradient6, Path as Path9, RadialGradient as RadialGradient4, Stop as Stop6 } from "react-native-svg";
|
|
2193
2422
|
|
|
2194
2423
|
// src/mascots/phoenix-geometry.ts
|
|
2195
2424
|
var PHOENIX = {
|
|
@@ -2212,17 +2441,17 @@ var PHOENIX_PALETTES = {
|
|
|
2212
2441
|
};
|
|
2213
2442
|
|
|
2214
2443
|
// src/native/phoenix.tsx
|
|
2215
|
-
import { jsx as
|
|
2444
|
+
import { jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2216
2445
|
function useFloat(animated) {
|
|
2217
|
-
const [y] =
|
|
2218
|
-
|
|
2446
|
+
const [y] = useState18(() => new Animated10.Value(0));
|
|
2447
|
+
useEffect12(() => {
|
|
2219
2448
|
if (!animated) return;
|
|
2220
2449
|
let loop;
|
|
2221
2450
|
let cancelled = false;
|
|
2222
2451
|
void AccessibilityInfo7.isReduceMotionEnabled().then((reduce) => {
|
|
2223
2452
|
if (reduce || cancelled) return;
|
|
2224
|
-
const step = (toValue) =>
|
|
2225
|
-
loop =
|
|
2453
|
+
const step = (toValue) => Animated10.timing(y, { toValue, duration: 2500, easing: Easing6.inOut(Easing6.ease), useNativeDriver: true });
|
|
2454
|
+
loop = Animated10.loop(Animated10.sequence([step(-6), step(0)]));
|
|
2226
2455
|
loop.start();
|
|
2227
2456
|
});
|
|
2228
2457
|
return () => {
|
|
@@ -2237,36 +2466,36 @@ function Phoenix({ tone: tone2 = "own", size = 120, animated = true, title, styl
|
|
|
2237
2466
|
const id = useSvgId("kzp");
|
|
2238
2467
|
const y = useFloat(animated);
|
|
2239
2468
|
const p = tone2 === "brand" ? { left: [theme.accent2, theme.accent], right: [theme.accent, theme.accent2], core: ["#ffffff", theme.accent], body: theme.surface3, edge: theme.borderStrong, crest: theme.accent } : PHOENIX_PALETTES.own;
|
|
2240
|
-
return /* @__PURE__ */
|
|
2241
|
-
/* @__PURE__ */
|
|
2242
|
-
/* @__PURE__ */
|
|
2243
|
-
/* @__PURE__ */
|
|
2244
|
-
/* @__PURE__ */
|
|
2469
|
+
return /* @__PURE__ */ jsx24(View20, { style: [{ width: size, height: size }, style], ...markA11y(title), children: /* @__PURE__ */ jsx24(Animated10.View, { style: { transform: [{ translateY: y }] }, children: /* @__PURE__ */ jsxs21(Svg10, { width: size, height: size, viewBox: "0 0 120 120", children: [
|
|
2470
|
+
/* @__PURE__ */ jsxs21(Defs6, { children: [
|
|
2471
|
+
/* @__PURE__ */ jsxs21(LinearGradient6, { id: `${id}l`, x1: "1", y1: "0", x2: "0", y2: "1", children: [
|
|
2472
|
+
/* @__PURE__ */ jsx24(Stop6, { offset: "0%", stopColor: p.left[0] }),
|
|
2473
|
+
/* @__PURE__ */ jsx24(Stop6, { offset: "100%", stopColor: p.left[1] })
|
|
2245
2474
|
] }),
|
|
2246
|
-
/* @__PURE__ */
|
|
2247
|
-
/* @__PURE__ */
|
|
2248
|
-
/* @__PURE__ */
|
|
2475
|
+
/* @__PURE__ */ jsxs21(LinearGradient6, { id: `${id}r`, x1: "0", y1: "0", x2: "1", y2: "1", children: [
|
|
2476
|
+
/* @__PURE__ */ jsx24(Stop6, { offset: "0%", stopColor: p.right[0] }),
|
|
2477
|
+
/* @__PURE__ */ jsx24(Stop6, { offset: "100%", stopColor: p.right[1] })
|
|
2249
2478
|
] }),
|
|
2250
|
-
/* @__PURE__ */
|
|
2251
|
-
/* @__PURE__ */
|
|
2252
|
-
/* @__PURE__ */
|
|
2479
|
+
/* @__PURE__ */ jsxs21(RadialGradient4, { id: `${id}c`, children: [
|
|
2480
|
+
/* @__PURE__ */ jsx24(Stop6, { offset: "0%", stopColor: p.core[0] }),
|
|
2481
|
+
/* @__PURE__ */ jsx24(Stop6, { offset: "100%", stopColor: p.core[1], stopOpacity: 0 })
|
|
2253
2482
|
] })
|
|
2254
2483
|
] }),
|
|
2255
|
-
/* @__PURE__ */
|
|
2256
|
-
/* @__PURE__ */
|
|
2257
|
-
/* @__PURE__ */
|
|
2258
|
-
/* @__PURE__ */
|
|
2259
|
-
/* @__PURE__ */
|
|
2260
|
-
/* @__PURE__ */
|
|
2261
|
-
/* @__PURE__ */
|
|
2262
|
-
/* @__PURE__ */
|
|
2484
|
+
/* @__PURE__ */ jsx24(Path9, { d: PHOENIX.wingL, fill: `url(#${id}l)` }),
|
|
2485
|
+
/* @__PURE__ */ jsx24(Path9, { d: PHOENIX.wingR, fill: `url(#${id}r)` }),
|
|
2486
|
+
/* @__PURE__ */ jsx24(Path9, { d: PHOENIX.tailL, fill: `url(#${id}l)`, opacity: 0.7 }),
|
|
2487
|
+
/* @__PURE__ */ jsx24(Path9, { d: PHOENIX.tailR, fill: `url(#${id}r)`, opacity: 0.7 }),
|
|
2488
|
+
/* @__PURE__ */ jsx24(Path9, { d: PHOENIX.body, fill: p.body, stroke: p.edge, strokeOpacity: 0.5 }),
|
|
2489
|
+
/* @__PURE__ */ jsx24(Circle5, { cx: 60, cy: 58, r: 12, fill: `url(#${id}c)` }),
|
|
2490
|
+
/* @__PURE__ */ jsx24(Circle5, { cx: 60, cy: 58, r: 3.5, fill: "#ffffff" }),
|
|
2491
|
+
/* @__PURE__ */ jsx24(Path9, { d: PHOENIX.crest, stroke: p.crest, strokeWidth: 2, strokeLinecap: "round" })
|
|
2263
2492
|
] }) }) });
|
|
2264
2493
|
}
|
|
2265
2494
|
|
|
2266
2495
|
// src/native/YazakiaMark.tsx
|
|
2267
|
-
import
|
|
2268
|
-
import { View as
|
|
2269
|
-
import
|
|
2496
|
+
import React19 from "react";
|
|
2497
|
+
import { View as View21 } from "react-native";
|
|
2498
|
+
import Svg11, { Circle as Circle6, Defs as Defs7, LinearGradient as LinearGradient7, Path as Path10, RadialGradient as RadialGradient5, Stop as Stop7 } from "react-native-svg";
|
|
2270
2499
|
|
|
2271
2500
|
// src/marks/yazakia-geometry.ts
|
|
2272
2501
|
var turquoise = marks.yazakia[marks.yazakia.length - 1][1];
|
|
@@ -2296,54 +2525,54 @@ var YAZAKIA = {
|
|
|
2296
2525
|
};
|
|
2297
2526
|
|
|
2298
2527
|
// src/native/YazakiaMark.tsx
|
|
2299
|
-
import { jsx as
|
|
2528
|
+
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2300
2529
|
function YazakiaMark({ size = 48, animated = true, title, neutral }) {
|
|
2301
2530
|
const { theme } = useTheme();
|
|
2302
|
-
const { Animated:
|
|
2531
|
+
const { Animated: Animated17, layer, spinStyle, pulseStyle } = useMarkMotion(size, animated);
|
|
2303
2532
|
const id = useSvgId("yzm");
|
|
2304
2533
|
const viewBox = size < 48 ? YAZAKIA.croppedViewBox : YAZAKIA.viewBox;
|
|
2305
2534
|
const stroke = neutral ?? theme.textMuted;
|
|
2306
|
-
const gradient = /* @__PURE__ */
|
|
2535
|
+
const gradient = /* @__PURE__ */ jsx25(LinearGradient7, { id: `${id}a`, gradientUnits: "userSpaceOnUse", x1: YAZAKIA.gradient.x1, y1: YAZAKIA.gradient.y1, x2: YAZAKIA.gradient.x2, y2: YAZAKIA.gradient.y2, children: YAZAKIA.gradient.stops.map(([offset, color]) => /* @__PURE__ */ jsx25(Stop7, { offset, stopColor: color }, offset)) });
|
|
2307
2536
|
const fill = `url(#${id}a)`;
|
|
2308
|
-
return /* @__PURE__ */
|
|
2309
|
-
/* @__PURE__ */
|
|
2310
|
-
/* @__PURE__ */
|
|
2311
|
-
/* @__PURE__ */
|
|
2312
|
-
/* @__PURE__ */
|
|
2313
|
-
/* @__PURE__ */
|
|
2537
|
+
return /* @__PURE__ */ jsxs22(View21, { style: { width: size, height: size }, ...markA11y(title), children: [
|
|
2538
|
+
/* @__PURE__ */ jsxs22(Svg11, { viewBox, style: layer, children: [
|
|
2539
|
+
/* @__PURE__ */ jsxs22(Defs7, { children: [
|
|
2540
|
+
/* @__PURE__ */ jsxs22(RadialGradient5, { id: `${id}g`, cx: "50%", cy: "50%", r: "50%", children: [
|
|
2541
|
+
/* @__PURE__ */ jsx25(Stop7, { offset: "0%", stopColor: YAZAKIA.glow.color, stopOpacity: YAZAKIA.glow.opacity }),
|
|
2542
|
+
/* @__PURE__ */ jsx25(Stop7, { offset: "100%", stopColor: YAZAKIA.glow.color, stopOpacity: 0 })
|
|
2314
2543
|
] }),
|
|
2315
2544
|
gradient
|
|
2316
2545
|
] }),
|
|
2317
|
-
size >= 48 ? /* @__PURE__ */
|
|
2318
|
-
/* @__PURE__ */
|
|
2319
|
-
YAZAKIA.voices.map((v, i) => /* @__PURE__ */
|
|
2320
|
-
/* @__PURE__ */
|
|
2321
|
-
/* @__PURE__ */
|
|
2322
|
-
i === 0 ? /* @__PURE__ */
|
|
2546
|
+
size >= 48 ? /* @__PURE__ */ jsx25(Circle6, { cx: YAZAKIA.center, cy: YAZAKIA.center, r: 190, fill: `url(#${id}g)` }) : null,
|
|
2547
|
+
/* @__PURE__ */ jsx25(Circle6, { cx: YAZAKIA.center, cy: YAZAKIA.center, r: YAZAKIA.ring.r, stroke, strokeWidth: YAZAKIA.ring.width, opacity: 0.35, fill: "none" }),
|
|
2548
|
+
YAZAKIA.voices.map((v, i) => /* @__PURE__ */ jsxs22(React19.Fragment, { children: [
|
|
2549
|
+
/* @__PURE__ */ jsx25(Path10, { d: v.body, fill }),
|
|
2550
|
+
/* @__PURE__ */ jsx25(Path10, { d: v.tail, fill }),
|
|
2551
|
+
i === 0 ? /* @__PURE__ */ jsx25(Path10, { d: `${v.body} ${v.tail}`, fill: YAZAKIA.shade.color, opacity: YAZAKIA.shade.opacity }) : null
|
|
2323
2552
|
] }, v.body))
|
|
2324
2553
|
] }),
|
|
2325
|
-
/* @__PURE__ */
|
|
2326
|
-
/* @__PURE__ */
|
|
2327
|
-
/* @__PURE__ */
|
|
2328
|
-
YAZAKIA.pair.at.map(([cx, cy]) => /* @__PURE__ */
|
|
2554
|
+
/* @__PURE__ */ jsx25(Animated17.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsxs22(Svg11, { viewBox, style: layer, children: [
|
|
2555
|
+
/* @__PURE__ */ jsx25(Defs7, { children: gradient }),
|
|
2556
|
+
/* @__PURE__ */ jsx25(Circle6, { cx: YAZAKIA.center, cy: YAZAKIA.center, r: YAZAKIA.orbit.r, stroke, strokeWidth: YAZAKIA.orbit.width, strokeDasharray: YAZAKIA.orbit.dash, opacity: 0.6, fill: "none" }),
|
|
2557
|
+
YAZAKIA.pair.at.map(([cx, cy]) => /* @__PURE__ */ jsx25(Circle6, { cx, cy, r: YAZAKIA.pair.r, fill }, cx))
|
|
2329
2558
|
] }) }),
|
|
2330
|
-
/* @__PURE__ */
|
|
2331
|
-
/* @__PURE__ */
|
|
2559
|
+
/* @__PURE__ */ jsx25(Animated17.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs22(Svg11, { viewBox, style: layer, children: [
|
|
2560
|
+
/* @__PURE__ */ jsxs22(Defs7, { children: [
|
|
2332
2561
|
gradient,
|
|
2333
|
-
/* @__PURE__ */
|
|
2334
|
-
/* @__PURE__ */
|
|
2335
|
-
/* @__PURE__ */
|
|
2562
|
+
/* @__PURE__ */ jsxs22(LinearGradient7, { id: `${id}l`, gradientUnits: "userSpaceOnUse", x1: 0, y1: YAZAKIA.lens.y1, x2: 0, y2: YAZAKIA.lens.y2, children: [
|
|
2563
|
+
/* @__PURE__ */ jsx25(Stop7, { offset: "0%", stopColor: YAZAKIA.highlight.color, stopOpacity: YAZAKIA.highlight.from }),
|
|
2564
|
+
/* @__PURE__ */ jsx25(Stop7, { offset: "100%", stopColor: YAZAKIA.highlight.color, stopOpacity: YAZAKIA.highlight.to })
|
|
2336
2565
|
] })
|
|
2337
2566
|
] }),
|
|
2338
|
-
/* @__PURE__ */
|
|
2339
|
-
/* @__PURE__ */
|
|
2567
|
+
/* @__PURE__ */ jsx25(Path10, { d: YAZAKIA.lens.d, fill }),
|
|
2568
|
+
/* @__PURE__ */ jsx25(Path10, { d: YAZAKIA.lens.d, fill: `url(#${id}l)` })
|
|
2340
2569
|
] }) })
|
|
2341
2570
|
] });
|
|
2342
2571
|
}
|
|
2343
2572
|
|
|
2344
2573
|
// src/native/YororisMark.tsx
|
|
2345
|
-
import { View as
|
|
2346
|
-
import
|
|
2574
|
+
import { View as View22 } from "react-native";
|
|
2575
|
+
import Svg12, { Circle as Circle7, Defs as Defs8, LinearGradient as LinearGradient8, Path as Path11, RadialGradient as RadialGradient6, Stop as Stop8 } from "react-native-svg";
|
|
2347
2576
|
|
|
2348
2577
|
// src/marks/yororis-geometry.ts
|
|
2349
2578
|
var sand = marks.yororis[0][1];
|
|
@@ -2379,65 +2608,65 @@ var YORORIS = {
|
|
|
2379
2608
|
};
|
|
2380
2609
|
|
|
2381
2610
|
// src/native/YororisMark.tsx
|
|
2382
|
-
import { jsx as
|
|
2611
|
+
import { jsx as jsx26, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2383
2612
|
function YororisMark({ size = 48, animated = true, title, neutral }) {
|
|
2384
2613
|
const { theme } = useTheme();
|
|
2385
|
-
const { Animated:
|
|
2614
|
+
const { Animated: Animated17, layer, spinStyle, pulseStyle } = useMarkMotion(size, animated, 36e3);
|
|
2386
2615
|
const id = useSvgId("yrm");
|
|
2387
2616
|
const viewBox = size < 48 ? YORORIS.croppedViewBox : YORORIS.viewBox;
|
|
2388
2617
|
const stroke = neutral ?? theme.textMuted;
|
|
2389
|
-
const gradient = /* @__PURE__ */
|
|
2618
|
+
const gradient = /* @__PURE__ */ jsx26(LinearGradient8, { id: `${id}a`, gradientUnits: "userSpaceOnUse", x1: YORORIS.gradient.x1, y1: YORORIS.gradient.y1, x2: YORORIS.gradient.x2, y2: YORORIS.gradient.y2, children: YORORIS.gradient.stops.map(([offset, color]) => /* @__PURE__ */ jsx26(Stop8, { offset, stopColor: color }, offset)) });
|
|
2390
2619
|
const fill = `url(#${id}a)`;
|
|
2391
|
-
return /* @__PURE__ */
|
|
2392
|
-
/* @__PURE__ */
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
/* @__PURE__ */
|
|
2395
|
-
/* @__PURE__ */
|
|
2396
|
-
/* @__PURE__ */
|
|
2620
|
+
return /* @__PURE__ */ jsxs23(View22, { style: { width: size, height: size }, ...markA11y(title), children: [
|
|
2621
|
+
/* @__PURE__ */ jsxs23(Svg12, { viewBox, style: layer, children: [
|
|
2622
|
+
/* @__PURE__ */ jsxs23(Defs8, { children: [
|
|
2623
|
+
/* @__PURE__ */ jsxs23(RadialGradient6, { id: `${id}g`, cx: "50%", cy: "50%", r: "50%", children: [
|
|
2624
|
+
/* @__PURE__ */ jsx26(Stop8, { offset: "0%", stopColor: YORORIS.glow.color, stopOpacity: YORORIS.glow.opacity }),
|
|
2625
|
+
/* @__PURE__ */ jsx26(Stop8, { offset: "100%", stopColor: YORORIS.glow.color, stopOpacity: 0 })
|
|
2397
2626
|
] }),
|
|
2398
2627
|
gradient
|
|
2399
2628
|
] }),
|
|
2400
|
-
size >= 48 ? /* @__PURE__ */
|
|
2401
|
-
/* @__PURE__ */
|
|
2402
|
-
/* @__PURE__ */
|
|
2403
|
-
YORORIS.leaves.map((d) => /* @__PURE__ */
|
|
2404
|
-
/* @__PURE__ */
|
|
2629
|
+
size >= 48 ? /* @__PURE__ */ jsx26(Circle7, { cx: YORORIS.center, cy: YORORIS.center, r: 190, fill: `url(#${id}g)` }) : null,
|
|
2630
|
+
/* @__PURE__ */ jsx26(Circle7, { cx: YORORIS.center, cy: YORORIS.center, r: YORORIS.ring.r, stroke, strokeWidth: YORORIS.ring.width, opacity: 0.35, fill: "none" }),
|
|
2631
|
+
/* @__PURE__ */ jsx26(Path11, { d: YORORIS.stem, stroke: fill, strokeWidth: YORORIS.stroke, strokeLinecap: "round", fill: "none" }),
|
|
2632
|
+
YORORIS.leaves.map((d) => /* @__PURE__ */ jsx26(Path11, { d, fill }, d)),
|
|
2633
|
+
/* @__PURE__ */ jsx26(Path11, { d: YORORIS.veins, stroke: YORORIS.vein.color, strokeOpacity: YORORIS.vein.opacity, strokeWidth: YORORIS.vein.width, strokeLinecap: "round", strokeDasharray: YORORIS.vein.dash, fill: "none" })
|
|
2405
2634
|
] }),
|
|
2406
|
-
/* @__PURE__ */
|
|
2407
|
-
/* @__PURE__ */
|
|
2408
|
-
/* @__PURE__ */
|
|
2409
|
-
/* @__PURE__ */
|
|
2635
|
+
/* @__PURE__ */ jsx26(Animated17.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsxs23(Svg12, { viewBox, style: layer, children: [
|
|
2636
|
+
/* @__PURE__ */ jsx26(Defs8, { children: gradient }),
|
|
2637
|
+
/* @__PURE__ */ jsx26(Circle7, { cx: YORORIS.center, cy: YORORIS.center, r: YORORIS.orbit.r, stroke, strokeWidth: YORORIS.orbit.width, strokeDasharray: YORORIS.orbit.dash, opacity: 0.6, fill: "none" }),
|
|
2638
|
+
/* @__PURE__ */ jsx26(Circle7, { cx: YORORIS.moment.at[0], cy: YORORIS.moment.at[1], r: YORORIS.moment.r, fill })
|
|
2410
2639
|
] }) }),
|
|
2411
|
-
/* @__PURE__ */
|
|
2412
|
-
/* @__PURE__ */
|
|
2413
|
-
/* @__PURE__ */
|
|
2414
|
-
/* @__PURE__ */
|
|
2640
|
+
/* @__PURE__ */ jsx26(Animated17.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs23(Svg12, { viewBox, style: layer, children: [
|
|
2641
|
+
/* @__PURE__ */ jsx26(Defs8, { children: /* @__PURE__ */ jsx26(LinearGradient8, { id: `${id}c`, x1: "50%", y1: "100%", x2: "50%", y2: "0%", children: YORORIS.coreGradient.stops.map(([offset, color]) => /* @__PURE__ */ jsx26(Stop8, { offset, stopColor: color }, offset)) }) }),
|
|
2642
|
+
/* @__PURE__ */ jsx26(Circle7, { cx: YORORIS.core.cx, cy: YORORIS.core.cy, r: YORORIS.core.r, fill: `url(#${id}c)` }),
|
|
2643
|
+
/* @__PURE__ */ jsx26(Circle7, { cx: YORORIS.core.cx, cy: YORORIS.core.cy, r: YORORIS.core.inner, fill: YORORIS.highlight })
|
|
2415
2644
|
] }) })
|
|
2416
2645
|
] });
|
|
2417
2646
|
}
|
|
2418
2647
|
|
|
2419
2648
|
// src/native/ProductMark.tsx
|
|
2420
|
-
import { jsx as
|
|
2649
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2421
2650
|
function ProductMark({ id, ...props }) {
|
|
2422
|
-
if (id === "krizaka") return /* @__PURE__ */
|
|
2423
|
-
if (id === "orazaka") return /* @__PURE__ */
|
|
2424
|
-
if (id === "yazakia") return /* @__PURE__ */
|
|
2425
|
-
if (id === "yororis") return /* @__PURE__ */
|
|
2426
|
-
return /* @__PURE__ */
|
|
2651
|
+
if (id === "krizaka") return /* @__PURE__ */ jsx27(KrizakaMark, { ...props });
|
|
2652
|
+
if (id === "orazaka") return /* @__PURE__ */ jsx27(OrazakaMark, { ...props });
|
|
2653
|
+
if (id === "yazakia") return /* @__PURE__ */ jsx27(YazakiaMark, { ...props });
|
|
2654
|
+
if (id === "yororis") return /* @__PURE__ */ jsx27(YororisMark, { ...props });
|
|
2655
|
+
return /* @__PURE__ */ jsx27(OrochiaMark, { ...props });
|
|
2427
2656
|
}
|
|
2428
2657
|
|
|
2429
2658
|
// src/native/profile-card.tsx
|
|
2430
|
-
import * as
|
|
2431
|
-
import { Animated as
|
|
2432
|
-
import { jsx as
|
|
2659
|
+
import * as React20 from "react";
|
|
2660
|
+
import { Animated as Animated11, StyleSheet as StyleSheet19, View as View23 } from "react-native";
|
|
2661
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2433
2662
|
var ratioOf = (value, max = 100) => Math.min(1, Math.max(0, value / (max || 1)));
|
|
2434
2663
|
function Bar({ label, ratio, words, animated, delay }) {
|
|
2435
2664
|
const { theme } = useTheme();
|
|
2436
2665
|
const t = useEntrance(animated, delay, 900);
|
|
2437
|
-
const [width, setWidth] =
|
|
2666
|
+
const [width, setWidth] = React20.useState(0);
|
|
2438
2667
|
const translateX = t.interpolate({ inputRange: [0, 1], outputRange: [-width * ratio, 0] });
|
|
2439
|
-
return /* @__PURE__ */
|
|
2440
|
-
|
|
2668
|
+
return /* @__PURE__ */ jsx28(
|
|
2669
|
+
View23,
|
|
2441
2670
|
{
|
|
2442
2671
|
accessible: true,
|
|
2443
2672
|
role: "meter",
|
|
@@ -2447,42 +2676,42 @@ function Bar({ label, ratio, words, animated, delay }) {
|
|
|
2447
2676
|
"aria-valuenow": Math.round(ratio * 100),
|
|
2448
2677
|
"aria-valuetext": words,
|
|
2449
2678
|
onLayout: (e) => setWidth(e.nativeEvent.layout.width),
|
|
2450
|
-
style: [
|
|
2451
|
-
children: /* @__PURE__ */
|
|
2679
|
+
style: [styles19.track, { backgroundColor: theme.surface3 }],
|
|
2680
|
+
children: /* @__PURE__ */ jsx28(Animated11.View, { style: [styles19.fill, { width: `${ratio * 100}%`, backgroundColor: theme.accent, transform: [{ translateX }] }] })
|
|
2452
2681
|
}
|
|
2453
2682
|
);
|
|
2454
2683
|
}
|
|
2455
2684
|
function ProfileCard({ visual, name, statLabel, value = 100, valueText, stats, caption, children, animated = true, style, ...props }) {
|
|
2456
2685
|
const { theme, radius: radius3 } = useTheme();
|
|
2457
2686
|
const ratio = ratioOf(value);
|
|
2458
|
-
return /* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */
|
|
2462
|
-
statLabel ? /* @__PURE__ */
|
|
2687
|
+
return /* @__PURE__ */ jsxs24(View23, { ...props, style: [styles19.root, { backgroundColor: theme.surface1, borderColor: theme.borderSubtle, borderRadius: radius3.xl }, style], children: [
|
|
2688
|
+
/* @__PURE__ */ jsx28(View23, { "aria-hidden": true, style: [styles19.disc, { backgroundColor: theme.surface2, borderColor: theme.accentSoft }], children: visual }),
|
|
2689
|
+
/* @__PURE__ */ jsxs24(View23, { style: styles19.head, children: [
|
|
2690
|
+
/* @__PURE__ */ jsx28(Txt, { variant: "title", style: styles19.name, children: name }),
|
|
2691
|
+
statLabel ? /* @__PURE__ */ jsxs24(Txt, { variant: "caption", tone: "secondary", children: [
|
|
2463
2692
|
statLabel,
|
|
2464
2693
|
" ",
|
|
2465
|
-
/* @__PURE__ */
|
|
2694
|
+
/* @__PURE__ */ jsx28(Txt, { variant: "caption", children: valueText ?? `${Math.round(ratio * 100)} %` })
|
|
2466
2695
|
] }) : null
|
|
2467
2696
|
] }),
|
|
2468
|
-
statLabel ? /* @__PURE__ */
|
|
2697
|
+
statLabel ? /* @__PURE__ */ jsx28(Bar, { label: statLabel, ratio, words: valueText ?? `${Math.round(ratio * 100)} %`, animated, delay: 200 }) : null,
|
|
2469
2698
|
stats?.map((s, i) => {
|
|
2470
2699
|
const r = ratioOf(s.value, s.max);
|
|
2471
2700
|
const words = s.valueText ?? `${Math.round(r * 100)} %`;
|
|
2472
|
-
return /* @__PURE__ */
|
|
2473
|
-
/* @__PURE__ */
|
|
2474
|
-
/* @__PURE__ */
|
|
2475
|
-
/* @__PURE__ */
|
|
2701
|
+
return /* @__PURE__ */ jsxs24(View23, { style: styles19.stat, children: [
|
|
2702
|
+
/* @__PURE__ */ jsxs24(View23, { "aria-hidden": true, style: styles19.statHead, children: [
|
|
2703
|
+
/* @__PURE__ */ jsx28(Txt, { variant: "caption", tone: "secondary", children: s.label }),
|
|
2704
|
+
/* @__PURE__ */ jsx28(Txt, { variant: "caption", children: words })
|
|
2476
2705
|
] }),
|
|
2477
|
-
/* @__PURE__ */
|
|
2706
|
+
/* @__PURE__ */ jsx28(Bar, { label: s.label, ratio: r, words, animated, delay: 320 + i * 120 })
|
|
2478
2707
|
] }, s.label);
|
|
2479
2708
|
}),
|
|
2480
|
-
caption ? /* @__PURE__ */
|
|
2481
|
-
children ? /* @__PURE__ */
|
|
2709
|
+
caption ? /* @__PURE__ */ jsx28(Txt, { variant: "caption", tone: "secondary", style: styles19.caption, children: caption }) : null,
|
|
2710
|
+
children ? /* @__PURE__ */ jsx28(View23, { style: styles19.extra, children }) : null
|
|
2482
2711
|
] });
|
|
2483
2712
|
}
|
|
2484
|
-
var
|
|
2485
|
-
root: { alignItems: "center", gap: 12, padding: 20, borderWidth:
|
|
2713
|
+
var styles19 = StyleSheet19.create({
|
|
2714
|
+
root: { alignItems: "center", gap: 12, padding: 20, borderWidth: StyleSheet19.hairlineWidth },
|
|
2486
2715
|
disc: { width: 104, height: 104, borderRadius: 52, borderWidth: 1, alignItems: "center", justifyContent: "center", overflow: "hidden" },
|
|
2487
2716
|
head: { flexDirection: "row", alignSelf: "stretch", alignItems: "center", justifyContent: "space-between", gap: 8 },
|
|
2488
2717
|
name: { flexShrink: 1, fontSize: 17 },
|
|
@@ -2495,11 +2724,11 @@ var styles17 = StyleSheet17.create({
|
|
|
2495
2724
|
});
|
|
2496
2725
|
|
|
2497
2726
|
// src/native/progress.tsx
|
|
2498
|
-
import * as
|
|
2499
|
-
import { Animated as
|
|
2500
|
-
import
|
|
2501
|
-
import { jsx as
|
|
2502
|
-
var AnimatedCircle =
|
|
2727
|
+
import * as React21 from "react";
|
|
2728
|
+
import { Animated as Animated12, Easing as Easing7, StyleSheet as StyleSheet20, View as View24 } from "react-native";
|
|
2729
|
+
import Svg13, { Circle as Circle8, Defs as Defs9, LinearGradient as LinearGradient9, Rect as Rect3, Stop as Stop9 } from "react-native-svg";
|
|
2730
|
+
import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2731
|
+
var AnimatedCircle = Animated12.createAnimatedComponent(Circle8);
|
|
2503
2732
|
var BAR = { sm: 4, md: 8, lg: 12 };
|
|
2504
2733
|
var RING = { sm: 40, md: 80, lg: 144 };
|
|
2505
2734
|
var STROKE = { sm: 12, md: 9, lg: 7 };
|
|
@@ -2510,21 +2739,21 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
2510
2739
|
const known = typeof value === "number" && Number.isFinite(value);
|
|
2511
2740
|
const ratio = known ? Math.min(1, Math.max(0, value / (max || 1))) : 0;
|
|
2512
2741
|
const percent = Math.round(ratio * 100);
|
|
2513
|
-
const [progress] =
|
|
2514
|
-
const [spin] =
|
|
2515
|
-
const [track, setTrack] =
|
|
2516
|
-
|
|
2742
|
+
const [progress] = React21.useState(() => new Animated12.Value(ratio));
|
|
2743
|
+
const [spin] = React21.useState(() => new Animated12.Value(0));
|
|
2744
|
+
const [track, setTrack] = React21.useState(0);
|
|
2745
|
+
React21.useEffect(() => {
|
|
2517
2746
|
if (reduce) {
|
|
2518
2747
|
progress.setValue(ratio);
|
|
2519
2748
|
return;
|
|
2520
2749
|
}
|
|
2521
|
-
const animation =
|
|
2750
|
+
const animation = Animated12.timing(progress, { toValue: ratio, duration: 700, easing: Easing7.out(Easing7.cubic), useNativeDriver: false });
|
|
2522
2751
|
animation.start();
|
|
2523
2752
|
return () => animation.stop();
|
|
2524
2753
|
}, [ratio, reduce, progress]);
|
|
2525
|
-
|
|
2754
|
+
React21.useEffect(() => {
|
|
2526
2755
|
if (known || reduce) return;
|
|
2527
|
-
const loop =
|
|
2756
|
+
const loop = Animated12.loop(Animated12.timing(spin, { toValue: 1, duration: 1200, easing: Easing7.linear, useNativeDriver: true }));
|
|
2528
2757
|
loop.start();
|
|
2529
2758
|
return () => {
|
|
2530
2759
|
loop.stop();
|
|
@@ -2540,9 +2769,9 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
2540
2769
|
"aria-valuenow": known ? Math.min(max, Math.max(0, value)) : void 0,
|
|
2541
2770
|
"aria-valuetext": known ? valueText ?? `${percent}%` : valueText
|
|
2542
2771
|
};
|
|
2543
|
-
const gradient = /* @__PURE__ */
|
|
2544
|
-
/* @__PURE__ */
|
|
2545
|
-
/* @__PURE__ */
|
|
2772
|
+
const gradient = /* @__PURE__ */ jsx29(Defs9, { children: /* @__PURE__ */ jsxs25(LinearGradient9, { id, x1: "0", y1: "0", x2: "1", y2: variant === "ring" ? "1" : "0", children: [
|
|
2773
|
+
/* @__PURE__ */ jsx29(Stop9, { offset: "0", stopColor: theme.accent }),
|
|
2774
|
+
/* @__PURE__ */ jsx29(Stop9, { offset: "1", stopColor: theme.accent2 })
|
|
2546
2775
|
] }) });
|
|
2547
2776
|
if (variant === "ring") {
|
|
2548
2777
|
const side = RING[size];
|
|
@@ -2551,11 +2780,11 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
2551
2780
|
const circumference = 2 * Math.PI * r;
|
|
2552
2781
|
const offset = known ? progress.interpolate({ inputRange: [0, 1], outputRange: [circumference, 0] }) : circumference * 0.75;
|
|
2553
2782
|
const rotate = spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] });
|
|
2554
|
-
return /* @__PURE__ */
|
|
2555
|
-
/* @__PURE__ */
|
|
2783
|
+
return /* @__PURE__ */ jsxs25(View24, { ...a11y, style: [styles20.ring, { width: side, height: side }, style], children: [
|
|
2784
|
+
/* @__PURE__ */ jsx29(Animated12.View, { style: [StyleSheet20.absoluteFill, { transform: [{ rotate: known ? "-90deg" : rotate }] }], children: /* @__PURE__ */ jsxs25(Svg13, { width: side, height: side, viewBox: "0 0 100 100", children: [
|
|
2556
2785
|
gradient,
|
|
2557
|
-
/* @__PURE__ */
|
|
2558
|
-
/* @__PURE__ */
|
|
2786
|
+
/* @__PURE__ */ jsx29(Circle8, { cx: 50, cy: 50, r, fill: "none", stroke: theme.borderDefault, strokeWidth: stroke }),
|
|
2787
|
+
/* @__PURE__ */ jsx29(
|
|
2559
2788
|
AnimatedCircle,
|
|
2560
2789
|
{
|
|
2561
2790
|
cx: 50,
|
|
@@ -2575,49 +2804,200 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
2575
2804
|
}
|
|
2576
2805
|
const width = known ? progress.interpolate({ inputRange: [0, 1], outputRange: ["0%", "100%"] }) : "40%";
|
|
2577
2806
|
const translate = spin.interpolate({ inputRange: [0, 1], outputRange: [-0.4 * track, track] });
|
|
2578
|
-
return /* @__PURE__ */
|
|
2579
|
-
|
|
2807
|
+
return /* @__PURE__ */ jsx29(
|
|
2808
|
+
View24,
|
|
2580
2809
|
{
|
|
2581
2810
|
...a11y,
|
|
2582
2811
|
onLayout: known ? void 0 : (event) => setTrack(event.nativeEvent.layout.width),
|
|
2583
|
-
style: [
|
|
2584
|
-
children: /* @__PURE__ */
|
|
2812
|
+
style: [styles20.bar, { height: BAR[size], backgroundColor: theme.surface3 }, style],
|
|
2813
|
+
children: /* @__PURE__ */ jsx29(Animated12.View, { style: [styles20.fill, { width }, known || reduce ? null : { transform: [{ translateX: translate }] }], children: /* @__PURE__ */ jsxs25(Svg13, { width: "100%", height: "100%", preserveAspectRatio: "none", children: [
|
|
2585
2814
|
gradient,
|
|
2586
|
-
/* @__PURE__ */
|
|
2815
|
+
/* @__PURE__ */ jsx29(Rect3, { x: 0, y: 0, width: "100%", height: "100%", fill: `url(#${id})` })
|
|
2587
2816
|
] }) })
|
|
2588
2817
|
}
|
|
2589
2818
|
);
|
|
2590
2819
|
}
|
|
2591
|
-
var
|
|
2820
|
+
var styles20 = StyleSheet20.create({
|
|
2592
2821
|
ring: { alignItems: "center", justifyContent: "center" },
|
|
2593
2822
|
bar: { width: "100%", overflow: "hidden", borderRadius: 9999 },
|
|
2594
2823
|
fill: { height: "100%", overflow: "hidden", borderRadius: 9999 }
|
|
2595
2824
|
});
|
|
2596
2825
|
|
|
2826
|
+
// src/native/radio-group.tsx
|
|
2827
|
+
import * as React22 from "react";
|
|
2828
|
+
import { Animated as Animated13, Pressable as Pressable10, StyleSheet as StyleSheet21, Text as Text14, View as View25 } from "react-native";
|
|
2829
|
+
import Svg14, { Path as Path12 } from "react-native-svg";
|
|
2830
|
+
import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2831
|
+
function Check({ color }) {
|
|
2832
|
+
return /* @__PURE__ */ jsx30(Svg14, { 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__ */ jsx30(Path12, { d: "M20 6 9 17l-5-5" }) });
|
|
2833
|
+
}
|
|
2834
|
+
function Key({ option, checked, disabled, onPress }) {
|
|
2835
|
+
const { theme, radius: radius3, motion: motion3 } = useTheme();
|
|
2836
|
+
const [held, setHeld] = React22.useState(false);
|
|
2837
|
+
const [sink] = React22.useState(() => new Animated13.Value(checked ? 1 : 0));
|
|
2838
|
+
const down = checked || held;
|
|
2839
|
+
React22.useEffect(() => {
|
|
2840
|
+
Animated13.timing(sink, { toValue: down ? 1 : 0, duration: motion3.duration.fast, useNativeDriver: true }).start();
|
|
2841
|
+
}, [down, sink, motion3.duration.fast]);
|
|
2842
|
+
return /* @__PURE__ */ jsxs26(
|
|
2843
|
+
Pressable10,
|
|
2844
|
+
{
|
|
2845
|
+
role: "radio",
|
|
2846
|
+
"aria-checked": checked,
|
|
2847
|
+
"aria-label": option.hint ? `${option.label}, ${option.hint}` : option.label,
|
|
2848
|
+
"aria-disabled": disabled || void 0,
|
|
2849
|
+
disabled,
|
|
2850
|
+
onPress,
|
|
2851
|
+
onPressIn: () => setHeld(true),
|
|
2852
|
+
onPressOut: () => setHeld(false),
|
|
2853
|
+
style: [styles21.keySlot, disabled ? styles21.disabled : null],
|
|
2854
|
+
children: [
|
|
2855
|
+
/* @__PURE__ */ jsx30(View25, { style: [styles21.ledge, { borderRadius: radius3.lg, backgroundColor: checked ? theme.accentHover : theme.borderStrong }] }),
|
|
2856
|
+
/* @__PURE__ */ jsxs26(
|
|
2857
|
+
Animated13.View,
|
|
2858
|
+
{
|
|
2859
|
+
style: [
|
|
2860
|
+
styles21.key,
|
|
2861
|
+
{
|
|
2862
|
+
borderRadius: radius3.lg,
|
|
2863
|
+
backgroundColor: checked ? theme.accent : theme.surface2,
|
|
2864
|
+
borderColor: checked ? theme.accent : theme.borderDefault,
|
|
2865
|
+
transform: [{ translateY: sink.interpolate({ inputRange: [0, 1], outputRange: [0, 3] }) }]
|
|
2866
|
+
}
|
|
2867
|
+
],
|
|
2868
|
+
children: [
|
|
2869
|
+
/* @__PURE__ */ jsx30(Text14, { style: [styles21.keyLabel, { color: checked ? theme.onAccent : theme.textPrimary }], children: option.label }),
|
|
2870
|
+
option.hint ? /* @__PURE__ */ jsx30(Text14, { style: [styles21.keyHint, { color: checked ? theme.onAccent : theme.textSecondary }], children: option.hint }) : null
|
|
2871
|
+
]
|
|
2872
|
+
}
|
|
2873
|
+
)
|
|
2874
|
+
]
|
|
2875
|
+
}
|
|
2876
|
+
);
|
|
2877
|
+
}
|
|
2878
|
+
function RadioGroup({ label, options, value: valueProp, defaultValue = null, onValueChange, variant = "list", error, disabled, style }) {
|
|
2879
|
+
const { theme, radius: radius3, haptic } = useTheme();
|
|
2880
|
+
const [own, setOwn] = React22.useState(defaultValue);
|
|
2881
|
+
const value = valueProp !== void 0 ? valueProp : own;
|
|
2882
|
+
const pick = (v) => {
|
|
2883
|
+
haptic(variant === "buttons" ? "impact" : "selection");
|
|
2884
|
+
if (valueProp === void 0) setOwn(v);
|
|
2885
|
+
if (v !== value) onValueChange?.(v);
|
|
2886
|
+
};
|
|
2887
|
+
const body = options.map((o) => {
|
|
2888
|
+
const checked = o.value === value;
|
|
2889
|
+
const off = Boolean(disabled || o.disabled);
|
|
2890
|
+
const name = o.description ? `${o.label}, ${o.description}` : o.label;
|
|
2891
|
+
if (variant === "buttons") return /* @__PURE__ */ jsx30(Key, { option: o, checked, disabled: off, onPress: () => pick(o.value) }, o.value);
|
|
2892
|
+
if (variant === "segmented")
|
|
2893
|
+
return /* @__PURE__ */ jsx30(
|
|
2894
|
+
Pressable10,
|
|
2895
|
+
{
|
|
2896
|
+
role: "radio",
|
|
2897
|
+
"aria-checked": checked,
|
|
2898
|
+
"aria-label": o.label,
|
|
2899
|
+
"aria-disabled": off || void 0,
|
|
2900
|
+
disabled: off,
|
|
2901
|
+
onPress: () => pick(o.value),
|
|
2902
|
+
style: [styles21.segment, { borderRadius: radius3.md }, checked ? { backgroundColor: theme.surface0, borderColor: theme.borderDefault } : null, off ? styles21.disabled : null],
|
|
2903
|
+
children: /* @__PURE__ */ jsx30(Text14, { numberOfLines: 1, style: [styles21.segmentLabel, { color: checked ? theme.textPrimary : theme.textSecondary }], children: o.label })
|
|
2904
|
+
},
|
|
2905
|
+
o.value
|
|
2906
|
+
);
|
|
2907
|
+
if (variant === "cards")
|
|
2908
|
+
return /* @__PURE__ */ jsxs26(
|
|
2909
|
+
Pressable10,
|
|
2910
|
+
{
|
|
2911
|
+
role: "radio",
|
|
2912
|
+
"aria-checked": checked,
|
|
2913
|
+
"aria-label": name,
|
|
2914
|
+
"aria-disabled": off || void 0,
|
|
2915
|
+
disabled: off,
|
|
2916
|
+
onPress: () => pick(o.value),
|
|
2917
|
+
style: ({ pressed }) => [
|
|
2918
|
+
styles21.card,
|
|
2919
|
+
{ borderRadius: radius3.xl, backgroundColor: checked ? theme.accentSoft : theme.surface1, borderColor: checked ? theme.accent : theme.borderDefault, transform: [{ scale: pressed ? 0.98 : 1 }] },
|
|
2920
|
+
off ? styles21.disabled : null
|
|
2921
|
+
],
|
|
2922
|
+
children: [
|
|
2923
|
+
/* @__PURE__ */ jsx30(View25, { style: [styles21.cardCheck, { borderColor: checked ? theme.accent : theme.borderStrong, backgroundColor: checked ? theme.accent : theme.surface1 }], children: checked ? /* @__PURE__ */ jsx30(Check, { color: theme.onAccent }) : null }),
|
|
2924
|
+
/* @__PURE__ */ jsx30(Text14, { style: [styles21.cardLabel, { color: theme.textPrimary }], children: o.label }),
|
|
2925
|
+
o.description ? /* @__PURE__ */ jsx30(Text14, { style: [styles21.cardDescription, { color: theme.textSecondary }], children: o.description }) : null
|
|
2926
|
+
]
|
|
2927
|
+
},
|
|
2928
|
+
o.value
|
|
2929
|
+
);
|
|
2930
|
+
return /* @__PURE__ */ jsxs26(Pressable10, { role: "radio", "aria-checked": checked, "aria-label": name, "aria-disabled": off || void 0, disabled: off, onPress: () => pick(o.value), style: [styles21.row, off ? styles21.disabled : null], children: [
|
|
2931
|
+
/* @__PURE__ */ jsx30(View25, { style: [styles21.dot, { borderColor: checked ? theme.accent : theme.borderStrong, backgroundColor: checked ? theme.accent : theme.surface1 }], children: checked ? /* @__PURE__ */ jsx30(View25, { style: [styles21.dotIn, { backgroundColor: theme.onAccent }] }) : null }),
|
|
2932
|
+
/* @__PURE__ */ jsxs26(View25, { style: styles21.rowText, children: [
|
|
2933
|
+
/* @__PURE__ */ jsx30(Text14, { style: [styles21.rowLabel, { color: theme.textPrimary }], children: o.label }),
|
|
2934
|
+
o.description ? /* @__PURE__ */ jsx30(Text14, { style: [styles21.cardDescription, { color: theme.textSecondary }], children: o.description }) : null
|
|
2935
|
+
] })
|
|
2936
|
+
] }, o.value);
|
|
2937
|
+
});
|
|
2938
|
+
return /* @__PURE__ */ jsxs26(View25, { style: [styles21.root, style], children: [
|
|
2939
|
+
/* @__PURE__ */ jsx30(
|
|
2940
|
+
View25,
|
|
2941
|
+
{
|
|
2942
|
+
role: "radiogroup",
|
|
2943
|
+
"aria-label": label,
|
|
2944
|
+
style: variant === "segmented" ? [styles21.track, { borderRadius: radius3.lg, backgroundColor: theme.surface2, borderColor: error ? theme.danger : theme.borderDefault }] : variant === "buttons" ? styles21.keys : variant === "cards" ? styles21.cards : styles21.list,
|
|
2945
|
+
children: body
|
|
2946
|
+
}
|
|
2947
|
+
),
|
|
2948
|
+
error ? /* @__PURE__ */ jsx30(Text14, { role: "alert", "aria-live": "polite", style: [styles21.error, { color: theme.dangerText }], children: error }) : null
|
|
2949
|
+
] });
|
|
2950
|
+
}
|
|
2951
|
+
var styles21 = StyleSheet21.create({
|
|
2952
|
+
root: { gap: 6, alignSelf: "stretch" },
|
|
2953
|
+
list: { gap: 2 },
|
|
2954
|
+
row: { flexDirection: "row", alignItems: "center", gap: 12, minHeight: 44 },
|
|
2955
|
+
rowText: { flex: 1, gap: 1 },
|
|
2956
|
+
rowLabel: { fontSize: 15, lineHeight: 20 },
|
|
2957
|
+
dot: { width: 22, height: 22, borderRadius: 11, borderWidth: 1.5, alignItems: "center", justifyContent: "center" },
|
|
2958
|
+
dotIn: { width: 8, height: 8, borderRadius: 4 },
|
|
2959
|
+
cards: { flexDirection: "row", flexWrap: "wrap", gap: 10 },
|
|
2960
|
+
card: { flexGrow: 1, flexBasis: 140, minHeight: 72, padding: 14, paddingRight: 40, gap: 2, borderWidth: 1 },
|
|
2961
|
+
cardCheck: { position: "absolute", right: 12, top: 12, width: 20, height: 20, borderRadius: 10, borderWidth: 1.5, alignItems: "center", justifyContent: "center" },
|
|
2962
|
+
cardLabel: { fontSize: 16, fontWeight: "700" },
|
|
2963
|
+
cardDescription: { fontSize: 12, lineHeight: 16 },
|
|
2964
|
+
keys: { flexDirection: "row", flexWrap: "wrap", gap: 10, paddingBottom: 4 },
|
|
2965
|
+
keySlot: { minWidth: 64, minHeight: 52 },
|
|
2966
|
+
ledge: { position: "absolute", left: 0, right: 0, top: 4, bottom: -4 },
|
|
2967
|
+
key: { minHeight: 48, paddingHorizontal: 16, paddingVertical: 8, alignItems: "center", justifyContent: "center", gap: 1, borderWidth: 1 },
|
|
2968
|
+
keyLabel: { fontSize: 15, fontWeight: "700" },
|
|
2969
|
+
keyHint: { fontSize: 11, fontWeight: "500" },
|
|
2970
|
+
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth: StyleSheet21.hairlineWidth, height: 42 },
|
|
2971
|
+
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth: StyleSheet21.hairlineWidth, borderColor: "transparent" },
|
|
2972
|
+
segmentLabel: { fontSize: 13, fontWeight: "600" },
|
|
2973
|
+
error: { fontSize: 12, lineHeight: 16 },
|
|
2974
|
+
disabled: { opacity: 0.4 }
|
|
2975
|
+
});
|
|
2976
|
+
|
|
2597
2977
|
// src/native/search-field.tsx
|
|
2598
|
-
import * as
|
|
2599
|
-
import { Pressable as
|
|
2600
|
-
import
|
|
2601
|
-
import { jsx as
|
|
2978
|
+
import * as React23 from "react";
|
|
2979
|
+
import { Pressable as Pressable11, StyleSheet as StyleSheet22, TextInput as TextInput4, View as View26 } from "react-native";
|
|
2980
|
+
import Svg15, { Circle as Circle9, Path as Path13 } from "react-native-svg";
|
|
2981
|
+
import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2602
2982
|
function SearchField({ label, value, defaultValue = "", onValueChange, onSearch, debounce = 300, onSubmit, clearLabel, style, placeholder, ...props }) {
|
|
2603
2983
|
const { theme, radius: radius3 } = useTheme();
|
|
2604
|
-
const [own, setOwn] =
|
|
2984
|
+
const [own, setOwn] = React23.useState(defaultValue);
|
|
2605
2985
|
const query = value ?? own;
|
|
2606
|
-
const timer2 =
|
|
2607
|
-
|
|
2986
|
+
const timer2 = React23.useRef(void 0);
|
|
2987
|
+
React23.useEffect(() => () => clearTimeout(timer2.current), []);
|
|
2608
2988
|
const change = (next) => {
|
|
2609
2989
|
if (value === void 0) setOwn(next);
|
|
2610
2990
|
onValueChange?.(next);
|
|
2611
2991
|
clearTimeout(timer2.current);
|
|
2612
2992
|
if (onSearch) timer2.current = setTimeout(() => onSearch(next), debounce);
|
|
2613
2993
|
};
|
|
2614
|
-
return /* @__PURE__ */
|
|
2615
|
-
/* @__PURE__ */
|
|
2616
|
-
/* @__PURE__ */
|
|
2617
|
-
/* @__PURE__ */
|
|
2994
|
+
return /* @__PURE__ */ jsxs27(View26, { style: [styles22.frame, { borderRadius: radius3.md, borderColor: theme.borderDefault, backgroundColor: theme.surface2 }, style], children: [
|
|
2995
|
+
/* @__PURE__ */ jsxs27(Svg15, { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: theme.textSecondary, strokeWidth: 2, strokeLinecap: "round", "aria-hidden": true, children: [
|
|
2996
|
+
/* @__PURE__ */ jsx31(Circle9, { cx: 11, cy: 11, r: 7 }),
|
|
2997
|
+
/* @__PURE__ */ jsx31(Path13, { d: "m20 20-3.5-3.5" })
|
|
2618
2998
|
] }),
|
|
2619
|
-
/* @__PURE__ */
|
|
2620
|
-
|
|
2999
|
+
/* @__PURE__ */ jsx31(
|
|
3000
|
+
TextInput4,
|
|
2621
3001
|
{
|
|
2622
3002
|
role: "searchbox",
|
|
2623
3003
|
"aria-label": label,
|
|
@@ -2634,34 +3014,34 @@ function SearchField({ label, value, defaultValue = "", onValueChange, onSearch,
|
|
|
2634
3014
|
onSearch?.(query);
|
|
2635
3015
|
onSubmit?.(query);
|
|
2636
3016
|
},
|
|
2637
|
-
style: [
|
|
3017
|
+
style: [styles22.input, { color: theme.textPrimary }],
|
|
2638
3018
|
...props
|
|
2639
3019
|
}
|
|
2640
3020
|
),
|
|
2641
|
-
query ? /* @__PURE__ */
|
|
3021
|
+
query ? /* @__PURE__ */ jsx31(Pressable11, { role: "button", "aria-label": clearLabel, hitSlop: 10, onPress: () => change(""), style: styles22.clear, children: /* @__PURE__ */ jsx31(Svg15, { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: theme.textSecondary, strokeWidth: 2.4, strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx31(Path13, { d: "M18 6 6 18M6 6l12 12" }) }) }) : null
|
|
2642
3022
|
] });
|
|
2643
3023
|
}
|
|
2644
|
-
var
|
|
2645
|
-
frame: { flexDirection: "row", alignItems: "center", gap: 8, height: 44, paddingLeft: 12, paddingRight: 6, borderWidth:
|
|
3024
|
+
var styles22 = StyleSheet22.create({
|
|
3025
|
+
frame: { flexDirection: "row", alignItems: "center", gap: 8, height: 44, paddingLeft: 12, paddingRight: 6, borderWidth: StyleSheet22.hairlineWidth },
|
|
2646
3026
|
input: { flex: 1, height: "100%", fontSize: 15, paddingVertical: 0 },
|
|
2647
3027
|
clear: { width: 32, height: 32, alignItems: "center", justifyContent: "center" }
|
|
2648
3028
|
});
|
|
2649
3029
|
|
|
2650
3030
|
// src/native/segmented.tsx
|
|
2651
|
-
import { Pressable as
|
|
2652
|
-
import { jsx as
|
|
3031
|
+
import { Pressable as Pressable12, StyleSheet as StyleSheet23, Text as Text15, View as View27 } from "react-native";
|
|
3032
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2653
3033
|
function Segmented({ options, value, onValueChange, size = "md", "aria-label": label, style }) {
|
|
2654
3034
|
const { theme, radius: radius3 } = useTheme();
|
|
2655
|
-
return /* @__PURE__ */
|
|
2656
|
-
|
|
3035
|
+
return /* @__PURE__ */ jsx32(
|
|
3036
|
+
View27,
|
|
2657
3037
|
{
|
|
2658
3038
|
role: "tablist",
|
|
2659
3039
|
"aria-label": label,
|
|
2660
|
-
style: [
|
|
3040
|
+
style: [styles23.track, { backgroundColor: theme.surface2, borderColor: theme.borderSubtle, borderRadius: radius3.md, height: size === "sm" ? 32 : 40 }, style],
|
|
2661
3041
|
children: options.map((option) => {
|
|
2662
3042
|
const selected = option.value === value;
|
|
2663
|
-
return /* @__PURE__ */
|
|
2664
|
-
|
|
3043
|
+
return /* @__PURE__ */ jsx32(
|
|
3044
|
+
Pressable12,
|
|
2665
3045
|
{
|
|
2666
3046
|
role: "tab",
|
|
2667
3047
|
"aria-selected": selected,
|
|
@@ -2671,12 +3051,12 @@ function Segmented({ options, value, onValueChange, size = "md", "aria-label": l
|
|
|
2671
3051
|
if (!selected) onValueChange(option.value);
|
|
2672
3052
|
},
|
|
2673
3053
|
style: [
|
|
2674
|
-
|
|
3054
|
+
styles23.segment,
|
|
2675
3055
|
{ borderRadius: radius3.sm },
|
|
2676
3056
|
selected ? { backgroundColor: theme.surface0, borderColor: theme.borderDefault } : null,
|
|
2677
|
-
option.disabled ?
|
|
3057
|
+
option.disabled ? styles23.disabled : null
|
|
2678
3058
|
],
|
|
2679
|
-
children: /* @__PURE__ */
|
|
3059
|
+
children: /* @__PURE__ */ jsx32(Text15, { numberOfLines: 1, style: [styles23.label, { color: selected ? theme.textPrimary : theme.textSecondary, fontSize: size === "sm" ? 12 : 13 }], children: option.label })
|
|
2680
3060
|
},
|
|
2681
3061
|
option.value
|
|
2682
3062
|
);
|
|
@@ -2684,17 +3064,17 @@ function Segmented({ options, value, onValueChange, size = "md", "aria-label": l
|
|
|
2684
3064
|
}
|
|
2685
3065
|
);
|
|
2686
3066
|
}
|
|
2687
|
-
var
|
|
2688
|
-
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth:
|
|
2689
|
-
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth:
|
|
3067
|
+
var styles23 = StyleSheet23.create({
|
|
3068
|
+
track: { flexDirection: "row", padding: 3, gap: 3, borderWidth: StyleSheet23.hairlineWidth },
|
|
3069
|
+
segment: { flex: 1, alignItems: "center", justifyContent: "center", paddingHorizontal: 8, borderWidth: StyleSheet23.hairlineWidth, borderColor: "transparent" },
|
|
2690
3070
|
label: { fontWeight: "600" },
|
|
2691
3071
|
disabled: { opacity: 0.4 }
|
|
2692
3072
|
});
|
|
2693
3073
|
|
|
2694
3074
|
// src/native/skeleton.tsx
|
|
2695
|
-
import * as
|
|
2696
|
-
import { Animated as
|
|
2697
|
-
import { jsx as
|
|
3075
|
+
import * as React24 from "react";
|
|
3076
|
+
import { Animated as Animated14 } from "react-native";
|
|
3077
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2698
3078
|
var SHAPE = {
|
|
2699
3079
|
text: { width: "100%", height: 12, radius: 4 },
|
|
2700
3080
|
circle: { width: 40, height: 40, radius: 9999 },
|
|
@@ -2703,13 +3083,13 @@ var SHAPE = {
|
|
|
2703
3083
|
function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
2704
3084
|
const { theme } = useTheme();
|
|
2705
3085
|
const reduce = useReducedMotion();
|
|
2706
|
-
const [opacity] =
|
|
2707
|
-
|
|
3086
|
+
const [opacity] = React24.useState(() => new Animated14.Value(1));
|
|
3087
|
+
React24.useEffect(() => {
|
|
2708
3088
|
if (reduce) return;
|
|
2709
|
-
const loop =
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
3089
|
+
const loop = Animated14.loop(
|
|
3090
|
+
Animated14.sequence([
|
|
3091
|
+
Animated14.timing(opacity, { toValue: 0.5, duration: 900, useNativeDriver: true }),
|
|
3092
|
+
Animated14.timing(opacity, { toValue: 1, duration: 900, useNativeDriver: true })
|
|
2713
3093
|
])
|
|
2714
3094
|
);
|
|
2715
3095
|
loop.start();
|
|
@@ -2720,8 +3100,8 @@ function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
|
2720
3100
|
}, [reduce, opacity]);
|
|
2721
3101
|
const s = SHAPE[shape];
|
|
2722
3102
|
const side = shape === "circle" ? width ?? height ?? s.width : void 0;
|
|
2723
|
-
return /* @__PURE__ */
|
|
2724
|
-
|
|
3103
|
+
return /* @__PURE__ */ jsx33(
|
|
3104
|
+
Animated14.View,
|
|
2725
3105
|
{
|
|
2726
3106
|
testID,
|
|
2727
3107
|
"aria-hidden": true,
|
|
@@ -2733,12 +3113,187 @@ function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
|
2733
3113
|
);
|
|
2734
3114
|
}
|
|
2735
3115
|
|
|
3116
|
+
// src/native/slider.tsx
|
|
3117
|
+
import * as React25 from "react";
|
|
3118
|
+
import { PanResponder, StyleSheet as StyleSheet24, Text as Text16, View as View28 } from "react-native";
|
|
3119
|
+
import Svg16, { Defs as Defs10, LinearGradient as LinearGradient10, Rect as Rect4, Stop as Stop10 } from "react-native-svg";
|
|
3120
|
+
import { jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3121
|
+
var THUMB = 26;
|
|
3122
|
+
var toArray = (v) => v === void 0 ? void 0 : typeof v === "number" ? [v] : [...v];
|
|
3123
|
+
function Slider({
|
|
3124
|
+
label,
|
|
3125
|
+
thumbLabels,
|
|
3126
|
+
value,
|
|
3127
|
+
defaultValue,
|
|
3128
|
+
onValueChange,
|
|
3129
|
+
onValueCommit,
|
|
3130
|
+
min = 0,
|
|
3131
|
+
max = 100,
|
|
3132
|
+
step = 1,
|
|
3133
|
+
formatValue = String,
|
|
3134
|
+
showLabel,
|
|
3135
|
+
floatingValue,
|
|
3136
|
+
ticks,
|
|
3137
|
+
marks: marks2,
|
|
3138
|
+
tone: tone2 = "gradient",
|
|
3139
|
+
orientation = "horizontal",
|
|
3140
|
+
disabled,
|
|
3141
|
+
style
|
|
3142
|
+
}) {
|
|
3143
|
+
const { theme, radius: radius3, haptic } = useTheme();
|
|
3144
|
+
const range = Array.isArray(value ?? defaultValue);
|
|
3145
|
+
const vertical = orientation === "vertical";
|
|
3146
|
+
const [inner, setInner] = React25.useState(() => toArray(defaultValue) ?? [min]);
|
|
3147
|
+
const current = toArray(value) ?? inner;
|
|
3148
|
+
const [length, setLength] = React25.useState(0);
|
|
3149
|
+
const [dragging, setDragging] = React25.useState(null);
|
|
3150
|
+
const gradientId = useSvgId("kzs");
|
|
3151
|
+
const out = (next) => range ? [next[0], next[1]] : next[0];
|
|
3152
|
+
const snap = (v) => Math.min(max, Math.max(min, Math.round((v - min) / step) * step + min));
|
|
3153
|
+
const pct = (v) => (v - min) / (max - min || 1);
|
|
3154
|
+
const live = React25.useRef({ current, length, vertical, disabled });
|
|
3155
|
+
React25.useLayoutEffect(() => {
|
|
3156
|
+
live.current = { current, length, vertical, disabled };
|
|
3157
|
+
});
|
|
3158
|
+
const active = React25.useRef(0);
|
|
3159
|
+
const start = React25.useRef(0);
|
|
3160
|
+
const set = (next) => {
|
|
3161
|
+
if (value === void 0) setInner(next);
|
|
3162
|
+
onValueChange?.(out(next));
|
|
3163
|
+
};
|
|
3164
|
+
const move = (thumb, to) => {
|
|
3165
|
+
const now = live.current.current;
|
|
3166
|
+
let v = snap(to);
|
|
3167
|
+
if (now.length === 2) v = thumb === 0 ? Math.min(v, now[1]) : Math.max(v, now[0]);
|
|
3168
|
+
if (v === now[thumb]) return;
|
|
3169
|
+
haptic("selection");
|
|
3170
|
+
const next = [...now];
|
|
3171
|
+
next[thumb] = v;
|
|
3172
|
+
set(next);
|
|
3173
|
+
};
|
|
3174
|
+
const at = (position) => {
|
|
3175
|
+
const { length: l, vertical: vert } = live.current;
|
|
3176
|
+
const p = Math.min(1, Math.max(0, (vert ? l + THUMB / 2 - position : position - THUMB / 2) / (l || 1)));
|
|
3177
|
+
return min + p * (max - min);
|
|
3178
|
+
};
|
|
3179
|
+
const commit = () => onValueCommit?.(out(live.current.current));
|
|
3180
|
+
const handlers = React25.useRef({ move, at, commit });
|
|
3181
|
+
React25.useLayoutEffect(() => {
|
|
3182
|
+
handlers.current = { move, at, commit };
|
|
3183
|
+
});
|
|
3184
|
+
const [responder] = React25.useState(
|
|
3185
|
+
() => PanResponder.create({
|
|
3186
|
+
onStartShouldSetPanResponder: () => !live.current.disabled,
|
|
3187
|
+
onMoveShouldSetPanResponder: () => !live.current.disabled,
|
|
3188
|
+
onPanResponderTerminationRequest: () => false,
|
|
3189
|
+
onPanResponderGrant: (e) => {
|
|
3190
|
+
const pos = live.current.vertical ? e.nativeEvent.locationY : e.nativeEvent.locationX;
|
|
3191
|
+
start.current = pos;
|
|
3192
|
+
const target = handlers.current.at(pos);
|
|
3193
|
+
const now = live.current.current;
|
|
3194
|
+
active.current = now.length === 2 && Math.abs(target - now[1]) < Math.abs(target - now[0]) ? 1 : 0;
|
|
3195
|
+
setDragging(active.current);
|
|
3196
|
+
handlers.current.move(active.current, target);
|
|
3197
|
+
},
|
|
3198
|
+
onPanResponderMove: (_, g) => handlers.current.move(active.current, handlers.current.at(start.current + (live.current.vertical ? g.dy : g.dx))),
|
|
3199
|
+
onPanResponderRelease: () => {
|
|
3200
|
+
setDragging(null);
|
|
3201
|
+
handlers.current.commit();
|
|
3202
|
+
},
|
|
3203
|
+
onPanResponderTerminate: () => setDragging(null)
|
|
3204
|
+
})
|
|
3205
|
+
);
|
|
3206
|
+
const lo = range ? Math.min(...current) : min;
|
|
3207
|
+
const hi = range ? Math.max(...current) : current[0];
|
|
3208
|
+
const tickValues = ticks === true ? (max - min) / step <= 40 ? Array.from({ length: Math.round((max - min) / step) + 1 }, (_, i) => min + i * step) : [] : ticks ? [...ticks] : [];
|
|
3209
|
+
const along = (p) => vertical ? { bottom: p * length } : { left: p * length };
|
|
3210
|
+
const onLayout = (e) => setLength(vertical ? e.nativeEvent.layout.height : e.nativeEvent.layout.width);
|
|
3211
|
+
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 };
|
|
3212
|
+
return /* @__PURE__ */ jsxs28(View28, { style: [styles24.root, vertical ? styles24.rootVertical : null, disabled ? styles24.disabled : null, style], children: [
|
|
3213
|
+
showLabel ? /* @__PURE__ */ jsxs28(View28, { style: styles24.header, children: [
|
|
3214
|
+
/* @__PURE__ */ jsx34(Text16, { style: [styles24.label, { color: theme.textSecondary }], children: label }),
|
|
3215
|
+
/* @__PURE__ */ jsx34(Text16, { "aria-hidden": true, style: [styles24.value, { color: theme.textSecondary }], children: current.map(formatValue).join(" \u2013 ") })
|
|
3216
|
+
] }) : null,
|
|
3217
|
+
/* @__PURE__ */ jsxs28(View28, { ...responder.panHandlers, style: vertical ? styles24.controlVertical : styles24.control, children: [
|
|
3218
|
+
/* @__PURE__ */ jsxs28(View28, { onLayout, pointerEvents: "none", style: [vertical ? styles24.trackVertical : styles24.track, { borderRadius: radius3.full, backgroundColor: theme.surface3 }], children: [
|
|
3219
|
+
/* @__PURE__ */ jsx34(View28, { style: [styles24.fill, fill, { borderRadius: radius3.full, overflow: "hidden", backgroundColor: theme.accent }], children: tone2 === "gradient" ? /* @__PURE__ */ jsxs28(Svg16, { width: "100%", height: "100%", "aria-hidden": true, children: [
|
|
3220
|
+
/* @__PURE__ */ jsx34(Defs10, { children: /* @__PURE__ */ jsxs28(LinearGradient10, { id: gradientId, x1: "0", y1: vertical ? "1" : "0", x2: vertical ? "0" : "1", y2: "0", children: [
|
|
3221
|
+
/* @__PURE__ */ jsx34(Stop10, { offset: "0", stopColor: theme.accent }),
|
|
3222
|
+
/* @__PURE__ */ jsx34(Stop10, { offset: "1", stopColor: theme.accent2 })
|
|
3223
|
+
] }) }),
|
|
3224
|
+
/* @__PURE__ */ jsx34(Rect4, { width: "100%", height: "100%", fill: `url(#${gradientId})` })
|
|
3225
|
+
] }) : null }),
|
|
3226
|
+
tickValues.map((t) => /* @__PURE__ */ jsx34(View28, { style: [vertical ? styles24.tickVertical : styles24.tick, along(pct(t)), { backgroundColor: t > lo && t < hi ? theme.onAccent : theme.borderStrong }] }, t))
|
|
3227
|
+
] }),
|
|
3228
|
+
current.map((v, i) => /* @__PURE__ */ jsx34(
|
|
3229
|
+
View28,
|
|
3230
|
+
{
|
|
3231
|
+
accessible: true,
|
|
3232
|
+
role: "slider",
|
|
3233
|
+
"aria-label": range ? thumbLabels?.[i] ?? label : label,
|
|
3234
|
+
"aria-valuenow": v,
|
|
3235
|
+
"aria-valuemin": min,
|
|
3236
|
+
"aria-valuemax": max,
|
|
3237
|
+
"aria-valuetext": formatValue(v),
|
|
3238
|
+
"aria-disabled": disabled || void 0,
|
|
3239
|
+
accessibilityActions: [{ name: "increment" }, { name: "decrement" }],
|
|
3240
|
+
onAccessibilityAction: (e) => {
|
|
3241
|
+
const next = snap(v + (e.nativeEvent.actionName === "increment" ? step : -step));
|
|
3242
|
+
move(i, next);
|
|
3243
|
+
const values = [...current];
|
|
3244
|
+
values[i] = next;
|
|
3245
|
+
onValueCommit?.(out(values));
|
|
3246
|
+
},
|
|
3247
|
+
pointerEvents: "none",
|
|
3248
|
+
style: [styles24.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 }],
|
|
3249
|
+
children: floatingValue === "always" || floatingValue && dragging === i ? /* @__PURE__ */ jsx34(View28, { "aria-hidden": true, style: [vertical ? styles24.bubbleVertical : styles24.bubble, { backgroundColor: theme.textPrimary, borderRadius: radius3.md }], children: /* @__PURE__ */ jsx34(Text16, { style: [styles24.bubbleText, { color: theme.surface0 }], children: formatValue(v) }) }) : null
|
|
3250
|
+
},
|
|
3251
|
+
i
|
|
3252
|
+
))
|
|
3253
|
+
] }),
|
|
3254
|
+
marks2?.length && !vertical ? /* @__PURE__ */ jsx34(View28, { "aria-hidden": true, style: styles24.marks, children: marks2.map((m) => /* @__PURE__ */ jsx34(Text16, { style: [styles24.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
|
|
3255
|
+
] });
|
|
3256
|
+
}
|
|
3257
|
+
var styles24 = StyleSheet24.create({
|
|
3258
|
+
root: { gap: 8, alignSelf: "stretch" },
|
|
3259
|
+
rootVertical: { alignSelf: "flex-start", alignItems: "center" },
|
|
3260
|
+
header: { flexDirection: "row", justifyContent: "space-between", alignItems: "baseline", gap: 12 },
|
|
3261
|
+
label: { fontSize: 12, fontWeight: "600" },
|
|
3262
|
+
value: { fontSize: 12, fontVariant: ["tabular-nums"] },
|
|
3263
|
+
control: { height: 44, justifyContent: "center", paddingHorizontal: THUMB / 2 },
|
|
3264
|
+
controlVertical: { flex: 1, minHeight: 160, width: 44, alignItems: "center", paddingVertical: THUMB / 2 },
|
|
3265
|
+
track: { height: 6 },
|
|
3266
|
+
trackVertical: { width: 6, flex: 1 },
|
|
3267
|
+
fill: { position: "absolute" },
|
|
3268
|
+
tick: { position: "absolute", top: 1, width: 1, height: 4, marginLeft: -0.5 },
|
|
3269
|
+
tickVertical: { position: "absolute", left: 1, height: 1, width: 4, marginBottom: -0.5 },
|
|
3270
|
+
thumb: {
|
|
3271
|
+
position: "absolute",
|
|
3272
|
+
width: THUMB,
|
|
3273
|
+
height: THUMB,
|
|
3274
|
+
borderRadius: THUMB / 2,
|
|
3275
|
+
borderWidth: 2.5,
|
|
3276
|
+
marginLeft: THUMB / 2,
|
|
3277
|
+
marginTop: (44 - THUMB) / 2,
|
|
3278
|
+
shadowOpacity: 0.3,
|
|
3279
|
+
shadowRadius: 4,
|
|
3280
|
+
shadowOffset: { width: 0, height: 2 },
|
|
3281
|
+
elevation: 3
|
|
3282
|
+
},
|
|
3283
|
+
bubble: { position: "absolute", bottom: THUMB + 6, left: -17, minWidth: 56, paddingHorizontal: 8, paddingVertical: 4, alignItems: "center" },
|
|
3284
|
+
bubbleVertical: { position: "absolute", left: THUMB + 8, top: -2, minWidth: 48, paddingHorizontal: 8, paddingVertical: 4, alignItems: "center" },
|
|
3285
|
+
bubbleText: { fontSize: 12, fontWeight: "700", fontVariant: ["tabular-nums"] },
|
|
3286
|
+
marks: { height: 16, marginHorizontal: THUMB / 2 },
|
|
3287
|
+
mark: { position: "absolute", width: 40, fontSize: 11, fontWeight: "500" },
|
|
3288
|
+
disabled: { opacity: 0.4 }
|
|
3289
|
+
});
|
|
3290
|
+
|
|
2736
3291
|
// src/native/spinner.tsx
|
|
2737
3292
|
import { ActivityIndicator as ActivityIndicator2 } from "react-native";
|
|
2738
|
-
import { jsx as
|
|
3293
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2739
3294
|
function Spinner({ label, size = "md", ...props }) {
|
|
2740
3295
|
const { theme } = useTheme();
|
|
2741
|
-
return /* @__PURE__ */
|
|
3296
|
+
return /* @__PURE__ */ jsx35(
|
|
2742
3297
|
ActivityIndicator2,
|
|
2743
3298
|
{
|
|
2744
3299
|
accessible: true,
|
|
@@ -2752,10 +3307,79 @@ function Spinner({ label, size = "md", ...props }) {
|
|
|
2752
3307
|
);
|
|
2753
3308
|
}
|
|
2754
3309
|
|
|
3310
|
+
// src/native/switch.tsx
|
|
3311
|
+
import * as React26 from "react";
|
|
3312
|
+
import { Animated as Animated15, Pressable as Pressable13, StyleSheet as StyleSheet25, Text as Text17, View as View29 } from "react-native";
|
|
3313
|
+
import { jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3314
|
+
var SIZES = { sm: { w: 40, h: 24, knob: 18 }, md: { w: 52, h: 32, knob: 26 } };
|
|
3315
|
+
function Switch({ label, checked, defaultChecked = false, onCheckedChange, description, showLabel, size = "md", error, disabled, style }) {
|
|
3316
|
+
const { theme, motion: motion3, haptic } = useTheme();
|
|
3317
|
+
const [own, setOwn] = React26.useState(defaultChecked);
|
|
3318
|
+
const on = checked ?? own;
|
|
3319
|
+
const d = SIZES[size];
|
|
3320
|
+
const travel = d.w - d.knob - (d.h - d.knob);
|
|
3321
|
+
const [x] = React26.useState(() => new Animated15.Value(on ? 1 : 0));
|
|
3322
|
+
React26.useEffect(() => {
|
|
3323
|
+
Animated15.timing(x, { toValue: on ? 1 : 0, duration: motion3.duration.base, useNativeDriver: true }).start();
|
|
3324
|
+
}, [on, x, motion3.duration.base]);
|
|
3325
|
+
const toggle = () => {
|
|
3326
|
+
haptic("selection");
|
|
3327
|
+
if (checked === void 0) setOwn(!on);
|
|
3328
|
+
onCheckedChange?.(!on);
|
|
3329
|
+
};
|
|
3330
|
+
const track = /* @__PURE__ */ jsx36(View29, { style: [styles25.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__ */ jsx36(
|
|
3331
|
+
Animated15.View,
|
|
3332
|
+
{
|
|
3333
|
+
style: [
|
|
3334
|
+
styles25.knob,
|
|
3335
|
+
{
|
|
3336
|
+
width: d.knob,
|
|
3337
|
+
height: d.knob,
|
|
3338
|
+
borderRadius: d.knob / 2,
|
|
3339
|
+
backgroundColor: theme.textOnMedia,
|
|
3340
|
+
shadowColor: theme.scrimStrong,
|
|
3341
|
+
transform: [{ translateX: x.interpolate({ inputRange: [0, 1], outputRange: [0, travel] }) }]
|
|
3342
|
+
}
|
|
3343
|
+
]
|
|
3344
|
+
}
|
|
3345
|
+
) });
|
|
3346
|
+
const a11y = {
|
|
3347
|
+
role: "switch",
|
|
3348
|
+
"aria-checked": on,
|
|
3349
|
+
"aria-label": label,
|
|
3350
|
+
"aria-disabled": disabled || void 0,
|
|
3351
|
+
accessibilityHint: error ?? description,
|
|
3352
|
+
disabled,
|
|
3353
|
+
onPress: toggle
|
|
3354
|
+
};
|
|
3355
|
+
if (!showLabel)
|
|
3356
|
+
return /* @__PURE__ */ jsx36(Pressable13, { ...a11y, hitSlop: 8, style: [disabled ? styles25.disabled : null, style], children: track });
|
|
3357
|
+
return /* @__PURE__ */ jsxs29(View29, { style: [styles25.root, style], children: [
|
|
3358
|
+
/* @__PURE__ */ jsxs29(Pressable13, { ...a11y, style: [styles25.row, disabled ? styles25.disabled : null], children: [
|
|
3359
|
+
/* @__PURE__ */ jsxs29(View29, { style: styles25.text, children: [
|
|
3360
|
+
/* @__PURE__ */ jsx36(Text17, { style: [styles25.label, { color: theme.textPrimary }], children: label }),
|
|
3361
|
+
description ? /* @__PURE__ */ jsx36(Text17, { style: [styles25.description, { color: theme.textSecondary }], children: description }) : null
|
|
3362
|
+
] }),
|
|
3363
|
+
track
|
|
3364
|
+
] }),
|
|
3365
|
+
error ? /* @__PURE__ */ jsx36(Text17, { role: "alert", "aria-live": "polite", style: [styles25.description, { color: theme.dangerText }], children: error }) : null
|
|
3366
|
+
] });
|
|
3367
|
+
}
|
|
3368
|
+
var styles25 = StyleSheet25.create({
|
|
3369
|
+
root: { gap: 2, alignSelf: "stretch" },
|
|
3370
|
+
row: { flexDirection: "row", alignItems: "center", gap: 16, minHeight: 48 },
|
|
3371
|
+
text: { flex: 1, gap: 2 },
|
|
3372
|
+
label: { fontSize: 15, lineHeight: 20, fontWeight: "500" },
|
|
3373
|
+
description: { fontSize: 12, lineHeight: 16 },
|
|
3374
|
+
track: { justifyContent: "center", paddingHorizontal: 2, borderWidth: 1 },
|
|
3375
|
+
knob: { shadowOpacity: 0.25, shadowRadius: 3, shadowOffset: { width: 0, height: 1 }, elevation: 2 },
|
|
3376
|
+
disabled: { opacity: 0.4 }
|
|
3377
|
+
});
|
|
3378
|
+
|
|
2755
3379
|
// src/native/toast.tsx
|
|
2756
|
-
import * as
|
|
2757
|
-
import { AccessibilityInfo as AccessibilityInfo8, Animated as
|
|
2758
|
-
import { Fragment as
|
|
3380
|
+
import * as React27 from "react";
|
|
3381
|
+
import { AccessibilityInfo as AccessibilityInfo8, Animated as Animated16, Pressable as Pressable14, StyleSheet as StyleSheet26, Text as Text18, View as View30 } from "react-native";
|
|
3382
|
+
import { Fragment as Fragment4, jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2759
3383
|
var items = [];
|
|
2760
3384
|
var listeners2 = /* @__PURE__ */ new Set();
|
|
2761
3385
|
var counter = 0;
|
|
@@ -2790,76 +3414,76 @@ var toast = Object.assign(show, {
|
|
|
2790
3414
|
function ToastView({ item, closeLabel, duration }) {
|
|
2791
3415
|
const { theme, radius: radius3 } = useTheme();
|
|
2792
3416
|
const reduce = useReducedMotion();
|
|
2793
|
-
const [enter] =
|
|
2794
|
-
|
|
3417
|
+
const [enter] = React27.useState(() => new Animated16.Value(reduce ? 1 : 0));
|
|
3418
|
+
React27.useEffect(() => {
|
|
2795
3419
|
if (reduce) enter.setValue(1);
|
|
2796
|
-
else
|
|
3420
|
+
else Animated16.timing(enter, { toValue: 1, duration: 220, useNativeDriver: true }).start();
|
|
2797
3421
|
}, [enter, reduce]);
|
|
2798
|
-
|
|
3422
|
+
React27.useEffect(() => {
|
|
2799
3423
|
AccessibilityInfo8.announceForAccessibility(item.description ? `${item.title}. ${item.description}` : item.title);
|
|
2800
3424
|
}, [item.title, item.description]);
|
|
2801
3425
|
const ms = item.duration ?? duration;
|
|
2802
|
-
|
|
3426
|
+
React27.useEffect(() => {
|
|
2803
3427
|
if (!Number.isFinite(ms)) return;
|
|
2804
3428
|
const timer2 = setTimeout(() => dismiss(item.id), ms);
|
|
2805
3429
|
return () => clearTimeout(timer2);
|
|
2806
3430
|
}, [item.id, ms]);
|
|
2807
3431
|
const edge = { success: theme.success, warning: theme.warning, error: theme.danger, info: theme.info, default: theme.borderDefault }[item.tone ?? "default"];
|
|
2808
|
-
const text = /* @__PURE__ */
|
|
2809
|
-
item.icon ? /* @__PURE__ */
|
|
2810
|
-
/* @__PURE__ */
|
|
2811
|
-
/* @__PURE__ */
|
|
2812
|
-
item.description ? /* @__PURE__ */
|
|
3432
|
+
const text = /* @__PURE__ */ jsxs30(Fragment4, { children: [
|
|
3433
|
+
item.icon ? /* @__PURE__ */ jsx37(View30, { "aria-hidden": true, children: item.icon }) : null,
|
|
3434
|
+
/* @__PURE__ */ jsxs30(View30, { style: styles26.content, children: [
|
|
3435
|
+
/* @__PURE__ */ jsx37(Txt, { variant: "label", numberOfLines: 2, children: item.title }),
|
|
3436
|
+
item.description ? /* @__PURE__ */ jsx37(Txt, { variant: "caption", tone: "secondary", numberOfLines: 3, children: item.description }) : null
|
|
2813
3437
|
] })
|
|
2814
3438
|
] });
|
|
2815
|
-
const body = /* @__PURE__ */
|
|
2816
|
-
item.onPress ? /* @__PURE__ */
|
|
2817
|
-
|
|
3439
|
+
const body = /* @__PURE__ */ jsxs30(Fragment4, { children: [
|
|
3440
|
+
item.onPress ? /* @__PURE__ */ jsx37(
|
|
3441
|
+
Pressable14,
|
|
2818
3442
|
{
|
|
2819
3443
|
role: "button",
|
|
2820
3444
|
onPress: () => {
|
|
2821
3445
|
item.onPress?.();
|
|
2822
3446
|
dismiss(item.id);
|
|
2823
3447
|
},
|
|
2824
|
-
style: ({ pressed }) => [
|
|
3448
|
+
style: ({ pressed }) => [styles26.main, { opacity: pressed ? 0.8 : 1 }],
|
|
2825
3449
|
children: text
|
|
2826
3450
|
}
|
|
2827
|
-
) : /* @__PURE__ */
|
|
2828
|
-
item.action ? /* @__PURE__ */
|
|
2829
|
-
|
|
3451
|
+
) : /* @__PURE__ */ jsx37(View30, { style: styles26.main, children: text }),
|
|
3452
|
+
item.action ? /* @__PURE__ */ jsx37(
|
|
3453
|
+
Pressable14,
|
|
2830
3454
|
{
|
|
2831
3455
|
role: "button",
|
|
2832
3456
|
onPress: () => {
|
|
2833
3457
|
item.action?.onPress();
|
|
2834
3458
|
dismiss(item.id);
|
|
2835
3459
|
},
|
|
2836
|
-
style: [
|
|
2837
|
-
children: /* @__PURE__ */
|
|
3460
|
+
style: [styles26.action, { backgroundColor: theme.accent, borderRadius: radius3.sm }],
|
|
3461
|
+
children: /* @__PURE__ */ jsx37(Text18, { style: [styles26.actionLabel, { color: theme.onAccent }], children: item.action.label })
|
|
2838
3462
|
}
|
|
2839
3463
|
) : null,
|
|
2840
|
-
/* @__PURE__ */
|
|
3464
|
+
/* @__PURE__ */ jsx37(Pressable14, { role: "button", "aria-label": closeLabel, hitSlop: 10, onPress: () => dismiss(item.id), style: styles26.close, children: /* @__PURE__ */ jsx37(Text18, { style: [styles26.cross, { color: theme.textSecondary }], children: "\xD7" }) })
|
|
2841
3465
|
] });
|
|
2842
3466
|
const frame = [
|
|
2843
|
-
|
|
3467
|
+
styles26.toast,
|
|
2844
3468
|
{ backgroundColor: theme.surface2, borderColor: theme.borderDefault, borderLeftColor: edge, borderRadius: radius3.lg, shadowColor: theme.scrimStrong }
|
|
2845
3469
|
];
|
|
2846
3470
|
const motion3 = { transform: [{ translateY: enter.interpolate({ inputRange: [0, 1], outputRange: [-8, 0] }) }] };
|
|
2847
|
-
return /* @__PURE__ */
|
|
3471
|
+
return /* @__PURE__ */ jsx37(Animated16.View, { "aria-live": "polite", style: motion3, children: /* @__PURE__ */ jsx37(View30, { style: frame, children: body }) });
|
|
2848
3472
|
}
|
|
2849
3473
|
function Toaster({ closeLabel, position = "top", offset = 12, duration = 6e3, max = 3 }) {
|
|
2850
|
-
const all =
|
|
3474
|
+
const all = React27.useSyncExternalStore(subscribe2, snapshot, snapshot);
|
|
2851
3475
|
const shown = all.slice(-max);
|
|
2852
3476
|
if (shown.length === 0) return null;
|
|
2853
|
-
return /* @__PURE__ */
|
|
3477
|
+
return /* @__PURE__ */ jsx37(View30, { pointerEvents: "box-none", style: [styles26.stack, position === "top" ? { top: offset } : { bottom: offset }], children: (position === "top" ? shown : [...shown].reverse()).map((item) => /* @__PURE__ */ jsx37(ToastView, { item, closeLabel, duration }, item.id)) });
|
|
2854
3478
|
}
|
|
2855
|
-
var
|
|
3479
|
+
var styles26 = StyleSheet26.create({
|
|
2856
3480
|
stack: { position: "absolute", left: 12, right: 12, gap: 8, zIndex: 100 },
|
|
2857
3481
|
toast: {
|
|
2858
3482
|
flexDirection: "row",
|
|
2859
3483
|
alignItems: "center",
|
|
2860
3484
|
gap: 10,
|
|
2861
3485
|
padding: 12,
|
|
2862
|
-
borderWidth:
|
|
3486
|
+
borderWidth: StyleSheet26.hairlineWidth,
|
|
2863
3487
|
borderLeftWidth: 4,
|
|
2864
3488
|
shadowOpacity: 0.3,
|
|
2865
3489
|
shadowRadius: 16,
|
|
@@ -2891,6 +3515,7 @@ export {
|
|
|
2891
3515
|
CardTitle,
|
|
2892
3516
|
Checkbox,
|
|
2893
3517
|
Chip,
|
|
3518
|
+
Combobox,
|
|
2894
3519
|
Countdown,
|
|
2895
3520
|
DateField,
|
|
2896
3521
|
DateWheel,
|
|
@@ -2911,11 +3536,16 @@ export {
|
|
|
2911
3536
|
ProductMark,
|
|
2912
3537
|
ProfileCard,
|
|
2913
3538
|
Progress,
|
|
3539
|
+
RadioGroup,
|
|
2914
3540
|
SearchField,
|
|
2915
3541
|
Segmented,
|
|
3542
|
+
Select,
|
|
3543
|
+
Sheet,
|
|
2916
3544
|
Skeleton,
|
|
3545
|
+
Slider,
|
|
2917
3546
|
Spinner,
|
|
2918
3547
|
SuccessState,
|
|
3548
|
+
Switch,
|
|
2919
3549
|
TextField,
|
|
2920
3550
|
ThemeProvider,
|
|
2921
3551
|
TimePicker,
|
|
@@ -2932,6 +3562,7 @@ export {
|
|
|
2932
3562
|
ageOn,
|
|
2933
3563
|
alpha,
|
|
2934
3564
|
calendarLabels,
|
|
3565
|
+
comboboxLabels,
|
|
2935
3566
|
composeDate,
|
|
2936
3567
|
dateFieldLabels,
|
|
2937
3568
|
datePartsOrder,
|