@up42/up-components 5.0.0-tokens.1 → 5.0.0-tokens.3

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 (65) hide show
  1. package/README.md +14 -2
  2. package/dist/cjs/index.js +2 -2
  3. package/dist/cjs/types/components/Banner/Banner.d.ts +16 -0
  4. package/dist/cjs/types/components/EditTagsButton/EditTagsButton.d.ts +10 -0
  5. package/dist/cjs/types/components/EditTagsButton/EditTagsButton.test.d.ts +1 -0
  6. package/dist/cjs/types/components/EditTagsButton/SearchTags.d.ts +6 -0
  7. package/dist/cjs/types/components/EditTagsButton/SearchTags.test.d.ts +1 -0
  8. package/dist/cjs/types/components/EditTagsButton/TagsManager.d.ts +8 -0
  9. package/dist/cjs/types/components/EditTagsButton/TagsManager.test.d.ts +1 -0
  10. package/dist/cjs/types/components/FeatureCard/FeatureCard.d.ts +3 -2
  11. package/dist/cjs/types/components/FeatureCard/PlaceholderArea.d.ts +4 -0
  12. package/dist/cjs/types/components/FeatureCardHeader/FeatureCardHeader.d.ts +11 -0
  13. package/dist/cjs/types/components/FeatureCardHeaderActions/FeatureCardHeaderActions.d.ts +21 -0
  14. package/dist/cjs/types/components/FeatureFlagCheckbox/FeatureFlagCheckbox.d.ts +25 -0
  15. package/dist/cjs/types/components/FeatureFlagCheckbox/FeatureFlagCheckbox.test.d.ts +1 -0
  16. package/dist/cjs/types/components/Logo/Logo.d.ts +2 -2
  17. package/dist/cjs/types/components/StatusLight/StatusLight.d.ts +46 -0
  18. package/dist/cjs/types/components/StatusLight/StatusLight.test.d.ts +1 -0
  19. package/dist/cjs/types/components/TagsList/MoreTags.d.ts +4 -0
  20. package/dist/cjs/types/components/TagsList/MoreTags.test.d.ts +1 -0
  21. package/dist/cjs/types/components/TagsList/Tags.d.ts +8 -0
  22. package/dist/cjs/types/components/TagsList/Tags.test.d.ts +1 -0
  23. package/dist/cjs/types/components/TagsList/TagsList.d.ts +7 -0
  24. package/dist/cjs/types/components/TagsList/TagsList.test.d.ts +1 -0
  25. package/dist/cjs/types/global/icons/index.d.ts +1 -0
  26. package/dist/cjs/types/global/logos/index.d.ts +1 -0
  27. package/dist/cjs/types/index.d.ts +7 -0
  28. package/dist/cjs/types/utils/hooks/useToggle.d.ts +24 -0
  29. package/dist/cjs/types/utils/hooks/useToggle.test.d.ts +1 -0
  30. package/dist/esm/index.js +2 -2
  31. package/dist/esm/types/components/Banner/Banner.d.ts +16 -0
  32. package/dist/esm/types/components/EditTagsButton/EditTagsButton.d.ts +10 -0
  33. package/dist/esm/types/components/EditTagsButton/EditTagsButton.test.d.ts +1 -0
  34. package/dist/esm/types/components/EditTagsButton/SearchTags.d.ts +6 -0
  35. package/dist/esm/types/components/EditTagsButton/SearchTags.test.d.ts +1 -0
  36. package/dist/esm/types/components/EditTagsButton/TagsManager.d.ts +8 -0
  37. package/dist/esm/types/components/EditTagsButton/TagsManager.test.d.ts +1 -0
  38. package/dist/esm/types/components/FeatureCard/FeatureCard.d.ts +3 -2
  39. package/dist/esm/types/components/FeatureCard/PlaceholderArea.d.ts +4 -0
  40. package/dist/esm/types/components/FeatureCardHeader/FeatureCardHeader.d.ts +11 -0
  41. package/dist/esm/types/components/FeatureCardHeaderActions/FeatureCardHeaderActions.d.ts +21 -0
  42. package/dist/esm/types/components/FeatureFlagCheckbox/FeatureFlagCheckbox.d.ts +25 -0
  43. package/dist/esm/types/components/FeatureFlagCheckbox/FeatureFlagCheckbox.test.d.ts +1 -0
  44. package/dist/esm/types/components/Logo/Logo.d.ts +2 -2
  45. package/dist/esm/types/components/StatusLight/StatusLight.d.ts +46 -0
  46. package/dist/esm/types/components/StatusLight/StatusLight.test.d.ts +1 -0
  47. package/dist/esm/types/components/TagsList/MoreTags.d.ts +4 -0
  48. package/dist/esm/types/components/TagsList/MoreTags.test.d.ts +1 -0
  49. package/dist/esm/types/components/TagsList/Tags.d.ts +8 -0
  50. package/dist/esm/types/components/TagsList/Tags.test.d.ts +1 -0
  51. package/dist/esm/types/components/TagsList/TagsList.d.ts +7 -0
  52. package/dist/esm/types/components/TagsList/TagsList.test.d.ts +1 -0
  53. package/dist/esm/types/global/icons/index.d.ts +1 -0
  54. package/dist/esm/types/global/logos/index.d.ts +1 -0
  55. package/dist/esm/types/index.d.ts +7 -0
  56. package/dist/esm/types/utils/hooks/useToggle.d.ts +24 -0
  57. package/dist/esm/types/utils/hooks/useToggle.test.d.ts +1 -0
  58. package/dist/index.d.ts +488 -313
  59. package/package.json +1 -1
  60. package/dist/cjs/types/global/overrides/form/datePicker.d.ts +0 -2
  61. package/dist/cjs/types/global/overrides/index.d.ts +0 -1
  62. package/dist/esm/types/global/overrides/form/datePicker.d.ts +0 -2
  63. package/dist/esm/types/global/overrides/index.d.ts +0 -1
  64. /package/dist/cjs/types/{global/overrides/form/label.d.ts → components/FormLabel/FormLabel.overrides.d.ts} +0 -0
  65. /package/dist/esm/types/{global/overrides/form/label.d.ts → components/FormLabel/FormLabel.overrides.d.ts} +0 -0
