@dimasbaguspm/versaur 0.0.30 → 0.0.32

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.
Files changed (35) hide show
  1. package/dist/js/{bottom-sheet-DUcwK0Yd.js → bottom-sheet-DJgcgmgw.js} +146 -160
  2. package/dist/js/{bottom-sheet-input-Bzx0ecmU.js → bottom-sheet-input-lRqhqp7I.js} +7 -7
  3. package/dist/js/forms/index.js +1 -1
  4. package/dist/js/{image-rectangle-BMEGIW-6.js → image-rectangle-BS6j3xEC.js} +429 -618
  5. package/dist/js/index.js +46 -47
  6. package/dist/js/layouts/index.js +1 -1
  7. package/dist/js/navigation/index.js +1 -1
  8. package/dist/js/overlays/index.js +7 -6
  9. package/dist/js/primitive/index.js +21 -22
  10. package/dist/js/{tabs-CIWr5hdb.js → tabs-80jJFJ7W.js} +1 -1
  11. package/dist/js/tooltip-J7r2xoUk.js +81 -0
  12. package/dist/js/{top-bar-BdmaTpTp.js → top-bar-DJNgsR7X.js} +1 -1
  13. package/dist/types/overlays/menu/index.d.ts +1 -1
  14. package/dist/types/overlays/menu/menu.d.ts +4 -1
  15. package/dist/types/overlays/menu/types.d.ts +4 -2
  16. package/dist/types/overlays/menu/use-menu.d.ts +0 -1
  17. package/dist/types/primitive/button-menu-icon/button-menu-icon.d.ts +4 -0
  18. package/dist/types/primitive/button-menu-icon/index.d.ts +2 -0
  19. package/dist/types/primitive/button-menu-icon/types.d.ts +13 -0
  20. package/dist/types/primitive/card/card.atoms.d.ts +3 -0
  21. package/dist/types/primitive/card/card.d.ts +4 -23
  22. package/dist/types/primitive/card/types.d.ts +6 -0
  23. package/dist/types/primitive/index.d.ts +1 -2
  24. package/dist/utils/enforce-subpath-import.js +1 -2
  25. package/package.json +1 -1
  26. package/dist/js/tooltip-IazSAgsg.js +0 -148
  27. package/dist/types/primitive/calendar/calendar.atoms.d.ts +0 -13
  28. package/dist/types/primitive/calendar/calendar.d.ts +0 -8
  29. package/dist/types/primitive/calendar/index.d.ts +0 -2
  30. package/dist/types/primitive/calendar/types.d.ts +0 -54
  31. package/dist/types/primitive/calendar/use-calendar.d.ts +0 -18
  32. package/dist/types/primitive/description-list/description-list.atoms.d.ts +0 -13
  33. package/dist/types/primitive/description-list/description-list.d.ts +0 -6
  34. package/dist/types/primitive/description-list/index.d.ts +0 -2
  35. package/dist/types/primitive/description-list/types.d.ts +0 -46
