sparkdesign 0.4.9 → 0.4.10
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/AGENT_COMPONENT_LIBRARY_QUICKREF.md +117 -0
- package/AI_README.md +7 -2
- package/README.md +4 -1
- package/cli/registry/AGENTS.md +1 -1
- package/cli/registry/agent-manifest.json +137 -93
- package/cli/registry/basic/calendar.tsx +16 -16
- package/cli/registry/basic/combobox.tsx +11 -2
- package/cli/registry/basic/date-picker.tsx +3 -2
- package/cli/registry/basic/popover.tsx +19 -2
- package/cli/registry/basic/rating.tsx +161 -0
- package/cli/registry/basic/sidebar.tsx +1 -1
- package/cli/registry/basic/stepper.tsx +163 -0
- package/cli/registry/basic/timeline.tsx +129 -0
- package/cli/registry/chat/permission-card.tsx +1 -1
- package/cli/registry/meta.json +30 -25
- package/dist/registry/basic/calendar.d.ts +1 -1
- package/dist/registry/basic/combobox.d.ts +2 -1
- package/dist/registry/basic/date-picker.d.ts +2 -2
- package/dist/registry/basic/popover.d.ts +2 -0
- package/dist/registry/basic/rating.d.ts +31 -0
- package/dist/registry/basic/stepper.d.ts +36 -0
- package/dist/registry/basic/timeline.d.ts +34 -0
- package/dist/spark-design.cjs.js +23 -23
- package/dist/spark-design.es.js +3420 -3035
- package/dist/sparkdesign.css +1 -1
- package/dist/src/components/basic/Rating/index.d.ts +13 -0
- package/dist/src/components/basic/Stepper/index.d.ts +13 -0
- package/dist/src/components/basic/Timeline/index.d.ts +13 -0
- package/dist/src/components/index.d.ts +6 -2
- package/docs/agent/component-selection.md +1 -3
- package/docs/agent/prompt-recipes.md +167 -0
- package/docs/guides/agent-usage.md +213 -0
- package/docs/guides/system-operating-model.md +148 -0
- package/package.json +14 -2
- package/registry/agent-manifest.json +137 -93
- package/cli/registry/basic/sheet.tsx +0 -18
- package/dist/registry/basic/sheet.d.ts +0 -13
- package/dist/src/components/basic/Sheet/index.d.ts +0 -13
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
+
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const ratingVariants = cva('inline-flex items-center gap-1', {
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
sm: '[--rating-size:1rem]',
|
|
10
|
+
md: '[--rating-size:1.25rem]',
|
|
11
|
+
lg: '[--rating-size:1.5rem]',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
size: 'md',
|
|
16
|
+
},
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
type RatingPrecision = 1 | 0.5
|
|
20
|
+
|
|
21
|
+
export interface RatingProps
|
|
22
|
+
extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>,
|
|
23
|
+
VariantProps<typeof ratingVariants> {
|
|
24
|
+
value?: number
|
|
25
|
+
defaultValue?: number
|
|
26
|
+
onValueChange?: (value: number) => void
|
|
27
|
+
max?: number
|
|
28
|
+
precision?: RatingPrecision
|
|
29
|
+
readOnly?: boolean
|
|
30
|
+
disabled?: boolean
|
|
31
|
+
showValue?: boolean
|
|
32
|
+
label?: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function clampRating(value: number, max: number, precision: RatingPrecision) {
|
|
36
|
+
const normalized = Math.max(0, Math.min(max, value))
|
|
37
|
+
return Math.round(normalized / precision) * precision
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function RatingStar({ className }: { className?: string }) {
|
|
41
|
+
return (
|
|
42
|
+
<svg
|
|
43
|
+
aria-hidden="true"
|
|
44
|
+
viewBox="0 0 20 20"
|
|
45
|
+
className={cn('size-[var(--rating-size)]', className)}
|
|
46
|
+
>
|
|
47
|
+
<path d="M10 1.7l2.3 4.7 5.2.8-3.8 3.7.9 5.2-4.6-2.5-4.6 2.5.9-5.2-3.8-3.7 5.2-.8L10 1.7z" />
|
|
48
|
+
</svg>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const Rating = React.forwardRef<HTMLDivElement, RatingProps>(
|
|
53
|
+
(
|
|
54
|
+
{
|
|
55
|
+
className,
|
|
56
|
+
size,
|
|
57
|
+
value,
|
|
58
|
+
defaultValue = 0,
|
|
59
|
+
onValueChange,
|
|
60
|
+
max = 5,
|
|
61
|
+
precision = 1,
|
|
62
|
+
readOnly = false,
|
|
63
|
+
disabled = false,
|
|
64
|
+
showValue = false,
|
|
65
|
+
label = 'Rating',
|
|
66
|
+
...props
|
|
67
|
+
},
|
|
68
|
+
ref
|
|
69
|
+
) => {
|
|
70
|
+
const [internalValue, setInternalValue] = React.useState(defaultValue)
|
|
71
|
+
const currentValue = clampRating(value ?? internalValue, max, precision)
|
|
72
|
+
const interactive = !readOnly && !disabled
|
|
73
|
+
|
|
74
|
+
const commitValue = (nextValue: number) => {
|
|
75
|
+
const next = clampRating(nextValue, max, precision)
|
|
76
|
+
if (value == null) setInternalValue(next)
|
|
77
|
+
onValueChange?.(next)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<div
|
|
82
|
+
ref={ref}
|
|
83
|
+
role={interactive ? 'radiogroup' : 'img'}
|
|
84
|
+
aria-label={label}
|
|
85
|
+
aria-disabled={disabled || undefined}
|
|
86
|
+
aria-readonly={readOnly || undefined}
|
|
87
|
+
aria-valuenow={!interactive ? currentValue : undefined}
|
|
88
|
+
aria-valuemax={!interactive ? max : undefined}
|
|
89
|
+
data-slot="rating"
|
|
90
|
+
data-disabled={disabled || undefined}
|
|
91
|
+
className={cn(
|
|
92
|
+
ratingVariants({ size }),
|
|
93
|
+
disabled && 'cursor-not-allowed opacity-50',
|
|
94
|
+
className
|
|
95
|
+
)}
|
|
96
|
+
{...props}
|
|
97
|
+
>
|
|
98
|
+
{Array.from({ length: max }, (_, index) => {
|
|
99
|
+
const starValue = index + 1
|
|
100
|
+
const fillRatio = Math.max(0, Math.min(1, currentValue - index))
|
|
101
|
+
const halfValue = starValue - 0.5
|
|
102
|
+
return (
|
|
103
|
+
<span
|
|
104
|
+
key={starValue}
|
|
105
|
+
className="relative inline-flex size-[var(--rating-size)] shrink-0 text-border-tertiary"
|
|
106
|
+
>
|
|
107
|
+
<RatingStar className="fill-current" />
|
|
108
|
+
<span
|
|
109
|
+
aria-hidden="true"
|
|
110
|
+
className="absolute inset-0 overflow-hidden text-warning"
|
|
111
|
+
style={{ width: `${fillRatio * 100}%` }}
|
|
112
|
+
>
|
|
113
|
+
<RatingStar className="fill-current" />
|
|
114
|
+
</span>
|
|
115
|
+
{interactive ? (
|
|
116
|
+
precision === 0.5 ? (
|
|
117
|
+
<span className="absolute inset-0 grid grid-cols-2">
|
|
118
|
+
<button
|
|
119
|
+
type="button"
|
|
120
|
+
role="radio"
|
|
121
|
+
aria-label={`${halfValue} of ${max}`}
|
|
122
|
+
aria-checked={currentValue === halfValue}
|
|
123
|
+
className="cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-border"
|
|
124
|
+
onClick={() => commitValue(halfValue)}
|
|
125
|
+
/>
|
|
126
|
+
<button
|
|
127
|
+
type="button"
|
|
128
|
+
role="radio"
|
|
129
|
+
aria-label={`${starValue} of ${max}`}
|
|
130
|
+
aria-checked={currentValue === starValue}
|
|
131
|
+
className="cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-border"
|
|
132
|
+
onClick={() => commitValue(starValue)}
|
|
133
|
+
/>
|
|
134
|
+
</span>
|
|
135
|
+
) : (
|
|
136
|
+
<button
|
|
137
|
+
type="button"
|
|
138
|
+
role="radio"
|
|
139
|
+
aria-label={`${starValue} of ${max}`}
|
|
140
|
+
aria-checked={currentValue === starValue}
|
|
141
|
+
className="absolute inset-0 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-border"
|
|
142
|
+
onClick={() => commitValue(starValue)}
|
|
143
|
+
/>
|
|
144
|
+
)
|
|
145
|
+
) : null}
|
|
146
|
+
</span>
|
|
147
|
+
)
|
|
148
|
+
})}
|
|
149
|
+
{showValue ? (
|
|
150
|
+
<span className="ml-1 text-sm font-medium text-text-secondary">
|
|
151
|
+
{currentValue.toFixed(precision === 0.5 && currentValue % 1 ? 1 : 0)}
|
|
152
|
+
</span>
|
|
153
|
+
) : null}
|
|
154
|
+
</div>
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
Rating.displayName = 'Rating'
|
|
159
|
+
|
|
160
|
+
export { Rating, ratingVariants }
|
|
161
|
+
export type { RatingPrecision }
|
|
@@ -9,7 +9,7 @@ import { cn } from "@/lib/utils"
|
|
|
9
9
|
import { Button } from "./button"
|
|
10
10
|
import { Input } from "./input"
|
|
11
11
|
import { Separator } from "./separator"
|
|
12
|
-
import { Sheet, SheetContent } from "./
|
|
12
|
+
import { Drawer as Sheet, DrawerContent as SheetContent } from "./drawer"
|
|
13
13
|
import { Skeleton } from "./skeleton"
|
|
14
14
|
import { Tooltip } from "./tooltip"
|
|
15
15
|
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
+
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
type StepStatus = 'complete' | 'current' | 'upcoming' | 'error'
|
|
7
|
+
|
|
8
|
+
const stepperVariants = cva('group/stepper flex w-full', {
|
|
9
|
+
variants: {
|
|
10
|
+
orientation: {
|
|
11
|
+
horizontal: 'items-start',
|
|
12
|
+
vertical: 'flex-col',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
orientation: 'horizontal',
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
export interface StepperProps
|
|
21
|
+
extends React.OlHTMLAttributes<HTMLOListElement>,
|
|
22
|
+
VariantProps<typeof stepperVariants> {}
|
|
23
|
+
|
|
24
|
+
export interface StepperItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
25
|
+
status?: StepStatus
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type StepperIndicatorProps = React.HTMLAttributes<HTMLSpanElement>
|
|
29
|
+
export type StepperContentProps = React.HTMLAttributes<HTMLDivElement>
|
|
30
|
+
export type StepperTitleProps = React.HTMLAttributes<HTMLDivElement>
|
|
31
|
+
export type StepperDescriptionProps = React.HTMLAttributes<HTMLDivElement>
|
|
32
|
+
export type StepperSeparatorProps = React.HTMLAttributes<HTMLSpanElement>
|
|
33
|
+
|
|
34
|
+
function CheckIcon() {
|
|
35
|
+
return (
|
|
36
|
+
<svg aria-hidden="true" viewBox="0 0 16 16" className="size-3.5">
|
|
37
|
+
<path
|
|
38
|
+
fill="currentColor"
|
|
39
|
+
d="M6.2 11.3 2.9 8l1-1 2.3 2.3 5-5 1 1-6 6z"
|
|
40
|
+
/>
|
|
41
|
+
</svg>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function Stepper({
|
|
46
|
+
className,
|
|
47
|
+
orientation = 'horizontal',
|
|
48
|
+
...props
|
|
49
|
+
}: StepperProps) {
|
|
50
|
+
return (
|
|
51
|
+
<ol
|
|
52
|
+
data-slot="stepper"
|
|
53
|
+
data-orientation={orientation}
|
|
54
|
+
className={cn(stepperVariants({ orientation }), className)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function StepperItem({
|
|
61
|
+
className,
|
|
62
|
+
status = 'upcoming',
|
|
63
|
+
...props
|
|
64
|
+
}: StepperItemProps) {
|
|
65
|
+
return (
|
|
66
|
+
<li
|
|
67
|
+
data-slot="stepper-item"
|
|
68
|
+
data-status={status}
|
|
69
|
+
className={cn(
|
|
70
|
+
'group/stepper-item relative flex min-w-0 flex-1 gap-3',
|
|
71
|
+
'group-data-[orientation=horizontal]/stepper:flex-col group-data-[orientation=horizontal]/stepper:items-center group-data-[orientation=horizontal]/stepper:gap-2 group-data-[orientation=horizontal]/stepper:text-center',
|
|
72
|
+
'data-[status=current]:text-text data-[status=upcoming]:text-text-tertiary',
|
|
73
|
+
'data-[status=complete]:text-text data-[status=error]:text-error',
|
|
74
|
+
className
|
|
75
|
+
)}
|
|
76
|
+
{...props}
|
|
77
|
+
/>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function StepperIndicator({ className, children, ...props }: StepperIndicatorProps) {
|
|
82
|
+
return (
|
|
83
|
+
<span
|
|
84
|
+
data-slot="stepper-indicator"
|
|
85
|
+
className={cn(
|
|
86
|
+
'z-10 flex size-7 shrink-0 items-center justify-center rounded-full border text-xs font-semibold transition-colors',
|
|
87
|
+
'border-border-tertiary bg-bg-container text-text-tertiary',
|
|
88
|
+
'group-data-[status=complete]/stepper-item:border-primary group-data-[status=complete]/stepper-item:bg-primary group-data-[status=complete]/stepper-item:text-text-on-primary',
|
|
89
|
+
'group-data-[status=current]/stepper-item:border-primary group-data-[status=current]/stepper-item:text-primary',
|
|
90
|
+
'group-data-[status=error]/stepper-item:border-error group-data-[status=error]/stepper-item:bg-error-bg group-data-[status=error]/stepper-item:text-error',
|
|
91
|
+
className
|
|
92
|
+
)}
|
|
93
|
+
{...props}
|
|
94
|
+
>
|
|
95
|
+
<span className="group-data-[status=complete]/stepper-item:hidden">
|
|
96
|
+
{children}
|
|
97
|
+
</span>
|
|
98
|
+
<span className="hidden group-data-[status=complete]/stepper-item:inline-flex">
|
|
99
|
+
<CheckIcon />
|
|
100
|
+
</span>
|
|
101
|
+
</span>
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function StepperContent({ className, ...props }: StepperContentProps) {
|
|
106
|
+
return (
|
|
107
|
+
<div
|
|
108
|
+
data-slot="stepper-content"
|
|
109
|
+
className={cn(
|
|
110
|
+
'min-w-0 flex-1 pb-6 group-data-[orientation=horizontal]/stepper:pb-0',
|
|
111
|
+
className
|
|
112
|
+
)}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function StepperTitle({ className, ...props }: StepperTitleProps) {
|
|
119
|
+
return (
|
|
120
|
+
<div
|
|
121
|
+
data-slot="stepper-title"
|
|
122
|
+
className={cn('text-sm font-medium leading-5 text-current', className)}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function StepperDescription({ className, ...props }: StepperDescriptionProps) {
|
|
129
|
+
return (
|
|
130
|
+
<div
|
|
131
|
+
data-slot="stepper-description"
|
|
132
|
+
className={cn('mt-1 text-sm leading-5 text-text-tertiary', className)}
|
|
133
|
+
{...props}
|
|
134
|
+
/>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function StepperSeparator({ className, ...props }: StepperSeparatorProps) {
|
|
139
|
+
return (
|
|
140
|
+
<span
|
|
141
|
+
aria-hidden="true"
|
|
142
|
+
data-slot="stepper-separator"
|
|
143
|
+
className={cn(
|
|
144
|
+
'absolute left-3.5 top-7 h-[calc(100%-1.75rem)] w-px -translate-x-1/2 bg-border-tertiary',
|
|
145
|
+
'group-data-[orientation=horizontal]/stepper:left-[calc(50%+1rem)] group-data-[orientation=horizontal]/stepper:right-[calc(-50%+1rem)] group-data-[orientation=horizontal]/stepper:top-3.5 group-data-[orientation=horizontal]/stepper:h-px group-data-[orientation=horizontal]/stepper:w-auto group-data-[orientation=horizontal]/stepper:translate-x-0',
|
|
146
|
+
'group-data-[status=complete]/stepper-item:bg-primary',
|
|
147
|
+
className
|
|
148
|
+
)}
|
|
149
|
+
{...props}
|
|
150
|
+
/>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export {
|
|
155
|
+
Stepper,
|
|
156
|
+
StepperItem,
|
|
157
|
+
StepperIndicator,
|
|
158
|
+
StepperContent,
|
|
159
|
+
StepperTitle,
|
|
160
|
+
StepperDescription,
|
|
161
|
+
StepperSeparator,
|
|
162
|
+
}
|
|
163
|
+
export type { StepStatus }
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
3
|
+
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const timelineMarkerVariants = cva(
|
|
7
|
+
'mt-1.5 flex size-2.5 shrink-0 rounded-full ring-4 ring-bg-base',
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
tone: {
|
|
11
|
+
default: 'bg-border',
|
|
12
|
+
primary: 'bg-primary',
|
|
13
|
+
success: 'bg-success',
|
|
14
|
+
warning: 'bg-warning',
|
|
15
|
+
error: 'bg-error',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
tone: 'default',
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
export type TimelineProps = React.OlHTMLAttributes<HTMLOListElement>
|
|
25
|
+
export type TimelineItemProps = React.LiHTMLAttributes<HTMLLIElement>
|
|
26
|
+
export type TimelineContentProps = React.HTMLAttributes<HTMLDivElement>
|
|
27
|
+
export type TimelineTitleProps = React.HTMLAttributes<HTMLDivElement>
|
|
28
|
+
export type TimelineDescriptionProps = React.HTMLAttributes<HTMLDivElement>
|
|
29
|
+
export type TimelineTimeProps = React.TimeHTMLAttributes<HTMLTimeElement>
|
|
30
|
+
export type TimelineConnectorProps = React.HTMLAttributes<HTMLSpanElement>
|
|
31
|
+
export interface TimelineMarkerProps
|
|
32
|
+
extends React.HTMLAttributes<HTMLSpanElement>,
|
|
33
|
+
VariantProps<typeof timelineMarkerVariants> {}
|
|
34
|
+
|
|
35
|
+
function Timeline({ className, ...props }: TimelineProps) {
|
|
36
|
+
return (
|
|
37
|
+
<ol
|
|
38
|
+
data-slot="timeline"
|
|
39
|
+
className={cn('flex flex-col', className)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function TimelineItem({ className, ...props }: TimelineItemProps) {
|
|
46
|
+
return (
|
|
47
|
+
<li
|
|
48
|
+
data-slot="timeline-item"
|
|
49
|
+
className={cn('group/timeline-item relative grid grid-cols-[auto_minmax(0,1fr)] gap-3 pb-6 last:pb-0', className)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function TimelineMarker({ className, tone, ...props }: TimelineMarkerProps) {
|
|
56
|
+
return (
|
|
57
|
+
<span
|
|
58
|
+
data-slot="timeline-marker"
|
|
59
|
+
className={cn(timelineMarkerVariants({ tone }), className)}
|
|
60
|
+
{...props}
|
|
61
|
+
/>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function TimelineConnector({ className, ...props }: TimelineConnectorProps) {
|
|
66
|
+
return (
|
|
67
|
+
<span
|
|
68
|
+
aria-hidden="true"
|
|
69
|
+
data-slot="timeline-connector"
|
|
70
|
+
className={cn(
|
|
71
|
+
'absolute left-1.5 top-5 h-[calc(100%-1.25rem)] w-px bg-border-tertiary group-last/timeline-item:hidden',
|
|
72
|
+
className
|
|
73
|
+
)}
|
|
74
|
+
{...props}
|
|
75
|
+
/>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function TimelineContent({ className, ...props }: TimelineContentProps) {
|
|
80
|
+
return (
|
|
81
|
+
<div
|
|
82
|
+
data-slot="timeline-content"
|
|
83
|
+
className={cn('min-w-0', className)}
|
|
84
|
+
{...props}
|
|
85
|
+
/>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function TimelineTitle({ className, ...props }: TimelineTitleProps) {
|
|
90
|
+
return (
|
|
91
|
+
<div
|
|
92
|
+
data-slot="timeline-title"
|
|
93
|
+
className={cn('text-sm font-medium leading-5 text-text', className)}
|
|
94
|
+
{...props}
|
|
95
|
+
/>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function TimelineDescription({ className, ...props }: TimelineDescriptionProps) {
|
|
100
|
+
return (
|
|
101
|
+
<div
|
|
102
|
+
data-slot="timeline-description"
|
|
103
|
+
className={cn('mt-1 text-sm leading-6 text-text-tertiary', className)}
|
|
104
|
+
{...props}
|
|
105
|
+
/>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function TimelineTime({ className, ...props }: TimelineTimeProps) {
|
|
110
|
+
return (
|
|
111
|
+
<time
|
|
112
|
+
data-slot="timeline-time"
|
|
113
|
+
className={cn('mt-1 block text-xs leading-5 text-text-quaternary', className)}
|
|
114
|
+
{...props}
|
|
115
|
+
/>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export {
|
|
120
|
+
Timeline,
|
|
121
|
+
TimelineItem,
|
|
122
|
+
TimelineMarker,
|
|
123
|
+
TimelineConnector,
|
|
124
|
+
TimelineContent,
|
|
125
|
+
TimelineTitle,
|
|
126
|
+
TimelineDescription,
|
|
127
|
+
TimelineTime,
|
|
128
|
+
timelineMarkerVariants,
|
|
129
|
+
}
|
|
@@ -103,7 +103,7 @@ export const PermissionCard = forwardRef<HTMLDivElement, PermissionCardProps>(
|
|
|
103
103
|
<p className="mb-2 ml-6 text-xs leading-xs text-text-tertiary">
|
|
104
104
|
{isLoadingIntent ? (
|
|
105
105
|
<span className="inline-flex items-center gap-1.5">
|
|
106
|
-
<
|
|
106
|
+
<span className="inline-block h-3 w-3 animate-spin rounded-full border-2 border-text-tertiary border-t-transparent" />
|
|
107
107
|
<span>{displayDescription}</span>
|
|
108
108
|
</span>
|
|
109
109
|
) : (
|
package/cli/registry/meta.json
CHANGED
|
@@ -968,6 +968,18 @@
|
|
|
968
968
|
"react-dom"
|
|
969
969
|
]
|
|
970
970
|
},
|
|
971
|
+
"rating": {
|
|
972
|
+
"files": [
|
|
973
|
+
"basic/rating.tsx"
|
|
974
|
+
],
|
|
975
|
+
"dependencies": [
|
|
976
|
+
"class-variance-authority"
|
|
977
|
+
],
|
|
978
|
+
"peerDependencies": [
|
|
979
|
+
"react",
|
|
980
|
+
"react-dom"
|
|
981
|
+
]
|
|
982
|
+
},
|
|
971
983
|
"reasoning-step": {
|
|
972
984
|
"files": [
|
|
973
985
|
"chat/reasoning-step/index.tsx",
|
|
@@ -1109,23 +1121,6 @@
|
|
|
1109
1121
|
"react-dom"
|
|
1110
1122
|
]
|
|
1111
1123
|
},
|
|
1112
|
-
"sheet": {
|
|
1113
|
-
"files": [
|
|
1114
|
-
"basic/sheet.tsx",
|
|
1115
|
-
"basic/drawer.tsx",
|
|
1116
|
-
"basic/icons-inline.tsx",
|
|
1117
|
-
"basic/theme-from-document.ts"
|
|
1118
|
-
],
|
|
1119
|
-
"dependencies": [
|
|
1120
|
-
"@radix-ui/react-dialog",
|
|
1121
|
-
"class-variance-authority",
|
|
1122
|
-
"framer-motion"
|
|
1123
|
-
],
|
|
1124
|
-
"peerDependencies": [
|
|
1125
|
-
"react",
|
|
1126
|
-
"react-dom"
|
|
1127
|
-
]
|
|
1128
|
-
},
|
|
1129
1124
|
"shimmering-text": {
|
|
1130
1125
|
"files": [
|
|
1131
1126
|
"basic/shimmering-text.tsx",
|
|
@@ -1149,7 +1144,6 @@
|
|
|
1149
1144
|
"basic/icons-inline.tsx",
|
|
1150
1145
|
"basic/input.tsx",
|
|
1151
1146
|
"basic/separator.tsx",
|
|
1152
|
-
"basic/sheet.tsx",
|
|
1153
1147
|
"basic/drawer.tsx",
|
|
1154
1148
|
"basic/theme-from-document.ts",
|
|
1155
1149
|
"basic/skeleton.tsx",
|
|
@@ -1211,23 +1205,22 @@
|
|
|
1211
1205
|
"react-dom"
|
|
1212
1206
|
]
|
|
1213
1207
|
},
|
|
1214
|
-
"
|
|
1208
|
+
"spinner": {
|
|
1215
1209
|
"files": [
|
|
1216
|
-
"basic/
|
|
1217
|
-
"basic/
|
|
1210
|
+
"basic/spinner.tsx",
|
|
1211
|
+
"basic/icons-inline.tsx"
|
|
1218
1212
|
],
|
|
1219
1213
|
"dependencies": [
|
|
1220
|
-
"
|
|
1214
|
+
"class-variance-authority"
|
|
1221
1215
|
],
|
|
1222
1216
|
"peerDependencies": [
|
|
1223
1217
|
"react",
|
|
1224
1218
|
"react-dom"
|
|
1225
1219
|
]
|
|
1226
1220
|
},
|
|
1227
|
-
"
|
|
1221
|
+
"stepper": {
|
|
1228
1222
|
"files": [
|
|
1229
|
-
"basic/
|
|
1230
|
-
"basic/icons-inline.tsx"
|
|
1223
|
+
"basic/stepper.tsx"
|
|
1231
1224
|
],
|
|
1232
1225
|
"dependencies": [
|
|
1233
1226
|
"class-variance-authority"
|
|
@@ -1359,6 +1352,18 @@
|
|
|
1359
1352
|
"react-dom"
|
|
1360
1353
|
]
|
|
1361
1354
|
},
|
|
1355
|
+
"timeline": {
|
|
1356
|
+
"files": [
|
|
1357
|
+
"basic/timeline.tsx"
|
|
1358
|
+
],
|
|
1359
|
+
"dependencies": [
|
|
1360
|
+
"class-variance-authority"
|
|
1361
|
+
],
|
|
1362
|
+
"peerDependencies": [
|
|
1363
|
+
"react",
|
|
1364
|
+
"react-dom"
|
|
1365
|
+
]
|
|
1366
|
+
},
|
|
1362
1367
|
"toast": {
|
|
1363
1368
|
"files": [
|
|
1364
1369
|
"basic/sonner.tsx",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* [WHO]: Calendar and CalendarDayButton date grid primitives.
|
|
3
3
|
* [FROM]: React, react-day-picker, registry/basic/button, registry/lib/utils.
|
|
4
4
|
* [TO]: sparkdesign package consumers; Showcase; CLI registry copies.
|
|
5
|
-
* [HERE]: registry/basic/calendar.tsx — tokenized shadcn-
|
|
5
|
+
* [HERE]: registry/basic/calendar.tsx — tokenized shadcn-compatible Calendar primitive.
|
|
6
6
|
*
|
|
7
7
|
* [PROTOCOL]:
|
|
8
8
|
* 1. Keep this P3 header in sync when the public contract changes.
|
|
@@ -18,6 +18,7 @@ export interface ComboboxOption {
|
|
|
18
18
|
}
|
|
19
19
|
export interface ComboboxProps {
|
|
20
20
|
options: ComboboxOption[];
|
|
21
|
+
size?: 'default' | 'compact';
|
|
21
22
|
value?: string;
|
|
22
23
|
defaultValue?: string;
|
|
23
24
|
onValueChange?: (value: string) => void;
|
|
@@ -33,5 +34,5 @@ export interface ComboboxProps {
|
|
|
33
34
|
name?: string;
|
|
34
35
|
'aria-label'?: string;
|
|
35
36
|
}
|
|
36
|
-
declare function Combobox({ options, value, defaultValue, onValueChange, placeholder, searchPlaceholder, emptyText, disabled, className, contentClassName, triggerClassName, align, id, name, 'aria-label': ariaLabel, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
declare function Combobox({ options, value, defaultValue, onValueChange, placeholder, searchPlaceholder, emptyText, size, disabled, className, contentClassName, triggerClassName, align, id, name, 'aria-label': ariaLabel, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
37
38
|
export { Combobox };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* [WHO]: DatePicker
|
|
2
|
+
* [WHO]: DatePicker composes a Spark trigger with the shared Calendar in a Popover.
|
|
3
3
|
* [FROM]: React, date-fns, registry/basic/button, registry/basic/calendar, registry/basic/popover, registry/lib/utils.
|
|
4
4
|
* [TO]: sparkdesign package consumers; output of CLI `add date-picker` when registered.
|
|
5
|
-
* [HERE]: registry/basic/date-picker.tsx — Spark Design
|
|
5
|
+
* [HERE]: registry/basic/date-picker.tsx — Spark Design date picker source.
|
|
6
6
|
*
|
|
7
7
|
* [PROTOCOL]:
|
|
8
8
|
* 1. Render a Button trigger that surfaces the selected date using project typography/tokens.
|
|
@@ -18,6 +18,8 @@ export interface PopoverContentProps extends React.ComponentPropsWithoutRef<type
|
|
|
18
18
|
/** When provided (e.g. from ThemeStyleProvider), used for portal wrapper */
|
|
19
19
|
dataStyle?: string;
|
|
20
20
|
dataTheme?: string;
|
|
21
|
+
/** Popover internal padding; keep default to avoid breaking existing usages */
|
|
22
|
+
contentPadding?: 'default' | 'compact' | 'none';
|
|
21
23
|
}
|
|
22
24
|
declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
25
|
export { Popover, PopoverTrigger, PopoverAnchor, PopoverContent };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: Rating component for tokenized star scoring and preference feedback.
|
|
3
|
+
* [FROM]: React, class-variance-authority, registry/lib/utils.
|
|
4
|
+
* [TO]: sparkdesign package consumers; Showcase; CLI registry copies.
|
|
5
|
+
* [HERE]: registry/basic/rating.tsx — interactive or read-only rating primitive.
|
|
6
|
+
*
|
|
7
|
+
* [PROTOCOL]:
|
|
8
|
+
* 1. Keep this P3 header in sync when the public contract changes.
|
|
9
|
+
* 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
|
|
10
|
+
* 3. Follow design tokens and explicit type exports.
|
|
11
|
+
*/
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
14
|
+
declare const ratingVariants: (props?: ({
|
|
15
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
16
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
17
|
+
type RatingPrecision = 1 | 0.5;
|
|
18
|
+
export interface RatingProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>, VariantProps<typeof ratingVariants> {
|
|
19
|
+
value?: number;
|
|
20
|
+
defaultValue?: number;
|
|
21
|
+
onValueChange?: (value: number) => void;
|
|
22
|
+
max?: number;
|
|
23
|
+
precision?: RatingPrecision;
|
|
24
|
+
readOnly?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
showValue?: boolean;
|
|
27
|
+
label?: string;
|
|
28
|
+
}
|
|
29
|
+
declare const Rating: React.ForwardRefExoticComponent<RatingProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
export { Rating, ratingVariants };
|
|
31
|
+
export type { RatingPrecision };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [WHO]: Stepper primitives for linear setup, checkout, and workflow progress.
|
|
3
|
+
* [FROM]: React, class-variance-authority, registry/lib/utils.
|
|
4
|
+
* [TO]: sparkdesign package consumers; Showcase; CLI registry copies.
|
|
5
|
+
* [HERE]: registry/basic/stepper.tsx — tokenized horizontal/vertical stepper.
|
|
6
|
+
*
|
|
7
|
+
* [PROTOCOL]:
|
|
8
|
+
* 1. Keep this P3 header in sync when the public contract changes.
|
|
9
|
+
* 2. Update module AGENTS.md (P2) and root AGENTS.md (P1) when boundaries change.
|
|
10
|
+
* 3. Follow design tokens and explicit type exports.
|
|
11
|
+
*/
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
14
|
+
type StepStatus = 'complete' | 'current' | 'upcoming' | 'error';
|
|
15
|
+
declare const stepperVariants: (props?: ({
|
|
16
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
|
+
export interface StepperProps extends React.OlHTMLAttributes<HTMLOListElement>, VariantProps<typeof stepperVariants> {
|
|
19
|
+
}
|
|
20
|
+
export interface StepperItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
21
|
+
status?: StepStatus;
|
|
22
|
+
}
|
|
23
|
+
export type StepperIndicatorProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
24
|
+
export type StepperContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
25
|
+
export type StepperTitleProps = React.HTMLAttributes<HTMLDivElement>;
|
|
26
|
+
export type StepperDescriptionProps = React.HTMLAttributes<HTMLDivElement>;
|
|
27
|
+
export type StepperSeparatorProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
28
|
+
declare function Stepper({ className, orientation, ...props }: StepperProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function StepperItem({ className, status, ...props }: StepperItemProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare function StepperIndicator({ className, children, ...props }: StepperIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare function StepperContent({ className, ...props }: StepperContentProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare function StepperTitle({ className, ...props }: StepperTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
declare function StepperDescription({ className, ...props }: StepperDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare function StepperSeparator({ className, ...props }: StepperSeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export { Stepper, StepperItem, StepperIndicator, StepperContent, StepperTitle, StepperDescription, StepperSeparator, };
|
|
36
|
+
export type { StepStatus };
|