@bearmenu/ui 0.8.4 → 0.8.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.
Files changed (150) hide show
  1. package/dist/chunk-637L7XQ3.js +85 -0
  2. package/dist/chunk-6XMYEZVR.js +26 -0
  3. package/dist/chunk-DNSXMHYX.js +8 -0
  4. package/dist/chunk-FDITZ2VM.js +16 -0
  5. package/dist/chunk-GPH6L4DX.js +55 -0
  6. package/dist/{chunk-N2KNBPAQ.js → chunk-QXHMPJ35.js} +1 -0
  7. package/dist/chunk-TT3WFS6S.js +379 -0
  8. package/dist/chunk-UXWAOISG.js +170 -0
  9. package/dist/{chunk-UZ3PCIE5.js → chunk-XWMRABZW.js} +2 -2
  10. package/dist/{chunk-VBA45GLP.js → chunk-ZDAHKI3A.js} +12 -2
  11. package/dist/components/card.d.ts +2 -2
  12. package/dist/components/card.js +4 -127
  13. package/dist/components/category-deck.d.ts +50 -0
  14. package/dist/components/category-deck.js +128 -0
  15. package/dist/components/concept-card.d.ts +43 -0
  16. package/dist/components/concept-card.js +81 -0
  17. package/dist/components/coverflow.d.ts +123 -0
  18. package/dist/components/coverflow.js +300 -0
  19. package/dist/components/day-rail-chip.d.ts +82 -0
  20. package/dist/components/day-rail-chip.js +105 -0
  21. package/dist/components/drift-rail.d.ts +28 -0
  22. package/dist/components/drift-rail.js +3 -0
  23. package/dist/components/event-card.d.ts +97 -0
  24. package/dist/components/event-card.js +164 -0
  25. package/dist/components/event-compact-row.d.ts +73 -0
  26. package/dist/components/event-compact-row.js +134 -0
  27. package/dist/components/event-day-header.d.ts +65 -0
  28. package/dist/components/event-day-header.js +95 -0
  29. package/dist/components/event-day-separator.d.ts +46 -0
  30. package/dist/components/event-day-separator.js +50 -0
  31. package/dist/components/event-detail-panel.d.ts +80 -0
  32. package/dist/components/event-detail-panel.js +251 -0
  33. package/dist/components/event-hub-hero.d.ts +34 -0
  34. package/dist/components/event-hub-hero.js +57 -0
  35. package/dist/components/event-index-row.d.ts +68 -0
  36. package/dist/components/event-index-row.js +84 -0
  37. package/dist/components/event-list-row-wide.d.ts +101 -0
  38. package/dist/components/event-list-row-wide.js +218 -0
  39. package/dist/components/event-list-row.d.ts +82 -0
  40. package/dist/components/event-list-row.js +173 -0
  41. package/dist/components/event-poster-fallback.d.ts +20 -0
  42. package/dist/components/event-poster-fallback.js +3 -0
  43. package/dist/components/event-types.d.ts +122 -0
  44. package/dist/components/event-types.js +2 -0
  45. package/dist/components/events-empty-state.d.ts +44 -0
  46. package/dist/components/events-empty-state.js +73 -0
  47. package/dist/components/facet-group.d.ts +93 -0
  48. package/dist/components/facet-group.js +222 -0
  49. package/dist/components/featured-rail-item.d.ts +42 -0
  50. package/dist/components/featured-rail-item.js +88 -0
  51. package/dist/components/hour-band.d.ts +68 -0
  52. package/dist/components/hour-band.js +53 -0
  53. package/dist/components/hour-group.d.ts +67 -0
  54. package/dist/components/hour-group.js +59 -0
  55. package/dist/components/motion-icon-controls.js +3 -379
  56. package/dist/components/multi-select-combobox.js +1 -1
  57. package/dist/components/place-about-tab.js +3 -3
  58. package/dist/components/place-details-mobile.js +3 -3
  59. package/dist/components/poster-stack.d.ts +30 -0
  60. package/dist/components/poster-stack.js +104 -0
  61. package/dist/components/poster-tape.d.ts +36 -0
  62. package/dist/components/poster-tape.js +64 -0
  63. package/dist/components/poster-wall.d.ts +25 -0
  64. package/dist/components/poster-wall.js +183 -0
  65. package/dist/components/quiet-stretch.d.ts +43 -0
  66. package/dist/components/quiet-stretch.js +54 -0
  67. package/dist/components/section-header.d.ts +53 -0
  68. package/dist/components/section-header.js +63 -0
  69. package/dist/components/segmented-nav.d.ts +62 -0
  70. package/dist/components/segmented-nav.js +54 -0
  71. package/dist/components/skeleton-card.js +1 -1
  72. package/dist/components/skeleton.d.ts +17 -0
  73. package/dist/components/skeleton.js +1 -1
  74. package/dist/components/tag-group.js +3 -26
  75. package/dist/components/tag.d.ts +2 -2
  76. package/dist/components/tag.js +1 -1
  77. package/dist/components/timeline-band.d.ts +46 -0
  78. package/dist/components/timeline-band.js +5 -0
  79. package/dist/components/venue-events-block.d.ts +143 -0
  80. package/dist/components/venue-events-block.js +222 -0
  81. package/dist/components/weekend-panel.d.ts +44 -0
  82. package/dist/components/weekend-panel.js +231 -0
  83. package/package.json +1 -1
  84. package/src/components/card.tsx +44 -1
  85. package/src/components/category-deck.stories.tsx +96 -0
  86. package/src/components/category-deck.tsx +227 -0
  87. package/src/components/concept-card.stories.tsx +80 -0
  88. package/src/components/concept-card.tsx +143 -0
  89. package/src/components/coverflow.stories.tsx +240 -0
  90. package/src/components/coverflow.test.tsx +193 -0
  91. package/src/components/coverflow.tsx +550 -0
  92. package/src/components/day-rail-chip.stories.tsx +145 -0
  93. package/src/components/day-rail-chip.tsx +201 -0
  94. package/src/components/drift-rail.stories.tsx +92 -0
  95. package/src/components/drift-rail.tsx +86 -0
  96. package/src/components/event-card.stories.tsx +248 -0
  97. package/src/components/event-card.test.tsx +188 -0
  98. package/src/components/event-card.tsx +329 -0
  99. package/src/components/event-compact-row.stories.tsx +221 -0
  100. package/src/components/event-compact-row.test.tsx +51 -0
  101. package/src/components/event-compact-row.tsx +270 -0
  102. package/src/components/event-day-header.stories.tsx +124 -0
  103. package/src/components/event-day-header.tsx +180 -0
  104. package/src/components/event-day-separator.stories.tsx +70 -0
  105. package/src/components/event-day-separator.tsx +95 -0
  106. package/src/components/event-detail-panel.stories.tsx +191 -0
  107. package/src/components/event-detail-panel.tsx +360 -0
  108. package/src/components/event-hub-hero.stories.tsx +66 -0
  109. package/src/components/event-hub-hero.tsx +110 -0
  110. package/src/components/event-index-row.stories.tsx +116 -0
  111. package/src/components/event-index-row.tsx +181 -0
  112. package/src/components/event-list-row-wide.stories.tsx +204 -0
  113. package/src/components/event-list-row-wide.tsx +386 -0
  114. package/src/components/event-list-row.stories.tsx +159 -0
  115. package/src/components/event-list-row.tsx +335 -0
  116. package/src/components/event-poster-fallback.stories.tsx +52 -0
  117. package/src/components/event-poster-fallback.tsx +31 -0
  118. package/src/components/event-types.ts +137 -0
  119. package/src/components/events-empty-state.stories.tsx +59 -0
  120. package/src/components/events-empty-state.tsx +131 -0
  121. package/src/components/facet-group.stories.tsx +247 -0
  122. package/src/components/facet-group.test.tsx +225 -0
  123. package/src/components/facet-group.tsx +352 -0
  124. package/src/components/featured-rail-item.stories.tsx +86 -0
  125. package/src/components/featured-rail-item.tsx +153 -0
  126. package/src/components/hour-band.stories.tsx +159 -0
  127. package/src/components/hour-band.tsx +126 -0
  128. package/src/components/hour-group.stories.tsx +100 -0
  129. package/src/components/hour-group.tsx +124 -0
  130. package/src/components/poster-stack.stories.tsx +68 -0
  131. package/src/components/poster-stack.tsx +155 -0
  132. package/src/components/poster-tape.stories.tsx +70 -0
  133. package/src/components/poster-tape.tsx +122 -0
  134. package/src/components/poster-wall.stories.tsx +95 -0
  135. package/src/components/poster-wall.tsx +220 -0
  136. package/src/components/quiet-stretch.stories.tsx +62 -0
  137. package/src/components/quiet-stretch.tsx +115 -0
  138. package/src/components/section-header.stories.tsx +70 -0
  139. package/src/components/section-header.tsx +134 -0
  140. package/src/components/segmented-nav.stories.tsx +118 -0
  141. package/src/components/segmented-nav.tsx +113 -0
  142. package/src/components/skeleton.tsx +18 -0
  143. package/src/components/tag.tsx +11 -1
  144. package/src/components/timeline-band.stories.tsx +206 -0
  145. package/src/components/timeline-band.tsx +207 -0
  146. package/src/components/venue-events-block.stories.tsx +216 -0
  147. package/src/components/venue-events-block.tsx +408 -0
  148. package/src/components/weekend-panel.stories.tsx +92 -0
  149. package/src/components/weekend-panel.tsx +322 -0
  150. package/src/globals.css +19 -0
