@leabankab/component-library 8.6.0 → 8.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/component-library.es.js +1925 -1087
  3. package/dist/component-library.es.js.map +1 -1
  4. package/dist/component-library.umd.js +2 -2
  5. package/dist/component-library.umd.js.map +1 -1
  6. package/dist/components/buttons/action-button.d.ts +34 -4
  7. package/dist/components/buttons/button-base.d.ts +5 -2
  8. package/dist/components/buttons/icon-button.d.ts +16 -2
  9. package/dist/components/color-roles.d.ts +7 -1
  10. package/dist/components/data-display/arrow-circle.d.ts +21 -0
  11. package/dist/components/data-display/article-card.d.ts +88 -0
  12. package/dist/components/data-display/avatar.d.ts +33 -0
  13. package/dist/components/data-display/chip.d.ts +8 -3
  14. package/dist/components/data-display/featured-image.d.ts +42 -0
  15. package/dist/components/data-display/index.d.ts +12 -0
  16. package/dist/components/data-display/link-card.d.ts +52 -0
  17. package/dist/components/data-display/media-card.d.ts +102 -0
  18. package/dist/components/data-display/partner-row.d.ts +46 -0
  19. package/dist/components/data-display/rich-text.d.ts +27 -0
  20. package/dist/components/data-display/service-card.d.ts +80 -0
  21. package/dist/components/data-display/star-rating.d.ts +26 -0
  22. package/dist/components/data-display/table.d.ts +93 -0
  23. package/dist/components/data-display/testimonial-card.d.ts +43 -0
  24. package/dist/components/data-display/use-star-rating-labels.d.ts +5 -0
  25. package/dist/components/data-display/use-video-player-labels.d.ts +2 -0
  26. package/dist/components/data-display/video-player.d.ts +22 -0
  27. package/dist/components/data-display/website-card.d.ts +10 -0
  28. package/dist/components/feedback/index.d.ts +1 -0
  29. package/dist/components/feedback/skeleton.d.ts +22 -0
  30. package/dist/components/navigation/breadcrumbs.d.ts +38 -0
  31. package/dist/components/navigation/index.d.ts +3 -0
  32. package/dist/components/navigation/pagination-dots.d.ts +34 -0
  33. package/dist/components/navigation/pagination.d.ts +37 -0
  34. package/dist/components/navigation/use-breadcrumbs-labels.d.ts +2 -0
  35. package/dist/components/navigation/use-pagination-labels.d.ts +7 -0
  36. package/dist/components/surfaces/accordion.d.ts +5 -1
  37. package/dist/components/surfaces/index.d.ts +1 -0
  38. package/dist/components/surfaces/panel.d.ts +30 -0
  39. package/dist/components/typography/link.d.ts +14 -1
  40. package/dist/cookie-consent-react.cjs +1 -1
  41. package/dist/cookie-consent-react.cjs.map +1 -1
  42. package/dist/cookie-consent-react.mjs +22 -22
  43. package/dist/cookie-consent-react.mjs.map +1 -1
  44. package/dist/cookie-consent.css +1 -1
  45. package/dist/date-picker.cjs +1 -1
  46. package/dist/date-picker.cjs.map +1 -1
  47. package/dist/date-picker.mjs +216 -203
  48. package/dist/date-picker.mjs.map +1 -1
  49. package/dist/index.css +1 -1
  50. package/dist/index.d.ts +1 -1
  51. package/dist/tailwind.css +16 -0
  52. package/dist/theme/index.d.ts +1 -1
  53. package/dist/theme/token-types.d.ts +13 -3
  54. package/dist/theme/tokens/breakpoints.d.ts +20 -0
  55. package/dist/theme/tokens/font-family.d.ts +6 -0
  56. package/dist/theme/tokens/index.d.ts +1 -0
  57. package/dist/theme/tokens/shadows.d.ts +6 -0
  58. package/dist/theme/tokens/text-styles.d.ts +8 -0
  59. package/dist/theme/tokens/widths.d.ts +10 -0
  60. package/dist/theme/types.d.ts +9 -1
  61. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  export type ColorToken = "base" | "subtle" | "muted" | "contrast" | "accent";
