@bayonai/mui-design 1.3.0 → 1.5.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.
package/CHANGELOG.md CHANGED
@@ -2,9 +2,15 @@
2
2
 
3
3
  All notable changes to `@bayonai/mui-design` will be documented in this file.
4
4
 
5
- ## 1.3.0 (unreleased)
5
+ ## 1.5.0 - 2026-11-19
6
6
 
7
- - Add reusable metadata value-row and explicit venue-search presentation.
7
+ - Add the optional dark comparison appearance for pricing tables.
8
+ - Give plan sections accessible names with an optional host override.
9
+ - Use the published file-uploads package for local upload component development.
10
+
11
+ ## 1.4.0 - 2026-11-12
12
+
13
+ - Add reusable metadata value-row/group spacing, neutral template badge, and explicit venue-search presentation.
8
14
 
9
15
  ## 1.2.1 - 2026-11-12
10
16
 
package/README.md CHANGED
@@ -121,7 +121,7 @@ context are retained. The private file swipe adapter delegates `/swipe` with
121
121
  identical delete colors, spacing, gesture thresholds, easing and reduced-motion
122
122
  behavior. Lightbox and scroll utilities keep their existing owners.
123
123
 
124
- Uploads consumers must install exact `@bayonai/file-uploads@0.2.0` (an optional peer for
124
+ Uploads consumers can install exact `@bayonai/file-uploads@0.2.1` (an optional peer for
125
125
  applications using other MUI entries). Neutral contracts belong to
126
126
  `@bayonai/file-uploads`; React-only locking belongs to
127
127
  `@bayonai/file-uploads/hooks`. No `file-uploads/mui` entry is introduced.
@@ -138,41 +138,34 @@ import type { UploadFile, LoadFile } from "@bayonai/file-uploads";
138
138
  import { useUploadLock } from "@bayonai/file-uploads/hooks";
139
139
  ```
140
140
 
141
- External consumers including Thunderlist must keep their exact existing package
142
- versions until the owner publishes and verifies file-uploads 0.2.0 and mui-design
143
- 1.1.0 together. Then install those versions and replace `@bayonai/ui/uploads`
144
- imports using the mapping above; compatibility type/hook exports also allow a
145
- single prefix replacement. Keep host providers, callbacks and props unchanged.
146
- The local development dependency uses `vendor/bayonai-file-uploads-0.2.0-neutral.tgz`.
147
- Release gates include packed ESM/CommonJS/types imports, copied upload lifecycle,
148
- security, loading, cancellation and download tests, shared swipe regressions,
149
- host-theme overrides and affected consumer verification. No publication or
150
- deployment is authorized by this relocation.
141
+ Consumers migrating from `@bayonai/ui/uploads` can use the mapping above.
142
+ Keep host providers, callbacks and props unchanged. The local development
143
+ dependency uses the published `@bayonai/file-uploads@0.2.1` package. Release
144
+ checks cover packed imports and declarations, upload lifecycle, downloads,
145
+ swipe behavior, host theme overrides, and affected consumers.
151
146
 
152
147
  Behavior regression snapshots are in `tests/`, outside the declaration/build
153
148
  source tree. They retain the source package's Vitest and React test renderer
154
149
  contracts; release verification must supply those test dependencies and run the
155
150
  preserved suite as well as build, typecheck, packed ESM/CommonJS import checks,
156
151
  and affected consumer checks in the designated fresh verification context.
157
- Version `1.1.0` is a local release candidate; this work does not publish it.
158
152
 
159
153
  The [upload ownership contract](docs/uploads-contract.md) records preserved flow,
160
154
  swipe equivalence and linked behavioral coverage.
161
155
 
162
156
  ### Package behavior tests
163
157
 
164
- Run `npm test --workspace @bayonai/mui-design` from the owner repository. The package Vitest configuration runs the preserved generic and upload suites against source with one React runtime, including host theme-provider overrides. Install the checked-in development archive for file-uploads before building/testing; production consumers of uploads explicitly install file-uploads 0.2.0 alongside their MUI/React peers.
158
+ Run `npm test --workspace @bayonai/mui-design` from the owner repository. The package Vitest configuration runs the preserved generic and upload suites against source with one React runtime, including host theme-provider overrides.
165
159
 
166
160
  ### Camera and crop dialogs (TL-M251)
167
161
 
168
162
  `CameraCaptureDialog`, `ImageCropDialog`, `CameraCaptureDialogProps`,
169
163
  `ImageCropDialogProps`, `CameraCaptureLabels`, and `ImageCropLabels` now belong to
170
164
  `@bayonai/mui-design/uploads`. Replace imports from
171
- `@bayonai/file-uploads/react` with this entry when adopting the paired candidates.
172
- Keep existing props, callbacks and host MUI providers unchanged. The neutral
173
- file-uploads 0.2.0 candidate removes its old `/react` presentation entry; crop
174
- geometry and `ImageCrop` remain at `@bayonai/file-uploads` and upload locking
175
- remains at `@bayonai/file-uploads/hooks`.
165
+ `@bayonai/file-uploads/react` with this entry.
166
+ Keep existing props, callbacks and host MUI providers unchanged. File-uploads 0.2.0 removed the old `/react` presentation entry. Import crop
167
+ geometry and `ImageCrop` from `@bayonai/file-uploads` and upload locking from
168
+ `@bayonai/file-uploads/hooks`.
176
169
 
177
170
  ```tsx
178
171
  import { CameraCaptureDialog, ImageCropDialog } from "@bayonai/mui-design/uploads";
@@ -211,7 +204,11 @@ open action retains its accessible label and tooltip.
211
204
  ### Location presentation
212
205
 
213
206
  `@bayonai/mui-design/location` exposes `MetadataValueField`,
214
- `VenueSearchDialog`, `GeographicLocationField`, and `SearchInputAction`. Supply an authorized `searchVenues`
207
+ `VenueSearchDialog`, `GeographicLocationField`, `MetadataFieldGroup`,
208
+ `TemplateBadge`, and `SearchInputAction`. `MetadataFieldGroup` and the exported
209
+ spacing constants preserve the close-label / separated-field rhythm. The exported
210
+ `metadataFieldLabelSx` and `metadataValueRowSx` recipes let hosts apply the same
211
+ layout to custom field controls. Supply an authorized `searchVenues`
215
212
  callback to the dialog; its result labels and addresses are transient. The user
216
213
  must explicitly search and select a result. Hosts provide credential handling,
217
214
  rate limits, persistence, billing configuration, safe error policy, clipboard
@@ -235,11 +232,19 @@ import { placeLocationMapsUrl } from "@bayonai/location";
235
232
  The field calls the host-provided search function only after explicit action;
236
233
  `onChange` supplies a selected Google Place ID or `undefined` for Clear. Hosts
237
234
  may override field and picker copy while the Google Maps logo remains unchanged.
238
- Only HTTPS Google Maps URLs are linked; invalid links display the label and a
239
- safe console diagnostic instead. Hosts should retain prior values until their
235
+ Only HTTPS `google.com/maps`, `www.google.com/maps`, and `maps.google.com`
236
+ URLs are linked; invalid links display the label and a safe console diagnostic
237
+ instead. Hosts should retain prior values until their
240
238
  own form's accepted save and implement any error/clipboard feedback policies.
241
239
 
242
240
  The picker embeds the unmodified official Google Maps attribution logos from the
243
241
  [Google attribution assets](https://developers.google.com/static/maps/documentation/images/Google_Maps_Attribution_Assets.zip).
244
242
  Keep attribution visible and follow the [Places API policies](https://developers.google.com/maps/documentation/places/web-service/policies)
245
- when presenting Google content.
243
+ when presenting Google content. Applications using a restrictive Content Security
244
+ Policy must permit `data:` images in `img-src` so the embedded attribution logo
245
+ remains visible.
246
+
247
+ `TemplateBadge` is the compact neutral marker for host-identified template
248
+ types. Hosts decide which types have a template and may supply a localized label.
249
+
250
+ `PricingTable` also supports the opt-in `appearance="darkComparison"` variant. Plan sections use the text label or ID as their accessible name; `accessibleLabel` can override it. Callers retain responsibility for plan terms, status and actions; the default appearance remains unchanged.
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.METADATA_FIELD_GROUP_SPACING = exports.METADATA_FIELD_LABEL_SPACING = void 0;
5
+ exports.MetadataFieldGroup = MetadataFieldGroup;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const material_1 = require("@mui/material");
8
+ /** Keep each label close to its value and separate neighboring fields. */
9
+ exports.METADATA_FIELD_LABEL_SPACING = 0.25;
10
+ exports.METADATA_FIELD_GROUP_SPACING = 2.5;
11
+ function MetadataFieldGroup(props) {
12
+ return (0, jsx_runtime_1.jsx)(material_1.Stack, { spacing: exports.METADATA_FIELD_GROUP_SPACING, ...props });
13
+ }
@@ -1,23 +1,27 @@
1
1
  "use strict";
2
2
  "use client";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.metadataValueRowSx = exports.metadataFieldLabelSx = void 0;
4
5
  exports.MetadataValueField = MetadataValueField;
5
6
  const jsx_runtime_1 = require("react/jsx-runtime");
6
7
  const material_1 = require("@mui/material");
7
- /** Compact label/value row; consumers own actions, wording and persistence. */
8
+ const MetadataFieldGroup_js_1 = require("./MetadataFieldGroup.js");
9
+ // Shared recipes preserve the field's label rhythm and underlined value row.
10
+ exports.metadataFieldLabelSx = {
11
+ color: "text.secondary",
12
+ fontSize: "0.75rem",
13
+ fontWeight: 700,
14
+ letterSpacing: "0.04em",
15
+ lineHeight: 1.2,
16
+ textTransform: "uppercase",
17
+ };
18
+ exports.metadataValueRowSx = {
19
+ alignItems: "center",
20
+ borderBottom: 1,
21
+ borderColor: "divider",
22
+ minHeight: 40,
23
+ minWidth: 0,
24
+ };
8
25
  function MetadataValueField({ label, children, actions, }) {
9
- return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { spacing: 0.25, sx: { minWidth: 0 }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "span", variant: "caption", sx: {
10
- color: "text.secondary",
11
- fontSize: "0.75rem",
12
- fontWeight: 700,
13
- letterSpacing: "0.04em",
14
- lineHeight: 1.2,
15
- textTransform: "uppercase",
16
- }, children: label }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", spacing: 0.5, sx: {
17
- alignItems: "center",
18
- borderBottom: 1,
19
- borderColor: "divider",
20
- minHeight: 40,
21
- minWidth: 0,
22
- }, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: { flex: 1, minWidth: 0, overflowWrap: "anywhere" }, children: children }), actions] })] }));
26
+ return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { spacing: MetadataFieldGroup_js_1.METADATA_FIELD_LABEL_SPACING, sx: { minWidth: 0 }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "span", variant: "caption", sx: exports.metadataFieldLabelSx, children: label }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", spacing: 0.5, sx: exports.metadataValueRowSx, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: { flex: 1, minWidth: 0, overflowWrap: "anywhere" }, children: children }), actions] })] }));
23
27
  }