package/dist/js/index.js CHANGED
@@ -1,79 +1,78 @@
1
- import { L as t, P as s, S as r } from "./skeleton-BNZyaRjo.js";
2
- import { A as n, a as p, B as u, b as i, F as l, e as I, P as c, c as S, d as m, S as B, T as g } from "./top-bar-BdmaTpTp.js";
3
- import { B as b, C as T, b as x, a as h, D as C, k as f, E as P, M as k, P as A, R as M, d as D, c as F, S as L, e as R, j as w, i as G, h as j, f as v, T as y, g as E } from "./bottom-sheet-input-Bzx0ecmU.js";
4
- import { B as q, D as H, M as z } from "./bottom-sheet-DUcwK0Yd.js";
5
- import { M as K, T as O } from "./tooltip-IazSAgsg.js";
6
- import { A as U, a as V, b as W, c as X, d as Y, B as Z, p as _, e as $, f as aa, g as ea, h as ta, C as sa, i as ra, j as oa, D as na, F as pa, I as ua, m as ia, o as la, n as Ia, N as ca, T as Sa, k as ma, l as Ba } from "./image-rectangle-BMEGIW-6.js";
7
- import { S as da } from "./snackbar-DH8jCh2V.js";
8
- import { B as Ta, T as xa } from "./tabs-CIWr5hdb.js";
9
- import { S as Ca, u as fa } from "./use-snackbars-B0MaRlg1.js";
1
+ import { L as e, P as s, S as r } from "./skeleton-BNZyaRjo.js";
2
+ import { A as n, a as p, B as u, b as i, F as l, e as I, P as c, c as S, d as m, S as B, T as g } from "./top-bar-DJNgsR7X.js";
3
+ import { B as b, C as T, b as x, a as h, D as f, k as C, E as P, M, P as k, R as A, d as F, c as D, S as L, e as R, j as w, i as G, h as j, f as v, T as y, g as E } from "./bottom-sheet-input-lRqhqp7I.js";
4
+ import { B as q, D as H, M as z } from "./bottom-sheet-DJgcgmgw.js";
5
+ import { A as K, a as O, b as Q, c as U, d as V, B as W, p as X, e as Y, f as Z, h as _, i as $, g as aa, C as ta, j as ea, F as sa, I as ra, m as oa, o as na, n as pa, M as ua, N as ia, T as la, k as Ia, l as ca } from "./image-rectangle-BS6j3xEC.js";
6
+ import { T as ma } from "./tooltip-J7r2xoUk.js";
7
+ import { S as ga } from "./snackbar-DH8jCh2V.js";
8
+ import { B as ba, T as Ta } from "./tabs-80jJFJ7W.js";
9
+ import { S as ha, u as fa } from "./use-snackbars-B0MaRlg1.js";
10
10
  export {
11
- U as Alert,
12
- V as Anchor,
11
+ K as Alert,
12
+ O as Anchor,
13
13
  n as AppBar,
14
- W as Attribute,
15
- X as AttributeList,
16
- Y as Avatar,
17
- Z as Badge,
14
+ Q as Attribute,
15
+ U as AttributeList,
16
+ V as Avatar,
17
+ W as Badge,
18
18
  p as BadgeGroup,
19
- _ as BaseImage,
19
+ X as BaseImage,
20
20
  u as BottomBar,
21
21
  q as BottomSheet,
22
22
  b as BottomSheetInput,
23
- $ as Brand,
24
- Ta as Breadcrumbs,
25
- aa as Button,
26
- ea as ButtonFloat,
23
+ Y as Brand,
24
+ ba as Breadcrumbs,
25
+ Z as Button,
26
+ _ as ButtonFloat,
27
27
  i as ButtonGroup,
28
- ta as ButtonIcon,
29
- sa as Calculator,
30
- ra as Calendar,
31
- oa as Card,
28
+ $ as ButtonIcon,
29
+ aa as ButtonMenuIcon,
30
+ ta as Calculator,
31
+ ea as Card,
32
32
  T as CheckboxInput,
33
33
  x as ChipMultipleInput,
34
34
  h as ChipSingleInput,
35
- C as DateSinglePickerInput,
36
- na as DescriptionList,
35
+ f as DateSinglePickerInput,
37
36
  H as Drawer,
38
- f as DrawerInput,
37
+ C as DrawerInput,
39
38
  P as EmailInput,
40
- pa as FilterChip,
39
+ sa as FilterChip,
41
40
  l as FilterChipGroup,
42
41
  I as FormLayout,
43
- ua as Icon,
44
- ia as ImageCircle,
45
- la as ImageRectangle,
46
- Ia as ImageSquare,
47
- t as LoadingIndicator,
48
- K as Menu,
42
+ ra as Icon,
43
+ oa as ImageCircle,
44
+ na as ImageRectangle,
45
+ pa as ImageSquare,
46
+ e as LoadingIndicator,
47
+ ua as Menu,
49
48
  z as Modal,
50
- k as ModalInput,
51
- ca as NoResults,
49
+ M as ModalInput,
50
+ ia as NoResults,
52
51
  c as PageContent,
53
52
  S as PageHeader,
54
53
  m as PageLayout,
55
- A as PriceInput,
54
+ k as PriceInput,
56
55
  s as ProgressIndicator,
57
- M as RadioInput,
58
- D as SearchInput,
59
- F as SegmentMultipleInput,
56
+ A as RadioInput,
57
+ F as SearchInput,
58
+ D as SegmentMultipleInput,
60
59
  L as SegmentSingleInput,
61
60
  R as SelectInput,
62
61
  w as SelectableMultipleInput,
63
62
  G as SelectableSingleInput,
64
63
  B as SideBar,
65
64
  r as Skeleton,
66
- da as Snackbar,
67
- Ca as SnackbarsProvider,
65
+ ga as Snackbar,
66
+ ha as SnackbarsProvider,
68
67
  j as SwitchInput,
69
- Sa as Table,
70
- xa as Tabs,
71
- ma as Text,
68
+ la as Table,
69
+ Ta as Tabs,
70
+ Ia as Text,
72
71
  v as TextAreaInput,
73
72
  y as TextInput,
74
- Ba as Tile,
73
+ ca as Tile,
75
74
  E as TimePickerInput,
76
- O as Tooltip,
75
+ ma as Tooltip,
77
76
  g as TopBar,
78
77
  fa as useSnackbars
79
78
  };
