@agentero/design-system 0.17.0 → 0.18.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentero/design-system",
3
- "version": "0.17.0",
3
+ "version": "0.18.1",
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",
@@ -57,6 +57,10 @@
57
57
  "types": "./src/loading/index.d.ts",
58
58
  "import": "./src/loading/index.js"
59
59
  },
60
+ "./modal": {
61
+ "types": "./src/modal/index.d.ts",
62
+ "import": "./src/modal/index.js"
63
+ },
60
64
  "./pagination": {
61
65
  "types": "./src/pagination/index.d.ts",
62
66
  "import": "./src/pagination/index.js"
@@ -109,6 +113,7 @@
109
113
  "dependencies": {
110
114
  "@radix-ui/react-accordion": "^1.2.14",
111
115
  "@radix-ui/react-avatar": "^1.1.11",
116
+ "@radix-ui/react-dialog": "^1.1.19",
112
117
  "@radix-ui/react-dropdown-menu": "^2.1.16",
113
118
  "@radix-ui/react-progress": "^1.1.12",
114
119
  "@radix-ui/react-separator": "^1.1.8",
@@ -0,0 +1 @@
1
+ export declare const IconClose: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ //#region src/modal/icons.tsx
3
+ var t = () => /* @__PURE__ */ e("svg", {
4
+ viewBox: "0 0 24 24",
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ "aria-hidden": !0,
7
+ children: /* @__PURE__ */ e("path", { d: "M12 13.0538L6.92689 18.1269C6.78844 18.2654 6.6144 18.3362 6.40479 18.3394C6.19519 18.3426 6.01795 18.2718 5.87309 18.1269C5.7282 17.982 5.65576 17.8064 5.65576 17.6C5.65576 17.3936 5.7282 17.218 5.87309 17.0731L10.9462 12L5.87309 6.92689C5.73462 6.78844 5.66379 6.6144 5.66059 6.40479C5.65737 6.19519 5.7282 6.01795 5.87309 5.87309C6.01795 5.7282 6.19359 5.65576 6.39999 5.65576C6.60639 5.65576 6.78202 5.7282 6.92689 5.87309L12 10.9462L17.0731 5.87309C17.2115 5.73462 17.3856 5.66379 17.5952 5.66059C17.8048 5.65737 17.982 5.7282 18.1269 5.87309C18.2718 6.01795 18.3442 6.19359 18.3442 6.39999C18.3442 6.60639 18.2718 6.78202 18.1269 6.92689L13.0538 12L18.1269 17.0731C18.2654 17.2115 18.3362 17.3856 18.3394 17.5952C18.3426 17.8048 18.2718 17.982 18.1269 18.1269C17.982 18.2718 17.8064 18.3442 17.6 18.3442C17.3936 18.3442 17.218 18.2718 17.0731 18.1269L12 13.0538Z" })
8
+ });
9
+ //#endregion
10
+ export { t as IconClose };
@@ -0,0 +1 @@
1
+ export { Modal, modalRecipe } from './modal';
@@ -0,0 +1,2 @@
1
+ import { Modal as e, modalRecipe as t } from "./modal.js";
2
+ export { e as Modal, t as modalRecipe };
@@ -0,0 +1,126 @@
1
+ import { ComponentProps } from 'react';
2
+ import { VariantProps } from 'tailwind-variants';
3
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
4
+ type RootProps = ComponentProps<typeof DialogPrimitive.Root>;
5
+ type TriggerProps = ComponentProps<typeof DialogPrimitive.Trigger>;
6
+ export declare const modalRecipe: import('tailwind-variants').TVReturnType<{
7
+ size: {
8
+ md: {
9
+ content: string;
10
+ };
11
+ lg: {
12
+ content: string;
13
+ };
14
+ };
15
+ }, {
16
+ overlay: string[];
17
+ content: string[];
18
+ title: string;
19
+ body: string;
20
+ footer: string;
21
+ }, undefined, {
22
+ size: {
23
+ md: {
24
+ content: string;
25
+ };
26
+ lg: {
27
+ content: string;
28
+ };
29
+ };
30
+ }, {
31
+ overlay: string[];
32
+ content: string[];
33
+ title: string;
34
+ body: string;
35
+ footer: string;
36
+ }, import('tailwind-variants').TVReturnType<{
37
+ size: {
38
+ md: {
39
+ content: string;
40
+ };
41
+ lg: {
42
+ content: string;
43
+ };
44
+ };
45
+ }, {
46
+ overlay: string[];
47
+ content: string[];
48
+ title: string;
49
+ body: string;
50
+ footer: string;
51
+ }, undefined, unknown, unknown, undefined>>;
52
+ type ModalVariants = VariantProps<typeof modalRecipe>;
53
+ type ContentProps = ComponentProps<typeof DialogPrimitive.Content> & {
54
+ /**
55
+ * Width of the modal. Defaults to `'md'` (540px); `'lg'` is 720px.
56
+ * Both shrink to the viewport on small screens.
57
+ */
58
+ size?: ModalVariants['size'];
59
+ };
60
+ type TitleProps = ComponentProps<typeof DialogPrimitive.Title>;
61
+ type BodyProps = ComponentProps<'div'>;
62
+ type FooterProps = ComponentProps<'div'>;
63
+ type CloseProps = ComponentProps<typeof DialogPrimitive.Close>;
64
+ /**
65
+ * Modal is the compound component for dialogs that interrupt the flow —
66
+ * confirmations, forms, and detail views. Built on Radix UI Dialog, so focus
67
+ * trapping, scroll locking, `Escape`/overlay dismissal, and ARIA wiring come
68
+ * for free.
69
+ *
70
+ * Compose `Root` (open state) with `Content` (surface, `size` md/lg), and
71
+ * fill it with `Title` (built-in X button), `Body` (scrollable), and `Footer`
72
+ * (right-aligned actions). Open it controlled (`open`/`onOpenChange`) or via
73
+ * `Trigger`; close from inside with `Close asChild` around your cancel button.
74
+ *
75
+ * @summary Compound modal dialog over a dimmed overlay
76
+ *
77
+ * @example
78
+ * ```tsx
79
+ * <Modal.Root open={isOpen} onOpenChange={setIsOpen}>
80
+ * <Modal.Content size="md">
81
+ * <Modal.Title>Delete carrier</Modal.Title>
82
+ * <Modal.Body>This action cannot be undone.</Modal.Body>
83
+ * <Modal.Footer>
84
+ * <Modal.Close asChild>
85
+ * <Button variant="ghost">Cancel</Button>
86
+ * </Modal.Close>
87
+ * <Button onClick={handleDelete}>Delete</Button>
88
+ * </Modal.Footer>
89
+ * </Modal.Content>
90
+ * </Modal.Root>
91
+ * ```
92
+ *
93
+ * @component
94
+ * @namespace Modal
95
+ */
96
+ export declare const Modal: {
97
+ Root: {
98
+ (props: RootProps): import("react/jsx-runtime").JSX.Element;
99
+ displayName: string;
100
+ };
101
+ Trigger: {
102
+ (props: TriggerProps): import("react/jsx-runtime").JSX.Element;
103
+ displayName: string;
104
+ };
105
+ Content: {
106
+ ({ className, size, children, ...props }: ContentProps): import("react/jsx-runtime").JSX.Element;
107
+ displayName: string;
108
+ };
109
+ Title: {
110
+ ({ className, children, ...props }: TitleProps): import("react/jsx-runtime").JSX.Element;
111
+ displayName: string;
112
+ };
113
+ Body: {
114
+ ({ className, ...props }: BodyProps): import("react/jsx-runtime").JSX.Element;
115
+ displayName: string;
116
+ };
117
+ Footer: {
118
+ ({ className, ...props }: FooterProps): import("react/jsx-runtime").JSX.Element;
119
+ displayName: string;
120
+ };
121
+ Close: {
122
+ (props: CloseProps): import("react/jsx-runtime").JSX.Element;
123
+ displayName: string;
124
+ };
125
+ };
126
+ export {};
@@ -0,0 +1,102 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/utils.js";
3
+ import { Button as t } from "../button/button.js";
4
+ import { IconClose as n } from "./icons.js";
5
+ import { tv as r } from "tailwind-variants";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ import * as o from "@radix-ui/react-dialog";
8
+ //#region src/modal/modal.tsx
9
+ var s = (e) => /* @__PURE__ */ i(o.Root, {
10
+ "data-slot": "modal-root",
11
+ ...e
12
+ });
13
+ s.displayName = "Modal.Root";
14
+ var c = (e) => /* @__PURE__ */ i(o.Trigger, {
15
+ "data-slot": "modal-trigger",
16
+ ...e
17
+ });
18
+ c.displayName = "Modal.Trigger";
19
+ var l = r({
20
+ slots: {
21
+ overlay: [
22
+ "fixed inset-0 z-(--z-index-overlay) bg-overlay-dark-300",
23
+ "data-[state=open]:animate-modal-overlay-in data-[state=closed]:animate-modal-overlay-out",
24
+ "motion-reduce:animate-none!"
25
+ ],
26
+ content: [
27
+ "fixed top-1/2 left-1/2 z-(--z-index-modal) -translate-x-1/2 -translate-y-1/2",
28
+ "flex max-h-[calc(100dvh-4rem)] w-[calc(100vw-2rem)] flex-col gap-6",
29
+ "rounded-lg bg-bg-default-base-primary py-10 shadow-sm outline-none",
30
+ "data-[state=open]:animate-modal-content-in data-[state=closed]:animate-modal-content-out",
31
+ "motion-reduce:animate-none!"
32
+ ],
33
+ title: "flex items-start justify-between gap-2 px-10 text-[1.375rem] leading-7 font-semibold text-text-default-base-primary",
34
+ body: "-my-1 max-h-[60vh] overflow-y-auto px-10 py-1",
35
+ footer: "flex shrink-0 items-center justify-end gap-2 px-10"
36
+ },
37
+ variants: { size: {
38
+ md: { content: "max-w-[33.75rem]" },
39
+ lg: { content: "max-w-[45rem]" }
40
+ } },
41
+ defaultVariants: { size: "md" }
42
+ }), u = l(), d = ({ className: t, size: n, children: r, ...s }) => {
43
+ let c = l({ size: n });
44
+ return /* @__PURE__ */ a(o.Portal, { children: [/* @__PURE__ */ i(o.Overlay, {
45
+ "data-slot": "modal-overlay",
46
+ className: c.overlay()
47
+ }), /* @__PURE__ */ i(o.Content, {
48
+ "data-slot": "modal-content",
49
+ "aria-describedby": void 0,
50
+ className: e(c.content(), t),
51
+ ...s,
52
+ children: r
53
+ })] });
54
+ };
55
+ d.displayName = "Modal.Content";
56
+ var f = ({ className: e, children: r, ...s }) => /* @__PURE__ */ a("div", {
57
+ "data-slot": "modal-title",
58
+ className: u.title({ className: e }),
59
+ children: [/* @__PURE__ */ i(o.Title, {
60
+ ...s,
61
+ children: r
62
+ }), /* @__PURE__ */ i(o.Close, {
63
+ asChild: !0,
64
+ children: /* @__PURE__ */ i(t, {
65
+ variant: "ghost",
66
+ size: "sm",
67
+ "aria-label": "Close",
68
+ className: "-my-2 -mr-6 shrink-0",
69
+ children: /* @__PURE__ */ i(n, {})
70
+ })
71
+ })]
72
+ });
73
+ f.displayName = "Modal.Title";
74
+ var p = ({ className: e, ...t }) => /* @__PURE__ */ i("div", {
75
+ "data-slot": "modal-body",
76
+ tabIndex: 0,
77
+ className: u.body({ className: e }),
78
+ ...t
79
+ });
80
+ p.displayName = "Modal.Body";
81
+ var m = ({ className: e, ...t }) => /* @__PURE__ */ i("div", {
82
+ "data-slot": "modal-footer",
83
+ className: u.footer({ className: e }),
84
+ ...t
85
+ });
86
+ m.displayName = "Modal.Footer";
87
+ var h = (e) => /* @__PURE__ */ i(o.Close, {
88
+ "data-slot": "modal-close",
89
+ ...e
90
+ });
91
+ h.displayName = "Modal.Close";
92
+ var g = {
93
+ Root: s,
94
+ Trigger: c,
95
+ Content: d,
96
+ Title: f,
97
+ Body: p,
98
+ Footer: m,
99
+ Close: h
100
+ };
101
+ //#endregion
102
+ export { g as Modal, l as modalRecipe };
package/src/tabs/tabs.js CHANGED
@@ -10,7 +10,7 @@ var o = t({
10
10
  root: "flex flex-col",
11
11
  list: "z-1 flex shrink-0 overflow-x-auto overflow-y-hidden",
12
12
  trigger: [
13
- "relative cursor-pointer text-sm font-semibold text-text-default-base-secondary transition-colors duration-150",
13
+ "relative cursor-pointer text-sm font-semibold text-text-default-base-secondary no-underline transition-colors duration-150",
14
14
  "hover:text-text-default-base-primary",
15
15
  "focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring-button-primary",
16
16
  "data-disabled:cursor-not-allowed data-disabled:opacity-50",
package/theme/base.css CHANGED
@@ -804,6 +804,10 @@
804
804
  --animate-dropdown-slide-in-from-bottom: dropdownSlideInFromBottom 200ms ease-out;
805
805
  --animate-dropdown-slide-in-from-left: dropdownSlideInFromLeft 200ms ease-out;
806
806
  --animate-dropdown-slide-in-from-right: dropdownSlideInFromRight 200ms ease-out;
807
+ --animate-modal-overlay-in: modalOverlayIn 200ms ease-out;
808
+ --animate-modal-overlay-out: modalOverlayOut 150ms ease-in forwards;
809
+ --animate-modal-content-in: modalContentIn 200ms ease-out;
810
+ --animate-modal-content-out: modalContentOut 150ms ease-in forwards;
807
811
  --animate-tooltip-slide-in-from-top: tooltipSlideInFromTop 200ms ease-out;
808
812
  --animate-tooltip-slide-in-from-bottom: tooltipSlideInFromBottom 200ms ease-out;
809
813
  --animate-tooltip-slide-in-from-left: tooltipSlideInFromLeft 200ms ease-out;
@@ -1000,6 +1004,49 @@
1000
1004
  }
1001
1005
  }
1002
1006
 
1007
+ @keyframes modalOverlayIn {
1008
+ 0% {
1009
+ opacity: 0;
1010
+ }
1011
+ 100% {
1012
+ opacity: 1;
1013
+ }
1014
+ }
1015
+
1016
+ @keyframes modalOverlayOut {
1017
+ 0% {
1018
+ opacity: 1;
1019
+ }
1020
+ 100% {
1021
+ opacity: 0;
1022
+ }
1023
+ }
1024
+
1025
+ /* Content is centered via the `translate` CSS property (Tailwind's
1026
+ -translate-x/y-1/2), so keyframes must only animate `transform` scale —
1027
+ putting translate() here would double the offset during the animation. */
1028
+ @keyframes modalContentIn {
1029
+ 0% {
1030
+ opacity: 0;
1031
+ transform: scale(0.95);
1032
+ }
1033
+ 100% {
1034
+ opacity: 1;
1035
+ transform: scale(1);
1036
+ }
1037
+ }
1038
+
1039
+ @keyframes modalContentOut {
1040
+ 0% {
1041
+ opacity: 1;
1042
+ transform: scale(1);
1043
+ }
1044
+ 100% {
1045
+ opacity: 0;
1046
+ transform: scale(0.95);
1047
+ }
1048
+ }
1049
+
1003
1050
  @keyframes tooltipSlideInFromTop {
1004
1051
  0% {
1005
1052
  opacity: 0;