@dimasbaguspm/versaur 0.0.33 → 0.0.35

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 (36) hide show
  1. package/dist/js/{bottom-sheet-B3Rt2JC5.js → bottom-sheet-BYq9Nf57.js} +99 -108
  2. package/dist/js/{bottom-sheet-input-DRcyjeGh.js → bottom-sheet-input-Bo5LLNVg.js} +2 -2
  3. package/dist/js/forms/index.js +1 -1
  4. package/dist/js/{image-rectangle-oPc5hFMM.js → image-rectangle-BPmnlpnT.js} +904 -436
  5. package/dist/js/index.js +54 -51
  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 +3 -3
  9. package/dist/js/primitive/index.js +24 -21
  10. package/dist/js/{tabs-CKLbsCWq.js → tabs-C3wTfqhW.js} +1 -1
  11. package/dist/js/{tooltip-DNKTNCQm.js → tooltip-Dh1adQMb.js} +1 -1
  12. package/dist/js/{top-bar-Bg-zMaFY.js → top-bar-DNHnNH-S.js} +158 -138
  13. package/dist/types/layouts/badge-group/types.d.ts +5 -0
  14. package/dist/types/layouts/bottom-bar/bottom-bar.atoms.d.ts +1 -1
  15. package/dist/types/layouts/bottom-bar/bottom-bar.d.ts +1 -1
  16. package/dist/types/layouts/bottom-bar/types.d.ts +4 -3
  17. package/dist/types/layouts/button-group/types.d.ts +5 -0
  18. package/dist/types/layouts/filter-chip-group/types.d.ts +5 -0
  19. package/dist/types/overlays/menu/menu.atoms.d.ts +0 -6
  20. package/dist/types/overlays/menu/types.d.ts +6 -3
  21. package/dist/types/overlays/menu/use-menu.d.ts +4 -5
  22. package/dist/types/primitive/accordion/accordion.atoms.d.ts +23 -0
  23. package/dist/types/primitive/accordion/accordion.d.ts +20 -0
  24. package/dist/types/primitive/accordion/index.d.ts +2 -0
  25. package/dist/types/primitive/accordion/types.d.ts +76 -0
  26. package/dist/types/primitive/attribute/types.d.ts +5 -0
  27. package/dist/types/primitive/button-menu-icon/types.d.ts +2 -1
  28. package/dist/types/primitive/heading/heading.d.ts +7 -0
  29. package/dist/types/primitive/heading/index.d.ts +2 -0
  30. package/dist/types/primitive/heading/types.d.ts +37 -0
  31. package/dist/types/primitive/hr/hr.d.ts +20 -0
  32. package/dist/types/primitive/hr/index.d.ts +2 -0
  33. package/dist/types/primitive/hr/types.d.ts +13 -0
  34. package/dist/types/primitive/index.d.ts +3 -0
  35. package/dist/utils/enforce-subpath-import.js +3 -0
  36. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
1
  import { BottomBarItemProps } from './types';
2
- export declare const BottomBarItem: import('react').ForwardRefExoticComponent<BottomBarItemProps & import('react').RefAttributes<HTMLDivElement>>;
2
+ export declare const BottomBarItem: import('react').ForwardRefExoticComponent<BottomBarItemProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -1,4 +1,4 @@
1
1
  import { BottomBarProps } from './types';
