@mijn-ui/react-tabs 0.0.7 → 0.0.9
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/README.md +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +22 -42
- package/dist/metafile-esm.json +1 -1
- package/package.json +13 -10
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
4
|
-
import { UnstyledProps } from '@mijn-ui/react-
|
|
4
|
+
import { UnstyledProps } from '@mijn-ui/react-core';
|
|
5
5
|
|
|
6
6
|
type TabsProps = React.ComponentPropsWithRef<typeof TabsPrimitive.Root> & UnstyledProps;
|
|
7
7
|
declare const Tabs: ({ children, unstyled, ...props }: TabsProps) => react_jsx_runtime.JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -2,54 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
// src/tabs.tsx
|
|
4
4
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { createContext } from "@mijn-ui/react-utilities";
|
|
6
|
+
import { tabsStyles } from "@mijn-ui/react-theme";
|
|
7
|
+
import { useTVUnstyled } from "@mijn-ui/react-hooks";
|
|
7
8
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
var
|
|
9
|
+
var [TabsProvider, useTabsContext] = createContext({
|
|
10
|
+
name: "TabsContext",
|
|
11
|
+
strict: true,
|
|
12
|
+
errorMessage: "useTabsContext: `context` is undefined. Seems you forgot to wrap component within <Tabs />"
|
|
13
|
+
});
|
|
14
|
+
var useTabsStyles = (unstyledOverride) => {
|
|
15
|
+
const context = useTabsContext();
|
|
16
|
+
return useTVUnstyled(context, unstyledOverride);
|
|
17
|
+
};
|
|
18
|
+
var Tabs = ({ children, unstyled = false, ...props }) => {
|
|
19
|
+
const styles = tabsStyles();
|
|
20
|
+
return /* @__PURE__ */ jsx(TabsProvider, { value: { unstyled, styles }, children: /* @__PURE__ */ jsx(TabsPrimitive.Root, { ...props, children }) });
|
|
21
|
+
};
|
|
9
22
|
var TabsList = ({ className, unstyled, ...props }) => {
|
|
10
|
-
const {
|
|
11
|
-
|
|
12
|
-
return /* @__PURE__ */ jsx(
|
|
13
|
-
TabsPrimitive.List,
|
|
14
|
-
{
|
|
15
|
-
className: applyUnstyled(
|
|
16
|
-
isUnstyled,
|
|
17
|
-
"bg-main text-muted-text inline-flex h-10 items-center justify-center rounded-lg p-1",
|
|
18
|
-
className
|
|
19
|
-
),
|
|
20
|
-
...props
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
+
const { list } = useTabsStyles(unstyled);
|
|
24
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.List, { className: list({ className }), ...props });
|
|
23
25
|
};
|
|
24
26
|
var TabsTrigger = ({ className, unstyled, ...props }) => {
|
|
25
|
-
const {
|
|
26
|
-
|
|
27
|
-
return /* @__PURE__ */ jsx(
|
|
28
|
-
TabsPrimitive.Trigger,
|
|
29
|
-
{
|
|
30
|
-
className: applyUnstyled(
|
|
31
|
-
isUnstyled,
|
|
32
|
-
"focus-visible:ring-ring data-[state=active]:bg-surface data-[state=active]:text-main-text inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm",
|
|
33
|
-
className
|
|
34
|
-
),
|
|
35
|
-
...props
|
|
36
|
-
}
|
|
37
|
-
);
|
|
27
|
+
const { trigger } = useTabsStyles(unstyled);
|
|
28
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { className: trigger({ className }), ...props });
|
|
38
29
|
};
|
|
39
30
|
var TabsContent = ({ className, unstyled, ...props }) => {
|
|
40
|
-
const {
|
|
41
|
-
|
|
42
|
-
return /* @__PURE__ */ jsx(
|
|
43
|
-
TabsPrimitive.Content,
|
|
44
|
-
{
|
|
45
|
-
className: applyUnstyled(
|
|
46
|
-
isUnstyled,
|
|
47
|
-
"focus-visible:ring-ring mt-2 focus-visible:outline-none focus-visible:ring-1",
|
|
48
|
-
className
|
|
49
|
-
),
|
|
50
|
-
...props
|
|
51
|
-
}
|
|
52
|
-
);
|
|
31
|
+
const { content } = useTabsStyles(unstyled);
|
|
32
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.Content, { className: content({ className }), ...props });
|
|
53
33
|
};
|
|
54
34
|
export {
|
|
55
35
|
Tabs,
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/tabs.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/tabs.tsx":{"bytes":3553,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-tabs","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-hooks","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":"@radix-ui/react-tabs","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-hooks","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Tabs","TabsContent","TabsList","TabsTrigger"],"entryPoint":"src/index.ts","inputs":{"src/tabs.tsx":{"bytesInOutput":1464},"src/index.ts":{"bytesInOutput":0}},"bytes":1541}}}
|
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.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -20,22 +20,25 @@
|
|
|
20
20
|
"exports": "./dist/index.js",
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"devDependencies": {
|
|
23
|
+
"react": "19.0.0",
|
|
24
|
+
"react-dom": "19.0.0",
|
|
23
25
|
"@next/eslint-plugin-next": "^15.0.3",
|
|
24
|
-
"@types/react": "^
|
|
25
|
-
"@types/react-dom": "^
|
|
26
|
-
"eslint-config-custom": "0.0.1",
|
|
26
|
+
"@types/react": "^19.0.0",
|
|
27
|
+
"@types/react-dom": "^19.0.0",
|
|
27
28
|
"tsconfig": "0.0.0",
|
|
29
|
+
"eslint-config-custom": "0.0.1",
|
|
28
30
|
"tsup-config": "0.0.0"
|
|
29
31
|
},
|
|
30
32
|
"dependencies": {
|
|
31
|
-
"@radix-ui/react-tabs": "^1.1.
|
|
32
|
-
"react": "
|
|
33
|
-
"react-
|
|
34
|
-
"@mijn-ui/react-
|
|
33
|
+
"@radix-ui/react-tabs": "^1.1.2",
|
|
34
|
+
"@mijn-ui/react-core": "0.0.2",
|
|
35
|
+
"@mijn-ui/react-utilities": "0.0.8",
|
|
36
|
+
"@mijn-ui/react-hooks": "0.0.9"
|
|
35
37
|
},
|
|
36
38
|
"peerDependencies": {
|
|
37
39
|
"react": "^19.0",
|
|
38
|
-
"react-dom": "^19.0"
|
|
40
|
+
"react-dom": "^19.0",
|
|
41
|
+
"@mijn-ui/react-theme": "0.0.7"
|
|
39
42
|
},
|
|
40
43
|
"publishConfig": {
|
|
41
44
|
"access": "public"
|
|
@@ -46,7 +49,7 @@
|
|
|
46
49
|
"nextjs"
|
|
47
50
|
],
|
|
48
51
|
"scripts": {
|
|
49
|
-
"clean": "rimraf dist",
|
|
52
|
+
"clean": "rimraf dist .turbo",
|
|
50
53
|
"build": "tsup",
|
|
51
54
|
"lint": "eslint .",
|
|
52
55
|
"lint:fix": "eslint . --fix",
|