@lax-wp/design-system 0.6.6 → 0.7.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.
@@ -0,0 +1,19 @@
1
+ export interface ResponsiveTag {
2
+ id?: string;
3
+ label: string;
4
+ color?: string;
5
+ }
6
+ export type ResponsiveTagSize = 'xs' | 'sm' | 'lg' | 'md';
7
+ export type TitleProp = string | null;
8
+ export interface ResponsiveTagsProps {
9
+ tags: ResponsiveTag[];
10
+ size?: ResponsiveTagSize;
11
+ className?: string;
12
+ maxVisible?: number;
13
+ icon?: React.ReactNode;
14
+ title?: TitleProp;
15
+ truncate?: number;
16
+ noWrap?: boolean;
17
+ }
18
+ declare const ResponsiveTags: ({ tags, size, className, maxVisible, icon, title, truncate, noWrap, }: ResponsiveTagsProps) => import("react/jsx-runtime").JSX.Element | "-";
19
+ export default ResponsiveTags;
@@ -0,0 +1,2 @@
1
+ export { default as ResponsiveTags } from './ResponsiveTags';
2
+ export type { ResponsiveTag, ResponsiveTagsProps } from './ResponsiveTags';
@@ -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;
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, 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, 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
- /** Callback when copy link is triggered receives tab name, should copy and return the URL */
78
- onCopyLink?(name: T): Promise<string>;
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
- portalContainer?: HTMLElement | null;
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;
@@ -0,0 +1,5 @@
1
+ export interface DimensionsData {
2
+ width: number;
3
+ height: number;
4
+ }
5
+ export declare function useResizeObserver<T extends HTMLElement>(ref: React.RefObject<T>): DimensionsData | undefined;
package/dist/index.d.ts CHANGED
@@ -59,6 +59,8 @@ export type { ModalProps, } from "./components/data-display/modal/Modal";
59
59
  export { FloatingElementWrapper } from "./components/data-display/floating-element-wrapper/floating-element-dragger";
60
60
  export { Tag } from "./components/data-display/tag/Tag";
61
61
  export type { TagProps, TagSize, TagColor, ThemeMode, UploadHandler, } from "./components/data-display/tag/Tag";
62
+ export { default as ResponsiveTags } from "./components/data-display/responsive-tags/ResponsiveTags";
63
+ export type { ResponsiveTag, ResponsiveTagsProps, ResponsiveTagSize, TitleProp as ResponsiveTagsTitleProp, } from "./components/data-display/responsive-tags/ResponsiveTags";
62
64
  export { LabelValue } from "./components/data-display/label-value/LabelValue";
63
65
  export type { LabelValueProps, LabelValueSize, HighlightColor, MasterDataItem, RiskDetails, MasterDataModalProps, RiskDetailsCardProps, } from "./components/data-display/label-value/LabelValue";
64
66
  export { Banner } from "./components/data-display/banner/Banner";
@@ -147,6 +149,8 @@ export { useScrollToTop } from "./hooks/useScrollToTop";
147
149
  export { useEventListener } from "./hooks/useEventListener";
148
150
  export { useIsomorphicLayoutEffect } from "./hooks/useIsomorphicLayoutEffect";
149
151
  export { useKeepSearchBox } from "./hooks/useKeepSearchBox";
152
+ export { useResizeObserver } from "./hooks/useResizeObserver";
153
+ export type { DimensionsData } from "./hooks/useResizeObserver";
150
154
  export { useOS, useShortcutKeys, detectOS, isMacOS, mapShortcutKey, mapShortcutKeys, SHORTCUT_KEY_MAP, } from "./hooks/useOS";
151
155
  export type { OS } from "./hooks/useOS";
152
156
  export { PageContainer, HelmetTitle, Helmet, ComponentLoader, LogoLoader, CustomScrollbar, ZoomContainer } from "./components/layout";