frontile 0.18.0-alpha.13 → 0.18.0-alpha.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.
- package/declarations/components/buttons/chip.d.ts +35 -4
- package/declarations/components/collections/dropdown.d.ts +18 -0
- package/declarations/components/collections/listbox/item.d.ts +13 -0
- package/declarations/components/collections/listbox/listbox.d.ts +15 -6
- package/declarations/components/forms/autocomplete.d.ts +13 -5
- package/declarations/components/forms/checkbox-group.d.ts +20 -0
- package/declarations/components/forms/checkbox.d.ts +22 -0
- package/declarations/components/forms/form-control.d.ts +49 -0
- package/declarations/components/forms/form-description.d.ts +12 -0
- package/declarations/components/forms/form-feedback.d.ts +21 -0
- package/declarations/components/forms/form.d.ts +1 -1
- package/declarations/components/forms/input.d.ts +44 -1
- package/declarations/components/forms/label.d.ts +13 -0
- package/declarations/components/forms/native-select.d.ts +103 -6
- package/declarations/components/forms/radio-group.d.ts +21 -0
- package/declarations/components/forms/radio.d.ts +27 -0
- package/declarations/components/forms/select/end-content.d.ts +31 -0
- package/declarations/components/forms/select/native-mirror.d.ts +44 -0
- package/declarations/components/forms/select/select.d.ts +425 -0
- package/declarations/components/forms/select/selected-items.d.ts +80 -0
- package/declarations/components/forms/select/trigger.d.ts +76 -0
- package/declarations/components/forms/select/types.d.ts +411 -0
- package/declarations/components/forms/select.d.ts +2 -531
- package/declarations/components/forms/textarea.d.ts +35 -0
- package/declarations/components/overlays/drawer.d.ts +3 -0
- package/declarations/components/overlays/modal.d.ts +3 -0
- package/declarations/components/overlays/overlay.d.ts +23 -0
- package/declarations/components/overlays/popover.d.ts +62 -0
- package/declarations/components/overlays/portal-target.d.ts +5 -1
- package/declarations/components/status/progress-bar.d.ts +5 -0
- package/declarations/components/utilities/divider.d.ts +14 -0
- package/declarations/components/utilities/spinner.d.ts +8 -0
- package/declarations/utils/listManager.d.ts +30 -5
- package/dist/components/buttons/chip.js +1 -1
- package/dist/components/buttons/chip.js.map +1 -1
- package/dist/components/collections/dropdown.js +13 -1
- package/dist/components/collections/dropdown.js.map +1 -1
- package/dist/components/collections/listbox/item.js +13 -1
- package/dist/components/collections/listbox/item.js.map +1 -1
- package/dist/components/collections/listbox/listbox.js +12 -1
- package/dist/components/collections/listbox/listbox.js.map +1 -1
- package/dist/components/collections/simple-table/column.js +1 -1
- package/dist/components/collections/simple-table/column.js.map +1 -1
- package/dist/components/forms/autocomplete.js +0 -3
- package/dist/components/forms/autocomplete.js.map +1 -1
- package/dist/components/forms/checkbox-group.js.map +1 -1
- package/dist/components/forms/checkbox.js.map +1 -1
- package/dist/components/forms/field.js +1 -1
- package/dist/components/forms/form-control.js +1 -1
- package/dist/components/forms/form-control.js.map +1 -1
- package/dist/components/forms/form-description.js.map +1 -1
- package/dist/components/forms/form-feedback.js.map +1 -1
- package/dist/components/forms/index.js +1 -1
- package/dist/components/forms/input.js +32 -1
- package/dist/components/forms/input.js.map +1 -1
- package/dist/components/forms/label.js.map +1 -1
- package/dist/components/forms/native-select.js +2 -2
- package/dist/components/forms/native-select.js.map +1 -1
- package/dist/components/forms/radio-group.js.map +1 -1
- package/dist/components/forms/radio.js.map +1 -1
- package/dist/components/forms/select/end-content.js +24 -0
- package/dist/components/forms/select/end-content.js.map +1 -0
- package/dist/components/forms/select/native-mirror.js +29 -0
- package/dist/components/forms/select/native-mirror.js.map +1 -0
- package/dist/components/forms/select/select.js +599 -0
- package/dist/components/forms/select/select.js.map +1 -0
- package/dist/components/forms/select/selected-items.js +63 -0
- package/dist/components/forms/select/selected-items.js.map +1 -0
- package/dist/components/forms/select/trigger.js +30 -0
- package/dist/components/forms/select/trigger.js.map +1 -0
- package/dist/components/forms/select/types.js +2 -0
- package/dist/components/forms/select/types.js.map +1 -0
- package/dist/components/forms/select.js +1 -387
- package/dist/components/forms/select.js.map +1 -1
- package/dist/components/forms/textarea.js.map +1 -1
- package/dist/components/overlays/drawer.js.map +1 -1
- package/dist/components/overlays/modal.js.map +1 -1
- package/dist/components/overlays/overlay.js.map +1 -1
- package/dist/components/overlays/popover.js +53 -2
- package/dist/components/overlays/popover.js.map +1 -1
- package/dist/components/overlays/portal-target.js.map +1 -1
- package/dist/components/status/progress-bar.js +8 -1
- package/dist/components/status/progress-bar.js.map +1 -1
- package/dist/components/utilities/avatar.js +1 -1
- package/dist/components/utilities/avatar.js.map +1 -1
- package/dist/components/utilities/divider.js +8 -2
- package/dist/components/utilities/divider.js.map +1 -1
- package/dist/components/utilities/spinner.js +1 -1
- package/dist/components/utilities/spinner.js.map +1 -1
- package/dist/forms.js +1 -1
- package/dist/index.js +1 -1
- package/dist/utils/listManager.js +63 -4
- package/dist/utils/listManager.js.map +1 -1
- package/dist/utils/nested-data.js +10 -1
- package/dist/utils/nested-data.js.map +1 -1
- package/package.json +4 -4
|
@@ -8,19 +8,29 @@ interface ChipSignature {
|
|
|
8
8
|
*/
|
|
9
9
|
appearance?: 'default' | 'outlined' | 'faded';
|
|
10
10
|
/**
|
|
11
|
-
* The intent of the chip
|
|
11
|
+
* The intent of the chip, which drives its color
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue 'default'
|
|
12
14
|
*/
|
|
13
15
|
intent?: 'default' | 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger';
|
|
14
16
|
/**
|
|
15
17
|
* The size of the chip
|
|
18
|
+
*
|
|
19
|
+
* @defaultValue 'md'
|
|
16
20
|
*/
|
|
17
21
|
size?: 'sm' | 'md' | 'lg';
|
|
18
22
|
/**
|
|
19
|
-
* The radius the chip
|
|
23
|
+
* The border radius of the chip
|
|
24
|
+
*
|
|
25
|
+
* @defaultValue 'full'
|
|
20
26
|
*/
|
|
21
27
|
radius?: 'none' | 'sm' | 'lg' | 'full';
|
|
22
28
|
/**
|
|
23
|
-
*
|
|
29
|
+
* Adds a dot before the content, colored by `@intent`. On the `default`
|
|
30
|
+
* appearance the dot takes the chip's text color, since the chip's
|
|
31
|
+
* background is already the intent color.
|
|
32
|
+
*
|
|
33
|
+
* @defaultValue false
|
|
24
34
|
*/
|
|
25
35
|
withDot?: boolean;
|
|
26
36
|
/**
|
|
@@ -29,7 +39,28 @@ interface ChipSignature {
|
|
|
29
39
|
*/
|
|
30
40
|
onClose?: () => void;
|
|
31
41
|
/**
|
|
32
|
-
*
|
|
42
|
+
* The accessible name of the close button. Every close button would
|
|
43
|
+
* otherwise be announced as just "Close", which does not say *what* is
|
|
44
|
+
* being removed — worth setting when several chips sit together.
|
|
45
|
+
*
|
|
46
|
+
* @defaultValue 'Close'
|
|
47
|
+
*/
|
|
48
|
+
closeButtonTitle?: string;
|
|
49
|
+
/**
|
|
50
|
+
* `tabindex` for the close button.
|
|
51
|
+
*
|
|
52
|
+
* Set to `-1` when chips sit inside another control (a multi-select field,
|
|
53
|
+
* say) and the close button should stay a pointer affordance: every chip
|
|
54
|
+
* would otherwise cost a Tab stop before the control itself is reached.
|
|
55
|
+
* Whoever does this owes keyboard users another way to remove a chip.
|
|
56
|
+
*
|
|
57
|
+
* @defaultValue undefined (the close button is a normal tab stop)
|
|
58
|
+
*/
|
|
59
|
+
closeButtonTabIndex?: number | string;
|
|
60
|
+
/**
|
|
61
|
+
* Dims the chip and disables its close button, if any.
|
|
62
|
+
*
|
|
63
|
+
* @defaultValue false
|
|
33
64
|
*/
|
|
34
65
|
isDisabled?: boolean;
|
|
35
66
|
/**
|
|
@@ -34,6 +34,9 @@ interface TriggerArgs extends Pick<ButtonSignature['Args'], 'appearance' | 'inte
|
|
|
34
34
|
anchor: ModifierLike<{
|
|
35
35
|
Element: HTMLElement;
|
|
36
36
|
}>;
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
37
40
|
trigger: ModifierLike<{
|
|
38
41
|
Element: HTMLElement;
|
|
39
42
|
}>;
|
|
@@ -57,6 +60,18 @@ declare class Trigger extends Component<TriggerSignature> {
|
|
|
57
60
|
Element: HTMLElement;
|
|
58
61
|
}>;
|
|
59
62
|
handleKeyDown: (event: KeyboardEvent) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Enter and Space have to be handled here rather than left to the button's
|
|
65
|
+
* native activation. The trigger renders Frontile's Button, whose `press`
|
|
66
|
+
* modifier calls preventDefault on Enter/Space keydown — that is deliberate,
|
|
67
|
+
* since press synthesises its own press event for `@onPress` consumers — but
|
|
68
|
+
* it also cancels the native click, and Popover's `trigger` modifier opens on
|
|
69
|
+
* click. Without this the menu could only be opened with the arrow keys.
|
|
70
|
+
*
|
|
71
|
+
* Select is unaffected because its trigger is a plain `<button>` with no press
|
|
72
|
+
* modifier, so its native click still fires. Handling this in Popover instead
|
|
73
|
+
* would double-toggle there.
|
|
74
|
+
*/
|
|
60
75
|
handleKeyUp: (event: KeyboardEvent) => void;
|
|
61
76
|
}
|
|
62
77
|
interface MenuArgs extends Pick<ListboxSignature<unknown>['Args'], 'appearance' | 'intent' | 'class' | 'selectionMode' | 'selectedKeys' | 'disabledKeys' | 'allowEmpty' | 'onSelectionChange'>, Pick<ContentSignature['Args'], 'renderInPlace' | 'target' | 'transitionDuration' | 'backdrop' | 'disableTransitions' | 'focusTrapOptions' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'backdropTransition' | 'transition'> {
|
|
@@ -72,6 +87,9 @@ interface MenuArgs extends Pick<ListboxSignature<unknown>['Args'], 'appearance'
|
|
|
72
87
|
* @internal
|
|
73
88
|
*/
|
|
74
89
|
toggle: () => void;
|
|
90
|
+
/**
|
|
91
|
+
* Callback when a menu item is selected, receiving that item's `@key`.
|
|
92
|
+
*/
|
|
75
93
|
onAction?: (key: string) => void;
|
|
76
94
|
/**
|
|
77
95
|
* @defaultValue true
|
|
@@ -5,6 +5,12 @@ export interface ListboxItemSignature {
|
|
|
5
5
|
manager: ListManager;
|
|
6
6
|
key: string;
|
|
7
7
|
textValue?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The entry of `@items` this option renders, remembered on the registered
|
|
10
|
+
* list item so a selection can hand it back. Bound for you on the Item
|
|
11
|
+
* yielded from the `:item` block; block-form options have no such entry.
|
|
12
|
+
*/
|
|
13
|
+
item?: unknown;
|
|
8
14
|
description?: string;
|
|
9
15
|
shortcut?: string;
|
|
10
16
|
onClick?: () => void;
|
|
@@ -48,5 +54,12 @@ declare class ListboxItem extends Component<ListboxItemSignature> {
|
|
|
48
54
|
shortcut: string;
|
|
49
55
|
};
|
|
50
56
|
get role(): "menuitem" | "option";
|
|
57
|
+
/**
|
|
58
|
+
* `aria-selected` belongs on `option`, and only there — a plain `menuitem`
|
|
59
|
+
* that carries it is invalid ARIA, since menu items convey state through
|
|
60
|
+
* `aria-checked` and only as `menuitemcheckbox`/`menuitemradio`. Returning
|
|
61
|
+
* undefined omits the attribute rather than rendering an empty one.
|
|
62
|
+
*/
|
|
63
|
+
get ariaSelected(): 'true' | 'false' | undefined;
|
|
51
64
|
}
|
|
52
65
|
export { ListboxItem };
|
|
@@ -3,6 +3,7 @@ import { ListManager, type SelectionMode, type ListItem } from '../../../utils/l
|
|
|
3
3
|
import { ListboxItem, type ListboxItemSignature } from './item';
|
|
4
4
|
import type { WithBoundArgs } from '@glint/template';
|
|
5
5
|
type ItemCompBounded = WithBoundArgs<typeof ListboxItem, 'manager'>;
|
|
6
|
+
type ItemCompBoundedWithItem = WithBoundArgs<typeof ListboxItem, 'manager' | 'item'>;
|
|
6
7
|
interface ListboxSignature<T> {
|
|
7
8
|
Args: {
|
|
8
9
|
/**
|
|
@@ -42,12 +43,14 @@ interface ListboxSignature<T> {
|
|
|
42
43
|
};
|
|
43
44
|
Element: HTMLUListElement;
|
|
44
45
|
Blocks: {
|
|
45
|
-
item: [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
item: [
|
|
47
|
+
{
|
|
48
|
+
item: T;
|
|
49
|
+
key: string;
|
|
50
|
+
label: string;
|
|
51
|
+
Item: ItemCompBoundedWithItem;
|
|
52
|
+
}
|
|
53
|
+
];
|
|
51
54
|
default: [{
|
|
52
55
|
Item: ItemCompBounded;
|
|
53
56
|
}];
|
|
@@ -70,6 +73,12 @@ declare class Listbox<T = unknown> extends Component<ListboxSignature<T>> {
|
|
|
70
73
|
}>;
|
|
71
74
|
get classNames(): string;
|
|
72
75
|
get role(): "menu" | "listbox";
|
|
76
|
+
/**
|
|
77
|
+
* A listbox that accepts more than one selection has to say so, otherwise a
|
|
78
|
+
* screen reader presents it as a single-choice list. Only meaningful on
|
|
79
|
+
* `role="listbox"`; a `menu` conveys multi-select through its item roles.
|
|
80
|
+
*/
|
|
81
|
+
get ariaMultiselectable(): 'true' | undefined;
|
|
73
82
|
}
|
|
74
83
|
export { Listbox, ListboxItem, type ListboxSignature, type ListboxItemSignature, type ListItem };
|
|
75
84
|
export default Listbox;
|
|
@@ -214,9 +214,6 @@ interface AutocompleteSignature<T> {
|
|
|
214
214
|
* static list (built-in filtering), an externally filtered list
|
|
215
215
|
* (`disableFiltering` + `onInputChange`), or an async source (`onSearch`).
|
|
216
216
|
*
|
|
217
|
-
* Selection state follows the same two-way data binding pattern as `Select`:
|
|
218
|
-
* internal tracked state gives immediate UI updates, while `onSelectionChange`
|
|
219
|
-
* notifies the parent, whose arg updates sync back through modifiers.
|
|
220
217
|
*/
|
|
221
218
|
declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<T>> {
|
|
222
219
|
#private;
|
|
@@ -250,7 +247,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
250
247
|
selectedLabel?: string;
|
|
251
248
|
containerRef: {
|
|
252
249
|
current: HTMLDivElement | undefined;
|
|
253
|
-
"__#
|
|
250
|
+
"__#9@#onChange"?: ((el: HTMLDivElement | undefined) => void) | undefined;
|
|
254
251
|
setup: import("ember-modifier").FunctionBasedModifier<{
|
|
255
252
|
Args: {
|
|
256
253
|
Positional: unknown[];
|
|
@@ -261,7 +258,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
261
258
|
};
|
|
262
259
|
triggerRef: {
|
|
263
260
|
current: HTMLInputElement | undefined;
|
|
264
|
-
"__#
|
|
261
|
+
"__#9@#onChange"?: ((el: HTMLInputElement | undefined) => void) | undefined;
|
|
265
262
|
setup: import("ember-modifier").FunctionBasedModifier<{
|
|
266
263
|
Args: {
|
|
267
264
|
Positional: unknown[];
|
|
@@ -304,6 +301,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
304
301
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
305
302
|
hasStartContent?: boolean | undefined;
|
|
306
303
|
hasEndContent?: boolean | undefined;
|
|
304
|
+
hasChips?: boolean | undefined;
|
|
307
305
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
308
306
|
innerContainer: (slotProps?: ({
|
|
309
307
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -311,6 +309,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
311
309
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
312
310
|
hasStartContent?: boolean | undefined;
|
|
313
311
|
hasEndContent?: boolean | undefined;
|
|
312
|
+
hasChips?: boolean | undefined;
|
|
314
313
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
315
314
|
startContent: (slotProps?: ({
|
|
316
315
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -318,6 +317,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
318
317
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
319
318
|
hasStartContent?: boolean | undefined;
|
|
320
319
|
hasEndContent?: boolean | undefined;
|
|
320
|
+
hasChips?: boolean | undefined;
|
|
321
321
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
322
322
|
endContent: (slotProps?: ({
|
|
323
323
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -325,6 +325,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
325
325
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
326
326
|
hasStartContent?: boolean | undefined;
|
|
327
327
|
hasEndContent?: boolean | undefined;
|
|
328
|
+
hasChips?: boolean | undefined;
|
|
328
329
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
329
330
|
input: (slotProps?: ({
|
|
330
331
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -332,6 +333,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
332
333
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
333
334
|
hasStartContent?: boolean | undefined;
|
|
334
335
|
hasEndContent?: boolean | undefined;
|
|
336
|
+
hasChips?: boolean | undefined;
|
|
335
337
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
336
338
|
} & {
|
|
337
339
|
base: (slotProps?: ({
|
|
@@ -340,6 +342,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
340
342
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
341
343
|
hasStartContent?: boolean | undefined;
|
|
342
344
|
hasEndContent?: boolean | undefined;
|
|
345
|
+
hasChips?: boolean | undefined;
|
|
343
346
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
344
347
|
listbox: (slotProps?: ({
|
|
345
348
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -347,6 +350,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
347
350
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
348
351
|
hasStartContent?: boolean | undefined;
|
|
349
352
|
hasEndContent?: boolean | undefined;
|
|
353
|
+
hasChips?: boolean | undefined;
|
|
350
354
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
351
355
|
icon: (slotProps?: ({
|
|
352
356
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -354,6 +358,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
354
358
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
355
359
|
hasStartContent?: boolean | undefined;
|
|
356
360
|
hasEndContent?: boolean | undefined;
|
|
361
|
+
hasChips?: boolean | undefined;
|
|
357
362
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
358
363
|
clearButton: (slotProps?: ({
|
|
359
364
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -361,6 +366,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
361
366
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
362
367
|
hasStartContent?: boolean | undefined;
|
|
363
368
|
hasEndContent?: boolean | undefined;
|
|
369
|
+
hasChips?: boolean | undefined;
|
|
364
370
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
365
371
|
input: (slotProps?: ({
|
|
366
372
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -368,6 +374,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
368
374
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
369
375
|
hasStartContent?: boolean | undefined;
|
|
370
376
|
hasEndContent?: boolean | undefined;
|
|
377
|
+
hasChips?: boolean | undefined;
|
|
371
378
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
372
379
|
emptyContent: (slotProps?: ({
|
|
373
380
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -375,6 +382,7 @@ declare class Autocomplete<T = unknown> extends Component<AutocompleteSignature<
|
|
|
375
382
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
376
383
|
hasStartContent?: boolean | undefined;
|
|
377
384
|
hasEndContent?: boolean | undefined;
|
|
385
|
+
hasChips?: boolean | undefined;
|
|
378
386
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
379
387
|
} & {};
|
|
380
388
|
get isClearable(): boolean | undefined;
|
|
@@ -4,10 +4,30 @@ import { type FormControlSharedArgs } from './form-control';
|
|
|
4
4
|
import { type CheckboxGroupVariants, type CheckboxGroupSlots, type SlotsToClasses } from '@frontile/theme';
|
|
5
5
|
import type { WithBoundArgs } from '@glint/template';
|
|
6
6
|
interface Args extends FormControlSharedArgs {
|
|
7
|
+
/**
|
|
8
|
+
* The name attribute applied to every checkbox in the group, so they are
|
|
9
|
+
* submitted together as one field.
|
|
10
|
+
*/
|
|
7
11
|
name?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Callback when a checkbox in the group is toggled. It is bound onto every
|
|
14
|
+
* yielded Checkbox, so a checkbox that sets its own `@onChange` replaces this
|
|
15
|
+
* one rather than running alongside it.
|
|
16
|
+
*/
|
|
8
17
|
onChange?: CheckboxSignature['Args']['onChange'];
|
|
18
|
+
/**
|
|
19
|
+
* The size applied to every checkbox in the group and to the group's label.
|
|
20
|
+
*/
|
|
9
21
|
size?: CheckboxGroupVariants['size'];
|
|
22
|
+
/**
|
|
23
|
+
* Class names for each slot of the component, merged with the theme's.
|
|
24
|
+
*/
|
|
10
25
|
classes?: SlotsToClasses<CheckboxGroupSlots>;
|
|
26
|
+
/**
|
|
27
|
+
* How the checkboxes are laid out.
|
|
28
|
+
*
|
|
29
|
+
* @defaultValue 'vertical'
|
|
30
|
+
*/
|
|
11
31
|
orientation?: 'horizontal' | 'vertical';
|
|
12
32
|
}
|
|
13
33
|
interface CheckboxGroupSignature {
|
|
@@ -2,11 +2,33 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { type FormControlSharedArgs } from './form-control';
|
|
3
3
|
import { type CheckboxVariants, type CheckboxSlots, type SlotsToClasses } from '@frontile/theme';
|
|
4
4
|
interface Args extends FormControlSharedArgs {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the checkbox is checked. Pair with `onChange` to control the
|
|
7
|
+
* checkbox; leave it unset to let the element track its own state.
|
|
8
|
+
*/
|
|
5
9
|
checked?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The name attribute of the underlying input, used when the checkbox is
|
|
12
|
+
* submitted as part of a form.
|
|
13
|
+
*/
|
|
6
14
|
name?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The size of the checkbox and its label.
|
|
17
|
+
*
|
|
18
|
+
* @defaultValue 'md'
|
|
19
|
+
*/
|
|
7
20
|
size?: CheckboxVariants['size'];
|
|
21
|
+
/**
|
|
22
|
+
* Class names for each slot of the component, merged with the theme's.
|
|
23
|
+
*/
|
|
8
24
|
classes?: SlotsToClasses<CheckboxSlots>;
|
|
25
|
+
/**
|
|
26
|
+
* Callback when onchange is triggered
|
|
27
|
+
*/
|
|
9
28
|
onChange?: (value: boolean, event: Event) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Callback when onblur is triggered
|
|
31
|
+
*/
|
|
10
32
|
onBlur?: () => void;
|
|
11
33
|
}
|
|
12
34
|
interface CheckboxSignature {
|
|
@@ -4,17 +4,66 @@ import { type FormDescriptionSignature } from './form-description';
|
|
|
4
4
|
import { type LabelSignature } from './label';
|
|
5
5
|
import type { ComponentLike, WithBoundArgs } from '@glint/template';
|
|
6
6
|
interface FormControlSharedArgs {
|
|
7
|
+
/**
|
|
8
|
+
* The label text rendered above the control and associated with it via `for`.
|
|
9
|
+
* Use the `:label` block instead when the label needs markup.
|
|
10
|
+
*/
|
|
7
11
|
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the field is required. Adds an asterisk to the label; it does not
|
|
14
|
+
* set the `required` attribute on the control itself.
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue false
|
|
17
|
+
*/
|
|
8
18
|
isRequired?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Help text rendered between the label and the control, and referenced by the
|
|
21
|
+
* ids `describedBy` returns.
|
|
22
|
+
*/
|
|
9
23
|
description?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Validation messages for the field. A non-empty value also marks the control
|
|
26
|
+
* invalid, and an array is joined with `; ` when displayed.
|
|
27
|
+
*/
|
|
10
28
|
errors?: string[] | string;
|
|
29
|
+
/**
|
|
30
|
+
* Marks the control invalid without supplying messages, for validation that is
|
|
31
|
+
* reported elsewhere.
|
|
32
|
+
*
|
|
33
|
+
* @defaultValue false
|
|
34
|
+
*/
|
|
11
35
|
isInvalid?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the field is disabled. FormControl passes this through for styling;
|
|
38
|
+
* the control it wraps is responsible for the `disabled` attribute.
|
|
39
|
+
*
|
|
40
|
+
* @defaultValue false
|
|
41
|
+
*/
|
|
12
42
|
isDisabled?: boolean;
|
|
13
43
|
}
|
|
14
44
|
interface Args extends FormControlSharedArgs {
|
|
45
|
+
/**
|
|
46
|
+
* The id given to the control, and the base for the description and feedback
|
|
47
|
+
* ids. Generated when omitted, so pass one only when something outside the
|
|
48
|
+
* block has to reference it.
|
|
49
|
+
*/
|
|
15
50
|
id?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The size of the label, description and feedback text.
|
|
53
|
+
*
|
|
54
|
+
* @defaultValue 'md'
|
|
55
|
+
*/
|
|
16
56
|
size?: 'sm' | 'md' | 'lg';
|
|
57
|
+
/**
|
|
58
|
+
* Suppresses the automatic error feedback, for when the block renders the
|
|
59
|
+
* yielded `Feedback` itself or places messages elsewhere.
|
|
60
|
+
*
|
|
61
|
+
* @defaultValue false
|
|
62
|
+
*/
|
|
17
63
|
preventErrorFeedback?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Class names for the wrapping element.
|
|
66
|
+
*/
|
|
18
67
|
class?: string;
|
|
19
68
|
}
|
|
20
69
|
interface FormControlSignature {
|
|
@@ -2,8 +2,20 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { type FormDescriptionVariants } from '@frontile/theme';
|
|
3
3
|
interface FormDescriptionSignature {
|
|
4
4
|
Args: {
|
|
5
|
+
/**
|
|
6
|
+
* The id of the description element, referenced by the control's
|
|
7
|
+
* `aria-describedby`.
|
|
8
|
+
*/
|
|
5
9
|
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The size of the description text.
|
|
12
|
+
*
|
|
13
|
+
* @defaultValue 'md'
|
|
14
|
+
*/
|
|
6
15
|
size?: FormDescriptionVariants['size'];
|
|
16
|
+
/**
|
|
17
|
+
* Class names for the description element, merged with the theme's.
|
|
18
|
+
*/
|
|
7
19
|
class?: string;
|
|
8
20
|
};
|
|
9
21
|
Element: HTMLDivElement;
|
|
@@ -2,10 +2,31 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { type FormFeedbackVariants } from '@frontile/theme';
|
|
3
3
|
interface FormFeedbackSignature {
|
|
4
4
|
Args: {
|
|
5
|
+
/**
|
|
6
|
+
* The id of the feedback element, referenced by the control's
|
|
7
|
+
* `aria-describedby`.
|
|
8
|
+
*/
|
|
5
9
|
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* A list of messages or a single message string. An array is joined with `; `.
|
|
12
|
+
*/
|
|
6
13
|
messages?: string[] | string;
|
|
14
|
+
/**
|
|
15
|
+
* The intent of the feedback, which also decides whether it is announced
|
|
16
|
+
* assertively (`danger`) or politely.
|
|
17
|
+
*
|
|
18
|
+
* @defaultValue 'danger'
|
|
19
|
+
*/
|
|
7
20
|
intent?: FormFeedbackVariants['intent'];
|
|
21
|
+
/**
|
|
22
|
+
* The size of the feedback text.
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue 'md'
|
|
25
|
+
*/
|
|
8
26
|
size?: FormFeedbackVariants['size'];
|
|
27
|
+
/**
|
|
28
|
+
* Class names for the feedback element, merged with the theme's.
|
|
29
|
+
*/
|
|
9
30
|
class?: string;
|
|
10
31
|
};
|
|
11
32
|
Element: HTMLDivElement;
|
|
@@ -159,7 +159,7 @@ declare class Form<T = FormDataCompiled> extends Component<FormSignature<T>> {
|
|
|
159
159
|
/** Reference to the form element. */
|
|
160
160
|
element: {
|
|
161
161
|
current: HTMLFormElement | undefined;
|
|
162
|
-
"__#
|
|
162
|
+
"__#9@#onChange"?: ((el: HTMLFormElement | undefined) => void) | undefined;
|
|
163
163
|
setup: import("ember-modifier").FunctionBasedModifier<{
|
|
164
164
|
Args: {
|
|
165
165
|
Positional: unknown[];
|
|
@@ -2,10 +2,31 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { type InputSlots, type InputVariants, type SlotsToClasses } from '@frontile/theme';
|
|
3
3
|
import { type FormControlSharedArgs } from './form-control';
|
|
4
4
|
interface Args extends FormControlSharedArgs {
|
|
5
|
+
/**
|
|
6
|
+
* The type attribute of the underlying input element.
|
|
7
|
+
*
|
|
8
|
+
* @defaultValue 'text'
|
|
9
|
+
*/
|
|
5
10
|
type?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The value of the input. Pair with `onInput` or `onChange` to control the
|
|
13
|
+
* input; leave it unset to let the element track its own value.
|
|
14
|
+
*/
|
|
6
15
|
value?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The name attribute of the underlying input, used when the input is
|
|
18
|
+
* submitted as part of a form.
|
|
19
|
+
*/
|
|
7
20
|
name?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The size of the input and its label.
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue 'md'
|
|
25
|
+
*/
|
|
8
26
|
size?: InputVariants['size'];
|
|
27
|
+
/**
|
|
28
|
+
* Class names for each slot of the component, merged with the theme's.
|
|
29
|
+
*/
|
|
9
30
|
classes?: SlotsToClasses<InputSlots>;
|
|
10
31
|
/**
|
|
11
32
|
* Whether to include a clear button
|
|
@@ -48,9 +69,16 @@ interface InputSignature {
|
|
|
48
69
|
}
|
|
49
70
|
declare class Input extends Component<InputSignature> {
|
|
50
71
|
uncontrolledValue: string;
|
|
72
|
+
/**
|
|
73
|
+
* What the element itself currently holds. A controlled parent does not
|
|
74
|
+
* always feed the value back through `@value` — `<Form>`, for one, reads it
|
|
75
|
+
* off the DOM instead — so the argument alone cannot tell us whether there
|
|
76
|
+
* is anything to clear.
|
|
77
|
+
*/
|
|
78
|
+
elementValue: string;
|
|
51
79
|
inputRef: {
|
|
52
80
|
current: HTMLInputElement | undefined;
|
|
53
|
-
"__#
|
|
81
|
+
"__#9@#onChange"?: ((el: HTMLInputElement | undefined) => void) | undefined;
|
|
54
82
|
setup: import("ember-modifier").FunctionBasedModifier<{
|
|
55
83
|
Args: {
|
|
56
84
|
Positional: unknown[];
|
|
@@ -61,6 +89,11 @@ declare class Input extends Component<InputSignature> {
|
|
|
61
89
|
};
|
|
62
90
|
get isControlled(): boolean;
|
|
63
91
|
get value(): string | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* The value in the field regardless of who owns it: the argument when the
|
|
94
|
+
* parent feeds one back, the element's own value otherwise.
|
|
95
|
+
*/
|
|
96
|
+
get currentValue(): string | undefined;
|
|
64
97
|
get type(): string;
|
|
65
98
|
handleOnInput(event: Event): void;
|
|
66
99
|
handleOnChange(event: Event): void;
|
|
@@ -74,6 +107,7 @@ declare class Input extends Component<InputSignature> {
|
|
|
74
107
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
75
108
|
hasStartContent?: boolean | undefined;
|
|
76
109
|
hasEndContent?: boolean | undefined;
|
|
110
|
+
hasChips?: boolean | undefined;
|
|
77
111
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
78
112
|
innerContainer: (slotProps?: ({
|
|
79
113
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -81,6 +115,7 @@ declare class Input extends Component<InputSignature> {
|
|
|
81
115
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
82
116
|
hasStartContent?: boolean | undefined;
|
|
83
117
|
hasEndContent?: boolean | undefined;
|
|
118
|
+
hasChips?: boolean | undefined;
|
|
84
119
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
85
120
|
startContent: (slotProps?: ({
|
|
86
121
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -88,6 +123,7 @@ declare class Input extends Component<InputSignature> {
|
|
|
88
123
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
89
124
|
hasStartContent?: boolean | undefined;
|
|
90
125
|
hasEndContent?: boolean | undefined;
|
|
126
|
+
hasChips?: boolean | undefined;
|
|
91
127
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
92
128
|
endContent: (slotProps?: ({
|
|
93
129
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -95,6 +131,7 @@ declare class Input extends Component<InputSignature> {
|
|
|
95
131
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
96
132
|
hasStartContent?: boolean | undefined;
|
|
97
133
|
hasEndContent?: boolean | undefined;
|
|
134
|
+
hasChips?: boolean | undefined;
|
|
98
135
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
99
136
|
input: (slotProps?: ({
|
|
100
137
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -102,6 +139,7 @@ declare class Input extends Component<InputSignature> {
|
|
|
102
139
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
103
140
|
hasStartContent?: boolean | undefined;
|
|
104
141
|
hasEndContent?: boolean | undefined;
|
|
142
|
+
hasChips?: boolean | undefined;
|
|
105
143
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
106
144
|
} & {
|
|
107
145
|
base: (slotProps?: ({
|
|
@@ -110,6 +148,7 @@ declare class Input extends Component<InputSignature> {
|
|
|
110
148
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
111
149
|
hasStartContent?: boolean | undefined;
|
|
112
150
|
hasEndContent?: boolean | undefined;
|
|
151
|
+
hasChips?: boolean | undefined;
|
|
113
152
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
114
153
|
innerContainer: (slotProps?: ({
|
|
115
154
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -117,6 +156,7 @@ declare class Input extends Component<InputSignature> {
|
|
|
117
156
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
118
157
|
hasStartContent?: boolean | undefined;
|
|
119
158
|
hasEndContent?: boolean | undefined;
|
|
159
|
+
hasChips?: boolean | undefined;
|
|
120
160
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
121
161
|
startContent: (slotProps?: ({
|
|
122
162
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -124,6 +164,7 @@ declare class Input extends Component<InputSignature> {
|
|
|
124
164
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
125
165
|
hasStartContent?: boolean | undefined;
|
|
126
166
|
hasEndContent?: boolean | undefined;
|
|
167
|
+
hasChips?: boolean | undefined;
|
|
127
168
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
128
169
|
endContent: (slotProps?: ({
|
|
129
170
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -131,6 +172,7 @@ declare class Input extends Component<InputSignature> {
|
|
|
131
172
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
132
173
|
hasStartContent?: boolean | undefined;
|
|
133
174
|
hasEndContent?: boolean | undefined;
|
|
175
|
+
hasChips?: boolean | undefined;
|
|
134
176
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
135
177
|
input: (slotProps?: ({
|
|
136
178
|
size?: "sm" | "md" | "lg" | undefined;
|
|
@@ -138,6 +180,7 @@ declare class Input extends Component<InputSignature> {
|
|
|
138
180
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
139
181
|
hasStartContent?: boolean | undefined;
|
|
140
182
|
hasEndContent?: boolean | undefined;
|
|
183
|
+
hasChips?: boolean | undefined;
|
|
141
184
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
142
185
|
} & {};
|
|
143
186
|
}
|
|
@@ -6,12 +6,25 @@ interface LabelSignature {
|
|
|
6
6
|
* The 'for' attribute of a <label>.
|
|
7
7
|
*/
|
|
8
8
|
for?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The size of the label text.
|
|
11
|
+
*
|
|
12
|
+
* @defaultValue 'md'
|
|
13
|
+
*/
|
|
9
14
|
size?: LabelVariants['size'];
|
|
15
|
+
/**
|
|
16
|
+
* Class names for each slot of the component, merged with the theme's.
|
|
17
|
+
*/
|
|
10
18
|
classes?: SlotsToClasses<LabelSlots>;
|
|
11
19
|
/**
|
|
12
20
|
* The class name to be passed to the label base slot.
|
|
13
21
|
*/
|
|
14
22
|
class?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the field is required or not, if true, an asterisk will be added to the label.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue false
|
|
27
|
+
*/
|
|
15
28
|
isRequired?: boolean;
|
|
16
29
|
};
|
|
17
30
|
Element: HTMLLabelElement;
|