@bearmenu/ui 0.8.8 → 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.
Files changed (206) hide show
  1. package/dist/chunk-24RFI4RQ.js +167 -0
  2. package/dist/chunk-2XCZJWTV.js +121 -0
  3. package/dist/chunk-5RWTOT5Y.js +72 -0
  4. package/dist/chunk-62ES6N32.js +27 -0
  5. package/dist/chunk-AKQ57NXY.js +58 -0
  6. package/dist/chunk-CLLY6XB3.js +41 -0
  7. package/dist/chunk-DTXNDLSE.js +125 -0
  8. package/dist/chunk-F6FMZJDG.js +113 -0
  9. package/dist/{chunk-2WDJR6K7.js → chunk-G7IFL4Z4.js} +4 -1
  10. package/dist/chunk-MZL7CGCL.js +109 -0
  11. package/dist/chunk-Q6QH52LJ.js +38 -0
  12. package/dist/chunk-SY6RV476.js +48 -0
  13. package/dist/chunk-TH6W2PWG.js +213 -0
  14. package/dist/chunk-UDN7UHJW.js +60 -0
  15. package/dist/{chunk-TT3WFS6S.js → chunk-YOKHBAIH.js} +11 -11
  16. package/dist/components/alert.d.ts +2 -2
  17. package/dist/components/badge.d.ts +1 -1
  18. package/dist/components/concept-compare-rail.d.ts +50 -0
  19. package/dist/components/concept-compare-rail.js +5 -0
  20. package/dist/components/concept-compare.d.ts +110 -0
  21. package/dist/components/concept-compare.js +238 -0
  22. package/dist/components/concept-convergence.d.ts +41 -0
  23. package/dist/components/concept-convergence.js +53 -0
  24. package/dist/components/convergence.d.ts +25 -0
  25. package/dist/components/convergence.js +4 -0
  26. package/dist/components/date-input.d.ts +1 -1
  27. package/dist/components/event-card.js +1 -1
  28. package/dist/components/event-compact-row.d.ts +1 -1
  29. package/dist/components/event-compact-row.js +1 -1
  30. package/dist/components/event-detail-panel.d.ts +171 -25
  31. package/dist/components/event-detail-panel.js +472 -175
  32. package/dist/components/event-index-row.js +1 -1
  33. package/dist/components/event-list-row-wide.js +2 -2
  34. package/dist/components/event-list-row.js +2 -2
  35. package/dist/components/explainer-steps.d.ts +34 -0
  36. package/dist/components/explainer-steps.js +36 -0
  37. package/dist/components/glass-ground.d.ts +66 -0
  38. package/dist/components/glass-ground.js +3 -0
  39. package/dist/components/hub-surface.d.ts +27 -0
  40. package/dist/components/hub-surface.js +30 -0
  41. package/dist/components/hue-chip.d.ts +70 -0
  42. package/dist/components/hue-chip.js +3 -0
  43. package/dist/components/kitchen-dossier.d.ts +88 -0
  44. package/dist/components/kitchen-dossier.js +187 -0
  45. package/dist/components/menu-dead-end.d.ts +56 -0
  46. package/dist/components/menu-dead-end.js +49 -0
  47. package/dist/components/menu-family-block.d.ts +99 -0
  48. package/dist/components/menu-family-block.js +155 -0
  49. package/dist/components/menu-family-card.d.ts +65 -0
  50. package/dist/components/menu-family-card.js +79 -0
  51. package/dist/components/menu-field.d.ts +57 -0
  52. package/dist/components/menu-field.js +93 -0
  53. package/dist/components/menu-filter-chips.d.ts +86 -0
  54. package/dist/components/menu-filter-chips.js +122 -0
  55. package/dist/components/menu-group-rows.d.ts +53 -0
  56. package/dist/components/menu-group-rows.js +67 -0
  57. package/dist/components/menu-hub-hero.d.ts +65 -0
  58. package/dist/components/menu-hub-hero.js +103 -0
  59. package/dist/components/menu-index-header.d.ts +37 -0
  60. package/dist/components/menu-index-header.js +68 -0
  61. package/dist/components/menu-index-list.d.ts +48 -0
  62. package/dist/components/menu-index-list.js +96 -0
  63. package/dist/components/menu-intent-hero.d.ts +69 -0
  64. package/dist/components/menu-intent-hero.js +87 -0
  65. package/dist/components/menu-intent-tiles.d.ts +31 -0
  66. package/dist/components/menu-intent-tiles.js +50 -0
  67. package/dist/components/menu-item.d.ts +127 -0
  68. package/dist/components/menu-item.js +5 -0
  69. package/dist/components/menu-kitchen-list.d.ts +82 -0
  70. package/dist/components/menu-kitchen-list.js +5 -0
  71. package/dist/components/menu-mocks.d.ts +90 -0
  72. package/dist/components/menu-mocks.js +504 -0
  73. package/dist/components/menu-types.d.ts +421 -0
  74. package/dist/components/menu-types.js +1 -0
  75. package/dist/components/motion-icon-controls.js +2 -2
  76. package/dist/components/motion-icon-set.js +21 -9
  77. package/dist/components/motion-icon.d.ts +22 -1
  78. package/dist/components/motion-icon.js +1 -1
  79. package/dist/components/open-now-list.d.ts +40 -0
  80. package/dist/components/open-now-list.js +69 -0
  81. package/dist/components/photo-ground.d.ts +64 -0
  82. package/dist/components/photo-ground.js +3 -0
  83. package/dist/components/place-about-tab.js +2 -2
  84. package/dist/components/place-details-mobile.js +2 -2
  85. package/dist/components/place-types.d.ts +112 -1
  86. package/dist/components/qa-block.d.ts +36 -0
  87. package/dist/components/qa-block.js +24 -0
  88. package/dist/components/scroll-fade.js +3 -121
  89. package/dist/components/signature-chip.d.ts +37 -0
  90. package/dist/components/signature-chip.js +4 -0
  91. package/dist/components/snap-rail.d.ts +48 -5
  92. package/dist/components/snap-rail.js +3 -51
  93. package/dist/components/stat-banner.d.ts +47 -0
  94. package/dist/components/stat-banner.js +61 -0
  95. package/dist/components/story.d.ts +34 -0
  96. package/dist/components/story.js +3 -0
  97. package/dist/components/tag.d.ts +2 -2
  98. package/dist/components/text.d.ts +1 -1
  99. package/dist/components/top-comparison.d.ts +28 -0
  100. package/dist/components/top-comparison.js +76 -0
  101. package/dist/components/top-cross-link.d.ts +34 -0
  102. package/dist/components/top-cross-link.js +101 -0
  103. package/dist/components/top-ranking-entry.d.ts +53 -0
  104. package/dist/components/top-ranking-entry.js +217 -0
  105. package/dist/components/top-ranking-hero.d.ts +61 -0
  106. package/dist/components/top-ranking-hero.js +99 -0
  107. package/dist/components/top-ranking-legend.d.ts +69 -0
  108. package/dist/components/top-ranking-legend.js +124 -0
  109. package/dist/components/top-types.d.ts +109 -0
  110. package/dist/components/top-types.js +1 -0
  111. package/dist/components/venue-grade-dimensions.d.ts +38 -0
  112. package/dist/components/venue-grade-dimensions.js +3 -0
  113. package/dist/components/venue-quotes.d.ts +32 -0
  114. package/dist/components/venue-quotes.js +3 -0
  115. package/dist/components/venue-wall.d.ts +41 -0
  116. package/dist/components/venue-wall.js +118 -0
  117. package/dist/components/weekday-theme-banner.d.ts +70 -0
  118. package/dist/components/weekday-theme-banner.js +127 -0
  119. package/dist/components/weekend-panel.js +2 -2
  120. package/package.json +1 -1
  121. package/src/components/colour-dictionary.stories.tsx +227 -0
  122. package/src/components/concept-compare-rail.tsx +131 -0
  123. package/src/components/concept-compare.stories.tsx +172 -0
  124. package/src/components/concept-compare.tsx +443 -0
  125. package/src/components/concept-convergence.stories.tsx +53 -0
  126. package/src/components/concept-convergence.tsx +90 -0
  127. package/src/components/convergence.stories.tsx +54 -0
  128. package/src/components/convergence.tsx +177 -0
  129. package/src/components/event-compact-row.tsx +1 -1
  130. package/src/components/event-detail-panel.stories.tsx +205 -97
  131. package/src/components/event-detail-panel.test.tsx +181 -0
  132. package/src/components/event-detail-panel.tsx +703 -185
  133. package/src/components/explainer-steps.stories.tsx +46 -0
  134. package/src/components/explainer-steps.tsx +74 -0
  135. package/src/components/glass-ground.tsx +129 -0
  136. package/src/components/hub-surface.stories.tsx +68 -0
  137. package/src/components/hub-surface.tsx +50 -0
  138. package/src/components/hue-chip.stories.tsx +76 -0
  139. package/src/components/hue-chip.test.tsx +62 -0
  140. package/src/components/hue-chip.tsx +99 -0
  141. package/src/components/kitchen-dossier.stories.tsx +108 -0
  142. package/src/components/kitchen-dossier.tsx +322 -0
  143. package/src/components/menu-dead-end.stories.tsx +67 -0
  144. package/src/components/menu-dead-end.tsx +127 -0
  145. package/src/components/menu-family-block.stories.tsx +91 -0
  146. package/src/components/menu-family-block.tsx +314 -0
  147. package/src/components/menu-family-card.stories.tsx +120 -0
  148. package/src/components/menu-family-card.tsx +191 -0
  149. package/src/components/menu-field.stories.tsx +74 -0
  150. package/src/components/menu-field.tsx +199 -0
  151. package/src/components/menu-filter-chips.stories.tsx +107 -0
  152. package/src/components/menu-filter-chips.tsx +238 -0
  153. package/src/components/menu-group-rows.stories.tsx +54 -0
  154. package/src/components/menu-group-rows.tsx +133 -0
  155. package/src/components/menu-hub-hero.stories.tsx +92 -0
  156. package/src/components/menu-hub-hero.tsx +187 -0
  157. package/src/components/menu-index-header.stories.tsx +72 -0
  158. package/src/components/menu-index-header.tsx +125 -0
  159. package/src/components/menu-index-list.stories.tsx +50 -0
  160. package/src/components/menu-index-list.tsx +149 -0
  161. package/src/components/menu-intent-hero.stories.tsx +67 -0
  162. package/src/components/menu-intent-hero.tsx +189 -0
  163. package/src/components/menu-intent-tiles.stories.tsx +54 -0
  164. package/src/components/menu-intent-tiles.tsx +76 -0
  165. package/src/components/menu-item.tsx +416 -0
  166. package/src/components/menu-kitchen-list.stories.tsx +67 -0
  167. package/src/components/menu-kitchen-list.test.tsx +78 -0
  168. package/src/components/menu-kitchen-list.tsx +284 -0
  169. package/src/components/menu-mocks.ts +592 -0
  170. package/src/components/menu-types.ts +442 -0
  171. package/src/components/motion-icon-controls.tsx +11 -11
  172. package/src/components/motion-icon-set.tsx +36 -8
  173. package/src/components/motion-icon.test.tsx +23 -1
  174. package/src/components/motion-icon.tsx +20 -0
  175. package/src/components/open-now-list.stories.tsx +76 -0
  176. package/src/components/open-now-list.tsx +127 -0
  177. package/src/components/photo-ground.tsx +147 -0
  178. package/src/components/place-types.ts +112 -0
  179. package/src/components/qa-block.stories.tsx +43 -0
  180. package/src/components/qa-block.tsx +60 -0
  181. package/src/components/signature-chip.tsx +77 -0
  182. package/src/components/snap-rail.tsx +133 -9
  183. package/src/components/stat-banner.stories.tsx +100 -0
  184. package/src/components/stat-banner.tsx +117 -0
  185. package/src/components/story.tsx +225 -0
  186. package/src/components/top-comparison.stories.tsx +78 -0
  187. package/src/components/top-comparison.tsx +151 -0
  188. package/src/components/top-cross-link.stories.tsx +84 -0
  189. package/src/components/top-cross-link.tsx +171 -0
  190. package/src/components/top-ranking-entry.stories.tsx +171 -0
  191. package/src/components/top-ranking-entry.test.tsx +105 -0
  192. package/src/components/top-ranking-entry.tsx +425 -0
  193. package/src/components/top-ranking-hero.stories.tsx +76 -0
  194. package/src/components/top-ranking-hero.tsx +218 -0
  195. package/src/components/top-ranking-legend.stories.tsx +78 -0
  196. package/src/components/top-ranking-legend.tsx +239 -0
  197. package/src/components/top-types.ts +110 -0
  198. package/src/components/venue-grade-dimensions.stories.tsx +83 -0
  199. package/src/components/venue-grade-dimensions.tsx +91 -0
  200. package/src/components/venue-quotes.stories.tsx +59 -0
  201. package/src/components/venue-quotes.tsx +64 -0
  202. package/src/components/venue-wall.stories.tsx +78 -0
  203. package/src/components/venue-wall.tsx +185 -0
  204. package/src/components/weekday-theme-banner.stories.tsx +113 -0
  205. package/src/components/weekday-theme-banner.tsx +231 -0
  206. package/dist/{chunk-XWMRABZW.js → chunk-HSIYYA2E.js} +1 -1
