@pk-design/react-tailwind 1.2.0 → 1.3.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.
@@ -7,42 +7,48 @@ export type TabsItem = {
7
7
  label: ReactNode;
8
8
  /** Content rendered inside the TabPanel for this tab */
9
9
  content: ReactNode;
10
- /** Optional icon (ReactNode) shown before the label */
10
+ /** Optional icon rendered before the label */
11
11
  icon?: ReactNode;
12
- /** optional id or key; if missing index will be used */
12
+ /** Unique key for this tab; falls back to index when omitted */
13
13
  id?: string | number;
14
+ /** Prevents this tab from being selected */
15
+ disabled?: boolean;
16
+ /** Extra classes applied to this specific tab button */
17
+ tabClass?: string;
18
+ /** Override the default panel className for this specific tab */
19
+ panelClass?: string;
14
20
  };
15
21
  /**
16
22
  * Tabs component props
17
23
  */
18
24
  export interface TabsProps {
19
- /**
20
- * Tabs data (label + panel). Order defines visual order.
21
- */
25
+ /** Tab data array. Order defines visual order. */
22
26
  tabs: TabsItem[];
23
27
  /**
24
- * Variant for the tab list's appearance.
25
- * Only supported values: "underline" | "segmented" | "solid"
26
- *
27
- * - "underline" (default): modern underline indicator under active tab
28
- * - "segmented": segmented pill style where selected tab looks like a pill
29
- * - "solid": solid nav tabs (selected tab has solid background)
28
+ * Visual style of the tab list.
29
+ * - "underline" (default): active tab shows a bottom indicator line
30
+ * - "segmented": active tab renders as a filled pill
31
+ * - "solid": active tab renders with a solid block background
30
32
  */
31
33
  variant?: 'underline' | 'segmented' | 'solid';
32
- /**
33
- * Starting tab index (controlled by TabGroup defaultIndex)
34
- */
34
+ /** Initial selected index (uncontrolled) */
35
35
  defaultIndex?: number;
36
+ /** Controlled selected index — pair with onChange */
37
+ selectedIndex?: number;
38
+ /** Called with the new index whenever the selected tab changes */
39
+ onChange?: (index: number) => void;
36
40
  /**
37
- * Extra classes for the outer group container
41
+ * Layout direction of the tab list.
42
+ * - "horizontal" (default): tabs sit in a row above the panel
43
+ * - "vertical": tabs sit in a column to the left of the panel
38
44
  */
45
+ orientation?: 'horizontal' | 'vertical';
46
+ /** Stretch tabs to fill equal width across the tab list (horizontal only) */
47
+ stretch?: boolean;
48
+ /** Extra classes for the outer TabGroup container */
39
49
  className?: string;
40
- /**
41
- * Extra classes to apply to the TabList wrapper
42
- */
50
+ /** Extra classes for the TabList wrapper */
43
51
  listClass?: string;
44
- /**
45
- * Extra classes to apply to individual TabPanel wrapper
46
- */
47
- panelClass?: string;
52
+ /** Extra classes for the TabPanels wrapper */
53
+ panelsClass?: string;
48
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pk-design/react-tailwind",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "main": "dist/react-tailwind.cjs.js",
5
5
  "module": "dist/react-tailwind.es.js",
6
6
  "types": "dist/types/index.d.ts",