2
- export type BgColorToken = ColorToken | "overlay";
3
- export type TextColorToken = ColorToken;
2
+ export type BgColorToken = ColorToken | "overlay" | "hover" | "contrast-hover" | "contrast-accent";
3
+ export type TextColorToken = ColorToken | "contrast-hover";
4
4
  export type BorderColorToken = ColorToken;
5
5
  export type BrandColorToken = "base" | "hover" | "subtle" | "contrast";
6
6
  export type StatusColorToken = "base" | "subtle";
@@ -15,8 +15,18 @@ export type ColorPath = `bg.${BgColorToken}` | `text.${TextColorToken}` | `borde
15
15
  * - `neutral`: the greys, for something that should carry no meaning.
16
16
  * - `success`, `info`, `warning`, `error`: the statuses.
17
17
  * - `contrast`: for use on a dark surface.
18
+ * - `muted`: the warm beige of `bg.muted`, for a tag on the website.
18
19
  */
19
- export type ColorRole = "primary" | "secondary" | "tertiary" | "neutral" | "success" | "info" | "warning" | "error" | "contrast";
20
+ export type ColorRole = "primary" | "secondary" | "tertiary" | "neutral" | "success" | "info" | "warning" | "error" | "contrast" | "muted";
21
+ /**
22
+ * The values a website component's `surface` prop can take: the background of
23
+ * a section or card, named after its `bg` token. `base` is white, `subtle` the
24
+ * grey, `muted` the beige, `contrast` the near-black and `contrast-accent` the
25
+ * deep purple. On the last two, text is `text.contrast`. Like `ColorRole`, it
26
+ * names a role and never a hue, and a component accepts the ones it has a
27
+ * design for.
28
+ */
29
+ export type SurfaceRole = "base" | "subtle" | "muted" | "contrast" | "contrast-accent";
20
30
  /** Allowed values for MUI `Typography` `color` prop (semantic text tokens). */
21
31
  export type TypographyColorToken = `text.${TextColorToken}`;
22
32
  /** Common spacing scale factors (8px base via `theme.spacing` / `theme.space`). */
@@ -14,3 +14,23 @@ export declare const breakpoints: {
14
14
  readonly xl: 1536;
15
15
  };
16
16
  export type Breakpoint = keyof typeof breakpoints;
17
+ /**
18
+ * The website's own widths, for the website components only, so a layout on
19
+ * leabank.no switches where it does today. Named as in the website's theme.
20
+ * There each is a `max-width` (`mobile` is up to 640px); here, as everywhere in
21
+ * the library, a CSS Module writes them mobile-first: `@media (min-width:
22
+ * 640px)` starts above `mobile`, and `max-width: 639.95px` ends below it. That
23
+ * moves each switch by one pixel, at exactly the width itself.
24
+ *
25
+ * They are not part of `Breakpoint`, so `Container` sizes and the responsive
26
+ * props of `Stack` and `Grid` keep their five steps.
27
+ */
28
+ export declare const websiteBreakpoints: {
29
+ readonly mobile: 640;
30
+ readonly tablet: 768;
31
+ readonly desktop: 1024;
32
+ /** The website's `mobileHeader`: below it the header is the mobile one. */
33
+ readonly header: 1312;
34
+ readonly wide: 1440;
35
+ };
36
+ export type WebsiteBreakpoint = keyof typeof websiteBreakpoints;
@@ -7,3 +7,9 @@
7
7
  * loads.
8
8
  */
9
9
  export declare const fontFamily = "\"ClashGrotesk\", \"ClashGrotesk Fallback\", sans-serif";
10
+ /**
11
+ * The stack for code in CMS text (`RichText`'s `code` and `pre`), emitted as
12
+ * `--lea-font-family-mono`: the website's Courier New, then the platform's own
13
+ * monospace. Nothing else sets text in it, and no face is shipped for it.
14
+ */
15
+ export declare const fontFamilyMono = "\"Courier New\", Courier, monospace";
@@ -12,3 +12,4 @@ export * from './spacing';
12
12
  export * from './text-styles';
13
13
  export * from './transitions';
14
14
  export * from './type-scale';
15
+ export * from './widths';
@@ -5,5 +5,11 @@ export declare const shadows: {
5
5
  readonly lg: "0px 10px 15px -3px rgba(0, 0, 0, 0.10), 0px 4px 6px -4px rgba(0, 0, 0, 0.10)";
6
6
  readonly xl: "0px 20px 25px -5px rgba(0, 0, 0, 0.10), 0px 8px 10px -6px rgba(0, 0, 0, 0.10)";
7
7
  readonly "2xl": "0px 25px 50px -12px rgba(0, 0, 0, 0.25)";
8
+ /**
9
+ * The website's shadow: an even 6px halo with no offset, the exact value of
10
+ * leabank.no. For the website components that float over a section (the
11
+ * elevated `IconButton`, the partner logo tile, the header dropdown).
12
+ */
13
+ readonly soft: "0 0 6px 0 rgba(86, 86, 118, 0.10)";
8
14
  readonly inner: "0px 2px 4px 0px rgba(0, 0, 0, 0.05) inset";
9
15
  };
@@ -18,6 +18,10 @@ type TextStyleDefinition = {
18
18
  * `label` move one step at a time; `heading` and `display` move two, because
19
19
  * neighbouring steps are too close to tell two headings apart.
20
20
  *
21
+ * `title` is a heading in the regular weight, for the website: the title of a
22
+ * link card (`title-md`) and an uppercase promo title (`title-xl`). It takes
23
+ * the sizes and line heights of `heading-md` and `heading-xl`.
24
+ *
21
25
  * The Figma text styles `heading/lg` and so on mirror this file.
22
26
  */
23
27
  export declare const textStyles: {
@@ -32,6 +36,10 @@ export declare const textStyles: {
32
36
  lg: TextStyleDefinition;
33
37
  xl: TextStyleDefinition;
34
38
  };
39
+ title: {
40
+ md: TextStyleDefinition;
41
+ xl: TextStyleDefinition;
42
+ };
35
43
  body: {
36
44
  xs: TextStyleDefinition;
37
45
  sm: TextStyleDefinition;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Content widths in pixels, emitted as `--lea-width-{name}`. Not breakpoints:
3
+ * a width caps how wide content grows, a breakpoint is where a layout changes.
4
+ *
5
+ * - `section`: the content column of a website section, 1312px (1440 less 64
6
+ * at each side). The Figma variable `width/section` holds the same number.
7
+ */
8
+ export declare const widths: {
9
+ readonly section: 1312;
10
+ };
@@ -16,6 +16,12 @@ export type Palette = {
16
16
  accent: string;
17
17
  /** The see-through layer behind a dialog or drawer. */
18
18
  overlay: string;
19
+ /** Hover on a website card or panel with a light surface. */
20
+ hover: string;
21
+ /** Hover on a website card or panel with a dark surface. */
22
+ "contrast-hover": string;
23
+ /** The deep purple of a website section or card. Takes `text.contrast`. */
24
+ "contrast-accent": string;
19
25
  };
20
26
  text: {
21
27
  base: string;
@@ -23,6 +29,8 @@ export type Palette = {
23
29
  muted: string;
24
30
  accent: string;
25
31
  contrast: string;
32
+ /** Hover on a link on a dark surface, on the website. */
33
+ "contrast-hover": string;
26
34
  };
27
35
  border: {
28
36
  base: string;
@@ -66,4 +74,4 @@ export type EasingToken = keyof typeof import('./tokens/transitions').easings;
66
74
  export type DurationToken = keyof typeof import('./tokens/transitions').durations;
67
75
  export type LineHeightToken = keyof typeof import('./tokens/line-heights').lineHeights;
68
76
  export type { TextStyleToken } from './tokens/text-styles';
69
- export type { BgColorToken, BorderColorToken, BrandColorToken, ColorPath, ColorRole, ColorToken, SpacingFactor, StatusColorToken, TextColorToken, TypographyColorToken, } from './token-types';
77
+ export type { BgColorToken, BorderColorToken, BrandColorToken, ColorPath, ColorRole, ColorToken, SpacingFactor, StatusColorToken, SurfaceRole, TextColorToken, TypographyColorToken, } from './token-types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leabankab/component-library",
3
- "version": "8.6.0",
3
+ "version": "8.7.0",
4
4
  "description": "@leabankab/component-library — Lea Bank's React component library.",
5
5
  "engines": {
6
6
  "node": ">=20"