kurtosis-ui-components 0.0.1 → 0.85.49
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/build/AppLayout.d.ts +10 -0
- package/build/AppLayout.js +24 -0
- package/build/CodeEditor.d.ts +14 -0
- package/build/CodeEditor.js +130 -0
- package/build/CopyButton.d.ts +9 -0
- package/build/CopyButton.js +27 -0
- package/build/DataTable.d.ts +17 -0
- package/build/DataTable.js +35 -0
- package/build/DownloadButton.d.ts +9 -0
- package/build/DownloadButton.js +31 -0
- package/build/FeatureNotImplementedModal.d.ts +9 -0
- package/build/FeatureNotImplementedModal.js +9 -0
- package/build/FileDisplay.d.ts +7 -0
- package/build/FileDisplay.js +9 -0
- package/build/FileSize.d.ts +6 -0
- package/build/FileSize.js +16 -0
- package/build/FileTree.d.ts +19 -0
- package/build/FileTree.js +34 -0
- package/build/FormatButton.d.ts +2 -0
- package/build/FormatButton.js +6 -0
- package/build/FormatDateTime.d.ts +8 -0
- package/build/FormatDateTime.js +19 -0
- package/build/HoverLineTabList.d.ts +9 -0
- package/build/HoverLineTabList.js +22 -0
- package/build/KeyboardCommands.d.ts +3 -0
- package/build/KeyboardCommands.js +16 -0
- package/build/KurtosisAlert.d.ts +9 -0
- package/build/KurtosisAlert.js +9 -0
- package/build/KurtosisAlertModal.d.ts +13 -0
- package/build/KurtosisAlertModal.js +5 -0
- package/build/KurtosisBreadcrumbs.d.ts +25 -0
- package/build/KurtosisBreadcrumbs.js +41 -0
- package/build/KurtosisMarkdown.d.ts +5 -0
- package/build/KurtosisMarkdown.js +56 -0
- package/build/KurtosisThemeProvider.d.ts +3 -0
- package/build/KurtosisThemeProvider.js +359 -0
- package/build/Navigation.d.ts +10 -0
- package/build/Navigation.js +10 -0
- package/build/PackageSourceButton.d.ts +7 -0
- package/build/PackageSourceButton.js +25 -0
- package/build/PageTitle.d.ts +5 -0
- package/build/PageTitle.js +5 -0
- package/build/PasteButton.d.ts +8 -0
- package/build/PasteButton.js +27 -0
- package/build/TitledBox.d.ts +6 -0
- package/build/TitledBox.js +5 -0
- package/build/TitledCard.d.ts +10 -0
- package/build/TitledCard.js +5 -0
- package/build/Toasts.d.ts +5 -0
- package/build/Toasts.js +6 -0
- package/build/ValueCard.d.ts +9 -0
- package/build/ValueCard.js +7 -0
- package/build/catalog/KurtosisPackageCard.d.ts +7 -0
- package/build/catalog/KurtosisPackageCard.js +18 -0
- package/build/catalog/KurtosisPackageCardGrid.d.ts +9 -0
- package/build/catalog/KurtosisPackageCardGrid.js +7 -0
- package/build/catalog/SavedPackages.d.ts +9 -0
- package/build/catalog/SavedPackages.js +9 -0
- package/build/catalog/index.d.ts +6 -0
- package/build/catalog/index.js +6 -0
- package/build/catalog/utils.d.ts +1 -0
- package/build/catalog/utils.js +8 -0
- package/build/catalog/widgets/RunKurtosisPackageButton.d.ts +7 -0
- package/build/catalog/widgets/RunKurtosisPackageButton.js +12 -0
- package/build/catalog/widgets/SaveKurtosisPackageButton.d.ts +7 -0
- package/build/catalog/widgets/SaveKurtosisPackageButton.js +28 -0
- package/build/constants.d.ts +3 -0
- package/build/constants.js +3 -0
- package/build/index.d.ts +30 -1
- package/build/index.js +30 -1
- package/build/logs/LogLine.d.ts +7 -0
- package/build/logs/LogLine.js +39 -0
- package/build/logs/LogViewer.d.ts +13 -0
- package/build/logs/LogViewer.js +169 -0
- package/build/logs/index.d.ts +3 -0
- package/build/logs/index.js +3 -0
- package/build/logs/types.d.ts +7 -0
- package/build/logs/types.js +1 -0
- package/build/logs/utils.d.ts +1 -0
- package/build/logs/utils.js +3 -0
- package/build/theme/Fonts.d.ts +2 -0
- package/build/theme/Fonts.js +4 -0
- package/build/theme/constants.d.ts +8 -0
- package/build/theme/constants.js +7 -0
- package/build/theme/formsTheme.d.ts +46 -0
- package/build/theme/formsTheme.js +33 -0
- package/build/theme/tabsTheme.d.ts +56 -0
- package/build/theme/tabsTheme.js +49 -0
- package/build/theme/tagsTheme.d.ts +55 -0
- package/build/theme/tagsTheme.js +45 -0
- package/build/useKeyboardAction.d.ts +3 -0
- package/build/useKeyboardAction.js +40 -0
- package/build/utils/download.d.ts +4 -0
- package/build/utils/download.js +10 -0
- package/build/utils/index.d.ts +19 -0
- package/build/utils/index.js +96 -0
- package/build/utils/packageUtils.d.ts +6 -0
- package/build/utils/packageUtils.js +15 -0
- package/build/utils/types.d.ts +5 -0
- package/build/utils/types.js +1 -0
- package/package.json +26 -3
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Flex, Icon, IconButton, Menu, MenuButton, MenuItem, MenuList, Text, } from "@chakra-ui/react";
|
|
4
|
+
import { BsCaretDownFill } from "react-icons/bs";
|
|
5
|
+
import { Link, useMatches } from "react-router-dom";
|
|
6
|
+
import { BREADCRUMBS_HEIGHT } from "./theme/constants";
|
|
7
|
+
import { isDefined } from "./utils";
|
|
8
|
+
const handlerRegistry = {};
|
|
9
|
+
export const registerBreadcrumbHandler = (type, render) => {
|
|
10
|
+
handlerRegistry[type] = render;
|
|
11
|
+
};
|
|
12
|
+
const getBreadcumbHandlerRenderer = (type) => {
|
|
13
|
+
return handlerRegistry[type] || null;
|
|
14
|
+
};
|
|
15
|
+
export const KurtosisBreadcrumbs = () => {
|
|
16
|
+
const matches = useMatches();
|
|
17
|
+
const handlerTypes = new Set(matches.map((match) => { var _a; return (_a = match.handle) === null || _a === void 0 ? void 0 : _a.type; }).filter(isDefined));
|
|
18
|
+
if (handlerTypes.size === 0) {
|
|
19
|
+
throw Error(`Currently routes with no breadcrumb handles are not supported`);
|
|
20
|
+
}
|
|
21
|
+
if (handlerTypes.size > 1) {
|
|
22
|
+
throw Error(`Routes with multiple breadcrumb handles are not supported.`);
|
|
23
|
+
}
|
|
24
|
+
const handleType = [...handlerTypes][0];
|
|
25
|
+
const Renderer = getBreadcumbHandlerRenderer(handleType);
|
|
26
|
+
if (isDefined(Renderer)) {
|
|
27
|
+
return _jsx(Renderer, { matches: matches });
|
|
28
|
+
}
|
|
29
|
+
throw new Error(`Unable to handle breadcrumbs of type ${handleType}`);
|
|
30
|
+
};
|
|
31
|
+
export const KurtosisBreadcrumbsImpl = ({ matchCrumbs, extraControls }) => {
|
|
32
|
+
return (_jsxs(Flex, { flex: "none", h: BREADCRUMBS_HEIGHT, alignItems: "center", justifyContent: "space-between", children: [_jsxs(Flex, { children: [_jsxs(Breadcrumb, { variant: "topNavigation", separator: _jsx(Text, { as: "span", fontSize: "lg", children: "/" }), children: [_jsx(BreadcrumbItem, { children: _jsx(Text, { fontSize: "xs", fontWeight: "semibold", p: "0px 8px", children: "Kurtosis" }) }), matchCrumbs.map((crumb, i, arr) => (_jsx(BreadcrumbItem, { isCurrentPage: i === arr.length - 1, children: _createElement(KurtosisBreadcrumbItem, { ...crumb, key: i, isLastItem: i === arr.length - 1 }) }, i)))] }), "\u00A0"] }), _jsx(Flex, { children: extraControls })] }));
|
|
33
|
+
};
|
|
34
|
+
const KurtosisBreadcrumbItem = ({ name, destination, alternatives, isLastItem }) => {
|
|
35
|
+
const baseLink = isLastItem ? (_jsx(Text, { fontSize: "xs", fontWeight: "semibold", p: "2px 8px", borderRadius: "6px", bg: "gray.650", children: name })) : (_jsx(BreadcrumbLink, { as: Link, to: destination, children: _jsx(Button, { variant: "breadcrumb", size: "xs", children: name }) }));
|
|
36
|
+
if (isDefined(alternatives) && alternatives.length > 0) {
|
|
37
|
+
// Render with menu
|
|
38
|
+
return (_jsxs(ButtonGroup, { isAttached: true, children: [baseLink, _jsxs(Menu, { children: [_jsx(MenuButton, { as: IconButton, variant: "breadcrumb", "aria-label": "Other options", icon: _jsx(Icon, { as: BsCaretDownFill }), size: "xs" }), _jsx(MenuList, { children: alternatives.map(({ name, destination, icon }) => (_jsx(MenuItem, { as: Link, to: destination, icon: icon, children: name }, destination))) })] })] }));
|
|
39
|
+
}
|
|
40
|
+
return baseLink;
|
|
41
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Code, Divider, Heading, Image, Link, Table, Tbody, Td, Text, Th, Thead, Tr } from "@chakra-ui/react";
|
|
3
|
+
import Markdown from "react-markdown";
|
|
4
|
+
const heading = (level) => ({ children }) => {
|
|
5
|
+
const sizes = ["xl", "lg", "md", "sm", "xs", "xs"];
|
|
6
|
+
return (_jsx(Heading, { my: 4, as: `h${level}`, size: sizes[`${level - 1}`], children: children }));
|
|
7
|
+
};
|
|
8
|
+
const componentStrategy = {
|
|
9
|
+
h1: heading(1),
|
|
10
|
+
h2: heading(2),
|
|
11
|
+
h3: heading(3),
|
|
12
|
+
h4: heading(4),
|
|
13
|
+
h5: heading(5),
|
|
14
|
+
h6: heading(6),
|
|
15
|
+
p: (props) => {
|
|
16
|
+
const { children } = props;
|
|
17
|
+
return _jsx(Text, { mb: 2, children: children });
|
|
18
|
+
},
|
|
19
|
+
em: (props) => {
|
|
20
|
+
const { children } = props;
|
|
21
|
+
return _jsx(Text, { as: "em", children: children });
|
|
22
|
+
},
|
|
23
|
+
blockquote: (props) => {
|
|
24
|
+
const { children } = props;
|
|
25
|
+
return (_jsx(Code, { as: "blockquote", p: 2, children: children }));
|
|
26
|
+
},
|
|
27
|
+
code: ({ children }) => {
|
|
28
|
+
return _jsx(Code, { children: children });
|
|
29
|
+
},
|
|
30
|
+
del: (props) => {
|
|
31
|
+
const { children } = props;
|
|
32
|
+
return _jsx(Text, { as: "del", children: children });
|
|
33
|
+
},
|
|
34
|
+
hr: (props) => {
|
|
35
|
+
return _jsx(Divider, {});
|
|
36
|
+
},
|
|
37
|
+
a: Link,
|
|
38
|
+
img: (props) => _jsx(Image, { src: props.src }),
|
|
39
|
+
text: (props) => {
|
|
40
|
+
const { children } = props;
|
|
41
|
+
return _jsx(Text, { as: "span", children: children });
|
|
42
|
+
},
|
|
43
|
+
pre: (props) => {
|
|
44
|
+
const { children } = props;
|
|
45
|
+
return (_jsx(Text, { margin: 1, as: "pre", children: children }));
|
|
46
|
+
},
|
|
47
|
+
table: Table,
|
|
48
|
+
thead: Thead,
|
|
49
|
+
tbody: Tbody,
|
|
50
|
+
tr: (props) => _jsx(Tr, { children: props.children }),
|
|
51
|
+
td: (props) => _jsx(Td, { children: props.children }),
|
|
52
|
+
th: (props) => _jsx(Th, { children: props.children }),
|
|
53
|
+
};
|
|
54
|
+
export const KurtosisMarkdown = ({ children }) => {
|
|
55
|
+
return (_jsx(Markdown, { components: componentStrategy, skipHtml: true, children: children }));
|
|
56
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ChakraProviderProps } from "@chakra-ui/react/dist/chakra-provider";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
export declare const KurtosisThemeProvider: ({ children, ...chakraProps }: PropsWithChildren<Omit<ChakraProviderProps, "theme">>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChakraProvider, defineStyle, extendTheme, Tooltip, useColorMode, } from "@chakra-ui/react";
|
|
3
|
+
import { mode } from "@chakra-ui/theme-tools";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import Fonts from "./theme/Fonts";
|
|
6
|
+
import { formsTheme } from "./theme/formsTheme";
|
|
7
|
+
import { tabsTheme } from "./theme/tabsTheme";
|
|
8
|
+
import { tagTheme } from "./theme/tagsTheme";
|
|
9
|
+
// https://github.com/chakra-ui/chakra-ui/issues/3347
|
|
10
|
+
Tooltip.defaultProps = {
|
|
11
|
+
hasArrow: true,
|
|
12
|
+
openDelay: 500,
|
|
13
|
+
size: "sm",
|
|
14
|
+
};
|
|
15
|
+
const config = {
|
|
16
|
+
initialColorMode: "dark",
|
|
17
|
+
useSystemColorMode: false,
|
|
18
|
+
disableTransitionOnChange: false,
|
|
19
|
+
};
|
|
20
|
+
const theme = extendTheme({
|
|
21
|
+
config,
|
|
22
|
+
fonts: {
|
|
23
|
+
heading: `'Inter', sans-serif`,
|
|
24
|
+
body: `'Inter', sans-serif`,
|
|
25
|
+
},
|
|
26
|
+
colors: {
|
|
27
|
+
kurtosisGreen: {
|
|
28
|
+
50: "#00371E",
|
|
29
|
+
100: "#005e11",
|
|
30
|
+
200: "#008c19",
|
|
31
|
+
300: "#00bb22",
|
|
32
|
+
400: "#00C223",
|
|
33
|
+
500: "#33ee55",
|
|
34
|
+
600: "#66f27f",
|
|
35
|
+
700: "#99f7aa",
|
|
36
|
+
},
|
|
37
|
+
darkBlue: {
|
|
38
|
+
200: "#516A77",
|
|
39
|
+
400: "#516A77",
|
|
40
|
+
},
|
|
41
|
+
gray: {
|
|
42
|
+
100: "#E3E3E3",
|
|
43
|
+
150: "#A1A3A5",
|
|
44
|
+
200: "#878787",
|
|
45
|
+
250: "#7A7A7A",
|
|
46
|
+
300: "#606770",
|
|
47
|
+
400: "#5B5B5B",
|
|
48
|
+
500: "#393B3E",
|
|
49
|
+
600: "#2E2E2E",
|
|
50
|
+
650: "#292929",
|
|
51
|
+
700: "#1E1E1E",
|
|
52
|
+
800: "#1D1D1D",
|
|
53
|
+
850: "#1B1B1D",
|
|
54
|
+
900: "#111111", // ui background
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
fontSizes: {
|
|
58
|
+
xs: "12px",
|
|
59
|
+
sm: "14px",
|
|
60
|
+
md: "16px",
|
|
61
|
+
lg: "18px",
|
|
62
|
+
xl: "20px",
|
|
63
|
+
"2xl": "22px",
|
|
64
|
+
},
|
|
65
|
+
styles: {
|
|
66
|
+
global: (props) => ({
|
|
67
|
+
body: {
|
|
68
|
+
bg: mode(props.theme.semanticTokens.colors["chakra-body-bg"]._light, "gray.900")(props),
|
|
69
|
+
},
|
|
70
|
+
"nav.primaryNav": {
|
|
71
|
+
bg: mode(props.theme.semanticTokens.colors["chakra-body-bg"]._light, "black")(props),
|
|
72
|
+
zIndex: "1",
|
|
73
|
+
},
|
|
74
|
+
main: {
|
|
75
|
+
color: "gray.100",
|
|
76
|
+
fontSize: "sm",
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
},
|
|
80
|
+
components: {
|
|
81
|
+
Badge: {
|
|
82
|
+
baseStyle: {
|
|
83
|
+
textTransform: "none",
|
|
84
|
+
color: "gray.100",
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
Button: {
|
|
88
|
+
defaultProps: {
|
|
89
|
+
variant: "outline",
|
|
90
|
+
},
|
|
91
|
+
variants: {
|
|
92
|
+
outline: (props) => ({
|
|
93
|
+
_hover: { borderColor: `${props.colorScheme}.400`, bg: `gray.650` },
|
|
94
|
+
_active: { bg: `gray.700` },
|
|
95
|
+
color: `${props.colorScheme}.400`,
|
|
96
|
+
borderColor: "gray.300",
|
|
97
|
+
}),
|
|
98
|
+
solidOutline: (props) => {
|
|
99
|
+
const outline = theme.components.Button.variants.outline(props);
|
|
100
|
+
return {
|
|
101
|
+
...outline,
|
|
102
|
+
_hover: { bg: `${props.colorScheme}.400`, color: "gray.900" },
|
|
103
|
+
_active: { bg: `${props.colorScheme}.400`, color: "gray.900" },
|
|
104
|
+
color: `${props.colorScheme}.400`,
|
|
105
|
+
borderColor: `${props.colorScheme}.400`,
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
kurtosisGroupOutline: (props) => {
|
|
109
|
+
const outline = theme.components.Button.variants.outline(props);
|
|
110
|
+
return {
|
|
111
|
+
...outline,
|
|
112
|
+
_hover: { ...outline._hover, bg: "gray.600" },
|
|
113
|
+
color: `${props.colorScheme}.400`,
|
|
114
|
+
borderColor: "gray.300",
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
kurtosisDisabled: (props) => {
|
|
118
|
+
const outline = theme.components.Button.variants.outline(props);
|
|
119
|
+
return {
|
|
120
|
+
...outline,
|
|
121
|
+
_hover: { ...outline._hover, bg: "gray.700", borderColor: "gray.300", cursor: "unset" },
|
|
122
|
+
_active: { ...outline._active, bg: "gray.700", borderColor: "gray.300", cursor: "unset" },
|
|
123
|
+
bg: "gray.700",
|
|
124
|
+
color: `${props.colorScheme}.100`,
|
|
125
|
+
borderColor: "gray.300",
|
|
126
|
+
};
|
|
127
|
+
},
|
|
128
|
+
solid: defineStyle((props) => ({
|
|
129
|
+
_hover: { bg: "gray.600" },
|
|
130
|
+
_active: { bg: "gray.600" },
|
|
131
|
+
color: `${props.colorScheme}.400`,
|
|
132
|
+
bg: "gray.700",
|
|
133
|
+
})),
|
|
134
|
+
ghost: defineStyle((props) => ({
|
|
135
|
+
_hover: { bg: "gray.650" },
|
|
136
|
+
color: props.colorScheme === "gray" ? undefined : `${props.colorScheme}.400`,
|
|
137
|
+
})),
|
|
138
|
+
sortableHeader: (props) => {
|
|
139
|
+
const ghost = theme.components.Button.variants.ghost(props);
|
|
140
|
+
return {
|
|
141
|
+
...ghost,
|
|
142
|
+
color: "gray.100",
|
|
143
|
+
textTransform: "uppercase",
|
|
144
|
+
};
|
|
145
|
+
},
|
|
146
|
+
fileTree: (props) => {
|
|
147
|
+
const ghost = theme.components.Button.variants.ghost(props);
|
|
148
|
+
return {
|
|
149
|
+
...ghost,
|
|
150
|
+
width: "100%",
|
|
151
|
+
fontWeight: "medium",
|
|
152
|
+
justifyContent: "flex-start",
|
|
153
|
+
};
|
|
154
|
+
},
|
|
155
|
+
breadcrumb: (props) => {
|
|
156
|
+
const ghost = theme.components.Button.variants.ghost(props);
|
|
157
|
+
return {
|
|
158
|
+
...ghost,
|
|
159
|
+
color: "gray.100",
|
|
160
|
+
};
|
|
161
|
+
},
|
|
162
|
+
nav: {
|
|
163
|
+
_active: {
|
|
164
|
+
bg: "gray.600",
|
|
165
|
+
color: "kurtosisGreen.400",
|
|
166
|
+
},
|
|
167
|
+
_hover: {
|
|
168
|
+
bg: "gray.600",
|
|
169
|
+
color: "white",
|
|
170
|
+
},
|
|
171
|
+
color: "gray.200",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
Breadcrumb: {
|
|
176
|
+
variants: {
|
|
177
|
+
topNavigation: {
|
|
178
|
+
link: {
|
|
179
|
+
"&[aria-current=page]": {
|
|
180
|
+
color: "gray.250",
|
|
181
|
+
},
|
|
182
|
+
fontSize: "sm",
|
|
183
|
+
lineHeight: "24px",
|
|
184
|
+
},
|
|
185
|
+
separator: {
|
|
186
|
+
color: "gray.250",
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
Card: {
|
|
192
|
+
variants: {
|
|
193
|
+
valueCard: {
|
|
194
|
+
container: {
|
|
195
|
+
bg: "gray.850",
|
|
196
|
+
borderRadius: "8px",
|
|
197
|
+
padding: "16px",
|
|
198
|
+
gap: "16px",
|
|
199
|
+
},
|
|
200
|
+
header: {
|
|
201
|
+
display: "flex",
|
|
202
|
+
flexDirection: "row",
|
|
203
|
+
justifyContent: "space-between",
|
|
204
|
+
padding: "0px",
|
|
205
|
+
},
|
|
206
|
+
body: {
|
|
207
|
+
padding: "0px",
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
titledCard: {
|
|
211
|
+
container: {
|
|
212
|
+
bgColor: "none",
|
|
213
|
+
borderColor: "gray.500",
|
|
214
|
+
borderStyle: "solid",
|
|
215
|
+
borderWidth: "1px",
|
|
216
|
+
borderRadius: "6px",
|
|
217
|
+
},
|
|
218
|
+
header: {
|
|
219
|
+
bg: "gray.850",
|
|
220
|
+
padding: "12px",
|
|
221
|
+
},
|
|
222
|
+
body: {
|
|
223
|
+
padding: "6px 12px",
|
|
224
|
+
height: "100%",
|
|
225
|
+
width: "100%",
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
Checkbox: {
|
|
231
|
+
defaultProps: {
|
|
232
|
+
size: "md",
|
|
233
|
+
},
|
|
234
|
+
baseStyle: defineStyle(({ colorScheme }) => ({
|
|
235
|
+
control: {
|
|
236
|
+
borderColor: `gray.400`,
|
|
237
|
+
_checked: {
|
|
238
|
+
bg: `${colorScheme}.500`,
|
|
239
|
+
borderColor: `${colorScheme}.500`,
|
|
240
|
+
color: `white`,
|
|
241
|
+
_hover: {
|
|
242
|
+
bg: `${colorScheme}.500`,
|
|
243
|
+
borderColor: `${colorScheme}.500`,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
_indeterminate: {
|
|
247
|
+
bg: `${colorScheme}.500`,
|
|
248
|
+
borderColor: `${colorScheme}.500`,
|
|
249
|
+
color: `white`,
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
})),
|
|
253
|
+
},
|
|
254
|
+
Form: formsTheme,
|
|
255
|
+
Menu: {
|
|
256
|
+
baseStyle: {
|
|
257
|
+
list: {
|
|
258
|
+
minW: "unset",
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
Popover: {
|
|
263
|
+
baseStyle: {
|
|
264
|
+
content: {
|
|
265
|
+
bg: "gray.500",
|
|
266
|
+
p: "8px",
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
Switch: {
|
|
271
|
+
defaultProps: {
|
|
272
|
+
colorScheme: "green",
|
|
273
|
+
},
|
|
274
|
+
baseStyle: defineStyle((props) => ({
|
|
275
|
+
track: {
|
|
276
|
+
_checked: {
|
|
277
|
+
bg: `${props.colorScheme}.500`,
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
})),
|
|
281
|
+
},
|
|
282
|
+
Table: {
|
|
283
|
+
variants: {
|
|
284
|
+
simple: {
|
|
285
|
+
tr: {
|
|
286
|
+
_notLast: {
|
|
287
|
+
borderBottom: "1px solid",
|
|
288
|
+
borderColor: "whiteAlpha.300",
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
th: {
|
|
292
|
+
color: "gray.100",
|
|
293
|
+
backgroundColor: "gray.850",
|
|
294
|
+
textTransform: "uppercase",
|
|
295
|
+
borderBottom: "1px solid",
|
|
296
|
+
borderColor: "whiteAlpha.300",
|
|
297
|
+
},
|
|
298
|
+
td: {
|
|
299
|
+
borderBottom: "none",
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
Tabs: tabsTheme,
|
|
305
|
+
Tag: tagTheme,
|
|
306
|
+
Tooltip: {
|
|
307
|
+
sizes: {
|
|
308
|
+
xs: defineStyle({
|
|
309
|
+
fontSize: "12px",
|
|
310
|
+
py: "2px",
|
|
311
|
+
px: "6px",
|
|
312
|
+
maxW: "200px",
|
|
313
|
+
}),
|
|
314
|
+
sm: defineStyle({
|
|
315
|
+
fontSize: "sm",
|
|
316
|
+
py: "1",
|
|
317
|
+
px: "2",
|
|
318
|
+
maxW: "200px",
|
|
319
|
+
}),
|
|
320
|
+
md: defineStyle({
|
|
321
|
+
fontSize: "md",
|
|
322
|
+
py: "2",
|
|
323
|
+
px: "3",
|
|
324
|
+
maxW: "300px",
|
|
325
|
+
}),
|
|
326
|
+
lg: defineStyle({
|
|
327
|
+
fontSize: "lg",
|
|
328
|
+
py: "2",
|
|
329
|
+
px: "4",
|
|
330
|
+
maxW: "350px",
|
|
331
|
+
}),
|
|
332
|
+
},
|
|
333
|
+
baseStyle: {
|
|
334
|
+
bg: "gray.500",
|
|
335
|
+
//https://github.com/chakra-ui/chakra-ui/issues/4695
|
|
336
|
+
["--popper-arrow-bg"]: "colors.gray.500",
|
|
337
|
+
color: "gray.100",
|
|
338
|
+
},
|
|
339
|
+
defaultProps: {
|
|
340
|
+
size: "xs",
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
});
|
|
345
|
+
export const KurtosisThemeProvider = ({ children, ...chakraProps }) => {
|
|
346
|
+
return (_jsxs(ChakraProvider, { theme: theme, toastOptions: { defaultOptions: { position: "top" } }, ...chakraProps, children: [_jsx(ColorModeFixer, {}), _jsx(Fonts, {}), children] }));
|
|
347
|
+
};
|
|
348
|
+
// This component handles legacy local storage settings on browsers that used the old
|
|
349
|
+
// emui, where the color mode may be set to 'light'.
|
|
350
|
+
const ColorModeFixer = () => {
|
|
351
|
+
const { colorMode, toggleColorMode } = useColorMode();
|
|
352
|
+
useEffect(() => {
|
|
353
|
+
// Currently only Dark Mode is supported.
|
|
354
|
+
if (colorMode === "light") {
|
|
355
|
+
toggleColorMode();
|
|
356
|
+
}
|
|
357
|
+
}, [colorMode, toggleColorMode]);
|
|
358
|
+
return null;
|
|
359
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IconButtonProps } from "@chakra-ui/react";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
export type NavigationProps = {};
|
|
4
|
+
export declare const Navigation: ({ children }: PropsWithChildren & NavigationProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
type NavButtonProps = Omit<IconButtonProps, "aria-label"> & {
|
|
6
|
+
label: string;
|
|
7
|
+
Icon: React.ReactElement;
|
|
8
|
+
};
|
|
9
|
+
export declare const NavButton: ({ Icon, label, ...iconButtonProps }: NavButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Flex, IconButton, Image, Tooltip } from "@chakra-ui/react";
|
|
3
|
+
import { useHref } from "react-router-dom";
|
|
4
|
+
export const Navigation = ({ children }) => {
|
|
5
|
+
const logoHref = useHref("/logo.png");
|
|
6
|
+
return (_jsxs(Flex, { as: "nav", className: "primaryNav", flexDirection: "column", alignItems: "center", gap: "36px", position: "fixed", top: "0", h: "100vh", p: "20px 16px", children: [_jsx(Flex, { width: "40px", height: "40px", alignItems: "center", children: _jsx(Image, { src: logoHref }) }), _jsx(Flex, { flexDirection: "column", gap: "16px", children: children })] }));
|
|
7
|
+
};
|
|
8
|
+
export const NavButton = ({ Icon, label, ...iconButtonProps }) => {
|
|
9
|
+
return (_jsx(Tooltip, { label: label, hasArrow: true, placement: "right", openDelay: 500, children: _jsx(IconButton, { ...iconButtonProps, colorScheme: "kurtosis", "aria-label": label, variant: "nav", size: "lg", icon: Icon }) }));
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ButtonProps } from "@chakra-ui/react";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
type EnclaveSourceProps = PropsWithChildren<ButtonProps & {
|
|
4
|
+
source: "loading" | string | null;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const PackageSourceButton: ({ source, children, ...buttonProps }: EnclaveSourceProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button, ButtonGroup, Icon, Link, Spinner, Tag, Tooltip } from "@chakra-ui/react";
|
|
3
|
+
import { IoLogoGithub } from "react-icons/io";
|
|
4
|
+
import { isDefined, parsePackageUrl, wrapResult } from "./utils";
|
|
5
|
+
export const PackageSourceButton = ({ source, children, ...buttonProps }) => {
|
|
6
|
+
if (!isDefined(source)) {
|
|
7
|
+
return _jsx(Tag, { children: "Unknown" });
|
|
8
|
+
}
|
|
9
|
+
if (source === "loading") {
|
|
10
|
+
return _jsx(Spinner, { size: "xs" });
|
|
11
|
+
}
|
|
12
|
+
let button = (_jsx(Link, { href: `https://${source}`, target: "_blank", rel: "noopener noreferrer", w: buttonProps.w || buttonProps.width, children: _jsx(Button, { variant: "ghost", size: "xs", ...buttonProps, children: children || source }) }));
|
|
13
|
+
if (source.startsWith("github.com/")) {
|
|
14
|
+
const repositoryResult = wrapResult(() => parsePackageUrl(source));
|
|
15
|
+
if (repositoryResult.isOk) {
|
|
16
|
+
const repository = repositoryResult.value;
|
|
17
|
+
const url = `https://${repository.baseUrl}/${repository.owner}/${repository.name}${isDefined(repository.rootPath) && repository.rootPath !== "/" ? "/tree/main/" + repository.rootPath : ""}`;
|
|
18
|
+
button = (_jsx(Link, { href: url, target: "_blank", rel: "noopener noreferrer", w: buttonProps.w || buttonProps.width, children: _jsx(Button, { leftIcon: _jsx(Icon, { as: IoLogoGithub, color: "gray.400" }), variant: "ghost", size: "xs", ...buttonProps, children: children || source.replace("github.com/", "") }) }));
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
button = (_jsx(Tooltip, { shouldWrapChildren: true, label: repositoryResult.error, children: _jsx("a", { href: `https://${source}`, target: "_blank", rel: "noopener noreferrer", children: _jsx(Button, { variant: "ghost", size: "xs", ...buttonProps, colorScheme: "red", children: children || source }) }) }));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return _jsx(ButtonGroup, { children: button });
|
|
25
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { HeadingProps } from "@chakra-ui/react";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
type PageTitleProps = PropsWithChildren<HeadingProps>;
|
|
4
|
+
export declare const PageTitle: ({ children, ...headingProps }: PageTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Heading } from "@chakra-ui/react";
|
|
3
|
+
export const PageTitle = ({ children, ...headingProps }) => {
|
|
4
|
+
return (_jsx(Heading, { fontSize: "lg", fontWeight: "medium", pl: "8px", ...headingProps, children: children }));
|
|
5
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ButtonProps, IconButtonProps } from "@chakra-ui/react";
|
|
2
|
+
type PasteButtonProps<IsIconButton extends boolean> = (IsIconButton extends true ? IconButtonProps : ButtonProps) & {
|
|
3
|
+
onValuePasted: (value: string) => void;
|
|
4
|
+
text?: IsIconButton extends true ? string : never;
|
|
5
|
+
isIconButton?: IsIconButton;
|
|
6
|
+
};
|
|
7
|
+
export declare const PasteButton: <IsIconButton extends boolean>({ onValuePasted, text, isIconButton, ...buttonProps }: PasteButtonProps<IsIconButton>) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button, IconButton } from "@chakra-ui/react";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { FiClipboard } from "react-icons/fi";
|
|
5
|
+
import { isDefined } from "./utils";
|
|
6
|
+
export const PasteButton = ({ onValuePasted, text, isIconButton, ...buttonProps }) => {
|
|
7
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
8
|
+
const handlePasteClick = async () => {
|
|
9
|
+
setIsLoading(true);
|
|
10
|
+
const value = await navigator.clipboard.readText();
|
|
11
|
+
setIsLoading(false);
|
|
12
|
+
if (isDefined(value)) {
|
|
13
|
+
onValuePasted(value);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
// Firefox does not support programmatic clipboard.readText
|
|
17
|
+
//https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText
|
|
18
|
+
if (!isDefined(onValuePasted) || !isDefined(navigator.clipboard.readText)) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
if (isIconButton) {
|
|
22
|
+
return (_jsx(IconButton, { icon: _jsx(FiClipboard, {}), size: "xs", variant: "ghost", colorScheme: "darkBlue", onClick: handlePasteClick, isLoading: isLoading, ...buttonProps, children: text || "Paste" }));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return (_jsx(Button, { leftIcon: _jsx(FiClipboard, {}), size: "xs", colorScheme: "darkBlue", onClick: handlePasteClick, isLoading: isLoading, ...buttonProps, children: text || "Paste" }));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Flex, Text } from "@chakra-ui/react";
|
|
3
|
+
export const TitledBox = ({ title, children }) => {
|
|
4
|
+
return (_jsxs(Flex, { flexDirection: "column", alignItems: "center", gap: "16px", children: [_jsx(Flex, { justifyContent: "flex-start", width: "100%", children: _jsx(Text, { fontSize: "lg", fontWeight: "medium", children: title }) }), children] }));
|
|
5
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CardProps } from "@chakra-ui/react";
|
|
2
|
+
import { PropsWithChildren, ReactElement } from "react";
|
|
3
|
+
type TitledCardProps = CardProps & PropsWithChildren<{
|
|
4
|
+
title: string;
|
|
5
|
+
fillContainer?: boolean;
|
|
6
|
+
controls?: ReactElement;
|
|
7
|
+
rightControls?: ReactElement;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const TitledCard: ({ title, fillContainer, controls, rightControls, children, ...cardProps }: TitledCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Card, CardBody, CardHeader, Flex, Text } from "@chakra-ui/react";
|
|
3
|
+
export const TitledCard = ({ title, fillContainer, controls, rightControls, children, ...cardProps }) => {
|
|
4
|
+
return (_jsxs(Card, { variant: "titledCard", overflow: fillContainer ? "clip" : undefined, ...cardProps, children: [_jsxs(CardHeader, { display: "flex", justifyContent: "space-between", alignItems: "center", width: "100%", gap: "16px", borderBottom: "1px solid", borderBottomColor: "gray.500", children: [_jsxs(Flex, { justifyContent: "flex-start", gap: "16px", alignItems: "center", children: [_jsx(Text, { as: "span", fontSize: "xs", fontWeight: "semibold", wordBreak: "break-all", children: title }), controls] }), _jsx(Flex, { children: rightControls })] }), _jsx(CardBody, { overflow: fillContainer ? "auto" : undefined, children: children })] }));
|
|
5
|
+
};
|
package/build/Toasts.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CheckCircleIcon } from "@chakra-ui/icons";
|
|
3
|
+
import { Flex, forwardRef, Icon, Text } from "@chakra-ui/react";
|
|
4
|
+
export const SuccessToast = forwardRef(({ message }, ref) => {
|
|
5
|
+
return (_jsxs(Flex, { ref: ref, bg: "rgba(0, 194, 35, 0.24)", p: "6px 16px", borderRadius: "6px", gap: "12px", children: [_jsx(Icon, { height: "24px", width: "24px", as: CheckCircleIcon, color: "kurtosisGreen.400" }), _jsx(Text, { fontWeight: "bold", fontSize: "lg", children: message })] }));
|
|
6
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
type ValueCardProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
value: string | ReactElement;
|
|
5
|
+
copyEnabled?: boolean;
|
|
6
|
+
copyValue?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const ValueCard: ({ title, value, copyEnabled, copyValue }: ValueCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Card, CardBody, CardHeader, Text } from "@chakra-ui/react";
|
|
3
|
+
import { CopyButton } from "./CopyButton";
|
|
4
|
+
import { isDefined } from "./utils";
|
|
5
|
+
export const ValueCard = ({ title, value, copyEnabled, copyValue }) => {
|
|
6
|
+
return (_jsxs(Card, { variant: "valueCard", height: "100%", children: [_jsxs(CardHeader, { children: [_jsx(Text, { fontSize: "sm", fontWeight: "extrabold", textTransform: "uppercase", color: "gray.400", children: title }), copyEnabled && (_jsx(CopyButton, { isIconButton: true, "aria-label": "Copy this value", valueToCopy: isDefined(copyValue) ? copyValue : typeof value === "string" ? value : null, contentName: title, color: "gray.400", colorScheme: "gray" }))] }), _jsx(CardBody, { children: _jsx(Text, { as: "div", fontSize: "xl", children: value }) })] }));
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KurtosisPackage } from "kurtosis-cloud-indexer-sdk";
|
|
2
|
+
type KurtosisPackageCardProps = {
|
|
3
|
+
kurtosisPackage: KurtosisPackage;
|
|
4
|
+
onRunClick: () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const KurtosisPackageCard: ({ kurtosisPackage, onRunClick }: KurtosisPackageCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|