@bearmenu/ui 0.8.40 → 0.8.42
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-TB2K5JN3.js → chunk-BFS4M7KD.js} +26 -9
- package/dist/{chunk-KGXTBTCJ.js → chunk-CLFE4U5T.js} +1 -1
- package/dist/{chunk-NF5UMLSL.js → chunk-FVFAOW36.js} +46 -40
- package/dist/{chunk-5SGKGFMN.js → chunk-K6ACNU2L.js} +6 -1
- package/dist/{chunk-ZUBBMLBD.js → chunk-RQPUBKFU.js} +1 -1
- package/dist/{chunk-FQAIYKAS.js → chunk-WHUG6QEI.js} +8 -2
- 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.js +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +1 -1
- 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 +3 -3
- package/dist/components/concept-convergence.js +1 -1
- package/dist/components/drawer.d.ts +9 -0
- package/dist/components/drawer.js +1 -1
- package/dist/components/empty-state.js +4 -2
- package/dist/components/event-detail-panel.js +1 -1
- package/dist/components/event-list-row-wide.js +1 -1
- package/dist/components/filter-category-row.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/multi-select-combobox.js +2 -2
- package/dist/components/pagination.js +1 -1
- package/dist/components/pan-zoom-viewport.js +1 -1
- package/dist/components/place-card.js +1 -1
- package/dist/components/place-details-mobile.js +1 -1
- package/dist/components/responsive-overlay.d.ts +18 -0
- package/dist/components/responsive-overlay.js +55 -30
- 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 +2 -2
- package/dist/components/toggle-group.js +9 -5
- package/dist/components/toggle.d.ts +11 -2
- package/dist/components/toggle.js +1 -1
- package/dist/components/top-ranking-entry.js +3 -3
- package/package.json +1 -1
- package/src/components/badge.stories.tsx +22 -1
- package/src/components/badge.test.tsx +37 -0
- package/src/components/badge.tsx +8 -2
- package/src/components/button.test.tsx +10 -0
- package/src/components/button.tsx +6 -1
- package/src/components/drawer.stories.tsx +25 -0
- package/src/components/drawer.test.tsx +50 -0
- package/src/components/drawer.tsx +70 -47
- package/src/components/empty-state.test.tsx +8 -0
- package/src/components/empty-state.tsx +3 -1
- package/src/components/responsive-overlay.stories.tsx +3 -0
- package/src/components/responsive-overlay.test.tsx +93 -0
- package/src/components/responsive-overlay.tsx +52 -3
- package/src/components/toggle-group.stories.tsx +17 -0
- package/src/components/toggle-group.test.tsx +65 -0
- package/src/components/toggle-group.tsx +13 -5
- package/src/components/toggle.test.tsx +50 -1
- package/src/components/toggle.tsx +35 -4
- package/src/globals.css +7 -1
|
@@ -22,12 +22,18 @@ const toggleVariants = cva(
|
|
|
22
22
|
"border border-border bg-transparent hover:bg-accent-subtle hover:text-foreground data-[state=on]:border-primary",
|
|
23
23
|
/**
|
|
24
24
|
* One cell of a segmented control: a raised card on the group's
|
|
25
|
-
* muted capsule when on, quiet type when off.
|
|
25
|
+
* muted capsule when on, quiet type when off. This class owns only
|
|
26
|
+
* the cell's layout and text colour — the button itself is the full
|
|
27
|
+
* 44px hit target the accessibility floor asks for. The raised card
|
|
28
|
+
* it draws is smaller (36px, measured off the booking frames'
|
|
29
|
+
* calendar toolbar and the closures scope control), so
|
|
30
|
+
* `SegmentedToggleContent` below carries the paint in an inner span,
|
|
31
|
+
* the same split `MenuPickRow` uses for its add disc. The group
|
|
26
32
|
* (`ToggleGroup variant="segmented"`) supplies the capsule; the cell
|
|
27
33
|
* never fills with the accent, which would read as a primary button.
|
|
28
34
|
*/
|
|
29
35
|
segmented:
|
|
30
|
-
"
|
|
36
|
+
"group/segment relative rounded-full text-muted-foreground hover:bg-transparent hover:text-foreground data-[state=on]:bg-transparent data-[state=on]:text-foreground",
|
|
31
37
|
/**
|
|
32
38
|
* A choice among a few named options that sit in a wrapping row —
|
|
33
39
|
* the booking flow's seating preference ("No preference", "Terrace",
|
|
@@ -58,6 +64,10 @@ const toggleVariants = cva(
|
|
|
58
64
|
compoundVariants: [
|
|
59
65
|
{ variant: "chip", class: "h-auto min-w-0 px-[13px]" },
|
|
60
66
|
{ variant: "tab", class: "h-auto min-w-0 px-3" },
|
|
67
|
+
// The segmented cell's hit target is fixed at the 44px floor
|
|
68
|
+
// regardless of `size` — restated here for the same reason as chip and
|
|
69
|
+
// tab above, so the size variants' `h-*` never wins the merge.
|
|
70
|
+
{ variant: "segmented", class: "h-11 px-0" },
|
|
61
71
|
],
|
|
62
72
|
defaultVariants: {
|
|
63
73
|
variant: "default",
|
|
@@ -66,10 +76,25 @@ const toggleVariants = cva(
|
|
|
66
76
|
}
|
|
67
77
|
);
|
|
68
78
|
|
|
79
|
+
/**
|
|
80
|
+
* The segmented variant's drawn pill — 36px tall, centred in the cell's 44px
|
|
81
|
+
* hit box. Painted here, on `group-data-[state=on]/segment:`, so the outer
|
|
82
|
+
* button (`toggleVariants({variant: "segmented"})`) can stay unpainted and
|
|
83
|
+
* full height. Shared by `Toggle` and `ToggleGroupItem`.
|
|
84
|
+
*/
|
|
85
|
+
function SegmentedToggleContent({ children }: { children?: React.ReactNode }) {
|
|
86
|
+
return (
|
|
87
|
+
<span className="flex h-9 w-full items-center justify-center gap-2 rounded-full text-inherit transition-[background-color,box-shadow] group-data-[state=on]/segment:bg-card group-data-[state=on]/segment:shadow-[var(--shadow-card)]">
|
|
88
|
+
{children}
|
|
89
|
+
</span>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
69
93
|
function Toggle({
|
|
70
94
|
className,
|
|
71
95
|
variant,
|
|
72
96
|
size,
|
|
97
|
+
children,
|
|
73
98
|
...props
|
|
74
99
|
}: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) {
|
|
75
100
|
return (
|
|
@@ -77,8 +102,14 @@ function Toggle({
|
|
|
77
102
|
data-slot="toggle"
|
|
78
103
|
className={cn(toggleVariants({ variant, size, className }))}
|
|
79
104
|
{...props}
|
|
80
|
-
|
|
105
|
+
>
|
|
106
|
+
{variant === "segmented" ? (
|
|
107
|
+
<SegmentedToggleContent>{children}</SegmentedToggleContent>
|
|
108
|
+
) : (
|
|
109
|
+
children
|
|
110
|
+
)}
|
|
111
|
+
</TogglePrimitive.Root>
|
|
81
112
|
);
|
|
82
113
|
}
|
|
83
114
|
|
|
84
|
-
export { Toggle, toggleVariants };
|
|
115
|
+
export { Toggle, toggleVariants, SegmentedToggleContent };
|
package/src/globals.css
CHANGED
|
@@ -364,7 +364,13 @@ h6 {
|
|
|
364
364
|
--floor-error: oklch(0.56 0.2 27);
|
|
365
365
|
--floor-error-foreground: oklch(0.99 0 0);
|
|
366
366
|
--floor-offer: var(--primary);
|
|
367
|
-
|
|
367
|
+
/* L raised from 0.25 (== --primary, the offer ring's colour) to 0.35: the
|
|
368
|
+
dark hairline read as a heavy black frame around a selected table. Same
|
|
369
|
+
chroma/hue, so it stays legibly the same family, just lighter — still
|
|
370
|
+
11.2:1 on --floor-room and 11.5:1 on --card (floor 3:1), and a clear
|
|
371
|
+
lightness step (ΔL 0.10) from --floor-offer/--primary at this hue so the
|
|
372
|
+
two rings stay distinct. */
|
|
373
|
+
--floor-selected: oklch(0.35 0.05 35);
|
|
368
374
|
--floor-room: oklch(0.99 0.005 75);
|
|
369
375
|
--floor-wall: oklch(0.33 0.02 45);
|
|
370
376
|
--floor-fixture: oklch(0.62 0.018 50);
|