@@ -9,7 +9,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
9
9
  const Search_1 = __importDefault(require("@mui/icons-material/Search"));
10
10
  const material_1 = require("@mui/material");
11
11
  const LoadingIconButton_js_1 = require("../actions/LoadingIconButton.js");
12
- /** Shared trailing action for search text fields; typing never starts a lookup. */
13
12
  function SearchInputAction({ label, loadingLabel, loading = false, disabled = false, onSearch, }) {
14
13
  return ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: loading ? loadingLabel : label, children: (0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)(LoadingIconButton_js_1.LoadingIconButton, { "aria-label": label, loadingLabel: loadingLabel, loading: loading, disabled: disabled, onClick: onSearch, type: "button", edge: "end", children: (0, jsx_runtime_1.jsx)(Search_1.default, {}) }) }) }) }));
15
14
  }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TemplateBadge = TemplateBadge;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const material_1 = require("@mui/material");
7
+ function TemplateBadge({ label = "Template" }) {
8
+ return ((0, jsx_runtime_1.jsx)(material_1.Chip, { component: "span", label: label, size: "small", sx: { flex: "0 0 auto", fontSize: "0.68rem", height: 20, ml: 1 } }));
9
+ }
@@ -48,8 +48,21 @@ function VenueSearchDialog({ placeName = "", canSearch = true, searchVenues, cop
48
48
  // A deliberate Search is one billable lookup. Never search per keystroke,
49
49
  // auto-select the first prediction, or persist Google's returned address.
50
50
  const result = await searchVenues(name);
51
+ if (!Array.isArray(result))
52
+ throw new Error("Venue search returned an invalid result list.");
53
+ // Keep the picker bounded and never allow malformed provider IDs to be selected.
54
+ const choices = result
55
+ .slice(0, 5)
56
+ .filter((venue) => venue &&
57
+ typeof venue.placeId === "string" &&
58
+ venue.placeId.length > 0 &&
59
+ venue.placeId.length <= 512 &&
60
+ !/[\s\u0000-\u001f\u007f]/u.test(venue.placeId) &&
61
+ typeof venue.name === "string" &&
62
+ venue.name.trim().length > 0 &&
63
+ (venue.address === undefined || typeof venue.address === "string"));
51
64
  if (current === generation.current)
52
- setVenues(result);
65
+ setVenues(choices);
53
66
  }
54
67
  catch (error) {
55
68
  if (current === generation.current) {
@@ -1,12 +1,20 @@
1
1
  "use strict";
2
2
  "use client";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.GeographicLocationField = exports.MetadataValueField = exports.SearchInputAction = exports.VenueSearchDialog = void 0;
4
+ exports.METADATA_FIELD_LABEL_SPACING = exports.METADATA_FIELD_GROUP_SPACING = exports.MetadataFieldGroup = exports.TemplateBadge = exports.GeographicLocationField = exports.metadataValueRowSx = exports.metadataFieldLabelSx = exports.MetadataValueField = exports.SearchInputAction = exports.VenueSearchDialog = void 0;
5
5
  var VenueSearchDialog_js_1 = require("./VenueSearchDialog.js");
6
6
  Object.defineProperty(exports, "VenueSearchDialog", { enumerable: true, get: function () { return VenueSearchDialog_js_1.VenueSearchDialog; } });
7
7
  var SearchInputAction_js_1 = require("./SearchInputAction.js");
8
8
  Object.defineProperty(exports, "SearchInputAction", { enumerable: true, get: function () { return SearchInputAction_js_1.SearchInputAction; } });
9
9
  var MetadataValueField_js_1 = require("./MetadataValueField.js");
10
10
  Object.defineProperty(exports, "MetadataValueField", { enumerable: true, get: function () { return MetadataValueField_js_1.MetadataValueField; } });
11
+ Object.defineProperty(exports, "metadataFieldLabelSx", { enumerable: true, get: function () { return MetadataValueField_js_1.metadataFieldLabelSx; } });
12
+ Object.defineProperty(exports, "metadataValueRowSx", { enumerable: true, get: function () { return MetadataValueField_js_1.metadataValueRowSx; } });
11
13
  var GeographicLocationField_js_1 = require("./GeographicLocationField.js");
12
14
  Object.defineProperty(exports, "GeographicLocationField", { enumerable: true, get: function () { return GeographicLocationField_js_1.GeographicLocationField; } });
15
+ var TemplateBadge_js_1 = require("./TemplateBadge.js");
16
+ Object.defineProperty(exports, "TemplateBadge", { enumerable: true, get: function () { return TemplateBadge_js_1.TemplateBadge; } });
17
+ var MetadataFieldGroup_js_1 = require("./MetadataFieldGroup.js");
18
+ Object.defineProperty(exports, "MetadataFieldGroup", { enumerable: true, get: function () { return MetadataFieldGroup_js_1.MetadataFieldGroup; } });
19
+ Object.defineProperty(exports, "METADATA_FIELD_GROUP_SPACING", { enumerable: true, get: function () { return MetadataFieldGroup_js_1.METADATA_FIELD_GROUP_SPACING; } });
20
+ Object.defineProperty(exports, "METADATA_FIELD_LABEL_SPACING", { enumerable: true, get: function () { return MetadataFieldGroup_js_1.METADATA_FIELD_LABEL_SPACING; } });
@@ -10,49 +10,51 @@ const CheckRounded_1 = __importDefault(require("@mui/icons-material/CheckRounded
10
10
  const material_1 = require("@mui/material");
11
11
  // Product decision: callers own plan content and actions; this component only
12
12
  // presents the supplied plans and never determines prices or availability.
13
- function PricingTable({ label, plans, className, interactiveClassName, colors, }) {
13
+ function PricingTable({ label, plans, className, interactiveClassName, colors, appearance = "default", }) {
14
+ const dark = appearance === "darkComparison";
14
15
  return ((0, jsx_runtime_1.jsx)(material_1.Box, { "aria-label": label, className: className, sx: {
15
16
  display: "grid",
16
- gap: 1.5,
17
+ gap: dark ? 2.5 : 1.5,
17
18
  gridTemplateColumns: {
18
19
  xs: "1fr",
19
20
  md: `repeat(${plans.length}, minmax(0, 1fr))`,
20
21
  },
21
22
  }, children: plans.map((plan) => {
23
+ var _a;
22
24
  const highlighted = Boolean(plan.highlighted);
23
- const secondary = highlighted ? "rgba(255,255,255,0.86)" : colors.muted;
24
- return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { className: interactiveClassName, spacing: 2.25, sx: {
25
- bgcolor: highlighted ? colors.accent : "#FFFFFF",
26
- boxShadow: highlighted
25
+ const secondary = dark ? "#c9c3dc" : highlighted ? "rgba(255,255,255,0.86)" : colors.muted;
26
+ return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { className: interactiveClassName, component: dark ? "section" : "div", "aria-label": dark ? ((_a = plan.accessibleLabel) !== null && _a !== void 0 ? _a : (typeof plan.label === "string" ? plan.label : plan.id)) : undefined, spacing: dark ? 2 : 2.25, sx: {
27
+ bgcolor: dark ? (highlighted ? "#27204d" : "#151327") : highlighted ? colors.accent : "#FFFFFF",
28
+ boxShadow: dark ? "none" : highlighted
27
29
  ? "0 8px 18px rgba(23, 106, 168, 0.22)"
28
30
  : "none",
29
- color: highlighted ? "#FFFFFF" : colors.text,
30
- minHeight: { md: 430 },
31
- p: { xs: 2.5, sm: 3 },
31
+ color: dark || highlighted ? "#f5efff" : colors.text,
32
+ minHeight: { md: dark ? 520 : 430 },
33
+ p: dark ? { xs: 2.5, md: 4 } : { xs: 2.5, sm: 3 },
32
34
  position: "relative",
33
- borderRadius: 2,
34
- ...(highlighted
35
+ borderRadius: dark ? 2.5 : 2,
36
+ ...(dark ? { border: highlighted ? "1px solid #b56ef3" : "1px solid #49405e" } : highlighted
35
37
  ? {}
36
38
  : { border: "1px solid rgba(23, 38, 56, 0.12)" }),
37
- "&:hover": {
38
- ...(highlighted
39
- ? { boxShadow: "0 10px 22px rgba(23, 106, 168, 0.28)" }
40
- : { bgcolor: "#FCFEFF" }),
41
- transform: "translateY(-2px)",
42
- },
43
- }, children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", spacing: 1, sx: { justifyContent: "space-between" }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { fontSize: 21, fontWeight: 780 }, children: plan.label }), plan.badge] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: {
39
+ ...(!dark && { "&:hover": {
40
+ ...(highlighted
41
+ ? { boxShadow: "0 10px 22px rgba(23, 106, 168, 0.28)" }
42
+ : { bgcolor: "#FCFEFF" }),
43
+ transform: "translateY(-2px)",
44
+ } }),
45
+ }, children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", spacing: 1, sx: { justifyContent: "space-between" }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: dark ? "h2" : "p", sx: { fontSize: dark ? { xs: 26, md: 34 } : 21, fontWeight: 780 }, children: plan.label }), plan.badge] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: {
44
46
  color: secondary,
45
- fontSize: 14,
47
+ fontSize: dark ? { xs: 15, md: 17 } : 14,
46
48
  lineHeight: 1.5,
47
49
  minHeight: { md: 42 },
48
- }, children: plan.description }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { spacing: 0.25, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { sx: {
49
- fontSize: { xs: 25, sm: 28 },
50
+ }, children: plan.description }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: dark ? "row" : "column", spacing: dark ? 1 : 0.25, sx: dark ? { alignItems: "baseline", flexWrap: "wrap" } : undefined, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { sx: {
51
+ fontSize: dark ? { xs: 36, md: 56 } : { xs: 25, sm: 28 },
50
52
  fontWeight: 780,
51
53
  letterSpacing: "-0.03em",
52
- }, children: plan.price }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { color: secondary, fontSize: 13 }, children: plan.priceNote })] }), (0, jsx_runtime_1.jsx)(material_1.Stack, { component: "ul", spacing: 1.1, sx: { listStyle: "none", m: 0, p: 0 }, children: plan.features.map((feature, index) => ((0, jsx_runtime_1.jsxs)(material_1.Stack, { component: "li", direction: "row", spacing: 1, children: [(0, jsx_runtime_1.jsx)(CheckRounded_1.default, { sx: {
53
- color: highlighted ? "#FFFFFF" : colors.accentDark,
54
+ }, children: plan.price }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { color: secondary, fontSize: dark ? { xs: 15, md: 18 } : 13 }, children: plan.priceNote })] }), dark && (0, jsx_runtime_1.jsx)(material_1.Box, { "aria-hidden": "true", sx: { borderTop: "1px solid #514761" } }), (0, jsx_runtime_1.jsx)(material_1.Stack, { component: "ul", spacing: 1.1, sx: { listStyle: "none", m: 0, p: 0 }, children: plan.features.map((feature, index) => ((0, jsx_runtime_1.jsxs)(material_1.Stack, { component: "li", direction: "row", spacing: 1, children: [(0, jsx_runtime_1.jsx)(CheckRounded_1.default, { "aria-hidden": "true", sx: {
55
+ color: dark ? "#d5b3f9" : highlighted ? "#FFFFFF" : colors.accentDark,
54
56
  fontSize: 18,
55
57
  mt: "2px",
56
- } }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { fontSize: 14, lineHeight: 1.45 }, children: feature })] }, index))) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { flex: 1 } }), plan.action] }, plan.id));
58
+ } }), (0, jsx_runtime_1.jsx)(material_1.Typography, { sx: { fontSize: dark ? { xs: 15, md: 18 } : 14, lineHeight: 1.45 }, children: feature })] }, index))) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { flex: 1 } }), plan.action] }, plan.id));
57
59
  }) }));
