@hotosm/ui 0.2.0-b4 → 0.2.0-b6
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 +99 -107
- package/components/header/header.styles.ts +103 -0
- package/components/header/header.ts +117 -194
- package/components/icons.ts +1 -1
- package/components/index.ts +68 -62
- package/components/logo/logo.styles.ts +8 -0
- package/components/logo/logo.ts +37 -0
- package/components/react/Header.ts +16 -0
- package/components/react/Logo.ts +15 -0
- package/components/react/Toolbar.ts +24 -0
- package/components/react/Tracking.ts +17 -0
- package/components/react/index.ts +63 -0
- package/components/toolbar/toolbar.styles.ts +6 -0
- package/components/toolbar/toolbar.ts +100 -57
- package/components/tracking/tracking.styles.ts +23 -0
- package/components/tracking/tracking.ts +89 -85
- package/dist/components/header/header.d.ts +28 -0
- package/dist/components/header/header.styles.d.ts +6 -0
- package/dist/components/index.d.ts +130 -0
- package/dist/components/logo/logo.d.ts +10 -0
- package/dist/components/logo/logo.styles.d.ts +2 -0
- package/dist/components/react/Tracking.d.ts +2 -0
- package/dist/components/react/index.d.ts +62 -0
- package/dist/components/toolbar/toolbar.d.ts +20 -0
- package/dist/components/toolbar/toolbar.styles.d.ts +2 -0
- package/{components → dist/components}/tracking/tracking.d.ts +8 -9
- package/dist/components/tracking/tracking.styles.d.ts +2 -0
- package/dist/{components.js → hotosm-ui.js} +3707 -3671
- package/dist/style.css +1 -1
- package/package.json +35 -33
- package/theme/hot-sl.css +180 -0
- package/theme/hot.css +177 -121
- package/theme/logo/hot-logo-icon.svg +1 -0
- package/theme/logo/hot-logo-png.png +0 -0
- package/theme/logo/hot-logo-text.svg +1 -0
- package/components/header/header.d.ts +0 -30
- package/components/header/header.js +0 -237
- package/components/icons.js +0 -78
- package/components/index.d.ts +0 -127
- package/components/index.js +0 -127
- package/components/toolbar/toolbar.d.ts +0 -24
- package/components/toolbar/toolbar.js +0 -121
- package/components/tracking/tracking.js +0 -164
- package/react/Header.js +0 -14
- package/react/Toolbar.js +0 -21
- package/react/Tracking.js +0 -15
- package/react/index.d.ts +0 -3
- package/react/index.js +0 -5
- package/theme/logo.png +0 -0
- package/theme/sl-custom.css +0 -74
- /package/{components → dist/components}/icons.d.ts +0 -0
- /package/{react → dist/components/react}/Header.d.ts +0 -0
- /package/{react/Toolbar.d.ts → dist/components/react/Logo.d.ts} +0 -0
- /package/{react/Tracking.d.ts → dist/components/react/Toolbar.d.ts} +0 -0
|
@@ -1,223 +1,146 @@
|
|
|
1
|
-
import "../../theme/sl
|
|
1
|
+
import "../../theme/hot-sl.css";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import "@shoelace-style/shoelace/dist/components/icon-button/icon-button.js";
|
|
4
|
+
import "@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.js";
|
|
5
|
+
import "@shoelace-style/shoelace/dist/components/tab-group/tab-group.js";
|
|
6
|
+
import "@shoelace-style/shoelace/dist/components/tab/tab.js";
|
|
7
7
|
|
|
8
|
-
import { LitElement,
|
|
9
|
-
import { property
|
|
10
|
-
import {
|
|
8
|
+
import { LitElement, html } from "lit";
|
|
9
|
+
import { property } from "lit/decorators.js";
|
|
10
|
+
import { headerVariants, type sizes, styles } from './header.styles.js';
|
|
11
|
+
import type { CSSResultGroup } from 'lit';
|
|
11
12
|
|
|
12
|
-
import registerBundledIcons from
|
|
13
|
+
import registerBundledIcons from "../../components/icons";
|
|
13
14
|
|
|
14
15
|
registerBundledIcons();
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
const headerVariants = cva(
|
|
18
|
-
// Defaults to include in all variants
|
|
19
|
-
`
|
|
20
|
-
flex flex-row bg-[var(--hot-white)] items-center justify-between
|
|
21
|
-
sm:justify-around p-2 border-b-2 border-b-gray-100 border-b-solid
|
|
22
|
-
`,
|
|
23
|
-
{
|
|
24
|
-
variants: {
|
|
25
|
-
size: {
|
|
26
|
-
small: "h-8",
|
|
27
|
-
large: "h-14",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
);
|
|
32
|
-
type sizes = "small" | "large";
|
|
33
|
-
|
|
34
17
|
interface MenuItem {
|
|
35
|
-
label: string
|
|
18
|
+
label: string;
|
|
36
19
|
clickEvent: () => void;
|
|
37
20
|
}
|
|
38
21
|
|
|
39
22
|
export class Header extends LitElement {
|
|
40
|
-
|
|
23
|
+
|
|
24
|
+
static styles: CSSResultGroup = [styles];
|
|
25
|
+
|
|
26
|
+
name = "hot-header";
|
|
41
27
|
|
|
42
28
|
/** Use a text-based title in the header. */
|
|
43
|
-
@property({ type: String })
|
|
29
|
+
@property({ type: String })
|
|
30
|
+
accessor title: string = "";
|
|
44
31
|
|
|
45
32
|
/** Display a logo on the left of the header. */
|
|
46
|
-
@property({ type: String })
|
|
47
|
-
|
|
48
|
-
////XPz/ke3vura3++vr32dn76+vYRET65eX10ND88PDxurrkfX3cVlb99PTkf3/zxMThb2/tqKjv
|
|
49
|
-
sbHfZWXlhIT439/cWVnyv7/rn5/idHT0ysrplpbaTU3qnJzZSEjni4veYWHgaWnokpKZE/dBAAAOH
|
|
50
|
-
ElEQVR4nO1cabuqvA6lMsggCCgzKOD//483SQvitiDoOfe4n7frw2YDHVfTJE2LmqagoKCgoKCgoK
|
|
51
|
-
CgoKCgoKCgoKCgoKCgoKCgoKDwhEu0+wzJW9Wmu0Mg/q127Uc9iHcVXlxj5n21iz8qfwKHfYronWo
|
|
52
|
-
rxlzxb8HYRz3w2U3TjNqfI+vG/I/KnyL9mK13ZMth+4Es/cPOXPqcypt7n/eXj8p/QPUxW2805g+S
|
|
53
|
-
RUj/oPgswvuYrdPmOp/Ici2aRobl0o2mmbmDD+ywGpSb5eSVTf8F8N6qQn5jgLYyQua7VKBh5rkpi
|
|
54
|
-
jI0M7ToPWVy8tDUhjdwZ77BFWmNDxFurRLIGjjgZHV7KiO9XqHPfpOWUGpmaQe4NKTA6QljJfCkJX
|
|
55
|
-
snx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-
NzZqdt/It1f2cFM4jY9vzfAfk0S0Ov0/qoijqtlw6s7TZsfInnqvlxad7UMqLdfryFETQwBAVkmqf
|
|
105
|
-
5IGmfwJ5dGsD9lvP8E3I4kqs5CdluO1oPHqu03cJBy76vUQp/BvMbyauRLOxK3eyavo2M6PYedCwL
|
|
106
|
-
s5xkz6lrxFZGYM56VkU31AzfgmM1+cCX2CjYzWSZYr4bI9k3ESMKMPtAJ0vyQVNf+QXkf4Q1n3fuo
|
|
107
|
-
R1ZxYHjGS1rKWri7teYcvVPv1Egc6ZE5+l2htjbX8Vr7aWX6PdUt1IVsdqEw9WVMOC0rCrwkeZEls
|
|
108
|
-
6Id9HMb+JrNnNxPXYEscayZost2DV4NbZWJb4vY+vJGvFgu8VNsSxJmQlNaG4pJrdMHYt6+rw9WQt
|
|
109
|
-
ulvrsN7dGsnKppl68Stg7feTpcmWMtuwOo41kpUIy2CfI0MbIo/ZLyBLWxNOWMTqONbUdaDwWU9Hp
|
|
110
|
-
/jT+vt1lvYn3K2132Y2o4IDP2qnx9nwu2tFeOrAG03QKaVDLvx3o8SvqHwVrFcfFrzEylXJZLlTkI
|
|
111
|
-
vXoeoy+OGO3EF/XueH175WssAF1D/EZR1ZoXdfTTr14SB+I8iNj+UNaPNOhmZ7pPotj9bQrrcUj1R
|
|
112
|
-
QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ+Gf4H5j7yuOYiAtqAAAAAElFTkSuQmCC
|
|
113
|
-
`;
|
|
33
|
+
@property({ type: String })
|
|
34
|
+
accessor logo: string | URL = "";
|
|
114
35
|
|
|
115
36
|
/** Add a drawer icon with a click event to e.g. open a sidebar. */
|
|
116
|
-
@property({ type: Boolean })
|
|
37
|
+
@property({ type: Boolean })
|
|
38
|
+
accessor drawer: boolean = true;
|
|
117
39
|
|
|
118
40
|
/** Array of menu items to include as navigation tabs. */
|
|
119
|
-
@property({ type: Array })
|
|
41
|
+
@property({ type: Array })
|
|
42
|
+
accessor tabs: MenuItem[] = [];
|
|
120
43
|
|
|
121
44
|
/** Size of toolbar vertically. */
|
|
122
|
-
@property({ type: String })
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
align-items: center;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
sl-tab-group {
|
|
135
|
-
display: flex;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
sl-tab::part(base) {
|
|
139
|
-
font-size: 1rem;
|
|
140
|
-
border-bottom: 2px solid transparent;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
sl-tab[selected]::part(base) {
|
|
144
|
-
border-bottom: 2px solid white;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
#drawer-block {
|
|
148
|
-
display: flex;
|
|
149
|
-
align-items: center;
|
|
150
|
-
padding-right: 30px;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
@media(prefers-color-scheme: light) {
|
|
154
|
-
header {
|
|
155
|
-
color: black;
|
|
156
|
-
}
|
|
157
|
-
#break {
|
|
158
|
-
background-color: black;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
`
|
|
162
|
-
];
|
|
45
|
+
@property({ type: String })
|
|
46
|
+
accessor size: sizes = "small";
|
|
47
|
+
|
|
48
|
+
/** Border bottom. */
|
|
49
|
+
@property({ type: Boolean })
|
|
50
|
+
accessor borderBottom: boolean = true;
|
|
51
|
+
|
|
52
|
+
@property()
|
|
53
|
+
accessor selectedTab: number = 0;
|
|
163
54
|
|
|
164
55
|
protected render() {
|
|
165
|
-
const logoSrc =
|
|
56
|
+
const logoSrc =
|
|
57
|
+
typeof this.logo === "string" || this.logo instanceof URL
|
|
58
|
+
? typeof this.logo === "string"
|
|
59
|
+
? this.logo
|
|
60
|
+
: this.logo.href
|
|
61
|
+
: "";
|
|
166
62
|
|
|
167
63
|
return html`
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
64
|
+
<header class=${headerVariants({
|
|
65
|
+
size: this.size,
|
|
66
|
+
borderBottom: this.borderBottom
|
|
67
|
+
})}>
|
|
68
|
+
<a href="/" class="header--link">
|
|
69
|
+
${logoSrc.length > 0
|
|
70
|
+
? html`
|
|
71
|
+
<img
|
|
72
|
+
id="logo"
|
|
73
|
+
src="${this.logo}"
|
|
74
|
+
alt="Logo"
|
|
75
|
+
class="header--logo-img"
|
|
76
|
+
/>
|
|
77
|
+
`
|
|
78
|
+
: html`
|
|
79
|
+
<hot-logo
|
|
80
|
+
?iconOnly="${this.title.length > 0}"
|
|
81
|
+
>
|
|
82
|
+
</hot-logo>
|
|
83
|
+
`}
|
|
84
|
+
${this.title.length > 0
|
|
85
|
+
? html`
|
|
86
|
+
<h1 class="header--title">
|
|
87
|
+
${this.title}
|
|
88
|
+
</h1>
|
|
89
|
+
`
|
|
90
|
+
: null}
|
|
91
|
+
</a>
|
|
92
|
+
|
|
93
|
+
${/* Navigation bar for desktop, hide on mobile */ ""}
|
|
94
|
+
<nav
|
|
95
|
+
class="header--nav"
|
|
96
|
+
>
|
|
97
|
+
<sl-tab-group class="header--tab-group">
|
|
98
|
+
${this.tabs.map(
|
|
99
|
+
(item, index) => html`
|
|
100
|
+
<sl-tab
|
|
101
|
+
class="header--tab"
|
|
102
|
+
slot="nav"
|
|
103
|
+
panel="general"
|
|
104
|
+
@click=${(e: MouseEvent) => {
|
|
105
|
+
this._selectTab(e, item.clickEvent, index);
|
|
106
|
+
}}
|
|
107
|
+
?selected=${this.selectedTab === index}
|
|
108
|
+
>${item.label}</sl-tab
|
|
109
|
+
>
|
|
110
|
+
`
|
|
111
|
+
)}
|
|
112
|
+
</sl-tab-group>
|
|
113
|
+
</nav>
|
|
114
|
+
|
|
115
|
+
${/* Stacked navigation drawer for mobile */ ""}
|
|
116
|
+
${/* NOTE this should probably be in a drawer instead */ ""}
|
|
117
|
+
<nav
|
|
118
|
+
class="header--nav-mobile"
|
|
119
|
+
></nav>
|
|
120
|
+
|
|
121
|
+
<div id="right-section" class="header--right-section">
|
|
122
|
+
<sl-icon-button
|
|
123
|
+
library="bundled"
|
|
124
|
+
name="person-circle"
|
|
125
|
+
class="header--person-circle"
|
|
126
|
+
label="login"
|
|
127
|
+
@click=${(e: MouseEvent) => {
|
|
128
|
+
this._handleLogin(e);
|
|
129
|
+
}}
|
|
130
|
+
></sl-icon-button>
|
|
131
|
+
${this.drawer
|
|
132
|
+
? html`
|
|
133
|
+
<sl-icon-button
|
|
134
|
+
library="bundled"
|
|
135
|
+
class="header--drawer"
|
|
136
|
+
name="list"
|
|
137
|
+
label="drawer-open"
|
|
138
|
+
></sl-icon-button>
|
|
139
|
+
`
|
|
140
|
+
: null}
|
|
141
|
+
</div>
|
|
218
142
|
</div>
|
|
219
|
-
</
|
|
220
|
-
</header>
|
|
143
|
+
</header>
|
|
221
144
|
`;
|
|
222
145
|
}
|
|
223
146
|
|
package/components/icons.ts
CHANGED
|
@@ -64,7 +64,7 @@ const icons = {
|
|
|
64
64
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-circle" viewBox="0 0 16 16">
|
|
65
65
|
<path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/>
|
|
66
66
|
<path fill-rule="evenodd" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1z"/>
|
|
67
|
-
</svg>
|
|
67
|
+
</svg>
|
|
68
68
|
`
|
|
69
69
|
};
|
|
70
70
|
|
package/components/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Index to import all components together
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { setBasePath } from '@shoelace-style/shoelace/dist/utilities/base-path.js';
|
|
3
4
|
|
|
4
5
|
// Default Shoelace exports
|
|
5
6
|
import SlAlert from '@shoelace-style/shoelace/dist/components/alert/alert.component.js';
|
|
@@ -63,6 +64,7 @@ import SlVisuallyHidden from '@shoelace-style/shoelace/dist/components/visually-
|
|
|
63
64
|
|
|
64
65
|
// Custom composite components
|
|
65
66
|
import HotHeader from './header/header';
|
|
67
|
+
import HotLogo from './logo/logo';
|
|
66
68
|
import HotToolbar from './toolbar/toolbar';
|
|
67
69
|
import HotTracking from './tracking/tracking';
|
|
68
70
|
|
|
@@ -194,66 +196,70 @@ declare global {
|
|
|
194
196
|
}
|
|
195
197
|
|
|
196
198
|
export {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
199
|
+
// setBasePath helper to use the UI behind proxies etc
|
|
200
|
+
setBasePath,
|
|
201
|
+
// Standard shoelace components
|
|
202
|
+
SlAlert as Alert,
|
|
203
|
+
SlAnimatedImage as AnimatedImage,
|
|
204
|
+
SlAnimation as Animation,
|
|
205
|
+
SlAvatar as Avatar,
|
|
206
|
+
SlBadge as Badge,
|
|
207
|
+
SlBreadcrumb as Breadcrumb,
|
|
208
|
+
SlBreadcrumbItem as BreadcrumbItem,
|
|
209
|
+
SlButton as Button,
|
|
210
|
+
SlButtonGroup as ButtonGroup,
|
|
211
|
+
SlCard as Card,
|
|
212
|
+
SlCarousel as Carousel,
|
|
213
|
+
SlCarouselItem as CarouselItem,
|
|
214
|
+
SlCheckbox as Checkbox,
|
|
215
|
+
SlColorPicker as ColorPicker,
|
|
216
|
+
SlCopyButton as CopyButton,
|
|
217
|
+
SlDetails as Details,
|
|
218
|
+
SlDialog as Dialog,
|
|
219
|
+
SlDivider as Divider,
|
|
220
|
+
SlDrawer as Drawer,
|
|
221
|
+
SlDropdown as Dropdown,
|
|
222
|
+
SlFormatBytes as FormatBytes,
|
|
223
|
+
SlFormatDate as FormatDate,
|
|
224
|
+
SlFormatNumber as FormatNumber,
|
|
225
|
+
SlIcon as Icon,
|
|
226
|
+
SlIconButton as IconButton,
|
|
227
|
+
SlImageComparer as ImageComparer,
|
|
228
|
+
SlInclude as Include,
|
|
229
|
+
SlInput as Input,
|
|
230
|
+
SlMenu as Menu,
|
|
231
|
+
SlMenuItem as MenuItem,
|
|
232
|
+
SlMenuLabel as MenuLabel,
|
|
233
|
+
SlMutationObserver as MutationObserver,
|
|
234
|
+
SlOption as Option,
|
|
235
|
+
SlPopup as Popup,
|
|
236
|
+
SlProgressBar as ProgressBar,
|
|
237
|
+
SlProgressRing as ProgressRing,
|
|
238
|
+
SlQRCode as QRCode,
|
|
239
|
+
SlRadio as Radio,
|
|
240
|
+
SlRadioButton as RadioButton,
|
|
241
|
+
SlRadioGroup as RadioGroup,
|
|
242
|
+
SlRange as Range,
|
|
243
|
+
SlRating as Rating,
|
|
244
|
+
SlRelativeTime as RelativeTime,
|
|
245
|
+
SlResizeObserver as ResizeObserver,
|
|
246
|
+
SlSelect as Select,
|
|
247
|
+
SlSkeleton as Skeleton,
|
|
248
|
+
SlSpinner as Spinner,
|
|
249
|
+
SlSplitPanel as SplitPanel,
|
|
250
|
+
SlSwitch as Switch,
|
|
251
|
+
SlTab as Tab,
|
|
252
|
+
SlTabGroup as TabGroup,
|
|
253
|
+
SlTabPanel as TabPanel,
|
|
254
|
+
SlTag as Tag,
|
|
255
|
+
SlTextarea as Textarea,
|
|
256
|
+
SlTooltip as Tooltip,
|
|
257
|
+
SlTree as Tree,
|
|
258
|
+
SlTreeItem as TreeItem,
|
|
259
|
+
SlVisuallyHidden as VisuallyHidden,
|
|
255
260
|
// Custom composite components
|
|
256
|
-
HotHeader,
|
|
257
|
-
|
|
258
|
-
|
|
261
|
+
HotHeader as Header,
|
|
262
|
+
HotLogo as Logo,
|
|
263
|
+
HotToolbar as Toolbar,
|
|
264
|
+
HotTracking as Tracking,
|
|
259
265
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
import HotLogoIconSVG from '../../theme/logo/hot-logo-icon.svg';
|
|
3
|
+
import HotLogoTextSVG from '../../theme/logo/hot-logo-text.svg';
|
|
4
|
+
|
|
5
|
+
import { LitElement, html } from "lit";
|
|
6
|
+
import { property } from "lit/decorators.js";
|
|
7
|
+
import styles from './logo.styles.js';
|
|
8
|
+
import type { CSSResultGroup } from 'lit';
|
|
9
|
+
|
|
10
|
+
export class Logo extends LitElement {
|
|
11
|
+
|
|
12
|
+
static styles: CSSResultGroup = [styles];
|
|
13
|
+
|
|
14
|
+
name = 'hot-logo';
|
|
15
|
+
|
|
16
|
+
@property({ type: Boolean })
|
|
17
|
+
accessor iconOnly = false;
|
|
18
|
+
|
|
19
|
+
@property({ type: Boolean })
|
|
20
|
+
accessor textOnly = false;
|
|
21
|
+
|
|
22
|
+
protected render() {
|
|
23
|
+
|
|
24
|
+
return html`
|
|
25
|
+
<div class="logo">
|
|
26
|
+
${ !this.textOnly ? html`<img src=${HotLogoIconSVG} />` : null }
|
|
27
|
+
${ !this.iconOnly ? html`<img src=${HotLogoTextSVG} />` : null }
|
|
28
|
+
</div>
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default Logo;
|
|
35
|
+
|
|
36
|
+
// Define web component
|
|
37
|
+
customElements.define("hot-logo", Logo);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { createComponent } from '@lit/react';
|
|
4
|
+
import Header from '../header/header';
|
|
5
|
+
|
|
6
|
+
const reactWrapper = createComponent({
|
|
7
|
+
tagName: 'hot-header',
|
|
8
|
+
elementClass: Header,
|
|
9
|
+
react: React,
|
|
10
|
+
events: {
|
|
11
|
+
onLogin: 'login',
|
|
12
|
+
},
|
|
13
|
+
displayName: 'HotHeader'
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export default reactWrapper;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { createComponent } from '@lit/react';
|
|
5
|
+
import Logo from '../logo/logo';
|
|
6
|
+
|
|
7
|
+
const reactWrapper = createComponent({
|
|
8
|
+
tagName: 'hot-logo',
|
|
9
|
+
elementClass: Logo,
|
|
10
|
+
react: React,
|
|
11
|
+
events: {},
|
|
12
|
+
displayName: 'HotLogo'
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default reactWrapper;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { createComponent } from '@lit/react';
|
|
5
|
+
import Toolbar from '../toolbar/toolbar';
|
|
6
|
+
|
|
7
|
+
const reactWrapper = createComponent({
|
|
8
|
+
tagName: 'hot-toolbar',
|
|
9
|
+
elementClass: Toolbar,
|
|
10
|
+
react: React,
|
|
11
|
+
events: {
|
|
12
|
+
onUndoClick: 'undo',
|
|
13
|
+
onRedoClick: 'redo',
|
|
14
|
+
onBoldClick: 'bold',
|
|
15
|
+
onItalicClick: 'italic',
|
|
16
|
+
onUnderlineClick: 'underline',
|
|
17
|
+
onLeftalignClick: 'leftalign',
|
|
18
|
+
onCenteralignClick: 'centeralign',
|
|
19
|
+
onRightalignClick: 'rightalign',
|
|
20
|
+
},
|
|
21
|
+
displayName: 'HotToolbar'
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export default reactWrapper;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { createComponent } from '@lit/react';
|
|
4
|
+
import Tracking from '../tracking/tracking';
|
|
5
|
+
|
|
6
|
+
const reactWrapper = createComponent({
|
|
7
|
+
tagName: 'hot-tracking',
|
|
8
|
+
elementClass: Tracking,
|
|
9
|
+
react: React,
|
|
10
|
+
events: {
|
|
11
|
+
onAgree: 'agree',
|
|
12
|
+
onDisagree: 'disagree',
|
|
13
|
+
},
|
|
14
|
+
displayName: 'HotTracking'
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export default reactWrapper;
|