@bearmenu/ui 0.8.35 → 0.8.37

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 (76) hide show
  1. package/dist/chunk-EGU6EG73.js +39 -0
  2. package/dist/{chunk-NIAL4ZU2.js → chunk-FQAIYKAS.js} +45 -8
  3. package/dist/{chunk-TVEIUTBQ.js → chunk-IQIJCMG2.js} +1 -1
  4. package/dist/{chunk-6W25S5CF.js → chunk-KGXTBTCJ.js} +1 -1
  5. package/dist/chunk-LAEVMNJN.js +135 -0
  6. package/dist/{chunk-VCRXL7H5.js → chunk-PGQXVJXW.js} +2 -2
  7. package/dist/{chunk-F3XK34DV.js → chunk-TB2K5JN3.js} +2 -2
  8. package/dist/{chunk-XNBDACL7.js → chunk-ZUBBMLBD.js} +1 -1
  9. package/dist/components/badge.d.ts +8 -2
  10. package/dist/components/badge.js +1 -1
  11. package/dist/components/banner.d.ts +17 -2
  12. package/dist/components/banner.js +10 -7
  13. package/dist/components/booking-row.js +1 -1
  14. package/dist/components/button-group.js +3 -39
  15. package/dist/components/calendar.js +1 -1
  16. package/dist/components/combobox.js +3 -3
  17. package/dist/components/command.js +2 -2
  18. package/dist/components/concept-convergence.js +1 -1
  19. package/dist/components/dialog.js +1 -1
  20. package/dist/components/dropdown-menu.js +6 -6
  21. package/dist/components/filter-category-row.js +1 -1
  22. package/dist/components/input-group.js +1 -1
  23. package/dist/components/menu-item.js +3 -3
  24. package/dist/components/multi-select-combobox.js +10 -5
  25. package/dist/components/multi-select-menu.js +1 -1
  26. package/dist/components/pan-zoom-viewport.d.ts +137 -0
  27. package/dist/components/pan-zoom-viewport.js +531 -0
  28. package/dist/components/place-card.js +2 -2
  29. package/dist/components/place-details-mobile.js +1 -1
  30. package/dist/components/responsive-overlay.d.ts +29 -1
  31. package/dist/components/responsive-overlay.js +46 -7
  32. package/dist/components/searchable-select.js +3 -3
  33. package/dist/components/select.js +2 -2
  34. package/dist/components/selection-bar.js +1 -1
  35. package/dist/components/sheet.d.ts +6 -0
  36. package/dist/components/sheet.js +3 -133
  37. package/dist/components/signature-chip.js +2 -2
  38. package/dist/components/tabs.d.ts +16 -1
  39. package/dist/components/tabs.js +21 -3
  40. package/dist/components/toggle-group.js +1 -1
  41. package/dist/components/toggle.d.ts +6 -0
  42. package/dist/components/toggle.js +1 -1
  43. package/dist/components/top-ranking-entry.js +3 -3
  44. package/package.json +1 -1
  45. package/src/components/badge.stories.tsx +32 -1
  46. package/src/components/badge.test.tsx +45 -0
  47. package/src/components/badge.tsx +41 -3
  48. package/src/components/banner.stories.tsx +32 -0
  49. package/src/components/banner.test.tsx +58 -0
  50. package/src/components/banner.tsx +28 -4
  51. package/src/components/calendar.tsx +1 -1
  52. package/src/components/combobox.tsx +1 -1
  53. package/src/components/command.test.tsx +10 -0
  54. package/src/components/command.tsx +1 -1
  55. package/src/components/dialog.tsx +1 -1
  56. package/src/components/dropdown-menu.test.tsx +31 -0
  57. package/src/components/dropdown-menu.tsx +6 -6
  58. package/src/components/input-group.tsx +1 -1
  59. package/src/components/multi-select-combobox.tsx +7 -1
  60. package/src/components/multi-select-menu.tsx +1 -1
  61. package/src/components/pan-zoom-viewport.stories.tsx +134 -0
  62. package/src/components/pan-zoom-viewport.test.tsx +381 -0
  63. package/src/components/pan-zoom-viewport.tsx +727 -0
  64. package/src/components/responsive-overlay.stories.tsx +61 -0
  65. package/src/components/responsive-overlay.test.tsx +104 -0
  66. package/src/components/responsive-overlay.tsx +87 -22
  67. package/src/components/searchable-select.tsx +1 -1
  68. package/src/components/select.tsx +2 -2
  69. package/src/components/selection-bar.tsx +1 -1
  70. package/src/components/sheet.tsx +14 -3
  71. package/src/components/tabs.stories.tsx +23 -0
  72. package/src/components/tabs.test.tsx +64 -0
  73. package/src/components/tabs.tsx +36 -3
  74. package/src/components/toggle.test.tsx +19 -0
  75. package/src/components/toggle.tsx +8 -2
  76. package/src/globals.css +28 -19
