Skip to content

Commit 5011a2f

Browse files
committed
docs: clarify implementation of slot demo components
1 parent 7c0a975 commit 5011a2f

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

apps/demo/config/blocks/Flex/index.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { ComponentConfig, Content } from "@/core/types";
2+
import { ComponentConfig, Slot } from "@/core/types";
33
import styles from "./styles.module.css";
44
import { getClassNameFactory } from "@/core/lib";
55
import { Section } from "../../components/Section";
@@ -12,7 +12,7 @@ export type FlexProps = WithLayout<{
1212
direction: "row" | "column";
1313
gap: number;
1414
wrap: "wrap" | "nowrap";
15-
children: Content;
15+
items: Slot;
1616
}>;
1717

1818
const FlexInternal: ComponentConfig<FlexProps> = {
@@ -47,7 +47,7 @@ const FlexInternal: ComponentConfig<FlexProps> = {
4747
{ label: "false", value: "nowrap" },
4848
],
4949
},
50-
children: {
50+
items: {
5151
type: "slot",
5252
},
5353
},
@@ -59,12 +59,12 @@ const FlexInternal: ComponentConfig<FlexProps> = {
5959
layout: {
6060
grow: true,
6161
},
62-
children: [],
62+
items: [],
6363
},
64-
render: ({ justifyContent, direction, gap, wrap, children: Children }) => {
64+
render: ({ justifyContent, direction, gap, wrap, items: Items }) => {
6565
return (
6666
<Section style={{ height: "100%" }}>
67-
<Children
67+
<Items
6868
className={getClassName()}
6969
style={{
7070
justifyContent,

apps/demo/config/blocks/Grid/index.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { ComponentConfig, Content } from "@/core/types";
2+
import { ComponentConfig, Slot } from "@/core/types";
33
import styles from "./styles.module.css";
44
import { getClassNameFactory } from "@/core/lib";
55
import { Section } from "../../components/Section";
@@ -10,7 +10,7 @@ const getClassName = getClassNameFactory("Grid", styles);
1010
export type GridProps = {
1111
numColumns: number;
1212
gap: number;
13-
children: Content;
13+
items: Slot;
1414
};
1515

1616
export const GridInternal: ComponentConfig<GridProps> = {
@@ -26,19 +26,19 @@ export const GridInternal: ComponentConfig<GridProps> = {
2626
type: "number",
2727
min: 0,
2828
},
29-
children: {
29+
items: {
3030
type: "slot",
3131
},
3232
},
3333
defaultProps: {
3434
numColumns: 4,
3535
gap: 24,
36-
children: [],
36+
items: [],
3737
},
38-
render: ({ gap, numColumns, children: Children }) => {
38+
render: ({ gap, numColumns, items: Items }) => {
3939
return (
4040
<Section>
41-
<Children
41+
<Items
4242
disallow={["Hero", "Stats"]}
4343
className={getClassName()}
4444
style={{

apps/demo/config/blocks/Template/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ export const TemplateInternal: ComponentConfig<TemplateProps> = {
141141
data: [
142142
await createComponent("Grid", {
143143
numColumns: 2,
144-
children: [
144+
items: [
145145
await createComponent("Card", { title: "A card", mode: "card" }),
146146
await createComponent("Flex", {
147147
direction: "column",
148148
gap: 0,
149-
children: [
149+
items: [
150150
await createComponent("Space", {
151151
size: "32px",
152152
}),

apps/demo/config/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export const initialData: Record<string, UserData> = {
149149
id: "Grid-c4cd99ae-8c5e-4cdb-87d2-35a639f5163e",
150150
gap: 24,
151151
numColumns: 3,
152-
children: [
152+
items: [
153153
{
154154
type: "Card",
155155
props: {
@@ -309,7 +309,7 @@ export const initialData: Record<string, UserData> = {
309309
gap: 24,
310310
numColumns: 3,
311311
id: "Grid-2da28e88-7b7b-4152-9da0-9f93f41213b6",
312-
children: [
312+
items: [
313313
{
314314
type: "Card",
315315
props: {
@@ -437,7 +437,7 @@ export const initialData: Record<string, UserData> = {
437437
wrap: "wrap",
438438
layout: { spanCol: 1, spanRow: 1, padding: "0px" },
439439
id: "Flex-7d63d5ff-bd42-4354-b05d-681b16436fd6",
440-
children: [
440+
items: [
441441
{
442442
type: "Button",
443443
props: {

0 commit comments

Comments
 (0)