@mrshmllw/smores-react 12.10.0-crumbs-feature-sticky-modal-title.1 → 12.10.0-crumbs-feature-using-campfire-config.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/dist/Modal/Modal.js +3 -10
- package/dist/Modal/Modal.js.map +1 -1
- package/package.json +11 -10
package/dist/Modal/Modal.js
CHANGED
@@ -21,8 +21,8 @@ export const Modal = ({ title = '', children, rightPanel, showModal = false, han
|
|
21
21
|
return null;
|
22
22
|
return createPortal(React.createElement(Wrapper, { ref: modalRef },
|
23
23
|
React.createElement(Overlay, { onClick: () => closeOnOverlayClick && handleClick(), "$closeOnOverlayClick": closeOnOverlayClick }),
|
24
|
-
React.createElement(Container, { "$drawer": drawer, "$width": width
|
25
|
-
React.createElement(
|
24
|
+
React.createElement(Container, { "$drawer": drawer, "$width": width || '460px', className: containerClass },
|
25
|
+
React.createElement(Box, { flex: true, alignItems: "flex-start", justifyContent: "space-between", mb: "8px" },
|
26
26
|
React.createElement(TitleElements, { flex: true, direction: "column" },
|
27
27
|
React.createElement(Text, { ...titleProps })),
|
28
28
|
React.createElement(Box, { flex: true, alignItems: "center", gap: '8px' },
|
@@ -51,18 +51,11 @@ const Overlay = styled.div `
|
|
51
51
|
left: 0;
|
52
52
|
right: 0;
|
53
53
|
`;
|
54
|
-
const HeaderContainer = styled(Box) `
|
55
|
-
position: sticky;
|
56
|
-
top: 0;
|
57
|
-
background: ${theme.colors.coconut};
|
58
|
-
padding: 36px 0 8px;
|
59
|
-
z-index: 1;
|
60
|
-
`;
|
61
54
|
const Container = styled.div(({ $drawer, $width }) => css `
|
62
55
|
background: ${theme.colors.coconut};
|
63
56
|
box-sizing: border-box;
|
64
57
|
border-radius: 16px;
|
65
|
-
padding:
|
58
|
+
padding: 24px;
|
66
59
|
width: 100%;
|
67
60
|
max-width: ${$width};
|
68
61
|
position: fixed;
|
package/dist/Modal/Modal.js.map
CHANGED
@@ -1 +1 @@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AAe,CAChB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;;;;;;;CAU1B,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAmC;;gBAE7C,KAAK,CAAC,MAAM,CAAC,SAAS;YAC1B,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,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","sourcesContent":["import React, { FC, ReactNode, useRef } from 'react'\nimport { createPortal } from 'react-dom'\nimport styled, { css } from 'styled-components'\nimport { theme } from '../theme'\n\nimport { Box } from '../Box'\nimport { IconStrict } from '../IconStrict'\nimport { Text, type TextProps } from '../Text'\nimport { useBodyScrollLock } from '../hooks/useBodyScrollLock'\n\ninterface IModalContainer {\n // drawer state\n $drawer: boolean\n // modal width\n $width: string\n}\n\nexport type ModalProps = {\n /**\n * Title of the modal\n * @default \"\" (empty string)\n *\n * @example\n * ```tsx\n * <Modal title=\"MultiCar Account\" />\n * ```\n *\n * @example\n * ```tsx\n * <Modal title={{ typo: 'hero', children: 'MultiCar Account' }} />\n * ```\n */\n title?: string | TitleProps\n icon?: string\n children?: ReactNode\n rightPanel?: ReactNode\n showModal?: boolean\n handleClick: () => void\n drawer?: boolean\n cross?: boolean\n width?: string\n containerClass?: string\n portalContainer?: Element | DocumentFragment\n closeOnOverlayClick?: boolean\n}\n\nexport type TitleProps = TextProps\n\nconst getDefaultTitleProps = (title: string): TitleProps => ({\n children: title,\n tag: 'h2',\n typo: 'heading-small',\n align: 'left',\n})\n\nexport const Modal: FC<ModalProps> = ({\n title = '',\n children,\n rightPanel,\n showModal = false,\n handleClick,\n drawer = true,\n cross = true,\n width,\n containerClass,\n portalContainer = document.body,\n closeOnOverlayClick = true,\n}) => {\n const modalRef = useRef<HTMLDivElement>(null)\n\n useBodyScrollLock({ node: modalRef.current, showModal })\n\n const isTitleString = typeof title === 'string'\n const titleProps = isTitleString ? getDefaultTitleProps(title) : title\n\n if (!showModal) return null\n\n return createPortal(\n <Wrapper ref={modalRef}>\n <Overlay\n onClick={() => closeOnOverlayClick && handleClick()}\n $closeOnOverlayClick={closeOnOverlayClick}\n />\n <Container\n $drawer={drawer}\n $width={width || '460px'}\n className={containerClass}\n >\n <Box\n flex\n alignItems=\"flex-start\"\n justifyContent=\"space-between\"\n mb=\"8px\"\n >\n <TitleElements flex direction=\"column\">\n <Text {...titleProps} />\n </TitleElements>\n <Box flex alignItems=\"center\" gap={'8px'}>\n {rightPanel}\n {cross && (\n <IconStrict\n render=\"cross\"\n title=\"Close modal\"\n backgroundColor=\"oatmeal\"\n handleClick={handleClick}\n size={36}\n />\n )}\n </Box>\n </Box>\n <Box flex direction=\"column\">\n {children}\n </Box>\n </Container>\n </Wrapper>,\n portalContainer,\n )\n}\n\nconst Wrapper = styled(Box)`\n display: flex;\n position: absolute;\n z-index: 999;\n top: 0;\n left: 0;\n height: 100vh;\n width: 100%;\n justify-content: center;\n align-items: center;\n`\n\nconst Overlay = styled.div<{ $closeOnOverlayClick: boolean }>`\n position: fixed;\n background: ${theme.colors.liquorice};\n cursor: ${(props) => (props.$closeOnOverlayClick ? 'pointer' : 'default')};\n opacity: 0.4;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n`\n\nconst Container = styled.div<IModalContainer>(\n ({ $drawer, $width }) => css`\n background: ${theme.colors.coconut};\n box-sizing: border-box;\n border-radius: 16px;\n padding: 24px;\n width: 100%;\n max-width: ${$width};\n position: fixed;\n max-height: calc(100vh - 64px);\n overflow: auto;\n transition: all 0.3s ease-in-out;\n\n ${$drawer === true &&\n css`\n @media (max-width: 768px) {\n max-width: none;\n border-radius: 16px 16px 0px 0px;\n padding: 10% 24px;\n max-height: 90vh;\n\n position: fixed;\n right: 0;\n left: 0;\n bottom: 0;\n }\n `}\n `,\n)\n\nconst TitleElements = styled(Box)`\n align-self: center;\n`\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mrshmllw/smores-react",
|
3
|
-
"version": "12.10.0-crumbs-feature-
|
3
|
+
"version": "12.10.0-crumbs-feature-using-campfire-config.1",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"description": "Collection of React components used by Marshmallow Technology",
|
6
6
|
"type": "module",
|
@@ -37,6 +37,7 @@
|
|
37
37
|
"devDependencies": {
|
38
38
|
"@commitlint/cli": "^19.8.1",
|
39
39
|
"@commitlint/types": "^19.8.0",
|
40
|
+
"@mrshmllw/campfire": "^1.1.0-crumbs-feature-testing-configs.1",
|
40
41
|
"@semantic-release/changelog": "^6.0.3",
|
41
42
|
"@semantic-release/git": "^10.0.1",
|
42
43
|
"@semantic-release/github": "^11.0.3",
|
@@ -51,15 +52,15 @@
|
|
51
52
|
"@storybook/react": "^8.6.14",
|
52
53
|
"@storybook/react-vite": "^8.6.14",
|
53
54
|
"@storybook/test": "^8.2.1",
|
54
|
-
"@storybook/test-runner": "^0.22.
|
55
|
+
"@storybook/test-runner": "^0.22.1",
|
55
56
|
"@testing-library/react": "^16.3.0",
|
56
57
|
"@types/body-scroll-lock": "^3.1.0",
|
57
58
|
"@types/dompurify": "^3.2.0",
|
58
|
-
"@types/node": "^22.15.
|
59
|
-
"@types/react": "^19.1.
|
60
|
-
"@types/react-dom": "^19.1.
|
61
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
62
|
-
"@typescript-eslint/parser": "^8.
|
59
|
+
"@types/node": "^22.15.30",
|
60
|
+
"@types/react": "^19.1.7",
|
61
|
+
"@types/react-dom": "^19.1.6",
|
62
|
+
"@typescript-eslint/eslint-plugin": "^8.34.0",
|
63
|
+
"@typescript-eslint/parser": "^8.34.0",
|
63
64
|
"axe-playwright": "^2.1.0",
|
64
65
|
"conventional-changelog-conventionalcommits": "^9.0.0",
|
65
66
|
"eslint": "^9.28.0",
|
@@ -70,7 +71,7 @@
|
|
70
71
|
"husky": "^9.1.7",
|
71
72
|
"jsdom": "^26.1.0",
|
72
73
|
"lint-staged": "^16.1.0",
|
73
|
-
"playwright": "^1.
|
74
|
+
"playwright": "^1.53.0",
|
74
75
|
"prettier": "^3.5.3",
|
75
76
|
"react": "^19.0.0",
|
76
77
|
"react-dom": "^19.1.0",
|
@@ -79,9 +80,9 @@
|
|
79
80
|
"storybook": "^8.0.4",
|
80
81
|
"styled-components": "^6.1.18",
|
81
82
|
"typescript": "^5.8.3",
|
82
|
-
"typescript-eslint": "^8.
|
83
|
+
"typescript-eslint": "^8.34.0",
|
83
84
|
"vite": "^6.3.5",
|
84
|
-
"vitest": "^3.2.
|
85
|
+
"vitest": "^3.2.3"
|
85
86
|
},
|
86
87
|
"dependencies": {
|
87
88
|
"@floating-ui/react": "0.27.12",
|