58
60
  }
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Stack } from "@mui/material";
4
+ /** Keep each label close to its value and separate neighboring fields. */
5
+ export const METADATA_FIELD_LABEL_SPACING = 0.25;
6
+ export const METADATA_FIELD_GROUP_SPACING = 2.5;
7
+ export function MetadataFieldGroup(props) {
8
+ return _jsx(Stack, { spacing: METADATA_FIELD_GROUP_SPACING, ...props });
9
+ }
@@ -1,20 +1,23 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Box, Stack, Typography } from "@mui/material";
4
- /** Compact label/value row; consumers own actions, wording and persistence. */
4
+ import { METADATA_FIELD_LABEL_SPACING } from "./MetadataFieldGroup.js";
5
+ // Shared recipes preserve the field's label rhythm and underlined value row.
6
+ export const metadataFieldLabelSx = {
7
+ color: "text.secondary",
8
+ fontSize: "0.75rem",
9
+ fontWeight: 700,
10
+ letterSpacing: "0.04em",
11
+ lineHeight: 1.2,
12
+ textTransform: "uppercase",
13
+ };
14
+ export const metadataValueRowSx = {
15
+ alignItems: "center",
16
+ borderBottom: 1,
17
+ borderColor: "divider",
18
+ minHeight: 40,
19
+ minWidth: 0,
20
+ };
5
21
  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] })] }));
