frontile 0.18.0-alpha.13 → 0.18.0-alpha.14

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.
Files changed (52) hide show
  1. package/declarations/components/collections/dropdown.d.ts +18 -0
  2. package/declarations/components/collections/listbox/item.d.ts +7 -0
  3. package/declarations/components/collections/listbox/listbox.d.ts +6 -0
  4. package/declarations/components/forms/autocomplete.d.ts +0 -3
  5. package/declarations/components/forms/checkbox-group.d.ts +20 -0
  6. package/declarations/components/forms/checkbox.d.ts +22 -0
  7. package/declarations/components/forms/form-control.d.ts +49 -0
  8. package/declarations/components/forms/form-description.d.ts +12 -0
  9. package/declarations/components/forms/form-feedback.d.ts +21 -0
  10. package/declarations/components/forms/input.d.ts +33 -0
  11. package/declarations/components/forms/label.d.ts +13 -0
  12. package/declarations/components/forms/native-select.d.ts +81 -0
  13. package/declarations/components/forms/radio-group.d.ts +21 -0
  14. package/declarations/components/forms/radio.d.ts +27 -0
  15. package/declarations/components/forms/select.d.ts +4 -37
  16. package/declarations/components/forms/textarea.d.ts +29 -0
  17. package/declarations/components/overlays/drawer.d.ts +3 -0
  18. package/declarations/components/overlays/modal.d.ts +3 -0
  19. package/declarations/components/overlays/overlay.d.ts +23 -0
  20. package/declarations/components/overlays/popover.d.ts +29 -0
  21. package/declarations/components/overlays/portal-target.d.ts +5 -1
  22. package/dist/components/collections/dropdown.js +13 -1
  23. package/dist/components/collections/dropdown.js.map +1 -1
  24. package/dist/components/collections/listbox/item.js +13 -1
  25. package/dist/components/collections/listbox/item.js.map +1 -1
  26. package/dist/components/collections/listbox/listbox.js +12 -1
  27. package/dist/components/collections/listbox/listbox.js.map +1 -1
  28. package/dist/components/collections/simple-table/column.js +1 -1
  29. package/dist/components/collections/simple-table/column.js.map +1 -1
  30. package/dist/components/forms/autocomplete.js +0 -3
  31. package/dist/components/forms/autocomplete.js.map +1 -1
  32. package/dist/components/forms/checkbox-group.js.map +1 -1
  33. package/dist/components/forms/checkbox.js.map +1 -1
  34. package/dist/components/forms/form-control.js +1 -1
  35. package/dist/components/forms/form-control.js.map +1 -1
  36. package/dist/components/forms/form-description.js.map +1 -1
  37. package/dist/components/forms/form-feedback.js.map +1 -1
  38. package/dist/components/forms/input.js +32 -1
  39. package/dist/components/forms/input.js.map +1 -1
  40. package/dist/components/forms/label.js.map +1 -1
  41. package/dist/components/forms/native-select.js.map +1 -1
  42. package/dist/components/forms/radio-group.js.map +1 -1
  43. package/dist/components/forms/radio.js.map +1 -1
  44. package/dist/components/forms/select.js +9 -5
  45. package/dist/components/forms/select.js.map +1 -1
  46. package/dist/components/forms/textarea.js.map +1 -1
  47. package/dist/components/overlays/drawer.js.map +1 -1
  48. package/dist/components/overlays/modal.js.map +1 -1
  49. package/dist/components/overlays/overlay.js.map +1 -1
  50. package/dist/components/overlays/popover.js.map +1 -1
  51. package/dist/components/overlays/portal-target.js.map +1 -1
  52. package/package.json +3 -3
@@ -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
@@ -48,5 +48,12 @@ declare class ListboxItem extends Component<ListboxItemSignature> {
48
48
  shortcut: string;
49
49
  };
50
50
  get role(): "menuitem" | "option";
51
+ /**
52
+ * `aria-selected` belongs on `option`, and only there — a plain `menuitem`
53
+ * that carries it is invalid ARIA, since menu items convey state through
54
+ * `aria-checked` and only as `menuitemcheckbox`/`menuitemradio`. Returning
55
+ * undefined omits the attribute rather than rendering an empty one.
56
+ */
57
+ get ariaSelected(): 'true' | 'false' | undefined;
51
58
  }
52
59
  export { ListboxItem };
@@ -70,6 +70,12 @@ declare class Listbox<T = unknown> extends Component<ListboxSignature<T>> {
70
70
  }>;
71
71
  get classNames(): string;
72
72
  get role(): "menu" | "listbox";
