@lumx/vue 4.9.0-next.7 → 4.9.0-next.8
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/components/tabs/Tab.d.ts +16 -0
- package/components/tabs/TabList.d.ts +21 -0
- package/components/tabs/TabPanel.d.ts +16 -0
- package/components/tabs/TabProvider.d.ts +26 -0
- package/components/tabs/TabProvider.stories.d.ts +53 -0
- package/components/tabs/TabProvider.test.d.ts +1 -0
- package/components/tabs/index.d.ts +4 -0
- package/components/tabs/state.d.ts +19 -0
- package/composables/useRovingTabIndexContainer.d.ts +25 -0
- package/index.d.ts +1 -0
- package/index.js +2743 -2247
- package/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TabProps as UIProps, TabPropsToOverride, CLASSNAME, COMPONENT_NAME, DEFAULT_PROPS } from '@lumx/core/js/components/Tabs/Tab';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
export type TabProps = VueToJSXProps<UIProps, TabPropsToOverride>;
|
|
4
|
+
export { CLASSNAME, COMPONENT_NAME, DEFAULT_PROPS };
|
|
5
|
+
/**
|
|
6
|
+
* Tab component.
|
|
7
|
+
*
|
|
8
|
+
* Implements WAI-ARIA `tab` role.
|
|
9
|
+
*
|
|
10
|
+
* @param props Component props.
|
|
11
|
+
* @return Vue element.
|
|
12
|
+
*/
|
|
13
|
+
declare const Tab: import('vue').DefineSetupFnComponent<TabProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | TabPropsToOverride> & {
|
|
14
|
+
class?: string;
|
|
15
|
+
} & {}, import('vue').PublicProps>;
|
|
16
|
+
export default Tab;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TabListProps as UIProps, TabListLayout, COMPONENT_NAME, DEFAULT_PROPS } from '@lumx/core/js/components/Tabs/TabList';
|
|
2
|
+
import { TABS_CLASSNAME as CLASSNAME } from '@lumx/core/js/components/Tabs/constants';
|
|
3
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
4
|
+
type InternalProps = VueToJSXProps<UIProps, 'aria-label'>;
|
|
5
|
+
/** Public props type (includes aria-label for TypeScript consumers). */
|
|
6
|
+
export type TabListProps = InternalProps & {
|
|
7
|
+
'aria-label': string;
|
|
8
|
+
};
|
|
9
|
+
export { TabListLayout, CLASSNAME, COMPONENT_NAME, DEFAULT_PROPS };
|
|
10
|
+
/**
|
|
11
|
+
* TabList component.
|
|
12
|
+
*
|
|
13
|
+
* Implements WAI-ARIA `tablist` role.
|
|
14
|
+
*
|
|
15
|
+
* @param props Component props.
|
|
16
|
+
* @return Vue element.
|
|
17
|
+
*/
|
|
18
|
+
declare const TabList: import('vue').DefineSetupFnComponent<InternalProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "aria-label"> & {
|
|
19
|
+
class?: string;
|
|
20
|
+
} & {}, import('vue').PublicProps>;
|
|
21
|
+
export default TabList;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TabPanelProps as UIProps, TabPanelPropsToOverride, CLASSNAME, COMPONENT_NAME, DEFAULT_PROPS } from '@lumx/core/js/components/Tabs/TabPanel';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
export type TabPanelProps = VueToJSXProps<UIProps, TabPanelPropsToOverride>;
|
|
4
|
+
export { CLASSNAME, COMPONENT_NAME, DEFAULT_PROPS };
|
|
5
|
+
/**
|
|
6
|
+
* TabPanel component.
|
|
7
|
+
*
|
|
8
|
+
* Implements WAI-ARIA `tabpanel` role.
|
|
9
|
+
*
|
|
10
|
+
* @param props Component props.
|
|
11
|
+
* @return Vue element.
|
|
12
|
+
*/
|
|
13
|
+
declare const TabPanel: import('vue').DefineSetupFnComponent<TabPanelProps, {}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | TabPanelPropsToOverride> & {
|
|
14
|
+
class?: string;
|
|
15
|
+
} & {}, import('vue').PublicProps>;
|
|
16
|
+
export default TabPanel;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface TabProviderProps {
|
|
2
|
+
/** Active tab index (controlled mode). */
|
|
3
|
+
activeTabIndex?: number;
|
|
4
|
+
/** Tab panel children should not render if the tab panel is hidden. */
|
|
5
|
+
isLazy?: boolean;
|
|
6
|
+
/** Activate tabs on focus. */
|
|
7
|
+
shouldActivateOnFocus?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const emitSchema: {
|
|
10
|
+
change: (index: number) => boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* This component provides a context in which tabs can be defined and linked to their tab panel.
|
|
14
|
+
*
|
|
15
|
+
* It does not produce any markup so you can wrap it around any Vue elements and then split
|
|
16
|
+
* the TabList and TabPanel components in the component tree.
|
|
17
|
+
*
|
|
18
|
+
* @param props Component props.
|
|
19
|
+
* @return Vue element.
|
|
20
|
+
*/
|
|
21
|
+
declare const TabProvider: import('vue').DefineSetupFnComponent<TabProviderProps, {
|
|
22
|
+
change: (index: number) => boolean;
|
|
23
|
+
}, {}, TabProviderProps & {
|
|
24
|
+
onChange?: ((index: number) => any) | undefined;
|
|
25
|
+
}, import('vue').PublicProps>;
|
|
26
|
+
export default TabProvider;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { TabListLayout } from '../..';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
controls: {
|
|
6
|
+
sort: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
/** Default tab behavior */
|
|
12
|
+
export declare const Default: {
|
|
13
|
+
render: ({ layout, position }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
14
|
+
argTypes: {
|
|
15
|
+
layout: {
|
|
16
|
+
control: {
|
|
17
|
+
type: "select" | "inline-radio";
|
|
18
|
+
};
|
|
19
|
+
options: TabListLayout[];
|
|
20
|
+
mapping: Record<string, TabListLayout> | undefined;
|
|
21
|
+
};
|
|
22
|
+
position: {
|
|
23
|
+
control: {
|
|
24
|
+
type: "select" | "inline-radio";
|
|
25
|
+
};
|
|
26
|
+
options: ("center" | "right" | "left")[];
|
|
27
|
+
mapping: Record<string, "center" | "right" | "left"> | undefined;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/** Control active tab externally. */
|
|
32
|
+
export declare const Controlled: {
|
|
33
|
+
render(): () => import("vue/jsx-runtime").JSX.Element;
|
|
34
|
+
parameters: {
|
|
35
|
+
chromatic: {
|
|
36
|
+
disable: boolean;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
tags: string[];
|
|
40
|
+
};
|
|
41
|
+
/** Dynamically generate tabs. */
|
|
42
|
+
export declare const DynamicTabs: {
|
|
43
|
+
render({ tabCount }: any): () => import("vue/jsx-runtime").JSX.Element;
|
|
44
|
+
args: {
|
|
45
|
+
tabCount: number;
|
|
46
|
+
};
|
|
47
|
+
parameters: {
|
|
48
|
+
chromatic: {
|
|
49
|
+
disable: boolean;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
tags: string[];
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as Tab, type TabProps } from './Tab';
|
|
2
|
+
export { default as TabList, type TabListProps, TabListLayout } from './TabList';
|
|
3
|
+
export { default as TabPanel, type TabPanelProps } from './TabPanel';
|
|
4
|
+
export { default as TabProvider, type TabProviderProps } from './TabProvider';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey, Ref } from 'vue';
|
|
2
|
+
import { Action, State, TabState, TabType } from '@lumx/core/js/components/Tabs/state';
|
|
3
|
+
export { type TabType, type State, INIT_STATE, type Action, reducer, type TabState, } from '@lumx/core/js/components/Tabs/state';
|
|
4
|
+
export type TabProviderContextValue = {
|
|
5
|
+
state: Ref<State>;
|
|
6
|
+
dispatch: (action: Action) => void;
|
|
7
|
+
};
|
|
8
|
+
/** Injection key used by TabProvider (provide) and Tab/TabPanel (inject). */
|
|
9
|
+
export declare const TAB_PROVIDER_INJECT_KEY: InjectionKey<TabProviderContextValue>;
|
|
10
|
+
/**
|
|
11
|
+
* Composable equivalent of React's useTabProviderContext.
|
|
12
|
+
* Registers the tab/tabPanel with the provider on mount and unregisters on unmount.
|
|
13
|
+
* Returns a computed ref with the derived tab state, or undefined if no provider is present.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useTabProviderContext: (type: TabType, originalId?: string) => ComputedRef<TabState | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the raw tab provider state ref, or undefined if no provider is present.
|
|
18
|
+
*/
|
|
19
|
+
export declare const useTabProviderContextState: () => Ref<State> | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export interface UseRovingTabIndexContainerOptions {
|
|
3
|
+
/** Ref to the container element holding the focusable items. */
|
|
4
|
+
containerRef: Ref<HTMLElement | null | undefined>;
|
|
5
|
+
/** CSS selector to identify focusable items within the container. */
|
|
6
|
+
itemSelector: string;
|
|
7
|
+
/** Callback invoked when an item receives focus via keyboard navigation. */
|
|
8
|
+
onItemFocused?: (item: HTMLElement) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Primary navigation axis — determines which arrow keys navigate.
|
|
11
|
+
* Default: 'horizontal' (ArrowLeft/ArrowRight).
|
|
12
|
+
*/
|
|
13
|
+
direction?: 'horizontal' | 'vertical';
|
|
14
|
+
/**
|
|
15
|
+
* CSS selector matching disabled items within the container.
|
|
16
|
+
* Disabled items are skipped during keyboard navigation.
|
|
17
|
+
*/
|
|
18
|
+
itemDisabledSelector?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Vue composable equivalent of React's useRovingTabIndexContainer.
|
|
22
|
+
* Sets up roving tab index keyboard navigation on a container element.
|
|
23
|
+
* Automatically tears down when the container is removed or the composable is unmounted.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useRovingTabIndexContainer({ containerRef, itemSelector, onItemFocused, direction, itemDisabledSelector, }: UseRovingTabIndexContainerOptions): void;
|
package/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export * from './components/uploader';
|
|
|
28
28
|
export * from './components/generic-block';
|
|
29
29
|
export * from './components/inline-list';
|
|
30
30
|
export * from './components/table';
|
|
31
|
+
export * from './components/tabs';
|
|
31
32
|
export * from './components/text';
|
|
32
33
|
export * from './components/thumbnail';
|
|
33
34
|
export * from './components/toolbar';
|