@flipdish/ui-library 0.53.1 → 0.54.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/forms/Form/hooks/{useSaveForm/useSaveForm.cjs → useSaveForm.cjs} +1 -1
- package/dist/components/forms/Form/hooks/useSaveForm.cjs.map +1 -0
- package/dist/components/forms/Form/hooks/useSaveForm.d.ts.map +1 -0
- package/dist/components/forms/Form/hooks/{useSaveForm/useSaveForm.js → useSaveForm.js} +1 -1
- package/dist/components/forms/Form/hooks/useSaveForm.js.map +1 -0
- package/dist/components/forms/Form/hooks/useSubmitInTurn.cjs.map +1 -0
- package/dist/components/forms/Form/hooks/useSubmitInTurn.d.ts.map +1 -0
- package/dist/components/forms/Form/hooks/useSubmitInTurn.js.map +1 -0
- package/dist/components/forms/Form/index.cjs +2 -2
- package/dist/components/forms/Form/index.d.ts +2 -2
- package/dist/components/forms/Form/index.d.ts.map +1 -1
- package/dist/components/forms/Form/index.js +2 -2
- package/dist/components/layouts/AppShell/hooks/usePageAreaBounds.cjs.map +1 -0
- package/dist/components/layouts/AppShell/hooks/usePageAreaBounds.d.ts.map +1 -0
- package/dist/components/layouts/AppShell/hooks/usePageAreaBounds.js.map +1 -0
- package/dist/components/layouts/AppShell/hooks/usePageCover.cjs.map +1 -0
- package/dist/components/layouts/AppShell/hooks/usePageCover.d.ts.map +1 -0
- package/dist/components/layouts/AppShell/hooks/usePageCover.js.map +1 -0
- package/dist/components/layouts/AppShell/index.cjs +40 -0
- package/dist/components/layouts/AppShell/index.cjs.map +1 -0
- package/dist/components/layouts/AppShell/index.d.ts +40 -0
- package/dist/components/layouts/AppShell/index.d.ts.map +1 -0
- package/dist/components/layouts/AppShell/index.js +38 -0
- package/dist/components/layouts/AppShell/index.js.map +1 -0
- package/dist/components/layouts/PageHubLayout/components/PageHubLayoutSectionNav.cjs.map +1 -0
- package/dist/components/layouts/PageHubLayout/components/PageHubLayoutSectionNav.d.ts.map +1 -0
- package/dist/components/layouts/PageHubLayout/components/PageHubLayoutSectionNav.js.map +1 -0
- package/dist/components/layouts/PageHubLayout/index.cjs +65 -0
- package/dist/components/layouts/PageHubLayout/index.cjs.map +1 -0
- package/dist/components/layouts/PageHubLayout/index.d.ts +56 -0
- package/dist/components/layouts/PageHubLayout/index.d.ts.map +1 -0
- package/dist/components/layouts/PageHubLayout/index.js +63 -0
- package/dist/components/layouts/PageHubLayout/index.js.map +1 -0
- package/dist/components/layouts/PageHubLayout/pageHubLayout.types.d.ts.map +1 -0
- package/dist/components/layouts/PageHubLayout/utilities/pageHubLayout.utils.cjs.map +1 -0
- package/dist/components/{templates/PageHubLayout → layouts/PageHubLayout/utilities}/pageHubLayout.utils.d.ts +1 -1
- package/dist/components/layouts/PageHubLayout/utilities/pageHubLayout.utils.d.ts.map +1 -0
- package/dist/components/layouts/PageHubLayout/utilities/pageHubLayout.utils.js.map +1 -0
- package/dist/components/layouts/PageLayout/index.cjs +31 -0
- package/dist/components/layouts/PageLayout/index.cjs.map +1 -0
- package/dist/components/layouts/PageLayout/index.d.ts +44 -0
- package/dist/components/layouts/PageLayout/index.d.ts.map +1 -0
- package/dist/components/layouts/PageLayout/index.js +29 -0
- package/dist/components/layouts/PageLayout/index.js.map +1 -0
- package/dist/components/layouts/WidgetLayout/index.cjs +42 -0
- package/dist/components/layouts/WidgetLayout/index.cjs.map +1 -0
- package/dist/components/layouts/WidgetLayout/index.d.ts +57 -0
- package/dist/components/layouts/WidgetLayout/index.d.ts.map +1 -0
- package/dist/components/layouts/WidgetLayout/index.js +40 -0
- package/dist/components/layouts/WidgetLayout/index.js.map +1 -0
- package/dist/components/molecules/Alerts/Alert/Alert.cjs.map +1 -0
- package/dist/components/molecules/Alerts/Alert/Alert.d.ts.map +1 -0
- package/dist/components/molecules/Alerts/Alert/Alert.js.map +1 -0
- package/dist/components/molecules/Alerts/{components → SaveErrorAlert}/SaveErrorAlert.cjs +1 -1
- package/dist/components/molecules/Alerts/SaveErrorAlert/SaveErrorAlert.cjs.map +1 -0
- package/dist/components/molecules/Alerts/SaveErrorAlert/SaveErrorAlert.d.ts.map +1 -0
- package/dist/components/molecules/Alerts/{components → SaveErrorAlert}/SaveErrorAlert.js +1 -1
- package/dist/components/molecules/Alerts/SaveErrorAlert/SaveErrorAlert.js.map +1 -0
- package/dist/components/molecules/Alerts/index.cjs +2 -2
- package/dist/components/molecules/Alerts/index.d.ts +7 -5
- package/dist/components/molecules/Alerts/index.d.ts.map +1 -1
- package/dist/components/molecules/Alerts/index.js +2 -2
- package/dist/components/molecules/Modals/{components → ConfirmationModal}/ConfirmationModal.cjs +1 -1
- package/dist/components/molecules/Modals/ConfirmationModal/ConfirmationModal.cjs.map +1 -0
- package/dist/components/molecules/Modals/ConfirmationModal/ConfirmationModal.d.ts.map +1 -0
- package/dist/components/molecules/Modals/{components → ConfirmationModal}/ConfirmationModal.js +1 -1
- package/dist/components/molecules/Modals/ConfirmationModal/ConfirmationModal.js.map +1 -0
- package/dist/components/molecules/Modals/Modal/Modal.cjs.map +1 -0
- package/dist/components/molecules/Modals/Modal/Modal.d.ts.map +1 -0
- package/dist/components/molecules/Modals/Modal/Modal.js.map +1 -0
- package/dist/components/molecules/Modals/{components → UnsavedChangesModal}/UnsavedChangesModal.cjs +1 -1
- package/dist/components/molecules/Modals/UnsavedChangesModal/UnsavedChangesModal.cjs.map +1 -0
- package/dist/components/molecules/Modals/UnsavedChangesModal/UnsavedChangesModal.d.ts.map +1 -0
- package/dist/components/molecules/Modals/{components → UnsavedChangesModal}/UnsavedChangesModal.js +1 -1
- package/dist/components/molecules/Modals/UnsavedChangesModal/UnsavedChangesModal.js.map +1 -0
- package/dist/components/molecules/Modals/index.cjs +3 -3
- package/dist/components/molecules/Modals/index.d.ts +9 -7
- package/dist/components/molecules/Modals/index.d.ts.map +1 -1
- package/dist/components/molecules/Modals/index.js +3 -3
- package/dist/components/molecules/Tags/Tag/Tag.cjs +58 -0
- package/dist/components/molecules/Tags/Tag/Tag.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tag/Tag.d.ts +43 -0
- package/dist/components/molecules/Tags/Tag/Tag.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tag/Tag.js +56 -0
- package/dist/components/molecules/Tags/Tag/Tag.js.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagAvatar.cjs +17 -0
- package/dist/components/molecules/Tags/Tag/TagAvatar.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagAvatar.d.ts +6 -0
- package/dist/components/molecules/Tags/Tag/TagAvatar.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagAvatar.js +15 -0
- package/dist/components/molecules/Tags/Tag/TagAvatar.js.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagCheckbox.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagCheckbox.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagCheckbox.js.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagCloseX.cjs.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagCloseX.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tag/TagCloseX.js.map +1 -0
- package/dist/components/molecules/Tags/TagGroup/TagGroup.cjs +23 -0
- package/dist/components/molecules/Tags/TagGroup/TagGroup.cjs.map +1 -0
- package/dist/components/molecules/Tags/TagGroup/TagGroup.d.ts +25 -0
- package/dist/components/molecules/Tags/TagGroup/TagGroup.d.ts.map +1 -0
- package/dist/components/molecules/Tags/TagGroup/TagGroup.js +20 -0
- package/dist/components/molecules/Tags/TagGroup/TagGroup.js.map +1 -0
- package/dist/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.d.ts +10 -0
- package/dist/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.d.ts.map +1 -0
- package/dist/components/molecules/Tags/Tags.styles.cjs +1 -1
- package/dist/components/molecules/Tags/Tags.styles.d.ts +1 -1
- package/dist/components/molecules/Tags/Tags.styles.js +1 -1
- package/dist/components/molecules/Tags/index.cjs +8 -64
- package/dist/components/molecules/Tags/index.cjs.map +1 -1
- package/dist/components/molecules/Tags/index.d.ts +13 -54
- package/dist/components/molecules/Tags/index.d.ts.map +1 -1
- package/dist/components/molecules/Tags/index.js +3 -63
- package/dist/components/molecules/Tags/index.js.map +1 -1
- package/dist/components/molecules/Tags/providers/TagGroup.context.cjs +12 -0
- package/dist/components/molecules/Tags/providers/TagGroup.context.cjs.map +1 -0
- package/dist/components/molecules/Tags/providers/TagGroup.context.d.ts +7 -0
- package/dist/components/molecules/Tags/providers/TagGroup.context.d.ts.map +1 -0
- package/dist/components/molecules/Tags/providers/TagGroup.context.js +10 -0
- package/dist/components/molecules/Tags/providers/TagGroup.context.js.map +1 -0
- package/dist/components/organisms/Charts/{components → ActivityGauge}/ActivityGauge.cjs +1 -1
- package/dist/components/organisms/Charts/ActivityGauge/ActivityGauge.cjs.map +1 -0
- package/dist/components/organisms/Charts/ActivityGauge/ActivityGauge.d.ts.map +1 -0
- package/dist/components/organisms/Charts/{components → ActivityGauge}/ActivityGauge.js +1 -1
- package/dist/components/organisms/Charts/ActivityGauge/ActivityGauge.js.map +1 -0
- package/dist/components/organisms/Charts/{components → BarChart}/BarChart.cjs +1 -1
- package/dist/components/organisms/Charts/BarChart/BarChart.cjs.map +1 -0
- package/dist/components/organisms/Charts/{components → BarChart}/BarChart.d.ts +1 -1
- package/dist/components/organisms/Charts/{components → BarChart}/BarChart.d.ts.map +1 -1
- package/dist/components/organisms/Charts/{components → BarChart}/BarChart.js +1 -1
- package/dist/components/organisms/Charts/BarChart/BarChart.js.map +1 -0
- package/dist/components/organisms/Charts/{components → LineChart}/LineChart.cjs +1 -1
- package/dist/components/organisms/Charts/LineChart/LineChart.cjs.map +1 -0
- package/dist/components/organisms/Charts/{components → LineChart}/LineChart.d.ts +1 -1
- package/dist/components/organisms/Charts/LineChart/LineChart.d.ts.map +1 -0
- package/dist/components/organisms/Charts/{components → LineChart}/LineChart.js +1 -1
- package/dist/components/organisms/Charts/LineChart/LineChart.js.map +1 -0
- package/dist/components/organisms/Charts/Metrics/Metrics.cjs.map +1 -0
- package/dist/components/organisms/Charts/Metrics/Metrics.d.ts.map +1 -0
- package/dist/components/organisms/Charts/Metrics/Metrics.js.map +1 -0
- package/dist/components/organisms/Charts/{components → PieChart}/PieChart.cjs +1 -1
- package/dist/components/organisms/Charts/PieChart/PieChart.cjs.map +1 -0
- package/dist/components/organisms/Charts/{components → PieChart}/PieChart.d.ts +1 -1
- package/dist/components/organisms/Charts/{components → PieChart}/PieChart.d.ts.map +1 -1
- package/dist/components/organisms/Charts/{components → PieChart}/PieChart.js +1 -1
- package/dist/components/organisms/Charts/PieChart/PieChart.js.map +1 -0
- package/dist/components/organisms/Charts/{components → RadarChart}/RadarChart.cjs +1 -1
- package/dist/components/organisms/Charts/{components → RadarChart}/RadarChart.cjs.map +1 -1
- package/dist/components/organisms/Charts/{components → RadarChart}/RadarChart.d.ts.map +1 -1
- package/dist/components/organisms/Charts/{components → RadarChart}/RadarChart.js +1 -1
- package/dist/components/organisms/Charts/{components → RadarChart}/RadarChart.js.map +1 -1
- package/dist/components/organisms/Charts/components/ChartsBase.cjs +1 -1
- package/dist/components/organisms/Charts/components/ChartsBase.js +1 -1
- package/dist/components/organisms/Charts/index.cjs +6 -6
- package/dist/components/organisms/Charts/index.d.ts +16 -14
- package/dist/components/organisms/Charts/index.d.ts.map +1 -1
- package/dist/components/organisms/Charts/index.js +6 -6
- package/dist/components/organisms/Charts/utilities/chartTooltip.utils.cjs.map +1 -0
- package/dist/components/organisms/Charts/utilities/chartTooltip.utils.d.ts.map +1 -0
- package/dist/components/organisms/Charts/utilities/chartTooltip.utils.js.map +1 -0
- package/dist/components/templates/AppShell/index.cjs +3 -34
- package/dist/components/templates/AppShell/index.cjs.map +1 -1
- package/dist/components/templates/AppShell/index.d.ts +7 -39
- package/dist/components/templates/AppShell/index.d.ts.map +1 -1
- package/dist/components/templates/AppShell/index.js +3 -34
- package/dist/components/templates/AppShell/index.js.map +1 -1
- package/dist/components/templates/PageHubLayout/index.cjs +3 -59
- package/dist/components/templates/PageHubLayout/index.cjs.map +1 -1
- package/dist/components/templates/PageHubLayout/index.d.ts +7 -55
- package/dist/components/templates/PageHubLayout/index.d.ts.map +1 -1
- package/dist/components/templates/PageHubLayout/index.js +3 -59
- package/dist/components/templates/PageHubLayout/index.js.map +1 -1
- package/dist/components/templates/PageLayout/index.cjs +3 -25
- package/dist/components/templates/PageLayout/index.cjs.map +1 -1
- package/dist/components/templates/PageLayout/index.d.ts +5 -42
- package/dist/components/templates/PageLayout/index.d.ts.map +1 -1
- package/dist/components/templates/PageLayout/index.js +3 -25
- package/dist/components/templates/PageLayout/index.js.map +1 -1
- package/dist/components/templates/WidgetLayout/index.cjs +3 -36
- package/dist/components/templates/WidgetLayout/index.cjs.map +1 -1
- package/dist/components/templates/WidgetLayout/index.d.ts +7 -56
- package/dist/components/templates/WidgetLayout/index.d.ts.map +1 -1
- package/dist/components/templates/WidgetLayout/index.js +3 -36
- package/dist/components/templates/WidgetLayout/index.js.map +1 -1
- package/dist/native/components/layouts/AppShell/index.d.ts +12 -0
- package/dist/native/components/layouts/PageHubLayout/index.d.ts +12 -0
- package/dist/native/components/layouts/PageLayout/index.d.ts +12 -0
- package/dist/native/components/layouts/WidgetLayout/index.d.ts +12 -0
- package/dist/native/components/molecules/Tags/Tag/Tag.d.ts +62 -0
- package/dist/native/components/molecules/Tags/Tag/Tag.d.ts.map +1 -0
- package/dist/native/components/molecules/Tags/Tag/Tag.js +78 -0
- package/dist/native/components/molecules/Tags/Tag/Tag.js.map +1 -0
- package/dist/native/components/molecules/Tags/TagGroup/TagGroup.d.ts +45 -0
- package/dist/native/components/molecules/Tags/TagGroup/TagGroup.d.ts.map +1 -0
- package/dist/native/components/molecules/Tags/TagGroup/TagGroup.js +36 -0
- package/dist/native/components/molecules/Tags/TagGroup/TagGroup.js.map +1 -0
- package/dist/native/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.d.ts +10 -0
- package/dist/native/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.d.ts.map +1 -0
- package/dist/native/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.js +23 -0
- package/dist/native/components/molecules/Tags/TagGroup/utilities/tagSelection.utils.js.map +1 -0
- package/dist/native/components/molecules/Tags/Tags.styles.d.ts +1 -1
- package/dist/native/components/molecules/Tags/Tags.styles.js +1 -1
- package/dist/native/components/molecules/Tags/index.d.ts +5 -96
- package/dist/native/components/molecules/Tags/index.d.ts.map +1 -1
- package/dist/native/components/molecules/Tags/index.js +2 -104
- package/dist/native/components/molecules/Tags/index.js.map +1 -1
- package/dist/native/components/molecules/Tags/providers/TagGroup.context.d.ts +13 -0
- package/dist/native/components/molecules/Tags/providers/TagGroup.context.d.ts.map +1 -0
- package/dist/native/components/molecules/Tags/providers/TagGroup.context.js +12 -0
- package/dist/native/components/molecules/Tags/providers/TagGroup.context.js.map +1 -0
- package/package.json +11 -2
- package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.cjs.map +0 -1
- package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.d.ts.map +0 -1
- package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.js.map +0 -1
- package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.cjs.map +0 -1
- package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.d.ts.map +0 -1
- package/dist/components/forms/Form/hooks/useSubmitInTurn/useSubmitInTurn.js.map +0 -1
- package/dist/components/molecules/Alerts/components/Alert.cjs.map +0 -1
- package/dist/components/molecules/Alerts/components/Alert.d.ts.map +0 -1
- package/dist/components/molecules/Alerts/components/Alert.js.map +0 -1
- package/dist/components/molecules/Alerts/components/SaveErrorAlert.cjs.map +0 -1
- package/dist/components/molecules/Alerts/components/SaveErrorAlert.d.ts.map +0 -1
- package/dist/components/molecules/Alerts/components/SaveErrorAlert.js.map +0 -1
- package/dist/components/molecules/Modals/components/ConfirmationModal.cjs.map +0 -1
- package/dist/components/molecules/Modals/components/ConfirmationModal.d.ts.map +0 -1
- package/dist/components/molecules/Modals/components/ConfirmationModal.js.map +0 -1
- package/dist/components/molecules/Modals/components/Modal.cjs.map +0 -1
- package/dist/components/molecules/Modals/components/Modal.d.ts.map +0 -1
- package/dist/components/molecules/Modals/components/Modal.js.map +0 -1
- package/dist/components/molecules/Modals/components/UnsavedChangesModal.cjs.map +0 -1
- package/dist/components/molecules/Modals/components/UnsavedChangesModal.d.ts.map +0 -1
- package/dist/components/molecules/Modals/components/UnsavedChangesModal.js.map +0 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.cjs.map +0 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.d.ts.map +0 -1
- package/dist/components/molecules/Tags/components/TagCheckbox.js.map +0 -1
- package/dist/components/molecules/Tags/components/TagCloseX.cjs.map +0 -1
- package/dist/components/molecules/Tags/components/TagCloseX.d.ts.map +0 -1
- package/dist/components/molecules/Tags/components/TagCloseX.js.map +0 -1
- package/dist/components/organisms/Charts/chartTooltip.utils.cjs.map +0 -1
- package/dist/components/organisms/Charts/chartTooltip.utils.d.ts.map +0 -1
- package/dist/components/organisms/Charts/chartTooltip.utils.js.map +0 -1
- package/dist/components/organisms/Charts/components/ActivityGauge.cjs.map +0 -1
- package/dist/components/organisms/Charts/components/ActivityGauge.d.ts.map +0 -1
- package/dist/components/organisms/Charts/components/ActivityGauge.js.map +0 -1
- package/dist/components/organisms/Charts/components/BarChart.cjs.map +0 -1
- package/dist/components/organisms/Charts/components/BarChart.js.map +0 -1
- package/dist/components/organisms/Charts/components/LineChart.cjs.map +0 -1
- package/dist/components/organisms/Charts/components/LineChart.d.ts.map +0 -1
- package/dist/components/organisms/Charts/components/LineChart.js.map +0 -1
- package/dist/components/organisms/Charts/components/Metrics.cjs.map +0 -1
- package/dist/components/organisms/Charts/components/Metrics.d.ts.map +0 -1
- package/dist/components/organisms/Charts/components/Metrics.js.map +0 -1
- package/dist/components/organisms/Charts/components/PieChart.cjs.map +0 -1
- package/dist/components/organisms/Charts/components/PieChart.js.map +0 -1
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.cjs.map +0 -1
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.d.ts.map +0 -1
- package/dist/components/templates/AppShell/hooks/usePageAreaBounds.js.map +0 -1
- package/dist/components/templates/AppShell/hooks/usePageCover.cjs.map +0 -1
- package/dist/components/templates/AppShell/hooks/usePageCover.d.ts.map +0 -1
- package/dist/components/templates/AppShell/hooks/usePageCover.js.map +0 -1
- package/dist/components/templates/PageHubLayout/components/PageHubLayoutSectionNav.cjs.map +0 -1
- package/dist/components/templates/PageHubLayout/components/PageHubLayoutSectionNav.d.ts.map +0 -1
- package/dist/components/templates/PageHubLayout/components/PageHubLayoutSectionNav.js.map +0 -1
- package/dist/components/templates/PageHubLayout/pageHubLayout.types.d.ts.map +0 -1
- package/dist/components/templates/PageHubLayout/pageHubLayout.utils.cjs.map +0 -1
- package/dist/components/templates/PageHubLayout/pageHubLayout.utils.d.ts.map +0 -1
- package/dist/components/templates/PageHubLayout/pageHubLayout.utils.js.map +0 -1
- /package/dist/components/forms/Form/hooks/{useSaveForm/useSaveForm.d.ts → useSaveForm.d.ts} +0 -0
- /package/dist/components/forms/Form/hooks/{useSubmitInTurn/useSubmitInTurn.cjs → useSubmitInTurn.cjs} +0 -0
- /package/dist/components/forms/Form/hooks/{useSubmitInTurn/useSubmitInTurn.d.ts → useSubmitInTurn.d.ts} +0 -0
- /package/dist/components/forms/Form/hooks/{useSubmitInTurn/useSubmitInTurn.js → useSubmitInTurn.js} +0 -0
- /package/dist/components/{templates → layouts}/AppShell/hooks/usePageAreaBounds.cjs +0 -0
- /package/dist/components/{templates → layouts}/AppShell/hooks/usePageAreaBounds.d.ts +0 -0
- /package/dist/components/{templates → layouts}/AppShell/hooks/usePageAreaBounds.js +0 -0
- /package/dist/components/{templates → layouts}/AppShell/hooks/usePageCover.cjs +0 -0
- /package/dist/components/{templates → layouts}/AppShell/hooks/usePageCover.d.ts +0 -0
- /package/dist/components/{templates → layouts}/AppShell/hooks/usePageCover.js +0 -0
- /package/dist/components/{templates → layouts}/PageHubLayout/components/PageHubLayoutSectionNav.cjs +0 -0
- /package/dist/components/{templates → layouts}/PageHubLayout/components/PageHubLayoutSectionNav.d.ts +0 -0
- /package/dist/components/{templates → layouts}/PageHubLayout/components/PageHubLayoutSectionNav.js +0 -0
- /package/dist/components/{templates → layouts}/PageHubLayout/pageHubLayout.types.d.ts +0 -0
- /package/dist/components/{templates/PageHubLayout → layouts/PageHubLayout/utilities}/pageHubLayout.utils.cjs +0 -0
- /package/dist/components/{templates/PageHubLayout → layouts/PageHubLayout/utilities}/pageHubLayout.utils.js +0 -0
- /package/dist/components/molecules/Alerts/{components → Alert}/Alert.cjs +0 -0
- /package/dist/components/molecules/Alerts/{components → Alert}/Alert.d.ts +0 -0
- /package/dist/components/molecules/Alerts/{components → Alert}/Alert.js +0 -0
- /package/dist/components/molecules/Alerts/{components → SaveErrorAlert}/SaveErrorAlert.d.ts +0 -0
- /package/dist/components/molecules/Modals/{components → ConfirmationModal}/ConfirmationModal.d.ts +0 -0
- /package/dist/components/molecules/Modals/{components → Modal}/Modal.cjs +0 -0
- /package/dist/components/molecules/Modals/{components → Modal}/Modal.d.ts +0 -0
- /package/dist/components/molecules/Modals/{components → Modal}/Modal.js +0 -0
- /package/dist/components/molecules/Modals/{components → UnsavedChangesModal}/UnsavedChangesModal.d.ts +0 -0
- /package/dist/components/molecules/Tags/{components → Tag}/TagCheckbox.cjs +0 -0
- /package/dist/components/molecules/Tags/{components → Tag}/TagCheckbox.d.ts +0 -0
- /package/dist/components/molecules/Tags/{components → Tag}/TagCheckbox.js +0 -0
- /package/dist/components/molecules/Tags/{components → Tag}/TagCloseX.cjs +0 -0
- /package/dist/components/molecules/Tags/{components → Tag}/TagCloseX.d.ts +0 -0
- /package/dist/components/molecules/Tags/{components → Tag}/TagCloseX.js +0 -0
- /package/dist/components/organisms/Charts/{components → ActivityGauge}/ActivityGauge.d.ts +0 -0
- /package/dist/components/organisms/Charts/{components → Metrics}/Metrics.cjs +0 -0
- /package/dist/components/organisms/Charts/{components → Metrics}/Metrics.d.ts +0 -0
- /package/dist/components/organisms/Charts/{components → Metrics}/Metrics.js +0 -0
- /package/dist/components/organisms/Charts/{components → RadarChart}/RadarChart.d.ts +0 -0
- /package/dist/components/organisms/Charts/{chartTooltip.utils.cjs → utilities/chartTooltip.utils.cjs} +0 -0
- /package/dist/components/organisms/Charts/{chartTooltip.utils.d.ts → utilities/chartTooltip.utils.d.ts} +0 -0
- /package/dist/components/organisms/Charts/{chartTooltip.utils.js → utilities/chartTooltip.utils.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var useForm = require('
|
|
4
|
+
var useForm = require('./useForm.cjs');
|
|
5
5
|
|
|
6
6
|
// A refetch brings newer values: the fields the user has edited keep the draft, the rest follow the server. The errors
|
|
7
7
|
// on screen and the dirty flag stay too, or a refetch would hide a rejection and switch Save off for a moment.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSaveForm.cjs","sources":["../../../../../src/components/forms/Form/hooks/useSaveForm.ts"],"sourcesContent":[null],"names":["useState","useForm","useEffect"],"mappings":";;;;;AAsDA;AACA;AACA,MAAM,cAAc,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;AAEnF;AACA,MAAM,WAAW,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE;AAEnF;AACA,MAAM,eAAe,GAAG,CACtB,YAAyD,EACzD,KAAc,KACyB;AACvC,IAAA,IAAI;AACF,QAAA,OAAO,YAAY,GAAG,KAAK,CAAC;IAC9B;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,SAAS;IAClB;AACF,CAAC;A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IACjB,oIAAoI;IACpI,YAAY,EAAE,OAAO,CAAC;IACtB,kGAAkG;IAClG,SAAS,EAAE,OAAO,CAAC;IACnB,oEAAoE;IACpE,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAyBD;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,WAAW,GAAI,OAAO,SAAS,WAAW,GAAG,WAAW,EAAE,QAAQ,GAAG,GAAG,EAAE,aAAa,GAAG,OAAO,EAAE,4CAK7G,kBAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,CAAC,KAAG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,CA4D3G,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
import { useForm } from '
|
|
2
|
+
import { useForm } from './useForm.js';
|
|
3
3
|
|
|
4
4
|
// A refetch brings newer values: the fields the user has edited keep the draft, the rest follow the server. The errors
|
|
5
5
|
// on screen and the dirty flag stay too, or a refetch would hide a rejection and switch Save off for a moment.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSaveForm.js","sources":["../../../../../src/components/forms/Form/hooks/useSaveForm.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAsDA;AACA;AACA,MAAM,cAAc,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;AAEnF;AACA,MAAM,WAAW,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE;AAEnF;AACA,MAAM,eAAe,GAAG,CACtB,YAAyD,EACzD,KAAc,KACyB;AACvC,IAAA,IAAI;AACF,QAAA,OAAO,YAAY,GAAG,KAAK,CAAC;IAC9B;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,SAAS;IAClB;AACF,CAAC;AAED;;;;;;;;;;AAUG;AACH;AACO,MAAM,WAA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":"useSubmitInTurn.cjs","sources":["../../../../../src/components/forms/Form/hooks/useSubmitInTurn.ts"],"sourcesContent":[null],"names":["useRef","useCallback"],"mappings":";;;;AAEA;;;;;;AAMG;AACI,MAAM,eAAe,GAAG,CAAC,MAA+D,KAAI;;AAEjG,IAAA,MAAM,YAAY,GAAGA,YAAM,CAAC,KAAK,CAAC;AAElC,IAAA,OAAOC,iBAAW,CAChB,CAAC,KAAiC,KAAI;AACpC,QAAA,IAAI,YAAY,CAAC,OAAO,EAAE;YACxB,KAAK,CAAC,cAAc,EAAE;AACtB,YAAA,OAAO,SAAS;QAClB;AACA,QAAA,YAAY,CAAC,OAAO,GAAG,IAAI;QAC3B,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAK;AAChC,YAAA,YAAY,CAAC,OAAO,GAAG,KAAK;AAC9B,QAAA,CAAC,CAAC;AACJ,IAAA,CAAC,EACD,CAAC,MAAM,CAAC,CACT;AACH;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSubmitInTurn.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/Form/hooks/useSubmitInTurn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,aAKnF,SAAS,CAAC,eAAe,CAAC,iCAYrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSubmitInTurn.js","sources":["../../../../../src/components/forms/Form/hooks/useSubmitInTurn.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;AAMG;AACI,MAAM,eAAe,GAAG,CAAC,MAA+D,KAAI;;AAEjG,IAAA,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC;AAElC,IAAA,OAAO,WAAW,CAChB,CAAC,KAAiC,KAAI;AACpC,QAAA,IAAI,YAAY,CAAC,OAAO,EAAE;YACxB,KAAK,CAAC,cAAc,EAAE;AACtB,YAAA,OAAO,SAAS;QAClB;AACA,QAAA,YAAY,CAAC,OAAO,GAAG,IAAI;QAC3B,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAK;AAChC,YAAA,YAAY,CAAC,OAAO,GAAG,KAAK;AAC9B,QAAA,CAAC,CAAC;AACJ,IAAA,CAAC,EACD,CAAC,MAAM,CAAC,CACT;AACH;;"}
|
|
@@ -9,10 +9,10 @@ var FieldElements_context = require('../__internal__/formField/providers/FieldEl
|
|
|
9
9
|
var fieldElements_utils = require('../__internal__/formField/utilities/fieldElements.utils.cjs');
|
|
10
10
|
var formFocus_utils = require('../__internal__/formField/utilities/formFocus.utils.cjs');
|
|
11
11
|
var FormSubmit_context = require('../__internal__/formSubmit/providers/FormSubmit.context.cjs');
|
|
12
|
-
var useSubmitInTurn = require('./hooks/useSubmitInTurn
|
|
12
|
+
var useSubmitInTurn = require('./hooks/useSubmitInTurn.cjs');
|
|
13
13
|
var formSubmit_utils = require('./utilities/formSubmit.utils.cjs');
|
|
14
14
|
var useForm = require('./hooks/useForm.cjs');
|
|
15
|
-
var useSaveForm = require('./hooks/useSaveForm
|
|
15
|
+
var useSaveForm = require('./hooks/useSaveForm.cjs');
|
|
16
16
|
|
|
17
17
|
/** Wraps a form's fields and marks them busy while the form submits, which is when they lock themselves. */
|
|
18
18
|
const FormFields = (props) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ComponentProps, type Ref } from 'react';
|
|
2
2
|
import { type FieldValues, type SubmitErrorHandler, type SubmitHandler, type UseFormReturn } from 'react-hook-form';
|
|
3
3
|
export { useForm } from './hooks/useForm';
|
|
4
|
-
export type { SaveFieldError, UseSaveFormOptions, UseSaveFormReturn } from './hooks/useSaveForm
|
|
5
|
-
export { useSaveForm } from './hooks/useSaveForm
|
|
4
|
+
export type { SaveFieldError, UseSaveFormOptions, UseSaveFormReturn } from './hooks/useSaveForm';
|
|
5
|
+
export { useSaveForm } from './hooks/useSaveForm';
|
|
6
6
|
export interface FormProps<TValues extends FieldValues = FieldValues, TSubmitValues = TValues> extends Omit<ComponentProps<'form'>, 'onSubmit' | 'onInvalid' | 'noValidate' | 'ref'> {
|
|
7
7
|
/**
|
|
8
8
|
* The form from this module's `useForm` or `useSaveForm`; every `Form*` field and `FormFooter` beneath reads it. One from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/Form/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,GAAG,EAAiC,MAAM,OAAO,CAAC;AACrF,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,aAAa,EAEnB,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/Form/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,GAAG,EAAiC,MAAM,OAAO,CAAC;AACrF,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,aAAa,EAEnB,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,WAAW,SAAS,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,EAAE,aAAa,GAAG,OAAO,CAC3F,SAAQ,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,KAAK,CAAC;IACrF;;;OAGG;IAEH,IAAI,EAAE,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,aAAa,CAAC,CAAC;IACjD;;;OAGG;IACH,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IACvC,4GAA4G;IAC5G,SAAS,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACxC,mCAAmC;IACnC,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;IAC3B,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;CAAG;AASpF;;;;;;GAMG;AACH,eAAO,MAAM,IAAI;KAAI,OAAO,SAAS,WAAW,gBAAgB,aAAa,8GAS1E,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC;oBAtBT,eAAe;CAsEzC,CAAC"}
|
|
@@ -7,10 +7,10 @@ import { FieldElementsContext } from '../__internal__/formField/providers/FieldE
|
|
|
7
7
|
import { createFieldElements } from '../__internal__/formField/utilities/fieldElements.utils.js';
|
|
8
8
|
import { firstInvalidFieldOnPage } from '../__internal__/formField/utilities/formFocus.utils.js';
|
|
9
9
|
import { FormSubmitContext } from '../__internal__/formSubmit/providers/FormSubmit.context.js';
|
|
10
|
-
import { useSubmitInTurn } from './hooks/useSubmitInTurn
|
|
10
|
+
import { useSubmitInTurn } from './hooks/useSubmitInTurn.js';
|
|
11
11
|
import { submitAfterValidations } from './utilities/formSubmit.utils.js';
|
|
12
12
|
export { useForm } from './hooks/useForm.js';
|
|
13
|
-
export { useSaveForm } from './hooks/useSaveForm
|
|
13
|
+
export { useSaveForm } from './hooks/useSaveForm.js';
|
|
14
14
|
|
|
15
15
|
/** Wraps a form's fields and marks them busy while the form submits, which is when they lock themselves. */
|
|
16
16
|
const FormFields = (props) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePageAreaBounds.cjs","sources":["../../../../../src/components/layouts/AppShell/hooks/usePageAreaBounds.ts"],"sourcesContent":[null],"names":["useState","useCallback","useLayoutEffect","useResizeObserver","useEffect"],"mappings":";;;;;AAOA,MAAM,KAAK,GAAkB,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;AAErE,MAAM,MAAM,GAAG,CAAC,CAAgB,EAAE,CAAgB,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;AAE3I;;;;;;;AAOG;AACI,MAAM,iBAAiB,GAAG,CAAC,GAAkC,KAAmB;IACrF,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAGA,cAAQ,CAAgB,KAAK,CAAC;AAE1D,IAAA,MAAM,OAAO,GAAGC,iBAAW,CAAC,MAAK;QAC/B,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,EAAE,qBAAqB,EAAE;QACjD,MAAM,IAAI,GAAG;cACT,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;cACxH,KAAK;QACT,SAAS,CAAC,CAAC,OAAO,MAAM,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;AAClE,IAAA,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;;AAGT,IAAAC,qBAAe,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC;IACnCC,mCAAiB,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;IAC7CC,eAAS,CAAC,MAAK;;;AAGb,QAAA,MAAM,QAAQ,GAAG,CAAC,KAAY,KAAI;AAChC,YAAA,IAAI,KAAK,CAAC,MAAM,YAAY,IAAI,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;gBAAE;AACzE,YAAA,OAAO,EAAE;AACX,QAAA,CAAC;QACD,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC;AACnD,QAAA,OAAO,MAAM,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC;AACrE,IAAA,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAElB,IAAA,OAAO,MAAM;AACf;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePageAreaBounds.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/AppShell/hooks/usePageAreaBounds.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iEAAiE,CAAC;AAMrG;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,KAAG,aA0BtE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePageAreaBounds.js","sources":["../../../../../src/components/layouts/AppShell/hooks/us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AQ,EAAE,OAAO,EAAE,CAAC;IAC7C,SAAS,CAAC,MAAK;;;AAGb,QAAA,MAAM,QAAQ,GAAG,CAAC,KAAY,KAAI;AAChC,YAAA,IAAI,KAAK,CAAC,MAAM,YAAY,IAAI,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;gBAAE;AACzE,YAAA,OAAO,EAAE;AACX,QAAA,CAAC;QACD,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC;AACnD,QAAA,OAAO,MAAM,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC;AACrE,IAAA,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAElB,IAAA,OAAO,MAAM;AACf;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePageCover.cjs","sources":["../../../../../src/components/layouts/AppShell/hooks/usePageCover.ts"],"sourcesContent":[null],"names":["useObjectRef","useCallback"],"mappings":";;;;;AAMA;;;;;;;AAOG;AACI,MAAM,YAAY,GAAG,CAAC,YAA6C,KAAI;AAC5E,IAAA,MAAM,aAAa,GAAGA,kBAAY,CAAC,YAAY,CAAC;AAEhD,IAAA,MAAM,cAAc,GAAGC,iBAAW,CAChC,CAAC,SAAkB,KAAI;QACrB,IAAI,aAAa,CAAC,OAAO;AAAE,YAAA,aAAa,CAAC,OAAO,CAAC,KAAK,GAAG,SAAS;AACpE,IAAA,CAAC,EACD,CAAC,aAAa,CAAC,CAChB;AAED,IAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE;AAC1C;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePageCover.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/AppShell/hooks/usePageCover.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,cAAc,GAAG,CAAC,cAAc,CAAC,GAAG,SAAS;;gCAI1D,OAAO;CAOtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePageCover.js","sources":["../../../../../src/components/layouts/AppShell/hooks/usePageCover.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAMA;;;;;;;AAOG;AACI,MAAM,YAAY,GAAG,CAAC,YAA6C,KAAI;AAC5E,IAAA,MAAM,aAAa,GAAG,YAAY,CAAC,YAAY,CAAC;AAEhD,IAAA,MAAM,cAAc,GAAG,WAAW,CAChC,CAAC,SAAkB,KAAI;QACrB,IAAI,aAAa,CAAC,OAAO;AAAE,YAAA,aAAa,CAAC,OAAO,CAAC,KAAK,GAAG,SAAS;AACpE,IAAA,CAAC,EACD,CAAC,aAAa,CAAC,CAChB;AAED,IAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE;AAC1C;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var PageCover_context = require('../../organisms/SidePanel/providers/PageCover.context.cjs');
|
|
8
|
+
var OverlayBounds_context = require('../../organisms/SlideoutMenu/providers/OverlayBounds.context.cjs');
|
|
9
|
+
var PageArea_context = require('../../organisms/SlideoutMenu/providers/PageArea.context.cjs');
|
|
10
|
+
var usePageAreaBounds = require('./hooks/usePageAreaBounds.cjs');
|
|
11
|
+
var usePageCover = require('./hooks/usePageCover.cjs');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Layout for an app shell: navigation beside a column that stacks the header
|
|
15
|
+
* above the page, with an optional side panel under the header. The shell is window-height and
|
|
16
|
+
* only the page area scrolls; it holds no state, so the app owns navigation, search and panel
|
|
17
|
+
* state.
|
|
18
|
+
*
|
|
19
|
+
* @summary window-height app shell layout with a scrolling page area
|
|
20
|
+
*/
|
|
21
|
+
const AppShell = ({ sidebar, header, panel, children, scrollAreaProps, className, 'data-testid': dataTestId }) => {
|
|
22
|
+
const appShellTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'app-shell', rootName: 'app-shell' });
|
|
23
|
+
// A `SidePanel` in the `panel` slot calls the setter while it covers the page area below `lg`.
|
|
24
|
+
const { scrollAreaRef, setPageCovered } = usePageCover.usePageCover(scrollAreaProps?.ref);
|
|
25
|
+
// A `SlideoutMenu` anywhere in the shell reads the page area so it covers that box and nothing else, and below `lg` makes the
|
|
26
|
+
// row under that box inert: the page and a side panel covering it, which the slideout then covers in turn.
|
|
27
|
+
const pageAreaBounds = usePageAreaBounds.usePageAreaBounds(scrollAreaRef);
|
|
28
|
+
const pageRowRef = React.useRef(null);
|
|
29
|
+
return (
|
|
30
|
+
// A column below `lg`, so a navigation that renders its own mobile top bar stacks above the content.
|
|
31
|
+
jsxRuntime.jsx("div", { "data-testid": appShellTestId, className: cx.cx('flex h-dvh w-full flex-col overflow-hidden bg-primary lg:flex-row', className), children: jsxRuntime.jsx(OverlayBounds_context.OverlayBoundsContext.Provider, { value: pageAreaBounds, children: jsxRuntime.jsxs(PageArea_context.PageAreaContext.Provider, { value: pageRowRef, children: [sidebar, jsxRuntime.jsxs("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [header, jsxRuntime.jsxs("div", { ref: pageRowRef, className: "relative flex min-h-0 flex-1 overflow-clip", children: [jsxRuntime.jsx("div", { id: scrollAreaProps?.id, ref: scrollAreaRef, "data-testid": scrollAreaProps?.['data-testid'] ?? testIdUtils.joinTestId(appShellTestId, 'scroll-area'),
|
|
32
|
+
// Focusable so keyboard users can scroll a page that has no focusable content of its own (axe: scrollable-region-focusable).
|
|
33
|
+
// biome-ignore lint/a11y/noNoninteractiveTabindex: a scrollable region must be reachable by keyboard
|
|
34
|
+
tabIndex: 0,
|
|
35
|
+
// isolate keeps the page's own stacked content (sticky headers) under a panel that covers it.
|
|
36
|
+
className: "isolate flex min-w-0 flex-1 flex-col overflow-y-auto outline-focus-ring focus-visible:outline-2 focus-visible:-outline-offset-2", children: children }), jsxRuntime.jsx(PageCover_context.PageCoverContext.Provider, { value: setPageCovered, children: panel })] })] })] }) }) }));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.AppShell = AppShell;
|
|
40
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/layouts/AppShell/index.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","usePageCover","usePageAreaBounds","useRef","_jsx","cx","OverlayBoundsContext","_jsxs","PageAreaContext","joinTestId","PageCoverContext"],"mappings":";;;;;;;;;;;;AA2CA;;;;;;;AAOG;MACU,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAiB,KAAe;AAChJ,IAAA,MAAM,cAAc,GAAGA,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;;AAE7G,IAAA,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,GAAGC,yBAAY,CAAC,eAAe,EAAE,GAAG,CAAC;;;AAG5E,IAAA,MAAM,cAAc,GAAGC,mCAAiB,CAAC,aAAa,CAAC;AACvD,IAAA,MAAM,UAAU,GAAGC,YAAM,CAAiB,IAAI,CAAC;IAE/C;;AAEE,IAAAC,cAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAkB,cAAc,EAAE,SAAS,EAAEC,KAAE,CAAC,mEAAmE,EAAE,SAAS,CAAC,EAAA,QAAA,EAC7HD,cAAA,CAACE,0CAAoB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,cAAc,EAAA,QAAA,EAClDC,eAAA,CAACC,gCAAe,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,UAAU,EAAA,QAAA,EAAA,CACxC,OAAO,EAGRD,yBAAK,SAAS,EAAC,sCAAsC,EAAA,QAAA,EAAA,CAClD,MAAM,EAGPA,eAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAC,4CAA4C,EAAA,QAAA,EAAA,CAC1EH,cAAA,CAAA,KAAA,EAAA,EACE,EAAE,EAAE,eAAe,EAAE,EAAE,EACvB,GAAG,EAAE,aAAa,EAAA,aAAA,EACL,eAAe,GAAG,aAAa,CAAC,IAAIK,sBAAU,CAAC,cAAc,EAAE,aAAa,CAAC;;;AAG1F,wCAAA,QAAQ,EAAE,CAAC;;wCAEX,SAAS,EAAC,iIAAiI,EAAA,QAAA,EAE1I,QAAQ,GACL,EAENL,cAAA,CAACM,kCAAgB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,cAAc,EAAA,QAAA,EAAG,KAAK,EAAA,CAA6B,CAAA,EAAA,CACjF,IACF,CAAA,EAAA,CACmB,EAAA,CACG,EAAA,CAC5B;AAEV;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
|
+
export interface AppShellScrollAreaProps {
|
|
3
|
+
/** `id` for the scrolling element, e.g. for a scroll-to-top helper that looks it up. */
|
|
4
|
+
id?: string;
|
|
5
|
+
/** Ref to the scrolling element, e.g. to reset `scrollTop` on navigation or attach a scroll listener. */
|
|
6
|
+
ref?: Ref<HTMLDivElement>;
|
|
7
|
+
/** Overrides the scrolling element's `data-testid` (defaults to `<root>--scroll-area`). */
|
|
8
|
+
'data-testid'?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AppShellProps {
|
|
11
|
+
/** Primary navigation, rendered first beside the content column. Compose `<SidebarNavigation>` here. */
|
|
12
|
+
sidebar?: ReactNode;
|
|
13
|
+
/** Top bar, rendered at the top of the content column. It stays in place while the page area scrolls, outside the box a `SlideoutMenu` covers. Compose `<ApplicationHeader>` here. */
|
|
14
|
+
header?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Side panel rendered under the header. From `lg` it sits beside the page area, which narrows to make
|
|
17
|
+
* room. Below `lg` it covers the page area, which is then out of reach of keyboard and assistive
|
|
18
|
+
* technology until the panel closes, as the panel itself is while a `SlideoutMenu` covers both. Compose
|
|
19
|
+
* one `<SidePanel>` here and switch its content.
|
|
20
|
+
*/
|
|
21
|
+
panel?: ReactNode;
|
|
22
|
+
/** Page content, normally a `<PageLayout>`. Rendered inside the shell's scroll area. */
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
/** Hooks for the element that scrolls the page content, since the document itself does not scroll. */
|
|
25
|
+
scrollAreaProps?: AppShellScrollAreaProps;
|
|
26
|
+
/** Extra classes merged onto the root element. */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Overrides the `data-testid` (defaults to `fd-app-shell`). */
|
|
29
|
+
'data-testid'?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Layout for an app shell: navigation beside a column that stacks the header
|
|
33
|
+
* above the page, with an optional side panel under the header. The shell is window-height and
|
|
34
|
+
* only the page area scrolls; it holds no state, so the app owns navigation, search and panel
|
|
35
|
+
* state.
|
|
36
|
+
*
|
|
37
|
+
* @summary window-height app shell layout with a scrolling page area
|
|
38
|
+
*/
|
|
39
|
+
export declare const AppShell: ({ sidebar, header, panel, children, scrollAreaProps, className, "data-testid": dataTestId }: AppShellProps) => ReactNode;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/AppShell/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAQ5C,MAAM,WAAW,uBAAuB;IACtC,wFAAwF;IACxF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yGAAyG;IACzG,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,2FAA2F;IAC3F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,wGAAwG;IACxG,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,sLAAsL;IACtL,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wFAAwF;IACxF,QAAQ,EAAE,SAAS,CAAC;IACpB,sGAAsG;IACtG,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAI,6FAA6F,aAAa,KAAG,SA0CrI,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
3
|
+
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
4
|
+
import { useRef } from 'react';
|
|
5
|
+
import { PageCoverContext } from '../../organisms/SidePanel/providers/PageCover.context.js';
|
|
6
|
+
import { OverlayBoundsContext } from '../../organisms/SlideoutMenu/providers/OverlayBounds.context.js';
|
|
7
|
+
import { PageAreaContext } from '../../organisms/SlideoutMenu/providers/PageArea.context.js';
|
|
8
|
+
import { usePageAreaBounds } from './hooks/usePageAreaBounds.js';
|
|
9
|
+
import { usePageCover } from './hooks/usePageCover.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Layout for an app shell: navigation beside a column that stacks the header
|
|
13
|
+
* above the page, with an optional side panel under the header. The shell is window-height and
|
|
14
|
+
* only the page area scrolls; it holds no state, so the app owns navigation, search and panel
|
|
15
|
+
* state.
|
|
16
|
+
*
|
|
17
|
+
* @summary window-height app shell layout with a scrolling page area
|
|
18
|
+
*/
|
|
19
|
+
const AppShell = ({ sidebar, header, panel, children, scrollAreaProps, className, 'data-testid': dataTestId }) => {
|
|
20
|
+
const appShellTestId = useResolvedTestId({ testId: dataTestId, segment: 'app-shell', rootName: 'app-shell' });
|
|
21
|
+
// A `SidePanel` in the `panel` slot calls the setter while it covers the page area below `lg`.
|
|
22
|
+
const { scrollAreaRef, setPageCovered } = usePageCover(scrollAreaProps?.ref);
|
|
23
|
+
// A `SlideoutMenu` anywhere in the shell reads the page area so it covers that box and nothing else, and below `lg` makes the
|
|
24
|
+
// row under that box inert: the page and a side panel covering it, which the slideout then covers in turn.
|
|
25
|
+
const pageAreaBounds = usePageAreaBounds(scrollAreaRef);
|
|
26
|
+
const pageRowRef = useRef(null);
|
|
27
|
+
return (
|
|
28
|
+
// A column below `lg`, so a navigation that renders its own mobile top bar stacks above the content.
|
|
29
|
+
jsx("div", { "data-testid": appShellTestId, className: cx('flex h-dvh w-full flex-col overflow-hidden bg-primary lg:flex-row', className), children: jsx(OverlayBoundsContext.Provider, { value: pageAreaBounds, children: jsxs(PageAreaContext.Provider, { value: pageRowRef, children: [sidebar, jsxs("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [header, jsxs("div", { ref: pageRowRef, className: "relative flex min-h-0 flex-1 overflow-clip", children: [jsx("div", { id: scrollAreaProps?.id, ref: scrollAreaRef, "data-testid": scrollAreaProps?.['data-testid'] ?? joinTestId(appShellTestId, 'scroll-area'),
|
|
30
|
+
// Focusable so keyboard users can scroll a page that has no focusable content of its own (axe: scrollable-region-focusable).
|
|
31
|
+
// biome-ignore lint/a11y/noNoninteractiveTabindex: a scrollable region must be reachable by keyboard
|
|
32
|
+
tabIndex: 0,
|
|
33
|
+
// isolate keeps the page's own stacked content (sticky headers) under a panel that covers it.
|
|
34
|
+
className: "isolate flex min-w-0 flex-1 flex-col overflow-y-auto outline-focus-ring focus-visible:outline-2 focus-visible:-outline-offset-2", children: children }), jsx(PageCoverContext.Provider, { value: setPageCovered, children: panel })] })] })] }) }) }));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { AppShell };
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/layouts/AppShell/index.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;AA2CA;;;;;;;AAOG;MACU,QAAQ,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAiB,KAAe;AAChJ,IAAA,MAAM,cAAc,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;;AAE7G,IAAA,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,YAAY,CAAC,eAAe,EAAE,GAAG,CAAC;;;AAG5E,IAAA,MAAM,cAAc,GAAG,iBAAiB,CAAC,aAAa,CAAC;AACvD,IAAA,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC;IAE/C;;AAEE,IAAAA,GAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAkB,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,mEAAmE,EAAE,SAAS,CAAC,EAAA,QAAA,EAC7HA,GAAA,CAAC,oBAAoB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,cAAc,EAAA,QAAA,EAClDC,IAAA,CAAC,eAAe,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,UAAU,EAAA,QAAA,EAAA,CACxC,OAAO,EAGRA,cAAK,SAAS,EAAC,sCAAsC,EAAA,QAAA,EAAA,CAClD,MAAM,EAGPA,IAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAC,4CAA4C,EAAA,QAAA,EAAA,CAC1ED,GAAA,CAAA,KAAA,EAAA,EACE,EAAE,EAAE,eAAe,EAAE,EAAE,EACvB,GAAG,EAAE,aAAa,EAAA,aAAA,EACL,eAAe,GAAG,aAAa,CAAC,IAAI,UAAU,CAAC,cAAc,EAAE,aAAa,CAAC;;;AAG1F,wCAAA,QAAQ,EAAE,CAAC;;wCAEX,SAAS,EAAC,iIAAiI,EAAA,QAAA,EAE1I,QAAQ,GACL,EAENA,GAAA,CAAC,gBAAgB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,cAAc,EAAA,QAAA,EAAG,KAAK,EAAA,CAA6B,CAAA,EAAA,CACjF,IACF,CAAA,EAAA,CACmB,EAAA,CACG,EAAA,CAC5B;AAEV;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageHubLayoutSectionNav.cjs","sources":["../../../../../src/components/layouts/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,aAAQ,CAAC,EAAE,CAAC,IAAI,EAChBC,iBAAY,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC,IAAI,EAC5D,UAAU,IAAI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,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 @@
|
|
|
1
|
+
{"version":3,"file":"PageHubLayoutSectionNav.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/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 @@
|
|
|
1
|
+
{"version":3,"file":"PageHubLayoutSectionNav.js","sources":["../../../../../src/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ACE,MAAU,IACT,UAAU,EAAE,OAAO,CAAC,UAAU,EAAA,cAAA,EAChB,UAAU,GAAG,MAAM,GAAG,SAAS,EAC7C,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,MAAM,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,EAAA,aAAA,EACtB,MAAM,YAElB,OAAO,EAAA,CACG;AAEjB,CAAC;AAED;;;;AAIG;MACU,uBAAuB,GAAG,CAAC,EACtC,QAAQ,EACR,eAAe,EACf,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 PageLayout = require('@flipdish/ui-library/components/layouts/PageLayout');
|
|
6
|
+
var Select = require('@flipdish/ui-library/components/molecules/Select');
|
|
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('./utilities/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 layout 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 layout 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/layouts/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,CAAC,MAAK;QACb,aAAa,CAAC,IAAI,CAAC;AACnB,QAAA,OAAO,MAAM,aAAa,CAAC,KAAK,CAAC;AACnC,IAAA,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC;AAEnB,IAAA,QACEF,eAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EAAe,MAAM,EAAA,aAAA,EAAc,MAAM,EAAE,SAAS,EAAC,4BAA4B,EAAA,QAAA,EAAA,CAC/EC,cAAA,CAACE,iBAAQ,IAAC,KAAK,EAAC,KAAK,EAAC,MAAM,EAAE,EAAE,EAAA,CAAI,EACpCF,cAAA,CAACG,qBAAY,EAAA,EAAC,KAAK,EAAE,CAAC,EAAA,CA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AA,CAAA,EAAI,aAAa,CAAC,EAAE,EAAE,EAC7C,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,KAAK,KAAI;;AAExB,gCAAA,MAAM,cAAc,GAAG,WAAW,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,EAAE,CAAC;gCACtF,IAAI,cAAc,KAAK,SAAS;AAAE,oCAAA,OAAO,cAAc;AACvD,gCAAA,OAAOZ,cAAA,CAAC,mBAAmB,EAAA,EAAC,MAAM,EAAEU,sBAAU,CAAC,mBAAmB,EAAE,eAAe,CAAC,EAAA,CAAI;4BAC1F,CAAC,EAAA,QAAA,EAEDV,cAAA,CAACa,cAAQ,EAAA,EACP,QAAQ,EACN,eAAe,KAAK,SAAS,IAC3B,eAAe,KAEfb,cAAA,CAAC,sBAAsB,EAAA,EAAC,MAAM,EAAEU,sBAAU,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,EAAE,aAAa,EAAE,yBAAyB,EAAA,CAAI,CACjI,EAAA,QAAA,EAGHV,cAAA,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,56 @@
|
|
|
1
|
+
import { type PageLayoutProps } from '@flipdish/ui-library/components/layouts/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 layout 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 layout 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/layouts/PageHubLayout/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAItG,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 { PageLayout } from '@flipdish/ui-library/components/layouts/PageLayout';
|
|
4
|
+
import { Select } from '@flipdish/ui-library/components/molecules/Select';
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,oCAAoC,EAAA,QAAA,EAAA,sBAAA,EAAA,CAA0B,EAC5EA,GAAA,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;IACnG,SAAS,CAAC,MAAK;QACb,aAAa,CAAC,IAAI,CAAC;AACnB,QAAA,OAAO,MAAM,aAAa,CAAC,KAAK,CAAC;AACnC,IAAA,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC;AAEnB,IAAA,QACED,IAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EAAe,MAAM,EAAA,aAAA,EAAc,MAAM,EAAE,SAAS,EAAC,4BAA4B,EAAA,QAAA,EAAA,CAC/EC,GAAA,CAAC,QAAQ,IAAC,KAAK,EAAC,KAAK,EAAC,MAAM,EAAE,EAAE,EAAA,CAAI,EACpCA,GAAA,CAAC,YAAY,EAAA,EAAC,KAAK,EAAE,CAAC,EAAA,CAAI,CAAA,EAAA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,EAAE,EAC7C,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,KAAK,KAAI;;AAExB,gCAAA,MAAM,cAAc,GAAG,WAAW,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,EAAE,CAAC;gCACtF,IAAI,cAAc,KAAK,SAAS;AAAE,oCAAA,OAAO,cAAc;AACvD,gCAAA,OAAOA,GAAA,CAAC,mBAAmB,EAAA,EAAC,MAAM,EAAE,UAAU,CAAC,mBAAmB,EAAE,eAAe,CAAC,EAAA,CAAI;4BAC1F,CAAC,EAAA,QAAA,EAEDA,GAAA,CAAC,QAAQ,EAAA,EACP,QAAQ,EACN,eAAe,KAAK,SAAS,IAC3B,eAAe,KAEfA,GAAA,CAAC,sBAAsB,EAAA,EAAC,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 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import type { Key } from 'react';
|
|
2
|
-
import type { PageHubLayoutSection } from '
|
|
2
|
+
import type { PageHubLayoutSection } from '../pageHubLayout.types';
|
|
3
3
|
/**
|
|
4
4
|
* Resolves an option picked in the mobile select to a section the layout selects itself. Arrow keys and typeahead on
|
|
5
5
|
* the closed select pick an option directly, skipping a link option's navigation, so a routed section is left to its link.
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var ErrorBoundary = require('@flipdish/ui-library/providers/ErrorBoundary');
|
|
5
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
6
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
7
|
+
|
|
8
|
+
/** English fallback copy — consumers localise via `renderError`. TODO(i18n): source from ui-library's translation layer once one exists. */
|
|
9
|
+
const DefaultPageError = ({ 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 page." })] }));
|
|
10
|
+
/**
|
|
11
|
+
* Page-shaped layout for app page chrome: a full-width `<main>` that owns the gutters (16px
|
|
12
|
+
* on mobile, 24px from `lg`) and the header-to-content gap, an optional header region and an
|
|
13
|
+
* error boundary keyed by `pageName`. The boundary wraps `children` only, so the header's
|
|
14
|
+
* breadcrumbs stay usable when content throws; an app-level boundary still catches header
|
|
15
|
+
* errors.
|
|
16
|
+
*
|
|
17
|
+
* @summary app-shell page layout with a page-scoped error boundary
|
|
18
|
+
*/
|
|
19
|
+
const PageLayout = ({ pageName, header, children, renderError, onError, className, 'data-testid': dataTestId, }) => {
|
|
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) => {
|
|
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 }, pageName)] }));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.PageLayout = PageLayout;
|
|
31
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/layouts/PageLayout/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx","useResolvedTestId","cx","ErrorBoundary","joinTestId"],"mappings":";;;;;;;AAqCA;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,EAGPF,cAAA,CAACG,2BAAa,EAAA,EAEZ,UAAU,EAAE,QAAQ,EACpB,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,KAAK,KAAI;;oBAExB,MAAM,cAAc,GAAG,WAAW,GAAG,EAAE,KAAK,EAA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