@krizaka/ui 2.0.0-beta.6 → 2.0.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 +7 -6
- package/dist/{button-D5aSsmxX.d.ts → button-Cgfkg_3y.d.ts} +5 -1
- package/dist/button.d.ts +5 -1
- package/dist/button.js +4 -2
- package/dist/button.js.map +1 -1
- package/dist/card.d.ts +7 -1
- package/dist/card.js +2 -2
- package/dist/card.js.map +1 -1
- package/dist/{chunk-IUGBKMJC.js → chunk-FHYZSO2S.js} +2 -2
- package/dist/{chunk-6DJ6SQY3.js → chunk-PESA2R4U.js} +5 -3
- package/dist/chunk-PESA2R4U.js.map +1 -0
- package/dist/command.d.ts +11 -2
- package/dist/command.js +17 -6
- package/dist/command.js.map +1 -1
- package/dist/confirm-button.d.ts +1 -1
- package/dist/confirm-button.js +1 -1
- package/dist/countdown.d.ts +7 -6
- package/dist/countdown.js +12 -8
- package/dist/countdown.js.map +1 -1
- package/dist/dialog.js +2 -2
- package/dist/dropdown-menu.js +3 -3
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/field.js +2 -2
- package/dist/field.js.map +1 -1
- package/dist/native.d.ts +20 -8
- package/dist/native.js +129 -85
- package/dist/native.js.map +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +1 -1
- package/package.json +3 -3
- package/registry/avatar.json +20 -5
- package/registry/button.json +36 -15
- package/registry/card.json +17 -2
- package/registry/command.json +30 -8
- package/registry/confirm-button.json +4 -4
- package/registry/countdown.json +53 -12
- package/registry/dropdown-menu.json +1 -1
- package/registry/examples/button/gradient.d.ts +4 -0
- package/registry/examples/button/gradient.js +11 -0
- package/registry/examples/button/gradient.tsx +5 -0
- package/registry/examples/button/native/gradient.d.ts +4 -0
- package/registry/examples/button/native/gradient.dark.png +0 -0
- package/registry/examples/button/native/gradient.js +12 -0
- package/registry/examples/button/native/gradient.light.png +0 -0
- package/registry/examples/button/native/gradient.tsx +5 -0
- package/registry/examples/command/dialog.js +1 -2
- package/registry/examples/command/dialog.tsx +1 -2
- package/registry/examples/command/inline.js +1 -2
- package/registry/examples/command/inline.tsx +1 -2
- package/registry/examples/command/no-results.d.ts +4 -0
- package/registry/examples/command/no-results.js +19 -0
- package/registry/examples/command/no-results.tsx +20 -0
- package/registry/examples/countdown/native/urgent.dark.png +0 -0
- package/registry/examples/countdown/native/urgent.light.png +0 -0
- package/registry/examples/countdown/native/with-label.d.ts +4 -0
- package/registry/examples/countdown/native/with-label.dark.png +0 -0
- package/registry/examples/countdown/native/with-label.js +13 -0
- package/registry/examples/countdown/native/with-label.light.png +0 -0
- package/registry/examples/countdown/native/with-label.tsx +7 -0
- package/registry/examples/countdown/with-label.d.ts +4 -0
- package/registry/examples/countdown/with-label.js +13 -0
- package/registry/examples/countdown/with-label.tsx +10 -0
- package/registry/field.json +1 -1
- package/registry/index.json +8 -8
- package/registry/theme.json +2 -2
- package/dist/chunk-6DJ6SQY3.js.map +0 -1
- /package/dist/{chunk-IUGBKMJC.js.map → chunk-FHYZSO2S.js.map} +0 -0
package/dist/native.js
CHANGED
|
@@ -30,6 +30,7 @@ function countdownParts(ms, units) {
|
|
|
30
30
|
// src/native/avatar.tsx
|
|
31
31
|
import * as React2 from "react";
|
|
32
32
|
import { Image, StyleSheet, Text, View } from "react-native";
|
|
33
|
+
import { SvgUri } from "react-native-svg";
|
|
33
34
|
|
|
34
35
|
// ../tokens/dist/native.js
|
|
35
36
|
var themes = Object.freeze({ dark: Object.freeze({
|
|
@@ -56,9 +57,13 @@ var themes = Object.freeze({ dark: Object.freeze({
|
|
|
56
57
|
"brandGradientVia": "#0e0f16",
|
|
57
58
|
"brandGradientTo": "#0c0c0e",
|
|
58
59
|
"success": "#10b77f",
|
|
60
|
+
"successText": "#36d399",
|
|
59
61
|
"warning": "#f59f0a",
|
|
62
|
+
"warningText": "#f6a823",
|
|
60
63
|
"danger": "#ef4343",
|
|
64
|
+
"dangerText": "#f87272",
|
|
61
65
|
"info": "#196df5",
|
|
66
|
+
"infoText": "#629cf8",
|
|
62
67
|
"scrim": "rgba(0,0,0,0.6)",
|
|
63
68
|
"scrimStrong": "rgba(0,0,0,0.8)",
|
|
64
69
|
"overlay": "rgba(0,0,0,0.7)"
|
|
@@ -86,9 +91,13 @@ var themes = Object.freeze({ dark: Object.freeze({
|
|
|
86
91
|
"brandGradientVia": "#f3f6fc",
|
|
87
92
|
"brandGradientTo": "#fafafa",
|
|
88
93
|
"success": "#10b77f",
|
|
94
|
+
"successText": "#0a714e",
|
|
89
95
|
"warning": "#f59f0a",
|
|
96
|
+
"warningText": "#955104",
|
|
90
97
|
"danger": "#ef4343",
|
|
98
|
+
"dangerText": "#af1d1d",
|
|
91
99
|
"info": "#0a64f5",
|
|
100
|
+
"infoText": "#0954ce",
|
|
92
101
|
"scrim": "rgba(0,0,0,0.6)",
|
|
93
102
|
"scrimStrong": "rgba(0,0,0,0.8)",
|
|
94
103
|
"overlay": "rgba(0,0,0,0.7)"
|
|
@@ -117,6 +126,7 @@ var brands = Object.freeze({
|
|
|
117
126
|
"onAccent": "#ffffff",
|
|
118
127
|
"ring": "#196df5",
|
|
119
128
|
"info": "#196df5",
|
|
129
|
+
"infoText": "#629cf8",
|
|
120
130
|
"brandGradientFrom": "#0e1525",
|
|
121
131
|
"brandGradientVia": "#0e0f16",
|
|
122
132
|
"brandGradientTo": "#0c0c0e"
|
|
@@ -130,6 +140,7 @@ var brands = Object.freeze({
|
|
|
130
140
|
"onAccent": "#ffffff",
|
|
131
141
|
"ring": "#0a64f5",
|
|
132
142
|
"info": "#0a64f5",
|
|
143
|
+
"infoText": "#0954ce",
|
|
133
144
|
"brandGradientFrom": "#dcebfe",
|
|
134
145
|
"brandGradientVia": "#f3f6fc",
|
|
135
146
|
"brandGradientTo": "#fafafa"
|
|
@@ -145,6 +156,7 @@ var brands = Object.freeze({
|
|
|
145
156
|
"onAccent": "#0c0c0e",
|
|
146
157
|
"ring": "#f67e23",
|
|
147
158
|
"info": "#3b83f7",
|
|
159
|
+
"infoText": "#629cf8",
|
|
148
160
|
"brandGradientFrom": "#28170b",
|
|
149
161
|
"brandGradientVia": "#17130c",
|
|
150
162
|
"brandGradientTo": "#0c0c0e"
|
|
@@ -158,6 +170,7 @@ var brands = Object.freeze({
|
|
|
158
170
|
"onAccent": "#ffffff",
|
|
159
171
|
"ring": "#b45309",
|
|
160
172
|
"info": "#0a64f5",
|
|
173
|
+
"infoText": "#0954ce",
|
|
161
174
|
"brandGradientFrom": "#ffebd6",
|
|
162
175
|
"brandGradientVia": "#fdf7ed",
|
|
163
176
|
"brandGradientTo": "#fafafa"
|
|
@@ -173,6 +186,7 @@ var brands = Object.freeze({
|
|
|
173
186
|
"onAccent": "#ffffff",
|
|
174
187
|
"ring": "#a78bfa",
|
|
175
188
|
"info": "#7c3aed",
|
|
189
|
+
"infoText": "#a78bfa",
|
|
176
190
|
"brandGradientFrom": "#1a0e2a",
|
|
177
191
|
"brandGradientVia": "#1c0d17",
|
|
178
192
|
"brandGradientTo": "#0c0c0e"
|
|
@@ -186,6 +200,7 @@ var brands = Object.freeze({
|
|
|
186
200
|
"onAccent": "#ffffff",
|
|
187
201
|
"ring": "#7c3aed",
|
|
188
202
|
"info": "#7c3aed",
|
|
203
|
+
"infoText": "#6d28d9",
|
|
189
204
|
"brandGradientFrom": "#efe7fe",
|
|
190
205
|
"brandGradientVia": "#fdedf5",
|
|
191
206
|
"brandGradientTo": "#fafafa"
|
|
@@ -261,7 +276,10 @@ function useSvgId(prefix) {
|
|
|
261
276
|
// src/native/avatar.tsx
|
|
262
277
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
263
278
|
var SIDE = { xs: 20, sm: 32, md: 40, lg: 56, xl: 80 };
|
|
264
|
-
function
|
|
279
|
+
function isSvgUri(uri) {
|
|
280
|
+
return /^data:image\/svg\+xml[;,]/i.test(uri) || /\.svg(?:[?#]|$)/i.test(uri);
|
|
281
|
+
}
|
|
282
|
+
function AvatarRoot({ src, svg, alt = "", fallback, size = "md", style, ...props }) {
|
|
265
283
|
const { theme } = useTheme();
|
|
266
284
|
const [failedSrc, setFailedSrc] = React2.useState(null);
|
|
267
285
|
const failed = Boolean(src) && failedSrc === src;
|
|
@@ -276,7 +294,7 @@ function AvatarRoot({ src, alt = "", fallback, size = "md", style, ...props }) {
|
|
|
276
294
|
"aria-label": alt || void 0,
|
|
277
295
|
...props,
|
|
278
296
|
style: [styles.root, { width: side, height: side, borderRadius: side / 2, backgroundColor: theme.surface3 }, style],
|
|
279
|
-
children: src && !failed ? /* @__PURE__ */ jsx2(Image, { testID: props.testID ? `${props.testID}.image` : void 0, source: { uri: src }, onError: () => setFailedSrc(src), resizeMode: "cover", style: StyleSheet.absoluteFill }) : typeof content === "string" ? /* @__PURE__ */ jsx2(Text, { style: [styles.initial, { color: theme.textSecondary, fontSize: Math.max(9, Math.round(side * 0.4)) }], children: content }) : content
|
|
297
|
+
children: src && !failed && (svg || isSvgUri(src)) ? /* @__PURE__ */ jsx2(View, { style: StyleSheet.absoluteFill, pointerEvents: "none", children: /* @__PURE__ */ jsx2(SvgUri, { testID: props.testID ? `${props.testID}.svg` : void 0, uri: src, width: "100%", height: "100%", preserveAspectRatio: "xMidYMid slice", onError: () => setFailedSrc(src) }) }) : src && !failed ? /* @__PURE__ */ jsx2(Image, { testID: props.testID ? `${props.testID}.image` : void 0, source: { uri: src }, onError: () => setFailedSrc(src), resizeMode: "cover", style: StyleSheet.absoluteFill }) : typeof content === "string" ? /* @__PURE__ */ jsx2(Text, { style: [styles.initial, { color: theme.textSecondary, fontSize: Math.max(9, Math.round(side * 0.4)) }], children: content }) : content
|
|
280
298
|
}
|
|
281
299
|
);
|
|
282
300
|
}
|
|
@@ -357,7 +375,9 @@ var styles2 = StyleSheet2.create({
|
|
|
357
375
|
});
|
|
358
376
|
|
|
359
377
|
// src/native/button.tsx
|
|
378
|
+
import * as React4 from "react";
|
|
360
379
|
import { ActivityIndicator, Pressable, StyleSheet as StyleSheet4, View as View2 } from "react-native";
|
|
380
|
+
import Svg, { Defs, LinearGradient, Rect, Stop } from "react-native-svg";
|
|
361
381
|
|
|
362
382
|
// src/native/txt.tsx
|
|
363
383
|
import { StyleSheet as StyleSheet3, Text as Text3 } from "react-native";
|
|
@@ -367,9 +387,9 @@ var TONE = {
|
|
|
367
387
|
secondary: "textSecondary",
|
|
368
388
|
muted: "textMuted",
|
|
369
389
|
accent: "accentText",
|
|
370
|
-
success: "
|
|
371
|
-
warning: "
|
|
372
|
-
danger: "
|
|
390
|
+
success: "successText",
|
|
391
|
+
warning: "warningText",
|
|
392
|
+
danger: "dangerText",
|
|
373
393
|
onAccent: "onAccent",
|
|
374
394
|
onMedia: "textOnMedia"
|
|
375
395
|
};
|
|
@@ -401,6 +421,8 @@ function look2(variant, t) {
|
|
|
401
421
|
switch (variant) {
|
|
402
422
|
case "primary":
|
|
403
423
|
return { bg: t.accent, fg: t.onAccent, border: t.accent };
|
|
424
|
+
case "gradient":
|
|
425
|
+
return { bg: t.accent, fg: t.onAccent, border: "transparent", gradient: [t.accent, t.accent2] };
|
|
404
426
|
case "outline":
|
|
405
427
|
return { bg: "transparent", fg: t.textPrimary, border: t.borderDefault };
|
|
406
428
|
case "ghost":
|
|
@@ -427,9 +449,20 @@ function useButton({ variant = "secondary", size = "md", shape = "rounded", load
|
|
|
427
449
|
});
|
|
428
450
|
return { colors, inactive, frame };
|
|
429
451
|
}
|
|
452
|
+
function Fill({ colors, id }) {
|
|
453
|
+
if (!colors.gradient) return null;
|
|
454
|
+
return /* @__PURE__ */ jsxs3(Svg, { "aria-hidden": true, pointerEvents: "none", style: StyleSheet4.absoluteFill, width: "100%", height: "100%", children: [
|
|
455
|
+
/* @__PURE__ */ jsx5(Defs, { children: /* @__PURE__ */ jsxs3(LinearGradient, { id, x1: "0", y1: "0", x2: "1", y2: "0", children: [
|
|
456
|
+
/* @__PURE__ */ jsx5(Stop, { offset: "0", stopColor: colors.gradient[0] }),
|
|
457
|
+
/* @__PURE__ */ jsx5(Stop, { offset: "1", stopColor: colors.gradient[1] })
|
|
458
|
+
] }) }),
|
|
459
|
+
/* @__PURE__ */ jsx5(Rect, { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
460
|
+
] });
|
|
461
|
+
}
|
|
430
462
|
function Button({ label, icon, variant, size = "md", shape, loading = false, disabled, style, ...props }) {
|
|
431
463
|
const { colors, inactive, frame } = useButton({ variant, size, shape, loading, disabled });
|
|
432
|
-
|
|
464
|
+
const gradientId = `kz-button-${React4.useId().replace(/:/g, "")}`;
|
|
465
|
+
return /* @__PURE__ */ jsxs3(
|
|
433
466
|
Pressable,
|
|
434
467
|
{
|
|
435
468
|
role: "button",
|
|
@@ -439,17 +472,21 @@ function Button({ label, icon, variant, size = "md", shape, loading = false, dis
|
|
|
439
472
|
...props,
|
|
440
473
|
disabled: inactive,
|
|
441
474
|
style: ({ pressed }) => [styles4.base, { paddingHorizontal: PADDING[size] }, frame(pressed), style],
|
|
442
|
-
children:
|
|
443
|
-
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
|
|
475
|
+
children: [
|
|
476
|
+
/* @__PURE__ */ jsx5(Fill, { colors, id: gradientId }),
|
|
477
|
+
/* @__PURE__ */ jsxs3(View2, { style: styles4.row, children: [
|
|
478
|
+
loading ? /* @__PURE__ */ jsx5(ActivityIndicator, { "aria-hidden": true, size: "small", color: colors.fg }) : icon,
|
|
479
|
+
/* @__PURE__ */ jsx5(Txt, { variant: "label", numberOfLines: 1, style: { color: colors.fg, fontSize: size === "sm" ? 12 : 14 }, children: label })
|
|
480
|
+
] })
|
|
481
|
+
]
|
|
446
482
|
}
|
|
447
483
|
);
|
|
448
484
|
}
|
|
449
485
|
function IconButton({ label, icon, variant, size = "md", shape, loading = false, disabled, style, ...props }) {
|
|
450
486
|
const { colors, inactive, frame } = useButton({ variant, size, shape, loading, disabled });
|
|
487
|
+
const gradientId = `kz-button-${React4.useId().replace(/:/g, "")}`;
|
|
451
488
|
const side = HEIGHT[size];
|
|
452
|
-
return /* @__PURE__ */
|
|
489
|
+
return /* @__PURE__ */ jsxs3(
|
|
453
490
|
Pressable,
|
|
454
491
|
{
|
|
455
492
|
role: "button",
|
|
@@ -460,12 +497,15 @@ function IconButton({ label, icon, variant, size = "md", shape, loading = false,
|
|
|
460
497
|
...props,
|
|
461
498
|
disabled: inactive,
|
|
462
499
|
style: ({ pressed }) => [styles4.base, frame(pressed), { width: side }, style],
|
|
463
|
-
children:
|
|
500
|
+
children: [
|
|
501
|
+
/* @__PURE__ */ jsx5(Fill, { colors, id: gradientId }),
|
|
502
|
+
loading ? /* @__PURE__ */ jsx5(ActivityIndicator, { "aria-hidden": true, size: "small", color: colors.fg }) : icon
|
|
503
|
+
]
|
|
464
504
|
}
|
|
465
505
|
);
|
|
466
506
|
}
|
|
467
507
|
var styles4 = StyleSheet4.create({
|
|
468
|
-
base: { alignItems: "center", justifyContent: "center", borderWidth: 1 },
|
|
508
|
+
base: { alignItems: "center", justifyContent: "center", borderWidth: 1, overflow: "hidden" },
|
|
469
509
|
row: { flexDirection: "row", alignItems: "center", gap: 8 }
|
|
470
510
|
});
|
|
471
511
|
|
|
@@ -550,18 +590,18 @@ var styles5 = StyleSheet5.create({
|
|
|
550
590
|
});
|
|
551
591
|
|
|
552
592
|
// src/native/chip.tsx
|
|
553
|
-
import * as
|
|
593
|
+
import * as React5 from "react";
|
|
554
594
|
import { Pressable as Pressable3, ScrollView, StyleSheet as StyleSheet6, Text as Text4, View as View4 } from "react-native";
|
|
555
595
|
import { Fragment, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
556
|
-
var ChipGroupContext =
|
|
596
|
+
var ChipGroupContext = React5.createContext(null);
|
|
557
597
|
function Label({ children, color, size }) {
|
|
558
598
|
if (typeof children !== "string" && typeof children !== "number") return /* @__PURE__ */ jsx7(Fragment, { children });
|
|
559
599
|
return /* @__PURE__ */ jsx7(Text4, { style: [styles6.label, { color, fontSize: size === "sm" ? 12 : 13 }], children });
|
|
560
600
|
}
|
|
561
601
|
function ChipBase(props) {
|
|
562
|
-
const group =
|
|
602
|
+
const group = React5.useContext(ChipGroupContext);
|
|
563
603
|
const { theme, radius: radius3 } = useTheme();
|
|
564
|
-
const [own, setOwn] =
|
|
604
|
+
const [own, setOwn] = React5.useState(props.removable ? false : props.defaultSelected ?? false);
|
|
565
605
|
const size = props.size ?? group?.size ?? "md";
|
|
566
606
|
const frame = (on2, pressed) => ({
|
|
567
607
|
height: size === "sm" ? 28 : 36,
|
|
@@ -604,9 +644,9 @@ function ChipBase(props) {
|
|
|
604
644
|
function ChipGroup(props) {
|
|
605
645
|
const { size, disabled, scrollable, "aria-label": label, style, children } = props;
|
|
606
646
|
const initial = props.type === "single" ? props.defaultValue ?? "" : props.defaultValue ?? [];
|
|
607
|
-
const [own, setOwn] =
|
|
647
|
+
const [own, setOwn] = React5.useState(initial);
|
|
608
648
|
const current = props.value ?? own;
|
|
609
|
-
const context =
|
|
649
|
+
const context = React5.useMemo(() => {
|
|
610
650
|
const list = Array.isArray(current) ? current : [current];
|
|
611
651
|
return {
|
|
612
652
|
type: props.type,
|
|
@@ -635,18 +675,18 @@ var styles6 = StyleSheet6.create({
|
|
|
635
675
|
});
|
|
636
676
|
|
|
637
677
|
// src/native/countdown.tsx
|
|
638
|
-
import * as
|
|
678
|
+
import * as React6 from "react";
|
|
639
679
|
import { Animated as Animated2, StyleSheet as StyleSheet7, Text as Text5 } from "react-native";
|
|
640
680
|
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
641
681
|
var FONT = { sm: 14, md: 20, lg: 32 };
|
|
642
|
-
function Countdown({ target, skewMs = 0, units, urgentBelowMs = 6e4, size = "md", label, style }) {
|
|
682
|
+
function Countdown({ target, skewMs = 0, units, urgentBelowMs = 6e4, size = "md", label, showLabel = false, style }) {
|
|
643
683
|
const { theme, fonts } = useTheme();
|
|
644
684
|
const reduce = useReducedMotion();
|
|
645
685
|
const ms = useCountdown(target, skewMs);
|
|
646
686
|
const urgent = ms > 0 && ms < urgentBelowMs;
|
|
647
687
|
const parts = countdownParts(ms, units);
|
|
648
|
-
const [opacity] =
|
|
649
|
-
|
|
688
|
+
const [opacity] = React6.useState(() => new Animated2.Value(1));
|
|
689
|
+
React6.useEffect(() => {
|
|
650
690
|
if (!urgent || reduce) return;
|
|
651
691
|
const loop = Animated2.loop(
|
|
652
692
|
Animated2.sequence([
|
|
@@ -660,19 +700,22 @@ function Countdown({ target, skewMs = 0, units, urgentBelowMs = 6e4, size = "md"
|
|
|
660
700
|
opacity.setValue(1);
|
|
661
701
|
};
|
|
662
702
|
}, [urgent, reduce, opacity]);
|
|
663
|
-
const color = urgent ? theme.
|
|
703
|
+
const color = urgent ? theme.dangerText : theme.textPrimary;
|
|
664
704
|
const text = parts.map(([value, unit]) => `${String(value).padStart(2, "0")}${unit}`).join(" ");
|
|
665
|
-
return /* @__PURE__ */
|
|
705
|
+
return /* @__PURE__ */ jsxs5(
|
|
666
706
|
Animated2.View,
|
|
667
707
|
{
|
|
668
708
|
accessible: true,
|
|
669
709
|
role: "timer",
|
|
670
710
|
"aria-label": `${label} ${text}`,
|
|
671
711
|
style: [styles7.root, style],
|
|
672
|
-
children:
|
|
673
|
-
/* @__PURE__ */ jsx8(Text5, { style: [styles7.
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
|
|
712
|
+
children: [
|
|
713
|
+
showLabel ? /* @__PURE__ */ jsx8(Text5, { style: [styles7.label, { color: theme.textSecondary, fontSize: Math.max(11, Math.round(FONT[size] * 0.6)) }], children: label }) : null,
|
|
714
|
+
parts.map(([value, unit], i) => /* @__PURE__ */ jsxs5(Animated2.View, { style: [styles7.segment, urgent && i === parts.length - 1 ? { opacity } : null], children: [
|
|
715
|
+
/* @__PURE__ */ jsx8(Text5, { style: [styles7.value, { color, fontSize: FONT[size] }, fonts.display ? { fontFamily: fonts.display } : null], children: String(value).padStart(2, "0") }),
|
|
716
|
+
/* @__PURE__ */ jsx8(Text5, { style: [styles7.unit, { color: theme.textSecondary, fontSize: Math.round(FONT[size] / 2) }], children: unit })
|
|
717
|
+
] }, unit))
|
|
718
|
+
]
|
|
676
719
|
}
|
|
677
720
|
);
|
|
678
721
|
}
|
|
@@ -680,7 +723,8 @@ var styles7 = StyleSheet7.create({
|
|
|
680
723
|
root: { flexDirection: "row", alignItems: "baseline", gap: 6 },
|
|
681
724
|
segment: { flexDirection: "row", alignItems: "baseline" },
|
|
682
725
|
value: { fontWeight: "900", fontVariant: ["tabular-nums"], letterSpacing: -0.3 },
|
|
683
|
-
unit: { marginLeft: 2, fontWeight: "700", textTransform: "uppercase" }
|
|
726
|
+
unit: { marginLeft: 2, fontWeight: "700", textTransform: "uppercase" },
|
|
727
|
+
label: { fontWeight: "600", marginRight: 2 }
|
|
684
728
|
});
|
|
685
729
|
|
|
686
730
|
// src/native/empty-state.tsx
|
|
@@ -704,7 +748,7 @@ var styles8 = StyleSheet8.create({
|
|
|
704
748
|
|
|
705
749
|
// src/native/KrizakaMark.tsx
|
|
706
750
|
import { View as View6 } from "react-native";
|
|
707
|
-
import
|
|
751
|
+
import Svg2, { Circle, Defs as Defs2, G as Group, LinearGradient as LinearGradient2, Path, RadialGradient, Stop as Stop2 } from "react-native-svg";
|
|
708
752
|
|
|
709
753
|
// src/marks/krizaka-geometry.ts
|
|
710
754
|
var KRIZAKA = {
|
|
@@ -770,21 +814,21 @@ function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
770
814
|
const id = useSvgId("kzm");
|
|
771
815
|
const viewBox = size < 48 ? KRIZAKA.croppedViewBox : KRIZAKA.viewBox;
|
|
772
816
|
const stroke = neutral ?? theme.textMuted;
|
|
773
|
-
const blue = /* @__PURE__ */ jsx10(
|
|
817
|
+
const blue = /* @__PURE__ */ jsx10(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__ */ jsx10(Stop2, { offset, stopColor: color }, offset)) });
|
|
774
818
|
const dot = (c) => /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
775
819
|
/* @__PURE__ */ jsx10(Circle, { cx: c.cx, cy: c.cy, r: c.r, fill: `url(#${id}b)` }),
|
|
776
820
|
/* @__PURE__ */ jsx10(Circle, { cx: c.cx, cy: c.cy, r: c.inner, fill: KRIZAKA.highlight })
|
|
777
821
|
] });
|
|
778
822
|
return /* @__PURE__ */ jsxs7(View6, { style: { width: size, height: size }, ...markA11y(title), children: [
|
|
779
|
-
/* @__PURE__ */ jsxs7(
|
|
780
|
-
/* @__PURE__ */ jsxs7(
|
|
823
|
+
/* @__PURE__ */ jsxs7(Svg2, { viewBox, style: layer, children: [
|
|
824
|
+
/* @__PURE__ */ jsxs7(Defs2, { children: [
|
|
781
825
|
/* @__PURE__ */ jsxs7(RadialGradient, { id: `${id}g`, cx: "50%", cy: "50%", r: "50%", children: [
|
|
782
|
-
/* @__PURE__ */ jsx10(
|
|
783
|
-
/* @__PURE__ */ jsx10(
|
|
826
|
+
/* @__PURE__ */ jsx10(Stop2, { offset: "0%", stopColor: KRIZAKA.glow.color, stopOpacity: KRIZAKA.glow.opacity }),
|
|
827
|
+
/* @__PURE__ */ jsx10(Stop2, { offset: "100%", stopColor: KRIZAKA.glow.color, stopOpacity: 0 })
|
|
784
828
|
] }),
|
|
785
|
-
/* @__PURE__ */ jsxs7(
|
|
786
|
-
/* @__PURE__ */ jsx10(
|
|
787
|
-
/* @__PURE__ */ jsx10(
|
|
829
|
+
/* @__PURE__ */ jsxs7(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: [
|
|
830
|
+
/* @__PURE__ */ jsx10(Stop2, { offset: "0%", stopColor: theme.textSecondary }),
|
|
831
|
+
/* @__PURE__ */ jsx10(Stop2, { offset: "100%", stopColor: theme.textPrimary })
|
|
788
832
|
] }),
|
|
789
833
|
blue
|
|
790
834
|
] }),
|
|
@@ -792,9 +836,9 @@ function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
792
836
|
/* @__PURE__ */ jsx10(Circle, { cx: 200, cy: 200, r: KRIZAKA.ring.r, stroke, strokeWidth: KRIZAKA.ring.width, opacity: 0.35, fill: "none" }),
|
|
793
837
|
/* @__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" }) })
|
|
794
838
|
] }),
|
|
795
|
-
/* @__PURE__ */ jsx10(Animated8.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsx10(
|
|
796
|
-
/* @__PURE__ */ jsx10(Animated8.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs7(
|
|
797
|
-
/* @__PURE__ */ jsx10(
|
|
839
|
+
/* @__PURE__ */ jsx10(Animated8.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" }) }) }),
|
|
840
|
+
/* @__PURE__ */ jsx10(Animated8.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs7(Svg2, { viewBox, style: layer, children: [
|
|
841
|
+
/* @__PURE__ */ jsx10(Defs2, { children: blue }),
|
|
798
842
|
/* @__PURE__ */ jsxs7(Group, { transform: `translate(${KRIZAKA.offset} ${KRIZAKA.offset})`, children: [
|
|
799
843
|
dot(KRIZAKA.node),
|
|
800
844
|
dot(KRIZAKA.core)
|
|
@@ -805,7 +849,7 @@ function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
805
849
|
|
|
806
850
|
// src/native/OrazakaMark.tsx
|
|
807
851
|
import { View as View7 } from "react-native";
|
|
808
|
-
import
|
|
852
|
+
import Svg3, { Circle as Circle2, Defs as Defs3, LinearGradient as LinearGradient3, Path as Path2, RadialGradient as RadialGradient2, Stop as Stop3 } from "react-native-svg";
|
|
809
853
|
|
|
810
854
|
// src/marks/orazaka-geometry.ts
|
|
811
855
|
var ORAZAKA = {
|
|
@@ -838,24 +882,24 @@ function OrazakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
838
882
|
const id = useSvgId("ozm");
|
|
839
883
|
const viewBox = size < 48 ? ORAZAKA.croppedViewBox : ORAZAKA.viewBox;
|
|
840
884
|
const stroke = neutral ?? theme.textMuted;
|
|
841
|
-
const amber = /* @__PURE__ */ jsx11(
|
|
885
|
+
const amber = /* @__PURE__ */ jsx11(LinearGradient3, { id: `${id}a`, gradientUnits: "userSpaceOnUse", x1: ORAZAKA.amber.x1, y1: ORAZAKA.amber.y1, x2: ORAZAKA.amber.x2, y2: ORAZAKA.amber.y2, children: ORAZAKA.amber.stops.map(([offset, color]) => /* @__PURE__ */ jsx11(Stop3, { offset, stopColor: color }, offset)) });
|
|
842
886
|
const fill = `url(#${id}a)`;
|
|
843
887
|
return /* @__PURE__ */ jsxs8(View7, { style: { width: size, height: size }, ...markA11y(title), children: [
|
|
844
|
-
/* @__PURE__ */ jsxs8(
|
|
845
|
-
/* @__PURE__ */ jsx11(
|
|
846
|
-
/* @__PURE__ */ jsx11(
|
|
847
|
-
/* @__PURE__ */ jsx11(
|
|
888
|
+
/* @__PURE__ */ jsxs8(Svg3, { viewBox, style: layer, children: [
|
|
889
|
+
/* @__PURE__ */ jsx11(Defs3, { children: /* @__PURE__ */ jsxs8(RadialGradient2, { id: `${id}g`, cx: "50%", cy: "50%", r: "50%", children: [
|
|
890
|
+
/* @__PURE__ */ jsx11(Stop3, { offset: "0%", stopColor: ORAZAKA.glow.color, stopOpacity: ORAZAKA.glow.opacity }),
|
|
891
|
+
/* @__PURE__ */ jsx11(Stop3, { offset: "100%", stopColor: ORAZAKA.glow.color, stopOpacity: 0 })
|
|
848
892
|
] }) }),
|
|
849
893
|
size >= 48 ? /* @__PURE__ */ jsx11(Circle2, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: 190, fill: `url(#${id}g)` }) : null,
|
|
850
894
|
/* @__PURE__ */ jsx11(Circle2, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.orbit.r, stroke, strokeWidth: ORAZAKA.orbit.width, strokeDasharray: ORAZAKA.orbit.dash, opacity: 0.6, fill: "none" }),
|
|
851
895
|
/* @__PURE__ */ jsx11(Circle2, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.ring.r, stroke, strokeWidth: ORAZAKA.ring.width, opacity: 0.35, fill: "none" })
|
|
852
896
|
] }),
|
|
853
|
-
/* @__PURE__ */ jsx11(Animated8.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsxs8(
|
|
854
|
-
/* @__PURE__ */ jsx11(
|
|
897
|
+
/* @__PURE__ */ jsx11(Animated8.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsxs8(Svg3, { viewBox, style: layer, children: [
|
|
898
|
+
/* @__PURE__ */ jsx11(Defs3, { children: amber }),
|
|
855
899
|
ORAZAKA.shards.map((d) => /* @__PURE__ */ jsx11(Path2, { d, fill, stroke: fill, strokeWidth: ORAZAKA.shardStroke, strokeLinejoin: "round" }, d))
|
|
856
900
|
] }) }),
|
|
857
|
-
/* @__PURE__ */ jsx11(Animated8.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs8(
|
|
858
|
-
/* @__PURE__ */ jsx11(
|
|
901
|
+
/* @__PURE__ */ jsx11(Animated8.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs8(Svg3, { viewBox, style: layer, children: [
|
|
902
|
+
/* @__PURE__ */ jsx11(Defs3, { children: amber }),
|
|
859
903
|
/* @__PURE__ */ jsx11(Circle2, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.core.r, fill }),
|
|
860
904
|
/* @__PURE__ */ jsx11(Circle2, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.core.inner, fill: ORAZAKA.highlight })
|
|
861
905
|
] }) })
|
|
@@ -865,7 +909,7 @@ function OrazakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
865
909
|
// src/native/OrochiaMark.tsx
|
|
866
910
|
import { useEffect as useEffect5, useState as useState7 } from "react";
|
|
867
911
|
import { AccessibilityInfo as AccessibilityInfo3, Animated as Animated4, Easing as Easing2, View as View8 } from "react-native";
|
|
868
|
-
import
|
|
912
|
+
import Svg4, { Circle as Circle3, Defs as Defs4, Ellipse, G as Group2, LinearGradient as LinearGradient4, Path as Path3, RadialGradient as RadialGradient3, Stop as Stop4 } from "react-native-svg";
|
|
869
913
|
|
|
870
914
|
// src/marks/orochia-geometry.ts
|
|
871
915
|
var OROCHIA = {
|
|
@@ -924,19 +968,19 @@ function OrochiaMark({ size = 48, animated = true, title, neutral: neutralProp }
|
|
|
924
968
|
const viewBox = size < 48 ? OROCHIA.croppedViewBox : OROCHIA.viewBox;
|
|
925
969
|
const layer = { position: "absolute", width: size, height: size };
|
|
926
970
|
const a11y = title ? { accessible: true, accessibilityRole: "image", accessibilityLabel: title } : { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants" };
|
|
927
|
-
const bodyGradient = /* @__PURE__ */ jsx12(
|
|
971
|
+
const bodyGradient = /* @__PURE__ */ jsx12(LinearGradient4, { 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__ */ jsx12(Stop4, { offset, stopColor: color }, offset)) });
|
|
928
972
|
return /* @__PURE__ */ jsxs9(View8, { style: { width: size, height: size }, ...a11y, children: [
|
|
929
|
-
/* @__PURE__ */ jsxs9(
|
|
930
|
-
/* @__PURE__ */ jsx12(
|
|
931
|
-
/* @__PURE__ */ jsx12(
|
|
932
|
-
/* @__PURE__ */ jsx12(
|
|
973
|
+
/* @__PURE__ */ jsxs9(Svg4, { viewBox, style: layer, children: [
|
|
974
|
+
/* @__PURE__ */ jsx12(Defs4, { children: /* @__PURE__ */ jsxs9(RadialGradient3, { id: "glow", cx: "50%", cy: "50%", r: "50%", children: [
|
|
975
|
+
/* @__PURE__ */ jsx12(Stop4, { offset: "0%", stopColor: OROCHIA.glow.color, stopOpacity: OROCHIA.glow.opacity }),
|
|
976
|
+
/* @__PURE__ */ jsx12(Stop4, { offset: "100%", stopColor: OROCHIA.glow.color, stopOpacity: 0 })
|
|
933
977
|
] }) }),
|
|
934
978
|
/* @__PURE__ */ jsx12(Circle3, { cx: CENTER, cy: CENTER, r: 170, fill: "url(#glow)" }),
|
|
935
979
|
/* @__PURE__ */ jsx12(Circle3, { cx: CENTER, cy: CENTER, r: OROCHIA.ring.r, stroke: neutral, strokeWidth: OROCHIA.ring.width, opacity: 0.35, fill: "none" })
|
|
936
980
|
] }),
|
|
937
|
-
/* @__PURE__ */ jsx12(Animated4.View, { style: [layer, { transform: [{ rotate: spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] }) }] }], children: /* @__PURE__ */ jsx12(
|
|
938
|
-
/* @__PURE__ */ jsxs9(
|
|
939
|
-
/* @__PURE__ */ jsx12(
|
|
981
|
+
/* @__PURE__ */ jsx12(Animated4.View, { style: [layer, { transform: [{ rotate: spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] }) }] }], children: /* @__PURE__ */ jsx12(Svg4, { viewBox, style: layer, children: /* @__PURE__ */ jsx12(Circle3, { cx: CENTER, cy: CENTER, r: OROCHIA.orbit.r, stroke: neutral, strokeWidth: OROCHIA.orbit.width, strokeDasharray: OROCHIA.orbit.dash, opacity: 0.6, fill: "none" }) }) }),
|
|
982
|
+
/* @__PURE__ */ jsxs9(Svg4, { viewBox, style: layer, children: [
|
|
983
|
+
/* @__PURE__ */ jsx12(Defs4, { children: bodyGradient }),
|
|
940
984
|
/* @__PURE__ */ jsxs9(Group2, { transform: `translate(${OROCHIA.offset} ${OROCHIA.offset})`, children: [
|
|
941
985
|
/* @__PURE__ */ jsx12(Path3, { d: OROCHIA.arc, stroke: "url(#body)", strokeWidth: 22, strokeLinecap: "round", fill: "none" }),
|
|
942
986
|
/* @__PURE__ */ jsx12(Path3, { d: OROCHIA.arc, stroke: OROCHIA.scales.color, strokeOpacity: OROCHIA.scales.opacity, strokeWidth: OROCHIA.scales.width, strokeLinecap: "round", strokeDasharray: OROCHIA.scales.dash, fill: "none" }),
|
|
@@ -946,8 +990,8 @@ function OrochiaMark({ size = 48, animated = true, title, neutral: neutralProp }
|
|
|
946
990
|
/* @__PURE__ */ jsx12(Path3, { d: OROCHIA.tongue.d, stroke: OROCHIA.tongue.color, strokeWidth: 3, strokeLinecap: "round", fill: "none" })
|
|
947
991
|
] })
|
|
948
992
|
] }),
|
|
949
|
-
/* @__PURE__ */ jsx12(Animated4.View, { style: [layer, { opacity: pulse.interpolate({ inputRange: [0, 1], outputRange: [0.85, 1] }) }], children: /* @__PURE__ */ jsxs9(
|
|
950
|
-
/* @__PURE__ */ jsx12(
|
|
993
|
+
/* @__PURE__ */ jsx12(Animated4.View, { style: [layer, { opacity: pulse.interpolate({ inputRange: [0, 1], outputRange: [0.85, 1] }) }], children: /* @__PURE__ */ jsxs9(Svg4, { viewBox, style: layer, children: [
|
|
994
|
+
/* @__PURE__ */ jsx12(Defs4, { children: /* @__PURE__ */ jsx12(LinearGradient4, { id: "flame", x1: "50%", y1: "100%", x2: "50%", y2: "0%", children: OROCHIA.flameGradient.stops.map(([offset, color]) => /* @__PURE__ */ jsx12(Stop4, { offset, stopColor: color }, offset)) }) }),
|
|
951
995
|
/* @__PURE__ */ jsxs9(Group2, { transform: `translate(${OROCHIA.offset} ${OROCHIA.offset})`, children: [
|
|
952
996
|
/* @__PURE__ */ jsx12(Circle3, { cx: OROCHIA.eye.cx, cy: OROCHIA.eye.cy, r: OROCHIA.eye.r, fill: OROCHIA.eye.color }),
|
|
953
997
|
/* @__PURE__ */ jsx12(Path3, { d: OROCHIA.flame.d, transform: `translate(${OROCHIA.flame.translate[0]} ${OROCHIA.flame.translate[1]}) scale(${OROCHIA.flame.scale})`, fill: "url(#flame)" })
|
|
@@ -965,9 +1009,9 @@ function ProductMark({ id, ...props }) {
|
|
|
965
1009
|
}
|
|
966
1010
|
|
|
967
1011
|
// src/native/progress.tsx
|
|
968
|
-
import * as
|
|
1012
|
+
import * as React8 from "react";
|
|
969
1013
|
import { Animated as Animated5, Easing as Easing3, StyleSheet as StyleSheet9, View as View9 } from "react-native";
|
|
970
|
-
import
|
|
1014
|
+
import Svg5, { Circle as Circle4, Defs as Defs5, LinearGradient as LinearGradient5, Rect as Rect2, Stop as Stop5 } from "react-native-svg";
|
|
971
1015
|
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
972
1016
|
var AnimatedCircle = Animated5.createAnimatedComponent(Circle4);
|
|
973
1017
|
var BAR = { sm: 4, md: 8, lg: 12 };
|
|
@@ -980,10 +1024,10 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
980
1024
|
const known = typeof value === "number" && Number.isFinite(value);
|
|
981
1025
|
const ratio = known ? Math.min(1, Math.max(0, value / (max || 1))) : 0;
|
|
982
1026
|
const percent = Math.round(ratio * 100);
|
|
983
|
-
const [progress] =
|
|
984
|
-
const [spin] =
|
|
985
|
-
const [track, setTrack] =
|
|
986
|
-
|
|
1027
|
+
const [progress] = React8.useState(() => new Animated5.Value(ratio));
|
|
1028
|
+
const [spin] = React8.useState(() => new Animated5.Value(0));
|
|
1029
|
+
const [track, setTrack] = React8.useState(0);
|
|
1030
|
+
React8.useEffect(() => {
|
|
987
1031
|
if (reduce) {
|
|
988
1032
|
progress.setValue(ratio);
|
|
989
1033
|
return;
|
|
@@ -992,7 +1036,7 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
992
1036
|
animation.start();
|
|
993
1037
|
return () => animation.stop();
|
|
994
1038
|
}, [ratio, reduce, progress]);
|
|
995
|
-
|
|
1039
|
+
React8.useEffect(() => {
|
|
996
1040
|
if (known || reduce) return;
|
|
997
1041
|
const loop = Animated5.loop(Animated5.timing(spin, { toValue: 1, duration: 1200, easing: Easing3.linear, useNativeDriver: true }));
|
|
998
1042
|
loop.start();
|
|
@@ -1010,9 +1054,9 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1010
1054
|
"aria-valuenow": known ? Math.min(max, Math.max(0, value)) : void 0,
|
|
1011
1055
|
"aria-valuetext": known ? valueText ?? `${percent}%` : valueText
|
|
1012
1056
|
};
|
|
1013
|
-
const gradient = /* @__PURE__ */ jsx14(
|
|
1014
|
-
/* @__PURE__ */ jsx14(
|
|
1015
|
-
/* @__PURE__ */ jsx14(
|
|
1057
|
+
const gradient = /* @__PURE__ */ jsx14(Defs5, { children: /* @__PURE__ */ jsxs10(LinearGradient5, { id, x1: "0", y1: "0", x2: "1", y2: variant === "ring" ? "1" : "0", children: [
|
|
1058
|
+
/* @__PURE__ */ jsx14(Stop5, { offset: "0", stopColor: theme.accent }),
|
|
1059
|
+
/* @__PURE__ */ jsx14(Stop5, { offset: "1", stopColor: theme.accent2 })
|
|
1016
1060
|
] }) });
|
|
1017
1061
|
if (variant === "ring") {
|
|
1018
1062
|
const side = RING[size];
|
|
@@ -1022,7 +1066,7 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1022
1066
|
const offset = known ? progress.interpolate({ inputRange: [0, 1], outputRange: [circumference, 0] }) : circumference * 0.75;
|
|
1023
1067
|
const rotate = spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] });
|
|
1024
1068
|
return /* @__PURE__ */ jsxs10(View9, { ...a11y, style: [styles9.ring, { width: side, height: side }, style], children: [
|
|
1025
|
-
/* @__PURE__ */ jsx14(Animated5.View, { style: [StyleSheet9.absoluteFill, { transform: [{ rotate: known ? "-90deg" : rotate }] }], children: /* @__PURE__ */ jsxs10(
|
|
1069
|
+
/* @__PURE__ */ jsx14(Animated5.View, { style: [StyleSheet9.absoluteFill, { transform: [{ rotate: known ? "-90deg" : rotate }] }], children: /* @__PURE__ */ jsxs10(Svg5, { width: side, height: side, viewBox: "0 0 100 100", children: [
|
|
1026
1070
|
gradient,
|
|
1027
1071
|
/* @__PURE__ */ jsx14(Circle4, { cx: 50, cy: 50, r, fill: "none", stroke: theme.borderDefault, strokeWidth: stroke }),
|
|
1028
1072
|
/* @__PURE__ */ jsx14(
|
|
@@ -1051,9 +1095,9 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1051
1095
|
...a11y,
|
|
1052
1096
|
onLayout: known ? void 0 : (event) => setTrack(event.nativeEvent.layout.width),
|
|
1053
1097
|
style: [styles9.bar, { height: BAR[size], backgroundColor: theme.surface3 }, style],
|
|
1054
|
-
children: /* @__PURE__ */ jsx14(Animated5.View, { style: [styles9.fill, { width }, known || reduce ? null : { transform: [{ translateX: translate }] }], children: /* @__PURE__ */ jsxs10(
|
|
1098
|
+
children: /* @__PURE__ */ jsx14(Animated5.View, { style: [styles9.fill, { width }, known || reduce ? null : { transform: [{ translateX: translate }] }], children: /* @__PURE__ */ jsxs10(Svg5, { width: "100%", height: "100%", preserveAspectRatio: "none", children: [
|
|
1055
1099
|
gradient,
|
|
1056
|
-
/* @__PURE__ */ jsx14(
|
|
1100
|
+
/* @__PURE__ */ jsx14(Rect2, { x: 0, y: 0, width: "100%", height: "100%", fill: `url(#${id})` })
|
|
1057
1101
|
] }) })
|
|
1058
1102
|
}
|
|
1059
1103
|
);
|
|
@@ -1109,7 +1153,7 @@ var styles10 = StyleSheet10.create({
|
|
|
1109
1153
|
});
|
|
1110
1154
|
|
|
1111
1155
|
// src/native/skeleton.tsx
|
|
1112
|
-
import * as
|
|
1156
|
+
import * as React9 from "react";
|
|
1113
1157
|
import { Animated as Animated6 } from "react-native";
|
|
1114
1158
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1115
1159
|
var SHAPE = {
|
|
@@ -1120,8 +1164,8 @@ var SHAPE = {
|
|
|
1120
1164
|
function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
1121
1165
|
const { theme } = useTheme();
|
|
1122
1166
|
const reduce = useReducedMotion();
|
|
1123
|
-
const [opacity] =
|
|
1124
|
-
|
|
1167
|
+
const [opacity] = React9.useState(() => new Animated6.Value(1));
|
|
1168
|
+
React9.useEffect(() => {
|
|
1125
1169
|
if (reduce) return;
|
|
1126
1170
|
const loop = Animated6.loop(
|
|
1127
1171
|
Animated6.sequence([
|
|
@@ -1170,7 +1214,7 @@ function Spinner({ label, size = "md", ...props }) {
|
|
|
1170
1214
|
}
|
|
1171
1215
|
|
|
1172
1216
|
// src/native/toast.tsx
|
|
1173
|
-
import * as
|
|
1217
|
+
import * as React10 from "react";
|
|
1174
1218
|
import { AccessibilityInfo as AccessibilityInfo4, Animated as Animated7, Pressable as Pressable5, StyleSheet as StyleSheet11, Text as Text7, View as View11 } from "react-native";
|
|
1175
1219
|
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1176
1220
|
var items = [];
|
|
@@ -1207,16 +1251,16 @@ var toast = Object.assign(show, {
|
|
|
1207
1251
|
function ToastView({ item, closeLabel, duration }) {
|
|
1208
1252
|
const { theme, radius: radius3 } = useTheme();
|
|
1209
1253
|
const reduce = useReducedMotion();
|
|
1210
|
-
const [enter] =
|
|
1211
|
-
|
|
1254
|
+
const [enter] = React10.useState(() => new Animated7.Value(reduce ? 1 : 0));
|
|
1255
|
+
React10.useEffect(() => {
|
|
1212
1256
|
if (reduce) enter.setValue(1);
|
|
1213
1257
|
else Animated7.timing(enter, { toValue: 1, duration: 220, useNativeDriver: true }).start();
|
|
1214
1258
|
}, [enter, reduce]);
|
|
1215
|
-
|
|
1259
|
+
React10.useEffect(() => {
|
|
1216
1260
|
AccessibilityInfo4.announceForAccessibility(item.description ? `${item.title}. ${item.description}` : item.title);
|
|
1217
1261
|
}, [item.title, item.description]);
|
|
1218
1262
|
const ms = item.duration ?? duration;
|
|
1219
|
-
|
|
1263
|
+
React10.useEffect(() => {
|
|
1220
1264
|
if (!Number.isFinite(ms)) return;
|
|
1221
1265
|
const timer2 = setTimeout(() => dismiss(item.id), ms);
|
|
1222
1266
|
return () => clearTimeout(timer2);
|
|
@@ -1264,7 +1308,7 @@ function ToastView({ item, closeLabel, duration }) {
|
|
|
1264
1308
|
return /* @__PURE__ */ jsx18(Animated7.View, { "aria-live": "polite", style: motion3, children: /* @__PURE__ */ jsx18(View11, { style: frame, children: body }) });
|
|
1265
1309
|
}
|
|
1266
1310
|
function Toaster({ closeLabel, position = "top", offset = 12, duration = 6e3, max = 3 }) {
|
|
1267
|
-
const all =
|
|
1311
|
+
const all = React10.useSyncExternalStore(subscribe2, snapshot, snapshot);
|
|
1268
1312
|
const shown = all.slice(-max);
|
|
1269
1313
|
if (shown.length === 0) return null;
|
|
1270
1314
|
return /* @__PURE__ */ jsx18(View11, { pointerEvents: "box-none", style: [styles11.stack, position === "top" ? { top: offset } : { bottom: offset }], children: (position === "top" ? shown : [...shown].reverse()).map((item) => /* @__PURE__ */ jsx18(ToastView, { item, closeLabel, duration }, item.id)) });
|