@pushwoosh/dumb-components 1.1.7 → 1.1.9
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/Radio/Radio.js
CHANGED
|
@@ -23,7 +23,8 @@ export function Radio(props) {
|
|
|
23
23
|
});
|
|
24
24
|
return React.createElement(NativeLabel, {
|
|
25
25
|
htmlFor: localId,
|
|
26
|
-
"$color": isDisabled ? 'locked' : color
|
|
26
|
+
"$color": isDisabled ? 'locked' : color,
|
|
27
|
+
"$size": size
|
|
27
28
|
}, React.createElement(NativeRadio, {
|
|
28
29
|
type: "radio",
|
|
29
30
|
id: localId,
|
package/Radio/styles.d.ts
CHANGED
package/Radio/styles.js
CHANGED
|
@@ -16,6 +16,8 @@ export const NativeRadio = styled.input.withConfig({
|
|
|
16
16
|
export const NativeLabel = styled.label.withConfig({
|
|
17
17
|
displayName: "NativeLabel",
|
|
18
18
|
componentId: "sc-34lgtl-1"
|
|
19
|
-
})(["display:inline-flex;align-items:center;font-size:", ";line-height:", ";user-select:none;", " & > ", "{&:not(:last-child){margin-right:", ";}}"],
|
|
19
|
+
})(["display:inline-flex;align-items:center;font-size:", ";line-height:", ";user-select:none;", " & > ", "{&:not(:last-child){margin-right:", ";}}"], ({
|
|
20
|
+
$size
|
|
21
|
+
}) => $size === 'compact' ? FontSize.SMALL : FontSize.REGULAR, LineHeight.REGULAR, ({
|
|
20
22
|
$color
|
|
21
23
|
}) => $color && `color: ${ColorMap[$color]};`, NativeRadio, Spacing.S3);
|
|
@@ -67,9 +67,12 @@ export const RichMessageEditor = ({
|
|
|
67
67
|
Transforms.move(editor);
|
|
68
68
|
setShowDrop(undefined);
|
|
69
69
|
};
|
|
70
|
-
const
|
|
70
|
+
const onClose = () => {
|
|
71
71
|
setShowDrop(undefined);
|
|
72
72
|
setIsFocused(false);
|
|
73
|
+
};
|
|
74
|
+
const clickAwayHandler = usePersistentFunction(() => {
|
|
75
|
+
onClose();
|
|
73
76
|
onBlur === null || onBlur === void 0 || onBlur();
|
|
74
77
|
});
|
|
75
78
|
useEffect(() => {
|
|
@@ -138,6 +141,7 @@ export const RichMessageEditor = ({
|
|
|
138
141
|
insertDynamicContent(editor, newDC);
|
|
139
142
|
}
|
|
140
143
|
},
|
|
144
|
+
onClose,
|
|
141
145
|
update
|
|
142
146
|
})), showDrop.type === 'emoji' && React.createElement(EmojiPicker, {
|
|
143
147
|
onEmojiSelect: s => editor.insertText(s)
|
|
@@ -11,6 +11,7 @@ export type DropValue = DropValueEmoji | DropValuePersonalization;
|
|
|
11
11
|
export type RenderDynamicContentProps = {
|
|
12
12
|
dc?: DynamicContent;
|
|
13
13
|
onChange: (newDC: DynamicContent) => void;
|
|
14
|
+
onClose: () => void;
|
|
14
15
|
update: () => void;
|
|
15
16
|
};
|
|
16
17
|
export type RichMessageEditorProps = {
|
package/index.d.ts
CHANGED
|
@@ -36,4 +36,4 @@ export { NumberPicker } from './NumberPicker';
|
|
|
36
36
|
export { CodeEditor } from './CodeEditor';
|
|
37
37
|
export { EnhancedInput, SearchInput } from './EnhancedInput';
|
|
38
38
|
export { Chip } from './Chip';
|
|
39
|
-
export { RichMessageEditor, RichMessageViewer } from './RichMessageEditor';
|
|
39
|
+
export { RichMessageEditor, RichMessageViewer, type DynamicContent } from './RichMessageEditor';
|