@@ -1,13 +1,13 @@
1
1
  import { Checkbox } from '../chunk-L3CDXVEP.js';
2
2
  import { Popover, PopoverTrigger, PopoverContent } from '../chunk-2ADCZXZJ.js';
3
- import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from '../chunk-VCRXL7H5.js';
4
- import '../chunk-TVEIUTBQ.js';
3
+ import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem } from '../chunk-PGQXVJXW.js';
4
+ import '../chunk-IQIJCMG2.js';
5
5
  import { Button } from '../chunk-5SGKGFMN.js';
6
6
  import '../chunk-RIH2IS7X.js';
7
7
  import '../chunk-5YNIQ2BL.js';
8
- import { Badge } from '../chunk-NIAL4ZU2.js';
8
+ import { Badge } from '../chunk-FQAIYKAS.js';
9
9
  import { cn } from '../chunk-FEK5XGZW.js';
10
- import '../chunk-MMUBH76A.js';
10
+ import { __spreadValues } from '../chunk-MMUBH76A.js';
11
11
  import * as React from 'react';
12
12
  import { ChevronsUpDown, X } from 'lucide-react';
13
13
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -62,7 +62,12 @@ function MultiSelectCombobox({
62
62
  className: "w-[var(--radix-popover-trigger-width)] p-0",
63
63
  align: "start",
64
64
  children: /* @__PURE__ */ jsxs(Command, { shouldFilter, children: [
65
- /* @__PURE__ */ jsx(CommandInput, { placeholder: searchPlaceholder, onValueChange: onSearchChange }),
65
+ /* @__PURE__ */ jsx(
66
+ CommandInput,
67
+ __spreadValues({
68
+ placeholder: searchPlaceholder
69
+ }, onSearchChange ? { onValueChange: onSearchChange } : {})
70
+ ),
66
71
  /* @__PURE__ */ jsxs(CommandList, { children: [
67
72
  /* @__PURE__ */ jsx(CommandEmpty, { children: loading ? "Loading\u2026" : emptyText }),
68
73
  /* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => {
@@ -54,7 +54,7 @@ function MultiSelectMenu({
54
54
  onCheckedChange: () => handleToggle(option.value),
55
55
  className: cn(
56
56
  "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none",
57
- "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
57
+ "data-[highlighted]:bg-accent-subtle data-[highlighted]:text-foreground",
58
58
  "data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
59
59
  ),
60
60
  children: [
@@ -0,0 +1,137 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * PanZoomViewport — a window onto content larger or smaller than itself, that
5
+ * pans and zooms: the floor plan in service and in the plan editor
6
+ * (floor/07-f0, floor/12-s11, seating/01-k2, registry/10-p0, registry/21-p15).
7
+ *
8
+ * The content is laid out at its natural size (`contentWidth` ×
9
+ * `contentHeight`, in CSS px) and moved with ONE transform —
10
+ * `translate(x, y) scale(s)` from its top-left corner — so what it draws is
11
+ * the caller's business and nothing here knows about tables.
12
+ *
13
+ * Input, all of it through the same clamp:
14
+ * - Drag with a mouse, a pen or one finger pans. The pan starts after 4px, so
15
+ * a tap still reaches a table underneath as a click, and the click a drag
16
+ * would otherwise become is swallowed. An element marked
17
+ * `data-pan-zoom-ignore` never starts a pan (the plan editor's drag handles).
18
+ * - Two fingers pinch; a trackpad pinch (a ctrl-wheel in Chromium and
19
+ * Firefox, a gesture event in Safari) and ctrl / ⌘ + wheel zoom about the
20
+ * pointer. A plain wheel or two-finger scroll pans — and hands the scroll
21
+ * back to the page once the content cannot move further that way, so the
22
+ * viewport never traps a page scroll.
23
+ * - Keyboard, with the viewport focused: arrows pan (Shift for four times the
24
+ * step); `+` / `-` zoom and `0` fits, from anywhere inside it. Tabbing onto
25
+ * a table that sits off screen pans it into view.
26
+ * - The + / − / Fit controls, bottom right.
27
+ *
28
+ * The min-scale floor: `Fit` never shrinks below `minScale`. On a phone the
29
+ * plan would otherwise fit at a size no finger can hit, so below the floor it
30
+ * stops shrinking, anchors top-left, and the rest is a pan away — with a
31
+ * shaded edge on every side where content runs past the viewport, so the
32
+ * clipped tables read as "more this way", not as a broken layout.
33
+ *
34
+ * Zooms from the controls and the keyboard ease over `--duration-quick`;
35
+ * gestures follow the finger with no easing; `prefers-reduced-motion` drops
36
+ * the easing entirely. Every string is injected through `labels`: the design
37
+ * system holds no copy.
38
+ *
39
+ * The viewport takes its size from the caller — give it a height. It refits
40
+ * when the viewport resizes or the content changes size, until the user moves
41
+ * it; after that it keeps their view and only pulls it back inside the
42
+ * bounds. To start a different plan fitted (switching Inside → Terrace),
43
+ * give the viewport a `key` per plan, or call `apiRef.current.fit()`.
44
+ */
45
+ type PanZoomTransform = {
46
+ /** 1 is the content's natural size. */
47
+ scale: number;
48
+ /** The content's top-left corner, in viewport px. */
49
+ x: number;
50
+ y: number;
51
+ };
52
+ type PanZoomViewportLabels = {
53
+ /** The viewport's accessible name — "Floor plan, Inside". */
54
+ viewport: string;
55
+ /** Read after the name — "Arrow keys move the plan; plus and minus zoom; 0 fits it." */
56
+ instructions?: string;
57
+ /** The + button — "Zoom in". */
58
+ zoomIn: string;
59
+ /** The − button — "Zoom out". */
60
+ zoomOut: string;
61
+ /** The fit button's visible text — "Fit". */
62
+ fit: string;
63
+ /** The controls group — "Zoom". */
64
+ controls?: string;
65
+ /**
66
+ * Announced politely after a zoom from the controls or the keyboard —
67
+ * `(percent) => \`${percent}%\``. Omit it and nothing is announced.
68
+ */
69
+ zoomLevel?: (percent: number) => string;
70
+ };
71
+ /** Drive the viewport from outside: a "Show T5" link, a reset on area change. */
72
+ type PanZoomViewportHandle = {
73
+ zoomIn: () => void;
74
+ zoomOut: () => void;
75
+ fit: () => void;
76
+ /** Zoom to `scale` about the viewport's centre. */
77
+ zoomTo: (scale: number) => void;
78
+ /** Move the content by `dx`, `dy` viewport px. */
79
+ panBy: (dx: number, dy: number) => void;
80
+ /** Bring the content point (`x`, `y`, in natural px) to the viewport's centre. */
81
+ centerOn: (x: number, y: number) => void;
82
+ getTransform: () => PanZoomTransform;
83
+ };
84
+ type PanZoomViewportProps = Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
85
+ /** The content's natural width, in CSS px. */
86
+ contentWidth: number;
87
+ /** The content's natural height, in CSS px. */
88
+ contentHeight: number;
89
+ children: React.ReactNode;
90
+ labels: PanZoomViewportLabels;
91
+ /** The floor: neither Fit nor zooming out goes below it. Default 0.5. */
92
+ minScale?: number;
93
+ /** Default 2.5. */
94
+ maxScale?: number;
95
+ /** The factor one + / − step multiplies by. Default 1.25. */
96
+ zoomStep?: number;
97
+ /** One arrow press, in viewport px. Default 48. */
98
+ panStep?: number;
99
+ /** The air Fit leaves around the content, and how far past it a pan may go. Default 24. */
100
+ fitPadding?: number;
101
+ /** Render the + / − / Fit controls. Default true. */
102
+ controls?: boolean;
103
+ /** Called with every transform — gestures included, so keep it cheap. */
104
+ onTransformChange?: (transform: PanZoomTransform) => void;
105
+ /** An imperative handle; see `PanZoomViewportHandle`. */
106
+ apiRef?: React.Ref<PanZoomViewportHandle>;
107
+ /** Classes for the transformed content layer. */
108
+ contentClassName?: string;
109
+ };
110
+ declare const PanZoomViewport: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
111
+ /** The content's natural width, in CSS px. */
112
+ contentWidth: number;
113
+ /** The content's natural height, in CSS px. */
114
+ contentHeight: number;
115
+ children: React.ReactNode;
116
+ labels: PanZoomViewportLabels;
117
+ /** The floor: neither Fit nor zooming out goes below it. Default 0.5. */
118
+ minScale?: number;
119
+ /** Default 2.5. */
120
+ maxScale?: number;
121
+ /** The factor one + / − step multiplies by. Default 1.25. */
122
+ zoomStep?: number;
123
+ /** One arrow press, in viewport px. Default 48. */
124
+ panStep?: number;
125
+ /** The air Fit leaves around the content, and how far past it a pan may go. Default 24. */
126
+ fitPadding?: number;
127
+ /** Render the + / − / Fit controls. Default true. */
128
+ controls?: boolean;
129
+ /** Called with every transform — gestures included, so keep it cheap. */
130
+ onTransformChange?: (transform: PanZoomTransform) => void;
131
+ /** An imperative handle; see `PanZoomViewportHandle`. */
132
+ apiRef?: React.Ref<PanZoomViewportHandle>;
133
+ /** Classes for the transformed content layer. */
134
+ contentClassName?: string;
135
+ } & React.RefAttributes<HTMLDivElement>>;
136
+
137
+ export { type PanZoomTransform, PanZoomViewport, type PanZoomViewportHandle, type PanZoomViewportLabels, type PanZoomViewportProps };