@dimasbaguspm/versaur 0.0.39 → 0.0.41
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/assets/styles.css +18 -0
- package/dist/js/{bottom-sheet-B9Knzg2N.js → bottom-sheet-Da41OlDM.js} +1 -1
- package/dist/js/{bottom-sheet-input-Ch9h_vZC.js → bottom-sheet-input-BB3FZtpr.js} +2 -2
- package/dist/js/forms/index.js +1 -1
- package/dist/js/{image-rectangle-C1ydvFGL.js → image-rectangle-S0pOfTm5.js} +89 -40
- 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-38zAflsT.js → tabs-C8iGcy7x.js} +1 -1
- package/dist/js/{tooltip-CvOzRRkS.js → tooltip-VV9T0wn6.js} +1 -1
- package/dist/js/{top-bar-CKFu3xrL.js → top-bar-DYbS1NgD.js} +247 -175
- 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 +36 -0
- package/dist/types/primitive/avatar/types.d.ts +1 -1
- package/dist/types/primitive/badge/types.d.ts +1 -1
- package/dist/types/primitive/button/types.d.ts +1 -1
- package/dist/types/primitive/card/card.d.ts +1 -1
- package/dist/types/primitive/card/types.d.ts +6 -1
- 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,36 @@
|
|
|
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
|
+
}
|
|
@@ -11,7 +11,7 @@ export interface AvatarProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
11
11
|
* Core variants: primary (coral), secondary (sage), tertiary (mist), ghost (slate), neutral (light gray)
|
|
12
12
|
* Semantic variants: success, info, warning, danger
|
|
13
13
|
*/
|
|
14
|
-
variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'neutral' | 'success' | 'info' | 'warning' | 'danger';
|
|
14
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'neutral' | 'success' | 'info' | 'warning' | 'danger' | 'accent_1' | 'accent_2' | 'accent_3';
|
|
15
15
|
/**
|
|
16
16
|
* Size of the avatar
|
|
17
17
|
* xs: 24px, sm: 32px, md: 40px, lg: 48px, xl: 64px
|
|
@@ -32,7 +32,7 @@ export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
32
32
|
* Core colors: primary (coral), secondary (sage), tertiary (mist), ghost (slate), neutral (light gray)
|
|
33
33
|
* Semantic colors: success, info, warning, danger
|
|
34
34
|
*/
|
|
35
|
-
color?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'neutral' | 'success' | 'info' | 'warning' | 'danger';
|
|
35
|
+
color?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'neutral' | 'success' | 'info' | 'warning' | 'danger' | 'accent_1' | 'accent_2' | 'accent_3';
|
|
36
36
|
/**
|
|
37
37
|
* Icon element to display on the left side of the badge
|
|
38
38
|
* When no children are provided and an icon is present, badge automatically becomes icon-only
|
|
@@ -14,7 +14,7 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
14
14
|
* Semantic variants: success, info, warning, danger
|
|
15
15
|
* Each variant supports outline and ghost forms for flexible design expression
|
|
16
16
|
*/
|
|
17
|
-
variant?: 'primary' | 'primary-outline' | 'primary-ghost' | 'secondary' | 'secondary-outline' | 'secondary-ghost' | 'tertiary' | 'tertiary-outline' | 'tertiary-ghost' | 'ghost' | 'ghost-outline' | 'neutral' | 'neutral-outline' | 'neutral-ghost' | 'success' | 'success-outline' | 'success-ghost' | 'info' | 'info-outline' | 'info-ghost' | 'warning' | 'warning-outline' | 'warning-ghost' | 'danger' | 'danger-outline' | 'danger-ghost' | 'outline' | 'destructive';
|
|
17
|
+
variant?: 'primary' | 'primary-outline' | 'primary-ghost' | 'secondary' | 'secondary-outline' | 'secondary-ghost' | 'tertiary' | 'tertiary-outline' | 'tertiary-ghost' | 'accent_1' | 'accent_1-outline' | 'accent_1-ghost' | 'accent_2' | 'accent_2-outline' | 'accent_2-ghost' | 'accent_3' | 'accent_3-outline' | 'accent_3-ghost' | 'ghost' | 'ghost-outline' | 'neutral' | 'neutral-outline' | 'neutral-ghost' | 'success' | 'success-outline' | 'success-ghost' | 'info' | 'info-outline' | 'info-ghost' | 'warning' | 'warning-outline' | 'warning-ghost' | 'danger' | 'danger-outline' | 'danger-ghost' | 'outline' | 'destructive';
|
|
18
18
|
/**
|
|
19
19
|
* Size of the button
|
|
20
20
|
* sm: 36px height, compact for space-constrained interfaces
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CardProps } from './types';
|
|
2
|
-
export declare const Card: import('react').ForwardRefExoticComponent<CardProps & import('react').RefAttributes<HTMLButtonElement>> & {
|
|
2
|
+
export declare const Card: import('react').ForwardRefExoticComponent<CardProps & import('react').RefAttributes<HTMLDivElement | HTMLButtonElement>> & {
|
|
3
3
|
List: import('react').ForwardRefExoticComponent<import('./types').CardListProps & import('react').RefAttributes<HTMLUListElement>>;
|
|
4
4
|
ListItem: import('react').ForwardRefExoticComponent<import('./types').CardListItemProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
5
5
|
};
|
|
@@ -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'
|
|
@@ -45,6 +45,11 @@ export interface CardProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>,
|
|
|
45
45
|
* @default false
|
|
46
46
|
*/
|
|
47
47
|
bordered?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Is the card a button or a div?
|
|
50
|
+
* @default 'button'
|
|
51
|
+
*/
|
|
52
|
+
as?: 'button' | 'div';
|
|
48
53
|
}
|
|
49
54
|
export type CardListProps = {
|
|
50
55
|
children: ReactNode;
|