@marigold/system 1.3.0 → 2.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
@@ -119,7 +119,9 @@ interface Theme {
119
119
  * for full page apps or an element if you're only using Marigold on a portion of the page.
120
120
  * This is useful for additional normalizationor and to style non-Marigold elements.
121
121
  */
122
- root?: CSSObject;
122
+ root?: {
123
+ [key: string]: CSSObject;
124
+ };
123
125
  /**
124
126
  * To configure the default breakpoints used in responsive array values,
125
127
  * add a breakpoints array to your theme.
@@ -231,8 +233,9 @@ declare const Global: ({ normalizeDocument, selector }: GlobalProps) => JSX.Elem
231
233
 
232
234
  interface SVGProps extends ComponentProps<'svg'> {
233
235
  size?: number | string | number[] | string[];
236
+ css?: CSSObject;
234
237
  }
235
- declare const SVG: ({ size, fill, children, ...props }: SVGProps) => react.ReactSVGElement;
238
+ declare const SVG: react.ForwardRefExoticComponent<SVGProps & react.RefAttributes<SVGElement>>;
236
239
 
237
240
  interface ComponentStylesProps {
238
241
  variant?: string;
package/dist/index.js CHANGED
@@ -343,7 +343,8 @@ var Global = ({ normalizeDocument = true, selector: selector2 }) => {
343
343
  };
344
344
 
345
345
  // src/components/SVG/SVG.tsx
346
- var import_react10 = require("@emotion/react");
346
+ var import_react10 = require("react");
347
+ var import_react11 = require("@emotion/react");
347
348
 
348
349
  // src/hooks/useComponentStyles.ts
349
350
  var import_deepmerge2 = __toESM(require("deepmerge"));
@@ -434,27 +435,25 @@ var useStateProps = (states) => {
434
435
  // src/components/SVG/SVG.tsx
435
436
  var toDimension = (value) => Array.isArray(value) ? value.map(ensureNumberOrToken) : ensureNumberOrToken(value);
436
437
  var ensureNumberOrToken = (value) => typeof value === "string" && /[0-9]+/.test(value) ? Number(value) : value;
437
- var SVG = ({
438
- size = 24,
439
- fill = "currentcolor",
440
- children,
441
- ...props
442
- }) => {
443
- const { css } = useTheme();
444
- return (0, import_react10.jsx)(
445
- "svg",
446
- {
447
- viewBox: "0 0 24 24",
448
- css: css({
449
- fill,
450
- width: toDimension(props.width || size),
451
- height: toDimension(props.height || size)
452
- }),
453
- ...props
454
- },
455
- children
456
- );
457
- };
438
+ var SVG = (0, import_react10.forwardRef)(
439
+ ({ size = 24, fill = "currentcolor", children, css: styles, ...props }, ref) => {
440
+ const { css } = useTheme();
441
+ return (0, import_react11.jsx)(
442
+ "svg",
443
+ {
444
+ ...props,
445
+ css: css({
446
+ ...styles,
447
+ fill,
448
+ width: toDimension(props.width || size),
449
+ height: toDimension(props.height || size)
450
+ }),
451
+ ref
452
+ },
453
+ children
454
+ );
455
+ }
456
+ );
458
457
  // Annotate the CommonJS export names for ESM import in node:
459
458
  0 && (module.exports = {
460
459
  Box,
package/dist/index.mjs CHANGED
@@ -310,6 +310,7 @@ var Global = ({ normalizeDocument = true, selector: selector2 }) => {
310
310
  };
311
311
 
312
312
  // src/components/SVG/SVG.tsx
313
+ import { forwardRef as forwardRef2 } from "react";
313
314
  import { jsx as jsx2 } from "@emotion/react";
314
315
 
315
316
  // src/hooks/useComponentStyles.ts
@@ -401,27 +402,25 @@ var useStateProps = (states) => {
401
402
  // src/components/SVG/SVG.tsx
402
403
  var toDimension = (value) => Array.isArray(value) ? value.map(ensureNumberOrToken) : ensureNumberOrToken(value);
403
404
  var ensureNumberOrToken = (value) => typeof value === "string" && /[0-9]+/.test(value) ? Number(value) : value;
404
- var SVG = ({
405
- size = 24,
406
- fill = "currentcolor",
407
- children,
408
- ...props
409
- }) => {
410
- const { css } = useTheme();
411
- return jsx2(
412
- "svg",
413
- {
414
- viewBox: "0 0 24 24",
415
- css: css({
416
- fill,
417
- width: toDimension(props.width || size),
418
- height: toDimension(props.height || size)
419
- }),
420
- ...props
421
- },
422
- children
423
- );
424
- };
405
+ var SVG = forwardRef2(
406
+ ({ size = 24, fill = "currentcolor", children, css: styles, ...props }, ref) => {
407
+ const { css } = useTheme();
408
+ return jsx2(
409
+ "svg",
410
+ {
411
+ ...props,
412
+ css: css({
413
+ ...styles,
414
+ fill,
415
+ width: toDimension(props.width || size),
416
+ height: toDimension(props.height || size)
417
+ }),
418
+ ref
419
+ },
420
+ children
421
+ );
422
+ }
423
+ );
425
424
  export {
426
425
  Box,
427
426
  Global,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marigold/system",
3
- "version": "1.3.0",
3
+ "version": "2.0.0",
4
4
  "description": "Marigold System Library",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -26,9 +26,9 @@
26
26
  "directory": "packages/system"
27
27
  },
28
28
  "dependencies": {
29
- "@emotion/react": "11.9.3",
29
+ "@emotion/react": "11.10.0",
30
30
  "@marigold/types": "0.5.2",
31
- "@theme-ui/css": "0.14.6",
31
+ "@theme-ui/css": "0.14.7",
32
32
  "csstype": "3.1.0",
33
33
  "deepmerge": "^4.2.2",
34
34
  "react-fast-compare": "^3.2.0"
@@ -38,10 +38,10 @@
38
38
  "react-dom": "16.x || 17.x || 18.x"
39
39
  },
40
40
  "devDependencies": {
41
- "@babel/core": "7.18.9",
41
+ "@babel/core": "7.18.10",
42
42
  "@marigold/tsconfig": "0.3.0",
43
43
  "react": "18.2.0",
44
- "tsup": "6.1.3"
44
+ "tsup": "6.2.2"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "tsup src/index.ts",