@lax-wp/design-system 0.6.2 → 0.6.4

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,32 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { Tab, TabOptionConfig } from '../components/navigation/tabs/types';
3
+ export type TabConfig = {
4
+ /** Look up persisted tab settings by key (e.g. from Redux/API) */
5
+ getTabSettings: (tabKey: string) => {
6
+ tab_items?: Tab<string>[];
7
+ tab_options?: TabOptionConfig;
8
+ } | undefined;
9
+ /** Persist tab state (order, visibility, options) to API/store */
10
+ persistTabSettings: (payload: {
11
+ tab_type: string;
12
+ tab_items?: Tab<string>[];
13
+ tab_options?: TabOptionConfig;
14
+ }) => void;
15
+ /** Navigate with search params (for URL sync on tab click) */
16
+ navigate: (search: string) => void;
17
+ /** Read a URL search parameter */
18
+ getSearchParam: (key: string) => string | null;
19
+ };
20
+ export type DesignSystemConfig = {
21
+ tab?: TabConfig;
22
+ table?: Record<string, unknown>;
23
+ theme?: Record<string, unknown>;
24
+ };
25
+ export declare const DesignSystemProvider: ({ config, children, }: {
26
+ config: DesignSystemConfig;
27
+ children: ReactNode;
28
+ }) => import("react/jsx-runtime").JSX.Element;
29
+ /** Returns the full design system config, or undefined if no provider */
30
+ export declare const useDesignSystem: () => DesignSystemConfig | undefined;
31
+ /** Convenience hook — returns the tab config, or undefined if no provider */
32
+ export declare const useTabConfig: () => TabConfig | undefined;
@@ -0,0 +1,2 @@
1
+ export { DesignSystemProvider, useDesignSystem, useTabConfig, } from './DesignSystemProvider';
2
+ export type { DesignSystemConfig, TabConfig } from './DesignSystemProvider';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lax-wp/design-system",
3
3
  "private": false,
4
- "version": "0.6.2",
4
+ "version": "0.6.4",
5
5
  "type": "module",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",