@mijn-ui/react-tabs 0.2.0 → 0.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.
- package/dist/index.d.ts +85 -31
- package/dist/index.js +20 -10
- package/dist/metafile-esm.json +1 -1
- package/package.json +9 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,90 +1,144 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as _mijn_ui_react_core from '@mijn-ui/react-core';
|
|
3
|
+
import { UnstyledComponentWithSlots } from '@mijn-ui/react-core';
|
|
2
4
|
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
+
import { VariantProps } from 'tailwind-variants';
|
|
6
|
+
import * as tailwind_merge from 'tailwind-merge';
|
|
5
7
|
import * as React from 'react';
|
|
6
8
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
7
9
|
|
|
10
|
+
declare const tabsStyles: tailwind_variants.TVReturnType<{
|
|
11
|
+
[key: string]: {
|
|
12
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
13
|
+
base?: tailwind_merge.ClassNameValue;
|
|
14
|
+
list?: tailwind_merge.ClassNameValue;
|
|
15
|
+
content?: tailwind_merge.ClassNameValue;
|
|
16
|
+
trigger?: tailwind_merge.ClassNameValue;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
} | {
|
|
20
|
+
[x: string]: {
|
|
21
|
+
[x: string]: tailwind_merge.ClassNameValue | {
|
|
22
|
+
base?: tailwind_merge.ClassNameValue;
|
|
23
|
+
list?: tailwind_merge.ClassNameValue;
|
|
24
|
+
content?: tailwind_merge.ClassNameValue;
|
|
25
|
+
trigger?: tailwind_merge.ClassNameValue;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
} | {}, {
|
|
29
|
+
base: string;
|
|
30
|
+
list: string;
|
|
31
|
+
trigger: string[];
|
|
32
|
+
content: string;
|
|
33
|
+
}, undefined, {
|
|
34
|
+
[key: string]: {
|
|
35
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
36
|
+
base?: tailwind_merge.ClassNameValue;
|
|
37
|
+
list?: tailwind_merge.ClassNameValue;
|
|
38
|
+
content?: tailwind_merge.ClassNameValue;
|
|
39
|
+
trigger?: tailwind_merge.ClassNameValue;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
} | {}, {
|
|
43
|
+
base: string;
|
|
44
|
+
list: string;
|
|
45
|
+
trigger: string[];
|
|
46
|
+
content: string;
|
|
47
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
48
|
+
base: string;
|
|
49
|
+
list: string;
|
|
50
|
+
trigger: string[];
|
|
51
|
+
content: string;
|
|
52
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
53
|
+
type TabsVariantProps = VariantProps<typeof tabsStyles>;
|
|
54
|
+
type TabsSlots = keyof ReturnType<typeof tabsStyles>;
|
|
55
|
+
|
|
8
56
|
type TabsBaseProps = UnstyledComponentWithSlots<TabsSlots>;
|
|
9
57
|
type TabsContextType = TabsBaseProps & {
|
|
10
58
|
styles: ReturnType<typeof tabsStyles>;
|
|
11
59
|
};
|
|
12
60
|
declare const useTabsContext: () => TabsContextType;
|
|
13
61
|
declare const useTabsStyles: (unstyledOverride?: boolean) => {
|
|
14
|
-
classNames:
|
|
62
|
+
classNames: _mijn_ui_react_core.SlotsToClasses<"base" | "list" | "content" | "trigger"> | undefined;
|
|
15
63
|
isUnstyled: boolean | undefined;
|
|
16
|
-
base: (slotProps?: ({
|
|
64
|
+
base: (slotProps?: ({
|
|
17
65
|
[x: string]: string | number | undefined;
|
|
18
66
|
[x: number]: string | number | undefined;
|
|
19
|
-
} & tailwind_variants.ClassProp<
|
|
67
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
20
68
|
[x: string]: string | number | undefined;
|
|
21
69
|
[x: number]: string | number | undefined;
|
|
22
|
-
} & tailwind_variants.ClassProp<
|
|
70
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
23
71
|
[x: string]: string | number | undefined;
|
|
24
72
|
[x: number]: string | number | undefined;
|
|
25
|
-
} & tailwind_variants.ClassProp<
|
|
73
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
26
74
|
[x: string]: string | number | undefined;
|
|
27
75
|
[x: number]: string | number | undefined;
|
|
28
|
-
} & tailwind_variants.ClassProp<
|
|
76
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
29
77
|
[x: string]: string | number | undefined;
|
|
30
78
|
[x: number]: string | number | undefined;
|
|
31
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
32
|
-
list: (slotProps?: ({
|
|
79
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
80
|
+
list: (slotProps?: ({
|
|
33
81
|
[x: string]: string | number | undefined;
|
|
34
82
|
[x: number]: string | number | undefined;
|
|
35
|
-
} & tailwind_variants.ClassProp<
|
|
83
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
36
84
|
[x: string]: string | number | undefined;
|
|
37
85
|
[x: number]: string | number | undefined;
|
|
38
|
-
} & tailwind_variants.ClassProp<
|
|
86
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
39
87
|
[x: string]: string | number | undefined;
|
|
40
88
|
[x: number]: string | number | undefined;
|
|
41
|
-
} & tailwind_variants.ClassProp<
|
|
89
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
42
90
|
[x: string]: string | number | undefined;
|
|
43
91
|
[x: number]: string | number | undefined;
|
|
44
|
-
} & tailwind_variants.ClassProp<
|
|
92
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
45
93
|
[x: string]: string | number | undefined;
|
|
46
94
|
[x: number]: string | number | undefined;
|
|
47
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
48
|
-
trigger: (slotProps?: ({
|
|
95
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
96
|
+
trigger: (slotProps?: ({
|
|
49
97
|
[x: string]: string | number | undefined;
|
|
50
98
|
[x: number]: string | number | undefined;
|
|
51
|
-
} & tailwind_variants.ClassProp<
|
|
99
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
52
100
|
[x: string]: string | number | undefined;
|
|
53
101
|
[x: number]: string | number | undefined;
|
|
54
|
-
} & tailwind_variants.ClassProp<
|
|
102
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
55
103
|
[x: string]: string | number | undefined;
|
|
56
104
|
[x: number]: string | number | undefined;
|
|
57
|
-
} & tailwind_variants.ClassProp<
|
|
105
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
58
106
|
[x: string]: string | number | undefined;
|
|
59
107
|
[x: number]: string | number | undefined;
|
|
60
|
-
} & tailwind_variants.ClassProp<
|
|
108
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
61
109
|
[x: string]: string | number | undefined;
|
|
62
110
|
[x: number]: string | number | undefined;
|
|
63
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
64
|
-
content: (slotProps?: ({
|
|
111
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
112
|
+
content: (slotProps?: ({
|
|
65
113
|
[x: string]: string | number | undefined;
|
|
66
114
|
[x: number]: string | number | undefined;
|
|
67
|
-
} & tailwind_variants.ClassProp<
|
|
115
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
68
116
|
[x: string]: string | number | undefined;
|
|
69
117
|
[x: number]: string | number | undefined;
|
|
70
|
-
} & tailwind_variants.ClassProp<
|
|
118
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
71
119
|
[x: string]: string | number | undefined;
|
|
72
120
|
[x: number]: string | number | undefined;
|
|
73
|
-
} & tailwind_variants.ClassProp<
|
|
121
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
74
122
|
[x: string]: string | number | undefined;
|
|
75
123
|
[x: number]: string | number | undefined;
|
|
76
|
-
} & tailwind_variants.ClassProp<
|
|
124
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({
|
|
77
125
|
[x: string]: string | number | undefined;
|
|
78
126
|
[x: number]: string | number | undefined;
|
|
79
|
-
} & tailwind_variants.ClassProp<tailwind_variants.
|
|
127
|
+
} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | ({} & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string | undefined;
|
|
80
128
|
};
|
|
81
129
|
type TabsProps = React.ComponentPropsWithRef<typeof TabsPrimitive.Root> & TabsBaseProps;
|
|
82
130
|
declare const Tabs: ({ children, className, classNames, unstyled, ...props }: TabsProps) => react_jsx_runtime.JSX.Element;
|
|
83
|
-
type TabsListProps = React.ComponentPropsWithRef<typeof TabsPrimitive.List> &
|
|
131
|
+
type TabsListProps = React.ComponentPropsWithRef<typeof TabsPrimitive.List> & {
|
|
132
|
+
unstyled?: boolean;
|
|
133
|
+
};
|
|
84
134
|
declare const TabsList: ({ className, unstyled, ...props }: TabsListProps) => react_jsx_runtime.JSX.Element;
|
|
85
|
-
type TabsTriggerProps = React.ComponentPropsWithRef<typeof TabsPrimitive.Trigger> &
|
|
135
|
+
type TabsTriggerProps = React.ComponentPropsWithRef<typeof TabsPrimitive.Trigger> & {
|
|
136
|
+
unstyled?: boolean;
|
|
137
|
+
};
|
|
86
138
|
declare const TabsTrigger: ({ className, unstyled, ...props }: TabsTriggerProps) => react_jsx_runtime.JSX.Element;
|
|
87
|
-
type TabsContentProps = React.ComponentPropsWithRef<typeof TabsPrimitive.Content> &
|
|
139
|
+
type TabsContentProps = React.ComponentPropsWithRef<typeof TabsPrimitive.Content> & {
|
|
140
|
+
unstyled?: boolean;
|
|
141
|
+
};
|
|
88
142
|
declare const TabsContent: ({ className, unstyled, ...props }: TabsContentProps) => react_jsx_runtime.JSX.Element;
|
|
89
143
|
|
|
90
|
-
export { Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, useTabsContext, useTabsStyles };
|
|
144
|
+
export { Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, type TabsSlots, TabsTrigger, type TabsTriggerProps, type TabsVariantProps, tabsStyles, useTabsContext, useTabsStyles };
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// src/tabs.tsx
|
|
4
|
-
import { createTVUnstyledSlots } from "@mijn-ui/react-core";
|
|
5
|
-
import { useTVUnstyled } from "@mijn-ui/react-hooks";
|
|
6
4
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
createContext,
|
|
6
|
+
createTVUnstyledSlots,
|
|
7
|
+
useTVUnstyled
|
|
8
|
+
} from "@mijn-ui/react-core";
|
|
11
9
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
10
|
+
import { cnBase, tv } from "tailwind-variants";
|
|
12
11
|
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var tabsStyles = tv({
|
|
13
|
+
slots: {
|
|
14
|
+
base: "",
|
|
15
|
+
list: "flex flex-col items-stretch sm:flex-row sm:items-center",
|
|
16
|
+
trigger: [
|
|
17
|
+
"text-fg-secondary hover:bg-bg-secondary focus-visible:bg-bg-secondary active:bg-bg-secondary/70 data-[state=active]:border-b-outline-brand data-[state=active]:text-fg-brand-emphasis data-[state=active]:hover:text-fg-brand-emphasis inline-flex h-9 items-center justify-center gap-1.5 border-b px-3 text-sm font-normal leading-none outline-none duration-300 ease-in-out disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-b-2 data-[state=active]:font-medium data-[state=active]:hover:bg-transparent"
|
|
18
|
+
],
|
|
19
|
+
content: "focus-visible:ring-outline-brand mt-2 focus-visible:outline-none focus-visible:ring-1"
|
|
20
|
+
}
|
|
21
|
+
});
|
|
13
22
|
var [TabsProvider, useTabsContext] = createContext({
|
|
14
23
|
name: "TabsContext",
|
|
15
24
|
strict: true,
|
|
@@ -32,7 +41,7 @@ var Tabs = ({
|
|
|
32
41
|
return /* @__PURE__ */ jsx(TabsProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsx(
|
|
33
42
|
TabsPrimitive.Root,
|
|
34
43
|
{
|
|
35
|
-
className: base({ className:
|
|
44
|
+
className: base({ className: cnBase(classNames?.base, className) }),
|
|
36
45
|
...props,
|
|
37
46
|
children
|
|
38
47
|
}
|
|
@@ -44,7 +53,7 @@ var TabsList = ({ className, unstyled, ...props }) => {
|
|
|
44
53
|
TabsPrimitive.List,
|
|
45
54
|
{
|
|
46
55
|
className: list({
|
|
47
|
-
className:
|
|
56
|
+
className: cnBase(classNames?.list, className)
|
|
48
57
|
}),
|
|
49
58
|
...props
|
|
50
59
|
}
|
|
@@ -56,7 +65,7 @@ var TabsTrigger = ({ className, unstyled, ...props }) => {
|
|
|
56
65
|
TabsPrimitive.Trigger,
|
|
57
66
|
{
|
|
58
67
|
className: trigger({
|
|
59
|
-
className:
|
|
68
|
+
className: cnBase(classNames?.trigger, className)
|
|
60
69
|
}),
|
|
61
70
|
...props
|
|
62
71
|
}
|
|
@@ -68,7 +77,7 @@ var TabsContent = ({ className, unstyled, ...props }) => {
|
|
|
68
77
|
TabsPrimitive.Content,
|
|
69
78
|
{
|
|
70
79
|
className: content({
|
|
71
|
-
className:
|
|
80
|
+
className: cnBase(classNames?.content, className)
|
|
72
81
|
}),
|
|
73
82
|
...props
|
|
74
83
|
}
|
|
@@ -79,6 +88,7 @@ export {
|
|
|
79
88
|
TabsContent,
|
|
80
89
|
TabsList,
|
|
81
90
|
TabsTrigger,
|
|
91
|
+
tabsStyles,
|
|
82
92
|
useTabsContext,
|
|
83
93
|
useTabsStyles
|
|
84
94
|
};
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/tabs.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/tabs.tsx":{"bytes":5232,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@radix-ui/react-tabs","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":23,"imports":[{"path":"src/tabs.tsx","kind":"import-statement","original":"./tabs"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@radix-ui/react-tabs","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Tabs","TabsContent","TabsList","TabsTrigger","tabsStyles","useTabsContext","useTabsStyles"],"entryPoint":"src/index.ts","inputs":{"src/tabs.tsx":{"bytesInOutput":2802},"src/index.ts":{"bytesInOutput":0}},"bytes":2943}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mijn-ui/react-tabs",
|
|
3
3
|
"author": "Htet Aung Lin<htetaunglin.coder@gmail.com>",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -25,25 +25,23 @@
|
|
|
25
25
|
"@next/eslint-plugin-next": "^15.0.3",
|
|
26
26
|
"@types/react": "^19.0.0",
|
|
27
27
|
"@types/react-dom": "^19.0.0",
|
|
28
|
-
"@mijn-ui/react-button": "0.
|
|
29
|
-
"@mijn-ui/react-card": "0.
|
|
30
|
-
"@mijn-ui/react-input": "0.
|
|
31
|
-
"@mijn-ui/react-core": "0.
|
|
32
|
-
"@mijn-ui/react-theme": "0.2.0",
|
|
28
|
+
"@mijn-ui/react-button": "0.3.0",
|
|
29
|
+
"@mijn-ui/react-card": "0.3.0",
|
|
30
|
+
"@mijn-ui/react-input": "0.3.0",
|
|
31
|
+
"@mijn-ui/react-core": "0.3.0",
|
|
33
32
|
"eslint-config-custom": "0.0.1",
|
|
34
33
|
"tsconfig": "0.0.0",
|
|
35
34
|
"tsup-config": "0.0.0"
|
|
36
35
|
},
|
|
37
36
|
"dependencies": {
|
|
38
|
-
"@radix-ui/react-tabs": "^1.1.2"
|
|
39
|
-
"@mijn-ui/react-utilities": "0.0.9",
|
|
40
|
-
"@mijn-ui/react-hooks": "0.0.18"
|
|
37
|
+
"@radix-ui/react-tabs": "^1.1.2"
|
|
41
38
|
},
|
|
42
39
|
"peerDependencies": {
|
|
43
40
|
"react": "^19.0",
|
|
44
41
|
"react-dom": "^19.0",
|
|
45
|
-
"@mijn-ui/react-
|
|
46
|
-
"
|
|
42
|
+
"@mijn-ui/react-core": "^0.3.0",
|
|
43
|
+
"tailwind-merge": "^3.0.0",
|
|
44
|
+
"tailwind-variants": "^3.0.0"
|
|
47
45
|
},
|
|
48
46
|
"publishConfig": {
|
|
49
47
|
"access": "public"
|