@leabankab/component-library 5.6.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.
Files changed (190) hide show
  1. package/CHANGELOG.md +408 -0
  2. package/README.md +22 -0
  3. package/dist/bankidlogo.png +0 -0
  4. package/dist/component-library.es.js +6143 -0
  5. package/dist/component-library.es.js.map +1 -0
  6. package/dist/component-library.umd.js +35 -0
  7. package/dist/component-library.umd.js.map +1 -0
  8. package/dist/components/animations/icons/index.d.ts +1 -0
  9. package/dist/components/animations/icons/status-icon.d.ts +21 -0
  10. package/dist/components/animations/illustrations/check-animation.d.ts +12 -0
  11. package/dist/components/animations/illustrations/index.d.ts +3 -0
  12. package/dist/components/animations/illustrations/pulse-animation.d.ts +12 -0
  13. package/dist/components/animations/illustrations/status-animation.d.ts +32 -0
  14. package/dist/components/animations/index.d.ts +2 -0
  15. package/dist/components/animations/shared.d.ts +67 -0
  16. package/dist/components/animations/use-animation-labels.d.ts +6 -0
  17. package/dist/components/buttons/action-button.d.ts +18 -0
  18. package/dist/components/buttons/button.d.ts +20 -0
  19. package/dist/components/buttons/download-trigger.d.ts +33 -0
  20. package/dist/components/buttons/icon-button.d.ts +12 -0
  21. package/dist/components/buttons/index.d.ts +5 -0
  22. package/dist/components/buttons/skip-link.d.ts +6 -0
  23. package/dist/components/buttons/use-download-labels.d.ts +5 -0
  24. package/dist/components/data-display/card.d.ts +6 -0
  25. package/dist/components/data-display/chip.d.ts +11 -0
  26. package/dist/components/data-display/data-field.d.ts +12 -0
  27. package/dist/components/data-display/index.d.ts +4 -0
  28. package/dist/components/data-display/tooltip.d.ts +37 -0
  29. package/dist/components/data-display/use-chip-labels.d.ts +6 -0
  30. package/dist/components/dev-panel/dev-panel-country.d.ts +26 -0
  31. package/dist/components/dev-panel/dev-panel-flow.d.ts +28 -0
  32. package/dist/components/dev-panel/dev-panel-footer.d.ts +26 -0
  33. package/dist/components/dev-panel/dev-panel-payload.d.ts +47 -0
  34. package/dist/components/dev-panel/dev-panel-status.d.ts +31 -0
  35. package/dist/components/dev-panel/dev-panel-step-state.d.ts +28 -0
  36. package/dist/components/dev-panel/dev-panel-steps.d.ts +39 -0
  37. package/dist/components/dev-panel/dev-panel-variant.d.ts +21 -0
  38. package/dist/components/dev-panel/dev-panel.d.ts +61 -0
  39. package/dist/components/dev-panel/index.d.ts +9 -0
  40. package/dist/components/dev-panel/json-highlight.d.ts +15 -0
  41. package/dist/components/dev-panel/segmented-control.d.ts +38 -0
  42. package/dist/components/dev-panel/use-copy.d.ts +9 -0
  43. package/dist/components/dev-panel/use-dev-panel-labels.d.ts +7 -0
  44. package/dist/components/dev-panel/use-roving-radio.d.ts +34 -0
  45. package/dist/components/feedback/alert.d.ts +27 -0
  46. package/dist/components/feedback/dialog.d.ts +22 -0
  47. package/dist/components/feedback/drawer.d.ts +22 -0
  48. package/dist/components/feedback/index.d.ts +3 -0
  49. package/dist/components/feedback/use-close-label.d.ts +6 -0
  50. package/dist/components/form/autocomplete.d.ts +71 -0
  51. package/dist/components/form/checkbox.d.ts +12 -0
  52. package/dist/components/form/datepicker/calendar-header.d.ts +12 -0
  53. package/dist/components/form/datepicker/datepicker.d.ts +99 -0
  54. package/dist/components/form/datepicker/drawer-toolbar.d.ts +17 -0
  55. package/dist/components/form/datepicker/index.d.ts +1 -0
  56. package/dist/components/form/datepicker/use-calendar-header-labels.d.ts +8 -0
  57. package/dist/components/form/datepicker/use-datepicker-title-labels.d.ts +5 -0
  58. package/dist/components/form/datepicker/use-view-toggle-labels.d.ts +7 -0
  59. package/dist/components/form/datepicker/view-renderers.d.ts +10 -0
  60. package/dist/components/form/datepicker/view-toggle.d.ts +21 -0
  61. package/dist/components/form/email-input.d.ts +35 -0
  62. package/dist/components/form/fields/autocomplete-field.d.ts +17 -0
  63. package/dist/components/form/fields/boolean-radio-field.d.ts +3 -0
  64. package/dist/components/form/fields/checkbox-field.d.ts +12 -0
  65. package/dist/components/form/fields/datepicker-field.d.ts +9 -0
  66. package/dist/components/form/fields/email-field.d.ts +10 -0
  67. package/dist/components/form/fields/field-types.d.ts +18 -0
  68. package/dist/components/form/fields/index.d.ts +14 -0
  69. package/dist/components/form/fields/input-field.d.ts +9 -0
  70. package/dist/components/form/fields/multi-select-field.d.ts +9 -0
  71. package/dist/components/form/fields/number-field.d.ts +10 -0
  72. package/dist/components/form/fields/phone-number-field.d.ts +11 -0
  73. package/dist/components/form/fields/radio-card-field.d.ts +22 -0
  74. package/dist/components/form/fields/radio-field.d.ts +16 -0
  75. package/dist/components/form/fields/select-field.d.ts +9 -0
  76. package/dist/components/form/fields/use-field-control.d.ts +6 -0
  77. package/dist/components/form/fields/use-tooltip-trigger-labels.d.ts +5 -0
  78. package/dist/components/form/form-control/form-control-context.d.ts +35 -0
  79. package/dist/components/form/form-control/form-control-label.d.ts +1 -0
  80. package/dist/components/form/form-control/form-control.d.ts +13 -0
  81. package/dist/components/form/form-control/form-helper-text.d.ts +9 -0
  82. package/dist/components/form/form-control/form-label.d.ts +9 -0
  83. package/dist/components/form/form-control/index.d.ts +5 -0
  84. package/dist/components/form/index.d.ts +18 -0
  85. package/dist/components/form/input-label.d.ts +9 -0
  86. package/dist/components/form/input.d.ts +19 -0
  87. package/dist/components/form/multi-select.d.ts +32 -0
  88. package/dist/components/form/number-input.d.ts +52 -0
  89. package/dist/components/form/phone-number-input/countries.d.ts +33 -0
  90. package/dist/components/form/phone-number-input/index.d.ts +2 -0
  91. package/dist/components/form/phone-number-input/phone-number-input.d.ts +53 -0
  92. package/dist/components/form/radio-card.d.ts +77 -0
  93. package/dist/components/form/radio-circle.d.ts +19 -0
  94. package/dist/components/form/radio.d.ts +36 -0
  95. package/dist/components/form/select.d.ts +46 -0
  96. package/dist/components/form/slider.d.ts +23 -0
  97. package/dist/components/form/use-autocomplete-labels.d.ts +19 -0
  98. package/dist/components/index.d.ts +11 -0
  99. package/dist/components/navigation/form-stepper.d.ts +63 -0
  100. package/dist/components/navigation/index.d.ts +4 -0
  101. package/dist/components/navigation/progress-circle.d.ts +34 -0
  102. package/dist/components/navigation/tabs.d.ts +79 -0
  103. package/dist/components/navigation/use-stepper-labels.d.ts +7 -0
  104. package/dist/components/surfaces/accordion.d.ts +15 -0
  105. package/dist/components/surfaces/index.d.ts +1 -0
  106. package/dist/components/typography/index.d.ts +3 -0
  107. package/dist/components/typography/link.d.ts +23 -0
  108. package/dist/components/typography/lists.d.ts +54 -0
  109. package/dist/components/typography/text.d.ts +18 -0
  110. package/dist/components/ui/brand-divider.d.ts +6 -0
  111. package/dist/components/ui/index.d.ts +1 -0
  112. package/dist/creditcard.png +0 -0
  113. package/dist/favicon.ico +0 -0
  114. package/dist/hooks/country/countries.d.ts +8 -0
  115. package/dist/hooks/country/country-context.d.ts +20 -0
  116. package/dist/hooks/index.d.ts +6 -0
  117. package/dist/hooks/use-format-currency.d.ts +9 -0
  118. package/dist/hooks/use-format-date.d.ts +4 -0
  119. package/dist/hooks/use-format-number.d.ts +10 -0
  120. package/dist/hooks/validation/index.d.ts +1 -0
  121. package/dist/hooks/validation/use-validation.d.ts +21 -0
  122. package/dist/i18n/create-translation.d.ts +28 -0
  123. package/dist/i18n/index.d.ts +3 -0
  124. package/dist/i18n/language-context.d.ts +9 -0
  125. package/dist/i18n/languages.d.ts +9 -0
  126. package/dist/index.d.ts +9 -0
  127. package/dist/leabank-logo-square.png +0 -0
  128. package/dist/leabank-logo.png +0 -0
  129. package/dist/provider/index.d.ts +1 -0
  130. package/dist/provider/lea-provider.d.ts +16 -0
  131. package/dist/success-icon.png +0 -0
  132. package/dist/theme/components/accordion.theme.d.ts +7 -0
  133. package/dist/theme/components/action-button.theme.d.ts +45 -0
  134. package/dist/theme/components/alert.theme.d.ts +2 -0
  135. package/dist/theme/components/autocomplete.theme.d.ts +2 -0
  136. package/dist/theme/components/baseline-css.d.ts +2 -0
  137. package/dist/theme/components/button.theme.d.ts +2 -0
  138. package/dist/theme/components/card.theme.d.ts +2 -0
  139. package/dist/theme/components/checkbox.theme.d.ts +2 -0
  140. package/dist/theme/components/chip.theme.d.ts +2 -0
  141. package/dist/theme/components/date-picker.theme.d.ts +15 -0
  142. package/dist/theme/components/dev-panel.theme.d.ts +95 -0
  143. package/dist/theme/components/dialog.theme.d.ts +2 -0
  144. package/dist/theme/components/drawer.theme.d.ts +4 -0
  145. package/dist/theme/components/field-base.d.ts +31 -0
  146. package/dist/theme/components/form-control-label.theme.d.ts +2 -0
  147. package/dist/theme/components/form-control.theme.d.ts +2 -0
  148. package/dist/theme/components/icon-button.theme.d.ts +2 -0
  149. package/dist/theme/components/index.d.ts +2 -0
  150. package/dist/theme/components/input.theme.d.ts +3 -0
  151. package/dist/theme/components/link.theme.d.ts +2 -0
  152. package/dist/theme/components/menu-item.theme.d.ts +2 -0
  153. package/dist/theme/components/number-input.theme.d.ts +23 -0
  154. package/dist/theme/components/phone-number-input.theme.d.ts +43 -0
  155. package/dist/theme/components/radio.theme.d.ts +2 -0
  156. package/dist/theme/components/select.theme.d.ts +2 -0
  157. package/dist/theme/components/slider.theme.d.ts +2 -0
  158. package/dist/theme/components/tabs.theme.d.ts +34 -0
  159. package/dist/theme/components/tooltip.theme.d.ts +110 -0
  160. package/dist/theme/components/typography.theme.d.ts +2 -0
  161. package/dist/theme/index.d.ts +6 -0
  162. package/dist/theme/mui-augmentation.d.ts +147 -0
  163. package/dist/theme/sx-config.d.ts +10 -0
  164. package/dist/theme/token-types.d.ts +11 -0
  165. package/dist/theme/tokens/colors.d.ts +95 -0
  166. package/dist/theme/tokens/font-sizes.d.ts +12 -0
  167. package/dist/theme/tokens/font-weights.d.ts +9 -0
  168. package/dist/theme/tokens/index.d.ts +9 -0
  169. package/dist/theme/tokens/palette.d.ts +2 -0
  170. package/dist/theme/tokens/shadows.d.ts +9 -0
  171. package/dist/theme/tokens/shape.d.ts +12 -0
  172. package/dist/theme/tokens/spacing.d.ts +1 -0
  173. package/dist/theme/tokens/transitions.d.ts +10 -0
  174. package/dist/theme/tokens/typography.d.ts +43 -0
  175. package/dist/theme/types.d.ts +80 -0
  176. package/dist/theme/utils/focus-visible-styles.d.ts +6 -0
  177. package/dist/theme/utils/index.d.ts +1 -0
  178. package/dist/utils/downloadFile.d.ts +4 -0
  179. package/dist/utils/formatDecimal.d.ts +16 -0
  180. package/dist/utils/formatDecimalString.d.ts +12 -0
  181. package/dist/utils/formatPercentage.d.ts +1 -0
  182. package/dist/utils/index.d.ts +5 -0
  183. package/dist/utils/parseExpirationDate.d.ts +4 -0
  184. package/dist/validation/bank-account.d.ts +29 -0
  185. package/dist/validation/email.d.ts +24 -0
  186. package/dist/validation/index.d.ts +5 -0
  187. package/dist/validation/national-id.d.ts +30 -0
  188. package/dist/validation/phone.d.ts +16 -0
  189. package/dist/validation/types.d.ts +10 -0
  190. package/package.json +107 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,408 @@
