@up42/up-components 4.10.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 (45) 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/StatusLight/StatusLight.d.ts +46 -0
  10. package/dist/cjs/types/components/StatusLight/StatusLight.test.d.ts +1 -0
  11. package/dist/cjs/types/components/TagsList/MoreTags.d.ts +4 -0
  12. package/dist/cjs/types/components/TagsList/MoreTags.test.d.ts +1 -0
  13. package/dist/cjs/types/components/TagsList/Tags.d.ts +8 -0
  14. package/dist/cjs/types/components/TagsList/Tags.test.d.ts +1 -0
  15. package/dist/cjs/types/components/TagsList/TagsList.d.ts +6 -0
  16. package/dist/cjs/types/components/TagsList/TagsList.test.d.ts +1 -0
  17. package/dist/cjs/types/index.d.ts +4 -0
  18. package/dist/cjs/types/utils/hooks/useToggle.d.ts +24 -0
  19. package/dist/cjs/types/utils/hooks/useToggle.test.d.ts +1 -0
  20. package/dist/esm/index.js +2 -2
  21. package/dist/esm/types/components/EditTagsButton/EditTagsButton.d.ts +9 -0
  22. package/dist/esm/types/components/EditTagsButton/EditTagsButton.test.d.ts +1 -0
  23. package/dist/esm/types/components/EditTagsButton/SearchTags.d.ts +6 -0
  24. package/dist/esm/types/components/EditTagsButton/SearchTags.test.d.ts +1 -0
  25. package/dist/esm/types/components/EditTagsButton/TagsManager.d.ts +8 -0
  26. package/dist/esm/types/components/EditTagsButton/TagsManager.test.d.ts +1 -0
  27. package/dist/esm/types/components/StatusLight/StatusLight.d.ts +46 -0
  28. package/dist/esm/types/components/StatusLight/StatusLight.test.d.ts +1 -0
  29. package/dist/esm/types/components/TagsList/MoreTags.d.ts +4 -0
  30. package/dist/esm/types/components/TagsList/MoreTags.test.d.ts +1 -0
  31. package/dist/esm/types/components/TagsList/Tags.d.ts +8 -0
  32. package/dist/esm/types/components/TagsList/Tags.test.d.ts +1 -0
  33. package/dist/esm/types/components/TagsList/TagsList.d.ts +6 -0
  34. package/dist/esm/types/components/TagsList/TagsList.test.d.ts +1 -0
  35. package/dist/esm/types/index.d.ts +4 -0
  36. package/dist/esm/types/utils/hooks/useToggle.d.ts +24 -0
  37. package/dist/esm/types/utils/hooks/useToggle.test.d.ts +1 -0
  38. package/dist/index.d.ts +86 -2
  39. package/package.json +2 -2
  40. package/dist/cjs/types/global/overrides/form/datePicker.d.ts +0 -2
  41. package/dist/cjs/types/global/overrides/index.d.ts +0 -1
  42. package/dist/esm/types/global/overrides/form/datePicker.d.ts +0 -2
  43. package/dist/esm/types/global/overrides/index.d.ts +0 -1
  44. /package/dist/cjs/types/{global/overrides/form/label.d.ts → components/FormLabel/FormLabel.overrides.d.ts} +0 -0
  45. /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,46 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import React from 'react';
3
+ declare const COLORS: {
4
+ primary: string;
5
+ secondary: string;
6
+ success: string;
7
+ warning: string;
8
+ error: string;
9
+ info: string;
10
+ neutral: string;
11
+ };
12
+ declare const SIZES: {
13
+ small: {
14
+ circle: string;
15
+ fontSize: string;
16
+ fontWeight: string;
17
+ lineHeight: string;
18
+ };
19
+ medium: {
20
+ circle: string;
21
+ fontSize: string;
22
+ fontWeight: string;
23
+ lineHeight: string;
24
+ };
25
+ large: {
26
+ circle: string;
27
+ fontSize: string;
28
+ fontWeight: string;
29
+ lineHeight: string;
30
+ };
31
+ };
32
+ type Variant = 'filled' | 'half';
33
+ type Color = keyof typeof COLORS;
34
+ type Size = keyof typeof SIZES;
35
+ export type StatusLightProps = {
36
+ label: string;
37
+ variant?: Variant;
38
+ color?: Color;
39
+ size?: Size;
40
+ sx?: SxProps<Theme>;
41
+ };
42
+ /**
43
+ * Documentation: https://up-components.up42.com/?path=/docs/data-display-status-light--docs
44
+ */
45
+ export declare const StatusLight: ({ label, variant, color, size, sx, }: StatusLightProps) => React.JSX.Element;
46
+ 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;
@@ -48,6 +48,9 @@ export { Divider, type DividerProps } from './components/Divider/Divider';
48
48
  export { FeatureCard, type FeatureCardProps } from './components/FeatureCard/FeatureCard';
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
+ 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';
51
54
  export { DocumentationPopover, type DocumentationPopoverProps, } from './components/DocumentationPopover/DocumentationPopover';
52
55
  export { CodeInline, type CodeInlineProps } from './components/CodeInline/CodeInline';
53
56
  export { CodeSnippet, type CodeSnippetProps, type CodeSnippetItemProps } from './components/CodeSnippet/CodeSnippet';
@@ -62,5 +65,6 @@ export { formatFileSize } from './utils/helpers/formatFileSize';
62
65
  export { useQueryParams } from './utils/hooks/useQueryParams';
63
66
  export { useRemotePagination, type PaginatedResponse } from './utils/hooks/useRemotePagination';
64
67
  export { useCursorPagination, type CursorPaginatedResponse } from './utils/hooks/useCursorPagination';