22
+ return (_jsxs(Stack, { spacing: METADATA_FIELD_LABEL_SPACING, sx: { minWidth: 0 }, children: [_jsx(Typography, { component: "span", variant: "caption", sx: metadataFieldLabelSx, children: label }), _jsxs(Stack, { direction: "row", spacing: 0.5, sx: metadataValueRowSx, children: [_jsx(Box, { sx: { flex: 1, minWidth: 0, overflowWrap: "anywhere" }, children: children }), actions] })] }));
20
23
  }
@@ -3,7 +3,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import SearchIcon from "@mui/icons-material/Search";
4
4
  import { InputAdornment, Tooltip } from "@mui/material";
5
5
  import { LoadingIconButton } from "../actions/LoadingIconButton.js";
6
- /** Shared trailing action for search text fields; typing never starts a lookup. */
7
6
  export function SearchInputAction({ label, loadingLabel, loading = false, disabled = false, onSearch, }) {
8
7
  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
8
  }
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Chip } from "@mui/material";
4
+ export function TemplateBadge({ label = "Template" }) {
5
+ return (_jsx(Chip, { component: "span", label: label, size: "small", sx: { flex: "0 0 auto", fontSize: "0.68rem", height: 20, ml: 1 } }));
6
+ }
@@ -45,8 +45,21 @@ export function VenueSearchDialog({ placeName = "", canSearch = true, searchVenu
45
45
  // A deliberate Search is one billable lookup. Never search per keystroke,
46
46
  // auto-select the first prediction, or persist Google's returned address.
47
47
  const result = await searchVenues(name);
48
+ if (!Array.isArray(result))
49
+ throw new Error("Venue search returned an invalid result list.");
50
+ // Keep the picker bounded and never allow malformed provider IDs to be selected.
51
+ const choices = result
52
+ .slice(0, 5)
53
+ .filter((venue) => venue &&
54
+ typeof venue.placeId === "string" &&
55
+ venue.placeId.length > 0 &&
56
+ venue.placeId.length <= 512 &&
57
+ !/[\s\u0000-\u001f\u007f]/u.test(venue.placeId) &&
58
+ typeof venue.name === "string" &&
59
+ venue.name.trim().length > 0 &&
60
+ (venue.address === undefined || typeof venue.address === "string"));
48
61
  if (current === generation.current)
49
- setVenues(result);
62
+ setVenues(choices);
50
63
  }
51
64
  catch (error) {
52
65
  if (current === generation.current) {
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  export { VenueSearchDialog, } from "./VenueSearchDialog.js";
3
- export { SearchInputAction } from "./SearchInputAction.js";
4
- export { MetadataValueField } from "./MetadataValueField.js";
3
+ export { SearchInputAction, } from "./SearchInputAction.js";
4
+ export { MetadataValueField, metadataFieldLabelSx, metadataValueRowSx, } from "./MetadataValueField.js";
5
5
  export { GeographicLocationField, } from "./GeographicLocationField.js";
6
+ export { TemplateBadge } from "./TemplateBadge.js";
7
+ export { MetadataFieldGroup, METADATA_FIELD_GROUP_SPACING, METADATA_FIELD_LABEL_SPACING, } from "./MetadataFieldGroup.js";
@@ -4,49 +4,51 @@ import CheckRoundedIcon from "@mui/icons-material/CheckRounded";
4
4
  import { Box, Stack, Typography } from "@mui/material";
5
5
  // Product decision: callers own plan content and actions; this component only
6
6
  // presents the supplied plans and never determines prices or availability.
7
- export function PricingTable({ label, plans, className, interactiveClassName, colors, }) {
7
+ export function PricingTable({ label, plans, className, interactiveClassName, colors, appearance = "default", }) {
8
+ const dark = appearance === "darkComparison";
8
9
  return (_jsx(Box, { "aria-label": label, className: className, sx: {
9
10
  display: "grid",
10
- gap: 1.5,
11
+ gap: dark ? 2.5 : 1.5,
11
12
  gridTemplateColumns: {
12
13
  xs: "1fr",
13
14
  md: `repeat(${plans.length}, minmax(0, 1fr))`,
14
15
  },
15
16
  }, children: plans.map((plan) => {
17
+ var _a;
16
18
  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
19
+ const secondary = dark ? "#c9c3dc" : highlighted ? "rgba(255,255,255,0.86)" : colors.muted;
20
+ return (_jsxs(Stack, { className: interactiveClassName, component: dark ? "section" : "div", "aria-label": dark ? ((_a = plan.accessibleLabel) !== null && _a !== void 0 ? _a : (typeof plan.label === "string" ? plan.label : plan.id)) : undefined, spacing: dark ? 2 : 2.25, sx: {
21
+ bgcolor: dark ? (highlighted ? "#27204d" : "#151327") : highlighted ? colors.accent : "#FFFFFF",
22
+ boxShadow: dark ? "none" : highlighted
21
23
  ? "0 8px 18px rgba(23, 106, 168, 0.22)"
22
24
  : "none",
23
- color: highlighted ? "#FFFFFF" : colors.text,
24
- minHeight: { md: 430 },
25
- p: { xs: 2.5, sm: 3 },
25
+ color: dark || highlighted ? "#f5efff" : colors.text,
26
+ minHeight: { md: dark ? 520 : 430 },
27
+ p: dark ? { xs: 2.5, md: 4 } : { xs: 2.5, sm: 3 },
26
28
  position: "relative",
27
- borderRadius: 2,
28
- ...(highlighted
29
+ borderRadius: dark ? 2.5 : 2,
30
+ ...(dark ? { border: highlighted ? "1px solid #b56ef3" : "1px solid #49405e" } : highlighted
29
31
  ? {}
30
32
  : { 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: {
33
+ ...(!dark && { "&:hover": {
34
+ ...(highlighted
35
+ ? { boxShadow: "0 10px 22px rgba(23, 106, 168, 0.28)" }
36
+ : { bgcolor: "#FCFEFF" }),
37
+ transform: "translateY(-2px)",
38
+ } }),
39
+ }, children: [_jsxs(Stack, { direction: "row", spacing: 1, sx: { justifyContent: "space-between" }, children: [_jsx(Typography, { component: dark ? "h2" : "p", sx: { fontSize: dark ? { xs: 26, md: 34 } : 21, fontWeight: 780 }, children: plan.label }), plan.badge] }), _jsx(Typography, { sx: {
38
40
  color: secondary,
39
- fontSize: 14,
41
+ fontSize: dark ? { xs: 15, md: 17 } : 14,
40
42
  lineHeight: 1.5,
41
43
  minHeight: { md: 42 },
42
- }, children: plan.description }), _jsxs(Stack, { spacing: 0.25, children: [_jsx(Typography, { sx: {
43
- fontSize: { xs: 25, sm: 28 },
44
+ }, children: plan.description }), _jsxs(Stack, { direction: dark ? "row" : "column", spacing: dark ? 1 : 0.25, sx: dark ? { alignItems: "baseline", flexWrap: "wrap" } : undefined, children: [_jsx(Typography, { sx: {
45
+ fontSize: dark ? { xs: 36, md: 56 } : { xs: 25, sm: 28 },
44
46
  fontWeight: 780,
45
47
  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
+ }, children: plan.price }), _jsx(Typography, { sx: { color: secondary, fontSize: dark ? { xs: 15, md: 18 } : 13 }, children: plan.priceNote })] }), dark && _jsx(Box, { "aria-hidden": "true", sx: { borderTop: "1px solid #514761" } }), _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, { "aria-hidden": "true", sx: {
49
+ color: dark ? "#d5b3f9" : highlighted ? "#FFFFFF" : colors.accentDark,
48
50
  fontSize: 18,
49
51
  mt: "2px",
50
- } }), _jsx(Typography, { sx: { fontSize: 14, lineHeight: 1.45 }, children: feature })] }, index))) }), _jsx(Box, { sx: { flex: 1 } }), plan.action] }, plan.id));
52
+ } }), _jsx(Typography, { sx: { fontSize: dark ? { xs: 15, md: 18 } : 14, lineHeight: 1.45 }, children: feature })] }, index))) }), _jsx(Box, { sx: { flex: 1 } }), plan.action] }, plan.id));
51
53
  }) }));
