@soroush.tech/styled-system 5.3.0 → 5.5.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 +18 -6
- package/dist/index.cjs +0 -2
- package/dist/index.d.cts +1 -2
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +1 -2
- 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/dist/theme-get.cjs +6 -3
- package/dist/theme-get.d.cts +5 -1
- package/dist/theme-get.d.mts +5 -1
- package/dist/theme-get.mjs +4 -1
- package/package.json +76 -3
- package/dist/index-CTguR0fU.d.cts +0 -6
- package/dist/index-C_ikENGU.d.mts +0 -6
- package/dist/theme-get-CwPt9eDy.mjs +0 -5
- package/dist/theme-get-D0fH7Jrd.cjs +0 -10
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,6 +110,7 @@ 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,
|
|
@@ -126,8 +127,19 @@ Existing `styled-system` users can swap with a package-manager alias — no code
|
|
|
126
127
|
}
|
|
127
128
|
```
|
|
128
129
|
|
|
129
|
-
`@styled-system
|
|
130
|
-
|
|
130
|
+
The satellite `@styled-system/*` packages don't need separate aliases — import them as
|
|
131
|
+
subpaths off the aliased `styled-system` name, and they resolve through this package's
|
|
132
|
+
`exports`:
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
import themeGet from 'styled-system/theme-get'
|
|
136
|
+
import propTypes from 'styled-system/prop-types'
|
|
137
|
+
import { css } from 'styled-system/css'
|
|
138
|
+
import shouldForwardProp from 'styled-system/should-forward-prop'
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Types resolve under both modern module resolution (`node16`/`nodenext`/`bundler`, via
|
|
142
|
+
`exports`) and classic `node` (via `typesVersions`).
|
|
131
143
|
|
|
132
144
|
## Documentation
|
|
133
145
|
|
package/dist/index.cjs
CHANGED
|
@@ -11,7 +11,6 @@ const require_typography = require("./typography-DD_eWLLx.cjs");
|
|
|
11
11
|
const require_space = require("./space-CAX_62yL.cjs");
|
|
12
12
|
const require_shadow = require("./shadow-BrDnaQQl.cjs");
|
|
13
13
|
const require_variant = require("./variant-C7vPzZHo.cjs");
|
|
14
|
-
const require_theme_get = require("./theme-get-D0fH7Jrd.cjs");
|
|
15
14
|
//#region src/style/style.ts
|
|
16
15
|
const style = ({ prop, cssProperty, alias, key, transformValue, scale, properties }) => {
|
|
17
16
|
const config = {};
|
|
@@ -178,7 +177,6 @@ exports.system = require_core.system;
|
|
|
178
177
|
exports.textAlign = textAlign;
|
|
179
178
|
exports.textShadow = require_shadow.shadow;
|
|
180
179
|
exports.textStyle = require_variant.textStyle;
|
|
181
|
-
exports.themeGet = require_theme_get.themeGet;
|
|
182
180
|
exports.top = top;
|
|
183
181
|
exports.typography = require_typography.typography;
|
|
184
182
|
exports.variant = require_variant.variant;
|
package/dist/index.d.cts
CHANGED
|
@@ -11,7 +11,6 @@ import { t as typography } from "./index-BrXslH97.cjs";
|
|
|
11
11
|
import { t as position } from "./index-DS-HZ740.cjs";
|
|
12
12
|
import { t as shadow } from "./index-CvbdNFVK.cjs";
|
|
13
13
|
import { a as variant, i as textStyle, n as buttonStyle, r as colorStyle } from "./index-5FNmSnEI.cjs";
|
|
14
|
-
import { t as themeGet } from "./index-CTguR0fU.cjs";
|
|
15
14
|
|
|
16
15
|
//#region src/style/style.d.ts
|
|
17
16
|
interface StyleOptions {
|
|
@@ -97,4 +96,4 @@ declare const right: Parser;
|
|
|
97
96
|
declare const bottom: Parser;
|
|
98
97
|
declare const left: Parser;
|
|
99
98
|
//#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,
|
|
99
|
+
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, top, typography, variant, verticalAlign, width, zIndex };
|
package/dist/index.d.mts
CHANGED
|
@@ -11,7 +11,6 @@ import { t as typography } from "./index-DzPnzx9p.mjs";
|
|
|
11
11
|
import { t as position } from "./index-Cq-vX0It.mjs";
|
|
12
12
|
import { t as shadow } from "./index-F79chYlR.mjs";
|
|
13
13
|
import { a as variant, i as textStyle, n as buttonStyle, r as colorStyle } from "./index-CeQ5ox80.mjs";
|
|
14
|
-
import { t as themeGet } from "./index-C_ikENGU.mjs";
|
|
15
14
|
|
|
16
15
|
//#region src/style/style.d.ts
|
|
17
16
|
interface StyleOptions {
|
|
@@ -97,4 +96,4 @@ declare const right: Parser;
|
|
|
97
96
|
declare const bottom: Parser;
|
|
98
97
|
declare const left: Parser;
|
|
99
98
|
//#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,
|
|
99
|
+
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, top, typography, variant, verticalAlign, width, zIndex };
|
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,6 @@ import { t as typography } from "./typography-CptBXSy0.mjs";
|
|
|
10
10
|
import { n as padding, r as space, t as margin } from "./space-DEf9-0r9.mjs";
|
|
11
11
|
import { t as shadow } from "./shadow-Bp7lx_41.mjs";
|
|
12
12
|
import { i as variant, n as colorStyle, r as textStyle, t as buttonStyle } from "./variant-DQA9pqwW.mjs";
|
|
13
|
-
import { t as themeGet } from "./theme-get-CwPt9eDy.mjs";
|
|
14
13
|
//#region src/style/style.ts
|
|
15
14
|
const style = ({ prop, cssProperty, alias, key, transformValue, scale, properties }) => {
|
|
16
15
|
const config = {};
|
|
@@ -96,4 +95,4 @@ const right = positionFns.right;
|
|
|
96
95
|
const bottom = positionFns.bottom;
|
|
97
96
|
const left = positionFns.left;
|
|
98
97
|
//#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,
|
|
98
|
+
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, 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/dist/theme-get.cjs
CHANGED
|
@@ -2,6 +2,9 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const require_core = require("./core.cjs");
|
|
6
|
+
//#region src/theme-get/theme-get.ts
|
|
7
|
+
const themeGet = (path, fallback = null) => (props) => require_core.get(props.theme, path, fallback);
|
|
8
|
+
//#endregion
|
|
9
|
+
exports.default = themeGet;
|
|
10
|
+
exports.themeGet = themeGet;
|
package/dist/theme-get.d.cts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as Props } from "./index-C6pWum7i.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/theme-get/theme-get.d.ts
|
|
4
|
+
declare const themeGet: (path: string, fallback?: unknown) => (props: Props) => unknown;
|
|
5
|
+
//#endregion
|
|
2
6
|
export { themeGet as default, themeGet };
|
package/dist/theme-get.d.mts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as Props } from "./index-C6pWum7i.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/theme-get/theme-get.d.ts
|
|
4
|
+
declare const themeGet: (path: string, fallback?: unknown) => (props: Props) => unknown;
|
|
5
|
+
//#endregion
|
|
2
6
|
export { themeGet as default, themeGet };
|
package/dist/theme-get.mjs
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { get } from "./core.mjs";
|
|
2
|
+
//#region src/theme-get/theme-get.ts
|
|
3
|
+
const themeGet = (path, fallback = null) => (props) => get(props.theme, path, fallback);
|
|
4
|
+
//#endregion
|
|
2
5
|
export { themeGet as default, themeGet };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soroush.tech/styled-system",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.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",
|
|
@@ -230,5 +248,60 @@
|
|
|
230
248
|
"test:coverage": "vitest run --coverage"
|
|
231
249
|
},
|
|
232
250
|
"main": "./dist/index.cjs",
|
|
233
|
-
"module": "./dist/index.mjs"
|
|
251
|
+
"module": "./dist/index.mjs",
|
|
252
|
+
"typesVersions": {
|
|
253
|
+
"*": {
|
|
254
|
+
"core": [
|
|
255
|
+
"./dist/core.d.cts"
|
|
256
|
+
],
|
|
257
|
+
"space": [
|
|
258
|
+
"./dist/space.d.cts"
|
|
259
|
+
],
|
|
260
|
+
"color": [
|
|
261
|
+
"./dist/color.d.cts"
|
|
262
|
+
],
|
|
263
|
+
"layout": [
|
|
264
|
+
"./dist/layout.d.cts"
|
|
265
|
+
],
|
|
266
|
+
"typography": [
|
|
267
|
+
"./dist/typography.d.cts"
|
|
268
|
+
],
|
|
269
|
+
"flexbox": [
|
|
270
|
+
"./dist/flexbox.d.cts"
|
|
271
|
+
],
|
|
272
|
+
"grid": [
|
|
273
|
+
"./dist/grid.d.cts"
|
|
274
|
+
],
|
|
275
|
+
"background": [
|
|
276
|
+
"./dist/background.d.cts"
|
|
277
|
+
],
|
|
278
|
+
"border": [
|
|
279
|
+
"./dist/border.d.cts"
|
|
280
|
+
],
|
|
281
|
+
"position": [
|
|
282
|
+
"./dist/position.d.cts"
|
|
283
|
+
],
|
|
284
|
+
"shadow": [
|
|
285
|
+
"./dist/shadow.d.cts"
|
|
286
|
+
],
|
|
287
|
+
"variant": [
|
|
288
|
+
"./dist/variant.d.cts"
|
|
289
|
+
],
|
|
290
|
+
"css": [
|
|
291
|
+
"./dist/css.d.cts"
|
|
292
|
+
],
|
|
293
|
+
"theme-get": [
|
|
294
|
+
"./dist/theme-get.d.cts"
|
|
295
|
+
],
|
|
296
|
+
"props": [
|
|
297
|
+
"./dist/props.d.cts"
|
|
298
|
+
],
|
|
299
|
+
"prop-types": [
|
|
300
|
+
"./dist/prop-types.d.cts"
|
|
301
|
+
],
|
|
302
|
+
"should-forward-prop": [
|
|
303
|
+
"./dist/should-forward-prop.d.cts"
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
}
|
|
234
307
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const require_core = require("./core.cjs");
|
|
2
|
-
//#region src/theme-get/theme-get.ts
|
|
3
|
-
const themeGet = (path, fallback = null) => (props) => require_core.get(props.theme, path, fallback);
|
|
4
|
-
//#endregion
|
|
5
|
-
Object.defineProperty(exports, "themeGet", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return themeGet;
|
|
9
|
-
}
|
|
10
|
-
});
|