@scality/core-ui 0.200.0 → 0.201.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,4 +1,4 @@
1
- import { Props } from './Buttonv2.component';
1
+ import { type Props } from './Buttonv2.component';
2
2
  export declare const COPY_STATE_IDLE = "idle";
3
3
  export declare const COPY_STATE_SUCCESS = "success";
4
4
  export declare const COPY_STATE_UNSUPPORTED = "unsupported";
@@ -1 +1 @@
1
- {"version":3,"file":"CopyButton.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/buttonv2/CopyButton.component.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAErD,eAAO,MAAM,eAAe,SAAS,CAAC;AACtC,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAC5C,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AACpD,eAAO,MAAM,YAAY;iBASQ,MAAM,WAAW,OAAO;;CAoCxD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,sDAMxB;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CAC/B,GAAG,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,4CA+CnC,CAAC"}
1
+ {"version":3,"file":"CopyButton.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/buttonv2/CopyButton.component.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE1D,eAAO,MAAM,eAAe,SAAS,CAAC;AACtC,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAC5C,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AACpD,eAAO,MAAM,YAAY;iBAUQ,MAAM,WAAW,OAAO;;CA0CxD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,sDAMxB;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;CAC/B,GAAG,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,4CA+CnC,CAAC"}
@@ -8,6 +8,8 @@ export const COPY_STATE_UNSUPPORTED = 'unsupported';
8
8
  export const useClipboard = () => {
9
9
  const [copyStatus, setCopyStatus] = useState(COPY_STATE_IDLE);
10
10
  useEffect(() => {
11
+ if (copyStatus === COPY_STATE_IDLE)
12
+ return;
11
13
  const timer = setTimeout(() => {
12
14
  setCopyStatus(COPY_STATE_IDLE);
13
15
  }, 2000);
@@ -38,8 +40,14 @@ export const useClipboard = () => {
38
40
  }
39
41
  else {
40
42
  // Copy as plain text only
41
- navigator.clipboard.writeText(text);
42
- setCopyStatus(COPY_STATE_SUCCESS);
43
+ navigator.clipboard
44
+ .writeText(text)
45
+ .then(() => {
46
+ setCopyStatus(COPY_STATE_SUCCESS);
47
+ })
48
+ .catch(() => {
49
+ setCopyStatus(COPY_STATE_UNSUPPORTED);
50
+ });
43
51
  }
44
52
  };
45
53
  return {
@@ -49,24 +57,26 @@ export const useClipboard = () => {
49
57
  };
50
58
  export const CopyButton = ({ label, textToCopy, copyAsHtml, variant, ...props }) => {
51
59
  const { copy, copyStatus } = useClipboard();
60
+ const isSuccess = copyStatus === COPY_STATE_SUCCESS;
52
61
  return (_jsx(Button, { ...props, variant: variant === 'outline' ? 'outline' : undefined, style: {
53
- minWidth:
54
- //Just to make sure the width of the button stays the same when copied!
55
- variant === 'outline'
56
- ? (label ? label.length / 2 : 0) + 7 + 'rem'
62
+ ...props.style,
63
+ ...(isSuccess && { cursor: 'not-allowed', opacity: 0.5 }),
64
+ minWidth: variant === 'outline'
65
+ ? `${(label ? label.length / 2 : 0) + 7}rem`
57
66
  : undefined,
58
67
  }, label: variant === 'outline'
59
- ? copyStatus === COPY_STATE_SUCCESS
60
- ? `Copied${label ? ' ' + label + '' : ''}!`
61
- : `Copy${label ? ' ' + label : ''}`
62
- : undefined, icon: _jsx(Icon, { name: copyStatus === COPY_STATE_SUCCESS ? 'Check' : 'Copy', color: copyStatus === COPY_STATE_SUCCESS ? 'statusHealthy' : undefined }), disabled: copyStatus === COPY_STATE_SUCCESS || props.disabled, onClick: () => copy(textToCopy, copyAsHtml), type: "button", tooltip: variant !== 'outline'
68
+ ? isSuccess
69
+ ? `Copied${label ? ` ${label}` : ''}!`
70
+ : `Copy${label ? ` ${label}` : ''}`
71
+ : undefined, icon: _jsx(Icon, { name: isSuccess ? 'Check' : 'Copy', color: isSuccess ? 'statusHealthy' : undefined }), disabled: props.disabled, "aria-disabled": isSuccess || props.disabled, onClick: () => {
72
+ if (!isSuccess)
73
+ copy(textToCopy, copyAsHtml);
74
+ }, type: "button", tooltip: variant !== 'outline'
63
75
  ? {
64
- overlay: copyStatus === COPY_STATE_SUCCESS
76
+ overlay: isSuccess
65
77
  ? 'Copied !'
66
- : `Copy${label ? ' ' + label : ''}`,
67
- overlayStyle: {
68
- maxWidth: '20rem',
69
- },
78
+ : `Copy${label ? ` ${label}` : ''}`,
79
+ overlayStyle: { maxWidth: '20rem' },
70
80
  placement: 'top',
71
81
  }
72
82
  : undefined }));
@@ -0,0 +1,17 @@
1
+ import type { Extension } from '@codemirror/state';
2
+ import type { JSONSchema7 } from 'json-schema';
3
+ export declare function isEditAttempt(e: KeyboardEvent): boolean;
4
+ export declare function createReadOnlyTooltipExtension(): Extension;
5
+ export interface EditorProps {
6
+ value: string;
7
+ onChange?: (value: string) => void;
8
+ readOnly?: boolean;
9
+ language?: 'json' | {
10
+ name: 'json';
11
+ schema?: JSONSchema7;
12
+ };
13
+ height?: string;
14
+ width?: string;
15
+ }
16
+ export declare const Editor: ({ value, onChange, readOnly, language, height, width, }: EditorProps) => import("react/jsx-runtime").JSX.Element;
17
+ //# sourceMappingURL=Editor.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Editor.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/editor/Editor.component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAQ/C,wBAAgB,aAAa,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,CAIvD;AAED,wBAAgB,8BAA8B,IAAI,SAAS,CA4E1D;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,CAAC;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,MAAM,GAAI,yDAOpB,WAAW,4CAiDb,CAAC"}
@@ -0,0 +1,118 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { json } from '@codemirror/lang-json';
3
+ import { ViewPlugin } from '@codemirror/view';
4
+ import CodeMirror from '@uiw/react-codemirror';
5
+ import { jsonSchema as jsonSchemaExtension } from 'codemirror-json-schema';
6
+ import { useMemo, useRef } from 'react';
7
+ import { useTheme } from 'styled-components';
8
+ import { createEditorTheme } from './editorTheme';
9
+ const EDIT_KEYS = new Set(['Backspace', 'Delete', 'Enter', 'Tab']);
10
+ export function isEditAttempt(e) {
11
+ const isTyping = !e.ctrlKey && !e.metaKey && !e.altKey && e.key.length === 1;
12
+ const isCutPaste = (e.ctrlKey || e.metaKey) && (e.key === 'x' || e.key === 'v');
13
+ return isTyping || EDIT_KEYS.has(e.key) || isCutPaste;
14
+ }
15
+ export function createReadOnlyTooltipExtension() {
16
+ return ViewPlugin.define((view) => {
17
+ let tooltip = null;
18
+ let hideTimer = null;
19
+ let wrapper = null;
20
+ const dismiss = () => {
21
+ tooltip === null || tooltip === void 0 ? void 0 : tooltip.remove();
22
+ tooltip = null;
23
+ if (hideTimer)
24
+ clearTimeout(hideTimer);
25
+ hideTimer = null;
26
+ };
27
+ const show = () => {
28
+ var _a, _b, _c;
29
+ if (hideTimer)
30
+ clearTimeout(hideTimer);
31
+ const head = view.state.selection.main.head;
32
+ const coords = view.coordsAtPos(head);
33
+ if (!coords)
34
+ return;
35
+ if (!wrapper) {
36
+ wrapper = document.createElement('div');
37
+ Object.assign(wrapper.style, {
38
+ position: 'absolute',
39
+ top: '0',
40
+ left: '0',
41
+ width: '100%',
42
+ height: '100%',
43
+ pointerEvents: 'none',
44
+ overflow: 'visible',
45
+ zIndex: '100',
46
+ });
47
+ (_a = view.dom.parentElement) === null || _a === void 0 ? void 0 : _a.appendChild(wrapper);
48
+ }
49
+ const parentRect = (_c = (_b = wrapper.offsetParent) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()) !== null && _c !== void 0 ? _c : view.dom.getBoundingClientRect();
50
+ if (!tooltip) {
51
+ tooltip = document.createElement('div');
52
+ tooltip.className = 'cm-readonly-tooltip';
53
+ tooltip.textContent = 'Cannot edit in read-only editor';
54
+ tooltip.setAttribute('role', 'status');
55
+ tooltip.setAttribute('aria-live', 'polite');
56
+ Object.assign(tooltip.style, {
57
+ position: 'absolute',
58
+ padding: '4px 12px',
59
+ borderRadius: '4px',
60
+ fontSize: '12px',
61
+ pointerEvents: 'none',
62
+ whiteSpace: 'nowrap',
63
+ });
64
+ wrapper.appendChild(tooltip);
65
+ }
66
+ tooltip.style.left = `${coords.left - parentRect.left}px`;
67
+ tooltip.style.top = `${coords.bottom - parentRect.top + 4}px`;
68
+ hideTimer = setTimeout(dismiss, 2000);
69
+ };
70
+ const handler = (e) => {
71
+ if (isEditAttempt(e))
72
+ show();
73
+ };
74
+ view.dom.addEventListener('keydown', handler, true);
75
+ return {
76
+ destroy() {
77
+ view.dom.removeEventListener('keydown', handler, true);
78
+ dismiss();
79
+ wrapper === null || wrapper === void 0 ? void 0 : wrapper.remove();
80
+ },
81
+ };
82
+ });
83
+ }
84
+ export const Editor = ({ value, onChange, readOnly = false, language = 'json', height = '400px', width = '100%', }) => {
85
+ const theme = useTheme();
86
+ const editorTheme = useMemo(() => createEditorTheme(theme), [theme]);
87
+ const langName = typeof language === 'string' ? language : language.name;
88
+ const schema = typeof language === 'object' ? language.schema : undefined;
89
+ const readOnlyTooltipExt = useRef(null);
90
+ if (!readOnlyTooltipExt.current) {
91
+ readOnlyTooltipExt.current = createReadOnlyTooltipExtension();
92
+ }
93
+ const extensions = useMemo(() => {
94
+ const exts = [];
95
+ if (langName === 'json') {
96
+ if (schema) {
97
+ exts.push(...jsonSchemaExtension(schema));
98
+ }
99
+ else {
100
+ exts.push(json());
101
+ }
102
+ }
103
+ if (readOnly) {
104
+ exts.push(readOnlyTooltipExt.current);
105
+ }
106
+ return exts;
107
+ }, [langName, schema, readOnly]);
108
+ return (_jsx(CodeMirror, { value: value, height: height, width: width, extensions: extensions, onChange: onChange, readOnly: readOnly, theme: editorTheme, basicSetup: {
109
+ lineNumbers: true,
110
+ foldGutter: true,
111
+ autocompletion: true,
112
+ highlightActiveLine: true,
113
+ highlightActiveLineGutter: true,
114
+ indentOnInput: true,
115
+ bracketMatching: true,
116
+ closeBrackets: true,
117
+ } }));
118
+ };
@@ -0,0 +1,5 @@
1
+ import type { Extension } from '@codemirror/state';
2
+ import type { CoreUITheme } from '../../style/theme';
3
+ export declare function isDarkBackground(theme: CoreUITheme): boolean;
4
+ export declare function createEditorTheme(theme: CoreUITheme): Extension;
5
+ //# sourceMappingURL=editorTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorTheme.d.ts","sourceRoot":"","sources":["../../../src/lib/components/editor/editorTheme.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAM5D;AAyBD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAsF/D"}
@@ -0,0 +1,115 @@
1
+ import { EditorView } from '@codemirror/view';
2
+ import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
3
+ import { tags } from '@lezer/highlight';
4
+ import { getLuminance } from 'polished';
5
+ import { lineColor5 } from '../../style/theme';
6
+ export function isDarkBackground(theme) {
7
+ try {
8
+ return getLuminance(theme.backgroundLevel1) < 0.5;
9
+ }
10
+ catch {
11
+ return true;
12
+ }
13
+ }
14
+ function getSyntaxColors(theme, isDark) {
15
+ if (isDark) {
16
+ return {
17
+ property: theme.statusHealthy,
18
+ string: lineColor5,
19
+ number: lineColor5,
20
+ boolean: lineColor5,
21
+ null: theme.textSecondary,
22
+ bracket: theme.textPrimary,
23
+ punctuation: theme.textPrimary,
24
+ };
25
+ }
26
+ return {
27
+ property: '#4078F2',
28
+ string: '#50A14F',
29
+ number: '#986801',
30
+ boolean: '#0184BC',
31
+ null: '#0184BC',
32
+ bracket: '#383A42',
33
+ punctuation: '#383A42',
34
+ };
35
+ }
36
+ export function createEditorTheme(theme) {
37
+ const isDark = isDarkBackground(theme);
38
+ const syntax = getSyntaxColors(theme, isDark);
39
+ const editorViewTheme = EditorView.theme({
40
+ '&': {
41
+ backgroundColor: theme.backgroundLevel1,
42
+ color: theme.textPrimary,
43
+ },
44
+ '.cm-content': {
45
+ caretColor: theme.textPrimary,
46
+ fontFamily: "'Courier New', monospace",
47
+ fontSize: '12px',
48
+ },
49
+ '.cm-cursor, .cm-dropCursor': {
50
+ borderLeftColor: theme.textPrimary,
51
+ },
52
+ '&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
53
+ backgroundColor: theme.highlight,
54
+ },
55
+ '.cm-gutters': {
56
+ backgroundColor: theme.backgroundLevel1,
57
+ color: theme.textSecondary,
58
+ border: 'none',
59
+ borderRight: `1px solid ${theme.border}`,
60
+ },
61
+ '.cm-activeLineGutter': {
62
+ backgroundColor: theme.backgroundLevel3,
63
+ },
64
+ '.cm-activeLine': {
65
+ backgroundColor: theme.backgroundLevel3,
66
+ },
67
+ '.cm-foldPlaceholder': {
68
+ backgroundColor: 'transparent',
69
+ border: 'none',
70
+ color: theme.textSecondary,
71
+ },
72
+ '.cm-diagnostic-error': {
73
+ borderLeftColor: theme.statusCritical,
74
+ },
75
+ '.cm-diagnostic-warning': {
76
+ borderLeftColor: theme.statusWarning,
77
+ },
78
+ '.cm-lintRange-error': {
79
+ backgroundImage: 'none',
80
+ textDecoration: `underline wavy ${theme.statusCritical}`,
81
+ },
82
+ '.cm-lintRange-warning': {
83
+ backgroundImage: 'none',
84
+ textDecoration: `underline wavy ${theme.statusWarning}`,
85
+ },
86
+ '.cm-tooltip': {
87
+ backgroundColor: theme.backgroundLevel3,
88
+ color: theme.textPrimary,
89
+ border: `1px solid ${theme.border}`,
90
+ },
91
+ '.cm-tooltip-lint': {
92
+ backgroundColor: theme.backgroundLevel3,
93
+ },
94
+ '.cm-panels': {
95
+ backgroundColor: theme.backgroundLevel4,
96
+ color: theme.textPrimary,
97
+ },
98
+ '.cm-readonly-tooltip': {
99
+ backgroundColor: theme.backgroundLevel3,
100
+ color: theme.textPrimary,
101
+ border: `1px solid ${theme.border}`,
102
+ },
103
+ }, { dark: isDark });
104
+ const highlightStyle = HighlightStyle.define([
105
+ { tag: tags.propertyName, color: syntax.property },
106
+ { tag: tags.string, color: syntax.string },
107
+ { tag: tags.number, color: syntax.number },
108
+ { tag: tags.bool, color: syntax.boolean },
109
+ { tag: tags.null, color: syntax.null },
110
+ { tag: tags.punctuation, color: syntax.punctuation },
111
+ { tag: tags.brace, color: syntax.bracket },
112
+ { tag: tags.squareBracket, color: syntax.bracket },
113
+ ]);
114
+ return [editorViewTheme, syntaxHighlighting(highlightStyle)];
115
+ }
@@ -0,0 +1,3 @@
1
+ export { Editor } from './Editor.component';
2
+ export type { EditorProps } from './Editor.component';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/components/editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ export { Editor } from './Editor.component';
@@ -1 +1 @@
1
- {"version":3,"file":"IconHelper.d.ts","sourceRoot":"","sources":["../../../src/lib/components/iconhelper/IconHelper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,QAAQ,EAAW,MAAM,8BAA8B,CAAC;AAEjE,KAAK,aAAa,GAAG;IACnB,cAAc,EAAE,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAoBF,eAAO,MAAM,QAAQ,GAAI,8EAMtB,aAAa,4CAaf,CAAC"}
1
+ {"version":3,"file":"IconHelper.d.ts","sourceRoot":"","sources":["../../../src/lib/components/iconhelper/IconHelper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,QAAQ,EAAW,MAAM,8BAA8B,CAAC;AAEjE,KAAK,aAAa,GAAG;IACnB,cAAc,EAAE,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAmBF,eAAO,MAAM,QAAQ,GAAI,8EAMtB,aAAa,4CAaf,CAAC"}
@@ -8,7 +8,6 @@ const HelpButton = styled.button `
8
8
  border: none;
9
9
  padding: 0;
10
10
  margin: 0;
11
- cursor: pointer;
12
11
  color: inherit;
13
12
  font: inherit; /* Inherit font sizing */
14
13
  vertical-align: text-bottom; /* Align with text */
package/dist/next.d.ts CHANGED
@@ -11,6 +11,8 @@ export { CoreUiThemeProvider } from './components/coreuithemeprovider/CoreUiThem
11
11
  export { Box } from './components/box/Box';
12
12
  export { Input } from './components/inputv2/inputv2';
13
13
  export { Accordion } from './components/accordion/Accordion.component';
14
+ export { Editor } from './components/editor';
15
+ export type { EditorProps } from './components/editor';
14
16
  export { Barchart, BarchartTooltip, LineTimeSerieChart, GlobalHealthBar, Sparkline, ChartLegend, ChartLegendWrapper, useChartId, useChartLegend, ChartTooltipContainer, ChartTooltipItem, ChartTooltipHeader, ChartTooltipItemsContainer, } from './components/charts';
15
17
  export type { BarchartProps, BarchartBars, BarchartSortFn, BarchartTooltipFn, LineChartProps, Serie, GlobalHealthProps, Alert, UnitRange, TimeType, CategoryType, } from './components/charts';
16
18
  export type { CoreUITheme } from './style/theme';
@@ -1 +1 @@
1
- {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/lib/next.ts"],"names":[],"mappings":"AAAA,OAAO,2CAA2C,CAAC;AACnD,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAG/D,OAAO,EACL,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,wDAAwD,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AAGvE,OAAO,EACL,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,YAAY,GACb,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/lib/next.ts"],"names":[],"mappings":"AAAA,OAAO,2CAA2C,CAAC;AACnD,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAG/D,OAAO,EACL,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,wDAAwD,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EACL,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,YAAY,GACb,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
package/dist/next.js CHANGED
@@ -12,5 +12,6 @@ export { CoreUiThemeProvider } from './components/coreuithemeprovider/CoreUiThem
12
12
  export { Box } from './components/box/Box';
13
13
  export { Input } from './components/inputv2/inputv2';
14
14
  export { Accordion } from './components/accordion/Accordion.component';
15
+ export { Editor } from './components/editor';
15
16
  // Export all chart components from the consolidated charts folder
16
17
  export { Barchart, BarchartTooltip, LineTimeSerieChart, GlobalHealthBar, Sparkline, ChartLegend, ChartLegendWrapper, useChartId, useChartLegend, ChartTooltipContainer, ChartTooltipItem, ChartTooltipHeader, ChartTooltipItemsContainer, } from './components/charts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scality/core-ui",
3
- "version": "0.200.0",
3
+ "version": "0.201.0",
4
4
  "description": "Scality common React component library",
5
5
  "author": "Scality Engineering",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -85,6 +85,9 @@
85
85
  }
86
86
  },
87
87
  "dependencies": {
88
+ "@codemirror/lang-json": "^6.0.2",
89
+ "@codemirror/language": "^6.12.2",
90
+ "@codemirror/view": "^6.39.15",
88
91
  "@floating-ui/dom": "^1.6.3",
89
92
  "@floating-ui/react": "^0.27.15",
90
93
  "@fortawesome/fontawesome-free": "^7.1.0",
@@ -93,7 +96,10 @@
93
96
  "@fortawesome/free-solid-svg-icons": "^7.1.0",
94
97
  "@fortawesome/react-fontawesome": "^3.1.1",
95
98
  "@js-temporal/polyfill": "^0.4.4",
99
+ "@lezer/highlight": "^1.2.3",
96
100
  "@storybook/preview-api": "^8.3.6",
101
+ "@uiw/react-codemirror": "^4.25.5",
102
+ "codemirror-json-schema": "^0.8.1",
97
103
  "downshift": "^7.0.5",
98
104
  "polished": "3.4.1",
99
105
  "pretty-bytes": "^5.6.0",