ropav 0.12.3 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,7 +132,8 @@ var autocomplete_filter_vue_vue_type_script_setup_true_vapor_true_lang_default =
132
132
  },
133
133
  selection,
134
134
  shouldFocusOnHover: true,
135
- shouldUseVirtualFocus: () => !props.disableVirtualFocus
135
+ shouldUseVirtualFocus: () => !props.disableVirtualFocus,
136
+ size: () => root.size.value
136
137
  });
137
138
  provideAutocompleteInputContext({
138
139
  inputAttributes: autocomplete.inputAttributes,
@@ -166,6 +166,7 @@ var autocomplete_root_vue_vue_type_script_setup_true_vapor_true_lang_default = /
166
166
  setTriggerElement: (element) => {
167
167
  triggerElement.value = element;
168
168
  },
169
+ size: computed(() => props.size),
169
170
  slots: styles,
170
171
  state,
171
172
  triggerElement
@@ -201,7 +202,8 @@ var autocomplete_root_vue_vue_type_script_setup_true_vapor_true_lang_default = /
201
202
  labelledBy: () => select.labelledBy.value,
202
203
  listId: () => select.listId.value,
203
204
  selection: state.selection,
204
- shouldFocusOnHover: true
205
+ shouldFocusOnHover: true,
206
+ size: () => props.size
205
207
  });
206
208
  /**
207
209
  * The popover is anchored to the trigger group, not to the button inside it.
@@ -1,7 +1,7 @@
1
1
  import type { CollectionKey } from "../../composables/use-collection.js";
2
2
  import type { UseSelectReturn } from "../../composables/use-select.js";
3
3
  import type { SelectedItem, UseSelectStateReturn } from "../../composables/use-select-state.js";
4
- import type { autocompleteVariants } from "@ropav/styles";
4
+ import type { AutocompleteVariants, autocompleteVariants } from "@ropav/styles";
5
5
  import type { ComputedRef, ShallowRef } from "vue";
6
6
  export interface AutocompleteContext {
7
7
  slots: ComputedRef<ReturnType<typeof autocompleteVariants>>;
@@ -14,6 +14,8 @@ export interface AutocompleteContext {
14
14
  /** What the trigger shows when nothing is chosen, already resolved to the localized default. */
15
15
  placeholder: ComputedRef<string>;
16
16
  isDisabled: ComputedRef<boolean>;
17
+ /** The root's size, which `AutocompleteFilter` hands on to the listbox in the popover. */
18
+ size: ComputedRef<AutocompleteVariants["size"] | undefined>;
17
19
  /**
18
20
  * The group the trigger renders, which the popover is measured and positioned against.
19
21
  *
@@ -189,10 +189,7 @@ var combo_box_root_vue_vue_type_script_setup_true_vapor_true_lang_default = /*@_
189
189
  if (state.selectionMode.value === "single") return texts[0] ?? "";
190
190
  return new Intl.ListFormat(locale.value.locale).format(texts);
191
191
  });
192
- const styles = computed(() => comboBoxVariants({
193
- fullWidth: props.fullWidth,
194
- size: props.size
195
- }));
192
+ const styles = computed(() => comboBoxVariants({ fullWidth: props.fullWidth }));
196
193
  const isDisabled = computed(() => Boolean(props.isDisabled));
197
194
  /**
198
195
  * The options that matched, handed to whoever writes the listbox.
@@ -245,7 +242,8 @@ var combo_box_root_vue_vue_type_script_setup_true_vapor_true_lang_default = /*@_
245
242
  },
246
243
  selection: state.selection,
247
244
  shouldFocusOnHover: true,
248
- shouldUseVirtualFocus: true
245
+ shouldUseVirtualFocus: true,
246
+ size: () => props.size
249
247
  });
250
248
  /**
251
249
  * The popover is anchored to the group around the field, not to the chevron inside it.
@@ -4,7 +4,7 @@ import type { ValidationBehavior, ValidationFunction } from "../../composables/u
4
4
  import type { SelectSelectionMode, SelectedItem, SelectedValue } from "../../composables/use-select-state.js";
5
5
  import type { DisabledBehavior } from "../../composables/use-selection-manager.js";
6
6
  import type { Placement } from "../../utils/position.js";
7
- import type { ComboBoxVariants } from "@ropav/styles";
7
+ import type { InputVariants } from "@ropav/styles";
8
8
  /**
9
9
  * A combo box is a text field that filters a list of options, and the text is part of the value.
10
10
  *
@@ -95,12 +95,15 @@ export interface ComboBoxRootProps<T = unknown> {
95
95
  ariaLabel?: string;
96
96
  ariaLabelledby?: string;
97
97
  ariaDescribedby?: string;
98
- /** How tall the field stands, matching a button of the same size. @default "md" */
99
- size?: ComboBoxVariants["size"];
98
+ /**
99
+ * How tall the field stands, matching a button of the same size. Handed to the `Input` inside and
100
+ * to the listbox in the popover, unless either declares one of its own. @default "md"
101
+ */
102
+ size?: InputVariants["size"];
100
103
  /** Whether the combo box stretches to fill its container. */
101
104
  fullWidth?: boolean;
102
105
  /** Visual variant the `Input` inside picks up. @default "primary" */
103
- variant?: "primary" | "secondary";
106
+ variant?: InputVariants["variant"];
104
107
  }
