@up42/up-components 5.3.2 → 5.5.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.
@@ -13,6 +13,6 @@ export type DocumentationPopoverProps = {
13
13
  ctaPath: string;
14
14
  };
15
15
  /**
16
- * Documentation: https://up-components.up42.com/?path=/docs/patterns-popovers-documentationpopover--docs
16
+ * @deprecated Please use [Popover](https://up-components.up42.com/?path=/docs-patterns-popovers-popover--docs) instead
17
17
  */
18
18
  export declare const DocumentationPopover: ({ children, ctaPath, ctaLabel, title }: DocumentationPopoverProps) => React.JSX.Element;
@@ -11,10 +11,6 @@ export type FeatureCardProps = CardProps & {
11
11
  info?: ReactNode;
12
12
  actions?: ReactNode;
13
13
  };
14
- /**
15
- * Whether the card is selectable.
16
- */
17
- isSelectable?: boolean;
18
14
  /**
19
15
  * Applies the selected state to the card from the parent.
20
16
  */
@@ -27,6 +23,10 @@ export type FeatureCardProps = CardProps & {
27
23
  * Applies the hovered state to the card from the parent.
28
24
  */
29
25
  hovered?: boolean;
26
+ /**
27
+ * Applies the active state to the card from the parent.
28
+ */
29
+ isActive?: boolean;
30
30
  };
31
31
  /**
32
32
  * Documentation: https://up-components.up42.com/?path=/docs/data-entry-featurecard--docs
@@ -45,10 +45,6 @@ export declare const FeatureCard: React.ForwardRefExoticComponent<Omit<import("@
45
45
  info?: ReactNode;
46
46
  actions?: ReactNode;
47
47
  } | undefined;
48
- /**
49
- * Whether the card is selectable.
50
- */
51
- isSelectable?: boolean | undefined;
52
48
  /**
53
49
  * Applies the selected state to the card from the parent.
54
50
  */
@@ -61,4 +57,8 @@ export declare const FeatureCard: React.ForwardRefExoticComponent<Omit<import("@
61
57
  * Applies the hovered state to the card from the parent.
62
58
  */
63
59
  hovered?: boolean | undefined;
60
+ /**
61
+ * Applies the active state to the card from the parent.
62
+ */
63
+ isActive?: boolean | undefined;
64
64
  }, "ref"> & React.RefAttributes<unknown>>;
@@ -4,6 +4,6 @@ export type InfoPopoverProps = InfoCardProps & {
4
4
  icon?: React.ElementType;
5
5
  };
6
6
  /**
7
- * Documentation: https://up-components.up42.com/?path=/docs/patterns-popovers-infopopover--docs
7
+ * @deprecated Please use [Popover](https://up-components.up42.com/?path=/docs-patterns-popovers-popover--docs) instead
8
8
  */
