@slotted/react 0.1.0-beta.14 → 0.1.0-beta.15

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.
@@ -1,6 +1,6 @@
1
1
  import { r as e } from "./i18n-D7xXDd8-.js";
2
2
  /* empty css */
3
- import { c as t, d as n, l as r, o as i, r as a, u as o } from "./drawer-Pk4tqPUV.js";
3
+ import { c as t, d as n, l as r, o as i, r as a, u as o } from "./drawer-CFpBsLG6.js";
4
4
  import { t as s } from "./spinner-ring-DyfaYloA.js";
5
5
  import { keyedProps as c, withSelectorKey as l } from "@slotted/core/selector-key";
6
6
  import { createRovingTabindex as u } from "@slotted/core/focus";
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, f as r, h as i, i as a, l as o, m as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m } from "./action-sheet-BAoaxbmI.js";
1
+ import { a as e, c as t, d as n, f as r, h as i, i as a, l as o, m as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m } from "./action-sheet-Klu-YxIk.js";
2
2
  export { r as ActionSheet, p as ActionSheetCancel, c as ActionSheetContent, s as ActionSheetDefaultsProvider, d as ActionSheetGroup, a as ActionSheetGroupLabel, e as ActionSheetHeader, l as ActionSheetItem, f as ActionSheetList, t as ActionSheetMessage, o as ActionSheetSeparator, m as ActionSheetTitle, n as ActionSheetTrigger, u as useActionSheet, i as useActionSheetDefaults };
@@ -1,7 +1,7 @@
1
1
  import { r as e } from "./i18n-D7xXDd8-.js";
2
2
  import { n as t, t as n } from "./icon-D04-_QFA.js";
3
3
  import { _ as r, c as i, n as a, t as o } from "./menu-parts-BDdCTmko.js";
4
- import { d as s, o as c, u as l } from "./drawer-Pk4tqPUV.js";
4
+ import { d as s, o as c, u as l } from "./drawer-CFpBsLG6.js";
5
5
  import { n as u } from "./icon-button-DbSZKGT4.js";
6
6
  import { t as d } from "./checkbox-Hq1PXk04.js";
7
7
  import { t as f } from "./text-field-CHYoral_.js";
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, r, t as i } from "./column-manager-DMaWNyXs.js";
1
+ import { a as e, i as t, n, r, t as i } from "./column-manager-e234Ey_u.js";
2
2
  export { i as ColumnManager, t as ColumnManagerProvider, n as ColumnManagerRoot, r as ColumnManagerTrigger, e as useColumnManagerDefaults };
@@ -163,7 +163,7 @@ Excerpt — not a complete module
163
163
 
164
164
  ### A bottom sheet as a phone draws one
165
165
 
166
- The sheet measures what it holds — the default size on top and bottom — stops at forty rems on a wide layer, and moves under a touch anywhere on its body. A downward drag with the list at its top moves the sheet; an upward one grows it to the next stop — the height of its content among them — before the list scrolls; a fling faster than 500 px/s goes to the next stop or closes. A tap on the grabber walks the stops.
166
+ The sheet measures what it holds — the default size on top and bottom — stops at forty rems on a wide layer, and is moved by the platform’s own scroll, so the finger, the fling and the landing on a stop run on the compositor. The sheet and its content are one scroll: pushing up lifts the sheet to the top of the screen and, without letting go, goes on through the list under the header, which sticks there; pulling down from the top of the list brings the sheet down. A fling out of the list stops at its top and never closes the sheet. A tap on the grabber walks the stops.
167
167
 
168
168
  Example
169
169
 
@@ -305,7 +305,7 @@
305
305
  "type": "'panel' | 'resizer'",
306
306
  "defaultValue": "panel",
307
307
  "appliesTo": "Drawer, DrawerDefaultsProvider",
308
- "description": "What a touch moves a bottom sheet by: panel, anywhere on the panel, or resizer, the separator only. With panel, a drag that starts in a list scrolled away from its top scrolls the list. A mouse or a pen always drags the separator."
308
+ "description": "What a touch moves a bottom sheet by: panel, anywhere on the panel, the sheet and its content scrolling as one; or resizer, the separator only, the body scrolling on its own at the highest stop. A mouse drags the separator, and the sheet settles on the nearest stop."
309
309
  },
