@flipdish/ui-library 0.48.3 → 0.49.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 (34) hide show
  1. package/dist/components/templates/PageHubLayout/components/PageHubLayoutSectionNav.cjs +26 -0
  2. package/dist/components/templates/PageHubLayout/components/PageHubLayoutSectionNav.cjs.map +1 -0
  3. package/dist/components/templates/PageHubLayout/components/PageHubLayoutSectionNav.d.ts +20 -0
  4. package/dist/components/templates/PageHubLayout/components/PageHubLayoutSectionNav.d.ts.map +1 -0
  5. package/dist/components/templates/PageHubLayout/components/PageHubLayoutSectionNav.js +24 -0
  6. package/dist/components/templates/PageHubLayout/components/PageHubLayoutSectionNav.js.map +1 -0
  7. package/dist/components/templates/PageHubLayout/index.cjs +65 -0
  8. package/dist/components/templates/PageHubLayout/index.cjs.map +1 -0
  9. package/dist/components/templates/PageHubLayout/index.d.ts +56 -0
  10. package/dist/components/templates/PageHubLayout/index.d.ts.map +1 -0
  11. package/dist/components/templates/PageHubLayout/index.js +63 -0
  12. package/dist/components/templates/PageHubLayout/index.js.map +1 -0
  13. package/dist/components/templates/PageHubLayout/pageHubLayout.types.d.ts +20 -0
  14. package/dist/components/templates/PageHubLayout/pageHubLayout.types.d.ts.map +1 -0
  15. package/dist/components/templates/PageHubLayout/pageHubLayout.utils.cjs +27 -0
  16. package/dist/components/templates/PageHubLayout/pageHubLayout.utils.cjs.map +1 -0
  17. package/dist/components/templates/PageHubLayout/pageHubLayout.utils.d.ts +21 -0
  18. package/dist/components/templates/PageHubLayout/pageHubLayout.utils.d.ts.map +1 -0
  19. package/dist/components/templates/PageHubLayout/pageHubLayout.utils.js +24 -0
  20. package/dist/components/templates/PageHubLayout/pageHubLayout.utils.js.map +1 -0
  21. package/dist/components/templates/PageLayout/index.cjs +7 -1
  22. package/dist/components/templates/PageLayout/index.cjs.map +1 -1
  23. package/dist/components/templates/PageLayout/index.d.ts +2 -1
  24. package/dist/components/templates/PageLayout/index.d.ts.map +1 -1
  25. package/dist/components/templates/PageLayout/index.js +7 -1
  26. package/dist/components/templates/PageLayout/index.js.map +1 -1
  27. package/dist/components/templates/WidgetLayout/index.cjs +7 -1
  28. package/dist/components/templates/WidgetLayout/index.cjs.map +1 -1
  29. package/dist/components/templates/WidgetLayout/index.d.ts +4 -1
  30. package/dist/components/templates/WidgetLayout/index.d.ts.map +1 -1
  31. package/dist/components/templates/WidgetLayout/index.js +7 -1
  32. package/dist/components/templates/WidgetLayout/index.js.map +1 -1
  33. package/dist/native/components/templates/PageHubLayout/index.d.ts +12 -0
  34. package/package.json +1 -1
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var Badge = require('@flipdish/ui-library/components/atoms/Badge');
5
+ var Tabs = require('@flipdish/ui-library/components/molecules/Tabs');
6
+ var cx = require('@flipdish/ui-library/utilities/cx');
7
+ var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
8
+ var reactAriaComponents = require('react-aria-components');
9
+
10
+ const PageHubLayoutSectionNavItem = ({ section, isSelected, onSelect, 'data-testid': testId }) => {
11
+ const itemClassName = ({ isHovered, isFocusVisible, isDisabled }) => cx.cx('flex h-max flex-1 cursor-pointer items-center justify-start text-left text-quaternary transition duration-100 ease-linear', Tabs.tabSizes.sm.base, Tabs.tabSizes.sm.line, Tabs.getTabStyles({ isSelected, isHovered, isFocusVisible }).line, isDisabled && 'cursor-not-allowed opacity-50');
12
+ const content = ({ isHovered }) => (jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [section.label, section.badge !== undefined && (jsxRuntime.jsx(Badge.Badge, { size: "sm", type: "pill-color", color: isHovered || isSelected ? 'brand' : 'gray', className: "-my-px transition-inherit-all", children: section.badge }))] }));
13
+ if (section.href) {
14
+ return (jsxRuntime.jsx(reactAriaComponents.Link, { href: section.href, isDisabled: section.isDisabled, "aria-current": isSelected ? 'page' : undefined, className: itemClassName, "data-testid": testId, children: content }));
15
+ }
16
+ return (jsxRuntime.jsx(reactAriaComponents.Button, { isDisabled: section.isDisabled, "aria-current": isSelected ? 'true' : undefined, className: itemClassName, onPress: () => onSelect(section.id), "data-testid": testId, children: content }));
17
+ };
18
+ /**
19
+ * Desktop section list for `PageHubLayout`, styled via the Tabs `line` class maps but rendered as a
20
+ * `<nav>` rather than a `tablist`: sections are routes or page-level views, and a `tab` would point
21
+ * `aria-controls` at a `tabpanel` this list does not own.
22
+ */
23
+ const PageHubLayoutSectionNav = ({ sections, selectedSection, onSelect, 'aria-label': ariaLabel, className, 'data-testid': testId, }) => (jsxRuntime.jsx("nav", { "aria-label": ariaLabel, "data-testid": testId, className: cx.cx('shrink-0', className), children: jsxRuntime.jsx("ul", { className: "flex w-max max-w-60 flex-col gap-2", children: sections.map((section) => (jsxRuntime.jsx("li", { className: "flex", children: jsxRuntime.jsx(PageHubLayoutSectionNavItem, { section: section, isSelected: section.id === selectedSection, onSelect: onSelect, "data-testid": testIdUtils.joinTestId(testId, `section-${testIdUtils.slugifyTestId(section.id)}`) }) }, section.id))) }) }));
24
+
25
+ exports.PageHubLayoutSectionNav = PageHubLayoutSectionNav;
26
+ //# sourceMappingURL=PageHubLayoutSectionNav.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageHubLayoutSectionNav.cjs","sources":["../../../../../src/components/templates/PageHubLayout/components/PageHubLayoutSectionNav.tsx"],"sourcesContent":[null],"names":["cx","tabSizes","getTabStyles","_jsxs","_jsx","Badge","AriaLink","AriaButton","joinTestId","slugifyTestId"],"mappings":";;;;;;;;;AAiCA,MAAM,2BAA2B,GAAG,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAoC,KAAI;IACjI,MAAM,aAAa,GAAG,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAoB,KAChFA,KAAE,CACA,2HAA2H,EAC3HC,aAAQ,CAAC,EAAE,CAAC,IAAI,EAChBA,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EACT,aAAa,EAAE,MAAM,GACQ,MAC7BH,cAAA,CAAA,KAAA,EAAA,EAAA,YAAA,EAAiB,SAAS,EAAA,aAAA,EAAe,MAAM,EAAE,SAAS,EAAEJ,KAAE,CAAC,UAAU,EAAE,SAAS,CAAC,EAAA,QAAA,EAEnFI,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,YAC/C,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,MACpBA,cAAA,CAAA,IAAA,EAAA,EAAqB,SAAS,EAAC,MAAM,EAAA,QAAA,EACnCA,cAAA,CAAC,2BAA2B,EAAA,EAC1B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,OAAO,CAAC,EAAE,KAAK,eAAe,EAC1C,QAAQ,EAAE,QAAQ,iBACLI,sBAAU,CAAC,MAAM,EAAE,CAAA,QAAA,EAAWC,yBAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAE,CAAC,EAAA,CACvE,EAAA,EANK,OAAO,CAAC,EAAE,CAOd,CACN,CAAC,EAAA,CACC,EAAA,CACD;;"}
@@ -0,0 +1,20 @@
1
+ import type { PageHubLayoutSection } from '../pageHubLayout.types';
2
+ interface PageHubLayoutSectionNavProps {
3
+ sections: PageHubLayoutSection[];
4
+ /** Id of the section whose content is showing. */
5
+ selectedSection: string | undefined;
6
+ /** Called with the id of a pressed section that has no `href`. */
7
+ onSelect: (id: string) => void;
8
+ /** Accessible name for the `<nav>` landmark. */
9
+ 'aria-label': string;
10
+ className?: string;
11
+ 'data-testid': string;
12
+ }
13
+ /**
14
+ * Desktop section list for `PageHubLayout`, styled via the Tabs `line` class maps but rendered as a
15
+ * `<nav>` rather than a `tablist`: sections are routes or page-level views, and a `tab` would point
16
+ * `aria-controls` at a `tabpanel` this list does not own.
17
+ */
18
+ export declare const PageHubLayoutSectionNav: ({ sections, selectedSection, onSelect, "aria-label": ariaLabel, className, "data-testid": testId, }: PageHubLayoutSectionNavProps) => import("react").JSX.Element;
19
+ export {};
20
+ //# sourceMappingURL=PageHubLayoutSectionNav.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageHubLayoutSectionNav.d.ts","sourceRoot":"","sources":["../../../../../src/components/templates/PageHubLayout/components/PageHubLayoutSectionNav.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,UAAU,4BAA4B;IACpC,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IACjC,kDAAkD;IAClD,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,kEAAkE;IAClE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AA+DD;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,qGAOrC,4BAA4B,gCAgB9B,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { Badge } from '@flipdish/ui-library/components/atoms/Badge';
3
+ import { tabSizes, getTabStyles } from '@flipdish/ui-library/components/molecules/Tabs';
4
+ import { cx } from '@flipdish/ui-library/utilities/cx';
5
+ import { joinTestId, slugifyTestId } from '@flipdish/ui-library/utilities/testIdUtils';
6
+ import { Link, Button } from 'react-aria-components';
7
+
8
+ const PageHubLayoutSectionNavItem = ({ section, isSelected, onSelect, 'data-testid': testId }) => {
9
+ const itemClassName = ({ isHovered, isFocusVisible, isDisabled }) => cx('flex h-max flex-1 cursor-pointer items-center justify-start text-left text-quaternary transition duration-100 ease-linear', tabSizes.sm.base, tabSizes.sm.line, getTabStyles({ isSelected, isHovered, isFocusVisible }).line, isDisabled && 'cursor-not-allowed opacity-50');
10
+ const content = ({ isHovered }) => (jsxs("span", { className: "flex items-center gap-1.5", children: [section.label, section.badge !== undefined && (jsx(Badge, { size: "sm", type: "pill-color", color: isHovered || isSelected ? 'brand' : 'gray', className: "-my-px transition-inherit-all", children: section.badge }))] }));
11
+ if (section.href) {
12
+ return (jsx(Link, { href: section.href, isDisabled: section.isDisabled, "aria-current": isSelected ? 'page' : undefined, className: itemClassName, "data-testid": testId, children: content }));
13
+ }
14
+ return (jsx(Button, { isDisabled: section.isDisabled, "aria-current": isSelected ? 'true' : undefined, className: itemClassName, onPress: () => onSelect(section.id), "data-testid": testId, children: content }));
15
+ };
16
+ /**
17
+ * Desktop section list for `PageHubLayout`, styled via the Tabs `line` class maps but rendered as a
18
+ * `<nav>` rather than a `tablist`: sections are routes or page-level views, and a `tab` would point
19
+ * `aria-controls` at a `tabpanel` this list does not own.
20
+ */
21
+ const PageHubLayoutSectionNav = ({ sections, selectedSection, onSelect, 'aria-label': ariaLabel, className, 'data-testid': testId, }) => (jsx("nav", { "aria-label": ariaLabel, "data-testid": testId, className: cx('shrink-0', className), children: jsx("ul", { className: "flex w-max max-w-60 flex-col gap-2", children: sections.map((section) => (jsx("li", { className: "flex", children: jsx(PageHubLayoutSectionNavItem, { section: section, isSelected: section.id === selectedSection, onSelect: onSelect, "data-testid": joinTestId(testId, `section-${slugifyTestId(section.id)}`) }) }, section.id))) }) }));
22
+
23
+ export { PageHubLayoutSectionNav };
24
+ //# sourceMappingURL=PageHubLayoutSectionNav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageHubLayoutSectionNav.js","sources":["../../../../../src/components/templates/PageHubLayout/components/PageHubLayoutSectionNav.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx","AriaLink","AriaButton"],"mappings":";;;;;;;AAiCA,MAAM,2BAA2B,GAAG,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAoC,KAAI;IACjI,MAAM,aAAa,GAAG,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAoB,KAChF,EAAE,CACA,2HAA2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QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,SAAS,EACT,aAAa,EAAE,MAAM,GACQ,MAC7BF,GAAA,CAAA,KAAA,EAAA,EAAA,YAAA,EAAiB,SAAS,EAAA,aAAA,EAAe,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,EAAA,QAAA,EAEnFA,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,YAC/C,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,MACpBA,GAAA,CAAA,IAAA,EAAA,EAAqB,SAAS,EAAC,MAAM,EAAA,QAAA,EACnCA,GAAA,CAAC,2BAA2B,EAAA,EAC1B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,OAAO,CAAC,EAAE,KAAK,eAAe,EAC1C,QAAQ,EAAE,QAAQ,iBACL,UAAU,CAAC,MAAM,EAAE,CAAA,QAAA,EAAW,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAE,CAAC,EAAA,CACvE,EAAA,EANK,OAAO,CAAC,EAAE,CAOd,CACN,CAAC,EAAA,CACC,EAAA,CACD;;"}
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var Skeleton = require('@flipdish/ui-library/components/atoms/Skeleton');
5
+ var Select = require('@flipdish/ui-library/components/molecules/Select');
6
+ var PageLayout = require('@flipdish/ui-library/components/templates/PageLayout');
7
+ var ErrorBoundary = require('@flipdish/ui-library/providers/ErrorBoundary');
8
+ var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
9
+ var React = require('react');
10
+ var PageHubLayoutSectionNav = require('./components/PageHubLayoutSectionNav.cjs');
11
+ var pageHubLayout_utils = require('./pageHubLayout.utils.cjs');
12
+
13
+ /** English fallback copy — consumers localise via `renderError`. TODO(i18n): source from ui-library's translation layer once one exists. */
14
+ const DefaultSectionError = ({ testId }) => (jsxRuntime.jsxs("div", { role: "alert", "data-testid": testId, className: "flex w-full flex-col items-center gap-2 py-2xl text-center", children: [jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-primary", children: "Something went wrong" }), jsxRuntime.jsx("p", { className: "text-md text-tertiary", children: "An unexpected error occurred while loading this section." })] }));
15
+ /** English status copy — consumers localise via `sectionFallback`. TODO(i18n): source from ui-library's translation layer once one exists. */
16
+ const DEFAULT_SECTION_LOADING_TEXT = 'Loading section';
17
+ const DefaultSectionFallback = ({ testId, onShownChange }) => {
18
+ React.useEffect(() => {
19
+ onShownChange(true);
20
+ return () => onShownChange(false);
21
+ }, [onShownChange]);
22
+ return (jsxRuntime.jsxs("div", { "aria-busy": "true", "data-testid": testId, className: "flex w-full flex-col gap-4", children: [jsxRuntime.jsx(Skeleton.Skeleton, { width: "40%", height: 20 }), jsxRuntime.jsx(Skeleton.SkeletonText, { lines: 4 })] }));
23
+ };
24
+ /** Runs `render` as a component, so a throw lands in the section boundary rather than in the layout's own render. */
25
+ const PageHubLayoutSectionContent = ({ render }) => render();
26
+ /**
27
+ * Page template for a hub of sections: a `PageLayout` whose content is a section navigation beside
28
+ * the selected section, each section rendered from config inside its own error and Suspense boundary. Reach for
29
+ * it instead of `PageLayout` when one page hosts several feature areas picked from a left-hand list,
30
+ * such as a settings hub; the list becomes a select below `lg`.
31
+ *
32
+ * @summary page template with section navigation and content
33
+ */
34
+ const PageHubLayout = ({ pageName, sections, navigationLabel, selectedSection, defaultSelectedSection, onSectionChange, sectionFallback, renderError, onError, 'data-testid': dataTestId, ...pageLayoutProps }) => {
35
+ const pageHubLayoutTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'page-hub-layout', rootName: 'page-hub-layout' });
36
+ // Uncontrolled fallback so the desktop navigation and the mobile select always agree on the selection.
37
+ const [internalSelectedSection, setInternalSelectedSection] = React.useState(defaultSelectedSection);
38
+ const [isDefaultFallbackShown, setIsDefaultFallbackShown] = React.useState(false);
39
+ const activeSection = pageHubLayout_utils.resolveSelectedSection(sections, selectedSection ?? internalSelectedSection);
40
+ const selectSection = (id) => {
41
+ setInternalSelectedSection(id);
42
+ // Re-picking the current section is not a change; the select already ignores it, so the navigation does too.
43
+ if (id !== activeSection?.id)
44
+ onSectionChange?.(id);
45
+ };
46
+ const selectFromSelect = (key) => {
47
+ const pickedId = pageHubLayout_utils.resolvePickedSectionId(sections, key);
48
+ if (pickedId !== undefined)
49
+ selectSection(pickedId);
50
+ };
51
+ return (jsxRuntime.jsx(PageLayout.PageLayout, { ...pageLayoutProps, pageName: pageName, renderError: renderError, onError: onError, "data-testid": pageHubLayoutTestId, children: jsxRuntime.jsxs("div", { className: "flex w-full flex-col gap-md lg:flex-row lg:items-start", children: [jsxRuntime.jsx(PageHubLayoutSectionNav.PageHubLayoutSectionNav, { className: "max-lg:hidden", sections: sections, selectedSection: activeSection?.id, onSelect: selectSection, "aria-label": navigationLabel, "data-testid": testIdUtils.joinTestId(pageHubLayoutTestId, 'sections') }), jsxRuntime.jsx(Select.Select, { className: "w-full lg:hidden", size: "md", "aria-label": navigationLabel, value: activeSection?.id ?? null, onChange: selectFromSelect, "data-testid": testIdUtils.joinTestId(pageHubLayoutTestId, 'sections-select'), children: sections.map((section) => (
52
+ // Spread, not `href={section.href}`: react-aria copies an `href` key that is present but undefined onto the option as `href=""`.
53
+ jsxRuntime.jsx(Select.Select.Item, { id: section.id, label: section.label, isDisabled: section.isDisabled, ...(section.href ? { href: section.href } : {}) }, section.id))) }), jsxRuntime.jsxs("div", { "data-testid": testIdUtils.joinTestId(pageHubLayoutTestId, 'content'), className: "w-full min-w-0 flex-1", children: [jsxRuntime.jsx("output", { className: "sr-only", children: isDefaultFallbackShown ? DEFAULT_SECTION_LOADING_TEXT : '' }), activeSection && (
54
+ // Keyed by section so a section that threw is replaced, not left showing its fallback, when the user moves on.
55
+ jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, { identifier: `${pageName}/${activeSection.id}`, onError: onError, renderFallback: (error) => {
56
+ // `undefined`, not nullish: an explicit `null` from `renderError` is honoured as "render nothing".
57
+ const customFallback = renderError?.({ error, pageName, sectionId: activeSection.id });
58
+ if (customFallback !== undefined)
59
+ return customFallback;
60
+ return jsxRuntime.jsx(DefaultSectionError, { testId: testIdUtils.joinTestId(pageHubLayoutTestId, 'section-error') });
61
+ }, children: jsxRuntime.jsx(React.Suspense, { fallback: sectionFallback !== undefined ? (sectionFallback) : (jsxRuntime.jsx(DefaultSectionFallback, { testId: testIdUtils.joinTestId(pageHubLayoutTestId, 'section-loading'), onShownChange: setIsDefaultFallbackShown })), children: jsxRuntime.jsx(PageHubLayoutSectionContent, { render: activeSection.render }) }) }, activeSection.id))] })] }) }));
62
+ };
63
+
64
+ exports.PageHubLayout = PageHubLayout;
65
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../../src/components/templates/PageHubLayout/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx","useEffect","Skeleton","SkeletonText","useResolvedTestId","useState","resolveSelectedSection","resolvePickedSectionId","PageLayout","PageHubLayoutSectionNav","joinTestId","Select","ErrorBoundary","Suspense"],"mappings":";;;;;;;;;;;;AAsDA;AACA,MAAM,mBAAmB,GAAG,CAAC,EAAE,MAAM,EAAuB,MAC1DA,eAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,iBAAc,MAAM,EAAE,SAAS,EAAC,4DAA4D,EAAA,QAAA,EAAA,CAC3GC,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,EAAA,QAAA,EAAA,sBAAA,EAAA,CAA0B,EAC5EA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAA,0DAAA,EAAA,CAA6D,CAAA,EAAA,CAC7F,CACP;AAED;AACA,MAAM,4BAA4B,GAAG,iBAAiB;AAQtD,MAAM,sBAAsB,GAAG,CAAC,EAAE,MAAM,EAAE,aAAa,EAA+B,KAAe;IACnGC,eAAS,CAA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AAA,EAAA,CACF,EAAA,CACK;AAEjB;;"}
@@ -0,0 +1,56 @@
1
+ import { type PageLayoutProps } from '@flipdish/ui-library/components/templates/PageLayout';
2
+ import type { ReactNode } from 'react';
3
+ import type { PageHubLayoutSection } from './pageHubLayout.types';
4
+ export type { PageHubLayoutSection } from './pageHubLayout.types';
5
+ export interface PageHubLayoutProps extends Omit<PageLayoutProps, 'children' | 'renderError' | 'data-testid'> {
6
+ /**
7
+ * The hub's sections, in navigation order. Each one is an entry in the section navigation and a
8
+ * `render` for its content; only the selected section's `render` runs.
9
+ */
10
+ sections: PageHubLayoutSection[];
11
+ /**
12
+ * Accessible name for the section navigation and its mobile select, e.g. "Settings sections". Must
13
+ * differ from the header's title, which already names the `PageHeader` tab navigation.
14
+ */
15
+ navigationLabel: string;
16
+ /**
17
+ * Controlled selected section id, usually read from the router. An id that matches no enabled
18
+ * section falls back to the first enabled one.
19
+ */
20
+ selectedSection?: string;
21
+ /** Initially selected section id (uncontrolled). Defaults to the first enabled section. */
22
+ defaultSelectedSection?: string;
23
+ /**
24
+ * Called with the section id when the user picks a different section that has no `href`, from the
25
+ * navigation or the mobile select. Re-picking the current section does not call it, and a section
26
+ * with `href` navigates as a link instead and never calls it.
27
+ */
28
+ onSectionChange?: (id: string) => void;
29
+ /**
30
+ * Shown in the content pane while the selected section suspends, such as a `React.lazy` section
31
+ * whose chunk is loading. Replaces the default skeleton; the header and navigation stay in place.
32
+ */
33
+ sectionFallback?: ReactNode;
34
+ /**
35
+ * Replaces the default fallback shown when content throws. Receives the thrown error, `pageName`
36
+ * and, when the selected section threw, its `sectionId`; without one the page-level boundary caught it.
37
+ * Return `null` to render nothing, or `undefined` to keep the default fallback.
38
+ */
39
+ renderError?: (props: {
40
+ error: Error;
41
+ pageName: string;
42
+ sectionId?: string;
43
+ }) => ReactNode;
44
+ /** Overrides the `data-testid` (defaults to `fd-page-hub-layout`). */
45
+ 'data-testid'?: string;
46
+ }
47
+ /**
48
+ * Page template for a hub of sections: a `PageLayout` whose content is a section navigation beside
49
+ * the selected section, each section rendered from config inside its own error and Suspense boundary. Reach for
50
+ * it instead of `PageLayout` when one page hosts several feature areas picked from a left-hand list,
51
+ * such as a settings hub; the list becomes a select below `lg`.
52
+ *
53
+ * @summary page template with section navigation and content
54
+ */
55
+ export declare const PageHubLayout: ({ pageName, sections, navigationLabel, selectedSection, defaultSelectedSection, onSectionChange, sectionFallback, renderError, onError, "data-testid": dataTestId, ...pageLayoutProps }: PageHubLayoutProps) => ReactNode;
56
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/PageHubLayout/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,sDAAsD,CAAC;AAGxG,OAAO,KAAK,EAAO,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGlE,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,aAAa,CAAC;IAC3G;;;OAGG;IACH,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IACjC;;;OAGG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2FAA2F;IAC3F,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;;;OAGG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IAC3F,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAoCD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,yLAY3B,kBAAkB,KAAG,SAmFvB,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { Skeleton, SkeletonText } from '@flipdish/ui-library/components/atoms/Skeleton';
3
+ import { Select } from '@flipdish/ui-library/components/molecules/Select';
4
+ import { PageLayout } from '@flipdish/ui-library/components/templates/PageLayout';
5
+ import { ErrorBoundary } from '@flipdish/ui-library/providers/ErrorBoundary';
6
+ import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
7
+ import { useState, Suspense, useEffect } from 'react';
8
+ import { PageHubLayoutSectionNav } from './components/PageHubLayoutSectionNav.js';
9
+ import { resolveSelectedSection, resolvePickedSectionId } from './pageHubLayout.utils.js';
10
+
11
+ /** English fallback copy — consumers localise via `renderError`. TODO(i18n): source from ui-library's translation layer once one exists. */
12
+ const DefaultSectionError = ({ testId }) => (jsxs("div", { role: "alert", "data-testid": testId, className: "flex w-full flex-col items-center gap-2 py-2xl text-center", children: [jsx("h2", { className: "text-lg font-semibold text-primary", children: "Something went wrong" }), jsx("p", { className: "text-md text-tertiary", children: "An unexpected error occurred while loading this section." })] }));
13
+ /** English status copy — consumers localise via `sectionFallback`. TODO(i18n): source from ui-library's translation layer once one exists. */
14
+ const DEFAULT_SECTION_LOADING_TEXT = 'Loading section';
15
+ const DefaultSectionFallback = ({ testId, onShownChange }) => {
16
+ useEffect(() => {
17
+ onShownChange(true);
18
+ return () => onShownChange(false);
19
+ }, [onShownChange]);
20
+ return (jsxs("div", { "aria-busy": "true", "data-testid": testId, className: "flex w-full flex-col gap-4", children: [jsx(Skeleton, { width: "40%", height: 20 }), jsx(SkeletonText, { lines: 4 })] }));
21
+ };
22
+ /** Runs `render` as a component, so a throw lands in the section boundary rather than in the layout's own render. */
23
+ const PageHubLayoutSectionContent = ({ render }) => render();
24
+ /**
25
+ * Page template for a hub of sections: a `PageLayout` whose content is a section navigation beside
26
+ * the selected section, each section rendered from config inside its own error and Suspense boundary. Reach for
27
+ * it instead of `PageLayout` when one page hosts several feature areas picked from a left-hand list,
28
+ * such as a settings hub; the list becomes a select below `lg`.
29
+ *
30
+ * @summary page template with section navigation and content
31
+ */
32
+ const PageHubLayout = ({ pageName, sections, navigationLabel, selectedSection, defaultSelectedSection, onSectionChange, sectionFallback, renderError, onError, 'data-testid': dataTestId, ...pageLayoutProps }) => {
33
+ const pageHubLayoutTestId = useResolvedTestId({ testId: dataTestId, segment: 'page-hub-layout', rootName: 'page-hub-layout' });
34
+ // Uncontrolled fallback so the desktop navigation and the mobile select always agree on the selection.
35
+ const [internalSelectedSection, setInternalSelectedSection] = useState(defaultSelectedSection);
36
+ const [isDefaultFallbackShown, setIsDefaultFallbackShown] = useState(false);
37
+ const activeSection = resolveSelectedSection(sections, selectedSection ?? internalSelectedSection);
38
+ const selectSection = (id) => {
39
+ setInternalSelectedSection(id);
40
+ // Re-picking the current section is not a change; the select already ignores it, so the navigation does too.
41
+ if (id !== activeSection?.id)
42
+ onSectionChange?.(id);
43
+ };
44
+ const selectFromSelect = (key) => {
45
+ const pickedId = resolvePickedSectionId(sections, key);
46
+ if (pickedId !== undefined)
47
+ selectSection(pickedId);
48
+ };
49
+ return (jsx(PageLayout, { ...pageLayoutProps, pageName: pageName, renderError: renderError, onError: onError, "data-testid": pageHubLayoutTestId, children: jsxs("div", { className: "flex w-full flex-col gap-md lg:flex-row lg:items-start", children: [jsx(PageHubLayoutSectionNav, { className: "max-lg:hidden", sections: sections, selectedSection: activeSection?.id, onSelect: selectSection, "aria-label": navigationLabel, "data-testid": joinTestId(pageHubLayoutTestId, 'sections') }), jsx(Select, { className: "w-full lg:hidden", size: "md", "aria-label": navigationLabel, value: activeSection?.id ?? null, onChange: selectFromSelect, "data-testid": joinTestId(pageHubLayoutTestId, 'sections-select'), children: sections.map((section) => (
50
+ // Spread, not `href={section.href}`: react-aria copies an `href` key that is present but undefined onto the option as `href=""`.
51
+ jsx(Select.Item, { id: section.id, label: section.label, isDisabled: section.isDisabled, ...(section.href ? { href: section.href } : {}) }, section.id))) }), jsxs("div", { "data-testid": joinTestId(pageHubLayoutTestId, 'content'), className: "w-full min-w-0 flex-1", children: [jsx("output", { className: "sr-only", children: isDefaultFallbackShown ? DEFAULT_SECTION_LOADING_TEXT : '' }), activeSection && (
52
+ // Keyed by section so a section that threw is replaced, not left showing its fallback, when the user moves on.
53
+ jsx(ErrorBoundary, { identifier: `${pageName}/${activeSection.id}`, onError: onError, renderFallback: (error) => {
54
+ // `undefined`, not nullish: an explicit `null` from `renderError` is honoured as "render nothing".
55
+ const customFallback = renderError?.({ error, pageName, sectionId: activeSection.id });
56
+ if (customFallback !== undefined)
57
+ return customFallback;
58
+ return jsx(DefaultSectionError, { testId: joinTestId(pageHubLayoutTestId, 'section-error') });
59
+ }, children: jsx(Suspense, { fallback: sectionFallback !== undefined ? (sectionFallback) : (jsx(DefaultSectionFallback, { testId: joinTestId(pageHubLayoutTestId, 'section-loading'), onShownChange: setIsDefaultFallbackShown })), children: jsx(PageHubLayoutSectionContent, { render: activeSection.render }) }) }, activeSection.id))] })] }) }));
60
+ };
61
+
62
+ export { PageHubLayout };
63
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/templates/PageHubLayout/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;AAsDA;AACA,MAAM,mBAAmB,GAAG,CAAC,EAAE,MAAM,EAAuB,MAC1DA,IAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,iBAAc,MAAM,EAAE,SAAS,EAAC,4DAA4D,EAAA,QAAA,EAAA,CAC3GC,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EA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AAC,MAAM,EAAE,UAAU,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,EAAE,aAAa,EAAE,yBAAyB,EAAA,CAAI,CACjI,EAAA,QAAA,EAGHA,GAAA,CAAC,2BAA2B,EAAA,EAAC,MAAM,EAAE,aAAa,CAAC,MAAM,EAAA,CAAI,EAAA,CACpD,EAAA,EApBN,aAAa,CAAC,EAAE,CAqBP,CACjB,CAAA,EAAA,CACG,CAAA,EAAA,CACF,EAAA,CACK;AAEjB;;"}
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface PageHubLayoutSection {
3
+ /** Stable identifier, matched against `selectedSection`, passed to `onSectionChange` and used in the derived `data-testid`. */
4
+ id: string;
5
+ /** Visible label in the section navigation and in the mobile select. */
6
+ label: string;
7
+ /** Optional count/status badge shown after the label (desktop only). */
8
+ badge?: number | string;
9
+ /**
10
+ * Makes the section a route: the desktop item and the mobile select option render as links to this
11
+ * URL, with `aria-current="page"` on the selected desktop item. Drive `selectedSection` from the
12
+ * router, since a link never calls `onSectionChange`.
13
+ */
14
+ href?: string;
15
+ /** Prevents the section from being selected. */
16
+ isDisabled?: boolean;
17
+ /** Returns the section's content. Called only while the section is selected, inside its own error boundary. */
18
+ render: () => ReactNode;
19
+ }
20
+ //# sourceMappingURL=pageHubLayout.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageHubLayout.types.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/PageHubLayout/pageHubLayout.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,oBAAoB;IACnC,+HAA+H;IAC/H,EAAE,EAAE,MAAM,CAAC;IACX,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+GAA+G;IAC/G,MAAM,EAAE,MAAM,SAAS,CAAC;CACzB"}
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Resolves an option picked in the mobile select to a section the layout selects itself. Arrow keys and typeahead on
5
+ * the closed select pick an option directly, skipping a link option's navigation, so a routed section is left to its link.
6
+ *
7
+ * @param sections The hub's sections, in navigation order.
8
+ * @param key The key the select reported; `null` when it has no selection.
9
+ * @returns The id of the matching section when it has no `href`, else `undefined`.
10
+ */
11
+ const resolvePickedSectionId = (sections, key) => {
12
+ const section = sections.find((candidate) => candidate.id === key);
13
+ return section && !section.href ? section.id : undefined;
14
+ };
15
+ /**
16
+ * Picks the section a hub renders, so a stale or disabled id (an old bookmark, a section the user lost
17
+ * access to) lands on a usable section instead of an empty page.
18
+ *
19
+ * @param sections The hub's sections, in navigation order.
20
+ * @param selectedId The requested section id, from the router or the hub's own state; may match nothing.
21
+ * @returns The enabled section with that id, else the first enabled section, else `undefined` when none is enabled.
22
+ */
23
+ const resolveSelectedSection = (sections, selectedId) => sections.find((section) => section.id === selectedId && !section.isDisabled) ?? sections.find((section) => !section.isDisabled);
24
+
25
+ exports.resolvePickedSectionId = resolvePickedSectionId;
26
+ exports.resolveSelectedSection = resolveSelectedSection;
27
+ //# sourceMappingURL=pageHubLayout.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageHubLayout.utils.cjs","sources":["../../../../src/components/templates/PageHubLayout/pageHubLayout.utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;;;;;;;AAOG;MACU,sBAAsB,GAAG,CAAC,QAAgC,EAAE,GAAe,KAAwB;AAC9G,IAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,EAAE,KAAK,GAAG,CAAC;AAClE,IAAA,OAAO,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS;AAC1D;AAEA;;;;;;;AAOG;MACU,sBAAsB,GAAG,CAAC,QAAgC,EAAE,UAA8B,KACrG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,EAAE,KAAK,UAAU,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU;;;"}
@@ -0,0 +1,21 @@
1
+ import type { Key } from 'react';
2
+ import type { PageHubLayoutSection } from './pageHubLayout.types';
3
+ /**
4
+ * Resolves an option picked in the mobile select to a section the layout selects itself. Arrow keys and typeahead on
5
+ * the closed select pick an option directly, skipping a link option's navigation, so a routed section is left to its link.
6
+ *
7
+ * @param sections The hub's sections, in navigation order.
8
+ * @param key The key the select reported; `null` when it has no selection.
9
+ * @returns The id of the matching section when it has no `href`, else `undefined`.
10
+ */
11
+ export declare const resolvePickedSectionId: (sections: PageHubLayoutSection[], key: Key | null) => string | undefined;
12
+ /**
13
+ * Picks the section a hub renders, so a stale or disabled id (an old bookmark, a section the user lost
14
+ * access to) lands on a usable section instead of an empty page.
15
+ *
16
+ * @param sections The hub's sections, in navigation order.
17
+ * @param selectedId The requested section id, from the router or the hub's own state; may match nothing.
18
+ * @returns The enabled section with that id, else the first enabled section, else `undefined` when none is enabled.
19
+ */
20
+ export declare const resolveSelectedSection: (sections: PageHubLayoutSection[], selectedId: string | undefined) => PageHubLayoutSection | undefined;
21
+ //# sourceMappingURL=pageHubLayout.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageHubLayout.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/PageHubLayout/pageHubLayout.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,UAAU,oBAAoB,EAAE,EAAE,KAAK,GAAG,GAAG,IAAI,KAAG,MAAM,GAAG,SAGnG,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,UAAU,oBAAoB,EAAE,EAAE,YAAY,MAAM,GAAG,SAAS,KAAG,oBAAoB,GAAG,SACA,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Resolves an option picked in the mobile select to a section the layout selects itself. Arrow keys and typeahead on
3
+ * the closed select pick an option directly, skipping a link option's navigation, so a routed section is left to its link.
4
+ *
5
+ * @param sections The hub's sections, in navigation order.
6
+ * @param key The key the select reported; `null` when it has no selection.
7
+ * @returns The id of the matching section when it has no `href`, else `undefined`.
8
+ */
9
+ const resolvePickedSectionId = (sections, key) => {
10
+ const section = sections.find((candidate) => candidate.id === key);
11
+ return section && !section.href ? section.id : undefined;
12
+ };
13
+ /**
14
+ * Picks the section a hub renders, so a stale or disabled id (an old bookmark, a section the user lost
15
+ * access to) lands on a usable section instead of an empty page.
16
+ *
17
+ * @param sections The hub's sections, in navigation order.
18
+ * @param selectedId The requested section id, from the router or the hub's own state; may match nothing.
19
+ * @returns The enabled section with that id, else the first enabled section, else `undefined` when none is enabled.
20
+ */
21
+ const resolveSelectedSection = (sections, selectedId) => sections.find((section) => section.id === selectedId && !section.isDisabled) ?? sections.find((section) => !section.isDisabled);
22
+
23
+ export { resolvePickedSectionId, resolveSelectedSection };
24
+ //# sourceMappingURL=pageHubLayout.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageHubLayout.utils.js","sources":["../../../../src/components/templates/PageHubLayout/pageHubLayout.utils.ts"],"sourcesContent":[null],"names":[],"mappings":"AAGA;;;;;;;AAOG;MACU,sBAAsB,GAAG,CAAC,QAAgC,EAAE,GAAe,KAAwB;AAC9G,IAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,EAAE,KAAK,GAAG,CAAC;AAClE,IAAA,OAAO,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS;AAC1D;AAEA;;;;;;;AAOG;MACU,sBAAsB,GAAG,CAAC,QAAgC,EAAE,UAA8B,KACrG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,EAAE,KAAK,UAAU,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU;;"}
@@ -18,7 +18,13 @@ const DefaultPageError = ({ testId }) => (jsxRuntime.jsxs("div", { role: "alert"
18
18
  */
19
19
  const PageLayout = ({ pageName, header, children, renderError, onError, className, 'data-testid': dataTestId, }) => {
20
20
  const pageLayoutTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'page-layout', rootName: 'page-layout' });
21
- return (jsxRuntime.jsxs("main", { "data-testid": pageLayoutTestId, className: cx.cx('flex w-full flex-col gap-md p-md lg:p-xl', className), children: [header, jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, { identifier: pageName, onError: onError, renderFallback: (error) => renderError?.({ error, pageName }) ?? jsxRuntime.jsx(DefaultPageError, { testId: testIdUtils.joinTestId(pageLayoutTestId, 'error') }), children: children })] }));
21
+ return (jsxRuntime.jsxs("main", { "data-testid": pageLayoutTestId, className: cx.cx('flex w-full flex-col gap-md p-md lg:p-xl', className), children: [header, jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, { identifier: pageName, onError: onError, renderFallback: (error) => {
22
+ // `undefined`, not nullish: an explicit `null` from `renderError` is honoured as "render nothing".
23
+ const customFallback = renderError?.({ error, pageName });
24
+ if (customFallback !== undefined)
25
+ return customFallback;
26
+ return jsxRuntime.jsx(DefaultPageError, { testId: testIdUtils.joinTestId(pageLayoutTestId, 'error') });
27
+ }, children: children })] }));
22
28
  };