52
54
  }
@@ -0,0 +1,5 @@
1
+ import { type StackProps } from "@mui/material";
2
+ /** Keep each label close to its value and separate neighboring fields. */
3
+ export declare const METADATA_FIELD_LABEL_SPACING = 0.25;
4
+ export declare const METADATA_FIELD_GROUP_SPACING = 2.5;
5
+ export declare function MetadataFieldGroup(props: StackProps): import("react").JSX.Element;
@@ -1,7 +1,23 @@
1
1
  import type { ReactNode } from "react";
2
+ export declare const metadataFieldLabelSx: {
3
+ readonly color: "text.secondary";
4
+ readonly fontSize: "0.75rem";
5
+ readonly fontWeight: 700;
6
+ readonly letterSpacing: "0.04em";
7
+ readonly lineHeight: 1.2;
8
+ readonly textTransform: "uppercase";
9
+ };
10
+ export declare const metadataValueRowSx: {
11
+ readonly alignItems: "center";
12
+ readonly borderBottom: 1;
13
+ readonly borderColor: "divider";
14
+ readonly minHeight: 40;
15
+ readonly minWidth: 0;
16
+ };
2
17
  /** Compact label/value row; consumers own actions, wording and persistence. */
3
- export declare function MetadataValueField({ label, children, actions, }: {
18
+ export type MetadataValueFieldProps = {
4
19
  label: ReactNode;
5
20
  children: ReactNode;
6
21
  actions?: ReactNode;
7
- }): import("react").JSX.Element;
22
+ };
23
+ export declare function MetadataValueField({ label, children, actions, }: MetadataValueFieldProps): import("react").JSX.Element;
@@ -1,8 +1,9 @@
1
1
  /** Shared trailing action for search text fields; typing never starts a lookup. */