73
+ /**
74
+ * A listbox that accepts more than one selection has to say so, otherwise a
75
+ * screen reader presents it as a single-choice list. Only meaningful on
76
+ * `role="listbox"`; a `menu` conveys multi-select through its item roles.
77
+ */
78
+ get ariaMultiselectable(): 'true' | undefined;
73
79
  }
74
80
  export { Listbox, ListboxItem, type ListboxSignature, type ListboxItemSignature, type ListItem };
75
81
  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;
@@ -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;
@@ -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,6 +69,13 @@ 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
  "__#8@#onChange"?: ((el: HTMLInputElement | undefined) => void) | undefined;
@@ -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;
@@ -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;
@@ -6,17 +6,53 @@ import { ListManager, type ListItem } from '../../utils/listManager';
6
6
  import type { WithBoundArgs } from '@glint/template';
7
7
  type ItemCompBounded = WithBoundArgs<typeof NativeSelectItem, 'manager'>;
8
8
  interface BaseArgs<T> extends FormControlSharedArgs {
9
+ /**
10
+ * Keys of the options that cannot be selected. Disabled options are still
11
+ * rendered and announced, they just cannot be picked.
12
+ */
9
13
  disabledKeys?: string[];
14
+ /**
15
+ * Renders an extra empty option, letting the user clear the selection.
16
+ * Label it with the placeholder argument.
17
+ *
18
+ * @defaultValue false
19
+ */
10
20
  allowEmpty?: boolean;
21
+ /**
22
+ * Collection used to render the options. Strings and numbers become both the
23
+ * key and the label; objects use key or id for the key and label, value,
24
+ * name or title for the label. Use the :item block when your data does not
25
+ * follow those conventions.
26
+ */
11
27
  items?: T[];
28
+ /**
29
+ * Id applied to the select element and referenced by its label. One is
30
+ * generated when omitted.
31
+ */
12
32
  id?: string;
33
+ /**
34
+ * Name of the select element, used when the surrounding form is submitted.
35
+ */
13
36
  name?: string;
37
+ /**
38
+ * The size of the control.
39
+ *
40
+ * @defaultValue 'md'
41
+ */
14
42
  size?: NativeSelectVariants['size'];
43
+ /**
44
+ * Per-slot class overrides: base, innerContainer, input, startContent,
45
+ * endContent and icon.
46
+ */
15
47
  classes?: SlotsToClasses<NativeSelectSlots>;
16
48
  /**
17
49
  * Placeholder text used when `allowEmpty` is set to `true`.
18
50
  */
19
51
  placeholder?: string;
52
+ /**
53
+ * Called with the key of an option whenever it is acted upon, including when
54
+ * the same option is picked again. Use onSelectionChange to track state.
55
+ */
20
56
  onAction?: (key: string) => void;
21
57
  /**
22
58
  * @internal
@@ -40,15 +76,48 @@ interface BaseArgs<T> extends FormControlSharedArgs {
40
76
  endContentPointerEvents?: 'none' | 'auto';
41
77
  }
42
78
  interface SingleNativeSelectArgs<T> extends BaseArgs<T> {
79
+ /**
80
+ * Whether one option or several can be selected. Multiple renders the native
81
+ * multi-select list box and switches to selectedKeys.
82
+ *
83
+ * @defaultValue 'single'
84
+ */
43
85
  selectionMode?: 'single' | undefined;
86
+ /**
87
+ * The selected key in single selection mode. The component is controlled:
88
+ * update this from onSelectionChange.
89
+ */
44
90
  selectedKey?: string | null;
91
+ /**
92
+ * Not available in single selection mode; use selectedKey.
93
+ */
45
94
  selectedKeys?: never;
95
+ /**
96
+ * Called with the newly selected key, or null when the selection is cleared
97
+ * through the allowEmpty option.
98
+ */
46
99
  onSelectionChange?: (key: string | null) => void;
47
100
  }
48
101
  interface MultipleNativeSelectArgs<T> extends BaseArgs<T> {
102
+ /**
103
+ * Whether one option or several can be selected. Multiple renders the native
104
+ * multi-select list box and switches to selectedKeys.
105
+ *
106
+ * @defaultValue 'single'
107
+ */
49
108
  selectionMode: 'multiple';
109
+ /**
110
+ * Not available in multiple selection mode; use selectedKeys.
111
+ */
50
112
  selectedKey?: never;
113
+ /**
114
+ * The selected keys in multiple selection mode. The component is controlled:
115
+ * update this from onSelectionChange.
116
+ */
51
117
  selectedKeys?: string[];
118
+ /**
119
+ * Called with every selected key each time the selection changes.
120
+ */
52
121
  onSelectionChange?: (keys: string[]) => void;
53
122
  }
