@app-studio/web 0.8.72 → 0.8.74
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/Accordion/Accordion/Accordion.props.d.ts +91 -0
- package/dist/components/Accordion/Accordion/Accordion.state.d.ts +5 -0
- package/dist/components/Accordion/Accordion/Accordion.style.d.ts +4 -0
- package/dist/components/Accordion/Accordion/Accordion.type.d.ts +15 -0
- package/dist/components/Accordion/Accordion/Accordion.view.d.ts +22 -0
- package/dist/components/Accordion/Accordion.d.ts +2 -0
- package/dist/components/Accordion/examples/default.d.ts +2 -0
- package/dist/components/Accordion/examples/disabled.d.ts +2 -0
- package/dist/components/Accordion/examples/index.d.ts +4 -0
- package/dist/components/Accordion/examples/multiple.d.ts +2 -0
- package/dist/components/Accordion/examples/variants.d.ts +2 -0
- package/dist/components/ContextMenu/ContextMenu/ContextMenu.props.d.ts +120 -0
- package/dist/components/ContextMenu/ContextMenu/ContextMenu.state.d.ts +15 -0
- package/dist/components/ContextMenu/ContextMenu/ContextMenu.style.d.ts +20 -0
- package/dist/components/ContextMenu/ContextMenu/ContextMenu.type.d.ts +41 -0
- package/dist/components/ContextMenu/ContextMenu/ContextMenu.view.d.ts +20 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +2 -0
- package/dist/components/ContextMenu/examples/custom.d.ts +2 -0
- package/dist/components/ContextMenu/examples/default.d.ts +2 -0
- package/dist/components/ContextMenu/examples/index.d.ts +4 -0
- package/dist/components/ContextMenu/examples/sizes.d.ts +2 -0
- package/dist/components/ContextMenu/examples/variants.d.ts +2 -0
- package/dist/components/DropdownMenu/DropdownMenu/DropdownMenu.props.d.ts +117 -0
- package/dist/components/DropdownMenu/DropdownMenu/DropdownMenu.state.d.ts +7 -0
- package/dist/components/DropdownMenu/DropdownMenu/DropdownMenu.style.d.ts +17 -0
- package/dist/components/DropdownMenu/DropdownMenu/DropdownMenu.type.d.ts +34 -0
- package/dist/components/DropdownMenu/DropdownMenu/DropdownMenu.view.d.ts +19 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +2 -0
- package/dist/components/DropdownMenu/examples/custom.d.ts +2 -0
- package/dist/components/DropdownMenu/examples/default.d.ts +2 -0
- package/dist/components/DropdownMenu/examples/index.d.ts +5 -0
- package/dist/components/DropdownMenu/examples/positions.d.ts +2 -0
- package/dist/components/DropdownMenu/examples/sizes.d.ts +2 -0
- package/dist/components/DropdownMenu/examples/variants.d.ts +2 -0
- package/dist/components/Form/Password/Password/Password.state.d.ts +1 -1
- package/dist/components/Formik/Formik.Slider.d.ts +7 -0
- package/dist/components/Formik/examples/FormikSlider.d.ts +2 -0
- package/dist/components/Formik/examples/index.d.ts +1 -0
- package/dist/components/Formik/index.d.ts +1 -0
- package/dist/components/HoverCard/HoverCard/HoverCard.props.d.ts +65 -0
- package/dist/components/HoverCard/HoverCard/HoverCard.state.d.ts +5 -0
- package/dist/components/HoverCard/HoverCard/HoverCard.style.d.ts +3 -0
- package/dist/components/HoverCard/HoverCard/HoverCard.type.d.ts +6 -0
- package/dist/components/HoverCard/HoverCard/HoverCard.view.d.ts +10 -0
- package/dist/components/HoverCard/HoverCard.d.ts +2 -0
- package/dist/components/HoverCard/examples/default.d.ts +2 -0
- package/dist/components/HoverCard/examples/index.d.ts +1 -0
- package/dist/components/Icon/Icon.d.ts +3 -0
- package/dist/components/NavigationMenu/NavigationMenu/NavigationMenu.props.d.ts +126 -0
- package/dist/components/NavigationMenu/NavigationMenu/NavigationMenu.state.d.ts +8 -0
- package/dist/components/NavigationMenu/NavigationMenu/NavigationMenu.style.d.ts +18 -0
- package/dist/components/NavigationMenu/NavigationMenu/NavigationMenu.type.d.ts +34 -0
- package/dist/components/NavigationMenu/NavigationMenu/NavigationMenu.view.d.ts +19 -0
- package/dist/components/NavigationMenu/NavigationMenu.d.ts +2 -0
- package/dist/components/NavigationMenu/examples/default.d.ts +2 -0
- package/dist/components/NavigationMenu/examples/horizontal.d.ts +2 -0
- package/dist/components/NavigationMenu/examples/index.d.ts +4 -0
- package/dist/components/NavigationMenu/examples/sizes.d.ts +2 -0
- package/dist/components/NavigationMenu/examples/variants.d.ts +2 -0
- package/dist/components/Slider/Slider/Slider.props.d.ts +112 -0
- package/dist/components/Slider/Slider/Slider.state.d.ts +14 -0
- package/dist/components/Slider/Slider/Slider.style.d.ts +11 -0
- package/dist/components/Slider/Slider/Slider.type.d.ts +18 -0
- package/dist/components/Slider/Slider/Slider.view.d.ts +3 -0
- package/dist/components/Slider/Slider.d.ts +6 -0
- package/dist/components/Slider/examples/controlled.d.ts +2 -0
- package/dist/components/Slider/examples/custom.d.ts +2 -0
- package/dist/components/Slider/examples/default.d.ts +2 -0
- package/dist/components/Slider/examples/disabled.d.ts +2 -0
- package/dist/components/Slider/examples/range.d.ts +2 -0
- package/dist/components/Slider/examples/shapes.d.ts +2 -0
- package/dist/components/Slider/examples/sizes.d.ts +2 -0
- package/dist/components/Slider/examples/stepValues.d.ts +3 -0
- package/dist/components/Slider/examples/tooltip.d.ts +2 -0
- package/dist/components/Slider/examples/variants.d.ts +2 -0
- package/dist/components/Slider/examples/vertical.d.ts +2 -0
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +8 -8
- package/dist/components/index.d.ts +11 -0
- package/dist/pages/accordion.page.d.ts +3 -0
- package/dist/pages/components.page.d.ts +5 -0
- package/dist/pages/contextMenu.page.d.ts +3 -0
- package/dist/pages/dropdownMenu.page.d.ts +3 -0
- package/dist/pages/hoverCard.page.d.ts +3 -0
- package/dist/pages/navigationMenu.page.d.ts +3 -0
- package/dist/pages/slider.page.d.ts +3 -0
- package/dist/web.cjs.development.js +2546 -384
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +2539 -387
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +2594 -433
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/utils/componentsPageImports.d.ts +0 -6
|
@@ -4,6 +4,7 @@ export * from './FormikCountryPicker';
|
|
|
4
4
|
export * from './FormikDatePicker';
|
|
5
5
|
export * from './FormikPassword';
|
|
6
6
|
export * from './FormikSelect';
|
|
7
|
+
export * from './FormikSlider';
|
|
7
8
|
export * from './FormikSwitch';
|
|
8
9
|
export * from './FormikTextArea';
|
|
9
10
|
export * from './FormikTextField';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewProps } from 'app-studio';
|
|
3
|
+
export interface HoverCardProps {
|
|
4
|
+
/**
|
|
5
|
+
* The content of the HoverCard
|
|
6
|
+
*/
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Custom styles for different parts of the HoverCard
|
|
10
|
+
*/
|
|
11
|
+
views?: {
|
|
12
|
+
container?: ViewProps;
|
|
13
|
+
content?: ViewProps;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface HoverCardTriggerProps {
|
|
17
|
+
/**
|
|
18
|
+
* The element that triggers the hover card
|
|
19
|
+
*/
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Custom styles for the trigger element
|
|
23
|
+
*/
|
|
24
|
+
views?: {
|
|
25
|
+
container?: ViewProps;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Additional props to be spread to the trigger element
|
|
29
|
+
*/
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
|
32
|
+
export interface HoverCardContentProps {
|
|
33
|
+
/**
|
|
34
|
+
* The content to be displayed in the hover card
|
|
35
|
+
*/
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Custom styles for the content container
|
|
39
|
+
*/
|
|
40
|
+
views?: {
|
|
41
|
+
container?: ViewProps;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The side of the trigger to render the content
|
|
45
|
+
*/
|
|
46
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
47
|
+
/**
|
|
48
|
+
* The alignment of the content relative to the trigger
|
|
49
|
+
*/
|
|
50
|
+
align?: 'start' | 'center' | 'end';
|
|
51
|
+
/**
|
|
52
|
+
* Additional props to be spread to the content element
|
|
53
|
+
*/
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}
|
|
56
|
+
export interface HoverCardType extends React.FC<HoverCardProps> {
|
|
57
|
+
/**
|
|
58
|
+
* The trigger element that will show the hover card on hover
|
|
59
|
+
*/
|
|
60
|
+
Trigger: React.FC<HoverCardTriggerProps>;
|
|
61
|
+
/**
|
|
62
|
+
* The content that will be displayed when hovering over the trigger
|
|
63
|
+
*/
|
|
64
|
+
Content: React.FC<HoverCardContentProps>;
|
|
65
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HoverCardContextType } from './HoverCard.type';
|
|
3
|
+
import { HoverCardContentProps, HoverCardTriggerProps } from './HoverCard.props';
|
|
4
|
+
export declare const HoverCardProvider: React.FC<{
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
value: HoverCardContextType;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const useHoverCardContext: () => HoverCardContextType;
|
|
9
|
+
export declare const HoverCardTrigger: React.FC<HoverCardTriggerProps>;
|
|
10
|
+
export declare const HoverCardContent: React.FC<HoverCardContentProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './default';
|
|
@@ -5,6 +5,8 @@ export interface IconProps extends ViewProps {
|
|
|
5
5
|
filled?: boolean;
|
|
6
6
|
orientation?: 'left' | 'right' | 'up' | 'down';
|
|
7
7
|
}
|
|
8
|
+
export declare const UserIcon: React.FC<IconProps>;
|
|
9
|
+
export declare const HelpIcon: ({ widthHeight, color, filled, strokeWidth, ...props }: IconProps) => React.JSX.Element;
|
|
8
10
|
export declare const ChevronIcon: React.FC<IconProps>;
|
|
9
11
|
export declare const DragHandleIcon: React.FC<IconProps>;
|
|
10
12
|
export declare const FileIcon: React.FC<IconProps>;
|
|
@@ -32,6 +34,7 @@ export declare const BookmarkIcon: React.FC<IconProps>;
|
|
|
32
34
|
export declare const CloudIcon: React.FC<IconProps>;
|
|
33
35
|
export declare const CopyIcon: React.FC<IconProps>;
|
|
34
36
|
export declare const DustBinIcon: React.FC<IconProps>;
|
|
37
|
+
export declare const DeleteIcon: React.FC<IconProps>;
|
|
35
38
|
export declare const EditIcon: React.FC<IconProps>;
|
|
36
39
|
export declare const ErrorIcon: React.FC<IconProps>;
|
|
37
40
|
export declare const DownloadIcon: React.FC<IconProps>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ViewProps } from 'app-studio';
|
|
3
|
+
import { NavigationItem, NavigationMenuStyles, Orientation, Size, Variant } from './NavigationMenu.type';
|
|
4
|
+
export interface NavigationMenuProps {
|
|
5
|
+
/**
|
|
6
|
+
* The items to display in the navigation menu
|
|
7
|
+
*/
|
|
8
|
+
items: NavigationItem[];
|
|
9
|
+
/**
|
|
10
|
+
* The orientation of the navigation menu
|
|
11
|
+
*/
|
|
12
|
+
orientation?: Orientation;
|
|
13
|
+
/**
|
|
14
|
+
* The size of the navigation menu items
|
|
15
|
+
*/
|
|
16
|
+
size?: Size;
|
|
17
|
+
/**
|
|
18
|
+
* The visual style variant of the navigation menu
|
|
19
|
+
*/
|
|
20
|
+
variant?: Variant;
|
|
21
|
+
/**
|
|
22
|
+
* The ID of the initially active item
|
|
23
|
+
*/
|
|
24
|
+
defaultActiveItemId?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The IDs of the initially expanded items (for items with sub-items)
|
|
27
|
+
*/
|
|
28
|
+
defaultExpandedItemIds?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Callback when an item is activated
|
|
31
|
+
*/
|
|
32
|
+
onItemActivate?: (itemId: string) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Custom styles for different parts of the navigation menu
|
|
35
|
+
*/
|
|
36
|
+
views?: NavigationMenuStyles;
|
|
37
|
+
/**
|
|
38
|
+
* Additional props to be spread to the container element
|
|
39
|
+
*/
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
}
|
|
42
|
+
export interface NavigationMenuListProps {
|
|
43
|
+
/**
|
|
44
|
+
* The content of the navigation menu list
|
|
45
|
+
*/
|
|
46
|
+
children: React.ReactNode;
|
|
47
|
+
/**
|
|
48
|
+
* Custom styles for the list
|
|
49
|
+
*/
|
|
50
|
+
views?: {
|
|
51
|
+
container?: ViewProps;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface NavigationMenuItemProps {
|
|
55
|
+
/**
|
|
56
|
+
* The navigation item data
|
|
57
|
+
*/
|
|
58
|
+
item: NavigationItem;
|
|
59
|
+
/**
|
|
60
|
+
* Custom styles for the item
|
|
61
|
+
*/
|
|
62
|
+
views?: {
|
|
63
|
+
item?: ViewProps;
|
|
64
|
+
trigger?: ViewProps;
|
|
65
|
+
content?: ViewProps;
|
|
66
|
+
icon?: ViewProps;
|
|
67
|
+
indicator?: ViewProps;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface NavigationMenuTriggerProps {
|
|
71
|
+
/**
|
|
72
|
+
* The content of the navigation menu trigger
|
|
73
|
+
*/
|
|
74
|
+
children: React.ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* The ID of the item this trigger belongs to
|
|
77
|
+
*/
|
|
78
|
+
itemId: string;
|
|
79
|
+
/**
|
|
80
|
+
* Whether the item is disabled
|
|
81
|
+
*/
|
|
82
|
+
disabled?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Custom styles for the trigger
|
|
85
|
+
*/
|
|
86
|
+
views?: {
|
|
87
|
+
container?: ViewProps;
|
|
88
|
+
icon?: ViewProps;
|
|
89
|
+
trigger?: ViewProps;
|
|
90
|
+
indicator?: ViewProps;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export interface NavigationMenuContentProps {
|
|
94
|
+
/**
|
|
95
|
+
* The content to be displayed
|
|
96
|
+
*/
|
|
97
|
+
children: React.ReactNode;
|
|
98
|
+
/**
|
|
99
|
+
* The ID of the item this content belongs to
|
|
100
|
+
*/
|
|
101
|
+
itemId: string;
|
|
102
|
+
/**
|
|
103
|
+
* Custom styles for the content
|
|
104
|
+
*/
|
|
105
|
+
views?: {
|
|
106
|
+
container?: ViewProps;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export interface NavigationMenuType extends React.FC<NavigationMenuProps> {
|
|
110
|
+
/**
|
|
111
|
+
* The list component for the navigation menu
|
|
112
|
+
*/
|
|
113
|
+
List: React.FC<NavigationMenuListProps>;
|
|
114
|
+
/**
|
|
115
|
+
* The item component for the navigation menu
|
|
116
|
+
*/
|
|
117
|
+
Item: React.FC<NavigationMenuItemProps>;
|
|
118
|
+
/**
|
|
119
|
+
* The trigger component for navigation menu items with sub-items
|
|
120
|
+
*/
|
|
121
|
+
Trigger: React.FC<NavigationMenuTriggerProps>;
|
|
122
|
+
/**
|
|
123
|
+
* The content component for navigation menu items with sub-items
|
|
124
|
+
*/
|
|
125
|
+
Content: React.FC<NavigationMenuContentProps>;
|
|
126
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const useNavigationMenuState: (defaultActiveItemId?: string | null, defaultExpandedItemIds?: string[]) => {
|
|
3
|
+
activeItemId: string | null;
|
|
4
|
+
setActiveItemId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
5
|
+
expandedItemIds: string[];
|
|
6
|
+
toggleExpandedItem: (itemId: string) => void;
|
|
7
|
+
isItemExpanded: (itemId: string) => boolean;
|
|
8
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ViewProps } from 'app-studio';
|
|
2
|
+
import { Orientation, Size, Variant } from './NavigationMenu.type';
|
|
3
|
+
export declare const NavigationMenuSizes: Record<Size, ViewProps>;
|
|
4
|
+
export declare const NavigationMenuVariants: Record<Variant, ViewProps>;
|
|
5
|
+
export declare const NavigationMenuOrientations: Record<Orientation, ViewProps>;
|
|
6
|
+
export declare const NavigationMenuItemStates: {
|
|
7
|
+
active: {
|
|
8
|
+
backgroundColor: string;
|
|
9
|
+
fontWeight: string;
|
|
10
|
+
};
|
|
11
|
+
hover: {
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
};
|
|
14
|
+
disabled: {
|
|
15
|
+
opacity: number;
|
|
16
|
+
cursor: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ViewProps } from 'app-studio';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare type Orientation = 'horizontal' | 'vertical';
|
|
4
|
+
export declare type Size = 'sm' | 'md' | 'lg';
|
|
5
|
+
export declare type Variant = 'default' | 'filled' | 'outline';
|
|
6
|
+
export interface NavigationItem {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
href?: string;
|
|
11
|
+
items?: NavigationItem[];
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface NavigationMenuContextType {
|
|
15
|
+
activeItemId: string | null;
|
|
16
|
+
setActiveItemId: (id: string | null) => void;
|
|
17
|
+
expandedItemIds: string[];
|
|
18
|
+
toggleExpandedItem: (id: string) => void;
|
|
19
|
+
isItemExpanded: (id: string) => boolean;
|
|
20
|
+
onItemActivate?: (itemId: string) => void;
|
|
21
|
+
orientation: Orientation;
|
|
22
|
+
size: Size;
|
|
23
|
+
variant: Variant;
|
|
24
|
+
}
|
|
25
|
+
export interface NavigationMenuStyles {
|
|
26
|
+
container?: ViewProps;
|
|
27
|
+
list?: ViewProps;
|
|
28
|
+
item?: ViewProps;
|
|
29
|
+
activeItem?: ViewProps;
|
|
30
|
+
content?: ViewProps;
|
|
31
|
+
trigger?: ViewProps;
|
|
32
|
+
icon?: ViewProps;
|
|
33
|
+
indicator?: ViewProps;
|
|
34
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavigationMenuContextType, NavigationItem, Orientation, Size, Variant } from './NavigationMenu.type';
|
|
3
|
+
import { NavigationMenuItemProps, NavigationMenuListProps, NavigationMenuTriggerProps, NavigationMenuContentProps } from './NavigationMenu.props';
|
|
4
|
+
export declare const NavigationMenuProvider: React.FC<{
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
value: NavigationMenuContextType;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const useNavigationMenuContext: () => NavigationMenuContextType;
|
|
9
|
+
export declare const NavigationMenuList: React.FC<NavigationMenuListProps>;
|
|
10
|
+
export declare const NavigationMenuItem: React.FC<NavigationMenuItemProps>;
|
|
11
|
+
export declare const NavigationMenuTrigger: React.FC<NavigationMenuTriggerProps>;
|
|
12
|
+
export declare const NavigationMenuContent: React.FC<NavigationMenuContentProps>;
|
|
13
|
+
export declare const NavigationMenuView: React.FC<{
|
|
14
|
+
items: NavigationItem[];
|
|
15
|
+
orientation: Orientation;
|
|
16
|
+
size: Size;
|
|
17
|
+
variant: Variant;
|
|
18
|
+
views?: any;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputProps, ViewProps } from 'app-studio';
|
|
3
|
+
import { Orientation, Shape, Size, SliderStyles, Variant } from './Slider.type';
|
|
4
|
+
export interface SliderProps extends Omit<InputProps, 'size' | 'onChange'> {
|
|
5
|
+
/**
|
|
6
|
+
* The minimum value of the slider
|
|
7
|
+
*/
|
|
8
|
+
min?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The maximum value of the slider
|
|
11
|
+
*/
|
|
12
|
+
max?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The current value of the slider
|
|
15
|
+
*/
|
|
16
|
+
value?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The default value of the slider (uncontrolled)
|
|
19
|
+
*/
|
|
20
|
+
defaultValue?: number;
|
|
21
|
+
/**
|
|
22
|
+
* The step value for the slider
|
|
23
|
+
*/
|
|
24
|
+
step?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Array of specific values to use as steps
|
|
27
|
+
* When provided, the slider will only allow these values
|
|
28
|
+
*/
|
|
29
|
+
stepValues?: number[];
|
|
30
|
+
/**
|
|
31
|
+
* The shape of the slider
|
|
32
|
+
*/
|
|
33
|
+
shape?: Shape;
|
|
34
|
+
/**
|
|
35
|
+
* The size of the slider
|
|
36
|
+
*/
|
|
37
|
+
size?: Size;
|
|
38
|
+
/**
|
|
39
|
+
* The variant of the slider
|
|
40
|
+
*/
|
|
41
|
+
variant?: Variant;
|
|
42
|
+
/**
|
|
43
|
+
* The orientation of the slider
|
|
44
|
+
*/
|
|
45
|
+
orientation?: Orientation;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the slider is disabled
|
|
48
|
+
*/
|
|
49
|
+
isDisabled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether to show the current value label
|
|
52
|
+
*/
|
|
53
|
+
showValue?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* If true, a tooltip showing the current value will appear on hover/drag
|
|
56
|
+
*/
|
|
57
|
+
showTooltip?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Custom label for the slider
|
|
60
|
+
*/
|
|
61
|
+
label?: React.ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* Helper text to display below the slider
|
|
64
|
+
*/
|
|
65
|
+
helperText?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Callback function when the value changes
|
|
68
|
+
*/
|
|
69
|
+
onChange?: (value: number) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Callback function when the slider is being dragged
|
|
72
|
+
*/
|
|
73
|
+
onDrag?: (value: number) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Optional color scheme to apply (e.g., 'theme.primary')
|
|
76
|
+
*/
|
|
77
|
+
colorScheme?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Custom styles for the slider components
|
|
80
|
+
*/
|
|
81
|
+
views?: SliderStyles;
|
|
82
|
+
/**
|
|
83
|
+
* Shadow effect for the slider
|
|
84
|
+
*/
|
|
85
|
+
shadow?: ViewProps;
|
|
86
|
+
/**
|
|
87
|
+
* Aria-label for accessibility
|
|
88
|
+
*/
|
|
89
|
+
ariaLabel?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface SliderViewProps extends SliderProps {
|
|
92
|
+
/** The current internal value being displayed/manipulated. */
|
|
93
|
+
currentValue?: number;
|
|
94
|
+
/** Flag indicating if the thumb is being dragged. */
|
|
95
|
+
isDragging: boolean;
|
|
96
|
+
/** Flag indicating if the component is hovered. */
|
|
97
|
+
isHovered: boolean;
|
|
98
|
+
/** Reference to the track element. */
|
|
99
|
+
trackRef: React.RefObject<HTMLDivElement>;
|
|
100
|
+
/** Reference to the thumb element. */
|
|
101
|
+
thumbRef: React.RefObject<HTMLDivElement>;
|
|
102
|
+
/** Handler for mouse down / touch start on the thumb. */
|
|
103
|
+
handleThumbMouseDown: (event: React.MouseEvent | React.TouchEvent) => void;
|
|
104
|
+
/** Handler for mouse down / touch start on the track. */
|
|
105
|
+
handleTrackMouseDown: (event: React.MouseEvent | React.TouchEvent) => void;
|
|
106
|
+
/** Handler for keyboard interaction on the thumb. */
|
|
107
|
+
handleKeyDown: (event: React.KeyboardEvent) => void;
|
|
108
|
+
/** The calculated position percentage for the thumb. */
|
|
109
|
+
thumbPositionPercent: number;
|
|
110
|
+
/** Callback to set hover state */
|
|
111
|
+
setIsHovered: (hovered: boolean) => void;
|
|
112
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SliderProps } from './Slider.props';
|
|
3
|
+
export declare const useSliderState: ({ min, max, step, value: controlledValue, defaultValue, onChange, onDrag, orientation, isDisabled, stepValues, }: SliderProps) => {
|
|
4
|
+
currentValue: number;
|
|
5
|
+
isDragging: boolean;
|
|
6
|
+
isHovered: boolean;
|
|
7
|
+
setIsHovered: React.Dispatch<React.SetStateAction<boolean>>;
|
|
8
|
+
trackRef: React.RefObject<HTMLDivElement>;
|
|
9
|
+
thumbRef: React.RefObject<HTMLDivElement>;
|
|
10
|
+
handleThumbMouseDown: (event: React.MouseEvent | React.TouchEvent) => void;
|
|
11
|
+
handleTrackMouseDown: (event: React.MouseEvent | React.TouchEvent) => void;
|
|
12
|
+
handleKeyDown: (event: React.KeyboardEvent) => void;
|
|
13
|
+
thumbPositionPercent: number;
|
|
14
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ViewProps } from 'app-studio';
|
|
2
|
+
import { Orientation, Shape, Size, Variant } from './Slider.type';
|
|
3
|
+
export declare const SliderSizes: Record<Size, ViewProps>;
|
|
4
|
+
export declare const ThumbSizes: Record<Size, ViewProps>;
|
|
5
|
+
export declare const SliderShapes: Record<Shape, number | string>;
|
|
6
|
+
export declare const SliderVariants: Record<Variant, ViewProps>;
|
|
7
|
+
export declare const EnhancedSliderSizes: Record<Size, {
|
|
8
|
+
trackCrossAxisSize: number;
|
|
9
|
+
thumbSize: number;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const OrientationStyles: Record<Orientation, ViewProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ViewProps, TextProps } from 'app-studio';
|
|
2
|
+
export declare type Shape = 'sharp' | 'rounded' | 'pillShaped';
|
|
3
|
+
export declare type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
export declare type Variant = 'default' | 'outline';
|
|
5
|
+
export declare type Orientation = 'horizontal' | 'vertical';
|
|
6
|
+
export interface SliderStyles {
|
|
7
|
+
container?: ViewProps;
|
|
8
|
+
track?: ViewProps;
|
|
9
|
+
progress?: ViewProps;
|
|
10
|
+
filledTrack?: ViewProps;
|
|
11
|
+
thumb?: ViewProps;
|
|
12
|
+
label?: ViewProps;
|
|
13
|
+
valueLabel?: ViewProps;
|
|
14
|
+
stepMarks?: ViewProps;
|
|
15
|
+
tooltip?: ViewProps & {
|
|
16
|
+
text?: TextProps;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Slider';
|
|
@@ -2,13 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { TableLayoutProps } from './Table/Table.props';
|
|
3
3
|
export declare const Table: {
|
|
4
4
|
({ children, views, onClick }: TableLayoutProps): React.JSX.Element;
|
|
5
|
-
Head: React.FC<
|
|
6
|
-
HeadCell: React.FC<
|
|
7
|
-
Body: React.FC<
|
|
8
|
-
Row: React.FC<
|
|
9
|
-
Cell: React.FC<
|
|
10
|
-
Footer: React.FC<
|
|
11
|
-
Caption: React.FC<
|
|
12
|
-
Container: React.FC<
|
|
5
|
+
Head: React.FC<import("app-studio").ViewProps>;
|
|
6
|
+
HeadCell: React.FC<import("app-studio").ViewProps>;
|
|
7
|
+
Body: React.FC<import("app-studio").ViewProps>;
|
|
8
|
+
Row: React.FC<import("app-studio").ViewProps>;
|
|
9
|
+
Cell: React.FC<import("app-studio").ViewProps>;
|
|
10
|
+
Footer: React.FC<import("app-studio").ViewProps>;
|
|
11
|
+
Caption: React.FC<import("app-studio").ViewProps>;
|
|
12
|
+
Container: React.FC<import("app-studio").ViewProps>;
|
|
13
13
|
Template: React.FC<import("./Table/Table.props").TableViewProps>;
|
|
14
14
|
};
|