@abcnews/components-builder 0.0.8 → 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 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:
@@ -214,15 +223,7 @@ To build the library:
214
223
  npm run build
215
224
  ```
216
225
 
217
- You can preview the production build with `npm run preview`.
218
-
219
- > To deploy the app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for the target environment.
220
-
221
- ## Publishing
222
-
223
- Go into the `package.json` and give the package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
224
-
225
- To publish the library to [npm](https://www.npmjs.com):
226
+ Then publish the new version with:
226
227
 
227
228
  ```bash
228
229
  npm publish
@@ -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>
@@ -0,0 +1,6 @@
1
+ declare const Loader: import("svelte").Component<{
2
+ width?: string;
3
+ children?: any;
4
+ }, {}, "">;
5
+ type Loader = ReturnType<typeof Loader>;
6
+ export default Loader;
@@ -1 +1 @@
1
- export function saveAs(blob: any, name: any): void;
1
+ export default function saveAs(blob: any, name: any): void;
@@ -7,7 +7,7 @@
7
7
  * License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)
8
8
  * source : http://purl.eligrey.com/github/FileSaver.js
9
9
  */
10
- export function saveAs(blob, name) {
10
+ export default function saveAs(blob, name) {
11
11
  var a = document.createElement("a");
12
12
  name = name || blob.name || "download";
13
13
 
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abcnews/components-builder",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",