@marigold/system 5.0.0 → 5.2.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
@@ -4,6 +4,7 @@ import { ResponsiveStyleValue as ResponsiveStyleValue$1, ThemeUIStyleObject, The
4
4
  import * as react from 'react';
5
5
  import { ReactNode } from 'react';
6
6
  import * as CSS from 'csstype';
7
+ export { keyframes } from '@emotion/react';
7
8
 
8
9
  type ResponsiveStyleValue<T> = ResponsiveStyleValue$1<T>;
9
10
  type StyleObject = ThemeUIStyleObject;
package/dist/index.js CHANGED
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
25
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
26
  mod
23
27
  ));
@@ -31,6 +35,7 @@ __export(src_exports, {
31
35
  SVG: () => SVG,
32
36
  ThemeProvider: () => ThemeProvider,
33
37
  __defaultTheme: () => __defaultTheme,
38
+ keyframes: () => import_react12.keyframes,
34
39
  useComponentStyles: () => useComponentStyles,
35
40
  useResponsiveValue: () => useResponsiveValue,
36
41
  useStateProps: () => useStateProps,
@@ -82,6 +87,7 @@ var pseudos = {
82
87
  "&:error": createteSelector([selector.self], state.error),
83
88
  "&:expanded": createteSelector([selector.self], state.expanded),
84
89
  "&:required": createteSelector([selector.self], state.required),
90
+ // Selector for elements that are part of a group
85
91
  "&:in-group": createteSelector(selector.grouped, state.none, selector.self),
86
92
  "&:hover-group": createteSelector(
87
93
  selector.grouped,
@@ -166,11 +172,7 @@ function ThemeProvider({
166
172
  theme,
167
173
  children
168
174
  }) {
169
- return /* @__PURE__ */ import_react3.default.createElement(import_react4.ThemeProvider, {
170
- theme
171
- }, /* @__PURE__ */ import_react3.default.createElement(InternalContext.Provider, {
172
- value: theme
173
- }, children));
175
+ return /* @__PURE__ */ import_react3.default.createElement(import_react4.ThemeProvider, { theme }, /* @__PURE__ */ import_react3.default.createElement(InternalContext.Provider, { value: theme }, children));
174
176
  }
175
177
 
176
178
  // src/components/Global/normalize.ts
@@ -179,13 +181,25 @@ var document = {
179
181
  height: "100%"
180
182
  },
181
183
  html: {
184
+ /**
185
+ * Prevent Mobile Safari from zooming stuff ...
186
+ * Source: https://css-tricks.com/your-css-reset-needs-text-size-adjust-probably/
187
+ */
182
188
  textSizeAdjust: "none"
183
189
  },
184
190
  body: {
185
191
  lineHeight: 1.5,
186
192
  WebkitFontSmoothing: "antialiased",
193
+ /**
194
+ * We have to duplicate this here, since the "*" selector will not be
195
+ * applied to the body element if a custom `selector` is used.
196
+ */
187
197
  margin: 0
188
198
  },
199
+ /**
200
+ * CSS snippet and idea from:
201
+ * https://css-tricks.com/revisiting-prefers-reduced-motion-the-reduced-motion-media-query/
202
+ */
189
203
  "@media screen and (prefers-reduced-motion: reduce), (update: slow)": {
190
204
  "*": {
191
205
  animationDuration: "0.001ms !important",
@@ -211,6 +225,10 @@ var element = {
211
225
  display: "block",
212
226
  maxWidth: "100%"
213
227
  },
228
+ /**
229
+ * No `maxWidth` for SVG since this makes them responsive
230
+ * and will cause icons to shrink.
231
+ */
214
232
  svg: {
215
233
  display: "block",
216
234
  fill: "currentColor"
@@ -249,17 +267,23 @@ var element = {
249
267
  };
250
268
 
251
269
  // src/components/Global/Global.tsx
270
+ var mergeRoot = ({ body, ...rest }) => typeof body === "object" ? {
271
+ ...body,
272
+ ...rest
273
+ } : {
274
+ body,
275
+ ...rest
276
+ };
252
277
  var Global = ({ normalizeDocument = true, selector: selector2 }) => {
253
278
  const { css, theme } = useTheme();
254
279
  const rootStyles = css((theme == null ? void 0 : theme.root) || {});
255
280
  const styles = [
256
281
  normalizeDocument ? document : {},
282
+ // Prefix normalization and root styles with selector if provided.
257
283
  selector2 ? { [`:where(${selector2})`]: element } : element,
258
- selector2 ? { [`:where(${selector2})`]: rootStyles } : rootStyles
284
+ selector2 ? { [`:where(${selector2})`]: mergeRoot(rootStyles) } : rootStyles
259
285
  ];
260
- return /* @__PURE__ */ import_react5.default.createElement(import_react6.Global, {
261
- styles
262
- });
286
+ return /* @__PURE__ */ import_react5.default.createElement(import_react6.Global, { styles });
263
287
  };
264
288
 
265
289
  // src/components/SVG/SVG.tsx
@@ -375,6 +399,9 @@ var SVG = (0, import_react10.forwardRef)(
375
399
  );
376
400
  }
377
401
  );
402
+
403
+ // src/keyframes.ts
404
+ var import_react12 = require("@emotion/react");
378
405
  // Annotate the CommonJS export names for ESM import in node:
379
406
  0 && (module.exports = {
380
407
  Box,
@@ -382,6 +409,7 @@ var SVG = (0, import_react10.forwardRef)(
382
409
  SVG,
383
410
  ThemeProvider,
384
411
  __defaultTheme,
412
+ keyframes,
385
413
  useComponentStyles,
386
414
  useResponsiveValue,
387
415
  useStateProps,
package/dist/index.mjs CHANGED
@@ -42,6 +42,7 @@ var pseudos = {
42
42
  "&:error": createteSelector([selector.self], state.error),
43
43
  "&:expanded": createteSelector([selector.self], state.expanded),
44
44
  "&:required": createteSelector([selector.self], state.required),
45
+ // Selector for elements that are part of a group
45
46
  "&:in-group": createteSelector(selector.grouped, state.none, selector.self),
46
47
  "&:hover-group": createteSelector(
47
48
  selector.grouped,
@@ -133,11 +134,7 @@ function ThemeProvider({
133
134
  theme,
134
135
  children
135
136
  }) {
136
- return /* @__PURE__ */ React.createElement(EmotionProvider, {
137
- theme
138
- }, /* @__PURE__ */ React.createElement(InternalContext.Provider, {
139
- value: theme
140
- }, children));
137
+ return /* @__PURE__ */ React.createElement(EmotionProvider, { theme }, /* @__PURE__ */ React.createElement(InternalContext.Provider, { value: theme }, children));
141
138
  }
142
139
 
143
140
  // src/components/Global/normalize.ts
@@ -146,13 +143,25 @@ var document = {
146
143
  height: "100%"
147
144
  },
148
145
  html: {
146
+ /**
147
+ * Prevent Mobile Safari from zooming stuff ...
148
+ * Source: https://css-tricks.com/your-css-reset-needs-text-size-adjust-probably/
149
+ */
149
150
  textSizeAdjust: "none"
150
151
  },
151
152
  body: {
152
153
  lineHeight: 1.5,
153
154
  WebkitFontSmoothing: "antialiased",
155
+ /**
156
+ * We have to duplicate this here, since the "*" selector will not be
157
+ * applied to the body element if a custom `selector` is used.
158
+ */
154
159
  margin: 0
155
160
  },
161
+ /**
162
+ * CSS snippet and idea from:
163
+ * https://css-tricks.com/revisiting-prefers-reduced-motion-the-reduced-motion-media-query/
164
+ */
156
165
  "@media screen and (prefers-reduced-motion: reduce), (update: slow)": {
157
166
  "*": {
158
167
  animationDuration: "0.001ms !important",
@@ -178,6 +187,10 @@ var element = {
178
187
  display: "block",
179
188
  maxWidth: "100%"
180
189
  },
190
+ /**
191
+ * No `maxWidth` for SVG since this makes them responsive
192
+ * and will cause icons to shrink.
193
+ */
181
194
  svg: {
182
195
  display: "block",
183
196
  fill: "currentColor"
@@ -216,17 +229,23 @@ var element = {
216
229
  };
217
230
 
218
231
  // src/components/Global/Global.tsx
232
+ var mergeRoot = ({ body, ...rest }) => typeof body === "object" ? {
233
+ ...body,
234
+ ...rest
235
+ } : {
236
+ body,
237
+ ...rest
238
+ };
219
239
  var Global = ({ normalizeDocument = true, selector: selector2 }) => {
220
240
  const { css, theme } = useTheme();
221
241
  const rootStyles = css((theme == null ? void 0 : theme.root) || {});
222
242
  const styles = [
223
243
  normalizeDocument ? document : {},
244
+ // Prefix normalization and root styles with selector if provided.
224
245
  selector2 ? { [`:where(${selector2})`]: element } : element,
225
- selector2 ? { [`:where(${selector2})`]: rootStyles } : rootStyles
246
+ selector2 ? { [`:where(${selector2})`]: mergeRoot(rootStyles) } : rootStyles
226
247
  ];
227
- return /* @__PURE__ */ React2.createElement(EmotionGlobal, {
228
- styles
229
- });
248
+ return /* @__PURE__ */ React2.createElement(EmotionGlobal, { styles });
230
249
  };
231
250
 
232
251
  // src/components/SVG/SVG.tsx
@@ -342,12 +361,16 @@ var SVG = forwardRef2(
342
361
  );
343
362
  }
344
363
  );
364
+
365
+ // src/keyframes.ts
366
+ import { keyframes } from "@emotion/react";
345
367
  export {
346
368
  Box,
347
369
  Global,
348
370
  SVG,
349
371
  ThemeProvider,
350
372
  __defaultTheme,
373
+ keyframes,
351
374
  useComponentStyles,
352
375
  useResponsiveValue,
353
376
  useStateProps,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marigold/system",
3
- "version": "5.0.0",
3
+ "version": "5.2.0",
4
4
  "description": "Marigold System Library",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -26,8 +26,8 @@
26
26
  "directory": "packages/system"
27
27
  },
28
28
  "dependencies": {
29
- "@emotion/react": "11.10.5",
30
- "@theme-ui/css": "0.15.4",
29
+ "@emotion/react": "11.10.6",
30
+ "@theme-ui/css": "0.15.5",
31
31
  "csstype": "3.1.1",
32
32
  "deepmerge": "^4.2.2",
33
33
  "react-fast-compare": "^3.2.0",
@@ -38,9 +38,9 @@
38
38
  "react-dom": "16.x || 17.x || 18.x"
39
39
  },
40
40
  "devDependencies": {
41
- "@babel/core": "7.20.12",
41
+ "@babel/core": "7.21.0",
42
42
  "react": "18.2.0",
43
- "tsup": "6.5.0",
43
+ "tsup": "6.6.3",
44
44
  "@marigold/tsconfig": "0.4.0"
45
45
  },
46
46
  "scripts": {