Skip to content

Commit 41a64bb

Browse files
improve particles
1 parent 13d4598 commit 41a64bb

File tree

9 files changed

+75
-75
lines changed

9 files changed

+75
-75
lines changed

apps/ui/content/docs/components/calendar.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ You can customize the cell size by passing a custom `className`:
9393
Or use responsive values:
9494

9595
```tsx
96-
<Calendar className="[--cell-size:--spacing(11)] sm:[--cell-size:--spacing(10)] lg:[--cell-size:--spacing(9)]" />
96+
<Calendar className="[--cell-size:--spacing(11)] sm:[--cell-size:--spacing(10)]" />
9797
```
9898

9999
## Examples

apps/ui/public/r/p-calendar-1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"files": [
1010
{
1111
"path": "registry/default/particles/p-calendar-1.tsx",
12-
"content": "\"use client\";\nimport * as React from \"react\";\n\nimport { Calendar } from \"@/registry/default/ui/calendar\";\n\nexport default function Particle() {\n const [date, setDate] = React.useState<Date | undefined>(new Date());\n return (\n <Calendar\n className=\"[--cell-size:--spacing(9)]\"\n mode=\"single\"\n onSelect={setDate}\n selected={date}\n />\n );\n}\n",
12+
"content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { Calendar } from \"@/registry/default/ui/calendar\";\n\nexport default function Particle() {\n const [date, setDate] = React.useState<Date | undefined>(new Date());\n\n return <Calendar mode=\"single\" onSelect={setDate} selected={date} />;\n}\n",
1313
"type": "registry:block"
1414
}
1515
],

apps/ui/public/r/p-calendar-2.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
33
"name": "p-calendar-2",
44
"type": "registry:block",
5-
"description": "Calendar with range date selection",
5+
"description": "Calendar with custom cell size",
66
"registryDependencies": [
77
"@coss/calendar"
88
],
99
"files": [
1010
{
1111
"path": "registry/default/particles/p-calendar-2.tsx",
12-
"content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { Calendar } from \"@/registry/default/ui/calendar\";\n\nexport default function Particle() {\n const [date, setDate] = React.useState<Date | undefined>(new Date());\n\n return <Calendar mode=\"single\" onSelect={setDate} selected={date} />;\n}\n",
12+
"content": "\"use client\";\nimport * as React from \"react\";\n\nimport { Calendar } from \"@/registry/default/ui/calendar\";\n\nexport default function Particle() {\n const [date, setDate] = React.useState<Date | undefined>(new Date());\n return (\n <Calendar\n className=\"[--cell-size:--spacing(11)] sm:[--cell-size:--spacing(10)]\"\n mode=\"single\"\n onSelect={setDate}\n selected={date}\n />\n );\n}\n",
1313
"type": "registry:block"
1414
}
1515
],

