Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mirohq/design-system-utils

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mirohq/design-system-utils - npm Package Compare versions

Comparing version 0.10.0 to 0.11.0

8

dist/main.js

@@ -16,2 +16,9 @@ 'use strict';

const isFragment = (fragment) => (fragment == null ? void 0 : fragment.type) === react.Fragment || fragment === react.Fragment;
const addPropsToChildren = (children, containsComponent, props) => react.Children.map(react.Children.toArray(children), (child) => {
const childElement = child;
if (containsComponent(childElement)) {
return react.cloneElement(childElement, { ...childElement.props, ...props });
}
return children;
});

@@ -31,2 +38,3 @@ const mapKeysToVariants = (map, prop) => Object.keys(map).reduce((acc, key) => {

exports.addPropsToChildren = addPropsToChildren;
exports.createConstants = createConstants;

@@ -33,0 +41,0 @@ exports.isFragment = isFragment;

11

dist/module.js

@@ -1,2 +0,2 @@

import { Fragment } from 'react';
import { Fragment, Children, cloneElement } from 'react';

@@ -12,2 +12,9 @@ const createConstants = (...constants) => constants.reduce(

const isFragment = (fragment) => (fragment == null ? void 0 : fragment.type) === Fragment || fragment === Fragment;
const addPropsToChildren = (children, containsComponent, props) => Children.map(Children.toArray(children), (child) => {
const childElement = child;
if (containsComponent(childElement)) {
return cloneElement(childElement, { ...childElement.props, ...props });
}
return children;
});

@@ -27,3 +34,3 @@ const mapKeysToVariants = (map, prop) => Object.keys(map).reduce((acc, key) => {

export { createConstants, isFragment, mapKeysToVariants };
export { addPropsToChildren, createConstants, isFragment, mapKeysToVariants };
//# sourceMappingURL=module.js.map

@@ -0,1 +1,2 @@

import { ReactNode, ReactElement } from 'react';
import * as _stitches_react_types_css_util from '@stitches/react/types/css-util';

@@ -7,2 +8,10 @@ import { CSSProperties } from '@stitches/react';

declare const isFragment: (fragment: any) => boolean;
/**
* Search a specific component by displayName inside of a children and replaces or adds a set of new props.
* @param children ReactNode where the search for the component by name will take place.
* @param containsComponent Function validating if props should be overridden.
* @param props props to be merged with existing props from the targe component.
* @returns Same children element but with the component and its props replaced if it was found.
*/
declare const addPropsToChildren: <T>(children: ReactNode, containsComponent: (child: ReactElement) => boolean, props: Partial<T>) => ReactNode;

@@ -25,2 +34,2 @@ declare type KeyVariants<KeyMap, Prop extends keyof CSSProperties> = {

export { createConstants, isFragment, mapKeysToVariants };
export { addPropsToChildren, createConstants, isFragment, mapKeysToVariants };

2

package.json
{
"name": "@mirohq/design-system-utils",
"version": "0.10.0",
"version": "0.11.0",
"description": "",

@@ -5,0 +5,0 @@ "author": "Miro",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc