@bearmenu/ui 0.8.9 → 0.8.10
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/dist/chunk-24RFI4RQ.js +167 -0
- package/dist/chunk-2XCZJWTV.js +121 -0
- package/dist/chunk-5RWTOT5Y.js +72 -0
- package/dist/{chunk-AXV5O2IZ.js → chunk-AKQ57NXY.js} +3 -3
- package/dist/chunk-CLLY6XB3.js +41 -0
- package/dist/chunk-DTXNDLSE.js +125 -0
- package/dist/chunk-F6FMZJDG.js +113 -0
- package/dist/{chunk-2WDJR6K7.js → chunk-G7IFL4Z4.js} +4 -1
- package/dist/chunk-MZL7CGCL.js +109 -0
- package/dist/chunk-SY6RV476.js +48 -0
- package/dist/chunk-UDN7UHJW.js +60 -0
- package/dist/{chunk-TT3WFS6S.js → chunk-YOKHBAIH.js} +11 -11
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/command.d.ts +7 -7
- package/dist/components/concept-compare-rail.d.ts +50 -0
- package/dist/components/concept-compare-rail.js +5 -0
- package/dist/components/concept-compare.d.ts +75 -38
- package/dist/components/concept-compare.js +209 -133
- package/dist/components/concept-convergence.d.ts +41 -0
- package/dist/components/concept-convergence.js +53 -0
- package/dist/components/convergence.d.ts +25 -0
- package/dist/components/convergence.js +4 -0
- package/dist/components/date-input.d.ts +1 -1
- package/dist/components/event-card.js +1 -1
- package/dist/components/event-compact-row.js +1 -1
- package/dist/components/event-detail-panel.js +1 -1
- package/dist/components/event-index-row.js +1 -1
- package/dist/components/event-list-row-wide.js +1 -1
- package/dist/components/event-list-row.js +2 -2
- package/dist/components/explainer-steps.d.ts +34 -0
- package/dist/components/explainer-steps.js +36 -0
- package/dist/components/glass-ground.d.ts +66 -0
- package/dist/components/glass-ground.js +3 -0
- package/dist/components/hub-surface.js +11 -1
- package/dist/components/hue-chip.d.ts +70 -0
- package/dist/components/hue-chip.js +3 -0
- package/dist/components/kitchen-dossier.d.ts +88 -0
- package/dist/components/kitchen-dossier.js +187 -0
- package/dist/components/menu-dead-end.d.ts +56 -0
- package/dist/components/menu-dead-end.js +49 -0
- package/dist/components/menu-family-block.d.ts +99 -0
- package/dist/components/menu-family-block.js +155 -0
- package/dist/components/menu-family-card.d.ts +33 -27
- package/dist/components/menu-family-card.js +43 -85
- package/dist/components/menu-field.js +92 -2
- package/dist/components/menu-filter-chips.d.ts +86 -0
- package/dist/components/menu-filter-chips.js +122 -0
- package/dist/components/menu-group-rows.d.ts +53 -0
- package/dist/components/menu-group-rows.js +67 -0
- package/dist/components/menu-index-header.d.ts +37 -0
- package/dist/components/menu-index-header.js +68 -0
- package/dist/components/menu-index-list.d.ts +48 -0
- package/dist/components/menu-index-list.js +96 -0
- package/dist/components/menu-intent-hero.d.ts +69 -0
- package/dist/components/menu-intent-hero.js +87 -0
- package/dist/components/menu-kitchen-list.d.ts +82 -0
- package/dist/components/menu-kitchen-list.js +5 -0
- package/dist/components/menu-mocks.d.ts +37 -2
- package/dist/components/menu-mocks.js +152 -27
- package/dist/components/menu-types.d.ts +182 -6
- package/dist/components/motion-icon-controls.js +2 -2
- package/dist/components/motion-icon-set.js +6 -6
- package/dist/components/motion-icon.d.ts +22 -1
- package/dist/components/motion-icon.js +1 -1
- package/dist/components/photo-ground.d.ts +64 -0
- package/dist/components/photo-ground.js +3 -0
- package/dist/components/place-about-tab.js +2 -2
- package/dist/components/place-details-mobile.js +2 -2
- package/dist/components/place-types.d.ts +2 -2
- package/dist/components/qa-block.d.ts +36 -0
- package/dist/components/qa-block.js +24 -0
- package/dist/components/scroll-fade.js +3 -121
- package/dist/components/snap-rail.d.ts +24 -1
- package/dist/components/snap-rail.js +3 -109
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/story.d.ts +34 -0
- package/dist/components/story.js +3 -0
- package/dist/components/text.d.ts +3 -3
- package/dist/components/top-comparison.d.ts +28 -0
- package/dist/components/top-comparison.js +76 -0
- package/dist/components/top-cross-link.d.ts +34 -0
- package/dist/components/top-cross-link.js +101 -0
- package/dist/components/top-ranking-entry.d.ts +53 -0
- package/dist/components/top-ranking-entry.js +217 -0
- package/dist/components/top-ranking-hero.d.ts +61 -0
- package/dist/components/top-ranking-hero.js +99 -0
- package/dist/components/top-ranking-legend.d.ts +69 -0
- package/dist/components/top-ranking-legend.js +124 -0
- package/dist/components/top-types.d.ts +109 -0
- package/dist/components/top-types.js +1 -0
- package/dist/components/venue-grade-dimensions.d.ts +3 -1
- package/dist/components/venue-grade-dimensions.js +1 -1
- package/dist/components/weekend-panel.js +2 -2
- package/package.json +1 -1
- package/src/components/concept-compare-rail.tsx +131 -0
- package/src/components/concept-compare.stories.tsx +122 -54
- package/src/components/concept-compare.tsx +363 -196
- package/src/components/concept-convergence.stories.tsx +53 -0
- package/src/components/concept-convergence.tsx +90 -0
- package/src/components/convergence.stories.tsx +54 -0
- package/src/components/convergence.tsx +177 -0
- package/src/components/explainer-steps.stories.tsx +46 -0
- package/src/components/explainer-steps.tsx +74 -0
- package/src/components/glass-ground.tsx +129 -0
- package/src/components/hub-surface.tsx +11 -1
- package/src/components/hue-chip.stories.tsx +76 -0
- package/src/components/hue-chip.test.tsx +62 -0
- package/src/components/hue-chip.tsx +99 -0
- package/src/components/kitchen-dossier.stories.tsx +108 -0
- package/src/components/kitchen-dossier.tsx +322 -0
- package/src/components/menu-dead-end.stories.tsx +67 -0
- package/src/components/menu-dead-end.tsx +127 -0
- package/src/components/menu-family-block.stories.tsx +91 -0
- package/src/components/menu-family-block.tsx +314 -0
- package/src/components/menu-family-card.stories.tsx +43 -35
- package/src/components/menu-family-card.tsx +122 -142
- package/src/components/menu-filter-chips.stories.tsx +107 -0
- package/src/components/menu-filter-chips.tsx +238 -0
- package/src/components/menu-group-rows.stories.tsx +54 -0
- package/src/components/menu-group-rows.tsx +133 -0
- package/src/components/menu-index-header.stories.tsx +72 -0
- package/src/components/menu-index-header.tsx +125 -0
- package/src/components/menu-index-list.stories.tsx +50 -0
- package/src/components/menu-index-list.tsx +149 -0
- package/src/components/menu-intent-hero.stories.tsx +67 -0
- package/src/components/menu-intent-hero.tsx +189 -0
- package/src/components/menu-kitchen-list.stories.tsx +67 -0
- package/src/components/menu-kitchen-list.test.tsx +78 -0
- package/src/components/menu-kitchen-list.tsx +284 -0
- package/src/components/menu-mocks.ts +198 -23
- package/src/components/menu-types.ts +189 -6
- package/src/components/motion-icon-controls.tsx +11 -11
- package/src/components/motion-icon-set.tsx +6 -5
- package/src/components/motion-icon.test.tsx +23 -1
- package/src/components/motion-icon.tsx +20 -0
- package/src/components/photo-ground.tsx +147 -0
- package/src/components/place-types.ts +2 -2
- package/src/components/qa-block.stories.tsx +43 -0
- package/src/components/qa-block.tsx +60 -0
- package/src/components/snap-rail.tsx +58 -15
- package/src/components/story.tsx +225 -0
- package/src/components/top-comparison.stories.tsx +78 -0
- package/src/components/top-comparison.tsx +151 -0
- package/src/components/top-cross-link.stories.tsx +84 -0
- package/src/components/top-cross-link.tsx +171 -0
- package/src/components/top-ranking-entry.stories.tsx +171 -0
- package/src/components/top-ranking-entry.test.tsx +105 -0
- package/src/components/top-ranking-entry.tsx +425 -0
- package/src/components/top-ranking-hero.stories.tsx +76 -0
- package/src/components/top-ranking-hero.tsx +218 -0
- package/src/components/top-ranking-legend.stories.tsx +78 -0
- package/src/components/top-ranking-legend.tsx +239 -0
- package/src/components/top-types.ts +110 -0
- package/src/components/venue-grade-dimensions.tsx +2 -2
- package/dist/chunk-THOVPZNN.js +0 -37
- package/dist/chunk-YS6BHKZO.js +0 -92
- package/dist/components/ranked-venue-list.d.ts +0 -49
- package/dist/components/ranked-venue-list.js +0 -87
- package/dist/components/signature-line-list.d.ts +0 -45
- package/dist/components/signature-line-list.js +0 -99
- package/dist/components/venue-busyness-strip.d.ts +0 -35
- package/dist/components/venue-busyness-strip.js +0 -37
- package/dist/components/venue-signature-block.d.ts +0 -39
- package/dist/components/venue-signature-block.js +0 -6
- package/dist/components/venue-spotlight.d.ts +0 -74
- package/dist/components/venue-spotlight.js +0 -138
- package/src/components/ranked-venue-list.stories.tsx +0 -80
- package/src/components/ranked-venue-list.tsx +0 -177
- package/src/components/signature-line-list.stories.tsx +0 -85
- package/src/components/signature-line-list.tsx +0 -136
- package/src/components/venue-busyness-strip.stories.tsx +0 -66
- package/src/components/venue-busyness-strip.tsx +0 -64
- package/src/components/venue-signature-block.stories.tsx +0 -68
- package/src/components/venue-signature-block.tsx +0 -71
- package/src/components/venue-spotlight.stories.tsx +0 -141
- package/src/components/venue-spotlight.tsx +0 -236
- package/dist/{chunk-XWMRABZW.js → chunk-HSIYYA2E.js} +1 -1
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { cn } from "../lib/utils";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* VenueBusynessStrip — when a venue actually fills up, as a bar per hour.
|
|
5
|
-
*
|
|
6
|
-
* The API serves one score per hour of the venue's own trading day, so the
|
|
7
|
-
* strip has no fixed length: a bakery closing at three and a club open until
|
|
8
|
-
* four draw different numbers of bars, and padding either to 24 would put empty
|
|
9
|
-
* columns under hours the venue is not open.
|
|
10
|
-
*
|
|
11
|
-
* The rush is derived rather than passed: bars at or above `peakRatio` of the
|
|
12
|
-
* day's own maximum take the accent. A fixed score threshold would mark every
|
|
13
|
-
* hour at a busy venue and none at a quiet one — busyness is only meaningful
|
|
14
|
-
* relative to that venue's own day.
|
|
15
|
-
*
|
|
16
|
-
* `caption` is composed by the caller ("Usually not busy until 18:00 — the rush
|
|
17
|
-
* is nine to eleven"), because the sentence needs the venue's clock, its locale
|
|
18
|
-
* and a plural rule the DS does not own.
|
|
19
|
-
*
|
|
20
|
-
* Server-safe.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export type VenueBusynessStripProps = {
|
|
24
|
-
busyness: Array<{ hour: number; score: number }>;
|
|
25
|
-
/** Composed sentence beside the bars. */
|
|
26
|
-
caption?: string;
|
|
27
|
-
/** Share of the day's own peak at which an hour counts as the rush. */
|
|
28
|
-
peakRatio?: number;
|
|
29
|
-
className?: string;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const BAR_MAX_HEIGHT = 22;
|
|
33
|
-
|
|
34
|
-
export function VenueBusynessStrip({
|
|
35
|
-
busyness,
|
|
36
|
-
caption,
|
|
37
|
-
peakRatio = 0.8,
|
|
38
|
-
className,
|
|
39
|
-
}: VenueBusynessStripProps) {
|
|
40
|
-
if (busyness.length === 0) return null;
|
|
41
|
-
|
|
42
|
-
const peak = Math.max(...busyness.map((entry) => entry.score));
|
|
43
|
-
if (peak <= 0) return null;
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<div
|
|
47
|
-
className={cn("flex items-center gap-2.5 text-[12.5px] text-muted-foreground", className)}
|
|
48
|
-
>
|
|
49
|
-
<span aria-hidden className="flex h-[22px] items-end gap-[3px]">
|
|
50
|
-
{busyness.map(({ hour, score }) => (
|
|
51
|
-
<i
|
|
52
|
-
key={hour}
|
|
53
|
-
className={cn(
|
|
54
|
-
"w-[7px] rounded-t-sm bg-[oklch(0.88_0.02_45)]",
|
|
55
|
-
score >= peak * peakRatio && "bg-[var(--accent,currentColor)]"
|
|
56
|
-
)}
|
|
57
|
-
style={{ height: Math.max(2, Math.round((score / peak) * BAR_MAX_HEIGHT)) }}
|
|
58
|
-
/>
|
|
59
|
-
))}
|
|
60
|
-
</span>
|
|
61
|
-
{caption}
|
|
62
|
-
</div>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { mockGradients, mockVenues } from "./menu-mocks";
|
|
3
|
-
import { VenueSignatureBlock } from "./venue-signature-block";
|
|
4
|
-
|
|
5
|
-
const labels = {
|
|
6
|
-
currency: "lei",
|
|
7
|
-
mentions: (count: number) => `${count} mentions`,
|
|
8
|
-
signature: "SIGNATURE",
|
|
9
|
-
mentioned: "MENTIONED",
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const meta: Meta<typeof VenueSignatureBlock> = {
|
|
13
|
-
title: "Menu/VenueSignatureBlock",
|
|
14
|
-
component: VenueSignatureBlock,
|
|
15
|
-
tags: ["autodocs"],
|
|
16
|
-
decorators: [
|
|
17
|
-
(Story) => (
|
|
18
|
-
<div className="w-[520px] bg-background p-4">
|
|
19
|
-
<Story />
|
|
20
|
-
</div>
|
|
21
|
-
),
|
|
22
|
-
],
|
|
23
|
-
parameters: {
|
|
24
|
-
docs: {
|
|
25
|
-
description: {
|
|
26
|
-
component:
|
|
27
|
-
"\"What it is known for\": the one dish or drink a venue's reviews single out, on a tinted band. It is a `MenuItem` with a kicker — the same row the venue's own menu renders, so the item does not look like a different object here. The kicker sits above the row rather than inside it; inline at 9.5px it competed with the dish name for the same line.",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default meta;
|
|
34
|
-
type Story = StoryObj<typeof VenueSignatureBlock>;
|
|
35
|
-
|
|
36
|
-
export const Default: Story = {
|
|
37
|
-
args: {
|
|
38
|
-
item: mockVenues[0].signature!.item,
|
|
39
|
-
labels,
|
|
40
|
-
formatPrice: (amount: number) => String(amount),
|
|
41
|
-
kicker: "WHAT IT IS KNOWN FOR",
|
|
42
|
-
markGradient: mockGradients.meat,
|
|
43
|
-
subtitle: mockVenues[0].signature!.why,
|
|
44
|
-
href: "/menu/dishes/chicken-wings",
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/** A drink signature — same block, different scope. */
|
|
49
|
-
export const Drink: Story = {
|
|
50
|
-
args: {
|
|
51
|
-
item: mockVenues[2].signature!.item,
|
|
52
|
-
labels,
|
|
53
|
-
formatPrice: (amount: number) => String(amount),
|
|
54
|
-
kicker: "WHAT THEY POUR",
|
|
55
|
-
markGradient: mockGradients.cocktail,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
/** Inert: no `href`. Used inside a surface that is itself a link. */
|
|
60
|
-
export const Static: Story = {
|
|
61
|
-
args: {
|
|
62
|
-
item: mockVenues[1].signature!.item,
|
|
63
|
-
labels,
|
|
64
|
-
formatPrice: (amount: number) => String(amount),
|
|
65
|
-
kicker: "WHAT IT IS KNOWN FOR",
|
|
66
|
-
markGradient: mockGradients.pasta,
|
|
67
|
-
},
|
|
68
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { cn } from "../lib/utils";
|
|
2
|
-
import { MenuItem, type MenuItemLabels, type MenuItemLinkProps } from "./menu-item";
|
|
3
|
-
import type { MenuItemPreview } from "./menu-types";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* VenueSignatureBlock — "what it is known for": the one dish or drink a venue's
|
|
7
|
-
* reviews single out, on a tinted band.
|
|
8
|
-
*
|
|
9
|
-
* ## It is a `<MenuItem>` with a kicker
|
|
10
|
-
*
|
|
11
|
-
* It used to be its own layout — swatch, label, name, price, all hand-placed —
|
|
12
|
-
* and it drifted from the row every other surface renders. It is now the
|
|
13
|
-
* production row on an accent ground, so a dish looks like itself here, in the
|
|
14
|
-
* "known for" list, and on the venue's own menu.
|
|
15
|
-
*
|
|
16
|
-
* The kicker sits ABOVE the row rather than inside it. Inline at 9.5px it
|
|
17
|
-
* competed with the dish name for the same line, which is how it ended up
|
|
18
|
-
* stacked one word per line.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
export type VenueSignatureBlockProps = {
|
|
22
|
-
item: MenuItemPreview;
|
|
23
|
-
labels: MenuItemLabels;
|
|
24
|
-
formatPrice: (amount: number) => string;
|
|
25
|
-
formatCount?: (value: number) => string;
|
|
26
|
-
/** Small caps kicker, e.g. "WHAT IT IS KNOWN FOR". */
|
|
27
|
-
kicker: string;
|
|
28
|
-
/** The row's category mark, as a CSS `background-image` value. */
|
|
29
|
-
markGradient?: string;
|
|
30
|
-
/** Reviewers' reason, in place of the item description. */
|
|
31
|
-
subtitle?: string;
|
|
32
|
-
href?: string;
|
|
33
|
-
linkComponent?: React.ComponentType<MenuItemLinkProps>;
|
|
34
|
-
className?: string;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export function VenueSignatureBlock({
|
|
38
|
-
item,
|
|
39
|
-
labels,
|
|
40
|
-
formatPrice,
|
|
41
|
-
formatCount,
|
|
42
|
-
kicker,
|
|
43
|
-
markGradient,
|
|
44
|
-
subtitle,
|
|
45
|
-
href,
|
|
46
|
-
linkComponent,
|
|
47
|
-
className,
|
|
48
|
-
}: VenueSignatureBlockProps) {
|
|
49
|
-
return (
|
|
50
|
-
<div className={cn("overflow-hidden rounded-xl bg-accent-subtle py-1", className)}>
|
|
51
|
-
<span className="block px-4 pt-2 text-[9.5px] font-bold uppercase tracking-[0.09em] text-muted-foreground">
|
|
52
|
-
{kicker}
|
|
53
|
-
</span>
|
|
54
|
-
|
|
55
|
-
<MenuItem
|
|
56
|
-
item={item}
|
|
57
|
-
labels={labels}
|
|
58
|
-
formatPrice={formatPrice}
|
|
59
|
-
formatCount={formatCount}
|
|
60
|
-
markGradient={markGradient}
|
|
61
|
-
subtitle={subtitle}
|
|
62
|
-
showSignatureBadge={false}
|
|
63
|
-
href={href}
|
|
64
|
-
linkComponent={linkComponent}
|
|
65
|
-
// The band is already the emphasis; the row must not also take a hover
|
|
66
|
-
// fill inside it.
|
|
67
|
-
className="min-h-0 md:rounded-none md:hover:bg-transparent md:hover:shadow-none"
|
|
68
|
-
/>
|
|
69
|
-
</div>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Button } from "./button";
|
|
3
|
-
import { mockFormatters, mockGradients, mockPlaces, mockVenues } from "./menu-mocks";
|
|
4
|
-
import { VenueSpotlight } from "./venue-spotlight";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const itemLabels = {
|
|
8
|
-
currency: "lei",
|
|
9
|
-
mentions: (count: number) => `${count} mentions`,
|
|
10
|
-
signature: "SIGNATURE",
|
|
11
|
-
mentioned: "MENTIONED",
|
|
12
|
-
};
|
|
13
|
-
const formatPrice = (amount: number) => String(amount);
|
|
14
|
-
|
|
15
|
-
const labels = {
|
|
16
|
-
photoCredit: "venue photograph",
|
|
17
|
-
openUntil: "Kitchen open until 23:00",
|
|
18
|
-
signatureKicker: "WHAT IT IS KNOWN FOR",
|
|
19
|
-
reviewCount: "318 reviews",
|
|
20
|
-
dimensions: {
|
|
21
|
-
food: "Food",
|
|
22
|
-
coffee_quality: "Coffee",
|
|
23
|
-
drinks_quality: "Drinks",
|
|
24
|
-
service: "Service",
|
|
25
|
-
value: "Value",
|
|
26
|
-
ambiance: "Ambiance",
|
|
27
|
-
portion: "Portion",
|
|
28
|
-
consistency: "Consistency",
|
|
29
|
-
},
|
|
30
|
-
tags: { casual: "casual", cozy: "cozy", family_friendly: "family friendly" },
|
|
31
|
-
valueVerdict: "Good value",
|
|
32
|
-
busyness: "Usually not busy until 18:00 — the rush is seven to eight.",
|
|
33
|
-
cite: (count: number) => `Read ${count} reviews`,
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const meta: Meta<typeof VenueSpotlight> = {
|
|
37
|
-
title: "Menu/VenueSpotlight",
|
|
38
|
-
component: VenueSpotlight,
|
|
39
|
-
tags: ["autodocs"],
|
|
40
|
-
decorators: [
|
|
41
|
-
(Story) => (
|
|
42
|
-
<div className="w-[1100px] bg-background p-4">
|
|
43
|
-
<Story />
|
|
44
|
-
</div>
|
|
45
|
-
),
|
|
46
|
-
],
|
|
47
|
-
parameters: {
|
|
48
|
-
docs: {
|
|
49
|
-
description: {
|
|
50
|
-
component:
|
|
51
|
-
"One venue given real space: photograph, what it is known for, what reviewers say, how it grades, and when it fills up. The photograph is the point — this is the one module on a menu hub that shows an image, and it can, because venue photography is real and licensed where item photography is generated. Composed from `VenueSignatureBlock`, `VenueQuotes`, `VenueGradeDimensions` and `VenueBusynessStrip`, each exported on its own for consumers building a narrower variant.",
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export default meta;
|
|
58
|
-
type Story = StoryObj<typeof VenueSpotlight>;
|
|
59
|
-
|
|
60
|
-
export const Default: Story = {
|
|
61
|
-
args: {
|
|
62
|
-
place: mockPlaces[0],
|
|
63
|
-
href: mockVenues[0].href,
|
|
64
|
-
labels,
|
|
65
|
-
meta: "pub · Centru · 318 reviews read",
|
|
66
|
-
signature: mockVenues[0].signature,
|
|
67
|
-
signatureGradient: mockGradients.meat,
|
|
68
|
-
formatScore: mockFormatters.score,
|
|
69
|
-
itemLabels,
|
|
70
|
-
formatPrice,
|
|
71
|
-
action: <Button size="sm">Open the menu</Button>,
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
/** A coffee bar: no food dimension, and a `frequent` signature rather than a signature one. */
|
|
76
|
-
export const CoffeeBar: Story = {
|
|
77
|
-
args: {
|
|
78
|
-
place: mockPlaces[2],
|
|
79
|
-
href: mockVenues[2].href,
|
|
80
|
-
labels: { ...labels, openUntil: "Open until 20:00", reviewCount: "96 reviews" },
|
|
81
|
-
meta: "coffee · Centru",
|
|
82
|
-
signature: mockVenues[2].signature,
|
|
83
|
-
signatureGradient: mockGradients.sweet,
|
|
84
|
-
formatScore: mockFormatters.score,
|
|
85
|
-
itemLabels,
|
|
86
|
-
formatPrice,
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* A venue the review census has not reached: no digest at all. Every block that
|
|
92
|
-
* depends on one drops out and the card still reads as a venue.
|
|
93
|
-
*/
|
|
94
|
-
export const WithoutDigest: Story = {
|
|
95
|
-
args: {
|
|
96
|
-
place: mockPlaces[3],
|
|
97
|
-
href: mockVenues[3].href,
|
|
98
|
-
labels: { ...labels, openUntil: undefined, reviewCount: "141 reviews" },
|
|
99
|
-
meta: "restaurant · Mărăști",
|
|
100
|
-
formatScore: mockFormatters.score,
|
|
101
|
-
itemLabels,
|
|
102
|
-
formatPrice,
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
/** Quotes wired to their evidence. Needs a client caller. */
|
|
107
|
-
export const CitableQuotes: Story = {
|
|
108
|
-
args: {
|
|
109
|
-
place: mockPlaces[0],
|
|
110
|
-
href: mockVenues[0].href,
|
|
111
|
-
labels,
|
|
112
|
-
meta: "pub · Centru",
|
|
113
|
-
signature: mockVenues[0].signature,
|
|
114
|
-
signatureGradient: mockGradients.meat,
|
|
115
|
-
formatScore: mockFormatters.score,
|
|
116
|
-
itemLabels,
|
|
117
|
-
formatPrice,
|
|
118
|
-
onCite: () => {},
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export const Mobile: Story = {
|
|
123
|
-
args: {
|
|
124
|
-
place: mockPlaces[0],
|
|
125
|
-
href: mockVenues[0].href,
|
|
126
|
-
labels,
|
|
127
|
-
meta: "pub · Centru",
|
|
128
|
-
signature: mockVenues[0].signature,
|
|
129
|
-
signatureGradient: mockGradients.meat,
|
|
130
|
-
formatScore: mockFormatters.score,
|
|
131
|
-
itemLabels,
|
|
132
|
-
formatPrice,
|
|
133
|
-
},
|
|
134
|
-
decorators: [
|
|
135
|
-
(Story) => (
|
|
136
|
-
<div className="w-[390px] bg-background p-3">
|
|
137
|
-
<Story />
|
|
138
|
-
</div>
|
|
139
|
-
),
|
|
140
|
-
],
|
|
141
|
-
};
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import { Camera, Star } from "lucide-react";
|
|
2
|
-
import { cn } from "../lib/utils";
|
|
3
|
-
import { Separator } from "./separator";
|
|
4
|
-
import { VenueGradeDimensions, type VenueGradeDimensionKey } from "./venue-grade-dimensions";
|
|
5
|
-
import { VenueQuotes } from "./venue-quotes";
|
|
6
|
-
import { VenueSignatureBlock } from "./venue-signature-block";
|
|
7
|
-
import type { MenuItemLabels } from "./menu-item";
|
|
8
|
-
import type { MenuVenueSignature, MenuLinkProps, MenuLinkComponent } from "./menu-types";
|
|
9
|
-
import type { CitedText, PlacePreview } from "./place-types";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* VenueSpotlight — one venue given real space: photograph, what it is known
|
|
13
|
-
* for, what reviewers say, how it grades, and when it fills up.
|
|
14
|
-
*
|
|
15
|
-
* The photograph IS the point of this surface. It is the one module on a menu
|
|
16
|
-
* hub that shows an image, and it can, because venue photography is real and
|
|
17
|
-
* licensed where item photography is generated. Absent a photo it degrades to
|
|
18
|
-
* the same diagonal texture the hero uses, never to a bare icon.
|
|
19
|
-
*
|
|
20
|
-
* ## Composed from exported parts
|
|
21
|
-
*
|
|
22
|
-
* `VenueSignatureBlock`, `VenueQuotes`, `VenueGradeDimensions` and
|
|
23
|
-
* `VenueBusynessStrip` are each exported on their own. This composite is the
|
|
24
|
-
* arrangement the hub wants; a consumer filming a single panel, or building a
|
|
25
|
-
* narrower variant, takes the parts instead. Everything here is layout — no
|
|
26
|
-
* part is reachable only through the composite.
|
|
27
|
-
*
|
|
28
|
-
* No directive: it renders on the server unless `onCite` is passed through to
|
|
29
|
-
* the quotes.
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/** @deprecated Alias of `MenuLinkProps`; kept so existing imports keep working. */
|
|
33
|
-
export type VenueSpotlightLinkProps = MenuLinkProps;
|
|
34
|
-
|
|
35
|
-
function DefaultLink({ href, ...props }: VenueSpotlightLinkProps) {
|
|
36
|
-
return <a href={href} {...props} />;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export type VenueSpotlightLabels = {
|
|
40
|
-
/** Overlay on the photograph, e.g. "venue photograph". */
|
|
41
|
-
photoCredit?: string;
|
|
42
|
-
/** Composed open state, e.g. "Kitchen open until 23:00". Absent when closed or unknown. */
|
|
43
|
-
openUntil?: string;
|
|
44
|
-
/** Kicker over the signature, e.g. "WHAT IT IS KNOWN FOR". */
|
|
45
|
-
signatureKicker: string;
|
|
46
|
-
/** Composed review count, e.g. "318 reviews". */
|
|
47
|
-
reviewCount?: string;
|
|
48
|
-
/** Dimension key → translated label. */
|
|
49
|
-
dimensions: Partial<Record<VenueGradeDimensionKey, string>>;
|
|
50
|
-
/** Tag code → translated label. Missing codes render the raw code. */
|
|
51
|
-
tags?: Record<string, string>;
|
|
52
|
-
/** Composed value verdict, e.g. "Good value". */
|
|
53
|
-
valueVerdict?: string;
|
|
54
|
-
/** Composed busyness sentence. */
|
|
55
|
-
busyness?: string;
|
|
56
|
-
/** Accessible name for a quote's cite action. */
|
|
57
|
-
cite?: (reviewCount: number) => string;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export type VenueSpotlightProps = {
|
|
61
|
-
place: PlacePreview;
|
|
62
|
-
href: string;
|
|
63
|
-
labels: VenueSpotlightLabels;
|
|
64
|
-
/** Composed meta line, e.g. "pub · Centru". Clause order is locale-dependent. */
|
|
65
|
-
meta?: string;
|
|
66
|
-
signature?: MenuVenueSignature;
|
|
67
|
-
/** CSS gradient for the signature swatch. */
|
|
68
|
-
signatureGradient?: string;
|
|
69
|
-
/** Passed through to the signature `<MenuItem>`. */
|
|
70
|
-
itemLabels: MenuItemLabels;
|
|
71
|
-
formatPrice: (amount: number) => string;
|
|
72
|
-
formatCount?: (value: number) => string;
|
|
73
|
-
/** 0–100 → display numeral for the dimension bars. */
|
|
74
|
-
formatScore: (value: number) => string;
|
|
75
|
-
/** Opens the reviews behind a quote. */
|
|
76
|
-
onCite?: (quote: CitedText) => void;
|
|
77
|
-
/** The action in the footer — pass a rendered link or button. */
|
|
78
|
-
action?: React.ReactNode;
|
|
79
|
-
linkComponent?: MenuLinkComponent;
|
|
80
|
-
className?: string;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
/** Quotes are capped at two: a third pushes the grade row below the fold on a phone. */
|
|
84
|
-
const QUOTE_LIMIT = 2;
|
|
85
|
-
|
|
86
|
-
export function VenueSpotlight({
|
|
87
|
-
place,
|
|
88
|
-
href,
|
|
89
|
-
labels,
|
|
90
|
-
meta,
|
|
91
|
-
signature,
|
|
92
|
-
signatureGradient,
|
|
93
|
-
itemLabels,
|
|
94
|
-
formatPrice,
|
|
95
|
-
formatCount,
|
|
96
|
-
formatScore,
|
|
97
|
-
onCite,
|
|
98
|
-
action,
|
|
99
|
-
linkComponent: LinkComponent = DefaultLink,
|
|
100
|
-
className,
|
|
101
|
-
}: VenueSpotlightProps) {
|
|
102
|
-
const digest = place.reviews_digest;
|
|
103
|
-
const tags = digest?.tags ?? [];
|
|
104
|
-
|
|
105
|
-
return (
|
|
106
|
-
<div
|
|
107
|
-
className={cn(
|
|
108
|
-
"grid overflow-hidden rounded-[18px] border border-border bg-card lg:grid-cols-[404px_1fr]",
|
|
109
|
-
className
|
|
110
|
-
)}
|
|
111
|
-
>
|
|
112
|
-
<div className="relative min-h-[220px] bg-[repeating-linear-gradient(135deg,oklch(0.76_0.02_55)_0_10px,oklch(0.83_0.013_58)_10px_20px)] lg:min-h-[340px]">
|
|
113
|
-
{place.thumbnail_url && (
|
|
114
|
-
// eslint-disable-next-line @next/next/no-img-element
|
|
115
|
-
<img
|
|
116
|
-
src={place.thumbnail_url}
|
|
117
|
-
alt={place.name}
|
|
118
|
-
className="absolute inset-0 h-full w-full object-cover"
|
|
119
|
-
/>
|
|
120
|
-
)}
|
|
121
|
-
|
|
122
|
-
{labels.photoCredit && (
|
|
123
|
-
<span className="absolute left-3.5 top-3.5 inline-flex h-7 items-center gap-1.5 rounded-full bg-black/60 px-2.5 text-[11px] font-bold text-white">
|
|
124
|
-
<Camera className="h-2.5 w-2.5" aria-hidden />
|
|
125
|
-
{labels.photoCredit}
|
|
126
|
-
</span>
|
|
127
|
-
)}
|
|
128
|
-
|
|
129
|
-
{labels.openUntil && (
|
|
130
|
-
<span className="absolute bottom-3.5 left-3.5 inline-flex h-[30px] items-center gap-[7px] rounded-full bg-background px-3 text-[11.5px] font-bold text-[var(--free,currentColor)]">
|
|
131
|
-
<i className="h-[7px] w-[7px] rounded-full bg-current" aria-hidden />
|
|
132
|
-
{labels.openUntil}
|
|
133
|
-
</span>
|
|
134
|
-
)}
|
|
135
|
-
</div>
|
|
136
|
-
|
|
137
|
-
<div className="flex flex-col gap-3.5 p-4 lg:p-6">
|
|
138
|
-
{/*
|
|
139
|
-
`items-baseline` and a hard `shrink-0` on the rating: the venue name
|
|
140
|
-
is a long serif line that wraps, and with `items-start` the numeral
|
|
141
|
-
floated beside its second line instead of sitting on the first. The
|
|
142
|
-
name column also needs `min-w-0` AND `basis-0` — without the basis a
|
|
143
|
-
long unbroken word (a venue called "Tortelli Pasta Bar") refuses to
|
|
144
|
-
wrap and pushes the rating off the card.
|
|
145
|
-
*/}
|
|
146
|
-
<div className="flex items-baseline justify-between gap-3">
|
|
147
|
-
<h3 className="min-w-0 flex-1 basis-0 font-serif text-xl font-semibold leading-tight tracking-[-0.02em] lg:text-[28px]">
|
|
148
|
-
<LinkComponent
|
|
149
|
-
href={href}
|
|
150
|
-
className="rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
151
|
-
>
|
|
152
|
-
{place.name}
|
|
153
|
-
</LinkComponent>
|
|
154
|
-
</h3>
|
|
155
|
-
|
|
156
|
-
{place.rating && (
|
|
157
|
-
<div className="flex shrink-0 items-baseline gap-1.5">
|
|
158
|
-
<b className="text-xl font-extrabold tabular-nums lg:text-2xl">
|
|
159
|
-
{place.rating.rating}
|
|
160
|
-
</b>
|
|
161
|
-
<Star className="h-3 w-3 self-center text-muted-foreground" aria-hidden />
|
|
162
|
-
</div>
|
|
163
|
-
)}
|
|
164
|
-
</div>
|
|
165
|
-
|
|
166
|
-
{(meta || labels.reviewCount) && (
|
|
167
|
-
<div className="-mt-2 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[12.5px] text-muted-foreground">
|
|
168
|
-
{meta && <span>{meta}</span>}
|
|
169
|
-
{meta && labels.reviewCount && <span aria-hidden>·</span>}
|
|
170
|
-
{labels.reviewCount && <span>{labels.reviewCount}</span>}
|
|
171
|
-
</div>
|
|
172
|
-
)}
|
|
173
|
-
|
|
174
|
-
{signature && (
|
|
175
|
-
<VenueSignatureBlock
|
|
176
|
-
item={signature.item}
|
|
177
|
-
labels={itemLabels}
|
|
178
|
-
formatPrice={formatPrice}
|
|
179
|
-
formatCount={formatCount}
|
|
180
|
-
kicker={labels.signatureKicker}
|
|
181
|
-
markGradient={signatureGradient}
|
|
182
|
-
subtitle={signature.why}
|
|
183
|
-
href={signature.href}
|
|
184
|
-
linkComponent={LinkComponent}
|
|
185
|
-
/>
|
|
186
|
-
)}
|
|
187
|
-
|
|
188
|
-
{digest?.highlights && (
|
|
189
|
-
<VenueQuotes
|
|
190
|
-
quotes={digest.highlights}
|
|
191
|
-
limit={QUOTE_LIMIT}
|
|
192
|
-
onCite={onCite}
|
|
193
|
-
citeLabel={labels.cite}
|
|
194
|
-
/>
|
|
195
|
-
)}
|
|
196
|
-
|
|
197
|
-
{digest?.grade?.dimensions && <Separator />}
|
|
198
|
-
|
|
199
|
-
{digest?.grade?.dimensions && (
|
|
200
|
-
<VenueGradeDimensions
|
|
201
|
-
dimensions={digest.grade.dimensions}
|
|
202
|
-
labels={labels.dimensions}
|
|
203
|
-
formatScore={formatScore}
|
|
204
|
-
className="mt-1"
|
|
205
|
-
/>
|
|
206
|
-
)}
|
|
207
|
-
|
|
208
|
-
{(labels.valueVerdict || tags.length > 0) && (
|
|
209
|
-
<div className="flex flex-wrap items-center gap-2">
|
|
210
|
-
{labels.valueVerdict && (
|
|
211
|
-
<span className="inline-flex h-[26px] items-center gap-1.5 rounded-full bg-accent-subtle px-2.5 text-[11.5px] font-bold text-accent">
|
|
212
|
-
{labels.valueVerdict}
|
|
213
|
-
</span>
|
|
214
|
-
)}
|
|
215
|
-
{tags.map((tag) => (
|
|
216
|
-
<span
|
|
217
|
-
key={tag.value}
|
|
218
|
-
className="inline-flex h-[26px] items-center rounded-full border border-border px-2.5 text-[11.5px] text-muted-foreground"
|
|
219
|
-
>
|
|
220
|
-
{labels.tags?.[tag.value] ?? tag.value}
|
|
221
|
-
</span>
|
|
222
|
-
))}
|
|
223
|
-
</div>
|
|
224
|
-
)}
|
|
225
|
-
|
|
226
|
-
{/* No busyness strip here. Twelve unlabelled bars under a grade row
|
|
227
|
-
read as a second, unexplained chart — nobody could tell what they
|
|
228
|
-
measured without the sentence beside them, and the sentence does not
|
|
229
|
-
fit on this card. `<VenueBusynessStrip>` still exists and belongs on
|
|
230
|
-
the venue's own page, where it has room to be captioned. */}
|
|
231
|
-
|
|
232
|
-
{action && <div className="mt-auto flex justify-end pt-1">{action}</div>}
|
|
233
|
-
</div>
|
|
234
|
-
</div>
|
|
235
|
-
);
|
|
236
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PlaceScheduleWeek } from './chunk-VG3PND3D.js';
|
|
2
|
-
import { Separator } from './chunk-WSRWFA6K.js';
|
|
3
2
|
import { Tag } from './chunk-ZDAHKI3A.js';
|
|
3
|
+
import { Separator } from './chunk-WSRWFA6K.js';
|
|
4
4
|
import { Text } from './chunk-7BWTYWM3.js';
|
|
5
5
|
import { cn } from './chunk-FEK5XGZW.js';
|
|
6
6
|
import { __spreadProps, __spreadValues } from './chunk-3GWWZKX7.js';
|