@soroush.tech/styled-system 5.3.0 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -6
- package/dist/index.cjs +5 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/prop-types.cjs +48 -0
- package/dist/prop-types.d.cts +22 -0
- package/dist/prop-types.d.mts +22 -0
- package/dist/prop-types.mjs +40 -0
- package/dist/rolldown-runtime-D6vf50IK.cjs +28 -0
- package/dist/should-forward-prop.cjs +2 -23
- package/package.json +20 -2
package/README.md
CHANGED
|
@@ -38,10 +38,10 @@ pnpm add @soroush.tech/styled-system
|
|
|
38
38
|
yarn add @soroush.tech/styled-system
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
`@emotion/is-prop-valid` (`^1.4.0
|
|
42
|
-
[
|
|
43
|
-
You bring your own CSS-in-JS
|
|
44
|
-
neither at runtime.
|
|
41
|
+
`@emotion/is-prop-valid` (`^1.4.0`, peer) and `prop-types` (`^15.8.1`, optional peer) are
|
|
42
|
+
each used by a single [subpath](#subpath-imports) — `should-forward-prop` and `prop-types`
|
|
43
|
+
respectively. Install one only if you import that subpath. You bring your own CSS-in-JS
|
|
44
|
+
library (Emotion, styled-components, …); the core carries neither at runtime.
|
|
45
45
|
|
|
46
46
|
## Usage
|
|
47
47
|
|
|
@@ -110,12 +110,16 @@ Subpaths mirror the original `@styled-system/*` packages:
|
|
|
110
110
|
import { css } from '@soroush.tech/styled-system/css'
|
|
111
111
|
import { themeGet } from '@soroush.tech/styled-system/theme-get'
|
|
112
112
|
import { pick, omit } from '@soroush.tech/styled-system/props'
|
|
113
|
+
import propTypes, { createPropTypes } from '@soroush.tech/styled-system/prop-types'
|
|
113
114
|
import shouldForwardProp, {
|
|
114
115
|
createShouldForwardProp,
|
|
115
116
|
props,
|
|
116
117
|
} from '@soroush.tech/styled-system/should-forward-prop'
|
|
117
118
|
```
|
|
118
119
|
|
|
120
|
+
`themeGet` is also re-exported from the package root (as both a named and the default
|
|
121
|
+
export), so `import { themeGet } from '@soroush.tech/styled-system'` works too.
|
|
122
|
+
|
|
119
123
|
## Drop-in via alias
|
|
120
124
|
|
|
121
125
|
Existing `styled-system` users can swap with a package-manager alias — no code changes:
|
|
@@ -126,8 +130,9 @@ Existing `styled-system` users can swap with a package-manager alias — no code
|
|
|
126
130
|
}
|
|
127
131
|
```
|
|
128
132
|
|
|
129
|
-
`@styled-system
|
|
130
|
-
`@soroush.tech/styled-system/should-forward-prop
|
|
133
|
+
Every `@styled-system/*` satellite maps 1:1 to the matching
|
|
134
|
+
`@soroush.tech/styled-system/*` subpath — e.g. `@styled-system/should-forward-prop`,
|
|
135
|
+
`@styled-system/prop-types`, `@styled-system/theme-get`, `@styled-system/css`.
|
|
131
136
|
|
|
132
137
|
## Documentation
|
|
133
138
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_core = require("./core.cjs");
|
|
3
6
|
const require_background = require("./background-wugr6cG7.cjs");
|
|
4
7
|
const require_border = require("./border-UuT-fTpy.cjs");
|
|
@@ -123,6 +126,7 @@ exports.colorStyle = require_variant.colorStyle;
|
|
|
123
126
|
exports.compose = require_core.compose;
|
|
124
127
|
exports.createParser = require_core.createParser;
|
|
125
128
|
exports.createStyleFunction = require_core.createStyleFunction;
|
|
129
|
+
exports.default = require_theme_get.themeGet;
|
|
126
130
|
exports.display = display;
|
|
127
131
|
exports.flex = flex;
|
|
128
132
|
exports.flexBasis = flexBasis;
|
package/dist/index.d.cts
CHANGED
|
@@ -97,4 +97,4 @@ declare const right: Parser;
|
|
|
97
97
|
declare const bottom: Parser;
|
|
98
98
|
declare const left: Parser;
|
|
99
99
|
//#endregion
|
|
100
|
-
export { AlignContentProps, AlignItemsProps, AlignSelfProps, BackgroundColorProps, BackgroundImageProps, BackgroundPositionProps, BackgroundProps, BackgroundRepeatProps, BackgroundSizeProps, BorderBottomProps, BorderColorProps, BorderLeftProps, BorderProps, BorderRadiusProps, BorderRightProps, BorderStyleProps, BorderTopProps, BorderWidthProps, BottomProps, BoxShadowProps, ButtonStyleProps, ColorProps, ColorStyleProps, type ConfigStyle, DisplayProps, FlexBasisProps, FlexDirectionProps, FlexGrowProps, FlexProps, FlexShrinkProps, FlexWrapProps, FlexboxProps, FontFamilyProps, FontSizeProps, FontStyleProps, FontWeightProps, GridAreaProps, GridAutoColumnsProps, GridAutoFlowProps, GridAutoRowsProps, GridColumnGapProps, GridColumnProps, GridGapProps, GridProps, GridRowGapProps, GridRowProps, GridTemplateAreasProps, GridTemplateColumnsProps, GridTemplateRowsProps, HeightProps, JustifyContentProps, JustifyItemsProps, JustifySelfProps, LayoutProps, LeftProps, LetterSpacingProps, LineHeightProps, MarginProps, MaxHeightProps, MaxWidthProps, MinHeightProps, MinWidthProps, ObjectOrArray, OpacityProps, OrderProps, OverflowProps, PaddingProps, type Parser, type ParserConfig, PositionProps, type Props, RequiredTheme, ResponsiveValue, RightProps, Scale, ShadowProps, SizeProps, SpaceProps, type StyleFn, type StyleObject, type SystemConfig, TLengthStyledSystem, TextAlignProps, TextColorProps, TextShadowProps, TextStyleProps, Theme, ThemeValue, TopProps, type Transform, TypographyProps, VerticalAlignProps, WidthProps, ZIndexProps, alignContent, alignItems, alignSelf, background, backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize, border, border as borders, borderBottom, borderColor, borderLeft, borderRadius, borderRight, borderStyle, borderTop, borderWidth, bottom, shadow as boxShadow, shadow, shadow as textShadow, buttonStyle, color, colorStyle, compose, createParser, createStyleFunction, display, flex, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, flexbox, fontFamily, fontSize, fontStyle, fontWeight, get, grid, gridArea, gridAutoColumns, gridAutoFlow, gridAutoRows, gridColumn, gridColumnGap, gridGap, gridRow, gridRowGap, gridTemplateAreas, gridTemplateColumns, gridTemplateRows, height, justifyContent, justifyItems, justifySelf, layout, left, letterSpacing, lineHeight, margin, maxHeight, maxWidth, minHeight, minWidth, opacity, order, overflow, overflowX, overflowY, padding, position, right, size, space, style, system, textAlign, textStyle,
|
|
100
|
+
export { AlignContentProps, AlignItemsProps, AlignSelfProps, BackgroundColorProps, BackgroundImageProps, BackgroundPositionProps, BackgroundProps, BackgroundRepeatProps, BackgroundSizeProps, BorderBottomProps, BorderColorProps, BorderLeftProps, BorderProps, BorderRadiusProps, BorderRightProps, BorderStyleProps, BorderTopProps, BorderWidthProps, BottomProps, BoxShadowProps, ButtonStyleProps, ColorProps, ColorStyleProps, type ConfigStyle, DisplayProps, FlexBasisProps, FlexDirectionProps, FlexGrowProps, FlexProps, FlexShrinkProps, FlexWrapProps, FlexboxProps, FontFamilyProps, FontSizeProps, FontStyleProps, FontWeightProps, GridAreaProps, GridAutoColumnsProps, GridAutoFlowProps, GridAutoRowsProps, GridColumnGapProps, GridColumnProps, GridGapProps, GridProps, GridRowGapProps, GridRowProps, GridTemplateAreasProps, GridTemplateColumnsProps, GridTemplateRowsProps, HeightProps, JustifyContentProps, JustifyItemsProps, JustifySelfProps, LayoutProps, LeftProps, LetterSpacingProps, LineHeightProps, MarginProps, MaxHeightProps, MaxWidthProps, MinHeightProps, MinWidthProps, ObjectOrArray, OpacityProps, OrderProps, OverflowProps, PaddingProps, type Parser, type ParserConfig, PositionProps, type Props, RequiredTheme, ResponsiveValue, RightProps, Scale, ShadowProps, SizeProps, SpaceProps, type StyleFn, type StyleObject, type SystemConfig, TLengthStyledSystem, TextAlignProps, TextColorProps, TextShadowProps, TextStyleProps, Theme, ThemeValue, TopProps, type Transform, TypographyProps, VerticalAlignProps, WidthProps, ZIndexProps, alignContent, alignItems, alignSelf, background, backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize, border, border as borders, borderBottom, borderColor, borderLeft, borderRadius, borderRight, borderStyle, borderTop, borderWidth, bottom, shadow as boxShadow, shadow, shadow as textShadow, buttonStyle, color, colorStyle, compose, createParser, createStyleFunction, themeGet as default, themeGet, display, flex, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, flexbox, fontFamily, fontSize, fontStyle, fontWeight, get, grid, gridArea, gridAutoColumns, gridAutoFlow, gridAutoRows, gridColumn, gridColumnGap, gridGap, gridRow, gridRowGap, gridTemplateAreas, gridTemplateColumns, gridTemplateRows, height, justifyContent, justifyItems, justifySelf, layout, left, letterSpacing, lineHeight, margin, maxHeight, maxWidth, minHeight, minWidth, opacity, order, overflow, overflowX, overflowY, padding, position, right, size, space, style, system, textAlign, textStyle, top, typography, variant, verticalAlign, width, zIndex };
|
package/dist/index.d.mts
CHANGED
|
@@ -97,4 +97,4 @@ declare const right: Parser;
|
|
|
97
97
|
declare const bottom: Parser;
|
|
98
98
|
declare const left: Parser;
|
|
99
99
|
//#endregion
|
|
100
|
-
export { AlignContentProps, AlignItemsProps, AlignSelfProps, BackgroundColorProps, BackgroundImageProps, BackgroundPositionProps, BackgroundProps, BackgroundRepeatProps, BackgroundSizeProps, BorderBottomProps, BorderColorProps, BorderLeftProps, BorderProps, BorderRadiusProps, BorderRightProps, BorderStyleProps, BorderTopProps, BorderWidthProps, BottomProps, BoxShadowProps, ButtonStyleProps, ColorProps, ColorStyleProps, type ConfigStyle, DisplayProps, FlexBasisProps, FlexDirectionProps, FlexGrowProps, FlexProps, FlexShrinkProps, FlexWrapProps, FlexboxProps, FontFamilyProps, FontSizeProps, FontStyleProps, FontWeightProps, GridAreaProps, GridAutoColumnsProps, GridAutoFlowProps, GridAutoRowsProps, GridColumnGapProps, GridColumnProps, GridGapProps, GridProps, GridRowGapProps, GridRowProps, GridTemplateAreasProps, GridTemplateColumnsProps, GridTemplateRowsProps, HeightProps, JustifyContentProps, JustifyItemsProps, JustifySelfProps, LayoutProps, LeftProps, LetterSpacingProps, LineHeightProps, MarginProps, MaxHeightProps, MaxWidthProps, MinHeightProps, MinWidthProps, ObjectOrArray, OpacityProps, OrderProps, OverflowProps, PaddingProps, type Parser, type ParserConfig, PositionProps, type Props, RequiredTheme, ResponsiveValue, RightProps, Scale, ShadowProps, SizeProps, SpaceProps, type StyleFn, type StyleObject, type SystemConfig, TLengthStyledSystem, TextAlignProps, TextColorProps, TextShadowProps, TextStyleProps, Theme, ThemeValue, TopProps, type Transform, TypographyProps, VerticalAlignProps, WidthProps, ZIndexProps, alignContent, alignItems, alignSelf, background, backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize, border, border as borders, borderBottom, borderColor, borderLeft, borderRadius, borderRight, borderStyle, borderTop, borderWidth, bottom, shadow as boxShadow, shadow, shadow as textShadow, buttonStyle, color, colorStyle, compose, createParser, createStyleFunction, display, flex, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, flexbox, fontFamily, fontSize, fontStyle, fontWeight, get, grid, gridArea, gridAutoColumns, gridAutoFlow, gridAutoRows, gridColumn, gridColumnGap, gridGap, gridRow, gridRowGap, gridTemplateAreas, gridTemplateColumns, gridTemplateRows, height, justifyContent, justifyItems, justifySelf, layout, left, letterSpacing, lineHeight, margin, maxHeight, maxWidth, minHeight, minWidth, opacity, order, overflow, overflowX, overflowY, padding, position, right, size, space, style, system, textAlign, textStyle,
|
|
100
|
+
export { AlignContentProps, AlignItemsProps, AlignSelfProps, BackgroundColorProps, BackgroundImageProps, BackgroundPositionProps, BackgroundProps, BackgroundRepeatProps, BackgroundSizeProps, BorderBottomProps, BorderColorProps, BorderLeftProps, BorderProps, BorderRadiusProps, BorderRightProps, BorderStyleProps, BorderTopProps, BorderWidthProps, BottomProps, BoxShadowProps, ButtonStyleProps, ColorProps, ColorStyleProps, type ConfigStyle, DisplayProps, FlexBasisProps, FlexDirectionProps, FlexGrowProps, FlexProps, FlexShrinkProps, FlexWrapProps, FlexboxProps, FontFamilyProps, FontSizeProps, FontStyleProps, FontWeightProps, GridAreaProps, GridAutoColumnsProps, GridAutoFlowProps, GridAutoRowsProps, GridColumnGapProps, GridColumnProps, GridGapProps, GridProps, GridRowGapProps, GridRowProps, GridTemplateAreasProps, GridTemplateColumnsProps, GridTemplateRowsProps, HeightProps, JustifyContentProps, JustifyItemsProps, JustifySelfProps, LayoutProps, LeftProps, LetterSpacingProps, LineHeightProps, MarginProps, MaxHeightProps, MaxWidthProps, MinHeightProps, MinWidthProps, ObjectOrArray, OpacityProps, OrderProps, OverflowProps, PaddingProps, type Parser, type ParserConfig, PositionProps, type Props, RequiredTheme, ResponsiveValue, RightProps, Scale, ShadowProps, SizeProps, SpaceProps, type StyleFn, type StyleObject, type SystemConfig, TLengthStyledSystem, TextAlignProps, TextColorProps, TextShadowProps, TextStyleProps, Theme, ThemeValue, TopProps, type Transform, TypographyProps, VerticalAlignProps, WidthProps, ZIndexProps, alignContent, alignItems, alignSelf, background, backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize, border, border as borders, borderBottom, borderColor, borderLeft, borderRadius, borderRight, borderStyle, borderTop, borderWidth, bottom, shadow as boxShadow, shadow, shadow as textShadow, buttonStyle, color, colorStyle, compose, createParser, createStyleFunction, themeGet as default, themeGet, display, flex, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, flexbox, fontFamily, fontSize, fontStyle, fontWeight, get, grid, gridArea, gridAutoColumns, gridAutoFlow, gridAutoRows, gridColumn, gridColumnGap, gridGap, gridRow, gridRowGap, gridTemplateAreas, gridTemplateColumns, gridTemplateRows, height, justifyContent, justifyItems, justifySelf, layout, left, letterSpacing, lineHeight, margin, maxHeight, maxWidth, minHeight, minWidth, opacity, order, overflow, overflowX, overflowY, padding, position, right, size, space, style, system, textAlign, textStyle, top, typography, variant, verticalAlign, width, zIndex };
|
package/dist/index.mjs
CHANGED
|
@@ -96,4 +96,4 @@ const right = positionFns.right;
|
|
|
96
96
|
const bottom = positionFns.bottom;
|
|
97
97
|
const left = positionFns.left;
|
|
98
98
|
//#endregion
|
|
99
|
-
export { alignContent, alignItems, alignSelf, background, backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize, border, border as borders, borderBottom, borderColor, borderLeft, borderRadius, borderRight, borderStyle, borderTop, borderWidth, bottom, shadow as boxShadow, shadow, shadow as textShadow, buttonStyle, color, colorStyle, compose, createParser, createStyleFunction, display, flex, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, flexbox, fontFamily, fontSize, fontStyle, fontWeight, get, grid, gridArea, gridAutoColumns, gridAutoFlow, gridAutoRows, gridColumn, gridColumnGap, gridGap, gridRow, gridRowGap, gridTemplateAreas, gridTemplateColumns, gridTemplateRows, height, justifyContent, justifyItems, justifySelf, layout, left, letterSpacing, lineHeight, margin, maxHeight, maxWidth, minHeight, minWidth, opacity, order, overflow, overflowX, overflowY, padding, position, right, size, space, style, system, textAlign, textStyle,
|
|
99
|
+
export { alignContent, alignItems, alignSelf, background, backgroundImage, backgroundPosition, backgroundRepeat, backgroundSize, border, border as borders, borderBottom, borderColor, borderLeft, borderRadius, borderRight, borderStyle, borderTop, borderWidth, bottom, shadow as boxShadow, shadow, shadow as textShadow, buttonStyle, color, colorStyle, compose, createParser, createStyleFunction, themeGet as default, themeGet, display, flex, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, flexbox, fontFamily, fontSize, fontStyle, fontWeight, get, grid, gridArea, gridAutoColumns, gridAutoFlow, gridAutoRows, gridColumn, gridColumnGap, gridGap, gridRow, gridRowGap, gridTemplateAreas, gridTemplateColumns, gridTemplateRows, height, justifyContent, justifyItems, justifySelf, layout, left, letterSpacing, lineHeight, margin, maxHeight, maxWidth, minHeight, minWidth, opacity, order, overflow, overflowX, overflowY, padding, position, right, size, space, style, system, textAlign, textStyle, top, typography, variant, verticalAlign, width, zIndex };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
|
|
6
|
+
const require_background = require("./background-wugr6cG7.cjs");
|
|
7
|
+
const require_border = require("./border-UuT-fTpy.cjs");
|
|
8
|
+
const require_color = require("./color-BNs17Gw-.cjs");
|
|
9
|
+
const require_flexbox = require("./flexbox-CFkO6PrP.cjs");
|
|
10
|
+
const require_grid = require("./grid-CpvRIng4.cjs");
|
|
11
|
+
const require_layout = require("./layout-JlwVxg8y.cjs");
|
|
12
|
+
const require_position = require("./position-zWvCE4hD.cjs");
|
|
13
|
+
const require_typography = require("./typography-DD_eWLLx.cjs");
|
|
14
|
+
const require_space = require("./space-CAX_62yL.cjs");
|
|
15
|
+
const require_shadow = require("./shadow-BrDnaQQl.cjs");
|
|
16
|
+
const require_variant = require("./variant-C7vPzZHo.cjs");
|
|
17
|
+
let prop_types = require("prop-types");
|
|
18
|
+
prop_types = require_rolldown_runtime.__toESM(prop_types, 1);
|
|
19
|
+
//#region src/prop-types/prop-types.ts
|
|
20
|
+
const propType = prop_types.default.oneOfType([
|
|
21
|
+
prop_types.default.number,
|
|
22
|
+
prop_types.default.string,
|
|
23
|
+
prop_types.default.array,
|
|
24
|
+
prop_types.default.object
|
|
25
|
+
]);
|
|
26
|
+
const createPropTypes = (props) => props.reduce((acc, name) => {
|
|
27
|
+
acc[name] = propType;
|
|
28
|
+
return acc;
|
|
29
|
+
}, {});
|
|
30
|
+
const propTypes = {
|
|
31
|
+
space: createPropTypes(require_space.space.propNames),
|
|
32
|
+
color: createPropTypes(require_color.color.propNames),
|
|
33
|
+
layout: createPropTypes(require_layout.layout.propNames),
|
|
34
|
+
typography: createPropTypes(require_typography.typography.propNames),
|
|
35
|
+
flexbox: createPropTypes(require_flexbox.flexbox.propNames),
|
|
36
|
+
border: createPropTypes(require_border.border.propNames),
|
|
37
|
+
background: createPropTypes(require_background.background.propNames),
|
|
38
|
+
position: createPropTypes(require_position.position.propNames),
|
|
39
|
+
grid: createPropTypes(require_grid.grid.propNames),
|
|
40
|
+
shadow: createPropTypes(require_shadow.shadow.propNames),
|
|
41
|
+
buttonStyle: createPropTypes(require_variant.buttonStyle.propNames),
|
|
42
|
+
textStyle: createPropTypes(require_variant.textStyle.propNames),
|
|
43
|
+
colorStyle: createPropTypes(require_variant.colorStyle.propNames)
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
exports.createPropTypes = createPropTypes;
|
|
47
|
+
exports.default = propTypes;
|
|
48
|
+
exports.propType = propType;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/prop-types/prop-types.d.ts
|
|
2
|
+
type PropTypeValidator = (props: Record<string, unknown>, propName: string, componentName: string, location: string, propFullName: string) => Error | null;
|
|
3
|
+
type PropTypeMap = Record<string, PropTypeValidator>;
|
|
4
|
+
declare const propType: PropTypeValidator;
|
|
5
|
+
declare const createPropTypes: (props: string[]) => PropTypeMap;
|
|
6
|
+
declare const propTypes: {
|
|
7
|
+
space: PropTypeMap;
|
|
8
|
+
color: PropTypeMap;
|
|
9
|
+
layout: PropTypeMap;
|
|
10
|
+
typography: PropTypeMap;
|
|
11
|
+
flexbox: PropTypeMap;
|
|
12
|
+
border: PropTypeMap;
|
|
13
|
+
background: PropTypeMap;
|
|
14
|
+
position: PropTypeMap;
|
|
15
|
+
grid: PropTypeMap;
|
|
16
|
+
shadow: PropTypeMap;
|
|
17
|
+
buttonStyle: PropTypeMap;
|
|
18
|
+
textStyle: PropTypeMap;
|
|
19
|
+
colorStyle: PropTypeMap;
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { PropTypeMap, PropTypeValidator, createPropTypes, propTypes as default, propType };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/prop-types/prop-types.d.ts
|
|
2
|
+
type PropTypeValidator = (props: Record<string, unknown>, propName: string, componentName: string, location: string, propFullName: string) => Error | null;
|
|
3
|
+
type PropTypeMap = Record<string, PropTypeValidator>;
|
|
4
|
+
declare const propType: PropTypeValidator;
|
|
5
|
+
declare const createPropTypes: (props: string[]) => PropTypeMap;
|
|
6
|
+
declare const propTypes: {
|
|
7
|
+
space: PropTypeMap;
|
|
8
|
+
color: PropTypeMap;
|
|
9
|
+
layout: PropTypeMap;
|
|
10
|
+
typography: PropTypeMap;
|
|
11
|
+
flexbox: PropTypeMap;
|
|
12
|
+
border: PropTypeMap;
|
|
13
|
+
background: PropTypeMap;
|
|
14
|
+
position: PropTypeMap;
|
|
15
|
+
grid: PropTypeMap;
|
|
16
|
+
shadow: PropTypeMap;
|
|
17
|
+
buttonStyle: PropTypeMap;
|
|
18
|
+
textStyle: PropTypeMap;
|
|
19
|
+
colorStyle: PropTypeMap;
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { PropTypeMap, PropTypeValidator, createPropTypes, propTypes as default, propType };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { t as background } from "./background-B-jql3jb.mjs";
|
|
2
|
+
import { t as border } from "./border-Dder4Dhp.mjs";
|
|
3
|
+
import { t as color } from "./color-CGmMe8yP.mjs";
|
|
4
|
+
import { t as flexbox } from "./flexbox-XQnlnfa4.mjs";
|
|
5
|
+
import { t as grid } from "./grid-Bpk-QjhF.mjs";
|
|
6
|
+
import { t as layout } from "./layout-Dx0Un_6l.mjs";
|
|
7
|
+
import { t as position } from "./position-jf6VlRyR.mjs";
|
|
8
|
+
import { t as typography } from "./typography-CptBXSy0.mjs";
|
|
9
|
+
import { r as space } from "./space-DEf9-0r9.mjs";
|
|
10
|
+
import { t as shadow } from "./shadow-Bp7lx_41.mjs";
|
|
11
|
+
import { n as colorStyle, r as textStyle, t as buttonStyle } from "./variant-DQA9pqwW.mjs";
|
|
12
|
+
import PropTypes from "prop-types";
|
|
13
|
+
//#region src/prop-types/prop-types.ts
|
|
14
|
+
const propType = PropTypes.oneOfType([
|
|
15
|
+
PropTypes.number,
|
|
16
|
+
PropTypes.string,
|
|
17
|
+
PropTypes.array,
|
|
18
|
+
PropTypes.object
|
|
19
|
+
]);
|
|
20
|
+
const createPropTypes = (props) => props.reduce((acc, name) => {
|
|
21
|
+
acc[name] = propType;
|
|
22
|
+
return acc;
|
|
23
|
+
}, {});
|
|
24
|
+
const propTypes = {
|
|
25
|
+
space: createPropTypes(space.propNames),
|
|
26
|
+
color: createPropTypes(color.propNames),
|
|
27
|
+
layout: createPropTypes(layout.propNames),
|
|
28
|
+
typography: createPropTypes(typography.propNames),
|
|
29
|
+
flexbox: createPropTypes(flexbox.propNames),
|
|
30
|
+
border: createPropTypes(border.propNames),
|
|
31
|
+
background: createPropTypes(background.propNames),
|
|
32
|
+
position: createPropTypes(position.propNames),
|
|
33
|
+
grid: createPropTypes(grid.propNames),
|
|
34
|
+
shadow: createPropTypes(shadow.propNames),
|
|
35
|
+
buttonStyle: createPropTypes(buttonStyle.propNames),
|
|
36
|
+
textStyle: createPropTypes(textStyle.propNames),
|
|
37
|
+
colorStyle: createPropTypes(colorStyle.propNames)
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { createPropTypes, propTypes as default, propType };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
Object.defineProperty(exports, "__toESM", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return __toESM;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -2,31 +2,10 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
var __create = Object.create;
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
|
-
key = keys[i];
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
-
get: ((k) => from[k]).bind(null, key),
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
//#endregion
|
|
5
|
+
const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
|
|
27
6
|
const require_presets = require("./presets-BgKBhlRl.cjs");
|
|
28
7
|
let _emotion_is_prop_valid = require("@emotion/is-prop-valid");
|
|
29
|
-
_emotion_is_prop_valid = __toESM(_emotion_is_prop_valid, 1);
|
|
8
|
+
_emotion_is_prop_valid = require_rolldown_runtime.__toESM(_emotion_is_prop_valid, 1);
|
|
30
9
|
//#region src/should-forward-prop/should-forward-prop.ts
|
|
31
10
|
const memoize = (fn) => {
|
|
32
11
|
const cache = Object.create(null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soroush.tech/styled-system",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "Maintained, first-class-TypeScript rewrite of styled-system — responsive, theme-aware style props for CSS-in-JS. Drop-in replacement for styled-system v5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"styled-system",
|
|
@@ -188,6 +188,16 @@
|
|
|
188
188
|
"default": "./dist/props.cjs"
|
|
189
189
|
}
|
|
190
190
|
},
|
|
191
|
+
"./prop-types": {
|
|
192
|
+
"import": {
|
|
193
|
+
"types": "./dist/prop-types.d.mts",
|
|
194
|
+
"default": "./dist/prop-types.mjs"
|
|
195
|
+
},
|
|
196
|
+
"require": {
|
|
197
|
+
"types": "./dist/prop-types.d.cts",
|
|
198
|
+
"default": "./dist/prop-types.cjs"
|
|
199
|
+
}
|
|
200
|
+
},
|
|
191
201
|
"./should-forward-prop": {
|
|
192
202
|
"import": {
|
|
193
203
|
"types": "./dist/should-forward-prop.d.mts",
|
|
@@ -210,13 +220,21 @@
|
|
|
210
220
|
"csstype": "^3.1.3"
|
|
211
221
|
},
|
|
212
222
|
"peerDependencies": {
|
|
213
|
-
"@emotion/is-prop-valid": "^1.4.0"
|
|
223
|
+
"@emotion/is-prop-valid": "^1.4.0",
|
|
224
|
+
"prop-types": "^15.8.1"
|
|
225
|
+
},
|
|
226
|
+
"peerDependenciesMeta": {
|
|
227
|
+
"prop-types": {
|
|
228
|
+
"optional": true
|
|
229
|
+
}
|
|
214
230
|
},
|
|
215
231
|
"devDependencies": {
|
|
216
232
|
"@emotion/is-prop-valid": "^1.4.0",
|
|
233
|
+
"@types/prop-types": "^15.7.12",
|
|
217
234
|
"@vitest/coverage-v8": "^4.1.9",
|
|
218
235
|
"eslint": "^10.5.0",
|
|
219
236
|
"globals": "^17.7.0",
|
|
237
|
+
"prop-types": "^15.8.1",
|
|
220
238
|
"tsdown": "^0.22.3",
|
|
221
239
|
"typescript": "~6.0.3",
|
|
222
240
|
"vitest": "^4.1.9",
|