@mrshmllw/smores-react 9.23.0 → 9.24.0-crumbs-feature-modal-title-configurable.1

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/README.md CHANGED
@@ -38,6 +38,12 @@ So to ensure our CHANGELOG.md is updated automatically and gets the changes we h
38
38
 
39
39
  ## Release
40
40
 
41
+ Only the following branches are supported for release:
42
+ - `main`
43
+ - `feature/*`
44
+ - `chore/*`
45
+ - `fix/*`
46
+
41
47
  #### Preview
42
48
  Before releasing, you may want to see the changes that will be included in the next version deployed on NPM, you can do so by:
43
49
 
@@ -59,11 +65,11 @@ Note: this workflow will fail if the package version is already on the latest, s
59
65
  #### Pre-Releases
60
66
  Not too different to your usual workflow!
61
67
 
62
- 1. Checkout a new branch with the prefix `crumbs-<your-branch-name>`
68
+ 1. Checkout a new branch with the prefix `(feature|chore|fix)/<your-branch-name>` e.g. `feature/awesome-new-feature`
63
69
  2. Open a PR and create your changes as normal using semantic-commits!
64
70
  3. Goto our [github workflows](https://github.com/marshmallow-insurance/smores-react/actions)
65
71
  4. Click `Bump and Publish` or `Preview Bump and Publish`
66
- 5. Press `Run workflow` and select `crumbs-<your-branch-name>` branch.
72
+ 5. Press `Run workflow` and select `<your-full-branch-name>` branch.
67
73
  6. Wait for release!
68
74
  7. This can be done multiple times and it will increment your pre-release package version!
69
75
  8. When you're happy with the changes, simply squash and merge the PR and release `main`!
@@ -1,6 +1,21 @@
1
1
  import { FC, ReactNode } from 'react';
2
+ import { type TextProps } from '../Text';
2
3
  export type ModalProps = {
3
- title?: string;
4
+ /**
5
+ * Title of the modal
6
+ * @default "" (empty string)
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <Modal title="MultiCar Account" />
11
+ * ```
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * <Modal title={{ typo: 'hero', children: 'MultiCar Account' }} />
16
+ * ```
17
+ */
18
+ title?: string | TitleProps;
4
19
  icon?: string;
5
20
  children?: ReactNode;
6
21
  rightPanel?: ReactNode;
@@ -13,4 +28,5 @@ export type ModalProps = {
13
28
  portalContainer?: Element | DocumentFragment;
14
29
  closeOnOverlayClick?: boolean;
15
30
  };
31
+ export type TitleProps = TextProps;
16
32
  export declare const Modal: FC<ModalProps>;
@@ -6,15 +6,23 @@ import { Box } from '../Box';
6
6
  import { IconStrict } from '../IconStrict';
7
7
  import { Text } from '../Text';
8
8
  import { useBodyScrollLock } from '../hooks/useBodyScrollLock';
9
+ const getDefaultTitleProps = (title) => ({
10
+ children: title,
11
+ tag: 'h2',
12
+ typo: 'heading-small',
13
+ align: 'left',
14
+ });
9
15
  export const Modal = ({ title = '', children, rightPanel, showModal = false, handleClick, drawer = true, cross = true, width, containerClass, portalContainer = document.body, closeOnOverlayClick = true, }) => {
10
16
  const modalRef = useRef(null);
11
17
  useBodyScrollLock({ node: modalRef.current, showModal });
18
+ const isTitleString = typeof title === 'string';
19
+ const titleProps = isTitleString ? getDefaultTitleProps(title) : title;
12
20
  return createPortal(React.createElement(Wrapper, { "$showModal": showModal, ref: modalRef },
13
21
  React.createElement(Overlay, { onClick: () => closeOnOverlayClick && handleClick(), "$closeOnOverlayClick": closeOnOverlayClick }),
14
22
  React.createElement(Container, { "$drawer": drawer, "$width": width || '460px', className: containerClass },
15
23
  React.createElement(Box, { flex: true, alignItems: "flex-start", justifyContent: "space-between", mb: "8px" },
16
24
  React.createElement(TitleElements, { flex: true, direction: "column" },
17
- React.createElement(Text, { tag: "h2", typo: "heading-small", align: "left" }, title)),
25
+ React.createElement(Text, { ...titleProps })),
18
26
  React.createElement(Box, { flex: true, alignItems: "center", gap: '8px' },
19
27
  rightPanel,
20
28
  cross && (React.createElement(IconStrict, { render: "cross", backgroundColor: "oatmeal", handleClick: handleClick, size: 36 })))),
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,MAAM,EAA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AAS,CAAC;;;;;;CAM1E,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAC1B,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;kBACZ,KAAK,CAAC,MAAM,CAAC,OAAO;;;;;iBAKrB,MAAM;;;;;;MAMjB,OAAO,KAAK,IAAI;IAClB,GAAG,CAAA;;;;;;;;;;;;KAYF;GACF,CACF,CAAA;AAED,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAEhC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrshmllw/smores-react",
3
- "version": "9.23.0",
3
+ "version": "9.24.0-crumbs-feature-modal-title-configurable.1",
4
4
  "main": "./dist/index.js",
5
5
  "description": "Collection of React components used by Marshmallow Technology",
6
6
  "keywords": [
@@ -46,19 +46,19 @@
46
46
  "@semantic-release/github": "^11.0.0",
47
47
  "@semantic-release/npm": "^12.0.0",
48
48
  "@snyk/protect": "^1.1293.1",
49
- "@storybook/addon-a11y": "^8.3.5",
49
+ "@storybook/addon-a11y": "^8.3.6",
50
50
  "@storybook/addon-coverage": "^1.0.3",
51
- "@storybook/addon-essentials": "^8.3.5",
52
- "@storybook/addon-interactions": "^8.3.5",
53
- "@storybook/addon-links": "^8.3.5",
54
- "@storybook/react": "^8.3.5",
55
- "@storybook/react-vite": "^8.3.5",
51
+ "@storybook/addon-essentials": "^8.3.6",
52
+ "@storybook/addon-interactions": "^8.3.6",
53
+ "@storybook/addon-links": "^8.3.6",
54
+ "@storybook/react": "^8.3.6",
55
+ "@storybook/react-vite": "^8.3.6",
56
56
  "@storybook/test": "^8.2.1",
57
57
  "@storybook/test-runner": "^0.19.1",
58
58
  "@testing-library/react": "^16.0.1",
59
59
  "@types/body-scroll-lock": "^3.1.0",
60
60
  "@types/dompurify": "^3.0.5",
61
- "@types/node": "^22.7.5",
61
+ "@types/node": "^22.7.8",
62
62
  "@types/react": "^18.0.24",
63
63
  "@types/react-dom": "^18.0.8",
64
64
  "@typescript-eslint/eslint-plugin": "^7.18.0",
@@ -68,7 +68,7 @@
68
68
  "eslint": "^8.57.1",
69
69
  "eslint-config-prettier": "^9.0.0",
70
70
  "eslint-plugin-react": "^7.37.1",
71
- "eslint-plugin-react-hooks": "^4.1.2",
71
+ "eslint-plugin-react-hooks": "^5.0.0",
72
72
  "husky": "^9.1.6",
73
73
  "jsdom": "^25.0.1",
74
74
  "lint-staged": "^15.2.10",
@@ -76,7 +76,7 @@
76
76
  "react": "^18.2.0",
77
77
  "react-dom": "^18.2.0",
78
78
  "rimraf": "^6.0.1",
79
- "semantic-release": "^24.1.2",
79
+ "semantic-release": "^24.1.3",
80
80
  "storybook": "^8.0.4",
81
81
  "styled-components": "^6.1.13",
82
82
  "typescript": "^5.6.3",
@@ -90,6 +90,7 @@
90
90
  "dompurify": "^3.1.7",
91
91
  "fuse.js": "^7.0.0",
92
92
  "lexical": "^0.18.0",
93
+ "micromatch": "^4.0.8",
93
94
  "polished": "^4.1.3"
94
95
  },
95
96
  "peerDependencies": {