@lavalogic/scoria 0.40.11 → 0.40.12

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.
@@ -99,6 +99,7 @@
99
99
  </script>
100
100
 
101
101
  <script lang="ts">
102
+ import { loaderDefaults } from '../Helpers/loaderDefaults.svelte.js';
102
103
  import type { LoadingAnimationProps } from './LoadingAnimationProps.js';
103
104
 
104
105
  const {
@@ -114,7 +115,12 @@
114
115
  // The word the box spells: the caller's first name, or the product name as a
115
116
  // friendly fallback. Block capitals tumble cleanly and dodge lowercase
116
117
  // descenders clipping the baseline on landing.
117
- const word = $derived((name.trim() || 'FloWMS').toUpperCase());
118
+ // Explicit `name` prop wins; otherwise fall back to the app-wide default
119
+ // (set by the host so internally-rendered loaders also show the user), then
120
+ // finally the product name.
121
+ const word = $derived(
122
+ (name.trim() || loaderDefaults.name.trim() || 'FloWMS').toUpperCase()
123
+ );
118
124
 
119
125
  // Caption text with any trailing dots/ellipsis stripped, since the pill
120
126
  // appends its own animated "..." — avoids "moment……" style doubling.
@@ -1107,21 +1113,30 @@
1107
1113
  top: 0;
1108
1114
  }
1109
1115
  .flowms-loader {
1110
- /* Caption pill: sits above the box and on top of every other layer. */
1116
+ /* Caption pill: sits above the box and on top of every other layer. Its
1117
+ bottom edge is anchored just above the opened flaps, so longer messages
1118
+ wrap and grow UPWARD into the headroom rather than down over the box. */
1111
1119
  }
1112
1120
  .flowms-loader .caption {
1113
1121
  position: absolute;
1114
1122
  left: 50%;
1115
- top: 10px; /* sits in the headroom above the opened flaps */
1123
+ bottom: calc(100% - 50px);
1116
1124
  transform: translateX(-50%);
1117
- white-space: nowrap;
1125
+ /* `width: max-content` opts out of the half-container shrink that
1126
+ `left: 50%` would otherwise impose, so the pill sizes to its text up
1127
+ to the max-width (then wraps). */
1128
+ width: max-content;
1129
+ max-width: min(380px, 90vw);
1130
+ white-space: normal;
1131
+ text-align: center;
1132
+ text-wrap: balance;
1118
1133
  padding: 7px 16px;
1119
1134
  border-radius: 999px;
1120
1135
  background: rgba(255, 255, 255, 0.82);
1121
1136
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
1122
1137
  -webkit-backdrop-filter: blur(3px);
1123
1138
  backdrop-filter: blur(3px);
1124
- font: 600 14px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
1139
+ font: 600 14px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif;
1125
1140
  color: #44515a;
1126
1141
  letter-spacing: 0.2px;
1127
1142
  }
@@ -35,13 +35,9 @@
35
35
  aria-live="polite"
36
36
  >
37
37
  <div class="modal-root">
38
- {#if message}
39
- <p>{message}</p>
40
- {/if}
41
38
  <LoadingAnimation
42
39
  {name}
43
- {caption}
44
- showText={!message}
40
+ caption={message ?? caption}
45
41
  />
46
42
  </div>
47
43
  </dialog>
@@ -310,17 +306,4 @@ dialog .modal-root {
310
306
  align-items: center;
311
307
  background: rgba(0, 0, 0, 0);
312
308
  position: relative;
313
- }
314
- dialog .modal-root p {
315
- position: absolute;
316
- left: 50%;
317
- top: 50%;
318
- z-index: 99999;
319
- translate: -50% -80%;
320
- user-select: none;
321
- text-shadow: 0px 0px 3px #000000;
322
- background-color: rgba(0, 0, 0, 0.4);
323
- border-radius: 4px;
324
- padding: 1rem;
325
- color: #ffffff;
326
309
  }</style>
@@ -17,13 +17,9 @@
17
17
  ? `border-radius: ${borderRadius};`
18
18
  : undefined}
