Skip to content

Commit d97a6bb

Browse files
authored
feat(registry): add stat (#197)
* chore: cleanup * feat: add stat * chore: update key-value registry * feat: add stat action thingy * feat: update stat * feat: add stat * chore: update tsdocs * feat(stat): rename primitives and complete component setup - Rename StatChange -> StatTrend for better clarity - Rename StatAccessory -> StatIndicator for semantic accuracy - Update all data-slot attributes to match new names - Add StatSeparator component for content division - Create comprehensive type definitions - Add stat to registry-ui and registry-examples - Create documentation with API reference - Add stat-variants-demo showcasing indicator variants - Add stat-layout-demo showcasing layout options * feat: add time-picker, key-value, and stat to registry.json * feat: add time-picker and key-value demos to registry.json * chore: update registry.json * chore: cleanup docs
1 parent 0052464 commit d97a6bb

32 files changed

+859
-116
lines changed

docs/__registry__/index.tsx

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export const Index: Record<string, any> = {
277277
name: "key-value",
278278
description: "",
279279
type: "registry:ui",
280-
registryDependencies: ["button","input"],
280+
registryDependencies: ["button","input","textarea"],
281281
files: [{
282282
path: "registry/default/ui/key-value.tsx",
283283
type: "registry:ui",
@@ -477,6 +477,20 @@ export const Index: Record<string, any> = {
477477
source: "",
478478
chunks: []
479479
},
480+
"stat": {
481+
name: "stat",
482+
description: "",
483+
type: "registry:ui",
484+
registryDependencies: ["separator"],
485+
files: [{
486+
path: "registry/default/ui/stat.tsx",
487+
type: "registry:ui",
488+
target: ""
489+
}],
490+
component: React.lazy(() => import("@/registry/default/ui/stat.tsx")),
491+
source: "",
492+
chunks: []
493+
},
480494
"stepper": {
481495
name: "stepper",
482496
description: "",
@@ -2409,6 +2423,48 @@ export const Index: Record<string, any> = {
24092423
source: "",
24102424
chunks: []
24112425
},
2426+
"stat-demo": {
2427+
name: "stat-demo",
2428+
description: "",
2429+
type: "registry:example",
2430+
registryDependencies: ["stat","dropdown-menu"],
2431+
files: [{
2432+
path: "registry/default/examples/stat-demo.tsx",
2433+
type: "registry:example",
2434+
target: ""
2435+
}],
2436+
component: React.lazy(() => import("@/registry/default/examples/stat-demo.tsx")),
2437+
source: "",
2438+
chunks: []
2439+
},
2440+
"stat-variants-demo": {
2441+
name: "stat-variants-demo",
2442+
description: "",
2443+
type: "registry:example",
2444+
registryDependencies: ["stat"],
2445+
files: [{
2446+
path: "registry/default/examples/stat-variants-demo.tsx",
2447+
type: "registry:example",
2448+
target: ""
2449+
}],
2450+
component: React.lazy(() => import("@/registry/default/examples/stat-variants-demo.tsx")),
2451+
source: "",
2452+
chunks: []
2453+
},
2454+
"stat-layout-demo": {
2455+
name: "stat-layout-demo",
2456+
description: "",
2457+
type: "registry:example",
2458+
registryDependencies: ["stat"],
2459+
files: [{
2460+
path: "registry/default/examples/stat-layout-demo.tsx",
2461+
type: "registry:example",
2462+
target: ""
2463+
}],
2464+
component: React.lazy(() => import("@/registry/default/examples/stat-layout-demo.tsx")),
2465+
source: "",
2466+
chunks: []
2467+
},
24122468
"stepper-demo": {
24132469
name: "stepper-demo",
24142470
description: "",

docs/app/(lobby)/pg/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
import { Demo } from "@/components/demo";
44
import { Shell } from "@/components/shell";
55
import ColorPickerDemo from "@/registry/default/examples/color-picker-demo";
6-
import KeyValueDemo from "@/registry/default/examples/key-value-demo";
6+
import StatDemo from "@/registry/default/examples/stat-demo";
7+
import StatLayoutDemo from "@/registry/default/examples/stat-layout-demo";
8+
import StatVariantsDemo from "@/registry/default/examples/stat-variants-demo";
79

810
export default function PlaygroundPage() {
911
return (
1012
<Shell>
1113
<Demo>
12-
<KeyValueDemo />
14+
<StatDemo />
15+
<StatVariantsDemo />
16+
<StatLayoutDemo />
1317
<ColorPickerDemo />
1418
</Demo>
1519
</Shell>

docs/components/auto-type-table.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createGenerator } from "fumadocs-typescript";
2-
import { AutoTypeTable as FumadocsAutoTypeTable } from "fumadocs-typescript/ui";
2+
import { AutoTypeTable as AutoTypeTableImpl } from "fumadocs-typescript/ui";
33

44
let cachedGenerator: ReturnType<typeof createGenerator> | null = null;
55

@@ -13,7 +13,7 @@ function getGenerator() {
1313
export function AutoTypeTable(props: Record<string, unknown>) {
1414
return (
1515
<div className="auto-type-table">
16-
<FumadocsAutoTypeTable {...props} generator={getGenerator()} />
16+
<AutoTypeTableImpl {...props} generator={getGenerator()} />
1717
</div>
1818
);
1919
}

docs/components/ui/button.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ const buttonVariants = cva(
99
{
1010
variants: {
1111
variant: {
12-
default:
13-
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
12+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
1413
destructive:
15-
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
14+
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
1615
outline:
1716
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
1817
secondary:
19-
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
18+
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
2019
ghost:
2120
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
2221
link: "text-primary underline-offset-4 hover:underline",
@@ -26,6 +25,8 @@ const buttonVariants = cva(
2625
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
2726
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
2827
icon: "size-9",
28+
"icon-sm": "size-8",
29+
"icon-lg": "size-10",
2930
},
3031
},
3132
defaultVariants: {

docs/content/docs/components/avatar-group.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ npx shadcn@latest add "https://diceui.com/r/avatar-group"
2424
Install the following dependencies:
2525

2626
```package-install
27-
@radix-ui/react-slot class-variance-authority
27+
@radix-ui/react-slot
2828
```
2929
</Step>
3030
<Step>

docs/content/docs/components/color-picker.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ npx shadcn@latest add "https://diceui.com/r/color-picker"
2424
Install the following dependencies:
2525

2626
```package-install
27-
@radix-ui/react-popover @radix-ui/react-select @radix-ui/react-slider @radix-ui/react-slot class-variance-authority lucide-react
27+
@radix-ui/react-popover @radix-ui/react-select @radix-ui/react-slider @radix-ui/react-slot lucide-react
2828
```
2929
</Step>
3030
<Step>

docs/content/docs/components/color-swatch.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ npx shadcn@latest add "https://diceui.com/r/color-swatch"
2424
Install the following dependencies:
2525

2626
```package-install
27-
@radix-ui/react-slot class-variance-authority
27+
@radix-ui/react-slot
2828
```
2929
</Step>
3030
<Step>

docs/content/docs/components/cropper.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ npx shadcn@latest add "https://diceui.com/r/cropper"
2424
Install the following dependencies:
2525

2626
```package-install
27-
@radix-ui/react-slot class-variance-authority
27+
@radix-ui/react-slot
2828
```
2929
</Step>
3030
<Step>

docs/content/docs/components/key-value.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Key-Value
3-
description: A dynamic key-value input component for managing environment variables and configuration pairs with paste support and validation.
2+
title: Key Value
3+
description: A dynamic input component for managing key-value pairs with paste support and validation.
44
preview: true
55
links:
66
api: /docs/components/key-value#api-reference

docs/content/docs/components/marquee.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ npx shadcn@latest add "https://diceui.com/r/marquee"
2323
Install the following dependencies:
2424

2525
```package-install
26-
@radix-ui/react-slot class-variance-authority
26+
@radix-ui/react-slot
2727
```
2828
</Step>
2929
<Step>

0 commit comments

Comments
 (0)