@lax-wp/design-system 0.8.0 → 0.8.1
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/dist/components/navigation/tabs/TabDragOverlay.d.ts +2 -2
- package/dist/components/navigation/tabs/TabSwitch.d.ts +1 -1
- package/dist/components/navigation/tabs/Tabs.d.ts +1 -1
- package/dist/components/navigation/tabs/types.d.ts +11 -4
- package/dist/index.es.js +5676 -5650
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +28 -28
- package/dist/index.umd.js.map +1 -1
- package/dist/providers/design-system-provider/DesignSystemProvider.d.ts +7 -0
- package/dist/providers/design-system-provider/context.d.ts +2 -0
- package/dist/providers/design-system-provider/hooks.d.ts +5 -0
- package/dist/providers/design-system-provider/index.d.ts +3 -0
- package/dist/providers/{DesignSystemProvider.d.ts → design-system-provider/types.d.ts} +1 -10
- package/dist/providers/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ type TabDragOverlayProps = {
|
|
|
5
5
|
size?: TabSize;
|
|
6
6
|
variant: TabVariant;
|
|
7
7
|
selectedId: string;
|
|
8
|
-
|
|
8
|
+
parentContainer?: HTMLElement | null;
|
|
9
9
|
};
|
|
10
|
-
declare const TabDragOverlay: ({ draggingTab, suffixRecord, size, variant, selectedId,
|
|
10
|
+
declare const TabDragOverlay: ({ draggingTab, suffixRecord, size, variant, selectedId, parentContainer, }: TabDragOverlayProps) => import("react").ReactPortal;
|
|
11
11
|
export default TabDragOverlay;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { TabSwitchProps } from './types';
|
|
2
|
-
declare const TabSwitch: ({ showCounts, title, icon, suffixRecord, classValue, isSelected, selectedClassValue, textClassValue, selectedId, iconsOnly, draggingTab, disableAnimation, tabOptions, color, onClick, }: TabSwitchProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const TabSwitch: ({ showCounts, title, icon, suffixRecord, classValue, isSelected, selectedClassValue, textClassValue, selectedId, iconsOnly, draggingTab, disableAnimation, tabOptions, color, href, onClick, }: TabSwitchProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default TabSwitch;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { TabsProps } from './types';
|
|
2
|
-
export declare const Tabs: <T extends string>({ variant, tabs, activeTab, onTabClick, suffixRecord, isLoading, size, className, draggable, showAllItems, copyLink, isDisabled, color, iconsOnly, tabIcons, height, fullWidth, fitContentWidth, disableAnimation, onDelete, onCopyLink, allowPin, isFullWidth, rightSection, initialTabs: initialTabsProp, tabConfig: tabConfigProp, onTabConfigChange, onTabsChange,
|
|
2
|
+
export declare const Tabs: <T extends string>({ variant, tabs, activeTab, onTabClick, suffixRecord, isLoading, size, className, draggable, showAllItems, copyLink, isDisabled, color, iconsOnly, tabIcons, height, fullWidth, fitContentWidth, disableAnimation, onDelete, onCopyLink, allowPin, isFullWidth, rightSection, initialTabs: initialTabsProp, tabConfig: tabConfigProp, onTabConfigChange, onTabsChange, parentContainer, tabKey, linkConfig, }: TabsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -70,12 +70,14 @@ export type TabsProps<T extends string> = {
|
|
|
70
70
|
allowPin?: boolean;
|
|
71
71
|
/** Show all tabs without overflow truncation */
|
|
72
72
|
showAllItems?: boolean;
|
|
73
|
-
/** Show copy link option in tab context menu
|
|
73
|
+
/** Show copy link option in tab context menu.
|
|
74
|
+
* Automatically enabled when `linkConfig` is provided. */
|
|
74
75
|
copyLink?: boolean;
|
|
75
76
|
/** Callback when a tab is deleted */
|
|
76
77
|
onDelete?(name: T): void;
|
|
77
|
-
/**
|
|
78
|
-
|
|
78
|
+
/** Called after the tab link is copied to the clipboard.
|
|
79
|
+
* Receives the tab name and the full URL that was copied — useful for showing a toast or analytics. */
|
|
80
|
+
onCopyLink?(name: T, href: string): void;
|
|
79
81
|
/** Redux/API persistence key — when provided and a DesignSystemProvider exists,
|
|
80
82
|
* tab state is automatically loaded and persisted via the provider's tab config */
|
|
81
83
|
tabKey?: string;
|
|
@@ -84,6 +86,8 @@ export type TabsProps<T extends string> = {
|
|
|
84
86
|
linkConfig?: {
|
|
85
87
|
key: string;
|
|
86
88
|
defaultLink: string;
|
|
89
|
+
/** Called with the URLSearchParams after the tab key is set — mutate to remove/add extra params before navigation */
|
|
90
|
+
onResolve?(searchParams: URLSearchParams): void;
|
|
87
91
|
};
|
|
88
92
|
/** Tabs with hidden state pre-configured (e.g. from API) */
|
|
89
93
|
initialHiddenTabs?: readonly T[];
|
|
@@ -96,7 +100,7 @@ export type TabsProps<T extends string> = {
|
|
|
96
100
|
/** Callback fired when tabs array changes (reorder, hide, pin — for external persistence) */
|
|
97
101
|
onTabsChange?(tabs: Tab<T>[]): void;
|
|
98
102
|
/** Container element for the drag overlay portal */
|
|
99
|
-
|
|
103
|
+
parentContainer?: HTMLElement | null;
|
|
100
104
|
};
|
|
101
105
|
export type ChildrenProps = {
|
|
102
106
|
isSelected?: boolean;
|
|
@@ -121,6 +125,9 @@ export type TabSwitchProps = {
|
|
|
121
125
|
tabOptions?: ReactNode;
|
|
122
126
|
color?: 'light' | 'dark';
|
|
123
127
|
showCounts?: boolean;
|
|
128
|
+
/** When provided, renders as `<a>` instead of `<button>` for native link behaviour
|
|
129
|
+
* (right-click → open in new tab, middle-click, Ctrl/Cmd+click). */
|
|
130
|
+
href?: string;
|
|
124
131
|
onClick?(): void;
|
|
125
132
|
};
|
|
126
133
|
export declare const INITIAL_TAB_OPTION_CONFIG: TabOptionConfig;
|