@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.
@@ -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, s] = p([]), t = k({}), n = m((e) => {
27
- s((r) => r.filter((o) => o.id !== e)), t.current[e] && (clearTimeout(t.current[e]), delete t.current[e]);
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, o) => {
30
- const u = `${Date.now()}-${Math.random()}`, l = o?.duration ?? C;
31
- s((b) => [
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
- ...o,
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: s, showSnack: t, removeSnack: n } = E(), i = v(() => ({ showSnack: t }), [t]);
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: s.map((e, r) => /* @__PURE__ */ c.jsx(
57
+ children: o.map((e, r) => /* @__PURE__ */ c.jsx(
61
58
  "div",
62
59
  {
63
60
  className: T({
@@ -6,6 +6,7 @@ export * from './filter-chip-group';
6
6
  export * from './page-content';
7
7
  export * from './page-header';
8
8
  export * from './page-layout';
9
+ export * from './page-loader';
9
10
  export * from './form-layout';
10
11
  export * from './side-bar';
11
12
  export * from './top-bar';
@@ -0,0 +1,2 @@
1
+ export { PageLoader } from './page-loader';
2
+ export type { PageLoaderProps } from './types';
@@ -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;
@@ -36,6 +36,7 @@ const symbolToSubpath = {
36
36
  "PageContent": "layouts",
37
37
  "PageHeader": "layouts",
38
38
  "PageLayout": "layouts",
39
+ "PageLoader": "layouts",
39
40
  "SideBar": "layouts",
40
41
  "TopBar": "layouts",
41
42
  "Breadcrumbs": "navigation",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimasbaguspm/versaur",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "description": "React UI library with Tailwind CSS",
5
5
  "author": "Dimas Bagus Prayogo Mukti<dimas.bagus.pm@gmail.com>",
6
6
  "license": "MIT",