1
+ # Changelog
2
+
3
+ ## 5.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f7fb516: Tooltip now act differently when pointer device is touch instead of mouse, expanded radius of clickable tooltip
8
+
9
+ ## 5.6.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 1e60d08: `Alert` accepts a `size` prop (`"sm"` for tighter padding and smaller text, `"lg"` unchanged and still the default) and the non-semantic `color` values `"purple"` and `"grey"` for messages that shouldn't read as a status. Brand colours default `severity` to `"info"`. Status icons are Lucide glyphs (`CircleCheck`, `Info`, `TriangleAlert`, `CircleAlert`), overridable via `icon` or `iconMapping`.
14
+ - 1e60d08: Library-owned labels now follow `LeaProvider`'s `language` instead of falling back to MUI's English or hardcoded Swedish text. Consumers no longer need wrappers like `LocalizedAutocompleteField`.
15
+
16
+ - `Autocomplete` (and `AutocompleteField`, `EmailInput`, `EmailField`) translate `noOptionsText`, `loadingText`, `openText`, `closeText` and `clearText`.
17
+ - `Alert`'s dismiss button (with `onClose`) gets a translated `closeText`.
18
+ - `DatePicker` passes MUI X's locale pack as `localeText`, so "Choose date", month navigation and the action bar are translated, and weekday labels come from the resolved `date-fns` locale rather than a fixed Norwegian array.
19
+ - `DownloadTrigger` defaults `children` to the translated word for "download".
20
+ - `StatusIcon`, `StatusAnimation` and `CheckAnimation` labels are translated; `CheckAnimation` and `PulseAnimation` gain a `label` prop.
21
+ - `Chip`'s delete affordance and `PulseAnimation`'s spinner get accessible names, and a field's `tooltip` now renders a focusable, named trigger button.
22
+
23
+ **Behaviour change:** default rendered strings differ for consumers who never set `language` — English MUI defaults and the Swedish animation labels become Norwegian. Every string stays overridable per-instance through the existing props.
24
+
25
+ ## 5.5.1
26
+
27
+ ### Patch Changes
28
+
29
+ - ace8e6c: Datepicker is no longer hardcoded norwegian, and now accepts custom inputs
30
+
31
+ ## 5.5.0
32
+
33
+ ### Minor Changes
34
+
35
+ - d69d15c: Fix email validation to reject domains ending with '.con', make the entire MultiSelect field clickable and add month/year picker with configurable order and update view renderers.
36
+
37
+ ## 5.4.0
38
+
39
+ ### Minor Changes
40
+
41
+ - db5f223: `DevPanelPayload` now syntax-highlights JSON payloads in the preview: keys, strings, numbers, booleans and null each get a distinct design-token colour on the dark panel (every shade clears WCAG AA against it). Highlighting is on by default via a new `highlight` prop — set `highlight={false}` for the plain single-colour view. Non-JSON string payloads still render verbatim, and the highlighter builds React nodes (no `dangerouslySetInnerHTML`), so string values containing markup can never inject HTML. The clipboard copy is unchanged (raw serialised text).
42
+ - db5f223: `DevPanelPayload` can now open beside the panel instead of inline. A new `placement` prop (`"inline"` default, or `"side"`) opens the payload as a floating dialog anchored to the `DevPanel`'s side: it is portalled out of the panel, positioned to the left (flipping to the right when there isn't room), and behaves as a dialog — focus moves in, Escape and outside clicks close it, and focus returns to the toggle. The side flyout adds an optional header `badge`, a full-width copy action, and `copyJsonLabel`/`closeLabel` overrides. The scrollable JSON regions are now keyboard-focusable. Existing inline usage is unchanged.
43
+ - db5f223: `DevPanelSteps` now wraps long step labels within their cell (and breaks long single words) instead of letting them overflow into neighbouring steps. The jump-to-step grid also gains a `columns` prop to control how many step circles appear per row; it defaults to `4` (previously a fixed 5-column grid), giving each label more room.
44
+
45
+ ### Patch Changes
46
+
47
+ - db5f223: Fix the ESM build so it no longer emits a `typeof require` shim that Turbopack and webpack reject. The library build now externalises its runtime `dependencies` (`@base-ui/react`, `motion`, `lucide-react`, `libphonenumber-js`) alongside the existing `peerDependencies`, so rolldown bundles only first-party source and stops inlining transitive CommonJS modules (e.g. `use-sync-external-store`, `framer-motion`) whose internal `require("react")` produced the shim. `component-library.es.js` now contains zero `typeof require` and imports `react` and friends as external ESM. These packages are declared in `dependencies`, so consumers already have them installed; no public API changes.
48
+
49
+ ## 5.3.0
50
+
51
+ ### Minor Changes
52
+
53
+ - 266313e: Add `DevPanel`, a reusable, fully-controlled dev-tooling panel that form apps compose from typed sub-components: `DevPanelFlow`, `DevPanelCountry`, `DevPanelVariant`, `DevPanelSteps`, `DevPanelStepState`, `DevPanelStatus`, `DevPanelPayload`, and `DevPanelFooter` (plus the `DevPanelSection` wrapper). The panel owns layout and styling; consumers own all state via `value` + `onChange`/callback props and decide where to place it (it renders content only, with a built-in minimise/collapse affordance).
54
+
55
+ Accessibility is baked in: single-selects (country / variant / step state / application status) are labelled `radiogroup`s with roving `tabindex`, arrow / Home / End navigation and `aria-checked`; the step grid exposes `aria-current="step"` and spells out each step's status so it never relies on colour alone; the payload preview is a proper disclosure (`aria-expanded`/`aria-controls`); and copy actions confirm via a `role="status"` live region. Section labels, step labels and meta use `neutral[600]` to clear WCAG AA against the cream surface. Icon-button and status labels are translated (no/se/fi/es) and overridable per-instance.
56
+
57
+ - 266313e: Add `PhoneNumberInput`, a phone number field with a searchable country-code picker on the left and a floating label. Clicking the country trigger opens a search popover that matches the width of the field and filters by country name, ISO code, or dialling code. The country trigger keeps a constant width across dialling codes so the floating label always stays aligned with the value. Lea Bank's core markets (Finland, Sweden, Norway, Spain) are pinned to the top of the list, the default country follows the active locale, and every country is validated and formatted with `libphonenumber-js` (Norwegian numbers are grouped 3-2-3, e.g. `400 12 345`). Both the country and the number can be controlled or left uncontrolled, and a `PhoneNumberField` wrapper connects it to react-hook-form.
58
+
59
+ This also switches the framework-agnostic `validatePhoneNumber` / `isValidPhoneNumber` validators over to `libphonenumber-js`, widening the accepted country from the four Lea Bank markets to any ISO country code. Validation results for NO/SE/FI/ES may differ slightly from the previous regex-based rules.
60
+
61
+ - 266313e: Add `Tabs`, a segmented pill-style tabs control built on Base UI's accessible `Tabs` primitive. Compose it from `TabsList` + `Tab` (the bar) and, optionally, `TabPanel` for built-in content, or drive it as a bar only with `value`/`onValueChange`. Two variants control the active-tab pill: `brand` (purple, default) and `greyscale` (near-black). The list scrolls horizontally when the tabs overflow (e.g. on mobile) and the pill slide respects `prefers-reduced-motion`.
62
+
63
+ Accessibility is baked in: roles (`tablist`/`tab`/`tabpanel`), roving `tabindex`, arrow-key navigation, `aria-selected` and the auto-wired `tab`↔`tabpanel` links come from Base UI, and `TabsList` requires an accessible name (`aria-label` or `aria-labelledby`) in TypeScript so the `tablist` can never be nameless. Inactive tab labels use `neutral[600]` to clear WCAG AA contrast against the beige track.
64
+
65
+ ### Patch Changes
66
+
67
+ - 266313e: Fix three component issues:
68
+
69
+ - **Text:** the `color` prop now applies through `sx`, so design-token palette paths (`text.base`, `purple.subtle`, `text.subtle`, …) and raw CSS colours resolve correctly. The MUI shorthands (`primary`, `secondary`, `error`, …) still map to their `.main` shade, and a consumer-provided `sx` is now merged instead of dropped.
70
+ - **DatePicker:** the month/year picker (`views={["year", "month"]}`) now renders its Måned / År segmented toggle (month first), opening on the month view and drilling month -> year, instead of falling back to the plain year list.
71
+ - **EmailInput:** reimplemented as a thin wrapper around `Autocomplete` with the `email` prop (same `@`-domain suggestions), replacing the bespoke dropdown. It remains deprecated in favour of `<Autocomplete email />`.
72
+
73
+ ## 5.2.0
74
+
75
+ ### Minor Changes
76
+
77
+ - b7d8f93: Add `PhoneNumberInput`, a phone number field with a searchable country-code picker on the left and a floating label. Clicking the country trigger opens a search popover that matches the width of the field and filters by country name, ISO code, or dialling code. The country trigger keeps a constant width across dialling codes so the floating label always stays aligned with the value. Lea Bank's core markets (Finland, Sweden, Norway, Spain) are pinned to the top of the list, the default country follows the active locale, and every country is validated and formatted with `libphonenumber-js` (Norwegian numbers are grouped 3-2-3, e.g. `400 12 345`). Both the country and the number can be controlled or left uncontrolled, and a `PhoneNumberField` wrapper connects it to react-hook-form.
78
+
79
+ This also switches the framework-agnostic `validatePhoneNumber` / `isValidPhoneNumber` validators over to `libphonenumber-js`, widening the accepted country from the four Lea Bank markets to any ISO country code. Validation results for NO/SE/FI/ES may differ slightly from the previous regex-based rules.
80
+
81
+ ### Patch Changes
82
+
83
+ - b7d8f93: Fix three component issues:
84
+
85
+ - **Text:** the `color` prop now applies through `sx`, so design-token palette paths (`text.base`, `purple.subtle`, `text.subtle`, …) and raw CSS colours resolve correctly. The MUI shorthands (`primary`, `secondary`, `error`, …) still map to their `.main` shade, and a consumer-provided `sx` is now merged instead of dropped.
86
+ - **DatePicker:** the month/year picker (`views={["year", "month"]}`) now renders its Måned / År segmented toggle (month first), opening on the month view and drilling month -> year, instead of falling back to the plain year list.
87
+ - **EmailInput:** reimplemented as a thin wrapper around `Autocomplete` with the `email` prop (same `@`-domain suggestions), replacing the bespoke dropdown. It remains deprecated in favour of `<Autocomplete email />`.
88
+
89
+ ## 5.1.0
90
+
91
+ ### Minor Changes
92
+
93
+ - c7b9a0e: Refine the Accordion component.
94
+
95
+ - `Accordion` is now a real Lea wrapper component (previously a raw MUI re-export), which fixes the Storybook "prop type error" where `react-docgen-typescript` could not read docs from MUI's compiled output.
96
+ - Add a `variant` prop: `"outlined"` (default, keeps the border) and `"filled"` (borderless, white-filled panel). Note: this replaces the inherited Paper `variant` values, so `variant="elevation"` is no longer accepted (the theme already forces `elevation={0}`).
97
+ - Give the summary heading and details the same default font size (1rem) and font family so they read consistently.
98
+ - Accessibility: `AccordionDetails` no longer needs `id`/`aria-labelledby` — MUI auto-wires the content region from the summary's `id`/`aria-controls`. The stories were setting these manually, which produced a duplicate id; they now follow the correct wiring.
99
+
100
+ - c7b9a0e: Add a reusable `Alert` component (and re-export `AlertTitle`). It wraps MUI's accessible `Alert`, applies Lea Bank status colours and border radius via the theme across the `standard`, `filled`, and `outlined` variants, and derives the ARIA `role` from `severity` (`error`/`warning` announce assertively, `info`/`success` politely).
101
+ - c7b9a0e: Add a `navigation` category with two components for multi-step forms:
102
+
103
+ - `ProgressCircle` — an animated circular progress indicator (`purple` / `teal`), respecting `prefers-reduced-motion`. Decorative by default; pass `label` to expose it as a `role="progressbar"`.
104
+ - `FormStepper` — a step header with a heading-or-text title (levels `h1`-`h3`), an optional translated `"Next: ..."` subtitle, an optional back button (via `onBack`), and a decorative `ProgressCircle`. The step count is announced once as visually-hidden text on the title. Labels use the built-in i18n (`useStepperLabels`) with per-instance overrides via the `labels` prop.
105
+
106
+ ### Patch Changes
107
+
108
+ - 901de05: Update description and script
109
+ - c7b9a0e: Add JSDoc descriptions to `ActionButton`, `Button`, `Card`, `Chip`, `DataField`, `IconButton`, `Link`, and `Text` (relocating the existing blocks on `ActionButton`, `Button`, and `Link` so they attach to the component rather than the props type). This surfaces the descriptions in the generated type declarations and Storybook autodocs. No runtime or public API changes.
110
+ - c7b9a0e: Fix the MUI theme type augmentation so the design tokens type-check against MUI v9.
111
+
112
+ - Type the semantic `palette.bg`, `palette.border`, `palette.status`, `palette.purple` and `palette.teal` groups with dedicated interfaces that match the actual tokens, instead of MUI's `SimplePaletteColorOptions` (which requires a `main` key the tokens don't have).
113
+ - Declare these groups on both `Palette` and `PaletteOptions`, so `palette.purple` / `palette.teal` are now typed on the resolved theme too, and `palette.border.strong` is included.
114
+ - Remove the conflicting `text: TypeText` and invalid `palette?: PaletteColor` declarations that broke module augmentation under MUI v9.
115
+
116
+ ## 5.0.0
117
+
118
+ ### Major Changes
119
+
120
+ - 43ab566: Require MUI v9 and slim the peer-dependency contract.
121
+
122
+ - `peerDependencies` for `@mui/material`, `@mui/system` and `@mui/x-date-pickers` are now `^9.0.0`. The compiled `Autocomplete` reads `renderInput` params via `slotProps.input` / `slotProps.htmlInput`, which only exist in MUI v9; the previous peer range (`^6 || ^7`) allowed installs that crashed at runtime with "Cannot read properties of undefined (reading 'input')". Consumers must upgrade to MUI v9.
123
+ - Removed `mui-markdown` and `@mui/utils` from `peerDependencies`: `mui-markdown` is no longer used by the library, and `@mui/utils` is only needed transitively through `@mui/material`. Consumers no longer need to install either directly.
124
+ - Removed `@mui/icons-material` from `peerDependencies`: it was only used by Storybook stories, never by shipped components. Consumers that relied on it being pulled in transitively should add it to their own dependencies if they use MUI icons.
125
+
126
+ ### Patch Changes
127
+
128
+ - 43ab566: Update manifest
129
+
130
+ ## 4.0.0
131
+
132
+ ### Major Changes
133
+
134
+ - 2a4d006: Require MUI v9 and slim the peer-dependency contract.
135
+
136
+ - `peerDependencies` for `@mui/material`, `@mui/system` and `@mui/x-date-pickers` are now `^9.0.0`. The compiled `Autocomplete` reads `renderInput` params via `slotProps.input` / `slotProps.htmlInput`, which only exist in MUI v9; the previous peer range (`^6 || ^7`) allowed installs that crashed at runtime with "Cannot read properties of undefined (reading 'input')". Consumers must upgrade to MUI v9.
137
+ - Removed `mui-markdown` and `@mui/utils` from `peerDependencies`: `mui-markdown` is no longer used by the library, and `@mui/utils` is only needed transitively through `@mui/material`. Consumers no longer need to install either directly.
138
+ - Removed `@mui/icons-material` from `peerDependencies`: it was only used by Storybook stories, never by shipped components. Consumers that relied on it being pulled in transitively should add it to their own dependencies if they use MUI icons.
139
+
140
+ ### Minor Changes
141
+
142
+ - 4e4c41e: Add `Link` component: a link-only (styling and behaviour) component with a polymorphic `component` prop for use with router links (React Router, Next.js) and a restricted `color` prop (`text.base`, `purple.700`, `teal.700`, `text.contrast`).
143
+
144
+ ### Patch Changes
145
+
146
+ - 4e4c41e: Document the `Autocomplete` `multiple` variant (originally shipped in 3.6.0; its changeset was lost during a manual version bump). Passing `multiple` switches the value type to `string[]` and renders selections as removable chips, bounded by `min` (default 1) and `max`. Props are a discriminated union on `multiple`, so single-select usage and its `value: string` type are unchanged and backwards compatible. `AutocompleteField` forwards `multiple` and defaults the field value per mode.
147
+
148
+ ## 3.6.0
149
+
150
+ ### Minor Changes
151
+
152
+ - ecb1ee8: Added tooltip, slider, changes to datepicker and numericalinput to use token measurements'
153
+ - 6ddbc51: Add generic `Slider`, reusable `Tooltip` with built-in text / outlined / filled info trigger variants, new `DataField` for label/value summary rows, `NumberInput` external-label support via explicit `labelPlacement`, more generic `FormLabel` adjacent-content composition, and themed `DatePicker` support for day or month/year `views`.
154
+
155
+ ## 3.4.0
156
+
157
+ ### Minor Changes
158
+
159
+ - 4e43b22: Expand the public API surface:
160
+
161
+ - Export `MultiSelectField` and `BooleanRadioCardField` from the form fields.
162
+ - Add `BrandDivider`, a decorative full-width divider in Lea Bank's brand colours.
163
+ - `RadioCardField` now accepts an optional `tooltip` prop that renders an info icon with contextual help next to the label.
164
+ - `SelectField` now validates on change and blur so errors clear as soon as a valid option is selected.
165
+
166
+ ## 3.3.0
167
+
168
+ ### Minor Changes
169
+
170
+ - eec2b3e: Add a `Dialog` family under a new `feedback` export.
171
+
172
+ `SimpleDialog` is the ready-made modal: pass `title`, an optional `description`, and `children`, and it renders the Lea chrome (white, large-radius paper over a dark overlay) with a title row, a close button, and a content area. The title labels the dialog and the description (when present) describes it via internally managed ids, so consumers never wire `aria-labelledby` / `aria-describedby` themselves; the close button's accessible name is translated (`no` / `se` / `fi` / `es`) and overridable via `closeLabel`.
173
+
174
+ `Dialog` is a thin, unopinionated wrapper over MUI's `Dialog` that forwards every MUI prop and applies the surface styling, leaving the inner layout to the consumer.
175
+
176
+ Both open and close with a minimal, token-timed motion (a soft fade + scale) that respects `prefers-reduced-motion`. Sizing uses MUI's own `maxWidth` / `fullWidth`.
177
+
178
+ - eec2b3e: Add a `Drawer` family under the `feedback` export, mirroring `Dialog`.
179
+
180
+ `SimpleDrawer` is the ready-made side panel: pass `title`, an optional `description`, and `children`, and it renders the Lea chrome (a white surface over a dark overlay) with a header row, a close button, and a scrollable content area. It is a labelled modal dialog (`role="dialog"`, `aria-modal`) whose title and description are wired via internally managed ids, so consumers never wire `aria-labelledby` / `aria-describedby` themselves; the close button's accessible name is translated (`no` / `se` / `fi` / `es`) and overridable via `closeLabel`. Defaults to `anchor="right"` with a sensible width; use MUI's `anchor` and `slotProps.paper` / `sx` to change side or size.
181
+
182
+ `Drawer` is a thin, unopinionated wrapper over MUI's `Drawer` that forwards every MUI prop and applies the surface styling, leaving the inner layout to the consumer.
183
+
184
+ Both keep MUI's native slide motion, now token-timed and reduced-motion-aware.
185
+
186
+ - 01da847: Add `NumberInput` and its react-hook-form wrapper `NumberField` to the public API. The numeric input keeps Base UI's `NumberField` engine (value / min / max / step / formatting) but now follows the local form conventions: named exports, automatic `FormControl` id wiring, standalone and composed usage, `label` / `helperText` / `error` / `required` / `disabled` props, and stepper styling moved into the theme.
187
+
188
+ `NumberInput` also supports adornments for currency-style fields: `startIcon` (a decorative, `aria-hidden` leading glyph), `unit` (trailing text such as `kr` linked to the input via `aria-describedby`, so it is announced rather than baked into the placeholder), and `showSteppers` (default `true`) to hide the `+` / `-` buttons for open-ended amounts.
189
+
190
+ - 01da847: Add a single `LeaProvider` that bundles the Lea Bank MUI theme (plus `CssBaseline`) and a language context, so consumers wrap once and forward only a `language` prop (`"no" | "se" | "fi" | "es"`, default `"no"`).
191
+
192
+ New public exports for co-located translations: `createTranslation` (a hook factory whose `no` key is the type-enforced fallback), `useLanguage`, `Language`, `LANGUAGES` and `DEFAULT_LANGUAGE`.
193
+
194
+ `NumberInput`'s stepper `aria-label`s are now translated (default changes from English to Norwegian), and `DatePicker`'s default `adapterLocale` follows the provider language (`no`->`nb`, `se`->`sv`, `fi`->`fi`, `es`->`es`); passing `adapterLocale` still overrides it.
195
+
196
+ ## 3.2.1
197
+
198
+ ### Patch Changes
199
+
200
+ - 0d1b427: Fix the empty root type declaration. `vite-plugin-dts`'s `insertTypesEntry` (combined with a non-applied `outDir`/`entryRoot`) overwrote the real `dist/src/index.d.ts` with an empty `export {}`, so consumers saw no exports (`import { theme }` and everything else resolved to nothing). Removed `insertTypesEntry` and the non-working `outDir`/`entryRoot` options and set `clearPureImport: false` so the entry keeps its re-exports and the `import "./theme/mui-augmentation"` side-effect (which activates the `@mui/material/styles` augmentation). Also added an explicit `exports` map so type/runtime resolution is unambiguous.
201
+
202
+ ## 3.2.0
203
+
204
+ ### Minor Changes
205
+
206
+ - 4c8258a: Add `Autocomplete` (and the react-hook-form `AutocompleteField`), a searchable select built on MUI's `Autocomplete` with the same standalone / composed `FormControl` behaviour and auto-wired ids as the other form controls. Pass `email` to turn it into an email field that suggests common domains (gmail, outlook, …) once the user types `@`.
207
+
208
+ `EmailInput` and `EmailField` are now deprecated in favour of `Autocomplete` / `AutocompleteField` with `email`, and will be removed in a future major release.
209
+
210
+ `MultiSelect` now renders its selected values as removable chips (kept on a single line, with any overflow collapsed into a trailing `+N` badge) and gains optional `min` (default 1, so the last value can't be removed) and `max` (unlimited by default) selection bounds — options that would breach either bound are disabled.
211
+
212
+ - 98a2be6: Add `DatePicker` (and the react-hook-form `DatePickerField`) built on `@mui/x-date-pickers`, styled to the Lea Bank design. The day picker is MUI's `DateCalendar` day grid with a centered header — a prev/next month chevron either side of a clickable month-year label that switches to the year list — and lowercase Monday-first weekday labels, themed with Lea Bank tokens. A month/year-only picker (`views={["year", "month"]}`) shows a segmented `Måned / År` toggle (month first) over the month/year grids: it opens on the month tab, picking a month switches to the year tab, and picking a year commits. Selecting a value commits immediately (`closeOnSelect`). On desktop it opens as a popover sized to the input width; on mobile it opens in a bottom `Drawer` with a custom `eyebrow` + `title` header and a grab handle. The trigger field is themed to match the other form inputs, `views` defaults to `["year", "month", "day"]`, and it bundles its own `LocalizationProvider` + `date-fns` adapter (Norwegian `nb` locale by default).
213
+
214
+ ### Patch Changes
215
+
216
+ - 4c8258a: Form fields now float their label on focus (keeping the existing inside-the-field floating style, not up on the border) and only show the input placeholder once the label has floated, so the label and placeholder no longer overlap in the resting state (most visible on `Autocomplete` with `email`). Applies to every field via the shared `FormControl`.
217
+
218
+ Internal: the outlined-field styling (fixed height, label padding, collapsed notch and hover / focus / error border states) is now shared from a single `field-base` module and consumed by the text input, select, autocomplete and date-picker themes, so field styling can be edited in one place.
219
+
220
+ - 06d1b7e: Fix exports for types
221
+
222
+ ## 3.1.0
223
+
224
+ ### Minor Changes
225
+
226
+ - b5969f5: Added validation checks for email, ssn, accountnumber, phonenumber
227
+
228
+ ## 3.0.0
229
+
230
+ ### Major Changes
231
+
232
+ - a442bac: - **Removed legacy exports** — domain-specific and deprecated components (e.g. `AccountInfoCard`, `Calculator`, root-level inputs, `Modal`, `Sidebar`, `Slider`, `InputGroup`, feedback helpers, and related utils/types) are no longer published
233
+ - **Narrowed public API** — package now exports `animations`, `buttons`, `data-display`, `form`, `surfaces`, and `typography` only
234
+ - **Colour token swap** — `colors` is now brand scales (`colors.purple[600]`); semantic tokens live on `palette` (`palette.bg.base`, `palette.text.base`, …)
235
+ - **Brand semantic rename** — `palette.primary.*` → `palette.purple.*`, `palette.secondary.*` → `palette.teal.*` (MUI `primary`/`secondary` `main`/`light`/`dark` kept for `color="primary"` etc.)
236
+ - **Token renames** — `text.inverse` / `bg.inverse` → `contrast`; `radii` → `shape`; removed `primitives` (scales inlined in `colors.ts`)
237
+ - **Removed deprecated palette aliases** — `background`, `divider`, `action`, and other legacy MUI palette shims
238
+
239
+ ### Minor Changes
240
+
241
+ - a442bac: Add `Chip` component with filled and outlined variants, five colour options (purple, blue, teal, orange, grey), and small/medium sizes. Defaults to purple, filled, small.
242
+ - a442bac: Add country-aware formatting hooks: `CountryProvider`, `useCountry`, `useFormatCurrency`, `useFormatDate`, `useFormatNumber`, and `useFormatPercentage`. Supports Norway, Sweden, Finland, and Spain via the native `Intl` API.
243
+ - a442bac: Add react-hook-form field components: `InputField`, `SelectField`, `RadioField`, `RadioCardField`, and `CheckboxField`. Each wraps the existing form primitive with a `Controller`, accepts an optional `control` prop or reads from `FormProvider`, and supports typed `name` via generics.
244
+
245
+ ### Patch Changes
246
+
247
+ - a442bac: Switch ClashGrotesk `@font-face` declarations from `font-display: swap` to `font-display: optional`. This stops a system fallback (e.g. Arial) flashing in before the brand font is ready. Also removes the dead `'ClashGroteskVariable'` entry from the font-family stack.
248
+ - a442bac: Fix `PulseAnimation` leaking the non-standard `enableTrackSlot` prop onto a DOM element. The prop only exists in MUI ≥ 7.3, but the library's peer range allows older MUI versions where it falls through to the underlying `<span>`, triggering a React "unknown DOM attribute" console error. The internal `CircularProgress` no longer sets it.
249
+ - 78985f8: Update pipeline
250
+
251
+ ## 2.3.0
252
+
253
+ ### Minor Changes
254
+
255
+ - 6254d13: Add animations
256
+ - 6254d13: Styling:
257
+ RadioGroup: Add size prop
258
+ RadioCard: Add small variant
259
+ Input: Fix some styling issues
260
+ SkipLink: new component
261
+ Text: add default color
262
+ Select: Update styling
263
+
264
+ ### Patch Changes
265
+
266
+ - 6254d13: Declare `@mui/system` and `@mui/utils` as peer dependencies. They were
267
+ already imported directly but only resolved transitively via `@mui/material`,
268
+ which broke type-checking/builds in stricter, non-hoisted installs.
269
+ - 6254d13: Styling updates for various inputs
270
+
271
+ ## 2.2.0
272
+
273
+ ### Minor Changes
274
+
275
+ - d92c4e7: Styling:
276
+ RadioGroup: Add size prop
277
+ RadioCard: Add small variant
278
+ Input: Fix some styling issues
279
+ SkipLink: new component
280
+ Text: add default color
281
+ Select: Update styling
282
+
283
+ ### Patch Changes
284
+
285
+ - d92c4e7: Declare `@mui/system` and `@mui/utils` as peer dependencies. They were
286
+ already imported directly but only resolved transitively via `@mui/material`,
287
+ which broke type-checking/builds in stricter, non-hoisted installs.
288
+ - d92c4e7: Styling updates for various inputs
289
+
290
+ ## 2.1.0
291
+
292
+ ### Minor Changes
293
+
294
+ - cd89d44: Styling:
295
+ RadioGroup: Add size prop
296
+ RadioCard: Add small variant
297
+ Input: Fix some styling issues
298
+ SkipLink: new component
299
+ Text: add default color
300
+ Select: Update styling
301
+
302
+ ### Patch Changes
303
+
304
+ - cd89d44: Declare `@mui/system` and `@mui/utils` as peer dependencies. They were
305
+ already imported directly but only resolved transitively via `@mui/material`,
306
+ which broke type-checking/builds in stricter, non-hoisted installs.
307
+
308
+ ## 2.0.1
309
+
310
+ ### Patch Changes
311
+
312
+ - 27f3f4f: RadioCard: Small styling changes
313
+
314
+ ## 2.0.0
315
+
316
+ ### Major Changes
317
+
318
+ - dc07fa4: New component: RadioCard
319
+ Breaking: Changed input, checkbox and radio
320
+
321
+ ### Minor Changes
322
+
323
+ - dc07fa4: Add strategy for tokens
324
+ - Old tokens will still work
325
+
326
+ ### Patch Changes
327
+
328
+ - b03a48d: RadioCard: Small styling changes
329
+
330
+ ## 1.0.1
331
+
332
+ ### Patch Changes
333
+
334
+ - d941381: Fix export for Field (again)
335
+
336
+ ## 1.0.0
337
+
338
+ ### Major Changes
339
+
340
+ - 1c2d5c6: Update List component (breaking)
341
+
342
+ ### Minor Changes
343
+
344
+ - 281c144: Add Field component
345
+ - bb77897: ### Fixed
346
+
347
+ - `dist/types/**/*.d.ts` no longer emit relative imports into `node_modules`
348
+ (e.g. `from '../../node_modules/react'`). External type imports are now
349
+ bare specifiers, fixing `Property 'children' does not exist on type
350
+ 'IntrinsicAttributes & CardProps'` and similar errors that consumers
351
+ hit on every `<Card>` (and many other components') usage.
352
+ - Root cause: `"baseUrl": "."` in `tsconfig.json` (added in 0.7.0) caused
353
+ `vite-plugin-dts` to rewrite bare `react` imports as paths relative to
354
+ the source file, walking into `node_modules/react`. Removed `baseUrl`;
355
+ `paths` continues to work without it since TypeScript 4.1.
356
+
357
+ - Next.js 16 / React 19 / MUI 7 / `@mui/x-date-pickers` 8 compatibility
358
+ (widened peer ranges to `^18 || ^19`, `^6 || ^7`, `^7 || ^8`).
359
+ - ESLint 9 flat config (`eslint.config.mjs`); removed `.eslintrc.json`.
360
+ - Vite 7 upgrade.
361
+ - Added `"use client"` directive at the package entry for React Server
362
+ Components compatibility (preserved through bundling via
363
+ `rollup-preserve-directives`).
364
+ - Consolidated asset module declarations into `src/assets.d.ts`.
365
+ - Removed unused dependencies: `yup`, `se-bank-account`.
366
+ - Add Changesets for version control
367
+ - `mui-markdown` is now a peer dependency (`^2.0.0`). Consumers must
368
+ install it themselves: `yarn add mui-markdown`. Previously it was
369
+ bundled into `dist/`; externalizing it shrinks the published bundle
370
+ and lets package managers dedupe across consumer apps.
371
+
372
+ ### Patch Changes
373
+
374
+ - 448f4b3: Fix exports for Field
375
+
376
+ All notable changes to `@leabank/component-library` are documented here.
377
+
378
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
379
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
380
+
381
+ > Adding an entry? See [docs/deployment/releasing.md](docs/deployment/releasing.md)
382
+ > for the section template, style rules, and the full release checklist.
383
+
384
+ ## [0.7.1] - 2026-04-29
385
+
386
+ ### Fixed
387
+
388
+ - `dist/types/**/*.d.ts` no longer emit relative imports into `node_modules`
389
+ (e.g. `from '../../node_modules/react'`). External type imports are now
390
+ bare specifiers, fixing `Property 'children' does not exist on type
391
+ 'IntrinsicAttributes & CardProps'` and similar errors that consumers
392
+ hit on every `<Card>` (and many other components') usage.
393
+ - Root cause: `"baseUrl": "."` in `tsconfig.json` (added in 0.7.0) caused
394
+ `vite-plugin-dts` to rewrite bare `react` imports as paths relative to
395
+ the source file, walking into `node_modules/react`. Removed `baseUrl`;
396
+ `paths` continues to work without it since TypeScript 4.1.
397
+
398
+ ## [0.7.0]
399
+
400
+ - Next.js 16 / React 19 / MUI 7 / `@mui/x-date-pickers` 8 compatibility
401
+ (widened peer ranges to `^18 || ^19`, `^6 || ^7`, `^7 || ^8`).
402
+ - ESLint 9 flat config (`eslint.config.mjs`); removed `.eslintrc.json`.
403
+ - Vite 7 upgrade.
404
+ - Added `"use client"` directive at the package entry for React Server
405
+ Components compatibility (preserved through bundling via
406
+ `rollup-preserve-directives`).
407
+ - Consolidated asset module declarations into `src/assets.d.ts`.
408
+ - Removed unused dependencies: `yup`, `se-bank-account`.
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # Lea Bank Storybook
2
+
3
+ Welcome to the lea bank storybook project!
4
+
5
+ The goal of this repo is to create a npm-package of components used for Lea Bank products.
6
+
7
+ ## Development
8
+
9
+ 1. [Getting started](docs/development/gettingStarted.md)
10
+ 1. [❗️ Quirks and Caveats ❗️](docs/development/quirks.md)
11
+ 1. [FAQ](docs/development/faq.md)
12
+
13
+ ## Releasing
14
+
15
+ 1. [Day-to-day release checklist](docs/deployment/releasing.md)
16
+ 1. [Changesets reference (config, snapshots, troubleshooting)](docs/deployment/changesets.md)
17
+ 1. [Pipelines and what they do](docs/deployment/pipelines.md)
18
+ 1. [How to use the npm package in projects](docs/deployment/howToUse.md)
19
+
20
+ ## Authenticate your user to use lea-bank-storybook package
21
+
22
+ [Follow this guide](https://dev.azure.com/NewBankCorp/Lea%20Bank/_wiki/wikis/LEA-FUNDING.wiki/348/Lea-Bank-Storybook)
Binary file