@mijn-ui/react-tabs 0.0.4 → 0.0.5
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 +10 -4
- package/dist/index.js +48 -39
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
4
|
+
import { UnstyledProps } from '@mijn-ui/react-utilities/shared';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
declare const
|
|
6
|
-
|
|
7
|
-
declare const
|
|
6
|
+
type TabsProps = React.ComponentPropsWithRef<typeof TabsPrimitive.Root> & UnstyledProps;
|
|
7
|
+
declare const Tabs: ({ children, unstyled, ...props }: TabsProps) => react_jsx_runtime.JSX.Element;
|
|
8
|
+
type TabsListProps = React.ComponentPropsWithRef<typeof TabsPrimitive.List> & UnstyledProps;
|
|
9
|
+
declare const TabsList: ({ className, unstyled, ...props }: TabsListProps) => react_jsx_runtime.JSX.Element;
|
|
10
|
+
type TabsTriggerProps = React.ComponentPropsWithRef<typeof TabsPrimitive.Trigger> & UnstyledProps;
|
|
11
|
+
declare const TabsTrigger: ({ className, unstyled, ...props }: TabsTriggerProps) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
type TabsContentProps = React.ComponentPropsWithRef<typeof TabsPrimitive.Content> & UnstyledProps;
|
|
13
|
+
declare const TabsContent: ({ className, unstyled, ...props }: TabsContentProps) => react_jsx_runtime.JSX.Element;
|
|
8
14
|
|
|
9
15
|
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
package/dist/index.js
CHANGED
|
@@ -1,47 +1,56 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
// src/tabs.tsx
|
|
4
|
-
import * as React from "react";
|
|
5
4
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
6
|
-
import {
|
|
5
|
+
import { applyUnstyled } from "@mijn-ui/react-utilities/shared";
|
|
6
|
+
import { UnstyledProvider, useUnstyled } from "@mijn-ui/react-utilities/context";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
var Tabs = TabsPrimitive.Root;
|
|
9
|
-
var TabsList =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
className
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
8
|
+
var Tabs = ({ children, unstyled = false, ...props }) => /* @__PURE__ */ jsx(UnstyledProvider, { unstyled, children: /* @__PURE__ */ jsx(TabsPrimitive.Root, { ...props, children }) });
|
|
9
|
+
var TabsList = ({ className, unstyled, ...props }) => {
|
|
10
|
+
const { unstyled: contextUnstyled } = useUnstyled();
|
|
11
|
+
const isUnstyled = unstyled ?? contextUnstyled;
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
TabsPrimitive.List,
|
|
14
|
+
{
|
|
15
|
+
className: applyUnstyled(
|
|
16
|
+
isUnstyled,
|
|
17
|
+
"bg-main text-neutral-text inline-flex h-10 items-center justify-center rounded-lg p-1",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
...props
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
var TabsTrigger = ({ className, unstyled, ...props }) => {
|
|
25
|
+
const { unstyled: contextUnstyled } = useUnstyled();
|
|
26
|
+
const isUnstyled = unstyled ?? contextUnstyled;
|
|
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
|
+
);
|
|
38
|
+
};
|
|
39
|
+
var TabsContent = ({ className, unstyled, ...props }) => {
|
|
40
|
+
const { unstyled: contextUnstyled } = useUnstyled();
|
|
41
|
+
const isUnstyled = unstyled ?? contextUnstyled;
|
|
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
|
+
);
|
|
53
|
+
};
|
|
45
54
|
export {
|
|
46
55
|
Tabs,
|
|
47
56
|
TabsContent,
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/tabs.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/tabs.tsx":{"bytes":3162,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@radix-ui/react-tabs","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities/shared","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities/context","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/shared","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities/context","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":1956},"src/index.ts":{"bytesInOutput":0}},"bytes":2033}}}
|