@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 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
- | tooltipHint | Defines the text | string | 'Copy' |
39
- | labelBeforeExpanded | Defines the text of button before expand | string | 'Show more' |
40
- | labelAfterExpanded | Defines the text of button after expand | string | 'Show less' |
41
- | tooltipTitleHover | Tooltip title on hover | string | 'Copy' |
42
- | tooltipTitleClick | Tooltip title on click | string | 'Copied!' |
43
- | fontSize | Defines the size for single block | FontSize | 'small' |
44
- | colorSyntax | Specify when use color syntax | boolean | false |
45
- | languages | Array of langugages defined for color syntax | LanguageHighlight[] | ['javascript', 'typescript', 'json'] |
46
- | rows | Specify the number of visible lines before expand | number | 6 |
47
- | wrap | Specify whether content is wrap or not | boolean | false |
48
- | onExpand | An extra function to invoke on button click expand content | () => void | - |
49
- | onCopy | An extra function to invoke on copy button event | () => void | - |
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.37",
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": "pnpm run 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.16",
40
- "@synerise/ds-copy-icon": "^1.2.0",
41
- "@synerise/ds-icon": "^1.14.1",
42
- "@synerise/ds-scrollbar": "^1.2.15",
43
- "@synerise/ds-tooltip": "^1.4.8",
44
- "@synerise/ds-utils": "^1.6.0",
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": "8dfafc5d7278f09d430f1e7499782d05c76b47c0"
57
+ "gitHead": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
58
58
  }