apps/ui/public/r/registry.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,23 +2929,6 @@
29292929
],
29302930
"type": "registry:block"
29312931
},
2932-
{
2933-
"categories": [
2934-
"calendar"
2935-
],
2936-
"description": "Calendar with range date selection",
2937-
"files": [
2938-
{
2939-
"path": "registry/default/particles/p-calendar-2.tsx",
2940-
"type": "registry:block"
2941-
}
2942-
],
2943-
"name": "p-calendar-2",
2944-
"registryDependencies": [
2945-
"@coss/calendar"
2946-
],
2947-
"type": "registry:block"
2948-
},
29492932
{
29502933
"categories": [
29512934
"calendar"
@@ -3061,6 +3044,23 @@
30613044
],
30623045
"type": "registry:block"
30633046
},
3047+
{
3048+
"categories": [
3049+
"calendar"
3050+
],
3051+
"description": "Calendar with custom cell size",
3052+
"files": [
3053+
{
3054+
"path": "registry/default/particles/p-calendar-2.tsx",
3055+
"type": "registry:block"
3056+
}
3057+
],
3058+
"name": "p-calendar-2",
3059+
"registryDependencies": [
3060+
"@coss/calendar"
3061+
],
3062+
"type": "registry:block"
3063+
},
30643064
{
30653065
"categories": [
30663066
"calendar"

apps/ui/registry.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,23 +2929,6 @@
29292929
],
29302930
"type": "registry:block"
29312931
},
2932-
{
2933-
"categories": [
2934-
"calendar"
2935-
],
2936-
"description": "Calendar with range date selection",
2937-
"files": [
2938-
{
2939-
"path": "registry/default/particles/p-calendar-2.tsx",
2940-
"type": "registry:block"
2941-
}
2942-
],
2943-
"name": "p-calendar-2",
2944-
"registryDependencies": [
2945-
"@coss/calendar"
2946-
],
2947-
"type": "registry:block"
2948-
},
29492932
{
29502933
"categories": [
29512934
"calendar"
@@ -3061,6 +3044,23 @@
30613044
],
30623045
"type": "registry:block"
30633046
},
3047+
{
3048+
"categories": [
3049+
"calendar"
3050+
],
3051+
"description": "Calendar with custom cell size",
3052+
"files": [
3053+
{
3054+
"path": "registry/default/particles/p-calendar-2.tsx",
3055+
"type": "registry:block"
3056+
}
3057+
],
3058+
"name": "p-calendar-2",
3059+
"registryDependencies": [
3060+
"@coss/calendar"
3061+
],
3062+
"type": "registry:block"
3063+
},
30643064
{
30653065
"categories": [
30663066
"calendar"

apps/ui/registry/__index__.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2887,24 +2887,6 @@ export const Index: Record<string, any> = {
28872887
categories: ["calendar"],
28882888
meta: undefined,
28892889
},
2890-
"p-calendar-2": {
2891-
name: "p-calendar-2",
2892-
description: "Calendar with range date selection",
2893-
type: "registry:block",
2894-
registryDependencies: ["@coss/calendar"],
2895-
files: [{
2896-
path: "registry/default/particles/p-calendar-2.tsx",
2897-
type: "registry:block",
2898-
target: ""
2899-
}],
2900-
component: React.lazy(async () => {
2901-
const mod = await import("@/registry/default/particles/p-calendar-2.tsx")
2902-
const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
2903-
return { default: mod.default || mod[exportName] }
2904-
}),
2905-
categories: ["calendar"],
2906-
meta: undefined,
2907-
},
29082890
"p-calendar-3": {
29092891
name: "p-calendar-3",
29102892
description: "Calendar with date range selection",
@@ -3013,6 +2995,24 @@ export const Index: Record<string, any> = {
30132995
categories: ["calendar"],
30142996
meta: undefined,
30152997
},
2998+
"p-calendar-2": {
2999+
name: "p-calendar-2",
3000+
description: "Calendar with custom cell size",
3001+
type: "registry:block",
3002+
registryDependencies: ["@coss/calendar"],
3003+
files: [{
3004+
path: "registry/default/particles/p-calendar-2.tsx",
3005+
type: "registry:block",
3006+
target: ""
3007+
}],
3008+
component: React.lazy(async () => {
3009+
const mod = await import("@/registry/default/particles/p-calendar-2.tsx")
3010+
const exportName = Object.keys(mod).find(key => typeof mod[key] === 'function' || typeof mod[key] === 'object') || item.name
3011+
return { default: mod.default || mod[exportName] }
3012+
}),
3013+
categories: ["calendar"],
3014+
meta: undefined,
3015+
},
30163016
"p-calendar-9": {
30173017
name: "p-calendar-9",
30183018
description: "Calendar with rounded day buttons",
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
"use client";
2+
23
import * as React from "react";
34

45
import { Calendar } from "@/registry/default/ui/calendar";
56

67
export default function Particle() {
78
const [date, setDate] = React.useState<Date | undefined>(new Date());
8-
return (
9-
<Calendar
10-
className="[--cell-size:--spacing(9)]"
11-
mode="single"
12-
onSelect={setDate}
13-
selected={date}
14-
/>
15-
);
9+
10+
return <Calendar mode="single" onSelect={setDate} selected={date} />;
1611
}
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
"use client";
2-
32
import * as React from "react";
43

54
import { Calendar } from "@/registry/default/ui/calendar";
65

76
export default function Particle() {
87
const [date, setDate] = React.useState<Date | undefined>(new Date());
9-
10-
return <Calendar mode="single" onSelect={setDate} selected={date} />;
8+
return (
9+
<Calendar
10+
className="[--cell-size:--spacing(11)] sm:[--cell-size:--spacing(10)]"
11+
mode="single"
12+
onSelect={setDate}
13+
selected={date}
14+
/>
15+
);
1116
}

apps/ui/registry/registry-particles.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,14 +1058,6 @@ export const particles: ParticleItem[] = [
10581058
registryDependencies: ["@coss/calendar"],
10591059
type: "registry:block",
10601060
},
1061-
{
1062-
categories: categories("calendar"),
1063-
description: "Calendar with range date selection",
1064-
files: [{ path: "particles/p-calendar-2.tsx", type: "registry:block" }],
1065-
name: "p-calendar-2",
1066-
registryDependencies: ["@coss/calendar"],
1067-
type: "registry:block",
1068-
},
10691061
{
10701062
categories: categories("calendar"),
10711063
description: "Calendar with date range selection",
@@ -1117,6 +1109,14 @@ export const particles: ParticleItem[] = [
11171109
registryDependencies: ["@coss/calendar"],
11181110
type: "registry:block",
11191111
},
1112+
{
1113+
categories: categories("calendar"),
1114+
description: "Calendar with custom cell size",
1115+
files: [{ path: "particles/p-calendar-2.tsx", type: "registry:block" }],
1116+
name: "p-calendar-2",
1117+
registryDependencies: ["@coss/calendar"],
1118+
type: "registry:block",
1119+
},
11201120
{
11211121
categories: categories("calendar"),
11221122
description: "Calendar with rounded day buttons",

0 commit comments

Comments
 (0)