@plurid/plurid-ui-components-react 0.0.0-13 → 0.0.0-14
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.
|
@@ -3,5 +3,8 @@ export interface IStyledNotification {
|
|
|
3
3
|
theme: Theme;
|
|
4
4
|
}
|
|
5
5
|
export declare const StyledNotification: import("styled-components").StyledComponent<"div", any, IStyledNotification, never>;
|
|
6
|
-
export
|
|
6
|
+
export interface IStyledNotificationContent {
|
|
7
|
+
wordBreak: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const StyledNotificationContent: import("styled-components").StyledComponent<"div", any, IStyledNotificationContent, never>;
|
|
7
10
|
export declare const StyledNotificationClose: import("styled-components").StyledComponent<"div", any, {}, never>;
|
package/distribution/index.es.js
CHANGED
|
@@ -286,8 +286,9 @@ const StyledPureButton = styled.button`
|
|
|
286
286
|
min-height: 40px;
|
|
287
287
|
min-width: 160px;
|
|
288
288
|
|
|
289
|
-
:hover {
|
|
290
|
-
|
|
289
|
+
@media (hover: hover) {
|
|
290
|
+
:hover {
|
|
291
|
+
background-color: ${({theme: theme, level: level, isDisabled: isDisabled}) => {
|
|
291
292
|
if (isDisabled) {
|
|
292
293
|
return theme.backgroundColorPrimaryAlpha;
|
|
293
294
|
}
|
|
@@ -308,6 +309,7 @@ const StyledPureButton = styled.button`
|
|
|
308
309
|
return theme.backgroundColorSecondary;
|
|
309
310
|
}
|
|
310
311
|
}};
|
|
312
|
+
}
|
|
311
313
|
}
|
|
312
314
|
|
|
313
315
|
:active {
|
|
@@ -1560,6 +1562,11 @@ const StyledInputBox = styled.div`
|
|
|
1560
1562
|
color: ${({theme: theme}) => theme.colorPrimary};
|
|
1561
1563
|
background-color: ${({theme: theme}) => theme.backgroundColorTertiary};
|
|
1562
1564
|
box-shadow: inset 0px 4px 4px ${({theme: theme}) => theme.boxShadowUmbraColor};
|
|
1565
|
+
|
|
1566
|
+
|
|
1567
|
+
::placeholder {
|
|
1568
|
+
color: ${({theme: theme}) => theme.colorSecondary};
|
|
1569
|
+
}
|
|
1563
1570
|
}
|
|
1564
1571
|
`;
|
|
1565
1572
|
|
|
@@ -2592,7 +2599,7 @@ const StyledNotification = styled.div`
|
|
|
2592
2599
|
const StyledNotificationContent = styled.div`
|
|
2593
2600
|
font-size: 0.9rem;
|
|
2594
2601
|
padding: 32px 16px;
|
|
2595
|
-
word-break:
|
|
2602
|
+
word-break: ${({wordBreak: wordBreak}) => wordBreak};
|
|
2596
2603
|
`;
|
|
2597
2604
|
|
|
2598
2605
|
const StyledNotificationClose = styled.div`
|
|
@@ -2609,7 +2616,8 @@ const StyledNotificationClose = styled.div`
|
|
|
2609
2616
|
|
|
2610
2617
|
const Notification = properties => {
|
|
2611
2618
|
const {data: data, theme: theme, remove: remove, elements: elements, style: style, className: className} = properties;
|
|
2612
|
-
const {id: id, text: text, html: html, react: react, timeout: timeout} = data;
|
|
2619
|
+
const {id: id, text: text, html: html, react: react, timeout: timeout, wordBreak: wordBreak} = data;
|
|
2620
|
+
const resolvedWordBreak = wordBreak === false ? "normal" : "break-all";
|
|
2613
2621
|
const notificationTimeout = useRef(null);
|
|
2614
2622
|
useEffect((() => {
|
|
2615
2623
|
if (timeout) {
|
|
@@ -2625,9 +2633,21 @@ const Notification = properties => {
|
|
|
2625
2633
|
}
|
|
2626
2634
|
};
|
|
2627
2635
|
}), [ id, timeout, remove ]);
|
|
2628
|
-
const
|
|
2629
|
-
|
|
2630
|
-
|
|
2636
|
+
const resolveRender = () => {
|
|
2637
|
+
const contentProperties = {
|
|
2638
|
+
wordBreak: resolvedWordBreak
|
|
2639
|
+
};
|
|
2640
|
+
if (html) {
|
|
2641
|
+
return React.createElement(StyledNotificationContent, Object.assign({
|
|
2642
|
+
dangerouslySetInnerHTML: createMarkup(text)
|
|
2643
|
+
}, contentProperties));
|
|
2644
|
+
}
|
|
2645
|
+
if (react && elements && elements[text]) {
|
|
2646
|
+
return React.createElement(StyledNotificationContent, Object.assign({}, contentProperties), elements[text]);
|
|
2647
|
+
}
|
|
2648
|
+
return React.createElement(StyledNotificationContent, Object.assign({}, contentProperties), text);
|
|
2649
|
+
};
|
|
2650
|
+
const content = resolveRender();
|
|
2631
2651
|
return React.createElement(StyledNotification, {
|
|
2632
2652
|
theme: theme,
|
|
2633
2653
|
style: Object.assign({}, style),
|
|
@@ -3116,17 +3136,19 @@ const StyledHorizontalToolbarButton = styled.div`
|
|
|
3116
3136
|
color: ${props => props.theme.colorPrimary};
|
|
3117
3137
|
font-family: ${props => props.theme.fontFamilySansSerif};
|
|
3118
3138
|
|
|
3119
|
-
:hover {
|
|
3120
|
-
|
|
3121
|
-
|
|
3139
|
+
@media (hover: hover) {
|
|
3140
|
+
:hover {
|
|
3141
|
+
background: ${props => props.theme.backgroundColorTertiary};
|
|
3142
|
+
}
|
|
3122
3143
|
|
|
3123
|
-
|
|
3124
|
-
|
|
3144
|
+
:hover svg {
|
|
3145
|
+
transform: ${props => {
|
|
3125
3146
|
if (props.scaleIcon) {
|
|
3126
3147
|
return "scale(1.2)";
|
|
3127
3148
|
}
|
|
3128
3149
|
return "";
|
|
3129
3150
|
}};
|
|
3151
|
+
}
|
|
3130
3152
|
}
|
|
3131
3153
|
|
|
3132
3154
|
svg {
|
|
@@ -3279,17 +3301,19 @@ const StyledVerticalToolbarButton = styled.div`
|
|
|
3279
3301
|
return "transparent";
|
|
3280
3302
|
}};
|
|
3281
3303
|
|
|
3282
|
-
:hover {
|
|
3283
|
-
|
|
3284
|
-
|
|
3304
|
+
@media (hover: hover) {
|
|
3305
|
+
:hover {
|
|
3306
|
+
background: ${props => props.theme.backgroundColorTertiary};
|
|
3307
|
+
}
|
|
3285
3308
|
|
|
3286
|
-
|
|
3287
|
-
|
|
3309
|
+
:hover svg {
|
|
3310
|
+
transform: ${props => {
|
|
3288
3311
|
if (props.scaleIcon) {
|
|
3289
3312
|
return "scale(1.2)";
|
|
3290
3313
|
}
|
|
3291
3314
|
return "";
|
|
3292
3315
|
}};
|
|
3316
|
+
}
|
|
3293
3317
|
}
|
|
3294
3318
|
|
|
3295
3319
|
svg {
|