@spectric/ui 0.0.4
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/.gitlab-ci.yml +28 -0
- package/.nvmrc +1 -0
- package/.storybook/analyze.sh +4 -0
- package/.storybook/main.ts +55 -0
- package/.storybook/preview.ts +42 -0
- package/.vscode/extensions.json +5 -0
- package/.vscode/settings.json +41 -0
- package/README.MD +50 -0
- package/html-include.png +0 -0
- package/package.json +33 -0
- package/src/classes/BitArray.ts +48 -0
- package/src/classes/DisposibleElement.ts +108 -0
- package/src/components/Banner.ts +102 -0
- package/src/components/Bitdisplay.ts +383 -0
- package/src/components/Button.ts +121 -0
- package/src/components/Header.ts +125 -0
- package/src/components/Page.ts +157 -0
- package/src/components/Panel.ts +56 -0
- package/src/components/ThemeProvider.ts +251 -0
- package/src/components/button.css.ts +160 -0
- package/src/components/configurations/classifications.ts +194 -0
- package/src/components/dialog/dialog.css.ts +50 -0
- package/src/components/dialog/dialog.ts +163 -0
- package/src/components/dialog/index.ts +1 -0
- package/src/components/header.css.ts +38 -0
- package/src/components/index.ts +10 -0
- package/src/components/input.css +75 -0
- package/src/components/input.ts +312 -0
- package/src/components/page.css.ts +158 -0
- package/src/components/panel.css.ts +44 -0
- package/src/components/query_bar/QueryBar.css +48 -0
- package/src/components/query_bar/QueryBar.ts +378 -0
- package/src/components/query_bar/index.ts +2 -0
- package/src/components/query_bar/querylanguage/kuery/ast/_generated_/kuery.js +3186 -0
- package/src/components/query_bar/querylanguage/kuery/ast/ast.ts +113 -0
- package/src/components/query_bar/querylanguage/kuery/ast/index.ts +31 -0
- package/src/components/query_bar/querylanguage/kuery/ast/kuery.peg +417 -0
- package/src/components/query_bar/querylanguage/kuery/functions/and.ts +55 -0
- package/src/components/query_bar/querylanguage/kuery/functions/exists.ts +62 -0
- package/src/components/query_bar/querylanguage/kuery/functions/index.ts +47 -0
- package/src/components/query_bar/querylanguage/kuery/functions/is.ts +211 -0
- package/src/components/query_bar/querylanguage/kuery/functions/nested.ts +63 -0
- package/src/components/query_bar/querylanguage/kuery/functions/not.ts +53 -0
- package/src/components/query_bar/querylanguage/kuery/functions/or.ts +56 -0
- package/src/components/query_bar/querylanguage/kuery/functions/range.ts +163 -0
- package/src/components/query_bar/querylanguage/kuery/functions/utils/get_fields.ts +49 -0
- package/src/components/query_bar/querylanguage/kuery/functions/utils/get_full_field_name_node.ts +87 -0
- package/src/components/query_bar/querylanguage/kuery/index.ts +38 -0
- package/src/components/query_bar/querylanguage/kuery/kuery_syntax_error.ts +76 -0
- package/src/components/query_bar/querylanguage/kuery/node_types/function.ts +75 -0
- package/src/components/query_bar/querylanguage/kuery/node_types/index.ts +46 -0
- package/src/components/query_bar/querylanguage/kuery/node_types/literal.ts +42 -0
- package/src/components/query_bar/querylanguage/kuery/node_types/named_arg.ts +47 -0
- package/src/components/query_bar/querylanguage/kuery/node_types/types.ts +108 -0
- package/src/components/query_bar/querylanguage/kuery/node_types/wildcard.ts +80 -0
- package/src/components/query_bar/querylanguage/kuery/types.ts +52 -0
- package/src/components/query_bar/querylanguage/outputTypes/toCQL.ts +122 -0
- package/src/components/query_bar/querylanguage/outputTypes/toMongo.ts +103 -0
- package/src/components/query_bar/querylanguage/utils.ts +35 -0
- package/src/components/query_bar/types.ts +59 -0
- package/src/components/splitview/index.ts +1 -0
- package/src/components/splitview/splitview.css.ts +66 -0
- package/src/components/splitview/splitview.ts +183 -0
- package/src/components/types.ts +35 -0
- package/src/index.ts +1 -0
- package/src/stories/Banner.stories.ts +46 -0
- package/src/stories/BitDisplay.stories.ts +68 -0
- package/src/stories/Button.stories.ts +138 -0
- package/src/stories/Header.stories.ts +55 -0
- package/src/stories/Page.stories.ts +108 -0
- package/src/stories/QueryBar.stories.ts +63 -0
- package/src/stories/Splitview.stories.ts +52 -0
- package/src/stories/fixtures/Bits.ts +15 -0
- package/src/stories/fixtures/ExampleContent.ts +102 -0
- package/src/stories/fixtures/data.ts +30 -0
- package/src/stories/fixtures/lorumipsum.ts +19 -0
- package/src/stories/input.stories.ts +77 -0
- package/src/stories/tsconfig.json +35 -0
- package/src/utils/debounce.ts +18 -0
- package/src/utils/spread.ts +71 -0
- package/src/vite-env.d.ts +1 -0
- package/test/__init__.py +9 -0
- package/test/elastic.py +9 -0
- package/test/interface.py +16 -0
- package/tsconfig.json +29 -0
- package/vite.config.js +34 -0
- package/vue-example.png +0 -0
- package/vue-include.png +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { StyleInfo } from "lit/directives/style-map.js";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
|
|
5
|
+
[US] Department of Defense (DoD)
|
|
6
|
+
|
|
7
|
+
CONTROLLED UNCLASSIFIED INFORMATION (CUI, color code: #3D1E5A)
|
|
8
|
+
CLASSIFIED (color code: #723D9A)
|
|
9
|
+
UNCLASSIFIED (U, color code: #007A33)
|
|
10
|
+
CONFIDENTIAL (C, color code: #0033A0)
|
|
11
|
+
SECRET (S, color code: #C8102E)
|
|
12
|
+
TOP SECRET (TS, color code: #FF671F)
|
|
13
|
+
TOP SECRET//SENSITIVE COMPARTMENT INFORMATION (TS//SCI, color code: #F7EA48)
|
|
14
|
+
NOTICE: According to CI Policy Publications Update (dodcui.mil), the CUI is not a CNSI classification.
|
|
15
|
+
The cyber intel classification banner is designed to fulfill the requirements of Executive Order 13526, ODNI CG v2.1 § 2.3.1, 32 CFR Part 2001.23 / Part 2002.16.a.3, DoDI 5200.48, DoD Manual 5200.1R, ISOO Rev4, STIG V-6146, STIG V-222643, and ECML-1 for marking/labeling sensitive/classified information electronically.
|
|
16
|
+
|
|
17
|
+
[UK] Government Communications Headquarters (GCHQ)
|
|
18
|
+
|
|
19
|
+
PROTECTIVE MARKING NOT SET (color code: #616161)
|
|
20
|
+
UK OFFICIAL (color code: #2B71C7)
|
|
21
|
+
UK OFFICIAL SENSITIVE (color code: #2B71C7)
|
|
22
|
+
UK SECRET (color code: #F39C2C)
|
|
23
|
+
UK TOP SECRET (color code: #AA0000)
|
|
24
|
+
NOTICE: The above color code is defined by the UK Secret Intelligence Service (MI6) – Intelligence Community Design System.
|
|
25
|
+
|
|
26
|
+
[CA] Canadian Security Intelligence Service (CSIS)
|
|
27
|
+
|
|
28
|
+
PROTECTED A (color code: #227ABC)
|
|
29
|
+
PROTECTED B (color code: #900FB5)
|
|
30
|
+
PROTECTED C (color code: #460FB5)
|
|
31
|
+
CONFIDENTIAL (color code: #0033a0)
|
|
32
|
+
SECRET (color code: #c8102e)
|
|
33
|
+
TOP SECRET (color code: #ff671f)
|
|
34
|
+
NOTICE: The above color code is defined by the Government of Canada.
|
|
35
|
+
|
|
36
|
+
[AU] Australian Secret Intelligence Service (ASIS)
|
|
37
|
+
|
|
38
|
+
UNOFFICIAL
|
|
39
|
+
OFFICIAL
|
|
40
|
+
OFFICIAL: Sensitive
|
|
41
|
+
Confidential (color code: #4F81BD)
|
|
42
|
+
SECRET (color code: #E5B8B7)
|
|
43
|
+
TOP SECRET (color code: #AA0000)
|
|
44
|
+
NOTICE: The above color code is defined by the Australian Government Attorney-General’s Department | Protective Security Policy Framework | Policy 8 – Classification System.
|
|
45
|
+
*/
|
|
46
|
+
export enum ClassificationVariants {
|
|
47
|
+
None = "none",
|
|
48
|
+
Uscui = "us.cui",
|
|
49
|
+
Usclassified = "us.classified",
|
|
50
|
+
Usunclassified = "us.unclassified",
|
|
51
|
+
Usconfidential = "us.confidential",
|
|
52
|
+
Ussecret = "us.secret",
|
|
53
|
+
Ustopsecret = "us.topsecret",
|
|
54
|
+
UstopsecretSi = "us.topsecret.si",
|
|
55
|
+
Uknotset = "uk.notset",
|
|
56
|
+
Ukofficial = "uk.official",
|
|
57
|
+
Uksecret = "uk.secret",
|
|
58
|
+
Uktopsecret = "uk.topsecret",
|
|
59
|
+
Caprotected_a = "ca.protected_a",
|
|
60
|
+
Caprotected_b = "ca.protected_b",
|
|
61
|
+
Caprotected_c = "ca.protected_c",
|
|
62
|
+
Caconfidential = "ca.confidential",
|
|
63
|
+
Casecret = "ca.secret",
|
|
64
|
+
Catopsecret = "ca.topsecret",
|
|
65
|
+
Auunofficial = "au.unofficial",
|
|
66
|
+
Auofficial = "au.official",
|
|
67
|
+
Auofficialsensitive = "au.officialsensitive",
|
|
68
|
+
Auconfidential = "au.confidential",
|
|
69
|
+
Ausecret = "au.secret",
|
|
70
|
+
Autopsecret = "au.topsecret",
|
|
71
|
+
}
|
|
72
|
+
export type Classifications = `${ClassificationVariants}`
|
|
73
|
+
export const ClassificationStyles: Record<Classifications, StyleInfo> = {
|
|
74
|
+
"none": {
|
|
75
|
+
|
|
76
|
+
},
|
|
77
|
+
//US Department of Defense spec CFR-2002-title31-vol1-sec2-7
|
|
78
|
+
"us.cui": { //controlled unclassified information
|
|
79
|
+
color: "white",
|
|
80
|
+
backgroundColor: "#3D1E5A",
|
|
81
|
+
content: "Controlled Unclassified Information"
|
|
82
|
+
},
|
|
83
|
+
"us.classified": {
|
|
84
|
+
color: "white",
|
|
85
|
+
backgroundColor: "#723D9A",
|
|
86
|
+
content: "Classified"
|
|
87
|
+
},
|
|
88
|
+
"us.unclassified": {
|
|
89
|
+
color: "white",
|
|
90
|
+
backgroundColor: "#007A33",
|
|
91
|
+
content: "Unclassified"
|
|
92
|
+
},
|
|
93
|
+
"us.confidential": {
|
|
94
|
+
color: "white",
|
|
95
|
+
backgroundColor: "#0033A0",
|
|
96
|
+
content: "Confidential"
|
|
97
|
+
},
|
|
98
|
+
"us.secret": {
|
|
99
|
+
color: "white",
|
|
100
|
+
backgroundColor: "#C8102E",
|
|
101
|
+
content: "Secret"
|
|
102
|
+
},
|
|
103
|
+
"us.topsecret": {
|
|
104
|
+
color: "white",
|
|
105
|
+
backgroundColor: "#FF671F",
|
|
106
|
+
content: "Top Secret"
|
|
107
|
+
},
|
|
108
|
+
"us.topsecret.si": {
|
|
109
|
+
color: "black",
|
|
110
|
+
backgroundColor: "#F7EA48",
|
|
111
|
+
content: "Top Secret//SI"
|
|
112
|
+
},
|
|
113
|
+
"uk.notset": {
|
|
114
|
+
color: "white",
|
|
115
|
+
backgroundColor: " #616161",
|
|
116
|
+
content: "Not Set"
|
|
117
|
+
|
|
118
|
+
},
|
|
119
|
+
"uk.official": {
|
|
120
|
+
color: "white",
|
|
121
|
+
backgroundColor: "#2B71C7",
|
|
122
|
+
content: "For Offical Use"
|
|
123
|
+
},
|
|
124
|
+
"uk.secret": {
|
|
125
|
+
color: "white",
|
|
126
|
+
backgroundColor: "#F39C2C",
|
|
127
|
+
content: "Secret"
|
|
128
|
+
},
|
|
129
|
+
"uk.topsecret": {
|
|
130
|
+
color: "white",
|
|
131
|
+
backgroundColor: "#AA0000",
|
|
132
|
+
content: "Top Secret"
|
|
133
|
+
},
|
|
134
|
+
"ca.protected_a": {
|
|
135
|
+
color: "white",
|
|
136
|
+
backgroundColor: "#227ABC",
|
|
137
|
+
content: "PROTECTED A"
|
|
138
|
+
},
|
|
139
|
+
"ca.protected_b": {
|
|
140
|
+
color: "white",
|
|
141
|
+
backgroundColor: "#900FB5",
|
|
142
|
+
content: "PROTECTED B"
|
|
143
|
+
},
|
|
144
|
+
"ca.protected_c": {
|
|
145
|
+
color: "white",
|
|
146
|
+
backgroundColor: "#460FB5",
|
|
147
|
+
content: "PROTECTED C"
|
|
148
|
+
},
|
|
149
|
+
"ca.confidential": {
|
|
150
|
+
color: "white",
|
|
151
|
+
backgroundColor: "#0033a0",
|
|
152
|
+
content: "Confidential"
|
|
153
|
+
},
|
|
154
|
+
"ca.secret": {
|
|
155
|
+
color: "white",
|
|
156
|
+
backgroundColor: "#c8102e",
|
|
157
|
+
content: "Secret"
|
|
158
|
+
},
|
|
159
|
+
"ca.topsecret": {
|
|
160
|
+
color: "white",
|
|
161
|
+
backgroundColor: "#ff671f",
|
|
162
|
+
content: "Top Secret"
|
|
163
|
+
},
|
|
164
|
+
"au.unofficial": {
|
|
165
|
+
color: "#666",
|
|
166
|
+
backgroundColor: "#ffffffff",
|
|
167
|
+
content: "Unofficial"
|
|
168
|
+
},
|
|
169
|
+
"au.official": {
|
|
170
|
+
color: "#666",
|
|
171
|
+
backgroundColor: "#ffffffff",
|
|
172
|
+
content: "Official"
|
|
173
|
+
},
|
|
174
|
+
"au.officialsensitive": {
|
|
175
|
+
color: "#666",
|
|
176
|
+
backgroundColor: "#ffffffff",
|
|
177
|
+
content: "Official Sentitive"
|
|
178
|
+
},
|
|
179
|
+
"au.confidential": {
|
|
180
|
+
color: "white",
|
|
181
|
+
backgroundColor: "#4F81BD",
|
|
182
|
+
content: "Confidential"
|
|
183
|
+
},
|
|
184
|
+
"au.secret": {
|
|
185
|
+
color: "black",
|
|
186
|
+
backgroundColor: " #E5B8B7",
|
|
187
|
+
content: "Secret"
|
|
188
|
+
},
|
|
189
|
+
"au.topsecret": {
|
|
190
|
+
color: "black",
|
|
191
|
+
backgroundColor: "#AA0000",
|
|
192
|
+
content: "Top Secret"
|
|
193
|
+
},
|
|
194
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
export const style = css`
|
|
4
|
+
:host {
|
|
5
|
+
--dialog-padding: var(--spectric-dialog-padding, 5px);
|
|
6
|
+
--dialog-background:var(--spectric-background,rgb(246, 249, 252));
|
|
7
|
+
}
|
|
8
|
+
dialog {
|
|
9
|
+
border: 0px solid var(--background-inverse);
|
|
10
|
+
--spectric-background: var(--dialog-background);
|
|
11
|
+
--panel-color:var(--dialog-background);
|
|
12
|
+
padding: 0;
|
|
13
|
+
border-radius: var(--spectric-border-radius);
|
|
14
|
+
overflow:hidden;
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
dialog[open]{
|
|
18
|
+
display:flex;
|
|
19
|
+
}
|
|
20
|
+
spectric-panel{
|
|
21
|
+
margin:0px
|
|
22
|
+
}
|
|
23
|
+
dialog::backdrop {
|
|
24
|
+
background-color: transparent;
|
|
25
|
+
}
|
|
26
|
+
dialog.backdrop::backdrop {
|
|
27
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
28
|
+
}
|
|
29
|
+
.modal{
|
|
30
|
+
display: flex;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
height: 100%;
|
|
34
|
+
}
|
|
35
|
+
.content{
|
|
36
|
+
flex-shrink: 1;
|
|
37
|
+
overflow: auto;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
h3 {
|
|
41
|
+
padding: 1em var(--dialog-padding);
|
|
42
|
+
margin: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
spectric-button{
|
|
46
|
+
position: absolute;
|
|
47
|
+
right: 0;
|
|
48
|
+
top: 0;
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { CSSResultGroup, html, LitElement, PropertyValues, render } from 'lit';
|
|
2
|
+
import "../Button";
|
|
3
|
+
import { customElement, property, queryAsync } from 'lit/decorators.js';
|
|
4
|
+
import { style } from './dialog.css';
|
|
5
|
+
import { HTMLElementTagWithEvents, ReactElementWithPropsAndEvents } from '../types';
|
|
6
|
+
export const DialogElementTag = "spectric-dialog"
|
|
7
|
+
export type { DialogProps as Props, DialogEvents }
|
|
8
|
+
interface DialogProps {
|
|
9
|
+
open?: boolean;
|
|
10
|
+
dismissable?: boolean;
|
|
11
|
+
hideBackdrop?: boolean;
|
|
12
|
+
title?: string;
|
|
13
|
+
closeOnEscape?: boolean;
|
|
14
|
+
closeOnOutsideClick?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Dialog Element
|
|
21
|
+
* @slot title - sets the title of the dialog attribute/property can also be use for setting the title to a string
|
|
22
|
+
*/
|
|
23
|
+
@customElement(DialogElementTag)
|
|
24
|
+
export class DialogElement extends LitElement implements DialogProps {
|
|
25
|
+
static styles: CSSResultGroup = style;
|
|
26
|
+
static display(props: DialogProps, body: any) {
|
|
27
|
+
let dialog = document.createElement(DialogElementTag);
|
|
28
|
+
dialog.addEventListener("close", () => {
|
|
29
|
+
dialog.remove()
|
|
30
|
+
});
|
|
31
|
+
for (let prop in props) {
|
|
32
|
+
//@ts-ignore
|
|
33
|
+
dialog[prop] = props[prop];
|
|
34
|
+
}
|
|
35
|
+
let frag = document.createDocumentFragment()
|
|
36
|
+
render(body, frag);
|
|
37
|
+
dialog.appendChild(frag)
|
|
38
|
+
dialog.open = true;
|
|
39
|
+
document.body.appendChild(dialog)
|
|
40
|
+
return dialog
|
|
41
|
+
}
|
|
42
|
+
@property({ type: Boolean, reflect: true })
|
|
43
|
+
open: boolean = false;
|
|
44
|
+
|
|
45
|
+
@property({ type: Boolean, reflect: true })
|
|
46
|
+
dismissable: boolean = true;
|
|
47
|
+
|
|
48
|
+
@property({ type: Boolean, reflect: true })
|
|
49
|
+
hideBackdrop: boolean = false;
|
|
50
|
+
|
|
51
|
+
@property({ type: String, reflect: true })
|
|
52
|
+
title: string = "";
|
|
53
|
+
|
|
54
|
+
@property({ type: Boolean, reflect: true })
|
|
55
|
+
closeOnEscape: boolean = true;
|
|
56
|
+
|
|
57
|
+
@property({ type: Boolean, reflect: true })
|
|
58
|
+
closeOnOutsideClick: boolean = true;
|
|
59
|
+
|
|
60
|
+
@queryAsync("dialog")
|
|
61
|
+
dialogElement!: Promise<HTMLDialogElement>;
|
|
62
|
+
|
|
63
|
+
connectedCallback(): void {
|
|
64
|
+
super.connectedCallback();
|
|
65
|
+
this.dialogElement.then(dialog => dialog.addEventListener('keydown', this._handleKeyDown));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
disconnectedCallback(): void {
|
|
69
|
+
super.disconnectedCallback();
|
|
70
|
+
this.dialogElement.then(dialog => dialog.removeEventListener('keydown', this._handleKeyDown));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
protected updated(_changedProperties: PropertyValues): void {
|
|
74
|
+
if (_changedProperties.has("open")) {
|
|
75
|
+
this.dialogElement.then(dialog => {
|
|
76
|
+
if (this.open) {
|
|
77
|
+
dialog.showModal();
|
|
78
|
+
} else {
|
|
79
|
+
dialog.close();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private clickHandler = async (e: PointerEvent): Promise<void> => {
|
|
86
|
+
const dialog = await this.dialogElement;
|
|
87
|
+
if (!this.dismissable || !this.closeOnOutsideClick) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (dialog === e.target) {
|
|
91
|
+
// clicked on backdrop
|
|
92
|
+
this.open = false;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
private _handleKeyDown = (e: KeyboardEvent): void => {
|
|
97
|
+
if (!this.closeOnEscape) {
|
|
98
|
+
e.preventDefault()
|
|
99
|
+
}
|
|
100
|
+
if (this.open && this.closeOnEscape && e.key === 'Escape') {
|
|
101
|
+
this.open = false;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
private _onClose = (e: PointerEvent): void => {
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
e.stopPropagation();
|
|
108
|
+
this.open = false;
|
|
109
|
+
this.dispatchEvent(new CustomEvent('close', {
|
|
110
|
+
bubbles: true,
|
|
111
|
+
composed: true,
|
|
112
|
+
}));
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
protected render(): unknown {
|
|
116
|
+
return html`
|
|
117
|
+
<dialog class=${this.hideBackdrop ? '' : 'backdrop'} @close=${this._onClose} @click=${this.clickHandler}>
|
|
118
|
+
<spectric-panel>
|
|
119
|
+
<div class="modal">
|
|
120
|
+
${this.dismissable ? html`<spectric-button variant="text" size="small" @click=${() => { this.open = false }}>X</spectric-button>` : null}
|
|
121
|
+
<h3 >
|
|
122
|
+
<slot name="title">
|
|
123
|
+
${this.title.length ? this.title : null}
|
|
124
|
+
</slot>
|
|
125
|
+
</h3>
|
|
126
|
+
|
|
127
|
+
<div class="content"><slot></slot></div>
|
|
128
|
+
<div class="footer"><slot name="footer"></slot></div>
|
|
129
|
+
</div>
|
|
130
|
+
</spectric-panel>
|
|
131
|
+
</dialog>
|
|
132
|
+
`;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface DialogEvents {
|
|
137
|
+
'close': (event: CustomEvent) => void;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
declare global {
|
|
141
|
+
interface HTMLElementTagNameMap {
|
|
142
|
+
[DialogElementTag]: HTMLElementTagWithEvents<DialogElement, DialogEvents>
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
namespace JSX {
|
|
146
|
+
interface IntrinsicElements {
|
|
147
|
+
/**
|
|
148
|
+
* @see {@link DialogElement}
|
|
149
|
+
*/
|
|
150
|
+
[DialogElementTag]: ReactElementWithPropsAndEvents<DialogElement, DialogProps, DialogEvents>;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
namespace React {
|
|
154
|
+
namespace JSX {
|
|
155
|
+
interface IntrinsicElements {
|
|
156
|
+
/**
|
|
157
|
+
* @see {@link DialogElement}
|
|
158
|
+
*/
|
|
159
|
+
[DialogElementTag]: ReactElementWithPropsAndEvents<DialogElement, DialogProps, DialogEvents>
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dialog"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
export default css`.spectric-header {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
align-items: center;
|
|
7
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
8
|
+
padding: 15px 20px;
|
|
9
|
+
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.spectric-header svg {
|
|
13
|
+
display: inline-block;
|
|
14
|
+
vertical-align: top;
|
|
15
|
+
}
|
|
16
|
+
.spectric-header slot {
|
|
17
|
+
display: inline-block;
|
|
18
|
+
vertical-align: middle;
|
|
19
|
+
}
|
|
20
|
+
.spectric-header h1 {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
vertical-align: middle;
|
|
23
|
+
margin: 6px 0 6px 10px;
|
|
24
|
+
font-weight: 700;
|
|
25
|
+
font-size: 20px;
|
|
26
|
+
line-height: 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.spectric-header button + button {
|
|
30
|
+
margin-left: 10px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.spectric-header .welcome {
|
|
34
|
+
margin-right: 10px;
|
|
35
|
+
color: #333;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
}
|
|
38
|
+
`
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./Button"
|
|
2
|
+
export * from "./Bitdisplay"
|
|
3
|
+
export * from "./Header"
|
|
4
|
+
export * from "./Page"
|
|
5
|
+
export * from "./input"
|
|
6
|
+
export * from "./query_bar"
|
|
7
|
+
export * from "./Panel"
|
|
8
|
+
export * from "./ThemeProvider"
|
|
9
|
+
export * from "./dialog"
|
|
10
|
+
export * from "./splitview"
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
spectric-input {
|
|
2
|
+
|
|
3
|
+
--input-color: var(--spectric-input-color, #f4f4f4);
|
|
4
|
+
--border-radius: var(--spectric-border-radius, .4em);
|
|
5
|
+
--input-bottom: var(--spectric-input-bottom, var(--spectric-button-primary, #a8a8a8));
|
|
6
|
+
--input-bottom-focused: var(--primary, #1ea7fd);
|
|
7
|
+
--text-on-color: var(--spectric-text-on-color, #ffffff);
|
|
8
|
+
--text-on-color-disabled: var(--spectric-text-on-color-disabled, #8d8d8d);
|
|
9
|
+
--text-placeholder: rgba(22, 22, 22, 0.4);
|
|
10
|
+
--text-primary: var(--spectric-text-primary, #161616);
|
|
11
|
+
--text-secondary: var(--spectric-text-secondary, #525252);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
spectric-input .inputWrapper {
|
|
15
|
+
color: var(--text-secondary)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
spectric-input .inputWrapper input {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
margin: 0px;
|
|
21
|
+
vertical-align: baseline;
|
|
22
|
+
font-size: .875rem;
|
|
23
|
+
font-weight: 400;
|
|
24
|
+
line-height: 1.28572;
|
|
25
|
+
letter-spacing: .16px;
|
|
26
|
+
outline: transparent solid 2px;
|
|
27
|
+
outline-offset: -2px;
|
|
28
|
+
border: none;
|
|
29
|
+
padding: 0 1rem;
|
|
30
|
+
background-color: var(--input-color);
|
|
31
|
+
color: var(--text-primary, #161616);
|
|
32
|
+
font-family: inherit;
|
|
33
|
+
inline-size: 100%;
|
|
34
|
+
block-size: 2.5rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
spectric-input .inputWrapper .inputContainer:active::after,
|
|
38
|
+
spectric-input .inputContainer:focus-within::after {
|
|
39
|
+
border-bottom-color: var(--input-bottom-focused);
|
|
40
|
+
width: calc(100% - 5px);
|
|
41
|
+
transition: width 0.4s ease-in-out;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
spectric-input .inputWrapper input:read-only {
|
|
45
|
+
background-color: transparent;
|
|
46
|
+
border-bottom-color: var(--border-disabled);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
spectric-input .inputContainer {
|
|
50
|
+
position: relative;
|
|
51
|
+
border-radius: var(--border-radius);
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
spectric-input .inputContainer::after {
|
|
56
|
+
content: "";
|
|
57
|
+
width: 0px;
|
|
58
|
+
transition: background-color 0.4s cubic-bezier(0.2, 0, 0.38, 0.9), border-bottom-color 0.4s cubic-bezier(0.2, 0, 0.38, 0.9);
|
|
59
|
+
border-bottom-color: var(--input-bottom);
|
|
60
|
+
border-bottom-style: solid;
|
|
61
|
+
border-bottom-width: 1px;
|
|
62
|
+
position: absolute;
|
|
63
|
+
left: 2.5px;
|
|
64
|
+
bottom: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
spectric-input #helper-text {
|
|
68
|
+
height: 18px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
spectric-input spectric-button {
|
|
72
|
+
position: absolute;
|
|
73
|
+
right: 4px;
|
|
74
|
+
bottom: 3px;
|
|
75
|
+
}
|