@up42/up-components 0.15.1 → 0.16.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.
@@ -8,16 +8,25 @@ import 'prismjs/components/prism-java';
8
8
  import 'prismjs/components/prism-julia';
9
9
  import 'prismjs/components/prism-bash';
10
10
  export declare type Languages = 'DFS' | 'atom' | 'bash' | 'clike' | 'css' | 'extend' | 'html' | 'insertBefore' | 'java' | 'javascript' | 'js' | 'json' | 'julia' | 'kotlin' | 'kt' | 'kts' | 'markup' | 'mathml' | 'plain' | 'plaintext' | 'py' | 'python' | 'rss' | 'sh' | 'shell' | 'ssml' | 'svg' | 'text' | 'txt' | 'webmanifest' | 'xml';
11
- export interface CodeSnippetProps {
11
+ export interface CodeSnippetItemProps {
12
+ label: string;
12
13
  code: string;
13
14
  language: Languages;
14
15
  /**
15
16
  * limit the code height. defaults to 512px, **roughly** 22 lines
16
17
  */
17
18
  maxCodeHeight?: string;
19
+ }
20
+ export interface CodeSnippetProps {
21
+ snippets: CodeSnippetItemProps[];
22
+ onCopy?: (code: string) => void;
18
23
  sx?: SxProps<Theme>;
24
+ /**
25
+ * Set value to show specific snippet when component mounts
26
+ */
27
+ initialSnippetIndex?: number;
19
28
  }
20
29
  /**
21
30
  * Documentation: https://up-components.up42.dev/?path=/docs/data-display-CodeSnippet
22
31
  */
23
- export declare const CodeSnippet: ({ code, language, sx, maxCodeHeight }: CodeSnippetProps) => JSX.Element;
32
+ export declare const CodeSnippet: ({ snippets, sx, onCopy, initialSnippetIndex }: CodeSnippetProps) => JSX.Element;
@@ -4,8 +4,9 @@ export interface CopyButtonProps {
4
4
  data: string;
5
5
  tooltip?: string;
6
6
  sx?: SxProps<Theme>;
7
+ onCopy?: (data: string) => void;
7
8
  }
8
9
  /**
9
10
  * Documentation: https://up-components.up42.dev/?path=/docs/patterns-copybutton
10
11
  */
11
- export declare const CopyButton: ({ data, tooltip, sx }: CopyButtonProps) => JSX.Element;
12
+ export declare const CopyButton: ({ data, tooltip, sx, onCopy }: CopyButtonProps) => JSX.Element;
@@ -1,12 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
- import { TabsProps } from '../Tabs/Tabs';
2
+ import { Tab as TabData, TabsProps } from '../Tabs/Tabs';
3
3
  import { BoxProps } from '../Box/Box';
4
- declare type tab = {
4
+ declare type TabData = {
5
5
  label: string | ReactNode;
6
6
  content: string | ReactNode;
7
7
  };
8
8
  export declare type TabGroupProps = {
9
- tabs: tab[];
9
+ tabs: TabData[];
10
10
  tabContentProps?: BoxProps;
11
11
  tabsProps?: TabsProps;
12
12
  /**
@@ -47,7 +47,7 @@ export { Tag, type TagProps } from './components/Tag/Tag';
47
47
  export { DateTime, type DateTimeProps } from './components/DateTime/DateTime';
48
48
  export { DocumentationPopover, type DocumentationPopoverProps, } from './components/DocumentationPopover/DocumentationPopover';
49
49
  export { CodeInline, type CodeInlineProps } from './components/CodeInline/CodeInline';
50
- export { CodeSnippet, type CodeSnippetProps } from './components/CodeSnippet/CodeSnippet';
50
+ export { CodeSnippet, type CodeSnippetProps, type CodeSnippetItemProps } from './components/CodeSnippet/CodeSnippet';
51
51
  export { Table, TableBody, TableCell, TableHead, TableContainer, TableRow, TableFooter, TablePagination, TableSortLabel, type TableProps, type TableBodyProps, type TableCellProps, type TableHeadProps, type TableContainerProps, type TableRowProps, type TableFooterProps, type TablePaginationProps, type TableSortLabelProps, } from './components/Table/Table';
52
52
  export { DataGrid, type DataGridProps, type GridColDef, type GridRenderCellParams, type GridRowId, type GridSelectionModel, type GridSortModel, } from './components/DataGrid/DataGrid';
53
53
  export { capitalize } from './utils/helpers/capitalize';