@bearmenu/ui 0.8.17 → 0.8.18

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 (71) hide show
  1. package/dist/{chunk-WYTJR2YU.js → chunk-5CPBSNWQ.js} +6 -1
  2. package/dist/{chunk-54FQQZZJ.js → chunk-EQYB4Q77.js} +1 -1
  3. package/dist/chunk-LYREUZH6.js +156 -0
  4. package/dist/chunk-PW247TG2.js +81 -0
  5. package/dist/components/alert.d.ts +2 -2
  6. package/dist/components/badge.d.ts +1 -1
  7. package/dist/components/button.d.ts +1 -1
  8. package/dist/components/card.d.ts +2 -2
  9. package/dist/components/command.d.ts +15 -15
  10. package/dist/components/concept-compare-rail.js +2 -2
  11. package/dist/components/concept-compare.js +2 -2
  12. package/dist/components/event-card.d.ts +22 -4
  13. package/dist/components/event-card.js +95 -50
  14. package/dist/components/event-day-header.d.ts +5 -3
  15. package/dist/components/event-day-header.js +12 -4
  16. package/dist/components/event-door.d.ts +41 -0
  17. package/dist/components/event-door.js +65 -0
  18. package/dist/components/event-hub-hero.d.ts +10 -2
  19. package/dist/components/event-hub-hero.js +11 -5
  20. package/dist/components/event-tonight-strip.d.ts +50 -0
  21. package/dist/components/event-tonight-strip.js +67 -0
  22. package/dist/components/item.d.ts +2 -2
  23. package/dist/components/menu-hub-hero.d.ts +7 -1
  24. package/dist/components/menu-hub-hero.js +2 -1
  25. package/dist/components/place-card.js +1 -1
  26. package/dist/components/poster-stack.d.ts +36 -3
  27. package/dist/components/poster-stack.js +49 -18
  28. package/dist/components/snap-rail.d.ts +2 -2
  29. package/dist/components/snap-rail.js +1 -1
  30. package/dist/components/spinner.d.ts +2 -2
  31. package/dist/components/tag.d.ts +2 -2
  32. package/dist/components/text.d.ts +3 -3
  33. package/dist/components/timeline-day.d.ts +54 -0
  34. package/dist/components/timeline-day.js +65 -0
  35. package/dist/components/timeline-hour-puck.d.ts +47 -0
  36. package/dist/components/timeline-hour-puck.js +3 -0
  37. package/dist/components/timeline-hour.d.ts +96 -0
  38. package/dist/components/{timeline-band.js → timeline-hour.js} +2 -1
  39. package/dist/components/timeline-playhead.js +1 -3
  40. package/package.json +1 -1
  41. package/src/components/event-card.tsx +70 -13
  42. package/src/components/event-day-header.tsx +19 -7
  43. package/src/components/event-door.stories.tsx +88 -0
  44. package/src/components/event-door.tsx +97 -0
  45. package/src/components/event-hub-hero.tsx +21 -3
  46. package/src/components/event-tonight-strip.stories.tsx +78 -0
  47. package/src/components/event-tonight-strip.test.tsx +59 -0
  48. package/src/components/event-tonight-strip.tsx +134 -0
  49. package/src/components/menu-hub-hero.test.tsx +13 -0
  50. package/src/components/menu-hub-hero.tsx +9 -2
  51. package/src/components/poster-stack.stories.tsx +43 -1
  52. package/src/components/poster-stack.tsx +98 -19
  53. package/src/components/snap-rail.tsx +6 -1
  54. package/src/components/timeline-day.stories.tsx +201 -0
  55. package/src/components/timeline-day.test.tsx +78 -0
  56. package/src/components/timeline-day.tsx +114 -0
  57. package/src/components/timeline-hour-puck.tsx +139 -0
  58. package/src/components/timeline-hour.tsx +266 -0
  59. package/src/components/timeline-playhead.tsx +1 -1
  60. package/dist/chunk-NSNEANOQ.js +0 -104
  61. package/dist/components/hour-band.d.ts +0 -66
  62. package/dist/components/hour-band.js +0 -81
  63. package/dist/components/hour-group.d.ts +0 -67
  64. package/dist/components/hour-group.js +0 -59
  65. package/dist/components/timeline-band.d.ts +0 -64
  66. package/src/components/hour-band.stories.tsx +0 -182
  67. package/src/components/hour-band.tsx +0 -146
  68. package/src/components/hour-group.stories.tsx +0 -100
  69. package/src/components/hour-group.tsx +0 -124
  70. package/src/components/timeline-band.stories.tsx +0 -206
  71. package/src/components/timeline-band.tsx +0 -247
