@hotosm/ui 0.2.0-b3 → 0.2.0-b5
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 +105 -105
- package/components/header/header.styles.ts +103 -0
- package/components/header/header.ts +160 -0
- package/components/{icons.js → icons.ts} +25 -13
- package/components/index.ts +265 -0
- package/components/logo/logo.styles.ts +8 -0
- package/components/logo/logo.ts +37 -0
- package/components/react/Header.ts +16 -0
- package/{react/Header.js → components/react/Logo.ts} +9 -5
- 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 +171 -0
- package/components/tracking/tracking.styles.ts +23 -0
- package/components/tracking/tracking.ts +177 -0
- 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/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/dist/components/tracking/tracking.d.ts +23 -0
- package/dist/components/tracking/tracking.styles.d.ts +2 -0
- package/dist/hotosm-ui.js +18450 -0
- package/dist/style.css +1 -0
- package/package.json +29 -35
- package/theme/hot-sl.css +194 -0
- package/theme/hot.css +191 -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/Button.d.ts +0 -16
- package/components/Button.js +0 -75
- package/components/Header.d.ts +0 -16
- package/components/Header.js +0 -152
- package/components/Toolbar.d.ts +0 -26
- package/components/Toolbar.js +0 -123
- package/components/Tracking.d.ts +0 -26
- package/components/Tracking.js +0 -167
- package/components/index.d.ts +0 -4
- package/components/index.js +0 -6
- package/dist/assets/logo-CqlPtOQW.png +0 -0
- package/dist/components.js +0 -121
- package/dist/styles.css +0 -1092
- package/react/Button.js +0 -14
- package/react/Toolbar.js +0 -21
- package/react/Tracking.js +0 -15
- package/react/index.d.ts +0 -4
- package/react/index.js +0 -6
- package/theme/logo.png +0 -0
- /package/{components → dist/components}/icons.d.ts +0 -0
- /package/{react → dist/components/react}/Header.d.ts +0 -0
- /package/{react/Button.d.ts → dist/components/react/Logo.d.ts} +0 -0
- /package/{react → dist/components/react}/Toolbar.d.ts +0 -0
- /package/{react → dist/components/react}/Tracking.d.ts +0 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
// Index to import all components together
|
|
2
|
+
|
|
3
|
+
import { setBasePath } from '@shoelace-style/shoelace/dist/utilities/base-path.js';
|
|
4
|
+
|
|
5
|
+
// Default Shoelace exports
|
|
6
|
+
import SlAlert from '@shoelace-style/shoelace/dist/components/alert/alert.component.js';
|
|
7
|
+
import SlAnimatedImage from '@shoelace-style/shoelace/dist/components/animated-image/animated-image.component.js';
|
|
8
|
+
import SlAnimation from '@shoelace-style/shoelace/dist/components/animation/animation.component.js';
|
|
9
|
+
import SlAvatar from '@shoelace-style/shoelace/dist/components/avatar/avatar.component.js';
|
|
10
|
+
import SlBadge from '@shoelace-style/shoelace/dist/components/badge/badge.component.js';
|
|
11
|
+
import SlBreadcrumb from '@shoelace-style/shoelace/dist/components/breadcrumb/breadcrumb.component.js';
|
|
12
|
+
import SlBreadcrumbItem from '@shoelace-style/shoelace/dist/components/breadcrumb-item/breadcrumb-item.component.js';
|
|
13
|
+
import SlButton from '@shoelace-style/shoelace/dist/components/button/button.component.js';
|
|
14
|
+
import SlButtonGroup from '@shoelace-style/shoelace/dist/components/button-group/button-group.component.js';
|
|
15
|
+
import SlCard from '@shoelace-style/shoelace/dist/components/card/card.component.js';
|
|
16
|
+
import SlCarousel from '@shoelace-style/shoelace/dist/components/carousel/carousel.component.js';
|
|
17
|
+
import SlCarouselItem from '@shoelace-style/shoelace/dist/components/carousel-item/carousel-item.component.js';
|
|
18
|
+
import SlCheckbox from '@shoelace-style/shoelace/dist/components/checkbox/checkbox.component.js';
|
|
19
|
+
import SlColorPicker from '@shoelace-style/shoelace/dist/components/color-picker/color-picker.component.js';
|
|
20
|
+
import SlCopyButton from '@shoelace-style/shoelace/dist/components/copy-button/copy-button.component.js';
|
|
21
|
+
import SlDetails from '@shoelace-style/shoelace/dist/components/details/details.component.js';
|
|
22
|
+
import SlDialog from '@shoelace-style/shoelace/dist/components/dialog/dialog.component.js';
|
|
23
|
+
import SlDivider from '@shoelace-style/shoelace/dist/components/divider/divider.component.js';
|
|
24
|
+
import SlDrawer from '@shoelace-style/shoelace/dist/components/drawer/drawer.component.js';
|
|
25
|
+
import SlDropdown from '@shoelace-style/shoelace/dist/components/dropdown/dropdown.component.js';
|
|
26
|
+
import SlFormatBytes from '@shoelace-style/shoelace/dist/components/format-bytes/format-bytes.component.js';
|
|
27
|
+
import SlFormatDate from '@shoelace-style/shoelace/dist/components/format-date/format-date.component.js';
|
|
28
|
+
import SlFormatNumber from '@shoelace-style/shoelace/dist/components/format-number/format-number.component.js';
|
|
29
|
+
import SlIcon from '@shoelace-style/shoelace/dist/components/icon/icon.component.js';
|
|
30
|
+
import SlIconButton from '@shoelace-style/shoelace/dist/components/icon-button/icon-button.component.js';
|
|
31
|
+
import SlImageComparer from '@shoelace-style/shoelace/dist/components/image-comparer/image-comparer.component.js';
|
|
32
|
+
import SlInclude from '@shoelace-style/shoelace/dist/components/include/include.component.js';
|
|
33
|
+
import SlInput from '@shoelace-style/shoelace/dist/components/input/input.component.js';
|
|
34
|
+
import SlMenu from '@shoelace-style/shoelace/dist/components/menu/menu.component.js';
|
|
35
|
+
import SlMenuItem from '@shoelace-style/shoelace/dist/components/menu-item/menu-item.component.js';
|
|
36
|
+
import SlMenuLabel from '@shoelace-style/shoelace/dist/components/menu-label/menu-label.component.js';
|
|
37
|
+
import SlMutationObserver from '@shoelace-style/shoelace/dist/components/mutation-observer/mutation-observer.component.js';
|
|
38
|
+
import SlOption from '@shoelace-style/shoelace/dist/components/option/option.component.js';
|
|
39
|
+
import SlPopup from '@shoelace-style/shoelace/dist/components/popup/popup.component.js';
|
|
40
|
+
import SlProgressBar from '@shoelace-style/shoelace/dist/components/progress-bar/progress-bar.component.js';
|
|
41
|
+
import SlProgressRing from '@shoelace-style/shoelace/dist/components/progress-ring/progress-ring.component.js';
|
|
42
|
+
import SlQRCode from '@shoelace-style/shoelace/dist/components/qr-code/qr-code.component.js';
|
|
43
|
+
import SlRadio from '@shoelace-style/shoelace/dist/components/radio/radio.component.js';
|
|
44
|
+
import SlRadioButton from '@shoelace-style/shoelace/dist/components/radio-button/radio-button.component.js';
|
|
45
|
+
import SlRadioGroup from '@shoelace-style/shoelace/dist/components/radio-group/radio-group.component.js';
|
|
46
|
+
import SlRange from '@shoelace-style/shoelace/dist/components/range/range.component.js';
|
|
47
|
+
import SlRating from '@shoelace-style/shoelace/dist/components/rating/rating.component.js';
|
|
48
|
+
import SlRelativeTime from '@shoelace-style/shoelace/dist/components/relative-time/relative-time.component.js';
|
|
49
|
+
import SlResizeObserver from '@shoelace-style/shoelace/dist/components/resize-observer/resize-observer.component.js';
|
|
50
|
+
import SlSelect from '@shoelace-style/shoelace/dist/components/select/select.component.js';
|
|
51
|
+
import SlSkeleton from '@shoelace-style/shoelace/dist/components/skeleton/skeleton.component.js';
|
|
52
|
+
import SlSpinner from '@shoelace-style/shoelace/dist/components/spinner/spinner.component.js';
|
|
53
|
+
import SlSplitPanel from '@shoelace-style/shoelace/dist/components/split-panel/split-panel.component.js';
|
|
54
|
+
import SlSwitch from '@shoelace-style/shoelace/dist/components/switch/switch.component.js';
|
|
55
|
+
import SlTab from '@shoelace-style/shoelace/dist/components/tab/tab.component.js';
|
|
56
|
+
import SlTabGroup from '@shoelace-style/shoelace/dist/components/tab-group/tab-group.component.js';
|
|
57
|
+
import SlTabPanel from '@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.component.js';
|
|
58
|
+
import SlTag from '@shoelace-style/shoelace/dist/components/tag/tag.component.js';
|
|
59
|
+
import SlTextarea from '@shoelace-style/shoelace/dist/components/textarea/textarea.component.js';
|
|
60
|
+
import SlTooltip from '@shoelace-style/shoelace/dist/components/tooltip/tooltip.component.js';
|
|
61
|
+
import SlTree from '@shoelace-style/shoelace/dist/components/tree/tree.component.js';
|
|
62
|
+
import SlTreeItem from '@shoelace-style/shoelace/dist/components/tree-item/tree-item.component.js';
|
|
63
|
+
import SlVisuallyHidden from '@shoelace-style/shoelace/dist/components/visually-hidden/visually-hidden.component.js';
|
|
64
|
+
|
|
65
|
+
// Custom composite components
|
|
66
|
+
import HotHeader from './header/header';
|
|
67
|
+
import HotLogo from './logo/logo';
|
|
68
|
+
import HotToolbar from './toolbar/toolbar';
|
|
69
|
+
import HotTracking from './tracking/tracking';
|
|
70
|
+
|
|
71
|
+
// Define web component names for Shoelace components
|
|
72
|
+
SlAlert.define('hot-alert');
|
|
73
|
+
SlAnimatedImage.define('hot-animated-image');
|
|
74
|
+
SlAnimation.define('hot-animation');
|
|
75
|
+
SlAvatar.define('hot-avatar');
|
|
76
|
+
SlBadge.define('hot-badge');
|
|
77
|
+
SlBreadcrumb.define('hot-breadcrumb');
|
|
78
|
+
SlBreadcrumbItem.define('hot-breadcrumb-item');
|
|
79
|
+
SlButton.define('hot-button');
|
|
80
|
+
SlButtonGroup.define('hot-button-group');
|
|
81
|
+
SlCard.define('hot-card');
|
|
82
|
+
SlCarousel.define('hot-carousel');
|
|
83
|
+
SlCarouselItem.define('hot-carousel-item');
|
|
84
|
+
SlCheckbox.define('hot-checkbox');
|
|
85
|
+
SlColorPicker.define('hot-color-picker');
|
|
86
|
+
SlCopyButton.define('hot-copy-button');
|
|
87
|
+
SlDetails.define('hot-details');
|
|
88
|
+
SlDialog.define('hot-dialog');
|
|
89
|
+
SlDivider.define('hot-divider');
|
|
90
|
+
SlDrawer.define('hot-drawer');
|
|
91
|
+
SlDropdown.define('hot-dropdown');
|
|
92
|
+
SlFormatBytes.define('hot-format-bytes');
|
|
93
|
+
SlFormatDate.define('hot-format-date');
|
|
94
|
+
SlFormatNumber.define('hot-format-number');
|
|
95
|
+
SlIcon.define('hot-icon');
|
|
96
|
+
SlIconButton.define('hot-icon-button');
|
|
97
|
+
SlImageComparer.define('hot-image-comparer');
|
|
98
|
+
SlInclude.define('hot-include');
|
|
99
|
+
SlInput.define('hot-input');
|
|
100
|
+
SlMenu.define('hot-menu');
|
|
101
|
+
SlMenuItem.define('hot-menu-item');
|
|
102
|
+
SlMenuLabel.define('hot-menu-label');
|
|
103
|
+
SlMutationObserver.define('hot-mutation-observer');
|
|
104
|
+
SlOption.define('hot-option');
|
|
105
|
+
SlPopup.define('hot-popup');
|
|
106
|
+
SlProgressBar.define('hot-progress-bar');
|
|
107
|
+
SlProgressRing.define('hot-progress-ring');
|
|
108
|
+
SlQRCode.define('hot-qr-code');
|
|
109
|
+
SlRadio.define('hot-radio');
|
|
110
|
+
SlRadioButton.define('hot-radio-button');
|
|
111
|
+
SlRadioGroup.define('hot-radio-group');
|
|
112
|
+
SlRange.define('hot-range');
|
|
113
|
+
SlRating.define('hot-rating');
|
|
114
|
+
SlRelativeTime.define('hot-relative-time');
|
|
115
|
+
SlResizeObserver.define('hot-resize-observer');
|
|
116
|
+
SlSelect.define('hot-select');
|
|
117
|
+
SlSkeleton.define('hot-skeleton');
|
|
118
|
+
SlSpinner.define('hot-spinner');
|
|
119
|
+
SlSplitPanel.define('hot-split-panel');
|
|
120
|
+
SlSwitch.define('hot-switch');
|
|
121
|
+
SlTab.define('hot-tab');
|
|
122
|
+
SlTabGroup.define('hot-tab-group');
|
|
123
|
+
SlTabPanel.define('hot-tab-panel');
|
|
124
|
+
SlTag.define('hot-tag');
|
|
125
|
+
SlTextarea.define('hot-textarea');
|
|
126
|
+
SlTooltip.define('hot-tooltip');
|
|
127
|
+
SlTree.define('hot-tree');
|
|
128
|
+
SlTreeItem.define('hot-tree-item');
|
|
129
|
+
SlVisuallyHidden.define('hot-visually-hidden');
|
|
130
|
+
|
|
131
|
+
declare global {
|
|
132
|
+
interface HTMLElementTagNameMap {
|
|
133
|
+
'hot-alert': SlAlert;
|
|
134
|
+
'hot-animated-image': SlAnimatedImage;
|
|
135
|
+
'hot-animation': SlAnimation;
|
|
136
|
+
'hot-avatar': SlAvatar;
|
|
137
|
+
'hot-badge': SlBadge;
|
|
138
|
+
'hot-breadcrumb': SlBreadcrumb;
|
|
139
|
+
'hot-breadcrumb-item': SlBreadcrumbItem;
|
|
140
|
+
'hot-button': SlButton;
|
|
141
|
+
'hot-button-group': SlButtonGroup;
|
|
142
|
+
'hot-card': SlCard;
|
|
143
|
+
'hot-carousel': SlCarousel;
|
|
144
|
+
'hot-carousel-item': SlCarouselItem;
|
|
145
|
+
'hot-checkbox': SlCheckbox;
|
|
146
|
+
'hot-color-picker': SlColorPicker;
|
|
147
|
+
'hot-copy-button': SlCopyButton;
|
|
148
|
+
'hot-details': SlDetails;
|
|
149
|
+
'hot-dialog': SlDialog;
|
|
150
|
+
'hot-divider': SlDivider;
|
|
151
|
+
'hot-drawer': SlDrawer;
|
|
152
|
+
'hot-dropdown': SlDropdown;
|
|
153
|
+
'hot-format-bytes': SlFormatBytes;
|
|
154
|
+
'hot-format-date': SlFormatDate;
|
|
155
|
+
'hot-format-number': SlFormatNumber;
|
|
156
|
+
'hot-icon': SlIcon;
|
|
157
|
+
'hot-icon-button': SlIconButton;
|
|
158
|
+
'hot-image-comparer': SlImageComparer;
|
|
159
|
+
'hot-include': SlInclude;
|
|
160
|
+
'hot-input': SlInput;
|
|
161
|
+
'hot-menu': SlMenu;
|
|
162
|
+
'hot-menu-item': SlMenuItem;
|
|
163
|
+
'hot-menu-label': SlMenuLabel;
|
|
164
|
+
'hot-mutation-observer': SlMutationObserver;
|
|
165
|
+
'hot-option': SlOption;
|
|
166
|
+
'hot-popup': SlPopup;
|
|
167
|
+
'hot-progress-bar': SlProgressBar;
|
|
168
|
+
'hot-progress-ring': SlProgressRing;
|
|
169
|
+
'hot-qrcode': SlQRCode;
|
|
170
|
+
'hot-radio': SlRadio;
|
|
171
|
+
'hot-radio-button': SlRadioButton;
|
|
172
|
+
'hot-radio-group': SlRadioGroup;
|
|
173
|
+
'hot-range': SlRange;
|
|
174
|
+
'hot-rating': SlRating;
|
|
175
|
+
'hot-relative-time': SlRelativeTime;
|
|
176
|
+
'hot-resize-observer': SlResizeObserver;
|
|
177
|
+
'hot-select': SlSelect;
|
|
178
|
+
'hot-skeleton': SlSkeleton;
|
|
179
|
+
'hot-spinner': SlSpinner;
|
|
180
|
+
'hot-split-panel': SlSplitPanel;
|
|
181
|
+
'hot-switch': SlSwitch;
|
|
182
|
+
'hot-tab': SlTab;
|
|
183
|
+
'hot-tab-group': SlTabGroup;
|
|
184
|
+
'hot-tab-panel': SlTabPanel;
|
|
185
|
+
'hot-tag': SlTag;
|
|
186
|
+
'hot-textarea': SlTextarea;
|
|
187
|
+
'hot-tooltip': SlTooltip;
|
|
188
|
+
'hot-tree': SlTree;
|
|
189
|
+
'hot-tree-item': SlTreeItem;
|
|
190
|
+
'hot-visually-hidden': SlVisuallyHidden;
|
|
191
|
+
// Custom composite components
|
|
192
|
+
'hot-header': HotHeader;
|
|
193
|
+
'hot-toolbar': HotToolbar;
|
|
194
|
+
'hot-tracking': HotTracking;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export {
|
|
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,
|
|
260
|
+
// Custom composite components
|
|
261
|
+
HotHeader as Header,
|
|
262
|
+
HotLogo as Logo,
|
|
263
|
+
HotToolbar as Toolbar,
|
|
264
|
+
HotTracking as Tracking,
|
|
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;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
|
|
1
2
|
// @ts-ignore
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { createComponent } from '@lit/react';
|
|
4
|
-
import
|
|
5
|
+
import Logo from '../logo/logo';
|
|
6
|
+
|
|
5
7
|
const reactWrapper = createComponent({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
tagName: 'hot-logo',
|
|
9
|
+
elementClass: Logo,
|
|
10
|
+
react: React,
|
|
11
|
+
events: {},
|
|
12
|
+
displayName: 'HotLogo'
|
|
10
13
|
});
|
|
14
|
+
|
|
11
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;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export { default as Header } from './Header';
|
|
2
|
+
export { default as Toolbar } from './Toolbar';
|
|
3
|
+
export { default as Tracking } from './Tracking';
|
|
4
|
+
export { default as Logo } from './Logo';
|
|
5
|
+
|
|
6
|
+
export { default as Alert } from '@shoelace-style/shoelace/dist/react/alert/index.js';
|
|
7
|
+
export { default as AnimatedImage } from '@shoelace-style/shoelace/dist/react/animated-image/index.js';
|
|
8
|
+
export { default as Animation } from '@shoelace-style/shoelace/dist/react/animation/index.js';
|
|
9
|
+
export { default as Avatar } from '@shoelace-style/shoelace/dist/react/avatar/index.js';
|
|
10
|
+
export { default as Badge } from '@shoelace-style/shoelace/dist/react/badge/index.js';
|
|
11
|
+
export { default as Breadcrumb } from '@shoelace-style/shoelace/dist/react/breadcrumb/index.js';
|
|
12
|
+
export { default as BreadcrumbItem } from '@shoelace-style/shoelace/dist/react/breadcrumb-item/index.js';
|
|
13
|
+
export { default as Button } from '@shoelace-style/shoelace/dist/react/button/index.js';
|
|
14
|
+
export { default as ButtonGroup } from '@shoelace-style/shoelace/dist/react/button-group/index.js';
|
|
15
|
+
export { default as Card } from '@shoelace-style/shoelace/dist/react/card/index.js';
|
|
16
|
+
export { default as Carousel } from '@shoelace-style/shoelace/dist/react/carousel/index.js';
|
|
17
|
+
export { default as CarouselItem } from '@shoelace-style/shoelace/dist/react/carousel-item/index.js';
|
|
18
|
+
export { default as Checkbox } from '@shoelace-style/shoelace/dist/react/checkbox/index.js';
|
|
19
|
+
export { default as ColorPicker } from '@shoelace-style/shoelace/dist/react/color-picker/index.js';
|
|
20
|
+
export { default as CopyButton } from '@shoelace-style/shoelace/dist/react/copy-button/index.js';
|
|
21
|
+
export { default as Details } from '@shoelace-style/shoelace/dist/react/details/index.js';
|
|
22
|
+
export { default as Dialog } from '@shoelace-style/shoelace/dist/react/dialog/index.js';
|
|
23
|
+
export { default as Divider } from '@shoelace-style/shoelace/dist/react/divider/index.js';
|
|
24
|
+
export { default as Drawer } from '@shoelace-style/shoelace/dist/react/drawer/index.js';
|
|
25
|
+
export { default as Dropdown } from '@shoelace-style/shoelace/dist/react/dropdown/index.js';
|
|
26
|
+
export { default as FormatBytes } from '@shoelace-style/shoelace/dist/react/format-bytes/index.js';
|
|
27
|
+
export { default as FormatDate } from '@shoelace-style/shoelace/dist/react/format-date/index.js';
|
|
28
|
+
export { default as FormatNumber } from '@shoelace-style/shoelace/dist/react/format-number/index.js';
|
|
29
|
+
export { default as Icon } from '@shoelace-style/shoelace/dist/react/icon/index.js';
|
|
30
|
+
export { default as IconButton } from '@shoelace-style/shoelace/dist/react/icon-button/index.js';
|
|
31
|
+
export { default as ImageComparer } from '@shoelace-style/shoelace/dist/react/image-comparer/index.js';
|
|
32
|
+
export { default as Include } from '@shoelace-style/shoelace/dist/react/include/index.js';
|
|
33
|
+
export { default as Input } from '@shoelace-style/shoelace/dist/react/input/index.js';
|
|
34
|
+
export { default as Menu } from '@shoelace-style/shoelace/dist/react/menu/index.js';
|
|
35
|
+
export { default as MenuItem } from '@shoelace-style/shoelace/dist/react/menu-item/index.js';
|
|
36
|
+
export { default as MenuLabel } from '@shoelace-style/shoelace/dist/react/menu-label/index.js';
|
|
37
|
+
export { default as MutationObserver } from '@shoelace-style/shoelace/dist/react/mutation-observer/index.js';
|
|
38
|
+
export { default as Option } from '@shoelace-style/shoelace/dist/react/option/index.js';
|
|
39
|
+
export { default as Popup } from '@shoelace-style/shoelace/dist/react/popup/index.js';
|
|
40
|
+
export { default as ProgressBar } from '@shoelace-style/shoelace/dist/react/progress-bar/index.js';
|
|
41
|
+
export { default as ProgressRing } from '@shoelace-style/shoelace/dist/react/progress-ring/index.js';
|
|
42
|
+
export { default as QRCode } from '@shoelace-style/shoelace/dist/react/qr-code/index.js';
|
|
43
|
+
export { default as Radio } from '@shoelace-style/shoelace/dist/react/radio/index.js';
|
|
44
|
+
export { default as RadioButton } from '@shoelace-style/shoelace/dist/react/radio-button/index.js';
|
|
45
|
+
export { default as RadioGroup } from '@shoelace-style/shoelace/dist/react/radio-group/index.js';
|
|
46
|
+
export { default as Range } from '@shoelace-style/shoelace/dist/react/range/index.js';
|
|
47
|
+
export { default as Rating } from '@shoelace-style/shoelace/dist/react/rating/index.js';
|
|
48
|
+
export { default as RelativeTime } from '@shoelace-style/shoelace/dist/react/relative-time/index.js';
|
|
49
|
+
export { default as ResizeObserver } from '@shoelace-style/shoelace/dist/react/resize-observer/index.js';
|
|
50
|
+
export { default as Select } from '@shoelace-style/shoelace/dist/react/select/index.js';
|
|
51
|
+
export { default as Skeleton } from '@shoelace-style/shoelace/dist/react/skeleton/index.js';
|
|
52
|
+
export { default as Spinner } from '@shoelace-style/shoelace/dist/react/spinner/index.js';
|
|
53
|
+
export { default as SplitPanel } from '@shoelace-style/shoelace/dist/react/split-panel/index.js';
|
|
54
|
+
export { default as Switch } from '@shoelace-style/shoelace/dist/react/switch/index.js';
|
|
55
|
+
export { default as Tab } from '@shoelace-style/shoelace/dist/react/tab/index.js';
|
|
56
|
+
export { default as TabGroup } from '@shoelace-style/shoelace/dist/react/tab-group/index.js';
|
|
57
|
+
export { default as TabPanel } from '@shoelace-style/shoelace/dist/react/tab-panel/index.js';
|
|
58
|
+
export { default as Tag } from '@shoelace-style/shoelace/dist/react/tag/index.js';
|
|
59
|
+
export { default as Textarea } from '@shoelace-style/shoelace/dist/react/textarea/index.js';
|
|
60
|
+
export { default as Tooltip } from '@shoelace-style/shoelace/dist/react/tooltip/index.js';
|
|
61
|
+
export { default as Tree } from '@shoelace-style/shoelace/dist/react/tree/index.js';
|
|
62
|
+
export { default as TreeItem } from '@shoelace-style/shoelace/dist/react/tree-item/index.js';
|
|
63
|
+
export { default as VisuallyHidden } from '@shoelace-style/shoelace/dist/react/visually-hidden/index.js';
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import "../../theme/hot-sl.css";
|
|
2
|
+
|
|
3
|
+
import "@shoelace-style/shoelace/dist/components/button/button.js";
|
|
4
|
+
import "@shoelace-style/shoelace/dist/components/button-group/button-group.js";
|
|
5
|
+
import "@shoelace-style/shoelace/dist/components/icon/icon.js";
|
|
6
|
+
import "@shoelace-style/shoelace/dist/components/tooltip/tooltip.js";
|
|
7
|
+
|
|
8
|
+
import { LitElement, html } from "lit";
|
|
9
|
+
import { property } from "lit/decorators.js";
|
|
10
|
+
import styles from './toolbar.styles.js';
|
|
11
|
+
import type { CSSResultGroup } from 'lit';
|
|
12
|
+
|
|
13
|
+
import registerBundledIcons from "../../components/icons";
|
|
14
|
+
|
|
15
|
+
registerBundledIcons();
|
|
16
|
+
|
|
17
|
+
export class Toolbar extends LitElement {
|
|
18
|
+
|
|
19
|
+
static styles: CSSResultGroup = [styles];
|
|
20
|
+
|
|
21
|
+
name = "hot-toolbar";
|
|
22
|
+
|
|
23
|
+
/** Change the position of the tooltips relative to buttons. */
|
|
24
|
+
@property({ type: String, attribute: "tooltip-position" })
|
|
25
|
+
accessor tooltipPosition =
|
|
26
|
+
"top";
|
|
27
|
+
|
|
28
|
+
protected render() {
|
|
29
|
+
return html`
|
|
30
|
+
<div class="toolbar">
|
|
31
|
+
${this.renderButtonGroup("History", [
|
|
32
|
+
{
|
|
33
|
+
content: "Undo",
|
|
34
|
+
icon: "arrow-counterclockwise",
|
|
35
|
+
label: "Undo",
|
|
36
|
+
action: this.undo,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
content: "Redo",
|
|
40
|
+
icon: "arrow-clockwise",
|
|
41
|
+
label: "Redo",
|
|
42
|
+
action: this.redo,
|
|
43
|
+
},
|
|
44
|
+
])}
|
|
45
|
+
${this.renderButtonGroup("Formatting", [
|
|
46
|
+
{
|
|
47
|
+
content: "Bold",
|
|
48
|
+
icon: "type-bold",
|
|
49
|
+
label: "Bold",
|
|
50
|
+
action: this.bold,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
content: "Italic",
|
|
54
|
+
icon: "type-italic",
|
|
55
|
+
label: "Italic",
|
|
56
|
+
action: this.italic,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
content: "Underline",
|
|
60
|
+
icon: "type-underline",
|
|
61
|
+
label: "Underline",
|
|
62
|
+
action: this.underline,
|
|
63
|
+
},
|
|
64
|
+
])}
|
|
65
|
+
${this.renderButtonGroup("Alignment", [
|
|
66
|
+
{
|
|
67
|
+
content: "Align Left",
|
|
68
|
+
icon: "justify-left",
|
|
69
|
+
label: "Align Left",
|
|
70
|
+
action: this.alignLeft,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
content: "Align Center",
|
|
74
|
+
icon: "justify",
|
|
75
|
+
label: "Align Center",
|
|
76
|
+
action: this.alignCenter,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
content: "Align Right",
|
|
80
|
+
icon: "justify-right",
|
|
81
|
+
label: "Align Right",
|
|
82
|
+
action: this.alignRight,
|
|
83
|
+
},
|
|
84
|
+
])}
|
|
85
|
+
</div>
|
|
86
|
+
`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
private renderButtonGroup(
|
|
90
|
+
label: string,
|
|
91
|
+
buttons: Array<{
|
|
92
|
+
content: string;
|
|
93
|
+
icon: string;
|
|
94
|
+
label: string;
|
|
95
|
+
action?: (e: MouseEvent) => void;
|
|
96
|
+
}>
|
|
97
|
+
) {
|
|
98
|
+
return html`
|
|
99
|
+
<sl-button-group label=${label}>
|
|
100
|
+
${buttons.map((button) => this.renderButton(button))}
|
|
101
|
+
</sl-button-group>
|
|
102
|
+
`;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
private renderButton({
|
|
106
|
+
content,
|
|
107
|
+
icon,
|
|
108
|
+
label,
|
|
109
|
+
action,
|
|
110
|
+
}: {
|
|
111
|
+
content: string;
|
|
112
|
+
icon: string;
|
|
113
|
+
label: string;
|
|
114
|
+
action?: (e: MouseEvent) => void;
|
|
115
|
+
}) {
|
|
116
|
+
return html`
|
|
117
|
+
<sl-tooltip content=${content} placement="${this.tooltipPosition}">
|
|
118
|
+
<sl-button @click=${action ?? (() => {})}
|
|
119
|
+
><sl-icon library="bundled" name=${icon} label=${label}></sl-icon
|
|
120
|
+
></sl-button>
|
|
121
|
+
</sl-tooltip>
|
|
122
|
+
`;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
private readonly undo = (e: MouseEvent) => {
|
|
126
|
+
// As the original event is also named 'click'
|
|
127
|
+
// stop propagation of the original event
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
this.dispatchEvent(new Event("undo"));
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
private readonly redo = (e: MouseEvent) => {
|
|
133
|
+
e.stopPropagation();
|
|
134
|
+
this.dispatchEvent(new Event("redo"));
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
private readonly bold = (e: MouseEvent) => {
|
|
138
|
+
e.stopPropagation();
|
|
139
|
+
this.dispatchEvent(new Event("bold"));
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
private readonly italic = (e: MouseEvent) => {
|
|
143
|
+
e.stopPropagation();
|
|
144
|
+
this.dispatchEvent(new Event("italic"));
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
private readonly underline = (e: MouseEvent) => {
|
|
148
|
+
e.stopPropagation();
|
|
149
|
+
this.dispatchEvent(new Event("underline"));
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
private readonly alignLeft = (e: MouseEvent) => {
|
|
153
|
+
e.stopPropagation();
|
|
154
|
+
this.dispatchEvent(new Event("leftalign"));
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
private readonly alignCenter = (e: MouseEvent) => {
|
|
158
|
+
e.stopPropagation();
|
|
159
|
+
this.dispatchEvent(new Event("centeralign"));
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
private readonly alignRight = (e: MouseEvent) => {
|
|
163
|
+
e.stopPropagation();
|
|
164
|
+
this.dispatchEvent(new Event("rightalign"));
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export default Toolbar;
|
|
169
|
+
|
|
170
|
+
// Define web component
|
|
171
|
+
customElements.define("hot-toolbar", Toolbar);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
|
|
3
|
+
export default css`
|
|
4
|
+
.tracking {
|
|
5
|
+
position: absolute;
|
|
6
|
+
bottom: 20px;
|
|
7
|
+
left: 50%;
|
|
8
|
+
transform: translateX(-50%);
|
|
9
|
+
z-index: 1000;
|
|
10
|
+
width: 80vw;
|
|
11
|
+
text-align: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.tracking--header {
|
|
15
|
+
font-weight: var(--sl-font-weight-bold);
|
|
16
|
+
font-size: var(--sl-font-size-large);
|
|
17
|
+
text-align: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.tracking--link {
|
|
21
|
+
color: var(--sl-color-primary-700);
|
|
22
|
+
}
|
|
23
|
+
`
|