@cloudoperators/juno-ui-components 5.3.0 → 5.4.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.
@@ -3,7 +3,7 @@ import { KnownIcons } from '../Icon/Icon.component';
3
3
  /**
4
4
  * The basic button component. Use this for `onClick` interactions.
5
5
  */
6
- export declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
6
+ export declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
7
7
  type ButtonVariant = "primary" | "primary-danger" | "default" | "subdued";
8
8
  type ButtonSize = "small" | "default";
9
9
  export interface ButtonProps extends Omit<React.HTMLProps<HTMLAnchorElement> | React.HTMLProps<HTMLButtonElement>, "size"> {
@@ -53,7 +53,7 @@ export declare enum KnownIconsEnum {
53
53
  widgets = "widgets"
54
54
  }
55
55
  export type KnownIcons = keyof typeof KnownIconsEnum;
56
- export declare const Icon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
56
+ export declare const Icon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
57
57
  export interface IconProps extends Omit<React.HTMLProps<HTMLAnchorElement> | React.HTMLProps<HTMLButtonElement>, "size"> {
58
58
  icon?: KnownIcons;
59
59
  color?: string;
@@ -1,19 +1,39 @@
1
1
  import { default as React, ReactElement, ReactNode } from 'react';
2
2
  /**
3
- * The PageHeader component renders a header to the application.
4
- * In order to customize the header Logo, PageHeader accepts a `logo` prop that expects a custom component: `logo={<CustomLogo />}` Ideally, the custom logo component should return an `<img />` or an inline `<svg>` element. When using `svg`, make sure the file does not contain any unnecessary cruft. `Svgo` is a great tool to optimize `svg` files. Make sure the `viewBox` element is not removed when optimizing a file for usage a a header logo.
5
- * Pass as prop to AppShell so it gets slotted into the correct place in the layout. If building your layout manually without AppShell place as first child of AppBody.
3
+ * The `PageHeader` component renders a header for an application with customisable `logo`, `title` and other options.
4
+ * Ideally, the custom logo component should return an `<img />` or an inline `<svg>` element.
5
+ * When using SVG, ensure the file is optimized to eliminate any superfluous elements or data that can contribute to increased file size and reduced performance. `Svgo` is a great tool to optimize `svg` files. Make sure the `viewBox` element is not removed when optimizing a file for usage a a header logo.
6
+ * Pass as prop to `AppShell` so it gets slotted into the correct place in the layout. If building your layout manually without `AppShell` place as first child of AppBody.
6
7
  */
7
8
  export declare const PageHeader: React.FC<PageHeaderProps>;
8
9
  export interface PageHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
9
- /** Heading (typically the name of the application) */
10
+ /**
11
+ * Name of the application.
12
+ */
13
+ applicationName?: string;
14
+ /**
15
+ * DEPRECATED PROP - Replaced by `applicationName`. If `applicationName` is provided, it will take precedence.
16
+ */
10
17
  heading?: string | ReactElement;
11
- /** Add custom class name */
18
+ /**
19
+ * Link to open when applicationName or logo is clicked. If `onClick` is provided, it will take precedence.
20
+ */
21
+ href?: string;
22
+ /**
23
+ * Custom class names.
24
+ */
12
25
  className?: string;
26
+ /**
27
+ * Application logo.
28
+ */
13
29
  logo?: boolean | ReactElement;
14
- /** Optional: onClick handler for brand logo/page title. To be used to navigate to the home page. */
30
+ /**
31
+ * Handler executed when `applicationName` or `logo` are clicked.
32
+ */
15
33
  onClick?: React.MouseEventHandler<HTMLDivElement>;
16
- /** Children to render in the header such as user name, avatar, log-in/out button, etc. */
34
+ /**
35
+ * Children to render in the header such as user name, avatar, log-in/out button, etc.
36
+ */
17
37
  children?: ReactNode;
18
38
  }
19
39
  //# sourceMappingURL=PageHeader.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PageHeader.component.d.ts","sourceRoot":"","sources":["../../../src/components/PageHeader/PageHeader.component.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AA+CtD;;;;GAIG;AAEH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA8BhD,CAAA;AAED,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC3E,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAAA;IAC/B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,GAAG,YAAY,CAAA;IAC7B,qGAAqG;IACrG,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAA;IACjD,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB"}
1
+ {"version":3,"file":"PageHeader.component.d.ts","sourceRoot":"","sources":["../../../src/components/PageHeader/PageHeader.component.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AA0DtD;;;;;GAKG;AAEH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA4ChD,CAAA;AAED,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC3E;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAAA;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,YAAY,CAAA;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAA;IACjD;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB"}
@@ -4,9 +4,9 @@ type Story = StoryObj<typeof meta>;
4
4
  declare const meta: Meta<typeof PageHeader>;
5
5
  export default meta;
6
6
  export declare const Default: Story;
7
- export declare const WithHeading: Story;
8
- export declare const WithHeadingAndChildren: Story;
9
- export declare const NoHeadingWithChildren: Story;
7
+ export declare const WithapplicationName: Story;
8
+ export declare const WithapplicationNameAndChildren: Story;
9
+ export declare const NoapplicationNameWithChildren: Story;
10
10
  export declare const NoLogo: Story;
11
11
  export declare const WithCustomLogoSquareInline: Story;
12
12
  export declare const WithCustomLogoLandscapeInline: Story;
@@ -1 +1 @@
1
- {"version":3,"file":"PageHeader.stories.d.ts","sourceRoot":"","sources":["../../../src/components/PageHeader/PageHeader.stories.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAO3D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAgBpC,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAuBjC,CAAA;AACD,eAAe,IAAI,CAAA;AAEnB,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KASzB,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KAKpC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,KAInC,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,KAMxC,CAAA;AAED,eAAO,MAAM,6BAA6B,EAAE,KAM3C,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAK1C,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,KAMrC,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,KAMxC,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE,KAMvC,CAAA"}
1
+ {"version":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