magic-pill 9.4.0-next.1 → 9.4.0-next.3

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 CHANGED
@@ -6,9 +6,36 @@
6
6
  - **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
7
  - **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
8
  - **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
+ - **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
10
+ - **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
11
+ - **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)
9
12
  - `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
10
13
  - `PillProgress`: a progress ring around a value or an icon, in the text colour (`--mp-progress-size`, `--mp-progress-width`)
11
- - 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`)
14
+ - 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)
15
+
16
+ ### Fixed
17
+ - 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)
18
+ - Two electrons given an empty `id` are two electrons, instead of one flickering between them
19
+ - The page's actions grow away from the pill when an action's label opens on hover, instead of over it
20
+ - 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
21
+ - 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
22
+ - 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
23
+ - 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
24
+ - Beside the pill, the actions and the electrons make a row of their own, clear of each other and kept on the screen (on a phone, four actions covered the second electron and could run off the screen); automatic actions turn across there when the row is too long, and a row that still doesn't fit wraps into a further one
25
+ - The actions slide with the group (gathered to spread, another satellite coming or going), instead of jumping; and whether they turn across is decided again once a resize settles, not only after a render
26
+ - An orbital's label is a small pill of the electron's look (its theme and colours), instead of always light on dark
27
+ - A navbar too long for its pill scrolls inside it, instead of its last items being cut off: a sidebar's, and a horizontal one once its labels have folded; where the browser has scroll-driven animations, the ends that hide some fade out
28
+ - 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
29
+ - 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
30
+ - An electron's orbitals keep clear of the page's actions, as they do of the other electrons
31
+ - 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)
32
+ - 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
33
+ - An electron's orbitals come out from behind it and go back in behind it, instead of over what it shows
34
+ - 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
35
+ - 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)
36
+ - 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
37
+ - 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
38
+ - 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
12
39
 
13
40
  ### Changed
14
41
  - 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
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
@@ -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). 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. Changing it, they go into the pill (or out of it) with the goo. |
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` | `false` | 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. |
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. `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.
@@ -660,9 +665,9 @@ An `<img>` keeps its file's colours: `currentColor` only reaches inline SVGs and
660
665
  | `--mp-duration-enter` / `--mp-duration-change` / `--mp-duration-exit` | `500ms` / `250ms` / `300ms` |
661
666
  | `--mp-duration-fade` | `150ms`: the content fades out before the pill shrinks, and in once it has grown |
662
667
  | `--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) |
668
+ | `--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
669
  | `--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 |
670
+ | `--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
671
  | `--mp-electron-gap` | `--mp-gap`: between the pill and its electrons (beta) |
667
672
  | `--mp-progress-size` / `--mp-progress-width` | `3.375rem` / `3.5`: `PillProgress`'s ring, and its stroke |
668
673
  | `--mp-scale-origin` | `center`: where the pill pops in from and scales out to (e.g. `bottom` to come out of the edge) |
@@ -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, 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
  /**
@@ -79,6 +86,20 @@ export interface MagicPillProps extends Omit<PillProps, "presence" | "defaultPre
79
86
  actionsSide?: ActionsSide;
80
87
  /** The page's actions run like the pill, turning across when room runs out (default), or horizontal, or vertical (beta). */
81
88
  actionsOrientation?: ActionsOrientation;
89
+ /**
90
+ * Short of room, the page's actions show what fits and turn the rest in a
91
+ * wheel (a mouse wheel, a drag, the arrow keys), instead of turning across.
92
+ * Default false (beta).
93
+ */
94
+ actionsWheel?: boolean;
95
+ /** On a side they share, the page's actions are nearer the pill (default), or the electrons (beta). */
96
+ nearestToPill?: NearestToPill;
97
+ /**
98
+ * The satellites keep clear of the other pills on the screen (a sidebar, a
99
+ * help pill): over one, the page's actions go to the other side, then turn
100
+ * across, then (with `actionsWheel`) show fewer. Default true (beta).
101
+ */
102
+ avoidPills?: boolean;
82
103
  /** The page's actions' accessible name. Default "Page actions" (beta). */
83
104
  actionsLabel?: string;
84
105
  }
@@ -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, 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
  /**
@@ -79,6 +86,20 @@ export interface MagicPillProps extends Omit<PillProps, "presence" | "defaultPre
79
86
  actionsSide?: ActionsSide;
80
87
  /** The page's actions run like the pill, turning across when room runs out (default), or horizontal, or vertical (beta). */
81
88
  actionsOrientation?: ActionsOrientation;
89
+ /**
90
+ * Short of room, the page's actions show what fits and turn the rest in a
91
+ * wheel (a mouse wheel, a drag, the arrow keys), instead of turning across.
92
+ * Default false (beta).
93
+ */
94
+ actionsWheel?: boolean;
95
+ /** On a side they share, the page's actions are nearer the pill (default), or the electrons (beta). */
96
+ nearestToPill?: NearestToPill;
97
+ /**
98
+ * The satellites keep clear of the other pills on the screen (a sidebar, a
99
+ * help pill): over one, the page's actions go to the other side, then turn
100
+ * across, then (with `actionsWheel`) show fewer. Default true (beta).
101
+ */
102
+ avoidPills?: boolean;
82
103
  /** The page's actions' accessible name. Default "Page actions" (beta). */
83
104
  actionsLabel?: string;
84
105
  }
@@ -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", 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 = false, 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);
@@ -270,10 +270,14 @@ const MagicPill = (0, react.forwardRef)(function MagicPill({ name = "main", chil
270
270
  arrange,
271
271
  orbitalsOpenOn,
272
272
  orbitalLabels,
273
+ orbitalsMore,
273
274
  orbitalsStayOpen,
274
275
  actionsStyle,
275
276
  actionsSide,
276
277
  actionsOrientation,
278
+ actionsWheel,
279
+ nearestToPill,
280
+ avoidPills,
277
281
  actionsLabel
278
282
  } : void 0;
279
283
  const inside = satellites && satelliteHost && actionsStyle === "inside" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(satellites.Inside, { host: satelliteHost }) : null;
@@ -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", 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 = false, 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);
@@ -270,10 +270,14 @@ const MagicPill = forwardRef(function MagicPill({ name = "main", children, scene
270
270
  arrange,
271
271
  orbitalsOpenOn,
272
272
  orbitalLabels,
273
+ orbitalsMore,
273
274
  orbitalsStayOpen,
274
275
  actionsStyle,
275
276
  actionsSide,
276
277
  actionsOrientation,
278
+ actionsWheel,
279
+ nearestToPill,
280
+ avoidPills,
277
281
  actionsLabel
278
282
  } : void 0;
279
283
  const inside = satellites && satelliteHost && actionsStyle === "inside" ? /* @__PURE__ */ jsx(satellites.Inside, { host: satelliteHost }) : null;