@kwantis-id3/frontend-library 1.1.0 → 1.2.0
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/esm/index.js +238 -79
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/AIBubble/AIBubble.d.ts +3 -0
- package/dist/esm/types/components/AIBubble/AIBubbleInterfaces.d.ts +11 -0
- package/dist/esm/types/components/AIBubble/AIBubbleStyled.d.ts +7 -0
- package/dist/esm/types/components/AIBubble/index.d.ts +2 -0
- package/dist/esm/types/components/Button/ButtonInterfaces.d.ts +2 -0
- package/dist/esm/types/components/Popover/Popover.d.ts +4 -0
- package/dist/esm/types/components/Popover/PopoverInterfaces.d.ts +79 -0
- package/dist/esm/types/components/Popover/PopoverStyled.d.ts +56 -0
- package/dist/esm/types/components/Popover/index.d.ts +2 -0
- package/dist/esm/types/components/index.d.ts +2 -0
- package/dist/index.d.ts +97 -2
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import { TAIBubbleProps } from "./AIBubbleInterfaces";
|
|
3
|
+
export declare const AIBubble: ({ url, externalUrl, placement, align, color, bubbleSize, iconSize, collapsedSize, showCloseButton, showExpandButton, ...rest }: TAIBubbleProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TPopoverProps } from "../Popover";
|
|
2
|
+
export type TAIBubbleProps = Omit<TPopoverProps, "trigger" | "children" | "topBarLeft" | "expandable"> & {
|
|
3
|
+
/** URL to embed in the iframe */
|
|
4
|
+
url: string;
|
|
5
|
+
/** URL to external link */
|
|
6
|
+
externalUrl?: string;
|
|
7
|
+
/** Size of the trigger bubble */
|
|
8
|
+
bubbleSize?: number;
|
|
9
|
+
/** Size of the icon inside the trigger bubble */
|
|
10
|
+
iconSize?: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const BubbleTrigger: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
|
+
} & {
|
|
5
|
+
$size: number;
|
|
6
|
+
$bgColor: string;
|
|
7
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** @jsxImportSource @emotion/react */
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { TPopoverProps } from "./PopoverInterfaces";
|
|
4
|
+
export declare const Popover: ({ trigger, children, placement, align, color, showArrow, isOpen: controlledIsOpen, onToggle, closeOnOutsideClick, width, height, position, showCloseButton, sx, onOpen, onClose, expandable, collapsedSize, expandedSize, showExpandButton, topBarLeft, isExpanded: controlledIsExpanded, onExpandedChange, }: TPopoverProps) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("@emotion/react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Theme } from "@emotion/react";
|
|
2
|
+
import { Interpolation } from "@emotion/react";
|
|
3
|
+
export type TPopoverProps = {
|
|
4
|
+
/** The trigger element that opens the popover on click */
|
|
5
|
+
trigger: React.ReactNode;
|
|
6
|
+
/** The content rendered inside the popover */
|
|
7
|
+
children: React.ReactNode | ((actions: TPopoverActions) => React.ReactNode);
|
|
8
|
+
/** Controls placement of the popover relative to the trigger */
|
|
9
|
+
placement?: "top" | "bottom" | "left" | "right";
|
|
10
|
+
/** Controls alignment of the popover panel relative to the trigger */
|
|
11
|
+
align?: "start" | "center" | "end";
|
|
12
|
+
/** Background color of the popover */
|
|
13
|
+
color?: string;
|
|
14
|
+
/** Whether to show the arrow pointing to the trigger */
|
|
15
|
+
showArrow?: boolean;
|
|
16
|
+
/** Controlled open state. */
|
|
17
|
+
isOpen?: boolean;
|
|
18
|
+
/** Called when the popover requests to open or close (controlled mode) */
|
|
19
|
+
onToggle?: (isOpen: boolean) => void;
|
|
20
|
+
/** Close the popover when clicking outside of it */
|
|
21
|
+
closeOnOutsideClick?: boolean;
|
|
22
|
+
/** Custom width of collapsed popover panel */
|
|
23
|
+
width?: string;
|
|
24
|
+
/** Custom height of collapsed popover panel */
|
|
25
|
+
height?: string;
|
|
26
|
+
/** Positions the trigger fixed on the screen */
|
|
27
|
+
position?: TPopoverPosition;
|
|
28
|
+
/** Whether ti show a close button */
|
|
29
|
+
showCloseButton?: boolean;
|
|
30
|
+
/** Custom styles applied to the popover panel */
|
|
31
|
+
sx?: Interpolation<Theme>;
|
|
32
|
+
/** Called when the popover opens */
|
|
33
|
+
onOpen?: () => void;
|
|
34
|
+
/** Called when the popover closes */
|
|
35
|
+
onClose?: () => void;
|
|
36
|
+
/** Controlled expanded state. If provided, the expanded mode is controlled */
|
|
37
|
+
/** Enables the expand/collapse feature */
|
|
38
|
+
expandable?: boolean;
|
|
39
|
+
/** Size of the collapsed popover panel. Overrides width/height when it is expandable popover */
|
|
40
|
+
collapsedSize?: {
|
|
41
|
+
width?: string;
|
|
42
|
+
height?: string;
|
|
43
|
+
};
|
|
44
|
+
/** Size of the expanded popover panel. Defaults to 90vw x 90vh */
|
|
45
|
+
expandedSize?: {
|
|
46
|
+
width?: string;
|
|
47
|
+
height?: string;
|
|
48
|
+
};
|
|
49
|
+
/** Whether to show expand/collapse button in the top bar */
|
|
50
|
+
showExpandButton?: boolean;
|
|
51
|
+
/** Content to render on the left side of the top bar */
|
|
52
|
+
topBarLeft?: (isExpanded: boolean) => React.ReactNode;
|
|
53
|
+
/** Controlled expanded state */
|
|
54
|
+
isExpanded?: boolean;
|
|
55
|
+
/** Called when the expanded state changes */
|
|
56
|
+
onExpandedChange?: (isExpanded: boolean) => void;
|
|
57
|
+
};
|
|
58
|
+
export type TPopoverActions = {
|
|
59
|
+
/** Closes the popover */
|
|
60
|
+
close: () => void;
|
|
61
|
+
/** Expands the popover when expandable={true} */
|
|
62
|
+
expand: () => void;
|
|
63
|
+
/** Collapses the popover when expandable={true} */
|
|
64
|
+
collapse: () => void;
|
|
65
|
+
/** Whether the popover is currently expanded */
|
|
66
|
+
isExpanded: boolean;
|
|
67
|
+
};
|
|
68
|
+
export type TPopoverPosition = {
|
|
69
|
+
/** Distance from top of viewport */
|
|
70
|
+
top?: string;
|
|
71
|
+
/** Distance from bottom of viewport */
|
|
72
|
+
bottom?: string;
|
|
73
|
+
/** Distance from left of viewport */
|
|
74
|
+
left?: string;
|
|
75
|
+
/** Distance from right of viewport */
|
|
76
|
+
right?: string;
|
|
77
|
+
/** Z-index of the fixed wrapper */
|
|
78
|
+
zIndex?: number;
|
|
79
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare const getPositionStyles: (placement: "top" | "bottom" | "left" | "right", align: "start" | "center" | "end") => import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const PopoverWrapper: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme;
|
|
4
|
+
as?: React.ElementType;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const PopoverTriggerContainer: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme;
|
|
8
|
+
as?: React.ElementType;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const PopoverArrow: import("@emotion/styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme;
|
|
12
|
+
as?: React.ElementType;
|
|
13
|
+
} & {
|
|
14
|
+
$placement: "top" | "bottom" | "left" | "right";
|
|
15
|
+
$bgColor: string;
|
|
16
|
+
$isOpen: boolean;
|
|
17
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
18
|
+
export declare const PopoverContent: import("@emotion/styled").StyledComponent<{
|
|
19
|
+
theme?: import("@emotion/react").Theme;
|
|
20
|
+
as?: React.ElementType;
|
|
21
|
+
} & {
|
|
22
|
+
$isOpen: boolean;
|
|
23
|
+
$placement: "top" | "bottom" | "left" | "right";
|
|
24
|
+
$align: "start" | "center" | "end";
|
|
25
|
+
$bgColor: string;
|
|
26
|
+
$textColor: string;
|
|
27
|
+
$width?: string;
|
|
28
|
+
$height?: string;
|
|
29
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
30
|
+
export declare const Backdrop: import("@emotion/styled").StyledComponent<{
|
|
31
|
+
theme?: import("@emotion/react").Theme;
|
|
32
|
+
as?: React.ElementType;
|
|
33
|
+
} & {
|
|
34
|
+
$isVisible: boolean;
|
|
35
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
36
|
+
export declare const Panel: import("@emotion/styled").StyledComponent<{
|
|
37
|
+
theme?: import("@emotion/react").Theme;
|
|
38
|
+
as?: React.ElementType;
|
|
39
|
+
} & {
|
|
40
|
+
$isOpen: boolean;
|
|
41
|
+
$isExpanded: boolean;
|
|
42
|
+
$collapsedWidth?: string;
|
|
43
|
+
$collapsedHeight?: string;
|
|
44
|
+
$expandedWidth?: string;
|
|
45
|
+
$expandedHeight?: string;
|
|
46
|
+
$bgColor: string;
|
|
47
|
+
$textColor: string;
|
|
48
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
49
|
+
export declare const TopBar: import("@emotion/styled").StyledComponent<{
|
|
50
|
+
theme?: import("@emotion/react").Theme;
|
|
51
|
+
as?: React.ElementType;
|
|
52
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
53
|
+
export declare const PanelContent: import("@emotion/styled").StyledComponent<{
|
|
54
|
+
theme?: import("@emotion/react").Theme;
|
|
55
|
+
as?: React.ElementType;
|
|
56
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
|
|
|
2
2
|
import * as _emotion_react from '@emotion/react';
|
|
3
3
|
import { Interpolation, Theme } from '@emotion/react';
|
|
4
4
|
import * as react from 'react';
|
|
5
|
-
import { PropsWithChildren, ReactElement, FC, ReactNode } from 'react';
|
|
5
|
+
import react__default, { PropsWithChildren, ReactElement, FC, ReactNode } from 'react';
|
|
6
6
|
import * as _emotion_styled from '@emotion/styled';
|
|
7
7
|
import { CreateStyled } from '@emotion/styled';
|
|
8
8
|
import { ColumnDef } from '@tanstack/react-table';
|
|
@@ -28,6 +28,8 @@ type TButtonProps = {
|
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
/** Elements to render as children */
|
|
30
30
|
children?: React.ReactNode;
|
|
31
|
+
/** HTML data-testid for testing */
|
|
32
|
+
"data-testid"?: string;
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
declare const Button: (props: TButtonProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
@@ -677,6 +679,99 @@ type TSwitchProps = {
|
|
|
677
679
|
|
|
678
680
|
declare const Switch: (props: TSwitchProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
679
681
|
|
|
682
|
+
type TPopoverProps = {
|
|
683
|
+
/** The trigger element that opens the popover on click */
|
|
684
|
+
trigger: React.ReactNode;
|
|
685
|
+
/** The content rendered inside the popover */
|
|
686
|
+
children: React.ReactNode | ((actions: TPopoverActions) => React.ReactNode);
|
|
687
|
+
/** Controls placement of the popover relative to the trigger */
|
|
688
|
+
placement?: "top" | "bottom" | "left" | "right";
|
|
689
|
+
/** Controls alignment of the popover panel relative to the trigger */
|
|
690
|
+
align?: "start" | "center" | "end";
|
|
691
|
+
/** Background color of the popover */
|
|
692
|
+
color?: string;
|
|
693
|
+
/** Whether to show the arrow pointing to the trigger */
|
|
694
|
+
showArrow?: boolean;
|
|
695
|
+
/** Controlled open state. */
|
|
696
|
+
isOpen?: boolean;
|
|
697
|
+
/** Called when the popover requests to open or close (controlled mode) */
|
|
698
|
+
onToggle?: (isOpen: boolean) => void;
|
|
699
|
+
/** Close the popover when clicking outside of it */
|
|
700
|
+
closeOnOutsideClick?: boolean;
|
|
701
|
+
/** Custom width of collapsed popover panel */
|
|
702
|
+
width?: string;
|
|
703
|
+
/** Custom height of collapsed popover panel */
|
|
704
|
+
height?: string;
|
|
705
|
+
/** Positions the trigger fixed on the screen */
|
|
706
|
+
position?: TPopoverPosition;
|
|
707
|
+
/** Whether ti show a close button */
|
|
708
|
+
showCloseButton?: boolean;
|
|
709
|
+
/** Custom styles applied to the popover panel */
|
|
710
|
+
sx?: Interpolation<Theme>;
|
|
711
|
+
/** Called when the popover opens */
|
|
712
|
+
onOpen?: () => void;
|
|
713
|
+
/** Called when the popover closes */
|
|
714
|
+
onClose?: () => void;
|
|
715
|
+
/** Controlled expanded state. If provided, the expanded mode is controlled */
|
|
716
|
+
/** Enables the expand/collapse feature */
|
|
717
|
+
expandable?: boolean;
|
|
718
|
+
/** Size of the collapsed popover panel. Overrides width/height when it is expandable popover */
|
|
719
|
+
collapsedSize?: {
|
|
720
|
+
width?: string;
|
|
721
|
+
height?: string;
|
|
722
|
+
};
|
|
723
|
+
/** Size of the expanded popover panel. Defaults to 90vw x 90vh */
|
|
724
|
+
expandedSize?: {
|
|
725
|
+
width?: string;
|
|
726
|
+
height?: string;
|
|
727
|
+
};
|
|
728
|
+
/** Whether to show expand/collapse button in the top bar */
|
|
729
|
+
showExpandButton?: boolean;
|
|
730
|
+
/** Content to render on the left side of the top bar */
|
|
731
|
+
topBarLeft?: (isExpanded: boolean) => React.ReactNode;
|
|
732
|
+
/** Controlled expanded state */
|
|
733
|
+
isExpanded?: boolean;
|
|
734
|
+
/** Called when the expanded state changes */
|
|
735
|
+
onExpandedChange?: (isExpanded: boolean) => void;
|
|
736
|
+
};
|
|
737
|
+
type TPopoverActions = {
|
|
738
|
+
/** Closes the popover */
|
|
739
|
+
close: () => void;
|
|
740
|
+
/** Expands the popover when expandable={true} */
|
|
741
|
+
expand: () => void;
|
|
742
|
+
/** Collapses the popover when expandable={true} */
|
|
743
|
+
collapse: () => void;
|
|
744
|
+
/** Whether the popover is currently expanded */
|
|
745
|
+
isExpanded: boolean;
|
|
746
|
+
};
|
|
747
|
+
type TPopoverPosition = {
|
|
748
|
+
/** Distance from top of viewport */
|
|
749
|
+
top?: string;
|
|
750
|
+
/** Distance from bottom of viewport */
|
|
751
|
+
bottom?: string;
|
|
752
|
+
/** Distance from left of viewport */
|
|
753
|
+
left?: string;
|
|
754
|
+
/** Distance from right of viewport */
|
|
755
|
+
right?: string;
|
|
756
|
+
/** Z-index of the fixed wrapper */
|
|
757
|
+
zIndex?: number;
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
declare const Popover: ({ trigger, children, placement, align, color, showArrow, isOpen: controlledIsOpen, onToggle, closeOnOutsideClick, width, height, position, showCloseButton, sx, onOpen, onClose, expandable, collapsedSize, expandedSize, showExpandButton, topBarLeft, isExpanded: controlledIsExpanded, onExpandedChange, }: TPopoverProps) => string | number | bigint | boolean | Iterable<react__default.ReactNode> | Promise<string | number | bigint | boolean | react__default.ReactPortal | react__default.ReactElement<unknown, string | react__default.JSXElementConstructor<any>> | Iterable<react__default.ReactNode> | null | undefined> | _emotion_react_jsx_runtime.JSX.Element | null | undefined;
|
|
761
|
+
|
|
762
|
+
type TAIBubbleProps = Omit<TPopoverProps, "trigger" | "children" | "topBarLeft" | "expandable"> & {
|
|
763
|
+
/** URL to embed in the iframe */
|
|
764
|
+
url: string;
|
|
765
|
+
/** URL to external link */
|
|
766
|
+
externalUrl?: string;
|
|
767
|
+
/** Size of the trigger bubble */
|
|
768
|
+
bubbleSize?: number;
|
|
769
|
+
/** Size of the icon inside the trigger bubble */
|
|
770
|
+
iconSize?: number;
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
declare const AIBubble: ({ url, externalUrl, placement, align, color, bubbleSize, iconSize, collapsedSize, showCloseButton, showExpandButton, ...rest }: TAIBubbleProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
774
|
+
|
|
680
775
|
/**
|
|
681
776
|
* emotion.js doesn't support transient options out of the box.
|
|
682
777
|
*
|
|
@@ -726,4 +821,4 @@ declare const getActiveColor: (color: string) => string;
|
|
|
726
821
|
|
|
727
822
|
declare function usePrefersColorScheme(): "light" | "dark";
|
|
728
823
|
|
|
729
|
-
export { Accordion, AccordionGroup, Button, Card, CardContent, CardFooter, CardHeader, CardIndicators, CardMediaSection, Checkbox, ControlledTreeView, DataGrid, Drawer, Dropdown, IBackgroundColors, ICommonColors, IIndicatorColors, IPalette, IStandardPaletteColor, ITagColors, IThemeContextProps, IThemeContextValue, Indicator, InputField, Modal, MultiSelect, MultiSelectProps, MultiViewGrid, MultiViewList, SingleSelect, SingleSelectProps, Slider, Switch, TAccordionProps, TButtonProps, TButtonVariants, TCardSectionProps, TCellValues, TCheckboxProps, TColorScale, TControlledTreeViewProps, TCustomRenderProps, TDataGridProps, TDataGridRow, TDrawerProps, TDropdownItem, TDropdownItemProps, TDropdownProps, TIndicatorInstanceProps, TIndicatorProps, TIndicatorVariants, TModalProps, TMultiViewGridProps, TMultiViewListProps, TRenderTriggerProps, TSliderProps, TSwitchProps, TTableCell, TTableProps, TTableRow, TTagProps, TTextFieldProps, TThemeMode, TTreeViewItem, TUncontrolledTreeViewProps, TViewState, Table, Tag, ThemeContextProvider, UncontrolledTreeView, commonColors, darkenColor, defaultDarkPalette, defaultLightPalette, getActiveColor, getContrastColor, getHoverColor, lightenColor, renderCell, transientOptions, useIsMobile, usePrefersColorScheme, useThemeContext };
|
|
824
|
+
export { AIBubble, Accordion, AccordionGroup, Button, Card, CardContent, CardFooter, CardHeader, CardIndicators, CardMediaSection, Checkbox, ControlledTreeView, DataGrid, Drawer, Dropdown, IBackgroundColors, ICommonColors, IIndicatorColors, IPalette, IStandardPaletteColor, ITagColors, IThemeContextProps, IThemeContextValue, Indicator, InputField, Modal, MultiSelect, MultiSelectProps, MultiViewGrid, MultiViewList, Popover, SingleSelect, SingleSelectProps, Slider, Switch, TAIBubbleProps, TAccordionProps, TButtonProps, TButtonVariants, TCardSectionProps, TCellValues, TCheckboxProps, TColorScale, TControlledTreeViewProps, TCustomRenderProps, TDataGridProps, TDataGridRow, TDrawerProps, TDropdownItem, TDropdownItemProps, TDropdownProps, TIndicatorInstanceProps, TIndicatorProps, TIndicatorVariants, TModalProps, TMultiViewGridProps, TMultiViewListProps, TPopoverActions, TPopoverPosition, TPopoverProps, TRenderTriggerProps, TSliderProps, TSwitchProps, TTableCell, TTableProps, TTableRow, TTagProps, TTextFieldProps, TThemeMode, TTreeViewItem, TUncontrolledTreeViewProps, TViewState, Table, Tag, ThemeContextProvider, UncontrolledTreeView, commonColors, darkenColor, defaultDarkPalette, defaultLightPalette, getActiveColor, getContrastColor, getHoverColor, lightenColor, renderCell, transientOptions, useIsMobile, usePrefersColorScheme, useThemeContext };
|