@dimasbaguspm/versaur 0.0.18 → 0.0.19

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.
@@ -13,3 +13,5 @@ export * from './time-picker-input';
13
13
  export * from './switch-input';
14
14
  export * from './price-input';
15
15
  export * from './email-input';
16
+ export * from './selectable-single-input';
17
+ export * from './selectable-multiple-input';
@@ -0,0 +1,2 @@
1
+ export { SelectableMultipleInput } from './selectable-multiple-input';
2
+ export type * from './types';
@@ -0,0 +1,6 @@
1
+ import { SelectableMultipleInputProps } from './types';
2
+ /**
3
+ * SelectableMultipleInput is a checkbox input with a custom label and checked icon
4
+ * @see https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/
5
+ */
6
+ export declare const SelectableMultipleInput: import('react').ForwardRefExoticComponent<SelectableMultipleInputProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,18 @@
1
+ import { ReactNode, InputHTMLAttributes } from 'react';
2
+ /**
3
+ * Props for SelectableMultipleInput
4
+ */
5
+ export interface SelectableMultipleInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
6
+ /**
7
+ * The value of the checkbox input
8
+ */
9
+ value: string;
10
+ /**
11
+ * The label to display next to the checkbox input (can be any ReactNode)
12
+ */
13
+ label: ReactNode;
14
+ /**
15
+ * Whether the input is checked (controlled)
16
+ */
17
+ checked: boolean;
18
+ }
@@ -0,0 +1,2 @@
1
+ export { SelectableSingleInput } from './selectable-single-input';
2
+ export type * from './types';
@@ -0,0 +1,6 @@
1
+ import { SelectableSingleInputProps } from './types';
2
+ /**
3
+ * SelectableSingleInput is a radio input with a custom label and checked icon
4
+ * @see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
5
+ */
6
+ export declare const SelectableSingleInput: import('react').ForwardRefExoticComponent<SelectableSingleInputProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,18 @@
1
+ import { ReactNode, InputHTMLAttributes } from 'react';
2
+ /**
3
+ * Props for SelectableSingleInput
4
+ */
5
+ export interface SelectableSingleInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
6
+ /**
7
+ * The value of the radio input
8
+ */
9
+ value: string;
10
+ /**
11
+ * The label to display next to the radio input (can be any ReactNode)
12
+ */
13
+ label: ReactNode;
14
+ /**
15
+ * Whether the input is checked (controlled)
16
+ */
17
+ checked: boolean;
18
+ }
@@ -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,5 @@
1
+ export { ImageCircle } from './image-circle';
2
+ export { ImageSquare } from './image-square';
3
+ export { ImageRectangle } from './image-rectangle';
4
+ export { BaseImage } from './base-image';
5
+ export type * from './types';
@@ -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 {};
@@ -14,3 +14,4 @@ export * from './table';
14
14
  export * from './text';
15
15
  export * from './tile';
16
16
  export * from './description-list';
17
+ export * from './image';
@@ -18,6 +18,8 @@ const symbolToSubpath = {
18
18
  "SegmentMultipleInput": "forms",
19
19
  "SegmentSingleInput": "forms",
20
20
  "SelectInput": "forms",
21
+ "SelectableMultipleInput": "forms",
22
+ "SelectableSingleInput": "forms",
21
23
  "SwitchInput": "forms",
22
24
  "TextInput": "forms",
23
25
  "TextAreaInput": "forms",
@@ -45,6 +47,10 @@ const symbolToSubpath = {
45
47
  "Calendar": "primitive",
46
48
  "DescriptionList": "primitive",
47
49
  "Icon": "primitive",
50
+ "ImageCircle": "primitive",
51
+ "ImageSquare": "primitive",
52
+ "ImageRectangle": "primitive",
53
+ "BaseImage": "primitive",
48
54
  "Snackbar": "primitive",
49
55
  "Table": "primitive",
50
56
  "Text": "primitive",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimasbaguspm/versaur",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
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",