@agentero/design-system 0.8.4 → 0.9.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 +244 -153
- package/mcp/manifests/components.json +1 -1
- package/package.json +7 -6
- package/src/data-table/data-table.d.ts +116 -0
- package/src/data-table/data-table.js +158 -0
- package/src/data-table/icons.d.ts +26 -0
- package/src/data-table/icons.js +38 -0
- package/src/data-table/index.d.ts +4 -0
- package/src/data-table/index.js +3 -0
- package/src/data-table/table.d.ts +124 -0
- package/src/data-table/table.js +182 -0
- package/theme/base.css +0 -14
- package/src/status-ball/index.d.ts +0 -2
- package/src/status-ball/index.js +0 -2
- package/src/status-ball/status-ball.d.ts +0 -93
- package/src/status-ball/status-ball.js +0 -24
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Button as t } from "../button/button.js";
|
|
4
|
+
import { IconKeyboardArrowDown as n } from "./icons.js";
|
|
5
|
+
import { createContext as r, use as i } from "react";
|
|
6
|
+
import { tv as a } from "tailwind-variants";
|
|
7
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
+
//#region src/data-table/table.tsx
|
|
9
|
+
var s = "ps-[var(--table-cell-padding-inline)] pe-[var(--table-cell-padding-inline)] first:ps-[var(--table-cell-padding-inline-ends)] last:pe-[var(--table-cell-padding-inline-ends)] has-[[type=checkbox]]:w-0 has-[[type=checkbox]]:pe-0", c = a({
|
|
10
|
+
slots: {
|
|
11
|
+
root: ["flex min-h-0 flex-1 flex-col overflow-hidden", "[--table-cell-padding-inline:1rem] [--table-cell-padding-inline-ends:1.5rem]"],
|
|
12
|
+
scroll: "min-h-0 flex-1 overflow-auto focus-visible:outline-none",
|
|
13
|
+
table: "w-full has-[[data-slot=table-empty-state]]:h-full"
|
|
14
|
+
},
|
|
15
|
+
variants: {
|
|
16
|
+
size: {
|
|
17
|
+
sm: {},
|
|
18
|
+
md: {},
|
|
19
|
+
lg: {}
|
|
20
|
+
},
|
|
21
|
+
embed: { true: { root: "[--table-cell-padding-inline-ends:1rem]" } },
|
|
22
|
+
sticky: {
|
|
23
|
+
header: {},
|
|
24
|
+
headerAndFooter: {}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: { size: "md" }
|
|
28
|
+
}), l = r(null), u = () => {
|
|
29
|
+
let e = i(l);
|
|
30
|
+
if (!e) throw Error("Table parts must be used within Table.Root");
|
|
31
|
+
return e;
|
|
32
|
+
}, d = r("body"), f = (e) => e === "header" || e === "headerAndFooter", p = (e) => e === "headerAndFooter", m = ({ children: e, ref: t, ...n }) => {
|
|
33
|
+
let { size: r, sticky: i, embed: a } = n, s = c(n);
|
|
34
|
+
return /* @__PURE__ */ o(l, {
|
|
35
|
+
value: {
|
|
36
|
+
header: y({ sticky: f(i) }),
|
|
37
|
+
cell: x({ size: r }),
|
|
38
|
+
headRow: _({ body: !1 }),
|
|
39
|
+
bodyRow: _({
|
|
40
|
+
body: !0,
|
|
41
|
+
divider: !a,
|
|
42
|
+
stickyFooter: p(i)
|
|
43
|
+
})
|
|
44
|
+
},
|
|
45
|
+
children: /* @__PURE__ */ o("div", {
|
|
46
|
+
"data-slot": "table-root",
|
|
47
|
+
className: s.root(),
|
|
48
|
+
children: /* @__PURE__ */ o("div", {
|
|
49
|
+
"data-slot": "table-scroll",
|
|
50
|
+
ref: t,
|
|
51
|
+
tabIndex: 0,
|
|
52
|
+
className: s.scroll(),
|
|
53
|
+
children: /* @__PURE__ */ o("table", {
|
|
54
|
+
"data-slot": "table",
|
|
55
|
+
className: s.table(),
|
|
56
|
+
children: e
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
m.displayName = "Table.Root";
|
|
63
|
+
var h = ({ children: e, ...t }) => /* @__PURE__ */ o(d, {
|
|
64
|
+
value: "head",
|
|
65
|
+
children: /* @__PURE__ */ o("thead", {
|
|
66
|
+
"data-slot": "table-head",
|
|
67
|
+
...t,
|
|
68
|
+
children: e
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
h.displayName = "Table.Head";
|
|
72
|
+
var g = ({ children: e, ...t }) => /* @__PURE__ */ o(d, {
|
|
73
|
+
value: "body",
|
|
74
|
+
children: /* @__PURE__ */ o("tbody", {
|
|
75
|
+
"data-slot": "table-body",
|
|
76
|
+
...t,
|
|
77
|
+
children: e
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
g.displayName = "Table.Body";
|
|
81
|
+
var _ = a({
|
|
82
|
+
base: "transition-colors duration-150",
|
|
83
|
+
variants: {
|
|
84
|
+
body: {
|
|
85
|
+
true: [
|
|
86
|
+
"hover:bg-bg-default-base-secondary hover:has-[[data-slot=table-empty-state]]:bg-transparent",
|
|
87
|
+
"[&:hover_[data-slot=table-row-actions]>*]:opacity-100",
|
|
88
|
+
"[&:hover_[data-slot=table-row-actions]]:after:opacity-100"
|
|
89
|
+
],
|
|
90
|
+
false: ""
|
|
91
|
+
},
|
|
92
|
+
divider: {
|
|
93
|
+
true: "border-t border-border-default-base-primary",
|
|
94
|
+
false: ""
|
|
95
|
+
},
|
|
96
|
+
stickyFooter: {
|
|
97
|
+
true: "last:sticky last:bottom-0 last:z-[1] last:bg-bg-default-base-primary last:shadow-[0_-0.03125rem_0_0_var(--color-border-default-base-primary)]",
|
|
98
|
+
false: ""
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}), v = ({ className: t, ...n }) => {
|
|
102
|
+
let { headRow: r, bodyRow: a } = u(), s = i(d) === "body";
|
|
103
|
+
return /* @__PURE__ */ o("tr", {
|
|
104
|
+
"data-slot": "table-row",
|
|
105
|
+
className: e(s ? a : r, t),
|
|
106
|
+
...n
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
v.displayName = "Table.Row";
|
|
110
|
+
var y = a({
|
|
111
|
+
base: `h-12 text-left align-middle text-sm font-light whitespace-nowrap text-text-default-base-tertiary ${s}`,
|
|
112
|
+
variants: { sticky: {
|
|
113
|
+
true: "sticky top-0 z-[1] bg-bg-default-base-primary shadow-[0_0.03125rem_0_0_var(--color-border-default-base-primary)]",
|
|
114
|
+
false: ""
|
|
115
|
+
} }
|
|
116
|
+
}), b = ({ className: t, ...n }) => {
|
|
117
|
+
let { header: r } = u();
|
|
118
|
+
return /* @__PURE__ */ o("th", {
|
|
119
|
+
"data-slot": "table-header",
|
|
120
|
+
className: e(r, t),
|
|
121
|
+
...n
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
b.displayName = "Table.Header";
|
|
125
|
+
var x = a({
|
|
126
|
+
base: `align-middle text-sm whitespace-nowrap ${s}`,
|
|
127
|
+
variants: { size: {
|
|
128
|
+
sm: "h-12",
|
|
129
|
+
md: "h-16",
|
|
130
|
+
lg: "h-22"
|
|
131
|
+
} },
|
|
132
|
+
defaultVariants: { size: "md" }
|
|
133
|
+
}), S = ({ className: t, ...n }) => {
|
|
134
|
+
let { cell: r } = u();
|
|
135
|
+
return /* @__PURE__ */ o("td", {
|
|
136
|
+
"data-slot": "table-cell",
|
|
137
|
+
className: e(r, t),
|
|
138
|
+
...n
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
S.displayName = "Table.Cell";
|
|
142
|
+
var C = a({ base: "relative z-[1] [&>svg]:shrink-0 [&>svg]:transition-transform [&>svg]:duration-200 data-[state=open]:[&>svg]:rotate-180" }), w = ({ toggleExpanded: r, isExpanded: i, className: a, ...s }) => /* @__PURE__ */ o(t, {
|
|
143
|
+
variant: "ghost",
|
|
144
|
+
onClick: r,
|
|
145
|
+
className: e(C(), a),
|
|
146
|
+
"data-state": i ? "open" : "default",
|
|
147
|
+
"data-slot": "table-expand-button",
|
|
148
|
+
...s,
|
|
149
|
+
children: /* @__PURE__ */ o(n, {})
|
|
150
|
+
});
|
|
151
|
+
w.displayName = "Table.ExpandButton";
|
|
152
|
+
var T = ({ className: t, ...n }) => /* @__PURE__ */ o("tr", {
|
|
153
|
+
"data-slot": "table-expanded-row",
|
|
154
|
+
className: e("border-t border-border-default-base-primary", t),
|
|
155
|
+
...n
|
|
156
|
+
});
|
|
157
|
+
T.displayName = "Table.ExpandedRow";
|
|
158
|
+
var E = a({ base: [
|
|
159
|
+
"relative flex w-fit gap-1",
|
|
160
|
+
"after:absolute after:inset-y-0 after:right-0 after:left-[calc(var(--table-cell-padding-inline)*-1)] after:opacity-0 after:transition-opacity after:duration-150 after:content-[\"\"]",
|
|
161
|
+
"after:[background:linear-gradient(to_right,transparent_0,var(--color-bg-default-base-secondary)_var(--table-cell-padding-inline))]",
|
|
162
|
+
"[&>*]:relative [&>*]:z-[1] [&>*]:opacity-0 [&>*]:transition-opacity [&>*]:duration-150",
|
|
163
|
+
"[@media(hover:none)_and_(pointer:coarse)]:[&>*]:opacity-100"
|
|
164
|
+
] }), D = ({ children: e }) => /* @__PURE__ */ o("div", {
|
|
165
|
+
"data-slot": "table-row-actions",
|
|
166
|
+
className: E(),
|
|
167
|
+
children: e
|
|
168
|
+
});
|
|
169
|
+
D.displayName = "Table.RowActions";
|
|
170
|
+
var O = {
|
|
171
|
+
Root: m,
|
|
172
|
+
Head: h,
|
|
173
|
+
Body: g,
|
|
174
|
+
Row: v,
|
|
175
|
+
Header: b,
|
|
176
|
+
Cell: S,
|
|
177
|
+
ExpandButton: w,
|
|
178
|
+
ExpandedRow: T,
|
|
179
|
+
RowActions: D
|
|
180
|
+
};
|
|
181
|
+
//#endregion
|
|
182
|
+
export { O as Table, c as tableRecipe };
|
package/theme/base.css
CHANGED
|
@@ -676,20 +676,6 @@
|
|
|
676
676
|
--color-focus-ring-button-primary: var(--color-slate-800);
|
|
677
677
|
--color-focus-ring-button-destructive: var(--color-danger-500);
|
|
678
678
|
|
|
679
|
-
/* ========================================
|
|
680
|
-
* STATUS BALL
|
|
681
|
-
* ======================================== */
|
|
682
|
-
|
|
683
|
-
/* Status Ball Backgrounds */
|
|
684
|
-
--color-bg-status-ball-success: var(--color-positive-700);
|
|
685
|
-
--color-bg-status-ball-info: var(--color-blue-600);
|
|
686
|
-
--color-bg-status-ball-warning: var(--color-warning-700);
|
|
687
|
-
--color-bg-status-ball-danger: var(--color-danger-500);
|
|
688
|
-
--color-bg-status-ball-creative: var(--color-purple-500);
|
|
689
|
-
--color-bg-status-ball-dynamic: var(--color-orange-500);
|
|
690
|
-
--color-bg-status-ball-playful: var(--color-pink-500);
|
|
691
|
-
--color-bg-status-ball-neutral: var(--color-neutrals-300);
|
|
692
|
-
|
|
693
679
|
/* Focus Ring */
|
|
694
680
|
--color-focus-ring-button-primary: var(--color-slate-800);
|
|
695
681
|
--color-focus-ring-button-brand: var(--color-slate-800);
|
package/src/status-ball/index.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
import { VariantProps } from 'tailwind-variants';
|
|
3
|
-
/**
|
|
4
|
-
* Style recipe for StatusBall using tailwind-variants. Defines a single `base`
|
|
5
|
-
* (a 8px circle via `size-2 rounded-full`) and a `color` variant that swaps
|
|
6
|
-
* the background across 8 semantic-intent tokens (`--color-bg-status-ball-*`).
|
|
7
|
-
* Consumers typically render `StatusBall` directly; import the recipe only
|
|
8
|
-
* when styling a custom element to match a StatusBall.
|
|
9
|
-
*
|
|
10
|
-
* @summary Tailwind-variants recipe for the StatusBall component
|
|
11
|
-
*/
|
|
12
|
-
export declare const statusBallRecipe: import('tailwind-variants').TVReturnType<{
|
|
13
|
-
color: {
|
|
14
|
-
success: string;
|
|
15
|
-
info: string;
|
|
16
|
-
warning: string;
|
|
17
|
-
danger: string;
|
|
18
|
-
creative: string;
|
|
19
|
-
dynamic: string;
|
|
20
|
-
playful: string;
|
|
21
|
-
neutral: string;
|
|
22
|
-
};
|
|
23
|
-
}, undefined, "size-2 rounded-full", {
|
|
24
|
-
color: {
|
|
25
|
-
success: string;
|
|
26
|
-
info: string;
|
|
27
|
-
warning: string;
|
|
28
|
-
danger: string;
|
|
29
|
-
creative: string;
|
|
30
|
-
dynamic: string;
|
|
31
|
-
playful: string;
|
|
32
|
-
neutral: string;
|
|
33
|
-
};
|
|
34
|
-
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
35
|
-
color: {
|
|
36
|
-
success: string;
|
|
37
|
-
info: string;
|
|
38
|
-
warning: string;
|
|
39
|
-
danger: string;
|
|
40
|
-
creative: string;
|
|
41
|
-
dynamic: string;
|
|
42
|
-
playful: string;
|
|
43
|
-
neutral: string;
|
|
44
|
-
};
|
|
45
|
-
}, undefined, "size-2 rounded-full", unknown, unknown, undefined>>;
|
|
46
|
-
export type StatusBallVariants = VariantProps<typeof statusBallRecipe>;
|
|
47
|
-
export type StatusBallProps = ComponentProps<'div'> & {
|
|
48
|
-
/**
|
|
49
|
-
* Semantic intent of the dot. Defaults to `'neutral'`. Resolve a
|
|
50
|
-
* domain-specific status to an intent via your own lookup table
|
|
51
|
-
* (e.g., `active → success`, `expired → danger`).
|
|
52
|
-
* - `success` — positive / active / confirmed states
|
|
53
|
-
* - `info` — informational / scheduled / in-progress states
|
|
54
|
-
* - `warning` — pending / approaching-expiration states
|
|
55
|
-
* - `danger` — error / expired / blocking states
|
|
56
|
-
* - `creative`, `dynamic`, `playful` — category intents for domain statuses
|
|
57
|
-
* without a direct success/info/warning/danger mapping (e.g., review,
|
|
58
|
-
* flagged, attention)
|
|
59
|
-
* - `neutral` — inactive / unknown / default
|
|
60
|
-
*/
|
|
61
|
-
color?: StatusBallVariants['color'];
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* StatusBall renders a small colored dot used to mark the state of an adjacent
|
|
65
|
-
* label — things like an appointment's confirmation state, a license's validity,
|
|
66
|
-
* or any list-row entry where a single glyph of color conveys the status at a
|
|
67
|
-
* glance. Pair it with text; the dot alone is not announced to assistive
|
|
68
|
-
* technologies, so the surrounding label must carry the meaning.
|
|
69
|
-
*
|
|
70
|
-
* The 8 intents (`success`, `info`, `warning`, `danger`, `creative`,
|
|
71
|
-
* `dynamic`, `playful`, `neutral`) map to semantic tokens
|
|
72
|
-
* (`--color-bg-status-ball-*`) and mirror the convention used by
|
|
73
|
-
* [Alert](?path=/docs/components-alert--docs). Consumers typically resolve a
|
|
74
|
-
* domain-specific status to an intent via their own lookup table
|
|
75
|
-
* (e.g., `active → success`, `expired → danger`).
|
|
76
|
-
*
|
|
77
|
-
* Do **not** use StatusBall as a progress or loading indicator — reach for
|
|
78
|
-
* [Loading](?path=/docs/components-loading--docs) for async state. For
|
|
79
|
-
* section-level alerts with copy, use [Alert](?path=/docs/components-alert--docs)
|
|
80
|
-
* instead.
|
|
81
|
-
*
|
|
82
|
-
* @summary Small colored dot that signals the status of an adjacent label
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* <div className="flex items-center gap-2">
|
|
86
|
-
* <StatusBall color="success" />
|
|
87
|
-
* <span>Active</span>
|
|
88
|
-
* </div>
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* <StatusBall color={statusToIntent[appointment.status]} />
|
|
92
|
-
*/
|
|
93
|
-
export declare const StatusBall: ({ color, className, ...props }: StatusBallProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import { tv as t } from "tailwind-variants";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
//#region src/status-ball/status-ball.tsx
|
|
5
|
-
var r = t({
|
|
6
|
-
base: "size-2 rounded-full",
|
|
7
|
-
variants: { color: {
|
|
8
|
-
success: "bg-bg-status-ball-success",
|
|
9
|
-
info: "bg-bg-status-ball-info",
|
|
10
|
-
warning: "bg-bg-status-ball-warning",
|
|
11
|
-
danger: "bg-bg-status-ball-danger",
|
|
12
|
-
creative: "bg-bg-status-ball-creative",
|
|
13
|
-
dynamic: "bg-bg-status-ball-dynamic",
|
|
14
|
-
playful: "bg-bg-status-ball-playful",
|
|
15
|
-
neutral: "bg-bg-status-ball-neutral"
|
|
16
|
-
} },
|
|
17
|
-
defaultVariants: { color: "neutral" }
|
|
18
|
-
}), i = ({ color: t, className: i, ...a }) => /* @__PURE__ */ n("div", {
|
|
19
|
-
"data-slot": "status-ball",
|
|
20
|
-
className: e(r({ color: t }), i),
|
|
21
|
-
...a
|
|
22
|
-
});
|
|
23
|
-
//#endregion
|
|
24
|
-
export { i as StatusBall, r as statusBallRecipe };
|