@squadbase/vantage 0.6.2-dev1.42c4e48 → 0.6.2-dev1.81c1bbe
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/{build-MFWRPYKW.js → build-X5NVCQKT.js} +4 -4
- package/dist/{build-MFWRPYKW.js.map → build-X5NVCQKT.js.map} +1 -1
- package/dist/chunk-2IAPIOPS.js +152 -0
- package/dist/chunk-2IAPIOPS.js.map +1 -0
- package/dist/{chunk-IBGOCWJB.js → chunk-2ICNHUG6.js} +186 -82
- package/dist/chunk-2ICNHUG6.js.map +1 -0
- package/dist/{chunk-5ZOP4SQR.js → chunk-2N72FKLB.js} +12 -7
- package/dist/chunk-2N72FKLB.js.map +1 -0
- package/dist/chunk-57GHR5LN.js +163 -0
- package/dist/chunk-57GHR5LN.js.map +1 -0
- package/dist/{chunk-OB6UBJXF.js → chunk-7S52M2SL.js} +127 -36
- package/dist/chunk-7S52M2SL.js.map +1 -0
- package/dist/chunk-JXFCSF3K.js +673 -0
- package/dist/chunk-JXFCSF3K.js.map +1 -0
- package/dist/{chunk-PXRX5PEC.js → chunk-PDOBHMUQ.js} +3 -3
- package/dist/chunk-PDOBHMUQ.js.map +1 -0
- package/dist/chunk-RU6WKEOG.js +7048 -0
- package/dist/chunk-RU6WKEOG.js.map +1 -0
- package/dist/{chunk-A2UUGASH.js → chunk-U736PVHY.js} +2 -2
- package/dist/chunk-U736PVHY.js.map +1 -0
- package/dist/{chunk-QEWCYW3I.js → chunk-WAMZWZJB.js} +13 -3
- package/dist/chunk-WAMZWZJB.js.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/components/index.d.ts +1592 -100
- package/dist/components/index.js +7 -4
- package/dist/{dev-DCTOHQ6W.js → dev-4XEDTELV.js} +4 -4
- package/dist/{dev-DCTOHQ6W.js.map → dev-4XEDTELV.js.map} +1 -1
- package/dist/doc/index.d.ts +194 -2
- package/dist/doc/index.js +336 -5
- package/dist/doc/index.js.map +1 -1
- package/dist/format-U0cQl069.d.ts +243 -0
- package/dist/markdown/index.js +1 -1
- package/dist/markdown/index.js.map +1 -1
- package/dist/slide/index.d.ts +177 -1
- package/dist/slide/index.js +866 -3
- package/dist/slide/index.js.map +1 -1
- package/dist/table/index.js +9 -6
- package/dist/table/index.js.map +1 -1
- package/dist/ui/index.d.ts +8 -2
- package/dist/ui/index.js +22 -112
- package/dist/ui/index.js.map +1 -1
- package/dist/{upgrade-DBBE6GIR.js → upgrade-JHXZBGQS.js} +3 -3
- package/dist/{upgrade-DBBE6GIR.js.map → upgrade-JHXZBGQS.js.map} +1 -1
- package/dist/vite/index.js +2 -2
- package/docs/en/components.md +40 -17
- package/docs/en/doc/doc-action-items.md +49 -0
- package/docs/en/doc/doc-callout.md +38 -0
- package/docs/en/doc/doc-data-table.md +60 -0
- package/docs/en/doc/doc-executive-summary.md +64 -0
- package/docs/en/doc/doc-figure.md +56 -0
- package/docs/en/doc/doc-key-findings.md +61 -0
- package/docs/en/doc/doc-kpi-scorecard.md +80 -0
- package/docs/en/doc/doc-report-header.md +46 -0
- package/docs/en/parts/area-chart.md +99 -0
- package/docs/en/parts/bar-chart.md +91 -0
- package/docs/en/parts/bar-list.md +50 -0
- package/docs/en/parts/category-bar.md +37 -0
- package/docs/en/parts/chart-frame.md +39 -0
- package/docs/en/parts/data-table.md +22 -0
- package/docs/en/parts/delta.md +50 -0
- package/docs/en/parts/donut-chart.md +72 -0
- package/docs/en/parts/format.md +43 -0
- package/docs/en/parts/funnel-steps.md +2 -1
- package/docs/en/parts/heatmap.md +53 -0
- package/docs/en/parts/kpi-card.md +57 -0
- package/docs/en/parts/legend.md +35 -0
- package/docs/en/parts/line-chart.md +94 -0
- package/docs/en/parts/metric-value.md +3 -2
- package/docs/en/parts/progress-circle.md +33 -0
- package/docs/en/parts/sample-data.md +39 -0
- package/docs/en/parts/scatter-chart.md +56 -0
- package/docs/en/parts/sparkline.md +1 -1
- package/docs/en/parts/tracker.md +36 -0
- package/docs/en/parts/trend-indicator.md +17 -1
- package/docs/en/parts/updated-at.md +30 -0
- package/docs/en/parts/waterfall-chart.md +56 -0
- package/docs/en/slide/slide-chart-insight.md +52 -0
- package/docs/en/slide/slide-cover.md +39 -0
- package/docs/en/slide/slide-exec-summary.md +47 -0
- package/docs/en/slide/slide-kpi-grid.md +55 -0
- package/docs/en/slide/slide-kpi-hero.md +58 -0
- package/docs/en/slide/slide-next-actions.md +49 -0
- package/docs/en/slide/slide-scorecard-table.md +54 -0
- package/docs/en/ui/alert-dialog.md +42 -0
- package/docs/en/ui/avatar.md +31 -0
- package/docs/en/ui/combobox.md +74 -0
- package/docs/en/ui/drawer.md +41 -0
- package/docs/en/ui/empty.md +1 -1
- package/docs/en/ui/error-state.md +4 -3
- package/docs/en/ui/field.md +42 -0
- package/docs/en/ui/hover-card.md +21 -0
- package/docs/en/ui/kbd.md +17 -0
- package/docs/en/ui/loading.md +1 -1
- package/docs/en/ui/pagination.md +36 -0
- package/docs/en/ui/radio-group.md +21 -0
- package/docs/en/ui/toast.md +44 -0
- package/docs/en/ui/toggle-group.md +4 -3
- package/docs/en/ui-and-theming.md +1 -1
- package/docs/index.json +753 -73
- package/docs/ja/components.md +37 -16
- package/docs/ja/doc/doc-action-items.md +49 -0
- package/docs/ja/doc/doc-callout.md +38 -0
- package/docs/ja/doc/doc-data-table.md +60 -0
- package/docs/ja/doc/doc-executive-summary.md +64 -0
- package/docs/ja/doc/doc-figure.md +56 -0
- package/docs/ja/doc/doc-key-findings.md +61 -0
- package/docs/ja/doc/doc-kpi-scorecard.md +80 -0
- package/docs/ja/doc/doc-report-header.md +46 -0
- package/docs/ja/parts/area-chart.md +49 -25
- package/docs/ja/parts/bar-chart.md +50 -24
- package/docs/ja/parts/bar-list.md +31 -8
- package/docs/ja/parts/chart-frame.md +36 -0
- package/docs/ja/parts/data-table.md +22 -0
- package/docs/ja/parts/delta.md +50 -0
- package/docs/ja/parts/donut-chart.md +45 -26
- package/docs/ja/parts/format.md +44 -0
- package/docs/ja/parts/funnel-steps.md +27 -8
- package/docs/ja/parts/heatmap.md +45 -0
- package/docs/ja/parts/kpi-card.md +55 -0
- package/docs/ja/parts/legend.md +36 -0
- package/docs/ja/parts/line-chart.md +48 -22
- package/docs/ja/parts/metric-value.md +3 -2
- package/docs/ja/parts/sample-data.md +61 -0
- package/docs/ja/parts/scatter-chart.md +69 -0
- package/docs/ja/parts/sparkline.md +1 -1
- package/docs/ja/parts/trend-indicator.md +17 -1
- package/docs/ja/parts/updated-at.md +27 -0
- package/docs/ja/parts/waterfall-chart.md +61 -0
- package/docs/ja/slide/slide-chart-insight.md +52 -0
- package/docs/ja/slide/slide-cover.md +39 -0
- package/docs/ja/slide/slide-exec-summary.md +47 -0
- package/docs/ja/slide/slide-kpi-grid.md +55 -0
- package/docs/ja/slide/slide-kpi-hero.md +58 -0
- package/docs/ja/slide/slide-next-actions.md +49 -0
- package/docs/ja/slide/slide-scorecard-table.md +54 -0
- package/docs/ja/ui/empty.md +1 -1
- package/docs/ja/ui/error-state.md +4 -3
- package/docs/ja/ui/loading.md +1 -1
- package/docs/ja/ui/toggle-group.md +4 -3
- package/docs/ja/ui-and-theming.md +2 -2
- package/package.json +26 -24
- package/registry/ui/accordion.tsx +4 -2
- package/registry/ui/alert-dialog.tsx +3 -3
- package/registry/ui/alert.tsx +3 -1
- package/registry/ui/app-shell.tsx +7 -1
- package/registry/ui/area-chart.tsx +2852 -166
- package/registry/ui/attention-list.tsx +303 -0
- package/registry/ui/avatar.tsx +1 -1
- package/registry/ui/badge.tsx +3 -1
- package/registry/ui/bar-chart.tsx +2851 -166
- package/registry/ui/bar-list.tsx +3531 -90
- package/registry/ui/box-plot-chart.tsx +3906 -0
- package/registry/ui/breadcrumb.tsx +3 -1
- package/registry/ui/button.tsx +3 -1
- package/registry/ui/calendar.tsx +3 -1
- package/registry/ui/card.tsx +4 -2
- package/registry/ui/category-bar.tsx +1025 -16
- package/registry/ui/chart-frame.tsx +1393 -0
- package/registry/ui/checkbox.tsx +3 -1
- package/registry/ui/collapsible.tsx +3 -1
- package/registry/ui/combobox.tsx +2 -2
- package/registry/ui/command.tsx +3 -1
- package/registry/ui/dashboard-card.tsx +71 -28
- package/registry/ui/data-table.tsx +678 -56
- package/registry/ui/date-range-picker.tsx +245 -64
- package/registry/ui/delta.tsx +188 -0
- package/registry/ui/dialog.tsx +5 -3
- package/registry/ui/donut-chart.tsx +2929 -182
- package/registry/ui/drawer.tsx +1 -1
- package/registry/ui/dropdown-menu.tsx +5 -3
- package/registry/ui/echart.tsx +621 -67
- package/registry/ui/field.tsx +1 -1
- package/registry/ui/filter-bar.tsx +33 -6
- package/registry/ui/funnel-steps.tsx +3344 -49
- package/registry/ui/heatmap.tsx +1786 -0
- package/registry/ui/histogram-chart.tsx +3986 -0
- package/registry/ui/hover-card.tsx +2 -2
- package/registry/ui/input-group.tsx +3 -1
- package/registry/ui/input.tsx +3 -1
- package/registry/ui/kbd.tsx +3 -1
- package/registry/ui/kpi-card.tsx +699 -0
- package/registry/ui/label.tsx +3 -1
- package/registry/ui/legend.tsx +3563 -0
- package/registry/ui/line-chart.tsx +2852 -160
- package/registry/ui/metric-value.tsx +9 -1
- package/registry/ui/multi-select.tsx +11 -5
- package/registry/ui/page-shell.tsx +106 -51
- package/registry/ui/pagination.tsx +3 -1
- package/registry/ui/paired-chart.tsx +3827 -0
- package/registry/ui/placeholder.tsx +8 -2
- package/registry/ui/popover.tsx +4 -2
- package/registry/ui/progress-circle.tsx +607 -12
- package/registry/ui/progress.tsx +3 -1
- package/registry/ui/radio-group.tsx +1 -1
- package/registry/ui/sample-data.tsx +86 -0
- package/registry/ui/scatter-chart.tsx +4212 -0
- package/registry/ui/scroll-area.tsx +3 -2
- package/registry/ui/searchable-select.tsx +8 -3
- package/registry/ui/section-header.tsx +5 -3
- package/registry/ui/segmented-control.tsx +7 -2
- package/registry/ui/select.tsx +4 -2
- package/registry/ui/separator.tsx +3 -1
- package/registry/ui/sheet.tsx +4 -2
- package/registry/ui/sidebar.tsx +4 -2
- package/registry/ui/skeleton.tsx +4 -2
- package/registry/ui/slider.tsx +4 -2
- package/registry/ui/sparkline.tsx +84 -9
- package/registry/ui/spinner.tsx +3 -1
- package/registry/ui/states.tsx +34 -5
- package/registry/ui/status-badge.tsx +83 -41
- package/registry/ui/switch.tsx +3 -1
- package/registry/ui/table.tsx +4 -2
- package/registry/ui/tabs.tsx +5 -3
- package/registry/ui/textarea.tsx +3 -1
- package/registry/ui/toast.tsx +2 -2
- package/registry/ui/toggle-group.tsx +3 -1
- package/registry/ui/toggle.tsx +3 -1
- package/registry/ui/tooltip.tsx +10 -4
- package/registry/ui/tracker.tsx +632 -19
- package/registry/ui/trend-indicator.tsx +15 -3
- package/registry/ui/updated-at.tsx +122 -0
- package/registry/ui/waterfall-chart.tsx +4248 -0
- package/skills/vantage-design/SKILL.md +34 -24
- package/skills/vantage-design/references/extract.md +16 -14
- package/skills/vantage-design/references/format.md +6 -5
- package/skills/vantage-design/references/presets.md +60 -110
- package/skills/vantage-slide/SKILL.md +54 -36
- package/templates/AGENTS.md +15 -3
- package/templates/agents/doc.md +45 -0
- package/templates/agents/page.md +32 -1
- package/templates/agents/slide.md +55 -2
- package/theme.css +244 -149
- package/dist/chunk-5ZOP4SQR.js.map +0 -1
- package/dist/chunk-A2UUGASH.js.map +0 -1
- package/dist/chunk-AG6RZ2RR.js +0 -3208
- package/dist/chunk-AG6RZ2RR.js.map +0 -1
- package/dist/chunk-IBGOCWJB.js.map +0 -1
- package/dist/chunk-OB6UBJXF.js.map +0 -1
- package/dist/chunk-PXRX5PEC.js.map +0 -1
- package/dist/chunk-QEWCYW3I.js.map +0 -1
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// @squadbase/vantage — generated build. Do not edit.
|
|
2
|
+
|
|
3
|
+
// ../squadkit/registry/lib/format.ts
|
|
4
|
+
var DEFAULT_LOCALE = "ja-JP";
|
|
5
|
+
var EMPTY_VALUE = "\u2014";
|
|
6
|
+
var MINUS_SIGN = "\u2212";
|
|
7
|
+
var PERCENT_DIGITS = 1;
|
|
8
|
+
var DEFAULT_CURRENCY = "JPY";
|
|
9
|
+
var MULTIPLE_SUFFIX = "\xD7";
|
|
10
|
+
var POINTS_SUFFIX = "pt";
|
|
11
|
+
function normalize(format) {
|
|
12
|
+
if (format === void 0) return { type: "compact" };
|
|
13
|
+
return typeof format === "string" ? { type: format } : format;
|
|
14
|
+
}
|
|
15
|
+
function formatKind(format) {
|
|
16
|
+
return normalize(format).type;
|
|
17
|
+
}
|
|
18
|
+
function digitOptions(digits, defaultMax, significantDigits) {
|
|
19
|
+
if (significantDigits !== void 0) return { maximumSignificantDigits: significantDigits };
|
|
20
|
+
if (digits !== void 0) return { minimumFractionDigits: digits, maximumFractionDigits: digits };
|
|
21
|
+
return defaultMax === void 0 ? {} : { maximumFractionDigits: defaultMax };
|
|
22
|
+
}
|
|
23
|
+
function formatParts(locale, options, value) {
|
|
24
|
+
if (options.notation === "compact") {
|
|
25
|
+
const compact = new Intl.NumberFormat(locale, {
|
|
26
|
+
...options,
|
|
27
|
+
useGrouping: "always"
|
|
28
|
+
}).formatToParts(value);
|
|
29
|
+
if (!compact.some((p) => p.type === "compact")) return formatParts(locale, { ...options, notation: "standard" }, value);
|
|
30
|
+
return joinParts(compact);
|
|
31
|
+
}
|
|
32
|
+
return joinParts(new Intl.NumberFormat(locale, options).formatToParts(value));
|
|
33
|
+
}
|
|
34
|
+
var joinParts = (parts) => parts.map((p) => p.type === "currency" ? p.value.normalize("NFKC") : p.type === "minusSign" ? MINUS_SIGN : p.value).join("");
|
|
35
|
+
function formatValue(value, format, locale = DEFAULT_LOCALE, options) {
|
|
36
|
+
if (value === null || value === void 0 || Number.isNaN(value)) return EMPTY_VALUE;
|
|
37
|
+
const { type, digits, currency, notation, unit, divisor, durationUnit } = normalize(format);
|
|
38
|
+
if (divisor !== void 0 && Number.isFinite(divisor) && divisor !== 0) value = value / divisor;
|
|
39
|
+
const signDisplay = options?.signDisplay ?? "auto";
|
|
40
|
+
const sig = options?.significantDigits;
|
|
41
|
+
const withUnit = (s) => unit ? `${s}${unit}` : s;
|
|
42
|
+
switch (type) {
|
|
43
|
+
case "number":
|
|
44
|
+
return withUnit(formatParts(locale, { ...digitOptions(digits, 2, sig), signDisplay }, value));
|
|
45
|
+
case "percent":
|
|
46
|
+
return formatParts(locale, { style: "percent", ...digitOptions(digits ?? PERCENT_DIGITS, void 0, sig), signDisplay }, value);
|
|
47
|
+
case "currency":
|
|
48
|
+
return withUnit(
|
|
49
|
+
formatParts(
|
|
50
|
+
locale,
|
|
51
|
+
{
|
|
52
|
+
style: "currency",
|
|
53
|
+
currency: currency ?? DEFAULT_CURRENCY,
|
|
54
|
+
notation: notation ?? "compact",
|
|
55
|
+
...digitOptions(digits, notation === "standard" ? void 0 : 1, sig),
|
|
56
|
+
signDisplay
|
|
57
|
+
},
|
|
58
|
+
value
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
case "multiple":
|
|
62
|
+
return `${formatParts(locale, { ...digitOptions(digits, 2, sig), signDisplay }, value)}${unit || MULTIPLE_SUFFIX}`;
|
|
63
|
+
case "compact":
|
|
64
|
+
return withUnit(formatParts(locale, { ...digitOptions(digits, 1, sig), signDisplay, notation: "compact" }, value));
|
|
65
|
+
case "duration":
|
|
66
|
+
return formatDuration(value, durationUnit ?? "second", locale, digits, signDisplay);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
var SECONDS_PER = { second: 1, minute: 60, hour: 3600, day: 86400 };
|
|
70
|
+
function durationWords(locale) {
|
|
71
|
+
return locale.toLowerCase().startsWith("ja") ? { day: "\u65E5", hour: "\u6642\u9593", minute: "\u5206", second: "\u79D2", sep: "" } : { day: "d", hour: "h", minute: "min", second: "s", sep: " " };
|
|
72
|
+
}
|
|
73
|
+
function formatDuration(value, unit, locale, digits, signDisplay) {
|
|
74
|
+
const w = durationWords(locale);
|
|
75
|
+
const abs = Math.round(Math.abs(value) * SECONDS_PER[unit]);
|
|
76
|
+
const join = (...parts) => parts.filter(([n]) => n !== 0).map(([n, u]) => `${n}${w.sep}${u}`).join(w.sep) || `0${w.sep}${parts.at(-1)?.[1] ?? w.second}`;
|
|
77
|
+
let body;
|
|
78
|
+
let zero = false;
|
|
79
|
+
if (abs >= 86400) {
|
|
80
|
+
const days = new Intl.NumberFormat(locale, { maximumFractionDigits: digits ?? 1, minimumFractionDigits: digits ?? 0 });
|
|
81
|
+
body = `${days.format(abs / 86400)}${w.sep}${w.day}`;
|
|
82
|
+
} else if (abs >= 3600) {
|
|
83
|
+
const minutes = Math.round(abs / 60);
|
|
84
|
+
body = join([Math.floor(minutes / 60), w.hour], [minutes % 60, w.minute]);
|
|
85
|
+
} else if (abs >= 60) {
|
|
86
|
+
body = join([Math.floor(abs / 60), w.minute], [abs % 60, w.second]);
|
|
87
|
+
} else {
|
|
88
|
+
zero = abs === 0;
|
|
89
|
+
body = `${abs}${w.sep}${w.second}`;
|
|
90
|
+
}
|
|
91
|
+
const sign = zero ? "" : value < 0 ? MINUS_SIGN : signDisplay === "exceptZero" ? "+" : "";
|
|
92
|
+
return `${sign}${body}`;
|
|
93
|
+
}
|
|
94
|
+
function formatDelta(value, format, locale = DEFAULT_LOCALE) {
|
|
95
|
+
return formatValue(value, format, locale, { signDisplay: "exceptZero" });
|
|
96
|
+
}
|
|
97
|
+
function formatPoints(difference, locale = DEFAULT_LOCALE, options) {
|
|
98
|
+
if (difference === null || difference === void 0 || Number.isNaN(difference)) return EMPTY_VALUE;
|
|
99
|
+
const digits = options?.digits ?? PERCENT_DIGITS;
|
|
100
|
+
const number = formatParts(
|
|
101
|
+
locale,
|
|
102
|
+
{ minimumFractionDigits: digits, maximumFractionDigits: digits, signDisplay: options?.signDisplay ?? "exceptZero" },
|
|
103
|
+
difference * 100
|
|
104
|
+
);
|
|
105
|
+
return `${number}${POINTS_SUFFIX}`;
|
|
106
|
+
}
|
|
107
|
+
function toValueFormatter(format, locale = DEFAULT_LOCALE) {
|
|
108
|
+
return (value) => formatValue(value, format, locale);
|
|
109
|
+
}
|
|
110
|
+
var DATE_STYLE_OPTIONS = {
|
|
111
|
+
date: { year: "numeric", month: "2-digit", day: "2-digit" },
|
|
112
|
+
datetime: { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", hourCycle: "h23" },
|
|
113
|
+
month: { month: "short" },
|
|
114
|
+
"year-month": { year: "numeric", month: "long" },
|
|
115
|
+
year: { year: "numeric" }
|
|
116
|
+
};
|
|
117
|
+
var CALENDAR_DATE = /^\d{4}-\d{2}(-\d{2})?$/;
|
|
118
|
+
function formatDate(value, style = "date", locale = DEFAULT_LOCALE, options) {
|
|
119
|
+
if (value === null || value === void 0 || value === "") return EMPTY_VALUE;
|
|
120
|
+
const calendar = typeof value === "string" && CALENDAR_DATE.test(value);
|
|
121
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
122
|
+
if (!Number.isFinite(date.getTime())) return EMPTY_VALUE;
|
|
123
|
+
return new Intl.DateTimeFormat(locale, {
|
|
124
|
+
...DATE_STYLE_OPTIONS[style],
|
|
125
|
+
timeZone: calendar ? "UTC" : options?.timeZone
|
|
126
|
+
}).format(date);
|
|
127
|
+
}
|
|
128
|
+
function formatDateRange(start, end, options) {
|
|
129
|
+
const locale = options?.locale ?? DEFAULT_LOCALE;
|
|
130
|
+
const parse = (value) => {
|
|
131
|
+
if (value === null || value === void 0 || value === "") return null;
|
|
132
|
+
const calendar = typeof value === "string" && CALENDAR_DATE.test(value);
|
|
133
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
134
|
+
if (!Number.isFinite(date.getTime())) return null;
|
|
135
|
+
return { date, timeZone: calendar ? "UTC" : options?.timeZone };
|
|
136
|
+
};
|
|
137
|
+
const a = parse(start);
|
|
138
|
+
const b = parse(end);
|
|
139
|
+
if (!a || !b) return EMPTY_VALUE;
|
|
140
|
+
const full = (x, withYear) => new Intl.DateTimeFormat(locale, {
|
|
141
|
+
...withYear ? { year: "numeric" } : {},
|
|
142
|
+
month: "numeric",
|
|
143
|
+
day: "numeric",
|
|
144
|
+
timeZone: x.timeZone
|
|
145
|
+
}).format(x.date);
|
|
146
|
+
const year = (x) => new Intl.DateTimeFormat("en-US", { year: "numeric", timeZone: x.timeZone }).format(x.date);
|
|
147
|
+
const startText = full(a, true);
|
|
148
|
+
const sameYear = year(a) === year(b);
|
|
149
|
+
const endFull = full(b, true);
|
|
150
|
+
if (startText === endFull) return startText;
|
|
151
|
+
const separator = locale.toLowerCase().startsWith("ja") ? "\u301C" : " \u2013 ";
|
|
152
|
+
return `${startText}${separator}${sameYear ? full(b, false) : endFull}`;
|
|
153
|
+
}
|
|
154
|
+
function formatDatesInText(text, locale = DEFAULT_LOCALE) {
|
|
155
|
+
return text.replace(
|
|
156
|
+
/(?<![\d-])(\d{4})-(0[1-9]|1[0-2])(-(0[1-9]|[12]\d|3[01]))?(?![\d-])/g,
|
|
157
|
+
(match, _y, _m, day) => formatDate(match, day ? "date" : "year-month", locale)
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export { DEFAULT_LOCALE, EMPTY_VALUE, MINUS_SIGN, formatDate, formatDateRange, formatDatesInText, formatDelta, formatKind, formatPoints, formatValue, toValueFormatter };
|
|
162
|
+
//# sourceMappingURL=chunk-57GHR5LN.js.map
|
|
163
|
+
//# sourceMappingURL=chunk-57GHR5LN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../squadkit/registry/lib/format.ts"],"names":[],"mappings":";;;AAmFO,IAAM,cAAA,GAAiB;AAGvB,IAAM,WAAA,GAAc;AAGpB,IAAM,UAAA,GAAa;AAGnB,IAAM,cAAA,GAAiB,CAAA;AAE9B,IAAM,gBAAA,GAAmB,KAAA;AACzB,IAAM,eAAA,GAAkB,MAAA;AAExB,IAAM,aAAA,GAAgB,IAAA;AAYtB,SAAS,UAAU,MAAA,EAAmD;AACpE,EAAA,IAAI,MAAA,KAAW,MAAA,EAAW,OAAO,E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GAAW,EAAE,IAAA,EAAM,SAAA,KAAc,EAAC;AAAA,IACtC,KAAA,EAAO,SAAA;AAAA,IACP,GAAA,EAAK,SAAA;AAAA,IACL,UAAU,CAAA,CAAE;AAAA,GACiB,CAAA,CAAE,MAAA,CAAO,CAAA,CAAE,IAAI,CAAA;AAChD,EAAA,MAAM,OAAO,CAAC,CAAA,KACZ,IAAI,IAAA,CAAK,eAAe,OAAA,EAAS,EAAE,IAAA,EAAM,SAAA,EAAW,UAAU,CAAA,CAAE,QAAA,EAAU,CAAA,CAAE,MAAA,CAAO,EAAE,IAAI,CAAA;AAC3F,EAAA,MAAM,SAAA,GAAY,IAAA,CAAK,CAAA,EAAG,IAAI,CAAA;AAC9B,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,CAAC,CAAA,KAAM,KAAK,CAAC,CAAA;AACnC,EAAA,MAAM,OAAA,GAAU,IAAA,CAAK,CAAA,EAAG,IAAI,CAAA;AAC5B,EAAA,IAAI,SAAA,KAAc,SAAS,OAAO,SAAA;AAClC,EAAA,MAAM,YAAY,MAAA,CAAO,WAAA,GAAc,UAAA,CAAW,IAAI,IAAI,QAAA,GAAM,UAAA;AAChE,EAAA,OAAO,CAAA,EAAG,SAAS,CAAA,EAAG,SAAS,CAAA,EAAG,WAAW,IAAA,CAAK,CAAA,EAAG,KAAK,CAAA,GAAI,OAAO,CAAA,CAAA;AACvE;AAUO,SAAS,iBAAA,CAAkB,IAAA,EAAc,MAAA,GAAiB,cAAA,EAAwB;AACvF,EAAA,OAAO,IAAA,CAAK,OAAA;AAAA,IAAQ,sEAAA;AAAA,IAAwE,CAAC,KAAA,EAAO,EAAA,EAAI,EAAA,EAAI,GAAA,KAC1G,WAAW,KAAA,EAAO,GAAA,GAAM,MAAA,GAAS,YAAA,EAAc,MAAM;AAAA,GACvD;AACF","file":"chunk-57GHR5LN.js","sourcesContent":["/**\n * Locale-aware number formatting shared by KPI cards, tables and charts. All\n * shortening is delegated to `Intl.NumberFormat` (`notation: \"compact\"`); this\n * module never hard-codes unit thresholds or unit strings.\n *\n * | `format` | input | ja-JP output |\n * |--------------------------------------------|--------------|----------------|\n * | `\"compact\"` (default) | `48_200_000` | `4,820万` |\n * | `\"number\"` | `1234.567` | `1,234.57` |\n * | `\"currency\"` (JPY, compact) | `48_200_000` | `¥4,820万` |\n * | `{ type: \"currency\", notation: \"standard\" }` | `48_200_000` | `¥48,200,000` |\n * | `{ type: \"currency\", currency: \"USD\" }` | `1234.5` | `$1,234.5` |\n * | `\"percent\"` — pass a **ratio** | `0.124` | `12.4%` |\n * | `{ type: \"percent\", digits: 0 }` | `0.124` | `12%` |\n * | `\"multiple\"` | `1.5` | `1.5×` |\n * | `{ type: \"number\", unit: \"件\" }` | `48_210` | `48,210件` |\n * | `{ type: \"compact\", unit: \"人\" }` | `12_345` | `1.2万人` |\n * | `\"duration\"` — pass **seconds** | `12_000` | `3時間20分` |\n * | `{ type: \"duration\", durationUnit: \"minute\" }` | `2160` | `1.5日` |\n *\n * - `percent` takes a ratio (0.124 → 12.4%). Passing 12.4 renders 1,240%. The fraction\n * digits are **fixed**, never trimmed (`PERCENT_DIGITS` = 1: 0.14 → \"14.0%\", never \"14%\"\n * beside \"11.9%\"). Pass `digits` in the format to share another count across cards.\n * - A minus sign is always U+2212 (`MINUS_SIGN`, \"−1,234\" / \"−5.0%\"), never the hyphen-minus.\n * - `currency` defaults to JPY and to compact notation (万・億 in ja); pass\n * `notation: \"standard\"` for every digit (tables, invoices). In ja-JP the yen\n * sign is the half-width `¥`.\n * - `unit` is a counter appended right after the number, with no space\n * (\"48,210件\", \"1.2万人\"), for `number` / `compact` / `currency`. It is\n * ignored for `percent` and `duration`, and for `multiple` it replaces the\n * default `×` (\"2.7倍\"). Do not write it into a `valueFormatter` by hand.\n * - Charts take the same `format` a KpiCard takes (`format=\"currency\"`).\n * `toValueFormatter(format)` turns it into a function for places that need\n * one (a `valueFormatter`, table cells).\n * - Missing values (null / undefined / NaN) render as `—` (`EMPTY_VALUE`).\n * - Dates go through `formatDate` (`Intl.DateTimeFormat`): `\"date\"` → `2026/10/20`,\n * `\"datetime\"` → `2026/10/20 14:30`, `\"year-month\"` → `2026年10月`, `\"month\"` → `10月`,\n * `\"year\"` → `2026年`.\n * - A period goes through `formatDateRange`: `2026/9/23〜10/20` (same year drops the end year),\n * `2025/12/20〜2026/1/18` across years; month and day are not zero-padded.\n */\n\n/**\n * The kind of number a value is. Pick by what the number means, not by how\n * long it is: `currency` for money, `percent` for a ratio, `multiple` for a\n * factor (\"1.5×\"), `duration` for a length of time (\"3時間20分\"), `number` for\n * exact counts in tables, `compact` (default) for large headline counts (万・億).\n */\nexport type FormatKind = \"number\" | \"compact\" | \"currency\" | \"percent\" | \"multiple\" | \"duration\"\n\n/** The unit a `duration` value is measured in. */\nexport type DurationUnit = \"second\" | \"minute\" | \"hour\" | \"day\"\n\n/**\n * How to display a number: a `FormatKind` alone, or an object for digits,\n * currency, notation and a counter. The same value is accepted by KpiCard,\n * Delta, the charts (`format`) and `formatValue`.\n *\n * @example\n * \"currency\" // ¥4,820万\n * { type: \"currency\", notation: \"standard\" } // ¥48,200,000\n * { type: \"percent\", digits: 1 } // 2.0%\n * { type: \"number\", unit: \"件\" } // 48,210件\n */\nexport type ValueFormat =\n | FormatKind\n | {\n type: FormatKind\n /** Fixed number of fraction digits. */\n digits?: number\n /** ISO 4217 code for `currency`. Default `\"JPY\"`. */\n currency?: string\n /** `currency` only: `\"compact\"` (default, 万・億) or `\"standard\"` (every digit). */\n notation?: \"compact\" | \"standard\"\n /** Counter appended after the number, e.g. `\"件\"`, `\"人\"`. Ignored for `percent` and `duration`. For `multiple` it replaces the default `×` (`\"倍\"` → `2.7倍`). */\n unit?: string\n /** 値をこの数で割ってから整形する。例: `divisor: 100`(セント → ドル)。0 と非有限は無視。 */\n divisor?: number\n /** `duration` only: the unit the value is in. Default `\"second\"`. Reads as \"45秒\" / \"12分\" / \"3時間20分\" / \"1.5日\" (`digits` sets the fraction digits of days). */\n durationUnit?: DurationUnit\n }\n\n/** Locale used when none is passed. Every function here takes a `locale` to override it. */\nexport const DEFAULT_LOCALE = \"ja-JP\"\n\n/** Shown in place of a missing value (null / undefined / NaN). */\nexport const EMPTY_VALUE = \"—\"\n\n/** The minus sign every formatter writes (U+2212), so a negative never mixes with a hyphen-minus. */\nexport const MINUS_SIGN = \"\\u2212\"\n\n/** Fraction digits of a `percent` value (and of the points in `formatPoints`) when `digits` is not given. Fixed, never trimmed. */\nexport const PERCENT_DIGITS = 1\n\nconst DEFAULT_CURRENCY = \"JPY\"\nconst MULTIPLE_SUFFIX = \"×\"\n/** Suffix for a difference between two rates, in percentage points. */\nconst POINTS_SUFFIX = \"pt\"\n\n/** Extra options for `formatValue`. */\nexport interface FormatValueOptions {\n /** `\"auto\"` (default) signs negatives only; `\"exceptZero\"` also writes `+` on positives (for differences). */\n signDisplay?: \"auto\" | \"exceptZero\"\n /** Round to this many significant digits (e.g. 3 for an estimate: 79,653,985 → 7,970万). */\n significantDigits?: number\n}\n\ntype NormalizedFormat = Exclude<ValueFormat, FormatKind>\n\nfunction normalize(format: ValueFormat | undefined): NormalizedFormat {\n if (format === undefined) return { type: \"compact\" }\n return typeof format === \"string\" ? { type: format } : format\n}\n\n/**\n * The kind of a format, whether it was given as a string or an object. Use it\n * to branch on the meaning of a metric (e.g. a `percent` metric compares in\n * points) without unpacking `ValueFormat` yourself.\n *\n * @param format - The format as a KpiCard / chart takes it. `undefined` means the default.\n * @returns The `FormatKind`; `\"compact\"` when `format` is omitted.\n *\n * @example\n * formatKind(\"percent\") // \"percent\"\n * formatKind({ type: \"currency\", notation: \"standard\" }) // \"currency\"\n * formatKind(undefined) // \"compact\"\n */\nexport function formatKind(format: ValueFormat | undefined): FormatKind {\n return normalize(format).type\n}\n\nfunction digitOptions(\n digits: number | undefined,\n defaultMax: number | undefined,\n significantDigits: number | undefined,\n): Intl.NumberFormatOptions {\n if (significantDigits !== undefined) return { maximumSignificantDigits: significantDigits }\n if (digits !== undefined) return { minimumFractionDigits: digits, maximumFractionDigits: digits }\n return defaultMax === undefined ? {} : { maximumFractionDigits: defaultMax }\n}\n\n/**\n * Format through Intl, letting Intl decide whether the number is large enough to\n * shorten. Shortened numbers keep digit grouping (\"7,965万\"), and the full-width\n * currency sign some locales emit (\"¥\") is folded to its half-width form (\"¥\").\n */\nfunction formatParts(locale: string, options: Intl.NumberFormatOptions, value: number): string {\n if (options.notation === \"compact\") {\n const compact = new Intl.NumberFormat(locale, {\n ...options,\n useGrouping: \"always\" as unknown as boolean,\n }).formatToParts(value)\n if (!compact.some((p) => p.type === \"compact\")) return formatParts(locale, { ...options, notation: \"standard\" }, value)\n return joinParts(compact)\n }\n return joinParts(new Intl.NumberFormat(locale, options).formatToParts(value))\n}\n\nconst joinParts = (parts: Intl.NumberFormatPart[]): string =>\n parts\n .map((p) => (p.type === \"currency\" ? p.value.normalize(\"NFKC\") : p.type === \"minusSign\" ? MINUS_SIGN : p.value))\n .join(\"\")\n\n/**\n * Format a number for display — KPI values, table cells, chart labels and\n * sentences built from data (titles, summaries). See the table at the top of\n * this module.\n *\n * @param value - The number. `null` / `undefined` / `NaN` render as `—`.\n * For `percent`, a ratio (0.124 means 12.4%).\n * @param format - How to display it. Default `\"compact\"`.\n * @param locale - BCP 47 locale. Default `\"ja-JP\"`.\n * @param options - `signDisplay` and `significantDigits` (rounding for estimates).\n * @returns The display string. In ja-JP the yen sign is the half-width `¥`.\n *\n * @example\n * formatValue(48_200_000, \"currency\") // \"¥4,820万\"\n * formatValue(48_200_000, { type: \"currency\", notation: \"standard\" }) // \"¥48,200,000\"\n * formatValue(0.021, \"percent\") // \"2.1%\"\n * formatValue(0.124, \"percent\", \"ja-JP\", { signDisplay: \"exceptZero\" }) // \"+12.4%\"\n * formatValue(79_653_985, \"currency\", \"ja-JP\", { significantDigits: 3 }) // \"¥7,970万\"\n * formatValue(48_210, { type: \"number\", unit: \"件\" }) // \"48,210件\"\n * formatValue(1.5, \"multiple\") // \"1.5×\"\n * formatValue(null) // \"—\"\n */\nexport function formatValue(\n value: number | null | undefined,\n format?: ValueFormat,\n locale: string = DEFAULT_LOCALE,\n options?: FormatValueOptions,\n): string {\n if (value === null || value === undefined || Number.isNaN(value)) return EMPTY_VALUE\n const { type, digits, currency, notation, unit, divisor, durationUnit } = normalize(format)\n if (divisor !== undefined && Number.isFinite(divisor) && divisor !== 0) value = value / divisor\n const signDisplay = options?.signDisplay ?? \"auto\"\n const sig = options?.significantDigits\n const withUnit = (s: string) => (unit ? `${s}${unit}` : s)\n\n switch (type) {\n case \"number\":\n return withUnit(formatParts(locale, { ...digitOptions(digits, 2, sig), signDisplay }, value))\n case \"percent\":\n return formatParts(locale, { style: \"percent\", ...digitOptions(digits ?? PERCENT_DIGITS, undefined, sig), signDisplay }, value)\n case \"currency\":\n return withUnit(\n formatParts(\n locale,\n {\n style: \"currency\",\n currency: currency ?? DEFAULT_CURRENCY,\n notation: notation ?? \"compact\",\n ...digitOptions(digits, notation === \"standard\" ? undefined : 1, sig),\n signDisplay,\n },\n value,\n ),\n )\n case \"multiple\":\n return `${formatParts(locale, { ...digitOptions(digits, 2, sig), signDisplay }, value)}${unit || MULTIPLE_SUFFIX}`\n case \"compact\":\n return withUnit(formatParts(locale, { ...digitOptions(digits, 1, sig), signDisplay, notation: \"compact\" }, value))\n case \"duration\":\n return formatDuration(value, durationUnit ?? \"second\", locale, digits, signDisplay)\n }\n}\n\nconst SECONDS_PER: Record<DurationUnit, number> = { second: 1, minute: 60, hour: 3600, day: 86_400 }\n\n/**\n * Unit words and spacing: Japanese reads \"3時間20分\" (no space, like \"48,210件\"),\n * other locales \"3 h 20 min\".\n */\nfunction durationWords(locale: string) {\n return locale.toLowerCase().startsWith(\"ja\")\n ? { day: \"日\", hour: \"時間\", minute: \"分\", second: \"秒\", sep: \"\" }\n : { day: \"d\", hour: \"h\", minute: \"min\", second: \"s\", sep: \" \" }\n}\n\n/**\n * A length of time in the largest sensible unit: under a minute in seconds, under\n * an hour in minutes (+ seconds), under a day in hours + minutes, from a day on\n * in days with a decimal (\"1.5日\"). Rounded before splitting, so 59.6 minutes\n * never reads \"59分60秒\".\n */\nfunction formatDuration(\n value: number,\n unit: DurationUnit,\n locale: string,\n digits: number | undefined,\n signDisplay: \"auto\" | \"exceptZero\",\n): string {\n const w = durationWords(locale)\n const abs = Math.round(Math.abs(value) * SECONDS_PER[unit])\n const join = (...parts: Array<[number, string]>) =>\n parts\n .filter(([n]) => n !== 0)\n .map(([n, u]) => `${n}${w.sep}${u}`)\n .join(w.sep) || `0${w.sep}${parts.at(-1)?.[1] ?? w.second}`\n let body: string\n let zero = false\n if (abs >= 86_400) {\n const days = new Intl.NumberFormat(locale, { maximumFractionDigits: digits ?? 1, minimumFractionDigits: digits ?? 0 })\n body = `${days.format(abs / 86_400)}${w.sep}${w.day}`\n } else if (abs >= 3600) {\n const minutes = Math.round(abs / 60)\n body = join([Math.floor(minutes / 60), w.hour], [minutes % 60, w.minute])\n } else if (abs >= 60) {\n body = join([Math.floor(abs / 60), w.minute], [abs % 60, w.second])\n } else {\n zero = abs === 0\n body = `${abs}${w.sep}${w.second}`\n }\n const sign = zero ? \"\" : value < 0 ? MINUS_SIGN : signDisplay === \"exceptZero\" ? \"+\" : \"\"\n return `${sign}${body}`\n}\n\n/**\n * Like `formatValue`, but always signed (except zero) — for a difference\n * between two values (\"+¥530万\", \"−120件\"). Use `formatPoints` instead for a\n * difference between two rates.\n *\n * @param value - The difference (current − previous). Missing values render as `—`.\n * @param format - Format of the metric itself. Default `\"compact\"`.\n * @param locale - BCP 47 locale. Default `\"ja-JP\"`.\n * @returns The signed display string; zero has no sign.\n *\n * @example\n * formatDelta(5_300_000, \"currency\") // \"+¥530万\"\n * formatDelta(-120, { type: \"number\", unit: \"件\" }) // \"−120件\"\n * formatDelta(0.031, \"percent\") // \"+3.1%\"\n * formatDelta(0, \"currency\") // \"¥0\"\n */\nexport function formatDelta(value: number | null | undefined, format?: ValueFormat, locale: string = DEFAULT_LOCALE): string {\n return formatValue(value, format, locale, { signDisplay: \"exceptZero\" })\n}\n\n/**\n * A difference between two rates in percentage points, always signed:\n * `formatPoints(0.021 - 0.026)` → `\"−0.5pt\"`. Use it instead of a relative\n * change for rate metrics (churn, conversion), where \"−19.2%\" reads as a drop\n * of nineteen points. `signDisplay: \"never\"` drops the sign (\"あと 0.5pt\").\n *\n * @param difference - The difference of two **ratios** (0.021 − 0.026). Missing values render as `—`.\n * @param locale - BCP 47 locale. Default `\"ja-JP\"`.\n * @param options - `digits`: fixed fraction digits (default `PERCENT_DIGITS` = 1, so \"0.0pt\" / \"+0.5pt\"); `signDisplay`:\n * `\"exceptZero\"` (default) or `\"never\"` when the sentence already says the direction.\n * @returns The difference in points with the `pt` suffix.\n *\n * @example\n * formatPoints(0.021 - 0.026) // \"−0.5pt\"\n * formatPoints(0.031 - 0.026) // \"+0.5pt\"\n * formatPoints(0.02 - 0.015, \"ja-JP\", { signDisplay: \"never\" }) // \"0.5pt\"(「目標まであと 0.5pt」)\n */\nexport function formatPoints(\n difference: number | null | undefined,\n locale: string = DEFAULT_LOCALE,\n options?: { digits?: number; signDisplay?: \"exceptZero\" | \"never\" },\n): string {\n if (difference === null || difference === undefined || Number.isNaN(difference)) return EMPTY_VALUE\n const digits = options?.digits ?? PERCENT_DIGITS\n const number = formatParts(\n locale,\n { minimumFractionDigits: digits, maximumFractionDigits: digits, signDisplay: options?.signDisplay ?? \"exceptZero\" },\n difference * 100,\n )\n return `${number}${POINTS_SUFFIX}`\n}\n\n/**\n * Binds a format and locale into a single-argument formatter, for a chart\n * `valueFormatter` or a table cell: `valueFormatter={toValueFormatter(\"currency\")}`.\n * Prefer passing `format` to the chart directly; this is for APIs that only\n * take a function.\n *\n * @param format - How to display each value. Default `\"compact\"`.\n * @param locale - BCP 47 locale. Default `\"ja-JP\"`.\n * @returns `(value) => string`, rendering missing values as `—`.\n *\n * @example\n * const yen = toValueFormatter(\"currency\")\n * yen(48_200_000) // \"¥4,820万\"\n * yen(null) // \"—\"\n * const count = toValueFormatter({ type: \"number\", unit: \"件\" })\n * count(48_210) // \"48,210件\"(表のセル)\n */\nexport function toValueFormatter(\n format?: ValueFormat,\n locale: string = DEFAULT_LOCALE,\n): (value: number | null | undefined) => string {\n return (value) => formatValue(value, format, locale)\n}\n\n/**\n * 日付の書式。何を表す日付かで選ぶ: 日単位は `\"date\"`、時刻まで要るなら `\"datetime\"`、\n * 月次の集計は `\"year-month\"`(年をまたぐ軸)か `\"month\"`(同じ年の中の軸)、年次は `\"year\"`。\n */\nexport type DateStyle = \"date\" | \"datetime\" | \"month\" | \"year-month\" | \"year\"\n\n/** `formatDate` の追加オプション。 */\nexport interface FormatDateOptions {\n /**\n * IANA のタイムゾーン名(例: `\"Asia/Tokyo\"`)。既定は実行環境のタイムゾーン。\n * サーバーとブラウザで描画が食い違う(SSR)なら固定する。日付だけの文字列(`\"2026-10-20\"`)には効かず、常にその暦日のまま出す。\n */\n timeZone?: string\n}\n\nconst DATE_STYLE_OPTIONS: Record<DateStyle, Intl.DateTimeFormatOptions> = {\n date: { year: \"numeric\", month: \"2-digit\", day: \"2-digit\" },\n datetime: { year: \"numeric\", month: \"2-digit\", day: \"2-digit\", hour: \"2-digit\", minute: \"2-digit\", hourCycle: \"h23\" },\n month: { month: \"short\" },\n \"year-month\": { year: \"numeric\", month: \"long\" },\n year: { year: \"numeric\" },\n}\n\n/** `\"2026-10-20\"` / `\"2026-10\"` はタイムゾーンを持たない暦日。UTC で解釈して UTC で出し、ずれを防ぐ。 */\nconst CALENDAR_DATE = /^\\d{4}-\\d{2}(-\\d{2})?$/\n\n/**\n * 日付を表示用の文字列にする。表のセル・タイトル・文に埋める日付に使い、`toLocaleString` や手組みの\n * `getMonth() + 1` は使わない。\n *\n * @param value - `Date`、エポックミリ秒、または日付文字列(`\"2026-10-20\"`、ISO 8601)。`null` / `undefined` / 解釈できない値は `—`。\n * @param style - 何を表す日付か。既定 `\"date\"`。\n * @param locale - BCP 47 ロケール。既定 `\"ja-JP\"`。\n * @param options - `timeZone`。\n * @returns 表示文字列。\n *\n * @example\n * formatDate(\"2026-10-20\") // \"2026/10/20\"\n * formatDate(new Date(\"2026-10-20T05:30:00Z\"), \"datetime\", \"ja-JP\", { timeZone: \"Asia/Tokyo\" }) // \"2026/10/20 14:30\"\n * formatDate(\"2026-10-01\", \"year-month\") // \"2026年10月\"\n * formatDate(\"2026-10-01\", \"month\") // \"10月\"\n * formatDate(null) // \"—\"\n */\nexport function formatDate(\n value: Date | string | number | null | undefined,\n style: DateStyle = \"date\",\n locale: string = DEFAULT_LOCALE,\n options?: FormatDateOptions,\n): string {\n if (value === null || value === undefined || value === \"\") return EMPTY_VALUE\n const calendar = typeof value === \"string\" && CALENDAR_DATE.test(value)\n const date = value instanceof Date ? value : new Date(value)\n if (!Number.isFinite(date.getTime())) return EMPTY_VALUE\n return new Intl.DateTimeFormat(locale, {\n ...DATE_STYLE_OPTIONS[style],\n timeZone: calendar ? \"UTC\" : options?.timeZone,\n }).format(date)\n}\n\n/** `formatDateRange` のオプション。 */\nexport interface FormatDateRangeOptions extends FormatDateOptions {\n /** BCP 47 ロケール。既定 `\"ja-JP\"`。 */\n locale?: string\n}\n\n/**\n * 期間を「2026/9/23〜10/20」の形にする。同じ年なら終了側の年を省き、年をまたぐときは両方に付ける。\n * 月日はゼロ詰めしない。区切りは日本語で「〜」、それ以外のロケールでは「 – 」。始まりと終わりが同じ日なら 1 日だけ出す。\n *\n * @param start - 期間の最初の日(`Date`、エポックミリ秒、日付文字列)。`\"2026-09-23\"` のような日付だけの文字列はその暦日のまま出す。\n * @param end - 期間の最後の日。\n * @param options - `locale` と `timeZone`。\n * @returns 表示文字列。どちらかが解釈できなければ `—`。\n *\n * @example\n * formatDateRange(\"2026-09-23\", \"2026-10-20\") // \"2026/9/23〜10/20\"\n * formatDateRange(\"2025-12-20\", \"2026-01-18\") // \"2025/12/20〜2026/1/18\"\n */\nexport function formatDateRange(\n start: Date | string | number | null | undefined,\n end: Date | string | number | null | undefined,\n options?: FormatDateRangeOptions,\n): string {\n const locale = options?.locale ?? DEFAULT_LOCALE\n const parse = (value: Date | string | number | null | undefined) => {\n if (value === null || value === undefined || value === \"\") return null\n const calendar = typeof value === \"string\" && CALENDAR_DATE.test(value)\n const date = value instanceof Date ? value : new Date(value)\n if (!Number.isFinite(date.getTime())) return null\n return { date, timeZone: calendar ? \"UTC\" : options?.timeZone }\n }\n const a = parse(start)\n const b = parse(end)\n if (!a || !b) return EMPTY_VALUE\n const full = (x: NonNullable<typeof a>, withYear: boolean) =>\n new Intl.DateTimeFormat(locale, {\n ...(withYear ? { year: \"numeric\" } : {}),\n month: \"numeric\",\n day: \"numeric\",\n timeZone: x.timeZone,\n } as Intl.DateTimeFormatOptions).format(x.date)\n const year = (x: NonNullable<typeof a>) =>\n new Intl.DateTimeFormat(\"en-US\", { year: \"numeric\", timeZone: x.timeZone }).format(x.date)\n const startText = full(a, true)\n const sameYear = year(a) === year(b)\n const endFull = full(b, true)\n if (startText === endFull) return startText\n const separator = locale.toLowerCase().startsWith(\"ja\") ? \"〜\" : \" – \"\n return `${startText}${separator}${sameYear ? full(b, false) : endFull}`\n}\n\n/**\n * 文中の ISO の年月・日付(`2023-04`、`2026-10-20`)を `formatDate` の書式に置き換える。期間や出典の注記のように、\n * 利用者が文字列で渡す文に日付が混ざるときの表示用(`\"2023-04 以降\"` → `\"2023年4月 以降\"`)。日付でない数字は触らない。\n *\n * @param text - 日付を含みうる文。\n * @param locale - BCP 47 ロケール。既定 `\"ja-JP\"`。\n * @returns ISO の年月は `\"year-month\"`、年月日は `\"date\"` で整形した文。\n */\nexport function formatDatesInText(text: string, locale: string = DEFAULT_LOCALE): string {\n return text.replace(/(?<![\\d-])(\\d{4})-(0[1-9]|1[0-2])(-(0[1-9]|[12]\\d|3[01]))?(?![\\d-])/g, (match, _y, _m, day) =>\n formatDate(match, day ? \"date\" : \"year-month\", locale),\n )\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { buttonVariants, Button } from './chunk-
|
|
2
|
-
import { cn } from './chunk-
|
|
1
|
+
import { buttonVariants, Button } from './chunk-PDOBHMUQ.js';
|
|
2
|
+
import { cn } from './chunk-U736PVHY.js';
|
|
3
3
|
import { mergeProps } from '@base-ui/react/merge-props';
|
|
4
4
|
import { useRender } from '@base-ui/react/use-render';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
|
-
import * as
|
|
6
|
+
import * as React13 from 'react';
|
|
7
7
|
import { getDefaultClassNames, DayPicker } from 'react-day-picker';
|
|
8
8
|
import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, CheckIcon, XIcon, SearchIcon, ChevronUpIcon, PanelLeftIcon } from 'lucide-react';
|
|
9
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -213,8 +213,8 @@ function CalendarDayButton({
|
|
|
213
213
|
...props
|
|
214
214
|
}) {
|
|
215
215
|
const defaultClassNames = getDefaultClassNames();
|
|
216
|
-
const ref =
|
|
217
|
-
|
|
216
|
+
const ref = React13.useRef(null);
|
|
217
|
+
React13.useEffect(() => {
|
|
218
218
|
if (modifiers.focused) ref.current?.focus();
|
|
219
219
|
}, [modifiers.focused]);
|
|
220
220
|
return /* @__PURE__ */ jsx(
|
|
@@ -236,6 +236,96 @@ function CalendarDayButton({
|
|
|
236
236
|
}
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
|
+
function Card({
|
|
240
|
+
className,
|
|
241
|
+
size = "default",
|
|
242
|
+
...props
|
|
243
|
+
}) {
|
|
244
|
+
return /* @__PURE__ */ jsx(
|
|
245
|
+
"div",
|
|
246
|
+
{
|
|
247
|
+
"data-slot": "card",
|
|
248
|
+
"data-size": size,
|
|
249
|
+
className: cn(
|
|
250
|
+
"group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl border bg-card shadow-[var(--shadow-card)] py-(--card-spacing) text-sm text-card-foreground [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
|
|
251
|
+
className
|
|
252
|
+
),
|
|
253
|
+
...props
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
function CardHeader({ className, ...props }) {
|
|
258
|
+
return /* @__PURE__ */ jsx(
|
|
259
|
+
"div",
|
|
260
|
+
{
|
|
261
|
+
"data-slot": "card-header",
|
|
262
|
+
className: cn(
|
|
263
|
+
"group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",
|
|
264
|
+
className
|
|
265
|
+
),
|
|
266
|
+
...props
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
function CardTitle({ className, ...props }) {
|
|
271
|
+
return /* @__PURE__ */ jsx(
|
|
272
|
+
"div",
|
|
273
|
+
{
|
|
274
|
+
"data-slot": "card-title",
|
|
275
|
+
className: cn(
|
|
276
|
+
"cn-font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",
|
|
277
|
+
className
|
|
278
|
+
),
|
|
279
|
+
...props
|
|
280
|
+
}
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
function CardDescription({ className, ...props }) {
|
|
284
|
+
return /* @__PURE__ */ jsx(
|
|
285
|
+
"div",
|
|
286
|
+
{
|
|
287
|
+
"data-slot": "card-description",
|
|
288
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
289
|
+
...props
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
function CardAction({ className, ...props }) {
|
|
294
|
+
return /* @__PURE__ */ jsx(
|
|
295
|
+
"div",
|
|
296
|
+
{
|
|
297
|
+
"data-slot": "card-action",
|
|
298
|
+
className: cn(
|
|
299
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
300
|
+
className
|
|
301
|
+
),
|
|
302
|
+
...props
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
function CardContent({ className, ...props }) {
|
|
307
|
+
return /* @__PURE__ */ jsx(
|
|
308
|
+
"div",
|
|
309
|
+
{
|
|
310
|
+
"data-slot": "card-content",
|
|
311
|
+
className: cn("px-(--card-spacing)", className),
|
|
312
|
+
...props
|
|
313
|
+
}
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
function CardFooter({ className, ...props }) {
|
|
317
|
+
return /* @__PURE__ */ jsx(
|
|
318
|
+
"div",
|
|
319
|
+
{
|
|
320
|
+
"data-slot": "card-footer",
|
|
321
|
+
className: cn(
|
|
322
|
+
"flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",
|
|
323
|
+
className
|
|
324
|
+
),
|
|
325
|
+
...props
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
}
|
|
239
329
|
function Checkbox({ className, ...props }) {
|
|
240
330
|
return /* @__PURE__ */ jsx(
|
|
241
331
|
Checkbox$1.Root,
|
|
@@ -444,7 +534,7 @@ function DialogOverlay({
|
|
|
444
534
|
{
|
|
445
535
|
"data-slot": "dialog-overlay",
|
|
446
536
|
className: cn(
|
|
447
|
-
"fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
537
|
+
"fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in motion-reduce:animate-none! data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
448
538
|
className
|
|
449
539
|
),
|
|
450
540
|
...props
|
|
@@ -464,7 +554,7 @@ function DialogContent({
|
|
|
464
554
|
{
|
|
465
555
|
"data-slot": "dialog-content",
|
|
466
556
|
className: cn(
|
|
467
|
-
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
557
|
+
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in motion-reduce:animate-none! data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
468
558
|
className
|
|
469
559
|
),
|
|
470
560
|
...props,
|
|
@@ -740,7 +830,7 @@ function DropdownMenuContent({
|
|
|
740
830
|
{
|
|
741
831
|
"data-slot": "dropdown-menu-content",
|
|
742
832
|
className: cn(
|
|
743
|
-
"cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
833
|
+
"cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in motion-reduce:animate-none! data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
744
834
|
className
|
|
745
835
|
),
|
|
746
836
|
...props
|
|
@@ -829,7 +919,7 @@ function DropdownMenuSubContent({
|
|
|
829
919
|
{
|
|
830
920
|
"data-slot": "dropdown-menu-sub-content",
|
|
831
921
|
className: cn(
|
|
832
|
-
"cn-menu-target cn-menu-translucent w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
922
|
+
"cn-menu-target cn-menu-translucent w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in motion-reduce:animate-none! data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
833
923
|
className
|
|
834
924
|
),
|
|
835
925
|
align,
|
|
@@ -985,7 +1075,7 @@ function PopoverContent({
|
|
|
985
1075
|
{
|
|
986
1076
|
"data-slot": "popover-content",
|
|
987
1077
|
className: cn(
|
|
988
|
-
"z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
1078
|
+
"z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in motion-reduce:animate-none! data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
989
1079
|
className
|
|
990
1080
|
),
|
|
991
1081
|
...props
|
|
@@ -1028,8 +1118,8 @@ function PopoverDescription({
|
|
|
1028
1118
|
);
|
|
1029
1119
|
}
|
|
1030
1120
|
function collectSelectItems(node, into = []) {
|
|
1031
|
-
|
|
1032
|
-
if (!
|
|
1121
|
+
React13.Children.forEach(node, (child) => {
|
|
1122
|
+
if (!React13.isValidElement(child)) return;
|
|
1033
1123
|
const props = child.props;
|
|
1034
1124
|
if (child.type === SelectItem) {
|
|
1035
1125
|
if (props.value !== void 0) into.push({ label: props.children, value: props.value });
|
|
@@ -1044,7 +1134,7 @@ function Select({
|
|
|
1044
1134
|
children,
|
|
1045
1135
|
...props
|
|
1046
1136
|
}) {
|
|
1047
|
-
const derivedItems =
|
|
1137
|
+
const derivedItems = React13.useMemo(() => {
|
|
1048
1138
|
if (items) return items;
|
|
1049
1139
|
const collected = collectSelectItems(children);
|
|
1050
1140
|
return collected.length > 0 ? collected : void 0;
|
|
@@ -1124,7 +1214,7 @@ function SelectContent({
|
|
|
1124
1214
|
"data-slot": "select-content",
|
|
1125
1215
|
"data-align-trigger": alignItemWithTrigger,
|
|
1126
1216
|
className: cn(
|
|
1127
|
-
"cn-menu-target cn-menu-translucent relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
1217
|
+
"cn-menu-target cn-menu-translucent relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in motion-reduce:animate-none! data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
1128
1218
|
className
|
|
1129
1219
|
),
|
|
1130
1220
|
...props,
|
|
@@ -1265,7 +1355,7 @@ function SheetContent({
|
|
|
1265
1355
|
"data-slot": "sheet-content",
|
|
1266
1356
|
"data-side": side,
|
|
1267
1357
|
className: cn(
|
|
1268
|
-
"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-
|
|
1358
|
+
"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0 motion-reduce:data-ending-style:translate-none! motion-reduce:data-starting-style:translate-none! data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",
|
|
1269
1359
|
className
|
|
1270
1360
|
),
|
|
1271
1361
|
...props,
|
|
@@ -1342,8 +1432,8 @@ function SheetDescription({
|
|
|
1342
1432
|
}
|
|
1343
1433
|
var MOBILE_BREAKPOINT = 768;
|
|
1344
1434
|
function useIsMobile() {
|
|
1345
|
-
const [isMobile, setIsMobile] =
|
|
1346
|
-
|
|
1435
|
+
const [isMobile, setIsMobile] = React13.useState(void 0);
|
|
1436
|
+
React13.useEffect(() => {
|
|
1347
1437
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
1348
1438
|
const onChange = () => {
|
|
1349
1439
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
@@ -1359,7 +1449,7 @@ function Skeleton({ className, ...props }) {
|
|
|
1359
1449
|
"div",
|
|
1360
1450
|
{
|
|
1361
1451
|
"data-slot": "skeleton",
|
|
1362
|
-
className: cn("animate-pulse rounded-md bg-muted", className),
|
|
1452
|
+
className: cn("animate-pulse motion-reduce:animate-none rounded-md bg-muted", className),
|
|
1363
1453
|
...props
|
|
1364
1454
|
}
|
|
1365
1455
|
);
|
|
@@ -1390,9 +1480,10 @@ function TooltipContent({
|
|
|
1390
1480
|
align = "center",
|
|
1391
1481
|
alignOffset = 0,
|
|
1392
1482
|
children,
|
|
1483
|
+
container,
|
|
1393
1484
|
...props
|
|
1394
1485
|
}) {
|
|
1395
|
-
return /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsx(
|
|
1486
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Portal, { container, className: container ? "contents" : void 0, children: /* @__PURE__ */ jsx(
|
|
1396
1487
|
Tooltip$1.Positioner,
|
|
1397
1488
|
{
|
|
1398
1489
|
align,
|
|
@@ -1405,7 +1496,7 @@ function TooltipContent({
|
|
|
1405
1496
|
{
|
|
1406
1497
|
"data-slot": "tooltip-content",
|
|
1407
1498
|
className: cn(
|
|
1408
|
-
"z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
1499
|
+
"z-50 inline-flex w-fit data-instant:animate-none max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in motion-reduce:animate-none! data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
1409
1500
|
className
|
|
1410
1501
|
),
|
|
1411
1502
|
...props,
|
|
@@ -1424,9 +1515,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
1424
1515
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
1425
1516
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
1426
1517
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
1427
|
-
var SidebarContext =
|
|
1518
|
+
var SidebarContext = React13.createContext(null);
|
|
1428
1519
|
function useSidebar() {
|
|
1429
|
-
const context =
|
|
1520
|
+
const context = React13.useContext(SidebarContext);
|
|
1430
1521
|
if (!context) {
|
|
1431
1522
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
1432
1523
|
}
|
|
@@ -1442,10 +1533,10 @@ function SidebarProvider({
|
|
|
1442
1533
|
...props
|
|
1443
1534
|
}) {
|
|
1444
1535
|
const isMobile = useIsMobile();
|
|
1445
|
-
const [openMobile, setOpenMobile] =
|
|
1446
|
-
const [_open, _setOpen] =
|
|
1536
|
+
const [openMobile, setOpenMobile] = React13.useState(false);
|
|
1537
|
+
const [_open, _setOpen] = React13.useState(defaultOpen);
|
|
1447
1538
|
const open = openProp ?? _open;
|
|
1448
|
-
const setOpen =
|
|
1539
|
+
const setOpen = React13.useCallback(
|
|
1449
1540
|
(value) => {
|
|
1450
1541
|
const openState = typeof value === "function" ? value(open) : value;
|
|
1451
1542
|
if (setOpenProp) {
|
|
@@ -1457,10 +1548,10 @@ function SidebarProvider({
|
|
|
1457
1548
|
},
|
|
1458
1549
|
[setOpenProp, open]
|
|
1459
1550
|
);
|
|
1460
|
-
const toggleSidebar =
|
|
1551
|
+
const toggleSidebar = React13.useCallback(() => {
|
|
1461
1552
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
1462
1553
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
1463
|
-
|
|
1554
|
+
React13.useEffect(() => {
|
|
1464
1555
|
const handleKeyDown = (event) => {
|
|
1465
1556
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
1466
1557
|
event.preventDefault();
|
|
@@ -1471,7 +1562,7 @@ function SidebarProvider({
|
|
|
1471
1562
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
1472
1563
|
}, [toggleSidebar]);
|
|
1473
1564
|
const state = open ? "expanded" : "collapsed";
|
|
1474
|
-
const contextValue =
|
|
1565
|
+
const contextValue = React13.useMemo(
|
|
1475
1566
|
() => ({
|
|
1476
1567
|
state,
|
|
1477
1568
|
open,
|
|
@@ -1635,7 +1726,7 @@ function SidebarRail({ className, ...props }) {
|
|
|
1635
1726
|
onClick: toggleSidebar,
|
|
1636
1727
|
title: "Toggle Sidebar",
|
|
1637
1728
|
className: cn(
|
|
1638
|
-
"absolute inset-y-0 z-20 hidden w-4 transition-
|
|
1729
|
+
"absolute inset-y-0 z-20 hidden w-4 transition-[background-color,translate,left,right] ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",
|
|
1639
1730
|
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
1640
1731
|
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
1641
1732
|
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar",
|
|
@@ -1931,7 +2022,7 @@ function SidebarMenuSkeleton({
|
|
|
1931
2022
|
showIcon = false,
|
|
1932
2023
|
...props
|
|
1933
2024
|
}) {
|
|
1934
|
-
const [width] =
|
|
2025
|
+
const [width] = React13.useState(() => {
|
|
1935
2026
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
1936
2027
|
});
|
|
1937
2028
|
return /* @__PURE__ */ jsxs(
|
|
@@ -2087,7 +2178,7 @@ function TableHead({ className, ...props }) {
|
|
|
2087
2178
|
{
|
|
2088
2179
|
"data-slot": "table-head",
|
|
2089
2180
|
className: cn(
|
|
2090
|
-
"h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
|
|
2181
|
+
"h-10 px-2 text-left align-middle text-xs font-medium whitespace-nowrap text-muted-foreground [&:has([role=checkbox])]:pr-0",
|
|
2091
2182
|
className
|
|
2092
2183
|
),
|
|
2093
2184
|
...props
|
|
@@ -2155,7 +2246,7 @@ function Toggle({
|
|
|
2155
2246
|
}
|
|
2156
2247
|
);
|
|
2157
2248
|
}
|
|
2158
|
-
var ToggleGroupContext =
|
|
2249
|
+
var ToggleGroupContext = React13.createContext({
|
|
2159
2250
|
size: "default",
|
|
2160
2251
|
variant: "default",
|
|
2161
2252
|
spacing: 2,
|
|
@@ -2201,7 +2292,7 @@ function ToggleGroupItem({
|
|
|
2201
2292
|
size = "default",
|
|
2202
2293
|
...props
|
|
2203
2294
|
}) {
|
|
2204
|
-
const context =
|
|
2295
|
+
const context = React13.useContext(ToggleGroupContext);
|
|
2205
2296
|
return /* @__PURE__ */ jsx(
|
|
2206
2297
|
Toggle$1,
|
|
2207
2298
|
{
|
|
@@ -2223,6 +2314,6 @@ function ToggleGroupItem({
|
|
|
2223
2314
|
);
|
|
2224
2315
|
}
|
|
2225
2316
|
|
|
2226
|
-
export { Badge, Calendar, CalendarDayButton, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Textarea, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, toggleVariants, useIsMobile, useSidebar };
|
|
2227
|
-
//# sourceMappingURL=chunk-
|
|
2228
|
-
//# sourceMappingURL=chunk-
|
|
2317
|
+
export { Badge, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Textarea, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, toggleVariants, useIsMobile, useSidebar };
|
|
2318
|
+
//# sourceMappingURL=chunk-7S52M2SL.js.map
|
|
2319
|
+
//# sourceMappingURL=chunk-7S52M2SL.js.map
|