23
29
 
24
30
  exports.PageLayout = PageLayout;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../src/components/templates/PageLayout/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx","useResolvedTestId","cx","ErrorBoundary","joinTestId"],"mappings":";;;;;;;AAmCA;AACA,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAuB,MACvDA,eAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,iBAAc,MAAM,EAAE,SAAS,EAAC,4DAA4D,EAAA,QAAA,EAAA,CAC3GC,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,EAAA,QAAA,EAAA,sBAAA,EAAA,CAA0B,EAC5EA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAA,uDAAA,EAAA,CAA0D,CAAA,EAAA,CAC1F,CACP;AAED;;;;;;;;AAQG;MACU,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,WAAW,EACX,OAAO,EACP,SAAS,EACT,aAAa,EAAE,UAAU,GACT,KAAe;AAC/B,IAAA,MAAM,gBAAgB,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAEnH,IAAA,QACEF,eAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAmB,gBAAgB,EAAE,SAAS,EAAEG,KAAE,CAAC,0CAA0C,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CACtG,MAAM,EAEPF,cAAA,CAACG,2BAAa,EAAA,EACZ,UAAU,EAAE,QAAQ,EACpB,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,KAAK,KAAK,WAAW,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,IAAIH,cAAA,CAAC,gBAAgB,EAAA,EAAC,MAAM,EAAEI,sBAAU,CAAC,gBAAgB,EAAE,OAAO,CAAC,EAAA,CAAI,EAAA,QAAA,EAEnI,QAAQ,EAAA,CACK,CAAA,EAAA,CACX;AAEX;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../src/components/templates/PageLayout/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx","useResolvedTestId","cx","ErrorBoundary","joinTestId"],"mappings":";;;;;;;AAoCA;AACA,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAuB,MACvDA,eAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,iBAAc,MAAM,EAAE,SAAS,EAAC,4DAA4D,EAAA,QAAA,EAAA,CAC3GC,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,EAAA,QAAA,EAAA,sBAAA,EAAA,CAA0B,EAC5EA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAA,uDAAA,EAAA,CAA0D,CAAA,EAAA,CAC1F,CACP;AAED;;;;;;;;AAQG;MACU,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,WAAW,EACX,OAAO,EACP,SAAS,EACT,aAAa,EAAE,UAAU,GACT,KAAe;AAC/B,IAAA,MAAM,gBAAgB,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAEnH,IAAA,QACEF,eAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAmB,gBAAgB,EAAE,SAAS,EAAEG,KAAE,CAAC,0CAA0C,EAAE,SAAS,CAAC,aACtG,MAAM,EAEPF,cAAA,CAACG,2BAAa,EAAA,EACZ,UAAU,EAAE,QAAQ,EACpB,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,KAAK,KAAI;;oBAExB,MAAM,cAAc,GAAG,WAAW,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;oBACzD,IAAI,cAAc,KAAK,SAAS;AAAE,wBAAA,OAAO,cAAc;AACvD,oBAAA,OAAOH,cAAA,CAAC,gBAAgB,EAAA,EAAC,MAAM,EAAEI,sBAAU,CAAC,gBAAgB,EAAE,OAAO,CAAC,EAAA,CAAI;AAC5E,gBAAA,CAAC,EAAA,QAAA,EAEA,QAAQ,EAAA,CACK,CAAA,EAAA,CACX;AAEX;;"}
