@krizaka/ui 2.0.0-beta.6 → 2.1.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 +13 -10
- 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/index.d.ts +2 -1
- package/dist/index.js +52 -10
- package/dist/index.js.map +1 -1
- package/dist/native.d.ts +20 -8
- package/dist/native.js +170 -184
- package/dist/native.js.map +1 -1
- package/dist/theme.d.ts +19 -9
- package/dist/theme.js +8 -5
- package/dist/theme.js.map +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 +24 -9
- 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,9 +30,10 @@ 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
|
-
var themes = Object.freeze({ dark: Object.freeze({
|
|
36
|
+
var themes = /* @__PURE__ */ Object.freeze({ dark: /* @__PURE__ */ Object.freeze({
|
|
36
37
|
"surface0": "#0c0c0e",
|
|
37
38
|
"surface1": "#161618",
|
|
38
39
|
"surface2": "#1f1f23",
|
|
@@ -56,13 +57,17 @@ 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)"
|
|
65
|
-
}), light: Object.freeze({
|
|
70
|
+
}), light: /* @__PURE__ */ Object.freeze({
|
|
66
71
|
"surface0": "#fafafa",
|
|
67
72
|
"surface1": "#ffffff",
|
|
68
73
|
"surface2": "#f1f1f3",
|
|
@@ -86,111 +91,60 @@ 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)"
|
|
95
104
|
}) });
|
|
96
|
-
var radius = Object.freeze({
|
|
105
|
+
var radius = /* @__PURE__ */ Object.freeze({
|
|
97
106
|
"sm": 8,
|
|
98
107
|
"md": 12,
|
|
99
108
|
"lg": 16,
|
|
100
109
|
"xl": 20,
|
|
101
110
|
"full": 9999
|
|
102
111
|
});
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"dark": {
|
|
140
|
-
"accent": "#f67e23",
|
|
141
|
-
"accentHover": "#f79245",
|
|
142
|
-
"accentSoft": "rgba(246,126,35,0.12)",
|
|
143
|
-
"accentText": "#f78c3b",
|
|
144
|
-
"accent2": "#f59e0b",
|
|
145
|
-
"onAccent": "#0c0c0e",
|
|
146
|
-
"ring": "#f67e23",
|
|
147
|
-
"info": "#3b83f7",
|
|
148
|
-
"brandGradientFrom": "#28170b",
|
|
149
|
-
"brandGradientVia": "#17130c",
|
|
150
|
-
"brandGradientTo": "#0c0c0e"
|
|
151
|
-
},
|
|
152
|
-
"light": {
|
|
153
|
-
"accent": "#b45309",
|
|
154
|
-
"accentHover": "#964608",
|
|
155
|
-
"accentSoft": "rgba(180,83,9,0.08)",
|
|
156
|
-
"accentText": "#9b4808",
|
|
157
|
-
"accent2": "#a45904",
|
|
158
|
-
"onAccent": "#ffffff",
|
|
159
|
-
"ring": "#b45309",
|
|
160
|
-
"info": "#0a64f5",
|
|
161
|
-
"brandGradientFrom": "#ffebd6",
|
|
162
|
-
"brandGradientVia": "#fdf7ed",
|
|
163
|
-
"brandGradientTo": "#fafafa"
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
"orochia": {
|
|
167
|
-
"dark": {
|
|
168
|
-
"accent": "#7c3aed",
|
|
169
|
-
"accentHover": "#6d28d9",
|
|
170
|
-
"accentSoft": "rgba(139,92,246,0.12)",
|
|
171
|
-
"accentText": "#a78bfa",
|
|
172
|
-
"accent2": "#db2777",
|
|
173
|
-
"onAccent": "#ffffff",
|
|
174
|
-
"ring": "#a78bfa",
|
|
175
|
-
"info": "#7c3aed",
|
|
176
|
-
"brandGradientFrom": "#1a0e2a",
|
|
177
|
-
"brandGradientVia": "#1c0d17",
|
|
178
|
-
"brandGradientTo": "#0c0c0e"
|
|
179
|
-
},
|
|
180
|
-
"light": {
|
|
181
|
-
"accent": "#7c3aed",
|
|
182
|
-
"accentHover": "#6d28d9",
|
|
183
|
-
"accentSoft": "rgba(124,58,237,0.08)",
|
|
184
|
-
"accentText": "#6d28d9",
|
|
185
|
-
"accent2": "#db2777",
|
|
186
|
-
"onAccent": "#ffffff",
|
|
187
|
-
"ring": "#7c3aed",
|
|
188
|
-
"info": "#7c3aed",
|
|
189
|
-
"brandGradientFrom": "#efe7fe",
|
|
190
|
-
"brandGradientVia": "#fdedf5",
|
|
191
|
-
"brandGradientTo": "#fafafa"
|
|
192
|
-
}
|
|
193
|
-
}
|
|
112
|
+
var motion = /* @__PURE__ */ Object.freeze({ ease: /* @__PURE__ */ Object.freeze([0.16, 1, 0.3, 1]) });
|
|
113
|
+
var marks = /* @__PURE__ */ Object.freeze({
|
|
114
|
+
"krizaka": [
|
|
115
|
+
[
|
|
116
|
+
"0%",
|
|
117
|
+
"#196df5"
|
|
118
|
+
],
|
|
119
|
+
[
|
|
120
|
+
"100%",
|
|
121
|
+
"#629cf8"
|
|
122
|
+
]
|
|
123
|
+
],
|
|
124
|
+
"orazaka": [
|
|
125
|
+
[
|
|
126
|
+
"0%",
|
|
127
|
+
"#b45309"
|
|
128
|
+
],
|
|
129
|
+
[
|
|
130
|
+
"100%",
|
|
131
|
+
"#dc6509"
|
|
132
|
+
]
|
|
133
|
+
],
|
|
134
|
+
"orochia": [
|
|
135
|
+
[
|
|
136
|
+
"0%",
|
|
137
|
+
"#7c3aed"
|
|
138
|
+
],
|
|
139
|
+
[
|
|
140
|
+
"55%",
|
|
141
|
+
"#d946ef"
|
|
142
|
+
],
|
|
143
|
+
[
|
|
144
|
+
"100%",
|
|
145
|
+
"#f472b6"
|
|
146
|
+
]
|
|
147
|
+
]
|
|
194
148
|
});
|
|
195
149
|
|
|
196
150
|
// src/native/theme.tsx
|
|
@@ -261,7 +215,10 @@ function useSvgId(prefix) {
|
|
|
261
215
|
// src/native/avatar.tsx
|
|
262
216
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
263
217
|
var SIDE = { xs: 20, sm: 32, md: 40, lg: 56, xl: 80 };
|
|
264
|
-
function
|
|
218
|
+
function isSvgUri(uri) {
|
|
219
|
+
return /^data:image\/svg\+xml[;,]/i.test(uri) || /\.svg(?:[?#]|$)/i.test(uri);
|
|
220
|
+
}
|
|
221
|
+
function AvatarRoot({ src, svg, alt = "", fallback, size = "md", style, ...props }) {
|
|
265
222
|
const { theme } = useTheme();
|
|
266
223
|
const [failedSrc, setFailedSrc] = React2.useState(null);
|
|
267
224
|
const failed = Boolean(src) && failedSrc === src;
|
|
@@ -276,7 +233,7 @@ function AvatarRoot({ src, alt = "", fallback, size = "md", style, ...props }) {
|
|
|
276
233
|
"aria-label": alt || void 0,
|
|
277
234
|
...props,
|
|
278
235
|
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
|
|
236
|
+
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
237
|
}
|
|
281
238
|
);
|
|
282
239
|
}
|
|
@@ -357,7 +314,9 @@ var styles2 = StyleSheet2.create({
|
|
|
357
314
|
});
|
|
358
315
|
|
|
359
316
|
// src/native/button.tsx
|
|
317
|
+
import * as React4 from "react";
|
|
360
318
|
import { ActivityIndicator, Pressable, StyleSheet as StyleSheet4, View as View2 } from "react-native";
|
|
319
|
+
import Svg, { Defs, LinearGradient, Rect, Stop } from "react-native-svg";
|
|
361
320
|
|
|
362
321
|
// src/native/txt.tsx
|
|
363
322
|
import { StyleSheet as StyleSheet3, Text as Text3 } from "react-native";
|
|
@@ -367,9 +326,9 @@ var TONE = {
|
|
|
367
326
|
secondary: "textSecondary",
|
|
368
327
|
muted: "textMuted",
|
|
369
328
|
accent: "accentText",
|
|
370
|
-
success: "
|
|
371
|
-
warning: "
|
|
372
|
-
danger: "
|
|
329
|
+
success: "successText",
|
|
330
|
+
warning: "warningText",
|
|
331
|
+
danger: "dangerText",
|
|
373
332
|
onAccent: "onAccent",
|
|
374
333
|
onMedia: "textOnMedia"
|
|
375
334
|
};
|
|
@@ -401,6 +360,8 @@ function look2(variant, t) {
|
|
|
401
360
|
switch (variant) {
|
|
402
361
|
case "primary":
|
|
403
362
|
return { bg: t.accent, fg: t.onAccent, border: t.accent };
|
|
363
|
+
case "gradient":
|
|
364
|
+
return { bg: t.accent, fg: t.onAccent, border: "transparent", gradient: [t.accent, t.accent2] };
|
|
404
365
|
case "outline":
|
|
405
366
|
return { bg: "transparent", fg: t.textPrimary, border: t.borderDefault };
|
|
406
367
|
case "ghost":
|
|
@@ -427,9 +388,20 @@ function useButton({ variant = "secondary", size = "md", shape = "rounded", load
|
|
|
427
388
|
});
|
|
428
389
|
return { colors, inactive, frame };
|
|
429
390
|
}
|
|
391
|
+
function Fill({ colors, id }) {
|
|
392
|
+
if (!colors.gradient) return null;
|
|
393
|
+
return /* @__PURE__ */ jsxs3(Svg, { "aria-hidden": true, pointerEvents: "none", style: StyleSheet4.absoluteFill, width: "100%", height: "100%", children: [
|
|
394
|
+
/* @__PURE__ */ jsx5(Defs, { children: /* @__PURE__ */ jsxs3(LinearGradient, { id, x1: "0", y1: "0", x2: "1", y2: "0", children: [
|
|
395
|
+
/* @__PURE__ */ jsx5(Stop, { offset: "0", stopColor: colors.gradient[0] }),
|
|
396
|
+
/* @__PURE__ */ jsx5(Stop, { offset: "1", stopColor: colors.gradient[1] })
|
|
397
|
+
] }) }),
|
|
398
|
+
/* @__PURE__ */ jsx5(Rect, { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
399
|
+
] });
|
|
400
|
+
}
|
|
430
401
|
function Button({ label, icon, variant, size = "md", shape, loading = false, disabled, style, ...props }) {
|
|
431
402
|
const { colors, inactive, frame } = useButton({ variant, size, shape, loading, disabled });
|
|
432
|
-
|
|
403
|
+
const gradientId = `kz-button-${React4.useId().replace(/:/g, "")}`;
|
|
404
|
+
return /* @__PURE__ */ jsxs3(
|
|
433
405
|
Pressable,
|
|
434
406
|
{
|
|
435
407
|
role: "button",
|
|
@@ -439,17 +411,21 @@ function Button({ label, icon, variant, size = "md", shape, loading = false, dis
|
|
|
439
411
|
...props,
|
|
440
412
|
disabled: inactive,
|
|
441
413
|
style: ({ pressed }) => [styles4.base, { paddingHorizontal: PADDING[size] }, frame(pressed), style],
|
|
442
|
-
children:
|
|
443
|
-
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ jsx5(Fill, { colors, id: gradientId }),
|
|
416
|
+
/* @__PURE__ */ jsxs3(View2, { style: styles4.row, children: [
|
|
417
|
+
loading ? /* @__PURE__ */ jsx5(ActivityIndicator, { "aria-hidden": true, size: "small", color: colors.fg }) : icon,
|
|
418
|
+
/* @__PURE__ */ jsx5(Txt, { variant: "label", numberOfLines: 1, style: { color: colors.fg, fontSize: size === "sm" ? 12 : 14 }, children: label })
|
|
419
|
+
] })
|
|
420
|
+
]
|
|
446
421
|
}
|
|
447
422
|
);
|
|
448
423
|
}
|
|
449
424
|
function IconButton({ label, icon, variant, size = "md", shape, loading = false, disabled, style, ...props }) {
|
|
450
425
|
const { colors, inactive, frame } = useButton({ variant, size, shape, loading, disabled });
|
|
426
|
+
const gradientId = `kz-button-${React4.useId().replace(/:/g, "")}`;
|
|
451
427
|
const side = HEIGHT[size];
|
|
452
|
-
return /* @__PURE__ */
|
|
428
|
+
return /* @__PURE__ */ jsxs3(
|
|
453
429
|
Pressable,
|
|
454
430
|
{
|
|
455
431
|
role: "button",
|
|
@@ -460,12 +436,15 @@ function IconButton({ label, icon, variant, size = "md", shape, loading = false,
|
|
|
460
436
|
...props,
|
|
461
437
|
disabled: inactive,
|
|
462
438
|
style: ({ pressed }) => [styles4.base, frame(pressed), { width: side }, style],
|
|
463
|
-
children:
|
|
439
|
+
children: [
|
|
440
|
+
/* @__PURE__ */ jsx5(Fill, { colors, id: gradientId }),
|
|
441
|
+
loading ? /* @__PURE__ */ jsx5(ActivityIndicator, { "aria-hidden": true, size: "small", color: colors.fg }) : icon
|
|
442
|
+
]
|
|
464
443
|
}
|
|
465
444
|
);
|
|
466
445
|
}
|
|
467
446
|
var styles4 = StyleSheet4.create({
|
|
468
|
-
base: { alignItems: "center", justifyContent: "center", borderWidth: 1 },
|
|
447
|
+
base: { alignItems: "center", justifyContent: "center", borderWidth: 1, overflow: "hidden" },
|
|
469
448
|
row: { flexDirection: "row", alignItems: "center", gap: 8 }
|
|
470
449
|
});
|
|
471
450
|
|
|
@@ -550,18 +529,18 @@ var styles5 = StyleSheet5.create({
|
|
|
550
529
|
});
|
|
551
530
|
|
|
552
531
|
// src/native/chip.tsx
|
|
553
|
-
import * as
|
|
532
|
+
import * as React5 from "react";
|
|
554
533
|
import { Pressable as Pressable3, ScrollView, StyleSheet as StyleSheet6, Text as Text4, View as View4 } from "react-native";
|
|
555
534
|
import { Fragment, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
556
|
-
var ChipGroupContext =
|
|
535
|
+
var ChipGroupContext = React5.createContext(null);
|
|
557
536
|
function Label({ children, color, size }) {
|
|
558
537
|
if (typeof children !== "string" && typeof children !== "number") return /* @__PURE__ */ jsx7(Fragment, { children });
|
|
559
538
|
return /* @__PURE__ */ jsx7(Text4, { style: [styles6.label, { color, fontSize: size === "sm" ? 12 : 13 }], children });
|
|
560
539
|
}
|
|
561
540
|
function ChipBase(props) {
|
|
562
|
-
const group =
|
|
541
|
+
const group = React5.useContext(ChipGroupContext);
|
|
563
542
|
const { theme, radius: radius3 } = useTheme();
|
|
564
|
-
const [own, setOwn] =
|
|
543
|
+
const [own, setOwn] = React5.useState(props.removable ? false : props.defaultSelected ?? false);
|
|
565
544
|
const size = props.size ?? group?.size ?? "md";
|
|
566
545
|
const frame = (on2, pressed) => ({
|
|
567
546
|
height: size === "sm" ? 28 : 36,
|
|
@@ -604,9 +583,9 @@ function ChipBase(props) {
|
|
|
604
583
|
function ChipGroup(props) {
|
|
605
584
|
const { size, disabled, scrollable, "aria-label": label, style, children } = props;
|
|
606
585
|
const initial = props.type === "single" ? props.defaultValue ?? "" : props.defaultValue ?? [];
|
|
607
|
-
const [own, setOwn] =
|
|
586
|
+
const [own, setOwn] = React5.useState(initial);
|
|
608
587
|
const current = props.value ?? own;
|
|
609
|
-
const context =
|
|
588
|
+
const context = React5.useMemo(() => {
|
|
610
589
|
const list = Array.isArray(current) ? current : [current];
|
|
611
590
|
return {
|
|
612
591
|
type: props.type,
|
|
@@ -635,18 +614,18 @@ var styles6 = StyleSheet6.create({
|
|
|
635
614
|
});
|
|
636
615
|
|
|
637
616
|
// src/native/countdown.tsx
|
|
638
|
-
import * as
|
|
617
|
+
import * as React6 from "react";
|
|
639
618
|
import { Animated as Animated2, StyleSheet as StyleSheet7, Text as Text5 } from "react-native";
|
|
640
619
|
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
641
620
|
var FONT = { sm: 14, md: 20, lg: 32 };
|
|
642
|
-
function Countdown({ target, skewMs = 0, units, urgentBelowMs = 6e4, size = "md", label, style }) {
|
|
621
|
+
function Countdown({ target, skewMs = 0, units, urgentBelowMs = 6e4, size = "md", label, showLabel = false, style }) {
|
|
643
622
|
const { theme, fonts } = useTheme();
|
|
644
623
|
const reduce = useReducedMotion();
|
|
645
624
|
const ms = useCountdown(target, skewMs);
|
|
646
625
|
const urgent = ms > 0 && ms < urgentBelowMs;
|
|
647
626
|
const parts = countdownParts(ms, units);
|
|
648
|
-
const [opacity] =
|
|
649
|
-
|
|
627
|
+
const [opacity] = React6.useState(() => new Animated2.Value(1));
|
|
628
|
+
React6.useEffect(() => {
|
|
650
629
|
if (!urgent || reduce) return;
|
|
651
630
|
const loop = Animated2.loop(
|
|
652
631
|
Animated2.sequence([
|
|
@@ -660,19 +639,22 @@ function Countdown({ target, skewMs = 0, units, urgentBelowMs = 6e4, size = "md"
|
|
|
660
639
|
opacity.setValue(1);
|
|
661
640
|
};
|
|
662
641
|
}, [urgent, reduce, opacity]);
|
|
663
|
-
const color = urgent ? theme.
|
|
642
|
+
const color = urgent ? theme.dangerText : theme.textPrimary;
|
|
664
643
|
const text = parts.map(([value, unit]) => `${String(value).padStart(2, "0")}${unit}`).join(" ");
|
|
665
|
-
return /* @__PURE__ */
|
|
644
|
+
return /* @__PURE__ */ jsxs5(
|
|
666
645
|
Animated2.View,
|
|
667
646
|
{
|
|
668
647
|
accessible: true,
|
|
669
648
|
role: "timer",
|
|
670
649
|
"aria-label": `${label} ${text}`,
|
|
671
650
|
style: [styles7.root, style],
|
|
672
|
-
children:
|
|
673
|
-
/* @__PURE__ */ jsx8(Text5, { style: [styles7.
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
|
|
651
|
+
children: [
|
|
652
|
+
showLabel ? /* @__PURE__ */ jsx8(Text5, { style: [styles7.label, { color: theme.textSecondary, fontSize: Math.max(11, Math.round(FONT[size] * 0.6)) }], children: label }) : null,
|
|
653
|
+
parts.map(([value, unit], i) => /* @__PURE__ */ jsxs5(Animated2.View, { style: [styles7.segment, urgent && i === parts.length - 1 ? { opacity } : null], children: [
|
|
654
|
+
/* @__PURE__ */ jsx8(Text5, { style: [styles7.value, { color, fontSize: FONT[size] }, fonts.display ? { fontFamily: fonts.display } : null], children: String(value).padStart(2, "0") }),
|
|
655
|
+
/* @__PURE__ */ jsx8(Text5, { style: [styles7.unit, { color: theme.textSecondary, fontSize: Math.round(FONT[size] / 2) }], children: unit })
|
|
656
|
+
] }, unit))
|
|
657
|
+
]
|
|
676
658
|
}
|
|
677
659
|
);
|
|
678
660
|
}
|
|
@@ -680,7 +662,8 @@ var styles7 = StyleSheet7.create({
|
|
|
680
662
|
root: { flexDirection: "row", alignItems: "baseline", gap: 6 },
|
|
681
663
|
segment: { flexDirection: "row", alignItems: "baseline" },
|
|
682
664
|
value: { fontWeight: "900", fontVariant: ["tabular-nums"], letterSpacing: -0.3 },
|
|
683
|
-
unit: { marginLeft: 2, fontWeight: "700", textTransform: "uppercase" }
|
|
665
|
+
unit: { marginLeft: 2, fontWeight: "700", textTransform: "uppercase" },
|
|
666
|
+
label: { fontWeight: "600", marginRight: 2 }
|
|
684
667
|
});
|
|
685
668
|
|
|
686
669
|
// src/native/empty-state.tsx
|
|
@@ -704,7 +687,7 @@ var styles8 = StyleSheet8.create({
|
|
|
704
687
|
|
|
705
688
|
// src/native/KrizakaMark.tsx
|
|
706
689
|
import { View as View6 } from "react-native";
|
|
707
|
-
import
|
|
690
|
+
import Svg2, { Circle, Defs as Defs2, G as Group, LinearGradient as LinearGradient2, Path, RadialGradient, Stop as Stop2 } from "react-native-svg";
|
|
708
691
|
|
|
709
692
|
// src/marks/krizaka-geometry.ts
|
|
710
693
|
var KRIZAKA = {
|
|
@@ -715,7 +698,7 @@ var KRIZAKA = {
|
|
|
715
698
|
shield: "M259.7,134 L259.7,226 L180,272 L100.3,226 L100.3,134 L180,88 L212,106.5",
|
|
716
699
|
stroke: 22,
|
|
717
700
|
ink: { x1: 70, y1: 290, x2: 290, y2: 70 },
|
|
718
|
-
blue: { x1: 180, y1: 180, x2: 300, y2: 60, stops:
|
|
701
|
+
blue: { x1: 180, y1: 180, x2: 300, y2: 60, stops: marks.krizaka },
|
|
719
702
|
/** The vertex where the shield opens: a node (the serpent's head in Orochia's grammar). */
|
|
720
703
|
node: { cx: 259.7, cy: 134, r: 19, inner: 6 },
|
|
721
704
|
core: { cx: 180, cy: 180, r: 24, inner: 8 },
|
|
@@ -770,21 +753,21 @@ function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
770
753
|
const id = useSvgId("kzm");
|
|
771
754
|
const viewBox = size < 48 ? KRIZAKA.croppedViewBox : KRIZAKA.viewBox;
|
|
772
755
|
const stroke = neutral ?? theme.textMuted;
|
|
773
|
-
const blue = /* @__PURE__ */ jsx10(
|
|
756
|
+
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
757
|
const dot = (c) => /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
775
758
|
/* @__PURE__ */ jsx10(Circle, { cx: c.cx, cy: c.cy, r: c.r, fill: `url(#${id}b)` }),
|
|
776
759
|
/* @__PURE__ */ jsx10(Circle, { cx: c.cx, cy: c.cy, r: c.inner, fill: KRIZAKA.highlight })
|
|
777
760
|
] });
|
|
778
761
|
return /* @__PURE__ */ jsxs7(View6, { style: { width: size, height: size }, ...markA11y(title), children: [
|
|
779
|
-
/* @__PURE__ */ jsxs7(
|
|
780
|
-
/* @__PURE__ */ jsxs7(
|
|
762
|
+
/* @__PURE__ */ jsxs7(Svg2, { viewBox, style: layer, children: [
|
|
763
|
+
/* @__PURE__ */ jsxs7(Defs2, { children: [
|
|
781
764
|
/* @__PURE__ */ jsxs7(RadialGradient, { id: `${id}g`, cx: "50%", cy: "50%", r: "50%", children: [
|
|
782
|
-
/* @__PURE__ */ jsx10(
|
|
783
|
-
/* @__PURE__ */ jsx10(
|
|
765
|
+
/* @__PURE__ */ jsx10(Stop2, { offset: "0%", stopColor: KRIZAKA.glow.color, stopOpacity: KRIZAKA.glow.opacity }),
|
|
766
|
+
/* @__PURE__ */ jsx10(Stop2, { offset: "100%", stopColor: KRIZAKA.glow.color, stopOpacity: 0 })
|
|
784
767
|
] }),
|
|
785
|
-
/* @__PURE__ */ jsxs7(
|
|
786
|
-
/* @__PURE__ */ jsx10(
|
|
787
|
-
/* @__PURE__ */ jsx10(
|
|
768
|
+
/* @__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: [
|
|
769
|
+
/* @__PURE__ */ jsx10(Stop2, { offset: "0%", stopColor: theme.textSecondary }),
|
|
770
|
+
/* @__PURE__ */ jsx10(Stop2, { offset: "100%", stopColor: theme.textPrimary })
|
|
788
771
|
] }),
|
|
789
772
|
blue
|
|
790
773
|
] }),
|
|
@@ -792,9 +775,9 @@ function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
792
775
|
/* @__PURE__ */ jsx10(Circle, { cx: 200, cy: 200, r: KRIZAKA.ring.r, stroke, strokeWidth: KRIZAKA.ring.width, opacity: 0.35, fill: "none" }),
|
|
793
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" }) })
|
|
794
777
|
] }),
|
|
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(
|
|
778
|
+
/* @__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" }) }) }),
|
|
779
|
+
/* @__PURE__ */ jsx10(Animated8.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs7(Svg2, { viewBox, style: layer, children: [
|
|
780
|
+
/* @__PURE__ */ jsx10(Defs2, { children: blue }),
|
|
798
781
|
/* @__PURE__ */ jsxs7(Group, { transform: `translate(${KRIZAKA.offset} ${KRIZAKA.offset})`, children: [
|
|
799
782
|
dot(KRIZAKA.node),
|
|
800
783
|
dot(KRIZAKA.core)
|
|
@@ -805,9 +788,10 @@ function KrizakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
805
788
|
|
|
806
789
|
// src/native/OrazakaMark.tsx
|
|
807
790
|
import { View as View7 } from "react-native";
|
|
808
|
-
import
|
|
791
|
+
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
792
|
|
|
810
793
|
// src/marks/orazaka-geometry.ts
|
|
794
|
+
var orange = marks.orazaka[marks.orazaka.length - 1][1];
|
|
811
795
|
var ORAZAKA = {
|
|
812
796
|
viewBox: "0 0 400 400",
|
|
813
797
|
croppedViewBox: "76 76 248 248",
|
|
@@ -822,10 +806,12 @@ var ORAZAKA = {
|
|
|
822
806
|
"M154.5,278.9 L108.8,252.6 L108.9,199.9 L137.7,183.3 L156.8,194.3 L128,210.9 L127.9,241.6 L154.6,257 L183.4,240.3 L183.3,262.3 Z"
|
|
823
807
|
],
|
|
824
808
|
shardStroke: 5.7,
|
|
825
|
-
|
|
809
|
+
gradient: { x1: 90, y1: 310, x2: 310, y2: 90, stops: marks.orazaka },
|
|
826
810
|
core: { r: 21, inner: 7.6 },
|
|
827
|
-
highlight: "#
|
|
828
|
-
glow: { color:
|
|
811
|
+
highlight: "#fff7ed",
|
|
812
|
+
glow: { color: orange, opacity: 0.16 },
|
|
813
|
+
/** The core's breathing shadow (web), in the mark's orange. */
|
|
814
|
+
pulse: { color: orange, low: 0.3, high: 0.6 },
|
|
829
815
|
orbit: { r: 160, dash: "8 8", width: 1.5 },
|
|
830
816
|
ring: { r: 134, width: 1 }
|
|
831
817
|
};
|
|
@@ -838,24 +824,24 @@ function OrazakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
838
824
|
const id = useSvgId("ozm");
|
|
839
825
|
const viewBox = size < 48 ? ORAZAKA.croppedViewBox : ORAZAKA.viewBox;
|
|
840
826
|
const stroke = neutral ?? theme.textMuted;
|
|
841
|
-
const
|
|
827
|
+
const gradient = /* @__PURE__ */ jsx11(LinearGradient3, { 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__ */ jsx11(Stop3, { offset, stopColor: color }, offset)) });
|
|
842
828
|
const fill = `url(#${id}a)`;
|
|
843
829
|
return /* @__PURE__ */ jsxs8(View7, { style: { width: size, height: size }, ...markA11y(title), children: [
|
|
844
|
-
/* @__PURE__ */ jsxs8(
|
|
845
|
-
/* @__PURE__ */ jsx11(
|
|
846
|
-
/* @__PURE__ */ jsx11(
|
|
847
|
-
/* @__PURE__ */ jsx11(
|
|
830
|
+
/* @__PURE__ */ jsxs8(Svg3, { viewBox, style: layer, children: [
|
|
831
|
+
/* @__PURE__ */ jsx11(Defs3, { children: /* @__PURE__ */ jsxs8(RadialGradient2, { id: `${id}g`, cx: "50%", cy: "50%", r: "50%", children: [
|
|
832
|
+
/* @__PURE__ */ jsx11(Stop3, { offset: "0%", stopColor: ORAZAKA.glow.color, stopOpacity: ORAZAKA.glow.opacity }),
|
|
833
|
+
/* @__PURE__ */ jsx11(Stop3, { offset: "100%", stopColor: ORAZAKA.glow.color, stopOpacity: 0 })
|
|
848
834
|
] }) }),
|
|
849
835
|
size >= 48 ? /* @__PURE__ */ jsx11(Circle2, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: 190, fill: `url(#${id}g)` }) : null,
|
|
850
836
|
/* @__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
837
|
/* @__PURE__ */ jsx11(Circle2, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.ring.r, stroke, strokeWidth: ORAZAKA.ring.width, opacity: 0.35, fill: "none" })
|
|
852
838
|
] }),
|
|
853
|
-
/* @__PURE__ */ jsx11(Animated8.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsxs8(
|
|
854
|
-
/* @__PURE__ */ jsx11(
|
|
839
|
+
/* @__PURE__ */ jsx11(Animated8.View, { style: [layer, spinStyle], children: /* @__PURE__ */ jsxs8(Svg3, { viewBox, style: layer, children: [
|
|
840
|
+
/* @__PURE__ */ jsx11(Defs3, { children: gradient }),
|
|
855
841
|
ORAZAKA.shards.map((d) => /* @__PURE__ */ jsx11(Path2, { d, fill, stroke: fill, strokeWidth: ORAZAKA.shardStroke, strokeLinejoin: "round" }, d))
|
|
856
842
|
] }) }),
|
|
857
|
-
/* @__PURE__ */ jsx11(Animated8.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs8(
|
|
858
|
-
/* @__PURE__ */ jsx11(
|
|
843
|
+
/* @__PURE__ */ jsx11(Animated8.View, { style: [layer, pulseStyle], children: /* @__PURE__ */ jsxs8(Svg3, { viewBox, style: layer, children: [
|
|
844
|
+
/* @__PURE__ */ jsx11(Defs3, { children: gradient }),
|
|
859
845
|
/* @__PURE__ */ jsx11(Circle2, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.core.r, fill }),
|
|
860
846
|
/* @__PURE__ */ jsx11(Circle2, { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.core.inner, fill: ORAZAKA.highlight })
|
|
861
847
|
] }) })
|
|
@@ -865,14 +851,14 @@ function OrazakaMark({ size = 48, animated = true, title, neutral }) {
|
|
|
865
851
|
// src/native/OrochiaMark.tsx
|
|
866
852
|
import { useEffect as useEffect5, useState as useState7 } from "react";
|
|
867
853
|
import { AccessibilityInfo as AccessibilityInfo3, Animated as Animated4, Easing as Easing2, View as View8 } from "react-native";
|
|
868
|
-
import
|
|
854
|
+
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
855
|
|
|
870
856
|
// src/marks/orochia-geometry.ts
|
|
871
857
|
var OROCHIA = {
|
|
872
858
|
viewBox: "0 0 400 400",
|
|
873
859
|
croppedViewBox: "86 82 228 228",
|
|
874
860
|
offset: 20,
|
|
875
|
-
body: { x1: 70, y1: 290, x2: 290, y2: 70, stops:
|
|
861
|
+
body: { x1: 70, y1: 290, x2: 290, y2: 70, stops: marks.orochia },
|
|
876
862
|
flameGradient: { stops: [["0%", "#a855f7"], ["100%", "#f9a8d4"]] },
|
|
877
863
|
glow: { color: "#d946ef", opacity: 0.18 },
|
|
878
864
|
orbit: { r: 160, dash: "8 8", width: 1.5 },
|
|
@@ -924,19 +910,19 @@ function OrochiaMark({ size = 48, animated = true, title, neutral: neutralProp }
|
|
|
924
910
|
const viewBox = size < 48 ? OROCHIA.croppedViewBox : OROCHIA.viewBox;
|
|
925
911
|
const layer = { position: "absolute", width: size, height: size };
|
|
926
912
|
const a11y = title ? { accessible: true, accessibilityRole: "image", accessibilityLabel: title } : { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants" };
|
|
927
|
-
const bodyGradient = /* @__PURE__ */ jsx12(
|
|
913
|
+
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
914
|
return /* @__PURE__ */ jsxs9(View8, { style: { width: size, height: size }, ...a11y, children: [
|
|
929
|
-
/* @__PURE__ */ jsxs9(
|
|
930
|
-
/* @__PURE__ */ jsx12(
|
|
931
|
-
/* @__PURE__ */ jsx12(
|
|
932
|
-
/* @__PURE__ */ jsx12(
|
|
915
|
+
/* @__PURE__ */ jsxs9(Svg4, { viewBox, style: layer, children: [
|
|
916
|
+
/* @__PURE__ */ jsx12(Defs4, { children: /* @__PURE__ */ jsxs9(RadialGradient3, { id: "glow", cx: "50%", cy: "50%", r: "50%", children: [
|
|
917
|
+
/* @__PURE__ */ jsx12(Stop4, { offset: "0%", stopColor: OROCHIA.glow.color, stopOpacity: OROCHIA.glow.opacity }),
|
|
918
|
+
/* @__PURE__ */ jsx12(Stop4, { offset: "100%", stopColor: OROCHIA.glow.color, stopOpacity: 0 })
|
|
933
919
|
] }) }),
|
|
934
920
|
/* @__PURE__ */ jsx12(Circle3, { cx: CENTER, cy: CENTER, r: 170, fill: "url(#glow)" }),
|
|
935
921
|
/* @__PURE__ */ jsx12(Circle3, { cx: CENTER, cy: CENTER, r: OROCHIA.ring.r, stroke: neutral, strokeWidth: OROCHIA.ring.width, opacity: 0.35, fill: "none" })
|
|
936
922
|
] }),
|
|
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(
|
|
923
|
+
/* @__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" }) }) }),
|
|
924
|
+
/* @__PURE__ */ jsxs9(Svg4, { viewBox, style: layer, children: [
|
|
925
|
+
/* @__PURE__ */ jsx12(Defs4, { children: bodyGradient }),
|
|
940
926
|
/* @__PURE__ */ jsxs9(Group2, { transform: `translate(${OROCHIA.offset} ${OROCHIA.offset})`, children: [
|
|
941
927
|
/* @__PURE__ */ jsx12(Path3, { d: OROCHIA.arc, stroke: "url(#body)", strokeWidth: 22, strokeLinecap: "round", fill: "none" }),
|
|
942
928
|
/* @__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 +932,8 @@ function OrochiaMark({ size = 48, animated = true, title, neutral: neutralProp }
|
|
|
946
932
|
/* @__PURE__ */ jsx12(Path3, { d: OROCHIA.tongue.d, stroke: OROCHIA.tongue.color, strokeWidth: 3, strokeLinecap: "round", fill: "none" })
|
|
947
933
|
] })
|
|
948
934
|
] }),
|
|
949
|
-
/* @__PURE__ */ jsx12(Animated4.View, { style: [layer, { opacity: pulse.interpolate({ inputRange: [0, 1], outputRange: [0.85, 1] }) }], children: /* @__PURE__ */ jsxs9(
|
|
950
|
-
/* @__PURE__ */ jsx12(
|
|
935
|
+
/* @__PURE__ */ jsx12(Animated4.View, { style: [layer, { opacity: pulse.interpolate({ inputRange: [0, 1], outputRange: [0.85, 1] }) }], children: /* @__PURE__ */ jsxs9(Svg4, { viewBox, style: layer, children: [
|
|
936
|
+
/* @__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
937
|
/* @__PURE__ */ jsxs9(Group2, { transform: `translate(${OROCHIA.offset} ${OROCHIA.offset})`, children: [
|
|
952
938
|
/* @__PURE__ */ jsx12(Circle3, { cx: OROCHIA.eye.cx, cy: OROCHIA.eye.cy, r: OROCHIA.eye.r, fill: OROCHIA.eye.color }),
|
|
953
939
|
/* @__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 +951,9 @@ function ProductMark({ id, ...props }) {
|
|
|
965
951
|
}
|
|
966
952
|
|
|
967
953
|
// src/native/progress.tsx
|
|
968
|
-
import * as
|
|
954
|
+
import * as React8 from "react";
|
|
969
955
|
import { Animated as Animated5, Easing as Easing3, StyleSheet as StyleSheet9, View as View9 } from "react-native";
|
|
970
|
-
import
|
|
956
|
+
import Svg5, { Circle as Circle4, Defs as Defs5, LinearGradient as LinearGradient5, Rect as Rect2, Stop as Stop5 } from "react-native-svg";
|
|
971
957
|
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
972
958
|
var AnimatedCircle = Animated5.createAnimatedComponent(Circle4);
|
|
973
959
|
var BAR = { sm: 4, md: 8, lg: 12 };
|
|
@@ -980,10 +966,10 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
980
966
|
const known = typeof value === "number" && Number.isFinite(value);
|
|
981
967
|
const ratio = known ? Math.min(1, Math.max(0, value / (max || 1))) : 0;
|
|
982
968
|
const percent = Math.round(ratio * 100);
|
|
983
|
-
const [progress] =
|
|
984
|
-
const [spin] =
|
|
985
|
-
const [track, setTrack] =
|
|
986
|
-
|
|
969
|
+
const [progress] = React8.useState(() => new Animated5.Value(ratio));
|
|
970
|
+
const [spin] = React8.useState(() => new Animated5.Value(0));
|
|
971
|
+
const [track, setTrack] = React8.useState(0);
|
|
972
|
+
React8.useEffect(() => {
|
|
987
973
|
if (reduce) {
|
|
988
974
|
progress.setValue(ratio);
|
|
989
975
|
return;
|
|
@@ -992,7 +978,7 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
992
978
|
animation.start();
|
|
993
979
|
return () => animation.stop();
|
|
994
980
|
}, [ratio, reduce, progress]);
|
|
995
|
-
|
|
981
|
+
React8.useEffect(() => {
|
|
996
982
|
if (known || reduce) return;
|
|
997
983
|
const loop = Animated5.loop(Animated5.timing(spin, { toValue: 1, duration: 1200, easing: Easing3.linear, useNativeDriver: true }));
|
|
998
984
|
loop.start();
|
|
@@ -1010,9 +996,9 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1010
996
|
"aria-valuenow": known ? Math.min(max, Math.max(0, value)) : void 0,
|
|
1011
997
|
"aria-valuetext": known ? valueText ?? `${percent}%` : valueText
|
|
1012
998
|
};
|
|
1013
|
-
const gradient = /* @__PURE__ */ jsx14(
|
|
1014
|
-
/* @__PURE__ */ jsx14(
|
|
1015
|
-
/* @__PURE__ */ jsx14(
|
|
999
|
+
const gradient = /* @__PURE__ */ jsx14(Defs5, { children: /* @__PURE__ */ jsxs10(LinearGradient5, { id, x1: "0", y1: "0", x2: "1", y2: variant === "ring" ? "1" : "0", children: [
|
|
1000
|
+
/* @__PURE__ */ jsx14(Stop5, { offset: "0", stopColor: theme.accent }),
|
|
1001
|
+
/* @__PURE__ */ jsx14(Stop5, { offset: "1", stopColor: theme.accent2 })
|
|
1016
1002
|
] }) });
|
|
1017
1003
|
if (variant === "ring") {
|
|
1018
1004
|
const side = RING[size];
|
|
@@ -1022,7 +1008,7 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1022
1008
|
const offset = known ? progress.interpolate({ inputRange: [0, 1], outputRange: [circumference, 0] }) : circumference * 0.75;
|
|
1023
1009
|
const rotate = spin.interpolate({ inputRange: [0, 1], outputRange: ["0deg", "360deg"] });
|
|
1024
1010
|
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(
|
|
1011
|
+
/* @__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
1012
|
gradient,
|
|
1027
1013
|
/* @__PURE__ */ jsx14(Circle4, { cx: 50, cy: 50, r, fill: "none", stroke: theme.borderDefault, strokeWidth: stroke }),
|
|
1028
1014
|
/* @__PURE__ */ jsx14(
|
|
@@ -1051,9 +1037,9 @@ function Progress({ variant = "bar", size = "md", value, max = 100, label, value
|
|
|
1051
1037
|
...a11y,
|
|
1052
1038
|
onLayout: known ? void 0 : (event) => setTrack(event.nativeEvent.layout.width),
|
|
1053
1039
|
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(
|
|
1040
|
+
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
1041
|
gradient,
|
|
1056
|
-
/* @__PURE__ */ jsx14(
|
|
1042
|
+
/* @__PURE__ */ jsx14(Rect2, { x: 0, y: 0, width: "100%", height: "100%", fill: `url(#${id})` })
|
|
1057
1043
|
] }) })
|
|
1058
1044
|
}
|
|
1059
1045
|
);
|
|
@@ -1109,7 +1095,7 @@ var styles10 = StyleSheet10.create({
|
|
|
1109
1095
|
});
|
|
1110
1096
|
|
|
1111
1097
|
// src/native/skeleton.tsx
|
|
1112
|
-
import * as
|
|
1098
|
+
import * as React9 from "react";
|
|
1113
1099
|
import { Animated as Animated6 } from "react-native";
|
|
1114
1100
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1115
1101
|
var SHAPE = {
|
|
@@ -1120,8 +1106,8 @@ var SHAPE = {
|
|
|
1120
1106
|
function Skeleton({ shape = "text", width, height, style, testID }) {
|
|
1121
1107
|
const { theme } = useTheme();
|
|
1122
1108
|
const reduce = useReducedMotion();
|
|
1123
|
-
const [opacity] =
|
|
1124
|
-
|
|
1109
|
+
const [opacity] = React9.useState(() => new Animated6.Value(1));
|
|
1110
|
+
React9.useEffect(() => {
|
|
1125
1111
|
if (reduce) return;
|
|
1126
1112
|
const loop = Animated6.loop(
|
|
1127
1113
|
Animated6.sequence([
|
|
@@ -1170,7 +1156,7 @@ function Spinner({ label, size = "md", ...props }) {
|
|
|
1170
1156
|
}
|
|
1171
1157
|
|
|
1172
1158
|
// src/native/toast.tsx
|
|
1173
|
-
import * as
|
|
1159
|
+
import * as React10 from "react";
|
|
1174
1160
|
import { AccessibilityInfo as AccessibilityInfo4, Animated as Animated7, Pressable as Pressable5, StyleSheet as StyleSheet11, Text as Text7, View as View11 } from "react-native";
|
|
1175
1161
|
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1176
1162
|
var items = [];
|
|
@@ -1207,16 +1193,16 @@ var toast = Object.assign(show, {
|
|
|
1207
1193
|
function ToastView({ item, closeLabel, duration }) {
|
|
1208
1194
|
const { theme, radius: radius3 } = useTheme();
|
|
1209
1195
|
const reduce = useReducedMotion();
|
|
1210
|
-
const [enter] =
|
|
1211
|
-
|
|
1196
|
+
const [enter] = React10.useState(() => new Animated7.Value(reduce ? 1 : 0));
|
|
1197
|
+
React10.useEffect(() => {
|
|
1212
1198
|
if (reduce) enter.setValue(1);
|
|
1213
1199
|
else Animated7.timing(enter, { toValue: 1, duration: 220, useNativeDriver: true }).start();
|
|
1214
1200
|
}, [enter, reduce]);
|
|
1215
|
-
|
|
1201
|
+
React10.useEffect(() => {
|
|
1216
1202
|
AccessibilityInfo4.announceForAccessibility(item.description ? `${item.title}. ${item.description}` : item.title);
|
|
1217
1203
|
}, [item.title, item.description]);
|
|
1218
1204
|
const ms = item.duration ?? duration;
|
|
1219
|
-
|
|
1205
|
+
React10.useEffect(() => {
|
|
1220
1206
|
if (!Number.isFinite(ms)) return;
|
|
1221
1207
|
const timer2 = setTimeout(() => dismiss(item.id), ms);
|
|
1222
1208
|
return () => clearTimeout(timer2);
|
|
@@ -1264,7 +1250,7 @@ function ToastView({ item, closeLabel, duration }) {
|
|
|
1264
1250
|
return /* @__PURE__ */ jsx18(Animated7.View, { "aria-live": "polite", style: motion3, children: /* @__PURE__ */ jsx18(View11, { style: frame, children: body }) });
|
|
1265
1251
|
}
|
|
1266
1252
|
function Toaster({ closeLabel, position = "top", offset = 12, duration = 6e3, max = 3 }) {
|
|
1267
|
-
const all =
|
|
1253
|
+
const all = React10.useSyncExternalStore(subscribe2, snapshot, snapshot);
|
|
1268
1254
|
const shown = all.slice(-max);
|
|
1269
1255
|
if (shown.length === 0) return null;
|
|
1270
1256
|
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)) });
|