@up42/up-components 4.11.0 → 4.12.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.
Files changed (41) hide show
  1. package/README.md +14 -2
  2. package/dist/cjs/index.js +2 -2
  3. package/dist/cjs/types/components/EditTagsButton/EditTagsButton.d.ts +9 -0
  4. package/dist/cjs/types/components/EditTagsButton/EditTagsButton.test.d.ts +1 -0
  5. package/dist/cjs/types/components/EditTagsButton/SearchTags.d.ts +6 -0
  6. package/dist/cjs/types/components/EditTagsButton/SearchTags.test.d.ts +1 -0
  7. package/dist/cjs/types/components/EditTagsButton/TagsManager.d.ts +8 -0
  8. package/dist/cjs/types/components/EditTagsButton/TagsManager.test.d.ts +1 -0
  9. package/dist/cjs/types/components/TagsList/MoreTags.d.ts +4 -0
  10. package/dist/cjs/types/components/TagsList/MoreTags.test.d.ts +1 -0
  11. package/dist/cjs/types/components/TagsList/Tags.d.ts +8 -0
  12. package/dist/cjs/types/components/TagsList/Tags.test.d.ts +1 -0
  13. package/dist/cjs/types/components/TagsList/TagsList.d.ts +6 -0
  14. package/dist/cjs/types/components/TagsList/TagsList.test.d.ts +1 -0
  15. package/dist/cjs/types/index.d.ts +3 -0
  16. package/dist/cjs/types/utils/hooks/useToggle.d.ts +24 -0
  17. package/dist/cjs/types/utils/hooks/useToggle.test.d.ts +1 -0
  18. package/dist/esm/index.js +2 -2
  19. package/dist/esm/types/components/EditTagsButton/EditTagsButton.d.ts +9 -0
  20. package/dist/esm/types/components/EditTagsButton/EditTagsButton.test.d.ts +1 -0
  21. package/dist/esm/types/components/EditTagsButton/SearchTags.d.ts +6 -0
  22. package/dist/esm/types/components/EditTagsButton/SearchTags.test.d.ts +1 -0
  23. package/dist/esm/types/components/EditTagsButton/TagsManager.d.ts +8 -0
  24. package/dist/esm/types/components/EditTagsButton/TagsManager.test.d.ts +1 -0
  25. package/dist/esm/types/components/TagsList/MoreTags.d.ts +4 -0
  26. package/dist/esm/types/components/TagsList/MoreTags.test.d.ts +1 -0
  27. package/dist/esm/types/components/TagsList/Tags.d.ts +8 -0
  28. package/dist/esm/types/components/TagsList/Tags.test.d.ts +1 -0
  29. package/dist/esm/types/components/TagsList/TagsList.d.ts +6 -0
  30. package/dist/esm/types/components/TagsList/TagsList.test.d.ts +1 -0
  31. package/dist/esm/types/index.d.ts +3 -0
  32. package/dist/esm/types/utils/hooks/useToggle.d.ts +24 -0
  33. package/dist/esm/types/utils/hooks/useToggle.test.d.ts +1 -0
  34. package/dist/index.d.ts +42 -2
  35. package/package.json +1 -1
  36. package/dist/cjs/types/global/overrides/form/datePicker.d.ts +0 -2
  37. package/dist/cjs/types/global/overrides/index.d.ts +0 -1
  38. package/dist/esm/types/global/overrides/form/datePicker.d.ts +0 -2
  39. package/dist/esm/types/global/overrides/index.d.ts +0 -1
  40. /package/dist/cjs/types/{global/overrides/form/label.d.ts → components/FormLabel/FormLabel.overrides.d.ts} +0 -0
  41. /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,6 @@
1
+ import React from 'react';
2
+ export type SearchTagsProps = {
3
+ tags: string[];
4
+ onAddTag: (tag: string) => void;
5
+ };
6
+ export declare const SearchTags: ({ tags, onAddTag }: SearchTagsProps) => React.JSX.Element;
@@ -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,4 @@
1
+ import React from 'react';
2
+ export declare const MoreTags: ({ tags }: {
3
+ tags: string[];
4
+ }) => React.JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type TagsProps = {
3
+ tags: string[];
4
+ setHiddenTagCount: (count: number) => void;
5
+ hiddenTagCount: number;
6
+ };
7
+ export declare const Tags: ({ tags, setHiddenTagCount, hiddenTagCount }: TagsProps) => React.JSX.Element;
8
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export type TagsListProps = {
3
+ tags: string[];
4
+ onTagsChange?: (tags: string[]) => void;
5
+ };
6
+ export declare const TagsList: ({ tags: tagsProp, onTagsChange }: TagsListProps) => React.JSX.Element;
@@ -49,6 +49,8 @@ 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';
52
54
  export { DocumentationPopover, type DocumentationPopoverProps, } from './components/DocumentationPopover/DocumentationPopover';
53
55
  export { CodeInline, type CodeInlineProps } from './components/CodeInline/CodeInline';
54
56
  export { CodeSnippet, type CodeSnippetProps, type CodeSnippetItemProps } from './components/CodeSnippet/CodeSnippet';
@@ -63,5 +65,6 @@ export { formatFileSize } from './utils/helpers/formatFileSize';
63
65
  export { useQueryParams } from './utils/hooks/useQueryParams';
64
66
  export { useRemotePagination, type PaginatedResponse } from './utils/hooks/useRemotePagination';
65
67
  export { useCursorPagination, type CursorPaginatedResponse } from './utils/hooks/useCursorPagination';
68
+ export { useToggle, type UseToggleResult } from './utils/hooks/useToggle';
66
69
  export { useDebounce } from './utils/hooks/useDebounce';
67
70
  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 {};