@@ -16,7 +16,8 @@ export interface PageLayoutProps {
16
16
  children: ReactNode;
17
17
  /**
18
18
  * Replaces the default fallback shown when a child throws. Receives the thrown
19
- * error and `pageName` so consumers can render localised copy.
19
+ * error and `pageName` so consumers can render localised copy. Return `null` to
20
+ * render nothing, or `undefined` to keep the default fallback.
20
21
  */
21
22
  renderError?: (props: {
22
23
  error: Error;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/PageLayout/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,wDAAwD;IACxD,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IACvE,qFAAqF;IACrF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAClD,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAUD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GAAI,6FAQxB,eAAe,KAAG,SAgBpB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/PageLayout/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,wDAAwD;IACxD,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IACvE,qFAAqF;IACrF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAClD,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAUD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GAAI,6FAQxB,eAAe,KAAG,SAqBpB,CAAC"}
@@ -16,7 +16,13 @@ const DefaultPageError = ({ testId }) => (jsxs("div", { role: "alert", "data-tes
16
16
  */
17
17
  const PageLayout = ({ pageName, header, children, renderError, onError, className, 'data-testid': dataTestId, }) => {
18
18
  const pageLayoutTestId = useResolvedTestId({ testId: dataTestId, segment: 'page-layout', rootName: 'page-layout' });
19
- return (jsxs("main", { "data-testid": pageLayoutTestId, className: cx('flex w-full flex-col gap-md p-md lg:p-xl', className), children: [header, jsx(ErrorBoundary, { identifier: pageName, onError: onError, renderFallback: (error) => renderError?.({ error, pageName }) ?? jsx(DefaultPageError, { testId: joinTestId(pageLayoutTestId, 'error') }), children: children })] }));
19
+ return (jsxs("main", { "data-testid": pageLayoutTestId, className: cx('flex w-full flex-col gap-md p-md lg:p-xl', className), children: [header, jsx(ErrorBoundary, { identifier: pageName, onError: onError, renderFallback: (error) => {
20
+ // `undefined`, not nullish: an explicit `null` from `renderError` is honoured as "render nothing".
21
+ const customFallback = renderError?.({ error, pageName });
22
+ if (customFallback !== undefined)
23
+ return customFallback;
24
+ return jsx(DefaultPageError, { testId: joinTestId(pageLayoutTestId, 'error') });
25
+ }, children: children })] }));
20
26
  };
21
27
 
22
28
  export { PageLayout };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/templates/PageLayout/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;AAmCA;AACA,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAuB,MACvDA,IAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,iBAAc,MAAM,EAAE,SAAS,EAAC,4DAA4D,EAAA,QAAA,EAAA,CAC3GC,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,EAAA,QAAA,EAAA,sBAAA,EAAA,CAA0B,EAC5EA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAA,uDAAA,EAAA,CAA0D,CAAA,EAAA,CAC1F,CACP;AAED;;;;;;;;AAQG;MACU,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,WAAW,EACX,OAAO,EACP,SAAS,EACT,aAAa,EAAE,UAAU,GACT,KAAe;AAC/B,IAAA,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAEnH,IAAA,QACED,IAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAmB,gBAAgB,EAAE,SAAS,EAAE,EAAE,CAAC,0CAA0C,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CACtG,MAAM,EAEPC,GAAA,CAAC,aAAa,EAAA,EACZ,UAAU,EAAE,QAAQ,EACpB,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,KAAK,KAAK,WAAW,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,IAAIA,GAAA,CAAC,gBAAgB,EAAA,EAAC,MAAM,EAAE,UAAU,CAAC,gBAAgB,EAAE,OAAO,CAAC,EAAA,CAAI,EAAA,QAAA,EAEnI,QAAQ,EAAA,CACK,CAAA,EAAA,CACX;AAEX;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/templates/PageLayout/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;AAoCA;AACA,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAuB,MACvDA,IAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,iBAAc,MAAM,EAAE,SAAS,EAAC,4DAA4D,EAAA,QAAA,EAAA,CAC3GC,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,EAAA,QAAA,EAAA,sBAAA,EAAA,CAA0B,EAC5EA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAA,uDAAA,EAAA,CAA0D,CAAA,EAAA,CAC1F,CACP;AAED;;;;;;;;AAQG;MACU,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,WAAW,EACX,OAAO,EACP,SAAS,EACT,aAAa,EAAE,UAAU,GACT,KAAe;AAC/B,IAAA,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAEnH,IAAA,QACED,IAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAmB,gBAAgB,EAAE,SAAS,EAAE,EAAE,CAAC,0CAA0C,EAAE,SAAS,CAAC,aACtG,MAAM,EAEPC,GAAA,CAAC,aAAa,EAAA,EACZ,UAAU,EAAE,QAAQ,EACpB,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,KAAK,KAAI;;oBAExB,MAAM,cAAc,GAAG,WAAW,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;oBACzD,IAAI,cAAc,KAAK,SAAS;AAAE,wBAAA,OAAO,cAAc;AACvD,oBAAA,OAAOA,GAAA,CAAC,gBAAgB,EAAA,EAAC,MAAM,EAAE,UAAU,CAAC,gBAAgB,EAAE,OAAO,CAAC,EAAA,CAAI;AAC5E,gBAAA,CAAC,EAAA,QAAA,EAEA,QAAQ,EAAA,CACK,CAAA,EAAA,CACX;AAEX;;"}
@@ -29,7 +29,13 @@ const WidgetLayout = ({ widgetName, label, header, footer, children, renderError
29
29
  // biome-ignore lint/a11y/noNoninteractiveTabindex: a scrollable region must be reachable by keyboard
30
30
  tabIndex: 0,
31
31
  // `overscroll-contain` keeps a scroll that reaches the end from chaining to the host page.
32
- className: cx.cx('min-h-0 flex-1 overflow-y-auto overscroll-contain outline-focus-ring focus-visible:outline-2 focus-visible:-outline-offset-2', scrollAreaProps?.className), children: jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, { identifier: widgetName, onError: onError, renderFallback: (error) => renderError?.({ error, widgetName }) ?? jsxRuntime.jsx(DefaultWidgetError, { testId: testIdUtils.joinTestId(widgetLayoutTestId, 'error') }), children: children }) }), footer] }));
32
+ className: cx.cx('min-h-0 flex-1 overflow-y-auto overscroll-contain outline-focus-ring focus-visible:outline-2 focus-visible:-outline-offset-2', scrollAreaProps?.className), children: jsxRuntime.jsx(ErrorBoundary.ErrorBoundary, { identifier: widgetName, onError: onError, renderFallback: (error) => {
33
+ // `undefined`, not nullish: an explicit `null` from `renderError` is honoured as "render nothing".
34
+ const customFallback = renderError?.({ error, widgetName });
35
+ if (customFallback !== undefined)
36
+ return customFallback;
37
+ return jsxRuntime.jsx(DefaultWidgetError, { testId: testIdUtils.joinTestId(widgetLayoutTestId, 'error') });
38
+ }, children: children }) }), footer] }));
33
39
  };