19
19
  >
20
- {#if message}
21
- <p>{message}</p>
22
- {/if}
23
20
  <LoadingAnimation
24
21
  {name}
25
- {caption}
26
- showText={!message}
22
+ caption={message ?? caption}
27
23
  />
28
24
  </div>
29
25
 
@@ -43,19 +39,6 @@
43
39
  flex-flow: column;
44
40
  gap: 2rem;
45
41
  }
46
- .loading-overlay p {
47
- position: absolute;
48
- left: 50%;
49
- top: 50%;
50
- z-index: 99999;
51
- translate: -50% -80%;
52
- user-select: none;
53
- text-shadow: 0px 0px 3px #000000;
54
- background-color: rgba(0, 0, 0, 0.4);
55
- border-radius: 4px;
56
- padding: 1rem;
57
- color: #ffffff;
58
- }
59
42
  .loading-overlay.absolute {
60
43
  position: absolute;
61
44
  }</style>
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Global fallback configuration for all loaders.
3
+ *
4
+ * Loaders rendered *internally* by components like {@link Table},
5
+ * {@link DesktopModal} and {@link AppointmentCalendar} can't be handed a `name`
6
+ * prop at the call site. So the host app sets {@link loaderDefaults.name} once —
7
+ * typically in its root layout inside a browser `$effect` — and every loader
8
+ * (including those internal ones) spells that name. An explicit `name` prop on a
9
+ * specific loader still takes precedence.
10
+ *
11
+ * Only assign this on the client (inside an `$effect` / `onMount`). Assigning it
12
+ * during SSR would share one request's value with concurrent requests.
13
+ */
14
+ export declare const loaderDefaults: {
15
+ name: string;
16
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Global fallback configuration for all loaders.
3
+ *
4
+ * Loaders rendered *internally* by components like {@link Table},
5
+ * {@link DesktopModal} and {@link AppointmentCalendar} can't be handed a `name`
6
+ * prop at the call site. So the host app sets {@link loaderDefaults.name} once —
7
+ * typically in its root layout inside a browser `$effect` — and every loader
8
+ * (including those internal ones) spells that name. An explicit `name` prop on a
9
+ * specific loader still takes precedence.
10
+ *
11
+ * Only assign this on the client (inside an `$effect` / `onMount`). Assigning it
12
+ * during SSR would share one request's value with concurrent requests.
13
+ */
14
+ export const loaderDefaults = $state({ name: '' });
package/dist/index.d.ts CHANGED
@@ -64,6 +64,7 @@ export type { InfoAlertProps } from './Components/InfoAlertProps.js';
64
64
  export type { InputProps } from './Components/InputProps.js';
65
65
  export { default as LoadingAnimation } from './Components/LoadingAnimation.svelte';
66
66
  export type { LoadingAnimationProps } from './Components/LoadingAnimationProps.js';
67
+ export { loaderDefaults } from './Helpers/loaderDefaults.svelte.js';
67
68
  export { default as LoadingModal } from './Components/LoadingModal.svelte';
68
69
  export type { LoadingModalProps } from './Components/LoadingModalProps.js';
69
70
  export { default as LoadingOverlay } from './Components/LoadingOverlay.svelte';
package/dist/index.js CHANGED
@@ -40,6 +40,7 @@ export {} from './Components/IconProps.js';
40
40
  export { icons } from './Components/Icons.js';
41
41
  export { default as InfoAlert } from './Components/InfoAlert.svelte';
42
42
  export { default as LoadingAnimation } from './Components/LoadingAnimation.svelte';
43
+ export { loaderDefaults } from './Helpers/loaderDefaults.svelte.js';
43
44
  export { default as LoadingModal } from './Components/LoadingModal.svelte';
44
45
  export { default as LoadingOverlay } from './Components/LoadingOverlay.svelte';
45
46
  export { default as Modal } from './Components/Modal.svelte';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lavalogic/scoria",
3
3
  "description": "Svelte components used for the FloWMS Web Frontend",
4
- "version": "0.40.11",
4
+ "version": "0.40.12",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },