@solo-io-public/ui-components 0.0.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/LICENSE +201 -0
- package/README.md +167 -0
- package/dist/Button.style-CCplEN2o.js +474 -0
- package/dist/Button.style-CCplEN2o.js.map +1 -0
- package/dist/Button.style-CI6Xbod7.cjs +10 -0
- package/dist/Button.style-CI6Xbod7.cjs.map +1 -0
- package/dist/_internal/Svg.d.ts +15 -0
- package/dist/_internal/colors.d.ts +17 -0
- package/dist/_internal/gradients.d.ts +11 -0
- package/dist/_internal/hexAddAlpha.d.ts +3 -0
- package/dist/_internal/palette.d.ts +30 -0
- package/dist/_internal/sizing.d.ts +14 -0
- package/dist/_internal/unstyledButton.d.ts +8 -0
- package/dist/_internal/utils.d.ts +7 -0
- package/dist/components/Alert/Alert.d.ts +17 -0
- package/dist/components/Alert/index.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +32 -0
- package/dist/components/Button/Button.style.d.ts +48 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/CloseButton/CloseButton.d.ts +14 -0
- package/dist/components/CloseButton/index.d.ts +1 -0
- package/dist/components/Layout/FlexLayout.d.ts +83 -0
- package/dist/components/Layout/Spacer.d.ts +80 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/MonacoEditor/EditorSettingsContext.d.ts +15 -0
- package/dist/components/MonacoEditor/MonacoEditorWithSettings.d.ts +20 -0
- package/dist/components/MonacoEditor/index.d.ts +2 -0
- package/dist/components/Text/Text.d.ts +71 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/providers/SoloContextProvider.d.ts +62 -0
- package/dist/providers/SoloModeContext.d.ts +5 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/solo-components.cjs +56 -0
- package/dist/solo-components.cjs.map +1 -0
- package/dist/solo-components.js +664 -0
- package/dist/solo-components.js.map +1 -0
- package/dist/styles.cjs +2 -0
- package/dist/styles.cjs.map +1 -0
- package/dist/styles.d.ts +1 -0
- package/dist/styles.js +5 -0
- package/dist/styles.js.map +1 -0
- package/package.json +109 -0
- package/src/_internal/Svg.tsx +58 -0
- package/src/_internal/colors.ts +26 -0
- package/src/_internal/gradients.ts +36 -0
- package/src/_internal/hexAddAlpha.ts +9 -0
- package/src/_internal/palette.ts +46 -0
- package/src/_internal/sizing.ts +15 -0
- package/src/_internal/unstyledButton.ts +17 -0
- package/src/_internal/utils.ts +11 -0
- package/src/components/Alert/Alert.stories.tsx +44 -0
- package/src/components/Alert/Alert.tsx +168 -0
- package/src/components/Alert/index.ts +1 -0
- package/src/components/Button/Button.stories.tsx +62 -0
- package/src/components/Button/Button.style.ts +158 -0
- package/src/components/Button/Button.test.tsx +47 -0
- package/src/components/Button/Button.tsx +84 -0
- package/src/components/Button/index.ts +11 -0
- package/src/components/CloseButton/CloseButton.tsx +76 -0
- package/src/components/CloseButton/index.ts +1 -0
- package/src/components/Layout/FlexLayout.tsx +101 -0
- package/src/components/Layout/Spacer.tsx +131 -0
- package/src/components/Layout/index.ts +2 -0
- package/src/components/MonacoEditor/EditorSettingsContext.test.tsx +55 -0
- package/src/components/MonacoEditor/EditorSettingsContext.tsx +63 -0
- package/src/components/MonacoEditor/MonacoEditor.stories.tsx +197 -0
- package/src/components/MonacoEditor/MonacoEditorWithSettings.tsx +376 -0
- package/src/components/MonacoEditor/index.ts +9 -0
- package/src/components/Text/Text.stories.tsx +63 -0
- package/src/components/Text/Text.tsx +65 -0
- package/src/components/Text/index.ts +1 -0
- package/src/index.ts +7 -0
- package/src/providers/SoloContextProvider.tsx +213 -0
- package/src/providers/SoloModeContext.tsx +13 -0
- package/src/providers/index.ts +10 -0
- package/src/styles.ts +5 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ElementOf } from '../../_internal/utils';
|
|
2
|
+
import { buttonVariants } from './Button';
|
|
3
|
+
export declare const StyledButton: import('@emotion/styled').StyledComponent<{
|
|
4
|
+
theme?: import('@emotion/react').Theme;
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
} & {
|
|
7
|
+
stylingOverrides?: import('@emotion/utils').SerializedStyles;
|
|
8
|
+
} & import('react').ClassAttributes<HTMLButtonElement> & import('react').ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
9
|
+
theme?: import('@emotion/react').Theme;
|
|
10
|
+
} & {
|
|
11
|
+
variant?: ElementOf<(typeof buttonVariants)["variants"]>;
|
|
12
|
+
color?: ElementOf<(typeof buttonVariants)["colors"]>;
|
|
13
|
+
size?: ElementOf<(typeof buttonVariants)["sizes"]>;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
isSquareIconButton?: boolean;
|
|
16
|
+
isCircleIconButton?: boolean;
|
|
17
|
+
minWidth?: import('react').CSSProperties["minWidth"];
|
|
18
|
+
leftIcon?: import('react').ReactNode;
|
|
19
|
+
rightIcon?: import('react').ReactNode;
|
|
20
|
+
uiTestId?: string;
|
|
21
|
+
styleOverrides?: import('@emotion/utils').SerializedStyles;
|
|
22
|
+
} & {
|
|
23
|
+
children?: import('react').ReactNode | undefined;
|
|
24
|
+
}, {}, {}>;
|
|
25
|
+
export declare namespace SoloButtonStyles {
|
|
26
|
+
const StyledButton: import("@emotion/styled").StyledComponent<{
|
|
27
|
+
theme?: import("@emotion/react").Theme;
|
|
28
|
+
as?: React.ElementType;
|
|
29
|
+
} & {
|
|
30
|
+
stylingOverrides?: import("@emotion/utils").SerializedStyles;
|
|
31
|
+
} & import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
32
|
+
theme?: import("@emotion/react").Theme;
|
|
33
|
+
} & {
|
|
34
|
+
variant?: ElementOf<(typeof buttonVariants)["variants"]>;
|
|
35
|
+
color?: ElementOf<(typeof buttonVariants)["colors"]>;
|
|
36
|
+
size?: ElementOf<(typeof buttonVariants)["sizes"]>;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
isSquareIconButton?: boolean;
|
|
39
|
+
isCircleIconButton?: boolean;
|
|
40
|
+
minWidth?: import("react").CSSProperties["minWidth"];
|
|
41
|
+
leftIcon?: import("react").ReactNode;
|
|
42
|
+
rightIcon?: import("react").ReactNode;
|
|
43
|
+
uiTestId?: string;
|
|
44
|
+
styleOverrides?: import("@emotion/utils").SerializedStyles;
|
|
45
|
+
} & {
|
|
46
|
+
children?: import("react").ReactNode | undefined;
|
|
47
|
+
}, {}, {}>;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button, IconButton, buttonSvg, buttonVariants, type ButtonProps, type ButtonPropsBase, type IconButtonProps } from './Button';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
3
|
+
export interface CloseButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
/** X icon size in px. */
|
|
5
|
+
size?: number;
|
|
6
|
+
/** Emotion styles appended to the button. */
|
|
7
|
+
styleOverrides?: SerializedStyles;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A minimal "×" icon button (Lucide `X`). Inherits its color from context
|
|
11
|
+
* (override via `style`/`styleOverrides`); hover/active washes derive from that
|
|
12
|
+
* color, so it sits cleanly on any surface — alerts, drawers, modals, etc.
|
|
13
|
+
*/
|
|
14
|
+
export declare function CloseButton({ size, styleOverrides, type, 'aria-label': ariaLabel, ...props }: CloseButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CloseButton, type CloseButtonProps } from './CloseButton';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { SpacerProps } from './Spacer';
|
|
3
|
+
export type FlexLayoutProps = SpacerProps & {
|
|
4
|
+
horizontal?: boolean;
|
|
5
|
+
vertical?: boolean;
|
|
6
|
+
gap?: CSSProperties['gap'] | number;
|
|
7
|
+
display?: CSSProperties['display'];
|
|
8
|
+
flexWrap?: CSSProperties['flexWrap'];
|
|
9
|
+
justifyContent?: CSSProperties['justifyContent'];
|
|
10
|
+
alignItems?: CSSProperties['alignItems'];
|
|
11
|
+
alignContent?: CSSProperties['alignContent'];
|
|
12
|
+
flexDirection?: CSSProperties['flexDirection'];
|
|
13
|
+
overflow?: CSSProperties['overflow'];
|
|
14
|
+
column?: boolean;
|
|
15
|
+
row?: boolean;
|
|
16
|
+
nowrap?: boolean;
|
|
17
|
+
expandChildren?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Quick horizontal, vertical, or centered (horizontal & vertical) flex layout.
|
|
21
|
+
* A numeric `gap` is treated as a 0.25em scale step (e.g. `gap={3}` → `0.75em`).
|
|
22
|
+
*/
|
|
23
|
+
export declare const FlexLayout: import('@emotion/styled').StyledComponent<{
|
|
24
|
+
theme?: import('@emotion/react').Theme;
|
|
25
|
+
as?: React.ElementType;
|
|
26
|
+
} & {
|
|
27
|
+
mx?: string;
|
|
28
|
+
my?: string;
|
|
29
|
+
mr?: string;
|
|
30
|
+
ml?: string;
|
|
31
|
+
mt?: string;
|
|
32
|
+
mb?: string;
|
|
33
|
+
margin?: string;
|
|
34
|
+
px?: string;
|
|
35
|
+
py?: string;
|
|
36
|
+
pr?: string;
|
|
37
|
+
pl?: string;
|
|
38
|
+
pt?: string;
|
|
39
|
+
pb?: string;
|
|
40
|
+
padding?: string;
|
|
41
|
+
display?: CSSProperties["display"];
|
|
42
|
+
position?: CSSProperties["position"];
|
|
43
|
+
minHeight?: string | number;
|
|
44
|
+
minWidth?: CSSProperties["minWidth"];
|
|
45
|
+
height?: string | number;
|
|
46
|
+
width?: string | number;
|
|
47
|
+
maxHeight?: CSSProperties["maxHeight"];
|
|
48
|
+
maxWidth?: CSSProperties["maxWidth"];
|
|
49
|
+
flexGrow?: CSSProperties["flexGrow"];
|
|
50
|
+
flexBasis?: CSSProperties["flexBasis"];
|
|
51
|
+
flexShrink?: CSSProperties["flexShrink"];
|
|
52
|
+
overflowY?: CSSProperties["overflowY"];
|
|
53
|
+
overflowX?: CSSProperties["overflowX"];
|
|
54
|
+
textOverflow?: CSSProperties["textOverflow"];
|
|
55
|
+
overflow?: CSSProperties["overflow"];
|
|
56
|
+
zIndex?: CSSProperties["zIndex"];
|
|
57
|
+
stylingOverrides?: import('@emotion/utils').SerializedStyles;
|
|
58
|
+
fadeIn?: boolean;
|
|
59
|
+
} & import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & {
|
|
60
|
+
theme?: import('@emotion/react').Theme;
|
|
61
|
+
} & {
|
|
62
|
+
horizontal?: boolean;
|
|
63
|
+
vertical?: boolean;
|
|
64
|
+
gap?: CSSProperties["gap"] | number;
|
|
65
|
+
display?: CSSProperties["display"];
|
|
66
|
+
flexWrap?: CSSProperties["flexWrap"];
|
|
67
|
+
justifyContent?: CSSProperties["justifyContent"];
|
|
68
|
+
alignItems?: CSSProperties["alignItems"];
|
|
69
|
+
alignContent?: CSSProperties["alignContent"];
|
|
70
|
+
flexDirection?: CSSProperties["flexDirection"];
|
|
71
|
+
overflow?: CSSProperties["overflow"];
|
|
72
|
+
column?: boolean;
|
|
73
|
+
row?: boolean;
|
|
74
|
+
nowrap?: boolean;
|
|
75
|
+
expandChildren?: boolean;
|
|
76
|
+
}, {}, {}>;
|
|
77
|
+
/** Adds a `flex-grow: 1` filler into a flex layout. */
|
|
78
|
+
export declare const FlexLayoutSpacer: import('@emotion/styled').StyledComponent<{
|
|
79
|
+
theme?: import('@emotion/react').Theme;
|
|
80
|
+
as?: React.ElementType;
|
|
81
|
+
} & {
|
|
82
|
+
flexBasis?: CSSProperties["flexBasis"];
|
|
83
|
+
}, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import { ComponentProps, CSSProperties } from 'react';
|
|
3
|
+
type SizeType = number | string;
|
|
4
|
+
/**
|
|
5
|
+
* Margin/padding/sizing primitive. Use a string for exact values
|
|
6
|
+
* (e.g. `mx='5px'`). Directional props (`mr`, `mb`, …) override the axis
|
|
7
|
+
* shorthands (`mx`, `my`).
|
|
8
|
+
*/
|
|
9
|
+
export type SpacerProps = {
|
|
10
|
+
mx?: string;
|
|
11
|
+
my?: string;
|
|
12
|
+
mr?: string;
|
|
13
|
+
ml?: string;
|
|
14
|
+
mt?: string;
|
|
15
|
+
mb?: string;
|
|
16
|
+
margin?: string;
|
|
17
|
+
px?: string;
|
|
18
|
+
py?: string;
|
|
19
|
+
pr?: string;
|
|
20
|
+
pl?: string;
|
|
21
|
+
pt?: string;
|
|
22
|
+
pb?: string;
|
|
23
|
+
padding?: string;
|
|
24
|
+
display?: CSSProperties['display'];
|
|
25
|
+
position?: CSSProperties['position'];
|
|
26
|
+
minHeight?: SizeType;
|
|
27
|
+
minWidth?: CSSProperties['minWidth'];
|
|
28
|
+
height?: SizeType;
|
|
29
|
+
width?: SizeType;
|
|
30
|
+
maxHeight?: CSSProperties['maxHeight'];
|
|
31
|
+
maxWidth?: CSSProperties['maxWidth'];
|
|
32
|
+
flexGrow?: CSSProperties['flexGrow'];
|
|
33
|
+
flexBasis?: CSSProperties['flexBasis'];
|
|
34
|
+
flexShrink?: CSSProperties['flexShrink'];
|
|
35
|
+
overflowY?: CSSProperties['overflowY'];
|
|
36
|
+
overflowX?: CSSProperties['overflowX'];
|
|
37
|
+
textOverflow?: CSSProperties['textOverflow'];
|
|
38
|
+
overflow?: CSSProperties['overflow'];
|
|
39
|
+
zIndex?: CSSProperties['zIndex'];
|
|
40
|
+
stylingOverrides?: SerializedStyles;
|
|
41
|
+
fadeIn?: boolean;
|
|
42
|
+
} & ComponentProps<'div'>;
|
|
43
|
+
export declare const Spacer: import('@emotion/styled').StyledComponent<{
|
|
44
|
+
theme?: import('@emotion/react').Theme;
|
|
45
|
+
as?: React.ElementType;
|
|
46
|
+
} & {
|
|
47
|
+
mx?: string;
|
|
48
|
+
my?: string;
|
|
49
|
+
mr?: string;
|
|
50
|
+
ml?: string;
|
|
51
|
+
mt?: string;
|
|
52
|
+
mb?: string;
|
|
53
|
+
margin?: string;
|
|
54
|
+
px?: string;
|
|
55
|
+
py?: string;
|
|
56
|
+
pr?: string;
|
|
57
|
+
pl?: string;
|
|
58
|
+
pt?: string;
|
|
59
|
+
pb?: string;
|
|
60
|
+
padding?: string;
|
|
61
|
+
display?: CSSProperties["display"];
|
|
62
|
+
position?: CSSProperties["position"];
|
|
63
|
+
minHeight?: SizeType;
|
|
64
|
+
minWidth?: CSSProperties["minWidth"];
|
|
65
|
+
height?: SizeType;
|
|
66
|
+
width?: SizeType;
|
|
67
|
+
maxHeight?: CSSProperties["maxHeight"];
|
|
68
|
+
maxWidth?: CSSProperties["maxWidth"];
|
|
69
|
+
flexGrow?: CSSProperties["flexGrow"];
|
|
70
|
+
flexBasis?: CSSProperties["flexBasis"];
|
|
71
|
+
flexShrink?: CSSProperties["flexShrink"];
|
|
72
|
+
overflowY?: CSSProperties["overflowY"];
|
|
73
|
+
overflowX?: CSSProperties["overflowX"];
|
|
74
|
+
textOverflow?: CSSProperties["textOverflow"];
|
|
75
|
+
overflow?: CSSProperties["overflow"];
|
|
76
|
+
zIndex?: CSSProperties["zIndex"];
|
|
77
|
+
stylingOverrides?: SerializedStyles;
|
|
78
|
+
fadeIn?: boolean;
|
|
79
|
+
} & import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface EditorSettings {
|
|
3
|
+
vimEnabled: boolean;
|
|
4
|
+
toggleVimMode: () => void;
|
|
5
|
+
wordWrapEnabled: boolean;
|
|
6
|
+
toggleWordWrap: () => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Provides per-user editor preferences (vim mode, word wrap), persisted to
|
|
10
|
+
* `localStorage`. Wrap any tree that renders `<MonacoEditorWithSettings />`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function EditorSettingsProvider({ children }: {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function useEditorSettings(): EditorSettings;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import { OnMount } from '@monaco-editor/react';
|
|
3
|
+
import type * as monacoEditor from 'monaco-editor';
|
|
4
|
+
export interface MonacoEditorWithSettingsProps {
|
|
5
|
+
value: string;
|
|
6
|
+
onChange?: (value: string | undefined) => void;
|
|
7
|
+
language: string;
|
|
8
|
+
height?: string;
|
|
9
|
+
/** Defaults to the active `SoloContextProvider` mode when omitted. */
|
|
10
|
+
theme?: 'light' | 'dark';
|
|
11
|
+
options?: monacoEditor.editor.IStandaloneEditorConstructionOptions;
|
|
12
|
+
onMount?: OnMount;
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
downloadFileName?: string;
|
|
15
|
+
onSave?: () => void;
|
|
16
|
+
onQuit?: () => void;
|
|
17
|
+
/** Emotion styles appended to the outer container. */
|
|
18
|
+
styleOverrides?: SerializedStyles;
|
|
19
|
+
}
|
|
20
|
+
export declare function MonacoEditorWithSettings({ value, onChange, language, height, theme, options, onMount, readOnly, downloadFileName, onSave, onQuit, styleOverrides, }: MonacoEditorWithSettingsProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { SpacerProps } from '../Layout/Spacer';
|
|
3
|
+
/**
|
|
4
|
+
* Typography primitive built on `Spacer` (so margin/padding/sizing props work
|
|
5
|
+
* too). Defaults to the theme's `--color-text-primary`, so text color follows
|
|
6
|
+
* the active light/dark mode unless `color` is set explicitly.
|
|
7
|
+
*/
|
|
8
|
+
export type TextProps = SpacerProps & {
|
|
9
|
+
size?: CSSProperties['fontSize'];
|
|
10
|
+
weight?: CSSProperties['fontWeight'];
|
|
11
|
+
lineHeight?: CSSProperties['lineHeight'];
|
|
12
|
+
color?: CSSProperties['color'];
|
|
13
|
+
textAlign?: CSSProperties['textAlign'];
|
|
14
|
+
whiteSpace?: CSSProperties['whiteSpace'];
|
|
15
|
+
truncate?: boolean;
|
|
16
|
+
wordBreak?: CSSProperties['wordBreak'];
|
|
17
|
+
textTransform?: CSSProperties['textTransform'];
|
|
18
|
+
fontStyle?: CSSProperties['fontStyle'];
|
|
19
|
+
inline?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const Text: import('@emotion/styled').StyledComponent<{
|
|
22
|
+
theme?: import('@emotion/react').Theme;
|
|
23
|
+
as?: React.ElementType;
|
|
24
|
+
} & {
|
|
25
|
+
mx?: string;
|
|
26
|
+
my?: string;
|
|
27
|
+
mr?: string;
|
|
28
|
+
ml?: string;
|
|
29
|
+
mt?: string;
|
|
30
|
+
mb?: string;
|
|
31
|
+
margin?: string;
|
|
32
|
+
px?: string;
|
|
33
|
+
py?: string;
|
|
34
|
+
pr?: string;
|
|
35
|
+
pl?: string;
|
|
36
|
+
pt?: string;
|
|
37
|
+
pb?: string;
|
|
38
|
+
padding?: string;
|
|
39
|
+
display?: CSSProperties["display"];
|
|
40
|
+
position?: CSSProperties["position"];
|
|
41
|
+
minHeight?: string | number;
|
|
42
|
+
minWidth?: CSSProperties["minWidth"];
|
|
43
|
+
height?: string | number;
|
|
44
|
+
width?: string | number;
|
|
45
|
+
maxHeight?: CSSProperties["maxHeight"];
|
|
46
|
+
maxWidth?: CSSProperties["maxWidth"];
|
|
47
|
+
flexGrow?: CSSProperties["flexGrow"];
|
|
48
|
+
flexBasis?: CSSProperties["flexBasis"];
|
|
49
|
+
flexShrink?: CSSProperties["flexShrink"];
|
|
50
|
+
overflowY?: CSSProperties["overflowY"];
|
|
51
|
+
overflowX?: CSSProperties["overflowX"];
|
|
52
|
+
textOverflow?: CSSProperties["textOverflow"];
|
|
53
|
+
overflow?: CSSProperties["overflow"];
|
|
54
|
+
zIndex?: CSSProperties["zIndex"];
|
|
55
|
+
stylingOverrides?: import('@emotion/utils').SerializedStyles;
|
|
56
|
+
fadeIn?: boolean;
|
|
57
|
+
} & import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & {
|
|
58
|
+
theme?: import('@emotion/react').Theme;
|
|
59
|
+
} & {
|
|
60
|
+
size?: CSSProperties["fontSize"];
|
|
61
|
+
weight?: CSSProperties["fontWeight"];
|
|
62
|
+
lineHeight?: CSSProperties["lineHeight"];
|
|
63
|
+
color?: CSSProperties["color"];
|
|
64
|
+
textAlign?: CSSProperties["textAlign"];
|
|
65
|
+
whiteSpace?: CSSProperties["whiteSpace"];
|
|
66
|
+
truncate?: boolean;
|
|
67
|
+
wordBreak?: CSSProperties["wordBreak"];
|
|
68
|
+
textTransform?: CSSProperties["textTransform"];
|
|
69
|
+
fontStyle?: CSSProperties["fontStyle"];
|
|
70
|
+
inline?: boolean;
|
|
71
|
+
}, {}, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Text, type TextProps } from './Text';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './components/Alert';
|
|
2
|
+
export * from './components/Button';
|
|
3
|
+
export * from './components/CloseButton';
|
|
4
|
+
export * from './components/Layout';
|
|
5
|
+
export * from './components/MonacoEditor';
|
|
6
|
+
export * from './components/Text';
|
|
7
|
+
export * from './providers';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ToasterProps } from 'react-hot-toast';
|
|
3
|
+
import { SoloMode } from './SoloModeContext';
|
|
4
|
+
/** Theme tokens the library — and the Monaco editor chrome — read from. */
|
|
5
|
+
export interface SoloTheme {
|
|
6
|
+
mode: SoloMode;
|
|
7
|
+
fontFamily: string;
|
|
8
|
+
colors: {
|
|
9
|
+
background: string;
|
|
10
|
+
bgElevated: string;
|
|
11
|
+
bgHover: string;
|
|
12
|
+
/** Pressed/active surface — a clearly distinct step from `bgHover`. */
|
|
13
|
+
bgActive: string;
|
|
14
|
+
borderBase: string;
|
|
15
|
+
primary: string;
|
|
16
|
+
textPrimary: string;
|
|
17
|
+
textSecondary: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** Default Solo theme (dark). */
|
|
21
|
+
export declare const defaultSoloTheme: SoloTheme;
|
|
22
|
+
/** Theme overrides — non-recursive (one level of `colors`) to keep types cheap. */
|
|
23
|
+
export interface SoloThemeOverride {
|
|
24
|
+
fontFamily?: string;
|
|
25
|
+
colors?: Partial<SoloTheme['colors']>;
|
|
26
|
+
}
|
|
27
|
+
/** Toggle which providers `SoloContextProvider` sets up. Each defaults to `true`. */
|
|
28
|
+
export interface SoloFeatures {
|
|
29
|
+
/** emotion `ThemeProvider`, the `--color-*` CSS variables, and the web fonts. */
|
|
30
|
+
theme?: boolean;
|
|
31
|
+
/** react-hot-toast `<Toaster />`. */
|
|
32
|
+
toaster?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** Fully typed customization for the enabled features. */
|
|
35
|
+
export interface SoloConfig {
|
|
36
|
+
/** Theme overrides, merged over the mode palette and any outer `ThemeProvider`. */
|
|
37
|
+
theme?: SoloThemeOverride;
|
|
38
|
+
/** Props for the bundled react-hot-toast `<Toaster />`. */
|
|
39
|
+
toaster?: ToasterProps;
|
|
40
|
+
}
|
|
41
|
+
export interface SoloContextProviderProps {
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
/** Light or dark color mode. Drives the palette and the editor's default theme. Defaults to `'dark'`. */
|
|
44
|
+
mode?: SoloMode;
|
|
45
|
+
/** Toggle which providers are set up. Each feature defaults to on. */
|
|
46
|
+
features?: SoloFeatures;
|
|
47
|
+
/** Fully typed customization for the enabled features. */
|
|
48
|
+
config?: SoloConfig;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Single top-level provider for apps consuming this library. Composes the
|
|
52
|
+
* color mode + emotion theme (web fonts + the `--color-*` CSS variables the
|
|
53
|
+
* editor chrome reads), editor settings, and a react-hot-toast `<Toaster />` —
|
|
54
|
+
* so the library's components work as drop-ins.
|
|
55
|
+
*
|
|
56
|
+
* Opinionated by default (closed to modification), open to extension: pick
|
|
57
|
+
* `mode`, toggle pieces with `features`, and customize them with `config`.
|
|
58
|
+
*
|
|
59
|
+
* The body reads top-down as the provider tree it renders:
|
|
60
|
+
* mode → theme → editor settings → toaster → your app.
|
|
61
|
+
*/
|
|
62
|
+
export declare function SoloContextProvider({ children, mode, features, config }: SoloContextProviderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type SoloMode = 'light' | 'dark';
|
|
2
|
+
/** Provides the active light/dark mode to descendants (e.g. the editor). */
|
|
3
|
+
export declare const SoloModeProvider: import('react').Provider<SoloMode>;
|
|
4
|
+
/** Read the active Solo color mode. Defaults to `'dark'` outside a provider. */
|
|
5
|
+
export declare function useSoloMode(): SoloMode;
|