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