@dimasbaguspm/versaur 0.0.40 → 0.0.42
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/js/{bottom-sheet-BjNMFNXp.js → bottom-sheet-DHMq1-Di.js} +1 -1
- package/dist/js/{bottom-sheet-input-BnuL4Cci.js → bottom-sheet-input-IzuwB7Zy.js} +10 -10
- package/dist/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle-DGO9R_ox.js → image-rectangle-DPZAgdEa.js} +163 -148
- package/dist/js/index.js +64 -63
- package/dist/js/layouts/index.js +6 -5
- package/dist/js/navigation/index.js +1 -1
- package/dist/js/overlays/index.js +3 -3
- package/dist/js/primitive/index.js +1 -1
- package/dist/js/providers/index.js +1 -1
- package/dist/js/{tabs-lPDgArjA.js → tabs-BRMO0ktc.js} +1 -1
- package/dist/js/{tooltip-uCpYAX_O.js → tooltip-D_laXWIT.js} +1 -1
- package/dist/js/{top-bar-D8P4uwtN.js → top-bar-BKeQ6yXv.js} +256 -178
- package/dist/js/{use-snackbars-CKi6BQDT.js → use-snackbars-Cou8L41F.js} +9 -12
- package/dist/types/layouts/index.d.ts +1 -0
- package/dist/types/layouts/page-loader/index.d.ts +2 -0
- package/dist/types/layouts/page-loader/page-loader.d.ts +11 -0
- package/dist/types/layouts/page-loader/types.d.ts +40 -0
- package/dist/types/primitive/card/types.d.ts +1 -5
- package/dist/utils/enforce-subpath-import.js +1 -0
- package/package.json +1 -1
|
@@ -6,10 +6,7 @@ const f = x(
|
|
|
6
6
|
), j = d(
|
|
7
7
|
[
|
|
8
8
|
"fixed z-100 flex flex-col gap-2 px-0 pb-2",
|
|
9
|
-
"w-[80vw] left-0 top-4"
|
|
10
|
-
// mobile: full width
|
|
11
|
-
"sm:w-auto sm:left-4 sm:bottom-4 sm:max-w-sm"
|
|
12
|
-
// desktop/tablet
|
|
9
|
+
"w-[80vw] left-0 top-4 md:w-auto md:left-4 md:top-auto md:bottom-4 md:max-w-sm"
|
|
13
10
|
].join(" ")
|
|
14
11
|
), T = d("", {
|
|
15
12
|
variants: {
|
|
@@ -23,18 +20,18 @@ const f = x(
|
|
|
23
20
|
}
|
|
24
21
|
}), C = 4e3;
|
|
25
22
|
function E() {
|
|
26
|
-
const [a,
|
|
27
|
-
|
|
23
|
+
const [a, o] = p([]), t = k({}), n = m((e) => {
|
|
24
|
+
o((r) => r.filter((s) => s.id !== e)), t.current[e] && (clearTimeout(t.current[e]), delete t.current[e]);
|
|
28
25
|
}, []), i = m(
|
|
29
|
-
(e, r,
|
|
30
|
-
const u = `${Date.now()}-${Math.random()}`, l =
|
|
31
|
-
|
|
26
|
+
(e, r, s) => {
|
|
27
|
+
const u = `${Date.now()}-${Math.random()}`, l = s?.duration ?? C;
|
|
28
|
+
o((b) => [
|
|
32
29
|
...b,
|
|
33
30
|
{
|
|
34
31
|
id: u,
|
|
35
32
|
color: e,
|
|
36
33
|
message: r,
|
|
37
|
-
...
|
|
34
|
+
...s,
|
|
38
35
|
duration: l
|
|
39
36
|
}
|
|
40
37
|
]), t.current[u] = setTimeout(() => {
|
|
@@ -48,7 +45,7 @@ function E() {
|
|
|
48
45
|
}, []), { queue: a, showSnack: i, removeSnack: n };
|
|
49
46
|
}
|
|
50
47
|
const V = ({ children: a }) => {
|
|
51
|
-
const { queue:
|
|
48
|
+
const { queue: o, showSnack: t, removeSnack: n } = E(), i = v(() => ({ showSnack: t }), [t]);
|
|
52
49
|
return /* @__PURE__ */ c.jsxs(f.Provider, { value: i, children: [
|
|
53
50
|
a,
|
|
54
51
|
/* @__PURE__ */ c.jsx(
|
|
@@ -57,7 +54,7 @@ const V = ({ children: a }) => {
|
|
|
57
54
|
className: j(),
|
|
58
55
|
"aria-live": "polite",
|
|
59
56
|
"aria-atomic": "true",
|
|
60
|
-
children:
|
|
57
|
+
children: o.map((e, r) => /* @__PURE__ */ c.jsx(
|
|
61
58
|
"div",
|
|
62
59
|
{
|
|
63
60
|
className: T({
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PageLoaderProps } from './types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* PageLoader component that centers a loading indicator within a flex container
|
|
5
|
+
*
|
|
6
|
+
* This component wraps the LoadingIndicator with layout styling to center it
|
|
7
|
+
* within the available container space, making it ideal for full-page loading states.
|
|
8
|
+
*
|
|
9
|
+
* @group Layout
|
|
10
|
+
*/
|
|
11
|
+
export declare const PageLoader: React.ForwardRefExoticComponent<PageLoaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { LoadingIndicatorProps } from '../../feedbacks/loading-indicator';
|
|
3
|
+
/**
|
|
4
|
+
* PageLoaderProps defines the props for the PageLoader component
|
|
5
|
+
* Extends LoadingIndicatorProps to support all loading indicator configurations
|
|
6
|
+
* while adding layout-specific functionality
|
|
7
|
+
*/
|
|
8
|
+
export interface PageLoaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
/**
|
|
10
|
+
* Type of loading indicator: spinner (default), bar
|
|
11
|
+
* Spinner is recommended for page loading states
|
|
12
|
+
*/
|
|
13
|
+
type?: LoadingIndicatorProps['type'];
|
|
14
|
+
/**
|
|
15
|
+
* Size of the indicator: sm, md, lg
|
|
16
|
+
*/
|
|
17
|
+
size?: LoadingIndicatorProps['size'];
|
|
18
|
+
/**
|
|
19
|
+
* Color variant based on Versaur color system
|
|
20
|
+
* Core: primary, secondary, tertiary, ghost, neutral
|
|
21
|
+
* Semantic: success, info, warning, danger
|
|
22
|
+
*/
|
|
23
|
+
color?: LoadingIndicatorProps['color'];
|
|
24
|
+
/**
|
|
25
|
+
* Accessible label for screen readers
|
|
26
|
+
*/
|
|
27
|
+
ariaLabel?: LoadingIndicatorProps['ariaLabel'];
|
|
28
|
+
/**
|
|
29
|
+
* Optional loading message to display below the indicator
|
|
30
|
+
*/
|
|
31
|
+
message?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to use a minimal height (useful for inline loading states)
|
|
34
|
+
*/
|
|
35
|
+
minimal?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether to cover the entire viewport
|
|
38
|
+
*/
|
|
39
|
+
fullscreen?: boolean;
|
|
40
|
+
}
|
|
@@ -9,7 +9,7 @@ export interface CardProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>,
|
|
|
9
9
|
* Size variant affecting padding
|
|
10
10
|
* @default 'md'
|
|
11
11
|
*/
|
|
12
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
12
|
+
size?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
13
13
|
/**
|
|
14
14
|
* Shape variant affecting border radius
|
|
15
15
|
* @default 'rounded'
|
|
@@ -31,10 +31,6 @@ export interface CardProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>,
|
|
|
31
31
|
* Badge element to display in the header area
|
|
32
32
|
*/
|
|
33
33
|
badge?: ReactNode;
|
|
34
|
-
/**
|
|
35
|
-
* Action elements to display in the right top area
|
|
36
|
-
*/
|
|
37
|
-
actions?: ReactNode;
|
|
38
34
|
/**
|
|
39
35
|
* Supplementary information to display on the bottom-right side
|
|
40
36
|
* Usually used for amounts, status, or additional info
|