@versini/ui-tabs 1.1.1 → 1.2.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.
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-tabs v1.
|
|
2
|
+
@versini/ui-tabs v1.2.1
|
|
3
3
|
© 2026 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -9,6 +9,8 @@ import { useUniqueId } from "@versini/ui-hooks/use-unique-id";
|
|
|
9
9
|
import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
10
10
|
import clsx from "clsx";
|
|
11
11
|
|
|
12
|
+
|
|
13
|
+
|
|
12
14
|
const TABS_CLASSNAME = "av-tabs";
|
|
13
15
|
const TABS_LIST_CLASSNAME = "av-tabs-list";
|
|
14
16
|
const TABS_TRIGGER_CLASSNAME = "av-tabs-trigger";
|
|
@@ -19,6 +21,7 @@ const TABS_CONTENT_CLASSNAME = "av-tabs-content";
|
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
|
|
24
|
+
|
|
22
25
|
/* v8 ignore start - default context values are fallbacks, never used directly */ const TabsContext = createContext({
|
|
23
26
|
value: undefined,
|
|
24
27
|
tabbableValue: undefined,
|
|
@@ -37,6 +40,7 @@ const TABS_CONTENT_CLASSNAME = "av-tabs-content";
|
|
|
37
40
|
}); /* v8 ignore stop */
|
|
38
41
|
|
|
39
42
|
|
|
43
|
+
|
|
40
44
|
/**
|
|
41
45
|
* `useLayoutEffect` in the browser, `useEffect` on the server — avoids React's
|
|
42
46
|
* "useLayoutEffect does nothing on the server" warning during SSR while keeping
|
|
@@ -75,7 +79,7 @@ const getTabsListClasses = ({ orientation })=>{
|
|
|
75
79
|
const getTabsTriggerSizeClasses = ({ size })=>{
|
|
76
80
|
return clsx({
|
|
77
81
|
"text-xs px-2 py-1": size === "small",
|
|
78
|
-
"text-sm px-4 py-2": size === "medium",
|
|
82
|
+
"text-sm px-2 sm:px-4 py-2": size === "medium",
|
|
79
83
|
"text-base px-5 py-2.5": size === "large"
|
|
80
84
|
});
|
|
81
85
|
};
|
|
@@ -328,6 +332,8 @@ Tabs.displayName = "Tabs";
|
|
|
328
332
|
|
|
329
333
|
|
|
330
334
|
|
|
335
|
+
|
|
336
|
+
|
|
331
337
|
function TabsContent({ value, children, className, ...rest }) {
|
|
332
338
|
const { value: activeValue, mode, baseId, registerPanel, unregisterPanel, getTriggers } = useContext(TabsContext);
|
|
333
339
|
useIsomorphicLayoutEffect(()=>{
|
|
@@ -369,6 +375,10 @@ function TabsContent({ value, children, className, ...rest }) {
|
|
|
369
375
|
TabsContent.displayName = "TabsContent";
|
|
370
376
|
|
|
371
377
|
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
372
382
|
const getNextEnabledIndex = (triggers, currentIndex, direction)=>{
|
|
373
383
|
const count = triggers.length;
|
|
374
384
|
/**
|
|
@@ -524,6 +534,9 @@ TabsList.displayName = "TabsList";
|
|
|
524
534
|
|
|
525
535
|
|
|
526
536
|
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
|
|
527
540
|
function TabsTrigger({ value, children, disabled = false, className, onClick, ...rest }) {
|
|
528
541
|
const { value: activeValue, tabbableValue, setValue, orientation, size, mode, baseId, registerTrigger, unregisterTrigger, hasPanel } = useContext(TabsContext);
|
|
529
542
|
const buttonRef = useRef(null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-tabs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@versini/ui-hooks": "6.1.1",
|
|
45
45
|
"clsx": "2.1.1",
|
|
46
|
-
"tailwindcss": "4.3.
|
|
46
|
+
"tailwindcss": "4.3.1"
|
|
47
47
|
},
|
|
48
48
|
"sideEffects": [
|
|
49
49
|
"**/*.css"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "f25e4b557175f745705c249d10e2e77dc02ed462"
|
|
52
52
|
}
|