magic-pill 9.4.0-next.2 → 9.4.0-next.4

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 (51) hide show
  1. package/CHANGELOG.md +38 -2
  2. package/README.md +25 -17
  3. package/dist/MagicPill/MagicPill.d.mts +16 -2
  4. package/dist/MagicPill/MagicPill.d.ts +16 -2
  5. package/dist/MagicPill/MagicPill.js +12 -3
  6. package/dist/MagicPill/MagicPill.mjs +12 -3
  7. package/dist/Pill/Pill.js +1 -0
  8. package/dist/Pill/Pill.mjs +1 -0
  9. package/dist/Pill/goo.js +110 -35
  10. package/dist/Pill/goo.mjs +110 -36
  11. package/dist/Pill/modal.js +3 -1
  12. package/dist/Pill/modal.mjs +3 -1
  13. package/dist/Pill/morph.js +64 -10
  14. package/dist/Pill/morph.mjs +64 -11
  15. package/dist/Pill/zone.js +1 -2
  16. package/dist/Pill/zone.mjs +1 -2
  17. package/dist/PillForm/PillForm.js +6 -1
  18. package/dist/PillForm/PillForm.mjs +7 -2
  19. package/dist/PillForm/dates.js +14 -3
  20. package/dist/PillForm/dates.mjs +14 -3
  21. package/dist/PillForm/room.js +46 -0
  22. package/dist/PillForm/room.mjs +46 -0
  23. package/dist/PillNavbar/PillNavbar.js +3 -1
  24. package/dist/PillNavbar/PillNavbar.mjs +4 -2
  25. package/dist/PillNavbar/room.js +99 -24
  26. package/dist/PillNavbar/room.mjs +98 -25
  27. package/dist/PillNotification/PillNotification.js +2 -4
  28. package/dist/PillNotification/PillNotification.mjs +2 -4
  29. package/dist/PillNotification/RowsBody.js +77 -0
  30. package/dist/PillNotification/RowsBody.mjs +77 -0
  31. package/dist/forms.css +14 -0
  32. package/dist/satellites/Actions.js +181 -6
  33. package/dist/satellites/Actions.mjs +182 -7
  34. package/dist/satellites/Orbitals.js +218 -50
  35. package/dist/satellites/Orbitals.mjs +220 -52
  36. package/dist/satellites/Satellites.js +495 -107
  37. package/dist/satellites/Satellites.mjs +498 -111
  38. package/dist/satellites/handoff.js +36 -0
  39. package/dist/satellites/handoff.mjs +34 -0
  40. package/dist/satellites/layout.js +69 -3
  41. package/dist/satellites/layout.mjs +69 -4
  42. package/dist/satellites/measure.js +22 -0
  43. package/dist/satellites/measure.mjs +22 -1
  44. package/dist/satellites/orbits.js +49 -2
  45. package/dist/satellites/orbits.mjs +47 -3
  46. package/dist/satellites/types.d.mts +15 -1
  47. package/dist/satellites/types.d.ts +15 -1
  48. package/dist/satellites.d.mts +2 -2
  49. package/dist/satellites.d.ts +2 -2
  50. package/dist/styles.css +103 -15
  51. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,19 +3,45 @@
3
3
  ## [Unreleased]
4
4
 
5
5
  ### Added
6
+ - `--mp-focus-ring`: the keyboard focus ring's colour on the pill's actions, electrons and orbitals
7
+ - `--mp-radius`: the pill's corners (half the one-line pill's height by default). Smaller gives a rounded rectangle at any size, a sidebar or a toolbox included; a pill closed to a circle, an electron and its orbitals stay round
8
+ - `--mp-rows-actions-align`: where a notification in rows (`layout="rows"`) puts its actions under the message: `start`, `center` (the default) or `end`, following the text direction
6
9
  - **Beta:** the Electron, in an optional entry, `magic-pill/satellites`: a small round pill that splits out of the host to keep a background activity in reach. `pill().electron()`, `updateElectron()` and `endElectron()`; on `<MagicPill>`, `satellites`, `pathname`, `electronSide`, `electronLine`, `keepElectronsOut`, `electronEnding` and `arrange`. It's tucked into the pill on the page that started it and while a notification has the pill, a tap goes back to that page, and the pill and its electrons stay centred as a group
7
10
  - **Beta:** an electron's orbitals, its quick actions fanned out around it (`orbitals` on `pill().electron()`): opened by a long press (slide to one and release to run it), hovering with a mouse, or a tap (`orbitalsOpenOn`, with a first orbital going back), and the keyboard as a menu. On an arc away from the screen's edge, clear of the pill and the other electrons; when they don't all fit, a wheel that turns with the mouse wheel, a drag along it or the arrow keys, and stays open until a tap away. `orbitalLabels`, `orbitalsStayOpen`, `backLabel`, and the tokens `--mp-orbital-size`, `--mp-orbital-distance`, `--mp-orbital-spread`, `--mp-orbital-stagger`, `--mp-hover-delay` and `--mp-long-press`
8
11
  - **Beta:** the page's actions, the design's wide atom: `usePillActions()` (from `magic-pill/satellites`) and `pill().setActions()` set one or more actions for the current page, next to the pill. `actionsStyle` (`"detached"`, a pill of their own that comes out of the host with the goo, or `"inside"`, after a divider), `actionsSide` (`"start"`, `"end"` or `"beside"`), `actionsOrientation` (`"auto"`, turning across when room runs out, `"horizontal"`, `"vertical"`) and `actionsLabel` on `<MagicPill>`
9
12
  - **Beta:** `actionsWheel` on `<MagicPill>`: short of room, the page's actions show what fits and the others turn in, like the orbitals' wheel (a mouse wheel, a drag, a swipe or the arrow keys, each one snapping into place, the ends that hide some fading out), instead of turning across; in the pill, the cut starts right at the divider. And `nearestToPill` (`"actions"`, the default, or `"electrons"`): which are nearer the pill on a side they share