9
9
  export declare const InfoPopover: ({ id, icon: CustomIcon, actions, title, children, sx, ...props }: InfoPopoverProps) => React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const Connector: ({ anchorEl }: {
3
+ anchorEl: HTMLElement;
4
+ }) => React.JSX.Element;
@@ -0,0 +1,144 @@
1
+ import React from 'react';
2
+ import { Theme, SxProps, PopoverProps as MUIPopoverProps } from '@mui/material';
3
+ import { ButtonProps } from '../Button/Button';
4
+ import { IconProps } from '../Icon/Icon';
5
+ export interface PopoverButtonProps extends Omit<ButtonProps, 'onClick' | 'startIcon' | 'endIcon'> {
6
+ label: string;
7
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => Promise<void>;
8
+ startIcon?: IconProps['name'];
9
+ }
10
+ export type PopoverProps = Omit<MUIPopoverProps, 'open' | 'onClose'> & {
11
+ /**
12
+ * Opens the modal if true, closes it if false
13
+ * This is optional for compatibility purposes
14
+ */
15
+ open?: boolean;
16
+ /**
17
+ * External callback fired when the popover should close
18
+ */
19
+ onClose?: () => void;
20
+ /**
21
+ * Header content (optional)
22
+ */
23
+ header?: React.ReactNode;
24
+ /**
25
+ * Footer info (optional)
26
+ */
27
+ footerInfo?: React.ReactNode;
28
+ /**
29
+ * Primary button props (optional)
30
+ */
31
+ primaryButton?: PopoverButtonProps;
32
+ /**
33
+ * Secondary button props (optional)
34
+ */
35
+ secondaryButton?: PopoverButtonProps;
36
+ /**
37
+ * Primarily used to indicate that the anchor is the built in button icon.
38
+ * @default false
39
+ */
40
+ isIconAnchor?: boolean;
41
+ /**
42
+ * Alternative icon to display as the built in button's icon (only applicable if isIconAnchor is true)
43
+ */
44
+ icon?: IconProps['name'];
45
+ /**
46
+ * Custom styles for the icon anchor button (only applicable if isIconAnchor is true)
47
+ */
48
+ iconButtonSx?: SxProps<Theme>;
49
+ /**
50
+ * Whether to show dividers between sections
51
+ * @default false
52
+ */
53
+ hasDivider?: boolean;
54
+ /**
55
+ * Whether to show a connector line between the popover and anchor
56
+ * @default false
57
+ */
58
+ hasConnector?: boolean;
59
+ /**
60
+ * Whether to show padding inside the content section(For backwards compatibility purposes)
61
+ * @default false
62
+ */
63
+ hasContentPadding?: boolean;
64
+ /**
65
+ * Whether to use the default min and max width for the popover(For backwards compatibility purposes)
66
+ * @default false
67
+ */
68
+ hasDefaultWidth?: boolean;
69
+ /**
70
+ * Custom styles for the popover
71
+ */
72
+ sx?: SxProps<Theme>;
73
+ inputRef?: MUIPopoverProps['ref'];
74
+ };
75
+ /**
76
+ * Multi-purpose popover component with Header, Content, and Footer slots.
77
+ *
78
+ * Documentation: https://up-components.up42.com/?path=/docs-patterns-popovers-popover--docs
79
+ */
80
+ export declare const Popover: React.ForwardRefExoticComponent<Omit<Omit<MUIPopoverProps, "open" | "onClose"> & {
81
+ /**
82
+ * Opens the modal if true, closes it if false
83
+ * This is optional for compatibility purposes
84
+ */
85
+ open?: boolean | undefined;
86
+ /**
87
+ * External callback fired when the popover should close
88
+ */
89
+ onClose?: (() => void) | undefined;
90
+ /**
91
+ * Header content (optional)
92
+ */
93
+ header?: React.ReactNode;
94
+ /**
95
+ * Footer info (optional)
96
+ */
97
+ footerInfo?: React.ReactNode;
98
+ /**
99
+ * Primary button props (optional)
100
+ */
101
+ primaryButton?: PopoverButtonProps | undefined;
102
+ /**
103
+ * Secondary button props (optional)
104
+ */
105
+ secondaryButton?: PopoverButtonProps | undefined;
106
+ /**
107
+ * Primarily used to indicate that the anchor is the built in button icon.
108
+ * @default false
109
+ */
110
+ isIconAnchor?: boolean | undefined;
111
+ /**
112
+ * Alternative icon to display as the built in button's icon (only applicable if isIconAnchor is true)
113
+ */
114
+ icon?: "AccessTime" | "Add" | "AddCircleFilled" | "AddPlusCircle" | "AlarmBell" | "AlertCircleFilled" | "AlertTriangle" | "Angle" | "AppWindowCode" | "ArrowBack" | "ArrowBackIos" | "ArrowDownLeft" | "ArrowDownRight" | "ArrowDownward" | "ArrowForward" | "ArrowTopLeft" | "ArrowTopRight" | "ArrowUpward" | "Attachment" | "AutoStoriesOutlined" | "Balance" | "Bin" | "Block" | "Blocked" | "Boxes" | "BoxesGrid" | "Brightness1" | "Calendar" | "CalendarAdd" | "CalendarCheck" | "CalendarDate" | "CalendarEdit" | "CalendarRemove" | "CalendarSearchDate" | "CampaignOutlined" | "CaretCircleFilledDown" | "CaretCircleFilledLeft" | "CaretCircleFilledRight" | "CaretCircleFilledUp" | "Catalog" | "CheckCircleFilled" | "CheckList" | "CheckMark" | "ChevronCircleFilledDown" | "ChevronCircleFilledLeft" | "ChevronCircleFilledRight" | "ChevronCircleFilledUp" | "Close" | "CloseCircle" | "CloseCircleFilled" | "Cloud" | "CloudCheck" | "CloudDownload" | "CloudOff" | "CloudRemove" | "CloudSearch" | "CloudSync" | "CloudUpload" | "CloudWarning" | "Coin" | "CoinEuro" | "Compass" | "ContactSupportOutlined" | "ContentCut" | "ContentPaste" | "Copy" | "Credit" | "Dashboard" | "DataTransferVertical" | "Delivery" | "DollarCoinCircleFilled" | "DottedLines" | "Download" | "DownloadCircle" | "EditPencil" | "EuroCoinCircleFilled" | "ExitLeaveBack" | "ExternalLink" | "EyeCircleFilled" | "FlagQuestion" | "FolderEmpty" | "Footprint" | "HeadphonesQuestion" | "Heart" | "HeartCircleFilled" | "Hyperlink" | "ImageResolution" | "Invoice" | "KeyboardArrowDown" | "KeyboardArrowLeft" | "KeyboardArrowRight" | "KeyboardArrowUp" | "Layers" | "Library" | "Lightbulb" | "LightbulbOutlined" | "LocalOfferOutlined" | "Lock" | "LockCircleFilled" | "LockShield" | "Logo" | "LogoKSA" | "Map" | "MapPin" | "MapSearch" | "Marketplace" | "MarketplaceExternal" | "MenuCircleFilledHorizontal" | "MenuCircleFilledVertical" | "MenuOpenHorizontal" | "MenuOpenVertical" | "MinusCircleFilled" | "Module" | "Module2" | "ModuleThree" | "MoreHoriz" | "MultipleUsers" | "NotificationError" | "NotificationInfo" | "NotificationSuccess" | "NotificationWarning" | "PenCircleFilled" | "Pencil" | "PercentCircle" | "Person" | "Pin" | "Polygon" | "Projects" | "QuestionBubble" | "QuestionCircle" | "QuestionCircleFilled" | "QuestionMark" | "Rectangle" | "RectangleAOI" | "Redo" | "Remove" | "Resolution" | "Satellite" | "Save" | "Scissors" | "Search" | "SelectedIndicator" | "ServerCheck" | "ServerDeny" | "ServerDownload" | "ServerEdit" | "ServerError" | "ServerLock" | "ServerMinus" | "ServerQuestion" | "ServerRefresh" | "ServerSearch" | "ServerSync" | "ServerUpload" | "ServerWarning" | "SettingsCog" | "SettingsCog2" | "SettingsSliderHorizontal" | "SettingsVertical" | "Share" | "ShareNetwork" | "Shield" | "ShieldWithLock" | "ShoppingCartCheck" | "ShoppingCartClose" | "ShoppingCartMinus" | "ShoppingCartOutlined" | "ShoppingCartPlus" | "Storage" | "Support" | "SupportClear" | "SupportHeadphones" | "System" | "Tag" | "TagAlert" | "TagCheck" | "TagDouble" | "TagEdit" | "TagMinus" | "TagPlus" | "TagSearch" | "TagX" | "Target" | "Transaction" | "TrashBin" | "Undo" | "Unlock" | "UpgradeShield" | "Upload" | "UploadCircle" | "User" | "VisibilityOffOutlined" | "VisibilityOutlined" | "WeatherCloud" | "Webhooks" | "Workflow" | "WorkflowPencil" | "ZoomIn" | "ZoomOut" | undefined;
115
+ /**
116
+ * Custom styles for the icon anchor button (only applicable if isIconAnchor is true)
117
+ */
118
+ iconButtonSx?: SxProps<Theme> | undefined;
119
+ /**
120
+ * Whether to show dividers between sections
121
+ * @default false
122
+ */
123
+ hasDivider?: boolean | undefined;
124
+ /**
125
+ * Whether to show a connector line between the popover and anchor
126
+ * @default false
127
+ */
128
+ hasConnector?: boolean | undefined;
129
+ /**
130
+ * Whether to show padding inside the content section(For backwards compatibility purposes)
131
+ * @default false
132
+ */
133
+ hasContentPadding?: boolean | undefined;
134
+ /**
135
+ * Whether to use the default min and max width for the popover(For backwards compatibility purposes)
136
+ * @default false
137
+ */
138
+ hasDefaultWidth?: boolean | undefined;
139
+ /**
140
+ * Custom styles for the popover
141
+ */
142
+ sx?: SxProps<Theme> | undefined;
143
+ inputRef?: MUIPopoverProps['ref'];
144
+ }, "ref"> & React.RefAttributes<unknown>>;
@@ -35,6 +35,7 @@ export { ContactBox, type ContactBoxProps } from './components/ContactBox/Contac
35
35
  export { ControlButton, type ControlButtonProps } from './components/ControlButton/ControlButton';
36
36
  export { CopyButton, type CopyButtonProps } from './components/CopyButton/CopyButton';
37
37
  export { InfoPopover, type InfoPopoverProps } from './components/InfoPopover/InfoPopover';
38
+ export { Popover, type PopoverProps } from './components/Popover/Popover';
38
39
  export { PageHeader, type PageHeaderProps } from './components/PageHeader/PageHeader';
39
40
  export { NotFound, type NotFoundProps } from './components/NotFound/NotFound';
40
41
  export { Loading, type LoadingProps } from './components/Loading/Loading';