@agentero/design-system 0.12.0 → 0.14.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentero/design-system",
3
- "version": "0.12.0",
3
+ "version": "0.14.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",
@@ -57,6 +57,10 @@
57
57
  "types": "./src/pagination/index.d.ts",
58
58
  "import": "./src/pagination/index.js"
59
59
  },
60
+ "./skeleton": {
61
+ "types": "./src/skeleton/index.d.ts",
62
+ "import": "./src/skeleton/index.js"
63
+ },
60
64
  "./switch": {
61
65
  "types": "./src/switch/index.d.ts",
62
66
  "import": "./src/switch/index.js"
@@ -69,6 +73,10 @@
69
73
  "types": "./src/toast/index.d.ts",
70
74
  "import": "./src/toast/index.js"
71
75
  },
76
+ "./tooltip": {
77
+ "types": "./src/tooltip/index.d.ts",
78
+ "import": "./src/tooltip/index.js"
79
+ },
72
80
  "./lib": {
73
81
  "types": "./lib/index.d.ts",
74
82
  "import": "./lib/index.js"
@@ -93,6 +101,7 @@
93
101
  "@radix-ui/react-separator": "^1.1.8",
94
102
  "@radix-ui/react-slot": "^1.2.4",
95
103
  "@radix-ui/react-switch": "^1.3.2",
104
+ "@radix-ui/react-tooltip": "^1.2.11",
96
105
  "clsx": "^2.1.1",
97
106
  "sonner": "^2.0.7",
98
107
  "tailwind-merge": "^3.5.0",
@@ -0,0 +1,2 @@
1
+ export { Skeleton, skeletonRecipe } from './skeleton';
2
+ export type { SkeletonProps } from './skeleton';
@@ -0,0 +1,2 @@
1
+ import { Skeleton as e, skeletonRecipe as t } from "./skeleton.js";
2
+ export { e as Skeleton, t as skeletonRecipe };
@@ -0,0 +1,19 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export declare const skeletonRecipe: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, "animate-pulse rounded-sm bg-bg-default-base-tertiary motion-reduce:animate-none", {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, "animate-pulse rounded-sm bg-bg-default-base-tertiary motion-reduce:animate-none", unknown, unknown, undefined>>;
3
+ export type SkeletonProps = ComponentPropsWithRef<'div'>;
4
+ /**
5
+ * Skeleton renders a pulsing placeholder box while content loads. Size and
6
+ * shape it with Tailwind classes (`h-4 w-30`, `size-10 rounded-full`) to
7
+ * mirror the content it stands in for. Hidden from assistive technologies.
8
+ *
9
+ * @summary Pulsing placeholder box for loading content
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <Skeleton className="h-4 w-30" />
14
+ * ```
15
+ */
16
+ export declare const Skeleton: {
17
+ ({ className, ...props }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
18
+ displayName: string;
19
+ };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import { tv as e } from "tailwind-variants";
3
+ import { jsx as t } from "react/jsx-runtime";
4
+ //#region src/skeleton/skeleton.tsx
5
+ var n = e({ base: "animate-pulse rounded-sm bg-bg-default-base-tertiary motion-reduce:animate-none" }), r = ({ className: e, ...r }) => /* @__PURE__ */ t("div", {
6
+ "data-slot": "skeleton",
7
+ "aria-hidden": "true",
8
+ ...r,
9
+ className: n({ className: e })
10
+ });
11
+ r.displayName = "Skeleton";
12
+ //#endregion
13
+ export { r as Skeleton, n as skeletonRecipe };
@@ -0,0 +1,2 @@
1
+ export { Tooltip, tooltipRecipe } from './tooltip';
2
+ export type { TooltipProps } from './tooltip';
@@ -0,0 +1,2 @@
1
+ import { Tooltip as e, tooltipRecipe as t } from "./tooltip.js";
2
+ export { e as Tooltip, t as tooltipRecipe };
@@ -0,0 +1,45 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
3
+ export declare const tooltipRecipe: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, string[], unknown, unknown, undefined>>;
4
+ type RootProps = ComponentProps<typeof TooltipPrimitive.Root>;
5
+ export type TooltipProps = {
6
+ /** The trigger element. Hovering or focusing it reveals the tooltip. */
7
+ children: ReactNode;
8
+ /** The floating hint. Keep it short — labels or hints, not paragraphs. */
9
+ content: ReactNode;
10
+ /** Preferred side of the trigger; flips on collision. Defaults to `'top'`. */
11
+ side?: TooltipPrimitive.TooltipContentProps['side'];
12
+ /** Preferred alignment against the trigger. Defaults to `'center'`. */
13
+ align?: TooltipPrimitive.TooltipContentProps['align'];
14
+ /** Distance in pixels between the tooltip and its trigger. Defaults to `4`. */
15
+ sideOffset?: number;
16
+ /** Merge Radix's behavior onto an already-interactive child instead of wrapping it in a `<button>`. Defaults to `false`. */
17
+ asChild?: boolean;
18
+ /** Hide the tooltip when the trigger is clipped away (e.g. scrolled out of an `overflow` container). */
19
+ hideWhenDetached?: boolean;
20
+ /** Delay in ms before opening on hover. Defaults to `0`; focus always opens instantly. */
21
+ delayDuration?: number;
22
+ /** Extra classes for the content surface, merged last. */
23
+ className?: string;
24
+ } & Pick<RootProps, 'open' | 'defaultOpen' | 'onOpenChange'>;
25
+ /**
26
+ * Tooltip reveals a short, non-essential hint anchored to a trigger element on
27
+ * hover or focus. Pass the trigger as `children` and the hint as `content`; use
28
+ * `asChild` when the trigger is already interactive (a button or link) to avoid
29
+ * nesting interactive elements. Don't put essential or interactive content
30
+ * inside it — hover-only content is inaccessible to touch and keyboard users.
31
+ *
32
+ * @summary Hover/focus hint anchored to a trigger element
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <Tooltip content="Archive this carrier" asChild>
37
+ * <IconButton aria-label="Archive"><IconArchive /></IconButton>
38
+ * </Tooltip>
39
+ * ```
40
+ */
41
+ export declare const Tooltip: {
42
+ ({ children, content, side, align, sideOffset, asChild, hideWhenDetached, delayDuration, open, defaultOpen, onOpenChange, className }: TooltipProps): import("react/jsx-runtime").JSX.Element;
43
+ displayName: string;
44
+ };
45
+ export {};
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { tv as e } from "tailwind-variants";
3
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
+ import * as r from "@radix-ui/react-tooltip";
5
+ //#region src/tooltip/tooltip.tsx
6
+ var i = e({ base: [
7
+ "z-(--z-index-tooltip) max-w-[32ch] px-3 py-2",
8
+ "rounded-sm border border-border-default-base-primary bg-bg-default-base-primary shadow-sm",
9
+ "text-xs text-pretty text-text-default-base-secondary select-none",
10
+ "will-change-[transform,opacity]",
11
+ "data-[side=bottom]:animate-tooltip-slide-in-from-top",
12
+ "data-[side=top]:animate-tooltip-slide-in-from-bottom",
13
+ "data-[side=left]:animate-tooltip-slide-in-from-right",
14
+ "data-[side=right]:animate-tooltip-slide-in-from-left",
15
+ "motion-reduce:animate-none!"
16
+ ] }), a = ({ children: e, content: a, side: o = "top", align: s, sideOffset: c = 4, asChild: l = !1, hideWhenDetached: u, delayDuration: d = 0, open: f, defaultOpen: p, onOpenChange: m, className: h }) => /* @__PURE__ */ t(r.Provider, {
17
+ delayDuration: d,
18
+ skipDelayDuration: 0,
19
+ children: /* @__PURE__ */ n(r.Root, {
20
+ open: f,
21
+ defaultOpen: p,
22
+ onOpenChange: m,
23
+ children: [/* @__PURE__ */ t(r.Trigger, {
24
+ asChild: l,
25
+ "data-slot": "tooltip-trigger",
26
+ "data-testid": "tooltip-trigger",
27
+ className: "align-middle",
28
+ children: e
29
+ }), /* @__PURE__ */ t(r.Portal, { children: /* @__PURE__ */ t(r.Content, {
30
+ "data-slot": "tooltip-content",
31
+ side: o,
32
+ align: s,
33
+ sideOffset: c,
34
+ collisionPadding: 8,
35
+ hideWhenDetached: u,
36
+ className: i({ className: h }),
37
+ children: a
38
+ }) })]
39
+ })
40
+ });
41
+ a.displayName = "Tooltip";
42
+ //#endregion
43
+ export { a as Tooltip, i as tooltipRecipe };
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-tooltip-slide-in-from-top: tooltipSlideInFromTop 200ms ease-out;
808
+ --animate-tooltip-slide-in-from-bottom: tooltipSlideInFromBottom 200ms ease-out;
809
+ --animate-tooltip-slide-in-from-left: tooltipSlideInFromLeft 200ms ease-out;
810
+ --animate-tooltip-slide-in-from-right: tooltipSlideInFromRight 200ms ease-out;
807
811
 
808
812
  /* ========================================
809
813
  * Z-INDEX
@@ -996,6 +1000,50 @@
996
1000
  }
997
1001
  }
998
1002
 
1003
+ @keyframes tooltipSlideInFromTop {
1004
+ 0% {
1005
+ opacity: 0;
1006
+ transform: translateY(-0.25rem);
1007
+ }
1008
+ 100% {
1009
+ opacity: 1;
1010
+ transform: translateY(0);
1011
+ }
1012
+ }
1013
+
1014
+ @keyframes tooltipSlideInFromBottom {
1015
+ 0% {
1016
+ opacity: 0;
1017
+ transform: translateY(0.25rem);
1018
+ }
1019
+ 100% {
1020
+ opacity: 1;
1021
+ transform: translateY(0);
1022
+ }
1023
+ }
1024
+
1025
+ @keyframes tooltipSlideInFromLeft {
1026
+ 0% {
1027
+ opacity: 0;
1028
+ transform: translateX(-0.25rem);
1029
+ }
1030
+ 100% {
1031
+ opacity: 1;
1032
+ transform: translateX(0);
1033
+ }
1034
+ }
1035
+
1036
+ @keyframes tooltipSlideInFromRight {
1037
+ 0% {
1038
+ opacity: 0;
1039
+ transform: translateX(0.25rem);
1040
+ }
1041
+ 100% {
1042
+ opacity: 1;
1043
+ transform: translateX(0);
1044
+ }
1045
+ }
1046
+
999
1047
  @keyframes accordionDown {
1000
1048
  from {
1001
1049
  height: 0;