From c97b9f8996ddd14e03617c860fbc6bd62cccac3f Mon Sep 17 00:00:00 2001 From: Brijesh Bittu Date: Mon, 3 Jun 2024 15:47:58 +0530 Subject: [PATCH] Add proptypes --- packages/pigment-css-react/src/Stack.jsx | 110 ++++++++++++++++++ .../pigment-css-react/tsconfig.build.json | 3 +- packages/pigment-css-react/tsconfig.json | 2 +- 3 files changed, 113 insertions(+), 2 deletions(-) diff --git a/packages/pigment-css-react/src/Stack.jsx b/packages/pigment-css-react/src/Stack.jsx index 54185ce6..5d1f2588 100644 --- a/packages/pigment-css-react/src/Stack.jsx +++ b/packages/pigment-css-react/src/Stack.jsx @@ -1,4 +1,5 @@ import clsx from 'clsx'; +import PropTypes from 'prop-types'; import * as React from 'react'; import { stackAtomics } from './baseAtomics'; @@ -71,6 +72,115 @@ const Stack = React.forwardRef(function Stack( ); }); +Stack.propTypes /* remove-proptypes */ = { + // ┌────────────────────────────── Warning ──────────────────────────────┐ + // │ These PropTypes are generated from the TypeScript type definitions. │ + // │ To update them, edit the d.ts file and run `pnpm proptypes`. │ + // └─────────────────────────────────────────────────────────────────────┘ + /** + * @ignore + */ + alignItems: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([ + PropTypes.oneOf([ + 'center', + 'end', + 'flex-end', + 'flex-start', + 'self-end', + 'self-start', + 'start', + 'baseline', + 'normal', + 'stretch', + ]), + PropTypes.arrayOf( + PropTypes.oneOf([ + 'center', + 'end', + 'flex-end', + 'flex-start', + 'self-end', + 'self-start', + 'start', + 'baseline', + 'normal', + 'stretch', + ]), + ), + PropTypes.object, + ]), + /** + * The content of the component. + */ + children: PropTypes.node, + /** + * @ignore + */ + className: PropTypes.string, + /** + * The component used for the root node. + * Either a string to use a HTML element or a component. + */ + component: PropTypes.elementType, + /** + * @ignore + */ + direction: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([ + PropTypes.oneOf(['column', 'column-reverse', 'row', 'row-reverse']), + PropTypes.arrayOf(PropTypes.oneOf(['column', 'column-reverse', 'row', 'row-reverse'])), + PropTypes.object, + ]), + /** + * @ignore + */ + display: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([ + PropTypes.oneOf(['flex', 'inline-flex']), + PropTypes.arrayOf(PropTypes.oneOf(['flex', 'inline-flex']).isRequired), + PropTypes.object, + ]), + /** + * @ignore + */ + divider: PropTypes.node, + /** + * @ignore + */ + justifyContent: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([ + PropTypes.oneOf([ + 'end', + 'start', + 'flex-end', + 'flex-start', + 'center', + 'space-between', + 'space-around', + 'space-evenly', + ]), + PropTypes.arrayOf( + PropTypes.oneOf([ + 'end', + 'start', + 'flex-end', + 'flex-start', + 'center', + 'space-between', + 'space-around', + 'space-evenly', + ]), + ), + PropTypes.object, + ]), + /** + * @ignore + */ + spacing: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([ + PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired), + PropTypes.number, + PropTypes.object, + PropTypes.string, + ]), +}; + Stack.displayName = 'Stack'; export default Stack; diff --git a/packages/pigment-css-react/tsconfig.build.json b/packages/pigment-css-react/tsconfig.build.json index 80b6a0a8..2639ca1b 100644 --- a/packages/pigment-css-react/tsconfig.build.json +++ b/packages/pigment-css-react/tsconfig.build.json @@ -2,5 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "composite": false - } + }, + "exclude": ["./tsup.config.ts", "src/**/*.d.ts"] } diff --git a/packages/pigment-css-react/tsconfig.json b/packages/pigment-css-react/tsconfig.json index 3e0efa80..30530ff4 100644 --- a/packages/pigment-css-react/tsconfig.json +++ b/packages/pigment-css-react/tsconfig.json @@ -11,5 +11,5 @@ "jsx": "react-jsx" }, "include": ["src/**/*.tsx", "src/**/*.js", "src/**/*.ts"], - "exclude": ["./tsup.config.ts", "src/**/*.d.ts"] + "exclude": ["./tsup.config.ts"] }