@sillsdev/config-r 1.0.0-alpha.1
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/README.md +20 -0
- package/dist/ConfigrAppBar.d.ts +7 -0
- package/dist/ConfigrPane.d.ts +11 -0
- package/dist/ConfigrTheme.d.ts +46 -0
- package/dist/ContentPane.d.ts +157 -0
- package/dist/FilterForSearch.d.ts +6 -0
- package/dist/HighlightSearchTerms.d.ts +5 -0
- package/dist/SearchContextProvider.d.ts +7 -0
- package/dist/configr.es.js +20598 -0
- package/dist/configr.umd.js +320 -0
- package/dist/index.d.ts +2 -0
- package/package.json +104 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
A react library for a settings UI similar to that of Chrome. Uses formik.
|
|
4
|
+
|
|
5
|
+
[](https://www.repostatus.org/#wip)
|
|
6
|
+
|
|
7
|
+
> :warning: This is a side project that I work on once in a while, and isn't ready for use yet.
|
|
8
|
+
|
|
9
|
+
## Screenshots
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
## Running
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
yarn install
|
|
19
|
+
yarn dev
|
|
20
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ConfigrGroup } from './ContentPane';
|
|
3
|
+
export declare const ConfigrPane: React.FunctionComponent<{
|
|
4
|
+
label: string;
|
|
5
|
+
initialValues: object;
|
|
6
|
+
children: React.ReactElement<typeof ConfigrGroup> | React.ReactElement<typeof ConfigrGroup>[];
|
|
7
|
+
setValueOnRender?: (currentValues: any) => void;
|
|
8
|
+
showSearch?: boolean;
|
|
9
|
+
showAllGroups?: boolean;
|
|
10
|
+
themeOverrides?: any;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare const defaultConfigrTheme: {
|
|
2
|
+
typography: {
|
|
3
|
+
fontFamily: string;
|
|
4
|
+
h2: {
|
|
5
|
+
fontSize: string;
|
|
6
|
+
fontWeight: string;
|
|
7
|
+
};
|
|
8
|
+
h3: {
|
|
9
|
+
fontSize: string;
|
|
10
|
+
fontWeight: string;
|
|
11
|
+
};
|
|
12
|
+
h4: {
|
|
13
|
+
fontSize: string;
|
|
14
|
+
fontWeight: string;
|
|
15
|
+
};
|
|
16
|
+
caption: {
|
|
17
|
+
fontSize: string;
|
|
18
|
+
lineHeight: string;
|
|
19
|
+
marginTop: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
components: {
|
|
23
|
+
MuiSelect: {
|
|
24
|
+
styleOverrides: {
|
|
25
|
+
select: {
|
|
26
|
+
fontSize: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
MuiDivider: {
|
|
31
|
+
styleOverrides: {
|
|
32
|
+
root: {
|
|
33
|
+
borderColor: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
MuiFormControlLabel: {
|
|
38
|
+
styleOverrides: {
|
|
39
|
+
label: {
|
|
40
|
+
fontSize: string;
|
|
41
|
+
fontWeight: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
type valueGetter = () => Object;
|
|
5
|
+
export declare const ContentPane: React.FunctionComponent<{
|
|
6
|
+
initialValues: object;
|
|
7
|
+
currentGroupIndex?: number;
|
|
8
|
+
children: React.ReactElement<typeof ConfigrGroup> | React.ReactElement<typeof ConfigrGroup>[];
|
|
9
|
+
setValueGetter?: (vg: valueGetter) => void;
|
|
10
|
+
setValueOnRender?: (currentValues: any) => void;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const VisibleGroups: React.FunctionComponent<{
|
|
13
|
+
currentGroup?: number;
|
|
14
|
+
focussedSubPagePath?: string;
|
|
15
|
+
children: React.ReactElement<typeof ConfigrGroup> | React.ReactElement<typeof ConfigrGroup>[];
|
|
16
|
+
}>;
|
|
17
|
+
export declare const ConfigrGroup: React.FunctionComponent<{
|
|
18
|
+
label: string;
|
|
19
|
+
description?: string | React.ReactNode;
|
|
20
|
+
level?: undefined | 1 | 2;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const FilterAndJoinWithDividers: React.FunctionComponent<{}>;
|
|
23
|
+
export declare const ConfigrRowOneColumn: React.FunctionComponent<{
|
|
24
|
+
label: string;
|
|
25
|
+
description?: string | React.ReactNode;
|
|
26
|
+
control: React.ReactNode;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const ConfigrRowTwoColumns: React.FunctionComponent<{
|
|
29
|
+
label: string;
|
|
30
|
+
labelCss?: SerializedStyles;
|
|
31
|
+
path: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
control: React.ReactNode;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
height?: string;
|
|
36
|
+
indented?: boolean;
|
|
37
|
+
onClick?: () => void;
|
|
38
|
+
}>;
|
|
39
|
+
export declare const ConfigrInput: React.FunctionComponent<{
|
|
40
|
+
path: string;
|
|
41
|
+
label: string;
|
|
42
|
+
className?: string;
|
|
43
|
+
suffix?: string;
|
|
44
|
+
getErrorMessage?: (data: any) => string | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
export declare const ConfigrCustomStringInput: React.FunctionComponent<{
|
|
47
|
+
path: string;
|
|
48
|
+
label: string;
|
|
49
|
+
control: React.ComponentType<{
|
|
50
|
+
value: string;
|
|
51
|
+
onChange: (value: string) => void;
|
|
52
|
+
}>;
|
|
53
|
+
getErrorMessage?: (data: any) => string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const ConfigrCustomBooleanInput: React.FunctionComponent<{
|
|
56
|
+
path: string;
|
|
57
|
+
label: string;
|
|
58
|
+
control: React.ComponentType<{
|
|
59
|
+
value: boolean;
|
|
60
|
+
onChange: (value: boolean) => void;
|
|
61
|
+
}>;
|
|
62
|
+
getErrorMessage?: (data: any) => string | undefined;
|
|
63
|
+
}>;
|
|
64
|
+
export declare const ConfigrCustomNumberInput: React.FunctionComponent<{
|
|
65
|
+
path: string;
|
|
66
|
+
label: string;
|
|
67
|
+
control: React.ComponentType<{
|
|
68
|
+
value: number;
|
|
69
|
+
onChange: (value: number) => void;
|
|
70
|
+
}>;
|
|
71
|
+
getErrorMessage?: (data: any) => string | undefined;
|
|
72
|
+
}>;
|
|
73
|
+
export declare const ConfigrCustomObjectInput: React.FunctionComponent<{
|
|
74
|
+
path: string;
|
|
75
|
+
label: string;
|
|
76
|
+
control: React.ComponentType<{
|
|
77
|
+
value: object;
|
|
78
|
+
onChange: (value: object) => void;
|
|
79
|
+
}>;
|
|
80
|
+
getErrorMessage?: (data: any) => string | undefined;
|
|
81
|
+
}>;
|
|
82
|
+
export declare const ConfigrSelect: React.FunctionComponent<{
|
|
83
|
+
path: string;
|
|
84
|
+
label: string;
|
|
85
|
+
indented?: boolean;
|
|
86
|
+
options: Array<{
|
|
87
|
+
value: string;
|
|
88
|
+
label?: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
} | number>;
|
|
91
|
+
enableWhen?: string | ((currentValues: object) => boolean);
|
|
92
|
+
description?: string;
|
|
93
|
+
getErrorMessage?: (data: any) => string | undefined;
|
|
94
|
+
}>;
|
|
95
|
+
export declare const ConfigrSubgroup: React.FunctionComponent<{
|
|
96
|
+
label: string;
|
|
97
|
+
path: string;
|
|
98
|
+
getErrorMessage?: (data: any) => string | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
export declare const ConfigrSubPage: React.FunctionComponent<{
|
|
101
|
+
label: string;
|
|
102
|
+
labelCss?: SerializedStyles;
|
|
103
|
+
path: string;
|
|
104
|
+
getErrorMessage?: (data: any) => string | undefined;
|
|
105
|
+
}>;
|
|
106
|
+
export declare const ConfigrForEach: React.FunctionComponent<{
|
|
107
|
+
path: string;
|
|
108
|
+
searchTerms: string;
|
|
109
|
+
render: (pathPrefix: string, index: number) => React.ReactNode;
|
|
110
|
+
getErrorMessage?: (data: any) => string | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
export declare const ConfigrBoolean: React.FunctionComponent<{
|
|
113
|
+
path: string;
|
|
114
|
+
label: string;
|
|
115
|
+
description?: string;
|
|
116
|
+
immediateEffect?: boolean;
|
|
117
|
+
}>;
|
|
118
|
+
export declare const ConfigrRadioGroup: React.FunctionComponent<{
|
|
119
|
+
path: string;
|
|
120
|
+
label: string;
|
|
121
|
+
row?: boolean;
|
|
122
|
+
}>;
|
|
123
|
+
export declare const ConfigrRadioGroupRaw: React.FunctionComponent<{
|
|
124
|
+
path: string;
|
|
125
|
+
label: string;
|
|
126
|
+
row?: boolean;
|
|
127
|
+
}>;
|
|
128
|
+
export declare const ConfigrRadio: React.FunctionComponent<{
|
|
129
|
+
value: any;
|
|
130
|
+
label?: string;
|
|
131
|
+
}>;
|
|
132
|
+
export declare const ConfigrToggleGroup: React.FunctionComponent<{
|
|
133
|
+
path: string;
|
|
134
|
+
label: string;
|
|
135
|
+
row?: boolean;
|
|
136
|
+
height?: string;
|
|
137
|
+
}>;
|
|
138
|
+
export declare const ConfigrToggleGroupRaw: React.FunctionComponent<{
|
|
139
|
+
path: string;
|
|
140
|
+
label: string;
|
|
141
|
+
row?: boolean;
|
|
142
|
+
height?: string;
|
|
143
|
+
}>;
|
|
144
|
+
export declare function ConfigrMakeToggle(value: any, content: ReactNode): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
145
|
+
export declare const ConfigrChooserButton: React.FunctionComponent<{
|
|
146
|
+
path: string;
|
|
147
|
+
label: string;
|
|
148
|
+
description?: string;
|
|
149
|
+
buttonLabel: string;
|
|
150
|
+
chooseAction: (currentValue: string) => string;
|
|
151
|
+
disabled?: boolean;
|
|
152
|
+
}>;
|
|
153
|
+
export declare const ConfigrConditional: React.FunctionComponent<{
|
|
154
|
+
enableWhen?: (currentValues: object) => boolean;
|
|
155
|
+
visibleWhen?: (currentValues: object) => boolean;
|
|
156
|
+
}>;
|
|
157
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const SearchContext: React.Context<{
|
|
3
|
+
searchString: string | null;
|
|
4
|
+
searchRegEx: RegExp | null;
|
|
5
|
+
setSearchString: (searchString: string | null) => void;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const SearchContextProvider: React.FunctionComponent<{}>;
|