@mieweb/ui 0.10.0-dev.6 → 0.10.0-dev.7
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/agent/mieweb-ui.instructions.md +13 -1
- package/dist/brands/index.cjs +13 -13
- package/dist/brands/index.js +1 -1
- package/dist/chunk-3YBS4WUQ.js +52 -0
- package/dist/chunk-3YBS4WUQ.js.map +1 -0
- package/dist/chunk-4IS3QCOQ.cjs +453 -0
- package/dist/chunk-4IS3QCOQ.cjs.map +1 -0
- package/dist/chunk-4NCDU5IG.cjs +56 -0
- package/dist/chunk-4NCDU5IG.cjs.map +1 -0
- package/dist/chunk-76TBQDED.js +166 -0
- package/dist/chunk-76TBQDED.js.map +1 -0
- package/dist/chunk-DZ5HFLRC.js +258 -0
- package/dist/chunk-DZ5HFLRC.js.map +1 -0
- package/dist/chunk-G4D6CLBT.js +333 -0
- package/dist/chunk-G4D6CLBT.js.map +1 -0
- package/dist/chunk-IT775BYG.js +179 -0
- package/dist/chunk-IT775BYG.js.map +1 -0
- package/dist/{chunk-ELPW32ZI.cjs → chunk-KQUI4BGS.cjs} +3 -3
- package/dist/{chunk-ELPW32ZI.cjs.map → chunk-KQUI4BGS.cjs.map} +1 -1
- package/dist/{chunk-WNM7IZJ7.js → chunk-MNILXWVY.js} +2 -2
- package/dist/{chunk-WNM7IZJ7.js.map → chunk-MNILXWVY.js.map} +1 -1
- package/dist/chunk-OCSCBB52.cjs +188 -0
- package/dist/chunk-OCSCBB52.cjs.map +1 -0
- package/dist/{chunk-2YCERQWC.js → chunk-TVTIGV7Q.js} +3 -3
- package/dist/{chunk-2YCERQWC.js.map → chunk-TVTIGV7Q.js.map} +1 -1
- package/dist/chunk-URAQIF67.cjs +356 -0
- package/dist/chunk-URAQIF67.cjs.map +1 -0
- package/dist/chunk-VINZZQBD.cjs +323 -0
- package/dist/chunk-VINZZQBD.cjs.map +1 -0
- package/dist/{chunk-U42F3HLE.cjs → chunk-XCENM6ED.cjs} +12 -2
- package/dist/chunk-XCENM6ED.cjs.map +1 -0
- package/dist/chunk-XDIMTPZU.cjs +202 -0
- package/dist/chunk-XDIMTPZU.cjs.map +1 -0
- package/dist/{chunk-JI244Y7C.js → chunk-XEPDIFEA.js} +12 -2
- package/dist/chunk-XEPDIFEA.js.map +1 -0
- package/dist/chunk-XVW5DPPP.js +429 -0
- package/dist/chunk-XVW5DPPP.js.map +1 -0
- package/dist/chunk-XZNN3S3S.cjs +281 -0
- package/dist/chunk-XZNN3S3S.cjs.map +1 -0
- package/dist/chunk-Y4QNLW7W.js +300 -0
- package/dist/chunk-Y4QNLW7W.js.map +1 -0
- package/dist/{chunk-2QKBTPUC.cjs → chunk-ZPSJ2UV6.cjs} +2 -2
- package/dist/{chunk-2QKBTPUC.cjs.map → chunk-ZPSJ2UV6.cjs.map} +1 -1
- package/dist/components/BoardView/index.cjs +24 -0
- package/dist/components/BoardView/index.cjs.map +1 -0
- package/dist/components/BoardView/index.d.cts +42 -0
- package/dist/components/BoardView/index.d.ts +42 -0
- package/dist/components/BoardView/index.js +7 -0
- package/dist/components/BoardView/index.js.map +1 -0
- package/dist/components/CalendarView/index.cjs +22 -0
- package/dist/components/CalendarView/index.cjs.map +1 -0
- package/dist/components/CalendarView/index.d.cts +40 -0
- package/dist/components/CalendarView/index.d.ts +40 -0
- package/dist/components/CalendarView/index.js +9 -0
- package/dist/components/CalendarView/index.js.map +1 -0
- package/dist/components/GanttView/index.cjs +20 -0
- package/dist/components/GanttView/index.cjs.map +1 -0
- package/dist/components/GanttView/index.d.cts +37 -0
- package/dist/components/GanttView/index.d.ts +37 -0
- package/dist/components/GanttView/index.js +7 -0
- package/dist/components/GanttView/index.js.map +1 -0
- package/dist/components/ListView/index.cjs +22 -0
- package/dist/components/ListView/index.cjs.map +1 -0
- package/dist/components/ListView/index.d.cts +37 -0
- package/dist/components/ListView/index.d.ts +37 -0
- package/dist/components/ListView/index.js +9 -0
- package/dist/components/ListView/index.js.map +1 -0
- package/dist/components/Markdown/index.cjs +15 -15
- package/dist/components/Markdown/index.js +3 -3
- package/dist/components/QuickAction/index.d.cts +1 -1
- package/dist/components/QuickAction/index.d.ts +1 -1
- package/dist/components/ViewSet/index.cjs +23 -0
- package/dist/components/ViewSet/index.cjs.map +1 -0
- package/dist/components/ViewSet/index.d.cts +89 -0
- package/dist/components/ViewSet/index.d.ts +89 -0
- package/dist/components/ViewSet/index.js +14 -0
- package/dist/components/ViewSet/index.js.map +1 -0
- package/dist/components/ViewSwitcher/index.cjs +20 -0
- package/dist/components/ViewSwitcher/index.cjs.map +1 -0
- package/dist/components/ViewSwitcher/index.d.cts +40 -0
- package/dist/components/ViewSwitcher/index.d.ts +40 -0
- package/dist/components/ViewSwitcher/index.js +7 -0
- package/dist/components/ViewSwitcher/index.js.map +1 -0
- package/dist/esheet.cjs +5 -5
- package/dist/esheet.js +2 -2
- package/dist/hooks/index.cjs +5 -5
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +439 -372
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +57 -50
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/dist/types-CbWXIKbe.d.cts +119 -0
- package/dist/types-CbWXIKbe.d.ts +119 -0
- package/package.json +1 -1
- package/dist/chunk-JI244Y7C.js.map +0 -1
- package/dist/chunk-U42F3HLE.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ListView/ListView.tsx"],"names":[],"mappings":";;;;;;;;;AAwDA,IAAM,YAAA,GAAe,GAAA;AAAA,EACnB;AAAA,IACE,sEAAA;AAAA,IACA,iBAAA;AAAA,IACA,mBAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,WAAA,EAAa,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\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button';\nimport { Spinner } from '../Spinner';\nimport { ChevronDownIcon, ChevronRightIcon } from '../Icons';\nimport {\n accentClasses,\n defaultViewLabels,\n type Stage,\n type ViewBaseProps,\n} from '../../views/types';\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport type ListViewSlot =\n | 'group'\n | 'groupHeader'\n | 'item'\n | 'selectedItem'\n | 'state';\n\nexport interface ListViewProps<T>\n extends ViewBaseProps<T>, VariantProps<typeof itemVariants> {\n /**\n * Group rows by `accessors.getStatus`, using these stages for order and\n * labels. Items whose status matches no stage are appended under their own\n * heading rather than dropped.\n */\n stages?: readonly Stage[];\n /** Group by `accessors.getGroup` instead of by stage. */\n groupBy?: 'status' | 'group' | 'none';\n /** Groups that start collapsed. Uncontrolled; the user can reopen them. */\n defaultCollapsedGroups?: readonly string[];\n /** Retries the failed load. Renders the retry action only when provided. */\n onRetry?: () => void;\n classNames?: Partial<Record<ListViewSlot, string>>;\n /** Heading level for group headers, under the page's own heading. */\n headingLevel?: 'h2' | 'h3' | 'h4';\n}\n\ninterface Group<T> {\n id: string;\n label: string;\n accent?: Stage['accent'];\n items: T[];\n}\n\n// =============================================================================\n// Variants\n// =============================================================================\n\nconst itemVariants = cva(\n [\n 'flex w-full items-start gap-3 border-b border-border px-3 text-start',\n 'last:border-b-0',\n 'transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring',\n ],\n {\n variants: {\n density: {\n comfortable: 'py-3',\n compact: 'py-2',\n },\n interactive: {\n true: 'cursor-pointer hover:bg-muted',\n false: '',\n },\n selected: {\n true: 'bg-primary-500/10',\n false: '',\n },\n },\n defaultVariants: {\n density: 'comfortable',\n interactive: false,\n selected: false,\n },\n }\n);\n\n// =============================================================================\n// Grouping\n// =============================================================================\n\nfunction buildGroups<T>(\n items: T[],\n groupBy: 'status' | 'group' | 'none',\n accessors: ListViewProps<T>['accessors'],\n ungrouped: string,\n stages?: readonly Stage[]\n): Group<T>[] {\n if (groupBy === 'none') return [{ id: '', label: '', items }];\n\n const read = groupBy === 'status' ? accessors.getStatus : accessors.getGroup;\n if (!read) return [{ id: '', label: '', items }];\n\n const buckets = new Map<string, T[]>();\n for (const item of items) {\n const key = read(item) ?? '';\n const bucket = buckets.get(key);\n if (bucket) bucket.push(item);\n else buckets.set(key, [item]);\n }\n\n const groups: Group<T>[] = [];\n // Stages fix the order, and an empty stage still shows — a board column that\n // disappears when it empties hides the fact that the stage exists. This only\n // applies to `groupBy=\"status\"`: stages name statuses, so seeding them under\n // `groupBy=\"group\"` would print an empty \"Backlog\"/\"In progress\" above the\n // real buckets. `ViewSet` always passes its shared stages, so that case is\n // reachable with nothing more than `listProps={{ groupBy: 'group' }}`.\n for (const stage of (groupBy === 'status' ? stages : undefined) ?? []) {\n groups.push({\n id: stage.id,\n label: stage.label,\n accent: stage.accent,\n items: buckets.get(stage.id) ?? [],\n });\n buckets.delete(stage.id);\n }\n for (const [key, bucket] of buckets) {\n groups.push({ id: key, label: key || ungrouped, items: bucket });\n }\n return groups;\n}\n\n// =============================================================================\n// Component\n// =============================================================================\n\n/**\n * Declared `parameters.catalog.collection` — the three load states below are\n * part of this component's API, not decoration.\n */\nexport function ListView<T>({\n items,\n accessors,\n loading = false,\n error = null,\n selectedId = null,\n onOpen,\n getHref,\n renderItem,\n emptyState,\n labels,\n stages,\n groupBy = stages ? 'status' : 'none',\n defaultCollapsedGroups,\n onRetry,\n density,\n className,\n classNames,\n headingLevel: Heading = 'h3',\n}: ListViewProps<T>) {\n const text = { ...defaultViewLabels, ...labels };\n // Ids come from position, not from the status text: two distinct statuses can\n // normalise to the same string, and a duplicate id makes `aria-labelledby`\n // resolve to the wrong heading.\n const baseId = React.useId();\n const [collapsed, setCollapsed] = React.useState<Set<string>>(\n () => new Set(defaultCollapsedGroups ?? [])\n );\n\n const groups = React.useMemo(\n () => buildGroups(items, groupBy, accessors, text.ungrouped, stages),\n [items, groupBy, accessors, text.ungrouped, stages]\n );\n\n const state = (content: React.ReactNode) => (\n <div\n data-slot=\"list-view-state\"\n className={cn(\n 'text-muted-foreground flex flex-col items-center justify-center gap-2 px-4 py-10 text-center text-sm',\n classNames?.state\n )}\n >\n {content}\n </div>\n );\n\n let body: React.ReactNode;\n if (error) {\n body = state(\n <>\n <p role=\"alert\" className=\"text-destructive\">\n {text.error}\n </p>\n {onRetry && (\n <Button variant=\"ghost\" size=\"sm\" onClick={onRetry}>\n {text.retry}\n </Button>\n )}\n </>\n );\n } else if (loading) {\n // Spinner is the status region and carries the accessible name; the visible\n // copy beside it would otherwise be announced twice.\n body = state(\n <span className=\"flex items-center gap-2\">\n <Spinner size=\"sm\" label={text.loading} />\n <span aria-hidden>{text.loading}</span>\n </span>\n );\n } else if (items.length === 0) {\n body = emptyState ?? state(text.empty);\n } else {\n body = groups.map((group, groupIndex) => {\n const isCollapsed = collapsed.has(group.id);\n const headerId = `${baseId}-group-${groupIndex}`;\n return (\n <section\n key={group.id}\n data-slot=\"list-view-group\"\n className={cn(classNames?.group)}\n >\n {group.label && (\n <Heading className=\"sticky top-0 z-10\">\n <button\n type=\"button\"\n id={headerId}\n aria-expanded={!isCollapsed}\n onClick={() =>\n setCollapsed((prev) => {\n const next = new Set(prev);\n if (!next.delete(group.id)) next.add(group.id);\n return next;\n })\n }\n data-slot=\"list-view-group-header\"\n className={cn(\n 'border-border bg-muted text-muted-foreground flex w-full items-center gap-2 border-b px-3 py-2 text-start text-xs font-semibold tracking-wide uppercase',\n 'focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset',\n classNames?.groupHeader\n )}\n >\n {isCollapsed ? (\n <ChevronRightIcon\n className=\"size-3.5 rtl:rotate-180\"\n aria-hidden\n />\n ) : (\n <ChevronDownIcon className=\"size-3.5\" aria-hidden />\n )}\n {group.accent && (\n <span\n aria-hidden\n className={cn(\n 'size-2 shrink-0 rounded-full',\n accentClasses[group.accent].marker\n )}\n />\n )}\n <span>{group.label}</span>\n <span className=\"ms-auto font-normal tabular-nums\">\n {group.items.length}\n </span>\n </button>\n </Heading>\n )}\n {!isCollapsed && (\n <ul aria-labelledby={group.label ? headerId : undefined}>\n {group.items.map((item) => {\n const id = accessors.getId(item);\n const selected = id === selectedId;\n const accent = accessors.getAccent?.(item);\n const subtitle = accessors.getSubtitle?.(item);\n const content = renderItem?.(item, { view: 'list' }) ?? (\n <>\n {accent && (\n <span\n aria-hidden\n className={cn(\n 'mt-1.5 size-2 shrink-0 rounded-full',\n accentClasses[accent].marker\n )}\n />\n )}\n <span className=\"min-w-0 flex-1\">\n <span className=\"text-foreground block truncate font-medium\">\n {accessors.getTitle(item)}\n </span>\n {subtitle && (\n <span className=\"text-muted-foreground block truncate text-sm\">\n {subtitle}\n </span>\n )}\n </span>\n </>\n );\n const classes = cn(\n itemVariants({\n density,\n interactive: Boolean(onOpen || getHref),\n selected,\n }),\n classNames?.item,\n selected && classNames?.selectedItem\n );\n const href = getHref?.(id, item);\n return (\n <li key={id}>\n {href ? (\n // An anchor, not a handler, so the row is middle-clickable\n // and crawlable; onOpen still runs for router navigation.\n <a\n href={href}\n aria-current={selected ? 'true' : undefined}\n data-slot=\"list-view-item\"\n className={classes}\n onClick={(event) => {\n if (\n !onOpen ||\n event.defaultPrevented ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.button !== 0\n )\n return;\n event.preventDefault();\n onOpen(id, item);\n }}\n >\n {content}\n </a>\n ) : onOpen ? (\n <button\n type=\"button\"\n aria-current={selected ? 'true' : undefined}\n data-slot=\"list-view-item\"\n className={classes}\n onClick={() => onOpen(id, item)}\n >\n {content}\n </button>\n ) : (\n <div data-slot=\"list-view-item\" className={classes}>\n {content}\n </div>\n )}\n </li>\n );\n })}\n {group.items.length === 0 && (\n <li className=\"text-muted-foreground px-3 py-2 text-sm\">\n {text.empty}\n </li>\n )}\n </ul>\n )}\n </section>\n );\n });\n }\n\n return (\n <div\n data-slot=\"list-view\"\n className={cn(\n 'border-border bg-card overflow-hidden rounded-lg border',\n className\n )}\n >\n {body}\n </div>\n );\n}\n\nexport { itemVariants as listViewItemVariants };\n"]}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { defaultViewLabels, toDateTime, accentClasses } from './chunk-3YBS4WUQ.js';
|
|
2
|
+
import { Spinner } from './chunk-UA7E7PDS.js';
|
|
3
|
+
import { ChevronLeft, ChevronRight } from './chunk-BKSPDTX4.js';
|
|
4
|
+
import { Button } from './chunk-GOALNQZ2.js';
|
|
5
|
+
import { cn } from './chunk-TQONQSJO.js';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { DateTime, Info } from 'luxon';
|
|
8
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
var defaultCalendarLabels = {
|
|
11
|
+
...defaultViewLabels,
|
|
12
|
+
empty: "Nothing this month",
|
|
13
|
+
previousMonth: "Previous month",
|
|
14
|
+
nextMonth: "Next month",
|
|
15
|
+
today: "Today",
|
|
16
|
+
more: "{count} more"
|
|
17
|
+
};
|
|
18
|
+
function CalendarView({
|
|
19
|
+
items,
|
|
20
|
+
accessors,
|
|
21
|
+
loading = false,
|
|
22
|
+
error = null,
|
|
23
|
+
selectedId = null,
|
|
24
|
+
onOpen,
|
|
25
|
+
getHref,
|
|
26
|
+
renderItem,
|
|
27
|
+
emptyState,
|
|
28
|
+
labels,
|
|
29
|
+
month,
|
|
30
|
+
defaultMonth,
|
|
31
|
+
onMonthChange,
|
|
32
|
+
timeZone,
|
|
33
|
+
weekStartsOn = 1,
|
|
34
|
+
locale,
|
|
35
|
+
maxPerDay = 3,
|
|
36
|
+
now,
|
|
37
|
+
className,
|
|
38
|
+
classNames,
|
|
39
|
+
hideToolbar = false
|
|
40
|
+
}) {
|
|
41
|
+
const text = { ...defaultCalendarLabels, ...labels };
|
|
42
|
+
const zone = timeZone ?? DateTime.local().zoneName;
|
|
43
|
+
const today = React.useMemo(
|
|
44
|
+
() => DateTime.fromJSDate(now ?? /* @__PURE__ */ new Date(), { zone }).startOf("day"),
|
|
45
|
+
[now, zone]
|
|
46
|
+
);
|
|
47
|
+
const [internalMonth, setInternalMonth] = React.useState(
|
|
48
|
+
() => defaultMonth ? DateTime.fromJSDate(defaultMonth, { zone }).startOf("month") : today.startOf("month")
|
|
49
|
+
);
|
|
50
|
+
const current = React.useMemo(() => {
|
|
51
|
+
const source = month ? DateTime.fromJSDate(month, { zone }) : internalMonth;
|
|
52
|
+
return DateTime.fromObject(
|
|
53
|
+
{ year: source.year, month: source.month, day: 1 },
|
|
54
|
+
{ zone }
|
|
55
|
+
);
|
|
56
|
+
}, [month, internalMonth, zone]);
|
|
57
|
+
const goToMonth = (next) => {
|
|
58
|
+
if (!month) setInternalMonth(next);
|
|
59
|
+
onMonthChange?.(next.toJSDate());
|
|
60
|
+
};
|
|
61
|
+
const gridStart = React.useMemo(() => {
|
|
62
|
+
const first = current.startOf("month");
|
|
63
|
+
const offset = (first.weekday - weekStartsOn + 7) % 7;
|
|
64
|
+
return first.minus({ days: offset });
|
|
65
|
+
}, [current, weekStartsOn]);
|
|
66
|
+
const days = React.useMemo(
|
|
67
|
+
() => Array.from({ length: 42 }, (_, i) => gridStart.plus({ days: i })),
|
|
68
|
+
[gridStart]
|
|
69
|
+
);
|
|
70
|
+
const weeks = React.useMemo(
|
|
71
|
+
() => Array.from({ length: 6 }, (_, i) => days.slice(i * 7, i * 7 + 7)),
|
|
72
|
+
[days]
|
|
73
|
+
);
|
|
74
|
+
const placed = React.useMemo(() => {
|
|
75
|
+
const out = [];
|
|
76
|
+
for (const item of items) {
|
|
77
|
+
const start = toDateTime(accessors.getStart?.(item), zone)?.startOf(
|
|
78
|
+
"day"
|
|
79
|
+
);
|
|
80
|
+
if (!start) continue;
|
|
81
|
+
const rawEnd = toDateTime(accessors.getEnd?.(item), zone)?.startOf("day");
|
|
82
|
+
const end = rawEnd ?? start;
|
|
83
|
+
out.push({
|
|
84
|
+
id: accessors.getId(item),
|
|
85
|
+
item,
|
|
86
|
+
start,
|
|
87
|
+
// A backwards range is data, not a crash: clamp it to one day.
|
|
88
|
+
end: end < start ? start : end
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}, [items, accessors, zone]);
|
|
93
|
+
const byDay = React.useMemo(() => {
|
|
94
|
+
const map = /* @__PURE__ */ new Map();
|
|
95
|
+
for (const day of days) {
|
|
96
|
+
const key = day.toISODate() ?? "";
|
|
97
|
+
map.set(
|
|
98
|
+
key,
|
|
99
|
+
placed.filter((p) => p.start <= day && day <= p.end)
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
return map;
|
|
103
|
+
}, [days, placed]);
|
|
104
|
+
const weekdayNames = React.useMemo(() => {
|
|
105
|
+
const names = Info.weekdays("short", { locale });
|
|
106
|
+
return Array.from(
|
|
107
|
+
{ length: 7 },
|
|
108
|
+
(_, i) => names[(weekStartsOn - 1 + i) % 7]
|
|
109
|
+
);
|
|
110
|
+
}, [locale, weekStartsOn]);
|
|
111
|
+
const state = (content) => /* @__PURE__ */ jsx(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
"data-slot": "calendar-view-state",
|
|
115
|
+
className: cn(
|
|
116
|
+
"border-border bg-card text-muted-foreground flex flex-col items-center justify-center gap-2 rounded-lg border px-4 py-10 text-center text-sm",
|
|
117
|
+
classNames?.state
|
|
118
|
+
),
|
|
119
|
+
children: content
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
if (error) {
|
|
123
|
+
return state(
|
|
124
|
+
/* @__PURE__ */ jsx("p", { role: "alert", className: "text-destructive", children: text.error })
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
if (loading) {
|
|
128
|
+
return state(
|
|
129
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
130
|
+
/* @__PURE__ */ jsx(Spinner, { size: "sm", label: text.loading }),
|
|
131
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: text.loading })
|
|
132
|
+
] })
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
const monthLabel = current.setLocale(locale ?? current.locale ?? "en").toFormat("LLLL yyyy");
|
|
136
|
+
const nothingPlaced = placed.length === 0;
|
|
137
|
+
return /* @__PURE__ */ jsxs(
|
|
138
|
+
"div",
|
|
139
|
+
{
|
|
140
|
+
"data-slot": "calendar-view",
|
|
141
|
+
className: cn(
|
|
142
|
+
"border-border bg-card overflow-hidden rounded-lg border",
|
|
143
|
+
className
|
|
144
|
+
),
|
|
145
|
+
children: [
|
|
146
|
+
!hideToolbar && /* @__PURE__ */ jsxs(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
"data-slot": "calendar-view-toolbar",
|
|
150
|
+
className: cn(
|
|
151
|
+
"border-border flex items-center gap-2 border-b px-3 py-2",
|
|
152
|
+
classNames?.toolbar
|
|
153
|
+
),
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ jsx("h3", { "aria-live": "polite", className: "text-sm font-semibold", children: monthLabel }),
|
|
156
|
+
/* @__PURE__ */ jsxs("div", { className: "ms-auto flex items-center gap-1", children: [
|
|
157
|
+
/* @__PURE__ */ jsx(
|
|
158
|
+
Button,
|
|
159
|
+
{
|
|
160
|
+
variant: "ghost",
|
|
161
|
+
size: "sm",
|
|
162
|
+
"aria-label": text.previousMonth,
|
|
163
|
+
onClick: () => goToMonth(current.minus({ months: 1 })),
|
|
164
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4 rtl:rotate-180", "aria-hidden": true })
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
/* @__PURE__ */ jsx(
|
|
168
|
+
Button,
|
|
169
|
+
{
|
|
170
|
+
variant: "ghost",
|
|
171
|
+
size: "sm",
|
|
172
|
+
onClick: () => goToMonth(today.startOf("month")),
|
|
173
|
+
children: text.today
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ jsx(
|
|
177
|
+
Button,
|
|
178
|
+
{
|
|
179
|
+
variant: "ghost",
|
|
180
|
+
size: "sm",
|
|
181
|
+
"aria-label": text.nextMonth,
|
|
182
|
+
onClick: () => goToMonth(current.plus({ months: 1 })),
|
|
183
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-4 rtl:rotate-180", "aria-hidden": true })
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
] })
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
nothingPlaced && emptyState ? emptyState : (
|
|
191
|
+
// `table`, not `grid`: a grid promises arrow-key navigation between
|
|
192
|
+
// cells, which this does not implement. Rows are explicit because a
|
|
193
|
+
// columnheader or cell outside one is invalid ARIA, not just untidy.
|
|
194
|
+
/* @__PURE__ */ jsxs("div", { role: "table", "aria-label": monthLabel, children: [
|
|
195
|
+
/* @__PURE__ */ jsx("div", { role: "rowgroup", children: /* @__PURE__ */ jsx("div", { role: "row", className: "border-border grid grid-cols-7 border-b", children: weekdayNames.map((name) => /* @__PURE__ */ jsx(
|
|
196
|
+
"div",
|
|
197
|
+
{
|
|
198
|
+
role: "columnheader",
|
|
199
|
+
"data-slot": "calendar-view-weekday",
|
|
200
|
+
className: cn(
|
|
201
|
+
"text-muted-foreground px-2 py-1.5 text-center text-xs font-medium tracking-wide uppercase",
|
|
202
|
+
classNames?.weekday
|
|
203
|
+
),
|
|
204
|
+
children: name
|
|
205
|
+
},
|
|
206
|
+
name
|
|
207
|
+
)) }) }),
|
|
208
|
+
/* @__PURE__ */ jsx("div", { role: "rowgroup", children: weeks.map((week) => /* @__PURE__ */ jsx(
|
|
209
|
+
"div",
|
|
210
|
+
{
|
|
211
|
+
role: "row",
|
|
212
|
+
className: "grid grid-cols-7",
|
|
213
|
+
children: week.map((day) => {
|
|
214
|
+
const key = day.toISODate() ?? "";
|
|
215
|
+
const entries = byDay.get(key) ?? [];
|
|
216
|
+
const outside = day.month !== current.month;
|
|
217
|
+
const isToday = day.hasSame(today, "day");
|
|
218
|
+
const visible = entries.slice(0, maxPerDay);
|
|
219
|
+
const overflow = entries.length - visible.length;
|
|
220
|
+
return /* @__PURE__ */ jsxs(
|
|
221
|
+
"div",
|
|
222
|
+
{
|
|
223
|
+
role: "cell",
|
|
224
|
+
"data-slot": "calendar-view-day",
|
|
225
|
+
"data-outside": outside || void 0,
|
|
226
|
+
"data-today": isToday || void 0,
|
|
227
|
+
className: cn(
|
|
228
|
+
"border-border min-h-24 border-e border-b p-1 last:border-e-0",
|
|
229
|
+
outside && cn("bg-muted/30", classNames?.outsideDay),
|
|
230
|
+
isToday && classNames?.today,
|
|
231
|
+
classNames?.day
|
|
232
|
+
),
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ jsxs(
|
|
235
|
+
"div",
|
|
236
|
+
{
|
|
237
|
+
className: cn(
|
|
238
|
+
"mb-1 flex h-5 w-5 items-center justify-center rounded-full text-xs tabular-nums",
|
|
239
|
+
outside ? "text-muted-foreground" : "text-foreground",
|
|
240
|
+
// primary-800, not 500: white on the mid scale is
|
|
241
|
+
// about 2:1 and fails AA. Same pair Button uses.
|
|
242
|
+
isToday && "bg-primary-800 font-semibold text-white"
|
|
243
|
+
),
|
|
244
|
+
children: [
|
|
245
|
+
/* @__PURE__ */ jsx("time", { dateTime: key, children: day.day }),
|
|
246
|
+
isToday && /* @__PURE__ */ jsx("span", { className: "sr-only", children: text.today })
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ jsxs("ul", { className: "space-y-0.5", children: [
|
|
251
|
+
visible.map(({ id, item, start, end }) => {
|
|
252
|
+
const accent = accessors.getAccent?.(item) ?? "primary";
|
|
253
|
+
const selected = id === selectedId;
|
|
254
|
+
const body = renderItem?.(item, {
|
|
255
|
+
view: "calendar"
|
|
256
|
+
}) ?? /* @__PURE__ */ jsx("span", { className: "block truncate", children: accessors.getTitle(item) });
|
|
257
|
+
const classes = cn(
|
|
258
|
+
"block w-full rounded px-1 py-0.5 text-start text-xs text-foreground",
|
|
259
|
+
accentClasses[accent].tint,
|
|
260
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
261
|
+
classNames?.entry,
|
|
262
|
+
selected && cn(
|
|
263
|
+
"ring-1",
|
|
264
|
+
accentClasses[accent].border,
|
|
265
|
+
classNames?.selectedEntry
|
|
266
|
+
)
|
|
267
|
+
);
|
|
268
|
+
const spanLabel = start.hasSame(end, "day") ? void 0 : `${accessors.getTitle(item)}, ${start.toISODate()} to ${end.toISODate()}`;
|
|
269
|
+
const href = getHref?.(id, item);
|
|
270
|
+
return /* @__PURE__ */ jsx("li", { children: href ? /* @__PURE__ */ jsx(
|
|
271
|
+
"a",
|
|
272
|
+
{
|
|
273
|
+
href,
|
|
274
|
+
"aria-label": spanLabel,
|
|
275
|
+
"aria-current": selected ? "true" : void 0,
|
|
276
|
+
"data-slot": "calendar-view-entry",
|
|
277
|
+
className: classes,
|
|
278
|
+
onClick: (event) => {
|
|
279
|
+
if (!onOpen || event.defaultPrevented || event.metaKey || event.ctrlKey || event.shiftKey || event.button !== 0)
|
|
280
|
+
return;
|
|
281
|
+
event.preventDefault();
|
|
282
|
+
onOpen(id, item);
|
|
283
|
+
},
|
|
284
|
+
children: body
|
|
285
|
+
}
|
|
286
|
+
) : onOpen ? /* @__PURE__ */ jsx(
|
|
287
|
+
"button",
|
|
288
|
+
{
|
|
289
|
+
type: "button",
|
|
290
|
+
"aria-label": spanLabel,
|
|
291
|
+
"aria-current": selected ? "true" : void 0,
|
|
292
|
+
"data-slot": "calendar-view-entry",
|
|
293
|
+
className: classes,
|
|
294
|
+
onClick: () => onOpen(id, item),
|
|
295
|
+
children: body
|
|
296
|
+
}
|
|
297
|
+
) : (
|
|
298
|
+
// `aria-label` is prohibited on role `generic`,
|
|
299
|
+
// so the range rides along as hidden text here.
|
|
300
|
+
/* @__PURE__ */ jsxs(
|
|
301
|
+
"span",
|
|
302
|
+
{
|
|
303
|
+
"data-slot": "calendar-view-entry",
|
|
304
|
+
className: classes,
|
|
305
|
+
children: [
|
|
306
|
+
body,
|
|
307
|
+
spanLabel && /* @__PURE__ */ jsx("span", { className: "sr-only", children: `, ${start.toISODate()} to ${end.toISODate()}` })
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
)
|
|
311
|
+
) }, id);
|
|
312
|
+
}),
|
|
313
|
+
overflow > 0 && /* @__PURE__ */ jsx("li", { className: "text-muted-foreground px-1 text-xs", children: text.more.replace("{count}", String(overflow)) })
|
|
314
|
+
] })
|
|
315
|
+
]
|
|
316
|
+
},
|
|
317
|
+
key
|
|
318
|
+
);
|
|
319
|
+
})
|
|
320
|
+
},
|
|
321
|
+
week[0].toISODate()
|
|
322
|
+
)) }),
|
|
323
|
+
nothingPlaced && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground px-3 py-2 text-center text-sm", children: text.empty })
|
|
324
|
+
] })
|
|
325
|
+
)
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export { CalendarView, defaultCalendarLabels };
|
|
332
|
+
//# sourceMappingURL=chunk-G4D6CLBT.js.map
|
|
333
|
+
//# sourceMappingURL=chunk-G4D6CLBT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/CalendarView/CalendarView.tsx"],"names":[],"mappings":";;;;;;;;;AAsCO,IAAM,qBAAA,GAAwC;AAAA,EACnD,GAAG,iBAAA;AAAA,EACH,KAAA,EAAO,oBAAA;AAAA,EACP,aAAA,EAAe,gBAAA;AAAA,EACf,SAAA,EAAW,YAAA;AAAA,EACX,KAAA,EAAO,OAAA;AAAA,EACP,IAAA,EAAM;AACR;AAqCO,SAAS,YAAA,CAAgB;AAAA,EAC9B,KAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA,GAAU,KAAA;AAAA,EACV,KAA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W,CAAA,CAAA,EAC/C;AAAA;AAAA;AAAA;AAEJ,6BAAA,EAAA,EAhDK,EAkDT,CAAA;AAAA,0BAEJ,CAAC,CAAA;AAAA,0BACA,QAAA,GAAW,CAAA,oBACV,GAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,oCAAA,EACX,QAAA,EAAA,IAAA,CAAK,IAAA,CAAK,OAAA,CAAQ,SAAA,EAAW,MAAA,CAAO,QAAQ,CAAC,CAAA,EAChD;AAAA,yBAAA,EAEJ;AAAA;AAAA,qBAAA;AAAA,oBAnHK;AAAA,mBAoHP;AAAA,gBAEJ,CAAC;AAAA,eAAA;AAAA,cAnII,IAAA,CAAK,CAAC,CAAA,CAAE,SAAA;AAAU,aAqI1B,CAAA,EACH,CAAA;AAAA,YACC,iCACC,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,qDAAA,EACV,eAAK,KAAA,EACR;AAAA,WAAA,EAEJ;AAAA;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-G4D6CLBT.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { DateTime, Info } from 'luxon';\nimport { cn } from '../../utils/cn';\nimport { Spinner } from '../Spinner';\nimport { Button } from '../Button';\nimport { ChevronLeftIcon, ChevronRightIcon } from '../Icons';\nimport {\n accentClasses,\n defaultViewLabels,\n toDateTime,\n type ViewBaseProps,\n type ViewLabels,\n} from '../../views/types';\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport type CalendarViewSlot =\n | 'toolbar'\n | 'weekday'\n | 'day'\n | 'outsideDay'\n | 'today'\n | 'entry'\n | 'selectedEntry'\n | 'state';\n\nexport interface CalendarLabels extends ViewLabels {\n previousMonth: string;\n nextMonth: string;\n today: string;\n /** Overflow affordance. `{count}` is substituted. */\n more: string;\n}\n\nexport const defaultCalendarLabels: CalendarLabels = {\n ...defaultViewLabels,\n empty: 'Nothing this month',\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n today: 'Today',\n more: '{count} more',\n};\n\nexport interface CalendarViewProps<T> extends ViewBaseProps<T> {\n /** Controlled month. Any date inside the month works. */\n month?: Date;\n /** Starting month when uncontrolled. Defaults to the month containing `now`. */\n defaultMonth?: Date;\n onMonthChange?: (month: Date) => void;\n /**\n * IANA zone the grid is drawn in, e.g. `America/New_York`. Defaults to the\n * runtime's. A day boundary is a business fact, so state it explicitly when\n * the collection belongs to somewhere other than the viewer.\n */\n timeZone?: string;\n /** 1 = Monday … 7 = Sunday. Defaults to Monday. */\n weekStartsOn?: number;\n /** Locale for month, weekday and day-number formatting. */\n locale?: string;\n /** Entries to show per day before collapsing into \"{count} more\". */\n maxPerDay?: number;\n labels?: Partial<CalendarLabels>;\n classNames?: Partial<Record<CalendarViewSlot, string>>;\n /** Hide the month toolbar when the host renders its own. */\n hideToolbar?: boolean;\n}\n\ninterface Placed<T> {\n id: string;\n item: T;\n start: DateTime;\n end: DateTime;\n}\n\n// =============================================================================\n// Component\n// =============================================================================\n\nexport function CalendarView<T>({\n items,\n accessors,\n loading = false,\n error = null,\n selectedId = null,\n onOpen,\n getHref,\n renderItem,\n emptyState,\n labels,\n month,\n defaultMonth,\n onMonthChange,\n timeZone,\n weekStartsOn = 1,\n locale,\n maxPerDay = 3,\n now,\n className,\n classNames,\n hideToolbar = false,\n}: CalendarViewProps<T>) {\n const text = { ...defaultCalendarLabels, ...labels };\n const zone = timeZone ?? DateTime.local().zoneName;\n const today = React.useMemo(\n () => DateTime.fromJSDate(now ?? new Date(), { zone }).startOf('day'),\n [now, zone]\n );\n\n const [internalMonth, setInternalMonth] = React.useState(() =>\n defaultMonth\n ? DateTime.fromJSDate(defaultMonth, { zone }).startOf('month')\n : today.startOf('month')\n );\n // Re-anchor from the calendar year and month rather than the instant: an\n // instant on the 1st shifted into a behind-UTC zone lands in the month before.\n const current = React.useMemo(() => {\n const source = month ? DateTime.fromJSDate(month, { zone }) : internalMonth;\n return DateTime.fromObject(\n { year: source.year, month: source.month, day: 1 },\n { zone }\n );\n }, [month, internalMonth, zone]);\n\n const goToMonth = (next: DateTime) => {\n if (!month) setInternalMonth(next);\n onMonthChange?.(next.toJSDate());\n };\n\n // Six weeks always, so the grid does not change height between months.\n const gridStart = React.useMemo(() => {\n const first = current.startOf('month');\n const offset = (first.weekday - weekStartsOn + 7) % 7;\n return first.minus({ days: offset });\n }, [current, weekStartsOn]);\n\n const days = React.useMemo(\n () => Array.from({ length: 42 }, (_, i) => gridStart.plus({ days: i })),\n [gridStart]\n );\n\n const weeks = React.useMemo(\n () => Array.from({ length: 6 }, (_, i) => days.slice(i * 7, i * 7 + 7)),\n [days]\n );\n\n const placed = React.useMemo<Placed<T>[]>(() => {\n const out: Placed<T>[] = [];\n for (const item of items) {\n const start = toDateTime(accessors.getStart?.(item), zone)?.startOf(\n 'day'\n );\n if (!start) continue;\n const rawEnd = toDateTime(accessors.getEnd?.(item), zone)?.startOf('day');\n const end = rawEnd ?? start;\n out.push({\n id: accessors.getId(item),\n item,\n start,\n // A backwards range is data, not a crash: clamp it to one day.\n end: end < start ? start : end,\n });\n }\n return out;\n }, [items, accessors, zone]);\n\n const byDay = React.useMemo(() => {\n const map = new Map<string, Placed<T>[]>();\n for (const day of days) {\n const key = day.toISODate() ?? '';\n map.set(\n key,\n placed.filter((p) => p.start <= day && day <= p.end)\n );\n }\n return map;\n }, [days, placed]);\n\n const weekdayNames = React.useMemo(() => {\n const names = Info.weekdays('short', { locale });\n return Array.from(\n { length: 7 },\n (_, i) => names[(weekStartsOn - 1 + i) % 7]\n );\n }, [locale, weekStartsOn]);\n\n const state = (content: React.ReactNode) => (\n <div\n data-slot=\"calendar-view-state\"\n className={cn(\n 'border-border bg-card text-muted-foreground flex flex-col items-center justify-center gap-2 rounded-lg border px-4 py-10 text-center text-sm',\n classNames?.state\n )}\n >\n {content}\n </div>\n );\n\n if (error) {\n return state(\n <p role=\"alert\" className=\"text-destructive\">\n {text.error}\n </p>\n );\n }\n if (loading) {\n return state(\n <span className=\"flex items-center gap-2\">\n <Spinner size=\"sm\" label={text.loading} />\n <span aria-hidden>{text.loading}</span>\n </span>\n );\n }\n\n const monthLabel = current\n .setLocale(locale ?? current.locale ?? 'en')\n .toFormat('LLLL yyyy');\n const nothingPlaced = placed.length === 0;\n\n return (\n <div\n data-slot=\"calendar-view\"\n className={cn(\n 'border-border bg-card overflow-hidden rounded-lg border',\n className\n )}\n >\n {!hideToolbar && (\n <div\n data-slot=\"calendar-view-toolbar\"\n className={cn(\n 'border-border flex items-center gap-2 border-b px-3 py-2',\n classNames?.toolbar\n )}\n >\n <h3 aria-live=\"polite\" className=\"text-sm font-semibold\">\n {monthLabel}\n </h3>\n <div className=\"ms-auto flex items-center gap-1\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n aria-label={text.previousMonth}\n onClick={() => goToMonth(current.minus({ months: 1 }))}\n >\n <ChevronLeftIcon className=\"size-4 rtl:rotate-180\" aria-hidden />\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => goToMonth(today.startOf('month'))}\n >\n {text.today}\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n aria-label={text.nextMonth}\n onClick={() => goToMonth(current.plus({ months: 1 }))}\n >\n <ChevronRightIcon className=\"size-4 rtl:rotate-180\" aria-hidden />\n </Button>\n </div>\n </div>\n )}\n\n {nothingPlaced && emptyState ? (\n emptyState\n ) : (\n // `table`, not `grid`: a grid promises arrow-key navigation between\n // cells, which this does not implement. Rows are explicit because a\n // columnheader or cell outside one is invalid ARIA, not just untidy.\n <div role=\"table\" aria-label={monthLabel}>\n <div role=\"rowgroup\">\n <div role=\"row\" className=\"border-border grid grid-cols-7 border-b\">\n {weekdayNames.map((name) => (\n <div\n key={name}\n role=\"columnheader\"\n data-slot=\"calendar-view-weekday\"\n className={cn(\n 'text-muted-foreground px-2 py-1.5 text-center text-xs font-medium tracking-wide uppercase',\n classNames?.weekday\n )}\n >\n {name}\n </div>\n ))}\n </div>\n </div>\n <div role=\"rowgroup\">\n {weeks.map((week) => (\n <div\n key={week[0].toISODate()}\n role=\"row\"\n className=\"grid grid-cols-7\"\n >\n {week.map((day) => {\n const key = day.toISODate() ?? '';\n const entries = byDay.get(key) ?? [];\n const outside = day.month !== current.month;\n const isToday = day.hasSame(today, 'day');\n const visible = entries.slice(0, maxPerDay);\n const overflow = entries.length - visible.length;\n return (\n <div\n key={key}\n role=\"cell\"\n data-slot=\"calendar-view-day\"\n data-outside={outside || undefined}\n data-today={isToday || undefined}\n className={cn(\n 'border-border min-h-24 border-e border-b p-1 last:border-e-0',\n outside && cn('bg-muted/30', classNames?.outsideDay),\n isToday && classNames?.today,\n classNames?.day\n )}\n >\n <div\n className={cn(\n 'mb-1 flex h-5 w-5 items-center justify-center rounded-full text-xs tabular-nums',\n outside ? 'text-muted-foreground' : 'text-foreground',\n // primary-800, not 500: white on the mid scale is\n // about 2:1 and fails AA. Same pair Button uses.\n isToday && 'bg-primary-800 font-semibold text-white'\n )}\n >\n <time dateTime={key}>{day.day}</time>\n {isToday && (\n <span className=\"sr-only\">{text.today}</span>\n )}\n </div>\n <ul className=\"space-y-0.5\">\n {visible.map(({ id, item, start, end }) => {\n const accent =\n accessors.getAccent?.(item) ?? 'primary';\n const selected = id === selectedId;\n const body = renderItem?.(item, {\n view: 'calendar',\n }) ?? (\n <span className=\"block truncate\">\n {accessors.getTitle(item)}\n </span>\n );\n const classes = cn(\n 'block w-full rounded px-1 py-0.5 text-start text-xs text-foreground',\n accentClasses[accent].tint,\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n classNames?.entry,\n selected &&\n cn(\n 'ring-1',\n accentClasses[accent].border,\n classNames?.selectedEntry\n )\n );\n // A multi-day item repeats on each day it covers; the\n // range is in the accessible name, not in the geometry.\n const spanLabel = start.hasSame(end, 'day')\n ? undefined\n : `${accessors.getTitle(item)}, ${start.toISODate()} to ${end.toISODate()}`;\n const href = getHref?.(id, item);\n return (\n <li key={id}>\n {href ? (\n <a\n href={href}\n aria-label={spanLabel}\n aria-current={selected ? 'true' : undefined}\n data-slot=\"calendar-view-entry\"\n className={classes}\n onClick={(event) => {\n if (\n !onOpen ||\n event.defaultPrevented ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.button !== 0\n )\n return;\n event.preventDefault();\n onOpen(id, item);\n }}\n >\n {body}\n </a>\n ) : onOpen ? (\n <button\n type=\"button\"\n aria-label={spanLabel}\n aria-current={selected ? 'true' : undefined}\n data-slot=\"calendar-view-entry\"\n className={classes}\n onClick={() => onOpen(id, item)}\n >\n {body}\n </button>\n ) : (\n // `aria-label` is prohibited on role `generic`,\n // so the range rides along as hidden text here.\n <span\n data-slot=\"calendar-view-entry\"\n className={classes}\n >\n {body}\n {spanLabel && (\n <span className=\"sr-only\">\n {`, ${start.toISODate()} to ${end.toISODate()}`}\n </span>\n )}\n </span>\n )}\n </li>\n );\n })}\n {overflow > 0 && (\n <li className=\"text-muted-foreground px-1 text-xs\">\n {text.more.replace('{count}', String(overflow))}\n </li>\n )}\n </ul>\n </div>\n );\n })}\n </div>\n ))}\n </div>\n {nothingPlaced && (\n <p className=\"text-muted-foreground px-3 py-2 text-center text-sm\">\n {text.empty}\n </p>\n )}\n </div>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { defaultViewLabels } from './chunk-3YBS4WUQ.js';
|
|
2
|
+
import { Table, BarChart3, Calendar, Columns, List, LayoutGrid } from './chunk-BKSPDTX4.js';
|
|
3
|
+
import { cn } from './chunk-TQONQSJO.js';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var VIEW_META = {
|
|
9
|
+
overview: { label: "Overview", icon: LayoutGrid },
|
|
10
|
+
list: { label: "List", icon: List },
|
|
11
|
+
board: { label: "Board", icon: Columns },
|
|
12
|
+
calendar: { label: "Calendar", icon: Calendar },
|
|
13
|
+
gantt: { label: "Gantt", icon: BarChart3 },
|
|
14
|
+
roadmap: { label: "Roadmap", icon: BarChart3 },
|
|
15
|
+
table: { label: "Table", icon: Table }
|
|
16
|
+
};
|
|
17
|
+
var viewSwitcherVariants = cva(
|
|
18
|
+
[
|
|
19
|
+
"inline-flex items-center gap-0.5",
|
|
20
|
+
"rounded-lg border border-border bg-muted p-0.5",
|
|
21
|
+
"overflow-x-auto"
|
|
22
|
+
],
|
|
23
|
+
{
|
|
24
|
+
variants: {
|
|
25
|
+
size: {
|
|
26
|
+
sm: "text-xs",
|
|
27
|
+
md: "text-sm"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: { size: "md" }
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
var optionVariants = cva(
|
|
34
|
+
[
|
|
35
|
+
"inline-flex shrink-0 items-center gap-1.5 rounded-md font-medium",
|
|
36
|
+
"transition-colors",
|
|
37
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background",
|
|
38
|
+
"disabled:pointer-events-none disabled:opacity-50"
|
|
39
|
+
],
|
|
40
|
+
{
|
|
41
|
+
variants: {
|
|
42
|
+
size: {
|
|
43
|
+
// 40px tall on touch, tighter once a pointer is likely.
|
|
44
|
+
sm: "min-h-10 px-2 py-2 sm:min-h-0 sm:px-2 sm:py-1",
|
|
45
|
+
md: "min-h-10 px-2.5 py-2 sm:min-h-0 sm:px-3 sm:py-1.5"
|
|
46
|
+
},
|
|
47
|
+
active: {
|
|
48
|
+
// A raised surface rather than tinted ink: an accent colour as text on
|
|
49
|
+
// its own wash fails AA contrast. Same treatment as Tabs' pills.
|
|
50
|
+
true: "bg-background text-foreground shadow-sm",
|
|
51
|
+
false: "text-muted-foreground hover:text-foreground"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
defaultVariants: { size: "md", active: false }
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
var ViewSwitcher = React.forwardRef(
|
|
58
|
+
function ViewSwitcher2({
|
|
59
|
+
views,
|
|
60
|
+
value,
|
|
61
|
+
onValueChange,
|
|
62
|
+
label = defaultViewLabels.viewSwitcher,
|
|
63
|
+
showLabels = "responsive",
|
|
64
|
+
size,
|
|
65
|
+
className,
|
|
66
|
+
classNames,
|
|
67
|
+
...rest
|
|
68
|
+
}, ref) {
|
|
69
|
+
const options = React.useMemo(
|
|
70
|
+
() => views.map((v) => typeof v === "string" ? { id: v } : v),
|
|
71
|
+
[views]
|
|
72
|
+
);
|
|
73
|
+
const refs = React.useRef({});
|
|
74
|
+
const select = (next) => {
|
|
75
|
+
if (!next || next.id === value) return;
|
|
76
|
+
onValueChange(next.id);
|
|
77
|
+
requestAnimationFrame(
|
|
78
|
+
() => refs.current[next.id]?.focus({ preventScroll: true })
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
const step = (delta) => {
|
|
82
|
+
const enabled = options.filter((o) => !o.disabled);
|
|
83
|
+
if (enabled.length === 0) return;
|
|
84
|
+
const current = enabled.findIndex((o) => o.id === value);
|
|
85
|
+
const from = current === -1 ? delta > 0 ? -1 : 0 : current;
|
|
86
|
+
select(enabled[(from + delta + enabled.length) % enabled.length]);
|
|
87
|
+
};
|
|
88
|
+
const onKeyDown = (event) => {
|
|
89
|
+
const enabled = options.filter((o) => !o.disabled);
|
|
90
|
+
const forward = getComputedStyle(event.currentTarget).direction === "rtl" ? -1 : 1;
|
|
91
|
+
switch (event.key) {
|
|
92
|
+
case "ArrowRight":
|
|
93
|
+
event.preventDefault();
|
|
94
|
+
step(forward);
|
|
95
|
+
break;
|
|
96
|
+
case "ArrowLeft":
|
|
97
|
+
event.preventDefault();
|
|
98
|
+
step(-forward);
|
|
99
|
+
break;
|
|
100
|
+
case "ArrowDown":
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
step(1);
|
|
103
|
+
break;
|
|
104
|
+
case "ArrowUp":
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
step(-1);
|
|
107
|
+
break;
|
|
108
|
+
case "Home":
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
select(enabled[0]);
|
|
111
|
+
break;
|
|
112
|
+
case "End":
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
select(enabled[enabled.length - 1]);
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const tabStopId = options.find((o) => o.id === value && !o.disabled)?.id ?? options.find((o) => !o.disabled)?.id;
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
ref,
|
|
123
|
+
role: "radiogroup",
|
|
124
|
+
"aria-label": label,
|
|
125
|
+
"data-slot": "view-switcher",
|
|
126
|
+
className: cn(viewSwitcherVariants({ size }), className),
|
|
127
|
+
...rest,
|
|
128
|
+
children: options.map((option) => {
|
|
129
|
+
const meta = VIEW_META[option.id];
|
|
130
|
+
const Icon = option.icon ?? meta.icon;
|
|
131
|
+
const text = option.label ?? meta.label;
|
|
132
|
+
const active = option.id === value;
|
|
133
|
+
return /* @__PURE__ */ jsxs(
|
|
134
|
+
"button",
|
|
135
|
+
{
|
|
136
|
+
ref: (node) => {
|
|
137
|
+
refs.current[option.id] = node;
|
|
138
|
+
},
|
|
139
|
+
type: "button",
|
|
140
|
+
role: "radio",
|
|
141
|
+
"aria-checked": active,
|
|
142
|
+
"aria-label": showLabels === true ? void 0 : text,
|
|
143
|
+
title: text,
|
|
144
|
+
disabled: option.disabled,
|
|
145
|
+
tabIndex: option.id === tabStopId ? 0 : -1,
|
|
146
|
+
"data-slot": "view-switcher-option",
|
|
147
|
+
"data-view": option.id,
|
|
148
|
+
className: cn(
|
|
149
|
+
optionVariants({ size, active }),
|
|
150
|
+
classNames?.option,
|
|
151
|
+
active && classNames?.activeOption
|
|
152
|
+
),
|
|
153
|
+
onClick: () => onValueChange(option.id),
|
|
154
|
+
onKeyDown,
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ jsx(Icon, { className: "size-4 shrink-0", "aria-hidden": true }),
|
|
157
|
+
showLabels !== false && /* @__PURE__ */ jsx(
|
|
158
|
+
"span",
|
|
159
|
+
{
|
|
160
|
+
"data-slot": "view-switcher-label",
|
|
161
|
+
className: cn(
|
|
162
|
+
showLabels === "responsive" && "hidden sm:inline"
|
|
163
|
+
),
|
|
164
|
+
children: text
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
option.id
|
|
170
|
+
);
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
export { ViewSwitcher, viewSwitcherVariants };
|
|
178
|
+
//# sourceMappingURL=chunk-IT775BYG.js.map
|
|
179
|
+
//# sourceMappingURL=chunk-IT775BYG.js.map
|