@panneau/lists 5.0.0-alpha.2 → 5.0.0-alpha.21

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.
Files changed (165) hide show
  1. package/README.md +17 -15
  2. package/dist/ItemDetails.css +50 -0
  3. package/dist/ItemDetails.d.ts +27 -0
  4. package/dist/ItemDetails.d.ts.map +1 -0
  5. package/dist/ItemDetails.js +134 -0
  6. package/dist/ItemDetails.js.map +1 -0
  7. package/dist/ItemDetails.module.js +20 -0
  8. package/dist/ItemDetails.module.js.map +1 -0
  9. package/dist/List.d.ts +3 -3
  10. package/dist/List.d.ts.map +1 -1
  11. package/dist/List.js +31 -10
  12. package/dist/List.js.map +1 -1
  13. package/dist/ListSkeleton.d.ts +19 -0
  14. package/dist/ListSkeleton.d.ts.map +1 -0
  15. package/dist/ListSkeleton.js +115 -0
  16. package/dist/ListSkeleton.js.map +1 -0
  17. package/dist/ListView.d.ts +73 -8
  18. package/dist/ListView.d.ts.map +1 -1
  19. package/dist/ListView.js +616 -218
  20. package/dist/ListView.js.map +1 -1
  21. package/dist/actions/ActionButton.d.ts +8 -2
  22. package/dist/actions/ActionButton.d.ts.map +1 -1
  23. package/dist/actions/ActionButton.js +98 -26
  24. package/dist/actions/ActionButton.js.map +1 -1
  25. package/dist/actions/Actions.css +16 -38
  26. package/dist/actions/Actions.module.js +6 -6
  27. package/dist/actions/Actions.module.js.map +1 -1
  28. package/dist/actions/ConfirmDialog.d.ts +20 -4
  29. package/dist/actions/ConfirmDialog.d.ts.map +1 -1
  30. package/dist/actions/ConfirmDialog.js +110 -92
  31. package/dist/actions/ConfirmDialog.js.map +1 -1
  32. package/dist/actions/RowActions.d.ts +25 -9
  33. package/dist/actions/RowActions.d.ts.map +1 -1
  34. package/dist/actions/RowActions.js +151 -80
  35. package/dist/actions/RowActions.js.map +1 -1
  36. package/dist/actions/actions.d.ts +5 -4
  37. package/dist/actions/actions.d.ts.map +1 -1
  38. package/dist/actions/actions.js +7 -14
  39. package/dist/actions/actions.js.map +1 -1
  40. package/dist/actions/fit.d.ts +25 -0
  41. package/dist/actions/fit.d.ts.map +1 -0
  42. package/dist/actions/fit.js +197 -0
  43. package/dist/actions/fit.js.map +1 -0
  44. package/dist/actions/icons.d.ts +5 -0
  45. package/dist/actions/icons.d.ts.map +1 -1
  46. package/dist/actions/icons.js +15 -1
  47. package/dist/actions/icons.js.map +1 -1
  48. package/dist/columns.d.ts +10 -0
  49. package/dist/columns.d.ts.map +1 -0
  50. package/dist/columns.js +25 -0
  51. package/dist/columns.js.map +1 -0
  52. package/dist/cx.js.map +1 -1
  53. package/dist/displays/Displays.css +48 -0
  54. package/dist/displays/Displays.module.js +18 -2
  55. package/dist/displays/Displays.module.js.map +1 -1
  56. package/dist/displays/displays.d.ts +62 -6
  57. package/dist/displays/displays.d.ts.map +1 -1
  58. package/dist/displays/displays.js +1151 -89
  59. package/dist/displays/displays.js.map +1 -1
  60. package/dist/filters/Filters.css +25 -11
  61. package/dist/filters/Filters.d.ts +1 -1
  62. package/dist/filters/Filters.js.map +1 -1
  63. package/dist/filters/Filters.module.js +5 -1
  64. package/dist/filters/Filters.module.js.map +1 -1
  65. package/dist/filters/controls.d.ts +1 -1
  66. package/dist/filters/controls.d.ts.map +1 -1
  67. package/dist/filters/controls.js +57 -35
  68. package/dist/filters/controls.js.map +1 -1
  69. package/dist/filters/format.d.ts +1 -1
  70. package/dist/filters/format.js.map +1 -1
  71. package/dist/images.d.ts +7 -0
  72. package/dist/images.d.ts.map +1 -0
  73. package/dist/images.js +39 -0
  74. package/dist/images.js.map +1 -0
  75. package/dist/index.d.ts +22 -18
  76. package/dist/index.d.ts.map +1 -1
  77. package/dist/index.js +7 -3
  78. package/dist/inline/Inline.css +58 -0
  79. package/dist/inline/Inline.module.js +20 -0
  80. package/dist/inline/Inline.module.js.map +1 -0
  81. package/dist/inline/InlineCell.d.ts +29 -0
  82. package/dist/inline/InlineCell.d.ts.map +1 -0
  83. package/dist/inline/InlineCell.js +490 -0
  84. package/dist/inline/InlineCell.js.map +1 -0
  85. package/dist/inline/editable.d.ts +12 -0
  86. package/dist/inline/editable.d.ts.map +1 -0
  87. package/dist/inline/editable.js +29 -0
  88. package/dist/inline/editable.js.map +1 -0
  89. package/dist/layouts/CalendarLayout.css +153 -0
  90. package/dist/layouts/CalendarLayout.d.ts +9 -0
  91. package/dist/layouts/CalendarLayout.d.ts.map +1 -0
  92. package/dist/layouts/CalendarLayout.js +303 -0
  93. package/dist/layouts/CalendarLayout.js.map +1 -0
  94. package/dist/layouts/CalendarLayout.module.js +28 -0
  95. package/dist/layouts/CalendarLayout.module.js.map +1 -0
  96. package/dist/layouts/CardsLayout.css +5 -0
  97. package/dist/layouts/CardsLayout.d.ts +2 -2
  98. package/dist/layouts/CardsLayout.d.ts.map +1 -1
  99. package/dist/layouts/CardsLayout.js +92 -91
  100. package/dist/layouts/CardsLayout.js.map +1 -1
  101. package/dist/layouts/CardsLayout.module.js.map +1 -1
  102. package/dist/layouts/GalleryLayout.css +87 -0
  103. package/dist/layouts/GalleryLayout.d.ts +8 -0
  104. package/dist/layouts/GalleryLayout.d.ts.map +1 -0
  105. package/dist/layouts/GalleryLayout.js +152 -0
  106. package/dist/layouts/GalleryLayout.js.map +1 -0
  107. package/dist/layouts/GalleryLayout.module.js +26 -0
  108. package/dist/layouts/GalleryLayout.module.js.map +1 -0
  109. package/dist/layouts/ItemTitle.d.ts +3 -1
  110. package/dist/layouts/ItemTitle.d.ts.map +1 -1
  111. package/dist/layouts/ItemTitle.js +12 -8
  112. package/dist/layouts/ItemTitle.js.map +1 -1
  113. package/dist/layouts/TableLayout.css +56 -0
  114. package/dist/layouts/TableLayout.d.ts +5 -4
  115. package/dist/layouts/TableLayout.d.ts.map +1 -1
  116. package/dist/layouts/TableLayout.js +171 -101
  117. package/dist/layouts/TableLayout.js.map +1 -1
  118. package/dist/layouts/TableLayout.module.js +8 -4
  119. package/dist/layouts/TableLayout.module.js.map +1 -1
  120. package/dist/layouts/builtIn.d.ts +2 -2
  121. package/dist/layouts/builtIn.d.ts.map +1 -1
  122. package/dist/layouts/builtIn.js +6 -2
  123. package/dist/layouts/builtIn.js.map +1 -1
  124. package/dist/layouts/calendarDays.d.ts +14 -0
  125. package/dist/layouts/calendarDays.d.ts.map +1 -0
  126. package/dist/layouts/calendarDays.js +44 -0
  127. package/dist/layouts/calendarDays.js.map +1 -0
  128. package/dist/plugin.d.ts +1 -1
  129. package/dist/plugin.js.map +1 -1
  130. package/dist/query.d.ts +4 -3
  131. package/dist/query.d.ts.map +1 -1
  132. package/dist/query.js +15 -4
  133. package/dist/query.js.map +1 -1
  134. package/dist/selection.d.ts +1 -1
  135. package/dist/selection.js.map +1 -1
  136. package/dist/toolbar/ColumnMenu.d.ts +17 -0
  137. package/dist/toolbar/ColumnMenu.d.ts.map +1 -0
  138. package/dist/toolbar/ColumnMenu.js +193 -0
  139. package/dist/toolbar/ColumnMenu.js.map +1 -0
  140. package/dist/toolbar/LayoutSwitch.d.ts.map +1 -1
  141. package/dist/toolbar/LayoutSwitch.js +73 -55
  142. package/dist/toolbar/LayoutSwitch.js.map +1 -1
  143. package/dist/toolbar/Pagination.d.ts +33 -0
  144. package/dist/toolbar/Pagination.d.ts.map +1 -1
  145. package/dist/toolbar/Pagination.js +282 -42
  146. package/dist/toolbar/Pagination.js.map +1 -1
  147. package/dist/toolbar/SearchField.js.map +1 -1
  148. package/dist/toolbar/SortSelect.d.ts +1 -1
  149. package/dist/toolbar/SortSelect.js.map +1 -1
  150. package/dist/toolbar/Toolbar.css +36 -0
  151. package/dist/toolbar/Toolbar.module.js +12 -2
  152. package/dist/toolbar/Toolbar.module.js.map +1 -1
  153. package/dist/types.d.ts +69 -1
  154. package/dist/types.d.ts.map +1 -1
  155. package/dist/useDraft.js.map +1 -1
  156. package/dist/useListState.js.map +1 -1
  157. package/dist/useRenderValue.d.ts +10 -0
  158. package/dist/useRenderValue.d.ts.map +1 -0
  159. package/dist/useRenderValue.js +84 -0
  160. package/dist/useRenderValue.js.map +1 -0
  161. package/dist/values.d.ts +4 -1
  162. package/dist/values.d.ts.map +1 -1
  163. package/dist/values.js +6 -2
  164. package/dist/values.js.map +1 -1
  165. package/package.json +9 -9
