@abcnews/components-builder 0.0.9 → 0.0.10
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 +9 -0
- package/dist/Loader/Loader.svelte +64 -0
- package/dist/Loader/Loader.svelte.d.ts +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -196,6 +196,15 @@ As a prerequisite your builder must store its state in window.location.hash. E.g
|
|
|
196
196
|
|
|
197
197
|
Prefixes correlate to the different marker types that have been implemented in the app. Users can choose which type of marker they want to copy. This is the same object as the `ScreenshotTool` component.
|
|
198
198
|
|
|
199
|
+
## Loader
|
|
200
|
+
|
|
201
|
+
A fairly straightforward spinner with the text "Loading" underneath. Use it when the user needs to wait for a process to complete. You can adjust the size or text:
|
|
202
|
+
|
|
203
|
+
```svelte
|
|
204
|
+
<Loader width="32px" />
|
|
205
|
+
<Loader>Reticulating splines</Loader>
|
|
206
|
+
```
|
|
207
|
+
|
|
199
208
|
## Developing
|
|
200
209
|
|
|
201
210
|
Once you've nstalled dependencies with `npm install`, start a development storybook:
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
* A loading spinner
|
|
5
|
+
*/
|
|
6
|
+
let { width = "32px", children = null } = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div class="loader" style:--width={width}>
|
|
10
|
+
<div class="loader__widget"></div>
|
|
11
|
+
<div class="loader__text">{@render children()}</div>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<style>
|
|
15
|
+
.loader {
|
|
16
|
+
font-family: "abcsans", sans-serif;
|
|
17
|
+
font-size: 1rem;
|
|
18
|
+
font-style: normal;
|
|
19
|
+
font-weight: 700;
|
|
20
|
+
line-height: normal;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: 0.75rem;
|
|
25
|
+
animation: fadeIn 1s;
|
|
26
|
+
}
|
|
27
|
+
.loader__widget,
|
|
28
|
+
.loader__widget::after {
|
|
29
|
+
display: block;
|
|
30
|
+
position: relative;
|
|
31
|
+
width: var(--width);
|
|
32
|
+
height: var(--width);
|
|
33
|
+
border: 2px solid currentcolor;
|
|
34
|
+
border-radius: 100%;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
}
|
|
37
|
+
.loader__widget::after {
|
|
38
|
+
content: "";
|
|
39
|
+
display: block;
|
|
40
|
+
border-color: white;
|
|
41
|
+
position: absolute;
|
|
42
|
+
left: -2px;
|
|
43
|
+
top: -2px;
|
|
44
|
+
clip-path: polygon(0 0%, 50% 0, 50% 50%, 0% 50%);
|
|
45
|
+
animation: spin 1.5s linear infinite;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@keyframes spin {
|
|
49
|
+
from {
|
|
50
|
+
transform: rotate(45deg);
|
|
51
|
+
}
|
|
52
|
+
to {
|
|
53
|
+
transform: rotate(405deg);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
@keyframes fadeIn {
|
|
57
|
+
from {
|
|
58
|
+
opacity: 0;
|
|
59
|
+
}
|
|
60
|
+
to {
|
|
61
|
+
opacity: 1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
package/dist/index.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export { default as ScreenshotTool } from "./ScreenshotTool/ScreenshotTool.svelt
|
|
|
7
7
|
export { default as Typeahead } from "./Typeahead/Typeahead.svelte";
|
|
8
8
|
export { default as UpdateChecker } from "./UpdateChecker/UpdateChecker.svelte";
|
|
9
9
|
export { default as MarkerAdmin } from "./MarkerAdmin/MarkerAdmin.svelte";
|
|
10
|
+
export { default as Loader } from "./Loader/Loader.svelte";
|
package/dist/index.js
CHANGED
|
@@ -8,3 +8,4 @@ export { default as ScreenshotTool } from "./ScreenshotTool/ScreenshotTool.svelt
|
|
|
8
8
|
export { default as Typeahead } from "./Typeahead/Typeahead.svelte";
|
|
9
9
|
export { default as UpdateChecker } from "./UpdateChecker/UpdateChecker.svelte";
|
|
10
10
|
export { default as MarkerAdmin } from "./MarkerAdmin/MarkerAdmin.svelte";
|
|
11
|
+
export { default as Loader } from "./Loader/Loader.svelte";
|