Skip to content

Commit

Permalink
Function for extracting component data (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
franckgaudin committed Jun 20, 2024
2 parents b3fee2e + d8b8a14 commit 665e85e
Show file tree
Hide file tree
Showing 47 changed files with 1,045 additions and 516 deletions.
16 changes: 15 additions & 1 deletion apps/docs/contentlayer.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineDocumentType, makeSource } from "contentlayer/source-files";
import { defineDocumentType, defineNestedType, makeSource } from "contentlayer/source-files";
import { rehypePluginOptions } from "./app/lib/rehypeConfig.js";

/** @type {import('contentlayer/source-files').ComputedFields} */
Expand Down Expand Up @@ -155,6 +155,13 @@ export const GettingStarted = defineDocumentType(() => ({
}
}));

const Links = defineNestedType(() => ({
name: "Links",
fields: {
source: { type: "string", required: true }
}
}));

export const Components = defineDocumentType(() => ({
name: "Components",
filePathPattern: "components/**/*.mdx",
Expand All @@ -172,6 +179,13 @@ export const Components = defineDocumentType(() => ({
},
status: {
type: "string"
},
order: {
type: "number"
},
links: {
type: "nested",
of: Links
}
},
computedFields: {
Expand Down
1 change: 1 addition & 0 deletions apps/docs/datas/components/Badge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"tags":{},"filePath":"/packages/components/src/badge/src/Badge.tsx","description":"A badge, displaying either text or a count, serves to present notices or notifications associated with a parent component.\n\n[View Documentation](TODO)","displayName":"Badge","methods":[],"props":{"variant":{"defaultValue":{"value":"\"primary\""},"description":"The visual style of the badge.\n*","name":"variant","parent":{"fileName":"wl-hopper/packages/components/src/badge/src/Badge.tsx","name":"BadgeProps"},"declarations":[{"fileName":"wl-hopper/packages/components/src/badge/src/Badge.tsx","name":"BadgeProps"}],"required":false,"type":{"name":"\"primary\" | \"secondary\""}},"isDisabled":{"defaultValue":null,"description":"Whether or not the badge is disabled.","name":"isDisabled","parent":{"fileName":"wl-hopper/packages/components/src/badge/src/Badge.tsx","name":"BadgeProps"},"declarations":[{"fileName":"wl-hopper/packages/components/src/badge/src/Badge.tsx","name":"BadgeProps"}],"required":false,"type":{"name":"boolean"}},"children":{"defaultValue":null,"description":"The children of the component.","name":"children","parent":{"fileName":"wl-hopper/packages/components/src/utils/src/types.ts","name":"DOMProps"},"declarations":[{"fileName":"wl-hopper/packages/components/src/utils/src/types.ts","name":"DOMProps"}],"required":false,"type":{"name":"ReactNode"}},"className":{"defaultValue":null,"description":"The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.","name":"className","parent":{"fileName":"wl-hopper/packages/components/src/utils/src/types.ts","name":"StyleProps"},"declarations":[{"fileName":"wl-hopper/packages/components/src/utils/src/types.ts","name":"StyleProps"}],"required":false,"type":{"name":"string"}},"style":{"defaultValue":null,"description":"The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.","name":"style","parent":{"fileName":"wl-hopper/packages/components/src/utils/src/types.ts","name":"StyleProps"},"declarations":[{"fileName":"wl-hopper/packages/components/src/utils/src/types.ts","name":"StyleProps"}],"required":false,"type":{"name":"CSSProperties"}},"id":{"defaultValue":null,"description":"The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).","name":"id","parent":{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"DOMProps"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"DOMProps"}],"required":false,"type":{"name":"string"}},"aria-label":{"defaultValue":null,"description":"Defines a string value that labels the current element.","name":"aria-label","parent":{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"}],"required":false,"type":{"name":"string"}},"aria-labelledby":{"defaultValue":null,"description":"Identifies the element (or elements) that labels the current element.","name":"aria-labelledby","parent":{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"}],"required":false,"type":{"name":"string"}},"aria-describedby":{"defaultValue":null,"description":"Identifies the element (or elements) that describes the object.","name":"aria-describedby","parent":{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"}],"required":false,"type":{"name":"string"}},"aria-details":{"defaultValue":null,"description":"Identifies the element (or elements) that provide a detailed, extended description for the object.","name":"aria-details","parent":{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"}],"required":false,"type":{"name":"string"}},"slot":{"defaultValue":null,"description":"A slot name for the component. Slots allow the component to receive props from a parent component.\nAn explicit `null` value indicates that the local props completely override all props received from a parent.","name":"slot","parent":{"fileName":"wl-hopper/node_modules/.pnpm/react-aria-components@1.2.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-aria-components/dist/types.d.ts","name":"SlotProps"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/react-aria-components@1.2.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-aria-components/dist/types.d.ts","name":"SlotProps"}],"required":false,"type":{"name":"string | null"}},"ref":{"defaultValue":null,"description":"Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}","name":"ref","parent":{"fileName":"wl-hopper/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts","name":"RefAttributes"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts","name":"RefAttributes"}],"required":false,"type":{"name":"LegacyRef<HTMLSpanElement>"}},"key":{"defaultValue":null,"description":"","name":"key","parent":{"fileName":"wl-hopper/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts","name":"Attributes"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts","name":"Attributes"}],"required":false,"type":{"name":"Key | null"}}},"groups":{"default":{"variant":{"defaultValue":{"value":"\"primary\""},"description":"The visual style of the badge.\n*","name":"variant","parent":{"fileName":"wl-hopper/packages/components/src/badge/src/Badge.tsx","name":"BadgeProps"},"declarations":[{"fileName":"wl-hopper/packages/components/src/badge/src/Badge.tsx","name":"BadgeProps"}],"required":false,"type":{"name":"\"primary\" | \"secondary\""}},"isDisabled":{"defaultValue":null,"description":"Whether or not the badge is disabled.","name":"isDisabled","parent":{"fileName":"wl-hopper/packages/components/src/badge/src/Badge.tsx","name":"BadgeProps"},"declarations":[{"fileName":"wl-hopper/packages/components/src/badge/src/Badge.tsx","name":"BadgeProps"}],"required":false,"type":{"name":"boolean"}},"children":{"defaultValue":null,"description":"The children of the component.","name":"children","parent":{"fileName":"wl-hopper/packages/components/src/utils/src/types.ts","name":"DOMProps"},"declarations":[{"fileName":"wl-hopper/packages/components/src/utils/src/types.ts","name":"DOMProps"}],"required":false,"type":{"name":"ReactNode"}},"className":{"defaultValue":null,"description":"The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.","name":"className","parent":{"fileName":"wl-hopper/packages/components/src/utils/src/types.ts","name":"StyleProps"},"declarations":[{"fileName":"wl-hopper/packages/components/src/utils/src/types.ts","name":"StyleProps"}],"required":false,"type":{"name":"string"}},"style":{"defaultValue":null,"description":"The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element.","name":"style","parent":{"fileName":"wl-hopper/packages/components/src/utils/src/types.ts","name":"StyleProps"},"declarations":[{"fileName":"wl-hopper/packages/components/src/utils/src/types.ts","name":"StyleProps"}],"required":false,"type":{"name":"CSSProperties"}},"id":{"defaultValue":null,"description":"The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).","name":"id","parent":{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"DOMProps"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"DOMProps"}],"required":false,"type":{"name":"string"}}},"events":{},"accessibility":{"aria-label":{"defaultValue":null,"description":"Defines a string value that labels the current element.","name":"aria-label","parent":{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"}],"required":false,"type":{"name":"string"}},"aria-labelledby":{"defaultValue":null,"description":"Identifies the element (or elements) that labels the current element.","name":"aria-labelledby","parent":{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"}],"required":false,"type":{"name":"string"}},"aria-describedby":{"defaultValue":null,"description":"Identifies the element (or elements) that describes the object.","name":"aria-describedby","parent":{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"}],"required":false,"type":{"name":"string"}},"aria-details":{"defaultValue":null,"description":"Identifies the element (or elements) that provide a detailed, extended description for the object.","name":"aria-details","parent":{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/@react-types+shared@3.23.1_react@18.3.1/node_modules/@react-types/shared/src/dom.d.ts","name":"AriaLabelingProps"}],"required":false,"type":{"name":"string"}}},"layout":{"slot":{"defaultValue":null,"description":"A slot name for the component. Slots allow the component to receive props from a parent component.\nAn explicit `null` value indicates that the local props completely override all props received from a parent.","name":"slot","parent":{"fileName":"wl-hopper/node_modules/.pnpm/react-aria-components@1.2.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-aria-components/dist/types.d.ts","name":"SlotProps"},"declarations":[{"fileName":"wl-hopper/node_modules/.pnpm/react-aria-components@1.2.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-aria-components/dist/types.d.ts","name":"SlotProps"}],"required":false,"type":{"name":"string | null"}}}}}]
2 changes: 1 addition & 1 deletion apps/docs/datas/components/Button.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apps/docs/datas/components/ButtonGroup.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apps/docs/datas/components/Checkbox.json

Large diffs are not rendered by default.

Loading

0 comments on commit 665e85e

Please sign in to comment.