2
- export declare function SearchInputAction({ label, loadingLabel, loading, disabled, onSearch, }: {
2
+ export type SearchInputActionProps = {
3
3
  label: string;
4
4
  loadingLabel: string;
5
5
  loading?: boolean;
6
6
  disabled?: boolean;
7
7
  onSearch: () => void;
8
- }): import("react").JSX.Element;
8
+ };
9
+ export declare function SearchInputAction({ label, loadingLabel, loading, disabled, onSearch, }: SearchInputActionProps): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ /** A neutral marker; the host decides which types have templates. */
2
+ export type TemplateBadgeProps = {
3
+ label?: string;
4
+ };
5
+ export declare function TemplateBadge({ label }: TemplateBadgeProps): import("react").JSX.Element;
@@ -22,11 +22,12 @@ export type VenueSearchCopy = {
22
22
  noResults: string;
23
23
  failure: string;
24
24
  };
25
- export declare function VenueSearchDialog({ placeName, canSearch, searchVenues, copy, onClose, onChange, }: {
25
+ export type VenueSearchDialogProps = {
26
26
  placeName?: string;
27
27
  canSearch?: boolean;
28
28
  searchVenues: (query: string) => Promise<VenueSuggestion[]>;
29
29
  copy?: Partial<VenueSearchCopy>;
30
30
  onClose: () => void;
31
31
  onChange: (pin: GoogleVenueReference) => void;
32
- }): import("react").JSX.Element;
32
+ };
33
+ export declare function VenueSearchDialog({ placeName, canSearch, searchVenues, copy, onClose, onChange, }: VenueSearchDialogProps): import("react").JSX.Element;
@@ -1,4 +1,6 @@
1
- export { VenueSearchDialog, type VenueSuggestion, type VenueSearchCopy, type GoogleVenueReference, } from "./VenueSearchDialog.js";
2
- export { SearchInputAction } from "./SearchInputAction.js";
3
- export { MetadataValueField } from "./MetadataValueField.js";
1
+ export { VenueSearchDialog, type VenueSuggestion, type VenueSearchCopy, type VenueSearchDialogProps, type GoogleVenueReference, } from "./VenueSearchDialog.js";
2
+ export { SearchInputAction, type SearchInputActionProps, } from "./SearchInputAction.js";
3
+ export { MetadataValueField, metadataFieldLabelSx, metadataValueRowSx, type MetadataValueFieldProps, } from "./MetadataValueField.js";
4
4
  export { GeographicLocationField, type GeographicLocationFieldProps, type GeographicLocationCopy, } from "./GeographicLocationField.js";