34
40
 
35
41
  exports.WidgetLayout = WidgetLayout;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../src/components/templates/WidgetLayout/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx","useResolvedTestId","joinTestId","cx","ErrorBoundary"],"mappings":";;;;;;;AAiDA;AACA,MAAM,kBAAkB,GAAG,CAAC,EAAE,MAAM,EAAuB,MACzDA,eAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,iBAAc,MAAM,EAAE,SAAS,EAAC,2DAA2D,EAAA,QAAA,EAAA,CAC1GC,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,EAAA,QAAA,EAAA,sBAAA,EAAA,CAA0B,EAC5EA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAA,8CAAA,EAAA,CAAiD,CAAA,EAAA,CACjF,CACP;AAED;;;;;;;AAOG;AACI,MAAM,YAAY,GAAG,CAAC,EAC3B,UAAU,EACV,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,WAAW,EACX,OAAO,EACP,eAAe,EACf,SAAS,EACT,aAAa,EAAE,UAAU,GACP,KAAe;AACjC,IAAA,MAAM,kBAAkB,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AACzH,IAAA,MAAM,gBAAgB,GAAG,eAAe,GAAG,aAAa,CAAC,IAAIC,sBAAU,CAAC,kBAAkB,EAAE,aAAa,CAAC;;;IAG1G,MAAM,IAAI,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK;IAEtC;;;AAGE,IAAAH,eAAA,CAAC,IAAI,EAAA,EAAA,YAAA,EACS,KAAK,EAAA,aAAA,EACJ,kBAAkB,EAC/B,SAAS,EAAEI,KAAE,CAAC,yGAAyG,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CAElI,MAAM,EAEPH,cAAA,CAAA,KAAA,EAAA,EACE,EAAE,EAAE,eAAe,EAAE,EAAE,EACvB,GAAG,EAAE,eAAe,EAAE,GAAG,iBACZ,gBAAgB;;;AAG7B,gBAAA,QAAQ,EAAE,CAAC;;gBAEX,SAAS,EAAEG,KAAE,CACX,8HAA8H,EAC9H,eAAe,EAAE,SAAS,CAC3B,EAAA,QAAA,EAEDH,cAAA,CAACI,2BAAa,EAAA,EACZ,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,KAAK,KAAK,WAAW,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,IAAIJ,cAAA,CAAC,kBAAkB,EAAA,EAAC,MAAM,EAAEE,sBAAU,CAAC,kBAAkB,EAAE,OAAO,CAAC,EAAA,CAAI,EAAA,QAAA,EAEzI,QAAQ,EAAA,CACK,EAAA,CACZ,EAEL,MAAM,CAAA,EAAA,CACF;AAEX;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../src/components/templates/WidgetLayout/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx","useResolvedTestId","joinTestId","cx","ErrorBoundary"],"mappings":";;;;;;;AAoDA;AACA,MAAM,kBAAkB,GAAG,CAAC,EAAE,MAAM,EAAuB,MACzDA,eAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,iBAAc,MAAM,EAAE,SAAS,EAAC,2DAA2D,EAAA,QAAA,EAAA,CAC1GC,cAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,EAAA,QAAA,EAAA,sBAAA,EAAA,CAA0B,EAC5EA,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAA,8CAAA,EAAA,CAAiD,CAAA,EAAA,CACjF,CACP;AAED;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B,EAAE,OAAO,CAAC,EAAA,CAAI;oBAChF,CAAC,EAAA,QAAA,EAEA,QAAQ,EAAA,CACK,EAAA,CACZ,EAEL,MAAM,CAAA,EAAA,CACF;AAEX;;"}
