@behavioral-agentic-design-system/core 0.1.1 → 0.1.3

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.
Files changed (36) hide show
  1. package/package.json +114 -2
  2. package/src/components/ui/alert.tsx +1 -1
  3. package/src/components/ui/avatar.tsx +1 -1
  4. package/src/components/ui/badge.tsx +1 -1
  5. package/src/components/ui/breadcrumb.tsx +1 -1
  6. package/src/components/ui/button.tsx +1 -1
  7. package/src/components/ui/calendar.tsx +2 -2
  8. package/src/components/ui/card.tsx +1 -1
  9. package/src/components/ui/chart.tsx +1 -1
  10. package/src/components/ui/checkbox.tsx +1 -1
  11. package/src/components/ui/command.tsx +2 -2
  12. package/src/components/ui/dialog.tsx +2 -2
  13. package/src/components/ui/dropdown-menu.tsx +1 -1
  14. package/src/components/ui/input.tsx +1 -1
  15. package/src/components/ui/label.tsx +1 -1
  16. package/src/components/ui/popover.tsx +1 -1
  17. package/src/components/ui/progress.tsx +1 -1
  18. package/src/components/ui/radio-group.tsx +1 -1
  19. package/src/components/ui/resizable.tsx +1 -1
  20. package/src/components/ui/scroll-area.tsx +1 -1
  21. package/src/components/ui/select.tsx +1 -1
  22. package/src/components/ui/separator.tsx +1 -1
  23. package/src/components/ui/sheet.tsx +1 -1
  24. package/src/components/ui/sidebar.tsx +8 -8
  25. package/src/components/ui/skeleton.tsx +1 -1
  26. package/src/components/ui/slider.tsx +1 -1
  27. package/src/components/ui/switch.tsx +1 -1
  28. package/src/components/ui/table.tsx +1 -1
  29. package/src/components/ui/tabs.tsx +1 -1
  30. package/src/components/ui/tag.tsx +1 -1
  31. package/src/components/ui/textarea.tsx +1 -1
  32. package/src/components/ui/toggle-group.tsx +2 -2
  33. package/src/components/ui/toggle.tsx +1 -1
  34. package/src/components/ui/tooltip.tsx +1 -1
  35. package/src/hooks/use-mobile.ts +19 -0
  36. package/src/components/ui/index.ts +0 -35
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@behavioral-agentic-design-system/core",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "BADS core — tokens and base shadcn/ui components for the Behavioral Agentic Design System.",
5
5
  "license": "ISC",
6
6
  "type": "module",
@@ -13,13 +13,125 @@
13
13
  ".": "./src/index.ts",
14
14
  "./tokens.json": "./src/tokens.json",
15
15
  "./lib/utils": "./src/lib/utils.ts",
16
+ "./hooks/*": "./src/hooks/*.ts",
16
17
  "./components/ui/*": "./src/components/ui/*.tsx"
17
18
  },
18
19
  "publishConfig": {
19
20
  "access": "public"
20
21
  },