@@ -0,0 +1,153 @@
1
+ .panneau-calendar-layout-calendar {
2
+ container-type: inline-size;
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: var(--panneau-space-2);
6
+ }
7
+
8
+ .panneau-calendar-layout-header {
9
+ display: flex;
10
+ flex-wrap: wrap;
11
+ align-items: center;
12
+ justify-content: space-between;
13
+ gap: var(--panneau-space-2);
14
+ }
15
+
16
+ .panneau-calendar-layout-month {
17
+ margin: 0;
18
+ font-size: var(--panneau-font-size-lg);
19
+ font-weight: var(--panneau-font-weight-medium);
20
+ }
21
+
22
+ .panneau-calendar-layout-month::first-letter {
23
+ text-transform: uppercase;
24
+ }
25
+
26
+ .panneau-calendar-layout-navigation {
27
+ display: flex;
28
+ align-items: center;
29
+ gap: var(--panneau-space-1);
30
+ }
31
+
32
+ .panneau-calendar-layout-more {
33
+ margin: 0;
34
+ font-size: var(--panneau-font-size-sm);
35
+ color: var(--panneau-color-text-muted);
36
+ }
37
+
38
+ .panneau-calendar-layout-grid {
39
+ width: 100%;
40
+ table-layout: fixed;
41
+ border-collapse: collapse;
42
+ background-color: var(--panneau-color-surface);
43
+ }
44
+
45
+ .panneau-calendar-layout-grid th {
46
+ padding: var(--panneau-space-1);
47
+ font-size: var(--panneau-font-size-sm);
48
+ font-weight: var(--panneau-font-weight-medium);
49
+ color: var(--panneau-color-text-muted);
50
+ text-align: start;
51
+ }
52
+
53
+ .panneau-calendar-layout-grid abbr {
54
+ text-decoration: none;
55
+ }
56
+
57
+ .panneau-calendar-layout-grid td {
58
+ height: 6rem;
59
+ padding: var(--panneau-space-1);
60
+ vertical-align: top;
61
+ border: var(--panneau-border-width) solid var(--panneau-color-border);
62
+ }
63
+
64
+ .panneau-calendar-layout-grid td[data-outside] {
65
+ background-color: var(--panneau-color-surface-sunken);
66
+ color: var(--panneau-color-text-muted);
67
+ }
68
+
69
+ .panneau-calendar-layout-day {
70
+ display: block;
71
+ font-size: var(--panneau-font-size-sm);
72
+ }
73
+
74
+ .panneau-calendar-layout-grid td[aria-current='date'] .panneau-calendar-layout-day-number {
75
+ display: inline-flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ min-width: 1.5rem;
79
+ height: 1.5rem;
80
+ color: var(--panneau-color-accent-text);
81
+ background-color: var(--panneau-color-accent);
82
+ border-radius: 999px;
83
+ }
84
+
85
+ /* The full date, for assistive technologies; shown on narrow lists. */
86
+ .panneau-calendar-layout-day-label {
87
+ position: absolute;
88
+ width: 1px;
89
+ height: 1px;
90
+ overflow: hidden;
91
+ clip-path: inset(50%);
92
+ white-space: nowrap;
93
+ }
94
+
95
+ .panneau-calendar-layout-items {
96
+ display: flex;
97
+ flex-direction: column;
98
+ gap: 2px;
99
+ margin: var(--panneau-space-1) 0 0;
100
+ padding: 0;
101
+ list-style: none;
102
+ font-size: var(--panneau-font-size-sm);
103
+ }
104
+
105
+ .panneau-calendar-layout-items li {
106
+ overflow: hidden;
107
+ text-overflow: ellipsis;
108
+ white-space: nowrap;
109
+ }
110
+
111
+ .panneau-calendar-layout-items li[data-current] {
112
+ font-weight: var(--panneau-font-weight-medium);
113
+ }
114
+
115
+ /* On narrow lists: the days that have items, one under the other. */
116
+ @container (max-width: 40rem) {
117
+ .panneau-calendar-layout-grid,
118
+ .panneau-calendar-layout-grid tbody,
119
+ .panneau-calendar-layout-grid tr,
120
+ .panneau-calendar-layout-grid td {
121
+ display: block;
122
+ width: auto;
123
+ height: auto;
124
+ }
125
+
126
+ .panneau-calendar-layout-grid thead,
127
+ .panneau-calendar-layout-grid td[data-empty],
128
+ .panneau-calendar-layout-day-number {
129
+ display: none;
130
+ }
131
+
132
+ .panneau-calendar-layout-grid td {
133
+ border-width: 0 0 var(--panneau-border-width);
134
+ padding: var(--panneau-space-2) 0;
135
+ }
136
+
137
+ .panneau-calendar-layout-grid td[data-outside] {
138
+ background: none;
139
+ }
140
+
141
+ .panneau-calendar-layout-day-label {
142
+ position: static;
143
+ width: auto;
144
+ height: auto;
145
+ overflow: visible;
146
+ clip-path: none;
147
+ font-weight: var(--panneau-font-weight-medium);
148
+ }
149
+
150
+ .panneau-calendar-layout-items li {
151
+ white-space: normal;
152
+ }
153
+ }
@@ -0,0 +1,9 @@
1
+ import type { ListLayoutProps } from '../types.js';
2
+ /**
3
+ * Items on the days of a month (decision 0044), and a range on each day it covers (decision 0053):
4
+ * the weeks of the month, from the first day of the week of the locale, with the title of each item
5
+ * as its link, in the order of their dates, and buttons to the previous, the next and the current
6
+ * month. On narrow lists, the days that have items, one under the other.
7
+ */
8
+ export declare function CalendarLayout({ items, columns, renderValue, getItemLabel, getItemHref, isCurrent, label, calendar, }: ListLayoutProps): import("react").JSX.Element;
9
+ //# sourceMappingURL=CalendarLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalendarLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/CalendarLayout.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,UAAU,CAAC;AAiD1D;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC3B,KAAK,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,WAAW,EACX,SAAS,EACT,KAAK,EACL,QAAQ,GACX,EAAE,eAAe,+BA4IjB"}
@@ -0,0 +1,303 @@
1
+ import { messages } from "../messages.js";
2
+ import CalendarLayout_module_default from "./CalendarLayout.module.js";
3
+ import { ItemTitle } from "./ItemTitle.js";
4
+ import { getItemDays } from "./calendarDays.js";
5
+ import { currentMonth, isMonth, shiftMonth } from "@panneau/core";
6
+ import { c } from "react/compiler-runtime";
7
+ import { Button, IconButton, usePanneauIntl } from "@panneau/ui";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { ChevronLeft, ChevronRight } from "lucide-react";
10
+ import { isDateRangeValue } from "@panneau/fields/daterange";
11
+ //#region src/layouts/CalendarLayout.tsx
12
+ function pad(value, length = 2) {
13
+ return String(value).padStart(length, "0");
14
+ }
15
+ function dayOf(date) {
16
+ return `${pad(date.getUTCFullYear(), 4)}-${pad(date.getUTCMonth() + 1)}-${pad(date.getUTCDate())}`;
17
+ }
18
+ /** What orders the items of a day: a date-time, or the start of a range. */
19
+ function sortKey(value) {
20
+ if (isDateRangeValue(value)) return value.start ?? value.end ?? "";
21
+ return typeof value === "string" ? value : "";
22
+ }
23
+ /** The first day of the week in a locale: 1 for Monday to 7 for Sunday. */
24
+ function getFirstDay(locale) {
25
+ try {
26
+ const info = new Intl.Locale(locale);
27
+ return info.getWeekInfo?.().firstDay ?? info.weekInfo?.firstDay ?? 1;
28
+ } catch {
29
+ return 1;
30
+ }
31
+ }
32
+ /** The weeks that show a month, as days (`2026-11-02`), from the first day of the week. */
33
+ function getWeeks(month, firstDay) {
34
+ const [year = 1970, index = 1] = month.split("-").map(Number);
35
+ const first = new Date(Date.UTC(year, index - 1, 1));
36
+ const last = new Date(Date.UTC(year, index, 0));
37
+ const offset = (first.getUTCDay() - firstDay % 7 + 7) % 7;
38
+ const start = Date.UTC(year, index - 1, 1 - offset);
39
+ const days = [];
40
+ for (let time = start; days.length % 7 !== 0 || time <= last.getTime(); time += 864e5) days.push(dayOf(new Date(time)));
41
+ return Array.from({ length: days.length / 7 }, (_, week) => days.slice(week * 7, week * 7 + 7));
42
+ }
43
+ /**
44
+ * Items on the days of a month (decision 0044), and a range on each day it covers (decision 0053):
45
+ * the weeks of the month, from the first day of the week of the locale, with the title of each item
46
+ * as its link, in the order of their dates, and buttons to the previous, the next and the current
47
+ * month. On narrow lists, the days that have items, one under the other.
48
+ */
49
+ function CalendarLayout(t0) {
50
+ const $ = c(45);
51
+ const { items, columns, renderValue, getItemLabel, getItemHref, isCurrent, label, calendar } = t0;
52
+ const intl = usePanneauIntl();
53
+ let t1;
54
+ let t2;
55
+ let t3;
56
+ let t4;
57
+ let t5;
58
+ let t6;
59
+ let t7;
60
+ if ($[0] !== calendar || $[1] !== columns || $[2] !== getItemHref || $[3] !== getItemLabel || $[4] !== intl || $[5] !== isCurrent || $[6] !== items || $[7] !== label || $[8] !== renderValue) {
61
+ const today = currentMonth();
62
+ const month = calendar !== void 0 && isMonth(calendar.month) ? calendar.month : today;
63
+ const [t8, t9] = month.split("-").map(Number);
64
+ const year = t8 === void 0 ? 1970 : t8;
65
+ const index = t9 === void 0 ? 1 : t9;
66
+ const [title] = columns;
67
+ const weeks = getWeeks(month, getFirstDay(intl.locale));
68
+ const monthLabel = new Intl.DateTimeFormat(intl.locale, {
69
+ month: "long",
70
+ year: "numeric",
71
+ timeZone: "UTC"
72
+ }).format(new Date(Date.UTC(year, index - 1, 1)));
73
+ const dayLabel = new Intl.DateTimeFormat(intl.locale, {
74
+ weekday: "long",
75
+ day: "numeric",
76
+ month: "long",
77
+ timeZone: "UTC"
78
+ });
79
+ let t10;
80
+ if ($[16] !== intl.locale) {
81
+ t10 = (format) => new Intl.DateTimeFormat(intl.locale, {
82
+ weekday: format,
83
+ timeZone: "UTC"
84
+ });
85
+ $[16] = intl.locale;
86
+ $[17] = t10;
87
+ } else t10 = $[17];
88
+ const weekday = t10;
89
+ let t11;
90
+ let t12;
91
+ let t13;
92
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
93
+ const now = /* @__PURE__ */ new Date();
94
+ t11 = pad(now.getFullYear(), 4);
95
+ t12 = pad(now.getMonth() + 1);
96
+ t13 = pad(now.getDate());
97
+ $[18] = t11;
98
+ $[19] = t12;
99
+ $[20] = t13;
100
+ } else {
101
+ t11 = $[18];
102
+ t12 = $[19];
103
+ t13 = $[20];
104
+ }
105
+ const todayDay = `${t11}-${t12}-${t13}`;
106
+ const byDay = /* @__PURE__ */ new Map();
107
+ if (calendar !== void 0) {
108
+ const shown = {
109
+ first: weeks[0]?.[0] ?? "",
110
+ last: weeks.at(-1)?.at(-1) ?? ""
111
+ };
112
+ items.forEach((item) => {
113
+ const value = item[calendar.field];
114
+ getItemDays(value, shown, calendar.timeZone).forEach((day) => {
115
+ byDay.set(day, [...byDay.get(day) ?? [], {
116
+ item,
117
+ value: sortKey(value)
118
+ }]);
119
+ });
120
+ });
121
+ }
122
+ const more = calendar?.more ?? null;
123
+ t5 = CalendarLayout_module_default.calendar;
124
+ let t14;
125
+ if ($[21] !== intl) {
126
+ t14 = intl.formatMessage(messages.previousMonth);
127
+ $[21] = intl;
128
+ $[22] = t14;
129
+ } else t14 = $[22];
130
+ let t15;
131
+ if ($[23] !== intl) {
132
+ t15 = intl.formatMessage(messages.thisMonth);
133
+ $[23] = intl;
134
+ $[24] = t15;
135
+ } else t15 = $[24];
136
+ let t16;
137
+ if ($[25] !== intl) {
138
+ t16 = intl.formatMessage(messages.nextMonth);
139
+ $[25] = intl;
140
+ $[26] = t16;
141
+ } else t16 = $[26];
142
+ t6 = /* @__PURE__ */ jsxs("div", {
143
+ className: CalendarLayout_module_default.header,
144
+ children: [/* @__PURE__ */ jsx("p", {
145
+ className: CalendarLayout_module_default.month,
146
+ "aria-live": "polite",
147
+ children: monthLabel
148
+ }), /* @__PURE__ */ jsxs("div", {
149
+ className: CalendarLayout_module_default.navigation,
150
+ children: [
151
+ /* @__PURE__ */ jsx(IconButton, {
152
+ icon: ChevronLeft,
153
+ label: t14,
154
+ onPress: () => calendar?.onMonthChange(shiftMonth(month, -1))
155
+ }),
156
+ /* @__PURE__ */ jsx(Button, {
157
+ size: "sm",
158
+ isDisabled: month === today,
159
+ onPress: () => calendar?.onMonthChange(today),
160
+ children: t15
161
+ }),
162
+ /* @__PURE__ */ jsx(IconButton, {
163
+ icon: ChevronRight,
164
+ label: t16,
165
+ onPress: () => calendar?.onMonthChange(shiftMonth(month, 1))
166
+ })
167
+ ]
168
+ })]
169
+ });
170
+ if ($[27] !== intl || $[28] !== items || $[29] !== more) {
171
+ t7 = more !== null ? /* @__PURE__ */ jsx("p", {
172
+ className: CalendarLayout_module_default.more,
173
+ role: "status",
174
+ children: more.total !== null ? intl.formatMessage(messages.calendarMore, {
175
+ shown: items.length,
176
+ total: more.total
177
+ }) : intl.formatMessage(messages.calendarMoreUnknown, { shown: items.length })
178
+ }) : null;
179
+ $[27] = intl;
180
+ $[28] = items;
181
+ $[29] = more;
182
+ $[30] = t7;
183
+ } else t7 = $[30];
184
+ t2 = CalendarLayout_module_default.grid;
185
+ t3 = `${label}, ${monthLabel}`;
186
+ let t17;
187
+ if ($[31] !== weekday) {
188
+ t17 = (day_0) => {
189
+ const date = /* @__PURE__ */ new Date(`${day_0}T00:00:00Z`);
190
+ return /* @__PURE__ */ jsx("th", {
191
+ scope: "col",
192
+ children: /* @__PURE__ */ jsx("abbr", {
193
+ title: weekday("long").format(date),
194
+ children: weekday("short").format(date)
195
+ })
196
+ }, day_0);
197
+ };
198
+ $[31] = weekday;
199
+ $[32] = t17;
200
+ } else t17 = $[32];
201
+ t4 = /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: (weeks[0] ?? []).map(t17) }) });
202
+ t1 = weeks.map((week) => /* @__PURE__ */ jsx("tr", { children: week.map((day_1) => {
203
+ const entries = [...byDay.get(day_1) ?? []].sort(_temp);
204
+ return /* @__PURE__ */ jsxs("td", {
205
+ "data-outside": !day_1.startsWith(month) || void 0,
206
+ "data-empty": entries.length === 0 || void 0,
207
+ "aria-current": day_1 === todayDay ? "date" : void 0,
208
+ children: [/* @__PURE__ */ jsxs("time", {
209
+ dateTime: day_1,
210
+ className: CalendarLayout_module_default.day,
211
+ children: [/* @__PURE__ */ jsx("span", {
212
+ "aria-hidden": "true",
213
+ className: CalendarLayout_module_default.dayNumber,
214
+ children: Number(day_1.slice(8))
215
+ }), /* @__PURE__ */ jsx("span", {
216
+ className: CalendarLayout_module_default.dayLabel,
217
+ children: dayLabel.format(/* @__PURE__ */ new Date(`${day_1}T00:00:00Z`))
218
+ })]
219
+ }), entries.length > 0 ? /* @__PURE__ */ jsx("ul", {
220
+ className: CalendarLayout_module_default.items,
221
+ children: entries.map((t18) => {
222
+ const { item: item_0 } = t18;
223
+ return /* @__PURE__ */ jsx("li", {
224
+ "data-current": isCurrent?.(item_0) === true || void 0,
225
+ children: /* @__PURE__ */ jsx(ItemTitle, {
226
+ href: getItemHref?.(item_0) ?? null,
227
+ current: isCurrent?.(item_0) ?? false,
228
+ children: title !== void 0 ? renderValue(item_0, title) : getItemLabel(item_0)
229
+ })
230
+ }, item_0.id);
231
+ })
232
+ }) : null]
233
+ }, day_1);
234
+ }) }, week[0]));
235
+ $[0] = calendar;
236
+ $[1] = columns;
237
+ $[2] = getItemHref;
238
+ $[3] = getItemLabel;
239
+ $[4] = intl;
240
+ $[5] = isCurrent;
241
+ $[6] = items;
242
+ $[7] = label;
243
+ $[8] = renderValue;
244
+ $[9] = t1;
245
+ $[10] = t2;
246
+ $[11] = t3;
247
+ $[12] = t4;
248
+ $[13] = t5;
249
+ $[14] = t6;
250
+ $[15] = t7;
251
+ } else {
252
+ t1 = $[9];
253
+ t2 = $[10];
254
+ t3 = $[11];
255
+ t4 = $[12];
256
+ t5 = $[13];
257
+ t6 = $[14];
258
+ t7 = $[15];
259
+ }
260
+ let t8;
261
+ if ($[33] !== t1) {
262
+ t8 = /* @__PURE__ */ jsx("tbody", { children: t1 });
263
+ $[33] = t1;
264
+ $[34] = t8;
265
+ } else t8 = $[34];
266
+ let t9;
267
+ if ($[35] !== t2 || $[36] !== t3 || $[37] !== t4 || $[38] !== t8) {
268
+ t9 = /* @__PURE__ */ jsxs("table", {
269
+ className: t2,
270
+ "aria-label": t3,
271
+ children: [t4, t8]
272
+ });
273
+ $[35] = t2;
274
+ $[36] = t3;
275
+ $[37] = t4;
276
+ $[38] = t8;
277
+ $[39] = t9;
278
+ } else t9 = $[39];
279
+ let t10;
280
+ if ($[40] !== t5 || $[41] !== t6 || $[42] !== t7 || $[43] !== t9) {
281
+ t10 = /* @__PURE__ */ jsxs("div", {
282
+ className: t5,
283
+ children: [
284
+ t6,
285
+ t7,
286
+ t9
287
+ ]
288
+ });
289
+ $[40] = t5;
290
+ $[41] = t6;
291
+ $[42] = t7;
292
+ $[43] = t9;
293
+ $[44] = t10;
294
+ } else t10 = $[44];
295
+ return t10;
296
+ }
297
+ function _temp(a, b) {
298
+ return a.value.localeCompare(b.value);
299
+ }
300
+ //#endregion
301
+ export { CalendarLayout };
302
+
303
+ //# sourceMappingURL=CalendarLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalendarLayout.js","names":["ChevronLeft","ChevronRight","currentMonth","isMonth","shiftMonth","isDateRangeValue","Button","IconButton","usePanneauIntl","messages","ListItem","ListLayoutProps","styles","ItemTitle","getItemDays","pad","value","length","String","padStart","dayOf","date","Date","getUTCFullYear","getUTCMonth","getUTCDate","sortKey","start","end","getFirstDay","locale","info","Intl","Locale","getWeekInfo","firstDay","weekInfo","getWeeks","month","year","index","split","map","Number","first","UTC","last","offset","getUTCDay","days","time","getTime","push","Array","from","_","week","slice","CalendarLayout","t0","$","_c","items","columns","renderValue","getItemLabel","getItemHref","isCurrent","label","calendar","intl","t1","t2","t3","t4","t5","t6","t7","today","undefined","t8","t9","title","weeks","monthLabel","DateTimeFormat","timeZone","format","dayLabel","weekday","day","t10","t11","t12","t13","Symbol","for","now","getFullYear","getMonth","getDate","todayDay","byDay","Map","shown","at","forEach","item","field","set","get","more","t14","formatMessage","previousMonth","t15","thisMonth","t16","nextMonth","header","navigation","onMonthChange","total","calendarMore","calendarMoreUnknown","grid","t17","day_0","day_1","entries","sort","_temp","startsWith","dayNumber","t18","item_0","id","a","b","localeCompare","_c","styles"],"sources":["../../src/layouts/CalendarLayout.tsx"],"sourcesContent":["import { ChevronLeft, ChevronRight } from 'lucide-react';\n\nimport { currentMonth, isMonth, shiftMonth } from '@panneau/core';\nimport { isDateRangeValue } from '@panneau/fields/daterange';\nimport { Button, IconButton, usePanneauIntl } from '@panneau/ui';\n\nimport { messages } from '../messages';\nimport type { ListItem, ListLayoutProps } from '../types';\nimport styles from './CalendarLayout.module.css';\nimport { ItemTitle } from './ItemTitle';\nimport { getItemDays } from './calendarDays';\n\nfunction pad(value: number, length = 2): string {\n return String(value).padStart(length, '0');\n}\n\nfunction dayOf(date: Date): string {\n return `${pad(date.getUTCFullYear(), 4)}-${pad(date.getUTCMonth() + 1)}-${pad(date.getUTCDate())}`;\n}\n\n/** What orders the items of a day: a date-time, or the start of a range. */\nfunction sortKey(value: unknown): string {\n if (isDateRangeValue(value)) {\n return value.start ?? value.end ?? '';\n }\n return typeof value === 'string' ? value : '';\n}\n\n/** The first day of the week in a locale: 1 for Monday to 7 for Sunday. */\nfunction getFirstDay(locale: string): number {\n try {\n const info = new Intl.Locale(locale) as Intl.Locale & {\n getWeekInfo?: () => { firstDay: number };\n weekInfo?: { firstDay: number };\n };\n return info.getWeekInfo?.().firstDay ?? info.weekInfo?.firstDay ?? 1;\n } catch {\n return 1;\n }\n}\n\n/** The weeks that show a month, as days (`2026-11-02`), from the first day of the week. */\nfunction getWeeks(month: string, firstDay: number): string[][] {\n const [year = 1970, index = 1] = month.split('-').map(Number);\n const first = new Date(Date.UTC(year, index - 1, 1));\n const last = new Date(Date.UTC(year, index, 0));\n // getUTCDay(): 0 for Sunday; firstDay: 7 for Sunday.\n const offset = (first.getUTCDay() - (firstDay % 7) + 7) % 7;\n const start = Date.UTC(year, index - 1, 1 - offset);\n const days: string[] = [];\n for (let time = start; days.length % 7 !== 0 || time <= last.getTime(); time += 86_400_000) {\n days.push(dayOf(new Date(time)));\n }\n return Array.from({ length: days.length / 7 }, (_, week) => days.slice(week * 7, week * 7 + 7));\n}\n\n/**\n * Items on the days of a month (decision 0044), and a range on each day it covers (decision 0053):\n * the weeks of the month, from the first day of the week of the locale, with the title of each item\n * as its link, in the order of their dates, and buttons to the previous, the next and the current\n * month. On narrow lists, the days that have items, one under the other.\n */\nexport function CalendarLayout({\n items,\n columns,\n renderValue,\n getItemLabel,\n getItemHref,\n isCurrent,\n label,\n calendar,\n}: ListLayoutProps) {\n const intl = usePanneauIntl();\n const today = currentMonth();\n const month = calendar !== undefined && isMonth(calendar.month) ? calendar.month : today;\n const [year = 1970, index = 1] = month.split('-').map(Number);\n const [title] = columns;\n const weeks = getWeeks(month, getFirstDay(intl.locale));\n const monthLabel = new Intl.DateTimeFormat(intl.locale, {\n month: 'long',\n year: 'numeric',\n timeZone: 'UTC',\n }).format(new Date(Date.UTC(year, index - 1, 1)));\n const dayLabel = new Intl.DateTimeFormat(intl.locale, {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n timeZone: 'UTC',\n });\n const weekday = (format: 'short' | 'long') =>\n new Intl.DateTimeFormat(intl.locale, { weekday: format, timeZone: 'UTC' });\n const now = new Date();\n const todayDay = `${pad(now.getFullYear(), 4)}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`;\n\n const byDay = new Map<string, { item: ListItem; value: string }[]>();\n if (calendar !== undefined) {\n const shown = { first: weeks[0]?.[0] ?? '', last: weeks.at(-1)?.at(-1) ?? '' };\n items.forEach((item) => {\n const value = item[calendar.field];\n getItemDays(value, shown, calendar.timeZone).forEach((day) => {\n byDay.set(day, [...(byDay.get(day) ?? []), { item, value: sortKey(value) }]);\n });\n });\n }\n const more = calendar?.more ?? null;\n\n return (\n <div className={styles.calendar}>\n <div className={styles.header}>\n <p className={styles.month} aria-live=\"polite\">\n {monthLabel}\n </p>\n <div className={styles.navigation}>\n <IconButton\n icon={ChevronLeft}\n label={intl.formatMessage(messages.previousMonth)}\n onPress={() => calendar?.onMonthChange(shiftMonth(month, -1))}\n />\n <Button\n size=\"sm\"\n isDisabled={month === today}\n onPress={() => calendar?.onMonthChange(today)}\n >\n {intl.formatMessage(messages.thisMonth)}\n </Button>\n <IconButton\n icon={ChevronRight}\n label={intl.formatMessage(messages.nextMonth)}\n onPress={() => calendar?.onMonthChange(shiftMonth(month, 1))}\n />\n </div>\n </div>\n {more !== null ? (\n <p className={styles.more} role=\"status\">\n {more.total !== null\n ? intl.formatMessage(messages.calendarMore, {\n shown: items.length,\n total: more.total,\n })\n : intl.formatMessage(messages.calendarMoreUnknown, {\n shown: items.length,\n })}\n </p>\n ) : null}\n <table className={styles.grid} aria-label={`${label}, ${monthLabel}`}>\n <thead>\n <tr>\n {(weeks[0] ?? []).map((day) => {\n const date = new Date(`${day}T00:00:00Z`);\n return (\n <th key={day} scope=\"col\">\n <abbr title={weekday('long').format(date)}>\n {weekday('short').format(date)}\n </abbr>\n </th>\n );\n })}\n </tr>\n </thead>\n <tbody>\n {weeks.map((week) => (\n <tr key={week[0]}>\n {week.map((day) => {\n const entries = [...(byDay.get(day) ?? [])].sort((a, b) =>\n a.value.localeCompare(b.value),\n );\n return (\n <td\n key={day}\n data-outside={!day.startsWith(month) || undefined}\n data-empty={entries.length === 0 || undefined}\n aria-current={day === todayDay ? 'date' : undefined}\n >\n <time dateTime={day} className={styles.day}>\n <span aria-hidden=\"true\" className={styles.dayNumber}>\n {Number(day.slice(8))}\n </span>\n <span className={styles.dayLabel}>\n {dayLabel.format(new Date(`${day}T00:00:00Z`))}\n </span>\n </time>\n {entries.length > 0 ? (\n <ul className={styles.items}>\n {entries.map(({ item }) => (\n <li\n key={item.id}\n data-current={\n isCurrent?.(item) === true || undefined\n }\n >\n <ItemTitle\n href={getItemHref?.(item) ?? null}\n current={isCurrent?.(item) ?? false}\n >\n {title !== undefined\n ? renderValue(item, title)\n : getItemLabel(item)}\n </ItemTitle>\n </li>\n ))}\n </ul>\n ) : null}\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAYA,SAASe,IAAIC,OAAeC,SAAS,GAAW;CAC5C,OAAOC,OAAOF,KAAK,CAAC,CAACG,SAASF,QAAQ,GAAG;AAC7C;AAEA,SAASG,MAAMC,MAAoB;CAC/B,OAAO,GAAGN,IAAIM,KAAKE,eAAe,GAAG,CAAC,EAAC,GAAIR,IAAIM,KAAKG,YAAY,IAAI,CAAC,EAAC,GAAIT,IAAI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panneau-calendar-layout-calendar";
4
+ var header = "panneau-calendar-layout-header";
5
+ var month = "panneau-calendar-layout-month";
6
+ var navigation = "panneau-calendar-layout-navigation";
7
+ var more = "panneau-calendar-layout-more";
8
+ var grid = "panneau-calendar-layout-grid";
9
+ var day = "panneau-calendar-layout-day";
10
+ var dayNumber = "panneau-calendar-layout-day-number";
11
+ var dayLabel = "panneau-calendar-layout-day-label";
12
+ var items = "panneau-calendar-layout-items";
13
+ var CalendarLayout_module_default = {
14
+ calendar,
15
+ header,
16
+ month,
17
+ navigation,
18
+ more,
19
+ grid,
20
+ day,
21
+ dayNumber,
22
+ dayLabel,
23
+ items
24
+ };
25
+ //#endregion
26
+ export { calendar, day, dayLabel, dayNumber, CalendarLayout_module_default as default, grid, header, items, month, more, navigation };
27
+
28
+ //# sourceMappingURL=CalendarLayout.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalendarLayout.module.js","names":[],"sources":["../../src/layouts/CalendarLayout.module.css"],"sourcesContent":[".calendar {\n container-type: inline-size;\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-2);\n}\n\n.header {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: var(--panneau-space-2);\n}\n\n.month {\n margin: 0;\n font-size: var(--panneau-font-size-lg);\n font-weight: var(--panneau-font-weight-medium);\n}\n\n.month::first-letter {\n text-transform: uppercase;\n}\n\n.navigation {\n display: flex;\n align-items: center;\n gap: var(--panneau-space-1);\n}\n\n.more {\n margin: 0;\n font-size: var(--panneau-font-size-sm);\n color: var(--panneau-color-text-muted);\n}\n\n.grid {\n width: 100%;\n table-layout: fixed;\n border-collapse: collapse;\n background-color: var(--panneau-color-surface);\n}\n\n.grid th {\n padding: var(--panneau-space-1);\n font-size: var(--panneau-font-size-sm);\n font-weight: var(--panneau-font-weight-medium);\n color: var(--panneau-color-text-muted);\n text-align: start;\n}\n\n.grid abbr {\n text-decoration: none;\n}\n\n.grid td {\n height: 6rem;\n padding: var(--panneau-space-1);\n vertical-align: top;\n border: var(--panneau-border-width) solid var(--panneau-color-border);\n}\n\n.grid td[data-outside] {\n background-color: var(--panneau-color-surface-sunken);\n color: var(--panneau-color-text-muted);\n}\n\n.day {\n display: block;\n font-size: var(--panneau-font-size-sm);\n}\n\n.grid td[aria-current='date'] .dayNumber {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 1.5rem;\n height: 1.5rem;\n color: var(--panneau-color-accent-text);\n background-color: var(--panneau-color-accent);\n border-radius: 999px;\n}\n\n/* The full date, for assistive technologies; shown on narrow lists. */\n.dayLabel {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n.items {\n display: flex;\n flex-direction: column;\n gap: 2px;\n margin: var(--panneau-space-1) 0 0;\n padding: 0;\n list-style: none;\n font-size: var(--panneau-font-size-sm);\n}\n\n.items li {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.items li[data-current] {\n font-weight: var(--panneau-font-weight-medium);\n}\n\n/* On narrow lists: the days that have items, one under the other. */\n@container (max-width: 40rem) {\n .grid,\n .grid tbody,\n .grid tr,\n .grid td {\n display: block;\n width: auto;\n height: auto;\n }\n\n .grid thead,\n .grid td[data-empty],\n .dayNumber {\n display: none;\n }\n\n .grid td {\n border-width: 0 0 var(--panneau-border-width);\n padding: var(--panneau-space-2) 0;\n }\n\n .grid td[data-outside] {\n background: none;\n }\n\n .dayLabel {\n position: static;\n width: auto;\n height: auto;\n overflow: visible;\n clip-path: none;\n font-weight: var(--panneau-font-weight-medium);\n }\n\n .items li {\n white-space: normal;\n }\n}\n"],"mappings":""}
@@ -17,6 +17,11 @@
17
17
  border-radius: var(--panneau-radius-lg);