54
123
  type Args<T> = SingleNativeSelectArgs<T> | MultipleNativeSelectArgs<T>;
@@ -132,8 +201,20 @@ declare class NativeSelect<T = unknown> extends Component<NativeSelectSignature<
132
201
  }
133
202
  export interface SelectItemSignature {
134
203
  Args: {
204
+ /**
205
+ * The ListManager that tracks selection for the parent select. It is bound
206
+ * for you on the yielded Item component.
207
+ */
135
208
  manager: ListManager;
209
+ /**
210
+ * Value of the rendered option, and the key reported by onSelectionChange,
211
+ * selectedKey or selectedKeys, and disabledKeys.
212
+ */
136
213
  key: string;
214
+ /**
215
+ * Text representation of the option, used for matching. Defaults to the
216
+ * option's rendered text content.
217
+ */
137
218
  textValue?: string;
138
219
  };
139
220
  Element: HTMLOptionElement;
@@ -4,11 +4,32 @@ import { type FormControlSharedArgs } from './form-control';
4
4
  import { type RadioGroupSlots, type RadioVariants, type SlotsToClasses } from '@frontile/theme';
5
5
  import type { WithBoundArgs } from '@glint/template';
6
6
  interface Args<T> extends FormControlSharedArgs {
7
+ /**
8
+ * The name attribute applied to every radio in the group, which is what makes
9
+ * the browser treat them as mutually exclusive.
10
+ */
7
11
  name?: string;
12
+ /**
13
+ * The currently selected value. Pair with `onChange` to control the group.
14
+ */
8
15
  value?: T;
16
+ /**
17
+ * Callback when the selected radio changes, receiving the new value.
18
+ */
9
19
  onChange?: RadioSignature<T>['Args']['onChange'];
20
+ /**
21
+ * The size applied to every radio in the group and to the group's label.
22
+ */
10
23
  size?: RadioVariants['size'];
24
+ /**
25
+ * Class names for each slot of the component, merged with the theme's.
26
+ */
11
27
  classes?: SlotsToClasses<RadioGroupSlots>;
28
+ /**
29
+ * How the radios are laid out.
30
+ *
31
+ * @defaultValue 'vertical'
32
+ */
12
33
  orientation?: 'horizontal' | 'vertical';
13
34
  }
14
35
  interface RadioGroupSignature<T> {
@@ -2,12 +2,39 @@ import Component from '@glimmer/component';
2
2
  import { type FormControlSharedArgs } from './form-control';
3
3
  import { type SlotsToClasses, type RadioVariants, type RadioSlots } from '@frontile/theme';
4
4
  interface Args<T> extends FormControlSharedArgs {
5
+ /**
6
+ * The value this radio represents. It is passed to `onChange` when the radio
7
+ * is selected, and compared against `checkedValue` to decide whether it is.
8
+ */
5
9
  value: T;
10
+ /**
11
+ * The currently selected value of the group. This radio renders as checked
12
+ * when it equals `value`. Usually supplied by RadioGroup rather than set
13
+ * directly.
14
+ */
6
15
  checkedValue?: T | undefined | null;
16
+ /**
17
+ * The name attribute shared by the radios in a group, which is what makes the
18
+ * browser treat them as mutually exclusive.
19
+ */
7
20
  name?: string;
21
+ /**
22
+ * The size of the radio and its label.
23
+ *
24
+ * @defaultValue 'md'
25
+ */
8
26
  size?: RadioVariants['size'];
27
+ /**
28
+ * Class names for each slot of the component, merged with the theme's.
29
+ */
9
30
  classes?: SlotsToClasses<RadioSlots>;
31
+ /**
32
+ * Callback when onchange is triggered
33
+ */
10
34
  onChange?: (value: T, event: Event) => void;
35
+ /**
36
+ * Callback when onblur is triggered
37
+ */
11
38
  onBlur?: () => void;
12
39
  }
13
40
  interface RadioSignature<T> {
@@ -249,44 +249,11 @@ interface SelectSignature<T> {
249
249
  };
250
250
  }
251
251
  /**
252
- * Select Component - A feature-rich dropdown selection component
252
+ * A dropdown selection component: a custom listbox in a popover, backed by a
253
+ * visually hidden native `<select>` so the value submits with a form.
253
254
  *
254
- * ## Selection State Architecture
255
- *
256
- * This component uses a **two-way data binding pattern** for managing selection state:
257
- *
258
- * ### Data Flow
259
- * 1. **External → Internal (Initialization & Updates)**
260
- * - Parent passes `@selectedKey` or `@selectedKeys` as arguments
261
- * - Constructor initializes internal tracked properties (`_selectedKey` or `_selectedKeys`)
262
- * - Modifiers (`updateSingleSelectValue`, `updateMultipleSelectValue`) sync internal state
263
- * when parent updates the arguments
264
- *
265
- * 2. **Internal State Management**
266
- * - `_selectedKey` / `_selectedKeys`: Internal tracked state (prefixed with underscore)
267
- * - These serve as the "source of truth" for rendering and reactivity
268
- * - Getters (`getSelectedKey`, `selectedKeys`) expose this internal state to the template
269
- *
270
- * 3. **Internal → External (User Interactions)**
271
- * - User interactions trigger selection change handlers
272
- * - Handlers update internal `_selectedKey` / `_selectedKeys` for immediate UI update
273
- * - Handlers call parent's `@onSelectionChange` callback to notify of state change
274
- * - Parent updates its state, which flows back through step 1
275
- *
276
- * ### Why Both Internal State AND Callbacks?
277
- * - **Internal state:** Enables immediate, responsive UI updates (`_selectedKey` / `_selectedKeys`)
278
- * - **Parent callback:** Enables parent to take action when changes occur (`@onSelectionChange`)
279
- * - This pattern provides both responsive UX and parent inclusion over state
280
- *
281
- * ### Example Flow
282
- * ```
283
- * User clicks item
284
- * → onSelectionChange handler
285
- * → Updates _selectedKey (immediate UI update)
286
- * → Calls parent's @onSelectionChange callback
287
- * → Parent updates its @selectedKey state
288
- * → updateSingleSelectValue modifier syncs _selectedKey with new arg value
289
- * ```
255
+ * Selection can be controlled with `@selectedKey` / `@selectedKeys` plus
256
+ * `@onSelectionChange`, or left uncontrolled.
290
257
  */
291
258
  declare class Select<T = unknown> extends Component<SelectSignature<T>> {
292
259
  nodes: ListItem[];
@@ -2,13 +2,42 @@ import Component from '@glimmer/component';
2
2
  import { type FormControlSharedArgs } from './form-control';
3
3
  import { type TextareaSlots, type TextareaVariants, type SlotsToClasses } from '@frontile/theme';
4
4
  interface Args extends FormControlSharedArgs {
5
+ /**
6
+ * The id attribute of the textarea, also used to associate the label and
7
+ * description with it. One is generated when this is omitted.
8
+ */
5
9
  id?: string;
10
+ /**
11
+ * The value of the textarea. Pair with `onInput` or `onChange` to control it;
12
+ * leave it unset to let the element track its own value.
13
+ */
6
14
  value?: string | number | boolean;
15
+ /**
16
+ * The name attribute of the underlying textarea, used when it is submitted as
17
+ * part of a form.
18
+ */
7
19
  name?: string;
20
+ /**
21
+ * The size of the textarea and its label.
22
+ *
23
+ * @defaultValue 'md'
24
+ */
8
25
  size?: TextareaVariants['size'];
26
+ /**
27
+ * Class names for each slot of the component, merged with the theme's.
28
+ */
9
29
  classes?: SlotsToClasses<TextareaSlots>;
30
+ /**
31
+ * Callback when oninput is triggered
32
+ */
10
33
  onInput?: (value: string, event: InputEvent) => void;
34
+ /**
35
+ * Callback when onchange is triggered
36
+ */
11
37
  onChange?: (value: string, event: InputEvent) => void;
38
+ /**
39
+ * Callback when onblur is triggered
40
+ */
12
41
  onBlur?: () => void;
13
42
  }
14
43
  interface TextareaSignature {
@@ -44,6 +44,9 @@ export interface DrawerArgs extends Pick<OverlaySignature['Args'], 'isOpen' | 'o
44
44
  * @defaultValue 'md'
45
45
  */
46
46
  size?: DrawerVariants['size'];
47
+ /**
48
+ * Class names for each slot of the component, merged with the theme's.
49
+ */
47
50
  classes?: SlotsToClasses<DrawerSlots>;
48
51
  }
49
52
  export interface DrawerSignature {
@@ -43,6 +43,9 @@ export interface ModalArgs extends Pick<OverlaySignature['Args'], 'isOpen' | 'on
43
43
  * @defaultValue 'lg'
44
44
  */
45
45
  size?: ModalVariants['size'];
46
+ /**
47
+ * Class names for each slot of the component, merged with the theme's.
48
+ */
46
49
  classes?: SlotsToClasses<ModalSlots>;
47
50
  }
48
51
  export interface ModalSignature {