2
2
  export declare const BottomBar: (({ children, variant, size, className, ...props }: BottomBarProps) => import("react/jsx-runtime").JSX.Element) & {
3
- Item: import('react').ForwardRefExoticComponent<import('./types').BottomBarItemProps & import('react').RefAttributes<HTMLDivElement>>;
3
+ Item: import('react').ForwardRefExoticComponent<import('./types').BottomBarItemProps & import('react').RefAttributes<HTMLButtonElement>>;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { HTMLAttributes } from 'react';
1
+ import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
2
2
  /**
3
3
  * Props for the BottomBar container
4
4
  */
@@ -17,11 +17,12 @@ export interface BottomBarProps extends HTMLAttributes<HTMLElement> {
17
17
  /**
18
18
  * Props for each BottomBar.Item
19
19
  */
20
- export interface BottomBarItemProps extends HTMLAttributes<HTMLDivElement> {
20
+ export interface BottomBarItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
21
+ as?: 'div' | 'button';
21
22
  /**
22
23
  * Icon element for the item
23
24
  */
24
- icon: React.ReactNode;
25
+ icon?: ReactNode;
25
26
  /**
26
27
  * Label for the item
27
28
  */
@@ -29,4 +29,9 @@ export interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement>, Varian
29
29
  * @default 'md'
30
30
  */
31
31
  gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
32
+ /**
33
+ * Whether the badge group has bottom margin
34
+ * @default false
35
+ */
36
+ hasMargin?: boolean;
32
37
  }
@@ -29,4 +29,9 @@ export interface FilterChipGroupProps extends HTMLAttributes<HTMLDivElement>, Va
29
29
  * @default 'md'
30
30
  */
31
31
  gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
32
+ /**
33
+ * Whether the badge group has bottom margin
34
+ * @default false
35
+ */
36
+ hasMargin?: boolean;
32
37
  }
@@ -1,9 +1,3 @@
1
1
  import { MenuContentProps, MenuItemProps } from './types';
2
- /**
3
- * MenuContent: Wraps menu items
4
- */
5
2
  export declare const MenuContent: import('react').ForwardRefExoticComponent<MenuContentProps & import('react').RefAttributes<HTMLUListElement>>;
6
- /**
7
- * MenuItem: Single menu item
8
- */
9
3
  export declare const MenuItem: import('react').ForwardRefExoticComponent<MenuItemProps & import('react').RefAttributes<HTMLLIElement>>;
@@ -1,4 +1,4 @@
1
- import { HTMLAttributes, ReactNode } from 'react';
1
+ import { HTMLAttributes, MouseEvent, ReactNode, RefObject } from 'react';
2
2
  export type MenuSize = 'sm' | 'md';
3
3
  export type MenuPlacement = 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end' | 'auto';
4
4
  /**
@@ -18,7 +18,9 @@ export interface MenuProps {
18
18
  /** Preferred placement of the menu relative to trigger */
19
19
  placement?: MenuPlacement;
20
20
  /** Container element to respect boundaries (defaults to viewport) */
21
- container?: HTMLElement | null;
21
+ container?: HTMLElement | RefObject<HTMLElement | null> | null;
22
+ /** Whether to keep the menu after list item clicked */
23
+ preserve?: boolean;
22
24
  }
23
25
  /**
24
26
  * Props for MenuContent
@@ -30,9 +32,10 @@ export interface MenuContentProps extends HTMLAttributes<HTMLUListElement> {
30
32
  /**
31
33
  * Props for MenuItem
32
34
  */
