@plurid/plurid-ui-components-react 0.0.0-16 → 0.0.0-19

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.
@@ -22,6 +22,7 @@ export interface HeadDefaults {
22
22
  appleTouchIcon?: string;
23
23
  }
24
24
  export interface HeadOwnProperties {
25
+ Helmet: any;
25
26
  defaults?: Partial<head.HeadState> & HeadDefaults;
26
27
  selectors: HeadSelectors;
27
28
  context: React.Context<any>;
@@ -1,11 +1,13 @@
1
1
  import React from 'react';
2
2
  import { Theme } from '@plurid/plurid-themes';
3
+ import { SwitchProperties } from '../Switch';
3
4
  export interface InputSwitchProperties {
4
5
  name: string;
5
6
  checked: boolean;
6
7
  atChange: () => void;
7
8
  theme?: Theme;
8
9
  compact?: boolean;
10
+ switch?: SwitchProperties;
9
11
  style?: React.CSSProperties;
10
12
  className?: string;
11
13
  }
@@ -1781,7 +1781,7 @@ const StyledInputSwitch = styled.div`
1781
1781
  `;
1782
1782
 
1783
1783
  const InputSwitch = properties => {
1784
- const {name: name, checked: checked, atChange: atChange, theme: themeProperty, compact: compact, style: style, className: className} = properties;
1784
+ const {name: name, checked: checked, atChange: atChange, theme: themeProperty, compact: compact, switch: switchProperties, style: style, className: className} = properties;
1785
1785
  const theme = themeProperty || plurid;
1786
1786
  return React.createElement(StyledInputSwitch, {
1787
1787
  compact: compact,
@@ -1791,13 +1791,13 @@ const InputSwitch = properties => {
1791
1791
  style: {
1792
1792
  marginLeft: "0.9rem"
1793
1793
  }
1794
- }, name), React.createElement(Switch, {
1794
+ }, name), React.createElement(Switch, Object.assign({
1795
1795
  checked: checked,
1796
1796
  level: 2,
1797
1797
  exclusive: true,
1798
1798
  theme: theme,
1799
1799
  atChange: () => atChange()
1800
- })));
1800
+ }, switchProperties))));
1801
1801
  };
1802
1802
 
1803
1803
  const StyledItemsline = styled.div`
@@ -2569,7 +2569,7 @@ const universal = {
2569
2569
 
2570
2570
  const Head = properties => {
2571
2571
  var _a, _b, _c, _d;
2572
- const {defaults: defaults, children: children, stateHead: stateHead} = properties;
2572
+ const {Helmet: Helmet, defaults: defaults, children: children, stateHead: stateHead} = properties;
2573
2573
  const robots = (defaults === null || defaults === void 0 ? void 0 : defaults.robots) || "index,follow";
2574
2574
  const viewport = (defaults === null || defaults === void 0 ? void 0 : defaults.viewport) || "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0, shrink-to-fit=no";
2575
2575
  const faviconIcon = (_a = defaults === null || defaults === void 0 ? void 0 : defaults.faviconIcon) !== null && _a !== void 0 ? _a : "/favicon.ico";
@@ -2590,7 +2590,7 @@ const Head = properties => {
2590
2590
  const ogSiteName = (defaults === null || defaults === void 0 ? void 0 : defaults.ogSiteName) || "";
2591
2591
  const appleTouchIcon = (defaults === null || defaults === void 0 ? void 0 : defaults.appleTouchIcon) || "";
2592
2592
  const {styles: styles, scripts: scripts} = stateHead;
2593
- return React.createElement(React.Fragment, null, React.createElement("meta", {
2593
+ return React.createElement(Helmet, null, React.createElement("meta", {
2594
2594
  charSet: "utf-8"
2595
2595
  }), React.createElement("meta", {
2596
2596
  name: "robots",
@@ -2598,9 +2598,6 @@ const Head = properties => {
2598
2598
  }), React.createElement("meta", {
2599
2599
  name: "viewport",
2600
2600
  content: viewport
2601
- }), React.createElement("meta", {
2602
- name: "description",
2603
- content: descriptionValue
2604
2601
  }), React.createElement("title", null, titleValue), React.createElement("meta", {
2605
2602
  name: "title",
2606
2603
  content: titleValue
@@ -2699,7 +2696,7 @@ const Head = properties => {
2699
2696
  };
2700
2697
 
2701
2698
  const mapStateToProperties$7 = (state, ownProperties) => ({
2702
- stateHead: ownProperties.selectors.notifications.getAll(state)
2699
+ stateHead: ownProperties.selectors.head.getHead(state)
2703
2700
  });
2704
2701
 
2705
2702
  const mapDispatchToProperties$7 = dispatch => ({});
@@ -2732,6 +2729,7 @@ const StyledNotification = styled.div`
2732
2729
  color: ${props => props.theme.colorPrimary};
2733
2730
  box-shadow: ${props => props.theme.boxShadowUmbra};
2734
2731
  animation: ${translateUp} 750ms ease-in-out forwards;
2732
+ transition: opacity 400ms;
2735
2733
 
2736
2734
  a {
2737
2735
  text-decoration: none;
@@ -2760,12 +2758,16 @@ const StyledNotificationClose = styled.div`
2760
2758
  const Notification = properties => {
2761
2759
  const {data: data, theme: theme, remove: remove, elements: elements, style: style, className: className} = properties;
2762
2760
  const {id: id, text: text, html: html, react: react, timeout: timeout, wordBreak: wordBreak} = data;
2763
- const resolvedWordBreak = wordBreak === false ? "normal" : "break-all";
2761
+ const resolvedWordBreak = wordBreak === true ? "break-all" : "normal";
2762
+ const [prepareForRemoval, setPrepareForRemoval] = useState(false);
2764
2763
  const notificationTimeout = useRef(null);
2765
2764
  useEffect((() => {
2766
2765
  if (timeout) {
2767
2766
  notificationTimeout.current = setTimeout((() => {
2768
- remove(id);
2767
+ setPrepareForRemoval(true);
2768
+ setTimeout((() => {
2769
+ remove(id);
2770
+ }), 400);
2769
2771
  }), timeout);
2770
2772
  }
2771
2773
  return () => {
@@ -2791,7 +2793,9 @@ const Notification = properties => {
2791
2793
  const content = resolveRender();
2792
2794
  return React.createElement(StyledNotification, {
2793
2795
  theme: theme,
2794
- style: Object.assign({}, style),
2796
+ style: Object.assign(Object.assign({}, style), {
2797
+ opacity: prepareForRemoval ? 0 : undefined
2798
+ }),
2795
2799
  className: className
2796
2800
  }, content, React.createElement(StyledNotificationClose, null, React.createElement(PluridIconDelete, {
2797
2801
  atClick: () => remove(id)