@zendeskgarden/react-tooltips 9.0.0-next.22 → 9.0.0-next.24

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.
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
10
10
  const COMPONENT_ID = 'tooltip.paragraph';
11
11
  const StyledParagraph = styled.p.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.22'
13
+ 'data-garden-version': '9.0.0-next.24'
14
14
  }).withConfig({
15
15
  displayName: "StyledParagraph",
16
16
  componentId: "sc-wuqkfc-0"
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
10
10
  const COMPONENT_ID = 'tooltip.title';
11
11
  const StyledTitle = styled.strong.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.22'
13
+ 'data-garden-version': '9.0.0-next.24'
14
14
  }).withConfig({
15
15
  displayName: "StyledTitle",
16
16
  componentId: "sc-vnjcvz-0"
@@ -54,8 +54,16 @@ const sizeStyles = _ref => {
54
54
  titleDisplay = 'block';
55
55
  }
56
56
  let arrowSize;
57
+ let arrowShift;
57
58
  if (hasArrow) {
58
- if (size === 'small' || size === 'medium') {
59
+ if (size === 'small') {
60
+ arrowSize = margin;
61
+ if (['left-start', 'left-end', 'right-start', 'right-end'].includes(placement)) {
62
+ arrowShift = `-${theme.borderRadii.md}px`;
63
+ } else {
64
+ arrowShift = '0';
65
+ }
66
+ } else if (size === 'medium') {
59
67
  arrowSize = margin;
60
68
  } else if (size === 'large') {
61
69
  margin = `${theme.space.base * 2}px`;
@@ -66,7 +74,8 @@ const sizeStyles = _ref => {
66
74
  }
67
75
  }
68
76
  return css(["margin:", ";border-radius:", ";padding:", ";max-width:", ";line-height:", ";word-wrap:", ";white-space:", ";font-size:", ";overflow-wrap:", ";", ";", "{margin-top:", ";}", "{display:", ";}"], margin, borderRadius, padding, maxWidth, lineHeight, wordWrap, whiteSpace, fontSize, overflowWrap, hasArrow && arrowStyles(getArrowPosition(theme, placement), {
69
- size: arrowSize
77
+ size: arrowSize,
78
+ shift: arrowShift
70
79
  }), StyledParagraph, paragraphMarginTop, StyledTitle, titleDisplay);
71
80
  };
72
81
  const colorStyles = _ref2 => {
@@ -125,7 +134,7 @@ const colorStyles = _ref2 => {
125
134
  };
126
135
  const StyledTooltip = styled.div.attrs({
127
136
  'data-garden-id': COMPONENT_ID,
128
- 'data-garden-version': '9.0.0-next.22'
137
+ 'data-garden-version': '9.0.0-next.24'
129
138
  }).withConfig({
130
139
  displayName: "StyledTooltip",
131
140
  componentId: "sc-gzzjq4-0"
package/dist/index.cjs.js CHANGED
@@ -25,7 +25,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
25
25
  const COMPONENT_ID$2 = 'tooltip.paragraph';
26
26
  const StyledParagraph = styled__default.default.p.attrs({
27
27
  'data-garden-id': COMPONENT_ID$2,
28
- 'data-garden-version': '9.0.0-next.22'
28
+ 'data-garden-version': '9.0.0-next.24'
29
29
  }).withConfig({
30
30
  displayName: "StyledParagraph",
31
31
  componentId: "sc-wuqkfc-0"
@@ -37,7 +37,7 @@ StyledParagraph.defaultProps = {
37
37
  const COMPONENT_ID$1 = 'tooltip.title';
38
38
  const StyledTitle = styled__default.default.strong.attrs({
39
39
  'data-garden-id': COMPONENT_ID$1,
40
- 'data-garden-version': '9.0.0-next.22'
40
+ 'data-garden-version': '9.0.0-next.24'
41
41
  }).withConfig({
42
42
  displayName: "StyledTitle",
43
43
  componentId: "sc-vnjcvz-0"
@@ -91,8 +91,16 @@ const sizeStyles = _ref => {
91
91
  titleDisplay = 'block';
92
92
  }
93
93
  let arrowSize;
94
+ let arrowShift;
94
95
  if (hasArrow) {
95
- if (size === 'small' || size === 'medium') {
96
+ if (size === 'small') {
97
+ arrowSize = margin;
98
+ if (['left-start', 'left-end', 'right-start', 'right-end'].includes(placement)) {
99
+ arrowShift = `-${theme.borderRadii.md}px`;
100
+ } else {
101
+ arrowShift = '0';
102
+ }
103
+ } else if (size === 'medium') {
96
104
  arrowSize = margin;
97
105
  } else if (size === 'large') {
98
106
  margin = `${theme.space.base * 2}px`;
@@ -103,7 +111,8 @@ const sizeStyles = _ref => {
103
111
  }
104
112
  }
105
113
  return styled.css(["margin:", ";border-radius:", ";padding:", ";max-width:", ";line-height:", ";word-wrap:", ";white-space:", ";font-size:", ";overflow-wrap:", ";", ";", "{margin-top:", ";}", "{display:", ";}"], margin, borderRadius, padding, maxWidth, lineHeight, wordWrap, whiteSpace, fontSize, overflowWrap, hasArrow && reactTheming.arrowStyles(reactTheming.getArrowPosition(theme, placement), {
106
- size: arrowSize
114
+ size: arrowSize,
115
+ shift: arrowShift
107
116
  }), StyledParagraph, paragraphMarginTop, StyledTitle, titleDisplay);
108
117
  };
109
118
  const colorStyles = _ref2 => {
@@ -162,7 +171,7 @@ const colorStyles = _ref2 => {
162
171
  };
163
172
  const StyledTooltip = styled__default.default.div.attrs({
164
173
  'data-garden-id': COMPONENT_ID,
165
- 'data-garden-version': '9.0.0-next.22'
174
+ 'data-garden-version': '9.0.0-next.24'
166
175
  }).withConfig({
167
176
  displayName: "StyledTooltip",
168
177
  componentId: "sc-gzzjq4-0"
@@ -37,30 +37,7 @@ export declare const TooltipComponent: {
37
37
  /**
38
38
  * @extends HTMLAttributes<HTMLDivElement>
39
39
  */
40
- export declare const Tooltip: {
41
- ({ id, delayMS, isInitialVisible, content, refKey, placement: _placement, children, hasArrow, size, type, appendToNode, zIndex, isVisible: externalIsVisible, onFocus, onBlur, ...props }: ITooltipProps): React.JSX.Element;
42
- displayName: string;
43
- propTypes: {
44
- appendToNode: PropTypes.Requireable<any>;
45
- hasArrow: PropTypes.Requireable<boolean>;
46
- delayMS: PropTypes.Requireable<number>;
47
- id: PropTypes.Requireable<string>;
48
- content: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
49
- placement: PropTypes.Requireable<"top" | "auto" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "end" | "end-top" | "end-bottom" | "start" | "start-top" | "start-bottom">;
50
- size: PropTypes.Requireable<"small" | "medium" | "large" | "extra-large">;
51
- type: PropTypes.Requireable<"light" | "dark">;
52
- zIndex: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
53
- isInitialVisible: PropTypes.Requireable<boolean>;
54
- refKey: PropTypes.Requireable<string>;
55
- };
56
- defaultProps: {
57
- hasArrow: boolean;
58
- type: string;
59
- placement: string;
60
- delayMS: number;
61
- refKey: string;
62
- };
63
- } & {
40
+ export declare const Tooltip: typeof TooltipComponent & {
64
41
  Paragraph: typeof Paragraph;
65
42
  Title: typeof Title;
66
43
  };
@@ -13,4 +13,4 @@ import { ITooltipProps } from '../types';
13
13
  *
14
14
  * @returns A tooltip size.
15
15
  */
16
- export declare const toSize: (size: ITooltipProps['size'], type: ITooltipProps['type']) => "small" | "medium" | "large" | "extra-large";
16
+ export declare const toSize: (size: ITooltipProps["size"], type: ITooltipProps["type"]) => "small" | "medium" | "large" | "extra-large";
@@ -5,5 +5,5 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  export declare const StyledTooltipWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
8
- zIndex?: string | number | undefined;
8
+ zIndex?: number | string;
9
9
  }, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-tooltips",
3
- "version": "9.0.0-next.22",
3
+ "version": "9.0.0-next.24",
4
4
  "description": "Collection of components and render prop containers relating to Tooltips in the Garden Design System",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -30,12 +30,12 @@
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@zendeskgarden/react-theming": ">=9.0.0-next",
33
- "react": ">=16.8.0",
34
- "react-dom": ">=16.8.0",
33
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
34
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
35
35
  "styled-components": "^5.3.1"
36
36
  },
37
37
  "devDependencies": {
38
- "@zendeskgarden/react-theming": "^9.0.0-next.22"
38
+ "@zendeskgarden/react-theming": "^9.0.0-next.24"
39
39
  },
40
40
  "keywords": [
41
41
  "components",
@@ -47,5 +47,5 @@
47
47
  "access": "public"
48
48
  },
49
49
  "zendeskgarden:src": "src/index.ts",
50
- "gitHead": "46309385a1495c2297da23409f4196f662fe418b"
50
+ "gitHead": "36ac3913276188edf8d187a9861be7ba765e487a"
51
51
  }