33
- export interface MenuItemProps extends HTMLAttributes<HTMLLIElement> {
35
+ export interface MenuItemProps extends Omit<HTMLAttributes<HTMLLIElement>, 'onClick'> {
34
36
  /** Item content */
35
37
  children: ReactNode;
36
38
  /** Whether the item is disabled */
37
39
  disabled?: boolean;
40
+ onClick?: (ev: MouseEvent<HTMLButtonElement>) => void;
38
41
  }
@@ -1,9 +1,6 @@
1
+ import { RefObject } from 'react';
1
2
  import { MenuPlacement } from './types';
2
3
  export declare function useMenuOutsideClick(isOpen: boolean, contentRef: React.RefObject<HTMLDivElement | null>, triggerRef: React.RefObject<HTMLButtonElement | null>, onOutsideClick: () => void): void;
3
- /**
4
- * Menu-specific escape close hook that doesn't disable body scrolling
5
- */
6
- export declare function useMenuEscapeClose(isOpen: boolean, onClose: () => void): void;
7
4
  interface MenuPosition {
8
5
  top?: number;
9
6
  bottom?: number;
@@ -11,6 +8,8 @@ interface MenuPosition {
11
8
  right?: number;
12
9
  maxHeight?: number;
13
10
  maxWidth?: number;
11
+ position?: 'absolute' | 'fixed';
12
+ isReady?: boolean;
14
13
  }
15
- export declare function useMenuPosition(isOpen: boolean, triggerRef: React.RefObject<HTMLElement | null>, contentRef: React.RefObject<HTMLDivElement | null>, placement?: MenuPlacement, container?: HTMLElement | null): MenuPosition;
14
+ export declare function useMenuPosition(isOpen: boolean, triggerRef: React.RefObject<HTMLElement | null>, contentRef: React.RefObject<HTMLDivElement | null>, placement: MenuPlacement | undefined, container: HTMLElement | RefObject<HTMLElement | null> | null): MenuPosition;
16
15
  export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Accordion Title sub-component
3
+ * Renders the title content within the accordion header
4
+ */
5
+ export declare const AccordionTitle: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLHeadingElement> & {
6
+ children: import('react').ReactNode;
7
+ } & import('react').RefAttributes<HTMLHeadingElement>>;
8
+ /**
9
+ * Accordion Content sub-component
10
+ * Renders the expandable content area when accordion is open
11
+ */
12
+ export declare const AccordionContent: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
13
+ children: import('react').ReactNode;
14
+ } & import('react').RefAttributes<HTMLDivElement>>;
15
+ /**
16
+ * Accordion Icon sub-component
17
+ * Renders the expand/collapse icon with rotation animation
18
+ */
19
+ export declare const AccordionIcon: import('react').ForwardRefExoticComponent<{
20
+ as: React.ComponentType<{
21
+ className?: string;
22
+ }>;
23
+ } & import('react').RefAttributes<SVGSVGElement>>;
@@ -0,0 +1,20 @@
1
+ export declare const Accordion: import('react').ForwardRefExoticComponent<Omit<import('react').HTMLAttributes<HTMLDivElement>, "title"> & {
2
+ title: import('react').ReactNode;
3
+ subtitle?: import('react').ReactNode;
4
+ isDefaultOpen?: boolean;
5
+ disabled?: boolean;
6
+ children?: import('react').ReactNode;
7
+ hasMargin?: boolean;
8
+ } & import('react').RefAttributes<HTMLDivElement>> & {
9
+ Title: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLHeadingElement> & {
10
+ children: import('react').ReactNode;
11
+ } & import('react').RefAttributes<HTMLHeadingElement>>;
12
+ Content: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
13
+ children: import('react').ReactNode;
14
+ } & import('react').RefAttributes<HTMLDivElement>>;
15
+ Icon: import('react').ForwardRefExoticComponent<{
16
+ as: React.ComponentType<{
17
+ className?: string;
18
+ }>;
19
+ } & import('react').RefAttributes<SVGSVGElement>>;
20
+ };
@@ -0,0 +1,2 @@
1
+ export { Accordion } from './accordion';
2
+ export type { AccordionProps, AccordionTitleProps, AccordionContentProps, } from './types';
@@ -0,0 +1,76 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * AccordionProps defines the props for the Accordion component
4
+ * @property title - Title content to display in the accordion header
5
+ * @property subtitle - Optional subtitle content (e.g., actions, secondary info)
6
+ * @property isDefaultOpen - Whether the accordion is open by default
7
+ * @property disabled - Whether the accordion is disabled
8
+ * @property children - Content to show when accordion is expanded
9
+ * Extends HTMLAttributes<HTMLDivElement> for native div props
10
+ */
11
+ export type AccordionProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {
12
+ /**
13
+ * Title content to display in the accordion header
14
+ */
15
+ title: ReactNode;
16
+ /**
17
+ * Optional subtitle content (e.g., actions, secondary info)
18
+ */
19
+ subtitle?: ReactNode;
20
+ /**
21
+ * Whether the accordion is open by default
22
+ */
23
+ isDefaultOpen?: boolean;
24
+ /**
25
+ * Whether the accordion is disabled
26
+ */
27
+ disabled?: boolean;
28
+ /**
29
+ * Content to show when accordion is expanded
30
+ */
31
+ children?: ReactNode;
32
+ /**
33
+ * Whether the accordion has bottom margin
34
+ * @default false
35
+ */
36
+ hasMargin?: boolean;
37
+ };
38
+ /**
39
+ * AccordionTitleProps defines the props for the Accordion.Title component
40
+ * @property children - Title content
41
+ * Extends HTMLAttributes<HTMLHeadingElement> for native heading props
42
+ */
43
+ export type AccordionTitleProps = React.HTMLAttributes<HTMLHeadingElement> & {
44
+ /**
45
+ * Title content
46
+ */
47
+ children: ReactNode;
48
+ };
49
+ /**
50
+ * AccordionContentProps defines the props for the Accordion.Content component
51
+ * @property children - Content to display when expanded
52
+ * Extends HTMLAttributes<HTMLDivElement> for native div props
53
+ */
54
+ export type AccordionContentProps = React.HTMLAttributes<HTMLDivElement> & {
55
+ /**
56
+ * Content to display when expanded
57
+ */
58
+ children: ReactNode;
59
+ };
60
+ /**
61
+ * AccordionContextValue defines the context value for Accordion state management
62
+ */
63
+ export type AccordionContextValue = {
64
+ /**
65
+ * Whether the accordion is currently open
66
+ */
67
+ isOpen: boolean;
68
+ /**
69
+ * Function to toggle the accordion state
70
+ */
71
+ toggle: () => void;
72
+ /**
73
+ * Whether the accordion is disabled
74
+ */
75
+ disabled: boolean;
76
+ };
@@ -11,4 +11,9 @@ export interface AttributeProps extends HTMLAttributes<HTMLDivElement> {
11
11
  * The attribute content (displayed as p)
12
12
  */
13
13
  children: ReactNode;
14
+ /**
15
+ * Whether the attribute has bottom margin
16
+ * @default false
17
+ */
18
+ hasMargin?: boolean;
14
19
  }
