orcs-design-system 3.2.19 → 3.2.20

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.
@@ -14,7 +14,7 @@ const crossTransform2 = keyframes(["0%{transform:translate(0,6px);border-radius:
14
14
  const StyledActionsMenuContainer = styled.div.withConfig({
15
15
  displayName: "ActionsMenu__StyledActionsMenuContainer",
16
16
  componentId: "sc-yvbni2-0"
17
- })(["pointer-events:none;opacity:0;transition:all 300ms;transition-timing-function:cubic-bezier(0,1.4,1,1);&.visible{opacity:1;pointer-events:auto;}"]);
17
+ })(["pointer-events:none;opacity:0;&.visible{opacity:1;pointer-events:auto;}"]);
18
18
  const Wrapper = styled.div.withConfig({
19
19
  displayName: "ActionsMenu__Wrapper",
20
20
  componentId: "sc-yvbni2-1"
@@ -65,14 +65,18 @@ export const ActionsMenuHeading = styled(props => {
65
65
  export const ActionsMenuItem = styled(props => {
66
66
  const {
67
67
  id,
68
- onItemClick
68
+ onItemClick,
69
+ actionMenu
69
70
  } = useContext(ActionMenuContext);
70
71
  const {
71
72
  as,
72
73
  ...others
73
74
  } = props;
74
75
  const Component = as ? as : others.href ? "a" : "button";
75
- let newProps = others;
76
+ let newProps = {
77
+ ...others,
78
+ ...actionMenu.getItemProps()
79
+ };
76
80
  const {
77
81
  onClick: originalOnClick
78
82
  } = newProps;
@@ -92,7 +96,7 @@ export const ActionsMenuItem = styled(props => {
92
96
  onClick: onClick
93
97
  });
94
98
  }).attrs({
95
- role: "listitem"
99
+ role: "menuitem"
96
100
  }).withConfig({
97
101
  displayName: "ActionsMenu__ActionsMenuItem",
98
102
  componentId: "sc-yvbni2-6"
@@ -165,9 +169,10 @@ export const ActionsMenuBody = _ref => {
165
169
  ...props,
166
170
  children: [triggerComponent, /*#__PURE__*/_jsx(FloatingPortal, {
167
171
  root: getFloatingUiRootElement(actionMenu.refs.reference),
168
- children: /*#__PURE__*/_jsx(FloatingFocusManager, {
172
+ children: toggleState && /*#__PURE__*/_jsx(FloatingFocusManager, {
169
173
  context: actionMenu.context,
170
- modal: actionMenu.modal,
174
+ modal: false,
175
+ guards: false,
171
176
  children: /*#__PURE__*/_jsx(StyledActionsMenuContainer, {
172
177
  ref: ref,
173
178
  style: {
@@ -180,7 +185,6 @@ export const ActionsMenuBody = _ref => {
180
185
  children: /*#__PURE__*/_jsx(Menu, {
181
186
  menuWidth: menuWidth,
182
187
  isOpen: toggleState,
183
- role: "list",
184
188
  children: children
185
189
  })
186
190
  })
@@ -36,7 +36,9 @@ export default function useActionMenu(_ref) {
36
36
  enabled: !isTooltip && controlledOpen == null
37
37
  });
38
38
  const dismiss = useDismiss(context);
39
- const role = useRole(context);
39
+ const role = useRole(context, {
40
+ role: "menu"
41
+ });
40
42
  const interactions = useInteractions([click, dismiss, role]);
41
43
  const Arrow = useCallback(() => /*#__PURE__*/_jsx(FloatingArrow, {
42
44
  ref: arrowRef,
@@ -17,18 +17,14 @@ const DIRECTIONS_MAP = {
17
17
  bottom: "bottom",
18
18
  bottomRight: "bottom-end"
19
19
  };
20
- const StyledPopoverContainer = styled.div.withConfig({
21
- displayName: "Popover__StyledPopoverContainer",
22
- componentId: "sc-1bwoak-0"
23
- })(["pointer-events:none;opacity:0;transition:all 300ms ease-in-out;transition-delay:300ms;&.visible{opacity:1;pointer-events:auto;}"]);
24
20
  const TooltipControl = styled.div.withConfig({
25
21
  displayName: "Popover__TooltipControl",
26
- componentId: "sc-1bwoak-1"
22
+ componentId: "sc-1bwoak-0"
27
23
  })(["border:none;background:none;padding:0;cursor:help;font-size:1em;color:", ";transition:", ";&:hover,&:focus{outline:0;color:", ";}"], props => props.active ? themeGet("colors.primary")(props) : themeGet("colors.black")(props), themeGet("transition.transitionDefault"), themeGet("colors.primary"));
28
24
  const StyledPopover = styled.div.withConfig({
29
25
  displayName: "Popover__StyledPopover",
30
- componentId: "sc-1bwoak-2"
31
- })(["font-size:", ";line-height:", ";font-weight:", ";text-align:", ";word-break:break-word;color:", ";outline:0;padding:", ";border-radius:", ";width:", ";background:", ";border:1px solid ", ";box-shadow:", ";user-select:", ";opacity:1;& a{font-size:", ";}&:before{content:\"\";z-index:2;height:0;width:0;border-style:solid;border-width:6px 6px 6px 0;border-color:transparent;border-right-color:", ";left:-5px;top:50%;margin-top:-6px;position:absolute;}&:after{content:\"\";z-index:1;position:absolute;border-color:transparent;border-right-color:", ";height:0;width:0;border-style:solid;border-width:6px 6px 6px 0;left:-6px;top:50%;margin-top:-6px;}&.top{&:before{left:50%;top:auto;margin-top:0;bottom:-8px;margin-left:-3px;transform:rotate(-90deg);}&:after{left:50%;top:auto;margin-top:0;bottom:-9px;margin-left:-3px;transform:rotate(-90deg);}}&.topRight,&.top-end{&:before{left:1px;top:auto;margin-top:0;bottom:-4px;margin-left:-5px;transform:rotate(-45deg);border-width:5px 10px 5px 0;}&:after{left:1px;top:auto;margin-top:0;bottom:-5px;margin-left:-6px;transform:rotate(-45deg);border-width:5px 10px 5px 0;}}&.bottomRight,&.bottom-end{&:before{left:1px;bottom:auto;margin-top:0;top:-4px;margin-left:-5px;transform:rotate(45deg);border-width:5px 10px 5px 0;}&:after{left:1px;bottom:auto;margin-top:0;top:-5px;margin-left:-6px;transform:rotate(45deg);border-width:5px 10px 5px 0;}}&.bottom{&:before{left:50%;top:-8px;margin-top:0;margin-left:-3px;transform:rotate(90deg);}&:after{left:50%;top:-9px;margin-top:0;margin-left:-3px;transform:rotate(90deg);}}&.bottomLeft,&.bottom-start{&:before{right:1px;left:auto;bottom:auto;margin-top:0;top:-4px;margin-right:-5px;transform:rotate(135deg);border-width:5px 10px 5px 0;}&:after{right:1px;left:auto;bottom:auto;margin-top:0;top:-5px;margin-right:-6px;transform:rotate(135deg);border-width:5px 10px 5px 0;}}&.left{&:before{left:auto;right:-5px;transform:rotate(180deg);}&:after{left:auto;right:-6px;transform:rotate(180deg);top:50%;margin-top:-6px;}}&.topLeft,&.top-start{&:before{right:1px;left:auto;top:auto;margin-top:0;bottom:-4px;margin-right:-5px;transform:rotate(225deg);border-width:5px 10px 5px 0;}&:after{right:1px;left:auto;top:auto;margin-top:0;bottom:-5px;margin-right:-6px;transform:rotate(225deg);border-width:5px 10px 5px 0;}}"], themeGet("fontSizes.0"), themeGet("fontSizes.1"), themeGet("fontWeights.1"), props => props.textAlign ? props.textAlign : "left", themeGet("colors.greyDarkest"), themeGet("space.3"), themeGet("radii.1"), props => props.width ? props.width : "200px", themeGet("colors.white"), themeGet("colors.greyLight"), themeGet("shadows.boxDefault"), props => props.enableSelectAll ? "all" : "auto", themeGet("fontSizes.0"), themeGet("colors.white"), themeGet("colors.grey"));
26
+ componentId: "sc-1bwoak-1"
27
+ })(["font-size:", ";line-height:", ";font-weight:", ";text-align:", ";word-break:break-word;color:", ";outline:0;padding:", ";border-radius:", ";width:", ";background:", ";border:1px solid ", ";box-shadow:", ";user-select:", ";pointer-events:none;opacity:0;&.visible{opacity:1;pointer-events:auto;}& a{font-size:", ";}&:before{content:\"\";z-index:2;height:0;width:0;border-style:solid;border-width:6px 6px 6px 0;border-color:transparent;border-right-color:", ";left:-5px;top:50%;margin-top:-6px;position:absolute;}&:after{content:\"\";z-index:1;position:absolute;border-color:transparent;border-right-color:", ";height:0;width:0;border-style:solid;border-width:6px 6px 6px 0;left:-6px;top:50%;margin-top:-6px;}&.top{&:before{left:50%;top:auto;margin-top:0;bottom:-8px;margin-left:-3px;transform:rotate(-90deg);}&:after{left:50%;top:auto;margin-top:0;bottom:-9px;margin-left:-3px;transform:rotate(-90deg);}}&.topRight,&.top-end{&:before{left:1px;top:auto;margin-top:0;bottom:-4px;margin-left:-5px;transform:rotate(-45deg);border-width:5px 10px 5px 0;}&:after{left:1px;top:auto;margin-top:0;bottom:-5px;margin-left:-6px;transform:rotate(-45deg);border-width:5px 10px 5px 0;}}&.bottomRight,&.bottom-end{&:before{left:1px;bottom:auto;margin-top:0;top:-4px;margin-left:-5px;transform:rotate(45deg);border-width:5px 10px 5px 0;}&:after{left:1px;bottom:auto;margin-top:0;top:-5px;margin-left:-6px;transform:rotate(45deg);border-width:5px 10px 5px 0;}}&.bottom{&:before{left:50%;top:-8px;margin-top:0;margin-left:-3px;transform:rotate(90deg);}&:after{left:50%;top:-9px;margin-top:0;margin-left:-3px;transform:rotate(90deg);}}&.bottomLeft,&.bottom-start{&:before{right:1px;left:auto;bottom:auto;margin-top:0;top:-4px;margin-right:-5px;transform:rotate(135deg);border-width:5px 10px 5px 0;}&:after{right:1px;left:auto;bottom:auto;margin-top:0;top:-5px;margin-right:-6px;transform:rotate(135deg);border-width:5px 10px 5px 0;}}&.left{&:before{left:auto;right:-5px;transform:rotate(180deg);}&:after{left:auto;right:-6px;transform:rotate(180deg);top:50%;margin-top:-6px;}}&.topLeft,&.top-start{&:before{right:1px;left:auto;top:auto;margin-top:0;bottom:-4px;margin-right:-5px;transform:rotate(225deg);border-width:5px 10px 5px 0;}&:after{right:1px;left:auto;top:auto;margin-top:0;bottom:-5px;margin-right:-6px;transform:rotate(225deg);border-width:5px 10px 5px 0;}}"], themeGet("fontSizes.0"), themeGet("fontSizes.1"), themeGet("fontWeights.1"), props => props.textAlign ? props.textAlign : "left", themeGet("colors.greyDarkest"), themeGet("space.3"), themeGet("radii.1"), props => props.width ? props.width : "200px", themeGet("colors.white"), themeGet("colors.greyLight"), themeGet("shadows.boxDefault"), props => props.enableSelectAll ? "all" : "auto", themeGet("fontSizes.0"), themeGet("colors.white"), themeGet("colors.grey"));
32
28
  export default function Popover(_ref) {
33
29
  var _children$type, _context$refs;
34
30
  let {
@@ -66,7 +62,11 @@ export default function Popover(_ref) {
66
62
  });
67
63
  const hover = useHover(context, {
68
64
  move: false,
69
- handleClose: safePolygon()
65
+ handleClose: safePolygon(),
66
+ delay: {
67
+ open: 400,
68
+ close: 0
69
+ }
70
70
  });
71
71
  const focus = useFocus(context);
72
72
  const dismiss = useDismiss(context);
@@ -79,7 +79,8 @@ export default function Popover(_ref) {
79
79
  } = useInteractions([hover, focus, dismiss, role]);
80
80
  const triggerProps = {
81
81
  ...getReferenceProps({
82
- ref: refs.setReference
82
+ ref: refs.setReference,
83
+ "aria-describedby": context.floatingId
83
84
  })
84
85
  };
85
86
  let triggerComponent = null;
@@ -108,27 +109,24 @@ export default function Popover(_ref) {
108
109
  children: [triggerComponent, /*#__PURE__*/_jsx(FloatingPortal, {
109
110
  root: getFloatingUiRootElement(context.refs.reference),
110
111
  preserveTabOrder: true,
111
- children: text && /*#__PURE__*/_jsx(StyledPopoverContainer, {
112
- className: "Tooltip popover ".concat(visible ? "visible" : ""),
113
- ref: refs.setFloating,
114
- style: {
115
- ...floatingStyles,
116
- zIndex: getFloatingUiZIndex(context.refs.reference)
117
- },
118
- ...getFloatingProps(),
119
- children: /*#__PURE__*/_jsx(FloatingFocusManager, {
120
- initialFocus: (_context$refs = context.refs) === null || _context$refs === void 0 ? void 0 : _context$refs.reference,
121
- context: context,
122
- modal: false,
123
- children: /*#__PURE__*/_jsx(StyledPopover, {
124
- className: "".concat(directionClass),
125
- role: "tooltip",
126
- textAlign: textAlign,
127
- width: width,
128
- enableSelectAll: enableSelectAll,
129
- ariaLabel: ariaLabel,
130
- children: text
131
- })
112
+ children: text && visible && /*#__PURE__*/_jsx(FloatingFocusManager, {
113
+ initialFocus: (_context$refs = context.refs) === null || _context$refs === void 0 ? void 0 : _context$refs.reference,
114
+ context: context,
115
+ modal: false,
116
+ children: /*#__PURE__*/_jsx(StyledPopover, {
117
+ "aria-hidden": "false",
118
+ textAlign: textAlign,
119
+ width: width,
120
+ enableSelectAll: enableSelectAll,
121
+ className: "Tooltip popover ".concat(visible ? "visible" : "", " ").concat(directionClass),
122
+ ref: refs.setFloating,
123
+ style: {
124
+ ...floatingStyles,
125
+ zIndex: getFloatingUiZIndex(context.refs.reference)
126
+ },
127
+ ...getFloatingProps(),
128
+ ariaLabel: ariaLabel,
129
+ children: text
132
130
  })
133
131
  })
134
132
  })]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orcs-design-system",
3
- "version": "3.2.19",
3
+ "version": "3.2.20",
4
4
  "engines": {
5
5
  "node": "20.12.2"
6
6
  },