@@ -28,7 +28,10 @@ export interface WidgetLayoutProps {
28
28
  footer?: ReactNode;
29
29
  /** Widget content, rendered INSIDE the error boundary and the scroll region. */
30
30
  children: ReactNode;
31
- /** Replaces the default fallback shown when a child throws. Receives the thrown error and `widgetName` so consumers can render localised copy. */
31
+ /**
32
+ * Replaces the default fallback shown when a child throws. Receives the thrown error and `widgetName` so consumers can render
33
+ * localised copy. Return `null` to render nothing, or `undefined` to keep the default fallback.
34
+ */
32
35
  renderError?: (props: {
33
36
  error: Error;
34
37
  widgetName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/WidgetLayout/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,WAAW,2BAA2B;IAC1C,2FAA2F;IAC3F,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2FAA2F;IAC3F,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2FAA2F;IAC3F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4IAA4I;IAC5I,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,+IAA+I;IAC/I,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,gFAAgF;IAChF,QAAQ,EAAE,SAAS,CAAC;IACpB,kJAAkJ;IAClJ,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;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,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IACzE,qFAAqF;IACrF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IAClD,mIAAmI;IACnI,eAAe,CAAC,EAAE,2BAA2B,CAAC;IAC9C,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAUD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,+HAW1B,iBAAiB,KAAG,SA+CtB,CAAC"}
@@ -27,7 +27,13 @@ const WidgetLayout = ({ widgetName, label, header, footer, children, renderError
27
27
  // biome-ignore lint/a11y/noNoninteractiveTabindex: a scrollable region must be reachable by keyboard
28
28
  tabIndex: 0,
29
29
  // `overscroll-contain` keeps a scroll that reaches the end from chaining to the host page.
30
- className: cx('min-h-0 flex-1 overflow-y-auto overscroll-contain outline-focus-ring focus-visible:outline-2 focus-visible:-outline-offset-2', scrollAreaProps?.className), children: jsx(ErrorBoundary, { identifier: widgetName, onError: onError, renderFallback: (error) => renderError?.({ error, widgetName }) ?? jsx(DefaultWidgetError, { testId: joinTestId(widgetLayoutTestId, 'error') }), children: children }) }), footer] }));
30
+ className: cx('min-h-0 flex-1 overflow-y-auto overscroll-contain outline-focus-ring focus-visible:outline-2 focus-visible:-outline-offset-2', scrollAreaProps?.className), children: jsx(ErrorBoundary, { identifier: widgetName, onError: onError, renderFallback: (error) => {
31
+ // `undefined`, not nullish: an explicit `null` from `renderError` is honoured as "render nothing".
32
+ const customFallback = renderError?.({ error, widgetName });
33
+ if (customFallback !== undefined)
34
+ return customFallback;
35
+ return jsx(DefaultWidgetError, { testId: joinTestId(widgetLayoutTestId, 'error') });
36
+ }, children: children }) }), footer] }));
31
37
  };
