@geomak/ui 1.7.5 → 1.8.0
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/dist/index.cjs +204 -146
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -17
- package/dist/index.d.ts +54 -17
- package/dist/index.js +204 -146
- package/dist/index.js.map +1 -1
- package/dist/styles.css +91 -129
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -587,45 +587,82 @@ declare function useNotification(): {
|
|
|
587
587
|
danger: (props: Omit<NotificationPayload, "type">) => void;
|
|
588
588
|
};
|
|
589
589
|
|
|
590
|
+
type LoadingSpinnerSize = 'sm' | 'md' | 'lg';
|
|
590
591
|
interface LoadingSpinnerProps {
|
|
591
|
-
/**
|
|
592
|
-
|
|
592
|
+
/**
|
|
593
|
+
* Text revealed letter-by-letter beneath the spinner. Optional — pass
|
|
594
|
+
* `undefined` for a pure spinner with no caption (e.g. inline mode).
|
|
595
|
+
*/
|
|
596
|
+
prompt?: string;
|
|
597
|
+
/** Spinner size variant. Defaults to `'md'`. */
|
|
598
|
+
size?: LoadingSpinnerSize;
|
|
599
|
+
/**
|
|
600
|
+
* When `true`, renders inline at the call site (no portal, no fullscreen
|
|
601
|
+
* overlay, no backdrop). Useful inside cards, table rows, drawers, or
|
|
602
|
+
* empty-state slots. Defaults to `false` (fullscreen overlay).
|
|
603
|
+
*/
|
|
604
|
+
inline?: boolean;
|
|
593
605
|
/**
|
|
594
606
|
* Optional override for the spinner ring colour. Accepts any CSS colour.
|
|
595
|
-
* Defaults to the accent token so it picks up theme overrides.
|
|
607
|
+
* Defaults to the `--color-accent` token so it picks up theme overrides.
|
|
596
608
|
*/
|
|
597
609
|
spinnerColor?: string;
|
|
598
610
|
/**
|
|
599
611
|
* Optional override for the prompt text colour.
|
|
600
|
-
* Defaults to the foreground token (light/dark aware).
|
|
612
|
+
* Defaults to the `--color-foreground` token (light/dark aware).
|
|
601
613
|
*/
|
|
602
614
|
textColor?: string;
|
|
603
615
|
/**
|
|
604
|
-
* Backdrop opacity (0 – 1). Defaults to 0.
|
|
605
|
-
* block UI underneath while still hinting at the
|
|
616
|
+
* Backdrop opacity (0 – 1) for the fullscreen overlay. Defaults to 0.8 —
|
|
617
|
+
* close enough to opaque to block UI underneath while still hinting at the
|
|
618
|
+
* previous state. Ignored when `inline` is true.
|
|
606
619
|
*/
|
|
607
620
|
backdropOpacity?: number;
|
|
608
621
|
}
|
|
609
622
|
/**
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
*
|
|
618
|
-
*
|
|
623
|
+
* Enterprise-grade loading indicator.
|
|
624
|
+
*
|
|
625
|
+
* Two concentric arcs counter-rotating around a breathing centre dot, with
|
|
626
|
+
* an optional staggered letter reveal beneath. Portaled to `document.body`
|
|
627
|
+
* for the fullscreen overlay so it always covers the actual viewport
|
|
628
|
+
* regardless of where it sits in the React tree.
|
|
629
|
+
*
|
|
630
|
+
* **Two modes:**
|
|
631
|
+
* - **Fullscreen overlay** (default): semi-opaque backdrop with
|
|
632
|
+
* `backdrop-blur-sm` for a modern depth effect. Use during page-level
|
|
633
|
+
* loading, route transitions, or critical mutations.
|
|
634
|
+
* - **Inline** (`inline`): just the spinner + optional caption rendered at
|
|
635
|
+
* the call site. Use inside cards, table rows, drawers, empty states,
|
|
636
|
+
* or anywhere a smaller loading affordance is appropriate.
|
|
637
|
+
*
|
|
638
|
+
* **Accessibility**: `role="status"` + `aria-label`/`aria-live` make the
|
|
639
|
+
* indicator announce-able to screen readers. `prefers-reduced-motion`
|
|
640
|
+
* collapses the letter stagger to instant reveal — the spinner rings keep
|
|
641
|
+
* rotating since a continuous spinner is informative, not decorative.
|
|
642
|
+
*
|
|
643
|
+
* @example Fullscreen overlay (page load)
|
|
644
|
+
* ```tsx
|
|
619
645
|
* {isLoading && <LoadingSpinner prompt="Loading vessels…" />}
|
|
646
|
+
* ```
|
|
620
647
|
*
|
|
621
|
-
* @example
|
|
648
|
+
* @example Inline (inside a card)
|
|
649
|
+
* ```tsx
|
|
650
|
+
* <Card>
|
|
651
|
+
* {data ? <Chart data={data} /> : <LoadingSpinner inline size="sm" />}
|
|
652
|
+
* </Card>
|
|
653
|
+
* ```
|
|
654
|
+
*
|
|
655
|
+
* @example Themed overlay
|
|
656
|
+
* ```tsx
|
|
622
657
|
* <LoadingSpinner
|
|
623
658
|
* prompt="Saving"
|
|
659
|
+
* size="lg"
|
|
624
660
|
* spinnerColor="#10b981"
|
|
625
661
|
* backdropOpacity={0.7}
|
|
626
662
|
* />
|
|
663
|
+
* ```
|
|
627
664
|
*/
|
|
628
|
-
declare function LoadingSpinner({ prompt, spinnerColor, textColor, backdropOpacity, }: LoadingSpinnerProps): react_jsx_runtime.JSX.Element;
|
|
665
|
+
declare function LoadingSpinner({ prompt, size, inline, spinnerColor, textColor, backdropOpacity, }: LoadingSpinnerProps): react_jsx_runtime.JSX.Element;
|
|
629
666
|
|
|
630
667
|
interface FadingBaseProps {
|
|
631
668
|
className?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -587,45 +587,82 @@ declare function useNotification(): {
|
|
|
587
587
|
danger: (props: Omit<NotificationPayload, "type">) => void;
|
|
588
588
|
};
|
|
589
589
|
|
|
590
|
+
type LoadingSpinnerSize = 'sm' | 'md' | 'lg';
|
|
590
591
|
interface LoadingSpinnerProps {
|
|
591
|
-
/**
|
|
592
|
-
|
|
592
|
+
/**
|
|
593
|
+
* Text revealed letter-by-letter beneath the spinner. Optional — pass
|
|
594
|
+
* `undefined` for a pure spinner with no caption (e.g. inline mode).
|
|
595
|
+
*/
|
|
596
|
+
prompt?: string;
|
|
597
|
+
/** Spinner size variant. Defaults to `'md'`. */
|
|
598
|
+
size?: LoadingSpinnerSize;
|
|
599
|
+
/**
|
|
600
|
+
* When `true`, renders inline at the call site (no portal, no fullscreen
|
|
601
|
+
* overlay, no backdrop). Useful inside cards, table rows, drawers, or
|
|
602
|
+
* empty-state slots. Defaults to `false` (fullscreen overlay).
|
|
603
|
+
*/
|
|
604
|
+
inline?: boolean;
|
|
593
605
|
/**
|
|
594
606
|
* Optional override for the spinner ring colour. Accepts any CSS colour.
|
|
595
|
-
* Defaults to the accent token so it picks up theme overrides.
|
|
607
|
+
* Defaults to the `--color-accent` token so it picks up theme overrides.
|
|
596
608
|
*/
|
|
597
609
|
spinnerColor?: string;
|
|
598
610
|
/**
|
|
599
611
|
* Optional override for the prompt text colour.
|
|
600
|
-
* Defaults to the foreground token (light/dark aware).
|
|
612
|
+
* Defaults to the `--color-foreground` token (light/dark aware).
|
|
601
613
|
*/
|
|
602
614
|
textColor?: string;
|
|
603
615
|
/**
|
|
604
|
-
* Backdrop opacity (0 – 1). Defaults to 0.
|
|
605
|
-
* block UI underneath while still hinting at the
|
|
616
|
+
* Backdrop opacity (0 – 1) for the fullscreen overlay. Defaults to 0.8 —
|
|
617
|
+
* close enough to opaque to block UI underneath while still hinting at the
|
|
618
|
+
* previous state. Ignored when `inline` is true.
|
|
606
619
|
*/
|
|
607
620
|
backdropOpacity?: number;
|
|
608
621
|
}
|
|
609
622
|
/**
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
*
|
|
618
|
-
*
|
|
623
|
+
* Enterprise-grade loading indicator.
|
|
624
|
+
*
|
|
625
|
+
* Two concentric arcs counter-rotating around a breathing centre dot, with
|
|
626
|
+
* an optional staggered letter reveal beneath. Portaled to `document.body`
|
|
627
|
+
* for the fullscreen overlay so it always covers the actual viewport
|
|
628
|
+
* regardless of where it sits in the React tree.
|
|
629
|
+
*
|
|
630
|
+
* **Two modes:**
|
|
631
|
+
* - **Fullscreen overlay** (default): semi-opaque backdrop with
|
|
632
|
+
* `backdrop-blur-sm` for a modern depth effect. Use during page-level
|
|
633
|
+
* loading, route transitions, or critical mutations.
|
|
634
|
+
* - **Inline** (`inline`): just the spinner + optional caption rendered at
|
|
635
|
+
* the call site. Use inside cards, table rows, drawers, empty states,
|
|
636
|
+
* or anywhere a smaller loading affordance is appropriate.
|
|
637
|
+
*
|
|
638
|
+
* **Accessibility**: `role="status"` + `aria-label`/`aria-live` make the
|
|
639
|
+
* indicator announce-able to screen readers. `prefers-reduced-motion`
|
|
640
|
+
* collapses the letter stagger to instant reveal — the spinner rings keep
|
|
641
|
+
* rotating since a continuous spinner is informative, not decorative.
|
|
642
|
+
*
|
|
643
|
+
* @example Fullscreen overlay (page load)
|
|
644
|
+
* ```tsx
|
|
619
645
|
* {isLoading && <LoadingSpinner prompt="Loading vessels…" />}
|
|
646
|
+
* ```
|
|
620
647
|
*
|
|
621
|
-
* @example
|
|
648
|
+
* @example Inline (inside a card)
|
|
649
|
+
* ```tsx
|
|
650
|
+
* <Card>
|
|
651
|
+
* {data ? <Chart data={data} /> : <LoadingSpinner inline size="sm" />}
|
|
652
|
+
* </Card>
|
|
653
|
+
* ```
|
|
654
|
+
*
|
|
655
|
+
* @example Themed overlay
|
|
656
|
+
* ```tsx
|
|
622
657
|
* <LoadingSpinner
|
|
623
658
|
* prompt="Saving"
|
|
659
|
+
* size="lg"
|
|
624
660
|
* spinnerColor="#10b981"
|
|
625
661
|
* backdropOpacity={0.7}
|
|
626
662
|
* />
|
|
663
|
+
* ```
|
|
627
664
|
*/
|
|
628
|
-
declare function LoadingSpinner({ prompt, spinnerColor, textColor, backdropOpacity, }: LoadingSpinnerProps): react_jsx_runtime.JSX.Element;
|
|
665
|
+
declare function LoadingSpinner({ prompt, size, inline, spinnerColor, textColor, backdropOpacity, }: LoadingSpinnerProps): react_jsx_runtime.JSX.Element;
|
|
629
666
|
|
|
630
667
|
interface FadingBaseProps {
|
|
631
668
|
className?: string;
|