@mechane-ai/elements 0.40.0 → 0.41.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/README.md CHANGED
@@ -69,7 +69,7 @@ Every path below belongs to `@mechane-ai/elements`. There is one package, versio
69
69
  | ---------------------- | ----------------------------------------------------------------------------------- |
70
70
  | Root | Buttons, text, surfaces, disclosure, avatars, and CopyValue. |
71
71
  | `/forms` | Fields, inputs, selection, appearance picking, file picking, and settings sections. |
72
- | `/forms/dates` | Civil-date calendars and range selection. |
72
+ | `/forms/dates` | Civil-date pickers, range selection, and a controlled event month. |
73
73
  | `/overlays` | Dialog, Drawer, Menu, Popover, Preview, Tooltip, and AlertDialog. |
74
74
  | `/feedback` | Async regions, skeletons, progress, meters, notices, empty states, and toasts. |
75
75
  | `/navigation` | Tabs, page navigation, breadcrumbs, skip links, and shortcut labels. |
@@ -670,4 +670,81 @@ function q({ label: e, value: t, onValueChange: n, formatValue: r, presets: i, v
670
670
  })] })
671
671
  });
672
672
  }
673
- export { F as Calendar, V as DatePicker, H as DateRangePicker, K as MonthPicker, q as MonthRangePicker, D as addCalendarDays, O as addCalendarMonths, T as parseCalendarDate, E as parseCalendarMonth, C as serializeCalendarDate, w as serializeCalendarMonth };
673
+ // packages/forms/src/dates/event-month.tsx
674
+ var J = 2;
675
+ function Y({ label: e, locale: t, timeZone: n, today: r, selected: i, weekStartsOn: a = 1, itemsByDate: o, onSelect: s }) {
676
+ let c = C(i), l = C(r);
677
+ function u(e) {
678
+ let t = T(e);
679
+ t !== void 0 && s(t);
680
+ }
681
+ return /* @__PURE__ */ p(v.Calendar, {
682
+ "aria-label": e,
683
+ mode: "single",
684
+ locale: t,
685
+ timeZone: n,
686
+ today: l,
687
+ month: w(i),
688
+ value: c,
689
+ weekStartsOn: a,
690
+ weekdayFormat: "short",
691
+ showOutsideDays: !0,
692
+ onValueChange: (e) => {
693
+ typeof e == "string" && u(e);
694
+ },
695
+ onFocusedChange: (e, t) => {
696
+ t.reason === "list-navigation" && u(e);
697
+ },
698
+ children: /* @__PURE__ */ m(v.CalendarGrid, {
699
+ className: "xh8yej3 x140o2bo x1mwwwfo x1y0btm7 xmkeg23 x1ey3b81 xpvm0e4 xbixft",
700
+ children: [/* @__PURE__ */ p(v.CalendarWeekdays, { children: (e) => /* @__PURE__ */ p(v.CalendarWeekday, {
701
+ index: e,
702
+ className: "xn9t2bk x14w6jbu x153jb6y x2b8uid xy8obcc xk4h15q"
703
+ }) }), /* @__PURE__ */ p(v.CalendarWeeks, { children: (e) => {
704
+ let n = T(e.date);
705
+ if (n === void 0) return null;
706
+ let r = o.get(e.date) ?? [], a = r.length - J, s = r.slice(0, J), u = [
707
+ k(n, t),
708
+ ...s.map((e) => e.label),
709
+ a > 0 && `+${a} more`
710
+ ].filter(Boolean).join(", ");
711
+ return /* @__PURE__ */ p(v.CalendarDay, {
712
+ value: e.date,
713
+ "aria-label": u,
714
+ ...{
715
+ 0: { className: "x1y0btm7 xmkeg23 x1ey3b81 x16dsc37 x1ypdohk xpvm0e4 xif5pkx x1t137rt x9v5kkp x12ei19c xx9gdjd x2ssjo2" },
716
+ 2: { className: "x1y0btm7 xmkeg23 x1ey3b81 x16dsc37 x1ypdohk x1t137rt x9v5kkp x12ei19c xx9gdjd x2ssjo2 x153jb6y x1r7kqkb" },
717
+ 1: { className: "x1y0btm7 xmkeg23 x1ey3b81 x16dsc37 x1ypdohk x1t137rt x9v5kkp x12ei19c xx9gdjd x2ssjo2 x1r8u7ye" },
718
+ 3: { className: "x1y0btm7 xmkeg23 x1ey3b81 x16dsc37 x1ypdohk x1t137rt x9v5kkp x12ei19c xx9gdjd x2ssjo2 x153jb6y x1r8u7ye" }
719
+ }[(n.month !== i.month) << 1 | e.date === c],
720
+ children: /* @__PURE__ */ m("div", {
721
+ className: "xrvj5dj x10ukxgv xunmzkg xefclja x13wpdut x1s01oa9",
722
+ "aria-hidden": "true",
723
+ children: [
724
+ /* @__PURE__ */ p("span", {
725
+ ...{
726
+ 0: { className: "x1lqcxt8 x14w6jbu xy8obcc x1ok0vyi" },
727
+ 1: { className: "x1lqcxt8 x14w6jbu xy8obcc x1ok0vyi x7ixh4y x1r8u7ye xtjd4bd" }
728
+ }[e.date === l | 0],
729
+ children: n.day
730
+ }),
731
+ s.map((e) => /* @__PURE__ */ p("span", {
732
+ className: "x1lliihq xb3r6kr xlyipyv xuxw1ft x14w6jbu xy8obcc x1r7kqkb x1ok0vyi",
733
+ children: e.label
734
+ }, e.id)),
735
+ a > 0 && /* @__PURE__ */ m("span", {
736
+ className: "xy8obcc x153jb6y xuxw1ft xb3r6kr",
737
+ children: [
738
+ "+",
739
+ a,
740
+ " more"
741
+ ]
742
+ })
743
+ ]
744
+ })
745
+ });
746
+ } })]
747
+ })
748
+ });
749
+ }
750
+ export { F as Calendar, V as DatePicker, H as DateRangePicker, Y as EventMonth, K as MonthPicker, q as MonthRangePicker, D as addCalendarDays, O as addCalendarMonths, T as parseCalendarDate, E as parseCalendarMonth, C as serializeCalendarDate, w as serializeCalendarMonth };
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { CalendarDate } from './civil.ts';
3
+ export type EventMonthItem = {
4
+ readonly id: string;
5
+ readonly label: string;
6
+ };
7
+ export type EventMonthProps = {
8
+ readonly label: string;
9
+ readonly locale: string;
10
+ readonly timeZone: string;
11
+ readonly today: CalendarDate;
12
+ readonly selected: CalendarDate;
13
+ readonly weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
14
+ readonly itemsByDate: ReadonlyMap<string, ReadonlyArray<EventMonthItem>>;
15
+ readonly onSelect: (date: CalendarDate) => void;
16
+ };
17
+ export declare function EventMonth({ label, locale, timeZone, today, selected, weekStartsOn, itemsByDate, onSelect, }: EventMonthProps): ReactNode;
@@ -11,3 +11,5 @@ export type { MonthPickerProps } from './month-picker.tsx';
11
11
  export { MonthPicker } from './month-picker.tsx';
12
12
  export type { MonthRangePickerProps, MonthRangePreset } from './month-range-picker.tsx';
13
13
  export { MonthRangePicker } from './month-range-picker.tsx';
14
+ export type { EventMonthItem, EventMonthProps } from './event-month.tsx';
15
+ export { EventMonth } from './event-month.tsx';
package/dist/styles2.css CHANGED
@@ -700,6 +700,10 @@
700
700
  accent-color: var(--x169lqhw);
701
701
  }
702
702
 
703
+ .x10ukxgv {
704
+ align-content: start;
705
+ }
706
+
703
707
  .x1pha0wt {
704
708
  align-items: baseline;
705
709
  }
@@ -1410,6 +1414,10 @@
1410
1414
  justify-content: start;
1411
1415
  }
1412
1416
 
1417
+ .x1lqcxt8 {
1418
+ justify-self: start;
1419
+ }
1420
+
1413
1421
  .x1wjjqco {
1414
1422
  letter-spacing: var(--xgto76l);
1415
1423
  }
@@ -2702,6 +2710,10 @@
2702
2710
  min-height: 80px;
2703
2711
  }
2704
2712
 
2713
+ .xefclja {
2714
+ min-height: 88px;
2715
+ }
2716
+
2705
2717
  .x2zujid {
2706
2718
  min-height: 35px;
2707
2719
  }
@@ -3128,6 +3140,12 @@
3128
3140
  }
3129
3141
  }
3130
3142
 
3143
+ @media (width <= 600px) {
3144
+ .x13wpdut.x13wpdut {
3145
+ min-height: 52px;
3146
+ }
3147
+ }
3148
+
3131
3149
  @container inspector (width <= 860px) {
3132
3150
  .x1mg79u0.x1mg79u0 {
3133
3151
  border-top-width: 1px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mechane-ai/elements",
3
- "version": "0.40.0",
3
+ "version": "0.41.0",
4
4
  "description": "Elements by Mechane — React components for applications, AI interfaces, and analytical graphics",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -29,3 +29,6 @@ toolbar.
29
29
  Give every table a query. Use local search and filter dimensions for complete finite data. Route remote search and
30
30
  filters through the collection owner before the server takes a page. A table inside its collection's query frame reuses
31
31
  the same controls. Record a specific reason for a static reference table or an unavailable capability.
32
+
33
+ Use `EventMonth` from `/forms/dates` for an event grid. Supply display labels per civil date and handle the selected day
34
+ in the caller. Use the grid across the working pane and show the selected day's actions and full agenda separately.