@joanroucoux/cairn-ui 0.6.5 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +105 -0
- package/fesm2022/joanroucoux-cairn-ui.mjs +1305 -180
- package/fesm2022/joanroucoux-cairn-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/motion.css +83 -0
- package/styles/theme.css +6 -0
- package/styles/tokens.css +5 -0
- package/types/joanroucoux-cairn-ui.d.ts +237 -15
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.7.1
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `uiFlipItem`: marks an item of the nearest `uiFlipList` at any depth. Once one item is marked, the list follows
|
|
8
|
+
its marked items instead of its direct children, so a page made of groups slides as one: put `uiFlipList` on the
|
|
9
|
+
element around every group (the `table`, the page column) and `uiFlipItem` on each group heading and row. A
|
|
10
|
+
removal then slides the rows below in the same group and the groups below. An item inside another item (a row
|
|
11
|
+
inside a card) moves by its own share, the card carrying the rest. A destroyed item stays followed until it
|
|
12
|
+
leaves the page (its `animate.leave` fade), and a live item that is briefly out of the list is followed again
|
|
13
|
+
once back.
|
|
14
|
+
- `ui-dialog` `busy` input (boolean, default `false`): while an action runs, Escape, a click on the backdrop and
|
|
15
|
+
a drag of the sheet leave the dialog open, the cross is disabled and the dialog carries `aria-busy`. The native
|
|
16
|
+
`cancel` and the Escape `keydown` are prevented, and a close the platform makes without asking reopens the
|
|
17
|
+
dialog. The owner disables its own buttons and still closes it through `open`.
|
|
18
|
+
- `ui-tab-bar` publishes its height as `--tab-bar-height` (`calc(52px + env(safe-area-inset-bottom))`) on the
|
|
19
|
+
root element while it is on the page. Use it instead of restating 52px for anything that must clear the bar,
|
|
20
|
+
e.g. `pb-(--tab-bar-height)`.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- `uiFlipList` slides only when an item is added or removed. A change inside an item (a row that grows, content
|
|
25
|
+
toggled in a cell) re-measures without sliding, as MOUVEMENT.md asks of layout changes. A list without
|
|
26
|
+
`uiFlipItem` keeps following its direct children, as in 0.7.0.
|
|
27
|
+
- `ui-toaster` and `ui-action-bar` sit above `var(--tab-bar-height)`, falling back to the former
|
|
28
|
+
`calc(52px + env(safe-area-inset-bottom))` when no tab bar is on the page.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- `uiFlipList` measures every item from the top of the list itself, no longer from the nearest positioned
|
|
33
|
+
ancestor: a list that moved on the page without resizing (the holdings list when the detail panel lays out)
|
|
34
|
+
slides by the gap only, not from a stale place. Containers no longer need `position: relative` for it; drop
|
|
35
|
+
the `relative` added as a workaround. Positions leave out the translate of any animation running inside the
|
|
36
|
+
list (a slide in progress, an enter fade-up). A move interrupted by the next change restarts from where the
|
|
37
|
+
item is displayed.
|
|
38
|
+
- `uiHighlight` and `animate.enter` on the same element both play: the highlight starts on the next frame and,
|
|
39
|
+
while the element or a painted cell still runs a finite animation of its own, once that animation has
|
|
40
|
+
finished, waiting no longer than `--duration-base`. Angular kept the 1400 ms highlight as the longest
|
|
41
|
+
animation and dropped the enter class after one frame. The enter fade no longer needs to sit on an inner
|
|
42
|
+
element.
|
|
43
|
+
- `uiStaleLink`: the link keeps its 12/17 caption size but now extends its hit area with a `::before` pseudo-element to 44 px high (40 px with `pointer: fine`), centred on the text, so it meets the touch target of the handoff. Its `::after` chevron is unchanged.
|
|
44
|
+
|
|
45
|
+
## 0.7.0
|
|
46
|
+
|
|
47
|
+
Motion release: every animation of the Cairn V3 handoff (MOUVEMENT.md), on shared tokens, with a reduced-motion path.
|
|
48
|
+
|
|
49
|
+
### Upgrade note
|
|
50
|
+
|
|
51
|
+
Import the new motion stylesheet after `theme.css`:
|
|
52
|
+
|
|
53
|
+
```css
|
|
54
|
+
@import '@joanroucoux/cairn-ui/styles/tokens.css';
|
|
55
|
+
@import '@joanroucoux/cairn-ui/styles/theme.css';
|
|
56
|
+
@import '@joanroucoux/cairn-ui/styles/motion.css';
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The skeleton pulse keyframes moved there: without `motion.css`, `ui-skeleton` no longer pulses and the spinners no
|
|
60
|
+
longer turn.
|
|
61
|
+
|
|
62
|
+
### Added
|
|
63
|
+
|
|
64
|
+
- Motion tokens in `tokens.css`: `--duration-spin`, `--duration-highlight`, `--toast-duration`, with slower or shorter
|
|
65
|
+
values under `prefers-reduced-motion`. `theme.css` sets the default transition curve and duration and adds the
|
|
66
|
+
`animate-cairn-spin` and `animate-cairn-pulse` utilities.
|
|
67
|
+
- `styles/motion.css`: the `cairn-spin`, `cairn-pulse`, `cairn-fade-in` and `cairn-fade-out` keyframes, the
|
|
68
|
+
`ui-enter-fade`, `ui-enter-fade-up`, `ui-enter-panel` and `ui-leave-fade` classes for Angular's `animate.enter` and
|
|
69
|
+
`animate.leave`, the root view transition and the theme-switch rule.
|
|
70
|
+
- `injectReducedMotion()`: a signal that follows `prefers-reduced-motion` live.
|
|
71
|
+
- `delayedState()`: a skeleton appears only after 150 ms and then stays at least 400 ms; `ui-async` uses it.
|
|
72
|
+
- `ui-toaster` and the `UiToasts` service: one confirmation message at a time, paused on hover and focus.
|
|
73
|
+
- `uiHighlight`: scrolls a changed element into view, holds the `--soft` fill, then fades it back.
|
|
74
|
+
- `uiFlipList`: slides the remaining children of a list into place when one is inserted or removed.
|
|
75
|
+
- `uiStaleLink`: a caption link in the stale tone, with an optional chevron.
|
|
76
|
+
- `ui-empty`: a centred empty state with a title, a hint and an action slot.
|
|
77
|
+
- `ui-row`: `busy` (spinner, `aria-busy`, clicks swallowed) and `unavailable` (half opacity, no hover or press,
|
|
78
|
+
`aria-disabled`, clicks swallowed).
|
|
79
|
+
- `ui-alert`: `fadeIn` (default on). Turn it off for an alert that is part of the page as it opens, such as an
|
|
80
|
+
error state after a load: it then shows without motion.
|
|
81
|
+
- `ui-action-bar` publishes its height as `--action-bar-height` on the root element while it is on the page.
|
|
82
|
+
- `ui-dialog`: a `closed` output that fires after the exit with its reason (`DialogCloseReason`), drag down to dismiss
|
|
83
|
+
the sheet, and a plain fade under reduced motion.
|
|
84
|
+
|
|
85
|
+
### Changed
|
|
86
|
+
|
|
87
|
+
- Press, hover and focus sweep: rows, tabs, nav items, segmented options, buttons, avatars, back links, the async
|
|
88
|
+
retry, the dialog cross, chips, table rows and legend rows scale on press over `--duration-press` (their transition
|
|
89
|
+
lists name `scale`, the property Tailwind's `scale-*` utilities write) and fill on hover over `--duration-fast`. The
|
|
90
|
+
focus ring never transitions: menu items, the field reveal button and the switch only fade their colours.
|
|
91
|
+
- `ui-button` loading spinner is centred over the label, which keeps its width and its accessible name. The projected
|
|
92
|
+
content is now wrapped in a `<span class="contents">`: a consumer selector such as `[ui-button] > svg` or a
|
|
93
|
+
`:first-child` on the button content no longer matches; target `[ui-button] > span > svg` instead.
|
|
94
|
+
- `ui-menu` scales in from `--enter-scale` and back on desktop; the sheet fades without sliding under reduced motion.
|
|
95
|
+
- `ui-field` errors and `ui-alert` fade in, `ui-alert` fades out.
|
|
96
|
+
- `ui-toaster` sits 8px above `ui-action-bar` when one is on the page below 64rem, instead of covering its actions.
|
|
97
|
+
- `uiHighlight` honours `scroll-margin-bottom` as well as `scroll-margin-top`: a row under the tab bar or the action
|
|
98
|
+
bar counts as off screen and is scrolled out.
|
|
99
|
+
- Under reduced motion the root view transition is off (no cross-fade on a page change, in the app or across
|
|
100
|
+
documents).
|
|
101
|
+
- `ui-line-chart` morphs from the drawn shape to the new range over `--duration-base`, never on mount, and fades the
|
|
102
|
+
start label and dashed line around it. A new array with the same values, reduced motion or a `0ms` token shows the
|
|
103
|
+
new series at once.
|
|
104
|
+
- `ui-donut` scales the hovered slice and dims the others instead of thickening the stroke; under reduced motion
|
|
105
|
+
it only dims.
|