@up42/up-components 4.11.0 → 4.13.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/README.md +14 -2
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/types/components/EditTagsButton/EditTagsButton.d.ts +9 -0
- package/dist/cjs/types/components/EditTagsButton/EditTagsButton.test.d.ts +1 -0
- package/dist/cjs/types/components/EditTagsButton/SearchTags.d.ts +6 -0
- package/dist/cjs/types/components/EditTagsButton/SearchTags.test.d.ts +1 -0
- package/dist/cjs/types/components/EditTagsButton/TagsManager.d.ts +8 -0
- package/dist/cjs/types/components/EditTagsButton/TagsManager.test.d.ts +1 -0
- package/dist/cjs/types/components/FeatureFlagCheckbox/FeatureFlagCheckbox.d.ts +25 -0
- package/dist/cjs/types/components/FeatureFlagCheckbox/FeatureFlagCheckbox.test.d.ts +1 -0
- package/dist/cjs/types/components/TagsList/MoreTags.d.ts +4 -0
- package/dist/cjs/types/components/TagsList/MoreTags.test.d.ts +1 -0
- package/dist/cjs/types/components/TagsList/Tags.d.ts +8 -0
- package/dist/cjs/types/components/TagsList/Tags.test.d.ts +1 -0
- package/dist/cjs/types/components/TagsList/TagsList.d.ts +6 -0
- package/dist/cjs/types/components/TagsList/TagsList.test.d.ts +1 -0
- package/dist/cjs/types/index.d.ts +4 -0
- package/dist/cjs/types/utils/hooks/useToggle.d.ts +24 -0
- package/dist/cjs/types/utils/hooks/useToggle.test.d.ts +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/types/components/EditTagsButton/EditTagsButton.d.ts +9 -0
- package/dist/esm/types/components/EditTagsButton/EditTagsButton.test.d.ts +1 -0
- package/dist/esm/types/components/EditTagsButton/SearchTags.d.ts +6 -0
- package/dist/esm/types/components/EditTagsButton/SearchTags.test.d.ts +1 -0
- package/dist/esm/types/components/EditTagsButton/TagsManager.d.ts +8 -0
- package/dist/esm/types/components/EditTagsButton/TagsManager.test.d.ts +1 -0
- package/dist/esm/types/components/FeatureFlagCheckbox/FeatureFlagCheckbox.d.ts +25 -0
- package/dist/esm/types/components/FeatureFlagCheckbox/FeatureFlagCheckbox.test.d.ts +1 -0
- package/dist/esm/types/components/TagsList/MoreTags.d.ts +4 -0
- package/dist/esm/types/components/TagsList/MoreTags.test.d.ts +1 -0
- package/dist/esm/types/components/TagsList/Tags.d.ts +8 -0
- package/dist/esm/types/components/TagsList/Tags.test.d.ts +1 -0
- package/dist/esm/types/components/TagsList/TagsList.d.ts +6 -0
- package/dist/esm/types/components/TagsList/TagsList.test.d.ts +1 -0
- package/dist/esm/types/index.d.ts +4 -0
- package/dist/esm/types/utils/hooks/useToggle.d.ts +24 -0
- package/dist/esm/types/utils/hooks/useToggle.test.d.ts +1 -0
- package/dist/index.d.ts +68 -3
- package/package.json +1 -1
- package/dist/cjs/types/global/overrides/form/datePicker.d.ts +0 -2
- package/dist/cjs/types/global/overrides/index.d.ts +0 -1
- package/dist/esm/types/global/overrides/form/datePicker.d.ts +0 -2
- package/dist/esm/types/global/overrides/index.d.ts +0 -1
- /package/dist/cjs/types/{global/overrides/form/label.d.ts → components/FormLabel/FormLabel.overrides.d.ts} +0 -0
- /package/dist/esm/types/{global/overrides/form/label.d.ts → components/FormLabel/FormLabel.overrides.d.ts} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type EditTagsButtonProps = {
|
|
3
|
+
tags: string[];
|
|
4
|
+
tagPool?: string[];
|
|
5
|
+
onSave: (tags: string[]) => void;
|
|
6
|
+
label?: string;
|
|
7
|
+
tooltip?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function EditTagsButton({ tags, tagPool, onSave, label, tooltip }: EditTagsButtonProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type TagsManagerProps = {
|
|
3
|
+
currentTags: string[];
|
|
4
|
+
setCurrentTags: (tags: string[]) => void;
|
|
5
|
+
tagPool?: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare const TagsManager: ({ currentTags, setCurrentTags, tagPool }: TagsManagerProps) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { SyntheticEvent } from 'react';
|
|
2
|
+
export type FeatureFlagCheckboxProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
checked: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Defines if the component should be rendered or not.
|
|
7
|
+
* Use this prop to indicate if the application is in a development environment.
|
|
8
|
+
*/
|
|
9
|
+
isDevelopment: boolean;
|
|
10
|
+
onChange: (event: SyntheticEvent, checked: boolean) => void;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* Development-only feature toggle component (not for production use).
|
|
16
|
+
*
|
|
17
|
+
* **Important**: This component is intended *strictly* for development environments and should not be included in production builds.
|
|
18
|
+
*
|
|
19
|
+
* The `FeatureFlagCheckbox` is a temporary UI component used by developers to enable or disable feature flags manually. It renders a labeled checkbox and an optional close button to dismiss the control.
|
|
20
|
+
*
|
|
21
|
+
* **Note**: The component is rendered only when the `isDevelopment` prop is set to `true`. It is the responsibility of the consuming application to ensure the provided value is correct so that is only rendered in non-production environments.
|
|
22
|
+
*
|
|
23
|
+
* Documentation: https://up-components.up42.com/?path=/docs/development-featureflagcheckbox--docs
|
|
24
|
+
*/
|
|
25
|
+
export declare function FeatureFlagCheckbox({ label, checked, isDevelopment, onChange, onClose }: FeatureFlagCheckboxProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -49,6 +49,9 @@ export { FeatureCard, type FeatureCardProps } from './components/FeatureCard/Fea
|
|
|
49
49
|
export { FeatureCardHeader, type FeatureCardHeaderProps } from './components/FeatureCardHeader/FeatureCardHeader';
|
|
50
50
|
export { FeatureCardHeaderActions, type IconAction, type MenuAction, type FeatureCardHeaderActionsProps, } from './components/FeatureCardHeaderActions/FeatureCardHeaderActions';
|
|
51
51
|
export { StatusLight, type StatusLightProps } from './components/StatusLight/StatusLight';
|
|
52
|
+
export { TagsList, type TagsListProps } from './components/TagsList/TagsList';
|
|
53
|
+
export { EditTagsButton, type EditTagsButtonProps } from './components/EditTagsButton/EditTagsButton';
|
|
54
|
+
export { FeatureFlagCheckbox, type FeatureFlagCheckboxProps, } from './components/FeatureFlagCheckbox/FeatureFlagCheckbox';
|
|
52
55
|
export { DocumentationPopover, type DocumentationPopoverProps, } from './components/DocumentationPopover/DocumentationPopover';
|
|
53
56
|
export { CodeInline, type CodeInlineProps } from './components/CodeInline/CodeInline';
|
|
54
57
|
export { CodeSnippet, type CodeSnippetProps, type CodeSnippetItemProps } from './components/CodeSnippet/CodeSnippet';
|
|
@@ -63,5 +66,6 @@ export { formatFileSize } from './utils/helpers/formatFileSize';
|
|
|
63
66
|
export { useQueryParams } from './utils/hooks/useQueryParams';
|
|
64
67
|
export { useRemotePagination, type PaginatedResponse } from './utils/hooks/useRemotePagination';
|
|
65
68
|
export { useCursorPagination, type CursorPaginatedResponse } from './utils/hooks/useCursorPagination';
|
|
69
|
+
export { useToggle, type UseToggleResult } from './utils/hooks/useToggle';
|
|
66
70
|
export { useDebounce } from './utils/hooks/useDebounce';
|
|
67
71
|
export { useAlert, type CreateAlertProps, type CreateSnackbarProps, } from './global/providers/AlertProvider/AlertProvider';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type UseToggleResult = [
|
|
2
|
+
boolean,
|
|
3
|
+
{
|
|
4
|
+
on: () => void;
|
|
5
|
+
off: () => void;
|
|
6
|
+
flip: () => void;
|
|
7
|
+
}
|
|
8
|
+
];
|
|
9
|
+
/**
|
|
10
|
+
* A custom hook that provides a boolean state with convenient toggle actions.
|
|
11
|
+
*
|
|
12
|
+
* This hook returns a boolean value and an object with three methods to control the state:
|
|
13
|
+
* - `on`: Sets the value to `true`
|
|
14
|
+
* - `off`: Sets the value to `false`
|
|
15
|
+
* - `flip`: Toggles the current value (true becomes false, false becomes true)
|
|
16
|
+
*
|
|
17
|
+
* @param initialState - The initial boolean value. Can be a boolean or a function that returns a boolean.
|
|
18
|
+
* @returns A tuple containing:
|
|
19
|
+
* - The current boolean value
|
|
20
|
+
* - An object with `on`, `off`, and `flip` methods to control the state
|
|
21
|
+
*
|
|
22
|
+
* Documentation: https://up-components.up42.com/?path=/docs/utils--docs#usetoggle
|
|
23
|
+
*/
|
|
24
|
+
export declare function useToggle(initialState: boolean | (() => boolean)): UseToggleResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { BoxProps, TextFieldProps, AvatarProps as AvatarProps$1, GridProps, Cont
|
|
|
4
4
|
export * from '@mui/material';
|
|
5
5
|
import { ThemeProviderProps } from '@mui/material/styles/ThemeProvider';
|
|
6
6
|
import * as React from 'react';
|
|
7
|
-
import React__default, { ReactNode, ElementType } from 'react';
|
|
7
|
+
import React__default, { ReactNode, ElementType, SyntheticEvent } from 'react';
|
|
8
8
|
import { ButtonProps as ButtonProps$1 } from '@mui/material/Button';
|
|
9
9
|
import { TypographyProps as TypographyProps$1 } from '@mui/material/Typography';
|
|
10
10
|
import { DatePickerProps, DateTimePickerProps } from '@mui/x-date-pickers-pro';
|
|
@@ -5201,6 +5201,46 @@ type StatusLightProps = {
|
|
|
5201
5201
|
*/
|
|
5202
5202
|
declare const StatusLight: ({ label, variant, color, size, sx, }: StatusLightProps) => React__default.JSX.Element;
|
|
5203
5203
|
|
|
5204
|
+
type TagsListProps = {
|
|
5205
|
+
tags: string[];
|
|
5206
|
+
onTagsChange?: (tags: string[]) => void;
|
|
5207
|
+
};
|
|
5208
|
+
declare const TagsList: ({ tags: tagsProp, onTagsChange }: TagsListProps) => React__default.JSX.Element;
|
|
5209
|
+
|
|
5210
|
+
type EditTagsButtonProps = {
|
|
5211
|
+
tags: string[];
|
|
5212
|
+
tagPool?: string[];
|
|
5213
|
+
onSave: (tags: string[]) => void;
|
|
5214
|
+
label?: string;
|
|
5215
|
+
tooltip?: string;
|
|
5216
|
+
};
|
|
5217
|
+
declare function EditTagsButton({ tags, tagPool, onSave, label, tooltip }: EditTagsButtonProps): React__default.JSX.Element;
|
|
5218
|
+
|
|
5219
|
+
type FeatureFlagCheckboxProps = {
|
|
5220
|
+
label: string;
|
|
5221
|
+
checked: boolean;
|
|
5222
|
+
/**
|
|
5223
|
+
* Defines if the component should be rendered or not.
|
|
5224
|
+
* Use this prop to indicate if the application is in a development environment.
|
|
5225
|
+
*/
|
|
5226
|
+
isDevelopment: boolean;
|
|
5227
|
+
onChange: (event: SyntheticEvent, checked: boolean) => void;
|
|
5228
|
+
onClose?: () => void;
|
|
5229
|
+
};
|
|
5230
|
+
/**
|
|
5231
|
+
*
|
|
5232
|
+
* Development-only feature toggle component (not for production use).
|
|
5233
|
+
*
|
|
5234
|
+
* **Important**: This component is intended *strictly* for development environments and should not be included in production builds.
|
|
5235
|
+
*
|
|
5236
|
+
* The `FeatureFlagCheckbox` is a temporary UI component used by developers to enable or disable feature flags manually. It renders a labeled checkbox and an optional close button to dismiss the control.
|
|
5237
|
+
*
|
|
5238
|
+
* **Note**: The component is rendered only when the `isDevelopment` prop is set to `true`. It is the responsibility of the consuming application to ensure the provided value is correct so that is only rendered in non-production environments.
|
|
5239
|
+
*
|
|
5240
|
+
* Documentation: https://up-components.up42.com/?path=/docs/development-featureflagcheckbox--docs
|
|
5241
|
+
*/
|
|
5242
|
+
declare function FeatureFlagCheckbox({ label, checked, isDevelopment, onChange, onClose }: FeatureFlagCheckboxProps): React__default.JSX.Element;
|
|
5243
|
+
|
|
5204
5244
|
type DocumentationPopoverProps = {
|
|
5205
5245
|
title: string;
|
|
5206
5246
|
children: React__default.ReactNode;
|
|
@@ -5387,6 +5427,31 @@ declare const useCursorPagination: (fetchingHook: ({ params }: {
|
|
|
5387
5427
|
[paramName: string]: string;
|
|
5388
5428
|
} | undefined) => UseCursorPaginationResponse;
|
|
5389
5429
|
|
|
5430
|
+
type UseToggleResult = [
|
|
5431
|
+
boolean,
|
|
5432
|
+
{
|
|
5433
|
+
on: () => void;
|
|
5434
|
+
off: () => void;
|
|
5435
|
+
flip: () => void;
|
|
5436
|
+
}
|
|
5437
|
+
];
|
|
5438
|
+
/**
|
|
5439
|
+
* A custom hook that provides a boolean state with convenient toggle actions.
|
|
5440
|
+
*
|
|
5441
|
+
* This hook returns a boolean value and an object with three methods to control the state:
|
|
5442
|
+
* - `on`: Sets the value to `true`
|
|
5443
|
+
* - `off`: Sets the value to `false`
|
|
5444
|
+
* - `flip`: Toggles the current value (true becomes false, false becomes true)
|
|
5445
|
+
*
|
|
5446
|
+
* @param initialState - The initial boolean value. Can be a boolean or a function that returns a boolean.
|
|
5447
|
+
* @returns A tuple containing:
|
|
5448
|
+
* - The current boolean value
|
|
5449
|
+
* - An object with `on`, `off`, and `flip` methods to control the state
|
|
5450
|
+
*
|
|
5451
|
+
* Documentation: https://up-components.up42.com/?path=/docs/utils--docs#usetoggle
|
|
5452
|
+
*/
|
|
5453
|
+
declare function useToggle(initialState: boolean | (() => boolean)): UseToggleResult;
|
|
5454
|
+
|
|
5390
5455
|
/**
|
|
5391
5456
|
* useDebounce is a generic React Hook that returns a debounced version of a given value.
|
|
5392
5457
|
* @param {T} value - The value to debounce.
|
|
@@ -5448,5 +5513,5 @@ type ContextState = {
|
|
|
5448
5513
|
*/
|
|
5449
5514
|
declare const useAlert: () => ContextState;
|
|
5450
5515
|
|
|
5451
|
-
export { Alert, Avatar, Badge, Banner, Button, Checkbox, CodeInline, CodeSnippet, ContactBox, ControlButton, CopyButton, DataGrid, DateTime, Divider, DocumentationPopover, EmptyState, FeatureCard, FeatureCardHeader, FeatureCardHeaderActions, FormCheckbox, FormDatePicker, FormDateRangePicker, FormDateRangePickerList, FormDateTimePicker, FormInput, FormRadio, FormSelect, FormSwitch, GridContainer, GridItem, Icon, Illustration, InfoCard, InfoModal, InfoPopover, Input, Link, Loading, Logo, NotFound, PageContainer, PageHeader, Radio, Select, Slider, StatusLight, Switch, Tab, TabGroup, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TablePagination, TableRow, TableSortLabel, Tabs, Tag, Typography, UpComponentsProvider, capitalize, copyToClipboard, formatDate, formatFileSize, formatNumber, theme, useAlert, useCursorPagination, useDebounce, useQueryParams, useRemotePagination };
|
|
5452
|
-
export type { AlertProps, AvatarProps, BadgeProps, BannerProps, ButtonProps, CheckboxProps, CodeInlineProps, CodeSnippetItemProps, CodeSnippetProps, ContactBoxProps, ControlButtonProps, CopyButtonProps, CreateAlertProps, CreateSnackbarProps, CursorPaginatedResponse, DatePickerDateType, DateRange, DateTimeProps, DividerProps, DocumentationPopoverProps, EmptyStateProps, FeatureCardHeaderActionsProps, FeatureCardHeaderProps, FeatureCardProps, FormCheckboxProps, FormDatePickerProps, FormDateRangePickerListProps, FormDateRangePickerProps, FormDateTimePickerProps, FormInputProps, FormRadioProps, FormSelectProps, FormSwitchProps, GridContainerProps, GridItemProps, IconAction, IconProps$1 as IconProps, IllustrationProps, InfoCardProps, InfoModalProps, InfoPopoverProps, InputProps, LinkProps, LoadingProps, LogoProps, MenuAction, NotFoundProps, PageContainerProps, PageHeaderProps, PaginatedResponse, RadioProps, SelectProps, SliderProps, StatusLightProps, SwitchProps, TabGroupProps, TabProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TableSortLabelProps, TabsProps, TagProps, TypographyProps };
|
|
5516
|
+
export { Alert, Avatar, Badge, Banner, Button, Checkbox, CodeInline, CodeSnippet, ContactBox, ControlButton, CopyButton, DataGrid, DateTime, Divider, DocumentationPopover, EditTagsButton, EmptyState, FeatureCard, FeatureCardHeader, FeatureCardHeaderActions, FeatureFlagCheckbox, FormCheckbox, FormDatePicker, FormDateRangePicker, FormDateRangePickerList, FormDateTimePicker, FormInput, FormRadio, FormSelect, FormSwitch, GridContainer, GridItem, Icon, Illustration, InfoCard, InfoModal, InfoPopover, Input, Link, Loading, Logo, NotFound, PageContainer, PageHeader, Radio, Select, Slider, StatusLight, Switch, Tab, TabGroup, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TablePagination, TableRow, TableSortLabel, Tabs, Tag, TagsList, Typography, UpComponentsProvider, capitalize, copyToClipboard, formatDate, formatFileSize, formatNumber, theme, useAlert, useCursorPagination, useDebounce, useQueryParams, useRemotePagination, useToggle };
|
|
5517
|
+
export type { AlertProps, AvatarProps, BadgeProps, BannerProps, ButtonProps, CheckboxProps, CodeInlineProps, CodeSnippetItemProps, CodeSnippetProps, ContactBoxProps, ControlButtonProps, CopyButtonProps, CreateAlertProps, CreateSnackbarProps, CursorPaginatedResponse, DatePickerDateType, DateRange, DateTimeProps, DividerProps, DocumentationPopoverProps, EditTagsButtonProps, EmptyStateProps, FeatureCardHeaderActionsProps, FeatureCardHeaderProps, FeatureCardProps, FeatureFlagCheckboxProps, FormCheckboxProps, FormDatePickerProps, FormDateRangePickerListProps, FormDateRangePickerProps, FormDateTimePickerProps, FormInputProps, FormRadioProps, FormSelectProps, FormSwitchProps, GridContainerProps, GridItemProps, IconAction, IconProps$1 as IconProps, IllustrationProps, InfoCardProps, InfoModalProps, InfoPopoverProps, InputProps, LinkProps, LoadingProps, LogoProps, MenuAction, NotFoundProps, PageContainerProps, PageHeaderProps, PaginatedResponse, RadioProps, SelectProps, SliderProps, StatusLightProps, SwitchProps, TabGroupProps, TabProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TableSortLabelProps, TabsProps, TagProps, TagsListProps, TypographyProps, UseToggleResult };
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './form/label';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './form/label';
|
|
File without changes
|
|
File without changes
|