@pontive/pontkit-core 1.39.0 → 1.41.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/catalog.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/index.js +1846 -1289
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17059 -12690
- package/dist/index.mjs.map +1 -1
- package/dist/pont2/core/context-root.d.ts +1 -0
- package/dist/pont2/core/events.d.ts +1 -1
- package/dist/pont2/core/format.d.ts +46 -0
- package/dist/pont2/core/icons.d.ts +11 -0
- package/dist/pont2/core/index.d.ts +2 -0
- package/dist/pont2/core/messages.d.ts +128 -2
- package/dist/pont2/core/popup/index.d.ts +1 -0
- package/dist/pont2/core/popup/modal.d.ts +56 -0
- package/dist/pont2/core/popup/popup-content.d.ts +7 -0
- package/dist/pont2/core/popup/story-helpers.d.ts +6 -0
- package/dist/pont2/custom-elements.json +55405 -24958
- package/dist/pont2/index.d.ts +7 -0
- package/dist/pont2/index.mjs +6600 -2376
- package/dist/pont2/index.mjs.map +1 -1
- package/dist/pont2/kit/account-menu/account-menu.d.ts +115 -0
- package/dist/pont2/kit/account-settings/account-settings.d.ts +157 -0
- package/dist/pont2/kit/account-settings/profile.d.ts +74 -0
- package/dist/pont2/kit/badge-selector/badge-selector.d.ts +65 -0
- package/dist/pont2/kit/consent/consent.d.ts +3 -2
- package/dist/pont2/kit/data-table/data-table.d.ts +120 -0
- package/dist/pont2/kit/data-table/rows.d.ts +25 -0
- package/dist/pont2/kit/flow-widget/flow-widget.d.ts +21 -8
- package/dist/pont2/kit/index.d.ts +11 -0
- package/dist/pont2/kit/layout/layout.d.ts +7 -0
- package/dist/pont2/kit/member-management/errors.d.ts +60 -0
- package/dist/pont2/kit/member-management/member-management.d.ts +237 -0
- package/dist/pont2/kit/member-management/roles.d.ts +42 -0
- package/dist/pont2/kit/multi-email-input/emails.d.ts +19 -0
- package/dist/pont2/kit/multi-email-input/multi-email-input.d.ts +78 -0
- package/dist/pont2/kit/multi-select-filter/multi-select-filter.d.ts +53 -0
- package/dist/pont2/kit/organization-switcher/organization-switcher.d.ts +111 -0
- package/dist/pont2/kit/pagination/pagination.d.ts +61 -0
- package/dist/pont2/kit/pagination/range.d.ts +17 -0
- package/dist/pont2/kit/provider/account-client.d.ts +355 -0
- package/dist/pont2/kit/provider/account-controller.d.ts +47 -0
- package/dist/pont2/kit/provider/account-user.d.ts +16 -0
- package/dist/pont2/kit/provider/coexistence.d.ts +19 -0
- package/dist/pont2/kit/provider/contexts.d.ts +46 -0
- package/dist/pont2/kit/provider/provider.d.ts +219 -0
- package/dist/pont2/kit/provider/redirect.d.ts +122 -0
- package/dist/pont2/kit/provider/runtime-config.d.ts +24 -0
- package/dist/pont2/kit/provider/sdk.d.ts +100 -0
- package/dist/pont2/kit/provider/signed-in.d.ts +81 -0
- package/dist/pont2/kit/provider/widget-messages.d.ts +35 -0
- package/dist/pont2/primitives/alert-dialog/alert-dialog.d.ts +132 -0
- package/dist/pont2/primitives/combobox/combobox.d.ts +82 -14
- package/dist/pont2/primitives/dialog/dialog.d.ts +195 -0
- package/dist/pont2/primitives/drawer/drawer.d.ts +112 -0
- package/dist/pont2/primitives/hover-card/hover-card.d.ts +83 -0
- package/dist/pont2/primitives/pagination/pagination.d.ts +120 -0
- package/dist/pont2/primitives/sheet/sheet.d.ts +92 -0
- package/dist/pont2/primitives/sonner/sonner.d.ts +86 -0
- package/dist/pont2/primitives/sonner/toast-store.d.ts +81 -0
- package/dist/pont2/styles.css +2489 -760
- package/dist/pont2/theme/tokens.json.d.ts +700 -1
- package/dist/pont2/theme-golden.json +45 -45
- package/dist/pont2/theme.mjs +119 -119
- package/dist/pont2/tokens.json +700 -1
- package/dist/styles.css +2475 -746
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function attachContextRoot(root?: Element | undefined): void;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function fireNative(target: EventTarget, type: "input" | "change"): void;
|
|
18
18
|
export declare function fire<T>(target: EventTarget, type: `pont2-${string}`, detail: T, cancelable?: boolean): boolean;
|
|
19
|
-
export type OpenChangeReason = "trigger-press" | "trigger-hover" | "trigger-focus" | "outside-press" | "escape-key" | "item-press" | "list-navigation" | "input-change" | "focus-out" | "imperative";
|
|
19
|
+
export type OpenChangeReason = "trigger-press" | "trigger-hover" | "trigger-focus" | "outside-press" | "escape-key" | "item-press" | "list-navigation" | "input-change" | "focus-out" | "close-press" | "imperative";
|
|
20
20
|
export interface OpenChangeDetail {
|
|
21
21
|
open: boolean;
|
|
22
22
|
reason: OpenChangeReason;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # Dates and numbers in the page's language (tracker I-3, I-4; carry-over §3)
|
|
3
|
+
*
|
|
4
|
+
* The legacy `src/utils/format.ts`, done properly: every function formats with
|
|
5
|
+
* the language the page was last served in (`currentLocale()`, from the
|
|
6
|
+
* server's message set; the browser's own until then), and the relative day
|
|
7
|
+
* ("Today", "Yesterday") comes from `Intl.RelativeTimeFormat`, so it is in
|
|
8
|
+
* that language too instead of English. No message codes are needed.
|
|
9
|
+
*
|
|
10
|
+
* Every function takes the locale and "now" as options so it can be tested.
|
|
11
|
+
*/
|
|
12
|
+
/** What the management API sends for a moment: Unix seconds, Unix milliseconds, an ISO string, or a Date. */
|
|
13
|
+
export type DateInput = number | string | Date | null | undefined;
|
|
14
|
+
export interface FormatOptions {
|
|
15
|
+
/** BCP-47 tag (default `currentLocale()`, then the browser's). */
|
|
16
|
+
locale?: string;
|
|
17
|
+
/** For relative labels: the moment to compare with (default now). */
|
|
18
|
+
now?: Date;
|
|
19
|
+
/** Format in this time zone (default the browser's). For tests. */
|
|
20
|
+
timeZone?: string;
|
|
21
|
+
}
|
|
22
|
+
/** `value` as a valid Date, or `null` (missing, unparsable). */
|
|
23
|
+
export declare function toDate(value: DateInput): Date | null;
|
|
24
|
+
/** "Jan 15, 2024" (en), "15 janv. 2024" (fr): the medium date. Empty for no date. */
|
|
25
|
+
export declare function formatDate(value: DateInput, options?: FormatOptions): string;
|
|
26
|
+
/** "2:30 PM" (en-US), "14:30" (de): hours and minutes in the language's own clock. Empty for no date. */
|
|
27
|
+
export declare function formatTime(value: DateInput, options?: FormatOptions): string;
|
|
28
|
+
/** Date and time together ("Jan 15, 2024, 2:30 PM"), e.g. for a `title` tooltip. Empty for no date. */
|
|
29
|
+
export declare function formatDateTime(value: DateInput, options?: FormatOptions): string;
|
|
30
|
+
/** Whole calendar days from `now` to `date` (negative: in the past), in the browser's (or `timeZone`'s) days. */
|
|
31
|
+
export declare function calendarDaysBetween(date: Date, now: Date, timeZone?: string): number;
|
|
32
|
+
/**
|
|
33
|
+
* A day as people say it, relative to today, in the page's language:
|
|
34
|
+
*
|
|
35
|
+
* - the same day, the day before or after: `Intl.RelativeTimeFormat` with `numeric: "auto"`
|
|
36
|
+
* ("Today", "Yesterday", "Tomorrow"; "Aujourd’hui", "Hier", "Demain"), first letter capitalised;
|
|
37
|
+
* - two to six days either side: the weekday ("Monday", "lundi");
|
|
38
|
+
* - anything further: the medium date (`formatDate`).
|
|
39
|
+
*
|
|
40
|
+
* The legacy `formatRelativeDateLabel` returned English "Today" / "Yesterday" in every language,
|
|
41
|
+
* and treated a future day (an invitation's expiry) like a past one; both are fixed here (I-4).
|
|
42
|
+
* Empty for no date.
|
|
43
|
+
*/
|
|
44
|
+
export declare function formatRelativeDay(value: DateInput, options?: FormatOptions): string;
|
|
45
|
+
/** A number in the page's language ("1,234" / "1.234"). */
|
|
46
|
+
export declare function formatNumber(value: number, options?: Pick<FormatOptions, "locale">): string;
|
|
@@ -9,8 +9,14 @@ export declare const icons: {
|
|
|
9
9
|
chevronRight: (a?: AttrMap) => TemplateResult<1>;
|
|
10
10
|
chevronLeft: (a?: AttrMap) => TemplateResult<1>;
|
|
11
11
|
chevronsUpDown: (a?: AttrMap) => TemplateResult<1>;
|
|
12
|
+
ellipsis: (a?: AttrMap) => TemplateResult<1>;
|
|
13
|
+
arrowUp: (a?: AttrMap) => TemplateResult<1>;
|
|
14
|
+
arrowDown: (a?: AttrMap) => TemplateResult<1>;
|
|
15
|
+
arrowUpDown: (a?: AttrMap) => TemplateResult<1>;
|
|
16
|
+
listFilter: (a?: AttrMap) => TemplateResult<1>;
|
|
12
17
|
search: (a?: AttrMap) => TemplateResult<1>;
|
|
13
18
|
circle: (a?: AttrMap) => TemplateResult<1>;
|
|
19
|
+
octagonX: (a?: AttrMap) => TemplateResult<1>;
|
|
14
20
|
loaderCircle: (a?: AttrMap) => TemplateResult<1>;
|
|
15
21
|
circleAlert: (a?: AttrMap) => TemplateResult<1>;
|
|
16
22
|
circleX: (a?: AttrMap) => TemplateResult<1>;
|
|
@@ -24,5 +30,10 @@ export declare const icons: {
|
|
|
24
30
|
download: (a?: AttrMap) => TemplateResult<1>;
|
|
25
31
|
arrowRight: (a?: AttrMap) => TemplateResult<1>;
|
|
26
32
|
userRoundKey: (a?: AttrMap) => TemplateResult<1>;
|
|
33
|
+
plus: (a?: AttrMap) => TemplateResult<1>;
|
|
34
|
+
refreshCw: (a?: AttrMap) => TemplateResult<1>;
|
|
35
|
+
mail: (a?: AttrMap) => TemplateResult<1>;
|
|
36
|
+
shieldAlert: (a?: AttrMap) => TemplateResult<1>;
|
|
37
|
+
externalLink: (a?: AttrMap) => TemplateResult<1>;
|
|
27
38
|
};
|
|
28
39
|
export type IconName = keyof typeof icons;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './context-root';
|
|
1
2
|
export * from './host-element';
|
|
2
3
|
export * from './form-control';
|
|
3
4
|
export * from './attrs';
|
|
@@ -11,3 +12,4 @@ export * from './url';
|
|
|
11
12
|
export * from './controllers/roving-focus';
|
|
12
13
|
export * from './controllers/action';
|
|
13
14
|
export * from './controllers/copy';
|
|
15
|
+
export * from './format';
|
|
@@ -21,8 +21,8 @@ import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
|
21
21
|
* Elements that render `msg()` add a `MessagesController`, so text that arrives
|
|
22
22
|
* after they first rendered reaches them.
|
|
23
23
|
*
|
|
24
|
-
* The account widgets' codes (carry-over §3) join this table
|
|
25
|
-
* built (migration tracker I-2, W-7…W-10).
|
|
24
|
+
* The account widgets' codes (carry-over §3) join this table as they are
|
|
25
|
+
* built (migration tracker I-2, W-7…W-10): the menu's and the switcher's are in.
|
|
26
26
|
*/
|
|
27
27
|
export declare const KIT_MESSAGES_EN: {
|
|
28
28
|
readonly connection_failed: "We couldn't reach the server. Check your connection and try again.";
|
|
@@ -39,6 +39,132 @@ export declare const KIT_MESSAGES_EN: {
|
|
|
39
39
|
readonly show_password: "Show password";
|
|
40
40
|
readonly hide_password: "Hide password";
|
|
41
41
|
readonly loading: "Loading";
|
|
42
|
+
readonly action_close: "Close";
|
|
43
|
+
readonly action_remove: "Remove";
|
|
44
|
+
readonly notifications: "Notifications";
|
|
45
|
+
readonly pagination: "Pagination";
|
|
46
|
+
readonly pagination_previous: "Previous";
|
|
47
|
+
readonly pagination_next: "Next";
|
|
48
|
+
readonly pagination_previous_page: "Go to previous page";
|
|
49
|
+
readonly pagination_next_page: "Go to next page";
|
|
50
|
+
readonly pagination_more: "More pages";
|
|
51
|
+
readonly no_results: "No results.";
|
|
52
|
+
readonly actions_menu: "Actions";
|
|
53
|
+
readonly sort_ascending: "Sort ascending";
|
|
54
|
+
readonly sort_descending: "Sort descending";
|
|
55
|
+
readonly filter: "Filter";
|
|
56
|
+
readonly clear_filters: "Clear filters";
|
|
57
|
+
readonly invalid_emails: "Not valid email addresses:";
|
|
58
|
+
readonly email_limit_reached: "No more addresses can be added.";
|
|
59
|
+
readonly invite_emails_placeholder: "Type or paste email addresses";
|
|
60
|
+
readonly invite_emails_required: "Enter at least one email address.";
|
|
61
|
+
readonly search_roles: "Search roles";
|
|
62
|
+
readonly no_options: "Nothing found.";
|
|
63
|
+
readonly account_settings: "Account settings";
|
|
64
|
+
readonly log_out: "Log out";
|
|
65
|
+
readonly select_organization: "Select organization";
|
|
66
|
+
readonly organization_switch_failed: "You can't switch to that organization.";
|
|
67
|
+
readonly organization_switching: "Switching…";
|
|
68
|
+
readonly action_save: "Save";
|
|
69
|
+
readonly action_saving: "Saving";
|
|
70
|
+
readonly action_cancel: "Cancel";
|
|
71
|
+
readonly action_edit: "Edit";
|
|
72
|
+
readonly action_submit: "Submit";
|
|
73
|
+
readonly action_submitting: "Submitting";
|
|
74
|
+
readonly action_retry: "Try again";
|
|
75
|
+
readonly action_refresh: "Refresh";
|
|
76
|
+
readonly field_email: "Email";
|
|
77
|
+
readonly tab_profile: "Profile";
|
|
78
|
+
readonly tab_security: "Security";
|
|
79
|
+
readonly not_added: "Not added";
|
|
80
|
+
readonly field_phone: "Phone number";
|
|
81
|
+
readonly field_photo: "Photo";
|
|
82
|
+
readonly field_photo_url: "Photo URL";
|
|
83
|
+
readonly avatar_alt: "Avatar";
|
|
84
|
+
readonly change_photo: "Change photo";
|
|
85
|
+
readonly login_info: "Login info";
|
|
86
|
+
readonly personal_info: "Personal info";
|
|
87
|
+
readonly location_section: "Location";
|
|
88
|
+
readonly links_section: "Links";
|
|
89
|
+
readonly field_username: "Username";
|
|
90
|
+
readonly field_first_name: "First name";
|
|
91
|
+
readonly field_middle_name: "Middle name";
|
|
92
|
+
readonly field_last_name: "Last name";
|
|
93
|
+
readonly field_nickname: "Nickname";
|
|
94
|
+
readonly field_gender: "Gender";
|
|
95
|
+
readonly field_bio: "Bio";
|
|
96
|
+
readonly field_location: "Location";
|
|
97
|
+
readonly field_timezone: "Time zone";
|
|
98
|
+
readonly field_website: "Website";
|
|
99
|
+
readonly select_gender: "Select gender";
|
|
100
|
+
readonly gender_male: "Male";
|
|
101
|
+
readonly gender_female: "Female";
|
|
102
|
+
readonly gender_other: "Other";
|
|
103
|
+
readonly select_timezone: "Select a time zone";
|
|
104
|
+
readonly timezone_hint: "Choose a time zone from the list.";
|
|
105
|
+
readonly username_hint: "Use 3 to 30 characters: letters, numbers, dots, underscores or hyphens.";
|
|
106
|
+
readonly url_hint: "Enter a full URL, including https://";
|
|
107
|
+
readonly url_scheme_invalid: "Only http:// and https:// addresses are allowed.";
|
|
108
|
+
readonly photo_update_failed: "We couldn't update your photo. Please try again.";
|
|
109
|
+
readonly personal_update_failed: "We couldn't update your personal information. Please try again.";
|
|
110
|
+
readonly location_update_failed: "We couldn't update your location. Please try again.";
|
|
111
|
+
readonly website_update_failed: "We couldn't update your website. Please try again.";
|
|
112
|
+
readonly security_title: "Security settings";
|
|
113
|
+
readonly security_coming_soon: "Advanced security features are coming soon. Manage your passwords, two-factor authentication, active sessions and more in future updates.";
|
|
114
|
+
readonly profile_load_failed: "We couldn't load your profile. Please try again.";
|
|
115
|
+
readonly account_settings_unavailable: "Account settings aren't available in this app.";
|
|
116
|
+
readonly member_management_title: "Member management";
|
|
117
|
+
readonly member_management_subtitle: "Manage who belongs to this organization, their roles and invitations.";
|
|
118
|
+
readonly tab_members: "Members";
|
|
119
|
+
readonly tab_invitations: "Invitations";
|
|
120
|
+
readonly members_unavailable: "This app can't manage organization members.";
|
|
121
|
+
readonly members_forbidden: "You don't have permission to manage this organization's members.";
|
|
122
|
+
readonly members_load_failed: "We couldn't load this organization's members. Please try again.";
|
|
123
|
+
readonly members_no_organization: "Choose an organization to manage its members.";
|
|
124
|
+
readonly search_members: "Search members";
|
|
125
|
+
readonly search_invitations: "Search invitations";
|
|
126
|
+
readonly field_roles: "Roles";
|
|
127
|
+
readonly column_name: "Name";
|
|
128
|
+
readonly column_joined: "Joined";
|
|
129
|
+
readonly column_invited_by: "Invited by";
|
|
130
|
+
readonly column_sent: "Sent";
|
|
131
|
+
readonly column_expires: "Expires";
|
|
132
|
+
readonly members_empty: "No members found.";
|
|
133
|
+
readonly invitations_empty: "No pending invitations.";
|
|
134
|
+
readonly rows_per_page: "Rows per page";
|
|
135
|
+
readonly unknown_user: "Unknown user";
|
|
136
|
+
readonly manage_roles: "Manage roles";
|
|
137
|
+
readonly manage_roles_subtitle: "Choose the roles this member has in the organization.";
|
|
138
|
+
readonly roles_locked_hint: "Roles you can't assign or remove are locked.";
|
|
139
|
+
readonly roles_required: "Choose at least one role.";
|
|
140
|
+
readonly update_roles_failed: "We couldn't update this member's roles. Please try again.";
|
|
141
|
+
readonly self_role_change: "You can't change your own roles.";
|
|
142
|
+
readonly role_ceiling: "You can only assign or remove roles whose permissions you have yourself.";
|
|
143
|
+
readonly member_roles_changed: "This member's roles changed while you were editing. Review them and try again.";
|
|
144
|
+
readonly owner_transfer_required: "Only someone who can transfer ownership can give, change or remove the owner role.";
|
|
145
|
+
readonly leave_disabled: "This organization doesn't let members leave. Ask an administrator to remove you.";
|
|
146
|
+
readonly member_change_refused: "You can't make this change.";
|
|
147
|
+
readonly remove_member: "Remove member";
|
|
148
|
+
readonly remove_member_confirm: "Remove this member from the organization?";
|
|
149
|
+
readonly remove_member_warning: "They lose access to the organization immediately and need a new invitation to rejoin.";
|
|
150
|
+
readonly remove_member_failed: "We couldn't remove this member. Please try again.";
|
|
151
|
+
readonly resend_invitation: "Resend invitation";
|
|
152
|
+
readonly resend_invitation_confirm: "Send this invitation again?";
|
|
153
|
+
readonly resend_invitation_failed: "We couldn't resend this invitation. Please try again.";
|
|
154
|
+
readonly revoke_invitation: "Revoke invitation";
|
|
155
|
+
readonly revoke_invitation_confirm: "Revoke this invitation?";
|
|
156
|
+
readonly revoke_invitation_warning: "The invitation link stops working and can no longer be used to join.";
|
|
157
|
+
readonly revoke_invitation_failed: "We couldn't revoke this invitation. Please try again.";
|
|
158
|
+
readonly invite_members: "Invite members";
|
|
159
|
+
readonly invite_members_subtitle: "Invite people to this organization by email.";
|
|
160
|
+
readonly invite_emails_label: "Email addresses";
|
|
161
|
+
readonly invite_roles_hint: "The roles people will have when they join.";
|
|
162
|
+
readonly invite_message_label: "Personal message (optional)";
|
|
163
|
+
readonly invite_message_placeholder: "Add a note to the invitation email";
|
|
164
|
+
readonly send_invitations: "Send invitations";
|
|
165
|
+
readonly sending_invitations: "Sending";
|
|
166
|
+
readonly invite_failed: "We couldn't send the invitations. Please try again.";
|
|
167
|
+
readonly revoke_invitation_notify: "Email the invitee that the invitation was revoked";
|
|
42
168
|
};
|
|
43
169
|
export type KitMessageCode = keyof typeof KIT_MESSAGES_EN;
|
|
44
170
|
/**
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # Modal machinery: what Base UI's `modal` dialogs do beyond a popup
|
|
3
|
+
*
|
|
4
|
+
* Dialog, AlertDialog, Sheet and Drawer are popups (`PopupContent`: the top
|
|
5
|
+
* layer through the Popover API, the shared Escape / outside-press stack) that
|
|
6
|
+
* are also **modal**. Base UI gives a modal popup four extra behaviours, and
|
|
7
|
+
* each is one function here, so every modal surface shares them:
|
|
8
|
+
*
|
|
9
|
+
* | Base UI behaviour | Here |
|
|
10
|
+
* |------------------------------|-------------------------|
|
|
11
|
+
* | the page behind is inert | `inertOthers(keep)` |
|
|
12
|
+
* | the page does not scroll | `lockScroll()` |
|
|
13
|
+
* | Tab cycles inside the popup | `trapFocus(container)` |
|
|
14
|
+
* | initial / final focus | `tabbables()`, `initialFocusOf()` |
|
|
15
|
+
*
|
|
16
|
+
* Each returns its undo, so a root opens with `release = [a(), b(), c()]` and
|
|
17
|
+
* closes with `release.forEach(f => f())`. All of them nest: a dialog opened
|
|
18
|
+
* from a dialog keeps the outer one inert behind it, and closing the inner
|
|
19
|
+
* one restores exactly what it changed.
|
|
20
|
+
*
|
|
21
|
+
* Why not a native `<dialog>`: the host is the component's root
|
|
22
|
+
* (host-as-root), so the popup is the custom element itself, and a custom
|
|
23
|
+
* element cannot be a `<dialog>`. `showModal()` would also make every other
|
|
24
|
+
* top-layer element (a toast, a popup opened from inside) inert, which Base
|
|
25
|
+
* UI does not.
|
|
26
|
+
*/
|
|
27
|
+
/** Elements inside `root`, in tab order position, that Tab can reach (tabindex ≥ 0, visible, not inert). */
|
|
28
|
+
export declare function tabbables(root: Element): HTMLElement[];
|
|
29
|
+
/**
|
|
30
|
+
* Where focus goes when a modal opens (Base UI `initialFocus` default): an
|
|
31
|
+
* element marked `autofocus`, else the first tabbable element, else the popup.
|
|
32
|
+
*/
|
|
33
|
+
export declare function initialFocusOf(popup: HTMLElement): HTMLElement;
|
|
34
|
+
/**
|
|
35
|
+
* Makes everything outside `keep` inert: every sibling of `keep` and of each
|
|
36
|
+
* of its ancestors up to `<body>` (what `aria-hidden`'s `hideOthers` does,
|
|
37
|
+
* with `inert` so it also blocks focus and pointer input). The popup stays
|
|
38
|
+
* where the author wrote it, so its ancestors cannot be made inert
|
|
39
|
+
* themselves; their other children are. Elements the author already made
|
|
40
|
+
* inert are left alone and stay inert afterwards.
|
|
41
|
+
*/
|
|
42
|
+
export declare function inertOthers(keep: Element[]): () => void;
|
|
43
|
+
/**
|
|
44
|
+
* Stops the page scrolling while a modal is open (Base UI's scroll lock).
|
|
45
|
+
* The scrollbar's width is kept as padding, so the page does not shift
|
|
46
|
+
* sideways. Reference-counted: nested modals unlock once, when the last one
|
|
47
|
+
* closes.
|
|
48
|
+
*/
|
|
49
|
+
export declare function lockScroll(): () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Tab and Shift+Tab cycle through the tabbable elements of the top-most
|
|
52
|
+
* trapping container (Base UI's `FloatingFocusManager` with `modal`). Focus
|
|
53
|
+
* that lands outside it (a programmatic `focus()` on an exempt element is
|
|
54
|
+
* the only way, since the rest of the page is inert) is brought back.
|
|
55
|
+
*/
|
|
56
|
+
export declare function trapFocus(container: HTMLElement): () => void;
|
|
@@ -53,6 +53,13 @@ export declare abstract class PopupContent extends HostElement {
|
|
|
53
53
|
connectedCallback(): void;
|
|
54
54
|
disconnectedCallback(): void;
|
|
55
55
|
get isOpen(): boolean;
|
|
56
|
+
/** A modal popup (Dialog, Sheet …): an outside press reaches it and nothing below it. */
|
|
57
|
+
get isModal(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the popup is anchored to an element. Modal surfaces (Dialog,
|
|
60
|
+
* Sheet, Drawer) and the toaster lay themselves out in CSS and return false.
|
|
61
|
+
*/
|
|
62
|
+
protected get anchored(): boolean;
|
|
56
63
|
/** Select overrides this to lay the selected item over the trigger. */
|
|
57
64
|
protected alignItem(): HTMLElement | null;
|
|
58
65
|
/** True if the event path is inside this popup or one of its inside elements. */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Resolves once `popup` is open and its enter animation has finished. */
|
|
2
|
+
export declare function opened(popup: HTMLElement): Promise<void>;
|
|
3
|
+
/** Resolves once `popup` has left the top layer (its exit animation done). */
|
|
4
|
+
export declare function closed(popup: HTMLElement): Promise<void>;
|
|
5
|
+
/** Resolves once every running animation in the document has finished (none may be infinite). */
|
|
6
|
+
export declare function settle(): Promise<void>;
|