@micromag/element-link 0.3.832 → 0.4.4
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/assets/css/styles.css +1 -1
- package/es/index.d.ts +17 -0
- package/es/index.js +19 -35
- package/es/styles.css +1 -0
- package/package.json +11 -10
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.container{margin:0;padding:0}
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Margin } from '@micromag/core';
|
|
4
|
+
|
|
5
|
+
interface LinkProps {
|
|
6
|
+
url?: string | null;
|
|
7
|
+
target?: string | null;
|
|
8
|
+
rel?: string | null;
|
|
9
|
+
external?: boolean;
|
|
10
|
+
margin?: Margin | null;
|
|
11
|
+
className?: string | null;
|
|
12
|
+
children?: React.ReactNode | null;
|
|
13
|
+
focusable?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare function Link({ url, target: linkTarget, rel: linkRel, external, margin, className, children, focusable, }: LinkProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { Link as default };
|
package/es/index.js
CHANGED
|
@@ -1,42 +1,28 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
4
|
import React, { useId } from 'react';
|
|
6
|
-
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
7
5
|
import { getStyleFromMargin } from '@micromag/core/utils';
|
|
8
6
|
|
|
9
|
-
var styles = {"container":"
|
|
7
|
+
var styles = {"container":"container"};
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
url
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
children: null,
|
|
29
|
-
focusable: true
|
|
30
|
-
};
|
|
31
|
-
var Link = function Link(_ref) {
|
|
32
|
-
var url = _ref.url,
|
|
33
|
-
linkTarget = _ref.target,
|
|
34
|
-
linkRel = _ref.rel,
|
|
35
|
-
external = _ref.external,
|
|
36
|
-
margin = _ref.margin,
|
|
37
|
-
className = _ref.className,
|
|
38
|
-
children = _ref.children,
|
|
39
|
-
focusable = _ref.focusable;
|
|
9
|
+
function Link(_ref) {
|
|
10
|
+
var _ref$url = _ref.url,
|
|
11
|
+
url = _ref$url === void 0 ? null : _ref$url,
|
|
12
|
+
_ref$target = _ref.target,
|
|
13
|
+
linkTarget = _ref$target === void 0 ? null : _ref$target,
|
|
14
|
+
_ref$rel = _ref.rel,
|
|
15
|
+
linkRel = _ref$rel === void 0 ? null : _ref$rel,
|
|
16
|
+
_ref$external = _ref.external,
|
|
17
|
+
external = _ref$external === void 0 ? true : _ref$external,
|
|
18
|
+
_ref$margin = _ref.margin,
|
|
19
|
+
margin = _ref$margin === void 0 ? null : _ref$margin,
|
|
20
|
+
_ref$className = _ref.className,
|
|
21
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
22
|
+
_ref$children = _ref.children,
|
|
23
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
24
|
+
_ref$focusable = _ref.focusable,
|
|
25
|
+
focusable = _ref$focusable === void 0 ? true : _ref$focusable;
|
|
40
26
|
var finalStyle = null;
|
|
41
27
|
if (margin !== null) {
|
|
42
28
|
finalStyle = _objectSpread(_objectSpread({}, finalStyle), getStyleFromMargin(margin));
|
|
@@ -65,8 +51,6 @@ var Link = function Link(_ref) {
|
|
|
65
51
|
className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
|
|
66
52
|
style: finalStyle
|
|
67
53
|
}, children);
|
|
68
|
-
}
|
|
69
|
-
Link.propTypes = propTypes;
|
|
70
|
-
Link.defaultProps = defaultProps;
|
|
54
|
+
}
|
|
71
55
|
|
|
72
56
|
export { Link as default };
|
package/es/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.container{margin:0;padding:0}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-link",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"module": "es/index.js",
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
|
+
"types": "./es/index.d.ts",
|
|
37
38
|
"import": "./es/index.js"
|
|
38
39
|
},
|
|
39
40
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -47,27 +48,27 @@
|
|
|
47
48
|
"scripts": {
|
|
48
49
|
"clean": "rm -rf es && rm -rf lib && rm -rf assets",
|
|
49
50
|
"prepublishOnly": "npm run build",
|
|
50
|
-
"build": "../../scripts/prepare-package.sh"
|
|
51
|
+
"build": "../../scripts/prepare-package.sh --types"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
|
-
"react": "^
|
|
54
|
-
"react-dom": "^
|
|
54
|
+
"react": "^19.2.0",
|
|
55
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
|
-
"react": "^
|
|
58
|
-
"react-dom": "^
|
|
58
|
+
"react": "^19.2.0",
|
|
59
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
59
60
|
},
|
|
60
61
|
"dependencies": {
|
|
61
62
|
"@babel/runtime": "^7.13.10",
|
|
62
|
-
"@micromag/core": "^0.
|
|
63
|
+
"@micromag/core": "^0.4.4",
|
|
63
64
|
"classnames": "^2.2.6",
|
|
64
|
-
"
|
|
65
|
-
"react-intl": "^6.6.4",
|
|
65
|
+
"react-intl": "^8.1.3",
|
|
66
66
|
"uuid": "^9.0.0"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public",
|
|
70
70
|
"registry": "https://registry.npmjs.org/"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
|
|
73
|
+
"types": "es/index.d.ts"
|
|
73
74
|
}
|