@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.
@@ -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,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
@@ -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.40",
3
+ "version": "0.0.42",
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",