@udixio/ui-react 2.9.8 → 2.9.10
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/CHANGELOG.md +26 -0
- package/dist/index.cjs +3 -3
- package/dist/index.js +2572 -2446
- package/dist/lib/components/Button.d.ts +6 -0
- package/dist/lib/components/Button.d.ts.map +1 -1
- package/dist/lib/components/Card.d.ts +4 -0
- package/dist/lib/components/Card.d.ts.map +1 -1
- package/dist/lib/components/Carousel.d.ts +4 -0
- package/dist/lib/components/Carousel.d.ts.map +1 -1
- package/dist/lib/components/CarouselItem.d.ts +4 -0
- package/dist/lib/components/CarouselItem.d.ts.map +1 -1
- package/dist/lib/components/Chip.d.ts +7 -0
- package/dist/lib/components/Chip.d.ts.map +1 -1
- package/dist/lib/components/Chips.d.ts +10 -0
- package/dist/lib/components/Chips.d.ts.map +1 -1
- package/dist/lib/components/Divider.d.ts +2 -0
- package/dist/lib/components/Divider.d.ts.map +1 -1
- package/dist/lib/components/Fab.d.ts +4 -0
- package/dist/lib/components/Fab.d.ts.map +1 -1
- package/dist/lib/components/FabMenu.d.ts +7 -0
- package/dist/lib/components/FabMenu.d.ts.map +1 -1
- package/dist/lib/components/IconButton.d.ts +7 -2
- package/dist/lib/components/IconButton.d.ts.map +1 -1
- package/dist/lib/components/NavigationRail.d.ts +6 -0
- package/dist/lib/components/NavigationRail.d.ts.map +1 -1
- package/dist/lib/components/NavigationRailItem.d.ts +7 -0
- package/dist/lib/components/NavigationRailItem.d.ts.map +1 -1
- package/dist/lib/components/ProgressIndicator.d.ts +6 -0
- package/dist/lib/components/ProgressIndicator.d.ts.map +1 -1
- package/dist/lib/components/SideSheet.d.ts +7 -0
- package/dist/lib/components/SideSheet.d.ts.map +1 -1
- package/dist/lib/components/Slider.d.ts +5 -0
- package/dist/lib/components/Slider.d.ts.map +1 -1
- package/dist/lib/components/Snackbar.d.ts +6 -0
- package/dist/lib/components/Snackbar.d.ts.map +1 -1
- package/dist/lib/components/Switch.d.ts +4 -0
- package/dist/lib/components/Switch.d.ts.map +1 -1
- package/dist/lib/components/Tab.d.ts +5 -0
- package/dist/lib/components/Tab.d.ts.map +1 -1
- package/dist/lib/components/TabGroup.d.ts +4 -0
- package/dist/lib/components/TabGroup.d.ts.map +1 -1
- package/dist/lib/components/TabGroupContext.d.ts +4 -0
- package/dist/lib/components/TabGroupContext.d.ts.map +1 -1
- package/dist/lib/components/TabPanel.d.ts +2 -0
- package/dist/lib/components/TabPanel.d.ts.map +1 -1
- package/dist/lib/components/TabPanels.d.ts +4 -0
- package/dist/lib/components/TabPanels.d.ts.map +1 -1
- package/dist/lib/components/Tabs.d.ts +4 -0
- package/dist/lib/components/Tabs.d.ts.map +1 -1
- package/dist/lib/components/TextField.d.ts +5 -0
- package/dist/lib/components/TextField.d.ts.map +1 -1
- package/dist/lib/components/Tooltip.d.ts +14 -0
- package/dist/lib/components/Tooltip.d.ts.map +1 -0
- package/dist/lib/components/index.d.ts +1 -1
- package/dist/lib/hooks/index.d.ts +5 -0
- package/dist/lib/hooks/index.d.ts.map +1 -0
- package/dist/lib/hooks/useTooltipPosition.d.ts +22 -0
- package/dist/lib/hooks/useTooltipPosition.d.ts.map +1 -0
- package/dist/lib/hooks/useTooltipTrigger.d.ts +44 -0
- package/dist/lib/hooks/useTooltipTrigger.d.ts.map +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/interfaces/fab.interface.d.ts +2 -1
- package/dist/lib/interfaces/fab.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/tooltip.interface.d.ts +24 -2
- package/dist/lib/interfaces/tooltip.interface.d.ts.map +1 -1
- package/dist/lib/styles/fab-menu.style.d.ts +4 -4
- package/dist/lib/styles/fab.style.d.ts +4 -4
- package/dist/lib/styles/icon-button.style.d.ts +2 -2
- package/dist/lib/styles/tooltip.style.d.ts +34 -6
- package/dist/lib/styles/tooltip.style.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/lib/components/Button.tsx +6 -0
- package/src/lib/components/Card.tsx +4 -0
- package/src/lib/components/Carousel.tsx +4 -0
- package/src/lib/components/CarouselItem.tsx +4 -0
- package/src/lib/components/Chip.tsx +7 -0
- package/src/lib/components/Chips.tsx +10 -0
- package/src/lib/components/Divider.tsx +2 -0
- package/src/lib/components/Fab.tsx +6 -2
- package/src/lib/components/FabMenu.tsx +7 -0
- package/src/lib/components/IconButton.tsx +12 -8
- package/src/lib/components/NavigationRail.tsx +6 -0
- package/src/lib/components/NavigationRailItem.tsx +7 -0
- package/src/lib/components/ProgressIndicator.tsx +6 -0
- package/src/lib/components/SideSheet.tsx +7 -0
- package/src/lib/components/Slider.tsx +5 -0
- package/src/lib/components/Snackbar.tsx +6 -0
- package/src/lib/components/Switch.tsx +4 -0
- package/src/lib/components/Tab.tsx +5 -0
- package/src/lib/components/TabGroup.tsx +4 -0
- package/src/lib/components/TabGroupContext.tsx +6 -1
- package/src/lib/components/TabPanel.tsx +2 -0
- package/src/lib/components/TabPanels.tsx +4 -0
- package/src/lib/components/Tabs.tsx +4 -0
- package/src/lib/components/TextField.tsx +5 -0
- package/src/lib/components/Tooltip.tsx +217 -0
- package/src/lib/components/index.ts +1 -1
- package/src/lib/hooks/index.ts +11 -0
- package/src/lib/hooks/useTooltipPosition.ts +95 -0
- package/src/lib/hooks/useTooltipTrigger.ts +270 -0
- package/src/lib/index.ts +1 -0
- package/src/lib/interfaces/fab.interface.ts +2 -1
- package/src/lib/interfaces/tooltip.interface.ts +24 -2
- package/src/lib/styles/tooltip.style.ts +1 -0
- package/src/stories/communication/tool-tip.stories.tsx +19 -19
- package/dist/lib/components/ToolTip.d.ts +0 -9
- package/dist/lib/components/ToolTip.d.ts.map +0 -1
- package/src/lib/components/ToolTip.tsx +0 -256
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ActionOrLink } from '../utils/component';
|
|
2
2
|
import { Transition } from 'motion';
|
|
3
3
|
import { Icon } from '../icon';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
4
5
|
export type FabVariant = 'primary' | 'secondary' | 'tertiary' | 'primaryContainer' | 'secondaryContainer' | 'tertiaryContainer';
|
|
5
6
|
type Props = {
|
|
6
7
|
variant?: FabVariant;
|
|
7
8
|
label?: string;
|
|
8
|
-
children?:
|
|
9
|
+
children?: ReactNode;
|
|
9
10
|
icon: Icon;
|
|
10
11
|
size?: 'small' | 'medium' | 'large';
|
|
11
12
|
extended?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fab.interface.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/fab.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"fab.interface.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/fab.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,WAAW,GACX,UAAU,GACV,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,CAAC;AACxB,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAE9D,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG;IAC/C,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC"}
|
|
@@ -8,11 +8,26 @@ export type ToolTipInterface<T extends HTMLElement = any> = {
|
|
|
8
8
|
props: {
|
|
9
9
|
variant?: 'plain' | 'rich';
|
|
10
10
|
title?: string;
|
|
11
|
-
text
|
|
11
|
+
/** Supporting text for the tooltip. Optional when using `content` prop. */
|
|
12
|
+
text?: string;
|
|
13
|
+
/** Custom content slot that replaces title/text/buttons when provided */
|
|
14
|
+
content?: ReactNode;
|
|
12
15
|
buttons?: ReactProps<ButtonInterface> | ReactProps<ButtonInterface>[];
|
|
13
16
|
position?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
14
17
|
trigger?: Trigger | Trigger[];
|
|
15
18
|
transition?: Transition;
|
|
19
|
+
/** Delay in milliseconds before showing the tooltip. Default: 400ms */
|
|
20
|
+
openDelay?: number;
|
|
21
|
+
/** Delay in milliseconds before hiding the tooltip. Default: 150ms */
|
|
22
|
+
closeDelay?: number;
|
|
23
|
+
/** Controlled mode: explicitly control whether the tooltip is open */
|
|
24
|
+
isOpen?: boolean;
|
|
25
|
+
/** Uncontrolled mode: default open state */
|
|
26
|
+
defaultOpen?: boolean;
|
|
27
|
+
/** Callback when the open state changes */
|
|
28
|
+
onOpenChange?: (open: boolean) => void;
|
|
29
|
+
/** Custom ID for accessibility linking. Auto-generated if not provided. */
|
|
30
|
+
id?: string;
|
|
16
31
|
} & ({
|
|
17
32
|
children?: never;
|
|
18
33
|
targetRef: RefObject<T>;
|
|
@@ -20,7 +35,14 @@ export type ToolTipInterface<T extends HTMLElement = any> = {
|
|
|
20
35
|
children: ReactNode;
|
|
21
36
|
targetRef?: never;
|
|
22
37
|
});
|
|
23
|
-
elements: [
|
|
38
|
+
elements: [
|
|
39
|
+
'toolTip',
|
|
40
|
+
'container',
|
|
41
|
+
'subHead',
|
|
42
|
+
'supportingText',
|
|
43
|
+
'actions',
|
|
44
|
+
'content'
|
|
45
|
+
];
|
|
24
46
|
};
|
|
25
47
|
export {};
|
|
26
48
|
//# sourceMappingURL=tooltip.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.interface.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/tooltip.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,KAAK,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;AAElD,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,WAAW,GAAG,GAAG,IAAI;IAC1D,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE;QACL,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"tooltip.interface.d.ts","sourceRoot":"","sources":["../../../src/lib/interfaces/tooltip.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,KAAK,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;AAElD,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,WAAW,GAAG,GAAG,IAAI;IAC1D,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE;QACL,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;QAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,2EAA2E;QAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,yEAAyE;QACzE,OAAO,CAAC,EAAE,SAAS,CAAC;QACpB,OAAO,CAAC,EAAE,UAAU,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QACtE,QAAQ,CAAC,EACL,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,CAAC;QACnB,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,CAAC;QAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,uEAAuE;QACvE,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,sEAAsE;QACtE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,sEAAsE;QACtE,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,4CAA4C;QAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,2CAA2C;QAC3C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;QACvC,2EAA2E;QAC3E,EAAE,CAAC,EAAE,MAAM,CAAC;KACb,GAAG,CACA;QACE,QAAQ,CAAC,EAAE,KAAK,CAAC;QACjB,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;KACzB,GACD;QACE,QAAQ,EAAE,SAAS,CAAC;QACpB,SAAS,CAAC,EAAE,KAAK,CAAC;KACnB,CACJ,CAAC;IACF,QAAQ,EAAE;QACR,SAAS;QACT,WAAW;QACX,SAAS;QACT,gBAAgB;QAChB,SAAS;QACT,SAAS;KACV,CAAC;CACH,CAAC"}
|
|
@@ -27,7 +27,7 @@ export declare const fabMenuStyle: (states: ({
|
|
|
27
27
|
}) & (((({
|
|
28
28
|
variant?: import('..').FabVariant;
|
|
29
29
|
label?: string;
|
|
30
|
-
children?:
|
|
30
|
+
children?: import('react').ReactNode;
|
|
31
31
|
icon: import('..').Icon;
|
|
32
32
|
size?: "small" | "medium" | "large";
|
|
33
33
|
extended?: boolean;
|
|
@@ -37,7 +37,7 @@ export declare const fabMenuStyle: (states: ({
|
|
|
37
37
|
}) | ({
|
|
38
38
|
variant?: import('..').FabVariant;
|
|
39
39
|
label?: string;
|
|
40
|
-
children?:
|
|
40
|
+
children?: import('react').ReactNode;
|
|
41
41
|
icon: import('..').Icon;
|
|
42
42
|
size?: "small" | "medium" | "large";
|
|
43
43
|
extended?: boolean;
|
|
@@ -55,7 +55,7 @@ export declare const fabMenuStyle: (states: ({
|
|
|
55
55
|
export declare const useFabMenuStyle: (states: ((({
|
|
56
56
|
variant?: import('..').FabVariant;
|
|
57
57
|
label?: string;
|
|
58
|
-
children?:
|
|
58
|
+
children?: import('react').ReactNode;
|
|
59
59
|
icon: import('..').Icon;
|
|
60
60
|
size?: "small" | "medium" | "large";
|
|
61
61
|
extended?: boolean;
|
|
@@ -65,7 +65,7 @@ export declare const useFabMenuStyle: (states: ((({
|
|
|
65
65
|
}) | ({
|
|
66
66
|
variant?: import('..').FabVariant;
|
|
67
67
|
label?: string;
|
|
68
|
-
children?:
|
|
68
|
+
children?: import('react').ReactNode;
|
|
69
69
|
icon: import('..').Icon;
|
|
70
70
|
size?: "small" | "medium" | "large";
|
|
71
71
|
extended?: boolean;
|
|
@@ -21,7 +21,7 @@ export declare const fabStyle: (states: ({
|
|
|
21
21
|
}) & ((({
|
|
22
22
|
variant?: import('..').FabVariant;
|
|
23
23
|
label?: string;
|
|
24
|
-
children?:
|
|
24
|
+
children?: import('react').ReactNode;
|
|
25
25
|
icon: import('..').Icon;
|
|
26
26
|
size?: "small" | "medium" | "large";
|
|
27
27
|
extended?: boolean;
|
|
@@ -31,7 +31,7 @@ export declare const fabStyle: (states: ({
|
|
|
31
31
|
}) | ({
|
|
32
32
|
variant?: import('..').FabVariant;
|
|
33
33
|
label?: string;
|
|
34
|
-
children?:
|
|
34
|
+
children?: import('react').ReactNode;
|
|
35
35
|
icon: import('..').Icon;
|
|
36
36
|
size?: "small" | "medium" | "large";
|
|
37
37
|
extended?: boolean;
|
|
@@ -44,7 +44,7 @@ export declare const fabStyle: (states: ({
|
|
|
44
44
|
export declare const useFabStyle: (states: (({
|
|
45
45
|
variant?: import('..').FabVariant;
|
|
46
46
|
label?: string;
|
|
47
|
-
children?:
|
|
47
|
+
children?: import('react').ReactNode;
|
|
48
48
|
icon: import('..').Icon;
|
|
49
49
|
size?: "small" | "medium" | "large";
|
|
50
50
|
extended?: boolean;
|
|
@@ -54,7 +54,7 @@ export declare const useFabStyle: (states: (({
|
|
|
54
54
|
}) | ({
|
|
55
55
|
variant?: import('..').FabVariant;
|
|
56
56
|
label?: string;
|
|
57
|
-
children?:
|
|
57
|
+
children?: import('react').ReactNode;
|
|
58
58
|
icon: import('..').Icon;
|
|
59
59
|
size?: "small" | "medium" | "large";
|
|
60
60
|
extended?: boolean;
|
|
@@ -64,7 +64,7 @@ export declare const iconButtonStyle: (states: (({
|
|
|
64
64
|
href?: never;
|
|
65
65
|
}))) & import('..').IconButtonStates & {
|
|
66
66
|
className: string | ClassNameComponent<IconButtonInterface> | undefined;
|
|
67
|
-
}) => Record<"icon" | "stateLayer" | "
|
|
67
|
+
}) => Record<"icon" | "stateLayer" | "touchTarget" | "iconButton", string>;
|
|
68
68
|
export declare const useIconButtonStyle: (states: import('..').IconButtonStates & ((({
|
|
69
69
|
label?: string;
|
|
70
70
|
children?: string;
|
|
@@ -99,5 +99,5 @@ export declare const useIconButtonStyle: (states: import('..').IconButtonStates
|
|
|
99
99
|
href?: never;
|
|
100
100
|
})) & {
|
|
101
101
|
className?: string | ClassNameComponent<IconButtonInterface> | undefined;
|
|
102
|
-
})) => Record<"icon" | "stateLayer" | "
|
|
102
|
+
})) => Record<"icon" | "stateLayer" | "touchTarget" | "iconButton", string>;
|
|
103
103
|
//# sourceMappingURL=icon-button.style.d.ts.map
|
|
@@ -4,30 +4,51 @@ export declare const toolStyle: (states: ({
|
|
|
4
4
|
variant: any;
|
|
5
5
|
title: any;
|
|
6
6
|
text: any;
|
|
7
|
+
content: any;
|
|
7
8
|
buttons: any;
|
|
8
9
|
position: any;
|
|
9
10
|
trigger: any;
|
|
10
11
|
transition: any;
|
|
12
|
+
openDelay: any;
|
|
13
|
+
closeDelay: any;
|
|
14
|
+
isOpen: any;
|
|
15
|
+
defaultOpen: any;
|
|
16
|
+
onOpenChange: any;
|
|
17
|
+
id: any;
|
|
11
18
|
children: any;
|
|
12
19
|
targetRef: any;
|
|
13
20
|
} | {
|
|
14
21
|
variant: any;
|
|
15
22
|
title: any;
|
|
16
23
|
text: any;
|
|
24
|
+
content: any;
|
|
17
25
|
buttons: any;
|
|
18
26
|
position: any;
|
|
19
27
|
trigger: any;
|
|
20
28
|
transition: any;
|
|
29
|
+
openDelay: any;
|
|
30
|
+
closeDelay: any;
|
|
31
|
+
isOpen: any;
|
|
32
|
+
defaultOpen: any;
|
|
33
|
+
onOpenChange: any;
|
|
34
|
+
id: any;
|
|
21
35
|
children: any;
|
|
22
36
|
targetRef: any;
|
|
23
37
|
}) & (({
|
|
24
38
|
variant?: "plain" | "rich";
|
|
25
39
|
title?: string;
|
|
26
|
-
text
|
|
40
|
+
text?: string;
|
|
41
|
+
content?: import('react').ReactNode;
|
|
27
42
|
buttons?: import('..').ReactProps<import('..').ButtonInterface> | import('..').ReactProps<import('..').ButtonInterface>[];
|
|
28
43
|
position?: "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
29
|
-
trigger?: ("
|
|
44
|
+
trigger?: ("hover" | "click" | "focus" | null) | ("hover" | "click" | "focus" | null)[];
|
|
30
45
|
transition?: import('motion').Transition;
|
|
46
|
+
openDelay?: number;
|
|
47
|
+
closeDelay?: number;
|
|
48
|
+
isOpen?: boolean;
|
|
49
|
+
defaultOpen?: boolean;
|
|
50
|
+
onOpenChange?: (open: boolean) => void;
|
|
51
|
+
id?: string;
|
|
31
52
|
} & ({
|
|
32
53
|
children: import('react').ReactNode;
|
|
33
54
|
targetRef?: never;
|
|
@@ -36,15 +57,22 @@ export declare const toolStyle: (states: ({
|
|
|
36
57
|
targetRef: import('react').RefObject<any>;
|
|
37
58
|
})) & {
|
|
38
59
|
className: string | ClassNameComponent<ToolTipInterface> | undefined;
|
|
39
|
-
})) => Record<"container" | "actions" | "supportingText" | "toolTip" | "subHead", string>;
|
|
60
|
+
})) => Record<"container" | "content" | "actions" | "supportingText" | "toolTip" | "subHead", string>;
|
|
40
61
|
export declare const useToolTipStyle: (states: ({
|
|
41
62
|
variant?: "plain" | "rich";
|
|
42
63
|
title?: string;
|
|
43
|
-
text
|
|
64
|
+
text?: string;
|
|
65
|
+
content?: import('react').ReactNode;
|
|
44
66
|
buttons?: import('..').ReactProps<import('..').ButtonInterface> | import('..').ReactProps<import('..').ButtonInterface>[];
|
|
45
67
|
position?: "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
46
|
-
trigger?: ("
|
|
68
|
+
trigger?: ("hover" | "click" | "focus" | null) | ("hover" | "click" | "focus" | null)[];
|
|
47
69
|
transition?: import('motion').Transition;
|
|
70
|
+
openDelay?: number;
|
|
71
|
+
closeDelay?: number;
|
|
72
|
+
isOpen?: boolean;
|
|
73
|
+
defaultOpen?: boolean;
|
|
74
|
+
onOpenChange?: (open: boolean) => void;
|
|
75
|
+
id?: string;
|
|
48
76
|
} & ({
|
|
49
77
|
children: import('react').ReactNode;
|
|
50
78
|
targetRef?: never;
|
|
@@ -53,5 +81,5 @@ export declare const useToolTipStyle: (states: ({
|
|
|
53
81
|
targetRef: import('react').RefObject<any>;
|
|
54
82
|
})) & {
|
|
55
83
|
className?: string | ClassNameComponent<ToolTipInterface> | undefined;
|
|
56
|
-
}) => Record<"container" | "actions" | "supportingText" | "toolTip" | "subHead", string>;
|
|
84
|
+
}) => Record<"container" | "content" | "actions" | "supportingText" | "toolTip" | "subHead", string>;
|
|
57
85
|
//# sourceMappingURL=tooltip.style.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.style.d.ts","sourceRoot":"","sources":["../../../src/lib/styles/tooltip.style.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"tooltip.style.d.ts","sourceRoot":"","sources":["../../../src/lib/styles/tooltip.style.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAiCjD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qGAGrB,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;oGAG3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -38,6 +38,12 @@ function resolveVariantAlias(
|
|
|
38
38
|
* Buttons prompt most actions in a UI
|
|
39
39
|
* @status beta
|
|
40
40
|
* @category Action
|
|
41
|
+
* @devx
|
|
42
|
+
* - Requires `label` or children; used for visible text and a11y.
|
|
43
|
+
* - `onToggle` uses internal state; pair with `activated` for controlled usage.
|
|
44
|
+
* @limitations
|
|
45
|
+
* - No explicit `type` prop; HTML button defaults may submit in forms.
|
|
46
|
+
* - When `href` is set, `disabled` is visual only (no `aria-disabled`).
|
|
41
47
|
*/
|
|
42
48
|
export const Button = ({
|
|
43
49
|
variant = 'filled',
|
|
@@ -8,6 +8,10 @@ import { State } from '../effects';
|
|
|
8
8
|
* Cards display content and actions about a single subject
|
|
9
9
|
* @status beta
|
|
10
10
|
* @category Layout
|
|
11
|
+
* @devx
|
|
12
|
+
* - `isInteractive` only adds a state layer; add your own click/role semantics.
|
|
13
|
+
* @limitations
|
|
14
|
+
* - No built-in header/actions slots; layout is fully custom via children.
|
|
11
15
|
*/
|
|
12
16
|
export const Card = ({
|
|
13
17
|
variant = 'outlined',
|
|
@@ -16,9 +16,13 @@ function clamp(v: number, min: number, max: number) {
|
|
|
16
16
|
*
|
|
17
17
|
* @status beta
|
|
18
18
|
* @category Layout
|
|
19
|
+
* @devx
|
|
20
|
+
* - Only `CarouselItem` children are rendered; other children are ignored.
|
|
21
|
+
* - Use `index` for controlled positioning; otherwise relies on internal scroll state.
|
|
19
22
|
* @limitations
|
|
20
23
|
* - Responsive behavior on mobile is not supported.
|
|
21
24
|
* - Only the default (hero) variant is supported.
|
|
25
|
+
* - No keyboard navigation or focus management.
|
|
22
26
|
*/
|
|
23
27
|
export const Carousel = ({
|
|
24
28
|
variant = 'hero',
|
|
@@ -21,6 +21,10 @@ export const normalize = (
|
|
|
21
21
|
/**
|
|
22
22
|
* @status beta
|
|
23
23
|
* @parent Carousel
|
|
24
|
+
* @devx
|
|
25
|
+
* - Intended for use inside `Carousel`; width and outputRange drive sizing.
|
|
26
|
+
* @limitations
|
|
27
|
+
* - Requires `outputRange` for min/max sizing; missing values can break layout.
|
|
24
28
|
*/
|
|
25
29
|
export const CarouselItem = ({
|
|
26
30
|
className,
|
|
@@ -10,6 +10,13 @@ import { faCheck, faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
|
10
10
|
* Chips prompt most actions in a UI
|
|
11
11
|
* @status beta
|
|
12
12
|
* @category Action
|
|
13
|
+
* @devx
|
|
14
|
+
* - `editable` relies on contentEditable; label should be a string.
|
|
15
|
+
* - `onToggle` uses internal state; pair with `activated` for controlled usage.
|
|
16
|
+
* @a11y
|
|
17
|
+
* - Uses `aria-pressed` only when togglable.
|
|
18
|
+
* @limitations
|
|
19
|
+
* - Edit mode starts after a 1s focus delay (no prop to customize).
|
|
13
20
|
*/
|
|
14
21
|
export const Chip = ({
|
|
15
22
|
variant = 'outlined',
|
|
@@ -6,6 +6,16 @@ import { Chip } from './Chip';
|
|
|
6
6
|
import { Divider } from './Divider';
|
|
7
7
|
import { v4 } from 'uuid';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Chips group for input or selection lists
|
|
11
|
+
* @status beta
|
|
12
|
+
* @category Input
|
|
13
|
+
* @devx
|
|
14
|
+
* - Works best as controlled: pass `items` + `onItemsChange`.
|
|
15
|
+
* - Internal ids are derived from object identity; replace items carefully.
|
|
16
|
+
* @limitations
|
|
17
|
+
* - No virtualization; very large lists can be slow.
|
|
18
|
+
*/
|
|
9
19
|
export const Chips = ({
|
|
10
20
|
variant = 'input',
|
|
11
21
|
className,
|
|
@@ -6,6 +6,8 @@ import { ReactProps } from '../utils';
|
|
|
6
6
|
* Dividers are thin lines that group content in lists or other containers
|
|
7
7
|
* @status beta
|
|
8
8
|
* @category Layout
|
|
9
|
+
* @devx
|
|
10
|
+
* - Renders a semantic `<hr>`; use `orientation` for vertical dividers.
|
|
9
11
|
*/
|
|
10
12
|
export const Divider = ({
|
|
11
13
|
orientation = 'horizontal',
|
|
@@ -5,13 +5,17 @@ import { FabInterface } from '../interfaces/fab.interface';
|
|
|
5
5
|
import { useFabStyle } from '../styles/fab.style';
|
|
6
6
|
import { classNames } from '../utils';
|
|
7
7
|
import { ReactProps } from '../utils/component';
|
|
8
|
-
import {
|
|
8
|
+
import { Tooltip } from './Tooltip';
|
|
9
9
|
import { State } from '../effects';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Floating action buttons (FABs) help people take primary actions
|
|
13
13
|
* @status beta
|
|
14
14
|
* @category Action
|
|
15
|
+
* @devx
|
|
16
|
+
* - Requires `label` or children; icon-only still needs a label for a11y.
|
|
17
|
+
* @limitations
|
|
18
|
+
* - No built-in positioning; placement is handled by the layout.
|
|
15
19
|
*/
|
|
16
20
|
export const Fab = ({
|
|
17
21
|
className,
|
|
@@ -86,7 +90,7 @@ export const Fab = ({
|
|
|
86
90
|
aria-label={extended ? undefined : label}
|
|
87
91
|
className={styles.fab}
|
|
88
92
|
>
|
|
89
|
-
<
|
|
93
|
+
<Tooltip
|
|
90
94
|
trigger={extended ? null : undefined}
|
|
91
95
|
text={label}
|
|
92
96
|
targetRef={resolvedRef}
|
|
@@ -15,6 +15,13 @@ import { v4 } from 'uuid';
|
|
|
15
15
|
* Floating action buttons (FABs) help people take primary actions
|
|
16
16
|
* @status beta
|
|
17
17
|
* @category Action
|
|
18
|
+
* @devx
|
|
19
|
+
* - Only `Button` children are rendered as actions.
|
|
20
|
+
* - Controlled via `open`/`onOpenChange` or `defaultOpen`.
|
|
21
|
+
* @a11y
|
|
22
|
+
* - No focus trap or Escape handling when open.
|
|
23
|
+
* @limitations
|
|
24
|
+
* - No outside-click handling; close uses the explicit close button.
|
|
18
25
|
*/
|
|
19
26
|
export const FabMenu = ({
|
|
20
27
|
className,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
|
|
3
|
-
import { Icon } from '../icon
|
|
4
|
-
import { IconButtonInterface } from '../interfaces
|
|
5
|
-
import { useIconButtonStyle } from '../styles
|
|
6
|
-
import { ReactProps } from '../utils
|
|
3
|
+
import { Icon } from '../icon';
|
|
4
|
+
import { IconButtonInterface } from '../interfaces';
|
|
5
|
+
import { useIconButtonStyle } from '../styles';
|
|
6
|
+
import { classNames, ReactProps } from '../utils';
|
|
7
7
|
import { State } from '../effects';
|
|
8
|
-
import {
|
|
9
|
-
import { ToolTip } from './ToolTip';
|
|
8
|
+
import { Tooltip } from './Tooltip';
|
|
10
9
|
|
|
11
10
|
export type IconButtonVariant = 'standard' | 'filled' | 'tonal' | 'outlined';
|
|
12
11
|
|
|
@@ -14,6 +13,11 @@ export type IconButtonVariant = 'standard' | 'filled' | 'tonal' | 'outlined';
|
|
|
14
13
|
* Icon buttons help people take minor actions with one tap
|
|
15
14
|
* @status beta
|
|
16
15
|
* @category Action
|
|
16
|
+
* @devx
|
|
17
|
+
* - Requires `label` or children to provide an aria-label.
|
|
18
|
+
* - Uses `title` as tooltip text; native title attribute is suppressed.
|
|
19
|
+
* @limitations
|
|
20
|
+
* - Tooltip is always rendered (no explicit opt-out).
|
|
17
21
|
*/
|
|
18
22
|
export const IconButton = ({
|
|
19
23
|
variant = 'standard',
|
|
@@ -104,11 +108,11 @@ export const IconButton = ({
|
|
|
104
108
|
onClick={handleClick}
|
|
105
109
|
ref={resolvedRef}
|
|
106
110
|
>
|
|
107
|
-
<
|
|
111
|
+
<Tooltip
|
|
108
112
|
targetRef={resolvedRef}
|
|
109
113
|
trigger={disabled ? null : undefined}
|
|
110
114
|
text={title}
|
|
111
|
-
></
|
|
115
|
+
></Tooltip>
|
|
112
116
|
|
|
113
117
|
<div className={styles.touchTarget} />
|
|
114
118
|
<State
|
|
@@ -26,6 +26,12 @@ import { IconButton } from './IconButton';
|
|
|
26
26
|
* Navigation rails let people switch between UI views on mid-sized devices
|
|
27
27
|
* @status beta
|
|
28
28
|
* @category Navigation
|
|
29
|
+
* @devx
|
|
30
|
+
* - Treats `NavigationRailItem`, `NavigationRailSection`, and `Fab` specially.
|
|
31
|
+
* - Selection is index-based; provide `selectedItem` for controlled usage.
|
|
32
|
+
* @limitations
|
|
33
|
+
* - `extended` is not fully controlled (prop changes after mount aren’t synced).
|
|
34
|
+
* - Keyboard navigation/roving tabindex is not implemented.
|
|
29
35
|
*/
|
|
30
36
|
export const NavigationRail = ({
|
|
31
37
|
variant = 'standard',
|
|
@@ -10,6 +10,8 @@ import { State } from '../effects';
|
|
|
10
10
|
/**
|
|
11
11
|
* @status beta
|
|
12
12
|
* @parent NavigationRail
|
|
13
|
+
* @devx
|
|
14
|
+
* - Section labels only render when the rail is extended.
|
|
13
15
|
*/
|
|
14
16
|
export const NavigationRailSection = ({ label }: { label: string }) => {
|
|
15
17
|
return (
|
|
@@ -22,6 +24,11 @@ export const NavigationRailSection = ({ label }: { label: string }) => {
|
|
|
22
24
|
/**
|
|
23
25
|
* @status beta
|
|
24
26
|
* @parent NavigationRail
|
|
27
|
+
* @devx
|
|
28
|
+
* - Selection is index-based and provided by the parent rail.
|
|
29
|
+
* - `extendedOnly` hides items when the rail is collapsed.
|
|
30
|
+
* @a11y
|
|
31
|
+
* - Uses `role="tab"` but no roving tabindex or aria-controls wiring.
|
|
25
32
|
*/
|
|
26
33
|
export const NavigationRailItem = ({
|
|
27
34
|
className,
|
|
@@ -8,6 +8,12 @@ import { ReactProps } from '../utils/component';
|
|
|
8
8
|
/**
|
|
9
9
|
* @status beta
|
|
10
10
|
* @category Communication
|
|
11
|
+
* @devx
|
|
12
|
+
* - `value` is clamped to 0–100; indeterminate variants ignore it.
|
|
13
|
+
* @a11y
|
|
14
|
+
* - Missing `role="progressbar"` and aria-* attributes.
|
|
15
|
+
* @limitations
|
|
16
|
+
* - Visibility auto-hides at 100% (no controlled open prop).
|
|
11
17
|
*/
|
|
12
18
|
export const ProgressIndicator = ({
|
|
13
19
|
variant = 'linear-determinate',
|
|
@@ -13,6 +13,13 @@ import { sideSheetStyle } from '../styles';
|
|
|
13
13
|
* Side sheets show secondary content anchored to the side of the screen
|
|
14
14
|
* @status beta
|
|
15
15
|
* @category Layout
|
|
16
|
+
* @devx
|
|
17
|
+
* - Controlled via `extended`/`onExtendedChange` or internal state.
|
|
18
|
+
* - `variant="modal"` renders into a portal on `document.body`.
|
|
19
|
+
* @a11y
|
|
20
|
+
* - No focus trap, Escape handling, or `aria-modal` attributes.
|
|
21
|
+
* @limitations
|
|
22
|
+
* - No body scroll lock when open.
|
|
16
23
|
*/
|
|
17
24
|
export const SideSheet = ({
|
|
18
25
|
variant = 'standard',
|
|
@@ -8,6 +8,11 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
8
8
|
* Sliders let users make selections from a range of values
|
|
9
9
|
* @status beta
|
|
10
10
|
* @category Input
|
|
11
|
+
* @devx
|
|
12
|
+
* - `value` is treated as the initial value; component is uncontrolled after mount.
|
|
13
|
+
* - `onChange` receives the numeric value (not the DOM event).
|
|
14
|
+
* @a11y
|
|
15
|
+
* - Provides slider role/aria values, but no label prop.
|
|
11
16
|
*/
|
|
12
17
|
export const Slider = ({
|
|
13
18
|
className,
|
|
@@ -11,6 +11,12 @@ import { IconButton } from './IconButton';
|
|
|
11
11
|
* Snackbars show short updates about app processes at the bottom of the screen
|
|
12
12
|
* @status beta
|
|
13
13
|
* @category Communication
|
|
14
|
+
* @devx
|
|
15
|
+
* - Uncontrolled visibility; use `duration` to auto-dismiss.
|
|
16
|
+
* @a11y
|
|
17
|
+
* - No `role="status"`/`alert` announcements.
|
|
18
|
+
* @limitations
|
|
19
|
+
* - No queue/stacking and no controlled open prop.
|
|
14
20
|
*/
|
|
15
21
|
export const Snackbar = ({
|
|
16
22
|
message,
|
|
@@ -10,6 +10,10 @@ import { MotionProps } from '../utils/component';
|
|
|
10
10
|
* Switches toggle the selection of an item on or off
|
|
11
11
|
* @status beta
|
|
12
12
|
* @category Input
|
|
13
|
+
* @devx
|
|
14
|
+
* - `selected` is used as initial state only; prop changes won’t sync.
|
|
15
|
+
* @a11y
|
|
16
|
+
* - Uses `role="switch"` but no label prop is exposed here.
|
|
13
17
|
*/
|
|
14
18
|
export const Switch = ({
|
|
15
19
|
selected = false,
|
|
@@ -10,6 +10,11 @@ import { State } from '../effects';
|
|
|
10
10
|
/**
|
|
11
11
|
* @status beta
|
|
12
12
|
* @parent Tabs
|
|
13
|
+
* @devx
|
|
14
|
+
* - `label` can come from string children; selection is index-based.
|
|
15
|
+
* - Use `TabGroup` to sync selection with panels/animations.
|
|
16
|
+
* @a11y
|
|
17
|
+
* - No keyboard navigation or `aria-controls` wiring.
|
|
13
18
|
*/
|
|
14
19
|
export const Tab = ({
|
|
15
20
|
className,
|
|
@@ -8,6 +8,10 @@ import { ReactProps } from '../utils/component';
|
|
|
8
8
|
* TabGroup provides shared state for Tabs and TabPanels
|
|
9
9
|
* @status beta
|
|
10
10
|
* @category Navigation
|
|
11
|
+
* @devx
|
|
12
|
+
* - Provides selection + slide direction for Tabs/TabPanels.
|
|
13
|
+
* @limitations
|
|
14
|
+
* - No URL/hash syncing or persistence built in.
|
|
11
15
|
*/
|
|
12
16
|
export const TabGroup = ({
|
|
13
17
|
children,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { createContext, Dispatch, SetStateAction } from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Shared state container for Tabs and TabPanels.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
|
|
3
8
|
export interface TabGroupContextValue {
|
|
4
9
|
selectedTab: number | null;
|
|
5
10
|
setSelectedTab: Dispatch<SetStateAction<number | null>>;
|
|
@@ -8,4 +13,4 @@ export interface TabGroupContextValue {
|
|
|
8
13
|
tabsId: string;
|
|
9
14
|
}
|
|
10
15
|
|
|
11
|
-
export const TabGroupContext = createContext<TabGroupContextValue | null>(null);
|
|
16
|
+
export const TabGroupContext = createContext<TabGroupContextValue | null>(null);
|
|
@@ -8,6 +8,8 @@ import { useTabPanelStyle } from '../styles/tab-panels.style';
|
|
|
8
8
|
* Must be used within TabPanels
|
|
9
9
|
* @status beta
|
|
10
10
|
* @category Navigation
|
|
11
|
+
* @devx
|
|
12
|
+
* - Should be rendered inside `TabPanels` for animations and aria wiring.
|
|
11
13
|
*/
|
|
12
14
|
export const TabPanel = ({
|
|
13
15
|
children,
|
|
@@ -11,6 +11,10 @@ import { TabPanel } from './TabPanel';
|
|
|
11
11
|
* Must be used within a TabGroup
|
|
12
12
|
* @status beta
|
|
13
13
|
* @category Navigation
|
|
14
|
+
* @devx
|
|
15
|
+
* - Requires `TabGroup` context; otherwise it renders nothing.
|
|
16
|
+
* @limitations
|
|
17
|
+
* - Only renders the active panel (no offscreen preservation).
|
|
14
18
|
*/
|
|
15
19
|
export const TabPanels = ({
|
|
16
20
|
children,
|
|
@@ -12,6 +12,10 @@ import { TabGroupContext } from './TabGroupContext';
|
|
|
12
12
|
* Tabs organize content across different screens and views
|
|
13
13
|
* @status beta
|
|
14
14
|
* @category Navigation
|
|
15
|
+
* @devx
|
|
16
|
+
* - Can be controlled via `selectedTab`/`setSelectedTab` or through `TabGroup`.
|
|
17
|
+
* @a11y
|
|
18
|
+
* - No keyboard navigation or roving tabindex.
|
|
15
19
|
*/
|
|
16
20
|
export const Tabs = ({
|
|
17
21
|
variant = 'primary',
|
|
@@ -14,6 +14,11 @@ import { TextFieldInterface } from '../interfaces/text-field.interface';
|
|
|
14
14
|
* Text fields let users enter text into a UI
|
|
15
15
|
* @status beta
|
|
16
16
|
* @category Input
|
|
17
|
+
* @devx
|
|
18
|
+
* - `onChange` receives the string value (not the DOM event).
|
|
19
|
+
* - `value` syncs internal state; not a fully controlled input.
|
|
20
|
+
* @a11y
|
|
21
|
+
* - Uses `label` for `aria-label`; no `aria-describedby` for supporting text.
|
|
17
22
|
*/
|
|
18
23
|
export const TextField = ({
|
|
19
24
|
variant = 'filled',
|