` element.
-
+
## Examples
diff --git a/canon-docs/src/app/(docs)/components/field/props.ts b/canon-docs/src/app/(docs)/components/field/props.ts
new file mode 100644
index 0000000000..aaadafee50
--- /dev/null
+++ b/canon-docs/src/app/(docs)/components/field/props.ts
@@ -0,0 +1,69 @@
+import { classNamePropDefs, stylePropDefs } from '../../../../utils/propDefs';
+import type { PropDef } from '../../../../utils/propDefs';
+
+export const fieldRootPropDefs: Record
= {
+ name: {
+ type: 'string',
+ responsive: false,
+ },
+ disabled: {
+ type: 'boolean',
+ responsive: false,
+ },
+ invalid: {
+ type: 'boolean',
+ responsive: false,
+ },
+ validate: {
+ type: 'enum',
+ values: ['(value) => string | string[] | null | Promise'],
+ responsive: false,
+ },
+ validationMode: {
+ type: 'enum',
+ values: ['onBlur', 'onChange'],
+ responsive: false,
+ },
+ validationDebounceTime: {
+ type: 'number',
+ responsive: false,
+ },
+ ...classNamePropDefs,
+ ...stylePropDefs,
+};
+
+export const fieldLabelPropDefs: Record = {
+ ...classNamePropDefs,
+ ...stylePropDefs,
+};
+
+export const fieldDescriptionPropDefs: Record = {
+ ...classNamePropDefs,
+ ...stylePropDefs,
+};
+
+export const fieldErrorPropDefs: Record = {
+ match: {
+ type: 'enum',
+ values: [
+ 'badInput',
+ 'customError',
+ 'patternMismatch',
+ 'rangeOverflow',
+ 'rangeUnderflow',
+ 'stepMismatch',
+ 'tooLong',
+ 'tooShort',
+ 'typeMismatch',
+ 'valid',
+ 'valueMissing',
+ ],
+ responsive: false,
+ },
+ forceShow: {
+ type: 'boolean',
+ responsive: false,
+ },
+ ...classNamePropDefs,
+ ...stylePropDefs,
+};
diff --git a/canon-docs/src/app/(docs)/components/flex/page.mdx b/canon-docs/src/app/(docs)/components/flex/page.mdx
index 9f2b0bb6ee..0e1a6a1fb8 100644
--- a/canon-docs/src/app/(docs)/components/flex/page.mdx
+++ b/canon-docs/src/app/(docs)/components/flex/page.mdx
@@ -1,5 +1,4 @@
import { PropsTable } from '@/components/PropsTable';
-import { spacePropsList } from '@/utils/spaceProps';
import { Tabs } from '@/components/Tabs';
import { CodeBlock } from '@/components/CodeBlock';
import {
@@ -10,6 +9,8 @@ import {
} from '@/snippets/_snippets';
import { Snippet } from '@/components/Snippet';
import { FlexPreview } from '@/snippets/flex';
+import { flexPropDefs } from './props';
+import { spacingPropDefs } from '../../../../utils/propDefs';
# Flex
@@ -44,30 +45,11 @@ columns. All values are responsive.
## API reference
-
+
The grid component also accepts all the spacing props from the Box component.
-
+
## Common questions
diff --git a/canon-docs/src/app/(docs)/components/flex/props.ts b/canon-docs/src/app/(docs)/components/flex/props.ts
new file mode 100644
index 0000000000..2268a6909d
--- /dev/null
+++ b/canon-docs/src/app/(docs)/components/flex/props.ts
@@ -0,0 +1,27 @@
+import {
+ PropDef,
+ childrenPropDefs,
+ classNamePropDefs,
+ stylePropDefs,
+} from '../../../../utils/propDefs';
+
+export const flexPropDefs: Record = {
+ align: {
+ type: 'enum',
+ values: ['start', 'center', 'end', 'baseline', 'stretch'],
+ responsive: true,
+ },
+ direction: {
+ type: 'enum',
+ values: ['row', 'column', 'row-reverse', 'column-reverse'],
+ responsive: true,
+ },
+ justify: {
+ type: 'enum',
+ values: ['start', 'center', 'end', 'between'],
+ responsive: true,
+ },
+ ...childrenPropDefs,
+ ...classNamePropDefs,
+ ...stylePropDefs,
+};
diff --git a/canon-docs/src/app/(docs)/components/grid/page.mdx b/canon-docs/src/app/(docs)/components/grid/page.mdx
index 4e38fe39ec..c57493b114 100644
--- a/canon-docs/src/app/(docs)/components/grid/page.mdx
+++ b/canon-docs/src/app/(docs)/components/grid/page.mdx
@@ -1,10 +1,11 @@
import { CodeBlock } from '@/components/CodeBlock';
import { PropsTable } from '@/components/PropsTable';
-import { spacePropsList } from '@/utils/spaceProps';
import { Tabs } from '@/components/Tabs';
import { grid } from '@/snippets/_snippets';
import { Snippet } from '@/components/Snippet';
import { GridPreview } from '@/snippets/grid';
+import { spacingPropDefs } from '../../../../utils/propDefs';
+import { gridPropDefs, gridItemPropDefs } from './props';
# Grid
@@ -38,34 +39,11 @@ This is the grid container component. It will help to define the number of
columns that will be used in the grid. You can also define the gap between the
columns. All values are responsive.
-
+
The grid component also accepts all the spacing props from the Box component.
-
+
### Grid.Item
@@ -74,38 +52,7 @@ component. This will give you access to `rowSpan`, `colSpan`, `start` and
`end`. All values are responsive. This component is optional, you can use any
elements directly if you prefer.
-
+
## Examples
diff --git a/canon-docs/src/app/(docs)/components/grid/props.ts b/canon-docs/src/app/(docs)/components/grid/props.ts
new file mode 100644
index 0000000000..a9e8717fa1
--- /dev/null
+++ b/canon-docs/src/app/(docs)/components/grid/props.ts
@@ -0,0 +1,59 @@
+import {
+ PropDef,
+ childrenPropDefs,
+ classNamePropDefs,
+ stylePropDefs,
+} from '../../../../utils/propDefs';
+
+const columnsValues = [
+ '1',
+ '2',
+ '3',
+ '4',
+ '5',
+ '6',
+ '7',
+ '8',
+ '9',
+ '10',
+ '11',
+ '12',
+];
+
+export const gridPropDefs: Record = {
+ columns: {
+ type: 'enum | string',
+ values: [...columnsValues, 'auto'],
+ responsive: true,
+ default: 'auto',
+ },
+ ...childrenPropDefs,
+ ...classNamePropDefs,
+ ...stylePropDefs,
+};
+
+export const gridItemPropDefs: Record = {
+ colSpan: {
+ type: 'enum | string',
+ values: [...columnsValues, 'full'],
+ responsive: true,
+ },
+ rowSpan: {
+ type: 'enum | string',
+ values: [...columnsValues, 'full'],
+ responsive: true,
+ },
+ start: {
+ type: 'enum | string',
+ values: [...columnsValues, 'auto'],
+ responsive: true,
+ },
+ end: {
+ type: 'enum | string',
+ values: [...columnsValues, 'auto'],
+ responsive: true,
+ },
+ ...childrenPropDefs,
+ ...classNamePropDefs,
+ ...stylePropDefs,
+};
diff --git a/canon-docs/src/app/(docs)/components/heading/page.mdx b/canon-docs/src/app/(docs)/components/heading/page.mdx
index f2fbe0e929..ad8131cdbd 100644
--- a/canon-docs/src/app/(docs)/components/heading/page.mdx
+++ b/canon-docs/src/app/(docs)/components/heading/page.mdx
@@ -7,6 +7,7 @@ import {
import { Snippet } from '@/components/Snippet';
import { Tabs } from '@/components/Tabs';
import { CodeBlock } from '@/components/CodeBlock';
+import { headingPropDefs } from './props';
# Heading
@@ -43,26 +44,7 @@ Headings are used to structure the content of your page.
## API reference
-
+
## Examples
diff --git a/canon-docs/src/app/(docs)/components/heading/props.ts b/canon-docs/src/app/(docs)/components/heading/props.ts
new file mode 100644
index 0000000000..a3dd3288ff
--- /dev/null
+++ b/canon-docs/src/app/(docs)/components/heading/props.ts
@@ -0,0 +1,17 @@
+import { classNamePropDefs, stylePropDefs } from '../../../../utils/propDefs';
+import type { PropDef } from '../../../../utils/propDefs';
+
+export const headingPropDefs: Record = {
+ variant: {
+ type: 'enum',
+ values: ['display', 'title1', 'title2', 'title3', 'title4', 'title5'],
+ responsive: true,
+ },
+ children: {
+ type: 'enum',
+ values: ['ReactNode'],
+ responsive: false,
+ },
+ ...classNamePropDefs,
+ ...stylePropDefs,
+};
diff --git a/canon-docs/src/app/(docs)/components/icon-button/page.mdx b/canon-docs/src/app/(docs)/components/icon-button/page.mdx
index 591ee321eb..28b6eefbf2 100644
--- a/canon-docs/src/app/(docs)/components/icon-button/page.mdx
+++ b/canon-docs/src/app/(docs)/components/icon-button/page.mdx
@@ -9,7 +9,7 @@ import {
IconButtonResponsive,
} from '@/snippets/icon-button';
import { iconButtonVariants } from '@/snippets/_snippets';
-import { iconButtonPropDefs } from '../../../../../../packages/canon/src/components/IconButton/IconButton.props';
+import { iconButtonPropDefs } from './props';
# Icon Button
@@ -50,12 +50,7 @@ A button component with a single icon that can be used to trigger actions.
## API reference
-
+
## Examples
diff --git a/canon-docs/src/app/(docs)/components/icon-button/props.ts b/canon-docs/src/app/(docs)/components/icon-button/props.ts
new file mode 100644
index 0000000000..bcb1580247
--- /dev/null
+++ b/canon-docs/src/app/(docs)/components/icon-button/props.ts
@@ -0,0 +1,20 @@
+import { classNamePropDefs, stylePropDefs } from '../../../../utils/propDefs';
+import type { PropDef } from '../../../../utils/propDefs';
+
+export const iconButtonPropDefs: Record = {
+ variant: {
+ type: 'enum',
+ values: ['primary', 'secondary'],
+ default: 'primary',
+ responsive: true,
+ },
+ size: {
+ type: 'enum',
+ values: ['small', 'medium'],
+ default: 'medium',
+ responsive: true,
+ },
+ icon: { type: 'enum', values: 'icon', responsive: false },
+ ...classNamePropDefs,
+ ...stylePropDefs,
+};
diff --git a/canon-docs/src/app/(docs)/components/icon/page.mdx b/canon-docs/src/app/(docs)/components/icon/page.mdx
index cb7c0df626..3d8d065374 100644
--- a/canon-docs/src/app/(docs)/components/icon/page.mdx
+++ b/canon-docs/src/app/(docs)/components/icon/page.mdx
@@ -3,6 +3,7 @@ import { IconPreview } from '@/snippets/icon';
import { Snippet } from '@/components/Snippet';
import { Tabs } from '@/components/Tabs';
import { CodeBlock } from '@/components/CodeBlock';
+import { iconPropDefs } from './props';
# Icon
@@ -40,23 +41,4 @@ Icons are used to represent an action or a state.
## API reference
-
+
diff --git a/canon-docs/src/app/(docs)/components/icon/props.ts b/canon-docs/src/app/(docs)/components/icon/props.ts
new file mode 100644
index 0000000000..2ddbafd94e
--- /dev/null
+++ b/canon-docs/src/app/(docs)/components/icon/props.ts
@@ -0,0 +1,16 @@
+import { classNamePropDefs, stylePropDefs } from '../../../../utils/propDefs';
+import type { PropDef } from '../../../../utils/propDefs';
+
+export const iconPropDefs: Record = {
+ name: {
+ type: 'enum',
+ values: 'icon',
+ responsive: false,
+ },
+ size: {
+ type: 'number',
+ responsive: false,
+ },
+ ...classNamePropDefs,
+ ...stylePropDefs,
+};
diff --git a/canon-docs/src/app/(docs)/components/input/page.mdx b/canon-docs/src/app/(docs)/components/input/page.mdx
index 802003501e..228ef68061 100644
--- a/canon-docs/src/app/(docs)/components/input/page.mdx
+++ b/canon-docs/src/app/(docs)/components/input/page.mdx
@@ -4,6 +4,7 @@ import { Tabs } from '@/components/Tabs';
import { CodeBlock } from '@/components/CodeBlock';
import { InputPreview, InputSizes } from '@/snippets/input';
import { BaseUI } from '@/components/HeadlessBanners/BaseUI';
+import { inputPropDefs } from './props';
# Input
@@ -42,22 +43,7 @@ A input component tfor your forms.
-
+
## Examples
diff --git a/canon-docs/src/app/(docs)/components/input/props.ts b/canon-docs/src/app/(docs)/components/input/props.ts
new file mode 100644
index 0000000000..412ae23dd6
--- /dev/null
+++ b/canon-docs/src/app/(docs)/components/input/props.ts
@@ -0,0 +1,13 @@
+import { classNamePropDefs, stylePropDefs } from '../../../../utils/propDefs';
+import type { PropDef } from '../../../../utils/propDefs';
+
+export const inputPropDefs: Record = {
+ size: {
+ type: 'enum',
+ values: ['sm', 'md'],
+ default: 'md',
+ responsive: false,
+ },
+ ...classNamePropDefs,
+ ...stylePropDefs,
+};
diff --git a/canon-docs/src/app/(docs)/components/text/page.mdx b/canon-docs/src/app/(docs)/components/text/page.mdx
index 450de0f79d..9b904f84c4 100644
--- a/canon-docs/src/app/(docs)/components/text/page.mdx
+++ b/canon-docs/src/app/(docs)/components/text/page.mdx
@@ -8,6 +8,7 @@ import {
import { Snippet } from '@/components/Snippet';
import { Tabs } from '@/components/Tabs';
import { CodeBlock } from '@/components/CodeBlock';
+import { textPropDefs } from './props';
# Text
@@ -48,30 +49,7 @@ The `Text` component is used to display content on your page.
## API reference
-
+
## Examples
diff --git a/canon-docs/src/app/(docs)/components/text/props.ts b/canon-docs/src/app/(docs)/components/text/props.ts
new file mode 100644
index 0000000000..53413dc9e7
--- /dev/null
+++ b/canon-docs/src/app/(docs)/components/text/props.ts
@@ -0,0 +1,22 @@
+import {
+ childrenPropDefs,
+ classNamePropDefs,
+ stylePropDefs,
+} from '../../../../utils/propDefs';
+import type { PropDef } from '../../../../utils/propDefs';
+
+export const textPropDefs: Record = {
+ variant: {
+ type: 'enum',
+ values: ['display', 'title1', 'title2', 'title3', 'title4', 'title5'],
+ responsive: true,
+ },
+ weight: {
+ type: 'enum',
+ values: ['regular', 'bold'],
+ responsive: true,
+ },
+ ...childrenPropDefs,
+ ...classNamePropDefs,
+ ...stylePropDefs,
+};
diff --git a/canon-docs/src/components/CustomTheme/customTheme.tsx b/canon-docs/src/components/CustomTheme/customTheme.tsx
index e8628b83ff..66b4afc47c 100644
--- a/canon-docs/src/components/CustomTheme/customTheme.tsx
+++ b/canon-docs/src/components/CustomTheme/customTheme.tsx
@@ -125,7 +125,7 @@ export const CustomTheme = () => {
className={styles.buttonClose}
onClick={() => setOpen(!open)}
>
-
+