13
+ - **Beta:** `avoidPills` on `<MagicPill>` (`true` by default): the satellites keep clear of the other pills on the screen. Over one (on a phone, the docs' sidebar), the page's actions go to the other side of the pill, then turn across, then (with `actionsWheel`) show fewer; when none of these is clear, the layout that covers them least
14
+ - **Beta:** `orbitalsMore` on `<MagicPill>`: how a wheel of orbitals says there are more past its ends. `"peek"` (the default, as before: the next one peeks out faintly where there's room), `"dots"` (small dots by the end orbital, one per orbital past it, up to three) or `"count"` (a small pill with how many, which turns the wheel a page that way when pressed)
10
15
  - `labels` on `<PillNavbar>`: which labels show at rest. `"auto"` (the default) shows the current page's while the pill has room for it and folds it when it doesn't, `"current"` always shows it, `"closed"` shows none. An electron stays in the pill's row when the navbar can fold to make room, and only goes above it when it still doesn't fit
11
16
  - `PillProgress`: a progress ring around a value or an icon, in the text colour (`--mp-progress-size`, `--mp-progress-width`)
12
- - The split's tokens, for a sidebar's flag: `--mp-duration-split` and `--mp-duration-join` (the enter and exit durations by default), `--mp-ease-split` (`bouncy`, the default, `pop`, `smooth` or any CSS easing), `--mp-goo` (`12`; `0` for no neck) and `--mp-electron-start` (`1`)
17
+ - The split's tokens, for a sidebar's flag: `--mp-duration-split` and `--mp-duration-join` (the enter and exit durations by default), `--mp-ease-split` (`bouncy`, the default, `pop`, `smooth` or any CSS easing), `--mp-goo` (`12`; `0` for no neck) and `--mp-electron-start` (`0.15`, a droplet)
13
18
 
14
19
  ### Fixed
20
+ - An electron coming out next to a navbar that folds its label for it (`labels="auto"`, on a phone) stays in the pill's row again, the label folding as the electron grows out of it: the pill used to jump shorter before the electron was there (its room capped it before the label had folded), and since the satellites plan from the pill open or folded, an electron that would fit beside the folded pill went above it instead
21
+ - Switching the page's actions into the pill (`actionsStyle`) no longer shows them twice: their own pill goes back into the host as when they hide, then they open in the pill. Out of it, they fold away in the pill before their own pill comes out of it, from the pill's edge (it showed at full size at once). In the pill, they open out of nothing as they come and fold away before they go, the pill following its content: it used to jump to its new length at once, and the navbar takes their room back as they fold away
22
+ - An electron's orbitals follow it while they're out: when it moves with the pill (on a phone, Safari's toolbar folding as the page scrolls; the group re-centring), they stayed where they had opened, apart from it, and went back in towards where it had been. They move with it at every frame, on the same arc, their opening or closing going on
23
+ - Placement changes run lighter: as the pill closed and opened, a navbar that folds by itself and the satellites laid out up to three hidden copies of it at every frame, for answers that don't change while it morphs (125 copies per change in the demo, now 27). The navbar checks again only when something it depends on changed (the pill's markup, the screen's size, the page's root, fonts loading); the satellites measure the host's open size once per placement and screen size on its way
24
+ - Turning a phone sideways, the satellites come out of the host in one go: they came out as the host slid to its new spot, followed it one way, then went back the other way to theirs (the electron 642 → 491 → 675 px). Out of a host that slides against their way out, they now wait for it to get there, then come out of its edge
25
+ - The satellites re-plan sooner once the window stops changing size: they waited 200 ms after its last change, a pause you could feel once you let go; now 120 ms, still after a drag (one change per frame)
26
+ - A sidebar's flag comes out with lighter goo: its overlay covered the whole sidebar (as tall as the screen) and its filter worked on four times that, at every frame, slow on a phone. It now covers the flag and the part of the sidebar a neck can reach (about nine times fewer pixels filtered), and every goo filter works on its overlay, not twice its width and height
27
+ - A wheel of orbitals turns from anywhere on its track on a phone: a finger had to land on an orbital (44 px) to turn it, and a swipe starting between two of them closed them, or scrolled the page. A finger now turns it from anywhere on the arc, between the orbitals and a little outside them, and neither the track nor the orbitals scroll the page; a tap on the track, off the orbitals, still closes them. With a mouse, nothing changes
28
+ - A form in the pill itself keeps its field usable on a phone: its submit button's label took the room, and the field was squeezed to a few letters (an e-mail subscription, 60 px on a 393 px screen, nothing at all in a narrow card). Short of room, the button folds its label to its icon, still its name; the field gets it back (184 px). Not while the pill is still growing (out of a circle)
29
+ - A notification in rows (`layout="rows"`) is as wide as what it shows: a wrapped message kept its box as wide as a message can be (`--mp-message-width`), so the pill looked too wide for it, with a gap after its lines. The message fits its longest line, measured on a copy of the pill as it ends up. The actions under it are centred in the pill, instead of lining up with the text; `--mp-rows-actions-align` (`start`, `center` or `end`) lines them up elsewhere
30
+ - The calendar's and `PillDate`'s labels start with a capital in languages that write days and months in lowercase: "Jeudi 24 décembre 2026", "Décembre 2026", "Déc." (was all lowercase in French)
31
+ - A modal no longer shows a focus ring on its first button as it opens after a click or a tap ("Delete", in a question about deleting): the dialog itself takes the focus, as a panel does, and the first Tab reaches the button, with its ring
32
+ - The page's actions in the pill, with their wheel, leave the navbar its room first: they show what fits next to it with its label open (or, when not even one does, next to it folded), the rest in their wheel. A navbar now folds its label when what's beside it in the pill leaves it no room, instead of being squeezed
33
+ - An electron, its orbitals and the page's actions take the tokens set in the host's `style`: the adaptive glass, the light following the pointer, the readability veil and the rest applied to the main pill only (they're pills of their own beside it, so they didn't inherit them)
34
+ - A navbar with `labels="auto"` and satellites could fold and unfold its label every frame, the satellites moving back and forth with it until a phone's page crashed (two electrons and four actions with a wheel, next to the docs' sidebar): they now plan from the host open, if they fit beside it so, or folded, never from the length it has as the label moves
35
+ - Another list of page actions resizes their pill where it is, sliding with the host as the group re-centres: it used to close to a circle, open with the new list, then close again to follow the host. A column of actions next to a bottom pill grows up from the pill's level, instead of jumping up and growing down; actions that turn for a new list close to a circle from where they were, not off to one side over the host
36
+ - Scrolling on a phone no longer sends the electrons back into the pill and out again: Safari's toolbar shrinking moves the pill and every satellite's row with it, which was taken for a new spot
37
+ - An electron that ends as a notification comes (an upload that ends with "Your file is uploaded") goes back into the pill's centre with the others as the pill closes, instead of shrinking on its own next to it as if it popped
38
+ - An electron and the page's actions come out from behind the pill and go back in behind it: they were drawn over it, so an electron's face (its ring, its time) showed on top of the pill as it joined. Their orbitals stay under them, and the goo's necks under them all. An electron's face fades once as it goes back in, instead of fading, showing again and fading a second time
39
+ - An electron shows its keyboard focus ring in apps with their own global `:focus-visible` rule: the app's ring was drawn outside it, in its colour, and the pill hid it. The rings on the pill's actions, electrons and orbitals now stay the library's, and `--mp-focus-ring` sets their colour
40
+ - A pill closing its panel goes to its size in one motion when its navbar folds its labels for the room it has: it shrank, then jumped as the labels folded. The navbar decides as the pill's presence changes, and the pill measures where it's going as it ends up (on a copy with no transitions); if its content still changes size meanwhile (a label opening under the pointer), it gets there smoothly instead of jumping
15
41
  - Opening an electron's orbitals no longer stutters: each orbital's goo ran an SVG filter over the whole screen; it now only covers the two pills it joins (60 frames a second where it fell to about 30, with frames of up to 180 ms)
16
42
  - Two electrons given an empty `id` are two electrons, instead of one flickering between them
17
43
  - The page's actions grow away from the pill when an action's label opens on hover, instead of over it
18
- - When the host changes placement or turns, its electrons and actions tuck in while it travels and come out at its new place; one that changes side or row (or actions that turn) goes back into the pill and out again, instead of sliding across it or jumping
44
+ - When the host changes placement or turns, its electrons and actions tuck in while it travels and come out at its new place; one that changes side or row goes back into the pill and out again, instead of sliding across it or jumping; the page's actions turning (across or back) close to a circle at the pill's level, turn, and open again the other way, as the pill does when it changes placement
19
45
  - An electron's orbitals bulge out of its centre one after the other and fold back into it, quicker than they came and in the other order, as the design drew them. Next to another electron, two of them used to slide sideways into each other above it, merge and vanish; the electron's shadow flickered as they opened, and on the glass themes they switched colour at the end. On their way back, they're out of reach (a pointer over them can't hold them); when their electron ends from one of them, they're in at once; on their way out, one under the pointer doesn't light up
