pixelplay 1.0.15 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -853,10 +853,10 @@ var SIZE_MAP = {
853
853
  checkbox: "h-3.5 w-3.5"
854
854
  },
855
855
  lg: {
856
- outer: "gap-2 rounded-md px-3 py-1.5",
857
- text: "text-sm font-medium leading-5",
856
+ outer: "gap-2 rounded-lg px-3.5 py-1.5",
857
+ text: "text-base font-medium leading-6",
858
858
  iconWrapper: "h-5 w-5",
859
- dot: "h-2 w-2",
859
+ dot: "h-2.5 w-2.5",
860
860
  dismissSize: 14,
861
861
  checkbox: "h-4 w-4"
862
862
  }
@@ -948,7 +948,7 @@ var Card = React5.forwardRef(
948
948
  className,
949
949
  isPressable = false,
950
950
  isBlurred = false,
951
- shadow = "md",
951
+ shadow = "xs",
952
952
  radius = "lg",
953
953
  fullWidth = false,
954
954
  onClick
@@ -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 && setOpen((v) => !v),
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 top-full z-50 mt-1 w-full overflow-hidden rounded-lg",
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)]"
@@ -2068,6 +2085,7 @@ function Toggle({
2068
2085
  !isChecked && !isDisabled && "hover:bg-[var(--surface-container-high)]",
2069
2086
  "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[var(--primary-container)]",
2070
2087
  isDisabled ? "cursor-not-allowed" : "cursor-pointer",
2088
+ size === "sm" ? "before:content-[''] before:absolute before:-inset-[10px]" : "before:content-[''] before:absolute before:-inset-3",
2071
2089
  !label && !description && className
2072
2090
  ),
2073
2091
  children: /* @__PURE__ */ jsx16(
@@ -2243,7 +2261,10 @@ function Checkbox({
2243
2261
  onChange: handleChange,
2244
2262
  disabled: isDisabled,
2245
2263
  "aria-checked": indeterminate ? "mixed" : isChecked,
2246
- className: "peer absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed"
2264
+ className: cn(
2265
+ "peer absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 cursor-pointer opacity-0 disabled:cursor-not-allowed",
2266
+ size === "sm" ? "min-h-10 min-w-10" : "min-h-12 min-w-12"
2267
+ )
2247
2268
  }
2248
2269
  ),
2249
2270
  /* @__PURE__ */ jsx17(
@@ -3360,7 +3381,7 @@ function TooltipTrigger({
3360
3381
  import {
3361
3382
  useEffect as useEffect2,
3362
3383
  useRef as useRef3,
3363
- useCallback,
3384
+ useCallback as useCallback2,
3364
3385
  useId as useId4,
3365
3386
  useSyncExternalStore
3366
3387
  } from "react";
@@ -3562,7 +3583,7 @@ function Modal({
3562
3583
  const titleId = useId4();
3563
3584
  const descId = useId4();
3564
3585
  const panelRef = useRef3(null);
3565
- const handleKeyDown = useCallback(
3586
+ const handleKeyDown = useCallback2(
3566
3587
  (e) => {
3567
3588
  if (e.key === "Escape") onClose == null ? void 0 : onClose();
3568
3589
  },
@@ -6303,7 +6324,7 @@ function Alert({
6303
6324
  // ../../app/ui-kit/pixelplay-ui/shared/ui/toast/Toast.tsx
6304
6325
  import {
6305
6326
  createContext,
6306
- useCallback as useCallback2,
6327
+ useCallback as useCallback3,
6307
6328
  useContext,
6308
6329
  useEffect as useEffect4,
6309
6330
  useState as useState6
@@ -6386,7 +6407,7 @@ function ToastProvider({ children }) {
6386
6407
  const [toasts, setToasts] = useState6([]);
6387
6408
  const [mounted, setMounted] = useState6(false);
6388
6409
  useEffect4(() => setMounted(true), []);
6389
- const removeToast = useCallback2((id) => {
6410
+ const removeToast = useCallback3((id) => {
6390
6411
  setToasts(
6391
6412
  (prev) => prev.map((t) => t.id === id ? __spreadProps(__spreadValues({}, t), { visible: false }) : t)
6392
6413
  );
@@ -6394,7 +6415,7 @@ function ToastProvider({ children }) {
6394
6415
  setToasts((prev) => prev.filter((t) => t.id !== id));
6395
6416
  }, 300);
6396
6417
  }, []);
6397
- const addToast = useCallback2(
6418
+ const addToast = useCallback3(
6398
6419
  (toast) => {
6399
6420
  var _a;
6400
6421
  const id = String(++_idCounter);
@@ -6437,7 +6458,7 @@ function ToastProvider({ children }) {
6437
6458
  }
6438
6459
 
6439
6460
  // ../../app/ui-kit/pixelplay-ui/shared/ui/date-picker/DatePicker.tsx
6440
- import { useCallback as useCallback3, useEffect as useEffect5, useRef as useRef5, useState as useState7 } from "react";
6461
+ import { useCallback as useCallback4, useEffect as useEffect5, useRef as useRef5, useState as useState7 } from "react";
6441
6462
  import { Calendar, ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight3 } from "react-feather";
6442
6463
  import { jsx as jsx41, jsxs as jsxs37 } from "react/jsx-runtime";
6443
6464
  var MONTHS = [
@@ -6785,7 +6806,7 @@ function DatePicker({
6785
6806
  const [pending, setPending] = useState7(current != null ? current : null);
6786
6807
  const [open, setOpen] = useState7(false);
6787
6808
  const wrapRef = useRef5(null);
6788
- const handleClose = useCallback3(() => setOpen(false), []);
6809
+ const handleClose = useCallback4(() => setOpen(false), []);
6789
6810
  useClickOutside(wrapRef, handleClose, open && !inline);
6790
6811
  useEffect5(() => {
6791
6812
  if (controlled) {
@@ -6895,7 +6916,7 @@ function DateTimePicker({
6895
6916
  const slots = timeSlots != null ? timeSlots : DEFAULT_SLOTS;
6896
6917
  const wrapRef = useRef5(null);
6897
6918
  const slotListRef = useRef5(null);
6898
- const handleClose = useCallback3(() => setOpen(false), []);
6919
+ const handleClose = useCallback4(() => setOpen(false), []);
6899
6920
  useClickOutside(wrapRef, handleClose, open && !inline);
6900
6921
  useEffect5(() => {
6901
6922
  if (controlled) {
@@ -7058,7 +7079,7 @@ function DateRangePicker({
7058
7079
  const [activePreset, setActivePreset] = useState7(null);
7059
7080
  const [open, setOpen] = useState7(false);
7060
7081
  const wrapRef = useRef5(null);
7061
- const handleClose = useCallback3(() => setOpen(false), []);
7082
+ const handleClose = useCallback4(() => setOpen(false), []);
7062
7083
  useClickOutside(wrapRef, handleClose, open && !inline);
7063
7084
  useEffect5(() => {
7064
7085
  if (controlled) {
@@ -7191,7 +7212,7 @@ function DateRangePicker({
7191
7212
  }
7192
7213
 
7193
7214
  // ../../app/ui-kit/pixelplay-ui/shared/ui/calendar/Calendar.tsx
7194
- import React23, { useState as useState8, useCallback as useCallback4, useMemo } from "react";
7215
+ import React23, { useState as useState8, useCallback as useCallback5, useMemo, useRef as useRef6 } from "react";
7195
7216
  import {
7196
7217
  Plus,
7197
7218
  ChevronLeft as ChevronLeft4,
@@ -7297,63 +7318,63 @@ function getHourLabels() {
7297
7318
  var HOUR_LABELS = getHourLabels();
7298
7319
  var colorMap3 = {
7299
7320
  neutral: {
7300
- chip: "bg-[var(--utility-neutral-50,#f9fafb)] ring-[var(--utility-neutral-200,#e5e7eb)] hover:bg-[var(--utility-neutral-100,#f3f4f6)]",
7301
- dot: "bg-[var(--utility-neutral-500,#6b7280)]",
7302
- text: "text-[var(--utility-neutral-700,#374151)]",
7303
- time: "text-[var(--utility-neutral-600,#4b5563)]"
7321
+ chip: "bg-[var(--surface-container-low)] ring-[var(--outline-variant)] hover:bg-[var(--surface-container)]",
7322
+ dot: "bg-[var(--on-surface-variant)]",
7323
+ text: "text-[var(--on-surface)]",
7324
+ time: "text-[var(--on-surface-variant)]"
7304
7325
  },
7305
7326
  blue: {
7306
- chip: "bg-[var(--utility-blue-50,#eff6ff)] ring-[var(--utility-blue-200,#bfdbfe)] hover:bg-[var(--utility-blue-100,#dbeafe)]",
7307
- dot: "bg-[var(--utility-blue-500,#3b82f6)]",
7308
- text: "text-[var(--utility-blue-700,#1d4ed8)]",
7309
- time: "text-[var(--utility-blue-600,#2563eb)]"
7327
+ chip: "bg-[var(--graphic-1-container)] ring-[var(--graphic-1)] hover:bg-[var(--graphic-1-container)]",
7328
+ dot: "bg-[var(--graphic-1)]",
7329
+ text: "text-[var(--on-graphic-1-container)]",
7330
+ time: "text-[var(--on-graphic-1-container)]"
7310
7331
  },
7311
7332
  green: {
7312
- chip: "bg-[var(--utility-green-50,#f0fdf4)] ring-[var(--utility-green-200,#bbf7d0)] hover:bg-[var(--utility-green-100,#dcfce7)]",
7313
- dot: "bg-[var(--utility-green-500,#22c55e)]",
7314
- text: "text-[var(--utility-green-700,#15803d)]",
7315
- time: "text-[var(--utility-green-600,#16a34a)]"
7333
+ chip: "bg-[var(--graphic-2-container)] ring-[var(--graphic-2)] hover:bg-[var(--graphic-2-container)]",
7334
+ dot: "bg-[var(--graphic-2)]",
7335
+ text: "text-[var(--on-graphic-2-container)]",
7336
+ time: "text-[var(--on-graphic-2-container)]"
7316
7337
  },
7317
7338
  purple: {
7318
- chip: "bg-[var(--utility-purple-50,#faf5ff)] ring-[var(--utility-purple-200,#e9d5ff)] hover:bg-[var(--utility-purple-100,#f3e8ff)]",
7319
- dot: "bg-[var(--utility-purple-500,#a855f7)]",
7320
- text: "text-[var(--utility-purple-700,#7e22ce)]",
7321
- time: "text-[var(--utility-purple-600,#9333ea)]"
7339
+ chip: "bg-[var(--graphic-3-container)] ring-[var(--graphic-3)] hover:bg-[var(--graphic-3-container)]",
7340
+ dot: "bg-[var(--graphic-3)]",
7341
+ text: "text-[var(--on-graphic-3-container)]",
7342
+ time: "text-[var(--on-graphic-3-container)]"
7322
7343
  },
7323
7344
  orange: {
7324
- chip: "bg-[var(--utility-orange-50,#fff7ed)] ring-[var(--utility-orange-200,#fed7aa)] hover:bg-[var(--utility-orange-100,#ffedd5)]",
7325
- dot: "bg-[var(--utility-orange-500,#f97316)]",
7326
- text: "text-[var(--utility-orange-700,#c2410c)]",
7327
- time: "text-[var(--utility-orange-600,#ea580c)]"
7345
+ chip: "bg-[var(--graphic-4-container)] ring-[var(--graphic-4)] hover:bg-[var(--graphic-4-container)]",
7346
+ dot: "bg-[var(--graphic-4)]",
7347
+ text: "text-[var(--on-graphic-4-container)]",
7348
+ time: "text-[var(--on-graphic-4-container)]"
7328
7349
  },
7329
7350
  pink: {
7330
- chip: "bg-[var(--utility-pink-50,#fdf2f8)] ring-[var(--utility-pink-200,#fbcfe8)] hover:bg-[var(--utility-pink-100,#fce7f3)]",
7331
- dot: "bg-[var(--utility-pink-500,#ec4899)]",
7332
- text: "text-[var(--utility-pink-700,#be185d)]",
7333
- time: "text-[var(--utility-pink-600,#db2777)]"
7351
+ chip: "bg-[var(--graphic-5-container)] ring-[var(--graphic-5)] hover:bg-[var(--graphic-5-container)]",
7352
+ dot: "bg-[var(--graphic-5)]",
7353
+ text: "text-[var(--on-graphic-5-container)]",
7354
+ time: "text-[var(--on-graphic-5-container)]"
7334
7355
  },
7335
7356
  red: {
7336
- chip: "bg-[var(--utility-red-50,#fef2f2)] ring-[var(--utility-red-200,#fecaca)] hover:bg-[var(--utility-red-100,#fee2e2)]",
7337
- dot: "bg-[var(--utility-red-500,#ef4444)]",
7338
- text: "text-[var(--utility-red-700,#b91c1c)]",
7339
- time: "text-[var(--utility-red-600,#dc2626)]"
7357
+ chip: "bg-[var(--graphic-6-container)] ring-[var(--graphic-6)] hover:bg-[var(--graphic-6-container)]",
7358
+ dot: "bg-[var(--graphic-6)]",
7359
+ text: "text-[var(--on-graphic-6-container)]",
7360
+ time: "text-[var(--on-graphic-6-container)]"
7340
7361
  },
7341
7362
  yellow: {
7342
- chip: "bg-[var(--utility-yellow-50,#fefce8)] ring-[var(--utility-yellow-200,#fef08a)] hover:bg-[var(--utility-yellow-100,#fef9c3)]",
7343
- dot: "bg-[var(--utility-yellow-500,#eab308)]",
7344
- text: "text-[var(--utility-yellow-700,#a16207)]",
7345
- time: "text-[var(--utility-yellow-600,#ca8a04)]"
7363
+ chip: "bg-[var(--graphic-7-container)] ring-[var(--graphic-7)] hover:bg-[var(--graphic-7-container)]",
7364
+ dot: "bg-[var(--graphic-7)]",
7365
+ text: "text-[var(--on-graphic-7-container)]",
7366
+ time: "text-[var(--on-graphic-7-container)]"
7346
7367
  }
7347
7368
  };
7348
7369
  var cardColorMap = {
7349
- neutral: "bg-[var(--utility-neutral-50,#f9fafb)] ring-[var(--utility-neutral-200,#e5e7eb)] text-[var(--utility-neutral-700,#374151)]",
7350
- blue: "bg-[var(--utility-blue-50,#eff6ff)] ring-[var(--utility-blue-200,#bfdbfe)] text-[var(--utility-blue-700,#1d4ed8)]",
7351
- green: "bg-[var(--utility-green-50,#f0fdf4)] ring-[var(--utility-green-200,#bbf7d0)] text-[var(--utility-green-700,#15803d)]",
7352
- purple: "bg-[var(--utility-purple-50,#faf5ff)] ring-[var(--utility-purple-200,#e9d5ff)] text-[var(--utility-purple-700,#7e22ce)]",
7353
- orange: "bg-[var(--utility-orange-50,#fff7ed)] ring-[var(--utility-orange-200,#fed7aa)] text-[var(--utility-orange-700,#c2410c)]",
7354
- pink: "bg-[var(--utility-pink-50,#fdf2f8)] ring-[var(--utility-pink-200,#fbcfe8)] text-[var(--utility-pink-700,#be185d)]",
7355
- red: "bg-[var(--utility-red-50,#fef2f2)] ring-[var(--utility-red-200,#fecaca)] text-[var(--utility-red-700,#b91c1c)]",
7356
- yellow: "bg-[var(--utility-yellow-50,#fefce8)] ring-[var(--utility-yellow-200,#fef08a)] text-[var(--utility-yellow-700,#a16207)]"
7370
+ neutral: "bg-[var(--surface-container-low)] ring-[var(--outline-variant)] text-[var(--on-surface)]",
7371
+ blue: "bg-[var(--graphic-1-container)] ring-[var(--graphic-1)] text-[var(--on-graphic-1-container)]",
7372
+ green: "bg-[var(--graphic-2-container)] ring-[var(--graphic-2)] text-[var(--on-graphic-2-container)]",
7373
+ purple: "bg-[var(--graphic-3-container)] ring-[var(--graphic-3)] text-[var(--on-graphic-3-container)]",
7374
+ orange: "bg-[var(--graphic-4-container)] ring-[var(--graphic-4)] text-[var(--on-graphic-4-container)]",
7375
+ pink: "bg-[var(--graphic-5-container)] ring-[var(--graphic-5)] text-[var(--on-graphic-5-container)]",
7376
+ red: "bg-[var(--graphic-6-container)] ring-[var(--graphic-6)] text-[var(--on-graphic-6-container)]",
7377
+ yellow: "bg-[var(--graphic-7-container)] ring-[var(--graphic-7)] text-[var(--on-graphic-7-container)]"
7357
7378
  };
7358
7379
  function EventChip({
7359
7380
  event,
@@ -7423,7 +7444,7 @@ function MonthView({
7423
7444
  onEventClick
7424
7445
  }) {
7425
7446
  const cells = useMemo(() => getMonthCells(year, month), [year, month]);
7426
- const eventsForDay = useCallback4(
7447
+ const eventsForDay = useCallback5(
7427
7448
  (date) => events.filter((e) => isSameDay2(e.date, date)).sort((a, b) => {
7428
7449
  return timeToMinutes(a.startTime) - timeToMinutes(b.startTime);
7429
7450
  }),
@@ -7588,7 +7609,7 @@ function WeekView({
7588
7609
  () => days.findIndex((d) => isToday2(d)),
7589
7610
  [days]
7590
7611
  );
7591
- const eventsForDay = useCallback4(
7612
+ const eventsForDay = useCallback5(
7592
7613
  (date) => events.filter((e) => isSameDay2(e.date, date)).sort(
7593
7614
  (a, b) => timeToMinutes(a.startTime) - timeToMinutes(b.startTime)
7594
7615
  ),
@@ -7681,11 +7702,13 @@ function WeekView({
7681
7702
  const top = startMins / 60 * CELL_HEIGHT;
7682
7703
  const height = durationMins / 60 * CELL_HEIGHT;
7683
7704
  const c = cardColorMap[(_a = ev.color) != null ? _a : "neutral"];
7684
- return /* @__PURE__ */ jsxs38(
7705
+ const isCompact = durationMins <= 30;
7706
+ return /* @__PURE__ */ jsx42(
7685
7707
  "div",
7686
7708
  {
7687
7709
  className: cn(
7688
- "absolute pointer-events-auto z-10 rounded-md px-2 py-1 ring-1 ring-inset cursor-pointer overflow-hidden",
7710
+ "absolute pointer-events-auto z-10 rounded-md ring-1 ring-inset cursor-pointer overflow-hidden",
7711
+ isCompact ? "px-2 py-0.5" : "px-2 py-1",
7689
7712
  c
7690
7713
  ),
7691
7714
  style: {
@@ -7698,13 +7721,19 @@ function WeekView({
7698
7721
  e.stopPropagation();
7699
7722
  onEventClick == null ? void 0 : onEventClick(ev);
7700
7723
  },
7701
- children: [
7724
+ children: isCompact ? /* @__PURE__ */ jsxs38("p", { className: "text-xs font-semibold truncate leading-tight", children: [
7725
+ ev.title,
7726
+ /* @__PURE__ */ jsxs38("span", { className: "font-normal opacity-75", children: [
7727
+ " \xB7 ",
7728
+ formatTime12(ev.startTime)
7729
+ ] })
7730
+ ] }) : /* @__PURE__ */ jsxs38(Fragment6, { children: [
7702
7731
  /* @__PURE__ */ jsx42("p", { className: "text-xs font-semibold truncate", children: ev.title }),
7703
7732
  /* @__PURE__ */ jsxs38("p", { className: "text-xs opacity-75", children: [
7704
7733
  formatTime12(ev.startTime),
7705
7734
  ev.endTime && ` \u2013 ${formatTime12(ev.endTime)}`
7706
7735
  ] })
7707
- ]
7736
+ ] })
7708
7737
  },
7709
7738
  ev.id
7710
7739
  );
@@ -7811,7 +7840,7 @@ function DayView({
7811
7840
  const now = /* @__PURE__ */ new Date();
7812
7841
  return now.getHours() * 60 + now.getMinutes();
7813
7842
  }, [date]);
7814
- const hasEvents = useCallback4(
7843
+ const hasEvents = useCallback5(
7815
7844
  (d) => events.some((e) => isSameDay2(e.date, d)),
7816
7845
  [events]
7817
7846
  );
@@ -8052,41 +8081,60 @@ function ViewDropdown({
8052
8081
  onViewChange
8053
8082
  }) {
8054
8083
  const [open, setOpen] = useState8(false);
8084
+ const [dropdownStyle, setDropdownStyle] = useState8({});
8085
+ const wrapperRef = useRef6(null);
8055
8086
  const labels = {
8056
8087
  month: "Month view",
8057
8088
  week: "Week view",
8058
8089
  day: "Day view"
8059
8090
  };
8060
- return /* @__PURE__ */ jsxs38("div", { className: "relative", children: [
8091
+ const handleToggle = () => {
8092
+ if (!open && wrapperRef.current) {
8093
+ const rect = wrapperRef.current.getBoundingClientRect();
8094
+ setDropdownStyle({
8095
+ top: rect.bottom + 4,
8096
+ right: window.innerWidth - rect.right
8097
+ });
8098
+ }
8099
+ setOpen((o) => !o);
8100
+ };
8101
+ return /* @__PURE__ */ jsxs38("div", { className: "relative", ref: wrapperRef, children: [
8061
8102
  /* @__PURE__ */ jsx42(
8062
8103
  Button,
8063
8104
  {
8064
8105
  variant: "bordered",
8065
8106
  size: "sm",
8066
8107
  endContent: /* @__PURE__ */ jsx42(ChevronDown2, { size: 14 }),
8067
- onClick: () => setOpen((o) => !o),
8108
+ onClick: handleToggle,
8068
8109
  "aria-haspopup": "true",
8069
8110
  "aria-expanded": open,
8070
8111
  children: labels[view]
8071
8112
  }
8072
8113
  ),
8073
8114
  open && /* @__PURE__ */ jsxs38(Fragment6, { children: [
8074
- /* @__PURE__ */ jsx42("div", { className: "fixed inset-0 z-20", onClick: () => setOpen(false) }),
8075
- /* @__PURE__ */ jsx42("div", { className: "absolute right-0 top-full z-30 mt-1 w-40 overflow-hidden rounded-lg border border-[var(--outline-variant)] bg-[var(--surface)] shadow-lg", children: ["month", "week", "day"].map((v) => /* @__PURE__ */ jsx42(
8076
- "button",
8115
+ /* @__PURE__ */ jsx42("div", { className: "fixed inset-0 z-40", onClick: () => setOpen(false) }),
8116
+ /* @__PURE__ */ jsx42(
8117
+ "div",
8077
8118
  {
8078
- className: cn(
8079
- "flex w-full items-center px-3 py-2 text-sm font-medium transition-colors",
8080
- 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)]"
8081
- ),
8082
- onClick: () => {
8083
- onViewChange(v);
8084
- setOpen(false);
8085
- },
8086
- children: labels[v]
8087
- },
8088
- v
8089
- )) })
8119
+ className: "fixed z-50 w-40 overflow-hidden rounded-lg border border-[var(--outline-variant)] bg-[var(--surface)] shadow-lg",
8120
+ style: dropdownStyle,
8121
+ children: ["month", "week", "day"].map((v) => /* @__PURE__ */ jsx42(
8122
+ "button",
8123
+ {
8124
+ className: cn(
8125
+ "flex w-full items-center px-3 py-2 text-sm font-medium transition-colors",
8126
+ 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)]"
8127
+ ),
8128
+ onClick: () => {
8129
+ onViewChange(v);
8130
+ setOpen(false);
8131
+ },
8132
+ children: labels[v]
8133
+ },
8134
+ v
8135
+ ))
8136
+ }
8137
+ )
8090
8138
  ] })
8091
8139
  ] });
8092
8140
  }
@@ -8210,35 +8258,35 @@ function Calendar2({
8210
8258
  const view = controlledView != null ? controlledView : internalView;
8211
8259
  const [internalDate, setInternalDate] = useState8(defaultDate != null ? defaultDate : today);
8212
8260
  const date = controlledDate != null ? controlledDate : internalDate;
8213
- const handleViewChange = useCallback4(
8261
+ const handleViewChange = useCallback5(
8214
8262
  (v) => {
8215
8263
  setInternalView(v);
8216
8264
  onViewChange == null ? void 0 : onViewChange(v);
8217
8265
  },
8218
8266
  [onViewChange]
8219
8267
  );
8220
- const handleDateChange = useCallback4(
8268
+ const handleDateChange = useCallback5(
8221
8269
  (d) => {
8222
8270
  setInternalDate(d);
8223
8271
  onDateChange == null ? void 0 : onDateChange(d);
8224
8272
  },
8225
8273
  [onDateChange]
8226
8274
  );
8227
- const handlePrev = useCallback4(() => {
8275
+ const handlePrev = useCallback5(() => {
8228
8276
  const d = new Date(date);
8229
8277
  if (view === "month") d.setMonth(d.getMonth() - 1);
8230
8278
  else if (view === "week") d.setDate(d.getDate() - 7);
8231
8279
  else d.setDate(d.getDate() - 1);
8232
8280
  handleDateChange(d);
8233
8281
  }, [date, view, handleDateChange]);
8234
- const handleNext = useCallback4(() => {
8282
+ const handleNext = useCallback5(() => {
8235
8283
  const d = new Date(date);
8236
8284
  if (view === "month") d.setMonth(d.getMonth() + 1);
8237
8285
  else if (view === "week") d.setDate(d.getDate() + 7);
8238
8286
  else d.setDate(d.getDate() + 1);
8239
8287
  handleDateChange(d);
8240
8288
  }, [date, view, handleDateChange]);
8241
- const handleToday = useCallback4(() => {
8289
+ const handleToday = useCallback5(() => {
8242
8290
  handleDateChange(/* @__PURE__ */ new Date());
8243
8291
  }, [handleDateChange]);
8244
8292
  return /* @__PURE__ */ jsxs38(
@@ -8382,7 +8430,7 @@ function FileTypeIcon({ name, variant = "outline" }) {
8382
8430
  }
8383
8431
 
8384
8432
  // ../../app/ui-kit/pixelplay-ui/shared/ui/file-upload/FileUpload.tsx
8385
- import { useId as useId7, useRef as useRef6, useState as useState9 } from "react";
8433
+ import { useId as useId7, useRef as useRef7, useState as useState9 } from "react";
8386
8434
  import { UploadCloud, X as X4, CheckCircle as CheckCircle3, XCircle, RotateCcw } from "react-feather";
8387
8435
  import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
8388
8436
  function FileRow({
@@ -8662,9 +8710,9 @@ function FileUpload({
8662
8710
  className
8663
8711
  }) {
8664
8712
  const inputId = useId7();
8665
- const containerRef = useRef6(null);
8713
+ const containerRef = useRef7(null);
8666
8714
  const [isDragging, setIsDragging] = useState9(false);
8667
- const dragCounter = useRef6(0);
8715
+ const dragCounter = useRef7(0);
8668
8716
  function handleDragEnter(e) {
8669
8717
  e.preventDefault();
8670
8718
  dragCounter.current++;