@mrshmllw/smores-react 9.22.0 → 9.23.0-crumbs-add-ref-to-support-props.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.
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import React, { MouseEventHandler, ReactElement } from 'react';
|
2
2
|
import { MarginProps } from '../utils/space';
|
3
3
|
type SupportMessageType = 'info' | 'fallbackStyle' | 'alert' | 'warning' | 'success';
|
4
4
|
export type SupportMessageProps = {
|
@@ -8,5 +8,11 @@ export type SupportMessageProps = {
|
|
8
8
|
type: SupportMessageType;
|
9
9
|
title?: string;
|
10
10
|
} & MarginProps;
|
11
|
-
export declare const SupportMessage:
|
11
|
+
export declare const SupportMessage: React.ForwardRefExoticComponent<{
|
12
|
+
className?: string;
|
13
|
+
description: string | ReactElement;
|
14
|
+
onClick?: MouseEventHandler;
|
15
|
+
type: SupportMessageType;
|
16
|
+
title?: string;
|
17
|
+
} & MarginProps & React.RefAttributes<HTMLDivElement>>;
|
12
18
|
export {};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { darken } from 'polished';
|
2
|
-
import React from 'react';
|
2
|
+
import React, { forwardRef } from 'react';
|
3
3
|
import styled, { css } from 'styled-components';
|
4
4
|
import { Box } from '../Box';
|
5
5
|
import { Icon } from '../Icon';
|
@@ -38,8 +38,8 @@ const styles = {
|
|
38
38
|
icon: 'circle-tick',
|
39
39
|
},
|
40
40
|
};
|
41
|
-
export const SupportMessage = ({ className, description, onClick, type = 'info', title, ...marginProps })
|
42
|
-
return (React.createElement(Wrapper, { className: className, "$type": type, onClick: onClick, ...marginProps },
|
41
|
+
export const SupportMessage = forwardRef(function SupportMessage({ className, description, onClick, type = 'info', title, ...marginProps }, ref) {
|
42
|
+
return (React.createElement(Wrapper, { ref: ref, className: className, "$type": type, onClick: onClick, ...marginProps },
|
43
43
|
React.createElement(IconWrapper, null,
|
44
44
|
React.createElement(Icon, { size: 20, render: styles[type].icon, color: styles[type].iconColor })),
|
45
45
|
React.createElement(Box, { flex: true, direction: "column", mx: "8px" },
|
@@ -47,7 +47,7 @@ export const SupportMessage = ({ className, description, onClick, type = 'info',
|
|
47
47
|
isReactElement(description) ? (React.createElement(DescriptionBox, null, description)) : (React.createElement(Description, { tag: "p" }, description))),
|
48
48
|
onClick && (React.createElement(Box, { ml: { custom: 'auto' } },
|
49
49
|
React.createElement(Icon, { size: 16, render: "caret", color: "marzipan", rotate: 270 })))));
|
50
|
-
};
|
50
|
+
});
|
51
51
|
const IconWrapper = styled(Box) `
|
52
52
|
align-self: flex-start;
|
53
53
|
`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SupportMessage.js","sourceRoot":"","sources":["../../src/SupportMessage/SupportMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,
|
1
|
+
{"version":3,"file":"SupportMessage.js","sourceRoot":"","sources":["../../src/SupportMessage/SupportMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAmC,MAAM,OAAO,CAAA;AAC1E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAG9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAS,KAAK,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAUxD,MAAM,MAAM,GAA2C;IACrD,IAAI,EAAE;QACJ,SAAS,EAAE,WAAW;QACtB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;QACrC,oBAAoB,EAAE,MAAM,CAAC,GAAG,EAAE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AG,CAAC,CAAA;WACvB,KAAK,CAAC,MAAM,CAAC,SAAS;;;CAGhC,CAAA;AAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;WACrB,KAAK,CAAC,MAAM,CAAC,SAAS;;;CAGhC,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mrshmllw/smores-react",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.23.0-crumbs-add-ref-to-support-props.1",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"description": "Collection of React components used by Marshmallow Technology",
|
6
6
|
"keywords": [
|
@@ -79,7 +79,7 @@
|
|
79
79
|
"semantic-release": "^24.1.2",
|
80
80
|
"storybook": "^8.0.4",
|
81
81
|
"styled-components": "^6.1.13",
|
82
|
-
"typescript": "^5.6.
|
82
|
+
"typescript": "^5.6.3",
|
83
83
|
"vite": "^5.4.8",
|
84
84
|
"vitest": "^2.1.2"
|
85
85
|
},
|