ropav 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +4 -0
- package/dist/components/portal-provider/portal-provider.types.d.ts +2 -2
- package/dist/composables/focus-scope-registry.d.ts +1 -1
- package/dist/composables/focus-scope-registry.js +1 -1
- package/dist/composables/use-dismissable.d.ts +1 -1
- package/dist/composables/use-focus-scope.d.ts +1 -1
- package/dist/composables/use-portal.d.ts +2 -2
- package/dist/composables/use-portal.js +2 -2
- package/dist/ropav.min.css +1 -1
- package/dist/styles/accordion.css +3 -0
- package/dist/styles/alert-dialog.css +4 -0
- package/dist/styles/alert.css +3 -0
- package/dist/styles/autocomplete.css +4 -0
- package/dist/styles/avatar-group.css +4 -0
- package/dist/styles/avatar.css +3 -0
- package/dist/styles/badge.css +3 -0
- package/dist/styles/breadcrumbs.css +4 -0
- package/dist/styles/button-group.css +4 -0
- package/dist/styles/button.css +3 -0
- package/dist/styles/calendar-year-picker.css +3 -0
- package/dist/styles/calendar.css +3 -0
- package/dist/styles/card.css +3 -0
- package/dist/styles/checkbox-group.css +3 -0
- package/dist/styles/checkbox.css +3 -0
- package/dist/styles/chip.css +3 -0
- package/dist/styles/close-button.css +3 -0
- package/dist/styles/color-area.css +3 -0
- package/dist/styles/color-field.css +3 -0
- package/dist/styles/color-input-group.css +3 -0
- package/dist/styles/color-picker.css +3 -0
- package/dist/styles/color-slider.css +3 -0
- package/dist/styles/color-swatch-picker.css +3 -0
- package/dist/styles/color-swatch.css +3 -0
- package/dist/styles/combo-box.css +3 -0
- package/dist/styles/components.css +3 -0
- package/dist/styles/core.css +2 -0
- package/dist/styles/date-field.css +4 -0
- package/dist/styles/date-picker.css +4 -0
- package/dist/styles/date-range-picker.css +4 -0
- package/dist/styles/description.css +3 -0
- package/dist/styles/disclosure-group.css +3 -0
- package/dist/styles/disclosure.css +3 -0
- package/dist/styles/drawer.css +4 -0
- package/dist/styles/drop-zone.css +3 -0
- package/dist/styles/dropdown.css +4 -0
- package/dist/styles/empty-state.css +3 -0
- package/dist/styles/error-message.css +3 -0
- package/dist/styles/field-error.css +3 -0
- package/dist/styles/fieldset.css +3 -0
- package/dist/styles/header.css +3 -0
- package/dist/styles/input-group.css +3 -0
- package/dist/styles/input-otp.css +3 -0
- package/dist/styles/input.css +3 -0
- package/dist/styles/kbd.css +3 -0
- package/dist/styles/label.css +3 -0
- package/dist/styles/link.css +3 -0
- package/dist/styles/list-box-item.css +3 -0
- package/dist/styles/list-box-section.css +3 -0
- package/dist/styles/list-box.css +4 -0
- package/dist/styles/menu-item.css +3 -0
- package/dist/styles/menu-section.css +3 -0
- package/dist/styles/menu.css +3 -0
- package/dist/styles/meter.css +3 -0
- package/dist/styles/modal.css +4 -0
- package/dist/styles/number-field.css +3 -0
- package/dist/styles/pagination.css +3 -0
- package/dist/styles/popover.css +3 -0
- package/dist/styles/progress-bar.css +3 -0
- package/dist/styles/progress-circle.css +3 -0
- package/dist/styles/radio-group.css +3 -0
- package/dist/styles/radio.css +3 -0
- package/dist/styles/range-calendar.css +3 -0
- package/dist/styles/scroll-shadow.css +3 -0
- package/dist/styles/search-field.css +4 -0
- package/dist/styles/segmented-control.css +3 -0
- package/dist/styles/select.css +3 -0
- package/dist/styles/separator.css +3 -0
- package/dist/styles/sidebar.css +8 -0
- package/dist/styles/skeleton.css +3 -0
- package/dist/styles/slider.css +3 -0
- package/dist/styles/spinner.css +3 -0
- package/dist/styles/splitter.css +3 -0
- package/dist/styles/surface.css +3 -0
- package/dist/styles/switch-group.css +3 -0
- package/dist/styles/switch.css +3 -0
- package/dist/styles/table.css +5 -0
- package/dist/styles/tabs.css +4 -0
- package/dist/styles/tag-group.css +3 -0
- package/dist/styles/tag.css +4 -0
- package/dist/styles/textarea.css +3 -0
- package/dist/styles/textfield.css +3 -0
- package/dist/styles/time-field.css +4 -0
- package/dist/styles/toast.css +6 -0
- package/dist/styles/toggle-button-group.css +3 -0
- package/dist/styles/toggle-button.css +3 -0
- package/dist/styles/toolbar.css +3 -0
- package/dist/styles/tooltip.css +3 -0
- package/dist/styles/typography.css +3 -0
- package/dist/styles/virtualizer.css +3 -0
- package/dist/utils/aria-hide-outside.js +1 -1
- package/dist/utils/position.d.ts +1 -1
- package/dist/utils/position.js +66 -52
- package/dist/utils/region.d.ts +3 -3
- package/dist/utils/region.js +3 -3
- package/dist/version.js +1 -1
- package/package.json +362 -2
package/AGENTS.md
CHANGED
|
@@ -18,6 +18,10 @@ so a bundler drops what is never imported. The stylesheet is a separate import:
|
|
|
18
18
|
import "ropav/styles/bundled.css";
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
Through a bundler, it also comes in parts: `ropav/styles/core` once, then `ropav/styles/<name>` for
|
|
22
|
+
each component used (`ropav/styles/modal`), or `ropav/styles/components` for all of them. The
|
|
23
|
+
core holds the theme, so it is never the part loaded late.
|
|
24
|
+
|
|
21
25
|
Every component takes `class`, `aria-label`, `aria-labelledby` and `aria-describedby`. Props are
|
|
22
26
|
camelCase in the types and kebab-case in a template: `itemTextValue` is written `item-text-value`.
|
|
23
27
|
|
|
@@ -13,8 +13,8 @@ export interface PortalProviderRootProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* The part of the page the overlays below belong to, usually an element holding both the content
|
|
15
15
|
* and the `container`. A modal makes only this element `inert` and holds focus and outside
|
|
16
|
-
* presses only within it, and a placed overlay flips and shifts to stay inside it — so
|
|
17
|
-
* rendered
|
|
16
|
+
* presses only within it, and a placed overlay flips and shifts to stay inside it — so content
|
|
17
|
+
* rendered into one region of a larger page leaves the rest of that page alone.
|
|
18
18
|
*
|
|
19
19
|
* Omitted, it inherits the enclosing provider's root; `null` goes back to the whole document.
|
|
20
20
|
*/
|
|
@@ -8,7 +8,7 @@ export interface RegisteredScope {
|
|
|
8
8
|
* The innermost scope holding focus in a region, among the scopes whose region overlaps it.
|
|
9
9
|
*
|
|
10
10
|
* Without a region every scope overlaps every other, which is the page-wide question. With one, a
|
|
11
|
-
* modal in one
|
|
11
|
+
* modal in one region is not shadowed by a modal opened later in another region beside it.
|
|
12
12
|
*/
|
|
13
13
|
export declare const innermostContainingScope: (region?: Element | null) => RegisteredScope | null;
|
|
14
14
|
/**
|
|
@@ -12,7 +12,7 @@ var scopes = [];
|
|
|
12
12
|
* The innermost scope holding focus in a region, among the scopes whose region overlaps it.
|
|
13
13
|
*
|
|
14
14
|
* Without a region every scope overlaps every other, which is the page-wide question. With one, a
|
|
15
|
-
* modal in one
|
|
15
|
+
* modal in one region is not shadowed by a modal opened later in another region beside it.
|
|
16
16
|
*/
|
|
17
17
|
var innermostContainingScope = (region = null) => {
|
|
18
18
|
for (let index = scopes.length - 1; index >= 0; index--) {
|
|
@@ -24,7 +24,7 @@ export interface UseDismissableOptions {
|
|
|
24
24
|
*/
|
|
25
25
|
shouldCloseOnInteractOutside?: (element: Element) => boolean;
|
|
26
26
|
/**
|
|
27
|
-
* The part of the page the overlay belongs to. A press outside it — in another
|
|
27
|
+
* The part of the page the overlay belongs to. A press outside it — in another region
|
|
28
28
|
* beside this one — is neither an outside interaction nor swallowed, and the overlay is only
|
|
29
29
|
* stacked with overlays whose region overlaps its own. `null` or absent: the whole document.
|
|
30
30
|
*/
|
|
@@ -25,7 +25,7 @@ export interface UseFocusScopeOptions {
|
|
|
25
25
|
autoFocus?: MaybeRefOrGetter<boolean | "first" | "last" | undefined>;
|
|
26
26
|
/**
|
|
27
27
|
* The part of the page containment holds focus within. Focus moving to something outside it —
|
|
28
|
-
* another
|
|
28
|
+
* another region beside this one — is left alone rather than pulled back, and Tab pressed
|
|
29
29
|
* out there is not taken over. `null` or absent: the whole document.
|
|
30
30
|
*/
|
|
31
31
|
region?: MaybeRefOrGetter<Element | null | undefined>;
|
|
@@ -16,8 +16,8 @@ export interface Portal {
|
|
|
16
16
|
* The portal that applies here: the nearest `PortalProvider`'s, or the document's body.
|
|
17
17
|
*
|
|
18
18
|
* Ported from React Aria's `UNSAFE_PortalProvider` (`getContainer`), with the root added: an
|
|
19
|
-
* overlay rendered into a region of the page
|
|
20
|
-
*
|
|
19
|
+
* overlay rendered into a region of the page belongs to that region and has to leave the rest of
|
|
20
|
+
* the page alone — hidden, focused and pressed as it was.
|
|
21
21
|
*/
|
|
22
22
|
export declare const usePortal: () => Portal;
|
|
23
23
|
export interface PortalOptions {
|
|
@@ -15,8 +15,8 @@ var BODY = {
|
|
|
15
15
|
* The portal that applies here: the nearest `PortalProvider`'s, or the document's body.
|
|
16
16
|
*
|
|
17
17
|
* Ported from React Aria's `UNSAFE_PortalProvider` (`getContainer`), with the root added: an
|
|
18
|
-
* overlay rendered into a region of the page
|
|
19
|
-
*
|
|
18
|
+
* overlay rendered into a region of the page belongs to that region and has to leave the rest of
|
|
19
|
+
* the page alone — hidden, focused and pressed as it was.
|
|
20
20
|
*/
|
|
21
21
|
var usePortal = () => usePortalContext() ?? BODY;
|
|
22
22
|
/**
|