@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.
- package/package.json +114 -2
- package/src/components/ui/alert.tsx +1 -1
- package/src/components/ui/avatar.tsx +1 -1
- package/src/components/ui/badge.tsx +1 -1
- package/src/components/ui/breadcrumb.tsx +1 -1
- package/src/components/ui/button.tsx +1 -1
- package/src/components/ui/calendar.tsx +2 -2
- package/src/components/ui/card.tsx +1 -1
- package/src/components/ui/chart.tsx +1 -1
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/command.tsx +2 -2
- package/src/components/ui/dialog.tsx +2 -2
- package/src/components/ui/dropdown-menu.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/progress.tsx +1 -1
- package/src/components/ui/radio-group.tsx +1 -1
- package/src/components/ui/resizable.tsx +1 -1
- package/src/components/ui/scroll-area.tsx +1 -1
- package/src/components/ui/select.tsx +1 -1
- package/src/components/ui/separator.tsx +1 -1
- package/src/components/ui/sheet.tsx +1 -1
- package/src/components/ui/sidebar.tsx +8 -8
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/slider.tsx +1 -1
- package/src/components/ui/switch.tsx +1 -1
- package/src/components/ui/table.tsx +1 -1
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/tag.tsx +1 -1
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toggle-group.tsx +2 -2
- package/src/components/ui/toggle.tsx +1 -1
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/hooks/use-mobile.ts +19 -0
- 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.
|
|
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 "
|
|
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",
|
|
@@ -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 "
|
|
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 "
|
|
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 "
|
|
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 "
|
|
16
|
-
import { Button, buttonVariants } from "
|
|
15
|
+
import { cn } from "../../lib/utils"
|
|
16
|
+
import { Button, buttonVariants } from "./button"
|
|
17
17
|
|
|
18
18
|
function Calendar({
|
|
19
19
|
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 "
|
|
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 "
|
|
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 "
|
|
8
|
-
import { Button } from "
|
|
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 "
|
|
7
|
+
import { cn } from "../../lib/utils"
|
|
8
8
|
|
|
9
9
|
function DropdownMenu({
|
|
10
10
|
...props
|
|
@@ -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 "
|
|
7
|
+
import { cn } from "../../lib/utils"
|
|
8
8
|
|
|
9
9
|
function Select({
|
|
10
10
|
...props
|
|
@@ -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 "
|
|
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 "
|
|
7
|
-
import { cn } from "
|
|
8
|
-
import { Button } from "
|
|
9
|
-
import { Input } from "
|
|
10
|
-
import { Separator } from "
|
|
11
|
-
import { Sheet, SheetContent } from "
|
|
12
|
-
import { Skeleton } from "
|
|
13
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
2
2
|
import { X } from "lucide-react"
|
|
3
|
-
import { cn } from "
|
|
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",
|
|
@@ -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 "
|
|
8
|
-
import { toggleVariants } from "
|
|
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 "
|
|
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",
|
|
@@ -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"
|