@plurid/plurid-ui-components-react 0.0.0-11 → 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.
@@ -2,7 +2,7 @@
2
2
  declare const pluridal: {
3
3
  notifications: {
4
4
  Notification: import("react").FC<import("./notifications/Notification").NotificationOwnProperties>;
5
- Notifications: import("react-redux").ConnectedComponent<import("react").FC<import("./notifications/Notifications").NotificationsProperties>, import("react-redux").Omit<import("./notifications/Notifications").NotificationsProperties, "stateGeneralTheme" | "stateNotifications" | "dispatchRemoveNotification"> & import("./notifications/Notifications").NotificationsOwnProperties>;
5
+ Notifications: import("react-redux").ConnectedComponent<import("react").FC<import("./notifications/Notifications").NotificationsProperties>, Omit<import("./notifications/Notifications").NotificationsProperties, "stateGeneralTheme" | "stateNotifications" | "dispatchRemoveNotification"> & import("./notifications/Notifications").NotificationsOwnProperties & import("react-redux").ConnectProps>;
6
6
  };
7
7
  sitting: {
8
8
  SittingTray: import("react-redux").ConnectedComponent<import("react").FC<import("./sitting/SittingTray").SittingTrayProperties>, any>;
@@ -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 declare const StyledNotificationContent: import("styled-components").StyledComponent<"div", any, {}, never>;
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>;
@@ -22,5 +22,5 @@ export interface NotificationsDispatchProperties {
22
22
  dispatchRemoveNotification: typeof notificationsStateService.actions.removeNotification;
23
23
  }
24
24
  export declare type NotificationsProperties = NotificationsOwnProperties & NotificationsStateProperties & NotificationsDispatchProperties;
25
- declare const ConnectedNotifications: import("react-redux").ConnectedComponent<React.FC<NotificationsProperties>, import("react-redux").Omit<NotificationsProperties, "stateGeneralTheme" | "stateNotifications" | "dispatchRemoveNotification"> & NotificationsOwnProperties>;
25
+ declare const ConnectedNotifications: import("react-redux").ConnectedComponent<React.FC<NotificationsProperties>, Omit<NotificationsProperties, "stateGeneralTheme" | "stateNotifications" | "dispatchRemoveNotification"> & NotificationsOwnProperties & import("react-redux").ConnectProps>;
26
26
  export default ConnectedNotifications;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  declare const notifications: {
3
3
  Notification: import("react").FC<import("./Notification").NotificationOwnProperties>;
4
- Notifications: import("react-redux").ConnectedComponent<import("react").FC<import("./Notifications").NotificationsProperties>, import("react-redux").Omit<import("./Notifications").NotificationsProperties, "stateGeneralTheme" | "stateNotifications" | "dispatchRemoveNotification"> & import("./Notifications").NotificationsOwnProperties>;
4
+ Notifications: import("react-redux").ConnectedComponent<import("react").FC<import("./Notifications").NotificationsProperties>, Omit<import("./Notifications").NotificationsProperties, "stateGeneralTheme" | "stateNotifications" | "dispatchRemoveNotification"> & import("./Notifications").NotificationsOwnProperties & import("react-redux").ConnectProps>;
5
5
  };
6
6
  export default notifications;
@@ -6,6 +6,7 @@ export interface ToolbarControlsOwnProperties {
6
6
  theme?: Theme;
7
7
  style?: React.CSSProperties;
8
8
  className?: string;
9
+ children?: React.ReactNode;
9
10
  }
10
11
  export declare type ToolbarControlsProperties = ToolbarControlsOwnProperties;
11
12
  declare const ToolbarControls: React.FC<ToolbarControlsProperties>;
@@ -8,6 +8,7 @@ export interface ToolbarSpecificOwnProperties {
8
8
  activeType: any;
9
9
  selectors: any;
10
10
  position?: keyof typeof HorizontalPositions;
11
+ children?: React.ReactNode;
11
12
  }
12
13
  export interface ToolbarSpecificStateProperties {
13
14
  stateToolbars: any;
@@ -4,6 +4,7 @@ export interface FormLeftRightProperties {
4
4
  theme?: Theme;
5
5
  style?: React.CSSProperties;
6
6
  className?: string;
7
+ children?: React.ReactNode;
7
8
  }
8
9
  /**
9
10
  * Form left and right items
@@ -5,6 +5,7 @@ export interface FormitemProperties {
5
5
  level?: number;
6
6
  style?: React.CSSProperties;
7
7
  className?: string;
8
+ children?: React.ReactNode;
8
9
  }
9
10
  /**
10
11
  * Renders a form item.
@@ -8,6 +8,7 @@ export interface FormlineProperties {
8
8
  responsive?: boolean;
9
9
  style?: React.CSSProperties;
10
10
  className?: string;
11
+ children?: React.ReactNode;
11
12
  }
12
13
  /**
13
14
  * Renders a descriptive text and a form element side by side.
@@ -7,6 +7,7 @@ export interface DropdownProperties {
7
7
  atSelect: (selection: PluridUIDropdownSelectable | string, kind?: string) => void;
8
8
  left?: boolean;
9
9
  kind?: string;
10
+ listTop?: string;
10
11
  dropdownToggled?: boolean;
11
12
  /**
12
13
  * Hide dropdown after click selection.
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Theme } from '@plurid/plurid-themes';
3
3
  export interface TextlineProperties {
4
4
  text: string;
5
- atChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
5
+ atChange: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;
6
6
  atKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
7
7
  atFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
8
8
  atBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
@@ -30,12 +30,12 @@ export interface TextlineProperties {
30
30
  export declare type TextlineType = TextlineProperties & React.RefAttributes<any>;
31
31
  /**
32
32
  * @param text `string`
33
- * @param atChange `(event: React.ChangeEvent<HTMLInputElement>) => void`
33
+ * @param atChange `(event: React.ChangeEvent<HTMLInputElement>, value: string) => void`
34
34
  * @param atKeyDown `(event: React.KeyboardEvent<HTMLInputElement>) => void`
35
35
  * @param atFocus `(event: React.FocusEvent<HTMLInputElement>) => void`
36
36
  * @param atBlur `(event: React.FocusEvent<HTMLInputElement>) => void`
37
37
  *
38
- * @param type optional - `'text' | 'password'`
38
+ * @param type optional - `'text' | 'password' | 'number'`
39
39
  * @param placeholder optional - `string`
40
40
  * @param autoCapitalize optional - `string`
41
41
  * @param autoComplete optional - `string`
@@ -286,8 +286,9 @@ const StyledPureButton = styled.button`
286
286
  min-height: 40px;
287
287
  min-width: 160px;
288
288
 
289
- :hover {
290
- background-color: ${({theme: theme, level: level, isDisabled: isDisabled}) => {
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 {
@@ -1020,7 +1022,9 @@ const Textline = forwardRef(((properties, reference) => {
1020
1022
  }, React.createElement("input", {
1021
1023
  type: _type,
1022
1024
  value: text,
1023
- onChange: atChange,
1025
+ onChange: event => {
1026
+ atChange(event, event.target.value);
1027
+ },
1024
1028
  onKeyDown: handleKeyDown,
1025
1029
  onFocus: atFocus,
1026
1030
  onBlur: atBlur,
@@ -1089,6 +1093,7 @@ const StyledDropdownList = styled.div`
1089
1093
  }
1090
1094
  }};
1091
1095
  color: ${props => props.theme.colorPrimary};
1096
+ position: absolute;
1092
1097
  left: ${props => {
1093
1098
  if (props.left) {
1094
1099
  return "0px";
@@ -1100,6 +1105,12 @@ const StyledDropdownList = styled.div`
1100
1105
  return "auto";
1101
1106
  }
1102
1107
  return "0px";
1108
+ }};
1109
+ top: ${props => {
1110
+ if (props.listTop) {
1111
+ return props.listTop;
1112
+ }
1113
+ return "25px";
1103
1114
  }};
1104
1115
  height: ${props => {
1105
1116
  if (props.heightItems) {
@@ -1136,8 +1147,6 @@ const StyledDropdownList = styled.div`
1136
1147
  return "initial";
1137
1148
  }};
1138
1149
 
1139
- position: absolute;
1140
- top: 25px;
1141
1150
  border-radius: 10px;
1142
1151
  min-width: 60px;
1143
1152
 
@@ -1219,7 +1228,7 @@ const StyledFilterUpdate = styled.div`
1219
1228
  `;
1220
1229
 
1221
1230
  const Dropdown = properties => {
1222
- const {selected: selected, selectables: selectables, atSelect: atSelect, left: left, kind: kind, dropdownToggled: dropdownToggled, hideAtSelect: hideAtSelect, selectAtHover: selectAtHover, selectedColor: selectedColor, filterable: filterable, style: style, className: className, theme: themeProperty, generalTheme: generalThemeProperty, interactionTheme: interactionThemeProperty, level: level, heightItems: heightItems, width: width, setDropdownToggled: setDropdownToggled, filterUpdate: filterUpdate} = properties;
1231
+ const {selected: selected, selectables: selectables, atSelect: atSelect, left: left, kind: kind, listTop: listTop, dropdownToggled: dropdownToggled, hideAtSelect: hideAtSelect, selectAtHover: selectAtHover, selectedColor: selectedColor, filterable: filterable, style: style, className: className, theme: themeProperty, generalTheme: generalThemeProperty, interactionTheme: interactionThemeProperty, level: level, heightItems: heightItems, width: width, setDropdownToggled: setDropdownToggled, filterUpdate: filterUpdate} = properties;
1223
1232
  const _generalTheme = generalThemeProperty === undefined ? themeProperty === undefined ? plurid : themeProperty : generalThemeProperty;
1224
1233
  const _interactionTheme = interactionThemeProperty === undefined ? themeProperty === undefined ? plurid : themeProperty : interactionThemeProperty;
1225
1234
  const _level = level !== null && level !== void 0 ? level : 0;
@@ -1391,6 +1400,7 @@ const Dropdown = properties => {
1391
1400
  }, typeof selected === "string" ? selected : selected.value), showList && React.createElement(StyledDropdownList, {
1392
1401
  theme: interactionTheme,
1393
1402
  left: left,
1403
+ listTop: listTop,
1394
1404
  level: _level,
1395
1405
  heightItems: heightItems && filterable && filteredSelectables.length < heightItems ? filteredSelectables.length + 1 : heightItems,
1396
1406
  heightBeyond: filteredSelectables.length > (heightItems || 0),
@@ -1552,6 +1562,11 @@ const StyledInputBox = styled.div`
1552
1562
  color: ${({theme: theme}) => theme.colorPrimary};
1553
1563
  background-color: ${({theme: theme}) => theme.backgroundColorTertiary};
1554
1564
  box-shadow: inset 0px 4px 4px ${({theme: theme}) => theme.boxShadowUmbraColor};
1565
+
1566
+
1567
+ ::placeholder {
1568
+ color: ${({theme: theme}) => theme.colorSecondary};
1569
+ }
1555
1570
  }
1556
1571
  `;
1557
1572
 
@@ -2584,7 +2599,7 @@ const StyledNotification = styled.div`
2584
2599
  const StyledNotificationContent = styled.div`
2585
2600
  font-size: 0.9rem;
2586
2601
  padding: 32px 16px;
2587
- word-break: break-all;
2602
+ word-break: ${({wordBreak: wordBreak}) => wordBreak};
2588
2603
  `;
2589
2604
 
2590
2605
  const StyledNotificationClose = styled.div`
@@ -2601,7 +2616,8 @@ const StyledNotificationClose = styled.div`
2601
2616
 
2602
2617
  const Notification = properties => {
2603
2618
  const {data: data, theme: theme, remove: remove, elements: elements, style: style, className: className} = properties;
2604
- 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";
2605
2621
  const notificationTimeout = useRef(null);
2606
2622
  useEffect((() => {
2607
2623
  if (timeout) {
@@ -2617,9 +2633,21 @@ const Notification = properties => {
2617
2633
  }
2618
2634
  };
2619
2635
  }), [ id, timeout, remove ]);
2620
- const content = html ? React.createElement(StyledNotificationContent, {
2621
- dangerouslySetInnerHTML: createMarkup(text)
2622
- }) : react && elements && elements[text] ? React.createElement(StyledNotificationContent, null, elements[text]) : React.createElement(StyledNotificationContent, null, text);
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();
2623
2651
  return React.createElement(StyledNotification, {
2624
2652
  theme: theme,
2625
2653
  style: Object.assign({}, style),
@@ -3108,17 +3136,19 @@ const StyledHorizontalToolbarButton = styled.div`
3108
3136
  color: ${props => props.theme.colorPrimary};
3109
3137
  font-family: ${props => props.theme.fontFamilySansSerif};
3110
3138
 
3111
- :hover {
3112
- background: ${props => props.theme.backgroundColorTertiary};
3113
- }
3139
+ @media (hover: hover) {
3140
+ :hover {
3141
+ background: ${props => props.theme.backgroundColorTertiary};
3142
+ }
3114
3143
 
3115
- :hover svg {
3116
- transform: ${props => {
3144
+ :hover svg {
3145
+ transform: ${props => {
3117
3146
  if (props.scaleIcon) {
3118
3147
  return "scale(1.2)";
3119
3148
  }
3120
3149
  return "";
3121
3150
  }};
3151
+ }
3122
3152
  }
3123
3153
 
3124
3154
  svg {
@@ -3271,17 +3301,19 @@ const StyledVerticalToolbarButton = styled.div`
3271
3301
  return "transparent";
3272
3302
  }};
3273
3303
 
3274
- :hover {
3275
- background: ${props => props.theme.backgroundColorTertiary};
3276
- }
3304
+ @media (hover: hover) {
3305
+ :hover {
3306
+ background: ${props => props.theme.backgroundColorTertiary};
3307
+ }
3277
3308
 
3278
- :hover svg {
3279
- transform: ${props => {
3309
+ :hover svg {
3310
+ transform: ${props => {
3280
3311
  if (props.scaleIcon) {
3281
3312
  return "scale(1.2)";
3282
3313
  }
3283
3314
  return "";
3284
3315
  }};
3316
+ }
3285
3317
  }
3286
3318
 
3287
3319
  svg {