@ag.ds-next/core
Advanced tools
Comparing version 2.2.1 to 3.0.0
# @ag.ds-next/core | ||
## 3.0.0 | ||
### Major Changes | ||
- c248ec2e: Updated default link component to include `forwardRef` | ||
### Minor Changes | ||
- 8ddb8b61: Add support for React version 18 | ||
- 00cbe00f: Created new `mergeRefs` utilty function | ||
### Patch Changes | ||
- 6fa3aa60: Fixed small eslint warnings after updating import order rule | ||
- afdc5214: Fixed small eslint warnings | ||
- 6c5d1563: Removed color from `LinkProps` | ||
## 2.2.1 | ||
@@ -4,0 +21,0 @@ |
@@ -50,6 +50,25 @@ 'use strict'; | ||
function DefaultLinkComponent(props) { | ||
return react$1.jsx("a", props); | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
const DefaultLinkComponent = react.forwardRef(function DefaultLinkComponent(props, ref) { | ||
return react$1.jsx("a", _extends({ | ||
ref: ref | ||
}, props)); | ||
}); | ||
const coreContext = react.createContext({ | ||
@@ -432,3 +451,3 @@ linkComponent: DefaultLinkComponent | ||
} | ||
}, process.env.NODE_ENV === "production" ? "" : ";label:Core;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvcmUudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJCSSIsImZpbGUiOiJDb3JlLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFByb3BzV2l0aENoaWxkcmVuIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgR2xvYmFsIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5pbXBvcnQgeyBnb2xkVGhlbWUgfSBmcm9tIC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XG5cdFx0XHRcdFx0XHQvLyBSZXNldCB0aGUgZ2xvYmFsIHRoZW1lIGluIHByaW50IG1vZGUgdG8gYmxhY2sgJiB3aGl0ZVxuXHRcdFx0XHRcdFx0Ly8gTm90ZTogQ29tcG9uZW50cyBjYW4gYWxzbyBjb250YWluIHByaW50IHNwZWNpZmljIHN0eWxlc1xuXHRcdFx0XHRcdFx0J0BtZWRpYSBwcmludCc6IHtcblx0XHRcdFx0XHRcdFx0Jzpyb290JzogbWVyZ2VUaGVtZShnb2xkVGhlbWUsIHByaW50VGhlbWUpLFxuXHRcdFx0XHRcdFx0fSxcblx0XHRcdFx0XHR9LFxuXHRcdFx0XHRcdHtcblx0XHRcdFx0XHRcdC8vIEFwcGx5IHRoZSBsaWdodCBwYWxsZXQgYnkgZGVmYXVsdFxuXHRcdFx0XHRcdFx0J2JvZHksaHRtbCc6IGJveFBhbGV0dGVzLmxpZ2h0LFxuXHRcdFx0XHRcdH0sXG5cdFx0XHRcdFx0YXBwbHlSZXNldCAmJiB7XG5cdFx0XHRcdFx0XHQvLyBGSVhNRTogYXBwbHkgdGhlIGNzcyByZXNldFxuXHRcdFx0XHRcdFx0J2JvZHksIGh0bWwnOiB7XG5cdFx0XHRcdFx0XHRcdG1hcmdpbjogMCxcblx0XHRcdFx0XHRcdFx0cGFkZGluZzogMCxcblx0XHRcdFx0XHRcdFx0YmFja2dyb3VuZDogYm94UGFsZXR0ZS5iYWNrZ3JvdW5kQm9keSxcblx0XHRcdFx0XHRcdFx0Zm9udEZhbWlseTogdG9rZW5zLmZvbnQuYm9keSxcblx0XHRcdFx0XHRcdH0sXG5cdFx0XHRcdFx0fSxcblx0XHRcdFx0XX1cblx0XHRcdC8+XG5cdFx0XHR7Y2hpbGRyZW59XG5cdFx0PC9Db3JlUHJvdmlkZXI+XG5cdCk7XG59XG4iXX0= */"] | ||
}, process.env.NODE_ENV === "production" ? "" : ";label:Core;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;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FsZXR0ZS5iYWNrZ3JvdW5kQm9keSxcblx0XHRcdFx0XHRcdFx0Zm9udEZhbWlseTogdG9rZW5zLmZvbnQuYm9keSxcblx0XHRcdFx0XHRcdH0sXG5cdFx0XHRcdFx0fSxcblx0XHRcdFx0XX1cblx0XHRcdC8+XG5cdFx0XHR7Y2hpbGRyZW59XG5cdFx0PC9Db3JlUHJvdmlkZXI+XG5cdCk7XG59XG4iXX0= */"] | ||
}), children); | ||
@@ -549,3 +568,3 @@ } | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
/* | ||
@@ -561,2 +580,21 @@ forwardRefWithAs lets us forward refs while keeping the correct component type, | ||
/** | ||
* Sometimes we need both a local ref _and_ a forwarded ref for the same element. | ||
* This utility merges them for us (as React doesn't offer this natively). | ||
* | ||
* @see https://github.com/gregberge/react-merge-refs/blob/main/src/index.tsx | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function mergeRefs(refs) { | ||
return value => { | ||
refs.forEach(ref => { | ||
if (typeof ref === 'function') { | ||
ref(value); | ||
} else if (ref != null) { | ||
ref.current = value; | ||
} | ||
}); | ||
}; | ||
} | ||
const control = { | ||
@@ -697,2 +735,3 @@ sm: { | ||
exports.mapSpacing = mapSpacing; | ||
exports.mergeRefs = mergeRefs; | ||
exports.mergeTheme = mergeTheme; | ||
@@ -699,0 +738,0 @@ exports.mq = mq; |
@@ -50,6 +50,25 @@ 'use strict'; | ||
function DefaultLinkComponent(props) { | ||
return react$1.jsx("a", props); | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
const DefaultLinkComponent = react.forwardRef(function DefaultLinkComponent(props, ref) { | ||
return react$1.jsx("a", _extends({ | ||
ref: ref | ||
}, props)); | ||
}); | ||
const coreContext = react.createContext({ | ||
@@ -548,3 +567,3 @@ linkComponent: DefaultLinkComponent | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
/* | ||
@@ -560,2 +579,21 @@ forwardRefWithAs lets us forward refs while keeping the correct component type, | ||
/** | ||
* Sometimes we need both a local ref _and_ a forwarded ref for the same element. | ||
* This utility merges them for us (as React doesn't offer this natively). | ||
* | ||
* @see https://github.com/gregberge/react-merge-refs/blob/main/src/index.tsx | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function mergeRefs(refs) { | ||
return value => { | ||
refs.forEach(ref => { | ||
if (typeof ref === 'function') { | ||
ref(value); | ||
} else if (ref != null) { | ||
ref.current = value; | ||
} | ||
}); | ||
}; | ||
} | ||
const control = { | ||
@@ -696,2 +734,3 @@ sm: { | ||
exports.mapSpacing = mapSpacing; | ||
exports.mergeRefs = mergeRefs; | ||
exports.mergeTheme = mergeTheme; | ||
@@ -698,0 +737,0 @@ exports.mq = mq; |
import { jsx, css, Global } from '@emotion/react'; | ||
import { createContext, useContext, useState, useCallback, useEffect, forwardRef } from 'react'; | ||
import { forwardRef, createContext, useContext, useState, useCallback, useEffect } from 'react'; | ||
import facepaint from 'facepaint'; | ||
@@ -42,6 +42,25 @@ | ||
function DefaultLinkComponent(props) { | ||
return jsx("a", props); | ||
function _extends() { | ||
_extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
const DefaultLinkComponent = forwardRef(function DefaultLinkComponent(props, ref) { | ||
return jsx("a", _extends({ | ||
ref: ref | ||
}, props)); | ||
}); | ||
const coreContext = createContext({ | ||
@@ -424,3 +443,3 @@ linkComponent: DefaultLinkComponent | ||
} | ||
}, process.env.NODE_ENV === "production" ? "" : ";label:Core;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvcmUudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJCSSIsImZpbGUiOiJDb3JlLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFByb3BzV2l0aENoaWxkcmVuIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgR2xvYmFsIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5pbXBvcnQgeyBnb2xkVGhlbWUgfSBmcm9tICcuL2dvbGRUaGVtZSc7XG5pbXBvcnQgeyBDb3JlUHJvdmlkZXIsIENvcmVQcm92aWRlclByb3BzIH0gZnJvbSAnLi9jb250ZXh0JztcbmltcG9ydCB7IG1lcmdlVGhlbWUsIFRoZW1lIH0gZnJvbSAnLi90aGVtZSc7XG5pbXBvcnQgeyBib3hQYWxldHRlcywgYm94UGFsZXR0ZSB9IGZyb20gJy4vYm94UGFsZXR0ZSc7XG5pbXBvcnQgeyB0b2tlbnMgfSBmcm9tICcuL3Rva2Vucyc7XG5pbXBvcnQgeyBnZW5lcmF0ZUZvbnRHcmlkIH0gZnJvbSAnLi91dGlscy9mb250R3JpZCc7XG5pbXBvcnQgeyBwcmludFRoZW1lIH0gZnJvbSAnLi9wcmludFRoZW1lJztcblxuZXhwb3J0IHR5cGUgQ29yZVByb3BzID0gUHJvcHNXaXRoQ2hpbGRyZW48XG5cdHtcblx0XHR0aGVtZT86IFRoZW1lO1xuXHRcdGFwcGx5UmVzZXQ/OiBib29sZWFuO1xuXHR9ICYgQ29yZVByb3ZpZGVyUHJvcHNcbj47XG5cbmV4cG9ydCBmdW5jdGlvbiBDb3JlKHtcblx0Y2hpbGRyZW4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h0bWwnOiB7XG5cdFx0XHRcdFx0XHRcdG1hcmdpbjogMCxcblx0XHRcdFx0XHRcdFx0cGFkZGluZzogMCxcblx0XHRcdFx0XHRcdFx0YmFja2dyb3VuZDogYm94UGFsZXR0ZS5iYWNrZ3JvdW5kQm9keSxcblx0XHRcdFx0XHRcdFx0Zm9udEZhbWlseTogdG9rZW5zLmZvbnQuYm9keSxcblx0XHRcdFx0XHRcdH0sXG5cdFx0XHRcdFx0fSxcblx0XHRcdFx0XX1cblx0XHRcdC8+XG5cdFx0XHR7Y2hpbGRyZW59XG5cdFx0PC9Db3JlUHJvdmlkZXI+XG5cdCk7XG59XG4iXX0= */"] | ||
}, process.env.NODE_ENV === "production" ? "" : ";label:Core;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvcmUudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBCSSIsImZpbGUiOiJDb3JlLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFByb3BzV2l0aENoaWxkcmVuIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgR2xvYmFsIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgZ29sZFRoZW1lIH0gZnJvbSAnLi9nb2xkVGhlbWUnO1xuaW1wb3J0IHsgQ29yZVByb3ZpZGVyLCBDb3JlUHJvdmlkZXJQcm9wcyB9IGZyb20gJy4vQ29yZVByb3ZpZGVyJztcbmltcG9ydCB7IG1lcmdlVGhlbWUsIFRoZW1lIH0gZnJvbSAnLi90aGVtZSc7XG5pbXBvcnQgeyBib3hQYWxldHRlcywgYm94UGFsZXR0ZSB9IGZyb20gJy4vYm94UGFsZXR0ZSc7XG5pbXBvcnQgeyB0b2tlbnMgfSBmcm9tICcuL3Rva2Vucyc7XG5pbXBvcnQgeyBnZW5lcmF0ZUZvbnRHcmlk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x0fSxcblx0XHRcdFx0XHR9LFxuXHRcdFx0XHRcdHtcblx0XHRcdFx0XHRcdC8vIEFwcGx5IHRoZSBsaWdodCBwYWxsZXQgYnkgZGVmYXVsdFxuXHRcdFx0XHRcdFx0J2JvZHksaHRtbCc6IGJveFBhbGV0dGVzLmxpZ2h0LFxuXHRcdFx0XHRcdH0sXG5cdFx0XHRcdFx0YXBwbHlSZXNldCAmJiB7XG5cdFx0XHRcdFx0XHQvLyBGSVhNRTogYXBwbHkgdGhlIGNzcyByZXNldFxuXHRcdFx0XHRcdFx0J2JvZHksIGh0bWwnOiB7XG5cdFx0XHRcdFx0XHRcdG1hcmdpbjogMCxcblx0XHRcdFx0XHRcdFx0cGFkZGluZzogMCxcblx0XHRcdFx0XHRcdFx0YmFja2dyb3VuZDogYm94UGFsZXR0ZS5iYWNrZ3JvdW5kQm9keSxcblx0XHRcdFx0XHRcdFx0Zm9udEZhbWlseTogdG9rZW5zLmZvbnQuYm9keSxcblx0XHRcdFx0XHRcdH0sXG5cdFx0XHRcdFx0fSxcblx0XHRcdFx0XX1cblx0XHRcdC8+XG5cdFx0XHR7Y2hpbGRyZW59XG5cdFx0PC9Db3JlUHJvdmlkZXI+XG5cdCk7XG59XG4iXX0= */"] | ||
}), children); | ||
@@ -541,3 +560,3 @@ } | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
/* | ||
@@ -553,2 +572,21 @@ forwardRefWithAs lets us forward refs while keeping the correct component type, | ||
/** | ||
* Sometimes we need both a local ref _and_ a forwarded ref for the same element. | ||
* This utility merges them for us (as React doesn't offer this natively). | ||
* | ||
* @see https://github.com/gregberge/react-merge-refs/blob/main/src/index.tsx | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function mergeRefs(refs) { | ||
return value => { | ||
refs.forEach(ref => { | ||
if (typeof ref === 'function') { | ||
ref(value); | ||
} else if (ref != null) { | ||
ref.current = value; | ||
} | ||
}); | ||
}; | ||
} | ||
const control = { | ||
@@ -679,2 +717,2 @@ sm: { | ||
export { Core, CoreProvider, boxPalette, boxPalettes, coreContext, fontGrid, forwardRefWithAs, globalPalette, mapResponsiveProp, mapSpacing, mergeTheme, mq, packs, print, themeVars, tokens, useClickOutside, useElementSize, useLinkComponent, usePrefersReducedMotion, useTernaryState, useToggleState, useWindowSize }; | ||
export { Core, CoreProvider, boxPalette, boxPalettes, coreContext, fontGrid, forwardRefWithAs, globalPalette, mapResponsiveProp, mapSpacing, mergeRefs, mergeTheme, mq, packs, print, themeVars, tokens, useClickOutside, useElementSize, useLinkComponent, usePrefersReducedMotion, useTernaryState, useToggleState, useWindowSize }; |
import { PropsWithChildren } from 'react'; | ||
import { CoreProviderProps } from './context'; | ||
import { CoreProviderProps } from './CoreProvider'; | ||
import { Theme } from './theme'; | ||
@@ -4,0 +4,0 @@ export declare type CoreProps = PropsWithChildren<{ |
export * from './Core'; | ||
export * from './CoreProvider'; | ||
export * from './tokens'; | ||
@@ -9,2 +10,1 @@ export * from './packs'; | ||
export * from './responsive'; | ||
export * from './context'; |
@@ -0,3 +1,3 @@ | ||
import facepaint from 'facepaint'; | ||
import { tokens } from './tokens'; | ||
import facepaint from 'facepaint'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Facepaint lets you write properties as arrays e.g. |
@@ -8,2 +8,3 @@ export { useTernaryState } from './useTernaryState'; | ||
export { forwardRefWithAs } from './forwardRefWithAs'; | ||
export { mergeRefs } from './mergeRefs'; | ||
export { fontGrid } from './fontGrid'; |
{ | ||
"name": "@ag.ds-next/core", | ||
"version": "2.2.1", | ||
"version": "3.0.0", | ||
"main": "dist/ag.ds-next-core.cjs.js", | ||
@@ -10,3 +10,3 @@ "module": "dist/ag.ds-next-core.esm.js", | ||
"facepaint": "^1.2.1", | ||
"react": "^16.14.0 || ^17.0.0" | ||
"react": "^16.14.0 || ^17.0.0 || ^18.0.0" | ||
}, | ||
@@ -17,4 +17,4 @@ "devDependencies": { | ||
"facepaint": "^1.2.1", | ||
"react": "17.0.2" | ||
"react": "18.1.0" | ||
} | ||
} |
export * from './Core'; | ||
export * from './CoreProvider'; | ||
export * from './tokens'; | ||
@@ -9,2 +10,1 @@ export * from './packs'; | ||
export * from './responsive'; | ||
export * from './context'; |
@@ -0,3 +1,3 @@ | ||
import facepaint from 'facepaint'; | ||
import { tokens } from './tokens'; | ||
import facepaint from 'facepaint'; | ||
@@ -4,0 +4,0 @@ /** |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
@@ -2,0 +3,0 @@ |
@@ -8,2 +8,3 @@ export { useTernaryState } from './useTernaryState'; | ||
export { forwardRefWithAs } from './forwardRefWithAs'; | ||
export { mergeRefs } from './mergeRefs'; | ||
export { fontGrid } from './fontGrid'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
141824
52
3477