@agentero/design-system 0.16.0 → 0.17.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/mcp/manifests/components.html +162 -14
- package/mcp/manifests/components.json +1 -1
- package/package.json +6 -1
- package/src/tabs/index.d.ts +2 -0
- package/src/tabs/index.js +2 -0
- package/src/tabs/tabs.d.ts +135 -0
- package/src/tabs/tabs.js +113 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentero/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "A React component library built with Tailwind CSS v4 and Radix UI primitives",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -73,6 +73,10 @@
|
|
|
73
73
|
"types": "./src/switch/index.d.ts",
|
|
74
74
|
"import": "./src/switch/index.js"
|
|
75
75
|
},
|
|
76
|
+
"./tabs": {
|
|
77
|
+
"types": "./src/tabs/index.d.ts",
|
|
78
|
+
"import": "./src/tabs/index.js"
|
|
79
|
+
},
|
|
76
80
|
"./tag": {
|
|
77
81
|
"types": "./src/tag/index.d.ts",
|
|
78
82
|
"import": "./src/tag/index.js"
|
|
@@ -110,6 +114,7 @@
|
|
|
110
114
|
"@radix-ui/react-separator": "^1.1.8",
|
|
111
115
|
"@radix-ui/react-slot": "^1.2.4",
|
|
112
116
|
"@radix-ui/react-switch": "^1.3.2",
|
|
117
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
113
118
|
"@radix-ui/react-tooltip": "^1.2.11",
|
|
114
119
|
"clsx": "^2.1.1",
|
|
115
120
|
"sonner": "^2.0.7",
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { VariantProps } from 'tailwind-variants';
|
|
3
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
4
|
+
export declare const tabsRecipe: import('tailwind-variants').TVReturnType<{
|
|
5
|
+
variant: {
|
|
6
|
+
line: {
|
|
7
|
+
list: string;
|
|
8
|
+
trigger: string[];
|
|
9
|
+
};
|
|
10
|
+
enclosed: {
|
|
11
|
+
list: string;
|
|
12
|
+
trigger: string;
|
|
13
|
+
};
|
|
14
|
+
button: {
|
|
15
|
+
list: string;
|
|
16
|
+
trigger: string[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
position: {
|
|
20
|
+
center: {
|
|
21
|
+
list: string;
|
|
22
|
+
};
|
|
23
|
+
start: {
|
|
24
|
+
list: string;
|
|
25
|
+
};
|
|
26
|
+
end: {
|
|
27
|
+
list: string;
|
|
28
|
+
};
|
|
29
|
+
full: {
|
|
30
|
+
list: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}, {
|
|
34
|
+
root: string;
|
|
35
|
+
list: string;
|
|
36
|
+
trigger: string[];
|
|
37
|
+
content: string;
|
|
38
|
+
}, undefined, {
|
|
39
|
+
variant: {
|
|
40
|
+
line: {
|
|
41
|
+
list: string;
|
|
42
|
+
trigger: string[];
|
|
43
|
+
};
|
|
44
|
+
enclosed: {
|
|
45
|
+
list: string;
|
|
46
|
+
trigger: string;
|
|
47
|
+
};
|
|
48
|
+
button: {
|
|
49
|
+
list: string;
|
|
50
|
+
trigger: string[];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
position: {
|
|
54
|
+
center: {
|
|
55
|
+
list: string;
|
|
56
|
+
};
|
|
57
|
+
start: {
|
|
58
|
+
list: string;
|
|
59
|
+
};
|
|
60
|
+
end: {
|
|
61
|
+
list: string;
|
|
62
|
+
};
|
|
63
|
+
full: {
|
|
64
|
+
list: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}, {
|
|
68
|
+
root: string;
|
|
69
|
+
list: string;
|
|
70
|
+
trigger: string[];
|
|
71
|
+
content: string;
|
|
72
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
73
|
+
variant: {
|
|
74
|
+
line: {
|
|
75
|
+
list: string;
|
|
76
|
+
trigger: string[];
|
|
77
|
+
};
|
|
78
|
+
enclosed: {
|
|
79
|
+
list: string;
|
|
80
|
+
trigger: string;
|
|
81
|
+
};
|
|
82
|
+
button: {
|
|
83
|
+
list: string;
|
|
84
|
+
trigger: string[];
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
position: {
|
|
88
|
+
center: {
|
|
89
|
+
list: string;
|
|
90
|
+
};
|
|
91
|
+
start: {
|
|
92
|
+
list: string;
|
|
93
|
+
};
|
|
94
|
+
end: {
|
|
95
|
+
list: string;
|
|
96
|
+
};
|
|
97
|
+
full: {
|
|
98
|
+
list: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
}, {
|
|
102
|
+
root: string;
|
|
103
|
+
list: string;
|
|
104
|
+
trigger: string[];
|
|
105
|
+
content: string;
|
|
106
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
107
|
+
type TabsVariants = VariantProps<typeof tabsRecipe>;
|
|
108
|
+
export type TabsRootProps = ComponentProps<typeof TabsPrimitive.Root> & TabsVariants;
|
|
109
|
+
export type TabsListProps = ComponentProps<typeof TabsPrimitive.List>;
|
|
110
|
+
export type TabsTriggerProps = ComponentProps<typeof TabsPrimitive.Trigger>;
|
|
111
|
+
export type TabsContentProps = ComponentProps<typeof TabsPrimitive.Content>;
|
|
112
|
+
/**
|
|
113
|
+
* Tabs built on Radix UI's Tabs (keyboard nav, roving focus and ARIA come for
|
|
114
|
+
* free). Compose `Root` with a `List` of `Trigger`s and matching `Content`s,
|
|
115
|
+
* pairing each `Trigger`/`Content` by `value`.
|
|
116
|
+
*/
|
|
117
|
+
export declare const Tabs: {
|
|
118
|
+
Root: {
|
|
119
|
+
({ className, variant, position, ...props }: TabsRootProps): import("react/jsx-runtime").JSX.Element;
|
|
120
|
+
displayName: string;
|
|
121
|
+
};
|
|
122
|
+
List: {
|
|
123
|
+
({ className, ...props }: TabsListProps): import("react/jsx-runtime").JSX.Element;
|
|
124
|
+
displayName: string;
|
|
125
|
+
};
|
|
126
|
+
Trigger: {
|
|
127
|
+
({ className, ...props }: TabsTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
128
|
+
displayName: string;
|
|
129
|
+
};
|
|
130
|
+
Content: {
|
|
131
|
+
({ className, ...props }: TabsContentProps): import("react/jsx-runtime").JSX.Element;
|
|
132
|
+
displayName: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
export {};
|
package/src/tabs/tabs.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { tv as t } from "tailwind-variants";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { createContext as r, use as i } from "react";
|
|
6
|
+
import * as a from "@radix-ui/react-tabs";
|
|
7
|
+
//#region src/tabs/tabs.tsx
|
|
8
|
+
var o = t({
|
|
9
|
+
slots: {
|
|
10
|
+
root: "flex flex-col",
|
|
11
|
+
list: "z-1 flex shrink-0 overflow-x-auto overflow-y-hidden",
|
|
12
|
+
trigger: [
|
|
13
|
+
"relative cursor-pointer text-sm font-semibold text-text-default-base-secondary transition-colors duration-150",
|
|
14
|
+
"hover:text-text-default-base-primary",
|
|
15
|
+
"focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring-button-primary",
|
|
16
|
+
"data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
17
|
+
"data-[state=active]:text-text-default-base-primary"
|
|
18
|
+
],
|
|
19
|
+
content: ""
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
variant: {
|
|
23
|
+
line: {
|
|
24
|
+
list: "w-full gap-6 border-b border-border-default-base-primary bg-bg-default-base-primary px-4",
|
|
25
|
+
trigger: [
|
|
26
|
+
"grid h-10 content-center",
|
|
27
|
+
"before:absolute before:inset-x-0 before:bottom-0 before:h-0.5 before:origin-bottom before:scale-y-0 before:bg-text-button-secondary-enable before:transition-transform before:duration-200 before:will-change-transform before:content-['']",
|
|
28
|
+
"data-[state=active]:before:scale-y-100"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
enclosed: {
|
|
32
|
+
list: "inline-grid max-w-full auto-cols-fr grid-flow-col rounded-md bg-bg-default-base-tertiary p-1",
|
|
33
|
+
trigger: "flex items-center justify-center rounded-sm px-3 py-1 text-center data-[state=active]:bg-bg-default-base-primary"
|
|
34
|
+
},
|
|
35
|
+
button: {
|
|
36
|
+
list: "gap-2",
|
|
37
|
+
trigger: [
|
|
38
|
+
"flex h-8 items-center gap-2.5 rounded-md px-3 text-sm font-normal text-text-default-base-secondary",
|
|
39
|
+
"[&>svg]:-mx-1 [&>svg]:size-4 [&>svg]:fill-icon-default-base-secondary",
|
|
40
|
+
"hover:bg-bg-default-base-primary-hover data-[state=active]:bg-bg-default-base-primary-hover"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
position: {
|
|
45
|
+
center: { list: "justify-center self-center" },
|
|
46
|
+
start: { list: "self-start" },
|
|
47
|
+
end: { list: "justify-end self-end" },
|
|
48
|
+
full: { list: "w-full self-stretch" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
compoundVariants: [{
|
|
52
|
+
variant: "button",
|
|
53
|
+
position: "start",
|
|
54
|
+
class: { list: "-ml-2.25" }
|
|
55
|
+
}],
|
|
56
|
+
defaultVariants: {
|
|
57
|
+
variant: "line",
|
|
58
|
+
position: "start"
|
|
59
|
+
}
|
|
60
|
+
}), s = r(null), c = () => {
|
|
61
|
+
let e = i(s);
|
|
62
|
+
if (!e) throw Error("Tabs.List, Tabs.Trigger and Tabs.Content must be used within Tabs.Root");
|
|
63
|
+
return e;
|
|
64
|
+
}, l = ({ className: t, variant: r, position: i, ...c }) => {
|
|
65
|
+
let l = o({
|
|
66
|
+
variant: r,
|
|
67
|
+
position: i
|
|
68
|
+
});
|
|
69
|
+
return /* @__PURE__ */ n(s, {
|
|
70
|
+
value: l,
|
|
71
|
+
children: /* @__PURE__ */ n(a.Root, {
|
|
72
|
+
"data-slot": "tabs-root",
|
|
73
|
+
className: e(l.root(), t),
|
|
74
|
+
...c
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
l.displayName = "Tabs.Root";
|
|
79
|
+
var u = ({ className: t, ...r }) => {
|
|
80
|
+
let i = c();
|
|
81
|
+
return /* @__PURE__ */ n(a.List, {
|
|
82
|
+
"data-slot": "tabs-list",
|
|
83
|
+
className: e(i.list(), t),
|
|
84
|
+
...r
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
u.displayName = "Tabs.List";
|
|
88
|
+
var d = ({ className: t, ...r }) => {
|
|
89
|
+
let i = c();
|
|
90
|
+
return /* @__PURE__ */ n(a.Trigger, {
|
|
91
|
+
"data-slot": "tabs-trigger",
|
|
92
|
+
className: e(i.trigger(), t),
|
|
93
|
+
...r
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
d.displayName = "Tabs.Trigger";
|
|
97
|
+
var f = ({ className: t, ...r }) => {
|
|
98
|
+
let i = c();
|
|
99
|
+
return /* @__PURE__ */ n(a.Content, {
|
|
100
|
+
"data-slot": "tabs-content",
|
|
101
|
+
className: e(i.content(), t),
|
|
102
|
+
...r
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
f.displayName = "Tabs.Content";
|
|
106
|
+
var p = {
|
|
107
|
+
Root: l,
|
|
108
|
+
List: u,
|
|
109
|
+
Trigger: d,
|
|
110
|
+
Content: f
|
|
111
|
+
};
|
|
112
|
+
//#endregion
|
|
113
|
+
export { p as Tabs, o as tabsRecipe };
|