@simplybusiness/mobius 3.2.0 → 3.2.2

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file, or link in
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.2.2] - 2023-01-06
9
+
10
+ ### Fixed
11
+
12
+ - Fixed `onClick` type for `<LinkButton>`, so that it always expects default event
13
+
8
14
  ## [3.2.0] - 2023-01-04
9
15
 
10
16
  ### Changed
@@ -14,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
20
  ### Fixed
15
21
 
16
22
  - Fixed typo in `<Chopin.Actions />` docs
23
+ - Fixed `<Chopin.Actions />` back button styles when disabled
17
24
 
18
25
  ## [3.1.3] - 2022-12-19
19
26
 
@@ -131,6 +138,8 @@ Additionally, mobius and themes are available on the public NPM registry and can
131
138
 
132
139
  ## Github Links
133
140
 
141
+ [3.2.2]: https://github.com/simplybusiness/mobius/releases/tag/v3.2.2
142
+ [3.2.1]: https://github.com/simplybusiness/mobius/releases/tag/v3.2.1
134
143
  [3.2.0]: https://github.com/simplybusiness/mobius/releases/tag/v3.2.0
135
144
  [3.1.3]: https://github.com/simplybusiness/mobius/releases/tag/v3.1.3
136
145
  [3.1.2]: https://github.com/simplybusiness/mobius/releases/tag/v3.1.2
@@ -26,8 +26,8 @@ const Actions = (0, react_1.forwardRef)((props, ref) => {
26
26
  const nextButtonClasses = (0, clsx_1.default)("chopin/ActionsNext", {
27
27
  "--single-action": !backButton,
28
28
  });
29
- const backButtonProps = Object.assign(Object.assign({}, backButton), { className: "chopin/ActionsBack", variant: "basic", icon: "buttonArrowLeft" });
30
- const nextButtonProps = Object.assign(Object.assign({}, nextButton), { className: nextButtonClasses });
29
+ const backButtonProps = Object.assign(Object.assign({}, backButton), { className: "chopin/ActionsBack", variant: "ghost", icon: "leftArrow", size: "large" });
30
+ const nextButtonProps = Object.assign(Object.assign({}, nextButton), { className: nextButtonClasses, size: "large" });
31
31
  return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, Object.assign({ ref: ref, className: classes, justifyContent: "center" }, rest, { children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, Object.assign({ className: "chopin/ActionsContainer", justifyContent: "space-between", alignItems: "center" }, { children: [(backButton === null || backButton === void 0 ? void 0 : backButton.href) && ((0, jsx_runtime_1.jsx)(LinkButton_1.LinkButton, Object.assign({}, backButtonProps, { href: backButtonProps.href }, { children: backLabel }))), (nextButton === null || nextButton === void 0 ? void 0 : nextButton.href) && ((0, jsx_runtime_1.jsx)(LinkButton_1.LinkButton, Object.assign({}, nextButtonProps, { href: nextButtonProps.href }, { children: nextLabel })))] })) })));
32
32
  });
