@agentero/design-system 0.26.2 → 0.27.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 +381 -134
- package/mcp/manifests/components.json +330 -42
- package/package.json +6 -1
- package/src/button/button.d.ts +3 -24
- package/src/button/button.js +17 -21
- package/src/checkbox/checkbox.d.ts +74 -0
- package/src/checkbox/checkbox.js +43 -0
- package/src/checkbox/icons.d.ts +5 -0
- package/src/checkbox/icons.js +28 -0
- package/src/checkbox/index.d.ts +2 -0
- package/src/checkbox/index.js +2 -0
- package/src/table/index.d.ts +0 -1
- package/theme/base.css +5 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
+
/** Style recipe for Checkbox. Slots: `root` (the box), `indicator` (the glyph). */
|
|
4
|
+
export declare const checkboxRecipe: import('tailwind-variants').TVReturnType<{
|
|
5
|
+
[key: string]: {
|
|
6
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
7
|
+
root?: import('tailwind-merge').ClassNameValue;
|
|
8
|
+
indicator?: import('tailwind-merge').ClassNameValue;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
} | {
|
|
12
|
+
[x: string]: {
|
|
13
|
+
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
14
|
+
root?: import('tailwind-merge').ClassNameValue;
|
|
15
|
+
indicator?: import('tailwind-merge').ClassNameValue;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
} | {}, {
|
|
19
|
+
root: string[];
|
|
20
|
+
indicator: string;
|
|
21
|
+
}, undefined, {
|
|
22
|
+
[key: string]: {
|
|
23
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
24
|
+
root?: import('tailwind-merge').ClassNameValue;
|
|
25
|
+
indicator?: import('tailwind-merge').ClassNameValue;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
} | {}, {
|
|
29
|
+
root: string[];
|
|
30
|
+
indicator: string;
|
|
31
|
+
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
32
|
+
root: string[];
|
|
33
|
+
indicator: string;
|
|
34
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
35
|
+
/** Radix Checkbox root props; the ones redeclared here are the ones docgen would otherwise omit. */
|
|
36
|
+
export type CheckboxProps = Omit<ComponentPropsWithRef<typeof CheckboxPrimitive.Root>, 'children'> & {
|
|
37
|
+
/** Controlled state. `'indeterminate'` renders a dash and announces `aria-checked="mixed"`. */
|
|
38
|
+
checked?: CheckboxPrimitive.CheckboxProps['checked'];
|
|
39
|
+
/** Initial state for an uncontrolled checkbox. */
|
|
40
|
+
defaultChecked?: CheckboxPrimitive.CheckboxProps['defaultChecked'];
|
|
41
|
+
/** Fires with the next state (`true`, `false` or `'indeterminate'`) on click and on Space. */
|
|
42
|
+
onCheckedChange?: CheckboxPrimitive.CheckboxProps['onCheckedChange'];
|
|
43
|
+
/** Blocks interaction and greys the box out; the value is not submitted. */
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
/** Marks the control required for the browser and assistive technology. */
|
|
46
|
+
required?: boolean;
|
|
47
|
+
/** Form field name. Needed for uncontrolled form usage. */
|
|
48
|
+
name?: string;
|
|
49
|
+
/** Value submitted when checked. Defaults to `'on'`. */
|
|
50
|
+
value?: string;
|
|
51
|
+
/** Drives the destructive border and fill. Point `aria-describedby` at the error message. */
|
|
52
|
+
'aria-invalid'?: ComponentPropsWithRef<'button'>['aria-invalid'];
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Base control for a boolean the user confirms later: one item of a
|
|
56
|
+
* multi-select, a terms tick, a row picked for a bulk action. Supports the
|
|
57
|
+
* mixed state for a parent that summarises a partially selected group.
|
|
58
|
+
* Keeps the legacy 16px surface, glyphs and state colours during adoption.
|
|
59
|
+
*
|
|
60
|
+
* Headless like [Input](?path=/docs/components-input--docs): pair it with
|
|
61
|
+
* [Label](?path=/docs/components-label--docs) and `htmlFor`, or give it an
|
|
62
|
+
* `aria-label`. There is no `status` prop — set `aria-invalid`.
|
|
63
|
+
*
|
|
64
|
+
* Use [Switch](?path=/docs/components-switch--docs) when the change applies
|
|
65
|
+
* immediately, and [CheckList](?path=/docs/components-check-list--docs) for a
|
|
66
|
+
* read-only list of ticked items.
|
|
67
|
+
*
|
|
68
|
+
* @summary Base checkbox control, with mixed state, unaware of form libraries
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* <Label htmlFor="terms">I accept the terms</Label>
|
|
72
|
+
* <Checkbox id="terms" name="terms" required />
|
|
73
|
+
*/
|
|
74
|
+
export declare const Checkbox: ({ className, ref, ...props }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { IconCheck as t, IconMinus as n } from "./icons.js";
|
|
3
|
+
import { tv as r } from "tailwind-variants";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import * as o from "@radix-ui/react-checkbox";
|
|
6
|
+
//#region src/checkbox/checkbox.tsx
|
|
7
|
+
var s = r({ slots: {
|
|
8
|
+
root: [
|
|
9
|
+
"group/checkbox box-border inline-flex size-4 shrink-0 appearance-none items-center justify-center rounded-sm",
|
|
10
|
+
"border border-solid border-border-input-default bg-bg-input-normal",
|
|
11
|
+
"cursor-pointer transition-colors duration-200 ease-in-out",
|
|
12
|
+
"data-[state=checked]:border-bg-checkbox-selected data-[state=checked]:bg-bg-checkbox-selected",
|
|
13
|
+
"data-[state=indeterminate]:border-bg-checkbox-selected data-[state=indeterminate]:bg-bg-checkbox-selected",
|
|
14
|
+
"outline-solid outline-2 outline-offset-2 outline-transparent",
|
|
15
|
+
"focus-visible:outline-focus-ring-button-primary",
|
|
16
|
+
"aria-invalid:border-border-input-destructive",
|
|
17
|
+
"aria-invalid:focus-visible:outline-focus-ring-button-destructive",
|
|
18
|
+
"aria-invalid:data-[state=checked]:border-bg-default-danger-primary aria-invalid:data-[state=checked]:bg-bg-default-danger-primary",
|
|
19
|
+
"aria-invalid:data-[state=indeterminate]:border-bg-default-danger-primary aria-invalid:data-[state=indeterminate]:bg-bg-default-danger-primary",
|
|
20
|
+
"disabled:cursor-not-allowed disabled:border-border-checkbox-disabled",
|
|
21
|
+
"disabled:data-[state=checked]:border-bg-checkbox-disabled disabled:data-[state=checked]:bg-bg-checkbox-disabled",
|
|
22
|
+
"disabled:data-[state=indeterminate]:border-bg-checkbox-disabled disabled:data-[state=indeterminate]:bg-bg-checkbox-disabled",
|
|
23
|
+
"aria-invalid:disabled:border-bg-checkbox-invalid-disabled",
|
|
24
|
+
"aria-invalid:disabled:data-[state=checked]:border-bg-checkbox-invalid-disabled aria-invalid:disabled:data-[state=checked]:bg-bg-checkbox-invalid-disabled",
|
|
25
|
+
"aria-invalid:disabled:data-[state=indeterminate]:border-bg-checkbox-invalid-disabled aria-invalid:disabled:data-[state=indeterminate]:bg-bg-checkbox-invalid-disabled"
|
|
26
|
+
],
|
|
27
|
+
indicator: "flex items-center justify-center text-text-default-base-inverse-primary"
|
|
28
|
+
} }), c = ({ className: r, ref: c, ...l }) => {
|
|
29
|
+
let u = s();
|
|
30
|
+
return /* @__PURE__ */ i(o.Root, {
|
|
31
|
+
ref: c,
|
|
32
|
+
"data-slot": "checkbox",
|
|
33
|
+
className: e(u.root(), r),
|
|
34
|
+
...l,
|
|
35
|
+
children: /* @__PURE__ */ a(o.Indicator, {
|
|
36
|
+
"data-slot": "checkbox-indicator",
|
|
37
|
+
className: u.indicator(),
|
|
38
|
+
children: [/* @__PURE__ */ i(t, { className: "hidden size-3.5 group-data-[state=checked]/checkbox:block" }), /* @__PURE__ */ i(n, { className: "hidden size-3.5 group-data-[state=indeterminate]/checkbox:block" })]
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { c as Checkbox, s as checkboxRecipe };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
/** @summary Material Sharp check used by the legacy checkbox */
|
|
3
|
+
export declare const IconCheck: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
/** @summary Rounded minus used by the legacy checkbox's mixed state */
|
|
5
|
+
export declare const IconMinus: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
//#region src/checkbox/icons.tsx
|
|
3
|
+
var t = (t) => /* @__PURE__ */ e("svg", {
|
|
4
|
+
width: "24",
|
|
5
|
+
height: "24",
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
stroke: "currentColor",
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
...t,
|
|
12
|
+
children: /* @__PURE__ */ e("path", { d: "M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" })
|
|
13
|
+
}), n = (t) => /* @__PURE__ */ e("svg", {
|
|
14
|
+
width: "24",
|
|
15
|
+
height: "24",
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
fill: "none",
|
|
18
|
+
stroke: "currentColor",
|
|
19
|
+
strokeWidth: "2",
|
|
20
|
+
strokeLinecap: "round",
|
|
21
|
+
strokeLinejoin: "round",
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
+
...t,
|
|
25
|
+
children: /* @__PURE__ */ e("path", { d: "M5 12h14" })
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { t as IconCheck, n as IconMinus };
|
package/src/table/index.d.ts
CHANGED
|
@@ -40,7 +40,6 @@ export declare const Table: {
|
|
|
40
40
|
rounded?: boolean;
|
|
41
41
|
align?: "center" | "start" | "end" | "justify";
|
|
42
42
|
fitContent?: boolean;
|
|
43
|
-
scaleOnPress?: boolean;
|
|
44
43
|
ref?: import('react').Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
45
44
|
} & import('react').ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
46
45
|
asChild?: boolean;
|
package/theme/base.css
CHANGED
|
@@ -325,6 +325,11 @@
|
|
|
325
325
|
--color-bg-button-brand-enable: var(--color-brand-600);
|
|
326
326
|
--color-bg-button-brand-hover: var(--color-brand-700);
|
|
327
327
|
|
|
328
|
+
--color-bg-checkbox-selected: var(--color-neutrals-900);
|
|
329
|
+
--color-bg-checkbox-disabled: var(--color-neutrals-200);
|
|
330
|
+
--color-bg-checkbox-invalid-disabled: var(--color-danger-200);
|
|
331
|
+
--color-border-checkbox-disabled: var(--color-neutrals-100);
|
|
332
|
+
|
|
328
333
|
/* Border Tokens */
|
|
329
334
|
--color-border-input-default: var(--color-slate-200);
|
|
330
335
|
--color-border-input-hover: var(--color-slate-400);
|