@synerise/ds-short-cuts 0.2.2 → 0.3.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/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/dist/ShortCuts.js +15 -9
- package/dist/ShortCuts.style.d.ts +1 -8
- package/dist/ShortCuts.style.js +24 -35
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.3.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-short-cuts@0.2.2...@synerise/ds-short-cuts@0.3.0) (2025-01-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **short-cuts:** adjust to designs changes ([f68f9a6](https://github.com/Synerise/synerise-design/commit/f68f9a6e8ff4b1591631691afc7bc3298b4e1049))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [0.2.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-short-cuts@0.2.1...@synerise/ds-short-cuts@0.2.2) (2025-01-15)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-short-cuts
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ import ShortCuts from '@synerise/ds-short-cuts'
|
|
|
27
27
|
## API
|
|
28
28
|
|
|
29
29
|
| Property | Description | Type | Default |
|
|
30
|
-
| size | sizes of short cut | `S` , `L` |
|
|
30
|
+
| size | sizes of short cut | `S` , `L` | `L` |
|
|
31
31
|
| children | content to display | ReactNode | - |
|
|
32
32
|
| color | type of colors | string | - |
|
|
33
33
|
| icon | icon to display | ReactNode | - |
|
package/dist/ShortCuts.js
CHANGED
|
@@ -2,23 +2,29 @@ var _excluded = ["size", "children", "color", "icon", "autoWidth"];
|
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import { theme } from '@synerise/ds-core';
|
|
6
|
+
import Icon from '@synerise/ds-icon';
|
|
7
|
+
import { Text } from '@synerise/ds-typography';
|
|
5
8
|
import * as S from './ShortCuts.style';
|
|
6
9
|
var ShortCuts = function ShortCuts(_ref) {
|
|
7
|
-
var size = _ref.size,
|
|
10
|
+
var _ref$size = _ref.size,
|
|
11
|
+
size = _ref$size === void 0 ? 'L' : _ref$size,
|
|
8
12
|
children = _ref.children,
|
|
9
13
|
color = _ref.color,
|
|
10
14
|
icon = _ref.icon,
|
|
11
15
|
autoWidth = _ref.autoWidth,
|
|
12
16
|
htmlAttributes = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
13
|
-
return /*#__PURE__*/React.createElement(S.
|
|
14
|
-
color: color
|
|
15
|
-
}, htmlAttributes), /*#__PURE__*/React.createElement(S.Wrapper, {
|
|
17
|
+
return /*#__PURE__*/React.createElement(S.Wrapper, _extends({
|
|
16
18
|
color: color,
|
|
17
19
|
size: size,
|
|
18
|
-
autoWidth: autoWidth
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
autoWidth: autoWidth,
|
|
21
|
+
isIcon: Boolean(icon)
|
|
22
|
+
}, htmlAttributes), icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
23
|
+
color: color === 'dark' ? theme.palette.white : theme.palette['grey-600'],
|
|
24
|
+
component: icon,
|
|
25
|
+
size: 12
|
|
26
|
+
}) : /*#__PURE__*/React.createElement(Text, {
|
|
27
|
+
size: "xsmall"
|
|
28
|
+
}, children));
|
|
23
29
|
};
|
|
24
30
|
export default ShortCuts;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const ShortCutWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
-
color?: "dark" | "light" | undefined;
|
|
4
|
-
size?: "S" | "L" | undefined;
|
|
5
|
-
}, never>;
|
|
6
1
|
export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {
|
|
7
2
|
size?: "S" | "L" | undefined;
|
|
8
3
|
color?: "dark" | "light" | undefined;
|
|
9
4
|
autoWidth?: boolean | undefined;
|
|
10
|
-
|
|
11
|
-
export declare const ShortCutIcon: import("styled-components").StyledComponent<({ name, component, className, ...rest }: import("@synerise/ds-icon").IconProps) => import("react").JSX.Element, any, {
|
|
12
|
-
color?: "dark" | "light" | undefined;
|
|
5
|
+
isIcon: boolean;
|
|
13
6
|
}, never>;
|
package/dist/ShortCuts.style.js
CHANGED
|
@@ -1,51 +1,40 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import Icon from '@synerise/ds-icon';
|
|
3
2
|
var getPadding = function getPadding(props) {
|
|
4
|
-
if (props.size === 'L') {
|
|
5
|
-
return '0 8px';
|
|
6
|
-
}
|
|
7
3
|
if (props.size === 'S') {
|
|
8
|
-
|
|
4
|
+
if (props.isIcon) {
|
|
5
|
+
return '3px 3px 2px';
|
|
6
|
+
}
|
|
7
|
+
return '1px 4px 0';
|
|
8
|
+
}
|
|
9
|
+
if (props.isIcon) {
|
|
10
|
+
return '6px 6px 5px';
|
|
9
11
|
}
|
|
10
|
-
return '
|
|
12
|
+
return '4px 8px 3px';
|
|
11
13
|
};
|
|
12
14
|
var getWidth = function getWidth(props) {
|
|
13
|
-
if (props.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return '18px';
|
|
15
|
+
if (!props.autoWidth) {
|
|
16
|
+
if (props.size === 'L') {
|
|
17
|
+
return '24px';
|
|
18
|
+
}
|
|
19
|
+
if (props.size === 'S') {
|
|
20
|
+
return '18px';
|
|
21
|
+
}
|
|
21
22
|
}
|
|
22
|
-
return '
|
|
23
|
+
return 'auto';
|
|
23
24
|
};
|
|
24
|
-
export var ShortCutWrapper = styled.div.withConfig({
|
|
25
|
-
displayName: "ShortCutsstyle__ShortCutWrapper",
|
|
26
|
-
componentId: "vo5qxe-0"
|
|
27
|
-
})(["display:flex;background-color:", ";border-radius:3px;border-bottom:1px solid ", ";box-shadow:0 0 10px 2px ", ";"], function (props) {
|
|
28
|
-
return props.color === 'dark' ? props.theme.palette['grey-600'] : props.theme.palette.white;
|
|
29
|
-
}, function (props) {
|
|
30
|
-
return props.color === 'dark' ? props.theme.palette['grey-500'] : props.theme.palette['grey-300'];
|
|
31
|
-
}, function (props) {
|
|
32
|
-
return props.color === 'dark' ? props.theme.palette['grey-300'] : props.theme.palette['grey-100'];
|
|
33
|
-
});
|
|
34
25
|
export var Wrapper = styled.div.withConfig({
|
|
35
26
|
displayName: "ShortCutsstyle__Wrapper",
|
|
36
|
-
componentId: "vo5qxe-
|
|
37
|
-
})(["display:flex;align-items:center;justify-content:center;height:", ";width:", ";
|
|
38
|
-
return props.size === 'S' ? '
|
|
27
|
+
componentId: "vo5qxe-0"
|
|
28
|
+
})(["box-sizing:border-box;display:flex;align-items:center;justify-content:center;height:", ";width:", ";background-color:", ";border-bottom:1px solid ", ";border-radius:3px;color:", ";padding:", ";font-size:11px;"], function (props) {
|
|
29
|
+
return props.size === 'S' ? '18px' : '24px';
|
|
39
30
|
}, function (props) {
|
|
40
31
|
return getWidth(props);
|
|
41
32
|
}, function (props) {
|
|
42
|
-
return
|
|
33
|
+
return props.color === 'dark' ? props.theme.palette['grey-600'] : props.theme.palette.white;
|
|
34
|
+
}, function (props) {
|
|
35
|
+
return props.color === 'dark' ? props.theme.palette['grey-500'] : props.theme.palette['grey-300'];
|
|
43
36
|
}, function (props) {
|
|
44
37
|
return props.color === 'dark' ? props.theme.palette.white : props.theme.palette['grey-600'];
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
displayName: "ShortCutsstyle__ShortCutIcon",
|
|
48
|
-
componentId: "vo5qxe-2"
|
|
49
|
-
})(["fill:", ";"], function (props) {
|
|
50
|
-
return props.color === 'dark' ? props.theme.palette.white : props.theme.palette['grey-600'];
|
|
38
|
+
}, function (props) {
|
|
39
|
+
return getPadding(props);
|
|
51
40
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-short-cuts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "ShortCuts UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,11 +34,12 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-icon": "^0.
|
|
37
|
+
"@synerise/ds-icon": "^0.70.0",
|
|
38
|
+
"@synerise/ds-typography": "^0.16.12"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"@synerise/ds-core": "*",
|
|
41
42
|
"react": ">=16.9.0 <= 17.0.2"
|
|
42
43
|
},
|
|
43
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "56e23cda61b7ddfe7da4669307183b105a500e1a"
|
|
44
45
|
}
|