22
+ "dependencies": {
23
+ "clsx": "^2.1.0",
24
+ "tailwind-merge": "^3.0.0",
25
+ "class-variance-authority": "^0.7.0"
26
+ },
21
27
  "peerDependencies": {
22
28
  "react": ">=18",
23
- "react-dom": ">=18"
29
+ "react-dom": ">=18",
30
+ "@radix-ui/react-avatar": "*",
31
+ "@radix-ui/react-checkbox": "*",
32
+ "@radix-ui/react-collapsible": "*",
33
+ "@radix-ui/react-dialog": "*",
34
+ "@radix-ui/react-dropdown-menu": "*",
35
+ "@radix-ui/react-label": "*",
36
+ "@radix-ui/react-popover": "*",
37
+ "@radix-ui/react-progress": "*",
38
+ "@radix-ui/react-radio-group": "*",
39
+ "@radix-ui/react-scroll-area": "*",
40
+ "@radix-ui/react-select": "*",
41
+ "@radix-ui/react-separator": "*",
42
+ "@radix-ui/react-slider": "*",
43
+ "@radix-ui/react-slot": "*",
44
+ "@radix-ui/react-switch": "*",
45
+ "@radix-ui/react-tabs": "*",
46
+ "@radix-ui/react-toggle": "*",
47
+ "@radix-ui/react-toggle-group": "*",
48
+ "@radix-ui/react-tooltip": "*",
49
+ "cmdk": "*",
50
+ "lucide-react": "*",
51
+ "next-themes": "*",
52
+ "react-day-picker": "*",
53
+ "react-resizable-panels": "*",
54
+ "recharts": "*",
55
+ "sonner": "*"
56
+ },
57
+ "peerDependenciesMeta": {
58
+ "@radix-ui/react-avatar": {
59
+ "optional": true
60
+ },
61
+ "@radix-ui/react-checkbox": {
62
+ "optional": true
63
+ },
64
+ "@radix-ui/react-collapsible": {
65
+ "optional": true
66
+ },
67
+ "@radix-ui/react-dialog": {
68
+ "optional": true
69
+ },
70
+ "@radix-ui/react-dropdown-menu": {
71
+ "optional": true
72
+ },
73
+ "@radix-ui/react-label": {
74
+ "optional": true
75
+ },
76
+ "@radix-ui/react-popover": {
77
+ "optional": true
78
+ },
79
+ "@radix-ui/react-progress": {
80
+ "optional": true
81
+ },
82
+ "@radix-ui/react-radio-group": {
83
+ "optional": true
84
+ },
85
+ "@radix-ui/react-scroll-area": {
86
+ "optional": true
87
+ },
88
+ "@radix-ui/react-select": {
89
+ "optional": true
90
+ },
91
+ "@radix-ui/react-separator": {
92
+ "optional": true
93
+ },
94
+ "@radix-ui/react-slider": {
95
+ "optional": true
96
+ },
97
+ "@radix-ui/react-slot": {
98
+ "optional": true
99
+ },
100
+ "@radix-ui/react-switch": {
101
+ "optional": true
102
+ },
103
+ "@radix-ui/react-tabs": {
104
+ "optional": true
105
+ },
106
+ "@radix-ui/react-toggle": {
107
+ "optional": true
108
+ },
109
+ "@radix-ui/react-toggle-group": {
110
+ "optional": true
111
+ },
112
+ "@radix-ui/react-tooltip": {
113
+ "optional": true
114
+ },
115
+ "cmdk": {
116
+ "optional": true
117
+ },
118
+ "lucide-react": {
119
+ "optional": true
120
+ },
121
+ "next-themes": {
122
+ "optional": true
123
+ },
124
+ "react-day-picker": {
125
+ "optional": true
126
+ },
127
+ "react-resizable-panels": {
128
+ "optional": true
129
+ },
130
+ "recharts": {
131
+ "optional": true
132
+ },
133
+ "sonner": {
134
+ "optional": true
135
+ }
24
136
  }
25
137
  }
@@ -1,7 +1,7 @@
1
1
  import * as React from "react"
2
2
  import { cva, type VariantProps } from "class-variance-authority"
3
3
 
4
- import { cn } from "@/lib/utils"
4
+ import { cn } from "../../lib/utils"
5
5
 
