@behavioral-agentic-design-system/core 0.34.0 → 0.37.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 +12 -6
- package/scripts/bads-doctor.mjs +217 -0
- package/scripts/build-tokens.cjs +29 -0
- package/scripts/check-sync.mjs +270 -0
- package/scripts/health-report.mjs +158 -0
- package/scripts/lint-ethics-contract.mjs +129 -0
- package/scripts/lint-slop.mjs +160 -0
- package/scripts/lint-token-intent.mjs +128 -0
- package/scripts/slop-rules.mjs +77 -0
- package/src/app/preview/components/page.tsx +132 -0
- package/src/components/home-tab.tsx +43 -12
- package/src/components/ui/combobox.tsx +8 -0
- package/src/components/ui/data-table.tsx +20 -2
- package/src/components/ui/input.tsx +13 -2
- package/src/components/ui/multi-select.tsx +16 -1
- package/src/components/ui/pagination.tsx +65 -12
- package/src/components/ui/progress.tsx +18 -0
- package/src/components/ui/radio-group.tsx +39 -8
- package/src/components/ui/switch.tsx +4 -4
- package/src/components/ui/table.tsx +71 -67
- package/src/components/ui/textarea.tsx +22 -6
- package/src/data/docs-index.ts +2 -0
- package/src/stories/Combobox.stories.tsx +48 -0
- package/src/stories/DataTable.stories.tsx +38 -0
- package/src/stories/Input.stories.tsx +54 -0
- package/src/stories/MultiSelect.stories.tsx +36 -0
- package/src/stories/Pagination.stories.tsx +108 -0
- package/src/stories/Progress.stories.tsx +46 -0
- package/src/stories/RadioGroup.stories.tsx +40 -0
- package/src/stories/Switch.stories.tsx +8 -3
- package/src/stories/Table.stories.tsx +88 -0
- package/src/stories/Textarea.stories.tsx +36 -0
- package/src/styles.css +29 -0
|
@@ -3,33 +3,64 @@
|
|
|
3
3
|
import * as React from "react"
|
|
4
4
|
import { CircleIcon } from "lucide-react"
|
|
5
5
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
6
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
6
7
|
|
|
7
8
|
import { cn } from "../../lib/utils"
|
|
8
9
|
|
|
9
10
|
function RadioGroup({
|
|
10
11
|
className,
|
|
12
|
+
orientation,
|
|
11
13
|
...props
|
|
12
14
|
}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
|
|
13
15
|
return (
|
|
14
16
|
<RadioGroupPrimitive.Root
|
|
15
17
|
data-slot="radio-group"
|
|
16
|
-
|
|
18
|
+
orientation={orientation}
|
|
19
|
+
className={cn(
|
|
20
|
+
orientation === "horizontal"
|
|
21
|
+
? "flex flex-row flex-wrap gap-x-6 gap-y-3"
|
|
22
|
+
: "grid gap-3",
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
17
25
|
{...props}
|
|
18
26
|
/>
|
|
19
27
|
)
|
|
20
28
|
}
|
|
21
29
|
|
|
30
|
+
const radioGroupItemVariants = cva(
|
|
31
|
+
"aspect-square shrink-0 rounded-full border-2 border-muted-foreground/60 bg-white text-primary shadow-xs transition-[background-color,border-color,color] duration-[210ms] ease-in-out outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 data-[state=checked]:bg-primary data-[state=checked]:border-primary",
|
|
32
|
+
{
|
|
33
|
+
variants: {
|
|
34
|
+
size: {
|
|
35
|
+
sm: "size-7",
|
|
36
|
+
default: "size-9",
|
|
37
|
+
lg: "size-11",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: { size: "default" },
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
const indicatorIconSizeMap: Record<NonNullable<VariantProps<typeof radioGroupItemVariants>["size"]>, string> = {
|
|
45
|
+
sm: "size-3",
|
|
46
|
+
default: "size-4",
|
|
47
|
+
lg: "size-5",
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface RadioGroupItemProps
|
|
51
|
+
extends React.ComponentProps<typeof RadioGroupPrimitive.Item>,
|
|
52
|
+
VariantProps<typeof radioGroupItemVariants> {}
|
|
53
|
+
|
|
22
54
|
function RadioGroupItem({
|
|
23
55
|
className,
|
|
56
|
+
size,
|
|
24
57
|
...props
|
|
25
|
-
}:
|
|
58
|
+
}: RadioGroupItemProps) {
|
|
59
|
+
const iconSize = indicatorIconSizeMap[size ?? "default"]
|
|
26
60
|
return (
|
|
27
61
|
<RadioGroupPrimitive.Item
|
|
28
62
|
data-slot="radio-group-item"
|
|
29
|
-
className={cn(
|
|
30
|
-
"aspect-square size-9 shrink-0 rounded-full border-2 border-muted-foreground/60 bg-white text-primary shadow-xs transition-[background-color,border-color,color] duration-[210ms] ease-in-out outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 data-[state=checked]:bg-primary data-[state=checked]:border-primary",
|
|
31
|
-
className
|
|
32
|
-
)}
|
|
63
|
+
className={cn(radioGroupItemVariants({ size }), className)}
|
|
33
64
|
{...props}
|
|
34
65
|
>
|
|
35
66
|
<RadioGroupPrimitive.Indicator
|
|
@@ -37,10 +68,10 @@ function RadioGroupItem({
|
|
|
37
68
|
data-slot="radio-group-indicator"
|
|
38
69
|
className="flex h-full w-full items-center justify-center opacity-0 scale-75 transition-[opacity,transform] duration-[120ms] ease-out data-[state=checked]:opacity-100 data-[state=checked]:scale-100"
|
|
39
70
|
>
|
|
40
|
-
<CircleIcon className="
|
|
71
|
+
<CircleIcon className={cn(iconSize, "fill-primary-foreground stroke-primary-foreground")} />
|
|
41
72
|
</RadioGroupPrimitive.Indicator>
|
|
42
73
|
</RadioGroupPrimitive.Item>
|
|
43
74
|
)
|
|
44
75
|
}
|
|
45
76
|
|
|
46
|
-
export { RadioGroup, RadioGroupItem }
|
|
77
|
+
export { RadioGroup, RadioGroupItem, radioGroupItemVariants }
|
|
@@ -11,14 +11,14 @@ function Switch({
|
|
|
11
11
|
size = "default",
|
|
12
12
|
...props
|
|
13
13
|
}: React.ComponentProps<typeof SwitchPrimitive.Root> & {
|
|
14
|
-
size?: "sm" | "default"
|
|
14
|
+
size?: "sm" | "default" | "lg"
|
|
15
15
|
}) {
|
|
16
16
|
return (
|
|
17
17
|
<SwitchPrimitive.Root
|
|
18
18
|
data-slot="switch"
|
|
19
19
|
data-size={size}
|
|
20
20
|
className={cn(
|
|
21
|
-
"peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-[background-color] duration-[210ms] ease-in-out outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[2.3rem] data-[size=default]:w-16 data-[size=sm]:h-7 data-[size=sm]:w-12 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",
|
|
21
|
+
"peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-[background-color] duration-[210ms] ease-in-out outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[2.3rem] data-[size=default]:w-16 data-[size=sm]:h-7 data-[size=sm]:w-12 data-[size=lg]:h-11 data-[size=lg]:w-20 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",
|
|
22
22
|
className
|
|
23
23
|
)}
|
|
24
24
|
{...props}
|
|
@@ -30,7 +30,7 @@ function Switch({
|
|
|
30
30
|
// check overlaps the thumb (lands ~20px); `left-1.5 size-3` leaves a
|
|
31
31
|
// ~2px gap. Default keeps left-2 size-4 — it already clears its 32px
|
|
32
32
|
// thumb.
|
|
33
|
-
className="pointer-events-none absolute text-primary-foreground opacity-0 scale-75 transition-[opacity,transform] duration-[120ms] ease-out group-data-[size=default]/switch:left-2 group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:left-1.5 group-data-[size=sm]/switch:size-3 group-data-[state=checked]/switch:opacity-100 group-data-[state=checked]/switch:scale-100"
|
|
33
|
+
className="pointer-events-none absolute text-primary-foreground opacity-0 scale-75 transition-[opacity,transform] duration-[120ms] ease-out group-data-[size=default]/switch:left-2 group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:left-1.5 group-data-[size=sm]/switch:size-3 group-data-[size=lg]/switch:left-2.5 group-data-[size=lg]/switch:size-5 group-data-[state=checked]/switch:opacity-100 group-data-[state=checked]/switch:scale-100"
|
|
34
34
|
/>
|
|
35
35
|
<SwitchPrimitive.Thumb
|
|
36
36
|
data-slot="switch-thumb"
|
|
@@ -41,7 +41,7 @@ function Switch({
|
|
|
41
41
|
// the thumb always contrasts the track: near-white thumb on
|
|
42
42
|
// near-black track in light, near-black thumb on near-white
|
|
43
43
|
// track in dark.
|
|
44
|
-
"pointer-events-none block rounded-full bg-white data-[state=checked]:bg-primary-foreground ring-0 shadow-sm transition-[translate,background-color] duration-[175ms] ease-[cubic-bezier(0.25,0.46,0.45,0.94)] group-data-[size=default]/switch:size-8 group-data-[size=sm]/switch:size-6 data-[state=checked]:translate-x-[calc(100%-4px)] data-[state=unchecked]:translate-x-[2px]"
|
|
44
|
+
"pointer-events-none block rounded-full bg-white data-[state=checked]:bg-primary-foreground ring-0 shadow-sm transition-[translate,background-color] duration-[175ms] ease-[cubic-bezier(0.25,0.46,0.45,0.94)] group-data-[size=default]/switch:size-8 group-data-[size=sm]/switch:size-6 group-data-[size=lg]/switch:size-10 data-[state=checked]:translate-x-[calc(100%-4px)] data-[state=unchecked]:translate-x-[2px]"
|
|
45
45
|
)}
|
|
46
46
|
/>
|
|
47
47
|
</SwitchPrimitive.Root>
|
|
@@ -1,76 +1,92 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
|
|
3
2
|
import * as React from "react"
|
|
4
|
-
|
|
5
3
|
import { cn } from "../../lib/utils"
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
interface TableVariantContextValue {
|
|
6
|
+
striped: boolean
|
|
7
|
+
bordered: boolean
|
|
8
|
+
compact: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const TableVariantContext = React.createContext<TableVariantContextValue>({
|
|
12
|
+
striped: false,
|
|
13
|
+
bordered: false,
|
|
14
|
+
compact: false,
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
type TableSection = "header" | "body" | "footer"
|
|
18
|
+
|
|
19
|
+
const TableSectionContext = React.createContext<TableSection>("body")
|
|
20
|
+
|
|
21
|
+
interface TableProps extends React.ComponentProps<"table"> {
|
|
22
|
+
wrapperClassName?: string
|
|
23
|
+
wrapperStyle?: React.CSSProperties
|
|
24
|
+
/** Zebra-stripe even body rows (bg-muted/30) for scanability on wide tables. Visual only — never the sole carrier of meaning. */
|
|
25
|
+
striped?: boolean
|
|
26
|
+
/** Draw a rounded outer border on the scroll container plus column separators between cells. */
|
|
27
|
+
bordered?: boolean
|
|
28
|
+
/** Reduced vertical density: h-8 header cells, py-1 body cells. For data-only rows — a flow-changing CTA inside a compact row keeps its own min-h-11. */
|
|
29
|
+
compact?: boolean
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function Table({ className, wrapperClassName, wrapperStyle, striped = false, bordered = false, compact = false, ...props }: TableProps) {
|
|
33
|
+
const variants = React.useMemo(() => ({ striped, bordered, compact }), [striped, bordered, compact])
|
|
8
34
|
return (
|
|
9
|
-
<
|
|
10
|
-
data-slot="table-container"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
className={cn("w-full caption-bottom text-sm", className)}
|
|
29
|
-
{...props}
|
|
30
|
-
/>
|
|
31
|
-
</div>
|
|
35
|
+
<TableVariantContext.Provider value={variants}>
|
|
36
|
+
<div data-slot="table-container" tabIndex={0}
|
|
37
|
+
className={cn(
|
|
38
|
+
"relative w-full overflow-x-auto scrollbar-thin scrollbar-thumb-border scrollbar-track-transparent",
|
|
39
|
+
bordered && "rounded-md border",
|
|
40
|
+
wrapperClassName
|
|
41
|
+
)}
|
|
42
|
+
style={wrapperStyle}
|
|
43
|
+
>
|
|
44
|
+
<table
|
|
45
|
+
data-slot="table"
|
|
46
|
+
data-striped={striped ? "" : undefined}
|
|
47
|
+
data-bordered={bordered ? "" : undefined}
|
|
48
|
+
data-compact={compact ? "" : undefined}
|
|
49
|
+
className={cn("w-full caption-bottom text-sm", className)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
</TableVariantContext.Provider>
|
|
32
54
|
)
|
|
33
55
|
}
|
|
34
56
|
|
|
35
57
|
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
|
|
36
58
|
return (
|
|
37
|
-
<
|
|
38
|
-
data-slot="table-header"
|
|
39
|
-
|
|
40
|
-
{...props}
|
|
41
|
-
/>
|
|
59
|
+
<TableSectionContext.Provider value="header">
|
|
60
|
+
<thead data-slot="table-header" className={cn("[&_tr]:border-b", className)} {...props} />
|
|
61
|
+
</TableSectionContext.Provider>
|
|
42
62
|
)
|
|
43
63
|
}
|
|
44
64
|
|
|
45
65
|
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
|
|
46
66
|
return (
|
|
47
|
-
<
|
|
48
|
-
data-slot="table-body"
|
|
49
|
-
|
|
50
|
-
{...props}
|
|
51
|
-
/>
|
|
67
|
+
<TableSectionContext.Provider value="body">
|
|
68
|
+
<tbody data-slot="table-body" className={cn("[&_tr:last-child]:border-0", className)} {...props} />
|
|
69
|
+
</TableSectionContext.Provider>
|
|
52
70
|
)
|
|
53
71
|
}
|
|
54
72
|
|
|
55
73
|
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
|
|
56
74
|
return (
|
|
57
|
-
<
|
|
58
|
-
data-slot="table-footer"
|
|
59
|
-
|
|
60
|
-
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
61
|
-
className
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
75
|
+
<TableSectionContext.Provider value="footer">
|
|
76
|
+
<tfoot data-slot="table-footer" className={cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className)} {...props} />
|
|
77
|
+
</TableSectionContext.Provider>
|
|
65
78
|
)
|
|
66
79
|
}
|
|
67
80
|
|
|
68
81
|
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
82
|
+
const { striped } = React.useContext(TableVariantContext)
|
|
83
|
+
const section = React.useContext(TableSectionContext)
|
|
69
84
|
return (
|
|
70
85
|
<tr
|
|
71
86
|
data-slot="table-row"
|
|
72
87
|
className={cn(
|
|
73
88
|
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
89
|
+
striped && section === "body" && "even:bg-muted/30",
|
|
74
90
|
className
|
|
75
91
|
)}
|
|
76
92
|
{...props}
|
|
@@ -79,11 +95,14 @@ function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
|
79
95
|
}
|
|
80
96
|
|
|
81
97
|
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
98
|
+
const { bordered, compact } = React.useContext(TableVariantContext)
|
|
82
99
|
return (
|
|
83
100
|
<th
|
|
84
101
|
data-slot="table-head"
|
|
85
102
|
className={cn(
|
|
86
|
-
"h-
|
|
103
|
+
compact ? "h-8" : "h-10",
|
|
104
|
+
"px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
105
|
+
bordered && "border-r last:border-r-0",
|
|
87
106
|
className
|
|
88
107
|
)}
|
|
89
108
|
{...props}
|
|
@@ -92,11 +111,14 @@ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
|
92
111
|
}
|
|
93
112
|
|
|
94
113
|
function TableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
114
|
+
const { bordered, compact } = React.useContext(TableVariantContext)
|
|
95
115
|
return (
|
|
96
116
|
<td
|
|
97
117
|
data-slot="table-cell"
|
|
98
118
|
className={cn(
|
|
99
|
-
"
|
|
119
|
+
compact ? "px-2 py-1" : "p-2",
|
|
120
|
+
"align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
121
|
+
bordered && "border-r last:border-r-0",
|
|
100
122
|
className
|
|
101
123
|
)}
|
|
102
124
|
{...props}
|
|
@@ -104,26 +126,8 @@ function TableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
|
104
126
|
)
|
|
105
127
|
}
|
|
106
128
|
|
|
107
|
-
function TableCaption({
|
|
108
|
-
className,
|
|
109
|
-
...props
|
|
110
|
-
}: React.ComponentProps<"caption">) {
|
|
111
|
-
return (
|
|
112
|
-
<caption
|
|
113
|
-
data-slot="table-caption"
|
|
114
|
-
className={cn("mt-4 text-sm text-muted-foreground", className)}
|
|
115
|
-
{...props}
|
|
116
|
-
/>
|
|
117
|
-
)
|
|
129
|
+
function TableCaption({ className, ...props }: React.ComponentProps<"caption">) {
|
|
130
|
+
return <caption data-slot="table-caption" className={cn("mt-4 text-sm text-muted-foreground", className)} {...props} />
|
|
118
131
|
}
|
|
119
132
|
|
|
120
|
-
export {
|
|
121
|
-
Table,
|
|
122
|
-
TableHeader,
|
|
123
|
-
TableBody,
|
|
124
|
-
TableFooter,
|
|
125
|
-
TableHead,
|
|
126
|
-
TableRow,
|
|
127
|
-
TableCell,
|
|
128
|
-
TableCaption,
|
|
129
|
-
}
|
|
133
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption }
|
|
@@ -4,10 +4,28 @@
|
|
|
4
4
|
// a server component at all. See the note in button.tsx for why the components
|
|
5
5
|
// that merely forward an optional callback are left server-renderable.
|
|
6
6
|
import * as React from "react"
|
|
7
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
7
8
|
|
|
8
9
|
import { cn } from "../../lib/utils"
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
const textareaVariants = cva(
|
|
12
|
+
"flex field-sizing-content w-full rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
13
|
+
{
|
|
14
|
+
variants: {
|
|
15
|
+
size: {
|
|
16
|
+
sm: "min-h-14 px-2.5 py-1.5 text-sm",
|
|
17
|
+
default: "min-h-16 px-3 py-2 text-base md:text-sm",
|
|
18
|
+
lg: "min-h-20 px-4 py-2.5 text-base",
|
|
19
|
+
xl: "min-h-24 px-5 py-3 text-lg",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: { size: "default" },
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
interface TextareaProps
|
|
27
|
+
extends React.ComponentProps<"textarea">,
|
|
28
|
+
VariantProps<typeof textareaVariants> {
|
|
11
29
|
/** Show a character count below the textarea. Default false. */
|
|
12
30
|
showCount?: boolean
|
|
13
31
|
/**
|
|
@@ -22,6 +40,7 @@ interface TextareaProps extends React.ComponentProps<"textarea"> {
|
|
|
22
40
|
|
|
23
41
|
function Textarea({
|
|
24
42
|
className,
|
|
43
|
+
size,
|
|
25
44
|
showCount = false,
|
|
26
45
|
maxLength,
|
|
27
46
|
countId,
|
|
@@ -50,10 +69,7 @@ function Textarea({
|
|
|
50
69
|
data-slot="textarea"
|
|
51
70
|
maxLength={maxLength}
|
|
52
71
|
aria-describedby={showCount ? resolvedCountId : undefined}
|
|
53
|
-
className={cn(
|
|
54
|
-
"flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
55
|
-
className
|
|
56
|
-
)}
|
|
72
|
+
className={cn(textareaVariants({ size }), className)}
|
|
57
73
|
value={value}
|
|
58
74
|
defaultValue={defaultValue}
|
|
59
75
|
onChange={handleChange}
|
|
@@ -83,5 +99,5 @@ function Textarea({
|
|
|
83
99
|
)
|
|
84
100
|
}
|
|
85
101
|
|
|
86
|
-
export { Textarea }
|
|
102
|
+
export { Textarea, textareaVariants }
|
|
87
103
|
export type { TextareaProps }
|
package/src/data/docs-index.ts
CHANGED
|
@@ -209,6 +209,8 @@ export const DOCS_INDEX: DocGroup[] = [
|
|
|
209
209
|
{ title: "Spec — skill package", path: "docs/specs/2026-08-21-skill-package.md", summary: "The durable contract for packages/skill: generated-only output, usage-focused recipes, ≤2k-word SKILL.md, deterministic builds, the check:skill staleness gate, and the eval --context=skill acceptance instrument." },
|
|
210
210
|
{ title: "Plan — self-healing layer", path: "docs/plans/2026-08-21-self-healing-layer.md", summary: "Approved plan: the watch-half of the system — drift ledger, token intent validator, component health score, and a Health surface, assembled from signals BADS already owns; runtime telemetry deliberately deferred behind consent + futures-check." },
|
|
211
211
|
{ title: "Spec — self-healing layer", path: "docs/specs/2026-08-21-self-healing-layer.md", summary: "Phase A contract: informational-only health score (Goodhart guard), no runtime telemetry, deterministic visible-copy intent rules, drift-ledger status convention, and the calibration record (6→0 false positives; two scoring bugs caught by face-checking)." },
|
|
212
|
+
{ title: "Plan — drift elimination", path: "docs/plans/2026-08-31-drift-elimination.md", summary: "Closing the loop between upstream, client forks, and prototype repos. Built on the one artifact every working template-sync tool shares: a committed record of which upstream version a downstream copy is layered on. Three phases ordered by risk — additive checks, then PR-gated fork sync, then the deferred structural calls." },
|
|
213
|
+
{ title: "Spec — drift elimination", path: "docs/specs/2026-08-31-drift-elimination.md", summary: "Phase A contract: precision over recall (unverifiable is never reported as drift), advisory-by-default with one blocking generated-artifact gate, additive-only sync manifest, and declared expected-drift allowlists. Calibration: 51→0 false positives on the registry checker, and real drift caught including llms.txt advertising 79 components when there were 173." },
|
|
212
214
|
],
|
|
213
215
|
},
|
|
214
216
|
];
|
|
@@ -138,6 +138,54 @@ export const Variant_Creatable: Story = {
|
|
|
138
138
|
},
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
+
export const Size_Sm: Story = {
|
|
142
|
+
name: "Size — sm",
|
|
143
|
+
render: () => {
|
|
144
|
+
const [value, setValue] = React.useState("");
|
|
145
|
+
return (
|
|
146
|
+
<Combobox
|
|
147
|
+
options={frameworks}
|
|
148
|
+
value={value}
|
|
149
|
+
onValueChange={setValue}
|
|
150
|
+
placeholder="Select framework..."
|
|
151
|
+
size="sm"
|
|
152
|
+
/>
|
|
153
|
+
);
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export const Size_Lg: Story = {
|
|
158
|
+
name: "Size — lg",
|
|
159
|
+
render: () => {
|
|
160
|
+
const [value, setValue] = React.useState("");
|
|
161
|
+
return (
|
|
162
|
+
<Combobox
|
|
163
|
+
options={frameworks}
|
|
164
|
+
value={value}
|
|
165
|
+
onValueChange={setValue}
|
|
166
|
+
placeholder="Select framework..."
|
|
167
|
+
size="lg"
|
|
168
|
+
/>
|
|
169
|
+
);
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export const Size_Xl: Story = {
|
|
174
|
+
name: "Size — xl (CTA floor, 44px)",
|
|
175
|
+
render: () => {
|
|
176
|
+
const [value, setValue] = React.useState("");
|
|
177
|
+
return (
|
|
178
|
+
<Combobox
|
|
179
|
+
options={frameworks}
|
|
180
|
+
value={value}
|
|
181
|
+
onValueChange={setValue}
|
|
182
|
+
placeholder="Select framework..."
|
|
183
|
+
size="xl"
|
|
184
|
+
/>
|
|
185
|
+
);
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
|
|
141
189
|
export const RealisticUse: Story = {
|
|
142
190
|
decorators: [
|
|
143
191
|
(Story) => (
|
|
@@ -253,6 +253,44 @@ const REALISTIC_COLUMNS: ColumnDef<ComponentRow>[] = [
|
|
|
253
253
|
{ accessorKey: "lastUpdated", header: "Last Updated" },
|
|
254
254
|
];
|
|
255
255
|
|
|
256
|
+
// ---------------------------------------------------------------------------
|
|
257
|
+
// StickyHeader — header stays visible as rows scroll
|
|
258
|
+
// ---------------------------------------------------------------------------
|
|
259
|
+
|
|
260
|
+
export const StickyHeader: Story = {
|
|
261
|
+
render: () => (
|
|
262
|
+
<DataTable
|
|
263
|
+
columns={ADOPTION_COLUMNS}
|
|
264
|
+
data={ADOPTION_DATA}
|
|
265
|
+
stickyHeader
|
|
266
|
+
scrollHeight="260px"
|
|
267
|
+
/>
|
|
268
|
+
),
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
// ---------------------------------------------------------------------------
|
|
272
|
+
// WideOverflowing — a min-width table in a constrained wrapper (scroll test)
|
|
273
|
+
// ---------------------------------------------------------------------------
|
|
274
|
+
|
|
275
|
+
export const WideOverflowing: Story = {
|
|
276
|
+
render: () => (
|
|
277
|
+
<div className="w-[380px]">
|
|
278
|
+
<DataTable
|
|
279
|
+
columns={[
|
|
280
|
+
{ accessorKey: "component", header: "Component", size: 200 },
|
|
281
|
+
{ accessorKey: "status", header: "Status", size: 120 },
|
|
282
|
+
{ accessorKey: "adopters", header: "Adopters", size: 100 },
|
|
283
|
+
{ accessorKey: "coverage", header: "Coverage", size: 100 },
|
|
284
|
+
{ accessorKey: "lastUpdated", header: "Last Updated", size: 140 },
|
|
285
|
+
]}
|
|
286
|
+
data={ADOPTION_DATA.slice(0, 6)}
|
|
287
|
+
stickyHeader
|
|
288
|
+
scrollHeight="200px"
|
|
289
|
+
/>
|
|
290
|
+
</div>
|
|
291
|
+
),
|
|
292
|
+
};
|
|
293
|
+
|
|
256
294
|
export const RealisticUse: Story = {
|
|
257
295
|
render: () => (
|
|
258
296
|
<div className="space-y-2">
|
|
@@ -66,6 +66,60 @@ export const WithError: Story = {
|
|
|
66
66
|
},
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
+
export const Variant_Ghost: Story = {
|
|
70
|
+
name: "Variant: Ghost (inline edit)",
|
|
71
|
+
render: () => {
|
|
72
|
+
const [value, setValue] = React.useState("Amara Okafor");
|
|
73
|
+
return (
|
|
74
|
+
<div className="flex w-72 flex-col gap-4">
|
|
75
|
+
<Input
|
|
76
|
+
variant="ghost"
|
|
77
|
+
type="search"
|
|
78
|
+
aria-label="Search projects"
|
|
79
|
+
placeholder="Search projects…"
|
|
80
|
+
leftSection={<SearchIcon size={16} strokeWidth={1.5} aria-hidden="true" />}
|
|
81
|
+
/>
|
|
82
|
+
<Input
|
|
83
|
+
variant="ghost"
|
|
84
|
+
aria-label="Assignee name"
|
|
85
|
+
value={value}
|
|
86
|
+
onChange={(e) => setValue(e.target.value)}
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const Variant_Filled: Story = {
|
|
94
|
+
name: "Variant: Filled",
|
|
95
|
+
render: () => {
|
|
96
|
+
const [value, setValue] = React.useState("maya.chen@lumenworks.studio");
|
|
97
|
+
return (
|
|
98
|
+
<div className="flex w-72 flex-col gap-4">
|
|
99
|
+
<Input variant="filled" aria-label="Filter by name" placeholder="Filter by name" />
|
|
100
|
+
<Input
|
|
101
|
+
variant="filled"
|
|
102
|
+
type="email"
|
|
103
|
+
aria-label="Work email"
|
|
104
|
+
value={value}
|
|
105
|
+
onChange={(e) => setValue(e.target.value)}
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
);
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export const Variant_AllThree: Story = {
|
|
113
|
+
name: "Variant: outline / ghost / filled",
|
|
114
|
+
render: () => (
|
|
115
|
+
<div className="flex w-72 flex-col gap-4">
|
|
116
|
+
<Input variant="outline" aria-label="Outline variant" placeholder="Search projects…" />
|
|
117
|
+
<Input variant="ghost" aria-label="Ghost variant" placeholder="Search projects…" />
|
|
118
|
+
<Input variant="filled" aria-label="Filled variant" placeholder="Search projects…" />
|
|
119
|
+
</div>
|
|
120
|
+
),
|
|
121
|
+
};
|
|
122
|
+
|
|
69
123
|
export const Variant_WithLeftIcon: Story = {
|
|
70
124
|
name: "Variant: With left icon",
|
|
71
125
|
args: {
|
|
@@ -92,6 +92,42 @@ export const EmptyState: Story = {
|
|
|
92
92
|
),
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
export const Size_Sm: Story = {
|
|
96
|
+
name: "Size — sm",
|
|
97
|
+
render: () => {
|
|
98
|
+
const [val, setVal] = React.useState<string[]>([])
|
|
99
|
+
return (
|
|
100
|
+
<div className="w-72">
|
|
101
|
+
<MultiSelect options={FRAMEWORKS} value={val} onValueChange={setVal} size="sm" placeholder="Select frameworks..." />
|
|
102
|
+
</div>
|
|
103
|
+
)
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const Size_Lg: Story = {
|
|
108
|
+
name: "Size — lg",
|
|
109
|
+
render: () => {
|
|
110
|
+
const [val, setVal] = React.useState<string[]>([])
|
|
111
|
+
return (
|
|
112
|
+
<div className="w-72">
|
|
113
|
+
<MultiSelect options={FRAMEWORKS} value={val} onValueChange={setVal} size="lg" placeholder="Select frameworks..." />
|
|
114
|
+
</div>
|
|
115
|
+
)
|
|
116
|
+
},
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const Size_Xl: Story = {
|
|
120
|
+
name: "Size — xl (CTA floor, 44 px)",
|
|
121
|
+
render: () => {
|
|
122
|
+
const [val, setVal] = React.useState<string[]>([])
|
|
123
|
+
return (
|
|
124
|
+
<div className="w-72">
|
|
125
|
+
<MultiSelect options={FRAMEWORKS} value={val} onValueChange={setVal} size="xl" placeholder="Select frameworks..." />
|
|
126
|
+
</div>
|
|
127
|
+
)
|
|
128
|
+
},
|
|
129
|
+
}
|
|
130
|
+
|
|
95
131
|
export const RealisticUse: Story = {
|
|
96
132
|
render: () => {
|
|
97
133
|
const [tags, setTags] = React.useState<string[]>(["next", "remix"])
|