@bayonai/mui-design 1.1.0 → 1.3.0

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 (35) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +57 -0
  3. package/dist/cjs/links/useLinkAddressPreview.js +17 -7
  4. package/dist/cjs/location/GeographicLocationField.js +49 -0
  5. package/dist/cjs/location/GoogleMapsAttribution.js +12 -0
  6. package/dist/cjs/location/MetadataValueField.js +23 -0
  7. package/dist/cjs/location/SearchInputAction.js +15 -0
  8. package/dist/cjs/location/VenueSearchDialog.js +99 -0
  9. package/dist/cjs/location/index.js +12 -0
  10. package/dist/cjs/pending/PendingChangesDialogView.js +43 -29
  11. package/dist/cjs/pricing/PricingTable.js +58 -0
  12. package/dist/cjs/pricing/index.js +6 -0
  13. package/dist/esm/links/useLinkAddressPreview.js +17 -7
  14. package/dist/esm/location/GeographicLocationField.js +43 -0
  15. package/dist/esm/location/GoogleMapsAttribution.js +9 -0
  16. package/dist/esm/location/MetadataValueField.js +20 -0
  17. package/dist/esm/location/SearchInputAction.js +9 -0
  18. package/dist/esm/location/VenueSearchDialog.js +96 -0
  19. package/dist/esm/location/index.js +5 -0
  20. package/dist/esm/pending/PendingChangesDialogView.js +43 -29
  21. package/dist/esm/pricing/PricingTable.js +52 -0
  22. package/dist/esm/pricing/index.js +2 -0
  23. package/dist/types/links/useLinkAddressPreview.d.ts +3 -1
  24. package/dist/types/location/GeographicLocationField.d.ts +26 -0
  25. package/dist/types/location/GoogleMapsAttribution.d.ts +1 -0
  26. package/dist/types/location/MetadataValueField.d.ts +7 -0
  27. package/dist/types/location/SearchInputAction.d.ts +8 -0
  28. package/dist/types/location/VenueSearchDialog.d.ts +32 -0
  29. package/dist/types/location/index.d.ts +4 -0
  30. package/dist/types/pending/PendingChangesDialogView.d.ts +1 -1
  31. package/dist/types/pending/types.d.ts +7 -0
  32. package/dist/types/pricing/PricingTable.d.ts +25 -0
  33. package/dist/types/pricing/index.d.ts +2 -0
  34. package/docs/pending-contract.md +11 -0
  35. package/package.json +11 -1
@@ -7,7 +7,7 @@ import { createPortal } from "react-dom";
7
7
  * a validated destination. The source previews/edits; the card navigates. */
