@livechat/design-system-react-components 2.2.2 → 2.3.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/components/Accordion/Accordion.d.ts +3 -0
- package/dist/components/Accordion/components/AccordionAnimatedLabel.d.ts +3 -0
- package/dist/components/Accordion/components/AccordionMultilineElement.d.ts +6 -0
- package/dist/components/Accordion/helpers.d.ts +10 -0
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/Accordion/stories-helpers.d.ts +4 -0
- package/dist/components/Accordion/types.d.ts +45 -0
- package/dist/components/ActionBar/ActionBar.d.ts +3 -0
- package/dist/components/ActionBar/ActionBarItem.d.ts +3 -0
- package/dist/components/ActionBar/constants.d.ts +3 -0
- package/dist/components/ActionBar/index.d.ts +2 -0
- package/dist/components/ActionBar/types.d.ts +45 -0
- package/dist/components/ActionCard/ActionCard.d.ts +4 -0
- package/dist/components/ActionCard/index.d.ts +2 -0
- package/dist/components/ActionCard/types.d.ts +23 -0
- package/dist/components/ActionMenu/ActionMenu.d.ts +3 -0
- package/dist/components/ActionMenu/ActionMenuItem.d.ts +3 -0
- package/dist/components/ActionMenu/index.d.ts +3 -0
- package/dist/components/ActionMenu/stories-constants.d.ts +15 -0
- package/dist/components/ActionMenu/types.d.ts +80 -0
- package/dist/components/Alert/Alert.d.ts +29 -0
- package/dist/components/Alert/index.d.ts +1 -0
- package/dist/components/AppFrame/AppFrame.d.ts +3 -0
- package/dist/components/AppFrame/components/ExpirationCounter/ExpirationCounter.d.ts +21 -0
- package/dist/components/AppFrame/components/MobileNavigation/MobileNavigation.d.ts +3 -0
- package/dist/components/AppFrame/components/MobileNavigation/types.d.ts +8 -0
- package/dist/components/AppFrame/components/Navigation/Navigation.d.ts +3 -0
- package/dist/components/AppFrame/components/Navigation/types.d.ts +8 -0
- package/dist/components/AppFrame/components/NavigationGroup/NavigationGroup.d.ts +3 -0
- package/dist/components/AppFrame/components/NavigationGroup/types.d.ts +16 -0
- package/dist/components/AppFrame/components/NavigationItem/NavigationItem.d.ts +3 -0
- package/dist/components/AppFrame/components/NavigationItem/types.d.ts +40 -0
- package/dist/components/AppFrame/components/NavigationTopBar/NavigationTopBar.d.ts +45 -0
- package/dist/components/AppFrame/components/NavigationTopBar/examples.d.ts +15 -0
- package/dist/components/AppFrame/components/NavigationTopBar/types.d.ts +59 -0
- package/dist/components/AppFrame/components/SideNavigation/SideNavigation.d.ts +3 -0
- package/dist/components/AppFrame/components/SideNavigation/types.d.ts +28 -0
- package/dist/components/AppFrame/components/SideNavigationGroup/SideNavigationGroup.d.ts +3 -0
- package/dist/components/AppFrame/components/SideNavigationGroup/types.d.ts +32 -0
- package/dist/components/AppFrame/components/SideNavigationItem/SideNavigationItem.d.ts +3 -0
- package/dist/components/AppFrame/components/SideNavigationItem/constants.d.ts +3 -0
- package/dist/components/AppFrame/components/SideNavigationItem/types.d.ts +44 -0
- package/dist/components/AppFrame/components/index.d.ts +10 -0
- package/dist/components/AppFrame/index.d.ts +2 -0
- package/dist/components/AppFrame/stories-helpers.d.ts +19 -0
- package/dist/components/AppFrame/types.d.ts +47 -0
- package/dist/components/AutoComplete/AutoComplete.d.ts +13 -0
- package/dist/components/AutoComplete/helpers.d.ts +7 -0
- package/dist/components/AutoComplete/index.d.ts +5 -0
- package/dist/components/AutoComplete/types.d.ts +27 -0
- package/dist/components/Avatar/Avatar.d.ts +42 -0
- package/dist/components/Avatar/Avatar.helpers.d.ts +3 -0
- package/dist/components/Avatar/index.d.ts +3 -0
- package/dist/components/Avatar/types.d.ts +8 -0
- package/dist/components/Badge/Badge.d.ts +27 -0
- package/dist/components/Badge/Badge.helpers.d.ts +1 -0
- package/dist/components/Badge/index.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +70 -0
- package/dist/components/Button/Button.helpers.d.ts +6 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Button/types.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +30 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +16 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +4 -0
- package/dist/components/DatePicker/DatePickerNavbar.d.ts +4 -0
- package/dist/components/DatePicker/DatePickerRangeCalendarsWrapper.d.ts +2 -0
- package/dist/components/DatePicker/RangeDatePicker.d.ts +17 -0
- package/dist/components/DatePicker/helpers.d.ts +17 -0
- package/dist/components/DatePicker/hooks.d.ts +7 -0
- package/dist/components/DatePicker/index.d.ts +3 -0
- package/dist/components/DatePicker/types.d.ts +101 -0
- package/dist/components/DetailsCard/DetailsCard.d.ts +40 -0
- package/dist/components/DetailsCard/index.d.ts +2 -0
- package/dist/components/DetailsCardInfo/DetailsCardInfo.d.ts +8 -0
- package/dist/components/DetailsCardInfo/index.d.ts +1 -0
- package/dist/components/FieldDescription/FieldDescription.d.ts +3 -0
- package/dist/components/FieldDescription/index.d.ts +1 -0
- package/dist/components/FieldError/FieldError.d.ts +3 -0
- package/dist/components/FieldError/index.d.ts +1 -0
- package/dist/components/FieldGroup/FieldGroup.d.ts +8 -0
- package/dist/components/FieldGroup/index.d.ts +1 -0
- package/dist/components/FileUploadProgress/FileUploadProgress.d.ts +42 -0
- package/dist/components/FileUploadProgress/FileUploadProgressActions.d.ts +9 -0
- package/dist/components/FileUploadProgress/index.d.ts +2 -0
- package/dist/components/Form/Form.d.ts +16 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/FormField/FormField.d.ts +40 -0
- package/dist/components/FormField/index.d.ts +1 -0
- package/dist/components/FormGroup/FormGroup.d.ts +16 -0
- package/dist/components/FormGroup/index.d.ts +1 -0
- package/dist/components/Icon/Icon.d.ts +32 -0
- package/dist/components/Icon/IconsShowcase/IconsShowcase.d.ts +11 -0
- package/dist/components/Icon/IconsShowcase/constans.d.ts +3 -0
- package/dist/components/Icon/IconsShowcase/helpers.d.ts +3 -0
- package/dist/components/Icon/IconsShowcase/types.d.ts +9 -0
- package/dist/components/Icon/index.d.ts +2 -0
- package/dist/components/Icon/types.d.ts +3 -0
- package/dist/components/Input/Input.d.ts +29 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/InviteAgents/InviteAgents.d.ts +3 -0
- package/dist/components/InviteAgents/components/AnimatedButton/AnimatedButton.d.ts +24 -0
- package/dist/components/InviteAgents/helpers.d.ts +4 -0
- package/dist/components/InviteAgents/index.d.ts +2 -0
- package/dist/components/InviteAgents/types.d.ts +34 -0
- package/dist/components/Link/Link.d.ts +14 -0
- package/dist/components/Link/index.d.ts +1 -0
- package/dist/components/Loader/Loader.d.ts +20 -0
- package/dist/components/Loader/index.d.ts +1 -0
- package/dist/components/Modal/Modal.d.ts +25 -0
- package/dist/components/Modal/StoriesComponents.d.ts +4 -0
- package/dist/components/Modal/components/ActionModalContent.d.ts +29 -0
- package/dist/components/Modal/components/ModalBase.d.ts +24 -0
- package/dist/components/Modal/components/ModalCloseButton.d.ts +7 -0
- package/dist/components/Modal/components/ModalHeader.d.ts +26 -0
- package/dist/components/Modal/components/ModalPortal.d.ts +8 -0
- package/dist/components/Modal/index.d.ts +11 -0
- package/dist/components/NumericInput/NumericInput.d.ts +12 -0
- package/dist/components/NumericInput/index.d.ts +1 -0
- package/dist/components/OnboardingChecklist/OnboardingChecklist.d.ts +3 -0
- package/dist/components/OnboardingChecklist/components/CheckListItem.d.ts +3 -0
- package/dist/components/OnboardingChecklist/components/index.d.ts +1 -0
- package/dist/components/OnboardingChecklist/index.d.ts +2 -0
- package/dist/components/OnboardingChecklist/types.d.ts +97 -0
- package/dist/components/Picker/Picker.d.ts +3 -0
- package/dist/components/Picker/components/PickerList.d.ts +27 -0
- package/dist/components/Picker/components/PickerListItem.d.ts +14 -0
- package/dist/components/Picker/components/PickerTrigger.d.ts +18 -0
- package/dist/components/Picker/components/PickerTriggerBody.d.ts +23 -0
- package/dist/components/Picker/constants.d.ts +40 -0
- package/dist/components/Picker/helpers.d.ts +6 -0
- package/dist/components/Picker/hooks/useFloatingPicker.d.ts +36 -0
- package/dist/components/Picker/hooks/usePickerItems.d.ts +23 -0
- package/dist/components/Picker/index.d.ts +3 -0
- package/dist/components/Picker/types.d.ts +143 -0
- package/dist/components/Popover/Popover.d.ts +3 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Popover/types.d.ts +65 -0
- package/dist/components/ProductSwitcher/ProductSwitcher.d.ts +4 -0
- package/dist/components/ProductSwitcher/components/ProductRow/ProductRow.d.ts +10 -0
- package/dist/components/ProductSwitcher/components/ProductTile/ProductTile.d.ts +9 -0
- package/dist/components/ProductSwitcher/constants.d.ts +7 -0
- package/dist/components/ProductSwitcher/helpers.d.ts +10 -0
- package/dist/components/ProductSwitcher/hooks/useProductSwitcher.d.ts +14 -0
- package/dist/components/ProductSwitcher/index.d.ts +4 -0
- package/dist/components/ProductSwitcher/openwidgetLogoUri.d.ts +1 -0
- package/dist/components/ProductSwitcher/types.d.ts +46 -0
- package/dist/components/Progress/Progress.helpers.d.ts +3 -0
- package/dist/components/Progress/ProgressBar.d.ts +21 -0
- package/dist/components/Progress/ProgressCircle.d.ts +21 -0
- package/dist/components/Progress/constants.d.ts +3 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/PromoBanner/PromoBanner.d.ts +43 -0
- package/dist/components/PromoBanner/index.d.ts +1 -0
- package/dist/components/PromoBannerV2/PromoBannerV2.d.ts +45 -0
- package/dist/components/PromoBannerV2/constants.d.ts +1 -0
- package/dist/components/PromoBannerV2/index.d.ts +2 -0
- package/dist/components/RadioButton/RadioButton.d.ts +7 -0
- package/dist/components/RadioButton/index.d.ts +1 -0
- package/dist/components/Search/Search.d.ts +40 -0
- package/dist/components/Search/index.d.ts +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +39 -0
- package/dist/components/SegmentedControl/index.d.ts +2 -0
- package/dist/components/Skeleton/SkeletonAvatar.d.ts +16 -0
- package/dist/components/Skeleton/SkeletonText.d.ts +16 -0
- package/dist/components/Skeleton/SkeletonWrapper.d.ts +16 -0
- package/dist/components/Skeleton/index.d.ts +3 -0
- package/dist/components/StatusBadge/StatusBadge.d.ts +13 -0
- package/dist/components/StatusBadge/index.d.ts +1 -0
- package/dist/components/Switch/Switch.d.ts +47 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/Tab/Tab.d.ts +31 -0
- package/dist/components/Tab/TabsWrapper.d.ts +3 -0
- package/dist/components/Tab/index.d.ts +2 -0
- package/dist/components/Tag/Tag.d.ts +3 -0
- package/dist/components/Tag/constants.d.ts +2 -0
- package/dist/components/Tag/index.d.ts +3 -0
- package/dist/components/Tag/types.d.ts +55 -0
- package/dist/components/TagInput/TagInput.d.ts +3 -0
- package/dist/components/TagInput/components/EditableTag.d.ts +13 -0
- package/dist/components/TagInput/components/EditableTagContent.d.ts +11 -0
- package/dist/components/TagInput/components/EmailTagInput.d.ts +5 -0
- package/dist/components/TagInput/index.d.ts +4 -0
- package/dist/components/TagInput/types.d.ts +41 -0
- package/dist/components/Textarea/Textarea.d.ts +6 -0
- package/dist/components/Textarea/index.d.ts +1 -0
- package/dist/components/Toast/Toast.d.ts +16 -0
- package/dist/components/Toast/ToastWrapper.d.ts +20 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +3 -0
- package/dist/components/Tooltip/Tooltip.helpers.d.ts +10 -0
- package/dist/components/Tooltip/components/Info.d.ts +3 -0
- package/dist/components/Tooltip/components/Interactive.d.ts +3 -0
- package/dist/components/Tooltip/components/Reports.d.ts +7 -0
- package/dist/components/Tooltip/components/Simple.d.ts +4 -0
- package/dist/components/Tooltip/components/UserGuide/SpotlightOverlay.d.ts +8 -0
- package/dist/components/Tooltip/components/UserGuide/UserGuide.d.ts +12 -0
- package/dist/components/Tooltip/components/UserGuide/UserGuideStep.d.ts +16 -0
- package/dist/components/Tooltip/components/UserGuide/index.d.ts +1 -0
- package/dist/components/Tooltip/components/UserGuide/virtualElementReference.d.ts +9 -0
- package/dist/components/Tooltip/components/index.d.ts +5 -0
- package/dist/components/Tooltip/index.d.ts +4 -0
- package/dist/components/Tooltip/types.d.ts +199 -0
- package/dist/components/Typography/Display.d.ts +18 -0
- package/dist/components/Typography/Heading.d.ts +19 -0
- package/dist/components/Typography/Text.d.ts +31 -0
- package/dist/components/Typography/index.d.ts +4 -0
- package/dist/components/Typography/types.d.ts +4 -0
- package/dist/components/UpdateBadge/UpdateBadge.d.ts +2 -0
- package/dist/components/UpdateBadge/index.d.ts +1 -0
- package/dist/components/UploadBar/UploadBar.d.ts +49 -0
- package/dist/components/UploadBar/index.d.ts +1 -0
- package/dist/foundations/design-token.d.ts +374 -0
- package/dist/foundations/index.d.ts +5 -0
- package/dist/foundations/radius-token.d.ts +13 -0
- package/dist/foundations/shadow-token.d.ts +24 -0
- package/dist/foundations/spacing-token.d.ts +22 -0
- package/dist/foundations/transition-token.d.ts +17 -0
- package/dist/hooks/helpers.d.ts +3 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/types.d.ts +13 -0
- package/dist/hooks/useAnimations.d.ts +12 -0
- package/dist/hooks/useHeightResizer.d.ts +3 -0
- package/dist/hooks/useMobileViewDetector.d.ts +3 -0
- package/dist/hooks/useSharedResizeObserver.d.ts +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +55 -0
- package/dist/index.js +1435 -1440
- package/dist/providers/AppFrameProvider.d.ts +14 -0
- package/dist/providers/ThemeProvider.d.ts +20 -0
- package/dist/providers/constants.d.ts +4 -0
- package/dist/providers/helpers.d.ts +4 -0
- package/dist/providers/index.d.ts +5 -0
- package/dist/providers/types.d.ts +1 -0
- package/dist/utils/PdfIcon.d.ts +2 -0
- package/dist/utils/getDesignTokenWithOpacity.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/keyCodes.d.ts +12 -0
- package/dist/utils/noop.d.ts +1 -0
- package/dist/utils/plural.d.ts +1 -0
- package/dist/utils/story-parameters.d.ts +3 -0
- package/dist/utils/types.d.ts +16 -0
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AccordionLabel } from './types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare const isLabelObject: (label: React.ReactNode | {
|
|
4
|
+
open: React.ReactNode;
|
|
5
|
+
closed: React.ReactNode;
|
|
6
|
+
}) => label is {
|
|
7
|
+
open: React.ReactNode;
|
|
8
|
+
closed: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare const getLabel: (label: AccordionLabel, currentlyOpen: boolean) => React.ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Accordion } from './Accordion';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ComponentCoreProps } from '../../utils/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export type AccordionLabel = React.ReactNode | {
|
|
4
|
+
open: React.ReactNode;
|
|
5
|
+
closed: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export interface IAccordionProps extends ComponentCoreProps {
|
|
8
|
+
/**
|
|
9
|
+
* Specify the content of the accordion
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Specify the label of the accordion, single element or different for open and closed state
|
|
14
|
+
*/
|
|
15
|
+
label: AccordionLabel;
|
|
16
|
+
/**
|
|
17
|
+
* Specify the multiline element, which will be displayed under the label
|
|
18
|
+
*/
|
|
19
|
+
multilineElement?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Specify the kind of the accordion
|
|
22
|
+
*/
|
|
23
|
+
kind?: 'default' | 'warning' | 'error';
|
|
24
|
+
/**
|
|
25
|
+
* Specify if the accordion should be open on init
|
|
26
|
+
*/
|
|
27
|
+
openOnInit?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Set to control accordion state
|
|
30
|
+
*/
|
|
31
|
+
isOpen?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Optional handler called on accordion close
|
|
34
|
+
*/
|
|
35
|
+
onClose?: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Optional handler called on accordion open
|
|
38
|
+
*/
|
|
39
|
+
onOpen?: () => void;
|
|
40
|
+
}
|
|
41
|
+
export interface IAccordionAnimatedLabelProps {
|
|
42
|
+
open: React.ReactNode;
|
|
43
|
+
closed: React.ReactNode;
|
|
44
|
+
isOpen: boolean;
|
|
45
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface IActionBarProps {
|
|
3
|
+
/**
|
|
4
|
+
* The CSS class for menu container
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The unique id key
|
|
9
|
+
*/
|
|
10
|
+
id?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Array of action bar options
|
|
13
|
+
*/
|
|
14
|
+
options: IActionBarOption[];
|
|
15
|
+
/**
|
|
16
|
+
* Set the key for active element
|
|
17
|
+
*/
|
|
18
|
+
activeOptionKey?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Set 'scroll' to disable menu and enable scroll
|
|
21
|
+
*/
|
|
22
|
+
type?: 'menu' | 'scroll';
|
|
23
|
+
/**
|
|
24
|
+
* Set the bar buttons verticaly
|
|
25
|
+
*/
|
|
26
|
+
vertical?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Optional element that will be placed at the bottom of the menu
|
|
29
|
+
*/
|
|
30
|
+
menuFooter?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export interface IActionBarOption {
|
|
33
|
+
key: string;
|
|
34
|
+
element: React.ReactElement;
|
|
35
|
+
label: string;
|
|
36
|
+
withDivider?: boolean;
|
|
37
|
+
showTooltip?: boolean;
|
|
38
|
+
hideInMenu?: boolean;
|
|
39
|
+
onClick: () => void;
|
|
40
|
+
}
|
|
41
|
+
export interface IActionBarItem {
|
|
42
|
+
option: IActionBarOption;
|
|
43
|
+
isActive?: boolean;
|
|
44
|
+
vertical?: boolean;
|
|
45
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ActionCardProps {
|
|
3
|
+
/**
|
|
4
|
+
* The CSS class for main container
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The CSS class for the first column container
|
|
9
|
+
*/
|
|
10
|
+
firstColumnClassName?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The CSS class for the second column container
|
|
13
|
+
*/
|
|
14
|
+
secondColumnClassName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional element that will be placed in the second column
|
|
17
|
+
*/
|
|
18
|
+
secondColumn?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Optional handler called on card click
|
|
21
|
+
*/
|
|
22
|
+
onClick?: () => void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as noop } from '../../utils/noop';
|
|
2
|
+
|
|
3
|
+
export declare const exampleOptions: ({
|
|
4
|
+
key: string;
|
|
5
|
+
element: import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
onClick: typeof noop;
|
|
7
|
+
disabled?: undefined;
|
|
8
|
+
withDivider?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
key: string;
|
|
11
|
+
element: import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
withDivider: boolean;
|
|
14
|
+
onClick: typeof noop;
|
|
15
|
+
})[];
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Placement, flip, Strategy } from '@floating-ui/react';
|
|
2
|
+
import { ComponentCoreProps } from '../../utils/types';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export interface IActionMenuOption {
|
|
5
|
+
key: string;
|
|
6
|
+
element: React.ReactNode;
|
|
7
|
+
groupHeader?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
withDivider?: boolean;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface IActionMenuProps extends ComponentCoreProps {
|
|
13
|
+
/**
|
|
14
|
+
* The CSS class for trigger container
|
|
15
|
+
*/
|
|
16
|
+
triggerClassName?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Array of menu options
|
|
19
|
+
*/
|
|
20
|
+
options: IActionMenuOption[];
|
|
21
|
+
/**
|
|
22
|
+
* Array of selected menu options keys
|
|
23
|
+
*/
|
|
24
|
+
selectedOptions?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Trigger element
|
|
27
|
+
*/
|
|
28
|
+
triggerRenderer: React.ReactElement;
|
|
29
|
+
/**
|
|
30
|
+
* The menu placement
|
|
31
|
+
*/
|
|
32
|
+
placement?: Placement;
|
|
33
|
+
/**
|
|
34
|
+
* Will open menu on component initialization
|
|
35
|
+
*/
|
|
36
|
+
openedOnInit?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Menu will stay open after option click
|
|
39
|
+
*/
|
|
40
|
+
keepOpenOnClick?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Set the menu placement to keep it in view
|
|
43
|
+
*/
|
|
44
|
+
flipOptions?: Parameters<typeof flip>[0];
|
|
45
|
+
/**
|
|
46
|
+
* Set to control the menu visibility
|
|
47
|
+
*/
|
|
48
|
+
visible?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Optional handler called on menu close
|
|
51
|
+
*/
|
|
52
|
+
onClose?: () => void;
|
|
53
|
+
/**
|
|
54
|
+
* Optional handler called on menu open
|
|
55
|
+
*/
|
|
56
|
+
onOpen?: () => void;
|
|
57
|
+
/**
|
|
58
|
+
* Set the type of CSS position property to use
|
|
59
|
+
* https://floating-ui.com/docs/usefloating#strategy
|
|
60
|
+
*/
|
|
61
|
+
floatingStrategy?: Strategy;
|
|
62
|
+
/**
|
|
63
|
+
* Optional footer element
|
|
64
|
+
*/
|
|
65
|
+
footer?: React.ReactNode;
|
|
66
|
+
}
|
|
67
|
+
export interface ActionMenuItemProps {
|
|
68
|
+
/**
|
|
69
|
+
* Renders given element on the left of element
|
|
70
|
+
*/
|
|
71
|
+
leftNode?: React.ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* Renders given element on the right of element
|
|
74
|
+
*/
|
|
75
|
+
rightNode?: React.ReactNode;
|
|
76
|
+
/**
|
|
77
|
+
* Specify the kind of menu item
|
|
78
|
+
*/
|
|
79
|
+
kind?: 'warning' | undefined;
|
|
80
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComponentCoreProps } from '../../utils/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type AlertKind = 'info' | 'warning' | 'success' | 'error';
|
|
4
|
+
export interface AlertProps extends ComponentCoreProps {
|
|
5
|
+
/**
|
|
6
|
+
* Specify the kind of Alert
|
|
7
|
+
*/
|
|
8
|
+
kind?: AlertKind;
|
|
9
|
+
/**
|
|
10
|
+
* Shows the primary CTA button
|
|
11
|
+
*/
|
|
12
|
+
primaryButton?: {
|
|
13
|
+
handleClick: () => void;
|
|
14
|
+
label: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Shows the secondary CTA button
|
|
18
|
+
*/
|
|
19
|
+
secondaryButton?: {
|
|
20
|
+
handleClick: () => void;
|
|
21
|
+
label: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The optional event handler for close button
|
|
25
|
+
*/
|
|
26
|
+
onClose?: () => void;
|
|
27
|
+
}
|
|
28
|
+
export declare const Alert: React.FC<React.PropsWithChildren<AlertProps>>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Alert } from './Alert';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentCoreProps } from '../../../../utils/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface IExpirationCounterProps extends ComponentCoreProps {
|
|
4
|
+
/**
|
|
5
|
+
* The ID of the item
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* The number of days left
|
|
10
|
+
*/
|
|
11
|
+
daysLeft: number;
|
|
12
|
+
/**
|
|
13
|
+
* The URL to navigate to
|
|
14
|
+
*/
|
|
15
|
+
url?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The function to call on click
|
|
18
|
+
*/
|
|
19
|
+
onClick: (e: React.MouseEvent<HTMLAnchorElement>, id: string) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const ExpirationCounter: React.FC<IExpirationCounterProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentCoreProps } from '../../../../utils/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface INavigationGroupProps extends ComponentCoreProps {
|
|
4
|
+
/**
|
|
5
|
+
* It will display your navigation elements
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The CSS class for the navigation bar list
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Specify whether the list should be scrollable
|
|
14
|
+
*/
|
|
15
|
+
scrollable?: boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentCoreProps } from '../../../../utils/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface INavigationItemProps extends ComponentCoreProps {
|
|
4
|
+
/**
|
|
5
|
+
* The ID of the item
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* The label of the item visible in the tooltip
|
|
10
|
+
*/
|
|
11
|
+
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Container for the icon or any other element
|
|
14
|
+
*/
|
|
15
|
+
icon: React.ReactElement;
|
|
16
|
+
/**
|
|
17
|
+
* The URL to navigate to
|
|
18
|
+
*/
|
|
19
|
+
url?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Set if you are preparing a custom element as a button icon and you do not want it to be semi-transparent without hover
|
|
22
|
+
*/
|
|
23
|
+
disableOpacity?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Specify whether the navigation item is disabled
|
|
26
|
+
*/
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Specify whether the badge should be visible and what type it should be
|
|
30
|
+
*/
|
|
31
|
+
badge?: 'dot' | 'alert' | number;
|
|
32
|
+
/**
|
|
33
|
+
* Specify whether the item is active
|
|
34
|
+
*/
|
|
35
|
+
isActive?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The function to call on click
|
|
38
|
+
*/
|
|
39
|
+
onClick: (e: React.MouseEvent<HTMLAnchorElement>, id: string) => void;
|
|
40
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { INavigationTopBarProps, ITopBarAlertProps, ITopBarTitleProps } from './types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* NavigationTopBar is used to display a top bar in the app frame - mostly to display alerts, but arbitrary content can be placed there too.
|
|
5
|
+
* @example
|
|
6
|
+
* <NavigationTopBar>
|
|
7
|
+
* <NavigationTopBar.Alert kind="error">
|
|
8
|
+
* Something went wrong
|
|
9
|
+
* </NavigationTopBar.Alert>
|
|
10
|
+
* </NavigationTopBar>
|
|
11
|
+
*/
|
|
12
|
+
export declare const NavigationTopBar: {
|
|
13
|
+
({ children, className, additionalNodes, }: INavigationTopBarProps): React.ReactElement;
|
|
14
|
+
Alert: React.FC<ITopBarAlertProps>;
|
|
15
|
+
Title: React.FC<ITopBarTitleProps>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Title component for the NavigationTopBar. Supposed to be placed in the `additionalNodes` prop of the NavigationTopBar.
|
|
19
|
+
* @example
|
|
20
|
+
* <NavigationTopBar additionalNodes={<NavigationTopBar.Title>Example top bar content</NavigationTopBar.Title>}>
|
|
21
|
+
* </NavigationTopBar>
|
|
22
|
+
*/
|
|
23
|
+
export declare const NavigationTopBarTitle: React.FC<ITopBarTitleProps>;
|
|
24
|
+
/**
|
|
25
|
+
* Alert component for the NavigationTopBar.
|
|
26
|
+
* @example
|
|
27
|
+
* <NavigationTopBar>
|
|
28
|
+
* <NavigationTopBar.Alert kind="error" show={!!error}>
|
|
29
|
+
* Something went wrong
|
|
30
|
+
* </NavigationTopBar.Alert>
|
|
31
|
+
* </NavigationTopBar>
|
|
32
|
+
* @example
|
|
33
|
+
* <NavigationTopBar>
|
|
34
|
+
* <NavigationTopBarAlert
|
|
35
|
+
* kind="warning"
|
|
36
|
+
* primaryCta={{ label: 'Save', onClick: () => console.log('Save clicked') }}
|
|
37
|
+
* secondaryCta={{ label: 'Discard', onClick: () => console.log('Discard clicked') }}
|
|
38
|
+
* closeButton={{ onClick: () => console.log('Close clicked') }}
|
|
39
|
+
* show={!hasUnsavedChanges && !hasClosedAlert}
|
|
40
|
+
* >
|
|
41
|
+
* You have unsaved changes
|
|
42
|
+
* </NavigationTopBarAlert>
|
|
43
|
+
* </NavigationTopBar>
|
|
44
|
+
**/
|
|
45
|
+
export declare const NavigationTopBarAlert: React.FC<ITopBarAlertProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const DisconnectedAlert: React.FC<{
|
|
3
|
+
show: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const ChameleonAlert: React.FC<{
|
|
7
|
+
show: boolean;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
kind: 'info' | 'success' | 'warning' | 'error';
|
|
10
|
+
changeKind: () => void;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const CustomBackgroundAlert: React.FC<{
|
|
13
|
+
show: boolean;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ButtonProps } from 'components/Button';
|
|
2
|
+
import { ComponentCoreProps } from 'utils/types';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export type NavigationTopBarKind = 'info' | 'success' | 'warning' | 'error';
|
|
5
|
+
export interface INavigationTopBarProps extends ComponentCoreProps {
|
|
6
|
+
/**
|
|
7
|
+
* Contents of the top bar. You can use the `NavigationTopBar.Alert` component to display alerts.
|
|
8
|
+
*/
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Ńodes placed under the children.
|
|
12
|
+
*/
|
|
13
|
+
additionalNodes?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export interface ITopBarTitleProps extends ComponentCoreProps {
|
|
16
|
+
/**
|
|
17
|
+
* Content of the title.
|
|
18
|
+
*/
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
type CTAProps = {
|
|
22
|
+
label: string;
|
|
23
|
+
onClick: () => void;
|
|
24
|
+
} & Omit<ButtonProps, 'onClick' | 'children'>;
|
|
25
|
+
export interface ITopBarAlertProps extends ComponentCoreProps {
|
|
26
|
+
/**
|
|
27
|
+
* Visual style of the alert. You can also use `className` to style the alert if you need to set a custom background color.
|
|
28
|
+
* Defaults to `info`.
|
|
29
|
+
* */
|
|
30
|
+
kind?: NavigationTopBarKind;
|
|
31
|
+
/**
|
|
32
|
+
* Properties of the close button. If defined, the alert will be closable and the close button will be rendered.
|
|
33
|
+
* aria-label is highly recommended for accessibility.
|
|
34
|
+
* */
|
|
35
|
+
closeButton?: {
|
|
36
|
+
onClick: () => void;
|
|
37
|
+
'data-testid'?: string;
|
|
38
|
+
'aria-label'?: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Content of the alert.
|
|
42
|
+
*/
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* Primary CTA button. The button will be rendered if defined.
|
|
46
|
+
* Allows ButtonProps, but `children` is recommended for more complex use-cases.
|
|
47
|
+
* */
|
|
48
|
+
primaryCta?: CTAProps;
|
|
49
|
+
/**
|
|
50
|
+
* Secondary CTA button. The button will be rendered if defined.
|
|
51
|
+
* Allows ButtonProps, but `children` is recommended for more complex use-cases.
|
|
52
|
+
* */
|
|
53
|
+
secondaryCta?: CTAProps;
|
|
54
|
+
/**
|
|
55
|
+
* Show or hide the alert, defaults to `true`. Changes to this prop are animated - the alert will enter and leave smoothly.
|
|
56
|
+
* */
|
|
57
|
+
isVisible?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentCoreProps } from '../../../../utils/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface ISideNavigationProps extends ComponentCoreProps {
|
|
4
|
+
/**
|
|
5
|
+
* It will display your side navigation elements
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* It will display the title of the side navigation bar
|
|
10
|
+
*/
|
|
11
|
+
title?: string;
|
|
12
|
+
/**
|
|
13
|
+
* It will display the custom element as title of the side navigation bar
|
|
14
|
+
*/
|
|
15
|
+
customHeader?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* It will display the custom element as footer of the side navigation bar
|
|
18
|
+
*/
|
|
19
|
+
customFooter?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Specify whether the gaps between elements should be removed
|
|
22
|
+
*/
|
|
23
|
+
noGaps?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* It will display the custom element on the right side of the side navigation bar title
|
|
26
|
+
*/
|
|
27
|
+
rightNode?: React.ReactNode;
|
|
28
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComponentCoreProps } from '../../../../utils/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface ISideNavigationGroupProps extends ComponentCoreProps {
|
|
4
|
+
/**
|
|
5
|
+
* It will display your side navigation elements
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The label of the side navigation list
|
|
10
|
+
*/
|
|
11
|
+
label?: React.ReactNode | ((isOpen: boolean) => React.ReactNode);
|
|
12
|
+
/**
|
|
13
|
+
* The right node of the side navigation list if `isCollapsible` is set to true
|
|
14
|
+
*/
|
|
15
|
+
rightNode?: React.ReactNode | ((isOpen: boolean) => React.ReactNode);
|
|
16
|
+
/**
|
|
17
|
+
* Specify whether the list should be collapsible
|
|
18
|
+
*/
|
|
19
|
+
isCollapsible?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The function to call on item hover
|
|
22
|
+
*/
|
|
23
|
+
onItemHover?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Specify whether the list should be open on the first render
|
|
26
|
+
*/
|
|
27
|
+
shouldOpenOnInit?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Specify whether the list should be open if an item within the group is active
|
|
30
|
+
*/
|
|
31
|
+
shouldOpenOnActive?: boolean;
|
|
32
|
+
}
|