@up42/up-components 8.0.0 → 8.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.
@@ -0,0 +1,49 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import React, { ReactNode } from 'react';
3
+ export type ActionToolbarProps = {
4
+ count: number;
5
+ singleLabel?: string;
6
+ multipleLabel?: string;
7
+ clearLabel?: string;
8
+ onClearSelection: () => void;
9
+ centerSlot?: ReactNode;
10
+ actionsSlot?: ReactNode;
11
+ color?: Color;
12
+ sx?: SxProps<Theme>;
13
+ /**
14
+ * This property defines the position where the component will be displayed.
15
+ * It is not part of the styling properties since this is taken as a configuration property.
16
+ */
17
+ position: 'bottom' | 'top';
18
+ /**
19
+ * This property defines the padding applied to the component in relation to the "position" property.
20
+ * It is not part of the styling properties since this is taken as a configuration property.
21
+ */
22
+ padding: string;
23
+ };
24
+ declare const COLORS: {
25
+ readonly primary: {
26
+ readonly bgColor: string;
27
+ readonly borderColor: string;
28
+ readonly textColor: string;
29
+ readonly badgeColor: string;
30
+ readonly badgeText: string;
31
+ };
32
+ readonly info: {
33
+ readonly bgColor: string;
34
+ readonly borderColor: string;
35
+ readonly textColor: string;
36
+ readonly badgeColor: string;
37
+ readonly badgeText: string;
38
+ };
39
+ readonly warning: {
40
+ readonly bgColor: string;
41
+ readonly borderColor: string;
42
+ readonly textColor: string;
43
+ readonly badgeColor: string;
44
+ readonly badgeText: string;
45
+ };
46
+ };
47
+ type Color = keyof typeof COLORS;
48
+ export declare const ActionToolbar: ({ count, singleLabel, multipleLabel, clearLabel, onClearSelection, centerSlot, actionsSlot, color, sx, position, padding, }: ActionToolbarProps) => React.JSX.Element;
49
+ export {};
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import { type PopoverProps } from '../Popover/Popover';
3
+ export type FilterPopoverProps = Pick<PopoverProps, 'anchorEl' | 'onClose' | 'header' | 'sx' | 'size'> & {
4
+ /**
5
+ * Filter area content (placeholder node for now).
6
+ */
7
+ content?: React.ReactNode;
8
+ /**
9
+ * Apply button text.
10
+ * @default 'Apply filters'
11
+ */
12
+ applyButtonLabel?: string;
13
+ /**
14
+ * Loading state for the count of results.
15
+ * @default false
16
+ */
17
+ isLoadingCount?: boolean;
18
+ /**
19
+ * Clear button text.
20
+ * @default 'Reset to defaults'
21
+ */
22
+ clearButtonLabel?: string;
23
+ /**
24
+ * When true, Apply is enabled; when false, disabled.
25
+ * @default false
26
+ */
27
+ disableApplyButton?: boolean;
28
+ /**
29
+ * Called when Apply is clicked; popover closes after.
30
+ */
31
+ onApply?: () => void | Promise<void>;
32
+ /**
33
+ * Called when Clear is clicked; no other behaviour (no close).
34
+ */
35
+ onClear?: () => void | Promise<void>;
36
+ };
37
+ /**
38
+ * Main container for filter inputs. Composes Popover with Apply/Clear footer.
39
+ * Opens when the user clicks the anchor; closes on Apply or Escape.
40
+ *
41
+ * Documentation: https://up-components.up42.com/?path=/docs-patterns-popovers-filterpopover--docs
42
+ */
43
+ export declare const FilterPopover: ({ anchorEl, onClose, header, content, applyButtonLabel, clearButtonLabel, disableApplyButton, isLoadingCount, onApply, onClear, ...popoverProps }: FilterPopoverProps) => React.JSX.Element;
@@ -36,6 +36,7 @@ export { ControlButton, type ControlButtonProps } from './components/ControlButt
36
36
  export { CopyButton, type CopyButtonProps } from './components/CopyButton/CopyButton';
37
37
  export { InfoPopover, type InfoPopoverProps } from './components/InfoPopover/InfoPopover';
38
38
  export { Popover, type PopoverProps } from './components/Popover/Popover';
39
+ export { FilterPopover, type FilterPopoverProps } from './components/FilterPopover/FilterPopover';
39
40
  export { PageHeader, type PageHeaderProps } from './components/PageHeader/PageHeader';
40
41
  export { PageHeaderV2, type PageHeaderV2Props } from './components/PageHeaderV2/PageHeaderV2';
41
42
  export { NotFound, type NotFoundProps } from './components/NotFound/NotFound';
