@bearmenu/ui 0.8.24 → 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-I4RUOAU7.js → chunk-AHL45DD2.js} +11 -38
- 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/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/concept-convergence.js +2 -2
- package/dist/components/drift-rail.d.ts +2 -29
- package/dist/components/drift-rail.js +1 -3
- 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/poster-tape.d.ts +2 -15
- package/dist/components/poster-tape.js +3 -12
- 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/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/drift-rail.stories.tsx +1 -29
- package/src/components/drift-rail.tsx +4 -71
- 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/poster-tape.stories.tsx +0 -29
- package/src/components/poster-tape.tsx +5 -21
- 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
- package/src/components/drift-rail.test.tsx +0 -125
- package/src/components/poster-tape.test.tsx +0 -42
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { cn } from '../chunk-FEK5XGZW.js';
|
|
2
|
+
import '../chunk-MMUBH76A.js';
|
|
3
|
+
import { Minus, Plus } from 'lucide-react';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function PartyCounter({
|
|
7
|
+
value,
|
|
8
|
+
onValueChange,
|
|
9
|
+
min = 1,
|
|
10
|
+
max = 20,
|
|
11
|
+
labels,
|
|
12
|
+
disabled,
|
|
13
|
+
className
|
|
14
|
+
}) {
|
|
15
|
+
const atMin = value <= min;
|
|
16
|
+
const atMax = value >= max;
|
|
17
|
+
const roundButton = "grid size-9 shrink-0 cursor-pointer place-items-center rounded-full transition-[filter,background-color,opacity] duration-150 motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card disabled:cursor-not-allowed disabled:opacity-40 [&_svg]:size-4";
|
|
18
|
+
return /* @__PURE__ */ jsxs(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "party-counter",
|
|
22
|
+
className: cn(
|
|
23
|
+
"flex h-[52px] items-center justify-between gap-2.5 rounded-xl border border-border bg-card px-2",
|
|
24
|
+
className
|
|
25
|
+
),
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ jsx(
|
|
28
|
+
"button",
|
|
29
|
+
{
|
|
30
|
+
type: "button",
|
|
31
|
+
"aria-label": labels.decrease,
|
|
32
|
+
disabled: disabled || atMin,
|
|
33
|
+
onClick: () => onValueChange(Math.max(min, value - 1)),
|
|
34
|
+
className: cn(roundButton, "bg-surface-2 text-foreground hover:bg-muted"),
|
|
35
|
+
children: /* @__PURE__ */ jsx(Minus, { "aria-hidden": true })
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ jsxs("output", { "aria-live": "polite", className: "flex-1 text-center", children: [
|
|
39
|
+
/* @__PURE__ */ jsx("b", { className: "text-[19px] font-bold tabular-nums text-foreground", children: value }),
|
|
40
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1 text-xs text-muted-foreground", children: labels.unit(value) })
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
"button",
|
|
44
|
+
{
|
|
45
|
+
type: "button",
|
|
46
|
+
"aria-label": labels.increase,
|
|
47
|
+
disabled: disabled || atMax,
|
|
48
|
+
onClick: () => onValueChange(Math.min(max, value + 1)),
|
|
49
|
+
className: cn(
|
|
50
|
+
roundButton,
|
|
51
|
+
"bg-[image:var(--gradient-primary)] text-white hover:brightness-[0.94]"
|
|
52
|
+
),
|
|
53
|
+
children: /* @__PURE__ */ jsx(Plus, { "aria-hidden": true })
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { PartyCounter };
|
|
@@ -3,10 +3,10 @@ import { HOVER_IMAGE_MOTION, HOVER_IMAGE_WRAPPER, HOVER_MOTION, HOVER_LIFT_GRID_
|
|
|
3
3
|
import { NEUTRAL_ICON_FILTER } from '../chunk-LQWGZIYA.js';
|
|
4
4
|
import { GradeAtom } from '../chunk-YE4ZQUTI.js';
|
|
5
5
|
import { showsGradeAtom } from '../chunk-I5V446BX.js';
|
|
6
|
-
import { Separator } from '../chunk-NWZGSLPU.js';
|
|
7
6
|
import { springSnappy } from '../chunk-OIV7B44M.js';
|
|
7
|
+
import { Separator } from '../chunk-NWZGSLPU.js';
|
|
8
8
|
import { Skeleton } from '../chunk-XBBEX4SF.js';
|
|
9
|
-
import { Badge } from '../chunk-
|
|
9
|
+
import { Badge } from '../chunk-IEIJP73R.js';
|
|
10
10
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
11
11
|
import { __objRest, __spreadValues } from '../chunk-MMUBH76A.js';
|
|
12
12
|
import { forwardRef, memo, useState, useMemo } from 'react';
|
|
@@ -3,7 +3,7 @@ import '../chunk-FMTJGO76.js';
|
|
|
3
3
|
import '../chunk-MWB7S54O.js';
|
|
4
4
|
import '../chunk-NWZGSLPU.js';
|
|
5
5
|
import { Text } from '../chunk-ZLMRVBD7.js';
|
|
6
|
-
import { Badge } from '../chunk-
|
|
6
|
+
import { Badge } from '../chunk-IEIJP73R.js';
|
|
7
7
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
8
8
|
import '../chunk-MMUBH76A.js';
|
|
9
9
|
import { useState } from 'react';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { DriftRailLabels } from './drift-rail.js';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* PosterTape — the closing marquee: small 4:5 posters drifting past at a
|
|
@@ -13,18 +12,8 @@ import { DriftRailLabels } from './drift-rail.js';
|
|
|
13
12
|
type PosterTapeItem = {
|
|
14
13
|
id: string;
|
|
15
14
|
title: string;
|
|
16
|
-
/**
|
|
17
|
-
* Caller-composed, e.g. "Sat 5" — or "Sat 5 · 20:00" when `time` is not
|
|
18
|
-
* given. Rendered as mono, small, and truncated at the tape's width.
|
|
19
|
-
*/
|
|
15
|
+
/** Caller-composed, e.g. "Sat 5 · 20:00". Rendered as mono, small. */
|
|
20
16
|
meta: string;
|
|
21
|
-
/**
|
|
22
|
-
* The time, e.g. "20:00", rendered after `meta` and never truncated. The
|
|
23
|
-
* tape is 132px wide and a long localised date ("sâm., 5 sept. · 17:00")
|
|
24
|
-
* used to clip to "17:…" — the one figure the reader came for. Split it out
|
|
25
|
-
* and the date is what gives way.
|
|
26
|
-
*/
|
|
27
|
-
time?: string;
|
|
28
17
|
posterUrl?: string;
|
|
29
18
|
href?: string;
|
|
30
19
|
/** Rendered instead of the poster when it's absent or failed to load. Defaults to `<EventPosterFallback />`. */
|
|
@@ -40,10 +29,8 @@ type PosterTapeProps = {
|
|
|
40
29
|
/** Defaults to a plain `<a>`. Pass `next/link` in a Next app. */
|
|
41
30
|
linkComponent?: React.ComponentType<PosterTapeLinkProps>;
|
|
42
31
|
durationSeconds?: number;
|
|
43
|
-
/** Forwarded to `<DriftRail>`: names for its pause/play toggle, which renders only when given. */
|
|
44
|
-
labels?: DriftRailLabels;
|
|
45
32
|
className?: string;
|
|
46
33
|
};
|
|
47
|
-
declare function PosterTape({ items, linkComponent: LinkComponent, durationSeconds,
|
|
34
|
+
declare function PosterTape({ items, linkComponent: LinkComponent, durationSeconds, className, }: PosterTapeProps): react_jsx_runtime.JSX.Element;
|
|
48
35
|
|
|
49
36
|
export { PosterTape, type PosterTapeItem, type PosterTapeLinkProps, type PosterTapeProps };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { DriftRail } from '../chunk-
|
|
2
|
-
import '../chunk-4OF4T4AI.js';
|
|
3
|
-
import '../chunk-L3VEMP5A.js';
|
|
1
|
+
import { DriftRail } from '../chunk-AHL45DD2.js';
|
|
4
2
|
import { EventPosterFallback } from '../chunk-FDITZ2VM.js';
|
|
5
3
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
6
4
|
import { __objRest, __spreadValues } from '../chunk-MMUBH76A.js';
|
|
@@ -36,13 +34,7 @@ function PosterTapeItemCard({
|
|
|
36
34
|
)
|
|
37
35
|
) : (_a = item.fallback) != null ? _a : /* @__PURE__ */ jsx(EventPosterFallback, {}) }),
|
|
38
36
|
/* @__PURE__ */ jsx("div", { className: "mt-1.5 text-[11px] font-semibold leading-[1.3] sm:mt-[7px] sm:text-[11.5px]", children: item.title }),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: item.meta }),
|
|
41
|
-
item.time && /* @__PURE__ */ jsxs("span", { className: "shrink-0", children: [
|
|
42
|
-
"\xB7 ",
|
|
43
|
-
item.time
|
|
44
|
-
] })
|
|
45
|
-
] })
|
|
37
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 truncate font-mono text-[10px] text-muted-foreground sm:text-[10.5px]", children: item.meta })
|
|
46
38
|
] });
|
|
47
39
|
const itemClasses = "block w-[132px] shrink-0";
|
|
48
40
|
if (item.href) {
|
|
@@ -64,10 +56,9 @@ function PosterTape({
|
|
|
64
56
|
items,
|
|
65
57
|
linkComponent: LinkComponent = DefaultLink,
|
|
66
58
|
durationSeconds = POSTER_TAPE_DEFAULT_DURATION_SECONDS,
|
|
67
|
-
labels,
|
|
68
59
|
className
|
|
69
60
|
}) {
|
|
70
|
-
return /* @__PURE__ */ jsx(DriftRail, { durationSeconds,
|
|
61
|
+
return /* @__PURE__ */ jsx(DriftRail, { durationSeconds, className, children: items.map((item) => /* @__PURE__ */ jsx(PosterTapeItemCard, { item, LinkComponent }, item.id)) });
|
|
71
62
|
}
|
|
72
63
|
|
|
73
64
|
export { PosterTape };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Popover, PopoverTrigger, PopoverContent } from '../chunk-2ADCZXZJ.js';
|
|
2
2
|
import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from '../chunk-MCOHLWRS.js';
|
|
3
3
|
import '../chunk-PDTPO6NG.js';
|
|
4
|
-
import { Button } from '../chunk-
|
|
4
|
+
import { Button } from '../chunk-5HHRVJOT.js';
|
|
5
5
|
import '../chunk-RIH2IS7X.js';
|
|
6
6
|
import '../chunk-5YNIQ2BL.js';
|
|
7
7
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* TimeSlot and TimeSlotGroups — the bookable times in the booking flow's
|
|
6
|
+
* "When are you coming?" screen, the reserve panel on the venue page, and
|
|
7
|
+
* "Change party size".
|
|
8
|
+
*
|
|
9
|
+
* Measured from the booking design (`.tsl`, `.tgrid`, `.grouplbl`):
|
|
10
|
+
* - A slot is a card with a 1px hairline, 11px radius, 8px × 4px inset,
|
|
11
|
+
* centred. The time in mono at 14.5px bold, line-height 1. An optional
|
|
12
|
+
* meta line under it at 9.5px, 3px apart — "Popular", "2 left" in accent,
|
|
13
|
+
* "Waitlist" muted.
|
|
14
|
+
* - Selected fills with `--gradient-primary`, white type, the meta at 80%.
|
|
15
|
+
* - Unavailable fades to 32% with the time struck through.
|
|
16
|
+
* - Groups are "Early / Evening / Late": a mono 10px small-caps label
|
|
17
|
+
* (0.08em tracking, 14px above, 7px below) over a three-column grid with
|
|
18
|
+
* 7px gaps.
|
|
19
|
+
*
|
|
20
|
+
* A slot is a button with `aria-pressed`: one of many times, picked once.
|
|
21
|
+
*/
|
|
22
|
+
type TimeSlotTone = "default" | "waitlist";
|
|
23
|
+
type TimeSlotProps = {
|
|
24
|
+
/** The time as displayed, already formatted in the venue's timezone — "19:30". */
|
|
25
|
+
time: string;
|
|
26
|
+
/** "Popular", "2 left", "Waitlist" — already localised. */
|
|
27
|
+
meta?: string;
|
|
28
|
+
/** `waitlist` renders the meta muted: the slot books onto the list, not a table. */
|
|
29
|
+
tone?: TimeSlotTone;
|
|
30
|
+
selected?: boolean;
|
|
31
|
+
/** Taken or past: faded and struck through, not clickable. */
|
|
32
|
+
unavailable?: boolean;
|
|
33
|
+
onSelect?: () => void;
|
|
34
|
+
/** Full accessible name, when the visible text is not enough ("19:30, popular"). */
|
|
35
|
+
"aria-label"?: string;
|
|
36
|
+
className?: string;
|
|
37
|
+
};
|
|
38
|
+
declare function TimeSlot({ time, meta, tone, selected, unavailable, onSelect, "aria-label": ariaLabel, className, }: TimeSlotProps): react_jsx_runtime.JSX.Element;
|
|
39
|
+
type TimeSlotGroup = {
|
|
40
|
+
/** Stable key — "early", "evening", "late". */
|
|
41
|
+
key: string;
|
|
42
|
+
/** "Early", "Evening", "Late" — already localised; rendered small-caps. */
|
|
43
|
+
label: string;
|
|
44
|
+
slots: (TimeSlotProps & {
|
|
45
|
+
key: string;
|
|
46
|
+
})[];
|
|
47
|
+
};
|
|
48
|
+
type TimeSlotGroupsProps = {
|
|
49
|
+
groups: TimeSlotGroup[];
|
|
50
|
+
/** Columns in each group's grid. The design uses 3 everywhere; 2 only in very narrow panels. */
|
|
51
|
+
columns?: 2 | 3;
|
|
52
|
+
className?: string;
|
|
53
|
+
};
|
|
54
|
+
declare function TimeSlotGroupLabel({ children, className, }: {
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
className?: string;
|
|
57
|
+
}): react_jsx_runtime.JSX.Element;
|
|
58
|
+
declare function TimeSlotGroups({ groups, columns, className }: TimeSlotGroupsProps): react_jsx_runtime.JSX.Element;
|
|
59
|
+
type TimeSlotGroupsSkeletonProps = {
|
|
60
|
+
/** The label above the grid while times load — "Checking availability for 4…". */
|
|
61
|
+
label: string;
|
|
62
|
+
rows?: number;
|
|
63
|
+
columns?: 2 | 3;
|
|
64
|
+
className?: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The grid while times load (S1). Same cells, same gaps, so nothing jumps when
|
|
68
|
+
* the real times land: a slot's footprint with a dashed hairline at 60%, a
|
|
69
|
+
* soft bar in place of the time. The label says what is being checked.
|
|
70
|
+
*/
|
|
71
|
+
declare function TimeSlotGroupsSkeleton({ label, rows, columns, className, }: TimeSlotGroupsSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
|
|
73
|
+
export { TimeSlot, type TimeSlotGroup, TimeSlotGroupLabel, TimeSlotGroups, type TimeSlotGroupsProps, TimeSlotGroupsSkeleton, type TimeSlotGroupsSkeletonProps, type TimeSlotProps, type TimeSlotTone };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Skeleton } from '../chunk-XBBEX4SF.js';
|
|
2
|
+
import { cn } from '../chunk-FEK5XGZW.js';
|
|
3
|
+
import { __objRest, __spreadValues } from '../chunk-MMUBH76A.js';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function TimeSlot({
|
|
7
|
+
time,
|
|
8
|
+
meta,
|
|
9
|
+
tone = "default",
|
|
10
|
+
selected,
|
|
11
|
+
unavailable,
|
|
12
|
+
onSelect,
|
|
13
|
+
"aria-label": ariaLabel,
|
|
14
|
+
className
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsxs(
|
|
17
|
+
"button",
|
|
18
|
+
{
|
|
19
|
+
type: "button",
|
|
20
|
+
"data-slot": "time-slot",
|
|
21
|
+
"aria-pressed": selected ? true : false,
|
|
22
|
+
"aria-label": ariaLabel,
|
|
23
|
+
disabled: unavailable,
|
|
24
|
+
onClick: onSelect,
|
|
25
|
+
className: cn(
|
|
26
|
+
// Content sits at the top: a slot without a meta line in a row with
|
|
27
|
+
// one is stretched by the grid, and the time must not drop to the middle.
|
|
28
|
+
"flex w-full cursor-pointer flex-col items-center justify-start rounded-[11px] border px-1 py-2 text-center leading-[1.2]",
|
|
29
|
+
"transition-[border-color,filter] duration-150 motion-reduce:transition-none",
|
|
30
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
31
|
+
selected ? "border-transparent bg-[image:var(--gradient-primary)] text-white hover:brightness-[0.94]" : "border-border bg-card text-foreground hover:border-accent/50",
|
|
32
|
+
unavailable && "cursor-not-allowed opacity-[0.32] hover:border-border"
|
|
33
|
+
),
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
"b",
|
|
37
|
+
{
|
|
38
|
+
className: cn(
|
|
39
|
+
"block font-mono text-[14.5px] leading-none font-bold tabular-nums",
|
|
40
|
+
unavailable && "line-through"
|
|
41
|
+
),
|
|
42
|
+
children: time
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
meta && /* @__PURE__ */ jsx(
|
|
46
|
+
"span",
|
|
47
|
+
{
|
|
48
|
+
className: cn(
|
|
49
|
+
"mt-[3px] block text-[9.5px] leading-[1.2]",
|
|
50
|
+
selected ? "text-white/80" : tone === "waitlist" ? "text-muted-foreground" : "text-accent"
|
|
51
|
+
),
|
|
52
|
+
children: meta
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
var GRID_COLUMNS = { 2: "grid-cols-2", 3: "grid-cols-3" };
|
|
60
|
+
function TimeSlotGroupLabel({
|
|
61
|
+
children,
|
|
62
|
+
className
|
|
63
|
+
}) {
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: cn(
|
|
68
|
+
"mb-[7px] font-mono text-[10px] leading-none font-semibold tracking-[0.08em] text-muted-foreground uppercase",
|
|
69
|
+
className
|
|
70
|
+
),
|
|
71
|
+
children
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function TimeSlotGroups({ groups, columns = 3, className }) {
|
|
76
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "time-slot-groups", className, children: groups.map((group) => (
|
|
77
|
+
// 14px between groups; the first sits flush with whatever is above.
|
|
78
|
+
/* @__PURE__ */ jsxs("section", { "aria-label": group.label, className: "[&+&]:mt-3.5", children: [
|
|
79
|
+
/* @__PURE__ */ jsx(TimeSlotGroupLabel, { children: group.label }),
|
|
80
|
+
/* @__PURE__ */ jsx("div", { className: cn("grid gap-[7px]", GRID_COLUMNS[columns]), children: group.slots.map((_a) => {
|
|
81
|
+
var _b = _a, { key } = _b, slot = __objRest(_b, ["key"]);
|
|
82
|
+
return /* @__PURE__ */ jsx(TimeSlot, __spreadValues({}, slot), key);
|
|
83
|
+
}) })
|
|
84
|
+
] }, group.key)
|
|
85
|
+
)) });
|
|
86
|
+
}
|
|
87
|
+
function TimeSlotGroupsSkeleton({
|
|
88
|
+
label,
|
|
89
|
+
rows = 3,
|
|
90
|
+
columns = 3,
|
|
91
|
+
className
|
|
92
|
+
}) {
|
|
93
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "time-slot-groups-skeleton", role: "status", "aria-live": "polite", className, children: [
|
|
94
|
+
/* @__PURE__ */ jsx(TimeSlotGroupLabel, { children: label }),
|
|
95
|
+
/* @__PURE__ */ jsx("div", { className: cn("grid gap-[7px]", GRID_COLUMNS[columns]), "aria-hidden": true, children: Array.from({ length: rows * columns }, (_, index) => /* @__PURE__ */ jsx(
|
|
96
|
+
"span",
|
|
97
|
+
{
|
|
98
|
+
className: "block rounded-[11px] border border-dashed border-border bg-card px-1 py-2 opacity-60 dark:opacity-100",
|
|
99
|
+
children: /* @__PURE__ */ jsx(Skeleton, { className: "mx-auto h-[17px] w-[90%] rounded-md" })
|
|
100
|
+
},
|
|
101
|
+
index
|
|
102
|
+
)) })
|
|
103
|
+
] });
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { TimeSlot, TimeSlotGroupLabel, TimeSlotGroups, TimeSlotGroupsSkeleton };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toggleVariants } from '../chunk-
|
|
1
|
+
import { toggleVariants } from '../chunk-VEGFQSZA.js';
|
|
2
2
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
3
3
|
import { __objRest, __spreadProps, __spreadValues } from '../chunk-MMUBH76A.js';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -32,6 +32,12 @@ function ToggleGroup(_a) {
|
|
|
32
32
|
// The segmented control's capsule: muted ground, the on cell a raised
|
|
33
33
|
// card inside it (see `toggleVariants.segmented`). 44px tall.
|
|
34
34
|
"data-[variant=segmented]:gap-0.5 data-[variant=segmented]:rounded-full data-[variant=segmented]:bg-muted data-[variant=segmented]:p-0.5",
|
|
35
|
+
// Chips wrap onto as many rows as they need, 7px apart.
|
|
36
|
+
"data-[variant=chip]:flex-wrap data-[variant=chip]:gap-[7px] data-[variant=chip]:rounded-none",
|
|
37
|
+
// The tab bar spans its container: a muted capsule, 4px inset.
|
|
38
|
+
// Dark swaps the steps: the track takes the card, the ON tab the
|
|
39
|
+
// lighter `surface-2`, so the tab still reads as raised.
|
|
40
|
+
"data-[variant=tab]:w-full data-[variant=tab]:gap-1 data-[variant=tab]:rounded-full data-[variant=tab]:bg-surface-2 data-[variant=tab]:p-1 dark:data-[variant=tab]:bg-card",
|
|
35
41
|
className
|
|
36
42
|
)
|
|
37
43
|
}, props), {
|
|
@@ -65,7 +71,14 @@ function ToggleGroupItem(_a) {
|
|
|
65
71
|
size: context.size || size
|
|
66
72
|
}),
|
|
67
73
|
"min-w-0 flex-1 shrink-0 shadow-none focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",
|
|
68
|
-
resolved === "segmented" ? "rounded-full px-0 data-[state=on]:shadow-[var(--shadow-card)]" :
|
|
74
|
+
resolved === "segmented" ? "rounded-full px-0 data-[state=on]:shadow-[var(--shadow-card)]" : (
|
|
75
|
+
// Tabs and chips size to their type: the size variant's fixed
|
|
76
|
+
// height and min-width would otherwise win the merge.
|
|
77
|
+
resolved === "tab" ? "h-auto min-w-0 rounded-full px-3" : resolved === "chip" ? (
|
|
78
|
+
// A chip keeps its own width, so the row can wrap.
|
|
79
|
+
"h-auto min-w-0 flex-none rounded-full px-[13px]"
|
|
80
|
+
) : "rounded-none first:rounded-l-md last:rounded-r-md"
|
|
81
|
+
),
|
|
69
82
|
className
|
|
70
83
|
)
|
|
71
84
|
}, props), {
|
|
@@ -5,7 +5,7 @@ import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
6
6
|
|
|
7
7
|
declare const toggleVariants: (props?: ({
|
|
8
|
-
variant?: "default" | "outline" | "segmented" | null | undefined;
|
|
8
|
+
variant?: "tab" | "default" | "outline" | "chip" | "segmented" | null | undefined;
|
|
9
9
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
11
|
declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { MenuItem } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { MenuItem } from '../chunk-AHHDC7ML.js';
|
|
2
|
+
import '../chunk-QG6I2ILT.js';
|
|
3
3
|
import { Separator } from '../chunk-NWZGSLPU.js';
|
|
4
4
|
import { Skeleton } from '../chunk-XBBEX4SF.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-IEIJP73R.js';
|
|
6
6
|
import { cn } from '../chunk-FEK5XGZW.js';
|
|
7
7
|
import { __objRest, __spreadValues } from '../chunk-MMUBH76A.js';
|
|
8
8
|
import { MapPin, Star, MessageSquareQuote } from 'lucide-react';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WeekdayChip — one day in the booking flow's week rail on mobile
|
|
5
|
+
* ("MON 10 · TUE 11 · … · SUN 16" in "When are you coming?").
|
|
6
|
+
*
|
|
7
|
+
* Not `DayRailChip`: that one is the events timeline's day, with a single-line
|
|
8
|
+
* label and an event count. This one is a date picker's day — weekday stacked
|
|
9
|
+
* over the date, no count — and the rail shares the width equally.
|
|
10
|
+
*
|
|
11
|
+
* Measured from the booking design (`.dchip`): flexes to an equal share, 1px
|
|
12
|
+
* hairline, 11px radius, 7px vertical inset, centred. The weekday at 10px
|
|
13
|
+
* uppercase, 0.05em tracking, muted; the date at 15px bold, tabular, 2px
|
|
14
|
+
* below. Selected fills with `--gradient-primary`, white type, the weekday at
|
|
15
|
+
* 75%. A day that cannot be booked (closed, past the window) fades to 40% and
|
|
16
|
+
* is disabled.
|
|
17
|
+
*/
|
|
18
|
+
type WeekdayChipProps = {
|
|
19
|
+
/** "Mon", "Tue" — already localised; rendered uppercase. */
|
|
20
|
+
weekday: string;
|
|
21
|
+
/** Day of month as displayed — "14". */
|
|
22
|
+
day: string;
|
|
23
|
+
selected?: boolean;
|
|
24
|
+
/** Closed that day or outside the booking window. */
|
|
25
|
+
unavailable?: boolean;
|
|
26
|
+
onSelect?: () => void;
|
|
27
|
+
/** The full date for assistive tech — "Friday 14 August". */
|
|
28
|
+
"aria-label"?: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
};
|
|
31
|
+
declare function WeekdayChip({ weekday, day, selected, unavailable, onSelect, "aria-label": ariaLabel, className, }: WeekdayChipProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
|
|
33
|
+
export { WeekdayChip, type WeekdayChipProps };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cn } from '../chunk-FEK5XGZW.js';
|
|
2
|
+
import '../chunk-MMUBH76A.js';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function WeekdayChip({
|
|
6
|
+
weekday,
|
|
7
|
+
day,
|
|
8
|
+
selected,
|
|
9
|
+
unavailable,
|
|
10
|
+
onSelect,
|
|
11
|
+
"aria-label": ariaLabel,
|
|
12
|
+
className
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsxs(
|
|
15
|
+
"button",
|
|
16
|
+
{
|
|
17
|
+
type: "button",
|
|
18
|
+
"data-slot": "weekday-chip",
|
|
19
|
+
"aria-pressed": selected ? true : false,
|
|
20
|
+
"aria-label": ariaLabel,
|
|
21
|
+
disabled: unavailable,
|
|
22
|
+
onClick: onSelect,
|
|
23
|
+
className: cn(
|
|
24
|
+
"min-w-0 flex-1 cursor-pointer rounded-[11px] border py-[7px] text-center leading-[1.2]",
|
|
25
|
+
"transition-[border-color,filter] duration-150 motion-reduce:transition-none",
|
|
26
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
27
|
+
selected ? "border-transparent bg-[image:var(--gradient-primary)] text-white" : "border-border bg-card text-foreground hover:border-accent/50",
|
|
28
|
+
unavailable && "cursor-not-allowed opacity-40 hover:border-border",
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
"span",
|
|
34
|
+
{
|
|
35
|
+
className: cn(
|
|
36
|
+
"block text-[10px] tracking-[0.05em] uppercase",
|
|
37
|
+
selected ? "text-white/75" : "text-muted-foreground"
|
|
38
|
+
),
|
|
39
|
+
children: weekday
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ jsx("span", { className: "mt-0.5 block text-[15px] font-bold tabular-nums", children: day })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { WeekdayChip };
|
package/package.json
CHANGED
|
@@ -68,6 +68,23 @@ export const OnPrimary: Story = {
|
|
|
68
68
|
),
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
+
/** A booking's status and its code, as in My bookings (B6). */
|
|
72
|
+
export const BookingStatus: Story = {
|
|
73
|
+
render: () => (
|
|
74
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
75
|
+
<Badge as="span" variant="confirmed">
|
|
76
|
+
Confirmed
|
|
77
|
+
</Badge>
|
|
78
|
+
<Badge as="span" variant="pending">
|
|
79
|
+
Pending
|
|
80
|
+
</Badge>
|
|
81
|
+
<Badge as="span" variant="code">
|
|
82
|
+
BM-8421
|
|
83
|
+
</Badge>
|
|
84
|
+
</div>
|
|
85
|
+
),
|
|
86
|
+
};
|
|
87
|
+
|
|
71
88
|
export const AllVariants: Story = {
|
|
72
89
|
render: () => (
|
|
73
90
|
<div className="flex flex-wrap items-center gap-3">
|
package/src/components/badge.tsx
CHANGED
|
@@ -23,6 +23,21 @@ const badgeVariants = cva(
|
|
|
23
23
|
brown: "border-transparent bg-brown text-brown-foreground",
|
|
24
24
|
/** A count sitting INSIDE a primary-filled control: its own ink, lifted a notch. */
|
|
25
25
|
onPrimary: "border-transparent bg-primary-foreground/20 text-primary-foreground",
|
|
26
|
+
/**
|
|
27
|
+
* Status pills of a booking — "Confirmed", "Pending" — and its code
|
|
28
|
+
* chip ("BM-8421"). A full pill at 10.5px bold, as the booking design
|
|
29
|
+
* draws them. The status type is darker than the solid tokens: `success`
|
|
30
|
+
* and `warning` sit at 0.48 / 0.72 lightness, which on their own 15–20%
|
|
31
|
+
* wash fall short of AA at this size, so light mode uses the design's
|
|
32
|
+
* 0.38 / 0.42 inks and dark mode the lifted tokens.
|
|
33
|
+
*/
|
|
34
|
+
// `border-0`: the base's transparent hairline would add 2px to each
|
|
35
|
+
// side the design does not have.
|
|
36
|
+
confirmed:
|
|
37
|
+
"rounded-full border-0 bg-success/15 px-[9px] py-[3px] text-[10.5px] leading-[1.2] font-bold text-[oklch(0.38_0.1_155)] dark:text-success",
|
|
38
|
+
pending:
|
|
39
|
+
"rounded-full border-0 bg-warning/20 px-[9px] py-[3px] text-[10.5px] leading-[1.2] font-bold text-[oklch(0.42_0.1_70)] dark:text-warning",
|
|
40
|
+
code: "rounded-full border-0 bg-surface-2 px-[9px] py-[3px] font-mono text-[10.5px] leading-[1.2] font-bold tabular-nums text-ink-secondary",
|
|
26
41
|
},
|
|
27
42
|
// v1.0 motion: "live" surface signal — applies `live-pulse` archetype.
|
|
28
43
|
// Pair with a colored variant (e.g. variant="destructive" live).
|