gridsmith-ui 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-6TMNEBBJ.js +140 -0
- package/dist/chunk-6TMNEBBJ.js.map +1 -0
- package/dist/feather-432JQGUB.js +72 -0
- package/dist/feather-432JQGUB.js.map +1 -0
- package/dist/heroicons-CCKJHFZY.js +72 -0
- package/dist/heroicons-CCKJHFZY.js.map +1 -0
- package/dist/icons.d.ts +9 -1
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +12 -5
- package/dist/index.js +782 -379
- package/dist/index.js.map +1 -1
- package/dist/lucide-Z74WVRAK.js +72 -0
- package/dist/lucide-Z74WVRAK.js.map +1 -0
- package/dist/phosphor-DYUCR5S2.js +72 -0
- package/dist/phosphor-DYUCR5S2.js.map +1 -0
- package/dist/tabler-GRXDPAHR.js +72 -0
- package/dist/tabler-GRXDPAHR.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-WVB3SRXW.js +0 -82
- package/dist/chunk-WVB3SRXW.js.map +0 -1
- package/dist/feather-N37QZ7LA.js +0 -72
- package/dist/feather-N37QZ7LA.js.map +0 -1
- package/dist/heroicons-HJTKMLIJ.js +0 -72
- package/dist/heroicons-HJTKMLIJ.js.map +0 -1
- package/dist/lucide-6TGT4G26.js +0 -67
- package/dist/lucide-6TGT4G26.js.map +0 -1
- package/dist/phosphor-BWDP4PU7.js +0 -72
- package/dist/phosphor-BWDP4PU7.js.map +0 -1
- package/dist/tabler-6TPNTLFV.js +0 -72
- package/dist/tabler-6TPNTLFV.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn, GLASS_BACKDROP, GLASS_DROPDOWN, lockBodyScroll, unlockBodyScroll, GLASS_OVERLAY, GLASS_SURFACE } from './chunk-5XIPPVH7.js';
|
|
2
|
-
import { Icon } from './chunk-
|
|
2
|
+
import { Icon } from './chunk-6TMNEBBJ.js';
|
|
3
3
|
import { __commonJS, __toESM } from './chunk-5WRI5ZAA.js';
|
|
4
4
|
import * as React6 from 'react';
|
|
5
5
|
import React6__default, { createContext, forwardRef, useState, useCallback, useRef, useContext, useId, useMemo, useEffect, useLayoutEffect, isValidElement, cloneElement, createElement, Fragment as Fragment$1, useDebugValue, memo, useReducer, useSyncExternalStore as useSyncExternalStore$1, useImperativeHandle } from 'react';
|
|
@@ -1909,7 +1909,7 @@ function DropdownMenu({ trigger, items, align = "end", className, container }) {
|
|
|
1909
1909
|
"flex items-center gap-ds-2 w-full text-left px-ds-3 py-ds-2 text-sm cursor-pointer",
|
|
1910
1910
|
"transition-colors rounded-[var(--ds-radius-sm)]",
|
|
1911
1911
|
"focus-visible:outline-none focus-visible:shadow-[var(--ds-shadow-focus)]",
|
|
1912
|
-
item.disabled ? "opacity-disabled cursor-not-allowed" : item.variant === "destructive" ? "text-[var(--ds-status-error)] hover:bg-[var(--ds-status-error-bg)] focus-visible:bg-[var(--ds-status-error-bg)]" : "text-[var(--ds-text-primary)] hover:bg-[var(--ds-bg-
|
|
1912
|
+
item.disabled ? "opacity-disabled cursor-not-allowed" : item.variant === "destructive" ? "text-[var(--ds-status-error)] hover:bg-[var(--ds-status-error-bg)] focus-visible:bg-[var(--ds-status-error-bg)]" : "text-[var(--ds-text-primary)] hover:bg-[var(--ds-bg-emphasis)] focus-visible:bg-[var(--ds-bg-emphasis)]"
|
|
1913
1913
|
),
|
|
1914
1914
|
children: [
|
|
1915
1915
|
item.icon && /* @__PURE__ */ jsx(Icon, { name: item.icon, size: 16, className: "shrink-0" }),
|
|
@@ -1925,8 +1925,46 @@ function DropdownMenu({ trigger, items, align = "end", className, container }) {
|
|
|
1925
1925
|
)
|
|
1926
1926
|
] });
|
|
1927
1927
|
}
|
|
1928
|
+
var DEFAULT_BREAKPOINTS = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
1929
|
+
var BreakpointWidthCtx = createContext(null);
|
|
1930
|
+
function BreakpointWidthProvider({ width, children }) {
|
|
1931
|
+
return createElement(BreakpointWidthCtx, { value: width }, children);
|
|
1932
|
+
}
|
|
1933
|
+
function readBpFromCSS(key2) {
|
|
1934
|
+
if (typeof window === "undefined") return DEFAULT_BREAKPOINTS[key2];
|
|
1935
|
+
const raw = getComputedStyle(document.documentElement).getPropertyValue(`--ds-bp-${key2}`).trim();
|
|
1936
|
+
const px = parseInt(raw, 10);
|
|
1937
|
+
return isNaN(px) ? DEFAULT_BREAKPOINTS[key2] : px;
|
|
1938
|
+
}
|
|
1939
|
+
function useBreakpoint(key2) {
|
|
1940
|
+
const overrideWidth = useContext(BreakpointWidthCtx);
|
|
1941
|
+
const px = useMemo(() => readBpFromCSS(key2), [key2]);
|
|
1942
|
+
const [matches2, setMatches] = useState(() => {
|
|
1943
|
+
if (overrideWidth !== null) return overrideWidth <= px;
|
|
1944
|
+
return typeof window !== "undefined" ? window.matchMedia(`(max-width: ${px}px)`).matches : false;
|
|
1945
|
+
});
|
|
1946
|
+
useEffect(() => {
|
|
1947
|
+
if (overrideWidth !== null) {
|
|
1948
|
+
setMatches(overrideWidth <= px);
|
|
1949
|
+
return;
|
|
1950
|
+
}
|
|
1951
|
+
const mql = window.matchMedia(`(max-width: ${px}px)`);
|
|
1952
|
+
const handler = (e) => setMatches(e.matches);
|
|
1953
|
+
mql.addEventListener("change", handler);
|
|
1954
|
+
setMatches(mql.matches);
|
|
1955
|
+
return () => mql.removeEventListener("change", handler);
|
|
1956
|
+
}, [px, overrideWidth]);
|
|
1957
|
+
return matches2;
|
|
1958
|
+
}
|
|
1928
1959
|
function BulkActionBar({ selectedCount, actions, onClearSelection, className }) {
|
|
1960
|
+
const isMobile = useBreakpoint("sm");
|
|
1929
1961
|
if (selectedCount === 0) return null;
|
|
1962
|
+
const dropdownItems = actions.map((action) => ({
|
|
1963
|
+
label: action.label,
|
|
1964
|
+
icon: action.icon,
|
|
1965
|
+
onClick: action.onClick,
|
|
1966
|
+
variant: action.variant
|
|
1967
|
+
}));
|
|
1930
1968
|
return /* @__PURE__ */ jsxs(
|
|
1931
1969
|
"div",
|
|
1932
1970
|
{
|
|
@@ -1946,7 +1984,14 @@ function BulkActionBar({ selectedCount, actions, onClearSelection, className })
|
|
|
1946
1984
|
" selected"
|
|
1947
1985
|
] }),
|
|
1948
1986
|
/* @__PURE__ */ jsx("div", { className: "h-4 w-px bg-[var(--ds-border-subtle)]" }),
|
|
1949
|
-
|
|
1987
|
+
isMobile ? /* @__PURE__ */ jsx(
|
|
1988
|
+
DropdownMenu,
|
|
1989
|
+
{
|
|
1990
|
+
trigger: /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", iconLeft: /* @__PURE__ */ jsx(Icon, { name: "more-vertical", size: 14 }), children: "Actions" }),
|
|
1991
|
+
items: dropdownItems,
|
|
1992
|
+
align: "start"
|
|
1993
|
+
}
|
|
1994
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex items-center gap-ds-2", children: actions.map((action, i) => /* @__PURE__ */ jsx(
|
|
1950
1995
|
Button,
|
|
1951
1996
|
{
|
|
1952
1997
|
variant: action.variant === "destructive" ? "destructive" : "secondary",
|
|
@@ -2368,7 +2413,7 @@ function OptionButton({
|
|
|
2368
2413
|
"w-full text-left cursor-pointer rounded-[var(--ds-radius-sm)]",
|
|
2369
2414
|
"transition-colors flex items-center gap-ds-2",
|
|
2370
2415
|
size === "sm" ? "px-ds-2 py-ds-1 text-xs" : "px-ds-2 py-ds-1.5 text-sm",
|
|
2371
|
-
isSelected && !multiple ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]" : "text-[var(--ds-text-primary)] hover:bg-[var(--ds-bg-
|
|
2416
|
+
isSelected && !multiple ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]" : "text-[var(--ds-text-primary)] hover:bg-[var(--ds-bg-emphasis)]"
|
|
2372
2417
|
),
|
|
2373
2418
|
children: [
|
|
2374
2419
|
multiple && /* @__PURE__ */ jsx(
|
|
@@ -2868,7 +2913,7 @@ function DatePicker({ value, onChange, placeholder = "Pick a date", disabled, cl
|
|
|
2868
2913
|
"w-full aspect-square flex items-center justify-center text-xs rounded-[var(--ds-radius-sm)]",
|
|
2869
2914
|
"transition-colors cursor-pointer",
|
|
2870
2915
|
"focus-visible:outline-none focus-visible:shadow-[var(--ds-shadow-focus)]",
|
|
2871
|
-
isSelected ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)] font-bold" : isToday2 ? "border-[length:var(--ds-border-width)] border-[var(--ds-accent-primary)] text-[var(--ds-accent-primary)] font-medium" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-
|
|
2916
|
+
isSelected ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)] font-bold" : isToday2 ? "border-[length:var(--ds-border-width)] border-[var(--ds-accent-primary)] text-[var(--ds-accent-primary)] font-medium" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-emphasis)]"
|
|
2872
2917
|
),
|
|
2873
2918
|
children: day
|
|
2874
2919
|
},
|
|
@@ -3325,7 +3370,7 @@ function TimePicker({
|
|
|
3325
3370
|
className: cn(
|
|
3326
3371
|
"w-full text-center text-sm py-ds-1 rounded-[var(--ds-radius-sm)] cursor-pointer",
|
|
3327
3372
|
"transition-colors",
|
|
3328
|
-
(use24Hour ? h2 === parseInt(value) : h2 === parsed.hour) ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-
|
|
3373
|
+
(use24Hour ? h2 === parseInt(value) : h2 === parsed.hour) ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-emphasis)]"
|
|
3329
3374
|
),
|
|
3330
3375
|
children: pad(h2)
|
|
3331
3376
|
},
|
|
@@ -3339,7 +3384,7 @@ function TimePicker({
|
|
|
3339
3384
|
className: cn(
|
|
3340
3385
|
"w-full text-center text-sm py-ds-1 rounded-[var(--ds-radius-sm)] cursor-pointer",
|
|
3341
3386
|
"transition-colors",
|
|
3342
|
-
m === parsed.minute ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-
|
|
3387
|
+
m === parsed.minute ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-emphasis)]"
|
|
3343
3388
|
),
|
|
3344
3389
|
children: pad(m)
|
|
3345
3390
|
},
|
|
@@ -3354,7 +3399,7 @@ function TimePicker({
|
|
|
3354
3399
|
className: cn(
|
|
3355
3400
|
"text-xs font-medium py-ds-1 rounded-[var(--ds-radius-sm)] cursor-pointer",
|
|
3356
3401
|
"transition-colors text-center",
|
|
3357
|
-
p === parsed.period ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-
|
|
3402
|
+
p === parsed.period ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-emphasis)]"
|
|
3358
3403
|
),
|
|
3359
3404
|
children: p
|
|
3360
3405
|
},
|
|
@@ -4033,24 +4078,24 @@ function ColorPicker({
|
|
|
4033
4078
|
},
|
|
4034
4079
|
[hsl, emitChange]
|
|
4035
4080
|
);
|
|
4036
|
-
const
|
|
4081
|
+
const handlePointerDown = useCallback(
|
|
4037
4082
|
(e) => {
|
|
4038
4083
|
if (disabled) return;
|
|
4084
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
4039
4085
|
draggingRef.current = true;
|
|
4040
4086
|
handleSatLightInteraction(e.clientX, e.clientY);
|
|
4041
|
-
const onMove = (ev) => {
|
|
4042
|
-
if (draggingRef.current) handleSatLightInteraction(ev.clientX, ev.clientY);
|
|
4043
|
-
};
|
|
4044
|
-
const onUp = () => {
|
|
4045
|
-
draggingRef.current = false;
|
|
4046
|
-
document.removeEventListener("mousemove", onMove);
|
|
4047
|
-
document.removeEventListener("mouseup", onUp);
|
|
4048
|
-
};
|
|
4049
|
-
document.addEventListener("mousemove", onMove);
|
|
4050
|
-
document.addEventListener("mouseup", onUp);
|
|
4051
4087
|
},
|
|
4052
4088
|
[disabled, handleSatLightInteraction]
|
|
4053
4089
|
);
|
|
4090
|
+
const handlePointerMove = useCallback(
|
|
4091
|
+
(e) => {
|
|
4092
|
+
if (draggingRef.current) handleSatLightInteraction(e.clientX, e.clientY);
|
|
4093
|
+
},
|
|
4094
|
+
[handleSatLightInteraction]
|
|
4095
|
+
);
|
|
4096
|
+
const handlePointerUp = useCallback(() => {
|
|
4097
|
+
draggingRef.current = false;
|
|
4098
|
+
}, []);
|
|
4054
4099
|
const handleHexChange = useCallback(
|
|
4055
4100
|
(raw) => {
|
|
4056
4101
|
setHexInput(raw);
|
|
@@ -4067,7 +4112,7 @@ function ColorPicker({
|
|
|
4067
4112
|
{
|
|
4068
4113
|
"aria-invalid": error || void 0,
|
|
4069
4114
|
className: cn(
|
|
4070
|
-
"w-64 p-ds-3 space-y-3",
|
|
4115
|
+
"w-full max-w-64 p-ds-3 space-y-3",
|
|
4071
4116
|
"bg-[var(--ds-bg-surface)] text-[var(--ds-text-primary)]",
|
|
4072
4117
|
"border-[length:var(--ds-border-width)]",
|
|
4073
4118
|
error ? "border-[var(--ds-status-error)]" : "border-[var(--ds-border-default)]",
|
|
@@ -4081,8 +4126,10 @@ function ColorPicker({
|
|
|
4081
4126
|
"div",
|
|
4082
4127
|
{
|
|
4083
4128
|
ref: satLightRef,
|
|
4084
|
-
|
|
4085
|
-
|
|
4129
|
+
onPointerDown: handlePointerDown,
|
|
4130
|
+
onPointerMove: handlePointerMove,
|
|
4131
|
+
onPointerUp: handlePointerUp,
|
|
4132
|
+
className: "relative h-40 rounded-[var(--ds-radius-md)] cursor-crosshair overflow-hidden touch-none",
|
|
4086
4133
|
style: {
|
|
4087
4134
|
background: `
|
|
4088
4135
|
linear-gradient(to top, #000, transparent),
|
|
@@ -4092,7 +4139,7 @@ function ColorPicker({
|
|
|
4092
4139
|
children: /* @__PURE__ */ jsx(
|
|
4093
4140
|
"div",
|
|
4094
4141
|
{
|
|
4095
|
-
className: "absolute w-
|
|
4142
|
+
className: "absolute w-5 h-5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-md pointer-events-none",
|
|
4096
4143
|
style: {
|
|
4097
4144
|
left: `${hsl.s}%`,
|
|
4098
4145
|
top: `${100 - hsl.l}%`,
|
|
@@ -4110,7 +4157,7 @@ function ColorPicker({
|
|
|
4110
4157
|
max: 360,
|
|
4111
4158
|
value: hsl.h,
|
|
4112
4159
|
onChange: (e) => emitChange({ ...hsl, h: Number(e.target.value) }),
|
|
4113
|
-
className: "w-full h-3 rounded-full cursor-pointer appearance-none [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-
|
|
4160
|
+
className: "w-full h-3.5 rounded-full cursor-pointer appearance-none touch-none [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:shadow-md [&::-webkit-slider-thumb]:cursor-pointer [&::-moz-range-thumb]:w-5 [&::-moz-range-thumb]:h-5 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-white [&::-moz-range-thumb]:shadow-md [&::-moz-range-thumb]:cursor-pointer [&::-moz-range-thumb]:appearance-none",
|
|
4114
4161
|
style: {
|
|
4115
4162
|
background: "linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)"
|
|
4116
4163
|
}
|
|
@@ -4124,7 +4171,7 @@ function ColorPicker({
|
|
|
4124
4171
|
max: 100,
|
|
4125
4172
|
value: Math.round(hsl.a * 100),
|
|
4126
4173
|
onChange: (e) => emitChange({ ...hsl, a: Number(e.target.value) / 100 }),
|
|
4127
|
-
className: "w-full h-3 rounded-full cursor-pointer appearance-none [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-
|
|
4174
|
+
className: "w-full h-3.5 rounded-full cursor-pointer appearance-none touch-none [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:shadow-md [&::-webkit-slider-thumb]:cursor-pointer [&::-moz-range-thumb]:w-5 [&::-moz-range-thumb]:h-5 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-white [&::-moz-range-thumb]:shadow-md [&::-moz-range-thumb]:cursor-pointer [&::-moz-range-thumb]:appearance-none",
|
|
4128
4175
|
style: {
|
|
4129
4176
|
background: `linear-gradient(to right, transparent, ${hslToHex({ ...hsl, a: 1 })})`
|
|
4130
4177
|
}
|
|
@@ -4155,7 +4202,7 @@ function ColorPicker({
|
|
|
4155
4202
|
}
|
|
4156
4203
|
)
|
|
4157
4204
|
] }),
|
|
4158
|
-
swatches.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-ds-
|
|
4205
|
+
swatches.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-ds-2", children: swatches.map((swatch) => /* @__PURE__ */ jsx(
|
|
4159
4206
|
"button",
|
|
4160
4207
|
{
|
|
4161
4208
|
type: "button",
|
|
@@ -4164,7 +4211,7 @@ function ColorPicker({
|
|
|
4164
4211
|
emitChange(parsed);
|
|
4165
4212
|
},
|
|
4166
4213
|
className: cn(
|
|
4167
|
-
"w-
|
|
4214
|
+
"w-7 h-7 rounded-[var(--ds-radius-sm)] cursor-pointer",
|
|
4168
4215
|
"border-[length:var(--ds-border-width)]",
|
|
4169
4216
|
"hover:scale-110 transition-transform",
|
|
4170
4217
|
"focus-visible:shadow-[var(--ds-shadow-focus)] outline-none",
|
|
@@ -4302,7 +4349,8 @@ function TransferList({
|
|
|
4302
4349
|
const allChecked = enabledIds.every((id) => checkedSelected.has(id));
|
|
4303
4350
|
setCheckedSelected(allChecked ? /* @__PURE__ */ new Set() : new Set(enabledIds));
|
|
4304
4351
|
}, [filteredSelected, checkedSelected]);
|
|
4305
|
-
|
|
4352
|
+
const isStacked = useBreakpoint("sm");
|
|
4353
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn(isStacked ? "flex flex-col gap-ds-2" : "flex items-stretch gap-ds-3", className), children: [
|
|
4306
4354
|
/* @__PURE__ */ jsx(
|
|
4307
4355
|
Panel,
|
|
4308
4356
|
{
|
|
@@ -4313,21 +4361,22 @@ function TransferList({
|
|
|
4313
4361
|
onToggle: (id) => toggleCheck(id, checkedAvailable, setCheckedAvailable),
|
|
4314
4362
|
onToggleAll: toggleAllAvailable,
|
|
4315
4363
|
search: searchLeft,
|
|
4316
|
-
onSearchChange: searchable ? setSearchLeft : void 0
|
|
4364
|
+
onSearchChange: searchable ? setSearchLeft : void 0,
|
|
4365
|
+
stacked: isStacked
|
|
4317
4366
|
}
|
|
4318
4367
|
),
|
|
4319
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
4320
|
-
|
|
4368
|
+
/* @__PURE__ */ jsxs("div", { className: cn(
|
|
4369
|
+
"flex items-center justify-center gap-ds-2 shrink-0",
|
|
4370
|
+
isStacked ? "flex-row py-ds-1" : "flex-col"
|
|
4371
|
+
), children: [
|
|
4372
|
+
/* @__PURE__ */ jsx(
|
|
4321
4373
|
"button",
|
|
4322
4374
|
{
|
|
4323
4375
|
onClick: moveAllRight,
|
|
4324
4376
|
disabled: !available.filter((i) => !i.disabled).length,
|
|
4325
|
-
"aria-label": "Move all right",
|
|
4377
|
+
"aria-label": isStacked ? "Move all down" : "Move all right",
|
|
4326
4378
|
className: cn(actionButtonClass),
|
|
4327
|
-
children:
|
|
4328
|
-
/* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 14 }),
|
|
4329
|
-
/* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 14, className: "-ml-ds-2.5" })
|
|
4330
|
-
]
|
|
4379
|
+
children: /* @__PURE__ */ jsx(Icon, { name: isStacked ? "chevrons-down" : "chevrons-right", size: 14 })
|
|
4331
4380
|
}
|
|
4332
4381
|
),
|
|
4333
4382
|
/* @__PURE__ */ jsx(
|
|
@@ -4335,9 +4384,9 @@ function TransferList({
|
|
|
4335
4384
|
{
|
|
4336
4385
|
onClick: moveRight,
|
|
4337
4386
|
disabled: !checkedAvailable.size,
|
|
4338
|
-
"aria-label": "Move selected right",
|
|
4387
|
+
"aria-label": isStacked ? "Move selected down" : "Move selected right",
|
|
4339
4388
|
className: cn(actionButtonClass),
|
|
4340
|
-
children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 14 })
|
|
4389
|
+
children: /* @__PURE__ */ jsx(Icon, { name: isStacked ? "chevron-down" : "chevron-right", size: 14 })
|
|
4341
4390
|
}
|
|
4342
4391
|
),
|
|
4343
4392
|
/* @__PURE__ */ jsx(
|
|
@@ -4345,22 +4394,19 @@ function TransferList({
|
|
|
4345
4394
|
{
|
|
4346
4395
|
onClick: moveLeft,
|
|
4347
4396
|
disabled: !checkedSelected.size,
|
|
4348
|
-
"aria-label": "Move selected left",
|
|
4397
|
+
"aria-label": isStacked ? "Move selected up" : "Move selected left",
|
|
4349
4398
|
className: cn(actionButtonClass),
|
|
4350
|
-
children: /* @__PURE__ */ jsx(Icon, { name: "chevron-
|
|
4399
|
+
children: /* @__PURE__ */ jsx(Icon, { name: isStacked ? "chevron-up" : "chevron-left", size: 14 })
|
|
4351
4400
|
}
|
|
4352
4401
|
),
|
|
4353
|
-
/* @__PURE__ */
|
|
4402
|
+
/* @__PURE__ */ jsx(
|
|
4354
4403
|
"button",
|
|
4355
4404
|
{
|
|
4356
4405
|
onClick: moveAllLeft,
|
|
4357
4406
|
disabled: !selected.filter((i) => !i.disabled).length,
|
|
4358
|
-
"aria-label": "Move all left",
|
|
4407
|
+
"aria-label": isStacked ? "Move all up" : "Move all left",
|
|
4359
4408
|
className: cn(actionButtonClass),
|
|
4360
|
-
children:
|
|
4361
|
-
/* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 14, className: "rotate-180" }),
|
|
4362
|
-
/* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 14, className: "rotate-180 -ml-ds-2.5" })
|
|
4363
|
-
]
|
|
4409
|
+
children: /* @__PURE__ */ jsx(Icon, { name: isStacked ? "chevrons-up" : "chevrons-left", size: 14 })
|
|
4364
4410
|
}
|
|
4365
4411
|
)
|
|
4366
4412
|
] }),
|
|
@@ -4374,7 +4420,8 @@ function TransferList({
|
|
|
4374
4420
|
onToggle: (id) => toggleCheck(id, checkedSelected, setCheckedSelected),
|
|
4375
4421
|
onToggleAll: toggleAllSelected,
|
|
4376
4422
|
search: searchRight,
|
|
4377
|
-
onSearchChange: searchable ? setSearchRight : void 0
|
|
4423
|
+
onSearchChange: searchable ? setSearchRight : void 0,
|
|
4424
|
+
stacked: isStacked
|
|
4378
4425
|
}
|
|
4379
4426
|
)
|
|
4380
4427
|
] });
|
|
@@ -4389,7 +4436,7 @@ var actionButtonClass = [
|
|
|
4389
4436
|
"focus-visible:outline-none focus-visible:shadow-[var(--ds-shadow-focus)]",
|
|
4390
4437
|
"disabled:opacity-disabled disabled:pointer-events-none"
|
|
4391
4438
|
].join(" ");
|
|
4392
|
-
function Panel({ title, items, totalCount, checked, onToggle, onToggleAll, search, onSearchChange }) {
|
|
4439
|
+
function Panel({ title, items, totalCount, checked, onToggle, onToggleAll, search, onSearchChange, stacked }) {
|
|
4393
4440
|
const enabledItems = items.filter((i) => !i.disabled);
|
|
4394
4441
|
const allChecked = enabledItems.length > 0 && enabledItems.every((i) => checked.has(i.id));
|
|
4395
4442
|
const someChecked = enabledItems.some((i) => checked.has(i.id));
|
|
@@ -4397,10 +4444,11 @@ function Panel({ title, items, totalCount, checked, onToggle, onToggleAll, searc
|
|
|
4397
4444
|
"div",
|
|
4398
4445
|
{
|
|
4399
4446
|
className: cn(
|
|
4400
|
-
"flex
|
|
4447
|
+
"flex flex-col",
|
|
4401
4448
|
"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
|
|
4402
4449
|
"rounded-[var(--ds-radius-md)] overflow-hidden",
|
|
4403
|
-
"bg-[var(--ds-bg-surface)]"
|
|
4450
|
+
"bg-[var(--ds-bg-surface)]",
|
|
4451
|
+
stacked ? "w-full" : "flex-1 min-w-[180px]"
|
|
4404
4452
|
),
|
|
4405
4453
|
children: [
|
|
4406
4454
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-ds-2.5 px-ds-3 py-ds-2 border-b-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]", children: [
|
|
@@ -4425,7 +4473,7 @@ function Panel({ title, items, totalCount, checked, onToggle, onToggleAll, searc
|
|
|
4425
4473
|
}
|
|
4426
4474
|
)
|
|
4427
4475
|
] }) }),
|
|
4428
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto max-h-[240px]", style: { padding: "var(--ds-space-1)" }, children: [
|
|
4476
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex-1 overflow-y-auto", stacked ? "max-h-[160px]" : "max-h-[240px]"), style: { padding: "var(--ds-space-1)" }, children: [
|
|
4429
4477
|
items.length === 0 && /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--ds-text-muted)] text-center py-ds-6", children: "No items" }),
|
|
4430
4478
|
items.map((item) => /* @__PURE__ */ jsxs(
|
|
4431
4479
|
"label",
|
|
@@ -81229,14 +81277,35 @@ var HastEmitter = class {
|
|
|
81229
81277
|
}
|
|
81230
81278
|
};
|
|
81231
81279
|
var lowlight = createLowlight(grammars2);
|
|
81280
|
+
var DEFAULT_TOOLBAR = [
|
|
81281
|
+
"blockType",
|
|
81282
|
+
"fontFamily",
|
|
81283
|
+
"textSize",
|
|
81284
|
+
"formatting",
|
|
81285
|
+
"colors",
|
|
81286
|
+
"alignment",
|
|
81287
|
+
"lists",
|
|
81288
|
+
"blocks",
|
|
81289
|
+
"insert",
|
|
81290
|
+
"extras",
|
|
81291
|
+
"history"
|
|
81292
|
+
];
|
|
81293
|
+
var MINIMAL_TOOLBAR = [
|
|
81294
|
+
"formatting",
|
|
81295
|
+
"lists",
|
|
81296
|
+
"insert",
|
|
81297
|
+
"history"
|
|
81298
|
+
];
|
|
81232
81299
|
function RichTextEditor({
|
|
81233
81300
|
content = "",
|
|
81234
81301
|
placeholder = "Start writing...",
|
|
81235
81302
|
onChange,
|
|
81236
81303
|
editable = true,
|
|
81304
|
+
toolbar = "full",
|
|
81237
81305
|
className,
|
|
81238
81306
|
ref
|
|
81239
81307
|
}) {
|
|
81308
|
+
const resolvedToolbar = toolbar === "full" ? DEFAULT_TOOLBAR : toolbar === "minimal" ? MINIMAL_TOOLBAR : toolbar;
|
|
81240
81309
|
const editor = useEditor({
|
|
81241
81310
|
extensions: [
|
|
81242
81311
|
index_default3.configure({ codeBlock: false }),
|
|
@@ -81276,7 +81345,7 @@ function RichTextEditor({
|
|
|
81276
81345
|
className
|
|
81277
81346
|
),
|
|
81278
81347
|
children: [
|
|
81279
|
-
editable && /* @__PURE__ */ jsx(Toolbar, { editor }),
|
|
81348
|
+
editable && /* @__PURE__ */ jsx(Toolbar, { editor, groups: resolvedToolbar }),
|
|
81280
81349
|
/* @__PURE__ */ jsx(
|
|
81281
81350
|
EditorContent,
|
|
81282
81351
|
{
|
|
@@ -81325,8 +81394,9 @@ var TEXT_SIZES = [
|
|
|
81325
81394
|
{ label: "Large", value: "1.2em" },
|
|
81326
81395
|
{ label: "Huge", value: "1.5em" }
|
|
81327
81396
|
];
|
|
81328
|
-
function Toolbar({ editor }) {
|
|
81397
|
+
function Toolbar({ editor, groups }) {
|
|
81329
81398
|
const [, forceUpdate] = useState(0);
|
|
81399
|
+
const isMobile = useBreakpoint("sm");
|
|
81330
81400
|
useEffect(() => {
|
|
81331
81401
|
const handler = () => forceUpdate((n) => n + 1);
|
|
81332
81402
|
editor.on("selectionUpdate", handler);
|
|
@@ -81337,19 +81407,23 @@ function Toolbar({ editor }) {
|
|
|
81337
81407
|
};
|
|
81338
81408
|
}, [editor]);
|
|
81339
81409
|
const inTable = editor.isActive("table");
|
|
81340
|
-
|
|
81341
|
-
|
|
81342
|
-
|
|
81343
|
-
|
|
81344
|
-
|
|
81345
|
-
|
|
81410
|
+
const has = (g) => groups.includes(g);
|
|
81411
|
+
const groupElements = [];
|
|
81412
|
+
if (has("blockType")) groupElements.push(/* @__PURE__ */ jsx(BlockTypeSelect, { editor }, "blockType"));
|
|
81413
|
+
if (has("fontFamily")) groupElements.push(/* @__PURE__ */ jsx(FontFamilySelect, { editor }, "fontFamily"));
|
|
81414
|
+
if (has("textSize")) groupElements.push(/* @__PURE__ */ jsx(TextSizeControls, { editor }, "textSize"));
|
|
81415
|
+
if (has("formatting")) {
|
|
81416
|
+
groupElements.push(
|
|
81346
81417
|
/* @__PURE__ */ jsxs(ToolGroup, { children: [
|
|
81347
81418
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive("bold"), onClick: () => editor.chain().focus().toggleBold().run(), title: "Bold (Ctrl+B)", children: /* @__PURE__ */ jsx(Icon, { name: "bold", size: 16 }) }),
|
|
81348
81419
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive("italic"), onClick: () => editor.chain().focus().toggleItalic().run(), title: "Italic (Ctrl+I)", children: /* @__PURE__ */ jsx(Icon, { name: "italic", size: 16 }) }),
|
|
81349
81420
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive("underline"), onClick: () => editor.chain().focus().toggleUnderline().run(), title: "Underline (Ctrl+U)", children: /* @__PURE__ */ jsx(Icon, { name: "underline", size: 16 }) }),
|
|
81350
81421
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive("strike"), onClick: () => editor.chain().focus().toggleStrike().run(), title: "Strikethrough", children: /* @__PURE__ */ jsx(Icon, { name: "strikethrough", size: 16 }) })
|
|
81351
|
-
] })
|
|
81352
|
-
|
|
81422
|
+
] }, "formatting")
|
|
81423
|
+
);
|
|
81424
|
+
}
|
|
81425
|
+
if (has("colors")) {
|
|
81426
|
+
groupElements.push(
|
|
81353
81427
|
/* @__PURE__ */ jsxs(ToolGroup, { children: [
|
|
81354
81428
|
/* @__PURE__ */ jsx(
|
|
81355
81429
|
ColorPicker2,
|
|
@@ -81371,45 +81445,83 @@ function Toolbar({ editor }) {
|
|
|
81371
81445
|
icon: /* @__PURE__ */ jsx(Icon, { name: "highlight", size: 16 })
|
|
81372
81446
|
}
|
|
81373
81447
|
)
|
|
81374
|
-
] })
|
|
81375
|
-
|
|
81448
|
+
] }, "colors")
|
|
81449
|
+
);
|
|
81450
|
+
}
|
|
81451
|
+
if (has("alignment")) {
|
|
81452
|
+
groupElements.push(
|
|
81376
81453
|
/* @__PURE__ */ jsxs(ToolGroup, { children: [
|
|
81377
81454
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive({ textAlign: "left" }), onClick: () => editor.chain().focus().setTextAlign("left").run(), title: "Align left", children: /* @__PURE__ */ jsx(Icon, { name: "align-left", size: 16 }) }),
|
|
81378
81455
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive({ textAlign: "center" }), onClick: () => editor.chain().focus().setTextAlign("center").run(), title: "Align center", children: /* @__PURE__ */ jsx(Icon, { name: "align-center", size: 16 }) }),
|
|
81379
81456
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive({ textAlign: "right" }), onClick: () => editor.chain().focus().setTextAlign("right").run(), title: "Align right", children: /* @__PURE__ */ jsx(Icon, { name: "align-right", size: 16 }) })
|
|
81380
|
-
] })
|
|
81381
|
-
|
|
81457
|
+
] }, "alignment")
|
|
81458
|
+
);
|
|
81459
|
+
}
|
|
81460
|
+
if (has("lists")) {
|
|
81461
|
+
groupElements.push(
|
|
81382
81462
|
/* @__PURE__ */ jsxs(ToolGroup, { children: [
|
|
81383
81463
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive("bulletList"), onClick: () => editor.chain().focus().toggleBulletList().run(), title: "Bullet list", children: /* @__PURE__ */ jsx(Icon, { name: "list", size: 16 }) }),
|
|
81384
81464
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive("orderedList"), onClick: () => editor.chain().focus().toggleOrderedList().run(), title: "Ordered list", children: /* @__PURE__ */ jsx(Icon, { name: "list-ordered", size: 16 }) }),
|
|
81385
81465
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive("taskList"), onClick: () => editor.chain().focus().toggleTaskList().run(), title: "Task list", children: /* @__PURE__ */ jsx(Icon, { name: "list-checks", size: 16 }) })
|
|
81386
|
-
] })
|
|
81387
|
-
|
|
81466
|
+
] }, "lists")
|
|
81467
|
+
);
|
|
81468
|
+
}
|
|
81469
|
+
if (has("blocks")) {
|
|
81470
|
+
groupElements.push(
|
|
81388
81471
|
/* @__PURE__ */ jsxs(ToolGroup, { children: [
|
|
81389
81472
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive("blockquote"), onClick: () => editor.chain().focus().toggleBlockquote().run(), title: "Blockquote", children: /* @__PURE__ */ jsx(Icon, { name: "quote", size: 16 }) }),
|
|
81390
81473
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive("codeBlock"), onClick: () => editor.chain().focus().toggleCodeBlock().run(), title: "Code block", children: /* @__PURE__ */ jsx(Icon, { name: "code", size: 16 }) })
|
|
81391
|
-
] })
|
|
81392
|
-
|
|
81474
|
+
] }, "blocks")
|
|
81475
|
+
);
|
|
81476
|
+
}
|
|
81477
|
+
if (has("insert")) {
|
|
81478
|
+
groupElements.push(
|
|
81393
81479
|
/* @__PURE__ */ jsxs(ToolGroup, { children: [
|
|
81394
81480
|
/* @__PURE__ */ jsx(LinkPopover, { editor }),
|
|
81395
81481
|
/* @__PURE__ */ jsx(ImagePopover, { editor }),
|
|
81396
81482
|
/* @__PURE__ */ jsx(ToolBtn, { onClick: () => editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: true }).run(), disabled: inTable, title: "Insert table", children: /* @__PURE__ */ jsx(Icon, { name: "table", size: 16 }) }),
|
|
81397
81483
|
/* @__PURE__ */ jsx(ToolBtn, { onClick: () => editor.chain().focus().setHorizontalRule().run(), title: "Horizontal rule", children: /* @__PURE__ */ jsx(Icon, { name: "minus", size: 16 }) })
|
|
81398
|
-
] })
|
|
81399
|
-
|
|
81484
|
+
] }, "insert")
|
|
81485
|
+
);
|
|
81486
|
+
}
|
|
81487
|
+
if (has("extras")) {
|
|
81488
|
+
groupElements.push(
|
|
81400
81489
|
/* @__PURE__ */ jsxs(ToolGroup, { children: [
|
|
81401
81490
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive("code"), onClick: () => editor.chain().focus().toggleCode().run(), title: "Inline code", children: /* @__PURE__ */ jsx(Icon, { name: "code", size: 16 }) }),
|
|
81402
81491
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive("superscript"), onClick: () => editor.chain().focus().toggleSuperscript().run(), title: "Superscript", children: /* @__PURE__ */ jsx(Icon, { name: "superscript", size: 16 }) }),
|
|
81403
81492
|
/* @__PURE__ */ jsx(ToolBtn, { active: editor.isActive("subscript"), onClick: () => editor.chain().focus().toggleSubscript().run(), title: "Subscript", children: /* @__PURE__ */ jsx(Icon, { name: "subscript", size: 16 }) })
|
|
81404
|
-
] })
|
|
81405
|
-
|
|
81493
|
+
] }, "extras")
|
|
81494
|
+
);
|
|
81495
|
+
}
|
|
81496
|
+
if (has("history")) {
|
|
81497
|
+
groupElements.push(
|
|
81406
81498
|
/* @__PURE__ */ jsxs(ToolGroup, { children: [
|
|
81407
81499
|
/* @__PURE__ */ jsx(ToolBtn, { onClick: () => editor.chain().focus().undo().run(), disabled: !editor.can().undo(), title: "Undo (Ctrl+Z)", children: /* @__PURE__ */ jsx(Icon, { name: "undo", size: 16 }) }),
|
|
81408
81500
|
/* @__PURE__ */ jsx(ToolBtn, { onClick: () => editor.chain().focus().redo().run(), disabled: !editor.can().redo(), title: "Redo (Ctrl+Shift+Z)", children: /* @__PURE__ */ jsx(Icon, { name: "redo", size: 16 }) })
|
|
81409
|
-
] })
|
|
81410
|
-
|
|
81411
|
-
|
|
81412
|
-
|
|
81501
|
+
] }, "history")
|
|
81502
|
+
);
|
|
81503
|
+
}
|
|
81504
|
+
const withDividers = groupElements.reduce((acc, el, i) => {
|
|
81505
|
+
if (i > 0) acc.push(/* @__PURE__ */ jsx(Divider, {}, `d-${i}`));
|
|
81506
|
+
acc.push(el);
|
|
81507
|
+
return acc;
|
|
81508
|
+
}, []);
|
|
81509
|
+
return /* @__PURE__ */ jsxs("div", { className: "border-b-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)] bg-[var(--ds-bg-muted)]", children: [
|
|
81510
|
+
/* @__PURE__ */ jsx(
|
|
81511
|
+
"div",
|
|
81512
|
+
{
|
|
81513
|
+
className: cn(
|
|
81514
|
+
"flex items-center gap-ds-0.5 px-ds-2 py-ds-1",
|
|
81515
|
+
isMobile ? "overflow-x-auto flex-nowrap scrollbar-none" : "flex-wrap"
|
|
81516
|
+
),
|
|
81517
|
+
children: withDividers
|
|
81518
|
+
}
|
|
81519
|
+
),
|
|
81520
|
+
inTable && /* @__PURE__ */ jsxs("div", { className: cn(
|
|
81521
|
+
"flex items-center gap-ds-0.5 px-ds-2 py-ds-1 border-t-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
|
|
81522
|
+
isMobile && "overflow-x-auto flex-nowrap scrollbar-none"
|
|
81523
|
+
), children: [
|
|
81524
|
+
/* @__PURE__ */ jsx("span", { className: "text-2xs text-[var(--ds-text-muted)] uppercase tracking-wider mr-ds-1 shrink-0", children: "Table" }),
|
|
81413
81525
|
/* @__PURE__ */ jsx(TableOpBtn, { onClick: () => editor.chain().focus().addRowAfter().run(), label: "+ Row" }),
|
|
81414
81526
|
/* @__PURE__ */ jsx(TableOpBtn, { onClick: () => editor.chain().focus().addColumnAfter().run(), label: "+ Col" }),
|
|
81415
81527
|
/* @__PURE__ */ jsx(Divider, {}),
|
|
@@ -81468,7 +81580,7 @@ function TextSizeControls({ editor }) {
|
|
|
81468
81580
|
};
|
|
81469
81581
|
return /* @__PURE__ */ jsxs(ToolGroup, { children: [
|
|
81470
81582
|
/* @__PURE__ */ jsx(ToolBtn, { onClick: decrease, disabled: currentIdx <= 0, title: `Decrease text size (${TEXT_SIZES[Math.max(0, currentIdx - 1)]?.label})`, children: /* @__PURE__ */ jsx("span", { className: "text-2xs font-bold leading-none select-none", children: "A" }) }),
|
|
81471
|
-
/* @__PURE__ */ jsx(ToolBtn, { onClick: increase, disabled: currentIdx >= TEXT_SIZES.length - 1, title: `Increase text size (${TEXT_SIZES[Math.min(TEXT_SIZES.length - 1, currentIdx + 1)]?.label})`, children: /* @__PURE__ */ jsx("span", { className: "text-
|
|
81583
|
+
/* @__PURE__ */ jsx(ToolBtn, { onClick: increase, disabled: currentIdx >= TEXT_SIZES.length - 1, title: `Increase text size (${TEXT_SIZES[Math.min(TEXT_SIZES.length - 1, currentIdx + 1)]?.label})`, children: /* @__PURE__ */ jsx("span", { className: "text-base font-bold leading-none select-none", children: "A" }) })
|
|
81472
81584
|
] });
|
|
81473
81585
|
}
|
|
81474
81586
|
function ColorPicker2({
|
|
@@ -81985,7 +82097,7 @@ function MentionInput({
|
|
|
81985
82097
|
className: cn(
|
|
81986
82098
|
"flex items-center gap-ds-2.5 w-full px-ds-3 py-ds-1.5 text-left text-sm cursor-pointer",
|
|
81987
82099
|
"transition-colors duration-[var(--ds-transition-speed)]",
|
|
81988
|
-
i === activeIndex ? "bg-[var(--ds-bg-muted)] text-[var(--ds-text-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-
|
|
82100
|
+
i === activeIndex ? "bg-[var(--ds-bg-muted)] text-[var(--ds-text-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-emphasis)] hover:text-[var(--ds-text-primary)]"
|
|
81989
82101
|
),
|
|
81990
82102
|
onMouseDown: (e) => {
|
|
81991
82103
|
e.preventDefault();
|
|
@@ -82154,7 +82266,7 @@ function StatsCard({ value, label, trend, icon, layout = "card", interactive, on
|
|
|
82154
82266
|
{
|
|
82155
82267
|
"data-card": "",
|
|
82156
82268
|
className: cn(
|
|
82157
|
-
"flex flex-col p-ds-5 min-w-0",
|
|
82269
|
+
"flex flex-col p-ds-3 sm:p-ds-5 min-w-0",
|
|
82158
82270
|
"bg-[var(--ds-bg-surface)] rounded-[var(--ds-radius-md)]",
|
|
82159
82271
|
"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
|
|
82160
82272
|
isInteractive ? [
|
|
@@ -82324,37 +82436,6 @@ function Accordion({ items, type = "single", defaultOpen = [], open: controlledO
|
|
|
82324
82436
|
] }, i);
|
|
82325
82437
|
}) });
|
|
82326
82438
|
}
|
|
82327
|
-
var DEFAULT_BREAKPOINTS = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
82328
|
-
var BreakpointWidthCtx = createContext(null);
|
|
82329
|
-
function BreakpointWidthProvider({ width, children }) {
|
|
82330
|
-
return createElement(BreakpointWidthCtx, { value: width }, children);
|
|
82331
|
-
}
|
|
82332
|
-
function readBpFromCSS(key2) {
|
|
82333
|
-
if (typeof window === "undefined") return DEFAULT_BREAKPOINTS[key2];
|
|
82334
|
-
const raw = getComputedStyle(document.documentElement).getPropertyValue(`--ds-bp-${key2}`).trim();
|
|
82335
|
-
const px = parseInt(raw, 10);
|
|
82336
|
-
return isNaN(px) ? DEFAULT_BREAKPOINTS[key2] : px;
|
|
82337
|
-
}
|
|
82338
|
-
function useBreakpoint(key2) {
|
|
82339
|
-
const overrideWidth = useContext(BreakpointWidthCtx);
|
|
82340
|
-
const px = useMemo(() => readBpFromCSS(key2), [key2]);
|
|
82341
|
-
const [matches2, setMatches] = useState(() => {
|
|
82342
|
-
if (overrideWidth !== null) return overrideWidth <= px;
|
|
82343
|
-
return typeof window !== "undefined" ? window.matchMedia(`(max-width: ${px}px)`).matches : false;
|
|
82344
|
-
});
|
|
82345
|
-
useEffect(() => {
|
|
82346
|
-
if (overrideWidth !== null) {
|
|
82347
|
-
setMatches(overrideWidth <= px);
|
|
82348
|
-
return;
|
|
82349
|
-
}
|
|
82350
|
-
const mql = window.matchMedia(`(max-width: ${px}px)`);
|
|
82351
|
-
const handler = (e) => setMatches(e.matches);
|
|
82352
|
-
mql.addEventListener("change", handler);
|
|
82353
|
-
setMatches(mql.matches);
|
|
82354
|
-
return () => mql.removeEventListener("change", handler);
|
|
82355
|
-
}, [px, overrideWidth]);
|
|
82356
|
-
return matches2;
|
|
82357
|
-
}
|
|
82358
82439
|
function Table2({
|
|
82359
82440
|
columns,
|
|
82360
82441
|
data,
|
|
@@ -82442,7 +82523,7 @@ function Table2({
|
|
|
82442
82523
|
if (data.length === 0 && emptyState) {
|
|
82443
82524
|
return /* @__PURE__ */ jsx("div", { ref, className: cn("py-ds-10 text-center text-sm text-[var(--ds-text-muted)]", className), children: emptyState });
|
|
82444
82525
|
}
|
|
82445
|
-
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col gap-ds-3", className), children: sortedWithIndices.map(({ row, originalIdx }, i) => {
|
|
82526
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col gap-ds-3 overflow-y-auto", className), children: sortedWithIndices.map(({ row, originalIdx }, i) => {
|
|
82446
82527
|
const isSelected = selectedSet.has(originalIdx);
|
|
82447
82528
|
return /* @__PURE__ */ jsxs(
|
|
82448
82529
|
"div",
|
|
@@ -82473,7 +82554,7 @@ function Table2({
|
|
|
82473
82554
|
{
|
|
82474
82555
|
ref,
|
|
82475
82556
|
className: cn(
|
|
82476
|
-
"w-full overflow-auto",
|
|
82557
|
+
"w-full overflow-x-auto",
|
|
82477
82558
|
"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
|
|
82478
82559
|
"rounded-[var(--ds-radius-md)]",
|
|
82479
82560
|
GLASS_SURFACE,
|
|
@@ -83071,7 +83152,7 @@ function OverflowPopover({
|
|
|
83071
83152
|
{
|
|
83072
83153
|
ref: floatingRef,
|
|
83073
83154
|
className: cn(
|
|
83074
|
-
"fixed z-[
|
|
83155
|
+
"fixed z-[var(--ds-z-popover)] w-56 max-h-48 overflow-y-auto",
|
|
83075
83156
|
"bg-[var(--ds-bg-surface-elevated)]",
|
|
83076
83157
|
"[backdrop-filter:var(--ds-glass-filter)] [-webkit-backdrop-filter:var(--ds-glass-filter)]",
|
|
83077
83158
|
"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]",
|
|
@@ -83293,31 +83374,48 @@ function WeekView({
|
|
|
83293
83374
|
selectedDate,
|
|
83294
83375
|
onDayClick,
|
|
83295
83376
|
onEventClick,
|
|
83296
|
-
weekStartsOn
|
|
83297
|
-
visibleDays = 7
|
|
83377
|
+
weekStartsOn
|
|
83298
83378
|
}) {
|
|
83299
|
-
const days = useMemo(() =>
|
|
83300
|
-
const allDays = getWeekDays(date, weekStartsOn);
|
|
83301
|
-
if (visibleDays === 7) return allDays;
|
|
83302
|
-
const dayOfWeek = date.getDay();
|
|
83303
|
-
const startIdx = Math.max(0, Math.min(allDays.findIndex((d2) => d2.getDay() === dayOfWeek), allDays.length - visibleDays));
|
|
83304
|
-
return allDays.slice(startIdx, startIdx + visibleDays);
|
|
83305
|
-
}, [date, weekStartsOn, visibleDays]);
|
|
83379
|
+
const days = useMemo(() => getWeekDays(date, weekStartsOn), [date, weekStartsOn]);
|
|
83306
83380
|
const allDayEvents = useMemo(() => {
|
|
83307
83381
|
return days.map(
|
|
83308
83382
|
(day) => getEventsForDay(events2, day).filter((e) => e.allDay)
|
|
83309
83383
|
);
|
|
83310
83384
|
}, [days, events2]);
|
|
83311
83385
|
const hasAllDay = allDayEvents.some((d2) => d2.length > 0);
|
|
83312
|
-
|
|
83313
|
-
|
|
83314
|
-
|
|
83315
|
-
|
|
83316
|
-
|
|
83317
|
-
|
|
83318
|
-
|
|
83319
|
-
|
|
83320
|
-
|
|
83386
|
+
const containerRef = useRef(null);
|
|
83387
|
+
const syncingScroll = useRef(false);
|
|
83388
|
+
const handleScroll = useCallback((e) => {
|
|
83389
|
+
if (syncingScroll.current) return;
|
|
83390
|
+
syncingScroll.current = true;
|
|
83391
|
+
const source3 = e.target;
|
|
83392
|
+
const scrollLeft = source3.scrollLeft;
|
|
83393
|
+
const panels = containerRef.current?.querySelectorAll("[data-week-scroll]");
|
|
83394
|
+
panels?.forEach((panel) => {
|
|
83395
|
+
if (panel !== source3) panel.scrollLeft = scrollLeft;
|
|
83396
|
+
});
|
|
83397
|
+
syncingScroll.current = false;
|
|
83398
|
+
}, []);
|
|
83399
|
+
useEffect(() => {
|
|
83400
|
+
const container = containerRef.current;
|
|
83401
|
+
if (!container) return;
|
|
83402
|
+
const panels = container.querySelectorAll("[data-week-scroll]");
|
|
83403
|
+
panels.forEach((panel) => panel.addEventListener("scroll", handleScroll));
|
|
83404
|
+
return () => {
|
|
83405
|
+
panels.forEach((panel) => panel.removeEventListener("scroll", handleScroll));
|
|
83406
|
+
};
|
|
83407
|
+
}, [handleScroll, hasAllDay]);
|
|
83408
|
+
const MIN_DAY_WIDTH = 100;
|
|
83409
|
+
const dayGridColumns = `repeat(${days.length}, minmax(${MIN_DAY_WIDTH}px, 1fr))`;
|
|
83410
|
+
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: "flex flex-col h-full overflow-hidden", children: [
|
|
83411
|
+
/* @__PURE__ */ jsxs("div", { className: "flex border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]", children: [
|
|
83412
|
+
/* @__PURE__ */ jsx("div", { className: "w-14 shrink-0 border-r-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]" }),
|
|
83413
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-x-auto scrollbar-none", "data-week-scroll": true, children: /* @__PURE__ */ jsx(
|
|
83414
|
+
"div",
|
|
83415
|
+
{
|
|
83416
|
+
className: "grid",
|
|
83417
|
+
style: { gridTemplateColumns: dayGridColumns, minWidth: MIN_DAY_WIDTH * days.length },
|
|
83418
|
+
children: days.map((day, i) => {
|
|
83321
83419
|
const today = isToday(day);
|
|
83322
83420
|
const selected = selectedDate && isSameDay2(day, selectedDate);
|
|
83323
83421
|
return /* @__PURE__ */ jsxs(
|
|
@@ -83325,8 +83423,8 @@ function WeekView({
|
|
|
83325
83423
|
{
|
|
83326
83424
|
className: cn(
|
|
83327
83425
|
"text-center py-ds-2 cursor-pointer transition-colors",
|
|
83328
|
-
"border-l-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]",
|
|
83329
83426
|
"hover:bg-[var(--ds-bg-muted)]",
|
|
83427
|
+
i > 0 && "border-l-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]",
|
|
83330
83428
|
selected && "bg-[var(--ds-accent-primary)]/5"
|
|
83331
83429
|
),
|
|
83332
83430
|
onClick: () => onDayClick?.(day),
|
|
@@ -83347,20 +83445,23 @@ function WeekView({
|
|
|
83347
83445
|
i
|
|
83348
83446
|
);
|
|
83349
83447
|
})
|
|
83350
|
-
|
|
83351
|
-
}
|
|
83352
|
-
),
|
|
83353
|
-
hasAllDay && /* @__PURE__ */ jsxs(
|
|
83354
|
-
"div",
|
|
83355
|
-
{
|
|
83356
|
-
|
|
83357
|
-
|
|
83358
|
-
|
|
83359
|
-
|
|
83360
|
-
allDayEvents.map((dayEvts, i) => /* @__PURE__ */ jsx(
|
|
83448
|
+
}
|
|
83449
|
+
) })
|
|
83450
|
+
] }),
|
|
83451
|
+
hasAllDay && /* @__PURE__ */ jsxs("div", { className: "flex border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)] bg-[var(--ds-bg-muted)]/30", children: [
|
|
83452
|
+
/* @__PURE__ */ jsx("div", { className: "w-14 shrink-0 border-r-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)] text-2xs text-[var(--ds-text-muted)] px-ds-1 py-ds-1 text-right", children: "all-day" }),
|
|
83453
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-x-auto scrollbar-none", "data-week-scroll": true, children: /* @__PURE__ */ jsx(
|
|
83454
|
+
"div",
|
|
83455
|
+
{
|
|
83456
|
+
className: "grid",
|
|
83457
|
+
style: { gridTemplateColumns: dayGridColumns, minWidth: MIN_DAY_WIDTH * days.length },
|
|
83458
|
+
children: allDayEvents.map((dayEvts, i) => /* @__PURE__ */ jsx(
|
|
83361
83459
|
"div",
|
|
83362
83460
|
{
|
|
83363
|
-
className:
|
|
83461
|
+
className: cn(
|
|
83462
|
+
"p-ds-0.5 space-y-ds-0.5 min-h-[28px]",
|
|
83463
|
+
i > 0 && "border-l-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]"
|
|
83464
|
+
),
|
|
83364
83465
|
children: dayEvts.map((event) => /* @__PURE__ */ jsx(
|
|
83365
83466
|
EventBar,
|
|
83366
83467
|
{
|
|
@@ -83373,65 +83474,72 @@ function WeekView({
|
|
|
83373
83474
|
},
|
|
83374
83475
|
i
|
|
83375
83476
|
))
|
|
83376
|
-
|
|
83377
|
-
}
|
|
83378
|
-
),
|
|
83379
|
-
/* @__PURE__ */
|
|
83380
|
-
"div",
|
|
83381
|
-
|
|
83382
|
-
|
|
83383
|
-
|
|
83384
|
-
|
|
83385
|
-
|
|
83477
|
+
}
|
|
83478
|
+
) })
|
|
83479
|
+
] }),
|
|
83480
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 min-h-0 overflow-y-auto", children: [
|
|
83481
|
+
/* @__PURE__ */ jsx("div", { className: "w-14 shrink-0 relative border-r-[length:var(--ds-divider-width)] border-t-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]", style: { height: GRID_HEIGHT }, children: HOURS.map((h2) => /* @__PURE__ */ jsx(
|
|
83482
|
+
"div",
|
|
83483
|
+
{
|
|
83484
|
+
className: "absolute right-0 pr-ds-2 text-2xs text-[var(--ds-text-muted)] -translate-y-1/2",
|
|
83485
|
+
style: { top: h2 * HOUR_HEIGHT },
|
|
83486
|
+
children: h2 > 0 && formatHour(h2)
|
|
83386
83487
|
},
|
|
83387
|
-
|
|
83388
|
-
|
|
83488
|
+
h2
|
|
83489
|
+
)) }),
|
|
83490
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-x-auto scrollbar-none", "data-week-scroll": true, children: /* @__PURE__ */ jsx(
|
|
83491
|
+
"div",
|
|
83492
|
+
{
|
|
83493
|
+
className: "relative",
|
|
83494
|
+
style: { height: GRID_HEIGHT, minWidth: MIN_DAY_WIDTH * days.length },
|
|
83495
|
+
children: /* @__PURE__ */ jsx(
|
|
83389
83496
|
"div",
|
|
83390
83497
|
{
|
|
83391
|
-
className: "
|
|
83392
|
-
style: {
|
|
83393
|
-
children:
|
|
83394
|
-
|
|
83395
|
-
|
|
83396
|
-
|
|
83397
|
-
|
|
83398
|
-
|
|
83399
|
-
|
|
83400
|
-
|
|
83401
|
-
|
|
83402
|
-
|
|
83403
|
-
|
|
83404
|
-
|
|
83405
|
-
|
|
83406
|
-
|
|
83407
|
-
|
|
83408
|
-
|
|
83409
|
-
|
|
83410
|
-
|
|
83411
|
-
|
|
83412
|
-
|
|
83413
|
-
|
|
83414
|
-
|
|
83415
|
-
|
|
83416
|
-
|
|
83417
|
-
|
|
83418
|
-
|
|
83419
|
-
|
|
83420
|
-
|
|
83421
|
-
|
|
83422
|
-
|
|
83423
|
-
|
|
83424
|
-
|
|
83425
|
-
|
|
83426
|
-
|
|
83427
|
-
|
|
83428
|
-
|
|
83429
|
-
|
|
83430
|
-
|
|
83431
|
-
|
|
83432
|
-
|
|
83433
|
-
|
|
83434
|
-
|
|
83498
|
+
className: "grid h-full",
|
|
83499
|
+
style: { gridTemplateColumns: dayGridColumns },
|
|
83500
|
+
children: days.map((day, i) => {
|
|
83501
|
+
const dayEvents = getEventsForDay(events2, day).filter((e) => !e.allDay);
|
|
83502
|
+
const layout = getOverlappingGroups(dayEvents);
|
|
83503
|
+
const today = isToday(day);
|
|
83504
|
+
return /* @__PURE__ */ jsxs(
|
|
83505
|
+
"div",
|
|
83506
|
+
{
|
|
83507
|
+
className: cn(
|
|
83508
|
+
"relative",
|
|
83509
|
+
i > 0 && "border-l-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]"
|
|
83510
|
+
),
|
|
83511
|
+
onClick: () => onDayClick?.(day),
|
|
83512
|
+
children: [
|
|
83513
|
+
HOURS.map((h2) => /* @__PURE__ */ jsx(
|
|
83514
|
+
"div",
|
|
83515
|
+
{
|
|
83516
|
+
className: "absolute left-0 right-0 border-t-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]",
|
|
83517
|
+
style: { top: h2 * HOUR_HEIGHT }
|
|
83518
|
+
},
|
|
83519
|
+
h2
|
|
83520
|
+
)),
|
|
83521
|
+
today && /* @__PURE__ */ jsx(CurrentTimeLine, {}),
|
|
83522
|
+
layout.map(({ event, column, totalColumns }) => /* @__PURE__ */ jsx(
|
|
83523
|
+
TimedEvent,
|
|
83524
|
+
{
|
|
83525
|
+
event,
|
|
83526
|
+
category: categories[event.category ?? ""],
|
|
83527
|
+
column,
|
|
83528
|
+
totalColumns,
|
|
83529
|
+
onEventClick
|
|
83530
|
+
},
|
|
83531
|
+
event.id
|
|
83532
|
+
))
|
|
83533
|
+
]
|
|
83534
|
+
},
|
|
83535
|
+
i
|
|
83536
|
+
);
|
|
83537
|
+
})
|
|
83538
|
+
}
|
|
83539
|
+
)
|
|
83540
|
+
}
|
|
83541
|
+
) })
|
|
83542
|
+
] })
|
|
83435
83543
|
] });
|
|
83436
83544
|
}
|
|
83437
83545
|
var WEEKS_SHOWN = 6;
|
|
@@ -83503,7 +83611,7 @@ function DayCellWithPopover({
|
|
|
83503
83611
|
{
|
|
83504
83612
|
ref: floatingRef,
|
|
83505
83613
|
className: cn(
|
|
83506
|
-
"fixed z-[
|
|
83614
|
+
"fixed z-[var(--ds-z-popover)] w-52 max-h-40 overflow-y-auto pointer-events-none",
|
|
83507
83615
|
"bg-[var(--ds-bg-surface-elevated)]",
|
|
83508
83616
|
"[backdrop-filter:var(--ds-glass-filter)] [-webkit-backdrop-filter:var(--ds-glass-filter)]",
|
|
83509
83617
|
"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]",
|
|
@@ -83636,6 +83744,176 @@ function YearView({
|
|
|
83636
83744
|
}
|
|
83637
83745
|
) });
|
|
83638
83746
|
}
|
|
83747
|
+
function CompactDayCell({
|
|
83748
|
+
day,
|
|
83749
|
+
isCurrentMonth,
|
|
83750
|
+
events: events2,
|
|
83751
|
+
categories,
|
|
83752
|
+
selectedDate,
|
|
83753
|
+
onDayClick,
|
|
83754
|
+
onEventClick
|
|
83755
|
+
}) {
|
|
83756
|
+
const [open, setOpen] = useState(false);
|
|
83757
|
+
const cellRef = useRef(null);
|
|
83758
|
+
const floatingRef = useRef(null);
|
|
83759
|
+
const pos = usePosition(cellRef, floatingRef, open, {
|
|
83760
|
+
side: "bottom",
|
|
83761
|
+
align: "center",
|
|
83762
|
+
offset: 4,
|
|
83763
|
+
flip: true
|
|
83764
|
+
});
|
|
83765
|
+
const hoverTimeout = useRef(void 0);
|
|
83766
|
+
const dayEvents = isCurrentMonth ? getEventsForDay(events2, day) : [];
|
|
83767
|
+
const today = isCurrentMonth && isToday(day);
|
|
83768
|
+
const selected = isCurrentMonth && selectedDate && isSameDay2(day, selectedDate);
|
|
83769
|
+
const hasEvents = dayEvents.length > 0;
|
|
83770
|
+
const eventColors = dayEvents.slice(0, 3).map((e) => categories[e.category ?? ""]?.color ?? "var(--ds-accent-primary)");
|
|
83771
|
+
const handleMouseEnter = () => {
|
|
83772
|
+
if (!hasEvents) return;
|
|
83773
|
+
hoverTimeout.current = setTimeout(() => setOpen(true), 250);
|
|
83774
|
+
};
|
|
83775
|
+
const handleMouseLeave2 = () => {
|
|
83776
|
+
clearTimeout(hoverTimeout.current);
|
|
83777
|
+
setOpen(false);
|
|
83778
|
+
};
|
|
83779
|
+
const handleClick2 = () => {
|
|
83780
|
+
onDayClick?.(day);
|
|
83781
|
+
if (hasEvents) {
|
|
83782
|
+
setOpen((prev) => !prev);
|
|
83783
|
+
}
|
|
83784
|
+
};
|
|
83785
|
+
useEffect(() => {
|
|
83786
|
+
if (!open) return;
|
|
83787
|
+
const onKey = (e) => {
|
|
83788
|
+
if (e.key === "Escape") setOpen(false);
|
|
83789
|
+
};
|
|
83790
|
+
const onClick = (e) => {
|
|
83791
|
+
const t = e.target;
|
|
83792
|
+
if (cellRef.current?.contains(t) || floatingRef.current?.contains(t)) return;
|
|
83793
|
+
setOpen(false);
|
|
83794
|
+
};
|
|
83795
|
+
document.addEventListener("keydown", onKey);
|
|
83796
|
+
document.addEventListener("mousedown", onClick);
|
|
83797
|
+
return () => {
|
|
83798
|
+
document.removeEventListener("keydown", onKey);
|
|
83799
|
+
document.removeEventListener("mousedown", onClick);
|
|
83800
|
+
};
|
|
83801
|
+
}, [open]);
|
|
83802
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
83803
|
+
/* @__PURE__ */ jsxs(
|
|
83804
|
+
"button",
|
|
83805
|
+
{
|
|
83806
|
+
ref: cellRef,
|
|
83807
|
+
type: "button",
|
|
83808
|
+
onClick: handleClick2,
|
|
83809
|
+
onMouseEnter: handleMouseEnter,
|
|
83810
|
+
onMouseLeave: handleMouseLeave2,
|
|
83811
|
+
className: cn(
|
|
83812
|
+
"flex flex-col items-center justify-center py-ds-1.5 rounded-[var(--ds-radius-sm)] cursor-pointer transition-colors",
|
|
83813
|
+
"focus-visible:outline-none focus-visible:shadow-[var(--ds-shadow-focus)]",
|
|
83814
|
+
!isCurrentMonth && "opacity-30",
|
|
83815
|
+
selected && "bg-[var(--ds-accent-primary)]/10",
|
|
83816
|
+
!selected && "hover:bg-[var(--ds-bg-muted)]"
|
|
83817
|
+
),
|
|
83818
|
+
children: [
|
|
83819
|
+
/* @__PURE__ */ jsx(
|
|
83820
|
+
"span",
|
|
83821
|
+
{
|
|
83822
|
+
className: cn(
|
|
83823
|
+
"text-sm w-7 h-7 flex items-center justify-center rounded-full",
|
|
83824
|
+
today ? "bg-[var(--ds-accent-primary)] [background-image:var(--ds-gradient)] text-[var(--ds-text-on-primary)] font-bold" : "text-[var(--ds-text-primary)]"
|
|
83825
|
+
),
|
|
83826
|
+
children: day.getDate()
|
|
83827
|
+
}
|
|
83828
|
+
),
|
|
83829
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-ds-0.5 mt-ds-0.5 h-[6px] items-center", children: eventColors.map((color, i) => /* @__PURE__ */ jsx(
|
|
83830
|
+
"span",
|
|
83831
|
+
{
|
|
83832
|
+
className: "w-1.5 h-1.5 rounded-full",
|
|
83833
|
+
style: { backgroundColor: color }
|
|
83834
|
+
},
|
|
83835
|
+
i
|
|
83836
|
+
)) })
|
|
83837
|
+
]
|
|
83838
|
+
}
|
|
83839
|
+
),
|
|
83840
|
+
open && hasEvents && createPortal(
|
|
83841
|
+
/* @__PURE__ */ jsxs(
|
|
83842
|
+
"div",
|
|
83843
|
+
{
|
|
83844
|
+
ref: floatingRef,
|
|
83845
|
+
onMouseEnter: () => clearTimeout(hoverTimeout.current),
|
|
83846
|
+
onMouseLeave: () => setOpen(false),
|
|
83847
|
+
className: cn(
|
|
83848
|
+
"fixed z-[var(--ds-z-popover)] w-52 max-h-40 overflow-y-auto",
|
|
83849
|
+
"bg-[var(--ds-bg-surface-elevated)]",
|
|
83850
|
+
"[backdrop-filter:var(--ds-glass-filter)] [-webkit-backdrop-filter:var(--ds-glass-filter)]",
|
|
83851
|
+
"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]",
|
|
83852
|
+
"rounded-[var(--ds-radius-md)]",
|
|
83853
|
+
"shadow-[var(--ds-shadow-dropdown),var(--ds-glass-inset)]",
|
|
83854
|
+
"p-ds-2 space-y-ds-1"
|
|
83855
|
+
),
|
|
83856
|
+
style: { top: pos.top, left: pos.left },
|
|
83857
|
+
role: "tooltip",
|
|
83858
|
+
children: [
|
|
83859
|
+
/* @__PURE__ */ jsx("p", { className: "text-2xs font-medium text-[var(--ds-text-muted)] px-ds-1 mb-ds-0.5", children: day.toLocaleDateString(void 0, { weekday: "short", month: "short", day: "numeric" }) }),
|
|
83860
|
+
dayEvents.map((event) => /* @__PURE__ */ jsx(
|
|
83861
|
+
EventBar,
|
|
83862
|
+
{
|
|
83863
|
+
event,
|
|
83864
|
+
category: categories[event.category ?? ""],
|
|
83865
|
+
onClick: onEventClick
|
|
83866
|
+
},
|
|
83867
|
+
event.id
|
|
83868
|
+
))
|
|
83869
|
+
]
|
|
83870
|
+
}
|
|
83871
|
+
),
|
|
83872
|
+
document.body
|
|
83873
|
+
)
|
|
83874
|
+
] });
|
|
83875
|
+
}
|
|
83876
|
+
function CompactMonthView({
|
|
83877
|
+
date,
|
|
83878
|
+
events: events2,
|
|
83879
|
+
categories,
|
|
83880
|
+
selectedDate,
|
|
83881
|
+
onDayClick,
|
|
83882
|
+
onEventClick,
|
|
83883
|
+
weekStartsOn
|
|
83884
|
+
}) {
|
|
83885
|
+
const weeks = useMemo(
|
|
83886
|
+
() => getMonthGrid(date.getFullYear(), date.getMonth(), weekStartsOn),
|
|
83887
|
+
[date, weekStartsOn]
|
|
83888
|
+
);
|
|
83889
|
+
const dayNames = useMemo(() => getOrderedDayNames(weekStartsOn), [weekStartsOn]);
|
|
83890
|
+
const currentMonth = date.getMonth();
|
|
83891
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", style: { padding: "var(--ds-space-3) var(--ds-space-2.5)" }, children: [
|
|
83892
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 mb-ds-1.5", children: dayNames.map((name) => /* @__PURE__ */ jsx(
|
|
83893
|
+
"div",
|
|
83894
|
+
{
|
|
83895
|
+
className: "text-center text-xs font-medium text-[var(--ds-text-muted)] py-ds-1.5",
|
|
83896
|
+
children: name[0]
|
|
83897
|
+
},
|
|
83898
|
+
name
|
|
83899
|
+
)) }),
|
|
83900
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-y-ds-0.5", children: weeks.map(
|
|
83901
|
+
(week, wi) => week.map((day, di) => /* @__PURE__ */ jsx(
|
|
83902
|
+
CompactDayCell,
|
|
83903
|
+
{
|
|
83904
|
+
day,
|
|
83905
|
+
isCurrentMonth: day.getMonth() === currentMonth,
|
|
83906
|
+
events: events2,
|
|
83907
|
+
categories,
|
|
83908
|
+
selectedDate,
|
|
83909
|
+
onDayClick,
|
|
83910
|
+
onEventClick
|
|
83911
|
+
},
|
|
83912
|
+
`${wi}-${di}`
|
|
83913
|
+
))
|
|
83914
|
+
) })
|
|
83915
|
+
] });
|
|
83916
|
+
}
|
|
83639
83917
|
|
|
83640
83918
|
// ../../showcase/src/components/Calendar/types.ts
|
|
83641
83919
|
var DEFAULT_CATEGORIES = {
|
|
@@ -83643,8 +83921,8 @@ var DEFAULT_CATEGORIES = {
|
|
|
83643
83921
|
personal: { color: "var(--ds-status-success)", label: "Personal" },
|
|
83644
83922
|
meeting: { color: "var(--ds-status-warning)", label: "Meeting" },
|
|
83645
83923
|
deadline: { color: "var(--ds-status-error)", label: "Deadline" },
|
|
83646
|
-
travel: { color: "
|
|
83647
|
-
social: { color: "
|
|
83924
|
+
travel: { color: "var(--ds-status-info)", label: "Travel" },
|
|
83925
|
+
social: { color: "var(--ds-hue-secondary)", label: "Social" }
|
|
83648
83926
|
};
|
|
83649
83927
|
function useControllableState(controlled, defaultValue2, onChange) {
|
|
83650
83928
|
const [internal, setInternal] = useState(defaultValue2);
|
|
@@ -83716,21 +83994,7 @@ function MonthDropdown({
|
|
|
83716
83994
|
MONTH_NAMES[currentMonth],
|
|
83717
83995
|
" ",
|
|
83718
83996
|
currentYear,
|
|
83719
|
-
/* @__PURE__ */ jsx(
|
|
83720
|
-
"svg",
|
|
83721
|
-
{
|
|
83722
|
-
width: "12",
|
|
83723
|
-
height: "12",
|
|
83724
|
-
viewBox: "0 0 24 24",
|
|
83725
|
-
fill: "none",
|
|
83726
|
-
stroke: "currentColor",
|
|
83727
|
-
strokeWidth: "2",
|
|
83728
|
-
strokeLinecap: "round",
|
|
83729
|
-
strokeLinejoin: "round",
|
|
83730
|
-
className: cn("transition-transform", open && "rotate-180"),
|
|
83731
|
-
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
83732
|
-
}
|
|
83733
|
-
)
|
|
83997
|
+
/* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: 12, className: cn("transition-transform", open && "rotate-180") })
|
|
83734
83998
|
]
|
|
83735
83999
|
}
|
|
83736
84000
|
),
|
|
@@ -83740,7 +84004,7 @@ function MonthDropdown({
|
|
|
83740
84004
|
{
|
|
83741
84005
|
ref: floatingRef,
|
|
83742
84006
|
className: cn(
|
|
83743
|
-
"fixed z-[
|
|
84007
|
+
"fixed z-[var(--ds-z-popover)] w-[240px]",
|
|
83744
84008
|
"bg-[var(--ds-bg-surface-elevated)]",
|
|
83745
84009
|
"[backdrop-filter:var(--ds-glass-filter)] [-webkit-backdrop-filter:var(--ds-glass-filter)]",
|
|
83746
84010
|
"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]",
|
|
@@ -83754,7 +84018,7 @@ function MonthDropdown({
|
|
|
83754
84018
|
/* @__PURE__ */ jsx(
|
|
83755
84019
|
"button",
|
|
83756
84020
|
{
|
|
83757
|
-
className: "p-ds-1 rounded-[var(--ds-radius-sm)] hover:bg-[var(--ds-bg-
|
|
84021
|
+
className: "p-ds-1 rounded-[var(--ds-radius-sm)] hover:bg-[var(--ds-bg-emphasis)] cursor-pointer text-[var(--ds-text-secondary)]",
|
|
83758
84022
|
onClick: () => setBrowseYear(browseYear - 1),
|
|
83759
84023
|
"aria-label": "Previous year",
|
|
83760
84024
|
children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 14, className: "rotate-180" })
|
|
@@ -83764,7 +84028,7 @@ function MonthDropdown({
|
|
|
83764
84028
|
/* @__PURE__ */ jsx(
|
|
83765
84029
|
"button",
|
|
83766
84030
|
{
|
|
83767
|
-
className: "p-ds-1 rounded-[var(--ds-radius-sm)] hover:bg-[var(--ds-bg-
|
|
84031
|
+
className: "p-ds-1 rounded-[var(--ds-radius-sm)] hover:bg-[var(--ds-bg-emphasis)] cursor-pointer text-[var(--ds-text-secondary)]",
|
|
83768
84032
|
onClick: () => setBrowseYear(browseYear + 1),
|
|
83769
84033
|
"aria-label": "Next year",
|
|
83770
84034
|
children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 14 })
|
|
@@ -83779,7 +84043,7 @@ function MonthDropdown({
|
|
|
83779
84043
|
className: cn(
|
|
83780
84044
|
"px-ds-2 py-ds-1.5 text-xs font-medium rounded-[var(--ds-radius-sm)] cursor-pointer transition-colors",
|
|
83781
84045
|
"focus-visible:outline-none focus-visible:shadow-[var(--ds-shadow-focus)]",
|
|
83782
|
-
isActive2 ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-
|
|
84046
|
+
isActive2 ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-emphasis)] hover:text-[var(--ds-text-primary)]"
|
|
83783
84047
|
),
|
|
83784
84048
|
onClick: () => {
|
|
83785
84049
|
onSelect(new Date(browseYear, i, 1));
|
|
@@ -83847,21 +84111,7 @@ function YearDropdown({
|
|
|
83847
84111
|
),
|
|
83848
84112
|
children: [
|
|
83849
84113
|
currentYear,
|
|
83850
|
-
/* @__PURE__ */ jsx(
|
|
83851
|
-
"svg",
|
|
83852
|
-
{
|
|
83853
|
-
width: "12",
|
|
83854
|
-
height: "12",
|
|
83855
|
-
viewBox: "0 0 24 24",
|
|
83856
|
-
fill: "none",
|
|
83857
|
-
stroke: "currentColor",
|
|
83858
|
-
strokeWidth: "2",
|
|
83859
|
-
strokeLinecap: "round",
|
|
83860
|
-
strokeLinejoin: "round",
|
|
83861
|
-
className: cn("transition-transform", open && "rotate-180"),
|
|
83862
|
-
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
83863
|
-
}
|
|
83864
|
-
)
|
|
84114
|
+
/* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: 12, className: cn("transition-transform", open && "rotate-180") })
|
|
83865
84115
|
]
|
|
83866
84116
|
}
|
|
83867
84117
|
),
|
|
@@ -83871,7 +84121,7 @@ function YearDropdown({
|
|
|
83871
84121
|
{
|
|
83872
84122
|
ref: floatingRef,
|
|
83873
84123
|
className: cn(
|
|
83874
|
-
"fixed z-[
|
|
84124
|
+
"fixed z-[var(--ds-z-popover)] w-[200px]",
|
|
83875
84125
|
"bg-[var(--ds-bg-surface-elevated)]",
|
|
83876
84126
|
"[backdrop-filter:var(--ds-glass-filter)] [-webkit-backdrop-filter:var(--ds-glass-filter)]",
|
|
83877
84127
|
"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]",
|
|
@@ -83885,7 +84135,7 @@ function YearDropdown({
|
|
|
83885
84135
|
/* @__PURE__ */ jsx(
|
|
83886
84136
|
"button",
|
|
83887
84137
|
{
|
|
83888
|
-
className: "p-ds-1 rounded-[var(--ds-radius-sm)] hover:bg-[var(--ds-bg-
|
|
84138
|
+
className: "p-ds-1 rounded-[var(--ds-radius-sm)] hover:bg-[var(--ds-bg-emphasis)] cursor-pointer text-[var(--ds-text-secondary)]",
|
|
83889
84139
|
onClick: () => setRangeStart(rangeStart - 9),
|
|
83890
84140
|
"aria-label": "Previous years",
|
|
83891
84141
|
children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 14, className: "rotate-180" })
|
|
@@ -83899,7 +84149,7 @@ function YearDropdown({
|
|
|
83899
84149
|
/* @__PURE__ */ jsx(
|
|
83900
84150
|
"button",
|
|
83901
84151
|
{
|
|
83902
|
-
className: "p-ds-1 rounded-[var(--ds-radius-sm)] hover:bg-[var(--ds-bg-
|
|
84152
|
+
className: "p-ds-1 rounded-[var(--ds-radius-sm)] hover:bg-[var(--ds-bg-emphasis)] cursor-pointer text-[var(--ds-text-secondary)]",
|
|
83903
84153
|
onClick: () => setRangeStart(rangeStart + 9),
|
|
83904
84154
|
"aria-label": "Next years",
|
|
83905
84155
|
children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 14 })
|
|
@@ -83912,7 +84162,7 @@ function YearDropdown({
|
|
|
83912
84162
|
className: cn(
|
|
83913
84163
|
"px-ds-2 py-ds-1.5 text-xs font-medium rounded-[var(--ds-radius-sm)] cursor-pointer transition-colors",
|
|
83914
84164
|
"focus-visible:outline-none focus-visible:shadow-[var(--ds-shadow-focus)]",
|
|
83915
|
-
y === currentYear ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-
|
|
84165
|
+
y === currentYear ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)]" : "text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-emphasis)] hover:text-[var(--ds-text-primary)]"
|
|
83916
84166
|
),
|
|
83917
84167
|
onClick: () => {
|
|
83918
84168
|
onSelect(new Date(y, currentDate.getMonth(), 1));
|
|
@@ -83942,6 +84192,7 @@ function Calendar({
|
|
|
83942
84192
|
onDayClick,
|
|
83943
84193
|
categories = DEFAULT_CATEGORIES,
|
|
83944
84194
|
weekStartsOn = 1,
|
|
84195
|
+
size = "default",
|
|
83945
84196
|
className
|
|
83946
84197
|
}) {
|
|
83947
84198
|
const [currentView, setCurrentView] = useControllableState(
|
|
@@ -83955,14 +84206,12 @@ function Calendar({
|
|
|
83955
84206
|
onDateChange
|
|
83956
84207
|
);
|
|
83957
84208
|
const [selectedDate, setSelectedDate] = useState(null);
|
|
83958
|
-
const [
|
|
84209
|
+
const [isNarrow, setIsNarrow] = useState(false);
|
|
83959
84210
|
const containerRef = useCallback((node) => {
|
|
83960
84211
|
if (!node) return;
|
|
83961
84212
|
const ro = new ResizeObserver((entries) => {
|
|
83962
84213
|
const width = entries[0]?.contentRect.width ?? 0;
|
|
83963
|
-
|
|
83964
|
-
else if (width < 768) setWeekVisibleDays(3);
|
|
83965
|
-
else setWeekVisibleDays(7);
|
|
84214
|
+
setIsNarrow(width < 500);
|
|
83966
84215
|
});
|
|
83967
84216
|
ro.observe(node);
|
|
83968
84217
|
return () => ro.disconnect();
|
|
@@ -84020,6 +84269,79 @@ function Calendar({
|
|
|
84020
84269
|
if (currentView === "week") return formatWeekRange(currentDate, weekStartsOn);
|
|
84021
84270
|
return void 0;
|
|
84022
84271
|
}, [currentView, currentDate, weekStartsOn]);
|
|
84272
|
+
if (size === "compact") {
|
|
84273
|
+
return /* @__PURE__ */ jsxs(
|
|
84274
|
+
"div",
|
|
84275
|
+
{
|
|
84276
|
+
className: cn(
|
|
84277
|
+
"flex flex-col",
|
|
84278
|
+
"bg-[var(--ds-bg-surface)]",
|
|
84279
|
+
"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]",
|
|
84280
|
+
"rounded-[var(--ds-radius-md)]",
|
|
84281
|
+
"shadow-[var(--ds-shadow-sm)]",
|
|
84282
|
+
"overflow-hidden",
|
|
84283
|
+
className
|
|
84284
|
+
),
|
|
84285
|
+
children: [
|
|
84286
|
+
/* @__PURE__ */ jsxs(
|
|
84287
|
+
"div",
|
|
84288
|
+
{
|
|
84289
|
+
className: cn(
|
|
84290
|
+
"flex items-center justify-between",
|
|
84291
|
+
"bg-[var(--ds-bg-muted)]",
|
|
84292
|
+
"border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]"
|
|
84293
|
+
),
|
|
84294
|
+
style: { padding: "var(--ds-space-1) var(--ds-space-1)" },
|
|
84295
|
+
children: [
|
|
84296
|
+
/* @__PURE__ */ jsx(
|
|
84297
|
+
"button",
|
|
84298
|
+
{
|
|
84299
|
+
onClick: () => navigate(-1),
|
|
84300
|
+
className: "flex items-center justify-center w-8 h-8 rounded-[var(--ds-radius-sm)] text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-surface)] hover:text-[var(--ds-text-primary)] transition-colors cursor-pointer",
|
|
84301
|
+
"aria-label": "Previous month",
|
|
84302
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "chevron-left", size: 16 })
|
|
84303
|
+
}
|
|
84304
|
+
),
|
|
84305
|
+
/* @__PURE__ */ jsxs(
|
|
84306
|
+
"button",
|
|
84307
|
+
{
|
|
84308
|
+
onClick: goToToday,
|
|
84309
|
+
className: "text-sm font-medium text-[var(--ds-text-primary)] hover:text-[var(--ds-accent-primary)] transition-colors cursor-pointer px-ds-2",
|
|
84310
|
+
children: [
|
|
84311
|
+
MONTH_NAMES[currentDate.getMonth()],
|
|
84312
|
+
" ",
|
|
84313
|
+
currentDate.getFullYear()
|
|
84314
|
+
]
|
|
84315
|
+
}
|
|
84316
|
+
),
|
|
84317
|
+
/* @__PURE__ */ jsx(
|
|
84318
|
+
"button",
|
|
84319
|
+
{
|
|
84320
|
+
onClick: () => navigate(1),
|
|
84321
|
+
className: "flex items-center justify-center w-8 h-8 rounded-[var(--ds-radius-sm)] text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-surface)] hover:text-[var(--ds-text-primary)] transition-colors cursor-pointer",
|
|
84322
|
+
"aria-label": "Next month",
|
|
84323
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 16 })
|
|
84324
|
+
}
|
|
84325
|
+
)
|
|
84326
|
+
]
|
|
84327
|
+
}
|
|
84328
|
+
),
|
|
84329
|
+
/* @__PURE__ */ jsx(
|
|
84330
|
+
CompactMonthView,
|
|
84331
|
+
{
|
|
84332
|
+
date: currentDate,
|
|
84333
|
+
events: stableEvents,
|
|
84334
|
+
categories,
|
|
84335
|
+
selectedDate,
|
|
84336
|
+
onDayClick: handleDayClick,
|
|
84337
|
+
onEventClick,
|
|
84338
|
+
weekStartsOn
|
|
84339
|
+
}
|
|
84340
|
+
)
|
|
84341
|
+
]
|
|
84342
|
+
}
|
|
84343
|
+
);
|
|
84344
|
+
}
|
|
84023
84345
|
return /* @__PURE__ */ jsxs(
|
|
84024
84346
|
"div",
|
|
84025
84347
|
{
|
|
@@ -84034,20 +84356,49 @@ function Calendar({
|
|
|
84034
84356
|
className
|
|
84035
84357
|
),
|
|
84036
84358
|
children: [
|
|
84037
|
-
/* @__PURE__ */ jsxs(
|
|
84359
|
+
isNarrow ? /* @__PURE__ */ jsxs(
|
|
84038
84360
|
"div",
|
|
84039
84361
|
{
|
|
84040
84362
|
className: cn(
|
|
84041
|
-
"
|
|
84363
|
+
"flex flex-col gap-ds-2",
|
|
84364
|
+
"bg-[var(--ds-bg-muted)]",
|
|
84365
|
+
"border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]"
|
|
84366
|
+
),
|
|
84367
|
+
style: { padding: "var(--ds-space-3)" },
|
|
84368
|
+
children: [
|
|
84369
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-ds-2", children: [
|
|
84370
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => navigate(-1), "aria-label": "Previous", children: /* @__PURE__ */ jsx(Icon, { name: "chevron-left", size: 14 }) }),
|
|
84371
|
+
currentView === "week" ? /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-[var(--ds-text-primary)] whitespace-nowrap px-ds-1", children: headerLabel }) : currentView === "year" ? /* @__PURE__ */ jsx(YearDropdown, { currentDate, onSelect: setCurrentDate }) : /* @__PURE__ */ jsx(MonthDropdown, { currentDate, onSelect: setCurrentDate }),
|
|
84372
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => navigate(1), "aria-label": "Next", children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 14 }) })
|
|
84373
|
+
] }),
|
|
84374
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-ds-2", children: [
|
|
84375
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: goToToday, children: "Today" }),
|
|
84376
|
+
/* @__PURE__ */ jsx(
|
|
84377
|
+
SegmentedControl,
|
|
84378
|
+
{
|
|
84379
|
+
value: currentView,
|
|
84380
|
+
onChange: (v) => setCurrentView(v),
|
|
84381
|
+
options: VIEWS.map((v) => ({ value: v, label: viewLabels[v] })),
|
|
84382
|
+
size: "sm"
|
|
84383
|
+
}
|
|
84384
|
+
)
|
|
84385
|
+
] })
|
|
84386
|
+
]
|
|
84387
|
+
}
|
|
84388
|
+
) : /* @__PURE__ */ jsxs(
|
|
84389
|
+
"div",
|
|
84390
|
+
{
|
|
84391
|
+
className: cn(
|
|
84392
|
+
"flex items-center justify-between gap-ds-3",
|
|
84042
84393
|
"bg-[var(--ds-bg-muted)]",
|
|
84043
84394
|
"border-b-[length:var(--ds-divider-width)] border-[var(--ds-border-subtle)]"
|
|
84044
84395
|
),
|
|
84045
84396
|
style: { padding: "var(--ds-space-2) var(--ds-space-3)" },
|
|
84046
84397
|
children: [
|
|
84047
84398
|
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: goToToday, children: "Today" }),
|
|
84048
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center
|
|
84049
|
-
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => navigate(-1), "aria-label": "Previous", children: /* @__PURE__ */ jsx(Icon, { name: "chevron-
|
|
84050
|
-
currentView === "week" ? /* @__PURE__ */ jsx("span", { className: "text-sm font-
|
|
84399
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-ds-1", children: [
|
|
84400
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => navigate(-1), "aria-label": "Previous", children: /* @__PURE__ */ jsx(Icon, { name: "chevron-left", size: 14 }) }),
|
|
84401
|
+
currentView === "week" ? /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-[var(--ds-text-primary)] whitespace-nowrap px-ds-2", children: headerLabel }) : currentView === "year" ? /* @__PURE__ */ jsx(YearDropdown, { currentDate, onSelect: setCurrentDate }) : /* @__PURE__ */ jsx(MonthDropdown, { currentDate, onSelect: setCurrentDate }),
|
|
84051
84402
|
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => navigate(1), "aria-label": "Next", children: /* @__PURE__ */ jsx(Icon, { name: "chevron-right", size: 14 }) })
|
|
84052
84403
|
] }),
|
|
84053
84404
|
/* @__PURE__ */ jsx(
|
|
@@ -84056,14 +84407,13 @@ function Calendar({
|
|
|
84056
84407
|
value: currentView,
|
|
84057
84408
|
onChange: (v) => setCurrentView(v),
|
|
84058
84409
|
options: VIEWS.map((v) => ({ value: v, label: viewLabels[v] })),
|
|
84059
|
-
size: "sm"
|
|
84060
|
-
variant: "ghost"
|
|
84410
|
+
size: "sm"
|
|
84061
84411
|
}
|
|
84062
84412
|
)
|
|
84063
84413
|
]
|
|
84064
84414
|
}
|
|
84065
84415
|
),
|
|
84066
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-h-0", style: { minHeight: currentView === "week" ? 420 : currentView === "month" ? 500 : void 0 }, children: [
|
|
84416
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-h-0", style: { minHeight: currentView === "week" ? 420 : currentView === "month" ? isNarrow ? 360 : 500 : void 0 }, children: [
|
|
84067
84417
|
currentView === "month" && /* @__PURE__ */ jsx(
|
|
84068
84418
|
MonthView,
|
|
84069
84419
|
{
|
|
@@ -84085,8 +84435,7 @@ function Calendar({
|
|
|
84085
84435
|
selectedDate,
|
|
84086
84436
|
onDayClick: handleDayClick,
|
|
84087
84437
|
onEventClick,
|
|
84088
|
-
weekStartsOn
|
|
84089
|
-
visibleDays: weekVisibleDays
|
|
84438
|
+
weekStartsOn
|
|
84090
84439
|
}
|
|
84091
84440
|
),
|
|
84092
84441
|
currentView === "year" && /* @__PURE__ */ jsx(
|
|
@@ -84137,7 +84486,7 @@ var dotVariant = {
|
|
|
84137
84486
|
warning: "bg-[var(--ds-status-warning)] shadow-[0_0_0_3px_var(--ds-status-warning)]/20",
|
|
84138
84487
|
error: "bg-[var(--ds-status-error)] shadow-[0_0_0_3px_var(--ds-status-error)]/20"
|
|
84139
84488
|
};
|
|
84140
|
-
function
|
|
84489
|
+
function HorizontalLayout({ items, className }) {
|
|
84141
84490
|
return /* @__PURE__ */ jsx("div", { className: cn("flex items-start", className), children: items.map((item, i) => {
|
|
84142
84491
|
const isFirst = i === 0;
|
|
84143
84492
|
const isLast = i === items.length - 1;
|
|
@@ -84179,7 +84528,7 @@ function TimelineHorizontal({ items, className }) {
|
|
|
84179
84528
|
] }, i);
|
|
84180
84529
|
}) });
|
|
84181
84530
|
}
|
|
84182
|
-
function
|
|
84531
|
+
function VerticalLayout({ items, className }) {
|
|
84183
84532
|
return /* @__PURE__ */ jsx("div", { className: cn("relative", className), children: items.map((item, i) => /* @__PURE__ */ jsxs("div", { className: "flex gap-ds-4", children: [
|
|
84184
84533
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
84185
84534
|
/* @__PURE__ */ jsx(
|
|
@@ -84202,15 +84551,15 @@ function TimelineVertical({ items, className }) {
|
|
|
84202
84551
|
}
|
|
84203
84552
|
function Timeline({ items, orientation = "vertical", className, ref }) {
|
|
84204
84553
|
if (orientation === "horizontal") {
|
|
84205
|
-
return /* @__PURE__ */ jsx("div", { ref, className, children: /* @__PURE__ */ jsx(
|
|
84554
|
+
return /* @__PURE__ */ jsx("div", { ref, className, children: /* @__PURE__ */ jsx(HorizontalLayout, { items }) });
|
|
84206
84555
|
}
|
|
84207
84556
|
if (orientation === "responsive") {
|
|
84208
84557
|
return /* @__PURE__ */ jsxs("div", { ref, className, children: [
|
|
84209
|
-
/* @__PURE__ */ jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsx(
|
|
84210
|
-
/* @__PURE__ */ jsx("div", { className: "md:hidden", children: /* @__PURE__ */ jsx(
|
|
84558
|
+
/* @__PURE__ */ jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsx(HorizontalLayout, { items }) }),
|
|
84559
|
+
/* @__PURE__ */ jsx("div", { className: "md:hidden", children: /* @__PURE__ */ jsx(VerticalLayout, { items }) })
|
|
84211
84560
|
] });
|
|
84212
84561
|
}
|
|
84213
|
-
return /* @__PURE__ */ jsx("div", { ref, className, children: /* @__PURE__ */ jsx(
|
|
84562
|
+
return /* @__PURE__ */ jsx("div", { ref, className, children: /* @__PURE__ */ jsx(VerticalLayout, { items }) });
|
|
84214
84563
|
}
|
|
84215
84564
|
function CodeBlock2({
|
|
84216
84565
|
code,
|
|
@@ -84706,13 +85055,13 @@ function Carousel({
|
|
|
84706
85055
|
"div",
|
|
84707
85056
|
{
|
|
84708
85057
|
ref: trackRef,
|
|
84709
|
-
className: cn("flex", !dragging && "transition-transform duration-
|
|
85058
|
+
className: cn("flex items-stretch", !dragging && "transition-transform duration-400 ease-[var(--ds-transition-ease)]"),
|
|
84710
85059
|
style: { transform: `translateX(calc(-${current * 100}% + ${dragOffset}px))` },
|
|
84711
85060
|
onPointerDown: handlePointerDown,
|
|
84712
85061
|
onPointerMove: handlePointerMove,
|
|
84713
85062
|
onPointerUp: handlePointerUp,
|
|
84714
85063
|
onPointerCancel: handlePointerUp,
|
|
84715
|
-
children: children.map((child, i) => /* @__PURE__ */ jsx("div", { className: "w-full shrink-0 select-none", "aria-roledescription": "slide", "aria-label": `Slide ${i + 1} of ${count2}`, children: child }, i))
|
|
85064
|
+
children: children.map((child, i) => /* @__PURE__ */ jsx("div", { className: "w-full shrink-0 select-none flex flex-col [&>*]:flex-1", "aria-roledescription": "slide", "aria-label": `Slide ${i + 1} of ${count2}`, children: child }, i))
|
|
84716
85065
|
}
|
|
84717
85066
|
),
|
|
84718
85067
|
showArrows && count2 > 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -84723,7 +85072,7 @@ function Carousel({
|
|
|
84723
85072
|
disabled: !canPrev,
|
|
84724
85073
|
"aria-label": "Previous slide",
|
|
84725
85074
|
className: cn(
|
|
84726
|
-
"absolute left-4 top-1/2 -translate-y-1/2 z-10",
|
|
85075
|
+
"absolute left-ds-4 top-1/2 -translate-y-1/2 z-10",
|
|
84727
85076
|
"flex items-center justify-center w-8 h-8",
|
|
84728
85077
|
"rounded-[var(--ds-radius-full)]",
|
|
84729
85078
|
"bg-[var(--ds-bg-surface-elevated)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
|
|
@@ -84742,7 +85091,7 @@ function Carousel({
|
|
|
84742
85091
|
disabled: !canNext,
|
|
84743
85092
|
"aria-label": "Next slide",
|
|
84744
85093
|
className: cn(
|
|
84745
|
-
"absolute right-4 top-1/2 -translate-y-1/2 z-10",
|
|
85094
|
+
"absolute right-ds-4 top-1/2 -translate-y-1/2 z-10",
|
|
84746
85095
|
"flex items-center justify-center w-8 h-8",
|
|
84747
85096
|
"rounded-[var(--ds-radius-full)]",
|
|
84748
85097
|
"bg-[var(--ds-bg-surface-elevated)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
|
|
@@ -84755,7 +85104,7 @@ function Carousel({
|
|
|
84755
85104
|
}
|
|
84756
85105
|
)
|
|
84757
85106
|
] }),
|
|
84758
|
-
showIndicators && count2 > 1 && /* @__PURE__ */ jsx("div", { className: "absolute bottom-3 left-1/2 -translate-x-1/2 flex gap-ds-1.5 z-10", children: children.map((_, i) => /* @__PURE__ */ jsx(
|
|
85107
|
+
showIndicators && count2 > 1 && /* @__PURE__ */ jsx("div", { className: "absolute bottom-ds-3 left-1/2 -translate-x-1/2 flex gap-ds-1.5 z-10", children: children.map((_, i) => /* @__PURE__ */ jsx(
|
|
84759
85108
|
"button",
|
|
84760
85109
|
{
|
|
84761
85110
|
onClick: () => goTo(i),
|
|
@@ -92151,7 +92500,7 @@ function SortableCard({
|
|
|
92151
92500
|
...attributes,
|
|
92152
92501
|
...listeners,
|
|
92153
92502
|
className: cn(
|
|
92154
|
-
"rounded-[var(--ds-radius-md)] border
|
|
92503
|
+
"rounded-[var(--ds-radius-md)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
|
|
92155
92504
|
"bg-[var(--ds-bg-surface)] p-ds-3 cursor-grab active:cursor-grabbing",
|
|
92156
92505
|
"shadow-[var(--ds-shadow-button)]",
|
|
92157
92506
|
"transition-shadow duration-[var(--ds-transition-speed)]",
|
|
@@ -92163,7 +92512,7 @@ function SortableCard({
|
|
|
92163
92512
|
);
|
|
92164
92513
|
}
|
|
92165
92514
|
function DefaultCard({ card }) {
|
|
92166
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
92515
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-ds-2", children: [
|
|
92167
92516
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[var(--ds-text-primary)]", children: card.title }),
|
|
92168
92517
|
card.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--ds-text-secondary)] line-clamp-2", children: card.description }),
|
|
92169
92518
|
card.tags && card.tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-ds-1", children: card.tags.map((tag) => /* @__PURE__ */ jsx(Badge, { variant: "subtle", size: "sm", children: tag }, tag)) })
|
|
@@ -92177,7 +92526,7 @@ function OverlayCard({
|
|
|
92177
92526
|
"div",
|
|
92178
92527
|
{
|
|
92179
92528
|
className: cn(
|
|
92180
|
-
"rounded-[var(--ds-radius-md)] border
|
|
92529
|
+
"rounded-[var(--ds-radius-md)] border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]",
|
|
92181
92530
|
"bg-[var(--ds-bg-surface)] p-ds-3 shadow-[var(--ds-shadow-card)]",
|
|
92182
92531
|
"rotate-2"
|
|
92183
92532
|
),
|
|
@@ -92277,13 +92626,13 @@ function KanbanBoard({
|
|
|
92277
92626
|
onDragOver: handleDragOver,
|
|
92278
92627
|
onDragEnd: handleDragEnd,
|
|
92279
92628
|
children: [
|
|
92280
|
-
/* @__PURE__ */ jsx("div", { className: cn("flex gap-ds-4 overflow-x-auto pb-ds-2", className), children: columns.map((col) => /* @__PURE__ */ jsxs(
|
|
92629
|
+
/* @__PURE__ */ jsx("div", { className: cn("flex gap-ds-4 overflow-x-auto pb-ds-2 snap-x snap-mandatory sm:snap-none", className), children: columns.map((col) => /* @__PURE__ */ jsxs(
|
|
92281
92630
|
"div",
|
|
92282
92631
|
{
|
|
92283
92632
|
className: cn(
|
|
92284
|
-
"flex flex-col shrink-0 w-[280px]",
|
|
92633
|
+
"flex flex-col shrink-0 w-[calc(100vw-4rem)] sm:w-[280px] snap-center",
|
|
92285
92634
|
"bg-[var(--ds-bg-muted)] rounded-[var(--ds-radius-lg)]",
|
|
92286
|
-
"border
|
|
92635
|
+
"border-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]"
|
|
92287
92636
|
),
|
|
92288
92637
|
children: [
|
|
92289
92638
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-ds-3 py-ds-2.5", children: [
|
|
@@ -92338,7 +92687,7 @@ function TypingIndicator({ name }) {
|
|
|
92338
92687
|
"div",
|
|
92339
92688
|
{
|
|
92340
92689
|
className: cn(
|
|
92341
|
-
"flex items-center gap-ds-1 px-ds-3 py-ds-2.5 rounded-
|
|
92690
|
+
"flex items-center gap-ds-1 px-ds-3 py-ds-2.5 rounded-[var(--ds-radius-xl)] rounded-bl-[var(--ds-radius-sm)]",
|
|
92342
92691
|
"bg-[var(--ds-bg-muted)]"
|
|
92343
92692
|
),
|
|
92344
92693
|
children: [
|
|
@@ -92356,70 +92705,97 @@ function TypingIndicator({ name }) {
|
|
|
92356
92705
|
}
|
|
92357
92706
|
function ChatInputBar({ onSend }) {
|
|
92358
92707
|
const [text2, setText] = useState("");
|
|
92708
|
+
const isMobile = useBreakpoint("sm");
|
|
92359
92709
|
const handleSend = () => {
|
|
92360
92710
|
if (!text2.trim()) return;
|
|
92361
92711
|
onSend?.(text2.trim());
|
|
92362
92712
|
setText("");
|
|
92363
92713
|
};
|
|
92364
|
-
|
|
92714
|
+
const handleKeyDown3 = (e) => {
|
|
92715
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
92716
|
+
e.preventDefault();
|
|
92717
|
+
handleSend();
|
|
92718
|
+
}
|
|
92719
|
+
};
|
|
92720
|
+
return /* @__PURE__ */ jsx("div", { className: "shrink-0 px-ds-3 pb-ds-3 pt-ds-1", children: /* @__PURE__ */ jsxs(
|
|
92365
92721
|
"div",
|
|
92366
92722
|
{
|
|
92367
92723
|
className: cn(
|
|
92368
|
-
"flex
|
|
92369
|
-
"
|
|
92370
|
-
"
|
|
92724
|
+
"flex flex-col",
|
|
92725
|
+
"rounded-[var(--ds-radius-lg)]",
|
|
92726
|
+
"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]",
|
|
92727
|
+
"bg-[var(--ds-input-bg)]",
|
|
92728
|
+
"shadow-[var(--ds-input-shadow)]",
|
|
92729
|
+
"focus-within:ring-2 focus-within:ring-[var(--ds-input-focus-ring)] focus-within:border-[var(--ds-input-focus-ring)]",
|
|
92730
|
+
"transition-colors duration-[var(--ds-transition-speed)]"
|
|
92371
92731
|
),
|
|
92372
92732
|
children: [
|
|
92373
92733
|
/* @__PURE__ */ jsx(
|
|
92374
|
-
|
|
92734
|
+
"textarea",
|
|
92375
92735
|
{
|
|
92376
|
-
|
|
92377
|
-
|
|
92378
|
-
|
|
92379
|
-
|
|
92380
|
-
children: /* @__PURE__ */ jsx(Icon, { name: "paperclip", size: 16 })
|
|
92381
|
-
}
|
|
92382
|
-
),
|
|
92383
|
-
/* @__PURE__ */ jsx(
|
|
92384
|
-
Input,
|
|
92385
|
-
{
|
|
92386
|
-
value: text2,
|
|
92387
|
-
onChange: (e) => setText(e.target.value),
|
|
92388
|
-
onKeyDown: (e) => {
|
|
92389
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
92390
|
-
e.preventDefault();
|
|
92391
|
-
handleSend();
|
|
92736
|
+
ref: (el) => {
|
|
92737
|
+
if (el) {
|
|
92738
|
+
el.style.height = "auto";
|
|
92739
|
+
el.style.height = Math.min(el.scrollHeight, 120) + "px";
|
|
92392
92740
|
}
|
|
92393
92741
|
},
|
|
92742
|
+
value: text2,
|
|
92743
|
+
onChange: (e) => {
|
|
92744
|
+
setText(e.target.value);
|
|
92745
|
+
const el = e.target;
|
|
92746
|
+
el.style.height = "auto";
|
|
92747
|
+
el.style.height = Math.min(el.scrollHeight, 120) + "px";
|
|
92748
|
+
},
|
|
92749
|
+
onKeyDown: handleKeyDown3,
|
|
92394
92750
|
placeholder: "Type a message\u2026",
|
|
92395
|
-
|
|
92396
|
-
|
|
92397
|
-
|
|
92398
|
-
|
|
92399
|
-
|
|
92400
|
-
|
|
92401
|
-
|
|
92402
|
-
size: "icon",
|
|
92403
|
-
"aria-label": "Voice message",
|
|
92404
|
-
className: "shrink-0 h-ds-8 w-ds-8",
|
|
92405
|
-
children: /* @__PURE__ */ jsx(Icon, { name: "mic", size: 16 })
|
|
92751
|
+
rows: 1,
|
|
92752
|
+
className: cn(
|
|
92753
|
+
"w-full resize-none bg-transparent px-ds-3 pt-ds-3 pb-ds-2",
|
|
92754
|
+
"text-sm text-[var(--ds-text-primary)] placeholder:text-[var(--ds-text-muted)]",
|
|
92755
|
+
"outline-none overflow-y-auto"
|
|
92756
|
+
),
|
|
92757
|
+
style: { maxHeight: 120 }
|
|
92406
92758
|
}
|
|
92407
92759
|
),
|
|
92408
|
-
/* @__PURE__ */
|
|
92409
|
-
|
|
92410
|
-
|
|
92411
|
-
|
|
92412
|
-
|
|
92413
|
-
|
|
92414
|
-
|
|
92415
|
-
|
|
92416
|
-
|
|
92417
|
-
|
|
92418
|
-
|
|
92419
|
-
|
|
92760
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-ds-2 pb-ds-1.5", children: [
|
|
92761
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-ds-0.5", children: [
|
|
92762
|
+
/* @__PURE__ */ jsx(
|
|
92763
|
+
Button,
|
|
92764
|
+
{
|
|
92765
|
+
variant: "ghost",
|
|
92766
|
+
size: "icon-sm",
|
|
92767
|
+
"aria-label": "Add attachment",
|
|
92768
|
+
className: isMobile ? "!h-6 !w-6" : void 0,
|
|
92769
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "paperclip", size: isMobile ? 13 : 15 })
|
|
92770
|
+
}
|
|
92771
|
+
),
|
|
92772
|
+
/* @__PURE__ */ jsx(
|
|
92773
|
+
Button,
|
|
92774
|
+
{
|
|
92775
|
+
variant: "ghost",
|
|
92776
|
+
size: "icon-sm",
|
|
92777
|
+
"aria-label": "Voice message",
|
|
92778
|
+
className: isMobile ? "!h-6 !w-6" : void 0,
|
|
92779
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "mic", size: isMobile ? 13 : 15 })
|
|
92780
|
+
}
|
|
92781
|
+
)
|
|
92782
|
+
] }),
|
|
92783
|
+
/* @__PURE__ */ jsx(
|
|
92784
|
+
Button,
|
|
92785
|
+
{
|
|
92786
|
+
variant: text2.trim() ? "default" : "ghost",
|
|
92787
|
+
size: "icon-sm",
|
|
92788
|
+
"aria-label": "Send message",
|
|
92789
|
+
onClick: handleSend,
|
|
92790
|
+
disabled: !text2.trim(),
|
|
92791
|
+
className: isMobile ? "!h-6 !w-6" : void 0,
|
|
92792
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "send", size: isMobile ? 13 : 15 })
|
|
92793
|
+
}
|
|
92794
|
+
)
|
|
92795
|
+
] })
|
|
92420
92796
|
]
|
|
92421
92797
|
}
|
|
92422
|
-
);
|
|
92798
|
+
) });
|
|
92423
92799
|
}
|
|
92424
92800
|
function ChatMessageList({
|
|
92425
92801
|
messages,
|
|
@@ -92465,8 +92841,8 @@ function ChatMessageList({
|
|
|
92465
92841
|
"div",
|
|
92466
92842
|
{
|
|
92467
92843
|
className: cn(
|
|
92468
|
-
"px-ds-3 py-ds-2 text-sm leading-relaxed rounded-
|
|
92469
|
-
msg.isOwn ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)] rounded-br-sm" : "bg-[var(--ds-bg-muted)] text-[var(--ds-text-primary)] rounded-bl-sm"
|
|
92844
|
+
"px-ds-3 py-ds-2 text-sm leading-relaxed rounded-[var(--ds-radius-xl)]",
|
|
92845
|
+
msg.isOwn ? "bg-[var(--ds-accent-primary)] text-[var(--ds-text-on-primary)] rounded-br-[var(--ds-radius-sm)]" : "bg-[var(--ds-bg-muted)] text-[var(--ds-text-primary)] rounded-bl-[var(--ds-radius-sm)]"
|
|
92470
92846
|
),
|
|
92471
92847
|
children: msg.content
|
|
92472
92848
|
}
|
|
@@ -94314,40 +94690,43 @@ function CompactFlyout({
|
|
|
94314
94690
|
onMouseLeave,
|
|
94315
94691
|
className: "fixed z-50",
|
|
94316
94692
|
style: { top: pos.top, left: pos.left, paddingLeft: FLYOUT_BRIDGE_PX, pointerEvents: "auto" },
|
|
94317
|
-
children: /* @__PURE__ */ jsxs(
|
|
94318
|
-
|
|
94319
|
-
|
|
94320
|
-
|
|
94321
|
-
|
|
94322
|
-
|
|
94323
|
-
|
|
94324
|
-
|
|
94325
|
-
|
|
94326
|
-
|
|
94327
|
-
|
|
94328
|
-
"
|
|
94329
|
-
{
|
|
94330
|
-
|
|
94331
|
-
|
|
94332
|
-
|
|
94333
|
-
|
|
94334
|
-
|
|
94335
|
-
|
|
94693
|
+
children: /* @__PURE__ */ jsxs(
|
|
94694
|
+
"div",
|
|
94695
|
+
{
|
|
94696
|
+
role: "menu",
|
|
94697
|
+
className: cn(
|
|
94698
|
+
"min-w-[160px] py-ds-1",
|
|
94699
|
+
"bg-[var(--ds-sidebar-bg)] rounded-[var(--ds-radius-md)]",
|
|
94700
|
+
"shadow-[var(--ds-shadow-dropdown)]",
|
|
94701
|
+
"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]"
|
|
94702
|
+
),
|
|
94703
|
+
children: [
|
|
94704
|
+
/* @__PURE__ */ jsx("p", { className: "px-ds-2 pt-ds-1 pb-ds-1.5 text-2xs font-semibold uppercase tracking-wider text-[var(--ds-sidebar-text-muted)]", children: parentLabel }),
|
|
94705
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col px-ds-1", style: { gap: "var(--ds-space-0\\.5)" }, children: items.map((child, i) => /* @__PURE__ */ jsxs(
|
|
94706
|
+
"a",
|
|
94707
|
+
{
|
|
94708
|
+
href: child.href ?? "#",
|
|
94709
|
+
role: "menuitem",
|
|
94710
|
+
onClick: (e) => {
|
|
94711
|
+
e.preventDefault();
|
|
94712
|
+
onItemClick?.(child, i);
|
|
94713
|
+
onClose();
|
|
94714
|
+
},
|
|
94715
|
+
className: cn(
|
|
94716
|
+
"flex items-center gap-ds-2 px-ds-2 py-ds-1.5 text-xs rounded-[var(--ds-radius-sm)] transition-colors cursor-pointer",
|
|
94717
|
+
child.active ? "bg-sidebar-accent-subtle text-[var(--ds-sidebar-accent)] font-medium" : "text-[var(--ds-sidebar-text-secondary)] hover:bg-[var(--ds-sidebar-item-hover)] hover:text-[var(--ds-sidebar-text)]"
|
|
94718
|
+
),
|
|
94719
|
+
children: [
|
|
94720
|
+
child.icon && /* @__PURE__ */ jsx(Icon, { name: child.icon, size: 14 }),
|
|
94721
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: child.label }),
|
|
94722
|
+
child.badge && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: child.badge })
|
|
94723
|
+
]
|
|
94336
94724
|
},
|
|
94337
|
-
|
|
94338
|
-
|
|
94339
|
-
|
|
94340
|
-
|
|
94341
|
-
|
|
94342
|
-
child.icon && /* @__PURE__ */ jsx(Icon, { name: child.icon, size: 14 }),
|
|
94343
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: child.label }),
|
|
94344
|
-
child.badge && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: child.badge })
|
|
94345
|
-
]
|
|
94346
|
-
},
|
|
94347
|
-
child.label
|
|
94348
|
-
)) })
|
|
94349
|
-
]
|
|
94350
|
-
})
|
|
94725
|
+
child.label
|
|
94726
|
+
)) })
|
|
94727
|
+
]
|
|
94728
|
+
}
|
|
94729
|
+
)
|
|
94351
94730
|
}
|
|
94352
94731
|
);
|
|
94353
94732
|
return createPortal(content, portalContainer ?? document.body);
|
|
@@ -94542,7 +94921,7 @@ function SidebarNav({
|
|
|
94542
94921
|
"div",
|
|
94543
94922
|
{
|
|
94544
94923
|
className: cn(
|
|
94545
|
-
isMinimal ? "ml-5 pl-2" : "ml-5 pl-3 border-l-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]"
|
|
94924
|
+
isMinimal ? "ml-ds-5 pl-ds-2" : "ml-ds-5 pl-ds-3 border-l-[length:var(--ds-border-width)] border-[var(--ds-border-subtle)]"
|
|
94546
94925
|
),
|
|
94547
94926
|
style: { marginTop: "var(--ds-space-1)", marginBottom: "var(--ds-space-1)" },
|
|
94548
94927
|
children: /* @__PURE__ */ jsx("div", { className: "flex flex-col", style: { gap: "var(--ds-space-0\\.5)" }, children: item.children.map((child, i) => renderItem(child, depth + 1, i, key2)) })
|
|
@@ -94668,7 +95047,7 @@ function CompactNavItem({
|
|
|
94668
95047
|
onCancelClose();
|
|
94669
95048
|
if (hasChildren && !isOpen) onOpen(flyoutKey);
|
|
94670
95049
|
}, [hasChildren, isOpen, onOpen, onCancelClose, flyoutKey]);
|
|
94671
|
-
const
|
|
95050
|
+
const handleMouseLeave2 = useCallback(() => {
|
|
94672
95051
|
onScheduleClose(flyoutKey);
|
|
94673
95052
|
}, [onScheduleClose, flyoutKey]);
|
|
94674
95053
|
const handleClick2 = () => {
|
|
@@ -94684,7 +95063,7 @@ function CompactNavItem({
|
|
|
94684
95063
|
{
|
|
94685
95064
|
ref: triggerRef,
|
|
94686
95065
|
onMouseEnter: !mobile && hasChildren ? handleMouseEnter : void 0,
|
|
94687
|
-
onMouseLeave: !mobile && hasChildren && isOpen ?
|
|
95066
|
+
onMouseLeave: !mobile && hasChildren && isOpen ? handleMouseLeave2 : void 0,
|
|
94688
95067
|
onClick: handleClick2,
|
|
94689
95068
|
"aria-expanded": hasChildren ? mobile ? expanded : isOpen : void 0,
|
|
94690
95069
|
className: cn(
|
|
@@ -94726,7 +95105,7 @@ function CompactNavItem({
|
|
|
94726
95105
|
onItemClick,
|
|
94727
95106
|
onClose,
|
|
94728
95107
|
onMouseEnter: onCancelClose,
|
|
94729
|
-
onMouseLeave:
|
|
95108
|
+
onMouseLeave: handleMouseLeave2
|
|
94730
95109
|
}
|
|
94731
95110
|
),
|
|
94732
95111
|
mobile && expanded && hasChildren && item.children && /* @__PURE__ */ jsx("div", { className: "w-full flex flex-col gap-ds-1 pb-ds-1", children: item.children.map((child, ci) => /* @__PURE__ */ jsxs(
|
|
@@ -95036,7 +95415,7 @@ function Dock({
|
|
|
95036
95415
|
className: cn(
|
|
95037
95416
|
"relative flex items-center justify-center rounded-[var(--ds-radius-lg)]",
|
|
95038
95417
|
"bg-[var(--ds-bg-surface)] text-[var(--ds-text-primary)]",
|
|
95039
|
-
"border
|
|
95418
|
+
"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]",
|
|
95040
95419
|
"shadow-[var(--ds-shadow-button)]",
|
|
95041
95420
|
"cursor-pointer origin-bottom",
|
|
95042
95421
|
"focus-visible:outline-none focus-visible:shadow-[var(--ds-shadow-focus)]"
|
|
@@ -95733,10 +96112,13 @@ var sizeClasses = {
|
|
|
95733
96112
|
var FOCUSABLE = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])';
|
|
95734
96113
|
function Dialog({ open, onClose, title, description, children, footer, variant = "default", size = "md", alert = false, container, onSubmit }) {
|
|
95735
96114
|
const titleId = useId();
|
|
96115
|
+
const descriptionId = useId();
|
|
95736
96116
|
const isMobile = useBreakpoint("sm");
|
|
95737
96117
|
const overlayRef = useRef(null);
|
|
95738
96118
|
const dialogRef = useRef(null);
|
|
95739
96119
|
const triggerRef = useRef(null);
|
|
96120
|
+
const onCloseRef = useRef(onClose);
|
|
96121
|
+
onCloseRef.current = onClose;
|
|
95740
96122
|
const trapFocus = useCallback((e) => {
|
|
95741
96123
|
if (e.key !== "Tab" || !dialogRef.current) return;
|
|
95742
96124
|
const focusable = dialogRef.current.querySelectorAll(FOCUSABLE);
|
|
@@ -95758,12 +96140,6 @@ function Dialog({ open, onClose, title, description, children, footer, variant =
|
|
|
95758
96140
|
useEffect(() => {
|
|
95759
96141
|
if (!open) return;
|
|
95760
96142
|
triggerRef.current = document.activeElement;
|
|
95761
|
-
const handler = (e) => {
|
|
95762
|
-
if (e.key === "Escape") onClose();
|
|
95763
|
-
trapFocus(e);
|
|
95764
|
-
};
|
|
95765
|
-
document.addEventListener("keydown", handler);
|
|
95766
|
-
lockBodyScroll();
|
|
95767
96143
|
requestAnimationFrame(() => {
|
|
95768
96144
|
const focusable = dialogRef.current?.querySelectorAll(FOCUSABLE);
|
|
95769
96145
|
if (focusable?.length) {
|
|
@@ -95774,12 +96150,26 @@ function Dialog({ open, onClose, title, description, children, footer, variant =
|
|
|
95774
96150
|
}
|
|
95775
96151
|
}
|
|
95776
96152
|
});
|
|
96153
|
+
}, [open, variant]);
|
|
96154
|
+
useEffect(() => {
|
|
96155
|
+
if (!open) return;
|
|
96156
|
+
const handler = (e) => {
|
|
96157
|
+
if (e.key === "Escape") onCloseRef.current();
|
|
96158
|
+
trapFocus(e);
|
|
96159
|
+
};
|
|
96160
|
+
document.addEventListener("keydown", handler);
|
|
95777
96161
|
return () => {
|
|
95778
96162
|
document.removeEventListener("keydown", handler);
|
|
96163
|
+
};
|
|
96164
|
+
}, [open, trapFocus]);
|
|
96165
|
+
useEffect(() => {
|
|
96166
|
+
if (!open) return;
|
|
96167
|
+
lockBodyScroll();
|
|
96168
|
+
return () => {
|
|
95779
96169
|
unlockBodyScroll();
|
|
95780
96170
|
triggerRef.current?.focus();
|
|
95781
96171
|
};
|
|
95782
|
-
}, [open
|
|
96172
|
+
}, [open]);
|
|
95783
96173
|
if (!open) return null;
|
|
95784
96174
|
return createPortal(
|
|
95785
96175
|
/* @__PURE__ */ jsxs(
|
|
@@ -95811,6 +96201,7 @@ function Dialog({ open, onClose, title, description, children, footer, variant =
|
|
|
95811
96201
|
role: alert ? "alertdialog" : "dialog",
|
|
95812
96202
|
"aria-modal": "true",
|
|
95813
96203
|
"aria-labelledby": titleId,
|
|
96204
|
+
"aria-describedby": description ? descriptionId : void 0,
|
|
95814
96205
|
className: cn(
|
|
95815
96206
|
"relative z-10 w-full",
|
|
95816
96207
|
isMobile ? "max-w-none h-full" : sizeClasses[size],
|
|
@@ -95843,7 +96234,7 @@ function Dialog({ open, onClose, title, description, children, footer, variant =
|
|
|
95843
96234
|
children: title
|
|
95844
96235
|
}
|
|
95845
96236
|
),
|
|
95846
|
-
description && /* @__PURE__ */ jsx("p", { className: "mt-ds-2 text-sm text-[var(--ds-text-muted)]", children: description }),
|
|
96237
|
+
description && /* @__PURE__ */ jsx("p", { id: descriptionId, className: "mt-ds-2 text-sm text-[var(--ds-text-muted)]", children: description }),
|
|
95847
96238
|
children && /* @__PURE__ */ jsx("div", { className: "mt-ds-4", children })
|
|
95848
96239
|
] })
|
|
95849
96240
|
] }) }),
|
|
@@ -95983,7 +96374,7 @@ function CommandPalette({ open, onOpenChange, commands, placeholder = "Type a co
|
|
|
95983
96374
|
if (!open) return null;
|
|
95984
96375
|
let flatIdx = 0;
|
|
95985
96376
|
return createPortal(
|
|
95986
|
-
/* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-[9999] flex items-start justify-center pt-[15vh]", children: [
|
|
96377
|
+
/* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-[9999] flex items-start justify-center pt-[15vh] px-ds-4", children: [
|
|
95987
96378
|
/* @__PURE__ */ jsx(
|
|
95988
96379
|
"div",
|
|
95989
96380
|
{
|
|
@@ -96634,7 +97025,7 @@ function NotificationCenter({
|
|
|
96634
97025
|
{
|
|
96635
97026
|
className: cn(
|
|
96636
97027
|
"flex gap-ds-3 px-ds-4 py-ds-3 transition-colors",
|
|
96637
|
-
"hover:bg-[var(--ds-bg-
|
|
97028
|
+
"hover:bg-[var(--ds-bg-emphasis)]",
|
|
96638
97029
|
!n.read && "bg-[color-mix(in_srgb,var(--ds-accent-primary)_5%,transparent)]"
|
|
96639
97030
|
),
|
|
96640
97031
|
children: [
|
|
@@ -96834,7 +97225,7 @@ function Tour({ steps, open, onClose, onComplete, container }) {
|
|
|
96834
97225
|
onClick: handlePrev,
|
|
96835
97226
|
className: cn(
|
|
96836
97227
|
"px-ds-3 py-ds-1.5 text-xs font-medium rounded-[var(--ds-radius-sm)]",
|
|
96837
|
-
"text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-
|
|
97228
|
+
"text-[var(--ds-text-secondary)] hover:bg-[var(--ds-bg-emphasis)]",
|
|
96838
97229
|
"transition-colors cursor-pointer",
|
|
96839
97230
|
"focus-visible:outline-none focus-visible:shadow-[var(--ds-shadow-focus)]"
|
|
96840
97231
|
),
|
|
@@ -99159,23 +99550,28 @@ function Qt({
|
|
|
99159
99550
|
}
|
|
99160
99551
|
Qt.displayName = "Separator";
|
|
99161
99552
|
var DirectionCtx = createContext("horizontal");
|
|
99553
|
+
var MobileCtx = createContext(false);
|
|
99162
99554
|
function ResizablePanelGroup({
|
|
99163
99555
|
className,
|
|
99164
99556
|
direction = "horizontal",
|
|
99557
|
+
stackOnMobile = true,
|
|
99165
99558
|
...props
|
|
99166
99559
|
}) {
|
|
99167
|
-
|
|
99560
|
+
const isMobile = useBreakpoint("sm");
|
|
99561
|
+
const shouldStack = stackOnMobile && isMobile && direction === "horizontal";
|
|
99562
|
+
const effectiveDirection = shouldStack ? "vertical" : direction;
|
|
99563
|
+
return /* @__PURE__ */ jsx(DirectionCtx.Provider, { value: effectiveDirection, children: /* @__PURE__ */ jsx(MobileCtx.Provider, { value: isMobile, children: /* @__PURE__ */ jsx(
|
|
99168
99564
|
Ut,
|
|
99169
99565
|
{
|
|
99170
99566
|
className: cn(
|
|
99171
99567
|
"flex h-full w-full",
|
|
99172
|
-
|
|
99568
|
+
effectiveDirection === "vertical" && "flex-col",
|
|
99173
99569
|
className
|
|
99174
99570
|
),
|
|
99175
|
-
orientation:
|
|
99571
|
+
orientation: effectiveDirection,
|
|
99176
99572
|
...props
|
|
99177
99573
|
}
|
|
99178
|
-
) });
|
|
99574
|
+
) }) });
|
|
99179
99575
|
}
|
|
99180
99576
|
function ResizablePanel({ className, ...props }) {
|
|
99181
99577
|
return /* @__PURE__ */ jsx(Yt, { className: cn("", className), ...props });
|
|
@@ -99186,13 +99582,20 @@ function ResizableHandle({
|
|
|
99186
99582
|
...props
|
|
99187
99583
|
}) {
|
|
99188
99584
|
const direction = useContext(DirectionCtx);
|
|
99585
|
+
const isMobile = useContext(MobileCtx);
|
|
99189
99586
|
const isVertical = direction === "vertical";
|
|
99190
99587
|
return /* @__PURE__ */ jsx(
|
|
99191
99588
|
Qt,
|
|
99192
99589
|
{
|
|
99193
99590
|
className: cn(
|
|
99194
99591
|
"relative flex items-center justify-center bg-[var(--ds-border-default)]",
|
|
99195
|
-
isVertical ?
|
|
99592
|
+
isVertical ? cn(
|
|
99593
|
+
"h-[var(--ds-border-width)] w-full after:absolute after:left-0 after:right-0 after:content-['']",
|
|
99594
|
+
isMobile ? "after:-top-3 after:-bottom-3" : "after:-top-1 after:-bottom-1"
|
|
99595
|
+
) : cn(
|
|
99596
|
+
"w-[var(--ds-border-width)] after:absolute after:inset-y-0 after:content-['']",
|
|
99597
|
+
isMobile ? "after:-left-3 after:-right-3" : "after:-left-1 after:-right-1"
|
|
99598
|
+
),
|
|
99196
99599
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--ds-input-focus-ring)]",
|
|
99197
99600
|
"[&[data-resize-handle-state=drag]]:bg-[var(--ds-accent-primary)]",
|
|
99198
99601
|
"[&[data-resize-handle-state=hover]]:bg-[var(--ds-accent-primary)]",
|
|
@@ -99203,16 +99606,16 @@ function ResizableHandle({
|
|
|
99203
99606
|
"div",
|
|
99204
99607
|
{
|
|
99205
99608
|
className: cn(
|
|
99206
|
-
"z-10 flex items-center justify-center rounded-sm",
|
|
99207
|
-
"border
|
|
99609
|
+
"z-10 flex items-center justify-center rounded-[var(--ds-radius-sm)]",
|
|
99610
|
+
"border-[length:var(--ds-border-width)] border-[var(--ds-border-default)]",
|
|
99208
99611
|
"bg-[var(--ds-bg-surface)]",
|
|
99209
|
-
isVertical ? "h-3 w-4" : "h-4 w-3"
|
|
99612
|
+
isVertical ? isMobile ? "h-4 w-8" : "h-3 w-4" : isMobile ? "h-8 w-4" : "h-4 w-3"
|
|
99210
99613
|
),
|
|
99211
99614
|
children: /* @__PURE__ */ jsx(
|
|
99212
99615
|
Icon,
|
|
99213
99616
|
{
|
|
99214
99617
|
name: "grip-vertical",
|
|
99215
|
-
size: 10,
|
|
99618
|
+
size: isMobile ? 12 : 10,
|
|
99216
99619
|
className: cn(
|
|
99217
99620
|
"text-[var(--ds-text-muted)]",
|
|
99218
99621
|
isVertical && "rotate-90"
|