@lax-wp/design-system 0.7.1 → 0.8.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.
@@ -1,18 +1,41 @@
1
+ /**
2
+ * Represents a single tag item in the ResponsiveTags component.
3
+ */
1
4
  export interface ResponsiveTag {
5
+ /** Unique identifier for the tag */
2
6
  id?: string;
7
+ /** Display text for the tag */
3
8
  label: string;
9
+ /** Color variant for the tag */
4
10
  color?: string;
5
11
  }
12
+ /**
13
+ * Size variants for responsive tags
14
+ */
6
15
  export type ResponsiveTagSize = 'xs' | 'sm' | 'lg' | 'md';
16
+ /**
17
+ * Type for the popover title, can be a string or null to hide the title
18
+ */
7
19
  export type TitleProp = string | null;
20
+ /**
21
+ * Props for the ResponsiveTags component.
22
+ */
8
23
  export interface ResponsiveTagsProps {
24
+ /** Array of tags to display */
9
25
  tags: ResponsiveTag[];
26
+ /** Size variant for all tags. @default 'sm' */
10
27
  size?: ResponsiveTagSize;
28
+ /** Additional CSS classes for the container */
11
29
  className?: string;
30
+ /** Maximum number of visible tags before showing "+X more" */
12
31
  maxVisible?: number;
32
+ /** Icon to display in each tag */
13
33
  icon?: React.ReactNode;
34
+ /** Title to display in the popover header. Set to null to hide. @default null */
14
35
  title?: TitleProp;
36
+ /** Maximum number of characters before truncating tag labels */
15
37
  truncate?: number;
38
+ /** Prevents tags from wrapping to a new line. @default false */
16
39
  noWrap?: boolean;
17
40
  }
18
41
  declare const ResponsiveTags: ({ tags, size, className, maxVisible, icon, title, truncate, noWrap, }: ResponsiveTagsProps) => import("react/jsx-runtime").JSX.Element | "-";
@@ -5,7 +5,7 @@ type TabDragOverlayProps = {
5
5
  size?: TabSize;
6
6
  variant: TabVariant;
7
7
  selectedId: string;
8
- parentContainer?: HTMLElement | null;
8
+ portalContainer?: HTMLElement | null;
9
9
  };
10
- declare const TabDragOverlay: ({ draggingTab, suffixRecord, size, variant, selectedId, parentContainer, }: TabDragOverlayProps) => import("react").ReactPortal;
10
+ declare const TabDragOverlay: ({ draggingTab, suffixRecord, size, variant, selectedId, portalContainer, }: 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, href, 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, 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, parentContainer, 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, onDelete, onCopyLink, allowPin, isFullWidth, rightSection, initialTabs: initialTabsProp, tabConfig: tabConfigProp, onTabConfigChange, onTabsChange, portalContainer, tabKey, linkConfig, }: TabsProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -70,14 +70,12 @@ 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.
74
- * Automatically enabled when `linkConfig` is provided. */
73
+ /** Show copy link option in tab context menu */
75
74
  copyLink?: boolean;
76
75
  /** Callback when a tab is deleted */
77
76
  onDelete?(name: T): void;
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;
77
+ /** Callback when copy link is triggered receives tab name, should copy and return the URL */
78
+ onCopyLink?(name: T): Promise<string>;
81
79
  /** Redux/API persistence key — when provided and a DesignSystemProvider exists,
82
80
  * tab state is automatically loaded and persisted via the provider's tab config */
83
81
  tabKey?: string;
@@ -86,8 +84,6 @@ export type TabsProps<T extends string> = {
86
84
  linkConfig?: {
87
85
  key: string;
88
86
  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;
91
87
  };
92
88
  /** Tabs with hidden state pre-configured (e.g. from API) */
93
89
  initialHiddenTabs?: readonly T[];
@@ -100,7 +96,7 @@ export type TabsProps<T extends string> = {
100
96
  /** Callback fired when tabs array changes (reorder, hide, pin — for external persistence) */
101
97
  onTabsChange?(tabs: Tab<T>[]): void;
102
98
  /** Container element for the drag overlay portal */
103
- parentContainer?: HTMLElement | null;
99
+ portalContainer?: HTMLElement | null;
104
100
  };
105
101
  export type ChildrenProps = {
106
102
  isSelected?: boolean;
@@ -125,9 +121,6 @@ export type TabSwitchProps = {
125
121
  tabOptions?: ReactNode;
126
122
  color?: 'light' | 'dark';
127
123
  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;
131
124
  onClick?(): void;
132
125
  };
133
126
  export declare const INITIAL_TAB_OPTION_CONFIG: TabOptionConfig;