orcs-design-system 3.1.25 → 3.1.27

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # ORCS: Orchestrated Design System
1
+ # ORCS: TeamForm's Design System
2
2
 
3
3
  ## featuring Styled System + Styled Components
4
4
 
@@ -79,6 +79,7 @@ npm run test
79
79
 
80
80
  In order to publish a new version, you will have to patch and push your changes.
81
81
  After your changes have been merged to master, from your master branch:
82
+
82
83
  ```
83
84
  npm version patch
84
85
  git push
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  var _excluded = ["children", "direction", "width", "textAlign", "text", "inlineBlock", "theme", "variant", "enableSelectAll", "tabIndex"];
5
- import React, { useId, useState } from "react";
5
+ import React, { useId, useRef, useState } from "react";
6
6
  import PropTypes from "prop-types";
7
7
  import styled, { css, ThemeProvider } from "styled-components";
8
8
  import { space, layout } from "styled-system";
@@ -10,6 +10,7 @@ import { keys } from "lodash";
10
10
  import Icon from "../Icon";
11
11
  import { themeGet } from "@styled-system/theme-get";
12
12
  import { useKeepInView, directions } from "../../hooks/keepInView";
13
+ import { commonKeys } from "../../hooks/keypress";
13
14
  var Container = styled.div.withConfig({
14
15
  displayName: "Popover__Container",
15
16
  componentId: "sc-1bwoak-0"
@@ -86,10 +87,15 @@ export default function Popover(_ref2) {
86
87
  _ref2$tabIndex = _ref2.tabIndex,
87
88
  tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex,
88
89
  props = _objectWithoutProperties(_ref2, _excluded);
90
+ var containerRef = useRef();
89
91
  var _useState = useState(direction),
90
92
  _useState2 = _slicedToArray(_useState, 2),
91
93
  inViewDirection = _useState2[0],
92
94
  setInViewDirection = _useState2[1];
95
+ var _useState3 = useState(false),
96
+ _useState4 = _slicedToArray(_useState3, 2),
97
+ dismissed = _useState4[0],
98
+ setDismissed = _useState4[1];
93
99
  var toolTipId = useId();
94
100
  var _useKeepInView = useKeepInView({
95
101
  direction: direction,
@@ -99,13 +105,27 @@ export default function Popover(_ref2) {
99
105
  ref = _useKeepInView2[0],
100
106
  setIsShown = _useKeepInView2[1];
101
107
  var component = /*#__PURE__*/React.createElement(Container, _extends({
108
+ ref: containerRef,
102
109
  inlineBlock: inlineBlock
103
110
  }, props, {
104
111
  onMouseEnter: function onMouseEnter() {
105
- return setIsShown(true);
112
+ setIsShown(true);
113
+ setDismissed(false);
114
+ },
115
+ onKeyDownCapture: function onKeyDownCapture(e) {
116
+ if ([commonKeys.ESCAPE, commonKeys.ESC].includes(e.key)) {
117
+ setDismissed(true);
118
+ if (containerRef !== null && containerRef !== void 0 && containerRef.current.contains(document.activeElement)) {
119
+ document.activeElement.blur();
120
+ }
121
+ }
122
+ },
123
+ onBlur: function onBlur() {
124
+ setDismissed(false);
106
125
  },
107
126
  onMouseLeave: function onMouseLeave() {
108
- return setIsShown(false);
127
+ setIsShown(false);
128
+ setDismissed(false);
109
129
  },
110
130
  "aria-describedby": toolTipId
111
131
  }), variant === "tooltip" && /*#__PURE__*/React.createElement(TooltipControl, {
@@ -114,7 +134,7 @@ export default function Popover(_ref2) {
114
134
  transform: "grow-4",
115
135
  icon: ["fas", "question-circle"],
116
136
  fontSize: "2"
117
- })), !!text && /*#__PURE__*/React.createElement(Text, {
137
+ })), !!text && !dismissed && /*#__PURE__*/React.createElement(Text, {
118
138
  ref: ref,
119
139
  role: "tooltip",
120
140
  className: "popoverText",
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "orcs-design-system",
3
- "version": "3.1.25",
3
+ "version": "3.1.27",
4
4
  "engines": {
5
5
  "node": "18.17.1"
6
6
  },
7
- "description": "Orchestrated's Design System, aka: ORCS",
7
+ "description": "TeamForm's Design System, aka: ORCS",
8
8
  "keywords": [
9
9
  "design",
10
10
  "system",