@flipdish/ui-library 0.65.0 → 0.66.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/__internal__/selectionControl/utilities/fieldProps.utils.cjs +30 -0
- package/dist/components/__internal__/selectionControl/utilities/fieldProps.utils.cjs.map +1 -0
- package/dist/components/__internal__/selectionControl/utilities/fieldProps.utils.d.ts +16 -0
- package/dist/components/__internal__/selectionControl/utilities/fieldProps.utils.d.ts.map +1 -0
- package/dist/components/__internal__/selectionControl/utilities/fieldProps.utils.js +28 -0
- package/dist/components/__internal__/selectionControl/utilities/fieldProps.utils.js.map +1 -0
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.cjs +23 -16
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.js +24 -17
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/components/CheckboxBase.cjs +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/components/CheckboxBase.d.ts +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/components/CheckboxBase.d.ts.map +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/components/CheckboxBase.js +1 -1
- package/dist/components/atoms/Radios/RadioButton/RadioButton.cjs +11 -4
- package/dist/components/atoms/Radios/RadioButton/RadioButton.cjs.map +1 -1
- package/dist/components/atoms/Radios/RadioButton/RadioButton.d.ts.map +1 -1
- package/dist/components/atoms/Radios/RadioButton/RadioButton.js +12 -5
- package/dist/components/atoms/Radios/RadioButton/RadioButton.js.map +1 -1
- package/dist/components/atoms/Radios/RadioButton/components/RadioButtonBase.cjs +1 -1
- package/dist/components/atoms/Radios/RadioButton/components/RadioButtonBase.d.ts +1 -1
- package/dist/components/atoms/Radios/RadioButton/components/RadioButtonBase.d.ts.map +1 -1
- package/dist/components/atoms/Radios/RadioButton/components/RadioButtonBase.js +1 -1
- package/dist/components/atoms/Toggle/index.cjs +17 -7
- package/dist/components/atoms/Toggle/index.cjs.map +1 -1
- package/dist/components/atoms/Toggle/index.d.ts +2 -2
- package/dist/components/atoms/Toggle/index.d.ts.map +1 -1
- package/dist/components/atoms/Toggle/index.js +18 -8
- package/dist/components/atoms/Toggle/index.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.cjs +3 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.js +4 -2
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.cjs +9 -3
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.js +9 -3
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.cjs +3 -1
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.js +4 -2
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.cjs +3 -1
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.js +4 -2
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.cjs +3 -1
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.js +4 -2
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.cjs +3 -1
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.js +4 -2
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.cjs +3 -1
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.js +4 -2
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.js.map +1 -1
- package/dist/components/molecules/RadioCards/hooks/useOptionIds.cjs +2 -2
- package/dist/components/molecules/RadioCards/hooks/useOptionIds.d.ts +2 -2
- package/dist/components/molecules/RadioCards/hooks/useOptionIds.js +2 -2
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.cjs +3 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.js +4 -2
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.js.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.cjs +6 -4
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.cjs.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.d.ts.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.js +7 -5
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.js.map +1 -1
- package/dist/components/organisms/TreeView/index.cjs +3 -1
- package/dist/components/organisms/TreeView/index.cjs.map +1 -1
- package/dist/components/organisms/TreeView/index.d.ts.map +1 -1
- package/dist/components/organisms/TreeView/index.js +4 -2
- package/dist/components/organisms/TreeView/index.js.map +1 -1
- package/dist/native/components/atoms/Checkboxes/Checkbox/Checkbox.d.ts +1 -1
- package/dist/native/components/atoms/Checkboxes/Checkbox/Checkbox.js +1 -1
- package/dist/native/components/atoms/Radios/RadioButton/RadioButton.d.ts +1 -1
- package/dist/native/components/atoms/Radios/RadioButton/RadioButton.js +1 -1
- package/dist/native/components/atoms/Toggle/index.d.ts +1 -1
- package/dist/native/components/atoms/Toggle/index.js +1 -1
- package/package.json +1 -1
- package/dist/components/layouts/PageHubLayout/components/PageHubLayoutSectionNav.cjs +0 -26
- package/dist/components/layouts/PageHubLayout/components/PageHubLayoutSectionNav.cjs.map +0 -1
- package/dist/components/layouts/PageHubLayout/components/PageHubLayoutSectionNav.d.ts +0 -20
- package/dist/components/layouts/PageHubLayout/components/PageHubLayoutSectionNav.d.ts.map +0 -1
- package/dist/components/layouts/PageHubLayout/components/PageHubLayoutSectionNav.js +0 -24
- package/dist/components/layouts/PageHubLayout/components/PageHubLayoutSectionNav.js.map +0 -1
- package/dist/components/layouts/PageHubLayout/index.cjs +0 -65
- package/dist/components/layouts/PageHubLayout/index.cjs.map +0 -1
- package/dist/components/layouts/PageHubLayout/index.d.ts +0 -56
- package/dist/components/layouts/PageHubLayout/index.d.ts.map +0 -1
- package/dist/components/layouts/PageHubLayout/index.js +0 -63
- package/dist/components/layouts/PageHubLayout/index.js.map +0 -1
- package/dist/components/layouts/PageHubLayout/pageHubLayout.types.d.ts +0 -20
- package/dist/components/layouts/PageHubLayout/pageHubLayout.types.d.ts.map +0 -1
- package/dist/components/layouts/PageHubLayout/utilities/pageHubLayout.utils.cjs +0 -27
- package/dist/components/layouts/PageHubLayout/utilities/pageHubLayout.utils.cjs.map +0 -1
- package/dist/components/layouts/PageHubLayout/utilities/pageHubLayout.utils.d.ts +0 -21
- package/dist/components/layouts/PageHubLayout/utilities/pageHubLayout.utils.d.ts.map +0 -1
- package/dist/components/layouts/PageHubLayout/utilities/pageHubLayout.utils.js +0 -24
- package/dist/components/layouts/PageHubLayout/utilities/pageHubLayout.utils.js.map +0 -1
- package/dist/components/templates/PageHubLayout/index.cjs +0 -9
- package/dist/components/templates/PageHubLayout/index.cjs.map +0 -1
- package/dist/components/templates/PageHubLayout/index.d.ts +0 -8
- package/dist/components/templates/PageHubLayout/index.d.ts.map +0 -1
- package/dist/components/templates/PageHubLayout/index.js +0 -7
- package/dist/components/templates/PageHubLayout/index.js.map +0 -1
- package/dist/native/components/layouts/PageHubLayout/index.d.ts +0 -12
- package/dist/native/components/templates/PageHubLayout/index.d.ts +0 -12
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { Skeleton, SkeletonText } from '@flipdish/ui-library/components/atoms/Skeleton';
|
|
3
|
-
import { PageLayout } from '@flipdish/ui-library/components/layouts/PageLayout';
|
|
4
|
-
import { Select } from '@flipdish/ui-library/components/molecules/Selects';
|
|
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 './utilities/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 layout 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 layout 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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/layouts/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,EAAC,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,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;;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pageHubLayout.types.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/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"}
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pageHubLayout.utils.cjs","sources":["../../../../../src/components/layouts/PageHubLayout/utilities/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;;;"}
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pageHubLayout.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/PageHubLayout/utilities/pageHubLayout.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;;;;;;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"}
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pageHubLayout.utils.js","sources":["../../../../../src/components/layouts/PageHubLayout/utilities/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;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var PageHubLayout$1 = require('@flipdish/ui-library/components/layouts/PageHubLayout');
|
|
4
|
-
|
|
5
|
-
/** @deprecated Import from `@flipdish/ui-library/components/layouts/PageHubLayout`. Removed in the next major. */
|
|
6
|
-
const PageHubLayout = PageHubLayout$1.PageHubLayout;
|
|
7
|
-
|
|
8
|
-
exports.PageHubLayout = PageHubLayout;
|
|
9
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/templates/PageHubLayout/index.tsx"],"sourcesContent":[null],"names":["PageHubLayoutNext"],"mappings":";;;;AAUA;AACO,MAAM,aAAa,GAAGA;;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type PageHubLayoutProps as PageHubLayoutPropsNext, type PageHubLayoutSection as PageHubLayoutSectionNext } from '@flipdish/ui-library/components/layouts/PageHubLayout';
|
|
2
|
-
/** @deprecated Import from `@flipdish/ui-library/components/layouts/PageHubLayout`. Removed in the next major. */
|
|
3
|
-
export declare const PageHubLayout: ({ pageName, sections, navigationLabel, selectedSection, defaultSelectedSection, onSectionChange, sectionFallback, renderError, onError, "data-testid": dataTestId, ...pageLayoutProps }: PageHubLayoutPropsNext) => import("react").ReactNode;
|
|
4
|
-
/** @deprecated Import from `@flipdish/ui-library/components/layouts/PageHubLayout`. Removed in the next major. */
|
|
5
|
-
export type PageHubLayoutProps = PageHubLayoutPropsNext;
|
|
6
|
-
/** @deprecated Import from `@flipdish/ui-library/components/layouts/PageHubLayout`. Removed in the next major. */
|
|
7
|
-
export type PageHubLayoutSection = PageHubLayoutSectionNext;
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/PageHubLayout/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,kBAAkB,IAAI,sBAAsB,EACjD,KAAK,oBAAoB,IAAI,wBAAwB,EACtD,MAAM,uDAAuD,CAAC;AAE/D,kHAAkH;AAClH,eAAO,MAAM,aAAa,gPAAoB,CAAC;AAC/C,kHAAkH;AAClH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AACxD,kHAAkH;AAClH,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PageHubLayout as PageHubLayout$1 } from '@flipdish/ui-library/components/layouts/PageHubLayout';
|
|
2
|
-
|
|
3
|
-
/** @deprecated Import from `@flipdish/ui-library/components/layouts/PageHubLayout`. Removed in the next major. */
|
|
4
|
-
const PageHubLayout = PageHubLayout$1;
|
|
5
|
-
|
|
6
|
-
export { PageHubLayout };
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/templates/PageHubLayout/index.tsx"],"sourcesContent":[null],"names":["PageHubLayoutNext"],"mappings":";;AAUA;AACO,MAAM,aAAa,GAAGA;;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
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/layouts/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;
|
|
@@ -1,12 +0,0 @@
|
|
|
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;
|