@dimasbaguspm/versaur 0.0.16 → 0.0.18
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 → assets}/styles.css +37 -0
- package/dist/js/bottom-sheet-BRv-oJL-.js +646 -0
- package/dist/js/description-list-DZQF212Z.js +1786 -0
- package/dist/js/email-input-BIbrfs5q.js +1731 -0
- package/dist/js/forms/index.js +16 -16
- package/dist/js/index.js +44 -41
- package/dist/js/overlays/index.js +3 -4
- package/dist/js/primitive/index.js +12 -11
- package/dist/js/providers/index.js +5 -0
- package/dist/js/snackbar-DH8jCh2V.js +50 -0
- package/dist/js/use-snackbars-oPoF7J5t.js +94 -0
- package/dist/types/feedbacks/loading-indicator/index.d.ts +2 -1
- package/dist/types/forms/chip-multiple-input/chip-multiple-input.atoms.d.ts +10 -0
- package/dist/types/forms/chip-multiple-input/chip-multiple-input.d.ts +5 -0
- package/dist/types/forms/chip-multiple-input/index.d.ts +2 -0
- package/dist/types/forms/{chip-input → chip-multiple-input}/types.d.ts +16 -4
- package/dist/types/forms/chip-single-input/chip-single-input.atoms.d.ts +10 -0
- package/dist/types/forms/chip-single-input/chip-single-input.d.ts +5 -0
- package/dist/types/forms/chip-single-input/index.d.ts +2 -0
- package/dist/types/forms/chip-single-input/types.d.ts +67 -0
- package/dist/types/forms/date-single-picker-input/date-single-picker-input.d.ts +1 -8
- package/dist/types/forms/date-single-picker-input/index.d.ts +1 -1
- package/dist/types/forms/date-single-picker-input/types.d.ts +12 -66
- package/dist/types/forms/email-input/email-input.d.ts +8 -0
- package/dist/types/forms/email-input/index.d.ts +2 -0
- package/dist/types/forms/email-input/types.d.ts +6 -0
- package/dist/types/forms/index.d.ts +5 -2
- package/dist/types/forms/price-input/index.d.ts +2 -0
- package/dist/types/forms/price-input/price-input.d.ts +6 -0
- package/dist/types/forms/price-input/types.d.ts +15 -0
- package/dist/types/forms/price-input/use-price-input.d.ts +6 -0
- package/dist/types/forms/search-input/index.d.ts +2 -0
- package/dist/types/forms/search-input/search-input.d.ts +8 -0
- package/dist/types/forms/search-input/types.d.ts +35 -0
- package/dist/types/forms/segment-multiple-input/types.d.ts +1 -5
- package/dist/types/forms/segment-single-input/types.d.ts +1 -5
- package/dist/types/forms/switch-input/index.d.ts +2 -3
- package/dist/types/forms/time-picker-input/time-picker-input.d.ts +4 -4
- package/dist/types/forms/time-picker-input/types.d.ts +2 -38
- package/dist/types/index.d.ts +1 -0
- package/dist/types/layouts/page-layout/index.d.ts +2 -1
- package/dist/types/overlays/menu/index.d.ts +2 -2
- package/dist/types/overlays/modal/types.d.ts +1 -1
- package/dist/types/primitive/anchor/types.d.ts +8 -2
- package/dist/types/primitive/description-list/description-list.atoms.d.ts +13 -0
- package/dist/types/primitive/description-list/description-list.d.ts +6 -0
- package/dist/types/primitive/description-list/index.d.ts +2 -0
- package/dist/types/primitive/description-list/types.d.ts +46 -0
- package/dist/types/primitive/index.d.ts +1 -0
- package/dist/types/providers/index.d.ts +1 -0
- package/dist/types/providers/snackbars-provider/index.d.ts +3 -0
- package/dist/types/providers/snackbars-provider/provider.d.ts +7 -0
- package/dist/types/providers/snackbars-provider/types.d.ts +28 -0
- package/dist/types/providers/snackbars-provider/use-snackbars-queue.d.ts +9 -0
- package/dist/types/providers/snackbars-provider/use-snackbars.d.ts +4 -0
- package/dist/{js → utils}/enforce-subpath-import.js +61 -51
- package/package.json +8 -4
- package/dist/js/bottom-sheet-Difan0U1.js +0 -340
- package/dist/js/calendar-CUjVZ7Ap.js +0 -811
- package/dist/js/menu-Bm-yPIMN.js +0 -310
- package/dist/js/switch-input-Bx6_2zG9.js +0 -2035
- package/dist/js/tile-BjhJ5Mvl.js +0 -939
- package/dist/types/forms/calculator-input/calculator-input.atoms.d.ts +0 -11
- package/dist/types/forms/calculator-input/calculator-input.d.ts +0 -8
- package/dist/types/forms/calculator-input/index.d.ts +0 -1
- package/dist/types/forms/calculator-input/types.d.ts +0 -51
- package/dist/types/forms/chip-input/chip-input.atoms.d.ts +0 -10
- package/dist/types/forms/chip-input/chip-input.d.ts +0 -5
- package/dist/types/forms/chip-input/index.d.ts +0 -2
- package/dist/types/forms/date-range-picker-input/date-range-picker-input.d.ts +0 -10
- package/dist/types/forms/date-range-picker-input/index.d.ts +0 -2
- package/dist/types/forms/date-range-picker-input/types.d.ts +0 -64
- package/dist/types/forms/date-range-picker-input/use-date-range-picker.d.ts +0 -13
- package/dist/types/forms/date-single-picker-input/date-single-picker-input.atoms.d.ts +0 -13
- package/dist/types/forms/date-single-picker-input/date-single-picker-input.docked.d.ts +0 -14
- package/dist/types/forms/date-single-picker-input/date-single-picker-input.modal.d.ts +0 -15
- package/dist/types/forms/date-single-picker-input/use-date-single-picker.d.ts +0 -10
- package/dist/types/forms/time-picker-input/time-picker-input.atoms.d.ts +0 -15
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { TextInputProps } from '../text-input/types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for PriceInput component
|
|
5
|
+
* @property value - The price value as a string (raw, unformatted)
|
|
6
|
+
* @property onChange - Called when the value changes (returns raw string)
|
|
7
|
+
* @property allowNegative - Optional: allow negative values (default: false)
|
|
8
|
+
* @property inputProps - Optional: custom input attributes
|
|
9
|
+
*/
|
|
10
|
+
export interface PriceInputProps extends Omit<TextInputProps, 'type' | 'value' | 'onChange'> {
|
|
11
|
+
value: string;
|
|
12
|
+
onChange: (value: string) => void;
|
|
13
|
+
allowNegative?: boolean;
|
|
14
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* usePriceInputSync synchronizes the local input value with the parent value
|
|
3
|
+
* @param value - The parent value (string or number)
|
|
4
|
+
* @param setRawValue - Setter for local raw value
|
|
5
|
+
*/
|
|
6
|
+
export declare function usePriceInputSync(value: string | number, setRawValue: (val: string) => void): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SearchInputProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* SearchInput component for Versaur UI
|
|
4
|
+
*
|
|
5
|
+
* A styled input field for search, extending TextInput and enforcing HTML search input standards
|
|
6
|
+
* Follows browser standards and accessibility best practices
|
|
7
|
+
*/
|
|
8
|
+
export declare const SearchInput: import('react').ForwardRefExoticComponent<SearchInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TextInputProps } from '../text-input/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the SearchInput component
|
|
4
|
+
* Extends TextInputProps and enforces type='search' with proper HTML search attributes
|
|
5
|
+
*/
|
|
6
|
+
export interface SearchInputProps extends Omit<TextInputProps, 'type'> {
|
|
7
|
+
/**
|
|
8
|
+
* The value of the input
|
|
9
|
+
*/
|
|
10
|
+
value?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Callback when the value changes
|
|
13
|
+
*/
|
|
14
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
15
|
+
/**
|
|
16
|
+
* Placeholder text for the search input
|
|
17
|
+
*/
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the input is disabled
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether to show the clear button (native search input feature)
|
|
25
|
+
*/
|
|
26
|
+
allowClear?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Autocomplete behavior for the search input
|
|
29
|
+
*/
|
|
30
|
+
autoComplete?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Spellcheck for the search input
|
|
33
|
+
*/
|
|
34
|
+
spellCheck?: boolean;
|
|
35
|
+
}
|
|
@@ -9,15 +9,11 @@ export interface SegmentMultipleInputProps extends Omit<InputHTMLAttributes<HTML
|
|
|
9
9
|
* Semantic variants: success, info, warning, danger
|
|
10
10
|
* Each variant supports outline form for flexible design expression
|
|
11
11
|
*/
|
|
12
|
-
variant?: 'primary' | '
|
|
12
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'neutral' | 'success' | 'info' | 'warning' | 'danger';
|
|
13
13
|
/**
|
|
14
14
|
* Size variant for the segment inputs
|
|
15
15
|
*/
|
|
16
16
|
size?: 'sm' | 'md' | 'lg';
|
|
17
|
-
/**
|
|
18
|
-
* If true, options will fill the parent width equally
|
|
19
|
-
*/
|
|
20
|
-
fullWidth?: boolean;
|
|
21
17
|
/**
|
|
22
18
|
* Label text to display above the segment group
|
|
23
19
|
*/
|
|
@@ -9,15 +9,11 @@ export interface SegmentSingleInputProps extends Omit<InputHTMLAttributes<HTMLIn
|
|
|
9
9
|
* Semantic variants: success, info, warning, danger
|
|
10
10
|
* Each variant supports outline form for flexible design expression
|
|
11
11
|
*/
|
|
12
|
-
variant?: 'primary' | '
|
|
12
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'neutral' | 'success' | 'info' | 'warning' | 'danger';
|
|
13
13
|
/**
|
|
14
14
|
* Size variant for the segment inputs
|
|
15
15
|
*/
|
|
16
16
|
size?: 'sm' | 'md' | 'lg';
|
|
17
|
-
/**
|
|
18
|
-
* If true, the segment group and its options will fill the parent width
|
|
19
|
-
*/
|
|
20
|
-
fullWidth?: boolean;
|
|
21
17
|
/**
|
|
22
18
|
* Label text to display above the segment group
|
|
23
19
|
*/
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './types';
|
|
1
|
+
export { SwitchInput } from './switch-input';
|
|
2
|
+
export type * from './types';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { TimePickerInputProps } from './types';
|
|
3
2
|
/**
|
|
4
3
|
* TimePickerInput component for Versaur UI
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Renders a visually accessible text input
|
|
6
|
+
*
|
|
7
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time
|
|
8
8
|
*/
|
|
9
|
-
export declare const TimePickerInput:
|
|
9
|
+
export declare const TimePickerInput: import('react').ForwardRefExoticComponent<TimePickerInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1,47 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ModalRootProps } from '../../overlays/modal';
|
|
1
|
+
import { TextInputProps } from '../text-input';
|
|
3
2
|
/**
|
|
4
3
|
* Props for the TimePickerInput component
|
|
5
4
|
*/
|
|
6
|
-
export interface TimePickerInputProps {
|
|
7
|
-
/**
|
|
8
|
-
* The selected time value in 12-hour format (e.g., '02:30 PM')
|
|
9
|
-
*/
|
|
5
|
+
export interface TimePickerInputProps extends Omit<TextInputProps, 'type' | 'value' | 'onChange'> {
|
|
10
6
|
value: string;
|
|
11
7
|
/**
|
|
12
8
|
* Called when the time value changes
|
|
13
9
|
*/
|
|
14
10
|
onChange: (value: string) => void;
|
|
15
|
-
/**
|
|
16
|
-
* Optional label for the input
|
|
17
|
-
*/
|
|
18
|
-
label?: ReactNode;
|
|
19
|
-
/**
|
|
20
|
-
* Optional helper text below the input
|
|
21
|
-
*/
|
|
22
|
-
helperText?: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* Whether the input is disabled
|
|
25
|
-
*/
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Optional error message
|
|
29
|
-
*/
|
|
30
|
-
error?: ReactNode;
|
|
31
|
-
/**
|
|
32
|
-
* Whether to decide the modal placement'
|
|
33
|
-
*/
|
|
34
|
-
placement?: ModalRootProps['placement'];
|
|
35
|
-
/**
|
|
36
|
-
* Optional: ARIA label for dialog
|
|
37
|
-
*/
|
|
38
|
-
'aria-label'?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Optional: ARIA labelledby for dialog
|
|
41
|
-
*/
|
|
42
|
-
'aria-labelledby'?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Optional: ARIA describedby for dialog
|
|
45
|
-
*/
|
|
46
|
-
'aria-describedby'?: string;
|
|
47
11
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { PageLayout } from './page-layout';
|
|
2
|
+
export type * from './types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from './types';
|
|
1
|
+
export { Menu } from './menu';
|
|
2
|
+
export type * from './types';
|
|
@@ -2,7 +2,7 @@ import { HTMLAttributes } from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Modal component prop types
|
|
4
4
|
*/
|
|
5
|
-
export type ModalSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
export type ModalSize = 'sm' | 'md' | 'lg' | 'fit-content';
|
|
6
6
|
export type ModalPlacement = 'top' | 'center';
|
|
7
7
|
/**
|
|
8
8
|
* Modal compound root
|
|
@@ -10,10 +10,16 @@ export interface AnchorProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
10
10
|
color?: 'primary' | 'secondary' | 'ghost' | 'danger' | 'neutral';
|
|
11
11
|
/**
|
|
12
12
|
* Font size utility (default: 'base')
|
|
13
|
+
* See: https://tailwindcss.com/docs/font-size
|
|
13
14
|
*/
|
|
14
|
-
fontSize?:
|
|
15
|
+
fontSize?: 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl' | 'inherit' | undefined;
|
|
15
16
|
/**
|
|
16
17
|
* Font weight utility (default: 'medium')
|
|
18
|
+
* See: https://tailwindcss.com/docs/font-weight
|
|
17
19
|
*/
|
|
18
|
-
fontWeight?:
|
|
20
|
+
fontWeight?: 'thin' | 'extralight' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black' | 'inherit' | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* If true, removes underline style from anchor
|
|
23
|
+
*/
|
|
24
|
+
quiet?: boolean;
|
|
19
25
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DescriptionListItemProps, DescriptionListTermProps, DescriptionListDetailsProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* DescriptionList.Item atom
|
|
4
|
+
*/
|
|
5
|
+
export declare const DescriptionListItem: import('react').ForwardRefExoticComponent<DescriptionListItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
/**
|
|
7
|
+
* DescriptionList.Term atom
|
|
8
|
+
*/
|
|
9
|
+
export declare const DescriptionListTerm: import('react').ForwardRefExoticComponent<DescriptionListTermProps & import('react').RefAttributes<HTMLElement>>;
|
|
10
|
+
/**
|
|
11
|
+
* DescriptionList.Details atom
|
|
12
|
+
*/
|
|
13
|
+
export declare const DescriptionListDetails: import('react').ForwardRefExoticComponent<DescriptionListDetailsProps & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DescriptionListProps } from './types';
|
|
2
|
+
export declare const DescriptionList: import('react').ForwardRefExoticComponent<DescriptionListProps & import('react').RefAttributes<HTMLDListElement>> & {
|
|
3
|
+
Item: import('react').ForwardRefExoticComponent<import('./types').DescriptionListItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
|
+
Term: import('react').ForwardRefExoticComponent<import('./types').DescriptionListTermProps & import('react').RefAttributes<HTMLElement>>;
|
|
5
|
+
Details: import('react').ForwardRefExoticComponent<import('./types').DescriptionListDetailsProps & import('react').RefAttributes<HTMLElement>>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import { TextProps } from '../text';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the DescriptionList root component
|
|
5
|
+
*/
|
|
6
|
+
export interface DescriptionListProps extends HTMLAttributes<HTMLDListElement> {
|
|
7
|
+
/**
|
|
8
|
+
* Children should be DescriptionList.Item elements
|
|
9
|
+
*/
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Props for DescriptionList.Item
|
|
14
|
+
*/
|
|
15
|
+
export interface DescriptionListItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
/**
|
|
17
|
+
* Children should be DescriptionList.Term and DescriptionList.Details
|
|
18
|
+
*/
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Number of grid columns to span (default: 4)
|
|
22
|
+
*/
|
|
23
|
+
span?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Props for DescriptionList.Term
|
|
27
|
+
*/
|
|
28
|
+
export interface DescriptionListTermProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
29
|
+
/**
|
|
30
|
+
* Term label (required, string only)
|
|
31
|
+
*/
|
|
32
|
+
children: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Props for DescriptionList.Details
|
|
36
|
+
*/
|
|
37
|
+
export interface DescriptionListDetailsProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
38
|
+
/**
|
|
39
|
+
* Details value (required, string only)
|
|
40
|
+
*/
|
|
41
|
+
children: string;
|
|
42
|
+
/**
|
|
43
|
+
* Text Color (default: 'black')
|
|
44
|
+
*/
|
|
45
|
+
color?: TextProps['color'];
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './snackbars-provider';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SnackbarsProviderProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* SnackbarsProvider manages a queue of snackbars and provides showSnack
|
|
5
|
+
* Placement: full width bottom for mobile, bottom left for desktop/tablet
|
|
6
|
+
*/
|
|
7
|
+
export declare const SnackbarsProvider: FC<SnackbarsProviderProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* SnackbarQueueItem: Represents a snackbar in the queue
|
|
4
|
+
*/
|
|
5
|
+
export interface SnackbarQueueItem {
|
|
6
|
+
/** Unique id for the snackbar */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Message content */
|
|
9
|
+
message: ReactNode;
|
|
10
|
+
/** Color variant */
|
|
11
|
+
color?: 'success' | 'info' | 'warning' | 'danger';
|
|
12
|
+
/** Optional action element */
|
|
13
|
+
action?: ReactNode;
|
|
14
|
+
/** Optional duration in milliseconds */
|
|
15
|
+
duration?: number | null;
|
|
16
|
+
}
|
|
17
|
+
export type ShowSnackFunction = (color: SnackbarQueueItem['color'], message: ReactNode, options?: Partial<Omit<SnackbarQueueItem, 'id' | 'color' | 'message'>>) => void;
|
|
18
|
+
/**
|
|
19
|
+
* SnackbarsContextValue: Context value for snackbars
|
|
20
|
+
*/
|
|
21
|
+
export interface SnackbarsContextValue {
|
|
22
|
+
/** Show a snackbar */
|
|
23
|
+
showSnack: ShowSnackFunction;
|
|
24
|
+
}
|
|
25
|
+
export interface SnackbarsProviderProps {
|
|
26
|
+
/** Children to render inside the provider */
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ShowSnackFunction, SnackbarQueueItem } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook to manage snackbar queue and auto-close logic
|
|
4
|
+
*/
|
|
5
|
+
export declare function useSnackbarsQueue(): {
|
|
6
|
+
queue: SnackbarQueueItem[];
|
|
7
|
+
showSnack: ShowSnackFunction;
|
|
8
|
+
removeSnack: (id: string) => void;
|
|
9
|
+
};
|
|
@@ -1,57 +1,65 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Auto-generated symbol-to-subpath mapping and ESLint rule for Versaur
|
|
3
|
+
* Run dist/utils/lint-rules.cjs to update
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
const symbolToSubpath = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Breadcrumbs:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
7
|
+
"LoadingIndicator": "feedbacks",
|
|
8
|
+
"ProgressIndicator": "feedbacks",
|
|
9
|
+
"Skeleton": "feedbacks",
|
|
10
|
+
"CheckboxInput": "forms",
|
|
11
|
+
"ChipMultipleInput": "forms",
|
|
12
|
+
"ChipSingleInput": "forms",
|
|
13
|
+
"DateSinglePickerInput": "forms",
|
|
14
|
+
"EmailInput": "forms",
|
|
15
|
+
"PriceInput": "forms",
|
|
16
|
+
"RadioInput": "forms",
|
|
17
|
+
"SearchInput": "forms",
|
|
18
|
+
"SegmentMultipleInput": "forms",
|
|
19
|
+
"SegmentSingleInput": "forms",
|
|
20
|
+
"SelectInput": "forms",
|
|
21
|
+
"SwitchInput": "forms",
|
|
22
|
+
"TextInput": "forms",
|
|
23
|
+
"TextAreaInput": "forms",
|
|
24
|
+
"TimePickerInput": "forms",
|
|
25
|
+
"AppBar": "layouts",
|
|
26
|
+
"BottomBar": "layouts",
|
|
27
|
+
"FormLayout": "layouts",
|
|
28
|
+
"PageLayout": "layouts",
|
|
29
|
+
"TopBar": "layouts",
|
|
30
|
+
"Breadcrumbs": "navigation",
|
|
31
|
+
"Tabs": "navigation",
|
|
32
|
+
"BottomSheet": "overlays",
|
|
33
|
+
"Drawer": "overlays",
|
|
34
|
+
"Menu": "overlays",
|
|
35
|
+
"Modal": "overlays",
|
|
36
|
+
"Alert": "primitive",
|
|
37
|
+
"Anchor": "primitive",
|
|
38
|
+
"Avatar": "primitive",
|
|
39
|
+
"Badge": "primitive",
|
|
40
|
+
"Brand": "primitive",
|
|
41
|
+
"Button": "primitive",
|
|
42
|
+
"ButtonFloat": "primitive",
|
|
43
|
+
"ButtonIcon": "primitive",
|
|
44
|
+
"Calculator": "primitive",
|
|
45
|
+
"Calendar": "primitive",
|
|
46
|
+
"DescriptionList": "primitive",
|
|
47
|
+
"Icon": "primitive",
|
|
48
|
+
"Snackbar": "primitive",
|
|
49
|
+
"Table": "primitive",
|
|
50
|
+
"Text": "primitive",
|
|
51
|
+
"Tile": "primitive",
|
|
52
|
+
"SnackbarsProvider": "providers",
|
|
53
|
+
"useSnackbars": "providers",
|
|
54
|
+
"cn": "utils",
|
|
55
|
+
"cva": "utils",
|
|
56
|
+
"createVariants": "utils"
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* ESLint rule for Versaur: enforce sub-path imports for optimal tree-shaking (Flat config compatible)
|
|
61
|
+
* This file expects a symbolToSubpath object to be defined in the scope before it is loaded.
|
|
62
|
+
*/
|
|
55
63
|
|
|
56
64
|
const rules = {
|
|
57
65
|
meta: {
|
|
@@ -116,7 +124,9 @@ const rules = {
|
|
|
116
124
|
},
|
|
117
125
|
}
|
|
118
126
|
|
|
119
|
-
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
// Compose the config for ESLint Flat config usage
|
|
120
130
|
export const versaurEnforceSubpathImport = [
|
|
121
131
|
{
|
|
122
132
|
plugins: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimasbaguspm/versaur",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
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",
|
|
@@ -38,14 +38,18 @@
|
|
|
38
38
|
"import": "./dist/js/overlays/index.js",
|
|
39
39
|
"types": "./dist/types/overlays/index.d.ts"
|
|
40
40
|
},
|
|
41
|
-
"./
|
|
42
|
-
|
|
41
|
+
"./providers": {
|
|
42
|
+
"import": "./dist/js/providers/index.js",
|
|
43
|
+
"types": "./dist/types/providers/index.d.ts"
|
|
44
|
+
},
|
|
45
|
+
"./styles.css": "./dist/assets/styles.css",
|
|
46
|
+
"./eslint-subpath-import": "./dist/utils/enforce-subpath-import.js"
|
|
43
47
|
},
|
|
44
48
|
"files": [
|
|
45
49
|
"dist"
|
|
46
50
|
],
|
|
47
51
|
"scripts": {
|
|
48
|
-
"build": "tsc && vite build",
|
|
52
|
+
"build": "tsc && vite build && node scripts/post-build.cjs",
|
|
49
53
|
"typecheck": "tsc --noEmit",
|
|
50
54
|
"lint": "eslint .",
|
|
51
55
|
"lint:fix": "eslint . --fix",
|