pixelplay 1.0.13 → 1.1.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/CHANGELOG.md +146 -61
- package/README.md +91 -91
- package/dist/index.js +107 -63
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +129 -85
- package/dist/index.mjs.map +1 -1
- package/dist/server.js.map +1 -1
- package/dist/server.mjs.map +1 -1
- package/package.json +75 -80
package/dist/index.mjs
CHANGED
|
@@ -1794,7 +1794,7 @@ function DropdownMenuItem({
|
|
|
1794
1794
|
}
|
|
1795
1795
|
|
|
1796
1796
|
// ../../app/ui-kit/pixelplay-ui/shared/ui/select/Select.tsx
|
|
1797
|
-
import { useState, useRef, useEffect } from "react";
|
|
1797
|
+
import { useState, useRef, useEffect, useCallback } from "react";
|
|
1798
1798
|
import Image2 from "next/image";
|
|
1799
1799
|
import { Check as Check2, ChevronDown, ChevronUp, Search } from "react-feather";
|
|
1800
1800
|
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
@@ -1886,6 +1886,7 @@ function Select({
|
|
|
1886
1886
|
}) {
|
|
1887
1887
|
const [open, setOpen] = useState(false);
|
|
1888
1888
|
const [search, setSearch] = useState("");
|
|
1889
|
+
const [openAbove, setOpenAbove] = useState(false);
|
|
1889
1890
|
const containerRef = useRef(null);
|
|
1890
1891
|
useEffect(() => {
|
|
1891
1892
|
function onOutsideClick(e) {
|
|
@@ -1897,6 +1898,21 @@ function Select({
|
|
|
1897
1898
|
document.addEventListener("mousedown", onOutsideClick);
|
|
1898
1899
|
return () => document.removeEventListener("mousedown", onOutsideClick);
|
|
1899
1900
|
}, []);
|
|
1901
|
+
const computeOpenAbove = useCallback(() => {
|
|
1902
|
+
if (!containerRef.current) return false;
|
|
1903
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
1904
|
+
const spaceBelow = window.innerHeight - rect.bottom;
|
|
1905
|
+
const panelHeight = 280;
|
|
1906
|
+
return spaceBelow < panelHeight && rect.top > spaceBelow;
|
|
1907
|
+
}, []);
|
|
1908
|
+
const toggleOpen = useCallback(() => {
|
|
1909
|
+
setOpen((prev) => {
|
|
1910
|
+
if (!prev) {
|
|
1911
|
+
setOpenAbove(computeOpenAbove());
|
|
1912
|
+
}
|
|
1913
|
+
return !prev;
|
|
1914
|
+
});
|
|
1915
|
+
}, [computeOpenAbove]);
|
|
1900
1916
|
const selectedOption = options.find((o) => o.value === value);
|
|
1901
1917
|
const filtered = isSearchable ? options.filter(
|
|
1902
1918
|
(o) => o.label.toLowerCase().includes(search.toLowerCase())
|
|
@@ -1916,7 +1932,7 @@ function Select({
|
|
|
1916
1932
|
{
|
|
1917
1933
|
type: "button",
|
|
1918
1934
|
disabled: isDisabled,
|
|
1919
|
-
onClick: () => !isDisabled &&
|
|
1935
|
+
onClick: () => !isDisabled && toggleOpen(),
|
|
1920
1936
|
className: cn(
|
|
1921
1937
|
"flex w-full items-center rounded-lg border transition-all",
|
|
1922
1938
|
"bg-[var(--surface-container-lowest)] border-[var(--outline)]",
|
|
@@ -1952,7 +1968,8 @@ function Select({
|
|
|
1952
1968
|
"div",
|
|
1953
1969
|
{
|
|
1954
1970
|
className: cn(
|
|
1955
|
-
"absolute left-0
|
|
1971
|
+
"absolute left-0 z-50 w-full overflow-hidden rounded-lg",
|
|
1972
|
+
openAbove ? "bottom-full mb-1" : "top-full mt-1",
|
|
1956
1973
|
"bg-[var(--surface-container-lowest)]",
|
|
1957
1974
|
"shadow-[0px_4px_6px_-2px_rgba(10,13,18,0.05),0px_12px_16px_-4px_rgba(10,13,18,0.10)]",
|
|
1958
1975
|
"outline outline-1 outline-offset-[-1px] outline-[var(--outline)]"
|
|
@@ -3360,7 +3377,7 @@ function TooltipTrigger({
|
|
|
3360
3377
|
import {
|
|
3361
3378
|
useEffect as useEffect2,
|
|
3362
3379
|
useRef as useRef3,
|
|
3363
|
-
useCallback,
|
|
3380
|
+
useCallback as useCallback2,
|
|
3364
3381
|
useId as useId4,
|
|
3365
3382
|
useSyncExternalStore
|
|
3366
3383
|
} from "react";
|
|
@@ -3562,7 +3579,7 @@ function Modal({
|
|
|
3562
3579
|
const titleId = useId4();
|
|
3563
3580
|
const descId = useId4();
|
|
3564
3581
|
const panelRef = useRef3(null);
|
|
3565
|
-
const handleKeyDown =
|
|
3582
|
+
const handleKeyDown = useCallback2(
|
|
3566
3583
|
(e) => {
|
|
3567
3584
|
if (e.key === "Escape") onClose == null ? void 0 : onClose();
|
|
3568
3585
|
},
|
|
@@ -6303,7 +6320,7 @@ function Alert({
|
|
|
6303
6320
|
// ../../app/ui-kit/pixelplay-ui/shared/ui/toast/Toast.tsx
|
|
6304
6321
|
import {
|
|
6305
6322
|
createContext,
|
|
6306
|
-
useCallback as
|
|
6323
|
+
useCallback as useCallback3,
|
|
6307
6324
|
useContext,
|
|
6308
6325
|
useEffect as useEffect4,
|
|
6309
6326
|
useState as useState6
|
|
@@ -6386,7 +6403,7 @@ function ToastProvider({ children }) {
|
|
|
6386
6403
|
const [toasts, setToasts] = useState6([]);
|
|
6387
6404
|
const [mounted, setMounted] = useState6(false);
|
|
6388
6405
|
useEffect4(() => setMounted(true), []);
|
|
6389
|
-
const removeToast =
|
|
6406
|
+
const removeToast = useCallback3((id) => {
|
|
6390
6407
|
setToasts(
|
|
6391
6408
|
(prev) => prev.map((t) => t.id === id ? __spreadProps(__spreadValues({}, t), { visible: false }) : t)
|
|
6392
6409
|
);
|
|
@@ -6394,7 +6411,7 @@ function ToastProvider({ children }) {
|
|
|
6394
6411
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
6395
6412
|
}, 300);
|
|
6396
6413
|
}, []);
|
|
6397
|
-
const addToast =
|
|
6414
|
+
const addToast = useCallback3(
|
|
6398
6415
|
(toast) => {
|
|
6399
6416
|
var _a;
|
|
6400
6417
|
const id = String(++_idCounter);
|
|
@@ -6437,7 +6454,7 @@ function ToastProvider({ children }) {
|
|
|
6437
6454
|
}
|
|
6438
6455
|
|
|
6439
6456
|
// ../../app/ui-kit/pixelplay-ui/shared/ui/date-picker/DatePicker.tsx
|
|
6440
|
-
import { useCallback as
|
|
6457
|
+
import { useCallback as useCallback4, useEffect as useEffect5, useRef as useRef5, useState as useState7 } from "react";
|
|
6441
6458
|
import { Calendar, ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight3 } from "react-feather";
|
|
6442
6459
|
import { jsx as jsx41, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
6443
6460
|
var MONTHS = [
|
|
@@ -6785,7 +6802,7 @@ function DatePicker({
|
|
|
6785
6802
|
const [pending, setPending] = useState7(current != null ? current : null);
|
|
6786
6803
|
const [open, setOpen] = useState7(false);
|
|
6787
6804
|
const wrapRef = useRef5(null);
|
|
6788
|
-
const handleClose =
|
|
6805
|
+
const handleClose = useCallback4(() => setOpen(false), []);
|
|
6789
6806
|
useClickOutside(wrapRef, handleClose, open && !inline);
|
|
6790
6807
|
useEffect5(() => {
|
|
6791
6808
|
if (controlled) {
|
|
@@ -6895,7 +6912,7 @@ function DateTimePicker({
|
|
|
6895
6912
|
const slots = timeSlots != null ? timeSlots : DEFAULT_SLOTS;
|
|
6896
6913
|
const wrapRef = useRef5(null);
|
|
6897
6914
|
const slotListRef = useRef5(null);
|
|
6898
|
-
const handleClose =
|
|
6915
|
+
const handleClose = useCallback4(() => setOpen(false), []);
|
|
6899
6916
|
useClickOutside(wrapRef, handleClose, open && !inline);
|
|
6900
6917
|
useEffect5(() => {
|
|
6901
6918
|
if (controlled) {
|
|
@@ -7058,7 +7075,7 @@ function DateRangePicker({
|
|
|
7058
7075
|
const [activePreset, setActivePreset] = useState7(null);
|
|
7059
7076
|
const [open, setOpen] = useState7(false);
|
|
7060
7077
|
const wrapRef = useRef5(null);
|
|
7061
|
-
const handleClose =
|
|
7078
|
+
const handleClose = useCallback4(() => setOpen(false), []);
|
|
7062
7079
|
useClickOutside(wrapRef, handleClose, open && !inline);
|
|
7063
7080
|
useEffect5(() => {
|
|
7064
7081
|
if (controlled) {
|
|
@@ -7191,7 +7208,7 @@ function DateRangePicker({
|
|
|
7191
7208
|
}
|
|
7192
7209
|
|
|
7193
7210
|
// ../../app/ui-kit/pixelplay-ui/shared/ui/calendar/Calendar.tsx
|
|
7194
|
-
import React23, { useState as useState8, useCallback as
|
|
7211
|
+
import React23, { useState as useState8, useCallback as useCallback5, useMemo, useRef as useRef6 } from "react";
|
|
7195
7212
|
import {
|
|
7196
7213
|
Plus,
|
|
7197
7214
|
ChevronLeft as ChevronLeft4,
|
|
@@ -7297,63 +7314,63 @@ function getHourLabels() {
|
|
|
7297
7314
|
var HOUR_LABELS = getHourLabels();
|
|
7298
7315
|
var colorMap3 = {
|
|
7299
7316
|
neutral: {
|
|
7300
|
-
chip: "bg-[var(--
|
|
7301
|
-
dot: "bg-[var(--
|
|
7302
|
-
text: "text-[var(--
|
|
7303
|
-
time: "text-[var(--
|
|
7317
|
+
chip: "bg-[var(--surface-container-low)] ring-[var(--outline-variant)] hover:bg-[var(--surface-container)]",
|
|
7318
|
+
dot: "bg-[var(--on-surface-variant)]",
|
|
7319
|
+
text: "text-[var(--on-surface)]",
|
|
7320
|
+
time: "text-[var(--on-surface-variant)]"
|
|
7304
7321
|
},
|
|
7305
7322
|
blue: {
|
|
7306
|
-
chip: "bg-[var(--
|
|
7307
|
-
dot: "bg-[var(--
|
|
7308
|
-
text: "text-[var(--
|
|
7309
|
-
time: "text-[var(--
|
|
7323
|
+
chip: "bg-[var(--graphic-1-container)] ring-[var(--graphic-1)] hover:bg-[var(--graphic-1-container)]",
|
|
7324
|
+
dot: "bg-[var(--graphic-1)]",
|
|
7325
|
+
text: "text-[var(--on-graphic-1-container)]",
|
|
7326
|
+
time: "text-[var(--on-graphic-1-container)]"
|
|
7310
7327
|
},
|
|
7311
7328
|
green: {
|
|
7312
|
-
chip: "bg-[var(--
|
|
7313
|
-
dot: "bg-[var(--
|
|
7314
|
-
text: "text-[var(--
|
|
7315
|
-
time: "text-[var(--
|
|
7329
|
+
chip: "bg-[var(--graphic-2-container)] ring-[var(--graphic-2)] hover:bg-[var(--graphic-2-container)]",
|
|
7330
|
+
dot: "bg-[var(--graphic-2)]",
|
|
7331
|
+
text: "text-[var(--on-graphic-2-container)]",
|
|
7332
|
+
time: "text-[var(--on-graphic-2-container)]"
|
|
7316
7333
|
},
|
|
7317
7334
|
purple: {
|
|
7318
|
-
chip: "bg-[var(--
|
|
7319
|
-
dot: "bg-[var(--
|
|
7320
|
-
text: "text-[var(--
|
|
7321
|
-
time: "text-[var(--
|
|
7335
|
+
chip: "bg-[var(--graphic-3-container)] ring-[var(--graphic-3)] hover:bg-[var(--graphic-3-container)]",
|
|
7336
|
+
dot: "bg-[var(--graphic-3)]",
|
|
7337
|
+
text: "text-[var(--on-graphic-3-container)]",
|
|
7338
|
+
time: "text-[var(--on-graphic-3-container)]"
|
|
7322
7339
|
},
|
|
7323
7340
|
orange: {
|
|
7324
|
-
chip: "bg-[var(--
|
|
7325
|
-
dot: "bg-[var(--
|
|
7326
|
-
text: "text-[var(--
|
|
7327
|
-
time: "text-[var(--
|
|
7341
|
+
chip: "bg-[var(--graphic-4-container)] ring-[var(--graphic-4)] hover:bg-[var(--graphic-4-container)]",
|
|
7342
|
+
dot: "bg-[var(--graphic-4)]",
|
|
7343
|
+
text: "text-[var(--on-graphic-4-container)]",
|
|
7344
|
+
time: "text-[var(--on-graphic-4-container)]"
|
|
7328
7345
|
},
|
|
7329
7346
|
pink: {
|
|
7330
|
-
chip: "bg-[var(--
|
|
7331
|
-
dot: "bg-[var(--
|
|
7332
|
-
text: "text-[var(--
|
|
7333
|
-
time: "text-[var(--
|
|
7347
|
+
chip: "bg-[var(--graphic-5-container)] ring-[var(--graphic-5)] hover:bg-[var(--graphic-5-container)]",
|
|
7348
|
+
dot: "bg-[var(--graphic-5)]",
|
|
7349
|
+
text: "text-[var(--on-graphic-5-container)]",
|
|
7350
|
+
time: "text-[var(--on-graphic-5-container)]"
|
|
7334
7351
|
},
|
|
7335
7352
|
red: {
|
|
7336
|
-
chip: "bg-[var(--
|
|
7337
|
-
dot: "bg-[var(--
|
|
7338
|
-
text: "text-[var(--
|
|
7339
|
-
time: "text-[var(--
|
|
7353
|
+
chip: "bg-[var(--graphic-6-container)] ring-[var(--graphic-6)] hover:bg-[var(--graphic-6-container)]",
|
|
7354
|
+
dot: "bg-[var(--graphic-6)]",
|
|
7355
|
+
text: "text-[var(--on-graphic-6-container)]",
|
|
7356
|
+
time: "text-[var(--on-graphic-6-container)]"
|
|
7340
7357
|
},
|
|
7341
7358
|
yellow: {
|
|
7342
|
-
chip: "bg-[var(--
|
|
7343
|
-
dot: "bg-[var(--
|
|
7344
|
-
text: "text-[var(--
|
|
7345
|
-
time: "text-[var(--
|
|
7359
|
+
chip: "bg-[var(--graphic-7-container)] ring-[var(--graphic-7)] hover:bg-[var(--graphic-7-container)]",
|
|
7360
|
+
dot: "bg-[var(--graphic-7)]",
|
|
7361
|
+
text: "text-[var(--on-graphic-7-container)]",
|
|
7362
|
+
time: "text-[var(--on-graphic-7-container)]"
|
|
7346
7363
|
}
|
|
7347
7364
|
};
|
|
7348
7365
|
var cardColorMap = {
|
|
7349
|
-
neutral: "bg-[var(--
|
|
7350
|
-
blue: "bg-[var(--
|
|
7351
|
-
green: "bg-[var(--
|
|
7352
|
-
purple: "bg-[var(--
|
|
7353
|
-
orange: "bg-[var(--
|
|
7354
|
-
pink: "bg-[var(--
|
|
7355
|
-
red: "bg-[var(--
|
|
7356
|
-
yellow: "bg-[var(--
|
|
7366
|
+
neutral: "bg-[var(--surface-container-low)] ring-[var(--outline-variant)] text-[var(--on-surface)]",
|
|
7367
|
+
blue: "bg-[var(--graphic-1-container)] ring-[var(--graphic-1)] text-[var(--on-graphic-1-container)]",
|
|
7368
|
+
green: "bg-[var(--graphic-2-container)] ring-[var(--graphic-2)] text-[var(--on-graphic-2-container)]",
|
|
7369
|
+
purple: "bg-[var(--graphic-3-container)] ring-[var(--graphic-3)] text-[var(--on-graphic-3-container)]",
|
|
7370
|
+
orange: "bg-[var(--graphic-4-container)] ring-[var(--graphic-4)] text-[var(--on-graphic-4-container)]",
|
|
7371
|
+
pink: "bg-[var(--graphic-5-container)] ring-[var(--graphic-5)] text-[var(--on-graphic-5-container)]",
|
|
7372
|
+
red: "bg-[var(--graphic-6-container)] ring-[var(--graphic-6)] text-[var(--on-graphic-6-container)]",
|
|
7373
|
+
yellow: "bg-[var(--graphic-7-container)] ring-[var(--graphic-7)] text-[var(--on-graphic-7-container)]"
|
|
7357
7374
|
};
|
|
7358
7375
|
function EventChip({
|
|
7359
7376
|
event,
|
|
@@ -7423,7 +7440,7 @@ function MonthView({
|
|
|
7423
7440
|
onEventClick
|
|
7424
7441
|
}) {
|
|
7425
7442
|
const cells = useMemo(() => getMonthCells(year, month), [year, month]);
|
|
7426
|
-
const eventsForDay =
|
|
7443
|
+
const eventsForDay = useCallback5(
|
|
7427
7444
|
(date) => events.filter((e) => isSameDay2(e.date, date)).sort((a, b) => {
|
|
7428
7445
|
return timeToMinutes(a.startTime) - timeToMinutes(b.startTime);
|
|
7429
7446
|
}),
|
|
@@ -7588,7 +7605,7 @@ function WeekView({
|
|
|
7588
7605
|
() => days.findIndex((d) => isToday2(d)),
|
|
7589
7606
|
[days]
|
|
7590
7607
|
);
|
|
7591
|
-
const eventsForDay =
|
|
7608
|
+
const eventsForDay = useCallback5(
|
|
7592
7609
|
(date) => events.filter((e) => isSameDay2(e.date, date)).sort(
|
|
7593
7610
|
(a, b) => timeToMinutes(a.startTime) - timeToMinutes(b.startTime)
|
|
7594
7611
|
),
|
|
@@ -7681,11 +7698,13 @@ function WeekView({
|
|
|
7681
7698
|
const top = startMins / 60 * CELL_HEIGHT;
|
|
7682
7699
|
const height = durationMins / 60 * CELL_HEIGHT;
|
|
7683
7700
|
const c = cardColorMap[(_a = ev.color) != null ? _a : "neutral"];
|
|
7684
|
-
|
|
7701
|
+
const isCompact = durationMins <= 30;
|
|
7702
|
+
return /* @__PURE__ */ jsx42(
|
|
7685
7703
|
"div",
|
|
7686
7704
|
{
|
|
7687
7705
|
className: cn(
|
|
7688
|
-
"absolute pointer-events-auto z-10 rounded-md
|
|
7706
|
+
"absolute pointer-events-auto z-10 rounded-md ring-1 ring-inset cursor-pointer overflow-hidden",
|
|
7707
|
+
isCompact ? "px-2 py-0.5" : "px-2 py-1",
|
|
7689
7708
|
c
|
|
7690
7709
|
),
|
|
7691
7710
|
style: {
|
|
@@ -7698,13 +7717,19 @@ function WeekView({
|
|
|
7698
7717
|
e.stopPropagation();
|
|
7699
7718
|
onEventClick == null ? void 0 : onEventClick(ev);
|
|
7700
7719
|
},
|
|
7701
|
-
children: [
|
|
7720
|
+
children: isCompact ? /* @__PURE__ */ jsxs38("p", { className: "text-xs font-semibold truncate leading-tight", children: [
|
|
7721
|
+
ev.title,
|
|
7722
|
+
/* @__PURE__ */ jsxs38("span", { className: "font-normal opacity-75", children: [
|
|
7723
|
+
" \xB7 ",
|
|
7724
|
+
formatTime12(ev.startTime)
|
|
7725
|
+
] })
|
|
7726
|
+
] }) : /* @__PURE__ */ jsxs38(Fragment6, { children: [
|
|
7702
7727
|
/* @__PURE__ */ jsx42("p", { className: "text-xs font-semibold truncate", children: ev.title }),
|
|
7703
7728
|
/* @__PURE__ */ jsxs38("p", { className: "text-xs opacity-75", children: [
|
|
7704
7729
|
formatTime12(ev.startTime),
|
|
7705
7730
|
ev.endTime && ` \u2013 ${formatTime12(ev.endTime)}`
|
|
7706
7731
|
] })
|
|
7707
|
-
]
|
|
7732
|
+
] })
|
|
7708
7733
|
},
|
|
7709
7734
|
ev.id
|
|
7710
7735
|
);
|
|
@@ -7811,7 +7836,7 @@ function DayView({
|
|
|
7811
7836
|
const now = /* @__PURE__ */ new Date();
|
|
7812
7837
|
return now.getHours() * 60 + now.getMinutes();
|
|
7813
7838
|
}, [date]);
|
|
7814
|
-
const hasEvents =
|
|
7839
|
+
const hasEvents = useCallback5(
|
|
7815
7840
|
(d) => events.some((e) => isSameDay2(e.date, d)),
|
|
7816
7841
|
[events]
|
|
7817
7842
|
);
|
|
@@ -8052,41 +8077,60 @@ function ViewDropdown({
|
|
|
8052
8077
|
onViewChange
|
|
8053
8078
|
}) {
|
|
8054
8079
|
const [open, setOpen] = useState8(false);
|
|
8080
|
+
const [dropdownStyle, setDropdownStyle] = useState8({});
|
|
8081
|
+
const wrapperRef = useRef6(null);
|
|
8055
8082
|
const labels = {
|
|
8056
8083
|
month: "Month view",
|
|
8057
8084
|
week: "Week view",
|
|
8058
8085
|
day: "Day view"
|
|
8059
8086
|
};
|
|
8060
|
-
|
|
8087
|
+
const handleToggle = () => {
|
|
8088
|
+
if (!open && wrapperRef.current) {
|
|
8089
|
+
const rect = wrapperRef.current.getBoundingClientRect();
|
|
8090
|
+
setDropdownStyle({
|
|
8091
|
+
top: rect.bottom + 4,
|
|
8092
|
+
right: window.innerWidth - rect.right
|
|
8093
|
+
});
|
|
8094
|
+
}
|
|
8095
|
+
setOpen((o) => !o);
|
|
8096
|
+
};
|
|
8097
|
+
return /* @__PURE__ */ jsxs38("div", { className: "relative", ref: wrapperRef, children: [
|
|
8061
8098
|
/* @__PURE__ */ jsx42(
|
|
8062
8099
|
Button,
|
|
8063
8100
|
{
|
|
8064
8101
|
variant: "bordered",
|
|
8065
8102
|
size: "sm",
|
|
8066
8103
|
endContent: /* @__PURE__ */ jsx42(ChevronDown2, { size: 14 }),
|
|
8067
|
-
onClick:
|
|
8104
|
+
onClick: handleToggle,
|
|
8068
8105
|
"aria-haspopup": "true",
|
|
8069
8106
|
"aria-expanded": open,
|
|
8070
8107
|
children: labels[view]
|
|
8071
8108
|
}
|
|
8072
8109
|
),
|
|
8073
8110
|
open && /* @__PURE__ */ jsxs38(Fragment6, { children: [
|
|
8074
|
-
/* @__PURE__ */ jsx42("div", { className: "fixed inset-0 z-
|
|
8075
|
-
/* @__PURE__ */ jsx42(
|
|
8076
|
-
"
|
|
8111
|
+
/* @__PURE__ */ jsx42("div", { className: "fixed inset-0 z-40", onClick: () => setOpen(false) }),
|
|
8112
|
+
/* @__PURE__ */ jsx42(
|
|
8113
|
+
"div",
|
|
8077
8114
|
{
|
|
8078
|
-
className:
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8115
|
+
className: "fixed z-50 w-40 overflow-hidden rounded-lg border border-[var(--outline-variant)] bg-[var(--surface)] shadow-lg",
|
|
8116
|
+
style: dropdownStyle,
|
|
8117
|
+
children: ["month", "week", "day"].map((v) => /* @__PURE__ */ jsx42(
|
|
8118
|
+
"button",
|
|
8119
|
+
{
|
|
8120
|
+
className: cn(
|
|
8121
|
+
"flex w-full items-center px-3 py-2 text-sm font-medium transition-colors",
|
|
8122
|
+
v === view ? "bg-[var(--surface-container-low,var(--surface-dim))] text-[var(--on-surface)]" : "text-[var(--on-surface-variant)] hover:bg-[var(--surface-container-low,var(--surface-dim))] hover:text-[var(--on-surface)]"
|
|
8123
|
+
),
|
|
8124
|
+
onClick: () => {
|
|
8125
|
+
onViewChange(v);
|
|
8126
|
+
setOpen(false);
|
|
8127
|
+
},
|
|
8128
|
+
children: labels[v]
|
|
8129
|
+
},
|
|
8130
|
+
v
|
|
8131
|
+
))
|
|
8132
|
+
}
|
|
8133
|
+
)
|
|
8090
8134
|
] })
|
|
8091
8135
|
] });
|
|
8092
8136
|
}
|
|
@@ -8210,35 +8254,35 @@ function Calendar2({
|
|
|
8210
8254
|
const view = controlledView != null ? controlledView : internalView;
|
|
8211
8255
|
const [internalDate, setInternalDate] = useState8(defaultDate != null ? defaultDate : today);
|
|
8212
8256
|
const date = controlledDate != null ? controlledDate : internalDate;
|
|
8213
|
-
const handleViewChange =
|
|
8257
|
+
const handleViewChange = useCallback5(
|
|
8214
8258
|
(v) => {
|
|
8215
8259
|
setInternalView(v);
|
|
8216
8260
|
onViewChange == null ? void 0 : onViewChange(v);
|
|
8217
8261
|
},
|
|
8218
8262
|
[onViewChange]
|
|
8219
8263
|
);
|
|
8220
|
-
const handleDateChange =
|
|
8264
|
+
const handleDateChange = useCallback5(
|
|
8221
8265
|
(d) => {
|
|
8222
8266
|
setInternalDate(d);
|
|
8223
8267
|
onDateChange == null ? void 0 : onDateChange(d);
|
|
8224
8268
|
},
|
|
8225
8269
|
[onDateChange]
|
|
8226
8270
|
);
|
|
8227
|
-
const handlePrev =
|
|
8271
|
+
const handlePrev = useCallback5(() => {
|
|
8228
8272
|
const d = new Date(date);
|
|
8229
8273
|
if (view === "month") d.setMonth(d.getMonth() - 1);
|
|
8230
8274
|
else if (view === "week") d.setDate(d.getDate() - 7);
|
|
8231
8275
|
else d.setDate(d.getDate() - 1);
|
|
8232
8276
|
handleDateChange(d);
|
|
8233
8277
|
}, [date, view, handleDateChange]);
|
|
8234
|
-
const handleNext =
|
|
8278
|
+
const handleNext = useCallback5(() => {
|
|
8235
8279
|
const d = new Date(date);
|
|
8236
8280
|
if (view === "month") d.setMonth(d.getMonth() + 1);
|
|
8237
8281
|
else if (view === "week") d.setDate(d.getDate() + 7);
|
|
8238
8282
|
else d.setDate(d.getDate() + 1);
|
|
8239
8283
|
handleDateChange(d);
|
|
8240
8284
|
}, [date, view, handleDateChange]);
|
|
8241
|
-
const handleToday =
|
|
8285
|
+
const handleToday = useCallback5(() => {
|
|
8242
8286
|
handleDateChange(/* @__PURE__ */ new Date());
|
|
8243
8287
|
}, [handleDateChange]);
|
|
8244
8288
|
return /* @__PURE__ */ jsxs38(
|
|
@@ -8382,7 +8426,7 @@ function FileTypeIcon({ name, variant = "outline" }) {
|
|
|
8382
8426
|
}
|
|
8383
8427
|
|
|
8384
8428
|
// ../../app/ui-kit/pixelplay-ui/shared/ui/file-upload/FileUpload.tsx
|
|
8385
|
-
import { useId as useId7, useRef as
|
|
8429
|
+
import { useId as useId7, useRef as useRef7, useState as useState9 } from "react";
|
|
8386
8430
|
import { UploadCloud, X as X4, CheckCircle as CheckCircle3, XCircle, RotateCcw } from "react-feather";
|
|
8387
8431
|
import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
8388
8432
|
function FileRow({
|
|
@@ -8662,9 +8706,9 @@ function FileUpload({
|
|
|
8662
8706
|
className
|
|
8663
8707
|
}) {
|
|
8664
8708
|
const inputId = useId7();
|
|
8665
|
-
const containerRef =
|
|
8709
|
+
const containerRef = useRef7(null);
|
|
8666
8710
|
const [isDragging, setIsDragging] = useState9(false);
|
|
8667
|
-
const dragCounter =
|
|
8711
|
+
const dragCounter = useRef7(0);
|
|
8668
8712
|
function handleDragEnter(e) {
|
|
8669
8713
|
e.preventDefault();
|
|
8670
8714
|
dragCounter.current++;
|