@@ -0,0 +1,97 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React$1 from 'react';
3
+ import { EventPreview, EventCardLabels, EventFormatters } from './event-types.js';
4
+
5
+ /**
6
+ * EventCard — the poster card every events surface reuses.
7
+ *
8
+ * RENDERS AN ANCHOR WHENEVER `href` IS GIVEN, and that is not incidental. The
9
+ * consumer app's events hub was measured serving 2,751 words and 50 links in
10
+ * its raw HTML but only 12 links — none of them to an event — in the rendered
11
+ * DOM, because the hydrated cards were `<button onClick>` rather than links.
12
+ * Pass `href` AND `onClick`: the anchor is real for crawlers, middle-click and
13
+ * "open in new tab", while `onClick` opens the detail sheet (call
14
+ * `preventDefault()` there). Falls back to a `<button>` when only `onClick` is
15
+ * given, and a plain `<div>` when neither is.
16
+ *
17
+ * Like `place-card.tsx`, this takes a DS-owned view model, injected labels and
18
+ * injected formatters — no app schema, no app hooks, no i18n, and a plain
19
+ * `<img>` so it works outside Next.
20
+ */
21
+ type EventCardLinkProps = {
22
+ href: string;
23
+ className?: string;
24
+ children: React.ReactNode;
25
+ onClick?: (mouseEvent: React.MouseEvent) => void;
26
+ };
27
+ type EventCardProps = {
28
+ event: EventPreview;
29
+ labels: EventCardLabels;
30
+ formatters: EventFormatters;
31
+ /**
32
+ * Poster ratio. `4/3` is the house shape shared with the dish/drink/place
33
+ * cards — the default, and what every card sitting in a column should use.
34
+ * `3/4` is the hub's original portrait deck/rail/tape ratio. `4/5` matches
35
+ * the Instagram source most real posters ship at (1080x1350) and is used by
36
+ * the hub's editorial poster surfaces (`CategoryDeck`, `PosterTape`,
37
+ * `Coverflow`) — it crops less than `3/4` and is not the same as it.
38
+ */
39
+ posterAspect?: "4/3" | "3/4" | "4/5";
40
+ /** Larger title — the featured/highlight slot. Never a clamp: the title wraps in full either way. */
41
+ emphasis?: boolean;
42
+ /** Top-left overlay pill (the design's "Busy" hype marker). Include its icon. */
43
+ badge?: React.ReactNode;
44
+ /** Bottom-left overlay pill naming the category. Include its icon. */
45
+ tagLabel?: React.ReactNode;
46
+ /**
47
+ * Caller-supplied display labels, rendered as small chips in the text area
48
+ * beneath the venue/meta line. `EventPreview.tags` is taxonomy coordinates
49
+ * (`slug`/`axis_slug`), not display text, so the DS cannot render them
50
+ * itself. Distinct from `tagLabel`: that is a single overlay pill on the
51
+ * poster (the design's category affordance for posters); this is an
52
+ * in-body list for the rest of an event's tags. Cap the count at the call
53
+ * site — this card does not.
54
+ */
55
+ tags?: string[];
56
+ /**
57
+ * The live line, fully composed by the caller (e.g. "Live now · ends around
58
+ * 23:00"). Composed outside the DS deliberately: the clause order differs by
59
+ * locale, and "is this live" depends on the app's clock, not the DS's.
60
+ */
61
+ liveStatus?: string;
62
+ /** Hide the day/time line — the timeline supplies its own hour heading. */
63
+ hideWhen?: boolean;
64
+ /** Overrides the day label when the card appears outside its own day section. */
65
+ dayLabel?: string;
66
+ /** Append the entry fee to the meta line. Off by default, matching the design's base card. */
67
+ showPrice?: boolean;
68
+ href?: string;
69
+ /** Defaults to a plain `<a>`. Pass `next/link` in a Next app. */
70
+ linkComponent?: React.ComponentType<EventCardLinkProps>;
71
+ onClick?: (event: EventPreview, mouseEvent: React.MouseEvent) => void;
72
+ className?: string;
73
+ /** Forwarded to the poster's `loading` attribute (`"eager"` when true). */
74
+ priority?: boolean;
75
+ /** Rendered instead of the poster when it's absent or failed to load. Defaults to `<EventPosterFallback />`. */
76
+ fallback?: React.ReactNode;
77
+ };
78
+ declare const EventCard: React$1.NamedExoticComponent<EventCardProps>;
79
+ type EventCardSkeletonProps = {
80
+ /** Matches `EventCardProps["posterAspect"]` — keep the poster box the same shape. */
81
+ posterAspect?: "4/3" | "3/4" | "4/5";
82
+ /** Matches `EventCardProps["emphasis"]` — the featured slot's taller title. */
83
+ emphasis?: boolean;
84
+ /** Matches `EventCardProps["hideWhen"]` — drops the day/time line placeholder too. */
85
+ hideWhen?: boolean;
86
+ className?: string;
87
+ };
88
+ /**
89
+ * Mirrors `<EventCard>`'s geometry so nothing shifts when data lands — with
90
+ * one honest caveat since the title stopped being clamped: the placeholder
91
+ * reserves two lines (three under `emphasis`), and a real title longer than
92
+ * that will grow the card past the skeleton it replaces. Reserving more would
93
+ * only move the shift to the far commoner short-title case.
94
+ */
95
+ declare function EventCardSkeleton({ posterAspect, emphasis, hideWhen, className, }: EventCardSkeletonProps): react_jsx_runtime.JSX.Element;
96
+
97
+ export { EventCard, type EventCardLinkProps, type EventCardProps, EventCardSkeleton, type EventCardSkeletonProps };
@@ -0,0 +1,164 @@
1
+ import { TagGroup } from '../chunk-6XMYEZVR.js';
2
+ import { Tag } from '../chunk-ZDAHKI3A.js';
3
+ import { resolveEventEntryFee } from '../chunk-DNSXMHYX.js';
4
+ import { EventPosterFallback } from '../chunk-FDITZ2VM.js';
5
+ import { Skeleton } from '../chunk-QXHMPJ35.js';
6
+ import { cn } from '../chunk-FEK5XGZW.js';
7
+ import { __objRest, __spreadValues } from '../chunk-3GWWZKX7.js';
8
+ import { memo, useState } from 'react';
9
+ import { Gift, MapPin, Radio } from 'lucide-react';
10
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
11
+
12
+ function DefaultLink(_a) {
13
+ var _b = _a, { href } = _b, props = __objRest(_b, ["href"]);
14
+ return /* @__PURE__ */ jsx("a", __spreadValues({ href }, props));
15
+ }
16
+ var PILL_BASE = "inline-flex items-center gap-1 h-6 max-w-[70%] px-2 rounded-full text-[11px] font-semibold";
17
+ var EventCard = memo(function EventCard2({
18
+ event,
19
+ labels,
20
+ formatters,
21
+ posterAspect = "4/3",
22
+ emphasis,
23
+ badge,
24
+ tagLabel,
25
+ tags,
26
+ liveStatus,
27
+ hideWhen,
28
+ dayLabel,
29
+ showPrice,
30
+ href,
31
+ linkComponent: LinkComponent = DefaultLink,
32
+ onClick,
33
+ className,
34
+ priority,
35
+ fallback = /* @__PURE__ */ jsx(EventPosterFallback, {})
36
+ }) {
37
+ var _a;
38
+ const [imgError, setImgError] = useState(false);
39
+ const time = hideWhen ? "" : formatters.time(event.starts_at);
40
+ const fee = resolveEventEntryFee(event);
41
+ const showPoster = !!event.poster_url && !imgError;
42
+ const venue = (_a = event.place_name) != null ? _a : event.location;
43
+ const body = /* @__PURE__ */ jsxs(Fragment, { children: [
44
+ /* @__PURE__ */ jsxs(
45
+ "div",
46
+ {
47
+ className: cn(
48
+ "relative overflow-hidden rounded-xl bg-muted",
49
+ posterAspect === "3/4" ? "aspect-[3/4]" : posterAspect === "4/5" ? "aspect-[4/5]" : "aspect-[4/3]"
50
+ ),
51
+ children: [
52
+ showPoster ? (
53
+ // eslint-disable-next-line @next/next/no-img-element
54
+ /* @__PURE__ */ jsx(
55
+ "img",
56
+ {
57
+ src: event.poster_url,
58
+ alt: event.title,
59
+ title: event.title,
60
+ loading: priority ? "eager" : "lazy",
61
+ decoding: "async",
62
+ className: "h-full w-full object-cover",
63
+ onError: () => setImgError(true)
64
+ }
65
+ )
66
+ ) : fallback,
67
+ /* @__PURE__ */ jsxs("div", { className: "absolute inset-x-2 top-2 flex items-start justify-between gap-2", children: [
68
+ badge ? /* @__PURE__ */ jsx("span", { className: cn(PILL_BASE, "bg-black/55 text-white"), children: badge }) : /* @__PURE__ */ jsx("span", {}),
69
+ fee.kind === "free" && /* @__PURE__ */ jsxs("span", { className: cn(PILL_BASE, "bg-success font-bold text-success-foreground"), children: [
70
+ /* @__PURE__ */ jsx(Gift, { className: "h-3 w-3", "aria-hidden": true }),
71
+ labels.free
72
+ ] })
73
+ ] }),
74
+ tagLabel && /* @__PURE__ */ jsx("div", { className: "absolute inset-x-2 bottom-2 flex gap-1", children: /* @__PURE__ */ jsx("span", { className: cn(PILL_BASE, "bg-black/55 text-white"), children: tagLabel }) })
75
+ ]
76
+ }
77
+ ),
78
+ /* @__PURE__ */ jsx(
79
+ "h3",
80
+ {
81
+ className: cn(
82
+ "mt-2.5 leading-[1.35]",
83
+ emphasis ? "text-lg font-bold tracking-[-0.02em]" : "text-sm font-semibold"
84
+ ),
85
+ children: event.title
86
+ }
87
+ ),
88
+ /* @__PURE__ */ jsxs("div", { className: "mt-0.5 flex min-w-0 items-center gap-1 text-xs font-medium text-foreground/85", children: [
89
+ /* @__PURE__ */ jsx(MapPin, { className: "h-3 w-3 shrink-0", "aria-hidden": true }),
90
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: venue })
91
+ ] }),
92
+ !hideWhen && /* @__PURE__ */ jsxs("div", { className: "mt-[3px] flex items-center gap-1.5 text-xs text-muted-foreground", children: [
93
+ /* @__PURE__ */ jsx("span", { children: dayLabel != null ? dayLabel : formatters.day(event.starts_at) }),
94
+ time && /* @__PURE__ */ jsxs(Fragment, { children: [
95
+ /* @__PURE__ */ jsx("span", { className: "text-border", "aria-hidden": true, children: "\xB7" }),
96
+ /* @__PURE__ */ jsx("span", { children: time })
97
+ ] }),
98
+ showPrice && fee.kind === "paid" && /* @__PURE__ */ jsxs(Fragment, { children: [
99
+ /* @__PURE__ */ jsx("span", { className: "text-border", "aria-hidden": true, children: "\xB7" }),
100
+ /* @__PURE__ */ jsx("span", { children: formatters.price(fee.amountRon) })
101
+ ] })
102
+ ] }),
103
+ tags && tags.length > 0 && /* @__PURE__ */ jsx(TagGroup, { className: "mt-1.5", children: tags.map((tag) => /* @__PURE__ */ jsx(Tag, { size: "sm", children: tag }, tag)) }),
104
+ liveStatus && /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center gap-1.5 text-xs font-bold text-success", children: [
105
+ /* @__PURE__ */ jsx(Radio, { className: "h-3 w-3 shrink-0", "aria-hidden": true }),
106
+ liveStatus
107
+ ] })
108
+ ] });
109
+ const rootClasses = cn(
110
+ "flex min-w-0 flex-col text-left",
111
+ (href || onClick) && "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",
112
+ className
113
+ );
114
+ if (href) {
115
+ return /* @__PURE__ */ jsx(
116
+ LinkComponent,
117
+ {
118
+ href,
119
+ className: rootClasses,
120
+ onClick: onClick ? (mouseEvent) => onClick(event, mouseEvent) : void 0,
121
+ children: body
122
+ }
123
+ );
124
+ }
125
+ if (onClick) {
126
+ return /* @__PURE__ */ jsx("button", { type: "button", className: rootClasses, onClick: (e) => onClick(event, e), children: body });
127
+ }
128
+ return /* @__PURE__ */ jsx("div", { className: rootClasses, children: body });
129
+ });
130
+ function EventCardSkeleton({
131
+ posterAspect = "4/3",
132
+ emphasis,
133
+ hideWhen,
134
+ className
135
+ }) {
136
+ return /* @__PURE__ */ jsxs("div", { "aria-hidden": "true", className: cn("flex min-w-0 flex-col text-left", className), children: [
137
+ /* @__PURE__ */ jsx(
138
+ Skeleton,
139
+ {
140
+ className: cn(
141
+ posterAspect === "3/4" ? "aspect-[3/4]" : posterAspect === "4/5" ? "aspect-[4/5]" : "aspect-[4/3]"
142
+ )
143
+ }
144
+ ),
145
+ emphasis ? /* @__PURE__ */ jsxs("div", { className: "mt-2.5 space-y-2", children: [
146
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-full" }),
147
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-full" }),
148
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-1/2" })
149
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "mt-2.5 space-y-1.5", children: [
150
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3.5 w-full" }),
151
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3.5 w-2/3" })
152
+ ] }),
153
+ /* @__PURE__ */ jsxs("div", { className: "mt-0.5 flex items-center gap-1", children: [
154
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-3 shrink-0 rounded-full" }),
155
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-24" })
156
+ ] }),
157
+ !hideWhen && /* @__PURE__ */ jsxs("div", { className: "mt-[3px] flex items-center gap-1.5", children: [
158
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-16" }),
159
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-10" })
160
+ ] })
161
+ ] });
162
+ }
163
+
164
+ export { EventCard, EventCardSkeleton };
@@ -0,0 +1,73 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React$1 from 'react';
3
+ import { EventPreview, EventCardLabels, EventFormatters } from './event-types.js';
4
+
5
+ /**
6
+ * EventCompactRow — the dense row used inside `<HourGroup>` once the night
7
+ * thins out and a run of poster cards would spend more space than it earns.
8
+ *
9
+ * NOT `<EventListRow>`: that one carries a date badge and a trailing CTA for
10
+ * the list view. This row has neither — the timeline's `<HourGroup>` already
11
+ * names the hour, and every row here means "open me", same as the poster
12
+ * card. `hideTime` drops the leading time from the sub line too, for the
13
+ * common case where the surrounding heading already names it to the minute.
14
+ *
15
+ * THIS ROW DOES NOT DRAW DIVIDERS; ITS CONTAINER DOES. `<HourGroup>` already
16
+ * draws the rule under the hour heading, so a row-level top separator here
17
+ * doubled it directly beneath every hour. `<EventListRow>` and
18
+ * `<EventListRowWide>` are different: they stack in a plain list with no
19
+ * other rule around them, so their own top separator is the only one there —
20
+ * do not carry this rule over to them.
21
+ *
22
+ * Same contract as the rest: DS-owned view model, injected labels/formatters,
23
+ * plain `<img>`, anchor whenever `href` is given.
24
+ */
25
+ type EventCompactRowLinkProps = {
26
+ href: string;
27
+ className?: string;
28
+ children: React.ReactNode;
29
+ onClick?: (mouseEvent: React.MouseEvent) => void;
30
+ };
31
+ type EventCompactRowProps = {
32
+ event: EventPreview;
33
+ labels: EventCardLabels;
34
+ formatters: EventFormatters;
35
+ /** Drops the leading time from the sub line. An empty `formatters.time`
36
+ * result (hour unknown) drops it the same way, without the prop. */
37
+ hideTime?: boolean;
38
+ /**
39
+ * Replaces the default "time · venue" sub-line entirely. For surfaces where
40
+ * the venue is already named above every row (the hub's venue block) and
41
+ * repeating it on each one is noise — the caller has something more
42
+ * differentiating to say instead (the event's own description). The
43
+ * timeline keeps the default: there the venue IS what tells rows apart
44
+ * across the night. Mirrors `menu-item-row.tsx`'s prop of the same name and
45
+ * intent.
46
+ */
47
+ subtitle?: string;
48
+ /** Caller-supplied display labels — `EventPreview.tags` is taxonomy
49
+ * coordinates (`slug`/`axis_slug`), not display text, so the DS cannot
50
+ * render them itself. Rendered as small chips below the sub-line; wrap
51
+ * rather than truncate, so a chip's own text is never cut mid-word. Cap
52
+ * the count at the call site — this row does not. */
53
+ tags?: string[];
54
+ size?: "sm" | "default";
55
+ href?: string;
56
+ linkComponent?: React.ComponentType<EventCompactRowLinkProps>;
57
+ onClick?: (event: EventPreview, mouseEvent: React.MouseEvent) => void;
58
+ className?: string;
59
+ /** Forwarded to the poster's `loading` attribute (`"eager"` when true). */
60
+ priority?: boolean;
61
+ /** Rendered in place of the poster when it is absent or fails to load. Defaults to `<EventPosterFallback />`. */
62
+ fallback?: React.ReactNode;
63
+ };
64
+ declare const EventCompactRow: React$1.NamedExoticComponent<EventCompactRowProps>;
65
+ type EventCompactRowSkeletonProps = {
66
+ /** Matches `EventCompactRowProps["size"]` — keep the poster and title sizes in step. */
67
+ size?: "sm" | "default";
68
+ className?: string;
69
+ };
70
+ /** Mirrors `<EventCompactRow>`'s geometry exactly so nothing shifts when data lands. */
71
+ declare function EventCompactRowSkeleton({ size, className }: EventCompactRowSkeletonProps): react_jsx_runtime.JSX.Element;
72
+
73
+ export { EventCompactRow, type EventCompactRowLinkProps, type EventCompactRowProps, EventCompactRowSkeleton, type EventCompactRowSkeletonProps };
@@ -0,0 +1,134 @@
1
+ import { TagGroup } from '../chunk-6XMYEZVR.js';
2
+ import { Tag } from '../chunk-ZDAHKI3A.js';
3
+ import { resolveEventEntryFee } from '../chunk-DNSXMHYX.js';
4
+ import { EventPosterFallback } from '../chunk-FDITZ2VM.js';
5
+ import { Skeleton } from '../chunk-QXHMPJ35.js';
6
+ import { cn } from '../chunk-FEK5XGZW.js';
7
+ import { __objRest, __spreadValues } from '../chunk-3GWWZKX7.js';
8
+ import { memo, useState } from 'react';
9
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
10
+
11
+ function DefaultLink(_a) {
12
+ var _b = _a, { href } = _b, props = __objRest(_b, ["href"]);
13
+ return /* @__PURE__ */ jsx("a", __spreadValues({ href }, props));
14
+ }
15
+ var EventCompactRow = memo(function EventCompactRow2({
16
+ event,
17
+ labels,
18
+ formatters,
19
+ hideTime,
20
+ subtitle,
21
+ tags,
22
+ size = "default",
23
+ href,
24
+ linkComponent: LinkComponent = DefaultLink,
25
+ onClick,
26
+ className,
27
+ priority,
28
+ fallback = /* @__PURE__ */ jsx(EventPosterFallback, {})
29
+ }) {
30
+ var _a;
31
+ const [imgError, setImgError] = useState(false);
32
+ const isSm = size === "sm";
33
+ const fee = resolveEventEntryFee(event);
34
+ const showPoster = !!event.poster_url && !imgError;
35
+ const venue = (_a = event.place_name) != null ? _a : event.location;
36
+ const time = formatters.time(event.starts_at);
37
+ const body = /* @__PURE__ */ jsxs(Fragment, { children: [
38
+ /* @__PURE__ */ jsx("div", { className: "relative aspect-[4/5] w-16 shrink-0 overflow-hidden rounded-[9px] bg-muted", children: showPoster ? (
39
+ // eslint-disable-next-line @next/next/no-img-element
40
+ /* @__PURE__ */ jsx(
41
+ "img",
42
+ {
43
+ src: event.poster_url,
44
+ alt: "",
45
+ loading: priority ? "eager" : "lazy",
46
+ decoding: "async",
47
+ className: "h-full w-full object-cover",
48
+ onError: () => setImgError(true)
49
+ }
50
+ )
51
+ ) : (
52
+ // A bare `bg-muted` rectangle was survivable at 34px. At 64x80 beside
53
+ // real posters it reads as a broken image rather than an absent one —
54
+ // so this row finally joins every sibling in the family in having a
55
+ // designed fallback.
56
+ fallback
57
+ ) }),
58
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
59
+ /* @__PURE__ */ jsx(
60
+ "div",
61
+ {
62
+ className: cn(
63
+ "font-semibold leading-[1.35]",
64
+ "transition-colors duration-150 motion-reduce:transition-none",
65
+ isSm ? "text-[13.5px]" : "text-[13px]",
66
+ (href || onClick) && "group-hover:text-primary"
67
+ ),
68
+ children: event.title
69
+ }
70
+ ),
71
+ /* @__PURE__ */ jsx("div", { className: "truncate text-[11.5px] text-muted-foreground", children: subtitle ? subtitle : /* @__PURE__ */ jsxs(Fragment, { children: [
72
+ !hideTime && time && /* @__PURE__ */ jsxs(Fragment, { children: [
73
+ /* @__PURE__ */ jsx("span", { className: "font-mono tabular-nums", children: time }),
74
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: " \xB7 " })
75
+ ] }),
76
+ venue
77
+ ] }) }),
78
+ tags && tags.length > 0 && /* @__PURE__ */ jsx(TagGroup, { className: "mt-1", children: tags.map((tag) => /* @__PURE__ */ jsx(Tag, { size: "sm", children: tag }, tag)) })
79
+ ] }),
80
+ fee.kind === "free" && /* @__PURE__ */ jsx(
81
+ "span",
82
+ {
83
+ className: cn(
84
+ "inline-flex shrink-0 items-center rounded-full border border-success/40 px-2 font-semibold text-success",
85
+ isSm ? "h-[22px] text-[10.5px]" : "h-6 text-[11px]"
86
+ ),
87
+ children: labels.free
88
+ }
89
+ )
90
+ ] });
91
+ const rootClasses = cn(
92
+ "group relative -mx-2.5 flex w-full items-start gap-[11px] rounded-lg px-2.5 py-2 text-left",
93
+ "transition-colors duration-150 motion-reduce:transition-none",
94
+ (href || onClick) && "cursor-pointer hover:bg-foreground/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
95
+ className
96
+ );
97
+ if (href) {
98
+ return /* @__PURE__ */ jsx(
99
+ LinkComponent,
100
+ {
101
+ href,
102
+ className: rootClasses,
103
+ onClick: onClick ? (mouseEvent) => onClick(event, mouseEvent) : void 0,
104
+ children: body
105
+ }
106
+ );
107
+ }
108
+ if (onClick) {
109
+ return /* @__PURE__ */ jsx("button", { type: "button", className: rootClasses, onClick: (e) => onClick(event, e), children: body });
110
+ }
111
+ return /* @__PURE__ */ jsx("div", { className: rootClasses, children: body });
112
+ });
113
+ function EventCompactRowSkeleton({ size = "default", className }) {
114
+ const isSm = size === "sm";
115
+ return /* @__PURE__ */ jsxs(
116
+ "div",
117
+ {
118
+ "aria-hidden": "true",
119
+ className: cn(
120
+ "relative -mx-2.5 flex w-full items-start gap-[11px] rounded-lg px-2.5 py-2 text-left",
121
+ className
122
+ ),
123
+ children: [
124
+ /* @__PURE__ */ jsx(Skeleton, { className: "aspect-[4/5] w-16 shrink-0 rounded-[9px]" }),
125
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
126
+ /* @__PURE__ */ jsx(Skeleton, { className: cn(isSm ? "h-[13.5px]" : "h-[13px]", "w-2/5") }),
127
+ /* @__PURE__ */ jsx(Skeleton, { className: "mt-0.5 h-[11.5px] w-1/3" })
128
+ ] })
129
+ ]
130
+ }
131
+ );
132
+ }
133
+
134
+ export { EventCompactRow, EventCompactRowSkeleton };
@@ -0,0 +1,65 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ /**
5
+ * EventDayHeader — the day divider in the timeline: an oversized day number,
6
+ * the weekday, and a meta line.
7
+ *
8
+ * The meta line is ONE caller-composed string. The design's variants
9
+ * ("September · 15 events · 3 live", "September · nothing listed yet",
10
+ * "September · 2 of 23 are free") do not decompose into counts, and building
11
+ * them from parts inside the DS would bake in English clause order.
12
+ *
13
+ * A day with nothing on still gets a header — the empty state belongs under it,
14
+ * not instead of it, so the reader can see the date they are looking at.
15
+ */
16
+ type EventDayHeaderLinkProps = {
17
+ href: string;
18
+ className?: string;
19
+ children: React.ReactNode;
20
+ };
21
+ type EventDayHeaderProps = {
22
+ /** Day of month as displayed, e.g. "03". */
23
+ dayNumber: string;
24
+ /** Weekday name, already localised. */
25
+ weekday: string;
26
+ /** Month plus counts, composed by the caller. */
27
+ meta: string;
28
+ /**
29
+ * Trailing slot, right-aligned. The desktop design puts a "See the whole day →"
30
+ * chip here; mobile has no slot and falls back to the chevron below. Passing an
31
+ * action REPLACES the chevron rather than sitting beside it — two affordances
32
+ * for one destination is the duplication this design set out to remove.
33
+ *
34
+ * The action is rendered outside the header's own link/button when the header
35
+ * is itself interactive, so an interactive chip is never nested inside an
36
+ * anchor (invalid HTML, and it steals the row's click target).
37
+ */
38
+ action?: React.ReactNode;
39
+ /**
40
+ * Larger desktop scale: 58px day number, 18px weekday, 12.5px meta,
41
+ * against the mobile 40/15/11.5.
42
+ */
43
+ size?: "sm" | "default";
44
+ href?: string;
45
+ linkComponent?: React.ComponentType<EventDayHeaderLinkProps>;
46
+ onClick?: () => void;
47
+ className?: string;
48
+ };
49
+ declare function EventDayHeader({ dayNumber, weekday, meta, action, size, href, linkComponent: LinkComponent, onClick, className, }: EventDayHeaderProps): react_jsx_runtime.JSX.Element;
50
+ type EventDayHeaderSkeletonProps = {
51
+ /** Reserves space for the chevron — only render this once you know the header will be tappable. */
52
+ interactive?: boolean;
53
+ className?: string;
54
+ };
55
+ /**
56
+ * Mirrors `<EventDayHeader>`'s geometry. The big day-number block (86×50,
57
+ * 10px radius) and the weekday/meta column (120×16, 200×12) come from the
58
+ * source design's own desktop day-header skeleton — the chevron does not: the
59
+ * design's spec for it (a 170×34 pill pushed right) matches nothing in this
60
+ * component, whose only trailing affordance is an 18×18 chevron icon, so that
61
+ * placeholder is sized from the real component instead.
62
+ */
63
+ declare function EventDayHeaderSkeleton({ interactive, className }: EventDayHeaderSkeletonProps): react_jsx_runtime.JSX.Element;
64
+
65
+ export { EventDayHeader, type EventDayHeaderLinkProps, type EventDayHeaderProps, EventDayHeaderSkeleton, type EventDayHeaderSkeletonProps };
@@ -0,0 +1,95 @@
1
+ import { Skeleton } from '../chunk-QXHMPJ35.js';
2
+ import { cn } from '../chunk-FEK5XGZW.js';
3
+ import { __objRest, __spreadValues } from '../chunk-3GWWZKX7.js';
4
+ import { ChevronRight } from 'lucide-react';
5
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
6
+
7
+ function DefaultLink(_a) {
8
+ var _b = _a, { href } = _b, props = __objRest(_b, ["href"]);
9
+ return /* @__PURE__ */ jsx("a", __spreadValues({ href }, props));
10
+ }
11
+ function EventDayHeader({
12
+ dayNumber,
13
+ weekday,
14
+ meta,
15
+ action,
16
+ size = "sm",
17
+ href,
18
+ linkComponent: LinkComponent = DefaultLink,
19
+ onClick,
20
+ className
21
+ }) {
22
+ const isInteractive = !!href || !!onClick;
23
+ const large = size === "default";
24
+ const body = /* @__PURE__ */ jsxs(Fragment, { children: [
25
+ /* @__PURE__ */ jsx(
26
+ "div",
27
+ {
28
+ className: cn(
29
+ "font-black leading-[0.82] tracking-[-0.05em] tabular-nums",
30
+ large ? "text-[58px]" : "text-[40px]"
31
+ ),
32
+ children: dayNumber
33
+ }
34
+ ),
35
+ /* @__PURE__ */ jsxs("div", { className: large ? "pb-1" : "pb-0.5", children: [
36
+ /* @__PURE__ */ jsx(
37
+ "div",
38
+ {
39
+ className: cn("font-extrabold tracking-[-0.015em]", large ? "text-lg" : "text-[15px]"),
40
+ children: weekday
41
+ }
42
+ ),
43
+ /* @__PURE__ */ jsx(
44
+ "div",
45
+ {
46
+ className: cn(
47
+ "mt-0.5 text-muted-foreground",
48
+ large ? "whitespace-nowrap text-[12.5px]" : "text-[11.5px]"
49
+ ),
50
+ children: meta
51
+ }
52
+ )
53
+ ] }),
54
+ !action && isInteractive && /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto mb-1 h-[18px] w-[18px] text-muted-foreground", "aria-hidden": true })
55
+ ] });
56
+ const dateClasses = cn(
57
+ "flex min-w-0 items-end gap-3 text-left",
58
+ !action && "flex-1",
59
+ isInteractive && "cursor-pointer rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
60
+ );
61
+ const date = href ? /* @__PURE__ */ jsx(LinkComponent, { href, className: dateClasses, children: body }) : onClick ? /* @__PURE__ */ jsx("button", { type: "button", className: dateClasses, onClick, children: body }) : /* @__PURE__ */ jsx("div", { className: dateClasses, children: body });
62
+ return /* @__PURE__ */ jsxs(
63
+ "div",
64
+ {
65
+ className: cn(
66
+ "relative flex w-full items-end gap-3 pb-3 pt-[18px]",
67
+ large && "gap-[18px] pb-4",
68
+ className
69
+ ),
70
+ children: [
71
+ date,
72
+ action && /* @__PURE__ */ jsx("div", { className: "ml-auto mb-1.5 shrink-0", children: action })
73
+ ]
74
+ }
75
+ );
76
+ }
77
+ function EventDayHeaderSkeleton({ interactive, className }) {
78
+ return /* @__PURE__ */ jsxs(
79
+ "div",
80
+ {
81
+ "aria-hidden": "true",
82
+ className: cn("relative flex w-full items-end gap-3 pb-3 pt-[18px] text-left", className),
83
+ children: [
84
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-[50px] w-[86px] rounded-[10px]" }),
85
+ /* @__PURE__ */ jsxs("div", { className: "space-y-0.5 pb-0.5", children: [
86
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-[120px]" }),
87
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-[200px]" })
88
+ ] }),
89
+ interactive && /* @__PURE__ */ jsx(Skeleton, { className: "mb-1 ml-auto h-[18px] w-[18px] shrink-0 rounded-full" })
90
+ ]
91
+ }
92
+ );
93
+ }
94
+
95
+ export { EventDayHeader, EventDayHeaderSkeleton };