@marigold/system 4.2.2 → 5.0.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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Simplify, PolymorphicPropsWithRef, PolymorphicComponentWithRef, ComponentProps, KebabCase } from '@marigold/types';
1
+ import { Simplify, PropsOf, PolymorphicComponent, HtmlProps, KebabCase } from '@marigold/types';
2
2
  import * as _theme_ui_css from '@theme-ui/css';
3
3
  import { ResponsiveStyleValue as ResponsiveStyleValue$1, ThemeUIStyleObject, ThemeUICSSObject, ThemeUICSSProperties, NestedScaleDict } from '@theme-ui/css';
4
4
  import * as react from 'react';
@@ -205,9 +205,7 @@ interface Theme {
205
205
  transitions?: Scale<CSS.Property.Transition>;
206
206
  }
207
207
 
208
- interface StyleProps extends Pick<CSSObject, 'display' | 'height' | 'width' | 'minWidth' | 'maxWidth' | 'position' | 'top' | 'bottom' | 'right' | 'left' | 'zIndex' | 'p' | 'px' | 'py' | 'pt' | 'pb' | 'pl' | 'pr' | 'm' | 'mx' | 'my' | 'mt' | 'mb' | 'ml' | 'mr' | 'flexDirection' | 'flexWrap' | 'flexShrink' | 'flexGrow' | 'alignItems' | 'justifyContent' | 'bg' | 'border' | 'borderRadius' | 'boxShadow' | 'opacity' | 'overflow' | 'transition'> {
209
- }
210
- interface BoxOwnProps extends StyleProps {
208
+ interface BoxOwnProps {
211
209
  css?: CSSObject | CSSObject[];
212
210
  /**
213
211
  * Use to set base styles for the component
@@ -215,9 +213,9 @@ interface BoxOwnProps extends StyleProps {
215
213
  */
216
214
  __baseCSS?: CSSObject;
217
215
  }
218
- interface BoxProps extends PolymorphicPropsWithRef<BoxOwnProps, 'div'> {
216
+ interface BoxProps extends PropsOf<typeof Box> {
219
217
  }
220
- declare const Box: PolymorphicComponentWithRef<BoxOwnProps, 'div'>;
218
+ declare const Box: PolymorphicComponent<"div", BoxOwnProps>;
221
219
 
222
220
  type GlobalProps = {
223
221
  /**
@@ -231,7 +229,7 @@ type GlobalProps = {
231
229
  };
232
230
  declare const Global: ({ normalizeDocument, selector }: GlobalProps) => JSX.Element;
233
231
 
234
- interface SVGProps extends ComponentProps<'svg'> {
232
+ interface SVGProps extends HtmlProps<'svg'> {
235
233
  size?: number | string | number[] | string[];
236
234
  css?: CSSObject;
237
235
  }
@@ -290,4 +288,4 @@ interface ThemeProviderProps<T extends Theme> {
290
288
  }
291
289
  declare function ThemeProvider<T extends Theme>({ theme, children, }: ThemeProviderProps<T>): JSX.Element;
292
290
 
293
- export { Box, BoxOwnProps, BoxProps, CSSObject, CSSProperties, ComponentState, ComponentStyleParts, ComponentStylesProps, Global, GlobalProps, ResponsiveStyleValue, SVG, SVGProps, Scale, ScaleValue, SizeScale, StateAttrKeyProps, StateAttrProps, StyleObject, StyleProps, Theme, ThemeComponentProps, ThemeExtension, ThemeExtensionsWithParts, ThemeProvider, ThemeProviderProps, UseStateProps, ZeroScale, ZeroSizeScale, __defaultTheme, useComponentStyles, useResponsiveValue, useStateProps, useTheme };
291
+ export { Box, BoxOwnProps, BoxProps, CSSObject, CSSProperties, ComponentState, ComponentStyleParts, ComponentStylesProps, Global, GlobalProps, ResponsiveStyleValue, SVG, SVGProps, Scale, ScaleValue, SizeScale, StateAttrKeyProps, StateAttrProps, StyleObject, Theme, ThemeComponentProps, ThemeExtension, ThemeExtensionsWithParts, ThemeProvider, ThemeProviderProps, UseStateProps, ZeroScale, ZeroSizeScale, __defaultTheme, useComponentStyles, useResponsiveValue, useStateProps, useTheme };
package/dist/index.js CHANGED
@@ -121,106 +121,21 @@ var transformPseudos = (styles) => {
121
121
  };
122
122
 
123
123
  // src/components/Box/Box.tsx
124
- var createThemedStyle = ({ __baseCSS, styles, css }) => (theme) => {
124
+ var createThemedStyle = ({ __baseCSS, css }) => (theme) => {
125
125
  const themedStyles = import_deepmerge.default.all([
126
126
  (0, import_css.css)(__baseCSS)(theme),
127
- (0, import_css.css)(styles)(theme),
128
127
  ...Array.isArray(css) ? css.map((c) => (0, import_css.css)(c)(theme)) : [(0, import_css.css)(css)(theme)]
129
128
  ]);
130
129
  return transformPseudos(themedStyles);
131
130
  };
132
131
  var Box = (0, import_react.forwardRef)(
133
- ({
134
- as = "div",
135
- children,
136
- __baseCSS,
137
- css,
138
- display,
139
- height,
140
- width,
141
- minWidth,
142
- maxWidth,
143
- position,
144
- top,
145
- bottom,
146
- right,
147
- left,
148
- zIndex,
149
- p,
150
- px,
151
- py,
152
- pt,
153
- pb,
154
- pl,
155
- pr,
156
- m,
157
- mx,
158
- my,
159
- mt,
160
- mb,
161
- ml,
162
- mr,
163
- flexDirection,
164
- flexWrap,
165
- flexShrink,
166
- flexGrow,
167
- alignItems,
168
- justifyContent,
169
- bg,
170
- border,
171
- borderRadius,
172
- boxShadow,
173
- opacity,
174
- overflow,
175
- transition,
176
- ...props
177
- }, ref) => (0, import_react2.jsx)(
132
+ ({ as = "div", children, __baseCSS, css, ...props }, ref) => (0, import_react2.jsx)(
178
133
  as,
179
134
  {
180
135
  ...props,
181
136
  css: createThemedStyle({
182
137
  __baseCSS,
183
- css,
184
- styles: {
185
- display,
186
- height,
187
- width,
188
- minWidth,
189
- maxWidth,
190
- position,
191
- top,
192
- bottom,
193
- right,
194
- left,
195
- zIndex,
196
- p,
197
- px,
198
- py,
199
- pt,
200
- pb,
201
- pl,
202
- pr,
203
- m,
204
- mx,
205
- my,
206
- mt,
207
- mb,
208
- ml,
209
- mr,
210
- flexDirection,
211
- flexWrap,
212
- flexShrink,
213
- flexGrow,
214
- alignItems,
215
- justifyContent,
216
- bg,
217
- border,
218
- borderRadius,
219
- boxShadow,
220
- opacity,
221
- overflow,
222
- transition
223
- }
138
+ css
224
139
  }),
225
140
  ref
226
141
  },
package/dist/index.mjs CHANGED
@@ -81,106 +81,21 @@ var transformPseudos = (styles) => {
81
81
  };
82
82
 
83
83
  // src/components/Box/Box.tsx
84
- var createThemedStyle = ({ __baseCSS, styles, css }) => (theme) => {
84
+ var createThemedStyle = ({ __baseCSS, css }) => (theme) => {
85
85
  const themedStyles = merge.all([
86
86
  transformStyleObject(__baseCSS)(theme),
87
- transformStyleObject(styles)(theme),
88
87
  ...Array.isArray(css) ? css.map((c) => transformStyleObject(c)(theme)) : [transformStyleObject(css)(theme)]
89
88
  ]);
90
89
  return transformPseudos(themedStyles);
91
90
  };
92
91
  var Box = forwardRef(
93
- ({
94
- as = "div",
95
- children,
96
- __baseCSS,
97
- css,
98
- display,
99
- height,
100
- width,
101
- minWidth,
102
- maxWidth,
103
- position,
104
- top,
105
- bottom,
106
- right,
107
- left,
108
- zIndex,
109
- p,
110
- px,
111
- py,
112
- pt,
113
- pb,
114
- pl,
115
- pr,
116
- m,
117
- mx,
118
- my,
119
- mt,
120
- mb,
121
- ml,
122
- mr,
123
- flexDirection,
124
- flexWrap,
125
- flexShrink,
126
- flexGrow,
127
- alignItems,
128
- justifyContent,
129
- bg,
130
- border,
131
- borderRadius,
132
- boxShadow,
133
- opacity,
134
- overflow,
135
- transition,
136
- ...props
137
- }, ref) => jsx(
92
+ ({ as = "div", children, __baseCSS, css, ...props }, ref) => jsx(
138
93
  as,
139
94
  {
140
95
  ...props,
141
96
  css: createThemedStyle({
142
97
  __baseCSS,
143
- css,
144
- styles: {
145
- display,
146
- height,
147
- width,
148
- minWidth,
149
- maxWidth,
150
- position,
151
- top,
152
- bottom,
153
- right,
154
- left,
155
- zIndex,
156
- p,
157
- px,
158
- py,
159
- pt,
160
- pb,
161
- pl,
162
- pr,
163
- m,
164
- mx,
165
- my,
166
- mt,
167
- mb,
168
- ml,
169
- mr,
170
- flexDirection,
171
- flexWrap,
172
- flexShrink,
173
- flexGrow,
174
- alignItems,
175
- justifyContent,
176
- bg,
177
- border,
178
- borderRadius,
179
- boxShadow,
180
- opacity,
181
- overflow,
182
- transition
183
- }
98
+ css
184
99
  }),
185
100
  ref
186
101
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marigold/system",
3
- "version": "4.2.2",
3
+ "version": "5.0.0",
4
4
  "description": "Marigold System Library",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -31,7 +31,7 @@
31
31
  "csstype": "3.1.1",
32
32
  "deepmerge": "^4.2.2",
33
33
  "react-fast-compare": "^3.2.0",
34
- "@marigold/types": "0.5.7"
34
+ "@marigold/types": "1.0.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": "16.x || 17.x || 18.x",