8
8
  export function useLinkAddressPreview(enabled = true, onEdit) {
9
9
  const id = useId();
10
- const activated = useRef(null);
10
+ const pointerPreview = useRef(null);
11
11
  const [preview, setPreview] = useState(null);
12
12
  const closeTimer = useRef(null);
13
13
  const focusFrame = useRef(null);
@@ -19,7 +19,7 @@ export function useLinkAddressPreview(enabled = true, onEdit) {
19
19
  function close() {
20
20
  cancelClose();
21
21
  setPreview(null);
22
- activated.current = null;
22
+ pointerPreview.current = null;
23
23
  }
24
24
  function contains(target) {
25
25
  var _a;
@@ -94,6 +94,12 @@ export function useLinkAddressPreview(enabled = true, onEdit) {
94
94
  ? {
95
95
  "aria-controls": (preview === null || preview === void 0 ? void 0 : preview.href) === href ? id : undefined,
96
96
  "aria-keyshortcuts": "ArrowDown",
97
+ onPointerDown: (event) => {
98
+ pointerPreview.current = {
99
+ anchor: event.currentTarget,
100
+ visible: (preview === null || preview === void 0 ? void 0 : preview.anchor) === event.currentTarget,
101
+ };
102
+ },
97
103
  onMouseEnter: (event) => show(event.currentTarget, href, label),
98
104
  onMouseLeave: scheduleClose,
99
105
  onFocus: (event) => show(event.currentTarget, href, label),
@@ -118,6 +124,7 @@ export function useLinkAddressPreview(enabled = true, onEdit) {
118
124
  : {};
119
125
  },
120
126
  onClick(event, href, label) {
127
+ var _a;
121
128
  event.stopPropagation();
122
129
  if (!enabled ||
123
130
  event.metaKey ||
@@ -126,16 +133,19 @@ export function useLinkAddressPreview(enabled = true, onEdit) {
126
133
  event.altKey ||
127
134
  event.button !== 0)
128
135
  return;
129
- // The source is an editing affordance after preview; the card owns navigation.
136
+ // Product decision: an already visible preview makes its source editable.
137
+ // Capture pointer state before click-induced focus can reveal the preview.
138
+ const wasVisible = event.detail > 0 &&
139
+ ((_a = pointerPreview.current) === null || _a === void 0 ? void 0 : _a.anchor) === event.currentTarget
140
+ ? pointerPreview.current.visible
141
+ : (preview === null || preview === void 0 ? void 0 : preview.anchor) === event.currentTarget;
142
+ pointerPreview.current = null;
130
143
  event.preventDefault();
131
- if ((preview === null || preview === void 0 ? void 0 : preview.anchor) === event.currentTarget &&
132
- activated.current === event.currentTarget &&
133
- onEdit) {
144
+ if (wasVisible && onEdit) {
134
145
  close();
135
146
  onEdit();
136
147
  }
137
148
  else {
138
- activated.current = event.currentTarget;
139
149
  show(event.currentTarget, href, label);
140
150
  }
141
151
  },
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import AddLocationAltOutlinedIcon from "@mui/icons-material/AddLocationAltOutlined";
4
+ import EditLocationAltOutlinedIcon from "@mui/icons-material/EditLocationAltOutlined";
5
+ import ClearIcon from "@mui/icons-material/Clear";
6
+ import { IconButton, Link, Tooltip, Typography } from "@mui/material";
7
+ import { useEffect, useState } from "react";
8
+ import { MetadataValueField } from "./MetadataValueField.js";
9
+ import { VenueSearchDialog, } from "./VenueSearchDialog.js";
10
+ const defaultCopy = {
11
+ fieldLabel: "Geographic location",
12
+ empty: "No location selected",
13
+ choose: "Choose venue",
14
+ change: "Change venue",
15
+ clear: "Clear location",
16
+ openMaps: (label) => `Open in Google Maps: ${label}`,
17
+ };
18
+ function isGoogleMapsUrl(value) {
19
+ try {
20
+ const url = new URL(value);
21
+ return (url.protocol === "https:" &&
22
+ (url.hostname === "maps.google.com" ||
23
+ (["google.com", "www.google.com"].includes(url.hostname) &&
24
+ url.pathname.startsWith("/maps"))));
25
+ }
26
+ catch {
27
+ return false;
28
+ }
29
+ }
30
+ /** Host adapters supply persisted values, copy behavior and an authorized lookup. */
31
+ export function GeographicLocationField({ value, placeName = "", disabled = false, canSearch = true, copyAction, copy, pickerCopy, searchVenues, onChange, }) {
32
+ const [editing, setEditing] = useState(false);
33
+ const labels = { ...defaultCopy, ...copy };
34
+ const safeMapUrl = value && isGoogleMapsUrl(value.mapsUrl);
35
+ useEffect(() => {
36
+ if (value && !safeMapUrl)
37
+ console.error("[Geographic location] Invalid Maps URL; displaying the label without a link.");
38
+ }, [value, safeMapUrl]);
39
+ return (_jsxs(_Fragment, { children: [_jsx(MetadataValueField, { label: labels.fieldLabel, actions: _jsxs(_Fragment, { children: [value && safeMapUrl ? copyAction : null, onChange ? (_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: value ? labels.change : labels.choose, children: _jsx("span", { children: _jsx(IconButton, { size: "small", disabled: disabled, "aria-label": value ? labels.change : labels.choose, onClick: () => setEditing(true), children: value ? (_jsx(EditLocationAltOutlinedIcon, { fontSize: "small" })) : (_jsx(AddLocationAltOutlinedIcon, { fontSize: "small" })) }) }) }), value ? (_jsx(Tooltip, { title: labels.clear, children: _jsx("span", { children: _jsx(IconButton, { size: "small", disabled: disabled, "aria-label": labels.clear, onClick: () => onChange(undefined), children: _jsx(ClearIcon, { fontSize: "small" }) }) }) })) : null] })) : null] }), children: value && safeMapUrl ? (_jsx(Link, { href: value.mapsUrl, target: "_blank", rel: "noopener noreferrer", "aria-label": labels.openMaps(value.label), sx: { flex: 1, overflowWrap: "anywhere", minWidth: 0 }, children: value.label })) : (_jsx(Typography, { sx: { flex: 1, minWidth: 0 }, color: value ? undefined : "text.secondary", children: value ? value.label : labels.empty })) }), editing && !disabled ? (_jsx(VenueSearchDialog, { placeName: placeName, copy: pickerCopy, canSearch: canSearch, searchVenues: searchVenues, onClose: () => setEditing(false), onChange: (selected) => {
40
+ onChange === null || onChange === void 0 ? void 0 : onChange(selected);
41
+ setEditing(false);
42
+ } })) : null] }));
43
+ }
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Box } from "@mui/material";
4
+ // Official Google Maps attribution assets; bytes are kept unmodified.
5
+ const whiteLogo = "data:image/svg+xml;base64,PD94bWwgdmV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DUtMC40OCwwLjc4YzAsMC40OCwwLjM3LDAuOCwxLjExLDAuOTdsMS42NSwwLjM5YzAuNzgsMC4xOCwxLjM2LDAuNDksMS43NCwwLjk0YzAuMzcsMC40NCwwLjU2LDAuOTQsMC41NiwxLjUKCQljMCwwLjc1LTAuMzEsMS4zNy0wLjkyLDEuODdDOTYuNDcsMTMuNzEsOTUuNjgsMTMuOTYsOTQuNzEsMTMuOTZ6Ii8+CjwvZz4KPC9zdmc+Cg==";
7
+ export function GoogleMapsAttribution() {
8
+ return (_jsxs(Box, { component: "span", "data-google-maps-attribution": "true", sx: { display: "block", pt: "10px", px: "10px", pb: "5px" }, children: [_jsx(Box, { component: "img", alt: "Google Maps", src: darkLogo, sx: { display: (theme) => theme.palette.mode === "light" ? "block" : "none", width: "auto", height: 16 } }), _jsx(Box, { component: "img", alt: "Google Maps", src: whiteLogo, sx: { display: (theme) => theme.palette.mode === "dark" ? "block" : "none", width: "auto", height: 16 } })] }));
9
+ }
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Box, Stack, Typography } from "@mui/material";
4
+ /** Compact label/value row; consumers own actions, wording and persistence. */
5
+ export function MetadataValueField({ label, children, actions, }) {
6
+ return (_jsxs(Stack, { spacing: 0.25, sx: { minWidth: 0 }, children: [_jsx(Typography, { component: "span", variant: "caption", sx: {
7
+ color: "text.secondary",
8
+ fontSize: "0.75rem",
9
+ fontWeight: 700,
10
+ letterSpacing: "0.04em",
11
+ lineHeight: 1.2,
12
+ textTransform: "uppercase",
13
+ }, children: label }), _jsxs(Stack, { direction: "row", spacing: 0.5, sx: {
14
+ alignItems: "center",
15
+ borderBottom: 1,
16
+ borderColor: "divider",
17
+ minHeight: 40,
18
+ minWidth: 0,
19
+ }, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0, overflowWrap: "anywhere" }, children: children }), actions] })] }));
20
+ }
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import SearchIcon from "@mui/icons-material/Search";
4
+ import { InputAdornment, Tooltip } from "@mui/material";
5
+ import { LoadingIconButton } from "../actions/LoadingIconButton.js";
6
+ /** Shared trailing action for search text fields; typing never starts a lookup. */
7
+ export function SearchInputAction({ label, loadingLabel, loading = false, disabled = false, onSearch, }) {
8
+ return (_jsx(InputAdornment, { position: "end", children: _jsx(Tooltip, { title: loading ? loadingLabel : label, children: _jsx("span", { children: _jsx(LoadingIconButton, { "aria-label": label, loadingLabel: loadingLabel, loading: loading, disabled: disabled, onClick: onSearch, type: "button", edge: "end", children: _jsx(SearchIcon, {}) }) }) }) }));
9
+ }
@@ -0,0 +1,96 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Dialog, DialogContent, DialogTitle, List, ListItemButton, ListItemText, Stack, TextField, Typography, } from "@mui/material";
4
+ import { useEffect, useId, useRef, useState } from "react";
5
+ import { DialogCloseButton } from "../actions/DialogActionButtons.js";
6
+ import { StatusNotice } from "../feedback/StatusNotice.js";
7
+ import { SearchInputAction } from "./SearchInputAction.js";
8
+ import { GoogleMapsAttribution } from "./GoogleMapsAttribution.js";
9
+ const defaultCopy = {
10
+ title: "Choose a venue",
11
+ close: "Close venue search",
12
+ queryLabel: "Venue name",
13
+ queryHelp: "Add a city or country to narrow the matches.",
14
+ queryTooLong: "Use a shorter venue name (up to 200 characters).",
15
+ search: "Search venues",
16
+ searching: "Searching venues",
17
+ loading: "Finding venues…",
18
+ resultsLabel: "Matching venues",
19
+ chooseResult: "Select the right venue, or adjust the name and search again.",
20
+ noResults: "No venues found. Add a city or country to the name and search again.",
21
+ failure: "Couldn't load venues. Your current location is unchanged.",
22
+ };
23
+ export function VenueSearchDialog({ placeName = "", canSearch = true, searchVenues, copy, onClose, onChange, }) {
24
+ const titleId = useId();
25
+ const labels = { ...defaultCopy, ...copy };
26
+ const [query, setQuery] = useState(placeName);
27
+ const [venues, setVenues] = useState(null);
28
+ const [pending, setPending] = useState(false);
29
+ const [message, setMessage] = useState(null);
30
+ const generation = useRef(0);
31
+ const busy = useRef(false);
32
+ useEffect(() => () => {
33
+ generation.current++;
34
+ }, []);
35
+ async function search() {
36
+ const name = query.trim();
37
+ if (busy.current || !canSearch || name.length < 2 || name.length > 200)
38
+ return;
39
+ const current = ++generation.current;
40
+ busy.current = true;
41
+ setPending(true);
42
+ setMessage(null);
43
+ setVenues(null);
44
+ try {
45
+ // A deliberate Search is one billable lookup. Never search per keystroke,
46
+ // auto-select the first prediction, or persist Google's returned address.
47
+ const result = await searchVenues(name);
48
+ if (current === generation.current)
49
+ setVenues(result);
50
+ }
51
+ catch (error) {
52
+ if (current === generation.current) {
53
+ console.error("[Place venue search] Could not load venue choices; the selected location is unchanged.", { error });
54
+ setMessage(labels.failure);
55
+ }
56
+ }
57
+ finally {
58
+ if (current === generation.current) {
59
+ busy.current = false;
60
+ setPending(false);
61
+ }
62
+ }
63
+ }
64
+ return (_jsxs(Dialog, { open: true, fullWidth: true, maxWidth: "sm", "aria-labelledby": titleId, onClose: onClose, children: [_jsxs(DialogTitle, { sx: { pr: 7 }, children: [_jsx("span", { id: titleId, children: labels.title }), _jsx(GoogleMapsAttribution, {})] }), _jsx(DialogCloseButton, { label: labels.close, onClose: onClose }), _jsx(DialogContent, { children: _jsxs(Stack, { spacing: 2, sx: { pt: 1 }, children: [_jsx(TextField, { autoFocus: true, fullWidth: true, label: labels.queryLabel, value: query, error: query.trim().length > 200, helperText: query.trim().length > 200 ? labels.queryTooLong : labels.queryHelp, slotProps: {
65
+ htmlInput: { maxLength: 200 },
66
+ input: {
67
+ // Product decision: explicit search lives inside the field;
68
+ // Enter and this icon share one guarded request path.
69
+ endAdornment: (_jsx(SearchInputAction, { label: labels.search, loadingLabel: labels.searching, loading: pending, disabled: !canSearch ||
70
+ query.trim().length < 2 ||
71
+ query.trim().length > 200, onSearch: () => void search() })),
72
+ },
73
+ }, onChange: (event) => {
74
+ generation.current++;
75
+ busy.current = false;
76
+ setPending(false);
77
+ setQuery(event.target.value);
78
+ setVenues(null);
79
+ setMessage(null);
80
+ }, onKeyDown: (event) => {
81
+ if (event.key === "Enter" && !event.nativeEvent.isComposing) {
82
+ event.preventDefault();
83
+ void search();
84
+ }
85
+ } }), message ? _jsx(StatusNotice, { message: message, tone: "error" }) : null, _jsxs("div", { "aria-live": "polite", "aria-busy": pending, children: [pending ? (_jsx(Typography, { variant: "body2", color: "text.secondary", children: labels.loading })) : null, venues !== null ? (_jsx(Stack, { spacing: 1, children: venues.length ? (_jsxs(_Fragment, { children: [_jsx(Typography, { variant: "body2", children: labels.chooseResult }), _jsx(List, { disablePadding: true, "aria-label": labels.resultsLabel, children: venues.map((venue) => (_jsx(ListItemButton, { component: "button", type: "button", sx: {
86
+ width: "100%",
87
+ textAlign: "left",
88
+ borderRadius: 1,
89
+ }, onClick: () => onChange({
90
+ provider: "google",
91
+ placeId: venue.placeId,
92
+ }), children: _jsx(ListItemText, { primary: venue.name, secondary: venue.address, slotProps: {
93
+ primary: { sx: { overflowWrap: "anywhere" } },
94
+ secondary: { sx: { overflowWrap: "anywhere" } },
95
+ } }) }, venue.placeId))) })] })) : (_jsx(Typography, { variant: "body2", children: labels.noResults })) })) : null] })] }) })] }));
96
+ }
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ export { VenueSearchDialog, } from "./VenueSearchDialog.js";
3
+ export { SearchInputAction } from "./SearchInputAction.js";
4
+ export { MetadataValueField } from "./MetadataValueField.js";
5
+ export { GeographicLocationField, } from "./GeographicLocationField.js";
@@ -2,11 +2,12 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { IconButton, List, ListItem, Pagination, Stack, Typography, Tooltip, } from "@mui/material";
4
4
  import ArrowForwardRoundedIcon from "@mui/icons-material/ArrowForwardRounded";
