@lumx/vue 4.11.0-next.0 → 4.11.0-next.2

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.
@@ -3,12 +3,6 @@ import { VueToJSXProps } from '../../utils/VueToJSX';
3
3
  export type FlexBoxProps = VueToJSXProps<UIProps, 'vAlign' | 'hAlign'> & {
4
4
  /** Customize the root element. */
5
5
  as?: string;
6
- /**
7
- * @deprecated please use `class`
8
- * custom class name, used for compatibility when using
9
- * FlexBox as a nested component.
10
- */
11
- className?: string;
12
6
  /** FlexBox vertical alignment */
13
7
  verticalAlign?: UIProps['vAlign'];
14
8
  /** FlexBox horizontal alignment */
@@ -26,12 +20,6 @@ declare const FlexBox: import('vue').DefineSetupFnComponent<FlexBoxProps, {}, {}
26
20
  } & {
27
21
  /** Customize the root element. */
28
22
  as?: string;
29
- /**
30
- * @deprecated please use `class`
31
- * custom class name, used for compatibility when using
32
- * FlexBox as a nested component.
33
- */
34
- className?: string;
35
23
  /** FlexBox vertical alignment */
36
24
  verticalAlign?: UIProps["vAlign"];
37
25
  /** FlexBox horizontal alignment */
@@ -0,0 +1,28 @@
1
+ import { ComputedRef, MaybeRefOrGetter } from 'vue';
2
+ /**
3
+ * Composable that falls back to an `$attrs` value when the Vue prop is absent.
4
+ *
5
+ * When a core JSX component renders a Vue sub-component, it passes props using React naming
6
+ * conventions (e.g. `className`, `tabIndex`). Since these names are not declared Vue props,
7
+ * they land in `$attrs`. This composable reads the fallback attr and merges it with the
8
+ * corresponding Vue prop value using a caller-supplied merge function (or `??` by default).
9
+ *
10
+ * Usage inside `defineComponent` setup:
11
+ * ```tsx
12
+ * // With default merge (vueProp ?? attrFallback):
13
+ * const tabIndex = useAttrFallback(() => attrs.tabindex, 'tabIndex');
14
+ *
15
+ * // With custom merge function:
16
+ * const className = useAttrFallback(
17
+ * () => props.class,
18
+ * 'className',
19
+ * (vue, fallback) => classNames.join(vue, fallback as string | undefined) || undefined,
20
+ * );
21
+ * ```
22
+ *
23
+ * @param vueProp The Vue prop value (or a getter/ref returning it).
24
+ * @param attrFallback The attribute name to read from `$attrs` as the fallback.
25
+ * @param merge Optional merge function. Defaults to `vueProp ?? attrFallback`.
26
+ * @return Computed ref holding the merged value.
27
+ */
28
+ export declare function useAttrFallback<T>(vueProp: MaybeRefOrGetter<T>, attrFallback: string, merge?: (vuePropValue: T, attrFallbackValue: unknown) => T): ComputedRef<T>;
@@ -0,0 +1,15 @@
1
+ import { ComputedRef, MaybeRefOrGetter } from 'vue';
2
+ /**
3
+ * Composable that merges the Vue `class` prop with the `className` attribute (for React compat).
4
+ *
5
+ * Usage inside `defineComponent` setup:
6
+ * ```tsx
7
+ * const className = useClassName(() => props.class);
8
+ * // Then use className.value instead of props.class when forwarding to the core UI:
9
+ * return () => <SomeUI {...props} className={className.value} />;
10
+ * ```
11
+ *
12
+ * @param classProp The Vue `class` prop value (or a getter/ref returning it).
13
+ * @return Computed ref holding the merged class string (or undefined when empty).
14
+ */
15
+ export declare function useClassName(classProp: MaybeRefOrGetter<string | undefined>): ComputedRef<string | undefined>;
@@ -16,10 +16,17 @@ export interface UseRovingTabIndexContainerOptions {
16
16
  * Disabled items are skipped during keyboard navigation.
17
17
  */
18
18
  itemDisabledSelector?: string;
19
+ /**
20
+ * Attribute name indicating the selected item (e.g. `'aria-selected'`, `'aria-checked'`).
21
+ * When set, the roving tabindex will keep `tabindex="0"` in sync with the item
22
+ * whose attribute value is `"true"`.
23
+ * Default: `'aria-selected'`.
24
+ */
25
+ itemSelectedAttr?: string;
19
26
  }
20
27
  /**
21
28
  * Vue composable equivalent of React's useRovingTabIndexContainer.
22
29
  * Sets up roving tab index keyboard navigation on a container element.
23
30
  * Automatically tears down when the container is removed or the composable is unmounted.
24
31
  */
25
- export declare function useRovingTabIndexContainer({ containerRef, itemSelector, onItemFocused, direction, itemDisabledSelector, }: UseRovingTabIndexContainerOptions): void;
32
+ export declare function useRovingTabIndexContainer({ containerRef, itemSelector, onItemFocused, direction, itemDisabledSelector, itemSelectedAttr, }: UseRovingTabIndexContainerOptions): void;