@@ -1,104 +0,0 @@
1
- import { Separator } from './chunk-NWZGSLPU.js';
2
- import { Skeleton } from './chunk-XBBEX4SF.js';
3
- import { cn } from './chunk-FEK5XGZW.js';
4
- import { Radio } from 'lucide-react';
5
- import { jsxs, jsx } from 'react/jsx-runtime';
6
-
7
- var LIVE_PUCK_PULSE_CLASS = "bm-timeline-live-puck-pulse";
8
- var TIMELINE_MOBILE_GUTTER_CLASS = "w-[58px]";
9
- function TimelineHourPuck({
10
- time,
11
- isLive,
12
- liveLabel,
13
- variant = "station",
14
- className
15
- }) {
16
- const isChip = variant === "chip";
17
- return /* @__PURE__ */ jsxs("span", { className: cn("relative flex justify-center", className), children: [
18
- isLive && /* @__PURE__ */ jsx("style", { children: `
19
- @keyframes ${LIVE_PUCK_PULSE_CLASS} {
20
- 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--success) 40%, transparent); }
21
- 50% { box-shadow: 0 0 0 4px color-mix(in oklch, var(--success) 0%, transparent); }
22
- }
23
- .${LIVE_PUCK_PULSE_CLASS} {
24
- animation: ${LIVE_PUCK_PULSE_CLASS} 2.4s ease-in-out infinite;
25
- }
26
- @media (prefers-reduced-motion: reduce) {
27
- .${LIVE_PUCK_PULSE_CLASS} { animation: none; }
28
- }
29
- ` }),
30
- /* @__PURE__ */ jsxs(
31
- "span",
32
- {
33
- className: cn(
34
- "whitespace-nowrap font-mono tabular-nums",
35
- isChip ? cn(
36
- "inline-flex h-6 min-w-[58px] items-center justify-center gap-1 rounded-[7px] px-1 text-[12px] font-medium",
37
- isLive ? cn("bg-success/10 text-success", LIVE_PUCK_PULSE_CLASS) : "bg-muted text-foreground"
38
- ) : cn(
39
- "rounded-[7px] border bg-background px-[7px] py-[3px] text-[12.5px] font-medium",
40
- isLive ? cn("border-success/40 text-success", LIVE_PUCK_PULSE_CLASS) : "border-border text-foreground"
41
- )
42
- ),
43
- children: [
44
- isChip && isLive && /* @__PURE__ */ jsx(Radio, { className: "h-2.5 w-2.5 shrink-0", "aria-hidden": true }),
45
- time
46
- ]
47
- }
48
- ),
49
- isLive && !!liveLabel && /* @__PURE__ */ jsx(
50
- "span",
51
- {
52
- className: cn(
53
- isChip ? "sr-only" : cn(
54
- "absolute top-[calc(100%+6px)] whitespace-nowrap bg-background px-1",
55
- "text-[9.5px] font-extrabold tracking-[0.08em] text-success"
56
- )
57
- ),
58
- children: liveLabel
59
- }
60
- )
61
- ] });
62
- }
63
- function TimelineBand({ lane, children, className }) {
64
- return /* @__PURE__ */ jsxs("div", { className: cn("flex items-stretch", className), children: [
65
- /* @__PURE__ */ jsx("div", { className: "w-[var(--timeline-lane)] shrink-0", children: lane }),
66
- /* @__PURE__ */ jsx("div", { className: "relative flex w-[var(--timeline-spine)] shrink-0 justify-center self-stretch", children: /* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "h-full" }) }),
67
- /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 flex-col", children })
68
- ] });
69
- }
70
- function sk(width, height, radiusPx = 12) {
71
- return /* @__PURE__ */ jsx(
72
- Skeleton,
73
- {
74
- style: { width, height: `${height}px`, borderRadius: `${radiusPx}px` }
75
- }
76
- );
77
- }
78
- function TimelineBandSkeleton({ className }) {
79
- return /* @__PURE__ */ jsxs("div", { className: cn("flex items-stretch", className), "aria-hidden": "true", children: [
80
- /* @__PURE__ */ jsxs("div", { className: "flex w-[var(--timeline-lane)] shrink-0 flex-col gap-3", children: [
81
- sk("100%", 297, 12),
82
- sk("70%", 18),
83
- sk("45%", 13)
84
- ] }),
85
- /* @__PURE__ */ jsx("div", { className: "relative flex w-[var(--timeline-spine)] shrink-0 justify-center self-stretch", children: /* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "h-full" }) }),
86
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-4", children: [
87
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-[10px]", children: Array.from({ length: 3 }, (_, index) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
88
- sk("100%", 190, 12),
89
- sk("85%", 15),
90
- sk("55%", 12)
91
- ] }, index)) }),
92
- /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: Array.from({ length: 3 }, (_, index) => /* @__PURE__ */ jsxs("div", { className: "relative flex items-center gap-[11px] py-2", children: [
93
- /* @__PURE__ */ jsx(Separator, { className: "absolute inset-x-0 top-0" }),
94
- /* @__PURE__ */ jsx(Skeleton, { className: "h-[34px] w-[34px] shrink-0 rounded-md" }),
95
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
96
- sk("60%", 13),
97
- sk("40%", 11.5)
98
- ] })
99
- ] }, index)) })
100
- ] })
101
- ] });
102
- }
103
-
104
- export { TIMELINE_MOBILE_GUTTER_CLASS, TimelineBand, TimelineBandSkeleton, TimelineHourPuck };
@@ -1,66 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
-
4
- /**
5
- * HourBand — one hour on the timeline's axis, with that hour's events beside it.
6
- *
7
- * The mobile timeline is an app list, not a page: a 58px gutter carrying a
8
- * filled hour chip with a hairline dropping from beneath it, and the hour's
9
- * rows to the right, separated by hairlines of their own. The rows carry no
10
- * timestamp — this band IS the timestamp, which is why `EventCard` has
11
- * `hideWhen` and `EventCompactRow` has `hideTime`.
12
- *
13
- * The chip is the shared `TimelineHourPuck` in its `chip` variant, so the
14
- * desktop spine's station and this gutter's label are one object with two
15
- * looks rather than two objects that drift. The hairline starts BELOW the chip
16
- * rather than running behind it: a chip is a label at the top of its hour, a
17
- * station is a tick on a continuous rail, and the two read differently.
18
- *
19
- * `isLive` tints the chip and the hairline with `--success`; the live label is
20
- * kept for screen readers (the chip variant hides it visually). The playhead —
21
- * the exact current time — is a separate `TimelinePlayhead` rendered between
22
- * bands by the caller, because an hour spans sixty minutes and "now" is one of
23
- * them.
24
- *
25
- * ROWS ARE SEPARATED HERE, NOT IN THE ROW. `EventCompactRow` deliberately
26
- * draws no divider (its container does — see its docblock), so this band wraps
27
- * each child and rules between them. The wrapper, not the child, carries the
28
- * rule, so the row's own negative-margin hover wash is untouched. Children are
29
- * read with `Children.toArray`, which drops `null`/`false` so a conditional
30
- * first row never inherits a rule meant for a second; pass rows as siblings,
31
- * not inside a fragment — a fragment is one child and gets one wrapper.
32
- */
33
- type HourBandProps = {
34
- /** The hour, already formatted and localised — "20:00". */
35
- time: string;
36
- /** Marks this as the hour currently in progress. */
37
- isLive?: boolean;
38
- /** Screen-reader text for the live hour, e.g. "Now on". Required to render it. */
39
- liveLabel?: string;
40
- /** The hour's events. Each direct child is one row or card. */
41
- children: React.ReactNode;
42
- /**
43
- * `rows` (default): compact rows, ruled between with a Separator. `cards`:
44
- * poster cards, stacked with a 16px gap and no rules — a card is its own
45
- * frame, and a hairline between two posters reads as a third object.
46
- */
47
- layout?: "rows" | "cards";
48
- className?: string;
49
- };
50
- declare function HourBand({ time, isLive, liveLabel, children, layout, className, }: HourBandProps): react_jsx_runtime.JSX.Element;
51
- type HourBandSkeletonProps = {
52
- /** Rows to reserve space for. */
53
- cardCount?: number;
54
- className?: string;
55
- };
56
- /**
57
- * The mobile timeline's loading state, mirroring `HourBand` exactly — same
58
- * gutter, same hairline, same row rhythm — so nothing jumps when data lands.
59
- *
60
- * The chip is blocked out at its real size rather than omitted: it is a fixed
61
- * 58x24 lozenge, so a grey one reads as "a time goes here" without inventing
62
- * a time. Row footprints mirror `EventCompactRowSkeleton`.
63
- */
64
- declare function HourBandSkeleton({ cardCount, className, }: HourBandSkeletonProps): react_jsx_runtime.JSX.Element;
65
-
66
- export { HourBand, type HourBandProps, HourBandSkeleton, type HourBandSkeletonProps };
@@ -1,81 +0,0 @@
1
- import { TimelineHourPuck, TIMELINE_MOBILE_GUTTER_CLASS } from '../chunk-NSNEANOQ.js';
2
- import { Separator } from '../chunk-NWZGSLPU.js';
3
- import { Skeleton } from '../chunk-XBBEX4SF.js';
4
- import { cn } from '../chunk-FEK5XGZW.js';
5
- import '../chunk-MMUBH76A.js';
6
- import * as React from 'react';
7
- import { jsxs, jsx } from 'react/jsx-runtime';
8
-
9
- function HourBand({
10
- time,
11
- isLive,
12
- liveLabel,
13
- children,
14
- layout = "rows",
15
- className
16
- }) {
17
- const isCards = layout === "cards";
18
- return /* @__PURE__ */ jsxs("div", { className: cn("flex gap-3 pt-2.5", className), children: [
19
- /* @__PURE__ */ jsxs("div", { className: cn("relative shrink-0", TIMELINE_MOBILE_GUTTER_CLASS), children: [
20
- /* @__PURE__ */ jsx(
21
- TimelineHourPuck,
22
- {
23
- time,
24
- isLive,
25
- liveLabel,
26
- variant: "chip"
27
- }
28
- ),
29
- /* @__PURE__ */ jsx(
30
- Separator,
31
- {
32
- orientation: "vertical",
33
- className: cn(
34
- "absolute bottom-[-10px] left-1/2 top-[30px] h-auto -translate-x-1/2",
35
- isLive && "bg-success/30"
36
- )
37
- }
38
- )
39
- ] }),
40
- /* @__PURE__ */ jsx(
41
- "div",
42
- {
43
- className: cn("flex min-w-0 flex-1 flex-col", isCards && "gap-4 pb-2"),
44
- children: React.Children.toArray(children).map((child, index) => /* @__PURE__ */ jsxs("div", { children: [
45
- !isCards && index > 0 && /* @__PURE__ */ jsx(Separator, {}),
46
- child
47
- ] }, index))
48
- }
49
- )
50
- ] });
51
- }
52
- function HourBandSkeleton({
53
- cardCount = 2,
54
- className
55
- }) {
56
- return /* @__PURE__ */ jsxs("div", { className: cn("flex gap-3 pt-2.5", className), "aria-hidden": "true", children: [
57
- /* @__PURE__ */ jsxs("div", { className: cn("relative shrink-0", TIMELINE_MOBILE_GUTTER_CLASS), children: [
58
- /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-[58px] rounded-[7px]" }),
59
- /* @__PURE__ */ jsx(
60
- Separator,
61
- {
62
- orientation: "vertical",
63
- className: "absolute bottom-[-10px] left-1/2 top-[30px] h-auto -translate-x-1/2"
64
- }
65
- )
66
- ] }),
67
- /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 flex-col", children: Array.from({ length: cardCount }).map((_, index) => /* @__PURE__ */ jsxs("div", { children: [
68
- index > 0 && /* @__PURE__ */ jsx(Separator, {}),
69
- /* @__PURE__ */ jsxs("div", { className: "flex gap-3 py-[11px]", children: [
70
- /* @__PURE__ */ jsx(Skeleton, { className: "aspect-[4/5] w-16 shrink-0 rounded-[10px]" }),
71
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
72
- /* @__PURE__ */ jsx(Skeleton, { className: "h-[14px] w-3/4" }),
73
- /* @__PURE__ */ jsx(Skeleton, { className: "mt-1.5 h-[11.5px] w-1/2" }),
74
- /* @__PURE__ */ jsx(Skeleton, { className: "mt-2 h-[22px] w-16 rounded-full" })
75
- ] })
76
- ] })
77
- ] }, index)) })
78
- ] });
79
- }
80
-
81
- export { HourBand, HourBandSkeleton };
@@ -1,67 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
-
4
- /**
5
- * HourGroup — an hour heading inside `<TimelineBand>`'s content column: a
6
- * time, a rule, and a count, with that hour's rows beneath and an optional
7
- * trailing note (e.g. "3 more not shown").
8
- *
9
- * ── `spine` — the desktop default ────────────────────────────────────────
10
- * Inside a `<TimelineBand>`, pass `spine` and the hour renders as a
11
- * `TimelineHourPuck` out ON the axis, centred on this heading's own rule,
12
- * instead of as inline text at the head of the content column. Every hour of
13
- * the day then reads as a station on the same rail, which is the entire point
14
- * of the rail; the band itself no longer draws any hour, so there is nothing
15
- * left to collide with.
16
- *
17
- * The offset is `calc(var(--timeline-spine) * -0.5)` — half the gutter, back
18
- * from the content column's left edge, which lands on the hairline. Written
19
- * with `*-0.5` rather than `/2` because a slash inside a Tailwind arbitrary
20
- * value collides with the opacity-modifier parse. The `w-0` wrapper plus the
21
- * puck's own `justify-center` is what centres it, so no `-translate-x-1/2` is
22
- * needed and the live label centres on the same line for free.
23
- *
24
- * `spine` implies the inline time is suppressed — no caller should have to
25
- * pass `spine hideTime` to avoid printing the hour twice.
26
- *
27
- * Keep the rule and the count. The rule is the only thing tying a puck to the
28
- * rows it labels across the empty gutter; without it the puck reads as a
29
- * sticker rather than a station on a track. The count carries information
30
- * present nowhere else and terminates the rule so it doesn't dissolve.
31
- *
32
- * Where a group's rows already carry their own timestamps, `hideTime` drops the
33
- * time and keeps the rule and count, so the hour is stated exactly once.
34
- *
35
- * `size="sm"` is the mobile variant, shrinking the type a half-step and
36
- * matching `<HourBand>`'s own top offset (18px) rather than the desktop
37
- * default (22px).
38
- */
39
- type HourGroupProps = {
40
- /** The hour, already formatted and localised — "20:00". */
41
- time: string;
42
- /**
43
- * Render the hour as a puck out on `<TimelineBand>`'s spine instead of as
44
- * inline text. The desktop timeline's default; implies `hideTime`.
45
- */
46
- spine?: boolean;
47
- /** Marks this hour as the one currently in progress. `spine` only. */
48
- isLive?: boolean;
49
- /** Shown under the puck when live, e.g. "NOW". `spine` only. */
50
- liveLabel?: string;
51
- /**
52
- * Drop the leading time, keeping the rule and count. For groups whose rows
53
- * state their own time.
54
- */
55
- hideTime?: boolean;
56
- /** Caller-composed, e.g. "2 events" — mirrors `EventDayHeader`'s `meta`. */
57
- countLabel: string;
58
- /** Trailing note shown after the rows, e.g. "3 more not shown". */
59
- note?: string;
60
- /** The hour's rows. */
61
- children?: React.ReactNode;
62
- size?: "sm" | "default";
63
- className?: string;
64
- };
65
- declare function HourGroup({ time, spine, isLive, liveLabel, hideTime, countLabel, note, children, size, className, }: HourGroupProps): react_jsx_runtime.JSX.Element;
66
-
67
- export { HourGroup, type HourGroupProps };
@@ -1,59 +0,0 @@
1
- import { TimelineHourPuck } from '../chunk-NSNEANOQ.js';
2
- import { Separator } from '../chunk-NWZGSLPU.js';
3
- import '../chunk-XBBEX4SF.js';
4
- import { cn } from '../chunk-FEK5XGZW.js';
5
- import '../chunk-MMUBH76A.js';
6
- import { jsxs, jsx } from 'react/jsx-runtime';
7
-
8
- function HourGroup({
9
- time,
10
- spine,
11
- isLive,
12
- liveLabel,
13
- hideTime,
14
- countLabel,
15
- note,
16
- children,
17
- size = "default",
18
- className
19
- }) {
20
- const isSm = size === "sm";
21
- return (
22
- // The group's top padding lives HERE, not on the heading row, and that is
23
- // load-bearing for `spine`: `top-1/2` resolves against the heading row's
24
- // PADDING box while `items-center` centres the rule in its CONTENT box, so
25
- // with `pt-[22px]` on the row the puck landed 19.25px down and the rule at
26
- // 30.25px — 11px apart, the puck visibly riding above the line it is
27
- // supposed to sit on. Unpadded, both resolve against the same box and the
28
- // puck's centre, the rule and the spine hairline are one line.
29
- /* @__PURE__ */ jsxs("div", { className: cn(isSm ? "pt-[18px]" : "pt-[22px]", className), children: [
30
- /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2.5", spine && "relative"), children: [
31
- spine && /* @__PURE__ */ jsx(
32
- TimelineHourPuck,
33
- {
34
- time,
35
- isLive,
36
- liveLabel,
37
- className: "absolute left-[calc(var(--timeline-spine)*-0.5)] top-1/2 w-0 -translate-y-1/2"
38
- }
39
- ),
40
- !hideTime && !spine && /* @__PURE__ */ jsx(
41
- "span",
42
- {
43
- className: cn(
44
- "font-mono text-muted-foreground tabular-nums",
45
- isSm ? "text-[11.5px]" : "text-xs"
46
- ),
47
- children: time
48
- }
49
- ),
50
- /* @__PURE__ */ jsx(Separator, { className: "flex-1" }),
51
- /* @__PURE__ */ jsx("span", { className: cn("text-muted-foreground/70", isSm ? "text-[10.5px]" : "text-[11px]"), children: countLabel })
52
- ] }),
53
- children,
54
- note && /* @__PURE__ */ jsx("p", { className: "pt-[9px] text-[11.5px] text-muted-foreground", children: note })
55
- ] })
56
- );
57
- }
58
-
59
- export { HourGroup };
@@ -1,64 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
-
4
- /**
5
- * The mobile axis gutter, shared by `HourBand` and `TimelinePlayhead` so the
6
- * hour chips and the current-time label sit in one column. 58px is the width
7
- * of a five-glyph 24-hour label ("20:00") in the chip's mono type plus its
8
- * padding; a 12-hour locale's "09:00 AM" overflows it, which is one of the
9
- * reasons the events surfaces format 24-hour everywhere.
10
- */
11
- declare const TIMELINE_MOBILE_GUTTER_CLASS = "w-[58px]";
12
- type TimelineHourPuckProps = {
13
- /** The hour, already formatted and localised — or an em dash for a quiet day. */
14
- time: string;
15
- /** Marks this as the hour currently in progress. */
16
- isLive?: boolean;
17
- /** Shown under the puck when live, e.g. "NOW ON". Required to render it. */
18
- liveLabel?: string;
19
- /**
20
- * `station` (default): the bordered puck that sits ON the hairline, for the
21
- * desktop spine. `chip`: a filled, fixed-width lozenge with the hairline
22
- * starting BELOW it, for the mobile gutter — an app's time label, not a
23
- * station on a rail. In `chip` the live label is visually hidden: the tinted
24
- * chip plus a small on-air glyph are the visible signal (the glyph so the
25
- * state never rests on colour alone once the pulse is reduced away) and the
26
- * label stays for screen readers only.
27
- */
28
- variant?: "station" | "chip";
29
- className?: string;
30
- };
31
- /**
32
- * The station on the timeline's axis — ONE object, positioned by its host:
33
- * `HourGroup` centres it on its own heading rule out in the desktop spine,
34
- * `HourBand` pins it to the top of the mobile gutter.
35
- *
36
- * Extracted because it was hand-rolled twice and the copies had already
37
- * drifted — this one bordered and `rounded-[7px] px-[7px]`, `hour-band.tsx`'s
38
- * borderless and `rounded-md px-1.5`. The `bg-background` fill punches through
39
- * the hairline so the rail reads as continuous behind the label rather than
40
- * butting into it.
41
- *
42
- * The live label is absolutely positioned rather than a flex sibling: hosts
43
- * centre this puck with `-translate-y-1/2`, and a two-item column would centre
44
- * the STACK, lifting the puck off the line it exists to sit on.
45
- */
46
- declare function TimelineHourPuck({ time, isLive, liveLabel, variant, className, }: TimelineHourPuckProps): react_jsx_runtime.JSX.Element;
47
- type TimelineBandProps = {
48
- /** The lane column — usually a poster card, or empty for a quiet hour. */
49
- lane: React.ReactNode;
50
- /** The content column, normally one `<HourGroup spine>` per hour. */
51
- children: React.ReactNode;
52
- className?: string;
53
- };
54
- declare function TimelineBand({ lane, children, className }: TimelineBandProps): react_jsx_runtime.JSX.Element;
55
- type TimelineBandSkeletonProps = {
56
- className?: string;
57
- };
58
- /**
59
- * Holds the lane/spine/content geometry so nothing jumps when data lands.
60
- * The spine renders its hairline with no puck — there's no hour to show yet.
61
- */
62
- declare function TimelineBandSkeleton({ className }: TimelineBandSkeletonProps): react_jsx_runtime.JSX.Element;
63
-
64
- export { TIMELINE_MOBILE_GUTTER_CLASS, TimelineBand, type TimelineBandProps, TimelineBandSkeleton, type TimelineBandSkeletonProps, TimelineHourPuck, type TimelineHourPuckProps };
@@ -1,182 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { HourBand, HourBandSkeleton } from "./hour-band";
3
- import { EventCard } from "./event-card";
4
- import { EventCompactRow } from "./event-compact-row";
5
- import type { EventCardLabels, EventFormatters, EventPreview } from "./event-types";
6
-
7
- const labels: EventCardLabels = { free: "Free", liveNow: "Live now" };
8
-
9
- const formatters: EventFormatters = {
10
- time: () => "20:00",
11
- day: () => "Thu, Sep 3",
12
- price: (amount) => `${amount} RON`,
13
- };
14
-
15
- const event = (id: string, title: string, place: string, fee?: number): EventPreview => ({
16
- id,
17
- title,
18
- location: place,
19
- place_name: place,
20
- starts_at: "2026-09-03T20:00:00",
21
- entry_fee: fee,
22
- });
23
-
24
- const meta: Meta<typeof HourBand> = {
25
- title: "Events/HourBand",
26
- component: HourBand,
27
- tags: ["autodocs"],
28
- decorators: [
29
- (Story) => (
30
- <div className="w-[390px] bg-background px-4">
31
- <Story />
32
- </div>
33
- ),
34
- ],
35
- parameters: {
36
- docs: {
37
- description: {
38
- component:
39
- "One hour of the mobile timeline: a 58px gutter with a filled hour chip and a hairline dropping from beneath it, and that hour's rows beside it, ruled between. The rows carry no timestamp of their own — the band is the timestamp, which is why cards render with `hideWhen` and compact rows with `hideTime`.",
40
- },
41
- },
42
- },
43
- };
44
-
45
- export default meta;
46
- type Story = StoryObj<typeof HourBand>;
47
-
48
- export const Default: Story = {
49
- args: {
50
- time: "21:00",
51
- children: (
52
- <>
53
- <EventCard
54
- event={event("1", "Karaoke Night", "VIBE OffSeason")}
55
- labels={labels}
56
- formatters={formatters}
57
- hideWhen
58
- />
59
- <EventCard
60
- event={event("2", "Urban Sounds at Caro", "Caro", 0)}
61
- labels={labels}
62
- formatters={formatters}
63
- hideWhen
64
- />
65
- </>
66
- ),
67
- },
68
- };
69
-
70
- /** The live hour: tinted chip and hairline. The live label is screen-reader only in this variant. */
71
- export const Live: Story = {
72
- args: {
73
- time: "20:00",
74
- isLive: true,
75
- liveLabel: "NOW ON",
76
- children: (
77
- <EventCard
78
- event={event("3", "Psihotrop — From the Beginning to Infinity", "Atelier Café", 50)}
79
- labels={labels}
80
- formatters={formatters}
81
- hideWhen
82
- liveStatus="Live now · ends around 23:00"
83
- />
84
- ),
85
- },
86
- };
87
-
88
- /** The shipped mobile shape: compact rows, ruled between, inside one band. */
89
- export const CompactRows: Story = {
90
- render: () => (
91
- <HourBand time="20:00" isLive liveLabel="Now on">
92
- <EventCompactRow
93
- event={event("r1", "Klausen Quiz by GOtrivia", "Klausen Pubhouse", 20)}
94
- labels={labels}
95
- formatters={formatters}
96
- hideTime
97
- tags={["Drinks", "Games"]}
98
- />
99
- <EventCompactRow
100
- event={event("r2", "Quiz Night at Café del Mars", "Del Mars", 10)}
101
- labels={labels}
102
- formatters={formatters}
103
- hideTime
104
- tags={["Games"]}
105
- />
106
- </HourBand>
107
- ),
108
- };
109
-
110
- /** A single event in a quiet hour. */
111
- export const OneEvent: Story = {
112
- args: {
113
- time: "19:00",
114
- children: (
115
- <EventCard
116
- event={event("4", "Quiz Night", "Flying Circus")}
117
- labels={labels}
118
- formatters={formatters}
119
- hideWhen
120
- />
121
- ),
122
- },
123
- };
124
-
125
- /** Consecutive bands — the hairline should read as one continuous axis. */
126
- export const StackedHours: Story = {
127
- render: () => (
128
- <>
129
- <HourBand time="20:00" isLive liveLabel="NOW ON">
130
- <EventCard
131
- event={event("5", "Psihotrop Live", "Atelier Café", 50)}
132
- labels={labels}
133
- formatters={formatters}
134
- hideWhen
135
- liveStatus="Live now · ends around 23:00"
136
- />
137
- </HourBand>
138
- <HourBand time="21:00">
139
- <EventCard
140
- event={event("6", "Charity Concert & Afterparty", "Flying Circus", 30)}
141
- labels={labels}
142
- formatters={formatters}
143
- hideWhen
144
- />
145
- </HourBand>
146
- <HourBand time="22:00">
147
- <EventCard
148
- event={event("7", "Schoolotheque Afterparty with Machedon", "Flying Circus", 25)}
149
- labels={labels}
150
- formatters={formatters}
151
- hideWhen
152
- />
153
- </HourBand>
154
- </>
155
- ),
156
- };
157
-
158
- /**
159
- * Loading. The chip is blocked out at its fixed 58x24 size — a grey lozenge
160
- * of that exact shape reads as "a time goes here" without inventing one — and
161
- * the rows mirror `EventCompactRowSkeleton`.
162
- */
163
- export const Loading: Story = {
164
- render: () => <HourBandSkeleton />,
165
- };
166
-
167
- /** Loading beside loaded, so gutter and card geometry drift is visible at a glance. */
168
- export const LoadingVsLoaded: Story = {
169
- render: () => (
170
- <div className="grid grid-cols-2 gap-6">
171
- <HourBandSkeleton cardCount={1} />
172
- <HourBand time="21:00">
173
- <EventCard
174
- event={event("8", "Karaoke Night", "VIBE OffSeason")}
175
- labels={labels}
176
- formatters={formatters}
177
- hideWhen
178
- />
179
- </HourBand>
180
- </div>
181
- ),
182
- };