@lax-wp/design-system 0.8.0 → 0.8.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.
@@ -9,5 +9,5 @@ type MoreButtonProps = {
9
9
  selectedId: string;
10
10
  suffixRecord?: SuffixRecord;
11
11
  };
12
- declare const MoreButton: ({ variant, size, draggingOver, title, showMoreDropdown, handleShowMoreDropdown, selectedId, suffixRecord, }: MoreButtonProps) => import("react/jsx-runtime").JSX.Element;
13
- export default MoreButton;
12
+ export declare const MoreButton: ({ variant, size, draggingOver, title, showMoreDropdown, handleShowMoreDropdown, selectedId, suffixRecord, }: MoreButtonProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -5,7 +5,7 @@ type TabDragOverlayProps = {
5
5
  size?: TabSize;
6
6
  variant: TabVariant;
7
7
  selectedId: string;
8
- portalContainer?: HTMLElement | null;
8
+ parentContainer?: HTMLElement | null;
9
9
  };
10
- declare const TabDragOverlay: ({ draggingTab, suffixRecord, size, variant, selectedId, portalContainer, }: TabDragOverlayProps) => import("react").ReactPortal;
11
- export default TabDragOverlay;
10
+ export declare const TabDragOverlay: ({ draggingTab, suffixRecord, size, variant, selectedId, parentContainer, }: TabDragOverlayProps) => import("react").ReactPortal;
11
+ export {};
@@ -1,3 +1,2 @@
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;
3
- export default TabSwitch;
2
+ export 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;
@@ -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, portalContainer, tabKey, linkConfig, }: TabsProps<T>) => import("react/jsx-runtime").JSX.Element;
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, onEdit, onDelete, onCopyLink, allowPin, isFullWidth, rightSection, initialTabs: initialTabsProp, tabConfig: tabConfigProp, onTabConfigChange, onTabsChange, parentContainer, tabKey, linkConfig, }: TabsProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const TrashIcon: ({ ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './TrashIcon';
@@ -1,3 +1,9 @@
1
1
  export { Tabs } from './Tabs';
2
+ export { DropableWrapper } from './DropableWrapper';
3
+ export { MoreButton } from './MoreButton';
4
+ export { SortableTab } from './SortableTab';
5
+ export { TabDragOverlay } from './TabDragOverlay';
6
+ export { TabOptions } from './TabOptions';
7
+ export { TabSwitch } from './TabSwitch';
2
8
  export type { TabsProps, TabVariant, TabSize, Tab, TabOptionConfig, SuffixRecord, } from './types';
3
9
  export { INITIAL_TAB_OPTION_CONFIG } from './types';
@@ -70,12 +70,16 @@ 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;
76
+ /** Callback when a tab is edited — when provided, shows an "Edit" option in the tab context menu */
77
+ onEdit?(name: T): void;
75
78
  /** Callback when a tab is deleted */
76
79
  onDelete?(name: T): void;
77
- /** Callback when copy link is triggered receives tab name, should copy and return the URL */
78
- onCopyLink?(name: T): Promise<string>;
80
+ /** Called after the tab link is copied to the clipboard.
81
+ * Receives the tab name and the full URL that was copied — useful for showing a toast or analytics. */
82
+ onCopyLink?(name: T, href: string): void;
79
83
  /** Redux/API persistence key — when provided and a DesignSystemProvider exists,
80
84
  * tab state is automatically loaded and persisted via the provider's tab config */
81
85
  tabKey?: string;
@@ -84,6 +88,8 @@ export type TabsProps<T extends string> = {
84
88
  linkConfig?: {
85
89
  key: string;
86
90
  defaultLink: string;
91
+ /** Called with the URLSearchParams after the tab key is set — mutate to remove/add extra params before navigation */
92
+ onResolve?(searchParams: URLSearchParams): void;
87
93
  };
88
94
  /** Tabs with hidden state pre-configured (e.g. from API) */
89
95
  initialHiddenTabs?: readonly T[];
@@ -96,7 +102,7 @@ export type TabsProps<T extends string> = {
96
102
  /** Callback fired when tabs array changes (reorder, hide, pin — for external persistence) */
97
103
  onTabsChange?(tabs: Tab<T>[]): void;
98
104
  /** Container element for the drag overlay portal */
99
- portalContainer?: HTMLElement | null;
105
+ parentContainer?: HTMLElement | null;
100
106
  };
101
107
  export type ChildrenProps = {
102
108
  isSelected?: boolean;
@@ -121,6 +127,9 @@ export type TabSwitchProps = {
121
127
  tabOptions?: ReactNode;
122
128
  color?: 'light' | 'dark';
123
129
  showCounts?: boolean;
130
+ /** When provided, renders as `<a>` instead of `<button>` for native link behaviour
131
+ * (right-click → open in new tab, middle-click, Ctrl/Cmd+click). */
132
+ href?: string;
124
133
  onClick?(): void;
125
134
  };
126
135
  export declare const INITIAL_TAB_OPTION_CONFIG: TabOptionConfig;