@synerise/ds-short-cuts 1.0.40 → 1.0.42
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 +8 -0
- package/README.md +7 -6
- package/dist/ShortCuts.d.ts +2 -2
- package/dist/ShortCuts.js +17 -29
- package/dist/ShortCuts.style.d.ts +1 -1
- package/dist/ShortCuts.style.js +18 -29
- package/dist/ShortCuts.types.d.ts +2 -2
- package/dist/ShortCuts.types.js +1 -1
- package/dist/index.js +4 -1
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/package.json +9 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [1.0.42](https://github.com/Synerise/synerise-design/compare/@synerise/ds-short-cuts@1.0.41...@synerise/ds-short-cuts@1.0.42) (2026-03-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-short-cuts
|
|
9
|
+
|
|
10
|
+
## [1.0.41](https://github.com/Synerise/synerise-design/compare/@synerise/ds-short-cuts@1.0.40...@synerise/ds-short-cuts@1.0.41) (2026-03-20)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @synerise/ds-short-cuts
|
|
13
|
+
|
|
6
14
|
## [1.0.40](https://github.com/Synerise/synerise-design/compare/@synerise/ds-short-cuts@1.0.39...@synerise/ds-short-cuts@1.0.40) (2026-03-09)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-short-cuts
|
package/README.md
CHANGED
|
@@ -28,9 +28,10 @@ import ShortCuts from '@synerise/ds-short-cuts'
|
|
|
28
28
|
|
|
29
29
|
## API
|
|
30
30
|
|
|
31
|
-
| Property
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
| color
|
|
35
|
-
|
|
|
36
|
-
|
|
|
31
|
+
| Property | Description | Type | Default |
|
|
32
|
+
| --------- | ---------------------------------------------------------- | ---------------------- | ------- |
|
|
33
|
+
| size | Size of the shortcut badge | `'S'` \| `'L'` | `L` |
|
|
34
|
+
| color | Color variant | `'light'` \| `'dark'` | - |
|
|
35
|
+
| children | Text label to display (mutually exclusive with `icon`) | ReactNode | - |
|
|
36
|
+
| icon | Icon to display (mutually exclusive with `children`) | ReactNode | - |
|
|
37
|
+
| autoWidth | When true, width is `auto`; when false, width equals height | boolean | `false` |
|
package/dist/ShortCuts.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ShortCutsProps } from './ShortCuts.types';
|
|
3
3
|
declare const ShortCuts: ({ size, children, color, icon, autoWidth, ...htmlAttributes }: ShortCutsProps) => React.JSX.Element;
|
|
4
4
|
export default ShortCuts;
|
package/dist/ShortCuts.js
CHANGED
|
@@ -1,30 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
color: color,
|
|
19
|
-
size: size,
|
|
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));
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { theme } from "@synerise/ds-core";
|
|
3
|
+
import Icon from "@synerise/ds-icon";
|
|
4
|
+
import { Text } from "@synerise/ds-typography";
|
|
5
|
+
import { Wrapper } from "./ShortCuts.style.js";
|
|
6
|
+
const ShortCuts = ({
|
|
7
|
+
size = "L",
|
|
8
|
+
children,
|
|
9
|
+
color,
|
|
10
|
+
icon,
|
|
11
|
+
autoWidth,
|
|
12
|
+
...htmlAttributes
|
|
13
|
+
}) => {
|
|
14
|
+
return /* @__PURE__ */ jsx(Wrapper, { color, size, autoWidth, isIcon: Boolean(icon), ...htmlAttributes, children: icon ? /* @__PURE__ */ jsx(Icon, { color: color === "dark" ? theme.palette.white : theme.palette["grey-600"], component: icon, size: 12 }) : /* @__PURE__ */ jsx(Text, { size: "xsmall", children }) });
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
ShortCuts as default
|
|
29
18
|
};
|
|
30
|
-
export default ShortCuts;
|
package/dist/ShortCuts.style.js
CHANGED
|
@@ -1,42 +1,31 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
|
|
3
|
-
if (props.size ===
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const getPadding = (props) => {
|
|
3
|
+
if (props.size === "S") {
|
|
4
4
|
if (props.isIcon) {
|
|
5
|
-
return
|
|
5
|
+
return "3px 3px 2px";
|
|
6
6
|
}
|
|
7
|
-
return
|
|
7
|
+
return "1px 4px 0";
|
|
8
8
|
}
|
|
9
9
|
if (props.isIcon) {
|
|
10
|
-
return
|
|
10
|
+
return "6px 6px 5px";
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return "4px 8px 3px";
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
const getWidth = (props) => {
|
|
15
15
|
if (!props.autoWidth) {
|
|
16
|
-
if (props.size ===
|
|
17
|
-
return
|
|
16
|
+
if (props.size === "L") {
|
|
17
|
+
return "24px";
|
|
18
18
|
}
|
|
19
|
-
if (props.size ===
|
|
20
|
-
return
|
|
19
|
+
if (props.size === "S") {
|
|
20
|
+
return "18px";
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
return
|
|
23
|
+
return "auto";
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
const Wrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
26
26
|
displayName: "ShortCutsstyle__Wrapper",
|
|
27
27
|
componentId: "sc-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;box-shadow:0px 1px 8px 0px rgba( 35,41,54,", " );"],
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, function (props) {
|
|
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'];
|
|
36
|
-
}, function (props) {
|
|
37
|
-
return props.color === 'dark' ? props.theme.palette.white : props.theme.palette['grey-600'];
|
|
38
|
-
}, function (props) {
|
|
39
|
-
return getPadding(props);
|
|
40
|
-
}, function (props) {
|
|
41
|
-
return props.color === 'dark' ? '0.5' : '0.08';
|
|
42
|
-
});
|
|
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;box-shadow:0px 1px 8px 0px rgba( 35,41,54,", " );"], (props) => props.size === "S" ? "18px" : "24px", (props) => getWidth(props), (props) => props.color === "dark" ? props.theme.palette["grey-600"] : props.theme.palette.white, (props) => props.color === "dark" ? props.theme.palette["grey-500"] : props.theme.palette["grey-300"], (props) => props.color === "dark" ? props.theme.palette.white : props.theme.palette["grey-600"], (props) => getPadding(props), (props) => props.color === "dark" ? "0.5" : "0.08");
|
|
29
|
+
export {
|
|
30
|
+
Wrapper
|
|
31
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ExactlyOne, WithHTMLAttributes } from '@synerise/ds-utils';
|
|
3
3
|
export type ShortCutsProps = WithHTMLAttributes<HTMLDivElement, {
|
|
4
4
|
size?: 'S' | 'L';
|
|
5
5
|
color?: 'light' | 'dark';
|
package/dist/ShortCuts.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
package/dist/index.js
CHANGED
package/dist/modules.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@testing-library/jest-dom/extend-expect";
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-short-cuts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.42",
|
|
4
4
|
"description": "ShortCuts UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "vite build",
|
|
20
20
|
"build:css": "node ../../../scripts/style/less.js",
|
|
21
21
|
"build:js": "babel --delete-dir-on-start --root-mode upward src --out-dir dist --extensions '.js,.ts,.tsx'",
|
|
22
|
-
"build:watch": "
|
|
22
|
+
"build:watch": "vite build --watch",
|
|
23
23
|
"defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
|
|
24
24
|
"pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
|
|
25
25
|
"prepublish": "pnpm run build",
|
|
@@ -35,15 +35,16 @@
|
|
|
35
35
|
],
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@synerise/ds-icon": "^1.
|
|
39
|
-
"@synerise/ds-typography": "^1.1.
|
|
38
|
+
"@synerise/ds-icon": "^1.15.1",
|
|
39
|
+
"@synerise/ds-typography": "^1.1.13"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@synerise/ds-utils": "^1.
|
|
42
|
+
"@synerise/ds-utils": "^1.7.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@synerise/ds-core": "*",
|
|
46
|
-
"react": ">=16.9.0 <= 18.3.1"
|
|
46
|
+
"react": ">=16.9.0 <= 18.3.1",
|
|
47
|
+
"styled-components": "^5.3.3"
|
|
47
48
|
},
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "e4ecca8944fc9b41c1b9d59c8bcad5e5e2013225"
|
|
49
50
|
}
|