frontile 0.18.0-alpha.15 → 0.18.0-alpha.16
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/declarations/-private/control-blur.d.ts +63 -0
- package/declarations/-private/dialog.d.ts +15 -0
- package/declarations/components/collections/listbox/item.d.ts +6 -0
- package/declarations/components/collections/listbox/listbox.d.ts +1 -1
- package/declarations/components/collections/table/table.d.ts +3 -0
- package/declarations/components/forms/autocomplete.d.ts +37 -3
- package/declarations/components/forms/form-control.d.ts +5 -0
- package/declarations/components/forms/form-feedback.d.ts +22 -1
- package/declarations/components/forms/select/select.d.ts +30 -1
- package/declarations/components/forms/select/trigger.d.ts +6 -1
- package/declarations/components/forms/select/types.d.ts +18 -2
- package/declarations/components/notifications/notifications-container.d.ts +1 -0
- package/declarations/components/overlays/drawer/header.d.ts +14 -0
- package/declarations/components/overlays/drawer.d.ts +20 -1
- package/declarations/components/overlays/modal/header.d.ts +14 -0
- package/declarations/components/overlays/modal.d.ts +20 -1
- package/declarations/components/overlays/overlay.d.ts +1 -0
- package/declarations/components/overlays/popover.d.ts +28 -8
- package/declarations/components/status/progress-bar.d.ts +22 -2
- package/declarations/components/utilities/collapsible.d.ts +11 -1
- package/declarations/utils/listManager.d.ts +40 -1
- package/declarations/utils/standard-validator.d.ts +28 -3
- package/dist/components/collections/listbox/item.js +7 -4
- package/dist/components/collections/listbox/item.js.map +1 -1
- package/dist/components/collections/listbox/listbox.js +2 -2
- package/dist/components/collections/listbox/listbox.js.map +1 -1
- package/dist/components/collections/table/table.js +51 -6
- package/dist/components/collections/table/table.js.map +1 -1
- package/dist/components/forms/autocomplete.js +33 -12
- package/dist/components/forms/autocomplete.js.map +1 -1
- package/dist/components/forms/checkbox-group.js +1 -1
- package/dist/components/forms/checkbox-group.js.map +1 -1
- package/dist/components/forms/form-control.js +12 -3
- package/dist/components/forms/form-control.js.map +1 -1
- package/dist/components/forms/form-feedback.js +25 -8
- package/dist/components/forms/form-feedback.js.map +1 -1
- package/dist/components/forms/form.js +7 -4
- package/dist/components/forms/form.js.map +1 -1
- package/dist/components/forms/index.js +1 -1
- package/dist/components/forms/radio-group.js +1 -1
- package/dist/components/forms/radio-group.js.map +1 -1
- package/dist/components/forms/select/select.js +46 -16
- package/dist/components/forms/select/select.js.map +1 -1
- package/dist/components/forms/select/trigger.js +1 -1
- package/dist/components/forms/select/trigger.js.map +1 -1
- package/dist/components/notifications/index.js +1 -1
- package/dist/components/notifications/notification-card.js +15 -4
- package/dist/components/notifications/notification-card.js.map +1 -1
- package/dist/components/notifications/notifications-container.js +18 -7
- package/dist/components/notifications/notifications-container.js.map +1 -1
- package/dist/components/overlays/drawer/header.js +8 -1
- package/dist/components/overlays/drawer/header.js.map +1 -1
- package/dist/components/overlays/drawer.js +69 -1
- package/dist/components/overlays/drawer.js.map +1 -1
- package/dist/components/overlays/index.js +1 -1
- package/dist/components/overlays/modal/header.js +8 -1
- package/dist/components/overlays/modal/header.js.map +1 -1
- package/dist/components/overlays/modal.js +69 -1
- package/dist/components/overlays/modal.js.map +1 -1
- package/dist/components/overlays/overlay.js +37 -4
- package/dist/components/overlays/overlay.js.map +1 -1
- package/dist/components/overlays/popover.js +65 -14
- package/dist/components/overlays/popover.js.map +1 -1
- package/dist/components/overlays/portal.js +110 -8
- package/dist/components/overlays/portal.js.map +1 -1
- package/dist/components/status/progress-bar.js +40 -6
- package/dist/components/status/progress-bar.js.map +1 -1
- package/dist/components/utilities/collapsible.js +70 -9
- package/dist/components/utilities/collapsible.js.map +1 -1
- package/dist/control-blur-C8OnSQR5.js +124 -0
- package/dist/control-blur-C8OnSQR5.js.map +1 -0
- package/dist/dialog-CreV7aPQ.js +27 -0
- package/dist/dialog-CreV7aPQ.js.map +1 -0
- package/dist/dom-Dpb18UgD.js +116 -0
- package/dist/dom-Dpb18UgD.js.map +1 -0
- package/dist/forms.js +1 -1
- package/dist/index.js +3 -3
- package/dist/{manager-x3PBWzjm.js → manager-BA-8yKMJ.js} +14 -3
- package/dist/manager-BA-8yKMJ.js.map +1 -0
- package/dist/modifiers/press.js +51 -16
- package/dist/modifiers/press.js.map +1 -1
- package/dist/notifications.js +1 -1
- package/dist/overlays.js +1 -1
- package/dist/services/notifications.js +1 -1
- package/dist/utils/listManager.js +265 -54
- package/dist/utils/listManager.js.map +1 -1
- package/dist/utils/nested-data.js +50 -0
- package/dist/utils/nested-data.js.map +1 -1
- package/dist/utils/standard-validator.js +36 -6
- package/dist/utils/standard-validator.js.map +1 -1
- package/package.json +3 -3
- package/dist/manager-x3PBWzjm.js.map +0 -1
- package/dist/portal-D2m_lkn7.js +0 -168
- package/dist/portal-D2m_lkn7.js.map +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
interface ControlBlurTrackerOptions {
|
|
2
|
+
/**
|
|
3
|
+
* The element the popover's `trigger` modifier is installed on. Its
|
|
4
|
+
* `aria-controls` is how the portaled content is found, so this must be the
|
|
5
|
+
* element that opens the dropdown, not merely something inside the control.
|
|
6
|
+
*/
|
|
7
|
+
trigger: () => HTMLElement | null | undefined;
|
|
8
|
+
/** The control's outermost element: trigger, chips, clear button and all. */
|
|
9
|
+
container: () => HTMLElement | null | undefined;
|
|
10
|
+
/** Whether the control's dropdown is currently open. */
|
|
11
|
+
isOpen: () => boolean;
|
|
12
|
+
/** Whether the owning component has been (or is being) destroyed. */
|
|
13
|
+
isDestroyed: () => boolean;
|
|
14
|
+
/** Called once each time focus genuinely leaves the control. */
|
|
15
|
+
onBlur: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Decides when a composite control -- a trigger plus a dropdown -- has really
|
|
19
|
+
* lost focus, and reports it once.
|
|
20
|
+
*
|
|
21
|
+
* A trigger's own blur is not the answer. Clicking an option moves focus onto
|
|
22
|
+
* that option, which is *inside* the control as far as the user is concerned
|
|
23
|
+
* but is not a DOM descendant of the trigger: the popover content is portaled
|
|
24
|
+
* to the end of the document. And in multiple selection mode the dropdown
|
|
25
|
+
* stays open across several such clicks, so a trigger-blur-means-blur rule
|
|
26
|
+
* fires mid-interaction -- which is what made blur validation paint "pick at
|
|
27
|
+
* least three" under a field the user was still filling in.
|
|
28
|
+
*
|
|
29
|
+
* So the control is treated as two regions, the container and the popover
|
|
30
|
+
* content, and focus leaving one for the other is not a blur:
|
|
31
|
+
*
|
|
32
|
+
* - **`focusout` naming its destination** (`relatedTarget`) is answered
|
|
33
|
+
* immediately, with no timer at all. This covers every deliberate exit --
|
|
34
|
+
* Tab, or a click on another focusable thing -- and every move *into* the
|
|
35
|
+
* dropdown, including the option click that starts a selection.
|
|
36
|
+
* - **A targetless `focusout`** is deferred by {@link FOCUS_SETTLE_MS} and then
|
|
37
|
+
* judged on `document.activeElement`. Focus nowhere (`body`) while the
|
|
38
|
+
* dropdown is open is still part of the interaction -- a click on the
|
|
39
|
+
* dropdown's padding -- so it is not a blur; once the dropdown has closed,
|
|
40
|
+
* the same state means the user clicked away.
|
|
41
|
+
*
|
|
42
|
+
* The portaled content is located through the trigger's `aria-controls`, which
|
|
43
|
+
* the popover's trigger modifier sets to the content's id. That needs no extra
|
|
44
|
+
* plumbing through the popover and stays correct wherever the content is
|
|
45
|
+
* rendered.
|
|
46
|
+
*
|
|
47
|
+
* Callers must call {@link cancel} from `willDestroy`: a pending timer would
|
|
48
|
+
* otherwise resolve against a torn-down component and both write tracked state
|
|
49
|
+
* and call a callback the consumer has stopped expecting.
|
|
50
|
+
*/
|
|
51
|
+
declare class ControlBlurTracker {
|
|
52
|
+
#private;
|
|
53
|
+
private readonly options;
|
|
54
|
+
constructor(options: ControlBlurTrackerOptions);
|
|
55
|
+
/**
|
|
56
|
+
* Wire this to `focusout` on the trigger -- not `blur`, whose
|
|
57
|
+
* `relatedTarget` browsers are not obliged to populate.
|
|
58
|
+
*/
|
|
59
|
+
handleFocusOut: (event: FocusEvent) => void;
|
|
60
|
+
/** Cancels a pending decision. Call from the owner's `willDestroy`. */
|
|
61
|
+
cancel: () => void;
|
|
62
|
+
}
|
|
63
|
+
export { ControlBlurTracker, type ControlBlurTrackerOptions };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Warns when a dialog ends up with no accessible name at all — no registered
|
|
3
|
+
* `Header`, and no `aria-label`/`aria-labelledby` of the consumer's own.
|
|
4
|
+
* Assistive technology announces such a dialog as just "dialog", and nothing
|
|
5
|
+
* else surfaces the mistake at runtime.
|
|
6
|
+
*
|
|
7
|
+
* Consumer-supplied names arrive through `...attributes`, which the component
|
|
8
|
+
* cannot see in its args, so this inspects the rendered element for them. A
|
|
9
|
+
* heading merely carrying `headerId` deliberately does *not* count: nothing
|
|
10
|
+
* points `aria-labelledby` at it, so the dialog really is unnamed, and that is
|
|
11
|
+
* the case most worth surfacing.
|
|
12
|
+
*
|
|
13
|
+
* `warn` is stripped from production builds, so this costs consumers nothing.
|
|
14
|
+
*/
|
|
15
|
+
export declare function warnIfDialogHasNoAccessibleName(element: Element, hasRegisteredHeader: boolean, component: 'modal' | 'drawer'): void;
|
|
@@ -44,6 +44,12 @@ declare class ListboxItem extends Component<ListboxItemSignature> {
|
|
|
44
44
|
get key(): string;
|
|
45
45
|
onRegister(item: ListItem): void;
|
|
46
46
|
onClick(): void;
|
|
47
|
+
/**
|
|
48
|
+
* A roving tabindex: the manager nominates one option as the composite's tab
|
|
49
|
+
* stop and every other option stays out of the tab order, as the ARIA
|
|
50
|
+
* listbox pattern requires. Giving a `0` to each active *or selected* option
|
|
51
|
+
* turned a multi-select with eight selections into eight tab stops.
|
|
52
|
+
*/
|
|
47
53
|
get tabindex(): 0 | -1;
|
|
48
54
|
get classNames(): {
|
|
49
55
|
base: string;
|
|
@@ -147,8 +147,11 @@ declare class Table<T = unknown, TColumns extends ColumnConfig<T>[] = ColumnConf
|
|
|
147
147
|
get hasSelection(): boolean;
|
|
148
148
|
get selectedKeysSet(): Set<string>;
|
|
149
149
|
get disabledKeysSet(): Set<string>;
|
|
150
|
+
activeRowKey?: string;
|
|
150
151
|
getRowData: (row: Row<T>) => T;
|
|
151
152
|
getKey: (itemOrRow: T | Row<T>) => string;
|
|
153
|
+
get rovingRowKey(): string | undefined;
|
|
154
|
+
rowTabIndex: (row: Row<T>) => string;
|
|
152
155
|
isKeyDisabled: (key: string) => boolean;
|
|
153
156
|
handleSelect: (key: string) => void;
|
|
154
157
|
handleDeselect: (key: string) => void;
|
|
@@ -3,6 +3,7 @@ import type Owner from '@ember/owner';
|
|
|
3
3
|
import { type ListItem } from './native-select';
|
|
4
4
|
import { type ListboxSignature } from '../collections/listbox';
|
|
5
5
|
import { type AutocompleteSlots, type AutocompleteVariants, type SlotsToClasses } from '@frontile/theme';
|
|
6
|
+
import { ControlBlurTracker } from '../../-private/control-blur';
|
|
6
7
|
import { type PopoverSignature, type ContentSignature } from '../overlays/popover';
|
|
7
8
|
import { type FormControlSharedArgs } from './form-control';
|
|
8
9
|
interface AutocompleteArgs<T> extends Pick<PopoverSignature['Args'], 'placement' | 'flipOptions' | 'middleware' | 'shiftOptions' | 'offsetOptions' | 'strategy' | 'didClose'>, Pick<ListboxSignature<T>['Args'], 'appearance' | 'intent' | 'disabledKeys' | 'allowEmpty' | 'items' | 'onAction'>, Pick<ContentSignature['Args'], 'renderInPlace' | 'target' | 'transitionDuration' | 'backdrop' | 'disableTransitions' | 'focusTrapOptions' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'backdropTransition' | 'transition'>, FormControlSharedArgs {
|
|
@@ -141,7 +142,14 @@ interface AutocompleteArgs<T> extends Pick<PopoverSignature['Args'], 'placement'
|
|
|
141
142
|
/**
|
|
142
143
|
* Whether to include a clear button in the autocomplete component.
|
|
143
144
|
* If enabled, this allows users to clear the selection and input text.
|
|
144
|
-
*
|
|
145
|
+
*
|
|
146
|
+
* This option deliberately overrides `allowEmpty`: that argument governs
|
|
147
|
+
* deselecting an *option* in the listbox, while this is a separate affordance
|
|
148
|
+
* you opt into for exactly the purpose of emptying the field. Since
|
|
149
|
+
* `allowEmpty` defaults to false, honouring it here would render the button
|
|
150
|
+
* dead by default.
|
|
151
|
+
*
|
|
152
|
+
* No clear button is rendered on a disabled Autocomplete.
|
|
145
153
|
*
|
|
146
154
|
* @defaultValue false
|
|
147
155
|
*/
|
|
@@ -175,7 +183,16 @@ interface AutocompleteArgs<T> extends Pick<PopoverSignature['Args'], 'placement'
|
|
|
175
183
|
*/
|
|
176
184
|
searchMessage?: string;
|
|
177
185
|
/**
|
|
178
|
-
* Callback fired when
|
|
186
|
+
* Callback fired when focus leaves the Autocomplete.
|
|
187
|
+
*
|
|
188
|
+
* "Leaves the Autocomplete" means the whole control: the input *and* its
|
|
189
|
+
* dropdown, which is rendered outside the input in the DOM. Moving focus
|
|
190
|
+
* between them -- which is what clicking an option does -- is not a blur, so
|
|
191
|
+
* this does not fire while the user is picking an option. It fires once, when
|
|
192
|
+
* focus lands somewhere outside the control (or nowhere, with the dropdown
|
|
193
|
+
* closed).
|
|
194
|
+
*
|
|
195
|
+
* This is what `Field` drives blur validation from.
|
|
179
196
|
*/
|
|
180
197
|
onBlur?: () => void;
|
|
181
198
|
}
|
|
@@ -285,7 +302,12 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
285
302
|
get blockScroll(): boolean;
|
|
286
303
|
get disableFocusTrap(): boolean;
|
|
287
304
|
onAction: (key: string) => void;
|
|
288
|
-
|
|
305
|
+
/**
|
|
306
|
+
* Reports focus leaving the *whole* control -- the input and its portaled
|
|
307
|
+
* dropdown -- rather than the input, which blurs on the way into the
|
|
308
|
+
* dropdown whenever an option is clicked. See `ControlBlurTracker`.
|
|
309
|
+
*/
|
|
310
|
+
blurTracker: ControlBlurTracker;
|
|
289
311
|
clearSelectedKeys: () => void;
|
|
290
312
|
onItemsChange: (nodes: ListItem[], _: "add" | "remove") => void;
|
|
291
313
|
didClose: () => void;
|
|
@@ -385,6 +407,18 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
385
407
|
hasChips?: boolean | undefined;
|
|
386
408
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
387
409
|
} & {};
|
|
410
|
+
/**
|
|
411
|
+
* Whether the clear button takes the chevron's place: something to clear,
|
|
412
|
+
* and a control that can act on it.
|
|
413
|
+
*
|
|
414
|
+
* `@allowEmpty` is deliberately not consulted -- it governs deselecting an
|
|
415
|
+
* *option* in the listbox, while `@isClearable` is a separate affordance the
|
|
416
|
+
* consumer opts into for exactly this purpose (and `@allowEmpty` defaults to
|
|
417
|
+
* false, so honouring it here would leave the button dead by default). A
|
|
418
|
+
* disabled Autocomplete shows no clear button at all: it carries no disabled
|
|
419
|
+
* state of its own, so it would be a focusable button that clears a field
|
|
420
|
+
* the user is not allowed to change.
|
|
421
|
+
*/
|
|
388
422
|
get isClearable(): boolean | undefined;
|
|
389
423
|
get isLoading(): boolean;
|
|
390
424
|
get filteredItems(): T[] | undefined;
|
|
@@ -90,6 +90,11 @@ declare class FormControl extends Component<FormControlSignature> {
|
|
|
90
90
|
get feedbackId(): string;
|
|
91
91
|
describedBy: (hasDescription?: string | boolean, hasFeedback?: string | boolean) => string | undefined;
|
|
92
92
|
get isInvalid(): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* The error messages as a single string, used by the persistent live region.
|
|
95
|
+
* Uses `FormFeedback`'s own join, so both render the same separator.
|
|
96
|
+
*/
|
|
97
|
+
get errorMessageText(): string;
|
|
93
98
|
get showErrorFeedback(): boolean;
|
|
94
99
|
}
|
|
95
100
|
export { FormControl, type FormControlSignature, type FormControlSharedArgs };
|
|
@@ -24,6 +24,15 @@ interface FormFeedbackSignature {
|
|
|
24
24
|
* @defaultValue 'md'
|
|
25
25
|
*/
|
|
26
26
|
size?: FormFeedbackVariants['size'];
|
|
27
|
+
/**
|
|
28
|
+
* Whether the element is itself an `aria-live` region. Set this to `false`
|
|
29
|
+
* when something else (such as `FormControl`, which keeps a persistent
|
|
30
|
+
* live region in the DOM) already announces the messages, so they are not
|
|
31
|
+
* announced twice.
|
|
32
|
+
*
|
|
33
|
+
* @defaultValue true
|
|
34
|
+
*/
|
|
35
|
+
announce?: boolean;
|
|
27
36
|
/**
|
|
28
37
|
* Class names for the feedback element, merged with the theme's.
|
|
29
38
|
*/
|
|
@@ -34,10 +43,22 @@ interface FormFeedbackSignature {
|
|
|
34
43
|
default: [];
|
|
35
44
|
};
|
|
36
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Renders feedback messages as a single string. An array is joined with `; `.
|
|
48
|
+
*
|
|
49
|
+
* Shared with `FormControl`, whose persistent live region announces the same
|
|
50
|
+
* text, so both render an identical separator.
|
|
51
|
+
*
|
|
52
|
+
* @param messages A list of messages or a single message string.
|
|
53
|
+
* @returns The messages as one string, or an empty string when there are none.
|
|
54
|
+
*/
|
|
55
|
+
declare function feedbackMessageText(messages: string[] | string | undefined): string;
|
|
37
56
|
declare class FormFeedback extends Component<FormFeedbackSignature> {
|
|
38
57
|
get isError(): boolean;
|
|
39
58
|
get classes(): string;
|
|
59
|
+
get announce(): boolean;
|
|
60
|
+
get ariaLive(): string | undefined;
|
|
40
61
|
get messageText(): string;
|
|
41
62
|
}
|
|
42
|
-
export { FormFeedback, type FormFeedbackSignature };
|
|
63
|
+
export { FormFeedback, feedbackMessageText, type FormFeedbackSignature };
|
|
43
64
|
export default FormFeedback;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import type Owner from '@ember/owner';
|
|
3
3
|
import type { ListItem } from '../native-select';
|
|
4
|
+
import { ControlBlurTracker } from '../../../-private/control-blur';
|
|
4
5
|
import type { ResolvedSelectChipOptions, SelectArgs, SelectChipOptions, SelectSignature, SelectedItem, SelectedItemBlockArg } from './types';
|
|
5
6
|
/**
|
|
6
7
|
* A dropdown selection component: a custom listbox in a popover, backed by a
|
|
@@ -156,7 +157,13 @@ declare class Select<T = unknown> extends Component<SelectSignature<T>> {
|
|
|
156
157
|
get blockScroll(): boolean;
|
|
157
158
|
get disableFocusTrap(): boolean;
|
|
158
159
|
onAction: (key: string) => void;
|
|
159
|
-
|
|
160
|
+
/**
|
|
161
|
+
* Reports focus leaving the *whole* control -- the field and its portaled
|
|
162
|
+
* dropdown -- rather than the trigger, which blurs on the way into the
|
|
163
|
+
* dropdown and on every option click. See `ControlBlurTracker`.
|
|
164
|
+
*/
|
|
165
|
+
blurTracker: ControlBlurTracker;
|
|
166
|
+
willDestroy(): void;
|
|
160
167
|
/**
|
|
161
168
|
* In chips mode the trigger is only as wide as the room left over beside the
|
|
162
169
|
* chips, so the field's padding -- and the strip under the chevron -- are not
|
|
@@ -173,6 +180,21 @@ declare class Select<T = unknown> extends Component<SelectSignature<T>> {
|
|
|
173
180
|
* too, since it already handles its own clicks.
|
|
174
181
|
*/
|
|
175
182
|
handleFieldClick: (event: MouseEvent) => void;
|
|
183
|
+
/**
|
|
184
|
+
* Wipes the selection from the clear button.
|
|
185
|
+
*
|
|
186
|
+
* Unlike the chips and the listbox options, this deliberately does *not*
|
|
187
|
+
* consult `@allowEmpty`. `@allowEmpty` governs deselecting *an option* --
|
|
188
|
+
* the listbox refuses to let the last one be toggled off, and
|
|
189
|
+
* `chipsRemovable` mirrors that -- whereas `@isClearable` is a separate,
|
|
190
|
+
* explicit affordance the consumer opts into for exactly this purpose. It
|
|
191
|
+
* also defaults to `false`, so honouring it here would render the clear
|
|
192
|
+
* button dead in every default configuration. Documented as an override on
|
|
193
|
+
* `@isClearable` itself; the two must keep saying the same thing.
|
|
194
|
+
*
|
|
195
|
+
* A disabled Select renders no clear button at all (see `isClearable`), so
|
|
196
|
+
* there is nothing to guard here.
|
|
197
|
+
*/
|
|
176
198
|
clearSelectedKeys: () => void;
|
|
177
199
|
/**
|
|
178
200
|
* Resolved chip appearance: `@chip` wins, then the Select's own `@intent`,
|
|
@@ -383,6 +405,13 @@ declare class Select<T = unknown> extends Component<SelectSignature<T>> {
|
|
|
383
405
|
isFilterable?: boolean | undefined;
|
|
384
406
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
385
407
|
} & {};
|
|
408
|
+
/**
|
|
409
|
+
* Whether the clear button takes the chevron's place: something to clear,
|
|
410
|
+
* and a control that can act on it. A disabled Select never shows it -- the
|
|
411
|
+
* end-content cluster is not pointer-transparent to it and it carries no
|
|
412
|
+
* disabled state of its own, so it would otherwise be a focusable button
|
|
413
|
+
* that clears a field the user is not allowed to change.
|
|
414
|
+
*/
|
|
386
415
|
get isClearable(): boolean | undefined;
|
|
387
416
|
get filterFieldValue(): string;
|
|
388
417
|
get filteredItems(): T[] | undefined;
|
|
@@ -51,7 +51,12 @@ interface SelectTriggerSignature {
|
|
|
51
51
|
onFilterInput: (event: Event) => void;
|
|
52
52
|
onFilterKeydown: (event: KeyboardEvent) => void;
|
|
53
53
|
onKeydown: (event: KeyboardEvent) => void;
|
|
54
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Reports the trigger losing focus, as `focusout` rather than `blur`: the
|
|
56
|
+
* Select decides whether focus actually left the control from the event's
|
|
57
|
+
* `relatedTarget`, and browsers only guarantee that on `focusout`.
|
|
58
|
+
*/
|
|
59
|
+
onFocusOut: (event: FocusEvent) => void;
|
|
55
60
|
};
|
|
56
61
|
Blocks: {
|
|
57
62
|
/**
|
|
@@ -300,7 +300,14 @@ type SelectArgs<T> = (ExplicitSingleSelectArgs<T> | DefaultSingleSelectArgs<T> |
|
|
|
300
300
|
/**
|
|
301
301
|
* Whether to include a clear button in the select component.
|
|
302
302
|
* If enabled, this allows users to clear the selection.
|
|
303
|
-
*
|
|
303
|
+
*
|
|
304
|
+
* This option deliberately overrides `allowEmpty`: that argument governs
|
|
305
|
+
* deselecting an *option* (the listbox and the chips both refuse to remove
|
|
306
|
+
* the last one without it), while this is a separate affordance you opt into
|
|
307
|
+
* for exactly the purpose of emptying the field. Since `allowEmpty` defaults
|
|
308
|
+
* to false, honouring it here would render the button dead by default.
|
|
309
|
+
*
|
|
310
|
+
* No clear button is rendered on a disabled Select, or with nothing selected.
|
|
304
311
|
*
|
|
305
312
|
* @defaultValue false
|
|
306
313
|
*/
|
|
@@ -327,7 +334,16 @@ type SelectArgs<T> = (ExplicitSingleSelectArgs<T> | DefaultSingleSelectArgs<T> |
|
|
|
327
334
|
*/
|
|
328
335
|
hideEmptyContent?: boolean;
|
|
329
336
|
/**
|
|
330
|
-
* Callback fired when
|
|
337
|
+
* Callback fired when focus leaves the Select.
|
|
338
|
+
*
|
|
339
|
+
* "Leaves the Select" means the whole control: the field *and* its dropdown,
|
|
340
|
+
* which is rendered outside the field in the DOM. Moving focus between them
|
|
341
|
+
* -- which is what clicking an option does -- is not a blur, so this does not
|
|
342
|
+
* fire while the user is picking options, in either selection mode. It fires
|
|
343
|
+
* once, when focus lands somewhere outside the control (or nowhere, with the
|
|
344
|
+
* dropdown closed).
|
|
345
|
+
*
|
|
346
|
+
* This is what `Field` drives blur validation from.
|
|
331
347
|
*/
|
|
332
348
|
onBlur?: () => void;
|
|
333
349
|
};
|
|
@@ -31,6 +31,7 @@ interface NotificationsContainerSignature {
|
|
|
31
31
|
declare class NotificationsContainer extends Component<NotificationsContainerSignature> {
|
|
32
32
|
notifications: NotificationsService;
|
|
33
33
|
constructor(owner: Owner, args: NotificationsContainerSignature['Args']);
|
|
34
|
+
handleDismiss: (notification: Notification<Record<string, unknown>>) => void;
|
|
34
35
|
get isTopPlacement(): boolean;
|
|
35
36
|
get sortedNotifications(): Notification[];
|
|
36
37
|
get classes(): string;
|
|
@@ -9,6 +9,13 @@ export interface DrawerHeaderArgs {
|
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
11
|
classFromParent?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Called with `true` when this header is rendered and `false` when it is
|
|
14
|
+
* removed, so the Drawer knows whether it may point `aria-labelledby` at us.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
registerSelf?: (isRendered: boolean) => void;
|
|
12
19
|
}
|
|
13
20
|
export interface DrawerHeaderSignature {
|
|
14
21
|
Args: DrawerHeaderArgs;
|
|
@@ -18,4 +25,11 @@ export interface DrawerHeaderSignature {
|
|
|
18
25
|
};
|
|
19
26
|
}
|
|
20
27
|
export default class DrawerHeader extends Component<DrawerHeaderSignature> {
|
|
28
|
+
register: import("ember-modifier").FunctionBasedModifier<{
|
|
29
|
+
Args: {
|
|
30
|
+
Positional: unknown[];
|
|
31
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
32
|
+
};
|
|
33
|
+
Element: Element;
|
|
34
|
+
}>;
|
|
21
35
|
}
|
|
@@ -55,7 +55,7 @@ export interface DrawerSignature {
|
|
|
55
55
|
default: [
|
|
56
56
|
{
|
|
57
57
|
CloseButton: WithBoundArgs<ComponentLike<CloseButtonSignature>, 'onPress' | 'class'>;
|
|
58
|
-
Header: WithBoundArgs<ComponentLike<DrawerHeaderSignature>, 'labelledById' | 'classFromParent'>;
|
|
58
|
+
Header: WithBoundArgs<ComponentLike<DrawerHeaderSignature>, 'labelledById' | 'classFromParent' | 'registerSelf'>;
|
|
59
59
|
Body: WithBoundArgs<ComponentLike<DrawerBodySignature>, 'classFromParent'>;
|
|
60
60
|
Footer: WithBoundArgs<ComponentLike<DrawerFooterSignature>, 'classFromParent'>;
|
|
61
61
|
headerId: string;
|
|
@@ -66,6 +66,25 @@ export interface DrawerSignature {
|
|
|
66
66
|
}
|
|
67
67
|
export default class Drawer extends Component<DrawerSignature> {
|
|
68
68
|
headerId: string;
|
|
69
|
+
renderedHeaders: number;
|
|
70
|
+
hasHeader: boolean;
|
|
71
|
+
registerHeader: (isRendered: boolean) => void;
|
|
72
|
+
get labelledById(): string | undefined;
|
|
73
|
+
warnIfUnnamed: import("ember-modifier").FunctionBasedModifier<{
|
|
74
|
+
Args: {
|
|
75
|
+
Positional: unknown[];
|
|
76
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
77
|
+
};
|
|
78
|
+
Element: HTMLElement;
|
|
79
|
+
}>;
|
|
80
|
+
/**
|
|
81
|
+
* `aria-modal="true"` promises assistive technology that the rest of the page
|
|
82
|
+
* is unreachable while this dialog is open. That promise only holds while the
|
|
83
|
+
* overlay's focus trap is active, so when the consumer turns the trap off we
|
|
84
|
+
* omit the attribute rather than lie about it — screen readers then keep
|
|
85
|
+
* exposing the page behind, which is what actually happens.
|
|
86
|
+
*/
|
|
87
|
+
get ariaModal(): 'true' | undefined;
|
|
69
88
|
get preventClosing(): boolean;
|
|
70
89
|
get showCloseButton(): boolean;
|
|
71
90
|
get placement(): "bottom" | "left" | "right" | "top";
|
|
@@ -9,6 +9,13 @@ export interface ModalHeaderArgs {
|
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
11
|
classFromParent?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Called with `true` when this header is rendered and `false` when it is
|
|
14
|
+
* removed, so the Modal knows whether it may point `aria-labelledby` at us.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
registerSelf?: (isRendered: boolean) => void;
|
|
12
19
|
}
|
|
13
20
|
export interface ModalHeaderSignature {
|
|
14
21
|
Args: ModalHeaderArgs;
|
|
@@ -18,4 +25,11 @@ export interface ModalHeaderSignature {
|
|
|
18
25
|
};
|
|
19
26
|
}
|
|
20
27
|
export default class ModalHeader extends Component<ModalHeaderSignature> {
|
|
28
|
+
register: import("ember-modifier").FunctionBasedModifier<{
|
|
29
|
+
Args: {
|
|
30
|
+
Positional: unknown[];
|
|
31
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
32
|
+
};
|
|
33
|
+
Element: Element;
|
|
34
|
+
}>;
|
|
21
35
|
}
|
|
@@ -54,7 +54,7 @@ export interface ModalSignature {
|
|
|
54
54
|
default: [
|
|
55
55
|
{
|
|
56
56
|
CloseButton: WithBoundArgs<ComponentLike<CloseButtonSignature>, 'onPress' | 'class'>;
|
|
57
|
-
Header: WithBoundArgs<ComponentLike<ModalHeaderSignature>, 'labelledById' | 'classFromParent'>;
|
|
57
|
+
Header: WithBoundArgs<ComponentLike<ModalHeaderSignature>, 'labelledById' | 'classFromParent' | 'registerSelf'>;
|
|
58
58
|
Body: WithBoundArgs<ComponentLike<ModalBodySignature>, 'classFromParent'>;
|
|
59
59
|
Footer: WithBoundArgs<ComponentLike<ModalFooterSignature>, 'classFromParent'>;
|
|
60
60
|
headerId: string;
|
|
@@ -65,6 +65,25 @@ export interface ModalSignature {
|
|
|
65
65
|
}
|
|
66
66
|
export default class Modal extends Component<ModalSignature> {
|
|
67
67
|
headerId: string;
|
|
68
|
+
renderedHeaders: number;
|
|
69
|
+
hasHeader: boolean;
|
|
70
|
+
registerHeader: (isRendered: boolean) => void;
|
|
71
|
+
get labelledById(): string | undefined;
|
|
72
|
+
warnIfUnnamed: import("ember-modifier").FunctionBasedModifier<{
|
|
73
|
+
Args: {
|
|
74
|
+
Positional: unknown[];
|
|
75
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
76
|
+
};
|
|
77
|
+
Element: HTMLElement;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* `aria-modal="true"` promises assistive technology that the rest of the page
|
|
81
|
+
* is unreachable while this dialog is open. That promise only holds while the
|
|
82
|
+
* overlay's focus trap is active, so when the consumer turns the trap off we
|
|
83
|
+
* omit the attribute rather than lie about it — screen readers then keep
|
|
84
|
+
* exposing the page behind, which is what actually happens.
|
|
85
|
+
*/
|
|
86
|
+
get ariaModal(): 'true' | undefined;
|
|
68
87
|
get preventClosing(): boolean;
|
|
69
88
|
get showCloseButton(): boolean;
|
|
70
89
|
get size(): "xs" | "sm" | "md" | "lg" | "xl" | "full";
|
|
@@ -129,6 +129,7 @@ declare class Overlay extends Component<OverlaySignature> {
|
|
|
129
129
|
contentElement: HTMLElement | undefined;
|
|
130
130
|
focusedElement: Element | null | undefined;
|
|
131
131
|
mouseDownContentElement: EventTarget | null;
|
|
132
|
+
didLockBodyScroll: boolean;
|
|
132
133
|
handleClose(): void;
|
|
133
134
|
handleContentClick(event: MouseEvent): void;
|
|
134
135
|
handleOutsideClick(e: Event): void;
|
|
@@ -78,7 +78,6 @@ interface PopoverSignature {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
declare class Popover extends Component<PopoverSignature> {
|
|
81
|
-
triggerEl?: HTMLElement;
|
|
82
81
|
/**
|
|
83
82
|
* The element `measureWidth` is watching, when a consumer opts into measuring
|
|
84
83
|
* something other than the trigger. Its presence is what gives `measureWidth`
|
|
@@ -86,6 +85,13 @@ declare class Popover extends Component<PopoverSignature> {
|
|
|
86
85
|
*/
|
|
87
86
|
widthEl?: HTMLElement;
|
|
88
87
|
menuId: string;
|
|
88
|
+
/**
|
|
89
|
+
* Whether the consumer is still owed a `@didClose`. Set by `close()` when a
|
|
90
|
+
* popover that was actually open was closed, and cleared either by `didClose`
|
|
91
|
+
* once it has fired the callback -- so it can only ever fire once per close --
|
|
92
|
+
* or by `open()`, which means the close it was armed for never completed.
|
|
93
|
+
*/
|
|
94
|
+
isDidClosePending: boolean;
|
|
89
95
|
_isOpen: boolean;
|
|
90
96
|
isClosing: boolean;
|
|
91
97
|
preventFocusRestore: boolean;
|
|
@@ -121,13 +127,27 @@ declare class Popover extends Component<PopoverSignature> {
|
|
|
121
127
|
};
|
|
122
128
|
Element: HTMLElement;
|
|
123
129
|
}>;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
/**
|
|
131
|
+
* Clears the short window during which `open()` refuses to re-open.
|
|
132
|
+
*
|
|
133
|
+
* The 90ms this is debounced by is deliberately not the transition duration
|
|
134
|
+
* (200ms): the window exists to absorb a single event cascade -- the Overlay's
|
|
135
|
+
* outside-click handler closing while the trigger's own click handler is
|
|
136
|
+
* about to re-open -- not to wait for the animation out. Stretching it to the
|
|
137
|
+
* transition would leave the trigger feeling dead for a fifth of a second
|
|
138
|
+
* after every close, which is far more noticeable than a re-click inside 90ms
|
|
139
|
+
* being dropped.
|
|
140
|
+
*/
|
|
141
|
+
resetIsClosing: () => void;
|
|
142
|
+
/**
|
|
143
|
+
* Passed to `Content` as `internalDidClose`, so it runs once the Overlay has
|
|
144
|
+
* finished tearing down -- that is, after the exit transition. That is the
|
|
145
|
+
* moment `@didClose` documents, which is why the consumer's callback is fired
|
|
146
|
+
* from here and not from `close()`.
|
|
147
|
+
*
|
|
148
|
+
* A popover whose `Content` never mounted never gets here, and never owes the
|
|
149
|
+
* callback: there was no overlay, so there was no close to finish.
|
|
150
|
+
*/
|
|
131
151
|
didClose: () => void;
|
|
132
152
|
}
|
|
133
153
|
interface ContentArgs extends Pick<OverlaySignature['Args'], 'onOpen' | 'didClose' | 'renderInPlace' | 'target' | 'transitionDuration' | 'backdrop' | 'disableTransitions' | 'focusTrapOptions' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'backdropTransition' | 'blockScroll' | 'preventAutoFocus'> {
|
|
@@ -52,8 +52,11 @@ interface ProgressBarSignature {
|
|
|
52
52
|
*/
|
|
53
53
|
showValueLabel?: boolean;
|
|
54
54
|
/**
|
|
55
|
-
* The display format of the value.
|
|
56
|
-
*
|
|
55
|
+
* The display format of the value, passed to `Intl.NumberFormat`.
|
|
56
|
+
*
|
|
57
|
+
* A `percent` style formats the position on the min/max scale as a
|
|
58
|
+
* fraction; every other style formats the raw `progress` value. With no
|
|
59
|
+
* format options, the value is displayed as a whole percentage.
|
|
57
60
|
*/
|
|
58
61
|
formatOptions?: Intl.NumberFormatOptions;
|
|
59
62
|
/**
|
|
@@ -80,13 +83,30 @@ declare class ProgressBar extends Component<ProgressBarSignature> {
|
|
|
80
83
|
};
|
|
81
84
|
get minValue(): number;
|
|
82
85
|
get maxValue(): number;
|
|
86
|
+
/**
|
|
87
|
+
* `@progress={{0}}` is a legitimate value, so this falls back to `minValue`
|
|
88
|
+
* only when nothing was passed — a truthiness check would report the bar as
|
|
89
|
+
* already at the bottom of the scale instead of at zero.
|
|
90
|
+
*/
|
|
83
91
|
get progress(): number;
|
|
92
|
+
/**
|
|
93
|
+
* The position on the scale as 0–100. Clamped, because the result drives an
|
|
94
|
+
* inline `width` — an out-of-range or `NaN` percentage is dropped by the CSS
|
|
95
|
+
* parser, which renders as a silently empty bar rather than as an error.
|
|
96
|
+
* A non-positive range has no meaningful position, so it reports 0.
|
|
97
|
+
*/
|
|
84
98
|
get percentage(): number;
|
|
85
99
|
get showValueLabel(): boolean;
|
|
86
100
|
get formattedValueLabel(): string;
|
|
87
101
|
/**
|
|
88
102
|
* ARIA requires aria-valuenow to be absent when the value is unknown —
|
|
89
103
|
* reporting a number would announce "0%" rather than "amount unknown".
|
|
104
|
+
*
|
|
105
|
+
* Otherwise it is clamped to the scale, because assistive technology
|
|
106
|
+
* announces a percentage computed from valuenow/valuemin/valuemax. Reporting
|
|
107
|
+
* a raw 150 on a 0–100 scale would say "150%" to a screen-reader user while
|
|
108
|
+
* the bar sits pinned at 100% for everyone else — the people who cannot see
|
|
109
|
+
* the bar would be the only ones given the wrong number.
|
|
90
110
|
*/
|
|
91
111
|
get ariaValueNow(): number | undefined;
|
|
92
112
|
get progressWidth(): SafeString;
|
|
@@ -8,7 +8,9 @@ interface CollapsibleArgs {
|
|
|
8
8
|
isOpen: boolean;
|
|
9
9
|
/**
|
|
10
10
|
* The height for the content in it's collapsed state.
|
|
11
|
-
* The unit of the value should be included, eg. '10px'.
|
|
11
|
+
* The unit of the value should be included, eg. '10px'. Any CSS height is
|
|
12
|
+
* accepted (`2rem`, `50%`, `calc(1rem + 2px)`, …); a value the CSS parser
|
|
13
|
+
* rejects is ignored and the content collapses to `0`.
|
|
12
14
|
*
|
|
13
15
|
* @defaultValue 0
|
|
14
16
|
*/
|
|
@@ -26,6 +28,12 @@ declare class Collapsible extends Component<CollapsibleSignature> {
|
|
|
26
28
|
waiterToken?: unknown;
|
|
27
29
|
isCurrentlyOpen: boolean;
|
|
28
30
|
constructor(owner: Owner, args: CollapsibleArgs);
|
|
31
|
+
/**
|
|
32
|
+
* `@initialHeight`, validated by the CSS parser. `undefined` when it was not
|
|
33
|
+
* given or could not be parsed as a height, in which case the collapsed
|
|
34
|
+
* state falls back to `0`.
|
|
35
|
+
*/
|
|
36
|
+
get initialHeight(): string | undefined;
|
|
29
37
|
get styles(): ReturnType<typeof safeStyles>;
|
|
30
38
|
hasSetupUpdate: boolean;
|
|
31
39
|
update: import("ember-modifier").FunctionBasedModifier<{
|
|
@@ -35,6 +43,8 @@ declare class Collapsible extends Component<CollapsibleSignature> {
|
|
|
35
43
|
};
|
|
36
44
|
Element: HTMLElement;
|
|
37
45
|
}>;
|
|
46
|
+
endWaiter(): void;
|
|
47
|
+
willDestroy(): void;
|
|
38
48
|
onTransitionEnd: (event: TransitionEvent) => void;
|
|
39
49
|
heightTransition(duration: number): string;
|
|
40
50
|
opacityTransition(duration: number): string;
|