@leabankab/component-library 7.3.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +644 -0
- package/README.md +2 -5
- package/dist/component-library.es.js +2712 -5705
- package/dist/component-library.es.js.map +1 -1
- package/dist/component-library.umd.js +2 -28
- package/dist/component-library.umd.js.map +1 -1
- package/dist/components/animations/icons/status-icon.d.ts +4 -0
- package/dist/components/animations/illustrations/check-animation.d.ts +8 -0
- package/dist/components/animations/illustrations/pulse-animation.d.ts +5 -1
- package/dist/components/animations/illustrations/status-animation.d.ts +8 -1
- package/dist/components/animations/shared.d.ts +6 -32
- package/dist/components/animations/spinner.d.ts +18 -0
- package/dist/components/animations/use-animation-labels.d.ts +0 -5
- package/dist/components/buttons/action-button.d.ts +8 -10
- package/dist/components/buttons/button-base.d.ts +26 -12
- package/dist/components/buttons/button.d.ts +2 -2
- package/dist/components/buttons/close-button.d.ts +1 -1
- package/dist/components/buttons/icon-button.d.ts +1 -13
- package/dist/components/buttons/skip-link.d.ts +21 -4
- package/dist/components/color-roles.d.ts +8 -0
- package/dist/components/data-display/card.d.ts +31 -4
- package/dist/components/data-display/chip.d.ts +50 -8
- package/dist/components/data-display/data-field.d.ts +15 -4
- package/dist/components/data-display/tooltip.d.ts +74 -22
- package/dist/components/feedback/alert-parts.d.ts +10 -9
- package/dist/components/feedback/alert.d.ts +1 -1
- package/dist/components/feedback/simple-dialog.d.ts +1 -1
- package/dist/components/form/amount-slider.d.ts +68 -0
- package/dist/components/form/autocomplete.d.ts +56 -59
- package/dist/components/form/checkbox-box.d.ts +11 -0
- package/dist/components/form/checkbox.d.ts +67 -7
- package/dist/components/form/combo-field.d.ts +60 -0
- package/dist/components/form/email-input.d.ts +20 -26
- package/dist/components/form/field-parts.d.ts +36 -0
- package/dist/components/form/index.d.ts +3 -9
- package/dist/components/form/input.d.ts +51 -13
- package/dist/components/form/multi-select.d.ts +12 -14
- package/dist/components/form/number-input.d.ts +20 -14
- package/dist/components/form/phone-number-input/phone-number-input.d.ts +25 -14
- package/dist/components/form/radio-card.d.ts +94 -43
- package/dist/components/form/radio-circle.d.ts +14 -13
- package/dist/components/form/radio-group-root.d.ts +88 -0
- package/dist/components/form/radio.d.ts +68 -24
- package/dist/components/form/select-field.d.ts +78 -0
- package/dist/components/form/select.d.ts +30 -42
- package/dist/components/form/slider-parts.d.ts +34 -0
- package/dist/components/form/slider.d.ts +40 -16
- package/dist/components/form/use-autocomplete-labels.d.ts +3 -16
- package/dist/components/form/use-blur-outside.d.ts +7 -0
- package/dist/components/form/use-focus-target-ref.d.ts +11 -0
- package/dist/components/form/use-tooltip-trigger-labels.d.ts +5 -0
- package/dist/components/index.d.ts +0 -1
- package/dist/components/navigation/form-stepper.d.ts +1 -1
- package/dist/components/navigation/index.d.ts +1 -1
- package/dist/components/navigation/linear-form-stepper.d.ts +1 -1
- package/dist/components/navigation/progress-circle.d.ts +14 -8
- package/dist/components/navigation/tabs.d.ts +37 -34
- package/dist/components/navigation/use-stepper-labels.d.ts +1 -1
- package/dist/components/typography/link.d.ts +25 -16
- package/dist/components/typography/lists.d.ts +20 -23
- package/dist/components/typography/text.d.ts +46 -10
- package/dist/components/ui/app-header.d.ts +9 -1
- package/dist/cookie-consent/react.d.ts +0 -1
- package/dist/cookie-consent-react.cjs +1 -1
- package/dist/cookie-consent-react.cjs.map +1 -1
- package/dist/cookie-consent-react.mjs +106 -96
- package/dist/cookie-consent-react.mjs.map +1 -1
- package/dist/cookie-consent.css +1 -1
- package/dist/date-picker/datepicker.d.ts +140 -0
- package/dist/date-picker/index.d.ts +18 -0
- package/dist/date-picker/theme/field-base.d.ts +23 -0
- package/dist/date-picker/theme/form-control.theme.d.ts +7 -0
- package/dist/date-picker/theme/index.d.ts +12 -0
- package/dist/date-picker/theme/input.theme.d.ts +6 -0
- package/dist/{components/form/datepicker → date-picker}/use-view-toggle-labels.d.ts +1 -1
- package/dist/date-picker.cjs +2 -0
- package/dist/date-picker.cjs.map +1 -0
- package/dist/date-picker.mjs +1012 -0
- package/dist/date-picker.mjs.map +1 -0
- package/dist/{components/dev-panel → dev-panel}/dev-panel-payload.d.ts +1 -1
- package/dist/{components/dev-panel → dev-panel}/dev-panel-status.d.ts +2 -2
- package/dist/{components/dev-panel → dev-panel}/dev-panel-steps.d.ts +2 -1
- package/dist/{components/dev-panel → dev-panel}/dev-panel.d.ts +25 -19
- package/dist/dev-panel/index.d.ts +10 -0
- package/dist/{components/dev-panel → dev-panel}/json-highlight.d.ts +2 -2
- package/dist/dev-panel/parts.d.ts +9 -0
- package/dist/{components/dev-panel → dev-panel}/segmented-control.d.ts +5 -4
- package/dist/{components/dev-panel → dev-panel}/use-dev-panel-labels.d.ts +1 -1
- package/dist/{components/dev-panel → dev-panel}/use-roving-radio.d.ts +2 -2
- package/dist/dev-panel.cjs +3 -0
- package/dist/dev-panel.cjs.map +1 -0
- package/dist/dev-panel.css +1 -0
- package/dist/dev-panel.mjs +818 -0
- package/dist/dev-panel.mjs.map +1 -0
- package/dist/fonts/ClashGrotesk-Variable.woff2 +0 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/provider/lea-provider.d.ts +4 -7
- package/dist/react-hook-form/form-field.d.ts +76 -0
- package/dist/react-hook-form/index.d.ts +1 -0
- package/dist/react-hook-form.cjs +2 -0
- package/dist/react-hook-form.cjs.map +1 -0
- package/dist/react-hook-form.mjs +33 -0
- package/dist/react-hook-form.mjs.map +1 -0
- package/dist/tailwind.css +103 -17
- package/dist/theme/index.d.ts +0 -4
- package/dist/theme/token-types.d.ts +15 -3
- package/dist/theme/tokens/colors.d.ts +13 -0
- package/dist/theme/tokens/font-family.d.ts +9 -0
- package/dist/theme/tokens/font-sizes.d.ts +8 -0
- package/dist/theme/tokens/index.d.ts +4 -1
- package/dist/theme/tokens/line-heights.d.ts +11 -0
- package/dist/theme/tokens/spacing.d.ts +6 -0
- package/dist/theme/tokens/text-styles.d.ts +61 -0
- package/dist/theme/tokens/type-scale.d.ts +21 -0
- package/dist/theme/types.d.ts +19 -30
- package/package.json +42 -6
- package/dist/components/dev-panel/index.d.ts +0 -9
- package/dist/components/form/datepicker/datepicker.d.ts +0 -99
- package/dist/components/form/datepicker/index.d.ts +0 -1
- package/dist/components/form/fields/autocomplete-field.d.ts +0 -17
- package/dist/components/form/fields/boolean-radio-field.d.ts +0 -3
- package/dist/components/form/fields/checkbox-field.d.ts +0 -12
- package/dist/components/form/fields/datepicker-field.d.ts +0 -9
- package/dist/components/form/fields/email-field.d.ts +0 -10
- package/dist/components/form/fields/field-types.d.ts +0 -18
- package/dist/components/form/fields/index.d.ts +0 -14
- package/dist/components/form/fields/input-field.d.ts +0 -9
- package/dist/components/form/fields/multi-select-field.d.ts +0 -9
- package/dist/components/form/fields/number-field.d.ts +0 -10
- package/dist/components/form/fields/phone-number-field.d.ts +0 -11
- package/dist/components/form/fields/radio-card-field.d.ts +0 -22
- package/dist/components/form/fields/radio-field.d.ts +0 -16
- package/dist/components/form/fields/select-field.d.ts +0 -9
- package/dist/components/form/fields/use-field-control.d.ts +0 -6
- package/dist/components/form/fields/use-tooltip-trigger-labels.d.ts +0 -5
- package/dist/components/form/form-control/form-control-context.d.ts +0 -35
- package/dist/components/form/form-control/form-control-label.d.ts +0 -1
- package/dist/components/form/form-control/form-control.d.ts +0 -13
- package/dist/components/form/form-control/form-helper-text.d.ts +0 -9
- package/dist/components/form/form-control/form-label.d.ts +0 -9
- package/dist/components/form/form-control/index.d.ts +0 -5
- package/dist/components/form/input-label.d.ts +0 -9
- package/dist/theme/components/accordion.theme.d.ts +0 -7
- package/dist/theme/components/action-button.theme.d.ts +0 -45
- package/dist/theme/components/alert.theme.d.ts +0 -2
- package/dist/theme/components/autocomplete.theme.d.ts +0 -2
- package/dist/theme/components/baseline-css.d.ts +0 -2
- package/dist/theme/components/button.theme.d.ts +0 -2
- package/dist/theme/components/card.theme.d.ts +0 -2
- package/dist/theme/components/checkbox.theme.d.ts +0 -2
- package/dist/theme/components/chip.theme.d.ts +0 -2
- package/dist/theme/components/dev-panel.theme.d.ts +0 -95
- package/dist/theme/components/dialog.theme.d.ts +0 -2
- package/dist/theme/components/drawer.theme.d.ts +0 -4
- package/dist/theme/components/field-base.d.ts +0 -31
- package/dist/theme/components/form-control-label.theme.d.ts +0 -2
- package/dist/theme/components/form-control.theme.d.ts +0 -2
- package/dist/theme/components/index.d.ts +0 -2
- package/dist/theme/components/input.theme.d.ts +0 -3
- package/dist/theme/components/link.theme.d.ts +0 -2
- package/dist/theme/components/menu-item.theme.d.ts +0 -2
- package/dist/theme/components/number-input.theme.d.ts +0 -23
- package/dist/theme/components/phone-number-input.theme.d.ts +0 -43
- package/dist/theme/components/radio.theme.d.ts +0 -2
- package/dist/theme/components/select.theme.d.ts +0 -2
- package/dist/theme/components/slider.theme.d.ts +0 -2
- package/dist/theme/components/tabs.theme.d.ts +0 -34
- package/dist/theme/components/tooltip.theme.d.ts +0 -110
- package/dist/theme/components/typography.theme.d.ts +0 -2
- package/dist/theme/mui-augmentation.d.ts +0 -147
- package/dist/theme/sx-config.d.ts +0 -10
- /package/dist/{components/form/datepicker → date-picker}/calendar-header.d.ts +0 -0
- /package/dist/{components/form/datepicker → date-picker}/drawer-toolbar.d.ts +0 -0
- /package/dist/{theme/components → date-picker/theme}/date-picker.theme.d.ts +0 -0
- /package/dist/{theme/components → date-picker/theme}/icon-button.theme.d.ts +0 -0
- /package/dist/{theme/tokens → date-picker/theme}/typography.d.ts +0 -0
- /package/dist/{components/form/datepicker → date-picker}/use-calendar-header-labels.d.ts +0 -0
- /package/dist/{components/form/datepicker → date-picker}/use-datepicker-title-labels.d.ts +0 -0
- /package/dist/{components/form/datepicker → date-picker}/view-renderers.d.ts +0 -0
- /package/dist/{components/form/datepicker → date-picker}/view-toggle.d.ts +0 -0
- /package/dist/{components/dev-panel → dev-panel}/dev-panel-country.d.ts +0 -0
- /package/dist/{components/dev-panel → dev-panel}/dev-panel-flow.d.ts +0 -0
- /package/dist/{components/dev-panel → dev-panel}/dev-panel-footer.d.ts +0 -0
- /package/dist/{components/dev-panel → dev-panel}/dev-panel-step-state.d.ts +0 -0
- /package/dist/{components/dev-panel → dev-panel}/dev-panel-variant.d.ts +0 -0
- /package/dist/{components/dev-panel → dev-panel}/use-copy.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,649 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 8.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 26dd9a1: **Migrating from 7.x:** follow the guide, which takes an app through this release step by step: what to install and remove, what TypeScript reports, and what it does not. It is in Storybook under Docs → Migrating to v8, and in the repo at `docs/migration/v7-to-v8.md`.
|
|
8
|
+
- 1d1f026: `ActionButton` no longer wraps MUI's `Button`. It is built on Base UI's `Button` and styled with a CSS Module from the design tokens, so it renders without `LeaProvider`. `ActionButtonProps` is exported.
|
|
9
|
+
|
|
10
|
+
Breaking:
|
|
11
|
+
|
|
12
|
+
- `component` and `href` are replaced by `render`, as on `Button`: `<ActionButton component={NextLink} href="/lan">` and `<ActionButton href="/lan">` become `<ActionButton render={<NextLink href="/lan" />}>` and `<ActionButton render={<a href="/lan" />}>`.
|
|
13
|
+
- The other props of MUI's `Button` are removed: `sx`, `startIcon`, `endIcon`, `size`, `color`, `fullWidth` and the rest. Use `className` or `style`.
|
|
14
|
+
- The markup no longer carries `MuiButton-*` class names, and there is no ripple.
|
|
15
|
+
|
|
16
|
+
Visible changes:
|
|
17
|
+
|
|
18
|
+
- The label is set in the page's font, Clash Grotesk. Before, it fell back to the browser's own button font (Arial), because the theme gave MUI's button no font.
|
|
19
|
+
- Keyboard focus shows the library's ring 2px outside the pill. Before, the line around the pill only grew from 1px to 2px.
|
|
20
|
+
|
|
21
|
+
- dfc1ef0: `CheckAnimation`, `PulseAnimation` and `StatusAnimation` name their sizes like every other component.
|
|
22
|
+
|
|
23
|
+
Breaking: `size="small"` is `size="sm"`, and `size="large"` is `size="lg"`. The sizes themselves are the same (90px and 150px), and `lg` is still the default.
|
|
24
|
+
|
|
25
|
+
- dbe22e6: `Autocomplete` no longer uses MUI. It is built on Base UI's `Combobox` and shares the box, the floating label and the helper text of `Input`, and the list of `Select`, so it renders without `LeaProvider`.
|
|
26
|
+
|
|
27
|
+
Breaking:
|
|
28
|
+
|
|
29
|
+
- The `email` mode is removed, with `domains` and `maxSuggestions`. Use `EmailInput`, which is the same control under its own name.
|
|
30
|
+
- `options` is required.
|
|
31
|
+
- The props are a defined list: `label`, `helperText`, `options`, `value`, `defaultValue`, `onValueChange`, `multiple`, `min`, `max`, `placeholder`, `noOptionsText`, `loading`, `error`, `required`, `disabled`, `onBlur`, `name`, `id`, `aria-label`, `aria-labelledby`, `aria-describedby`, `className`, `style` and `ref`. Everything else MUI's `Autocomplete` took is gone, among them `sx`, `size`, `fullWidth`, `renderOption`, `groupBy`, `loadingText`, `openOnFocus`, `disableClearable`, `open`, `onOpen`, `onClose`, `slots` and `slotProps`.
|
|
32
|
+
- `className` and `style` are applied to the outermost element, which also holds the helper text.
|
|
33
|
+
- The markup no longer carries `MuiAutocomplete-*`, `MuiOutlinedInput-*`, `MuiInputBase-*` and `MuiFormControl-*` class names. The list is a Base UI popup.
|
|
34
|
+
- Home and End move the cursor in the text. In MUI they moved to the first and the last option.
|
|
35
|
+
- Hovering an option no longer moves the option the arrow keys are on. The keyboard and the mouse each mark their own, as in `Select`.
|
|
36
|
+
- With `multiple`, an option that is chosen is disabled once `min` is reached, as in `MultiSelect`. Before, a click on it was ignored without a sign.
|
|
37
|
+
|
|
38
|
+
New:
|
|
39
|
+
|
|
40
|
+
- `value`, `defaultValue` and `onValueChange` take their type from the options, as in `Select`. `onValueChange` of a single `Autocomplete` gives `""` when the control is emptied.
|
|
41
|
+
- `disabled` on an option shows it without letting it be chosen.
|
|
42
|
+
- The control is named by its label through `aria-labelledby` as well as `for`.
|
|
43
|
+
|
|
44
|
+
Visible changes:
|
|
45
|
+
|
|
46
|
+
- The text is `text.base` (`#0F1010`) instead of MUI's `rgba(0, 0, 0, 0.87)`, the label `neutral-600` (`#5E5E5E`) instead of `rgba(0, 0, 0, 0.6)`, and the resting border `neutral-300` instead of `rgba(0, 0, 0, 0.23)`, as in `Input`. The text sits 1px lower, on the same line as in `Input`.
|
|
47
|
+
- The arrow is 20px and the cross 18px. Both were 24px. The arrow turns with a short transition.
|
|
48
|
+
- While the list is open, the field is square where the two meet, as in `Select`.
|
|
49
|
+
- Options are 40px high with rounded ends, as in `Select`. They were 48px on screens under 600px wide and 36px above. The chosen option has the fill of `Select`'s (`bg.accent`), a shade darker than before.
|
|
50
|
+
- With `multiple`, the text field shares the last line of chips while 64px is left on it, so a field with a few chips stays 54px high. Before, it moved to a line of its own once less than about 210px was left. The chips start 14px in, under the label, instead of 10px.
|
|
51
|
+
|
|
52
|
+
- 1d1f026: `Card` no longer wraps MUI's `Card`, and the library now has its own `CardContent`. Both are a `div` styled with a CSS Module from the design tokens, so they render without `LeaProvider`. A card looks the same: white, a 1px `border.base` border, 16px corners and no shadow. `CardContent` has 16px of padding on every side; MUI's has 24px at the bottom when it is the last child.
|
|
53
|
+
|
|
54
|
+
Both take `className`, `style`, `render`, `ref` and the attributes of a `div`. `ref` gives the rendered element and is typed `Ref<HTMLElement>`, since `render` decides which element that is. `CardProps` and `CardContentProps` are exported.
|
|
55
|
+
|
|
56
|
+
Breaking:
|
|
57
|
+
|
|
58
|
+
- Import `CardContent` from `@leabankab/component-library` instead of `@mui/material`. MUI's still works inside the card, but needs MUI and Emotion installed.
|
|
59
|
+
- `raised`, `elevation`, `variant` and `square` are removed. A card is always flat.
|
|
60
|
+
- `sx` and `component` are removed. Use `className` or `style`, and `render` for another element: `<Card render={<section />}>`.
|
|
61
|
+
- The element no longer carries `MuiCard-*` and `MuiPaper-*` class names.
|
|
62
|
+
- Text placed straight in a card is `text.base` (`#0F1010`) instead of MUI's `rgba(0, 0, 0, 0.87)`.
|
|
63
|
+
|
|
64
|
+
- 1d1f026: `Chip` no longer wraps MUI's `Chip`. It is a `span` styled with a CSS Module from the design tokens, so it renders without `LeaProvider`, and it has its own props: `label`, `color`, `variant`, `size`, `icon`, `onDelete`, `deleteLabel`, `disabled`, `className`, `style`, `ref` and the attributes of a `span`. `ChipColor`, `ChipVariant` and `ChipSize` are exported. The colours look the same; their names change with the colour props of the other components, described in this release.
|
|
65
|
+
|
|
66
|
+
Breaking:
|
|
67
|
+
|
|
68
|
+
- `size` takes `"sm"` and `"md"` instead of `"small"` and `"medium"`, like `Button`.
|
|
69
|
+
- `color` takes only the chip's own colours. MUI's `default` and `secondary` are no longer accepted, and `primary`, `success`, `info`, `warning` and `error` now mean the library's colours rather than MUI's.
|
|
70
|
+
- `avatar`, `deleteIcon`, `onClick`, `clickable`, `component` and `sx` are removed. `ref` is the `span`, where it was a `div`. A chip is no longer clickable as a whole. `deleteLabel` replaces `deleteIcon` for a different accessible name.
|
|
71
|
+
- With `onDelete`, the chip is no longer a focusable `role="button"` that is removed with Backspace or Delete. It has a real remove `<button>` named "Fjern" plus the label, reached with Tab and pressed with Enter or Space. Tests that click `.MuiChip-deleteIcon` can use `getByRole("button", { name: "Fjern Oslo" })`.
|
|
72
|
+
- The markup no longer carries `MuiChip-*` class names.
|
|
73
|
+
|
|
74
|
+
Visible changes, all small: a medium chip is 27px tall instead of 27.8px, an outlined chip is 2px wider, and the cross of the remove button is the `lucide-react` icon.
|
|
75
|
+
|
|
76
|
+
- 3b123bb: One vocabulary for the `color` prop. A value names a group of colour tokens (a brand colour, a status, the greys), never a hue, and means the same on every component: `primary`, `secondary`, `tertiary`, `neutral`, `success`, `info`, `warning`, `error` and `contrast`. `ColorRole` is the shared type, and each component accepts the subset it has a design for.
|
|
77
|
+
|
|
78
|
+
**Breaking.** Rename:
|
|
79
|
+
|
|
80
|
+
| Component | Before | After |
|
|
81
|
+
| -------------------------------------------------------- | --------- | -------------------------------------------- |
|
|
82
|
+
| `Button`, `IconButton`, `CloseButton`, `DownloadTrigger` | `accent` | `primary` |
|
|
83
|
+
| | `neutral` | `secondary` |
|
|
84
|
+
| | `danger` | `error` |
|
|
85
|
+
| `Link` | `black` | `secondary` |
|
|
86
|
+
| | `purple` | `primary` |
|
|
87
|
+
| | `teal` | `tertiary` |
|
|
88
|
+
| | `white` | `contrast` |
|
|
89
|
+
| `Alert`, `GlobalAlert` | `purple` | `primary` |
|
|
90
|
+
| | `grey` | `neutral` |
|
|
91
|
+
| `ProgressCircle`, `FormStepper`, `LinearFormStepper` | `purple` | `primary` |
|
|
92
|
+
| | `teal` | `tertiary` |
|
|
93
|
+
| `StatusIcon`, `CheckAnimation`, `StatusAnimation` | `purple` | `primary` |
|
|
94
|
+
| | `green` | `tertiary` |
|
|
95
|
+
| `Chip` | `purple` | `primary` |
|
|
96
|
+
| | `teal` | `success` for a status, `tertiary` for a tag |
|
|
97
|
+
| | `blue` | `info` |
|
|
98
|
+
| | `orange` | `warning` |
|
|
99
|
+
| | `grey` | `neutral` |
|
|
100
|
+
|
|
101
|
+
The rename changes no colour (the warning colour itself changes in a separate change in this release): every value looks as it did under its old name, and the defaults are the same colours (`primary` on the buttons, `Chip`, the steppers and the animations; `secondary` on `Link` and `CloseButton`).
|
|
102
|
+
|
|
103
|
+
TypeScript reports every old name. Two things it cannot report:
|
|
104
|
+
|
|
105
|
+
- `neutral` has moved. On the buttons it meant near-black and is now `secondary`; `neutral` now means grey, on `Alert` and `Chip`. No component accepts both, so a missed rename is still a type error.
|
|
106
|
+
- An old name that reaches a component untyped (from JavaScript, or through `as any`) is not an error. The component renders in its default colour.
|
|
107
|
+
|
|
108
|
+
The `data-color` attribute on the rendered elements carries the new names, for a test or a stylesheet that selects on it.
|
|
109
|
+
|
|
110
|
+
New:
|
|
111
|
+
|
|
112
|
+
- `Chip` takes `error`, a red chip. A chip is either a tag (`primary`, `tertiary`, `neutral`) or a status (`success`, `info`, `warning`, `error`); the status colours are kept for statuses, so there is no blue tag.
|
|
113
|
+
- `ColorRole` is exported. `ButtonColor`, `LinkColor`, `AlertColor`, `AlertSeverity`, `ChipColor` and `ProgressCircleColor` keep their names and are subsets of it.
|
|
114
|
+
|
|
115
|
+
`Text` is not part of this: its `color` takes a palette token by its path (`text.subtle`, `primary.base`).
|
|
116
|
+
|
|
117
|
+
- 1d1f026: `DataField`, `List.Root` and `List.Item` no longer use MUI's `Box`. They are styled with CSS Modules from the design tokens, so they render without `LeaProvider`, and they look the same.
|
|
118
|
+
|
|
119
|
+
Breaking:
|
|
120
|
+
|
|
121
|
+
- `sx` is removed from all three, and `DataField` no longer takes `component`. Use `className` or `style`.
|
|
122
|
+
- The elements no longer carry `MuiBox-root` class names. The marker of a `List.Item` is a `span` instead of a `div`.
|
|
123
|
+
|
|
124
|
+
`List.Root` and `List.Item` now also take `style` and the attributes of a `ul` and an `li`, so a list can have an `aria-label`.
|
|
125
|
+
|
|
126
|
+
- af6b039: `DatePicker` has its own import path, and its own props.
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
import { DatePicker } from "@leabankab/component-library/date-picker";
|
|
130
|
+
|
|
131
|
+
<DatePicker label="Ansatt siden" value={value} onValueChange={setValue} />;
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
It is the one component still built on MUI (`@mui/x-date-pickers`). Moving it out of the main entry is what lets MUI, Emotion and `date-fns` be optional peer dependencies: an app with a date picker installs `@mui/material`, `@mui/system`, `@mui/x-date-pickers`, `@emotion/react`, `@emotion/styled` and `date-fns`, and an app without one installs none of them.
|
|
135
|
+
|
|
136
|
+
It needs no provider. The picker brings its own MUI theme and localisation, and follows the `language` of `LeaProvider`. Its theme is private: it does not reach MUI components the app renders itself. It looks and behaves as before.
|
|
137
|
+
|
|
138
|
+
Breaking:
|
|
139
|
+
|
|
140
|
+
- Import it from `@leabankab/component-library/date-picker`. It is no longer exported from the main entry.
|
|
141
|
+
- `DatePickerProps` no longer extends MUI's. The props are:
|
|
142
|
+
|
|
143
|
+
| Props | |
|
|
144
|
+
| --------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
145
|
+
| `value`, `defaultValue`, `onValueChange`, `onBlur`, `ref`, `name` | The form contract, as before. The value is `Date \| null`. |
|
|
146
|
+
| `label`, `helperText`, `error`, `disabled`, `required`, `readOnly` | As before. |
|
|
147
|
+
| `minDate`, `maxDate`, `disablePast`, `disableFuture` | What can be chosen. |
|
|
148
|
+
| `views`, `monthYearOrder`, `format`, `referenceDate` | Day picker or month/year picker, and how the date is written. |
|
|
149
|
+
| `open`, `onOpenChange` | The calendar, controlled. |
|
|
150
|
+
| `desktopModeMediaQuery`, `eyebrow`, `title`, `viewToggleLabels`, `calendarHeaderLabels` | The drawer and popover, as before. |
|
|
151
|
+
| `className`, `style` | On the field. |
|
|
152
|
+
|
|
153
|
+
- `onOpen` and `onClose` are replaced by `onOpenChange(open)`, as on `Select`.
|
|
154
|
+
- The second argument of `onValueChange` is `{ validationError }`, typed by the library: `"invalidDate"`, `"minDate"`, `"maxDate"`, `"disablePast"`, `"disableFuture"` or `null`.
|
|
155
|
+
- Everything else MUI's `DatePicker` takes is no longer passed through. That includes `slots`, `slotProps`, `sx`, `localeText`, `adapterLocale`, `viewRenderers`, `dayOfWeekFormatter`, `openTo`, `closeOnSelect`, `shouldDisableDate`, `shouldDisableMonth`, `shouldDisableYear`, `onAccept`, `onError`, `timezone` and `autoFocus`. The locale and the texts follow `LeaProvider`; a date always commits when it is picked.
|
|
156
|
+
- `ViewToggleLabels` and `CalendarHeaderLabels` are exported from the new path, with `DatePickerView`, `DatePickerChangeDetails`, `DatePickerValidationError` and `MonthYearOrder`.
|
|
157
|
+
|
|
158
|
+
- af6b039: `DevPanel` and its parts have their own import path, so an app only ships the dev panel where it imports it, and the panel no longer uses MUI. It is drawn with plain elements and a stylesheet of its own from the design tokens, `dev-panel.css`, which the import path loads with the component.
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
import { DevPanel } from "@leabankab/component-library/dev-panel";
|
|
162
|
+
|
|
163
|
+
<DevPanel.Root badge="MOCK">
|
|
164
|
+
<DevPanel.Country
|
|
165
|
+
value={country}
|
|
166
|
+
onChange={setCountry}
|
|
167
|
+
options={countries}
|
|
168
|
+
/>
|
|
169
|
+
</DevPanel.Root>;
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Breaking:
|
|
173
|
+
|
|
174
|
+
- Import `DevPanel` from `@leabankab/component-library/dev-panel`. It is no longer exported from the main entry, and its parts are a namespace in this release: `DevPanel.Root`, `DevPanel.Country`, `DevPanel.Variant`, `DevPanel.StepState`, `DevPanel.Steps`, `DevPanel.Status`, `DevPanel.Flow`, `DevPanel.Payload`, `DevPanel.Footer`, `DevPanel.Section`, `DevPanel.useSectionLabelId` and their types.
|
|
175
|
+
- `sx` on the panel and on a section is removed. Both take `className` and `style`, on their outermost element: `<DevPanel sx={{ position: "fixed", bottom: 16, right: 16 }}>` becomes `<DevPanel.Root style={{ position: "fixed", bottom: 16, right: 16 }}>`.
|
|
176
|
+
- The markup no longer carries `MuiBox-root` class names.
|
|
177
|
+
|
|
178
|
+
The path needs no peer dependency, no theme and no provider: with the dev panel off MUI, `@mui/material`, `@mui/system`, `@mui/x-date-pickers`, `@emotion/react`, `@emotion/styled` and `date-fns` are needed by the `date-picker` path alone.
|
|
179
|
+
|
|
180
|
+
It looks as before, pixel for pixel. What behaves differently is listed under the dev panel fixes in this release.
|
|
181
|
+
|
|
182
|
+
- dbe22e6: `EmailInput` no longer uses MUI. It is built on Base UI's `Autocomplete` and shares the box, the floating label and the helper text of `Input`, so it renders without `LeaProvider`. The suggestions work as before.
|
|
183
|
+
|
|
184
|
+
Breaking:
|
|
185
|
+
|
|
186
|
+
- The input has `autocomplete="email"`, so the browser offers the user's own address. MUI set `autocomplete="off"`. Pass `autoComplete="off"` where the address is somebody else's.
|
|
187
|
+
- `onBlur` is called with a `FocusEvent<HTMLElement>` when focus leaves the control. It was typed for the wrapping `div`.
|
|
188
|
+
- The markup no longer carries `MuiAutocomplete-*`, `MuiOutlinedInput-*` and `MuiFormControl-*` class names.
|
|
189
|
+
|
|
190
|
+
New:
|
|
191
|
+
|
|
192
|
+
- `id`, `autoComplete`, `aria-label`, `aria-labelledby`, `aria-describedby`, `className` and `style`.
|
|
193
|
+
|
|
194
|
+
Visible changes: the colours, the text position, the 18px cross and the list are those described for `Autocomplete`.
|
|
195
|
+
|
|
196
|
+
- 079a525: Clash Grotesk now ships as a font file with the library stylesheet instead of inside the JavaScript. An app gets the font by using the package, with or without `LeaProvider`, and it is declared before any JavaScript runs, so a server-rendered page can start loading it straight away.
|
|
197
|
+
|
|
198
|
+
- The library's JavaScript (the ES build) is less than half the size: 163 kB, down from 359 kB, or 44 kB gzipped, down from 192 kB.
|
|
199
|
+
- One variable font file (47 kB, weights 200 to 700) replaces six files. The browser caches it separately from your JavaScript.
|
|
200
|
+
- The stylesheet sets the font on `body`, with the same font smoothing `LeaProvider` applied.
|
|
201
|
+
- Add the token `--lea-font-family`, and `font-sans` in the Tailwind theme.
|
|
202
|
+
|
|
203
|
+
**Breaking.**
|
|
204
|
+
|
|
205
|
+
- `LeaProvider` no longer declares the font. The ES build imports the stylesheet for you; with the UMD build, import `@leabankab/component-library/styles.css`, or the page has no Clash Grotesk.
|
|
206
|
+
- The font loads with `font-display: swap`, where it was `optional`. It now always appears once it has loaded. Until then text is set in Arial, resized to Clash Grotesk's letter width, so lines break in the same places and the layout barely moves.
|
|
207
|
+
- The font stack is `"ClashGrotesk", "ClashGrotesk Fallback", sans-serif`. Use `var(--lea-font-family)` instead of writing the family name yourself, so your own text gets the same fallback.
|
|
208
|
+
- Don't set a `font-family` on `body` in the app; the stylesheet does it.
|
|
209
|
+
|
|
210
|
+
At weights 400 and 500 the variable font draws some letters 1/1000 em wider than the old files did, which is about 0.02px per letter at 16px.
|
|
211
|
+
|
|
212
|
+
- 31da3b6: Every form control now takes the same props for its value, its error state and its ref: `value`, `defaultValue`, `onValueChange`, `onBlur`, `ref`, `name`, `label`, `helperText`, `error`, `disabled` and `required`. `Checkbox`, `RadioGroup` and the new `RadioCardGroup` render their own label, helper text and error state, which used to take a `FormControl`, a `FormLabel` and a `FormControlLabel` around them.
|
|
213
|
+
|
|
214
|
+
Breaking, on every control:
|
|
215
|
+
|
|
216
|
+
- `onChange` is replaced by `onValueChange`, called with the value instead of an event, on `Select`, `MultiSelect`, `Autocomplete`, `EmailInput`, `PhoneNumberInput`, `DatePicker` and `RadioGroup`. `Select`: `onChange={(e) => set(e.target.value)}` becomes `onValueChange={set}`. `MultiSelect` no longer passes the event as a second argument. `Input` gains `onValueChange` and keeps the native `onChange`.
|
|
217
|
+
- `ref` now points at the element that takes focus instead of the wrapper: the `<input>` on `Input`, `Autocomplete`, `EmailInput`, `PhoneNumberInput` and `NumberInput`, the element with the `combobox` role on `Select` and `MultiSelect`, the first part of the date on `DatePicker`, and the chosen radio on the radio groups. `inputRef` is gone from `NumberInput`, `PhoneNumberInput` and `DatePicker`; use `ref`.
|
|
218
|
+
- The low-level parts are no longer exported: `FormControl`, `FormLabel`, `FormHelperText`, `InputLabel`, `FormControlLabel`, `InputAdornment`, `useFormField`, `RadioCircle` and `useRadioGroupSize`, with their types. Controls can no longer be composed inside a `FormControl`; pass `label` and `helperText` to the control.
|
|
219
|
+
- `startAdornment` and `endAdornment` on `Input` and `Select` take the content itself. Drop the `InputAdornment` around it: `startAdornment={<Search size={20} />}`.
|
|
220
|
+
|
|
221
|
+
Breaking, per control:
|
|
222
|
+
|
|
223
|
+
- `Input` has its own list of props instead of MUI's `OutlinedInputProps`: the native `<input>` attributes, plus `label`, `helperText`, `error`, `onValueChange`, `startAdornment`, `endAdornment` and `multiline` with `rows`, `minRows` and `maxRows`. `sx`, `inputProps`, `slotProps`, `size`, `color` and the other MUI-only props are gone. Native attributes go straight on the component (`<Input maxLength={6} inputMode="numeric" />`), and `className` and `style` go on the outermost element.
|
|
224
|
+
- `Checkbox` takes `label`, `helperText`, `error`, `checked`, `defaultChecked` and `onCheckedChange(checked)`. `onChange(event, checked)` and MUI's other props are gone. An accessible name is required in TypeScript: pass `label`, or `aria-label` when there is no visible label. `<FormControlLabel control={<Checkbox />} label="…" />` becomes `<Checkbox label="…" />`.
|
|
225
|
+
- `RadioGroup` takes `label`, `tooltip`, `helperText`, `error`, `value`, `defaultValue`, `onValueChange` and an `options` list, and no longer wraps MUI's `RadioGroup`: `row`, `sx` and `onChange(event, value)` are gone. Values are typed and compared with `===`, so `value="true"` no longer matches a radio whose value is `true`. An accessible name is required in TypeScript: `label`, `aria-label` or `aria-labelledby`.
|
|
226
|
+
- `Radio` takes `value`, `label`, `disabled` and `size`, and only works inside a `RadioGroup`: `checked`, `defaultChecked` and `onChange` are gone, and it throws outside a group. `<FormControlLabel value="a" control={<Radio />} label="A" />` becomes `<RadioGroup.Item value="a" label="A" />` (the radios are a namespace in this release), or an entry in `options`.
|
|
227
|
+
- The radio `size` values are renamed from `"small"` and `"medium"` to `"sm"` and `"md"`.
|
|
228
|
+
- `RadioCard` goes inside the new `RadioCardGroup` instead of a `RadioGroup` with a grid around the cards. `RadioCardGroup` has the same props as `RadioGroup`, plus `columns` for the layout and `size` for the card padding. `RadioCard` loses `sx`, `checked` and `onChange`, and `RadioCardContent` loses `sx`; both take `className` and `style`. `RadioCardIndicator` takes its own `size` instead of reading it from the group.
|
|
229
|
+
- `DatePicker` gains `onBlur`, called when focus leaves the field and when the calendar closes.
|
|
230
|
+
- `NumberInput` gains `tooltip`, for help text next to a label placed outside the field. It replaces composing a `FormLabel` with a `Tooltip` by hand.
|
|
231
|
+
- `Autocomplete` and `EmailInput` gain `name`, which submits the value in a native form.
|
|
232
|
+
|
|
233
|
+
- 31da3b6: `Input`, `Checkbox`, `Radio`, `RadioGroup`, `RadioCard` and `RadioCardGroup` no longer wrap MUI. They are built on Base UI's `Input`, `Checkbox`, `Radio` and `RadioGroup` and styled with CSS Modules from the design tokens, so they render without `LeaProvider`. Their props are unchanged.
|
|
234
|
+
|
|
235
|
+
Breaking:
|
|
236
|
+
|
|
237
|
+
- The markup no longer carries `Mui*` class names, and the checkbox and the radios are no longer a native `<input>` with a picture on top: each is a `<button>` with the `checkbox` or `radio` role, next to a hidden `<input>` that submits the value. Stylesheets and tests that target `.MuiOutlinedInput-root`, `.MuiCheckbox-root`, `.lea-checkbox-box`, `.lea-radio-circle` or `input[type="radio"]` need updating. In tests, find the controls by role or by label (`getByRole("checkbox", { name })`, `getByLabelText`), which works as before.
|
|
238
|
+
- `id` on `Checkbox` and `Radio` is now on that button rather than on the `<input>`. `ref` is still the `<input>`, which is hidden; `ref.current.focus()` moves focus to the visible control.
|
|
239
|
+
- `RadioCard` no longer has a `data-checked` attribute. The radio inside it does: `.card:has([data-checked])`.
|
|
240
|
+
- `RadioGroup` and `RadioCardGroup` no longer generate a `name` when none is given. Pass `name` to include the choice in a native form submit; before, it was submitted under a generated name.
|
|
241
|
+
- The helper text of these controls is announced as an alert while the control is in error.
|
|
242
|
+
|
|
243
|
+
Visible changes, all small:
|
|
244
|
+
|
|
245
|
+
- Keyboard focus on a checkbox and a radio is the library's dark ring instead of a purple one, and a `RadioCard` now shows it too. It had no visible focus before.
|
|
246
|
+
- Text in an `Input` is `text.base` (`#0F1010`) instead of MUI's `rgba(0, 0, 0, 0.87)`, and its label and helper text are `neutral-600` (`#5E5E5E`) instead of `rgba(0, 0, 0, 0.6)`.
|
|
247
|
+
- A multiline `Input` has 24px rows instead of 19px, so the same number of rows is taller: three rows are 102px instead of 89px.
|
|
248
|
+
- The label above a radio group is 20px tall instead of 23px, so the group sits 3px higher. With a `tooltip` it now has the same 12px below it as without, where it had none.
|
|
249
|
+
- A `RadioCard` with a description is 2px taller, from the text styles its two lines now use.
|
|
250
|
+
- Helper text sits 4px below its control instead of 3px.
|
|
251
|
+
|
|
252
|
+
- 31da3b6: The twelve react-hook-form wrappers are replaced by one binding, `FormField`, which works with every form control. It has its own import path, and `react-hook-form` is now an optional peer dependency: an app that does not use `FormField` no longer needs it installed.
|
|
253
|
+
|
|
254
|
+
```tsx
|
|
255
|
+
import { Input } from "@leabankab/component-library";
|
|
256
|
+
import { FormField } from "@leabankab/component-library/react-hook-form";
|
|
257
|
+
|
|
258
|
+
<FormField
|
|
259
|
+
control={control}
|
|
260
|
+
name="email"
|
|
261
|
+
rules={{ required: "Skriv inn e-postadressen din." }}
|
|
262
|
+
render={({ field }) => <Input label="E-post" {...field} />}
|
|
263
|
+
/>;
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
`FormField` takes what `useController` takes (`name`, `control`, `rules`, `defaultValue`, `disabled`, `shouldUnregister`) and reads `control` from a `FormProvider` when the prop is left out. Spread `field` last. For a `Checkbox`, spread `checkedField` instead. The Forms page in Storybook has the full guide.
|
|
267
|
+
|
|
268
|
+
Breaking:
|
|
269
|
+
|
|
270
|
+
- `InputField`, `EmailField`, `NumberField`, `PhoneNumberField`, `SelectField`, `MultiSelectField`, `AutocompleteField`, `DatePickerField`, `CheckboxField`, `RadioField`, `RadioCardField` and `BooleanRadioCardField` are removed, with `useResolvedControl` and the types `BaseFieldProps`, `FieldOption` and `FieldValueTransform`. Wrap the control in a `FormField`: `<InputField name="email" label="E-post" />` becomes `<FormField name="email" render={({ field }) => <Input label="E-post" {...field} />} />`.
|
|
271
|
+
- `RadioField` becomes `<RadioGroup.Root label options {...field} />`, and `RadioCardField` becomes `<RadioCard.Group label options columns={2} size="sm" {...field} />`. The `columns` and `size` are needed to keep the old look: `RadioCardField` was two columns of small cards, and `RadioCardGroup` defaults to one column of large ones. `gridColumns="1fr 1fr"` is now `columns={2}` and `cardSize` is `size`.
|
|
272
|
+
- `format` and `parse` are gone, and with them `BooleanRadioCardField`. Radio values are compared with `===` and can be booleans or numbers, so give the options the real values: `options={[{ value: true, label: "Ja" }, { value: false, label: "Nei" }]}`.
|
|
273
|
+
- `SelectField` validated the field on every change, whatever the form's `mode`. `Select` in a `FormField` follows the `mode`, like every other control.
|
|
274
|
+
- The wrappers turned a missing value into `""`, `null` or `[]`. `FormField` passes the value through as react-hook-form gives it, so give every field a default in `defaultValues`.
|
|
275
|
+
- `DatePickerField` only marked the field as touched when the calendar closed. `DatePicker` now also does so when focus leaves the field, so a typed date is validated on blur.
|
|
276
|
+
|
|
277
|
+
- 1d1f026: Helper text under every form control is now 14px with a 21px line (`body-sm`), as it already was under `Slider` and `AmountSlider`. It was 16px with a 24px line. A field with one line of helper text is 3px shorter.
|
|
278
|
+
|
|
279
|
+
This covers `Input`, `NumberInput`, `Checkbox`, `RadioGroup`, `RadioCardGroup`, `Select`, `MultiSelect`, `Autocomplete`, `EmailInput`, `PhoneNumberInput` and `DatePicker`.
|
|
280
|
+
|
|
281
|
+
- af6b039: `LeaProvider` no longer brings MUI. It sets the language of the library's own texts and of the components that format by locale, and nothing else: no `ThemeProvider`, no `CssBaseline`, no Emotion. No component in the main entry needs it to render, and without it the language is Norwegian.
|
|
282
|
+
|
|
283
|
+
The main entry (`@leabankab/component-library`) no longer imports MUI, Emotion or `date-fns` at all. Its JavaScript (the ES build) is 97 kB, down from 151 kB, and a page without a date picker has no Emotion style tags.
|
|
284
|
+
|
|
285
|
+
Breaking:
|
|
286
|
+
|
|
287
|
+
- **The MUI theme is gone from the app.** A MUI component the app renders itself (`Box`, `Typography`, `Button`, anything from `@mui/material`) is no longer themed by the library: it gets MUI's default look, and `sx` no longer resolves the Lea tokens (`sx={{ color: "text.subtle" }}`, `borderRadius: "md"`, `theme.palette.bg.base`). Use the library's components, the `--lea-*` variables or the Tailwind theme instead. An app that keeps MUI code of its own for a while provides its own `ThemeProvider` and theme.
|
|
288
|
+
- **`theme`, `LeaBankTheme` and `LeaSxProps` are no longer exported.** The token values are in the stylesheet as `--lea-*` variables: `theme.palette.text.subtle` is `var(--lea-palette-text-subtle)`, `theme.colors.purple[600]` is `var(--lea-color-purple-600)`, `theme.shape.md` is `var(--lea-radius-md)` and `theme.space(2)` is `var(--lea-spacing-2)`. `breakpoints` is still exported.
|
|
289
|
+
- **The MUI type augmentation is gone.** The library no longer adds `bg`, `border`, `status` and `tertiary` to MUI's `Palette`, the radius names to `Shape`, the token groups to `Theme`, `fontSize` tokens and `text.*` colours to `Typography`, or the Lea colours to MUI's `Alert`, `Chip` and `Button`. An app's own MUI theme types are what MUI declares.
|
|
290
|
+
- **The `--mui-*` variables are no longer on the page.** Use the `--lea-*` equivalents.
|
|
291
|
+
- **`disableCssBaseline` is removed.** There is no `CssBaseline` to disable. What it did for the page is in the library stylesheet now; see the page defaults change in this release.
|
|
292
|
+
- **Every theme override goes with the theme**, from `MuiButton` and `MuiTypography` to `MuiOutlinedInput`. The 7.0.0 notes listed the `MuiDialog` and `MuiDrawer` overrides as removed, but 7.3.0 still applied them.
|
|
293
|
+
|
|
294
|
+
`@mui/material`, `@mui/system`, `@mui/x-date-pickers`, `@emotion/react`, `@emotion/styled` and `date-fns` are now optional peer dependencies. Only the `date-picker` import path needs them; see its change in this release.
|
|
295
|
+
|
|
296
|
+
- 1d1f026: `Link` no longer wraps MUI's `Link`. It is a plain `a` styled with a CSS Module from the design tokens, so it renders without `LeaProvider`. It keeps the size and line height of the text around it, regular weight and the same four colours (renamed with the colour props of the other components in this release). `LinkProps` and `LinkColor` are exported. `ref` gives the rendered element and is typed `Ref<HTMLElement>`, since `render` decides which element that is.
|
|
297
|
+
|
|
298
|
+
**A link is now underlined at rest**, and the line goes from 1px to 2px on hover. It had no line until it was hovered, which left colour as the only thing setting it apart from the sentence around it: 1.9:1 against body text for `primary`, and nothing at all for `secondary`, which is the colour of body text. Where a link is not in running text and should have no line, as in a menu, set `text-decoration: none` with `className` or `style`.
|
|
299
|
+
|
|
300
|
+
Breaking:
|
|
301
|
+
|
|
302
|
+
- `component` is replaced by `render`, as on `Button`: `<Link component={NextLink} href="/om-oss">` becomes `<Link render={<NextLink href="/om-oss" />}>`, and `<Link component="button">` becomes `<Link render={<button type="button" />}>`.
|
|
303
|
+
- `sx`, `underline` and `variant` are removed. Use `className` or `style`.
|
|
304
|
+
- The element no longer carries `MuiLink-*` and `MuiTypography-*` class names.
|
|
305
|
+
|
|
306
|
+
The focus ring now sits 2px off the text instead of 1px.
|
|
307
|
+
|
|
308
|
+
- dbe22e6: `MultiSelect` no longer uses MUI. It is built on Base UI's `Select`, on the same field as `Select`, and renders without `LeaProvider`. Chips, the `+N` badge, the checkboxes in the list, and `min` and `max` work as before.
|
|
309
|
+
|
|
310
|
+
Breaking:
|
|
311
|
+
|
|
312
|
+
- The props are a defined list: those of `Select`, with `value`, `defaultValue` and `onValueChange` as arrays, plus `min`, `max` and `renderValue`. The props passed on to MUI's `Select` are gone, among them `sx`, `variant`, `size`, `MenuProps`, `inputProps`, `onOpen` and `onClose`.
|
|
313
|
+
- In a native form, `name` now submits one field per chosen value (`country=no&country=dk`). MUI submitted one field with the values joined by commas (`country=no,dk`). Read them with `formData.getAll("country")`.
|
|
314
|
+
- The chips are no longer inside the element with the `combobox` role. That element holds the chosen labels as text, separated by commas, so a screen reader reads them as the value; the remove buttons of the chips come after it in the tab order. Tests that looked for chips inside the combobox need to look in the field instead.
|
|
315
|
+
- The markup no longer carries MUI class names.
|
|
316
|
+
|
|
317
|
+
New, as in `Select`: values typed from the options, `disabled` on an option, `placeholder`, and `open` with `onOpenChange`.
|
|
318
|
+
|
|
319
|
+
Fixed:
|
|
320
|
+
|
|
321
|
+
- The remove button of a chip works from the keyboard. Enter or Space removes the chip and focus stays in the field. Before, the key opened the list and the chip stayed.
|
|
322
|
+
|
|
323
|
+
- dfc1ef0: `Tabs`, `RadioGroup`, `RadioCard` and `DevPanel` are namespaces that hold their parts, the way `Dialog`, `Drawer`, `Accordion` and `List` already did. Only the names change. The props, the markup and the look are the same.
|
|
324
|
+
|
|
325
|
+
Breaking. Rename:
|
|
326
|
+
|
|
327
|
+
| Before | After |
|
|
328
|
+
| ------------------------------------------------------------ | ----------------------------------------------------------------- |
|
|
329
|
+
| `Tabs`, `TabsList`, `Tab` | `Tabs.Root`, `Tabs.List`, `Tabs.Tab` |
|
|
330
|
+
| `TabsIndicator`, `TabPanel` | `Tabs.Indicator`, `Tabs.Panel` |
|
|
331
|
+
| `TabsProps`, `TabProps` and the other props types | `Tabs.RootProps`, `Tabs.TabProps` and so on |
|
|
332
|
+
| `TabsVariant` | `Tabs.Color` |
|
|
333
|
+
| `RadioGroup`, `Radio` | `RadioGroup.Root`, `RadioGroup.Item` |
|
|
334
|
+
| `RadioGroupProps`, `RadioProps`, `RadioSize` | `RadioGroup.RootProps`, `RadioGroup.ItemProps`, `RadioGroup.Size` |
|
|
335
|
+
| `RadioCard`, `RadioCardProps` | `RadioCard.Root`, `RadioCard.RootProps` |
|
|
336
|
+
| `RadioCardContent`, `RadioCardLabel`, `RadioCardDescription` | `RadioCard.Content`, `RadioCard.Label`, `RadioCard.Description` |
|
|
337
|
+
| `RadioCardIndicator`, `RadioCardIcon`, `RadioCardIconProps` | `RadioCard.Indicator`, `RadioCard.Icon`, `RadioCard.IconProps` |
|
|
338
|
+
| `DevPanel`, `DevPanelSection` | `DevPanel.Root`, `DevPanel.Section` |
|
|
339
|
+
| `DevPanelStatus`, `DevPanelSteps` and the other parts | `DevPanel.Status`, `DevPanel.Steps` and so on |
|
|
340
|
+
| `DevPanelProps`, `DevPanelStep` and the other types | `DevPanel.RootProps`, `DevPanel.Step` and so on |
|
|
341
|
+
| `useDevPanelSectionLabelId` | `DevPanel.useSectionLabelId` |
|
|
342
|
+
|
|
343
|
+
New in this release, so under their new names only: `RadioCard.Group`, `RadioCard.GroupProps`, `RadioCard.IndicatorProps`, `RadioGroup.Option` and `RadioGroup.Value`.
|
|
344
|
+
|
|
345
|
+
TypeScript reports every old name. Also new: `RadioCard.Size`, the card padding, which had no exported type, and `RadioCard.Option` and `RadioCard.Value`, the same types as on `RadioGroup`.
|
|
346
|
+
|
|
347
|
+
A server component cannot use a namespace: the library is one client bundle, and React throws "You cannot dot into a client module from a server component" for `<Tabs.Root>` in a Next.js App Router page. Use these components in a file that starts with `"use client"`. `Card`, `Alert`, `Grid`, `StepProgressProvider` and the other components a server page renders on its own keep their flat names for that reason.
|
|
348
|
+
|
|
349
|
+
- 1d1f026: `NumberInput` no longer uses MUI. It is built on Base UI's `NumberField` alone and shares the box, the floating label and the helper text of `Input`, so it renders without `LeaProvider`. Its value, formatting, stepper and unit behave as before.
|
|
350
|
+
|
|
351
|
+
Breaking:
|
|
352
|
+
|
|
353
|
+
- `size` is removed. `Input` has no sizes either.
|
|
354
|
+
- `className` and `style` are now applied to the outermost element, as on `Input`. Before, they went to an element without a box of its own and had no effect. `render` is no longer accepted.
|
|
355
|
+
- The markup no longer carries `MuiOutlinedInput-*`, `MuiInputAdornment-*`, `MuiIconButton-*` and `MuiFormControl-*` class names.
|
|
356
|
+
|
|
357
|
+
Visible changes, all small:
|
|
358
|
+
|
|
359
|
+
- The value is `text.base` (`#0F1010`) instead of MUI's `rgba(0, 0, 0, 0.87)`, and the floating label is `neutral-600` (`#5E5E5E`) instead of `rgba(0, 0, 0, 0.6)`, as in `Input`.
|
|
360
|
+
- With `labelPlacement="outside"`, the label is 12px above the field with or without a `tooltip`. With a tooltip it used to touch the field. A click on the label now moves focus to the input.
|
|
361
|
+
- A click on the unit or the icon moves focus to the input.
|
|
362
|
+
|
|
363
|
+
- af6b039: The library stylesheet now carries the page defaults that MUI's `CssBaseline` set while `LeaProvider` rendered one: `box-sizing: border-box` on every element, no margin on `body`, and body text in `text.base` on `bg.base` at 16px with line height 1.5. An app gets them with the stylesheet, with or without `LeaProvider`, and they are in the markup the server sends rather than injected by Emotion.
|
|
364
|
+
|
|
365
|
+
They sit in the cascade layer `base`, the layer Tailwind's preflight uses. A layered rule loses to every rule outside a layer and to every later layer, so the app's own stylesheet and its Tailwind utilities win without extra specificity: `<body class="bg-beige-50">` now works, where `CssBaseline` overrode it.
|
|
366
|
+
|
|
367
|
+
Breaking:
|
|
368
|
+
|
|
369
|
+
- Text that takes its colour from `body` is `text.base` (`#0F1010`) instead of MUI's `rgba(0, 0, 0, 0.87)`, which is `#212121` on white. Text in a library component already had its own colour.
|
|
370
|
+
- An unlayered `body` or `*` rule in the app now wins over the defaults, whatever the order of the stylesheets. Before, `CssBaseline` was injected at run time, after the app's stylesheets, and usually won. Check a rule that sets `margin`, `color`, `background-color`, `line-height` or `box-sizing` there.
|
|
371
|
+
- `html` no longer gets `color-scheme: light`. The page is light either way; set it yourself if the app relies on the property.
|
|
372
|
+
- With the UMD build, import `@leabankab/component-library/styles.css`, or the page has no defaults. The ES build imports it for you.
|
|
373
|
+
|
|
374
|
+
- dbe22e6: `PhoneNumberInput` no longer uses MUI. It shares the box, the label and the helper text of `Input`, and its country list is built on Base UI's `Combobox`, so it renders without `LeaProvider`. Formatting, validation and the pinned countries work as before.
|
|
375
|
+
|
|
376
|
+
Breaking:
|
|
377
|
+
|
|
378
|
+
- The props are those of `Input` instead of MUI's `OutlinedInputProps`: the native `<input>` attributes, which land on the number input, plus `label`, `helperText`, `error`, `country`, `defaultCountry`, `onCountryChange`, `value`, `defaultValue`, `onValueChange`, `validateOnBlur`, `className`, `style` and `ref`. `sx`, `inputProps`, `slotProps`, `size`, `fullWidth`, `endAdornment`, `multiline` and the rest of MUI's props are gone. What went into `inputProps` is now passed directly.
|
|
379
|
+
- `className` and `style` are applied to the outermost element, which also holds the helper text.
|
|
380
|
+
- `onBlur` and the other event handlers are typed for the `<input>` alone.
|
|
381
|
+
- The markup no longer carries `MuiOutlinedInput-*`, `MuiInputAdornment-*`, `MuiAutocomplete-*`, `MuiPopper-*` and `MuiFormControl-*` class names, nor `LeaPhoneCountry*`.
|
|
382
|
+
|
|
383
|
+
Changed in the country list:
|
|
384
|
+
|
|
385
|
+
- The country in use is marked in the list, and the list opens scrolled to it.
|
|
386
|
+
- On a touch screen, opening the list no longer brings up the keyboard. Tap the search box to type.
|
|
387
|
+
- The country button has a visible focus ring, and the field has the accent border while the list is open.
|
|
388
|
+
- Tab in the open list closes it and moves on to the number. Before, the list stayed open.
|
|
389
|
+
- The popup has an accessible name, and the line under the pinned countries is no longer an item of the list to assistive tech.
|
|
390
|
+
|
|
391
|
+
Visible changes, all small:
|
|
392
|
+
|
|
393
|
+
- The text is `text.base` (`#0F1010`) instead of MUI's `rgba(0, 0, 0, 0.87)`, the label `neutral-600` (`#5E5E5E`) instead of `rgba(0, 0, 0, 0.6)`, and the resting border `neutral-300`, as in `Input`.
|
|
394
|
+
- The number starts 2px further in, under the label, and sits 1px lower, on the same line as in `Input`. The label was 4px to its left.
|
|
395
|
+
- The countries are 40px high with rounded ends, as the options of `Select`. They were 48px on screens under 600px wide and 36px above.
|
|
396
|
+
- The dial codes in the list are `neutral-600` (`#5E5E5E`) instead of `text.subtle` (`#757575`), which is below 4.5:1 on the fill of a row under the pointer.
|
|
397
|
+
|
|
398
|
+
- 6aa14f4: React 18 is no longer supported. The peer range for `react` and `react-dom` is now `^19.0.0`.
|
|
399
|
+
|
|
400
|
+
`Button`, `IconButton` and `CloseButton` take `ref` as a regular prop instead of through `forwardRef`. Passing a `ref` works as before and points at the rendered element: the `<button>`, or the link passed to `render`. It is typed `Ref<HTMLElement>` on `ButtonProps`, `IconButtonProps` and `CloseButtonProps`.
|
|
401
|
+
|
|
402
|
+
- dbe22e6: `Select` no longer uses MUI. It is built on Base UI's `Select` and shares the box, the floating label and the helper text of `Input`, so it renders without `LeaProvider`.
|
|
403
|
+
|
|
404
|
+
Breaking:
|
|
405
|
+
|
|
406
|
+
- The choices are `options` only, and `options` is required. MUI `MenuItem` children are no longer accepted.
|
|
407
|
+
- The props are a defined list: `label`, `helperText`, `options`, `value`, `defaultValue`, `onValueChange`, `placeholder`, `error`, `required`, `disabled`, `startAdornment`, `endAdornment`, `open`, `onOpenChange`, `onBlur`, `name`, `id`, `aria-label`, `aria-labelledby`, `aria-describedby`, `className`, `style` and `ref`. Everything else MUI's `Select` took is gone, among them `sx`, `variant`, `size`, `fullWidth`, `renderValue`, `displayEmpty`, `MenuProps`, `inputProps`, `IconComponent`, `onOpen` and `onClose`. Use `open` with `onOpenChange` instead of `onOpen` and `onClose`.
|
|
408
|
+
- `className` and `style` are applied to the outermost element, which also holds the helper text.
|
|
409
|
+
- The markup no longer carries `MuiSelect-*`, `MuiOutlinedInput-*`, `MuiMenu-*`, `MuiMenuItem-*` and `MuiFormControl-*` class names. The list is a Base UI popup, not a MUI `Menu`.
|
|
410
|
+
|
|
411
|
+
New:
|
|
412
|
+
|
|
413
|
+
- `value`, `defaultValue` and `onValueChange` take their type from the options. With options written `as const`, `onValueChange` gives `"no" | "se"` rather than `string`, which fits a state of that type without a cast. Plain strings work as before: a `value` of type `string` makes the whole select `string`.
|
|
414
|
+
- `disabled` on an option shows it without letting it be chosen.
|
|
415
|
+
- `placeholder` is shown while nothing is chosen. With a `label` it appears once the label has floated up.
|
|
416
|
+
- `open` and `onOpenChange` control the list from outside.
|
|
417
|
+
- When the list does not fit below the field, it opens above it. MUI moved it over the field.
|
|
418
|
+
|
|
419
|
+
Visible changes, all small:
|
|
420
|
+
|
|
421
|
+
- The chosen value sits 2.5px lower, on the same line as the text in `Input`.
|
|
422
|
+
- The arrow is centred in the field, 2px higher than before, and turns with a short transition.
|
|
423
|
+
- The option the keyboard is on is marked only while the keyboard is in use. Opening the list with the mouse while nothing is chosen no longer marks the first option.
|
|
424
|
+
- When the keyboard is on the chosen option, that option is darker than the chosen fill. Before, the two looked the same.
|
|
425
|
+
|
|
426
|
+
- 679b741: One naming system for the brand colours. `primary`, `secondary` and `tertiary` each have `base`, `hover`, `subtle` and `contrast`, the same steps `bg`, `text` and `border` already use.
|
|
427
|
+
|
|
428
|
+
| Group | Colour | `base` | `hover` | `subtle` | `contrast` |
|
|
429
|
+
| ----------- | ---------- | --------- | --------- | --------- | ---------- |
|
|
430
|
+
| `primary` | purple | `#70427B` | `#5A3463` | `#E2D8E4` | `#FFFFFF` |
|
|
431
|
+
| `secondary` | near-black | `#0F1010` | `#2E2E2E` | `#EBEBEB` | `#FFFFFF` |
|
|
432
|
+
| `tertiary` | teal | `#08C2A7` | `#46D1BD` | `#DAF6F1` | `#FFFFFF` |
|
|
433
|
+
|
|
434
|
+
**Breaking.** `purple` and `teal` are no longer semantic groups, and `primary` and `secondary` no longer use MUI's `main`, `dark`, `light` and `contrastText`. Rename:
|
|
435
|
+
|
|
436
|
+
| Before | After |
|
|
437
|
+
| ----------------------------------------- | ------------------- |
|
|
438
|
+
| `purple.base`, `primary.main` | `primary.base` |
|
|
439
|
+
| `purple.hover`, `primary.dark` | `primary.hover` |
|
|
440
|
+
| `purple.subtle`, `primary.light` | `primary.subtle` |
|
|
441
|
+
| `purple.contrast`, `primary.contrastText` | `primary.contrast` |
|
|
442
|
+
| `teal.base`, `secondary.main` | `tertiary.base` |
|
|
443
|
+
| `teal.hover`, `secondary.dark` | `tertiary.hover` |
|
|
444
|
+
| `teal.subtle`, `secondary.light` | `tertiary.subtle` |
|
|
445
|
+
| `teal.contrast`, `secondary.contrastText` | `tertiary.contrast` |
|
|
446
|
+
|
|
447
|
+
The same rename applies in every form the token takes:
|
|
448
|
+
|
|
449
|
+
- `var(--lea-palette-purple-base)` becomes `var(--lea-palette-primary-base)`. A stylesheet that still uses a removed variable gets no colour and no error, so search for `--lea-palette-purple-`, `--lea-palette-teal-`, `--lea-palette-primary-main` and `--lea-palette-secondary-`.
|
|
450
|
+
- Tailwind `bg-purple-base` becomes `bg-primary-base`, and `bg-teal-base` becomes `bg-tertiary-base`.
|
|
451
|
+
|
|
452
|
+
**`secondary` changes colour** from teal to near-black. Use `tertiary` where teal was meant.
|
|
453
|
+
|
|
454
|
+
Not changed: the raw scales (`colors.purple[600]`, `--lea-color-teal-300`, `bg-purple-600`), `bg`, `text`, `border` and `status`. The `color` props of `Chip`, `Alert`, `Link`, `ProgressCircle` and the steppers are renamed in a change of their own in this release.
|
|
455
|
+
|
|
456
|
+
- 679b741: `Slider` no longer wraps MUI. It is built on Base UI's `Slider` and styled with a CSS Module from the design tokens, so it renders without `LeaProvider`. It has a new look: a flat track and thumb with no shadow or hover halo, the current value shown next to the label, and `min` and `max` shown under each end of the track.
|
|
457
|
+
|
|
458
|
+
Breaking:
|
|
459
|
+
|
|
460
|
+
- `onChange(event, value)` is replaced by `onValueChange(value, details)`, and `onChangeCommitted` by `onValueCommitted`.
|
|
461
|
+
- An accessible name is required in TypeScript: pass `label`, or `aria-label` when there is no visible label.
|
|
462
|
+
- `Slider` is standalone only. It no longer picks up a label or helper text from a surrounding `FormControl`; pass `label` and `helperText` to the slider itself.
|
|
463
|
+
- Single value and horizontal only. Range sliders (an array `value`) and `orientation="vertical"` are not supported.
|
|
464
|
+
- MUI-only props are gone: `marks`, `valueLabelDisplay`, `valueLabelFormat`, `color`, `size`, `track`, `sx`, `slots` and `slotProps`. Use `format` and `locale` to control how the value, `min` and `max` are written, and `className` or `style` for one-off styling.
|
|
465
|
+
- `required` is gone. A slider always has a value.
|
|
466
|
+
- `ref` now points at the root `<div>` rather than MUI's `<span>`, and the markup no longer carries `MuiSlider-*` class names. Stylesheets that target those classes need updating.
|
|
467
|
+
|
|
468
|
+
- 1d1f026: `FormStepper`, `ProgressCircle`, `StatusIcon`, `CheckAnimation`, `PulseAnimation` and `StatusAnimation` no longer use MUI. They are styled with CSS Modules from the design tokens, so they render without `LeaProvider`. Apart from the colour names, which change with the colour props of the other components in this release, and the size names of the three animations, their props are unchanged and they look and move the same.
|
|
469
|
+
|
|
470
|
+
Breaking:
|
|
471
|
+
|
|
472
|
+
- The markup no longer carries `MuiBox-root`, `MuiDivider-root` and `MuiCircularProgress-*` class names. The spinner in `StatusIcon` and `PulseAnimation` is the library's own.
|
|
473
|
+
- `StatusIcon` is built from `span` elements only, so it can sit inside a paragraph. Its spinner is hidden from assistive tech, which already gets the status from the icon's own name; before, it was an unnamed `progressbar` inside the image.
|
|
474
|
+
- The line under `FormStepper` is `border.base` (`#DBDBDB`) instead of MUI's `rgba(0, 0, 0, 0.12)`.
|
|
475
|
+
|
|
476
|
+
- dfc1ef0: `Tabs` takes `color` instead of `variant`. The prop only ever chose the colour of the active pill, so it uses the role names of every other `color` prop. No colour changes, and the default is the same purple.
|
|
477
|
+
|
|
478
|
+
Breaking:
|
|
479
|
+
|
|
480
|
+
- `variant="brand"` is `color="primary"`, and `variant="greyscale"` is `color="secondary"`.
|
|
481
|
+
- `TabsVariant` is `Tabs.Color`.
|
|
482
|
+
- The root carries `data-color`, where it carried `data-variant`, for a test or a stylesheet that selects on it.
|
|
483
|
+
|
|
484
|
+
- 1d1f026: `Tabs` and its parts are styled with a CSS Module from the design tokens instead of MUI's `sx`, so they render without `LeaProvider`. Their look is unchanged. So are their props, apart from `variant`, which is `color` in this release, and their names, which are a namespace in this release (`Tabs.Root`, `Tabs.List`, `Tabs.Tab`, `Tabs.Indicator`, `Tabs.Panel`).
|
|
485
|
+
|
|
486
|
+
Breaking: the markup no longer carries `MuiBox-root` class names.
|
|
487
|
+
|
|
488
|
+
The focus ring of a tab now sits 2px off the tab, like every other control, instead of against it.
|
|
489
|
+
|
|
490
|
+
- 079a525: The Tailwind theme covers line heights, durations and the state opacities.
|
|
491
|
+
|
|
492
|
+
- `leading-none`, `leading-tight`, `leading-snug` and `leading-normal` are the Lea line heights: 1, 1.25, 1.4 and 1.5.
|
|
493
|
+
- `duration-fast`, `duration-normal` and `duration-emphasis` are the Lea durations: 0.15s, 0.2s and 0.3s.
|
|
494
|
+
- `opacity-hover`, `opacity-pressed` and `opacity-highlight`, also as a colour modifier: `bg-primary-base/hover`.
|
|
495
|
+
|
|
496
|
+
**Breaking**, for apps that use the theme: `leading-relaxed` and `leading-loose` no longer exist, and `leading-snug` is 1.4, where Tailwind's own is 1.375. A numbered line height such as `leading-6` is unchanged.
|
|
497
|
+
|
|
498
|
+
- 1d1f026: `Text` no longer wraps MUI's `Typography`. It is a plain element styled with a CSS Module from the design tokens, so it renders without `LeaProvider`. Text with no props looks the same: a `p` without margin, 16px regular at line height 1.5, in `text.base`.
|
|
499
|
+
|
|
500
|
+
`Text` now takes `textStyle`, `fontWeight`, `color`, the new `align`, `render`, `ref`, `className`, `style` and the attributes of the element. `TextProps` is exported. `ref` gives the rendered element and is typed `Ref<HTMLElement>`, since `render` decides which element that is.
|
|
501
|
+
|
|
502
|
+
Breaking:
|
|
503
|
+
|
|
504
|
+
- `component` is replaced by `render`, as on `Button` and `Stack`: `<Text component="h2">` becomes `<Text render={<h2 />}>`.
|
|
505
|
+
- `variant` is removed. `variant="body2"` becomes `textStyle="body-sm"`, which has line height 1.5 where `body2` had 1.43, so a line is 21px instead of 20px. `body1` was the default and needs no replacement. The other variants (`h1` to `h6`, `subtitle1`, `subtitle2`, `caption`, `button`) had no styles of their own in the Lea theme and rendered as body text: pick a `textStyle` for them.
|
|
506
|
+
- `sx` is removed. Space text with `Stack` and its `gap`, or use `className` or `style`.
|
|
507
|
+
- `color` takes a palette token by its path (`text.subtle`, `primary.base`, `status.error.base`) or `inherit`. MUI's own names (`primary`, `error`, `text.secondary`, `textSecondary`) and raw CSS colours are no longer accepted; pass a raw colour through `style`.
|
|
508
|
+
- `align` takes `start`, `center` or `end` instead of `left`, `center`, `right`, `justify` and `inherit`.
|
|
509
|
+
- `noWrap` and `gutterBottom` are removed.
|
|
510
|
+
- The element no longer carries `MuiTypography-*` class names.
|
|
511
|
+
|
|
512
|
+
`fontSize` still works and is still deprecated in favour of `textStyle`.
|
|
513
|
+
|
|
514
|
+
- 1d1f026: `Tooltip` no longer wraps MUI's `Tooltip`. It is built on Base UI's `Tooltip` and `Popover` and styled with a CSS Module from the design tokens, so it renders without `LeaProvider`. The bubble and the three built-in triggers look the same.
|
|
515
|
+
|
|
516
|
+
New: `openOn="hover" | "click"` chooses how it opens. Around `children` it defaults to `"hover"`: mouse hover and keyboard focus. The built-in trigger (`ariaLabel`, no children) defaults to `"click"`: click, tap, Enter or Space, and mouse hover as before; it stays open until dismissed, so it works on touch.
|
|
517
|
+
|
|
518
|
+
Breaking:
|
|
519
|
+
|
|
520
|
+
- `triggerSx` is replaced by `className` and `style`, which go on the built-in trigger button.
|
|
521
|
+
- The props passed through to MUI are removed: `arrow`, `slotProps`, `enterDelay`, `leaveDelay`, `open`, `onOpen`, `onClose`, `describeChild`, `id`, `disableHoverListener` and the rest. `title`, `placement`, `surfaceVariant`, `children`, `ariaLabel`, `triggerIcon` and `triggerVariant` are unchanged.
|
|
522
|
+
- Around a child, a text `title` no longer becomes the child's `aria-label`. The tooltip is now the child's description while it shows (`aria-describedby`), so an icon-only child that got its name from `title` needs its own `aria-label`.
|
|
523
|
+
- The bubble of the built-in trigger is a `dialog` named by the button instead of a `tooltip`. Focus moves into it when it is opened by click or keyboard, and Escape or Tab closes it and puts focus back on the button. Tests that look for `getByRole("tooltip")` after a click need `getByRole("dialog")`.
|
|
524
|
+
- A tooltip that opens on hover no longer opens on a long press on touch. Use `openOn="click"` for text people need on touch.
|
|
525
|
+
- The markup no longer carries `MuiTooltip-*` class names.
|
|
526
|
+
|
|
527
|
+
The focus ring of the built-in trigger is the library's dark ring instead of a purple one.
|
|
528
|
+
|
|
529
|
+
### Minor Changes
|
|
530
|
+
|
|
531
|
+
- 679b741: Add `AmountSlider`, for an amount that is chosen by dragging a slider or by typing it, such as the loan amount on the first page of an application. It shows a `label`, the amount in an editable field, the slider, and `min` and `max` under each end of the track.
|
|
532
|
+
|
|
533
|
+
The field and the slider share one value: moving the slider rewrites the amount, and typing an amount moves the thumb. A typed amount is kept as typed, also between two steps. One outside `min` and `max` is brought back into range when the field loses focus, and an emptied field goes back to the last amount.
|
|
534
|
+
|
|
535
|
+
The `label` is a real label for the amount field and also names the slider, `helperText` describes both, and `error` marks both invalid. `format` and `locale` decide how the amount, `min` and `max` are written. It is built on Base UI and styled with a CSS Module, so it renders without `LeaProvider`.
|
|
536
|
+
|
|
537
|
+
- dfc1ef0: `AppHeader` takes a `logo`, shown in place of the Lea Bank logo, and a `className` for the `header` element.
|
|
538
|
+
|
|
539
|
+
```tsx
|
|
540
|
+
<AppHeader logo={<img src="/partner-logo.svg" alt="Partner" width={100} />} />
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
- 1d1f026: Added `SkipLink`, a link for keyboard users to jump past the header to the main content: `<SkipLink href="#main">Hopp til hovedinnhold</SkipLink>`. It is hidden until it receives focus, looks like a neutral `Button`, and sits at the top left of the page. Place it first in the page.
|
|
544
|
+
|
|
545
|
+
The component existed in the source but was never exported, was always visible and removed its own focus outline.
|
|
546
|
+
|
|
547
|
+
- 679b741: Add numbered spacing tokens, so a step no longer has to be multiplied out with `calc()`. `--lea-spacing-2` is two 8px steps, the same as `spacing(2)`, `<Stack gap={2}>` and `p-2` in the Tailwind theme.
|
|
548
|
+
|
|
549
|
+
| Token | Value |
|
|
550
|
+
| ------------------- | ---------------- |
|
|
551
|
+
| `--lea-spacing-0-5` | `0.25rem` (4px) |
|
|
552
|
+
| `--lea-spacing-1` | `0.5rem` (8px) |
|
|
553
|
+
| `--lea-spacing-1-5` | `0.75rem` (12px) |
|
|
554
|
+
| `--lea-spacing-2` | `1rem` (16px) |
|
|
555
|
+
| `--lea-spacing-2-5` | `1.25rem` (20px) |
|
|
556
|
+
| `--lea-spacing-3` | `1.5rem` (24px) |
|
|
557
|
+
| `--lea-spacing-4` | `2rem` (32px) |
|
|
558
|
+
| `--lea-spacing-5` | `2.5rem` (40px) |
|
|
559
|
+
| `--lea-spacing-6` | `3rem` (48px) |
|
|
560
|
+
| `--lea-spacing-8` | `4rem` (64px) |
|
|
561
|
+
|
|
562
|
+
A half step writes the point as a hyphen, because a point is not valid in a custom property name. `--lea-spacing` is unchanged and is still the way to reach a value off the scale: `calc(var(--lea-spacing) * 7)`.
|
|
563
|
+
|
|
564
|
+
- 3b123bb: Warning is amber. `status.warning` was the brand orange, 12 degrees of hue from the red of `status.error`, and the two tinted fills (`#FFDFD7` and `#FCDCDC`) could hardly be told apart. Error is unchanged.
|
|
565
|
+
|
|
566
|
+
| Token | Before | After |
|
|
567
|
+
| ----------------------- | --------- | --------- |
|
|
568
|
+
| `status.warning.base` | `#FE653E` | `#F7A800` |
|
|
569
|
+
| `status.warning.subtle` | `#FFDFD7` | `#FFEFC7` |
|
|
570
|
+
|
|
571
|
+
- New scale `amber`, 50 to 950: `colors.amber[400]`, `var(--lea-color-amber-400)`, Tailwind `bg-amber-400`.
|
|
572
|
+
- `Alert` and `GlobalAlert` with `severity="warning"` and `Chip` with `color="warning"` are amber. The filled warning alert has dark text (`text.base`, 9.6:1), because white on amber is 2.0:1. The warning `Chip` takes its text from `amber-800` when filled and `amber-700` when outlined.
|
|
573
|
+
- `orange` is still a scale and still a brand colour. `BrandDivider` and the confetti of `CheckAnimation` look the same: they read the `blue` and `orange` scales now, not `status.info` and `status.warning`.
|
|
574
|
+
|
|
575
|
+
In an app:
|
|
576
|
+
|
|
577
|
+
- Anything that reads `status.warning` (`var(--lea-palette-status-warning-base)`, `bg-status-warning-subtle`) turns amber by itself. Text placed on `status.warning.base` should be `text.base`, not white.
|
|
578
|
+
- A warning drawn straight from the orange scale (`var(--lea-color-orange-400)`, `bg-orange-100`) stays orange. Move it to `status.warning`.
|
|
579
|
+
- Amber is too light for text or a thin line on white (`amber-400` is 2.0:1). Use `amber-700` (5.9:1).
|
|
580
|
+
|
|
581
|
+
- 079a525: `Button`, `Alert`, `Dialog`, `Drawer`, `Accordion`, `Slider`, `AmountSlider` and `LinearFormStepper` take their text from the text styles and the type scale. Most look exactly as before. Three sizes move onto the scale:
|
|
582
|
+
|
|
583
|
+
| Text | Before | After |
|
|
584
|
+
| ------------------------- | ------ | ----- |
|
|
585
|
+
| `AmountSlider` label | 24px | 26px |
|
|
586
|
+
| `AmountSlider` amount | 40px | 41px |
|
|
587
|
+
| `LinearFormStepper` title | 24px | 26px |
|
|
588
|
+
|
|
589
|
+
Deprecate the older font sizes: the `FontSizeToken` type, `--lea-font-size-*`, the Tailwind classes `text-xs` to `text-6xl`, and the `fontSize` prop on `Text`. They are not on the type scale. They still work, and are removed in a later major. Use a text style instead: `--lea-text-heading-lg-*`, `text-heading-lg` or `<Text textStyle="heading-lg">`. The Type page in Storybook lists the nearest replacement for each size.
|
|
590
|
+
|
|
591
|
+
Add the colour token `bg.overlay` (`--lea-palette-bg-overlay`, `bg-bg-overlay`): the see-through layer behind a dialog or drawer, which `Dialog` and `Drawer` now use. Its value is the one they had.
|
|
592
|
+
|
|
593
|
+
Add Storybook pages for the tokens under Docs → Tokens: Colour, Type, Spacing, Radius and shadow, and Motion.
|
|
594
|
+
|
|
595
|
+
- 679b741: Add text styles: size, weight, line height and letter spacing as one token, named `{role}-{size}` after what the text does rather than the element it sits in. `heading-lg` can be an `h1` on one page and an `h3` on the next, so the element still comes from the page hierarchy.
|
|
596
|
+
|
|
597
|
+
```tsx
|
|
598
|
+
<Text render={<h2 />} textStyle="heading-lg">
|
|
599
|
+
Mine lån
|
|
600
|
+
</Text>
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
```css
|
|
604
|
+
.Title {
|
|
605
|
+
font-size: var(--lea-text-heading-lg-font-size);
|
|
606
|
+
font-weight: var(--lea-text-heading-lg-font-weight);
|
|
607
|
+
line-height: var(--lea-text-heading-lg-line-height);
|
|
608
|
+
letter-spacing: var(--lea-text-heading-lg-letter-spacing);
|
|
609
|
+
}
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
The Tailwind theme has one utility per style: `text-heading-lg` sets all four.
|
|
613
|
+
|
|
614
|
+
| Role | Sizes | Weight | Line height |
|
|
615
|
+
| --------- | ---------------------------------- | -------- | ----------- |
|
|
616
|
+
| `display` | `sm` 52, `md` 66 | semibold | 1 |
|
|
617
|
+
| `heading` | `xs` 16, `sm` 20, `md` 26 | semibold | 1.4 |
|
|
618
|
+
| `heading` | `lg` 32, `xl` 41 | semibold | 1.25 |
|
|
619
|
+
| `body` | `xs` 13, `sm` 14, `md` 16, `lg` 18 | regular | 1.5 |
|
|
620
|
+
| `label` | `sm` 13, `md` 14, `lg` 16 | medium | 1.25 |
|
|
621
|
+
|
|
622
|
+
The sizes sit on a modular scale, 16px × 1.125 per step, rounded to a whole pixel. Two new token groups carry it: `--lea-font-step-{n}` for steps -2 to 12 (a step below body text is written `--lea-font-step-minus-1`), and `--lea-line-height-none`, `-tight`, `-snug` and `-normal`.
|
|
623
|
+
|
|
624
|
+
Nothing existing changes. The `fontSize` and `fontWeight` props on `Text`, `--lea-font-size-*` and the components keep their current sizes until each is moved to a text style.
|
|
625
|
+
|
|
626
|
+
### Patch Changes
|
|
627
|
+
|
|
628
|
+
- dfc1ef0: Three fixes in `DevPanel`:
|
|
629
|
+
|
|
630
|
+
- **The side payload (`placement="side"`) can be used.** A click inside it, on "Copy JSON" or on the close button, closed it before the click arrived, so nothing was copied. Focus did not move into it when it opened, and Tab did nothing while it was open. Now a click inside stays inside, focus moves to its close button, Tab stays within it, and Escape or a click outside closes it and returns focus to the toggle, as documented.
|
|
631
|
+
- **A step button is named by what it shows.** Its accessible name was an `aria-label`, `Steg 6: Skulder, gjeldende`, which did not contain the visible text as written and dropped a label that was not a string. The name is now the visible number and label with the status added for assistive tech: `Steg 6 Skulder (gjeldende)`. A test that finds a step by its full name needs the new one; matching on the label (`{ name: /Skulder/ }`) works as before.
|
|
632
|
+
- **The focus ring shows on the dark payload panels.** It was drawn in the colour of the panel, on the copy and close buttons and on "Copy JSON". It is white there now.
|
|
633
|
+
|
|
634
|
+
- dfc1ef0: The asterisk of a required `RadioGroup` or `RadioCardGroup`, and of a `NumberInput` with its label outside the field, follows the label by a thin space, as on `Input`, `Select` and `Checkbox`. It sat about 12px from the text. When the label wraps, the asterisk stays with its last word.
|
|
635
|
+
- 31da3b6: `Input`, `Autocomplete`, `EmailInput` and `PhoneNumberInput` are now named by their label. The wrapper around the field carried the same `id` as the input, and a `<label for>` resolves to the first element with that id, so the label pointed at the wrapper: screen readers announced the fields without a name, and clicking the label did not focus the input. The wrapper no longer has an id.
|
|
636
|
+
|
|
637
|
+
Three smaller fixes in the same area:
|
|
638
|
+
|
|
639
|
+
- The helper text link (`aria-describedby`) is now in the server-rendered markup. It used to be added after hydration.
|
|
640
|
+
- With a `tooltip`, the label of a radio group no longer includes the info button's name, and clicking the label text no longer opens the tooltip.
|
|
641
|
+
- The label of a radio card group without a tooltip sits 12px above the cards, like every other group label. It sat directly on them.
|
|
642
|
+
|
|
643
|
+
- dfc1ef0: The `value/max` label of a `ProgressCircle` stays inside the ring. It was always 14px, so it ran into the ring in a small circle (`3/4` at `size={32}`) and with many digits (`20/20` at the default 48px). It is now set smaller where 14px does not fit, and is unchanged everywhere else. Below about 32px the label is too small to read: use `showValue={false}` there.
|
|
644
|
+
- 6aa14f4: `@storybook/addon-a11y` is no longer installed with the library. It was listed as a runtime dependency, but only this repo's own Storybook uses it.
|
|
645
|
+
- dfc1ef0: `Tabs` no longer pushes the page wider than the screen. The row of tabs was the least width the control could have wherever the layout sized it by its content, such as a flex row or a centred column, so three tabs with icons made a 390px page scroll sideways. The control is now as narrow as its container, and the tabs scroll inside their track, as they already did in a plain block.
|
|
646
|
+
|
|
3
647
|
## 7.3.0
|
|
4
648
|
|
|
5
649
|
### Minor Changes
|