@up42/up-components 0.12.12 → 0.13.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.
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
- export interface CodeBoxProps {
2
+ export interface CodeInlineProps {
3
3
  text: string;
4
4
  label?: string;
5
5
  'data-testid'?: string;
6
6
  }
7
7
  /**
8
- * Documentation: https://up-components.up42.dev/?path=/docs/data-display-codebox
8
+ * Documentation: https://up-components.up42.dev/?path=/docs/data-display-codeinline
9
9
  */
10
- export declare const CodeBox: ({ label, text, "data-testid": dataTestId }: CodeBoxProps) => JSX.Element;
10
+ export declare const CodeInline: ({ label, text, "data-testid": dataTestId }: CodeInlineProps) => JSX.Element;
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ import { SxProps, Theme } from '@mui/material';
3
+ import 'prismjs/plugins/line-numbers/prism-line-numbers';
4
+ import 'prismjs/components/prism-json';
5
+ import 'prismjs/components/prism-python';
6
+ import 'prismjs/components/prism-kotlin';
7
+ import 'prismjs/components/prism-java';
8
+ import 'prismjs/components/prism-julia';
9
+ import 'prismjs/components/prism-bash';
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 {
12
+ code: string;
13
+ language: Languages;
14
+ /**
15
+ * limit the code height. defaults to 512px, **roughly** 22 lines
16
+ */
17
+ maxCodeHeight?: string;
18
+ sx?: SxProps<Theme>;
19
+ }
20
+ /**
21
+ * Documentation: https://up-components.up42.dev/?path=/docs/data-display-CodeSnippet
22
+ */
23
+ export declare const CodeSnippet: ({ code, language, sx, maxCodeHeight }: CodeSnippetProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const Pre: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, {}>;
@@ -45,7 +45,8 @@ export { Badge, type BadgeProps } from './components/Badge/Badge';
45
45
  export { Tag, type TagProps } from './components/Tag/Tag';
46
46
  export { DateTime, type DateTimeProps } from './components/DateTime/DateTime';
47
47
  export { DocumentationPopover, type DocumentationPopoverProps, } from './components/DocumentationPopover/DocumentationPopover';
48
- export { CodeBox, type CodeBoxProps } from './components/CodeBox/CodeBox';
48
+ export { CodeInline, type CodeInlineProps } from './components/CodeInline/CodeInline';
49
+ export { CodeSnippet, type CodeSnippetProps } from './components/CodeSnippet/CodeSnippet';
49
50
  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';
50
51
  export { DataGrid, type DataGridProps, type GridColDef, type GridRenderCellParams, type GridRowId, type GridSelectionModel, type GridSortModel, } from './components/DataGrid/DataGrid';
51
52
  export { capitalize } from './utils/helpers/capitalize';
package/dist/index.d.ts CHANGED
@@ -2025,15 +2025,30 @@ declare type DocumentationPopoverProps = {
2025
2025
  */
2026
2026
  declare const DocumentationPopover: ({ content, linkPath, linkText, heading, id }: DocumentationPopoverProps) => JSX.Element;
2027
2027
 
2028
- interface CodeBoxProps {
2028
+ interface CodeInlineProps {
2029
2029
  text: string;
2030
2030
  label?: string;
2031
2031
  'data-testid'?: string;
2032
2032
  }
2033
2033
  /**
2034
- * Documentation: https://up-components.up42.dev/?path=/docs/data-display-codebox
2034
+ * Documentation: https://up-components.up42.dev/?path=/docs/data-display-codeinline
2035
2035
  */
2036
- declare const CodeBox: ({ label, text, "data-testid": dataTestId }: CodeBoxProps) => JSX.Element;
2036
+ declare const CodeInline: ({ label, text, "data-testid": dataTestId }: CodeInlineProps) => JSX.Element;
2037
+
2038
+ 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';
2039
+ interface CodeSnippetProps {
2040
+ code: string;
2041
+ language: Languages;
2042
+ /**
2043
+ * limit the code height. defaults to 512px, **roughly** 22 lines
2044
+ */
2045
+ maxCodeHeight?: string;
2046
+ sx?: SxProps<Theme>;
2047
+ }
2048
+ /**
2049
+ * Documentation: https://up-components.up42.dev/?path=/docs/data-display-CodeSnippet
2050
+ */
2051
+ declare const CodeSnippet: ({ code, language, sx, maxCodeHeight }: CodeSnippetProps) => JSX.Element;
2037
2052
 
2038
2053
  declare type TableProps = MUIGlobalOmit<TableProps$1>;
2039
2054
  /**
@@ -2153,4 +2168,4 @@ declare type ContextState = {
2153
2168
  */
2154
2169
  declare const useAlert: () => ContextState;
2155
2170
 
2156
- export { Alert, AlertProps, Avatar, AvatarProps, Badge, BadgeProps, Banner, BannerProps, Box, BoxProps, Button, ButtonProps, Checkbox, CheckboxProps, Chip, ChipProps, CodeBox, CodeBoxProps, Container, ContainerProps, ControlButton, ControlButtonProps, CopyButton, CopyButtonProps, CreateAlertProps, DataGrid, DataGridProps, DatePickerDateType, DateTime, DateTimeProps, DocumentationPopover, DocumentationPopoverProps, EmptyState, EmptyStateProps, FormCheckbox, FormCheckboxProps, FormDatePicker, FormDatePickerProps, FormDateRangePicker, FormDateRangePickerProps, FormInput, FormInputProps, FormRadio, FormRadioProps, FormSelect, FormSelectProps, FormSwitch, FormSwitchProps, Icon, IconProps, InfoCard, InfoCardProps, InfoModal, InfoModalProps, InfoPopover, InfoPopoverProps, Input, InputProps, Link, LinkProps, Loading, LoadingProps, Menu, MenuItem, MenuItemProps, MenuProps, Modal, ModalProps, NotFound, PageHeader, PageHeaderProps, PaginatedResponse, Popover, PopoverProps, Radio, RadioProps, Select, SelectProps, Slider, SliderProps, Switch, SwitchProps, Tab, TabGroup, TabGroupProps, TabProps, Table, TableBody, TableBodyProps, TableCell, TableCellProps, TableContainer, TableContainerProps, TableFooter, TableFooterProps, TableHead, TableHeadProps, TablePagination, TablePaginationProps, TableProps, TableRow, TableRowProps, TableSortLabel, TableSortLabelProps, Tabs, TabsProps, Tag, TagProps, Tooltip, TooltipProps, Typography, TypographyProps, UpComponentsProvider, capitalize, copyToClipboard, formatDate, formatFileSize, formatNumber, theme, useAlert, useQueryParams, useRemotePagination };
2171
+ export { Alert, AlertProps, Avatar, AvatarProps, Badge, BadgeProps, Banner, BannerProps, Box, BoxProps, Button, ButtonProps, Checkbox, CheckboxProps, Chip, ChipProps, CodeInline, CodeInlineProps, CodeSnippet, CodeSnippetProps, Container, ContainerProps, ControlButton, ControlButtonProps, CopyButton, CopyButtonProps, CreateAlertProps, DataGrid, DataGridProps, DatePickerDateType, DateTime, DateTimeProps, DocumentationPopover, DocumentationPopoverProps, EmptyState, EmptyStateProps, FormCheckbox, FormCheckboxProps, FormDatePicker, FormDatePickerProps, FormDateRangePicker, FormDateRangePickerProps, FormInput, FormInputProps, FormRadio, FormRadioProps, FormSelect, FormSelectProps, FormSwitch, FormSwitchProps, Icon, IconProps, InfoCard, InfoCardProps, InfoModal, InfoModalProps, InfoPopover, InfoPopoverProps, Input, InputProps, Link, LinkProps, Loading, LoadingProps, Menu, MenuItem, MenuItemProps, MenuProps, Modal, ModalProps, NotFound, PageHeader, PageHeaderProps, PaginatedResponse, Popover, PopoverProps, Radio, RadioProps, Select, SelectProps, Slider, SliderProps, Switch, SwitchProps, Tab, TabGroup, TabGroupProps, TabProps, Table, TableBody, TableBodyProps, TableCell, TableCellProps, TableContainer, TableContainerProps, TableFooter, TableFooterProps, TableHead, TableHeadProps, TablePagination, TablePaginationProps, TableProps, TableRow, TableRowProps, TableSortLabel, TableSortLabelProps, Tabs, TabsProps, Tag, TagProps, Tooltip, TooltipProps, Typography, TypographyProps, UpComponentsProvider, capitalize, copyToClipboard, formatDate, formatFileSize, formatNumber, theme, useAlert, useQueryParams, useRemotePagination };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@up42/up-components",
3
- "version": "0.12.12",
3
+ "version": "0.13.0",
4
4
  "description": "UP42 Component Library",
5
5
  "author": "Axel Fuhrmann axel.fuhrmann@up42.com",
6
6
  "license": "ISC",
@@ -27,6 +27,7 @@
27
27
  "dependencies": {
28
28
  "@up42/design-system-tokens": "^3.0.1",
29
29
  "dayjs": "^1.11.7",
30
+ "prismjs": "^1.29.0",
30
31
  "react-markdown": "^8.0.3"
31
32
  },
32
33
  "devDependencies": {
@@ -59,6 +60,7 @@
59
60
  "@testing-library/react": "^12.1.2",
60
61
  "@testing-library/react-hooks": "^8.0.1",
61
62
  "@types/jest": "^27.4.0",
63
+ "@types/prismjs": "^1.26.0",
62
64
  "@types/react": "^17.0.38",
63
65
  "@typescript-eslint/eslint-plugin": "^5.10.0",
64
66
  "@typescript-eslint/parser": "^5.10.0",