@dimasbaguspm/versaur 0.0.6 → 0.0.8
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/components/app-bar/app-bar.atoms.d.ts +5 -1
- package/dist/components/app-bar/app-bar.d.ts +1 -0
- package/dist/components/app-bar/app-bar.stories.d.ts +2 -0
- package/dist/components/app-bar/types.d.ts +6 -0
- package/dist/components/calculator/calculator.atoms.d.ts +2 -0
- package/dist/components/calculator/calculator.d.ts +2 -0
- package/dist/components/calculator/calculator.stories.d.ts +8 -0
- package/dist/components/calculator/helpers.d.ts +7 -0
- package/dist/components/calculator/index.d.ts +2 -0
- package/dist/components/calculator/types.d.ts +29 -0
- package/dist/components/calculator/use-calculator.d.ts +11 -0
- package/dist/components/calculator-input/calculator-input.atoms.d.ts +11 -0
- package/dist/components/calculator-input/calculator-input.d.ts +8 -0
- package/dist/components/calculator-input/calculator-input.stories.d.ts +8 -0
- package/dist/components/calculator-input/helpers.d.ts +3 -0
- package/dist/components/calculator-input/index.d.ts +1 -0
- package/dist/components/calculator-input/types.d.ts +51 -0
- package/dist/components/drawer/drawer.stories.d.ts +1 -0
- package/dist/components/drawer/helpers.d.ts +1 -0
- package/dist/components/drawer/index.d.ts +1 -9
- package/dist/components/drawer/types.d.ts +8 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/page-layout/helpers.d.ts +6 -0
- package/dist/components/page-layout/index.d.ts +1 -0
- package/dist/components/page-layout/page-layout.d.ts +8 -0
- package/dist/components/page-layout/page-layout.stories.d.ts +8 -0
- package/dist/components/page-layout/types.d.ts +20 -0
- package/dist/components/table/context.d.ts +3 -0
- package/dist/components/table/helpers.d.ts +2 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/table.atoms.d.ts +22 -0
- package/dist/components/table/table.d.ts +8 -0
- package/dist/components/table/table.stories.d.ts +27 -0
- package/dist/components/table/types.d.ts +51 -0
- package/dist/components/time-picker-input/helpers.d.ts +4 -0
- package/dist/components/time-picker-input/index.d.ts +2 -0
- package/dist/components/time-picker-input/time-picker-input.atoms.d.ts +15 -0
- package/dist/components/time-picker-input/time-picker-input.d.ts +9 -0
- package/dist/components/time-picker-input/time-picker-input.stories.d.ts +7 -0
- package/dist/components/time-picker-input/types.d.ts +47 -0
- package/dist/hooks/use-floating-position/index.d.ts +1 -0
- package/dist/hooks/use-floating-position/use-floating-position.d.ts +12 -0
- package/dist/index.js +2820 -2160
- package/dist/styles.css +11 -11
- package/package.json +1 -1
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { AppBarLeadingProps, AppBarHeadlineProps, AppBarSubtitleProps, AppBarTrailingProps, AppBarCenterProps } from './types';
|
|
1
|
+
import { AppBarLeadingProps, AppBarHeadlineProps, AppBarSubtitleProps, AppBarTrailingProps, AppBarCenterProps, AppBarBottomProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Bottom section (flexible area for additional content, e.g. tabs)
|
|
4
|
+
*/
|
|
5
|
+
export declare const AppBarBottom: import('react').ForwardRefExoticComponent<AppBarBottomProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
2
6
|
/**
|
|
3
7
|
* Leading section (logo, nav icon)
|
|
4
8
|
*/
|
|
@@ -5,4 +5,5 @@ export declare const AppBar: (({ children, className, variant, }: AppBarProps) =
|
|
|
5
5
|
Subtitle: import('react').ForwardRefExoticComponent<import('./types').AppBarSubtitleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
6
|
Trailing: import('react').ForwardRefExoticComponent<import('./types').AppBarTrailingProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
7
|
Center: import('react').ForwardRefExoticComponent<import('./types').AppBarCenterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
Bottom: import('react').ForwardRefExoticComponent<import('./types').AppBarBottomProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
9
|
};
|
|
@@ -8,6 +8,7 @@ declare const meta: {
|
|
|
8
8
|
Subtitle: import('react').ForwardRefExoticComponent<import('./types').AppBarSubtitleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
9
|
Trailing: import('react').ForwardRefExoticComponent<import('./types').AppBarTrailingProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
10
|
Center: import('react').ForwardRefExoticComponent<import('./types').AppBarCenterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
11
|
+
Bottom: import('react').ForwardRefExoticComponent<import('./types').AppBarBottomProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
11
12
|
};
|
|
12
13
|
parameters: {
|
|
13
14
|
layout: string;
|
|
@@ -17,3 +18,4 @@ export default meta;
|
|
|
17
18
|
type Story = StoryObj<typeof AppBar>;
|
|
18
19
|
export declare const Home: Story;
|
|
19
20
|
export declare const Detail: Story;
|
|
21
|
+
export declare const WithBottom: Story;
|
|
@@ -37,3 +37,9 @@ export interface AppBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
37
37
|
children: React.ReactNode;
|
|
38
38
|
variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'neutral';
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Props for AppBarBottom (bottom area for additional content)
|
|
42
|
+
*/
|
|
43
|
+
export interface AppBarBottomProps extends HTMLAttributes<HTMLDivElement> {
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Calculator } from './calculator';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: Meta<typeof Calculator>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Calculator>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithInitialValue: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const calculatorRootVariants: (props?: ({
|
|
2
|
+
disabled?: boolean | null | undefined;
|
|
3
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
4
|
+
export declare const calculatorButtonVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "danger" | "operator" | "action" | null | undefined;
|
|
6
|
+
disabled?: boolean | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for Calculator component
|
|
4
|
+
*/
|
|
5
|
+
export interface CalculatorProps {
|
|
6
|
+
/**
|
|
7
|
+
* Initial value to display in the calculator input
|
|
8
|
+
*/
|
|
9
|
+
initialValue?: string | number;
|
|
10
|
+
/**
|
|
11
|
+
* Callback when the value changes (on equals or input)
|
|
12
|
+
*/
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
/**
|
|
15
|
+
* If true, disables all calculator input
|
|
16
|
+
*/
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Optional className for the calculator root
|
|
20
|
+
*/
|
|
21
|
+
className?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional aria-label for accessibility
|
|
24
|
+
*/
|
|
25
|
+
'aria-label'?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CalculatorButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
28
|
+
variant?: 'default' | 'action' | 'operator' | 'danger';
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface UseCalculatorOptions {
|
|
2
|
+
initialValue?: string | number;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
onChange?: (value: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function useCalculator({ initialValue, disabled, onChange, }: UseCalculatorOptions): {
|
|
7
|
+
input: string;
|
|
8
|
+
inputRef: import('react').RefObject<HTMLInputElement | null>;
|
|
9
|
+
handleButton: (val: string) => void;
|
|
10
|
+
handleInput: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CalculatorInputProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* CalculatorInputField is the input field for CalculatorInput
|
|
4
|
+
*/
|
|
5
|
+
export interface CalculatorInputFieldProps extends Omit<CalculatorInputProps, 'onChange'> {
|
|
6
|
+
onChange: (value: number | '') => void;
|
|
7
|
+
onClick?: React.MouseEventHandler<HTMLInputElement>;
|
|
8
|
+
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const CalculatorInputField: import('react').ForwardRefExoticComponent<CalculatorInputFieldProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { CalculatorInput } from './calculator-input';
|
|
3
|
+
declare const meta: Meta<typeof CalculatorInput>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof CalculatorInput>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const WithError: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './calculator-input';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CalculatorProps } from '../calculator/types';
|
|
2
|
+
import { ModalRootProps } from '../modal/types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for CalculatorInput component
|
|
5
|
+
*/
|
|
6
|
+
export interface CalculatorInputProps extends Omit<CalculatorProps, 'value' | 'onChange'> {
|
|
7
|
+
/**
|
|
8
|
+
* The value of the input (number or empty string)
|
|
9
|
+
*/
|
|
10
|
+
value: number | '';
|
|
11
|
+
/**
|
|
12
|
+
* Called when the value changes
|
|
13
|
+
*/
|
|
14
|
+
onChange: (value: number | '') => void;
|
|
15
|
+
/**
|
|
16
|
+
* Label text to display above the input
|
|
17
|
+
*/
|
|
18
|
+
label?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Helper text to display below the input
|
|
21
|
+
*/
|
|
22
|
+
helperText?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Error message for invalid state
|
|
25
|
+
*/
|
|
26
|
+
error?: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Placeholder text for the input
|
|
29
|
+
*/
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
/**
|
|
32
|
+
* If true, disables the input
|
|
33
|
+
*/
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Modal props for customizing the modal behavior
|
|
37
|
+
*/
|
|
38
|
+
modalProps?: Partial<ModalRootProps>;
|
|
39
|
+
/**
|
|
40
|
+
* Optional: ARIA label for dialog
|
|
41
|
+
*/
|
|
42
|
+
'aria-label'?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Optional: ARIA labelledby for dialog
|
|
45
|
+
*/
|
|
46
|
+
'aria-labelledby'?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Optional: ARIA describedby for dialog
|
|
49
|
+
*/
|
|
50
|
+
'aria-describedby'?: string;
|
|
51
|
+
}
|
|
@@ -14,6 +14,7 @@ export declare const drawerVariants: (props?: ({
|
|
|
14
14
|
position?: "right" | "left" | null | undefined;
|
|
15
15
|
size?: "sm" | "md" | "lg" | "xl" | "3/4" | "full" | null | undefined;
|
|
16
16
|
variant?: "default" | "glass" | null | undefined;
|
|
17
|
+
transitionType?: "slide" | "fade" | null | undefined;
|
|
17
18
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
18
19
|
/**
|
|
19
20
|
* Drawer header variants
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Drawer component exports
|
|
3
|
-
*
|
|
4
|
-
* Provides a sliding drawer overlay component with compound pattern
|
|
5
|
-
* Supports left/right positioning, multiple sizes, and glass variant
|
|
6
|
-
*/
|
|
7
1
|
export { Drawer } from './drawer';
|
|
8
|
-
export
|
|
9
|
-
export { useDrawerContext } from './context';
|
|
10
|
-
export type { DrawerProps, DrawerHeaderProps, DrawerBodyProps, DrawerFooterProps, DrawerOverlayProps, DrawerContextValue, DrawerPosition, DrawerSize, DrawerVariant, DrawerVariantProps, } from './types';
|
|
2
|
+
export type * from './types';
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import { VariantProps } from '../../utils/variants';
|
|
3
3
|
import { drawerVariants } from './helpers';
|
|
4
|
+
/**
|
|
5
|
+
* Drawer transition type options
|
|
6
|
+
*/
|
|
7
|
+
export type DrawerTransitionType = 'slide' | 'fade';
|
|
4
8
|
/**
|
|
5
9
|
* Base drawer variant props derived from the drawer variants
|
|
6
10
|
*/
|
|
@@ -31,6 +35,8 @@ export interface DrawerContextValue {
|
|
|
31
35
|
size: DrawerSize;
|
|
32
36
|
/** Drawer variant */
|
|
33
37
|
variant: DrawerVariant;
|
|
38
|
+
/** Drawer transition type */
|
|
39
|
+
transitionType: DrawerTransitionType;
|
|
34
40
|
}
|
|
35
41
|
/**
|
|
36
42
|
* Props for the Drawer component (controlled component)
|
|
@@ -46,6 +52,8 @@ export interface DrawerProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
46
52
|
size?: DrawerSize;
|
|
47
53
|
/** Drawer variant */
|
|
48
54
|
variant?: DrawerVariant;
|
|
55
|
+
/** Drawer transition type */
|
|
56
|
+
transitionType?: DrawerTransitionType;
|
|
49
57
|
/** Children components */
|
|
50
58
|
children: ReactNode;
|
|
51
59
|
/** Additional CSS classes */
|
|
@@ -7,6 +7,8 @@ export * from './breadcrumbs';
|
|
|
7
7
|
export * from './button';
|
|
8
8
|
export * from './button-icon';
|
|
9
9
|
export * from './button-float';
|
|
10
|
+
export * from './calculator';
|
|
11
|
+
export * from './calculator-input';
|
|
10
12
|
export * from './calendar';
|
|
11
13
|
export * from './checkbox-input';
|
|
12
14
|
export * from './chip-input';
|
|
@@ -19,12 +21,15 @@ export * from './segment-single-input';
|
|
|
19
21
|
export * from './segment-multiple-input';
|
|
20
22
|
export * from './select-input';
|
|
21
23
|
export * from './snackbar';
|
|
24
|
+
export * from './table';
|
|
22
25
|
export * from './tabs';
|
|
23
26
|
export * from './text';
|
|
24
27
|
export * from './text-input';
|
|
25
28
|
export * from './textarea-input';
|
|
26
29
|
export * from './tile';
|
|
30
|
+
export * from './time-picker-input';
|
|
27
31
|
export * from './top-bar';
|
|
28
32
|
export * from './loading-indicator';
|
|
33
|
+
export * from './page-layout';
|
|
29
34
|
export * from './switch-input';
|
|
30
35
|
export * from './skeleton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './page-layout';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PageLayoutProps } from './types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* PageLayout component for consistent responsive layout breakpoints
|
|
5
|
+
*
|
|
6
|
+
* @group Layout
|
|
7
|
+
*/
|
|
8
|
+
export declare const PageLayout: React.ForwardRefExoticComponent<PageLayoutProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { PageLayout } from './page-layout';
|
|
3
|
+
declare const meta: Meta<typeof PageLayout>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof PageLayout>;
|
|
6
|
+
export declare const Desktop: Story;
|
|
7
|
+
export declare const Tablet: Story;
|
|
8
|
+
export declare const Mobile: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the PageLayout component
|
|
3
|
+
*/
|
|
4
|
+
export interface PageLayoutProps {
|
|
5
|
+
/**
|
|
6
|
+
* The layout type to use for breakpoint consistency
|
|
7
|
+
* - 'desktop': For large screens (default)
|
|
8
|
+
* - 'tablet': For medium screens
|
|
9
|
+
* - 'mobile': For small screens
|
|
10
|
+
*/
|
|
11
|
+
type?: 'desktop' | 'tablet' | 'mobile';
|
|
12
|
+
/**
|
|
13
|
+
* Content to render inside the layout
|
|
14
|
+
*/
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Additional class names to apply to the root element
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TableHeaderProps, TableBodyProps, TableFooterProps, TableRowProps, TableColumnProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Table.Header renders the table header row (grid-based, ARIA role)
|
|
4
|
+
*/
|
|
5
|
+
declare const TableHeader: import('react').ForwardRefExoticComponent<TableHeaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
/**
|
|
7
|
+
* Table.Body renders the table body (grid-based, ARIA role)
|
|
8
|
+
*/
|
|
9
|
+
declare const TableBody: import('react').ForwardRefExoticComponent<TableBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
|
+
/**
|
|
11
|
+
* Table.Footer renders the table footer row (grid-based, ARIA role)
|
|
12
|
+
*/
|
|
13
|
+
declare const TableFooter: import('react').ForwardRefExoticComponent<TableFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
/**
|
|
15
|
+
* Table.Row renders a table row (grid-based, ARIA role)
|
|
16
|
+
*/
|
|
17
|
+
declare const TableRow: import('react').ForwardRefExoticComponent<TableRowProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
18
|
+
/**
|
|
19
|
+
* Table.Column renders a table cell (grid-based, ARIA role)
|
|
20
|
+
*/
|
|
21
|
+
declare const TableColumn: import('react').ForwardRefExoticComponent<TableColumnProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export { TableHeader, TableBody, TableFooter, TableRow, TableColumn };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TableProps } from './types';
|
|
2
|
+
export declare const Table: import('react').ForwardRefExoticComponent<TableProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
3
|
+
Header: import('react').ForwardRefExoticComponent<import('./types').TableHeaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
|
+
Body: import('react').ForwardRefExoticComponent<import('./types').TableBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
Footer: import('react').ForwardRefExoticComponent<import('./types').TableFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
Row: import('react').ForwardRefExoticComponent<import('./types').TableRowProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
|
+
Column: import('react').ForwardRefExoticComponent<import('./types').TableColumnProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: import('react').ForwardRefExoticComponent<import('./types').TableProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
4
|
+
Header: import('react').ForwardRefExoticComponent<import('./types').TableHeaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
Body: import('react').ForwardRefExoticComponent<import('./types').TableBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
Footer: import('react').ForwardRefExoticComponent<import('./types').TableFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
|
+
Row: import('react').ForwardRefExoticComponent<import('./types').TableRowProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
Column: import('react').ForwardRefExoticComponent<import('./types').TableColumnProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
|
+
};
|
|
10
|
+
parameters: {
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
19
|
+
export declare const Basic: () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* ColumnSpan story demonstrates various column span (1-12) and mixed widths
|
|
22
|
+
*/
|
|
23
|
+
export declare const ColumnSpan: () => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* Alignment story demonstrates left, center, and right alignment in TableColumn
|
|
26
|
+
*/
|
|
27
|
+
export declare const Alignment: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode, TableHTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* TableProps for the root Table component
|
|
4
|
+
*/
|
|
5
|
+
export interface TableProps extends TableHTMLAttributes<HTMLTableElement> {
|
|
6
|
+
/** Table children (Header, Body, Footer, etc) */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
maxColumns?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Context value for Table
|
|
12
|
+
*/
|
|
13
|
+
export interface TableContextValue {
|
|
14
|
+
maxColumns: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* TableHeaderProps for <Table.Header>
|
|
18
|
+
*/
|
|
19
|
+
export interface TableHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* TableBodyProps for <Table.Body>
|
|
24
|
+
*/
|
|
25
|
+
export interface TableBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* TableFooterProps for <Table.Footer>
|
|
30
|
+
*/
|
|
31
|
+
export interface TableFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* TableRowProps for <Table.Row>
|
|
36
|
+
*/
|
|
37
|
+
export interface TableRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* TableColumnProps for <Table.Column>
|
|
42
|
+
* @property as - 'th' for header, 'td' for body/footer (default: 'td')
|
|
43
|
+
* @property span - number of grid columns to span (1-12)
|
|
44
|
+
*/
|
|
45
|
+
export interface TableColumnProps extends HTMLAttributes<HTMLDivElement> {
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
as: 'th' | 'td';
|
|
48
|
+
span: number;
|
|
49
|
+
/** Horizontal alignment of cell content (left, center, right). Default: left */
|
|
50
|
+
align?: 'left' | 'center' | 'right';
|
|
51
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface TimeFieldProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (val: string) => void;
|
|
5
|
+
label: string;
|
|
6
|
+
'aria-label'?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const TimeField: React.FC<TimeFieldProps>;
|
|
10
|
+
export interface AmPmSegmentProps {
|
|
11
|
+
value: 'AM' | 'PM';
|
|
12
|
+
onChange: (val: 'AM' | 'PM') => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const AmPmSegment: React.FC<AmPmSegmentProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TimePickerInputProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* TimePickerInput component for Versaur UI
|
|
5
|
+
*
|
|
6
|
+
* Provides a modal-based time picker with hour, minute, and AM/PM selection
|
|
7
|
+
* Follows Material 3 guidelines (no clock UI)
|
|
8
|
+
*/
|
|
9
|
+
export declare const TimePickerInput: React.FC<TimePickerInputProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TimePickerInput } from './time-picker-input';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: Meta<typeof TimePickerInput>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof TimePickerInput>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const WithError: Story;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ModalRootProps } from '../modal';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the TimePickerInput component
|
|
5
|
+
*/
|
|
6
|
+
export interface TimePickerInputProps {
|
|
7
|
+
/**
|
|
8
|
+
* The selected time value in 12-hour format (e.g., '02:30 PM')
|
|
9
|
+
*/
|
|
10
|
+
value: string;
|
|
11
|
+
/**
|
|
12
|
+
* Called when the time value changes
|
|
13
|
+
*/
|
|
14
|
+
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFloatingPosition } from './use-floating-position';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefCallback, CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* useFloatingPositionSticky
|
|
4
|
+
* Determines the correct positioning and style for a floating element that should always be visible
|
|
5
|
+
* at the bottom right of a scrollable container, even if the container is taller than the viewport.
|
|
6
|
+
*
|
|
7
|
+
* Returns:
|
|
8
|
+
* - containerRef: attach to the container div
|
|
9
|
+
* - style: CSSProperties for the button (position, bottom, right, transform)
|
|
10
|
+
* - positionClass: string for Tailwind/utility classes
|
|
11
|
+
*/
|
|
12
|
+
export declare function useFloatingPosition(side: 'right' | 'left', offset?: string): [RefCallback<HTMLDivElement>, CSSProperties, string];
|