33
33
  exports.Actions = Actions;
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sourceRoot":"","sources":["../../../../../src/components/Chopin/Actions/Actions.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,iCAAwC;AAExC,gDAAwB;AAGxB,qCAAkC;AAElC,iDAAoE;AAepE,MAAM,OAAO,GACX,IAAA,kBAAU,EAAC,CAAC,KAAmB,EAAE,GAAe,EAAE,EAAE;IAClD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,KAC7D,KAAK,EAD6D,IAAI,UACtE,KAAK,EADD,mEAAoE,CACnE,CAAC;IAER,MAAM,OAAO,GAAG,IAAA,cAAI,EAAC,QAAQ,EAAE,gBAAgB,EAAE,SAAS,CAAC,CAAC;IAC5D,MAAM,iBAAiB,GAAG,IAAA,cAAI,EAAC,oBAAoB,EAAE;QACnD,iBAAiB,EAAE,CAAC,UAAU;KAC/B,CAAC,CAAC;IAEH,MAAM,eAAe,mCAChB,UAAU,KACb,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,OAAkB,EAC3B,IAAI,EAAE,iBAA6B,GACpC,CAAC;IAEF,MAAM,eAAe,mCAChB,UAAU,KACb,SAAS,EAAE,iBAAiB,GAC7B,CAAC;IAEF,OAAO,CACL,uBAAC,WAAI,kBAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAC,QAAQ,IAAK,IAAI,cAClE,wBAAC,WAAI,kBACH,SAAS,EAAC,yBAAyB,EACnC,cAAc,EAAC,eAAe,EAC9B,UAAU,EAAC,QAAQ,iBAElB,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,KAAI,CACnB,uBAAC,uBAAU,oBAAK,eAAe,IAAE,IAAI,EAAE,eAAe,CAAC,IAAK,gBACzD,SAAS,IACC,CACd,EACA,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,KAAI,CACnB,uBAAC,uBAAU,oBAAK,eAAe,IAAE,IAAI,EAAE,eAAe,CAAC,IAAK,gBACzD,SAAS,IACC,CACd,KACI,IACF,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAGI,0BAAO;AADhB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"Actions.js","sourceRoot":"","sources":["../../../../../src/components/Chopin/Actions/Actions.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,iCAAwC;AAExC,gDAAwB;AAGxB,qCAAkC;AAElC,iDAAoE;AAepE,MAAM,OAAO,GACX,IAAA,kBAAU,EAAC,CAAC,KAAmB,EAAE,GAAe,EAAE,EAAE;IAClD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,KAC7D,KAAK,EAD6D,IAAI,UACtE,KAAK,EADD,mEAAoE,CACnE,CAAC;IAER,MAAM,OAAO,GAAG,IAAA,cAAI,EAAC,QAAQ,EAAE,gBAAgB,EAAE,SAAS,CAAC,CAAC;IAC5D,MAAM,iBAAiB,GAAG,IAAA,cAAI,EAAC,oBAAoB,EAAE;QACnD,iBAAiB,EAAE,CAAC,UAAU;KAC/B,CAAC,CAAC;IAEH,MAAM,eAAe,mCAChB,UAAU,KACb,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,OAAkB,EAC3B,IAAI,EAAE,WAAuB,EAC7B,IAAI,EAAE,OAAe,GACtB,CAAC;IAEF,MAAM,eAAe,mCAChB,UAAU,KACb,SAAS,EAAE,iBAAiB,EAC5B,IAAI,EAAE,OAAe,GACtB,CAAC;IAEF,OAAO,CACL,uBAAC,WAAI,kBAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAC,QAAQ,IAAK,IAAI,cAClE,wBAAC,WAAI,kBACH,SAAS,EAAC,yBAAyB,EACnC,cAAc,EAAC,eAAe,EAC9B,UAAU,EAAC,QAAQ,iBAElB,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,KAAI,CACnB,uBAAC,uBAAU,oBAAK,eAAe,IAAE,IAAI,EAAE,eAAe,CAAC,IAAK,gBACzD,SAAS,IACC,CACd,EACA,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,KAAI,CACnB,uBAAC,uBAAU,oBAAK,eAAe,IAAE,IAAI,EAAE,eAAe,CAAC,IAAK,gBACzD,SAAS,IACC,CACd,KACI,IACF,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAGI,0BAAO;AADhB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC"}
@@ -1,4 +1,4 @@
1
- import { HTMLAttributeAnchorTarget } from "react";
1
+ import { HTMLAttributeAnchorTarget, SyntheticEvent } from "react";
2
2
  import type { Link } from "react-router-dom";
3
3
  import { ButtonProps } from "../Button";