20
46
  - With the orbitals open (they stay open after an action), a press on the electron slides onto one at once, instead of waiting for a long press again: it only worked once until a tap away
21
47
  - For a notification, the electrons and the actions go into the pill with it, once their content has faded, instead of staying out while it closes and then chasing it; back from the notification, they come out once the pill has grown back, not out of a half-grown pill
@@ -26,8 +52,18 @@
26
52
  - An electron and the page's actions come out of the pill and go back into it as the orbitals do, drawing themselves the whole way: on the glass themes they no longer switch colour at the end; changing sides, they no longer flicker between going in and coming out. For a notification, they go into the pill's centre as it closes to a circle
27
53
  - The actions go into the pill and come out of it with the goo when `actionsStyle` changes, instead of disappearing; turned while they were in, they come out turned, instead of at their old shape first. Two satellites passing each other (`nearestToPill` changed) melt together as they meet
28
54
  - An electron's orbitals keep clear of the page's actions, as they do of the other electrons
55
+ - With `avoidPills`, an electron's orbitals also keep clear of the other pills on the screen, as the electrons and the actions do: on a phone, the timer's orbitals no longer open over the docs' sidebar
56
+ - When the group gathers again (an electron coming or going, the actions changing), the satellites no longer slide across whole: the page's actions close to a circle where they are, move, and open at their new spot; an electron goes down to a droplet, moves, and grows back (a nudge of a few pixels still slides)
57
+ - An electron and the page's actions come out of the pill as a droplet, as the design drew it: drawn out small on the goo's neck (following the pill as it slides to make room), growing to their size as they come free, then showing their content; going back in, the same played backwards. A sidebar's flag does the same, out of the sidebar's edge. `--mp-electron-start` is now `0.15` (a droplet); `--mp-ease-split`, when set, still picks the curve
58
+ - An electron's orbitals come out from behind it and go back in behind it, instead of over what it shows
59
+ - When the screen changes (a phone turned), satellites with a new side or row (keeping clear of another pill, or for lack of room) go there through the pill once it has settled, instead of jumping there as it resized; and a phone turned back upright no longer leaves the pill squeezed by the room its satellites had taken in landscape
60
+ - With electrons or actions out, a pill changing placement keeps the room and the spot it has with them through the trip, at its new placement: it opens there at its size, and they come out with nothing else moving. It used to slide to the centre as it closed, open wide, then shrink and slide as they came out (and, at a -start or -end placement, travel without its shift and jump by it at the end)
61
+ - A navbar's current label no longer folds while the pill is a circle on its way to another placement: the pill opened at its new place with the label folded, and grew by it with a jump once open
62
+ - An electron (or the page's actions) going back into the pill as the group gathers again goes to the pill's end where it now is, instead of where it was when it set off: it ended inside the pill, over its last item, with a doubled shadow at its end
63
+ - With electrons or actions out, a pill changing placement goes there through the circle in one movement, from and to any placement: it used to jump across the screen as it closed (to or from the top and bottom, the start and end placements, between the bottom and a side), laid out for its new placement while still at its old one. Next to another pill of the same side, it no longer flashes aside as it sets off
29
64
 
30
65
  ### Changed
66
+ - **Beta:** `actionsWheel` is on by default for the page's actions in the pill (`actionsStyle="inside"`): short of room, they show what fits next to the navbar and turn the rest in their wheel; `false` shows them all. Still off by default for a pill of their own
31
67
  - A navbar whose current page's label has no room folds it (`labels="auto"`, the new default), instead of the pill cutting its last items off. `labels="current"` keeps the old behaviour
32
68
  - A sidebar's flag comes out of the sidebar's edge as a droplet, with goo: a neck forms between them, stretches and snaps, on a bouncy curve, and it goes back into the sidebar the same way. It no longer pops in at its spot with a short bridge, nor scales in and out. With reduced motion it still fades. On the glass themes, its blur waits until it's clear of the sidebar
33
69
 
package/README.md CHANGED
@@ -30,7 +30,7 @@ On top of it come ready-made **templates** (a notification, a navbar, a form pan
30
30
  - [X] Accessible: screen reader announcements, keyboard focus pauses the countdown, focus handling for panels and modals
31
31
  - [X] Works in any React 18+ app, including React Server Components (Next.js App Router), with any router
32
32
  - [X] Styles you can override without `!important`, design tokens, no fonts loaded behind your back
33
- - [X] Tiny: the quick start adds about **19 kB gzipped** to your app (15.5 kB of JavaScript + 3.7 kB of CSS, minified by your bundler), checked in CI. Unused parts are tree-shaken.
33
+ - [X] Tiny: the quick start adds about **20 kB gzipped** to your app (16 kB of JavaScript + 4.4 kB of CSS, minified by your bundler), checked in CI. Unused parts are tree-shaken.
34
34
  - [X] Written in TypeScript, zero runtime dependencies
35
35
 
36
36
  ## Installation
@@ -119,7 +119,7 @@ const id = pill().notify({
119
119
  | `panel` | `{ title?, titleAction?, content, footer?, trigger?, closeLabel?, closeExpanded? }` | A "Learn more" action that grows the pill into a panel. `trigger` defaults to `{ icon: <PlusIcon />, label: "Learn more" }` and takes `expanded` too, `closeLabel` to `"Close"`: like the other labels, it shows on hover and focus, or all the time with `closeExpanded`. `titleAction` and `footer`: see [the panel](#the-primitive). |
120
120
  | `variant` | `"neutral"` · `"success"` · `"danger"` · any string | Defaults to the host's variant. |
121
121
  | `duration` | `number` (ms) | Defaults to the host's (5000). `Infinity` keeps it until dismissed. |
122
- | `layout` | `"pill"` · `"rows"` · `"card"` · `"flag"` | Defaults to the host's `notificationLayout`. `"rows"` puts the actions under the message when they need the room: when the message wraps, or with an action and a panel. Under it, they line up with the message. `"card"`, in a sidebar: a column of the sidebar's width (at least `--mp-card-width`, `12.5rem`), the icon on top, the actions full width with their labels; a horizontal host shows it in one row. `"flag"`, in a `left` or `right` sidebar with a base layer: a pill of its own out of the sidebar's edge, while the sidebar stays (see below). |
122
+ | `layout` | `"pill"` · `"rows"` · `"card"` · `"flag"` | Defaults to the host's `notificationLayout`. `"rows"` puts the actions under the message when they need the room: when the message wraps, or with an action and a panel. Under it, they're centred in the pill (`--mp-rows-actions-align` lines them up at the `start` or the `end` instead), and the pill is as wide as the message's longest line. `"card"`, in a sidebar: a column of the sidebar's width (at least `--mp-card-width`, `12.5rem`), the icon on top, the actions full width with their labels; a horizontal host shows it in one row. `"flag"`, in a `left` or `right` sidebar with a base layer: a pill of its own out of the sidebar's edge, while the sidebar stays (see below). |
123
123
  | `at` | `string` | `"flag"` only: the `href` of the navbar item it's about, to come out next to it (matched as the navbar matches the current page). Default: the middle of the sidebar. |
124
124
  | `id` | `string` | Notifying again with the same id updates the notification in place. |
125
125
  | `announce` | `string` · `false` | What screen readers hear. Defaults to the message's text. |
@@ -233,7 +233,7 @@ export function AppPill() {
233
233
  </MagicPill>
234
234
  ```
235
235
 
236
- - **The active link** shows its label and gets `aria-current="page"`. `labels` says which labels show at rest: `"auto"` (the default) shows the current page's while the pill has room for it, and folds it when it doesn't (next to an electron on a phone, or on a very narrow screen, where the pill used to cut its last items off); `"current"` always shows it; `"closed"` shows none. An item pointed at or focused shows its label in every case. A folded navbar has `data-folded`.
236
+ - **The active link** shows its label and gets `aria-current="page"`. `labels` says which labels show at rest: `"auto"` (the default) shows the current page's while the pill has room for it, and folds it when it doesn't (next to an electron on a phone, or on a very narrow screen, where the pill used to cut its last items off); `"current"` always shows it; `"closed"` shows none. An item pointed at or focused shows its label in every case. A folded navbar has `data-folded`. Too long for its pill even then (many items on a narrow phone, a sidebar on a short screen), it scrolls inside it, and where the browser has scroll-driven animations, the ends that hide some fade out.
237
237
  - **Without `pathname`**, the navbar reads `window.location.pathname` after mounting and on back/forward navigation. That misses client-side navigations, so pass `pathname` when you use a client-side router.
238
238
  - **On a narrow screen**, when there's no room for the current page's label and the one you point at (or focus), the current one folds meanwhile. A label that still has no room ends with an ellipsis.
239
239
  - **`aria-label`** defaults to `"Main"`.
@@ -267,7 +267,7 @@ pill("assistant").notify({ icon: <HelpIcon />, message: "Need a hand?", duration
267
267
  ```
268
268
  A sidebar's notifications are pills like the others: it turns horizontal for them while it's a circle, and back once they're gone. Between its base layer and a notification it goes through the circle, even with `swap="always"`, unless the notification is in `rows` (it slides, turning as it goes) or a `card`: a card stays in the sidebar's column, and slides like any other content.
269
269
 
270
- **A flag** (`notificationLayout="flag"`, `left`/`right` sidebars) leaves the sidebar where it is, usable: the notification comes out of its edge as a pill of its own (`[data-layout="flag"]`), next to the section it's about (`at`), and goes back into it. Pointing at it or focusing it pauses it; the next one slides in it, and it moves to its own section. Its panel opens beside the sidebar, in the middle of the screen. It comes out of the sidebar's edge as a droplet (a neck forms between them, stretches and snaps) and goes back into it the same way: `--mp-duration-split` and `--mp-duration-join` time it, `--mp-ease-split` picks its curve (`bouncy`, the default, `pop`, `smooth` or any CSS easing), `--mp-goo` how sticky it is (`0`: no neck), `--mp-electron-start` the size it starts at.
270
+ **A flag** (`notificationLayout="flag"`, `left`/`right` sidebars) leaves the sidebar where it is, usable: the notification comes out of its edge as a pill of its own (`[data-layout="flag"]`), next to the section it's about (`at`), and goes back into it. Pointing at it or focusing it pauses it; the next one slides in it, and it moves to its own section. Its panel opens beside the sidebar, in the middle of the screen. It comes out of the sidebar's edge as a droplet, as an electron does (drawn out small on a neck, growing to its size as it comes free, then showing its content), and goes back into it the same way played backwards: `--mp-duration-split` and `--mp-duration-join` time it, `--mp-ease-split` can pick another curve (`bouncy`, `pop`, `smooth` or any CSS easing), `--mp-goo` how sticky it is (`0`: no neck), `--mp-electron-start` the size it starts at.
271
271
 
272
272
  ## The Electron (beta)
273
273
  A small round pill that splits out of the host to keep a background activity in reach while the person goes elsewhere in the app: a timer, a call, an upload. It's tucked into the pill on the page that started it, and comes out as a droplet (with the goo, like a sidebar's flag) anywhere else; a tap goes back to that page. **Beta:** it ships in `9.4.0-next` releases, and its API may still change.
@@ -318,10 +318,11 @@ pill().endElectron(id); // it goes back into the pill
318
318
  | `electronEnding` | `"join"` | `"join"` or `"pop"`. |
319
319
  | `arrange` | `"gather"` | `"gather"`: the pill and its electrons are centred as a group (or at the edge, for a `-start` or `-end` placement). `"spread"`: the pill stays where it is, the electrons go to the screen's edge (under the thumb on a tablet). |
320
320
  | `orbitalsOpenOn` | `"press-hover"` | What opens an electron's orbitals: a long press, or hovering it with a mouse; `"press"`, a long press only; `"tap"`, a tap, with a first orbital going back. |
321
- | `orbitalLabels` | `true` | The orbital under the finger, the pointer or the focus shows its label next to it. |
321
+ | `orbitalLabels` | `true` | The orbital under the finger, the pointer or the focus shows its label next to it, in a small pill of the electron's look (its theme and colours). |
322
322
  | `orbitalsStayOpen` | `true` | They stay open after one of them runs (Pause becomes Resume in place). |
323
+ | `orbitalsMore` | `"peek"` | How a wheel of orbitals says there are more past its ends: the next one peeks out faintly where there's room; `"dots"`, small dots by the end orbital instead, one per orbital past it (up to three); `"count"`, a small pill there with how many, which turns the wheel a page that way when pressed. |
323
324
 
324
- **Orbitals** are an electron's quick actions, small round pills that bulge out of it with the goo:
325
+ **Orbitals** are an electron's quick actions, small round pills that bud out of its centre with the goo, one after the other, and fold back into it (quicker, the other way round):
325
326
 
326
327
  ```ts
327
328
  pill().electron({
@@ -335,13 +336,14 @@ pill().electron({
335
336
  });
336
337
  ```
337
338
 
338
- - A long press opens them. Keep pressing, slide to one (it's picked by its angle from the electron) and release to run it; released on none, they stay open until a tap away. With a mouse, hovering opens them too, and they close once the pointer leaves them.
339
- - They fan out on an arc away from the screen's edge, clear of the pill, the other electrons and the screen's edges, moving out a little if they must. **When they don't all fit, they're a wheel:** the arc shows what fits and turns to show the others, with the mouse wheel, a drag along it, or the arrow keys (it brings the focused one into view). One past an end fades out (it peeks out faintly where its spot is clear). A wheel stays open until a tap away or Escape. `--mp-orbital-size` (an action's size), `--mp-orbital-distance` (`0.875rem`), `--mp-orbital-spread` (`auto`, or an angle such as `120deg`), `--mp-orbital-stagger` (`30ms`), `--mp-hover-delay` (`300ms`) and `--mp-long-press` (`450ms`) tune them.
339
+ - A long press opens them. Keep pressing, slide to one (it's picked by its angle from the electron) and release to run it; released on none, they stay open until a tap away. While they're open, a press slides onto one at once. With a mouse, hovering opens them too, and they close once the pointer leaves them; on their way back in, they're out of reach.
340
+ - They fan out on an arc away from the screen's edge, clear of the pill, the other electrons, the page's actions and the screen's edges, moving out a little if they must. **When they don't all fit, they're a wheel:** the arc shows what fits and turns to show the others, with the mouse wheel, a drag along it, or the arrow keys (it brings the focused one into view). On a touchscreen, a finger turns it from anywhere on its track, between the orbitals and a little outside them too, and the page doesn't scroll under it; a tap on the track, off the orbitals, closes them. One past an end fades out (it peeks out faintly where its spot is clear). A wheel stays open until a tap away or Escape. `--mp-orbital-size` (an action's size), `--mp-orbital-distance` (`0.875rem`), `--mp-orbital-spread` (`auto`, or an angle such as `120deg`), `--mp-orbital-stagger` (`30ms`), `--mp-hover-delay` (`300ms`) and `--mp-long-press` (`450ms`) tune them.
340
341
  - The keyboard opens them with the arrow pointing away from the edge, Shift+F10 or the context-menu key, and goes round them with the arrows, Home and End; Escape closes them and gives the focus back. An ARIA menu named after the electron.
341
342
 
342
343
  **How it behaves:**
343
- - **Short of room** (the pill and its electrons wider than the screen), a navbar folds its labels first (`labels="auto"`, its default); if they still don't fit, the last ones go beside the pill, one row towards the page, like the ladder.
344
- - It splits and joins with the goo, on the split's tokens (`--mp-duration-split`, `--mp-duration-join`, `--mp-ease-split`, `--mp-goo`, `--mp-electron-start`, see [Styling](#styling)); `--mp-electron-gap` (`--mp-gap` by default) keeps it apart from the pill. With reduced motion, it fades.
344
+ - **Short of room** (the pill and its electrons wider than the screen), a navbar folds its labels first (`labels="auto"`, its default); if they still don't fit, the last ones go beside the pill, one row towards the page, like the ladder. There they make a row of their own, clear of each other and on the screen, wrapping into a further row as a last resort.
345
+ - It comes out of the pill as a droplet, drawn out small on the goo's neck, growing to its size as it comes free, then showing its content, and goes back into it the same way played backwards, drawing itself the whole way (its glass too), on the split's tokens (`--mp-duration-split`, `--mp-duration-join`, `--mp-ease-split`, `--mp-goo`, `--mp-electron-start`, see [Styling](#styling)); `--mp-electron-gap` (`--mp-gap` by default) keeps it apart from the pill. With reduced motion, it fades.
346
+ - While a notification has the pill (or it travels to another placement), it goes into the pill's centre as the pill closes to a circle, and comes out once the pill has grown back. Changing sides or rows, it goes back in, the pill waiting until it is, then comes out at its new spot as the pill moves. Two satellites passing each other melt together as they meet.
345
347
  - It's a link (or a button, or an image for neither) named after its `label` and `valueText`, with its own focus ring.
346
348
 
347
349
  ### The page's actions (beta)
@@ -366,12 +368,15 @@ export function InboxPage() {
366
368
 
367
369
  | Host prop | Default | Notes |
368
370
  |---|---|---|
369
- | `actionsStyle` | `"detached"` | `"detached"`: a pill of their own, which comes out of the host with the goo and goes back into it when the page has none (or while a notification has the pill). `"inside"`: in the pill itself, after a divider. |
371
+ | `actionsStyle` | `"detached"` | `"detached"`: a pill of their own, which comes out of the host with the goo and goes back into it when the page has none (or while a notification has the pill). `"inside"`: in the pill itself, after a divider, opening out of nothing as they come and folding away before they go. Changing it, their own pill goes back into the host before they open in it; the other way, they fold away in the pill before their own pill comes out of it. |
370
372
  | `actionsSide` | `"start"` | `"start"` or `"end"` (following the text direction: under the thumb you want), or `"beside"` (one row towards the page). |
371
- | `actionsOrientation` | `"auto"` | `"auto"`: like the pill, turning across it when they'd leave the pill too little room (a column next to a bottom pill), and back once they're beside it. `"horizontal"` or `"vertical"`, always. |
373
+ | `actionsOrientation` | `"auto"` | `"auto"`: like the pill, turning across it when they'd leave the pill too little room (a column next to a bottom pill), in its row or in the row beside it; decided again once a resize settles. `"horizontal"` or `"vertical"`, always. Turning, they close to a circle where they are and open again the other way, as the pill does when it changes placement. |
374
+ | `actionsWheel` | `true` in the pill, `false` in a pill of their own | Short of room, they show what fits (two at least in the pill's row) and the others turn in, like the orbitals' wheel: a mouse wheel, a drag, a swipe or the arrow keys, each one snapping into place, the ends that hide some fading out. Instead of turning across. In the pill (`"inside"`), the cut starts at the divider, and the navbar keeps its room first: `false` there shows them all. |
375
+ | `nearestToPill` | `"actions"` | On a side they share, the page's actions are nearer the pill, or `"electrons"` are. |
376
+ | `avoidPills` | `true` | The satellites keep clear of the other pills on the screen (a sidebar, a help pill): over one, the actions go to the other side, then turn across, then (with `actionsWheel`) show fewer; the layout that covers them least when none is clear. An electron's orbitals turn away from them too (a wheel shows what fits clear of them). `false`: they go where the props say. |
372
377
  | `actionsLabel` | `"Page actions"` | Their accessible name. |
373
378
 
374
- Short of room, the actions turn across first (`"auto"`), then the last electrons, the actions and the first electron go beside the pill, in that order.
379
+ Short of room, the actions turn across first (`"auto"`, or show what fits with `actionsWheel`), then the farthest ones go beside the pill: the last electrons, then the first electron and the actions, the nearer of them last. They slide with the group as it changes (gathered or spread, another one coming or going).
375
380
 
376
381
  ## The primitive
377
382
  Everything above is built from `<Pill>` and its parts, and you can use them directly. A `<Pill>` you write yourself isn't connected to `pill()`: you control it with props.
@@ -537,7 +542,7 @@ async function send(data: FormData) {
537
542
  | `disabled` / `busy` | `false` | Disables every field (`busy`: while something is being sent; `onSend` does it for you) |
538
543
 
539
544
  - **Validation** is the browser's own (`required`, `type`, `pattern`, `min`…), in the reader's language: on an attempt to submit, which focuses the first wrong field, or on leaving a field that was changed and is wrong. A message goes as soon as the value is right.
540
- - **In the pill itself**, a `<PillForm>` is a row, with fields as tall as the actions: one field, one action.
545
+ - **In the pill itself**, a `<PillForm>` is a row, with fields as tall as the actions: one field, one action. Short of room (a phone), its `expanded` submit button folds its label to its icon (still its name, read out), so the field keeps room to type in.
541
546
  - **On phones**, the pill stays above the keyboard while one of its fields has the focus.
542
547
  - **Escape** closes an open list, not the panel.
543
548
  - **Notifications wait** while a form of the base layer is open, so what's being typed isn't taken away. The base layer unmounts while a notification shows: keep what must last in your own state.
@@ -653,16 +658,19 @@ An `<img>` keeps its file's colours: `currentColor` only reaches inline SVGs and
653
658
  | `--mp-text-size` / `--mp-title-size` | fluid, about 1rem / 1.5–2rem |
654
659
  | `--mp-padding` / `--mp-gap` / `--mp-action-size` | `0.875rem` / `1rem` / `2.75rem` |
655
660
  | `--mp-max-width` / `--mp-message-width` / `--mp-panel-width` | `48rem` / `24rem` / `32rem` |
661
+ | `--mp-rows-actions-align` | `center`: where a notification in `rows` puts its actions on their own line under the message: `start`, `center` or `end` (following the text direction) |
656
662
  | `--mp-card-width` | `12.5rem`: a sidebar's notification card, at the least (it keeps the sidebar's width if that's wider) |
663
+ | `--mp-radius` | Half the one-line pill's height: the pill's corners. Smaller makes a rounded rectangle at any size (a sidebar, a toolbox); a pill closed to a circle, an electron and its orbitals stay round |
657
664
  | `--mp-radius-panel` / `--mp-shadow` | `2.5rem` / a soft drop shadow |
665
+ | `--mp-focus-ring` | The keyboard focus ring's colour on the pill's actions, an electron and its orbitals: the text's colour by default. Drawn by the stylesheet even over an app's own global `:focus-visible` rule, which would draw it outside the item, where the pill hides it |
658
666
  | `--mp-offset` / `--mp-z-index` | `1.5rem` from the viewport edges (plus safe areas) / `50` |
659
667
  | `--mp-backdrop` / `--mp-backdrop-blur` | the overlay's backdrop: `rgb(20 20 20 / 0.4)` / no blur |
660
668
  | `--mp-duration-enter` / `--mp-duration-change` / `--mp-duration-exit` | `500ms` / `250ms` / `300ms` |
661
669
  | `--mp-duration-fade` | `150ms`: the content fades out before the pill shrinks, and in once it has grown |
662
670
  | `--mp-duration-split` / `--mp-duration-join` | `--mp-duration-enter` / `--mp-duration-exit`: a sidebar's flag coming out of the sidebar and going back |
663
- | `--mp-ease-split` | `bouncy`: the split's curve, `bouncy`, `pop`, `smooth` or any CSS easing (the join is always smooth) |
671
+ | `--mp-ease-split` | The split's curve. Unset: a flag, an electron and the page's actions follow the droplet's (drawn out slowly, then growing), orbitals bounce (`bouncy`). Or `bouncy`, `pop`, `smooth` or any CSS easing, for all of them. The join follows the droplet's backwards (orbitals: smooth) |
664
672
  | `--mp-goo` | `12`: how sticky the split is, the blur behind the neck in px. `0`: a plain split, no neck |
665
- | `--mp-electron-start` | `1`: the size a flag or an electron starts at as it comes out. `1`: full size, hidden behind the pill's edge. Lower: it starts small and grows on its way out |
673
+ | `--mp-electron-start` | `0.15`: the size a flag, an electron or the page's actions start at as they come out of the pill's edge, a droplet drawn out of it, growing to its size, then showing its content (and the same played backwards going back in). `1`: full size, hidden behind the pill's edge |
666
674
  | `--mp-electron-gap` | `--mp-gap`: between the pill and its electrons (beta) |
667
675
  | `--mp-progress-size` / `--mp-progress-width` | `3.375rem` / `3.5`: `PillProgress`'s ring, and its stroke |
668
676
  | `--mp-scale-origin` | `center`: where the pill pops in from and scales out to (e.g. `bottom` to come out of the edge) |
@@ -672,7 +680,7 @@ The pill fits small screens: sizes are in `rem`, fixed pills stay inside the vie
672
680
 
673
681
  **Sidebars:** a `left` or `right` pill lines its items up along the screen edge, and on the right-hand side its labels open towards the middle of the screen, so the icons stay in line (mirrored in right-to-left pages). Set `--mp-align` to change the alignment.
674
682
 
675
- **Shape and motion:** the pill animates its real size whenever its presence changes (a script measures it; with `unstyled` or reduced motion it doesn't). Its corners are half the one-line pill's height, so a taller pill, such as a wrapped message, is a rounded rectangle; a panel's corners are `--mp-radius-panel`.
683
+ **Shape and motion:** the pill animates its real size whenever its presence changes (a script measures it; with `unstyled` or reduced motion it doesn't). Its corners are half the one-line pill's height (`--mp-radius` makes them smaller), so a taller pill, such as a wrapped message, is a rounded rectangle; a panel's corners are `--mp-radius-panel`.
676
684
 
677
685
  ### Themes
678
686
  A theme is the pill's material. `glass` (frosted glass) and `liquid` (clearer, thicker Liquid Glass) come in a second stylesheet, so plain pills don't load them. Import it once, before or after `styles.css`:
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
2
2
  import { LinkComponent, PillProps } from "../Pill/types.mjs";
3
3
  import { NotificationLayout, PillNotificationClassNames } from "../PillNotification/PillNotification.mjs";
4
4
  import { SwapMode } from "./choreography.mjs";
5
- import { ActionsOrientation, ActionsSide, ActionsStyle, ElectronEnding, ElectronLine, ElectronSide, NearestToPill, OrbitalsOpenOn, PillSatellites, SatelliteArrangement } from "../satellites/types.mjs";
5
+ import { ActionsOrientation, ActionsSide, ActionsStyle, ElectronEnding, ElectronLine, ElectronSide, NearestToPill, OrbitalsMore, OrbitalsOpenOn, PillSatellites, SatelliteArrangement } from "../satellites/types.mjs";
6
6
  export interface MagicPillProps extends Omit<PillProps, "presence" | "defaultPresence" | "onPresenceChange" | "children" | "scene" | "sceneChange"> {
7
7
  /** Default "main". Two hosts with the same name warn in development. */
8
8
  name?: string;
@@ -68,6 +68,13 @@ export interface MagicPillProps extends Omit<PillProps, "presence" | "defaultPre
68
68
  orbitalsOpenOn?: OrbitalsOpenOn;
69
69
  /** The label of the orbital under the finger, the pointer or the focus shows next to it. Default true (beta). */
70
70
  orbitalLabels?: boolean;
71
+ /**
72
+ * How a wheel of orbitals says there are more past its ends: the next one
73
+ * peeking out faintly where there's room (`"peek"`, default), small dots by
74
+ * the end orbital, one per orbital past it, up to three (`"dots"`), or a
75
+ * count that turns the wheel a page when pressed (`"count"`) (beta).
76
+ */
77
+ orbitalsMore?: OrbitalsMore;
71
78
  /** Orbitals stay open after one of them runs. Default true (beta). */
72
79
  orbitalsStayOpen?: boolean;
73
80
  /**
@@ -82,11 +89,18 @@ export interface MagicPillProps extends Omit<PillProps, "presence" | "defaultPre
82
89
  /**
83
90
  * Short of room, the page's actions show what fits and turn the rest in a
84
91
  * wheel (a mouse wheel, a drag, the arrow keys), instead of turning across.
85
- * Default false (beta).
92
+ * Default: true in the pill (`actionsStyle="inside"`: the navbar keeps its
93
+ * room), false in a pill of their own (beta).
86
94
  */
87
95
  actionsWheel?: boolean;
88
96
  /** On a side they share, the page's actions are nearer the pill (default), or the electrons (beta). */
89
97
  nearestToPill?: NearestToPill;
98
+ /**
99
+ * The satellites keep clear of the other pills on the screen (a sidebar, a
100
+ * help pill): over one, the page's actions go to the other side, then turn
101
+ * across, then (with `actionsWheel`) show fewer. Default true (beta).
102
+ */
103
+ avoidPills?: boolean;
90
104
  /** The page's actions' accessible name. Default "Page actions" (beta). */
91
105
  actionsLabel?: string;
92
106
  }
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
2
2
  import { LinkComponent, PillProps } from "../Pill/types.js";
3
3
  import { NotificationLayout, PillNotificationClassNames } from "../PillNotification/PillNotification.js";
4
4
  import { SwapMode } from "./choreography.js";
5
- import { ActionsOrientation, ActionsSide, ActionsStyle, ElectronEnding, ElectronLine, ElectronSide, NearestToPill, OrbitalsOpenOn, PillSatellites, SatelliteArrangement } from "../satellites/types.js";
5
+ import { ActionsOrientation, ActionsSide, ActionsStyle, ElectronEnding, ElectronLine, ElectronSide, NearestToPill, OrbitalsMore, OrbitalsOpenOn, PillSatellites, SatelliteArrangement } from "../satellites/types.js";
6
6
  export interface MagicPillProps extends Omit<PillProps, "presence" | "defaultPresence" | "onPresenceChange" | "children" | "scene" | "sceneChange"> {
7
7
  /** Default "main". Two hosts with the same name warn in development. */
8
8
  name?: string;
@@ -68,6 +68,13 @@ export interface MagicPillProps extends Omit<PillProps, "presence" | "defaultPre
68
68
  orbitalsOpenOn?: OrbitalsOpenOn;
69
69
  /** The label of the orbital under the finger, the pointer or the focus shows next to it. Default true (beta). */
70
70
  orbitalLabels?: boolean;
71
+ /**
72
+ * How a wheel of orbitals says there are more past its ends: the next one
73
+ * peeking out faintly where there's room (`"peek"`, default), small dots by
74
+ * the end orbital, one per orbital past it, up to three (`"dots"`), or a
75
+ * count that turns the wheel a page when pressed (`"count"`) (beta).
76
+ */
77
+ orbitalsMore?: OrbitalsMore;
71
78
  /** Orbitals stay open after one of them runs. Default true (beta). */
72
79
  orbitalsStayOpen?: boolean;
73
80
  /**
@@ -82,11 +89,18 @@ export interface MagicPillProps extends Omit<PillProps, "presence" | "defaultPre
82
89
  /**
83
90
  * Short of room, the page's actions show what fits and turn the rest in a
84
91
  * wheel (a mouse wheel, a drag, the arrow keys), instead of turning across.
85
- * Default false (beta).
92
+ * Default: true in the pill (`actionsStyle="inside"`: the navbar keeps its
93
+ * room), false in a pill of their own (beta).
86
94
  */
87
95
  actionsWheel?: boolean;
88
96
  /** On a side they share, the page's actions are nearer the pill (default), or the electrons (beta). */
89
97
  nearestToPill?: NearestToPill;
98
+ /**
99
+ * The satellites keep clear of the other pills on the screen (a sidebar, a
100
+ * help pill): over one, the page's actions go to the other side, then turn
101
+ * across, then (with `actionsWheel`) show fewer. Default true (beta).
102
+ */
103
+ avoidPills?: boolean;
90
104
  /** The page's actions' accessible name. Default "Page actions" (beta). */
91
105
  actionsLabel?: string;
92
106
  }
@@ -83,7 +83,7 @@ const notificationIn = ({ scene, presence }) => scene.kind === "notification" &&
83
83
  * The batteries-included pill: a <Pill> with a base layer, a queue of
84
84
  * notifications fed by pill(name), and a live region that announces them.
85
85
  */
86
- const MagicPill = (0, react.forwardRef)(function MagicPill({ name = "main", children, scene, duration = DEFAULT_DURATION, idle = "hidden", idleIcon, swap = "queue", notificationLayout = "pill", linkComponent, classNames, pathname, satellites, electronSide = "after", electronLine = "along", keepElectronsOut = false, electronEnding = "join", arrange = "gather", orbitalsOpenOn = "press-hover", orbitalLabels = true, orbitalsStayOpen = true, actionsStyle = "detached", actionsSide = "start", actionsOrientation = "auto", actionsWheel = false, nearestToPill = "actions", actionsLabel = "Page actions", placement = "bottom", orientation, moveThroughCircle, variant, onPointerEnter, onPointerLeave, onFocus, onBlur, ...rest }, forwardedRef) {
86
+ const MagicPill = (0, react.forwardRef)(function MagicPill({ name = "main", children, scene, duration = DEFAULT_DURATION, idle = "hidden", idleIcon, swap = "queue", notificationLayout = "pill", linkComponent, classNames, pathname, satellites, electronSide = "after", electronLine = "along", keepElectronsOut = false, electronEnding = "join", arrange = "gather", orbitalsOpenOn = "press-hover", orbitalLabels = true, orbitalsMore = "peek", orbitalsStayOpen = true, actionsStyle = "detached", actionsSide = "start", actionsOrientation = "auto", actionsWheel: actionsWheelProp, nearestToPill = "actions", avoidPills = true, actionsLabel = "Page actions", placement = "bottom", orientation, moveThroughCircle, variant, onPointerEnter, onPointerLeave, onFocus, onBlur, ...rest }, forwardedRef) {
87
87
  const store = require_store.getStore(name);
88
88
  const { current } = require_usePillQueue.usePillQueue(name);
89
89
  const rootRef = (0, react.useRef)(null);
@@ -263,6 +263,7 @@ const MagicPill = (0, react.forwardRef)(function MagicPill({ name = "main", chil
263
263
  linkComponent,
264
264
  variant,
265
265
  theme: rest.theme,
266
+ tokens: hostTokens(rest.style),
266
267
  electronSide,
267
268
  electronLine,
268
269
  keepElectronsOut,
@@ -270,15 +271,17 @@ const MagicPill = (0, react.forwardRef)(function MagicPill({ name = "main", chil
270
271
  arrange,
271
272
  orbitalsOpenOn,
272
273
  orbitalLabels,
274
+ orbitalsMore,
273
275
  orbitalsStayOpen,
274
276
  actionsStyle,
275
277
  actionsSide,
276
278
  actionsOrientation,
277
- actionsWheel,
279
+ actionsWheel: actionsWheelProp ?? actionsStyle === "inside",
278
280
  nearestToPill,
281
+ avoidPills,
279
282
  actionsLabel
280
283
  } : void 0;
281
- const inside = satellites && satelliteHost && actionsStyle === "inside" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(satellites.Inside, { host: satelliteHost }) : null;
284
+ const inside = satellites && satelliteHost ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(satellites.Inside, { host: satelliteHost }) : null;
282
285
  const renderScene = (shownScene) => {
283
286
  switch (shownScene.kind) {
284
287
  case "base": return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [
@@ -378,5 +381,11 @@ const MagicPill = (0, react.forwardRef)(function MagicPill({ name = "main", chil
378
381
  })
379
382
  ] });
380
383
  });
384
+ /** The tokens (`--mp-*`) in a style, for the satellites: undefined when there are none. */
385
+ function hostTokens(style) {
386
+ if (!style) return void 0;
387
+ const entries = Object.entries(style).filter(([name]) => name.startsWith("--mp-"));
388
+ return entries.length > 0 ? Object.fromEntries(entries) : void 0;
389
+ }
381
390
 
382
391
  module.exports = MagicPill;
@@ -83,7 +83,7 @@ const notificationIn = ({ scene, presence }) => scene.kind === "notification" &&
83
83
  * The batteries-included pill: a <Pill> with a base layer, a queue of
84
84
  * notifications fed by pill(name), and a live region that announces them.
85
85
  */
86
- const MagicPill = forwardRef(function MagicPill({ name = "main", children, scene, duration = DEFAULT_DURATION, idle = "hidden", idleIcon, swap = "queue", notificationLayout = "pill", linkComponent, classNames, pathname, satellites, electronSide = "after", electronLine = "along", keepElectronsOut = false, electronEnding = "join", arrange = "gather", orbitalsOpenOn = "press-hover", orbitalLabels = true, orbitalsStayOpen = true, actionsStyle = "detached", actionsSide = "start", actionsOrientation = "auto", actionsWheel = false, nearestToPill = "actions", actionsLabel = "Page actions", placement = "bottom", orientation, moveThroughCircle, variant, onPointerEnter, onPointerLeave, onFocus, onBlur, ...rest }, forwardedRef) {
86
+ const MagicPill = forwardRef(function MagicPill({ name = "main", children, scene, duration = DEFAULT_DURATION, idle = "hidden", idleIcon, swap = "queue", notificationLayout = "pill", linkComponent, classNames, pathname, satellites, electronSide = "after", electronLine = "along", keepElectronsOut = false, electronEnding = "join", arrange = "gather", orbitalsOpenOn = "press-hover", orbitalLabels = true, orbitalsMore = "peek", orbitalsStayOpen = true, actionsStyle = "detached", actionsSide = "start", actionsOrientation = "auto", actionsWheel: actionsWheelProp, nearestToPill = "actions", avoidPills = true, actionsLabel = "Page actions", placement = "bottom", orientation, moveThroughCircle, variant, onPointerEnter, onPointerLeave, onFocus, onBlur, ...rest }, forwardedRef) {
87
87
  const store = getStore(name);
88
88
  const { current } = usePillQueue(name);
89
89
  const rootRef = useRef(null);
@@ -263,6 +263,7 @@ const MagicPill = forwardRef(function MagicPill({ name = "main", children, scene
263
263
  linkComponent,
264
264
  variant,
265
265
  theme: rest.theme,
266
+ tokens: hostTokens(rest.style),
266
267
  electronSide,
267
268
  electronLine,
268
269
  keepElectronsOut,
@@ -270,15 +271,17 @@ const MagicPill = forwardRef(function MagicPill({ name = "main", children, scene
270
271
  arrange,
271
272
  orbitalsOpenOn,
272
273
  orbitalLabels,
274
+ orbitalsMore,
273
275
  orbitalsStayOpen,
274
276
  actionsStyle,
275
277
  actionsSide,
276
278
  actionsOrientation,
277
- actionsWheel,
279
+ actionsWheel: actionsWheelProp ?? actionsStyle === "inside",
278
280
  nearestToPill,
281
+ avoidPills,
279
282
  actionsLabel
280
283
  } : void 0;
281
- const inside = satellites && satelliteHost && actionsStyle === "inside" ? /* @__PURE__ */ jsx(satellites.Inside, { host: satelliteHost }) : null;
284
+ const inside = satellites && satelliteHost ? /* @__PURE__ */ jsx(satellites.Inside, { host: satelliteHost }) : null;
282
285
  const renderScene = (shownScene) => {
283
286
  switch (shownScene.kind) {
284
287
  case "base": return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -378,5 +381,11 @@ const MagicPill = forwardRef(function MagicPill({ name = "main", children, scene
378
381
  })
379
382
  ] });
380
383
  });
384
+ /** The tokens (`--mp-*`) in a style, for the satellites: undefined when there are none. */
385
+ function hostTokens(style) {
386
+ if (!style) return void 0;
387
+ const entries = Object.entries(style).filter(([name]) => name.startsWith("--mp-"));
388
+ return entries.length > 0 ? Object.fromEntries(entries) : void 0;
389
+ }
381
390
 
382
391
  export { MagicPill as default };
package/dist/Pill/Pill.js CHANGED
@@ -140,6 +140,7 @@ const Pill = (0, react.forwardRef)(function Pill({ presence: presenceProp, defau
140
140
  ...require_react.inertProps(!isVisible),
141
141
  onKeyDown: handleKeyDown,
142
142
  ...isOverlay && {
143
+ tabIndex: -1,
143
144
  onCancel: handleCancel,
144
145
  onClose: handleClose,
145
146
  ...closeOnBackdropClick && {
@@ -140,6 +140,7 @@ const Pill = forwardRef(function Pill({ presence: presenceProp, defaultPresence
140
140
  ...inertProps(!isVisible),
141
141
  onKeyDown: handleKeyDown,
142
142
  ...isOverlay && {
143
+ tabIndex: -1,
143
144
  onCancel: handleCancel,
144
145
  onClose: handleClose,
145
146
  ...closeOnBackdropClick && {