18
18
  }
19
19
 
20
+ .panneau-cards-layout-card[data-current] {
21
+ border-color: var(--panneau-color-accent);
22
+ box-shadow: inset 0 0 0 1px var(--panneau-color-accent);
23
+ }
24
+
20
25
  .panneau-cards-layout-card[data-selected] {
21
26
  background-color: var(--panneau-color-accent-subtle);
22
27
  border-color: var(--panneau-color-border-control);
@@ -1,4 +1,4 @@
1
- import type { ListLayoutProps } from '../types';
1
+ import type { ListLayoutProps } from '../types.js';
2
2
  /** Items as cards: the first column is the title, the others are listed under it. */
3
- export declare function CardsLayout({ items, columns, renderValue, getItemLabel, getItemHref, selectable, isSelected, onToggle, renderActions, label, pageSelection, }: ListLayoutProps): import("react").JSX.Element;
3
+ export declare function CardsLayout({ items, columns, renderValue, getItemLabel, getItemHref, isCurrent, selectable, isSelected, onToggle, renderActions, label, pageSelection, }: ListLayoutProps): import("react").JSX.Element;
4
4
  //# sourceMappingURL=CardsLayout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardsLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/CardsLayout.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU,EACV,QAAQ,EACR,aAAa,EACb,KAAK,EACL,aAAa,GAChB,EAAE,eAAe,+BAqDjB"}
1
+ {"version":3,"file":"CardsLayout.d.ts","sourceRoot":"","sources":["../../src/layouts/CardsLayout.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,EACR,aAAa,EACb,KAAK,EACL,aAAa,GAChB,EAAE,eAAe,+BA6DjB"}