4
4
  export interface LinkButtonProps extends Omit<ButtonProps, "elementType"> {
@@ -9,7 +9,7 @@ export interface LinkButtonProps extends Omit<ButtonProps, "elementType"> {
9
9
  download?: boolean | string;
10
10
  rel?: string;
11
11
  target?: HTMLAttributeAnchorTarget;
12
- onClick?: () => void;
12
+ onClick?: (event: SyntheticEvent) => void;
13
13
  to?: React.ComponentProps<typeof Link>["to"];
14
14
  elementType?: React.ElementType;
15
15
  }
@@ -20,8 +20,8 @@ const Actions = forwardRef((props, ref) => {
20
20
  const nextButtonClasses = clsx("chopin/ActionsNext", {
21
21
  "--single-action": !backButton,
22
22
  });
23
- const backButtonProps = Object.assign(Object.assign({}, backButton), { className: "chopin/ActionsBack", variant: "basic", icon: "buttonArrowLeft" });
24
- const nextButtonProps = Object.assign(Object.assign({}, nextButton), { className: nextButtonClasses });
23
+ const backButtonProps = Object.assign(Object.assign({}, backButton), { className: "chopin/ActionsBack", variant: "ghost", icon: "leftArrow", size: "large" });
24
+ const nextButtonProps = Object.assign(Object.assign({}, nextButton), { className: nextButtonClasses, size: "large" });
25
25
  return (_jsx(Flex, Object.assign({ ref: ref, className: classes, justifyContent: "center" }, rest, { children: _jsxs(Flex, Object.assign({ className: "chopin/ActionsContainer", justifyContent: "space-between", alignItems: "center" }, { children: [(backButton === null || backButton === void 0 ? void 0 : backButton.href) && (_jsx(LinkButton, Object.assign({}, backButtonProps, { href: backButtonProps.href }, { children: backLabel }))), (nextButton === null || nextButton === void 0 ? void 0 : nextButton.href) && (_jsx(LinkButton, Object.assign({}, nextButtonProps, { href: nextButtonProps.href }, { children: nextLabel })))] })) })));
26
26
  });
27
27
  Actions.displayName = "Actions";
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sourceRoot":"","sources":["../../../../../src/components/Chopin/Actions/Actions.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAO,MAAM,OAAO,CAAC;AAExC,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AAepE,MAAM,OAAO,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AK,gBACzD,SAAS,IACC,CACd,EACA,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,KAAI,CACnB,KAAC,UAAU,oBAAK,eAAe,IAAE,IAAI,EAAE,eAAe,CAAC,IAAK,gBACzD,SAAS,IACC,CACd,KACI,IACF,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,CAAC"}
package/dist/mobius.d.ts CHANGED
@@ -43,6 +43,7 @@ import { RefAttributes } from 'react';
43
43
  import { SeparatorProps } from '@react-aria/separator';
44
44
  import { SliderProps as SliderProps_2 } from '@react-types/slider';
45
45
  import { SSRProvider } from '@react-aria/ssr';
46
+ import { SyntheticEvent } from 'react';
46
47
  import { useVisuallyHidden } from '@react-aria/visually-hidden';
47
48
  import { Validation } from '@react-types/shared';
48
49
  import { VisuallyHidden } from '@react-aria/visually-hidden';
@@ -604,7 +605,7 @@ export declare interface LinkButtonProps extends Omit<ButtonProps, "elementType"
604
605
  download?: boolean | string;
605
606
  rel?: string;
606
607
  target?: HTMLAttributeAnchorTarget;
607
- onClick?: () => void;
608
+ onClick?: (event: SyntheticEvent) => void;
608
609
  to?: React.ComponentProps<typeof Link_2>["to"];
609
610
  elementType?: React.ElementType;
610
611
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simplybusiness/mobius",
3
3
  "license": "UNLICENSED",
4
- "version": "3.2.0",
4
+ "version": "3.2.2",
5
5
  "description": "Core library of Mobius react components",
6
6
  "repository": {
7
7
  "type": "git",
@@ -128,7 +128,7 @@ import { Chopin } from "@simplybusiness/mobius";
128
128
  backButton: {
129
129
  href: "https://www.google.com",
130
130
  elementType: "button",
131
- isDisabled: false,
131
+ isDisabled: true,
132
132
  },
133
133
  nextLabel: "Next Step",
134
134
  nextButton: {
@@ -2,7 +2,7 @@ import { forwardRef, Ref } from "react";
2
2
  import { DOMProps } from "@react-types/shared";
3
3
  import clsx from "clsx";
4
4
  import type { IconName } from "@simplybusiness/icons";
5
- import { Variant } from "../../Button";
5
+ import { Size, Variant } from "../../Button";
6
6
  import { Flex } from "../../Flex";
7
7
  import { ForwardedRefComponent } from "../../../types/components";
8
8
  import { LinkButton, type LinkButtonProps } from "../../LinkButton";
@@ -33,13 +33,15 @@ const Actions: ForwardedRefComponent<ActionsProps, ActionsElementType> =
33
33
  const backButtonProps = {
34
34
  ...backButton,
35
35
  className: "chopin/ActionsBack",
36
- variant: "basic" as Variant,
37
- icon: "buttonArrowLeft" as IconName,
36
+ variant: "ghost" as Variant,
37
+ icon: "leftArrow" as IconName,
38
+ size: "large" as Size,
38
39
  };
39
40
 
40
41
  const nextButtonProps = {
41
42
  ...nextButton,
42
43
  className: nextButtonClasses,
44
+ size: "large" as Size,
43
45
  };
44
46
 
45
47
  return (
@@ -1,4 +1,4 @@
1
- import { HTMLAttributeAnchorTarget } from "react";
1
+ import { HTMLAttributeAnchorTarget, SyntheticEvent } from "react";
2
2
  import clsx from "clsx";
3
3
  import type { Link } from "react-router-dom";
4
4
  import { Button, ButtonProps } from "../Button";
@@ -11,7 +11,7 @@ export interface LinkButtonProps extends Omit<ButtonProps, "elementType"> {
11
11
  download?: boolean | string;
12
12
  rel?: string;
13
13
  target?: HTMLAttributeAnchorTarget;
14
- onClick?: () => void;
14
+ onClick?: (event: SyntheticEvent) => void;
15
15
  to?: React.ComponentProps<typeof Link>["to"];
16
16
  elementType?: React.ElementType;
17
17
  }