@evinvest/uikit 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -4
- package/dist/index.d.ts +88 -5
- package/dist/index.js +406 -119
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -334,7 +334,9 @@ import "react";
|
|
|
334
334
|
var ALERT_BASE = "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current";
|
|
335
335
|
var alertVariants = {
|
|
336
336
|
"neutral": "bg-card text-ink",
|
|
337
|
-
"destructive": "text-accent-error bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-accent-error/90"
|
|
337
|
+
"destructive": "text-accent-error bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-accent-error/90",
|
|
338
|
+
"success": "text-positive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-positive/90",
|
|
339
|
+
"info": "text-accent-info bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-accent-info/90"
|
|
338
340
|
};
|
|
339
341
|
var ALERT_TITLE = "col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight";
|
|
340
342
|
var ALERT_DESCRIPTION = "text-ink-soft col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed";
|
|
@@ -1302,24 +1304,27 @@ function Footer({
|
|
|
1302
1304
|
}
|
|
1303
1305
|
|
|
1304
1306
|
// src/components/input.tsx
|
|
1305
|
-
import "react";
|
|
1307
|
+
import * as React24 from "react";
|
|
1306
1308
|
|
|
1307
1309
|
// src/generated/input.ts
|
|
1308
1310
|
var INPUT_BASE = "file:text-ink placeholder:text-ink-soft selection:bg-primary selection:text-on-primary border-input h-9 w-full min-w-0 rounded-[var(--control-radius)] border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-accent-error/20 aria-invalid:border-accent-error";
|
|
1309
1311
|
|
|
1310
1312
|
// src/components/input.tsx
|
|
1311
1313
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
}
|
|
1314
|
+
var Input = React24.forwardRef(
|
|
1315
|
+
function Input2({ className, type, ...props }, ref) {
|
|
1316
|
+
return /* @__PURE__ */ jsx14(
|
|
1317
|
+
"input",
|
|
1318
|
+
{
|
|
1319
|
+
ref,
|
|
1320
|
+
type,
|
|
1321
|
+
"data-slot": "input",
|
|
1322
|
+
className: cn(INPUT_BASE, className),
|
|
1323
|
+
...props
|
|
1324
|
+
}
|
|
1325
|
+
);
|
|
1326
|
+
}
|
|
1327
|
+
);
|
|
1323
1328
|
|
|
1324
1329
|
// src/components/textarea.tsx
|
|
1325
1330
|
import "react";
|
|
@@ -6758,6 +6763,21 @@ function mondayIndex(d) {
|
|
|
6758
6763
|
function sameDay(a, b) {
|
|
6759
6764
|
return !!a && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
6760
6765
|
}
|
|
6766
|
+
function startOfDay(d) {
|
|
6767
|
+
return new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
6768
|
+
}
|
|
6769
|
+
function outOfRange(day, min, max) {
|
|
6770
|
+
const t = day.getTime();
|
|
6771
|
+
return !!min && t < startOfDay(min).getTime() || !!max && t > startOfDay(max).getTime();
|
|
6772
|
+
}
|
|
6773
|
+
var MONDAY = new Date(2024, 0, 1);
|
|
6774
|
+
function localisedWeekdays(locale) {
|
|
6775
|
+
const fmt = new Intl.DateTimeFormat(locale, { weekday: "short" });
|
|
6776
|
+
return Array.from(
|
|
6777
|
+
{ length: 7 },
|
|
6778
|
+
(_, i) => fmt.format(new Date(MONDAY.getFullYear(), MONDAY.getMonth(), MONDAY.getDate() + i))
|
|
6779
|
+
);
|
|
6780
|
+
}
|
|
6761
6781
|
function Calendar({
|
|
6762
6782
|
selected,
|
|
6763
6783
|
onSelect,
|
|
@@ -6765,6 +6785,12 @@ function Calendar({
|
|
|
6765
6785
|
defaultMonth,
|
|
6766
6786
|
onMonthChange,
|
|
6767
6787
|
today = /* @__PURE__ */ new Date(),
|
|
6788
|
+
min,
|
|
6789
|
+
max,
|
|
6790
|
+
disabled = false,
|
|
6791
|
+
previousMonthLabel = "Previous month",
|
|
6792
|
+
nextMonthLabel = "Next month",
|
|
6793
|
+
locale,
|
|
6768
6794
|
className
|
|
6769
6795
|
}) {
|
|
6770
6796
|
const [internal, setInternal] = React66.useState(
|
|
@@ -6778,7 +6804,8 @@ function Calendar({
|
|
|
6778
6804
|
};
|
|
6779
6805
|
const year = view.getFullYear();
|
|
6780
6806
|
const monthIndex = view.getMonth();
|
|
6781
|
-
const caption = `${MONTHS[monthIndex]} ${year}`;
|
|
6807
|
+
const caption = locale ? new Intl.DateTimeFormat(locale, { month: "long", year: "numeric" }).format(view) : `${MONTHS[monthIndex]} ${year}`;
|
|
6808
|
+
const weekdays = locale ? localisedWeekdays(locale) : WEEKDAYS;
|
|
6782
6809
|
const lead = mondayIndex(view);
|
|
6783
6810
|
const total = new Date(year, monthIndex + 1, 0).getDate();
|
|
6784
6811
|
const cells = [];
|
|
@@ -6806,32 +6833,34 @@ function Calendar({
|
|
|
6806
6833
|
{
|
|
6807
6834
|
type: "button",
|
|
6808
6835
|
className: navClass,
|
|
6809
|
-
"aria-label":
|
|
6836
|
+
"aria-label": previousMonthLabel,
|
|
6837
|
+
disabled,
|
|
6810
6838
|
onClick: () => go(-1),
|
|
6811
6839
|
children: /* @__PURE__ */ jsx56(Chevron, { d: CHEVRON_LEFT })
|
|
6812
6840
|
}
|
|
6813
6841
|
),
|
|
6814
|
-
/* @__PURE__ */ jsx56("div", { className: CALENDAR_CAPTION, children: caption }),
|
|
6842
|
+
/* @__PURE__ */ jsx56("div", { "data-slot": "calendar-caption", className: CALENDAR_CAPTION, children: caption }),
|
|
6815
6843
|
/* @__PURE__ */ jsx56(
|
|
6816
6844
|
"button",
|
|
6817
6845
|
{
|
|
6818
6846
|
type: "button",
|
|
6819
6847
|
className: navClass,
|
|
6820
|
-
"aria-label":
|
|
6848
|
+
"aria-label": nextMonthLabel,
|
|
6849
|
+
disabled,
|
|
6821
6850
|
onClick: () => go(1),
|
|
6822
6851
|
children: /* @__PURE__ */ jsx56(Chevron, { d: CHEVRON_RIGHT })
|
|
6823
6852
|
}
|
|
6824
6853
|
)
|
|
6825
6854
|
] }),
|
|
6826
6855
|
/* @__PURE__ */ jsxs26("table", { className: CALENDAR_GRID, role: "grid", children: [
|
|
6827
|
-
/* @__PURE__ */ jsx56("thead", { children: /* @__PURE__ */ jsx56("tr", { className: CALENDAR_WEEKDAY_ROW, children:
|
|
6856
|
+
/* @__PURE__ */ jsx56("thead", { children: /* @__PURE__ */ jsx56("tr", { className: CALENDAR_WEEKDAY_ROW, children: weekdays.map((wd, i) => /* @__PURE__ */ jsx56(
|
|
6828
6857
|
"th",
|
|
6829
6858
|
{
|
|
6830
6859
|
scope: "col",
|
|
6831
6860
|
className: CALENDAR_WEEKDAY,
|
|
6832
6861
|
children: wd
|
|
6833
6862
|
},
|
|
6834
|
-
|
|
6863
|
+
i
|
|
6835
6864
|
)) }) }),
|
|
6836
6865
|
/* @__PURE__ */ jsx56("tbody", { children: weeks.map((week, wi) => /* @__PURE__ */ jsx56("tr", { className: CALENDAR_WEEK, children: week.map((cell, ci) => {
|
|
6837
6866
|
if (cell === null) {
|
|
@@ -6846,6 +6875,7 @@ function Calendar({
|
|
|
6846
6875
|
const date = new Date(year, monthIndex, cell);
|
|
6847
6876
|
const isSelected = sameDay(selected, date);
|
|
6848
6877
|
const isToday = sameDay(today, date);
|
|
6878
|
+
const isDisabled = disabled || outOfRange(date, min, max);
|
|
6849
6879
|
return /* @__PURE__ */ jsx56(
|
|
6850
6880
|
"td",
|
|
6851
6881
|
{
|
|
@@ -6859,7 +6889,10 @@ function Calendar({
|
|
|
6859
6889
|
"data-slot": "calendar-day",
|
|
6860
6890
|
"data-selected": isSelected,
|
|
6861
6891
|
"data-today": isToday,
|
|
6862
|
-
|
|
6892
|
+
...isDisabled ? { "data-disabled": "true", disabled: true } : {},
|
|
6893
|
+
onClick: () => {
|
|
6894
|
+
if (!isDisabled) onSelect?.(date);
|
|
6895
|
+
},
|
|
6863
6896
|
className: cn(
|
|
6864
6897
|
buttonVariants({
|
|
6865
6898
|
variant: "ghost",
|
|
@@ -6882,9 +6915,262 @@ function Calendar({
|
|
|
6882
6915
|
);
|
|
6883
6916
|
}
|
|
6884
6917
|
|
|
6885
|
-
// src/components/
|
|
6918
|
+
// src/components/date-time-picker.tsx
|
|
6886
6919
|
import * as React67 from "react";
|
|
6887
6920
|
|
|
6921
|
+
// src/generated/date-time-picker.ts
|
|
6922
|
+
var DATE_TIME_PICKER_TRIGGER = "w-full justify-start gap-2 text-left font-normal data-[placeholder]:text-ink-soft [&>svg]:text-ink-soft";
|
|
6923
|
+
var DATE_TIME_PICKER_CONTENT = "w-auto p-0";
|
|
6924
|
+
var DATE_TIME_PICKER_TIME = "flex items-center gap-2 border-t border-border px-3 py-2";
|
|
6925
|
+
var DATE_TIME_PICKER_TIME_INPUT = "w-14 text-center tabular-nums";
|
|
6926
|
+
var DATE_TIME_PICKER_TIME_SEPARATOR = "text-ink-soft select-none";
|
|
6927
|
+
var DATE_TIME_PICKER_CLEAR = "ml-auto";
|
|
6928
|
+
|
|
6929
|
+
// src/components/date-time-picker.tsx
|
|
6930
|
+
import { jsx as jsx57, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
6931
|
+
var CALENDAR_ICON = [
|
|
6932
|
+
"M8 2v4",
|
|
6933
|
+
"M16 2v4",
|
|
6934
|
+
"M3 10h18",
|
|
6935
|
+
"M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z"
|
|
6936
|
+
];
|
|
6937
|
+
function CalendarIcon() {
|
|
6938
|
+
return /* @__PURE__ */ jsx57(
|
|
6939
|
+
"svg",
|
|
6940
|
+
{
|
|
6941
|
+
className: "size-4",
|
|
6942
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6943
|
+
width: "24",
|
|
6944
|
+
height: "24",
|
|
6945
|
+
viewBox: "0 0 24 24",
|
|
6946
|
+
fill: "none",
|
|
6947
|
+
stroke: "currentColor",
|
|
6948
|
+
strokeWidth: "2",
|
|
6949
|
+
strokeLinecap: "round",
|
|
6950
|
+
strokeLinejoin: "round",
|
|
6951
|
+
"aria-hidden": true,
|
|
6952
|
+
children: CALENDAR_ICON.map((d) => /* @__PURE__ */ jsx57("path", { d }, d))
|
|
6953
|
+
}
|
|
6954
|
+
);
|
|
6955
|
+
}
|
|
6956
|
+
var pad = (n) => String(n).padStart(2, "0");
|
|
6957
|
+
function atMinute(d) {
|
|
6958
|
+
return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes());
|
|
6959
|
+
}
|
|
6960
|
+
function clampMoment(d, min, max) {
|
|
6961
|
+
const lo = min && atMinute(min);
|
|
6962
|
+
const hi = max && atMinute(max);
|
|
6963
|
+
if (lo && d.getTime() < lo.getTime()) return lo;
|
|
6964
|
+
if (hi && d.getTime() > hi.getTime()) return hi;
|
|
6965
|
+
return d;
|
|
6966
|
+
}
|
|
6967
|
+
function parseField(raw, max) {
|
|
6968
|
+
const digits = raw.replace(/\D/g, "").slice(-2);
|
|
6969
|
+
if (digits === "") return null;
|
|
6970
|
+
return Math.min(Number(digits), max);
|
|
6971
|
+
}
|
|
6972
|
+
var selectAll = (e) => e.currentTarget.select();
|
|
6973
|
+
function isoLabel(d) {
|
|
6974
|
+
return `${d.getFullYear().toString().padStart(4, "0")}-${pad(d.getMonth() + 1)}-${pad(
|
|
6975
|
+
d.getDate()
|
|
6976
|
+
)} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
6977
|
+
}
|
|
6978
|
+
function DateTimePicker({
|
|
6979
|
+
value: valueProp,
|
|
6980
|
+
defaultValue = null,
|
|
6981
|
+
onChange,
|
|
6982
|
+
min,
|
|
6983
|
+
max,
|
|
6984
|
+
locale,
|
|
6985
|
+
format,
|
|
6986
|
+
placeholder = "",
|
|
6987
|
+
labels = {},
|
|
6988
|
+
disabled = false,
|
|
6989
|
+
name,
|
|
6990
|
+
today = /* @__PURE__ */ new Date(),
|
|
6991
|
+
open,
|
|
6992
|
+
defaultOpen = false,
|
|
6993
|
+
onOpenChange,
|
|
6994
|
+
align = "start",
|
|
6995
|
+
className,
|
|
6996
|
+
id,
|
|
6997
|
+
...rest
|
|
6998
|
+
}) {
|
|
6999
|
+
const [value, setValue] = useControllableState({
|
|
7000
|
+
...valueProp !== void 0 ? { value: valueProp } : {},
|
|
7001
|
+
defaultValue,
|
|
7002
|
+
...onChange ? { onChange } : {}
|
|
7003
|
+
});
|
|
7004
|
+
const [isOpen, setOpen] = useControllableState({
|
|
7005
|
+
...open !== void 0 ? { value: open } : {},
|
|
7006
|
+
defaultValue: defaultOpen,
|
|
7007
|
+
...onOpenChange ? { onChange: onOpenChange } : {}
|
|
7008
|
+
});
|
|
7009
|
+
const rootRef = React67.useRef(null);
|
|
7010
|
+
const hoursRef = React67.useRef(null);
|
|
7011
|
+
React67.useEffect(() => {
|
|
7012
|
+
if (!isOpen) return;
|
|
7013
|
+
hoursRef.current?.focus();
|
|
7014
|
+
return () => {
|
|
7015
|
+
const active = document.activeElement;
|
|
7016
|
+
const content = hoursRef.current?.closest("[data-slot=date-time-picker-content]");
|
|
7017
|
+
const lost = !active || active === document.body || !!content?.contains(active);
|
|
7018
|
+
if (lost) {
|
|
7019
|
+
rootRef.current?.querySelector("[data-slot=date-time-picker-trigger]")?.focus();
|
|
7020
|
+
}
|
|
7021
|
+
};
|
|
7022
|
+
}, [isOpen]);
|
|
7023
|
+
const emit = (next) => setValue(clampMoment(atMinute(next), min, max));
|
|
7024
|
+
const base = () => value ? new Date(value.getTime()) : new Date(today.getFullYear(), today.getMonth(), today.getDate());
|
|
7025
|
+
const onSelect = (day) => emit(
|
|
7026
|
+
new Date(
|
|
7027
|
+
day.getFullYear(),
|
|
7028
|
+
day.getMonth(),
|
|
7029
|
+
day.getDate(),
|
|
7030
|
+
value?.getHours() ?? 0,
|
|
7031
|
+
value?.getMinutes() ?? 0
|
|
7032
|
+
)
|
|
7033
|
+
);
|
|
7034
|
+
const onHours = (e) => {
|
|
7035
|
+
const hour = parseField(e.target.value, 23);
|
|
7036
|
+
if (hour === null) return;
|
|
7037
|
+
const next = base();
|
|
7038
|
+
next.setHours(hour);
|
|
7039
|
+
emit(next);
|
|
7040
|
+
};
|
|
7041
|
+
const onMinutes = (e) => {
|
|
7042
|
+
const minute = parseField(e.target.value, 59);
|
|
7043
|
+
if (minute === null) return;
|
|
7044
|
+
const next = base();
|
|
7045
|
+
next.setMinutes(minute);
|
|
7046
|
+
emit(next);
|
|
7047
|
+
};
|
|
7048
|
+
const onClear = () => {
|
|
7049
|
+
setValue(null);
|
|
7050
|
+
setOpen(false);
|
|
7051
|
+
};
|
|
7052
|
+
const onContentBlur = (e) => {
|
|
7053
|
+
const next = e.relatedTarget;
|
|
7054
|
+
if (!(next instanceof Node)) return;
|
|
7055
|
+
if (e.currentTarget.contains(next) || rootRef.current?.contains(next)) return;
|
|
7056
|
+
setOpen(false);
|
|
7057
|
+
};
|
|
7058
|
+
const label = value ? format ? format(value) : locale ? (
|
|
7059
|
+
// The fields are 24-hour, so the label is too — even where the locale
|
|
7060
|
+
// would default to 12-hour ("2:05 PM" over a "14" hours field).
|
|
7061
|
+
new Intl.DateTimeFormat(locale, {
|
|
7062
|
+
dateStyle: "medium",
|
|
7063
|
+
timeStyle: "short",
|
|
7064
|
+
hourCycle: "h23"
|
|
7065
|
+
}).format(value)
|
|
7066
|
+
) : isoLabel(value) : placeholder;
|
|
7067
|
+
return /* @__PURE__ */ jsx57("div", { "data-slot": "date-time-picker", ref: rootRef, children: /* @__PURE__ */ jsxs27(Popover, { open: isOpen, onOpenChange: setOpen, children: [
|
|
7068
|
+
/* @__PURE__ */ jsxs27(
|
|
7069
|
+
PopoverTrigger,
|
|
7070
|
+
{
|
|
7071
|
+
type: "button",
|
|
7072
|
+
"data-slot": "date-time-picker-trigger",
|
|
7073
|
+
"data-placeholder": value ? void 0 : "true",
|
|
7074
|
+
"aria-haspopup": "dialog",
|
|
7075
|
+
className: cn(
|
|
7076
|
+
buttonVariants({ variant: "outline", size: "md" }),
|
|
7077
|
+
DATE_TIME_PICKER_TRIGGER,
|
|
7078
|
+
className
|
|
7079
|
+
),
|
|
7080
|
+
disabled,
|
|
7081
|
+
...id !== void 0 ? { id } : {},
|
|
7082
|
+
...rest,
|
|
7083
|
+
children: [
|
|
7084
|
+
/* @__PURE__ */ jsx57(CalendarIcon, {}),
|
|
7085
|
+
/* @__PURE__ */ jsx57("span", { children: label })
|
|
7086
|
+
]
|
|
7087
|
+
}
|
|
7088
|
+
),
|
|
7089
|
+
name !== void 0 && /* @__PURE__ */ jsx57(
|
|
7090
|
+
"input",
|
|
7091
|
+
{
|
|
7092
|
+
type: "hidden",
|
|
7093
|
+
name,
|
|
7094
|
+
value: value ? String(Math.floor(value.getTime() / 1e3)) : ""
|
|
7095
|
+
}
|
|
7096
|
+
),
|
|
7097
|
+
/* @__PURE__ */ jsxs27(
|
|
7098
|
+
PopoverContent,
|
|
7099
|
+
{
|
|
7100
|
+
"data-slot": "date-time-picker-content",
|
|
7101
|
+
role: "dialog",
|
|
7102
|
+
"aria-label": labels.dialog ?? "Choose date and time",
|
|
7103
|
+
align,
|
|
7104
|
+
onBlur: onContentBlur,
|
|
7105
|
+
className: DATE_TIME_PICKER_CONTENT,
|
|
7106
|
+
children: [
|
|
7107
|
+
/* @__PURE__ */ jsx57(
|
|
7108
|
+
Calendar,
|
|
7109
|
+
{
|
|
7110
|
+
...value ? { selected: value } : {},
|
|
7111
|
+
onSelect,
|
|
7112
|
+
defaultMonth: value ?? min ?? today,
|
|
7113
|
+
today,
|
|
7114
|
+
disabled,
|
|
7115
|
+
...min ? { min } : {},
|
|
7116
|
+
...max ? { max } : {},
|
|
7117
|
+
...locale !== void 0 ? { locale } : {},
|
|
7118
|
+
...labels.previousMonth !== void 0 ? { previousMonthLabel: labels.previousMonth } : {},
|
|
7119
|
+
...labels.nextMonth !== void 0 ? { nextMonthLabel: labels.nextMonth } : {}
|
|
7120
|
+
}
|
|
7121
|
+
),
|
|
7122
|
+
/* @__PURE__ */ jsxs27("div", { className: DATE_TIME_PICKER_TIME, "data-slot": "date-time-picker-time", children: [
|
|
7123
|
+
/* @__PURE__ */ jsx57(
|
|
7124
|
+
Input,
|
|
7125
|
+
{
|
|
7126
|
+
type: "text",
|
|
7127
|
+
inputMode: "numeric",
|
|
7128
|
+
onFocus: selectAll,
|
|
7129
|
+
className: DATE_TIME_PICKER_TIME_INPUT,
|
|
7130
|
+
ref: hoursRef,
|
|
7131
|
+
"data-slot": "date-time-picker-hours",
|
|
7132
|
+
"aria-label": labels.hours ?? "Hours",
|
|
7133
|
+
value: pad(value?.getHours() ?? 0),
|
|
7134
|
+
disabled,
|
|
7135
|
+
onChange: onHours
|
|
7136
|
+
}
|
|
7137
|
+
),
|
|
7138
|
+
/* @__PURE__ */ jsx57("span", { className: DATE_TIME_PICKER_TIME_SEPARATOR, "aria-hidden": true, children: ":" }),
|
|
7139
|
+
/* @__PURE__ */ jsx57(
|
|
7140
|
+
Input,
|
|
7141
|
+
{
|
|
7142
|
+
type: "text",
|
|
7143
|
+
inputMode: "numeric",
|
|
7144
|
+
onFocus: selectAll,
|
|
7145
|
+
className: DATE_TIME_PICKER_TIME_INPUT,
|
|
7146
|
+
"data-slot": "date-time-picker-minutes",
|
|
7147
|
+
"aria-label": labels.minutes ?? "Minutes",
|
|
7148
|
+
value: pad(value?.getMinutes() ?? 0),
|
|
7149
|
+
disabled,
|
|
7150
|
+
onChange: onMinutes
|
|
7151
|
+
}
|
|
7152
|
+
),
|
|
7153
|
+
/* @__PURE__ */ jsx57(
|
|
7154
|
+
"button",
|
|
7155
|
+
{
|
|
7156
|
+
type: "button",
|
|
7157
|
+
className: buttonVariants({ variant: "ghost", size: "sm", className: DATE_TIME_PICKER_CLEAR }),
|
|
7158
|
+
"data-slot": "date-time-picker-clear",
|
|
7159
|
+
disabled,
|
|
7160
|
+
onClick: onClear,
|
|
7161
|
+
children: labels.clear ?? "Clear"
|
|
7162
|
+
}
|
|
7163
|
+
)
|
|
7164
|
+
] })
|
|
7165
|
+
]
|
|
7166
|
+
}
|
|
7167
|
+
)
|
|
7168
|
+
] }) });
|
|
7169
|
+
}
|
|
7170
|
+
|
|
7171
|
+
// src/components/sonner.tsx
|
|
7172
|
+
import * as React68 from "react";
|
|
7173
|
+
|
|
6888
7174
|
// src/generated/sonner.ts
|
|
6889
7175
|
var TOAST_BASE = "pointer-events-auto flex w-full items-start gap-3 rounded-md border p-4 text-sm shadow-lg";
|
|
6890
7176
|
var toastVariantClasses = {
|
|
@@ -6908,7 +7194,7 @@ var TOAST_CONTENT = "flex-1 space-y-1";
|
|
|
6908
7194
|
var TOAST_TITLE = "font-medium";
|
|
6909
7195
|
|
|
6910
7196
|
// src/components/sonner.tsx
|
|
6911
|
-
import { jsx as
|
|
7197
|
+
import { jsx as jsx58, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
6912
7198
|
var DEFAULT_DURATION = 4e3;
|
|
6913
7199
|
var SWIPE_THRESHOLD = 45;
|
|
6914
7200
|
var SWIPE_VELOCITY = 0.11;
|
|
@@ -6973,17 +7259,17 @@ function ToastItem({
|
|
|
6973
7259
|
reportHeight,
|
|
6974
7260
|
removeHeight
|
|
6975
7261
|
}) {
|
|
6976
|
-
const ref =
|
|
6977
|
-
const [height, setHeight] =
|
|
6978
|
-
const remainingRef =
|
|
6979
|
-
const startedRef =
|
|
6980
|
-
const flingRef =
|
|
7262
|
+
const ref = React68.useRef(null);
|
|
7263
|
+
const [height, setHeight] = React68.useState(0);
|
|
7264
|
+
const remainingRef = React68.useRef(t.duration);
|
|
7265
|
+
const startedRef = React68.useRef(0);
|
|
7266
|
+
const flingRef = React68.useRef(
|
|
6981
7267
|
void 0
|
|
6982
7268
|
);
|
|
6983
|
-
const dragRef =
|
|
7269
|
+
const dragRef = React68.useRef(
|
|
6984
7270
|
null
|
|
6985
7271
|
);
|
|
6986
|
-
|
|
7272
|
+
React68.useLayoutEffect(() => {
|
|
6987
7273
|
const el = ref.current;
|
|
6988
7274
|
if (!el) return;
|
|
6989
7275
|
el.style.height = "auto";
|
|
@@ -6994,12 +7280,12 @@ function ToastItem({
|
|
|
6994
7280
|
reportHeight(t.id, h);
|
|
6995
7281
|
}
|
|
6996
7282
|
}, [t.id, t.message, t.description, reportHeight]);
|
|
6997
|
-
|
|
6998
|
-
const mountedClosing =
|
|
6999
|
-
|
|
7283
|
+
React68.useEffect(() => () => removeHeight(t.id), [t.id, removeHeight]);
|
|
7284
|
+
const mountedClosing = React68.useRef(t.state === "closing");
|
|
7285
|
+
React68.useEffect(() => {
|
|
7000
7286
|
if (mountedClosing.current) store.remove(t.id);
|
|
7001
7287
|
}, [t.id]);
|
|
7002
|
-
|
|
7288
|
+
React68.useEffect(() => {
|
|
7003
7289
|
if (t.duration === Infinity || t.state === "closing" || paused) return;
|
|
7004
7290
|
startedRef.current = Date.now();
|
|
7005
7291
|
const id = setTimeout(() => store.dismiss(t.id), remainingRef.current);
|
|
@@ -7011,7 +7297,7 @@ function ToastItem({
|
|
|
7011
7297
|
);
|
|
7012
7298
|
};
|
|
7013
7299
|
}, [paused, t.id, t.duration, t.state]);
|
|
7014
|
-
|
|
7300
|
+
React68.useEffect(
|
|
7015
7301
|
() => () => {
|
|
7016
7302
|
if (flingRef.current) clearTimeout(flingRef.current);
|
|
7017
7303
|
},
|
|
@@ -7070,7 +7356,7 @@ function ToastItem({
|
|
|
7070
7356
|
);
|
|
7071
7357
|
}
|
|
7072
7358
|
};
|
|
7073
|
-
return /* @__PURE__ */
|
|
7359
|
+
return /* @__PURE__ */ jsxs28(
|
|
7074
7360
|
"li",
|
|
7075
7361
|
{
|
|
7076
7362
|
ref,
|
|
@@ -7098,11 +7384,11 @@ function ToastItem({
|
|
|
7098
7384
|
toastVariantClasses[t.variant]
|
|
7099
7385
|
),
|
|
7100
7386
|
children: [
|
|
7101
|
-
/* @__PURE__ */
|
|
7102
|
-
/* @__PURE__ */
|
|
7103
|
-
t.description ? /* @__PURE__ */
|
|
7387
|
+
/* @__PURE__ */ jsxs28("div", { className: TOAST_CONTENT, children: [
|
|
7388
|
+
/* @__PURE__ */ jsx58("div", { className: TOAST_TITLE, children: t.message }),
|
|
7389
|
+
t.description ? /* @__PURE__ */ jsx58("div", { className: "text-ink-soft text-sm", children: t.description }) : null
|
|
7104
7390
|
] }),
|
|
7105
|
-
/* @__PURE__ */
|
|
7391
|
+
/* @__PURE__ */ jsx58(
|
|
7106
7392
|
"button",
|
|
7107
7393
|
{
|
|
7108
7394
|
type: "button",
|
|
@@ -7110,7 +7396,7 @@ function ToastItem({
|
|
|
7110
7396
|
"data-slot": "toast-close",
|
|
7111
7397
|
onClick: () => store.dismiss(t.id),
|
|
7112
7398
|
className: TOAST_CLOSE,
|
|
7113
|
-
children: /* @__PURE__ */
|
|
7399
|
+
children: /* @__PURE__ */ jsx58(
|
|
7114
7400
|
"svg",
|
|
7115
7401
|
{
|
|
7116
7402
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7123,7 +7409,7 @@ function ToastItem({
|
|
|
7123
7409
|
strokeLinecap: "round",
|
|
7124
7410
|
strokeLinejoin: "round",
|
|
7125
7411
|
"aria-hidden": "true",
|
|
7126
|
-
children: /* @__PURE__ */
|
|
7412
|
+
children: /* @__PURE__ */ jsx58("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
7127
7413
|
}
|
|
7128
7414
|
)
|
|
7129
7415
|
}
|
|
@@ -7137,17 +7423,17 @@ function Toaster({
|
|
|
7137
7423
|
className,
|
|
7138
7424
|
...props
|
|
7139
7425
|
}) {
|
|
7140
|
-
const [toasts, setToasts] =
|
|
7141
|
-
const [heights, setHeights] =
|
|
7142
|
-
const [paused, setPaused] =
|
|
7143
|
-
|
|
7426
|
+
const [toasts, setToasts] = React68.useState([]);
|
|
7427
|
+
const [heights, setHeights] = React68.useState(/* @__PURE__ */ new Map());
|
|
7428
|
+
const [paused, setPaused] = React68.useState(false);
|
|
7429
|
+
React68.useEffect(() => store.subscribe(setToasts), []);
|
|
7144
7430
|
const onEnter = () => setPaused(true);
|
|
7145
7431
|
const onLeave = (e) => {
|
|
7146
7432
|
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
7147
7433
|
setPaused(false);
|
|
7148
7434
|
}
|
|
7149
7435
|
};
|
|
7150
|
-
const reportHeight =
|
|
7436
|
+
const reportHeight = React68.useCallback((id, h) => {
|
|
7151
7437
|
setHeights((prev) => {
|
|
7152
7438
|
if (prev.get(id) === h) return prev;
|
|
7153
7439
|
const next = new Map(prev);
|
|
@@ -7155,7 +7441,7 @@ function Toaster({
|
|
|
7155
7441
|
return next;
|
|
7156
7442
|
});
|
|
7157
7443
|
}, []);
|
|
7158
|
-
const removeHeight =
|
|
7444
|
+
const removeHeight = React68.useCallback((id) => {
|
|
7159
7445
|
setHeights((prev) => {
|
|
7160
7446
|
if (!prev.has(id)) return prev;
|
|
7161
7447
|
const next = new Map(prev);
|
|
@@ -7173,7 +7459,7 @@ function Toaster({
|
|
|
7173
7459
|
sum += heights.get(t.id) ?? 0;
|
|
7174
7460
|
return o;
|
|
7175
7461
|
});
|
|
7176
|
-
return /* @__PURE__ */
|
|
7462
|
+
return /* @__PURE__ */ jsx58(
|
|
7177
7463
|
"ol",
|
|
7178
7464
|
{
|
|
7179
7465
|
"data-slot": "toaster",
|
|
@@ -7194,7 +7480,7 @@ function Toaster({
|
|
|
7194
7480
|
onPointerOut: onLeave,
|
|
7195
7481
|
onFocus: onEnter,
|
|
7196
7482
|
onBlur: onLeave,
|
|
7197
|
-
children: ordered.map((t, i) => /* @__PURE__ */
|
|
7483
|
+
children: ordered.map((t, i) => /* @__PURE__ */ jsx58(
|
|
7198
7484
|
ToastItem,
|
|
7199
7485
|
{
|
|
7200
7486
|
toast: t,
|
|
@@ -7212,7 +7498,7 @@ function Toaster({
|
|
|
7212
7498
|
}
|
|
7213
7499
|
|
|
7214
7500
|
// src/components/form.tsx
|
|
7215
|
-
import * as
|
|
7501
|
+
import * as React69 from "react";
|
|
7216
7502
|
|
|
7217
7503
|
// src/generated/form.ts
|
|
7218
7504
|
var FORM_ITEM = "grid gap-2";
|
|
@@ -7220,21 +7506,21 @@ var FORM_DESCRIPTION = "text-ink-soft text-sm";
|
|
|
7220
7506
|
var FORM_MESSAGE = "text-accent-error text-sm";
|
|
7221
7507
|
|
|
7222
7508
|
// src/components/form.tsx
|
|
7223
|
-
import { jsx as
|
|
7224
|
-
var FormItemContext =
|
|
7509
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
7510
|
+
var FormItemContext = React69.createContext(null);
|
|
7225
7511
|
function useFormItem() {
|
|
7226
|
-
const ctx =
|
|
7512
|
+
const ctx = React69.useContext(FormItemContext);
|
|
7227
7513
|
if (!ctx) {
|
|
7228
7514
|
throw new Error("Form parts must be used within <FormItem>");
|
|
7229
7515
|
}
|
|
7230
7516
|
return ctx;
|
|
7231
7517
|
}
|
|
7232
7518
|
function Form({ ...props }) {
|
|
7233
|
-
return /* @__PURE__ */
|
|
7519
|
+
return /* @__PURE__ */ jsx59("form", { "data-slot": "form", ...props });
|
|
7234
7520
|
}
|
|
7235
7521
|
function FormItem({ className, ...props }) {
|
|
7236
|
-
const id =
|
|
7237
|
-
const value =
|
|
7522
|
+
const id = React69.useId();
|
|
7523
|
+
const value = React69.useMemo(
|
|
7238
7524
|
() => ({
|
|
7239
7525
|
id,
|
|
7240
7526
|
formItemId: `${id}-form-item`,
|
|
@@ -7243,7 +7529,7 @@ function FormItem({ className, ...props }) {
|
|
|
7243
7529
|
}),
|
|
7244
7530
|
[id]
|
|
7245
7531
|
);
|
|
7246
|
-
return /* @__PURE__ */
|
|
7532
|
+
return /* @__PURE__ */ jsx59(FormItemContext.Provider, { value, children: /* @__PURE__ */ jsx59("div", { "data-slot": "form-item", className: cn(FORM_ITEM, className), ...props }) });
|
|
7247
7533
|
}
|
|
7248
7534
|
function FormLabel({
|
|
7249
7535
|
className,
|
|
@@ -7251,7 +7537,7 @@ function FormLabel({
|
|
|
7251
7537
|
...props
|
|
7252
7538
|
}) {
|
|
7253
7539
|
const { formItemId } = useFormItem();
|
|
7254
|
-
return /* @__PURE__ */
|
|
7540
|
+
return /* @__PURE__ */ jsx59(
|
|
7255
7541
|
Label,
|
|
7256
7542
|
{
|
|
7257
7543
|
"data-slot": "form-label",
|
|
@@ -7267,7 +7553,7 @@ function FormControl({
|
|
|
7267
7553
|
...props
|
|
7268
7554
|
}) {
|
|
7269
7555
|
const { formItemId, formDescriptionId, formMessageId } = useFormItem();
|
|
7270
|
-
return /* @__PURE__ */
|
|
7556
|
+
return /* @__PURE__ */ jsx59(
|
|
7271
7557
|
Slot,
|
|
7272
7558
|
{
|
|
7273
7559
|
"data-slot": "form-control",
|
|
@@ -7280,7 +7566,7 @@ function FormControl({
|
|
|
7280
7566
|
}
|
|
7281
7567
|
function FormDescription({ className, ...props }) {
|
|
7282
7568
|
const { formDescriptionId } = useFormItem();
|
|
7283
|
-
return /* @__PURE__ */
|
|
7569
|
+
return /* @__PURE__ */ jsx59(
|
|
7284
7570
|
"p",
|
|
7285
7571
|
{
|
|
7286
7572
|
"data-slot": "form-description",
|
|
@@ -7295,7 +7581,7 @@ function FormMessage({ className, children, ...props }) {
|
|
|
7295
7581
|
if (!children) {
|
|
7296
7582
|
return null;
|
|
7297
7583
|
}
|
|
7298
|
-
return /* @__PURE__ */
|
|
7584
|
+
return /* @__PURE__ */ jsx59(
|
|
7299
7585
|
"p",
|
|
7300
7586
|
{
|
|
7301
7587
|
"data-slot": "form-message",
|
|
@@ -7308,7 +7594,7 @@ function FormMessage({ className, children, ...props }) {
|
|
|
7308
7594
|
}
|
|
7309
7595
|
|
|
7310
7596
|
// src/components/resizable.tsx
|
|
7311
|
-
import * as
|
|
7597
|
+
import * as React70 from "react";
|
|
7312
7598
|
|
|
7313
7599
|
// src/generated/resizable.ts
|
|
7314
7600
|
var RESIZABLE_GROUP = "flex h-full w-full data-[panel-group-direction=vertical]:flex-col";
|
|
@@ -7317,10 +7603,10 @@ var RESIZABLE_HANDLE = "bg-border focus-visible:ring-ring relative flex w-px ite
|
|
|
7317
7603
|
var RESIZABLE_HANDLE_GRIP = "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border";
|
|
7318
7604
|
|
|
7319
7605
|
// src/components/resizable.tsx
|
|
7320
|
-
import { jsx as
|
|
7321
|
-
var ResizableContext =
|
|
7606
|
+
import { jsx as jsx60, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
7607
|
+
var ResizableContext = React70.createContext(null);
|
|
7322
7608
|
function useResizable() {
|
|
7323
|
-
const ctx =
|
|
7609
|
+
const ctx = React70.useContext(ResizableContext);
|
|
7324
7610
|
if (!ctx)
|
|
7325
7611
|
throw new Error("Resizable parts must be used within a ResizablePanelGroup");
|
|
7326
7612
|
return ctx;
|
|
@@ -7343,9 +7629,9 @@ function ResizablePanelGroup({
|
|
|
7343
7629
|
children,
|
|
7344
7630
|
...props
|
|
7345
7631
|
}) {
|
|
7346
|
-
const [sizes, setSizes] =
|
|
7347
|
-
const groupRef =
|
|
7348
|
-
const register =
|
|
7632
|
+
const [sizes, setSizes] = React70.useState([]);
|
|
7633
|
+
const groupRef = React70.useRef(null);
|
|
7634
|
+
const register = React70.useCallback((index, defaultSize) => {
|
|
7349
7635
|
setSizes((prev) => {
|
|
7350
7636
|
if (prev[index] !== void 0) return prev;
|
|
7351
7637
|
const next = prev.slice();
|
|
@@ -7354,14 +7640,14 @@ function ResizablePanelGroup({
|
|
|
7354
7640
|
return next;
|
|
7355
7641
|
});
|
|
7356
7642
|
}, []);
|
|
7357
|
-
|
|
7643
|
+
React70.useEffect(() => {
|
|
7358
7644
|
if (sizes.length) onLayout?.(sizes);
|
|
7359
7645
|
}, [sizes, onLayout]);
|
|
7360
|
-
const value =
|
|
7646
|
+
const value = React70.useMemo(
|
|
7361
7647
|
() => ({ sizes, setSizes, register, direction, keyboardStep, groupRef }),
|
|
7362
7648
|
[sizes, register, direction, keyboardStep]
|
|
7363
7649
|
);
|
|
7364
|
-
return /* @__PURE__ */
|
|
7650
|
+
return /* @__PURE__ */ jsx60(ResizableContext.Provider, { value, children: /* @__PURE__ */ jsx60(
|
|
7365
7651
|
"div",
|
|
7366
7652
|
{
|
|
7367
7653
|
ref: groupRef,
|
|
@@ -7382,11 +7668,11 @@ function ResizablePanel({
|
|
|
7382
7668
|
...props
|
|
7383
7669
|
}) {
|
|
7384
7670
|
const { sizes, register } = useResizable();
|
|
7385
|
-
|
|
7671
|
+
React70.useEffect(() => {
|
|
7386
7672
|
register(index, defaultSize);
|
|
7387
7673
|
}, [register, index, defaultSize]);
|
|
7388
7674
|
const basis = sizes[index] ?? defaultSize;
|
|
7389
|
-
return /* @__PURE__ */
|
|
7675
|
+
return /* @__PURE__ */ jsx60(
|
|
7390
7676
|
"div",
|
|
7391
7677
|
{
|
|
7392
7678
|
"data-slot": "resizable-panel",
|
|
@@ -7405,12 +7691,12 @@ function ResizableHandle({
|
|
|
7405
7691
|
...props
|
|
7406
7692
|
}) {
|
|
7407
7693
|
const { setSizes, direction, keyboardStep, groupRef } = useResizable();
|
|
7408
|
-
const draggingRef =
|
|
7409
|
-
const resize =
|
|
7694
|
+
const draggingRef = React70.useRef(false);
|
|
7695
|
+
const resize = React70.useCallback(
|
|
7410
7696
|
(delta) => setSizes((prev) => redistribute(prev, index, delta)),
|
|
7411
7697
|
[setSizes, index]
|
|
7412
7698
|
);
|
|
7413
|
-
const onPointerMove =
|
|
7699
|
+
const onPointerMove = React70.useCallback(
|
|
7414
7700
|
(event) => {
|
|
7415
7701
|
if (!draggingRef.current) return;
|
|
7416
7702
|
const rect = groupRef.current?.getBoundingClientRect();
|
|
@@ -7422,7 +7708,7 @@ function ResizableHandle({
|
|
|
7422
7708
|
},
|
|
7423
7709
|
[direction, resize, groupRef]
|
|
7424
7710
|
);
|
|
7425
|
-
const onPointerUp =
|
|
7711
|
+
const onPointerUp = React70.useCallback(() => {
|
|
7426
7712
|
draggingRef.current = false;
|
|
7427
7713
|
window.removeEventListener("pointermove", onPointerMove);
|
|
7428
7714
|
window.removeEventListener("pointerup", onPointerUp);
|
|
@@ -7433,7 +7719,7 @@ function ResizableHandle({
|
|
|
7433
7719
|
window.addEventListener("pointermove", onPointerMove);
|
|
7434
7720
|
window.addEventListener("pointerup", onPointerUp);
|
|
7435
7721
|
};
|
|
7436
|
-
|
|
7722
|
+
React70.useEffect(() => () => onPointerUp(), [onPointerUp]);
|
|
7437
7723
|
const onKeyDown = (event) => {
|
|
7438
7724
|
let delta;
|
|
7439
7725
|
switch (event.key) {
|
|
@@ -7453,7 +7739,7 @@ function ResizableHandle({
|
|
|
7453
7739
|
event.preventDefault();
|
|
7454
7740
|
resize(delta);
|
|
7455
7741
|
};
|
|
7456
|
-
return /* @__PURE__ */
|
|
7742
|
+
return /* @__PURE__ */ jsxs29(
|
|
7457
7743
|
"div",
|
|
7458
7744
|
{
|
|
7459
7745
|
"data-slot": "resizable-handle",
|
|
@@ -7466,7 +7752,7 @@ function ResizableHandle({
|
|
|
7466
7752
|
onKeyDown,
|
|
7467
7753
|
...props,
|
|
7468
7754
|
children: [
|
|
7469
|
-
withHandle && /* @__PURE__ */
|
|
7755
|
+
withHandle && /* @__PURE__ */ jsx60("div", { className: RESIZABLE_HANDLE_GRIP, children: /* @__PURE__ */ jsxs29(
|
|
7470
7756
|
"svg",
|
|
7471
7757
|
{
|
|
7472
7758
|
className: "size-2.5",
|
|
@@ -7481,12 +7767,12 @@ function ResizableHandle({
|
|
|
7481
7767
|
strokeLinejoin: "round",
|
|
7482
7768
|
"aria-hidden": "true",
|
|
7483
7769
|
children: [
|
|
7484
|
-
/* @__PURE__ */
|
|
7485
|
-
/* @__PURE__ */
|
|
7486
|
-
/* @__PURE__ */
|
|
7487
|
-
/* @__PURE__ */
|
|
7488
|
-
/* @__PURE__ */
|
|
7489
|
-
/* @__PURE__ */
|
|
7770
|
+
/* @__PURE__ */ jsx60("circle", { cx: "9", cy: "12", r: "1" }),
|
|
7771
|
+
/* @__PURE__ */ jsx60("circle", { cx: "9", cy: "5", r: "1" }),
|
|
7772
|
+
/* @__PURE__ */ jsx60("circle", { cx: "9", cy: "19", r: "1" }),
|
|
7773
|
+
/* @__PURE__ */ jsx60("circle", { cx: "15", cy: "12", r: "1" }),
|
|
7774
|
+
/* @__PURE__ */ jsx60("circle", { cx: "15", cy: "5", r: "1" }),
|
|
7775
|
+
/* @__PURE__ */ jsx60("circle", { cx: "15", cy: "19", r: "1" })
|
|
7490
7776
|
]
|
|
7491
7777
|
}
|
|
7492
7778
|
) }),
|
|
@@ -7497,7 +7783,7 @@ function ResizableHandle({
|
|
|
7497
7783
|
}
|
|
7498
7784
|
|
|
7499
7785
|
// src/components/terminal.tsx
|
|
7500
|
-
import * as
|
|
7786
|
+
import * as React71 from "react";
|
|
7501
7787
|
|
|
7502
7788
|
// src/generated/terminal.ts
|
|
7503
7789
|
var TERMINAL_ROOT = "grid w-full grid-cols-1 gap-px bg-border text-ink text-sm lg:h-[calc(100dvh-var(--ev-shell-offset,0px))] lg:grid-cols-[minmax(0,1fr)_18rem_20rem] lg:grid-rows-[auto_minmax(0,1fr)_14rem]";
|
|
@@ -7543,12 +7829,12 @@ var orderSideClasses = {
|
|
|
7543
7829
|
var OPEN_ORDERS_EMPTY = "flex flex-1 items-center justify-center p-6 text-sm text-ink-soft";
|
|
7544
7830
|
|
|
7545
7831
|
// src/components/terminal.tsx
|
|
7546
|
-
import { jsx as
|
|
7832
|
+
import { jsx as jsx61, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
7547
7833
|
function Terminal({ className, ...props }) {
|
|
7548
|
-
return /* @__PURE__ */
|
|
7834
|
+
return /* @__PURE__ */ jsx61("div", { "data-slot": "terminal", className: cn(TERMINAL_ROOT, className), ...props });
|
|
7549
7835
|
}
|
|
7550
7836
|
function TerminalPane({ area, className, ...props }) {
|
|
7551
|
-
return /* @__PURE__ */
|
|
7837
|
+
return /* @__PURE__ */ jsx61(
|
|
7552
7838
|
"section",
|
|
7553
7839
|
{
|
|
7554
7840
|
"data-slot": "terminal-pane",
|
|
@@ -7559,7 +7845,7 @@ function TerminalPane({ area, className, ...props }) {
|
|
|
7559
7845
|
);
|
|
7560
7846
|
}
|
|
7561
7847
|
function TerminalPaneHeader({ className, ...props }) {
|
|
7562
|
-
return /* @__PURE__ */
|
|
7848
|
+
return /* @__PURE__ */ jsx61(
|
|
7563
7849
|
"header",
|
|
7564
7850
|
{
|
|
7565
7851
|
"data-slot": "terminal-pane-header",
|
|
@@ -7569,10 +7855,10 @@ function TerminalPaneHeader({ className, ...props }) {
|
|
|
7569
7855
|
);
|
|
7570
7856
|
}
|
|
7571
7857
|
function TerminalPaneBody({ className, ...props }) {
|
|
7572
|
-
return /* @__PURE__ */
|
|
7858
|
+
return /* @__PURE__ */ jsx61("div", { "data-slot": "terminal-pane-body", className: cn(TERMINAL_PANE_BODY, className), ...props });
|
|
7573
7859
|
}
|
|
7574
|
-
var TerminalChart =
|
|
7575
|
-
return /* @__PURE__ */
|
|
7860
|
+
var TerminalChart = React71.forwardRef(function TerminalChart2({ className, ...props }, ref) {
|
|
7861
|
+
return /* @__PURE__ */ jsx61(
|
|
7576
7862
|
"div",
|
|
7577
7863
|
{
|
|
7578
7864
|
ref,
|
|
@@ -7583,7 +7869,7 @@ var TerminalChart = React70.forwardRef(function TerminalChart2({ className, ...p
|
|
|
7583
7869
|
);
|
|
7584
7870
|
});
|
|
7585
7871
|
function TerminalTicker({ className, ...props }) {
|
|
7586
|
-
return /* @__PURE__ */
|
|
7872
|
+
return /* @__PURE__ */ jsx61(
|
|
7587
7873
|
"div",
|
|
7588
7874
|
{
|
|
7589
7875
|
"data-slot": "terminal-ticker",
|
|
@@ -7594,19 +7880,19 @@ function TerminalTicker({ className, ...props }) {
|
|
|
7594
7880
|
);
|
|
7595
7881
|
}
|
|
7596
7882
|
function TickerStat({ label, value, className, ...props }) {
|
|
7597
|
-
return /* @__PURE__ */
|
|
7598
|
-
/* @__PURE__ */
|
|
7599
|
-
/* @__PURE__ */
|
|
7883
|
+
return /* @__PURE__ */ jsxs30("div", { "data-slot": "ticker-stat", className: TERMINAL_TICKER_STAT, ...props, children: [
|
|
7884
|
+
/* @__PURE__ */ jsx61("span", { className: TERMINAL_TICKER_LABEL, children: label }),
|
|
7885
|
+
/* @__PURE__ */ jsx61("span", { className: cn(TERMINAL_TICKER_VALUE, className), children: value })
|
|
7600
7886
|
] });
|
|
7601
7887
|
}
|
|
7602
7888
|
function OrderBook({ className, ...props }) {
|
|
7603
|
-
return /* @__PURE__ */
|
|
7889
|
+
return /* @__PURE__ */ jsx61("div", { "data-slot": "order-book", className: cn(ORDER_BOOK, className), ...props });
|
|
7604
7890
|
}
|
|
7605
7891
|
function OrderBookHead({ price, size, total, className, ...props }) {
|
|
7606
|
-
return /* @__PURE__ */
|
|
7607
|
-
/* @__PURE__ */
|
|
7608
|
-
/* @__PURE__ */
|
|
7609
|
-
/* @__PURE__ */
|
|
7892
|
+
return /* @__PURE__ */ jsxs30("div", { "data-slot": "order-book-head", className: cn(ORDER_BOOK_HEAD, className), ...props, children: [
|
|
7893
|
+
/* @__PURE__ */ jsx61("span", { children: price }),
|
|
7894
|
+
/* @__PURE__ */ jsx61("span", { children: size }),
|
|
7895
|
+
/* @__PURE__ */ jsx61("span", { children: total })
|
|
7610
7896
|
] });
|
|
7611
7897
|
}
|
|
7612
7898
|
function OrderBookRow({
|
|
@@ -7618,7 +7904,7 @@ function OrderBookRow({
|
|
|
7618
7904
|
className,
|
|
7619
7905
|
...props
|
|
7620
7906
|
}) {
|
|
7621
|
-
return /* @__PURE__ */
|
|
7907
|
+
return /* @__PURE__ */ jsxs30(
|
|
7622
7908
|
"div",
|
|
7623
7909
|
{
|
|
7624
7910
|
"data-slot": "order-book-row",
|
|
@@ -7626,7 +7912,7 @@ function OrderBookRow({
|
|
|
7626
7912
|
className: cn(ORDER_BOOK_ROW, className),
|
|
7627
7913
|
...props,
|
|
7628
7914
|
children: [
|
|
7629
|
-
/* @__PURE__ */
|
|
7915
|
+
/* @__PURE__ */ jsx61(
|
|
7630
7916
|
"span",
|
|
7631
7917
|
{
|
|
7632
7918
|
"aria-hidden": "true",
|
|
@@ -7634,9 +7920,9 @@ function OrderBookRow({
|
|
|
7634
7920
|
style: { width: `${depthPercent(depth)}%` }
|
|
7635
7921
|
}
|
|
7636
7922
|
),
|
|
7637
|
-
/* @__PURE__ */
|
|
7638
|
-
/* @__PURE__ */
|
|
7639
|
-
/* @__PURE__ */
|
|
7923
|
+
/* @__PURE__ */ jsx61("span", { className: cn(ORDER_BOOK_PRICE, bookSideClasses[side]), children: price }),
|
|
7924
|
+
/* @__PURE__ */ jsx61("span", { children: size }),
|
|
7925
|
+
/* @__PURE__ */ jsx61("span", { children: total })
|
|
7640
7926
|
]
|
|
7641
7927
|
}
|
|
7642
7928
|
);
|
|
@@ -7646,10 +7932,10 @@ function depthPercent(depth) {
|
|
|
7646
7932
|
return Math.round(Math.min(1, Math.max(0, depth)) * 100);
|
|
7647
7933
|
}
|
|
7648
7934
|
function OrderBookSpread({ className, ...props }) {
|
|
7649
|
-
return /* @__PURE__ */
|
|
7935
|
+
return /* @__PURE__ */ jsx61("div", { "data-slot": "order-book-spread", className: cn(ORDER_BOOK_SPREAD, className), ...props });
|
|
7650
7936
|
}
|
|
7651
7937
|
function TradesTapeRow({ side, price, size, time, className, ...props }) {
|
|
7652
|
-
return /* @__PURE__ */
|
|
7938
|
+
return /* @__PURE__ */ jsxs30(
|
|
7653
7939
|
"div",
|
|
7654
7940
|
{
|
|
7655
7941
|
"data-slot": "trades-tape-row",
|
|
@@ -7657,15 +7943,15 @@ function TradesTapeRow({ side, price, size, time, className, ...props }) {
|
|
|
7657
7943
|
className: cn(TRADES_TAPE_ROW, className),
|
|
7658
7944
|
...props,
|
|
7659
7945
|
children: [
|
|
7660
|
-
/* @__PURE__ */
|
|
7661
|
-
/* @__PURE__ */
|
|
7662
|
-
/* @__PURE__ */
|
|
7946
|
+
/* @__PURE__ */ jsx61("span", { className: cn(ORDER_BOOK_PRICE, bookSideClasses[side]), children: price }),
|
|
7947
|
+
/* @__PURE__ */ jsx61("span", { children: size }),
|
|
7948
|
+
/* @__PURE__ */ jsx61("span", { children: time })
|
|
7663
7949
|
]
|
|
7664
7950
|
}
|
|
7665
7951
|
);
|
|
7666
7952
|
}
|
|
7667
7953
|
function OrderForm({ className, onSubmit, ...props }) {
|
|
7668
|
-
return /* @__PURE__ */
|
|
7954
|
+
return /* @__PURE__ */ jsx61(
|
|
7669
7955
|
"form",
|
|
7670
7956
|
{
|
|
7671
7957
|
"data-slot": "order-form",
|
|
@@ -7679,13 +7965,13 @@ function OrderForm({ className, onSubmit, ...props }) {
|
|
|
7679
7965
|
);
|
|
7680
7966
|
}
|
|
7681
7967
|
function OrderFormRow({ label, value, className, ...props }) {
|
|
7682
|
-
return /* @__PURE__ */
|
|
7683
|
-
/* @__PURE__ */
|
|
7684
|
-
/* @__PURE__ */
|
|
7968
|
+
return /* @__PURE__ */ jsxs30("div", { "data-slot": "order-form-row", className: cn(ORDER_FORM_ROW, className), ...props, children: [
|
|
7969
|
+
/* @__PURE__ */ jsx61("span", { className: ORDER_FORM_LABEL, children: label }),
|
|
7970
|
+
/* @__PURE__ */ jsx61("span", { className: ORDER_FORM_VALUE, children: value })
|
|
7685
7971
|
] });
|
|
7686
7972
|
}
|
|
7687
7973
|
function OrderFormSubmit({ side = "buy", className, ...props }) {
|
|
7688
|
-
return /* @__PURE__ */
|
|
7974
|
+
return /* @__PURE__ */ jsx61(
|
|
7689
7975
|
"button",
|
|
7690
7976
|
{
|
|
7691
7977
|
type: "submit",
|
|
@@ -7697,7 +7983,7 @@ function OrderFormSubmit({ side = "buy", className, ...props }) {
|
|
|
7697
7983
|
);
|
|
7698
7984
|
}
|
|
7699
7985
|
function OpenOrdersEmpty({ className, ...props }) {
|
|
7700
|
-
return /* @__PURE__ */
|
|
7986
|
+
return /* @__PURE__ */ jsx61("div", { "data-slot": "open-orders-empty", className: cn(OPEN_ORDERS_EMPTY, className), ...props });
|
|
7701
7987
|
}
|
|
7702
7988
|
export {
|
|
7703
7989
|
Accordion,
|
|
@@ -7782,6 +8068,7 @@ export {
|
|
|
7782
8068
|
ContextMenuSubContent,
|
|
7783
8069
|
ContextMenuSubTrigger,
|
|
7784
8070
|
ContextMenuTrigger,
|
|
8071
|
+
DateTimePicker,
|
|
7785
8072
|
Dialog,
|
|
7786
8073
|
DialogClose,
|
|
7787
8074
|
DialogContent,
|