@@ -0,0 +1,231 @@
1
+ import { cn } from "../lib/utils";
2
+
3
+ /**
4
+ * WeekdayThemeBanner — the day's editorial theme, with the whole week beside it.
5
+ *
6
+ * Showing all seven days is the point: a banner that only says "it is Burger
7
+ * Thursday" is an assertion, while one that shows Wednesday was salads and
8
+ * Friday is pizza reads as a standing rhythm the reader can come back for. The
9
+ * other six days are also the only affordance for browsing to one.
10
+ *
11
+ * ## The active day is the caller's, not the component's
12
+ *
13
+ * `activeDay` is an index into `days`, resolved by the caller from the READER's
14
+ * clock. Resolving it here would use the server's, and a server in UTC and a
15
+ * reader in Bucharest disagree about which day it is for two hours out of every
16
+ * twenty-four.
17
+ *
18
+ * No directive: with `dayHref` the week rail is links and renders on the
19
+ * server; with `onDayChange` it is buttons and needs a client caller.
20
+ */
21
+
22
+ export type WeekdayThemeBannerLinkProps = {
23
+ href: string;
24
+ className?: string;
25
+ children: React.ReactNode;
26
+ };
27
+
28
+ function DefaultLink({ href, ...props }: WeekdayThemeBannerLinkProps) {
29
+ return <a href={href} {...props} />;
30
+ }
31
+
32
+ export type WeekdayThemeDay = {
33
+ /** Short code, e.g. "THU". Already localised. */
34
+ code: string;
35
+ /** Theme name, e.g. "Burger Thursday". */
36
+ name: string;
37
+ /** Short form for the rail, e.g. "Burger". Falls back to `name`. */
38
+ shortName?: string;
39
+ /** Items under the theme. Omit where there is no count to show. */
40
+ count?: number;
41
+ };
42
+
43
+ export type WeekdayThemeBannerProps = {
44
+ days: WeekdayThemeDay[];
45
+ /** Index into `days` for the reader's own today. */
46
+ activeDay: number;
47
+ /** Kicker over the title, e.g. "TODAY IS THURSDAY". Composed by the caller. */
48
+ kicker?: string;
49
+ kickerIcon?: React.ReactNode;
50
+ /** The banner's body copy for the active day. */
51
+ body?: string;
52
+ /** Heading over the week rail, e.g. "THE WEEK". */
53
+ weekLabel?: string;
54
+ /** The primary action — pass a rendered button or link. */
55
+ action?: React.ReactNode;
56
+ /** Note beside the action, e.g. "Bruno picks nine, ranked on mentions". */
57
+ actionNote?: string;
58
+ /** Destination per day index. Renders the rail as links. */
59
+ dayHref?: (day: WeekdayThemeDay, index: number) => string;
60
+ /** Selects a day in place. Renders the rail as buttons. */
61
+ onDayChange?: (index: number) => void;
62
+ /**
63
+ * The day's photograph.
64
+ *
65
+ * This is the one editorial slot on a menu hub that carries a plated dish,
66
+ * and it can because these are art-directed assets shipped with the app, not
67
+ * generated item photos pulled off a menu row. Without one the banner falls
68
+ * back to its flat ground and still reads — but the flat version is the
69
+ * degraded state, not the design.
70
+ */
71
+ imageUrl?: string;
72
+ linkComponent?: React.ComponentType<WeekdayThemeBannerLinkProps>;
73
+ className?: string;
74
+ };
75
+
76
+ export function WeekdayThemeBanner({
77
+ days,
78
+ activeDay,
79
+ kicker,
80
+ kickerIcon,
81
+ body,
82
+ weekLabel,
83
+ action,
84
+ actionNote,
85
+ dayHref,
86
+ onDayChange,
87
+ imageUrl,
88
+ linkComponent: LinkComponent = DefaultLink,
89
+ className,
90
+ }: WeekdayThemeBannerProps) {
91
+ const active = days[activeDay];
92
+ if (!active) return null;
93
+
94
+ return (
95
+ <div
96
+ className={cn(
97
+ "relative grid overflow-hidden rounded-[18px] bg-[linear-gradient(120deg,oklch(0.32_0.06_45),oklch(0.24_0.04_40))] text-white lg:grid-cols-[1fr_auto]",
98
+ className
99
+ )}
100
+ >
101
+ {imageUrl && (
102
+ <>
103
+ {/* eslint-disable-next-line @next/next/no-img-element */}
104
+ <img
105
+ src={imageUrl}
106
+ alt=""
107
+ aria-hidden
108
+ className="absolute inset-0 h-full w-full object-cover"
109
+ />
110
+ {/*
111
+ The scrim covers the WHOLE banner, not just the text side.
112
+ It used to fade to near-transparent on the right, which looked
113
+ better in isolation and made the week rail — seven lines of 12px
114
+ type — sit directly on whatever the plate happened to be. A photo
115
+ you can half-read under is worth less than seven labels you can
116
+ read. Still a gradient rather than a flat wash, so the image keeps
117
+ some depth on the right.
118
+ */}
119
+ <div
120
+ aria-hidden
121
+ className="absolute inset-0 bg-[linear-gradient(100deg,oklch(0.18_0.03_45_/_0.94)_0%,oklch(0.18_0.03_45_/_0.82)_45%,oklch(0.18_0.03_45_/_0.66)_100%)]"
122
+ />
123
+ </>
124
+ )}
125
+
126
+ {!imageUrl && (
127
+ <span
128
+ aria-hidden
129
+ className="pointer-events-none absolute bottom-0 right-[28%] select-none font-serif text-[140px] font-bold leading-none text-white/[0.06]"
130
+ >
131
+ {active.code}
132
+ </span>
133
+ )}
134
+
135
+ <div className="relative z-[1] flex flex-col gap-2.5 p-4 lg:gap-3 lg:p-6">
136
+ {kicker && (
137
+ <span className="inline-flex w-max items-center gap-1.5 rounded-full bg-white/15 px-2.5 py-1 text-[10.5px] font-bold tracking-[0.09em]">
138
+ {kickerIcon}
139
+ {kicker}
140
+ </span>
141
+ )}
142
+
143
+ <h3 className="font-serif text-[24px] font-semibold tracking-[-0.02em] lg:text-[36px]">
144
+ {active.name}
145
+ </h3>
146
+
147
+ {body && <p className="max-w-[520px] text-[13.5px] leading-[1.5] opacity-90">{body}</p>}
148
+
149
+ {(action || actionNote) && (
150
+ <div className="mt-1 flex flex-wrap items-center gap-3">
151
+ {action}
152
+ {actionNote && <span className="text-xs opacity-75">{actionNote}</span>}
153
+ </div>
154
+ )}
155
+ </div>
156
+
157
+ <div
158
+ className={cn(
159
+ "relative z-[1] hidden border-t border-white/15 p-4 lg:block lg:min-w-[240px] lg:border-l lg:border-t-0 lg:p-5",
160
+ // Over a photograph the rail needs its own ground, or seven lines of
161
+ // small type land on whatever the plate happens to be.
162
+ imageUrl && "bg-black/45 backdrop-blur-[2px]"
163
+ )}
164
+ >
165
+ {weekLabel && (
166
+ <div className="mb-2 text-[10px] font-bold tracking-[0.12em] opacity-70">
167
+ {weekLabel}
168
+ </div>
169
+ )}
170
+
171
+ <ul className="grid grid-cols-2 gap-x-4 sm:grid-cols-4 lg:grid-cols-1">
172
+ {days.map((day, index) => {
173
+ const isActive = index === activeDay;
174
+ const content = (
175
+ <>
176
+ <b className="w-8 shrink-0 font-mono text-[11px] font-medium opacity-70">
177
+ {day.code}
178
+ </b>
179
+ <span className="min-w-0 flex-1 truncate">{day.shortName ?? day.name}</span>
180
+ {day.count != null && (
181
+ <span className="shrink-0 tabular-nums opacity-70">{day.count}</span>
182
+ )}
183
+ </>
184
+ );
185
+
186
+ // Today is set BIGGER, not just bolder. Weight alone was doing all
187
+ // the work at 12.5px against six neighbours, which is not enough
188
+ // separation to answer "which one is today" at a glance — the
189
+ // question the rail exists to answer.
190
+ const rowClasses = cn(
191
+ "flex w-full items-center gap-2 rounded transition-opacity",
192
+ isActive
193
+ ? "-mx-1.5 bg-white/10 px-1.5 py-1.5 text-[14.5px] font-extrabold"
194
+ : "py-[5px] text-[12.5px] opacity-70 hover:opacity-100"
195
+ );
196
+
197
+ return (
198
+ <li key={day.code}>
199
+ {dayHref ? (
200
+ <LinkComponent
201
+ href={dayHref(day, index)}
202
+ className={cn(
203
+ rowClasses,
204
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/60"
205
+ )}
206
+ >
207
+ {content}
208
+ </LinkComponent>
209
+ ) : onDayChange ? (
210
+ <button
211
+ type="button"
212
+ aria-pressed={isActive}
213
+ onClick={() => onDayChange(index)}
214
+ className={cn(
215
+ rowClasses,
216
+ "text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/60"
217
+ )}
218
+ >
219
+ {content}
220
+ </button>
221
+ ) : (
222
+ <span className={rowClasses}>{content}</span>
223
+ )}
224
+ </li>
225
+ );
226
+ })}
227
+ </ul>
228
+ </div>
229
+ </div>
230
+ );
231
+ }
@@ -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';