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