@@ -1,7 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { IconProps } from '../icon';
3
3
  import { ButtonIconProps } from '../button-icon';
4
- export interface ButtonMenuIconProps extends Omit<ButtonIconProps, 'content'>, Pick<IconProps, 'as'> {
4
+ import { MenuProps } from '../../overlays/menu/types';
5
+ export interface ButtonMenuIconProps extends Omit<ButtonIconProps, 'content'>, Pick<IconProps, 'as'>, Pick<MenuProps, 'placement' | 'container' | 'preserve'> {
5
6
  /**
6
7
  * Callback function triggered when the menu open state changes.
7
8
  */
@@ -0,0 +1,7 @@
1
+ import { HeadingProps } from './types';
2
+ /**
3
+ * Heading component for Versaur UI
4
+ * Provides semantic heading typography (h1-h6), color, underline, capitalization, and margin support
5
+ * @example <Heading level={1} color="primary" hasUnderline isCapitalize hasMargin>Main Title</Heading>
6
+ */
7
+ export declare const Heading: import('react').ForwardRefExoticComponent<HeadingProps & import('react').RefAttributes<HTMLHeadingElement>>;
@@ -0,0 +1,2 @@
1
+ export { Heading } from './heading';
2
+ export type { HeadingProps } from './types';
@@ -0,0 +1,37 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * HeadingProps defines the props for the Heading component
4
+ * @property level - Heading level (1-6, corresponding to h1-h6)
5
+ * @property color - Versaur color system (primary, secondary, tertiary, ghost, neutral, success, info, warning, danger)
6
+ * @property hasUnderline - Whether to underline the text
7
+ * @property isCapitalize - Whether to capitalize the text
8
+ * @property hasMargin - Whether to add margin bottom (mb-4)
9
+ * @property align - Text alignment
10
+ * @property italic - Whether to italicize the text
11
+ * @property clamp - Clamp lines (1-5) or none
12
+ * @property ellipsis - Whether to truncate text with ellipsis
13
+ * @property className - Additional CSS classes
14
+ * @property children - Text content
15
+ */
16
+ export interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
17
+ /** Heading level (1-6, corresponding to h1-h6) */
18
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
19
+ /** Versaur color system */
20
+ color?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'neutral' | 'success' | 'info' | 'warning' | 'danger' | 'inherit' | 'white' | 'black' | 'gray';
21
+ /** Underline text */
22
+ hasUnderline?: boolean;
23
+ /** Capitalize text */
24
+ isCapitalize?: boolean;
25
+ /** Add margin bottom (mb-4) */
26
+ hasMargin?: boolean;
27
+ /** Text alignment */
28
+ align?: 'left' | 'center' | 'right' | 'justify';
29
+ /** Italic text */
30
+ italic?: boolean;
31
+ /** Clamp lines (1-5) or none */
32
+ clamp?: 1 | 2 | 3 | 4 | 5 | 'none';
33
+ /** Ellipsis (truncate) */
34
+ ellipsis?: boolean;
35
+ /** Text content */
36
+ children: ReactNode;
37
+ }
@@ -0,0 +1,20 @@
1
+ import { HrProps } from './types';
2
+ /**
3
+ * Hr component for creating a horizontal line separator with optional margin
4
+ *
5
+ * Follows the Regular Pattern - a simple styled wrapper that aligns with standard HTML behavior.
6
+ * Creates a 1px height horizontal line with border color and optional bottom margin.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * // Basic usage
11
+ * <Hr />
12
+ *
13
+ * // With bottom margin
14
+ * <Hr hasMargin />
15
+ *
16
+ * // With custom className
17
+ * <Hr className="my-8" />
18
+ * ```
19
+ */
20
+ export declare const Hr: import('react').ForwardRefExoticComponent<HrProps & import('react').RefAttributes<HTMLHRElement>>;
@@ -0,0 +1,2 @@
1
+ export { Hr } from './hr';
2
+ export type { HrProps } from './types';
@@ -0,0 +1,13 @@
1
+ import { HTMLAttributes } from 'react';
2
+ /**
3
+ * HrProps defines the props for the Hr component
4
+ * @property hasMargin - Whether to include bottom margin (mb-4)
5
+ */
6
+ export interface HrProps extends HTMLAttributes<HTMLHRElement> {
7
+ /**
8
+ * Whether to include bottom margin
9
+ * - When true: Adds mb-4 for spacing
10
+ * - When false: No margin applied (default)
11
+ */
12
+ hasMargin?: boolean;
13
+ }
@@ -1,3 +1,4 @@
1
+ export * from './accordion';
1
2
  export * from './alert';
2
3
  export * from './anchor';
3
4
  export * from './attribute';
@@ -12,6 +13,8 @@ export * from './button-icon';
12
13
  export * from './calculator';
13
14
  export * from './card';
14
15
  export * from './filter-chip';
16
+ export * from './heading';
17
+ export * from './hr';
15
18
  export * from './icon';
16
19
  export * from './no-results';
17
20
  export * from './snackbar';
@@ -45,6 +45,7 @@ const symbolToSubpath = {
45
45
  "Menu": "overlays",
46
46
  "Modal": "overlays",
47
47
  "Tooltip": "overlays",
48
+ "Accordion": "primitive",
48
49
  "Alert": "primitive",
49
50
  "Anchor": "primitive",
50
51
  "Attribute": "primitive",
@@ -59,6 +60,8 @@ const symbolToSubpath = {
59
60
  "Calculator": "primitive",
60
61
  "Card": "primitive",
61
62
  "FilterChip": "primitive",
63
+ "Heading": "primitive",
64
+ "Hr": "primitive",
62
65
  "Icon": "primitive",
63
66
  "ImageCircle": "primitive",
64
67
  "ImageSquare": "primitive",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimasbaguspm/versaur",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
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",