@synerise/ds-code-snippet 1.1.37 → 1.1.38
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 +4 -0
- package/README.md +15 -12
- package/dist/CodeSnippet.figma.d.ts +1 -0
- package/dist/CodeSnippet.figma.js +43 -0
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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.1.38](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-snippet@1.1.37...@synerise/ds-code-snippet@1.1.38) (2026-03-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-code-snippet
|
|
9
|
+
|
|
6
10
|
## [1.1.37](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-snippet@1.1.36...@synerise/ds-code-snippet@1.1.37) (2026-03-09)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @synerise/ds-code-snippet
|
package/README.md
CHANGED
|
@@ -35,15 +35,18 @@ import CodeSnippet from '@synerise/ds-code-snippet'
|
|
|
35
35
|
| type | Defines the type of the codesnippet | CodeSnippetType | INLINE |
|
|
36
36
|
| className | Class name for main CodeSnippet's container | string | - |
|
|
37
37
|
| children | CodeSnippet's content | string | "" |
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
| wrap
|
|
48
|
-
|
|
|
49
|
-
|
|
|
38
|
+
| tooltipTitleHover | Tooltip title on hover (before copy) | string | 'Copy' |
|
|
39
|
+
| tooltipTitleClick | Tooltip title after copy | string | 'Copied!' |
|
|
40
|
+
| labelBeforeExpanded | Text of expand button before expanding | string | 'Show more' |
|
|
41
|
+
| labelAfterExpanded | Text of expand button after expanding | string | 'Show less' |
|
|
42
|
+
| fontSize | Font size (FontSize.SMALL=12, FontSize.MEDIUM=14) | FontSize | FontSize.SMALL |
|
|
43
|
+
| colorSyntax | Enable syntax highlighting (multi-line only) | boolean | false |
|
|
44
|
+
| languages | Languages for syntax highlighting (multi-line only) | LanguageHighlight[] | ['javascript', 'typescript', 'json'] |
|
|
45
|
+
| rows | Visible lines before expand button appears (multi-line) | number | 6 |
|
|
46
|
+
| expanded | Initial expanded state (multi-line only) | boolean | false |
|
|
47
|
+
| wrap | Enable word wrap (multi-line only) | boolean | false |
|
|
48
|
+
| hideExpandButton | Hide the expand/collapse button (multi-line only) | boolean | false |
|
|
49
|
+
| hideCopyButton | Hide the copy icon (multi-line only) | boolean | false |
|
|
50
|
+
| customTriggerComponent | Custom node to replace the copy icon | ReactNode | - |
|
|
51
|
+
| onExpand | Extra callback on expand/collapse click | () => void | - |
|
|
52
|
+
| onCopy | Extra callback on copy | () => void | - |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import CodeSnippet from './CodeSnippet';
|
|
3
|
+
import { CodeSnippetType, FontSize } from './CodeSnippet.types';
|
|
4
|
+
var FIGMA_URL = 'https://www.figma.com/design/fsSZONXpVvtrDsCgtu01Jb/Synerise-Design-System?node-id=725:13723&m=dev';
|
|
5
|
+
figma.connect(CodeSnippet, FIGMA_URL, {
|
|
6
|
+
variant: {
|
|
7
|
+
Size: 'Small'
|
|
8
|
+
},
|
|
9
|
+
example: function example() {
|
|
10
|
+
return /*#__PURE__*/React.createElement(CodeSnippet, {
|
|
11
|
+
type: CodeSnippetType.SINGLE_LINE,
|
|
12
|
+
fontSize: FontSize.SMALL
|
|
13
|
+
}, 'code here');
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
figma.connect(CodeSnippet, FIGMA_URL, {
|
|
17
|
+
variant: {
|
|
18
|
+
Size: 'Large'
|
|
19
|
+
},
|
|
20
|
+
example: function example() {
|
|
21
|
+
return /*#__PURE__*/React.createElement(CodeSnippet, {
|
|
22
|
+
type: CodeSnippetType.SINGLE_LINE,
|
|
23
|
+
fontSize: FontSize.MEDIUM
|
|
24
|
+
}, 'code here');
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
var FIGMA_URL_INLINE = 'https://www.figma.com/design/fsSZONXpVvtrDsCgtu01Jb/Synerise-Design-System?node-id=725:13620&m=dev';
|
|
28
|
+
figma.connect(CodeSnippet, FIGMA_URL_INLINE, {
|
|
29
|
+
example: function example() {
|
|
30
|
+
return /*#__PURE__*/React.createElement(CodeSnippet, {
|
|
31
|
+
type: CodeSnippetType.INLINE
|
|
32
|
+
}, 'code here');
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
var FIGMA_URL_MULTI = 'https://www.figma.com/design/fsSZONXpVvtrDsCgtu01Jb/Synerise-Design-System?node-id=725:13726&m=dev';
|
|
36
|
+
figma.connect(CodeSnippet, FIGMA_URL_MULTI, {
|
|
37
|
+
example: function example() {
|
|
38
|
+
return /*#__PURE__*/React.createElement(CodeSnippet, {
|
|
39
|
+
type: CodeSnippetType.MULTI_LINE,
|
|
40
|
+
colorSyntax: true
|
|
41
|
+
}, 'code here');
|
|
42
|
+
}
|
|
43
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-code-snippet",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.38",
|
|
4
4
|
"description": "CodeSnippet UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"defs": "tsc --declaration --outDir dist/ --emitDeclarationOnly",
|
|
25
25
|
"pack:ci": "pnpm pack --pack-destination ../../storybook/storybook-static/static",
|
|
26
26
|
"prepublish": "pnpm run build",
|
|
27
|
-
"test": "vitest",
|
|
28
|
-
"test:watch": "
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"test:watch": "vitest",
|
|
29
29
|
"types": "tsc --noEmit",
|
|
30
30
|
"check:circular-dependencies": "madge --circular --extensions ts,tsx,js,jsx --ts-config tsconfig.json src/ --exclude '/dist/'",
|
|
31
31
|
"upgrade:ds": "ncu -f \"@synerise/ds-*\" -u"
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
],
|
|
37
37
|
"types": "dist/index.d.ts",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@synerise/ds-button": "^1.5.
|
|
40
|
-
"@synerise/ds-copy-icon": "^1.2.
|
|
41
|
-
"@synerise/ds-icon": "^1.
|
|
42
|
-
"@synerise/ds-scrollbar": "^1.2.
|
|
43
|
-
"@synerise/ds-tooltip": "^1.4.
|
|
44
|
-
"@synerise/ds-utils": "^1.
|
|
39
|
+
"@synerise/ds-button": "^1.5.17",
|
|
40
|
+
"@synerise/ds-copy-icon": "^1.2.1",
|
|
41
|
+
"@synerise/ds-icon": "^1.15.0",
|
|
42
|
+
"@synerise/ds-scrollbar": "^1.2.16",
|
|
43
|
+
"@synerise/ds-tooltip": "^1.4.9",
|
|
44
|
+
"@synerise/ds-utils": "^1.7.0",
|
|
45
45
|
"highlight.js": "^10.7.2",
|
|
46
46
|
"react-animate-height": "^2.0.23"
|
|
47
47
|
},
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"react": ">=16.9.0 <= 18.3.1",
|
|
55
55
|
"styled-components": "^5.3.3"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
|
|
58
58
|
}
|