@dimasbaguspm/versaur 0.0.18 → 0.0.20
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/js/bottom-sheet-DbtyWwsy.js +493 -0
- package/dist/js/{email-input-BIbrfs5q.js → bottom-sheet-input-C7cYfBaK.js} +789 -504
- package/dist/js/forms/index.js +21 -16
- package/dist/js/{description-list-DZQF212Z.js → image-rectangle-DH7v2xvp.js} +415 -323
- package/dist/js/index.js +63 -50
- package/dist/js/layouts/index.js +5 -4
- package/dist/js/overlays/index.js +6 -4
- package/dist/js/primitive/index.js +21 -16
- package/dist/js/side-bar-CHhcp0yS.js +397 -0
- package/dist/js/text-CRsIInRA.js +127 -0
- package/dist/js/tooltip-CDdl1U3A.js +148 -0
- package/dist/types/forms/bottom-sheet-input/bottom-sheet-input.d.ts +7 -0
- package/dist/types/forms/bottom-sheet-input/index.d.ts +2 -0
- package/dist/types/forms/bottom-sheet-input/types.d.ts +17 -0
- package/dist/types/forms/drawer-input/drawer-input.d.ts +6 -0
- package/dist/types/forms/drawer-input/index.d.ts +2 -0
- package/dist/types/forms/drawer-input/types.d.ts +18 -0
- package/dist/types/forms/index.d.ts +5 -0
- package/dist/types/forms/modal-input/index.d.ts +2 -0
- package/dist/types/forms/modal-input/modal-input.d.ts +6 -0
- package/dist/types/forms/modal-input/types.d.ts +18 -0
- package/dist/types/forms/selectable-multiple-input/index.d.ts +2 -0
- package/dist/types/forms/selectable-multiple-input/selectable-multiple-input.d.ts +6 -0
- package/dist/types/forms/selectable-multiple-input/types.d.ts +18 -0
- package/dist/types/forms/selectable-single-input/index.d.ts +2 -0
- package/dist/types/forms/selectable-single-input/selectable-single-input.d.ts +6 -0
- package/dist/types/forms/selectable-single-input/types.d.ts +18 -0
- package/dist/types/layouts/index.d.ts +1 -0
- package/dist/types/layouts/side-bar/index.d.ts +2 -0
- package/dist/types/layouts/side-bar/side-bar.atoms.d.ts +3 -0
- package/dist/types/layouts/side-bar/side-bar.d.ts +5 -0
- package/dist/types/layouts/side-bar/types.d.ts +42 -0
- package/dist/types/overlays/bottom-sheet/types.d.ts +2 -1
- package/dist/types/overlays/drawer/types.d.ts +2 -1
- package/dist/types/overlays/index.d.ts +1 -0
- package/dist/types/overlays/menu/menu.atoms.d.ts +5 -10
- package/dist/types/overlays/menu/menu.d.ts +2 -6
- package/dist/types/overlays/menu/types.d.ts +9 -14
- package/dist/types/overlays/menu/use-menu.d.ts +0 -1
- package/dist/types/overlays/modal/modal.d.ts +14 -5
- package/dist/types/overlays/modal/types.d.ts +7 -20
- package/dist/types/overlays/tooltip/index.d.ts +2 -0
- package/dist/types/overlays/tooltip/tooltip.d.ts +5 -0
- package/dist/types/overlays/tooltip/types.d.ts +33 -0
- package/dist/types/overlays/tooltip/use-tooltip-position.d.ts +8 -0
- package/dist/types/primitive/image/base-image.atoms.d.ts +6 -0
- package/dist/types/primitive/image/base-image.d.ts +6 -0
- package/dist/types/primitive/image/image-circle.d.ts +6 -0
- package/dist/types/primitive/image/image-rectangle.d.ts +6 -0
- package/dist/types/primitive/image/image-square.d.ts +6 -0
- package/dist/types/primitive/image/index.d.ts +5 -0
- package/dist/types/primitive/image/types.d.ts +48 -0
- package/dist/types/primitive/image/use-image.d.ts +13 -0
- package/dist/types/primitive/index.d.ts +1 -0
- package/dist/types/primitive/table/table.atoms.d.ts +4 -6
- package/dist/types/primitive/table/table.d.ts +2 -1
- package/dist/types/primitive/table/types.d.ts +7 -4
- package/dist/utils/enforce-subpath-import.js +11 -0
- package/package.json +1 -1
- package/dist/js/bottom-sheet-BRv-oJL-.js +0 -646
- package/dist/js/form-layout-4ASWdXn8.js +0 -302
- package/dist/types/overlays/modal/use-escape-close.d.ts +0 -6
- package/dist/types/overlays/modal/use-focus-trap.d.ts +0 -6
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OverlayPortalProps } from '../../utils/overlay-portal';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
3
|
/**
|
|
3
4
|
* Modal component prop types
|
|
4
5
|
*/
|
|
@@ -7,27 +8,17 @@ export type ModalPlacement = 'top' | 'center';
|
|
|
7
8
|
/**
|
|
8
9
|
* Modal compound root
|
|
9
10
|
*/
|
|
10
|
-
export interface ModalRootProps {
|
|
11
|
+
export interface ModalRootProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'>, OverlayPortalProps {
|
|
11
12
|
/** Controls whether the modal is open */
|
|
12
13
|
isOpen: boolean;
|
|
13
|
-
/**
|
|
14
|
-
|
|
14
|
+
/** Function to close the modal */
|
|
15
|
+
onClose: () => void;
|
|
15
16
|
/** Modal size variant */
|
|
16
17
|
size?: ModalSize;
|
|
17
18
|
/** Modal placement variant */
|
|
18
19
|
placement?: ModalPlacement;
|
|
19
20
|
/** Children (Modal compound parts) */
|
|
20
|
-
children:
|
|
21
|
-
/** Optional: disables closing on overlay click */
|
|
22
|
-
disableOverlayClose?: boolean;
|
|
23
|
-
/** Optional: disables closing on ESC key */
|
|
24
|
-
disableEscClose?: boolean;
|
|
25
|
-
/** Optional: ARIA label for dialog */
|
|
26
|
-
'aria-label'?: string;
|
|
27
|
-
/** Optional: ARIA labelledby for dialog */
|
|
28
|
-
'aria-labelledby'?: string;
|
|
29
|
-
/** Optional: ARIA describedby for dialog */
|
|
30
|
-
'aria-describedby'?: string;
|
|
21
|
+
children: ReactNode;
|
|
31
22
|
}
|
|
32
23
|
/**
|
|
33
24
|
* Props for Modal.Header, Modal.Footer
|
|
@@ -41,8 +32,4 @@ export interface ModalFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
41
32
|
export interface ModalBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
42
33
|
children: React.ReactNode;
|
|
43
34
|
}
|
|
44
|
-
export
|
|
45
|
-
children: React.ReactNode;
|
|
46
|
-
placement?: string;
|
|
47
|
-
onOverlayClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
48
|
-
}
|
|
35
|
+
export type ModalOverlayProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DetailedHTMLProps, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Tooltip position options
|
|
4
|
+
* 'auto' (default): browser chooses best position, prefers bottom
|
|
5
|
+
* 'top', 'bottom', 'left', 'right': force position
|
|
6
|
+
*/
|
|
7
|
+
export type TooltipPosition = 'auto' | 'top' | 'bottom' | 'left' | 'right';
|
|
8
|
+
/**
|
|
9
|
+
* TooltipRootProps: Props for Tooltip root
|
|
10
|
+
* Extends native div props, but allows ReactNode for content
|
|
11
|
+
*/
|
|
12
|
+
export interface TooltipRootProps extends Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'content'> {
|
|
13
|
+
/**
|
|
14
|
+
* The content to show inside the tooltip
|
|
15
|
+
*/
|
|
16
|
+
content: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* The element that triggers the tooltip (usually a child)
|
|
19
|
+
*/
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Position of the tooltip relative to the trigger (default: 'auto')
|
|
23
|
+
*/
|
|
24
|
+
position?: TooltipPosition;
|
|
25
|
+
/**
|
|
26
|
+
* Optional: delay in ms before showing the tooltip
|
|
27
|
+
*/
|
|
28
|
+
delay?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Optional: className for the tooltip popover
|
|
31
|
+
*/
|
|
32
|
+
popoverClassName?: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { TooltipPosition } from './types';
|
|
3
|
+
type TooltipPositionRef = {
|
|
4
|
+
position: TooltipPosition;
|
|
5
|
+
ref: RefObject<HTMLDivElement | null>;
|
|
6
|
+
};
|
|
7
|
+
export declare function useTooltipPositionRef(preferred?: TooltipPosition): TooltipPositionRef;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseImageFallbackProps, BaseImageSkeletonProps } from './types';
|
|
2
|
+
export declare function BaseImageSkeleton({ className, shape, size, height, width, }: BaseImageSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
/**
|
|
4
|
+
* FallbackAtom - displays a fallback UI when the image fails to load
|
|
5
|
+
*/
|
|
6
|
+
export declare function BaseImageFallback({ alt, width, height, className, style, shape, size, }: BaseImageFallbackProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseImageProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Image component that aligns with standard HTML <img> behavior, with required shape, skeleton loading, and cva variants
|
|
4
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
|
|
5
|
+
*/
|
|
6
|
+
export declare const BaseImage: import('react').ForwardRefExoticComponent<BaseImageProps & import('react').RefAttributes<HTMLImageElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseImageProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Circle-shaped Image component for Versaur
|
|
4
|
+
* Inherits all behavior from BaseImage, sets shape to 'circle'
|
|
5
|
+
*/
|
|
6
|
+
export declare const ImageCircle: import('react').ForwardRefExoticComponent<Omit<BaseImageProps, "shape"> & import('react').RefAttributes<HTMLImageElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseImageProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Rectangle-shaped Image component for Versaur
|
|
4
|
+
* Inherits all behavior from BaseImage, sets shape to 'rectangle'
|
|
5
|
+
*/
|
|
6
|
+
export declare const ImageRectangle: import('react').ForwardRefExoticComponent<Omit<BaseImageProps, "shape"> & import('react').RefAttributes<HTMLImageElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseImageProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Square-shaped Image component for Versaur
|
|
4
|
+
* Inherits all behavior from BaseImage, sets shape to 'square'
|
|
5
|
+
*/
|
|
6
|
+
export declare const ImageSquare: import('react').ForwardRefExoticComponent<Omit<BaseImageProps, "shape"> & import('react').RefAttributes<HTMLImageElement>>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { SkeletonProps } from '../../feedbacks';
|
|
2
|
+
import { ImgHTMLAttributes } from 'react';
|
|
3
|
+
export interface BaseImageSkeletonProps extends Omit<SkeletonProps, 'shape' | 'size'> {
|
|
4
|
+
/**
|
|
5
|
+
* Shape of the skeleton: 'square', 'rectangle', or 'circle'
|
|
6
|
+
*/
|
|
7
|
+
shape?: BaseImageProps['shape'];
|
|
8
|
+
/**
|
|
9
|
+
* Predefined size variant for the skeleton (see helpers.ts)
|
|
10
|
+
*/
|
|
11
|
+
size?: BaseImageProps['size'];
|
|
12
|
+
width?: number | string;
|
|
13
|
+
height?: number | string;
|
|
14
|
+
}
|
|
15
|
+
export interface BaseImageFallbackProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt'> {
|
|
16
|
+
/**
|
|
17
|
+
* Alternative text for the fallback image
|
|
18
|
+
*/
|
|
19
|
+
alt: string;
|
|
20
|
+
shape?: BaseImageProps['shape'];
|
|
21
|
+
size?: BaseImageProps['size'];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* ImageProps extends standard HTML <img> attributes with required src and alt, and supports position/size variants
|
|
25
|
+
*/
|
|
26
|
+
export interface BaseImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt'> {
|
|
27
|
+
/**
|
|
28
|
+
* Image source URL
|
|
29
|
+
*/
|
|
30
|
+
src: string;
|
|
31
|
+
/**
|
|
32
|
+
* Alternative text for the image
|
|
33
|
+
*/
|
|
34
|
+
alt: string;
|
|
35
|
+
/**
|
|
36
|
+
* Image object-fit/position variant (see helpers.ts)
|
|
37
|
+
*/
|
|
38
|
+
position?: 'cover' | 'contain' | 'center' | 'top' | 'bottom' | 'left' | 'right' | 'none';
|
|
39
|
+
/**
|
|
40
|
+
* Predefined image size variant (see helpers.ts)
|
|
41
|
+
*/
|
|
42
|
+
size?: 'sm' | 'md' | 'lg' | 'full' | 'auto';
|
|
43
|
+
/**
|
|
44
|
+
* Shape of the image: 'square', 'rectangle', or 'circle'
|
|
45
|
+
* Required for all image components
|
|
46
|
+
*/
|
|
47
|
+
shape: 'square' | 'rectangle' | 'circle';
|
|
48
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface UseImageProps {
|
|
2
|
+
src: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Custom hook to manage image loading, error, and natural size detection
|
|
6
|
+
*/
|
|
7
|
+
export declare function useImage({ src }: UseImageProps): {
|
|
8
|
+
loaded: boolean;
|
|
9
|
+
errored: boolean;
|
|
10
|
+
handleLoad: () => void;
|
|
11
|
+
handleError: () => void;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TableHeaderProps, TableBodyProps, TableFooterProps, TableRowProps,
|
|
1
|
+
import { TableHeaderProps, TableBodyProps, TableFooterProps, TableRowProps, TableHeaderItemProps, TableRowItemProps } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Table.Header renders the table header row (grid-based, ARIA role)
|
|
4
4
|
*/
|
|
@@ -15,8 +15,6 @@ declare const TableFooter: import('react').ForwardRefExoticComponent<TableFooter
|
|
|
15
15
|
* Table.Row renders a table row (grid-based, ARIA role)
|
|
16
16
|
*/
|
|
17
17
|
declare const TableRow: import('react').ForwardRefExoticComponent<TableRowProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
declare const TableColumn: import('react').ForwardRefExoticComponent<TableColumnProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
22
|
-
export { TableHeader, TableBody, TableFooter, TableRow, TableColumn };
|
|
18
|
+
declare const TableRowItem: import('react').ForwardRefExoticComponent<TableRowItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const TableHeaderItem: import('react').ForwardRefExoticComponent<TableHeaderItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export { TableHeader, TableBody, TableFooter, TableRow, TableRowItem, TableHeaderItem, };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { TableProps } from './types';
|
|
2
2
|
export declare const Table: import('react').ForwardRefExoticComponent<TableProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
3
3
|
Header: import('react').ForwardRefExoticComponent<import('./types').TableHeaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
|
+
HeaderItem: import('react').ForwardRefExoticComponent<import('./types').TableHeaderItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
5
|
Body: import('react').ForwardRefExoticComponent<import('./types').TableBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
6
|
Footer: import('react').ForwardRefExoticComponent<import('./types').TableFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
7
|
Row: import('react').ForwardRefExoticComponent<import('./types').TableRowProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
|
-
|
|
8
|
+
RowItem: import('react').ForwardRefExoticComponent<import('./types').TableRowItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
9
|
};
|
|
@@ -5,19 +5,20 @@ import { HTMLAttributes, ReactNode, TableHTMLAttributes } from 'react';
|
|
|
5
5
|
export interface TableProps extends TableHTMLAttributes<HTMLTableElement> {
|
|
6
6
|
/** Table children (Header, Body, Footer, etc) */
|
|
7
7
|
children: ReactNode;
|
|
8
|
-
|
|
8
|
+
/** Maximum number of columns in the table */
|
|
9
|
+
columns: number;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* Context value for Table
|
|
12
13
|
*/
|
|
13
14
|
export interface TableContextValue {
|
|
14
|
-
|
|
15
|
+
columns: number;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* TableHeaderProps for <Table.Header>
|
|
18
19
|
*/
|
|
19
|
-
export interface TableHeaderProps extends
|
|
20
|
-
children:
|
|
20
|
+
export interface TableHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
children: ReactNode;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* TableBodyProps for <Table.Body>
|
|
@@ -49,3 +50,5 @@ export interface TableColumnProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
49
50
|
/** Horizontal alignment of cell content (left, center, right). Default: left */
|
|
50
51
|
align?: 'left' | 'center' | 'right';
|
|
51
52
|
}
|
|
53
|
+
export type TableHeaderItemProps = Omit<TableColumnProps, 'as'>;
|
|
54
|
+
export type TableRowItemProps = Omit<TableColumnProps, 'as'>;
|
|
@@ -7,17 +7,22 @@ const symbolToSubpath = {
|
|
|
7
7
|
"LoadingIndicator": "feedbacks",
|
|
8
8
|
"ProgressIndicator": "feedbacks",
|
|
9
9
|
"Skeleton": "feedbacks",
|
|
10
|
+
"BottomSheetInput": "forms",
|
|
10
11
|
"CheckboxInput": "forms",
|
|
11
12
|
"ChipMultipleInput": "forms",
|
|
12
13
|
"ChipSingleInput": "forms",
|
|
13
14
|
"DateSinglePickerInput": "forms",
|
|
15
|
+
"DrawerInput": "forms",
|
|
14
16
|
"EmailInput": "forms",
|
|
17
|
+
"ModalInput": "forms",
|
|
15
18
|
"PriceInput": "forms",
|
|
16
19
|
"RadioInput": "forms",
|
|
17
20
|
"SearchInput": "forms",
|
|
18
21
|
"SegmentMultipleInput": "forms",
|
|
19
22
|
"SegmentSingleInput": "forms",
|
|
20
23
|
"SelectInput": "forms",
|
|
24
|
+
"SelectableMultipleInput": "forms",
|
|
25
|
+
"SelectableSingleInput": "forms",
|
|
21
26
|
"SwitchInput": "forms",
|
|
22
27
|
"TextInput": "forms",
|
|
23
28
|
"TextAreaInput": "forms",
|
|
@@ -26,6 +31,7 @@ const symbolToSubpath = {
|
|
|
26
31
|
"BottomBar": "layouts",
|
|
27
32
|
"FormLayout": "layouts",
|
|
28
33
|
"PageLayout": "layouts",
|
|
34
|
+
"SideBar": "layouts",
|
|
29
35
|
"TopBar": "layouts",
|
|
30
36
|
"Breadcrumbs": "navigation",
|
|
31
37
|
"Tabs": "navigation",
|
|
@@ -33,6 +39,7 @@ const symbolToSubpath = {
|
|
|
33
39
|
"Drawer": "overlays",
|
|
34
40
|
"Menu": "overlays",
|
|
35
41
|
"Modal": "overlays",
|
|
42
|
+
"Tooltip": "overlays",
|
|
36
43
|
"Alert": "primitive",
|
|
37
44
|
"Anchor": "primitive",
|
|
38
45
|
"Avatar": "primitive",
|
|
@@ -45,6 +52,10 @@ const symbolToSubpath = {
|
|
|
45
52
|
"Calendar": "primitive",
|
|
46
53
|
"DescriptionList": "primitive",
|
|
47
54
|
"Icon": "primitive",
|
|
55
|
+
"ImageCircle": "primitive",
|
|
56
|
+
"ImageSquare": "primitive",
|
|
57
|
+
"ImageRectangle": "primitive",
|
|
58
|
+
"BaseImage": "primitive",
|
|
48
59
|
"Snackbar": "primitive",
|
|
49
60
|
"Table": "primitive",
|
|
50
61
|
"Text": "primitive",
|