5
+ import DeleteOutlineRoundedIcon from "@mui/icons-material/DeleteOutlineRounded";
5
6
  import CloudUploadOutlinedIcon from "@mui/icons-material/CloudUploadOutlined";
6
7
  import { useRef, useState } from "react";
7
8
  import { PendingChangesDialogShell } from "./PendingChangesDialogShell.js";
8
9
  const pageSize = 10;
9
- export function PendingChangesDialogView({ groups, open, onClose, title, summary, emptyMessage = "All changes are saved.", accountKey, onOpenItem, focusGroupKey, navigationError, contentHeader, contentTouchHandlers, shell: Shell = PendingChangesDialogShell, }) {
10
+ export function PendingChangesDialogView({ groups, open, onClose, title, summary, emptyMessage = "All changes are saved.", accountKey, onOpenItem, onDiscardRequest, discardLabel = "Discard a change", focusGroupKey, navigationError, contentHeader, contentTouchHandlers, shell: Shell = PendingChangesDialogShell, }) {
10
11
  const returnItemButton = useRef(null);
11
12
  const [page, setPage] = useState(1);
12
13
  const [actionPages, setActionPages] = useState({});
@@ -40,7 +41,12 @@ export function PendingChangesDialogView({ groups, open, onClose, title, summary
40
41
  return (_jsxs(Shell, { autoFocusInput: false, closeLabel: "Close pending changes", closeTooltip: "Close pending changes", contentHeader: contentHeader !== null && contentHeader !== void 0 ? contentHeader : (groups.length ? (
41
42
  // Product decision: the sync summary remains distinct and visible
42
43
  // while the user scrolls through pending groups.
43
- _jsx(Stack, { component: "section", "aria-label": "Pending changes summary", spacing: 0.5, sx: { p: 2, borderRadius: 1, bgcolor: "action.selected" }, children: _jsx(Typography, { variant: "body2", sx: { fontWeight: 600 }, children: summary }) })) : undefined), contentTouchHandlers: contentTouchHandlers, contentSx: { pt: 0.5, pb: 3, overscrollBehaviorY: "contain" }, exclusive: false, onClose: onClose, onEntered: () => {
44
+ _jsxs(Stack, { component: "section", "aria-label": "Pending changes summary", direction: "row", spacing: 1, sx: {
45
+ p: 2,
46
+ borderRadius: 1,
47
+ bgcolor: "action.selected",
48
+ alignItems: "center",
49
+ }, children: [_jsx(Typography, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: summary }), onDiscardRequest ? (_jsx(Tooltip, { title: discardLabel, children: _jsx(IconButton, { "aria-label": discardLabel, onClick: onDiscardRequest, sx: { width: 44, height: 44 }, children: _jsx(DeleteOutlineRoundedIcon, {}) }) })) : null] })) : undefined), contentTouchHandlers: contentTouchHandlers, contentSx: { pt: 0.5, pb: 3, overscrollBehaviorY: "contain" }, exclusive: false, onClose: onClose, onEntered: () => {
44
50
  // Entry focus runs after MUI settles its focus trap, including a reopen
45
51
  // of the same inspector. A removed group retains the shell's fallback.
46
52
  const target = returnItemButton.current;
@@ -56,23 +62,23 @@ export function PendingChangesDialogView({ groups, open, onClose, title, summary
56
62
  const actionPage = Math.min((_a = actionPages[group.key]) !== null && _a !== void 0 ? _a : 1, actionPageCount);
57
63
  return (_jsx(ListItem, { disableGutters: true, sx: {
58
64
  p: 2,
65
+ position: "relative",
59
66
  alignItems: "flex-start",
60
67
  border: 1,
61
68
  borderColor: "divider",
62
69
  borderRadius: 1,
63
- }, children: _jsxs(Stack, { spacing: 1, sx: { minWidth: 0, width: "100%" }, children: [_jsxs(Stack, { direction: "row", spacing: 1, sx: {
70
+ }, children: _jsxs(Stack, { spacing: 0, sx: { minWidth: 0, width: "100%" }, children: [_jsxs(Stack, { direction: "row", spacing: 1, sx: {
64
71
  alignItems: "center",
65
72
  justifyContent: "space-between",
66
- }, children: [_jsx(Tooltip, { title: title, children: _jsx(Typography, { component: "h3", "aria-label": title, tabIndex: 0, sx: {
67
- flex: 1,
68
- minWidth: 0,
69
- fontWeight: 600,
70
- // The item name owns one row; CSS handles the
71
- // available width, while the tooltip retains it all.
72
- overflow: "hidden",
73
- textOverflow: "ellipsis",
74
- whiteSpace: "nowrap",
75
- }, variant: "body2", children: title }) }), _jsx(Stack, { direction: "row", spacing: 0.5, sx: { alignItems: "center", flexShrink: 0 }, children: group.openLabel && onOpenItem ? (_jsx(Tooltip, { title: unavailableReason || group.openLabel, children: _jsx("span", { tabIndex: unavailableReason ? 0 : undefined, "aria-label": unavailableReason
73
+ }, children: [_jsx(Typography, { component: "h3", sx: {
74
+ flex: 1,
75
+ minWidth: 0,
76
+ fontWeight: 600,
77
+ overflowWrap: "anywhere",
78
+ }, variant: "body2", children: title }), _jsx(Stack, { direction: "row", spacing: 0.5, sx: {
79
+ alignItems: "center",
80
+ flexShrink: 0,
81
+ }, children: group.openLabel && onOpenItem ? (_jsx(Tooltip, { title: unavailableReason || group.openLabel, children: _jsx("span", { tabIndex: unavailableReason ? 0 : undefined, "aria-label": unavailableReason
76
82
  ? `${group.openLabel} unavailable. ${unavailableReason}`
77
83
  : undefined, children: _jsx(IconButton, { "aria-label": `${group.openLabel}: ${title}`, disabled: Boolean(unavailableReason), ref: focusGroupKey === group.key
78
84
  ? returnItemButton
@@ -84,26 +90,34 @@ export function PendingChangesDialogView({ groups, open, onClose, title, summary
84
90
  if (!presentation.action &&
85
91
  !exception &&
86
92
  !presentation.targetLabel &&
87
- presentation.attemptedText === undefined)
93
+ !presentation.elapsedText &&
94
+ presentation.attemptedText === undefined &&
95
+ !presentation.endAction)
88
96
  return null;
89
- return (_jsx(ListItem, { disableGutters: true, sx: {
90
- display: "block",
97
+ return (_jsxs(ListItem, { disableGutters: true, sx: {
98
+ display: "flex",
99
+ alignItems: "center",
100
+ gap: 1,
91
101
  py: 1,
92
102
  borderTop: index > 0 ? 1 : 0,
93
103
  borderColor: "divider",
94
- }, children: _jsxs(Stack, { spacing: 0.75, children: [_jsxs(Stack, { direction: "row", spacing: 1, sx: {
95
- alignItems: "baseline",
96
- justifyContent: "space-between",
97
- flexWrap: "wrap",
98
- }, children: [presentation.action ? (_jsx(Typography, { component: "h4", color: "text.secondary", variant: "caption", children: presentation.action })) : null, exception ? (_jsx(Typography, { color: item.needsAttention
99
- ? "error"
100
- : "text.secondary", variant: "caption", children: exception })) : null] }), presentation.targetLabel ? (_jsx(Typography, { color: "text.secondary", variant: "caption", sx: {
101
- overflowWrap: "anywhere",
102
- whiteSpace: "pre-wrap",
103
- }, children: presentation.targetLabel })) : null, presentation.attemptedText !== undefined ? (_jsx(Typography, { variant: "body1", sx: {
104
- whiteSpace: "pre-wrap",
105
- overflowWrap: "anywhere",
106
- }, children: presentation.attemptedText })) : null] }) }, item.id));
104
+ }, children: [_jsxs(Stack, { spacing: 0.75, sx: { flex: 1, minWidth: 0 }, children: [_jsxs(Stack, { direction: "row", spacing: 1, sx: {
105
+ alignItems: "baseline",
106
+ justifyContent: "space-between",
107
+ flexWrap: "wrap",
108
+ }, children: [presentation.action ? (_jsx(Typography, { component: "h4", color: "text.secondary", variant: "caption", children: presentation.action })) : null, exception ? (_jsx(Typography, { color: item.needsAttention
109
+ ? "error"
110
+ : "text.secondary", variant: "caption", children: exception })) : null] }), presentation.elapsedText ? (_jsx(Typography, { variant: "caption", sx: {
111
+ fontSize: "0.6875rem",
112
+ color: "text.primary",
113
+ opacity: 0.78,
114
+ }, children: presentation.elapsedText })) : null, presentation.targetLabel ? (_jsx(Typography, { color: "text.secondary", variant: "caption", sx: {
115
+ overflowWrap: "anywhere",
116
+ whiteSpace: "pre-wrap",
117
+ }, children: presentation.targetLabel })) : null, presentation.attemptedText !== undefined ? (_jsx(Typography, { variant: "body1", sx: {
118
+ whiteSpace: "pre-wrap",
119
+ overflowWrap: "anywhere",
120
+ }, children: presentation.attemptedText })) : null] }), presentation.endAction] }, item.id));
107
121
  }) }), actionPageCount > 1 ? (_jsx(Pagination, { "aria-label": `Change pages for ${group.title}`, count: actionPageCount, page: actionPage, onChange: (_event, nextPage) => setActionPages((previous) => ({
108
122
  ...previous,
109
123
  [group.key]: nextPage,
@@ -0,0 +1,52 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import CheckRoundedIcon from "@mui/icons-material/CheckRounded";
4
+ import { Box, Stack, Typography } from "@mui/material";
5
+ // Product decision: callers own plan content and actions; this component only
6
+ // presents the supplied plans and never determines prices or availability.
7
+ export function PricingTable({ label, plans, className, interactiveClassName, colors, }) {
8
+ return (_jsx(Box, { "aria-label": label, className: className, sx: {
9
+ display: "grid",
10
+ gap: 1.5,
11
+ gridTemplateColumns: {
12
+ xs: "1fr",
13
+ md: `repeat(${plans.length}, minmax(0, 1fr))`,
14
+ },
15
+ }, children: plans.map((plan) => {
16
+ const highlighted = Boolean(plan.highlighted);
17
+ const secondary = highlighted ? "rgba(255,255,255,0.86)" : colors.muted;
18
+ return (_jsxs(Stack, { className: interactiveClassName, spacing: 2.25, sx: {
19
+ bgcolor: highlighted ? colors.accent : "#FFFFFF",
20
+ boxShadow: highlighted
21
+ ? "0 8px 18px rgba(23, 106, 168, 0.22)"
22
+ : "none",
23
+ color: highlighted ? "#FFFFFF" : colors.text,
24
+ minHeight: { md: 430 },
25
+ p: { xs: 2.5, sm: 3 },
26
+ position: "relative",
27
+ borderRadius: 2,
28
+ ...(highlighted
29
+ ? {}
30
+ : { border: "1px solid rgba(23, 38, 56, 0.12)" }),
31
+ "&:hover": {
32
+ ...(highlighted
33
+ ? { boxShadow: "0 10px 22px rgba(23, 106, 168, 0.28)" }
34
+ : { bgcolor: "#FCFEFF" }),
35
+ transform: "translateY(-2px)",
36
+ },
37
+ }, children: [_jsxs(Stack, { direction: "row", spacing: 1, sx: { justifyContent: "space-between" }, children: [_jsx(Typography, { sx: { fontSize: 21, fontWeight: 780 }, children: plan.label }), plan.badge] }), _jsx(Typography, { sx: {
38
+ color: secondary,
39
+ fontSize: 14,
40
+ lineHeight: 1.5,
41
+ minHeight: { md: 42 },
42
+ }, children: plan.description }), _jsxs(Stack, { spacing: 0.25, children: [_jsx(Typography, { sx: {
43
+ fontSize: { xs: 25, sm: 28 },
44
+ fontWeight: 780,
45
+ letterSpacing: "-0.03em",
46
+ }, children: plan.price }), _jsx(Typography, { sx: { color: secondary, fontSize: 13 }, children: plan.priceNote })] }), _jsx(Stack, { component: "ul", spacing: 1.1, sx: { listStyle: "none", m: 0, p: 0 }, children: plan.features.map((feature, index) => (_jsxs(Stack, { component: "li", direction: "row", spacing: 1, children: [_jsx(CheckRoundedIcon, { sx: {
47
+ color: highlighted ? "#FFFFFF" : colors.accentDark,
48
+ fontSize: 18,
49
+ mt: "2px",
50
+ } }), _jsx(Typography, { sx: { fontSize: 14, lineHeight: 1.45 }, children: feature })] }, index))) }), _jsx(Box, { sx: { flex: 1 } }), plan.action] }, plan.id));
51
+ }) }));
52
+ }
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { PricingTable } from "./PricingTable.js";
@@ -1,10 +1,11 @@
1
- import { type FocusEvent, type KeyboardEvent, type MouseEvent } from "react";
1
+ import { type FocusEvent, type KeyboardEvent, type MouseEvent, type PointerEvent as ReactPointerEvent } from "react";
2
2
  /** Product decision: hosts own link interaction; the shared UI card only displays
3
3
  * a validated destination. The source previews/edits; the card navigates. */
4
4
  export declare function useLinkAddressPreview(enabled?: boolean, onEdit?: () => void): {
5
5
  linkProps(href: string, label: string): {
6
6
  "aria-controls": string | undefined;
7
7
  "aria-keyshortcuts": string;
8
+ onPointerDown: (event: ReactPointerEvent<HTMLAnchorElement>) => void;
8
9
  onMouseEnter: (event: MouseEvent<HTMLAnchorElement>) => void;
9
10
  onMouseLeave: () => void;
10
11
  onFocus: (event: FocusEvent<HTMLAnchorElement>) => void;
@@ -13,6 +14,7 @@ export declare function useLinkAddressPreview(enabled?: boolean, onEdit?: () =>
13
14
  } | {
14
15
  "aria-controls"?: undefined;
15
16
  "aria-keyshortcuts"?: undefined;
17
+ onPointerDown?: undefined;
16
18
  onMouseEnter?: undefined;
17
19
  onMouseLeave?: undefined;
18
20
  onFocus?: undefined;
@@ -0,0 +1,26 @@
1
+ import { type ReactNode } from "react";
2
+ import { type GoogleVenueReference, type VenueSuggestion, type VenueSearchCopy } from "./VenueSearchDialog.js";
3
+ export type GeographicLocationCopy = {
4
+ fieldLabel: string;
5
+ empty: string;
6
+ choose: string;
7
+ change: string;
8
+ clear: string;
9
+ openMaps: (label: string) => string;
10
+ };
11
+ export type GeographicLocationFieldProps = {
12
+ value?: {
13
+ label: string;
14
+ mapsUrl: string;
15
+ };
16
+ placeName?: string;
17
+ disabled?: boolean;
18
+ canSearch?: boolean;
19
+ copyAction?: ReactNode;
20
+ copy?: Partial<GeographicLocationCopy>;
21
+ pickerCopy?: Partial<VenueSearchCopy>;
22
+ searchVenues: (query: string) => Promise<VenueSuggestion[]>;
23
+ onChange?: (value: GoogleVenueReference | undefined) => void;
24
+ };
25
+ /** Host adapters supply persisted values, copy behavior and an authorized lookup. */
26
+ export declare function GeographicLocationField({ value, placeName, disabled, canSearch, copyAction, copy, pickerCopy, searchVenues, onChange, }: GeographicLocationFieldProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function GoogleMapsAttribution(): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from "react";
2
+ /** Compact label/value row; consumers own actions, wording and persistence. */
3
+ export declare function MetadataValueField({ label, children, actions, }: {
4
+ label: ReactNode;
5
+ children: ReactNode;
6
+ actions?: ReactNode;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /** Shared trailing action for search text fields; typing never starts a lookup. */
2
+ export declare function SearchInputAction({ label, loadingLabel, loading, disabled, onSearch, }: {
3
+ label: string;
4
+ loadingLabel: string;
5
+ loading?: boolean;
6
+ disabled?: boolean;
7
+ onSearch: () => void;
8
+ }): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ export type VenueSuggestion = {
2
+ placeId: string;
3
+ name: string;
4
+ address?: string;
5
+ };
6
+ export type GoogleVenueReference = {
7
+ provider: "google";
8
+ placeId: string;
9
+ };
10
+ /** Hosts can localize all product copy; Google Maps attribution remains fixed. */
11
+ export type VenueSearchCopy = {
12
+ title: string;
13
+ close: string;
14
+ queryLabel: string;
15
+ queryHelp: string;
16
+ queryTooLong: string;
17
+ search: string;
18
+ searching: string;
19
+ loading: string;
20
+ resultsLabel: string;
21
+ chooseResult: string;
22
+ noResults: string;
23
+ failure: string;
24
+ };
25
+ export declare function VenueSearchDialog({ placeName, canSearch, searchVenues, copy, onClose, onChange, }: {
26
+ placeName?: string;
27
+ canSearch?: boolean;
28
+ searchVenues: (query: string) => Promise<VenueSuggestion[]>;
29
+ copy?: Partial<VenueSearchCopy>;
30
+ onClose: () => void;
31
+ onChange: (pin: GoogleVenueReference) => void;
32
+ }): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { VenueSearchDialog, type VenueSuggestion, type VenueSearchCopy, type GoogleVenueReference, } from "./VenueSearchDialog.js";
2
+ export { SearchInputAction } from "./SearchInputAction.js";
3
+ export { MetadataValueField } from "./MetadataValueField.js";
4
+ export { GeographicLocationField, type GeographicLocationFieldProps, type GeographicLocationCopy, } from "./GeographicLocationField.js";
@@ -1,2 +1,2 @@
1
1
  import type { PendingChangesDialogViewProps } from "./types.js";
2
- export declare function PendingChangesDialogView({ groups, open, onClose, title, summary, emptyMessage, accountKey, onOpenItem, focusGroupKey, navigationError, contentHeader, contentTouchHandlers, shell: Shell, }: PendingChangesDialogViewProps): import("react").JSX.Element;
2
+ export declare function PendingChangesDialogView({ groups, open, onClose, title, summary, emptyMessage, accountKey, onOpenItem, onDiscardRequest, discardLabel, focusGroupKey, navigationError, contentHeader, contentTouchHandlers, shell: Shell, }: PendingChangesDialogViewProps): import("react").JSX.Element;
@@ -7,7 +7,11 @@ export type PendingChangeRow = {
7
7
  exception?: string;
8
8
  needsAttention?: boolean;
9
9
  targetLabel?: string;
10
+ /** Host-formatted age of this change, refreshed by the host as needed. */
11
+ elapsedText?: string;
10
12
  attemptedText?: string;
13
+ /** Host-owned action for this individual change. */
14
+ endAction?: ReactNode;
11
15
  };
12
16
  export type PendingChangeViewGroup = {
13
17
  key: string;
@@ -40,6 +44,9 @@ export type PendingChangesDialogViewProps = {
40
44
  onClose: () => void;
41
45
  accountKey?: string | null;
42
46
  onOpenItem?: (groupKey: string) => void;
47
+ /** Requests host-owned selection and confirmation; does not discard data. */
48
+ onDiscardRequest?: () => void;
49
+ discardLabel?: string;
43
50
  focusGroupKey?: string | null;
44
51
  navigationError?: string | null;
45
52
  contentHeader?: ReactNode;