105
108
  export interface ComboBoxRootEmits {
106
109
  change: [value: SelectedValue];
@@ -59,11 +59,6 @@ var list_box_root_vue_vue_type_script_setup_true_vapor_true_lang_default = /*@__
59
59
  * built the collection out of its own `items`, so naming `T` here restates what went in.
60
60
  */
61
61
  const itemOf = (node) => node?.content;
62
- const styles = computed(() => listboxVariants({
63
- class: props.class,
64
- size: props.size,
65
- variant: props.variant
66
- }));
67
62
  /**
68
63
  * The state this listbox runs on, which is not always its own.
69
64
  *
@@ -72,6 +67,12 @@ var list_box_root_vue_vue_type_script_setup_true_vapor_true_lang_default = /*@__
72
67
  * one is there the listbox borrows it whole rather than keeping a second copy that would drift.
73
68
  */
74
69
  const owner = useListBoxStateContext();
70
+ const resolvedSize = computed(() => props.size ?? toValue(owner?.size));
71
+ const styles = computed(() => listboxVariants({
72
+ class: props.class,
73
+ size: resolvedSize.value,
74
+ variant: props.variant
75
+ }));
75
76
  const ownListId = useId$1();
76
77
  const collectionId = useId$1();
77
78
  const listId = computed(() => toValue(owner?.listId) ?? ownListId.value);
@@ -5,6 +5,7 @@ import type { UseDroppableCollectionStateReturn } from "../../composables/use-dr
5
5
  import type { UseListKeyboardReturn } from "../../composables/use-list-keyboard.js";
6
6
  import type { FocusStrategy } from "../../composables/use-overlay-trigger-state.js";
7
7
  import type { UseSelectionManagerReturn } from "../../composables/use-selection-manager.js";
8
+ import type { ListBoxVariants } from "@ropav/styles";
8
9
  import type { ComputedRef, MaybeRefOrGetter } from "vue";
9
10
  export interface ListBoxContext {
10
11
  collection: UseCollectionReturn;
@@ -66,6 +67,13 @@ export interface ListBoxStateContext {
66
67
  ariaLabel?: MaybeRefOrGetter<string | undefined>;
67
68
  /** Where focus lands when the listbox appears, given how its owner was opened. */
68
69
  autoFocus?: MaybeRefOrGetter<boolean | FocusStrategy | undefined>;
70
+ /**
71
+ * The owner's size, which the listbox's rows take when it declares none of its own.
72
+ *
73
+ * Handed down rather than reached by a selector: a picker's listbox is teleported out of the
74
+ * picker's DOM along with the popover, so no rule keyed on the root can find its rows.
75
+ */
76
+ size?: MaybeRefOrGetter<ListBoxVariants["size"] | undefined>;
69
77
  /** Whether hovering an option moves focus to it. @default false */
70
78
  shouldFocusOnHover?: MaybeRefOrGetter<boolean | undefined>;
71
79
  /**
@@ -6,7 +6,7 @@ export interface SegmentedControlRootProps {
6
6
  /**
7
7
  * The control's scale.
8
8
  *
9
- * The track lands on 32/36/40px, the three heights a button and a field stand at, so a
9
+ * The track lands on 28/32/36/40px, the four heights a button and a field stand at, so a
10
10
  * segmented control lines up with either.
11
11
  *
12
12
  * @default "md"
@@ -170,7 +170,8 @@ var select_root_vue_vue_type_script_setup_true_vapor_true_lang_default = /*@__PU
170
170
  labelledBy: () => select.labelledBy.value,
171
171
  listId: () => select.listId.value,
172
172
  selection: state.selection,
173
- shouldFocusOnHover: true
173
+ shouldFocusOnHover: true,
174
+ size: () => props.size
174
175
  });
175
176
  provideOverlayTargetContext({
176
177
  autoFocus: computed(() => state.focusStrategy.value ?? true),
@@ -60,7 +60,10 @@ export interface SelectRootProps<T = unknown> {
60
60
  ariaLabelledby?: string;
61
61
  ariaDescribedby?: string;
62
62
  variant?: SelectVariants["variant"];
63
- /** How tall the trigger stands, matching a button of the same size. @default "md" */
63
+ /**
64
+ * How tall the trigger stands, matching a button of the same size. Handed to the listbox in the
65
+ * popover, unless it declares one of its own. @default "md"
66
+ */
64
67
  size?: SelectVariants["size"];
65
68
  fullWidth?: boolean;
66
69
  }
@@ -1,9 +1,10 @@
1
+ import type { InputVariants } from "@ropav/styles";
1
2
  import type { ComputedRef } from "vue";
2
3
  export interface TextFieldContext {
3
4
  /** Visual variant the control inside picks up when it declares none of its own. */
4
- variant: ComputedRef<"primary" | "secondary" | undefined>;
5
+ variant: ComputedRef<InputVariants["variant"] | undefined>;
5
6
  /** Size the control inside picks up when it declares none of its own. */
6
- size: ComputedRef<"sm" | "md" | "lg" | undefined>;
7
+ size: ComputedRef<InputVariants["size"] | undefined>;
7
8
  }
8
9
  /**
9
10
  * Carries the variant alone, kept apart from the control context that carries the behaviour.
@@ -1,13 +1,14 @@
1
1
  import type { ValidationBehavior, ValidationDetails, ValidationFunction } from "../../composables/use-form-validation-state.js";
2
+ import type { InputVariants } from "@ropav/styles";
2
3
  export interface TextFieldRootProps {
3
4
  class?: string;
4
5
  /** Visual variant handed down to the control inside. @default "primary" */
5
- variant?: "primary" | "secondary";
6
+ variant?: InputVariants["variant"];
6
7
  /**
7
8
  * How tall the control inside stands, matching a button of the same size. Handed to the control
8
9
  * unless it declares one of its own. @default "md"
9
10
  */
10
- size?: "sm" | "md" | "lg";
11
+ size?: InputVariants["size"];
11
12
  /** Whether the field stretches to fill its container. */
12
13
  fullWidth?: boolean;
13
14
  /** Text in the field. Makes it controlled. */