@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,69 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c721111: New cards for the website:
8
+
9
+ - `LinkCard`: the navigation card, a title and a round arrow, and the whole card is one link (`href`, or a router link in `render`). In five colours through `surface`; on hover it takes the website's purple tint and the arrow slides.
10
+ - `MediaCard`: a photo and text. Horizontal, a coloured card with the text in one half and the photo in the other from 1024px (`imagePosition`, `imageAsBackground`); vertical, a photo over centred text, for a row of cards. `action` takes an `ActionButton` or a `Link`, `priceExample` the small print.
11
+ - `ServiceCard`: a card of the website's service grid, with a photo that fills the room the text leaves (`layout="stacked"`) or a square photo before the text (`layout="row"`), an optional icon, in five colours.
12
+ - `TestimonialCard`: a customer review as a `figure`, with `StarRating`, the quote in quotation marks and the person with an `Avatar`.
13
+ - `ArticleCard`: an article or a job opening in a list, one link with the title, a two-line excerpt and the facts as beige pills (`variant="post"` or `"job"`); the title is underlined on hover.
14
+ - `PartnerRow`: text about a partner beside its logo on a white tile, over a line.
15
+
16
+ `MediaCard` and `ServiceCard` become one link when `render` is a link (`render={<NextLink href="/lan" />}`). A card that is a link is named by its title and described by its text, and its focus ring shows on light and dark sections. On the dark surfaces the text, the arrow and the price example are white.
17
+
18
+ - ac44e29: Existing components extended for the website:
19
+
20
+ - `ActionButton` takes the website's look: an 18px semibold label (16px on a phone), 32px from the edge and from the arrow, and on hover the label slides towards the arrow while the arrow turns purple and points up. New `size` (`"lg"`, the default, or `"sm"`, 40px tall) and `iconOnly`, which shows only the arrow and keeps the label as the accessible name.
21
+ - `IconButton` takes `variant="elevated"`: a white disc with a small shadow, for controls over a picture or a coloured section.
22
+ - `Link` takes `arrow`: a chevron after the text that slides on hover, while the text turns purple, or light purple with `color="contrast"`. Links without `arrow` keep their hover.
23
+ - `Chip` takes `color="muted"`, the website's beige pill, and `muted` joins `ColorRole`.
24
+ - `Accordion.Root` and `SimpleAccordion` take `variant="card"`: white cards with 16px corners, for a grey section.
25
+ - New `SurfaceRole` type (`base`, `subtle`, `muted`, `contrast`, `contrast-accent`), the values of the `surface` prop the website cards and sections will take.
26
+ - New `websiteBreakpoints` (640, 768, 1024, 1312, 1440), the website's own widths, for the website components.
27
+
28
+ - a6b0816: New components for the website's content:
29
+
30
+ - `Table`, with `TableHead`, `TableBody`, `TableRow`, `TableHeaderCell` and `TableCell`: the website's price table, a 1px line under every row, the first column at the start, the last at the end and the rest centred (`align` on a cell overrides it). 16px text, 14px below 640px; `size` fixes either. The header row is optional, and a header cell at the start of a body row heads that row. A table wider than its column scrolls sideways, and its box can then be reached with the keyboard.
31
+ - `RichText`: styles text from the CMS (headings, paragraphs, bold, italic, underline, strikethrough, lists, links, quotes, code and images) on the library's text styles, with the website's spacing. It styles only bare elements, so a library component inside keeps its look, and it does not sanitise: an HTML string has to be cleaned before it goes in through `dangerouslySetInnerHTML`.
32
+ - `Panel`: the website's white box, 64px corners and 64px inside, 32px and 32px below 768px; `size` fixes either.
33
+ - `FeaturedImage`: a large photo with 64px corners and an optional call to action 32px in from the bottom right; it fills its row from 1024px and is 1 : 0.7 below. `imageRender` takes `next/image`.
34
+ - `VideoPlayer`: a silent, looping 16 : 9 video with a play / pause button under it (the elevated `IconButton`). It starts by itself once the page has loaded, except under reduced motion, where it waits for the button.
35
+ - New token `--lea-font-family-mono` (`fontFamilyMono`): the website's Courier New stack, for the code in `RichText`.
36
+
37
+ The button names of `VideoPlayer` are translated (no, se, fi, es).
38
+
39
+ - 41539df: New components for the website, and three website components moved to the website's sizes:
40
+
41
+ - `Breadcrumbs`: the way to the current page, in a named `nav`; links through `href` or a router link in `render`.
42
+ - `Pagination`: numbered pages with previous and next, as buttons or, with `renderLink`, as links. From eight pages it shows the first, the last and the current page with its neighbours.
43
+ - `PaginationDots`: one dot per page for a carousel or a paged list; each dot is a named button.
44
+ - `StarRating`: a read-only rating in stars, one image named "4 av 5 stjerner" to a screen reader.
45
+ - `Avatar`: a round 48px photo on Base UI's `Avatar`, a grey disc until it loads; `imageRender` for `next/image`.
46
+ - `Skeleton`: a grey block that pulses while content loads, hidden from screen readers.
47
+ - New shadow token `soft` (`--lea-shadow-soft`, `shadow-soft`): the website's even 6px halo.
48
+ - `IconButton` `variant="elevated"` is 40px at `md` and takes the `soft` shadow, as on leabank.no. Its `sm` and `lg` sizes are unchanged.
49
+ - `Chip` takes `size="lg"`, the website's pill (16px semibold, 28px tall), in every colour and variant.
50
+ - `Accordion` and `SimpleAccordion` `variant="card"` take the website's FAQ spacing: 16px between the cards and inside the header, titles in 18px semibold (16px below 768px), 32px above and below the answer.
51
+
52
+ The texts of the new components are translated (no, se, fi, es).
53
+
54
+ - 54ee507: New design tokens for the website components:
55
+
56
+ - Palette roles `bg.hover`, `bg.contrast-hover`, `bg.contrast-accent` and `text.contrast-hover` (`--lea-palette-bg-hover` and so on, `bg-bg-hover` in Tailwind), and in `BgColorToken` and `TextColorToken`, so `<Text color="text.contrast-hover">` works.
57
+ - `--lea-width-section` (1312px), the content width of a website section; `max-w-section` in Tailwind.
58
+ - Text styles `title-md` and `title-xl`, headings in the regular weight: `<Text textStyle="title-md">`, `--lea-text-title-md-*` and `text-title-md` in Tailwind.
59
+
60
+ ## 8.6.1
61
+
62
+ ### Patch Changes
63
+
64
+ - 9516cbb: Description in dialog gets text.base instead of text.subtle
65
+ - 9516cbb: A `Stack`, `HStack`, `Grid` or `GridItem` inside another no longer takes the outer one's `direction`, `gap`, `columns` or `span`. A prop it isn't given now falls back to its default, as documented: a nested `Stack` is a column with no gap, a nested `Grid` has 12 columns, and a `GridItem` without `span` covers the row. Apps that reset these styles themselves can drop that CSS.
66
+
3
67
  ## 8.6.0
4
68
 
5
69
  ### Minor Changes