32
38
 
33
39
  export { WidgetLayout };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/templates/Wid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,gBAAA,QAAQ,EAAE,CAAC;;gBAEX,SAAS,EAAE,EAAE,CACX,8HAA8H,EAC9H,eAAe,EAAE,SAAS,CAC3B,EAAA,QAAA,EAEDA,GAAA,CAAC,aAAa,EAAA,EACZ,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,KAAK,KAAK,WAAW,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,IAAIA,GAAA,CAAC,kBAAkB,EAAA,EAAC,MAAM,EAAE,UAAU,CAAC,kBAAkB,EAAE,OAAO,CAAC,EAAA,CAAI,EAAA,QAAA,EAEzI,QAAQ,EAAA,CACK,EAAA,CACZ,EAEL,MAAM,CAAA,EAAA,CACF;AAEX;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/templates/WidgetLayout/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;AAoDA;AACA,MAAM,kBAAkB,GAAG,CAAC,EAAE,MAAM,EAAuB,MACzDA,IAAA,CAAA,KAAA,EAAA,EAAK,IAAI,EAAC,OAAO,iBAAc,MAAM,EAAE,SAAS,EAAC,2DAA2D,EAAA,QAAA,EAAA,CAC1GC,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAC,oCAAoC,EAAA,QAAA,EAAA,sBAAA,EAAA,CAA0B,EAC5EA,GAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,uBAAuB,EAAA,QAAA,EAAA,8CAAA,EAAA,CAAiD,CAAA,EAAA,CACjF,CACP;AAED;;;;;;;AAOG;AACI,MAAM,YAAY,GAAG,CAAC,EAC3B,UAAU,EACV,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,WAAW,EACX,OAAO,EACP,eAAe,EACf,SAAS,EACT,aAAa,EAAE,UAAU,GACP,KAAe;AACjC,IAAA,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AACzH,IAAA,MAAM,gBAAgB,GAAG,eAAe,GAAG,aAAa,CAAC,IAAI,UAAU,CAAC,kBAAkB,EAAE,aAAa,CAAC;;;IAG1G,MAAM,IAAI,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK;IAEtC;;;AAGE,IAAAD,IAAA,CAAC,IAAI,EAAA,EAAA,YAAA,EACS,KAAK,EAAA,aAAA,EACJ,kBAAkB,EAC/B,SAAS,EAAE,EAAE,CAAC,yGAAyG,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CAElI,MAAM,EAEPC,GAAA,CAAA,KAAA,EAAA,EACE,EAAE,EAAE,eAAe,EAAE,EAAE,EACvB,GAAG,EAAE,eAAe,EAAE,GAAG,iBACZ,gBAAgB;;;AAG7B,gBAAA,QAAQ,EAAE,CAAC;;gBAEX,SAAS,EAAE,EAAE,CACX,8HAA8H,EAC9H,eAAe,EAAE,SAAS,CAC3B,EAAA,QAAA,EAEDA,GAAA,CAAC,aAAa,EAAA,EACZ,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,KAAK,KAAI;;wBAExB,MAAM,cAAc,GAAG,WAAW,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;wBAC3D,IAAI,cAAc,KAAK,SAAS;AAAE,4BAAA,OAAO,cAAc;AACvD,wBAAA,OAAOA,GAAA,CAAC,kBAAkB,EAAA,EAAC,MAAM,EAAE,UAAU,CAAC,kBAAkB,EAAE,OAAO,CAAC,EAAA,CAAI;oBAChF,CAAC,EAAA,QAAA,EAEA,QAAQ,EAAA,CACK,EAAA,CACZ,EAEL,MAAM,CAAA,EAAA,CACF;AAEX;;"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `PageHubLayout` has no React Native implementation.
3
+ *
4
+ * This is a generated types-only stub (scripts/emit-native-stubs.mjs). It exists so
5
+ * that importing `@flipdish/ui-library/components/templates/PageHubLayout` from React Native fails at
6
+ * compile time rather than resolving to the web build's types. There is no
7
+ * matching `index.js`, so Metro cannot bundle this module either.
8
+ *
9
+ * To make `PageHubLayout` available on React Native, add an `index.native.tsx` beside
10
+ * its `index.tsx` — the build picks it up automatically and this stub disappears.
11
+ */
12
+ export declare const __NO_REACT_NATIVE_IMPLEMENTATION__: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flipdish/ui-library",
3
- "version": "0.48.3",
3
+ "version": "0.49.0",
4
4
  "description": "Flipdish Design System — atomic-design component library (Tailwind v4 + UntitledUI + React Aria).",
5
5
  "type": "module",
6
6
  "imports": {