@bearmenu/ui 0.8.23 → 0.8.25
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-5LTILG3L.js → chunk-5HHRVJOT.js} +14 -1
- package/dist/{chunk-SDWN6L4O.js → chunk-AHHDC7ML.js} +1 -1
- package/dist/{chunk-5XREWOBB.js → chunk-IEIJP73R.js} +14 -1
- package/dist/{chunk-BKKQ7GCZ.js → chunk-QG6I2ILT.js} +1 -1
- package/dist/{chunk-TIQNM4XD.js → chunk-VEGFQSZA.js} +17 -1
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert.d.ts +2 -2
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/booking-row.d.ts +60 -0
- package/dist/components/booking-row.js +103 -0
- package/dist/components/booking-summary-card.d.ts +38 -0
- package/dist/components/booking-summary-card.js +67 -0
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.d.ts +17 -3
- package/dist/components/calendar.js +100 -12
- package/dist/components/carousel.js +1 -1
- package/dist/components/coach-marks.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command.d.ts +7 -7
- package/dist/components/concept-convergence.js +2 -2
- package/dist/components/empty-state.js +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-list-row-wide.js +2 -2
- package/dist/components/event-list-row.js +1 -1
- package/dist/components/filter-category-row.js +1 -1
- package/dist/components/hold-countdown.d.ts +43 -0
- package/dist/components/hold-countdown.js +90 -0
- package/dist/components/kitchen-dossier.js +1 -1
- package/dist/components/link-button.js +1 -1
- package/dist/components/menu-family-block.js +1 -1
- package/dist/components/menu-index-list.js +1 -1
- package/dist/components/menu-item.js +3 -3
- package/dist/components/motion-icon-set.d.ts +2 -1
- package/dist/components/motion-icon-set.js +27 -1
- package/dist/components/multi-select-combobox.js +2 -2
- package/dist/components/pagination.js +1 -1
- package/dist/components/party-counter.d.ts +36 -0
- package/dist/components/party-counter.js +61 -0
- package/dist/components/place-card.js +2 -2
- package/dist/components/place-details-mobile.js +1 -1
- package/dist/components/searchable-select.js +1 -1
- package/dist/components/signature-chip.js +2 -2
- package/dist/components/sliding-panels.js +1 -1
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/tag.d.ts +2 -2
- package/dist/components/text.d.ts +3 -3
- package/dist/components/time-slot.d.ts +73 -0
- package/dist/components/time-slot.js +106 -0
- package/dist/components/toggle-group.js +15 -2
- package/dist/components/toggle.d.ts +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/components/top-ranking-entry.js +3 -3
- package/dist/components/weekday-chip.d.ts +33 -0
- package/dist/components/weekday-chip.js +48 -0
- package/package.json +1 -1
- package/src/components/badge.stories.tsx +17 -0
- package/src/components/badge.tsx +15 -0
- package/src/components/booking-primitives.test.tsx +180 -0
- package/src/components/booking-row.stories.tsx +66 -0
- package/src/components/booking-row.tsx +168 -0
- package/src/components/booking-summary-card.stories.tsx +41 -0
- package/src/components/booking-summary-card.tsx +109 -0
- package/src/components/button.stories.tsx +23 -0
- package/src/components/button.tsx +13 -0
- package/src/components/calendar.stories.tsx +27 -0
- package/src/components/calendar.tsx +110 -3
- package/src/components/hold-countdown.stories.tsx +68 -0
- package/src/components/hold-countdown.tsx +140 -0
- package/src/components/motion-icon-set.stories.tsx +2 -0
- package/src/components/motion-icon-set.tsx +42 -0
- package/src/components/party-counter.stories.tsx +57 -0
- package/src/components/party-counter.tsx +93 -0
- package/src/components/time-slot.stories.tsx +85 -0
- package/src/components/time-slot.tsx +186 -0
- package/src/components/toggle-group.stories.tsx +27 -0
- package/src/components/toggle-group.tsx +14 -1
- package/src/components/toggle.tsx +16 -0
- package/src/components/weekday-chip.stories.tsx +54 -0
- package/src/components/weekday-chip.tsx +75 -0
|
@@ -22,6 +22,22 @@ const toggleVariants = cva(
|
|
|
22
22
|
*/
|
|
23
23
|
segmented:
|
|
24
24
|
"h-10 w-11 rounded-full text-muted-foreground hover:bg-transparent hover:text-foreground data-[state=on]:bg-card data-[state=on]:text-foreground data-[state=on]:shadow-[var(--shadow-card)]",
|
|
25
|
+
/**
|
|
26
|
+
* A choice among a few named options that sit in a wrapping row —
|
|
27
|
+
* the booking flow's seating preference ("No preference", "Terrace",
|
|
28
|
+
* "By the window"). Off: a card pill with a hairline. On: the accent
|
|
29
|
+
* hairline over an 8% accent wash and accent type — a selection, not
|
|
30
|
+
* a button, so it never fills.
|
|
31
|
+
*/
|
|
32
|
+
chip: "h-auto min-w-0 rounded-full border border-border bg-card px-[13px] py-[7px] text-[12.5px] leading-[1.2] font-normal text-foreground hover:border-accent/40 hover:bg-card hover:text-foreground data-[state=on]:border-accent data-[state=on]:bg-accent/[0.08] data-[state=on]:font-semibold data-[state=on]:text-accent",
|
|
33
|
+
/**
|
|
34
|
+
* One tab of a two-or-three-way switch that shares the width — My
|
|
35
|
+
* bookings' Upcoming / Past. The group (`ToggleGroup variant="tab"`)
|
|
36
|
+
* supplies the muted capsule; the ON tab is a raised card. The type
|
|
37
|
+
* does not change colour between on and off — as drawn, the raised
|
|
38
|
+
* card alone says which tab is current.
|
|
39
|
+
*/
|
|
40
|
+
tab: "h-auto min-w-0 flex-1 rounded-full px-3 py-[7px] text-[12.5px] leading-[1.2] font-semibold text-ink-secondary hover:bg-transparent hover:text-foreground data-[state=on]:bg-card data-[state=on]:text-ink-secondary data-[state=on]:shadow-[0_1px_2px_oklch(0.5_0_0/0.12)] dark:data-[state=on]:bg-surface-2 dark:data-[state=on]:text-foreground",
|
|
25
41
|
},
|
|
26
42
|
size: {
|
|
27
43
|
default: "h-9 px-2 min-w-9",
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { WeekdayChip } from "./weekday-chip";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof WeekdayChip> = {
|
|
6
|
+
title: "Booking/WeekdayChip",
|
|
7
|
+
component: WeekdayChip,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component:
|
|
13
|
+
"One day in the booking flow's week rail on mobile. Weekday over date, sharing the rail's width equally. Not DayRailChip, which is the events timeline's day with a count.",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof WeekdayChip>;
|
|
21
|
+
|
|
22
|
+
export const Default: Story = { args: { weekday: "Mon", day: "10" } };
|
|
23
|
+
export const Selected: Story = { args: { weekday: "Fri", day: "14", selected: true } };
|
|
24
|
+
export const Unavailable: Story = { args: { weekday: "Tue", day: "11", unavailable: true } };
|
|
25
|
+
|
|
26
|
+
const WEEK = [
|
|
27
|
+
["Mon", "10"],
|
|
28
|
+
["Tue", "11"],
|
|
29
|
+
["Wed", "12"],
|
|
30
|
+
["Thu", "13"],
|
|
31
|
+
["Fri", "14"],
|
|
32
|
+
["Sat", "15"],
|
|
33
|
+
["Sun", "16"],
|
|
34
|
+
] as const;
|
|
35
|
+
|
|
36
|
+
/** B1 mobile: the week, Friday chosen. */
|
|
37
|
+
export const Week: Story = {
|
|
38
|
+
render: () => {
|
|
39
|
+
const [selected, setSelected] = React.useState("14");
|
|
40
|
+
return (
|
|
41
|
+
<div className="flex w-[335px] gap-1.5">
|
|
42
|
+
{WEEK.map(([weekday, day]) => (
|
|
43
|
+
<WeekdayChip
|
|
44
|
+
key={day}
|
|
45
|
+
weekday={weekday}
|
|
46
|
+
day={day}
|
|
47
|
+
selected={selected === day}
|
|
48
|
+
onSelect={() => setSelected(day)}
|
|
49
|
+
/>
|
|
50
|
+
))}
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
},
|
|
54
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WeekdayChip — one day in the booking flow's week rail on mobile
|
|
8
|
+
* ("MON 10 · TUE 11 · … · SUN 16" in "When are you coming?").
|
|
9
|
+
*
|
|
10
|
+
* Not `DayRailChip`: that one is the events timeline's day, with a single-line
|
|
11
|
+
* label and an event count. This one is a date picker's day — weekday stacked
|
|
12
|
+
* over the date, no count — and the rail shares the width equally.
|
|
13
|
+
*
|
|
14
|
+
* Measured from the booking design (`.dchip`): flexes to an equal share, 1px
|
|
15
|
+
* hairline, 11px radius, 7px vertical inset, centred. The weekday at 10px
|
|
16
|
+
* uppercase, 0.05em tracking, muted; the date at 15px bold, tabular, 2px
|
|
17
|
+
* below. Selected fills with `--gradient-primary`, white type, the weekday at
|
|
18
|
+
* 75%. A day that cannot be booked (closed, past the window) fades to 40% and
|
|
19
|
+
* is disabled.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
export type WeekdayChipProps = {
|
|
23
|
+
/** "Mon", "Tue" — already localised; rendered uppercase. */
|
|
24
|
+
weekday: string;
|
|
25
|
+
/** Day of month as displayed — "14". */
|
|
26
|
+
day: string;
|
|
27
|
+
selected?: boolean;
|
|
28
|
+
/** Closed that day or outside the booking window. */
|
|
29
|
+
unavailable?: boolean;
|
|
30
|
+
onSelect?: () => void;
|
|
31
|
+
/** The full date for assistive tech — "Friday 14 August". */
|
|
32
|
+
"aria-label"?: string;
|
|
33
|
+
className?: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export function WeekdayChip({
|
|
37
|
+
weekday,
|
|
38
|
+
day,
|
|
39
|
+
selected,
|
|
40
|
+
unavailable,
|
|
41
|
+
onSelect,
|
|
42
|
+
"aria-label": ariaLabel,
|
|
43
|
+
className,
|
|
44
|
+
}: WeekdayChipProps) {
|
|
45
|
+
return (
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
data-slot="weekday-chip"
|
|
49
|
+
aria-pressed={selected ? true : false}
|
|
50
|
+
aria-label={ariaLabel}
|
|
51
|
+
disabled={unavailable}
|
|
52
|
+
onClick={onSelect}
|
|
53
|
+
className={cn(
|
|
54
|
+
"min-w-0 flex-1 cursor-pointer rounded-[11px] border py-[7px] text-center leading-[1.2]",
|
|
55
|
+
"transition-[border-color,filter] duration-150 motion-reduce:transition-none",
|
|
56
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
57
|
+
selected
|
|
58
|
+
? "border-transparent bg-[image:var(--gradient-primary)] text-white"
|
|
59
|
+
: "border-border bg-card text-foreground hover:border-accent/50",
|
|
60
|
+
unavailable && "cursor-not-allowed opacity-40 hover:border-border",
|
|
61
|
+
className
|
|
62
|
+
)}
|
|
63
|
+
>
|
|
64
|
+
<span
|
|
65
|
+
className={cn(
|
|
66
|
+
"block text-[10px] tracking-[0.05em] uppercase",
|
|
67
|
+
selected ? "text-white/75" : "text-muted-foreground"
|
|
68
|
+
)}
|
|
69
|
+
>
|
|
70
|
+
{weekday}
|
|
71
|
+
</span>
|
|
72
|
+
<span className="mt-0.5 block text-[15px] font-bold tabular-nums">{day}</span>
|
|
73
|
+
</button>
|
|
74
|
+
);
|
|
75
|
+
}
|