310
310
  {
311
311
  "name": "scrimFrom",
@@ -422,7 +422,7 @@
422
422
  {
423
423
  "name": "onExtentChange",
424
424
  "payload": "(extent: number | undefined, request: DrawerExtentRequest)",
425
- "when": "Before the panel’s measure changes, with the reason pointer for a drag or a tap on the grip, keyboard for an arrow key, Home, End or Enter, and programmatic for a change from code. A drag of the separator fires on every pointer move and can report a value below minExtent; a drag of a sheet’s body fires once, on release, with the stop it landed on. undefined means the panel is back on its size step, or on the height of its content under size=\"content\"."
425
+ "when": "Before the panel’s measure changes, with the reason pointer for a drag or a tap on the grip, keyboard for an arrow key, Home, End or Enter, and programmatic for a change from code. A drag of the separator fires on every pointer move and can report a value below minExtent; a bottom sheet fires once its scroll comes to rest, with the stop it rests on. undefined means the panel is back on its size step, or on the height of its content under size=\"content\"."
426
426
  },
427
427
  {
428
428
  "name": "onClick, onKeyDown, onPointerDown, on every part",
@@ -435,7 +435,7 @@
435
435
  "Under mode=\"inline\" the panel has no role, because a navigation drawer is a navigation landmark and a filter panel is complementary; give it one with render. The trigger has no aria-haspopup there, because an inline drawer is a disclosure, not a popup.",
436
436
  "aria-modal=\"true\" is written only while the drawer is modal, which is the only state in which the page behind is inert. modal is always false under mode=\"inline\".",
437
437
  "The separator follows the WAI-ARIA window splitter pattern. The arrow keys move it in the direction they point, Home and End go to the limits, and Enter collapses the panel to its minimum and then restores it. Enter never closes the drawer; Escape does. The values are percentages, and there is no aria-valuetext, so a screen reader announces 40 rather than 40 per cent.",
438
- "A bottom sheet moves under a touch on its body as well as on its separator, and every stop a finger reaches, the height of the content among them, is also reachable with the arrow keys on the separator. A touch drag never starts on a field, on selected text, or on an element whose touch-action already takes vertical movement.",
438
+ "A bottom sheet moves under a touch on its body as well as on its separator, and every stop a finger reaches, the height of the content among them, is also reachable with the arrow keys on the separator. It is moved by the page’s own scroll, so a control whose touch-action takes vertical movement keeps its gesture, and a region inside data-drawer-drag=\"none\" keeps its scroll from passing on to the sheet.",
439
439
  "A closed panel is inert in both modes, so its controls are in neither the tab order nor the accessibility tree.",
440
440
  "Focus moves into an overlay panel when it opens, to the first focusable element unless initialFocus names another, and returns on close to the element that had it before; if that element has left the document, focus goes to its nearest ancestor still in it. An inline drawer moves no focus when it opens, and on close restores focus only when focus is inside the panel or on the page body.",
441
441
  "The ✕ button and the separator are each at least --slotted-target-min across, so both meet the WCAG 2.2 minimum target size of 24 by 24 pixels."
@@ -473,6 +473,8 @@
473
473
  "--slotted-drawer-resizer-line-color",
474
474
  "--slotted-drawer-rule-color",
475
475
  "--slotted-drawer-scrim",
476
+ "--slotted-drawer-sheet-floor",
477
+ "--slotted-drawer-sheet-height",
476
478
  "--slotted-drawer-sheet-inline-size",
477
479
  "--slotted-drawer-surface",
478
480
  "--slotted-drawer-title-color",
@@ -571,7 +573,7 @@
571
573
  {
572
574
  "id": "sheet",
573
575
  "title": "A bottom sheet as a phone draws one",
574
- "note": "The sheet measures what it holds — the default size on top and bottom — stops at forty rems on a wide layer, and moves under a touch anywhere on its body. A downward drag with the list at its top moves the sheet; an upward one grows it to the next stop — the height of its content among them — before the list scrolls; a fling faster than 500 px/s goes to the next stop or closes. A tap on the grabber walks the stops.",
576
+ "note": "The sheet measures what it holds — the default size on top and bottom — stops at forty rems on a wide layer, and is moved by the platform’s own scroll, so the finger, the fling and the landing on a stop run on the compositor. The sheet and its content are one scroll: pushing up lifts the sheet to the top of the screen and, without letting go, goes on through the list under the header, which sticks there; pulling down from the top of the list brings the sheet down. A fling out of the list stops at its top and never closes the sheet. A tap on the grabber walks the stops.",
575
577
  "language": "tsx",
576
578
  "source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport {\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerPanel,\n DrawerResizer,\n DrawerTitle,\n DrawerTrigger,\n} from '@slotted/react/drawer';\nimport { FieldGroup, FieldGroupContent, FieldGroupLegend } from '@slotted/react/field-group';\nimport { Inline } from '@slotted/react/inline';\nimport { Radio, RadioGroup } from '@slotted/react/radio-group';\nimport { Text } from '@slotted/react/typography';\n\nconst WINDOWS = [\n { value: 'morning', label: 'Thursday 8 October, 8 AM to noon' },\n { value: 'afternoon', label: 'Thursday 8 October, 1 to 5 PM' },\n { value: 'friday', label: 'Friday 9 October, 8 AM to noon' },\n];\n\nexport default function DrawerSheet() {\n const [open, setOpen] = useState(false);\n const [pickup, setPickup] = useState('morning');\n const [draft, setDraft] = useState(pickup);\n\n return (\n <Inline align=\"center\" gap={3}>\n <Text size=\"sm\">Pickup: {WINDOWS.find((window) => window.value === pickup)?.label}</Text>\n <Drawer\n open={open}\n onOpenChange={(next) => {\n if (next) setDraft(pickup);\n setOpen(next);\n }}\n side=\"bottom\"\n >\n <DrawerTrigger\n render={(props) => (\n <Button {...props} size=\"sm\" tone=\"secondary\" variant=\"outline\">\n Reschedule\n </Button>\n )}\n />\n <DrawerPanel>\n <DrawerResizer />\n <DrawerHeader>\n <DrawerTitle>Reschedule pickup</DrawerTitle>\n <DrawerDescription>Shipment SH-4471, UPS Ground from Reno, NV.</DrawerDescription>\n <DrawerClose />\n </DrawerHeader>\n <DrawerBody>\n <FieldGroup>\n <FieldGroupLegend>Pickup window</FieldGroupLegend>\n <FieldGroupContent>\n <RadioGroup value={draft} onValueChange={setDraft}>\n {WINDOWS.map((window) => (\n <Radio key={window.value} value={window.value}>\n {window.label}\n </Radio>\n ))}\n </RadioGroup>\n </FieldGroupContent>\n </FieldGroup>\n </DrawerBody>\n <DrawerFooter>\n <Button variant=\"ghost\" tone=\"secondary\" onClick={() => setOpen(false)}>\n Cancel\n </Button>\n <Button\n onClick={() => {\n setPickup(draft);\n setOpen(false);\n }}\n >\n Reschedule\n </Button>\n </DrawerFooter>\n </DrawerPanel>\n </Drawer>\n </Inline>\n );\n}\n",
577
579
  "verdict": "example"
@@ -128,7 +128,7 @@ export default function DrawerBasic() {
128
128
  | `escape` | `'close' \| 'none'` | close | Drawer, DrawerDefaultsProvider | Whether Escape asks to close the drawer. Escape reaches only the topmost layer, and a layer that refuses it does not pass it to the one below. |
129
129
  | `outsidePress` | `'close' \| 'none'` | close | Drawer, DrawerDefaultsProvider | Whether a press outside the layer, the scrim included, asks to close the drawer. It has no effect under mode="inline". |
130
130
  | `back` | `'close' \| 'none'` | close | Drawer, DrawerDefaultsProvider | Whether the browser’s back button or a phone’s back gesture closes a modal drawer instead of leaving the page. The drawer holds one history entry while it is open. It has no effect under mode="inline". |
131
- | `drag` | `'panel' \| 'resizer'` | panel | Drawer, DrawerDefaultsProvider | What a touch moves a bottom sheet by: panel, anywhere on the panel, or resizer, the separator only. With panel, a drag that starts in a list scrolled away from its top scrolls the list. A mouse or a pen always drags the separator. |
131
+ | `drag` | `'panel' \| 'resizer'` | panel | Drawer, DrawerDefaultsProvider | What a touch moves a bottom sheet by: panel, anywhere on the panel, the sheet and its content scrolling as one; or resizer, the separator only, the body scrolling on its own at the highest stop. A mouse drags the separator, and the sheet settles on the nearest stop. |
132
132
  | `scrimFrom` | `number` | 0 | Drawer | While the measure is below this fraction, the scrim is not painted, a press reaches the page, and the root carries data-undimmed. Use it with modal={false} and outsidePress="none". |
133
133
  | `loading` | `boolean` | false | Drawer | Marks the body as busy with aria-busy and gives it a minimum height, so the panel does not jump when the content arrives. The header, the ✕, Escape and the separator stay available. |
134
134
  | `messages` | `Partial<DrawerMessages>` | — | Drawer | Words laid over the current language, key by key: close, the name of the ✕. An aria-label on DrawerClose takes precedence. |
@@ -150,7 +150,7 @@ export default function DrawerBasic() {
150
150
  | --- | --- | --- |
151
151
  | `onOpenChange` | `(open: boolean, request: DrawerChangeRequest)` | Before the drawer opens or closes, for every way it can: the trigger, the ✕, Escape, a press outside, the back gesture and the handle. The request carries value, previous, reason (pointer, keyboard, dismiss, escape, outsidePress, back or programmatic), result, the source event and cancel(), which keeps the drawer as it is. |
152
152
  | `onOpenChangeComplete` | `(open: boolean)` | After the entrance or the exit has ended: true once the drawer is settled open, false once it has left — the moment an application that renders the drawer conditionally removes it, so the exit runs. A drawer mounted open enters from its closed style, as one opened later does. |
153
- | `onExtentChange` | `(extent: number \| undefined, request: DrawerExtentRequest)` | Before the panel’s measure changes, with the reason pointer for a drag or a tap on the grip, keyboard for an arrow key, Home, End or Enter, and programmatic for a change from code. A drag of the separator fires on every pointer move and can report a value below minExtent; a drag of a sheet’s body fires once, on release, with the stop it landed on. undefined means the panel is back on its size step, or on the height of its content under size="content". |
153
+ | `onExtentChange` | `(extent: number \| undefined, request: DrawerExtentRequest)` | Before the panel’s measure changes, with the reason pointer for a drag or a tap on the grip, keyboard for an arrow key, Home, End or Enter, and programmatic for a change from code. A drag of the separator fires on every pointer move and can report a value below minExtent; a bottom sheet fires once its scroll comes to rest, with the stop it rests on. undefined means the panel is back on its size step, or on the height of its content under size="content". |
154
154
  | `onClick, onKeyDown, onPointerDown, on every part` | `the element’s own events` | Whenever the element fires them. Your handler runs first, and preventDefault() in it cancels the drawer’s own behaviour for that event. |
155
155
 
156
156
  ## Axes and defaults
@@ -173,14 +173,14 @@ export default function DrawerBasic() {
173
173
  - Under mode="inline" the panel has no role, because a navigation drawer is a navigation landmark and a filter panel is complementary; give it one with render. The trigger has no aria-haspopup there, because an inline drawer is a disclosure, not a popup.
174
174
  - aria-modal="true" is written only while the drawer is modal, which is the only state in which the page behind is inert. modal is always false under mode="inline".
175
175
  - The separator follows the WAI-ARIA window splitter pattern. The arrow keys move it in the direction they point, Home and End go to the limits, and Enter collapses the panel to its minimum and then restores it. Enter never closes the drawer; Escape does. The values are percentages, and there is no aria-valuetext, so a screen reader announces 40 rather than 40 per cent.
176
- - A bottom sheet moves under a touch on its body as well as on its separator, and every stop a finger reaches, the height of the content among them, is also reachable with the arrow keys on the separator. A touch drag never starts on a field, on selected text, or on an element whose touch-action already takes vertical movement.
176
+ - A bottom sheet moves under a touch on its body as well as on its separator, and every stop a finger reaches, the height of the content among them, is also reachable with the arrow keys on the separator. It is moved by the page’s own scroll, so a control whose touch-action takes vertical movement keeps its gesture, and a region inside data-drawer-drag="none" keeps its scroll from passing on to the sheet.
177
177
  - A closed panel is inert in both modes, so its controls are in neither the tab order nor the accessibility tree.
178
178
  - Focus moves into an overlay panel when it opens, to the first focusable element unless initialFocus names another, and returns on close to the element that had it before; if that element has left the document, focus goes to its nearest ancestor still in it. An inline drawer moves no focus when it opens, and on close restores focus only when focus is inside the panel or on the page body.
179
179
  - The ✕ button and the separator are each at least --slotted-target-min across, so both meet the WCAG 2.2 minimum target size of 24 by 24 pixels.
180
180
 
181
181
  ## Tokens
182
182
 
183
- `--slotted-border-strong`, `--slotted-border-subtle`, `--slotted-border-width-thick`, `--slotted-border-width-thin`, `--slotted-control-font-family`, `--slotted-control-icon-size-md`, `--slotted-control-inner-size-md`, `--slotted-control-radius`, `--slotted-control-transition-duration`, `--slotted-control-transition-easing`, `--slotted-drawer-backdrop-filter`, `--slotted-drawer-body-color`, `--slotted-drawer-border-color`, `--slotted-drawer-close-active-background`, `--slotted-drawer-close-color`, `--slotted-drawer-close-hover-background`, `--slotted-drawer-color`, `--slotted-drawer-description-color`, `--slotted-drawer-extent`, `--slotted-drawer-extent-lg`, `--slotted-drawer-extent-md`, `--slotted-drawer-extent-sm`, `--slotted-drawer-extent-xl`, `--slotted-drawer-footer-surface`, `--slotted-drawer-radius`, `--slotted-drawer-radius-expanded`, `--slotted-drawer-resizer-line-active-color`, `--slotted-drawer-resizer-line-color`, `--slotted-drawer-rule-color`, `--slotted-drawer-scrim`, `--slotted-drawer-sheet-inline-size`, `--slotted-drawer-surface`, `--slotted-drawer-title-color`, `--slotted-drawer-title-font-family`, `--slotted-duration-instant`, `--slotted-duration-long`, `--slotted-duration-medium`, `--slotted-duration-short`, `--slotted-easing-enter`, `--slotted-easing-exit`, `--slotted-easing-standard`, `--slotted-focus-ring-color`, `--slotted-focus-ring-offset`, `--slotted-focus-ring-width`, `--slotted-font-family-heading`, `--slotted-font-family-sans`, `--slotted-font-size-lg`, `--slotted-font-size-md`, `--slotted-font-size-xl`, `--slotted-font-weight-semibold`, `--slotted-line-height-lg`, `--slotted-line-height-md`, `--slotted-radius-full`, `--slotted-radius-lg`, `--slotted-radius-sm`, `--slotted-scrim`, `--slotted-shadow-lg`, `--slotted-space-11`, `--slotted-space-12`, `--slotted-space-2`, `--slotted-space-4`, `--slotted-space-5`, `--slotted-space-6`, `--slotted-space-7`, `--slotted-space-8`, `--slotted-space-9`, `--slotted-surface-raised`, `--slotted-surface-sunken`, `--slotted-target-comfortable`, `--slotted-target-min`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-secondary-subtle-active`, `--slotted-tone-secondary-subtle-hover`, `--slotted-z-index-overlay`
183
+ `--slotted-border-strong`, `--slotted-border-subtle`, `--slotted-border-width-thick`, `--slotted-border-width-thin`, `--slotted-control-font-family`, `--slotted-control-icon-size-md`, `--slotted-control-inner-size-md`, `--slotted-control-radius`, `--slotted-control-transition-duration`, `--slotted-control-transition-easing`, `--slotted-drawer-backdrop-filter`, `--slotted-drawer-body-color`, `--slotted-drawer-border-color`, `--slotted-drawer-close-active-background`, `--slotted-drawer-close-color`, `--slotted-drawer-close-hover-background`, `--slotted-drawer-color`, `--slotted-drawer-description-color`, `--slotted-drawer-extent`, `--slotted-drawer-extent-lg`, `--slotted-drawer-extent-md`, `--slotted-drawer-extent-sm`, `--slotted-drawer-extent-xl`, `--slotted-drawer-footer-surface`, `--slotted-drawer-radius`, `--slotted-drawer-radius-expanded`, `--slotted-drawer-resizer-line-active-color`, `--slotted-drawer-resizer-line-color`, `--slotted-drawer-rule-color`, `--slotted-drawer-scrim`, `--slotted-drawer-sheet-floor`, `--slotted-drawer-sheet-height`, `--slotted-drawer-sheet-inline-size`, `--slotted-drawer-surface`, `--slotted-drawer-title-color`, `--slotted-drawer-title-font-family`, `--slotted-duration-instant`, `--slotted-duration-long`, `--slotted-duration-medium`, `--slotted-duration-short`, `--slotted-easing-enter`, `--slotted-easing-exit`, `--slotted-easing-standard`, `--slotted-focus-ring-color`, `--slotted-focus-ring-offset`, `--slotted-focus-ring-width`, `--slotted-font-family-heading`, `--slotted-font-family-sans`, `--slotted-font-size-lg`, `--slotted-font-size-md`, `--slotted-font-size-xl`, `--slotted-font-weight-semibold`, `--slotted-line-height-lg`, `--slotted-line-height-md`, `--slotted-radius-full`, `--slotted-radius-lg`, `--slotted-radius-sm`, `--slotted-scrim`, `--slotted-shadow-lg`, `--slotted-space-11`, `--slotted-space-12`, `--slotted-space-2`, `--slotted-space-4`, `--slotted-space-5`, `--slotted-space-6`, `--slotted-space-7`, `--slotted-space-8`, `--slotted-space-9`, `--slotted-surface-raised`, `--slotted-surface-sunken`, `--slotted-target-comfortable`, `--slotted-target-min`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-secondary-subtle-active`, `--slotted-tone-secondary-subtle-hover`, `--slotted-z-index-overlay`
184
184
 
185
185
  ## Examples
186
186