68
+ export { useToggle, type UseToggleResult } from './utils/hooks/useToggle';
65
69
  export { useDebounce } from './utils/hooks/useDebounce';
66
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 {};
package/dist/index.d.ts CHANGED
@@ -5157,6 +5157,65 @@ type FeatureCardHeaderActionsProps = {
5157
5157
  };
5158
5158
  declare const FeatureCardHeaderActions: ({ iconActions, menuActions }: FeatureCardHeaderActionsProps) => React__default.JSX.Element;
5159
5159
 
5160
+ declare const COLORS: {
5161
+ primary: string;
5162
+ secondary: string;
5163
+ success: string;
5164
+ warning: string;
5165
+ error: string;
5166
+ info: string;
5167
+ neutral: string;
5168
+ };
5169
+ declare const SIZES: {
5170
+ small: {
5171
+ circle: string;
5172
+ fontSize: string;
5173
+ fontWeight: string;
5174
+ lineHeight: string;
5175
+ };
5176
+ medium: {
5177
+ circle: string;
5178
+ fontSize: string;
5179
+ fontWeight: string;
5180
+ lineHeight: string;
5181
+ };
5182
+ large: {
5183
+ circle: string;
5184
+ fontSize: string;
5185
+ fontWeight: string;
5186
+ lineHeight: string;
5187
+ };
5188
+ };
5189
+ type Variant = 'filled' | 'half';
5190
+ type Color = keyof typeof COLORS;
5191
+ type Size = keyof typeof SIZES;
5192
+ type StatusLightProps = {
5193
+ label: string;
5194
+ variant?: Variant;
5195
+ color?: Color;
5196
+ size?: Size;
5197
+ sx?: SxProps<Theme>;
5198
+ };
5199
+ /**
5200
+ * Documentation: https://up-components.up42.com/?path=/docs/data-display-status-light--docs
5201
+ */
5202
+ declare const StatusLight: ({ label, variant, color, size, sx, }: StatusLightProps) => React__default.JSX.Element;
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
+
5160
5219
  type DocumentationPopoverProps = {
5161
5220
  title: string;
5162
5221
  children: React__default.ReactNode;
@@ -5343,6 +5402,31 @@ declare const useCursorPagination: (fetchingHook: ({ params }: {
5343
5402
  [paramName: string]: string;
5344
5403
  } | undefined) => UseCursorPaginationResponse;
5345
5404
 
5405
+ type UseToggleResult = [
5406
+ boolean,
5407
+ {
5408
+ on: () => void;
5409
+ off: () => void;
5410
+ flip: () => void;
5411
+ }
5412
+ ];
5413
+ /**
5414
+ * A custom hook that provides a boolean state with convenient toggle actions.
5415
+ *
5416
+ * This hook returns a boolean value and an object with three methods to control the state:
5417
+ * - `on`: Sets the value to `true`
5418
+ * - `off`: Sets the value to `false`
5419
+ * - `flip`: Toggles the current value (true becomes false, false becomes true)
5420
+ *
5421
+ * @param initialState - The initial boolean value. Can be a boolean or a function that returns a boolean.
5422
+ * @returns A tuple containing:
5423
+ * - The current boolean value
5424
+ * - An object with `on`, `off`, and `flip` methods to control the state
5425
+ *
5426
+ * Documentation: https://up-components.up42.com/?path=/docs/utils--docs#usetoggle
5427
+ */
5428
+ declare function useToggle(initialState: boolean | (() => boolean)): UseToggleResult;
5429
+
5346
5430
  /**
5347
5431
  * useDebounce is a generic React Hook that returns a debounced version of a given value.
5348
5432
  * @param {T} value - The value to debounce.
@@ -5404,5 +5488,5 @@ type ContextState = {
5404
5488
  */
5405
5489
  declare const useAlert: () => ContextState;
5406
5490
 
5407
- 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, 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 };
5408
- 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, SwitchProps, TabGroupProps, TabProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TableSortLabelProps, TabsProps, TagProps, TypographyProps };
5491
+ export { Alert, Avatar, Badge, Banner, Button, Checkbox, CodeInline, CodeSnippet, ContactBox, ControlButton, CopyButton, DataGrid, DateTime, Divider, DocumentationPopover, EditTagsButton, 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, TagsList, Typography, UpComponentsProvider, capitalize, copyToClipboard, formatDate, formatFileSize, formatNumber, theme, useAlert, useCursorPagination, useDebounce, useQueryParams, useRemotePagination, useToggle };
5492
+ 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, 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@up42/up-components",
3
- "version": "4.10.0",
3
+ "version": "4.12.0",
4
4
  "description": "UP42 Component Library",
5
5
  "author": "Axel Fuhrmann axel.fuhrmann@up42.com",
6
6
  "license": "ISC",
@@ -31,7 +31,7 @@
31
31
  "optimize-icons": "svgo -f src/global/icons"
32
32
  },
33
33
  "dependencies": {
34
- "@up42/design-system-tokens": "^6.0.1",
34
+ "@up42/design-system-tokens": "^6.1.0",
35
35
  "dayjs": "^1.11.7",
36
36
  "prismjs": "^1.29.0"
37
37
  },
@@ -1,2 +0,0 @@
1
- import { OverridesStyleRules } from '@mui/material/styles/overrides';
2
- export declare const datepickerOverrides: OverridesStyleRules;
@@ -1 +0,0 @@
1
- export * from './form/label';
@@ -1,2 +0,0 @@
1
- import { OverridesStyleRules } from '@mui/material/styles/overrides';
2
- export declare const datepickerOverrides: OverridesStyleRules;
@@ -1 +0,0 @@
1
- export * from './form/label';