@@ -62,6 +63,7 @@ export { DataGrid, GridRow, GridCell, GridEditInputCell, GridCellModes, GridFoot
62
63
  export type { GridColDef, GridRenderEditCellParams, GridCellModesModel, GridCellParams, GridRenderCellParams, GridRowId, GridRowParams, GridRowSelectionModel, GridRowsProp, GridSortModel, GridTreeNodeWithRender, GridColumnHeaderParams, GridEditCellProps, GridInitialState, GridPreProcessEditCellProps, } from './components/DataGrid/DataGrid';
63
64
  export { ToggleButton, type ToggleButtonProps } from './components/ToggleButton/ToggleButton';
64
65
  export { FindUsersButton, LearnMoreButton, RoleBanner, type FindUsersButtonProps, type LearnMoreButtonProps, type RoleBannerProps, } from './components/RoleBanner/RoleBanner';
66
+ export { ActionToolbar, type ActionToolbarProps } from './components/ActionToolbar/ActionToolbar';
65
67
  export { capitalize } from './utils/helpers/capitalize';
66
68
  export { copyToClipboard } from './utils/helpers/copyToClipboard';
67
69
  export { formatNumber } from './utils/helpers/formatNumber';
package/dist/index.d.ts CHANGED
@@ -4740,6 +4740,48 @@ type PopoverProps = Omit<PopoverProps$1, 'content' | 'open' | 'onClose'> & {
4740
4740
  */
4741
4741
  declare const Popover: React__default.ForwardRefExoticComponent<Omit<PopoverProps, "ref"> & React__default.RefAttributes<unknown>>;
4742
4742
 
4743
+ type FilterPopoverProps = Pick<PopoverProps, 'anchorEl' | 'onClose' | 'header' | 'sx' | 'size'> & {
4744
+ /**
4745
+ * Filter area content (placeholder node for now).
4746
+ */
4747
+ content?: React__default.ReactNode;
4748
+ /**
4749
+ * Apply button text.
4750
+ * @default 'Apply filters'
4751
+ */
4752
+ applyButtonLabel?: string;
4753
+ /**
4754
+ * Loading state for the count of results.
4755
+ * @default false
4756
+ */
4757
+ isLoadingCount?: boolean;
4758
+ /**
4759
+ * Clear button text.
4760
+ * @default 'Reset to defaults'
4761
+ */
4762
+ clearButtonLabel?: string;
4763
+ /**
4764
+ * When true, Apply is enabled; when false, disabled.
4765
+ * @default false
4766
+ */
4767
+ disableApplyButton?: boolean;
4768
+ /**
4769
+ * Called when Apply is clicked; popover closes after.
4770
+ */
4771
+ onApply?: () => void | Promise<void>;
4772
+ /**
4773
+ * Called when Clear is clicked; no other behaviour (no close).
4774
+ */
4775
+ onClear?: () => void | Promise<void>;
4776
+ };
4777
+ /**
4778
+ * Main container for filter inputs. Composes Popover with Apply/Clear footer.
4779
+ * Opens when the user clicks the anchor; closes on Apply or Escape.
4780
+ *
4781
+ * Documentation: https://up-components.up42.com/?path=/docs-patterns-popovers-filterpopover--docs
4782
+ */
4783
+ declare const FilterPopover: ({ anchorEl, onClose, header, content, applyButtonLabel, clearButtonLabel, disableApplyButton, isLoadingCount, onApply, onClear, ...popoverProps }: FilterPopoverProps) => React__default.JSX.Element;
4784
+
4743
4785
  type PageHeaderProps = {
4744
4786
  title: string;
4745
4787
  divider?: boolean;
@@ -11213,7 +11255,7 @@ type FeatureCardHeaderActionsProps = {
11213
11255
  };
11214
11256
  declare const FeatureCardHeaderActions: ({ iconActions, menuActions }: FeatureCardHeaderActionsProps) => React__default.JSX.Element;
11215
11257
 
11216
- declare const COLORS: {
11258
+ declare const COLORS$1: {
11217
11259
  primary: string;
11218
11260
  secondary: string;
11219
11261
  success: string;
@@ -11243,12 +11285,12 @@ declare const SIZES: {
11243
11285
  };
11244
11286
  };
11245
11287
  type Variant = 'filled' | 'half';
11246
- type Color = keyof typeof COLORS;
11288
+ type Color$1 = keyof typeof COLORS$1;
11247
11289
  type Size = keyof typeof SIZES;
11248
11290
  type StatusLightProps = {
11249
11291
  label: string;
11250
11292
  variant?: Variant;
11251
- color?: Color;
11293
+ color?: Color$1;
11252
11294
  size?: Size;
11253
11295
  sx?: SxProps<Theme>;
11254
11296
  };
@@ -11444,6 +11486,53 @@ declare function LearnMoreButton(props: LearnMoreButtonProps): React__default.JS
11444
11486
  type FindUsersButtonProps = ButtonProps;
11445
11487
  declare function FindUsersButton(props: FindUsersButtonProps): React__default.JSX.Element;
11446
11488
 
11489
+ type ActionToolbarProps = {
11490
+ count: number;
11491
+ singleLabel?: string;
11492
+ multipleLabel?: string;
11493
+ clearLabel?: string;
11494
+ onClearSelection: () => void;
11495
+ centerSlot?: ReactNode;
11496
+ actionsSlot?: ReactNode;
11497
+ color?: Color;
11498
+ sx?: SxProps<Theme>;
11499
+ /**
11500
+ * This property defines the position where the component will be displayed.
11501
+ * It is not part of the styling properties since this is taken as a configuration property.
11502
+ */
11503
+ position: 'bottom' | 'top';
11504
+ /**
11505
+ * This property defines the padding applied to the component in relation to the "position" property.
11506
+ * It is not part of the styling properties since this is taken as a configuration property.
11507
+ */
11508
+ padding: string;
11509
+ };
11510
+ declare const COLORS: {
11511
+ readonly primary: {
11512
+ readonly bgColor: string;
11513
+ readonly borderColor: string;
11514
+ readonly textColor: string;
11515
+ readonly badgeColor: string;
11516
+ readonly badgeText: string;
11517
+ };
11518
+ readonly info: {
11519
+ readonly bgColor: string;
11520
+ readonly borderColor: string;
11521
+ readonly textColor: string;
11522
+ readonly badgeColor: string;
11523
+ readonly badgeText: string;
11524
+ };
11525
+ readonly warning: {
11526
+ readonly bgColor: string;
11527
+ readonly borderColor: string;
11528
+ readonly textColor: string;
11529
+ readonly badgeColor: string;
11530
+ readonly badgeText: string;
11531
+ };
11532
+ };
11533
+ type Color = keyof typeof COLORS;
11534
+ declare const ActionToolbar: ({ count, singleLabel, multipleLabel, clearLabel, onClearSelection, centerSlot, actionsSlot, color, sx, position, padding, }: ActionToolbarProps) => React__default.JSX.Element;
11535
+
11447
11536
  /**
11448
11537
  * It should to be noted that this helper isn't equivalent to `text-transform: capitalize`.
11449
11538
  * A strict capitalization should uppercase the first letter of each word in the sentence.
@@ -11672,5 +11761,5 @@ type ContextState = {
11672
11761
  */
11673
11762
  declare const useAlert: () => ContextState;
11674
11763
 
11675
- export { Alert, Avatar, Badge, Banner, Button, Checkbox, CodeBlock, CodeInline, CodeSnippet, ContactBox, ControlButton, CopyButton, DataGrid, DateTime, Divider, DocumentationPopover, EditTagsButton, EmptyState, FeatureCard, FeatureCardHeader, FeatureCardHeaderActions, FeatureFlagCheckbox, FindUsersButton, FormCheckbox, FormDatePicker, FormDateRangePicker, FormDateRangePickerList, FormDateTimePicker, FormInput, FormRadio, FormSelect, FormSwitch, GridContainer, GridItem, Icon, Illustration, InfoCard, InfoModal, InfoPopover, Input, LearnMoreButton, Link, Loading, Logo, NotFound, PageContainer, PageHeader, PageHeaderV2, Popover, Radio, RoleBanner, Select, Slider, StatusLight, Switch, Tab, TabGroup, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TablePagination, TableRow, TableSortLabel, Tabs, Tag, TagsList, ToggleButton, Typography, UpComponentsProvider, analytics, capitalize, copyToClipboard, formatDate, formatFileSize, formatNumber, generateQueryKey, theme, useAlert, useCursorPagination, useDebounce, useQueryParams, useRemotePagination, useToggle };
11676
- export type { AlertProps, AnalyticsConfig, AvatarProps, BadgeProps, BannerProps, ButtonProps, CheckboxProps, CodeBlockProps, CodeInlineProps, CodeSnippetItemProps, CodeSnippetProps, ContactBoxProps, ControlButtonProps, CopyButtonProps, CreateAlertProps, CreateSnackbarProps, CursorPaginatedResponse, DateRange, DateTimeProps, DividerProps, DocumentationPopoverProps, EditTagsButtonProps, EmptyStateProps, FeatureCardHeaderActionsProps, FeatureCardHeaderProps, FeatureCardProps, FeatureFlagCheckboxProps, FindUsersButtonProps, FormCheckboxProps, FormDatePickerDateType, FormDatePickerProps, FormDateRangePickerListProps, FormDateRangePickerProps, FormDateTimePickerProps, FormInputProps, FormRadioProps, FormSelectProps, FormSwitchProps, GridContainerProps, GridItemProps, IconAction, IconProps$1 as IconProps, IllustrationProps, InfoCardProps, InfoModalProps, InfoPopoverProps, InputProps, LearnMoreButtonProps, LinkProps, LoadingProps, LogoProps, MenuAction, NotFoundProps, PageContainerProps, PageHeaderProps, PageHeaderV2Props, PaginatedResponse, PopoverProps, RadioProps, RoleBannerProps, SelectProps, SliderProps, StatusLightProps, SwitchProps, TabGroupProps, TabProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TableSortLabelProps, TabsProps, TagItem, TagProps, TagsListProps, ToggleButtonProps, TypographyProps, UseToggleResult };
11764
+ export { ActionToolbar, Alert, Avatar, Badge, Banner, Button, Checkbox, CodeBlock, CodeInline, CodeSnippet, ContactBox, ControlButton, CopyButton, DataGrid, DateTime, Divider, DocumentationPopover, EditTagsButton, EmptyState, FeatureCard, FeatureCardHeader, FeatureCardHeaderActions, FeatureFlagCheckbox, FilterPopover, FindUsersButton, FormCheckbox, FormDatePicker, FormDateRangePicker, FormDateRangePickerList, FormDateTimePicker, FormInput, FormRadio, FormSelect, FormSwitch, GridContainer, GridItem, Icon, Illustration, InfoCard, InfoModal, InfoPopover, Input, LearnMoreButton, Link, Loading, Logo, NotFound, PageContainer, PageHeader, PageHeaderV2, Popover, Radio, RoleBanner, Select, Slider, StatusLight, Switch, Tab, TabGroup, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TablePagination, TableRow, TableSortLabel, Tabs, Tag, TagsList, ToggleButton, Typography, UpComponentsProvider, analytics, capitalize, copyToClipboard, formatDate, formatFileSize, formatNumber, generateQueryKey, theme, useAlert, useCursorPagination, useDebounce, useQueryParams, useRemotePagination, useToggle };
11765
+ export type { ActionToolbarProps, AlertProps, AnalyticsConfig, AvatarProps, BadgeProps, BannerProps, ButtonProps, CheckboxProps, CodeBlockProps, CodeInlineProps, CodeSnippetItemProps, CodeSnippetProps, ContactBoxProps, ControlButtonProps, CopyButtonProps, CreateAlertProps, CreateSnackbarProps, CursorPaginatedResponse, DateRange, DateTimeProps, DividerProps, DocumentationPopoverProps, EditTagsButtonProps, EmptyStateProps, FeatureCardHeaderActionsProps, FeatureCardHeaderProps, FeatureCardProps, FeatureFlagCheckboxProps, FilterPopoverProps, FindUsersButtonProps, FormCheckboxProps, FormDatePickerDateType, FormDatePickerProps, FormDateRangePickerListProps, FormDateRangePickerProps, FormDateTimePickerProps, FormInputProps, FormRadioProps, FormSelectProps, FormSwitchProps, GridContainerProps, GridItemProps, IconAction, IconProps$1 as IconProps, IllustrationProps, InfoCardProps, InfoModalProps, InfoPopoverProps, InputProps, LearnMoreButtonProps, LinkProps, LoadingProps, LogoProps, MenuAction, NotFoundProps, PageContainerProps, PageHeaderProps, PageHeaderV2Props, PaginatedResponse, PopoverProps, RadioProps, RoleBannerProps, SelectProps, SliderProps, StatusLightProps, SwitchProps, TabGroupProps, TabProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TableSortLabelProps, TabsProps, TagItem, TagProps, TagsListProps, ToggleButtonProps, TypographyProps, UseToggleResult };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@up42/up-components",
3
- "version": "8.0.0",
3
+ "version": "8.2.0",
4
4
  "description": "UP42 Component Library",
5
5
  "author": "Axel Fuhrmann axel.fuhrmann@up42.com",
6
6
  "license": "ISC",
@@ -84,7 +84,7 @@
84
84
  "rollup-plugin-dts": "^6.1.0",
85
85
  "rollup-plugin-peer-deps-external": "^2.2.4",
86
86
  "storybook": "^8.6.17",
87
- "svgo": "^3.3.2",
87
+ "svgo": "^3.3.3",
88
88
  "tslib": "^2.8.1",
89
89
  "typescript": "^4.5.4",
90
90
  "vite": "^7.1.12",
@@ -120,7 +120,9 @@
120
120
  "//": "Lodash override should be removed when we upgrade to Storybook 9+",
121
121
  "overrides": {
122
122
  "lodash@>=4.0.0 <=4.17.22": ">=4.17.23",
123
- "csstype@>=3.0.0": "3.1.3"
123
+ "serialize-javascript@<=7.0.2": ">=7.0.3",
124
+ "csstype@>=3.0.0": "3.1.3",
125
+ "@tootallnate/once@<3.0.1": ">=3.0.1"
124
126
  }
125
127
  }
126
128
  }