@@ -23,6 +23,14 @@ export type BannerProps = {
23
23
  */
24
24
  onDismiss?: ButtonProps['onClick'];
25
25
  title: string;
26
+ /**
27
+ * The size(height) of the banner.
28
+ * - 'default': Standard banner height.
29
+ * - 'slim': Reduced height, intended for use only with the 'inline' variant.
30
+ *
31
+ * Note: 'slim' size has a fixed height of '32px' and should be used exclusively with variant='inline' and probably text ellipsis to ensure proper layout and appearance.
32
+ */
33
+ size?: 'default' | 'slim';
26
34
  } & Omit<AlertProps, 'title' | 'closeText' | 'icon' | 'role' | 'onClose'>;
27
35
  /**
28
36
  * Documentation: https://up-components.up42.com/?path=/docs/feedback-banner--docs
@@ -49,4 +57,12 @@ export declare const Banner: React.ForwardRefExoticComponent<Omit<{
49
57
  */
50
58
  onDismiss?: ButtonProps['onClick'];
51
59
  title: string;
60
+ /**
61
+ * The size(height) of the banner.
62
+ * - 'default': Standard banner height.
63
+ * - 'slim': Reduced height, intended for use only with the 'inline' variant.
64
+ *
65
+ * Note: 'slim' size has a fixed height of '32px' and should be used exclusively with variant='inline' and probably text ellipsis to ensure proper layout and appearance.
66
+ */
67
+ size?: "default" | "slim" | undefined;
52
68
  } & Omit<AlertProps, "title" | "role" | "onClose" | "closeText" | "icon">, "ref"> & React.RefAttributes<unknown>>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export type EditTagsButtonProps = {
3
+ tags: string[];
4
+ tagPool?: string[];
5
+ onSave: (tags: string[]) => Promise<void>;
6
+ label?: string;
7
+ tooltip?: string;
8
+ isUpdatingTags?: boolean;
9
+ };
10
+ export declare function EditTagsButton({ tags, tagPool, onSave, label, tooltip, isUpdatingTags }: 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 {};
@@ -1,7 +1,8 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { CardProps } from '@mui/material';
3
+ import { BannerProps } from '../Banner/Banner';
3
4
  export type FeatureCardProps = CardProps & {
4
- banner?: ReactNode;
5
+ bannerProps?: Omit<BannerProps, 'title' | 'variant'>;
5
6
  header?: {
6
7
  title: ReactNode;
7
8
  actions?: ReactNode;
@@ -27,4 +28,4 @@ export type FeatureCardProps = CardProps & {
27
28
  */
28
29
  hovered?: boolean;
29
30
  };
30
- export declare const FeatureCard: ({ children, header, footer, banner, isSelectable, selected, isHoverable, hovered, ...props }: FeatureCardProps) => React.JSX.Element;
31
+ export declare const FeatureCard: ({ children, header, footer, bannerProps, isSelectable, selected, isHoverable, hovered, ...props }: FeatureCardProps) => React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const PlaceholderArea: ({ children }: {
3
+ children: React.ReactNode;
4
+ }) => React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { CheckboxProps } from '../Checkbox/Checkbox';
3
+ export type FeatureCardHeaderProps = {
4
+ header: string;
5
+ subheader?: string;
6
+ imageUrl?: string;
7
+ selected?: boolean;
8
+ onSelectChange?: CheckboxProps['onChange'];
9
+ isLoading?: boolean;
10
+ };
11
+ export declare const FeatureCardHeader: ({ header, subheader, imageUrl, selected, onSelectChange, isLoading, }: FeatureCardHeaderProps) => React.JSX.Element;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { SxProps } from '@mui/material';
3
+ import { IconProps } from 'components/Icon/Icon';
4
+ export type IconAction = {
5
+ name: IconProps['name'];
6
+ tooltip?: string;
7
+ isActive?: boolean;
8
+ onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
9
+ isDisabled?: boolean;
10
+ sx?: SxProps;
11
+ };
12
+ export type MenuAction = {
13
+ label: string;
14
+ onClick: (event: React.MouseEvent<HTMLLIElement>) => void;
15
+ sx?: SxProps;
16
+ };
17
+ export type FeatureCardHeaderActionsProps = {
18
+ iconActions?: IconAction[];
19
+ menuActions?: MenuAction[];
20
+ };
21
+ export declare const FeatureCardHeaderActions: ({ iconActions, menuActions }: FeatureCardHeaderActionsProps) => React.JSX.Element;
@@ -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;
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import { SvgIconProps } from '@mui/material';
3
3
  export type LogoProps = {
4
- variant?: 'dark' | 'light';
4
+ variant?: 'dark' | 'light' | 'vertical';
5
5
  /**
6
6
  * use isKSA to toggle between KSA and INT logo versions
7
7
  */
8
8
  isKSA?: boolean;
9
- size?: 'small' | 'medium';
9
+ size?: 'small' | 'medium' | 'large';
10
10
  } & Omit<SvgIconProps, 'children' | 'inheritViewBox' | 'shapeRendering' | 'viewBox' | 'fontSize'>;
11
11
  /**
12
12
  * Documentation: https://up-components.up42.com/?path=/docs/data-display-logos--docs
@@ -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,7 @@
1
+ import React from 'react';
2
+ export type TagsListProps = {
3
+ tags: string[];
4
+ onTagsUpdate?: (tags: string[]) => Promise<void>;
5
+ isUpdatingTags?: boolean;
6
+ };
7
+ export declare const TagsList: ({ tags: tagsProp, onTagsUpdate, isUpdatingTags }: TagsListProps) => React.JSX.Element;
@@ -103,6 +103,7 @@ export { default as Map } from './Map.svg';
103
103
  export { default as MapPin } from './MapPin.svg';
104
104
  export { default as MapSearch } from './MapSearch.svg';
105
105
  export { default as Marketplace } from './Marketplace.svg';
106
+ export { default as MarketplaceExternal } from './MarketplaceExternal.svg';
106
107
  export { default as MenuCircleFilledHorizontal } from './MenuCircleFilledHorizontal.svg';
107
108
  export { default as MenuCircleFilledVertical } from './MenuCircleFilledVertical.svg';
108
109
  export { default as MenuOpenHorizontal } from './MenuOpenHorizontal.svg';
@@ -2,3 +2,4 @@ export { default as INTDark } from './int-dark.svg';
2
2
  export { default as INTLight } from './int-light.svg';
3
3
  export { default as KSADark } from './ksa-dark.svg';
4
4
  export { default as KSALight } from './ksa-light.svg';
5
+ export { default as KSALightVertical } from './ksa-light-vertical.svg';
@@ -46,6 +46,12 @@ export { Tag, type TagProps } from './components/Tag/Tag';
46
46
  export { DateTime, type DateTimeProps } from './components/DateTime/DateTime';
47
47
  export { Divider, type DividerProps } from './components/Divider/Divider';
48
48
  export { FeatureCard, type FeatureCardProps } from './components/FeatureCard/FeatureCard';
49
+ export { FeatureCardHeader, type FeatureCardHeaderProps } from './components/FeatureCardHeader/FeatureCardHeader';
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';
54
+ export { FeatureFlagCheckbox, type FeatureFlagCheckboxProps, } from './components/FeatureFlagCheckbox/FeatureFlagCheckbox';
49
55
  export { DocumentationPopover, type DocumentationPopoverProps, } from './components/DocumentationPopover/DocumentationPopover';
50
56
  export { CodeInline, type CodeInlineProps } from './components/CodeInline/CodeInline';
51
57
  export { CodeSnippet, type CodeSnippetProps, type CodeSnippetItemProps } from './components/CodeSnippet/CodeSnippet';
@@ -60,5 +66,6 @@ export { formatFileSize } from './utils/helpers/formatFileSize';
60
66
  export { useQueryParams } from './utils/hooks/useQueryParams';
61
67
  export { useRemotePagination, type PaginatedResponse } from './utils/hooks/useRemotePagination';
62
68
  export { useCursorPagination, type CursorPaginatedResponse } from './utils/hooks/useCursorPagination';
69
+ export { useToggle, type UseToggleResult } from './utils/hooks/useToggle';
63
70
  export { useDebounce } from './utils/hooks/useDebounce';
64
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 {};