@mijn-ui/react-tabs 0.0.10 → 0.0.11

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 CHANGED
@@ -1,10 +1,12 @@
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-core';
4
+ import { UnstyledProps, UnstyledComponentWithSlots } from '@mijn-ui/react-core';
5
+ import { TabsSlots } from '@mijn-ui/react-theme';
5
6
 
6
- type TabsProps = React.ComponentPropsWithRef<typeof TabsPrimitive.Root> & UnstyledProps;
7
- declare const Tabs: ({ children, unstyled, ...props }: TabsProps) => react_jsx_runtime.JSX.Element;
7
+ type TabsBaseProps = UnstyledComponentWithSlots<TabsSlots>;
8
+ type TabsProps = React.ComponentPropsWithRef<typeof TabsPrimitive.Root> & TabsBaseProps;
9
+ declare const Tabs: ({ children, className, classNames, unstyled, ...props }: TabsProps) => react_jsx_runtime.JSX.Element;
8
10
  type TabsListProps = React.ComponentPropsWithRef<typeof TabsPrimitive.List> & UnstyledProps;
9
11
  declare const TabsList: ({ className, unstyled, ...props }: TabsListProps) => react_jsx_runtime.JSX.Element;
10
12
  type TabsTriggerProps = React.ComponentPropsWithRef<typeof TabsPrimitive.Trigger> & UnstyledProps;
package/dist/index.js CHANGED
@@ -2,7 +2,10 @@
2
2
 
3
3
  // src/tabs.tsx
4
4
  import * as TabsPrimitive from "@radix-ui/react-tabs";
5
- import { createContext } from "@mijn-ui/react-utilities";
5
+ import {
6
+ createTVUnstyledSlots
7
+ } from "@mijn-ui/react-core";
8
+ import { cn, createContext } from "@mijn-ui/react-utilities";
6
9
  import { tabsStyles } from "@mijn-ui/react-theme";
7
10
  import { useTVUnstyled } from "@mijn-ui/react-hooks";
8
11
  import { jsx } from "react/jsx-runtime";
@@ -13,23 +16,62 @@ var [TabsProvider, useTabsContext] = createContext({
13
16
  });
14
17
  var useTabsStyles = (unstyledOverride) => {
15
18
  const context = useTabsContext();
16
- return useTVUnstyled(context, unstyledOverride);
19
+ const unstyledSlots = useTVUnstyled(context, unstyledOverride);
20
+ return { ...unstyledSlots, classNames: context.classNames };
17
21
  };
18
- var Tabs = ({ children, unstyled = false, ...props }) => {
22
+ var Tabs = ({
23
+ children,
24
+ className,
25
+ classNames,
26
+ unstyled = false,
27
+ ...props
28
+ }) => {
19
29
  const styles = tabsStyles();
20
- return /* @__PURE__ */ jsx(TabsProvider, { value: { unstyled, styles }, children: /* @__PURE__ */ jsx(TabsPrimitive.Root, { ...props, children }) });
30
+ const { base } = createTVUnstyledSlots({ base: styles.base }, unstyled);
31
+ return /* @__PURE__ */ jsx(TabsProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsx(
32
+ TabsPrimitive.Root,
33
+ {
34
+ className: base({ className: cn(classNames?.base, className) }),
35
+ ...props,
36
+ children
37
+ }
38
+ ) });
21
39
  };
22
40
  var TabsList = ({ className, unstyled, ...props }) => {
23
- const { list } = useTabsStyles(unstyled);
24
- return /* @__PURE__ */ jsx(TabsPrimitive.List, { className: list({ className }), ...props });
41
+ const { list, classNames } = useTabsStyles(unstyled);
42
+ return /* @__PURE__ */ jsx(
43
+ TabsPrimitive.List,
44
+ {
45
+ className: list({
46
+ className: cn(classNames?.list, className)
47
+ }),
48
+ ...props
49
+ }
50
+ );
25
51
  };
26
52
  var TabsTrigger = ({ className, unstyled, ...props }) => {
27
- const { trigger } = useTabsStyles(unstyled);
28
- return /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { className: trigger({ className }), ...props });
53
+ const { trigger, classNames } = useTabsStyles(unstyled);
54
+ return /* @__PURE__ */ jsx(
55
+ TabsPrimitive.Trigger,
56
+ {
57
+ className: trigger({
58
+ className: cn(classNames?.trigger, className)
59
+ }),
60
+ ...props
61
+ }
62
+ );
29
63
  };
30
64
  var TabsContent = ({ className, unstyled, ...props }) => {
31
- const { content } = useTabsStyles(unstyled);
32
- return /* @__PURE__ */ jsx(TabsPrimitive.Content, { className: content({ className }), ...props });
65
+ const { content, classNames } = useTabsStyles(unstyled);
66
+ return /* @__PURE__ */ jsx(
67
+ TabsPrimitive.Content,
68
+ {
69
+ className: content({
70
+ className: cn(classNames?.content, className)
71
+ }),
72
+ ...props
73
+ }
74
+ );
33
75
  };
34
76
  export {
35
77
  Tabs,
@@ -1 +1 @@
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}}}
1
+ {"inputs":{"src/tabs.tsx":{"bytes":4250,"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-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}],"exports":["Tabs","TabsContent","TabsList","TabsTrigger"],"entryPoint":"src/index.ts","inputs":{"src/tabs.tsx":{"bytesInOutput":2095},"src/index.ts":{"bytesInOutput":0}},"bytes":2172}}}
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.10",
4
+ "version": "0.0.11",
5
5
  "homepage": "https://mijn-ui.vercel.app",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -26,19 +26,20 @@
26
26
  "@types/react": "^19.0.0",
27
27
  "@types/react-dom": "^19.0.0",
28
28
  "@mijn-ui/react-core": "0.0.3",
29
+ "@mijn-ui/react-theme": "0.0.8",
29
30
  "eslint-config-custom": "0.0.1",
30
31
  "tsconfig": "0.0.0",
31
32
  "tsup-config": "0.0.0"
32
33
  },
33
34
  "dependencies": {
34
35
  "@radix-ui/react-tabs": "^1.1.2",
35
- "@mijn-ui/react-hooks": "0.0.10",
36
- "@mijn-ui/react-utilities": "0.0.8"
36
+ "@mijn-ui/react-utilities": "0.0.8",
37
+ "@mijn-ui/react-hooks": "0.0.10"
37
38
  },
38
39
  "peerDependencies": {
39
40
  "react": "^19.0",
40
41
  "react-dom": "^19.0",
41
- "@mijn-ui/react-theme": "^0.0.6",
42
+ "@mijn-ui/react-theme": "^0.0.8",
42
43
  "@mijn-ui/react-core": "^0.0.3"
43
44
  },
44
45
  "publishConfig": {