@licklist/design 0.50.1 → 0.51.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.
@@ -11,8 +11,9 @@ type FooterProps = Partial<{
11
11
  disabled?: boolean;
12
12
  buttonLabel?: ReactNode;
13
13
  showButton?: boolean;
14
+ isLoading: boolean;
14
15
  } & (ButtonPropsWithoutOnClick | ButtonPropsWithOnClick)>;
15
16
  export type BookingSummaryFooterProps = PropsWithChildren<FooterProps>;
16
- export declare const BookingSummaryFooter: ({ disabled, onClick, buttonLabel, form, children, showButton, }: BookingSummaryFooterProps) => JSX.Element;
17
+ export declare const BookingSummaryFooter: ({ disabled: _disabled, onClick, buttonLabel, form, children, showButton, isLoading, }: BookingSummaryFooterProps) => JSX.Element;
17
18
  export {};
18
19
  //# sourceMappingURL=BookingSummaryFooter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BookingSummaryFooter.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK5D,KAAK,yBAAyB,GAAG;IAC/B,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,KAAK,WAAW,GAAG,OAAO,CACxB;IACE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,CAAC,yBAAyB,GAAG,sBAAsB,CAAC,CACzD,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAEvE,eAAO,MAAM,oBAAoB,oEAO9B,yBAAyB,gBAe3B,CAAC"}
1
+ {"version":3,"file":"BookingSummaryFooter.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/BookingSummaryFooter/BookingSummaryFooter.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAM5D,KAAK,yBAAyB,GAAG;IAC/B,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,KAAK,WAAW,GAAG,OAAO,CACxB;IACE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,CAAC,yBAAyB,GAAG,sBAAsB,CAAC,CACzD,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAEvE,eAAO,MAAM,oBAAoB,0FAQ9B,yBAAyB,gBAyB3B,CAAC"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=e(require("react")),o=require("react-i18next"),n=e(require("react-bootstrap/Button")),i=require("../../constants.js");exports.BookingSummaryFooter=function(e){var a=e.disabled,s=void 0!==a&&a,u=e.onClick,l=e.buttonLabel,c=e.form,d=void 0===c?i.STEP_FORM_ID:c,m=e.children,f=e.showButton,b=void 0===f||f,v=o.useTranslation("Design").t,p=u?{onClick:u}:{type:"submit",form:d};return r.createElement("div",{className:"d-flex flex-column"},m,b&&r.createElement(n,t.__assign({className:"m-0 mt-3",disabled:s},p),null!=l?l:v("continue")))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=e(require("react")),n=require("react-i18next"),i=e(require("react-bootstrap/Button")),o=require("react-bootstrap"),a=require("../../constants.js");exports.BookingSummaryFooter=function(e){var s=e.disabled,u=void 0!==s&&s,l=e.onClick,c=e.buttonLabel,d=e.form,m=void 0===d?a.STEP_FORM_ID:d,f=e.children,b=e.showButton,p=void 0===b||b,v=e.isLoading,q=void 0!==v&&v,x=n.useTranslation("Design").t,_=l?{onClick:l}:{type:"submit",form:m},g=u||q;return r.createElement("div",{className:"d-flex flex-column"},f,p&&r.createElement(i,t.__assign({className:"m-0 d-flex align-items-center justify-content-center mt-3",disabled:g},_),q?r.createElement(o.Spinner,{animation:"border",size:"sm",role:"status"}):null!=c?c:x("continue")))};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.50.1",
3
+ "version": "0.51.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -1,6 +1,7 @@
1
1
  import React, { ReactNode, PropsWithChildren } from "react";
2
2
  import { useTranslation } from "react-i18next";
3
3
  import Button from "react-bootstrap/Button";
4
+ import { Spinner } from "react-bootstrap";
4
5
  import { STEP_FORM_ID } from "../../constants";
5
6
 
6
7
  type ButtonPropsWithoutOnClick = {
@@ -18,29 +19,41 @@ type FooterProps = Partial<
18
19
  disabled?: boolean;
19
20
  buttonLabel?: ReactNode;
20
21
  showButton?: boolean;
22
+ isLoading: boolean;
21
23
  } & (ButtonPropsWithoutOnClick | ButtonPropsWithOnClick)
22
24
  >;
23
25
 
24
26
  export type BookingSummaryFooterProps = PropsWithChildren<FooterProps>;
25
27
 
26
28
  export const BookingSummaryFooter = ({
27
- disabled = false,
29
+ disabled: _disabled = false,
28
30
  onClick,
29
31
  buttonLabel,
30
32
  form = STEP_FORM_ID,
31
33
  children,
32
34
  showButton = true,
35
+ isLoading = false,
33
36
  }: BookingSummaryFooterProps) => {
34
37
  const { t } = useTranslation("Design");
35
38
 
36
39
  const buttonProps = onClick ? { onClick } : { type: "submit", form };
37
40
 
41
+ const disabled = _disabled || isLoading;
42
+
38
43
  return (
39
44
  <div className="d-flex flex-column">
40
45
  {children}
41
46
  {showButton && (
42
- <Button className="m-0 mt-3" disabled={disabled} {...buttonProps}>
43
- {buttonLabel ?? t("continue")}
47
+ <Button
48
+ className="m-0 d-flex align-items-center justify-content-center mt-3"
49
+ disabled={disabled}
50
+ {...buttonProps}
51
+ >
52
+ {isLoading ? (
53
+ <Spinner animation="border" size="sm" role="status" />
54
+ ) : (
55
+ buttonLabel ?? t("continue")
56
+ )}
44
57
  </Button>
45
58
  )}
46
59
  </div>