@cloudoperators/juno-ui-components 5.0.1 → 5.1.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.
@@ -16,14 +16,32 @@ To make the modal less intrusive and effectively un-modal it, pass `closeOnBackd
16
16
  export declare const Modal: React.FC<ModalProps>;
17
17
  type ModalSize = "small" | "large";
18
18
  export interface ModalProps extends Omit<React.HTMLProps<HTMLDivElement>, "size"> {
19
- /** The aria-label of the modal. Use only if the modal does NOT have a `title` or `heading`. */
20
- ariaLabel?: string;
21
19
  /** The title of the modal. This will be rendering as the heading of the modal, and the modal's `arial-labelledby` attribute will reference the title/heading element. If the modal does not have `title` or `heading`, use `ariaLabel` to provide an accessible name for the modal. */
22
20
  title?: string;
23
21
  /** Also the title of the modal, just for API flexibility. If both `title` and `heading` are passed, `title` will win. */
24
22
  heading?: string;
23
+ /** The aria-label of the modal. Use only if the modal does NOT have a `title` or `heading`. */
24
+ ariaLabel?: string;
25
+ /** By default, the first element in the tab order of the Modal content will be focussed. To specify an element to be focussed when the modal opens, pass an element, DOM node, or selector string. */
26
+ initialFocus?: HTMLElement | SVGElement | string;
27
+ /** Whether the modal will be open */
28
+ open?: boolean;
29
+ /** Whether the modal can be closed using an "X"-Button at the top right. Defaults to true. */
30
+ closeable?: boolean;
31
+ /** Whether the modal should be closed when the backdrop is clicked. Essentially 'un-modals' the modal. */
32
+ closeOnEsc?: boolean;
25
33
  /** The Modal size */
34
+ closeOnBackdropClick?: boolean;
35
+ /** Whether the modal can be closed by hitting the ESC key */
26
36
  size?: ModalSize;
37
+ /** Pass to remove default padding from the content area of the modal */
38
+ unpad?: boolean;
39
+ /** Custom className to add to the modal */
40
+ className?: string;
41
+ /** The children of the modal. These will be rendered as the modal content. To render custom buttons at the bottom, see `modalFooter` below.*/
42
+ children?: React.ReactNode;
43
+ /** Optional. Pass a `<ModalFooter />` component with custom content as required. Will default to using the `<ModalFooter/>` component internally. */
44
+ modalFooter?: React.ReactElement;
27
45
  /** Pass a label to render a confirm button and a Cancel button */
28
46
  confirmButtonLabel?: string;
29
47
  /** Pass a label for the cancel button. Defaults to "Cancel" */
@@ -32,28 +50,14 @@ export interface ModalProps extends Omit<React.HTMLProps<HTMLDivElement>, "size"
32
50
  confirmButtonIcon?: KnownIcons;
33
51
  /** Pass an icon name to show on the cancelling button */
34
52
  cancelButtonIcon?: KnownIcons;
35
- /** Whether the modal will be open */
36
- open?: boolean;
37
- /** The children of the modal. These will be rendered as the modal content. To render custom buttons at the bottom, see `modalFooter` below.*/
38
- children?: React.ReactNode;
39
- /** Optional. Pass a `<ModalFooter />` component with custom content as required. Will default to using the `<ModalFooter/>` component internally. */
40
- modalFooter?: React.ReactElement;
41
- /** Whether the modal can be closed using an "X"-Button at the top right. Defaults to true. */
42
- closeable?: boolean;
43
- /** Pass to remove default padding from the content area of the modal */
44
- unpad?: boolean;
45
- /** Custom className to add to the modal */
46
- className?: string;
53
+ /** Determines whether the confirm action button should be disabled */
54
+ disableConfirmButton?: boolean;
55
+ /** Determines whether the cancel action button should be disabled */
56
+ disableCancelButton?: boolean;
47
57
  /** A handler to execute once the modal is confirmed by clicking the confrim button if exists. Note that we do not close the modal automatically. */
48
58
  onConfirm?: React.MouseEventHandler<HTMLElement>;
49
59
  /** A handler to execute once the modal is cancelled or dismissed using the x-Close button, Cancel-button or pressing ESC */
50
60
  onCancel?: (event: React.MouseEvent<HTMLElement> | KeyboardEvent) => void;
51
- /** Whether the modal should be closed when the backdrop is clicked. Essentially 'un-modals' the modal. */
52
- closeOnBackdropClick?: boolean;
53
- /** Whether the modal can be closed by hitting the ESC key */
54
- closeOnEsc?: boolean;
55
- /** By default, the first element in the tab order of the Modal content will be focussed. To specify an element to be focussed when the modal opens, pass an element, DOM node, or selector string. */
56
- initialFocus?: HTMLElement | SVGElement | string;
57
61
  }
58
62
  export {};
59
63
  //# sourceMappingURL=Modal.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.component.d.ts","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;IACxE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8IAA8I;IAC9I,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,qJAAqJ;IACrJ,WAAW,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IAChC,kEAAkE;IAClE,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,UAAU,CAAA;IAC9B,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,UAAU,CAAA;IAC7B,sEAAsE;IACtE,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,qEAAqE;IACrE,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,oJAAoJ;IACpJ,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAA;IAChD,6HAA6H;IAE7H,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,aAAa,KAAK,IAAI,CAAA;CAC1E"}
@@ -5,6 +5,7 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
7
  export declare const SimpleConfirmDialog: Story;
8
+ export declare const SimpleConfirmDialogWithDisabledButtons: Story;
8
9
  export declare const AutoFocusDialog: Story;
9
10
  export declare const LargeWithTitle: Story;
10
11
  export declare const NonCloseable: Story;
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAc,MAAM,mBAAmB,CAAA;AAqCrD,QAAA,MAAM,IA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1B,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAOlC,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAsBnB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAoB/B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAe/B,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAwBjC,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KA8ClC,CAAA"}
@@ -8,6 +8,8 @@ Can alternatively render all custom children as passed.
8
8
  */
9
9
  export declare const ModalFooter: React.FC<ModalFooterProps>;
10
10
  export interface ModalFooterProps extends React.HTMLProps<HTMLDivElement> {
11
+ /** A custom className. Useful to configure flex items alignment when passing custom content as children. */
12
+ className?: string;
11
13
  /** Custom children to render. */
12
14
  children?: React.ReactNode;
13
15
  /** The label for the Confirm-button. When passed, the component will render a Confirm button and a cancel button, otherwise the component will ONLY render a Close-Button. */
@@ -18,8 +20,10 @@ export interface ModalFooterProps extends React.HTMLProps<HTMLDivElement> {
18
20
  confirmButtonIcon?: KnownIcons;
19
21
  /** Pass an icon name to show on the cancelling button */
20
22
  cancelButtonIcon?: KnownIcons;
21
- /** A custom className. Useful to configure flex items alignment when passing custom content as children. */
22
- className?: string;
23
+ /** Determines whether the confirm action button should be disabled */
24
+ disableConfirmButton?: boolean;
25
+ /** Determines whether the cancel action button should be disabled */
26
+ disableCancelButton?: boolean;
23
27
  /** Handler to execute once the confirming button is clicked */
24
28
  onConfirm?: React.MouseEventHandler<HTMLElement>;
25
29
  /** Handler to execute once the cancelling button is clicked */
@@ -1 +1 @@
1
- {"version":3,"file":"ModalFooter.component.d.ts","sourceRoot":"","sources":["../../../src/components/ModalFooter/ModalFooter.component.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAgBnD;;;;;EAKE;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,C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AAE,UAAU,CAAA;IAC9B,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,UAAU,CAAA;IAC7B,sEAAsE;IACtE,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,qEAAqE;IACrE,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,+DAA+D;IAC/D,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAA;IAChD,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAA;CAChD"}
@@ -5,5 +5,6 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
7
  export declare const Configure: Story;
8
+ export declare const ConfigureWithDisabledButtons: Story;
8
9
  export declare const Custom: Story;
9
10
  //# sourceMappingURL=ModalFooter.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModalFooter.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ModalFooter/ModalFooter.stories.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAM3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAM1D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAWhC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAgBpB,CAAA"}
1
+ {"version":3,"file":"ModalFooter.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ModalFooter/ModalFooter.stories.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAM3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAM1D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAWhC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAQ1C,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAgBpB,CAAA"}