5
+ export { TemplateBadge, type TemplateBadgeProps } from "./TemplateBadge.js";
6
+ export { MetadataFieldGroup, METADATA_FIELD_GROUP_SPACING, METADATA_FIELD_LABEL_SPACING, } from "./MetadataFieldGroup.js";
@@ -9,10 +9,13 @@ export type PricingTablePlan = {
9
9
  badge?: ReactNode;
10
10
  action?: ReactNode;
11
11
  highlighted?: boolean;
12
+ /** Overrides the section name; defaults to the text label or plan ID. */
13
+ accessibleLabel?: string;
12
14
  };
13
15
  export type PricingTableProps = {
14
16
  label: string;
15
17
  plans: readonly PricingTablePlan[];
18
+ appearance?: "default" | "darkComparison";
16
19
  className?: string;
17
20
  interactiveClassName?: string;
18
21
  colors: {
@@ -22,4 +25,4 @@ export type PricingTableProps = {
22
25
  muted: string;
23
26
  };
24
27
  };
25
- export declare function PricingTable({ label, plans, className, interactiveClassName, colors, }: PricingTableProps): import("react").JSX.Element;
28
+ export declare function PricingTable({ label, plans, className, interactiveClassName, colors, appearance, }: PricingTableProps): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bayonai/mui-design",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Shared Bayon AI Material UI theme, style recipes, and reusable design components.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -102,7 +102,7 @@
102
102
  },
103
103
  "devDependencies": {
104
104
  "typescript": "^5",
105
- "@bayonai/file-uploads": "file:../../vendor/bayonai-file-uploads-0.2.0-neutral.tgz",
105
+ "@bayonai/file-uploads": "0.2.1",
106
106
  "react": "19.3.1",
107
107
  "react-dom": "19.3.1",
108
108
  "react-test-renderer": "19.3.1",