@krizaka/ui 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/mascots.d.ts +40 -0
- package/dist/mascots.js +253 -0
- package/dist/mascots.js.map +1 -0
- package/dist/native.d.ts +40 -1
- package/dist/native.js +326 -128
- package/dist/native.js.map +1 -1
- package/package.json +14 -4
- package/registry/alert.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +1 -1
- package/registry/card.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/command.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/examples/mascots/empty-state.d.ts +4 -0
- package/registry/examples/mascots/empty-state.js +24 -0
- package/registry/examples/mascots/empty-state.tsx +18 -0
- package/registry/examples/mascots/flock.d.ts +4 -0
- package/registry/examples/mascots/flock.js +14 -0
- package/registry/examples/mascots/flock.tsx +15 -0
- package/registry/examples/mascots/long-task.d.ts +4 -0
- package/registry/examples/mascots/long-task.js +18 -0
- package/registry/examples/mascots/long-task.tsx +15 -0
- package/registry/examples/mascots/moods.d.ts +4 -0
- package/registry/examples/mascots/moods.js +14 -0
- package/registry/examples/mascots/moods.tsx +15 -0
- package/registry/examples/mascots/native/default.d.ts +4 -0
- package/registry/examples/mascots/native/default.dark.png +0 -0
- package/registry/examples/mascots/native/default.js +25 -0
- package/registry/examples/mascots/native/default.light.png +0 -0
- package/registry/examples/mascots/native/default.tsx +22 -0
- package/registry/examples/mascots/own-tone.d.ts +4 -0
- package/registry/examples/mascots/own-tone.js +11 -0
- package/registry/examples/mascots/own-tone.tsx +12 -0
- package/registry/field.json +1 -1
- package/registry/index.json +17 -1
- package/registry/kbd.json +1 -1
- package/registry/mascots.json +314 -0
- package/registry/page-header.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/tooltip.json +1 -1
package/dist/native.js
CHANGED
|
@@ -749,7 +749,7 @@ function useMarkMotion(size, animated, spinMs = 3e4) {
|
|
|
749
749
|
import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
750
750
|
function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
751
751
|
const { theme } = useTheme();
|
|
752
|
-
const { Animated:
|
|
752
|
+
const { Animated: Animated9, layer, spinStyle, pulseStyle } = useMarkMotion(size, animated);
|
|
753
753
|
const id = useSvgId("kzm");
|
|
754
754
|
const viewBox = size < 48 ? KRIZAKA.croppedViewBox : KRIZAKA.viewBox;
|
|
755
755
|
const stroke = neutral ?? theme.textMuted;
|
|
@@ -775,8 +775,8 @@ function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
775
775
|
/* @__PURE__ */ jsx10(Circle, { cx: 200, cy: 200, r: KRIZAKA.ring.r, stroke, strokeWidth: KRIZAKA.ring.width, opacity: 0.35, fill: "none" }),
|
|
776
776
|
/* @__PURE__ */ jsx10(Group, { transform: `translate(${KRIZAKA.offset} ${KRIZAKA.offset})`, children: /* @__PURE__ */ jsx10(Path, { d: KRIZAKA.shield, stroke: `url(#${id}i)`, strokeWidth: KRIZAKA.stroke, strokeLinecap: "round", strokeLinejoin: "round", fill: "none" }) })
|
|
777
777
|
] }),
|
|
778
|
-
/* @__PURE__ */ jsx10(
|
|
779
|
-
/* @__PURE__ */ jsx10(
|
|
778
|
+
/* @__PURE__ */ jsx10(Animated9.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsx10(Svg2, { viewBox, style: layer, children: /* @__PURE__ */ jsx10(Circle, { cx: 200, cy: 200, r: KRIZAKA.orbit.r, stroke, strokeWidth: KRIZAKA.orbit.width, strokeDasharray: KRIZAKA.orbit.dash, opacity: 0.6, fill: "none" }) }) }),
|
|
779
|
+
/* @__PURE__ */ jsx10(Animated9.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs7(Svg2, { viewBox, style: layer, children: [
|
|
780
780
|
/* @__PURE__ */ jsx10(Defs2, { children: blue }),
|
|
781
781
|
/* @__PURE__ */ jsxs7(Group, { transform: `translate(${KRIZAKA.offset} ${KRIZAKA.offset})`, children: [
|
|
782
782
|
dot(KRIZAKA.node),
|
|
@@ -786,9 +786,206 @@ function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
786
786
|
] });
|
|
787
787
|
}
|
|
788
788
|
|
|
789
|
+
// src/native/mascots.tsx
|
|
790
|
+
import { useEffect as useEffect5, useState as useState7 } from "react";
|
|
791
|
+
import { AccessibilityInfo as AccessibilityInfo3, Animated as Animated4, Easing as Easing2, View as View7 } from "react-native";
|
|
792
|
+
import Svg3, { Circle as Circle2, Defs as Defs3, Ellipse, G, LinearGradient as LinearGradient3, Path as Path2, Rect as Rect2, Stop as Stop3 } from "react-native-svg";
|
|
793
|
+
|
|
794
|
+
// src/mascots/geometry.ts
|
|
795
|
+
var mirror = (d) => d.replace(/(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/g, (_, x, y) => `${120 - Number(x)} ${y}`);
|
|
796
|
+
var falconWing = "M29 58 C17 68 19 88 37 86 C31 76 31 66 29 58 Z";
|
|
797
|
+
var pigeonWing = "M36 58 C20 50 16 80 38 84 C34 74 34 66 36 58 Z";
|
|
798
|
+
var BIRDS = {
|
|
799
|
+
falcon: {
|
|
800
|
+
shadow: [60, 110, 26, 3.5],
|
|
801
|
+
legs: ["M51 94 L48 108 M44 108 L52 108", "M69 94 L72 108 M68 108 L76 108"],
|
|
802
|
+
body: "M30 62 C30 42 90 42 90 62 C90 88 78 98 60 98 C42 98 30 88 30 62 Z",
|
|
803
|
+
belly: "M41 66 C41 55 79 55 79 66 C79 82 71 90 60 90 C49 90 41 82 41 66 Z",
|
|
804
|
+
wings: [
|
|
805
|
+
{ d: falconWing, pivot: [29, 58] },
|
|
806
|
+
{ d: mirror(falconWing), pivot: [91, 58] }
|
|
807
|
+
],
|
|
808
|
+
head: { cx: 60, cy: 38, r: 22 },
|
|
809
|
+
details: ["M46 20 L52 10 L56 19 Z", "M74 20 L68 10 L64 19 Z"],
|
|
810
|
+
visor: { x: 41, y: 29, w: 38, h: 13 },
|
|
811
|
+
beak: "M54 45 L66 45 L60 57 Z",
|
|
812
|
+
eyes: { at: [[50, 35.5], [70, 35.5]], white: 0, pupil: 3.2 }
|
|
813
|
+
},
|
|
814
|
+
owl: {
|
|
815
|
+
shadow: [60, 110, 24, 3.5],
|
|
816
|
+
legs: ["M53 100 L51 107 M47 107 L55 107", "M67 100 L69 107 M65 107 L73 107"],
|
|
817
|
+
body: "M28 52 C28 20 92 20 92 52 C92 86 82 102 60 102 C38 102 28 86 28 52 Z",
|
|
818
|
+
belly: "M42 66 C42 52 78 52 78 66 C78 86 72 94 60 94 C48 94 42 86 42 66 Z",
|
|
819
|
+
wings: [
|
|
820
|
+
{ d: "M29 58 C18 68 20 88 36 90 C32 78 32 68 29 58 Z", pivot: [29, 58] },
|
|
821
|
+
{ d: mirror("M29 58 C18 68 20 88 36 90 C32 78 32 68 29 58 Z"), pivot: [91, 58] }
|
|
822
|
+
],
|
|
823
|
+
head: { cx: 60, cy: 42, r: 0 },
|
|
824
|
+
details: ["M31 20 L47 31 L31 41 Z", "M89 20 L73 31 L89 41 Z"],
|
|
825
|
+
beak: "M55 50 L65 50 L60 59 Z",
|
|
826
|
+
eyes: { at: [[47, 41], [73, 41]], white: 10, pupil: 4 }
|
|
827
|
+
},
|
|
828
|
+
duck: {
|
|
829
|
+
shadow: [60, 110, 30, 3.5],
|
|
830
|
+
legs: [],
|
|
831
|
+
back: ["M88 80 C100 76 104 66 96 62 C98 70 94 74 88 74 Z"],
|
|
832
|
+
body: "M26 80 C26 62 94 62 94 80 C94 100 82 106 60 106 C38 106 26 100 26 80 Z",
|
|
833
|
+
belly: "M38 84 C38 72 82 72 82 84 C82 96 74 101 60 101 C46 101 38 96 38 84 Z",
|
|
834
|
+
wings: [
|
|
835
|
+
{ d: "M27 74 C14 80 18 98 35 96 C31 88 29 80 27 74 Z", pivot: [27, 74] },
|
|
836
|
+
{ d: mirror("M27 74 C14 80 18 98 35 96 C31 88 29 80 27 74 Z"), pivot: [93, 74] }
|
|
837
|
+
],
|
|
838
|
+
head: { cx: 60, cy: 42, r: 23 },
|
|
839
|
+
details: ["M57 20 C54 11 63 8 66 14 C62 13 60 16 61 20 Z"],
|
|
840
|
+
glasses: true,
|
|
841
|
+
beak: "M43 51 C43 46 55 45 60 45 C65 45 77 46 77 51 C77 56 66 60 60 60 C54 60 43 56 43 51 Z",
|
|
842
|
+
eyes: { at: [[51, 37], [69, 37]], white: 0, pupil: 2.6 }
|
|
843
|
+
},
|
|
844
|
+
flamingo: {
|
|
845
|
+
shadow: [60, 110, 20, 3],
|
|
846
|
+
legs: ["M56 86 L55 97 L58 108 M53 108 L62 108", "M65 86 L66 108 M62 108 L71 108"],
|
|
847
|
+
body: "M38 70 C38 54 88 54 88 70 C88 86 76 90 62 90 C48 90 38 86 38 70 Z",
|
|
848
|
+
belly: "M46 72 C46 63 80 63 80 72 C80 82 72 85 63 85 C54 85 46 82 46 72 Z",
|
|
849
|
+
wings: [
|
|
850
|
+
{ d: "M42 64 C30 68 32 84 47 84 C43 76 43 70 42 64 Z", pivot: [42, 64] },
|
|
851
|
+
{ d: "M84 64 C96 68 94 84 79 84 C83 76 83 70 84 64 Z", pivot: [84, 64] }
|
|
852
|
+
],
|
|
853
|
+
neck: { d: "M58 60 C58 42 40 34 46 22", width: 7 },
|
|
854
|
+
head: { cx: 48, cy: 18, r: 11 },
|
|
855
|
+
details: [],
|
|
856
|
+
beak: "M38 16 C28 18 29 28 24 33 C33 28 38 23 40 20 Z",
|
|
857
|
+
eyes: { at: [[46, 15]], white: 3.2, pupil: 1.8 }
|
|
858
|
+
},
|
|
859
|
+
pigeon: {
|
|
860
|
+
shadow: [60, 112, 22, 3],
|
|
861
|
+
legs: ["M52 94 L51 99 M48 99 L54 99", "M68 94 L69 99 M66 99 L72 99"],
|
|
862
|
+
back: ["M53 98 L52 103", "M67 98 L68 103", "M30 68 C16 72 14 62 28 56 C17 57 15 49 32 48 Z"],
|
|
863
|
+
body: "M34 64 C34 44 86 44 86 64 C86 86 74 96 60 96 C46 96 34 86 34 64 Z",
|
|
864
|
+
belly: "M43 68 C43 57 77 57 77 68 C77 82 70 88 60 88 C50 88 43 82 43 68 Z",
|
|
865
|
+
wings: [
|
|
866
|
+
{ d: pigeonWing, pivot: [36, 58] },
|
|
867
|
+
{ d: mirror(pigeonWing), pivot: [84, 58] }
|
|
868
|
+
],
|
|
869
|
+
head: { cx: 60, cy: 36, r: 19 },
|
|
870
|
+
details: ["M54 18 C56 12 64 12 66 18 C63 16 57 16 54 18 Z"],
|
|
871
|
+
beak: "M55 41 L65 41 L60 50 Z",
|
|
872
|
+
eyes: { at: [[52, 33], [68, 33]], white: 5, pupil: 2.4 },
|
|
873
|
+
parcel: ["M60 100 L71 105 L60 110 L49 105 Z", "M49 105 L60 110 L60 118 L49 113 Z", "M71 105 L60 110 L60 118 L71 113 Z"]
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
var MOOD_PARTS = {
|
|
877
|
+
/** The badge of `success` and `error`, top right. */
|
|
878
|
+
badge: { cx: 98, cy: 22, r: 11 },
|
|
879
|
+
check: "M92.5 22.5 L96.8 26.6 L103.6 18.4",
|
|
880
|
+
bang: { line: "M98 15.5 L98 23.5", dot: [98, 28] },
|
|
881
|
+
/** `thinking`: three dots rising to the right of the head. */
|
|
882
|
+
dots: [
|
|
883
|
+
[88, 26, 2.6],
|
|
884
|
+
[96, 19, 3.2],
|
|
885
|
+
[105, 11, 3.8]
|
|
886
|
+
],
|
|
887
|
+
/** `empty`: an open tray beside the bird. */
|
|
888
|
+
tray: "M90 96 L110 96 L107 108 L93 108 Z",
|
|
889
|
+
/** `success`: two sparkles. */
|
|
890
|
+
sparkles: ["M16 26 L18 31 L23 33 L18 35 L16 40 L14 35 L9 33 L14 31 Z", "M104 52 L105.2 55 L108 56 L105.2 57 L104 60 L102.8 57 L100 56 L102.8 55 Z"]
|
|
891
|
+
};
|
|
892
|
+
var archEye = ([x, y], r) => `M${x - r} ${y + r * 0.45} Q${x} ${y - r * 1.15} ${x + r} ${y + r * 0.45}`;
|
|
893
|
+
var lidEye = ([x, y], r) => `M${x - r} ${y + 0.4} L${x + r} ${y + 0.4}`;
|
|
894
|
+
var upperLid = ([x, y], r) => `M${x - r} ${y} A${r} ${r} 0 0 1 ${x + r} ${y} Z`;
|
|
895
|
+
var brow = ([x, y], r, side) => `M${x - r * 1.1} ${y - r * 1.25 - (side < 0 ? 0 : r * 0.7)} L${x + r * 1.1} ${y - r * 1.5 - (side < 0 ? r * 0.7 : 0)}`;
|
|
896
|
+
var OWN_PALETTES = {
|
|
897
|
+
falcon: { from: "#ff9f00", to: "#ff2a00", wing: "#d84315", detail: "#b4320d", beak: "#ffb300", eye: "#00c8d4" },
|
|
898
|
+
owl: { from: "#a78bfa", to: "#6d28d9", wing: "#7c3aed", detail: "#5b21b6", beak: "#fbbf24", eye: "#1f2937" },
|
|
899
|
+
duck: { from: "#f43f5e", to: "#be123c", wing: "#db2777", detail: "#9f1239", beak: "#fbbf24", eye: "#1f2937" },
|
|
900
|
+
flamingo: { from: "#f9a8d4", to: "#db2777", wing: "#ec4899", detail: "#be185d", beak: "#fbbf24", eye: "#1f2937" },
|
|
901
|
+
pigeon: { from: "#22d3ee", to: "#6366f1", wing: "#a855f7", detail: "#4338ca", beak: "#f59e0b", eye: "#1f2937" }
|
|
902
|
+
};
|
|
903
|
+
var LIGHT = "#ffffff";
|
|
904
|
+
var SHADE = "#000000";
|
|
905
|
+
var PARCEL = ["#f59e0b", "#d97706", "#b45309"];
|
|
906
|
+
|
|
907
|
+
// src/native/mascots.tsx
|
|
908
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
909
|
+
function useBob(animated) {
|
|
910
|
+
const [y] = useState7(() => new Animated4.Value(0));
|
|
911
|
+
useEffect5(() => {
|
|
912
|
+
if (!animated) return;
|
|
913
|
+
let loop;
|
|
914
|
+
let cancelled = false;
|
|
915
|
+
void AccessibilityInfo3.isReduceMotionEnabled().then((reduce) => {
|
|
916
|
+
if (reduce || cancelled) return;
|
|
917
|
+
const step = (toValue) => Animated4.timing(y, { toValue, duration: 1800, easing: Easing2.inOut(Easing2.ease), useNativeDriver: true });
|
|
918
|
+
loop = Animated4.loop(Animated4.sequence([step(-2.5), step(0)]));
|
|
919
|
+
loop.start();
|
|
920
|
+
});
|
|
921
|
+
return () => {
|
|
922
|
+
cancelled = true;
|
|
923
|
+
loop?.stop();
|
|
924
|
+
};
|
|
925
|
+
}, [animated, y]);
|
|
926
|
+
return y;
|
|
927
|
+
}
|
|
928
|
+
function Mascot({ bird = "owl", mood = "welcome", tone: tone2 = "brand", size = 96, animated = true, title, style }) {
|
|
929
|
+
const { theme } = useTheme();
|
|
930
|
+
const id = useSvgId("kzb");
|
|
931
|
+
const bob = useBob(animated);
|
|
932
|
+
const g = BIRDS[bird];
|
|
933
|
+
const brand = { from: theme.accent2, to: theme.accent, wing: theme.accent, detail: theme.accent2, beak: theme.warning, eye: theme.textPrimary };
|
|
934
|
+
const p = tone2 === "own" ? OWN_PALETTES[bird] : brand;
|
|
935
|
+
const outline = theme.borderStrong;
|
|
936
|
+
const body = `url(#${id})`;
|
|
937
|
+
const line = { stroke: outline, strokeWidth: 1.4, strokeLinejoin: "round" };
|
|
938
|
+
const eyeR = g.eyes.white || g.eyes.pupil * 1.2;
|
|
939
|
+
const look3 = mood === "thinking" ? 1.4 : 0;
|
|
940
|
+
const rot = (deg, [x, y]) => `rotate(${deg} ${x} ${y})`;
|
|
941
|
+
const [wl, wr] = g.wings;
|
|
942
|
+
return /* @__PURE__ */ jsx11(View7, { style: [{ width: size, height: size }, style], ...markA11y(title), children: /* @__PURE__ */ jsx11(Animated4.View, { style: { transform: [{ translateY: bob }] }, children: /* @__PURE__ */ jsxs8(Svg3, { width: size, height: size, viewBox: "0 0 120 120", children: [
|
|
943
|
+
/* @__PURE__ */ jsx11(Defs3, { children: /* @__PURE__ */ jsxs8(LinearGradient3, { id, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
944
|
+
/* @__PURE__ */ jsx11(Stop3, { offset: "0%", stopColor: p.from }),
|
|
945
|
+
/* @__PURE__ */ jsx11(Stop3, { offset: "100%", stopColor: p.to })
|
|
946
|
+
] }) }),
|
|
947
|
+
/* @__PURE__ */ jsx11(Ellipse, { cx: g.shadow[0], cy: g.shadow[1], rx: g.shadow[2], ry: g.shadow[3], fill: SHADE, opacity: 0.14 }),
|
|
948
|
+
mood === "empty" && /* @__PURE__ */ jsx11(Path2, { d: MOOD_PARTS.tray, stroke: outline, strokeWidth: 1.6, strokeDasharray: "3 3", fill: "none" }),
|
|
949
|
+
g.legs.map((d) => /* @__PURE__ */ jsx11(Path2, { d, stroke: p.beak, strokeWidth: 2.6, strokeLinecap: "round", fill: "none" }, d)),
|
|
950
|
+
g.back?.map((d) => d.endsWith("Z") ? /* @__PURE__ */ jsx11(Path2, { d, fill: p.detail, ...line }, d) : /* @__PURE__ */ jsx11(Path2, { d, stroke: outline, strokeWidth: 1.4, fill: "none" }, d)),
|
|
951
|
+
g.parcel?.map((d, i) => /* @__PURE__ */ jsx11(Path2, { d, fill: PARCEL[i], ...line }, d)),
|
|
952
|
+
/* @__PURE__ */ jsx11(Path2, { d: g.body, fill: body, ...line }),
|
|
953
|
+
/* @__PURE__ */ jsx11(Path2, { d: g.belly, fill: LIGHT, opacity: 0.28 }),
|
|
954
|
+
[wl, wr].map((w, i) => {
|
|
955
|
+
const turn = mood === "success" ? i === 0 ? 28 : -28 : mood === "welcome" && i === 1 ? -20 : 0;
|
|
956
|
+
return /* @__PURE__ */ jsxs8(G, { transform: turn ? rot(turn, w.pivot) : void 0, children: [
|
|
957
|
+
/* @__PURE__ */ jsx11(Path2, { d: w.d, fill: p.wing, ...line }),
|
|
958
|
+
/* @__PURE__ */ jsx11(Path2, { d: w.d, fill: SHADE, opacity: 0.16 })
|
|
959
|
+
] }, i);
|
|
960
|
+
}),
|
|
961
|
+
g.neck && /* @__PURE__ */ jsx11(Path2, { d: g.neck.d, stroke: body, strokeWidth: g.neck.width, strokeLinecap: "round", fill: "none" }),
|
|
962
|
+
g.head.r > 0 && /* @__PURE__ */ jsx11(Circle2, { cx: g.head.cx, cy: g.head.cy, r: g.head.r, fill: body, ...line }),
|
|
963
|
+
g.details.map((d) => /* @__PURE__ */ jsx11(Path2, { d, fill: p.detail, ...line }, d)),
|
|
964
|
+
g.visor && /* @__PURE__ */ jsx11(Rect2, { x: g.visor.x, y: g.visor.y, width: g.visor.w, height: g.visor.h, rx: 4, fill: theme.surface0, ...line }),
|
|
965
|
+
g.eyes.at.map(
|
|
966
|
+
(at, i) => mood === "empty" && g.eyes.white > 0 ? /* @__PURE__ */ jsxs8(G, { children: [
|
|
967
|
+
/* @__PURE__ */ jsx11(Circle2, { cx: at[0], cy: at[1], r: g.eyes.white, fill: LIGHT, ...line }),
|
|
968
|
+
/* @__PURE__ */ jsx11(Circle2, { cx: at[0], cy: at[1] + g.eyes.pupil * 0.7, r: g.eyes.pupil, fill: SHADE }),
|
|
969
|
+
/* @__PURE__ */ jsx11(Path2, { d: upperLid(at, g.eyes.white), fill: p.detail, ...line })
|
|
970
|
+
] }, i) : mood === "success" || mood === "empty" ? /* @__PURE__ */ jsx11(Path2, { 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__ */ jsxs8(G, { children: [
|
|
971
|
+
g.eyes.white > 0 && /* @__PURE__ */ jsx11(Circle2, { cx: at[0], cy: at[1], r: g.eyes.white, fill: LIGHT, ...line }),
|
|
972
|
+
/* @__PURE__ */ jsx11(Circle2, { cx: at[0] + look3, cy: at[1] - look3, r: g.eyes.pupil, fill: g.visor ? p.eye : SHADE })
|
|
973
|
+
] }, i)
|
|
974
|
+
),
|
|
975
|
+
g.glasses && g.eyes.at.map(([x, y]) => /* @__PURE__ */ jsx11(Circle2, { cx: x, cy: y, r: 6.5, fill: "none", stroke: outline, strokeWidth: 1.3 }, x)),
|
|
976
|
+
mood === "error" && g.eyes.at.map((at, i) => /* @__PURE__ */ jsx11(Path2, { d: brow(at, eyeR, g.eyes.at.length === 1 ? 1 : i === 0 ? -1 : 1), stroke: outline, strokeWidth: 2, strokeLinecap: "round" }, i)),
|
|
977
|
+
/* @__PURE__ */ jsx11(Path2, { d: g.beak, fill: p.beak, ...line }),
|
|
978
|
+
mood === "thinking" && MOOD_PARTS.dots.map(([cx, cy, r], i) => /* @__PURE__ */ jsx11(Circle2, { cx, cy, r, fill: theme.textSecondary, opacity: 0.5 + i * 0.25 }, cx)),
|
|
979
|
+
(mood === "success" || mood === "error") && /* @__PURE__ */ jsx11(Circle2, { cx: MOOD_PARTS.badge.cx, cy: MOOD_PARTS.badge.cy, r: MOOD_PARTS.badge.r, fill: mood === "success" ? theme.success : theme.danger }),
|
|
980
|
+
mood === "success" && /* @__PURE__ */ jsx11(Path2, { d: MOOD_PARTS.check, stroke: theme.surface0, strokeWidth: 2.6, strokeLinecap: "round", strokeLinejoin: "round", fill: "none" }),
|
|
981
|
+
mood === "error" && /* @__PURE__ */ jsx11(Path2, { d: MOOD_PARTS.bang.line, stroke: theme.surface0, strokeWidth: 2.8, strokeLinecap: "round" }),
|
|
982
|
+
mood === "error" && /* @__PURE__ */ jsx11(Circle2, { cx: MOOD_PARTS.bang.dot[0], cy: MOOD_PARTS.bang.dot[1], r: 1.6, fill: theme.surface0 })
|
|
983
|
+
] }) }) });
|
|
984
|
+
}
|
|
985
|
+
|
|
789
986
|
// src/native/OrazakaMark.tsx
|
|
790
|
-
import { View as
|
|
791
|
-
import
|
|
987
|
+
import { View as View8 } from "react-native";
|
|
988
|
+
import Svg4, { Circle as Circle3, Defs as Defs4, LinearGradient as LinearGradient4, Path as Path3, RadialGradient as RadialGradient2, Stop as Stop4 } from "react-native-svg";
|
|
792
989
|
|
|
793
990
|
// src/marks/orazaka-geometry.ts
|
|
794
991
|
var orange = marks.orazaka[marks.orazaka.length - 1][1];
|
|
@@ -817,41 +1014,41 @@ var ORAZAKA = {
|
|
|
817
1014
|
};
|
|
818
1015
|
|
|
819
1016
|
// src/native/OrazakaMark.tsx
|
|
820
|
-
import { jsx as
|
|
1017
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
821
1018
|
function OrazakaMark({ size = 48, animated = true, title, neutral }) {
|
|
822
1019
|
const { theme } = useTheme();
|
|
823
|
-
const { Animated:
|
|
1020
|
+
const { Animated: Animated9, layer, spinStyle, pulseStyle } = useMarkMotion(size, animated);
|
|
824
1021
|
const id = useSvgId("ozm");
|
|
825
1022
|
const viewBox = size < 48 ? ORAZAKA.croppedViewBox : ORAZAKA.viewBox;
|
|
826
1023
|
const stroke = neutral ?? theme.textMuted;
|
|
827
|
-
const gradient = /* @__PURE__ */
|
|
1024
|
+
const gradient = /* @__PURE__ */ jsx12(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__ */ jsx12(Stop4, { offset, stopColor: color }, offset)) });
|
|
828
1025
|
const fill = `url(#${id}a)`;
|
|
829
|
-
return /* @__PURE__ */
|
|
830
|
-
/* @__PURE__ */
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
/* @__PURE__ */
|
|
1026
|
+
return /* @__PURE__ */ jsxs9(View8, { style: { width: size, height: size }, ...markA11y(title), children: [
|
|
1027
|
+
/* @__PURE__ */ jsxs9(Svg4, { viewBox, style: layer, children: [
|
|
1028
|
+
/* @__PURE__ */ jsx12(Defs4, { children: /* @__PURE__ */ jsxs9(RadialGradient2, { id: `${id}g`, cx: "50%", cy: "50%", r: "50%", children: [
|
|
1029
|
+
/* @__PURE__ */ jsx12(Stop4, { offset: "0%", stopColor: ORAZAKA.glow.color, stopOpacity: ORAZAKA.glow.opacity }),
|
|
1030
|
+
/* @__PURE__ */ jsx12(Stop4, { offset: "100%", stopColor: ORAZAKA.glow.color, stopOpacity: 0 })
|
|
834
1031
|
] }) }),
|
|
835
|
-
size >= 48 ? /* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
1032
|
+
size >= 48 ? /* @__PURE__ */ jsx12(Circle3, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: 190, fill: `url(#${id}g)` }) : null,
|
|
1033
|
+
/* @__PURE__ */ jsx12(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" }),
|
|
1034
|
+
/* @__PURE__ */ jsx12(Circle3, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.ring.r, stroke, strokeWidth: ORAZAKA.ring.width, opacity: 0.35, fill: "none" })
|
|
838
1035
|
] }),
|
|
839
|
-
/* @__PURE__ */
|
|
840
|
-
/* @__PURE__ */
|
|
841
|
-
ORAZAKA.shards.map((d) => /* @__PURE__ */
|
|
1036
|
+
/* @__PURE__ */ jsx12(Animated9.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsxs9(Svg4, { viewBox, style: layer, children: [
|
|
1037
|
+
/* @__PURE__ */ jsx12(Defs4, { children: gradient }),
|
|
1038
|
+
ORAZAKA.shards.map((d) => /* @__PURE__ */ jsx12(Path3, { d, fill, stroke: fill, strokeWidth: ORAZAKA.shardStroke, strokeLinejoin: "round" }, d))
|
|
842
1039
|
] }) }),
|
|
843
|
-
/* @__PURE__ */
|
|
844
|
-
/* @__PURE__ */
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
1040
|
+
/* @__PURE__ */ jsx12(Animated9.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs9(Svg4, { viewBox, style: layer, children: [
|
|
1041
|
+
/* @__PURE__ */ jsx12(Defs4, { children: gradient }),
|
|
1042
|
+
/* @__PURE__ */ jsx12(Circle3, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.core.r, fill }),
|
|
1043
|
+
/* @__PURE__ */ jsx12(Circle3, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.core.inner, fill: ORAZAKA.highlight })
|
|
847
1044
|
] }) })
|
|
848
1045
|
] });
|
|
849
1046
|
}
|
|
850
1047
|
|
|
851
1048
|
// src/native/OrochiaMark.tsx
|
|
852
|
-
import { useEffect as
|
|
853
|
-
import { AccessibilityInfo as
|
|
854
|
-
import
|
|
1049
|
+
import { useEffect as useEffect6, useState as useState8 } from "react";
|
|
1050
|
+
import { AccessibilityInfo as AccessibilityInfo4, Animated as Animated5, Easing as Easing3, View as View9 } from "react-native";
|
|
1051
|
+
import Svg5, { Circle as Circle4, Defs as Defs5, Ellipse as Ellipse2, G as Group2, LinearGradient as LinearGradient5, Path as Path4, RadialGradient as RadialGradient3, Stop as Stop5 } from "react-native-svg";
|
|
855
1052
|
|
|
856
1053
|
// src/marks/orochia-geometry.ts
|
|
857
1054
|
var OROCHIA = {
|
|
@@ -878,25 +1075,25 @@ var OROCHIA = {
|
|
|
878
1075
|
};
|
|
879
1076
|
|
|
880
1077
|
// src/native/OrochiaMark.tsx
|
|
881
|
-
import { jsx as
|
|
1078
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
882
1079
|
var CENTER = OROCHIA.offset + 180;
|
|
883
1080
|
function OrochiaMark({ size = 48, animated = true, title, neutral: neutralProp }) {
|
|
884
1081
|
const { theme } = useTheme();
|
|
885
1082
|
const neutral = neutralProp ?? theme.textMuted;
|
|
886
|
-
const [spin] =
|
|
887
|
-
const [pulse] =
|
|
888
|
-
|
|
1083
|
+
const [spin] = useState8(() => new Animated5.Value(0));
|
|
1084
|
+
const [pulse] = useState8(() => new Animated5.Value(0));
|
|
1085
|
+
useEffect6(() => {
|
|
889
1086
|
if (!animated) return;
|
|
890
1087
|
let loops = [];
|
|
891
1088
|
let cancelled = false;
|
|
892
|
-
void
|
|
1089
|
+
void AccessibilityInfo4.isReduceMotionEnabled().then((reduce) => {
|
|
893
1090
|
if (reduce || cancelled) return;
|
|
894
1091
|
loops = [
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
1092
|
+
Animated5.loop(Animated5.timing(spin, { toValue: 1, duration: 3e4, easing: Easing3.linear, useNativeDriver: true })),
|
|
1093
|
+
Animated5.loop(
|
|
1094
|
+
Animated5.sequence([
|
|
1095
|
+
Animated5.timing(pulse, { toValue: 1, duration: 1600, easing: Easing3.inOut(Easing3.ease), useNativeDriver: true }),
|
|
1096
|
+
Animated5.timing(pulse, { toValue: 0, duration: 1600, easing: Easing3.inOut(Easing3.ease), useNativeDriver: true })
|
|
900
1097
|
])
|
|
901
1098
|
)
|
|
902
1099
|
];
|
|
@@ -910,52 +1107,52 @@ function OrochiaMark({ size = 48, animated = true, title, neutral: neutralProp }
|
|
|
910
1107
|
const viewBox = size < 48 ? OROCHIA.croppedViewBox : OROCHIA.viewBox;
|
|
911
1108
|
const layer = { position: "absolute", width: size, height: size };
|
|
912
1109
|
const a11y = title ? { accessible: true, accessibilityRole: "image", accessibilityLabel: title } : { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants" };
|
|
913
|
-
const bodyGradient = /* @__PURE__ */
|
|
914
|
-
return /* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
/* @__PURE__ */
|
|
1110
|
+
const bodyGradient = /* @__PURE__ */ jsx13(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__ */ jsx13(Stop5, { offset, stopColor: color }, offset)) });
|
|
1111
|
+
return /* @__PURE__ */ jsxs10(View9, { style: { width: size, height: size }, ...a11y, children: [
|
|
1112
|
+
/* @__PURE__ */ jsxs10(Svg5, { viewBox, style: layer, children: [
|
|
1113
|
+
/* @__PURE__ */ jsx13(Defs5, { children: /* @__PURE__ */ jsxs10(RadialGradient3, { id: "glow", cx: "50%", cy: "50%", r: "50%", children: [
|
|
1114
|
+
/* @__PURE__ */ jsx13(Stop5, { offset: "0%", stopColor: OROCHIA.glow.color, stopOpacity: OROCHIA.glow.opacity }),
|
|
1115
|
+
/* @__PURE__ */ jsx13(Stop5, { offset: "100%", stopColor: OROCHIA.glow.color, stopOpacity: 0 })
|
|
919
1116
|
] }) }),
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ jsx13(Circle4, { cx: CENTER, cy: CENTER, r: 170, fill: "url(#glow)" }),
|
|
1118
|
+
/* @__PURE__ */ jsx13(Circle4, { cx: CENTER, cy: CENTER, r: OROCHIA.ring.r, stroke: neutral, strokeWidth: OROCHIA.ring.width, opacity: 0.35, fill: "none" })
|
|
922
1119
|
] }),
|
|
923
|
-
/* @__PURE__ */
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
929
|
-
/* @__PURE__ */
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
/* @__PURE__ */
|
|
1120
|
+
/* @__PURE__ */ jsx13(Animated5.View, { style: [layer, { transform: [{ rotate: spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] }) }] }], children: /* @__PURE__ */ jsx13(Svg5, { viewBox, style: layer, children: /* @__PURE__ */ jsx13(Circle4, { cx: CENTER, cy: CENTER, r: OROCHIA.orbit.r, stroke: neutral, strokeWidth: OROCHIA.orbit.width, strokeDasharray: OROCHIA.orbit.dash, opacity: 0.6, fill: "none" }) }) }),
|
|
1121
|
+
/* @__PURE__ */ jsxs10(Svg5, { viewBox, style: layer, children: [
|
|
1122
|
+
/* @__PURE__ */ jsx13(Defs5, { children: bodyGradient }),
|
|
1123
|
+
/* @__PURE__ */ jsxs10(Group2, { transform: `translate(${OROCHIA.offset} ${OROCHIA.offset})`, children: [
|
|
1124
|
+
/* @__PURE__ */ jsx13(Path4, { d: OROCHIA.arc, stroke: "url(#body)", strokeWidth: 22, strokeLinecap: "round", fill: "none" }),
|
|
1125
|
+
/* @__PURE__ */ jsx13(Path4, { d: OROCHIA.arc, stroke: OROCHIA.scales.color, strokeOpacity: OROCHIA.scales.opacity, strokeWidth: OROCHIA.scales.width, strokeLinecap: "round", strokeDasharray: OROCHIA.scales.dash, fill: "none" }),
|
|
1126
|
+
/* @__PURE__ */ jsx13(Path4, { d: OROCHIA.neck, stroke: "url(#body)", strokeWidth: 14, strokeLinecap: "round", fill: "none" }),
|
|
1127
|
+
/* @__PURE__ */ jsx13(Path4, { d: OROCHIA.tail, stroke: "url(#body)", strokeWidth: 6, strokeLinecap: "round", fill: "none" }),
|
|
1128
|
+
/* @__PURE__ */ jsx13(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)" }),
|
|
1129
|
+
/* @__PURE__ */ jsx13(Path4, { d: OROCHIA.tongue.d, stroke: OROCHIA.tongue.color, strokeWidth: 3, strokeLinecap: "round", fill: "none" })
|
|
933
1130
|
] })
|
|
934
1131
|
] }),
|
|
935
|
-
/* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */
|
|
937
|
-
/* @__PURE__ */
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
/* @__PURE__ */
|
|
1132
|
+
/* @__PURE__ */ jsx13(Animated5.View, { style: [layer, { opacity: pulse.interpolate({ inputRange: [0, 1], outputRange: [0.85, 1] }) }], children: /* @__PURE__ */ jsxs10(Svg5, { viewBox, style: layer, children: [
|
|
1133
|
+
/* @__PURE__ */ jsx13(Defs5, { children: /* @__PURE__ */ jsx13(LinearGradient5, { id: "flame", x1: "50%", y1: "100%", x2: "50%", y2: "0%", children: OROCHIA.flameGradient.stops.map(([offset, color]) => /* @__PURE__ */ jsx13(Stop5, { offset, stopColor: color }, offset)) }) }),
|
|
1134
|
+
/* @__PURE__ */ jsxs10(Group2, { transform: `translate(${OROCHIA.offset} ${OROCHIA.offset})`, children: [
|
|
1135
|
+
/* @__PURE__ */ jsx13(Circle4, { cx: OROCHIA.eye.cx, cy: OROCHIA.eye.cy, r: OROCHIA.eye.r, fill: OROCHIA.eye.color }),
|
|
1136
|
+
/* @__PURE__ */ jsx13(Path4, { d: OROCHIA.flame.d, transform: `translate(${OROCHIA.flame.translate[0]} ${OROCHIA.flame.translate[1]}) scale(${OROCHIA.flame.scale})`, fill: "url(#flame)" })
|
|
940
1137
|
] })
|
|
941
1138
|
] }) })
|
|
942
1139
|
] });
|
|
943
1140
|
}
|
|
944
1141
|
|
|
945
1142
|
// src/native/ProductMark.tsx
|
|
946
|
-
import { jsx as
|
|
1143
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
947
1144
|
function ProductMark({ id, ...props }) {
|
|
948
|
-
if (id === "krizaka") return /* @__PURE__ */
|
|
949
|
-
if (id === "orazaka") return /* @__PURE__ */
|
|
950
|
-
return /* @__PURE__ */
|
|
1145
|
+
if (id === "krizaka") return /* @__PURE__ */ jsx14(KrizakaMark, { ...props });
|
|
1146
|
+
if (id === "orazaka") return /* @__PURE__ */ jsx14(OrazakaMark, { ...props });
|
|
1147
|
+
return /* @__PURE__ */ jsx14(OrochiaMark, { ...props });
|
|
951
1148
|
}
|
|
952
1149
|
|
|
953
1150
|
// src/native/progress.tsx
|
|
954
|
-
import * as
|
|
955
|
-
import { Animated as
|
|
956
|
-
import
|
|
957
|
-
import { jsx as
|
|
958
|
-
var AnimatedCircle =
|
|
1151
|
+
import * as React9 from "react";
|
|
1152
|
+
import { Animated as Animated6, Easing as Easing4, StyleSheet as StyleSheet9, View as View10 } from "react-native";
|
|
1153
|
+
import Svg6, { Circle as Circle5, Defs as Defs6, LinearGradient as LinearGradient6, Rect as Rect3, Stop as Stop6 } from "react-native-svg";
|
|
1154
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1155
|
+
var AnimatedCircle = Animated6.createAnimatedComponent(Circle5);
|
|
959
1156
|
var BAR = { sm: 4, md: 8, lg: 12 };
|
|
960
1157
|
var RING = { sm: 40, md: 80, lg: 144 };
|
|
961
1158
|
var STROKE = { sm: 12, md: 9, lg: 7 };
|
|
@@ -966,21 +1163,21 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
966
1163
|
const known = typeof value === "number" && Number.isFinite(value);
|
|
967
1164
|
const ratio = known ? Math.min(1, Math.max(0, value / (max || 1))) : 0;
|
|
968
1165
|
const percent = Math.round(ratio * 100);
|
|
969
|
-
const [progress] =
|
|
970
|
-
const [spin] =
|
|
971
|
-
const [track, setTrack] =
|
|
972
|
-
|
|
1166
|
+
const [progress] = React9.useState(() => new Animated6.Value(ratio));
|
|
1167
|
+
const [spin] = React9.useState(() => new Animated6.Value(0));
|
|
1168
|
+
const [track, setTrack] = React9.useState(0);
|
|
1169
|
+
React9.useEffect(() => {
|
|
973
1170
|
if (reduce) {
|
|
974
1171
|
progress.setValue(ratio);
|
|
975
1172
|
return;
|
|
976
1173
|
}
|
|
977
|
-
const animation =
|
|
1174
|
+
const animation = Animated6.timing(progress, { toValue: ratio, duration: 700, easing: Easing4.out(Easing4.cubic), useNativeDriver: false });
|
|
978
1175
|
animation.start();
|
|
979
1176
|
return () => animation.stop();
|
|
980
1177
|
}, [ratio, reduce, progress]);
|
|
981
|
-
|
|
1178
|
+
React9.useEffect(() => {
|
|
982
1179
|
if (known || reduce) return;
|
|
983
|
-
const loop =
|
|
1180
|
+
const loop = Animated6.loop(Animated6.timing(spin, { toValue: 1, duration: 1200, easing: Easing4.linear, useNativeDriver: true }));
|
|
984
1181
|
loop.start();
|
|
985
1182
|
return () => {
|
|
986
1183
|
loop.stop();
|
|
@@ -996,9 +1193,9 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
996
1193
|
"aria-valuenow": known ? Math.min(max, Math.max(0, value)) : void 0,
|
|
997
1194
|
"aria-valuetext": known ? valueText ?? `${percent}%` : valueText
|
|
998
1195
|
};
|
|
999
|
-
const gradient = /* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
1196
|
+
const gradient = /* @__PURE__ */ jsx15(Defs6, { children: /* @__PURE__ */ jsxs11(LinearGradient6, { id, x1: "0", y1: "0", x2: "1", y2: variant === "ring" ? "1" : "0", children: [
|
|
1197
|
+
/* @__PURE__ */ jsx15(Stop6, { offset: "0", stopColor: theme.accent }),
|
|
1198
|
+
/* @__PURE__ */ jsx15(Stop6, { offset: "1", stopColor: theme.accent2 })
|
|
1002
1199
|
] }) });
|
|
1003
1200
|
if (variant === "ring") {
|
|
1004
1201
|
const side = RING[size];
|
|
@@ -1007,11 +1204,11 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1007
1204
|
const circumference = 2 * Math.PI * r;
|
|
1008
1205
|
const offset = known ? progress.interpolate({ inputRange: [0, 1], outputRange: [circumference, 0] }) : circumference * 0.75;
|
|
1009
1206
|
const rotate = spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] });
|
|
1010
|
-
return /* @__PURE__ */
|
|
1011
|
-
/* @__PURE__ */
|
|
1207
|
+
return /* @__PURE__ */ jsxs11(View10, { ...a11y, style: [styles9.ring, { width: side, height: side }, style], children: [
|
|
1208
|
+
/* @__PURE__ */ jsx15(Animated6.View, { style: [StyleSheet9.absoluteFill, { transform: [{ rotate: known ? "-90deg" : rotate }] }], children: /* @__PURE__ */ jsxs11(Svg6, { width: side, height: side, viewBox: "0 0 100 100", children: [
|
|
1012
1209
|
gradient,
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
/* @__PURE__ */
|
|
1210
|
+
/* @__PURE__ */ jsx15(Circle5, { cx: 50, cy: 50, r, fill: "none", stroke: theme.borderDefault, strokeWidth: stroke }),
|
|
1211
|
+
/* @__PURE__ */ jsx15(
|
|
1015
1212
|
AnimatedCircle,
|
|
1016
1213
|
{
|
|
1017
1214
|
cx: 50,
|
|
@@ -1031,15 +1228,15 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1031
1228
|
}
|
|
1032
1229
|
const width = known ? progress.interpolate({ inputRange: [0, 1], outputRange: ["0%", "100%"] }) : "40%";
|
|
1033
1230
|
const translate = spin.interpolate({ inputRange: [0, 1], outputRange: [-0.4 * track, track] });
|
|
1034
|
-
return /* @__PURE__ */
|
|
1035
|
-
|
|
1231
|
+
return /* @__PURE__ */ jsx15(
|
|
1232
|
+
View10,
|
|
1036
1233
|
{
|
|
1037
1234
|
...a11y,
|
|
1038
1235
|
onLayout: known ? void 0 : (event) => setTrack(event.nativeEvent.layout.width),
|
|
1039
1236
|
style: [styles9.bar, { height: BAR[size], backgroundColor: theme.surface3 }, style],
|
|
1040
|
-
children: /* @__PURE__ */
|
|
1237
|
+
children: /* @__PURE__ */ jsx15(Animated6.View, { style: [styles9.fill, { width }, known || reduce ? null : { transform: [{ translateX: translate }] }], children: /* @__PURE__ */ jsxs11(Svg6, { width: "100%", height: "100%", preserveAspectRatio: "none", children: [
|
|
1041
1238
|
gradient,
|
|
1042
|
-
/* @__PURE__ */
|
|
1239
|
+
/* @__PURE__ */ jsx15(Rect3, { x: 0, y: 0, width: "100%", height: "100%", fill: `url(#${id})` })
|
|
1043
1240
|
] }) })
|
|
1044
1241
|
}
|
|
1045
1242
|
);
|
|
@@ -1051,19 +1248,19 @@ var styles9 = StyleSheet9.create({
|
|
|
1051
1248
|
});
|
|
1052
1249
|
|
|
1053
1250
|
// src/native/segmented.tsx
|
|
1054
|
-
import { Pressable as Pressable4, StyleSheet as StyleSheet10, Text as Text6, View as
|
|
1055
|
-
import { jsx as
|
|
1251
|
+
import { Pressable as Pressable4, StyleSheet as StyleSheet10, Text as Text6, View as View11 } from "react-native";
|
|
1252
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1056
1253
|
function Segmented({ options, value, onValueChange, size = "md", "aria-label": label, style }) {
|
|
1057
1254
|
const { theme, radius: radius3 } = useTheme();
|
|
1058
|
-
return /* @__PURE__ */
|
|
1059
|
-
|
|
1255
|
+
return /* @__PURE__ */ jsx16(
|
|
1256
|
+
View11,
|
|
1060
1257
|
{
|
|
1061
1258
|
role: "tablist",
|
|
1062
1259
|
"aria-label": label,
|
|
1063
1260
|
style: [styles10.track, { backgroundColor: theme.surface2, borderColor: theme.borderSubtle, borderRadius: radius3.md, height: size === "sm" ? 32 : 40 }, style],
|
|
1064
1261
|
children: options.map((option) => {
|
|
1065
1262
|
const selected = option.value === value;
|
|
1066
|
-
return /* @__PURE__ */
|
|
1263
|
+
return /* @__PURE__ */ jsx16(
|
|
1067
1264
|
Pressable4,
|
|
1068
1265
|
{
|
|
1069
1266
|
role: "tab",
|
|
@@ -1079,7 +1276,7 @@ function Segmented({ options, value, onValueChange, size = "md", "aria-label": l
|
|
|
1079
1276
|
selected ? { backgroundColor: theme.surface0, borderColor: theme.borderDefault } : null,
|
|
1080
1277
|
option.disabled ? styles10.disabled : null
|
|
1081
1278
|
],
|
|
1082
|
-
children: /* @__PURE__ */
|
|
1279
|
+
children: /* @__PURE__ */ jsx16(Text6, { numberOfLines: 1, style: [styles10.label, { color: selected ? theme.textPrimary : theme.textSecondary, fontSize: size === "sm" ? 12 : 13 }], children: option.label })
|
|
1083
1280
|
},
|
|
1084
1281
|
option.value
|
|
1085
1282
|
);
|
|
@@ -1095,9 +1292,9 @@ var styles10 = StyleSheet10.create({
|
|
|
1095
1292
|
});
|
|
1096
1293
|
|
|
1097
1294
|
// src/native/skeleton.tsx
|
|
1098
|
-
import * as
|
|
1099
|
-
import { Animated as
|
|
1100
|
-
import { jsx as
|
|
1295
|
+
import * as React10 from "react";
|
|
1296
|
+
import { Animated as Animated7 } from "react-native";
|
|
1297
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1101
1298
|
var SHAPE = {
|
|
1102
1299
|
text: { width: "100%", height: 12, radius: 4 },
|
|
1103
1300
|
circle: { width: 40, height: 40, radius: 9999 },
|
|
@@ -1106,13 +1303,13 @@ var SHAPE = {
|
|
|
1106
1303
|
function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
1107
1304
|
const { theme } = useTheme();
|
|
1108
1305
|
const reduce = useReducedMotion();
|
|
1109
|
-
const [opacity] =
|
|
1110
|
-
|
|
1306
|
+
const [opacity] = React10.useState(() => new Animated7.Value(1));
|
|
1307
|
+
React10.useEffect(() => {
|
|
1111
1308
|
if (reduce) return;
|
|
1112
|
-
const loop =
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1309
|
+
const loop = Animated7.loop(
|
|
1310
|
+
Animated7.sequence([
|
|
1311
|
+
Animated7.timing(opacity, { toValue: 0.5, duration: 900, useNativeDriver: true }),
|
|
1312
|
+
Animated7.timing(opacity, { toValue: 1, duration: 900, useNativeDriver: true })
|
|
1116
1313
|
])
|
|
1117
1314
|
);
|
|
1118
1315
|
loop.start();
|
|
@@ -1123,8 +1320,8 @@ function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
|
1123
1320
|
}, [reduce, opacity]);
|
|
1124
1321
|
const s = SHAPE[shape];
|
|
1125
1322
|
const side = shape === "circle" ? width ?? height ?? s.width : void 0;
|
|
1126
|
-
return /* @__PURE__ */
|
|
1127
|
-
|
|
1323
|
+
return /* @__PURE__ */ jsx17(
|
|
1324
|
+
Animated7.View,
|
|
1128
1325
|
{
|
|
1129
1326
|
testID,
|
|
1130
1327
|
"aria-hidden": true,
|
|
@@ -1138,10 +1335,10 @@ function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
|
1138
1335
|
|
|
1139
1336
|
// src/native/spinner.tsx
|
|
1140
1337
|
import { ActivityIndicator as ActivityIndicator2 } from "react-native";
|
|
1141
|
-
import { jsx as
|
|
1338
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1142
1339
|
function Spinner({ label, size = "md", ...props }) {
|
|
1143
1340
|
const { theme } = useTheme();
|
|
1144
|
-
return /* @__PURE__ */
|
|
1341
|
+
return /* @__PURE__ */ jsx18(
|
|
1145
1342
|
ActivityIndicator2,
|
|
1146
1343
|
{
|
|
1147
1344
|
accessible: true,
|
|
@@ -1156,9 +1353,9 @@ function Spinner({ label, size = "md", ...props }) {
|
|
|
1156
1353
|
}
|
|
1157
1354
|
|
|
1158
1355
|
// src/native/toast.tsx
|
|
1159
|
-
import * as
|
|
1160
|
-
import { AccessibilityInfo as
|
|
1161
|
-
import { Fragment as Fragment3, jsx as
|
|
1356
|
+
import * as React11 from "react";
|
|
1357
|
+
import { AccessibilityInfo as AccessibilityInfo5, Animated as Animated8, Pressable as Pressable5, StyleSheet as StyleSheet11, Text as Text7, View as View12 } from "react-native";
|
|
1358
|
+
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1162
1359
|
var items = [];
|
|
1163
1360
|
var listeners2 = /* @__PURE__ */ new Set();
|
|
1164
1361
|
var counter = 0;
|
|
@@ -1193,30 +1390,30 @@ var toast = Object.assign(show, {
|
|
|
1193
1390
|
function ToastView({ item, closeLabel, duration }) {
|
|
1194
1391
|
const { theme, radius: radius3 } = useTheme();
|
|
1195
1392
|
const reduce = useReducedMotion();
|
|
1196
|
-
const [enter] =
|
|
1197
|
-
|
|
1393
|
+
const [enter] = React11.useState(() => new Animated8.Value(reduce ? 1 : 0));
|
|
1394
|
+
React11.useEffect(() => {
|
|
1198
1395
|
if (reduce) enter.setValue(1);
|
|
1199
|
-
else
|
|
1396
|
+
else Animated8.timing(enter, { toValue: 1, duration: 220, useNativeDriver: true }).start();
|
|
1200
1397
|
}, [enter, reduce]);
|
|
1201
|
-
|
|
1202
|
-
|
|
1398
|
+
React11.useEffect(() => {
|
|
1399
|
+
AccessibilityInfo5.announceForAccessibility(item.description ? `${item.title}. ${item.description}` : item.title);
|
|
1203
1400
|
}, [item.title, item.description]);
|
|
1204
1401
|
const ms = item.duration ?? duration;
|
|
1205
|
-
|
|
1402
|
+
React11.useEffect(() => {
|
|
1206
1403
|
if (!Number.isFinite(ms)) return;
|
|
1207
1404
|
const timer2 = setTimeout(() => dismiss(item.id), ms);
|
|
1208
1405
|
return () => clearTimeout(timer2);
|
|
1209
1406
|
}, [item.id, ms]);
|
|
1210
1407
|
const edge = { success: theme.success, warning: theme.warning, error: theme.danger, info: theme.info, default: theme.borderDefault }[item.tone ?? "default"];
|
|
1211
|
-
const text = /* @__PURE__ */
|
|
1212
|
-
item.icon ? /* @__PURE__ */
|
|
1213
|
-
/* @__PURE__ */
|
|
1214
|
-
/* @__PURE__ */
|
|
1215
|
-
item.description ? /* @__PURE__ */
|
|
1408
|
+
const text = /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1409
|
+
item.icon ? /* @__PURE__ */ jsx19(View12, { "aria-hidden": true, children: item.icon }) : null,
|
|
1410
|
+
/* @__PURE__ */ jsxs12(View12, { style: styles11.content, children: [
|
|
1411
|
+
/* @__PURE__ */ jsx19(Txt, { variant: "label", numberOfLines: 2, children: item.title }),
|
|
1412
|
+
item.description ? /* @__PURE__ */ jsx19(Txt, { variant: "caption", tone: "secondary", numberOfLines: 3, children: item.description }) : null
|
|
1216
1413
|
] })
|
|
1217
1414
|
] });
|
|
1218
|
-
const body = /* @__PURE__ */
|
|
1219
|
-
item.onPress ? /* @__PURE__ */
|
|
1415
|
+
const body = /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1416
|
+
item.onPress ? /* @__PURE__ */ jsx19(
|
|
1220
1417
|
Pressable5,
|
|
1221
1418
|
{
|
|
1222
1419
|
role: "button",
|
|
@@ -1227,8 +1424,8 @@ function ToastView({ item, closeLabel, duration }) {
|
|
|
1227
1424
|
style: ({ pressed }) => [styles11.main, { opacity: pressed ? 0.8 : 1 }],
|
|
1228
1425
|
children: text
|
|
1229
1426
|
}
|
|
1230
|
-
) : /* @__PURE__ */
|
|
1231
|
-
item.action ? /* @__PURE__ */
|
|
1427
|
+
) : /* @__PURE__ */ jsx19(View12, { style: styles11.main, children: text }),
|
|
1428
|
+
item.action ? /* @__PURE__ */ jsx19(
|
|
1232
1429
|
Pressable5,
|
|
1233
1430
|
{
|
|
1234
1431
|
role: "button",
|
|
@@ -1237,23 +1434,23 @@ function ToastView({ item, closeLabel, duration }) {
|
|
|
1237
1434
|
dismiss(item.id);
|
|
1238
1435
|
},
|
|
1239
1436
|
style: [styles11.action, { backgroundColor: theme.accent, borderRadius: radius3.sm }],
|
|
1240
|
-
children: /* @__PURE__ */
|
|
1437
|
+
children: /* @__PURE__ */ jsx19(Text7, { style: [styles11.actionLabel, { color: theme.onAccent }], children: item.action.label })
|
|
1241
1438
|
}
|
|
1242
1439
|
) : null,
|
|
1243
|
-
/* @__PURE__ */
|
|
1440
|
+
/* @__PURE__ */ jsx19(Pressable5, { role: "button", "aria-label": closeLabel, hitSlop: 10, onPress: () => dismiss(item.id), style: styles11.close, children: /* @__PURE__ */ jsx19(Text7, { style: [styles11.cross, { color: theme.textSecondary }], children: "\xD7" }) })
|
|
1244
1441
|
] });
|
|
1245
1442
|
const frame = [
|
|
1246
1443
|
styles11.toast,
|
|
1247
1444
|
{ backgroundColor: theme.surface2, borderColor: theme.borderDefault, borderLeftColor: edge, borderRadius: radius3.lg, shadowColor: theme.scrimStrong }
|
|
1248
1445
|
];
|
|
1249
1446
|
const motion3 = { transform: [{ translateY: enter.interpolate({ inputRange: [0, 1], outputRange: [-8, 0] }) }] };
|
|
1250
|
-
return /* @__PURE__ */
|
|
1447
|
+
return /* @__PURE__ */ jsx19(Animated8.View, { "aria-live": "polite", style: motion3, children: /* @__PURE__ */ jsx19(View12, { style: frame, children: body }) });
|
|
1251
1448
|
}
|
|
1252
1449
|
function Toaster({ closeLabel, position = "top", offset = 12, duration = 6e3, max = 3 }) {
|
|
1253
|
-
const all =
|
|
1450
|
+
const all = React11.useSyncExternalStore(subscribe2, snapshot, snapshot);
|
|
1254
1451
|
const shown = all.slice(-max);
|
|
1255
1452
|
if (shown.length === 0) return null;
|
|
1256
|
-
return /* @__PURE__ */
|
|
1453
|
+
return /* @__PURE__ */ jsx19(View12, { pointerEvents: "box-none", style: [styles11.stack, position === "top" ? { top: offset } : { bottom: offset }], children: (position === "top" ? shown : [...shown].reverse()).map((item) => /* @__PURE__ */ jsx19(ToastView, { item, closeLabel, duration }, item.id)) });
|
|
1257
1454
|
}
|
|
1258
1455
|
var styles11 = StyleSheet11.create({
|
|
1259
1456
|
stack: { position: "absolute", left: 12, right: 12, gap: 8, zIndex: 100 },
|
|
@@ -1296,6 +1493,7 @@ export {
|
|
|
1296
1493
|
EmptyState,
|
|
1297
1494
|
IconButton,
|
|
1298
1495
|
KrizakaMark,
|
|
1496
|
+
Mascot,
|
|
1299
1497
|
OrazakaMark,
|
|
1300
1498
|
OrochiaMark,
|
|
1301
1499
|
ProductMark,
|