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/CHANGELOG.md +200 -61
- package/README.md +91 -91
- package/dist/index.js +116 -68
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +138 -90
- 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.js
CHANGED
|
@@ -956,10 +956,10 @@ var SIZE_MAP = {
|
|
|
956
956
|
checkbox: "h-3.5 w-3.5"
|
|
957
957
|
},
|
|
958
958
|
lg: {
|
|
959
|
-
outer: "gap-2 rounded-
|
|
960
|
-
text: "text-
|
|
959
|
+
outer: "gap-2 rounded-lg px-3.5 py-1.5",
|
|
960
|
+
text: "text-base font-medium leading-6",
|
|
961
961
|
iconWrapper: "h-5 w-5",
|
|
962
|
-
dot: "h-2 w-2",
|
|
962
|
+
dot: "h-2.5 w-2.5",
|
|
963
963
|
dismissSize: 14,
|
|
964
964
|
checkbox: "h-4 w-4"
|
|
965
965
|
}
|
|
@@ -1051,7 +1051,7 @@ var Card = import_react5.default.forwardRef(
|
|
|
1051
1051
|
className,
|
|
1052
1052
|
isPressable = false,
|
|
1053
1053
|
isBlurred = false,
|
|
1054
|
-
shadow = "
|
|
1054
|
+
shadow = "xs",
|
|
1055
1055
|
radius = "lg",
|
|
1056
1056
|
fullWidth = false,
|
|
1057
1057
|
onClick
|
|
@@ -1989,6 +1989,7 @@ function Select({
|
|
|
1989
1989
|
}) {
|
|
1990
1990
|
const [open, setOpen] = (0, import_react12.useState)(false);
|
|
1991
1991
|
const [search, setSearch] = (0, import_react12.useState)("");
|
|
1992
|
+
const [openAbove, setOpenAbove] = (0, import_react12.useState)(false);
|
|
1992
1993
|
const containerRef = (0, import_react12.useRef)(null);
|
|
1993
1994
|
(0, import_react12.useEffect)(() => {
|
|
1994
1995
|
function onOutsideClick(e) {
|
|
@@ -2000,6 +2001,21 @@ function Select({
|
|
|
2000
2001
|
document.addEventListener("mousedown", onOutsideClick);
|
|
2001
2002
|
return () => document.removeEventListener("mousedown", onOutsideClick);
|
|
2002
2003
|
}, []);
|
|
2004
|
+
const computeOpenAbove = (0, import_react12.useCallback)(() => {
|
|
2005
|
+
if (!containerRef.current) return false;
|
|
2006
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
2007
|
+
const spaceBelow = window.innerHeight - rect.bottom;
|
|
2008
|
+
const panelHeight = 280;
|
|
2009
|
+
return spaceBelow < panelHeight && rect.top > spaceBelow;
|
|
2010
|
+
}, []);
|
|
2011
|
+
const toggleOpen = (0, import_react12.useCallback)(() => {
|
|
2012
|
+
setOpen((prev) => {
|
|
2013
|
+
if (!prev) {
|
|
2014
|
+
setOpenAbove(computeOpenAbove());
|
|
2015
|
+
}
|
|
2016
|
+
return !prev;
|
|
2017
|
+
});
|
|
2018
|
+
}, [computeOpenAbove]);
|
|
2003
2019
|
const selectedOption = options.find((o) => o.value === value);
|
|
2004
2020
|
const filtered = isSearchable ? options.filter(
|
|
2005
2021
|
(o) => o.label.toLowerCase().includes(search.toLowerCase())
|
|
@@ -2019,7 +2035,7 @@ function Select({
|
|
|
2019
2035
|
{
|
|
2020
2036
|
type: "button",
|
|
2021
2037
|
disabled: isDisabled,
|
|
2022
|
-
onClick: () => !isDisabled &&
|
|
2038
|
+
onClick: () => !isDisabled && toggleOpen(),
|
|
2023
2039
|
className: cn(
|
|
2024
2040
|
"flex w-full items-center rounded-lg border transition-all",
|
|
2025
2041
|
"bg-[var(--surface-container-lowest)] border-[var(--outline)]",
|
|
@@ -2055,7 +2071,8 @@ function Select({
|
|
|
2055
2071
|
"div",
|
|
2056
2072
|
{
|
|
2057
2073
|
className: cn(
|
|
2058
|
-
"absolute left-0
|
|
2074
|
+
"absolute left-0 z-50 w-full overflow-hidden rounded-lg",
|
|
2075
|
+
openAbove ? "bottom-full mb-1" : "top-full mt-1",
|
|
2059
2076
|
"bg-[var(--surface-container-lowest)]",
|
|
2060
2077
|
"shadow-[0px_4px_6px_-2px_rgba(10,13,18,0.05),0px_12px_16px_-4px_rgba(10,13,18,0.10)]",
|
|
2061
2078
|
"outline outline-1 outline-offset-[-1px] outline-[var(--outline)]"
|
|
@@ -2171,6 +2188,7 @@ function Toggle({
|
|
|
2171
2188
|
!isChecked && !isDisabled && "hover:bg-[var(--surface-container-high)]",
|
|
2172
2189
|
"focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[var(--primary-container)]",
|
|
2173
2190
|
isDisabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
2191
|
+
size === "sm" ? "before:content-[''] before:absolute before:-inset-[10px]" : "before:content-[''] before:absolute before:-inset-3",
|
|
2174
2192
|
!label && !description && className
|
|
2175
2193
|
),
|
|
2176
2194
|
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
@@ -2346,7 +2364,10 @@ function Checkbox({
|
|
|
2346
2364
|
onChange: handleChange,
|
|
2347
2365
|
disabled: isDisabled,
|
|
2348
2366
|
"aria-checked": indeterminate ? "mixed" : isChecked,
|
|
2349
|
-
className:
|
|
2367
|
+
className: cn(
|
|
2368
|
+
"peer absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 cursor-pointer opacity-0 disabled:cursor-not-allowed",
|
|
2369
|
+
size === "sm" ? "min-h-10 min-w-10" : "min-h-12 min-w-12"
|
|
2370
|
+
)
|
|
2350
2371
|
}
|
|
2351
2372
|
),
|
|
2352
2373
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -7332,63 +7353,63 @@ function getHourLabels() {
|
|
|
7332
7353
|
var HOUR_LABELS = getHourLabels();
|
|
7333
7354
|
var colorMap3 = {
|
|
7334
7355
|
neutral: {
|
|
7335
|
-
chip: "bg-[var(--
|
|
7336
|
-
dot: "bg-[var(--
|
|
7337
|
-
text: "text-[var(--
|
|
7338
|
-
time: "text-[var(--
|
|
7356
|
+
chip: "bg-[var(--surface-container-low)] ring-[var(--outline-variant)] hover:bg-[var(--surface-container)]",
|
|
7357
|
+
dot: "bg-[var(--on-surface-variant)]",
|
|
7358
|
+
text: "text-[var(--on-surface)]",
|
|
7359
|
+
time: "text-[var(--on-surface-variant)]"
|
|
7339
7360
|
},
|
|
7340
7361
|
blue: {
|
|
7341
|
-
chip: "bg-[var(--
|
|
7342
|
-
dot: "bg-[var(--
|
|
7343
|
-
text: "text-[var(--
|
|
7344
|
-
time: "text-[var(--
|
|
7362
|
+
chip: "bg-[var(--graphic-1-container)] ring-[var(--graphic-1)] hover:bg-[var(--graphic-1-container)]",
|
|
7363
|
+
dot: "bg-[var(--graphic-1)]",
|
|
7364
|
+
text: "text-[var(--on-graphic-1-container)]",
|
|
7365
|
+
time: "text-[var(--on-graphic-1-container)]"
|
|
7345
7366
|
},
|
|
7346
7367
|
green: {
|
|
7347
|
-
chip: "bg-[var(--
|
|
7348
|
-
dot: "bg-[var(--
|
|
7349
|
-
text: "text-[var(--
|
|
7350
|
-
time: "text-[var(--
|
|
7368
|
+
chip: "bg-[var(--graphic-2-container)] ring-[var(--graphic-2)] hover:bg-[var(--graphic-2-container)]",
|
|
7369
|
+
dot: "bg-[var(--graphic-2)]",
|
|
7370
|
+
text: "text-[var(--on-graphic-2-container)]",
|
|
7371
|
+
time: "text-[var(--on-graphic-2-container)]"
|
|
7351
7372
|
},
|
|
7352
7373
|
purple: {
|
|
7353
|
-
chip: "bg-[var(--
|
|
7354
|
-
dot: "bg-[var(--
|
|
7355
|
-
text: "text-[var(--
|
|
7356
|
-
time: "text-[var(--
|
|
7374
|
+
chip: "bg-[var(--graphic-3-container)] ring-[var(--graphic-3)] hover:bg-[var(--graphic-3-container)]",
|
|
7375
|
+
dot: "bg-[var(--graphic-3)]",
|
|
7376
|
+
text: "text-[var(--on-graphic-3-container)]",
|
|
7377
|
+
time: "text-[var(--on-graphic-3-container)]"
|
|
7357
7378
|
},
|
|
7358
7379
|
orange: {
|
|
7359
|
-
chip: "bg-[var(--
|
|
7360
|
-
dot: "bg-[var(--
|
|
7361
|
-
text: "text-[var(--
|
|
7362
|
-
time: "text-[var(--
|
|
7380
|
+
chip: "bg-[var(--graphic-4-container)] ring-[var(--graphic-4)] hover:bg-[var(--graphic-4-container)]",
|
|
7381
|
+
dot: "bg-[var(--graphic-4)]",
|
|
7382
|
+
text: "text-[var(--on-graphic-4-container)]",
|
|
7383
|
+
time: "text-[var(--on-graphic-4-container)]"
|
|
7363
7384
|
},
|
|
7364
7385
|
pink: {
|
|
7365
|
-
chip: "bg-[var(--
|
|
7366
|
-
dot: "bg-[var(--
|
|
7367
|
-
text: "text-[var(--
|
|
7368
|
-
time: "text-[var(--
|
|
7386
|
+
chip: "bg-[var(--graphic-5-container)] ring-[var(--graphic-5)] hover:bg-[var(--graphic-5-container)]",
|
|
7387
|
+
dot: "bg-[var(--graphic-5)]",
|
|
7388
|
+
text: "text-[var(--on-graphic-5-container)]",
|
|
7389
|
+
time: "text-[var(--on-graphic-5-container)]"
|
|
7369
7390
|
},
|
|
7370
7391
|
red: {
|
|
7371
|
-
chip: "bg-[var(--
|
|
7372
|
-
dot: "bg-[var(--
|
|
7373
|
-
text: "text-[var(--
|
|
7374
|
-
time: "text-[var(--
|
|
7392
|
+
chip: "bg-[var(--graphic-6-container)] ring-[var(--graphic-6)] hover:bg-[var(--graphic-6-container)]",
|
|
7393
|
+
dot: "bg-[var(--graphic-6)]",
|
|
7394
|
+
text: "text-[var(--on-graphic-6-container)]",
|
|
7395
|
+
time: "text-[var(--on-graphic-6-container)]"
|
|
7375
7396
|
},
|
|
7376
7397
|
yellow: {
|
|
7377
|
-
chip: "bg-[var(--
|
|
7378
|
-
dot: "bg-[var(--
|
|
7379
|
-
text: "text-[var(--
|
|
7380
|
-
time: "text-[var(--
|
|
7398
|
+
chip: "bg-[var(--graphic-7-container)] ring-[var(--graphic-7)] hover:bg-[var(--graphic-7-container)]",
|
|
7399
|
+
dot: "bg-[var(--graphic-7)]",
|
|
7400
|
+
text: "text-[var(--on-graphic-7-container)]",
|
|
7401
|
+
time: "text-[var(--on-graphic-7-container)]"
|
|
7381
7402
|
}
|
|
7382
7403
|
};
|
|
7383
7404
|
var cardColorMap = {
|
|
7384
|
-
neutral: "bg-[var(--
|
|
7385
|
-
blue: "bg-[var(--
|
|
7386
|
-
green: "bg-[var(--
|
|
7387
|
-
purple: "bg-[var(--
|
|
7388
|
-
orange: "bg-[var(--
|
|
7389
|
-
pink: "bg-[var(--
|
|
7390
|
-
red: "bg-[var(--
|
|
7391
|
-
yellow: "bg-[var(--
|
|
7405
|
+
neutral: "bg-[var(--surface-container-low)] ring-[var(--outline-variant)] text-[var(--on-surface)]",
|
|
7406
|
+
blue: "bg-[var(--graphic-1-container)] ring-[var(--graphic-1)] text-[var(--on-graphic-1-container)]",
|
|
7407
|
+
green: "bg-[var(--graphic-2-container)] ring-[var(--graphic-2)] text-[var(--on-graphic-2-container)]",
|
|
7408
|
+
purple: "bg-[var(--graphic-3-container)] ring-[var(--graphic-3)] text-[var(--on-graphic-3-container)]",
|
|
7409
|
+
orange: "bg-[var(--graphic-4-container)] ring-[var(--graphic-4)] text-[var(--on-graphic-4-container)]",
|
|
7410
|
+
pink: "bg-[var(--graphic-5-container)] ring-[var(--graphic-5)] text-[var(--on-graphic-5-container)]",
|
|
7411
|
+
red: "bg-[var(--graphic-6-container)] ring-[var(--graphic-6)] text-[var(--on-graphic-6-container)]",
|
|
7412
|
+
yellow: "bg-[var(--graphic-7-container)] ring-[var(--graphic-7)] text-[var(--on-graphic-7-container)]"
|
|
7392
7413
|
};
|
|
7393
7414
|
function EventChip({
|
|
7394
7415
|
event,
|
|
@@ -7716,11 +7737,13 @@ function WeekView({
|
|
|
7716
7737
|
const top = startMins / 60 * CELL_HEIGHT;
|
|
7717
7738
|
const height = durationMins / 60 * CELL_HEIGHT;
|
|
7718
7739
|
const c = cardColorMap[(_a = ev.color) != null ? _a : "neutral"];
|
|
7719
|
-
|
|
7740
|
+
const isCompact = durationMins <= 30;
|
|
7741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7720
7742
|
"div",
|
|
7721
7743
|
{
|
|
7722
7744
|
className: cn(
|
|
7723
|
-
"absolute pointer-events-auto z-10 rounded-md
|
|
7745
|
+
"absolute pointer-events-auto z-10 rounded-md ring-1 ring-inset cursor-pointer overflow-hidden",
|
|
7746
|
+
isCompact ? "px-2 py-0.5" : "px-2 py-1",
|
|
7724
7747
|
c
|
|
7725
7748
|
),
|
|
7726
7749
|
style: {
|
|
@@ -7733,13 +7756,19 @@ function WeekView({
|
|
|
7733
7756
|
e.stopPropagation();
|
|
7734
7757
|
onEventClick == null ? void 0 : onEventClick(ev);
|
|
7735
7758
|
},
|
|
7736
|
-
children: [
|
|
7759
|
+
children: isCompact ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("p", { className: "text-xs font-semibold truncate leading-tight", children: [
|
|
7760
|
+
ev.title,
|
|
7761
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "font-normal opacity-75", children: [
|
|
7762
|
+
" \xB7 ",
|
|
7763
|
+
formatTime12(ev.startTime)
|
|
7764
|
+
] })
|
|
7765
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
7737
7766
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xs font-semibold truncate", children: ev.title }),
|
|
7738
7767
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("p", { className: "text-xs opacity-75", children: [
|
|
7739
7768
|
formatTime12(ev.startTime),
|
|
7740
7769
|
ev.endTime && ` \u2013 ${formatTime12(ev.endTime)}`
|
|
7741
7770
|
] })
|
|
7742
|
-
]
|
|
7771
|
+
] })
|
|
7743
7772
|
},
|
|
7744
7773
|
ev.id
|
|
7745
7774
|
);
|
|
@@ -8087,41 +8116,60 @@ function ViewDropdown({
|
|
|
8087
8116
|
onViewChange
|
|
8088
8117
|
}) {
|
|
8089
8118
|
const [open, setOpen] = (0, import_react31.useState)(false);
|
|
8119
|
+
const [dropdownStyle, setDropdownStyle] = (0, import_react31.useState)({});
|
|
8120
|
+
const wrapperRef = (0, import_react31.useRef)(null);
|
|
8090
8121
|
const labels = {
|
|
8091
8122
|
month: "Month view",
|
|
8092
8123
|
week: "Week view",
|
|
8093
8124
|
day: "Day view"
|
|
8094
8125
|
};
|
|
8095
|
-
|
|
8126
|
+
const handleToggle = () => {
|
|
8127
|
+
if (!open && wrapperRef.current) {
|
|
8128
|
+
const rect = wrapperRef.current.getBoundingClientRect();
|
|
8129
|
+
setDropdownStyle({
|
|
8130
|
+
top: rect.bottom + 4,
|
|
8131
|
+
right: window.innerWidth - rect.right
|
|
8132
|
+
});
|
|
8133
|
+
}
|
|
8134
|
+
setOpen((o) => !o);
|
|
8135
|
+
};
|
|
8136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "relative", ref: wrapperRef, children: [
|
|
8096
8137
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8097
8138
|
Button,
|
|
8098
8139
|
{
|
|
8099
8140
|
variant: "bordered",
|
|
8100
8141
|
size: "sm",
|
|
8101
8142
|
endContent: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react_feather14.ChevronDown, { size: 14 }),
|
|
8102
|
-
onClick:
|
|
8143
|
+
onClick: handleToggle,
|
|
8103
8144
|
"aria-haspopup": "true",
|
|
8104
8145
|
"aria-expanded": open,
|
|
8105
8146
|
children: labels[view]
|
|
8106
8147
|
}
|
|
8107
8148
|
),
|
|
8108
8149
|
open && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
8109
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "fixed inset-0 z-
|
|
8110
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8111
|
-
"
|
|
8150
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "fixed inset-0 z-40", onClick: () => setOpen(false) }),
|
|
8151
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8152
|
+
"div",
|
|
8112
8153
|
{
|
|
8113
|
-
className:
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8154
|
+
className: "fixed z-50 w-40 overflow-hidden rounded-lg border border-[var(--outline-variant)] bg-[var(--surface)] shadow-lg",
|
|
8155
|
+
style: dropdownStyle,
|
|
8156
|
+
children: ["month", "week", "day"].map((v) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8157
|
+
"button",
|
|
8158
|
+
{
|
|
8159
|
+
className: cn(
|
|
8160
|
+
"flex w-full items-center px-3 py-2 text-sm font-medium transition-colors",
|
|
8161
|
+
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)]"
|
|
8162
|
+
),
|
|
8163
|
+
onClick: () => {
|
|
8164
|
+
onViewChange(v);
|
|
8165
|
+
setOpen(false);
|
|
8166
|
+
},
|
|
8167
|
+
children: labels[v]
|
|
8168
|
+
},
|
|
8169
|
+
v
|
|
8170
|
+
))
|
|
8171
|
+
}
|
|
8172
|
+
)
|
|
8125
8173
|
] })
|
|
8126
8174
|
] });
|
|
8127
8175
|
}
|