@@ -1,4 +1,4 @@
1
- import { A as r, a as e, B as s, b as t, F as p, e as B, P as u, c as d, d as g, S as P, T as i } from "../top-bar-BdmaTpTp.js";
1
+ import { A as r, a as e, B as s, b as t, F as p, e as B, P as u, c as d, d as g, S as P, T as i } from "../top-bar-DJNgsR7X.js";
2
2
  export {
3
3
  r as AppBar,
4
4
  e as BadgeGroup,
@@ -1,4 +1,4 @@
1
- import { B as s, T as b } from "../tabs-CIWr5hdb.js";
1
+ import { B as s, T as b } from "../tabs-80jJFJ7W.js";
2
2
  export {
3
3
  s as Breadcrumbs,
4
4
  b as Tabs
@@ -1,9 +1,10 @@
1
- import { B as e, D as r, M as t } from "../bottom-sheet-DUcwK0Yd.js";
2
- import { M, T as m } from "../tooltip-IazSAgsg.js";
1
+ import { B as a, D as e, M as t } from "../bottom-sheet-DJgcgmgw.js";
2
+ import { M as m } from "../image-rectangle-BS6j3xEC.js";
3
+ import { T as M } from "../tooltip-J7r2xoUk.js";
3
4
  export {
4
- e as BottomSheet,
5
- r as Drawer,
6
- M as Menu,
5
+ a as BottomSheet,
6
+ e as Drawer,
7
+ m as Menu,
7
8
  t as Modal,
8
- m as Tooltip
9
+ M as Tooltip
9
10
  };
@@ -1,29 +1,28 @@
1
- import { A as t, a as e, b as r, c as o, d as l, B as n, p as i, e as c, f as u, g, h as m, C as B, i as I, j as A, D as C, F as b, I as d, m as p, o as T, n as f, N as h, T as x, k as F, l as S } from "../image-rectangle-BMEGIW-6.js";
2
- import { S as D } from "../snackbar-DH8jCh2V.js";
1
+ import { A as t, a as e, b as o, c as r, d as n, B as l, p as u, e as c, f as i, h as B, i as I, g, C as m, j as A, F as b, I as C, m as d, o as p, n as T, N as f, T as h, k as x, l as F } from "../image-rectangle-BS6j3xEC.js";
2
+ import { S as k } from "../snackbar-DH8jCh2V.js";
3
3
  export {
4
4
  t as Alert,
5
5
  e as Anchor,
6
- r as Attribute,
7
- o as AttributeList,
8
- l as Avatar,
9
- n as Badge,
10
- i as BaseImage,
6
+ o as Attribute,
7
+ r as AttributeList,
8
+ n as Avatar,
9
+ l as Badge,
10
+ u as BaseImage,
11
11
  c as Brand,
12
- u as Button,
13
- g as ButtonFloat,
14
- m as ButtonIcon,
15
- B as Calculator,
16
- I as Calendar,
12
+ i as Button,
13
+ B as ButtonFloat,
14
+ I as ButtonIcon,
15
+ g as ButtonMenuIcon,
16
+ m as Calculator,
17
17
  A as Card,
18
- C as DescriptionList,
19
18
  b as FilterChip,
20
- d as Icon,
21
- p as ImageCircle,
22
- T as ImageRectangle,
23
- f as ImageSquare,
24
- h as NoResults,
25
- D as Snackbar,
26
- x as Table,
27
- F as Text,
28
- S as Tile
19
+ C as Icon,
20
+ d as ImageCircle,
21
+ p as ImageRectangle,
22
+ T as ImageSquare,
23
+ f as NoResults,
24
+ k as Snackbar,
25
+ h as Table,
26
+ x as Text,
27
+ F as Tile
29
28
  };
@@ -1,6 +1,6 @@
1
1
  import { c as d, j as s, a as u } from "./index-DOdDlCoL.js";
2
2
  import { forwardRef as f, createContext as x, useContext as g, useState as p, useLayoutEffect as y, useRef as h } from "react";
3
- import { I as w } from "./image-rectangle-BMEGIW-6.js";
3
+ import { I as w } from "./image-rectangle-BS6j3xEC.js";
4
4
  import "./snackbar-DH8jCh2V.js";
5
5
  import { ChevronRight as T } from "lucide-react";
6
6
  const j = d(
@@ -0,0 +1,81 @@
1
+ import { c as v, j as c, a as w } from "./index-DOdDlCoL.js";
2
+ import { useRef as m, useState as d, useEffect as h, useId as T, cloneElement as j } from "react";
3
+ import { k as y } from "./image-rectangle-BS6j3xEC.js";
4
+ function P(e = "auto") {
5
+ const n = m(null), [a, t] = d("bottom");
6
+ return h(() => {
7
+ if (!open || e !== "auto" || !n.current) {
8
+ t(e === "auto" ? "bottom" : e);
9
+ return;
10
+ }
11
+ const o = n.current.getBoundingClientRect(), l = window.innerWidth, r = window.innerHeight, i = {
12
+ top: o.top,
13
+ bottom: r - o.bottom,
14
+ left: o.left,
15
+ right: l - o.right
16
+ };
17
+ i.bottom > 64 ? t("bottom") : i.top > 64 ? t("top") : i.right > 128 ? t("right") : t("left");
18
+ }, [e, n]), { position: a, ref: n };
19
+ }
20
+ const E = v(
21
+ "absolute z-50 px-2 py-1 rounded bg-neutral pointer-events-auto transition-opacity duration-150 min-w-[max-content] max-w-sm whitespace-pre-line",
22
+ {
23
+ variants: {
24
+ position: {
25
+ top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
26
+ bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
27
+ left: "right-full top-1/2 -translate-y-1/2 mr-2",
28
+ right: "left-full top-1/2 -translate-y-1/2 ml-2",
29
+ auto: "top-full left-1/2 -translate-x-1/2 mt-2"
30
+ }
31
+ },
32
+ defaultVariants: {
33
+ position: "auto"
34
+ }
35
+ }
36
+ ), O = ({
37
+ children: e,
38
+ content: n,
39
+ position: a = "auto",
40
+ popoverClassName: t,
41
+ delay: o,
42
+ ...l
43
+ }) => {
44
+ const r = T(), [i, u] = d(!1), s = m(null), p = () => {
45
+ o ? s.current = setTimeout(() => u(!0), o) : u(!0);
46
+ }, f = () => {
47
+ s.current && clearTimeout(s.current), u(!1);
48
+ };
49
+ h(() => () => {
50
+ s.current && clearTimeout(s.current);
51
+ }, []);
52
+ const b = {
53
+ tabIndex: 0,
54
+ "aria-describedby": r,
55
+ onMouseEnter: p,
56
+ onFocus: p,
57
+ onMouseLeave: f,
58
+ onBlur: f,
59
+ ...l
60
+ }, { ref: x, position: g } = P(a);
61
+ return /* @__PURE__ */ c.jsxs("div", { className: "relative w-fit", ref: x, children: [
62
+ j(e, b),
63
+ /* @__PURE__ */ c.jsx(
64
+ "div",
65
+ {
66
+ id: r,
67
+ className: w(
68
+ E({ position: g }),
69
+ t,
70
+ !i && "opacity-0 pointer-events-none"
71
+ ),
72
+ role: "tooltip",
73
+ "aria-hidden": !i,
74
+ children: /* @__PURE__ */ c.jsx(y, { as: "p", fontSize: "xs", fontWeight: "normal", color: "black", children: n })
75
+ }
76
+ )
77
+ ] });
78
+ };
79
+ export {
80
+ O as T
81
+ };
@@ -1,7 +1,7 @@
1
1
  import { c as i, j as s, a as l } from "./index-DOdDlCoL.js";
2
2
  import * as b from "react";
3
3
  import { forwardRef as o } from "react";
4
- import { k as u } from "./image-rectangle-BMEGIW-6.js";
4
+ import { k as u } from "./image-rectangle-BS6j3xEC.js";
5
5
  import "./snackbar-DH8jCh2V.js";
6
6
  const j = i(
7
7
  "w-full flex flex-wrap items-center pt-3 mb-3 gap-2 bg-white [&>[data-versaur-appbar-bottom]]:basis-full [&>[data-versaur-appbar-bottom]]:w-full [&:has([data-versaur-appbar-bottom])>[data-versaur-appbar-leading]]:pl-4 [&:has([data-versaur-appbar-bottom])>[data-versaur-appbar-trailing]]:pr-4 [&:not(:has([data-versaur-appbar-bottom]))]:px-4",
@@ -1,2 +1,2 @@
1
1
  export { Menu } from './menu';
2
- export type * from './types';
2
+ export type { MenuProps, MenuSize } from './types';
@@ -1,3 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { MenuProps } from './types';
3
- export declare const Menu: React.FC<MenuProps>;
3
+ export declare const Menu: React.FC<MenuProps> & {
4
+ Content: React.ForwardRefExoticComponent<import('./types').MenuContentProps & React.RefAttributes<HTMLUListElement>>;
5
+ Item: React.ForwardRefExoticComponent<import('./types').MenuItemProps & React.RefAttributes<HTMLLIElement>>;
6
+ };
@@ -1,4 +1,4 @@
1
- import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
2
  export type MenuSize = 'sm' | 'md';
3
3
  /**
4
4
  * Props for Menu
@@ -25,7 +25,9 @@ export interface MenuContentProps extends HTMLAttributes<HTMLUListElement> {
25
25
  /**
26
26
  * Props for MenuItem
27
27
  */
28
- export interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
28
+ export interface MenuItemProps extends HTMLAttributes<HTMLLIElement> {
29
29
  /** Item content */
30
30
  children: ReactNode;
31
+ /** Whether the item is disabled */
32
+ disabled?: boolean;
31
33
  }
@@ -1,2 +1 @@
1
1
  export declare function useMenuOutsideClick(isOpen: boolean, contentRef: React.RefObject<HTMLDivElement | null>, triggerRef: React.RefObject<HTMLButtonElement | null>, onOutsideClick: () => void): void;
2
- export declare function useMenuFocusFirstItem(isOpen: boolean, contentRef: React.RefObject<HTMLDivElement | null>): void;
@@ -0,0 +1,4 @@
1
+ import { ButtonMenuIconProps } from './types';
2
+ export declare const ButtonMenuIcon: import('react').ForwardRefExoticComponent<ButtonMenuIconProps & import('react').RefAttributes<HTMLButtonElement>> & {
3
+ Item: import('react').ForwardRefExoticComponent<import('../../overlays/menu/types').MenuItemProps & import('react').RefAttributes<HTMLLIElement>>;
4
+ };
@@ -0,0 +1,2 @@
1
+ export { ButtonMenuIcon } from './button-menu-icon';
2
+ export type { ButtonMenuIconProps } from './types';
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { IconProps } from '../icon';
3
+ import { ButtonIconProps } from '../button-icon';
4
+ export interface ButtonMenuIconProps extends Omit<ButtonIconProps, 'content'>, Pick<IconProps, 'as'> {
5
+ /**
6
+ * Callback function triggered when the menu open state changes.
7
+ */
8
+ onOpenChange?: (isOpen: boolean) => void;
9
+ /**
10
+ * The content to be displayed inside the menu.
11
+ */
12
+ content: ReactNode;
13
+ }
@@ -0,0 +1,3 @@
1
+ import { CardListItemProps, CardListProps } from './types';
2
+ export declare const CardList: import('react').ForwardRefExoticComponent<CardListProps & import('react').RefAttributes<HTMLUListElement>>;
3
+ export declare const CardListItem: import('react').ForwardRefExoticComponent<CardListItemProps & import('react').RefAttributes<HTMLLIElement>>;
@@ -1,24 +1,5 @@
1
1
  import { CardProps } from './types';
2
- /**
3
- * Card component - A clickable container component for displaying structured information
4
- *
5
- * Features:
6
- * - All cards are clickable by default with hover effects
7
- * - Structured layout with avatar, title, subtitle, badge, and supplementary info
8
- * - Multiple color variants with soft backgrounds
9
- * - Configurable padding sizes and shapes
10
- * - Built with accessibility in mind
11
- *
12
- * @example
13
- * ```tsx
14
- * <Card
15
- * title="John Doe"
16
- * subtitle="Software Engineer"
17
- * avatar={<Avatar shape="rounded">JD</Avatar>}
18
- * badge={<BadgeGroup><Badge color="secondary">Available</Badge></BadgeGroup>}
19
- * supplementaryInfo="$2,847.32"
20
- * onClick={handleClick}
21
- * />
22
- * ```
23
- */
24
- export declare const Card: import('react').ForwardRefExoticComponent<CardProps & import('react').RefAttributes<HTMLButtonElement>>;
2
+ export declare const Card: import('react').ForwardRefExoticComponent<CardProps & import('react').RefAttributes<HTMLButtonElement>> & {
3
+ List: import('react').ForwardRefExoticComponent<import('./types').CardListProps & import('react').RefAttributes<HTMLUListElement>>;
4
+ ListItem: import('react').ForwardRefExoticComponent<import('./types').CardListItemProps & import('react').RefAttributes<HTMLLIElement>>;
5
+ };
@@ -42,3 +42,9 @@ export interface CardProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>,
42
42
  */
43
43
  bordered?: boolean;
44
44
  }
45
+ export type CardListProps = {
46
+ children: ReactNode;
47
+ };
48
+ export type CardListItemProps = {
49
+ children: ReactNode;
50
+ };
@@ -6,10 +6,10 @@ export * from './avatar';
6
6
  export * from './badge';
7
7
  export * from './brand';
8
8
  export * from './button';
9
+ export * from './button-menu-icon';
9
10
  export * from './button-float';
10
11
  export * from './button-icon';
11
12
  export * from './calculator';
12
- export * from './calendar';
13
13
  export * from './card';
14
14
  export * from './filter-chip';
15
15
  export * from './icon';
@@ -18,5 +18,4 @@ export * from './snackbar';
18
18
  export * from './table';
19
19
  export * from './text';
20
20
  export * from './tile';
21
- export * from './description-list';
22
21
  export * from './image';
@@ -55,10 +55,9 @@ const symbolToSubpath = {
55
55
  "Button": "primitive",
56
56
  "ButtonFloat": "primitive",
57
57
  "ButtonIcon": "primitive",
58
+ "ButtonMenuIcon": "primitive",
58
59
  "Calculator": "primitive",
59
- "Calendar": "primitive",
60
60
  "Card": "primitive",
61
- "DescriptionList": "primitive",
62
61
  "FilterChip": "primitive",
63
62
  "Icon": "primitive",
64
63
  "ImageCircle": "primitive",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimasbaguspm/versaur",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
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",
@@ -1,148 +0,0 @@
1
- import { c as h, j as u, a as b } from "./index-DOdDlCoL.js";
2
- import { useEffect as m, useRef as c, useId as v, cloneElement as x, useState as g } from "react";
3
- import { k as j } from "./image-rectangle-BMEGIW-6.js";
4
- const I = h(
5
- "absolute z-30 min-w-40 bg-background rounded-lg border border-border transition-all duration-200 ease-out will-change-transform",
6
- {
7
- variants: {
8
- size: {
9
- sm: "py-1.5 px-1",
10
- md: "py-2 px-1"
11
- },
12
- open: {
13
- true: "opacity-100 translate-y-1",
14
- false: "opacity-0 pointer-events-none translate-y-3"
15
- }
16
- },
17
- defaultVariants: {
18
- size: "md",
19
- open: !1
20
- }
21
- }
22
- );
23
- function E(t, e, r, o) {
24
- m(() => {
25
- if (!t) return;
26
- function n(s) {
27
- !e.current?.contains(s.target) && !r.current?.contains(s.target) && o();
28
- }
29
- return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
30
- }, [t, o, e, r]);
31
- }
32
- function M(t, e) {
33
- m(() => {
34
- if (t && e.current) {
35
- const r = e.current.querySelectorAll('[role="menuitem"]');
36
- r.length && r[0].focus();
37
- }
38
- }, [t, e]);
39
- }
40
- const F = ({
41
- isOpen: t,
42
- onOutsideClick: e,
43
- size: r = "md",
44
- content: o,
45
- children: n
46
- }) => {
47
- const s = c(null), a = c(null), i = v();
48
- return E(t, a, s, e), M(t, a), /* @__PURE__ */ u.jsxs("div", { className: "relative w-fit", children: [
49
- x(n, {
50
- // @ts-expect-error: ref is valid for button or forwardRef components
51
- ref: s,
52
- "aria-haspopup": "menu",
53
- "aria-expanded": t,
54
- "aria-controls": i,
55
- tabIndex: 0
56
- }),
57
- /* @__PURE__ */ u.jsx(
58
- "div",
59
- {
60
- id: i,
61
- ref: a,
62
- className: b(I({ size: r, open: t })),
63
- role: "menu",
64
- "aria-hidden": !t,
65
- children: o
66
- }
67
- )
68
- ] });
69
- };
70
- function z(t = "auto") {
71
- const e = c(null), [r, o] = g("bottom");
72
- return m(() => {
73
- if (!open || t !== "auto" || !e.current) {
74
- o(t === "auto" ? "bottom" : t);
75
- return;
76
- }
77
- const n = e.current.getBoundingClientRect(), s = window.innerWidth, a = window.innerHeight, i = {
78
- top: n.top,
79
- bottom: a - n.bottom,
80
- left: n.left,
81
- right: s - n.right
82
- };
83
- i.bottom > 64 ? o("bottom") : i.top > 64 ? o("top") : i.right > 128 ? o("right") : o("left");
84
- }, [t, e]), { position: r, ref: e };
85
- }
86
- const P = h(
87
- "absolute z-50 px-2 py-1 rounded bg-neutral pointer-events-auto transition-opacity duration-150 min-w-[max-content] max-w-sm whitespace-pre-line",
88
- {
89
- variants: {
90
- position: {
91
- top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
92
- bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
93
- left: "right-full top-1/2 -translate-y-1/2 mr-2",
94
- right: "left-full top-1/2 -translate-y-1/2 ml-2",
95
- auto: "top-full left-1/2 -translate-x-1/2 mt-2"
96
- }
97
- },
98
- defaultVariants: {
99
- position: "auto"
100
- }
101
- }
102
- ), L = ({
103
- children: t,
104
- content: e,
105
- position: r = "auto",
106
- popoverClassName: o,
107
- delay: n,
108
- ...s
109
- }) => {
110
- const a = v(), [i, d] = g(!1), l = c(null), p = () => {
111
- n ? l.current = setTimeout(() => d(!0), n) : d(!0);
112
- }, f = () => {
113
- l.current && clearTimeout(l.current), d(!1);
114
- };
115
- m(() => () => {
116
- l.current && clearTimeout(l.current);
117
- }, []);
118
- const w = {
119
- tabIndex: 0,
120
- "aria-describedby": a,
121
- onMouseEnter: p,
122
- onFocus: p,
123
- onMouseLeave: f,
124
- onBlur: f,
125
- ...s
126
- }, { ref: y, position: T } = z(r);
127
- return /* @__PURE__ */ u.jsxs("div", { className: "relative w-fit", ref: y, children: [
128
- x(t, w),
129
- /* @__PURE__ */ u.jsx(
130
- "div",
131
- {
132
- id: a,
133
- className: b(
134
- P({ position: T }),
135
- o,
136
- !i && "opacity-0 pointer-events-none"
137
- ),
138
- role: "tooltip",
139
- "aria-hidden": !i,
140
- children: /* @__PURE__ */ u.jsx(j, { as: "p", fontSize: "xs", fontWeight: "normal", color: "black", children: e })
141
- }
142
- )
143
- ] });
144
- };
145
- export {
146
- F as M,
147
- L as T
148
- };
@@ -1,13 +0,0 @@
1
- import { FC } from 'react';
2
- /**
3
- * CalendarHeader atom for Calendar component
4
- */
5
- export declare const CalendarHeader: FC;
6
- /**
7
- * CalendarWeekdays atom for Calendar component
8
- */
9
- export declare const CalendarWeekdays: React.FC;
10
- /**
11
- * CalendarDays atom: delegates to single or range atom based on context
12
- */
13
- export declare const CalendarDays: FC;
@@ -1,8 +0,0 @@
1
- import { default as React } from 'react';
2
- import { CalendarProps } from './types';
3
- /**
4
- * Calendar component (Compound Pattern)
5
- * Implements a month view date picker following Material 3 specs and Versaur standards
6
- */
7
- export declare const CalendarRoot: React.FC<CalendarProps>;
8
- export declare const Calendar: React.FC<CalendarProps>;
@@ -1,2 +0,0 @@
1
- export { Calendar } from './calendar';
2
- export type * from './types';