Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
brijeshb42 committed Jun 5, 2024
1 parent 545ed61 commit 2262486
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 111 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
"proptypes": "tsx ./scripts/generateProptypes.ts",
"proptypes": "echo \"tsx ./scripts/generateProptypes.ts\"",
"deduplicate": "pnpm dedupe",
"build": "lerna run --no-private build",
"build:ci": "lerna run build --concurrency 8 --skip-nx-cache",
Expand Down
214 changes: 108 additions & 106 deletions packages/pigment-css-react/src/Stack.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,114 +72,116 @@ 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',
process.env.NODE_ENV !== 'production'
? (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,
]),
),
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',
/**
* 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,
]),
),
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,
]),
};
/**
* @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,
]),
})
: void 0;

Stack.displayName = 'Stack';

Expand Down
14 changes: 10 additions & 4 deletions packages/pigment-css-react/src/generateAtomics.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ export function generateAtomics() {
*
* @param {RuntimeConfig} runtimeConfig
*/
export function atomics({ styles, shorthands, conditions, unitless, multiplier = 1 }) {
export function atomics({
styles,
shorthands,
conditions,
defaultCondition,
unitless,
multiplier = 1,
}) {
function addStyles(cssProperty, propertyValue, classes, inlineStyle) {
const styleClasses = styles[cssProperty];
if (!styleClasses) {
Expand All @@ -38,9 +45,8 @@ export function atomics({ styles, shorthands, conditions, unitless, multiplier =
const key = keys[0];
const styleValue = typeof value === 'number' ? value * multiplier : value;
classes.push(styleClasses[key][breakpoint]);
inlineStyle[`${key}_${breakpoint}`] = unitless.includes(cssProperty)
? styleValue
: `${styleValue}px`;
inlineStyle[`${key}_${breakpoint === '$$default' ? defaultCondition : breakpoint}`] =
unitless.includes(cssProperty) ? styleValue : `${styleValue}px`;
} else {
classes.push(styleClasses[value][breakpoint]);
}
Expand Down

0 comments on commit 2262486

Please sign in to comment.