@leabankab/component-library 8.8.0 → 8.9.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/CHANGELOG.md +30 -0
- package/dist/component-library.es.js +1241 -1215
- package/dist/component-library.es.js.map +1 -1
- package/dist/component-library.umd.js +2 -2
- package/dist/component-library.umd.js.map +1 -1
- package/dist/components/buttons/{action-button.d.ts → action-button/action-button.d.ts} +1 -1
- package/dist/components/buttons/{button.d.ts → button/button.d.ts} +2 -2
- package/dist/components/buttons/{close-button.d.ts → close-button/close-button.d.ts} +1 -1
- package/dist/components/buttons/{download-trigger.d.ts → download-trigger/download-trigger.d.ts} +2 -2
- package/dist/components/buttons/{icon-button.d.ts → icon-button/icon-button.d.ts} +1 -1
- package/dist/components/buttons/index.d.ts +6 -6
- package/dist/components/buttons/{skip-link.d.ts → skip-link/skip-link.d.ts} +1 -1
- package/dist/components/data-display/{card.d.ts → card/card.d.ts} +1 -1
- package/dist/components/data-display/{chip.d.ts → chip/chip.d.ts} +1 -1
- package/dist/components/data-display/index.d.ts +17 -16
- package/dist/components/data-display/{link-card.d.ts → link-card/link-card.d.ts} +1 -1
- package/dist/components/data-display/{media-card.d.ts → media-card/media-card.d.ts} +1 -1
- package/dist/components/data-display/{service-card.d.ts → service-card/service-card.d.ts} +1 -1
- package/dist/components/feedback/{alert.d.ts → alert/alert.d.ts} +2 -2
- package/dist/components/feedback/{global-alert.d.ts → global-alert/global-alert.d.ts} +1 -1
- package/dist/components/feedback/index.d.ts +8 -8
- package/dist/components/feedback/{toast.d.ts → toast/toast.d.ts} +1 -1
- package/dist/components/form/{autocomplete.d.ts → autocomplete/autocomplete.d.ts} +2 -2
- package/dist/components/form/{email-input.d.ts → email-input/email-input.d.ts} +1 -1
- package/dist/components/form/index.d.ts +12 -12
- package/dist/components/form/{multi-select.d.ts → multi-select/multi-select.d.ts} +1 -1
- package/dist/components/form/{number-input-unit.d.ts → number-input/number-input-unit.d.ts} +2 -2
- package/dist/components/form/{radio.d.ts → radio/radio.d.ts} +2 -2
- package/dist/components/form/{radio-card.d.ts → radio-card/radio-card.d.ts} +3 -3
- package/dist/components/form/{select.d.ts → select/select.d.ts} +13 -3
- package/dist/components/form/select-field.d.ts +20 -1
- package/dist/components/form/{slider.d.ts → slider/slider.d.ts} +1 -1
- package/dist/components/index.d.ts +1 -2
- package/dist/components/layout/{container.d.ts → container/container.d.ts} +1 -1
- package/dist/components/layout/{grid.d.ts → grid/grid.d.ts} +2 -2
- package/dist/components/layout/index.d.ts +3 -3
- package/dist/components/layout/{stack.d.ts → stack/stack.d.ts} +2 -2
- package/dist/components/navigation/{form-stepper.d.ts → form-stepper/form-stepper.d.ts} +2 -2
- package/dist/components/navigation/index.d.ts +9 -8
- package/dist/components/navigation/{linear-form-stepper.d.ts → linear-form-stepper/linear-form-stepper.d.ts} +2 -2
- package/dist/components/navigation/{progress-circle.d.ts → progress-circle/progress-circle.d.ts} +1 -1
- package/dist/components/navigation/{tabs.d.ts → tabs/tabs.d.ts} +1 -1
- package/dist/components/surfaces/index.d.ts +3 -3
- package/dist/components/typography/index.d.ts +3 -3
- package/dist/components/typography/{link.d.ts → link/link.d.ts} +1 -1
- package/dist/components/typography/{text.d.ts → text/text.d.ts} +4 -4
- package/dist/cookie-consent-react.cjs.map +1 -1
- package/dist/cookie-consent-react.mjs +3 -3
- package/dist/cookie-consent-react.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/utils/{formatDecimalString.d.ts → format-decimal-string.d.ts} +1 -1
- package/dist/utils/index.d.ts +5 -5
- package/dist/website/alert-banner/alert-banner.d.ts +48 -0
- package/dist/website/arrow-reveal-link.d.ts +22 -0
- package/dist/website/{use-carousel.d.ts → carousel/use-carousel.d.ts} +3 -1
- package/dist/website/{expanding-cards-item.d.ts → expanding-cards/expanding-cards-item.d.ts} +1 -1
- package/dist/website/index.d.ts +25 -21
- package/dist/website/{payment-feature.d.ts → payment-feature/payment-feature.d.ts} +1 -1
- package/dist/website/{section.d.ts → section/section.d.ts} +1 -1
- package/dist/website/side-nav/side-nav.d.ts +57 -0
- package/dist/website/side-nav/use-side-nav-labels.d.ts +5 -0
- package/dist/website/site-footer/flags.d.ts +7 -0
- package/dist/website/site-footer/site-footer.d.ts +122 -0
- package/dist/website/site-footer/use-site-footer-labels.d.ts +7 -0
- package/dist/website/site-header/site-header-menu.d.ts +21 -0
- package/dist/website/site-header/site-header.d.ts +141 -0
- package/dist/website/site-header-link.d.ts +16 -0
- package/dist/website/use-site-header-labels.d.ts +7 -0
- package/dist/website.cjs +1 -1
- package/dist/website.cjs.map +1 -1
- package/dist/website.css +1 -1
- package/dist/website.mjs +1185 -433
- package/dist/website.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/components/ui/index.d.ts +0 -2
- /package/dist/components/buttons/{use-download-labels.d.ts → download-trigger/use-download-labels.d.ts} +0 -0
- /package/dist/components/data-display/{article-card.d.ts → article-card/article-card.d.ts} +0 -0
- /package/dist/components/data-display/{avatar.d.ts → avatar/avatar.d.ts} +0 -0
- /package/dist/components/{ui → data-display/brand-divider}/brand-divider.d.ts +0 -0
- /package/dist/components/data-display/{use-chip-labels.d.ts → chip/use-chip-labels.d.ts} +0 -0
- /package/dist/components/data-display/{data-field.d.ts → data-field/data-field.d.ts} +0 -0
- /package/dist/components/data-display/{featured-image.d.ts → featured-image/featured-image.d.ts} +0 -0
- /package/dist/components/data-display/{arrow-circle.d.ts → link-card/arrow-circle.d.ts} +0 -0
- /package/dist/components/data-display/{partner-row.d.ts → partner-row/partner-row.d.ts} +0 -0
- /package/dist/components/data-display/{rich-text.d.ts → rich-text/rich-text.d.ts} +0 -0
- /package/dist/components/data-display/{star-rating.d.ts → star-rating/star-rating.d.ts} +0 -0
- /package/dist/components/data-display/{use-star-rating-labels.d.ts → star-rating/use-star-rating-labels.d.ts} +0 -0
- /package/dist/components/data-display/{table.d.ts → table/table.d.ts} +0 -0
- /package/dist/components/data-display/{testimonial-card.d.ts → testimonial-card/testimonial-card.d.ts} +0 -0
- /package/dist/components/data-display/{tooltip.d.ts → tooltip/tooltip.d.ts} +0 -0
- /package/dist/components/data-display/{use-video-player-labels.d.ts → video-player/use-video-player-labels.d.ts} +0 -0
- /package/dist/components/data-display/{video-player.d.ts → video-player/video-player.d.ts} +0 -0
- /package/dist/components/feedback/{dialog.d.ts → dialog/dialog.d.ts} +0 -0
- /package/dist/components/feedback/{simple-dialog.d.ts → dialog/simple-dialog.d.ts} +0 -0
- /package/dist/components/feedback/{drawer.d.ts → drawer/drawer.d.ts} +0 -0
- /package/dist/components/feedback/{simple-drawer.d.ts → drawer/simple-drawer.d.ts} +0 -0
- /package/dist/components/feedback/{skeleton.d.ts → skeleton/skeleton.d.ts} +0 -0
- /package/dist/components/form/{amount-slider.d.ts → amount-slider/amount-slider.d.ts} +0 -0
- /package/dist/components/form/{checkbox.d.ts → checkbox/checkbox.d.ts} +0 -0
- /package/dist/components/form/{input.d.ts → input/input.d.ts} +0 -0
- /package/dist/components/form/{number-input.d.ts → number-input/number-input.d.ts} +0 -0
- /package/dist/components/form/{switch.d.ts → switch/switch.d.ts} +0 -0
- /package/dist/components/{ui → navigation/app-header}/app-header.d.ts +0 -0
- /package/dist/components/navigation/{breadcrumbs.d.ts → breadcrumbs/breadcrumbs.d.ts} +0 -0
- /package/dist/components/navigation/{use-breadcrumbs-labels.d.ts → breadcrumbs/use-breadcrumbs-labels.d.ts} +0 -0
- /package/dist/components/navigation/{step-progress.d.ts → linear-form-stepper/step-progress.d.ts} +0 -0
- /package/dist/components/navigation/{pagination.d.ts → pagination/pagination.d.ts} +0 -0
- /package/dist/components/navigation/{pagination-dots.d.ts → pagination-dots/pagination-dots.d.ts} +0 -0
- /package/dist/components/surfaces/{accordion.d.ts → accordion/accordion.d.ts} +0 -0
- /package/dist/components/surfaces/{simple-accordion.d.ts → accordion/simple-accordion.d.ts} +0 -0
- /package/dist/components/surfaces/{panel.d.ts → panel/panel.d.ts} +0 -0
- /package/dist/components/typography/{lists.d.ts → lists/lists.d.ts} +0 -0
- /package/dist/utils/{downloadFile.d.ts → download-file.d.ts} +0 -0
- /package/dist/utils/{formatDecimal.d.ts → format-decimal.d.ts} +0 -0
- /package/dist/utils/{formatPercentage.d.ts → format-percentage.d.ts} +0 -0
- /package/dist/utils/{parseExpirationDate.d.ts → parse-expiration-date.d.ts} +0 -0
- /package/dist/website/{brand-letters.d.ts → brand-letters/brand-letters.d.ts} +0 -0
- /package/dist/website/{use-brand-letters-labels.d.ts → brand-letters/use-brand-letters-labels.d.ts} +0 -0
- /package/dist/website/{calculator.d.ts → calculator/calculator.d.ts} +0 -0
- /package/dist/website/{carousel.d.ts → carousel/carousel.d.ts} +0 -0
- /package/dist/website/{use-carousel-labels.d.ts → carousel/use-carousel-labels.d.ts} +0 -0
- /package/dist/website/{cta-banner.d.ts → cta-banner/cta-banner.d.ts} +0 -0
- /package/dist/website/{expanding-cards-context.d.ts → expanding-cards/expanding-cards-context.d.ts} +0 -0
- /package/dist/website/{expanding-cards.d.ts → expanding-cards/expanding-cards.d.ts} +0 -0
- /package/dist/website/{hero.d.ts → hero/hero.d.ts} +0 -0
- /package/dist/website/{hero-service-grid.d.ts → hero-service-grid/hero-service-grid.d.ts} +0 -0
- /package/dist/website/{navigation-grid.d.ts → navigation-grid/navigation-grid.d.ts} +0 -0
- /package/dist/website/{partner-list.d.ts → partner-list/partner-list.d.ts} +0 -0
- /package/dist/website/{use-partner-list-labels.d.ts → partner-list/use-partner-list-labels.d.ts} +0 -0
- /package/dist/website/{promo-grid.d.ts → promo-grid/promo-grid.d.ts} +0 -0
- /package/dist/website/{section-header.d.ts → section-header/section-header.d.ts} +0 -0
- /package/dist/website/{service-card-grid.d.ts → service-card-grid/service-card-grid.d.ts} +0 -0
- /package/dist/website/{split-content.d.ts → split-content/split-content.d.ts} +0 -0
- /package/dist/website/{stats.d.ts → stats/stats.d.ts} +0 -0
- /package/dist/website/{testimonials.d.ts → testimonials/testimonials.d.ts} +0 -0
- /package/dist/website/{use-testimonials-labels.d.ts → testimonials/use-testimonials-labels.d.ts} +0 -0
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
1
|
+
export * from './download-file';
|
|
2
|
+
export * from './format-decimal';
|
|
3
|
+
export * from './format-decimal-string';
|
|
4
|
+
export * from './format-percentage';
|
|
5
|
+
export * from './parse-expiration-date';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ComponentProps, ReactElement, ReactNode } from 'react';
|
|
2
|
+
/** A title, a text or both: a banner with neither does not compile. */
|
|
3
|
+
type AlertBannerContent = {
|
|
4
|
+
/** The title, 14px semibold, a heading (`titleRender`). */
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* The notice. A string becomes a `<p>`; anything else (the CMS's
|
|
8
|
+
* paragraphs, with links) goes in a `<div>`.
|
|
9
|
+
*/
|
|
10
|
+
text?: ReactNode;
|
|
11
|
+
} | {
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
text: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
export type AlertBannerProps = Omit<ComponentProps<"div">, "children" | "title"> & AlertBannerContent & {
|
|
16
|
+
/**
|
|
17
|
+
* The element of the title.
|
|
18
|
+
* @default <h2 />
|
|
19
|
+
*/
|
|
20
|
+
titleRender?: ReactElement;
|
|
21
|
+
/**
|
|
22
|
+
* The picture before the text, 48px, decoration: the CMS's image with
|
|
23
|
+
* `alt=""`, or an icon. Left out, Lucide's `TriangleAlert`; `null` for
|
|
24
|
+
* none.
|
|
25
|
+
*/
|
|
26
|
+
icon?: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The website's notice (`AlertBanner`, the global one at the foot of every
|
|
30
|
+
* page and the `sections.alert-banner` block): a 48px icon beside a short
|
|
31
|
+
* title and a text, in the colour of the `Section` it sits in.
|
|
32
|
+
*
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <Section surface="muted" spacingTop="sm" spacingBottom="sm">
|
|
35
|
+
* <AlertBanner
|
|
36
|
+
* title="Viktig informasjon"
|
|
37
|
+
* text="Lea Bank ringer deg aldri for å be om BankID, passord eller kortopplysninger."
|
|
38
|
+
* />
|
|
39
|
+
* </Section>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* A notice that stays on the page, not a message that has just appeared: it
|
|
43
|
+
* has no `role="alert"` and is not announced, and it has no close button.
|
|
44
|
+
* For a status message over the page, use `GlobalAlert`. The icon and the
|
|
45
|
+
* text are 32px apart (16 below 768px); title and text are 14px.
|
|
46
|
+
*/
|
|
47
|
+
export declare function AlertBanner({ title, text, titleRender, icon, className, ...rest }: AlertBannerProps): import("react").JSX.Element;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
export type ArrowRevealLinkProps = useRender.ComponentProps<"a"> & {
|
|
3
|
+
/**
|
|
4
|
+
* `"md"`: the header's menus, 16px, the arrow growing in on hover. `"lg"`:
|
|
5
|
+
* the `SideNav`, 18px, underlined on hover, the arrow before the link to
|
|
6
|
+
* the current page (`aria-current="page"`) only.
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size?: "md" | "lg";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Internal: Figma's `.ArrowRevealLink`. At `md`, the links of the header's
|
|
13
|
+
* menus: a plain 16px link whose purple arrow grows in on hover while the
|
|
14
|
+
* text turns purple and steps aside, as the website's `DropdownLink`. At
|
|
15
|
+
* `lg`, the links of `SideNav`: 18px, underlined on hover, and the arrow
|
|
16
|
+
* marks the current page, as the website's `SidebarLink`. Not exported.
|
|
17
|
+
*
|
|
18
|
+
* Renders an `<a>`, or the element passed to `render`: a router link, or the
|
|
19
|
+
* `NavigationMenu.Link` of the desktop menu, which renders the page's own
|
|
20
|
+
* link in turn.
|
|
21
|
+
*/
|
|
22
|
+
export declare function ArrowRevealLink({ render, className, children, size, ...rest }: ArrowRevealLinkProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
@@ -22,7 +22,9 @@ export type CarouselState = {
|
|
|
22
22
|
* The state of a scroll-snap track, for `Carousel`: the places it can stop at
|
|
23
23
|
* (a slide's start, or the end of the track for the last slides, which never
|
|
24
24
|
* reach the start), the one it is at, and `goTo` to scroll to another. The
|
|
25
|
-
* browser does the
|
|
25
|
+
* browser does the swiping and the scrolling by hand; `goTo` scrolls over
|
|
26
|
+
* `SCROLL_DURATION` itself, since the browser's smooth scroll can't be timed.
|
|
27
|
+
* Internal.
|
|
26
28
|
*
|
|
27
29
|
* Before it has measured (on the server, and in the first render), it
|
|
28
30
|
* assumes the website's 2.2 slides from 1024px: one place per slide but the
|
package/dist/website/{expanding-cards-item.d.ts → expanding-cards/expanding-cards-item.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
2
|
import { ReactElement, ReactNode, Ref } from 'react';
|
|
3
|
-
import { SurfaceRoles } from '
|
|
3
|
+
import { SurfaceRoles } from '../../components/color-roles';
|
|
4
4
|
export type ExpandingCardsItemSurface = SurfaceRoles<"base" | "subtle" | "muted" | "contrast" | "contrast-accent">;
|
|
5
5
|
/** `alt` is required with a photo, `""` when it is decoration. */
|
|
6
6
|
type ExpandingCardsItemImage = {
|
package/dist/website/index.d.ts
CHANGED
|
@@ -6,28 +6,32 @@
|
|
|
6
6
|
* which the entry imports itself.
|
|
7
7
|
*
|
|
8
8
|
* The primitives and cards the sections hold (`Panel`, `FeaturedImage`,
|
|
9
|
-
* `MediaCard` and the rest) stay in the main entry.
|
|
10
|
-
* shares with the main entry from
|
|
11
|
-
* tests/entries.test.tsx).
|
|
9
|
+
* `MediaCard` and the rest) stay in the main entry. Each section has a folder
|
|
10
|
+
* of its own and imports what it shares with the main entry from
|
|
11
|
+
* "../../index" (see vite.website.config.ts and tests/entries.test.tsx).
|
|
12
12
|
*
|
|
13
13
|
* Names are flat (`SectionHeader`, not `Section.Header`): the website renders
|
|
14
14
|
* these from server components, which can't dot into a client bundle.
|
|
15
15
|
*/
|
|
16
|
-
export * from './
|
|
17
|
-
export * from './
|
|
18
|
-
export * from './
|
|
19
|
-
export * from './
|
|
20
|
-
export * from './
|
|
21
|
-
export * from './expanding-cards-
|
|
22
|
-
export * from './
|
|
23
|
-
export * from './hero
|
|
24
|
-
export * from './
|
|
25
|
-
export * from './
|
|
26
|
-
export * from './
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './section
|
|
30
|
-
export * from './
|
|
31
|
-
export * from './
|
|
32
|
-
export * from './
|
|
33
|
-
export * from './
|
|
16
|
+
export * from './alert-banner/alert-banner';
|
|
17
|
+
export * from './brand-letters/brand-letters';
|
|
18
|
+
export * from './calculator/calculator';
|
|
19
|
+
export * from './carousel/carousel';
|
|
20
|
+
export * from './cta-banner/cta-banner';
|
|
21
|
+
export * from './expanding-cards/expanding-cards';
|
|
22
|
+
export * from './expanding-cards/expanding-cards-item';
|
|
23
|
+
export * from './hero/hero';
|
|
24
|
+
export * from './hero-service-grid/hero-service-grid';
|
|
25
|
+
export * from './navigation-grid/navigation-grid';
|
|
26
|
+
export * from './partner-list/partner-list';
|
|
27
|
+
export * from './payment-feature/payment-feature';
|
|
28
|
+
export * from './promo-grid/promo-grid';
|
|
29
|
+
export * from './section/section';
|
|
30
|
+
export * from './section-header/section-header';
|
|
31
|
+
export * from './service-card-grid/service-card-grid';
|
|
32
|
+
export * from './side-nav/side-nav';
|
|
33
|
+
export * from './site-footer/site-footer';
|
|
34
|
+
export * from './site-header/site-header';
|
|
35
|
+
export * from './split-content/split-content';
|
|
36
|
+
export * from './stats/stats';
|
|
37
|
+
export * from './testimonials/testimonials';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { PanelProps } from '
|
|
2
|
+
import { PanelProps } from '../../index';
|
|
3
3
|
export type PaymentFeatureImagePosition = "start" | "end";
|
|
4
4
|
/** A logo in the row at the top. */
|
|
5
5
|
export type PaymentFeatureLogo = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRender } from '@base-ui/react/use-render';
|
|
2
2
|
import { Ref } from 'react';
|
|
3
|
-
import { SurfaceRoles } from '
|
|
3
|
+
import { SurfaceRoles } from '../../components/color-roles';
|
|
4
4
|
export type SectionSurface = SurfaceRoles<"base" | "subtle" | "muted" | "contrast" | "contrast-accent">;
|
|
5
5
|
export type SectionSpacing = "none" | "sm" | "lg";
|
|
6
6
|
export type SectionWidth = "full" | "wide" | "narrow";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { SiteHeaderLink } from '../site-header/site-header';
|
|
3
|
+
/**
|
|
4
|
+
* A link in the side navigation: `{ label, href }`, or `{ label, render }`
|
|
5
|
+
* with a router link carrying its own `href`. A link without either does not
|
|
6
|
+
* compile.
|
|
7
|
+
*/
|
|
8
|
+
export type SideNavItem = SiteHeaderLink & {
|
|
9
|
+
/**
|
|
10
|
+
* This page: the link is marked `aria-current="page"` and has the arrow
|
|
11
|
+
* before it.
|
|
12
|
+
*/
|
|
13
|
+
current?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type SideNavProps = Omit<ComponentProps<"div">, "children"> & {
|
|
16
|
+
/** The pages beside this one (the website's child pages), in order. */
|
|
17
|
+
items: SideNavItem[];
|
|
18
|
+
/**
|
|
19
|
+
* The name of the navigation, read out with it: the part of the site it
|
|
20
|
+
* covers ("Investor Relations"). Left out, "Sidemeny".
|
|
21
|
+
*/
|
|
22
|
+
label?: string;
|
|
23
|
+
/** The `Breadcrumbs` at the top of the content panel. */
|
|
24
|
+
breadcrumbs?: ReactNode;
|
|
25
|
+
/** The page's content, in the white panel. */
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The website's two-column page (`TwoColumnLayout`, the Investor Relations
|
|
30
|
+
* pages of leabank.no): a beige sidebar of links to the pages of one part of
|
|
31
|
+
* the site, beside a white panel with the breadcrumbs and the content. Put it
|
|
32
|
+
* in a `Section` (grey, `spacingTop` and `spacingBottom` `sm`, as on the
|
|
33
|
+
* website).
|
|
34
|
+
*
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <Section surface="subtle" spacingTop="sm" spacingBottom="sm">
|
|
37
|
+
* <SideNav
|
|
38
|
+
* label="Investor Relations"
|
|
39
|
+
* items={[
|
|
40
|
+
* { label: "About Lea Bank", render: <NextLink href="/om-oss/investor-relations/about-lea-bank" />, current: true },
|
|
41
|
+
* { label: "Dividend policy", render: <NextLink href="/om-oss/investor-relations/dividend-policy" /> },
|
|
42
|
+
* ]}
|
|
43
|
+
* breadcrumbs={<Breadcrumbs items={crumbs} />}
|
|
44
|
+
* >
|
|
45
|
+
* <RichText>…</RichText>
|
|
46
|
+
* </SideNav>
|
|
47
|
+
* </Section>
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* From 1024px the sidebar is 280px wide (360 from 1312px), 16 from the
|
|
51
|
+
* panel, and stays in view while the page scrolls (32 from the top); below
|
|
52
|
+
* 1024px it is a block over the panel, 32 apart. The sidebar is a `nav`
|
|
53
|
+
* named by `label`; the link to this page is marked `aria-current="page"`
|
|
54
|
+
* and has a purple arrow before it, the others underline on hover. The panel
|
|
55
|
+
* is a `Panel size="sm"`: what is in it stacks 16 apart.
|
|
56
|
+
*/
|
|
57
|
+
export declare function SideNav({ items, label, breadcrumbs, children, className, ...rest }: SideNavProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
type FlagProps = Omit<ComponentProps<"svg">, "children">;
|
|
3
|
+
export declare function FlagNorway(props: FlagProps): import("react").JSX.Element;
|
|
4
|
+
export declare function FlagSweden(props: FlagProps): import("react").JSX.Element;
|
|
5
|
+
export declare function FlagFinland(props: FlagProps): import("react").JSX.Element;
|
|
6
|
+
export declare function FlagSpain(props: FlagProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { ComponentProps, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { SiteHeaderLink } from '../site-header/site-header';
|
|
3
|
+
/**
|
|
4
|
+
* A link in the footer: `{ label, href }`, or `{ label, render }` with a
|
|
5
|
+
* router link carrying its own `href`. A link without either does not
|
|
6
|
+
* compile. A link that opens in a new tab is a `render` with `target`.
|
|
7
|
+
*/
|
|
8
|
+
export type SiteFooterLink = SiteHeaderLink;
|
|
9
|
+
/** A column of links under a title ("Tjenester", "Support", "Juridisk"). */
|
|
10
|
+
export type SiteFooterColumn = {
|
|
11
|
+
/** The title over the links, a heading (`titleRender`). */
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
links: SiteFooterLink[];
|
|
14
|
+
};
|
|
15
|
+
/** A link to one of the bank's pages on a social network. */
|
|
16
|
+
export type SiteFooterSocialLink = SiteFooterLink & {
|
|
17
|
+
/**
|
|
18
|
+
* The network's logo, 24px: an `<img>` or `next/image` with `alt=""`, as
|
|
19
|
+
* the label names the link.
|
|
20
|
+
*/
|
|
21
|
+
icon: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
/** The four markets, by the codes of the languages they speak. */
|
|
24
|
+
export type SiteFooterMarketCode = "no" | "se" | "fi" | "es";
|
|
25
|
+
/** The list of markets: the select that takes the visitor to another one. */
|
|
26
|
+
export type SiteFooterMarket = {
|
|
27
|
+
/** The market of this site, shown with its flag. */
|
|
28
|
+
value: SiteFooterMarketCode;
|
|
29
|
+
/**
|
|
30
|
+
* Called with the market the visitor picks. The website goes to that
|
|
31
|
+
* market's site (`https://leabank.se/`).
|
|
32
|
+
*/
|
|
33
|
+
onValueChange: (value: SiteFooterMarketCode) => void;
|
|
34
|
+
/**
|
|
35
|
+
* The markets to choose from, sorted by name in the page's language.
|
|
36
|
+
* @default ["no", "se", "fi", "es"]
|
|
37
|
+
*/
|
|
38
|
+
options?: readonly SiteFooterMarketCode[];
|
|
39
|
+
/** The title over the select, which names it. Left out, "Marked". */
|
|
40
|
+
title?: ReactNode;
|
|
41
|
+
};
|
|
42
|
+
/** The links to the bank on social networks, under a title. */
|
|
43
|
+
export type SiteFooterSocial = {
|
|
44
|
+
/** The title over the links. Left out, "Sosiale medier". */
|
|
45
|
+
title?: ReactNode;
|
|
46
|
+
links: SiteFooterSocialLink[];
|
|
47
|
+
};
|
|
48
|
+
export type SiteFooterProps = Omit<ComponentProps<"footer">, "children"> & {
|
|
49
|
+
/**
|
|
50
|
+
* The white logo, an `<img>` or `next/image`, 140px wide. It is the
|
|
51
|
+
* content of the link to the start page, named "Lea Bank, forside" as in
|
|
52
|
+
* `SiteHeader`, so the image can take `alt=""`.
|
|
53
|
+
*/
|
|
54
|
+
logo: ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* The link to the start page, a router link carrying its own `href`:
|
|
57
|
+
* `<NextLink href="/" />`.
|
|
58
|
+
* @default <a href="/" />
|
|
59
|
+
*/
|
|
60
|
+
homeRender?: ReactElement;
|
|
61
|
+
/** The columns of links, in order. */
|
|
62
|
+
columns?: SiteFooterColumn[];
|
|
63
|
+
/** The market select, at the top of the last column. */
|
|
64
|
+
market?: SiteFooterMarket;
|
|
65
|
+
/** The social links, at the foot of the last column. */
|
|
66
|
+
social?: SiteFooterSocial;
|
|
67
|
+
/**
|
|
68
|
+
* Called by the button that opens the cookie settings, which shows only
|
|
69
|
+
* with it: `openCookieSettings` from
|
|
70
|
+
* `@leabankab/component-library/cookie-consent`, or the website's own.
|
|
71
|
+
*/
|
|
72
|
+
onOpenCookieSettings?: () => void;
|
|
73
|
+
/**
|
|
74
|
+
* The line at the very end. A string becomes a `<p>`; anything else (the
|
|
75
|
+
* CMS's paragraphs) goes in a `<div>`.
|
|
76
|
+
*/
|
|
77
|
+
copyright?: ReactNode;
|
|
78
|
+
/**
|
|
79
|
+
* The element of every title in the footer.
|
|
80
|
+
* @default <h2 />
|
|
81
|
+
*/
|
|
82
|
+
titleRender?: ReactElement;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* The website's footer, as at the end of every page of leabank.no: the
|
|
86
|
+
* white logo, the columns of links, the market select and the social links
|
|
87
|
+
* on a near-black band, then a line, the cookie settings and the copyright.
|
|
88
|
+
*
|
|
89
|
+
* ```tsx
|
|
90
|
+
* <SiteFooter
|
|
91
|
+
* logo={<img src="/lea-bank-white.svg" alt="" />}
|
|
92
|
+
* homeRender={<NextLink href="/" />}
|
|
93
|
+
* columns={[
|
|
94
|
+
* {
|
|
95
|
+
* title: "Tjenester",
|
|
96
|
+
* links: [{ label: "Lån", render: <NextLink href="/lan" /> }],
|
|
97
|
+
* },
|
|
98
|
+
* ]}
|
|
99
|
+
* market={{ value: "no", onValueChange: (market) => location.assign(sites[market]) }}
|
|
100
|
+
* social={{
|
|
101
|
+
* links: [
|
|
102
|
+
* {
|
|
103
|
+
* label: "Facebook",
|
|
104
|
+
* icon: <img src="/facebook.svg" alt="" />,
|
|
105
|
+
* render: <a href="https://www.facebook.com/leabank" target="_blank" rel="noopener noreferrer" />,
|
|
106
|
+
* },
|
|
107
|
+
* ],
|
|
108
|
+
* }}
|
|
109
|
+
* onOpenCookieSettings={openCookieSettings}
|
|
110
|
+
* copyright="Copyright © 2005–2026 Lea Bank AB NUF (publ)."
|
|
111
|
+
* />
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* The columns share the width, as many 140px columns as fit beside the logo
|
|
115
|
+
* from 1024px (five at 1440px), under it below; two columns below 768px and
|
|
116
|
+
* one below 640px. The market select is Paloma's `Select` at `size="sm"`,
|
|
117
|
+
* each market with its flag, named by the title over it; picking a market
|
|
118
|
+
* calls `onValueChange` and goes nowhere by itself. `market.onValueChange`
|
|
119
|
+
* and `onOpenCookieSettings` are functions, so a server component renders
|
|
120
|
+
* the footer through a client component of its own.
|
|
121
|
+
*/
|
|
122
|
+
export declare function SiteFooter({ logo, homeRender, columns, market, social, onOpenCookieSettings, copyright, titleRender, className, ...rest }: SiteFooterProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words of `SiteFooter`: the titles of the market and social columns
|
|
3
|
+
* when the page gives none, and the button that opens the cookie settings.
|
|
4
|
+
* `collation` is the language the markets are sorted in, as a BCP 47 tag
|
|
5
|
+
* for `Intl.Collator`. The link round the logo takes `SiteHeader`'s name.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useSiteFooterLabels: () => Record<"collation" | "market" | "social" | "cookieSettings", string>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SiteHeaderItem } from './site-header';
|
|
3
|
+
type SiteHeaderMenuProps = {
|
|
4
|
+
items: SiteHeaderItem[];
|
|
5
|
+
/** The link around the logo, shown in the menu's own bar too. */
|
|
6
|
+
home: ReactNode;
|
|
7
|
+
/** The account link, shown in the menu's own bar too. */
|
|
8
|
+
account: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Internal to `SiteHeader`: the menu below 1312px. The button in the bar
|
|
12
|
+
* opens a dialog that drops in from the top (Base UI's `Drawer`): focus
|
|
13
|
+
* moves into it and stays there, the page behind it does not scroll, and
|
|
14
|
+
* Escape, the close button, a swipe up or a press outside closes it. The
|
|
15
|
+
* dialog starts with a bar of its own, the bar of the header with a close
|
|
16
|
+
* button where the menu button was, so the visitor sees the same bar and
|
|
17
|
+
* always has a visible way out. Its links are not in the page while it is
|
|
18
|
+
* closed, and following one closes it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function SiteHeaderMenu({ items, home, account }: SiteHeaderMenuProps): import("react").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ComponentProps, ReactElement, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Where a link goes: `href`, or a router link in `render` that carries its
|
|
4
|
+
* own (`<NextLink href="/lan" />`). A link without either does not compile.
|
|
5
|
+
*/
|
|
6
|
+
export type SiteHeaderLinkTarget = {
|
|
7
|
+
/** Where the link goes. */
|
|
8
|
+
href: string;
|
|
9
|
+
/**
|
|
10
|
+
* A router link to render instead of an `<a>`, carrying its own
|
|
11
|
+
* `href`, and any `target` or `data-` attribute the page wants on it.
|
|
12
|
+
*/
|
|
13
|
+
render?: ReactElement;
|
|
14
|
+
} | {
|
|
15
|
+
href?: undefined;
|
|
16
|
+
render: ReactElement;
|
|
17
|
+
};
|
|
18
|
+
/** A link in the header or in one of its menus. */
|
|
19
|
+
export type SiteHeaderLink = SiteHeaderLinkTarget & {
|
|
20
|
+
/** The text of the link. */
|
|
21
|
+
label: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A group of links in a menu: the website's "Sublink", a column of the
|
|
25
|
+
* dropdown. The menus on leabank.no have one each.
|
|
26
|
+
*/
|
|
27
|
+
export type SiteHeaderGroup = {
|
|
28
|
+
/**
|
|
29
|
+
* The small title over the links on a wide screen ("Låneprodukter"). It
|
|
30
|
+
* names the list; the phone menu leaves it out, as the website's.
|
|
31
|
+
*/
|
|
32
|
+
title?: ReactNode;
|
|
33
|
+
/** The links, each with the arrow that grows in on hover. */
|
|
34
|
+
links: SiteHeaderLink[];
|
|
35
|
+
/**
|
|
36
|
+
* The last link, under a short purple line, with an arrow pointing up and
|
|
37
|
+
* to the right ("Se våre lån").
|
|
38
|
+
*/
|
|
39
|
+
cta?: SiteHeaderLink;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* A top-level item: a link, or a menu of `groups`. With a menu the item is a
|
|
43
|
+
* button that opens it, so its own page is not a click on the item any more:
|
|
44
|
+
* link to it in the menu (the website's menus do, with the `cta` or a link).
|
|
45
|
+
* Given `href` or `render`, a menu item's own page is the first link of its
|
|
46
|
+
* submenu on a phone, in small bold type, as on the website.
|
|
47
|
+
*/
|
|
48
|
+
export type SiteHeaderItem = (SiteHeaderLink & {
|
|
49
|
+
groups?: undefined;
|
|
50
|
+
}) | {
|
|
51
|
+
/** The text of the item. */
|
|
52
|
+
label: ReactNode;
|
|
53
|
+
/** The item's own page, the first link of its submenu on a phone. */
|
|
54
|
+
href?: string;
|
|
55
|
+
/** A router link to the item's own page, instead of `href`. */
|
|
56
|
+
render?: ReactElement;
|
|
57
|
+
/** The menu that opens from the item. */
|
|
58
|
+
groups: SiteHeaderGroup[];
|
|
59
|
+
};
|
|
60
|
+
/** The account link, a round icon beside the call to action. */
|
|
61
|
+
export type SiteHeaderAccount = SiteHeaderLinkTarget & {
|
|
62
|
+
/**
|
|
63
|
+
* The link's name, read out in place of the icon ("Logg inn", "Min side").
|
|
64
|
+
*/
|
|
65
|
+
label: string;
|
|
66
|
+
/**
|
|
67
|
+
* The icon, 40px (32px below 1312px). Left out, Lucide's
|
|
68
|
+
* `CircleUserRound`; the website passes its own image with `alt=""`.
|
|
69
|
+
*/
|
|
70
|
+
icon?: ReactNode;
|
|
71
|
+
};
|
|
72
|
+
export type SiteHeaderProps = Omit<ComponentProps<"header">, "children"> & {
|
|
73
|
+
/**
|
|
74
|
+
* The logo, an `<img>` or `next/image`, 38px tall (32px below 1312px). It
|
|
75
|
+
* is the content of the link to the start page, which is named "Lea Bank,
|
|
76
|
+
* forside" by the header, so the image can take `alt=""`.
|
|
77
|
+
*/
|
|
78
|
+
logo: ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* The link to the start page, a router link carrying its own `href`:
|
|
81
|
+
* `<NextLink href="/" />`.
|
|
82
|
+
* @default <a href="/" />
|
|
83
|
+
*/
|
|
84
|
+
homeRender?: ReactElement;
|
|
85
|
+
/** The items at the start of the row (Lån, Sparing, Forsikring …). */
|
|
86
|
+
items: SiteHeaderItem[];
|
|
87
|
+
/**
|
|
88
|
+
* The items pushed to the end of the row (Kundeservice, Om oss). On a
|
|
89
|
+
* phone they follow `items` in the menu.
|
|
90
|
+
*/
|
|
91
|
+
endItems?: SiteHeaderItem[];
|
|
92
|
+
/** The account link, an icon at the end of the bar at every width. */
|
|
93
|
+
account?: SiteHeaderAccount;
|
|
94
|
+
/**
|
|
95
|
+
* The call to action at the end of the bar from 1312px, an
|
|
96
|
+
* `ActionButton size="sm"` ("Min side"). Below 1312px it is left out, as
|
|
97
|
+
* on the website.
|
|
98
|
+
*/
|
|
99
|
+
action?: ReactNode;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* The website's header, as on every page of leabank.no: the logo, the main
|
|
103
|
+
* navigation, the account link and a call to action on a white bar, with
|
|
104
|
+
* the brand stripe under it.
|
|
105
|
+
*
|
|
106
|
+
* ```tsx
|
|
107
|
+
* <SiteHeader
|
|
108
|
+
* logo={<img src="/lea-bank.svg" alt="" />}
|
|
109
|
+
* homeRender={<NextLink href="/" />}
|
|
110
|
+
* items={[
|
|
111
|
+
* {
|
|
112
|
+
* label: "Lån",
|
|
113
|
+
* render: <NextLink href="/lan" />,
|
|
114
|
+
* groups: [
|
|
115
|
+
* {
|
|
116
|
+
* title: "Låneprodukter",
|
|
117
|
+
* links: [{ label: "Forbrukslån", render: <NextLink href="/lan/forbrukslan" /> }],
|
|
118
|
+
* cta: { label: "Se våre lån", render: <NextLink href="/lan" /> },
|
|
119
|
+
* },
|
|
120
|
+
* ],
|
|
121
|
+
* },
|
|
122
|
+
* { label: "Økonomiguiden", render: <NextLink href="/okonomiguiden" /> },
|
|
123
|
+
* ]}
|
|
124
|
+
* endItems={[{ label: "Kundeservice", href: "/kundeservice" }]}
|
|
125
|
+
* account={{ label: "Logg inn", href: "https://secure.leabank.no/" }}
|
|
126
|
+
* action={<ActionButton size="sm" render={<a href="https://secure.leabank.no/" />}>Min side</ActionButton>}
|
|
127
|
+
* />
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* From 1312px the bar is 72px tall: the items are 40px pills that turn grey
|
|
131
|
+
* on hover, and an item with `groups` opens its menu, a white panel with the
|
|
132
|
+
* website's soft shadow, on hover, on a click and with the arrow-down key
|
|
133
|
+
* (Base UI's `NavigationMenu`: links, not a `role="menu"`; Escape closes it,
|
|
134
|
+
* and the focus moves into it with Tab). Below 1312px the bar is 55px tall
|
|
135
|
+
* with a menu button, the logo in the middle and the account icon; the menu
|
|
136
|
+
* drops in from under the bar as a dialog (Base UI's `Drawer` from the top),
|
|
137
|
+
* the items 72px rows and the menus disclosures, one open at a time. The
|
|
138
|
+
* menu closes when a link in it is followed, and its links are not in the
|
|
139
|
+
* page while it is closed.
|
|
140
|
+
*/
|
|
141
|
+
export declare function SiteHeader({ logo, homeRender, items, endItems, account, action, className, ...rest }: SiteHeaderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentProps, ReactElement } from 'react';
|
|
2
|
+
import { SiteHeaderGroup, SiteHeaderItem } from './site-header/site-header';
|
|
3
|
+
/**
|
|
4
|
+
* Internal to `SiteHeader`: a link to `href`, or the router link in
|
|
5
|
+
* `render`, which carries its own.
|
|
6
|
+
*/
|
|
7
|
+
export declare function SiteLink({ href, render, ...rest }: Omit<ComponentProps<"a">, "href"> & {
|
|
8
|
+
href?: string;
|
|
9
|
+
render?: ReactElement;
|
|
10
|
+
}): ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
11
|
+
/** Whether an item opens a menu: it has a group to show. */
|
|
12
|
+
export declare const hasMenu: (item: SiteHeaderItem) => item is Extract<SiteHeaderItem, {
|
|
13
|
+
groups: SiteHeaderGroup[];
|
|
14
|
+
}>;
|
|
15
|
+
/** Whether an item has a page of its own to link to. */
|
|
16
|
+
export declare const hasPage: (item: SiteHeaderItem) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words of `SiteHeader`: the name of the navigation, the menu button on
|
|
3
|
+
* a phone and the button that closes the menu, and the name of the link
|
|
4
|
+
* around the logo. The link's name starts with the words in the logo, so
|
|
5
|
+
* what a voice user reads out matches what they see.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useSiteHeaderLabels: () => Record<"menu" | "navigation" | "home" | "closeMenu", string>;
|