@synerise/ds-code-snippet 1.1.54 → 1.2.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 CHANGED
@@ -3,6 +3,12 @@
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.2.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-snippet@1.1.54...@synerise/ds-code-snippet@1.2.0) (2026-06-27)
7
+
8
+ ### Features
9
+
10
+ - expose overscrollBehavior on multi-line CodeSnippet ([c9938bb](https://github.com/Synerise/synerise-design/commit/c9938bba726489754d3f9bbf9e64edfb679d4a52))
11
+
6
12
  ## [1.1.54](https://github.com/Synerise/synerise-design/compare/@synerise/ds-code-snippet@1.1.53...@synerise/ds-code-snippet@1.1.54) (2026-06-17)
7
13
 
8
14
  **Note:** Version bump only for package @synerise/ds-code-snippet
@@ -1,4 +1,4 @@
1
1
  import { default as React } from 'react';
2
2
  import { CodeSnippetProps } from './CodeSnippet.types';
3
- declare const CodeSnippet: ({ type, languages, children, colorSyntax, fontSize, tooltipTitleHover, tooltipTitleClick, labelBeforeExpanded, labelAfterExpanded, wrap, rows, className, onExpand, onCopy, customTriggerComponent, expanded, hideExpandButton, hideCopyButton, }: CodeSnippetProps) => React.JSX.Element;
3
+ declare const CodeSnippet: ({ type, languages, children, colorSyntax, fontSize, tooltipTitleHover, tooltipTitleClick, labelBeforeExpanded, labelAfterExpanded, wrap, rows, overscrollBehavior, className, onExpand, onCopy, customTriggerComponent, expanded, hideExpandButton, hideCopyButton, }: CodeSnippetProps) => React.JSX.Element;
4
4
  export default CodeSnippet;
@@ -16,6 +16,7 @@ const CodeSnippet = ({
16
16
  labelAfterExpanded = "Show less",
17
17
  wrap = false,
18
18
  rows = 6,
19
+ overscrollBehavior,
19
20
  className,
20
21
  onExpand,
21
22
  onCopy,
@@ -28,7 +29,7 @@ const CodeSnippet = ({
28
29
  case CodeSnippetType.SINGLE_LINE:
29
30
  return /* @__PURE__ */ jsx(SingleCode, { fontSize, tooltipTitleHover, tooltipTitleClick, className, onCopy, customTriggerComponent, children });
30
31
  case CodeSnippetType.MULTI_LINE:
31
- return /* @__PURE__ */ jsx(MultiCode, { languages, colorSyntax, fontSize, tooltipTitleHover, tooltipTitleClick, labelBeforeExpanded, labelAfterExpanded, expanded, className, wrap, rows, onExpand, onCopy, customTriggerComponent, hideExpandButton, hideCopyButton, children });
32
+ return /* @__PURE__ */ jsx(MultiCode, { languages, colorSyntax, fontSize, tooltipTitleHover, tooltipTitleClick, labelBeforeExpanded, labelAfterExpanded, expanded, className, wrap, rows, overscrollBehavior, onExpand, onCopy, customTriggerComponent, hideExpandButton, hideCopyButton, children });
32
33
  default:
33
34
  return /* @__PURE__ */ jsx(InlineCode, { className, children });
34
35
  }
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { OverscrollBehavior } from '@synerise/ds-scrollbar';
2
3
  import { LanguageHighlight } from './Highlight/Highlight.types';
3
4
  export declare enum FontSize {
4
5
  SMALL = 12,
@@ -24,6 +25,7 @@ export interface CodeSnippetProps {
24
25
  fontSize?: FontSize;
25
26
  rows?: number;
26
27
  wrap?: boolean;
28
+ overscrollBehavior?: OverscrollBehavior;
27
29
  onExpand?: () => void;
28
30
  onCopy?: () => void;
29
31
  customTriggerComponent?: React.ReactNode;
@@ -18,6 +18,7 @@ const MultiCode = ({
18
18
  labelAfterExpanded,
19
19
  wrap = false,
20
20
  rows = 6,
21
+ overscrollBehavior,
21
22
  onExpand,
22
23
  onCopy,
23
24
  customTriggerComponent,
@@ -60,9 +61,9 @@ const MultiCode = ({
60
61
  const extraHeightOption = React.useMemo(() => isButtonVisible ? initialContentHeight : "auto", [isButtonVisible, initialContentHeight]);
61
62
  const multilineStructureContent = React.useMemo(() => /* @__PURE__ */ jsx(PreBlock, { wrap, expanded: expandedState, isButtonVisible, children: /* @__PURE__ */ jsx(AnimateHeight, { className: "content-animation", duration: ANIMATE_HEIGHT_TIME, height: !expandedState ? extraHeightOption : "auto", style: {
62
63
  minHeight: LINE_HEIGHT_DEFAULT
63
- }, children: /* @__PURE__ */ jsx(Scrollbar, { maxHeight: !scrollable ? (rows + 1) * LINE_HEIGHT_DEFAULT : "100%", style: {
64
+ }, children: /* @__PURE__ */ jsx(Scrollbar, { maxHeight: !scrollable ? (rows + 1) * LINE_HEIGHT_DEFAULT : "100%", overscrollBehavior, style: {
64
65
  marginRight: "17px"
65
- }, children: /* @__PURE__ */ jsx(BlockCodeWrapperMulti, { ref: codeRef, isButtonVisible, children }) }) }) }), [wrap, rows, expandedState, isButtonVisible, scrollable, codeRef, extraHeightOption, children]);
66
+ }, children: /* @__PURE__ */ jsx(BlockCodeWrapperMulti, { ref: codeRef, isButtonVisible, children }) }) }) }), [wrap, rows, overscrollBehavior, expandedState, isButtonVisible, scrollable, codeRef, extraHeightOption, children]);
66
67
  const iconElement = React.useMemo(() => !hideCopyButton && /* @__PURE__ */ jsx(MultiIconCopy, { copyValue: children, texts: {
67
68
  copyTooltip: tooltipTitleHover,
68
69
  copiedTooltip: tooltipTitleClick
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-code-snippet",
3
- "version": "1.1.54",
3
+ "version": "1.2.0",
4
4
  "description": "CodeSnippet UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -60,5 +60,5 @@
60
60
  "react": ">=16.9.0 <= 18.3.1",
61
61
  "styled-components": "^5.3.3"
62
62
  },
63
- "gitHead": "d8c64070f58f14e3fb1bfbcbf00d1e3b8fd51eb8"
63
+ "gitHead": "dfd892acc1d02abebcf661db3fb32f0fc4b6c354"
64
64
  }