@tpzdsp/next-toolkit 2.5.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +21 -12
- package/src/assets/styles/globals.css +75 -95
- package/src/assets/styles/ol.css +57 -16
- package/src/assets/styles/utils.css +80 -0
- package/src/components/Accordion/Accordion.css +85 -0
- package/src/components/Accordion/Accordion.stories.tsx +264 -0
- package/src/components/Accordion/Accordion.tsx +98 -0
- package/src/components/Alert/Alert.css +129 -0
- package/src/components/Alert/Alert.stories.tsx +291 -0
- package/src/components/Alert/Alert.tsx +76 -0
- package/src/components/BackLink/BackLink.css +12 -0
- package/src/components/BackLink/BackLink.stories.tsx +52 -0
- package/src/components/BackLink/BackLink.tsx +44 -0
- package/src/components/BackToTop/BackToTop.css +23 -0
- package/src/components/BackToTop/BackToTop.stories.tsx +41 -0
- package/src/components/BackToTop/BackToTop.tsx +48 -0
- package/src/components/Breadcrumb/Breadcrumb.css +42 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +94 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +135 -0
- package/src/components/Button/Button.css +229 -0
- package/src/components/Button/Button.stories.tsx +140 -20
- package/src/components/Button/Button.tsx +53 -28
- package/src/components/Button/ButtonSkeleton.stories.tsx +50 -0
- package/src/components/Button/ButtonSkeleton.tsx +14 -0
- package/src/components/ButtonGroup/ButtonGroup.css +52 -0
- package/src/components/ButtonGroup/ButtonGroup.stories.tsx +156 -0
- package/src/components/ButtonGroup/ButtonGroup.tsx +50 -0
- package/src/components/ButtonLink/ButtonLink.css +114 -0
- package/src/components/ButtonLink/ButtonLink.stories.tsx +38 -51
- package/src/components/ButtonLink/ButtonLink.tsx +54 -23
- package/src/components/Card/Card.css +13 -0
- package/src/components/Card/Card.stories.tsx +98 -57
- package/src/components/Card/Card.tsx +4 -13
- package/src/components/CardGroup/CardGroup.css +10 -0
- package/src/components/CardGroup/CardGroup.stories.tsx +81 -0
- package/src/components/CardGroup/CardGroup.tsx +9 -0
- package/src/components/Checkbox/Checkbox.css +49 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +86 -0
- package/src/components/Checkbox/Checkbox.tsx +32 -0
- package/src/components/Chip/Chip.css +54 -0
- package/src/components/Chip/Chip.stories.tsx +94 -0
- package/src/components/Chip/Chip.tsx +34 -0
- package/src/components/CookieBanner/CookieBanner.css +19 -0
- package/src/components/CookieBanner/CookieBanner.stories.tsx +52 -0
- package/src/components/CookieBanner/CookieBanner.tsx +55 -0
- package/src/components/CopyButton/CopyButton.stories.tsx +28 -0
- package/src/components/CopyButton/CopyButton.tsx +65 -0
- package/src/components/DateInput/DateInput.css +13 -0
- package/src/components/DateInput/DateInput.stories.tsx +131 -0
- package/src/components/DateInput/DateInput.test.tsx +21 -0
- package/src/components/DateInput/DateInput.tsx +98 -0
- package/src/components/Details/Details.css +28 -0
- package/src/components/Details/Details.stories.tsx +48 -0
- package/src/components/Details/Details.tsx +41 -0
- package/src/components/Dropdown/Dropdown.css +81 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +131 -0
- package/src/components/Dropdown/Dropdown.tsx +69 -0
- package/src/components/ErrorBoundary/ErrorBoundary.stories.tsx +4 -39
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +7 -4
- package/src/components/ErrorBoundary/ErrorFallback.tsx +32 -66
- package/src/components/ErrorModal/ErrorModal.css +32 -0
- package/src/components/ErrorModal/ErrorModal.stories.tsx +101 -0
- package/src/components/ErrorModal/ErrorModal.tsx +120 -0
- package/src/components/ErrorText/ErrorText.css +22 -0
- package/src/components/ErrorText/ErrorText.stories.tsx +42 -27
- package/src/components/ErrorText/ErrorText.tsx +10 -8
- package/src/components/ExternalLink/ExternalLink.css +12 -0
- package/src/components/ExternalLink/ExternalLink.stories.tsx +43 -0
- package/src/components/ExternalLink/ExternalLink.tsx +43 -0
- package/src/components/Fieldset/Fieldset.css +103 -0
- package/src/components/Fieldset/Fieldset.stories.tsx +304 -0
- package/src/components/Fieldset/Fieldset.tsx +38 -0
- package/src/components/FileUpload/FileUpload.css +85 -0
- package/src/components/FileUpload/FileUpload.stories.tsx +106 -0
- package/src/components/FileUpload/FileUpload.tsx +99 -0
- package/src/components/{layout/footer → Footer}/Copyright.tsx +4 -2
- package/src/components/Footer/Footer.stories.tsx +24 -0
- package/src/components/Footer/Footer.tsx +41 -0
- package/src/components/Footer/Licence.tsx +18 -0
- package/src/components/{layout/footer → Footer}/MetaLinks.tsx +8 -3
- package/src/components/Footer/Small/SmallFooter.tsx +43 -42
- package/src/components/Form/FormGroup.css +18 -0
- package/src/components/Form/FormGroup.stories.tsx +87 -0
- package/src/components/Form/FormGroup.tsx +16 -0
- package/src/components/{layout/header → Header}/Header.stories.tsx +26 -12
- package/src/components/Header/Header.test.tsx +87 -0
- package/src/components/Header/Header.tsx +303 -0
- package/src/components/Header/HeaderAppContent.tsx +120 -0
- package/src/components/Heading/Heading.css +40 -0
- package/src/components/Heading/Heading.stories.tsx +15 -5
- package/src/components/Heading/Heading.tsx +21 -44
- package/src/components/Heading/HeadingSkeleton.stories.tsx +30 -0
- package/src/components/Heading/HeadingSkeleton.tsx +14 -0
- package/src/components/Hero/Hero.css +19 -0
- package/src/components/Hero/Hero.stories.tsx +41 -0
- package/src/components/Hero/Hero.tsx +14 -0
- package/src/components/HintText/HintText.css +5 -0
- package/src/components/HintText/HintText.stories.tsx +29 -0
- package/src/components/HintText/HintText.tsx +13 -0
- package/src/components/InfoBox/InfoBox.css +38 -0
- package/src/components/InfoBox/InfoBox.stories.tsx +51 -403
- package/src/components/InfoBox/InfoBox.tsx +31 -158
- package/src/components/Input/Input.css +77 -0
- package/src/components/Input/Input.stories.tsx +123 -0
- package/src/components/Input/Input.tsx +74 -0
- package/src/components/InputGroup/InputGroup.css +140 -0
- package/src/components/InputGroup/InputGroup.stories.tsx +125 -0
- package/src/components/InputGroup/InputGroup.tsx +47 -0
- package/src/components/InsetText/InsetText.css +5 -0
- package/src/components/InsetText/InsetText.stories.tsx +30 -0
- package/src/components/InsetText/InsetText.tsx +9 -0
- package/src/components/Keyboard/Keyboard.css +9 -0
- package/src/components/Keyboard/Keyboard.stories.tsx +63 -0
- package/src/components/Keyboard/Keyboard.tsx +30 -0
- package/src/components/Label/Label.css +27 -0
- package/src/components/Label/Label.stories.tsx +40 -0
- package/src/components/Label/Label.tsx +17 -0
- package/src/components/LayerSwitcher/LayerSwitcher.css +59 -0
- package/src/components/LayerSwitcher/LayerSwitcher.stories.tsx +112 -0
- package/src/components/LayerSwitcher/LayerSwitcher.tsx +61 -0
- package/src/components/Layout/401/401.stories.tsx +23 -0
- package/src/components/Layout/401/401.tsx +1 -0
- package/src/components/Layout/403/403.stories.tsx +23 -0
- package/src/components/Layout/403/403.tsx +21 -0
- package/src/components/Layout/404/404.stories.tsx +23 -0
- package/src/components/Layout/404/404.tsx +28 -0
- package/src/components/Layout/500/500.stories.tsx +56 -0
- package/src/components/Layout/500/500.tsx +63 -0
- package/src/components/Layout/ButtonGroup/ButtonGroup.css +52 -0
- package/src/components/Layout/ButtonGroup/ButtonGroup.stories.tsx +156 -0
- package/src/components/Layout/ButtonGroup/ButtonGroup.tsx +50 -0
- package/src/components/Layout/HeadingGroup/HeadingGroup.css +21 -0
- package/src/components/Layout/HeadingGroup/HeadingGroup.stories.tsx +84 -0
- package/src/components/Layout/HeadingGroup/HeadingGroup.tsx +9 -0
- package/src/components/Layout/MainWrapper/MainWrapper.css +12 -0
- package/src/components/Layout/MainWrapper/MainWrapper.stories.tsx +36 -0
- package/src/components/Layout/MainWrapper/MainWrapper.tsx +14 -0
- package/src/components/Layout/PageShell/PageShell.css +42 -0
- package/src/components/Layout/PageShell/PageShell.stories.tsx +108 -0
- package/src/components/Layout/PageShell/PageShell.tsx +31 -0
- package/src/components/Layout/ParagraphGroup/ParagraphGroup.css +5 -0
- package/src/components/Layout/ParagraphGroup/ParagraphGroup.stories.tsx +34 -0
- package/src/components/Layout/ParagraphGroup/ParagraphGroup.tsx +9 -0
- package/src/components/Layout/Stack/Stack.css +29 -0
- package/src/components/Layout/Stack/Stack.stories.tsx +83 -0
- package/src/components/Layout/Stack/Stack.tsx +19 -0
- package/src/components/Layout/WidthContainer/WidthContainer.css +17 -0
- package/src/components/Layout/WidthContainer/WidthContainer.stories.tsx +59 -0
- package/src/components/Layout/WidthContainer/WidthContainer.tsx +13 -0
- package/src/components/Legend/Legend.css +95 -0
- package/src/components/Legend/Legend.stories.tsx +81 -0
- package/src/components/Legend/Legend.tsx +32 -0
- package/src/components/Legend/LegendDot.tsx +15 -0
- package/src/components/Legend/LegendPanel.stories.tsx +101 -0
- package/src/components/Legend/LegendPanel.tsx +68 -0
- package/src/components/Legend/LegendSkeleton.stories.tsx +87 -0
- package/src/components/Legend/LegendSkeleton.tsx +73 -0
- package/src/components/LegendSelect/LegendSelect.css +8 -0
- package/src/components/LegendSelect/LegendSelect.stories.tsx +80 -0
- package/src/components/LegendSelect/LegendSelect.tsx +26 -0
- package/src/components/Link/Link.css +98 -0
- package/src/components/Link/Link.stories.tsx +70 -0
- package/src/components/Link/Link.tsx +52 -0
- package/src/components/LinkButton/LinkButton.css +67 -0
- package/src/components/LinkButton/LinkButton.stories.tsx +90 -42
- package/src/components/LinkButton/LinkButton.tsx +50 -63
- package/src/components/LinkList/LinkList.css +28 -0
- package/src/components/LinkList/LinkList.stories.tsx +46 -0
- package/src/components/LinkList/LinkList.tsx +23 -0
- package/src/components/List/Li.tsx +9 -0
- package/src/components/List/List.css +9 -0
- package/src/components/List/OrderedList.stories.tsx +36 -0
- package/src/components/List/OrderedList.tsx +9 -0
- package/src/components/List/UnorderedList.stories.tsx +36 -0
- package/src/components/List/UnorderedList.tsx +9 -0
- package/src/components/LoadingBox/LoadingBox.css +27 -0
- package/src/components/LoadingBox/LoadingBox.stories.tsx +66 -0
- package/src/components/LoadingBox/LoadingBox.tsx +40 -0
- package/src/components/Modal/Modal.css +114 -0
- package/src/components/Modal/Modal.stories.tsx +41 -160
- package/src/components/Modal/Modal.tsx +132 -75
- package/src/components/NoScriptBanner/NoScriptBanner.css +17 -0
- package/src/components/NoScriptBanner/NoScriptBanner.stories.tsx +46 -0
- package/src/components/NoScriptBanner/NoScriptBanner.tsx +26 -0
- package/src/components/Paragraph/Paragraph.css +22 -0
- package/src/components/Paragraph/Paragraph.stories.tsx +1 -42
- package/src/components/Paragraph/Paragraph.tsx +4 -3
- package/src/components/Paragraph/ParagraphSkeleton.stories.tsx +44 -0
- package/src/components/Paragraph/ParagraphSkeleton.tsx +33 -0
- package/src/components/PasswordInput/PasswordInput.css +3 -0
- package/src/components/PasswordInput/PasswordInput.stories.tsx +47 -0
- package/src/components/PasswordInput/PasswordInput.tsx +45 -0
- package/src/components/PhaseBanner/PhaseBanner.css +12 -0
- package/src/components/PhaseBanner/PhaseBanner.stories.tsx +61 -0
- package/src/components/PhaseBanner/PhaseBanner.tsx +17 -0
- package/src/components/Popover/Popover.css +43 -0
- package/src/components/Popover/Popover.stories.tsx +102 -0
- package/src/components/Popover/Popover.tsx +40 -0
- package/src/components/Radio/Radio.css +69 -0
- package/src/components/Radio/Radio.stories.tsx +169 -0
- package/src/components/Radio/Radio.tsx +56 -0
- package/src/components/Resizable/Resizable.css +86 -0
- package/src/components/Resizable/Resizable.stories.tsx +123 -0
- package/src/components/Resizable/Resizable.tsx +86 -0
- package/src/components/ScrollArea/ScrollArea.css +9 -0
- package/src/components/ScrollArea/ScrollArea.stories.tsx +42 -0
- package/src/components/ScrollArea/ScrollArea.tsx +11 -0
- package/src/components/SearchBox/SearchBox.stories.tsx +88 -0
- package/src/components/SearchBox/SearchBox.tsx +36 -0
- package/src/components/Select/AsyncSelect.stories.tsx +84 -0
- package/src/components/Select/AsyncSelect.tsx +41 -0
- package/src/components/Select/Select.css +194 -0
- package/src/components/Select/Select.stories.tsx +162 -0
- package/src/components/Select/Select.test.tsx +36 -0
- package/src/components/Select/Select.tsx +291 -0
- package/src/components/Select/SelectSkeleton.stories.tsx +51 -0
- package/src/components/Select/SelectSkeleton.tsx +23 -0
- package/src/components/Separator/Separator.css +41 -0
- package/src/components/Separator/Separator.stories.tsx +63 -0
- package/src/components/Separator/Separator.tsx +42 -0
- package/src/components/Sidebar/ResizableSidebar.tsx +118 -0
- package/src/components/Sidebar/Sidebar.css +203 -0
- package/src/components/Sidebar/Sidebar.stories.tsx +438 -0
- package/src/components/Sidebar/Sidebar.tsx +225 -0
- package/src/components/Skeleton/Skeleton.css +16 -0
- package/src/components/Skeleton/Skeleton.stories.tsx +39 -0
- package/src/components/Skeleton/Skeleton.tsx +12 -0
- package/src/components/SkipLink/SkipLink.css +16 -0
- package/src/components/SkipLink/SkipLink.stories.tsx +40 -0
- package/src/components/SkipLink/SkipLink.tsx +15 -0
- package/src/components/Spinner/Spinner.css +30 -0
- package/src/components/Spinner/Spinner.stories.tsx +36 -0
- package/src/components/Spinner/Spinner.tsx +45 -0
- package/src/components/StartButton/StartButton.css +13 -0
- package/src/components/StartButton/StartButton.stories.tsx +68 -0
- package/src/components/StartButton/StartButton.tsx +50 -0
- package/src/components/SubmitButton/SubmitButton.stories.tsx +31 -0
- package/src/components/SubmitButton/SubmitButton.tsx +14 -0
- package/src/components/SummaryList/SummaryList.css +71 -0
- package/src/components/SummaryList/SummaryList.stories.tsx +211 -0
- package/src/components/SummaryList/SummaryList.tsx +41 -0
- package/src/components/SummaryList/SummaryListSkeleton.stories.tsx +67 -0
- package/src/components/SummaryList/SummaryListSkeleton.tsx +40 -0
- package/src/components/Tabs/Tabs.css +84 -0
- package/src/components/Tabs/Tabs.stories.tsx +133 -0
- package/src/components/Tabs/Tabs.tsx +66 -0
- package/src/components/Tag/Tag.css +8 -0
- package/src/components/Tag/Tag.stories.tsx +96 -0
- package/src/components/Tag/Tag.tsx +34 -0
- package/src/components/Textarea/Textarea.css +38 -0
- package/src/components/Textarea/Textarea.stories.tsx +131 -0
- package/src/components/Textarea/Textarea.tsx +50 -0
- package/src/components/TextareaCount/TextareaCount.css +17 -0
- package/src/components/TextareaCount/TextareaCount.stories.tsx +131 -0
- package/src/components/TextareaCount/TextareaCount.tsx +108 -0
- package/src/components/Tooltip/Tooltip.css +43 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +110 -0
- package/src/components/Tooltip/Tooltip.tsx +53 -0
- package/src/components/WarningText/WarningText.css +20 -0
- package/src/components/WarningText/WarningText.stories.tsx +29 -0
- package/src/components/WarningText/WarningText.tsx +17 -0
- package/src/components/index.ts +342 -61
- package/src/errors/errorDisplay.ts +70 -0
- package/src/errors/index.ts +1 -0
- package/src/http/constants.ts +1 -0
- package/src/http/fetch.ts +7 -3
- package/src/map/LayerSwitcherPanel.tsx +2 -173
- package/src/map/LegendShim.tsx +2 -0
- package/src/map/MapComponent.tsx +7 -17
- package/src/map/MapControlsOverlay.tsx +68 -175
- package/src/map/Popup.tsx +71 -24
- package/src/map/geocoder/Geocoder.test.tsx +46 -3
- package/src/map/geocoder/Geocoder.tsx +155 -278
- package/src/map/index.ts +1 -1
- package/src/types/utils.ts +0 -10
- package/src/utils/components.ts +96 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/utils.ts +0 -12
- package/src/assets/images/defra-logo.svg +0 -51
- package/src/assets/images/ea-logo.svg +0 -58
- package/src/assets/images/ogl.svg +0 -1
- package/src/components/Button/Button.test.tsx +0 -53
- package/src/components/ButtonLink/ButtonLink.test.tsx +0 -154
- package/src/components/Card/Card.test.tsx +0 -51
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +0 -75
- package/src/components/ErrorBoundary/ErrorFallback.test.tsx +0 -107
- package/src/components/ErrorText/ErrorText.test.tsx +0 -33
- package/src/components/Heading/Heading.test.tsx +0 -22
- package/src/components/Hint/Hint.stories.tsx +0 -58
- package/src/components/Hint/Hint.test.tsx +0 -33
- package/src/components/Hint/Hint.tsx +0 -12
- package/src/components/InfoBox/InfoBox.test.tsx +0 -330
- package/src/components/InfoBox/types.ts +0 -6
- package/src/components/LinkButton/LinkButton.test.tsx +0 -177
- package/src/components/Modal/Modal.test.tsx +0 -246
- package/src/components/NotificationBanner/NotificationBanner.stories.tsx +0 -45
- package/src/components/NotificationBanner/NotificationBanner.test.tsx +0 -58
- package/src/components/NotificationBanner/NotificationBanner.tsx +0 -45
- package/src/components/Paragraph/Paragraph.test.tsx +0 -10
- package/src/components/SlidingPanel/SlidingPanel.stories.tsx +0 -129
- package/src/components/SlidingPanel/SlidingPanel.test.tsx +0 -83
- package/src/components/SlidingPanel/SlidingPanel.tsx +0 -258
- package/src/components/accordion/Accordion.stories.tsx +0 -234
- package/src/components/accordion/Accordion.test.tsx +0 -192
- package/src/components/accordion/Accordion.tsx +0 -73
- package/src/components/backToTop/BackToTop.stories.tsx +0 -407
- package/src/components/backToTop/BackToTop.test.tsx +0 -57
- package/src/components/backToTop/BackToTop.tsx +0 -134
- package/src/components/chip/Chip.stories.tsx +0 -61
- package/src/components/chip/Chip.test.tsx +0 -31
- package/src/components/chip/Chip.tsx +0 -23
- package/src/components/container/Container.tsx +0 -42
- package/src/components/cookieBanner/CookieBanner.stories.tsx +0 -257
- package/src/components/cookieBanner/CookieBanner.test.tsx +0 -68
- package/src/components/cookieBanner/CookieBanner.tsx +0 -73
- package/src/components/divider/RuleDivider.stories.tsx +0 -254
- package/src/components/divider/RuleDivider.test.tsx +0 -164
- package/src/components/divider/RuleDivider.tsx +0 -23
- package/src/components/dropdown/DropdownMenu.test.tsx +0 -211
- package/src/components/dropdown/DropdownMenu.tsx +0 -108
- package/src/components/dropdown/useDropdownMenu.ts +0 -249
- package/src/components/form/Input.stories.tsx +0 -435
- package/src/components/form/Input.test.tsx +0 -206
- package/src/components/form/Input.tsx +0 -23
- package/src/components/form/TextArea.stories.tsx +0 -464
- package/src/components/form/TextArea.test.tsx +0 -232
- package/src/components/form/TextArea.tsx +0 -23
- package/src/components/layout/footer/Footer.tsx +0 -26
- package/src/components/layout/footer/Licence.tsx +0 -19
- package/src/components/layout/header/Header.test.tsx +0 -36
- package/src/components/layout/header/Header.tsx +0 -90
- package/src/components/layout/header/HeaderAuthClient.test.tsx +0 -45
- package/src/components/layout/header/HeaderAuthClient.tsx +0 -40
- package/src/components/layout/header/HeaderNavClient.test.tsx +0 -44
- package/src/components/layout/header/HeaderNavClient.tsx +0 -67
- package/src/components/link/ExternalLink.test.tsx +0 -102
- package/src/components/link/ExternalLink.tsx +0 -29
- package/src/components/link/Link.tsx +0 -26
- package/src/components/select/Select.stories.tsx +0 -336
- package/src/components/select/Select.test.tsx +0 -474
- package/src/components/select/Select.tsx +0 -125
- package/src/components/select/SelectSkeleton.stories.tsx +0 -194
- package/src/components/select/SelectSkeleton.test.tsx +0 -104
- package/src/components/select/SelectSkeleton.tsx +0 -23
- package/src/components/select/common.ts +0 -3
- package/src/components/select/index.ts +0 -18
- package/src/components/skipLink/SkipLink.stories.tsx +0 -346
- package/src/components/skipLink/SkipLink.test.tsx +0 -22
- package/src/components/skipLink/SkipLink.tsx +0 -49
- package/src/map/LegendPanel.tsx +0 -85
- /package/src/{components → assets}/images/DefraLogo.tsx +0 -0
- /package/src/{components → assets}/images/EaLogo.tsx +0 -0
- /package/src/{components → assets}/images/OglLogo.tsx +0 -0
- /package/src/components/{googleAnalytics → GoogleAnalytics}/GlobalVars.tsx +0 -0
- /package/src/components/{googleAnalytics → GoogleAnalytics}/GoogleAnalytics.tsx +0 -0
package/src/components/index.ts
CHANGED
|
@@ -1,68 +1,349 @@
|
|
|
1
|
-
//
|
|
2
|
-
export {
|
|
1
|
+
// MARK: Layout
|
|
2
|
+
export { SkipLink } from './SkipLink/SkipLink';
|
|
3
|
+
export type { SkipLinkProps } from './SkipLink/SkipLink';
|
|
4
|
+
|
|
5
|
+
// MARK: Loading
|
|
6
|
+
export { Skeleton } from './Skeleton/Skeleton';
|
|
7
|
+
export type { SkeletonProps } from './Skeleton/Skeleton';
|
|
8
|
+
export { Spinner } from './Spinner/Spinner';
|
|
9
|
+
export type { SpinnerProps } from './Spinner/Spinner';
|
|
10
|
+
export { LoadingBox } from './LoadingBox/LoadingBox';
|
|
11
|
+
export type { LoadingBoxProps } from './LoadingBox/LoadingBox';
|
|
12
|
+
|
|
13
|
+
// MARK: Typography
|
|
14
|
+
export { Heading } from './Heading/Heading';
|
|
15
|
+
export type { HeadingProps } from './Heading/Heading';
|
|
16
|
+
export { HeadingSkeleton } from './Heading/HeadingSkeleton';
|
|
17
|
+
export type { HeadingSkeletonProps } from './Heading/HeadingSkeleton';
|
|
18
|
+
export { Paragraph } from './Paragraph/Paragraph';
|
|
19
|
+
export type { ParagraphProps } from './Paragraph/Paragraph';
|
|
20
|
+
export { ParagraphSkeleton } from './Paragraph/ParagraphSkeleton';
|
|
21
|
+
export type { ParagraphSkeletonProps } from './Paragraph/ParagraphSkeleton';
|
|
22
|
+
export { InsetText } from './InsetText/InsetText';
|
|
23
|
+
export type { InsetTextProps } from './InsetText/InsetText';
|
|
24
|
+
export { HintText } from './HintText/HintText';
|
|
25
|
+
export type { HintTextProps } from './HintText/HintText';
|
|
26
|
+
export { ErrorText } from './ErrorText/ErrorText';
|
|
27
|
+
export type { ErrorTextProps } from './ErrorText/ErrorText';
|
|
28
|
+
export { WarningText } from './WarningText/WarningText';
|
|
29
|
+
export type { WarningTextProps } from './WarningText/WarningText';
|
|
30
|
+
export { HeadingGroup } from './Layout/HeadingGroup/HeadingGroup';
|
|
31
|
+
export type { HeadingGroupProps } from './Layout/HeadingGroup/HeadingGroup';
|
|
32
|
+
export { ParagraphGroup } from './Layout/ParagraphGroup/ParagraphGroup';
|
|
33
|
+
export type { ParagraphGroupProps } from './Layout/ParagraphGroup/ParagraphGroup';
|
|
34
|
+
|
|
35
|
+
// MARK: Navigation
|
|
36
|
+
export { Link, LINK_VARIANTS } from './Link/Link';
|
|
37
|
+
export type { LinkProps, LinkAppearance, LinkVariant } from './Link/Link';
|
|
38
|
+
export { ExternalLink } from './ExternalLink/ExternalLink';
|
|
39
|
+
export type { ExternalLinkProps } from './ExternalLink/ExternalLink';
|
|
40
|
+
export { BackToTop } from './BackToTop/BackToTop';
|
|
41
|
+
export type { BackToTopProps } from './BackToTop/BackToTop';
|
|
42
|
+
export { BackLink } from './BackLink/BackLink';
|
|
43
|
+
export type { BackLinkProps } from './BackLink/BackLink';
|
|
44
|
+
export { Breadcrumb } from './Breadcrumb/Breadcrumb';
|
|
45
|
+
export type {
|
|
46
|
+
BreadcrumbProps,
|
|
47
|
+
BreadcrumbItem,
|
|
48
|
+
BreadcrumbAppearance,
|
|
49
|
+
} from './Breadcrumb/Breadcrumb';
|
|
50
|
+
|
|
51
|
+
// MARK: Buttons
|
|
3
52
|
export { Button } from './Button/Button';
|
|
53
|
+
export type { ButtonProps, ButtonAppearance, ButtonVariant, ButtonSize } from './Button/Button';
|
|
54
|
+
export { ButtonSkeleton } from './Button/ButtonSkeleton';
|
|
55
|
+
export type { ButtonSkeletonProps } from './Button/ButtonSkeleton';
|
|
4
56
|
export { ButtonLink } from './ButtonLink/ButtonLink';
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { GoogleAnalytics } from './googleAnalytics/GoogleAnalytics';
|
|
12
|
-
export { Heading } from './Heading/Heading';
|
|
13
|
-
export { Hint } from './Hint/Hint';
|
|
14
|
-
export { NotificationBanner } from './NotificationBanner/NotificationBanner';
|
|
15
|
-
export { DefraLogo } from './images/DefraLogo';
|
|
16
|
-
export { EaLogo } from './images/EaLogo';
|
|
17
|
-
export { OglLogo } from './images/OglLogo';
|
|
18
|
-
export { ExternalLink } from './link/ExternalLink';
|
|
19
|
-
export { Link } from './link/Link';
|
|
57
|
+
export type {
|
|
58
|
+
ButtonLinkProps,
|
|
59
|
+
ButtonLinkAppearance,
|
|
60
|
+
ButtonLinkVariant,
|
|
61
|
+
ButtonLinkSize,
|
|
62
|
+
} from './ButtonLink/ButtonLink';
|
|
20
63
|
export { LinkButton } from './LinkButton/LinkButton';
|
|
21
|
-
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export type {
|
|
29
|
-
export
|
|
30
|
-
export type {
|
|
64
|
+
export type {
|
|
65
|
+
LinkButtonProps,
|
|
66
|
+
LinkButtonAppearance,
|
|
67
|
+
LinkButtonVariant,
|
|
68
|
+
LinkButtonSize,
|
|
69
|
+
} from './LinkButton/LinkButton';
|
|
70
|
+
export { StartButton, StartButtonContent } from './StartButton/StartButton';
|
|
71
|
+
export type { StartButtonProps, StartButtonContentProps } from './StartButton/StartButton';
|
|
72
|
+
export { SubmitButton } from './SubmitButton/SubmitButton';
|
|
73
|
+
export type { SubmitButtonProps } from './SubmitButton/SubmitButton';
|
|
74
|
+
export { CopyButton } from './CopyButton/CopyButton';
|
|
75
|
+
export type { CopyButtonProps } from './CopyButton/CopyButton';
|
|
76
|
+
export {
|
|
77
|
+
ButtonGroup,
|
|
78
|
+
ButtonGroupText,
|
|
79
|
+
ButtonGroupSeparator,
|
|
80
|
+
} from './Layout/ButtonGroup/ButtonGroup';
|
|
81
|
+
export type {
|
|
82
|
+
ButtonGroupProps,
|
|
83
|
+
ButtonGroupTextProps,
|
|
84
|
+
ButtonGroupSeparatorProps,
|
|
85
|
+
ButtonGroupOrientation,
|
|
86
|
+
} from './Layout/ButtonGroup/ButtonGroup';
|
|
87
|
+
|
|
88
|
+
// MARK: Form inputs
|
|
89
|
+
export { Input } from './Input/Input';
|
|
90
|
+
export type { InputProps, InputSize, InputAppearance, InputType } from './Input/Input';
|
|
91
|
+
export { Textarea } from './Textarea/Textarea';
|
|
92
|
+
export type { TextareaProps, TextareaAppearance } from './Textarea/Textarea';
|
|
93
|
+
export {
|
|
94
|
+
TextareaCount,
|
|
95
|
+
TextareaCountMessage,
|
|
96
|
+
TextareaCountContext,
|
|
97
|
+
} from './TextareaCount/TextareaCount';
|
|
98
|
+
export type {
|
|
99
|
+
TextareaCountProps,
|
|
100
|
+
TextareaCountMessageProps,
|
|
101
|
+
TextareaCountContextValue,
|
|
102
|
+
} from './TextareaCount/TextareaCount';
|
|
103
|
+
export { PasswordInput } from './PasswordInput/PasswordInput';
|
|
104
|
+
export type { PasswordInputProps } from './PasswordInput/PasswordInput';
|
|
105
|
+
export { FileUpload } from './FileUpload/FileUpload';
|
|
106
|
+
export type { FileUploadProps } from './FileUpload/FileUpload';
|
|
107
|
+
export { DateInput } from './DateInput/DateInput';
|
|
108
|
+
export type { DateInputProps, DateValue, DateInputInvalid } from './DateInput/DateInput';
|
|
109
|
+
export { SearchBox } from './SearchBox/SearchBox';
|
|
110
|
+
export type { SearchBoxProps } from './SearchBox/SearchBox';
|
|
111
|
+
export { Select } from './Select/Select';
|
|
112
|
+
export type { SelectProps } from './Select/Select';
|
|
113
|
+
export { AsyncSelect } from './Select/AsyncSelect';
|
|
114
|
+
export type { AsyncSelectProps } from './Select/AsyncSelect';
|
|
115
|
+
export { SelectSkeleton } from './Select/SelectSkeleton';
|
|
116
|
+
export type { SelectSkeletonProps } from './Select/SelectSkeleton';
|
|
117
|
+
export { LegendSelect } from './LegendSelect/LegendSelect';
|
|
118
|
+
export type { LegendSelectProps, LegendOption } from './LegendSelect/LegendSelect';
|
|
119
|
+
export { FormGroup } from './Form/FormGroup';
|
|
120
|
+
export type { FormGroupProps } from './Form/FormGroup';
|
|
121
|
+
|
|
122
|
+
// MARK: Form structure
|
|
123
|
+
export { Label } from './Label/Label';
|
|
124
|
+
export type { LabelProps } from './Label/Label';
|
|
125
|
+
export { FieldSet, FieldLegend, FieldItem, FieldDivider } from './Fieldset/Fieldset';
|
|
126
|
+
export type {
|
|
127
|
+
FieldSetProps,
|
|
128
|
+
FieldLegendProps,
|
|
129
|
+
FieldItemProps,
|
|
130
|
+
FieldDividerProps,
|
|
131
|
+
} from './Fieldset/Fieldset';
|
|
132
|
+
export {
|
|
133
|
+
InputGroup,
|
|
134
|
+
InputToolbar,
|
|
135
|
+
InputPrefix,
|
|
136
|
+
InputSuffix,
|
|
137
|
+
InputSwatch,
|
|
138
|
+
} from './InputGroup/InputGroup';
|
|
139
|
+
export type {
|
|
140
|
+
InputGroupProps,
|
|
141
|
+
InputToolbarProps,
|
|
142
|
+
InputPrefixProps,
|
|
143
|
+
InputSuffixProps,
|
|
144
|
+
InputSwatchProps,
|
|
145
|
+
InputGroupDirection,
|
|
146
|
+
} from './InputGroup/InputGroup';
|
|
147
|
+
|
|
148
|
+
// MARK: Selection controls
|
|
149
|
+
export { Checkbox } from './Checkbox/Checkbox';
|
|
150
|
+
export type { CheckboxProps, CheckboxSize } from './Checkbox/Checkbox';
|
|
151
|
+
export { Radio, RadioGroup } from './Radio/Radio';
|
|
152
|
+
export type { RadioProps, RadioGroupProps, RadioSize } from './Radio/Radio';
|
|
153
|
+
|
|
154
|
+
// MARK: Feedback
|
|
155
|
+
export {
|
|
156
|
+
Alert,
|
|
157
|
+
AlertTitle,
|
|
158
|
+
AlertDescription,
|
|
159
|
+
AlertBody,
|
|
160
|
+
AlertList,
|
|
161
|
+
AlertListItem,
|
|
162
|
+
AlertAction,
|
|
163
|
+
} from './Alert/Alert';
|
|
164
|
+
export type {
|
|
165
|
+
AlertProps,
|
|
166
|
+
AlertTitleProps,
|
|
167
|
+
AlertDescriptionProps,
|
|
168
|
+
AlertBodyProps,
|
|
169
|
+
AlertListProps,
|
|
170
|
+
AlertListItemProps,
|
|
171
|
+
AlertActionProps,
|
|
172
|
+
AlertAppearance,
|
|
173
|
+
AlertVariant,
|
|
174
|
+
} from './Alert/Alert';
|
|
175
|
+
export { PhaseBanner } from './PhaseBanner/PhaseBanner';
|
|
176
|
+
export type { PhaseBannerProps } from './PhaseBanner/PhaseBanner';
|
|
177
|
+
|
|
178
|
+
// MARK: Content
|
|
179
|
+
export { Tag } from './Tag/Tag';
|
|
180
|
+
export type { TagProps, TagAppearance, TagSize } from './Tag/Tag';
|
|
181
|
+
export { Chip } from './Chip/Chip';
|
|
182
|
+
export type { ChipProps, ChipSize, ChipAppearances } from './Chip/Chip';
|
|
183
|
+
export { Card } from './Card/Card';
|
|
31
184
|
export type { CardProps } from './Card/Card';
|
|
32
|
-
export
|
|
33
|
-
export type {
|
|
34
|
-
export
|
|
35
|
-
export type {
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export type {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export {
|
|
51
|
-
export {
|
|
52
|
-
export {
|
|
185
|
+
export { CardGroup } from './CardGroup/CardGroup';
|
|
186
|
+
export type { CardGroupProps } from './CardGroup/CardGroup';
|
|
187
|
+
export { Details, DetailsTrigger, DetailsContent } from './Details/Details';
|
|
188
|
+
export type { DetailsProps, DetailsTriggerProps, DetailsContentProps } from './Details/Details';
|
|
189
|
+
export {
|
|
190
|
+
SummaryList,
|
|
191
|
+
SummaryListRow,
|
|
192
|
+
SummaryListKey,
|
|
193
|
+
SummaryListValue,
|
|
194
|
+
SummaryListActions,
|
|
195
|
+
} from './SummaryList/SummaryList';
|
|
196
|
+
export type {
|
|
197
|
+
SummaryListProps,
|
|
198
|
+
SummaryListRowProps,
|
|
199
|
+
SummaryListKeyProps,
|
|
200
|
+
SummaryListValueProps,
|
|
201
|
+
SummaryListActionsProps,
|
|
202
|
+
} from './SummaryList/SummaryList';
|
|
203
|
+
export { SummaryListSkeleton } from './SummaryList/SummaryListSkeleton';
|
|
204
|
+
export type { SummaryListSkeletonProps } from './SummaryList/SummaryListSkeleton';
|
|
205
|
+
export { UnorderedList } from './List/UnorderedList';
|
|
206
|
+
export type { UnorderedListProps } from './List/UnorderedList';
|
|
207
|
+
export { OrderedList } from './List/OrderedList';
|
|
208
|
+
export type { OrderedListProps } from './List/OrderedList';
|
|
209
|
+
export { LinkList, LinkListItem } from './LinkList/LinkList';
|
|
210
|
+
export type { LinkListProps, LinkListItemProps } from './LinkList/LinkList';
|
|
211
|
+
export { Li } from './List/Li';
|
|
212
|
+
export type { LiProps } from './List/Li';
|
|
213
|
+
|
|
214
|
+
// MARK: Overlays
|
|
215
|
+
export {
|
|
216
|
+
Modal,
|
|
217
|
+
ModalTrigger,
|
|
218
|
+
ModalPortal,
|
|
219
|
+
ModalClose,
|
|
220
|
+
ModalOverlay,
|
|
221
|
+
ModalContent,
|
|
222
|
+
ModalHeader,
|
|
223
|
+
ModalFooter,
|
|
224
|
+
ModalTitle,
|
|
225
|
+
ModalDescription,
|
|
226
|
+
} from './Modal/Modal';
|
|
227
|
+
export type {
|
|
228
|
+
ModalProps,
|
|
229
|
+
ModalTriggerProps,
|
|
230
|
+
ModalPortalProps,
|
|
231
|
+
ModalCloseProps,
|
|
232
|
+
ModalOverlayProps,
|
|
233
|
+
ModalContentProps,
|
|
234
|
+
ModalHeaderProps,
|
|
235
|
+
ModalFooterProps,
|
|
236
|
+
ModalTitleProps,
|
|
237
|
+
ModalDescriptionProps,
|
|
238
|
+
} from './Modal/Modal';
|
|
239
|
+
export { ErrorModal } from './ErrorModal/ErrorModal';
|
|
240
|
+
export type { ErrorModalProps } from './ErrorModal/ErrorModal';
|
|
241
|
+
export { Popover, PopoverTrigger, PopoverAnchor, PopoverContent } from './Popover/Popover';
|
|
242
|
+
export {
|
|
243
|
+
DropdownMenu,
|
|
244
|
+
DropdownMenuTrigger,
|
|
245
|
+
DropdownMenuContent,
|
|
246
|
+
DropdownMenuItem,
|
|
247
|
+
DropdownMenuSeparator,
|
|
248
|
+
} from './Dropdown/Dropdown';
|
|
249
|
+
export { Tooltip, TooltipProvider, TooltipTrigger, TooltipContent } from './Tooltip/Tooltip';
|
|
250
|
+
export type {
|
|
251
|
+
TooltipProps,
|
|
252
|
+
TooltipProviderProps,
|
|
253
|
+
TooltipTriggerProps,
|
|
254
|
+
TooltipContentProps,
|
|
255
|
+
} from './Tooltip/Tooltip';
|
|
256
|
+
|
|
257
|
+
// MARK: Navigation patterns
|
|
258
|
+
export {
|
|
259
|
+
Accordion,
|
|
260
|
+
AccordionItem,
|
|
261
|
+
AccordionTrigger,
|
|
262
|
+
AccordionContent,
|
|
263
|
+
} from './Accordion/Accordion';
|
|
264
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent } from './Tabs/Tabs';
|
|
265
|
+
export type { TabsProps, TabsListProps, TabsTriggerProps, TabsContentProps } from './Tabs/Tabs';
|
|
266
|
+
export {
|
|
267
|
+
Sidebar,
|
|
268
|
+
SidebarProvider,
|
|
269
|
+
SidebarClose,
|
|
270
|
+
SidebarInset,
|
|
271
|
+
SidebarHeader,
|
|
272
|
+
SidebarContent,
|
|
273
|
+
SidebarFooter,
|
|
274
|
+
useSidebar,
|
|
275
|
+
} from './Sidebar/Sidebar';
|
|
276
|
+
export type {
|
|
277
|
+
SidebarSide,
|
|
278
|
+
SidebarOrientation,
|
|
279
|
+
SidebarProviderProps,
|
|
280
|
+
SidebarProps,
|
|
281
|
+
} from './Sidebar/Sidebar';
|
|
282
|
+
export { ResizableSidebar, ResizableSidebarHandle } from './Sidebar/ResizableSidebar';
|
|
283
|
+
export type {
|
|
284
|
+
ResizableSidebarProps,
|
|
285
|
+
ResizableSidebarHandleProps,
|
|
286
|
+
} from './Sidebar/ResizableSidebar';
|
|
287
|
+
|
|
288
|
+
// MARK: Layout utilities
|
|
289
|
+
export { Stack } from './Layout/Stack/Stack';
|
|
290
|
+
export type { StackProps, StackGap } from './Layout/Stack/Stack';
|
|
291
|
+
export { Separator } from './Separator/Separator';
|
|
292
|
+
export type { SeparatorProps } from './Separator/Separator';
|
|
293
|
+
export { ScrollArea } from './ScrollArea/ScrollArea';
|
|
294
|
+
export type { ScrollAreaProps } from './ScrollArea/ScrollArea';
|
|
295
|
+
export { ResizablePanelGroup, ResizablePanel, ResizableHandle } from './Resizable/Resizable';
|
|
296
|
+
export type {
|
|
297
|
+
ResizablePanelGroupProps,
|
|
298
|
+
ResizablePanelProps,
|
|
299
|
+
ResizableHandleProps,
|
|
300
|
+
} from './Resizable/Resizable';
|
|
301
|
+
export { Keyboard, KeyboardGroup } from './Keyboard/Keyboard';
|
|
302
|
+
export type { KeyboardProps, KeyboardGroupProps } from './Keyboard/Keyboard';
|
|
303
|
+
|
|
304
|
+
// MARK: Map controls
|
|
305
|
+
export { LayerSwitcher } from './LayerSwitcher/LayerSwitcher';
|
|
306
|
+
export type { LayerSwitcherProps, LayerOption } from './LayerSwitcher/LayerSwitcher';
|
|
307
|
+
export { Legend } from './Legend/Legend';
|
|
308
|
+
export type { LegendProps } from './Legend/Legend';
|
|
309
|
+
export { LegendPanel } from './Legend/LegendPanel';
|
|
310
|
+
export type { LegendPanelProps } from './Legend/LegendPanel';
|
|
311
|
+
export { LegendSkeleton } from './Legend/LegendSkeleton';
|
|
312
|
+
export type { LegendSkeletonProps } from './Legend/LegendSkeleton';
|
|
313
|
+
|
|
314
|
+
// MARK: Application
|
|
315
|
+
export { CookieBanner } from './CookieBanner/CookieBanner';
|
|
316
|
+
export type { CookieBannerProps } from './CookieBanner/CookieBanner';
|
|
317
|
+
export { NoScriptBanner } from './NoScriptBanner/NoScriptBanner';
|
|
318
|
+
export type { NoScriptBannerProps } from './NoScriptBanner/NoScriptBanner';
|
|
319
|
+
export { InfoBox } from './InfoBox/InfoBox';
|
|
320
|
+
export type { InfoBoxProps } from './InfoBox/InfoBox';
|
|
53
321
|
export { ErrorBoundary } from './ErrorBoundary/ErrorBoundary';
|
|
322
|
+
export type { ErrorBoundaryProps } from './ErrorBoundary/ErrorBoundary';
|
|
54
323
|
export { ErrorFallback } from './ErrorBoundary/ErrorFallback';
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
export type
|
|
62
|
-
export
|
|
63
|
-
export
|
|
64
|
-
|
|
65
|
-
// Export layout components
|
|
66
|
-
export { Header } from './layout/header/Header';
|
|
67
|
-
export { Footer } from './layout/footer/Footer';
|
|
324
|
+
export type { ErrorFallbackProps } from './ErrorBoundary/ErrorFallback';
|
|
325
|
+
export { GoogleAnalytics } from './GoogleAnalytics/GoogleAnalytics';
|
|
326
|
+
export { Hero } from './Hero/Hero';
|
|
327
|
+
|
|
328
|
+
// MARK: Structure
|
|
329
|
+
export { Header } from './Header/Header';
|
|
330
|
+
export { type HeaderProps } from './Header/Header';
|
|
331
|
+
export { HeaderAppContent } from './Header/HeaderAppContent';
|
|
332
|
+
export { Footer } from './Footer/Footer';
|
|
68
333
|
export { SmallFooter } from './Footer/Small/SmallFooter';
|
|
334
|
+
export { Unauthorized } from './Layout/401/401';
|
|
335
|
+
export { Forbidden } from './Layout/403/403';
|
|
336
|
+
export { NotFound } from './Layout/404/404';
|
|
337
|
+
export { InternalServerError } from './Layout/500/500';
|
|
338
|
+
export type { InternalServerErrorProps } from './Layout/500/500';
|
|
339
|
+
export { WidthContainer } from './Layout/WidthContainer/WidthContainer';
|
|
340
|
+
export type { WidthContainerProps } from './Layout/WidthContainer/WidthContainer';
|
|
341
|
+
export { MainWrapper } from './Layout/MainWrapper/MainWrapper';
|
|
342
|
+
export type { MainWrapperProps } from './Layout/MainWrapper/MainWrapper';
|
|
343
|
+
export { PageShell } from './Layout/PageShell/PageShell';
|
|
344
|
+
export type { PageShellProps, PageShellVariant } from './Layout/PageShell/PageShell';
|
|
345
|
+
|
|
346
|
+
// MARK: Images
|
|
347
|
+
export { DefraLogo } from '../assets/images/DefraLogo';
|
|
348
|
+
export { EaLogo } from '../assets/images/EaLogo';
|
|
349
|
+
export { OglLogo } from '../assets/images/OglLogo';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ApiError } from './ApiError';
|
|
2
|
+
|
|
3
|
+
export type ErrorDisplayInfo = {
|
|
4
|
+
message: string;
|
|
5
|
+
details?: string;
|
|
6
|
+
digest?: string;
|
|
7
|
+
stack?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A digest can come from two unrelated places: ApiError sets its own (a
|
|
12
|
+
* random UUID, preserved as long as the error stays client-side and never
|
|
13
|
+
* crosses a server/client boundary), or Next.js sets one itself when it
|
|
14
|
+
* replaces a server-render error with a generic one for app/error.tsx (a
|
|
15
|
+
* hash correlating to the full error in the server log). Once that happens
|
|
16
|
+
* the error is no longer `instanceof ApiError`, so this only needs to read
|
|
17
|
+
* whatever `digest` property is already on the plain Error.
|
|
18
|
+
*/
|
|
19
|
+
const getDigest = (error: Error): string | undefined => {
|
|
20
|
+
return 'digest' in error && typeof error.digest === 'string' ? error.digest : undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Derives a consistent, displayable shape from an unknown thrown value.
|
|
25
|
+
* Shared by ErrorFallback, ErrorModal, and InternalServerError so all three
|
|
26
|
+
* surfaces describe the same error the same way.
|
|
27
|
+
*/
|
|
28
|
+
export const getErrorDisplayInfo = (error: unknown): ErrorDisplayInfo => {
|
|
29
|
+
if (error instanceof ApiError) {
|
|
30
|
+
return {
|
|
31
|
+
message: error.message,
|
|
32
|
+
details: error.details ?? undefined,
|
|
33
|
+
digest: error.digest,
|
|
34
|
+
stack: error.stack,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (error instanceof Error) {
|
|
39
|
+
return {
|
|
40
|
+
message: error.message,
|
|
41
|
+
details: error.cause?.toString(),
|
|
42
|
+
digest: getDigest(error),
|
|
43
|
+
stack: error.stack,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return { message: 'Unknown error' };
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Formats an ErrorDisplayInfo as plain text for the clipboard, including the
|
|
52
|
+
* stack trace (the backtrace) when one is available.
|
|
53
|
+
*/
|
|
54
|
+
export const formatErrorForClipboard = (info: ErrorDisplayInfo): string => {
|
|
55
|
+
const lines = [`Error: ${info.message}`];
|
|
56
|
+
|
|
57
|
+
if (info.details) {
|
|
58
|
+
lines.push(`Details: ${info.details}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (info.digest) {
|
|
62
|
+
lines.push(`Digest: ${info.digest}`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (info.stack) {
|
|
66
|
+
lines.push('', 'Stack:', info.stack);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return lines.join('\n');
|
|
70
|
+
};
|
package/src/errors/index.ts
CHANGED
package/src/http/constants.ts
CHANGED
package/src/http/fetch.ts
CHANGED
|
@@ -187,9 +187,13 @@ const TOOLKIT_PLUGIN = {
|
|
|
187
187
|
},
|
|
188
188
|
hooks: {
|
|
189
189
|
onRequest: (context) => {
|
|
190
|
-
//
|
|
191
|
-
// but
|
|
192
|
-
|
|
190
|
+
// better-fetch now handle json content types and stringifies the body, so we skip if the
|
|
191
|
+
// body is already a string, but we also use custom json mime types like geojson so if the
|
|
192
|
+
// body didn't get stringified then we do it here
|
|
193
|
+
if (
|
|
194
|
+
isJsonMimeType(context.headers.get(Header.ContentType)) &&
|
|
195
|
+
typeof context.body !== 'string'
|
|
196
|
+
) {
|
|
193
197
|
context.body = JSON.stringify(context.body);
|
|
194
198
|
}
|
|
195
199
|
|