6
6
  const alertVariants = cva(
7
7
  "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
@@ -3,7 +3,7 @@
3
3
  import * as React from "react"
4
4
  import * as AvatarPrimitive from "@radix-ui/react-avatar"
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from "../../lib/utils"
7
7
 
8
8
  function Avatar({
9
9
  className,
@@ -2,7 +2,7 @@ import * as React from "react"
2
2
  import { cva, type VariantProps } from "class-variance-authority"
3
3
  import { Slot } from "@radix-ui/react-slot"
4
4
 
5
- import { cn } from "@/lib/utils"
5
+ import { cn } from "../../lib/utils"
6
6
 
7
7
  const badgeVariants = cva(
8
8
  "inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
@@ -2,7 +2,7 @@ import * as React from "react"
2
2
  import { ChevronRight, MoreHorizontal } from "lucide-react"
3
3
  import { Slot } from "@radix-ui/react-slot"
4
4
 
5
- import { cn } from "@/lib/utils"
5
+ import { cn } from "../../lib/utils"
6
6
 
7
7
  function Breadcrumb({ ...props }: React.ComponentProps<"nav">) {
8
8
  return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />
@@ -2,7 +2,7 @@ import * as React from "react"
2
2
  import { cva, type VariantProps } from "class-variance-authority"
3
3
  import { Slot } from "@radix-ui/react-slot"
4
4
 
5
- import { cn } from "@/lib/utils"
5
+ import { cn } from "../../lib/utils"
6
6
 
7
7
  const buttonVariants = cva(
8
8
  "inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
@@ -12,8 +12,8 @@ import {
12
12
  type DayButton,
13
13
  } from "react-day-picker"
14
14
 
15
- import { cn } from "@/lib/utils"
16
- import { Button, buttonVariants } from "@/components/ui/button"
15
+ import { cn } from "../../lib/utils"
16
+ import { Button, buttonVariants } from "./button"
17
17
 
18
18
  function Calendar({
19
19
  className,
@@ -1,6 +1,6 @@
1
1
  import * as React from "react"
2
2
 
3
- import { cn } from "@/lib/utils"
3
+ import { cn } from "../../lib/utils"
4
4
 
5
5
  function Card({ className, ...props }: React.ComponentProps<"div">) {
6
6
  return (
@@ -3,7 +3,7 @@
3
3
  import * as React from "react"
4
4
  import * as RechartsPrimitive from "recharts"
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from "../../lib/utils"
7
7
 
8
8
  // Format: { THEME_NAME: CSS_SELECTOR }
9
9
  const THEMES = { light: "", dark: ".dark" } as const
@@ -4,7 +4,7 @@ import * as React from "react"
4
4
  import { CheckIcon } from "lucide-react"
5
5
  import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
6
6
 
7
- import { cn } from "@/lib/utils"
7
+ import { cn } from "../../lib/utils"
8
8
 
9
9
  function Checkbox({
10
10
  className,
@@ -4,14 +4,14 @@ import * as React from "react"
4
4
  import { Command as CommandPrimitive } from "cmdk"
5
5
  import { SearchIcon } from "lucide-react"
6
6
 
7
- import { cn } from "@/lib/utils"
7
+ import { cn } from "../../lib/utils"
8
8
  import {
9
9
  Dialog,
10
10
  DialogContent,
11
11
  DialogDescription,
12
12
  DialogHeader,
13
13
  DialogTitle,
14
- } from "@/components/ui/dialog"
14
+ } from "./dialog"
15
15
 
16
16
  function Command({
17
17
  className,
@@ -4,8 +4,8 @@ import * as React from "react"
4
4
  import { XIcon } from "lucide-react"
5
5
  import * as DialogPrimitive from "@radix-ui/react-dialog"
6
6
 
7
- import { cn } from "@/lib/utils"
8
- import { Button } from "@/components/ui/button"
7
+ import { cn } from "../../lib/utils"
8
+ import { Button } from "./button"
9
9
 
10
10
  function Dialog({
11
11
  ...props
@@ -4,7 +4,7 @@ import * as React from "react"
4
4
  import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
5
5
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
6
6
 
7
- import { cn } from "@/lib/utils"
7
+ import { cn } from "../../lib/utils"
8
8
 
9
9
  function DropdownMenu({
10
10
  ...props
@@ -1,6 +1,6 @@
1
1
  import * as React from "react"
2
2
 
3
- import { cn } from "@/lib/utils"
3
+ import { cn } from "../../lib/utils"
4
4
 
5
5
  function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
6
  return (
@@ -3,7 +3,7 @@
3
3
  import * as React from "react"
4
4
  import * as LabelPrimitive from "@radix-ui/react-label"
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from "../../lib/utils"
7
7
 
8
8
  function Label({
9
9
  className,
@@ -3,7 +3,7 @@
3
3
  import * as React from "react"
4
4
  import * as PopoverPrimitive from "@radix-ui/react-popover"
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from "../../lib/utils"
7
7
 
8
8
  function Popover({
9
9
  ...props
@@ -3,7 +3,7 @@
3
3
  import * as React from "react"
4
4
  import * as ProgressPrimitive from "@radix-ui/react-progress"
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from "../../lib/utils"
7
7
 
8
8
  function Progress({
9
9
  className,
@@ -4,7 +4,7 @@ import * as React from "react"
4
4
  import { CircleIcon } from "lucide-react"
5
5
  import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
6
6
 
7
- import { cn } from "@/lib/utils"
7
+ import { cn } from "../../lib/utils"
8
8
 
9
9
  function RadioGroup({
10
10
  className,
@@ -3,7 +3,7 @@
3
3
  import { GripVerticalIcon } from "lucide-react"
4
4
  import * as ResizablePrimitive from "react-resizable-panels"
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from "../../lib/utils"
7
7
 
8
8
  function ResizablePanelGroup({
9
9
  className,
@@ -3,7 +3,7 @@
3
3
  import * as React from "react"
4
4
  import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from "../../lib/utils"
7
7
 
8
8
  function ScrollArea({
9
9
  className,
@@ -4,7 +4,7 @@ import * as React from "react"
4
4
  import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
5
5
  import * as SelectPrimitive from "@radix-ui/react-select"
6
6
 
7
- import { cn } from "@/lib/utils"
7
+ import { cn } from "../../lib/utils"
8
8
 
9
9
  function Select({
10
10
  ...props
@@ -3,7 +3,7 @@
3
3
  import * as React from "react"
4
4
  import * as SeparatorPrimitive from "@radix-ui/react-separator"
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from "../../lib/utils"
7
7
 
8
8
  function Separator({
9
9
  className,
@@ -4,7 +4,7 @@ import * as React from "react"
4
4
  import { XIcon } from "lucide-react"
5
5
  import * as SheetPrimitive from "@radix-ui/react-dialog"
6
6
 
7
- import { cn } from "@/lib/utils"
7
+ import { cn } from "../../lib/utils"
8
8
 
9
9
  function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
10
10
  return <SheetPrimitive.Root data-slot="sheet" {...props} />
@@ -3,14 +3,14 @@ import * as SlotPrimitive from "@radix-ui/react-slot";
3
3
  import { VariantProps, cva } from "class-variance-authority";
4
4
  import { PanelLeft } from "lucide-react";
5
5
 
6
- import { useIsMobile } from "@/hooks/use-mobile";
7
- import { cn } from "@/lib/utils";
8
- import { Button } from "@/components/ui/button";
9
- import { Input } from "@/components/ui/input";
10
- import { Separator } from "@/components/ui/separator";
11
- import { Sheet, SheetContent } from "@/components/ui/sheet";
12
- import { Skeleton } from "@/components/ui/skeleton";
13
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
6
+ import { useIsMobile } from "../../hooks/use-mobile";
7
+ import { cn } from "../../lib/utils";
8
+ import { Button } from "./button";
9
+ import { Input } from "./input";
10
+ import { Separator } from "./separator";
11
+ import { Sheet, SheetContent } from "./sheet";
12
+ import { Skeleton } from "./skeleton";
13
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip";
14
14
 
15
15
  const SIDEBAR_COOKIE_NAME = "sidebar:state";
16
16
  const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
@@ -1,4 +1,4 @@
1
- import { cn } from "@/lib/utils"
1
+ import { cn } from "../../lib/utils"
2
2
 
3
3
  function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4
4
  return (
@@ -3,7 +3,7 @@
3
3
  import * as React from "react"
4
4
  import * as SliderPrimitive from "@radix-ui/react-slider"
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from "../../lib/utils"
7
7
 
8
8
  function Slider({
9
9
  className,
@@ -3,7 +3,7 @@
3
3
  import * as React from "react"
4
4
  import * as SwitchPrimitive from "@radix-ui/react-switch"
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from "../../lib/utils"
7
7
 
8
8
  function Switch({
9
9
  className,
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as React from "react"
4
4
 
5
- import { cn } from "@/lib/utils"
5
+ import { cn } from "../../lib/utils"
6
6
 
7
7
  function Table({ className, ...props }: React.ComponentProps<"table">) {
8
8
  return (
@@ -4,7 +4,7 @@ import * as React from "react"
4
4
  import { cva, type VariantProps } from "class-variance-authority"
5
5
  import * as TabsPrimitive from "@radix-ui/react-tabs"
6
6
 
7
- import { cn } from "@/lib/utils"
7
+ import { cn } from "../../lib/utils"
8
8
 
9
9
  function Tabs({
10
10
  className,
@@ -1,6 +1,6 @@
1
1
  import { cva, type VariantProps } from "class-variance-authority"
2
2
  import { X } from "lucide-react"
3
- import { cn } from "@/lib/utils"
3
+ import { cn } from "../../lib/utils"
4
4
 
5
5
  const tagVariants = cva(
6
6
  "inline-flex items-center gap-1 rounded-full px-3 py-1 text-sm font-medium transition-colors",
@@ -1,6 +1,6 @@
1
1
  import * as React from "react"
2
2
 
3
- import { cn } from "@/lib/utils"
3
+ import { cn } from "../../lib/utils"
4
4
 
5
5
  function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
6
6
  return (
@@ -4,8 +4,8 @@ import * as React from "react"
4
4
  import { type VariantProps } from "class-variance-authority"
5
5
  import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
6
6
 
7
- import { cn } from "@/lib/utils"
8
- import { toggleVariants } from "@/components/ui/toggle"
7
+ import { cn } from "../../lib/utils"
8
+ import { toggleVariants } from "./toggle"
9
9
 
10
10
  const ToggleGroupContext = React.createContext<
11
11
  VariantProps<typeof toggleVariants> & {
@@ -4,7 +4,7 @@ import * as React from "react"
4
4
  import { cva, type VariantProps } from "class-variance-authority"
5
5
  import * as TogglePrimitive from "@radix-ui/react-toggle"
6
6
 
7
- import { cn } from "@/lib/utils"
7
+ import { cn } from "../../lib/utils"
8
8
 
9
9
  const toggleVariants = cva(
10
10
  "inline-flex items-center justify-center gap-2 rounded-md text-xs font-medium whitespace-nowrap text-muted-foreground transition-[color,box-shadow] outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
@@ -3,7 +3,7 @@
3
3
  import * as React from "react"
4
4
  import * as TooltipPrimitive from "@radix-ui/react-tooltip"
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from "../../lib/utils"
7
7
 
8
8
  function TooltipProvider({
9
9
  delayDuration = 0,
@@ -0,0 +1,19 @@
1
+ import * as React from "react"
2
+
3
+ const MOBILE_BREAKPOINT = 768
4
+
5
+ export function useIsMobile() {
6
+ const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
7
+
8
+ React.useEffect(() => {
9
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
10
+ const onChange = () => {
11
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
12
+ }
13
+ mql.addEventListener("change", onChange)
14
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
15
+ return () => mql.removeEventListener("change", onChange)
16
+ }, [])
17
+
18
+ return !!isMobile
19
+ }
@@ -1,35 +0,0 @@
1
- export * from "./alert"
2
- export * from "./avatar"
3
- export * from "./badge"
4
- export * from "./breadcrumb"
5
- export * from "./button"
6
- export * from "./calendar"
7
- export * from "./card"
8
- export * from "./chart"
9
- export * from "./checkbox"
10
- export * from "./collapsible"
11
- export * from "./command"
12
- export * from "./dialog"
13
- export * from "./dropdown-menu"
14
- export * from "./input"
15
- export * from "./label"
16
- export * from "./popover"
17
- export * from "./progress"
18
- export * from "./radio-group"
19
- export * from "./resizable"
20
- export * from "./scroll-area"
21
- export * from "./select"
22
- export * from "./separator"
23
- export * from "./sheet"
24
- export * from "./sidebar"
25
- export * from "./skeleton"
26
- export * from "./slider"
27
- export * from "./sonner"
28
- export * from "./switch"
29
- export * from "./table"
30
- export * from "./tabs"
31
- export * from "./tag"
32
- export * from "./textarea"
33
- export * from "./toggle"
34
- export * from "./toggle-group"
35
- export * from "./tooltip"